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.1.3 to 1.1.4

src/util/Date.js

2

debug.js

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

module.exports = exports = require('./lib/zn.minx.js');

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

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,c){if(a){var d=null;for(var e in a)a.hasOwnProperty(e)&&(d=a[e],(c&&c(d,e,b))!==!1&&this.set(e,d,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},offs:function(){var b=Array.prototype.slice.call(arguments);return b.length?a.each(b,function(a){this.__handlers__[a]&&(this.__handlers__[a]=[{owner:null,handler:null,context:null}])}.bind(this)):this.__handlers__={},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;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)}};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-1;c>-1;c--)try{return this._XMLHttpRequest=new ActiveXObject(b[c]),this._XMLHttpRequest}catch(d){continue}},__onComplete:function(a,b){clearTimeout(this._timeoutID),a.abort(),this._isRunning=!1,this.fire("complete",a,b),this.fire("after",a,b),this.offs()},__initRequestHeader:function(a,b){for(var c in b)a.setRequestHeader(c,b[c])},resetEvents:function(){this.offs()},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&&(d.fire("timeout",d),d.__onComplete(c,"timeout"))},this.timeout)),this.fire("before",this)===!1||!this.url)return this.__onComplete(c),e.promise;var f=this.url,g=this.data,h=this._method.toUpperCase();return"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>=200&&300>c){try{d=f&&f.indexOf("application/json")>=0?JSON.parse(d):d}catch(g){d=d}this.fire("success",d),e.resolve(d,b)}else this.fire("error",b),e.reject(b,d);return this.__onComplete(b,d),d}}.bind(this),this.__initRequestHeader(c,this.headers),c.send(g),this.asyns||this.__onComplete(c),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","validate","before","success","error","complete","after"],properties:{url:null,data:null,method:"POST",headers:null},methods:{init:function(a,b,c,d){this.sets({url:a,data:b,method:c,headers:d}),this.fire("init",this.gets())},validateArgv:function(a,b,c,d){var e=a||this._url||"",f=b||this._data||{},g=c||this._method||"POST",h=d||this._headers||{},i={url:e,data:f,method:g,headers:h};return i},exec:function(a,b,c,d){var e=this.validateArgv(a,b,c,d),f=Store.fire("before",e);return f===!1?!1:(f=this.fire("before",e),f===!1?!1:e)},__onComplete:function(a){var b=Store.fire("after",a);return b===!1?!1:(b=this.fire("complete",a),b===!1?!1:void 0)},__onSuccess:function(a,b){var c=Store.fire("success",a,b);return c===!1?!1:(c=this.fire("success",a,b),c===!1?!1:void 0)},__onError:function(a){var b=Store.fire("success",a);return b===!1?!1:(b=this.fire("success",a),b===!1?!1:void 0)},refresh:function(a,b,c,d){return this.exec(a,b,c,d)},clone:function(b){var c=this._data;return c="object"==typeof c?a.extend(JSON.parse(JSON.stringify(c)),b):b,new this.constructor(this._url,c,this._method,this._headers)},extend:function(b){return this._data=a.extend(this._data,b),this},overwrite:function(b){return this._data=a.overwrite(this._data,b),this}}}),c=a.Class(b,{methods:{init:function(a,b,c,d){this.sets({url:a,data:b,method:c,headers:d}),this.fire("init",this.gets())},exec:function(b,c,d,e){var f=this.validateArgv(b,c,d,e),g=Store.fire("before",f);return g===!1?!1:(g=this.fire("before",f),g===!1?!1:f===!1?!1:a["$"+f.method.toLowerCase()]({url:Store.fixURL(f.url),data:f.data,headers:f.headers,success:function(a,b,c){this.__onSuccess(b,c)}.bind(this),error:function(a,b){this.__onError(b)}.bind(this),complete:function(a,b){this.__onComplete(b)}.bind(this)}))}}}),d=a.Class(b,{methods:{init:function(a,b,c,d){this.sets({url:a,data:b,method:c,headers:d}),this.fire("init",this.gets())},exec:function(b,c,d,e){var f=this.validateArgv(b,c,d,e),g=Store.fire("before",f);if(g===!1)return!1;if(g=this.fire("before",f),g===!1)return!1;if(f===!1)return!1;var h=f.url,i=f.method,j=f.data,k=f.headers,l=this,m={method:i.toUpperCase()};switch(i.toUpperCase()){case"POST":var n=new FormData;for(var o in j)n.append(o,j[o]);m.body=n,m.headers=a.overwrite(k,{Accept:"multipart/form-data","Content-Type":"multipart/form-data; charset=UTF-8"});break;case"GET":var p=[];a.each(j,function(a,b){p.push(b+"="+a)}),h+="?"+p.join("&");break;case"JSON":m.body=JSON.stringify(j),m.method="POST",m.headers=a.overwrite(k,{Accept:"multipart/form-data","Content-Type":"multipart/form-data; charset=UTF-8"})}return new Promise(function(a,b){fetch(Store.fixURL(h),m).then(function(a){return a.json()}).then(function(b){l.__onSuccess(b),l.__onComplete(b),a(b)}).catch(function(a){l.__onError(a),l.__onComplete(a),b(a)})})}}}),e=a.Class({events:["init","before","after"],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){return a&&(this._data=a),b&&(this._argv=b),this._argv&&this._argv.autoLoad&&this.exec(),this},refresh:function(){return this.exec(),this},exec:function(){var a=this._data,b=this;if(!a)return!1;if((this._argv.onExec&&this._argv.onExec(a))===!1)return!1;var c=this.fire("before",a);return c===!1?!1:a.__id__?void a.on("success",function(a,c){b._argv.onSuccess&&b._argv.onSuccess(c)}).on("error",function(a,c){b._argv.onError&&b._argv.onError(c)}).on("complete",function(a,c){b._argv.onComplete&&b._argv.onComplete(c)}).exec():new Promise(function(c,d){if(a){if(Store.fire("success",a)===!1)return!1;b._argv.onSuccess&&b._argv.onSuccess(a),b._argv.onComplete&&b._argv.onComplete(a),c(a)}else{if(Store.fire("error",a)===!1)return!1;b._argv.onError&&b._argv.onError(a),b._argv.onComplete&&b._argv.onComplete(a),d(a)}})}}}),f=a.Class({events:["before","success","error","complete","after"],properties:{host:"http://0.0.0.0:8080/",engine:{set:function(a){this._engine=a},get:function(){return"Fetcher"==this._engine?d:c}},headers:{}},methods:{request:function(a,b,e,f){var g=null;return new(g="Fetcher"==this._engine?d:c)(a,b,e,f)},post:function(a,b,c){return this.request(a,b,"POST",c)},"delete":function(a,b,c){return this.request(a,b,"DELETE",c)},put:function(a,b,c){return this.request(a,b,"PUT",c)},get:function(b,c,d){var e=[];return a.each(c,function(b,c){e.push(c+"="+(a.is(b,"object")?JSON.stringify(b):b))}),this.request(b,e.join("&"),"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):""},dataSource:function(a,b){return new e(a,b)}}});a.GLOBAL.Store=new f}(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],b=b.toString?b.toString():b,c=a[1],d.each(c,function(a,c){null!==a&&void 0!==a&&(a=d.is(a,"object")?JSON.stringify(a):a.toString?a.toString():a,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,c){if(a){var d=null;for(var e in a)a.hasOwnProperty(e)&&(d=a[e],(c&&c(d,e,b))!==!1&&this.set(e,d,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},offs:function(){var b=Array.prototype.slice.call(arguments);return b.length?a.each(b,function(a){this.__handlers__[a]&&(this.__handlers__[a]=[{owner:null,handler:null,context:null}])}.bind(this)):this.__handlers__={},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;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)}};a.Class=c}(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.ZNDate",{methods:{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}}});a.date=new 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-1;c>-1;c--)try{return this._XMLHttpRequest=new ActiveXObject(b[c]),this._XMLHttpRequest}catch(d){continue}},__onComplete:function(a,b){clearTimeout(this._timeoutID),a.abort(),this._isRunning=!1,this.fire("complete",a,b),this.fire("after",a,b),this.offs()},__initRequestHeader:function(a,b){for(var c in b)a.setRequestHeader(c,b[c])},resetEvents:function(){this.offs()},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&&(d.fire("timeout",d),d.__onComplete(c,"timeout"))},this.timeout)),this.fire("before",this)===!1||!this.url)return this.__onComplete(c),e.promise;var f=this.url,g=this.data,h=this._method.toUpperCase();return"GET"===h&&(g&&(f=f+"?"+g),g=null),c.readyState<2,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>=200&&300>c){try{d=f&&f.indexOf("application/json")>=0?JSON.parse(d):d}catch(g){d=d}this.fire("success",d),e.resolve(d,b)}else this.fire("error",b),e.reject(b,d);return this.__onComplete(b,d),d}}.bind(this),this.__initRequestHeader(c,this.headers),c.send(g),this.asyns||this.__onComplete(c),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(){zn.querystring=zn.Class({"static":!0,properties:{config:{get:function(){}}},methods:{init:function(){this._config={separator:"&",equal:"=",minIndex:0,maxIndex:1e3}},config:function(a){return this.overwrite(this._config,a),this},parse:function(a,b){var c=zn.extend({},this._config,b),d={},e=c.equal,f=a.split(c.separator),g=f.length;c.maxIndex>0&&g>c.maxIndex&&(g=c.maxIndex);for(var h=c.minIndex;g>h;h++){var i=f[h].replace(/\+/g,"%20"),j=i.indexOf(e),k=null,l=null;j>=0?(k=i.substr(0,j),l=i.substr(j+1)):(k=i,l=""),k=decodeURIComponent(k),l=decodeURIComponent(l),hasOwnProperty(d,k)?zn.is(d[k],"array")?d[k].push(l):d[k]=[d[k],l]:d[k]=l}return d},stringify:function(a,b){var c=zn.extend({},this._config,b),d=[],e=c.equal,f={};if(f=zn.isZNObject(a)?a.gets():a,!zn.is(f,"object"))throw new Error("Agrument Error.");for(var g in a){var h=a[g],i=encodeURIComponent(this.__stringifyValue(g));h=encodeURIComponent(this.__stringifyValue(h)),d.push(i+e+h)}return d.join(c.separator)},__stringifyValue:function(a){switch(zn.type(a)){case"string":return a;case"boolean":return a?"true":"false";case"object":case"array":return JSON.stringify(a);case"number":return isFinite(a)?a:"";default:return""}}}})}(zn),function(a){var b=a.Class({events:["init","validate","before","success","error","complete","after"],properties:{url:null,data:null,method:"POST",headers:null},methods:{init:function(a,b,c,d){this.sets({url:a,data:b,method:c,headers:d}),this.fire("init",this.gets())},validateArgv:function(a,b,c,d){var e=a||this._url||"",f=b||this._data||{},g=c||this._method||"POST",h=d||this._headers||{},i={url:e,data:f,method:g,headers:h};return i},exec:function(a,b,c,d){var e=this.validateArgv(a,b,c,d),f=Store.fire("before",e);return f===!1?!1:(f=this.fire("before",e),f===!1?!1:e)},__onComplete:function(a){var b=Store.fire("after",a);return b===!1?!1:(b=this.fire("complete",a),b===!1?!1:void 0)},__onSuccess:function(a,b){var c=Store.fire("success",a,b);return c===!1?!1:(c=this.fire("success",a,b),c===!1?!1:void 0)},__onError:function(a){var b=Store.fire("success",a);return b===!1?!1:(b=this.fire("success",a),b===!1?!1:void 0)},refresh:function(a,b,c,d){return this.exec(a,b,c,d)},clone:function(b){var c=this._data;return c="object"==typeof c?a.extend(JSON.parse(JSON.stringify(c)),b):b,new this.constructor(this._url,c,this._method,this._headers)},extend:function(b){return this._data=a.extend(this._data,b),this},overwrite:function(b){return this._data=a.overwrite(this._data,b),this}}}),c=a.Class(b,{methods:{init:function(a,b,c,d){this.sets({url:a,data:b,method:c,headers:d}),this.fire("init",this.gets())},exec:function(b,c,d,e){var f=this.validateArgv(b,c,d,e),g=Store.fire("before",f);return g===!1?!1:(g=this.fire("before",f),g===!1?!1:f===!1?!1:a["$"+f.method.toLowerCase()]({url:Store.fixURL(f.url),data:f.data,headers:f.headers,success:function(a,b,c){this.__onSuccess(b,c)}.bind(this),error:function(a,b){this.__onError(b)}.bind(this),complete:function(a,b){this.__onComplete(b)}.bind(this)}))}}}),d=a.Class(b,{methods:{init:function(a,b,c,d){this.sets({url:a,data:b,method:c,headers:d}),this.fire("init",this.gets())},exec:function(b,c,d,e){var f=this.validateArgv(b,c,d,e),g=Store.fire("before",f);if(g===!1)return!1;if(g=this.fire("before",f),g===!1)return!1;if(f===!1)return!1;var h=f.url,i=f.method,j=f.data,k=f.headers,l=this,m={method:i.toUpperCase()};switch(i.toUpperCase()){case"POST":var n=new FormData;for(var o in j)n.append(o,j[o]);m.body=n,m.headers=a.overwrite(k,{Accept:"multipart/form-data","Content-Type":"multipart/form-data; charset=UTF-8"});break;case"GET":var p=[];a.each(j,function(a,b){p.push(b+"="+a)}),h+="?"+p.join("&");break;case"JSON":m.body=JSON.stringify(j),m.method="POST",m.headers=a.overwrite(k,{Accept:"multipart/form-data","Content-Type":"multipart/form-data; charset=UTF-8"})}return new Promise(function(a,b){fetch(Store.fixURL(h),m).then(function(a){return a.json()}).then(function(b){l.__onSuccess(b),l.__onComplete(b),a(b)}).catch(function(a){l.__onError(a),l.__onComplete(a),b(a)})})}}}),e=a.Class({events:["init","before","after"],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){return a&&(this._data=a),b&&(this._argv=b),this._argv&&this._argv.autoLoad&&this.exec(),this},refresh:function(){return this.exec(),this},exec:function(){var a=this._data,b=this;if(!a)return!1;if((this._argv.onExec&&this._argv.onExec(a))===!1)return!1;var c=this.fire("before",a);return c===!1?!1:a.__id__?void a.on("success",function(a,c){b._argv.onSuccess&&b._argv.onSuccess(c)}).on("error",function(a,c){b._argv.onError&&b._argv.onError(c)}).on("complete",function(a,c){b._argv.onComplete&&b._argv.onComplete(c)}).exec():new Promise(function(c,d){if(a){if(Store.fire("success",a)===!1)return!1;b._argv.onSuccess&&b._argv.onSuccess(a),b._argv.onComplete&&b._argv.onComplete(a),c(a)}else{if(Store.fire("error",a)===!1)return!1;b._argv.onError&&b._argv.onError(a),b._argv.onComplete&&b._argv.onComplete(a),d(a)}})}}}),f=a.Class({events:["before","success","error","complete","after"],properties:{host:"http://0.0.0.0:8080/",engine:{set:function(a){this._engine=a},get:function(){return"Fetcher"==this._engine?d:c}},headers:{}},methods:{request:function(a,b,e,f){var g=null;return new(g="Fetcher"==this._engine?d:c)(a,b,e,f)},post:function(a,b,c){return this.request(a,b,"POST",c)},"delete":function(a,b,c){return this.request(a,b,"DELETE",c)},put:function(a,b,c){return this.request(a,b,"PUT",c)},get:function(b,c,d){var e=[];return a.each(c,function(b,c){e.push(c+"="+(a.is(b,"object")?JSON.stringify(b):b))}),this.request(b,e.join("&"),"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):""},dataSource:function(a,b){return new e(a,b)}}});a.GLOBAL.Store=new f}(zn);

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

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,c){if(a){var d=null;for(var e in a)a.hasOwnProperty(e)&&(d=a[e],(c&&c(d,e,b))!==!1&&this.set(e,d,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},offs:function(){var b=Array.prototype.slice.call(arguments);return b.length?a.each(b,function(a){this.__handlers__[a]&&(this.__handlers__[a]=[{owner:null,handler:null,context:null}])}.bind(this)):this.__handlers__={},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;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)}};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(b){try{b=require.resolve(b);var c=require.cache[b];c&&c.parent&&c.parent.children.splice(c.parent.children.indexOf(c),1),require.cache[b]=null;var d=h.all[b];h.all[b]=null,d&&d.parent&&h.unloadModule(d.parent.path)}catch(e){a.error(e.message)}return 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);if(!f)try{i=require.resolve(i)}catch(j){return a.error("node require.resolve() error: ",j.message),c({})}var k=h.all[i];k?k.load(c):(k=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);k.sets({parent:d,path:i,dependencies:h.current.get("dependencies"),factory:h.current.get("factory"),status:e.LOADING}),k.load(c)}):this.__nodeModule(i,function(){h.counter--,k.sets({parent:d,path:i,dependencies:h.current.get("dependencies"),factory:h.current.get("factory"),status:e.LOADING}),k.load(c)}))},__nodeModule:function(b,c){var d=b,e=c||a.idle,f={};try{f=require(d)}catch(g){a.error("node require() error: ",g.message)}finally{e(f)}},__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,methods:{info:function(){this.__log.call(this,g.INFO,arguments)},debug:function(){this.__log.call(this,g.DEBUG,arguments)},warn:function(){this.__log.call(this,g.WARNING,arguments)},trace:function(){this.__log.call(this,g.TRACE,arguments)},error:function(){this.__log.call(this,g.ERROR,arguments)},__getDateString:function(a){return c.asString(a||new Date)},__getPosition:function(){try{throw new Error}catch(a){var b=a.stack.split("\n")[5].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,"] [",e,c,a.pos,g,"] ",a.message].join("")},__formatLog4Client:function(a){return["%c"+a.time," [",d[a.type],"] "].join("")},__log:function(a,b){var c=Array.prototype.slice.call(b);"undefined"!=typeof module&&module.exports?c.unshift(this.__formatLog4Server({type:a,time:this.__getDateString(),pos:this.__getPosition()},!0)):(c.unshift(this.__formatLog4Client({type:a,time:this.__getDateString(),pos:this.__getPosition()},!0)),c.unshift("color:"+e[a])),console.log.apply(this,c)}}}),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-1;c>-1;c--)try{return this._XMLHttpRequest=new ActiveXObject(b[c]),this._XMLHttpRequest}catch(d){continue}},__onComplete:function(a,b){clearTimeout(this._timeoutID),a.abort(),this._isRunning=!1,this.fire("complete",a,b),this.fire("after",a,b),this.offs()},__initRequestHeader:function(a,b){for(var c in b)a.setRequestHeader(c,b[c])},resetEvents:function(){this.offs()},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&&(d.fire("timeout",d),d.__onComplete(c,"timeout"))},this.timeout)),this.fire("before",this)===!1||!this.url)return this.__onComplete(c),e.promise;var f=this.url,g=this.data,h=this._method.toUpperCase();return"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>=200&&300>c){try{d=f&&f.indexOf("application/json")>=0?JSON.parse(d):d}catch(g){d=d}this.fire("success",d),e.resolve(d,b)}else this.fire("error",b),e.reject(b,d);return this.__onComplete(b,d),d}}.bind(this),this.__initRequestHeader(c,this.headers),c.send(g),this.asyns||this.__onComplete(c),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","validate","before","success","error","complete","after"],properties:{url:null,data:null,method:"POST",headers:null},methods:{init:function(a,b,c,d){this.sets({url:a,data:b,method:c,headers:d}),this.fire("init",this.gets())},validateArgv:function(a,b,c,d){var e=a||this._url||"",f=b||this._data||{},g=c||this._method||"POST",h=d||this._headers||{},i={url:e,data:f,method:g,headers:h};return i},exec:function(a,b,c,d){var e=this.validateArgv(a,b,c,d),f=Store.fire("before",e);return f===!1?!1:(f=this.fire("before",e),f===!1?!1:e)},__onComplete:function(a){var b=Store.fire("after",a);return b===!1?!1:(b=this.fire("complete",a),b===!1?!1:void 0)},__onSuccess:function(a,b){var c=Store.fire("success",a,b);return c===!1?!1:(c=this.fire("success",a,b),c===!1?!1:void 0)},__onError:function(a){var b=Store.fire("success",a);return b===!1?!1:(b=this.fire("success",a),b===!1?!1:void 0)},refresh:function(a,b,c,d){return this.exec(a,b,c,d)},clone:function(b){var c=this._data;return c="object"==typeof c?a.extend(JSON.parse(JSON.stringify(c)),b):b,new this.constructor(this._url,c,this._method,this._headers)},extend:function(b){return this._data=a.extend(this._data,b),this},overwrite:function(b){return this._data=a.overwrite(this._data,b),this}}}),c=a.Class(b,{methods:{init:function(a,b,c,d){this.sets({url:a,data:b,method:c,headers:d}),this.fire("init",this.gets())},exec:function(b,c,d,e){var f=this.validateArgv(b,c,d,e),g=Store.fire("before",f);return g===!1?!1:(g=this.fire("before",f),g===!1?!1:f===!1?!1:a["$"+f.method.toLowerCase()]({url:Store.fixURL(f.url),data:f.data,headers:f.headers,success:function(a,b,c){this.__onSuccess(b,c)}.bind(this),error:function(a,b){this.__onError(b)}.bind(this),complete:function(a,b){this.__onComplete(b)}.bind(this)}))}}}),d=a.Class(b,{methods:{init:function(a,b,c,d){this.sets({url:a,data:b,method:c,headers:d}),this.fire("init",this.gets())},exec:function(b,c,d,e){var f=this.validateArgv(b,c,d,e),g=Store.fire("before",f);if(g===!1)return!1;if(g=this.fire("before",f),g===!1)return!1;if(f===!1)return!1;var h=f.url,i=f.method,j=f.data,k=f.headers,l=this,m={method:i.toUpperCase()};switch(i.toUpperCase()){case"POST":var n=new FormData;for(var o in j)n.append(o,j[o]);m.body=n,m.headers=a.overwrite(k,{Accept:"multipart/form-data","Content-Type":"multipart/form-data; charset=UTF-8"});break;case"GET":var p=[];a.each(j,function(a,b){p.push(b+"="+a)}),h+="?"+p.join("&");break;case"JSON":m.body=JSON.stringify(j),m.method="POST",m.headers=a.overwrite(k,{Accept:"multipart/form-data","Content-Type":"multipart/form-data; charset=UTF-8"})}return new Promise(function(a,b){fetch(Store.fixURL(h),m).then(function(a){return a.json()}).then(function(b){l.__onSuccess(b),l.__onComplete(b),a(b)}).catch(function(a){l.__onError(a),l.__onComplete(a),b(a)})})}}}),e=a.Class({events:["init","before","after"],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){return a&&(this._data=a),b&&(this._argv=b),this._argv&&this._argv.autoLoad&&this.exec(),this},refresh:function(){return this.exec(),this},exec:function(){var a=this._data,b=this;if(!a)return!1;if((this._argv.onExec&&this._argv.onExec(a))===!1)return!1;var c=this.fire("before",a);return c===!1?!1:a.__id__?void a.on("success",function(a,c){b._argv.onSuccess&&b._argv.onSuccess(c)}).on("error",function(a,c){b._argv.onError&&b._argv.onError(c)}).on("complete",function(a,c){b._argv.onComplete&&b._argv.onComplete(c)}).exec():new Promise(function(c,d){if(a){if(Store.fire("success",a)===!1)return!1;b._argv.onSuccess&&b._argv.onSuccess(a),b._argv.onComplete&&b._argv.onComplete(a),c(a)}else{if(Store.fire("error",a)===!1)return!1;b._argv.onError&&b._argv.onError(a),b._argv.onComplete&&b._argv.onComplete(a),d(a)}})}}}),f=a.Class({events:["before","success","error","complete","after"],properties:{host:"http://0.0.0.0:8080/",engine:{set:function(a){this._engine=a},get:function(){return"Fetcher"==this._engine?d:c}},headers:{}},methods:{request:function(a,b,e,f){var g=null;return new(g="Fetcher"==this._engine?d:c)(a,b,e,f)},post:function(a,b,c){return this.request(a,b,"POST",c)},"delete":function(a,b,c){return this.request(a,b,"DELETE",c)},put:function(a,b,c){return this.request(a,b,"PUT",c)},get:function(b,c,d){var e=[];return a.each(c,function(b,c){e.push(c+"="+(a.is(b,"object")?JSON.stringify(b):b))}),this.request(b,e.join("&"),"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):""},dataSource:function(a,b){return new e(a,b)}}});a.GLOBAL.Store=new f}(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],b=b.toString?b.toString():b,c=a[1],d.each(c,function(a,c){null!==a&&void 0!==a&&(a=d.is(a,"object")?JSON.stringify(a):a.toString?a.toString():a,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,c){if(a){var d=null;for(var e in a)a.hasOwnProperty(e)&&(d=a[e],(c&&c(d,e,b))!==!1&&this.set(e,d,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},offs:function(){var b=Array.prototype.slice.call(arguments);return b.length?a.each(b,function(a){this.__handlers__[a]&&(this.__handlers__[a]=[{owner:null,handler:null,context:null}])}.bind(this)):this.__handlers__={},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;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)}};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(b){try{if(!h.all[b])return this;b=require.resolve(b);var c=require.cache[b];c&&c.parent&&c.parent.children.splice(c.parent.children.indexOf(c),1),require.cache[b]=null;var d=h.all[b];h.all[b]=null,d&&d.parent&&h.unloadModule(d.parent.path)}catch(e){a.error(e.message)}return 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);if(!f)try{i=require.resolve(i)}catch(j){return a.error("node require.resolve() error: ",j.message),c({})}var k=h.all[i];k?k.load(c):(k=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);k.sets({parent:d,path:i,dependencies:h.current.get("dependencies"),factory:h.current.get("factory"),status:e.LOADING}),k.load(c)}):this.__nodeModule(i,function(){h.counter--,k.sets({parent:d,path:i,dependencies:h.current.get("dependencies"),factory:h.current.get("factory"),status:e.LOADING}),k.load(c)}))},__nodeModule:function(b,c){var d=b,e=c||a.idle,f={};try{f=require(d)}catch(g){console.error(g),a.error("Node.js require("+d+") error: ",g.message)}finally{e(f)}},__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={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.ZNDate",{methods:{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}}});a.date=new 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=["INFO","DEBUG","WARN","ERROR","TRACE","ALL"],c=["#100000","#2125a0","#a82c2c","#c045b7","1cb131","#100000"],d=[38,34,35,31,32,36,33],e={INFO:0,DEBUG:1,WARN:2,ERROR:3,TRACE:4,ALL:6},f=a.Class({events:["info","debug","warn","error","trace","all"],methods:{init:function(){this._config={only:null,levels:["info","debug","warn","error","trace","all"]}},config:function(b){this._config=a.overwrite(b,this._config)},info:function(){this.__log.call(this,e.INFO,arguments)},debug:function(){this.__log.call(this,e.DEBUG,arguments)},warn:function(){this.__log.call(this,e.WARN,arguments)},trace:function(){this.__log.call(this,e.TRACE,arguments)},error:function(){this.__log.call(this,e.ERROR,arguments)},all:function(){this.__log.call(this,e.ALL,arguments)},__getDateString:function(b){return a.date.asString(b||new Date)},__getPosition:function(){try{throw new Error}catch(a){var b=a.stack.split("\n")[5].replace(/\(/g,"").replace(/\)/g,"").split("/").pop();return b}},__formatLog4Server:function(a,c){var e="",f="",g="";return c&&(f="[",g="",e=d[5]+"m",c=d[a.type]+"m"),[a.time," [",f,c,b[a.type],g,"] [",f,e,a.pos,g,"] ",a.message].join("")},__formatLog4Client:function(a){return["%c"+a.time," [",b[a.type],"] "].join("")},__log:function(a,d){var e=Array.prototype.slice.call(d),f=e.slice(0),g=b[a].toLowerCase(),h=this.__getDateString(),i=this.__getPosition();if(f.unshift(i),f.unshift(g),f.unshift(h),"undefined"!=typeof module&&module.exports?e.unshift(this.__formatLog4Server({type:a,time:h,pos:i},!0)):(e.unshift(this.__formatLog4Client({type:a,time:h,pos:i},!0)),e.unshift("color:"+c[a])),this.__isOk(g)){var j=this.fire(g,f);j!==!1&&console.log.apply(this,e)}},__isOk:function(a){if(this._config.only){if(this._config.only===a)return!0}else{var b=-1!==this._config.levels.indexOf(a);if(b)return!0}return!1}}});a.logger=new f;var g={info:function(){a.logger.info.apply(a.logger,arguments)},debug:function(){a.logger.debug.apply(a.logger,arguments)},warn:function(){a.logger.warn.apply(a.logger,arguments)},trace:function(){a.logger.trace.apply(a.logger,arguments)},error:function(){a.logger.error.apply(a.logger,arguments)}};a.extend(a,g)}(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-1;c>-1;c--)try{return this._XMLHttpRequest=new ActiveXObject(b[c]),this._XMLHttpRequest}catch(d){continue}},__onComplete:function(a,b){clearTimeout(this._timeoutID),a.abort(),this._isRunning=!1,this.fire("complete",a,b),this.fire("after",a,b),this.offs()},__initRequestHeader:function(a,b){for(var c in b)a.setRequestHeader(c,b[c])},resetEvents:function(){this.offs()},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&&(d.fire("timeout",d),d.__onComplete(c,"timeout"))},this.timeout)),this.fire("before",this)===!1||!this.url)return this.__onComplete(c),e.promise;var f=this.url,g=this.data,h=this._method.toUpperCase();return"GET"===h&&(g&&(f=f+"?"+g),g=null),c.readyState<2,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>=200&&300>c){try{d=f&&f.indexOf("application/json")>=0?JSON.parse(d):d}catch(g){d=d}this.fire("success",d),e.resolve(d,b)}else this.fire("error",b),e.reject(b,d);return this.__onComplete(b,d),d}}.bind(this),this.__initRequestHeader(c,this.headers),c.send(g),this.asyns||this.__onComplete(c),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(){zn.querystring=zn.Class({"static":!0,properties:{config:{get:function(){}}},methods:{init:function(){this._config={separator:"&",equal:"=",minIndex:0,maxIndex:1e3}},config:function(a){return this.overwrite(this._config,a),this},parse:function(a,b){var c=zn.extend({},this._config,b),d={},e=c.equal,f=a.split(c.separator),g=f.length;c.maxIndex>0&&g>c.maxIndex&&(g=c.maxIndex);for(var h=c.minIndex;g>h;h++){var i=f[h].replace(/\+/g,"%20"),j=i.indexOf(e),k=null,l=null;j>=0?(k=i.substr(0,j),l=i.substr(j+1)):(k=i,l=""),k=decodeURIComponent(k),l=decodeURIComponent(l),hasOwnProperty(d,k)?zn.is(d[k],"array")?d[k].push(l):d[k]=[d[k],l]:d[k]=l}return d},stringify:function(a,b){var c=zn.extend({},this._config,b),d=[],e=c.equal,f={};if(f=zn.isZNObject(a)?a.gets():a,!zn.is(f,"object"))throw new Error("Agrument Error.");for(var g in a){var h=a[g],i=encodeURIComponent(this.__stringifyValue(g));h=encodeURIComponent(this.__stringifyValue(h)),d.push(i+e+h)}return d.join(c.separator)},__stringifyValue:function(a){switch(zn.type(a)){case"string":return a;case"boolean":return a?"true":"false";case"object":case"array":return JSON.stringify(a);case"number":return isFinite(a)?a:"";default:return""}}}})}(zn),function(a){var b=a.Class({events:["init","validate","before","success","error","complete","after"],properties:{url:null,data:null,method:"POST",headers:null},methods:{init:function(a,b,c,d){this.sets({url:a,data:b,method:c,headers:d}),this.fire("init",this.gets())},validateArgv:function(a,b,c,d){var e=a||this._url||"",f=b||this._data||{},g=c||this._method||"POST",h=d||this._headers||{},i={url:e,data:f,method:g,headers:h};return i},exec:function(a,b,c,d){var e=this.validateArgv(a,b,c,d),f=Store.fire("before",e);return f===!1?!1:(f=this.fire("before",e),f===!1?!1:e)},__onComplete:function(a){var b=Store.fire("after",a);return b===!1?!1:(b=this.fire("complete",a),b===!1?!1:void 0)},__onSuccess:function(a,b){var c=Store.fire("success",a,b);return c===!1?!1:(c=this.fire("success",a,b),c===!1?!1:void 0)},__onError:function(a){var b=Store.fire("success",a);return b===!1?!1:(b=this.fire("success",a),b===!1?!1:void 0)},refresh:function(a,b,c,d){return this.exec(a,b,c,d)},clone:function(b){var c=this._data;return c="object"==typeof c?a.extend(JSON.parse(JSON.stringify(c)),b):b,new this.constructor(this._url,c,this._method,this._headers)},extend:function(b){return this._data=a.extend(this._data,b),this},overwrite:function(b){return this._data=a.overwrite(this._data,b),this}}}),c=a.Class(b,{methods:{init:function(a,b,c,d){this.sets({url:a,data:b,method:c,headers:d}),this.fire("init",this.gets())},exec:function(b,c,d,e){var f=this.validateArgv(b,c,d,e),g=Store.fire("before",f);return g===!1?!1:(g=this.fire("before",f),g===!1?!1:f===!1?!1:a["$"+f.method.toLowerCase()]({url:Store.fixURL(f.url),data:f.data,headers:f.headers,success:function(a,b,c){this.__onSuccess(b,c)}.bind(this),error:function(a,b){this.__onError(b)}.bind(this),complete:function(a,b){this.__onComplete(b)}.bind(this)}))}}}),d=a.Class(b,{methods:{init:function(a,b,c,d){this.sets({url:a,data:b,method:c,headers:d}),this.fire("init",this.gets())},exec:function(b,c,d,e){var f=this.validateArgv(b,c,d,e),g=Store.fire("before",f);if(g===!1)return!1;if(g=this.fire("before",f),g===!1)return!1;if(f===!1)return!1;var h=f.url,i=f.method,j=f.data,k=f.headers,l=this,m={method:i.toUpperCase()};switch(i.toUpperCase()){case"POST":var n=new FormData;for(var o in j)n.append(o,j[o]);m.body=n,m.headers=a.overwrite(k,{Accept:"multipart/form-data","Content-Type":"multipart/form-data; charset=UTF-8"});break;case"GET":var p=[];a.each(j,function(a,b){p.push(b+"="+a)}),h+="?"+p.join("&");break;case"JSON":m.body=JSON.stringify(j),m.method="POST",m.headers=a.overwrite(k,{Accept:"multipart/form-data","Content-Type":"multipart/form-data; charset=UTF-8"})}return new Promise(function(a,b){fetch(Store.fixURL(h),m).then(function(a){return a.json()}).then(function(b){l.__onSuccess(b),l.__onComplete(b),a(b)}).catch(function(a){l.__onError(a),l.__onComplete(a),b(a)})})}}}),e=a.Class({events:["init","before","after"],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){return a&&(this._data=a),b&&(this._argv=b),this._argv&&this._argv.autoLoad&&this.exec(),this},refresh:function(){return this.exec(),this},exec:function(){var a=this._data,b=this;if(!a)return!1;if((this._argv.onExec&&this._argv.onExec(a))===!1)return!1;var c=this.fire("before",a);return c===!1?!1:a.__id__?void a.on("success",function(a,c){b._argv.onSuccess&&b._argv.onSuccess(c)}).on("error",function(a,c){b._argv.onError&&b._argv.onError(c)}).on("complete",function(a,c){b._argv.onComplete&&b._argv.onComplete(c)}).exec():new Promise(function(c,d){if(a){if(Store.fire("success",a)===!1)return!1;b._argv.onSuccess&&b._argv.onSuccess(a),b._argv.onComplete&&b._argv.onComplete(a),c(a)}else{if(Store.fire("error",a)===!1)return!1;b._argv.onError&&b._argv.onError(a),b._argv.onComplete&&b._argv.onComplete(a),d(a)}})}}}),f=a.Class({events:["before","success","error","complete","after"],properties:{host:"http://0.0.0.0:8080/",engine:{set:function(a){this._engine=a},get:function(){return"Fetcher"==this._engine?d:c}},headers:{}},methods:{request:function(a,b,e,f){var g=null;return new(g="Fetcher"==this._engine?d:c)(a,b,e,f)},post:function(a,b,c){return this.request(a,b,"POST",c)},"delete":function(a,b,c){return this.request(a,b,"DELETE",c)},put:function(a,b,c){return this.request(a,b,"PUT",c)},get:function(b,c,d){var e=[];return a.each(c,function(b,c){e.push(c+"="+(a.is(b,"object")?JSON.stringify(b):b))}),this.request(b,e.join("&"),"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):""},dataSource:function(a,b){return new e(a,b)}}});a.GLOBAL.Store=new f}(zn);

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

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,c){if(a){var d=null;for(var e in a)a.hasOwnProperty(e)&&(d=a[e],(c&&c(d,e,b))!==!1&&this.set(e,d,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},offs:function(){var b=Array.prototype.slice.call(arguments);return b.length?a.each(b,function(a){this.__handlers__[a]&&(this.__handlers__[a]=[{owner:null,handler:null,context:null}])}.bind(this)):this.__handlers__={},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;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)}};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(b){try{b=require.resolve(b);var c=require.cache[b];c&&c.parent&&c.parent.children.splice(c.parent.children.indexOf(c),1),require.cache[b]=null;var d=h.all[b];h.all[b]=null,d&&d.parent&&h.unloadModule(d.parent.path)}catch(e){a.error(e.message)}return 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);if(!f)try{i=require.resolve(i)}catch(j){return a.error("node require.resolve() error: ",j.message),c({})}var k=h.all[i];k?k.load(c):(k=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);k.sets({parent:d,path:i,dependencies:h.current.get("dependencies"),factory:h.current.get("factory"),status:e.LOADING}),k.load(c)}):this.__nodeModule(i,function(){h.counter--,k.sets({parent:d,path:i,dependencies:h.current.get("dependencies"),factory:h.current.get("factory"),status:e.LOADING}),k.load(c)}))},__nodeModule:function(b,c){var d=b,e=c||a.idle,f={};try{f=require(d)}catch(g){a.error("node require() error: ",g.message)}finally{e(f)}},__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,methods:{info:function(){this.__log.call(this,g.INFO,arguments)},debug:function(){this.__log.call(this,g.DEBUG,arguments)},warn:function(){this.__log.call(this,g.WARNING,arguments)},trace:function(){this.__log.call(this,g.TRACE,arguments)},error:function(){this.__log.call(this,g.ERROR,arguments)},__getDateString:function(a){return c.asString(a||new Date)},__getPosition:function(){try{throw new Error}catch(a){var b=a.stack.split("\n")[5].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,"] [",e,c,a.pos,g,"] ",a.message].join("")},__formatLog4Client:function(a){return["%c"+a.time," [",d[a.type],"] "].join("")},__log:function(a,b){var c=Array.prototype.slice.call(b);"undefined"!=typeof module&&module.exports?c.unshift(this.__formatLog4Server({type:a,time:this.__getDateString(),pos:this.__getPosition()},!0)):(c.unshift(this.__formatLog4Client({type:a,time:this.__getDateString(),pos:this.__getPosition()},!0)),c.unshift("color:"+e[a])),console.log.apply(this,c)}}}),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-1;c>-1;c--)try{return this._XMLHttpRequest=new ActiveXObject(b[c]),this._XMLHttpRequest}catch(d){continue}},__onComplete:function(a,b){clearTimeout(this._timeoutID),a.abort(),this._isRunning=!1,this.fire("complete",a,b),this.fire("after",a,b),this.offs()},__initRequestHeader:function(a,b){for(var c in b)a.setRequestHeader(c,b[c])},resetEvents:function(){this.offs()},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&&(d.fire("timeout",d),d.__onComplete(c,"timeout"))},this.timeout)),this.fire("before",this)===!1||!this.url)return this.__onComplete(c),e.promise;var f=this.url,g=this.data,h=this._method.toUpperCase();return"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>=200&&300>c){try{d=f&&f.indexOf("application/json")>=0?JSON.parse(d):d}catch(g){d=d}this.fire("success",d),e.resolve(d,b)}else this.fire("error",b),e.reject(b,d);return this.__onComplete(b,d),d}}.bind(this),this.__initRequestHeader(c,this.headers),c.send(g),this.asyns||this.__onComplete(c),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","validate","before","success","error","complete","after"],properties:{url:null,data:null,method:"POST",headers:null},methods:{init:function(a,b,c,d){this.sets({url:a,data:b,method:c,headers:d}),this.fire("init",this.gets())},validateArgv:function(a,b,c,d){var e=a||this._url||"",f=b||this._data||{},g=c||this._method||"POST",h=d||this._headers||{},i={url:e,data:f,method:g,headers:h};return i},exec:function(a,b,c,d){var e=this.validateArgv(a,b,c,d),f=Store.fire("before",e);return f===!1?!1:(f=this.fire("before",e),f===!1?!1:e)},__onComplete:function(a){var b=Store.fire("after",a);return b===!1?!1:(b=this.fire("complete",a),b===!1?!1:void 0)},__onSuccess:function(a,b){var c=Store.fire("success",a,b);return c===!1?!1:(c=this.fire("success",a,b),c===!1?!1:void 0)},__onError:function(a){var b=Store.fire("success",a);return b===!1?!1:(b=this.fire("success",a),b===!1?!1:void 0)},refresh:function(a,b,c,d){return this.exec(a,b,c,d)},clone:function(b){var c=this._data;return c="object"==typeof c?a.extend(JSON.parse(JSON.stringify(c)),b):b,new this.constructor(this._url,c,this._method,this._headers)},extend:function(b){return this._data=a.extend(this._data,b),this},overwrite:function(b){return this._data=a.overwrite(this._data,b),this}}}),c=a.Class(b,{methods:{init:function(a,b,c,d){this.sets({url:a,data:b,method:c,headers:d}),this.fire("init",this.gets())},exec:function(b,c,d,e){var f=this.validateArgv(b,c,d,e),g=Store.fire("before",f);return g===!1?!1:(g=this.fire("before",f),g===!1?!1:f===!1?!1:a["$"+f.method.toLowerCase()]({url:Store.fixURL(f.url),data:f.data,headers:f.headers,success:function(a,b,c){this.__onSuccess(b,c)}.bind(this),error:function(a,b){this.__onError(b)}.bind(this),complete:function(a,b){this.__onComplete(b)}.bind(this)}))}}}),d=a.Class(b,{methods:{init:function(a,b,c,d){this.sets({url:a,data:b,method:c,headers:d}),this.fire("init",this.gets())},exec:function(b,c,d,e){var f=this.validateArgv(b,c,d,e),g=Store.fire("before",f);if(g===!1)return!1;if(g=this.fire("before",f),g===!1)return!1;if(f===!1)return!1;var h=f.url,i=f.method,j=f.data,k=f.headers,l=this,m={method:i.toUpperCase()};switch(i.toUpperCase()){case"POST":var n=new FormData;for(var o in j)n.append(o,j[o]);m.body=n,m.headers=a.overwrite(k,{Accept:"multipart/form-data","Content-Type":"multipart/form-data; charset=UTF-8"});break;case"GET":var p=[];a.each(j,function(a,b){p.push(b+"="+a)}),h+="?"+p.join("&");break;case"JSON":m.body=JSON.stringify(j),m.method="POST",m.headers=a.overwrite(k,{Accept:"multipart/form-data","Content-Type":"multipart/form-data; charset=UTF-8"})}return new Promise(function(a,b){fetch(Store.fixURL(h),m).then(function(a){return a.json()}).then(function(b){l.__onSuccess(b),l.__onComplete(b),a(b)}).catch(function(a){l.__onError(a),l.__onComplete(a),b(a)})})}}}),e=a.Class({events:["init","before","after"],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){return a&&(this._data=a),b&&(this._argv=b),this._argv&&this._argv.autoLoad&&this.exec(),this},refresh:function(){return this.exec(),this},exec:function(){var a=this._data,b=this;if(!a)return!1;if((this._argv.onExec&&this._argv.onExec(a))===!1)return!1;var c=this.fire("before",a);return c===!1?!1:a.__id__?void a.on("success",function(a,c){b._argv.onSuccess&&b._argv.onSuccess(c)}).on("error",function(a,c){b._argv.onError&&b._argv.onError(c)}).on("complete",function(a,c){b._argv.onComplete&&b._argv.onComplete(c)}).exec():new Promise(function(c,d){if(a){if(Store.fire("success",a)===!1)return!1;b._argv.onSuccess&&b._argv.onSuccess(a),b._argv.onComplete&&b._argv.onComplete(a),c(a)}else{if(Store.fire("error",a)===!1)return!1;b._argv.onError&&b._argv.onError(a),b._argv.onComplete&&b._argv.onComplete(a),d(a)}})}}}),f=a.Class({events:["before","success","error","complete","after"],properties:{host:"http://0.0.0.0:8080/",engine:{set:function(a){this._engine=a},get:function(){return"Fetcher"==this._engine?d:c}},headers:{}},methods:{request:function(a,b,e,f){var g=null;return new(g="Fetcher"==this._engine?d:c)(a,b,e,f)},post:function(a,b,c){return this.request(a,b,"POST",c)},"delete":function(a,b,c){return this.request(a,b,"DELETE",c)},put:function(a,b,c){return this.request(a,b,"PUT",c)},get:function(b,c,d){var e=[];return a.each(c,function(b,c){e.push(c+"="+(a.is(b,"object")?JSON.stringify(b):b))}),this.request(b,e.join("&"),"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):""},dataSource:function(a,b){return new e(a,b)}}});a.GLOBAL.Store=new f}(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],b=b.toString?b.toString():b,c=a[1],d.each(c,function(a,c){null!==a&&void 0!==a&&(a=d.is(a,"object")?JSON.stringify(a):a.toString?a.toString():a,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,c){if(a){var d=null;for(var e in a)a.hasOwnProperty(e)&&(d=a[e],(c&&c(d,e,b))!==!1&&this.set(e,d,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},offs:function(){var b=Array.prototype.slice.call(arguments);return b.length?a.each(b,function(a){this.__handlers__[a]&&(this.__handlers__[a]=[{owner:null,handler:null,context:null}])}.bind(this)):this.__handlers__={},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;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)}};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(b){try{if(!h.all[b])return this;b=require.resolve(b);var c=require.cache[b];c&&c.parent&&c.parent.children.splice(c.parent.children.indexOf(c),1),require.cache[b]=null;var d=h.all[b];h.all[b]=null,d&&d.parent&&h.unloadModule(d.parent.path)}catch(e){a.error(e.message)}return 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);if(!f)try{i=require.resolve(i)}catch(j){return a.error("node require.resolve() error: ",j.message),c({})}var k=h.all[i];k?k.load(c):(k=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);k.sets({parent:d,path:i,dependencies:h.current.get("dependencies"),factory:h.current.get("factory"),status:e.LOADING}),k.load(c)}):this.__nodeModule(i,function(){h.counter--,k.sets({parent:d,path:i,dependencies:h.current.get("dependencies"),factory:h.current.get("factory"),status:e.LOADING}),k.load(c)}))},__nodeModule:function(b,c){var d=b,e=c||a.idle,f={};try{f=require(d)}catch(g){console.error(g),a.error("Node.js require("+d+") error: ",g.message)}finally{e(f)}},__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={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.ZNDate",{methods:{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}}});a.date=new 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=["INFO","DEBUG","WARN","ERROR","TRACE","ALL"],c=["#100000","#2125a0","#a82c2c","#c045b7","1cb131","#100000"],d=[38,34,35,31,32,36,33],e={INFO:0,DEBUG:1,WARN:2,ERROR:3,TRACE:4,ALL:6},f=a.Class({events:["info","debug","warn","error","trace","all"],methods:{init:function(){this._config={only:null,levels:["info","debug","warn","error","trace","all"]}},config:function(b){this._config=a.overwrite(b,this._config)},info:function(){this.__log.call(this,e.INFO,arguments)},debug:function(){this.__log.call(this,e.DEBUG,arguments)},warn:function(){this.__log.call(this,e.WARN,arguments)},trace:function(){this.__log.call(this,e.TRACE,arguments)},error:function(){this.__log.call(this,e.ERROR,arguments)},all:function(){this.__log.call(this,e.ALL,arguments)},__getDateString:function(b){return a.date.asString(b||new Date)},__getPosition:function(){try{throw new Error}catch(a){var b=a.stack.split("\n")[5].replace(/\(/g,"").replace(/\)/g,"").split("/").pop();return b}},__formatLog4Server:function(a,c){var e="",f="",g="";return c&&(f="[",g="",e=d[5]+"m",c=d[a.type]+"m"),[a.time," [",f,c,b[a.type],g,"] [",f,e,a.pos,g,"] ",a.message].join("")},__formatLog4Client:function(a){return["%c"+a.time," [",b[a.type],"] "].join("")},__log:function(a,d){var e=Array.prototype.slice.call(d),f=e.slice(0),g=b[a].toLowerCase(),h=this.__getDateString(),i=this.__getPosition();if(f.unshift(i),f.unshift(g),f.unshift(h),"undefined"!=typeof module&&module.exports?e.unshift(this.__formatLog4Server({type:a,time:h,pos:i},!0)):(e.unshift(this.__formatLog4Client({type:a,time:h,pos:i},!0)),e.unshift("color:"+c[a])),this.__isOk(g)){var j=this.fire(g,f);j!==!1&&console.log.apply(this,e)}},__isOk:function(a){if(this._config.only){if(this._config.only===a)return!0}else{var b=-1!==this._config.levels.indexOf(a);if(b)return!0}return!1}}});a.logger=new f;var g={info:function(){a.logger.info.apply(a.logger,arguments)},debug:function(){a.logger.debug.apply(a.logger,arguments)},warn:function(){a.logger.warn.apply(a.logger,arguments)},trace:function(){a.logger.trace.apply(a.logger,arguments)},error:function(){a.logger.error.apply(a.logger,arguments)}};a.extend(a,g)}(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-1;c>-1;c--)try{return this._XMLHttpRequest=new ActiveXObject(b[c]),this._XMLHttpRequest}catch(d){continue}},__onComplete:function(a,b){clearTimeout(this._timeoutID),a.abort(),this._isRunning=!1,this.fire("complete",a,b),this.fire("after",a,b),this.offs()},__initRequestHeader:function(a,b){for(var c in b)a.setRequestHeader(c,b[c])},resetEvents:function(){this.offs()},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&&(d.fire("timeout",d),d.__onComplete(c,"timeout"))},this.timeout)),this.fire("before",this)===!1||!this.url)return this.__onComplete(c),e.promise;var f=this.url,g=this.data,h=this._method.toUpperCase();return"GET"===h&&(g&&(f=f+"?"+g),g=null),c.readyState<2,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>=200&&300>c){try{d=f&&f.indexOf("application/json")>=0?JSON.parse(d):d}catch(g){d=d}this.fire("success",d),e.resolve(d,b)}else this.fire("error",b),e.reject(b,d);return this.__onComplete(b,d),d}}.bind(this),this.__initRequestHeader(c,this.headers),c.send(g),this.asyns||this.__onComplete(c),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(){zn.querystring=zn.Class({"static":!0,properties:{config:{get:function(){}}},methods:{init:function(){this._config={separator:"&",equal:"=",minIndex:0,maxIndex:1e3}},config:function(a){return this.overwrite(this._config,a),this},parse:function(a,b){var c=zn.extend({},this._config,b),d={},e=c.equal,f=a.split(c.separator),g=f.length;c.maxIndex>0&&g>c.maxIndex&&(g=c.maxIndex);for(var h=c.minIndex;g>h;h++){var i=f[h].replace(/\+/g,"%20"),j=i.indexOf(e),k=null,l=null;j>=0?(k=i.substr(0,j),l=i.substr(j+1)):(k=i,l=""),k=decodeURIComponent(k),l=decodeURIComponent(l),hasOwnProperty(d,k)?zn.is(d[k],"array")?d[k].push(l):d[k]=[d[k],l]:d[k]=l}return d},stringify:function(a,b){var c=zn.extend({},this._config,b),d=[],e=c.equal,f={};if(f=zn.isZNObject(a)?a.gets():a,!zn.is(f,"object"))throw new Error("Agrument Error.");for(var g in a){var h=a[g],i=encodeURIComponent(this.__stringifyValue(g));h=encodeURIComponent(this.__stringifyValue(h)),d.push(i+e+h)}return d.join(c.separator)},__stringifyValue:function(a){switch(zn.type(a)){case"string":return a;case"boolean":return a?"true":"false";case"object":case"array":return JSON.stringify(a);case"number":return isFinite(a)?a:"";default:return""}}}})}(zn),function(a){var b=a.Class({events:["init","validate","before","success","error","complete","after"],properties:{url:null,data:null,method:"POST",headers:null},methods:{init:function(a,b,c,d){this.sets({url:a,data:b,method:c,headers:d}),this.fire("init",this.gets())},validateArgv:function(a,b,c,d){var e=a||this._url||"",f=b||this._data||{},g=c||this._method||"POST",h=d||this._headers||{},i={url:e,data:f,method:g,headers:h};return i},exec:function(a,b,c,d){var e=this.validateArgv(a,b,c,d),f=Store.fire("before",e);return f===!1?!1:(f=this.fire("before",e),f===!1?!1:e)},__onComplete:function(a){var b=Store.fire("after",a);return b===!1?!1:(b=this.fire("complete",a),b===!1?!1:void 0)},__onSuccess:function(a,b){var c=Store.fire("success",a,b);return c===!1?!1:(c=this.fire("success",a,b),c===!1?!1:void 0)},__onError:function(a){var b=Store.fire("success",a);return b===!1?!1:(b=this.fire("success",a),b===!1?!1:void 0)},refresh:function(a,b,c,d){return this.exec(a,b,c,d)},clone:function(b){var c=this._data;return c="object"==typeof c?a.extend(JSON.parse(JSON.stringify(c)),b):b,new this.constructor(this._url,c,this._method,this._headers)},extend:function(b){return this._data=a.extend(this._data,b),this},overwrite:function(b){return this._data=a.overwrite(this._data,b),this}}}),c=a.Class(b,{methods:{init:function(a,b,c,d){this.sets({url:a,data:b,method:c,headers:d}),this.fire("init",this.gets())},exec:function(b,c,d,e){var f=this.validateArgv(b,c,d,e),g=Store.fire("before",f);return g===!1?!1:(g=this.fire("before",f),g===!1?!1:f===!1?!1:a["$"+f.method.toLowerCase()]({url:Store.fixURL(f.url),data:f.data,headers:f.headers,success:function(a,b,c){this.__onSuccess(b,c)}.bind(this),error:function(a,b){this.__onError(b)}.bind(this),complete:function(a,b){this.__onComplete(b)}.bind(this)}))}}}),d=a.Class(b,{methods:{init:function(a,b,c,d){this.sets({url:a,data:b,method:c,headers:d}),this.fire("init",this.gets())},exec:function(b,c,d,e){var f=this.validateArgv(b,c,d,e),g=Store.fire("before",f);if(g===!1)return!1;if(g=this.fire("before",f),g===!1)return!1;if(f===!1)return!1;var h=f.url,i=f.method,j=f.data,k=f.headers,l=this,m={method:i.toUpperCase()};switch(i.toUpperCase()){case"POST":var n=new FormData;for(var o in j)n.append(o,j[o]);m.body=n,m.headers=a.overwrite(k,{Accept:"multipart/form-data","Content-Type":"multipart/form-data; charset=UTF-8"});break;case"GET":var p=[];a.each(j,function(a,b){p.push(b+"="+a)}),h+="?"+p.join("&");break;case"JSON":m.body=JSON.stringify(j),m.method="POST",m.headers=a.overwrite(k,{Accept:"multipart/form-data","Content-Type":"multipart/form-data; charset=UTF-8"})}return new Promise(function(a,b){fetch(Store.fixURL(h),m).then(function(a){return a.json()}).then(function(b){l.__onSuccess(b),l.__onComplete(b),a(b)}).catch(function(a){l.__onError(a),l.__onComplete(a),b(a)})})}}}),e=a.Class({events:["init","before","after"],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){return a&&(this._data=a),b&&(this._argv=b),this._argv&&this._argv.autoLoad&&this.exec(),this},refresh:function(){return this.exec(),this},exec:function(){var a=this._data,b=this;if(!a)return!1;if((this._argv.onExec&&this._argv.onExec(a))===!1)return!1;var c=this.fire("before",a);return c===!1?!1:a.__id__?void a.on("success",function(a,c){b._argv.onSuccess&&b._argv.onSuccess(c)}).on("error",function(a,c){b._argv.onError&&b._argv.onError(c)}).on("complete",function(a,c){b._argv.onComplete&&b._argv.onComplete(c)}).exec():new Promise(function(c,d){if(a){if(Store.fire("success",a)===!1)return!1;b._argv.onSuccess&&b._argv.onSuccess(a),b._argv.onComplete&&b._argv.onComplete(a),c(a)}else{if(Store.fire("error",a)===!1)return!1;b._argv.onError&&b._argv.onError(a),b._argv.onComplete&&b._argv.onComplete(a),d(a)}})}}}),f=a.Class({events:["before","success","error","complete","after"],properties:{host:"http://0.0.0.0:8080/",engine:{set:function(a){this._engine=a},get:function(){return"Fetcher"==this._engine?d:c}},headers:{}},methods:{request:function(a,b,e,f){var g=null;return new(g="Fetcher"==this._engine?d:c)(a,b,e,f)},post:function(a,b,c){return this.request(a,b,"POST",c)},"delete":function(a,b,c){return this.request(a,b,"DELETE",c)},put:function(a,b,c){return this.request(a,b,"PUT",c)},get:function(b,c,d){var e=[];return a.each(c,function(b,c){e.push(c+"="+(a.is(b,"object")?JSON.stringify(b):b))}),this.request(b,e.join("&"),"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):""},dataSource:function(a,b){return new e(a,b)}}});a.GLOBAL.Store=new f}(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);

@@ -7,5 +7,7 @@ {

"src/core/class.js",
"src/util/Date.js",
"src/util/Queue.js",
"src/util/Async.js",
"src/util/Http.js",
"src/util/QueryString.js",
"src/util/Store.js"

@@ -19,2 +21,3 @@ ],

"src/core/require.js",
"src/util/Date.js",
"src/util/Queue.js",

@@ -24,2 +27,3 @@ "src/util/Logger.js",

"src/util/Http.js",
"src/util/QueryString.js",
"src/util/Store.js"

@@ -26,0 +30,0 @@ ],

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

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

# Zeanium
[简体中文文档](https://github.com/yangyxu/Zeanium-Node/blob/master/README_zh-CN.md)
[英文中文文档](https://github.com/yangyxu/Zeanium/blob/master/README.md)
## Introduction
## 介绍
Zeanium is .
Zeanium是完全面向对象的JavaScript底层框架, 它基于JavaScript语言本身封装, 没有任何前端、后端、第三方库限制, 只要能运行JavaScript的地方就可以运行zeanium核心底层库。你可以自由的使用面向对象的继承、封装、多态等等特性随意定义自己的类和模块。一次编写可以在前端、后端都可以运行。
It's back-end mvc framework, provide integrated solutions.
```js
//define database model
zn.define(function () {
## 顶级内置API接口
//common data model
var model = zn.db.common.model;
//zn.Model is define.
return zn.Model("zn_rights_user", {
mixins: [
model.Base
],
//define property
properties: {
name: {
value: null, //field data value
type: ['varchar', 100], //field data type
default: '' //field default value
},
pwd: {
value: null,
type: ['varchar', 100],
default: ''
},
email: {
value: null,
type: ['varchar', 50],
default: ''
},
phone: {
value: null,
type: ['varchar', 20],
default: ''
},
address: {
value: null,
type: ['varchar', 250],
default: ''
},
avatarImg: {
value: null,
type: ['varchar', 100],
default: ''
},
lastLoginTime: {
value: null,
type: ['datetime'],
format: "date_format({},'%Y-%c-%d %h:%i:%s')",
default: null
}
- `zn.idle()`: 空函数
- `zn.idleArray()`: 返回空数组
- `zn.idleObject()`: 返回空对象
- `zn.format(string, argv...)`: 格式化字符串, 可以是多个参数, 也可以是一个数组参数, 字符串里面用{xx}类似作为占位符, 根据参数索引序列一次替换, 并返回替换好之后的最新字符串。
比如以下代码:
```javascript
1. zn.format('hello {0}, you are {1} year.', 'yangyxu', '2017');
2. zn.format('hello {0}, you are {1} year.', ['yangyxu', '2017']);
```
第一行代码和第二行代码效果是一样的. 输出都是 "hello yangyxu, you are 2017 year."
- `zn.uuid()`: 返回一个uuid字符串值
- `zn.serializeJSON(jsonObject)`: 序列化json数据
- `zn.fix(target, argv...)`: 根据argv补齐target的属性集
- `zn.extend(target, argv...)`: 根据argv只扩展target的属性集
- `zn.overwrite(target, argv...)`: 根据argv值重写target的属性集
- `zn.path(target, path, value)`: 设置或获取对象target属性路径path下的值
- `zn.invoke(target, path, args)`: 执行对象target路径path下的方法, argv作为输入参数
- `zn.deepEachObject(data, handler, context)`: 深度遍历data对象, handler是遍历函数, context是每次遍历的作用域, 并返回一个新的对象;
- `zn.arrayValueToObject(data, handler, context)`: 遍历数组并返回一个对象
- `zn.toString(value)`: 获取value toString的值
- `zn.each(target, callback, context)`: 遍历对象target, callback是遍历函数, context是callback的作用域
- `zn.clone(target)`: 克隆target对象
- `zn.type(target)`: 获取target类型
- `zn.is(target, type)`: 判断对象target的类型是否是type类型
- `zn.may(target, name)`: 判断对象target是否能执行"name"时间
- `zn.can(target, name)`: 判断对象target是否可以执行"name"事件
- `zn.has(target, name)`: 判断对象target是否有"name"属性
- `zn.get(target, name)`: 获取target对象属性为"name"的值
- `zn.set(target, name, value)`: 给target对象设置值
- `zn.gets(target)`: 获取target对象所有属性值
- `zn.sets(target, values)`: 给对象target 批量设置值
## 类
### 定义类
每个类都有 `static`、`statics`、`mixins` 、`properties`、`events`、`methods` 6个关键之;
- `static`: `true` 或 `false`, 默认值是`false`, 值为`true`时, 整个类是静态类, 不允许被实例化, 如果强制实例化, 系统会抛出`TypeError`错误。
- `statics`: 定义类的静态属性和方法
- `mixins`: 继承多类, 常规是继承是单向继承, 只有一个父类, 但是有些需求是需要继承多类的就可以使用mixins关键字, 如:mixins: [User, Person]
- `properties`: 定义类的属性集, 是一个json对象
- `events`: 定义类的事件集, 是一个数组对象 配合对象的on/off使用
- `methods`: 定义类的方法集, 是对象类型。`init` 是每个类唯一指定的构造函数, 每次实例化对象是,如果有init函数则一定会调用。
定义 人 类
```javascript
var Person = zn.Class({
static: false, //默认值是false, 如果是true, 定义类的时候就会执行 init 构造函数
statics: {
count: 1 //定义静态属性,
getCount: function (){ //定义静态方法,
return this._count;
}
});
})
```
```js
//define user controller
zn.define(function () {
//define controller name
return zn.Controller('user',{
methods: {
init: function (args){
//init
this._action = this.action('zn_rights_user');
},
properties: {
name: '', //定义属性名“name”的属性
age: {
value: 10, //value: 属性默认值
get: function (value){ //get: 定义属性get方法
this._age = value; (1)
//zeanium定义类属性时会自动定义“_”+属性名 的内部变量,后续所有操作都是基于内部变量
},
//define login action
login: {
method: 'GET/POST', //action method
argv: { //action argv
username: null,
password: null
},
value: function (request, response, chain){
this._action.selectOne(request.getValue()).then(function (user){
if(user){
request.session.user = user;
response.success(user);
} else {
response.error('Username or password is incorrect.');
}
}, function (error){
response.error(error.message);
});
}
set: function (){ //定义属性set方法
return this._age;
}
}
});
},
methods: {
init: function (name, age){ (2)
//If you new Person Class instance, init method will be call
console.log("I'm constructor function.");
this.name = name;
this.age = age;
//!important: This code will call 'age' set function
},
say: function (){ (3)
console.log('person hello ', this.name);
return 'person hello ' + this.name;
}
}
});
var _count = Person.getCount();
console.log(_count); //print: 1
var person1 = new Person('yangyxu', 20);
person1.name = "xu"; //<1>
person1.set(name, "xu");//<2>
//<1> is the same with <2>
```
```js
//define user Action
zn.define(function () {
1. define any property, the system will generate the `_` + property_name property.
2. `init` is default constructor function, the name is fixed. Call `new Person()`, init constructor function will be called;
3. define `say` customize method.
return zn.Action({
methods: {
getLoginInfo: function (userId){
定义学生类 学生是继承人类
```javascript
var Student = zn.Class(Person, { //inherit Person, the Student Super is Person
properties: {
grade: {
value: 10, //define `age` default value
get: function (value){ //define `age` get method
this._grade = value; (1)
},
set: function (){ //define `age` set method
return this._grade;
}
}
});
},
methods: {
init: function (name, age, grade){ (2)
this.super(name, age); //It will call super Class Person init method
this.sets({
name: name,
age: age,
grade: grade
});
//
},
say: function (){ (3)
this.super(name, age); //It will call super Class Person say method
console.log('student hello ', this.name);
return 'student hello ' + this.name;
}
}
});
```
## Features
var _yangyxu = new Student('yangyxu', 20, 'g1');
_yangyxu.say();
//print:
//person hello yangyxu
//student hello yangyxu
* Fully OOP.
## Installation
```sh
npm install zeanium-node -g
```
## Create Workspace
Define Teacher
```javascript
var Teacher = zn.Class(Person, { //inherit Person, the Student Super is Person
properties: {
id: ''
},
methods: {
init: {
auto: true, // the attr is the same with this.super();
value: function (argv){ (2)
this.sets(argv);
}
},
teach: function (){
return 'teacher name: ' + this.name;
}
}
});
```sh
zn create workspace workspace_demo
var _yangyxu = new Teacher('t1', 20);
_yangyxu.teach();
```
## Create Application
## Define Module
Define module is using AMD.
```sh
zn create app app_demo
```
## Install dependencies
Define zeanium module
```javascript
zn.define([
'node:http' //If module is node module, you have to add "node:" prefix
], function (node_http){ //If load finished, you can use the module.
```sh
npm install
```
return zn.Class({
properties: {
## Start Application
},
methods: {
```sh
npm start or zn
```
}
});
If you start server you will see the detail on console:
```text
2016-08-17 21:12:44.043 [INFO] [ Begin ] Scanning Path:../www/
2016-08-17 21:12:44.051 [INFO] Loading Application: ../www/__zn__
2016-08-17 21:12:44.059 [INFO] Register Project(Application): __zn__
2016-08-17 21:12:44.060 [INFO] [ End ] Scanning Path(Application:1):../www/
2016-08-17 21:12:44.060 [INFO] [ Begin ] Scanning Path:../bin/
2016-08-17 21:12:44.063 [INFO] [ End ] Scanning Path(Application:0):../bin/
2016-08-17 21:12:44.066 [INFO] http://0.0.0.0:8080
2016-08-17 21:12:44.068 [INFO] http://127.0.0.1:8080
2016-08-17 21:12:44.069 [INFO] You can press [ control + c ] to stop current zeanium server.
});
```

@@ -170,2 +203,2 @@

[MIT](https://github.com/yangyxu/Zeanium-Node/blob/master/LICENSE)
[MIT](https://github.com/yangyxu/Zeanium/blob/master/LICENSE)

@@ -8,156 +8,186 @@ # Zeanium

Zeanium-Node is based on Zeanium-Core(https://github.com/yangyxu/Zeanium), it is back-end solution for node.js. Provide `cache`、`database`、`io`、`net`、`parser`、`session`、`template` features.
Zeanium is fully oop javascript framework, you can define Class object、module and soon. It support front-end and back-end in the same api what we provide.
It's back-end mvc framework, provide integrated solutions.
```js
//define database model
zn.define(function () {
## Builtin api list
//common data model
var model = zn.db.common.model;
//zn.Model is define.
return zn.Model("zn_rights_user", {
mixins: [
model.Base
],
//define property
properties: {
name: {
value: null, //field data value
type: ['varchar', 100], //field data type
default: '' //field default value
},
pwd: {
value: null,
type: ['varchar', 100],
default: ''
},
email: {
value: null,
type: ['varchar', 50],
default: ''
},
phone: {
value: null,
type: ['varchar', 20],
default: ''
},
address: {
value: null,
type: ['varchar', 250],
default: ''
},
avatarImg: {
value: null,
type: ['varchar', 100],
default: ''
},
lastLoginTime: {
value: null,
type: ['datetime'],
format: "date_format({},'%Y-%c-%d %h:%i:%s')",
default: null
}
- `zn.idle()`: empty function
- `zn.idleArray()`: return empty array
- `zn.idleObject()`: return empty object;
- `zn.format(string, argv...)`: string is input value, argv is any string arguments. Such as:
```javascript
1. zn.format('hello {0}, you are {1} year.', 'yangyxu', '2017');
2. zn.format('hello {0}, you are {1} year.', ['yangyxu', '2017']);
```
The code 1 is the same with code 2. The output is "hello yangyxu, you are 2017 year."
- `zn.uuid()`: return uuid string value
- `zn.serializeJSON(jsonObject)`: serialize json data
- `zn.fix(target, argv...)`: if target has no key in arguments key, the function will extend object arguments value to target
- `zn.extend(target, argv...)`: the function will extend object arguments value to target
- `zn.overwrite(target, argv...)`: get argv value to overwrite the target value
- `zn.path(target, path, value)`: set or get the value for the path in target
- `zn.invoke(target, path, args)`: args as arguments, invoke the target path function
- `zn.deepEachObject(data, handler, context)`: deep each object, data the input value, handler is each function, context is the scope for each function, the output is object value;
- `zn.arrayValueToObject(data, handler, context)`: the function is the same with zn.deepEachObject, but the data type of input is array;
- `zn.toString(value)`: get string value;
- `zn.each(target, callback, context)`: each target, callback is the each function, context is scope for each function
- `zn.clone(target)`: clone target to a copy
- `zn.type(target)`: get type for target
- `zn.is(target, type)`: judge target type is or not type
- `zn.may(target, name)`: judge target has "name" event
- `zn.can(target, name)`: judge target can exec "name" event
- `zn.has(target, name)`: judge target has "name" property
- `zn.get(target, name)`: get "name" value from target object
- `zn.set(target, name, value)`: set value to target name property
- `zn.gets(target)`: get all properties from target
- `zn.sets(target, values)`: set object to target
## Class
### Define Class
The class has `static`、`statics`、`mixins` 、`properties`、`events`、`methods` five key word;
- `static`: `true` or `false`, default value is `false`, if value is `true`, the class is static class, can't be instantiated. If you new the class, the system will throw `TypeError`.
- `statics`: define class static property or method.
- `mixins`: define Super Class collection.
- `properties`: define class property, value is object.
- `events`: define class event, value is array. `init` is the constructor function for class.
- `methods`: define class method, value is array.
Define Person Class
```javascript
var Person = zn.Class({
static: false, //defalut value is false
statics: {
count: 1 //class static property,
getCount: function (){ //class static method,
return this._count;
}
});
})
```
```js
//define user controller
zn.define(function () {
//define controller name
return zn.Controller('user',{
methods: {
init: function (args){
//init
this._action = this.action('zn_rights_user');
},
properties: {
name: '', //define `name` property, value is ''
age: {
value: 10, //define `age` default value
get: function (value){ //define `age` get method
this._age = value; (1)
},
//define login action
login: {
method: 'GET/POST', //action method
argv: { //action argv
username: null,
password: null
},
value: function (request, response, chain){
this._action.selectOne(request.getValue()).then(function (user){
if(user){
request.session.user = user;
response.success(user);
} else {
response.error('Username or password is incorrect.');
}
}, function (error){
response.error(error.message);
});
}
set: function (){ //define `age` set method
return this._age;
}
}
});
},
methods: {
init: function (name, age){ (2)
//If you new Person Class instance, init method will be call
console.log("I'm constructor function.");
this.name = name;
this.age = age;
//!important: This code will call 'age' set function
},
say: function (){ (3)
console.log('person hello ', this.name);
return 'person hello ' + this.name;
}
}
});
var _count = Person.getCount();
console.log(_count); //print: 1
var person1 = new Person('yangyxu', 20);
person1.name = "xu"; //<1>
person1.set(name, "xu");//<2>
//<1> is the same with <2>
```
```js
//define user Action
zn.define(function () {
1. define any property, the system will generate the `_` + property_name property.
2. `init` is default constructor function, the name is fixed. Call `new Person()`, init constructor function will be called;
3. define `say` customize method.
return zn.Action({
methods: {
getLoginInfo: function (userId){
Define Student
```javascript
var Student = zn.Class(Person, { //inherit Person, the Student Super is Person
properties: {
grade: {
value: 10, //define `age` default value
get: function (value){ //define `age` get method
this._grade = value; (1)
},
set: function (){ //define `age` set method
return this._grade;
}
}
});
},
methods: {
init: function (name, age, grade){ (2)
this.super(name, age); //It will call super Class Person init method
this.sets({
name: name,
age: age,
grade: grade
});
//
},
say: function (){ (3)
this.super(name, age); //It will call super Class Person say method
console.log('student hello ', this.name);
return 'student hello ' + this.name;
}
}
});
```
## Features
var _yangyxu = new Student('yangyxu', 20, 'g1');
_yangyxu.say();
//print:
//person hello yangyxu
//student hello yangyxu
* Fully OOP.
## Installation
```sh
npm install zeanium-node -g
```
## Create Workspace
Define Teacher
```javascript
var Teacher = zn.Class(Person, { //inherit Person, the Student Super is Person
properties: {
id: ''
},
methods: {
init: {
auto: true, // the attr is the same with this.super();
value: function (argv){ (2)
this.sets(argv);
}
},
teach: function (){
return 'teacher name: ' + this.name;
}
}
});
```sh
zn create workspace workspace_demo
var _yangyxu = new Teacher('t1', 20);
_yangyxu.teach();
```
## Create Application
## Define Module
Define module is using AMD.
```sh
zn create app app_demo
```
## Install dependencies
Define zeanium module
```javascript
zn.define([
'node:http' //If module is node module, you have to add "node:" prefix
], function (node_http){ //If load finished, you can use the module.
```sh
npm install
```
return zn.Class({
properties: {
## Start Application
},
methods: {
```sh
npm start or zn
```
}
});
If you start server you will see the detail on console:
```text
2016-08-17 21:12:44.043 [INFO] [ Begin ] Scanning Path:../www/
2016-08-17 21:12:44.051 [INFO] Loading Application: ../www/__zn__
2016-08-17 21:12:44.059 [INFO] Register Project(Application): __zn__
2016-08-17 21:12:44.060 [INFO] [ End ] Scanning Path(Application:1):../www/
2016-08-17 21:12:44.060 [INFO] [ Begin ] Scanning Path:../bin/
2016-08-17 21:12:44.063 [INFO] [ End ] Scanning Path(Application:0):../bin/
2016-08-17 21:12:44.066 [INFO] http://0.0.0.0:8080
2016-08-17 21:12:44.068 [INFO] http://127.0.0.1:8080
2016-08-17 21:12:44.069 [INFO] You can press [ control + c ] to stop current zeanium server.
});
```

@@ -171,2 +201,2 @@

[MIT](https://github.com/yangyxu/Zeanium-Node/blob/master/LICENSE)
[MIT](https://github.com/yangyxu/Zeanium/blob/master/LICENSE)

@@ -24,7 +24,10 @@ /**

}else {
_value = _argv[0].toString();
_value = _argv[0];
_value = _value.toString?_value.toString():_value;
_values = _argv[1];
__builtinZNObject__.each(_values, function (value, index){
value = (__builtinZNObject__.is(value, 'object')?JSON.stringify(value):value.toString());
_value = _value.replace(new RegExp('\\{'+index+'\\}', 'gi'), value);
if(value!==null&&value!==undefined){
value = (__builtinZNObject__.is(value, 'object')?JSON.stringify(value):(value.toString?value.toString():value));
_value = _value.replace(new RegExp('\\{'+index+'\\}', 'gi'), value);
}
});

@@ -31,0 +34,0 @@ }

@@ -103,2 +103,5 @@ /**

try {
if(!Module.all[path]){
return this;
}
path = require.resolve(path);

@@ -191,3 +194,4 @@

} catch (e) {
zn.error('node require() error: ', e.message);
console.error(e);
zn.error('Node.js require('+_path+') error: ', e.message);
} finally {

@@ -194,0 +198,0 @@ _callback(_value);

@@ -192,3 +192,3 @@ (function (zn) {

if(_XHR.readyState<2){
_XHR.withCredentials = true;
//_XHR.withCredentials = true;
}

@@ -195,0 +195,0 @@

@@ -6,78 +6,4 @@ /**

var DATE_FORMAT = {
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"
};
/**
* Date: Date
* @class Date
* @namespace zn.util
**/
var DateUtil = zn.Class('zn.util.DateUtil', {
static: true,
properties: {
},
methods: {
init: function (args){
},
asString: function (date){
var format = DATE_FORMAT.ISO8601;
if (typeof(date) === "string") {
format = arguments[0];
date = arguments[1];
}
var vDay = this.__addZero(date.getDate());
var vMonth = this.__addZero(date.getMonth()+1);
var vYearLong = this.__addZero(date.getFullYear());
var vYearShort = this.__addZero(date.getFullYear().toString().substring(2,4));
var vYear = (format.indexOf("yyyy") > -1 ? vYearLong : vYearShort);
var vHour = this.__addZero(date.getHours());
var vMinute = this.__addZero(date.getMinutes());
var vSecond = this.__addZero(date.getSeconds());
var vMillisecond = this.__padWithZeros(date.getMilliseconds(), 3);
var vTimeZone = this.__offset(date);
var formatted = format
.replace(/dd/g, vDay)
.replace(/MM/g, vMonth)
.replace(/y{1,4}/g, vYear)
.replace(/hh/g, vHour)
.replace(/mm/g, vMinute)
.replace(/ss/g, vSecond)
.replace(/SSS/g, vMillisecond)
.replace(/O/g, vTimeZone);
return formatted;
},
__padWithZeros: function (vNumber, width){
var numAsString = vNumber + "";
while (numAsString.length < width) {
numAsString = "0" + numAsString;
}
return numAsString;
},
__addZero: function(vNumber){
return this.__padWithZeros(vNumber, 2);
},
__offset: function (date){
// Difference to Greenwich time (GMT) in hours
var os = Math.abs(date.getTimezoneOffset());
var h = String(Math.floor(os/60));
var m = String(os%60);
if (h.length == 1) {
h = "0" + h;
}
if (m.length == 1) {
m = "0" + m;
}
return date.getTimezoneOffset() < 0 ? "+"+h+m : "-"+h+m;
}
}
});
var TYPES = ['INFO', 'DEBUG', 'WARNING', 'ERROR', 'TRACE', '', 'INIT'];
var COLORS_VALUE = ['#100000', '#2125a0', '#a82c2c', '#c045b7', '1cb131', '', '#100000'];
var TYPES = ['INFO', 'DEBUG', 'WARN', 'ERROR', 'TRACE', 'ALL'];
var COLORS_VALUE = ['#100000', '#2125a0', '#a82c2c', '#c045b7', '1cb131', '#100000'];
var COLORS = [38, 34, 35, 31, 32, 36, 33];

@@ -87,6 +13,6 @@ var LEVELS = {

DEBUG: 1,
WARNING: 2,
WARN: 2,
ERROR: 3,
TRACE: 4,
INIT: 6
ALL: 6
};

@@ -100,4 +26,20 @@

var Logger = zn.Class({
static: true,
events: [
'info',
'debug',
'warn',
'error',
'trace',
'all'
],
methods: {
init: function (){
this._config = {
only: null,
levels: ['info', 'debug', 'warn', 'error', 'trace', 'all']
};
},
config: function (value){
this._config = zn.overwrite(value, this._config);
},
info: function () {

@@ -110,3 +52,3 @@ this.__log.call(this, LEVELS.INFO, arguments);

warn: function () {
this.__log.call(this, LEVELS.WARNING, arguments);
this.__log.call(this, LEVELS.WARN, arguments);
},

@@ -119,4 +61,7 @@ trace: function () {

},
all: function (obj) {
this.__log.call(this, LEVELS.ALL, arguments);
},
__getDateString: function (date) {
return DateUtil.asString(date||new Date());
return zn.date.asString(date||new Date());
},

@@ -180,8 +125,16 @@ __getPosition: function (){

__log: function (type, argv) {
var _argv = Array.prototype.slice.call(argv);
var _argv = Array.prototype.slice.call(argv),
_data = _argv.slice(0),
_type = TYPES[type].toLowerCase(),
_time = this.__getDateString(),
_pos = this.__getPosition();
_data.unshift(_pos);
_data.unshift(_type);
_data.unshift(_time);
if (typeof module !== 'undefined' && module.exports){
_argv.unshift(this.__formatLog4Server({
type: type,
time: this.__getDateString(),
pos: this.__getPosition()
time: _time,
pos: _pos
}, true));

@@ -191,10 +144,28 @@ }else {

type: type,
time: this.__getDateString(),
pos: this.__getPosition()
time: _time,
pos: _pos
}, true));
_argv.unshift('color:' + COLORS_VALUE[type]);
}
_argv.unshift('color:'+COLORS_VALUE[type]);
if(this.__isOk(_type)){
var _result = this.fire(_type, _data);
if(_result !== false){
console.log.apply(this, _argv);
}
}
},
__isOk: function (type){
if(this._config.only){
if(this._config.only === type){
return true;
}
}else {
var _include = (this._config.levels.indexOf(type) !== -1 );
if(_include){
return true;
}
}
console.log.apply(this, _argv);
return false;
}

@@ -204,18 +175,20 @@ }

zn.logger = new Logger();
var __console = {
info: function (){
Logger.info.apply(Logger, arguments);
zn.logger.info.apply(zn.logger, arguments);
},
debug: function (){
Logger.debug.apply(Logger, arguments);
zn.logger.debug.apply(zn.logger, arguments);
},
warn: function (){
Logger.warn.apply(Logger, arguments);
zn.logger.warn.apply(zn.logger, arguments);
},
trace: function (){
Logger.trace.apply(Logger, arguments);
zn.logger.trace.apply(zn.logger, arguments);
},
error: function (){
Logger.error.apply(Logger, arguments);
},
zn.logger.error.apply(zn.logger, arguments);
}
};

@@ -222,0 +195,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