text: "use strict";!function($jsRoot){function emptyFunction(){}function __$A__(e){if(!e)return[];if(e.toArray)return e.toArray();for(var t=e.length||0,r=new Array(t);t--;)r[t]=e[t];return r}"object"==typeof self?$jsRoot=self:"object"==typeof window&&window.document?$jsRoot=window:"object"==typeof global&&($jsRoot=global);var Class={createCore:function(){var e=null,t=__$A__(arguments);if(!t[0]&&t.length>1){var r=t[1],n=r&&r.CLASS_NAME;throw"Can not create new class"+(n?" "+n:"")+" , base class not found"}function i(){this.initialize.apply(this,arguments)}if(Object.isFunction(t[0])&&(e=t.shift()),Object.extend(i,Class.Methods),i.superclass=e,i.subclasses=[],e){var a=function(){};a.prototype=e.prototype,i.prototype=new a,e.subclasses.push(i)}for(var o=0;o<t.length;o++)i.addMethods(t[o]);return i.prototype.initialize||(i.prototype.initialize=emptyFunction),i.prototype.constructor=i,i},create:function(){return Class.createCore.apply(this,arguments)},free:function(e){e.finalize&&e.finalize(),e=null}};Class.Methods={addMethods:function(e){if(!e)return this;var t=this.superclass&&this.superclass.prototype,r=Object.keys(e);Object.keys({toString:!0}).length||r.push("toString","valueOf");for(var n=function(){},i=0,a=r.length;i<a;i++){var o=r[i],s=e[o],l=Object.isFunction(s);if(t&&l&&"$super"===FunctionUtils.argumentNames(s)[0]){var u=s;(s=function(e){return function(){return(t[e]||n).apply(this,arguments)}}(o).wrap(u)).valueOf=u.valueOf.bind(u),s.toString=u.toString.bind(u)}this.prototype[o]=s}return this}},Object.extend=function(e,t,r,n){if(r||n)for(var i in t){var a=t[i];r&&null==a||(n&&""===a||(e[i]=a))}else for(var i in t)e[i]=t[i];return e},Object.extendEx=function(e,t,r){var n=r||{};for(var i in t){var a=t[i];if((!n.ignoreUnsetValue||null!=a)&&(!n.ignoreEmptyString||""!==a)){var o=e[i];if(!r.preserveExisted||!o){var s=o&&o.constructor&&o.constructor.prototype,l=a&&a.constructor&&a.constructor.prototype;o&&"object"==typeof o&&s===l?Object.extendEx(o,a,r):e[i]=a}}}return e},Object._extendSupportMethods=function(e,t){return Object.extendEx(e,t,{ignoreUnsetValue:!0,preserveExisted:!0})},Object.getCascadeFieldValue=function(e,t){var r,n;if(n=e.length&&e.splice?e:e.split("."),!t)t=$jsRoot||this;for(var i=0,a=n.length;i<a&&(r=t[n[i]]);++i)t=r;return r},Object.setCascadeFieldValue=function(e,t,r,n){for(var i,a=r,o=0,s=(i=e.length&&e.splice?e:e.split(".")).length;o<s;++o){var l=i[o];if(o===s-1)return a[l]=t,t;var u=a[l];if(!u&&n&&(u={},a[l]=u),!u)return!1;a=u}},Object._inherit=function(e){null===e&&(e={});var t=typeof e;if(!DataType.isFunctionType(t)&&!DataType.isObjectType(t))throw TypeError();function r(){}return r.prototype=e,new r},Object.create||(Object.create=Object._inherit),Object.copyValues=function(e,t,r){if(r){for(var n=0,i=r.length;n<i;++n){var a=r[n],o=t[a];void 0!==o&&(e[a]=o)}return e}return Object.extend(e,t)},Object._extendSupportMethods(Object,{keys:function(e){var t=[];for(var r in e)t.push(r);return t},isFunction:function(e){return"function"==typeof e},isUndefined:function(e){return void 0===e}}),Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){var t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(r);return t});var FunctionUtils={argumentNames:function(e){var t=((e.toString().match(/^[\s\(]*function[^(]*\(([^\)]*)\)/)||[])[1]||"").replace(/\s+/g,"").split(",");return 1!=t.length||t[0]?t:[]}};Object._extendSupportMethods(Function.prototype,{argumentNames:function(){var e=this.toString().match(/^[\s\(]*function[^(]*\(([^\)]*)\)/)[1].replace(/\s+/g,"").split(",");return 1!=e.length||e[0]?e:[]},wrap:function(e){var t=this;return function(){return e.apply(this,[t.bind(this)].concat(__$A__(arguments)))}},methodize:function(){if(this._methodized)return this._methodized;var e=this;return this._methodized=function(){var t=Array.prototype.slice.call(arguments);return t.unshift(this),e.apply(null,t)}},bind:function(){if(arguments.length<2&&Object.isUndefined(arguments[0]))return this;var e=this,t=__$A__(arguments),r=t.shift();return function(){return e.apply(r,t.concat(__$A__(arguments)))}},delay:function(){var e=this,t=__$A__(arguments),r=t.shift();return window.setTimeout(function(){return e.apply(e,t)},r)},defer:function(){var e=this,t=__$A__(arguments);t.shift();return window.setTimeout(function(){return e.apply(e,t)},10)}}),Array.prototype.indexOf||(Array.prototype.indexOf=function(e,t){t||(t=0);var r=this.length;for(t<0&&(t=r+t);t<r;t++)if(this[t]===e)return t;return-1}),Array.prototype.lastIndexOf||(Array.prototype.lastIndexOf=function(e,t){t=isNaN(t)?this.length:(t<0?this.length+t:t)+1;var r=this.slice(0,t).reverse().indexOf(e);return r<0?r:t-r-1}),Object._extendSupportMethods(String.prototype,{gsub:function(e,t){for(var r="",n=this;n.length>0;)void 0===n.match(e)?(r+=n.slice(0,(void 0).index),r+=t,n=n.slice((void 0).index+(void 0)[0].length)):(r+=n,n="");return r},sub:function(e,t,r){return r=Object.isUndefined(r)?1:r,this.gsub(e,function(e){return--r<0?e[0]:t(e)})},scan:function(e,t){return this.gsub(e,t),String(this)},truncate:function(e,t){return e=e||30,t=Object.isUndefined(t)?"...":t,this.length>e?this.slice(0,e-t.length)+t:String(this)},strip:function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"")},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")},extractScripts:function(){var e=new RegExp(Prototype.ScriptFragment,"img"),t=new RegExp(Prototype.ScriptFragment,"im");return(this.match(e)||[]).map(function(e){return(e.match(t)||["",""])[1]})},evalScripts:function(){return this.extractScripts().map(function(script){return eval(script)})},escapeHTML:function(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"<br />")},unescapeHTML:function(){return this.replace(/\<br \/\>/g,"\n").replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">")},toQueryParams:function(e){var t=this.strip().match(/([^?#]*)(#.*)?$/);return t?t[1].split(e||"&").inject({},function(e,t){if((t=t.split("="))[0]){var r=decodeURIComponent(t.shift()),n=t.length>1?t.join("="):t[0];null!=n&&(n=decodeURIComponent(n)),r in e?(Object.isArray(e[r])||(e[r]=[e[r]]),e[r].push(n)):e[r]=n}return e}):{}},toArray:function(){return this.split("")},succ:function(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)},times:function(e){return e<1?"":new Array(e+1).join(this)},camelize:function(){var e=this.split("-"),t=e.length;if(1==t)return e[0];for(var r="-"==this.charAt(0)?e[0].charAt(0).toUpperCase()+e[0].substring(1):e[0],n=1;n<t;n++)r+=e[n].charAt(0).toUpperCase()+e[n].substring(1);return r},capitalize:function(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()},capitalizeFirst:function(){return this.charAt(0).toUpperCase()+this.substring(1)},underscore:function(){return this.gsub(/::/,"/").gsub(/([A-Z]+)([A-Z][a-z])/,"#{1}_#{2}").gsub(/([a-z\d])([A-Z])/,"#{1}_#{2}").gsub(/-/,"_").toLowerCase()},dasherize:function(){return this.gsub(/_/,"-")},inspect:function(e){var t=this.gsub(/[\x00-\x1f\\]/,function(e){var t=String.specialChar[e[0]];return t||"\\u00"+e[0].charCodeAt().toPaddedString(2,16)});return e?'"'+t.replace(/"/g,'\\"')+'"':"'"+t.replace(/'/g,"\\'")+"'"},toJSON:function(){return this.inspect(!0)},unfilterJSON:function(e){return this.sub(e||Prototype.JSONFilter,"#{1}")},isJSON:function(){var e=this;return!e.blank()&&(e=this.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,""),/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/.test(e))},evalJSON:function(sanitize){var json=this.unfilterJSON();try{if(!sanitize||json.isJSON())return eval("("+json+")")}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect())},include:function(e){return this.indexOf(e)>-1},startsWith:function(e){return 0===this.indexOf(e)},endsWith:function(e){var t=this.length-e.length;return t>=0&&this.lastIndexOf(e)===t},empty:function(){return""==this},blank:function(){return/^\s*$/.test(this)},interpolate:function(e,t){return new Template(this,t).evaluate(e)}}),Object._extendSupportMethods(String.prototype,{upperFirst:function(){return this.charAt(0).toUpperCase()+this.substring(1)},format:function(){for(var e=this,t=0;t<arguments.length;t++){var r=new RegExp("\\{"+t+"\\}","gi");e=e.replace(r,arguments[t])}return e},trim:function(){return this.replace(/^\s*|\s*$/g,"")},ltrim:function(){return this.replace(/^\s+/,"")},rtrim:function(){return this.replace(/\s+$/,"")},trimLeft:function(){return this.ltrim()},trimRight:function(){return this.rtrim()},pad:function(e,t,r){for(var n=t||" ",i=[],a=0,o=e-this.length;a<o;++a)i.push(n);return r?this+i.join(""):i.join("")+this},lpad:function(e,t){return this.pad(e,t,!1)},rpad:function(e,t){return this.pad(e,t,!0)},reverse:function(){for(var e=[],t=this.length-1;t>=0;--t)e.push(this.charAt(t));return e.join("")},toCharArray:function(){for(var e=[],t=0,r=this.length;t<r;++t)e.push(this.charAt(t));return e},hyphenize:function(e){e||(e="-");for(var t=this.length,r=[],n=0;n<t;++n){var i=this.charAt(n);0!==n&&i>="A"&&i<="Z"?r.push(e+i.toLowerCase()):r.push(i)}return r.join("")}});var StringUtils={STRUE:"$TRUE",SFALSE:"$FALSE",SUNDEFINED:"$UNDEFINED",SNULL:"$NULL",SNAN:"$NAN",SPOSITIVE:"+",SNEGATIVE:"-",SDATEPREFIX:"@",isAllDigitalChar:function(e){for(var t=0,r=e.length;t<r;++t){var n=e.charAt(t);if(!(n>="0"&&n<="9")&&"."!=n)return!1}return!0},isNumbericStr:function(e){var t=Number(e);return!isNaN(t)},serializeValue:function(e,t){var r=t||[],n=DataType.getType(e);if(r.indexOf(n)>=0)return e.toString();if(null===e)return StringUtils.SNULL;if(void 0===e)return StringUtils.SUNDEFINED;if(e!=e)return StringUtils.SNAN;switch(n){case"boolean":return e?StringUtils.STRUE:StringUtils.SFALSE;case"number":case DataType.INT:case DataType.FLOAT:return(e>=0?StringUtils.SPOSITIVE:"")+e;case DataType.DATE:return StringUtils.SDATEPREFIX+e.toString();default:return e.toString()}},deserializeValue:function(e,t){if("string"!=typeof e)return e;switch(e){case StringUtils.STRUE:return!0;case StringUtils.SFALSE:return!1;case StringUtils.SNULL:return null;case StringUtils.SUNDEFINED:return;case StringUtils.SNAN:return NaN;default:if(t)switch(t){case DataType.FLOAT:return parseFloat(e);case DataType.INT:return parseInt(e);case"number":return parseFloat(e);case"boolean":return!!e;default:return e}else switch(e.charAt(0)){case StringUtils.SPOSITIVE:case StringUtils.SNEGATIVE:var r=e.substring(1);return StringUtils.isNumbericStr(r)?parseFloat(e):e;case StringUtils.SDATEPREFIX:r=e.substr(1);try{var n=new Date(r);return isNaN(n.getTime())?e:n}catch(t){return e}default:return e}}}};Object.extend(Date.prototype,{copyFrom:function(e){this.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),this.setTime(e.getTime())}}),Math.sqr||(Math.sqr=function(e){return e*e}),Math.sign||(Math.sign=function(e){return e>0?1:e<0?-1:0}),$jsRoot.Node||($jsRoot.Node={}),$jsRoot.Node.ELEMENT_NODE||Object.extend($jsRoot.Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12}),Class.PropertyScope={DEFAULT:3,PUBLISHED:3,PUBLIC:2,PRIVATE:1},Class.PropList=function(){this.props=[]},Class.PropList.prototype={addProperty:function(e,t){var r;return t||(t={}),(r=this.getPropInfo(e))||(r={},this.props.push(r)),void 0===(r=Object.extend(r,t)).serializable&&(r.serializable=!0),r.name=e,r},removeProperty:function(e){var t=this.indexOf(e);t>=0&&this.props.splice(t,1)},removePropAt:function(e){e>=0&&(this.props[e]&&this.props.splice(e,1))},getLength:function(){return this.props.length},indexOf:function(e){for(var t=0,r=this.props.length;t<r;++t)if(this.props[t].name===e)return t;return-1},getPropInfoAt:function(e){return e>=0?this.props[e]:null},getPropInfo:function(e){var t=this.indexOf(e);return this.getPropInfoAt(t)},hasProperty:function(e){return this.indexOf(e)>=0},clear:function(){this.props.clear()},clone:function(){var e=new Class.PropList;return e.props=this.props.slice(),e},appendList:function(e){for(var t=0,r=e.props.length;t<r;++t)this.props.push(e.props[t])}},Class.PropList.prototype.constructor=Class.PropList,Class.EventHandlerList=function(){this.handlers=[],this._$flag_="KekuleEventList"},Class.EventHandlerList.prototype={add:function(e,t){t||(t=null),this.handlers.push({thisArg:t,handler:e})},remove:function(e,t){var r=this.indexesOf(e,t);if(r.length>0)for(var n=r.length-1;n>=0;--n)this.removeAt(r[n])},removeAt:function(e){for(var t=e,r=this.handlers.length;t<r;++t)this.handlers[t]=this.handlers[t+1];this.handlers.length=this.handlers.length-1},clear:function(){this.handlers=[]},getHandlerInfo:function(e){return this.handlers[e]},indexOf:function(e,t){for(var r=0,n=this.handlers.length;r<n;++r)if(this.handlers[r].handler==e){if(void 0!==t&&this.handlers[r].thisArg===t)return r;if(void 0===t)return r}return-1},indexesOf:function(e,t){for(var r=[],n=0,i=this.handlers.length;n<i;++n)this.handlers[n].handler==e&&(void 0!==t&&this.handlers[n].thisArg===t?r.push(n):void 0===t&&r.push(n));return r},getLength:function(){return this.handlers.length}},Class.EventHandlerList.constructor=Class.EventHandlerList;var DataType={UNKNOWN:null,VARIANT:null,PRIMARY:"primary",UNDEFINED:"undefined",BOOL:"boolean",BOOLEAN:"boolean",NUMBER:"number",INT:"int",INTEGER:"int",FLOAT:"float",STRING:"string",ARRAY:"array",FUNCTION:"function",DATE:"date",HASH:"object",OBJECT:"object",OBJECTEX:"objectex",CLASS:"class",isSimpleType:function(e){return e==DataType.STRING||e==DataType.NUMBER||e==DataType.INT||e==DataType.FLOAT||e==DataType.BOOL||e==DataType.UNDEFINED||e==DataType.PRIMARY},isComplexType:function(e){return!(DataType.isSimpleType(e)||DataType.isFunctionType(e))},isFunctionType:function(e){return e==DataType.FUNCTION},isObjectType:function(e){return e==DataType.OBJECT},isDateType:function(e){return e==DataType.DATE},isObjectExType:function(e){var t=DataType.isComplexType(e)&&!DataType.isObjectType(e)&&!DataType.isDateType(e);if(t){var r=ClassEx.findClass(e);t=r&&ClassEx.isOrIsDescendantOf(r,ObjectEx)}return t},getType:function(e){var t=typeof e;switch(t){case"undefined":return DataType.UNDEFINED;case"function":return DataType.FUNCTION;case"boolean":return DataType.BOOL;case"string":return DataType.STRING;case"number":return Math.floor(e)==e?DataType.INT:DataType.FLOAT;case"object":return this.isDateValue(e)?DataType.DATE:DataType.isArrayValue(e)?DataType.ARRAY:ClassEx.isClass(e)?DataType.CLASS:DataType.isObjectExValue(e)&&e.getClassName?e.getClassName():DataType.OBJECT;default:return t}},isSimpleValue:function(e){return DataType.isSimpleType(typeof e)},isUndefinedValue:function(e){return void 0===e},isNullValue:function(e){return null===e},isFunctionValue:function(e){return"function"==typeof e},isObjectValue:function(e){return!!e&&("object"==typeof e&&!DataType.isArrayValue(e)&&!DataType.isDateValue(e))},isDateValue:function(e){return!!e&&("object"==typeof e&&void 0!==e.getFullYear)},isArrayValue:function(e){return!!e&&("object"==typeof e&&void 0!==e.length)},isObjectExValue:function(e){return e instanceof ObjectEx},createInstance:function(e){switch(e){case DataType.UNDEFINED:return;case DataType.DATE:return new Date;case DataType.ARRAY:return new Array;case DataType.OBJECT:return new Object;case DataType.FUNCTION:return new Function;default:return new(ClassEx.findClass(e.capitalizeFirst()))}}},__definePropertyAvailable__=Object.defineProperty&&function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}(),ClassEx={isClass:function(e){return!!e&&!(!e.superclass&&!e.subclasses)},findClass:function(e,t){return Object.getCascadeFieldValue(e,t||$jsRoot)},getClassName:function(e){return e?e.prototype.CLASS_NAME:null},getClassLocalName:function(e){var t=ClassEx.getClassName(e),r=t.lastIndexOf(".");return r>=0?t.substring(r+1):t},getPrototype:function(e){return e.prototype},getSuperClass:function(e){return e.superclass||e.constructor.superclass},getSuperClassPrototype:function(e){return e.superclass?e.superclass.prototype:null},_getCommonSuperClass2:function(e,t){for(var r=e;r&&!ClassEx.isOrIsDescendantOf(t,r);)r=ClassEx.getSuperClass(r);return r},getCommonSuperClass:function(e){if(!e||!e.length)return null;var t=e[0].getClass?e[0].getClass():null;if(!t)return null;for(var r=1,n=e.length;r<n;++r){var i=e[r].getClass?e[r].getClass():null;if(!i)return null;t=ClassEx._getCommonSuperClass2(t,i)}return t},isDescendantOf:function(e,t){for(var r=ClassEx.getSuperClass(e);r&&r!==t;)r=ClassEx.getSuperClass(r);return!!r},isOrIsDescendantOf:function(e,t){return e===t||ClassEx.isDescendantOf(e,t)},isOrIsDescendantOfClasses:function(e,t){for(var r=0,n=t.length;r<n;++r)if(ClassEx.isOrIsDescendantOf(e,t[r]))return!0;return!1},_ensurePropertySystem:function(e){var t=ClassEx.getPrototype(e);if(t&&!t.hasOwnProperty("properties")){var r=ClassEx.getSuperClass(e);r&&ClassEx._ensurePropertySystem(r),ClassEx._createPropertyList(e),ClassEx._remapPropGetters(e),t.hasOwnProperty("initProperties")&&t.initProperties.apply(t)}},_createPropertyList:function(e){ClassEx.getPrototype(e).hasOwnProperty("properties")||(ClassEx.getPrototype(e).properties=new Class.PropList)},_remapPropGetters:function(e,t){for(var r=ClassEx.getPrototype(e),n=t||Object.getOwnPropertyNames(r),i=0,a=n.length;i<a;++i){var o=n[i];if(o.length>5&&o.startsWith("doGet")){var s=r[o];if("function"==typeof s){var l=o.charAt(5).toLowerCase()+o.substr(6);if(r.hasDirectProperty(l))continue;var u=ClassEx.getPropInfo(e,l);if(u&&u.getter)if(r["get"+l.capitalizeFirst()]=s,__definePropertyAvailable__){var p=Object.extend({},u.descriptor);p.get=s;try{Object.defineProperty(r,l,p)}catch(e){throw e}}}}}},getOwnPropList:function(e){var t=ClassEx.getPrototype(e);return t?(t._initPropertySystem(),t.properties):null},getAllPropList:function(e){var t,r=ClassEx.getSuperClassPrototype(e);return r?(t=r.getAllPropList().clone()).appendList(ClassEx.getOwnPropList(e)):t=ClassEx.getOwnPropList(e),t},getPropListOfScopes:function(e,t){var r,n=function(e,t){var r=ClassEx.getOwnPropList(e).clone();if(r)for(var n=r.getLength()-1;n>=0;--n){var i=r.getPropInfoAt(n).scope||Class.PropertyScope.DEFAULT;t.indexOf(i)<0&&r.removePropAt(n)}return r},i=ClassEx.getSuperClass(e);return i?(r=ClassEx.getPropListOfScopes(i,t).clone()).appendList(n(e,t)):r=n(e,t),r},defineProp:function(e,t,r){return ClassEx._ensurePropertySystem(e),ClassEx.getPrototype(e).defineProp(t,r)},defineProps:function(e,t){ClassEx._ensurePropertySystem(e);for(var r=ClassEx.getPrototype(e),n=0,i=t.length;n<i;++n){var a=t[n],o=a.name,s=a;r.defineProp(o,s)}},getPropInfo:function(e,t,r){return ClassEx.getPrototype(e).getPropInfo(t,r)},defineEvent:function(e,t){return ClassEx.getPrototype(e).defineEvent(t)},getUnusedMethodName:function(e,t,r){for(var n=r||0,i=ClassEx.getPrototype(e),a=t+Number(n).toString();i[a];)++n,a=t+Number(n).toString();return a},extendMethod:function(e,t,r){var n=ClassEx.getPrototype(e),i=n[t],a=ClassEx.getUnusedMethodName(e,"__$changed$_"+t+"__");n[a]=i;var o,s=(o=a,function(){return n[o].apply(this,arguments)}).wrap(r);n[t]=s,s.valueOf=r.valueOf.bind(r),s.toString=r.toString.bind(r)},extend:function(e,t){var r=ClassEx.getPrototype(e),n=ClassEx.getSuperClassPrototype(e),i=Object.keys(t);Object.keys({toString:!0}).length||i.push("toString","valueOf");for(var a=0,o=i.length;a<o;a++){var s=i[a],l=t[s];if("function"==typeof l){var u=FunctionUtils.argumentNames(l),p=u[0];if("$origin"==p){var c=l,f=r[s],d=ClassEx.getUnusedMethodName(e,"__$changed$_"+s+"__");r[d]=f,(l=function(e){return function(){return r[e].apply(this,arguments)}}(d).wrap(c)).valueOf=c.valueOf.bind(c),l.toString=c.toString.bind(c),u.shift(),p=u.first()}if("$super"==p){c=l;(l=function(e){return function(){return n[e].apply(this,arguments)}}(s).wrap(c)).valueOf=c.valueOf.bind(c),l.toString=c.toString.bind(c)}}r[s]=l}return ClassEx._remapPropGetters(e,i),e}},ObjectEx=Class.create({CLASS_NAME:"ObjectEx",EVENT_HANDLERS_FIELD:"__$__k__eventhandlers__$__",initialize:function(){this._initPropertySystem(),this.initPropValues(),this._updateStatus=0,this._childChangeEventSuppressed=!1,this._modifiedProps=[],this._finalized=!1,this.afterInitialization()},afterInitialization:function(){},finalize:function(){this._finalized||(this.doFinalize(),this.invokeEvent("finalize",{obj:this}),this[this.EVENT_HANDLERS_FIELD]=null,this._finalized=!0)},doFinalize:function(){},initProperties:function(){this.defineProp("enablePropValueGetEvent",{dataType:DataType.BOOL,serializable:!1,scope:Class.PropertyScope.PUBLIC}),this.defineProp("enablePropValueSetEvent",{dataType:DataType.BOOL,serializable:!1,scope:Class.PropertyScope.PUBLIC}),this.defineProp("enableObjectChangeEvent",{dataType:DataType.BOOL,serializable:!1,scope:Class.PropertyScope.PUBLIC}),this.defineProp("bubbleEvent",{dataType:DataType.BOOL,serializable:!1,scope:Class.PropertyScope.PUBLIC}),this.defineProp("suppressChildChangeEventInUpdating",{dataType:DataType.BOOL,serializable:!1,scope:Class.PropertyScope.PUBLIC}),this.defineProp("eventHandlers",{dataType:DataType.HASH,serializable:!1,scope:Class.PropertyScope.PRIVATE,setter:null,getter:function(){var e=this[this.EVENT_HANDLERS_FIELD];return e||(e={},this[this.EVENT_HANDLERS_FIELD]=e),e}})},initPropValues:function(){},getHigherLevelObj:function(){return null},saved:function(){},loaded:function(){},_initPropertySystem:function(){ClassEx._ensurePropertySystem(this.getClass())},_createPropertyList:function(){ClassEx._createPropertyList(this.getClass())},_remapPropGetters:function(){ClassEx._remapPropGetters(this.getClass())},getClass:function(){return this.constructor},getSuperClass:function(){return this.getClass().superclass},getClassName:function(){return this.getPrototype().CLASS_NAME},getClassLocalName:function(){return ClassEx.getClassLocalName(this.getClass())},getSerializationName:function(){return this.getClassName()},getPrototype:function(){return this.prototype?this.prototype:this.constructor.prototype},getSuperClassPrototype:function(){return this.constructor&&this.constructor.superclass?this.constructor.superclass.prototype:null},__changeClass__:function(e){var t=ClassEx.getPrototype(e);return this.prototype=t,this.__proto__=t,this.constructor=e,this.objectChange(["__proto__"]),this},getOwnPropList:function(){return this._initPropertySystem(),this.getPrototype().properties},getAllPropList:function(){var e,t=this.getSuperClassPrototype();return t?(e=t.getAllPropList().clone()).appendList(this.getOwnPropList()):e=this.getOwnPropList().clone(),e},getPropListOfScopes:function(e){return ClassEx.getPropListOfScopes(this.getClass(),e)},getPropInfoHashKey:function(e){return ObjectEx._PROPINFO_HASHKEY_PREFIX+e},getDefPropStoreFieldName:function(e){return ObjectEx._PROP_STOREFIELD_PREFIX+e},defineProp:function(e,t){var r;void 0===(r=t?Object.extend({},t):{}).serializable&&(r.serializable=!0),r.storeField=this.getDefPropStoreFieldName(e);var n,i,a=this.getOwnPropList().addProperty(e,r);if(null!==r.getter&&!1!==r.getter&&(n=this.createPropGetter(a,r.getter),a.getter=n.doGetterName),null!==r.setter&&!1!==r.setter&&(i=this.createPropSetter(a,r.setter),a.setter=i.doSetterName),this[this.getPropInfoHashKey(e)]=a,__definePropertyAvailable__){var o={enumerable:r.enumerable,configurable:!1};void 0===o.enumerable&&(o.enumerable=!0),n&&(o.get=this[n.getterName]),i&&(o.set=this[i.setterName]),a.descriptor=o;try{Object.defineProperty(this,e,o)}catch(e){throw e}}return a},createPropGetter:function(e,t){var r=e.name.toString().upperFirst(),n="get"+r,i="doGet"+r,a=this[i];return a||(a=t||new Function('return this["'+e.storeField+'"];'),this.getPrototype()[i]=a),this.getPrototype()[n]=a,{getterName:n,doGetterName:i}},createPropSetter:function(e,t){var r=e.name.toString(),n=r.upperFirst(),i="set"+n,a="doSet"+n,o=this[a];return this[a]||(o=t||new Function("value",'this["'+e.storeField+'"] = value;'),this.getPrototype()[a]=o),this.getPrototype()[i]=function(){var e=arguments[0];return this[a].apply(this,arguments),this.notifyPropSet(r,e),this},{setterName:i,doSetterName:a}},hasProperty:function(e){return null!=this.getPropInfo(e)},hasDirectProperty:function(e){return null!=this.getPropInfo(e,!0)},getPropInfo:function(e,t){var r,n=e||"";t||(r=this[this.getPropInfoHashKey(n)||""]);if(!r&&!(r=this.getOwnPropList().getPropInfo(n))&&!t){var i=this.getSuperClassPrototype();r=i&&i.getPropInfo?i.getPropInfo(n):null}return r},getPropertyDataType:function(e){var t=this.getPropInfo(e);return t?t.dataType:null},isPropertySerializable:function(e){var t=this.getPropInfo(e),r=t&&t.serializable;return void 0===r||!!r},getPropStoreFieldValue:function(e){return this[ObjectEx._PROP_STOREFIELD_PREFIX+e]},getPropValue:function(e){var t,r=this.getPropInfo(e);if(r){if(r.getter){var n=Array.prototype.slice.call(arguments);n.shift(),t=this[r.getter].apply(this,n)}else t=this[r.storeField];return t}return null},getPropValues:function(e){var t={};if(DataType.isArrayValue(e))for(var r=0,n=e.length;r<n;++r){t[i=e[r]]=this.getPropValue(i)}else if(DataType.isObjectValue(e))for(var i in e)e.hasOwnProperty(i)&&"function"!=typeof e[i]&&(t[i]=this.getPropValue(i));return t},setPropStoreFieldValue:function(e,t){this[ObjectEx._PROP_STOREFIELD_PREFIX+e]=t},setPropValue:function(e,t,r){var n=this.getPropInfo(e);return n&&(n.setter?this[n.setter].apply(this,[t]):r&&(this[n.storeField]=t),this.notifyPropSet(e,t)),this},setPropValueX:function(){var e=Array.prototype.slice.call(arguments),t=e.shift(),r=this.getPropInfo(t);return r&&(r.setter&&this[r.setter].apply(this,e),this.notifyPropSet(t,this.getPropValue(t))),this},setPropValues:function(e,t){for(var r in e)if(e.hasOwnProperty(r)&&this.hasProperty(r)){var n=e[r];this.setPropValue(r,n,t)}return this},_isPropGetOrSetEvent:function(e){return"propValueGet"==e||"propValueSet"==e},notifyPropSet:function(e,t,r){this.isUpdating()?this._modifiedProps.indexOf(e)<0&&this._modifiedProps.push(e):this._isPropGetOrSetEvent(e)||this.isEventPropName(e)||(this.doPropChanged(e,t),this.getPropStoreFieldValue("enablePropValueSetEvent")&&this.invokeEvent("propValueSet",{propName:e,propValue:t}),r||this.objectChange([e]))},objectChange:function(e){this.doObjectChange(e),this.getEnableObjectChangeEvent()&&this.invokeEvent("change",{changedPropNames:e})},doObjectChange:function(e){},doPropChanged:function(e,t){},defineEvent:function(e){},eventNameToPropName:function(e){return"__event_"+e},isEventPropName:function(e){return"string"==typeof e&&e.indexOf("__event_")>=0},isEventHandlerList:function(e){return e&&"object"==typeof e&&e instanceof Class.EventHandlerList},getEventHandlerList:function(e){var t=this.getEventHandlers(),r=t[e];return r||(r=new Class.EventHandlerList,t[e]=r),r},addEventListener:function(e,t,r){var n=this.getEventHandlerList(e);return this.isEventHandlerList(n)?("change"===e&&this.setEnableObjectChangeEvent(!0),n.add(t,r)):null},addOnceEventListener:function(e,t,r){var n=this,i=function(a){n.removeEventListener(e,i,r),t(a)};return this.addEventListener(e,i,r)},removeEventListener:function(e,t,r){var n=this.getEventHandlerList(e);if(this.isEventHandlerList(n))return n.remove(t,r)},on:function(e,t,r){return this.addEventListener(e,t,r)},once:function(e,t,r){return this.addOnceEventListener(e,t,r)},off:function(e,t,r){return this.removeEventListener(e,t,r)},invokeEvent:function(e,t){t?(t.name=e,t.target=this):t={name:e,target:this},t.stopImmediatePropagation||(t.stopImmediatePropagation=this._eventStopImmediatePropagation),t.stopPropagation||(t.stopPropagation=this._eventCancelBubble),t.preventDefault||(t.preventDefault=this._eventPreventDefault),this.dispatchEvent(e,t)},_eventStopImmediatePropagation:function(){this._stopImmediatePropagation=!0,this._cancelBubble=!0},_eventCancelBubble:function(){this._cancelBubble=!0},_eventPreventDefault:function(){this._preventDefault=!0},relayEvent:function(e,t){t.currentTarget=this,"change"===e&&this.getSuppressChildChangeEventInUpdating()&&this.isUpdating()?this._childChangeEventSuppressed=!0:this.dispatchEvent(e,t)},dispatchEvent:function(e,t){for(var r=this.getEventHandlerList(e),n=0,i=r.getLength();n<i&&!t._stopImmediatePropagation;++n){var a=r.getHandlerInfo(n);a.handler.apply(a.thisArg,[t])}if(!t._cancelBubble&&this.getBubbleEvent()){var o=this.getHigherLevelObj();o&&o.relayEvent&&o.relayEvent(e,t)}},stopEventPropagation:function(e){e.cancelBubble=!0},overwriteMethod:function(e,t){var r=this,n=this[e];return this[e]=function(){var e=Array.prototype.slice.call(arguments);return e.unshift(n.bind(r)),t.apply(r,e)},this},assign:function(e){return e.assignTo(this)},assignTo:function(e){var t={};this.saveObj(t,"json"),e.loadObj(t,"json")},clone:function(){var e=new(this.getClass());return this.assignTo(e),e},beginUpdate:function(){++this._updateStatus},endUpdate:function(){if(--this._updateStatus,this.checkUpdateStatus(),!this.isUpdating()){var e=this._modifiedProps||[];this._modifiedProps=[],this._childChangeEventSuppressed&&(e.push("[children]"),this._childChangeEventSuppressed=!1),this.doEndUpdate(e)}},doEndUpdate:function(e){if(e.length){if(this.getPropStoreFieldValue("enablePropValueSetEvent"))for(var t=0,r=e.length;t<r;++t){var n=e[t],i=this.getPropValue(n);this.notifyPropSet(n,i,!0)}this.objectChange(e)}},isUpdating:function(){return this._updateStatus>0},isPropUpdated:function(e){return this._modifiedProps.indexOf(e)>=0},checkUpdateStatus:function(){this._updateStatus<=0&&(this._updateStatus=0)},copyPropsTo:function(e){for(var t=this.getAllPropList(),r=0,n=t.getLength();r<n;++r){var i=t.getPropInfoAt(r).name;if(e.hasProperty(i)){var a=this.getPropValue(i);e.setPropValue(i,a,!0)}}}});ObjectEx._PROPINFO_HASHKEY_PREFIX="__$propInfo__",ObjectEx._PROP_STOREFIELD_PREFIX="__$__k__p__",$jsRoot.Class=Class,$jsRoot.ClassEx=ClassEx,$jsRoot.ObjectEx=ObjectEx,$jsRoot.DataType=DataType,DataType.StringUtils=StringUtils}(this),function(){var JsonUtility={DEF_LOAD_TIMEOUT:2e4,FILE_EXT_JSON:".json",FILE_EXT_JSON_JS_WRAPPER:".jsonjs",DEF_SERIALIZE_TO_JSCODE_VARNAME:"__jsonvar__",parse:function(e){return JSON.parse(e)},parseFromJsWrappedCode:function(code,jsVarName){return jsVarName||(jsVarName=JsonUtility.DEF_SERIALIZE_TO_JSCODE_VARNAME),eval(code),JsonUtility.parse(eval(jsVarName))},load:function(e,t,r){return WebShow.URL.getFileExt(e).toLowerCase()==JsonUtility.FILE_EXT_JSON_JS_WRAPPER?JsonUtility.loadJsWrapper(e,t,r):JsonUtility.loadJson(e,t,r)},loadJsWrapper:function(url,callback,options){var loptions=options||{},wrapperVarName=loptions.wrapperVarName||JsonUtility.DEF_SERIALIZE_TO_JSCODE_VARNAME;loptions.timeout||(loptions.timeout=JsonUtility.DEF_LOAD_TIMEOUT);var runCallBack=function(e,t){callback&&callback(e,t)},wrapperCallback=function(src,isSuccess){var jsonObj=null;if(isSuccess){var wrapperVar=eval(wrapperVarName);wrapperVar&&(jsonObj="string"==typeof wrapperVar?JsonUtility.parse(wrapperVar):wrapperVar),runCallBack(jsonObj,!0)}else runCallBack(null,!1)};WebShow.ScriptLoader.load(url,wrapperCallback,loptions)},loadJson:function(e,t,r){var n=r||{};n.timeout||(n.timeout=JsonUtility.DEF_LOAD_TIMEOUT),n.resultType=WebShow.FileLoader.ResultType.TEXT,n.extractBody=!1;(new WebShow.XHRLoader).load(e,function(e,r,n){if(r){var i=JsonUtility.parse(e);t(i,!0)}else t(null,!1)},n)},serializeToStr:function(e,t){return t&&t.prettyPrint?JSON.stringify(e,null,t.indentSpaces||2):JSON.stringify(e)},serializeToJsCode:function(e,t,r){r||(r="'"),t||(t=JsonUtility.DEF_SERIALIZE_TO_JSCODE_VARNAME);var n=JsonUtility.serializeToStr(e),i=new RegExp(r,"g");return"var "+t+" = "+r+(n=n.replace(i,"\\"+r))+r}},XmlUtility={DEF_INCLUDE_TAG_NAME:"include",DEF_INCLUDE_SRC_ATTRIB:"src",DEF_LOAD_TIMEOUT:2e4,DEF_BYPASS_ROOT_ELEM:!0,DEF_SERIALIZE_TO_JSCODE_VARNAME:"__xmlStr__",FILE_EXT_XML:".xml",FILE_EXT_XML_JS_WRAPPER:".xmljs",newDocument:function(e,t){if(e||(e=""),t||(t=""),document.implementation&&document.implementation.createDocument)return r=document.implementation.createDocument(t,e,null);var r=new ActiveXObject("MSXML2.DOMDocument");if(e){var n="",i=e,a=e.indexOf(":");-1!=a&&(n=e.substring(0,a),i=e.substring(a+1));var o="<"+(n?n+":":"")+i+(t?(n?" xmlns:":" xmlns")+n+'="'+t+'"':"")+"/>";r.loadXML(o)}return r},parse:function(e){if("undefined"!=typeof DOMParser)return(new DOMParser).parseFromString(e,"application/xml");if("undefined"!=typeof ActiveXObject){var t=XmlUtility.newDocument();return t.loadXML(e),t}var r="data:text/xml;charset=utf-8,"+encodeURIComponent(e),n=new XMLHttpRequest;return n.open("GET",r,!1),n.send(null),n.responseXML},load:function(e,t,r){return WebShow.URL.getFileExt(e).toLowerCase()==XmlUtility.FILE_EXT_XML_JS_WRAPPER?XmlUtility.loadHelper.loadJsWrapper(e,t,r):(r||(r={disableInclude:!1}),r.disableInclude?XmlUtility.loadHelper.loadSimple(e,t,r.timeout):XmlUtility.loadHelper.loadAndHandleIncludeElement(e,t,r))},loadHelper:{loadSimple:function(e,t,r){var n=null!=t;if(null==r&&(r=XmlUtility.DEF_LOAD_TIMEOUT),document.implementation&&document.implementation.createDocument){var i=new XMLHttpRequest,a=null;r&&(a=setTimeout(function(){o(null,!1)},r));var o=function(e,r){a&&clearTimeout(a),t&&t(e,r)};n&&(i.onreadystatechange=function(){if(4==i.readyState){var e=i.responseXML;e&&e.documentElement?o(e,!0):o(null,!1)}});try{i.open("get",e,n),i.send(null)}catch(e){WebShow.reportError(e),o(null,!1)}var s=i.responseXML;return s&&s.documentElement?s:null}return XmlUtility.loadHelper.loadSimpleViaDoc(e,t)},loadSimpleViaDoc:function(e,t){var r=null!=t,n=XmlUtility.newDocument("dummy_dummy_dummy_dummy");return n.async=r,r&&(n.onreadystatechange=function(){4==n.readyState&&(n.documentElement&&"dummy_dummy_dummy_dummy"!=n.documentElement.tag?t(n,!0):t(n,!1))}),n.load(e),n},loadAndHandleIncludeElement:function(e,t,r){var n;if(n=r?r.timeout:null,null==t){var i=XmlUtility.loadHelper.loadSimple(e,null,n);return i&&i.documentElement?(XmlUtility.loadHelper.handleIncludedXmlInElement(i.documentElement,null,r),i):null}return XmlUtility.loadHelper.loadSimple(e,function(e,n){n?XmlUtility.loadHelper.handleIncludedXmlInElement(e.documentElement,function(r){t(e,!0)},r):t(e,!1)},n)},loadJsWrapper:function(url,callback,options){options=options||{};var wrapperVarName=options.wrapperVarName||XmlUtility.DEF_SERIALIZE_TO_JSCODE_VARNAME,loadTimeout=options.timeout;null==loadTimeout&&(loadTimeout=XmlUtility.DEF_LOAD_TIMEOUT);var runCallBack=function(e,t){callback&&callback(e,t)},wrapperCallback=function(src,isSuccess){if(isSuccess){var xmlContent=eval(wrapperVarName),doc=XmlUtility.parse(xmlContent);runCallBack(doc,!0)}else runCallBack(null,!1)};options.timeout=loadTimeout,WebShow.ScriptLoader.load(url,wrapperCallback,options)},getIncludeElements:function(e,t){return t||(t=XmlUtility.DEF_INCLUDE_TAG_NAME),e.getElementsByTagName(t)},handleIncludedXmlInElement:function(e,t,r){r||(r={});var n=r.includeTagName||XmlUtility.DEF_INCLUDE_TAG_NAME,i=r.srcAttribName||XmlUtility.DEF_INCLUDE_SRC_ATTRIB,a=null!=r.bypassRootElem?r.bypassRootElem:XmlUtility.DEF_BYPASS_ROOT_ELEM,o=null==t,s=XmlUtility.getXmlDocUrl(e.ownerDocument),l=XmlUtility.loadHelper.getIncludeElements(e,n);if(!i)var u=null;var p,c=null,f=0,d=l.length;if(d<=0)return t&&t(0),null;for(var h=l.length-1;h>=0;--h)(u=(c=l[h]).getAttribute(i))&&(u=WebShow.URL.mergePath(u,s),o?(p=XmlUtility.loadHelper.loadSimple(u))&&XmlUtility.loadHelper.insertIncludedSection(p,c,a):XmlUtility.loadHelper.loadSimple(u,function(e,r,n){n&&r&&(p=r,XmlUtility.loadHelper.insertIncludedSection(p,e,a)),++f==d&&t(f)}.bind(this,c)));return e},insertIncludedSection:function(e,t,r){var n=[];if(r)for(var i=e.documentElement.firstChild;i;)i.nodeType==Node.ELEMENT_NODE&&n.push(i),i=i.nextSibling;else n.push(e.documentElement);for(var a=t.ownerDocument,o=(a.documentElement,0),s=n.length;o<s;++o){var l=n[o];a.importNode&&(l=a.importNode(l,!0)),t.parentNode.insertBefore(l,t)}return t.parentNode.removeChild(t),a}},serializeNode:function(e,t){if(t&&t.prettyPrint)return XmlUtility.serializeNodePretty(e);if("undefined"!=typeof XMLSerializer)return(new XMLSerializer).serializeToString(e);if(e.xml)return e.xml;throw"XML.serialize is not supported or can't serialize "+e},serializeNodePretty:function(e){try{return(new XMLSerializer).serializeToString(e).toXMLString()}catch(t){return XmlUtility.serializeNode(e)}},serializeNodeToJsCode:function(e,t,r){r||(r="'"),t||(t=XmlUtility.DEF_SERIALIZE_TO_JSCODE_VARNAME);var n=XmlUtility.serializeNode(e),i=new RegExp(r,"g");return"var "+t+" = "+r+(n=n.replace(i,"\\"+r))+r+";"},parseFromJsWrappedCode:function(code,jsVarName){eval(code);var xmlText=eval(jsVarName);return XmlUtility.parse(xmlText)},getXmlDocUrl:function(e){return e.url||e.documentURI||e.URL||e.location}};DataType.JsonUtility=JsonUtility,DataType.XmlUtility=XmlUtility}(),function(){var e=Class.create({CLASS_NAME:"ObjSerializer",serializeValue:function(e){return e},deserializeValue:function(e,t){return e},propNameToStorageName:function(e){return e},storageNameToPropName:function(e){return e},getObjCustomSaveMethod:function(e){return e.doSaveObj},getObjCustomLoadMethod:function(e){return e.doLoadObj},getObjCustomPropSaveMethod:function(e){return e.doSaveProp},getObjCustomPropLoadMethod:function(e){return e.doLoadProp},isUndefined:function(e){return DataType.isUndefinedValue(e)},isNull:function(e){return null===e},isNaN:function(e){return e!=e},isFunction:function(e){return DataType.isFunctionValue(e)},isArray:function(e){return DataType.isArrayValue(e)},isDate:function(e){return DataType.isDateValue(e)},isObject:function(e){return DataType.isObjectValue(e)},isObjectEx:function(e){return DataType.isObjectExValue(e)},isSimpleType:function(e){var t=typeof e;return"string"==t||"number"==t||"boolean"==t||"undefined"==t||this.isNull(e)},isComplexType:function(e){return!this.isSimpleType(e)},createChildStorageNode:function(e,t,r){},appendArrayItemStorageNode:function(e,t,r){},getNameForArrayItemStorageNode:function(e){return this.getDefaultArrayItemStorageName()},getChildStorageNode:function(e,t){},getAllArrayItemStorageNodes:function(e){},getAllStoredStorageNames:function(e){},setStorageNodeExplicitType:function(e,t){},getStorageNodeExplicitType:function(e){},getStorageNodeName:function(e){},isComplexStorageNode:function(e){},isComplexArrayItemStorageNode:function(e){},isSimpleStorageNode:function(e){},getValueExplicitType:function(e){return e instanceof ObjectEx?e.getClassName():this.isObject(e)?DataType.OBJECT:this.isArray(e)?DataType.ARRAY:this.isDate(e)?DataType.DATE:typeof e},getDefaultArrayItemStorageName:function(){return"item"},getDefaultDateStorageName:function(){return"date"},save:function(e,t,r){if("object"==typeof e){var n=this.getObjCustomSaveMethod(e);if(n)return n(e,t,this)}var i=this.doSave(e,t,r||{});return i&&this.isFunction(e.saved)&&e.saved(),i},doSave:function(e,t,r){return"object"==typeof e&&(e instanceof ObjectEx?this.doSaveObjectEx(e,t,r):this.isArray(e)?this.doSaveArray(e,t):this.isDate(e)?this.doSaveDate(e,t):this.doSaveSimpleObject(e,t)),this.setStorageNodeExplicitType(t,this.getValueExplicitType(e)),e},doSaveSimpleObject:function(e,t){for(var r in e)if(e.hasOwnProperty(r)){var n,i=e[r];this.isComplexType(i)&&(n=this.getValueExplicitType(i)),this.doSaveFieldValue(e,r,i,t,n)}},doSaveArray:function(e,t){for(var r=0,n=e.length;r<n;++r){var i=e[r],a=this.getNameForArrayItemStorageNode(i);if(this.isComplexType(i)){var o=this.appendArrayItemStorageNode(t,this.propNameToStorageName(a),this.isArray(i));this.setStorageNodeExplicitType(o,this.getValueExplicitType(i)),this.save(i,o)}else this.doAppendArrayItemSimpleValue(this.serializeValue(i),typeof i,t)}},doSaveDate:function(e,t){var r=e.toUTCString();this.doSaveSimpleValue(e,this.propNameToStorageName(this.getDefaultDateStorageName()),this.serializeValue(r),DataType.DATE,t)},doSaveObjectEx:function(e,t,r){for(var n=e.getAllPropList(),i=r.propFilter,a=0,o=n.getLength();a<o;++a){var s=n.getPropInfoAt(a);if(!i||i(s,e)){var l=this.getObjCustomPropSaveMethod(e),u=!1;l&&(u=l(e,s,t,this)),u||s.serializable&&this.doSaveObjectExProp(e,s,t,r)}}},doSaveObjectExProp:function(e,t,r,n){var i,a=t.name,o=t.dataType,s=e.getPropValue(a);(n.saveDefaultValues||s!==t.defaultValue)&&(s instanceof ObjectEx?s.getClassName()!=o&&(i=s.getClassName()):this.isComplexType(s)&&(i=this.getValueExplicitType(s))==o&&(i=void 0),this.doSaveFieldValue(e,a,s,r,i))},doSaveFieldValue:function(e,t,r,n,i){if("function"!=typeof r)if(this.isComplexType(r)){var a=this.createChildStorageNode(n,this.propNameToStorageName(t),this.isArray(r));i&&this.setStorageNodeExplicitType(a,i),this.save(r,a)}else this.doSaveSimpleValue(e,this.propNameToStorageName(t),this.serializeValue(r),this.getValueExplicitType(r),n)},doSaveSimpleValue:function(e,t,r,n,i){},doAppendArrayItemSimpleValue:function(e,t,r){},load:function(e,t){if(!e){var r=this.getStorageNodeExplicitType(t);if(!r)return this.doLoadUntypedNode?this.doLoadUntypedNode(t):null;e=DataType.createInstance(r)}if("object"==typeof e){var n=this.getObjCustomLoadMethod(e);if(n)return n(e,t,this)}var i=this.doLoad(e,t);return i&&this.isFunction(e.loaded)&&e.loaded(),i},doLoad:function(e,t){this.getStorageNodeExplicitType(t);if("object"==typeof e)if(e instanceof ObjectEx){e.beginUpdate();try{e=this.doLoadObjectEx(e,t)}finally{e.endUpdate()}}else e=this.isArray(e)?this.doLoadArray(e,t):this.isDate(e)?this.doLoadDate(e,t):this.doLoadSimpleObject(e,t);return e},doLoadArray:function(e,t){for(var r=this.getAllArrayItemStorageNodes(t),n=0,i=r.length;n<i;++n){var a=r[n];if(this.isComplexArrayItemStorageNode(a)){var o,s=this.getStorageNodeExplicitType(a)||this.getStorageNodeName(a);s?(o=DataType.createInstance(s),this.load(o,a)):(o={},this.load(o,a)),e.push(o)}else{var l=this.deserializeValue(this.doGetArrayItemSimpleStorageValue(a));e.push(l)}}return e},doLoadDate:function(e,t){var r=this.propNameToStorageName(this.getDefaultDateStorageName()),n=this.doLoadSimpleValue(e,r,DataType.DATE,t);if(n){var i=new Date(n);return e.copyFrom(i),e}},doLoadSimpleObject:function(e,t){for(var r=this.getAllStoredStorageNames(t),n=0,i=r.length;n<i;++n){var a=r[n],o=this.storageNameToPropName(a),s=this.getChildStorageNode(t,a);if(s){var l,u=this.getStorageNodeExplicitType(s);l=u?DataType.createInstance(u):{},this.load(l,s),e[o]=l}else{var p=this.doLoadSimpleValue(e,a,null,t);e[o]=p}}return e},doLoadObjectEx:function(e,t){for(var r=e.getAllPropList(),n=0,i=r.getLength();n<i;++n){var a=r.getPropInfoAt(n);if(a.serializable){var o=this.getObjCustomPropLoadMethod(e),s=!1;o&&(s=o(e,a,t,this)),s||this.doLoadObjectExProp(e,a,t)}}return e},doLoadObjectExProp:function(e,t,r){var n=t.name,i=t.dataType,a=this.doLoadFieldValue(e,n,r,i);null!=a&&e.setPropValue(n,a,!0)},doLoadFieldValue:function(e,t,r,n){var i,a=!1;if(DataType.isComplexType(n)){var o=this.getChildStorageNode(r,this.propNameToStorageName(t));if(o){var s=this.getStorageNodeExplicitType(o);i=s&&s!=n?DataType.createInstance(s):DataType.createInstance(n),this.load(i,o),a=!0}}return!DataType.isSimpleType(n)&&a||(i=this.doLoadSimpleValue(e,this.propNameToStorageName(t),n,r)),i},doLoadSimpleValue:function(e,t,r,n){var i=this.doLoadSimpleStorageValue(t,n);return this.deserializeValue(i,r)},doLoadSimpleStorageValue:function(e,t){},doGetArrayItemSimpleStorageValue:function(e){}}),t=Class.create(e,{CLASS_NAME:"JsonObjSerializer",TYPE_TAG_NAME:"__type__",createChildStorageNode:function(e,t,r){var n=r?[]:{};return e[t]=n,n},appendArrayItemStorageNode:function(e,t,r){var n=r?[]:{};return e.push(n),n},getChildStorageNode:function(e,t){var r=e[t];return this.isSimpleType(r)&&(r=null),r},getAllArrayItemStorageNodes:function(e){return Array.prototype.slice.call(e)},getAllStoredStorageNames:function(e){var t=[];for(var r in e)e.hasOwnProperty(r)&&r!=this.TYPE_TAG_NAME&&t.push(r);return t},isComplexStorageNode:function(e){return this.isComplexType(e)},isComplexArrayItemStorageNode:function(e){return this.isComplexStorageNode(e)},isSimpleStorageNode:function(e){return this.isSimpleType(e)},setStorageNodeExplicitType:function(e,t){this.isArray(e)||(e[this.TYPE_TAG_NAME]=t)},getStorageNodeExplicitType:function(e){var t=e[this.TYPE_TAG_NAME]||null;return!t&&this.isArray(e)?DataType.ARRAY:t},doSaveSimpleValue:function(e,t,r,n,i){i[t]=r},doAppendArrayItemSimpleValue:function(e,t,r){return r.push(e)},doLoadSimpleStorageValue:function(e,t){return t[e]},doLoadUntypedNode:function(e){return e},doGetArrayItemSimpleStorageValue:function(e){return e}}),r=Class.create(e,{CLASS_NAME:"XmlObjSerializer",TYPE_TAG_NAME:"dataType",getLocalName:function(e){return e.localName||e.baseName||e.nodeName},getElemTextValue:function(e){for(var t="",r=0,n=e.childNodes.length;r<n;++r)e.childNodes[r].nodeType==Node.TEXT_NODE&&(t+=e.childNodes[r].nodeValue);return t},serializeValue:function(e){return DataType.StringUtils.serializeValue(e)},deserializeValue:function(e,t){return DataType.StringUtils.deserializeValue(e,t)},createChildStorageNode:function(e,t,r){var n=e.ownerDocument.createElement(t);return e.appendChild(n),n},appendArrayItemStorageNode:function(e,t,r){return this.createChildStorageNode(e,t,r)},getAllArrayItemStorageNodes:function(e){for(var t=[],r=0,n=e.childNodes.length;r<n;++r){var i=e.childNodes[r];i.nodeType==Node.ELEMENT_NODE&&t.push(i)}return t},getAllStoredStorageNames:function(e){for(var t=[],r=0,n=e.childNodes.length;r<n;++r){var i=e.childNodes[r];i.nodeType==Node.ELEMENT_NODE&&this.getLocalName(i)!=this.TYPE_TAG_NAME&&t.push(this.getLocalName(i))}for(r=0,n=e.attributes.length;r<n;++r){var a=e.attributes[r];this.getLocalName(a)!=this.TYPE_TAG_NAME&&t.push(this.getLocalName(a))}return t},getChildStorageNode:function(e,t){for(var r=null,n=0,i=e.childNodes.length;n<i;++n){var a=e.childNodes[n];a.nodeType==Node.ELEMENT_NODE&&this.getLocalName(a)==t&&(r=a)}return r},isComplexStorageNode:function(e){return e.nodeType==Node.ELEMENT_NODE},isComplexArrayItemStorageNode:function(e){return this.isComplexStorageNode(e)&&e.attributes.length&&!this.getElemTextValue(e).trim()},isSimpleStorageNode:function(e){return e.nodeType==Node.ATTRIBUTE_NODE},setStorageNodeExplicitType:function(e,t){e.setAttribute(this.TYPE_TAG_NAME,t)},getStorageNodeExplicitType:function(e){return e.getAttribute(this.TYPE_TAG_NAME)||null},getStorageNodeName:function(e){var t=e.tagName;return t==this.getDefaultArrayItemStorageName()?null:t},doSaveSimpleObject:function($super,e,t){$super(e,t)},doSaveArray:function($super,e,t){$super(e,t)},doSaveSimpleValue:function(e,t,r,n,i){i.setAttribute(t,r)},doAppendArrayItemSimpleValue:function(e,t,r){var n=this.appendArrayItemStorageNode(r,this.propNameToStorageName(this.getDefaultArrayItemStorageName()),!1),i=n.ownerDocument.createTextNode(e);n.appendChild(i)},doLoadSimpleStorageValue:function(e,t){return t.getAttribute(e)},doGetArrayItemSimpleStorageValue:function(e){return this.getElemTextValue(e)}}),n={_serializerClasses:{},_defaultName:null,registerSerializer:function(e,t,r){var i="string"==typeof t?ClassEx.findClass(t):t;n._serializerClasses[e]=i,r&&(n._defaultName=e)},getSerializer:function(e){var t=e||n._defaultName;if(t){var r=n._serializerClasses[t];return r?new r:null}return null}};n.registerSerializer("json",t,!0),n.registerSerializer("xml",r),Class.ObjSerializerFactory=n,ClassEx.extend(ObjectEx,{saveObj:function(e,t,r){return(t?"string"==typeof t?n.getSerializer(t):t:n.getSerializer()).save(this,e,r)},loadObj:function(e,t){var r,i;r=t?"string"==typeof t?n.getSerializer(t):t:n.getSerializer(),this.beginUpdate();try{i=r.load(this,e)}finally{this.endUpdate()}return i}}),Object.extend(ClassEx,{saveObj:function(e,t,r,i){return(r?"string"==typeof r?n.getSerializer(r):r:n.getSerializer()).save(e,t,i)},loadObj:function(e,t,r){return(r?"string"==typeof r?n.getSerializer(r):r:n.getSerializer()).load(e,t)}}),Object.extend(DataType,{valueToJson:function(e,t){if(DataType.isSimpleValue(e))return JSON.stringify(e);var r=DataType.isArrayValue(e)?[]:{};return ClassEx.saveObj(e,r,"json",t),JSON.stringify(r)},jsonToValue:function(e){var t=JSON.parse(e);return!t||DataType.isSimpleValue(t)?t:ClassEx.loadObj(null,t,"json")}})}();var Kekule={LIBNAME:"Kekule.js",LIBNAME_CORE:"Kekule",VERSION:"0.9.3.19090200",LOADED:!1,_afterLoadSysProcedures:[],_afterLoadUserProcedures:[],PROP_AUTO_TITLE:!0,_loaded:function(){if(!Kekule.LOADED){Kekule.LOADED=!0;for(var e=Kekule._afterLoadSysProcedures;e.length;){(t=e.shift())&&t()}for(e=Kekule._afterLoadUserProcedures;e.length;){var t;(t=e.shift())&&t()}var r=Kekule.$jsRoot&&Kekule.$jsRoot.document;if(r&&r.createEvent&&r.body&&r.body.dispatchEvent){var n=r.createEvent("Event");n.initEvent("kekuleload",!0,!0),r.body.dispatchEvent(n)}}},_isLoaded:function(){return Kekule.LOADED},_registerAfterLoadSysProc:function(e){e&&(Kekule.LOADED?e():Kekule._afterLoadSysProcedures.push(e))},_ready:function(e){e&&(Kekule.LOADED?e():Kekule._afterLoadUserProcedures.push(e))}};Kekule._registerAfterLoadProc=Kekule._ready,Kekule.$jsRoot=this,"object"==typeof self?Kekule.$jsRoot=self:"object"==typeof window&&window.document?Kekule.$jsRoot=window:"object"==typeof global&&(Kekule.$jsRoot=global),Kekule.$jsRoot.Kekule=Kekule,Kekule.$document=this.document||null,Kekule.scriptSrcInfo||(Kekule.scriptSrcInfo=Kekule.$jsRoot.__$kekule_load_info__),Kekule.scriptSrcInfo&&Kekule.scriptSrcInfo.language&&(Kekule.language=Kekule.scriptSrcInfo.language),!Kekule.scriptSrcInfo&&Kekule.$jsRoot.document&&(Kekule.scriptSrcInfo=function(){for(var e=/^(.*\/?)kekule\..*\.js(\?.*)?$/,t=document.getElementsByTagName("script"),r=t.length-1;r>=0;--r){var n=t[r];if(n.src){var i=n.src.match(e);if(i){var a=i[2];return a&&(a=a.substr(1)),{src:n.src,path:i[1],paramStr:a,useMinFile:!0}}}}return null}()),Kekule.getScriptPath=function(){return Kekule.scriptSrcInfo.path},Kekule.getScriptSrc=function(){return Kekule.scriptSrcInfo.src},Kekule.getStyleSheetPath=function(){var e=Kekule.scriptSrcInfo;return e.useMinFile?e.path:e.path+"widgets/"},Kekule.getStyleSheetUrl=function(){return Kekule.getStyleSheetPath()+"themes/default/kekule.css"},Kekule.$jsRoot&&Kekule.$jsRoot.addEventListener&&Kekule.$jsRoot.postMessage&&Kekule.$jsRoot.addEventListener("message",function(e){"kekule-sys-info-query"===e.data&&Kekule.$jsRoot.postMessage({msg:"kekule-sys-info-result",libName:Kekule.LIBNAME,version:Kekule.VERSION},"*")},!1),Kekule.Dev={},Kekule.Class=Class,Kekule.ClassEx=ClassEx,Kekule.ObjectEx=ObjectEx,Kekule.DataType=DataType;