Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

zeanium

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zeanium - npm Package Compare versions

Comparing version 1.0.6 to 1.0.8

src/format/JSONFormater.js

2

dist/zn.base.minx.js

@@ -1,1 +0,1 @@

var zn={VERSION:"0.0.1",DEBUG:!1,ZN_PATH:"",PATH:"",GLOBAL:function(){return this}.call(null)};if(zn.GLOBAL&&(zn.GLOBAL.zn=zn),"undefined"!=typeof module&&module.exports)module.exports=zn,zn.ZN_PATH=__dirname,zn.PATH=process.cwd();else{window&&(window.zn=zn);var _zn_url="";try{__a__=__b__}catch(e){e.fileName?_zn_url=e.fileName:e.sourceURL?_zn_url=e.sourceURL:e.stacktrace?console.log(e.stacktrace):e.stack?(_zn_url=e.stack.split("\n")[1],_zn_url=_zn_url.replace(/\s/g,""),_zn_url=_zn_url.substring(2,_zn_url.length)):console.log(e.toString())}if(!_zn_url)for(var _scripts=document.getElementsByTagName("script"),_src="",_node,i=0,_len=scripts.length;_len>i;i++)if(_node=scripts[i],_node.getAttribute&&(_src=_node.getAttribute("src")||"","zn.js"===_src.slice(-5)||"zn.minx.js"===_src.slice(-10))){_zn_url=_src;break}if(!_zn_url)throw new Error("zn.js has not been included, please do it first.");zn.ZN_PATH=_zn_url.substring(0,_zn_url.lastIndexOf("/")+1)}!function(a){var b=Object.prototype.toString,c={idle:function(){},idleArray:function(){return[]},idleObject:function(){return{}},format:function(){var a=arguments,b=null,c=null;return a.length<2?a[0]:(b=a[0].toString(),c=a[1],d.each(c,function(a,c){a=d.is(a,"object")?JSON.stringify(a):a.toString(),b=b.replace(new RegExp("\\{"+c+"\\}","gi"),a)}),b)},uuid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0,c="x"==a?b:3&b|8;return c.toString(16)}).toUpperCase()},fix:function(a){for(var b=a||{},c=1,d=arguments.length;d>c;c++){var e=arguments[c];for(var f in e)e.hasOwnProperty(f)&&"function"!=typeof b[f]&&(b[f]=e[f])}return b},extend:function(a){for(var b=a||{},c=1,d=arguments.length;d>c;c++){var e=arguments[c];for(var f in e)e.hasOwnProperty(f)&&(b[f]=e[f])}return b},overwrite:function(a){for(var b=a||{},c=1,d=arguments.length;d>c;c++){var e=arguments[c];for(var f in e)e.hasOwnProperty(f)&&void 0===b[f]&&(b[f]=e[f])}return b},path:function(a,b,c){var d=a||{};if(b){var e,f=b.split("."),g=f.length,h=0;if(arguments.length<3)for(;d&&g>h;h++)e=f[h],d=d.__get__?d.__get__(e):d[e];else{for(g-=1;d&&g>h;h++)e=f[h],d=d.__get__?d.__get__(e):d[e]=d[e]||{};e=f[h],d&&(d.__set__?d.__set__(e,c):d[e]=c,d=c)}}return d},invoke:function(b,c,d){if(b&&c){var e,f,g=c.lastIndexOf(".");g>0?(e=a.path(b,c.substring(0,g)),e&&(f=e[c.substring(g+1)])):(e=b,f=b[c]),f&&f.apply(e,d)}},deepEachObject:function(a,b,c){if(d.is(a,"object")){var e,f=null;for(var g in a)f=a[g],d.is(f,"object")?this.deepEachObject(f,b,c):(e=b&&b.call(c,f,g,a),void 0!==e&&null!==e&&(a[g]=e))}return a},arrayValueToObject:function(a,b,c){if(d.is(a,"array")){for(var e,f=null,g={},h=0,i=a.length;i>h;h++)f=a[h],e=b&&b.call(c,f,h,a),void 0!==e&&null!==e&&(g[f]=e);a=g}return a}},d={toString:function(a){return a&&a.toString?a.toString():b.call(a)},each:function(a,c,d){if(a&&c)if(a.__each__)a.__each__(c,d);else{var e=a.length,f=null;if(e>0&&"[object Array]"===b.call(a)){for(var g=0;e>g;g++)if(f=c.call(d,a[g],g),f===!1)return!1}else for(var h in a)if(a.hasOwnProperty(h)){if(f=c.call(d,a[h],h),f===!1)return!1;if(-1===f)continue}}},clone:function(b){if(b){if(b.__clone__)return b.__clone__();if(a.is(b,"array"))return b.slice(0);var c={};for(var d in b)b.hasOwnProperty(d)&&(c[d]=b[d]);return c}return b},type:function(a){return a&&a.__type__?a.__type__:b.call(a).slice(8,-1).toLowerCase()},is:function(a,b){if(a&&a.__is__)return a.__is__(b);if("string"==typeof b)switch(b.toLowerCase()){case"plain":return a&&a.constructor===Object;default:return this.type(a)===b}else if("function"==typeof b)return a instanceof b},may:function(a,b){return a?a.__may__?a.__may__(b):a.hasOwnProperty("on"+b):!1},can:function(a,b){return a?a.__can__?a.__can__(b):"function"==typeof a[b]:!1},has:function(a,b){return a?a.__has__?a.__has__(b):a.hasOwnProperty(b):!1},get:function(a,b){return a?a.__get__?a.__get__(b):a[b]:void 0},set:function(a,b,c){a&&(a.__set__?a.__set__(b,c):a[b]=c)},gets:function(a){if(a){if(a.__gets__)return a.__gets__();var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}},sets:function(a,b){if(a&&b)if(a.__sets__)a.__sets__(b);else for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])}};c.extend(a,c),c.extend(a,d)}(zn),function(a){{var b=Array.prototype.slice,c=Object.prototype.hasOwnProperty,d=Object.prototype.toString,e={format:function(){var b=arguments,c=this;return 1==b.length&&"object"==typeof b[0]&&(b=b[0]),a.each(b,function(b,d){b="object"==a.type(b)?JSON.stringify(b):b.toString(),c=c.replace(new RegExp("\\{"+d+"\\}","gi"),b)}),c.toString()}},f={isArray:function(b){return b&&"[object Array]"===a.toString(b)&&b.constructor===Array}},g={forEach:function(a,b){if(!a)return!1;for(var c=0,d=this.length;d>c;c++)a.call(b,this[c],c);return this},indexOf:function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},lastIndexOf:function(a){for(var b=this.length-1;b>=0;b--)if(this[b]===a)return b;return-1}},h={bind:function(a){var c=this;return function(){return c.apply(a,b.call(arguments,1))}}},i={toArray:function(a){return b.call(a)},keys:function(a){if(a!==Object(a))throw new TypeError("Object.keys called on a non-object");var b,d=[];for(b in a)c.call(a,b)&&d.push(b);return d},values:function(a){if(a!==Object(a))throw new TypeError("Object.keys called on a non-object");var b,d=[];for(b in a)c.call(a,b)&&d.push(a[b]);return d},create:function(){var b=function(){};return function(c,d){if(null===c)throw new Error("Cannot set a null [[Prototype]]");if("object"!=typeof c)throw new TypeError("Argument must be an object");return a.each(d,function(a,b){i.defineProperty(c,a,b)}),b.prototype=c,new b}}(),defineProperty:function(a,b,c){return a&&b&&c&&c.hasOwnProperty("value")&&(a[b]=c.value),a}};({parse:function(){return""},stringify:function(){var a=d,b=Array.isArray,c={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},e=function(a){return c[a]||"\\u"+(a.charCodeAt(0)+65536).toString(16).substr(1)},f=/[\\"\u0000-\u001F\u2028\u2029]/g;return function g(c){if(null==c)return"null";if("number"==typeof c)return isFinite(c)?c.toString():"null";if("boolean"==typeof c)return c.toString();if("object"==typeof c){var d;if("function"==typeof c.toJSON)return g(c.toJSON());if(b(c)){d="[";for(var h=0;h<c.length;h++)d+=(h?", ":"")+g(c[h]);return d+"]"}if("[object Object]"===a.call(c)){d=[];for(var i in c)c.hasOwnProperty(i)&&d.push(g(i)+": "+g(c[i]));return"{"+d.join(", ")+"}"}}return'"'+c.toString().replace(f,e)+'"'}}()})}a.fix(Array,f),a.fix(Array.prototype,g),a.fix(Function.prototype,h),a.fix(String.prototype,e)}(zn),function(a){function b(){}function c(){var c,e,f,h=l._arguments.apply(this,arguments),i=h.name,j=h.super,k=h.meta,n=k.methods.init;if(j._static_)throw new Error("Static class cannot be inherited.");if(j._final_)throw new Error("Final class cannot be inherited.");if(i&&k.partial&&(c=a.path(d,i)),k.static){if(c){if(!c._static_)throw new Error('Partial class "'+i+'" must be static.')}else c=function(){throw new Error("Cannot instantiate static class.")};f=c.prototype}else{if(c){if(c._static_)throw new Error('Partial class "'+i+'" must not be static.');if(c._super_!==j&&c._super_!==b)throw new Error('Partial class "'+i+'" must have consistent super class.')}else c=k.abstract?function(){throw new Error("Cannot instantiate abstract class.")}:function(){var b=c._mixins_||[],d=c._ctors_||[],e=null,f=arguments;this.__id__=g++,this.__handlers__={},this.__initializing__=!0,this.__afters__=[];for(var h=null,i=null,j=0,k=b.length;k>j;j++)h=b[j],h["@init"]?(i=h["@init"].meta,i=a.is(i,"function")?i:i.value,m(h.prototype.__super__,this,f),i&&i.call(this)):m(h.prototype.__super__,this,f);m(this.__super__,this,f);for(var l=0,n=d.length;n>l;l++)e=d[l],e=a.is(e,"function")?e:e.value,e&&e.apply(this,f);for(;this.__afters__.length>0;){var o=this.__afters__.pop();o.handler.apply(o.context,f)}this.__afters__=null,delete this.__afters__,this.__initializing__=!1},c._ctors_=[];c._super_!==j?(e=function(){},e.prototype=j.prototype,f=new e,f.constructor=c,f.__type__=i||"Anonymous",f.__super__=j,c.prototype=f):f=c.prototype,f.class=f.constructor,n&&(c._ctors_.push(n),f.__ctor__||(f.__ctor__=n))}return l._meta(c,h),f.__define__&&f.__define__.call(c),i&&a.path(d,i,c),c}var d=a.GLOBAL,e="@",f=1,g=1,h={fixTargetCtor:function(a){return a instanceof b?a.constructor:a},fixTargetKey:function(a){return e+a},defineEvent:function(a,b,c){var d=h.fixTargetCtor(a),e=h.fixTargetKey(b),f=e in d,g={};return f||(g=Object.defineProperty(a,"on"+b.toLowerCase(),{get:function(){var a=this.__handlers__[b];return a?a[0].handler:null},set:function(a){var c=this.__handlers__,d=c[b]=c[b]||[];d[0]={owner:this,handler:a,context:null}}})),d[e]={name:b,type:"event",meta:c,descriptor:g},f},defineProperty:function(b,c,d){var e,f,g=h.fixTargetCtor(b),i=h.fixTargetKey(c),j=i in g,k={};if("value"in d){var l=d.value,m="_"+c,n=d.get,o=d.set;e=n||function(){return m in this?this[m]:a.is(l,"function")?l.call(this):l},f=d.readonly?function(a,b){return b&&b.force?void(this[m]=a):!1}:o||function(a){this[m]=a}}else e=d.get||function(){return void 0},f=d.set||function(){return!1};return j&&(e.__super__=g[i].getter,f.__super__=g[i].setter),k=Object.defineProperty(b,c,{get:e,set:f,configurable:!0}),g[i]={name:c,type:"property",meta:d,getter:e,setter:f,descriptor:k},j},defineMethod:function(a,b,c){var d=h.fixTargetCtor(a),e=h.fixTargetKey(b),f=e in d;return d[e]={name:b,type:"method",meta:c},b in a&&(c.value.__super__=a[b]),a[b]=c.value,f}},i={__handlers__:{},member:function(a,c){var d=h.fixTargetCtor(c||this),e=d[h.fixTargetKey(a)];return e||d===b?e:this.member(a,d._super_)},may:function(a){var b=this.member(a);return b&&"event"==b.type},has:function(a){var b=this.member(a);return b&&"property"==b.type},can:function(a){var b=this.member(a);return b&&"method"==b.type},get:function(a,b){var c=this.member(a);return c&&c.getter?c.getter.call(this,b):void 0},set:function(a,b,c){var d=this.member(a);return d&&d.setter&&d.setter.call(this,b,c),this},gets:function(b){var c={},d=h.fixTargetCtor(this)._properties_;return a.each(d,function(a){c[a]=this.get(a,b)},this),c},sets:function(a,b){if(a)for(var c in a)a.hasOwnProperty(c)&&this.set(c,a[c],b);return this},each:function(a,b){for(var c=h.fixTargetCtor(this)._properties_,d=0,e=c.length;e>d;d++){var f=c[d],g=a.call(b,f,d,this.member(f),this.get(f));if(g===!1)return!1}return this},__may__:function(a){return this.may(a)},__has__:function(a){return this.has(a)},__can__:function(a){return this.can(a)},__get__:function(a){return this.get(a)},__gets__:function(){return this.gets()},__set__:function(a,b){this.set(a,b)},__sets__:function(a){this.sets(a)},__each__:function(a,b){return this.each(a,b)}},j={toString:function(){return"{ ClassName: "+(this._name_||"Anonymous")+", ClassID: "+this._id_+" }"},getProperties:function(b){var c={};if(!this.getMeta||"ZNObject"==this._name_)return c;var d=this._super_,e=this._mixins_;return d&&a.extend(c,d.getProperties(b)),e&&e.length&&a.each(e,function(d){a.extend(c,d.getProperties(b))}),a.each(this.getMeta("properties"),function(a,d){var e=b&&b(d,a)===!1;e||a.hidden||(c[d]=a)}),c},getPropertie:function(b){var c=null;return b&&a.each(this.getProperties(),function(a,d){return b==d&&(c=a),-1}),c},getMeta:function(a){return a?this._meta_[a]:this._meta_},setMeta:function(a,b){return this._meta_[a]=b,this},defineEvent:function(a,b,c){return h.defineEvent(c||this.prototype,a,b)||this._events_.push(a),this},defineProperty:function(a,b,c){return h.defineProperty(c||this.prototype,a,b)||this._properties_.push(a),this},defineMethod:function(a,b,c){return h.defineMethod(c||this.prototype,a,b)||this._methods_.push(a),this}},k={toString:function(){var a={ClassName:this.__name__||"Anonymous",InstanceID:this.__id__,Meta:this.constructor._meta_};return JSON.stringify(a)},toJson:function(){var b={};return a.each(this.constructor.getProperties(),function(a,c){b[c]=this.get(c)},this),b},getProperties:function(){return this.constructor.getProperties()},getPropertie:function(a){return this.constructor.getPropertie(a)},upon:function(b,c,d){if(c){var e=this.__handlers__,f=e[b]=e[b]||[];f[0]=a.extend({owner:this,handler:c},d)}return this},on:function(b,c,d){if(c){var e=this.__handlers__,f=e[b]=e[b]||[{owner:null,handler:null,context:null}];f.push(a.extend({owner:this,handler:c},d))}return this},off:function(a,b,c){var d,e=this.__handlers__[a]||[],f=c&&c.context;if(b)for(var g=e.length-1;g>=0;g--)d=e[g],d.handler!==b||f&&d.context!==f||this.__handlers__[a].splice(g,1);else this.__handlers__[a]=[{owner:null,handler:null,context:null}];return this},fire:function(a,b,c){var d,e=this.__handlers__[a],f=null;if(e)for(var g=0,h=e.length;h>g;g++)if(d=e[g],d&&d.handler&&(f=c&&"apply"==c.method?d.handler.apply(d.context||d.owner,b):d.handler.call(d.context||d.owner,d.owner,b,c),!1===f))return this;return this},dispose:function(){return this.__handlers__={},this},destroy:function(){return this.dispose()},"super":function(){var a=this.super.caller.__super__;return a?a.apply(this,arguments):void 0},is:function(b){if("string"==typeof b&&(b=a.path(d,b)),b){if(this instanceof b)return!0;for(var c=this.constructor._mixins_,e=0,f=c.length;f>e;e++){var g=c[e];if(b===g)return!0}}return!1},__is__:function(a){return this.is(a)},__clone__:function(){}};a.extend(b,i,j,{_id_:0,_name_:"ZNObject",_statics_:{},_events_:[],_properties_:[],_methods_:[],_mixins_:[],_meta_:{}}),a.extend(b.prototype,i,k),a.isZNObject=function(a){return a instanceof b};var l={_arguments:function(){var c,d,e,f=arguments,g=f.length,h=f[0],i={"static":!1,statics:[],partial:!1,"abstract":!1,"final":!1,mixins:[],events:[],properties:[],methods:[]};if(3===g){if(c=h,d=f[1],e=f[2],!a.is(d,"function"))throw new Error("Invalid _super class.")}else if(2===g){if(a.is(h,"string"))c=h,d=null;else{if(!a.is(h,"function"))throw new Error("Invalid _super class.");c=null,d=h}e=f[1]}else{if(1!==g)throw new Error("Invalid arguments.");if(c=null,d=null,e=h,!a.is(e,"object"))throw new Error("The meta argument must be an object.")}return c=c||"",e=a.overwrite(e||{},i),d=d||b,{name:c,"super":d,meta:e}},_meta:function(b,c){var d=c.name,e=c.super,g=c.meta;return a.extend(b,i,j,{_id_:f++,_name_:d,_super_:e,_partial_:g.partial,_abstract_:g.abstract,_static_:g.static,_final_:g.final,_statics_:a.extend({},e._statics_,g.statics),_events_:e._events_.slice(0),_properties_:e._properties_.slice(0),_methods_:e._methods_.slice(0),_mixins_:e._mixins_.concat(g.mixins),_meta_:g}),a.extend(b,b._statics_),g.static?(a.each(g.events,function(a){b.defineEvent(a,{},b)}),a.each(g.properties||g.props,function(c,d){b.defineProperty(d,a.is(c,"object")?c:{value:c},b)}),a.each(g.methods,function(c,d){b.defineMethod(d,a.is(c,"function")?{value:c}:c,b)}),g.methods.init&&g.methods.init.call(b,b)):(a.each(g.mixins,function(c){var d=c.prototype;a.each(c._events_,function(a){b.defineEvent(a,d.member(a).meta)}),a.each(c._properties_,function(a){b.defineProperty(a,d.member(a).meta)}),a.each(c._methods_,function(a){i[a]||k[a]||b.defineMethod(a,d.member(a).meta)})}),a.each(g.events,function(a){b.defineEvent(a,{})}),a.each(g.properties,function(c,d){b.defineProperty(d,a.is(c,"object")?c:{value:c})}),a.each(g.methods,function(c,d){b.defineMethod(d,a.is(c,"function")?{value:c}:c)})),b}},m=function(c,d,e){if(c&&c!==b){var f=c.member("init"),g=c._mixins_,h=null;return f&&f.meta.after&&d.__afters__.push({context:d,handler:f.meta.after}),g.length&&a.each(g,function(b){b["@init"]&&(h=b["@init"].meta,h=a.is(h,"function")?h:h.value,h&&h.call(d))}),f&&f.meta.auto&&f.meta.value.apply(d,e),arguments.callee(c._super_,d)}};a.Class=c}(zn);
var __isServer="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0),zn={VERSION:"0.0.1",DEBUG:!1,ZN_PATH:"",PATH:"",isServer:__isServer,GLOBAL:function(){return __isServer?global:window}.call(null)};if(zn.GLOBAL.zn=zn,__isServer)zn.ZN_PATH=__dirname,zn.PATH=process.cwd(),module.exports=zn;else{var _zn_url="";try{__a__=__b__}catch(e){e.fileName?_zn_url=e.fileName:e.sourceURL?_zn_url=e.sourceURL:e.stacktrace?console.log(e.stacktrace):e.stack?(_zn_url=e.stack.split("\n")[1],_zn_url=_zn_url.replace(/\s/g,""),_zn_url=_zn_url.substring(2,_zn_url.length)):console.log(e.toString())}if(!_zn_url)for(var _scripts=document.getElementsByTagName("script"),_src="",_node,i=0,_len=scripts.length;_len>i;i++)if(_node=scripts[i],_node.getAttribute&&(_src=_node.getAttribute("src")||"","zn.js"===_src.slice(-5)||"zn.minx.js"===_src.slice(-10))){_zn_url=_src;break}if(!_zn_url)throw new Error("zn.js has not been included, please do it first.");zn.ZN_PATH=_zn_url.substring(0,_zn_url.lastIndexOf("/")+1)}!function(a){var b=Object.prototype.toString,c={idle:function(){},idleArray:function(){return[]},idleObject:function(){return{}},format:function(){var a=arguments,b=null,c=null;return a.length<2?a[0]:(b=a[0].toString(),c=a[1],d.each(c,function(a,c){a=d.is(a,"object")?JSON.stringify(a):a.toString(),b=b.replace(new RegExp("\\{"+c+"\\}","gi"),a)}),b)},uuid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0,c="x"==a?b:3&b|8;return c.toString(16)}).toUpperCase()},serializeJSON:function(a){return Object.keys(a).map(function(b){return encodeURIComponent(b)+"="+encodeURIComponent(a[b])}).join("&")},fix:function(a){for(var b=a||{},c=1,d=arguments.length;d>c;c++){var e=arguments[c];for(var f in e)e.hasOwnProperty(f)&&"function"!=typeof b[f]&&(b[f]=e[f])}return b},extend:function(a){for(var b=a||{},c=1,d=arguments.length;d>c;c++){var e=arguments[c];for(var f in e)e.hasOwnProperty(f)&&(b[f]=e[f])}return b},overwrite:function(a){for(var b=a||{},c=1,d=arguments.length;d>c;c++){var e=arguments[c];for(var f in e)e.hasOwnProperty(f)&&void 0===b[f]&&(b[f]=e[f])}return b},path:function(a,b,c){var d=a||{};if(b){var e,f=b.split("."),g=f.length,h=0;if(arguments.length<3)for(;d&&g>h;h++)e=f[h],d=d.__get__?d.__get__(e):d[e];else{for(g-=1;d&&g>h;h++)e=f[h],d=d.__get__?d.__get__(e):d[e]=d[e]||{};e=f[h],d&&(d.__set__?d.__set__(e,c):d[e]=c,d=c)}}return d},invoke:function(b,c,d){if(b&&c){var e,f,g=c.lastIndexOf(".");g>0?(e=a.path(b,c.substring(0,g)),e&&(f=e[c.substring(g+1)])):(e=b,f=b[c]),f&&f.apply(e,d)}},deepEachObject:function(a,b,c){if(d.is(a,"object")){var e,f=null;for(var g in a)f=a[g],d.is(f,"object")?this.deepEachObject(f,b,c):(e=b&&b.call(c,f,g,a),void 0!==e&&null!==e&&(a[g]=e))}return a},arrayValueToObject:function(a,b,c){if(d.is(a,"array")){for(var e,f=null,g={},h=0,i=a.length;i>h;h++)f=a[h],e=b&&b.call(c,f,h,a),void 0!==e&&null!==e&&(g[f]=e);a=g}return a}},d={toString:function(a){return a&&a.toString?a.toString():b.call(a)},each:function(a,c,d){if(a&&c)if(a.__each__)a.__each__(c,d);else{var e=a.length,f=null;if(e>0&&"[object Array]"===b.call(a)){for(var g=0;e>g;g++)if(f=c.call(d,a[g],g),f===!1)return!1}else for(var h in a)if(a.hasOwnProperty(h)){if(f=c.call(d,a[h],h),f===!1)return!1;if(-1===f)continue}}},clone:function(b){if(b){if(b.__clone__)return b.__clone__();if(a.is(b,"array"))return b.slice(0);var c={};for(var d in b)b.hasOwnProperty(d)&&(c[d]=b[d]);return c}return b},type:function(a){return a&&a.__type__?a.__type__:b.call(a).slice(8,-1).toLowerCase()},is:function(a,b){if(a&&a.__is__)return a.__is__(b);if("string"==typeof b)switch(b.toLowerCase()){case"plain":return a&&a.constructor===Object;default:return this.type(a)===b}else if("function"==typeof b)return a instanceof b},may:function(a,b){return a?a.__may__?a.__may__(b):a.hasOwnProperty("on"+b):!1},can:function(a,b){return a?a.__can__?a.__can__(b):"function"==typeof a[b]:!1},has:function(a,b){return a?a.__has__?a.__has__(b):a.hasOwnProperty(b):!1},get:function(a,b){return a?a.__get__?a.__get__(b):a[b]:void 0},set:function(a,b,c){a&&(a.__set__?a.__set__(b,c):a[b]=c)},gets:function(a){if(a){if(a.__gets__)return a.__gets__();var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}},sets:function(a,b){if(a&&b)if(a.__sets__)a.__sets__(b);else for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])}};c.extend(a,c),c.extend(a,d)}(zn),function(a){{var b=Array.prototype.slice,c=Object.prototype.hasOwnProperty,d=Object.prototype.toString,e={format:function(){var b=arguments,c=this;return 1==b.length&&"object"==typeof b[0]&&(b=b[0]),a.each(b,function(b,d){b="object"==a.type(b)?JSON.stringify(b):b.toString(),c=c.replace(new RegExp("\\{"+d+"\\}","gi"),b)}),c.toString()}},f={isArray:function(b){return b&&"[object Array]"===a.toString(b)&&b.constructor===Array}},g={forEach:function(a,b){if(!a)return!1;for(var c=0,d=this.length;d>c;c++)a.call(b,this[c],c);return this},indexOf:function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},lastIndexOf:function(a){for(var b=this.length-1;b>=0;b--)if(this[b]===a)return b;return-1}},h={bind:function(a){var c=this;return function(){return c.apply(a,b.call(arguments,1))}}},i={toArray:function(a){return b.call(a)},keys:function(a){if(a!==Object(a))throw new TypeError("Object.keys called on a non-object");var b,d=[];for(b in a)c.call(a,b)&&d.push(b);return d},values:function(a){if(a!==Object(a))throw new TypeError("Object.keys called on a non-object");var b,d=[];for(b in a)c.call(a,b)&&d.push(a[b]);return d},create:function(){var b=function(){};return function(c,d){if(null===c)throw new Error("Cannot set a null [[Prototype]]");if("object"!=typeof c)throw new TypeError("Argument must be an object");return a.each(d,function(a,b){i.defineProperty(c,a,b)}),b.prototype=c,new b}}(),defineProperty:function(a,b,c){return a&&b&&c&&c.hasOwnProperty("value")&&(a[b]=c.value),a}};({parse:function(){return""},stringify:function(){var a=d,b=Array.isArray,c={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},e=function(a){return c[a]||"\\u"+(a.charCodeAt(0)+65536).toString(16).substr(1)},f=/[\\"\u0000-\u001F\u2028\u2029]/g;return function g(c){if(null==c)return"null";if("number"==typeof c)return isFinite(c)?c.toString():"null";if("boolean"==typeof c)return c.toString();if("object"==typeof c){var d;if("function"==typeof c.toJSON)return g(c.toJSON());if(b(c)){d="[";for(var h=0;h<c.length;h++)d+=(h?", ":"")+g(c[h]);return d+"]"}if("[object Object]"===a.call(c)){d=[];for(var i in c)c.hasOwnProperty(i)&&d.push(g(i)+": "+g(c[i]));return"{"+d.join(", ")+"}"}}return'"'+c.toString().replace(f,e)+'"'}}()})}a.fix(Array,f),a.fix(Array.prototype,g),a.fix(Function.prototype,h),a.fix(String.prototype,e)}(zn),function(a){function b(){}function c(){var c,e,f,h=l._arguments.apply(this,arguments),i=h.name,j=h.super,k=h.meta,n=k.methods.init;if(j._static_)throw new Error("Static class cannot be inherited.");if(j._final_)throw new Error("Final class cannot be inherited.");if(i&&k.partial&&(c=a.path(d,i)),k.static){if(c){if(!c._static_)throw new Error('Partial class "'+i+'" must be static.')}else c=function(){throw new Error("Cannot instantiate static class.")};f=c.prototype}else{if(c){if(c._static_)throw new Error('Partial class "'+i+'" must not be static.');if(c._super_!==j&&c._super_!==b)throw new Error('Partial class "'+i+'" must have consistent super class.')}else c=k.abstract?function(){throw new Error("Cannot instantiate abstract class.")}:function(){var b=c._mixins_||[],d=c._ctors_||[],e=null,f=arguments;this.__id__=g++,this.__handlers__={},this.__initializing__=!0,this.__afters__=[];for(var h=null,i=null,j=0,k=b.length;k>j;j++)h=b[j],h["@init"]?(i=h["@init"].meta,i=a.is(i,"function")?i:i.value,m(h.prototype.__super__,this,f),i&&i.call(this)):m(h.prototype.__super__,this,f);m(this.__super__,this,f);for(var l=0,n=d.length;n>l;l++)e=d[l],e=a.is(e,"function")?e:e.value,e&&e.apply(this,f);for(;this.__afters__.length>0;){var o=this.__afters__.pop();o.handler.apply(o.context,f)}this.__afters__=null,delete this.__afters__,this.__initializing__=!1},c._ctors_=[];c._super_!==j?(e=function(){},e.prototype=j.prototype,f=new e,f.constructor=c,f.__type__=i||"Anonymous",f.__super__=j,c.prototype=f):f=c.prototype,f.class=f.constructor,n&&(c._ctors_.push(n),f.__ctor__||(f.__ctor__=n))}return l._meta(c,h),f.__define__&&f.__define__.call(c),i&&a.path(d,i,c),c}var d=a.GLOBAL,e="@",f=1,g=1,h={fixTargetCtor:function(a){return a instanceof b?a.constructor:a},fixTargetKey:function(a){return e+a},defineEvent:function(a,b,c){var d=h.fixTargetCtor(a),e=h.fixTargetKey(b),f=e in d,g={};return f||(g=Object.defineProperty(a,"on"+b.toLowerCase(),{get:function(){var a=this.__handlers__[b];return a?a[0].handler:null},set:function(a){var c=this.__handlers__,d=c[b]=c[b]||[];d[0]={owner:this,handler:a,context:null}}})),d[e]={name:b,type:"event",meta:c,descriptor:g},f},defineProperty:function(b,c,d){var e,f,g=h.fixTargetCtor(b),i=h.fixTargetKey(c),j=i in g,k={};if("value"in d){var l=d.value,m="_"+c,n=d.get,o=d.set;e=n||function(){return m in this?this[m]:a.is(l,"function")?l.call(this):l},f=d.readonly?function(a,b){return b&&b.force?void(this[m]=a):!1}:o||function(a){this[m]=a}}else e=d.get||function(){return void 0},f=d.set||function(){return!1};return j&&(e.__super__=g[i].getter,f.__super__=g[i].setter),k=Object.defineProperty(b,c,{get:e,set:f,configurable:!0}),g[i]={name:c,type:"property",meta:d,getter:e,setter:f,descriptor:k},j},defineMethod:function(a,b,c){var d=h.fixTargetCtor(a),e=h.fixTargetKey(b),f=e in d;return d[e]={name:b,type:"method",meta:c},b in a&&(c.value.__super__=a[b]),a[b]=c.value,f}},i={__handlers__:{},member:function(a,c){var d=h.fixTargetCtor(c||this),e=d[h.fixTargetKey(a)];return e||d===b?e:this.member(a,d._super_)},may:function(a){var b=this.member(a);return b&&"event"==b.type},has:function(a){var b=this.member(a);return b&&"property"==b.type},can:function(a){var b=this.member(a);return b&&"method"==b.type},get:function(a,b){var c=this.member(a);return c&&c.getter?c.getter.call(this,b):void 0},set:function(a,b,c){var d=this.member(a);return d&&d.setter&&d.setter.call(this,b,c),this},gets:function(b){var c={},d=h.fixTargetCtor(this)._properties_;return a.each(d,function(a){c[a]=this.get(a,b)},this),c},sets:function(a,b){if(a)for(var c in a)a.hasOwnProperty(c)&&this.set(c,a[c],b);return this},each:function(a,b){for(var c=h.fixTargetCtor(this)._properties_,d=0,e=c.length;e>d;d++){var f=c[d],g=a.call(b,f,d,this.member(f),this.get(f));if(g===!1)return!1}return this},__may__:function(a){return this.may(a)},__has__:function(a){return this.has(a)},__can__:function(a){return this.can(a)},__get__:function(a){return this.get(a)},__gets__:function(){return this.gets()},__set__:function(a,b){this.set(a,b)},__sets__:function(a){this.sets(a)},__each__:function(a,b){return this.each(a,b)}},j={toString:function(){return"{ ClassName: "+(this._name_||"Anonymous")+", ClassID: "+this._id_+" }"},getProperties:function(b){var c={};if(!this.getMeta||"ZNObject"==this._name_)return c;var d=this._super_,e=this._mixins_;return d&&a.extend(c,d.getProperties(b)),e&&e.length&&a.each(e,function(d){a.extend(c,d.getProperties(b))}),a.each(this.getMeta("properties"),function(a,d){var e=b&&b(d,a)===!1;e||a.hidden||(c[d]=a)}),c},getPropertie:function(b){var c=null;return b&&a.each(this.getProperties(),function(a,d){return b==d&&(c=a),-1}),c},getMeta:function(a){return a?this._meta_[a]:this._meta_},setMeta:function(a,b){return this._meta_[a]=b,this},defineEvent:function(a,b,c){return h.defineEvent(c||this.prototype,a,b)||this._events_.push(a),this},defineProperty:function(a,b,c){return h.defineProperty(c||this.prototype,a,b)||this._properties_.push(a),this},defineMethod:function(a,b,c){return h.defineMethod(c||this.prototype,a,b)||this._methods_.push(a),this}},k={toString:function(){var a={ClassName:this.__name__||"Anonymous",InstanceID:this.__id__,Meta:this.constructor._meta_};return JSON.stringify(a)},toJson:function(){var b={};return a.each(this.constructor.getProperties(),function(a,c){b[c]=this.get(c)},this),b},getProperties:function(){return this.constructor.getProperties()},getPropertie:function(a){return this.constructor.getPropertie(a)},upon:function(b,c,d){if(c){var e=this.__handlers__,f=e[b]=e[b]||[];f[0]=a.extend({owner:this,handler:c},d)}return this},on:function(b,c,d){if(c){var e=this.__handlers__,f=e[b]=e[b]||[{owner:null,handler:null,context:null}];f.push(a.extend({owner:this,handler:c},d))}return this},off:function(a,b,c){var d,e=this.__handlers__[a]||[],f=c&&c.context;if(b)for(var g=e.length-1;g>=0;g--)d=e[g],d.handler!==b||f&&d.context!==f||this.__handlers__[a].splice(g,1);else this.__handlers__[a]=[{owner:null,handler:null,context:null}];return this},fire:function(a,b,c){var d,e=this.__handlers__[a],f=null;if(e)for(var g=0,h=e.length;h>g;g++)if(d=e[g],d&&d.handler&&(f=c&&"apply"==c.method?d.handler.apply(d.context||d.owner,b):d.handler.call(d.context||d.owner,d.owner,b,c),!1===f))return!1;return this},dispose:function(){return this.__handlers__={},this},destroy:function(){return this.dispose()},"super":function(){var a=this.super.caller.__super__;return a?a.apply(this,arguments):void 0},is:function(b){if("string"==typeof b&&(b=a.path(d,b)),b){if(this instanceof b)return!0;for(var c=this.constructor._mixins_,e=0,f=c.length;f>e;e++){var g=c[e];if(b===g)return!0}}return!1},__is__:function(a){return this.is(a)},__clone__:function(){}};a.extend(b,i,j,{_id_:0,_name_:"ZNObject",_statics_:{},_events_:[],_properties_:[],_methods_:[],_mixins_:[],_meta_:{}}),a.extend(b.prototype,i,k),a.isZNObject=function(a){return a instanceof b};var l={_arguments:function(){var c,d,e,f=arguments,g=f.length,h=f[0],i={"static":!1,statics:[],partial:!1,"abstract":!1,"final":!1,mixins:[],events:[],properties:[],methods:[]};if(3===g){if(c=h,d=f[1],e=f[2],!a.is(d,"function"))throw new Error("Invalid _super class.")}else if(2===g){if(a.is(h,"string"))c=h,d=null;else{if(!a.is(h,"function"))throw new Error("Invalid _super class.");c=null,d=h}e=f[1]}else{if(1!==g)throw new Error("Invalid arguments.");if(c=null,d=null,e=h,!a.is(e,"object"))throw new Error("The meta argument must be an object.")}return c=c||"",e=a.overwrite(e||{},i),d=d||b,{name:c,"super":d,meta:e}},_meta:function(b,c){var d=c.name,e=c.super,g=c.meta;return a.extend(b,i,j,{_id_:f++,_name_:d,_super_:e,_partial_:g.partial,_abstract_:g.abstract,_static_:g.static,_final_:g.final,_statics_:a.extend({},e._statics_,g.statics),_events_:e._events_.slice(0),_properties_:e._properties_.slice(0),_methods_:e._methods_.slice(0),_mixins_:e._mixins_.concat(g.mixins),_meta_:g}),a.extend(b,b._statics_),g.static?(a.each(g.events,function(a){b.defineEvent(a,{},b)}),a.each(g.properties||g.props,function(c,d){b.defineProperty(d,a.is(c,"object")?c:{value:c},b)}),a.each(g.methods,function(c,d){b.defineMethod(d,a.is(c,"function")?{value:c}:c,b)}),g.methods.init&&g.methods.init.call(b,b)):(a.each(g.mixins,function(c){var d=c.prototype;a.each(c._events_,function(a){b.defineEvent(a,d.member(a).meta)}),a.each(c._properties_,function(a){b.defineProperty(a,d.member(a).meta)}),a.each(c._methods_,function(a){i[a]||k[a]||b.defineMethod(a,d.member(a).meta)})}),a.each(g.events,function(a){b.defineEvent(a,{})}),a.each(g.properties,function(c,d){b.defineProperty(d,a.is(c,"object")?c:{value:c})}),a.each(g.methods,function(c,d){b.defineMethod(d,a.is(c,"function")?{value:c}:c)})),b}},m=function(c,d,e){if(c&&c!==b){var f=c.member("init"),g=c._mixins_,h=null;return f&&f.meta.after&&d.__afters__.push({context:d,handler:f.meta.after}),g.length&&a.each(g,function(b){b["@init"]&&(h=b["@init"].meta,h=a.is(h,"function")?h:h.value,h&&h.call(d))}),f&&f.meta.auto&&f.meta.value.apply(d,e),arguments.callee(c._super_,d)}};a.Class=c}(zn),function(a){var b=Array.prototype.slice,c={PENDING:0,CANCLE:1,PAUSE:2,FINISHED:3},d=a.Class({events:["init","finished"],properties:{status:{value:c.PENDING,get:function(){return this._status}}},methods:{init:function(){},doTask:function(a,b){if(a){var c=b||[];c.unshift(this),a.handler.apply(a.context,c)}},done:function(){this._status=c.FINISHED,this._data=b.call(arguments),this.fire("finished",this._data),this.off("finished")}}}),e=a.Class({events:["clear","push","pause","resume","exception","every","finally"],properties:{count:{get:function(){return this._tasks.length}}},methods:{init:function(a){this._exceptions=[],this._finallys=[],this._everys=[],this._tasks=[],this._taskProcessor=[],this._lastTask=null,this._data=[],this._max=(a||{}).max||1},destroy:function(){this._everys=[],this._tasks=[],this._taskProcessor=[],this.fire("finally",this._data,{method:"apply"}),this.super()},clear:function(){this._tasks=[]},pause:function(a){return this._paused=!0,a>0&&(this._pauseTimer=setTimeout(function(){this.resume()}.bind(this),a)),this.fire("pause"),this},resume:function(){return this._pauseTimer&&clearTimeout(this._pauseTimer),this._paused=!1,this.fire("resume"),this.doTask(),this},exception:function(a,b){return this.on("exception",a,b||this),this},"catch":function(a){return this.fire("exception",a),this},"finally":function(a,b){return this.on("finally",a,b||this),this},every:function(a,b){return this.on("every",a,b||this),this},push:function(a,b){var c={handler:a,context:b||this};return this._lastTask&&(c.previous=c,this._lastTask.next=c),this._lastTask=c,this._tasks.push(c),this.fire("push",c),this},getTaskProcessor:function(){for(var a=null,b=this._taskProcessor.length,e=0;b>e;e++)if(a=this._taskProcessor[e],a.status==c.FINISHED)return a;if(!a&&this._max>b){var f=new d;return f.queue=this,f.on("finished",this.__onProcessorFinished.bind(this),this),f}},start:function(){return this._data=[],this.doTask()},doTask:function(a){var b=this._tasks.shift();if(b){var c=this.getTaskProcessor();c&&(b.previousResult=a,c.doTask(b,a))}else this.destroy();return this},__onProcessorFinished:function(a,b){this._data.push(b),this.fire("every",b,{method:"apply"}),this.doTask(b)}}});a.queue=function(a){return new e(a)}}(zn),function(a){var b=Array.prototype.slice,c={PENDING:0,FULFILLED:1,REJECTED:2},d=a.Class({"static":!0,methods:{init:function(){this._exceptions=[],this._finallys=[],this._count=0,this._currIndex=0,this._dataArray=[]},exception:function(a){return this._exceptions.push(a),this},"catch":function(b,c){return a.each(this._exceptions,function(a){a.call(c,b)}),this},"finally":function(a){return this._finallys.push(a),this},defer:function(b,c){var d=this,f=new e(b,c);return f.on("complete",function(b,c){d._currIndex++,d._dataArray.push(c),d._currIndex==d._count&&(a.each(d._finallys,function(b){try{b(d._dataArray)}catch(c){a.error(c.message)}}),d._finallys=[])}),d._count++,f},all:function(b){var c=d.defer(),e=0,f=[];return a.each(b,function(a){a.then(function(a){f.push(a),e++,e>=b.length&&c.resolve(f)})}),c.promise},any:function(b){var c=d.defer();return a.each(b,function(a){a.then(function(a){c.resolve(a)})}),c.promise}}}),e=a.Class({events:["complete"],properties:{promise:null},methods:{init:function(a,b){this._promise=new f,a&&this.resolve(a),b&&this.reject(b)},resolve:function(){var e=b.call(arguments);try{var f=this.get("promise"),g=this;if(f.get("readyState")!=c.PENDING)return;f.set("readyState",c.FULFILLED),f.set("data",e),a.each(f.get("resolves"),function(a){a.apply(g,e)})}catch(h){d.catch(h,this)}this.fire("complete",e)},reject:function(){var a=b.call(arguments);try{var e=this.get("promise");if(e.get("readyState")!=c.PENDING)return;e.set("readyState",c.REJECTED),e.set("reason",a);var f=e.get("rejects")[0];f&&f.apply(this,a)}catch(g){d.catch(g,this)}this.fire("complete",a)}}}),f=a.Class({statics:{isPromise:function(a){return null!==a&&void 0!==a&&"function"==typeof a.then},defer:null},properties:{resolves:null,rejects:null,data:null,reason:null,readyState:null},methods:{init:function(){this.set("resolves",[]),this.set("rejects",[]),this.set("exceptions",[]),this.set("readyState",c.PENDING)},then:function(a,d){function g(){var c=b.call(arguments),d=a?a.apply(this,c):c;return f.isPromise(d)?d.then(function(){h.resolve.apply(h,b.call(arguments))}):h.resolve.apply(h,d),d}var h=new e;if(this.get("readyState")===c.PENDING)this.get("resolves").push(g),this.get("rejects").push(d?d:function(){h.reject.apply(h,b.call(arguments))});else if(this.get("readyState")===c.FULFILLED){var i=this;setTimeout(function(){g.apply(i,i.get("data"))})}return h.promise},"catch":function(a){return d.exception(a)},"finally":function(a){return d.finally(a)},otherwise:function(a){return this.then(void 0,a)}}});a.async=d}(zn),function(a){var b=(a.Class({events:["init","start","stop","cancle","goNext","goPre"],properties:{pre:null,next:null,delay:null,action:null,args:[],context:this,taskList:null,status:{value:"",get:function(){return this._status}}},methods:{init:function(a){this.sets(a),this.fire("init",this)},start:function(){"started"!=this._status&&(this._action?(this._action.apply(this._context,this._args),this._status="started"):this.goNext(),this.fire("start",this))},stop:function(){this._status="stoped",this.fire("stop",this)},cancle:function(){this._status="cancle",this.fire("cancle",this)},goNext:function(){this._next&&this._next.start(),this.fire("goNext",this)},goPre:function(){this._pre&&this._pre.start(),this.fire("goPre",this)}}}),a.Class({properties:{url:"",data:{set:function(a){this._data=a},get:function(){return a.is(this._data,"object")?JSON.stringify(this._data):this._data}},method:"GET",asyns:!0,username:null,password:null,headers:{get:function(){return a.overwrite({"X-Requested-With":"XMLHttpRequest","Content-type":"application/json"},this._headers)},set:function(a){this._headers=a}},timeout:{get:function(){return this._timeout||2e4},set:function(a){this._timeout=a}}},events:["before","after","success","error","complete","timeout"],methods:{init:function(a){this.sets(a),this._isRunning=!1},__initXMLHttpRequest:function(){if(this._XMLHttpRequest)return this._XMLHttpRequest;if(!window.ActiveXObject)return this._XMLHttpRequest=new XMLHttpRequest,this._XMLHttpRequest;for(var a="MSXML2.XMLHTTP",b=["Microsoft.XMLHTTP",a,a+".3.0",a+".4.0",a+".5.0",a+".6.0"],c=b.length,d=c-1;d>-1;d--)try{return this._XMLHttpRequest=new ActiveXObject(b[d]),this._XMLHttpRequest}catch(e){continue}},__onComplete:function(a){clearTimeout(this._timeoutID),this._isRunning=!1,this.resetEvents(),this.fire("complete",a)},__initRequestHeader:function(a,b){for(var c in b)a.setRequestHeader(c,b[c])},resetEvents:function(){this.off("before"),this.off("after"),this.off("success"),this.off("error"),this.off("complete"),this.off("timeout")},send:function(b){if(this._isRunning)return!1;this.sets(b);var c=this.__initXMLHttpRequest(),d=this,e=a.async.defer();if(this._isRunning=!0,this.timeout&&(this._timeoutID=setTimeout(function(){d._isRunning&&(c.abort(),d.fire("timeout",d),d.__onComplete("timeout"))},this.timeout)),this.fire("before",this)!==!1&&this.url){var f=this.url,g=this.data,h=this._method.toUpperCase();"GET"===h&&(g&&(f=f+"?"+g),g=null),c.readyState<2&&(c.withCredentials=!0),c.open(h,f,this.asyns),c.onreadystatechange=function(a){var b=a.currentTarget;if(4==b.readyState){var c=b.status,d=b.responseText,f=b.getResponseHeader("Content-Type");if(c>=400&&500>c)return e.reject(b),void this.fire("error","Client Error Code: "+c);if(c>=500)return e.reject(b),void this.fire("error","Server Error code: "+c);if(c>=200&&300>c){try{d=f&&f.indexOf("application/json")>=0?JSON.parse(d):d}catch(g){d=d}b.abort(),e.resolve(d,b),this.fire("success",d)}else b.abort(),e.reject(b),this.fire("error",b);return this.__onComplete(b),d}}.bind(this),this.__initRequestHeader(c,this.headers),c.send(g),this.asyns||this.__onComplete(c)}else this.__onComplete(c);return e.promise},abort:function(){this._XMLHttpRequest&&this._XMLHttpRequest.abort()}}})),c=a.Class({"static":!0,properties:{max:3,count:{get:function(){return this._data.length}}},methods:{init:function(){this._data=[]},getInstance:function(){for(var a=0,c=this._data.length;c>a;a++)if(!this._data[a]._isRunning)return this._data[a].resetEvents(),this._data[a];return function(a){var c=new b;return a._data.push(c),c}(this)}}}),d=a.Class({properties:{timeout:1e3},methods:{init:function(a){this.sets(a)},request:function(b,d){var e=c.getInstance();return a.each(b,function(a,b){"function"==typeof a&&e.on(b,a,this)},this),d&&d(e),e.send(b)},get:function(a){return a.method="GET",this.request(a)},post:function(a){return a.method="POST",this.request(a)},put:function(a){return a.method="PUT",this.request(a)},"delete":function(a){return a.method="DELETE",this.request(a)}}}),e=new d;a.extend(a,{$get:e.get.bind(e),$post:e.post.bind(e),$put:e.put.bind(e),$delete:e.delete.bind(e)})}(zn),function(a){var b=a.Class({events:["init"],properties:{url:null,data:null,method:"POST",headers:null,onExec:null,success:null,error:null,timeout:null},methods:{init:function(a,b,c,d){this.sets({url:a,data:b,method:c,headers:d}),this.fire("init",this)},exec:function(b,c,d,e){var f=b||this._url,g=c||this._data||{},h=d||this._method,i=e||this._headers||{},j=this._onExec&&this._onExec(this);return j===!1?!1:a.GLOBAL.Store.fire("before")===!1?!1:a["$"+h.toLowerCase()]({url:Store.fixURL(f),data:g,success:this._success,error:this._error,timeout:this._timeout,headers:i})},refresh:function(){this.exec()},copyAndExt:function(a){var c=this._data;if("object"==typeof c){c=JSON.parse(JSON.stringify(c));for(var d in a)c[d]=a[d]}else c=a;return new b(this._url,c,this._method)},ext:function(){var a=this._data;for(var b in data)a[b]=data[b];return this}}}),c=a.Class({events:["init"],properties:{url:null,data:null,method:"POST",headers:null,onExec:null,success:null,error:null},methods:{init:function(a,b,c,d){this.sets({url:a,data:b,method:c,headers:d}),this.fire("init",this)},exec:function(b,c,d,e){var f=this,g=b||this._url,h=c||this._data||{},i=d||this._method,j=e||this._headers||{},k=this._onExec&&this._onExec(this);if(k===!1)return!1;switch(i.toUpperCase()){case"POST":var l=new FormData;for(var m in h)l.append(m,h[m]);h=l,j=a.overwrite(j,{Accept:"multipart/form-data","Content-Type":"multipart/form-data; charset=UTF-8"});break;case"GET":break;case"JSON":h=JSON.stringify(h),i="POST",j=a.overwrite(j,{Accept:"multipart/form-data","Content-Type":"multipart/form-data; charset=UTF-8"})}return new Promise(function(a,b){fetch(g,{method:i.toUpperCase(),body:h,headers:j}).then(function(a){return a.json()}).then(function(b){f._success&&f._success(b),a(b)}).catch(function(a){f._error&&f._error(a),b(a)})})},refresh:function(){this.exec()},copyAndExt:function(a){var b=this._data;if("object"==typeof b){b=JSON.parse(JSON.stringify(b));for(var d in a)b[d]=a[d]}else b=a;return new c(this._url,b,this._method)},ext:function(){var a=this._data;for(var b in data)a[b]=data[b];return this}}}),d=a.Class({events:["init","exec"],properties:{data:null,argv:{set:function(a){this._argv=a},get:function(){return this._argv||{}}}},methods:{init:function(a,b){this.reset(a,b),this.fire("init",this)},reset:function(a,b){this.sets({data:a,argv:b})},refresh:function(){this.exec()},exec:function(){var a=this._data;if(a){var b=this._argv.onSubmitBefore&&this._argv.onSubmitBefore(a,this._argv);if(b!==!1)if(void 0!==b&&(a=b),a.__id__)a._onExec||(a._onExec=this._argv.onExec),a._success=function(a,b){var c=Store._success&&Store._success(b);c!==!1&&this._argv.onSuccess&&this._argv.onSuccess(b)}.bind(this),a._error=function(a,b){var c=Store._error&&Store._error(b);c!==!1&&this._argv.onError&&this._argv.onError(b)}.bind(this),a.exec();else{if((this._argv.onExec&&this._argv.onExec(a))===!1)return!1;this._argv.onSuccess&&this._argv.onSuccess(data)}}}}});a.GLOBAL.Store=new a.Class({events:["before","after","success","error"],properties:{HOST:"http://0.0.0.0:8080/"},methods:{requestHandler:function(a,b){this._success=a,this._error=b},request:function(a,c,d,e){return new b(a,c,d,e)},post:function(a,c,d){return new b(a,c,"POST",d)},"delete":function(a,c,d){return new b(a,c,"DELETE",d)},put:function(a,c,d){return new b(a,c,"PUT",d)},get:function(a,c,d){return new b(this.formatURL(a,c),c,"GET",d)},fetch:function(a,b,d,e){return new c(a,b,d,e)},fetchPost:function(a,b,d){return new c(a,b,"POST",d)},fetchGet:function(a,b,d){return new c(this.formatURL(a,b),b,"GET",d)},setHost:function(a){this._HOST=a},getHost:function(){return this._HOST},fixURL:function(a){return a?(a&&-1===a.indexOf("http://")&&(a=this._HOST+a),a):""},formatURL:function(a,b){for(var c in b)a=a.replace(new RegExp("{"+c+"}","gi"),b[c]||"");return a},dataSource:function(a,b){return new d(a,b)}}})}(zn);

@@ -1,1 +0,2 @@

var zn={VERSION:"0.0.1",DEBUG:!1,ZN_PATH:"",PATH:"",GLOBAL:function(){return this}.call(null)};if(zn.GLOBAL&&(zn.GLOBAL.zn=zn),"undefined"!=typeof module&&module.exports)module.exports=zn,zn.ZN_PATH=__dirname,zn.PATH=process.cwd();else{window&&(window.zn=zn);var _zn_url="";try{__a__=__b__}catch(e){e.fileName?_zn_url=e.fileName:e.sourceURL?_zn_url=e.sourceURL:e.stacktrace?console.log(e.stacktrace):e.stack?(_zn_url=e.stack.split("\n")[1],_zn_url=_zn_url.replace(/\s/g,""),_zn_url=_zn_url.substring(2,_zn_url.length)):console.log(e.toString())}if(!_zn_url)for(var _scripts=document.getElementsByTagName("script"),_src="",_node,i=0,_len=scripts.length;_len>i;i++)if(_node=scripts[i],_node.getAttribute&&(_src=_node.getAttribute("src")||"","zn.js"===_src.slice(-5)||"zn.minx.js"===_src.slice(-10))){_zn_url=_src;break}if(!_zn_url)throw new Error("zn.js has not been included, please do it first.");zn.ZN_PATH=_zn_url.substring(0,_zn_url.lastIndexOf("/")+1)}!function(a){var b=Object.prototype.toString,c={idle:function(){},idleArray:function(){return[]},idleObject:function(){return{}},format:function(){var a=arguments,b=null,c=null;return a.length<2?a[0]:(b=a[0].toString(),c=a[1],d.each(c,function(a,c){a=d.is(a,"object")?JSON.stringify(a):a.toString(),b=b.replace(new RegExp("\\{"+c+"\\}","gi"),a)}),b)},uuid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0,c="x"==a?b:3&b|8;return c.toString(16)}).toUpperCase()},fix:function(a){for(var b=a||{},c=1,d=arguments.length;d>c;c++){var e=arguments[c];for(var f in e)e.hasOwnProperty(f)&&"function"!=typeof b[f]&&(b[f]=e[f])}return b},extend:function(a){for(var b=a||{},c=1,d=arguments.length;d>c;c++){var e=arguments[c];for(var f in e)e.hasOwnProperty(f)&&(b[f]=e[f])}return b},overwrite:function(a){for(var b=a||{},c=1,d=arguments.length;d>c;c++){var e=arguments[c];for(var f in e)e.hasOwnProperty(f)&&void 0===b[f]&&(b[f]=e[f])}return b},path:function(a,b,c){var d=a||{};if(b){var e,f=b.split("."),g=f.length,h=0;if(arguments.length<3)for(;d&&g>h;h++)e=f[h],d=d.__get__?d.__get__(e):d[e];else{for(g-=1;d&&g>h;h++)e=f[h],d=d.__get__?d.__get__(e):d[e]=d[e]||{};e=f[h],d&&(d.__set__?d.__set__(e,c):d[e]=c,d=c)}}return d},invoke:function(b,c,d){if(b&&c){var e,f,g=c.lastIndexOf(".");g>0?(e=a.path(b,c.substring(0,g)),e&&(f=e[c.substring(g+1)])):(e=b,f=b[c]),f&&f.apply(e,d)}},deepEachObject:function(a,b,c){if(d.is(a,"object")){var e,f=null;for(var g in a)f=a[g],d.is(f,"object")?this.deepEachObject(f,b,c):(e=b&&b.call(c,f,g,a),void 0!==e&&null!==e&&(a[g]=e))}return a},arrayValueToObject:function(a,b,c){if(d.is(a,"array")){for(var e,f=null,g={},h=0,i=a.length;i>h;h++)f=a[h],e=b&&b.call(c,f,h,a),void 0!==e&&null!==e&&(g[f]=e);a=g}return a}},d={toString:function(a){return a&&a.toString?a.toString():b.call(a)},each:function(a,c,d){if(a&&c)if(a.__each__)a.__each__(c,d);else{var e=a.length,f=null;if(e>0&&"[object Array]"===b.call(a)){for(var g=0;e>g;g++)if(f=c.call(d,a[g],g),f===!1)return!1}else for(var h in a)if(a.hasOwnProperty(h)){if(f=c.call(d,a[h],h),f===!1)return!1;if(-1===f)continue}}},clone:function(b){if(b){if(b.__clone__)return b.__clone__();if(a.is(b,"array"))return b.slice(0);var c={};for(var d in b)b.hasOwnProperty(d)&&(c[d]=b[d]);return c}return b},type:function(a){return a&&a.__type__?a.__type__:b.call(a).slice(8,-1).toLowerCase()},is:function(a,b){if(a&&a.__is__)return a.__is__(b);if("string"==typeof b)switch(b.toLowerCase()){case"plain":return a&&a.constructor===Object;default:return this.type(a)===b}else if("function"==typeof b)return a instanceof b},may:function(a,b){return a?a.__may__?a.__may__(b):a.hasOwnProperty("on"+b):!1},can:function(a,b){return a?a.__can__?a.__can__(b):"function"==typeof a[b]:!1},has:function(a,b){return a?a.__has__?a.__has__(b):a.hasOwnProperty(b):!1},get:function(a,b){return a?a.__get__?a.__get__(b):a[b]:void 0},set:function(a,b,c){a&&(a.__set__?a.__set__(b,c):a[b]=c)},gets:function(a){if(a){if(a.__gets__)return a.__gets__();var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}},sets:function(a,b){if(a&&b)if(a.__sets__)a.__sets__(b);else for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])}};c.extend(a,c),c.extend(a,d)}(zn),function(a){{var b=Array.prototype.slice,c=Object.prototype.hasOwnProperty,d=Object.prototype.toString,e={format:function(){var b=arguments,c=this;return 1==b.length&&"object"==typeof b[0]&&(b=b[0]),a.each(b,function(b,d){b="object"==a.type(b)?JSON.stringify(b):b.toString(),c=c.replace(new RegExp("\\{"+d+"\\}","gi"),b)}),c.toString()}},f={isArray:function(b){return b&&"[object Array]"===a.toString(b)&&b.constructor===Array}},g={forEach:function(a,b){if(!a)return!1;for(var c=0,d=this.length;d>c;c++)a.call(b,this[c],c);return this},indexOf:function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},lastIndexOf:function(a){for(var b=this.length-1;b>=0;b--)if(this[b]===a)return b;return-1}},h={bind:function(a){var c=this;return function(){return c.apply(a,b.call(arguments,1))}}},i={toArray:function(a){return b.call(a)},keys:function(a){if(a!==Object(a))throw new TypeError("Object.keys called on a non-object");var b,d=[];for(b in a)c.call(a,b)&&d.push(b);return d},values:function(a){if(a!==Object(a))throw new TypeError("Object.keys called on a non-object");var b,d=[];for(b in a)c.call(a,b)&&d.push(a[b]);return d},create:function(){var b=function(){};return function(c,d){if(null===c)throw new Error("Cannot set a null [[Prototype]]");if("object"!=typeof c)throw new TypeError("Argument must be an object");return a.each(d,function(a,b){i.defineProperty(c,a,b)}),b.prototype=c,new b}}(),defineProperty:function(a,b,c){return a&&b&&c&&c.hasOwnProperty("value")&&(a[b]=c.value),a}};({parse:function(){return""},stringify:function(){var a=d,b=Array.isArray,c={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},e=function(a){return c[a]||"\\u"+(a.charCodeAt(0)+65536).toString(16).substr(1)},f=/[\\"\u0000-\u001F\u2028\u2029]/g;return function g(c){if(null==c)return"null";if("number"==typeof c)return isFinite(c)?c.toString():"null";if("boolean"==typeof c)return c.toString();if("object"==typeof c){var d;if("function"==typeof c.toJSON)return g(c.toJSON());if(b(c)){d="[";for(var h=0;h<c.length;h++)d+=(h?", ":"")+g(c[h]);return d+"]"}if("[object Object]"===a.call(c)){d=[];for(var i in c)c.hasOwnProperty(i)&&d.push(g(i)+": "+g(c[i]));return"{"+d.join(", ")+"}"}}return'"'+c.toString().replace(f,e)+'"'}}()})}a.fix(Array,f),a.fix(Array.prototype,g),a.fix(Function.prototype,h),a.fix(String.prototype,e)}(zn),function(a){function b(){}function c(){var c,e,f,h=l._arguments.apply(this,arguments),i=h.name,j=h.super,k=h.meta,n=k.methods.init;if(j._static_)throw new Error("Static class cannot be inherited.");if(j._final_)throw new Error("Final class cannot be inherited.");if(i&&k.partial&&(c=a.path(d,i)),k.static){if(c){if(!c._static_)throw new Error('Partial class "'+i+'" must be static.')}else c=function(){throw new Error("Cannot instantiate static class.")};f=c.prototype}else{if(c){if(c._static_)throw new Error('Partial class "'+i+'" must not be static.');if(c._super_!==j&&c._super_!==b)throw new Error('Partial class "'+i+'" must have consistent super class.')}else c=k.abstract?function(){throw new Error("Cannot instantiate abstract class.")}:function(){var b=c._mixins_||[],d=c._ctors_||[],e=null,f=arguments;this.__id__=g++,this.__handlers__={},this.__initializing__=!0,this.__afters__=[];for(var h=null,i=null,j=0,k=b.length;k>j;j++)h=b[j],h["@init"]?(i=h["@init"].meta,i=a.is(i,"function")?i:i.value,m(h.prototype.__super__,this,f),i&&i.call(this)):m(h.prototype.__super__,this,f);m(this.__super__,this,f);for(var l=0,n=d.length;n>l;l++)e=d[l],e=a.is(e,"function")?e:e.value,e&&e.apply(this,f);for(;this.__afters__.length>0;){var o=this.__afters__.pop();o.handler.apply(o.context,f)}this.__afters__=null,delete this.__afters__,this.__initializing__=!1},c._ctors_=[];c._super_!==j?(e=function(){},e.prototype=j.prototype,f=new e,f.constructor=c,f.__type__=i||"Anonymous",f.__super__=j,c.prototype=f):f=c.prototype,f.class=f.constructor,n&&(c._ctors_.push(n),f.__ctor__||(f.__ctor__=n))}return l._meta(c,h),f.__define__&&f.__define__.call(c),i&&a.path(d,i,c),c}var d=a.GLOBAL,e="@",f=1,g=1,h={fixTargetCtor:function(a){return a instanceof b?a.constructor:a},fixTargetKey:function(a){return e+a},defineEvent:function(a,b,c){var d=h.fixTargetCtor(a),e=h.fixTargetKey(b),f=e in d,g={};return f||(g=Object.defineProperty(a,"on"+b.toLowerCase(),{get:function(){var a=this.__handlers__[b];return a?a[0].handler:null},set:function(a){var c=this.__handlers__,d=c[b]=c[b]||[];d[0]={owner:this,handler:a,context:null}}})),d[e]={name:b,type:"event",meta:c,descriptor:g},f},defineProperty:function(b,c,d){var e,f,g=h.fixTargetCtor(b),i=h.fixTargetKey(c),j=i in g,k={};if("value"in d){var l=d.value,m="_"+c,n=d.get,o=d.set;e=n||function(){return m in this?this[m]:a.is(l,"function")?l.call(this):l},f=d.readonly?function(a,b){return b&&b.force?void(this[m]=a):!1}:o||function(a){this[m]=a}}else e=d.get||function(){return void 0},f=d.set||function(){return!1};return j&&(e.__super__=g[i].getter,f.__super__=g[i].setter),k=Object.defineProperty(b,c,{get:e,set:f,configurable:!0}),g[i]={name:c,type:"property",meta:d,getter:e,setter:f,descriptor:k},j},defineMethod:function(a,b,c){var d=h.fixTargetCtor(a),e=h.fixTargetKey(b),f=e in d;return d[e]={name:b,type:"method",meta:c},b in a&&(c.value.__super__=a[b]),a[b]=c.value,f}},i={__handlers__:{},member:function(a,c){var d=h.fixTargetCtor(c||this),e=d[h.fixTargetKey(a)];return e||d===b?e:this.member(a,d._super_)},may:function(a){var b=this.member(a);return b&&"event"==b.type},has:function(a){var b=this.member(a);return b&&"property"==b.type},can:function(a){var b=this.member(a);return b&&"method"==b.type},get:function(a,b){var c=this.member(a);return c&&c.getter?c.getter.call(this,b):void 0},set:function(a,b,c){var d=this.member(a);return d&&d.setter&&d.setter.call(this,b,c),this},gets:function(b){var c={},d=h.fixTargetCtor(this)._properties_;return a.each(d,function(a){c[a]=this.get(a,b)},this),c},sets:function(a,b){if(a)for(var c in a)a.hasOwnProperty(c)&&this.set(c,a[c],b);return this},each:function(a,b){for(var c=h.fixTargetCtor(this)._properties_,d=0,e=c.length;e>d;d++){var f=c[d],g=a.call(b,f,d,this.member(f),this.get(f));if(g===!1)return!1}return this},__may__:function(a){return this.may(a)},__has__:function(a){return this.has(a)},__can__:function(a){return this.can(a)},__get__:function(a){return this.get(a)},__gets__:function(){return this.gets()},__set__:function(a,b){this.set(a,b)},__sets__:function(a){this.sets(a)},__each__:function(a,b){return this.each(a,b)}},j={toString:function(){return"{ ClassName: "+(this._name_||"Anonymous")+", ClassID: "+this._id_+" }"},getProperties:function(b){var c={};if(!this.getMeta||"ZNObject"==this._name_)return c;var d=this._super_,e=this._mixins_;return d&&a.extend(c,d.getProperties(b)),e&&e.length&&a.each(e,function(d){a.extend(c,d.getProperties(b))}),a.each(this.getMeta("properties"),function(a,d){var e=b&&b(d,a)===!1;e||a.hidden||(c[d]=a)}),c},getPropertie:function(b){var c=null;return b&&a.each(this.getProperties(),function(a,d){return b==d&&(c=a),-1}),c},getMeta:function(a){return a?this._meta_[a]:this._meta_},setMeta:function(a,b){return this._meta_[a]=b,this},defineEvent:function(a,b,c){return h.defineEvent(c||this.prototype,a,b)||this._events_.push(a),this},defineProperty:function(a,b,c){return h.defineProperty(c||this.prototype,a,b)||this._properties_.push(a),this},defineMethod:function(a,b,c){return h.defineMethod(c||this.prototype,a,b)||this._methods_.push(a),this}},k={toString:function(){var a={ClassName:this.__name__||"Anonymous",InstanceID:this.__id__,Meta:this.constructor._meta_};return JSON.stringify(a)},toJson:function(){var b={};return a.each(this.constructor.getProperties(),function(a,c){b[c]=this.get(c)},this),b},getProperties:function(){return this.constructor.getProperties()},getPropertie:function(a){return this.constructor.getPropertie(a)},upon:function(b,c,d){if(c){var e=this.__handlers__,f=e[b]=e[b]||[];f[0]=a.extend({owner:this,handler:c},d)}return this},on:function(b,c,d){if(c){var e=this.__handlers__,f=e[b]=e[b]||[{owner:null,handler:null,context:null}];f.push(a.extend({owner:this,handler:c},d))}return this},off:function(a,b,c){var d,e=this.__handlers__[a]||[],f=c&&c.context;if(b)for(var g=e.length-1;g>=0;g--)d=e[g],d.handler!==b||f&&d.context!==f||this.__handlers__[a].splice(g,1);else this.__handlers__[a]=[{owner:null,handler:null,context:null}];return this},fire:function(a,b,c){var d,e=this.__handlers__[a],f=null;if(e)for(var g=0,h=e.length;h>g;g++)if(d=e[g],d&&d.handler&&(f=c&&"apply"==c.method?d.handler.apply(d.context||d.owner,b):d.handler.call(d.context||d.owner,d.owner,b,c),!1===f))return this;return this},dispose:function(){return this.__handlers__={},this},destroy:function(){return this.dispose()},"super":function(){var a=this.super.caller.__super__;return a?a.apply(this,arguments):void 0},is:function(b){if("string"==typeof b&&(b=a.path(d,b)),b){if(this instanceof b)return!0;for(var c=this.constructor._mixins_,e=0,f=c.length;f>e;e++){var g=c[e];if(b===g)return!0}}return!1},__is__:function(a){return this.is(a)},__clone__:function(){}};a.extend(b,i,j,{_id_:0,_name_:"ZNObject",_statics_:{},_events_:[],_properties_:[],_methods_:[],_mixins_:[],_meta_:{}}),a.extend(b.prototype,i,k),a.isZNObject=function(a){return a instanceof b};var l={_arguments:function(){var c,d,e,f=arguments,g=f.length,h=f[0],i={"static":!1,statics:[],partial:!1,"abstract":!1,"final":!1,mixins:[],events:[],properties:[],methods:[]};if(3===g){if(c=h,d=f[1],e=f[2],!a.is(d,"function"))throw new Error("Invalid _super class.")}else if(2===g){if(a.is(h,"string"))c=h,d=null;else{if(!a.is(h,"function"))throw new Error("Invalid _super class.");c=null,d=h}e=f[1]}else{if(1!==g)throw new Error("Invalid arguments.");if(c=null,d=null,e=h,!a.is(e,"object"))throw new Error("The meta argument must be an object.")}return c=c||"",e=a.overwrite(e||{},i),d=d||b,{name:c,"super":d,meta:e}},_meta:function(b,c){var d=c.name,e=c.super,g=c.meta;return a.extend(b,i,j,{_id_:f++,_name_:d,_super_:e,_partial_:g.partial,_abstract_:g.abstract,_static_:g.static,_final_:g.final,_statics_:a.extend({},e._statics_,g.statics),_events_:e._events_.slice(0),_properties_:e._properties_.slice(0),_methods_:e._methods_.slice(0),_mixins_:e._mixins_.concat(g.mixins),_meta_:g}),a.extend(b,b._statics_),g.static?(a.each(g.events,function(a){b.defineEvent(a,{},b)}),a.each(g.properties||g.props,function(c,d){b.defineProperty(d,a.is(c,"object")?c:{value:c},b)}),a.each(g.methods,function(c,d){b.defineMethod(d,a.is(c,"function")?{value:c}:c,b)}),g.methods.init&&g.methods.init.call(b,b)):(a.each(g.mixins,function(c){var d=c.prototype;a.each(c._events_,function(a){b.defineEvent(a,d.member(a).meta)}),a.each(c._properties_,function(a){b.defineProperty(a,d.member(a).meta)}),a.each(c._methods_,function(a){i[a]||k[a]||b.defineMethod(a,d.member(a).meta)})}),a.each(g.events,function(a){b.defineEvent(a,{})}),a.each(g.properties,function(c,d){b.defineProperty(d,a.is(c,"object")?c:{value:c})}),a.each(g.methods,function(c,d){b.defineMethod(d,a.is(c,"function")?{value:c}:c)})),b}},m=function(c,d,e){if(c&&c!==b){var f=c.member("init"),g=c._mixins_,h=null;return f&&f.meta.after&&d.__afters__.push({context:d,handler:f.meta.after}),g.length&&a.each(g,function(b){b["@init"]&&(h=b["@init"].meta,h=a.is(h,"function")?h:h.value,h&&h.call(d))}),f&&f.meta.auto&&f.meta.value.apply(d,e),arguments.callee(c._super_,d)}};a.Class=c}(zn),function(a){var b=".",c="..",d="/",e={PENDING:0,LOADING:1,WAITING:2,LOADED:3},f=null;"undefined"!=typeof module&&module.exports?a.SLASH=d=require("path").sep:f=document;var g={normalizePath:function(a){for(var e,f=a.split(d),g=[f[0]],h=1,i=f.length;i>h;h++)switch(e=f[h]){case b:break;case c:var j=g[g.length-1];j===b||j===c?g.push(c):g.pop();break;default:g.push(e)}return g.join(d)},formatPath:function(b,c){var e=b;e="/"===d?e.split("\\").join(d):e.split("/").join(d);var f=c?c.get("path")||a.PATH:a.PATH,g=e.indexOf(d);return e.indexOf(a.PATH)>-1||e.indexOf(a.ZN_PATH)>-1?e:(e=g>0?f?f.substring(0,f.lastIndexOf(d)+1)+e:e:0===g?a.PATH.substring(0,a.PATH.lastIndexOf(d))+e:a.ZN_PATH+d+e+d,e.slice(-1)===d&&(e+="index.js"),e=this.normalizePath(e))}},h=a.Class("zn.Module",{events:["pending","loading","waiting","loaded"],statics:{all:{},current:null,counter:0,preLoadedPackage:{},unloadModule:function(a){var b=(require.resolve(a),require.cache[a]);b&&b.parent&&b.parent.children.splice(b.parent.children.indexOf(b),1),require.cache[a]=null;var c=h.all[a];return c&&c.parent&&h.unloadModule(c.parent.path),h.all[a]=null,this},loadModule:function(b,c,d){if(a.is(b,h))return b.load(c);if("node:"===b.substring(0,5))return c(require(b.substring(5)));var i=g.formatPath(b,d);f||(i=require.resolve(i));var j=h.all[i];j?j.load(c):(j=h.all[i]=new h(i),h.counter++,f?this.__webModule(i,function(a){if(h.counter--,a)throw new Error("Failed to load module:"+b);j.sets({parent:d,path:i,dependencies:h.current.get("dependencies"),factory:h.current.get("factory"),status:e.LOADING}),j.load(c)}):this.__nodeModule(i,function(){h.counter--,j.sets({parent:d,path:i,dependencies:h.current.get("dependencies"),factory:h.current.get("factory"),status:e.LOADING}),j.load(c)}))},__nodeModule:function(b,c){var d=b,e=c||a.idle;e(require(d))},__webModule:function(b,c){var e=f.head||f.getElementsByTagName("head")[0],g=f.createElement("script"),h=b,i=c||a.idle,j=function(a){g.onload=null,g.onerror=null,i(a)};h=h.slice(-1)===d?h+"index.js":h,h=".js"===h.slice(-3).toLowerCase()?h:h+".js",g.src=h,"onload"in g?g.onload=function(){j(null)}:g.onreadystatechange=function(a){var b=g.readyState;j("loaded"===b||"complete"===b?null:a)},g.onerror=function(a){j(a)},e.appendChild(g)}},properties:{parent:null,status:e.PENDING,path:"",dependencies:null,factory:null,value:{set:function(a){a._ctors_&&(a.$path=this.get("path")),this._value=a},get:function(){return this._value}}},methods:{init:function(a,b,c){this.sets({path:a,dependencies:b||[],factory:c,value:{}}),this._callbacks=[]},exec:function(a){var b=process.argv,c=b[1];return this.sets({path:c,status:e.LOADING}),this.load(a),this},__pending:function(a){this._callbacks.push(a)},__loading:function(b){var c=(this.get("path"),this.get("dependencies")),d=this._depHandler,f=this.get("factory"),g=this.get("value");this.set("status",e.WAITING),this._callbacks.push(b);var i=c.length;if(0===i)g=f.call(g)||g,this.set("value",g),this.set("status",e.LOADED),a.each(this._callbacks,function(a){a(g)});else{var j=[],k=this;a.each(c,function(b,c){d&&(b=d(b,c)),h.loadModule(b,function(b){j[c]=b,i--,0===i&&(g=f.apply(g,j)||g,k.set("value",g),k.set("status",e.LOADED),a.each(k._callbacks,function(a){a(g)}))},k)})}},__waiting:function(a){var b=this;setTimeout(function(){0===h.counter&&b.set("status",e.LOADING),b.load(a)})},__loaded:function(a){a(this.get("value"))},load:function(b){var c=this.get("status"),d=b||a.idle;switch(c){case e.PENDING:this.__pending(d);break;case e.LOADING:this.__loading(d);break;case e.WAITING:this.__waiting(d);break;case e.LOADED:this.__loaded(d)}return this}}});a.define=function(){var b=arguments,c=b.length,d=b[0],e=[],f=null;switch(c){case 1:a.is(d,"function")?f=d:a.is(d,"array")?(e=d,f=function(){var b={};return a.each(arguments,function(c){c._name_?b[c._name_]=c:a.extend(b,c)}),b}):f=function(){return d};break;case 2:e=d,f=b[1];break;case 3:e=d,f=b[1]}return e&&a.is(e,"string")&&(e=[e]),h.current=new h("",e,f),b[2]&&(h.current._depHandler=b[2]),h.current};var i=a.Class("zn.Loader",{"static":!0,properties:{preLoadPackages:[]},methods:{init:function(){for(var a=this.preLoadPackages,b=0,c=a.length;c>b;b++)this.loadPackage(a[b])},loadPackage:function(b){this.load(b+"index.js",function(b){a.extend(h.preLoadedPackage,b)})},load:function(a,b,c){return h.loadModule(a,b,c),this}}});a.load=i.load,a.module=h}(zn),function(a){var b=Array.prototype.slice,c={PENDING:0,CANCLE:1,PAUSE:2,FINISHED:3},d=a.Class({events:["init","finished"],properties:{status:{value:c.PENDING,get:function(){return this._status}}},methods:{init:function(){},doTask:function(a,b){if(a){var c=b||[];c.unshift(this),a.handler.apply(a.context,c)}},done:function(){this._status=c.FINISHED,this._data=b.call(arguments),this.fire("finished",this._data),this.off("finished")}}}),e=a.Class({events:["clear","push","pause","resume","exception","every","finally"],properties:{count:{get:function(){return this._tasks.length}}},methods:{init:function(a){this._exceptions=[],this._finallys=[],this._everys=[],this._tasks=[],this._taskProcessor=[],this._lastTask=null,this._data=[],this._max=(a||{}).max||1},destroy:function(){this._everys=[],this._tasks=[],this._taskProcessor=[],this.fire("finally",this._data,{method:"apply"}),this.super()},clear:function(){this._tasks=[]},pause:function(a){return this._paused=!0,a>0&&(this._pauseTimer=setTimeout(function(){this.resume()}.bind(this),a)),this.fire("pause"),this},resume:function(){return this._pauseTimer&&clearTimeout(this._pauseTimer),this._paused=!1,this.fire("resume"),this.doTask(),this},exception:function(a,b){return this.on("exception",a,b||this),this},"catch":function(a){return this.fire("exception",a),this},"finally":function(a,b){return this.on("finally",a,b||this),this},every:function(a,b){return this.on("every",a,b||this),this},push:function(a,b){var c={handler:a,context:b||this};return this._lastTask&&(c.previous=c,this._lastTask.next=c),this._lastTask=c,this._tasks.push(c),this.fire("push",c),this},getTaskProcessor:function(){for(var a=null,b=this._taskProcessor.length,e=0;b>e;e++)if(a=this._taskProcessor[e],a.status==c.FINISHED)return a;if(!a&&this._max>b){var f=new d;return f.queue=this,f.on("finished",this.__onProcessorFinished.bind(this),this),f}},start:function(){return this._data=[],this.doTask()},doTask:function(a){var b=this._tasks.shift();if(b){var c=this.getTaskProcessor();c&&(b.previousResult=a,c.doTask(b,a))}else this.destroy();return this},__onProcessorFinished:function(a,b){this._data.push(b),this.fire("every",b,{method:"apply"}),this.doTask(b)}}});a.queue=function(a){return new e(a)}}(zn),function(a){var b={ISO8601:"yyyy-MM-dd hh:mm:ss.SSS",ISO8601_WITH_TZ_OFFSET:"yyyy-MM-ddThh:mm:ssO",DATETIME:"dd MM yyyy hh:mm:ss.SSS",ABSOLUTETIME:"hh:mm:ss.SSS"},c=a.Class("zn.util.DateUtil",{"static":!0,properties:{},methods:{init:function(){},asString:function(a){var c=b.ISO8601;"string"==typeof a&&(c=arguments[0],a=arguments[1]);var d=this.__addZero(a.getDate()),e=this.__addZero(a.getMonth()+1),f=this.__addZero(a.getFullYear()),g=this.__addZero(a.getFullYear().toString().substring(2,4)),h=c.indexOf("yyyy")>-1?f:g,i=this.__addZero(a.getHours()),j=this.__addZero(a.getMinutes()),k=this.__addZero(a.getSeconds()),l=this.__padWithZeros(a.getMilliseconds(),3),m=this.__offset(a),n=c.replace(/dd/g,d).replace(/MM/g,e).replace(/y{1,4}/g,h).replace(/hh/g,i).replace(/mm/g,j).replace(/ss/g,k).replace(/SSS/g,l).replace(/O/g,m);return n},__padWithZeros:function(a,b){for(var c=a+"";c.length<b;)c="0"+c;return c},__addZero:function(a){return this.__padWithZeros(a,2)},__offset:function(a){var b=Math.abs(a.getTimezoneOffset()),c=String(Math.floor(b/60)),d=String(b%60);return 1==c.length&&(c="0"+c),1==d.length&&(d="0"+d),a.getTimezoneOffset()<0?"+"+c+d:"-"+c+d}}}),d=["INFO","DEBUG","WARNING","ERROR","TRACE","","INIT"],e=["#100000","#2125a0","#a82c2c","#c045b7","1cb131","","#100000"],f=[38,34,35,31,32,36,33],g={INFO:0,DEBUG:1,WARNING:2,ERROR:3,TRACE:4,INIT:6},h=a.Class({"static":!0,properties:{},methods:{init:function(){},info:function(a){this.__log(g.INFO,a)},debug:function(a){this.__log(g.DEBUG,a)},warn:function(a){this.__log(g.WARNING,a)},trace:function(a){this.__log(g.TRACE,a)},error:function(a){this.__log(g.ERROR,a)},__getDateString:function(a){return c.asString(a||new Date)},__getPosition:function(){try{throw new Error}catch(a){var b=a.stack.split("\n")[4].replace(/\(/g,"").replace(/\)/g,"").split("/").pop();return b}},__formatLog4Server:function(a,b){var c="",e="",g="";return b&&(e="[",g="",c=f[5]+"m",b=f[a.type]+"m"),[a.time," [",e,b,d[a.type],g,"] ",a.message].join("")},__formatLog4Client:function(a){return["%c"+a.time," [",d[a.type],"] ",a.message].join("")},__log:function(a,b){var c={type:a,message:"object"==typeof b?JSON.stringify(b):b,time:this.__getDateString(),pos:this.__getPosition()};"undefined"!=typeof module&&module.exports?console.log(this.__formatLog4Server(c,!0)):console.log(this.__formatLog4Client(c,!0),"color:"+e[a])}}}),i={info:function(){h.info.apply(h,arguments)},debug:function(){h.debug.apply(h,arguments)},warn:function(){h.warn.apply(h,arguments)},trace:function(){h.trace.apply(h,arguments)},error:function(){h.error.apply(h,arguments)}};a.extend(a,i)}(zn),function(a){var b=Array.prototype.slice,c={PENDING:0,FULFILLED:1,REJECTED:2},d=a.Class({"static":!0,methods:{init:function(){this._exceptions=[],this._finallys=[],this._count=0,this._currIndex=0,this._dataArray=[]},exception:function(a){return this._exceptions.push(a),this},"catch":function(b,c){return a.each(this._exceptions,function(a){a.call(c,b)}),this},"finally":function(a){return this._finallys.push(a),this},defer:function(b,c){var d=this,f=new e(b,c);return f.on("complete",function(b,c){d._currIndex++,d._dataArray.push(c),d._currIndex==d._count&&(a.each(d._finallys,function(b){try{b(d._dataArray)}catch(c){a.error(c.message)}}),d._finallys=[])}),d._count++,f},all:function(b){var c=d.defer(),e=0,f=[];return a.each(b,function(a){a.then(function(a){f.push(a),e++,e>=b.length&&c.resolve(f)})}),c.promise},any:function(b){var c=d.defer();return a.each(b,function(a){a.then(function(a){c.resolve(a)})}),c.promise}}}),e=a.Class({events:["complete"],properties:{promise:null},methods:{init:function(a,b){this._promise=new f,a&&this.resolve(a),b&&this.reject(b)},resolve:function(){var e=b.call(arguments);try{var f=this.get("promise"),g=this;if(f.get("readyState")!=c.PENDING)return;f.set("readyState",c.FULFILLED),f.set("data",e),a.each(f.get("resolves"),function(a){a.apply(g,e)})}catch(h){d.catch(h,this)}this.fire("complete",e)},reject:function(){var a=b.call(arguments);try{var e=this.get("promise");if(e.get("readyState")!=c.PENDING)return;e.set("readyState",c.REJECTED),e.set("reason",a);var f=e.get("rejects")[0];f&&f.apply(this,a)}catch(g){d.catch(g,this)}this.fire("complete",a)}}}),f=a.Class({statics:{isPromise:function(a){return null!==a&&void 0!==a&&"function"==typeof a.then},defer:null},properties:{resolves:null,rejects:null,data:null,reason:null,readyState:null},methods:{init:function(){this.set("resolves",[]),this.set("rejects",[]),this.set("exceptions",[]),this.set("readyState",c.PENDING)},then:function(a,d){function g(){var c=b.call(arguments),d=a?a.apply(this,c):c;return f.isPromise(d)?d.then(function(){h.resolve.apply(h,b.call(arguments))}):h.resolve.apply(h,d),d}var h=new e;if(this.get("readyState")===c.PENDING)this.get("resolves").push(g),this.get("rejects").push(d?d:function(){h.reject.apply(h,b.call(arguments))});else if(this.get("readyState")===c.FULFILLED){var i=this;setTimeout(function(){g.apply(i,i.get("data"))})}return h.promise},"catch":function(a){return d.exception(a)},"finally":function(a){return d.finally(a)},otherwise:function(a){return this.then(void 0,a)}}});a.async=d}(zn),function(a){var b=(a.Class({events:["init","start","stop","cancle","goNext","goPre"],properties:{pre:null,next:null,delay:null,action:null,args:[],context:this,taskList:null,status:{value:"",get:function(){return this._status}}},methods:{init:function(a){this.sets(a),this.fire("init",this)},start:function(){"started"!=this._status&&(this._action?(this._action.apply(this._context,this._args),this._status="started"):this.goNext(),this.fire("start",this))},stop:function(){this._status="stoped",this.fire("stop",this)},cancle:function(){this._status="cancle",this.fire("cancle",this)},goNext:function(){this._next&&this._next.start(),this.fire("goNext",this)},goPre:function(){this._pre&&this._pre.start(),this.fire("goPre",this)}}}),a.Class({properties:{url:"",data:{set:function(a){this._data=a},get:function(){return a.is(this._data,"object")?JSON.stringify(this._data):this._data}},method:"GET",asyns:!0,username:null,password:null,headers:{get:function(){return a.overwrite({"X-Requested-With":"XMLHttpRequest","Content-type":"application/json"},this._headers)},set:function(a){this._headers=a}},timeout:{get:function(){return this._timeout||2e4},set:function(a){this._timeout=a}}},events:["before","after","success","error","complete","timeout"],methods:{init:function(a){this.sets(a),this._isRunning=!1},__initXMLHttpRequest:function(){if(this._XMLHttpRequest)return this._XMLHttpRequest;if(!window.ActiveXObject)return this._XMLHttpRequest=new XMLHttpRequest,this._XMLHttpRequest;for(var a="MSXML2.XMLHTTP",b=["Microsoft.XMLHTTP",a,a+".3.0",a+".4.0",a+".5.0",a+".6.0"],c=b.length,d=c-1;d>-1;d--)try{return this._XMLHttpRequest=new ActiveXObject(b[d]),this._XMLHttpRequest}catch(e){continue}},__onComplete:function(a){clearTimeout(this._timeoutID),this._isRunning=!1,this.resetEvents(),this.fire("complete",a)},__initRequestHeader:function(a,b){for(var c in b)a.setRequestHeader(c,b[c])},resetEvents:function(){this.off("before"),this.off("after"),this.off("success"),this.off("error"),this.off("complete"),this.off("timeout")},send:function(b){if(this._isRunning)return!1;this.sets(b);var c=this.__initXMLHttpRequest(),d=this,e=a.async.defer();if(this._isRunning=!0,this.timeout&&(this._timeoutID=setTimeout(function(){d._isRunning&&(c.abort(),d.fire("timeout",d),d.__onComplete("timeout"))},this.timeout)),this.fire("before",this)!==!1&&this.url){var f=this.url,g=this.data,h=this._method.toUpperCase();"GET"===h&&(g&&(f=f+"?"+g),g=null),c.readyState<2&&(c.withCredentials=!0),c.open(h,f,this.asyns),c.onreadystatechange=function(a){var b=a.currentTarget;if(4==b.readyState){var c=b.status,d=b.responseText,f=b.getResponseHeader("Content-Type");if(c>=400&&500>c)return e.reject(b),void this.fire("error","Client Error Code: "+c);if(c>=500)return e.reject(b),void this.fire("error","Server Error code: "+c);try{d=f&&f.indexOf("application/json")>=0?JSON.parse(d):d}catch(g){d=d}return c>=200&&300>c?(e.resolve(d,b),this.fire("success",d)):(e.reject(b),this.fire("error",b)),this.__onComplete(b),d}}.bind(this),this.__initRequestHeader(c,this.headers),c.send(g),this.asyns||this.__onComplete(c)}else this.__onComplete(c);return e.promise},abort:function(){this._XMLHttpRequest&&this._XMLHttpRequest.abort()}}})),c=a.Class({"static":!0,properties:{max:3,count:{get:function(){return this._data.length}}},methods:{init:function(){this._data=[]},getInstance:function(){for(var a=0,c=this._data.length;c>a;a++)if(!this._data[a]._isRunning)return this._data[a].resetEvents(),this._data[a];return function(a){var c=new b;return a._data.push(c),c}(this)}}}),d=a.Class({properties:{timeout:1e3},methods:{init:function(a){this.sets(a)},request:function(b,d){var e=c.getInstance();return a.each(b,function(a,b){"function"==typeof a&&e.on(b,a,this)},this),d&&d(e),e.send(b)},get:function(a){return a.method="GET",this.request(a)},post:function(a){return a.method="POST",this.request(a)},put:function(a){return a.method="PUT",this.request(a)},"delete":function(a){return a.method="DELETE",this.request(a)}}}),e=new d;a.extend(a,{$get:e.get.bind(e),$post:e.post.bind(e),$put:e.put.bind(e),$delete:e.delete.bind(e)})}(zn);
var __isServer="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0),zn={VERSION:"0.0.1",DEBUG:!1,ZN_PATH:"",PATH:"",isServer:__isServer,GLOBAL:function(){return __isServer?global:window}.call(null)};if(zn.GLOBAL.zn=zn,__isServer)zn.ZN_PATH=__dirname,zn.PATH=process.cwd(),module.exports=zn;else{var _zn_url="";try{__a__=__b__}catch(e){e.fileName?_zn_url=e.fileName:e.sourceURL?_zn_url=e.sourceURL:e.stacktrace?console.log(e.stacktrace):e.stack?(_zn_url=e.stack.split("\n")[1],_zn_url=_zn_url.replace(/\s/g,""),_zn_url=_zn_url.substring(2,_zn_url.length)):console.log(e.toString())}if(!_zn_url)for(var _scripts=document.getElementsByTagName("script"),_src="",_node,i=0,_len=scripts.length;_len>i;i++)if(_node=scripts[i],_node.getAttribute&&(_src=_node.getAttribute("src")||"","zn.js"===_src.slice(-5)||"zn.minx.js"===_src.slice(-10))){_zn_url=_src;break}if(!_zn_url)throw new Error("zn.js has not been included, please do it first.");zn.ZN_PATH=_zn_url.substring(0,_zn_url.lastIndexOf("/")+1)}!function(a){var b=Object.prototype.toString,c={idle:function(){},idleArray:function(){return[]},idleObject:function(){return{}},format:function(){var a=arguments,b=null,c=null;return a.length<2?a[0]:(b=a[0].toString(),c=a[1],d.each(c,function(a,c){a=d.is(a,"object")?JSON.stringify(a):a.toString(),b=b.replace(new RegExp("\\{"+c+"\\}","gi"),a)}),b)},uuid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0,c="x"==a?b:3&b|8;return c.toString(16)}).toUpperCase()},serializeJSON:function(a){return Object.keys(a).map(function(b){return encodeURIComponent(b)+"="+encodeURIComponent(a[b])}).join("&")},fix:function(a){for(var b=a||{},c=1,d=arguments.length;d>c;c++){var e=arguments[c];for(var f in e)e.hasOwnProperty(f)&&"function"!=typeof b[f]&&(b[f]=e[f])}return b},extend:function(a){for(var b=a||{},c=1,d=arguments.length;d>c;c++){var e=arguments[c];for(var f in e)e.hasOwnProperty(f)&&(b[f]=e[f])}return b},overwrite:function(a){for(var b=a||{},c=1,d=arguments.length;d>c;c++){var e=arguments[c];for(var f in e)e.hasOwnProperty(f)&&void 0===b[f]&&(b[f]=e[f])}return b},path:function(a,b,c){var d=a||{};if(b){var e,f=b.split("."),g=f.length,h=0;if(arguments.length<3)for(;d&&g>h;h++)e=f[h],d=d.__get__?d.__get__(e):d[e];else{for(g-=1;d&&g>h;h++)e=f[h],d=d.__get__?d.__get__(e):d[e]=d[e]||{};e=f[h],d&&(d.__set__?d.__set__(e,c):d[e]=c,d=c)}}return d},invoke:function(b,c,d){if(b&&c){var e,f,g=c.lastIndexOf(".");g>0?(e=a.path(b,c.substring(0,g)),e&&(f=e[c.substring(g+1)])):(e=b,f=b[c]),f&&f.apply(e,d)}},deepEachObject:function(a,b,c){if(d.is(a,"object")){var e,f=null;for(var g in a)f=a[g],d.is(f,"object")?this.deepEachObject(f,b,c):(e=b&&b.call(c,f,g,a),void 0!==e&&null!==e&&(a[g]=e))}return a},arrayValueToObject:function(a,b,c){if(d.is(a,"array")){for(var e,f=null,g={},h=0,i=a.length;i>h;h++)f=a[h],e=b&&b.call(c,f,h,a),void 0!==e&&null!==e&&(g[f]=e);a=g}return a}},d={toString:function(a){return a&&a.toString?a.toString():b.call(a)},each:function(a,c,d){if(a&&c)if(a.__each__)a.__each__(c,d);else{var e=a.length,f=null;if(e>0&&"[object Array]"===b.call(a)){for(var g=0;e>g;g++)if(f=c.call(d,a[g],g),f===!1)return!1}else for(var h in a)if(a.hasOwnProperty(h)){if(f=c.call(d,a[h],h),f===!1)return!1;if(-1===f)continue}}},clone:function(b){if(b){if(b.__clone__)return b.__clone__();if(a.is(b,"array"))return b.slice(0);var c={};for(var d in b)b.hasOwnProperty(d)&&(c[d]=b[d]);return c}return b},type:function(a){return a&&a.__type__?a.__type__:b.call(a).slice(8,-1).toLowerCase()},is:function(a,b){if(a&&a.__is__)return a.__is__(b);if("string"==typeof b)switch(b.toLowerCase()){case"plain":return a&&a.constructor===Object;default:return this.type(a)===b}else if("function"==typeof b)return a instanceof b},may:function(a,b){return a?a.__may__?a.__may__(b):a.hasOwnProperty("on"+b):!1},can:function(a,b){return a?a.__can__?a.__can__(b):"function"==typeof a[b]:!1},has:function(a,b){return a?a.__has__?a.__has__(b):a.hasOwnProperty(b):!1},get:function(a,b){return a?a.__get__?a.__get__(b):a[b]:void 0},set:function(a,b,c){a&&(a.__set__?a.__set__(b,c):a[b]=c)},gets:function(a){if(a){if(a.__gets__)return a.__gets__();var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}},sets:function(a,b){if(a&&b)if(a.__sets__)a.__sets__(b);else for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])}};c.extend(a,c),c.extend(a,d)}(zn),function(a){{var b=Array.prototype.slice,c=Object.prototype.hasOwnProperty,d=Object.prototype.toString,e={format:function(){var b=arguments,c=this;return 1==b.length&&"object"==typeof b[0]&&(b=b[0]),a.each(b,function(b,d){b="object"==a.type(b)?JSON.stringify(b):b.toString(),c=c.replace(new RegExp("\\{"+d+"\\}","gi"),b)}),c.toString()}},f={isArray:function(b){return b&&"[object Array]"===a.toString(b)&&b.constructor===Array}},g={forEach:function(a,b){if(!a)return!1;for(var c=0,d=this.length;d>c;c++)a.call(b,this[c],c);return this},indexOf:function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},lastIndexOf:function(a){for(var b=this.length-1;b>=0;b--)if(this[b]===a)return b;return-1}},h={bind:function(a){var c=this;return function(){return c.apply(a,b.call(arguments,1))}}},i={toArray:function(a){return b.call(a)},keys:function(a){if(a!==Object(a))throw new TypeError("Object.keys called on a non-object");var b,d=[];for(b in a)c.call(a,b)&&d.push(b);return d},values:function(a){if(a!==Object(a))throw new TypeError("Object.keys called on a non-object");var b,d=[];for(b in a)c.call(a,b)&&d.push(a[b]);return d},create:function(){var b=function(){};return function(c,d){if(null===c)throw new Error("Cannot set a null [[Prototype]]");if("object"!=typeof c)throw new TypeError("Argument must be an object");return a.each(d,function(a,b){i.defineProperty(c,a,b)}),b.prototype=c,new b}}(),defineProperty:function(a,b,c){return a&&b&&c&&c.hasOwnProperty("value")&&(a[b]=c.value),a}};({parse:function(){return""},stringify:function(){var a=d,b=Array.isArray,c={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},e=function(a){return c[a]||"\\u"+(a.charCodeAt(0)+65536).toString(16).substr(1)},f=/[\\"\u0000-\u001F\u2028\u2029]/g;return function g(c){if(null==c)return"null";if("number"==typeof c)return isFinite(c)?c.toString():"null";if("boolean"==typeof c)return c.toString();if("object"==typeof c){var d;if("function"==typeof c.toJSON)return g(c.toJSON());if(b(c)){d="[";for(var h=0;h<c.length;h++)d+=(h?", ":"")+g(c[h]);return d+"]"}if("[object Object]"===a.call(c)){d=[];for(var i in c)c.hasOwnProperty(i)&&d.push(g(i)+": "+g(c[i]));return"{"+d.join(", ")+"}"}}return'"'+c.toString().replace(f,e)+'"'}}()})}a.fix(Array,f),a.fix(Array.prototype,g),a.fix(Function.prototype,h),a.fix(String.prototype,e)}(zn),function(a){function b(){}function c(){var c,e,f,h=l._arguments.apply(this,arguments),i=h.name,j=h.super,k=h.meta,n=k.methods.init;if(j._static_)throw new Error("Static class cannot be inherited.");if(j._final_)throw new Error("Final class cannot be inherited.");if(i&&k.partial&&(c=a.path(d,i)),k.static){if(c){if(!c._static_)throw new Error('Partial class "'+i+'" must be static.')}else c=function(){throw new Error("Cannot instantiate static class.")};f=c.prototype}else{if(c){if(c._static_)throw new Error('Partial class "'+i+'" must not be static.');if(c._super_!==j&&c._super_!==b)throw new Error('Partial class "'+i+'" must have consistent super class.')}else c=k.abstract?function(){throw new Error("Cannot instantiate abstract class.")}:function(){var b=c._mixins_||[],d=c._ctors_||[],e=null,f=arguments;this.__id__=g++,this.__handlers__={},this.__initializing__=!0,this.__afters__=[];for(var h=null,i=null,j=0,k=b.length;k>j;j++)h=b[j],h["@init"]?(i=h["@init"].meta,i=a.is(i,"function")?i:i.value,m(h.prototype.__super__,this,f),i&&i.call(this)):m(h.prototype.__super__,this,f);m(this.__super__,this,f);for(var l=0,n=d.length;n>l;l++)e=d[l],e=a.is(e,"function")?e:e.value,e&&e.apply(this,f);for(;this.__afters__.length>0;){var o=this.__afters__.pop();o.handler.apply(o.context,f)}this.__afters__=null,delete this.__afters__,this.__initializing__=!1},c._ctors_=[];c._super_!==j?(e=function(){},e.prototype=j.prototype,f=new e,f.constructor=c,f.__type__=i||"Anonymous",f.__super__=j,c.prototype=f):f=c.prototype,f.class=f.constructor,n&&(c._ctors_.push(n),f.__ctor__||(f.__ctor__=n))}return l._meta(c,h),f.__define__&&f.__define__.call(c),i&&a.path(d,i,c),c}var d=a.GLOBAL,e="@",f=1,g=1,h={fixTargetCtor:function(a){return a instanceof b?a.constructor:a},fixTargetKey:function(a){return e+a},defineEvent:function(a,b,c){var d=h.fixTargetCtor(a),e=h.fixTargetKey(b),f=e in d,g={};return f||(g=Object.defineProperty(a,"on"+b.toLowerCase(),{get:function(){var a=this.__handlers__[b];return a?a[0].handler:null},set:function(a){var c=this.__handlers__,d=c[b]=c[b]||[];d[0]={owner:this,handler:a,context:null}}})),d[e]={name:b,type:"event",meta:c,descriptor:g},f},defineProperty:function(b,c,d){var e,f,g=h.fixTargetCtor(b),i=h.fixTargetKey(c),j=i in g,k={};if("value"in d){var l=d.value,m="_"+c,n=d.get,o=d.set;e=n||function(){return m in this?this[m]:a.is(l,"function")?l.call(this):l},f=d.readonly?function(a,b){return b&&b.force?void(this[m]=a):!1}:o||function(a){this[m]=a}}else e=d.get||function(){return void 0},f=d.set||function(){return!1};return j&&(e.__super__=g[i].getter,f.__super__=g[i].setter),k=Object.defineProperty(b,c,{get:e,set:f,configurable:!0}),g[i]={name:c,type:"property",meta:d,getter:e,setter:f,descriptor:k},j},defineMethod:function(a,b,c){var d=h.fixTargetCtor(a),e=h.fixTargetKey(b),f=e in d;return d[e]={name:b,type:"method",meta:c},b in a&&(c.value.__super__=a[b]),a[b]=c.value,f}},i={__handlers__:{},member:function(a,c){var d=h.fixTargetCtor(c||this),e=d[h.fixTargetKey(a)];return e||d===b?e:this.member(a,d._super_)},may:function(a){var b=this.member(a);return b&&"event"==b.type},has:function(a){var b=this.member(a);return b&&"property"==b.type},can:function(a){var b=this.member(a);return b&&"method"==b.type},get:function(a,b){var c=this.member(a);return c&&c.getter?c.getter.call(this,b):void 0},set:function(a,b,c){var d=this.member(a);return d&&d.setter&&d.setter.call(this,b,c),this},gets:function(b){var c={},d=h.fixTargetCtor(this)._properties_;return a.each(d,function(a){c[a]=this.get(a,b)},this),c},sets:function(a,b){if(a)for(var c in a)a.hasOwnProperty(c)&&this.set(c,a[c],b);return this},each:function(a,b){for(var c=h.fixTargetCtor(this)._properties_,d=0,e=c.length;e>d;d++){var f=c[d],g=a.call(b,f,d,this.member(f),this.get(f));if(g===!1)return!1}return this},__may__:function(a){return this.may(a)},__has__:function(a){return this.has(a)},__can__:function(a){return this.can(a)},__get__:function(a){return this.get(a)},__gets__:function(){return this.gets()},__set__:function(a,b){this.set(a,b)},__sets__:function(a){this.sets(a)},__each__:function(a,b){return this.each(a,b)}},j={toString:function(){return"{ ClassName: "+(this._name_||"Anonymous")+", ClassID: "+this._id_+" }"},getProperties:function(b){var c={};if(!this.getMeta||"ZNObject"==this._name_)return c;var d=this._super_,e=this._mixins_;return d&&a.extend(c,d.getProperties(b)),e&&e.length&&a.each(e,function(d){a.extend(c,d.getProperties(b))}),a.each(this.getMeta("properties"),function(a,d){var e=b&&b(d,a)===!1;e||a.hidden||(c[d]=a)}),c},getPropertie:function(b){var c=null;return b&&a.each(this.getProperties(),function(a,d){return b==d&&(c=a),-1}),c},getMeta:function(a){return a?this._meta_[a]:this._meta_},setMeta:function(a,b){return this._meta_[a]=b,this},defineEvent:function(a,b,c){return h.defineEvent(c||this.prototype,a,b)||this._events_.push(a),this},defineProperty:function(a,b,c){return h.defineProperty(c||this.prototype,a,b)||this._properties_.push(a),this},defineMethod:function(a,b,c){return h.defineMethod(c||this.prototype,a,b)||this._methods_.push(a),this}},k={toString:function(){var a={ClassName:this.__name__||"Anonymous",InstanceID:this.__id__,Meta:this.constructor._meta_};return JSON.stringify(a)},toJson:function(){var b={};return a.each(this.constructor.getProperties(),function(a,c){b[c]=this.get(c)},this),b},getProperties:function(){return this.constructor.getProperties()},getPropertie:function(a){return this.constructor.getPropertie(a)},upon:function(b,c,d){if(c){var e=this.__handlers__,f=e[b]=e[b]||[];f[0]=a.extend({owner:this,handler:c},d)}return this},on:function(b,c,d){if(c){var e=this.__handlers__,f=e[b]=e[b]||[{owner:null,handler:null,context:null}];f.push(a.extend({owner:this,handler:c},d))}return this},off:function(a,b,c){var d,e=this.__handlers__[a]||[],f=c&&c.context;if(b)for(var g=e.length-1;g>=0;g--)d=e[g],d.handler!==b||f&&d.context!==f||this.__handlers__[a].splice(g,1);else this.__handlers__[a]=[{owner:null,handler:null,context:null}];return this},fire:function(a,b,c){var d,e=this.__handlers__[a],f=null;if(e)for(var g=0,h=e.length;h>g;g++)if(d=e[g],d&&d.handler&&(f=c&&"apply"==c.method?d.handler.apply(d.context||d.owner,b):d.handler.call(d.context||d.owner,d.owner,b,c),!1===f))return!1;return this},dispose:function(){return this.__handlers__={},this},destroy:function(){return this.dispose()},"super":function(){var a=this.super.caller.__super__;return a?a.apply(this,arguments):void 0},is:function(b){if("string"==typeof b&&(b=a.path(d,b)),b){if(this instanceof b)return!0;for(var c=this.constructor._mixins_,e=0,f=c.length;f>e;e++){var g=c[e];if(b===g)return!0}}return!1},__is__:function(a){return this.is(a)},__clone__:function(){}};a.extend(b,i,j,{_id_:0,_name_:"ZNObject",_statics_:{},_events_:[],_properties_:[],_methods_:[],_mixins_:[],_meta_:{}}),a.extend(b.prototype,i,k),a.isZNObject=function(a){return a instanceof b};var l={_arguments:function(){var c,d,e,f=arguments,g=f.length,h=f[0],i={"static":!1,statics:[],partial:!1,"abstract":!1,"final":!1,mixins:[],events:[],properties:[],methods:[]};if(3===g){if(c=h,d=f[1],e=f[2],!a.is(d,"function"))throw new Error("Invalid _super class.")}else if(2===g){if(a.is(h,"string"))c=h,d=null;else{if(!a.is(h,"function"))throw new Error("Invalid _super class.");c=null,d=h}e=f[1]}else{if(1!==g)throw new Error("Invalid arguments.");if(c=null,d=null,e=h,!a.is(e,"object"))throw new Error("The meta argument must be an object.")}return c=c||"",e=a.overwrite(e||{},i),d=d||b,{name:c,"super":d,meta:e}},_meta:function(b,c){var d=c.name,e=c.super,g=c.meta;return a.extend(b,i,j,{_id_:f++,_name_:d,_super_:e,_partial_:g.partial,_abstract_:g.abstract,_static_:g.static,_final_:g.final,_statics_:a.extend({},e._statics_,g.statics),_events_:e._events_.slice(0),_properties_:e._properties_.slice(0),_methods_:e._methods_.slice(0),_mixins_:e._mixins_.concat(g.mixins),_meta_:g}),a.extend(b,b._statics_),g.static?(a.each(g.events,function(a){b.defineEvent(a,{},b)}),a.each(g.properties||g.props,function(c,d){b.defineProperty(d,a.is(c,"object")?c:{value:c},b)}),a.each(g.methods,function(c,d){b.defineMethod(d,a.is(c,"function")?{value:c}:c,b)}),g.methods.init&&g.methods.init.call(b,b)):(a.each(g.mixins,function(c){var d=c.prototype;a.each(c._events_,function(a){b.defineEvent(a,d.member(a).meta)}),a.each(c._properties_,function(a){b.defineProperty(a,d.member(a).meta)}),a.each(c._methods_,function(a){i[a]||k[a]||b.defineMethod(a,d.member(a).meta)})}),a.each(g.events,function(a){b.defineEvent(a,{})}),a.each(g.properties,function(c,d){b.defineProperty(d,a.is(c,"object")?c:{value:c})}),a.each(g.methods,function(c,d){b.defineMethod(d,a.is(c,"function")?{value:c}:c)})),b}},m=function(c,d,e){if(c&&c!==b){var f=c.member("init"),g=c._mixins_,h=null;return f&&f.meta.after&&d.__afters__.push({context:d,handler:f.meta.after}),g.length&&a.each(g,function(b){b["@init"]&&(h=b["@init"].meta,h=a.is(h,"function")?h:h.value,h&&h.call(d))}),f&&f.meta.auto&&f.meta.value.apply(d,e),arguments.callee(c._super_,d)}};a.Class=c}(zn),function(a){var b=".",c="..",d="/",e={PENDING:0,LOADING:1,WAITING:2,LOADED:3},f=null;"undefined"!=typeof module&&module.exports?a.SLASH=d=require("path").sep:f=document;var g={normalizePath:function(a){for(var e,f=a.split(d),g=[f[0]],h=1,i=f.length;i>h;h++)switch(e=f[h]){case b:break;case c:var j=g[g.length-1];j===b||j===c?g.push(c):g.pop();break;default:g.push(e)}return g.join(d)},formatPath:function(b,c){var e=b;e="/"===d?e.split("\\").join(d):e.split("/").join(d);var f=c?c.get("path")||a.PATH:a.PATH,g=e.indexOf(d);return e.indexOf(a.PATH)>-1||e.indexOf(a.ZN_PATH)>-1?e:(e=g>0?f?f.substring(0,f.lastIndexOf(d)+1)+e:e:0===g?a.PATH.substring(0,a.PATH.lastIndexOf(d))+e:a.ZN_PATH+d+e+d,e.slice(-1)===d&&(e+="index.js"),e=this.normalizePath(e))}},h=a.Class("zn.Module",{events:["pending","loading","waiting","loaded"],statics:{all:{},current:null,counter:0,preLoadedPackage:{},unloadModule:function(a){var b=(require.resolve(a),require.cache[a]);b&&b.parent&&b.parent.children.splice(b.parent.children.indexOf(b),1),require.cache[a]=null;var c=h.all[a];return c&&c.parent&&h.unloadModule(c.parent.path),h.all[a]=null,this},loadModule:function(b,c,d){if(a.is(b,h))return b.load(c);if("node:"===b.substring(0,5))return c(require(b.substring(5)));var i=g.formatPath(b,d);f||(i=require.resolve(i));var j=h.all[i];j?j.load(c):(j=h.all[i]=new h(i),h.counter++,f?this.__webModule(i,function(a){if(h.counter--,a)throw new Error("Failed to load module:"+b);j.sets({parent:d,path:i,dependencies:h.current.get("dependencies"),factory:h.current.get("factory"),status:e.LOADING}),j.load(c)}):this.__nodeModule(i,function(){h.counter--,j.sets({parent:d,path:i,dependencies:h.current.get("dependencies"),factory:h.current.get("factory"),status:e.LOADING}),j.load(c)}))},__nodeModule:function(b,c){var d=b,e=c||a.idle;e(require(d))},__webModule:function(b,c){var e=f.head||f.getElementsByTagName("head")[0],g=f.createElement("script"),h=b,i=c||a.idle,j=function(a){g.onload=null,g.onerror=null,i(a)};h=h.slice(-1)===d?h+"index.js":h,h=".js"===h.slice(-3).toLowerCase()?h:h+".js",g.src=h,"onload"in g?g.onload=function(){j(null)}:g.onreadystatechange=function(a){var b=g.readyState;j("loaded"===b||"complete"===b?null:a)},g.onerror=function(a){j(a)},e.appendChild(g)}},properties:{parent:null,status:e.PENDING,path:"",dependencies:null,factory:null,value:{set:function(a){a._ctors_&&(a.$path=this.get("path")),this._value=a},get:function(){return this._value}}},methods:{init:function(a,b,c){this.sets({path:a,dependencies:b||[],factory:c,value:{}}),this._callbacks=[]},exec:function(a){var b=process.argv,c=b[1];return this.sets({path:c,status:e.LOADING}),this.load(a),this},__pending:function(a){this._callbacks.push(a)},__loading:function(b){var c=(this.get("path"),this.get("dependencies")),d=this._depHandler,f=this.get("factory"),g=this.get("value");this.set("status",e.WAITING),this._callbacks.push(b);var i=c.length;if(0===i)g=f.call(g)||g,this.set("value",g),this.set("status",e.LOADED),a.each(this._callbacks,function(a){a(g)});else{var j=[],k=this;a.each(c,function(b,c){d&&(b=d(b,c)),h.loadModule(b,function(b){j[c]=b,i--,0===i&&(g=f.apply(g,j)||g,k.set("value",g),k.set("status",e.LOADED),a.each(k._callbacks,function(a){a(g)}))},k)})}},__waiting:function(a){var b=this;setTimeout(function(){0===h.counter&&b.set("status",e.LOADING),b.load(a)})},__loaded:function(a){a(this.get("value"))},load:function(b){var c=this.get("status"),d=b||a.idle;switch(c){case e.PENDING:this.__pending(d);break;case e.LOADING:this.__loading(d);break;case e.WAITING:this.__waiting(d);break;case e.LOADED:this.__loaded(d)}return this}}});a.define=function(){var b=arguments,c=b.length,d=b[0],e=[],f=null;switch(c){case 1:a.is(d,"function")?f=d:a.is(d,"array")?(e=d,f=function(){var b={};return a.each(arguments,function(c){c._name_?b[c._name_]=c:a.extend(b,c)}),b}):f=function(){return d};break;case 2:e=d,f=b[1];break;case 3:e=d,f=b[1]}return e&&a.is(e,"string")&&(e=[e]),h.current=new h("",e,f),b[2]&&(h.current._depHandler=b[2]),h.current};var i=a.Class("zn.Loader",{"static":!0,properties:{preLoadPackages:[]},methods:{init:function(){for(var a=this.preLoadPackages,b=0,c=a.length;c>b;b++)this.loadPackage(a[b])},loadPackage:function(b){this.load(b+"index.js",function(b){a.extend(h.preLoadedPackage,b)})},load:function(a,b,c){return h.loadModule(a,b,c),this}}});a.load=i.load,a.module=h}(zn),function(a){var b=Array.prototype.slice,c={PENDING:0,CANCLE:1,PAUSE:2,FINISHED:3},d=a.Class({events:["init","finished"],properties:{status:{value:c.PENDING,get:function(){return this._status}}},methods:{init:function(){},doTask:function(a,b){if(a){var c=b||[];c.unshift(this),a.handler.apply(a.context,c)}},done:function(){this._status=c.FINISHED,this._data=b.call(arguments),this.fire("finished",this._data),this.off("finished")}}}),e=a.Class({events:["clear","push","pause","resume","exception","every","finally"],properties:{count:{get:function(){return this._tasks.length}}},methods:{init:function(a){this._exceptions=[],this._finallys=[],this._everys=[],this._tasks=[],this._taskProcessor=[],this._lastTask=null,this._data=[],this._max=(a||{}).max||1},destroy:function(){this._everys=[],this._tasks=[],this._taskProcessor=[],this.fire("finally",this._data,{method:"apply"}),this.super()},clear:function(){this._tasks=[]},pause:function(a){return this._paused=!0,a>0&&(this._pauseTimer=setTimeout(function(){this.resume()}.bind(this),a)),this.fire("pause"),this},resume:function(){return this._pauseTimer&&clearTimeout(this._pauseTimer),this._paused=!1,this.fire("resume"),this.doTask(),this},exception:function(a,b){return this.on("exception",a,b||this),this},"catch":function(a){return this.fire("exception",a),this},"finally":function(a,b){return this.on("finally",a,b||this),this},every:function(a,b){return this.on("every",a,b||this),this},push:function(a,b){var c={handler:a,context:b||this};return this._lastTask&&(c.previous=c,this._lastTask.next=c),this._lastTask=c,this._tasks.push(c),this.fire("push",c),this},getTaskProcessor:function(){for(var a=null,b=this._taskProcessor.length,e=0;b>e;e++)if(a=this._taskProcessor[e],a.status==c.FINISHED)return a;if(!a&&this._max>b){var f=new d;return f.queue=this,f.on("finished",this.__onProcessorFinished.bind(this),this),f}},start:function(){return this._data=[],this.doTask()},doTask:function(a){var b=this._tasks.shift();if(b){var c=this.getTaskProcessor();c&&(b.previousResult=a,c.doTask(b,a))}else this.destroy();return this},__onProcessorFinished:function(a,b){this._data.push(b),this.fire("every",b,{method:"apply"}),this.doTask(b)}}});a.queue=function(a){return new e(a)}}(zn),function(a){var b={ISO8601:"yyyy-MM-dd hh:mm:ss.SSS",ISO8601_WITH_TZ_OFFSET:"yyyy-MM-ddThh:mm:ssO",DATETIME:"dd MM yyyy hh:mm:ss.SSS",ABSOLUTETIME:"hh:mm:ss.SSS"},c=a.Class("zn.util.DateUtil",{"static":!0,properties:{},methods:{init:function(){},asString:function(a){var c=b.ISO8601;"string"==typeof a&&(c=arguments[0],a=arguments[1]);var d=this.__addZero(a.getDate()),e=this.__addZero(a.getMonth()+1),f=this.__addZero(a.getFullYear()),g=this.__addZero(a.getFullYear().toString().substring(2,4)),h=c.indexOf("yyyy")>-1?f:g,i=this.__addZero(a.getHours()),j=this.__addZero(a.getMinutes()),k=this.__addZero(a.getSeconds()),l=this.__padWithZeros(a.getMilliseconds(),3),m=this.__offset(a),n=c.replace(/dd/g,d).replace(/MM/g,e).replace(/y{1,4}/g,h).replace(/hh/g,i).replace(/mm/g,j).replace(/ss/g,k).replace(/SSS/g,l).replace(/O/g,m);return n},__padWithZeros:function(a,b){for(var c=a+"";c.length<b;)c="0"+c;return c},__addZero:function(a){return this.__padWithZeros(a,2)},__offset:function(a){var b=Math.abs(a.getTimezoneOffset()),c=String(Math.floor(b/60)),d=String(b%60);return 1==c.length&&(c="0"+c),1==d.length&&(d="0"+d),a.getTimezoneOffset()<0?"+"+c+d:"-"+c+d}}}),d=["INFO","DEBUG","WARNING","ERROR","TRACE","","INIT"],e=["#100000","#2125a0","#a82c2c","#c045b7","1cb131","","#100000"],f=[38,34,35,31,32,36,33],g={INFO:0,DEBUG:1,WARNING:2,ERROR:3,TRACE:4,INIT:6},h=a.Class({"static":!0,properties:{},methods:{init:function(){},info:function(a){this.__log(g.INFO,a)},debug:function(a){this.__log(g.DEBUG,a)},warn:function(a){this.__log(g.WARNING,a)},trace:function(a){this.__log(g.TRACE,a)},error:function(a){this.__log(g.ERROR,a)},__getDateString:function(a){return c.asString(a||new Date)},__getPosition:function(){try{throw new Error}catch(a){var b=a.stack.split("\n")[4].replace(/\(/g,"").replace(/\)/g,"").split("/").pop();return b}},__formatLog4Server:function(a,b){var c="",e="",g="";return b&&(e="[",g="",c=f[5]+"m",b=f[a.type]+"m"),[a.time," [",e,b,d[a.type],g,"] ",a.message].join("")},__formatLog4Client:function(a){return["%c"+a.time," [",d[a.type],"] ",a.message].join("")},__log:function(a,b){var c={type:a,message:"object"==typeof b?JSON.stringify(b):b,time:this.__getDateString(),pos:this.__getPosition()};"undefined"!=typeof module&&module.exports?console.log(this.__formatLog4Server(c,!0)):console.log(this.__formatLog4Client(c,!0),"color:"+e[a])}}}),i={info:function(){h.info.apply(h,arguments)},debug:function(){h.debug.apply(h,arguments)},warn:function(){h.warn.apply(h,arguments)},trace:function(){h.trace.apply(h,arguments)},error:function(){h.error.apply(h,arguments)}};a.extend(a,i)}(zn),function(a){var b=Array.prototype.slice,c={PENDING:0,FULFILLED:1,REJECTED:2},d=a.Class({"static":!0,methods:{init:function(){this._exceptions=[],this._finallys=[],this._count=0,this._currIndex=0,this._dataArray=[]},exception:function(a){return this._exceptions.push(a),this},"catch":function(b,c){return a.each(this._exceptions,function(a){a.call(c,b)}),this},"finally":function(a){return this._finallys.push(a),this},defer:function(b,c){var d=this,f=new e(b,c);return f.on("complete",function(b,c){d._currIndex++,d._dataArray.push(c),d._currIndex==d._count&&(a.each(d._finallys,function(b){try{b(d._dataArray)}catch(c){a.error(c.message)}}),d._finallys=[])}),d._count++,f},all:function(b){var c=d.defer(),e=0,f=[];return a.each(b,function(a){a.then(function(a){f.push(a),e++,e>=b.length&&c.resolve(f)})}),c.promise},any:function(b){var c=d.defer();return a.each(b,function(a){a.then(function(a){c.resolve(a)})}),c.promise}}}),e=a.Class({events:["complete"],properties:{promise:null},methods:{init:function(a,b){this._promise=new f,a&&this.resolve(a),b&&this.reject(b)},resolve:function(){var e=b.call(arguments);try{var f=this.get("promise"),g=this;if(f.get("readyState")!=c.PENDING)return;f.set("readyState",c.FULFILLED),f.set("data",e),a.each(f.get("resolves"),function(a){a.apply(g,e)})}catch(h){d.catch(h,this)}this.fire("complete",e)},reject:function(){var a=b.call(arguments);try{var e=this.get("promise");if(e.get("readyState")!=c.PENDING)return;e.set("readyState",c.REJECTED),e.set("reason",a);var f=e.get("rejects")[0];f&&f.apply(this,a)}catch(g){d.catch(g,this)}this.fire("complete",a)}}}),f=a.Class({statics:{isPromise:function(a){return null!==a&&void 0!==a&&"function"==typeof a.then},defer:null},properties:{resolves:null,rejects:null,data:null,reason:null,readyState:null},methods:{init:function(){this.set("resolves",[]),this.set("rejects",[]),this.set("exceptions",[]),this.set("readyState",c.PENDING)},then:function(a,d){function g(){var c=b.call(arguments),d=a?a.apply(this,c):c;return f.isPromise(d)?d.then(function(){h.resolve.apply(h,b.call(arguments))}):h.resolve.apply(h,d),d}var h=new e;if(this.get("readyState")===c.PENDING)this.get("resolves").push(g),this.get("rejects").push(d?d:function(){h.reject.apply(h,b.call(arguments))});else if(this.get("readyState")===c.FULFILLED){var i=this;setTimeout(function(){g.apply(i,i.get("data"))})}return h.promise},"catch":function(a){return d.exception(a)},"finally":function(a){return d.finally(a)},otherwise:function(a){return this.then(void 0,a)}}});a.async=d}(zn),function(a){var b=(a.Class({events:["init","start","stop","cancle","goNext","goPre"],properties:{pre:null,next:null,delay:null,action:null,args:[],context:this,taskList:null,status:{value:"",get:function(){return this._status}}},methods:{init:function(a){this.sets(a),this.fire("init",this)},start:function(){"started"!=this._status&&(this._action?(this._action.apply(this._context,this._args),this._status="started"):this.goNext(),this.fire("start",this))},stop:function(){this._status="stoped",this.fire("stop",this)},cancle:function(){this._status="cancle",this.fire("cancle",this)},goNext:function(){this._next&&this._next.start(),this.fire("goNext",this)},goPre:function(){this._pre&&this._pre.start(),this.fire("goPre",this)}}}),a.Class({properties:{url:"",data:{set:function(a){this._data=a},get:function(){return a.is(this._data,"object")?JSON.stringify(this._data):this._data}},method:"GET",asyns:!0,username:null,password:null,headers:{get:function(){return a.overwrite({"X-Requested-With":"XMLHttpRequest","Content-type":"application/json"},this._headers)},set:function(a){this._headers=a}},timeout:{get:function(){return this._timeout||2e4},set:function(a){this._timeout=a}}},events:["before","after","success","error","complete","timeout"],methods:{init:function(a){this.sets(a),this._isRunning=!1},__initXMLHttpRequest:function(){if(this._XMLHttpRequest)return this._XMLHttpRequest;if(!window.ActiveXObject)return this._XMLHttpRequest=new XMLHttpRequest,this._XMLHttpRequest;for(var a="MSXML2.XMLHTTP",b=["Microsoft.XMLHTTP",a,a+".3.0",a+".4.0",a+".5.0",a+".6.0"],c=b.length,d=c-1;d>-1;d--)try{return this._XMLHttpRequest=new ActiveXObject(b[d]),this._XMLHttpRequest}catch(e){continue}},__onComplete:function(a){clearTimeout(this._timeoutID),this._isRunning=!1,this.resetEvents(),this.fire("complete",a)},__initRequestHeader:function(a,b){for(var c in b)a.setRequestHeader(c,b[c])},resetEvents:function(){this.off("before"),this.off("after"),this.off("success"),this.off("error"),this.off("complete"),this.off("timeout")},send:function(b){if(this._isRunning)return!1;this.sets(b);var c=this.__initXMLHttpRequest(),d=this,e=a.async.defer();if(this._isRunning=!0,this.timeout&&(this._timeoutID=setTimeout(function(){d._isRunning&&(c.abort(),d.fire("timeout",d),d.__onComplete("timeout"))},this.timeout)),this.fire("before",this)!==!1&&this.url){var f=this.url,g=this.data,h=this._method.toUpperCase();"GET"===h&&(g&&(f=f+"?"+g),g=null),c.readyState<2&&(c.withCredentials=!0),c.open(h,f,this.asyns),c.onreadystatechange=function(a){var b=a.currentTarget;if(4==b.readyState){var c=b.status,d=b.responseText,f=b.getResponseHeader("Content-Type");if(c>=400&&500>c)return e.reject(b),void this.fire("error","Client Error Code: "+c);if(c>=500)return e.reject(b),void this.fire("error","Server Error code: "+c);if(c>=200&&300>c){try{d=f&&f.indexOf("application/json")>=0?JSON.parse(d):d}catch(g){d=d}b.abort(),e.resolve(d,b),this.fire("success",d)}else b.abort(),e.reject(b),this.fire("error",b);return this.__onComplete(b),d}}.bind(this),this.__initRequestHeader(c,this.headers),c.send(g),this.asyns||this.__onComplete(c)}else this.__onComplete(c);return e.promise},abort:function(){this._XMLHttpRequest&&this._XMLHttpRequest.abort()}}})),c=a.Class({"static":!0,properties:{max:3,count:{get:function(){return this._data.length}}},methods:{init:function(){this._data=[]},getInstance:function(){for(var a=0,c=this._data.length;c>a;a++)if(!this._data[a]._isRunning)return this._data[a].resetEvents(),this._data[a];return function(a){var c=new b;return a._data.push(c),c}(this)}}}),d=a.Class({properties:{timeout:1e3},methods:{init:function(a){this.sets(a)},request:function(b,d){var e=c.getInstance();return a.each(b,function(a,b){"function"==typeof a&&e.on(b,a,this)},this),d&&d(e),e.send(b)},get:function(a){return a.method="GET",this.request(a)},post:function(a){return a.method="POST",this.request(a)},put:function(a){return a.method="PUT",this.request(a)},"delete":function(a){return a.method="DELETE",this.request(a)}}}),e=new d;a.extend(a,{$get:e.get.bind(e),$post:e.post.bind(e),$put:e.put.bind(e),$delete:e.delete.bind(e)})}(zn),function(a){var b=a.Class({events:["init"],properties:{url:null,data:null,method:"POST",headers:null,onExec:null,success:null,error:null,timeout:null},methods:{init:function(a,b,c,d){this.sets({url:a,data:b,method:c,headers:d}),this.fire("init",this)},exec:function(b,c,d,e){var f=b||this._url,g=c||this._data||{},h=d||this._method,i=e||this._headers||{},j=this._onExec&&this._onExec(this);
return j===!1?!1:a.GLOBAL.Store.fire("before")===!1?!1:a["$"+h.toLowerCase()]({url:Store.fixURL(f),data:g,success:this._success,error:this._error,timeout:this._timeout,headers:i})},refresh:function(){this.exec()},copyAndExt:function(a){var c=this._data;if("object"==typeof c){c=JSON.parse(JSON.stringify(c));for(var d in a)c[d]=a[d]}else c=a;return new b(this._url,c,this._method)},ext:function(){var a=this._data;for(var b in data)a[b]=data[b];return this}}}),c=a.Class({events:["init"],properties:{url:null,data:null,method:"POST",headers:null,onExec:null,success:null,error:null},methods:{init:function(a,b,c,d){this.sets({url:a,data:b,method:c,headers:d}),this.fire("init",this)},exec:function(b,c,d,e){var f=this,g=b||this._url,h=c||this._data||{},i=d||this._method,j=e||this._headers||{},k=this._onExec&&this._onExec(this);if(k===!1)return!1;switch(i.toUpperCase()){case"POST":var l=new FormData;for(var m in h)l.append(m,h[m]);h=l,j=a.overwrite(j,{Accept:"multipart/form-data","Content-Type":"multipart/form-data; charset=UTF-8"});break;case"GET":break;case"JSON":h=JSON.stringify(h),i="POST",j=a.overwrite(j,{Accept:"multipart/form-data","Content-Type":"multipart/form-data; charset=UTF-8"})}return new Promise(function(a,b){fetch(g,{method:i.toUpperCase(),body:h,headers:j}).then(function(a){return a.json()}).then(function(b){f._success&&f._success(b),a(b)}).catch(function(a){f._error&&f._error(a),b(a)})})},refresh:function(){this.exec()},copyAndExt:function(a){var b=this._data;if("object"==typeof b){b=JSON.parse(JSON.stringify(b));for(var d in a)b[d]=a[d]}else b=a;return new c(this._url,b,this._method)},ext:function(){var a=this._data;for(var b in data)a[b]=data[b];return this}}}),d=a.Class({events:["init","exec"],properties:{data:null,argv:{set:function(a){this._argv=a},get:function(){return this._argv||{}}}},methods:{init:function(a,b){this.reset(a,b),this.fire("init",this)},reset:function(a,b){this.sets({data:a,argv:b})},refresh:function(){this.exec()},exec:function(){var a=this._data;if(a){var b=this._argv.onSubmitBefore&&this._argv.onSubmitBefore(a,this._argv);if(b!==!1)if(void 0!==b&&(a=b),a.__id__)a._onExec||(a._onExec=this._argv.onExec),a._success=function(a,b){var c=Store._success&&Store._success(b);c!==!1&&this._argv.onSuccess&&this._argv.onSuccess(b)}.bind(this),a._error=function(a,b){var c=Store._error&&Store._error(b);c!==!1&&this._argv.onError&&this._argv.onError(b)}.bind(this),a.exec();else{if((this._argv.onExec&&this._argv.onExec(a))===!1)return!1;this._argv.onSuccess&&this._argv.onSuccess(data)}}}}});a.GLOBAL.Store=new a.Class({events:["before","after","success","error"],properties:{HOST:"http://0.0.0.0:8080/"},methods:{requestHandler:function(a,b){this._success=a,this._error=b},request:function(a,c,d,e){return new b(a,c,d,e)},post:function(a,c,d){return new b(a,c,"POST",d)},"delete":function(a,c,d){return new b(a,c,"DELETE",d)},put:function(a,c,d){return new b(a,c,"PUT",d)},get:function(a,c,d){return new b(this.formatURL(a,c),c,"GET",d)},fetch:function(a,b,d,e){return new c(a,b,d,e)},fetchPost:function(a,b,d){return new c(a,b,"POST",d)},fetchGet:function(a,b,d){return new c(this.formatURL(a,b),b,"GET",d)},setHost:function(a){this._HOST=a},getHost:function(){return this._HOST},fixURL:function(a){return a?(a&&-1===a.indexOf("http://")&&(a=this._HOST+a),a):""},formatURL:function(a,b){for(var c in b)a=a.replace(new RegExp("{"+c+"}","gi"),b[c]||"");return a},dataSource:function(a,b){return new d(a,b)}}})}(zn);

@@ -1,2 +0,2 @@

var zn={VERSION:"0.0.1",DEBUG:!1,ZN_PATH:"",PATH:"",GLOBAL:function(){return this}.call(null)};if(zn.GLOBAL&&(zn.GLOBAL.zn=zn),"undefined"!=typeof module&&module.exports)module.exports=zn,zn.ZN_PATH=__dirname,zn.PATH=process.cwd();else{window&&(window.zn=zn);var _zn_url="";try{__a__=__b__}catch(e){e.fileName?_zn_url=e.fileName:e.sourceURL?_zn_url=e.sourceURL:e.stacktrace?console.log(e.stacktrace):e.stack?(_zn_url=e.stack.split("\n")[1],_zn_url=_zn_url.replace(/\s/g,""),_zn_url=_zn_url.substring(2,_zn_url.length)):console.log(e.toString())}if(!_zn_url)for(var _scripts=document.getElementsByTagName("script"),_src="",_node,i=0,_len=scripts.length;_len>i;i++)if(_node=scripts[i],_node.getAttribute&&(_src=_node.getAttribute("src")||"","zn.js"===_src.slice(-5)||"zn.minx.js"===_src.slice(-10))){_zn_url=_src;break}if(!_zn_url)throw new Error("zn.js has not been included, please do it first.");zn.ZN_PATH=_zn_url.substring(0,_zn_url.lastIndexOf("/")+1)}!function(a){var b=Object.prototype.toString,c={idle:function(){},idleArray:function(){return[]},idleObject:function(){return{}},format:function(){var a=arguments,b=null,c=null;return a.length<2?a[0]:(b=a[0].toString(),c=a[1],d.each(c,function(a,c){a=d.is(a,"object")?JSON.stringify(a):a.toString(),b=b.replace(new RegExp("\\{"+c+"\\}","gi"),a)}),b)},uuid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0,c="x"==a?b:3&b|8;return c.toString(16)}).toUpperCase()},fix:function(a){for(var b=a||{},c=1,d=arguments.length;d>c;c++){var e=arguments[c];for(var f in e)e.hasOwnProperty(f)&&"function"!=typeof b[f]&&(b[f]=e[f])}return b},extend:function(a){for(var b=a||{},c=1,d=arguments.length;d>c;c++){var e=arguments[c];for(var f in e)e.hasOwnProperty(f)&&(b[f]=e[f])}return b},overwrite:function(a){for(var b=a||{},c=1,d=arguments.length;d>c;c++){var e=arguments[c];for(var f in e)e.hasOwnProperty(f)&&void 0===b[f]&&(b[f]=e[f])}return b},path:function(a,b,c){var d=a||{};if(b){var e,f=b.split("."),g=f.length,h=0;if(arguments.length<3)for(;d&&g>h;h++)e=f[h],d=d.__get__?d.__get__(e):d[e];else{for(g-=1;d&&g>h;h++)e=f[h],d=d.__get__?d.__get__(e):d[e]=d[e]||{};e=f[h],d&&(d.__set__?d.__set__(e,c):d[e]=c,d=c)}}return d},invoke:function(b,c,d){if(b&&c){var e,f,g=c.lastIndexOf(".");g>0?(e=a.path(b,c.substring(0,g)),e&&(f=e[c.substring(g+1)])):(e=b,f=b[c]),f&&f.apply(e,d)}},deepEachObject:function(a,b,c){if(d.is(a,"object")){var e,f=null;for(var g in a)f=a[g],d.is(f,"object")?this.deepEachObject(f,b,c):(e=b&&b.call(c,f,g,a),void 0!==e&&null!==e&&(a[g]=e))}return a},arrayValueToObject:function(a,b,c){if(d.is(a,"array")){for(var e,f=null,g={},h=0,i=a.length;i>h;h++)f=a[h],e=b&&b.call(c,f,h,a),void 0!==e&&null!==e&&(g[f]=e);a=g}return a}},d={toString:function(a){return a&&a.toString?a.toString():b.call(a)},each:function(a,c,d){if(a&&c)if(a.__each__)a.__each__(c,d);else{var e=a.length,f=null;if(e>0&&"[object Array]"===b.call(a)){for(var g=0;e>g;g++)if(f=c.call(d,a[g],g),f===!1)return!1}else for(var h in a)if(a.hasOwnProperty(h)){if(f=c.call(d,a[h],h),f===!1)return!1;if(-1===f)continue}}},clone:function(b){if(b){if(b.__clone__)return b.__clone__();if(a.is(b,"array"))return b.slice(0);var c={};for(var d in b)b.hasOwnProperty(d)&&(c[d]=b[d]);return c}return b},type:function(a){return a&&a.__type__?a.__type__:b.call(a).slice(8,-1).toLowerCase()},is:function(a,b){if(a&&a.__is__)return a.__is__(b);if("string"==typeof b)switch(b.toLowerCase()){case"plain":return a&&a.constructor===Object;default:return this.type(a)===b}else if("function"==typeof b)return a instanceof b},may:function(a,b){return a?a.__may__?a.__may__(b):a.hasOwnProperty("on"+b):!1},can:function(a,b){return a?a.__can__?a.__can__(b):"function"==typeof a[b]:!1},has:function(a,b){return a?a.__has__?a.__has__(b):a.hasOwnProperty(b):!1},get:function(a,b){return a?a.__get__?a.__get__(b):a[b]:void 0},set:function(a,b,c){a&&(a.__set__?a.__set__(b,c):a[b]=c)},gets:function(a){if(a){if(a.__gets__)return a.__gets__();var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}},sets:function(a,b){if(a&&b)if(a.__sets__)a.__sets__(b);else for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])}};c.extend(a,c),c.extend(a,d)}(zn),function(a){{var b=Array.prototype.slice,c=Object.prototype.hasOwnProperty,d=Object.prototype.toString,e={format:function(){var b=arguments,c=this;return 1==b.length&&"object"==typeof b[0]&&(b=b[0]),a.each(b,function(b,d){b="object"==a.type(b)?JSON.stringify(b):b.toString(),c=c.replace(new RegExp("\\{"+d+"\\}","gi"),b)}),c.toString()}},f={isArray:function(b){return b&&"[object Array]"===a.toString(b)&&b.constructor===Array}},g={forEach:function(a,b){if(!a)return!1;for(var c=0,d=this.length;d>c;c++)a.call(b,this[c],c);return this},indexOf:function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},lastIndexOf:function(a){for(var b=this.length-1;b>=0;b--)if(this[b]===a)return b;return-1}},h={bind:function(a){var c=this;return function(){return c.apply(a,b.call(arguments,1))}}},i={toArray:function(a){return b.call(a)},keys:function(a){if(a!==Object(a))throw new TypeError("Object.keys called on a non-object");var b,d=[];for(b in a)c.call(a,b)&&d.push(b);return d},values:function(a){if(a!==Object(a))throw new TypeError("Object.keys called on a non-object");var b,d=[];for(b in a)c.call(a,b)&&d.push(a[b]);return d},create:function(){var b=function(){};return function(c,d){if(null===c)throw new Error("Cannot set a null [[Prototype]]");if("object"!=typeof c)throw new TypeError("Argument must be an object");return a.each(d,function(a,b){i.defineProperty(c,a,b)}),b.prototype=c,new b}}(),defineProperty:function(a,b,c){return a&&b&&c&&c.hasOwnProperty("value")&&(a[b]=c.value),a}};({parse:function(){return""},stringify:function(){var a=d,b=Array.isArray,c={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},e=function(a){return c[a]||"\\u"+(a.charCodeAt(0)+65536).toString(16).substr(1)},f=/[\\"\u0000-\u001F\u2028\u2029]/g;return function g(c){if(null==c)return"null";if("number"==typeof c)return isFinite(c)?c.toString():"null";if("boolean"==typeof c)return c.toString();if("object"==typeof c){var d;if("function"==typeof c.toJSON)return g(c.toJSON());if(b(c)){d="[";for(var h=0;h<c.length;h++)d+=(h?", ":"")+g(c[h]);return d+"]"}if("[object Object]"===a.call(c)){d=[];for(var i in c)c.hasOwnProperty(i)&&d.push(g(i)+": "+g(c[i]));return"{"+d.join(", ")+"}"}}return'"'+c.toString().replace(f,e)+'"'}}()})}a.fix(Array,f),a.fix(Array.prototype,g),a.fix(Function.prototype,h),a.fix(String.prototype,e)}(zn),function(a){function b(){}function c(){var c,e,f,h=l._arguments.apply(this,arguments),i=h.name,j=h.super,k=h.meta,n=k.methods.init;if(j._static_)throw new Error("Static class cannot be inherited.");if(j._final_)throw new Error("Final class cannot be inherited.");if(i&&k.partial&&(c=a.path(d,i)),k.static){if(c){if(!c._static_)throw new Error('Partial class "'+i+'" must be static.')}else c=function(){throw new Error("Cannot instantiate static class.")};f=c.prototype}else{if(c){if(c._static_)throw new Error('Partial class "'+i+'" must not be static.');if(c._super_!==j&&c._super_!==b)throw new Error('Partial class "'+i+'" must have consistent super class.')}else c=k.abstract?function(){throw new Error("Cannot instantiate abstract class.")}:function(){var b=c._mixins_||[],d=c._ctors_||[],e=null,f=arguments;this.__id__=g++,this.__handlers__={},this.__initializing__=!0,this.__afters__=[];for(var h=null,i=null,j=0,k=b.length;k>j;j++)h=b[j],h["@init"]?(i=h["@init"].meta,i=a.is(i,"function")?i:i.value,m(h.prototype.__super__,this,f),i&&i.call(this)):m(h.prototype.__super__,this,f);m(this.__super__,this,f);for(var l=0,n=d.length;n>l;l++)e=d[l],e=a.is(e,"function")?e:e.value,e&&e.apply(this,f);for(;this.__afters__.length>0;){var o=this.__afters__.pop();o.handler.apply(o.context,f)}this.__afters__=null,delete this.__afters__,this.__initializing__=!1},c._ctors_=[];c._super_!==j?(e=function(){},e.prototype=j.prototype,f=new e,f.constructor=c,f.__type__=i||"Anonymous",f.__super__=j,c.prototype=f):f=c.prototype,f.class=f.constructor,n&&(c._ctors_.push(n),f.__ctor__||(f.__ctor__=n))}return l._meta(c,h),f.__define__&&f.__define__.call(c),i&&a.path(d,i,c),c}var d=a.GLOBAL,e="@",f=1,g=1,h={fixTargetCtor:function(a){return a instanceof b?a.constructor:a},fixTargetKey:function(a){return e+a},defineEvent:function(a,b,c){var d=h.fixTargetCtor(a),e=h.fixTargetKey(b),f=e in d,g={};return f||(g=Object.defineProperty(a,"on"+b.toLowerCase(),{get:function(){var a=this.__handlers__[b];return a?a[0].handler:null},set:function(a){var c=this.__handlers__,d=c[b]=c[b]||[];d[0]={owner:this,handler:a,context:null}}})),d[e]={name:b,type:"event",meta:c,descriptor:g},f},defineProperty:function(b,c,d){var e,f,g=h.fixTargetCtor(b),i=h.fixTargetKey(c),j=i in g,k={};if("value"in d){var l=d.value,m="_"+c,n=d.get,o=d.set;e=n||function(){return m in this?this[m]:a.is(l,"function")?l.call(this):l},f=d.readonly?function(a,b){return b&&b.force?void(this[m]=a):!1}:o||function(a){this[m]=a}}else e=d.get||function(){return void 0},f=d.set||function(){return!1};return j&&(e.__super__=g[i].getter,f.__super__=g[i].setter),k=Object.defineProperty(b,c,{get:e,set:f,configurable:!0}),g[i]={name:c,type:"property",meta:d,getter:e,setter:f,descriptor:k},j},defineMethod:function(a,b,c){var d=h.fixTargetCtor(a),e=h.fixTargetKey(b),f=e in d;return d[e]={name:b,type:"method",meta:c},b in a&&(c.value.__super__=a[b]),a[b]=c.value,f}},i={__handlers__:{},member:function(a,c){var d=h.fixTargetCtor(c||this),e=d[h.fixTargetKey(a)];return e||d===b?e:this.member(a,d._super_)},may:function(a){var b=this.member(a);return b&&"event"==b.type},has:function(a){var b=this.member(a);return b&&"property"==b.type},can:function(a){var b=this.member(a);return b&&"method"==b.type},get:function(a,b){var c=this.member(a);return c&&c.getter?c.getter.call(this,b):void 0},set:function(a,b,c){var d=this.member(a);return d&&d.setter&&d.setter.call(this,b,c),this},gets:function(b){var c={},d=h.fixTargetCtor(this)._properties_;return a.each(d,function(a){c[a]=this.get(a,b)},this),c},sets:function(a,b){if(a)for(var c in a)a.hasOwnProperty(c)&&this.set(c,a[c],b);return this},each:function(a,b){for(var c=h.fixTargetCtor(this)._properties_,d=0,e=c.length;e>d;d++){var f=c[d],g=a.call(b,f,d,this.member(f),this.get(f));if(g===!1)return!1}return this},__may__:function(a){return this.may(a)},__has__:function(a){return this.has(a)},__can__:function(a){return this.can(a)},__get__:function(a){return this.get(a)},__gets__:function(){return this.gets()},__set__:function(a,b){this.set(a,b)},__sets__:function(a){this.sets(a)},__each__:function(a,b){return this.each(a,b)}},j={toString:function(){return"{ ClassName: "+(this._name_||"Anonymous")+", ClassID: "+this._id_+" }"},getProperties:function(b){var c={};if(!this.getMeta||"ZNObject"==this._name_)return c;var d=this._super_,e=this._mixins_;return d&&a.extend(c,d.getProperties(b)),e&&e.length&&a.each(e,function(d){a.extend(c,d.getProperties(b))}),a.each(this.getMeta("properties"),function(a,d){var e=b&&b(d,a)===!1;e||a.hidden||(c[d]=a)}),c},getPropertie:function(b){var c=null;return b&&a.each(this.getProperties(),function(a,d){return b==d&&(c=a),-1}),c},getMeta:function(a){return a?this._meta_[a]:this._meta_},setMeta:function(a,b){return this._meta_[a]=b,this},defineEvent:function(a,b,c){return h.defineEvent(c||this.prototype,a,b)||this._events_.push(a),this},defineProperty:function(a,b,c){return h.defineProperty(c||this.prototype,a,b)||this._properties_.push(a),this},defineMethod:function(a,b,c){return h.defineMethod(c||this.prototype,a,b)||this._methods_.push(a),this}},k={toString:function(){var a={ClassName:this.__name__||"Anonymous",InstanceID:this.__id__,Meta:this.constructor._meta_};return JSON.stringify(a)},toJson:function(){var b={};return a.each(this.constructor.getProperties(),function(a,c){b[c]=this.get(c)},this),b},getProperties:function(){return this.constructor.getProperties()},getPropertie:function(a){return this.constructor.getPropertie(a)},upon:function(b,c,d){if(c){var e=this.__handlers__,f=e[b]=e[b]||[];f[0]=a.extend({owner:this,handler:c},d)}return this},on:function(b,c,d){if(c){var e=this.__handlers__,f=e[b]=e[b]||[{owner:null,handler:null,context:null}];f.push(a.extend({owner:this,handler:c},d))}return this},off:function(a,b,c){var d,e=this.__handlers__[a]||[],f=c&&c.context;if(b)for(var g=e.length-1;g>=0;g--)d=e[g],d.handler!==b||f&&d.context!==f||this.__handlers__[a].splice(g,1);else this.__handlers__[a]=[{owner:null,handler:null,context:null}];return this},fire:function(a,b,c){var d,e=this.__handlers__[a],f=null;if(e)for(var g=0,h=e.length;h>g;g++)if(d=e[g],d&&d.handler&&(f=c&&"apply"==c.method?d.handler.apply(d.context||d.owner,b):d.handler.call(d.context||d.owner,d.owner,b,c),!1===f))return this;return this},dispose:function(){return this.__handlers__={},this},destroy:function(){return this.dispose()},"super":function(){var a=this.super.caller.__super__;return a?a.apply(this,arguments):void 0},is:function(b){if("string"==typeof b&&(b=a.path(d,b)),b){if(this instanceof b)return!0;for(var c=this.constructor._mixins_,e=0,f=c.length;f>e;e++){var g=c[e];if(b===g)return!0}}return!1},__is__:function(a){return this.is(a)},__clone__:function(){}};a.extend(b,i,j,{_id_:0,_name_:"ZNObject",_statics_:{},_events_:[],_properties_:[],_methods_:[],_mixins_:[],_meta_:{}}),a.extend(b.prototype,i,k),a.isZNObject=function(a){return a instanceof b};var l={_arguments:function(){var c,d,e,f=arguments,g=f.length,h=f[0],i={"static":!1,statics:[],partial:!1,"abstract":!1,"final":!1,mixins:[],events:[],properties:[],methods:[]};if(3===g){if(c=h,d=f[1],e=f[2],!a.is(d,"function"))throw new Error("Invalid _super class.")}else if(2===g){if(a.is(h,"string"))c=h,d=null;else{if(!a.is(h,"function"))throw new Error("Invalid _super class.");c=null,d=h}e=f[1]}else{if(1!==g)throw new Error("Invalid arguments.");if(c=null,d=null,e=h,!a.is(e,"object"))throw new Error("The meta argument must be an object.")}return c=c||"",e=a.overwrite(e||{},i),d=d||b,{name:c,"super":d,meta:e}},_meta:function(b,c){var d=c.name,e=c.super,g=c.meta;return a.extend(b,i,j,{_id_:f++,_name_:d,_super_:e,_partial_:g.partial,_abstract_:g.abstract,_static_:g.static,_final_:g.final,_statics_:a.extend({},e._statics_,g.statics),_events_:e._events_.slice(0),_properties_:e._properties_.slice(0),_methods_:e._methods_.slice(0),_mixins_:e._mixins_.concat(g.mixins),_meta_:g}),a.extend(b,b._statics_),g.static?(a.each(g.events,function(a){b.defineEvent(a,{},b)}),a.each(g.properties||g.props,function(c,d){b.defineProperty(d,a.is(c,"object")?c:{value:c},b)}),a.each(g.methods,function(c,d){b.defineMethod(d,a.is(c,"function")?{value:c}:c,b)}),g.methods.init&&g.methods.init.call(b,b)):(a.each(g.mixins,function(c){var d=c.prototype;a.each(c._events_,function(a){b.defineEvent(a,d.member(a).meta)}),a.each(c._properties_,function(a){b.defineProperty(a,d.member(a).meta)}),a.each(c._methods_,function(a){i[a]||k[a]||b.defineMethod(a,d.member(a).meta)})}),a.each(g.events,function(a){b.defineEvent(a,{})}),a.each(g.properties,function(c,d){b.defineProperty(d,a.is(c,"object")?c:{value:c})}),a.each(g.methods,function(c,d){b.defineMethod(d,a.is(c,"function")?{value:c}:c)})),b}},m=function(c,d,e){if(c&&c!==b){var f=c.member("init"),g=c._mixins_,h=null;return f&&f.meta.after&&d.__afters__.push({context:d,handler:f.meta.after}),g.length&&a.each(g,function(b){b["@init"]&&(h=b["@init"].meta,h=a.is(h,"function")?h:h.value,h&&h.call(d))}),f&&f.meta.auto&&f.meta.value.apply(d,e),arguments.callee(c._super_,d)}};a.Class=c}(zn),function(a){var b=".",c="..",d="/",e={PENDING:0,LOADING:1,WAITING:2,LOADED:3},f=null;"undefined"!=typeof module&&module.exports?a.SLASH=d=require("path").sep:f=document;var g={normalizePath:function(a){for(var e,f=a.split(d),g=[f[0]],h=1,i=f.length;i>h;h++)switch(e=f[h]){case b:break;case c:var j=g[g.length-1];j===b||j===c?g.push(c):g.pop();break;default:g.push(e)}return g.join(d)},formatPath:function(b,c){var e=b;e="/"===d?e.split("\\").join(d):e.split("/").join(d);var f=c?c.get("path")||a.PATH:a.PATH,g=e.indexOf(d);return e.indexOf(a.PATH)>-1||e.indexOf(a.ZN_PATH)>-1?e:(e=g>0?f?f.substring(0,f.lastIndexOf(d)+1)+e:e:0===g?a.PATH.substring(0,a.PATH.lastIndexOf(d))+e:a.ZN_PATH+d+e+d,e.slice(-1)===d&&(e+="index.js"),e=this.normalizePath(e))}},h=a.Class("zn.Module",{events:["pending","loading","waiting","loaded"],statics:{all:{},current:null,counter:0,preLoadedPackage:{},unloadModule:function(a){var b=(require.resolve(a),require.cache[a]);b&&b.parent&&b.parent.children.splice(b.parent.children.indexOf(b),1),require.cache[a]=null;var c=h.all[a];return c&&c.parent&&h.unloadModule(c.parent.path),h.all[a]=null,this},loadModule:function(b,c,d){if(a.is(b,h))return b.load(c);if("node:"===b.substring(0,5))return c(require(b.substring(5)));var i=g.formatPath(b,d);f||(i=require.resolve(i));var j=h.all[i];j?j.load(c):(j=h.all[i]=new h(i),h.counter++,f?this.__webModule(i,function(a){if(h.counter--,a)throw new Error("Failed to load module:"+b);j.sets({parent:d,path:i,dependencies:h.current.get("dependencies"),factory:h.current.get("factory"),status:e.LOADING}),j.load(c)}):this.__nodeModule(i,function(){h.counter--,j.sets({parent:d,path:i,dependencies:h.current.get("dependencies"),factory:h.current.get("factory"),status:e.LOADING}),j.load(c)}))},__nodeModule:function(b,c){var d=b,e=c||a.idle;e(require(d))},__webModule:function(b,c){var e=f.head||f.getElementsByTagName("head")[0],g=f.createElement("script"),h=b,i=c||a.idle,j=function(a){g.onload=null,g.onerror=null,i(a)};h=h.slice(-1)===d?h+"index.js":h,h=".js"===h.slice(-3).toLowerCase()?h:h+".js",g.src=h,"onload"in g?g.onload=function(){j(null)}:g.onreadystatechange=function(a){var b=g.readyState;j("loaded"===b||"complete"===b?null:a)},g.onerror=function(a){j(a)},e.appendChild(g)}},properties:{parent:null,status:e.PENDING,path:"",dependencies:null,factory:null,value:{set:function(a){a._ctors_&&(a.$path=this.get("path")),this._value=a},get:function(){return this._value}}},methods:{init:function(a,b,c){this.sets({path:a,dependencies:b||[],factory:c,value:{}}),this._callbacks=[]},exec:function(a){var b=process.argv,c=b[1];return this.sets({path:c,status:e.LOADING}),this.load(a),this},__pending:function(a){this._callbacks.push(a)},__loading:function(b){var c=(this.get("path"),this.get("dependencies")),d=this._depHandler,f=this.get("factory"),g=this.get("value");this.set("status",e.WAITING),this._callbacks.push(b);var i=c.length;if(0===i)g=f.call(g)||g,this.set("value",g),this.set("status",e.LOADED),a.each(this._callbacks,function(a){a(g)});else{var j=[],k=this;a.each(c,function(b,c){d&&(b=d(b,c)),h.loadModule(b,function(b){j[c]=b,i--,0===i&&(g=f.apply(g,j)||g,k.set("value",g),k.set("status",e.LOADED),a.each(k._callbacks,function(a){a(g)}))},k)})}},__waiting:function(a){var b=this;setTimeout(function(){0===h.counter&&b.set("status",e.LOADING),b.load(a)})},__loaded:function(a){a(this.get("value"))},load:function(b){var c=this.get("status"),d=b||a.idle;switch(c){case e.PENDING:this.__pending(d);break;case e.LOADING:this.__loading(d);break;case e.WAITING:this.__waiting(d);break;case e.LOADED:this.__loaded(d)}return this}}});a.define=function(){var b=arguments,c=b.length,d=b[0],e=[],f=null;switch(c){case 1:a.is(d,"function")?f=d:a.is(d,"array")?(e=d,f=function(){var b={};return a.each(arguments,function(c){c._name_?b[c._name_]=c:a.extend(b,c)}),b}):f=function(){return d};break;case 2:e=d,f=b[1];break;case 3:e=d,f=b[1]}return e&&a.is(e,"string")&&(e=[e]),h.current=new h("",e,f),b[2]&&(h.current._depHandler=b[2]),h.current};var i=a.Class("zn.Loader",{"static":!0,properties:{preLoadPackages:[]},methods:{init:function(){for(var a=this.preLoadPackages,b=0,c=a.length;c>b;b++)this.loadPackage(a[b])},loadPackage:function(b){this.load(b+"index.js",function(b){a.extend(h.preLoadedPackage,b)})},load:function(a,b,c){return h.loadModule(a,b,c),this}}});a.load=i.load,a.module=h}(zn),function(a){var b=Array.prototype.slice,c={PENDING:0,CANCLE:1,PAUSE:2,FINISHED:3},d=a.Class({events:["init","finished"],properties:{status:{value:c.PENDING,get:function(){return this._status}}},methods:{init:function(){},doTask:function(a,b){if(a){var c=b||[];c.unshift(this),a.handler.apply(a.context,c)}},done:function(){this._status=c.FINISHED,this._data=b.call(arguments),this.fire("finished",this._data),this.off("finished")}}}),e=a.Class({events:["clear","push","pause","resume","exception","every","finally"],properties:{count:{get:function(){return this._tasks.length}}},methods:{init:function(a){this._exceptions=[],this._finallys=[],this._everys=[],this._tasks=[],this._taskProcessor=[],this._lastTask=null,this._data=[],this._max=(a||{}).max||1},destroy:function(){this._everys=[],this._tasks=[],this._taskProcessor=[],this.fire("finally",this._data,{method:"apply"}),this.super()},clear:function(){this._tasks=[]},pause:function(a){return this._paused=!0,a>0&&(this._pauseTimer=setTimeout(function(){this.resume()}.bind(this),a)),this.fire("pause"),this},resume:function(){return this._pauseTimer&&clearTimeout(this._pauseTimer),this._paused=!1,this.fire("resume"),this.doTask(),this},exception:function(a,b){return this.on("exception",a,b||this),this},"catch":function(a){return this.fire("exception",a),this},"finally":function(a,b){return this.on("finally",a,b||this),this},every:function(a,b){return this.on("every",a,b||this),this},push:function(a,b){var c={handler:a,context:b||this};return this._lastTask&&(c.previous=c,this._lastTask.next=c),this._lastTask=c,this._tasks.push(c),this.fire("push",c),this},getTaskProcessor:function(){for(var a=null,b=this._taskProcessor.length,e=0;b>e;e++)if(a=this._taskProcessor[e],a.status==c.FINISHED)return a;if(!a&&this._max>b){var f=new d;return f.queue=this,f.on("finished",this.__onProcessorFinished.bind(this),this),f}},start:function(){return this._data=[],this.doTask()},doTask:function(a){var b=this._tasks.shift();if(b){var c=this.getTaskProcessor();c&&(b.previousResult=a,c.doTask(b,a))}else this.destroy();return this},__onProcessorFinished:function(a,b){this._data.push(b),this.fire("every",b,{method:"apply"}),this.doTask(b)}}});a.queue=function(a){return new e(a)}}(zn),function(a){var b={ISO8601:"yyyy-MM-dd hh:mm:ss.SSS",ISO8601_WITH_TZ_OFFSET:"yyyy-MM-ddThh:mm:ssO",DATETIME:"dd MM yyyy hh:mm:ss.SSS",ABSOLUTETIME:"hh:mm:ss.SSS"},c=a.Class("zn.util.DateUtil",{"static":!0,properties:{},methods:{init:function(){},asString:function(a){var c=b.ISO8601;"string"==typeof a&&(c=arguments[0],a=arguments[1]);var d=this.__addZero(a.getDate()),e=this.__addZero(a.getMonth()+1),f=this.__addZero(a.getFullYear()),g=this.__addZero(a.getFullYear().toString().substring(2,4)),h=c.indexOf("yyyy")>-1?f:g,i=this.__addZero(a.getHours()),j=this.__addZero(a.getMinutes()),k=this.__addZero(a.getSeconds()),l=this.__padWithZeros(a.getMilliseconds(),3),m=this.__offset(a),n=c.replace(/dd/g,d).replace(/MM/g,e).replace(/y{1,4}/g,h).replace(/hh/g,i).replace(/mm/g,j).replace(/ss/g,k).replace(/SSS/g,l).replace(/O/g,m);return n},__padWithZeros:function(a,b){for(var c=a+"";c.length<b;)c="0"+c;return c},__addZero:function(a){return this.__padWithZeros(a,2)},__offset:function(a){var b=Math.abs(a.getTimezoneOffset()),c=String(Math.floor(b/60)),d=String(b%60);return 1==c.length&&(c="0"+c),1==d.length&&(d="0"+d),a.getTimezoneOffset()<0?"+"+c+d:"-"+c+d}}}),d=["INFO","DEBUG","WARNING","ERROR","TRACE","","INIT"],e=["#100000","#2125a0","#a82c2c","#c045b7","1cb131","","#100000"],f=[38,34,35,31,32,36,33],g={INFO:0,DEBUG:1,WARNING:2,ERROR:3,TRACE:4,INIT:6},h=a.Class({"static":!0,properties:{},methods:{init:function(){},info:function(a){this.__log(g.INFO,a)},debug:function(a){this.__log(g.DEBUG,a)},warn:function(a){this.__log(g.WARNING,a)},trace:function(a){this.__log(g.TRACE,a)},error:function(a){this.__log(g.ERROR,a)},__getDateString:function(a){return c.asString(a||new Date)},__getPosition:function(){try{throw new Error}catch(a){var b=a.stack.split("\n")[4].replace(/\(/g,"").replace(/\)/g,"").split("/").pop();return b}},__formatLog4Server:function(a,b){var c="",e="",g="";return b&&(e="[",g="",c=f[5]+"m",b=f[a.type]+"m"),[a.time," [",e,b,d[a.type],g,"] ",a.message].join("")},__formatLog4Client:function(a){return["%c"+a.time," [",d[a.type],"] ",a.message].join("")},__log:function(a,b){var c={type:a,message:"object"==typeof b?JSON.stringify(b):b,time:this.__getDateString(),pos:this.__getPosition()};"undefined"!=typeof module&&module.exports?console.log(this.__formatLog4Server(c,!0)):console.log(this.__formatLog4Client(c,!0),"color:"+e[a])}}}),i={info:function(){h.info.apply(h,arguments)},debug:function(){h.debug.apply(h,arguments)},warn:function(){h.warn.apply(h,arguments)},trace:function(){h.trace.apply(h,arguments)},error:function(){h.error.apply(h,arguments)}};a.extend(a,i)}(zn),function(a){var b=Array.prototype.slice,c={PENDING:0,FULFILLED:1,REJECTED:2},d=a.Class({"static":!0,methods:{init:function(){this._exceptions=[],this._finallys=[],this._count=0,this._currIndex=0,this._dataArray=[]},exception:function(a){return this._exceptions.push(a),this},"catch":function(b,c){return a.each(this._exceptions,function(a){a.call(c,b)}),this},"finally":function(a){return this._finallys.push(a),this},defer:function(b,c){var d=this,f=new e(b,c);return f.on("complete",function(b,c){d._currIndex++,d._dataArray.push(c),d._currIndex==d._count&&(a.each(d._finallys,function(b){try{b(d._dataArray)}catch(c){a.error(c.message)}}),d._finallys=[])}),d._count++,f},all:function(b){var c=d.defer(),e=0,f=[];return a.each(b,function(a){a.then(function(a){f.push(a),e++,e>=b.length&&c.resolve(f)})}),c.promise},any:function(b){var c=d.defer();return a.each(b,function(a){a.then(function(a){c.resolve(a)})}),c.promise}}}),e=a.Class({events:["complete"],properties:{promise:null},methods:{init:function(a,b){this._promise=new f,a&&this.resolve(a),b&&this.reject(b)},resolve:function(){var e=b.call(arguments);try{var f=this.get("promise"),g=this;if(f.get("readyState")!=c.PENDING)return;f.set("readyState",c.FULFILLED),f.set("data",e),a.each(f.get("resolves"),function(a){a.apply(g,e)})}catch(h){d.catch(h,this)}this.fire("complete",e)},reject:function(){var a=b.call(arguments);try{var e=this.get("promise");if(e.get("readyState")!=c.PENDING)return;e.set("readyState",c.REJECTED),e.set("reason",a);var f=e.get("rejects")[0];f&&f.apply(this,a)}catch(g){d.catch(g,this)}this.fire("complete",a)}}}),f=a.Class({statics:{isPromise:function(a){return null!==a&&void 0!==a&&"function"==typeof a.then},defer:null},properties:{resolves:null,rejects:null,data:null,reason:null,readyState:null},methods:{init:function(){this.set("resolves",[]),this.set("rejects",[]),this.set("exceptions",[]),this.set("readyState",c.PENDING)},then:function(a,d){function g(){var c=b.call(arguments),d=a?a.apply(this,c):c;return f.isPromise(d)?d.then(function(){h.resolve.apply(h,b.call(arguments))}):h.resolve.apply(h,d),d}var h=new e;if(this.get("readyState")===c.PENDING)this.get("resolves").push(g),this.get("rejects").push(d?d:function(){h.reject.apply(h,b.call(arguments))});else if(this.get("readyState")===c.FULFILLED){var i=this;setTimeout(function(){g.apply(i,i.get("data"))})}return h.promise},"catch":function(a){return d.exception(a)},"finally":function(a){return d.finally(a)},otherwise:function(a){return this.then(void 0,a)}}});a.async=d}(zn),function(a){var b=(a.Class({events:["init","start","stop","cancle","goNext","goPre"],properties:{pre:null,next:null,delay:null,action:null,args:[],context:this,taskList:null,status:{value:"",get:function(){return this._status}}},methods:{init:function(a){this.sets(a),this.fire("init",this)},start:function(){"started"!=this._status&&(this._action?(this._action.apply(this._context,this._args),this._status="started"):this.goNext(),this.fire("start",this))},stop:function(){this._status="stoped",this.fire("stop",this)},cancle:function(){this._status="cancle",this.fire("cancle",this)},goNext:function(){this._next&&this._next.start(),this.fire("goNext",this)},goPre:function(){this._pre&&this._pre.start(),this.fire("goPre",this)}}}),a.Class({properties:{url:"",data:{set:function(a){this._data=a},get:function(){return a.is(this._data,"object")?JSON.stringify(this._data):this._data}},method:"GET",asyns:!0,username:null,password:null,headers:{get:function(){return a.overwrite({"X-Requested-With":"XMLHttpRequest","Content-type":"application/json"},this._headers)},set:function(a){this._headers=a}},timeout:{get:function(){return this._timeout||2e4},set:function(a){this._timeout=a}}},events:["before","after","success","error","complete","timeout"],methods:{init:function(a){this.sets(a),this._isRunning=!1},__initXMLHttpRequest:function(){if(this._XMLHttpRequest)return this._XMLHttpRequest;if(!window.ActiveXObject)return this._XMLHttpRequest=new XMLHttpRequest,this._XMLHttpRequest;for(var a="MSXML2.XMLHTTP",b=["Microsoft.XMLHTTP",a,a+".3.0",a+".4.0",a+".5.0",a+".6.0"],c=b.length,d=c-1;d>-1;d--)try{return this._XMLHttpRequest=new ActiveXObject(b[d]),this._XMLHttpRequest}catch(e){continue}},__onComplete:function(a){clearTimeout(this._timeoutID),this._isRunning=!1,this.resetEvents(),this.fire("complete",a)},__initRequestHeader:function(a,b){for(var c in b)a.setRequestHeader(c,b[c])},resetEvents:function(){this.off("before"),this.off("after"),this.off("success"),this.off("error"),this.off("complete"),this.off("timeout")},send:function(b){if(this._isRunning)return!1;this.sets(b);var c=this.__initXMLHttpRequest(),d=this,e=a.async.defer();if(this._isRunning=!0,this.timeout&&(this._timeoutID=setTimeout(function(){d._isRunning&&(c.abort(),d.fire("timeout",d),d.__onComplete("timeout"))},this.timeout)),this.fire("before",this)!==!1&&this.url){var f=this.url,g=this.data,h=this._method.toUpperCase();"GET"===h&&(g&&(f=f+"?"+g),g=null),c.readyState<2&&(c.withCredentials=!0),c.open(h,f,this.asyns),c.onreadystatechange=function(a){var b=a.currentTarget;if(4==b.readyState){var c=b.status,d=b.responseText,f=b.getResponseHeader("Content-Type");if(c>=400&&500>c)return e.reject(b),void this.fire("error","Client Error Code: "+c);if(c>=500)return e.reject(b),void this.fire("error","Server Error code: "+c);try{d=f&&f.indexOf("application/json")>=0?JSON.parse(d):d}catch(g){d=d}return c>=200&&300>c?(e.resolve(d,b),this.fire("success",d)):(e.reject(b),this.fire("error",b)),this.__onComplete(b),d}}.bind(this),this.__initRequestHeader(c,this.headers),c.send(g),this.asyns||this.__onComplete(c)}else this.__onComplete(c);return e.promise},abort:function(){this._XMLHttpRequest&&this._XMLHttpRequest.abort()}}})),c=a.Class({"static":!0,properties:{max:3,count:{get:function(){return this._data.length}}},methods:{init:function(){this._data=[]},getInstance:function(){for(var a=0,c=this._data.length;c>a;a++)if(!this._data[a]._isRunning)return this._data[a].resetEvents(),this._data[a];return function(a){var c=new b;return a._data.push(c),c}(this)}}}),d=a.Class({properties:{timeout:1e3},methods:{init:function(a){this.sets(a)},request:function(b,d){var e=c.getInstance();return a.each(b,function(a,b){"function"==typeof a&&e.on(b,a,this)},this),d&&d(e),e.send(b)},get:function(a){return a.method="GET",this.request(a)},post:function(a){return a.method="POST",this.request(a)},put:function(a){return a.method="PUT",this.request(a)},"delete":function(a){return a.method="DELETE",this.request(a)}}}),e=new d;a.extend(a,{$get:e.get.bind(e),$post:e.post.bind(e),$put:e.put.bind(e),$delete:e.delete.bind(e)})}(zn),function(a){var b=Array.prototype,c=b.push,d=b.sort,e=b.join,f=b.slice,g=b.splice,h=b.indexOf,i=b.lastIndexOf,j=b.forEach,k=function(b){if(a.is(b,l))return b.toArray();if(a.is(b,"array"))return b.slice(0);var c=[];return a.each(b,function(a){c.push(a)}),c},l=a.Class("zn.data.List",{properties:{count:{get:function(){return this.length},set:function(){throw new Error("Unable to set count of List")}}},methods:{init:{auto:!0,value:function(a){this.length=0,this.insertRange(a,0)}},unique:function(){},dispose:function(){this.clear()
},add:function(a){var b=this.length;return c.call(this,a),b},addRange:function(a){return this.insertRange(a,this.length)},remove:function(a){var b=this.indexOf(a);return b>=0?(g.call(this,b,1),b):-1},removeAt:function(a){return g.call(this,a,1)[0]},insert:function(a,b){return g.call(this,b,0,a),a},insertRange:function(a,b){return g.apply(this,[b,0].concat(k(a))),b},clear:function(){return g.call(this,0)},getItem:function(a){if(a<this.length)return this[a];throw new Error("Index out of range.")},setItem:function(a,b){if(!(a<this.length))throw new Error("Index out of range.");this[a]=b},getRange:function(a,b){return new l(f.call(this,a,a+b))},indexOf:function(a){return h.call(this,a)},lastIndexOf:function(a){return i.call(this,a)},contains:function(a){return this.indexOf(a)>=0},toggle:function(a){this.contains(a)?this.remove(a):this.add(a)},sort:function(a){return d.call(this,a)},each:function(a,b){j.call(this,a,b)},toArray:function(){return f.call(this,0)},join:function(){return e.call(this)}}})}(zn),function(a){a.Class("zn.data.TList",{statics:{getInstance:function(a){return new this(a)}},properties:{min:0,max:100,TClass:null,TClassArgv:{}},methods:{init:function(a){this.sets(a),this.reset()},reset:function(){this._data=[];for(var a=0;a<(this.min||0);a++)this.push(this.TClassArgv)},push:function(a){if(this.TClass){var b=new this.TClass(a||this.TClassArgv);return this._data.push(b),b}},findOneT:function(b){var c=null,d=b||a.idle;return a.each(this._data,function(a,b){return d(a,b)?(c=a,-1):void 0}),c},findAllT:function(b){var c=[],d=b||a.idle;return a.each(this._data,function(a,b){d(a,b)&&c.push(a)}),c}}})}(zn),function(a){a.Class("zn.data.Task",{statics:{getInstance:function(a){return new this(a)},PANDING:0,WAITING:1,DOING:2,DONE:3},properties:{statue:0},methods:{init:function(a){this.sets(a)}}})}(zn),function(a){var b=a.Class("zn.data.Observable",{properties:{},methods:{init:{auto:!0,value:function(){this.__watchers__={}}},dispose:function(){a.each(this.__watchers__,function(a,b){this.__unbind(b,this.get(b))},this),this.__watchers__=null},watch:function(b,c,d){var e="*"===b?this.constructor._properties_:a.is(b,"array")?b:[b];return e.forEach(function(a){this.__watch(a,c,d)},this),this},unwatch:function(b,c,d){var e="*"===b?this.constructor._properties_:a.is(b,"array")?b:[b];return e.forEach(function(a){this.__unwatch(a,c,d)},this),this},notify:function(b){var c="*"===b?Object.keys(this.__watchers__):a.is(b,"array")?b:[b];return a.each(c,function(a){this.__notify(a)},this),this},__watch:function(a,c,d){var e=a.indexOf("."),f=a,g="",h=this.__watchers__;if(e>=0){f=a.slice(0,e),g=a.slice(e+1);var i=this.get(f);i&&i.watch&&i.watch(g,c,d)}var j=h[f]=h[f]||[];j.push({handler:c,context:d,fullPath:a,subPath:g});var k=this.member(f);if(k&&"property"===k.type){var l=k.meta;if(!l.watched){var m=k.getter,n=k.setter;b.defineProperty(f,{get:function(a){return m.call(this,a)},set:function(a,b){var c=m.call(this);(c!==a||b&&b.force)&&(this.__unbind(f,c),n.call(this,a,b)!==!1&&(this.__bind(f,a),this.notify(f)))},watched:!0},this)}}},__unwatch:function(a,b,c){var d=a.indexOf("."),e=a,f="",g=this.__watchers__;if(d>=0){e=a.slice(0,d),f=a.slice(d+1);var h=this.get(e);h&&h.unwatch&&h.unwatch(f,b,c)}var i,j=g[e];if(!j)return!1;if(b){for(var k=0,l=j.length;l>k;k++)if(i=j[k],i.handler===b&&i.context===c){j.splice(k,1);break}}else j.length=0},__bind:function(b,c){c&&c.watch&&a.each(this.__watchers__[b],function(a){a.subPath&&c.watch(a.subPath,a.handler,a.context)})},__unbind:function(b,c){c&&c.unwatch&&a.each(this.__watchers__[b],function(a){a.subPath&&c.unwatch(a.subPath,a.handler,a.context)})},__notify:function(b){var c=this.get(b);a.each(this.__watchers__[b],function(b){b&&b.handler&&b.handler.call(b.context,a.path(c,b.subPath),b.fullPath,this)},this)}}})}(zn),function(a){var b=a.Class({properties:{direction:{value:"oneway",readonly:!0},target:{value:null,readonly:!0},targetPath:{value:"",readonly:!0},source:{get:function(a){return a?this._owner:this._source},set:function(a){this._source=a,this.__rebind()}},sourcePaths:{get:function(){return this._sourcePaths},set:function(a){this._sourcePaths=this.__parseSourcePaths(a,function(a){a&&this.__rebind()}.bind(this))}},owner:{get:function(){return this._owner}},converter:{value:null},async:{value:!1}},methods:{init:function(b,c,d){{var e=d||{},f=b.member(c);f&&f.meta.binding||{}}a.overwrite(e,{direction:"oneway",converter:{}});var g=this._direction=e.direction;this._source=e.source,this._sourcePaths=this.__parseSourcePaths(e.sourcePaths),this._owner=e.owner||b,this._converter=this.__parseConverter(e),this._target=b,this._targetPath=c,("twoway"===g||"oneway"===g)&&this.__rebind(),("twoway"===g||"inverse"===g)&&b.watch(c,function(a){this.__updateSource(a)},this)},dispose:function(){this._source=null,this.__rebind()},__updateSource:function(b){var c=this._converter,d=null;return a.each(this.sourcePaths,function(e){d=c.revert.call(c.context,b),a.path(this.get("source",e[0]),e[1],d)},this),this},__updateTarget:function(){var b=this,c=[],d=null,e=this._owner,f=this._target,g=null,h=this._targetPath,i=this._converter;return a.each(this.sourcePaths,function(f){d=a.path(b.get("source",f[0]),f[1]),d=a.is(d,"function")?d.bind(e):d,c.push(d)}),g=i.convert.apply(i.context,c),f.set(h,g),this},__rebind:function(){var b=this._sourcePaths,c=this._watchers;return c&&(a.each(c,function(a){a.source.unwatch(a.path,a.handler)}),this._watchers=null),a.each(b,function(b){var d=b[0],e=b[1],f=this.get("source",d);a.can(f,"watch")&&(f.watch(e,this.__updateTarget.bind(this)),c=c||[],c.push({source:f,path:e,handler:this.__updateTarget}))},this),this.__updateTarget()},__parseSourcePaths:function(a,b){for(var c=a.split(","),d="",e=!1,f=0,g=c.length;g>f;f++)d=c[f].trim(),"#"===d.charAt(0)&&(d=d.substring(1),e=!0),c[f]=[e,d],b&&b(e,d);return c},__parseConverter:function(b){var c=b.converter;(a.is(c,"string")||a.is(c,"function"))&&(c={convert:c});var d=c.convert=b.convert||c.convert||function(a){return a};if(c.revert=b.revert||function(a){return a},c.context=b.context||this.owner,a.is(d,"string")){var e=d.lastIndexOf("."),f=d,g=this.source||this.owner,h="";e>0&&(h=d.slice(0,e),f=d.slice(e+1),g=a.path(this.source,h)),d=g&&g[f]}return c.convert=d,c}}}),c=a.Class("zn.data.Bindable",a.data.Observable,{statics:{parseOptions:function(b,c){var d=null;if("string"==typeof b&&"{"===b.charAt(0)&&"}"===b.charAt(b.length-1)){var e=b.slice(1,-1),f=e.split(";");d={owner:c,sourcePaths:f.shift()},a.each(f,function(a){if(!a)return-1;var b=a.split("=");d[b[0]]=b[1]})}else"object"==typeof b&&(d=b);return d}},properties:{model:{get:function(){return this._model},set:function(b){this._model=b,a.each(this.__bindings__,function(a){a.set("source",b)})}}},methods:{init:{auto:!0,value:function(){this.__bindings__={}},after:function(){this.__binding()}},dispose:function(){this.super(),a.each(this.__bindings__,function(a){a.dispose()}),this.__bindings__=null},let:function(a,b,d,e){var f=c.parseOptions(b);f?(f.owner=d,this.setBinding(a,f,e)):this.set(a,b)},getBinding:function(a){return this.__bindings__[a]},setBinding:function(a,c,d){return c.source=c.model||this.get("model"),c.owner=c.owner||this,this.clearBinding(a),this.__bindings__[a]=new b(d||this,c.targetPath||a,c),this},clearBinding:function(a){var b=this.__bindings__[a];b&&(b.dispose(),delete this.__bindings__[a])},__binding:function(){var b=this,c=this.constructor.getMeta("properties");a.each(c,function(a,c){a&&a.binding&&b.let(c,a.binding)})}}})}(zn),function(a){a.Class("zn.data.Map",{properties:{count:{get:function(){var a=0;return this.each(function(){a++}),a}},keys:{get:function(){return Object.keys(this._map)},set:function(){throw new Error("Unable to set keys of Map")}},values:{get:function(){return this.__getMapValues()},set:function(){throw new Error("Unable to set values of Map")}}},methods:{init:{auto:!0,value:function(a){this._map={},this.concat(a)}},concat:function(b){if(b){var c=(this._map,this);a.each(b,function(a,b){c.set(b,a)})}return this},contains:function(a){return a in this._map},getItem:function(a){return this._map[a]},get:function(a){if(this.has(a))return this.super(a);var b=this.getItem(a);return b&&b.value},set:function(a,b){if(this.has(a))return this.super(a);var c=a,d=this._map[c];return d||(d=this._map[c]={key:c}),d.value=b,this},remove:function(a){return delete this._map[a],this},clear:function(){return this._map={},this},each:function(b,c){return a.each(this._map,b,c),this},eachKey:function(b,c){return a.each(this.keys,b,c),this},eachValue:function(b,c){return a.each(this.values,b,c),this},toArray:function(){var a=[];return this.each(function(b){a.push(b)}),a},toObject:function(){var a={};return this.each(function(b){a[b.key]=b.value}),a},__getMapValues:function(){var a=[];return this.each(function(b){a.push(b.value)}),a}}})}(zn),function(a){a.Class("zn.data.ObservableList",a.data.List,{mixins:[a.data.Observable],events:["change"],methods:{add:function(a){var b=this.super(a);return this.notify("count"),this.fire("change",{action:"add",items:[a],index:b}),b},addRange:function(a){var b=this.super(a);return this.notify("count"),this.fire("change",{action:"add",items:a,index:b}),b},insert:function(a,b){return this.super(a,b),this.notify("count"),this.fire("change",{action:"add",items:[a],index:b}),b},insertRange:function(a,b){return this.super(a,b),this.notify("count"),this.fire("change",{action:"add",items:a,index:b}),b},remove:function(a){var b=this.super(a);return b>=0&&(this.notify("count"),this.fire("change",{action:"remove",items:[a],index:b})),index},removeAt:function(a){var b=this.super(a);return void 0!==b&&(this.notify("count"),this.fire("change",{action:"remove",items:[b],index:a})),b},clear:function(){var a=this.super();return this.notify("count"),this.fire("change",{action:"clear",items:a}),a},sort:function(a){var b=this.super(a);return this.notify("count"),this.fire("change",{action:"sort",sort:a||function(a,b){return a>b?1:b>a?-1:0}}),b}}})}(zn),function(a){a.Class("zn.data.ObservableMap",a.data.Map,{mixins:[a.data.Observable],events:["change"],methods:{set:function(a,b){if(this.has(a))return this.super(a);var c=this._map,d={key:a,value:b};if(a in c){var e=c[a];c[a]=d,this.fire("change",{action:"replace",oldItem:e,newItem:d})}else c[a]=d,this.notify("count"),this.fire("change",{action:"add",items:[d]})},remove:function(a){var b=this._map;if(a in b){var c=b[a];delete b[a],this.notify("count"),this.fire("change",{action:"remove",items:[c]})}},clear:function(){this.toArray();return this.super(),this.notify("count"),this.fire("change",{action:"clear",items:this.toArray()}),this}}})}(zn);
var __isServer="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0),zn={VERSION:"0.0.1",DEBUG:!1,ZN_PATH:"",PATH:"",isServer:__isServer,GLOBAL:function(){return __isServer?global:window}.call(null)};if(zn.GLOBAL.zn=zn,__isServer)zn.ZN_PATH=__dirname,zn.PATH=process.cwd(),module.exports=zn;else{var _zn_url="";try{__a__=__b__}catch(e){e.fileName?_zn_url=e.fileName:e.sourceURL?_zn_url=e.sourceURL:e.stacktrace?console.log(e.stacktrace):e.stack?(_zn_url=e.stack.split("\n")[1],_zn_url=_zn_url.replace(/\s/g,""),_zn_url=_zn_url.substring(2,_zn_url.length)):console.log(e.toString())}if(!_zn_url)for(var _scripts=document.getElementsByTagName("script"),_src="",_node,i=0,_len=scripts.length;_len>i;i++)if(_node=scripts[i],_node.getAttribute&&(_src=_node.getAttribute("src")||"","zn.js"===_src.slice(-5)||"zn.minx.js"===_src.slice(-10))){_zn_url=_src;break}if(!_zn_url)throw new Error("zn.js has not been included, please do it first.");zn.ZN_PATH=_zn_url.substring(0,_zn_url.lastIndexOf("/")+1)}!function(a){var b=Object.prototype.toString,c={idle:function(){},idleArray:function(){return[]},idleObject:function(){return{}},format:function(){var a=arguments,b=null,c=null;return a.length<2?a[0]:(b=a[0].toString(),c=a[1],d.each(c,function(a,c){a=d.is(a,"object")?JSON.stringify(a):a.toString(),b=b.replace(new RegExp("\\{"+c+"\\}","gi"),a)}),b)},uuid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0,c="x"==a?b:3&b|8;return c.toString(16)}).toUpperCase()},serializeJSON:function(a){return Object.keys(a).map(function(b){return encodeURIComponent(b)+"="+encodeURIComponent(a[b])}).join("&")},fix:function(a){for(var b=a||{},c=1,d=arguments.length;d>c;c++){var e=arguments[c];for(var f in e)e.hasOwnProperty(f)&&"function"!=typeof b[f]&&(b[f]=e[f])}return b},extend:function(a){for(var b=a||{},c=1,d=arguments.length;d>c;c++){var e=arguments[c];for(var f in e)e.hasOwnProperty(f)&&(b[f]=e[f])}return b},overwrite:function(a){for(var b=a||{},c=1,d=arguments.length;d>c;c++){var e=arguments[c];for(var f in e)e.hasOwnProperty(f)&&void 0===b[f]&&(b[f]=e[f])}return b},path:function(a,b,c){var d=a||{};if(b){var e,f=b.split("."),g=f.length,h=0;if(arguments.length<3)for(;d&&g>h;h++)e=f[h],d=d.__get__?d.__get__(e):d[e];else{for(g-=1;d&&g>h;h++)e=f[h],d=d.__get__?d.__get__(e):d[e]=d[e]||{};e=f[h],d&&(d.__set__?d.__set__(e,c):d[e]=c,d=c)}}return d},invoke:function(b,c,d){if(b&&c){var e,f,g=c.lastIndexOf(".");g>0?(e=a.path(b,c.substring(0,g)),e&&(f=e[c.substring(g+1)])):(e=b,f=b[c]),f&&f.apply(e,d)}},deepEachObject:function(a,b,c){if(d.is(a,"object")){var e,f=null;for(var g in a)f=a[g],d.is(f,"object")?this.deepEachObject(f,b,c):(e=b&&b.call(c,f,g,a),void 0!==e&&null!==e&&(a[g]=e))}return a},arrayValueToObject:function(a,b,c){if(d.is(a,"array")){for(var e,f=null,g={},h=0,i=a.length;i>h;h++)f=a[h],e=b&&b.call(c,f,h,a),void 0!==e&&null!==e&&(g[f]=e);a=g}return a}},d={toString:function(a){return a&&a.toString?a.toString():b.call(a)},each:function(a,c,d){if(a&&c)if(a.__each__)a.__each__(c,d);else{var e=a.length,f=null;if(e>0&&"[object Array]"===b.call(a)){for(var g=0;e>g;g++)if(f=c.call(d,a[g],g),f===!1)return!1}else for(var h in a)if(a.hasOwnProperty(h)){if(f=c.call(d,a[h],h),f===!1)return!1;if(-1===f)continue}}},clone:function(b){if(b){if(b.__clone__)return b.__clone__();if(a.is(b,"array"))return b.slice(0);var c={};for(var d in b)b.hasOwnProperty(d)&&(c[d]=b[d]);return c}return b},type:function(a){return a&&a.__type__?a.__type__:b.call(a).slice(8,-1).toLowerCase()},is:function(a,b){if(a&&a.__is__)return a.__is__(b);if("string"==typeof b)switch(b.toLowerCase()){case"plain":return a&&a.constructor===Object;default:return this.type(a)===b}else if("function"==typeof b)return a instanceof b},may:function(a,b){return a?a.__may__?a.__may__(b):a.hasOwnProperty("on"+b):!1},can:function(a,b){return a?a.__can__?a.__can__(b):"function"==typeof a[b]:!1},has:function(a,b){return a?a.__has__?a.__has__(b):a.hasOwnProperty(b):!1},get:function(a,b){return a?a.__get__?a.__get__(b):a[b]:void 0},set:function(a,b,c){a&&(a.__set__?a.__set__(b,c):a[b]=c)},gets:function(a){if(a){if(a.__gets__)return a.__gets__();var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}},sets:function(a,b){if(a&&b)if(a.__sets__)a.__sets__(b);else for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])}};c.extend(a,c),c.extend(a,d)}(zn),function(a){{var b=Array.prototype.slice,c=Object.prototype.hasOwnProperty,d=Object.prototype.toString,e={format:function(){var b=arguments,c=this;return 1==b.length&&"object"==typeof b[0]&&(b=b[0]),a.each(b,function(b,d){b="object"==a.type(b)?JSON.stringify(b):b.toString(),c=c.replace(new RegExp("\\{"+d+"\\}","gi"),b)}),c.toString()}},f={isArray:function(b){return b&&"[object Array]"===a.toString(b)&&b.constructor===Array}},g={forEach:function(a,b){if(!a)return!1;for(var c=0,d=this.length;d>c;c++)a.call(b,this[c],c);return this},indexOf:function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},lastIndexOf:function(a){for(var b=this.length-1;b>=0;b--)if(this[b]===a)return b;return-1}},h={bind:function(a){var c=this;return function(){return c.apply(a,b.call(arguments,1))}}},i={toArray:function(a){return b.call(a)},keys:function(a){if(a!==Object(a))throw new TypeError("Object.keys called on a non-object");var b,d=[];for(b in a)c.call(a,b)&&d.push(b);return d},values:function(a){if(a!==Object(a))throw new TypeError("Object.keys called on a non-object");var b,d=[];for(b in a)c.call(a,b)&&d.push(a[b]);return d},create:function(){var b=function(){};return function(c,d){if(null===c)throw new Error("Cannot set a null [[Prototype]]");if("object"!=typeof c)throw new TypeError("Argument must be an object");return a.each(d,function(a,b){i.defineProperty(c,a,b)}),b.prototype=c,new b}}(),defineProperty:function(a,b,c){return a&&b&&c&&c.hasOwnProperty("value")&&(a[b]=c.value),a}};({parse:function(){return""},stringify:function(){var a=d,b=Array.isArray,c={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},e=function(a){return c[a]||"\\u"+(a.charCodeAt(0)+65536).toString(16).substr(1)},f=/[\\"\u0000-\u001F\u2028\u2029]/g;return function g(c){if(null==c)return"null";if("number"==typeof c)return isFinite(c)?c.toString():"null";if("boolean"==typeof c)return c.toString();if("object"==typeof c){var d;if("function"==typeof c.toJSON)return g(c.toJSON());if(b(c)){d="[";for(var h=0;h<c.length;h++)d+=(h?", ":"")+g(c[h]);return d+"]"}if("[object Object]"===a.call(c)){d=[];for(var i in c)c.hasOwnProperty(i)&&d.push(g(i)+": "+g(c[i]));return"{"+d.join(", ")+"}"}}return'"'+c.toString().replace(f,e)+'"'}}()})}a.fix(Array,f),a.fix(Array.prototype,g),a.fix(Function.prototype,h),a.fix(String.prototype,e)}(zn),function(a){function b(){}function c(){var c,e,f,h=l._arguments.apply(this,arguments),i=h.name,j=h.super,k=h.meta,n=k.methods.init;if(j._static_)throw new Error("Static class cannot be inherited.");if(j._final_)throw new Error("Final class cannot be inherited.");if(i&&k.partial&&(c=a.path(d,i)),k.static){if(c){if(!c._static_)throw new Error('Partial class "'+i+'" must be static.')}else c=function(){throw new Error("Cannot instantiate static class.")};f=c.prototype}else{if(c){if(c._static_)throw new Error('Partial class "'+i+'" must not be static.');if(c._super_!==j&&c._super_!==b)throw new Error('Partial class "'+i+'" must have consistent super class.')}else c=k.abstract?function(){throw new Error("Cannot instantiate abstract class.")}:function(){var b=c._mixins_||[],d=c._ctors_||[],e=null,f=arguments;this.__id__=g++,this.__handlers__={},this.__initializing__=!0,this.__afters__=[];for(var h=null,i=null,j=0,k=b.length;k>j;j++)h=b[j],h["@init"]?(i=h["@init"].meta,i=a.is(i,"function")?i:i.value,m(h.prototype.__super__,this,f),i&&i.call(this)):m(h.prototype.__super__,this,f);m(this.__super__,this,f);for(var l=0,n=d.length;n>l;l++)e=d[l],e=a.is(e,"function")?e:e.value,e&&e.apply(this,f);for(;this.__afters__.length>0;){var o=this.__afters__.pop();o.handler.apply(o.context,f)}this.__afters__=null,delete this.__afters__,this.__initializing__=!1},c._ctors_=[];c._super_!==j?(e=function(){},e.prototype=j.prototype,f=new e,f.constructor=c,f.__type__=i||"Anonymous",f.__super__=j,c.prototype=f):f=c.prototype,f.class=f.constructor,n&&(c._ctors_.push(n),f.__ctor__||(f.__ctor__=n))}return l._meta(c,h),f.__define__&&f.__define__.call(c),i&&a.path(d,i,c),c}var d=a.GLOBAL,e="@",f=1,g=1,h={fixTargetCtor:function(a){return a instanceof b?a.constructor:a},fixTargetKey:function(a){return e+a},defineEvent:function(a,b,c){var d=h.fixTargetCtor(a),e=h.fixTargetKey(b),f=e in d,g={};return f||(g=Object.defineProperty(a,"on"+b.toLowerCase(),{get:function(){var a=this.__handlers__[b];return a?a[0].handler:null},set:function(a){var c=this.__handlers__,d=c[b]=c[b]||[];d[0]={owner:this,handler:a,context:null}}})),d[e]={name:b,type:"event",meta:c,descriptor:g},f},defineProperty:function(b,c,d){var e,f,g=h.fixTargetCtor(b),i=h.fixTargetKey(c),j=i in g,k={};if("value"in d){var l=d.value,m="_"+c,n=d.get,o=d.set;e=n||function(){return m in this?this[m]:a.is(l,"function")?l.call(this):l},f=d.readonly?function(a,b){return b&&b.force?void(this[m]=a):!1}:o||function(a){this[m]=a}}else e=d.get||function(){return void 0},f=d.set||function(){return!1};return j&&(e.__super__=g[i].getter,f.__super__=g[i].setter),k=Object.defineProperty(b,c,{get:e,set:f,configurable:!0}),g[i]={name:c,type:"property",meta:d,getter:e,setter:f,descriptor:k},j},defineMethod:function(a,b,c){var d=h.fixTargetCtor(a),e=h.fixTargetKey(b),f=e in d;return d[e]={name:b,type:"method",meta:c},b in a&&(c.value.__super__=a[b]),a[b]=c.value,f}},i={__handlers__:{},member:function(a,c){var d=h.fixTargetCtor(c||this),e=d[h.fixTargetKey(a)];return e||d===b?e:this.member(a,d._super_)},may:function(a){var b=this.member(a);return b&&"event"==b.type},has:function(a){var b=this.member(a);return b&&"property"==b.type},can:function(a){var b=this.member(a);return b&&"method"==b.type},get:function(a,b){var c=this.member(a);return c&&c.getter?c.getter.call(this,b):void 0},set:function(a,b,c){var d=this.member(a);return d&&d.setter&&d.setter.call(this,b,c),this},gets:function(b){var c={},d=h.fixTargetCtor(this)._properties_;return a.each(d,function(a){c[a]=this.get(a,b)},this),c},sets:function(a,b){if(a)for(var c in a)a.hasOwnProperty(c)&&this.set(c,a[c],b);return this},each:function(a,b){for(var c=h.fixTargetCtor(this)._properties_,d=0,e=c.length;e>d;d++){var f=c[d],g=a.call(b,f,d,this.member(f),this.get(f));if(g===!1)return!1}return this},__may__:function(a){return this.may(a)},__has__:function(a){return this.has(a)},__can__:function(a){return this.can(a)},__get__:function(a){return this.get(a)},__gets__:function(){return this.gets()},__set__:function(a,b){this.set(a,b)},__sets__:function(a){this.sets(a)},__each__:function(a,b){return this.each(a,b)}},j={toString:function(){return"{ ClassName: "+(this._name_||"Anonymous")+", ClassID: "+this._id_+" }"},getProperties:function(b){var c={};if(!this.getMeta||"ZNObject"==this._name_)return c;var d=this._super_,e=this._mixins_;return d&&a.extend(c,d.getProperties(b)),e&&e.length&&a.each(e,function(d){a.extend(c,d.getProperties(b))}),a.each(this.getMeta("properties"),function(a,d){var e=b&&b(d,a)===!1;e||a.hidden||(c[d]=a)}),c},getPropertie:function(b){var c=null;return b&&a.each(this.getProperties(),function(a,d){return b==d&&(c=a),-1}),c},getMeta:function(a){return a?this._meta_[a]:this._meta_},setMeta:function(a,b){return this._meta_[a]=b,this},defineEvent:function(a,b,c){return h.defineEvent(c||this.prototype,a,b)||this._events_.push(a),this},defineProperty:function(a,b,c){return h.defineProperty(c||this.prototype,a,b)||this._properties_.push(a),this},defineMethod:function(a,b,c){return h.defineMethod(c||this.prototype,a,b)||this._methods_.push(a),this}},k={toString:function(){var a={ClassName:this.__name__||"Anonymous",InstanceID:this.__id__,Meta:this.constructor._meta_};return JSON.stringify(a)},toJson:function(){var b={};return a.each(this.constructor.getProperties(),function(a,c){b[c]=this.get(c)},this),b},getProperties:function(){return this.constructor.getProperties()},getPropertie:function(a){return this.constructor.getPropertie(a)},upon:function(b,c,d){if(c){var e=this.__handlers__,f=e[b]=e[b]||[];f[0]=a.extend({owner:this,handler:c},d)}return this},on:function(b,c,d){if(c){var e=this.__handlers__,f=e[b]=e[b]||[{owner:null,handler:null,context:null}];f.push(a.extend({owner:this,handler:c},d))}return this},off:function(a,b,c){var d,e=this.__handlers__[a]||[],f=c&&c.context;if(b)for(var g=e.length-1;g>=0;g--)d=e[g],d.handler!==b||f&&d.context!==f||this.__handlers__[a].splice(g,1);else this.__handlers__[a]=[{owner:null,handler:null,context:null}];return this},fire:function(a,b,c){var d,e=this.__handlers__[a],f=null;if(e)for(var g=0,h=e.length;h>g;g++)if(d=e[g],d&&d.handler&&(f=c&&"apply"==c.method?d.handler.apply(d.context||d.owner,b):d.handler.call(d.context||d.owner,d.owner,b,c),!1===f))return!1;return this},dispose:function(){return this.__handlers__={},this},destroy:function(){return this.dispose()},"super":function(){var a=this.super.caller.__super__;return a?a.apply(this,arguments):void 0},is:function(b){if("string"==typeof b&&(b=a.path(d,b)),b){if(this instanceof b)return!0;for(var c=this.constructor._mixins_,e=0,f=c.length;f>e;e++){var g=c[e];if(b===g)return!0}}return!1},__is__:function(a){return this.is(a)},__clone__:function(){}};a.extend(b,i,j,{_id_:0,_name_:"ZNObject",_statics_:{},_events_:[],_properties_:[],_methods_:[],_mixins_:[],_meta_:{}}),a.extend(b.prototype,i,k),a.isZNObject=function(a){return a instanceof b};var l={_arguments:function(){var c,d,e,f=arguments,g=f.length,h=f[0],i={"static":!1,statics:[],partial:!1,"abstract":!1,"final":!1,mixins:[],events:[],properties:[],methods:[]};if(3===g){if(c=h,d=f[1],e=f[2],!a.is(d,"function"))throw new Error("Invalid _super class.")}else if(2===g){if(a.is(h,"string"))c=h,d=null;else{if(!a.is(h,"function"))throw new Error("Invalid _super class.");c=null,d=h}e=f[1]}else{if(1!==g)throw new Error("Invalid arguments.");if(c=null,d=null,e=h,!a.is(e,"object"))throw new Error("The meta argument must be an object.")}return c=c||"",e=a.overwrite(e||{},i),d=d||b,{name:c,"super":d,meta:e}},_meta:function(b,c){var d=c.name,e=c.super,g=c.meta;return a.extend(b,i,j,{_id_:f++,_name_:d,_super_:e,_partial_:g.partial,_abstract_:g.abstract,_static_:g.static,_final_:g.final,_statics_:a.extend({},e._statics_,g.statics),_events_:e._events_.slice(0),_properties_:e._properties_.slice(0),_methods_:e._methods_.slice(0),_mixins_:e._mixins_.concat(g.mixins),_meta_:g}),a.extend(b,b._statics_),g.static?(a.each(g.events,function(a){b.defineEvent(a,{},b)}),a.each(g.properties||g.props,function(c,d){b.defineProperty(d,a.is(c,"object")?c:{value:c},b)}),a.each(g.methods,function(c,d){b.defineMethod(d,a.is(c,"function")?{value:c}:c,b)}),g.methods.init&&g.methods.init.call(b,b)):(a.each(g.mixins,function(c){var d=c.prototype;a.each(c._events_,function(a){b.defineEvent(a,d.member(a).meta)}),a.each(c._properties_,function(a){b.defineProperty(a,d.member(a).meta)}),a.each(c._methods_,function(a){i[a]||k[a]||b.defineMethod(a,d.member(a).meta)})}),a.each(g.events,function(a){b.defineEvent(a,{})}),a.each(g.properties,function(c,d){b.defineProperty(d,a.is(c,"object")?c:{value:c})}),a.each(g.methods,function(c,d){b.defineMethod(d,a.is(c,"function")?{value:c}:c)})),b}},m=function(c,d,e){if(c&&c!==b){var f=c.member("init"),g=c._mixins_,h=null;return f&&f.meta.after&&d.__afters__.push({context:d,handler:f.meta.after}),g.length&&a.each(g,function(b){b["@init"]&&(h=b["@init"].meta,h=a.is(h,"function")?h:h.value,h&&h.call(d))}),f&&f.meta.auto&&f.meta.value.apply(d,e),arguments.callee(c._super_,d)}};a.Class=c}(zn),function(a){var b=".",c="..",d="/",e={PENDING:0,LOADING:1,WAITING:2,LOADED:3},f=null;"undefined"!=typeof module&&module.exports?a.SLASH=d=require("path").sep:f=document;var g={normalizePath:function(a){for(var e,f=a.split(d),g=[f[0]],h=1,i=f.length;i>h;h++)switch(e=f[h]){case b:break;case c:var j=g[g.length-1];j===b||j===c?g.push(c):g.pop();break;default:g.push(e)}return g.join(d)},formatPath:function(b,c){var e=b;e="/"===d?e.split("\\").join(d):e.split("/").join(d);var f=c?c.get("path")||a.PATH:a.PATH,g=e.indexOf(d);return e.indexOf(a.PATH)>-1||e.indexOf(a.ZN_PATH)>-1?e:(e=g>0?f?f.substring(0,f.lastIndexOf(d)+1)+e:e:0===g?a.PATH.substring(0,a.PATH.lastIndexOf(d))+e:a.ZN_PATH+d+e+d,e.slice(-1)===d&&(e+="index.js"),e=this.normalizePath(e))}},h=a.Class("zn.Module",{events:["pending","loading","waiting","loaded"],statics:{all:{},current:null,counter:0,preLoadedPackage:{},unloadModule:function(a){var b=(require.resolve(a),require.cache[a]);b&&b.parent&&b.parent.children.splice(b.parent.children.indexOf(b),1),require.cache[a]=null;var c=h.all[a];return c&&c.parent&&h.unloadModule(c.parent.path),h.all[a]=null,this},loadModule:function(b,c,d){if(a.is(b,h))return b.load(c);if("node:"===b.substring(0,5))return c(require(b.substring(5)));var i=g.formatPath(b,d);f||(i=require.resolve(i));var j=h.all[i];j?j.load(c):(j=h.all[i]=new h(i),h.counter++,f?this.__webModule(i,function(a){if(h.counter--,a)throw new Error("Failed to load module:"+b);j.sets({parent:d,path:i,dependencies:h.current.get("dependencies"),factory:h.current.get("factory"),status:e.LOADING}),j.load(c)}):this.__nodeModule(i,function(){h.counter--,j.sets({parent:d,path:i,dependencies:h.current.get("dependencies"),factory:h.current.get("factory"),status:e.LOADING}),j.load(c)}))},__nodeModule:function(b,c){var d=b,e=c||a.idle;e(require(d))},__webModule:function(b,c){var e=f.head||f.getElementsByTagName("head")[0],g=f.createElement("script"),h=b,i=c||a.idle,j=function(a){g.onload=null,g.onerror=null,i(a)};h=h.slice(-1)===d?h+"index.js":h,h=".js"===h.slice(-3).toLowerCase()?h:h+".js",g.src=h,"onload"in g?g.onload=function(){j(null)}:g.onreadystatechange=function(a){var b=g.readyState;j("loaded"===b||"complete"===b?null:a)},g.onerror=function(a){j(a)},e.appendChild(g)}},properties:{parent:null,status:e.PENDING,path:"",dependencies:null,factory:null,value:{set:function(a){a._ctors_&&(a.$path=this.get("path")),this._value=a},get:function(){return this._value}}},methods:{init:function(a,b,c){this.sets({path:a,dependencies:b||[],factory:c,value:{}}),this._callbacks=[]},exec:function(a){var b=process.argv,c=b[1];return this.sets({path:c,status:e.LOADING}),this.load(a),this},__pending:function(a){this._callbacks.push(a)},__loading:function(b){var c=(this.get("path"),this.get("dependencies")),d=this._depHandler,f=this.get("factory"),g=this.get("value");this.set("status",e.WAITING),this._callbacks.push(b);var i=c.length;if(0===i)g=f.call(g)||g,this.set("value",g),this.set("status",e.LOADED),a.each(this._callbacks,function(a){a(g)});else{var j=[],k=this;a.each(c,function(b,c){d&&(b=d(b,c)),h.loadModule(b,function(b){j[c]=b,i--,0===i&&(g=f.apply(g,j)||g,k.set("value",g),k.set("status",e.LOADED),a.each(k._callbacks,function(a){a(g)}))},k)})}},__waiting:function(a){var b=this;setTimeout(function(){0===h.counter&&b.set("status",e.LOADING),b.load(a)})},__loaded:function(a){a(this.get("value"))},load:function(b){var c=this.get("status"),d=b||a.idle;switch(c){case e.PENDING:this.__pending(d);break;case e.LOADING:this.__loading(d);break;case e.WAITING:this.__waiting(d);break;case e.LOADED:this.__loaded(d)}return this}}});a.define=function(){var b=arguments,c=b.length,d=b[0],e=[],f=null;switch(c){case 1:a.is(d,"function")?f=d:a.is(d,"array")?(e=d,f=function(){var b={};return a.each(arguments,function(c){c._name_?b[c._name_]=c:a.extend(b,c)}),b}):f=function(){return d};break;case 2:e=d,f=b[1];break;case 3:e=d,f=b[1]}return e&&a.is(e,"string")&&(e=[e]),h.current=new h("",e,f),b[2]&&(h.current._depHandler=b[2]),h.current};var i=a.Class("zn.Loader",{"static":!0,properties:{preLoadPackages:[]},methods:{init:function(){for(var a=this.preLoadPackages,b=0,c=a.length;c>b;b++)this.loadPackage(a[b])},loadPackage:function(b){this.load(b+"index.js",function(b){a.extend(h.preLoadedPackage,b)})},load:function(a,b,c){return h.loadModule(a,b,c),this}}});a.load=i.load,a.module=h}(zn),function(a){var b=Array.prototype.slice,c={PENDING:0,CANCLE:1,PAUSE:2,FINISHED:3},d=a.Class({events:["init","finished"],properties:{status:{value:c.PENDING,get:function(){return this._status}}},methods:{init:function(){},doTask:function(a,b){if(a){var c=b||[];c.unshift(this),a.handler.apply(a.context,c)}},done:function(){this._status=c.FINISHED,this._data=b.call(arguments),this.fire("finished",this._data),this.off("finished")}}}),e=a.Class({events:["clear","push","pause","resume","exception","every","finally"],properties:{count:{get:function(){return this._tasks.length}}},methods:{init:function(a){this._exceptions=[],this._finallys=[],this._everys=[],this._tasks=[],this._taskProcessor=[],this._lastTask=null,this._data=[],this._max=(a||{}).max||1},destroy:function(){this._everys=[],this._tasks=[],this._taskProcessor=[],this.fire("finally",this._data,{method:"apply"}),this.super()},clear:function(){this._tasks=[]},pause:function(a){return this._paused=!0,a>0&&(this._pauseTimer=setTimeout(function(){this.resume()}.bind(this),a)),this.fire("pause"),this},resume:function(){return this._pauseTimer&&clearTimeout(this._pauseTimer),this._paused=!1,this.fire("resume"),this.doTask(),this},exception:function(a,b){return this.on("exception",a,b||this),this},"catch":function(a){return this.fire("exception",a),this},"finally":function(a,b){return this.on("finally",a,b||this),this},every:function(a,b){return this.on("every",a,b||this),this},push:function(a,b){var c={handler:a,context:b||this};return this._lastTask&&(c.previous=c,this._lastTask.next=c),this._lastTask=c,this._tasks.push(c),this.fire("push",c),this},getTaskProcessor:function(){for(var a=null,b=this._taskProcessor.length,e=0;b>e;e++)if(a=this._taskProcessor[e],a.status==c.FINISHED)return a;if(!a&&this._max>b){var f=new d;return f.queue=this,f.on("finished",this.__onProcessorFinished.bind(this),this),f}},start:function(){return this._data=[],this.doTask()},doTask:function(a){var b=this._tasks.shift();if(b){var c=this.getTaskProcessor();c&&(b.previousResult=a,c.doTask(b,a))}else this.destroy();return this},__onProcessorFinished:function(a,b){this._data.push(b),this.fire("every",b,{method:"apply"}),this.doTask(b)}}});a.queue=function(a){return new e(a)}}(zn),function(a){var b={ISO8601:"yyyy-MM-dd hh:mm:ss.SSS",ISO8601_WITH_TZ_OFFSET:"yyyy-MM-ddThh:mm:ssO",DATETIME:"dd MM yyyy hh:mm:ss.SSS",ABSOLUTETIME:"hh:mm:ss.SSS"},c=a.Class("zn.util.DateUtil",{"static":!0,properties:{},methods:{init:function(){},asString:function(a){var c=b.ISO8601;"string"==typeof a&&(c=arguments[0],a=arguments[1]);var d=this.__addZero(a.getDate()),e=this.__addZero(a.getMonth()+1),f=this.__addZero(a.getFullYear()),g=this.__addZero(a.getFullYear().toString().substring(2,4)),h=c.indexOf("yyyy")>-1?f:g,i=this.__addZero(a.getHours()),j=this.__addZero(a.getMinutes()),k=this.__addZero(a.getSeconds()),l=this.__padWithZeros(a.getMilliseconds(),3),m=this.__offset(a),n=c.replace(/dd/g,d).replace(/MM/g,e).replace(/y{1,4}/g,h).replace(/hh/g,i).replace(/mm/g,j).replace(/ss/g,k).replace(/SSS/g,l).replace(/O/g,m);return n},__padWithZeros:function(a,b){for(var c=a+"";c.length<b;)c="0"+c;return c},__addZero:function(a){return this.__padWithZeros(a,2)},__offset:function(a){var b=Math.abs(a.getTimezoneOffset()),c=String(Math.floor(b/60)),d=String(b%60);return 1==c.length&&(c="0"+c),1==d.length&&(d="0"+d),a.getTimezoneOffset()<0?"+"+c+d:"-"+c+d}}}),d=["INFO","DEBUG","WARNING","ERROR","TRACE","","INIT"],e=["#100000","#2125a0","#a82c2c","#c045b7","1cb131","","#100000"],f=[38,34,35,31,32,36,33],g={INFO:0,DEBUG:1,WARNING:2,ERROR:3,TRACE:4,INIT:6},h=a.Class({"static":!0,properties:{},methods:{init:function(){},info:function(a){this.__log(g.INFO,a)},debug:function(a){this.__log(g.DEBUG,a)},warn:function(a){this.__log(g.WARNING,a)},trace:function(a){this.__log(g.TRACE,a)},error:function(a){this.__log(g.ERROR,a)},__getDateString:function(a){return c.asString(a||new Date)},__getPosition:function(){try{throw new Error}catch(a){var b=a.stack.split("\n")[4].replace(/\(/g,"").replace(/\)/g,"").split("/").pop();return b}},__formatLog4Server:function(a,b){var c="",e="",g="";return b&&(e="[",g="",c=f[5]+"m",b=f[a.type]+"m"),[a.time," [",e,b,d[a.type],g,"] ",a.message].join("")},__formatLog4Client:function(a){return["%c"+a.time," [",d[a.type],"] ",a.message].join("")},__log:function(a,b){var c={type:a,message:"object"==typeof b?JSON.stringify(b):b,time:this.__getDateString(),pos:this.__getPosition()};"undefined"!=typeof module&&module.exports?console.log(this.__formatLog4Server(c,!0)):console.log(this.__formatLog4Client(c,!0),"color:"+e[a])}}}),i={info:function(){h.info.apply(h,arguments)},debug:function(){h.debug.apply(h,arguments)},warn:function(){h.warn.apply(h,arguments)},trace:function(){h.trace.apply(h,arguments)},error:function(){h.error.apply(h,arguments)}};a.extend(a,i)}(zn),function(a){var b=Array.prototype.slice,c={PENDING:0,FULFILLED:1,REJECTED:2},d=a.Class({"static":!0,methods:{init:function(){this._exceptions=[],this._finallys=[],this._count=0,this._currIndex=0,this._dataArray=[]},exception:function(a){return this._exceptions.push(a),this},"catch":function(b,c){return a.each(this._exceptions,function(a){a.call(c,b)}),this},"finally":function(a){return this._finallys.push(a),this},defer:function(b,c){var d=this,f=new e(b,c);return f.on("complete",function(b,c){d._currIndex++,d._dataArray.push(c),d._currIndex==d._count&&(a.each(d._finallys,function(b){try{b(d._dataArray)}catch(c){a.error(c.message)}}),d._finallys=[])}),d._count++,f},all:function(b){var c=d.defer(),e=0,f=[];return a.each(b,function(a){a.then(function(a){f.push(a),e++,e>=b.length&&c.resolve(f)})}),c.promise},any:function(b){var c=d.defer();return a.each(b,function(a){a.then(function(a){c.resolve(a)})}),c.promise}}}),e=a.Class({events:["complete"],properties:{promise:null},methods:{init:function(a,b){this._promise=new f,a&&this.resolve(a),b&&this.reject(b)},resolve:function(){var e=b.call(arguments);try{var f=this.get("promise"),g=this;if(f.get("readyState")!=c.PENDING)return;f.set("readyState",c.FULFILLED),f.set("data",e),a.each(f.get("resolves"),function(a){a.apply(g,e)})}catch(h){d.catch(h,this)}this.fire("complete",e)},reject:function(){var a=b.call(arguments);try{var e=this.get("promise");if(e.get("readyState")!=c.PENDING)return;e.set("readyState",c.REJECTED),e.set("reason",a);var f=e.get("rejects")[0];f&&f.apply(this,a)}catch(g){d.catch(g,this)}this.fire("complete",a)}}}),f=a.Class({statics:{isPromise:function(a){return null!==a&&void 0!==a&&"function"==typeof a.then},defer:null},properties:{resolves:null,rejects:null,data:null,reason:null,readyState:null},methods:{init:function(){this.set("resolves",[]),this.set("rejects",[]),this.set("exceptions",[]),this.set("readyState",c.PENDING)},then:function(a,d){function g(){var c=b.call(arguments),d=a?a.apply(this,c):c;return f.isPromise(d)?d.then(function(){h.resolve.apply(h,b.call(arguments))}):h.resolve.apply(h,d),d}var h=new e;if(this.get("readyState")===c.PENDING)this.get("resolves").push(g),this.get("rejects").push(d?d:function(){h.reject.apply(h,b.call(arguments))});else if(this.get("readyState")===c.FULFILLED){var i=this;setTimeout(function(){g.apply(i,i.get("data"))})}return h.promise},"catch":function(a){return d.exception(a)},"finally":function(a){return d.finally(a)},otherwise:function(a){return this.then(void 0,a)}}});a.async=d}(zn),function(a){var b=(a.Class({events:["init","start","stop","cancle","goNext","goPre"],properties:{pre:null,next:null,delay:null,action:null,args:[],context:this,taskList:null,status:{value:"",get:function(){return this._status}}},methods:{init:function(a){this.sets(a),this.fire("init",this)},start:function(){"started"!=this._status&&(this._action?(this._action.apply(this._context,this._args),this._status="started"):this.goNext(),this.fire("start",this))},stop:function(){this._status="stoped",this.fire("stop",this)},cancle:function(){this._status="cancle",this.fire("cancle",this)},goNext:function(){this._next&&this._next.start(),this.fire("goNext",this)},goPre:function(){this._pre&&this._pre.start(),this.fire("goPre",this)}}}),a.Class({properties:{url:"",data:{set:function(a){this._data=a},get:function(){return a.is(this._data,"object")?JSON.stringify(this._data):this._data}},method:"GET",asyns:!0,username:null,password:null,headers:{get:function(){return a.overwrite({"X-Requested-With":"XMLHttpRequest","Content-type":"application/json"},this._headers)},set:function(a){this._headers=a}},timeout:{get:function(){return this._timeout||2e4},set:function(a){this._timeout=a}}},events:["before","after","success","error","complete","timeout"],methods:{init:function(a){this.sets(a),this._isRunning=!1},__initXMLHttpRequest:function(){if(this._XMLHttpRequest)return this._XMLHttpRequest;if(!window.ActiveXObject)return this._XMLHttpRequest=new XMLHttpRequest,this._XMLHttpRequest;for(var a="MSXML2.XMLHTTP",b=["Microsoft.XMLHTTP",a,a+".3.0",a+".4.0",a+".5.0",a+".6.0"],c=b.length,d=c-1;d>-1;d--)try{return this._XMLHttpRequest=new ActiveXObject(b[d]),this._XMLHttpRequest}catch(e){continue}},__onComplete:function(a){clearTimeout(this._timeoutID),this._isRunning=!1,this.resetEvents(),this.fire("complete",a)},__initRequestHeader:function(a,b){for(var c in b)a.setRequestHeader(c,b[c])},resetEvents:function(){this.off("before"),this.off("after"),this.off("success"),this.off("error"),this.off("complete"),this.off("timeout")},send:function(b){if(this._isRunning)return!1;this.sets(b);var c=this.__initXMLHttpRequest(),d=this,e=a.async.defer();if(this._isRunning=!0,this.timeout&&(this._timeoutID=setTimeout(function(){d._isRunning&&(c.abort(),d.fire("timeout",d),d.__onComplete("timeout"))},this.timeout)),this.fire("before",this)!==!1&&this.url){var f=this.url,g=this.data,h=this._method.toUpperCase();"GET"===h&&(g&&(f=f+"?"+g),g=null),c.readyState<2&&(c.withCredentials=!0),c.open(h,f,this.asyns),c.onreadystatechange=function(a){var b=a.currentTarget;if(4==b.readyState){var c=b.status,d=b.responseText,f=b.getResponseHeader("Content-Type");if(c>=400&&500>c)return e.reject(b),void this.fire("error","Client Error Code: "+c);if(c>=500)return e.reject(b),void this.fire("error","Server Error code: "+c);if(c>=200&&300>c){try{d=f&&f.indexOf("application/json")>=0?JSON.parse(d):d}catch(g){d=d}b.abort(),e.resolve(d,b),this.fire("success",d)}else b.abort(),e.reject(b),this.fire("error",b);return this.__onComplete(b),d}}.bind(this),this.__initRequestHeader(c,this.headers),c.send(g),this.asyns||this.__onComplete(c)}else this.__onComplete(c);return e.promise},abort:function(){this._XMLHttpRequest&&this._XMLHttpRequest.abort()}}})),c=a.Class({"static":!0,properties:{max:3,count:{get:function(){return this._data.length}}},methods:{init:function(){this._data=[]},getInstance:function(){for(var a=0,c=this._data.length;c>a;a++)if(!this._data[a]._isRunning)return this._data[a].resetEvents(),this._data[a];return function(a){var c=new b;return a._data.push(c),c}(this)}}}),d=a.Class({properties:{timeout:1e3},methods:{init:function(a){this.sets(a)},request:function(b,d){var e=c.getInstance();return a.each(b,function(a,b){"function"==typeof a&&e.on(b,a,this)},this),d&&d(e),e.send(b)},get:function(a){return a.method="GET",this.request(a)},post:function(a){return a.method="POST",this.request(a)},put:function(a){return a.method="PUT",this.request(a)},"delete":function(a){return a.method="DELETE",this.request(a)}}}),e=new d;a.extend(a,{$get:e.get.bind(e),$post:e.post.bind(e),$put:e.put.bind(e),$delete:e.delete.bind(e)})}(zn),function(a){var b=a.Class({events:["init"],properties:{url:null,data:null,method:"POST",headers:null,onExec:null,success:null,error:null,timeout:null},methods:{init:function(a,b,c,d){this.sets({url:a,data:b,method:c,headers:d}),this.fire("init",this)},exec:function(b,c,d,e){var f=b||this._url,g=c||this._data||{},h=d||this._method,i=e||this._headers||{},j=this._onExec&&this._onExec(this);
return j===!1?!1:a.GLOBAL.Store.fire("before")===!1?!1:a["$"+h.toLowerCase()]({url:Store.fixURL(f),data:g,success:this._success,error:this._error,timeout:this._timeout,headers:i})},refresh:function(){this.exec()},copyAndExt:function(a){var c=this._data;if("object"==typeof c){c=JSON.parse(JSON.stringify(c));for(var d in a)c[d]=a[d]}else c=a;return new b(this._url,c,this._method)},ext:function(){var a=this._data;for(var b in data)a[b]=data[b];return this}}}),c=a.Class({events:["init"],properties:{url:null,data:null,method:"POST",headers:null,onExec:null,success:null,error:null},methods:{init:function(a,b,c,d){this.sets({url:a,data:b,method:c,headers:d}),this.fire("init",this)},exec:function(b,c,d,e){var f=this,g=b||this._url,h=c||this._data||{},i=d||this._method,j=e||this._headers||{},k=this._onExec&&this._onExec(this);if(k===!1)return!1;switch(i.toUpperCase()){case"POST":var l=new FormData;for(var m in h)l.append(m,h[m]);h=l,j=a.overwrite(j,{Accept:"multipart/form-data","Content-Type":"multipart/form-data; charset=UTF-8"});break;case"GET":break;case"JSON":h=JSON.stringify(h),i="POST",j=a.overwrite(j,{Accept:"multipart/form-data","Content-Type":"multipart/form-data; charset=UTF-8"})}return new Promise(function(a,b){fetch(g,{method:i.toUpperCase(),body:h,headers:j}).then(function(a){return a.json()}).then(function(b){f._success&&f._success(b),a(b)}).catch(function(a){f._error&&f._error(a),b(a)})})},refresh:function(){this.exec()},copyAndExt:function(a){var b=this._data;if("object"==typeof b){b=JSON.parse(JSON.stringify(b));for(var d in a)b[d]=a[d]}else b=a;return new c(this._url,b,this._method)},ext:function(){var a=this._data;for(var b in data)a[b]=data[b];return this}}}),d=a.Class({events:["init","exec"],properties:{data:null,argv:{set:function(a){this._argv=a},get:function(){return this._argv||{}}}},methods:{init:function(a,b){this.reset(a,b),this.fire("init",this)},reset:function(a,b){this.sets({data:a,argv:b})},refresh:function(){this.exec()},exec:function(){var a=this._data;if(a){var b=this._argv.onSubmitBefore&&this._argv.onSubmitBefore(a,this._argv);if(b!==!1)if(void 0!==b&&(a=b),a.__id__)a._onExec||(a._onExec=this._argv.onExec),a._success=function(a,b){var c=Store._success&&Store._success(b);c!==!1&&this._argv.onSuccess&&this._argv.onSuccess(b)}.bind(this),a._error=function(a,b){var c=Store._error&&Store._error(b);c!==!1&&this._argv.onError&&this._argv.onError(b)}.bind(this),a.exec();else{if((this._argv.onExec&&this._argv.onExec(a))===!1)return!1;this._argv.onSuccess&&this._argv.onSuccess(data)}}}}});a.GLOBAL.Store=new a.Class({events:["before","after","success","error"],properties:{HOST:"http://0.0.0.0:8080/"},methods:{requestHandler:function(a,b){this._success=a,this._error=b},request:function(a,c,d,e){return new b(a,c,d,e)},post:function(a,c,d){return new b(a,c,"POST",d)},"delete":function(a,c,d){return new b(a,c,"DELETE",d)},put:function(a,c,d){return new b(a,c,"PUT",d)},get:function(a,c,d){return new b(this.formatURL(a,c),c,"GET",d)},fetch:function(a,b,d,e){return new c(a,b,d,e)},fetchPost:function(a,b,d){return new c(a,b,"POST",d)},fetchGet:function(a,b,d){return new c(this.formatURL(a,b),b,"GET",d)},setHost:function(a){this._HOST=a},getHost:function(){return this._HOST},fixURL:function(a){return a?(a&&-1===a.indexOf("http://")&&(a=this._HOST+a),a):""},formatURL:function(a,b){for(var c in b)a=a.replace(new RegExp("{"+c+"}","gi"),b[c]||"");return a},dataSource:function(a,b){return new d(a,b)}}})}(zn),function(a){var b=Array.prototype,c=b.push,d=b.sort,e=b.join,f=b.slice,g=b.splice,h=b.indexOf,i=b.lastIndexOf,j=b.forEach,k=function(b){if(a.is(b,l))return b.toArray();if(a.is(b,"array"))return b.slice(0);var c=[];return a.each(b,function(a){c.push(a)}),c},l=a.Class("zn.data.List",{properties:{count:{get:function(){return this.length},set:function(){throw new Error("Unable to set count of List")}}},methods:{init:{auto:!0,value:function(a){this.length=0,this.insertRange(a,0)}},unique:function(){},dispose:function(){this.clear()},add:function(a){var b=this.length;return c.call(this,a),b},addRange:function(a){return this.insertRange(a,this.length)},remove:function(a){var b=this.indexOf(a);return b>=0?(g.call(this,b,1),b):-1},removeAt:function(a){return g.call(this,a,1)[0]},insert:function(a,b){return g.call(this,b,0,a),a},insertRange:function(a,b){return g.apply(this,[b,0].concat(k(a))),b},clear:function(){return g.call(this,0)},getItem:function(a){if(a<this.length)return this[a];throw new Error("Index out of range.")},setItem:function(a,b){if(!(a<this.length))throw new Error("Index out of range.");this[a]=b},getRange:function(a,b){return new l(f.call(this,a,a+b))},indexOf:function(a){return h.call(this,a)},lastIndexOf:function(a){return i.call(this,a)},contains:function(a){return this.indexOf(a)>=0},toggle:function(a){this.contains(a)?this.remove(a):this.add(a)},sort:function(a){return d.call(this,a)},each:function(a,b){j.call(this,a,b)},toArray:function(){return f.call(this,0)},join:function(){return e.call(this)}}})}(zn),function(a){a.Class("zn.data.TList",{statics:{getInstance:function(a){return new this(a)}},properties:{min:0,max:100,TClass:null,TClassArgv:{}},methods:{init:function(a){this.sets(a),this.reset()},reset:function(){this._data=[];for(var a=0;a<(this.min||0);a++)this.push(this.TClassArgv)},push:function(a){if(this.TClass){var b=new this.TClass(a||this.TClassArgv);return this._data.push(b),b}},findOneT:function(b){var c=null,d=b||a.idle;return a.each(this._data,function(a,b){return d(a,b)?(c=a,-1):void 0}),c},findAllT:function(b){var c=[],d=b||a.idle;return a.each(this._data,function(a,b){d(a,b)&&c.push(a)}),c}}})}(zn),function(a){a.Class("zn.data.Task",{statics:{getInstance:function(a){return new this(a)},PANDING:0,WAITING:1,DOING:2,DONE:3},properties:{statue:0},methods:{init:function(a){this.sets(a)}}})}(zn),function(a){var b=a.Class("zn.data.Observable",{properties:{},methods:{init:{auto:!0,value:function(){this.__watchers__={}}},dispose:function(){a.each(this.__watchers__,function(a,b){this.__unbind(b,this.get(b))},this),this.__watchers__=null},watch:function(b,c,d){var e="*"===b?this.constructor._properties_:a.is(b,"array")?b:[b];return e.forEach(function(a){this.__watch(a,c,d)},this),this},unwatch:function(b,c,d){var e="*"===b?this.constructor._properties_:a.is(b,"array")?b:[b];return e.forEach(function(a){this.__unwatch(a,c,d)},this),this},notify:function(b){var c="*"===b?Object.keys(this.__watchers__):a.is(b,"array")?b:[b];return a.each(c,function(a){this.__notify(a)},this),this},__watch:function(a,c,d){var e=a.indexOf("."),f=a,g="",h=this.__watchers__;if(e>=0){f=a.slice(0,e),g=a.slice(e+1);var i=this.get(f);i&&i.watch&&i.watch(g,c,d)}var j=h[f]=h[f]||[];j.push({handler:c,context:d,fullPath:a,subPath:g});var k=this.member(f);if(k&&"property"===k.type){var l=k.meta;if(!l.watched){var m=k.getter,n=k.setter;b.defineProperty(f,{get:function(a){return m.call(this,a)},set:function(a,b){var c=m.call(this);(c!==a||b&&b.force)&&(this.__unbind(f,c),n.call(this,a,b)!==!1&&(this.__bind(f,a),this.notify(f)))},watched:!0},this)}}},__unwatch:function(a,b,c){var d=a.indexOf("."),e=a,f="",g=this.__watchers__;if(d>=0){e=a.slice(0,d),f=a.slice(d+1);var h=this.get(e);h&&h.unwatch&&h.unwatch(f,b,c)}var i,j=g[e];if(!j)return!1;if(b){for(var k=0,l=j.length;l>k;k++)if(i=j[k],i.handler===b&&i.context===c){j.splice(k,1);break}}else j.length=0},__bind:function(b,c){c&&c.watch&&a.each(this.__watchers__[b],function(a){a.subPath&&c.watch(a.subPath,a.handler,a.context)})},__unbind:function(b,c){c&&c.unwatch&&a.each(this.__watchers__[b],function(a){a.subPath&&c.unwatch(a.subPath,a.handler,a.context)})},__notify:function(b){var c=this.get(b);a.each(this.__watchers__[b],function(b){b&&b.handler&&b.handler.call(b.context,a.path(c,b.subPath),b.fullPath,this)},this)}}})}(zn),function(a){var b=a.Class({properties:{direction:{value:"oneway",readonly:!0},target:{value:null,readonly:!0},targetPath:{value:"",readonly:!0},source:{get:function(a){return a?this._owner:this._source},set:function(a){this._source=a,this.__rebind()}},sourcePaths:{get:function(){return this._sourcePaths},set:function(a){this._sourcePaths=this.__parseSourcePaths(a,function(a){a&&this.__rebind()}.bind(this))}},owner:{get:function(){return this._owner}},converter:{value:null},async:{value:!1}},methods:{init:function(b,c,d){{var e=d||{},f=b.member(c);f&&f.meta.binding||{}}a.overwrite(e,{direction:"oneway",converter:{}});var g=this._direction=e.direction;this._source=e.source,this._sourcePaths=this.__parseSourcePaths(e.sourcePaths),this._owner=e.owner||b,this._converter=this.__parseConverter(e),this._target=b,this._targetPath=c,("twoway"===g||"oneway"===g)&&this.__rebind(),("twoway"===g||"inverse"===g)&&b.watch(c,function(a){this.__updateSource(a)},this)},dispose:function(){this._source=null,this.__rebind()},__updateSource:function(b){var c=this._converter,d=null;return a.each(this.sourcePaths,function(e){d=c.revert.call(c.context,b),a.path(this.get("source",e[0]),e[1],d)},this),this},__updateTarget:function(){var b=this,c=[],d=null,e=this._owner,f=this._target,g=null,h=this._targetPath,i=this._converter;return a.each(this.sourcePaths,function(f){d=a.path(b.get("source",f[0]),f[1]),d=a.is(d,"function")?d.bind(e):d,c.push(d)}),g=i.convert.apply(i.context,c),f.set(h,g),this},__rebind:function(){var b=this._sourcePaths,c=this._watchers;return c&&(a.each(c,function(a){a.source.unwatch(a.path,a.handler)}),this._watchers=null),a.each(b,function(b){var d=b[0],e=b[1],f=this.get("source",d);a.can(f,"watch")&&(f.watch(e,this.__updateTarget.bind(this)),c=c||[],c.push({source:f,path:e,handler:this.__updateTarget}))},this),this.__updateTarget()},__parseSourcePaths:function(a,b){for(var c=a.split(","),d="",e=!1,f=0,g=c.length;g>f;f++)d=c[f].trim(),"#"===d.charAt(0)&&(d=d.substring(1),e=!0),c[f]=[e,d],b&&b(e,d);return c},__parseConverter:function(b){var c=b.converter;(a.is(c,"string")||a.is(c,"function"))&&(c={convert:c});var d=c.convert=b.convert||c.convert||function(a){return a};if(c.revert=b.revert||function(a){return a},c.context=b.context||this.owner,a.is(d,"string")){var e=d.lastIndexOf("."),f=d,g=this.source||this.owner,h="";e>0&&(h=d.slice(0,e),f=d.slice(e+1),g=a.path(this.source,h)),d=g&&g[f]}return c.convert=d,c}}}),c=a.Class("zn.data.Bindable",a.data.Observable,{statics:{parseOptions:function(b,c){var d=null;if("string"==typeof b&&"{"===b.charAt(0)&&"}"===b.charAt(b.length-1)){var e=b.slice(1,-1),f=e.split(";");d={owner:c,sourcePaths:f.shift()},a.each(f,function(a){if(!a)return-1;var b=a.split("=");d[b[0]]=b[1]})}else"object"==typeof b&&(d=b);return d}},properties:{model:{get:function(){return this._model},set:function(b){this._model=b,a.each(this.__bindings__,function(a){a.set("source",b)})}}},methods:{init:{auto:!0,value:function(){this.__bindings__={}},after:function(){this.__binding()}},dispose:function(){this.super(),a.each(this.__bindings__,function(a){a.dispose()}),this.__bindings__=null},let:function(a,b,d,e){var f=c.parseOptions(b);f?(f.owner=d,this.setBinding(a,f,e)):this.set(a,b)},getBinding:function(a){return this.__bindings__[a]},setBinding:function(a,c,d){return c.source=c.model||this.get("model"),c.owner=c.owner||this,this.clearBinding(a),this.__bindings__[a]=new b(d||this,c.targetPath||a,c),this},clearBinding:function(a){var b=this.__bindings__[a];b&&(b.dispose(),delete this.__bindings__[a])},__binding:function(){var b=this,c=this.constructor.getMeta("properties");a.each(c,function(a,c){a&&a.binding&&b.let(c,a.binding)})}}})}(zn),function(a){a.Class("zn.data.Map",{properties:{count:{get:function(){var a=0;return this.each(function(){a++}),a}},keys:{get:function(){return Object.keys(this._map)},set:function(){throw new Error("Unable to set keys of Map")}},values:{get:function(){return this.__getMapValues()},set:function(){throw new Error("Unable to set values of Map")}}},methods:{init:{auto:!0,value:function(a){this._map={},this.concat(a)}},concat:function(b){if(b){var c=(this._map,this);a.each(b,function(a,b){c.set(b,a)})}return this},contains:function(a){return a in this._map},getItem:function(a){return this._map[a]},get:function(a){if(this.has(a))return this.super(a);var b=this.getItem(a);return b&&b.value},set:function(a,b){if(this.has(a))return this.super(a);var c=a,d=this._map[c];return d||(d=this._map[c]={key:c}),d.value=b,this},remove:function(a){return delete this._map[a],this},clear:function(){return this._map={},this},each:function(b,c){return a.each(this._map,b,c),this},eachKey:function(b,c){return a.each(this.keys,b,c),this},eachValue:function(b,c){return a.each(this.values,b,c),this},toArray:function(){var a=[];return this.each(function(b){a.push(b)}),a},toObject:function(){var a={};return this.each(function(b){a[b.key]=b.value}),a},__getMapValues:function(){var a=[];return this.each(function(b){a.push(b.value)}),a}}})}(zn),function(a){a.Class("zn.data.ObservableList",a.data.List,{mixins:[a.data.Observable],events:["change"],methods:{add:function(a){var b=this.super(a);return this.notify("count"),this.fire("change",{action:"add",items:[a],index:b}),b},addRange:function(a){var b=this.super(a);return this.notify("count"),this.fire("change",{action:"add",items:a,index:b}),b},insert:function(a,b){return this.super(a,b),this.notify("count"),this.fire("change",{action:"add",items:[a],index:b}),b},insertRange:function(a,b){return this.super(a,b),this.notify("count"),this.fire("change",{action:"add",items:a,index:b}),b},remove:function(a){var b=this.super(a);return b>=0&&(this.notify("count"),this.fire("change",{action:"remove",items:[a],index:b})),index},removeAt:function(a){var b=this.super(a);return void 0!==b&&(this.notify("count"),this.fire("change",{action:"remove",items:[b],index:a})),b},clear:function(){var a=this.super();return this.notify("count"),this.fire("change",{action:"clear",items:a}),a},sort:function(a){var b=this.super(a);return this.notify("count"),this.fire("change",{action:"sort",sort:a||function(a,b){return a>b?1:b>a?-1:0}}),b}}})}(zn),function(a){a.Class("zn.data.ObservableMap",a.data.Map,{mixins:[a.data.Observable],events:["change"],methods:{set:function(a,b){if(this.has(a))return this.super(a);var c=this._map,d={key:a,value:b};if(a in c){var e=c[a];c[a]=d,this.fire("change",{action:"replace",oldItem:e,newItem:d})}else c[a]=d,this.notify("count"),this.fire("change",{action:"add",items:[d]})},remove:function(a){var b=this._map;if(a in b){var c=b[a];delete b[a],this.notify("count"),this.fire("change",{action:"remove",items:[c]})}},clear:function(){this.toArray();return this.super(),this.notify("count"),this.fire("change",{action:"clear",items:this.toArray()}),this}}})}(zn);

@@ -6,3 +6,7 @@ {

"src/core/fix.js",
"src/core/class.js"
"src/core/class.js",
"src/util/Queue.js",
"src/util/Async.js",
"src/util/Http.js",
"src/util/Store.js"
],

@@ -18,3 +22,4 @@ "core": [

"src/util/Async.js",
"src/util/Http.js"
"src/util/Http.js",
"src/util/Store.js"
],

@@ -21,0 +26,0 @@ "data": [

{
"name": "zeanium",
"version": "1.0.6",
"version": "1.0.8",
"description": "Javascript framework for Node.js and Browser. Simple MVVM model in data and view module.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -1,3 +0,86 @@

Zeanium
Zeanium代码规范
===============================
Javascript framework for Node.js and Browser. Simple MVVM model in data and view module.
# 组织结构目录
1. 框架(Framework)
For example(zeanium):
>
|--zeanium
|--lib(Automatic generation)
|--js
|--css
|--src
|--fonts
|--js
|--less
|--test
|--unittest
|--autotest
|--tutorial
|--.gitignore
|--files.json
|--Gruntfile.js
|--README.md
2. 项目(Project)
For example(zn-cms):
>
|--zn-cms
|--dest(Automatic generation)
|--css
|--js
|--libs
|--resource
|--src
|--js
|--less
|--libs
|--resource
|--index.html
|--index_mockup.html
|--index_debug.html
|--.gitignore
|--files.json
|--Gruntfile.js
|--README.md
# 文件名
1. 类文件:只定义一个类的文件必须必须与类名一致,每个单词首字母大写。如:`MyClass.js`
2. 配置文件:
1). 专门用于配置App的可配置信息,文件名全小写。如:`config.js`
2). 如只是静态数据信息,最好直接配置成原生Json或者Array对象,为了提升性能,
减少创建Class性能和消耗,除非有对某个属性有明确的get, set区别, 可以使用静态类。
3. 数据文件:App中提供的静态数据源,文件名全小写。如:`data.json`
# 语法
1. 所有语句单独一行,每一行单独语句结尾必须带分号。
2. if/while/for等表达式必须带花括号并且换行。
3. 定义类必须放在函数闭包里面。
4. 尽量只写一重三元表达式。
# 变量
1. 闭包变量:闭包变量采用驼峰式命名。如:`var myValue`
2. 方法参数:方法参数采用驼峰式命名。如:`function (inParameter, inArgs)`
3. 局部变量:方法内的局部变量采用下划线加驼峰式命名。如:`var _myVar`
# 方法
1. 公有方法:公有方法采用驼峰式命名。如:`myPublicMethod: function()`
2. 私有方法:私有方法采用双下划线加驼峰式命名。如:`__myPrivateMethod: function()`
# 类
1. 类元数据的顺序:mixins->static->statics自定义元数据->events->view->properties->methods
2. 框架内的属性访问器统一使用get/set
3. 属性元数据的顺序:value->get->set->自定义元数据
# 建议
1. 对于功能复杂的模块,尽量进行拆分成单元性函数,如果重复共用,可以把相关模块封装成全局通用模块。
2. 代码尽量简单明了,如果是为解决某个复杂逻辑是程序复杂度变高,希望在对应模块写清楚注释。

@@ -40,2 +40,7 @@ /**

},
serializeJSON: function (data){
return Object.keys(data).map(function (key) {
return encodeURIComponent(key) + '=' + encodeURIComponent(data[key]);
}).join('&');
},
fix: function (target){

@@ -42,0 +47,0 @@ var _target = target||{};

@@ -581,3 +581,3 @@ /**

if (false === _result) {
return this;
return false;
}

@@ -584,0 +584,0 @@ }

/**
* Global Var
*/
var __isServer = Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]';
var zn = {

@@ -9,18 +11,19 @@ VERSION: '0.0.1',

PATH: '',
GLOBAL: (function () { return this; }).call(null)
isServer: __isServer,
GLOBAL: (function () {
if(__isServer){
return global;
}else {
return window;
}
}).call(null)
};
if(zn.GLOBAL){
zn.GLOBAL.zn = zn;
}
zn.GLOBAL.zn = zn;
if (typeof module !== 'undefined' && module.exports) {
module.exports = zn;
if (__isServer) {
zn.ZN_PATH = __dirname;
zn.PATH = process.cwd();
module.exports = zn;
}else{
if(window){
window.zn = zn;
}
var _zn_url = '';

@@ -27,0 +30,0 @@ try{

@@ -187,2 +187,4 @@ (function (zn) {

_ct = _XHR.getResponseHeader('Content-Type');
//_XHR.abort(); //TODO: This line code has some issue.
if (e >= 400 && e < 500) {

@@ -198,12 +200,15 @@ _defer.reject(_XHR);

}
try {
t = (_ct && _ct.indexOf('application/json')>=0) ? JSON.parse(t) : t;
} catch (error) {
t = t;
}
if (e >= 200 && e < 300) {
try {
t = (_ct && _ct.indexOf('application/json')>=0) ? JSON.parse(t) : t;
} catch (error) {
t = t;
}
_XHR.abort();
_defer.resolve(t, _XHR);
this.fire('success', t);
} else {
_XHR.abort();
_defer.reject(_XHR);

@@ -213,2 +218,3 @@ this.fire('error', _XHR);

this.__onComplete(_XHR);
return t;

@@ -215,0 +221,0 @@ }

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc