diff --git a/avalon.js b/avalon.js index 2e1b5a90a..b639cb565 100644 --- a/avalon.js +++ b/avalon.js @@ -5,7 +5,7 @@ http://weibo.com/jslouvre/ Released under the MIT license - avalon.js 1.5.3 built in 2015.10.4 + avalon.js 1.5.3 built in 2015.10.9 support IE6+ and other browsers ==================================================*/ (function(global, factory) { @@ -1128,7 +1128,7 @@ function observeObject(source, options) { options = options || nullObject var force = options.force || nullObject var old = options.old - var oldAccessors = typeof old === "object" ? old.$accessors : nullObject + var oldAccessors = old && old.$accessors || nullObject var $vmodel = new Component() //要返回的对象, 它在IE6-8下可能被偷龙转凤 var accessors = {} //监控属性 var hasOwn = {} @@ -3316,10 +3316,10 @@ function scanExpr(str) { } function scanText(textNode, vmodels, index) { - var bindings = [] + var bindings = [], tokens = scanExpr(textNode.data) if (tokens.length) { - for (var i = 0; token = tokens[i++];) { + for (var i = 0, token; token = tokens[i++];) { var node = DOC.createTextNode(token.expr) //将文本转换为文本节点,并替换原来的文本节点 if (token.type) { token.expr = token.expr.replace(roneTime, function () { diff --git a/dist/avalon.js b/dist/avalon.js index 2e1b5a90a..b639cb565 100644 --- a/dist/avalon.js +++ b/dist/avalon.js @@ -5,7 +5,7 @@ http://weibo.com/jslouvre/ Released under the MIT license - avalon.js 1.5.3 built in 2015.10.4 + avalon.js 1.5.3 built in 2015.10.9 support IE6+ and other browsers ==================================================*/ (function(global, factory) { @@ -1128,7 +1128,7 @@ function observeObject(source, options) { options = options || nullObject var force = options.force || nullObject var old = options.old - var oldAccessors = typeof old === "object" ? old.$accessors : nullObject + var oldAccessors = old && old.$accessors || nullObject var $vmodel = new Component() //要返回的对象, 它在IE6-8下可能被偷龙转凤 var accessors = {} //监控属性 var hasOwn = {} @@ -3316,10 +3316,10 @@ function scanExpr(str) { } function scanText(textNode, vmodels, index) { - var bindings = [] + var bindings = [], tokens = scanExpr(textNode.data) if (tokens.length) { - for (var i = 0; token = tokens[i++];) { + for (var i = 0, token; token = tokens[i++];) { var node = DOC.createTextNode(token.expr) //将文本转换为文本节点,并替换原来的文本节点 if (token.type) { token.expr = token.expr.replace(roneTime, function () { diff --git a/dist/avalon.min.js b/dist/avalon.min.js index d34baf7b2..978db0e63 100644 --- a/dist/avalon.min.js +++ b/dist/avalon.min.js @@ -1,3 +1,3 @@ -!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("Avalon requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(){e.console&&avalon.config.debug&&Function.apply.call(console.log,console,arguments)}function r(e){return Function.apply(i,e)}function i(){}function o(e,t){"string"==typeof e&&(e=e.match(Qt)||[]);for(var n={},r=void 0!==t?t:1,a=0,i=e.length;i>a;a++)n[e[a]]=r;return n}function l(){if(e.VBArray){var t=document.documentMode;return t?t:e.XMLHttpRequest?7:6}return 0/0}function s(e){return nn.test(on.call(e))}function c(e,t){return e=Math.floor(e)||0,0>e?Math.max(t+e,0):Math.min(e,t)}function u(e){if(!e)return!1;var t=e.length;if(t===t>>>0){var n=on.call(e).slice(8,-1);if(/(?:regexp|string|function|window|global)$/i.test(n))return!1;if("Array"===n)return!0;try{return{}.propertyIsEnumerable.call(e,"length")===!1?/^\s?function/.test(e.item||e.callee):!0}catch(r){return!e.window}}return!1}function f(e,t,n){var r="for(var "+e+"i=0,n = this.length; i < n; i++){"+t.replace("_","((i in this) && fn.call(scope,this[i],i,this))")+"}"+n;return Function("fn,scope",r)}function p(e,t){try{for(;t=t.parentNode;)if(t===e)return!0;return!1}catch(n){return!1}}function d(){return(new XMLSerializer).serializeToString(this)}function v(e,t){if(e&&e.childNodes)for(var n,r=e.childNodes,a=0;n=r[a++];)if(n.tagName){var i=Ut.createElementNS(An,n.tagName.toLowerCase());ln.forEach.call(n.attributes,function(e){i.setAttribute(e.name,e.value)}),v(n,i),t.appendChild(i)}}function h(e){var t={};for(var n in e)t[n]=e[n];var r=t.target=e.srcElement;if(0===e.type.indexOf("key"))t.which=null!=e.charCode?e.charCode:e.keyCode;else if(On.test(e.type)){var a=r.ownerDocument||Ut,i="BackCompat"===a.compatMode?a.body:a.documentElement;t.pageX=e.clientX+(i.scrollLeft>>0)-(i.clientLeft>>0),t.pageY=e.clientY+(i.scrollTop>>0)-(i.clientTop>>0),t.wheelDeltaY=t.wheelDelta,t.wheelDeltaX=0}return t.timeStamp=new Date-0,t.originalEvent=e,t.preventDefault=function(){e.returnValue=!1},t.stopPropagation=function(){e.cancelBubble=!0},t}function m(e){for(var t in e)if(an.call(e,t)){var n=e[t];"function"==typeof m.plugins[t]?m.plugins[t](n):"object"==typeof m[t]?avalon.mix(m[t],n):m[t]=n}return this}function g(e){return(e+"").replace(Rn,"\\$&")}function y(e,t){var n=this.$events||(this.$events={}),r=n[e]||(n[e]=[]);if("function"==typeof t){var a=t;a.uniqueNumber=Math.random(),t={element:un,type:"user-watcher",handler:i,vmodels:[this],expr:e,uniqueNumber:a.uniqueNumber},t.wildcard=/\*/.test(e)}if(t.update)t.oneTime||avalon.Array.ensure(r,t);else{if(/\w\.*\B/.test(e)){t.getter=i;var o=this;t.update=function(){var e=this.fireArgs||[];e[2]&&t.handler.apply(o,e),delete this.fireArgs},r.sync=!0,avalon.Array.ensure(r,t)}else avalon.injectBinding(t);a&&(t.handler=a)}return function(){t.update=t.getter=t.handler=i,t.element=Ut.createElement("a")}}function b(e,t){var n=this.$events;if(n&&n[e]){t&&(t[2]=e),$(n[e],t);var r=this.$up;r&&(this.$pathname&&b.call(r,this.$pathname+"."+e,t),b.call(r,"*."+e,t))}else if(r=this.$up){var a=this.$pathname+"."+e,i=a.split(".");-1===i.indexOf("*")?(b.call(r,a,t),i[1]="*",b.call(r,i.join("."),t)):b.call(r,a,t)}}function x(e,t){for(;;){if(e.$watch){var n=e.$events||(e.$events={}),r=n[t]||(n[t]=[]);return void er.collectDependency(r)}if(e=e.$up,!e)break;t=e.$pathname+"."+t}}function $(e,t){if(e){new Date-rr>444&&"object"==typeof e[0]&&R();for(var n,r=[],a=[],i=0;n=e[i++];)"user-watcher"===n.type?r.push(n):a.push(n);if(m.async){for(pa.render(),i=0;n=a[i++];)if(n.update){var o=P(n);pa.queue[o]||(pa.queue[o]=1,pa.queue.push(n))}}else for(i=0;n=a[i++];)n.update&&n.update();for(i=0;n=r[i++];)(t&&t[2]===n.expr||n.wildcard)&&(n.fireArgs=t),n.update()}}function w(e,t){return t=t||{},t.watch=!0,k(e,t)}function C(){}function k(e,t){function r(e){return u[e]===!0}if(!e||e.$id&&e.$accessors)return e;t=t||Kt;var a=t.force||Kt,i=t.old,l="object"==typeof i?i.$accessors:Kt,s=new C,c={},u={},f=[],p=[],d={};e.$skipArray&&(d=o(e.$skipArray),delete e.$skipArray);var v=e.$computed;if(v){delete e.$computed;for(var h in v)u[h]=!0,function(e,t){var n;c[e]={get:function(){return n=t.get.call(this)},set:function(r){if("function"==typeof t.set){var a=n;t.set.call(this,r);var i=this[e];this.$fire&&i!==a&&this.$fire(e,i,a)}},enumerable:!0,configurable:!0}}(h,v[h])}for(h in e){var m=e[h];In[h]||(u[h]=!0),"function"==typeof m||m&&m.nodeType||!a[h]&&("$"===h.charAt(0)||In[h]||d[h])?f.push(h):N(m)?(n("warning:计算属性建议放在$computed对象中统一定义"),function(e,t){var n;c[e]={get:function(){return n=t.get.call(this)},set:function(r){if("function"==typeof t.set){var a=n;t.set.call(this,r);var i=this[e];this.$fire&&i!==a&&this.$fire(e,i,a)}},enumerable:!0,configurable:!0}}(h,m)):(p.push(h),c[h]=l[h]?l[h]:T(h,m))}c.$model=Yn,s=zn(s,c,e),f.forEach(function(t){s[t]=e[t]}),_(s,"$id","anonymous"),_(s,"$up",i?i.$up:null),_(s,"$track",Object.keys(u)),_(s,"$active",!1),_(s,"$pathname",i?i.$pathname:""),_(s,"$accessors",c),_(s,"hasOwnProperty",r),t.watch&&(_(s,"$watch",function(){return y.apply(s,arguments)}),_(s,"$fire",function(e,t){if(0===e.indexOf("all!")){var n=e.slice(4);for(var r in avalon.vmodels){var a=avalon.vmodels[r];a.$fire&&a.$fire.apply(a,[n,t])}}else b.call(s,e,[t])})),p.forEach(function(t){var n=s[t]=e[t];n&&"object"==typeof n&&(n.$up=s,n.$pathname=t),b.call(s,t)});for(h in v)m=s[h];return s.$active=!0,s}function N(e){if(e&&"object"==typeof e){for(var t in e)if("get"!==t&&"set"!==t)return!1;return"function"==typeof e.get}}function T(e,t){var n;return t=0/0,{get:function(){return this.$active&&x(this,e),t},set:function(r){if(t!==r){var a=t;n=E(r,t),n?t=n:(n=void 0,t=r),Object(n)===n&&(n.$pathname=e,n.$up=this),this.$active&&b.call(this,e,[t,a])}},enumerable:!0,configurable:!0}}function E(e,t,n,r){if(Array.isArray(e))return A(e,t,r);if(avalon.isPlainObject(e)){if(t){var a=Xn(e),i=Xn(t);if(a.join(";")===i.join(";")){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);return t}t.$active=!1}return k(e,{old:t,watch:r})}return n?e:void 0}function A(e,t,n){if(t){var r=[0,t.length].concat(e);return t.splice.apply(t,r),t}for(var a in Kn)e[a]=Kn[a];_(e,"$up",null),_(e,"$pathname",""),_(e,"$track",j(e.length)),e._=k({length:0/0},{watch:!0}),e._.length=e.length,e._.$watch("length",function(t,n){b.call(e.$up,e.$pathname+".length",[t,n])}),n&&_(e,"$watch",function(){return y.apply(e,arguments)}),cn?Object.defineProperty(e,"$model",Yn):e.$model=O(e);for(var i=0,o=e.length;o>i;i++){var l=e[i]=E(e[i],0,1,1);Object(l)===l&&(l.$up=e)}return e}function _(e,t,n){Un?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!1,configurable:!0}):e[t]=n}function O(e){var t=avalon.type(e);if("array"===t){for(var n=[],r=0;rr;r++){n[r]=e[r];var i=t[r];i in n?(e[r]=n[i],delete n[i]):e[r]=e[i]}}function j(e){for(var t=[],n=0;e>n;n++)t[n]=vn("$proxy$each");return t}function L(e,t,n){switch(t){case"push":case"unshift":n=j(n.length);break;case"splice":if(n.length>2){{n[1],n.length-2}n=[n[0],n[1]].concat(j(n.length-2))}}Array.prototype[t].apply(e,n)}function D(e,t){t.oneTime||e&&avalon.Array.ensure(e,t)&&t.element&&(F(t,e),new Date-rr>444&&R())}function H(e,t){for(var n,r=[],a=0;n=e[a++];)r.push(t?n.$id:n.$key);return r.join(";")}function P(e){if(!e.uniqueNumber){var t=e.element;e.uniqueNumber=t?1!==t.nodeType?e.type+(e.pos||0)+"-"+P(t.parentNode):e.name+"-"+P(t):++tr}return e.uniqueNumber}function F(e,t){var n=e.lists||(e.lists=[]),r=P(e);avalon.Array.ensure(n,t),t.$uuid=t.$uuid||vn(),nr[r]||(nr[r]=1,nr.push(e))}function R(e){for(var t=nr.length,n=t,r=[],a={},i={};e=nr[--t];){var o=e.type;i[o]?i[o]++:(i[o]=1,r.push(o))}var l=!1;if(r.forEach(function(e){ar[e]!==i[e]&&(a[e]=1,l=!0)}),t=n,l)for(;e=nr[--t];)if(null!==e.element){if(a[e.type]&&q(e.element)){nr.splice(t,1),delete nr[e.uniqueNumber];for(var s,c=e.lists,u=0;s=c[u++];)avalon.Array.remove(c,s),avalon.Array.remove(s,e);B(e)}}else nr.splice(t,1);ar=i,rr=new Date}function B(e){delete nr[e.uniqueNumber],e.element=null,e.rollback&&e.rollback();for(var t in e)e[t]=null}function q(e){try{{e.parentNode.nodeType}}catch(t){return!0}return e.ifRemove&&!un.contains(e.ifRemove)&&Wt===e.parentNode?(e.parentNode&&e.parentNode.removeChild(e),!0):e.msRetain?0:1===e.nodeType?!un.contains(e):!avalon.contains(un,e)}function I(e){var t=e.nodeName;return t.toLowerCase()===t&&e.scopeName&&""===e.outerText}function V(e){"url(#default#VML)"!==e.currentStyle.behavior&&(e.style.behavior="url(#default#VML)",e.style.display="inline-block",e.style.zoom=1)}function U(e){return e.replace(/([a-z\d])([A-Z]+)/g,"$1-$2").toLowerCase()}function z(e){return!e||e.indexOf("-")<0&&e.indexOf("_")<0?e:e.replace(/[-_][^-_]/g,function(e){return e.charAt(1).toUpperCase()})}function W(e){if(!("classList"in e)){e.classList={node:e};for(var t in dr)e.classList[t.slice(1)]=dr[t]}return e.classList}function X(e){try{if("object"==typeof e)return e;e="true"===e?!0:"false"===e?!1:"null"===e?null:+e+""===e?+e:vr.test(e)?avalon.parseJSON(e):e}catch(t){}return e}function Y(e){return e.window&&e.document?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}function G(e,t){if(e.offsetWidth<=0){if(_r.test(br["@:get"](e,"display"))){var n={node:e};for(var r in Ar)n[r]=e.style[r],e.style[r]=Ar[r];t.push(n)}var a=e.parentNode;a&&1===a.nodeType&&G(a,t)}}function J(e){var t=e.tagName.toLowerCase();return"input"===t&&/checkbox|radio/.test(e.type)?"checked":t}function Z(e,t){var n=[],a=!!t;t=t||0;for(var i="unknown",o="",l=0;lu;u++)if(i.length){var p="vm"+o+"_"+u;s.push(p),c.push(t[u]),l.push.apply(l,Q(i,t[u],p,n))}n.args=c;var d=n.type,v=t.map(function(e){return String(e.$id).replace(Hr,"$1")})+e+d,h=Fr.get(v);if(h){if("duplex"===d){var m=Fr.get(v+"setter");n.setter=m.apply(m,n.args)}return n.getter=h}if(l.length||l.push("fix"+o),"duplex"===d){var g={};l.forEach(function(e){var t=e.split("=");g[t[0].trim()]=t[1].trim()}),e=e.replace(/[\$\w]+/,function(e){return g[e]?g[e]:e});var y=r(s.concat("'use strict';return function(vvv){"+e+" = vvv\n}\n"));Fr.put(v+"setter",y),n.setter=y.apply(y,n.args)}if("on"===d){-1===e.indexOf("(")?e+=".call(this, $event)":e=e.replace("(",".call(this,"),s.push("$event"),e="\nreturn "+e+";";var b=e.lastIndexOf("\nreturn"),x=e.slice(0,b),$=e.slice(b);e=x+"\n"+$}else e="\nreturn "+e+";";return h=r(s.concat("'use strict';\nvar "+l.join(",\n")+e)),Fr.put(v,h)}function nt(e){var t=Hn.test(e);if(t){var n=vt(e);return 1===n.length?n[0].expr:n.map(function(e){return e.type?"("+e.expr+")":zr(e.expr)}).join(" + ")}return e}function rt(e){return e=e.replace(Rr,"").replace(Br,function(){return"],|"}).replace(qr,function(e,t){return"["+zr(t)}).replace(Ir,function(){return'"],["'}).replace(Vr,function(){return'",'})+"]",r(["return ["+e+"]"])()}function at(e,t,n){var r=setTimeout(function(){var a=e.innerHTML;clearTimeout(r),a===n?t():at(e,t,a)})}function it(e,t){var n=e.getAttribute("avalonctrl")||t.$id;e.setAttribute("avalonctrl",n),t.$events&&(t.$events.expr=e.tagName+'[avalonctrl="'+n+'"]')}function ot(e,t){for(var n,r=0;n=e[r++];)n.vmodels=t,$n[n.type].init(n),avalon.injectBinding(n),n.getter&&1===n.element.nodeType&&n.element.removeAttribute(n.name);e.length=0}function lt(e,t){return e.priority-t.priority}function st(e,t,r){var a=!0;if(t.length){for(var i,o=oa?oa(e):e.attributes,l=[],s={},c=0;i=o[c++];){var u=i.name;if(!s[u]&&(s[u]=1,i.specified&&(r=u.match(Jr)))){var f=r[1],p=r[2]||"",d=i.value;if(Zr[f]?(p=f,f="on"):Kr[f]&&(p=f,f="attr",u="ms-"+f+"-"+p,n("warning!请改用"+u+"代替"+i.name+"!")),$n[f]){var v=d.replace(Gr,""),h=d!==v,m={type:f,param:p,element:e,name:u,expr:v,oneTime:h,uniqueNumber:i.name+"-"+P(e),priority:($n[f].priority||10*f.charCodeAt(0))+(Number(p.replace(/\D/g,""))||0)};if("html"===f||"text"===f){var g=dt(d).filters;m.expr=m.expr.replace(g,""),m.filters=g.replace(sa,function(){return m.type="html",m.group=1,""}).trim()}else if("duplex"===f)var y=u;else if("ms-if-loop"===u)m.priority+=100;else if("ms-attr-value"===u)var b=u;l.push(m)}}}if(l.length){for(l.sort(lt),y&&b&&"INPUT"===e.nodeName&&"text"===e.type&&n("warning!一个控件不能同时定义ms-attr-value与"+y),c=0;m=l[c];c++){if(f=m.type,Qr.test(f))return ot(l.slice(0,c+1),t);a&&(a=!ea.test(f))}ot(l,t)}}a&&!Wr[e.tagName]&&(gt(e)?e.msResolved:1)&&(Yr&&Yr(e),ut(e,t))}function ct(e){for(var t,n=oa?oa(e):e.attributes,r={},a=0;t=n[a++];)t.specified&&!la.test(t.name)&&(r[z(t.name)]=X(t.value));return r}function ut(e,t){var n=avalon.slice(e.childNodes);ft(n,t)}function ft(e,t){for(var n,r=0;n=e[r++];)switch(n.nodeType){case 1:var a=n;if(pt(n,t),!a.msResolved&&a.parentNode&&1===a.parentNode.nodeType){var i=gt(a);if(i){var o=a.localName?a.localName.replace(i+":",""):a.nodeName,l=i+":"+z(o);da.push({library:i,element:a,fullName:l,widget:o,vmodels:t,name:"widget"}),avalon.components[l]&&avalon.component(l)}}n.msHasEvent&&avalon.fireDom(n,"datasetchanged",{bubble:n.msHasEvent});break;case 3:Hn.test(n.nodeValue)&&ht(n,t,r)}}function pt(e,t,r){var a=e.getAttribute("ms-skip");if(!e.getAttributeNode)return n("warning "+e.tagName+" no getAttributeNode method");var i=e.getAttributeNode("ms-important"),o=e.getAttributeNode("ms-controller");if("string"!=typeof a){if(r=i||o){var l=avalon.vmodels[r.value];if(!l)return;t=r===i?[l]:[l].concat(t);var s=r.name;e.removeAttribute(s),avalon(e).removeClass(s),it(e,l)}st(e,t)}}function dt(e){if(e.indexOf("|")>0){var t=e.replace(ua,function(e){return Array(e.length+1).join("1")}),n=t.replace(ca,"ᄢ㍄").indexOf("|");if(n>-1)return{type:"text",filters:e.slice(n).trim(),expr:e.slice(0,n)}}return{type:"text",expr:e,filters:""}}function vt(e){for(var t,n,r=[],a=0;;){if(n=e.indexOf(Ln,a),-1===n)break;if(t=e.slice(a,n),t&&r.push({expr:t}),a=n+Ln.length,n=e.indexOf(Dn,a),-1===n)break;t=e.slice(a,n),t&&r.push(dt(t,a)),a=n+Dn.length}return t=e.slice(a),t&&r.push({expr:t}),r}function ht(e,t,n){var r=[];if(tokens=vt(e.data),tokens.length){for(var a=0;token=tokens[a++];){var i=Ut.createTextNode(token.expr);token.type&&(token.expr=token.expr.replace(Gr,function(){return token.oneTime=!0,""}),token.element=i,token.filters=token.filters.replace(sa,function(){return token.type="html",""}),token.pos=1e3*n+a,r.push(token)),fn.appendChild(i)}e.parentNode.replaceChild(fn,e),r.length&&ot(r,t)}}function mt(e,t){if(t)for(var n,r=0;n=e[r++];)if(n.hasOwnProperty(t)&&"object"==typeof n[t]){var a=n[t];return a.$model||a}return{}}function gt(e){if(e.scopeName&&"HTML"!==e.scopeName)return e.scopeName;var t=e.nodeName.toLowerCase(),n=t.indexOf(":");return n>0?t.slice(0,n):void 0}function yt(e){return null==e?"":e}function bt(e,t,n){return t.param.replace(en,function(r){var a=avalon.duplexHooks[r];a&&"function"==typeof a[n]&&(e=a[n](e,t))}),e}function xt(){for(var e=ka.length-1;e>=0;e--){var t=ka[e];t()===!1&&ka.splice(e,1)}ka.length||clearInterval(Ca)}function $t(e,t){if(!e||1!==e.nodeType)return null;if(t)var n=t.effectName,r=t.effectDriver;else n=e.getAttribute("data-effect-name"),r=e.getAttribute("data-effect-driver");if(!n||!r)return null;var a=Ma.pop()||new kt;return a.el=e,a.driver=r,a.useCss="j"!==r,a.useCss&&(t&&avalon(e).addClass(t.effectClass),a.cssEvent="t"===r?Ta:Ea),a.name=n,a.callbacks=avalon.effects[n]||{},a}function wt(e,t){var n=e.getAttribute("data-effect-name");if(n){t.effectName=n,t.effectDriver=e.getAttribute("data-effect-driver");var r=+e.getAttribute("data-effect-stagger");t.effectLeaveStagger=+e.getAttribute("data-effect-leave-stagger")||r,t.effectEnterStagger=+e.getAttribute("data-effect-enter-stagger")||r,t.effectClass=e.className||0/0}}function Ct(e){return e.replace(/^[\S]/g,function(e){return e.toUpperCase()})}function kt(){}function Nt(e,t){var n=e.callbacks[t+"Class"];return"string"==typeof n?n:"function"==typeof n?n():e.name+"-"+t}function Tt(e,t,n){var r=e.callbacks[t];r&&r.call(e,e.el,n)}function Et(e,t,n){var r=e.templateCache&&e.templateCache[t];if(r){for(var a,i=Ut.createDocumentFragment();a=r.firstChild;)i.appendChild(a);return i}return avalon.parseHTML(n)}function At(e){for(var t=Ut.createDocumentFragment(),n=0,r=e.length;r>n;n++)t.appendChild(e[n]);return t}function _t(e,t,n){for(var r,a=0;r=e[a++];)r.className===n.effectClass&&avalon.effect.apply(r,t,i,i,n)}function Ot(e,t,n){return e?setTimeout(t,++n*e):t(),n}function St(e,t){for(var n=fn.cloneNode(!1),r=e,a=r.nodeValue,o=t&&Math.max(+t.staggerIndex,0),l=avalon.slice(r.parentNode.childNodes),s=l.indexOf(r);;){var c=l[--s];if(!c||0===String(c.nodeValue).indexOf(a))break;t&&c.className===t.effectClass?(e=c,function(e){t.staggerIndex=Ot(t.effectLeaveStagger,function(){avalon.effect.apply(e,0,i,function(){n.appendChild(e)},t)},o)}(c)):n.insertBefore(c,n.firstChild)}return n.appendChild(r),n}function Mt(e,t,n,r,a){var i=e.template.cloneNode(!0),o=avalon.slice(i.childNodes);i.appendChild(n.$anchor),a&&t.appendChild(i);var l=[n].concat(e.vmodels),s={nodes:o,vmodels:l,content:i};r.push(s)}function jt(e){var t="object"===e.xtype?Pt:Lt,n=t(e),r=n.$anchor||(n.$anchor=e.element.cloneNode(!1));return r.nodeValue=e.signature,n.$outer=e.$outer,n}function Lt(e,t){for(var n=e.param||"el",r=0,a=qa.length;a>r;r++){var i=qa[r];if(i&&i.hasOwnProperty(n)){qa.splice(r,1),t=i;break}}return t||(t=Dt(n)),t}function Dt(e){var t={$outer:{},$index:0,$oldIndex:0,$anchor:null,$first:!1,$last:!1,$remove:avalon.noop};t[e]=0/0;var n={$last:1,$first:1,$index:1};n[e]=1;var r=w(t,{force:n});return r.$id=vn("$proxy$each"),r}function Ht(e,t,n){if("array"===n){e.$remove=function(){t.$repeat.removeAt(e.$index)};var r=t.param;e.$watch(r,function(n){var r=e.$index;t.$repeat[r]=n})}else e.$watch("$val",function(n){t.$repeat[e.$key]=n})}function Pt(){return Ia.pop()||Ft()}function Ft(){var e=w({$key:"",$val:0/0,$index:0,$oldIndex:0,$outer:{},$anchor:null},{force:{$key:1,$val:1,$index:1}});return e.$id=vn("$proxy$with"),e}function Rt(e,t,n){var r=e[t];if(r){var a=0===r.$id.indexOf("$proxy$each")?qa:Ia;r.$outer={};for(var i in r.$events){var o=r.$events[i];Array.isArray(o)&&(o.length=0,i===n?r[n]=0/0:"$val"===i&&(r.$val=0/0))}a.unshift(r)>m.maxRepeatSize&&a.pop(),delete e[t]}}function Bt(e,t){var n="_"+e;if(!Bt[n]){var r=Ut.createElement(e);un.appendChild(r),t=cn?getComputedStyle(r,null).display:r.currentStyle.display,un.removeChild(r),Bt[n]=t}return Bt[n]}function qt(e,t,n,r){e=(e+"").replace(/[^0-9+\-Ee.]/g,"");var a=isFinite(+e)?+e:0,i=isFinite(+t)?Math.abs(t):3,o=r||",",l=n||".",s="",c=function(e,t){var n=Math.pow(10,t);return""+(Math.round(e*n)/n).toFixed(t)};return s=(i?c(a,i):""+Math.round(a)).split("."),s[0].length>3&&(s[0]=s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,o)),(s[1]||"").length.avalonHide{ display: none!important }",Wt.setAttribute("ms-skip","1"),Wt.className="avalonHide";var Xt,Yt=/\[native code\]/,Gt="$"+Vt,Jt=e.require,Zt=e.define,Kt={},Qt=/[^, ]+/g,en=/\w+/g,tn=/^\[object SVG\w*Element\]$/,nn=/^\[object (?:Window|DOMWindow|global)\]$/,rn=Object.prototype,an=rn.hasOwnProperty,on=rn.toString,ln=Array.prototype,sn=ln.slice,cn=e.dispatchEvent,un=Ut.documentElement,fn=Ut.createDocumentFragment(),pn=Ut.createElement("div"),dn={};"Boolean Number String Function Array Date RegExp Object Error".replace(Qt,function(e){dn["[object "+e+"]"]=e.toLowerCase()});var vn=function(e){return e=e||"avalon",String(Math.random()+Math.random()).replace(/\d\.\d{4}/,e)},hn=l();avalon=function(e){return new avalon.init(e)},avalon.nextTick=new function(){function t(){for(var e=a.length,t=0;e>t;t++)a[t]();a=a.slice(e)}var n=e.setImmediate,r=e.MutationObserver;if(n)return n.bind(e);var a=[];if(r){var i=document.createTextNode("avalon");new r(t).observe(i,{characterData:!0});var o=!1;return function(e){a.push(e),o=!o,i.data=o}}return function(e){setTimeout(e,4)}},avalon.init=function(e){this[0]=this.element=e},avalon.fn=avalon.prototype=avalon.init.prototype,avalon.type=function(e){return null==e?String(e):"object"==typeof e||"function"==typeof e?dn[on.call(e)]||"object":typeof e};var mn="object"==typeof alert?function(e){try{return/^\s*\bfunction\b/.test(e+"")}catch(t){return!1}}:function(e){return"[object Function]"===on.call(e)};avalon.isFunction=mn,avalon.isWindow=function(e){return e?e==e.document&&e.document!=e:!1},s(e)&&(avalon.isWindow=s);var gn;for(gn in avalon({}))break;var yn="0"!==gn;avalon.isPlainObject=function(e,t){if(!e||"object"!==avalon.type(e)||e.nodeType||avalon.isWindow(e))return!1;try{if(e.constructor&&!an.call(e,"constructor")&&!an.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}if(yn)for(t in e)return an.call(e,t);for(t in e);return void 0===t||an.call(e,t)},Yt.test(Object.getPrototypeOf)&&(avalon.isPlainObject=function(e){return"[object Object]"===on.call(e)&&Object.getPrototypeOf(e)===rn}),avalon.mix=avalon.fn.mix=function(){var e,t,n,r,a,i,o=arguments[0]||{},l=1,s=arguments.length,c=!1;for("boolean"==typeof o&&(c=o,o=arguments[1]||{},l++),"object"==typeof o||mn(o)||(o={}),l===s&&(o=this,l--);s>l;l++)if(null!=(e=arguments[l]))for(t in e){n=o[t];try{r=e[t]}catch(u){continue}o!==r&&(c&&r&&(avalon.isPlainObject(r)||(a=Array.isArray(r)))?(a?(a=!1,i=n&&Array.isArray(n)?n:[]):i=n&&avalon.isPlainObject(n)?n:{},o[t]=avalon.mix(c,i,r)):void 0!==r&&(o[t]=r))}return o},avalon.mix({rword:Qt,subscribers:Gt,version:1.53,ui:{},log:n,slice:cn?function(e,t,n){return sn.call(e,t,n)}:function(e,t,n){var r=[],a=e.length;if(void 0===n&&(n=a),"number"==typeof n&&isFinite(n)){t=c(t,a),n=c(n,a);for(var i=t;n>i;++i)r[i-t]=e[i]}return r},noop:i,error:function(e,t){throw(t||Error)(e)},oneObject:o,range:function(e,t,n){n||(n=1),null==t&&(t=e||0,e=0);for(var r=-1,a=Math.max(0,Math.ceil((t-e)/n)),i=new Array(a);++rn&&t(n,e[n])!==!1;n++);else for(n in e)if(e.hasOwnProperty(n)&&t(n,e[n])===!1)break}},getWidgetData:function(e,t){var n=avalon(e).data(),r={};for(var a in n)0===a.indexOf(t)&&(r[a.replace(t,"").replace(/\w/,function(e){return e.toLowerCase()})]=n[a]);return r},Array:{ensure:function(e,t){return-1===e.indexOf(t)?e.push(t):void 0},removeAt:function(e,t){return!!e.splice(t,1).length},remove:function(e,t){var n=e.indexOf(t);return~n?avalon.Array.removeAt(e,n):!1}}});var bn=avalon.bindingHandlers={},xn=avalon.bindingExecutors={},$n=avalon.directives={};avalon.directive=function(e,t){return bn[e]=t.init=t.init||i,xn[e]=t.update=t.update||i,$n[e]=t};var wn=new function(){function e(e){this.size=0,this.limit=e,this.head=this.tail=void 0,this._keymap={}}var t=e.prototype;return t.put=function(e,t){var n={key:e,value:t};return this._keymap[e]=n,this.tail?(this.tail.newer=n,n.older=this.tail):this.head=n,this.tail=n,this.size===this.limit?this.shift():this.size++,t},t.shift=function(){var e=this.head;e&&(this.head=this.head.newer,this.head.older=e.newer=e.older=this._keymap[e.key]=void 0,delete this._keymap[e.key])},t.get=function(e){var t=this._keymap[e];if(void 0!==t)return t===this.tail?t.value:(t.newer&&(t===this.head&&(this.head=t.newer),t.newer.older=t.older),t.older&&(t.older.newer=t.newer),t.newer=void 0,t.older=this.tail,this.tail&&(this.tail.newer=t),this.tail=t,t.value)},e};if(!"司徒正美".trim){var Cn=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;String.prototype.trim=function(){return this.replace(Cn,"")}}var kn=!{toString:null}.propertyIsEnumerable("toString"),Nn=function(){}.propertyIsEnumerable("prototype"),Tn=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],En=Tn.length;if(Object.keys||(Object.keys=function(e){var t=[],n=Nn&&"function"==typeof e;if("string"==typeof e||e&&e.callee)for(var r=0;rl;l++){var s=Tn[l];o&&"constructor"===s||!an.call(e,s)||t.push(s)}return t}),Array.isArray||(Array.isArray=function(e){return"[object Array]"===on.call(e)}),i.bind||(Function.prototype.bind=function(e){if(arguments.length<2&&void 0===e)return this;var t=this,n=arguments;return function(){var r,a=[];for(r=1;rr&&(r+=n);n>r;r++)if(this[r]===e)return r;return-1},lastIndexOf:function(e,t){var n=this.length,r=null==t?n-1:t;for(0>r&&(r=Math.max(0,n+r));r>=0;r--)if(this[r]===e)return r;return-1},forEach:f("","_",""),filter:f("r=[],j=0,","if(_)r[j++]=this[i]","return r"),map:f("r=[],","r[i]=_","return r"),some:f("","if(_)return true","return false"),every:f("","if(!_)return false","return true")}),avalon.contains=p,Ut.contains||(Ut.contains=function(e){return p(Ut,e)}),e.SVGElement){Ut.createTextNode("x").contains||(Node.prototype.contains=function(e){return!!(16&this.compareDocumentPosition(e))});var An="http://www.w3.org/2000/svg",_n=Ut.createElementNS(An,"svg");_n.innerHTML='',tn.test(_n.firstChild)||Object.defineProperties(SVGElement.prototype,{outerHTML:{enumerable:!0,configurable:!0,get:d,set:function(e){var t=this.tagName.toLowerCase(),n=this.parentNode,r=avalon.parseHTML(e);if("svg"===t)n.insertBefore(r,this);else{var a=Ut.createDocumentFragment();v(r,a),n.insertBefore(a,this)}n.removeChild(this)}},innerHTML:{enumerable:!0,configurable:!0,get:function(){var e=this.outerHTML,t=new RegExp("<"+this.nodeName+'\\b(?:(["\'])[^"]*?(\\1)|[^>])*>',"i"),n=new RegExp("$","i");return e.replace(t,"").replace(n,"")},set:function(e){if(avalon.clearHTML){avalon.clearHTML(this);var t=avalon.parseHTML(e);v(t,this)}}}})}!un.outerHTML&&e.HTMLElement&&HTMLElement.prototype.__defineGetter__("outerHTML",d);var On=/^(?:mouse|contextmenu|drag)|click/,Sn=avalon.eventHooks;if("onmouseenter"in un||avalon.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){Sn[e]={type:t,fn:function(t,n){return function(r){var a=r.relatedTarget;return a&&(a===t||16&t.compareDocumentPosition(a))?void 0:(delete r.type,r.type=e,n.call(t,r))}}}}),avalon.each({AnimationEvent:"animationend",WebKitAnimationEvent:"webkitAnimationEnd"},function(t,n){e[t]&&!Sn.animationend&&(Sn.animationend={type:n})}),"oninput"in Ut.createElement("input")||(Sn.input={type:"propertychange",deel:function(e,t){return function(n){return"value"===n.propertyName?(n.type="input",t.call(e,n)):void 0}}}),void 0===Ut.onmousewheel){var Mn=void 0!==Ut.onwheel?"wheel":"DOMMouseScroll",jn="wheel"===Mn?"deltaY":"detail";Sn.mousewheel={type:Mn,fn:function(e,t){return function(n){n.wheelDeltaY=n.wheelDelta=n[jn]>0?-120:120,n.wheelDeltaX=0,Object.defineProperty&&Object.defineProperty(n,"type",{value:"mousewheel"}),t.call(e,n)}}}}var Ln,Dn,Hn,Pn,Fn,Rn=/[-.*+?^${}()|[\]\/\\]/g,Bn={loader:function(t){var n=Xt&&t;e.require=n?Xt:Jt,e.define=n?Xt.define:Zt},interpolate:function(e){if(Ln=e[0],Dn=e[1],Ln===Dn){throw new SyntaxError("openTag!==closeTag")}m.openTag=Ln,m.closeTag=Dn;var t=g(Ln),n=g(Dn);Hn=new RegExp(t+"(.*?)"+n),Pn=new RegExp(t+"(.*?)"+n,"g"),Fn=new RegExp(t+".*?"+n+"|\\sms-")}};m.async=!0,m.debug=!0,m.plugins=Bn,m.plugins.interpolate(["{{","}}"]),m.paths={},m.shim={},m.maxRepeatSize=100,avalon.config=m;var qn=avalon.vmodels={};avalon.define=function(e){var t=e.$id;t||n("warning: vm必须指定$id");var r=w(e);return r.$id=t,qn[t]=r};var In=o("$id,$watch,$fire,$events,$model,$skipArray,$active,$pathname,$up,$track,$accessors"),Vn=Object.defineProperty,Un=!0;try{Vn({},"_",{value:"x"});var zn=Object.defineProperties}catch(Wn){Un=!1}var Xn=Yt.test(Object.key)?Object.key:function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&!In[n]&&t.push(n);return t},Yn={get:function(){return O(this)},set:i,enumerable:!1,configurable:!0};if(!Un&&("__defineGetter__"in avalon&&(Vn=function(e,t,n){return"value"in n&&(e[t]=n.value),"get"in n&&e.__defineGetter__(t,n.get),"set"in n&&e.__defineSetter__(t,n.set),e},zn=function(e,t){for(var n in t)t.hasOwnProperty(n)&&Vn(e,n,t[n]);return e}),hn)){var Gn={};e.execScript(["Function parseVB(code)"," ExecuteGlobal(code)","End Function"].join("\n"),"VBScript"),zn=function(t,n,r){var a=[];a.push("\r\n Private [__data__], [__proxy__]"," Public Default Function [__const__](d"+Vt+", p"+Vt+")"," Set [__data__] = d"+Vt+": set [__proxy__] = p"+Vt," Set [__const__] = Me"," End Function");var i={};for(t in n)i[t]=!0,a.push(" Public Property Let ["+t+"](val"+Vt+")",' Call [__proxy__](Me,[__data__], "'+t+'", val'+Vt+")"," End Property"," Public Property Set ["+t+"](val"+Vt+")",' Call [__proxy__](Me,[__data__], "'+t+'", val'+Vt+")"," End Property"," Public Property Get ["+t+"]"," On Error Resume Next"," Set["+t+'] = [__proxy__](Me,[__data__],"'+t+'")'," If Err.Number <> 0 Then"," ["+t+'] = [__proxy__](Me,[__data__],"'+t+'")'," End If"," On Error Goto 0"," End Property");for(t in r)i[t]!==!0&&(i[t]=!0,a.push(" Public ["+t+"]"));for(t in In)i[t]!==!0&&(i[t]=!0,a.push(" Public ["+t+"]"));a.push(" Public [hasOwnProperty]"),a.push("End Class");var o=a.join("\r\n"),l=Gn[o];l||(l=vn("VBClass"),e.parseVB("Class "+l+o),e.parseVB(["Function "+l+"Factory(a, b)"," Dim o"," Set o = (New "+l+")(a, b)"," Set "+l+"Factory = o","End Function"].join("\r\n")),Gn[o]=l);var s=e[l+"Factory"](n,S); -return s}}var Jn=["push","pop","shift","unshift","splice"],Zn=Array.prototype,Kn={notify:function(){b.call(this.$up,this.$pathname)},set:function(e,t){if(e>>>0===e&&this[e]!==t){if(e>this.length)throw Error(e+"set方法的第一个参数不能大于原数组长度");b.call(this.$up,this.$pathname+".*",[t,this[e]]),this.splice(e,1,t)}},contains:function(e){return-1!==this.indexOf(e)},ensure:function(e){return this.contains(e)||this.push(e),this},pushArray:function(e){return this.push.apply(this,e)},remove:function(e){return this.removeAt(this.indexOf(e))},removeAt:function(e){return e>>>0===e?this.splice(e,1):[]},size:function(){return this._.length},removeAll:function(e){if(Array.isArray(e))for(var t=this.length-1;t>=0;t--)-1!==e.indexOf(this[t])&&(Qn.call(this.$track,t,1),Qn.call(this,t,1));else if("function"==typeof e)for(t=this.length-1;t>=0;t--){var n=this[t];e(n,t)&&(Qn.call(this.$track,t,1),Qn.call(this,t,1))}else Qn.call(this.$track,0,this.length),Qn.call(this,0,this.length);cn||(this.$model=O(this)),this.notify(),this._.length=this.length},clear:function(){return this.removeAll()}},Qn=Zn.splice;Jn.forEach(function(e){var t=Zn[e];Kn[e]=function(){for(var n=[],r=0,a=arguments.length;a>r;r++)n[r]=E(arguments[r],0,1,1);var i=t.apply(this,n);return L(this.$track,e,n),cn||(this.$model=O(this)),this.notify(),this._.length=this.length,i}}),"sort,reverse".replace(Qt,function(e){Kn[e]=function(){var t=this.concat(),n=this,r=Math.random(),a=[],i=!1;Zn[e].apply(n,arguments);for(var o=0,l=t.length;l>o;o++){var s=n[o],c=t[o];if(s===c)a.push(o);else{var u=t.indexOf(s);a.push(u),t[u]=r,i=!0}}return i&&(M(this.$track,a),cn||(this.$model=O(this)),this.notify()),this}});var er=function(){var e,t=[];return{begin:function(n){t.push(e),e=n},end:function(){e=t.pop()},collectDependency:function(t){e&&e.callback(t)}}}();avalon.injectBinding=function(e){e.handler=e.handler||$n[e.type].update||i,e.update=function(){var t=!1;e.getter||(t=!0,er.begin({callback:function(t){D(t,e)}}),e.getter=tt(e.expr,e.vmodels,e),e.observers.forEach(function(t){t.v.$watch(t.p,e)}),delete e.observers);try{var r,a,i=e.fireArgs;if(delete e.fireArgs,i?(r=i[0],a=i[1]):r="on"===e.type?e.getter+"":e.getter.apply(0,e.args),a="undefined"==typeof a?e.oldValue:a,e._filters&&(r=Ga.$filter.apply(0,[r].concat(e._filters))),e.signature){var o=avalon.type(r);if("array"!==o&&"object"!==o)throw Error("warning:"+e.expr+"只能是对象或数组");e.xtype=o;var l=H(e.proxies||[],o),s=r.$track||("array"===o?j(r.length):Object.keys(r));e.track=s,l!==s.join(";")&&(e.handler(r,a),e.oldValue=1)}else(Array.isArray(r)?r.length===(a&&a.length):1)?"oldValue"in e&&r===a||(e.handler(r,a),e.oldValue=r):(e.handler(r,a),e.oldValue=r.concat())}catch(c){delete e.getter,n("warning:exception throwed in [avalon.injectBinding] ",c);var u=e.element;u&&3===u.nodeType&&(u.nodeValue=Ln+(e.oneTime?"::":"")+e.expr+Dn)}finally{t&&er.end()}},e.update()};var tr=0,nr=avalon.$$subscribers=[],rr=new Date,ar={},ir={area:[1,"",""],param:[1,"",""],col:[2,"","
"],legend:[1,"
","
"],option:[1,""],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],g:[1,'',""],_default:cn?[0,"",""]:[1,"X
","
"]};ir.th=ir.td,ir.optgroup=ir.option,ir.tbody=ir.tfoot=ir.colgroup=ir.caption=ir.thead,String("circle,defs,ellipse,image,line,path,polygon,polyline,rect,symbol,text,use").replace(Qt,function(e){ir[e]=ir.g});var or=/<([\w:]+)/,lr=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,sr=cn?/[^\d\D]/:/(<(?:script|link|style|meta|noscript))/gi,cr=o(["","text/javascript","text/ecmascript","application/ecmascript","application/javascript"]),ur=/<(?:tb|td|tf|th|tr|col|opt|leg|cap|area)/,fr=Ut.createElement("script"),pr=/<|&#?\w+;/;avalon.parseHTML=function(e){var t=fn.cloneNode(!1);if("string"!=typeof e)return t;if(!pr.test(e))return t.appendChild(Ut.createTextNode(e)),t;e=e.replace(lr,"<$1>").trim();var n,r,a=(or.exec(e)||["",""])[1].toLowerCase(),i=ir[a]||ir._default,o=pn;cn||(e=e.replace(sr,"
$1")),o.innerHTML=i[1]+e+i[2];var l=o.getElementsByTagName("script");if(l.length)for(var s,c=0;s=l[c++];)cr[s.type]&&(r=fr.cloneNode(!1),ln.forEach.call(s.attributes,function(e){e&&e.specified&&(r[e.name]=e.value,r.setAttribute(e.name,e.value))}),r.text=s.text,s.parentNode.replaceChild(r,s));if(!cn){var u="X
"===i[1]?o.lastChild.firstChild:o.lastChild;if(u&&"TABLE"===u.tagName&&"tbody"!==a)for(l=u.childNodes,c=0;s=l[c++];)if("TBODY"===s.tagName&&!s.innerHTML){u.removeChild(s);break}l=o.getElementsByTagName("br");for(var f=l.length;s=l[--f];)"msNoScope"===s.className&&s.parentNode.removeChild(s);for(l=o.all,c=0;s=l[c++];)I(s)&&V(s)}for(c=i[0];c--;o=o.lastChild);for(;n=o.firstChild;)t.appendChild(n);return t},avalon.innerHTML=function(e,t){if(!cn&&!sr.test(t)&&!ur.test(t))try{return void(e.innerHTML=t)}catch(n){}var r=this.parseHTML(t);this.clearHTML(e).appendChild(r)},avalon.clearHTML=function(e){for(e.textContent="";e.firstChild;)e.removeChild(e.firstChild);return e};var dr={_toString:function(){var e=this.node,t=e.className,n="string"==typeof t?t:t.baseVal;return n.split(/\s+/).join(" ")},_contains:function(e){return(" "+this+" ").indexOf(" "+e+" ")>-1},_add:function(e){this.contains(e)||this._set(this+" "+e)},_remove:function(e){this._set((" "+this+" ").replace(" "+e+" "," "))},__set:function(e){e=e.trim();var t=this.node;tn.test(t)?t.setAttribute("class",e):t.className=e}};"add,remove".replace(Qt,function(e){avalon.fn[e+"Class"]=function(t){var n=this[0];return t&&"string"==typeof t&&n&&1===n.nodeType&&t.replace(/\S+/g,function(t){W(n)[e](t)}),this}}),avalon.fn.mix({hasClass:function(e){var t=this[0]||{};return 1===t.nodeType&&W(t).contains(e)},toggleClass:function(e,t){for(var n,r=0,a=String(e).split(/\s+/),i="boolean"==typeof t;n=a[r++];){var o=i?t:!this.hasClass(n);this[o?"addClass":"removeClass"](n)}return this},attr:function(e,t){return 2===arguments.length?(this[0].setAttribute(e,t),this):this[0].getAttribute(e)},data:function(e,t){switch(e="data-"+U(e||""),arguments.length){case 2:return this.attr(e,t),this;case 1:var n=this.attr(e);return X(n);case 0:var r={};return ln.forEach.call(this[0].attributes,function(t){t&&(e=t.name,e.indexOf("data-")||(e=z(e.slice(5)),r[e]=X(t.value)))}),r}},removeData:function(e){return e="data-"+U(e),this[0].removeAttribute(e),this},css:function(e,t){if(avalon.isPlainObject(e))for(var n in e)avalon.css(this,n,e[n]);else var r=avalon.css(this,e,t);return void 0!==r?r:this},position:function(){var e,t,n=this[0],r={top:0,left:0};if(n)return"fixed"===this.css("position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),"HTML"!==e[0].tagName&&(r=e.offset()),r.top+=avalon.css(e[0],"borderTopWidth",!0),r.left+=avalon.css(e[0],"borderLeftWidth",!0),r.top-=e.scrollTop(),r.left-=e.scrollLeft()),{top:t.top-r.top-avalon.css(n,"marginTop",!0),left:t.left-r.left-avalon.css(n,"marginLeft",!0)}},offsetParent:function(){for(var e=this[0].offsetParent;e&&"static"===avalon.css(e,"position");)e=e.offsetParent;return avalon(e||un)},bind:function(e,t,n){return this[0]?avalon.bind(this[0],e,t,n):void 0},unbind:function(e,t,n){return this[0]&&avalon.unbind(this[0],e,t,n),this},val:function(e){var t=this[0];if(t&&1===t.nodeType){var n=0===arguments.length,r=n?":get":":set",a=Sr[J(t)+r];if(a)var i=a(t,e);else{if(n)return(t.value||"").replace(/\r/g,"");t.value=e}}return n?i:this}});var vr=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,hr=/^[\],:{}\s]*$/,mr=/(?:^|:|,)(?:\s*\[)+/g,gr=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,yr=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g;avalon.parseJSON=e.JSON?JSON.parse:function(e){if("string"==typeof e){if(e=e.trim(),e&&hr.test(e.replace(gr,"@").replace(yr,"]").replace(mr,"")))return new Function("return "+e)();avalon.error("Invalid JSON: "+e)}return e},avalon.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){avalon.fn[e]=function(n){var r=this[0]||{},a=Y(r),i="scrollTop"===e;return arguments.length?void(a?a.scrollTo(i?avalon(a).scrollLeft():n,i?n:avalon(a).scrollTop()):r[e]=n):a?t in a?a[t]:un[e]:r[e]}});var br=avalon.cssHooks={},xr=["","-webkit-","-o-","-moz-","-ms-"],$r={"float":cn?"cssFloat":"styleFloat"};if(avalon.cssNumber=o("animationIterationCount,columnCount,order,flex,flexGrow,flexShrink,fillOpacity,fontWeight,lineHeight,opacity,orphans,widows,zIndex,zoom"),avalon.cssName=function(e,t,n){if($r[e])return $r[e];t=t||un.style;for(var r=0,a=xr.length;a>r;r++)if(n=z(xr[r]+e),n in t)return $r[e]=n;return null},br["@:set"]=function(e,t,n){try{e.style[t]=n}catch(r){}},e.getComputedStyle)br["@:get"]=function(e,t){if(!e||!e.style)throw new Error("getComputedStyle要求传入一个节点 "+e);var n,r=getComputedStyle(e,null);return r&&(n="filter"===t?r.getPropertyValue(t):r[t],""===n&&(n=e.style[t])),n},br["opacity:get"]=function(e){var t=br["@:get"](e,"opacity");return""===t?"1":t};else{var wr=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,Cr=/^(top|right|bottom|left)$/,kr=/alpha\([^)]*\)/i,Nr=!!e.XDomainRequest,Tr="DXImageTransform.Microsoft.Alpha",Er={thin:Nr?"1px":"2px",medium:Nr?"3px":"4px",thick:Nr?"5px":"6px"};br["@:get"]=function(e,t){var n=e.currentStyle,r=n[t];if(wr.test(r)&&!Cr.test(r)){var a=e.style,i=a.left,o=e.runtimeStyle.left;e.runtimeStyle.left=n.left,a.left="fontSize"===t?"1em":r||0,r=a.pixelLeft+"px",a.left=i,e.runtimeStyle.left=o}return"medium"===r&&(t=t.replace("Width","Style"),"none"===n[t]&&(r="0px")),""===r?"auto":Er[r]||r},br["opacity:set"]=function(e,t,n){var r=e.style,a=isFinite(n)&&1>=n?"alpha(opacity="+100*n+")":"",i=r.filter||"";r.zoom=1,r.filter=(kr.test(i)?i.replace(kr,a):i+" "+a).trim(),r.filter||r.removeAttribute("filter")},br["opacity:get"]=function(e){var t=e.filters.alpha||e.filters[Tr],n=t&&t.enabled?t.opacity:100;return n/100+""}}"top,left".replace(Qt,function(e){br[e+":get"]=function(t){var n=br["@:get"](t,e);return/px$/.test(n)?n:avalon(t).position()[e]+"px"}});var Ar={position:"absolute",visibility:"hidden",display:"block"},_r=/^(none|table(?!-c[ea]).+)/;"Width,Height".replace(Qt,function(e){var t=e.toLowerCase(),n="client"+e,r="scroll"+e,a="offset"+e;br[t+":get"]=function(t,n,r){var i=-4;"number"==typeof r&&(i=r),n="Width"===e?["Left","Right"]:["Top","Bottom"];var o=t[a];return 2===i?o+avalon.css(t,"margin"+n[0],!0)+avalon.css(t,"margin"+n[1],!0):(0>i&&(o=o-avalon.css(t,"border"+n[0]+"Width",!0)-avalon.css(t,"border"+n[1]+"Width",!0)),-4===i&&(o=o-avalon.css(t,"padding"+n[0],!0)-avalon.css(t,"padding"+n[1],!0)),o)},br[t+"&get"]=function(e){var n=[];G(e,n);for(var r,a=br[t+":get"](e),i=0;r=n[i++];){e=r.node;for(var o in r)"string"==typeof r[o]&&(e.style[o]=r[o])}return a},avalon.fn[t]=function(i){var o=this[0];if(0===arguments.length){if(o.setTimeout)return o["inner"+e]||o.document.documentElement[n]||o.document.body[n];if(9===o.nodeType){var l=o.documentElement;return Math.max(o.body[r],l[r],o.body[a],l[a],l[n])}return br[t+"&get"](o)}return this.css(t,i)},avalon.fn["inner"+e]=function(){return br[t+":get"](this[0],void 0,-2)},avalon.fn["outer"+e]=function(e){return br[t+":get"](this[0],void 0,e===!0?2:0)}}),avalon.fn.offset=function(){var e=this[0],t={left:0,top:0};if(!e||!e.tagName||!e.ownerDocument)return t;var n=e.ownerDocument,r=n.body,a=n.documentElement,i=n.defaultView||n.parentWindow;if(!avalon.contains(a,e))return t;e.getBoundingClientRect&&(t=e.getBoundingClientRect());var o=a.clientTop||r.clientTop,l=a.clientLeft||r.clientLeft,s=Math.max(i.pageYOffset||0,a.scrollTop,r.scrollTop),c=Math.max(i.pageXOffset||0,a.scrollLeft,r.scrollLeft);return{top:t.top+s-o,left:t.left+c-l}};var Or=/^]+))?)*\s+value[\s=]/i,Sr={"option:get":hn?function(e){return Or.test(e.outerHTML)?e.value:e.text.trim()}:function(e){return e.value},"select:get":function(e,t){for(var n,r=e.options,a=e.selectedIndex,i=Sr["option:get"],o="select-one"===e.type||0>a,l=o?null:[],s=o?a+1:r.length,c=0>a?s:o?a:0;s>c;c++)if(n=r[c],(n.selected||c===a)&&!n.disabled){if(t=i(n),o)return t;l.push(t)}return l},"select:set":function(e,t,n){t=[].concat(t);for(var r,a=Sr["option:get"],i=0;r=e.options[i++];)(r.selected=t.indexOf(a(r))>-1)&&(n=!0);n||(e.selectedIndex=-1)}},Mr={},jr=["break,case,catch,continue,debugger,default,delete,do,else,false","finally,for,function,if,in,instanceof,new,null,return,switch,this","throw,true,try,typeof,var,void,while,with","abstract,boolean,byte,char,class,const,double,enum,export,extends","final,float,goto,implements,import,int,interface,long,native","package,private,protected,public,short,static,super,synchronized","throws,transient,volatile","arguments,let,yield,undefined"].join(",");jr.replace(/\w+/g,function(e){Mr[e]=!0});var Lr=/[a-z_$]/i,Dr=/[\s\uFEFF\xA0]/,Hr=/(\$proxy\$[a-z]+)\d+$/,Pr=new wn(218),Fr=new wn(128),Rr=/\)\s*$/,Br=/\)\s*\|/g,qr=/\|\s*([$\w]+)/g,Ir=/"\s*\["/g,Vr=/"\s*\(/g,Ur={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},zr=e.JSON&&JSON.stringify||function(e){return'"'+e.replace(/[\\\"\x00-\x1f]/g,function(e){var t=Ur[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"'};avalon.scan=function(e,t){e=e||un;var n=t?[].concat(t):[];pt(e,n)};var Wr=o("area,base,basefont,br,col,command,embed,hr,img,input,link,meta,param,source,track,wbr,noscript,script,style,textarea".toUpperCase()),Xr=function(e,t,n){var r=e.getAttribute(t);if(r)for(var a,i=0;a=n[i++];)if(a.hasOwnProperty(r)&&"function"==typeof a[r])return a[r]},Yr=hn&&e.MutationObserver?function(e){for(var t,n=e.firstChild;n;){var r=n.nextSibling;3===n.nodeType?t?(t.nodeValue+=n.nodeValue,e.removeChild(n)):t=n:t=null,n=r}}:0,Gr=/^\s*::/,Jr=/ms-(\w+)-?(.*)/,Zr=o("animationend,blur,change,input,click,dblclick,focus,keydown,keypress,keyup,mousedown,mouseenter,mouseleave,mousemove,mouseout,mouseover,mouseup,scan,scroll,submit"),Kr=o("value,title,alt,checked,selected,disabled,readonly,enabled,href,src"),Qr=/^if|widget|repeat$/,ea=/^each|with|html|include$/;if(!cn)var ta=new wn(512),na=/\s+([^=\s]+)(?:=("[^"]*"|'[^']*'|[^\s>]+))?/g,ra=/^['"]/,aa=/<\w+\b(?:(["'])[^"]*?(\1)|[^>])*>/i,ia=/&/g,oa=function(e){var t=e.outerHTML;if("8?e.bound("input",d):e.bound("propertychange",function(e){"value"===e.propertyName&&d()}),e.bound("dragend",function(){setTimeout(function(){d()},17)})):(e.bound("input",d),e.bound("compositionstart",a),e.bound("compositionend",l),e.bound("DOMAutoComplete",d));break;case"select":e.bound("change",function(){var t=avalon(s).val();if(t=Array.isArray(t)?t.map(function(t){return e.pipe(t,e,"get")}):e.pipe(t,e,"get"),t+""!==e.oldValue)try{e.setter(t),r.call(s,t)}catch(a){n(a)}})}"input"===e.xtype&&/^(text|password|hidden)/.test(s.type)&&(s.avalonSetter=d,Na(function(){if(un.contains(s))e.oldValue!==s.value&&d();else if(!s.msRetain)return!1}));for(var v in avalon.vmodels){var h=avalon.vmodels[v];h.$fire("avalon-ms-duplex-init",e)}var m=e.pipe||(e.pipe=bt);m(null,e,"init")},update:function(e){var t,n=this.element,r=this;switch(this.xtype){case"input":case"change":t=this.pipe(e,this,"set"),t!==this.oldValue&&(n.value=this.oldValue=t);break;case"radio":t=r.isChecked?!!e:e+""===n.value,6===hn?setTimeout(function(){n.defaultChecked=t,n.checked=t},31):n.checked=t;break;case"checkbox":var a=[].concat(e);t=this.pipe(n.value,this,"get"),n.checked=a.indexOf(t)>-1;break;case"select":r._value=e,n.msHasEvent="selectDuplex",avalon.bind(n,"datasetchanged",function(e){if("selectDuplex"===e.bubble){var t=r._value,a=Array.isArray(t)?t.map(String):t+"";avalon(n).val(a),n.oldValue=a+"",r.changed.call(n,a)}})}"select"!==r.xtype&&r.changed.call(n,t)}})}hn&&avalon.bind(Ut,"selectionchange",function(){var e=Ut.activeElement;e&&"function"==typeof e.avalonSetter&&e.avalonSetter()}),avalon.duplexHooks={checked:{get:function(e,t){return!t.oldValue}},string:{get:function(e){return e},set:yt},"boolean":{get:function(e){return"true"===e},set:yt},number:{get:function(e,t){var n=parseFloat(e+"");if(-e===-n)return n;var r=/strong|medium|weak/.exec(t.element.getAttribute("data-duplex-number"))||["medium"];switch(r[0]){case"strong":return 0;case"medium":return""===e?"":0;case"weak":return e}},set:yt}};var Ca,ka=[];avalon.tick=function(e){1===ka.push(e)&&(Ca=setInterval(xt,60))};var Na=i;!new function(){function e(e){t[this.tagName].call(this,e),"function"==typeof this.avalonSetter&&this.oldValue!==e&&this.avalonSetter()}try{var t={},n=HTMLInputElement.prototype,r=HTMLTextAreaElement.prototype,a=HTMLInputElement.prototype;Object.getOwnPropertyNames(a),t.INPUT=Object.getOwnPropertyDescriptor(n,"value").set,Object.defineProperty(n,"value",{set:e}),t.TEXTAREA=Object.getOwnPropertyDescriptor(r,"value").set,Object.defineProperty(r,"value",{set:e})}catch(i){Na=avalon.tick}},avalon.directive("effect",{priority:5,init:function(e){var t,n,r=e.expr,a=r.replace(Pn,function(e){return e.replace(/./g,"0")}).indexOf(":");-1===a?(t=r,n=!0):(t=r.slice(0,a),n=r.slice(a+1)),t=Hn.test(r)?nt(t):zr(t),e.expr="["+t+","+n+"]"},update:function(t){var n=t[0],r=this.element;if(r.getAttribute("data-effect-name")!==n){r.removeAttribute("data-effect-driver");var a=r.style,i=e.getComputedStyle?e.getComputedStyle(r):null,o=!1;if(i&&(Aa||_a)){var l=a[Oa]||i[Oa];l&&"0s"!==l&&(r.setAttribute("data-effect-driver","t"),o=!0),o||(l=a[Sa]||i[Sa],l&&"0s"!==l&&(r.setAttribute("data-effect-driver","a"),o=!0))}o||avalon.effects[n]&&(r.setAttribute("data-effect-driver","j"),o=!0),o&&r.setAttribute("data-effect-name",n)}}}),avalon.effects={},avalon.effect=function(e,t){avalon.effects[e]=t};var Ta,Ea,Aa=!1,_a=!1,Oa=avalon.cssName("transition-duration"),Sa=avalon.cssName("animation-duration");!new function(){var t,n={TransitionEvent:"transitionend",WebKitTransitionEvent:"webkitTransitionEnd",OTransitionEvent:"oTransitionEnd",otransitionEvent:"otransitionEnd"};for(var r in n){if(e[r]){t=n[r];break}try{{document.createEvent(r)}t=n[r];break}catch(a){}}"string"==typeof t&&(Aa=!0,Ta=t),n={AnimationEvent:"animationend",WebKitAnimationEvent:"webkitAnimationEnd"};var i;for(r in n)if(e[r]){i=n[r];break}"string"==typeof i&&(Aa=!0,Ea=i)};var Ma=[],ja=new fa;kt.prototype={contrustor:kt,enterClass:function(){return Nt(this,"enter")},leaveClass:function(){return Nt(this,"leave")},actionFun:function(e,t,n){if(!document.hidden){var r=this,a=r.el,i="leave"===e;e=i?"leave":"enter";var o=i?"enter":"leave";Tt(r,"abort"+Ct(o)),Tt(r,"before"+Ct(e)),i||t(a);var l=function(o){a.removeEventListener(r.cssEvent,r.cssCallback),i?(t(a),avalon(a).removeClass(r.cssClass)):"a"===r.driver&&avalon(a).removeClass(r.cssClass),o!==!0&&(Tt(r,"after"+Ct(e)),n&&n(a)),r.dispose()};r.useCss?(r.cssCallback&&r.cssCallback(!0),r.cssClass=Nt(r,e),r.cssCallback=l,r.update=function(){a.addEventListener(r.cssEvent,r.cssCallback),i||"t"!==r.driver||avalon(a).removeClass(r.cssClass)},avalon(a).addClass(r.cssClass),ja.render(!0),ja.queue.push(r)):Tt(r,e,l)}},enter:function(){this.actionFun.apply(this,["enter"].concat(avalon.slice(arguments)))},leave:function(){this.actionFun.apply(this,["leave"].concat(avalon.slice(arguments)))},dispose:function(){this.update=this.cssCallback=null,Ma.unshift(this)>100&&Ma.pop()}};var La=function(e,t){var n=sn.call(arguments,0);"function"!=typeof n[2]&&n.splice(2,0,i),"function"!=typeof n[3]&&n.splice(3,0,i);var r=n[2],a=n[3],o=n[4],l=$t(e,o);if(!l)return r(),a(),!1;var s=t?"enter":"leave";l[s](r,a)};avalon.mix(avalon.effect,{apply:La,append:function(e,t,n,r){return La(e,1,function(){t.appendChild(e)},n,r)},before:function(e,t,n,r){return La(e,1,function(){t.parentNode.insertBefore(e,t)},n,r)},remove:function(e,t,n,r){return La(e,0,function(){e.parentNode===t&&t.removeChild(e)},n,r)}}),avalon.directive("html",{update:function(e){var t=this,n=this.element,r=1!==n.nodeType,a=r?n.parentNode:n;if(a){if(e=null==e?"":e,3===n.nodeType){var i=vn("html");a.insertBefore(Ut.createComment(i),n),t.element=Ut.createComment(i+":end"),a.replaceChild(t.element,n),n=t.element}if("object"!=typeof e)var o=avalon.parseHTML(String(e));else if(11===e.nodeType)o=e;else if(1===e.nodeType||e.item){var l=1===e.nodeType?e.childNodes:e.item;for(o=fn.cloneNode(!0);l[0];)o.appendChild(l[0])}if(l=avalon.slice(o.childNodes),r){for(var s=n.nodeValue.slice(0,-4);;){var c=n.previousSibling;if(!c||8===c.nodeType&&c.nodeValue===s)break;a.removeChild(c)}a.insertBefore(o,n)}else avalon.clearHTML(n).appendChild(o);ft(l,t.vmodels)}}}),avalon.directive("if",{priority:10,update:function(e){function t(){a.getAttribute(r.name)&&(a.removeAttribute(r.name),st(a,r.vmodels)),r.rollback=null}var n,r=this,a=this.element,i=r.stamp=+new Date,o=function(){i===r.stamp&&(r.recoverNode=null)};r.recoverNode&&r.recoverNode();try{if(!a.parentNode)return;n=a.parentNode}catch(l){return}if(e){if(8===a.nodeType){var s=r.keep,c=avalon.effect.apply(s,1,function(){i===r.stamp&&(a.parentNode.replaceChild(s,a),a=r.element=s,s.getAttribute("_required")&&(a.required=!0,a.removeAttribute("_required")),a.querySelectorAll&&avalon.each(a.querySelectorAll("[_required=true]"),function(e){e.required=!0,e.removeAttribute("_required")}),t())},o);c=c===!1}c||t()}else if(1===a.nodeType){a.required===!0&&(a.required=!1,a.setAttribute("_required","true"));try{avalon.each(a.querySelectorAll(":required"),function(e){a.required=!1,e.setAttribute("_required","true")})}catch(l){}var u=r.element=Ut.createComment("ms-if"),f=a.nextSibling;r.recoverNode=function(){r.recoverNode=null,u.parentNode!==n&&(n.insertBefore(u,f),r.keep=a)},avalon.effect.apply(a,0,function(){r.recoverNode=null,i===r.stamp&&(a.parentNode.replaceChild(u,a),r.keep=a,Wt.appendChild(a),r.rollback=function(){a.parentNode===Wt&&Wt.removeChild(a)})},o)}}});var Da=/(?:[\s\S]+?)<\/noscript>/gim,Ha=/([\s\S]+?)<\/noscript>/im,Pa=function(){return new(e.XMLHttpRequest||ActiveXObject)("Microsoft.XMLHTTP")},Fa=avalon.templateCache={};avalon.directive("include",{init:$n.attr.init,update:function(e){var t=this,n=this.element,r=t.vmodels,a=t.includeRendered,i=t.effectName&&t.effectClass,o=t.templateCache,l=t.includeReplace,s=t.includeLoaded,c=l?n.parentNode:n,u=t._element;t.recoverNodes=t.recoverNodes||avalon.noop;var f=(l&&u.cloneNode(),function(f){var p=t._stamp=+new Date;if(s){var d=s.apply(c,[f].concat(r));"string"==typeof d&&(f=d)}a&&at(c,function(){a.call(c)},0/0);var v=t.includeLastID||"_default";t.includeLastID=e;var h=o&&o[v]||Ut.createElement(n.tagName||t._element.tagName);i&&(h.className=i,c.insertBefore(h,t.start)),(o||{})[v]=h;var m=t.recoverNodes();for(m&&c.insertBefore(m,t.end);;){var g=t.start.nextSibling;if(!g||g===h||g===t.end)break;h.appendChild(g)}avalon.effect.remove(h,c,function(){o&&p===t._stamp&&Wt.appendChild(h)},t);var y=c,b=avalon.noop,x=avalon.noop,$=Et(t,e,f),w=avalon.slice($.childNodes);l&&i?(y=u,y.innerHTML="",y.setAttribute("ms-skip","true"),c.insertBefore(y,t.end.nextSibling),b=function(){y.insertBefore($,null)},x=function(){t.recoverNodes=avalon.noop,p===t._stamp&&($=At(w),c.insertBefore($,t.end),ft(w,r)),y.parentNode===c&&c.removeChild(y)},t.recoverNodes=function(){return t.recoverNodes=avalon.noop,At(w)}):b=function(){c.insertBefore($,t.end),ft(w,r)},avalon.effect.apply(y,"enter",b,x)});if("src"===t.param)if("string"==typeof Fa[e])avalon.nextTick(function(){f(Fa[e])});else if(Array.isArray(Fa[e]))Fa[e].push(f);else{var p=Pa();p.onreadystatechange=function(){if(4===p.readyState){var t=p.status;if(t>=200&&300>t||304===t||1223===t){for(var n,r=p.responseText,a=0;n=Fa[e][a++];)n(r);Fa[e]=r}}},Fa[e]=[f],p.open("GET",e,!0),"withCredentials"in p&&(p.withCredentials=!0),p.setRequestHeader("X-Requested-With","XMLHttpRequest"),p.send(null) -}else{var d=e&&1===e.nodeType?e:Ut.getElementById(e);if(d){if("NOSCRIPT"===d.tagName&&!d.innerHTML&&!d.fixIE78){p=Pa(),p.open("GET",location,!1),p.send(null);for(var v=Ut.getElementsByTagName("noscript"),h=(p.responseText||"").match(Da)||[],m=h.length,g=0;m>g;g++){var y=v[g];y&&(y.style.display="none",y.fixIE78=(h[g].match(Ha)||[""," "])[1])}}avalon.nextTick(function(){f(d.fixIE78||d.value||d.innerText||d.innerHTML)})}}}});var Ra=/\(([^)]*)\)/,Ba=avalon.directive("on",{priority:3e3,init:function(e){var t=e.expr;e.type="on";var n=e.param.replace(/-\d+$/,"");if("function"==typeof Ba[n+"Hook"]&&Ba[n+"Hook"](e),t.indexOf("(")>0&&t.indexOf(")")>-1){var r=(t.match(Ra)||["",""])[1].trim();(""===r||"$event"===r)&&(t=t.replace(Ra,""))}e.expr=t},update:function(e){var t=this,n=this.element;e=function(e){var n=t.getter||i;return n.apply(this,t.args.concat(e))};var r=t.param.replace(/-\d+$/,"");if("scan"===r)e.call(n,{type:r});else if("function"==typeof t.specialBind)t.specialBind(n,e);else var a=avalon.bind(n,r,e);t.rollback=function(){"function"==typeof t.specialUnbind?t.specialUnbind():avalon.unbind(n,r,a)}}});avalon.directive("repeat",{priority:90,init:function(e){var t=e.type;e.cache={},e.enterCount=0;var n=e.element;if(1===n.nodeType){n.removeAttribute(e.name),wt(n,e),e.param=e.param||"el",e.sortedCallback=Xr(n,"data-with-sorted",e.vmodels);var r=Xr(n,"data-"+t+"-rendered",e.vmodels),a=vn(t),i=Ut.createComment(a+":start"),o=e.element=Ut.createComment(a+":end");if(e.signature=a,e.start=i,e.template=fn.cloneNode(!1),"repeat"===t){var l=n.parentNode;l.replaceChild(o,n),l.insertBefore(i,o),e.template.appendChild(n)}else{for(;n.firstChild;)e.template.appendChild(n.firstChild);n.appendChild(i),n.appendChild(o),l=n}if(e.element=o,r)var s=avalon.bind(l,"datasetchanged",function(){r.apply(l,l.args),avalon.unbind(l,"datasetchanged",s),l.msRendered=r})}},update:function(e,t){var n=this,r=this.xtype;this.enterCount+=1;var a=!t;if(a){n.$outer={};var i="$key",o="$val";"array"===r&&(i="$first",o="$last");for(var l,s=0;l=n.vmodels[s++];)if(l.hasOwnProperty(i)&&l.hasOwnProperty(o)){n.$outer=l;break}}var c=this.track;if(n.sortedCallback){var u=n.sortedCallback.call(x,c);u&&Array.isArray(u)&&(c=u)}var f="move";n.$repeat=e;var p=[],d=a&&fn.cloneNode(!1),v=[],h=this.param,g=avalon.mix({},this.cache),y=this.element,b=c.length,x=y.parentNode;for(s=0;b>s;s++){var $=c[s],w=g[$];if(w)p.push({}),g[$]=!0;else{w=jt(this),"array"===r?(f="add",w.$id=$,w[h]=e[s]):(f="append",w.$key=$,w.$val=e[$]),this.cache[$]=w;var C=w.$anchor||(w.$anchor=y.cloneNode(!1));C.nodeValue=this.signature,Mt(n,d,w,p,a&&!n.effectDriver),Ht(w,n,r)}1===this.enterCount&&(w.$active=!1,w.$oldIndex=w.$index,w.$active=!0,w.$index=s),"array"===r?(w.$first=0===s,w.$last=s===b-1):w.$val=O(e[$]),v.push(w)}if(this.proxies=v,a&&!n.effectDriver)x.insertBefore(d,y),p.forEach(function(e){ft(e.nodes||[],e.vmodels),e.nodes=e.vmodels=null});else{var k=n.staggerIndex=0;for($ in g)g[$]!==!0&&(f="del",St(g[$].$anchor,n),Rt(this.cache,$,h),g[$]=null);for(s=0;b>s;s++){w=v[s],$="array"===r?w.$id:w.$key;var N=v[s-1],T=N?N.$anchor:n.start;g[$]?w.$index!==w.$oldIndex&&!function(e,t){k=Ot(n.effectEnterStagger,function(){var r=St(e.$anchor),a=avalon.slice(r.childNodes);x.insertBefore(r,t.nextSibling),_t(a,1,n)},k)}(w,T):!function(e,t){var r=e.nodes,a=e.vmodels;r&&(k=Ot(n.effectEnterStagger,function(){x.insertBefore(e.content,t.nextSibling),ft(r,a),_t(r,1,n)},k)),e.nodes=e.vmodels=null}(p[s],T)}}if(!e.$track)for($ in this.cache)Rt(this.cache,$,h);!function(e){x.args=e,x.msRendered&&x.msRendered.apply(x,e)}(m.newWatch?arguments:[f]);var E=setTimeout(function(){clearTimeout(E),avalon.fireDom(x,"datasetchanged",{bubble:x.msHasEvent})});this.enterCount-=1}}),"with,each".replace(Qt,function(e){$n[e]=avalon.mix({},$n.repeat,{priority:1400})});var qa=[],Ia=[];avalon.directive("text",{update:function(e){var t=this.element;if(e=null==e?"":e,3===t.nodeType)try{t.data=e}catch(n){}else"textContent"in t?t.textContent=e:t.innerText=e}}),avalon.parseDisplay=Bt,avalon.directive("visible",{init:function(){},update:function(e){var t=this.element,n=this,r=n.stamp=+new Date;e?(t.style.display="none",avalon.effect.apply(t,1,function(){if(r===n.stamp){var e=t.getAttribute("data-effect-driver")||"a";/^[atn]/.test(e)&&(this.effectName||(t.style.display=""),"none"===avalon(t).css("display")&&(t.style.display=Bt(t.nodeName)))}})):avalon.effect.apply(t,0,function(){r===n.stamp&&(t.style.display="none")})}});var Va=/]*>([\S\s]*?)<\/script\s*>/gim,Ua=/\s+(on[^=\s]+)(?:=("[^"]*"|'[^']*'|[^\s>]+))?/g,za=/<\w+\b(?:(["'])[^"]*?(\1)|[^>])*>/gi,Wa={a:/\b(href)\=("javascript[^"]*"|'javascript[^']*')/gi,img:/\b(src)\=("javascript[^"]*"|'javascript[^']*')/gi,form:/\b(action)\=("javascript[^"]*"|'javascript[^']*')/gi},Xa=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Ya=/([^\#-~| |!])/g,Ga=avalon.filters={uppercase:function(e){return e.toUpperCase()},lowercase:function(e){return e.toLowerCase()},truncate:function(e,t,n){return t=t||30,n="string"==typeof n?n:"...",e.length>t?e.slice(0,t-n.length)+n:String(e)},$filter:function(e){for(var t=1,n=arguments.length;n>t;t++){var r=arguments[t],a=avalon.filters[r[0]];if("function"==typeof a){var i=[e].concat(r.slice(1));e=a.apply(null,i)}}return e},camelize:z,sanitize:function(e){return e.replace(Va,"").replace(za,function(e){var t=e.toLowerCase().match(/<(\w+)\s/);if(t){var n=Wa[t[1]];n&&(e=e.replace(n,function(e,t,n){var r=n.charAt(0);return t+"="+r+"javascript:void(0)"+r}))}return e.replace(Ua," ").replace(/\s+/g," ")})},escape:function(e){return String(e).replace(/&/g,"&").replace(Xa,function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1);return"&#"+(1024*(t-55296)+(n-56320)+65536)+";"}).replace(Ya,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")},currency:function(e,t,n){return(t||"¥")+qt(e,isFinite(n)?n:2)},number:qt};!new function(){function e(e){return parseInt(e,10)||0}function t(e,t,n){var r="";for(0>e&&(r="-",e=-e),e=""+e;e.length0||o>-r)&&(o+=r),0===o&&-12===r&&(o=12),t(o,n,a)}}function r(e,t){return function(n,r){var a=n["get"+e](),i=(t?"SHORT"+e:e).toUpperCase();return r[i][a]}}function a(e){var n=-1*e.getTimezoneOffset(),r=n>=0?"+":"";return r+=t(Math[n>0?"floor":"ceil"](n/60),2)+t(Math.abs(n%60),2)}function i(e,t){return e.getHours()<12?t.AMPMS[0]:t.AMPMS[1]}var o={yyyy:n("FullYear",4),yy:n("FullYear",2,0,!0),y:n("FullYear",1),MMMM:r("Month"),MMM:r("Month",!0),MM:n("Month",2,1),M:n("Month",1,1),dd:n("Date",2),d:n("Date",1),HH:n("Hours",2),H:n("Hours",1),hh:n("Hours",2,-12),h:n("Hours",1,-12),mm:n("Minutes",2),m:n("Minutes",1),ss:n("Seconds",2),s:n("Seconds",1),sss:n("Milliseconds",3),EEEE:r("Day"),EEE:r("Day",!0),a:i,Z:a},l=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,s=/^\/Date\((\d+)\)\/$/;Ga.date=function(t,n){var r,a,i=Ga.date.locate,c="",u=[];if(n=n||"mediumDate",n=i[n]||n,"string"==typeof t)if(/^\d+$/.test(t))t=e(t);else if(s.test(t))t=+RegExp.$1;else{var f=t.trim(),p=[0,0,0,0,0,0,0],d=new Date(0);f=f.replace(/^(\d+)\D(\d+)\D(\d+)/,function(t,n,r,a){var i=4===a.length?[a,n,r]:[n,r,a];return p[0]=e(i[0]),p[1]=e(i[1])-1,p[2]=e(i[2]),""});var v=d.setFullYear,h=d.setHours;f=f.replace(/[T\s](\d+):(\d+):?(\d+)?\.?(\d)?/,function(t,n,r,a,i){return p[3]=e(n),p[4]=e(r),p[5]=e(a),i&&(p[6]=Math.round(1e3*parseFloat("0."+i))),""});var m=0,g=0;f=f.replace(/Z|([+-])(\d\d):?(\d\d)/,function(t,n,r,a){return v=d.setUTCFullYear,h=d.setUTCHours,n&&(m=e(n+r),g=e(n+a)),""}),p[3]-=m,p[4]-=g,v.apply(d,p.slice(0,3)),h.apply(d,p.slice(3)),t=d}if("number"==typeof t&&(t=new Date(t)),"date"===avalon.type(t)){for(;n;)a=l.exec(n),a?(u=u.concat(a.slice(1)),n=u.pop()):(u.push(n),n=null);return u.forEach(function(e){r=o[e],c+=r?r(t,i):e.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),c}};var c={AMPMS:{0:"上午",1:"下午"},DAY:{0:"星期日",1:"星期一",2:"星期二",3:"星期三",4:"星期四",5:"星期五",6:"星期六"},MONTH:{0:"1月",1:"2月",2:"3月",3:"4月",4:"5月",5:"6月",6:"7月",7:"8月",8:"9月",9:"10月",10:"11月",11:"12月"},SHORTDAY:{0:"周日",1:"周一",2:"周二",3:"周三",4:"周四",5:"周五",6:"周六"},fullDate:"y年M月d日EEEE",longDate:"y年M月d日",medium:"yyyy-M-d H:mm:ss",mediumDate:"yyyy-M-d",mediumTime:"H:mm:ss","short":"yy-M-d ah:mm",shortDate:"yy-M-d",shortTime:"ah:mm"};c.SHORTMONTH=c.MONTH,Ga.date.locate=c};var Ja=avalon.modules={"domReady!":{exports:avalon,state:3},avalon:{exports:avalon,state:4}};Ja.exports=Ja.avalon,new function(){function t(e,t){var r="js";e=e.replace(/^(\w+)\!/,function(e,t){return r=t,""}),"ready"===r&&(n("debug: ready!已经被废弃,请使用domReady!"),r="domReady");var a="";e=e.replace(A,function(e){return a=e,""});var i="."+r,o=/js|css/.test(i)?i:"";e=e.replace(/\.[a-z0-9]+$/g,function(e){return e===i?(o=e,""):e});var l=avalon.mix({query:a,ext:o,res:r,name:e,toUrl:h},t);return l.toUrl(e),l}function r(e){var t=e.name,n=e.res,r=Ja[t],a=t&&e.urlNoQuery;if(r&&r.state>=1)return t;if(r=Ja[a],r&&r.state>=3)return Xt(r.deps||[],r.factory,a),a;if(t&&!r){r=Ja[a]={id:a,state:1};var i=function(a){H[n]=a,a.load(t,e,function(e){arguments.length&&void 0!==e&&(r.exports=e),r.state=4,s()})};H[n]?i(H[n]):Xt([n],i)}return t?a:n+"!"}function o(e,t){for(var n,r=0;n=e[r++];)if(4!==Ja[n].state&&(n===t||o(Ja[n].deps,t)))return!0}function l(e,t,r){var a=u(e.src);return e.onload=e.onreadystatechange=e.onerror=null,t||r&&Ja[a]&&!Ja[a].state?(setTimeout(function(){zt.removeChild(e),e=null}),void n("debug: 加载 "+a+" 失败"+t+" "+!Ja[a].state)):!0}function s(){e:for(var e,t=N.length;e=N[--t];){var n=Ja[e],r=n.deps;if(r){for(var a,i=0;a=r[i];i++)if(4!==Object(Ja[a]).state)continue e;4!==n.state&&(N.splice(t,1),v(n.id,n.deps,n.factory),s())}}}function c(e,t,r){function a(){var a=T.pop();a&&a.require(t),r&&r(),l(i,!1,!o)&&(n("debug: 已成功加载 "+e),t&&N.push(t),s())}var i=Ut.createElement("script"),o="onload"in i,c=o?"onload":"onreadystatechange";i[c]=o?a:function(){D.test(i.readyState)&&a()},i.onerror=function(){l(i,!0)},i.className=Gt,i.src=e,zt.insertBefore(i,zt.firstChild),n("debug: 正准备加载 "+e)}function u(e){return(e||"").replace(A,"")}function f(e){return/^(?:[a-z]+:)?\/\//i.test(String(e))}function p(e,t){return"1"[0]?e[t]:e.getAttribute(t,4)}function d(){var t;try{a.b.c()}catch(n){t=n.stack,!t&&e.opera&&(t=(String(n).match(/of linked script \S+/g)||[]).join(" "))}if(t)return t=t.split(/[@ ]/g).pop(),t="("===t[0]?t.slice(1,-1):t.replace(/\s/,""),u(t.replace(/(:\d+)?:\d+$/i,""));for(var r,i=zt.getElementsByTagName("script"),o=i.length;r=i[--o];)if(r.className===Gt&&"interactive"===r.readyState){var l=p(r,"src");return r.className=u(l)}}function v(t,r,a){var i=Object(Ja[t]);i.state=4;for(var o,l=0,s=[];o=r[l++];)if("exports"===o){var c=i.exports||(i.exports={});s.push(c)}else s.push(Ja[o].exports);try{var u=a.apply(e,s)}catch(f){n("执行["+t+"]模块的factory抛错: ",f)}return void 0!==u&&(i.exports=u),P.test(t)&&delete Ja[t],delete i.factory,u}function h(e){0===e.indexOf(this.res+"!")&&(e=e.slice(this.res.length+1));var t=e,n=0,r=this.baseUrl,a=this.parentUrl||r;$(e,m.paths,function(e,r){t=t.replace(r,e),n=1}),n||$(e,m.packages,function(e,n,r){t=t.replace(r.name,r.location)}),this.mapUrl&&$(this.mapUrl,m.map,function(e){$(t,e,function(e,n){t=t.replace(n,e),a=r})});var i=this.ext;i&&n&&t.slice(-i.length)===i&&(t=t.slice(0,-i.length)),f(t)||(a=this.built||/^\w/.test(t)?r:a,t=C(a,t));var o=t+i;return t=o+this.query,o=t.replace(A,function(e){return this.query=e,""}),$(e,m.urlArgs,function(e){t+=(-1===t.indexOf("?")?"?":"&")+e}),this.url=t,this.urlNoQuery=o}function g(e,t,n){var r=x(e,t,n);return r.sort(w),r}function y(e){return new RegExp("^"+e+"(/|$)")}function b(t){return function(){var n;return t.init&&(n=t.init.apply(e,arguments)),n||t.exports&&k(t.exports)}}function x(e,t,n){var r=[];for(var a in e)if(an.call(e,a)){var i={name:a,val:e[a]};r.push(i),i.reg="*"===a&&t?/^/:y(a),n&&"*"!==a&&(i.reg=new RegExp("/"+a.replace(/^\//,"")+"(/|$)"))}return r}function $(e,t,n){t=t||[];for(var r,a=0;r=t[a++];)if(r.reg.test(e))return n(r.val,r.name,r),!1}function w(e,t){var n=e.name,r=t.name;return"*"===r?-1:"*"===n?1:r.length-n.length}function C(e,t){if("/"!==e.charAt(e.length-1)&&(e+="/"),"./"===t.slice(0,2))return e+t.slice(2);if(".."===t.slice(0,2)){for(e+=t;F.test(e);)e=e.replace(F,"");return e}return"/"===t.slice(0,1)?e+t.slice(1):e+t}function k(t){if(!t)return t;var n=e;return t.split(".").forEach(function(e){n=n[e]}),n}var N=[],T=[],E=/\.js$/i,A=/(\?[^#]*)$/,_=[],O=!1;Xt=avalon.require=function(e,n,a,o){if(O){Array.isArray(e)||avalon.error("require方法的第一个参数应为数组 "+e);var l=[],c={},u=a||"callback"+setTimeout("1");o=o||{},o.baseUrl=m.baseUrl;var f=!!o.built;if(a&&(o.parentUrl=a.substr(0,a.lastIndexOf("/")),o.mapUrl=a.replace(E,"")),f){var p=t(o.defineName,o);u=p.urlNoQuery}else e.forEach(function(e){var n=t(e,o),a=r(n);a&&(c[a]||(l.push(a),c[a]="司徒正美"))});var d=Ja[u];d&&4===d.state||(Ja[u]={id:u,deps:f?e.concat():l,factory:n||i,state:3}),d||N.push(u),s()}else if(_.push(avalon.slice(arguments)),arguments.length<=2){O=!0;for(var v,h=_.splice(0,_.length);v=h.shift();)Xt.apply(null,v)}},Xt.define=function(e,t,n){"string"!=typeof e&&(n=t,t=e,e="anonymous"),Array.isArray(t)||(n=t,t=[]);var r={built:!O,defineName:e},a=[t,n,r];n.require=function(e){if(a.splice(2,0,e),Ja[e]){Ja[e].state=3;var t=!1;try{t=o(Ja[e].deps,e)}catch(r){}t&&avalon.error(e+"模块与之前的模块存在循环依赖,请不要直接用script标签引入"+e+"模块")}delete n.require,Xt.apply(null,a)};var i=r.built?"unknown":d();if(i){var l=Ja[i];l&&(l.state=2),n.require(i)}else T.push(n)},Xt.config=m,Xt.define.amd=Ja;var S=m["orig.paths"]={},M=m["orig.map"]={},j=m.packages=[],L=m["orig.args"]={};avalon.mix(Bn,{paths:function(e){avalon.mix(S,e),m.paths=g(S)},map:function(e){avalon.mix(M,e);var t=g(M,1,1);avalon.each(t,function(e,t){t.val=g(t.val)}),m.map=t},packages:function(e){e=e.concat(j);for(var t,n={},r=[],a=0;t=e[a++];){t="string"==typeof t?{name:t}:t;var i=t.name;if(!n[i]){var o=C(t.location||i,t.main||"main");o=o.replace(E,""),r.push(t),n[i]=t.location=o,t.reg=y(i)}}m.packages=r.sort()},urlArgs:function(e){"string"==typeof e&&(e={"*":e}),avalon.mix(L,e),m.urlArgs=g(L,1)},baseUrl:function(e){if(!f(e)){var t=zt.getElementsByTagName("base")[0];t&&zt.removeChild(t);var n=Ut.createElement("a");n.href=e,e=p(n,"href"),t&&zt.insertBefore(t,zt.firstChild)}e.length>3&&(m.baseUrl=e)},shim:function(e){for(var t in e){var n=e[t];Array.isArray(n)&&(n=e[t]={deps:n}),n.exportsFn||!n.exports&&!n.init||(n.exportsFn=b(n))}m.shim=e}});var D=/complete|loaded/,H=Xt.plugins={domReady:{load:i},js:{load:function(e,t,n){var r=t.url,a=t.urlNoQuery,i=m.shim[e.replace(E,"")];i?Xt(i.deps||[],function(){var e=avalon.slice(arguments);c(r,a,function(){n(i.exportsFn?i.exportsFn.apply(0,e):void 0)})}):c(r,a)}},css:{load:function(e,t,r){var a=t.url,i=Ut.createElement("link");i.rel="stylesheet",i.href=a,zt.insertBefore(i,zt.firstChild),n("debug: 已成功加载 "+a),r()}},text:{load:function(e,t,r){var a=t.url,i=Pa();i.onreadystatechange=function(){if(4===i.readyState){var e=i.status;e>399&&600>e?avalon.error(a+" 对应资源不存在或没有开启 CORS"):(n("debug: 已成功加载 "+a),r(i.responseText))}};var o="_="+(new Date-0),l=-1===a.indexOf("?")?a+"?"+o:a+"&"+o;i.open("GET",l,!0),"withCredentials"in i&&(i.withCredentials=!0),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.send(),n("debug: 正准备加载 "+a)}}};Xt.checkDeps=s;var P=/^callback\d+$/,F=/\/\w+\/\.\./,R=Ut.scripts[Ut.scripts.length-1],B=R.getAttribute("data-main");if(B){Bn.baseUrl(B);var q=m.baseUrl;m.baseUrl=q.slice(0,q.lastIndexOf("/")+1),c(q.replace(E,"")+".js")}else{var I=u(p(R,"src"));m.baseUrl=I.slice(0,I.lastIndexOf("/")+1)}};var Za,Ka=[],Qa=function(e){for(Za=!0,Xt&&(Ja["domReady!"].state=4,Xt.checkDeps());e=Ka.shift();)e(avalon)};if("complete"===Ut.readyState)setTimeout(Qa);else if(cn)Ut.addEventListener("DOMContentLoaded",Qa);else{Ut.attachEvent("onreadystatechange",function(){"complete"===Ut.readyState&&Qa()});try{var ei=null===e.frameElement}catch(Wn){}un.doScroll&&ei&&e.external&&It()}avalon.bind(e,"load",Qa),avalon.ready=function(e){Za?e(avalon):Ka.push(e)},avalon.config({loader:!0}),avalon.ready(function(){avalon.scan(Ut.body)}),"function"==typeof define&&define.amd&&define("avalon",[],function(){return avalon});var ti=e.avalon;return avalon.noConflict=function(t){return t&&e.avalon===avalon&&(e.avalon=ti),avalon},void 0===t&&(e.avalon=avalon),avalon}); \ No newline at end of file +!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("Avalon requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(){e.console&&avalon.config.debug&&Function.apply.call(console.log,console,arguments)}function r(e){return Function.apply(i,e)}function i(){}function o(e,t){"string"==typeof e&&(e=e.match(Qt)||[]);for(var n={},r=void 0!==t?t:1,a=0,i=e.length;i>a;a++)n[e[a]]=r;return n}function l(){if(e.VBArray){var t=document.documentMode;return t?t:e.XMLHttpRequest?7:6}return 0/0}function s(e){return nn.test(on.call(e))}function c(e,t){return e=Math.floor(e)||0,0>e?Math.max(t+e,0):Math.min(e,t)}function u(e){if(!e)return!1;var t=e.length;if(t===t>>>0){var n=on.call(e).slice(8,-1);if(/(?:regexp|string|function|window|global)$/i.test(n))return!1;if("Array"===n)return!0;try{return{}.propertyIsEnumerable.call(e,"length")===!1?/^\s?function/.test(e.item||e.callee):!0}catch(r){return!e.window}}return!1}function f(e,t,n){var r="for(var "+e+"i=0,n = this.length; i < n; i++){"+t.replace("_","((i in this) && fn.call(scope,this[i],i,this))")+"}"+n;return Function("fn,scope",r)}function p(e,t){try{for(;t=t.parentNode;)if(t===e)return!0;return!1}catch(n){return!1}}function d(){return(new XMLSerializer).serializeToString(this)}function v(e,t){if(e&&e.childNodes)for(var n,r=e.childNodes,a=0;n=r[a++];)if(n.tagName){var i=Ut.createElementNS(An,n.tagName.toLowerCase());ln.forEach.call(n.attributes,function(e){i.setAttribute(e.name,e.value)}),v(n,i),t.appendChild(i)}}function h(e){var t={};for(var n in e)t[n]=e[n];var r=t.target=e.srcElement;if(0===e.type.indexOf("key"))t.which=null!=e.charCode?e.charCode:e.keyCode;else if(On.test(e.type)){var a=r.ownerDocument||Ut,i="BackCompat"===a.compatMode?a.body:a.documentElement;t.pageX=e.clientX+(i.scrollLeft>>0)-(i.clientLeft>>0),t.pageY=e.clientY+(i.scrollTop>>0)-(i.clientTop>>0),t.wheelDeltaY=t.wheelDelta,t.wheelDeltaX=0}return t.timeStamp=new Date-0,t.originalEvent=e,t.preventDefault=function(){e.returnValue=!1},t.stopPropagation=function(){e.cancelBubble=!0},t}function m(e){for(var t in e)if(an.call(e,t)){var n=e[t];"function"==typeof m.plugins[t]?m.plugins[t](n):"object"==typeof m[t]?avalon.mix(m[t],n):m[t]=n}return this}function g(e){return(e+"").replace(Rn,"\\$&")}function y(e,t){var n=this.$events||(this.$events={}),r=n[e]||(n[e]=[]);if("function"==typeof t){var a=t;a.uniqueNumber=Math.random(),t={element:un,type:"user-watcher",handler:i,vmodels:[this],expr:e,uniqueNumber:a.uniqueNumber},t.wildcard=/\*/.test(e)}if(t.update)t.oneTime||avalon.Array.ensure(r,t);else{if(/\w\.*\B/.test(e)){t.getter=i;var o=this;t.update=function(){var e=this.fireArgs||[];e[2]&&t.handler.apply(o,e),delete this.fireArgs},r.sync=!0,avalon.Array.ensure(r,t)}else avalon.injectBinding(t);a&&(t.handler=a)}return function(){t.update=t.getter=t.handler=i,t.element=Ut.createElement("a")}}function b(e,t){var n=this.$events;if(n&&n[e]){t&&(t[2]=e),$(n[e],t);var r=this.$up;r&&(this.$pathname&&b.call(r,this.$pathname+"."+e,t),b.call(r,"*."+e,t))}else if(r=this.$up){var a=this.$pathname+"."+e,i=a.split(".");-1===i.indexOf("*")?(b.call(r,a,t),i[1]="*",b.call(r,i.join("."),t)):b.call(r,a,t)}}function x(e,t){for(;;){if(e.$watch){var n=e.$events||(e.$events={}),r=n[t]||(n[t]=[]);return void er.collectDependency(r)}if(e=e.$up,!e)break;t=e.$pathname+"."+t}}function $(e,t){if(e){new Date-rr>444&&"object"==typeof e[0]&&R();for(var n,r=[],a=[],i=0;n=e[i++];)"user-watcher"===n.type?r.push(n):a.push(n);if(m.async){for(pa.render(),i=0;n=a[i++];)if(n.update){var o=P(n);pa.queue[o]||(pa.queue[o]=1,pa.queue.push(n))}}else for(i=0;n=a[i++];)n.update&&n.update();for(i=0;n=r[i++];)(t&&t[2]===n.expr||n.wildcard)&&(n.fireArgs=t),n.update()}}function w(e,t){return t=t||{},t.watch=!0,k(e,t)}function C(){}function k(e,t){function r(e){return u[e]===!0}if(!e||e.$id&&e.$accessors)return e;t=t||Kt;var a=t.force||Kt,i=t.old,l=i&&i.$accessors||Kt,s=new C,c={},u={},f=[],p=[],d={};e.$skipArray&&(d=o(e.$skipArray),delete e.$skipArray);var v=e.$computed;if(v){delete e.$computed;for(var h in v)u[h]=!0,function(e,t){var n;c[e]={get:function(){return n=t.get.call(this)},set:function(r){if("function"==typeof t.set){var a=n;t.set.call(this,r);var i=this[e];this.$fire&&i!==a&&this.$fire(e,i,a)}},enumerable:!0,configurable:!0}}(h,v[h])}for(h in e){var m=e[h];In[h]||(u[h]=!0),"function"==typeof m||m&&m.nodeType||!a[h]&&("$"===h.charAt(0)||In[h]||d[h])?f.push(h):N(m)?(n("warning:计算属性建议放在$computed对象中统一定义"),function(e,t){var n;c[e]={get:function(){return n=t.get.call(this)},set:function(r){if("function"==typeof t.set){var a=n;t.set.call(this,r);var i=this[e];this.$fire&&i!==a&&this.$fire(e,i,a)}},enumerable:!0,configurable:!0}}(h,m)):(p.push(h),c[h]=l[h]?l[h]:T(h,m))}c.$model=Yn,s=zn(s,c,e),f.forEach(function(t){s[t]=e[t]}),_(s,"$id","anonymous"),_(s,"$up",i?i.$up:null),_(s,"$track",Object.keys(u)),_(s,"$active",!1),_(s,"$pathname",i?i.$pathname:""),_(s,"$accessors",c),_(s,"hasOwnProperty",r),t.watch&&(_(s,"$watch",function(){return y.apply(s,arguments)}),_(s,"$fire",function(e,t){if(0===e.indexOf("all!")){var n=e.slice(4);for(var r in avalon.vmodels){var a=avalon.vmodels[r];a.$fire&&a.$fire.apply(a,[n,t])}}else b.call(s,e,[t])})),p.forEach(function(t){var n=s[t]=e[t];n&&"object"==typeof n&&(n.$up=s,n.$pathname=t),b.call(s,t)});for(h in v)m=s[h];return s.$active=!0,s}function N(e){if(e&&"object"==typeof e){for(var t in e)if("get"!==t&&"set"!==t)return!1;return"function"==typeof e.get}}function T(e,t){var n;return t=0/0,{get:function(){return this.$active&&x(this,e),t},set:function(r){if(t!==r){var a=t;n=E(r,t),n?t=n:(n=void 0,t=r),Object(n)===n&&(n.$pathname=e,n.$up=this),this.$active&&b.call(this,e,[t,a])}},enumerable:!0,configurable:!0}}function E(e,t,n,r){if(Array.isArray(e))return A(e,t,r);if(avalon.isPlainObject(e)){if(t){var a=Xn(e),i=Xn(t);if(a.join(";")===i.join(";")){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);return t}t.$active=!1}return k(e,{old:t,watch:r})}return n?e:void 0}function A(e,t,n){if(t){var r=[0,t.length].concat(e);return t.splice.apply(t,r),t}for(var a in Kn)e[a]=Kn[a];_(e,"$up",null),_(e,"$pathname",""),_(e,"$track",j(e.length)),e._=k({length:0/0},{watch:!0}),e._.length=e.length,e._.$watch("length",function(t,n){b.call(e.$up,e.$pathname+".length",[t,n])}),n&&_(e,"$watch",function(){return y.apply(e,arguments)}),cn?Object.defineProperty(e,"$model",Yn):e.$model=O(e);for(var i=0,o=e.length;o>i;i++){var l=e[i]=E(e[i],0,1,1);Object(l)===l&&(l.$up=e)}return e}function _(e,t,n){Un?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!1,configurable:!0}):e[t]=n}function O(e){var t=avalon.type(e);if("array"===t){for(var n=[],r=0;rr;r++){n[r]=e[r];var i=t[r];i in n?(e[r]=n[i],delete n[i]):e[r]=e[i]}}function j(e){for(var t=[],n=0;e>n;n++)t[n]=vn("$proxy$each");return t}function L(e,t,n){switch(t){case"push":case"unshift":n=j(n.length);break;case"splice":if(n.length>2){{n[1],n.length-2}n=[n[0],n[1]].concat(j(n.length-2))}}Array.prototype[t].apply(e,n)}function D(e,t){t.oneTime||e&&avalon.Array.ensure(e,t)&&t.element&&(F(t,e),new Date-rr>444&&R())}function H(e,t){for(var n,r=[],a=0;n=e[a++];)r.push(t?n.$id:n.$key);return r.join(";")}function P(e){if(!e.uniqueNumber){var t=e.element;e.uniqueNumber=t?1!==t.nodeType?e.type+(e.pos||0)+"-"+P(t.parentNode):e.name+"-"+P(t):++tr}return e.uniqueNumber}function F(e,t){var n=e.lists||(e.lists=[]),r=P(e);avalon.Array.ensure(n,t),t.$uuid=t.$uuid||vn(),nr[r]||(nr[r]=1,nr.push(e))}function R(e){for(var t=nr.length,n=t,r=[],a={},i={};e=nr[--t];){var o=e.type;i[o]?i[o]++:(i[o]=1,r.push(o))}var l=!1;if(r.forEach(function(e){ar[e]!==i[e]&&(a[e]=1,l=!0)}),t=n,l)for(;e=nr[--t];)if(null!==e.element){if(a[e.type]&&q(e.element)){nr.splice(t,1),delete nr[e.uniqueNumber];for(var s,c=e.lists,u=0;s=c[u++];)avalon.Array.remove(c,s),avalon.Array.remove(s,e);B(e)}}else nr.splice(t,1);ar=i,rr=new Date}function B(e){delete nr[e.uniqueNumber],e.element=null,e.rollback&&e.rollback();for(var t in e)e[t]=null}function q(e){try{{e.parentNode.nodeType}}catch(t){return!0}return e.ifRemove&&!un.contains(e.ifRemove)&&Wt===e.parentNode?(e.parentNode&&e.parentNode.removeChild(e),!0):e.msRetain?0:1===e.nodeType?!un.contains(e):!avalon.contains(un,e)}function I(e){var t=e.nodeName;return t.toLowerCase()===t&&e.scopeName&&""===e.outerText}function V(e){"url(#default#VML)"!==e.currentStyle.behavior&&(e.style.behavior="url(#default#VML)",e.style.display="inline-block",e.style.zoom=1)}function U(e){return e.replace(/([a-z\d])([A-Z]+)/g,"$1-$2").toLowerCase()}function z(e){return!e||e.indexOf("-")<0&&e.indexOf("_")<0?e:e.replace(/[-_][^-_]/g,function(e){return e.charAt(1).toUpperCase()})}function W(e){if(!("classList"in e)){e.classList={node:e};for(var t in dr)e.classList[t.slice(1)]=dr[t]}return e.classList}function X(e){try{if("object"==typeof e)return e;e="true"===e?!0:"false"===e?!1:"null"===e?null:+e+""===e?+e:vr.test(e)?avalon.parseJSON(e):e}catch(t){}return e}function Y(e){return e.window&&e.document?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}function G(e,t){if(e.offsetWidth<=0){if(_r.test(br["@:get"](e,"display"))){var n={node:e};for(var r in Ar)n[r]=e.style[r],e.style[r]=Ar[r];t.push(n)}var a=e.parentNode;a&&1===a.nodeType&&G(a,t)}}function J(e){var t=e.tagName.toLowerCase();return"input"===t&&/checkbox|radio/.test(e.type)?"checked":t}function Z(e,t){var n=[],a=!!t;t=t||0;for(var i="unknown",o="",l=0;lu;u++)if(i.length){var p="vm"+o+"_"+u;s.push(p),c.push(t[u]),l.push.apply(l,Q(i,t[u],p,n))}n.args=c;var d=n.type,v=t.map(function(e){return String(e.$id).replace(Hr,"$1")})+e+d,h=Fr.get(v);if(h){if("duplex"===d){var m=Fr.get(v+"setter");n.setter=m.apply(m,n.args)}return n.getter=h}if(l.length||l.push("fix"+o),"duplex"===d){var g={};l.forEach(function(e){var t=e.split("=");g[t[0].trim()]=t[1].trim()}),e=e.replace(/[\$\w]+/,function(e){return g[e]?g[e]:e});var y=r(s.concat("'use strict';return function(vvv){"+e+" = vvv\n}\n"));Fr.put(v+"setter",y),n.setter=y.apply(y,n.args)}if("on"===d){-1===e.indexOf("(")?e+=".call(this, $event)":e=e.replace("(",".call(this,"),s.push("$event"),e="\nreturn "+e+";";var b=e.lastIndexOf("\nreturn"),x=e.slice(0,b),$=e.slice(b);e=x+"\n"+$}else e="\nreturn "+e+";";return h=r(s.concat("'use strict';\nvar "+l.join(",\n")+e)),Fr.put(v,h)}function nt(e){var t=Hn.test(e);if(t){var n=vt(e);return 1===n.length?n[0].expr:n.map(function(e){return e.type?"("+e.expr+")":zr(e.expr)}).join(" + ")}return e}function rt(e){return e=e.replace(Rr,"").replace(Br,function(){return"],|"}).replace(qr,function(e,t){return"["+zr(t)}).replace(Ir,function(){return'"],["'}).replace(Vr,function(){return'",'})+"]",r(["return ["+e+"]"])()}function at(e,t,n){var r=setTimeout(function(){var a=e.innerHTML;clearTimeout(r),a===n?t():at(e,t,a)})}function it(e,t){var n=e.getAttribute("avalonctrl")||t.$id;e.setAttribute("avalonctrl",n),t.$events&&(t.$events.expr=e.tagName+'[avalonctrl="'+n+'"]')}function ot(e,t){for(var n,r=0;n=e[r++];)n.vmodels=t,$n[n.type].init(n),avalon.injectBinding(n),n.getter&&1===n.element.nodeType&&n.element.removeAttribute(n.name);e.length=0}function lt(e,t){return e.priority-t.priority}function st(e,t,r){var a=!0;if(t.length){for(var i,o=oa?oa(e):e.attributes,l=[],s={},c=0;i=o[c++];){var u=i.name;if(!s[u]&&(s[u]=1,i.specified&&(r=u.match(Jr)))){var f=r[1],p=r[2]||"",d=i.value;if(Zr[f]?(p=f,f="on"):Kr[f]&&(p=f,f="attr",u="ms-"+f+"-"+p,n("warning!请改用"+u+"代替"+i.name+"!")),$n[f]){var v=d.replace(Gr,""),h=d!==v,m={type:f,param:p,element:e,name:u,expr:v,oneTime:h,uniqueNumber:i.name+"-"+P(e),priority:($n[f].priority||10*f.charCodeAt(0))+(Number(p.replace(/\D/g,""))||0)};if("html"===f||"text"===f){var g=dt(d).filters;m.expr=m.expr.replace(g,""),m.filters=g.replace(sa,function(){return m.type="html",m.group=1,""}).trim()}else if("duplex"===f)var y=u;else if("ms-if-loop"===u)m.priority+=100;else if("ms-attr-value"===u)var b=u;l.push(m)}}}if(l.length){for(l.sort(lt),y&&b&&"INPUT"===e.nodeName&&"text"===e.type&&n("warning!一个控件不能同时定义ms-attr-value与"+y),c=0;m=l[c];c++){if(f=m.type,Qr.test(f))return ot(l.slice(0,c+1),t);a&&(a=!ea.test(f))}ot(l,t)}}a&&!Wr[e.tagName]&&(gt(e)?e.msResolved:1)&&(Yr&&Yr(e),ut(e,t))}function ct(e){for(var t,n=oa?oa(e):e.attributes,r={},a=0;t=n[a++];)t.specified&&!la.test(t.name)&&(r[z(t.name)]=X(t.value));return r}function ut(e,t){var n=avalon.slice(e.childNodes);ft(n,t)}function ft(e,t){for(var n,r=0;n=e[r++];)switch(n.nodeType){case 1:var a=n;if(pt(n,t),!a.msResolved&&a.parentNode&&1===a.parentNode.nodeType){var i=gt(a);if(i){var o=a.localName?a.localName.replace(i+":",""):a.nodeName,l=i+":"+z(o);da.push({library:i,element:a,fullName:l,widget:o,vmodels:t,name:"widget"}),avalon.components[l]&&avalon.component(l)}}n.msHasEvent&&avalon.fireDom(n,"datasetchanged",{bubble:n.msHasEvent});break;case 3:Hn.test(n.nodeValue)&&ht(n,t,r)}}function pt(e,t,r){var a=e.getAttribute("ms-skip");if(!e.getAttributeNode)return n("warning "+e.tagName+" no getAttributeNode method");var i=e.getAttributeNode("ms-important"),o=e.getAttributeNode("ms-controller");if("string"!=typeof a){if(r=i||o){var l=avalon.vmodels[r.value];if(!l)return;t=r===i?[l]:[l].concat(t);var s=r.name;e.removeAttribute(s),avalon(e).removeClass(s),it(e,l)}st(e,t)}}function dt(e){if(e.indexOf("|")>0){var t=e.replace(ua,function(e){return Array(e.length+1).join("1")}),n=t.replace(ca,"ᄢ㍄").indexOf("|");if(n>-1)return{type:"text",filters:e.slice(n).trim(),expr:e.slice(0,n)}}return{type:"text",expr:e,filters:""}}function vt(e){for(var t,n,r=[],a=0;;){if(n=e.indexOf(Ln,a),-1===n)break;if(t=e.slice(a,n),t&&r.push({expr:t}),a=n+Ln.length,n=e.indexOf(Dn,a),-1===n)break;t=e.slice(a,n),t&&r.push(dt(t,a)),a=n+Dn.length}return t=e.slice(a),t&&r.push({expr:t}),r}function ht(e,t,n){var r=[],a=vt(e.data);if(a.length){for(var i,o=0;i=a[o++];){var l=Ut.createTextNode(i.expr);i.type&&(i.expr=i.expr.replace(Gr,function(){return i.oneTime=!0,""}),i.element=l,i.filters=i.filters.replace(sa,function(){return i.type="html",""}),i.pos=1e3*n+o,r.push(i)),fn.appendChild(l)}e.parentNode.replaceChild(fn,e),r.length&&ot(r,t)}}function mt(e,t){if(t)for(var n,r=0;n=e[r++];)if(n.hasOwnProperty(t)&&"object"==typeof n[t]){var a=n[t];return a.$model||a}return{}}function gt(e){if(e.scopeName&&"HTML"!==e.scopeName)return e.scopeName;var t=e.nodeName.toLowerCase(),n=t.indexOf(":");return n>0?t.slice(0,n):void 0}function yt(e){return null==e?"":e}function bt(e,t,n){return t.param.replace(en,function(r){var a=avalon.duplexHooks[r];a&&"function"==typeof a[n]&&(e=a[n](e,t))}),e}function xt(){for(var e=ka.length-1;e>=0;e--){var t=ka[e];t()===!1&&ka.splice(e,1)}ka.length||clearInterval(Ca)}function $t(e,t){if(!e||1!==e.nodeType)return null;if(t)var n=t.effectName,r=t.effectDriver;else n=e.getAttribute("data-effect-name"),r=e.getAttribute("data-effect-driver");if(!n||!r)return null;var a=Ma.pop()||new kt;return a.el=e,a.driver=r,a.useCss="j"!==r,a.useCss&&(t&&avalon(e).addClass(t.effectClass),a.cssEvent="t"===r?Ta:Ea),a.name=n,a.callbacks=avalon.effects[n]||{},a}function wt(e,t){var n=e.getAttribute("data-effect-name");if(n){t.effectName=n,t.effectDriver=e.getAttribute("data-effect-driver");var r=+e.getAttribute("data-effect-stagger");t.effectLeaveStagger=+e.getAttribute("data-effect-leave-stagger")||r,t.effectEnterStagger=+e.getAttribute("data-effect-enter-stagger")||r,t.effectClass=e.className||0/0}}function Ct(e){return e.replace(/^[\S]/g,function(e){return e.toUpperCase()})}function kt(){}function Nt(e,t){var n=e.callbacks[t+"Class"];return"string"==typeof n?n:"function"==typeof n?n():e.name+"-"+t}function Tt(e,t,n){var r=e.callbacks[t];r&&r.call(e,e.el,n)}function Et(e,t,n){var r=e.templateCache&&e.templateCache[t];if(r){for(var a,i=Ut.createDocumentFragment();a=r.firstChild;)i.appendChild(a);return i}return avalon.parseHTML(n)}function At(e){for(var t=Ut.createDocumentFragment(),n=0,r=e.length;r>n;n++)t.appendChild(e[n]);return t}function _t(e,t,n){for(var r,a=0;r=e[a++];)r.className===n.effectClass&&avalon.effect.apply(r,t,i,i,n)}function Ot(e,t,n){return e?setTimeout(t,++n*e):t(),n}function St(e,t){for(var n=fn.cloneNode(!1),r=e,a=r.nodeValue,o=t&&Math.max(+t.staggerIndex,0),l=avalon.slice(r.parentNode.childNodes),s=l.indexOf(r);;){var c=l[--s];if(!c||0===String(c.nodeValue).indexOf(a))break;t&&c.className===t.effectClass?(e=c,function(e){t.staggerIndex=Ot(t.effectLeaveStagger,function(){avalon.effect.apply(e,0,i,function(){n.appendChild(e)},t)},o)}(c)):n.insertBefore(c,n.firstChild)}return n.appendChild(r),n}function Mt(e,t,n,r,a){var i=e.template.cloneNode(!0),o=avalon.slice(i.childNodes);i.appendChild(n.$anchor),a&&t.appendChild(i);var l=[n].concat(e.vmodels),s={nodes:o,vmodels:l,content:i};r.push(s)}function jt(e){var t="object"===e.xtype?Pt:Lt,n=t(e),r=n.$anchor||(n.$anchor=e.element.cloneNode(!1));return r.nodeValue=e.signature,n.$outer=e.$outer,n}function Lt(e,t){for(var n=e.param||"el",r=0,a=qa.length;a>r;r++){var i=qa[r];if(i&&i.hasOwnProperty(n)){qa.splice(r,1),t=i;break}}return t||(t=Dt(n)),t}function Dt(e){var t={$outer:{},$index:0,$oldIndex:0,$anchor:null,$first:!1,$last:!1,$remove:avalon.noop};t[e]=0/0;var n={$last:1,$first:1,$index:1};n[e]=1;var r=w(t,{force:n});return r.$id=vn("$proxy$each"),r}function Ht(e,t,n){if("array"===n){e.$remove=function(){t.$repeat.removeAt(e.$index)};var r=t.param;e.$watch(r,function(n){var r=e.$index;t.$repeat[r]=n})}else e.$watch("$val",function(n){t.$repeat[e.$key]=n})}function Pt(){return Ia.pop()||Ft()}function Ft(){var e=w({$key:"",$val:0/0,$index:0,$oldIndex:0,$outer:{},$anchor:null},{force:{$key:1,$val:1,$index:1}});return e.$id=vn("$proxy$with"),e}function Rt(e,t,n){var r=e[t];if(r){var a=0===r.$id.indexOf("$proxy$each")?qa:Ia;r.$outer={};for(var i in r.$events){var o=r.$events[i];Array.isArray(o)&&(o.length=0,i===n?r[n]=0/0:"$val"===i&&(r.$val=0/0))}a.unshift(r)>m.maxRepeatSize&&a.pop(),delete e[t]}}function Bt(e,t){var n="_"+e;if(!Bt[n]){var r=Ut.createElement(e);un.appendChild(r),t=cn?getComputedStyle(r,null).display:r.currentStyle.display,un.removeChild(r),Bt[n]=t}return Bt[n]}function qt(e,t,n,r){e=(e+"").replace(/[^0-9+\-Ee.]/g,"");var a=isFinite(+e)?+e:0,i=isFinite(+t)?Math.abs(t):3,o=r||",",l=n||".",s="",c=function(e,t){var n=Math.pow(10,t);return""+(Math.round(e*n)/n).toFixed(t)};return s=(i?c(a,i):""+Math.round(a)).split("."),s[0].length>3&&(s[0]=s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,o)),(s[1]||"").length.avalonHide{ display: none!important }",Wt.setAttribute("ms-skip","1"),Wt.className="avalonHide";var Xt,Yt=/\[native code\]/,Gt="$"+Vt,Jt=e.require,Zt=e.define,Kt={},Qt=/[^, ]+/g,en=/\w+/g,tn=/^\[object SVG\w*Element\]$/,nn=/^\[object (?:Window|DOMWindow|global)\]$/,rn=Object.prototype,an=rn.hasOwnProperty,on=rn.toString,ln=Array.prototype,sn=ln.slice,cn=e.dispatchEvent,un=Ut.documentElement,fn=Ut.createDocumentFragment(),pn=Ut.createElement("div"),dn={};"Boolean Number String Function Array Date RegExp Object Error".replace(Qt,function(e){dn["[object "+e+"]"]=e.toLowerCase()});var vn=function(e){return e=e||"avalon",String(Math.random()+Math.random()).replace(/\d\.\d{4}/,e)},hn=l();avalon=function(e){return new avalon.init(e)},avalon.nextTick=new function(){function t(){for(var e=a.length,t=0;e>t;t++)a[t]();a=a.slice(e)}var n=e.setImmediate,r=e.MutationObserver;if(n)return n.bind(e);var a=[];if(r){var i=document.createTextNode("avalon");new r(t).observe(i,{characterData:!0});var o=!1;return function(e){a.push(e),o=!o,i.data=o}}return function(e){setTimeout(e,4)}},avalon.init=function(e){this[0]=this.element=e},avalon.fn=avalon.prototype=avalon.init.prototype,avalon.type=function(e){return null==e?String(e):"object"==typeof e||"function"==typeof e?dn[on.call(e)]||"object":typeof e};var mn="object"==typeof alert?function(e){try{return/^\s*\bfunction\b/.test(e+"")}catch(t){return!1}}:function(e){return"[object Function]"===on.call(e)};avalon.isFunction=mn,avalon.isWindow=function(e){return e?e==e.document&&e.document!=e:!1},s(e)&&(avalon.isWindow=s);var gn;for(gn in avalon({}))break;var yn="0"!==gn;avalon.isPlainObject=function(e,t){if(!e||"object"!==avalon.type(e)||e.nodeType||avalon.isWindow(e))return!1;try{if(e.constructor&&!an.call(e,"constructor")&&!an.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}if(yn)for(t in e)return an.call(e,t);for(t in e);return void 0===t||an.call(e,t)},Yt.test(Object.getPrototypeOf)&&(avalon.isPlainObject=function(e){return"[object Object]"===on.call(e)&&Object.getPrototypeOf(e)===rn}),avalon.mix=avalon.fn.mix=function(){var e,t,n,r,a,i,o=arguments[0]||{},l=1,s=arguments.length,c=!1;for("boolean"==typeof o&&(c=o,o=arguments[1]||{},l++),"object"==typeof o||mn(o)||(o={}),l===s&&(o=this,l--);s>l;l++)if(null!=(e=arguments[l]))for(t in e){n=o[t];try{r=e[t]}catch(u){continue}o!==r&&(c&&r&&(avalon.isPlainObject(r)||(a=Array.isArray(r)))?(a?(a=!1,i=n&&Array.isArray(n)?n:[]):i=n&&avalon.isPlainObject(n)?n:{},o[t]=avalon.mix(c,i,r)):void 0!==r&&(o[t]=r))}return o},avalon.mix({rword:Qt,subscribers:Gt,version:1.53,ui:{},log:n,slice:cn?function(e,t,n){return sn.call(e,t,n)}:function(e,t,n){var r=[],a=e.length;if(void 0===n&&(n=a),"number"==typeof n&&isFinite(n)){t=c(t,a),n=c(n,a);for(var i=t;n>i;++i)r[i-t]=e[i]}return r},noop:i,error:function(e,t){throw(t||Error)(e)},oneObject:o,range:function(e,t,n){n||(n=1),null==t&&(t=e||0,e=0);for(var r=-1,a=Math.max(0,Math.ceil((t-e)/n)),i=new Array(a);++rn&&t(n,e[n])!==!1;n++);else for(n in e)if(e.hasOwnProperty(n)&&t(n,e[n])===!1)break}},getWidgetData:function(e,t){var n=avalon(e).data(),r={};for(var a in n)0===a.indexOf(t)&&(r[a.replace(t,"").replace(/\w/,function(e){return e.toLowerCase()})]=n[a]);return r},Array:{ensure:function(e,t){return-1===e.indexOf(t)?e.push(t):void 0},removeAt:function(e,t){return!!e.splice(t,1).length},remove:function(e,t){var n=e.indexOf(t);return~n?avalon.Array.removeAt(e,n):!1}}});var bn=avalon.bindingHandlers={},xn=avalon.bindingExecutors={},$n=avalon.directives={};avalon.directive=function(e,t){return bn[e]=t.init=t.init||i,xn[e]=t.update=t.update||i,$n[e]=t};var wn=new function(){function e(e){this.size=0,this.limit=e,this.head=this.tail=void 0,this._keymap={}}var t=e.prototype;return t.put=function(e,t){var n={key:e,value:t};return this._keymap[e]=n,this.tail?(this.tail.newer=n,n.older=this.tail):this.head=n,this.tail=n,this.size===this.limit?this.shift():this.size++,t},t.shift=function(){var e=this.head;e&&(this.head=this.head.newer,this.head.older=e.newer=e.older=this._keymap[e.key]=void 0,delete this._keymap[e.key])},t.get=function(e){var t=this._keymap[e];if(void 0!==t)return t===this.tail?t.value:(t.newer&&(t===this.head&&(this.head=t.newer),t.newer.older=t.older),t.older&&(t.older.newer=t.newer),t.newer=void 0,t.older=this.tail,this.tail&&(this.tail.newer=t),this.tail=t,t.value)},e};if(!"司徒正美".trim){var Cn=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;String.prototype.trim=function(){return this.replace(Cn,"")}}var kn=!{toString:null}.propertyIsEnumerable("toString"),Nn=function(){}.propertyIsEnumerable("prototype"),Tn=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],En=Tn.length;if(Object.keys||(Object.keys=function(e){var t=[],n=Nn&&"function"==typeof e;if("string"==typeof e||e&&e.callee)for(var r=0;rl;l++){var s=Tn[l];o&&"constructor"===s||!an.call(e,s)||t.push(s)}return t}),Array.isArray||(Array.isArray=function(e){return"[object Array]"===on.call(e)}),i.bind||(Function.prototype.bind=function(e){if(arguments.length<2&&void 0===e)return this;var t=this,n=arguments;return function(){var r,a=[];for(r=1;rr&&(r+=n);n>r;r++)if(this[r]===e)return r;return-1},lastIndexOf:function(e,t){var n=this.length,r=null==t?n-1:t;for(0>r&&(r=Math.max(0,n+r));r>=0;r--)if(this[r]===e)return r;return-1},forEach:f("","_",""),filter:f("r=[],j=0,","if(_)r[j++]=this[i]","return r"),map:f("r=[],","r[i]=_","return r"),some:f("","if(_)return true","return false"),every:f("","if(!_)return false","return true")}),avalon.contains=p,Ut.contains||(Ut.contains=function(e){return p(Ut,e)}),e.SVGElement){Ut.createTextNode("x").contains||(Node.prototype.contains=function(e){return!!(16&this.compareDocumentPosition(e))});var An="http://www.w3.org/2000/svg",_n=Ut.createElementNS(An,"svg");_n.innerHTML='',tn.test(_n.firstChild)||Object.defineProperties(SVGElement.prototype,{outerHTML:{enumerable:!0,configurable:!0,get:d,set:function(e){var t=this.tagName.toLowerCase(),n=this.parentNode,r=avalon.parseHTML(e);if("svg"===t)n.insertBefore(r,this);else{var a=Ut.createDocumentFragment();v(r,a),n.insertBefore(a,this)}n.removeChild(this)}},innerHTML:{enumerable:!0,configurable:!0,get:function(){var e=this.outerHTML,t=new RegExp("<"+this.nodeName+'\\b(?:(["\'])[^"]*?(\\1)|[^>])*>',"i"),n=new RegExp("$","i");return e.replace(t,"").replace(n,"")},set:function(e){if(avalon.clearHTML){avalon.clearHTML(this);var t=avalon.parseHTML(e);v(t,this)}}}})}!un.outerHTML&&e.HTMLElement&&HTMLElement.prototype.__defineGetter__("outerHTML",d);var On=/^(?:mouse|contextmenu|drag)|click/,Sn=avalon.eventHooks;if("onmouseenter"in un||avalon.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){Sn[e]={type:t,fn:function(t,n){return function(r){var a=r.relatedTarget;return a&&(a===t||16&t.compareDocumentPosition(a))?void 0:(delete r.type,r.type=e,n.call(t,r))}}}}),avalon.each({AnimationEvent:"animationend",WebKitAnimationEvent:"webkitAnimationEnd"},function(t,n){e[t]&&!Sn.animationend&&(Sn.animationend={type:n})}),"oninput"in Ut.createElement("input")||(Sn.input={type:"propertychange",deel:function(e,t){return function(n){return"value"===n.propertyName?(n.type="input",t.call(e,n)):void 0}}}),void 0===Ut.onmousewheel){var Mn=void 0!==Ut.onwheel?"wheel":"DOMMouseScroll",jn="wheel"===Mn?"deltaY":"detail";Sn.mousewheel={type:Mn,fn:function(e,t){return function(n){n.wheelDeltaY=n.wheelDelta=n[jn]>0?-120:120,n.wheelDeltaX=0,Object.defineProperty&&Object.defineProperty(n,"type",{value:"mousewheel"}),t.call(e,n)}}}}var Ln,Dn,Hn,Pn,Fn,Rn=/[-.*+?^${}()|[\]\/\\]/g,Bn={loader:function(t){var n=Xt&&t;e.require=n?Xt:Jt,e.define=n?Xt.define:Zt},interpolate:function(e){if(Ln=e[0],Dn=e[1],Ln===Dn){throw new SyntaxError("openTag!==closeTag")}m.openTag=Ln,m.closeTag=Dn;var t=g(Ln),n=g(Dn);Hn=new RegExp(t+"(.*?)"+n),Pn=new RegExp(t+"(.*?)"+n,"g"),Fn=new RegExp(t+".*?"+n+"|\\sms-")}};m.async=!0,m.debug=!0,m.plugins=Bn,m.plugins.interpolate(["{{","}}"]),m.paths={},m.shim={},m.maxRepeatSize=100,avalon.config=m;var qn=avalon.vmodels={};avalon.define=function(e){var t=e.$id;t||n("warning: vm必须指定$id");var r=w(e);return r.$id=t,qn[t]=r};var In=o("$id,$watch,$fire,$events,$model,$skipArray,$active,$pathname,$up,$track,$accessors"),Vn=Object.defineProperty,Un=!0;try{Vn({},"_",{value:"x"});var zn=Object.defineProperties}catch(Wn){Un=!1}var Xn=Yt.test(Object.key)?Object.key:function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&!In[n]&&t.push(n);return t},Yn={get:function(){return O(this)},set:i,enumerable:!1,configurable:!0};if(!Un&&("__defineGetter__"in avalon&&(Vn=function(e,t,n){return"value"in n&&(e[t]=n.value),"get"in n&&e.__defineGetter__(t,n.get),"set"in n&&e.__defineSetter__(t,n.set),e},zn=function(e,t){for(var n in t)t.hasOwnProperty(n)&&Vn(e,n,t[n]);return e}),hn)){var Gn={};e.execScript(["Function parseVB(code)"," ExecuteGlobal(code)","End Function"].join("\n"),"VBScript"),zn=function(t,n,r){var a=[];a.push("\r\n Private [__data__], [__proxy__]"," Public Default Function [__const__](d"+Vt+", p"+Vt+")"," Set [__data__] = d"+Vt+": set [__proxy__] = p"+Vt," Set [__const__] = Me"," End Function");var i={};for(t in n)i[t]=!0,a.push(" Public Property Let ["+t+"](val"+Vt+")",' Call [__proxy__](Me,[__data__], "'+t+'", val'+Vt+")"," End Property"," Public Property Set ["+t+"](val"+Vt+")",' Call [__proxy__](Me,[__data__], "'+t+'", val'+Vt+")"," End Property"," Public Property Get ["+t+"]"," On Error Resume Next"," Set["+t+'] = [__proxy__](Me,[__data__],"'+t+'")'," If Err.Number <> 0 Then"," ["+t+'] = [__proxy__](Me,[__data__],"'+t+'")'," End If"," On Error Goto 0"," End Property");for(t in r)i[t]!==!0&&(i[t]=!0,a.push(" Public ["+t+"]"));for(t in In)i[t]!==!0&&(i[t]=!0,a.push(" Public ["+t+"]"));a.push(" Public [hasOwnProperty]"),a.push("End Class");var o=a.join("\r\n"),l=Gn[o];l||(l=vn("VBClass"),e.parseVB("Class "+l+o),e.parseVB(["Function "+l+"Factory(a, b)"," Dim o"," Set o = (New "+l+")(a, b)"," Set "+l+"Factory = o","End Function"].join("\r\n")),Gn[o]=l);var s=e[l+"Factory"](n,S);return s}}var Jn=["push","pop","shift","unshift","splice"],Zn=Array.prototype,Kn={notify:function(){b.call(this.$up,this.$pathname) +},set:function(e,t){if(e>>>0===e&&this[e]!==t){if(e>this.length)throw Error(e+"set方法的第一个参数不能大于原数组长度");b.call(this.$up,this.$pathname+".*",[t,this[e]]),this.splice(e,1,t)}},contains:function(e){return-1!==this.indexOf(e)},ensure:function(e){return this.contains(e)||this.push(e),this},pushArray:function(e){return this.push.apply(this,e)},remove:function(e){return this.removeAt(this.indexOf(e))},removeAt:function(e){return e>>>0===e?this.splice(e,1):[]},size:function(){return this._.length},removeAll:function(e){if(Array.isArray(e))for(var t=this.length-1;t>=0;t--)-1!==e.indexOf(this[t])&&(Qn.call(this.$track,t,1),Qn.call(this,t,1));else if("function"==typeof e)for(t=this.length-1;t>=0;t--){var n=this[t];e(n,t)&&(Qn.call(this.$track,t,1),Qn.call(this,t,1))}else Qn.call(this.$track,0,this.length),Qn.call(this,0,this.length);cn||(this.$model=O(this)),this.notify(),this._.length=this.length},clear:function(){return this.removeAll()}},Qn=Zn.splice;Jn.forEach(function(e){var t=Zn[e];Kn[e]=function(){for(var n=[],r=0,a=arguments.length;a>r;r++)n[r]=E(arguments[r],0,1,1);var i=t.apply(this,n);return L(this.$track,e,n),cn||(this.$model=O(this)),this.notify(),this._.length=this.length,i}}),"sort,reverse".replace(Qt,function(e){Kn[e]=function(){var t=this.concat(),n=this,r=Math.random(),a=[],i=!1;Zn[e].apply(n,arguments);for(var o=0,l=t.length;l>o;o++){var s=n[o],c=t[o];if(s===c)a.push(o);else{var u=t.indexOf(s);a.push(u),t[u]=r,i=!0}}return i&&(M(this.$track,a),cn||(this.$model=O(this)),this.notify()),this}});var er=function(){var e,t=[];return{begin:function(n){t.push(e),e=n},end:function(){e=t.pop()},collectDependency:function(t){e&&e.callback(t)}}}();avalon.injectBinding=function(e){e.handler=e.handler||$n[e.type].update||i,e.update=function(){var t=!1;e.getter||(t=!0,er.begin({callback:function(t){D(t,e)}}),e.getter=tt(e.expr,e.vmodels,e),e.observers.forEach(function(t){t.v.$watch(t.p,e)}),delete e.observers);try{var r,a,i=e.fireArgs;if(delete e.fireArgs,i?(r=i[0],a=i[1]):r="on"===e.type?e.getter+"":e.getter.apply(0,e.args),a="undefined"==typeof a?e.oldValue:a,e._filters&&(r=Ga.$filter.apply(0,[r].concat(e._filters))),e.signature){var o=avalon.type(r);if("array"!==o&&"object"!==o)throw Error("warning:"+e.expr+"只能是对象或数组");e.xtype=o;var l=H(e.proxies||[],o),s=r.$track||("array"===o?j(r.length):Object.keys(r));e.track=s,l!==s.join(";")&&(e.handler(r,a),e.oldValue=1)}else(Array.isArray(r)?r.length===(a&&a.length):1)?"oldValue"in e&&r===a||(e.handler(r,a),e.oldValue=r):(e.handler(r,a),e.oldValue=r.concat())}catch(c){delete e.getter,n("warning:exception throwed in [avalon.injectBinding] ",c);var u=e.element;u&&3===u.nodeType&&(u.nodeValue=Ln+(e.oneTime?"::":"")+e.expr+Dn)}finally{t&&er.end()}},e.update()};var tr=0,nr=avalon.$$subscribers=[],rr=new Date,ar={},ir={area:[1,"",""],param:[1,"",""],col:[2,"","
"],legend:[1,"
","
"],option:[1,""],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],g:[1,'',""],_default:cn?[0,"",""]:[1,"X
","
"]};ir.th=ir.td,ir.optgroup=ir.option,ir.tbody=ir.tfoot=ir.colgroup=ir.caption=ir.thead,String("circle,defs,ellipse,image,line,path,polygon,polyline,rect,symbol,text,use").replace(Qt,function(e){ir[e]=ir.g});var or=/<([\w:]+)/,lr=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,sr=cn?/[^\d\D]/:/(<(?:script|link|style|meta|noscript))/gi,cr=o(["","text/javascript","text/ecmascript","application/ecmascript","application/javascript"]),ur=/<(?:tb|td|tf|th|tr|col|opt|leg|cap|area)/,fr=Ut.createElement("script"),pr=/<|&#?\w+;/;avalon.parseHTML=function(e){var t=fn.cloneNode(!1);if("string"!=typeof e)return t;if(!pr.test(e))return t.appendChild(Ut.createTextNode(e)),t;e=e.replace(lr,"<$1>").trim();var n,r,a=(or.exec(e)||["",""])[1].toLowerCase(),i=ir[a]||ir._default,o=pn;cn||(e=e.replace(sr,"
$1")),o.innerHTML=i[1]+e+i[2];var l=o.getElementsByTagName("script");if(l.length)for(var s,c=0;s=l[c++];)cr[s.type]&&(r=fr.cloneNode(!1),ln.forEach.call(s.attributes,function(e){e&&e.specified&&(r[e.name]=e.value,r.setAttribute(e.name,e.value))}),r.text=s.text,s.parentNode.replaceChild(r,s));if(!cn){var u="X
"===i[1]?o.lastChild.firstChild:o.lastChild;if(u&&"TABLE"===u.tagName&&"tbody"!==a)for(l=u.childNodes,c=0;s=l[c++];)if("TBODY"===s.tagName&&!s.innerHTML){u.removeChild(s);break}l=o.getElementsByTagName("br");for(var f=l.length;s=l[--f];)"msNoScope"===s.className&&s.parentNode.removeChild(s);for(l=o.all,c=0;s=l[c++];)I(s)&&V(s)}for(c=i[0];c--;o=o.lastChild);for(;n=o.firstChild;)t.appendChild(n);return t},avalon.innerHTML=function(e,t){if(!cn&&!sr.test(t)&&!ur.test(t))try{return void(e.innerHTML=t)}catch(n){}var r=this.parseHTML(t);this.clearHTML(e).appendChild(r)},avalon.clearHTML=function(e){for(e.textContent="";e.firstChild;)e.removeChild(e.firstChild);return e};var dr={_toString:function(){var e=this.node,t=e.className,n="string"==typeof t?t:t.baseVal;return n.split(/\s+/).join(" ")},_contains:function(e){return(" "+this+" ").indexOf(" "+e+" ")>-1},_add:function(e){this.contains(e)||this._set(this+" "+e)},_remove:function(e){this._set((" "+this+" ").replace(" "+e+" "," "))},__set:function(e){e=e.trim();var t=this.node;tn.test(t)?t.setAttribute("class",e):t.className=e}};"add,remove".replace(Qt,function(e){avalon.fn[e+"Class"]=function(t){var n=this[0];return t&&"string"==typeof t&&n&&1===n.nodeType&&t.replace(/\S+/g,function(t){W(n)[e](t)}),this}}),avalon.fn.mix({hasClass:function(e){var t=this[0]||{};return 1===t.nodeType&&W(t).contains(e)},toggleClass:function(e,t){for(var n,r=0,a=String(e).split(/\s+/),i="boolean"==typeof t;n=a[r++];){var o=i?t:!this.hasClass(n);this[o?"addClass":"removeClass"](n)}return this},attr:function(e,t){return 2===arguments.length?(this[0].setAttribute(e,t),this):this[0].getAttribute(e)},data:function(e,t){switch(e="data-"+U(e||""),arguments.length){case 2:return this.attr(e,t),this;case 1:var n=this.attr(e);return X(n);case 0:var r={};return ln.forEach.call(this[0].attributes,function(t){t&&(e=t.name,e.indexOf("data-")||(e=z(e.slice(5)),r[e]=X(t.value)))}),r}},removeData:function(e){return e="data-"+U(e),this[0].removeAttribute(e),this},css:function(e,t){if(avalon.isPlainObject(e))for(var n in e)avalon.css(this,n,e[n]);else var r=avalon.css(this,e,t);return void 0!==r?r:this},position:function(){var e,t,n=this[0],r={top:0,left:0};if(n)return"fixed"===this.css("position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),"HTML"!==e[0].tagName&&(r=e.offset()),r.top+=avalon.css(e[0],"borderTopWidth",!0),r.left+=avalon.css(e[0],"borderLeftWidth",!0),r.top-=e.scrollTop(),r.left-=e.scrollLeft()),{top:t.top-r.top-avalon.css(n,"marginTop",!0),left:t.left-r.left-avalon.css(n,"marginLeft",!0)}},offsetParent:function(){for(var e=this[0].offsetParent;e&&"static"===avalon.css(e,"position");)e=e.offsetParent;return avalon(e||un)},bind:function(e,t,n){return this[0]?avalon.bind(this[0],e,t,n):void 0},unbind:function(e,t,n){return this[0]&&avalon.unbind(this[0],e,t,n),this},val:function(e){var t=this[0];if(t&&1===t.nodeType){var n=0===arguments.length,r=n?":get":":set",a=Sr[J(t)+r];if(a)var i=a(t,e);else{if(n)return(t.value||"").replace(/\r/g,"");t.value=e}}return n?i:this}});var vr=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,hr=/^[\],:{}\s]*$/,mr=/(?:^|:|,)(?:\s*\[)+/g,gr=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,yr=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g;avalon.parseJSON=e.JSON?JSON.parse:function(e){if("string"==typeof e){if(e=e.trim(),e&&hr.test(e.replace(gr,"@").replace(yr,"]").replace(mr,"")))return new Function("return "+e)();avalon.error("Invalid JSON: "+e)}return e},avalon.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){avalon.fn[e]=function(n){var r=this[0]||{},a=Y(r),i="scrollTop"===e;return arguments.length?void(a?a.scrollTo(i?avalon(a).scrollLeft():n,i?n:avalon(a).scrollTop()):r[e]=n):a?t in a?a[t]:un[e]:r[e]}});var br=avalon.cssHooks={},xr=["","-webkit-","-o-","-moz-","-ms-"],$r={"float":cn?"cssFloat":"styleFloat"};if(avalon.cssNumber=o("animationIterationCount,columnCount,order,flex,flexGrow,flexShrink,fillOpacity,fontWeight,lineHeight,opacity,orphans,widows,zIndex,zoom"),avalon.cssName=function(e,t,n){if($r[e])return $r[e];t=t||un.style;for(var r=0,a=xr.length;a>r;r++)if(n=z(xr[r]+e),n in t)return $r[e]=n;return null},br["@:set"]=function(e,t,n){try{e.style[t]=n}catch(r){}},e.getComputedStyle)br["@:get"]=function(e,t){if(!e||!e.style)throw new Error("getComputedStyle要求传入一个节点 "+e);var n,r=getComputedStyle(e,null);return r&&(n="filter"===t?r.getPropertyValue(t):r[t],""===n&&(n=e.style[t])),n},br["opacity:get"]=function(e){var t=br["@:get"](e,"opacity");return""===t?"1":t};else{var wr=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,Cr=/^(top|right|bottom|left)$/,kr=/alpha\([^)]*\)/i,Nr=!!e.XDomainRequest,Tr="DXImageTransform.Microsoft.Alpha",Er={thin:Nr?"1px":"2px",medium:Nr?"3px":"4px",thick:Nr?"5px":"6px"};br["@:get"]=function(e,t){var n=e.currentStyle,r=n[t];if(wr.test(r)&&!Cr.test(r)){var a=e.style,i=a.left,o=e.runtimeStyle.left;e.runtimeStyle.left=n.left,a.left="fontSize"===t?"1em":r||0,r=a.pixelLeft+"px",a.left=i,e.runtimeStyle.left=o}return"medium"===r&&(t=t.replace("Width","Style"),"none"===n[t]&&(r="0px")),""===r?"auto":Er[r]||r},br["opacity:set"]=function(e,t,n){var r=e.style,a=isFinite(n)&&1>=n?"alpha(opacity="+100*n+")":"",i=r.filter||"";r.zoom=1,r.filter=(kr.test(i)?i.replace(kr,a):i+" "+a).trim(),r.filter||r.removeAttribute("filter")},br["opacity:get"]=function(e){var t=e.filters.alpha||e.filters[Tr],n=t&&t.enabled?t.opacity:100;return n/100+""}}"top,left".replace(Qt,function(e){br[e+":get"]=function(t){var n=br["@:get"](t,e);return/px$/.test(n)?n:avalon(t).position()[e]+"px"}});var Ar={position:"absolute",visibility:"hidden",display:"block"},_r=/^(none|table(?!-c[ea]).+)/;"Width,Height".replace(Qt,function(e){var t=e.toLowerCase(),n="client"+e,r="scroll"+e,a="offset"+e;br[t+":get"]=function(t,n,r){var i=-4;"number"==typeof r&&(i=r),n="Width"===e?["Left","Right"]:["Top","Bottom"];var o=t[a];return 2===i?o+avalon.css(t,"margin"+n[0],!0)+avalon.css(t,"margin"+n[1],!0):(0>i&&(o=o-avalon.css(t,"border"+n[0]+"Width",!0)-avalon.css(t,"border"+n[1]+"Width",!0)),-4===i&&(o=o-avalon.css(t,"padding"+n[0],!0)-avalon.css(t,"padding"+n[1],!0)),o)},br[t+"&get"]=function(e){var n=[];G(e,n);for(var r,a=br[t+":get"](e),i=0;r=n[i++];){e=r.node;for(var o in r)"string"==typeof r[o]&&(e.style[o]=r[o])}return a},avalon.fn[t]=function(i){var o=this[0];if(0===arguments.length){if(o.setTimeout)return o["inner"+e]||o.document.documentElement[n]||o.document.body[n];if(9===o.nodeType){var l=o.documentElement;return Math.max(o.body[r],l[r],o.body[a],l[a],l[n])}return br[t+"&get"](o)}return this.css(t,i)},avalon.fn["inner"+e]=function(){return br[t+":get"](this[0],void 0,-2)},avalon.fn["outer"+e]=function(e){return br[t+":get"](this[0],void 0,e===!0?2:0)}}),avalon.fn.offset=function(){var e=this[0],t={left:0,top:0};if(!e||!e.tagName||!e.ownerDocument)return t;var n=e.ownerDocument,r=n.body,a=n.documentElement,i=n.defaultView||n.parentWindow;if(!avalon.contains(a,e))return t;e.getBoundingClientRect&&(t=e.getBoundingClientRect());var o=a.clientTop||r.clientTop,l=a.clientLeft||r.clientLeft,s=Math.max(i.pageYOffset||0,a.scrollTop,r.scrollTop),c=Math.max(i.pageXOffset||0,a.scrollLeft,r.scrollLeft);return{top:t.top+s-o,left:t.left+c-l}};var Or=/^]+))?)*\s+value[\s=]/i,Sr={"option:get":hn?function(e){return Or.test(e.outerHTML)?e.value:e.text.trim()}:function(e){return e.value},"select:get":function(e,t){for(var n,r=e.options,a=e.selectedIndex,i=Sr["option:get"],o="select-one"===e.type||0>a,l=o?null:[],s=o?a+1:r.length,c=0>a?s:o?a:0;s>c;c++)if(n=r[c],(n.selected||c===a)&&!n.disabled){if(t=i(n),o)return t;l.push(t)}return l},"select:set":function(e,t,n){t=[].concat(t);for(var r,a=Sr["option:get"],i=0;r=e.options[i++];)(r.selected=t.indexOf(a(r))>-1)&&(n=!0);n||(e.selectedIndex=-1)}},Mr={},jr=["break,case,catch,continue,debugger,default,delete,do,else,false","finally,for,function,if,in,instanceof,new,null,return,switch,this","throw,true,try,typeof,var,void,while,with","abstract,boolean,byte,char,class,const,double,enum,export,extends","final,float,goto,implements,import,int,interface,long,native","package,private,protected,public,short,static,super,synchronized","throws,transient,volatile","arguments,let,yield,undefined"].join(",");jr.replace(/\w+/g,function(e){Mr[e]=!0});var Lr=/[a-z_$]/i,Dr=/[\s\uFEFF\xA0]/,Hr=/(\$proxy\$[a-z]+)\d+$/,Pr=new wn(218),Fr=new wn(128),Rr=/\)\s*$/,Br=/\)\s*\|/g,qr=/\|\s*([$\w]+)/g,Ir=/"\s*\["/g,Vr=/"\s*\(/g,Ur={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},zr=e.JSON&&JSON.stringify||function(e){return'"'+e.replace(/[\\\"\x00-\x1f]/g,function(e){var t=Ur[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"'};avalon.scan=function(e,t){e=e||un;var n=t?[].concat(t):[];pt(e,n)};var Wr=o("area,base,basefont,br,col,command,embed,hr,img,input,link,meta,param,source,track,wbr,noscript,script,style,textarea".toUpperCase()),Xr=function(e,t,n){var r=e.getAttribute(t);if(r)for(var a,i=0;a=n[i++];)if(a.hasOwnProperty(r)&&"function"==typeof a[r])return a[r]},Yr=hn&&e.MutationObserver?function(e){for(var t,n=e.firstChild;n;){var r=n.nextSibling;3===n.nodeType?t?(t.nodeValue+=n.nodeValue,e.removeChild(n)):t=n:t=null,n=r}}:0,Gr=/^\s*::/,Jr=/ms-(\w+)-?(.*)/,Zr=o("animationend,blur,change,input,click,dblclick,focus,keydown,keypress,keyup,mousedown,mouseenter,mouseleave,mousemove,mouseout,mouseover,mouseup,scan,scroll,submit"),Kr=o("value,title,alt,checked,selected,disabled,readonly,enabled,href,src"),Qr=/^if|widget|repeat$/,ea=/^each|with|html|include$/;if(!cn)var ta=new wn(512),na=/\s+([^=\s]+)(?:=("[^"]*"|'[^']*'|[^\s>]+))?/g,ra=/^['"]/,aa=/<\w+\b(?:(["'])[^"]*?(\1)|[^>])*>/i,ia=/&/g,oa=function(e){var t=e.outerHTML;if("8?e.bound("input",d):e.bound("propertychange",function(e){"value"===e.propertyName&&d()}),e.bound("dragend",function(){setTimeout(function(){d()},17)})):(e.bound("input",d),e.bound("compositionstart",a),e.bound("compositionend",l),e.bound("DOMAutoComplete",d));break;case"select":e.bound("change",function(){var t=avalon(s).val();if(t=Array.isArray(t)?t.map(function(t){return e.pipe(t,e,"get")}):e.pipe(t,e,"get"),t+""!==e.oldValue)try{e.setter(t),r.call(s,t)}catch(a){n(a)}})}"input"===e.xtype&&/^(text|password|hidden)/.test(s.type)&&(s.avalonSetter=d,Na(function(){if(un.contains(s))e.oldValue!==s.value&&d();else if(!s.msRetain)return!1}));for(var v in avalon.vmodels){var h=avalon.vmodels[v];h.$fire("avalon-ms-duplex-init",e)}var m=e.pipe||(e.pipe=bt);m(null,e,"init")},update:function(e){var t,n=this.element,r=this;switch(this.xtype){case"input":case"change":t=this.pipe(e,this,"set"),t!==this.oldValue&&(n.value=this.oldValue=t);break;case"radio":t=r.isChecked?!!e:e+""===n.value,6===hn?setTimeout(function(){n.defaultChecked=t,n.checked=t},31):n.checked=t;break;case"checkbox":var a=[].concat(e);t=this.pipe(n.value,this,"get"),n.checked=a.indexOf(t)>-1;break;case"select":r._value=e,n.msHasEvent="selectDuplex",avalon.bind(n,"datasetchanged",function(e){if("selectDuplex"===e.bubble){var t=r._value,a=Array.isArray(t)?t.map(String):t+"";avalon(n).val(a),n.oldValue=a+"",r.changed.call(n,a)}})}"select"!==r.xtype&&r.changed.call(n,t)}})}hn&&avalon.bind(Ut,"selectionchange",function(){var e=Ut.activeElement;e&&"function"==typeof e.avalonSetter&&e.avalonSetter()}),avalon.duplexHooks={checked:{get:function(e,t){return!t.oldValue}},string:{get:function(e){return e},set:yt},"boolean":{get:function(e){return"true"===e},set:yt},number:{get:function(e,t){var n=parseFloat(e+"");if(-e===-n)return n;var r=/strong|medium|weak/.exec(t.element.getAttribute("data-duplex-number"))||["medium"];switch(r[0]){case"strong":return 0;case"medium":return""===e?"":0;case"weak":return e}},set:yt}};var Ca,ka=[];avalon.tick=function(e){1===ka.push(e)&&(Ca=setInterval(xt,60))};var Na=i;!new function(){function e(e){t[this.tagName].call(this,e),"function"==typeof this.avalonSetter&&this.oldValue!==e&&this.avalonSetter()}try{var t={},n=HTMLInputElement.prototype,r=HTMLTextAreaElement.prototype,a=HTMLInputElement.prototype;Object.getOwnPropertyNames(a),t.INPUT=Object.getOwnPropertyDescriptor(n,"value").set,Object.defineProperty(n,"value",{set:e}),t.TEXTAREA=Object.getOwnPropertyDescriptor(r,"value").set,Object.defineProperty(r,"value",{set:e})}catch(i){Na=avalon.tick}},avalon.directive("effect",{priority:5,init:function(e){var t,n,r=e.expr,a=r.replace(Pn,function(e){return e.replace(/./g,"0")}).indexOf(":");-1===a?(t=r,n=!0):(t=r.slice(0,a),n=r.slice(a+1)),t=Hn.test(r)?nt(t):zr(t),e.expr="["+t+","+n+"]"},update:function(t){var n=t[0],r=this.element;if(r.getAttribute("data-effect-name")!==n){r.removeAttribute("data-effect-driver");var a=r.style,i=e.getComputedStyle?e.getComputedStyle(r):null,o=!1;if(i&&(Aa||_a)){var l=a[Oa]||i[Oa];l&&"0s"!==l&&(r.setAttribute("data-effect-driver","t"),o=!0),o||(l=a[Sa]||i[Sa],l&&"0s"!==l&&(r.setAttribute("data-effect-driver","a"),o=!0))}o||avalon.effects[n]&&(r.setAttribute("data-effect-driver","j"),o=!0),o&&r.setAttribute("data-effect-name",n)}}}),avalon.effects={},avalon.effect=function(e,t){avalon.effects[e]=t};var Ta,Ea,Aa=!1,_a=!1,Oa=avalon.cssName("transition-duration"),Sa=avalon.cssName("animation-duration");!new function(){var t,n={TransitionEvent:"transitionend",WebKitTransitionEvent:"webkitTransitionEnd",OTransitionEvent:"oTransitionEnd",otransitionEvent:"otransitionEnd"};for(var r in n){if(e[r]){t=n[r];break}try{{document.createEvent(r)}t=n[r];break}catch(a){}}"string"==typeof t&&(Aa=!0,Ta=t),n={AnimationEvent:"animationend",WebKitAnimationEvent:"webkitAnimationEnd"};var i;for(r in n)if(e[r]){i=n[r];break}"string"==typeof i&&(Aa=!0,Ea=i)};var Ma=[],ja=new fa;kt.prototype={contrustor:kt,enterClass:function(){return Nt(this,"enter")},leaveClass:function(){return Nt(this,"leave")},actionFun:function(e,t,n){if(!document.hidden){var r=this,a=r.el,i="leave"===e;e=i?"leave":"enter";var o=i?"enter":"leave";Tt(r,"abort"+Ct(o)),Tt(r,"before"+Ct(e)),i||t(a);var l=function(o){a.removeEventListener(r.cssEvent,r.cssCallback),i?(t(a),avalon(a).removeClass(r.cssClass)):"a"===r.driver&&avalon(a).removeClass(r.cssClass),o!==!0&&(Tt(r,"after"+Ct(e)),n&&n(a)),r.dispose()};r.useCss?(r.cssCallback&&r.cssCallback(!0),r.cssClass=Nt(r,e),r.cssCallback=l,r.update=function(){a.addEventListener(r.cssEvent,r.cssCallback),i||"t"!==r.driver||avalon(a).removeClass(r.cssClass)},avalon(a).addClass(r.cssClass),ja.render(!0),ja.queue.push(r)):Tt(r,e,l)}},enter:function(){this.actionFun.apply(this,["enter"].concat(avalon.slice(arguments)))},leave:function(){this.actionFun.apply(this,["leave"].concat(avalon.slice(arguments)))},dispose:function(){this.update=this.cssCallback=null,Ma.unshift(this)>100&&Ma.pop()}};var La=function(e,t){var n=sn.call(arguments,0);"function"!=typeof n[2]&&n.splice(2,0,i),"function"!=typeof n[3]&&n.splice(3,0,i);var r=n[2],a=n[3],o=n[4],l=$t(e,o);if(!l)return r(),a(),!1;var s=t?"enter":"leave";l[s](r,a)};avalon.mix(avalon.effect,{apply:La,append:function(e,t,n,r){return La(e,1,function(){t.appendChild(e)},n,r)},before:function(e,t,n,r){return La(e,1,function(){t.parentNode.insertBefore(e,t)},n,r)},remove:function(e,t,n,r){return La(e,0,function(){e.parentNode===t&&t.removeChild(e)},n,r)}}),avalon.directive("html",{update:function(e){var t=this,n=this.element,r=1!==n.nodeType,a=r?n.parentNode:n;if(a){if(e=null==e?"":e,3===n.nodeType){var i=vn("html");a.insertBefore(Ut.createComment(i),n),t.element=Ut.createComment(i+":end"),a.replaceChild(t.element,n),n=t.element}if("object"!=typeof e)var o=avalon.parseHTML(String(e));else if(11===e.nodeType)o=e;else if(1===e.nodeType||e.item){var l=1===e.nodeType?e.childNodes:e.item;for(o=fn.cloneNode(!0);l[0];)o.appendChild(l[0])}if(l=avalon.slice(o.childNodes),r){for(var s=n.nodeValue.slice(0,-4);;){var c=n.previousSibling;if(!c||8===c.nodeType&&c.nodeValue===s)break;a.removeChild(c)}a.insertBefore(o,n)}else avalon.clearHTML(n).appendChild(o);ft(l,t.vmodels)}}}),avalon.directive("if",{priority:10,update:function(e){function t(){a.getAttribute(r.name)&&(a.removeAttribute(r.name),st(a,r.vmodels)),r.rollback=null}var n,r=this,a=this.element,i=r.stamp=+new Date,o=function(){i===r.stamp&&(r.recoverNode=null)};r.recoverNode&&r.recoverNode();try{if(!a.parentNode)return;n=a.parentNode}catch(l){return}if(e){if(8===a.nodeType){var s=r.keep,c=avalon.effect.apply(s,1,function(){i===r.stamp&&(a.parentNode.replaceChild(s,a),a=r.element=s,s.getAttribute("_required")&&(a.required=!0,a.removeAttribute("_required")),a.querySelectorAll&&avalon.each(a.querySelectorAll("[_required=true]"),function(e){e.required=!0,e.removeAttribute("_required")}),t())},o);c=c===!1}c||t()}else if(1===a.nodeType){a.required===!0&&(a.required=!1,a.setAttribute("_required","true"));try{avalon.each(a.querySelectorAll(":required"),function(e){a.required=!1,e.setAttribute("_required","true")})}catch(l){}var u=r.element=Ut.createComment("ms-if"),f=a.nextSibling;r.recoverNode=function(){r.recoverNode=null,u.parentNode!==n&&(n.insertBefore(u,f),r.keep=a)},avalon.effect.apply(a,0,function(){r.recoverNode=null,i===r.stamp&&(a.parentNode.replaceChild(u,a),r.keep=a,Wt.appendChild(a),r.rollback=function(){a.parentNode===Wt&&Wt.removeChild(a)})},o)}}});var Da=/(?:[\s\S]+?)<\/noscript>/gim,Ha=/([\s\S]+?)<\/noscript>/im,Pa=function(){return new(e.XMLHttpRequest||ActiveXObject)("Microsoft.XMLHTTP")},Fa=avalon.templateCache={};avalon.directive("include",{init:$n.attr.init,update:function(e){var t=this,n=this.element,r=t.vmodels,a=t.includeRendered,i=t.effectName&&t.effectClass,o=t.templateCache,l=t.includeReplace,s=t.includeLoaded,c=l?n.parentNode:n,u=t._element;t.recoverNodes=t.recoverNodes||avalon.noop;var f=(l&&u.cloneNode(),function(f){var p=t._stamp=+new Date;if(s){var d=s.apply(c,[f].concat(r));"string"==typeof d&&(f=d)}a&&at(c,function(){a.call(c)},0/0);var v=t.includeLastID||"_default";t.includeLastID=e;var h=o&&o[v]||Ut.createElement(n.tagName||t._element.tagName);i&&(h.className=i,c.insertBefore(h,t.start)),(o||{})[v]=h;var m=t.recoverNodes();for(m&&c.insertBefore(m,t.end);;){var g=t.start.nextSibling;if(!g||g===h||g===t.end)break;h.appendChild(g)}avalon.effect.remove(h,c,function(){o&&p===t._stamp&&Wt.appendChild(h)},t);var y=c,b=avalon.noop,x=avalon.noop,$=Et(t,e,f),w=avalon.slice($.childNodes);l&&i?(y=u,y.innerHTML="",y.setAttribute("ms-skip","true"),c.insertBefore(y,t.end.nextSibling),b=function(){y.insertBefore($,null)},x=function(){t.recoverNodes=avalon.noop,p===t._stamp&&($=At(w),c.insertBefore($,t.end),ft(w,r)),y.parentNode===c&&c.removeChild(y)},t.recoverNodes=function(){return t.recoverNodes=avalon.noop,At(w)}):b=function(){c.insertBefore($,t.end),ft(w,r)},avalon.effect.apply(y,"enter",b,x)});if("src"===t.param)if("string"==typeof Fa[e])avalon.nextTick(function(){f(Fa[e])});else if(Array.isArray(Fa[e]))Fa[e].push(f);else{var p=Pa();p.onreadystatechange=function(){if(4===p.readyState){var t=p.status;if(t>=200&&300>t||304===t||1223===t){for(var n,r=p.responseText,a=0;n=Fa[e][a++];)n(r);Fa[e]=r}}},Fa[e]=[f],p.open("GET",e,!0),"withCredentials"in p&&(p.withCredentials=!0),p.setRequestHeader("X-Requested-With","XMLHttpRequest"),p.send(null)}else{var d=e&&1===e.nodeType?e:Ut.getElementById(e);if(d){if("NOSCRIPT"===d.tagName&&!d.innerHTML&&!d.fixIE78){p=Pa(),p.open("GET",location,!1),p.send(null); +for(var v=Ut.getElementsByTagName("noscript"),h=(p.responseText||"").match(Da)||[],m=h.length,g=0;m>g;g++){var y=v[g];y&&(y.style.display="none",y.fixIE78=(h[g].match(Ha)||[""," "])[1])}}avalon.nextTick(function(){f(d.fixIE78||d.value||d.innerText||d.innerHTML)})}}}});var Ra=/\(([^)]*)\)/,Ba=avalon.directive("on",{priority:3e3,init:function(e){var t=e.expr;e.type="on";var n=e.param.replace(/-\d+$/,"");if("function"==typeof Ba[n+"Hook"]&&Ba[n+"Hook"](e),t.indexOf("(")>0&&t.indexOf(")")>-1){var r=(t.match(Ra)||["",""])[1].trim();(""===r||"$event"===r)&&(t=t.replace(Ra,""))}e.expr=t},update:function(e){var t=this,n=this.element;e=function(e){var n=t.getter||i;return n.apply(this,t.args.concat(e))};var r=t.param.replace(/-\d+$/,"");if("scan"===r)e.call(n,{type:r});else if("function"==typeof t.specialBind)t.specialBind(n,e);else var a=avalon.bind(n,r,e);t.rollback=function(){"function"==typeof t.specialUnbind?t.specialUnbind():avalon.unbind(n,r,a)}}});avalon.directive("repeat",{priority:90,init:function(e){var t=e.type;e.cache={},e.enterCount=0;var n=e.element;if(1===n.nodeType){n.removeAttribute(e.name),wt(n,e),e.param=e.param||"el",e.sortedCallback=Xr(n,"data-with-sorted",e.vmodels);var r=Xr(n,"data-"+t+"-rendered",e.vmodels),a=vn(t),i=Ut.createComment(a+":start"),o=e.element=Ut.createComment(a+":end");if(e.signature=a,e.start=i,e.template=fn.cloneNode(!1),"repeat"===t){var l=n.parentNode;l.replaceChild(o,n),l.insertBefore(i,o),e.template.appendChild(n)}else{for(;n.firstChild;)e.template.appendChild(n.firstChild);n.appendChild(i),n.appendChild(o),l=n}if(e.element=o,r)var s=avalon.bind(l,"datasetchanged",function(){r.apply(l,l.args),avalon.unbind(l,"datasetchanged",s),l.msRendered=r})}},update:function(e,t){var n=this,r=this.xtype;this.enterCount+=1;var a=!t;if(a){n.$outer={};var i="$key",o="$val";"array"===r&&(i="$first",o="$last");for(var l,s=0;l=n.vmodels[s++];)if(l.hasOwnProperty(i)&&l.hasOwnProperty(o)){n.$outer=l;break}}var c=this.track;if(n.sortedCallback){var u=n.sortedCallback.call(x,c);u&&Array.isArray(u)&&(c=u)}var f="move";n.$repeat=e;var p=[],d=a&&fn.cloneNode(!1),v=[],h=this.param,g=avalon.mix({},this.cache),y=this.element,b=c.length,x=y.parentNode;for(s=0;b>s;s++){var $=c[s],w=g[$];if(w)p.push({}),g[$]=!0;else{w=jt(this),"array"===r?(f="add",w.$id=$,w[h]=e[s]):(f="append",w.$key=$,w.$val=e[$]),this.cache[$]=w;var C=w.$anchor||(w.$anchor=y.cloneNode(!1));C.nodeValue=this.signature,Mt(n,d,w,p,a&&!n.effectDriver),Ht(w,n,r)}1===this.enterCount&&(w.$active=!1,w.$oldIndex=w.$index,w.$active=!0,w.$index=s),"array"===r?(w.$first=0===s,w.$last=s===b-1):w.$val=O(e[$]),v.push(w)}if(this.proxies=v,a&&!n.effectDriver)x.insertBefore(d,y),p.forEach(function(e){ft(e.nodes||[],e.vmodels),e.nodes=e.vmodels=null});else{var k=n.staggerIndex=0;for($ in g)g[$]!==!0&&(f="del",St(g[$].$anchor,n),Rt(this.cache,$,h),g[$]=null);for(s=0;b>s;s++){w=v[s],$="array"===r?w.$id:w.$key;var N=v[s-1],T=N?N.$anchor:n.start;g[$]?w.$index!==w.$oldIndex&&!function(e,t){k=Ot(n.effectEnterStagger,function(){var r=St(e.$anchor),a=avalon.slice(r.childNodes);x.insertBefore(r,t.nextSibling),_t(a,1,n)},k)}(w,T):!function(e,t){var r=e.nodes,a=e.vmodels;r&&(k=Ot(n.effectEnterStagger,function(){x.insertBefore(e.content,t.nextSibling),ft(r,a),_t(r,1,n)},k)),e.nodes=e.vmodels=null}(p[s],T)}}if(!e.$track)for($ in this.cache)Rt(this.cache,$,h);!function(e){x.args=e,x.msRendered&&x.msRendered.apply(x,e)}(m.newWatch?arguments:[f]);var E=setTimeout(function(){clearTimeout(E),avalon.fireDom(x,"datasetchanged",{bubble:x.msHasEvent})});this.enterCount-=1}}),"with,each".replace(Qt,function(e){$n[e]=avalon.mix({},$n.repeat,{priority:1400})});var qa=[],Ia=[];avalon.directive("text",{update:function(e){var t=this.element;if(e=null==e?"":e,3===t.nodeType)try{t.data=e}catch(n){}else"textContent"in t?t.textContent=e:t.innerText=e}}),avalon.parseDisplay=Bt,avalon.directive("visible",{init:function(){},update:function(e){var t=this.element,n=this,r=n.stamp=+new Date;e?(t.style.display="none",avalon.effect.apply(t,1,function(){if(r===n.stamp){var e=t.getAttribute("data-effect-driver")||"a";/^[atn]/.test(e)&&(this.effectName||(t.style.display=""),"none"===avalon(t).css("display")&&(t.style.display=Bt(t.nodeName)))}})):avalon.effect.apply(t,0,function(){r===n.stamp&&(t.style.display="none")})}});var Va=/]*>([\S\s]*?)<\/script\s*>/gim,Ua=/\s+(on[^=\s]+)(?:=("[^"]*"|'[^']*'|[^\s>]+))?/g,za=/<\w+\b(?:(["'])[^"]*?(\1)|[^>])*>/gi,Wa={a:/\b(href)\=("javascript[^"]*"|'javascript[^']*')/gi,img:/\b(src)\=("javascript[^"]*"|'javascript[^']*')/gi,form:/\b(action)\=("javascript[^"]*"|'javascript[^']*')/gi},Xa=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Ya=/([^\#-~| |!])/g,Ga=avalon.filters={uppercase:function(e){return e.toUpperCase()},lowercase:function(e){return e.toLowerCase()},truncate:function(e,t,n){return t=t||30,n="string"==typeof n?n:"...",e.length>t?e.slice(0,t-n.length)+n:String(e)},$filter:function(e){for(var t=1,n=arguments.length;n>t;t++){var r=arguments[t],a=avalon.filters[r[0]];if("function"==typeof a){var i=[e].concat(r.slice(1));e=a.apply(null,i)}}return e},camelize:z,sanitize:function(e){return e.replace(Va,"").replace(za,function(e){var t=e.toLowerCase().match(/<(\w+)\s/);if(t){var n=Wa[t[1]];n&&(e=e.replace(n,function(e,t,n){var r=n.charAt(0);return t+"="+r+"javascript:void(0)"+r}))}return e.replace(Ua," ").replace(/\s+/g," ")})},escape:function(e){return String(e).replace(/&/g,"&").replace(Xa,function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1);return"&#"+(1024*(t-55296)+(n-56320)+65536)+";"}).replace(Ya,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")},currency:function(e,t,n){return(t||"¥")+qt(e,isFinite(n)?n:2)},number:qt};!new function(){function e(e){return parseInt(e,10)||0}function t(e,t,n){var r="";for(0>e&&(r="-",e=-e),e=""+e;e.length0||o>-r)&&(o+=r),0===o&&-12===r&&(o=12),t(o,n,a)}}function r(e,t){return function(n,r){var a=n["get"+e](),i=(t?"SHORT"+e:e).toUpperCase();return r[i][a]}}function a(e){var n=-1*e.getTimezoneOffset(),r=n>=0?"+":"";return r+=t(Math[n>0?"floor":"ceil"](n/60),2)+t(Math.abs(n%60),2)}function i(e,t){return e.getHours()<12?t.AMPMS[0]:t.AMPMS[1]}var o={yyyy:n("FullYear",4),yy:n("FullYear",2,0,!0),y:n("FullYear",1),MMMM:r("Month"),MMM:r("Month",!0),MM:n("Month",2,1),M:n("Month",1,1),dd:n("Date",2),d:n("Date",1),HH:n("Hours",2),H:n("Hours",1),hh:n("Hours",2,-12),h:n("Hours",1,-12),mm:n("Minutes",2),m:n("Minutes",1),ss:n("Seconds",2),s:n("Seconds",1),sss:n("Milliseconds",3),EEEE:r("Day"),EEE:r("Day",!0),a:i,Z:a},l=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,s=/^\/Date\((\d+)\)\/$/;Ga.date=function(t,n){var r,a,i=Ga.date.locate,c="",u=[];if(n=n||"mediumDate",n=i[n]||n,"string"==typeof t)if(/^\d+$/.test(t))t=e(t);else if(s.test(t))t=+RegExp.$1;else{var f=t.trim(),p=[0,0,0,0,0,0,0],d=new Date(0);f=f.replace(/^(\d+)\D(\d+)\D(\d+)/,function(t,n,r,a){var i=4===a.length?[a,n,r]:[n,r,a];return p[0]=e(i[0]),p[1]=e(i[1])-1,p[2]=e(i[2]),""});var v=d.setFullYear,h=d.setHours;f=f.replace(/[T\s](\d+):(\d+):?(\d+)?\.?(\d)?/,function(t,n,r,a,i){return p[3]=e(n),p[4]=e(r),p[5]=e(a),i&&(p[6]=Math.round(1e3*parseFloat("0."+i))),""});var m=0,g=0;f=f.replace(/Z|([+-])(\d\d):?(\d\d)/,function(t,n,r,a){return v=d.setUTCFullYear,h=d.setUTCHours,n&&(m=e(n+r),g=e(n+a)),""}),p[3]-=m,p[4]-=g,v.apply(d,p.slice(0,3)),h.apply(d,p.slice(3)),t=d}if("number"==typeof t&&(t=new Date(t)),"date"===avalon.type(t)){for(;n;)a=l.exec(n),a?(u=u.concat(a.slice(1)),n=u.pop()):(u.push(n),n=null);return u.forEach(function(e){r=o[e],c+=r?r(t,i):e.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),c}};var c={AMPMS:{0:"上午",1:"下午"},DAY:{0:"星期日",1:"星期一",2:"星期二",3:"星期三",4:"星期四",5:"星期五",6:"星期六"},MONTH:{0:"1月",1:"2月",2:"3月",3:"4月",4:"5月",5:"6月",6:"7月",7:"8月",8:"9月",9:"10月",10:"11月",11:"12月"},SHORTDAY:{0:"周日",1:"周一",2:"周二",3:"周三",4:"周四",5:"周五",6:"周六"},fullDate:"y年M月d日EEEE",longDate:"y年M月d日",medium:"yyyy-M-d H:mm:ss",mediumDate:"yyyy-M-d",mediumTime:"H:mm:ss","short":"yy-M-d ah:mm",shortDate:"yy-M-d",shortTime:"ah:mm"};c.SHORTMONTH=c.MONTH,Ga.date.locate=c};var Ja=avalon.modules={"domReady!":{exports:avalon,state:3},avalon:{exports:avalon,state:4}};Ja.exports=Ja.avalon,new function(){function t(e,t){var r="js";e=e.replace(/^(\w+)\!/,function(e,t){return r=t,""}),"ready"===r&&(n("debug: ready!已经被废弃,请使用domReady!"),r="domReady");var a="";e=e.replace(A,function(e){return a=e,""});var i="."+r,o=/js|css/.test(i)?i:"";e=e.replace(/\.[a-z0-9]+$/g,function(e){return e===i?(o=e,""):e});var l=avalon.mix({query:a,ext:o,res:r,name:e,toUrl:h},t);return l.toUrl(e),l}function r(e){var t=e.name,n=e.res,r=Ja[t],a=t&&e.urlNoQuery;if(r&&r.state>=1)return t;if(r=Ja[a],r&&r.state>=3)return Xt(r.deps||[],r.factory,a),a;if(t&&!r){r=Ja[a]={id:a,state:1};var i=function(a){H[n]=a,a.load(t,e,function(e){arguments.length&&void 0!==e&&(r.exports=e),r.state=4,s()})};H[n]?i(H[n]):Xt([n],i)}return t?a:n+"!"}function o(e,t){for(var n,r=0;n=e[r++];)if(4!==Ja[n].state&&(n===t||o(Ja[n].deps,t)))return!0}function l(e,t,r){var a=u(e.src);return e.onload=e.onreadystatechange=e.onerror=null,t||r&&Ja[a]&&!Ja[a].state?(setTimeout(function(){zt.removeChild(e),e=null}),void n("debug: 加载 "+a+" 失败"+t+" "+!Ja[a].state)):!0}function s(){e:for(var e,t=N.length;e=N[--t];){var n=Ja[e],r=n.deps;if(r){for(var a,i=0;a=r[i];i++)if(4!==Object(Ja[a]).state)continue e;4!==n.state&&(N.splice(t,1),v(n.id,n.deps,n.factory),s())}}}function c(e,t,r){function a(){var a=T.pop();a&&a.require(t),r&&r(),l(i,!1,!o)&&(n("debug: 已成功加载 "+e),t&&N.push(t),s())}var i=Ut.createElement("script"),o="onload"in i,c=o?"onload":"onreadystatechange";i[c]=o?a:function(){D.test(i.readyState)&&a()},i.onerror=function(){l(i,!0)},i.className=Gt,i.src=e,zt.insertBefore(i,zt.firstChild),n("debug: 正准备加载 "+e)}function u(e){return(e||"").replace(A,"")}function f(e){return/^(?:[a-z]+:)?\/\//i.test(String(e))}function p(e,t){return"1"[0]?e[t]:e.getAttribute(t,4)}function d(){var t;try{a.b.c()}catch(n){t=n.stack,!t&&e.opera&&(t=(String(n).match(/of linked script \S+/g)||[]).join(" "))}if(t)return t=t.split(/[@ ]/g).pop(),t="("===t[0]?t.slice(1,-1):t.replace(/\s/,""),u(t.replace(/(:\d+)?:\d+$/i,""));for(var r,i=zt.getElementsByTagName("script"),o=i.length;r=i[--o];)if(r.className===Gt&&"interactive"===r.readyState){var l=p(r,"src");return r.className=u(l)}}function v(t,r,a){var i=Object(Ja[t]);i.state=4;for(var o,l=0,s=[];o=r[l++];)if("exports"===o){var c=i.exports||(i.exports={});s.push(c)}else s.push(Ja[o].exports);try{var u=a.apply(e,s)}catch(f){n("执行["+t+"]模块的factory抛错: ",f)}return void 0!==u&&(i.exports=u),P.test(t)&&delete Ja[t],delete i.factory,u}function h(e){0===e.indexOf(this.res+"!")&&(e=e.slice(this.res.length+1));var t=e,n=0,r=this.baseUrl,a=this.parentUrl||r;$(e,m.paths,function(e,r){t=t.replace(r,e),n=1}),n||$(e,m.packages,function(e,n,r){t=t.replace(r.name,r.location)}),this.mapUrl&&$(this.mapUrl,m.map,function(e){$(t,e,function(e,n){t=t.replace(n,e),a=r})});var i=this.ext;i&&n&&t.slice(-i.length)===i&&(t=t.slice(0,-i.length)),f(t)||(a=this.built||/^\w/.test(t)?r:a,t=C(a,t));var o=t+i;return t=o+this.query,o=t.replace(A,function(e){return this.query=e,""}),$(e,m.urlArgs,function(e){t+=(-1===t.indexOf("?")?"?":"&")+e}),this.url=t,this.urlNoQuery=o}function g(e,t,n){var r=x(e,t,n);return r.sort(w),r}function y(e){return new RegExp("^"+e+"(/|$)")}function b(t){return function(){var n;return t.init&&(n=t.init.apply(e,arguments)),n||t.exports&&k(t.exports)}}function x(e,t,n){var r=[];for(var a in e)if(an.call(e,a)){var i={name:a,val:e[a]};r.push(i),i.reg="*"===a&&t?/^/:y(a),n&&"*"!==a&&(i.reg=new RegExp("/"+a.replace(/^\//,"")+"(/|$)"))}return r}function $(e,t,n){t=t||[];for(var r,a=0;r=t[a++];)if(r.reg.test(e))return n(r.val,r.name,r),!1}function w(e,t){var n=e.name,r=t.name;return"*"===r?-1:"*"===n?1:r.length-n.length}function C(e,t){if("/"!==e.charAt(e.length-1)&&(e+="/"),"./"===t.slice(0,2))return e+t.slice(2);if(".."===t.slice(0,2)){for(e+=t;F.test(e);)e=e.replace(F,"");return e}return"/"===t.slice(0,1)?e+t.slice(1):e+t}function k(t){if(!t)return t;var n=e;return t.split(".").forEach(function(e){n=n[e]}),n}var N=[],T=[],E=/\.js$/i,A=/(\?[^#]*)$/,_=[],O=!1;Xt=avalon.require=function(e,n,a,o){if(O){Array.isArray(e)||avalon.error("require方法的第一个参数应为数组 "+e);var l=[],c={},u=a||"callback"+setTimeout("1");o=o||{},o.baseUrl=m.baseUrl;var f=!!o.built;if(a&&(o.parentUrl=a.substr(0,a.lastIndexOf("/")),o.mapUrl=a.replace(E,"")),f){var p=t(o.defineName,o);u=p.urlNoQuery}else e.forEach(function(e){var n=t(e,o),a=r(n);a&&(c[a]||(l.push(a),c[a]="司徒正美"))});var d=Ja[u];d&&4===d.state||(Ja[u]={id:u,deps:f?e.concat():l,factory:n||i,state:3}),d||N.push(u),s()}else if(_.push(avalon.slice(arguments)),arguments.length<=2){O=!0;for(var v,h=_.splice(0,_.length);v=h.shift();)Xt.apply(null,v)}},Xt.define=function(e,t,n){"string"!=typeof e&&(n=t,t=e,e="anonymous"),Array.isArray(t)||(n=t,t=[]);var r={built:!O,defineName:e},a=[t,n,r];n.require=function(e){if(a.splice(2,0,e),Ja[e]){Ja[e].state=3;var t=!1;try{t=o(Ja[e].deps,e)}catch(r){}t&&avalon.error(e+"模块与之前的模块存在循环依赖,请不要直接用script标签引入"+e+"模块")}delete n.require,Xt.apply(null,a)};var i=r.built?"unknown":d();if(i){var l=Ja[i];l&&(l.state=2),n.require(i)}else T.push(n)},Xt.config=m,Xt.define.amd=Ja;var S=m["orig.paths"]={},M=m["orig.map"]={},j=m.packages=[],L=m["orig.args"]={};avalon.mix(Bn,{paths:function(e){avalon.mix(S,e),m.paths=g(S)},map:function(e){avalon.mix(M,e);var t=g(M,1,1);avalon.each(t,function(e,t){t.val=g(t.val)}),m.map=t},packages:function(e){e=e.concat(j);for(var t,n={},r=[],a=0;t=e[a++];){t="string"==typeof t?{name:t}:t;var i=t.name;if(!n[i]){var o=C(t.location||i,t.main||"main");o=o.replace(E,""),r.push(t),n[i]=t.location=o,t.reg=y(i)}}m.packages=r.sort()},urlArgs:function(e){"string"==typeof e&&(e={"*":e}),avalon.mix(L,e),m.urlArgs=g(L,1)},baseUrl:function(e){if(!f(e)){var t=zt.getElementsByTagName("base")[0];t&&zt.removeChild(t);var n=Ut.createElement("a");n.href=e,e=p(n,"href"),t&&zt.insertBefore(t,zt.firstChild)}e.length>3&&(m.baseUrl=e)},shim:function(e){for(var t in e){var n=e[t];Array.isArray(n)&&(n=e[t]={deps:n}),n.exportsFn||!n.exports&&!n.init||(n.exportsFn=b(n))}m.shim=e}});var D=/complete|loaded/,H=Xt.plugins={domReady:{load:i},js:{load:function(e,t,n){var r=t.url,a=t.urlNoQuery,i=m.shim[e.replace(E,"")];i?Xt(i.deps||[],function(){var e=avalon.slice(arguments);c(r,a,function(){n(i.exportsFn?i.exportsFn.apply(0,e):void 0)})}):c(r,a)}},css:{load:function(e,t,r){var a=t.url,i=Ut.createElement("link");i.rel="stylesheet",i.href=a,zt.insertBefore(i,zt.firstChild),n("debug: 已成功加载 "+a),r()}},text:{load:function(e,t,r){var a=t.url,i=Pa();i.onreadystatechange=function(){if(4===i.readyState){var e=i.status;e>399&&600>e?avalon.error(a+" 对应资源不存在或没有开启 CORS"):(n("debug: 已成功加载 "+a),r(i.responseText))}};var o="_="+(new Date-0),l=-1===a.indexOf("?")?a+"?"+o:a+"&"+o;i.open("GET",l,!0),"withCredentials"in i&&(i.withCredentials=!0),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.send(),n("debug: 正准备加载 "+a)}}};Xt.checkDeps=s;var P=/^callback\d+$/,F=/\/\w+\/\.\./,R=Ut.scripts[Ut.scripts.length-1],B=R.getAttribute("data-main");if(B){Bn.baseUrl(B);var q=m.baseUrl;m.baseUrl=q.slice(0,q.lastIndexOf("/")+1),c(q.replace(E,"")+".js")}else{var I=u(p(R,"src"));m.baseUrl=I.slice(0,I.lastIndexOf("/")+1)}};var Za,Ka=[],Qa=function(e){for(Za=!0,Xt&&(Ja["domReady!"].state=4,Xt.checkDeps());e=Ka.shift();)e(avalon)};if("complete"===Ut.readyState)setTimeout(Qa);else if(cn)Ut.addEventListener("DOMContentLoaded",Qa);else{Ut.attachEvent("onreadystatechange",function(){"complete"===Ut.readyState&&Qa()});try{var ei=null===e.frameElement}catch(Wn){}un.doScroll&&ei&&e.external&&It()}avalon.bind(e,"load",Qa),avalon.ready=function(e){Za?e(avalon):Ka.push(e)},avalon.config({loader:!0}),avalon.ready(function(){avalon.scan(Ut.body)}),"function"==typeof define&&define.amd&&define("avalon",[],function(){return avalon});var ti=e.avalon;return avalon.noConflict=function(t){return t&&e.avalon===avalon&&(e.avalon=ti),avalon},void 0===t&&(e.avalon=avalon),avalon}); \ No newline at end of file diff --git a/dist/avalon.mobile.js b/dist/avalon.mobile.js index 61fb893c2..c08d1f958 100644 --- a/dist/avalon.mobile.js +++ b/dist/avalon.mobile.js @@ -5,7 +5,7 @@ http://weibo.com/jslouvre/ Released under the MIT license - avalon.mobile.js 1.5.3 built in 2015.10.4 + avalon.mobile.js 1.5.3 built in 2015.10.9 mobile ==================================================*/ (function(global, factory) { @@ -870,7 +870,7 @@ function observeObject(source, options) { options = options || nullObject var force = options.force || nullObject var old = options.old - var oldAccessors = typeof old === "object" ? old.$accessors : nullObject + var oldAccessors = old && old.$accessors || nullObject var $vmodel = new Component() //要返回的对象, 它在IE6-8下可能被偷龙转凤 var accessors = {} //监控属性 var hasOwn = {} @@ -2678,10 +2678,10 @@ function scanExpr(str) { } function scanText(textNode, vmodels, index) { - var bindings = [] + var bindings = [], tokens = scanExpr(textNode.data) if (tokens.length) { - for (var i = 0; token = tokens[i++];) { + for (var i = 0, token; token = tokens[i++];) { var node = DOC.createTextNode(token.expr) //将文本转换为文本节点,并替换原来的文本节点 if (token.type) { token.expr = token.expr.replace(roneTime, function () { @@ -5701,7 +5701,91 @@ function iOSversion() { var deviceIsAndroid = ua.indexOf('android') > 0 var deviceIsIOS = iOSversion() -avalon.gestureHooks = { +var gestureHooks = avalon.gestureHooks = { + pointers: {}, + start: function (event, callback) { + + //touches是当前屏幕上所有触摸点的列表; + //targetTouches是当前对象上所有触摸点的列表; + //changedTouches是涉及当前事件的触摸点的列表。 + for (var i = 0; i < event.changedTouches.length; i++) { + var touch = event.changedTouches[i] + var pointer = { + startTouch: mixTouchAttr({}, touch), + startTime: Date.now(), + status: 'tapping', + element: event.target + } + gestureHooks.pointers[touch.identifier] = pointer; + callback(pointer, touch) + + } + }, + move: function (event, callback) { + for (var i = 0; i < event.changedTouches.length; i++) { + var touch = event.changedTouches[i] + var pointer = gestureHooks.pointers[touch.identifier] + if (!pointer) { + return + } + + if (!("lastTouch" in pointer)) { + pointer.lastTouch = pointer.startTouch + pointer.lastTime = pointer.startTime + pointer.deltaX = pointer.deltaY = pointer.duration = pointer.distance = 0 + } + + var time = Date.now() - pointer.lastTime + + if (time > 0) { + + var RECORD_DURATION = 70 + if (time > RECORD_DURATION) { + time = RECORD_DURATION + } + if (pointer.duration + time > RECORD_DURATION) { + pointer.duration = RECORD_DURATION - time + } + + + pointer.duration += time; + pointer.lastTouch = mixTouchAttr({}, touch) + + pointer.lastTime = Date.now() + + pointer.deltaX = touch.clientX - pointer.startTouch.clientX + pointer.deltaY = touch.clientY - pointer.startTouch.clientY + var x = pointer.deltaX * pointer.deltaX + var y = pointer.deltaY * pointer.deltaY + pointer.distance = Math.sqrt(x + y) + pointer.isVertical = !(x > y) + + callback(pointer, touch) + } + } + }, + end: function (event, callback) { + for (var i = 0; i < event.changedTouches.length; i++) { + var touch = event.changedTouches[i], + id = touch.identifier, + pointer = gestureHooks.pointers[id] + + if (!pointer) + continue + + callback(pointer, touch) + + delete gestureHooks.pointers[id] + } + }, + fire: function (elem, type, props) { + if (elem) { + var event = document.createEvent('Events') + event.initEvent(type, true, true) + avalon.mix(event, props) + elem.dispatchEvent(event) + } + }, add: function (name, gesture) { function move(event) { gesture.touchmove(event) @@ -5710,40 +5794,40 @@ avalon.gestureHooks = { function end(event) { gesture.touchend(event) - document.removeEventListener("touchmove", move, false) + document.removeEventListener('touchmove', move) - document.removeEventListener("touchend", end, false) + document.removeEventListener('touchend', end) - document.removeEventListener("touchcancel", cancel, false) + document.removeEventListener('touchcancel', cancel) } function cancel(event) { gesture.touchcancel(event) - document.removeEventListener("touchmove", move, false) + document.removeEventListener('touchmove', move) - document.removeEventListener("touchend", end, false) + document.removeEventListener('touchend', end) - document.removeEventListener("touchcancel", cancel, false) + document.removeEventListener('touchcancel', cancel) } gesture.events.forEach(function (eventName) { avalon.eventHooks[eventName] = { fn: function (el, fn) { - if (!el.getAttribute("data-" + name)) { - el.setAttribute("data-" + name, "1") - el.addEventListener("touchstart", function (event) { + if (!el.getAttribute('data-' + name)) { + el.setAttribute('data-' + name, '1') + el.addEventListener('touchstart', function (event) { gesture.touchstart(event) - document.addEventListener("touchmove", move, false) + document.addEventListener('touchmove', move) - document.addEventListener("touchend", end, false) + document.addEventListener('touchend', end) - document.addEventListener("touchcancel", cancel, false) + document.addEventListener('touchcancel', cancel) - }, false) + }) } return fn } @@ -5751,7 +5835,9 @@ avalon.gestureHooks = { }) } } -var gestures = {} + + + var touchkeys = ['screenX', 'screenY', 'clientX', 'clientY', 'pageX', 'pageY'] // 复制 touch 对象上的有用属性到固定对象上 @@ -5764,128 +5850,21 @@ function mixTouchAttr(target, source) { return target } -function startGesture(event, callback) { - for (var i = 0; i < event.changedTouches.length; i++) { - var touch = event.changedTouches[i] - - var gesture = { - startTouch: mixTouchAttr({}, touch), - startTime: Date.now(), - status: 'tapping', - element: event.target - }; - callback(gesture, event) - gestures[touch.identifier] = gesture; - } -} -function moveGesture(event, callback) { - for (var i = 0; i < event.changedTouches.length; i++) { - var touch = event.changedTouches[i], - gesture = gestures[touch.identifier]; - - if (!gesture) { - return; - } - if (typeof gesture._movestart === 'boolean') { - gesture._movestart = !!gesture._movestart - } - - if (!gesture.lastTouch) { - gesture.lastTouch = gesture.startTouch - } - if (!gesture.lastTime) { - gesture.lastTime = gesture.startTime - } - - if (!gesture.duration) { - gesture.duration = 0 - } - - var time = Date.now() - gesture.lastTime - - if (time > 0) { - - var RECORD_DURATION = 70 - if (time > RECORD_DURATION) { - time = RECORD_DURATION - } - if (gesture.duration + time > RECORD_DURATION) { - gesture.duration = RECORD_DURATION - time - } - - - gesture.duration += time; - - gesture.lastTouch = mixTouchAttr({}, touch) - - gesture.lastTime = Date.now() - - var displacementX = touch.clientX - gesture.startTouch.clientX - var displacementY = touch.clientY - gesture.startTouch.clientY - gesture.distance = Math.sqrt(Math.pow(displacementX, 2) + Math.pow(displacementY, 2)); - gesture.isVertical = !(Math.abs(displacementX) > Math.abs(displacementY)) - - callback(gesture, touch) - } - } -} - -function endGesture(event, callback) { - for (var i = 0; i < event.changedTouches.length; i++) { - var touch = event.changedTouches[i], - id = touch.identifier, - gesture = gestures[id] - if (!gesture) - continue + - callback(gesture, touch) +var supportPointer = !!navigator.pointerEnabled || !!navigator.msPointerEnabled - delete gestures[id] - } -} - -function fireGesture(elem, type, props) { - if (elem) { - var event = document.createEvent('Events') - event.initEvent(type, true, true) - avalon.mix(event, props) - elem.dispatchEvent(event) - } +if (supportPointer) { // 支持pointer的设备可用样式来取消click事件的300毫秒延迟 + root.style.msTouchAction = root.style.touchAction = 'none' } -var fastClick = { - trackingClick: false, - trackingClickStart: 0, - targetElement: null, - touchStartX: 0, - touchStartY: 0, +var tapGesture = { + events: ['tap', 'click'], touchBoundary: 10, tapDelay: 200, - sendClick: function (targetElement, event) { - // 在click之前触发tap事件 - fireGesture(targetElement, 'tap', { - fastclick: true - }) - var clickEvent, touch - - // On some Android devices activeElement needs to be blurred otherwise the synthetic click will have no effect (#24) - if (document.activeElement && document.activeElement !== targetElement) { - document.activeElement.blur() - } - - touch = event.changedTouches[0] - - // Synthesise a click event, with an extra attribute so it can be tracked - clickEvent = document.createEvent('MouseEvents') - clickEvent.initMouseEvent('click', true, true, window, 1, touch.screenX, - touch.screenY, touch.clientX, touch.clientY, false, false, false, false, 0, null); - clickEvent.fastclick = true; - targetElement.dispatchEvent(clickEvent) - }, needClick: function (target) { + //判定是否使用原生的点击事件, 否则使用sendClick方法手动触发一个人工的点击事件 switch (target.nodeName.toLowerCase()) { - - // Don't send a synthetic click to disabled inputs (issue #62) case 'button': case 'select': case 'textarea': @@ -5895,8 +5874,7 @@ var fastClick = { break; case 'input': - - // File inputs need real clicks on iOS 6 due to a browser bug (issue #68) + // IOS6 pad 上选择文件,如果不是原生的click,弹出的选择界面尺寸错误 if ((deviceIsIOS && target.type === 'file') || target.disabled) { return true } @@ -5910,18 +5888,6 @@ var fastClick = { return false }, - focus: function (targetElement) { - var length; - - // on iOS 7, some input elements (e.g. date datetime) throw a vague TypeError on setSelectionRange. These elements don't have an integer value for the selectionStart and selectionEnd properties, but unfortunately that can't be used for detection because accessing the properties also throws a TypeError. Just check the type instead. Filed as Apple bug #15122724. - if (deviceIsIOS && targetElement.setSelectionRange && - targetElement.type.indexOf('date') !== 0 && targetElement.type !== 'time') { - length = targetElement.value.length - targetElement.setSelectionRange(length, length) - } else { - targetElement.focus() - } - }, needFocus: function (target) { switch (target.nodeName.toLowerCase()) { case 'textarea': @@ -5937,304 +5903,335 @@ var fastClick = { case 'submit': return false } - - // No point in attempting to focus disabled inputs + //如果是只读或disabled状态,就无须获得焦点了 return !target.disabled && !target.readOnly default: return false } }, - updateScrollParent: function (targetElement) { + focus: function (targetElement) { + var length; + //在iOS7下, 对一些新表单元素(如date, datetime, time, month)调用focus方法会抛错, + //幸好的是,我们可以改用setSelectionRange获取焦点, 将光标挪到文字的最后 + var type = targetElement.type + if (deviceIsIOS && targetElement.setSelectionRange && + type.indexOf('date') !== 0 && type !== 'time' && type !== 'month') { + length = targetElement.value.length + targetElement.setSelectionRange(length, length) + } else { + targetElement.focus() + } + }, + findControl: function (labelElement) { + // 获取label元素所对应的表单元素 + // 可以能过control属性, getElementById, 或用querySelector直接找其内部第一表单元素实现 + if (labelElement.control !== undefined) { + return labelElement.control + } + + if (labelElement.htmlFor) { + return document.getElementById(labelElement.htmlFor) + } + + return labelElement.querySelector('button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea') + }, + fixTarget: function (target) { + if (target.nodeType === 3) { + return target.parentNode + } + if (window.SVGElementInstance && (target instanceof SVGElementInstance)) { + return target.correspondingUseElement; + } - var scrollParent = targetElement.fastClickScrollParent + return target + }, + updateScrollParent: function (targetElement) { + //如果事件源元素位于某一个有滚动条的祖父元素中,那么保持其scrollParent与scrollTop值 + var scrollParent = targetElement.tapScrollParent - // Attempt to discover whether the target element is contained within a scrollable layer. Re-check if the - // target element was moved to another parent. if (!scrollParent || !scrollParent.contains(targetElement)) { - var parentElement = targetElement; + var parentElement = targetElement do { if (parentElement.scrollHeight > parentElement.offsetHeight) { - scrollParent = parentElement; - targetElement.fastClickScrollParent = parentElement - break; + scrollParent = parentElement + targetElement.tapScrollParent = parentElement + break } parentElement = parentElement.parentElement - } while (parentElement); + } while (parentElement) } - // Always update the scroll top tracker if possible. if (scrollParent) { - scrollParent.fastClickLastScrollTop = scrollParent.scrollTop + scrollParent.lastScrollTop = scrollParent.scrollTop } }, + touchHasMoved: function (event) { + // 判定是否发生移动,其阀值是10px + var touch = event.changedTouches[0], + boundary = tapGesture.touchBoundary + return Math.abs(touch.pageX - tapGesture.touchStartX) > boundary || + Math.abs(touch.pageY - tapGesture.touchStartY) > boundary + + }, findControl: function (labelElement) { - // Fast path for newer browsers supporting the HTML5 control attribute + // 获取label元素所对应的表单元素 + // 可以能过control属性, getElementById, 或用querySelector直接找其内部第一表单元素实现 if (labelElement.control !== undefined) { return labelElement.control } - // All browsers under test that support touch events also support the HTML5 htmlFor attribute if (labelElement.htmlFor) { return document.getElementById(labelElement.htmlFor) } - // If no for attribute exists, attempt to retrieve the first labellable descendant element - // the list of which is defined here: http://www.w3.org/TR/html5/forms.html#category-label - return labelElement.querySelector('button, input:not([type=hidden]), keygen,' + - 'meter, output, progress, select, textarea') + return labelElement.querySelector('button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea') }, - touchHasMoved: function (event) { - var touch = event.changedTouches[0], - boundary = fastClick.touchBoundary - - if (Math.abs(touch.pageX - fastClick.touchStartX) > boundary || - Math.abs(touch.pageY - fastClick.touchStartY) > boundary) { - return true + findType: function (targetElement) { + // 安卓chrome浏览器上,模拟的 click 事件不能让 select 打开,故使用 mousedown 事件 + return deviceIsAndroid && targetElement.tagName.toLowerCase() === 'select' ? + 'mousedown' : 'click' + }, + sendClick: function (targetElement, event) { + // 在click之前触发tap事件 + gestureHooks.fire(targetElement, 'tap', { + touchEvent: event + }) + var clickEvent, touch + //某些安卓设备必须先移除焦点,之后模拟的click事件才能让新元素获取焦点 + if (document.activeElement && document.activeElement !== targetElement) { + document.activeElement.blur() } - return false + touch = event.changedTouches[0] + // 手动触发点击事件,此时必须使用document.createEvent('MouseEvents')来创建事件 + // 及使用initMouseEvent来初始化它 + clickEvent = document.createEvent('MouseEvents') + clickEvent.initMouseEvent(tapGesture.findType(targetElement), true, true, window, 1, touch.screenX, + touch.screenY, touch.clientX, touch.clientY, false, false, false, false, 0, null) + clickEvent.touchEvent = event + targetElement.dispatchEvent(clickEvent) }, - fixTarget: function (target) { - if (window.SVGElementInstance && (target instanceof SVGElementInstance)) { - target = target.correspondingUseElement; - } - - return target - } -} -supportPointer = !!navigator.pointerEnabled || !!navigator.msPointerEnabled - -if (supportPointer) { // 支持pointer的设备可用样式来取消click事件的300毫秒延迟 - root.style.msTouchAction = root.style.touchAction = "none" -} -avalon.gestureHooks.add("tap", { - events: ['tap', 'click'], touchstart: function (event) { - var targetElement, touch, selection; - - // Ignore multiple touches, otherwise pinch-to-zoom is prevented if both fingers are on the fastClick element (issue #111). - if (event.targetTouches.length > 1) { + //忽略多点触摸 + if (event.targetTouches.length !== 1) { return true } - - targetElement = fastClick.fixTarget(event.target); - touch = event.targetTouches[0]; - + //修正事件源对象 + var targetElement = tapGesture.fixTarget(event.target) + var touch = event.targetTouches[0] if (deviceIsIOS) { - - // Only trusted events will deselect text on iOS (issue #49) - selection = window.getSelection(); + // 判断是否是点击文字,进行选择等操作,如果是,不需要模拟click + var selection = window.getSelection(); if (selection.rangeCount && !selection.isCollapsed) { return true } + var id = touch.identifier + //当 alert 或 confirm 时,点击其他地方,会触发touch事件,identifier相同,此事件应该被忽略 + if (id && isFinite(tapGesture.lastTouchIdentifier) && tapGesture.lastTouchIdentifier === id) { + event.preventDefault() + return false + } - fastClick.updateScrollParent(targetElement); - } - - fastClick.trackingClick = true - fastClick.trackingClickStart = event.timeStamp - fastClick.targetElement = targetElement - - - fastClick.touchStartX = touch.pageX - fastClick.touchStartY = touch.pageY + tapGesture.lastTouchIdentifier = id - // Prevent phantom clicks on fast double-tap (issue #36) - if ((event.timeStamp - fastClick.lastClickTime) < fastClick.tapDelay) { + tapGesture.updateScrollParent(targetElement) + } + //收集触摸点的信息 + tapGesture.status = "tapping" + tapGesture.startTime = Date.now() + tapGesture.element = targetElement + tapGesture.pageX = touch.pageX + tapGesture.pageY = touch.pageY + // 如果点击太快,阻止双击带来的放大收缩行为 + if ((tapGesture.startTime - tapGesture.lastTime) < tapGesture.tapDelay) { event.preventDefault() } - - return true }, touchmove: function (event) { - if (!fastClick.trackingClick) { + if (tapGesture.status !== "tapping") { return true } - - // If the touch has moved, cancel the click tracking - if (fastClick.targetElement !== fastClick.fixTarget(event.target) || - fastClick.touchHasMoved(event)) { - fastClick.trackingClick = false - fastClick.targetElement = null + // 如果事件源元素发生改变,或者发生了移动,那么就取消触发点击事件 + if (tapGesture.element !== tapGesture.fixTarget(event.target) || + tapGesture.touchHasMoved(event)) { + tapGesture.status = tapGesture.element = 0 } }, touchend: function (event) { - var forElement, trackingClickStart, targetTagName, scrollParent, - targetElement = fastClick.targetElement; - - if (event.timeStamp - fastClick.trackingClickStart > fastClick.tapDelay || !fastClick.trackingClick) { - return true; - } - - // Prevent phantom clicks on fast double-tap (issue #36) - if ((event.timeStamp - fastClick.lastClickTime) < fastClick.tapDelay) { - fastClick.cancelNextClick = true; - return true; + var targetElement = tapGesture.element + var now = Date.now() + //如果是touchstart与touchend相隔太久,可以认为是长按,那么就直接返回 + //或者是在touchstart, touchmove阶段,判定其不该触发点击事件,也直接返回 + if (!targetElement || now - tapGesture.startTime > tapGesture.tapDelay) { + return true } - // Reset to prevent wrong click cancel on input (issue #156). - fastClick.cancelNextClick = false; - fastClick.lastClickTime = event.timeStamp; + tapGesture.lastTime = now - trackingClickStart = fastClick.trackingClickStart; - fastClick.trackingClick = false - fastClick.trackingClickStart = 0 + var startTime = tapGesture.startTime + tapGesture.status = tapGesture.startTime = 0 targetTagName = targetElement.tagName.toLowerCase() if (targetTagName === 'label') { - forElement = fastClick.findControl(targetElement) + //尝试触发label上可能绑定的tap事件 + gestureHooks.fire(targetElement, 'tap', { + touchEvent: event + }) + var forElement = tapGesture.findControl(targetElement) if (forElement) { - fastClick.focus(targetElement) - if (deviceIsAndroid) { - return false - } - + tapGesture.focus(targetElement) targetElement = forElement } - } else if (fastClick.needFocus(targetElement)) { - - // Case 1: If the touch started a while ago (best guess is 100ms based on tests for issue #36) then focus will be triggered anyway. Return early and unset the target element reference so that the subsequent click will be allowed through. - // Case 2: Without this exception for input elements tapped when the document is contained in an iframe, then any inputted text won't be visible even though the value attribute is updated as the user types (issue #37). - if ((event.timeStamp - trackingClickStart) > 100 || (deviceIsIOS && window.top !== window && targetTagName === 'input')) { - fastClick.targetElement = null - return false; + } else if (tapGesture.needFocus(targetElement)) { + // 如果元素从touchstart到touchend经历时间过长,那么不应该触发点击事 + // 或者此元素是iframe中的input元素,那么它也无法获点焦点 + if ((now - startTime) > 100 || (deviceIsIOS && window.top !== window && targetTagName === 'input')) { + tapGesture.element = 0 + return false } - fastClick.focus(targetElement) - deviceIsAndroid && fastClick.sendClick(targetElement, event) + tapGesture.focus(targetElement) + deviceIsAndroid && tapGesture.sendClick(targetElement, event) - return false; + return false } if (deviceIsIOS) { - - // Don't send a synthetic click event if the target element is contained within a parent layer that was scrolled - // and this tap is being used to stop the scrolling (usually initiated by a fling - issue #42). - scrollParent = targetElement.fastClickScrollParent; - if (scrollParent && scrollParent.fastClickLastScrollTop !== scrollParent.scrollTop) { + //如果它的父容器的滚动条发生改变,那么应该识别为划动或拖动事件,不应该触发点击事件 + var scrollParent = targetElement.tapScrollParent; + if (scrollParent && scrollParent.lastScrollTop !== scrollParent.scrollTop) { return true } } - - // Prevent the actual click from going though - unless the target node is marked as requiring - // real clicks or if it is in the whitelist in which case only non-programmatic clicks are permitted. - if (!fastClick.needClick(targetElement)) { - event.preventDefault(); - fastClick.sendClick(targetElement, event) + //如果这不是一个需要使用原生click的元素,则屏蔽原生事件,避免触发两次click + if (!tapGesture.needClick(targetElement)) { + event.preventDefault() + // 触发一次模拟的click + tapGesture.sendClick(targetElement, event) } - - return false; }, touchcancel: function () { - fastClick.trackingClick = false - fastClick.targetElement = null - } -}) - -var swipeGesture = { - events: ['swipe', 'swipeleft', 'swiperight', 'swipeup', 'swipedown'], - touchstart: function (event) { - startGesture(event, noop) - }, - touchmove: function (event) { - moveGesture(event, noop) - }, - touchend: function (event) { - endGesture(event, function (gesture, touch) { - var now = Date.now() - var isflick = (gesture.distance > 100 && gesture.distance / gesture.duration > 0.65) - - if (isflick) { - var displacementX = touch.clientX - gesture.startTouch.clientX - var displacementY = touch.clientY - gesture.startTouch.clientY - var extra = { - duration: now - gesture.startTime, - isflick: isflick, - displacementX: displacementX, - displacementY: displacementY, - touch: touch, - touchEvent: event, - isVertical: gesture.isVertical - } - var target = gesture.element, - dir - fireGesture(target, 'swipe', extra) - - if (gesture.isVertical) { - dir = displacementY > 0 ? 'down' : 'up' - } else { - dir = displacementY > 0 ? 'right' : 'left' - } - fireGesture(target, 'swipe' + dir, extra) - } - }) + tapGesture.startTime = tapGesture.element = 0 } } -swipeGesture.touchcancel = swipeGesture.touchend -avalon.gestureHooks.add('swipe', swipeGesture) +gestureHooks.add("tap", tapGesture) + -var lastTap = null -function cancelPress(gesture) { - clearTimeout(gesture.pressingHandler) - gesture.pressingHandler = null -} var pressGesture = { events: ['longtap', 'doubletap'], + cancelPress: function (pointer) { + clearTimeout(pointer.pressingHandler) + pointer.pressingHandler = null + }, touchstart: function (event) { - startGesture(event, function (gesture, event) { - gesture.pressingHandler = setTimeout(function () { - if (gesture.status === 'tapping') { - gesture.status = 'pressing' - fireGesture(event.target, 'longtap', { + gestureHooks.start(event, function (pointer, touch) { + pointer.pressingHandler = setTimeout(function () { + if (pointer.status === 'tapping') { + gestureHooks.fire(event.target, 'longtap', { + touch: touch, touchEvent: event }) } - cancelPress(gesture) + pressGesture.cancelPress(pointer) }, 500) + if (event.changedTouches.length !== 1) { + pointer.status = 0 + } }) + }, touchmove: function (event) { - moveGesture(event, function (gesture) { - - if (gesture.distance > 10 && gesture.pressingHandler) { - cancelPress(gesture) - - if (gesture.status === 'tapping' || gesture.status === 'pressing') { - gesture.status = 'panning' + gestureHooks.move(event, function (pointer) { + if (pointer.distance > 10 && pointer.pressingHandler) { + pressGesture.cancelPress(pointer) + if (pointer.status === 'tapping') { + pointer.status = 'panning' } } }) }, touchend: function (event) { - endGesture(event, function (gesture, touch) { - cancelPress(gesture) - - if (gesture.status === 'tapping') { - gesture.timestamp = Date.now() - - if (lastTap && gesture.timestamp - lastTap.timestamp < 300) { - fireGesture(gesture.element, 'doubletap', { + gestureHooks.end(event, function (pointer, touch) { + pressGesture.cancelPress(pointer) + if (pointer.status === 'tapping') { + pointer.lastTime = Date.now() + if (pressGesture.lastTap && pointer.lastTime - pressGesture.lastTap.lastTime < 300) { + gestureHooks.fire(pointer.element, 'doubletap', { touch: touch, touchEvent: event }) } - lastTap = gesture + pressGesture.lastTap = pointer } }) }, touchcancel: function (event) { - endGesture(event, function (gesture) { - cancelPress(gesture) + gestureHooks.end(event, function (pointer) { + pressGesture.cancelPress(pointer) }) } } -avalon.gestureHooks.add('press', pressGesture) +gestureHooks.add('press', pressGesture) + +var swipeGesture = { + events: ['swipe', 'swipeleft', 'swiperight', 'swipeup', 'swipedown'], + getAngle: function (x, y) { + var r = Math.atan2(y, x) //radians + var angle = Math.round(r * 180 / Math.PI) //degrees + return angle < 0 ? 360 - Math.abs(angle) : angle + }, + getDirection: function (x, y) { + var angle = swipeGesture.getAngle(x, y) + if ((angle <= 45) && (angle >= 0)) { + return "left" + } else if ((angle <= 360) && (angle >= 315)) { + return "left" + } else if ((angle >= 135) && (angle <= 225)) { + return "right" + } else if ((angle > 45) && (angle < 135)) { + return "down" + } else { + return "up" + } + }, + touchstart: function (event) { + gestureHooks.start(event, noop) + }, + touchmove: function (event) { + gestureHooks.move(event, noop) + }, + touchend: function (event) { + if(event.changedTouches.length !== 1){ + return + } + gestureHooks.end(event, function (pointer, touch) { + var isflick = (pointer.distance > 30 && pointer.distance / pointer.duration > 0.65) + if (isflick) { + var extra = { + deltaX : pointer.deltaX, + deltaY: pointer.deltaY, + touch: touch, + touchEvent: event, + direction: swipeGesture.getDirection(pointer.deltaX, pointer.deltaY), + isVertical: pointer.isVertical + } + var target = pointer.element + gestureHooks.fire(target, 'swipe', extra) + gestureHooks.fire(target, 'swipe' + extra.direction, extra) + } + }) + } +} + +swipeGesture.touchcancel = swipeGesture.touchend +gestureHooks.add('swipe', swipeGesture) + // Register as a named AMD module, since avalon can be concatenated with other diff --git a/dist/avalon.mobile.min.js b/dist/avalon.mobile.min.js index 7d3706b7a..f301924d8 100644 --- a/dist/avalon.mobile.min.js +++ b/dist/avalon.mobile.min.js @@ -1,3 +1,3 @@ -!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("Avalon requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(){avalon.config.debug&&console.log.apply(console,arguments)}function r(){return Object.create(null)}function i(e){return Function.apply(o,e)}function o(){}function l(e,t){"string"==typeof e&&(e=e.match(Gt)||[]);for(var n={},a=void 0!==t?t:1,r=0,i=e.length;i>r;r++)n[e[r]]=a;return n}function s(){if(e.VBArray){var t=document.documentMode;return t?t:e.XMLHttpRequest?7:6}return 0/0}function c(e){if(e&&"object"==typeof e){var t=e.length,n=tn.call(e);if(/(Array|List|Collection|Map|Arguments)\]$/.test(n))return!0;if("[object Object]"===n&&t===t>>>0)return!0}return!1}function u(e,t){if(e&&e.childNodes)for(var n,a=e.childNodes,r=0;n=a[r++];)if(n.tagName){var i=_t.createElementNS(mn,n.tagName.toLowerCase());nn.forEach.call(n.attributes,function(e){i.setAttribute(e.name,e.value)}),u(n,i),t.appendChild(i)}}function f(e){for(var t in e)if(en.call(e,t)){var n=e[t];"function"==typeof f.plugins[t]?f.plugins[t](n):"object"==typeof f[t]?avalon.mix(f[t],n):f[t]=n}return this}function d(e){return(e+"").replace(Cn,"\\$&")}function p(e,t){var n=this.$events||(this.$events={}),a=n[e]||(n[e]=[]);if("function"==typeof t){var r=t;r.uniqueNumber=Math.random(),t={element:on,type:"user-watcher",handler:o,vmodels:[this],expr:e,uniqueNumber:r.uniqueNumber},t.wildcard=/\*/.test(e)}if(t.update)t.oneTime||avalon.Array.ensure(a,t);else{if(/\w\.*\B/.test(e)){t.getter=o;var i=this;t.update=function(){var e=this.fireArgs||[];e[2]&&t.handler.apply(i,e),delete this.fireArgs},a.sync=!0,avalon.Array.ensure(a,t)}else avalon.injectBinding(t);r&&(t.handler=r)}return function(){t.update=t.getter=t.handler=o,t.element=_t.createElement("a")}}function v(e,t){var n=this.$events;if(n&&n[e]){t&&(t[2]=e),m(n[e],t);var a=this.$up;a&&(this.$pathname&&v.call(a,this.$pathname+"."+e,t),v.call(a,"*."+e,t))}else if(a=this.$up){var r=this.$pathname+"."+e,i=r.split(".");-1===i.indexOf("*")?(v.call(a,r,t),i[1]="*",v.call(a,i.join("."),t)):v.call(a,r,t)}}function h(e,t){for(;;){if(e.$watch){var n=e.$events||(e.$events={}),a=n[t]||(n[t]=[]);return void Ln.collectDependency(a)}if(e=e.$up,!e)break;t=e.$pathname+"."+t}}function m(e,t){if(e){new Date-Rn>444&&"object"==typeof e[0]&&L();for(var n,a=[],r=[],i=0;n=e[i++];)"user-watcher"===n.type?a.push(n):r.push(n);if(f.async){for(Ca.render(),i=0;n=r[i++];)if(n.update){var o=O(n);Ca.queue[o]||(Ca.queue[o]=1,Ca.queue.push(n))}}else for(i=0;n=r[i++];)n.update&&n.update();for(i=0;n=a[i++];)(t&&t[2]===n.expr||n.wildcard)&&(n.fireArgs=t),n.update()}}function g(e,t){return t=t||{},t.watch=!0,b(e,t)}function y(){}function b(e,t){function a(e){return u[e]===!0}if(!e||e.$id&&e.$accessors)return e;t=t||Wt;var r=t.force||Wt,i=t.old,o="object"==typeof i?i.$accessors:Wt,s=new y,c={},u={},f=[],d=[],h={};e.$skipArray&&(h=l(e.$skipArray),delete e.$skipArray);var m=e.$computed;if(m){delete e.$computed;for(var g in m)u[g]=!0,function(e,t){var n;c[e]={get:function(){return n=t.get.call(this)},set:function(a){if("function"==typeof t.set){var r=n;t.set.call(this,a);var i=this[e];this.$fire&&i!==r&&this.$fire(e,i,r)}},enumerable:!0,configurable:!0}}(g,m[g])}for(g in e){var b=e[g];An[g]||(u[g]=!0),"function"==typeof b||b&&b.nodeType||!r[g]&&("$"===g.charAt(0)||An[g]||h[g])?f.push(g):$(b)?(n("warning:计算属性建议放在$computed对象中统一定义"),function(e,t){var n;c[e]={get:function(){return n=t.get.call(this)},set:function(a){if("function"==typeof t.set){var r=n;t.set.call(this,a);var i=this[e];this.$fire&&i!==r&&this.$fire(e,i,r)}},enumerable:!0,configurable:!0}}(g,b)):(d.push(g),c[g]=o[g]?o[g]:x(g,b))}c.$model=Nn,s=Object.defineProperties(s,c,e),f.forEach(function(t){s[t]=e[t]}),C(s,"$id","anonymous"),C(s,"$up",i?i.$up:null),C(s,"$track",Object.keys(u)),C(s,"$active",!1),C(s,"$pathname",i?i.$pathname:""),C(s,"$accessors",c),C(s,"hasOwnProperty",a),t.watch&&(C(s,"$watch",function(){return p.apply(s,arguments)}),C(s,"$fire",function(e,t){if(0===e.indexOf("all!")){var n=e.slice(4);for(var a in avalon.vmodels){var r=avalon.vmodels[a];r.$fire&&r.$fire.apply(r,[n,t])}}else v.call(s,e,[t])})),d.forEach(function(t){var n=s[t]=e[t];n&&"object"==typeof n&&(n.$up=s,n.$pathname=t),v.call(s,t)});for(g in m)b=s[g];return s.$active=!0,s}function $(e){if(e&&"object"==typeof e){for(var t in e)if("get"!==t&&"set"!==t)return!1;return"function"==typeof e.get}}function x(e,t){var n,t=0/0;return{get:function(){return this.$active&&h(this,e),t},set:function(a){if(t!==a){var r=t;n=w(a,t),n?t=n:(n=void 0,t=a),Object(n)===n&&(n.$pathname=e,n.$up=this),this.$active&&v.call(this,e,[t,r])}},enumerable:!0,configurable:!0}}function w(e,t,n,a){if(Array.isArray(e))return k(e,t,a);if(avalon.isPlainObject(e)){if(t){var r=Object.keys(e),i=Object.keys(t);if(r.join(";")===i.join(";")){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);return t}t.$active=!1}return b(e,{old:t,watch:a})}return n?e:void 0}function k(e,t,n){if(t){var a=[0,t.length].concat(e);return t.splice.apply(t,a),t}for(var r in On)e[r]=On[r];C(e,"$up",null),C(e,"$pathname",""),C(e,"$track",A(e.length)),e._=b({length:0/0},{watch:!0}),e._.length=e.length,e._.$watch("length",function(t,n){v.call(e.$up,e.$pathname+".length",[t,n])}),n&&C(e,"$watch",function(){return p.apply(e,arguments)}),Object.defineProperty(e,"$model",Nn);for(var i=0,o=e.length;o>i;i++){var l=e[i]=w(e[i],0,1,1);Object(l)===l&&(l.$up=e)}return e}function C(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!1,configurable:!0})}function T(e){var t=avalon.type(e);if("array"===t){for(var n=[],a=0;aa;a++){n[a]=e[a];var i=t[a];i in n?(e[a]=n[i],delete n[i]):e[a]=e[i]}}function A(e){for(var t=[],n=0;e>n;n++)t[n]=cn("$proxy$each");return t}function N(e,t,n){switch(t){case"push":case"unshift":n=A(n.length);break;case"splice":if(n.length>2){{n[1],n.length-2}n=[n[0],n[1]].concat(A(n.length-2))}}Array.prototype[t].apply(e,n)}function S(e,t){t.oneTime||e&&avalon.Array.ensure(e,t)&&t.element&&(j(t,e),new Date-Rn>444&&L())}function M(e,t){for(var n,a=[],r=0;n=e[r++];)a.push(t?n.$id:n.$key);return a.join(";")}function O(e){if(!e.uniqueNumber){var t=e.element;e.uniqueNumber=t?1!==t.nodeType?e.type+(e.pos||0)+"-"+O(t.parentNode):e.name+"-"+O(t):++Hn}return e.uniqueNumber}function j(e,t){var n=e.lists||(e.lists=[]),a=O(e);avalon.Array.ensure(n,t),t.$uuid=t.$uuid||cn(),Dn[a]||(Dn[a]=1,Dn.push(e))}function L(e){for(var t=Dn.length,n=t,a=[],r={},i={};e=Dn[--t];){var o=e.type;i[o]?i[o]++:(i[o]=1,a.push(o))}var l=!1;if(a.forEach(function(e){Pn[e]!==i[e]&&(r[e]=1,l=!0)}),t=n,l)for(;e=Dn[--t];)if(null!==e.element){if(r[e.type]&&D(e.element)){Dn.splice(t,1),delete Dn[e.uniqueNumber];for(var s,c=e.lists,u=0;s=c[u++];)avalon.Array.remove(c,s),avalon.Array.remove(s,e);H(e)}}else Dn.splice(t,1);Pn=i,Rn=new Date}function H(e){delete Dn[e.uniqueNumber],e.element=null,e.rollback&&e.rollback();for(var t in e)e[t]=null}function D(e){try{{e.parentNode.nodeType}}catch(t){return!0}return e.ifRemove&&!on.contains(e.ifRemove)&&Ut===e.parentNode?(e.parentNode&&e.parentNode.removeChild(e),!0):e.msRetain?0:1===e.nodeType?!on.contains(e):!avalon.contains(on,e)}function R(e){return e.replace(/([a-z\d])([A-Z]+)/g,"$1-$2").toLowerCase()}function P(e){return e.indexOf("-")<0&&e.indexOf("_")<0?e:e.replace(/[-_][^-_]/g,function(e){return e.charAt(1).toUpperCase()})}function q(e){try{if("object"==typeof e)return e;e="true"===e?!0:"false"===e?!1:"null"===e?null:+e+""===e?+e:Un.test(e)?JSON.parse(e):e}catch(t){}return e}function B(e){return e.window&&e.document?e:9===e.nodeType?e.defaultView:!1}function F(e,t){if(e.offsetWidth<=0){var n=getComputedStyle(e,null);if(Gn.test(n.display)){var a={node:e};for(var r in Wn)a[r]=n[r],e.style[r]=Wn[r];t.push(a)}var i=e.parentNode;i&&1===i.nodeType&&F(i,t)}}function _(e){var t=e.tagName.toLowerCase();return"input"===t&&/checkbox|radio/.test(e.type)?"checked":t}function V(e,t){var n=[],a=!!t;t=t||0;for(var r="unknown",o="",l=0;lu;u++)if(r.length){var d="vm"+o+"_"+u;s.push(d),c.push(t[u]),l.push.apply(l,U(r,t[u],d,n))}n.args=c;var p=n.type,v=t.map(function(e){return String(e.$id).replace(ta,"$1")})+e+p,h=aa.get(v);if(h){if("duplex"===p){var m=aa.get(v+"setter");n.setter=m.apply(m,n.args)}return n.getter=h}if(l.length||l.push("fix"+o),"duplex"===p){var g={};l.forEach(function(e){var t=e.split("=");g[t[0].trim()]=t[1].trim()}),e=e.replace(/[\$\w]+/,function(e){return g[e]?g[e]:e});var y=i(s.concat("'use strict';return function(vvv){"+e+" = vvv\n}\n"));aa.put(v+"setter",y),n.setter=y.apply(y,n.args)}if("on"===p){-1===e.indexOf("(")?e+=".call(this, $event)":e=e.replace("(",".call(this,"),s.push("$event"),e="\nreturn "+e+";";var b=e.lastIndexOf("\nreturn"),$=e.slice(0,b),x=e.slice(b);e=$+"\n"+x}else e="\nreturn "+e+";";return h=i(s.concat("'use strict';\nvar "+l.join(",\n")+e)),aa.put(v,h)}function z(e){var t=xn.test(e);if(t){var n=it(e);return 1===n.length?n[0].expr:n.map(function(e){return e.type?"("+e.expr+")":ca(e.expr)}).join(" + ")}return e}function W(e){return e=e.replace(ra,"").replace(ia,function(){return"],|"}).replace(oa,function(e,t){return"["+ca(t)}).replace(la,function(){return'"],["'}).replace(sa,function(){return'",'})+"]",i(["return ["+e+"]"])()}function G(e,t,n){var a=setTimeout(function(){var r=e.innerHTML;clearTimeout(a),r===n?t():G(e,t,r)})}function Z(e,t){var n=e.getAttribute("avalonctrl")||t.$id;e.setAttribute("avalonctrl",n),t.$events&&(t.$events.expr=e.tagName+'[avalonctrl="'+n+'"]')}function J(e,t){for(var n,a=0;n=e[a++];)n.vmodels=t,vn[n.type].init(n),avalon.injectBinding(n),n.getter&&1===n.element.nodeType&&n.element.removeAttribute(n.name);e.length=0}function K(e,t){return e.priority-t.priority}function Q(e,t,a){var r=!0;if(t.length){for(var i,o=e.attributes,l=[],s={},c=0;i=o[c++];){var u=i.name;if(!s[u]&&(s[u]=1,i.specified&&(a=u.match(va)))){var f=a[1],d=a[2]||"",p=i.value;if(ha[f]?(d=f,f="on"):ma[f]&&(d=f,f="attr",u="ms-"+f+"-"+d,n("warning!请改用"+u+"代替"+i.name+"!")),vn[f]){var v=p.replace(pa,""),h=p!==v,m={type:f,param:d,element:e,name:u,expr:v,oneTime:h,priority:(vn[f].priority||10*f.charCodeAt(0))+(Number(d.replace(/\D/g,""))||0)};if("html"===f||"text"===f){var g=rt(p).filters;m.expr=m.expr.replace(g,""),m.filters=g.replace($a,function(){return m.type="html",m.group=1,""}).trim()}else if("duplex"===f)var y=u;else if("ms-if-loop"===u)m.priority+=100;else if("ms-attr-value"===u)var b=u;l.push(m)}}}if(l.length){for(l.sort(K),y&&b&&"text"===e.type&&n("warning!一个控件不能同时定义ms-attr-value与"+y),c=0;m=l[c];c++){if(f=m.type,ga.test(f))return J(l.slice(0,c+1),t);r&&(r=!ya.test(f))}J(l,t)}}r&&!ua[e.tagName]&&(da&&da(e),tt(e,t))}function et(e){for(var t,n=e.attributes,a={},r=0;t=n[r++];)t.specified&&!ba.test(t.name)&&(a[P(t.name)]=q(t.value));return a}function tt(e,t){var n=avalon.slice(e.childNodes);nt(n,t)}function nt(e,t){for(var n,a=0;n=e[a++];)switch(n.nodeType){case 1:var r=n;if(at(n,t),!r.msResolved&&r.parentNode&&1===r.parentNode.nodeType){var i=st(r);if(i){var o=r.localName?r.localName.replace(i+":",""):r.nodeName,l=i+":"+P(o);Ta.push({library:i,element:r,fullName:l,widget:o,vmodels:t,name:"widget"}),avalon.components[l]&&avalon.component(l)}}n.msHasEvent&&avalon.fireDom(n,"datasetchanged",{bubble:n.msHasEvent});break;case 3:xn.test(n.nodeValue)&&ot(n,t,a)}}function at(e,t,n){var a=e.getAttribute("ms-skip"),r=e.getAttributeNode("ms-important"),i=e.getAttributeNode("ms-controller");if("string"!=typeof a){if(n=r||i){var o=avalon.vmodels[n.value];if(!o)return;t=n===r?[o]:[o].concat(t),e.removeAttribute(n.name),e.classList.remove(n.name),Z(e,o)}Q(e,t)}}function rt(e){if(e.indexOf("|")>0){var t=e.replace(wa,function(e){return Array(e.length+1).join("1")}),n=t.replace(xa,"ᄢ㍄").indexOf("|");if(n>-1)return{type:"text",filters:e.slice(n).trim(),expr:e.slice(0,n)}}return{type:"text",expr:e,filters:""}}function it(e){for(var t,n,a=[],r=0;;){if(n=e.indexOf(bn,r),-1===n)break;if(t=e.slice(r,n),t&&a.push({expr:t}),r=n+bn.length,n=e.indexOf($n,r),-1===n)break;t=e.slice(r,n),t&&a.push(rt(t,r)),r=n+$n.length}return t=e.slice(r),t&&a.push({expr:t}),a}function ot(e,t,n){var a=[];if(tokens=it(e.data),tokens.length){for(var r=0;token=tokens[r++];){var i=_t.createTextNode(token.expr);token.type&&(token.expr=token.expr.replace(pa,function(){return token.oneTime=!0,""}),token.element=i,token.filters=token.filters.replace($a,function(){return token.type="html",""}),token.pos=1e3*n+r,a.push(token)),ln.appendChild(i)}e.parentNode.replaceChild(ln,e),a.length&&J(a,t)}}function lt(e,t){if(t)for(var n,a=0;n=e[a++];)if(n.hasOwnProperty(t)&&"object"==typeof n[t]){var r=n[t];return r.$model||r}return{}}function st(e){if(e.scopeName&&"HTML"!==e.scopeName)return e.scopeName;var t=e.nodeName.toLowerCase(),n=t.indexOf(":");return n>0?t.slice(0,n):void 0}function ct(e){return null==e?"":e}function ut(e,t,n){return t.param.replace(Zt,function(a){var r=avalon.duplexHooks[a];r&&"function"==typeof r[n]&&(e=r[n](e,t))}),e}function ft(){for(var e=Ra.length-1;e>=0;e--){var t=Ra[e];t()===!1&&Ra.splice(e,1)}Ra.length||clearInterval(Da)}function dt(e,t){if(!e||1!==e.nodeType)return null;if(t)var n=t.effectName,a=t.effectDriver;else n=e.getAttribute("data-effect-name"),a=e.getAttribute("data-effect-driver");if(!n||!a)return null;var r=Ua.pop()||new ht;return r.el=e,r.driver=a,r.useCss="j"!==a,r.useCss&&(t&&avalon(e).addClass(t.effectClass),r.cssEvent="t"===a?qa:Ba),r.name=n,r.callbacks=avalon.effects[n]||{},r}function pt(e,t){var n=e.getAttribute("data-effect-name");if(n){t.effectName=n,t.effectDriver=e.getAttribute("data-effect-driver");var a=+e.getAttribute("data-effect-stagger");t.effectLeaveStagger=+e.getAttribute("data-effect-leave-stagger")||a,t.effectEnterStagger=+e.getAttribute("data-effect-enter-stagger")||a,t.effectClass=e.className||0/0}}function vt(e){return e.replace(/^[\S]/g,function(e){return e.toUpperCase()})}function ht(){}function mt(e,t){var n=e.callbacks[t+"Class"];return"string"==typeof n?n:"function"==typeof n?n():e.name+"-"+t}function gt(e,t,n){var a=e.callbacks[t];a&&a.call(e,e.el,n)}function yt(e,t,n){var a=e.templateCache&&e.templateCache[t];if(a){for(var r,i=_t.createDocumentFragment();r=a.firstChild;)i.appendChild(r);return i}return avalon.parseHTML(n)}function bt(e){for(var t=_t.createDocumentFragment(),n=0,a=e.length;a>n;n++)t.appendChild(e[n]);return t}function $t(e,t,n){for(var a,r=0;a=e[r++];)a.className===n.effectClass&&avalon.effect.apply(a,t,o,o,n)}function xt(e,t,n){return e?setTimeout(t,++n*e):t(),n}function wt(e,t){for(var n=ln.cloneNode(!1),a=e,r=a.nodeValue,i=t&&Math.max(+t.staggerIndex,0),l=avalon.slice(a.parentNode.childNodes),s=l.indexOf(a);;){var c=l[--s];if(!c||0===String(c.nodeValue).indexOf(r))break;t&&c.className===t.effectClass?(e=c,function(e){t.staggerIndex=xt(t.effectLeaveStagger,function(){avalon.effect.apply(e,0,o,function(){n.appendChild(e)},t)},i)}(c)):n.insertBefore(c,n.firstChild)}return n.appendChild(a),n}function kt(e,t,n,a,r){var i=e.template.cloneNode(!0),o=avalon.slice(i.childNodes);i.appendChild(n.$anchor),r&&t.appendChild(i);var l=[n].concat(e.vmodels),s={nodes:o,vmodels:l,content:i};a.push(s)}function Ct(e){var t="object"===e.xtype?Nt:Tt,n=t(e),a=n.$anchor||(n.$anchor=e.element.cloneNode(!1));return a.nodeValue=e.signature,n.$outer=e.$outer,n}function Tt(e,t){for(var n=e.param||"el",a=0,r=Ja.length;r>a;a++){var i=Ja[a];if(i&&i.hasOwnProperty(n)){Ja.splice(a,1),t=i;break}}return t||(t=Et(n)),t}function Et(e){var t={$outer:{},$index:0,$oldIndex:0,$anchor:null,$first:!1,$last:!1,$remove:avalon.noop};t[e]=0/0;var n={$last:1,$first:1,$index:1};n[e]=1;var a=g(t,{force:n});return a.$id=cn("$proxy$each"),a}function At(e,t,n){if("array"===n){e.$remove=function(){t.$repeat.removeAt(e.$index)};var a=t.param;e.$watch(a,function(n){var a=e.$index;t.$repeat[a]=n})}else e.$watch("$val",function(n){t.$repeat[e.$key]=n})}function Nt(){return Ka.pop()||St()}function St(){var e=g({$key:"",$val:0/0,$index:0,$oldIndex:0,$outer:{},$anchor:null},{force:{$key:1,$val:1,$index:1}});return e.$id=cn("$proxy$with"),e}function Mt(e,t,n){var a=e[t];if(a){var r=0===a.$id.indexOf("$proxy$each")?Ja:Ka;a.$outer={};for(var i in a.$events){var o=a.$events[i];Array.isArray(o)&&(o.length=0,i===n?a[n]=0/0:"$val"===i&&(a.$val=0/0))}r.unshift(a)>f.maxRepeatSize&&r.pop(),delete e[t]}}function Ot(e,t){var n="_"+e;if(!Ot[n]){var a=_t.createElement(e);on.appendChild(a),t=rn?getComputedStyle(a,null).display:a.currentStyle.display,on.removeChild(a),Ot[n]=t}return Ot[n]}function jt(e,t,n,a){e=(e+"").replace(/[^0-9+\-Ee.]/g,"");var r=isFinite(+e)?+e:0,i=isFinite(+t)?Math.abs(t):3,o=a||",",l=n||".",s="",c=function(e,t){var n=Math.pow(10,t);return""+(Math.round(e*n)/n).toFixed(t)};return s=(i?c(r,i):""+Math.round(r)).split("."),s[0].length>3&&(s[0]=s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,o)),(s[1]||"").length0){var o=70;i>o&&(i=o),r.duration+i>o&&(r.duration=o-i),r.duration+=i,r.lastTouch=Ht({},a),r.lastTime=Date.now();var l=a.clientX-r.startTouch.clientX,s=a.clientY-r.startTouch.clientY;r.distance=Math.sqrt(Math.pow(l,2)+Math.pow(s,2)),r.isVertical=!(Math.abs(l)>Math.abs(s)),t(r,a)}}}function Pt(e,t){for(var n=0;n');var It,Ut=Vt.firstChild,Xt="$"+Ft,Yt=e.require,zt=e.define,Wt={},Gt=/[^, ]+/g,Zt=/\w+/g,Jt=/^\[object SVG\w*Element\]$/,Kt=/^\[object (?:Window|DOMWindow|global)\]$/,Qt=Object.prototype,en=Qt.hasOwnProperty,tn=Qt.toString,nn=Array.prototype,an=nn.slice,rn=e.dispatchEvent,on=_t.documentElement,ln=_t.createDocumentFragment(),sn=(_t.createElement("div"),{});"Boolean Number String Function Array Date RegExp Object Error".replace(Gt,function(e){sn["[object "+e+"]"]=e.toLowerCase()});var cn=function(e){return e=e||"avalon",String(Math.random()+Math.random()).replace(/\d\.\d{4}/,e)},un=s();avalon=function(e){return new avalon.init(e)},avalon.nextTick=new function(){function t(){for(var e=r.length,t=0;e>t;t++)r[t]();r=r.slice(e)}var n=e.setImmediate,a=e.MutationObserver;if(n)return n.bind(e);var r=[];if(a){var i=document.createTextNode("avalon");new a(t).observe(i,{characterData:!0});var o=!1;return function(e){r.push(e),o=!o,i.data=o}}return function(e){setTimeout(e,4)}},avalon.init=function(e){this[0]=this.element=e},avalon.fn=avalon.prototype=avalon.init.prototype,avalon.type=function(e){return null==e?String(e):"object"==typeof e||"function"==typeof e?sn[tn.call(e)]||"object":typeof e};var fn=function(e){return"[object Function]"===tn.call(e)};avalon.isFunction=fn,avalon.isWindow=function(e){return Kt.test(tn.call(e))},avalon.isPlainObject=function(e){return"[object Object]"===tn.call(e)&&Object.getPrototypeOf(e)===Qt},avalon.mix=avalon.fn.mix=function(){var e,t,n,a,r,i,o=arguments[0]||{},l=1,s=arguments.length,c=!1;for("boolean"==typeof o&&(c=o,o=arguments[1]||{},l++),"object"==typeof o||fn(o)||(o={}),l===s&&(o=this,l--);s>l;l++)if(null!=(e=arguments[l]))for(t in e)n=o[t],a=e[t],o!==a&&(c&&a&&(avalon.isPlainObject(a)||(r=Array.isArray(a)))?(r?(r=!1,i=n&&Array.isArray(n)?n:[]):i=n&&avalon.isPlainObject(n)?n:{},o[t]=avalon.mix(c,i,a)):void 0!==a&&(o[t]=a));return o},avalon.mix({rword:Gt,subscribers:Xt,version:1.53,ui:{},log:n,slice:function(e,t,n){return an.call(e,t,n)},noop:o,error:function(e,t){throw new(t||Error)(e)},oneObject:l,range:function(e,t,n){n||(n=1),null==t&&(t=e||0,e=0);for(var a=-1,r=Math.max(0,Math.ceil((t-e)/n)),i=new Array(r);++an&&t(n,e[n])!==!1;n++);else for(n in e)if(e.hasOwnProperty(n)&&t(n,e[n])===!1)break}},getWidgetData:function(e,t){var n=avalon(e).data(),a={};for(var r in n)0===r.indexOf(t)&&(a[r.replace(t,"").replace(/\w/,function(e){return e.toLowerCase()})]=n[r]);return a},Array:{ensure:function(e,t){return-1===e.indexOf(t)?e.push(t):void 0},removeAt:function(e,t){return!!e.splice(t,1).length},remove:function(e,t){var n=e.indexOf(t);return~n?avalon.Array.removeAt(e,n):!1}}});var dn=avalon.bindingHandlers={},pn=avalon.bindingExecutors={},vn=avalon.directives={};avalon.directive=function(e,t){return dn[e]=t.init=t.init||o,pn[e]=t.update=t.update||o,vn[e]=t};var hn=new function(){function e(e){this.size=0,this.limit=e,this.head=this.tail=void 0,this._keymap={}}var t=e.prototype;return t.put=function(e,t){var n={key:e,value:t};return this._keymap[e]=n,this.tail?(this.tail.newer=n,n.older=this.tail):this.head=n,this.tail=n,this.size===this.limit?this.shift():this.size++,t},t.shift=function(){var e=this.head;e&&(this.head=this.head.newer,this.head.older=e.newer=e.older=this._keymap[e.key]=void 0,delete this._keymap[e.key])},t.get=function(e){var t=this._keymap[e];if(void 0!==t)return t===this.tail?t.value:(t.newer&&(t===this.head&&(this.head=t.newer),t.newer.older=t.older),t.older&&(t.older.newer=t.newer),t.newer=void 0,t.older=this.tail,this.tail&&(this.tail.newer=t),this.tail=t,t.value)},e};if(_t.contains||(Node.prototype.contains=function(e){return!!(16&this.compareDocumentPosition(e))}),avalon.contains=function(e,t){try{for(;t=t.parentNode;)if(t===e)return!0;return!1}catch(n){return!1}},e.SVGElement){var mn="http://www.w3.org/2000/svg",gn=_t.createElementNS(mn,"svg");gn.innerHTML='',Jt.test(gn.firstChild)||Object.defineProperties(SVGElement.prototype,{outerHTML:{enumerable:!0,configurable:!0,get:function(){return(new XMLSerializer).serializeToString(this)},set:function(e){var t=this.tagName.toLowerCase(),n=this.parentNode,a=avalon.parseHTML(e);if("svg"===t)n.insertBefore(a,this);else{var r=_t.createDocumentFragment();u(a,r),n.insertBefore(r,this)}n.removeChild(this)}},innerHTML:{enumerable:!0,configurable:!0,get:function(){var e=this.outerHTML,t=new RegExp("<"+this.nodeName+'\\b(?:(["\'])[^"]*?(\\1)|[^>])*>',"i"),n=new RegExp("$","i");return e.replace(t,"").replace(n,"")},set:function(e){if(avalon.clearHTML){avalon.clearHTML(this);var t=avalon.parseHTML(e);u(t,this)}}}})}var yn=avalon.eventHooks;"onmouseenter"in on||avalon.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){yn[e]={type:t,fn:function(t,n){return function(a){var r=a.relatedTarget;return r&&(r===t||16&t.compareDocumentPosition(r))?void 0:(delete a.type,a.type=e,n.call(t,a))}}}}),avalon.each({AnimationEvent:"animationend",WebKitAnimationEvent:"webkitAnimationEnd"},function(t,n){e[t]&&!yn.animationend&&(yn.animationend={type:n})}),void 0===_t.onmousewheel&&(yn.mousewheel={type:"wheel",fn:function(e,t){return function(n){n.wheelDeltaY=n.wheelDelta=n.deltaY>0?-120:120,n.wheelDeltaX=0,Object.defineProperty(n,"type",{value:"mousewheel"}),t.call(e,n)}}});var bn,$n,xn,wn,kn,Cn=/[-.*+?^${}()|[\]\/\\]/g,Tn={loader:function(t){var n=It&&t;e.require=n?It:Yt,e.define=n?It.define:zt},interpolate:function(e){if(bn=e[0],$n=e[1],bn===$n){throw new SyntaxError("openTag!==closeTag")}f.openTag=bn,f.closeTag=$n;var t=d(bn),n=d($n);xn=new RegExp(t+"(.*?)"+n),wn=new RegExp(t+"(.*?)"+n,"g"),kn=new RegExp(t+".*?"+n+"|\\sms-")}};f.async=!0,f.debug=!0,f.plugins=Tn,f.plugins.interpolate(["{{","}}"]),f.paths={},f.shim={},f.maxRepeatSize=100,avalon.config=f;var En=avalon.vmodels={};avalon.define=function(e){var t=e.$id;t||n("warning: vm必须指定$id");var a=g(e);return a.$id=t,En[t]=a};var An=l("$id,$watch,$fire,$events,$model,$skipArray,$active,$pathname,$up,$track,$accessors"),Nn={get:function(){return T(this)},set:o,enumerable:!1,configurable:!0},Sn=["push","pop","shift","unshift","splice"],Mn=Array.prototype,On={notify:function(){v.call(this.$up,this.$pathname)},set:function(e,t){if(e>>>0===e&&this[e]!==t){if(e>this.length)throw Error(e+"set方法的第一个参数不能大于原数组长度");v.call(this.$up,this.$pathname+".*",[t,this[e]]),this.splice(e,1,t)}},contains:function(e){return-1!==this.indexOf(e)},ensure:function(e){return this.contains(e)||this.push(e),this},pushArray:function(e){return this.push.apply(this,e)},remove:function(e){return this.removeAt(this.indexOf(e))},removeAt:function(e){return e>>>0===e?this.splice(e,1):[]},size:function(){return this._.length},removeAll:function(e){if(Array.isArray(e))for(var t=this.length-1;t>=0;t--)-1!==e.indexOf(this[t])&&(jn.call(this.$track,t,1),jn.call(this,t,1));else if("function"==typeof e)for(t=this.length-1;t>=0;t--){var n=this[t];e(n,t)&&(jn.call(this.$track,t,1),jn.call(this,t,1))}else jn.call(this.$track,0,this.length),jn.call(this,0,this.length);rn||(this.$model=T(this)),this.notify(),this._.length=this.length},clear:function(){return this.removeAll()}},jn=Mn.splice;Sn.forEach(function(e){var t=Mn[e];On[e]=function(){for(var n=[],a=0,r=arguments.length;r>a;a++)n[a]=w(arguments[a],0,1,1);var i=t.apply(this,n);return N(this.$track,e,n),rn||(this.$model=T(this)),this.notify(),this._.length=this.length,i}}),"sort,reverse".replace(Gt,function(e){On[e]=function(){var t=this.concat(),n=this,a=Math.random(),r=[],i=!1;Mn[e].apply(n,arguments);for(var o=0,l=t.length;l>o;o++){var s=n[o],c=t[o];if(s===c)r.push(o);else{var u=t.indexOf(s);r.push(u),t[u]=a,i=!0}}return i&&(E(this.$track,r),rn||(this.$model=T(this)),this.notify()),this}});var Ln=function(){var e,t=[];return{begin:function(n){t.push(e),e=n},end:function(){e=t.pop()},collectDependency:function(t){e&&e.callback(t)}}}();avalon.injectBinding=function(e){e.handler=e.handler||vn[e.type].update||o,e.update=function(){var t=!1;e.getter||(t=!0,Ln.begin({callback:function(t){S(t,e)}}),e.getter=Y(e.expr,e.vmodels,e),e.observers.forEach(function(t){t.v.$watch(t.p,e)}),delete e.observers);try{var a,r,i=e.fireArgs;if(delete e.fireArgs,i?(a=i[0],r=i[1]):a="on"===e.type?e.getter+"":e.getter.apply(0,e.args),r="undefined"==typeof r?e.oldValue:r,e._filters&&(a=ir.$filter.apply(0,[a].concat(e._filters))),e.signature){var o=avalon.type(a);if("array"!==o&&"object"!==o)throw Error("warning:"+e.expr+"只能是对象或数组");e.xtype=o;var l=M(e.proxies||[],o),s=a.$track||("array"===o?A(a.length):Object.keys(a));e.track=s,l!==s.join(";")&&(e.handler(a,r),e.oldValue=1)}else(Array.isArray(a)?a.length===(r&&r.length):1)?"oldValue"in e&&a===r||(e.handler(a,r),e.oldValue=a):(e.handler(a,r),e.oldValue=a.concat())}catch(c){delete e.getter,n("warning:exception throwed in [avalon.injectBinding] ",c);var u=e.element;u&&3===u.nodeType&&(u.nodeValue=bn+(e.oneTime?"::":"")+e.expr+$n)}finally{t&&Ln.end()}},e.update()};var Hn=0,Dn=avalon.$$subscribers=[],Rn=new Date,Pn={},qn=new function(){avalon.mix(this,{option:_t.createElement("select"),thead:_t.createElement("table"),td:_t.createElement("tr"),area:_t.createElement("map"),tr:_t.createElement("tbody"),col:_t.createElement("colgroup"),legend:_t.createElement("fieldset"),_default:_t.createElement("div"),g:_t.createElementNS("http://www.w3.org/2000/svg","svg")}),this.optgroup=this.option,this.tbody=this.tfoot=this.colgroup=this.caption=this.thead,this.th=this.td};String("circle,defs,ellipse,image,line,path,polygon,polyline,rect,symbol,text,use").replace(Gt,function(e){qn[e]=qn.g});var Bn=/<([\w:]+)/,Fn=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,_n=l(["","text/javascript","text/ecmascript","application/ecmascript","application/javascript"]),Vn=_t.createElement("script"),In=/<|&#?\w+;/;avalon.parseHTML=function(e){var t=ln.cloneNode(!1);if("string"!=typeof e)return t;if(!In.test(e))return t.appendChild(_t.createTextNode(e)),t;e=e.replace(Fn,"<$1>").trim();var n,a=(Bn.exec(e)||["",""])[1].toLowerCase(),r=qn[a]||qn._default;r.innerHTML=e;var i=r.getElementsByTagName("script");if(i.length)for(var o,l=0;o=i[l++];)if(_n[o.type]){var s=Vn.cloneNode(!1);nn.forEach.call(o.attributes,function(e){s.setAttribute(e.name,e.value)}),s.text=o.text,o.parentNode.replaceChild(s,o)}for(;n=r.firstChild;)t.appendChild(n);return t},avalon.innerHTML=function(e,t){var n=this.parseHTML(t);this.clearHTML(e).appendChild(n)},avalon.clearHTML=function(e){for(e.textContent="";e.firstChild;)e.removeChild(e.firstChild);return e},"add,remove".replace(Gt,function(e){avalon.fn[e+"Class"]=function(t){var n=this[0];return t&&"string"==typeof t&&n&&1===n.nodeType&&t.replace(/\S+/g,function(t){n.classList[e](t)}),this}}),avalon.fn.mix({hasClass:function(e){var t=this[0]||{};return 1===t.nodeType&&t.classList.contains(e)},toggleClass:function(e,t){for(var n,a=0,r=String(e).split(/\s+/),i="boolean"==typeof t;n=r[a++];){var o=i?t:!this.hasClass(n);this[o?"addClass":"removeClass"](n)}return this},attr:function(e,t){return 2===arguments.length?(this[0].setAttribute(e,t),this):this[0].getAttribute(e) -},data:function(e,t){switch(e="data-"+R(e||""),arguments.length){case 2:return this.attr(e,t),this;case 1:var n=this.attr(e);return q(n);case 0:var a={};return nn.forEach.call(this[0].attributes,function(t){t&&(e=t.name,e.indexOf("data-")||(e=P(e.slice(5)),a[e]=q(t.value)))}),a}},removeData:function(e){return e="data-"+R(e),this[0].removeAttribute(e),this},css:function(e,t){if(avalon.isPlainObject(e))for(var n in e)avalon.css(this,n,e[n]);else var a=avalon.css(this,e,t);return void 0!==a?a:this},position:function(){var e,t,n=this[0],a={top:0,left:0};if(n)return"fixed"===this.css("position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),"HTML"!==e[0].tagName&&(a=e.offset()),a.top+=avalon.css(e[0],"borderTopWidth",!0),a.left+=avalon.css(e[0],"borderLeftWidth",!0),a.top-=e.scrollTop(),a.left-=e.scrollLeft()),{top:t.top-a.top-avalon.css(n,"marginTop",!0),left:t.left-a.left-avalon.css(n,"marginLeft",!0)}},offsetParent:function(){for(var e=this[0].offsetParent;e&&"static"===avalon.css(e,"position");)e=e.offsetParent;return avalon(e||on)},bind:function(e,t,n){return this[0]?avalon.bind(this[0],e,t,n):void 0},unbind:function(e,t,n){return this[0]&&avalon.unbind(this[0],e,t,n),this},val:function(e){var t=this[0];if(t&&1===t.nodeType){var n=0===arguments.length,a=n?":get":":set",r=Zn[_(t)+a];if(r)var i=r(t,e);else{if(n)return(t.value||"").replace(/\r/g,"");t.value=e}}return n?i:this}}),on.dataset&&(avalon.fn.data=function(e,t){e=e&&P(e);var n=this[0].dataset;switch(arguments.length){case 2:return n[e]=t,this;case 1:return t=n[e],q(t);case 0:var a=r();for(e in n)a[e]=q(n[e]);return a}});var Un=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/;avalon.parseJSON=JSON.parse,avalon.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){avalon.fn[e]=function(n){var a=this[0]||{},r=B(a),i="scrollTop"===e;return arguments.length?void(r?r.scrollTo(i?r[t]:n,i?n:r[t]):a[e]=n):r?r[t]:a[e]}});var Xn=avalon.cssHooks=r(),Yn=["","-webkit-","-moz-","-ms-"],zn={"float":"cssFloat"};avalon.cssNumber=l("animationIterationCount,animationIterationCount,columnCount,order,flex,flexGrow,flexShrink,fillOpacity,fontWeight,lineHeight,opacity,orphans,widows,zIndex,zoom"),avalon.cssName=function(e,t,n){if(zn[e])return zn[e];t=t||on.style;for(var a=0,r=Yn.length;r>a;a++)if(n=P(Yn[a]+e),n in t)return zn[e]=n;return null},Xn["@:set"]=function(e,t,n){e.style[t]=n},Xn["@:get"]=function(e,t){if(!e||!e.style)throw new Error("getComputedStyle要求传入一个节点 "+e);var n,a=getComputedStyle(e);return a&&(n="filter"===t?a.getPropertyValue(t):a[t],""===n&&(n=e.style[t])),n},Xn["opacity:get"]=function(e){var t=Xn["@:get"](e,"opacity");return""===t?"1":t},"top,left".replace(Gt,function(e){Xn[e+":get"]=function(t){var n=Xn["@:get"](t,e);return/px$/.test(n)?n:avalon(t).position()[e]+"px"}});var Wn={position:"absolute",visibility:"hidden",display:"block"},Gn=/^(none|table(?!-c[ea]).+)/;"Width,Height".replace(Gt,function(e){var t=e.toLowerCase(),n="client"+e,a="scroll"+e,r="offset"+e;Xn[t+":get"]=function(t,n,a){var i=-4;"number"==typeof a&&(i=a),n="Width"===e?["Left","Right"]:["Top","Bottom"];var o=t[r];return 2===i?o+avalon.css(t,"margin"+n[0],!0)+avalon.css(t,"margin"+n[1],!0):(0>i&&(o=o-avalon.css(t,"border"+n[0]+"Width",!0)-avalon.css(t,"border"+n[1]+"Width",!0)),-4===i&&(o=o-avalon.css(t,"padding"+n[0],!0)-avalon.css(t,"padding"+n[1],!0)),o)},Xn[t+"&get"]=function(e){var n=[];F(e,n);for(var a,r=Xn[t+":get"](e),i=0;a=n[i++];){e=a.node;for(var o in a)"string"==typeof a[o]&&(e.style[o]=a[o])}return r},avalon.fn[t]=function(i){var o=this[0];if(0===arguments.length){if(o.setTimeout)return o["inner"+e];if(9===o.nodeType){var l=o.documentElement;return Math.max(o.body[a],l[a],o.body[r],l[r],l[n])}return Xn[t+"&get"](o)}return this.css(t,i)},avalon.fn["inner"+e]=function(){return Xn[t+":get"](this[0],void 0,-2)},avalon.fn["outer"+e]=function(e){return Xn[t+":get"](this[0],void 0,e===!0?2:0)}}),avalon.fn.offset=function(){var e=this[0];try{var t=e.getBoundingClientRect();if(t.width||t.height||e.getClientRects().length){var n=e.ownerDocument,a=n.documentElement,r=n.defaultView;return{top:t.top+r.pageYOffset-a.clientTop,left:t.left+r.pageXOffset-a.clientLeft}}}catch(i){return{left:0,top:0}}};var Zn={"select:get":function(e,t){for(var n,a=e.options,r=e.selectedIndex,i="select-one"===e.type||0>r,o=i?null:[],l=i?r+1:a.length,s=0>r?l:i?r:0;l>s;s++)if(n=a[s],(n.selected||s===r)&&!n.disabled){if(t=n.value,i)return t;o.push(t)}return o},"select:set":function(e,t,n){t=[].concat(t);for(var a,r=0;a=e.options[r++];)(a.selected=t.indexOf(a.value)>-1)&&(n=!0);n||(e.selectedIndex=-1)}},Jn={},Kn=["break,case,catch,continue,debugger,default,delete,do,else,false","finally,for,function,if,in,instanceof,new,null,return,switch,this","throw,true,try,typeof,var,void,while,with","abstract,boolean,byte,char,class,const,double,enum,export,extends","final,float,goto,implements,import,int,interface,long,native","package,private,protected,public,short,static,super,synchronized","throws,transient,volatile","arguments,let,yield,undefined"].join(",");Kn.replace(/\w+/g,function(e){Jn[e]=!0});var Qn=/[a-z_$]/i,ea=/[\s\uFEFF\xA0]/,ta=/(\$proxy\$[a-z]+)\d+$/,na=new hn(218),aa=new hn(128),ra=/\)\s*$/,ia=/\)\s*\|/g,oa=/\|\s*([$\w]+)/g,la=/"\s*\["/g,sa=/"\s*\(/g,ca=JSON.stringify;avalon.scan=function(e,t){e=e||on;var n=t?[].concat(t):[];at(e,n)};var ua=l("area,base,basefont,br,col,command,embed,hr,img,input,link,meta,param,source,track,wbr,noscript,script,style,textarea".toUpperCase()),fa=function(e,t,n){var a=e.getAttribute(t);if(a)for(var r,i=0;r=n[i++];)if(r.hasOwnProperty(a)&&"function"==typeof r[a])return r[a]},da=un&&e.MutationObserver?function(e){for(var t,n=e.firstChild;n;){var a=n.nextSibling;3===n.nodeType?t?(t.nodeValue+=n.nodeValue,e.removeChild(n)):t=n:t=null,n=a}}:0,pa=/^\s*::/,va=/ms-(\w+)-?(.*)/,ha=l("animationend,blur,change,input,click,dblclick,focus,keydown,keypress,keyup,mousedown,mouseenter,mouseleave,mousemove,mouseout,mouseover,mouseup,scan,scroll,submit"),ma=l("value,title,alt,checked,selected,disabled,readonly,enabled,href,src"),ga=/^if|widget|repeat$/,ya=/^each|with|html|include$/,ba=/^(ms-\S+|data-\S+|on[a-z]+|id|style|class|tabindex)$/,$a=/\|\s*html(?:\b|$)/,xa=/\|\|/g,wa=/(['"])(\\\1|.)+?\1/g,ka=function(){this.queue=[]};ka.prototype={render:function(e){if(!this.locked){this.locked=e?on.offsetHeight+10:1;var t=this;avalon.nextTick(function(){t.flush()})}},flush:function(){for(var e,t=0;e=this.queue[t++];)e.update();this.locked=0,this.queue=[]}};var Ca=new ka,Ta=[],Ea=[],Aa={$construct:function(){return avalon.mix.apply(null,arguments)},$ready:o,$init:o,$dispose:o,$container:null,$childReady:o,$replace:!1,$extend:null,$$template:function(e){return e}};avalon.components={},avalon.component=function(t,n){n&&(avalon.components[t]=avalon.mix({},Aa,n));for(var a,r=0;a=Ta[r];r++)t===a.fullName&&(Ta.splice(r,1),r--,function(n,a,r,i){var o=1,l=n.library,s=avalon.libraries[l]||Aa,c=et(r),u=lt(n.vmodels,c.config||n.fullName),f=c.$id||c.identifier||cn(i);delete c.config,delete c.$id,delete c.identifier;var d={},p=avalon.components[a.$extend];p?(avalon.mix(!0,d,p),d=p.$construct.call(r,d,{},{})):avalon.mix(!0,d,a),d=avalon.components[t].$construct.call(r,d,u,c),d.$refs={},d.$id=f;var v=d.$slot,h=d.$replace,m=d.$container,g=d.$template;delete d.$slot,delete d.$replace,delete d.$container,delete d.$template,delete d.$construct;var y=avalon.define(d)||{};r.msResolved=1,y.$init(y,r),s.$init(y,r);for(var b,$,x=r.childNodes,w={},k=0;$=x[k++];){var C=1===$.nodeType&&$.getAttribute("slot")||v;C&&(w[C]?w[C].push($):w[C]=[$])}y.$$template&&(avalon.clearHTML(r),r.innerHTML=y.$$template(g));for(k in w)if(y.hasOwnProperty(k)){var T=w[k];if(T.length){for(var E=ln.cloneNode(!0),A=0;b=T[A++];)E.appendChild(b);y[k]=E}w[k]=null}w=null;var N=r.firstChild;h&&(N=r.firstChild,r.parentNode.replaceChild(N,r),N.msResolved=1,r=n.element=N),m&&m.appendChild(r),avalon.fireDom(r,"datasetchanged",{library:l,vm:y,childReady:1});var S=0,M=avalon.bind(r,"datasetchanged",function(t){if(t.childReady&&t.library===l&&(o+=t.childReady,y!==t.vm&&(y.$refs[t.vm.$id]=t.vm,-1===t.childReady&&(S++,y.$childReady(y,r,t)),t.stopPropagation())),0===o){var a=setTimeout(function(){clearTimeout(a),y.$ready(y,r),s.$ready(y,r)},S?Math.max(17*S,100):17);avalon.unbind(r,"datasetchanged",M),n.rollback=function(){try{y.$dispose(y,r),s.$dispose(y,r)}catch(e){}delete avalon.vmodels[y.$id]},j(n,Ea),e.chrome&&r.addEventListener("DOMNodeRemovedFromDocument",function(){setTimeout(L)})}});if(at(r,[y].concat(n.vmodels)),avalon.vmodels[y.$id]=y,r.childNodes.length)var O=setTimeout(function(){clearTimeout(O),avalon.fireDom(r,"datasetchanged",{library:l,vm:y,childReady:-1})},17);else avalon.fireDom(r,"datasetchanged",{library:l,vm:y,childReady:-1})}(a,avalon.components[t],a.element,a.widget))},avalon.fireDom=function(e,t,n){if(_t.createEvent){var a=_t.createEvent("Events");a.initEvent(t,!0,!0,n),avalon.mix(a,n),e.dispatchEvent(a)}else on.contains(e)&&(a=_t.createEventObject(),avalon.mix(a,n),e.fireEvent("on"+t,a))},avalon.libraries=[],avalon.library=function(e,t){_t.namespaces&&_t.namespaces.add(e,"http://www.w3.org/1999/xhtml"),avalon.libraries[e]=avalon.mix({$init:o,$ready:o,$dispose:o},t||{})},avalon.library("ms");var Na=["autofocus,autoplay,async,allowTransparency,checked,controls","declare,disabled,defer,defaultChecked,defaultSelected","contentEditable,isMap,loop,multiple,noHref,noResize,noShade","open,readOnly,selected"].join(","),Sa={};Na.replace(Gt,function(e){Sa[e.toLowerCase()]=e});var Ma={"accept-charset":"acceptCharset","char":"ch",charoff:"chOff","class":"className","for":"htmlFor","http-equiv":"httpEquiv"},Oa=["accessKey,bgColor,cellPadding,cellSpacing,codeBase,codeType,colSpan","dateTime,defaultValue,frameBorder,longDesc,maxLength,marginWidth,marginHeight","rowSpan,tabIndex,useMap,vSpace,valueType,vAlign"].join(",");Oa.replace(Gt,function(e){Ma[e.toLowerCase()]=e});var ja=avalon.directive("attr",{init:function(e){if(e.expr=z(e.expr.trim()),"include"===e.type){var t=e.element;pt(t,e),e.includeRendered=fa(t,"data-include-rendered",e.vmodels),e.includeLoaded=fa(t,"data-include-loaded",e.vmodels);var n=e.includeReplace=!!avalon(t).data("includeReplace");avalon(t).data("includeCache")&&(e.templateCache={}),e.start=_t.createComment("ms-include"),e.end=_t.createComment("ms-include-end"),n?(e.element=e.end,e._element=t,t.parentNode.insertBefore(e.end,t),t.parentNode.insertBefore(e.start,e.end)):(t.insertBefore(e.start,t.firstChild),t.appendChild(e.end))}},update:function(t){var n=this.element,a=this.param;if("href"===a||"src"===a){if("string"!=typeof t||on.hasAttribute||(t=t.replace(/&/g,"&")),n[a]=t,e.chrome&&"EMBED"===n.tagName){var r=n.parentNode,i=document.createComment("ms-src");r.replaceChild(i,n),r.replaceChild(n,i)}}else{var o=t===!1||null===t||void 0===t;!rn&&Ma[a]&&(a=Ma[a]);var l=Sa[a];if("boolean"==typeof n[l]&&(n[l]=!!t,t||(o=!0)),o)return n.removeAttribute(a);var s=Jt.test(n)?!1:_t.namespaces&&isVML(n)?!0:a in n.cloneNode(!1);s?n[a]=t+"":n.setAttribute(a,t)}}});"title,alt,src,value,css,include,href".replace(Gt,function(e){vn[e]=ja}),avalon.directive("class",{init:function(e){var t=e.param,a=e.type;if(!t||isFinite(t)?(e.param="",vn.effect.init(e)):(n("ms-"+a+'-xxx="yyy"这种用法已经过时,请使用ms-'+a+'="xxx:yyy"'),e.expr="["+ca(t)+","+e.expr+"]",e.oldStyle=t),"hover"===a||"active"===a){if(!e.hasBindEvent){var r=e.element,i=avalon(r),o="mouseenter",l="mouseleave";if("active"===a){r.tabIndex=r.tabIndex||-1,o="mousedown",l="mouseup";var s=i.bind("mouseleave",function(){e.toggleClass&&i.removeClass(e.newClass)})}}var c=i.bind(o,function(){e.toggleClass&&i.addClass(e.newClass)}),u=i.bind(l,function(){e.toggleClass&&i.removeClass(e.newClass)});e.rollback=function(){i.unbind("mouseleave",s),i.unbind(o,c),i.unbind(l,u)},e.hasBindEvent=!0}},update:function(e){var t=this,n=avalon(this.element);t.newClass=e[0],t.toggleClass=!!e[1],t.oldClass&&t.newClass!==t.oldClass&&n.removeClass(t.oldClass),t.oldClass=t.newClass,"class"===t.type&&(t.oldStyle?n.toggleClass(t.oldStyle,!!e[1]):n.toggleClass(t.newClass,t.toggleClass))}}),"hover,active".replace(Gt,function(e){vn[e]=vn["class"]}),avalon.directive("css",{init:vn.attr.init,update:function(e){avalon(this.element).css(this.param,e)}}),avalon.directive("data",{priority:100,update:function(e){var t=this.element,n="data-"+this.param;e&&"object"==typeof e?t[n]=e:t.setAttribute(n,String(e))}});{var La=/^(?:checkbox|radio)$/,Ha=/^(?:radio|checked)$/;avalon.directive("duplex",{priority:2e3,init:function(e,t){function a(t){e.changed.call(this,t,e)}function r(){d=!0}function i(){d=!1}var s=e.element,c=e.vmodels;e.changed=fa(s,"data-duplex-changed",c)||o;var u=[],f=l("string,number,boolean,checked");"radio"===s.type&&""===e.param&&(e.param="checked"),e.param.replace(Zt,function(a){La.test(s.type)&&Ha.test(a)&&("radio"===a&&n("ms-duplex-radio已经更名为ms-duplex-checked"),a="checked",e.isChecked=!0,e.xtype="radio"),"bool"===a?(a="boolean",n("ms-duplex-bool已经更名为ms-duplex-boolean")):"text"===a&&(a="string",n("ms-duplex-text已经更名为ms-duplex-string")),f[a]&&(t=!0),avalon.Array.ensure(u,a)}),t||u.push("string"),e.param=u.join("-"),e.changed=fa(s,"binding-duplex-changed",c)||o,e.xtype||(e.xtype="SELECT"===s.tagName?"select":"checkbox"===s.type?"checkbox":"radio"===s.type?"radio":/^change/.test(s.getAttribute("data-duplex-event"))?"change":"input"),e.bound=function(t,n){s.addEventListener(t,n,!1);var a=e.rollback;e.rollback=function(){s.avalonSetter=null,avalon.unbind(s,t,n),a&&a()}};var d=!1,p=function(){var t=s.value;if(!d&&t!==e.oldValue){var n=e.pipe(t,e,"get");e.setter(n),a.call(s,n)}};switch(e.xtype){case"radio":e.bound("click",function(){var t=e.pipe(s.value,e,"get");e.setter(t),a.call(s,t)});break;case"checkbox":e.bound("change",function(){var t=s.checked?"ensure":"remove",r=e.getter.apply(0,e.vmodels);Array.isArray(r)||(n("ms-duplex应用于checkbox上要对应一个数组"),r=[r]);var i=e.pipe(s.value,e,"get");avalon.Array[t](r,i),a.call(s,r)});break;case"change":e.bound("change",p);break;case"input":un?e.bound("input",p):(e.bound("input",p),e.bound("compositionstart",r),e.bound("compositionend",i),e.bound("DOMAutoComplete",p));break;case"select":e.bound("change",function(){var t=avalon(s).val();t=Array.isArray(t)?t.map(function(t){return e.pipe(t,e,"get")}):e.pipe(t,e,"get"),t+""!==e.oldValue&&(e.setter(t),a.call(s,t))})}"input"===e.xtype&&/^(text|password|hidden)/.test(s.type)&&Pa(function(){if(on.contains(s))e.oldValue!==s.value&&p();else if(!s.msRetain)return!1}),s.avalonSetter=p;for(var v in avalon.vmodels){var h=avalon.vmodels[v];h.$fire("avalon-ms-duplex-init",e)}var m=e.pipe||(e.pipe=ut);m(null,e,"init")},update:function(e){var t,n=this.element,a=this;switch(this.xtype){case"input":case"change":t=this.pipe(e,this,"set"),t!==this.oldValue&&(n.value=this.oldValue=t);break;case"radio":t=a.isChecked?!!e:e+""===n.value,n.checked=t;break;case"checkbox":var r=[].concat(e);t=this.pipe(n.value,this,"get"),n.checked=r.indexOf(t)>-1;break;case"select":a._value=e,n.msHasEvent="selectDuplex",avalon.bind(n,"datasetchanged",function(e){if("selectDuplex"===e.bubble){var t=a._value,r=Array.isArray(t)?t.map(String):t+"";avalon(n).val(r),n.oldValue=r+"",a.changed.call(n,r)}})}"select"!==a.xtype&&a.changed.call(n,t)}})}avalon.duplexHooks={checked:{get:function(e,t){return!t.element.oldValue}},string:{get:function(e){return e},set:ct},"boolean":{get:function(e){return"true"===e},set:ct},number:{get:function(e,t){var n=parseFloat(e);if(-e===-n)return n;var a=/strong|medium|weak/.exec(t.element.getAttribute("data-duplex-number"))||["medium"];switch(a[0]){case"strong":return 0;case"medium":return""===e?"":0;case"weak":return e}},set:ct}};var Da,Ra=[];avalon.tick=function(e){1===Ra.push(e)&&(Da=setInterval(ft,60))};var Pa=o;!new function(){function e(e){t[this.tagName].call(this,e),"function"==typeof this.avalonSetter&&this.oldValue!==e&&this.avalonSetter()}try{var t={},n=HTMLInputElement.prototype,a=HTMLTextAreaElement.prototype,r=HTMLInputElement.prototype;Object.getOwnPropertyNames(r),t.INPUT=Object.getOwnPropertyDescriptor(n,"value").set,Object.defineProperty(n,"value",{set:e}),t.TEXTAREA=Object.getOwnPropertyDescriptor(a,"value").set,Object.defineProperty(a,"value",{set:e})}catch(i){Pa=avalon.tick}},avalon.directive("effect",{priority:5,init:function(e){var t,n,a=e.expr,r=a.replace(wn,function(e){return e.replace(/./g,"0")}).indexOf(":");-1===r?(t=a,n=!0):(t=a.slice(0,r),n=a.slice(r+1)),t=xn.test(a)?z(t):ca(t),e.expr="["+t+","+n+"]"},update:function(t){var n=t[0],a=this.element;if(a.getAttribute("data-effect-name")!==n){a.removeAttribute("data-effect-driver");var r=a.style,i=e.getComputedStyle?e.getComputedStyle(a):null,o=!1;if(i&&(Fa||_a)){var l=r[Va]||i[Va];l&&"0s"!==l&&(a.setAttribute("data-effect-driver","t"),o=!0),o||(l=r[Ia]||i[Ia],l&&"0s"!==l&&(a.setAttribute("data-effect-driver","a"),o=!0))}o||avalon.effects[n]&&(a.setAttribute("data-effect-driver","j"),o=!0),o&&a.setAttribute("data-effect-name",n)}}}),avalon.effects={},avalon.effect=function(e,t){avalon.effects[e]=t};var qa,Ba,Fa=!1,_a=!1,Va=avalon.cssName("transition-duration"),Ia=avalon.cssName("animation-duration");!new function(){var t,n={TransitionEvent:"transitionend",WebKitTransitionEvent:"webkitTransitionEnd",OTransitionEvent:"oTransitionEnd",otransitionEvent:"otransitionEnd"};for(var a in n){if(e[a]){t=n[a];break}try{{document.createEvent(a)}t=n[a];break}catch(r){}}"string"==typeof t&&(Fa=!0,qa=t),n={AnimationEvent:"animationend",WebKitAnimationEvent:"webkitAnimationEnd"};var i;for(a in n)if(e[a]){i=n[a];break}"string"==typeof i&&(Fa=!0,Ba=i)};var Ua=[],Xa=new ka;ht.prototype={contrustor:ht,enterClass:function(){return mt(this,"enter")},leaveClass:function(){return mt(this,"leave")},actionFun:function(e,t,n){if(!document.hidden){var a=this,r=a.el,i="leave"===e;e=i?"leave":"enter";var o=i?"enter":"leave";gt(a,"abort"+vt(o)),gt(a,"before"+vt(e)),i||t(r);var l=function(o){r.removeEventListener(a.cssEvent,a.cssCallback),i?(t(r),avalon(r).removeClass(a.cssClass)):"a"===a.driver&&avalon(r).removeClass(a.cssClass),o!==!0&&(gt(a,"after"+vt(e)),n&&n(r)),a.dispose()};a.useCss?(a.cssCallback&&a.cssCallback(!0),a.cssClass=mt(a,e),a.cssCallback=l,a.update=function(){r.addEventListener(a.cssEvent,a.cssCallback),i||"t"!==a.driver||avalon(r).removeClass(a.cssClass)},avalon(r).addClass(a.cssClass),Xa.render(!0),Xa.queue.push(a)):gt(a,e,l)}},enter:function(){this.actionFun.apply(this,["enter"].concat(avalon.slice(arguments)))},leave:function(){this.actionFun.apply(this,["leave"].concat(avalon.slice(arguments)))},dispose:function(){this.update=this.cssCallback=null,Ua.unshift(this)>100&&Ua.pop()}};var Ya=function(e,t){var n=an.call(arguments,0);"function"!=typeof n[2]&&n.splice(2,0,o),"function"!=typeof n[3]&&n.splice(3,0,o);var a=n[2],r=n[3],i=n[4],l=dt(e,i);if(!l)return a(),r(),!1;var s=t?"enter":"leave";l[s](a,r)};avalon.mix(avalon.effect,{apply:Ya,append:function(e,t,n,a){return Ya(e,1,function(){t.appendChild(e)},n,a)},before:function(e,t,n,a){return Ya(e,1,function(){t.parentNode.insertBefore(e,t)},n,a)},remove:function(e,t,n,a){return Ya(e,0,function(){e.parentNode===t&&t.removeChild(e)},n,a)}}),avalon.directive("html",{update:function(e){var t=this,n=this.element,a=1!==n.nodeType,r=a?n.parentNode:n;if(r){if(e=null==e?"":e,3===n.nodeType){var i=cn("html");r.insertBefore(_t.createComment(i),n),t.element=_t.createComment(i+":end"),r.replaceChild(t.element,n),n=t.element}if("object"!=typeof e)var o=avalon.parseHTML(String(e));else if(11===e.nodeType)o=e;else if(1===e.nodeType||e.item){var l=1===e.nodeType?e.childNodes:e.item;for(o=ln.cloneNode(!0);l[0];)o.appendChild(l[0])}if(l=avalon.slice(o.childNodes),a){for(var s=n.nodeValue.slice(0,-4);;){var c=n.previousSibling;if(!c||8===c.nodeType&&c.nodeValue===s)break;r.removeChild(c)}r.insertBefore(o,n)}else avalon.clearHTML(n).appendChild(o);nt(l,t.vmodels)}}}),avalon.directive("if",{priority:10,update:function(e){function t(){r.getAttribute(a.name)&&(r.removeAttribute(a.name),Q(r,a.vmodels)),a.rollback=null}var n,a=this,r=this.element,i=a.stamp=+new Date,o=function(){i===a.stamp&&(a.recoverNode=null)};a.recoverNode&&a.recoverNode();try{if(!r.parentNode)return;n=r.parentNode}catch(l){return}if(e){if(8===r.nodeType){var s=a.keep,c=avalon.effect.apply(s,1,function(){i===a.stamp&&(r.parentNode.replaceChild(s,r),r=a.element=s,s.getAttribute("_required")&&(r.required=!0,r.removeAttribute("_required")),r.querySelectorAll&&avalon.each(r.querySelectorAll("[_required=true]"),function(e){e.required=!0,e.removeAttribute("_required")}),t())},o);c=c===!1}c||t()}else if(1===r.nodeType){r.required===!0&&(r.required=!1,r.setAttribute("_required","true"));try{avalon.each(r.querySelectorAll(":required"),function(e){r.required=!1,e.setAttribute("_required","true")})}catch(l){}var u=a.element=_t.createComment("ms-if"),f=r.nextSibling;a.recoverNode=function(){a.recoverNode=null,u.parentNode!==n&&(n.insertBefore(u,f),a.keep=r)},avalon.effect.apply(r,0,function(){a.recoverNode=null,i===a.stamp&&(r.parentNode.replaceChild(u,r),a.keep=r,Ut.appendChild(r),a.rollback=function(){r.parentNode===Ut&&Ut.removeChild(r)})},o)}}});var za=function(){return new e.XMLHttpRequest},Wa=avalon.templateCache={};avalon.directive("include",{init:vn.attr.init,update:function(e){var t=this,n=this.element,a=t.vmodels,r=t.includeRendered,i=t.effectName&&t.effectClass,o=t.templateCache,l=t.includeReplace,s=t.includeLoaded,c=l?n.parentNode:n,u=t._element;t.recoverNodes=t.recoverNodes||avalon.noop;var f=(l&&u.cloneNode(),function(f){var d=t._stamp=+new Date;if(s){var p=s.apply(c,[f].concat(a));"string"==typeof p&&(f=p)}r&&G(c,function(){r.call(c)},0/0);var v=t.includeLastID||"_default";t.includeLastID=e;var h=o&&o[v]||_t.createElement(n.tagName||t._element.tagName);i&&(h.className=i,c.insertBefore(h,t.start)),(o||{})[v]=h;var m=t.recoverNodes();for(m&&c.insertBefore(m,t.end);;){var g=t.start.nextSibling;if(!g||g===h||g===t.end)break;h.appendChild(g)}avalon.effect.remove(h,c,function(){o&&d===t._stamp&&Ut.appendChild(h)},t);var y=c,b=avalon.noop,$=avalon.noop,x=yt(t,e,f),w=avalon.slice(x.childNodes);l&&i?(y=u,y.innerHTML="",y.setAttribute("ms-skip","true"),c.insertBefore(y,t.end.nextSibling),b=function(){y.insertBefore(x,null)},$=function(){t.recoverNodes=avalon.noop,d===t._stamp&&(x=bt(w),c.insertBefore(x,t.end),nt(w,a)),y.parentNode===c&&c.removeChild(y)},t.recoverNodes=function(){return t.recoverNodes=avalon.noop,bt(w)}):b=function(){c.insertBefore(x,t.end),nt(w,a)},avalon.effect.apply(y,"enter",b,$)});if("src"===t.param)if("string"==typeof Wa[e])avalon.nextTick(function(){f(Wa[e])});else if(Array.isArray(Wa[e]))Wa[e].push(f);else{var d=za();d.onload=function(){for(var t,n=d.responseText,a=0;t=Wa[e][a++];)t(n);Wa[e]=n},Wa[e]=[f],d.open("GET",e,!0),"withCredentials"in d&&(d.withCredentials=!0),d.setRequestHeader("X-Requested-With","XMLHttpRequest"),d.send(null)}else{var p=e&&1===e.nodeType?e:_t.getElementById(e);p&&avalon.nextTick(function(){f(p.value||p.innerText||p.innerHTML)})}}});var Ga=/\(([^)]*)\)/,Za=avalon.directive("on",{priority:3e3,init:function(e){var t=e.expr;e.type="on";var n=e.param.replace(/-\d+$/,"");if("function"==typeof Za[n+"Hook"]&&Za[n+"Hook"](e),t.indexOf("(")>0&&t.indexOf(")")>-1){var a=(t.match(Ga)||["",""])[1].trim();(""===a||"$event"===a)&&(t=t.replace(Ga,""))}e.expr=t},update:function(e){var t=this,n=this.element;e=function(e){var n=t.getter||o;return n.apply(this,t.args.concat(e))};var a=t.param.replace(/-\d+$/,"");if("scan"===a)e.call(n,{type:a});else if("function"==typeof t.specialBind)t.specialBind(n,e);else var r=avalon.bind(n,a,e);t.rollback=function(){"function"==typeof t.specialUnbind?t.specialUnbind():avalon.unbind(n,a,r)}}});avalon.directive("repeat",{priority:90,init:function(e){var t=e.type;e.cache={},e.enterCount=0;var n=e.element;if(1===n.nodeType){n.removeAttribute(e.name),pt(n,e),e.param=e.param||"el",e.sortedCallback=fa(n,"data-with-sorted",e.vmodels);var a=fa(n,"data-"+t+"-rendered",e.vmodels),r=cn(t),i=_t.createComment(r+":start"),o=e.element=_t.createComment(r+":end");if(e.signature=r,e.start=i,e.template=ln.cloneNode(!1),"repeat"===t){var l=n.parentNode;l.replaceChild(o,n),l.insertBefore(i,o),e.template.appendChild(n)}else{for(;n.firstChild;)e.template.appendChild(n.firstChild);n.appendChild(i),n.appendChild(o),l=n}if(e.element=o,a)var s=avalon.bind(l,"datasetchanged",function(){a.apply(l,l.args),avalon.unbind(l,"datasetchanged",s),l.msRendered=a})}},update:function(e,t){var n=this,a=this.xtype;this.enterCount+=1;var r=!t;if(r){n.$outer={};var i="$key",o="$val";"array"===a&&(i="$first",o="$last");for(var l,s=0;l=n.vmodels[s++];)if(l.hasOwnProperty(i)&&l.hasOwnProperty(o)){n.$outer=l;break}}var c=this.track;if(n.sortedCallback){var u=n.sortedCallback.call($,c);u&&Array.isArray(u)&&(c=u)}var d="move";n.$repeat=e;var p=[],v=r&&ln.cloneNode(!1),h=[],m=this.param,g=avalon.mix({},this.cache),y=this.element,b=c.length,$=y.parentNode;for(s=0;b>s;s++){var x=c[s],w=g[x];if(w)p.push({}),g[x]=!0;else{w=Ct(this),"array"===a?(d="add",w.$id=x,w[m]=e[s]):(d="append",w.$key=x,w.$val=e[x]),this.cache[x]=w;var k=w.$anchor||(w.$anchor=y.cloneNode(!1));k.nodeValue=this.signature,kt(n,v,w,p,r&&!n.effectDriver),At(w,n,a)}1===this.enterCount&&(w.$active=!1,w.$oldIndex=w.$index,w.$active=!0,w.$index=s),"array"===a?(w.$first=0===s,w.$last=s===b-1):w.$val=T(e[x]),h.push(w)}if(this.proxies=h,r&&!n.effectDriver)$.insertBefore(v,y),p.forEach(function(e){nt(e.nodes||[],e.vmodels),e.nodes=e.vmodels=null});else{var C=n.staggerIndex=0;for(x in g)g[x]!==!0&&(d="del",wt(g[x].$anchor,n),Mt(this.cache,x,m),g[x]=null);for(s=0;b>s;s++){w=h[s],x="array"===a?w.$id:w.$key;var E=h[s-1],A=E?E.$anchor:n.start;g[x]?w.$index!==w.$oldIndex&&!function(e,t){C=xt(n.effectEnterStagger,function(){var a=wt(e.$anchor),r=avalon.slice(a.childNodes);$.insertBefore(a,t.nextSibling),$t(r,1,n)},C)}(w,A):!function(e,t){var a=e.nodes,r=e.vmodels;a&&(C=xt(n.effectEnterStagger,function(){$.insertBefore(e.content,t.nextSibling),nt(a,r),$t(a,1,n)},C)),e.nodes=e.vmodels=null}(p[s],A)}}if(!e.$track)for(x in this.cache)Mt(this.cache,x,m);!function(e){$.args=e,$.msRendered&&$.msRendered.apply($,e)}(f.newWatch?arguments:[d]);var N=setTimeout(function(){clearTimeout(N),avalon.fireDom($,"datasetchanged",{bubble:$.msHasEvent})});this.enterCount-=1}}),"with,each".replace(Gt,function(e){vn[e]=avalon.mix({},vn.repeat,{priority:1400})});var Ja=[],Ka=[];avalon.directive("text",{update:function(e){var t=this.element;if(e=null==e?"":e,3===t.nodeType)try{t.data=e}catch(n){}else t.textContent=e}}),avalon.parseDisplay=Ot,avalon.directive("visible",{init:function(){},update:function(e){var t=this.element,n=this,a=n.stamp=+new Date;e?(t.style.display="none",avalon.effect.apply(t,1,function(){if(a===n.stamp){var e=t.getAttribute("data-effect-driver")||"a";/^[atn]/.test(e)&&(this.effectName||(t.style.display=""),"none"===avalon(t).css("display")&&(t.style.display=Ot(t.nodeName)))}})):avalon.effect.apply(t,0,function(){a===n.stamp&&(t.style.display="none")})}});var Qa=/]*>([\S\s]*?)<\/script\s*>/gim,er=/\s+(on[^=\s]+)(?:=("[^"]*"|'[^']*'|[^\s>]+))?/g,tr=/<\w+\b(?:(["'])[^"]*?(\1)|[^>])*>/gi,nr={a:/\b(href)\=("javascript[^"]*"|'javascript[^']*')/gi,img:/\b(src)\=("javascript[^"]*"|'javascript[^']*')/gi,form:/\b(action)\=("javascript[^"]*"|'javascript[^']*')/gi},ar=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,rr=/([^\#-~| |!])/g,ir=avalon.filters={uppercase:function(e){return e.toUpperCase()},lowercase:function(e){return e.toLowerCase()},truncate:function(e,t,n){return t=t||30,n="string"==typeof n?n:"...",e.length>t?e.slice(0,t-n.length)+n:String(e)},$filter:function(e){for(var t=1,n=arguments.length;n>t;t++){var a=arguments[t],r=avalon.filters[a[0]];if("function"==typeof r){var i=[e].concat(a.slice(1));e=r.apply(null,i)}}return e},camelize:P,sanitize:function(e){return e.replace(Qa,"").replace(tr,function(e){var t=e.toLowerCase().match(/<(\w+)\s/);if(t){var n=nr[t[1]];n&&(e=e.replace(n,function(e,t,n){var a=n.charAt(0);return t+"="+a+"javascript:void(0)"+a}))}return e.replace(er," ").replace(/\s+/g," ")})},escape:function(e){return String(e).replace(/&/g,"&").replace(ar,function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1);return"&#"+(1024*(t-55296)+(n-56320)+65536)+";"}).replace(rr,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")},currency:function(e,t,n){return(t||"¥")+jt(e,isFinite(n)?n:2)},number:jt};!new function(){function e(e){return parseInt(e,10)||0}function t(e,t,n){var a="";for(0>e&&(a="-",e=-e),e=""+e;e.length0||o>-a)&&(o+=a),0===o&&-12===a&&(o=12),t(o,n,r)}}function a(e,t){return function(n,a){var r=n["get"+e](),i=(t?"SHORT"+e:e).toUpperCase();return a[i][r]}}function r(e){var n=-1*e.getTimezoneOffset(),a=n>=0?"+":"";return a+=t(Math[n>0?"floor":"ceil"](n/60),2)+t(Math.abs(n%60),2)}function i(e,t){return e.getHours()<12?t.AMPMS[0]:t.AMPMS[1]}var o={yyyy:n("FullYear",4),yy:n("FullYear",2,0,!0),y:n("FullYear",1),MMMM:a("Month"),MMM:a("Month",!0),MM:n("Month",2,1),M:n("Month",1,1),dd:n("Date",2),d:n("Date",1),HH:n("Hours",2),H:n("Hours",1),hh:n("Hours",2,-12),h:n("Hours",1,-12),mm:n("Minutes",2),m:n("Minutes",1),ss:n("Seconds",2),s:n("Seconds",1),sss:n("Milliseconds",3),EEEE:a("Day"),EEE:a("Day",!0),a:i,Z:r},l=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,s=/^\/Date\((\d+)\)\/$/;ir.date=function(t,n){var a,r,i=ir.date.locate,c="",u=[];if(n=n||"mediumDate",n=i[n]||n,"string"==typeof t)if(/^\d+$/.test(t))t=e(t);else if(s.test(t))t=+RegExp.$1;else{var f=t.trim(),d=[0,0,0,0,0,0,0],p=new Date(0);f=f.replace(/^(\d+)\D(\d+)\D(\d+)/,function(t,n,a,r){var i=4===r.length?[r,n,a]:[n,a,r];return d[0]=e(i[0]),d[1]=e(i[1])-1,d[2]=e(i[2]),""});var v=p.setFullYear,h=p.setHours;f=f.replace(/[T\s](\d+):(\d+):?(\d+)?\.?(\d)?/,function(t,n,a,r,i){return d[3]=e(n),d[4]=e(a),d[5]=e(r),i&&(d[6]=Math.round(1e3*parseFloat("0."+i))),""});var m=0,g=0;f=f.replace(/Z|([+-])(\d\d):?(\d\d)/,function(t,n,a,r){return v=p.setUTCFullYear,h=p.setUTCHours,n&&(m=e(n+a),g=e(n+r)),""}),d[3]-=m,d[4]-=g,v.apply(p,d.slice(0,3)),h.apply(p,d.slice(3)),t=p}if("number"==typeof t&&(t=new Date(t)),"date"===avalon.type(t)){for(;n;)r=l.exec(n),r?(u=u.concat(r.slice(1)),n=u.pop()):(u.push(n),n=null);return u.forEach(function(e){a=o[e],c+=a?a(t,i):e.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),c}};var c={AMPMS:{0:"上午",1:"下午"},DAY:{0:"星期日",1:"星期一",2:"星期二",3:"星期三",4:"星期四",5:"星期五",6:"星期六"},MONTH:{0:"1月",1:"2月",2:"3月",3:"4月",4:"5月",5:"6月",6:"7月",7:"8月",8:"9月",9:"10月",10:"11月",11:"12月"},SHORTDAY:{0:"周日",1:"周一",2:"周二",3:"周三",4:"周四",5:"周五",6:"周六"},fullDate:"y年M月d日EEEE",longDate:"y年M月d日",medium:"yyyy-M-d H:mm:ss",mediumDate:"yyyy-M-d",mediumTime:"H:mm:ss","short":"yy-M-d ah:mm",shortDate:"yy-M-d",shortTime:"ah:mm"};c.SHORTMONTH=c.MONTH,ir.date.locate=c};var or=avalon.modules={"domReady!":{exports:avalon,state:3},avalon:{exports:avalon,state:4}};or.exports=or.avalon,new function(){function t(e,t){var a="js";e=e.replace(/^(\w+)\!/,function(e,t){return a=t,""}),"ready"===a&&(n("debug: ready!已经被废弃,请使用domReady!"),a="domReady");var r="";e=e.replace(D,function(e){return r=e,""});var i="."+a,o=/js|css/.test(i)?i:"";e=e.replace(/\.[a-z0-9]+$/g,function(e){return e===i?(o=e,""):e});var l=avalon.mix({query:r,ext:o,res:a,name:e,toUrl:m},t);return l.toUrl(e),l}function i(e){var t=e.name,n=e.res,a=or[t],r=t&&e.urlNoQuery;if(a&&a.state>=1)return t;if(a=or[r],a&&a.state>=3)return It(a.deps||[],a.factory,r),r;if(t&&!a){a=or[r]={id:r,state:1};var i=function(r){H[n]=r,r.load(t,e,function(e){arguments.length&&void 0!==e&&(a.exports=e),a.state=4,c()})};H[n]?i(H[n]):It([n],i)}return t?r:n+"!"}function l(e,t){for(var n,a=0;n=e[a++];)if(4!==or[n].state&&(n===t||l(or[n].deps,t)))return!0}function s(e,t){var a=d(e.src);return e.onload=e.onerror=null,t?(setTimeout(function(){Vt.removeChild(e),e=null}),void n("debug: 加载 "+a+" 失败"+t+" "+!or[a].state)):!0 -}function c(){e:for(var e,t=T.length;e=T[--t];){var n=or[e],a=n.deps;if(a){for(var r,i=0;r=a[i];i++)if(4!==Object(or[r]).state)continue e;4!==n.state&&(T.splice(t,1),h(n.id,n.deps,n.factory),c())}}}function u(e,t,a){var r=_t.createElement("script");r.className=Xt,r.onload=function(){var r=E.pop();r&&r.require(t),a&&a(),n("debug: 已成功加载 "+e),t&&T.push(t),c()},r.onerror=function(){s(r,!0)},Vt.insertBefore(r,Vt.firstChild),r.src=e,n("debug: 正准备加载 "+e)}function d(e){return(e||"").replace(D,"")}function p(e){return/^(?:[a-z]+:)?\/\//i.test(String(e))}function v(){var e;try{a.b.c()}catch(t){e=t.stack}if(e)return e=e.split(/[@ ]/g).pop(),e="("===e[0]?e.slice(1,-1):e.replace(/\s/,""),d(e.replace(/(:\d+)?:\d+$/i,""));for(var n,r=Vt.getElementsByTagName("script"),i=r.length;n=r[--i];)if(n.className===Xt&&"interactive"===n.readyState){var o=n.src;return n.className=d(o)}}function h(t,a,i){var o=Object(or[t]);o.state=4;for(var l,s=0,c=[];l=a[s++];)if("exports"===l){var u=o.exports||(o.exports=r());c.push(u)}else c.push(or[l].exports);try{var f=i.apply(e,c)}catch(d){n("执行["+t+"]模块的factory抛错: ",d)}return void 0!==f&&(o.exports=f),R.test(t)&&delete or[t],delete o.factory,f}function m(e){0===e.indexOf(this.res+"!")&&(e=e.slice(this.res.length+1));var t=e,n=0,a=this.baseUrl,r=this.parentUrl||a;x(e,f.paths,function(e,a){t=t.replace(a,e),n=1}),n||x(e,f.packages,function(e,n,a){t=t.replace(a.name,a.location)}),this.mapUrl&&x(this.mapUrl,f.map,function(e){x(t,e,function(e,n){t=t.replace(n,e),r=a})});var i=this.ext;i&&n&&t.slice(-i.length)===i&&(t=t.slice(0,-i.length)),p(t)||(r=this.built||/^\w/.test(t)?a:r,t=k(r,t));var o=t+i;return t=o+this.query,o=t.replace(D,function(e){return this.query=e,""}),x(e,f.urlArgs,function(e){t+=(-1===t.indexOf("?")?"?":"&")+e}),this.url=t,this.urlNoQuery=o}function g(e,t,n){var a=$(e,t,n);return a.sort(w),a}function y(e){return new RegExp("^"+e+"(/|$)")}function b(t){return function(){var n;return t.init&&(n=t.init.apply(e,arguments)),n||t.exports&&C(t.exports)}}function $(e,t,n){var a=[];for(var r in e){var i={name:r,val:e[r]};a.push(i),i.reg="*"===r&&t?/^/:y(r),n&&"*"!==r&&(i.reg=new RegExp("/"+r.replace(/^\//,"")+"(/|$)"))}return a}function x(e,t,n){t=t||[];for(var a,r=0;a=t[r++];)if(a.reg.test(e))return n(a.val,a.name,a),!1}function w(e,t){var n=e.name,a=t.name;return"*"===a?-1:"*"===n?1:a.length-n.length}function k(e,t){if("/"!==e.charAt(e.length-1)&&(e+="/"),"./"===t.slice(0,2))return e+t.slice(2);if(".."===t.slice(0,2)){for(e+=t;P.test(e);)e=e.replace(P,"");return e}return"/"===t.slice(0,1)?e+t.slice(1):e+t}function C(t){if(!t)return t;var n=e;return t.split(".").forEach(function(e){n=n[e]}),n}var T=[],E=[],A=/\.js$/i,N=[],S=!1;It=avalon.require=function(e,n,a,l){if(S){Array.isArray(e)||avalon.error("require方法的第一个参数应为数组 "+e);var s=[],u=r(),d=a||"callback"+setTimeout("1");l=l||r(),l.baseUrl=f.baseUrl;var p=!!l.built;if(a&&(l.parentUrl=a.substr(0,a.lastIndexOf("/")),l.mapUrl=a.replace(A,"")),p){var v=t(l.defineName,l);d=v.urlNoQuery}else e.forEach(function(e){var n=t(e,l),a=i(n);a&&(u[a]||(s.push(a),u[a]="司徒正美"))});var h=or[d];h&&4===h.state||(or[d]={id:d,deps:p?e.concat():s,factory:n||o,state:3}),h||T.push(d),c()}else if(N.push(avalon.slice(arguments)),arguments.length<=2){S=!0;for(var m,g=N.splice(0,N.length);m=g.shift();)It.apply(null,m)}},It.define=function(e,t,n){"string"!=typeof e&&(n=t,t=e,e="anonymous"),Array.isArray(t)||(n=t,t=[]);var a={built:!S,defineName:e},r=[t,n,a];n.require=function(e){if(r.splice(2,0,e),or[e]){or[e].state=3;var t=!1;try{t=l(or[e].deps,e)}catch(a){}t&&avalon.error(e+"模块与之前的模块存在循环依赖,请不要直接用script标签引入"+e+"模块")}delete n.require,It.apply(null,r)};var i=a.built?"unknown":v();if(i){var o=or[i];o&&(o.state=2),n.require(i)}else E.push(n)},It.config=f,It.define.amd=or;var M=f["orig.paths"]=r(),O=f["orig.map"]=r(),j=f.packages=[],L=f["orig.args"]=r();avalon.mix(Tn,{paths:function(e){avalon.mix(M,e),f.paths=g(M)},map:function(e){avalon.mix(O,e);var t=g(O,1,1);avalon.each(t,function(e,t){t.val=g(t.val)}),f.map=t},packages:function(e){e=e.concat(j);for(var t,n=r(),a=[],i=0;t=e[i++];){t="string"==typeof t?{name:t}:t;var o=t.name;if(!n[o]){var l=k(t.location||o,t.main||"main");l=l.replace(A,""),a.push(t),n[o]=t.location=l,t.reg=y(o)}}f.packages=a.sort()},urlArgs:function(e){"string"==typeof e&&(e={"*":e}),avalon.mix(L,e),f.urlArgs=g(L,1)},baseUrl:function(e){if(!p(e)){var t=Vt.getElementsByTagName("base")[0];t&&Vt.removeChild(t);var n=_t.createElement("a");n.href=e,e=n.href,t&&Vt.insertBefore(t,Vt.firstChild)}e.length>3&&(f.baseUrl=e)},shim:function(e){for(var t in e){var n=e[t];Array.isArray(n)&&(n=e[t]={deps:n}),n.exportsFn||!n.exports&&!n.init||(n.exportsFn=b(n))}f.shim=e}});var H=It.plugins={domReady:{load:o},js:{load:function(e,t,n){var a=t.url,r=t.urlNoQuery,i=f.shim[e.replace(A,"")];i?It(i.deps||[],function(){var e=avalon.slice(arguments);u(a,r,function(){n(i.exportsFn?i.exportsFn.apply(0,e):void 0)})}):u(a,r)}},css:{load:function(e,t,a){var r=t.url;Vt.insertAdjacentHTML("afterBegin",''),n("debug: 已成功加载 "+r),a()}},text:{load:function(e,t,a){var r=t.url,i=za();i.onload=function(){var e=i.status;e>399&&600>e?avalon.error(r+" 对应资源不存在或没有开启 CORS"):(n("debug: 已成功加载 "+r),a(i.responseText))};var o="_="+(new Date-0),l=-1===r.indexOf("?")?r+"?"+o:r+"&"+o;i.open("GET",l,!0),"withCredentials"in i&&(i.withCredentials=!0),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.send(),n("debug: 正准备加载 "+r)}}};It.checkDeps=c;var D=/(\?[^#]*)$/,R=/^callback\d+$/,P=/\/\w+\/\.\./,q=_t.scripts[_t.scripts.length-1],B=q.getAttribute("data-main");if(B){Tn.baseUrl(B);var F=f.baseUrl;f.baseUrl=F.slice(0,F.lastIndexOf("/")+1),u(F.replace(A,"")+".js")}else{var _=d(q.src);f.baseUrl=_.slice(0,_.lastIndexOf("/")+1)}};var lr,sr=[],cr=function(e){for(lr=!0,It&&(or["domReady!"].state=4,It.checkDeps());e=sr.shift();)e(avalon)};"complete"===_t.readyState?setTimeout(cr):_t.addEventListener("DOMContentLoaded",cr),e.addEventListener("load",cr),avalon.ready=function(e){lr?e(avalon):sr.push(e)},avalon.config({loader:!0}),avalon.ready(function(){avalon.scan(_t.body)});var ur=navigator.userAgent.toLowerCase(),fr=ur.indexOf("android")>0,dr=Lt();avalon.gestureHooks={add:function(e,t){function n(e){t.touchmove(e)}function a(e){t.touchend(e),document.removeEventListener("touchmove",n,!1),document.removeEventListener("touchend",a,!1),document.removeEventListener("touchcancel",r,!1)}function r(e){t.touchcancel(e),document.removeEventListener("touchmove",n,!1),document.removeEventListener("touchend",a,!1),document.removeEventListener("touchcancel",r,!1)}t.events.forEach(function(i){avalon.eventHooks[i]={fn:function(i,o){return i.getAttribute("data-"+e)||(i.setAttribute("data-"+e,"1"),i.addEventListener("touchstart",function(e){t.touchstart(e),document.addEventListener("touchmove",n,!1),document.addEventListener("touchend",a,!1),document.addEventListener("touchcancel",r,!1)},!1)),o}}})}};var pr={},vr=["screenX","screenY","clientX","clientY","pageX","pageY"],hr={trackingClick:!1,trackingClickStart:0,targetElement:null,touchStartX:0,touchStartY:0,touchBoundary:10,tapDelay:200,sendClick:function(t,n){qt(t,"tap",{fastclick:!0});var a,r;document.activeElement&&document.activeElement!==t&&document.activeElement.blur(),r=n.changedTouches[0],a=document.createEvent("MouseEvents"),a.initMouseEvent("click",!0,!0,e,1,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),a.fastclick=!0,t.dispatchEvent(a)},needClick:function(e){switch(e.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(e.disabled)return!0;break;case"input":if(dr&&"file"===e.type||e.disabled)return!0;break;case"label":case"iframe":case"video":return!0}return!1},focus:function(e){var t;dr&&e.setSelectionRange&&0!==e.type.indexOf("date")&&"time"!==e.type?(t=e.value.length,e.setSelectionRange(t,t)):e.focus()},needFocus:function(e){switch(e.nodeName.toLowerCase()){case"textarea":case"select":return!0;case"input":switch(e.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return!1}return!e.disabled&&!e.readOnly;default:return!1}},updateScrollParent:function(e){var t=e.fastClickScrollParent;if(!t||!t.contains(e)){var n=e;do{if(n.scrollHeight>n.offsetHeight){t=n,e.fastClickScrollParent=n;break}n=n.parentElement}while(n)}t&&(t.fastClickLastScrollTop=t.scrollTop)},findControl:function(e){return void 0!==e.control?e.control:e.htmlFor?document.getElementById(e.htmlFor):e.querySelector("button, input:not([type=hidden]), keygen,meter, output, progress, select, textarea")},touchHasMoved:function(e){var t=e.changedTouches[0],n=hr.touchBoundary;return Math.abs(t.pageX-hr.touchStartX)>n||Math.abs(t.pageY-hr.touchStartY)>n?!0:!1},fixTarget:function(t){return e.SVGElementInstance&&t instanceof SVGElementInstance&&(t=t.correspondingUseElement),t}};supportPointer=!!navigator.pointerEnabled||!!navigator.msPointerEnabled,supportPointer&&(on.style.msTouchAction=on.style.touchAction="none"),avalon.gestureHooks.add("tap",{events:["tap","click"],touchstart:function(t){var n,a,r;if(t.targetTouches.length>1)return!0;if(n=hr.fixTarget(t.target),a=t.targetTouches[0],dr){if(r=e.getSelection(),r.rangeCount&&!r.isCollapsed)return!0;hr.updateScrollParent(n)}return hr.trackingClick=!0,hr.trackingClickStart=t.timeStamp,hr.targetElement=n,hr.touchStartX=a.pageX,hr.touchStartY=a.pageY,t.timeStamp-hr.lastClickTimehr.tapDelay||!hr.trackingClick)return!0;if(t.timeStamp-hr.lastClickTime100||dr&&e.top!==e&&"input"===r?(hr.targetElement=null,!1):(hr.focus(o),fr&&hr.sendClick(o,t),!1);return dr&&(i=o.fastClickScrollParent,i&&i.fastClickLastScrollTop!==i.scrollTop)?!0:(hr.needClick(o)||(t.preventDefault(),hr.sendClick(o,t)),!1)},touchcancel:function(){hr.trackingClick=!1,hr.targetElement=null}});var mr={events:["swipe","swipeleft","swiperight","swipeup","swipedown"],touchstart:function(e){Dt(e,o)},touchmove:function(e){Rt(e,o)},touchend:function(e){Pt(e,function(t,n){var a=Date.now(),r=t.distance>100&&t.distance/t.duration>.65;if(r){var i,o=n.clientX-t.startTouch.clientX,l=n.clientY-t.startTouch.clientY,s={duration:a-t.startTime,isflick:r,displacementX:o,displacementY:l,touch:n,touchEvent:e,isVertical:t.isVertical},c=t.element;qt(c,"swipe",s),i=t.isVertical?l>0?"down":"up":l>0?"right":"left",qt(c,"swipe"+i,s)}})}};mr.touchcancel=mr.touchend,avalon.gestureHooks.add("swipe",mr);var gr=null,yr={events:["longtap","doubletap"],touchstart:function(e){Dt(e,function(e,t){e.pressingHandler=setTimeout(function(){"tapping"===e.status&&(e.status="pressing",qt(t.target,"longtap",{touchEvent:t})),Bt(e)},500)})},touchmove:function(e){Rt(e,function(e){e.distance>10&&e.pressingHandler&&(Bt(e),("tapping"===e.status||"pressing"===e.status)&&(e.status="panning"))})},touchend:function(e){Pt(e,function(t,n){Bt(t),"tapping"===t.status&&(t.timestamp=Date.now(),gr&&t.timestamp-gr.timestamp<300&&qt(t.element,"doubletap",{touch:n,touchEvent:e}),gr=t)})},touchcancel:function(e){Pt(e,function(e){Bt(e)})}};avalon.gestureHooks.add("press",yr),"function"==typeof define&&define.amd&&define("avalon",[],function(){return avalon});var br=e.avalon;return avalon.noConflict=function(t){return t&&e.avalon===avalon&&(e.avalon=br),avalon},void 0===t&&(e.avalon=avalon),avalon}); \ No newline at end of file +!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("Avalon requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(){avalon.config.debug&&console.log.apply(console,arguments)}function r(){return Object.create(null)}function i(e){return Function.apply(o,e)}function o(){}function l(e,t){"string"==typeof e&&(e=e.match(Xt)||[]);for(var n={},a=void 0!==t?t:1,r=0,i=e.length;i>r;r++)n[e[r]]=a;return n}function s(){if(e.VBArray){var t=document.documentMode;return t?t:e.XMLHttpRequest?7:6}return 0/0}function c(e){if(e&&"object"==typeof e){var t=e.length,n=Zt.call(e);if(/(Array|List|Collection|Map|Arguments)\]$/.test(n))return!0;if("[object Object]"===n&&t===t>>>0)return!0}return!1}function u(e,t){if(e&&e.childNodes)for(var n,a=e.childNodes,r=0;n=a[r++];)if(n.tagName){var i=Pt.createElementNS(fn,n.tagName.toLowerCase());Jt.forEach.call(n.attributes,function(e){i.setAttribute(e.name,e.value)}),u(n,i),t.appendChild(i)}}function f(e){for(var t in e)if(Gt.call(e,t)){var n=e[t];"function"==typeof f.plugins[t]?f.plugins[t](n):"object"==typeof f[t]?avalon.mix(f[t],n):f[t]=n}return this}function d(e){return(e+"").replace(bn,"\\$&")}function p(e,t){var n=this.$events||(this.$events={}),a=n[e]||(n[e]=[]);if("function"==typeof t){var r=t;r.uniqueNumber=Math.random(),t={element:en,type:"user-watcher",handler:o,vmodels:[this],expr:e,uniqueNumber:r.uniqueNumber},t.wildcard=/\*/.test(e)}if(t.update)t.oneTime||avalon.Array.ensure(a,t);else{if(/\w\.*\B/.test(e)){t.getter=o;var i=this;t.update=function(){var e=this.fireArgs||[];e[2]&&t.handler.apply(i,e),delete this.fireArgs},a.sync=!0,avalon.Array.ensure(a,t)}else avalon.injectBinding(t);r&&(t.handler=r)}return function(){t.update=t.getter=t.handler=o,t.element=Pt.createElement("a")}}function v(e,t){var n=this.$events;if(n&&n[e]){t&&(t[2]=e),m(n[e],t);var a=this.$up;a&&(this.$pathname&&v.call(a,this.$pathname+"."+e,t),v.call(a,"*."+e,t))}else if(a=this.$up){var r=this.$pathname+"."+e,i=r.split(".");-1===i.indexOf("*")?(v.call(a,r,t),i[1]="*",v.call(a,i.join("."),t)):v.call(a,r,t)}}function h(e,t){for(;;){if(e.$watch){var n=e.$events||(e.$events={}),a=n[t]||(n[t]=[]);return void An.collectDependency(a)}if(e=e.$up,!e)break;t=e.$pathname+"."+t}}function m(e,t){if(e){new Date-Sn>444&&"object"==typeof e[0]&&L();for(var n,a=[],r=[],i=0;n=e[i++];)"user-watcher"===n.type?a.push(n):r.push(n);if(f.async){for(ba.render(),i=0;n=r[i++];)if(n.update){var o=S(n);ba.queue[o]||(ba.queue[o]=1,ba.queue.push(n))}}else for(i=0;n=r[i++];)n.update&&n.update();for(i=0;n=a[i++];)(t&&t[2]===n.expr||n.wildcard)&&(n.fireArgs=t),n.update()}}function g(e,t){return t=t||{},t.watch=!0,b(e,t)}function y(){}function b(e,t){function a(e){return u[e]===!0}if(!e||e.$id&&e.$accessors)return e;t=t||Vt;var r=t.force||Vt,i=t.old,o=i&&i.$accessors||Vt,s=new y,c={},u={},f=[],d=[],h={};e.$skipArray&&(h=l(e.$skipArray),delete e.$skipArray);var m=e.$computed;if(m){delete e.$computed;for(var g in m)u[g]=!0,function(e,t){var n;c[e]={get:function(){return n=t.get.call(this)},set:function(a){if("function"==typeof t.set){var r=n;t.set.call(this,a);var i=this[e];this.$fire&&i!==r&&this.$fire(e,i,r)}},enumerable:!0,configurable:!0}}(g,m[g])}for(g in e){var b=e[g];wn[g]||(u[g]=!0),"function"==typeof b||b&&b.nodeType||!r[g]&&("$"===g.charAt(0)||wn[g]||h[g])?f.push(g):$(b)?(n("warning:计算属性建议放在$computed对象中统一定义"),function(e,t){var n;c[e]={get:function(){return n=t.get.call(this)},set:function(a){if("function"==typeof t.set){var r=n;t.set.call(this,a);var i=this[e];this.$fire&&i!==r&&this.$fire(e,i,r)}},enumerable:!0,configurable:!0}}(g,b)):(d.push(g),c[g]=o[g]?o[g]:x(g,b))}c.$model=Cn,s=Object.defineProperties(s,c,e),f.forEach(function(t){s[t]=e[t]}),T(s,"$id","anonymous"),T(s,"$up",i?i.$up:null),T(s,"$track",Object.keys(u)),T(s,"$active",!1),T(s,"$pathname",i?i.$pathname:""),T(s,"$accessors",c),T(s,"hasOwnProperty",a),t.watch&&(T(s,"$watch",function(){return p.apply(s,arguments)}),T(s,"$fire",function(e,t){if(0===e.indexOf("all!")){var n=e.slice(4);for(var a in avalon.vmodels){var r=avalon.vmodels[a];r.$fire&&r.$fire.apply(r,[n,t])}}else v.call(s,e,[t])})),d.forEach(function(t){var n=s[t]=e[t];n&&"object"==typeof n&&(n.$up=s,n.$pathname=t),v.call(s,t)});for(g in m)b=s[g];return s.$active=!0,s}function $(e){if(e&&"object"==typeof e){for(var t in e)if("get"!==t&&"set"!==t)return!1;return"function"==typeof e.get}}function x(e,t){var n,t=0/0;return{get:function(){return this.$active&&h(this,e),t},set:function(a){if(t!==a){var r=t;n=w(a,t),n?t=n:(n=void 0,t=a),Object(n)===n&&(n.$pathname=e,n.$up=this),this.$active&&v.call(this,e,[t,r])}},enumerable:!0,configurable:!0}}function w(e,t,n,a){if(Array.isArray(e))return C(e,t,a);if(avalon.isPlainObject(e)){if(t){var r=Object.keys(e),i=Object.keys(t);if(r.join(";")===i.join(";")){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);return t}t.$active=!1}return b(e,{old:t,watch:a})}return n?e:void 0}function C(e,t,n){if(t){var a=[0,t.length].concat(e);return t.splice.apply(t,a),t}for(var r in En)e[r]=En[r];T(e,"$up",null),T(e,"$pathname",""),T(e,"$track",N(e.length)),e._=b({length:0/0},{watch:!0}),e._.length=e.length,e._.$watch("length",function(t,n){v.call(e.$up,e.$pathname+".length",[t,n])}),n&&T(e,"$watch",function(){return p.apply(e,arguments)}),Object.defineProperty(e,"$model",Cn);for(var i=0,o=e.length;o>i;i++){var l=e[i]=w(e[i],0,1,1);Object(l)===l&&(l.$up=e)}return e}function T(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!1,configurable:!0})}function k(e){var t=avalon.type(e);if("array"===t){for(var n=[],a=0;aa;a++){n[a]=e[a];var i=t[a];i in n?(e[a]=n[i],delete n[i]):e[a]=e[i]}}function N(e){for(var t=[],n=0;e>n;n++)t[n]=an("$proxy$each");return t}function A(e,t,n){switch(t){case"push":case"unshift":n=N(n.length);break;case"splice":if(n.length>2){{n[1],n.length-2}n=[n[0],n[1]].concat(N(n.length-2))}}Array.prototype[t].apply(e,n)}function M(e,t){t.oneTime||e&&avalon.Array.ensure(e,t)&&t.element&&(j(t,e),new Date-Sn>444&&L())}function O(e,t){for(var n,a=[],r=0;n=e[r++];)a.push(t?n.$id:n.$key);return a.join(";")}function S(e){if(!e.uniqueNumber){var t=e.element;e.uniqueNumber=t?1!==t.nodeType?e.type+(e.pos||0)+"-"+S(t.parentNode):e.name+"-"+S(t):++Mn}return e.uniqueNumber}function j(e,t){var n=e.lists||(e.lists=[]),a=S(e);avalon.Array.ensure(n,t),t.$uuid=t.$uuid||an(),On[a]||(On[a]=1,On.push(e))}function L(e){for(var t=On.length,n=t,a=[],r={},i={};e=On[--t];){var o=e.type;i[o]?i[o]++:(i[o]=1,a.push(o))}var l=!1;if(a.forEach(function(e){jn[e]!==i[e]&&(r[e]=1,l=!0)}),t=n,l)for(;e=On[--t];)if(null!==e.element){if(r[e.type]&&H(e.element)){On.splice(t,1),delete On[e.uniqueNumber];for(var s,c=e.lists,u=0;s=c[u++];)avalon.Array.remove(c,s),avalon.Array.remove(s,e);D(e)}}else On.splice(t,1);jn=i,Sn=new Date}function D(e){delete On[e.uniqueNumber],e.element=null,e.rollback&&e.rollback();for(var t in e)e[t]=null}function H(e){try{{e.parentNode.nodeType}}catch(t){return!0}return e.ifRemove&&!en.contains(e.ifRemove)&&Bt===e.parentNode?(e.parentNode&&e.parentNode.removeChild(e),!0):e.msRetain?0:1===e.nodeType?!en.contains(e):!avalon.contains(en,e)}function P(e){return e.replace(/([a-z\d])([A-Z]+)/g,"$1-$2").toLowerCase()}function R(e){return e.indexOf("-")<0&&e.indexOf("_")<0?e:e.replace(/[-_][^-_]/g,function(e){return e.charAt(1).toUpperCase()})}function q(e){try{if("object"==typeof e)return e;e="true"===e?!0:"false"===e?!1:"null"===e?null:+e+""===e?+e:Bn.test(e)?JSON.parse(e):e}catch(t){}return e}function B(e){return e.window&&e.document?e:9===e.nodeType?e.defaultView:!1}function F(e,t){if(e.offsetWidth<=0){var n=getComputedStyle(e,null);if(Xn.test(n.display)){var a={node:e};for(var r in Vn)a[r]=n[r],e.style[r]=Vn[r];t.push(a)}var i=e.parentNode;i&&1===i.nodeType&&F(i,t)}}function _(e){var t=e.tagName.toLowerCase();return"input"===t&&/checkbox|radio/.test(e.type)?"checked":t}function I(e,t){var n=[],a=!!t;t=t||0;for(var r="unknown",o="",l=0;lu;u++)if(r.length){var d="vm"+o+"_"+u;s.push(d),c.push(t[u]),l.push.apply(l,X(r,t[u],d,n))}n.args=c;var p=n.type,v=t.map(function(e){return String(e.$id).replace(Zn,"$1")})+e+p,h=Kn.get(v);if(h){if("duplex"===p){var m=Kn.get(v+"setter");n.setter=m.apply(m,n.args)}return n.getter=h}if(l.length||l.push("fix"+o),"duplex"===p){var g={};l.forEach(function(e){var t=e.split("=");g[t[0].trim()]=t[1].trim()}),e=e.replace(/[\$\w]+/,function(e){return g[e]?g[e]:e});var y=i(s.concat("'use strict';return function(vvv){"+e+" = vvv\n}\n"));Kn.put(v+"setter",y),n.setter=y.apply(y,n.args)}if("on"===p){-1===e.indexOf("(")?e+=".call(this, $event)":e=e.replace("(",".call(this,"),s.push("$event"),e="\nreturn "+e+";";var b=e.lastIndexOf("\nreturn"),$=e.slice(0,b),x=e.slice(b);e=$+"\n"+x}else e="\nreturn "+e+";";return h=i(s.concat("'use strict';\nvar "+l.join(",\n")+e)),Kn.put(v,h)}function z(e){var t=mn.test(e);if(t){var n=it(e);return 1===n.length?n[0].expr:n.map(function(e){return e.type?"("+e.expr+")":ra(e.expr)}).join(" + ")}return e}function W(e){return e=e.replace(Qn,"").replace(ea,function(){return"],|"}).replace(ta,function(e,t){return"["+ra(t)}).replace(na,function(){return'"],["'}).replace(aa,function(){return'",'})+"]",i(["return ["+e+"]"])()}function G(e,t,n){var a=setTimeout(function(){var r=e.innerHTML;clearTimeout(a),r===n?t():G(e,t,r)})}function Z(e,t){var n=e.getAttribute("avalonctrl")||t.$id;e.setAttribute("avalonctrl",n),t.$events&&(t.$events.expr=e.tagName+'[avalonctrl="'+n+'"]')}function J(e,t){for(var n,a=0;n=e[a++];)n.vmodels=t,cn[n.type].init(n),avalon.injectBinding(n),n.getter&&1===n.element.nodeType&&n.element.removeAttribute(n.name);e.length=0}function K(e,t){return e.priority-t.priority}function Q(e,t,a){var r=!0;if(t.length){for(var i,o=e.attributes,l=[],s={},c=0;i=o[c++];){var u=i.name;if(!s[u]&&(s[u]=1,i.specified&&(a=u.match(ca)))){var f=a[1],d=a[2]||"",p=i.value;if(ua[f]?(d=f,f="on"):fa[f]&&(d=f,f="attr",u="ms-"+f+"-"+d,n("warning!请改用"+u+"代替"+i.name+"!")),cn[f]){var v=p.replace(sa,""),h=p!==v,m={type:f,param:d,element:e,name:u,expr:v,oneTime:h,priority:(cn[f].priority||10*f.charCodeAt(0))+(Number(d.replace(/\D/g,""))||0)};if("html"===f||"text"===f){var g=rt(p).filters;m.expr=m.expr.replace(g,""),m.filters=g.replace(ha,function(){return m.type="html",m.group=1,""}).trim()}else if("duplex"===f)var y=u;else if("ms-if-loop"===u)m.priority+=100;else if("ms-attr-value"===u)var b=u;l.push(m)}}}if(l.length){for(l.sort(K),y&&b&&"text"===e.type&&n("warning!一个控件不能同时定义ms-attr-value与"+y),c=0;m=l[c];c++){if(f=m.type,da.test(f))return J(l.slice(0,c+1),t);r&&(r=!pa.test(f))}J(l,t)}}r&&!ia[e.tagName]&&(la&&la(e),tt(e,t))}function et(e){for(var t,n=e.attributes,a={},r=0;t=n[r++];)t.specified&&!va.test(t.name)&&(a[R(t.name)]=q(t.value));return a}function tt(e,t){var n=avalon.slice(e.childNodes);nt(n,t)}function nt(e,t){for(var n,a=0;n=e[a++];)switch(n.nodeType){case 1:var r=n;if(at(n,t),!r.msResolved&&r.parentNode&&1===r.parentNode.nodeType){var i=st(r);if(i){var o=r.localName?r.localName.replace(i+":",""):r.nodeName,l=i+":"+R(o);$a.push({library:i,element:r,fullName:l,widget:o,vmodels:t,name:"widget"}),avalon.components[l]&&avalon.component(l)}}n.msHasEvent&&avalon.fireDom(n,"datasetchanged",{bubble:n.msHasEvent});break;case 3:mn.test(n.nodeValue)&&ot(n,t,a)}}function at(e,t,n){var a=e.getAttribute("ms-skip"),r=e.getAttributeNode("ms-important"),i=e.getAttributeNode("ms-controller");if("string"!=typeof a){if(n=r||i){var o=avalon.vmodels[n.value];if(!o)return;t=n===r?[o]:[o].concat(t),e.removeAttribute(n.name),e.classList.remove(n.name),Z(e,o)}Q(e,t)}}function rt(e){if(e.indexOf("|")>0){var t=e.replace(ga,function(e){return Array(e.length+1).join("1")}),n=t.replace(ma,"ᄢ㍄").indexOf("|");if(n>-1)return{type:"text",filters:e.slice(n).trim(),expr:e.slice(0,n)}}return{type:"text",expr:e,filters:""}}function it(e){for(var t,n,a=[],r=0;;){if(n=e.indexOf(vn,r),-1===n)break;if(t=e.slice(r,n),t&&a.push({expr:t}),r=n+vn.length,n=e.indexOf(hn,r),-1===n)break;t=e.slice(r,n),t&&a.push(rt(t,r)),r=n+hn.length}return t=e.slice(r),t&&a.push({expr:t}),a}function ot(e,t,n){var a=[],r=it(e.data);if(r.length){for(var i,o=0;i=r[o++];){var l=Pt.createTextNode(i.expr);i.type&&(i.expr=i.expr.replace(sa,function(){return i.oneTime=!0,""}),i.element=l,i.filters=i.filters.replace(ha,function(){return i.type="html",""}),i.pos=1e3*n+o,a.push(i)),tn.appendChild(l)}e.parentNode.replaceChild(tn,e),a.length&&J(a,t)}}function lt(e,t){if(t)for(var n,a=0;n=e[a++];)if(n.hasOwnProperty(t)&&"object"==typeof n[t]){var r=n[t];return r.$model||r}return{}}function st(e){if(e.scopeName&&"HTML"!==e.scopeName)return e.scopeName;var t=e.nodeName.toLowerCase(),n=t.indexOf(":");return n>0?t.slice(0,n):void 0}function ct(e){return null==e?"":e}function ut(e,t,n){return t.param.replace(Yt,function(a){var r=avalon.duplexHooks[a];r&&"function"==typeof r[n]&&(e=r[n](e,t))}),e}function ft(){for(var e=Sa.length-1;e>=0;e--){var t=Sa[e];t()===!1&&Sa.splice(e,1)}Sa.length||clearInterval(Oa)}function dt(e,t){if(!e||1!==e.nodeType)return null;if(t)var n=t.effectName,a=t.effectDriver;else n=e.getAttribute("data-effect-name"),a=e.getAttribute("data-effect-driver");if(!n||!a)return null;var r=Ba.pop()||new ht;return r.el=e,r.driver=a,r.useCss="j"!==a,r.useCss&&(t&&avalon(e).addClass(t.effectClass),r.cssEvent="t"===a?La:Da),r.name=n,r.callbacks=avalon.effects[n]||{},r}function pt(e,t){var n=e.getAttribute("data-effect-name");if(n){t.effectName=n,t.effectDriver=e.getAttribute("data-effect-driver");var a=+e.getAttribute("data-effect-stagger");t.effectLeaveStagger=+e.getAttribute("data-effect-leave-stagger")||a,t.effectEnterStagger=+e.getAttribute("data-effect-enter-stagger")||a,t.effectClass=e.className||0/0}}function vt(e){return e.replace(/^[\S]/g,function(e){return e.toUpperCase()})}function ht(){}function mt(e,t){var n=e.callbacks[t+"Class"];return"string"==typeof n?n:"function"==typeof n?n():e.name+"-"+t}function gt(e,t,n){var a=e.callbacks[t];a&&a.call(e,e.el,n)}function yt(e,t,n){var a=e.templateCache&&e.templateCache[t];if(a){for(var r,i=Pt.createDocumentFragment();r=a.firstChild;)i.appendChild(r);return i}return avalon.parseHTML(n)}function bt(e){for(var t=Pt.createDocumentFragment(),n=0,a=e.length;a>n;n++)t.appendChild(e[n]);return t}function $t(e,t,n){for(var a,r=0;a=e[r++];)a.className===n.effectClass&&avalon.effect.apply(a,t,o,o,n)}function xt(e,t,n){return e?setTimeout(t,++n*e):t(),n}function wt(e,t){for(var n=tn.cloneNode(!1),a=e,r=a.nodeValue,i=t&&Math.max(+t.staggerIndex,0),l=avalon.slice(a.parentNode.childNodes),s=l.indexOf(a);;){var c=l[--s];if(!c||0===String(c.nodeValue).indexOf(r))break;t&&c.className===t.effectClass?(e=c,function(e){t.staggerIndex=xt(t.effectLeaveStagger,function(){avalon.effect.apply(e,0,o,function(){n.appendChild(e)},t)},i)}(c)):n.insertBefore(c,n.firstChild)}return n.appendChild(a),n}function Ct(e,t,n,a,r){var i=e.template.cloneNode(!0),o=avalon.slice(i.childNodes);i.appendChild(n.$anchor),r&&t.appendChild(i);var l=[n].concat(e.vmodels),s={nodes:o,vmodels:l,content:i};a.push(s)}function Tt(e){var t="object"===e.xtype?At:kt,n=t(e),a=n.$anchor||(n.$anchor=e.element.cloneNode(!1));return a.nodeValue=e.signature,n.$outer=e.$outer,n}function kt(e,t){for(var n=e.param||"el",a=0,r=Ua.length;r>a;a++){var i=Ua[a];if(i&&i.hasOwnProperty(n)){Ua.splice(a,1),t=i;break}}return t||(t=Et(n)),t}function Et(e){var t={$outer:{},$index:0,$oldIndex:0,$anchor:null,$first:!1,$last:!1,$remove:avalon.noop};t[e]=0/0;var n={$last:1,$first:1,$index:1};n[e]=1;var a=g(t,{force:n});return a.$id=an("$proxy$each"),a}function Nt(e,t,n){if("array"===n){e.$remove=function(){t.$repeat.removeAt(e.$index)};var a=t.param;e.$watch(a,function(n){var a=e.$index;t.$repeat[a]=n})}else e.$watch("$val",function(n){t.$repeat[e.$key]=n})}function At(){return za.pop()||Mt()}function Mt(){var e=g({$key:"",$val:0/0,$index:0,$oldIndex:0,$outer:{},$anchor:null},{force:{$key:1,$val:1,$index:1}});return e.$id=an("$proxy$with"),e}function Ot(e,t,n){var a=e[t];if(a){var r=0===a.$id.indexOf("$proxy$each")?Ua:za;a.$outer={};for(var i in a.$events){var o=a.$events[i];Array.isArray(o)&&(o.length=0,i===n?a[n]=0/0:"$val"===i&&(a.$val=0/0))}r.unshift(a)>f.maxRepeatSize&&r.pop(),delete e[t]}}function St(e,t){var n="_"+e;if(!St[n]){var a=Pt.createElement(e);en.appendChild(a),t=Qt?getComputedStyle(a,null).display:a.currentStyle.display,en.removeChild(a),St[n]=t}return St[n]}function jt(e,t,n,a){e=(e+"").replace(/[^0-9+\-Ee.]/g,"");var r=isFinite(+e)?+e:0,i=isFinite(+t)?Math.abs(t):3,o=a||",",l=n||".",s="",c=function(e,t){var n=Math.pow(10,t);return""+(Math.round(e*n)/n).toFixed(t)};return s=(i?c(r,i):""+Math.round(r)).split("."),s[0].length>3&&(s[0]=s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,o)),(s[1]||"").length');var qt,Bt=Rt.firstChild,Ft="$"+Ht,_t=e.require,It=e.define,Vt={},Xt=/[^, ]+/g,Yt=/\w+/g,Ut=/^\[object SVG\w*Element\]$/,zt=/^\[object (?:Window|DOMWindow|global)\]$/,Wt=Object.prototype,Gt=Wt.hasOwnProperty,Zt=Wt.toString,Jt=Array.prototype,Kt=Jt.slice,Qt=e.dispatchEvent,en=Pt.documentElement,tn=Pt.createDocumentFragment(),nn=(Pt.createElement("div"),{});"Boolean Number String Function Array Date RegExp Object Error".replace(Xt,function(e){nn["[object "+e+"]"]=e.toLowerCase()});var an=function(e){return e=e||"avalon",String(Math.random()+Math.random()).replace(/\d\.\d{4}/,e)},rn=s();avalon=function(e){return new avalon.init(e)},avalon.nextTick=new function(){function t(){for(var e=r.length,t=0;e>t;t++)r[t]();r=r.slice(e)}var n=e.setImmediate,a=e.MutationObserver;if(n)return n.bind(e);var r=[];if(a){var i=document.createTextNode("avalon");new a(t).observe(i,{characterData:!0});var o=!1;return function(e){r.push(e),o=!o,i.data=o}}return function(e){setTimeout(e,4)}},avalon.init=function(e){this[0]=this.element=e},avalon.fn=avalon.prototype=avalon.init.prototype,avalon.type=function(e){return null==e?String(e):"object"==typeof e||"function"==typeof e?nn[Zt.call(e)]||"object":typeof e};var on=function(e){return"[object Function]"===Zt.call(e)};avalon.isFunction=on,avalon.isWindow=function(e){return zt.test(Zt.call(e))},avalon.isPlainObject=function(e){return"[object Object]"===Zt.call(e)&&Object.getPrototypeOf(e)===Wt},avalon.mix=avalon.fn.mix=function(){var e,t,n,a,r,i,o=arguments[0]||{},l=1,s=arguments.length,c=!1;for("boolean"==typeof o&&(c=o,o=arguments[1]||{},l++),"object"==typeof o||on(o)||(o={}),l===s&&(o=this,l--);s>l;l++)if(null!=(e=arguments[l]))for(t in e)n=o[t],a=e[t],o!==a&&(c&&a&&(avalon.isPlainObject(a)||(r=Array.isArray(a)))?(r?(r=!1,i=n&&Array.isArray(n)?n:[]):i=n&&avalon.isPlainObject(n)?n:{},o[t]=avalon.mix(c,i,a)):void 0!==a&&(o[t]=a));return o},avalon.mix({rword:Xt,subscribers:Ft,version:1.53,ui:{},log:n,slice:function(e,t,n){return Kt.call(e,t,n)},noop:o,error:function(e,t){throw new(t||Error)(e)},oneObject:l,range:function(e,t,n){n||(n=1),null==t&&(t=e||0,e=0);for(var a=-1,r=Math.max(0,Math.ceil((t-e)/n)),i=new Array(r);++an&&t(n,e[n])!==!1;n++);else for(n in e)if(e.hasOwnProperty(n)&&t(n,e[n])===!1)break}},getWidgetData:function(e,t){var n=avalon(e).data(),a={};for(var r in n)0===r.indexOf(t)&&(a[r.replace(t,"").replace(/\w/,function(e){return e.toLowerCase()})]=n[r]);return a},Array:{ensure:function(e,t){return-1===e.indexOf(t)?e.push(t):void 0},removeAt:function(e,t){return!!e.splice(t,1).length},remove:function(e,t){var n=e.indexOf(t);return~n?avalon.Array.removeAt(e,n):!1}}});var ln=avalon.bindingHandlers={},sn=avalon.bindingExecutors={},cn=avalon.directives={};avalon.directive=function(e,t){return ln[e]=t.init=t.init||o,sn[e]=t.update=t.update||o,cn[e]=t};var un=new function(){function e(e){this.size=0,this.limit=e,this.head=this.tail=void 0,this._keymap={}}var t=e.prototype;return t.put=function(e,t){var n={key:e,value:t};return this._keymap[e]=n,this.tail?(this.tail.newer=n,n.older=this.tail):this.head=n,this.tail=n,this.size===this.limit?this.shift():this.size++,t},t.shift=function(){var e=this.head;e&&(this.head=this.head.newer,this.head.older=e.newer=e.older=this._keymap[e.key]=void 0,delete this._keymap[e.key])},t.get=function(e){var t=this._keymap[e];if(void 0!==t)return t===this.tail?t.value:(t.newer&&(t===this.head&&(this.head=t.newer),t.newer.older=t.older),t.older&&(t.older.newer=t.newer),t.newer=void 0,t.older=this.tail,this.tail&&(this.tail.newer=t),this.tail=t,t.value)},e};if(Pt.contains||(Node.prototype.contains=function(e){return!!(16&this.compareDocumentPosition(e))}),avalon.contains=function(e,t){try{for(;t=t.parentNode;)if(t===e)return!0;return!1}catch(n){return!1}},e.SVGElement){var fn="http://www.w3.org/2000/svg",dn=Pt.createElementNS(fn,"svg");dn.innerHTML='',Ut.test(dn.firstChild)||Object.defineProperties(SVGElement.prototype,{outerHTML:{enumerable:!0,configurable:!0,get:function(){return(new XMLSerializer).serializeToString(this)},set:function(e){var t=this.tagName.toLowerCase(),n=this.parentNode,a=avalon.parseHTML(e);if("svg"===t)n.insertBefore(a,this);else{var r=Pt.createDocumentFragment();u(a,r),n.insertBefore(r,this)}n.removeChild(this)}},innerHTML:{enumerable:!0,configurable:!0,get:function(){var e=this.outerHTML,t=new RegExp("<"+this.nodeName+'\\b(?:(["\'])[^"]*?(\\1)|[^>])*>',"i"),n=new RegExp("$","i");return e.replace(t,"").replace(n,"")},set:function(e){if(avalon.clearHTML){avalon.clearHTML(this);var t=avalon.parseHTML(e);u(t,this)}}}})}var pn=avalon.eventHooks;"onmouseenter"in en||avalon.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){pn[e]={type:t,fn:function(t,n){return function(a){var r=a.relatedTarget;return r&&(r===t||16&t.compareDocumentPosition(r))?void 0:(delete a.type,a.type=e,n.call(t,a))}}}}),avalon.each({AnimationEvent:"animationend",WebKitAnimationEvent:"webkitAnimationEnd"},function(t,n){e[t]&&!pn.animationend&&(pn.animationend={type:n})}),void 0===Pt.onmousewheel&&(pn.mousewheel={type:"wheel",fn:function(e,t){return function(n){n.wheelDeltaY=n.wheelDelta=n.deltaY>0?-120:120,n.wheelDeltaX=0,Object.defineProperty(n,"type",{value:"mousewheel"}),t.call(e,n)}}});var vn,hn,mn,gn,yn,bn=/[-.*+?^${}()|[\]\/\\]/g,$n={loader:function(t){var n=qt&&t;e.require=n?qt:_t,e.define=n?qt.define:It},interpolate:function(e){if(vn=e[0],hn=e[1],vn===hn){throw new SyntaxError("openTag!==closeTag")}f.openTag=vn,f.closeTag=hn;var t=d(vn),n=d(hn);mn=new RegExp(t+"(.*?)"+n),gn=new RegExp(t+"(.*?)"+n,"g"),yn=new RegExp(t+".*?"+n+"|\\sms-")}};f.async=!0,f.debug=!0,f.plugins=$n,f.plugins.interpolate(["{{","}}"]),f.paths={},f.shim={},f.maxRepeatSize=100,avalon.config=f;var xn=avalon.vmodels={};avalon.define=function(e){var t=e.$id;t||n("warning: vm必须指定$id");var a=g(e);return a.$id=t,xn[t]=a};var wn=l("$id,$watch,$fire,$events,$model,$skipArray,$active,$pathname,$up,$track,$accessors"),Cn={get:function(){return k(this)},set:o,enumerable:!1,configurable:!0},Tn=["push","pop","shift","unshift","splice"],kn=Array.prototype,En={notify:function(){v.call(this.$up,this.$pathname)},set:function(e,t){if(e>>>0===e&&this[e]!==t){if(e>this.length)throw Error(e+"set方法的第一个参数不能大于原数组长度");v.call(this.$up,this.$pathname+".*",[t,this[e]]),this.splice(e,1,t)}},contains:function(e){return-1!==this.indexOf(e)},ensure:function(e){return this.contains(e)||this.push(e),this},pushArray:function(e){return this.push.apply(this,e)},remove:function(e){return this.removeAt(this.indexOf(e))},removeAt:function(e){return e>>>0===e?this.splice(e,1):[]},size:function(){return this._.length},removeAll:function(e){if(Array.isArray(e))for(var t=this.length-1;t>=0;t--)-1!==e.indexOf(this[t])&&(Nn.call(this.$track,t,1),Nn.call(this,t,1));else if("function"==typeof e)for(t=this.length-1;t>=0;t--){var n=this[t];e(n,t)&&(Nn.call(this.$track,t,1),Nn.call(this,t,1))}else Nn.call(this.$track,0,this.length),Nn.call(this,0,this.length);Qt||(this.$model=k(this)),this.notify(),this._.length=this.length},clear:function(){return this.removeAll()}},Nn=kn.splice;Tn.forEach(function(e){var t=kn[e];En[e]=function(){for(var n=[],a=0,r=arguments.length;r>a;a++)n[a]=w(arguments[a],0,1,1);var i=t.apply(this,n);return A(this.$track,e,n),Qt||(this.$model=k(this)),this.notify(),this._.length=this.length,i}}),"sort,reverse".replace(Xt,function(e){En[e]=function(){var t=this.concat(),n=this,a=Math.random(),r=[],i=!1;kn[e].apply(n,arguments);for(var o=0,l=t.length;l>o;o++){var s=n[o],c=t[o];if(s===c)r.push(o);else{var u=t.indexOf(s);r.push(u),t[u]=a,i=!0}}return i&&(E(this.$track,r),Qt||(this.$model=k(this)),this.notify()),this}});var An=function(){var e,t=[];return{begin:function(n){t.push(e),e=n},end:function(){e=t.pop()},collectDependency:function(t){e&&e.callback(t)}}}();avalon.injectBinding=function(e){e.handler=e.handler||cn[e.type].update||o,e.update=function(){var t=!1;e.getter||(t=!0,An.begin({callback:function(t){M(t,e)}}),e.getter=U(e.expr,e.vmodels,e),e.observers.forEach(function(t){t.v.$watch(t.p,e)}),delete e.observers);try{var a,r,i=e.fireArgs;if(delete e.fireArgs,i?(a=i[0],r=i[1]):a="on"===e.type?e.getter+"":e.getter.apply(0,e.args),r="undefined"==typeof r?e.oldValue:r,e._filters&&(a=er.$filter.apply(0,[a].concat(e._filters))),e.signature){var o=avalon.type(a);if("array"!==o&&"object"!==o)throw Error("warning:"+e.expr+"只能是对象或数组");e.xtype=o;var l=O(e.proxies||[],o),s=a.$track||("array"===o?N(a.length):Object.keys(a));e.track=s,l!==s.join(";")&&(e.handler(a,r),e.oldValue=1)}else(Array.isArray(a)?a.length===(r&&r.length):1)?"oldValue"in e&&a===r||(e.handler(a,r),e.oldValue=a):(e.handler(a,r),e.oldValue=a.concat())}catch(c){delete e.getter,n("warning:exception throwed in [avalon.injectBinding] ",c);var u=e.element;u&&3===u.nodeType&&(u.nodeValue=vn+(e.oneTime?"::":"")+e.expr+hn)}finally{t&&An.end()}},e.update()};var Mn=0,On=avalon.$$subscribers=[],Sn=new Date,jn={},Ln=new function(){avalon.mix(this,{option:Pt.createElement("select"),thead:Pt.createElement("table"),td:Pt.createElement("tr"),area:Pt.createElement("map"),tr:Pt.createElement("tbody"),col:Pt.createElement("colgroup"),legend:Pt.createElement("fieldset"),_default:Pt.createElement("div"),g:Pt.createElementNS("http://www.w3.org/2000/svg","svg")}),this.optgroup=this.option,this.tbody=this.tfoot=this.colgroup=this.caption=this.thead,this.th=this.td};String("circle,defs,ellipse,image,line,path,polygon,polyline,rect,symbol,text,use").replace(Xt,function(e){Ln[e]=Ln.g});var Dn=/<([\w:]+)/,Hn=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Pn=l(["","text/javascript","text/ecmascript","application/ecmascript","application/javascript"]),Rn=Pt.createElement("script"),qn=/<|&#?\w+;/;avalon.parseHTML=function(e){var t=tn.cloneNode(!1);if("string"!=typeof e)return t;if(!qn.test(e))return t.appendChild(Pt.createTextNode(e)),t;e=e.replace(Hn,"<$1>").trim();var n,a=(Dn.exec(e)||["",""])[1].toLowerCase(),r=Ln[a]||Ln._default;r.innerHTML=e;var i=r.getElementsByTagName("script");if(i.length)for(var o,l=0;o=i[l++];)if(Pn[o.type]){var s=Rn.cloneNode(!1);Jt.forEach.call(o.attributes,function(e){s.setAttribute(e.name,e.value)}),s.text=o.text,o.parentNode.replaceChild(s,o)}for(;n=r.firstChild;)t.appendChild(n);return t},avalon.innerHTML=function(e,t){var n=this.parseHTML(t);this.clearHTML(e).appendChild(n)},avalon.clearHTML=function(e){for(e.textContent="";e.firstChild;)e.removeChild(e.firstChild);return e},"add,remove".replace(Xt,function(e){avalon.fn[e+"Class"]=function(t){var n=this[0];return t&&"string"==typeof t&&n&&1===n.nodeType&&t.replace(/\S+/g,function(t){n.classList[e](t)}),this}}),avalon.fn.mix({hasClass:function(e){var t=this[0]||{};return 1===t.nodeType&&t.classList.contains(e)},toggleClass:function(e,t){for(var n,a=0,r=String(e).split(/\s+/),i="boolean"==typeof t;n=r[a++];){var o=i?t:!this.hasClass(n);this[o?"addClass":"removeClass"](n)}return this},attr:function(e,t){return 2===arguments.length?(this[0].setAttribute(e,t),this):this[0].getAttribute(e)},data:function(e,t){switch(e="data-"+P(e||""),arguments.length){case 2:return this.attr(e,t),this;case 1:var n=this.attr(e);return q(n);case 0:var a={};return Jt.forEach.call(this[0].attributes,function(t){t&&(e=t.name,e.indexOf("data-")||(e=R(e.slice(5)),a[e]=q(t.value)))}),a}},removeData:function(e){return e="data-"+P(e),this[0].removeAttribute(e),this},css:function(e,t){if(avalon.isPlainObject(e))for(var n in e)avalon.css(this,n,e[n]);else var a=avalon.css(this,e,t);return void 0!==a?a:this},position:function(){var e,t,n=this[0],a={top:0,left:0};if(n)return"fixed"===this.css("position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),"HTML"!==e[0].tagName&&(a=e.offset()),a.top+=avalon.css(e[0],"borderTopWidth",!0),a.left+=avalon.css(e[0],"borderLeftWidth",!0),a.top-=e.scrollTop(),a.left-=e.scrollLeft()),{top:t.top-a.top-avalon.css(n,"marginTop",!0),left:t.left-a.left-avalon.css(n,"marginLeft",!0)}},offsetParent:function(){for(var e=this[0].offsetParent;e&&"static"===avalon.css(e,"position");)e=e.offsetParent;return avalon(e||en)},bind:function(e,t,n){return this[0]?avalon.bind(this[0],e,t,n):void 0},unbind:function(e,t,n){return this[0]&&avalon.unbind(this[0],e,t,n),this +},val:function(e){var t=this[0];if(t&&1===t.nodeType){var n=0===arguments.length,a=n?":get":":set",r=Yn[_(t)+a];if(r)var i=r(t,e);else{if(n)return(t.value||"").replace(/\r/g,"");t.value=e}}return n?i:this}}),en.dataset&&(avalon.fn.data=function(e,t){e=e&&R(e);var n=this[0].dataset;switch(arguments.length){case 2:return n[e]=t,this;case 1:return t=n[e],q(t);case 0:var a=r();for(e in n)a[e]=q(n[e]);return a}});var Bn=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/;avalon.parseJSON=JSON.parse,avalon.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){avalon.fn[e]=function(n){var a=this[0]||{},r=B(a),i="scrollTop"===e;return arguments.length?void(r?r.scrollTo(i?r[t]:n,i?n:r[t]):a[e]=n):r?r[t]:a[e]}});var Fn=avalon.cssHooks=r(),_n=["","-webkit-","-moz-","-ms-"],In={"float":"cssFloat"};avalon.cssNumber=l("animationIterationCount,animationIterationCount,columnCount,order,flex,flexGrow,flexShrink,fillOpacity,fontWeight,lineHeight,opacity,orphans,widows,zIndex,zoom"),avalon.cssName=function(e,t,n){if(In[e])return In[e];t=t||en.style;for(var a=0,r=_n.length;r>a;a++)if(n=R(_n[a]+e),n in t)return In[e]=n;return null},Fn["@:set"]=function(e,t,n){e.style[t]=n},Fn["@:get"]=function(e,t){if(!e||!e.style)throw new Error("getComputedStyle要求传入一个节点 "+e);var n,a=getComputedStyle(e);return a&&(n="filter"===t?a.getPropertyValue(t):a[t],""===n&&(n=e.style[t])),n},Fn["opacity:get"]=function(e){var t=Fn["@:get"](e,"opacity");return""===t?"1":t},"top,left".replace(Xt,function(e){Fn[e+":get"]=function(t){var n=Fn["@:get"](t,e);return/px$/.test(n)?n:avalon(t).position()[e]+"px"}});var Vn={position:"absolute",visibility:"hidden",display:"block"},Xn=/^(none|table(?!-c[ea]).+)/;"Width,Height".replace(Xt,function(e){var t=e.toLowerCase(),n="client"+e,a="scroll"+e,r="offset"+e;Fn[t+":get"]=function(t,n,a){var i=-4;"number"==typeof a&&(i=a),n="Width"===e?["Left","Right"]:["Top","Bottom"];var o=t[r];return 2===i?o+avalon.css(t,"margin"+n[0],!0)+avalon.css(t,"margin"+n[1],!0):(0>i&&(o=o-avalon.css(t,"border"+n[0]+"Width",!0)-avalon.css(t,"border"+n[1]+"Width",!0)),-4===i&&(o=o-avalon.css(t,"padding"+n[0],!0)-avalon.css(t,"padding"+n[1],!0)),o)},Fn[t+"&get"]=function(e){var n=[];F(e,n);for(var a,r=Fn[t+":get"](e),i=0;a=n[i++];){e=a.node;for(var o in a)"string"==typeof a[o]&&(e.style[o]=a[o])}return r},avalon.fn[t]=function(i){var o=this[0];if(0===arguments.length){if(o.setTimeout)return o["inner"+e];if(9===o.nodeType){var l=o.documentElement;return Math.max(o.body[a],l[a],o.body[r],l[r],l[n])}return Fn[t+"&get"](o)}return this.css(t,i)},avalon.fn["inner"+e]=function(){return Fn[t+":get"](this[0],void 0,-2)},avalon.fn["outer"+e]=function(e){return Fn[t+":get"](this[0],void 0,e===!0?2:0)}}),avalon.fn.offset=function(){var e=this[0];try{var t=e.getBoundingClientRect();if(t.width||t.height||e.getClientRects().length){var n=e.ownerDocument,a=n.documentElement,r=n.defaultView;return{top:t.top+r.pageYOffset-a.clientTop,left:t.left+r.pageXOffset-a.clientLeft}}}catch(i){return{left:0,top:0}}};var Yn={"select:get":function(e,t){for(var n,a=e.options,r=e.selectedIndex,i="select-one"===e.type||0>r,o=i?null:[],l=i?r+1:a.length,s=0>r?l:i?r:0;l>s;s++)if(n=a[s],(n.selected||s===r)&&!n.disabled){if(t=n.value,i)return t;o.push(t)}return o},"select:set":function(e,t,n){t=[].concat(t);for(var a,r=0;a=e.options[r++];)(a.selected=t.indexOf(a.value)>-1)&&(n=!0);n||(e.selectedIndex=-1)}},Un={},zn=["break,case,catch,continue,debugger,default,delete,do,else,false","finally,for,function,if,in,instanceof,new,null,return,switch,this","throw,true,try,typeof,var,void,while,with","abstract,boolean,byte,char,class,const,double,enum,export,extends","final,float,goto,implements,import,int,interface,long,native","package,private,protected,public,short,static,super,synchronized","throws,transient,volatile","arguments,let,yield,undefined"].join(",");zn.replace(/\w+/g,function(e){Un[e]=!0});var Wn=/[a-z_$]/i,Gn=/[\s\uFEFF\xA0]/,Zn=/(\$proxy\$[a-z]+)\d+$/,Jn=new un(218),Kn=new un(128),Qn=/\)\s*$/,ea=/\)\s*\|/g,ta=/\|\s*([$\w]+)/g,na=/"\s*\["/g,aa=/"\s*\(/g,ra=JSON.stringify;avalon.scan=function(e,t){e=e||en;var n=t?[].concat(t):[];at(e,n)};var ia=l("area,base,basefont,br,col,command,embed,hr,img,input,link,meta,param,source,track,wbr,noscript,script,style,textarea".toUpperCase()),oa=function(e,t,n){var a=e.getAttribute(t);if(a)for(var r,i=0;r=n[i++];)if(r.hasOwnProperty(a)&&"function"==typeof r[a])return r[a]},la=rn&&e.MutationObserver?function(e){for(var t,n=e.firstChild;n;){var a=n.nextSibling;3===n.nodeType?t?(t.nodeValue+=n.nodeValue,e.removeChild(n)):t=n:t=null,n=a}}:0,sa=/^\s*::/,ca=/ms-(\w+)-?(.*)/,ua=l("animationend,blur,change,input,click,dblclick,focus,keydown,keypress,keyup,mousedown,mouseenter,mouseleave,mousemove,mouseout,mouseover,mouseup,scan,scroll,submit"),fa=l("value,title,alt,checked,selected,disabled,readonly,enabled,href,src"),da=/^if|widget|repeat$/,pa=/^each|with|html|include$/,va=/^(ms-\S+|data-\S+|on[a-z]+|id|style|class|tabindex)$/,ha=/\|\s*html(?:\b|$)/,ma=/\|\|/g,ga=/(['"])(\\\1|.)+?\1/g,ya=function(){this.queue=[]};ya.prototype={render:function(e){if(!this.locked){this.locked=e?en.offsetHeight+10:1;var t=this;avalon.nextTick(function(){t.flush()})}},flush:function(){for(var e,t=0;e=this.queue[t++];)e.update();this.locked=0,this.queue=[]}};var ba=new ya,$a=[],xa=[],wa={$construct:function(){return avalon.mix.apply(null,arguments)},$ready:o,$init:o,$dispose:o,$container:null,$childReady:o,$replace:!1,$extend:null,$$template:function(e){return e}};avalon.components={},avalon.component=function(t,n){n&&(avalon.components[t]=avalon.mix({},wa,n));for(var a,r=0;a=$a[r];r++)t===a.fullName&&($a.splice(r,1),r--,function(n,a,r,i){var o=1,l=n.library,s=avalon.libraries[l]||wa,c=et(r),u=lt(n.vmodels,c.config||n.fullName),f=c.$id||c.identifier||an(i);delete c.config,delete c.$id,delete c.identifier;var d={},p=avalon.components[a.$extend];p?(avalon.mix(!0,d,p),d=p.$construct.call(r,d,{},{})):avalon.mix(!0,d,a),d=avalon.components[t].$construct.call(r,d,u,c),d.$refs={},d.$id=f;var v=d.$slot,h=d.$replace,m=d.$container,g=d.$template;delete d.$slot,delete d.$replace,delete d.$container,delete d.$template,delete d.$construct;var y=avalon.define(d)||{};r.msResolved=1,y.$init(y,r),s.$init(y,r);for(var b,$,x=r.childNodes,w={},C=0;$=x[C++];){var T=1===$.nodeType&&$.getAttribute("slot")||v;T&&(w[T]?w[T].push($):w[T]=[$])}y.$$template&&(avalon.clearHTML(r),r.innerHTML=y.$$template(g));for(C in w)if(y.hasOwnProperty(C)){var k=w[C];if(k.length){for(var E=tn.cloneNode(!0),N=0;b=k[N++];)E.appendChild(b);y[C]=E}w[C]=null}w=null;var A=r.firstChild;h&&(A=r.firstChild,r.parentNode.replaceChild(A,r),A.msResolved=1,r=n.element=A),m&&m.appendChild(r),avalon.fireDom(r,"datasetchanged",{library:l,vm:y,childReady:1});var M=0,O=avalon.bind(r,"datasetchanged",function(t){if(t.childReady&&t.library===l&&(o+=t.childReady,y!==t.vm&&(y.$refs[t.vm.$id]=t.vm,-1===t.childReady&&(M++,y.$childReady(y,r,t)),t.stopPropagation())),0===o){var a=setTimeout(function(){clearTimeout(a),y.$ready(y,r),s.$ready(y,r)},M?Math.max(17*M,100):17);avalon.unbind(r,"datasetchanged",O),n.rollback=function(){try{y.$dispose(y,r),s.$dispose(y,r)}catch(e){}delete avalon.vmodels[y.$id]},j(n,xa),e.chrome&&r.addEventListener("DOMNodeRemovedFromDocument",function(){setTimeout(L)})}});if(at(r,[y].concat(n.vmodels)),avalon.vmodels[y.$id]=y,r.childNodes.length)var S=setTimeout(function(){clearTimeout(S),avalon.fireDom(r,"datasetchanged",{library:l,vm:y,childReady:-1})},17);else avalon.fireDom(r,"datasetchanged",{library:l,vm:y,childReady:-1})}(a,avalon.components[t],a.element,a.widget))},avalon.fireDom=function(e,t,n){if(Pt.createEvent){var a=Pt.createEvent("Events");a.initEvent(t,!0,!0,n),avalon.mix(a,n),e.dispatchEvent(a)}else en.contains(e)&&(a=Pt.createEventObject(),avalon.mix(a,n),e.fireEvent("on"+t,a))},avalon.libraries=[],avalon.library=function(e,t){Pt.namespaces&&Pt.namespaces.add(e,"http://www.w3.org/1999/xhtml"),avalon.libraries[e]=avalon.mix({$init:o,$ready:o,$dispose:o},t||{})},avalon.library("ms");var Ca=["autofocus,autoplay,async,allowTransparency,checked,controls","declare,disabled,defer,defaultChecked,defaultSelected","contentEditable,isMap,loop,multiple,noHref,noResize,noShade","open,readOnly,selected"].join(","),Ta={};Ca.replace(Xt,function(e){Ta[e.toLowerCase()]=e});var ka={"accept-charset":"acceptCharset","char":"ch",charoff:"chOff","class":"className","for":"htmlFor","http-equiv":"httpEquiv"},Ea=["accessKey,bgColor,cellPadding,cellSpacing,codeBase,codeType,colSpan","dateTime,defaultValue,frameBorder,longDesc,maxLength,marginWidth,marginHeight","rowSpan,tabIndex,useMap,vSpace,valueType,vAlign"].join(",");Ea.replace(Xt,function(e){ka[e.toLowerCase()]=e});var Na=avalon.directive("attr",{init:function(e){if(e.expr=z(e.expr.trim()),"include"===e.type){var t=e.element;pt(t,e),e.includeRendered=oa(t,"data-include-rendered",e.vmodels),e.includeLoaded=oa(t,"data-include-loaded",e.vmodels);var n=e.includeReplace=!!avalon(t).data("includeReplace");avalon(t).data("includeCache")&&(e.templateCache={}),e.start=Pt.createComment("ms-include"),e.end=Pt.createComment("ms-include-end"),n?(e.element=e.end,e._element=t,t.parentNode.insertBefore(e.end,t),t.parentNode.insertBefore(e.start,e.end)):(t.insertBefore(e.start,t.firstChild),t.appendChild(e.end))}},update:function(t){var n=this.element,a=this.param;if("href"===a||"src"===a){if("string"!=typeof t||en.hasAttribute||(t=t.replace(/&/g,"&")),n[a]=t,e.chrome&&"EMBED"===n.tagName){var r=n.parentNode,i=document.createComment("ms-src");r.replaceChild(i,n),r.replaceChild(n,i)}}else{var o=t===!1||null===t||void 0===t;!Qt&&ka[a]&&(a=ka[a]);var l=Ta[a];if("boolean"==typeof n[l]&&(n[l]=!!t,t||(o=!0)),o)return n.removeAttribute(a);var s=Ut.test(n)?!1:Pt.namespaces&&isVML(n)?!0:a in n.cloneNode(!1);s?n[a]=t+"":n.setAttribute(a,t)}}});"title,alt,src,value,css,include,href".replace(Xt,function(e){cn[e]=Na}),avalon.directive("class",{init:function(e){var t=e.param,a=e.type;if(!t||isFinite(t)?(e.param="",cn.effect.init(e)):(n("ms-"+a+'-xxx="yyy"这种用法已经过时,请使用ms-'+a+'="xxx:yyy"'),e.expr="["+ra(t)+","+e.expr+"]",e.oldStyle=t),"hover"===a||"active"===a){if(!e.hasBindEvent){var r=e.element,i=avalon(r),o="mouseenter",l="mouseleave";if("active"===a){r.tabIndex=r.tabIndex||-1,o="mousedown",l="mouseup";var s=i.bind("mouseleave",function(){e.toggleClass&&i.removeClass(e.newClass)})}}var c=i.bind(o,function(){e.toggleClass&&i.addClass(e.newClass)}),u=i.bind(l,function(){e.toggleClass&&i.removeClass(e.newClass)});e.rollback=function(){i.unbind("mouseleave",s),i.unbind(o,c),i.unbind(l,u)},e.hasBindEvent=!0}},update:function(e){var t=this,n=avalon(this.element);t.newClass=e[0],t.toggleClass=!!e[1],t.oldClass&&t.newClass!==t.oldClass&&n.removeClass(t.oldClass),t.oldClass=t.newClass,"class"===t.type&&(t.oldStyle?n.toggleClass(t.oldStyle,!!e[1]):n.toggleClass(t.newClass,t.toggleClass))}}),"hover,active".replace(Xt,function(e){cn[e]=cn["class"]}),avalon.directive("css",{init:cn.attr.init,update:function(e){avalon(this.element).css(this.param,e)}}),avalon.directive("data",{priority:100,update:function(e){var t=this.element,n="data-"+this.param;e&&"object"==typeof e?t[n]=e:t.setAttribute(n,String(e))}});{var Aa=/^(?:checkbox|radio)$/,Ma=/^(?:radio|checked)$/;avalon.directive("duplex",{priority:2e3,init:function(e,t){function a(t){e.changed.call(this,t,e)}function r(){d=!0}function i(){d=!1}var s=e.element,c=e.vmodels;e.changed=oa(s,"data-duplex-changed",c)||o;var u=[],f=l("string,number,boolean,checked");"radio"===s.type&&""===e.param&&(e.param="checked"),e.param.replace(Yt,function(a){Aa.test(s.type)&&Ma.test(a)&&("radio"===a&&n("ms-duplex-radio已经更名为ms-duplex-checked"),a="checked",e.isChecked=!0,e.xtype="radio"),"bool"===a?(a="boolean",n("ms-duplex-bool已经更名为ms-duplex-boolean")):"text"===a&&(a="string",n("ms-duplex-text已经更名为ms-duplex-string")),f[a]&&(t=!0),avalon.Array.ensure(u,a)}),t||u.push("string"),e.param=u.join("-"),e.changed=oa(s,"binding-duplex-changed",c)||o,e.xtype||(e.xtype="SELECT"===s.tagName?"select":"checkbox"===s.type?"checkbox":"radio"===s.type?"radio":/^change/.test(s.getAttribute("data-duplex-event"))?"change":"input"),e.bound=function(t,n){s.addEventListener(t,n,!1);var a=e.rollback;e.rollback=function(){s.avalonSetter=null,avalon.unbind(s,t,n),a&&a()}};var d=!1,p=function(){var t=s.value;if(!d&&t!==e.oldValue){var n=e.pipe(t,e,"get");e.setter(n),a.call(s,n)}};switch(e.xtype){case"radio":e.bound("click",function(){var t=e.pipe(s.value,e,"get");e.setter(t),a.call(s,t)});break;case"checkbox":e.bound("change",function(){var t=s.checked?"ensure":"remove",r=e.getter.apply(0,e.vmodels);Array.isArray(r)||(n("ms-duplex应用于checkbox上要对应一个数组"),r=[r]);var i=e.pipe(s.value,e,"get");avalon.Array[t](r,i),a.call(s,r)});break;case"change":e.bound("change",p);break;case"input":rn?e.bound("input",p):(e.bound("input",p),e.bound("compositionstart",r),e.bound("compositionend",i),e.bound("DOMAutoComplete",p));break;case"select":e.bound("change",function(){var t=avalon(s).val();t=Array.isArray(t)?t.map(function(t){return e.pipe(t,e,"get")}):e.pipe(t,e,"get"),t+""!==e.oldValue&&(e.setter(t),a.call(s,t))})}"input"===e.xtype&&/^(text|password|hidden)/.test(s.type)&&ja(function(){if(en.contains(s))e.oldValue!==s.value&&p();else if(!s.msRetain)return!1}),s.avalonSetter=p;for(var v in avalon.vmodels){var h=avalon.vmodels[v];h.$fire("avalon-ms-duplex-init",e)}var m=e.pipe||(e.pipe=ut);m(null,e,"init")},update:function(e){var t,n=this.element,a=this;switch(this.xtype){case"input":case"change":t=this.pipe(e,this,"set"),t!==this.oldValue&&(n.value=this.oldValue=t);break;case"radio":t=a.isChecked?!!e:e+""===n.value,n.checked=t;break;case"checkbox":var r=[].concat(e);t=this.pipe(n.value,this,"get"),n.checked=r.indexOf(t)>-1;break;case"select":a._value=e,n.msHasEvent="selectDuplex",avalon.bind(n,"datasetchanged",function(e){if("selectDuplex"===e.bubble){var t=a._value,r=Array.isArray(t)?t.map(String):t+"";avalon(n).val(r),n.oldValue=r+"",a.changed.call(n,r)}})}"select"!==a.xtype&&a.changed.call(n,t)}})}avalon.duplexHooks={checked:{get:function(e,t){return!t.element.oldValue}},string:{get:function(e){return e},set:ct},"boolean":{get:function(e){return"true"===e},set:ct},number:{get:function(e,t){var n=parseFloat(e);if(-e===-n)return n;var a=/strong|medium|weak/.exec(t.element.getAttribute("data-duplex-number"))||["medium"];switch(a[0]){case"strong":return 0;case"medium":return""===e?"":0;case"weak":return e}},set:ct}};var Oa,Sa=[];avalon.tick=function(e){1===Sa.push(e)&&(Oa=setInterval(ft,60))};var ja=o;!new function(){function e(e){t[this.tagName].call(this,e),"function"==typeof this.avalonSetter&&this.oldValue!==e&&this.avalonSetter()}try{var t={},n=HTMLInputElement.prototype,a=HTMLTextAreaElement.prototype,r=HTMLInputElement.prototype;Object.getOwnPropertyNames(r),t.INPUT=Object.getOwnPropertyDescriptor(n,"value").set,Object.defineProperty(n,"value",{set:e}),t.TEXTAREA=Object.getOwnPropertyDescriptor(a,"value").set,Object.defineProperty(a,"value",{set:e})}catch(i){ja=avalon.tick}},avalon.directive("effect",{priority:5,init:function(e){var t,n,a=e.expr,r=a.replace(gn,function(e){return e.replace(/./g,"0")}).indexOf(":");-1===r?(t=a,n=!0):(t=a.slice(0,r),n=a.slice(r+1)),t=mn.test(a)?z(t):ra(t),e.expr="["+t+","+n+"]"},update:function(t){var n=t[0],a=this.element;if(a.getAttribute("data-effect-name")!==n){a.removeAttribute("data-effect-driver");var r=a.style,i=e.getComputedStyle?e.getComputedStyle(a):null,o=!1;if(i&&(Ha||Pa)){var l=r[Ra]||i[Ra];l&&"0s"!==l&&(a.setAttribute("data-effect-driver","t"),o=!0),o||(l=r[qa]||i[qa],l&&"0s"!==l&&(a.setAttribute("data-effect-driver","a"),o=!0))}o||avalon.effects[n]&&(a.setAttribute("data-effect-driver","j"),o=!0),o&&a.setAttribute("data-effect-name",n)}}}),avalon.effects={},avalon.effect=function(e,t){avalon.effects[e]=t};var La,Da,Ha=!1,Pa=!1,Ra=avalon.cssName("transition-duration"),qa=avalon.cssName("animation-duration");!new function(){var t,n={TransitionEvent:"transitionend",WebKitTransitionEvent:"webkitTransitionEnd",OTransitionEvent:"oTransitionEnd",otransitionEvent:"otransitionEnd"};for(var a in n){if(e[a]){t=n[a];break}try{{document.createEvent(a)}t=n[a];break}catch(r){}}"string"==typeof t&&(Ha=!0,La=t),n={AnimationEvent:"animationend",WebKitAnimationEvent:"webkitAnimationEnd"};var i;for(a in n)if(e[a]){i=n[a];break}"string"==typeof i&&(Ha=!0,Da=i)};var Ba=[],Fa=new ya;ht.prototype={contrustor:ht,enterClass:function(){return mt(this,"enter")},leaveClass:function(){return mt(this,"leave")},actionFun:function(e,t,n){if(!document.hidden){var a=this,r=a.el,i="leave"===e;e=i?"leave":"enter";var o=i?"enter":"leave";gt(a,"abort"+vt(o)),gt(a,"before"+vt(e)),i||t(r);var l=function(o){r.removeEventListener(a.cssEvent,a.cssCallback),i?(t(r),avalon(r).removeClass(a.cssClass)):"a"===a.driver&&avalon(r).removeClass(a.cssClass),o!==!0&&(gt(a,"after"+vt(e)),n&&n(r)),a.dispose()};a.useCss?(a.cssCallback&&a.cssCallback(!0),a.cssClass=mt(a,e),a.cssCallback=l,a.update=function(){r.addEventListener(a.cssEvent,a.cssCallback),i||"t"!==a.driver||avalon(r).removeClass(a.cssClass)},avalon(r).addClass(a.cssClass),Fa.render(!0),Fa.queue.push(a)):gt(a,e,l)}},enter:function(){this.actionFun.apply(this,["enter"].concat(avalon.slice(arguments)))},leave:function(){this.actionFun.apply(this,["leave"].concat(avalon.slice(arguments)))},dispose:function(){this.update=this.cssCallback=null,Ba.unshift(this)>100&&Ba.pop()}};var _a=function(e,t){var n=Kt.call(arguments,0);"function"!=typeof n[2]&&n.splice(2,0,o),"function"!=typeof n[3]&&n.splice(3,0,o);var a=n[2],r=n[3],i=n[4],l=dt(e,i);if(!l)return a(),r(),!1;var s=t?"enter":"leave";l[s](a,r)};avalon.mix(avalon.effect,{apply:_a,append:function(e,t,n,a){return _a(e,1,function(){t.appendChild(e)},n,a)},before:function(e,t,n,a){return _a(e,1,function(){t.parentNode.insertBefore(e,t)},n,a)},remove:function(e,t,n,a){return _a(e,0,function(){e.parentNode===t&&t.removeChild(e)},n,a)}}),avalon.directive("html",{update:function(e){var t=this,n=this.element,a=1!==n.nodeType,r=a?n.parentNode:n;if(r){if(e=null==e?"":e,3===n.nodeType){var i=an("html");r.insertBefore(Pt.createComment(i),n),t.element=Pt.createComment(i+":end"),r.replaceChild(t.element,n),n=t.element}if("object"!=typeof e)var o=avalon.parseHTML(String(e));else if(11===e.nodeType)o=e;else if(1===e.nodeType||e.item){var l=1===e.nodeType?e.childNodes:e.item;for(o=tn.cloneNode(!0);l[0];)o.appendChild(l[0])}if(l=avalon.slice(o.childNodes),a){for(var s=n.nodeValue.slice(0,-4);;){var c=n.previousSibling;if(!c||8===c.nodeType&&c.nodeValue===s)break;r.removeChild(c)}r.insertBefore(o,n)}else avalon.clearHTML(n).appendChild(o);nt(l,t.vmodels)}}}),avalon.directive("if",{priority:10,update:function(e){function t(){r.getAttribute(a.name)&&(r.removeAttribute(a.name),Q(r,a.vmodels)),a.rollback=null}var n,a=this,r=this.element,i=a.stamp=+new Date,o=function(){i===a.stamp&&(a.recoverNode=null)};a.recoverNode&&a.recoverNode();try{if(!r.parentNode)return;n=r.parentNode}catch(l){return}if(e){if(8===r.nodeType){var s=a.keep,c=avalon.effect.apply(s,1,function(){i===a.stamp&&(r.parentNode.replaceChild(s,r),r=a.element=s,s.getAttribute("_required")&&(r.required=!0,r.removeAttribute("_required")),r.querySelectorAll&&avalon.each(r.querySelectorAll("[_required=true]"),function(e){e.required=!0,e.removeAttribute("_required")}),t())},o);c=c===!1}c||t()}else if(1===r.nodeType){r.required===!0&&(r.required=!1,r.setAttribute("_required","true"));try{avalon.each(r.querySelectorAll(":required"),function(e){r.required=!1,e.setAttribute("_required","true")})}catch(l){}var u=a.element=Pt.createComment("ms-if"),f=r.nextSibling;a.recoverNode=function(){a.recoverNode=null,u.parentNode!==n&&(n.insertBefore(u,f),a.keep=r)},avalon.effect.apply(r,0,function(){a.recoverNode=null,i===a.stamp&&(r.parentNode.replaceChild(u,r),a.keep=r,Bt.appendChild(r),a.rollback=function(){r.parentNode===Bt&&Bt.removeChild(r)})},o)}}});var Ia=function(){return new e.XMLHttpRequest},Va=avalon.templateCache={};avalon.directive("include",{init:cn.attr.init,update:function(e){var t=this,n=this.element,a=t.vmodels,r=t.includeRendered,i=t.effectName&&t.effectClass,o=t.templateCache,l=t.includeReplace,s=t.includeLoaded,c=l?n.parentNode:n,u=t._element;t.recoverNodes=t.recoverNodes||avalon.noop;var f=(l&&u.cloneNode(),function(f){var d=t._stamp=+new Date;if(s){var p=s.apply(c,[f].concat(a));"string"==typeof p&&(f=p)}r&&G(c,function(){r.call(c)},0/0);var v=t.includeLastID||"_default";t.includeLastID=e;var h=o&&o[v]||Pt.createElement(n.tagName||t._element.tagName);i&&(h.className=i,c.insertBefore(h,t.start)),(o||{})[v]=h;var m=t.recoverNodes();for(m&&c.insertBefore(m,t.end);;){var g=t.start.nextSibling;if(!g||g===h||g===t.end)break;h.appendChild(g)}avalon.effect.remove(h,c,function(){o&&d===t._stamp&&Bt.appendChild(h)},t);var y=c,b=avalon.noop,$=avalon.noop,x=yt(t,e,f),w=avalon.slice(x.childNodes);l&&i?(y=u,y.innerHTML="",y.setAttribute("ms-skip","true"),c.insertBefore(y,t.end.nextSibling),b=function(){y.insertBefore(x,null)},$=function(){t.recoverNodes=avalon.noop,d===t._stamp&&(x=bt(w),c.insertBefore(x,t.end),nt(w,a)),y.parentNode===c&&c.removeChild(y)},t.recoverNodes=function(){return t.recoverNodes=avalon.noop,bt(w)}):b=function(){c.insertBefore(x,t.end),nt(w,a)},avalon.effect.apply(y,"enter",b,$)});if("src"===t.param)if("string"==typeof Va[e])avalon.nextTick(function(){f(Va[e])});else if(Array.isArray(Va[e]))Va[e].push(f);else{var d=Ia();d.onload=function(){for(var t,n=d.responseText,a=0;t=Va[e][a++];)t(n);Va[e]=n},Va[e]=[f],d.open("GET",e,!0),"withCredentials"in d&&(d.withCredentials=!0),d.setRequestHeader("X-Requested-With","XMLHttpRequest"),d.send(null)}else{var p=e&&1===e.nodeType?e:Pt.getElementById(e);p&&avalon.nextTick(function(){f(p.value||p.innerText||p.innerHTML)})}}});var Xa=/\(([^)]*)\)/,Ya=avalon.directive("on",{priority:3e3,init:function(e){var t=e.expr;e.type="on";var n=e.param.replace(/-\d+$/,"");if("function"==typeof Ya[n+"Hook"]&&Ya[n+"Hook"](e),t.indexOf("(")>0&&t.indexOf(")")>-1){var a=(t.match(Xa)||["",""])[1].trim();(""===a||"$event"===a)&&(t=t.replace(Xa,""))}e.expr=t},update:function(e){var t=this,n=this.element;e=function(e){var n=t.getter||o;return n.apply(this,t.args.concat(e))};var a=t.param.replace(/-\d+$/,"");if("scan"===a)e.call(n,{type:a});else if("function"==typeof t.specialBind)t.specialBind(n,e);else var r=avalon.bind(n,a,e);t.rollback=function(){"function"==typeof t.specialUnbind?t.specialUnbind():avalon.unbind(n,a,r)}}});avalon.directive("repeat",{priority:90,init:function(e){var t=e.type;e.cache={},e.enterCount=0;var n=e.element;if(1===n.nodeType){n.removeAttribute(e.name),pt(n,e),e.param=e.param||"el",e.sortedCallback=oa(n,"data-with-sorted",e.vmodels);var a=oa(n,"data-"+t+"-rendered",e.vmodels),r=an(t),i=Pt.createComment(r+":start"),o=e.element=Pt.createComment(r+":end");if(e.signature=r,e.start=i,e.template=tn.cloneNode(!1),"repeat"===t){var l=n.parentNode;l.replaceChild(o,n),l.insertBefore(i,o),e.template.appendChild(n)}else{for(;n.firstChild;)e.template.appendChild(n.firstChild);n.appendChild(i),n.appendChild(o),l=n}if(e.element=o,a)var s=avalon.bind(l,"datasetchanged",function(){a.apply(l,l.args),avalon.unbind(l,"datasetchanged",s),l.msRendered=a})}},update:function(e,t){var n=this,a=this.xtype;this.enterCount+=1;var r=!t;if(r){n.$outer={};var i="$key",o="$val";"array"===a&&(i="$first",o="$last");for(var l,s=0;l=n.vmodels[s++];)if(l.hasOwnProperty(i)&&l.hasOwnProperty(o)){n.$outer=l;break}}var c=this.track;if(n.sortedCallback){var u=n.sortedCallback.call($,c);u&&Array.isArray(u)&&(c=u)}var d="move";n.$repeat=e;var p=[],v=r&&tn.cloneNode(!1),h=[],m=this.param,g=avalon.mix({},this.cache),y=this.element,b=c.length,$=y.parentNode;for(s=0;b>s;s++){var x=c[s],w=g[x];if(w)p.push({}),g[x]=!0;else{w=Tt(this),"array"===a?(d="add",w.$id=x,w[m]=e[s]):(d="append",w.$key=x,w.$val=e[x]),this.cache[x]=w;var C=w.$anchor||(w.$anchor=y.cloneNode(!1));C.nodeValue=this.signature,Ct(n,v,w,p,r&&!n.effectDriver),Nt(w,n,a)}1===this.enterCount&&(w.$active=!1,w.$oldIndex=w.$index,w.$active=!0,w.$index=s),"array"===a?(w.$first=0===s,w.$last=s===b-1):w.$val=k(e[x]),h.push(w)}if(this.proxies=h,r&&!n.effectDriver)$.insertBefore(v,y),p.forEach(function(e){nt(e.nodes||[],e.vmodels),e.nodes=e.vmodels=null});else{var T=n.staggerIndex=0;for(x in g)g[x]!==!0&&(d="del",wt(g[x].$anchor,n),Ot(this.cache,x,m),g[x]=null);for(s=0;b>s;s++){w=h[s],x="array"===a?w.$id:w.$key;var E=h[s-1],N=E?E.$anchor:n.start;g[x]?w.$index!==w.$oldIndex&&!function(e,t){T=xt(n.effectEnterStagger,function(){var a=wt(e.$anchor),r=avalon.slice(a.childNodes);$.insertBefore(a,t.nextSibling),$t(r,1,n)},T)}(w,N):!function(e,t){var a=e.nodes,r=e.vmodels;a&&(T=xt(n.effectEnterStagger,function(){$.insertBefore(e.content,t.nextSibling),nt(a,r),$t(a,1,n)},T)),e.nodes=e.vmodels=null}(p[s],N)}}if(!e.$track)for(x in this.cache)Ot(this.cache,x,m);!function(e){$.args=e,$.msRendered&&$.msRendered.apply($,e)}(f.newWatch?arguments:[d]);var A=setTimeout(function(){clearTimeout(A),avalon.fireDom($,"datasetchanged",{bubble:$.msHasEvent})});this.enterCount-=1}}),"with,each".replace(Xt,function(e){cn[e]=avalon.mix({},cn.repeat,{priority:1400})});var Ua=[],za=[];avalon.directive("text",{update:function(e){var t=this.element;if(e=null==e?"":e,3===t.nodeType)try{t.data=e}catch(n){}else t.textContent=e}}),avalon.parseDisplay=St,avalon.directive("visible",{init:function(){},update:function(e){var t=this.element,n=this,a=n.stamp=+new Date;e?(t.style.display="none",avalon.effect.apply(t,1,function(){if(a===n.stamp){var e=t.getAttribute("data-effect-driver")||"a";/^[atn]/.test(e)&&(this.effectName||(t.style.display=""),"none"===avalon(t).css("display")&&(t.style.display=St(t.nodeName)))}})):avalon.effect.apply(t,0,function(){a===n.stamp&&(t.style.display="none")})}});var Wa=/]*>([\S\s]*?)<\/script\s*>/gim,Ga=/\s+(on[^=\s]+)(?:=("[^"]*"|'[^']*'|[^\s>]+))?/g,Za=/<\w+\b(?:(["'])[^"]*?(\1)|[^>])*>/gi,Ja={a:/\b(href)\=("javascript[^"]*"|'javascript[^']*')/gi,img:/\b(src)\=("javascript[^"]*"|'javascript[^']*')/gi,form:/\b(action)\=("javascript[^"]*"|'javascript[^']*')/gi},Ka=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Qa=/([^\#-~| |!])/g,er=avalon.filters={uppercase:function(e){return e.toUpperCase()},lowercase:function(e){return e.toLowerCase()},truncate:function(e,t,n){return t=t||30,n="string"==typeof n?n:"...",e.length>t?e.slice(0,t-n.length)+n:String(e)},$filter:function(e){for(var t=1,n=arguments.length;n>t;t++){var a=arguments[t],r=avalon.filters[a[0]];if("function"==typeof r){var i=[e].concat(a.slice(1));e=r.apply(null,i)}}return e},camelize:R,sanitize:function(e){return e.replace(Wa,"").replace(Za,function(e){var t=e.toLowerCase().match(/<(\w+)\s/);if(t){var n=Ja[t[1]];n&&(e=e.replace(n,function(e,t,n){var a=n.charAt(0);return t+"="+a+"javascript:void(0)"+a}))}return e.replace(Ga," ").replace(/\s+/g," ")})},escape:function(e){return String(e).replace(/&/g,"&").replace(Ka,function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1);return"&#"+(1024*(t-55296)+(n-56320)+65536)+";"}).replace(Qa,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")},currency:function(e,t,n){return(t||"¥")+jt(e,isFinite(n)?n:2)},number:jt};!new function(){function e(e){return parseInt(e,10)||0}function t(e,t,n){var a="";for(0>e&&(a="-",e=-e),e=""+e;e.length0||o>-a)&&(o+=a),0===o&&-12===a&&(o=12),t(o,n,r)}}function a(e,t){return function(n,a){var r=n["get"+e](),i=(t?"SHORT"+e:e).toUpperCase();return a[i][r]}}function r(e){var n=-1*e.getTimezoneOffset(),a=n>=0?"+":"";return a+=t(Math[n>0?"floor":"ceil"](n/60),2)+t(Math.abs(n%60),2)}function i(e,t){return e.getHours()<12?t.AMPMS[0]:t.AMPMS[1]}var o={yyyy:n("FullYear",4),yy:n("FullYear",2,0,!0),y:n("FullYear",1),MMMM:a("Month"),MMM:a("Month",!0),MM:n("Month",2,1),M:n("Month",1,1),dd:n("Date",2),d:n("Date",1),HH:n("Hours",2),H:n("Hours",1),hh:n("Hours",2,-12),h:n("Hours",1,-12),mm:n("Minutes",2),m:n("Minutes",1),ss:n("Seconds",2),s:n("Seconds",1),sss:n("Milliseconds",3),EEEE:a("Day"),EEE:a("Day",!0),a:i,Z:r},l=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,s=/^\/Date\((\d+)\)\/$/;er.date=function(t,n){var a,r,i=er.date.locate,c="",u=[];if(n=n||"mediumDate",n=i[n]||n,"string"==typeof t)if(/^\d+$/.test(t))t=e(t);else if(s.test(t))t=+RegExp.$1;else{var f=t.trim(),d=[0,0,0,0,0,0,0],p=new Date(0);f=f.replace(/^(\d+)\D(\d+)\D(\d+)/,function(t,n,a,r){var i=4===r.length?[r,n,a]:[n,a,r];return d[0]=e(i[0]),d[1]=e(i[1])-1,d[2]=e(i[2]),""});var v=p.setFullYear,h=p.setHours;f=f.replace(/[T\s](\d+):(\d+):?(\d+)?\.?(\d)?/,function(t,n,a,r,i){return d[3]=e(n),d[4]=e(a),d[5]=e(r),i&&(d[6]=Math.round(1e3*parseFloat("0."+i))),""});var m=0,g=0;f=f.replace(/Z|([+-])(\d\d):?(\d\d)/,function(t,n,a,r){return v=p.setUTCFullYear,h=p.setUTCHours,n&&(m=e(n+a),g=e(n+r)),""}),d[3]-=m,d[4]-=g,v.apply(p,d.slice(0,3)),h.apply(p,d.slice(3)),t=p}if("number"==typeof t&&(t=new Date(t)),"date"===avalon.type(t)){for(;n;)r=l.exec(n),r?(u=u.concat(r.slice(1)),n=u.pop()):(u.push(n),n=null);return u.forEach(function(e){a=o[e],c+=a?a(t,i):e.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),c}};var c={AMPMS:{0:"上午",1:"下午"},DAY:{0:"星期日",1:"星期一",2:"星期二",3:"星期三",4:"星期四",5:"星期五",6:"星期六"},MONTH:{0:"1月",1:"2月",2:"3月",3:"4月",4:"5月",5:"6月",6:"7月",7:"8月",8:"9月",9:"10月",10:"11月",11:"12月"},SHORTDAY:{0:"周日",1:"周一",2:"周二",3:"周三",4:"周四",5:"周五",6:"周六"},fullDate:"y年M月d日EEEE",longDate:"y年M月d日",medium:"yyyy-M-d H:mm:ss",mediumDate:"yyyy-M-d",mediumTime:"H:mm:ss","short":"yy-M-d ah:mm",shortDate:"yy-M-d",shortTime:"ah:mm"};c.SHORTMONTH=c.MONTH,er.date.locate=c};var tr=avalon.modules={"domReady!":{exports:avalon,state:3},avalon:{exports:avalon,state:4}};tr.exports=tr.avalon,new function(){function t(e,t){var a="js";e=e.replace(/^(\w+)\!/,function(e,t){return a=t,""}),"ready"===a&&(n("debug: ready!已经被废弃,请使用domReady!"),a="domReady");var r="";e=e.replace(H,function(e){return r=e,""});var i="."+a,o=/js|css/.test(i)?i:"";e=e.replace(/\.[a-z0-9]+$/g,function(e){return e===i?(o=e,""):e});var l=avalon.mix({query:r,ext:o,res:a,name:e,toUrl:m},t);return l.toUrl(e),l}function i(e){var t=e.name,n=e.res,a=tr[t],r=t&&e.urlNoQuery;if(a&&a.state>=1)return t;if(a=tr[r],a&&a.state>=3)return qt(a.deps||[],a.factory,r),r;if(t&&!a){a=tr[r]={id:r,state:1};var i=function(r){D[n]=r,r.load(t,e,function(e){arguments.length&&void 0!==e&&(a.exports=e),a.state=4,c()})};D[n]?i(D[n]):qt([n],i)}return t?r:n+"!"}function l(e,t){for(var n,a=0;n=e[a++];)if(4!==tr[n].state&&(n===t||l(tr[n].deps,t)))return!0}function s(e,t){var a=d(e.src);return e.onload=e.onerror=null,t?(setTimeout(function(){Rt.removeChild(e),e=null}),void n("debug: 加载 "+a+" 失败"+t+" "+!tr[a].state)):!0}function c(){e:for(var e,t=k.length;e=k[--t];){var n=tr[e],a=n.deps;if(a){for(var r,i=0;r=a[i];i++)if(4!==Object(tr[r]).state)continue e;4!==n.state&&(k.splice(t,1),h(n.id,n.deps,n.factory),c())}}}function u(e,t,a){var r=Pt.createElement("script");r.className=Ft,r.onload=function(){var r=E.pop();r&&r.require(t),a&&a(),n("debug: 已成功加载 "+e),t&&k.push(t),c()},r.onerror=function(){s(r,!0)},Rt.insertBefore(r,Rt.firstChild),r.src=e,n("debug: 正准备加载 "+e)}function d(e){return(e||"").replace(H,"")}function p(e){return/^(?:[a-z]+:)?\/\//i.test(String(e))}function v(){var e;try{a.b.c()}catch(t){e=t.stack}if(e)return e=e.split(/[@ ]/g).pop(),e="("===e[0]?e.slice(1,-1):e.replace(/\s/,""),d(e.replace(/(:\d+)?:\d+$/i,""));for(var n,r=Rt.getElementsByTagName("script"),i=r.length;n=r[--i];)if(n.className===Ft&&"interactive"===n.readyState){var o=n.src;return n.className=d(o)}}function h(t,a,i){var o=Object(tr[t]);o.state=4;for(var l,s=0,c=[];l=a[s++];)if("exports"===l){var u=o.exports||(o.exports=r());c.push(u)}else c.push(tr[l].exports);try{var f=i.apply(e,c)}catch(d){n("执行["+t+"]模块的factory抛错: ",d)}return void 0!==f&&(o.exports=f),P.test(t)&&delete tr[t],delete o.factory,f +}function m(e){0===e.indexOf(this.res+"!")&&(e=e.slice(this.res.length+1));var t=e,n=0,a=this.baseUrl,r=this.parentUrl||a;x(e,f.paths,function(e,a){t=t.replace(a,e),n=1}),n||x(e,f.packages,function(e,n,a){t=t.replace(a.name,a.location)}),this.mapUrl&&x(this.mapUrl,f.map,function(e){x(t,e,function(e,n){t=t.replace(n,e),r=a})});var i=this.ext;i&&n&&t.slice(-i.length)===i&&(t=t.slice(0,-i.length)),p(t)||(r=this.built||/^\w/.test(t)?a:r,t=C(r,t));var o=t+i;return t=o+this.query,o=t.replace(H,function(e){return this.query=e,""}),x(e,f.urlArgs,function(e){t+=(-1===t.indexOf("?")?"?":"&")+e}),this.url=t,this.urlNoQuery=o}function g(e,t,n){var a=$(e,t,n);return a.sort(w),a}function y(e){return new RegExp("^"+e+"(/|$)")}function b(t){return function(){var n;return t.init&&(n=t.init.apply(e,arguments)),n||t.exports&&T(t.exports)}}function $(e,t,n){var a=[];for(var r in e){var i={name:r,val:e[r]};a.push(i),i.reg="*"===r&&t?/^/:y(r),n&&"*"!==r&&(i.reg=new RegExp("/"+r.replace(/^\//,"")+"(/|$)"))}return a}function x(e,t,n){t=t||[];for(var a,r=0;a=t[r++];)if(a.reg.test(e))return n(a.val,a.name,a),!1}function w(e,t){var n=e.name,a=t.name;return"*"===a?-1:"*"===n?1:a.length-n.length}function C(e,t){if("/"!==e.charAt(e.length-1)&&(e+="/"),"./"===t.slice(0,2))return e+t.slice(2);if(".."===t.slice(0,2)){for(e+=t;R.test(e);)e=e.replace(R,"");return e}return"/"===t.slice(0,1)?e+t.slice(1):e+t}function T(t){if(!t)return t;var n=e;return t.split(".").forEach(function(e){n=n[e]}),n}var k=[],E=[],N=/\.js$/i,A=[],M=!1;qt=avalon.require=function(e,n,a,l){if(M){Array.isArray(e)||avalon.error("require方法的第一个参数应为数组 "+e);var s=[],u=r(),d=a||"callback"+setTimeout("1");l=l||r(),l.baseUrl=f.baseUrl;var p=!!l.built;if(a&&(l.parentUrl=a.substr(0,a.lastIndexOf("/")),l.mapUrl=a.replace(N,"")),p){var v=t(l.defineName,l);d=v.urlNoQuery}else e.forEach(function(e){var n=t(e,l),a=i(n);a&&(u[a]||(s.push(a),u[a]="司徒正美"))});var h=tr[d];h&&4===h.state||(tr[d]={id:d,deps:p?e.concat():s,factory:n||o,state:3}),h||k.push(d),c()}else if(A.push(avalon.slice(arguments)),arguments.length<=2){M=!0;for(var m,g=A.splice(0,A.length);m=g.shift();)qt.apply(null,m)}},qt.define=function(e,t,n){"string"!=typeof e&&(n=t,t=e,e="anonymous"),Array.isArray(t)||(n=t,t=[]);var a={built:!M,defineName:e},r=[t,n,a];n.require=function(e){if(r.splice(2,0,e),tr[e]){tr[e].state=3;var t=!1;try{t=l(tr[e].deps,e)}catch(a){}t&&avalon.error(e+"模块与之前的模块存在循环依赖,请不要直接用script标签引入"+e+"模块")}delete n.require,qt.apply(null,r)};var i=a.built?"unknown":v();if(i){var o=tr[i];o&&(o.state=2),n.require(i)}else E.push(n)},qt.config=f,qt.define.amd=tr;var O=f["orig.paths"]=r(),S=f["orig.map"]=r(),j=f.packages=[],L=f["orig.args"]=r();avalon.mix($n,{paths:function(e){avalon.mix(O,e),f.paths=g(O)},map:function(e){avalon.mix(S,e);var t=g(S,1,1);avalon.each(t,function(e,t){t.val=g(t.val)}),f.map=t},packages:function(e){e=e.concat(j);for(var t,n=r(),a=[],i=0;t=e[i++];){t="string"==typeof t?{name:t}:t;var o=t.name;if(!n[o]){var l=C(t.location||o,t.main||"main");l=l.replace(N,""),a.push(t),n[o]=t.location=l,t.reg=y(o)}}f.packages=a.sort()},urlArgs:function(e){"string"==typeof e&&(e={"*":e}),avalon.mix(L,e),f.urlArgs=g(L,1)},baseUrl:function(e){if(!p(e)){var t=Rt.getElementsByTagName("base")[0];t&&Rt.removeChild(t);var n=Pt.createElement("a");n.href=e,e=n.href,t&&Rt.insertBefore(t,Rt.firstChild)}e.length>3&&(f.baseUrl=e)},shim:function(e){for(var t in e){var n=e[t];Array.isArray(n)&&(n=e[t]={deps:n}),n.exportsFn||!n.exports&&!n.init||(n.exportsFn=b(n))}f.shim=e}});var D=qt.plugins={domReady:{load:o},js:{load:function(e,t,n){var a=t.url,r=t.urlNoQuery,i=f.shim[e.replace(N,"")];i?qt(i.deps||[],function(){var e=avalon.slice(arguments);u(a,r,function(){n(i.exportsFn?i.exportsFn.apply(0,e):void 0)})}):u(a,r)}},css:{load:function(e,t,a){var r=t.url;Rt.insertAdjacentHTML("afterBegin",''),n("debug: 已成功加载 "+r),a()}},text:{load:function(e,t,a){var r=t.url,i=Ia();i.onload=function(){var e=i.status;e>399&&600>e?avalon.error(r+" 对应资源不存在或没有开启 CORS"):(n("debug: 已成功加载 "+r),a(i.responseText))};var o="_="+(new Date-0),l=-1===r.indexOf("?")?r+"?"+o:r+"&"+o;i.open("GET",l,!0),"withCredentials"in i&&(i.withCredentials=!0),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.send(),n("debug: 正准备加载 "+r)}}};qt.checkDeps=c;var H=/(\?[^#]*)$/,P=/^callback\d+$/,R=/\/\w+\/\.\./,q=Pt.scripts[Pt.scripts.length-1],B=q.getAttribute("data-main");if(B){$n.baseUrl(B);var F=f.baseUrl;f.baseUrl=F.slice(0,F.lastIndexOf("/")+1),u(F.replace(N,"")+".js")}else{var _=d(q.src);f.baseUrl=_.slice(0,_.lastIndexOf("/")+1)}};var nr,ar=[],rr=function(e){for(nr=!0,qt&&(tr["domReady!"].state=4,qt.checkDeps());e=ar.shift();)e(avalon)};"complete"===Pt.readyState?setTimeout(rr):Pt.addEventListener("DOMContentLoaded",rr),e.addEventListener("load",rr),avalon.ready=function(e){nr?e(avalon):ar.push(e)},avalon.config({loader:!0}),avalon.ready(function(){avalon.scan(Pt.body)});var ir=navigator.userAgent.toLowerCase(),or=ir.indexOf("android")>0,lr=Lt(),sr=avalon.gestureHooks={pointers:{},start:function(e,t){for(var n=0;n0){var o=70;i>o&&(i=o),r.duration+i>o&&(r.duration=o-i),r.duration+=i,r.lastTouch=Dt({},a),r.lastTime=Date.now(),r.deltaX=a.clientX-r.startTouch.clientX,r.deltaY=a.clientY-r.startTouch.clientY;var l=r.deltaX*r.deltaX,s=r.deltaY*r.deltaY;r.distance=Math.sqrt(l+s),r.isVertical=!(l>s),t(r,a)}}},end:function(e,t){for(var n=0;nn.offsetHeight){t=n,e.tapScrollParent=n;break}n=n.parentElement}while(n)}t&&(t.lastScrollTop=t.scrollTop)},touchHasMoved:function(e){var t=e.changedTouches[0],n=fr.touchBoundary;return Math.abs(t.pageX-fr.touchStartX)>n||Math.abs(t.pageY-fr.touchStartY)>n},findControl:function(e){return void 0!==e.control?e.control:e.htmlFor?document.getElementById(e.htmlFor):e.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")},findType:function(e){return or&&"select"===e.tagName.toLowerCase()?"mousedown":"click"},sendClick:function(t,n){sr.fire(t,"tap",{touchEvent:n});var a,r;document.activeElement&&document.activeElement!==t&&document.activeElement.blur(),r=n.changedTouches[0],a=document.createEvent("MouseEvents"),a.initMouseEvent(fr.findType(t),!0,!0,e,1,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),a.touchEvent=n,t.dispatchEvent(a)},touchstart:function(t){if(1!==t.targetTouches.length)return!0;var n=fr.fixTarget(t.target),a=t.targetTouches[0];if(lr){var r=e.getSelection();if(r.rangeCount&&!r.isCollapsed)return!0;var i=a.identifier;if(i&&isFinite(fr.lastTouchIdentifier)&&fr.lastTouchIdentifier===i)return t.preventDefault(),!1;fr.lastTouchIdentifier=i,fr.updateScrollParent(n)}fr.status="tapping",fr.startTime=Date.now(),fr.element=n,fr.pageX=a.pageX,fr.pageY=a.pageY,fr.startTime-fr.lastTimefr.tapDelay)return!0;fr.lastTime=a;var r=fr.startTime;if(fr.status=fr.startTime=0,targetTagName=n.tagName.toLowerCase(),"label"===targetTagName){sr.fire(n,"tap",{touchEvent:t});var i=fr.findControl(n);i&&(fr.focus(n),n=i)}else if(fr.needFocus(n))return a-r>100||lr&&e.top!==e&&"input"===targetTagName?(fr.element=0,!1):(fr.focus(n),or&&fr.sendClick(n,t),!1);if(lr){var o=n.tapScrollParent;if(o&&o.lastScrollTop!==o.scrollTop)return!0}fr.needClick(n)||(t.preventDefault(),fr.sendClick(n,t))},touchcancel:function(){fr.startTime=fr.element=0}};sr.add("tap",fr);var dr={events:["longtap","doubletap"],cancelPress:function(e){clearTimeout(e.pressingHandler),e.pressingHandler=null},touchstart:function(e){sr.start(e,function(t,n){t.pressingHandler=setTimeout(function(){"tapping"===t.status&&sr.fire(e.target,"longtap",{touch:n,touchEvent:e}),dr.cancelPress(t)},500),1!==e.changedTouches.length&&(t.status=0)})},touchmove:function(e){sr.move(e,function(e){e.distance>10&&e.pressingHandler&&(dr.cancelPress(e),"tapping"===e.status&&(e.status="panning"))})},touchend:function(e){sr.end(e,function(t,n){dr.cancelPress(t),"tapping"===t.status&&(t.lastTime=Date.now(),dr.lastTap&&t.lastTime-dr.lastTap.lastTime<300&&sr.fire(t.element,"doubletap",{touch:n,touchEvent:e}),dr.lastTap=t)})},touchcancel:function(e){sr.end(e,function(e){dr.cancelPress(e)})}};sr.add("press",dr);var pr={events:["swipe","swipeleft","swiperight","swipeup","swipedown"],getAngle:function(e,t){var n=Math.atan2(t,e),a=Math.round(180*n/Math.PI);return 0>a?360-Math.abs(a):a},getDirection:function(e,t){var n=pr.getAngle(e,t);return 45>=n&&n>=0?"left":360>=n&&n>=315?"left":n>=135&&225>=n?"right":n>45&&135>n?"down":"up"},touchstart:function(e){sr.start(e,o)},touchmove:function(e){sr.move(e,o)},touchend:function(e){1===e.changedTouches.length&&sr.end(e,function(t,n){var a=t.distance>30&&t.distance/t.duration>.65;if(a){var r={deltaX:t.deltaX,deltaY:t.deltaY,touch:n,touchEvent:e,direction:pr.getDirection(t.deltaX,t.deltaY),isVertical:t.isVertical},i=t.element;sr.fire(i,"swipe",r),sr.fire(i,"swipe"+r.direction,r)}})}};pr.touchcancel=pr.touchend,sr.add("swipe",pr),"function"==typeof define&&define.amd&&define("avalon",[],function(){return avalon});var vr=e.avalon;return avalon.noConflict=function(t){return t&&e.avalon===avalon&&(e.avalon=vr),avalon},void 0===t&&(e.avalon=avalon),avalon}); \ No newline at end of file diff --git a/dist/avalon.mobile.shim.js b/dist/avalon.mobile.shim.js index b7ac5ca1c..5453ecc27 100644 --- a/dist/avalon.mobile.shim.js +++ b/dist/avalon.mobile.shim.js @@ -5,7 +5,7 @@ http://weibo.com/jslouvre/ Released under the MIT license - avalon.mobile.shim.js 1.5.3 built in 2015.10.4 + avalon.mobile.shim.js 1.5.3 built in 2015.10.9 mobile ==================================================*/ (function(global, factory) { @@ -870,7 +870,7 @@ function observeObject(source, options) { options = options || nullObject var force = options.force || nullObject var old = options.old - var oldAccessors = typeof old === "object" ? old.$accessors : nullObject + var oldAccessors = old && old.$accessors || nullObject var $vmodel = new Component() //要返回的对象, 它在IE6-8下可能被偷龙转凤 var accessors = {} //监控属性 var hasOwn = {} @@ -2678,10 +2678,10 @@ function scanExpr(str) { } function scanText(textNode, vmodels, index) { - var bindings = [] + var bindings = [], tokens = scanExpr(textNode.data) if (tokens.length) { - for (var i = 0; token = tokens[i++];) { + for (var i = 0, token; token = tokens[i++];) { var node = DOC.createTextNode(token.expr) //将文本转换为文本节点,并替换原来的文本节点 if (token.type) { token.expr = token.expr.replace(roneTime, function () { @@ -5049,7 +5049,91 @@ function iOSversion() { var deviceIsAndroid = ua.indexOf('android') > 0 var deviceIsIOS = iOSversion() -avalon.gestureHooks = { +var gestureHooks = avalon.gestureHooks = { + pointers: {}, + start: function (event, callback) { + + //touches是当前屏幕上所有触摸点的列表; + //targetTouches是当前对象上所有触摸点的列表; + //changedTouches是涉及当前事件的触摸点的列表。 + for (var i = 0; i < event.changedTouches.length; i++) { + var touch = event.changedTouches[i] + var pointer = { + startTouch: mixTouchAttr({}, touch), + startTime: Date.now(), + status: 'tapping', + element: event.target + } + gestureHooks.pointers[touch.identifier] = pointer; + callback(pointer, touch) + + } + }, + move: function (event, callback) { + for (var i = 0; i < event.changedTouches.length; i++) { + var touch = event.changedTouches[i] + var pointer = gestureHooks.pointers[touch.identifier] + if (!pointer) { + return + } + + if (!("lastTouch" in pointer)) { + pointer.lastTouch = pointer.startTouch + pointer.lastTime = pointer.startTime + pointer.deltaX = pointer.deltaY = pointer.duration = pointer.distance = 0 + } + + var time = Date.now() - pointer.lastTime + + if (time > 0) { + + var RECORD_DURATION = 70 + if (time > RECORD_DURATION) { + time = RECORD_DURATION + } + if (pointer.duration + time > RECORD_DURATION) { + pointer.duration = RECORD_DURATION - time + } + + + pointer.duration += time; + pointer.lastTouch = mixTouchAttr({}, touch) + + pointer.lastTime = Date.now() + + pointer.deltaX = touch.clientX - pointer.startTouch.clientX + pointer.deltaY = touch.clientY - pointer.startTouch.clientY + var x = pointer.deltaX * pointer.deltaX + var y = pointer.deltaY * pointer.deltaY + pointer.distance = Math.sqrt(x + y) + pointer.isVertical = !(x > y) + + callback(pointer, touch) + } + } + }, + end: function (event, callback) { + for (var i = 0; i < event.changedTouches.length; i++) { + var touch = event.changedTouches[i], + id = touch.identifier, + pointer = gestureHooks.pointers[id] + + if (!pointer) + continue + + callback(pointer, touch) + + delete gestureHooks.pointers[id] + } + }, + fire: function (elem, type, props) { + if (elem) { + var event = document.createEvent('Events') + event.initEvent(type, true, true) + avalon.mix(event, props) + elem.dispatchEvent(event) + } + }, add: function (name, gesture) { function move(event) { gesture.touchmove(event) @@ -5058,40 +5142,40 @@ avalon.gestureHooks = { function end(event) { gesture.touchend(event) - document.removeEventListener("touchmove", move, false) + document.removeEventListener('touchmove', move) - document.removeEventListener("touchend", end, false) + document.removeEventListener('touchend', end) - document.removeEventListener("touchcancel", cancel, false) + document.removeEventListener('touchcancel', cancel) } function cancel(event) { gesture.touchcancel(event) - document.removeEventListener("touchmove", move, false) + document.removeEventListener('touchmove', move) - document.removeEventListener("touchend", end, false) + document.removeEventListener('touchend', end) - document.removeEventListener("touchcancel", cancel, false) + document.removeEventListener('touchcancel', cancel) } gesture.events.forEach(function (eventName) { avalon.eventHooks[eventName] = { fn: function (el, fn) { - if (!el.getAttribute("data-" + name)) { - el.setAttribute("data-" + name, "1") - el.addEventListener("touchstart", function (event) { + if (!el.getAttribute('data-' + name)) { + el.setAttribute('data-' + name, '1') + el.addEventListener('touchstart', function (event) { gesture.touchstart(event) - document.addEventListener("touchmove", move, false) + document.addEventListener('touchmove', move) - document.addEventListener("touchend", end, false) + document.addEventListener('touchend', end) - document.addEventListener("touchcancel", cancel, false) + document.addEventListener('touchcancel', cancel) - }, false) + }) } return fn } @@ -5099,7 +5183,9 @@ avalon.gestureHooks = { }) } } -var gestures = {} + + + var touchkeys = ['screenX', 'screenY', 'clientX', 'clientY', 'pageX', 'pageY'] // 复制 touch 对象上的有用属性到固定对象上 @@ -5112,128 +5198,21 @@ function mixTouchAttr(target, source) { return target } -function startGesture(event, callback) { - for (var i = 0; i < event.changedTouches.length; i++) { - var touch = event.changedTouches[i] - - var gesture = { - startTouch: mixTouchAttr({}, touch), - startTime: Date.now(), - status: 'tapping', - element: event.target - }; - callback(gesture, event) - gestures[touch.identifier] = gesture; - } -} -function moveGesture(event, callback) { - for (var i = 0; i < event.changedTouches.length; i++) { - var touch = event.changedTouches[i], - gesture = gestures[touch.identifier]; - - if (!gesture) { - return; - } - if (typeof gesture._movestart === 'boolean') { - gesture._movestart = !!gesture._movestart - } - - if (!gesture.lastTouch) { - gesture.lastTouch = gesture.startTouch - } - if (!gesture.lastTime) { - gesture.lastTime = gesture.startTime - } - - if (!gesture.duration) { - gesture.duration = 0 - } - - var time = Date.now() - gesture.lastTime - - if (time > 0) { - - var RECORD_DURATION = 70 - if (time > RECORD_DURATION) { - time = RECORD_DURATION - } - if (gesture.duration + time > RECORD_DURATION) { - gesture.duration = RECORD_DURATION - time - } - - - gesture.duration += time; - - gesture.lastTouch = mixTouchAttr({}, touch) - - gesture.lastTime = Date.now() - - var displacementX = touch.clientX - gesture.startTouch.clientX - var displacementY = touch.clientY - gesture.startTouch.clientY - gesture.distance = Math.sqrt(Math.pow(displacementX, 2) + Math.pow(displacementY, 2)); - gesture.isVertical = !(Math.abs(displacementX) > Math.abs(displacementY)) - - callback(gesture, touch) - } - } -} - -function endGesture(event, callback) { - for (var i = 0; i < event.changedTouches.length; i++) { - var touch = event.changedTouches[i], - id = touch.identifier, - gesture = gestures[id] - if (!gesture) - continue + - callback(gesture, touch) +var supportPointer = !!navigator.pointerEnabled || !!navigator.msPointerEnabled - delete gestures[id] - } -} - -function fireGesture(elem, type, props) { - if (elem) { - var event = document.createEvent('Events') - event.initEvent(type, true, true) - avalon.mix(event, props) - elem.dispatchEvent(event) - } +if (supportPointer) { // 支持pointer的设备可用样式来取消click事件的300毫秒延迟 + root.style.msTouchAction = root.style.touchAction = 'none' } -var fastClick = { - trackingClick: false, - trackingClickStart: 0, - targetElement: null, - touchStartX: 0, - touchStartY: 0, +var tapGesture = { + events: ['tap', 'click'], touchBoundary: 10, tapDelay: 200, - sendClick: function (targetElement, event) { - // 在click之前触发tap事件 - fireGesture(targetElement, 'tap', { - fastclick: true - }) - var clickEvent, touch - - // On some Android devices activeElement needs to be blurred otherwise the synthetic click will have no effect (#24) - if (document.activeElement && document.activeElement !== targetElement) { - document.activeElement.blur() - } - - touch = event.changedTouches[0] - - // Synthesise a click event, with an extra attribute so it can be tracked - clickEvent = document.createEvent('MouseEvents') - clickEvent.initMouseEvent('click', true, true, window, 1, touch.screenX, - touch.screenY, touch.clientX, touch.clientY, false, false, false, false, 0, null); - clickEvent.fastclick = true; - targetElement.dispatchEvent(clickEvent) - }, needClick: function (target) { + //判定是否使用原生的点击事件, 否则使用sendClick方法手动触发一个人工的点击事件 switch (target.nodeName.toLowerCase()) { - - // Don't send a synthetic click to disabled inputs (issue #62) case 'button': case 'select': case 'textarea': @@ -5243,8 +5222,7 @@ var fastClick = { break; case 'input': - - // File inputs need real clicks on iOS 6 due to a browser bug (issue #68) + // IOS6 pad 上选择文件,如果不是原生的click,弹出的选择界面尺寸错误 if ((deviceIsIOS && target.type === 'file') || target.disabled) { return true } @@ -5258,18 +5236,6 @@ var fastClick = { return false }, - focus: function (targetElement) { - var length; - - // on iOS 7, some input elements (e.g. date datetime) throw a vague TypeError on setSelectionRange. These elements don't have an integer value for the selectionStart and selectionEnd properties, but unfortunately that can't be used for detection because accessing the properties also throws a TypeError. Just check the type instead. Filed as Apple bug #15122724. - if (deviceIsIOS && targetElement.setSelectionRange && - targetElement.type.indexOf('date') !== 0 && targetElement.type !== 'time') { - length = targetElement.value.length - targetElement.setSelectionRange(length, length) - } else { - targetElement.focus() - } - }, needFocus: function (target) { switch (target.nodeName.toLowerCase()) { case 'textarea': @@ -5285,304 +5251,335 @@ var fastClick = { case 'submit': return false } - - // No point in attempting to focus disabled inputs + //如果是只读或disabled状态,就无须获得焦点了 return !target.disabled && !target.readOnly default: return false } }, - updateScrollParent: function (targetElement) { + focus: function (targetElement) { + var length; + //在iOS7下, 对一些新表单元素(如date, datetime, time, month)调用focus方法会抛错, + //幸好的是,我们可以改用setSelectionRange获取焦点, 将光标挪到文字的最后 + var type = targetElement.type + if (deviceIsIOS && targetElement.setSelectionRange && + type.indexOf('date') !== 0 && type !== 'time' && type !== 'month') { + length = targetElement.value.length + targetElement.setSelectionRange(length, length) + } else { + targetElement.focus() + } + }, + findControl: function (labelElement) { + // 获取label元素所对应的表单元素 + // 可以能过control属性, getElementById, 或用querySelector直接找其内部第一表单元素实现 + if (labelElement.control !== undefined) { + return labelElement.control + } + + if (labelElement.htmlFor) { + return document.getElementById(labelElement.htmlFor) + } + + return labelElement.querySelector('button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea') + }, + fixTarget: function (target) { + if (target.nodeType === 3) { + return target.parentNode + } + if (window.SVGElementInstance && (target instanceof SVGElementInstance)) { + return target.correspondingUseElement; + } - var scrollParent = targetElement.fastClickScrollParent + return target + }, + updateScrollParent: function (targetElement) { + //如果事件源元素位于某一个有滚动条的祖父元素中,那么保持其scrollParent与scrollTop值 + var scrollParent = targetElement.tapScrollParent - // Attempt to discover whether the target element is contained within a scrollable layer. Re-check if the - // target element was moved to another parent. if (!scrollParent || !scrollParent.contains(targetElement)) { - var parentElement = targetElement; + var parentElement = targetElement do { if (parentElement.scrollHeight > parentElement.offsetHeight) { - scrollParent = parentElement; - targetElement.fastClickScrollParent = parentElement - break; + scrollParent = parentElement + targetElement.tapScrollParent = parentElement + break } parentElement = parentElement.parentElement - } while (parentElement); + } while (parentElement) } - // Always update the scroll top tracker if possible. if (scrollParent) { - scrollParent.fastClickLastScrollTop = scrollParent.scrollTop + scrollParent.lastScrollTop = scrollParent.scrollTop } }, + touchHasMoved: function (event) { + // 判定是否发生移动,其阀值是10px + var touch = event.changedTouches[0], + boundary = tapGesture.touchBoundary + return Math.abs(touch.pageX - tapGesture.touchStartX) > boundary || + Math.abs(touch.pageY - tapGesture.touchStartY) > boundary + + }, findControl: function (labelElement) { - // Fast path for newer browsers supporting the HTML5 control attribute + // 获取label元素所对应的表单元素 + // 可以能过control属性, getElementById, 或用querySelector直接找其内部第一表单元素实现 if (labelElement.control !== undefined) { return labelElement.control } - // All browsers under test that support touch events also support the HTML5 htmlFor attribute if (labelElement.htmlFor) { return document.getElementById(labelElement.htmlFor) } - // If no for attribute exists, attempt to retrieve the first labellable descendant element - // the list of which is defined here: http://www.w3.org/TR/html5/forms.html#category-label - return labelElement.querySelector('button, input:not([type=hidden]), keygen,' + - 'meter, output, progress, select, textarea') + return labelElement.querySelector('button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea') }, - touchHasMoved: function (event) { - var touch = event.changedTouches[0], - boundary = fastClick.touchBoundary - - if (Math.abs(touch.pageX - fastClick.touchStartX) > boundary || - Math.abs(touch.pageY - fastClick.touchStartY) > boundary) { - return true + findType: function (targetElement) { + // 安卓chrome浏览器上,模拟的 click 事件不能让 select 打开,故使用 mousedown 事件 + return deviceIsAndroid && targetElement.tagName.toLowerCase() === 'select' ? + 'mousedown' : 'click' + }, + sendClick: function (targetElement, event) { + // 在click之前触发tap事件 + gestureHooks.fire(targetElement, 'tap', { + touchEvent: event + }) + var clickEvent, touch + //某些安卓设备必须先移除焦点,之后模拟的click事件才能让新元素获取焦点 + if (document.activeElement && document.activeElement !== targetElement) { + document.activeElement.blur() } - return false + touch = event.changedTouches[0] + // 手动触发点击事件,此时必须使用document.createEvent('MouseEvents')来创建事件 + // 及使用initMouseEvent来初始化它 + clickEvent = document.createEvent('MouseEvents') + clickEvent.initMouseEvent(tapGesture.findType(targetElement), true, true, window, 1, touch.screenX, + touch.screenY, touch.clientX, touch.clientY, false, false, false, false, 0, null) + clickEvent.touchEvent = event + targetElement.dispatchEvent(clickEvent) }, - fixTarget: function (target) { - if (window.SVGElementInstance && (target instanceof SVGElementInstance)) { - target = target.correspondingUseElement; - } - - return target - } -} -supportPointer = !!navigator.pointerEnabled || !!navigator.msPointerEnabled - -if (supportPointer) { // 支持pointer的设备可用样式来取消click事件的300毫秒延迟 - root.style.msTouchAction = root.style.touchAction = "none" -} -avalon.gestureHooks.add("tap", { - events: ['tap', 'click'], touchstart: function (event) { - var targetElement, touch, selection; - - // Ignore multiple touches, otherwise pinch-to-zoom is prevented if both fingers are on the fastClick element (issue #111). - if (event.targetTouches.length > 1) { + //忽略多点触摸 + if (event.targetTouches.length !== 1) { return true } - - targetElement = fastClick.fixTarget(event.target); - touch = event.targetTouches[0]; - + //修正事件源对象 + var targetElement = tapGesture.fixTarget(event.target) + var touch = event.targetTouches[0] if (deviceIsIOS) { - - // Only trusted events will deselect text on iOS (issue #49) - selection = window.getSelection(); + // 判断是否是点击文字,进行选择等操作,如果是,不需要模拟click + var selection = window.getSelection(); if (selection.rangeCount && !selection.isCollapsed) { return true } + var id = touch.identifier + //当 alert 或 confirm 时,点击其他地方,会触发touch事件,identifier相同,此事件应该被忽略 + if (id && isFinite(tapGesture.lastTouchIdentifier) && tapGesture.lastTouchIdentifier === id) { + event.preventDefault() + return false + } - fastClick.updateScrollParent(targetElement); - } - - fastClick.trackingClick = true - fastClick.trackingClickStart = event.timeStamp - fastClick.targetElement = targetElement - - - fastClick.touchStartX = touch.pageX - fastClick.touchStartY = touch.pageY + tapGesture.lastTouchIdentifier = id - // Prevent phantom clicks on fast double-tap (issue #36) - if ((event.timeStamp - fastClick.lastClickTime) < fastClick.tapDelay) { + tapGesture.updateScrollParent(targetElement) + } + //收集触摸点的信息 + tapGesture.status = "tapping" + tapGesture.startTime = Date.now() + tapGesture.element = targetElement + tapGesture.pageX = touch.pageX + tapGesture.pageY = touch.pageY + // 如果点击太快,阻止双击带来的放大收缩行为 + if ((tapGesture.startTime - tapGesture.lastTime) < tapGesture.tapDelay) { event.preventDefault() } - - return true }, touchmove: function (event) { - if (!fastClick.trackingClick) { + if (tapGesture.status !== "tapping") { return true } - - // If the touch has moved, cancel the click tracking - if (fastClick.targetElement !== fastClick.fixTarget(event.target) || - fastClick.touchHasMoved(event)) { - fastClick.trackingClick = false - fastClick.targetElement = null + // 如果事件源元素发生改变,或者发生了移动,那么就取消触发点击事件 + if (tapGesture.element !== tapGesture.fixTarget(event.target) || + tapGesture.touchHasMoved(event)) { + tapGesture.status = tapGesture.element = 0 } }, touchend: function (event) { - var forElement, trackingClickStart, targetTagName, scrollParent, - targetElement = fastClick.targetElement; - - if (event.timeStamp - fastClick.trackingClickStart > fastClick.tapDelay || !fastClick.trackingClick) { - return true; - } - - // Prevent phantom clicks on fast double-tap (issue #36) - if ((event.timeStamp - fastClick.lastClickTime) < fastClick.tapDelay) { - fastClick.cancelNextClick = true; - return true; + var targetElement = tapGesture.element + var now = Date.now() + //如果是touchstart与touchend相隔太久,可以认为是长按,那么就直接返回 + //或者是在touchstart, touchmove阶段,判定其不该触发点击事件,也直接返回 + if (!targetElement || now - tapGesture.startTime > tapGesture.tapDelay) { + return true } - // Reset to prevent wrong click cancel on input (issue #156). - fastClick.cancelNextClick = false; - fastClick.lastClickTime = event.timeStamp; + tapGesture.lastTime = now - trackingClickStart = fastClick.trackingClickStart; - fastClick.trackingClick = false - fastClick.trackingClickStart = 0 + var startTime = tapGesture.startTime + tapGesture.status = tapGesture.startTime = 0 targetTagName = targetElement.tagName.toLowerCase() if (targetTagName === 'label') { - forElement = fastClick.findControl(targetElement) + //尝试触发label上可能绑定的tap事件 + gestureHooks.fire(targetElement, 'tap', { + touchEvent: event + }) + var forElement = tapGesture.findControl(targetElement) if (forElement) { - fastClick.focus(targetElement) - if (deviceIsAndroid) { - return false - } - + tapGesture.focus(targetElement) targetElement = forElement } - } else if (fastClick.needFocus(targetElement)) { - - // Case 1: If the touch started a while ago (best guess is 100ms based on tests for issue #36) then focus will be triggered anyway. Return early and unset the target element reference so that the subsequent click will be allowed through. - // Case 2: Without this exception for input elements tapped when the document is contained in an iframe, then any inputted text won't be visible even though the value attribute is updated as the user types (issue #37). - if ((event.timeStamp - trackingClickStart) > 100 || (deviceIsIOS && window.top !== window && targetTagName === 'input')) { - fastClick.targetElement = null - return false; + } else if (tapGesture.needFocus(targetElement)) { + // 如果元素从touchstart到touchend经历时间过长,那么不应该触发点击事 + // 或者此元素是iframe中的input元素,那么它也无法获点焦点 + if ((now - startTime) > 100 || (deviceIsIOS && window.top !== window && targetTagName === 'input')) { + tapGesture.element = 0 + return false } - fastClick.focus(targetElement) - deviceIsAndroid && fastClick.sendClick(targetElement, event) + tapGesture.focus(targetElement) + deviceIsAndroid && tapGesture.sendClick(targetElement, event) - return false; + return false } if (deviceIsIOS) { - - // Don't send a synthetic click event if the target element is contained within a parent layer that was scrolled - // and this tap is being used to stop the scrolling (usually initiated by a fling - issue #42). - scrollParent = targetElement.fastClickScrollParent; - if (scrollParent && scrollParent.fastClickLastScrollTop !== scrollParent.scrollTop) { + //如果它的父容器的滚动条发生改变,那么应该识别为划动或拖动事件,不应该触发点击事件 + var scrollParent = targetElement.tapScrollParent; + if (scrollParent && scrollParent.lastScrollTop !== scrollParent.scrollTop) { return true } } - - // Prevent the actual click from going though - unless the target node is marked as requiring - // real clicks or if it is in the whitelist in which case only non-programmatic clicks are permitted. - if (!fastClick.needClick(targetElement)) { - event.preventDefault(); - fastClick.sendClick(targetElement, event) + //如果这不是一个需要使用原生click的元素,则屏蔽原生事件,避免触发两次click + if (!tapGesture.needClick(targetElement)) { + event.preventDefault() + // 触发一次模拟的click + tapGesture.sendClick(targetElement, event) } - - return false; }, touchcancel: function () { - fastClick.trackingClick = false - fastClick.targetElement = null - } -}) - -var swipeGesture = { - events: ['swipe', 'swipeleft', 'swiperight', 'swipeup', 'swipedown'], - touchstart: function (event) { - startGesture(event, noop) - }, - touchmove: function (event) { - moveGesture(event, noop) - }, - touchend: function (event) { - endGesture(event, function (gesture, touch) { - var now = Date.now() - var isflick = (gesture.distance > 100 && gesture.distance / gesture.duration > 0.65) - - if (isflick) { - var displacementX = touch.clientX - gesture.startTouch.clientX - var displacementY = touch.clientY - gesture.startTouch.clientY - var extra = { - duration: now - gesture.startTime, - isflick: isflick, - displacementX: displacementX, - displacementY: displacementY, - touch: touch, - touchEvent: event, - isVertical: gesture.isVertical - } - var target = gesture.element, - dir - fireGesture(target, 'swipe', extra) - - if (gesture.isVertical) { - dir = displacementY > 0 ? 'down' : 'up' - } else { - dir = displacementY > 0 ? 'right' : 'left' - } - fireGesture(target, 'swipe' + dir, extra) - } - }) + tapGesture.startTime = tapGesture.element = 0 } } -swipeGesture.touchcancel = swipeGesture.touchend -avalon.gestureHooks.add('swipe', swipeGesture) +gestureHooks.add("tap", tapGesture) + -var lastTap = null -function cancelPress(gesture) { - clearTimeout(gesture.pressingHandler) - gesture.pressingHandler = null -} var pressGesture = { events: ['longtap', 'doubletap'], + cancelPress: function (pointer) { + clearTimeout(pointer.pressingHandler) + pointer.pressingHandler = null + }, touchstart: function (event) { - startGesture(event, function (gesture, event) { - gesture.pressingHandler = setTimeout(function () { - if (gesture.status === 'tapping') { - gesture.status = 'pressing' - fireGesture(event.target, 'longtap', { + gestureHooks.start(event, function (pointer, touch) { + pointer.pressingHandler = setTimeout(function () { + if (pointer.status === 'tapping') { + gestureHooks.fire(event.target, 'longtap', { + touch: touch, touchEvent: event }) } - cancelPress(gesture) + pressGesture.cancelPress(pointer) }, 500) + if (event.changedTouches.length !== 1) { + pointer.status = 0 + } }) + }, touchmove: function (event) { - moveGesture(event, function (gesture) { - - if (gesture.distance > 10 && gesture.pressingHandler) { - cancelPress(gesture) - - if (gesture.status === 'tapping' || gesture.status === 'pressing') { - gesture.status = 'panning' + gestureHooks.move(event, function (pointer) { + if (pointer.distance > 10 && pointer.pressingHandler) { + pressGesture.cancelPress(pointer) + if (pointer.status === 'tapping') { + pointer.status = 'panning' } } }) }, touchend: function (event) { - endGesture(event, function (gesture, touch) { - cancelPress(gesture) - - if (gesture.status === 'tapping') { - gesture.timestamp = Date.now() - - if (lastTap && gesture.timestamp - lastTap.timestamp < 300) { - fireGesture(gesture.element, 'doubletap', { + gestureHooks.end(event, function (pointer, touch) { + pressGesture.cancelPress(pointer) + if (pointer.status === 'tapping') { + pointer.lastTime = Date.now() + if (pressGesture.lastTap && pointer.lastTime - pressGesture.lastTap.lastTime < 300) { + gestureHooks.fire(pointer.element, 'doubletap', { touch: touch, touchEvent: event }) } - lastTap = gesture + pressGesture.lastTap = pointer } }) }, touchcancel: function (event) { - endGesture(event, function (gesture) { - cancelPress(gesture) + gestureHooks.end(event, function (pointer) { + pressGesture.cancelPress(pointer) }) } } -avalon.gestureHooks.add('press', pressGesture) +gestureHooks.add('press', pressGesture) + +var swipeGesture = { + events: ['swipe', 'swipeleft', 'swiperight', 'swipeup', 'swipedown'], + getAngle: function (x, y) { + var r = Math.atan2(y, x) //radians + var angle = Math.round(r * 180 / Math.PI) //degrees + return angle < 0 ? 360 - Math.abs(angle) : angle + }, + getDirection: function (x, y) { + var angle = swipeGesture.getAngle(x, y) + if ((angle <= 45) && (angle >= 0)) { + return "left" + } else if ((angle <= 360) && (angle >= 315)) { + return "left" + } else if ((angle >= 135) && (angle <= 225)) { + return "right" + } else if ((angle > 45) && (angle < 135)) { + return "down" + } else { + return "up" + } + }, + touchstart: function (event) { + gestureHooks.start(event, noop) + }, + touchmove: function (event) { + gestureHooks.move(event, noop) + }, + touchend: function (event) { + if(event.changedTouches.length !== 1){ + return + } + gestureHooks.end(event, function (pointer, touch) { + var isflick = (pointer.distance > 30 && pointer.distance / pointer.duration > 0.65) + if (isflick) { + var extra = { + deltaX : pointer.deltaX, + deltaY: pointer.deltaY, + touch: touch, + touchEvent: event, + direction: swipeGesture.getDirection(pointer.deltaX, pointer.deltaY), + isVertical: pointer.isVertical + } + var target = pointer.element + gestureHooks.fire(target, 'swipe', extra) + gestureHooks.fire(target, 'swipe' + extra.direction, extra) + } + }) + } +} + +swipeGesture.touchcancel = swipeGesture.touchend +gestureHooks.add('swipe', swipeGesture) + // Register as a named AMD module, since avalon can be concatenated with other diff --git a/dist/avalon.mobile.shim.min.js b/dist/avalon.mobile.shim.min.js index 339946011..123758d49 100644 --- a/dist/avalon.mobile.shim.min.js +++ b/dist/avalon.mobile.shim.min.js @@ -1,3 +1,3 @@ -!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("Avalon requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(){avalon.config.debug&&console.log.apply(console,arguments)}function a(){return Object.create(null)}function r(e){return Function.apply(i,e)}function i(){}function o(e,t){"string"==typeof e&&(e=e.match(Ut)||[]);for(var n={},a=void 0!==t?t:1,r=0,i=e.length;i>r;r++)n[e[r]]=a;return n}function l(){if(e.VBArray){var t=document.documentMode;return t?t:e.XMLHttpRequest?7:6}return 0/0}function c(e){if(e&&"object"==typeof e){var t=e.length,n=en.call(e);if(/(Array|List|Collection|Map|Arguments)\]$/.test(n))return!0;if("[object Object]"===n&&t===t>>>0)return!0}return!1}function s(e,t){if(e&&e.childNodes)for(var n,a=e.childNodes,r=0;n=a[r++];)if(n.tagName){var i=_t.createElementNS(hn,n.tagName.toLowerCase());tn.forEach.call(n.attributes,function(e){i.setAttribute(e.name,e.value)}),s(n,i),t.appendChild(i)}}function u(e){for(var t in e)if(Qt.call(e,t)){var n=e[t];"function"==typeof u.plugins[t]?u.plugins[t](n):"object"==typeof u[t]?avalon.mix(u[t],n):u[t]=n}return this}function f(e){return(e+"").replace(kn,"\\$&")}function d(e,t){var n=this.$events||(this.$events={}),a=n[e]||(n[e]=[]);if("function"==typeof t){var r=t;r.uniqueNumber=Math.random(),t={element:rn,type:"user-watcher",handler:i,vmodels:[this],expr:e,uniqueNumber:r.uniqueNumber},t.wildcard=/\*/.test(e)}if(t.update)t.oneTime||avalon.Array.ensure(a,t);else{if(/\w\.*\B/.test(e)){t.getter=i;var o=this;t.update=function(){var e=this.fireArgs||[];e[2]&&t.handler.apply(o,e),delete this.fireArgs},a.sync=!0,avalon.Array.ensure(a,t)}else avalon.injectBinding(t);r&&(t.handler=r)}return function(){t.update=t.getter=t.handler=i,t.element=_t.createElement("a")}}function v(e,t){var n=this.$events;if(n&&n[e]){t&&(t[2]=e),h(n[e],t);var a=this.$up;a&&(this.$pathname&&v.call(a,this.$pathname+"."+e,t),v.call(a,"*."+e,t))}else if(a=this.$up){var r=this.$pathname+"."+e,i=r.split(".");-1===i.indexOf("*")?(v.call(a,r,t),i[1]="*",v.call(a,i.join("."),t)):v.call(a,r,t)}}function p(e,t){for(;;){if(e.$watch){var n=e.$events||(e.$events={}),a=n[t]||(n[t]=[]);return void Ln.collectDependency(a)}if(e=e.$up,!e)break;t=e.$pathname+"."+t}}function h(e,t){if(e){new Date-Dn>444&&"object"==typeof e[0]&&L();for(var n,a=[],r=[],i=0;n=e[i++];)"user-watcher"===n.type?a.push(n):r.push(n);if(u.async){for(ka.render(),i=0;n=r[i++];)if(n.update){var o=M(n);ka.queue[o]||(ka.queue[o]=1,ka.queue.push(n))}}else for(i=0;n=r[i++];)n.update&&n.update();for(i=0;n=a[i++];)(t&&t[2]===n.expr||n.wildcard)&&(n.fireArgs=t),n.update()}}function m(e,t){return t=t||{},t.watch=!0,y(e,t)}function g(){}function y(e,t){function a(e){return u[e]===!0}if(!e||e.$id&&e.$accessors)return e;t=t||Wt;var r=t.force||Wt,i=t.old,l="object"==typeof i?i.$accessors:Wt,c=new g,s={},u={},f=[],p=[],h={};e.$skipArray&&(h=o(e.$skipArray),delete e.$skipArray);var m=e.$computed;if(m){delete e.$computed;for(var y in m)u[y]=!0,function(e,t){var n;s[e]={get:function(){return n=t.get.call(this)},set:function(a){if("function"==typeof t.set){var r=n;t.set.call(this,a);var i=this[e];this.$fire&&i!==r&&this.$fire(e,i,r)}},enumerable:!0,configurable:!0}}(y,m[y])}for(y in e){var w=e[y];En[y]||(u[y]=!0),"function"==typeof w||w&&w.nodeType||!r[y]&&("$"===y.charAt(0)||En[y]||h[y])?f.push(y):b(w)?(n("warning:计算属性建议放在$computed对象中统一定义"),function(e,t){var n;s[e]={get:function(){return n=t.get.call(this)},set:function(a){if("function"==typeof t.set){var r=n;t.set.call(this,a);var i=this[e];this.$fire&&i!==r&&this.$fire(e,i,r)}},enumerable:!0,configurable:!0}}(y,w)):(p.push(y),s[y]=l[y]?l[y]:$(y,w))}s.$model=Nn,c=Object.defineProperties(c,s,e),f.forEach(function(t){c[t]=e[t]}),k(c,"$id","anonymous"),k(c,"$up",i?i.$up:null),k(c,"$track",Object.keys(u)),k(c,"$active",!1),k(c,"$pathname",i?i.$pathname:""),k(c,"$accessors",s),k(c,"hasOwnProperty",a),t.watch&&(k(c,"$watch",function(){return d.apply(c,arguments)}),k(c,"$fire",function(e,t){if(0===e.indexOf("all!")){var n=e.slice(4);for(var a in avalon.vmodels){var r=avalon.vmodels[a];r.$fire&&r.$fire.apply(r,[n,t])}}else v.call(c,e,[t])})),p.forEach(function(t){var n=c[t]=e[t];n&&"object"==typeof n&&(n.$up=c,n.$pathname=t),v.call(c,t)});for(y in m)w=c[y];return c.$active=!0,c}function b(e){if(e&&"object"==typeof e){for(var t in e)if("get"!==t&&"set"!==t)return!1;return"function"==typeof e.get}}function $(e,t){var n,t=0/0;return{get:function(){return this.$active&&p(this,e),t},set:function(a){if(t!==a){var r=t;n=w(a,t),n?t=n:(n=void 0,t=a),Object(n)===n&&(n.$pathname=e,n.$up=this),this.$active&&v.call(this,e,[t,r])}},enumerable:!0,configurable:!0}}function w(e,t,n,a){if(Array.isArray(e))return x(e,t,a);if(avalon.isPlainObject(e)){if(t){var r=Object.keys(e),i=Object.keys(t);if(r.join(";")===i.join(";")){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);return t}t.$active=!1}return y(e,{old:t,watch:a})}return n?e:void 0}function x(e,t,n){if(t){var a=[0,t.length].concat(e);return t.splice.apply(t,a),t}for(var r in Mn)e[r]=Mn[r];k(e,"$up",null),k(e,"$pathname",""),k(e,"$track",E(e.length)),e._=y({length:0/0},{watch:!0}),e._.length=e.length,e._.$watch("length",function(t,n){v.call(e.$up,e.$pathname+".length",[t,n])}),n&&k(e,"$watch",function(){return d.apply(e,arguments)}),Object.defineProperty(e,"$model",Nn);for(var i=0,o=e.length;o>i;i++){var l=e[i]=w(e[i],0,1,1);Object(l)===l&&(l.$up=e)}return e}function k(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!1,configurable:!0})}function C(e){var t=avalon.type(e);if("array"===t){for(var n=[],a=0;aa;a++){n[a]=e[a];var i=t[a];i in n?(e[a]=n[i],delete n[i]):e[a]=e[i]}}function E(e){for(var t=[],n=0;e>n;n++)t[n]=cn("$proxy$each");return t}function N(e,t,n){switch(t){case"push":case"unshift":n=E(n.length);break;case"splice":if(n.length>2){{n[1],n.length-2}n=[n[0],n[1]].concat(E(n.length-2))}}Array.prototype[t].apply(e,n)}function A(e,t){t.oneTime||e&&avalon.Array.ensure(e,t)&&t.element&&(O(t,e),new Date-Dn>444&&L())}function S(e,t){for(var n,a=[],r=0;n=e[r++];)a.push(t?n.$id:n.$key);return a.join(";")}function M(e){if(!e.uniqueNumber){var t=e.element;e.uniqueNumber=t?1!==t.nodeType?e.type+(e.pos||0)+"-"+M(t.parentNode):e.name+"-"+M(t):++Hn}return e.uniqueNumber}function O(e,t){var n=e.lists||(e.lists=[]),a=M(e);avalon.Array.ensure(n,t),t.$uuid=t.$uuid||cn(),jn[a]||(jn[a]=1,jn.push(e))}function L(e){for(var t=jn.length,n=t,a=[],r={},i={};e=jn[--t];){var o=e.type;i[o]?i[o]++:(i[o]=1,a.push(o))}var l=!1;if(a.forEach(function(e){Pn[e]!==i[e]&&(r[e]=1,l=!0)}),t=n,l)for(;e=jn[--t];)if(null!==e.element){if(r[e.type]&&j(e.element)){jn.splice(t,1),delete jn[e.uniqueNumber];for(var c,s=e.lists,u=0;c=s[u++];)avalon.Array.remove(s,c),avalon.Array.remove(c,e);H(e)}}else jn.splice(t,1);Pn=i,Dn=new Date}function H(e){delete jn[e.uniqueNumber],e.element=null,e.rollback&&e.rollback();for(var t in e)e[t]=null}function j(e){try{{e.parentNode.nodeType}}catch(t){return!0}return e.ifRemove&&!rn.contains(e.ifRemove)&&It===e.parentNode?(e.parentNode&&e.parentNode.removeChild(e),!0):e.msRetain?0:1===e.nodeType?!rn.contains(e):!avalon.contains(rn,e)}function D(e){return e.replace(/([a-z\d])([A-Z]+)/g,"$1-$2").toLowerCase()}function P(e){return e.indexOf("-")<0&&e.indexOf("_")<0?e:e.replace(/[-_][^-_]/g,function(e){return e.charAt(1).toUpperCase()})}function R(e){try{if("object"==typeof e)return e;e="true"===e?!0:"false"===e?!1:"null"===e?null:+e+""===e?+e:In.test(e)?JSON.parse(e):e}catch(t){}return e}function B(e){return e.window&&e.document?e:9===e.nodeType?e.defaultView:!1}function q(e,t){if(e.offsetWidth<=0){var n=getComputedStyle(e,null);if(Un.test(n.display)){var a={node:e};for(var r in Wn)a[r]=n[r],e.style[r]=Wn[r];t.push(a)}var i=e.parentNode;i&&1===i.nodeType&&q(i,t)}}function _(e){var t=e.tagName.toLowerCase();return"input"===t&&/checkbox|radio/.test(e.type)?"checked":t}function F(e,t){var n=[],a=!!t;t=t||0;for(var i="unknown",o="",l=0;lu;u++)if(i.length){var d="vm"+o+"_"+u;c.push(d),s.push(t[u]),l.push.apply(l,I(i,t[u],d,n))}n.args=s;var v=n.type,p=t.map(function(e){return String(e.$id).replace(ea,"$1")})+e+v,h=na.get(p);if(h){if("duplex"===v){var m=na.get(p+"setter");n.setter=m.apply(m,n.args)}return n.getter=h}if(l.length||l.push("fix"+o),"duplex"===v){var g={};l.forEach(function(e){var t=e.split("=");g[t[0].trim()]=t[1].trim()}),e=e.replace(/[\$\w]+/,function(e){return g[e]?g[e]:e});var y=r(c.concat("'use strict';return function(vvv){"+e+" = vvv\n}\n"));na.put(p+"setter",y),n.setter=y.apply(y,n.args)}if("on"===v){-1===e.indexOf("(")?e+=".call(this, $event)":e=e.replace("(",".call(this,"),c.push("$event"),e="\nreturn "+e+";";var b=e.lastIndexOf("\nreturn"),$=e.slice(0,b),w=e.slice(b);e=$+"\n"+w}else e="\nreturn "+e+";";return h=r(c.concat("'use strict';\nvar "+l.join(",\n")+e)),na.put(p,h)}function z(e){var t=$n.test(e);if(t){var n=rt(e);return 1===n.length?n[0].expr:n.map(function(e){return e.type?"("+e.expr+")":ca(e.expr)}).join(" + ")}return e}function W(e){return e=e.replace(aa,"").replace(ra,function(){return"],|"}).replace(ia,function(e,t){return"["+ca(t)}).replace(oa,function(){return'"],["'}).replace(la,function(){return'",'})+"]",r(["return ["+e+"]"])()}function U(e,t,n){var a=setTimeout(function(){var r=e.innerHTML;clearTimeout(a),r===n?t():U(e,t,r)})}function G(e,t){var n=e.getAttribute("avalonctrl")||t.$id;e.setAttribute("avalonctrl",n),t.$events&&(t.$events.expr=e.tagName+'[avalonctrl="'+n+'"]')}function Z(e,t){for(var n,a=0;n=e[a++];)n.vmodels=t,vn[n.type].init(n),avalon.injectBinding(n),n.getter&&1===n.element.nodeType&&n.element.removeAttribute(n.name);e.length=0}function J(e,t){return e.priority-t.priority}function K(e,t,a){var r=!0;if(t.length){for(var i,o=e.attributes,l=[],c={},s=0;i=o[s++];){var u=i.name;if(!c[u]&&(c[u]=1,i.specified&&(a=u.match(va)))){var f=a[1],d=a[2]||"",v=i.value;if(pa[f]?(d=f,f="on"):ha[f]&&(d=f,f="attr",u="ms-"+f+"-"+d,n("warning!请改用"+u+"代替"+i.name+"!")),vn[f]){var p=v.replace(da,""),h=v!==p,m={type:f,param:d,element:e,name:u,expr:p,oneTime:h,priority:(vn[f].priority||10*f.charCodeAt(0))+(Number(d.replace(/\D/g,""))||0)};if("html"===f||"text"===f){var g=at(v).filters;m.expr=m.expr.replace(g,""),m.filters=g.replace(ba,function(){return m.type="html",m.group=1,""}).trim()}else if("duplex"===f)var y=u;else if("ms-if-loop"===u)m.priority+=100;else if("ms-attr-value"===u)var b=u;l.push(m)}}}if(l.length){for(l.sort(J),y&&b&&"text"===e.type&&n("warning!一个控件不能同时定义ms-attr-value与"+y),s=0;m=l[s];s++){if(f=m.type,ma.test(f))return Z(l.slice(0,s+1),t);r&&(r=!ga.test(f))}Z(l,t)}}r&&!sa[e.tagName]&&(fa&&fa(e),et(e,t))}function Q(e){for(var t,n=e.attributes,a={},r=0;t=n[r++];)t.specified&&!ya.test(t.name)&&(a[P(t.name)]=R(t.value));return a}function et(e,t){var n=avalon.slice(e.childNodes);tt(n,t)}function tt(e,t){for(var n,a=0;n=e[a++];)switch(n.nodeType){case 1:var r=n;if(nt(n,t),!r.msResolved&&r.parentNode&&1===r.parentNode.nodeType){var i=lt(r);if(i){var o=r.localName?r.localName.replace(i+":",""):r.nodeName,l=i+":"+P(o);Ca.push({library:i,element:r,fullName:l,widget:o,vmodels:t,name:"widget"}),avalon.components[l]&&avalon.component(l)}}n.msHasEvent&&avalon.fireDom(n,"datasetchanged",{bubble:n.msHasEvent});break;case 3:$n.test(n.nodeValue)&&it(n,t,a)}}function nt(e,t,n){var a=e.getAttribute("ms-skip"),r=e.getAttributeNode("ms-important"),i=e.getAttributeNode("ms-controller");if("string"!=typeof a){if(n=r||i){var o=avalon.vmodels[n.value];if(!o)return;t=n===r?[o]:[o].concat(t),e.removeAttribute(n.name),e.classList.remove(n.name),G(e,o)}K(e,t)}}function at(e){if(e.indexOf("|")>0){var t=e.replace(wa,function(e){return Array(e.length+1).join("1")}),n=t.replace($a,"ᄢ㍄").indexOf("|");if(n>-1)return{type:"text",filters:e.slice(n).trim(),expr:e.slice(0,n)}}return{type:"text",expr:e,filters:""}}function rt(e){for(var t,n,a=[],r=0;;){if(n=e.indexOf(yn,r),-1===n)break;if(t=e.slice(r,n),t&&a.push({expr:t}),r=n+yn.length,n=e.indexOf(bn,r),-1===n)break;t=e.slice(r,n),t&&a.push(at(t,r)),r=n+bn.length}return t=e.slice(r),t&&a.push({expr:t}),a}function it(e,t,n){var a=[];if(tokens=rt(e.data),tokens.length){for(var r=0;token=tokens[r++];){var i=_t.createTextNode(token.expr);token.type&&(token.expr=token.expr.replace(da,function(){return token.oneTime=!0,""}),token.element=i,token.filters=token.filters.replace(ba,function(){return token.type="html",""}),token.pos=1e3*n+r,a.push(token)),on.appendChild(i)}e.parentNode.replaceChild(on,e),a.length&&Z(a,t)}}function ot(e,t){if(t)for(var n,a=0;n=e[a++];)if(n.hasOwnProperty(t)&&"object"==typeof n[t]){var r=n[t];return r.$model||r}return{}}function lt(e){if(e.scopeName&&"HTML"!==e.scopeName)return e.scopeName;var t=e.nodeName.toLowerCase(),n=t.indexOf(":");return n>0?t.slice(0,n):void 0}function ct(e){return null==e?"":e}function st(e,t,n){return t.param.replace(Gt,function(a){var r=avalon.duplexHooks[a];r&&"function"==typeof r[n]&&(e=r[n](e,t))}),e}function ut(){for(var e=Da.length-1;e>=0;e--){var t=Da[e];t()===!1&&Da.splice(e,1)}Da.length||clearInterval(ja)}function ft(e,t){if(!e||1!==e.nodeType)return null;if(t)var n=t.effectName,a=t.effectDriver;else n=e.getAttribute("data-effect-name"),a=e.getAttribute("data-effect-driver");if(!n||!a)return null;var r=Ia.pop()||new pt;return r.el=e,r.driver=a,r.useCss="j"!==a,r.useCss&&(t&&avalon(e).addClass(t.effectClass),r.cssEvent="t"===a?Ra:Ba),r.name=n,r.callbacks=avalon.effects[n]||{},r}function dt(e,t){var n=e.getAttribute("data-effect-name");if(n){t.effectName=n,t.effectDriver=e.getAttribute("data-effect-driver");var a=+e.getAttribute("data-effect-stagger");t.effectLeaveStagger=+e.getAttribute("data-effect-leave-stagger")||a,t.effectEnterStagger=+e.getAttribute("data-effect-enter-stagger")||a,t.effectClass=e.className||0/0}}function vt(e){return e.replace(/^[\S]/g,function(e){return e.toUpperCase()})}function pt(){}function ht(e,t){var n=e.callbacks[t+"Class"];return"string"==typeof n?n:"function"==typeof n?n():e.name+"-"+t}function mt(e,t,n){var a=e.callbacks[t];a&&a.call(e,e.el,n)}function gt(e,t,n){var a=e.templateCache&&e.templateCache[t];if(a){for(var r,i=_t.createDocumentFragment();r=a.firstChild;)i.appendChild(r);return i}return avalon.parseHTML(n)}function yt(e){for(var t=_t.createDocumentFragment(),n=0,a=e.length;a>n;n++)t.appendChild(e[n]);return t}function bt(e,t,n){for(var a,r=0;a=e[r++];)a.className===n.effectClass&&avalon.effect.apply(a,t,i,i,n)}function $t(e,t,n){return e?setTimeout(t,++n*e):t(),n}function wt(e,t){for(var n=on.cloneNode(!1),a=e,r=a.nodeValue,o=t&&Math.max(+t.staggerIndex,0),l=avalon.slice(a.parentNode.childNodes),c=l.indexOf(a);;){var s=l[--c];if(!s||0===String(s.nodeValue).indexOf(r))break;t&&s.className===t.effectClass?(e=s,function(e){t.staggerIndex=$t(t.effectLeaveStagger,function(){avalon.effect.apply(e,0,i,function(){n.appendChild(e)},t)},o)}(s)):n.insertBefore(s,n.firstChild)}return n.appendChild(a),n}function xt(e,t,n,a,r){var i=e.template.cloneNode(!0),o=avalon.slice(i.childNodes);i.appendChild(n.$anchor),r&&t.appendChild(i);var l=[n].concat(e.vmodels),c={nodes:o,vmodels:l,content:i};a.push(c)}function kt(e){var t="object"===e.xtype?Nt:Ct,n=t(e),a=n.$anchor||(n.$anchor=e.element.cloneNode(!1));return a.nodeValue=e.signature,n.$outer=e.$outer,n}function Ct(e,t){for(var n=e.param||"el",a=0,r=Za.length;r>a;a++){var i=Za[a];if(i&&i.hasOwnProperty(n)){Za.splice(a,1),t=i;break}}return t||(t=Tt(n)),t}function Tt(e){var t={$outer:{},$index:0,$oldIndex:0,$anchor:null,$first:!1,$last:!1,$remove:avalon.noop};t[e]=0/0;var n={$last:1,$first:1,$index:1};n[e]=1;var a=m(t,{force:n});return a.$id=cn("$proxy$each"),a}function Et(e,t,n){if("array"===n){e.$remove=function(){t.$repeat.removeAt(e.$index)};var a=t.param;e.$watch(a,function(n){var a=e.$index;t.$repeat[a]=n})}else e.$watch("$val",function(n){t.$repeat[e.$key]=n})}function Nt(){return Ja.pop()||At()}function At(){var e=m({$key:"",$val:0/0,$index:0,$oldIndex:0,$outer:{},$anchor:null},{force:{$key:1,$val:1,$index:1}});return e.$id=cn("$proxy$with"),e}function St(e,t,n){var a=e[t];if(a){var r=0===a.$id.indexOf("$proxy$each")?Za:Ja;a.$outer={};for(var i in a.$events){var o=a.$events[i];Array.isArray(o)&&(o.length=0,i===n?a[n]=0/0:"$val"===i&&(a.$val=0/0))}r.unshift(a)>u.maxRepeatSize&&r.pop(),delete e[t]}}function Mt(e,t){var n="_"+e;if(!Mt[n]){var a=_t.createElement(e);rn.appendChild(a),t=an?getComputedStyle(a,null).display:a.currentStyle.display,rn.removeChild(a),Mt[n]=t}return Mt[n]}function Ot(e,t,n,a){e=(e+"").replace(/[^0-9+\-Ee.]/g,"");var r=isFinite(+e)?+e:0,i=isFinite(+t)?Math.abs(t):3,o=a||",",l=n||".",c="",s=function(e,t){var n=Math.pow(10,t);return""+(Math.round(e*n)/n).toFixed(t)};return c=(i?s(r,i):""+Math.round(r)).split("."),c[0].length>3&&(c[0]=c[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,o)),(c[1]||"").length0){var o=70;i>o&&(i=o),r.duration+i>o&&(r.duration=o-i),r.duration+=i,r.lastTouch=Ht({},a),r.lastTime=Date.now();var l=a.clientX-r.startTouch.clientX,c=a.clientY-r.startTouch.clientY;r.distance=Math.sqrt(Math.pow(l,2)+Math.pow(c,2)),r.isVertical=!(Math.abs(l)>Math.abs(c)),t(r,a)}}}function Pt(e,t){for(var n=0;n');var Vt,It=Ft.firstChild,Yt="$"+qt,Xt=e.require,zt=e.define,Wt={},Ut=/[^, ]+/g,Gt=/\w+/g,Zt=/^\[object SVG\w*Element\]$/,Jt=/^\[object (?:Window|DOMWindow|global)\]$/,Kt=Object.prototype,Qt=Kt.hasOwnProperty,en=Kt.toString,tn=Array.prototype,nn=tn.slice,an=e.dispatchEvent,rn=_t.documentElement,on=_t.createDocumentFragment(),ln=(_t.createElement("div"),{});"Boolean Number String Function Array Date RegExp Object Error".replace(Ut,function(e){ln["[object "+e+"]"]=e.toLowerCase()});var cn=function(e){return e=e||"avalon",String(Math.random()+Math.random()).replace(/\d\.\d{4}/,e)},sn=l();avalon=function(e){return new avalon.init(e)},avalon.nextTick=new function(){function t(){for(var e=r.length,t=0;e>t;t++)r[t]();r=r.slice(e)}var n=e.setImmediate,a=e.MutationObserver;if(n)return n.bind(e);var r=[];if(a){var i=document.createTextNode("avalon");new a(t).observe(i,{characterData:!0});var o=!1;return function(e){r.push(e),o=!o,i.data=o}}return function(e){setTimeout(e,4)}},avalon.init=function(e){this[0]=this.element=e},avalon.fn=avalon.prototype=avalon.init.prototype,avalon.type=function(e){return null==e?String(e):"object"==typeof e||"function"==typeof e?ln[en.call(e)]||"object":typeof e};var un=function(e){return"[object Function]"===en.call(e)};avalon.isFunction=un,avalon.isWindow=function(e){return Jt.test(en.call(e))},avalon.isPlainObject=function(e){return"[object Object]"===en.call(e)&&Object.getPrototypeOf(e)===Kt},avalon.mix=avalon.fn.mix=function(){var e,t,n,a,r,i,o=arguments[0]||{},l=1,c=arguments.length,s=!1;for("boolean"==typeof o&&(s=o,o=arguments[1]||{},l++),"object"==typeof o||un(o)||(o={}),l===c&&(o=this,l--);c>l;l++)if(null!=(e=arguments[l]))for(t in e)n=o[t],a=e[t],o!==a&&(s&&a&&(avalon.isPlainObject(a)||(r=Array.isArray(a)))?(r?(r=!1,i=n&&Array.isArray(n)?n:[]):i=n&&avalon.isPlainObject(n)?n:{},o[t]=avalon.mix(s,i,a)):void 0!==a&&(o[t]=a));return o},avalon.mix({rword:Ut,subscribers:Yt,version:1.53,ui:{},log:n,slice:function(e,t,n){return nn.call(e,t,n)},noop:i,error:function(e,t){throw new(t||Error)(e)},oneObject:o,range:function(e,t,n){n||(n=1),null==t&&(t=e||0,e=0);for(var a=-1,r=Math.max(0,Math.ceil((t-e)/n)),i=new Array(r);++an&&t(n,e[n])!==!1;n++);else for(n in e)if(e.hasOwnProperty(n)&&t(n,e[n])===!1)break}},getWidgetData:function(e,t){var n=avalon(e).data(),a={};for(var r in n)0===r.indexOf(t)&&(a[r.replace(t,"").replace(/\w/,function(e){return e.toLowerCase()})]=n[r]);return a},Array:{ensure:function(e,t){return-1===e.indexOf(t)?e.push(t):void 0},removeAt:function(e,t){return!!e.splice(t,1).length},remove:function(e,t){var n=e.indexOf(t);return~n?avalon.Array.removeAt(e,n):!1}}});var fn=avalon.bindingHandlers={},dn=avalon.bindingExecutors={},vn=avalon.directives={};avalon.directive=function(e,t){return fn[e]=t.init=t.init||i,dn[e]=t.update=t.update||i,vn[e]=t};var pn=new function(){function e(e){this.size=0,this.limit=e,this.head=this.tail=void 0,this._keymap={}}var t=e.prototype;return t.put=function(e,t){var n={key:e,value:t};return this._keymap[e]=n,this.tail?(this.tail.newer=n,n.older=this.tail):this.head=n,this.tail=n,this.size===this.limit?this.shift():this.size++,t},t.shift=function(){var e=this.head;e&&(this.head=this.head.newer,this.head.older=e.newer=e.older=this._keymap[e.key]=void 0,delete this._keymap[e.key])},t.get=function(e){var t=this._keymap[e];if(void 0!==t)return t===this.tail?t.value:(t.newer&&(t===this.head&&(this.head=t.newer),t.newer.older=t.older),t.older&&(t.older.newer=t.newer),t.newer=void 0,t.older=this.tail,this.tail&&(this.tail.newer=t),this.tail=t,t.value)},e};if(_t.contains||(Node.prototype.contains=function(e){return!!(16&this.compareDocumentPosition(e))}),avalon.contains=function(e,t){try{for(;t=t.parentNode;)if(t===e)return!0;return!1}catch(n){return!1}},e.SVGElement){var hn="http://www.w3.org/2000/svg",mn=_t.createElementNS(hn,"svg");mn.innerHTML='',Zt.test(mn.firstChild)||Object.defineProperties(SVGElement.prototype,{outerHTML:{enumerable:!0,configurable:!0,get:function(){return(new XMLSerializer).serializeToString(this)},set:function(e){var t=this.tagName.toLowerCase(),n=this.parentNode,a=avalon.parseHTML(e);if("svg"===t)n.insertBefore(a,this);else{var r=_t.createDocumentFragment();s(a,r),n.insertBefore(r,this)}n.removeChild(this)}},innerHTML:{enumerable:!0,configurable:!0,get:function(){var e=this.outerHTML,t=new RegExp("<"+this.nodeName+'\\b(?:(["\'])[^"]*?(\\1)|[^>])*>',"i"),n=new RegExp("$","i");return e.replace(t,"").replace(n,"")},set:function(e){if(avalon.clearHTML){avalon.clearHTML(this);var t=avalon.parseHTML(e);s(t,this)}}}})}var gn=avalon.eventHooks;"onmouseenter"in rn||avalon.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){gn[e]={type:t,fn:function(t,n){return function(a){var r=a.relatedTarget;return r&&(r===t||16&t.compareDocumentPosition(r))?void 0:(delete a.type,a.type=e,n.call(t,a))}}}}),avalon.each({AnimationEvent:"animationend",WebKitAnimationEvent:"webkitAnimationEnd"},function(t,n){e[t]&&!gn.animationend&&(gn.animationend={type:n})}),void 0===_t.onmousewheel&&(gn.mousewheel={type:"wheel",fn:function(e,t){return function(n){n.wheelDeltaY=n.wheelDelta=n.deltaY>0?-120:120,n.wheelDeltaX=0,Object.defineProperty(n,"type",{value:"mousewheel"}),t.call(e,n)}}});var yn,bn,$n,wn,xn,kn=/[-.*+?^${}()|[\]\/\\]/g,Cn={loader:function(t){var n=Vt&&t;e.require=n?Vt:Xt,e.define=n?Vt.define:zt},interpolate:function(e){if(yn=e[0],bn=e[1],yn===bn){throw new SyntaxError("openTag!==closeTag")}u.openTag=yn,u.closeTag=bn;var t=f(yn),n=f(bn);$n=new RegExp(t+"(.*?)"+n),wn=new RegExp(t+"(.*?)"+n,"g"),xn=new RegExp(t+".*?"+n+"|\\sms-")}};u.async=!0,u.debug=!0,u.plugins=Cn,u.plugins.interpolate(["{{","}}"]),u.paths={},u.shim={},u.maxRepeatSize=100,avalon.config=u;var Tn=avalon.vmodels={};avalon.define=function(e){var t=e.$id;t||n("warning: vm必须指定$id");var a=m(e);return a.$id=t,Tn[t]=a};var En=o("$id,$watch,$fire,$events,$model,$skipArray,$active,$pathname,$up,$track,$accessors"),Nn={get:function(){return C(this)},set:i,enumerable:!1,configurable:!0},An=["push","pop","shift","unshift","splice"],Sn=Array.prototype,Mn={notify:function(){v.call(this.$up,this.$pathname)},set:function(e,t){if(e>>>0===e&&this[e]!==t){if(e>this.length)throw Error(e+"set方法的第一个参数不能大于原数组长度");v.call(this.$up,this.$pathname+".*",[t,this[e]]),this.splice(e,1,t)}},contains:function(e){return-1!==this.indexOf(e)},ensure:function(e){return this.contains(e)||this.push(e),this},pushArray:function(e){return this.push.apply(this,e)},remove:function(e){return this.removeAt(this.indexOf(e))},removeAt:function(e){return e>>>0===e?this.splice(e,1):[]},size:function(){return this._.length},removeAll:function(e){if(Array.isArray(e))for(var t=this.length-1;t>=0;t--)-1!==e.indexOf(this[t])&&(On.call(this.$track,t,1),On.call(this,t,1));else if("function"==typeof e)for(t=this.length-1;t>=0;t--){var n=this[t];e(n,t)&&(On.call(this.$track,t,1),On.call(this,t,1))}else On.call(this.$track,0,this.length),On.call(this,0,this.length);an||(this.$model=C(this)),this.notify(),this._.length=this.length},clear:function(){return this.removeAll()}},On=Sn.splice;An.forEach(function(e){var t=Sn[e];Mn[e]=function(){for(var n=[],a=0,r=arguments.length;r>a;a++)n[a]=w(arguments[a],0,1,1);var i=t.apply(this,n);return N(this.$track,e,n),an||(this.$model=C(this)),this.notify(),this._.length=this.length,i}}),"sort,reverse".replace(Ut,function(e){Mn[e]=function(){var t=this.concat(),n=this,a=Math.random(),r=[],i=!1;Sn[e].apply(n,arguments);for(var o=0,l=t.length;l>o;o++){var c=n[o],s=t[o];if(c===s)r.push(o);else{var u=t.indexOf(c);r.push(u),t[u]=a,i=!0}}return i&&(T(this.$track,r),an||(this.$model=C(this)),this.notify()),this}});var Ln=function(){var e,t=[];return{begin:function(n){t.push(e),e=n},end:function(){e=t.pop()},collectDependency:function(t){e&&e.callback(t)}}}();avalon.injectBinding=function(e){e.handler=e.handler||vn[e.type].update||i,e.update=function(){var t=!1;e.getter||(t=!0,Ln.begin({callback:function(t){A(t,e)}}),e.getter=X(e.expr,e.vmodels,e),e.observers.forEach(function(t){t.v.$watch(t.p,e)}),delete e.observers);try{var a,r,i=e.fireArgs;if(delete e.fireArgs,i?(a=i[0],r=i[1]):a="on"===e.type?e.getter+"":e.getter.apply(0,e.args),r="undefined"==typeof r?e.oldValue:r,e._filters&&(a=rr.$filter.apply(0,[a].concat(e._filters))),e.signature){var o=avalon.type(a);if("array"!==o&&"object"!==o)throw Error("warning:"+e.expr+"只能是对象或数组");e.xtype=o;var l=S(e.proxies||[],o),c=a.$track||("array"===o?E(a.length):Object.keys(a));e.track=c,l!==c.join(";")&&(e.handler(a,r),e.oldValue=1)}else(Array.isArray(a)?a.length===(r&&r.length):1)?"oldValue"in e&&a===r||(e.handler(a,r),e.oldValue=a):(e.handler(a,r),e.oldValue=a.concat())}catch(s){delete e.getter,n("warning:exception throwed in [avalon.injectBinding] ",s);var u=e.element;u&&3===u.nodeType&&(u.nodeValue=yn+(e.oneTime?"::":"")+e.expr+bn)}finally{t&&Ln.end()}},e.update()};var Hn=0,jn=avalon.$$subscribers=[],Dn=new Date,Pn={},Rn=new function(){avalon.mix(this,{option:_t.createElement("select"),thead:_t.createElement("table"),td:_t.createElement("tr"),area:_t.createElement("map"),tr:_t.createElement("tbody"),col:_t.createElement("colgroup"),legend:_t.createElement("fieldset"),_default:_t.createElement("div"),g:_t.createElementNS("http://www.w3.org/2000/svg","svg")}),this.optgroup=this.option,this.tbody=this.tfoot=this.colgroup=this.caption=this.thead,this.th=this.td};String("circle,defs,ellipse,image,line,path,polygon,polyline,rect,symbol,text,use").replace(Ut,function(e){Rn[e]=Rn.g});var Bn=/<([\w:]+)/,qn=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,_n=o(["","text/javascript","text/ecmascript","application/ecmascript","application/javascript"]),Fn=_t.createElement("script"),Vn=/<|&#?\w+;/;avalon.parseHTML=function(e){var t=on.cloneNode(!1);if("string"!=typeof e)return t;if(!Vn.test(e))return t.appendChild(_t.createTextNode(e)),t;e=e.replace(qn,"<$1>").trim();var n,a=(Bn.exec(e)||["",""])[1].toLowerCase(),r=Rn[a]||Rn._default;r.innerHTML=e;var i=r.getElementsByTagName("script");if(i.length)for(var o,l=0;o=i[l++];)if(_n[o.type]){var c=Fn.cloneNode(!1);tn.forEach.call(o.attributes,function(e){c.setAttribute(e.name,e.value)}),c.text=o.text,o.parentNode.replaceChild(c,o)}for(;n=r.firstChild;)t.appendChild(n);return t},avalon.innerHTML=function(e,t){var n=this.parseHTML(t);this.clearHTML(e).appendChild(n)},avalon.clearHTML=function(e){for(e.textContent="";e.firstChild;)e.removeChild(e.firstChild);return e},"add,remove".replace(Ut,function(e){avalon.fn[e+"Class"]=function(t){var n=this[0];return t&&"string"==typeof t&&n&&1===n.nodeType&&t.replace(/\S+/g,function(t){n.classList[e](t)}),this}}),avalon.fn.mix({hasClass:function(e){var t=this[0]||{};return 1===t.nodeType&&t.classList.contains(e)},toggleClass:function(e,t){for(var n,a=0,r=String(e).split(/\s+/),i="boolean"==typeof t;n=r[a++];){var o=i?t:!this.hasClass(n);this[o?"addClass":"removeClass"](n)}return this},attr:function(e,t){return 2===arguments.length?(this[0].setAttribute(e,t),this):this[0].getAttribute(e) -},data:function(e,t){switch(e="data-"+D(e||""),arguments.length){case 2:return this.attr(e,t),this;case 1:var n=this.attr(e);return R(n);case 0:var a={};return tn.forEach.call(this[0].attributes,function(t){t&&(e=t.name,e.indexOf("data-")||(e=P(e.slice(5)),a[e]=R(t.value)))}),a}},removeData:function(e){return e="data-"+D(e),this[0].removeAttribute(e),this},css:function(e,t){if(avalon.isPlainObject(e))for(var n in e)avalon.css(this,n,e[n]);else var a=avalon.css(this,e,t);return void 0!==a?a:this},position:function(){var e,t,n=this[0],a={top:0,left:0};if(n)return"fixed"===this.css("position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),"HTML"!==e[0].tagName&&(a=e.offset()),a.top+=avalon.css(e[0],"borderTopWidth",!0),a.left+=avalon.css(e[0],"borderLeftWidth",!0),a.top-=e.scrollTop(),a.left-=e.scrollLeft()),{top:t.top-a.top-avalon.css(n,"marginTop",!0),left:t.left-a.left-avalon.css(n,"marginLeft",!0)}},offsetParent:function(){for(var e=this[0].offsetParent;e&&"static"===avalon.css(e,"position");)e=e.offsetParent;return avalon(e||rn)},bind:function(e,t,n){return this[0]?avalon.bind(this[0],e,t,n):void 0},unbind:function(e,t,n){return this[0]&&avalon.unbind(this[0],e,t,n),this},val:function(e){var t=this[0];if(t&&1===t.nodeType){var n=0===arguments.length,a=n?":get":":set",r=Gn[_(t)+a];if(r)var i=r(t,e);else{if(n)return(t.value||"").replace(/\r/g,"");t.value=e}}return n?i:this}}),rn.dataset&&(avalon.fn.data=function(e,t){e=e&&P(e);var n=this[0].dataset;switch(arguments.length){case 2:return n[e]=t,this;case 1:return t=n[e],R(t);case 0:var r=a();for(e in n)r[e]=R(n[e]);return r}});var In=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/;avalon.parseJSON=JSON.parse,avalon.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){avalon.fn[e]=function(n){var a=this[0]||{},r=B(a),i="scrollTop"===e;return arguments.length?void(r?r.scrollTo(i?r[t]:n,i?n:r[t]):a[e]=n):r?r[t]:a[e]}});var Yn=avalon.cssHooks=a(),Xn=["","-webkit-","-moz-","-ms-"],zn={"float":"cssFloat"};avalon.cssNumber=o("animationIterationCount,animationIterationCount,columnCount,order,flex,flexGrow,flexShrink,fillOpacity,fontWeight,lineHeight,opacity,orphans,widows,zIndex,zoom"),avalon.cssName=function(e,t,n){if(zn[e])return zn[e];t=t||rn.style;for(var a=0,r=Xn.length;r>a;a++)if(n=P(Xn[a]+e),n in t)return zn[e]=n;return null},Yn["@:set"]=function(e,t,n){e.style[t]=n},Yn["@:get"]=function(e,t){if(!e||!e.style)throw new Error("getComputedStyle要求传入一个节点 "+e);var n,a=getComputedStyle(e);return a&&(n="filter"===t?a.getPropertyValue(t):a[t],""===n&&(n=e.style[t])),n},Yn["opacity:get"]=function(e){var t=Yn["@:get"](e,"opacity");return""===t?"1":t},"top,left".replace(Ut,function(e){Yn[e+":get"]=function(t){var n=Yn["@:get"](t,e);return/px$/.test(n)?n:avalon(t).position()[e]+"px"}});var Wn={position:"absolute",visibility:"hidden",display:"block"},Un=/^(none|table(?!-c[ea]).+)/;"Width,Height".replace(Ut,function(e){var t=e.toLowerCase(),n="client"+e,a="scroll"+e,r="offset"+e;Yn[t+":get"]=function(t,n,a){var i=-4;"number"==typeof a&&(i=a),n="Width"===e?["Left","Right"]:["Top","Bottom"];var o=t[r];return 2===i?o+avalon.css(t,"margin"+n[0],!0)+avalon.css(t,"margin"+n[1],!0):(0>i&&(o=o-avalon.css(t,"border"+n[0]+"Width",!0)-avalon.css(t,"border"+n[1]+"Width",!0)),-4===i&&(o=o-avalon.css(t,"padding"+n[0],!0)-avalon.css(t,"padding"+n[1],!0)),o)},Yn[t+"&get"]=function(e){var n=[];q(e,n);for(var a,r=Yn[t+":get"](e),i=0;a=n[i++];){e=a.node;for(var o in a)"string"==typeof a[o]&&(e.style[o]=a[o])}return r},avalon.fn[t]=function(i){var o=this[0];if(0===arguments.length){if(o.setTimeout)return o["inner"+e];if(9===o.nodeType){var l=o.documentElement;return Math.max(o.body[a],l[a],o.body[r],l[r],l[n])}return Yn[t+"&get"](o)}return this.css(t,i)},avalon.fn["inner"+e]=function(){return Yn[t+":get"](this[0],void 0,-2)},avalon.fn["outer"+e]=function(e){return Yn[t+":get"](this[0],void 0,e===!0?2:0)}}),avalon.fn.offset=function(){var e=this[0];try{var t=e.getBoundingClientRect();if(t.width||t.height||e.getClientRects().length){var n=e.ownerDocument,a=n.documentElement,r=n.defaultView;return{top:t.top+r.pageYOffset-a.clientTop,left:t.left+r.pageXOffset-a.clientLeft}}}catch(i){return{left:0,top:0}}};var Gn={"select:get":function(e,t){for(var n,a=e.options,r=e.selectedIndex,i="select-one"===e.type||0>r,o=i?null:[],l=i?r+1:a.length,c=0>r?l:i?r:0;l>c;c++)if(n=a[c],(n.selected||c===r)&&!n.disabled){if(t=n.value,i)return t;o.push(t)}return o},"select:set":function(e,t,n){t=[].concat(t);for(var a,r=0;a=e.options[r++];)(a.selected=t.indexOf(a.value)>-1)&&(n=!0);n||(e.selectedIndex=-1)}},Zn={},Jn=["break,case,catch,continue,debugger,default,delete,do,else,false","finally,for,function,if,in,instanceof,new,null,return,switch,this","throw,true,try,typeof,var,void,while,with","abstract,boolean,byte,char,class,const,double,enum,export,extends","final,float,goto,implements,import,int,interface,long,native","package,private,protected,public,short,static,super,synchronized","throws,transient,volatile","arguments,let,yield,undefined"].join(",");Jn.replace(/\w+/g,function(e){Zn[e]=!0});var Kn=/[a-z_$]/i,Qn=/[\s\uFEFF\xA0]/,ea=/(\$proxy\$[a-z]+)\d+$/,ta=new pn(218),na=new pn(128),aa=/\)\s*$/,ra=/\)\s*\|/g,ia=/\|\s*([$\w]+)/g,oa=/"\s*\["/g,la=/"\s*\(/g,ca=JSON.stringify;avalon.scan=function(e,t){e=e||rn;var n=t?[].concat(t):[];nt(e,n)};var sa=o("area,base,basefont,br,col,command,embed,hr,img,input,link,meta,param,source,track,wbr,noscript,script,style,textarea".toUpperCase()),ua=function(e,t,n){var a=e.getAttribute(t);if(a)for(var r,i=0;r=n[i++];)if(r.hasOwnProperty(a)&&"function"==typeof r[a])return r[a]},fa=sn&&e.MutationObserver?function(e){for(var t,n=e.firstChild;n;){var a=n.nextSibling;3===n.nodeType?t?(t.nodeValue+=n.nodeValue,e.removeChild(n)):t=n:t=null,n=a}}:0,da=/^\s*::/,va=/ms-(\w+)-?(.*)/,pa=o("animationend,blur,change,input,click,dblclick,focus,keydown,keypress,keyup,mousedown,mouseenter,mouseleave,mousemove,mouseout,mouseover,mouseup,scan,scroll,submit"),ha=o("value,title,alt,checked,selected,disabled,readonly,enabled,href,src"),ma=/^if|widget|repeat$/,ga=/^each|with|html|include$/,ya=/^(ms-\S+|data-\S+|on[a-z]+|id|style|class|tabindex)$/,ba=/\|\s*html(?:\b|$)/,$a=/\|\|/g,wa=/(['"])(\\\1|.)+?\1/g,xa=function(){this.queue=[]};xa.prototype={render:function(e){if(!this.locked){this.locked=e?rn.offsetHeight+10:1;var t=this;avalon.nextTick(function(){t.flush()})}},flush:function(){for(var e,t=0;e=this.queue[t++];)e.update();this.locked=0,this.queue=[]}};var ka=new xa,Ca=[],Ta=[],Ea={$construct:function(){return avalon.mix.apply(null,arguments)},$ready:i,$init:i,$dispose:i,$container:null,$childReady:i,$replace:!1,$extend:null,$$template:function(e){return e}};avalon.components={},avalon.component=function(t,n){n&&(avalon.components[t]=avalon.mix({},Ea,n));for(var a,r=0;a=Ca[r];r++)t===a.fullName&&(Ca.splice(r,1),r--,function(n,a,r,i){var o=1,l=n.library,c=avalon.libraries[l]||Ea,s=Q(r),u=ot(n.vmodels,s.config||n.fullName),f=s.$id||s.identifier||cn(i);delete s.config,delete s.$id,delete s.identifier;var d={},v=avalon.components[a.$extend];v?(avalon.mix(!0,d,v),d=v.$construct.call(r,d,{},{})):avalon.mix(!0,d,a),d=avalon.components[t].$construct.call(r,d,u,s),d.$refs={},d.$id=f;var p=d.$slot,h=d.$replace,m=d.$container,g=d.$template;delete d.$slot,delete d.$replace,delete d.$container,delete d.$template,delete d.$construct;var y=avalon.define(d)||{};r.msResolved=1,y.$init(y,r),c.$init(y,r);for(var b,$,w=r.childNodes,x={},k=0;$=w[k++];){var C=1===$.nodeType&&$.getAttribute("slot")||p;C&&(x[C]?x[C].push($):x[C]=[$])}y.$$template&&(avalon.clearHTML(r),r.innerHTML=y.$$template(g));for(k in x)if(y.hasOwnProperty(k)){var T=x[k];if(T.length){for(var E=on.cloneNode(!0),N=0;b=T[N++];)E.appendChild(b);y[k]=E}x[k]=null}x=null;var A=r.firstChild;h&&(A=r.firstChild,r.parentNode.replaceChild(A,r),A.msResolved=1,r=n.element=A),m&&m.appendChild(r),avalon.fireDom(r,"datasetchanged",{library:l,vm:y,childReady:1});var S=0,M=avalon.bind(r,"datasetchanged",function(t){if(t.childReady&&t.library===l&&(o+=t.childReady,y!==t.vm&&(y.$refs[t.vm.$id]=t.vm,-1===t.childReady&&(S++,y.$childReady(y,r,t)),t.stopPropagation())),0===o){var a=setTimeout(function(){clearTimeout(a),y.$ready(y,r),c.$ready(y,r)},S?Math.max(17*S,100):17);avalon.unbind(r,"datasetchanged",M),n.rollback=function(){try{y.$dispose(y,r),c.$dispose(y,r)}catch(e){}delete avalon.vmodels[y.$id]},O(n,Ta),e.chrome&&r.addEventListener("DOMNodeRemovedFromDocument",function(){setTimeout(L)})}});if(nt(r,[y].concat(n.vmodels)),avalon.vmodels[y.$id]=y,r.childNodes.length)var H=setTimeout(function(){clearTimeout(H),avalon.fireDom(r,"datasetchanged",{library:l,vm:y,childReady:-1})},17);else avalon.fireDom(r,"datasetchanged",{library:l,vm:y,childReady:-1})}(a,avalon.components[t],a.element,a.widget))},avalon.fireDom=function(e,t,n){if(_t.createEvent){var a=_t.createEvent("Events");a.initEvent(t,!0,!0,n),avalon.mix(a,n),e.dispatchEvent(a)}else rn.contains(e)&&(a=_t.createEventObject(),avalon.mix(a,n),e.fireEvent("on"+t,a))},avalon.libraries=[],avalon.library=function(e,t){_t.namespaces&&_t.namespaces.add(e,"http://www.w3.org/1999/xhtml"),avalon.libraries[e]=avalon.mix({$init:i,$ready:i,$dispose:i},t||{})},avalon.library("ms");var Na=["autofocus,autoplay,async,allowTransparency,checked,controls","declare,disabled,defer,defaultChecked,defaultSelected","contentEditable,isMap,loop,multiple,noHref,noResize,noShade","open,readOnly,selected"].join(","),Aa={};Na.replace(Ut,function(e){Aa[e.toLowerCase()]=e});var Sa={"accept-charset":"acceptCharset","char":"ch",charoff:"chOff","class":"className","for":"htmlFor","http-equiv":"httpEquiv"},Ma=["accessKey,bgColor,cellPadding,cellSpacing,codeBase,codeType,colSpan","dateTime,defaultValue,frameBorder,longDesc,maxLength,marginWidth,marginHeight","rowSpan,tabIndex,useMap,vSpace,valueType,vAlign"].join(",");Ma.replace(Ut,function(e){Sa[e.toLowerCase()]=e});var Oa=avalon.directive("attr",{init:function(e){if(e.expr=z(e.expr.trim()),"include"===e.type){var t=e.element;dt(t,e),e.includeRendered=ua(t,"data-include-rendered",e.vmodels),e.includeLoaded=ua(t,"data-include-loaded",e.vmodels);var n=e.includeReplace=!!avalon(t).data("includeReplace");avalon(t).data("includeCache")&&(e.templateCache={}),e.start=_t.createComment("ms-include"),e.end=_t.createComment("ms-include-end"),n?(e.element=e.end,e._element=t,t.parentNode.insertBefore(e.end,t),t.parentNode.insertBefore(e.start,e.end)):(t.insertBefore(e.start,t.firstChild),t.appendChild(e.end))}},update:function(t){var n=this.element,a=this.param;if("href"===a||"src"===a){if("string"!=typeof t||rn.hasAttribute||(t=t.replace(/&/g,"&")),n[a]=t,e.chrome&&"EMBED"===n.tagName){var r=n.parentNode,i=document.createComment("ms-src");r.replaceChild(i,n),r.replaceChild(n,i)}}else{var o=t===!1||null===t||void 0===t;!an&&Sa[a]&&(a=Sa[a]);var l=Aa[a];if("boolean"==typeof n[l]&&(n[l]=!!t,t||(o=!0)),o)return n.removeAttribute(a);var c=Zt.test(n)?!1:_t.namespaces&&isVML(n)?!0:a in n.cloneNode(!1);c?n[a]=t+"":n.setAttribute(a,t)}}});"title,alt,src,value,css,include,href".replace(Ut,function(e){vn[e]=Oa}),avalon.directive("class",{init:function(e){var t=e.param,a=e.type;if(!t||isFinite(t)?(e.param="",vn.effect.init(e)):(n("ms-"+a+'-xxx="yyy"这种用法已经过时,请使用ms-'+a+'="xxx:yyy"'),e.expr="["+ca(t)+","+e.expr+"]",e.oldStyle=t),"hover"===a||"active"===a){if(!e.hasBindEvent){var r=e.element,i=avalon(r),o="mouseenter",l="mouseleave";if("active"===a){r.tabIndex=r.tabIndex||-1,o="mousedown",l="mouseup";var c=i.bind("mouseleave",function(){e.toggleClass&&i.removeClass(e.newClass)})}}var s=i.bind(o,function(){e.toggleClass&&i.addClass(e.newClass)}),u=i.bind(l,function(){e.toggleClass&&i.removeClass(e.newClass)});e.rollback=function(){i.unbind("mouseleave",c),i.unbind(o,s),i.unbind(l,u)},e.hasBindEvent=!0}},update:function(e){var t=this,n=avalon(this.element);t.newClass=e[0],t.toggleClass=!!e[1],t.oldClass&&t.newClass!==t.oldClass&&n.removeClass(t.oldClass),t.oldClass=t.newClass,"class"===t.type&&(t.oldStyle?n.toggleClass(t.oldStyle,!!e[1]):n.toggleClass(t.newClass,t.toggleClass))}}),"hover,active".replace(Ut,function(e){vn[e]=vn["class"]}),avalon.directive("css",{init:vn.attr.init,update:function(e){avalon(this.element).css(this.param,e)}}),avalon.directive("data",{priority:100,update:function(e){var t=this.element,n="data-"+this.param;e&&"object"==typeof e?t[n]=e:t.setAttribute(n,String(e))}});{var La=/^(?:checkbox|radio)$/,Ha=/^(?:radio|checked)$/;avalon.directive("duplex",{priority:2e3,init:function(e,t){function a(t){e.changed.call(this,t,e)}function r(){d=!0}function l(){d=!1}var c=e.element,s=e.vmodels;e.changed=ua(c,"data-duplex-changed",s)||i;var u=[],f=o("string,number,boolean,checked");"radio"===c.type&&""===e.param&&(e.param="checked"),e.param.replace(Gt,function(a){La.test(c.type)&&Ha.test(a)&&("radio"===a&&n("ms-duplex-radio已经更名为ms-duplex-checked"),a="checked",e.isChecked=!0,e.xtype="radio"),"bool"===a?(a="boolean",n("ms-duplex-bool已经更名为ms-duplex-boolean")):"text"===a&&(a="string",n("ms-duplex-text已经更名为ms-duplex-string")),f[a]&&(t=!0),avalon.Array.ensure(u,a)}),t||u.push("string"),e.param=u.join("-"),e.changed=ua(c,"binding-duplex-changed",s)||i,e.xtype||(e.xtype="SELECT"===c.tagName?"select":"checkbox"===c.type?"checkbox":"radio"===c.type?"radio":/^change/.test(c.getAttribute("data-duplex-event"))?"change":"input"),e.bound=function(t,n){c.addEventListener(t,n,!1);var a=e.rollback;e.rollback=function(){c.avalonSetter=null,avalon.unbind(c,t,n),a&&a()}};var d=!1,v=function(){var t=c.value;if(!d&&t!==e.oldValue){var n=e.pipe(t,e,"get");e.setter(n),a.call(c,n)}};switch(e.xtype){case"radio":e.bound("click",function(){var t=e.pipe(c.value,e,"get");e.setter(t),a.call(c,t)});break;case"checkbox":e.bound("change",function(){var t=c.checked?"ensure":"remove",r=e.getter.apply(0,e.vmodels);Array.isArray(r)||(n("ms-duplex应用于checkbox上要对应一个数组"),r=[r]);var i=e.pipe(c.value,e,"get");avalon.Array[t](r,i),a.call(c,r)});break;case"change":e.bound("change",v);break;case"input":sn?e.bound("input",v):(e.bound("input",v),e.bound("compositionstart",r),e.bound("compositionend",l),e.bound("DOMAutoComplete",v));break;case"select":e.bound("change",function(){var t=avalon(c).val();t=Array.isArray(t)?t.map(function(t){return e.pipe(t,e,"get")}):e.pipe(t,e,"get"),t+""!==e.oldValue&&(e.setter(t),a.call(c,t))})}"input"===e.xtype&&/^(text|password|hidden)/.test(c.type)&&Pa(function(){if(rn.contains(c))e.oldValue!==c.value&&v();else if(!c.msRetain)return!1}),c.avalonSetter=v;for(var p in avalon.vmodels){var h=avalon.vmodels[p];h.$fire("avalon-ms-duplex-init",e)}var m=e.pipe||(e.pipe=st);m(null,e,"init")},update:function(e){var t,n=this.element,a=this;switch(this.xtype){case"input":case"change":t=this.pipe(e,this,"set"),t!==this.oldValue&&(n.value=this.oldValue=t);break;case"radio":t=a.isChecked?!!e:e+""===n.value,n.checked=t;break;case"checkbox":var r=[].concat(e);t=this.pipe(n.value,this,"get"),n.checked=r.indexOf(t)>-1;break;case"select":a._value=e,n.msHasEvent="selectDuplex",avalon.bind(n,"datasetchanged",function(e){if("selectDuplex"===e.bubble){var t=a._value,r=Array.isArray(t)?t.map(String):t+"";avalon(n).val(r),n.oldValue=r+"",a.changed.call(n,r)}})}"select"!==a.xtype&&a.changed.call(n,t)}})}avalon.duplexHooks={checked:{get:function(e,t){return!t.element.oldValue}},string:{get:function(e){return e},set:ct},"boolean":{get:function(e){return"true"===e},set:ct},number:{get:function(e,t){var n=parseFloat(e);if(-e===-n)return n;var a=/strong|medium|weak/.exec(t.element.getAttribute("data-duplex-number"))||["medium"];switch(a[0]){case"strong":return 0;case"medium":return""===e?"":0;case"weak":return e}},set:ct}};var ja,Da=[];avalon.tick=function(e){1===Da.push(e)&&(ja=setInterval(ut,60))};var Pa=i;!new function(){function e(e){t[this.tagName].call(this,e),"function"==typeof this.avalonSetter&&this.oldValue!==e&&this.avalonSetter()}try{var t={},n=HTMLInputElement.prototype,a=HTMLTextAreaElement.prototype,r=HTMLInputElement.prototype;Object.getOwnPropertyNames(r),t.INPUT=Object.getOwnPropertyDescriptor(n,"value").set,Object.defineProperty(n,"value",{set:e}),t.TEXTAREA=Object.getOwnPropertyDescriptor(a,"value").set,Object.defineProperty(a,"value",{set:e})}catch(i){Pa=avalon.tick}},avalon.directive("effect",{priority:5,init:function(e){var t,n,a=e.expr,r=a.replace(wn,function(e){return e.replace(/./g,"0")}).indexOf(":");-1===r?(t=a,n=!0):(t=a.slice(0,r),n=a.slice(r+1)),t=$n.test(a)?z(t):ca(t),e.expr="["+t+","+n+"]"},update:function(t){var n=t[0],a=this.element;if(a.getAttribute("data-effect-name")!==n){a.removeAttribute("data-effect-driver");var r=a.style,i=e.getComputedStyle?e.getComputedStyle(a):null,o=!1;if(i&&(qa||_a)){var l=r[Fa]||i[Fa];l&&"0s"!==l&&(a.setAttribute("data-effect-driver","t"),o=!0),o||(l=r[Va]||i[Va],l&&"0s"!==l&&(a.setAttribute("data-effect-driver","a"),o=!0))}o||avalon.effects[n]&&(a.setAttribute("data-effect-driver","j"),o=!0),o&&a.setAttribute("data-effect-name",n)}}}),avalon.effects={},avalon.effect=function(e,t){avalon.effects[e]=t};var Ra,Ba,qa=!1,_a=!1,Fa=avalon.cssName("transition-duration"),Va=avalon.cssName("animation-duration");!new function(){var t,n={TransitionEvent:"transitionend",WebKitTransitionEvent:"webkitTransitionEnd",OTransitionEvent:"oTransitionEnd",otransitionEvent:"otransitionEnd"};for(var a in n){if(e[a]){t=n[a];break}try{{document.createEvent(a)}t=n[a];break}catch(r){}}"string"==typeof t&&(qa=!0,Ra=t),n={AnimationEvent:"animationend",WebKitAnimationEvent:"webkitAnimationEnd"};var i;for(a in n)if(e[a]){i=n[a];break}"string"==typeof i&&(qa=!0,Ba=i)};var Ia=[],Ya=new xa;pt.prototype={contrustor:pt,enterClass:function(){return ht(this,"enter")},leaveClass:function(){return ht(this,"leave")},actionFun:function(e,t,n){if(!document.hidden){var a=this,r=a.el,i="leave"===e;e=i?"leave":"enter";var o=i?"enter":"leave";mt(a,"abort"+vt(o)),mt(a,"before"+vt(e)),i||t(r);var l=function(o){r.removeEventListener(a.cssEvent,a.cssCallback),i?(t(r),avalon(r).removeClass(a.cssClass)):"a"===a.driver&&avalon(r).removeClass(a.cssClass),o!==!0&&(mt(a,"after"+vt(e)),n&&n(r)),a.dispose()};a.useCss?(a.cssCallback&&a.cssCallback(!0),a.cssClass=ht(a,e),a.cssCallback=l,a.update=function(){r.addEventListener(a.cssEvent,a.cssCallback),i||"t"!==a.driver||avalon(r).removeClass(a.cssClass)},avalon(r).addClass(a.cssClass),Ya.render(!0),Ya.queue.push(a)):mt(a,e,l)}},enter:function(){this.actionFun.apply(this,["enter"].concat(avalon.slice(arguments)))},leave:function(){this.actionFun.apply(this,["leave"].concat(avalon.slice(arguments)))},dispose:function(){this.update=this.cssCallback=null,Ia.unshift(this)>100&&Ia.pop()}};var Xa=function(e,t){var n=nn.call(arguments,0);"function"!=typeof n[2]&&n.splice(2,0,i),"function"!=typeof n[3]&&n.splice(3,0,i);var a=n[2],r=n[3],o=n[4],l=ft(e,o);if(!l)return a(),r(),!1;var c=t?"enter":"leave";l[c](a,r)};avalon.mix(avalon.effect,{apply:Xa,append:function(e,t,n,a){return Xa(e,1,function(){t.appendChild(e)},n,a)},before:function(e,t,n,a){return Xa(e,1,function(){t.parentNode.insertBefore(e,t)},n,a)},remove:function(e,t,n,a){return Xa(e,0,function(){e.parentNode===t&&t.removeChild(e)},n,a)}}),avalon.directive("html",{update:function(e){var t=this,n=this.element,a=1!==n.nodeType,r=a?n.parentNode:n;if(r){if(e=null==e?"":e,3===n.nodeType){var i=cn("html");r.insertBefore(_t.createComment(i),n),t.element=_t.createComment(i+":end"),r.replaceChild(t.element,n),n=t.element}if("object"!=typeof e)var o=avalon.parseHTML(String(e));else if(11===e.nodeType)o=e;else if(1===e.nodeType||e.item){var l=1===e.nodeType?e.childNodes:e.item;for(o=on.cloneNode(!0);l[0];)o.appendChild(l[0])}if(l=avalon.slice(o.childNodes),a){for(var c=n.nodeValue.slice(0,-4);;){var s=n.previousSibling;if(!s||8===s.nodeType&&s.nodeValue===c)break;r.removeChild(s)}r.insertBefore(o,n)}else avalon.clearHTML(n).appendChild(o);tt(l,t.vmodels)}}}),avalon.directive("if",{priority:10,update:function(e){function t(){r.getAttribute(a.name)&&(r.removeAttribute(a.name),K(r,a.vmodels)),a.rollback=null}var n,a=this,r=this.element,i=a.stamp=+new Date,o=function(){i===a.stamp&&(a.recoverNode=null)};a.recoverNode&&a.recoverNode();try{if(!r.parentNode)return;n=r.parentNode}catch(l){return}if(e){if(8===r.nodeType){var c=a.keep,s=avalon.effect.apply(c,1,function(){i===a.stamp&&(r.parentNode.replaceChild(c,r),r=a.element=c,c.getAttribute("_required")&&(r.required=!0,r.removeAttribute("_required")),r.querySelectorAll&&avalon.each(r.querySelectorAll("[_required=true]"),function(e){e.required=!0,e.removeAttribute("_required")}),t())},o);s=s===!1}s||t()}else if(1===r.nodeType){r.required===!0&&(r.required=!1,r.setAttribute("_required","true"));try{avalon.each(r.querySelectorAll(":required"),function(e){r.required=!1,e.setAttribute("_required","true")})}catch(l){}var u=a.element=_t.createComment("ms-if"),f=r.nextSibling;a.recoverNode=function(){a.recoverNode=null,u.parentNode!==n&&(n.insertBefore(u,f),a.keep=r)},avalon.effect.apply(r,0,function(){a.recoverNode=null,i===a.stamp&&(r.parentNode.replaceChild(u,r),a.keep=r,It.appendChild(r),a.rollback=function(){r.parentNode===It&&It.removeChild(r)})},o)}}});var za=function(){return new e.XMLHttpRequest},Wa=avalon.templateCache={};avalon.directive("include",{init:vn.attr.init,update:function(e){var t=this,n=this.element,a=t.vmodels,r=t.includeRendered,i=t.effectName&&t.effectClass,o=t.templateCache,l=t.includeReplace,c=t.includeLoaded,s=l?n.parentNode:n,u=t._element;t.recoverNodes=t.recoverNodes||avalon.noop;var f=(l&&u.cloneNode(),function(f){var d=t._stamp=+new Date;if(c){var v=c.apply(s,[f].concat(a));"string"==typeof v&&(f=v)}r&&U(s,function(){r.call(s)},0/0);var p=t.includeLastID||"_default";t.includeLastID=e;var h=o&&o[p]||_t.createElement(n.tagName||t._element.tagName);i&&(h.className=i,s.insertBefore(h,t.start)),(o||{})[p]=h;var m=t.recoverNodes();for(m&&s.insertBefore(m,t.end);;){var g=t.start.nextSibling;if(!g||g===h||g===t.end)break;h.appendChild(g)}avalon.effect.remove(h,s,function(){o&&d===t._stamp&&It.appendChild(h)},t);var y=s,b=avalon.noop,$=avalon.noop,w=gt(t,e,f),x=avalon.slice(w.childNodes);l&&i?(y=u,y.innerHTML="",y.setAttribute("ms-skip","true"),s.insertBefore(y,t.end.nextSibling),b=function(){y.insertBefore(w,null)},$=function(){t.recoverNodes=avalon.noop,d===t._stamp&&(w=yt(x),s.insertBefore(w,t.end),tt(x,a)),y.parentNode===s&&s.removeChild(y)},t.recoverNodes=function(){return t.recoverNodes=avalon.noop,yt(x)}):b=function(){s.insertBefore(w,t.end),tt(x,a)},avalon.effect.apply(y,"enter",b,$)});if("src"===t.param)if("string"==typeof Wa[e])avalon.nextTick(function(){f(Wa[e])});else if(Array.isArray(Wa[e]))Wa[e].push(f);else{var d=za();d.onload=function(){for(var t,n=d.responseText,a=0;t=Wa[e][a++];)t(n);Wa[e]=n},Wa[e]=[f],d.open("GET",e,!0),"withCredentials"in d&&(d.withCredentials=!0),d.setRequestHeader("X-Requested-With","XMLHttpRequest"),d.send(null)}else{var v=e&&1===e.nodeType?e:_t.getElementById(e);v&&avalon.nextTick(function(){f(v.value||v.innerText||v.innerHTML)})}}});var Ua=/\(([^)]*)\)/,Ga=avalon.directive("on",{priority:3e3,init:function(e){var t=e.expr;e.type="on";var n=e.param.replace(/-\d+$/,"");if("function"==typeof Ga[n+"Hook"]&&Ga[n+"Hook"](e),t.indexOf("(")>0&&t.indexOf(")")>-1){var a=(t.match(Ua)||["",""])[1].trim();(""===a||"$event"===a)&&(t=t.replace(Ua,""))}e.expr=t},update:function(e){var t=this,n=this.element;e=function(e){var n=t.getter||i;return n.apply(this,t.args.concat(e))};var a=t.param.replace(/-\d+$/,"");if("scan"===a)e.call(n,{type:a});else if("function"==typeof t.specialBind)t.specialBind(n,e);else var r=avalon.bind(n,a,e);t.rollback=function(){"function"==typeof t.specialUnbind?t.specialUnbind():avalon.unbind(n,a,r)}}});avalon.directive("repeat",{priority:90,init:function(e){var t=e.type;e.cache={},e.enterCount=0;var n=e.element;if(1===n.nodeType){n.removeAttribute(e.name),dt(n,e),e.param=e.param||"el",e.sortedCallback=ua(n,"data-with-sorted",e.vmodels);var a=ua(n,"data-"+t+"-rendered",e.vmodels),r=cn(t),i=_t.createComment(r+":start"),o=e.element=_t.createComment(r+":end");if(e.signature=r,e.start=i,e.template=on.cloneNode(!1),"repeat"===t){var l=n.parentNode;l.replaceChild(o,n),l.insertBefore(i,o),e.template.appendChild(n)}else{for(;n.firstChild;)e.template.appendChild(n.firstChild);n.appendChild(i),n.appendChild(o),l=n}if(e.element=o,a)var c=avalon.bind(l,"datasetchanged",function(){a.apply(l,l.args),avalon.unbind(l,"datasetchanged",c),l.msRendered=a})}},update:function(e,t){var n=this,a=this.xtype;this.enterCount+=1;var r=!t;if(r){n.$outer={};var i="$key",o="$val";"array"===a&&(i="$first",o="$last");for(var l,c=0;l=n.vmodels[c++];)if(l.hasOwnProperty(i)&&l.hasOwnProperty(o)){n.$outer=l;break}}var s=this.track;if(n.sortedCallback){var f=n.sortedCallback.call($,s);f&&Array.isArray(f)&&(s=f)}var d="move";n.$repeat=e;var v=[],p=r&&on.cloneNode(!1),h=[],m=this.param,g=avalon.mix({},this.cache),y=this.element,b=s.length,$=y.parentNode;for(c=0;b>c;c++){var w=s[c],x=g[w];if(x)v.push({}),g[w]=!0;else{x=kt(this),"array"===a?(d="add",x.$id=w,x[m]=e[c]):(d="append",x.$key=w,x.$val=e[w]),this.cache[w]=x;var k=x.$anchor||(x.$anchor=y.cloneNode(!1));k.nodeValue=this.signature,xt(n,p,x,v,r&&!n.effectDriver),Et(x,n,a)}1===this.enterCount&&(x.$active=!1,x.$oldIndex=x.$index,x.$active=!0,x.$index=c),"array"===a?(x.$first=0===c,x.$last=c===b-1):x.$val=C(e[w]),h.push(x)}if(this.proxies=h,r&&!n.effectDriver)$.insertBefore(p,y),v.forEach(function(e){tt(e.nodes||[],e.vmodels),e.nodes=e.vmodels=null});else{var T=n.staggerIndex=0;for(w in g)g[w]!==!0&&(d="del",wt(g[w].$anchor,n),St(this.cache,w,m),g[w]=null);for(c=0;b>c;c++){x=h[c],w="array"===a?x.$id:x.$key;var E=h[c-1],N=E?E.$anchor:n.start;g[w]?x.$index!==x.$oldIndex&&!function(e,t){T=$t(n.effectEnterStagger,function(){var a=wt(e.$anchor),r=avalon.slice(a.childNodes);$.insertBefore(a,t.nextSibling),bt(r,1,n)},T)}(x,N):!function(e,t){var a=e.nodes,r=e.vmodels;a&&(T=$t(n.effectEnterStagger,function(){$.insertBefore(e.content,t.nextSibling),tt(a,r),bt(a,1,n)},T)),e.nodes=e.vmodels=null}(v[c],N)}}if(!e.$track)for(w in this.cache)St(this.cache,w,m);!function(e){$.args=e,$.msRendered&&$.msRendered.apply($,e)}(u.newWatch?arguments:[d]);var A=setTimeout(function(){clearTimeout(A),avalon.fireDom($,"datasetchanged",{bubble:$.msHasEvent})});this.enterCount-=1}}),"with,each".replace(Ut,function(e){vn[e]=avalon.mix({},vn.repeat,{priority:1400})});var Za=[],Ja=[];avalon.directive("text",{update:function(e){var t=this.element;if(e=null==e?"":e,3===t.nodeType)try{t.data=e}catch(n){}else t.textContent=e}}),avalon.parseDisplay=Mt,avalon.directive("visible",{init:function(){},update:function(e){var t=this.element,n=this,a=n.stamp=+new Date;e?(t.style.display="none",avalon.effect.apply(t,1,function(){if(a===n.stamp){var e=t.getAttribute("data-effect-driver")||"a";/^[atn]/.test(e)&&(this.effectName||(t.style.display=""),"none"===avalon(t).css("display")&&(t.style.display=Mt(t.nodeName)))}})):avalon.effect.apply(t,0,function(){a===n.stamp&&(t.style.display="none")})}});var Ka=/]*>([\S\s]*?)<\/script\s*>/gim,Qa=/\s+(on[^=\s]+)(?:=("[^"]*"|'[^']*'|[^\s>]+))?/g,er=/<\w+\b(?:(["'])[^"]*?(\1)|[^>])*>/gi,tr={a:/\b(href)\=("javascript[^"]*"|'javascript[^']*')/gi,img:/\b(src)\=("javascript[^"]*"|'javascript[^']*')/gi,form:/\b(action)\=("javascript[^"]*"|'javascript[^']*')/gi},nr=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ar=/([^\#-~| |!])/g,rr=avalon.filters={uppercase:function(e){return e.toUpperCase()},lowercase:function(e){return e.toLowerCase()},truncate:function(e,t,n){return t=t||30,n="string"==typeof n?n:"...",e.length>t?e.slice(0,t-n.length)+n:String(e)},$filter:function(e){for(var t=1,n=arguments.length;n>t;t++){var a=arguments[t],r=avalon.filters[a[0]];if("function"==typeof r){var i=[e].concat(a.slice(1));e=r.apply(null,i)}}return e},camelize:P,sanitize:function(e){return e.replace(Ka,"").replace(er,function(e){var t=e.toLowerCase().match(/<(\w+)\s/);if(t){var n=tr[t[1]];n&&(e=e.replace(n,function(e,t,n){var a=n.charAt(0);return t+"="+a+"javascript:void(0)"+a}))}return e.replace(Qa," ").replace(/\s+/g," ")})},escape:function(e){return String(e).replace(/&/g,"&").replace(nr,function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1);return"&#"+(1024*(t-55296)+(n-56320)+65536)+";"}).replace(ar,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")},currency:function(e,t,n){return(t||"¥")+Ot(e,isFinite(n)?n:2)},number:Ot};!new function(){function e(e){return parseInt(e,10)||0}function t(e,t,n){var a="";for(0>e&&(a="-",e=-e),e=""+e;e.length0||o>-a)&&(o+=a),0===o&&-12===a&&(o=12),t(o,n,r)}}function a(e,t){return function(n,a){var r=n["get"+e](),i=(t?"SHORT"+e:e).toUpperCase();return a[i][r]}}function r(e){var n=-1*e.getTimezoneOffset(),a=n>=0?"+":"";return a+=t(Math[n>0?"floor":"ceil"](n/60),2)+t(Math.abs(n%60),2)}function i(e,t){return e.getHours()<12?t.AMPMS[0]:t.AMPMS[1]}var o={yyyy:n("FullYear",4),yy:n("FullYear",2,0,!0),y:n("FullYear",1),MMMM:a("Month"),MMM:a("Month",!0),MM:n("Month",2,1),M:n("Month",1,1),dd:n("Date",2),d:n("Date",1),HH:n("Hours",2),H:n("Hours",1),hh:n("Hours",2,-12),h:n("Hours",1,-12),mm:n("Minutes",2),m:n("Minutes",1),ss:n("Seconds",2),s:n("Seconds",1),sss:n("Milliseconds",3),EEEE:a("Day"),EEE:a("Day",!0),a:i,Z:r},l=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,c=/^\/Date\((\d+)\)\/$/;rr.date=function(t,n){var a,r,i=rr.date.locate,s="",u=[];if(n=n||"mediumDate",n=i[n]||n,"string"==typeof t)if(/^\d+$/.test(t))t=e(t);else if(c.test(t))t=+RegExp.$1;else{var f=t.trim(),d=[0,0,0,0,0,0,0],v=new Date(0);f=f.replace(/^(\d+)\D(\d+)\D(\d+)/,function(t,n,a,r){var i=4===r.length?[r,n,a]:[n,a,r];return d[0]=e(i[0]),d[1]=e(i[1])-1,d[2]=e(i[2]),""});var p=v.setFullYear,h=v.setHours;f=f.replace(/[T\s](\d+):(\d+):?(\d+)?\.?(\d)?/,function(t,n,a,r,i){return d[3]=e(n),d[4]=e(a),d[5]=e(r),i&&(d[6]=Math.round(1e3*parseFloat("0."+i))),""});var m=0,g=0;f=f.replace(/Z|([+-])(\d\d):?(\d\d)/,function(t,n,a,r){return p=v.setUTCFullYear,h=v.setUTCHours,n&&(m=e(n+a),g=e(n+r)),""}),d[3]-=m,d[4]-=g,p.apply(v,d.slice(0,3)),h.apply(v,d.slice(3)),t=v}if("number"==typeof t&&(t=new Date(t)),"date"===avalon.type(t)){for(;n;)r=l.exec(n),r?(u=u.concat(r.slice(1)),n=u.pop()):(u.push(n),n=null);return u.forEach(function(e){a=o[e],s+=a?a(t,i):e.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),s}};var s={AMPMS:{0:"上午",1:"下午"},DAY:{0:"星期日",1:"星期一",2:"星期二",3:"星期三",4:"星期四",5:"星期五",6:"星期六"},MONTH:{0:"1月",1:"2月",2:"3月",3:"4月",4:"5月",5:"6月",6:"7月",7:"8月",8:"9月",9:"10月",10:"11月",11:"12月"},SHORTDAY:{0:"周日",1:"周一",2:"周二",3:"周三",4:"周四",5:"周五",6:"周六"},fullDate:"y年M月d日EEEE",longDate:"y年M月d日",medium:"yyyy-M-d H:mm:ss",mediumDate:"yyyy-M-d",mediumTime:"H:mm:ss","short":"yy-M-d ah:mm",shortDate:"yy-M-d",shortTime:"ah:mm"};s.SHORTMONTH=s.MONTH,rr.date.locate=s};var ir,or=[],lr=function(e){for(ir=!0,Vt&&(modules["domReady!"].state=4,Vt.checkDeps());e=or.shift();)e(avalon)};"complete"===_t.readyState?setTimeout(lr):_t.addEventListener("DOMContentLoaded",lr),e.addEventListener("load",lr),avalon.ready=function(e){ir?e(avalon):or.push(e)},avalon.config({loader:!0}),avalon.ready(function(){avalon.scan(_t.body)});var cr=navigator.userAgent.toLowerCase(),sr=cr.indexOf("android")>0,ur=Lt();avalon.gestureHooks={add:function(e,t){function n(e){t.touchmove(e)}function a(e){t.touchend(e),document.removeEventListener("touchmove",n,!1),document.removeEventListener("touchend",a,!1),document.removeEventListener("touchcancel",r,!1)}function r(e){t.touchcancel(e),document.removeEventListener("touchmove",n,!1),document.removeEventListener("touchend",a,!1),document.removeEventListener("touchcancel",r,!1)}t.events.forEach(function(i){avalon.eventHooks[i]={fn:function(i,o){return i.getAttribute("data-"+e)||(i.setAttribute("data-"+e,"1"),i.addEventListener("touchstart",function(e){t.touchstart(e),document.addEventListener("touchmove",n,!1),document.addEventListener("touchend",a,!1),document.addEventListener("touchcancel",r,!1) -},!1)),o}}})}};var fr={},dr=["screenX","screenY","clientX","clientY","pageX","pageY"],vr={trackingClick:!1,trackingClickStart:0,targetElement:null,touchStartX:0,touchStartY:0,touchBoundary:10,tapDelay:200,sendClick:function(t,n){Rt(t,"tap",{fastclick:!0});var a,r;document.activeElement&&document.activeElement!==t&&document.activeElement.blur(),r=n.changedTouches[0],a=document.createEvent("MouseEvents"),a.initMouseEvent("click",!0,!0,e,1,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),a.fastclick=!0,t.dispatchEvent(a)},needClick:function(e){switch(e.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(e.disabled)return!0;break;case"input":if(ur&&"file"===e.type||e.disabled)return!0;break;case"label":case"iframe":case"video":return!0}return!1},focus:function(e){var t;ur&&e.setSelectionRange&&0!==e.type.indexOf("date")&&"time"!==e.type?(t=e.value.length,e.setSelectionRange(t,t)):e.focus()},needFocus:function(e){switch(e.nodeName.toLowerCase()){case"textarea":case"select":return!0;case"input":switch(e.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return!1}return!e.disabled&&!e.readOnly;default:return!1}},updateScrollParent:function(e){var t=e.fastClickScrollParent;if(!t||!t.contains(e)){var n=e;do{if(n.scrollHeight>n.offsetHeight){t=n,e.fastClickScrollParent=n;break}n=n.parentElement}while(n)}t&&(t.fastClickLastScrollTop=t.scrollTop)},findControl:function(e){return void 0!==e.control?e.control:e.htmlFor?document.getElementById(e.htmlFor):e.querySelector("button, input:not([type=hidden]), keygen,meter, output, progress, select, textarea")},touchHasMoved:function(e){var t=e.changedTouches[0],n=vr.touchBoundary;return Math.abs(t.pageX-vr.touchStartX)>n||Math.abs(t.pageY-vr.touchStartY)>n?!0:!1},fixTarget:function(t){return e.SVGElementInstance&&t instanceof SVGElementInstance&&(t=t.correspondingUseElement),t}};supportPointer=!!navigator.pointerEnabled||!!navigator.msPointerEnabled,supportPointer&&(rn.style.msTouchAction=rn.style.touchAction="none"),avalon.gestureHooks.add("tap",{events:["tap","click"],touchstart:function(t){var n,a,r;if(t.targetTouches.length>1)return!0;if(n=vr.fixTarget(t.target),a=t.targetTouches[0],ur){if(r=e.getSelection(),r.rangeCount&&!r.isCollapsed)return!0;vr.updateScrollParent(n)}return vr.trackingClick=!0,vr.trackingClickStart=t.timeStamp,vr.targetElement=n,vr.touchStartX=a.pageX,vr.touchStartY=a.pageY,t.timeStamp-vr.lastClickTimevr.tapDelay||!vr.trackingClick)return!0;if(t.timeStamp-vr.lastClickTime100||ur&&e.top!==e&&"input"===r?(vr.targetElement=null,!1):(vr.focus(o),sr&&vr.sendClick(o,t),!1);return ur&&(i=o.fastClickScrollParent,i&&i.fastClickLastScrollTop!==i.scrollTop)?!0:(vr.needClick(o)||(t.preventDefault(),vr.sendClick(o,t)),!1)},touchcancel:function(){vr.trackingClick=!1,vr.targetElement=null}});var pr={events:["swipe","swipeleft","swiperight","swipeup","swipedown"],touchstart:function(e){jt(e,i)},touchmove:function(e){Dt(e,i)},touchend:function(e){Pt(e,function(t,n){var a=Date.now(),r=t.distance>100&&t.distance/t.duration>.65;if(r){var i,o=n.clientX-t.startTouch.clientX,l=n.clientY-t.startTouch.clientY,c={duration:a-t.startTime,isflick:r,displacementX:o,displacementY:l,touch:n,touchEvent:e,isVertical:t.isVertical},s=t.element;Rt(s,"swipe",c),i=t.isVertical?l>0?"down":"up":l>0?"right":"left",Rt(s,"swipe"+i,c)}})}};pr.touchcancel=pr.touchend,avalon.gestureHooks.add("swipe",pr);var hr=null,mr={events:["longtap","doubletap"],touchstart:function(e){jt(e,function(e,t){e.pressingHandler=setTimeout(function(){"tapping"===e.status&&(e.status="pressing",Rt(t.target,"longtap",{touchEvent:t})),Bt(e)},500)})},touchmove:function(e){Dt(e,function(e){e.distance>10&&e.pressingHandler&&(Bt(e),("tapping"===e.status||"pressing"===e.status)&&(e.status="panning"))})},touchend:function(e){Pt(e,function(t,n){Bt(t),"tapping"===t.status&&(t.timestamp=Date.now(),hr&&t.timestamp-hr.timestamp<300&&Rt(t.element,"doubletap",{touch:n,touchEvent:e}),hr=t)})},touchcancel:function(e){Pt(e,function(e){Bt(e)})}};avalon.gestureHooks.add("press",mr),"function"==typeof define&&define.amd&&define("avalon",[],function(){return avalon});var gr=e.avalon;return avalon.noConflict=function(t){return t&&e.avalon===avalon&&(e.avalon=gr),avalon},void 0===t&&(e.avalon=avalon),avalon}); \ No newline at end of file +!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("Avalon requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(){avalon.config.debug&&console.log.apply(console,arguments)}function a(){return Object.create(null)}function r(e){return Function.apply(i,e)}function i(){}function o(e,t){"string"==typeof e&&(e=e.match(It)||[]);for(var n={},a=void 0!==t?t:1,r=0,i=e.length;i>r;r++)n[e[r]]=a;return n}function l(){if(e.VBArray){var t=document.documentMode;return t?t:e.XMLHttpRequest?7:6}return 0/0}function s(e){if(e&&"object"==typeof e){var t=e.length,n=Gt.call(e);if(/(Array|List|Collection|Map|Arguments)\]$/.test(n))return!0;if("[object Object]"===n&&t===t>>>0)return!0}return!1}function c(e,t){if(e&&e.childNodes)for(var n,a=e.childNodes,r=0;n=a[r++];)if(n.tagName){var i=Ht.createElementNS(un,n.tagName.toLowerCase());Zt.forEach.call(n.attributes,function(e){i.setAttribute(e.name,e.value)}),c(n,i),t.appendChild(i)}}function u(e){for(var t in e)if(Ut.call(e,t)){var n=e[t];"function"==typeof u.plugins[t]?u.plugins[t](n):"object"==typeof u[t]?avalon.mix(u[t],n):u[t]=n}return this}function f(e){return(e+"").replace(yn,"\\$&")}function d(e,t){var n=this.$events||(this.$events={}),a=n[e]||(n[e]=[]);if("function"==typeof t){var r=t;r.uniqueNumber=Math.random(),t={element:Qt,type:"user-watcher",handler:i,vmodels:[this],expr:e,uniqueNumber:r.uniqueNumber},t.wildcard=/\*/.test(e)}if(t.update)t.oneTime||avalon.Array.ensure(a,t);else{if(/\w\.*\B/.test(e)){t.getter=i;var o=this;t.update=function(){var e=this.fireArgs||[];e[2]&&t.handler.apply(o,e),delete this.fireArgs},a.sync=!0,avalon.Array.ensure(a,t)}else avalon.injectBinding(t);r&&(t.handler=r)}return function(){t.update=t.getter=t.handler=i,t.element=Ht.createElement("a")}}function v(e,t){var n=this.$events;if(n&&n[e]){t&&(t[2]=e),h(n[e],t);var a=this.$up;a&&(this.$pathname&&v.call(a,this.$pathname+"."+e,t),v.call(a,"*."+e,t))}else if(a=this.$up){var r=this.$pathname+"."+e,i=r.split(".");-1===i.indexOf("*")?(v.call(a,r,t),i[1]="*",v.call(a,i.join("."),t)):v.call(a,r,t)}}function p(e,t){for(;;){if(e.$watch){var n=e.$events||(e.$events={}),a=n[t]||(n[t]=[]);return void Nn.collectDependency(a)}if(e=e.$up,!e)break;t=e.$pathname+"."+t}}function h(e,t){if(e){new Date-Sn>444&&"object"==typeof e[0]&&L();for(var n,a=[],r=[],i=0;n=e[i++];)"user-watcher"===n.type?a.push(n):r.push(n);if(u.async){for(ya.render(),i=0;n=r[i++];)if(n.update){var o=S(n);ya.queue[o]||(ya.queue[o]=1,ya.queue.push(n))}}else for(i=0;n=r[i++];)n.update&&n.update();for(i=0;n=a[i++];)(t&&t[2]===n.expr||n.wildcard)&&(n.fireArgs=t),n.update()}}function m(e,t){return t=t||{},t.watch=!0,y(e,t)}function g(){}function y(e,t){function a(e){return u[e]===!0}if(!e||e.$id&&e.$accessors)return e;t=t||Vt;var r=t.force||Vt,i=t.old,l=i&&i.$accessors||Vt,s=new g,c={},u={},f=[],p=[],h={};e.$skipArray&&(h=o(e.$skipArray),delete e.$skipArray);var m=e.$computed;if(m){delete e.$computed;for(var y in m)u[y]=!0,function(e,t){var n;c[e]={get:function(){return n=t.get.call(this)},set:function(a){if("function"==typeof t.set){var r=n;t.set.call(this,a);var i=this[e];this.$fire&&i!==r&&this.$fire(e,i,r)}},enumerable:!0,configurable:!0}}(y,m[y])}for(y in e){var w=e[y];wn[y]||(u[y]=!0),"function"==typeof w||w&&w.nodeType||!r[y]&&("$"===y.charAt(0)||wn[y]||h[y])?f.push(y):b(w)?(n("warning:计算属性建议放在$computed对象中统一定义"),function(e,t){var n;c[e]={get:function(){return n=t.get.call(this)},set:function(a){if("function"==typeof t.set){var r=n;t.set.call(this,a);var i=this[e];this.$fire&&i!==r&&this.$fire(e,i,r)}},enumerable:!0,configurable:!0}}(y,w)):(p.push(y),c[y]=l[y]?l[y]:$(y,w))}c.$model=xn,s=Object.defineProperties(s,c,e),f.forEach(function(t){s[t]=e[t]}),C(s,"$id","anonymous"),C(s,"$up",i?i.$up:null),C(s,"$track",Object.keys(u)),C(s,"$active",!1),C(s,"$pathname",i?i.$pathname:""),C(s,"$accessors",c),C(s,"hasOwnProperty",a),t.watch&&(C(s,"$watch",function(){return d.apply(s,arguments)}),C(s,"$fire",function(e,t){if(0===e.indexOf("all!")){var n=e.slice(4);for(var a in avalon.vmodels){var r=avalon.vmodels[a];r.$fire&&r.$fire.apply(r,[n,t])}}else v.call(s,e,[t])})),p.forEach(function(t){var n=s[t]=e[t];n&&"object"==typeof n&&(n.$up=s,n.$pathname=t),v.call(s,t)});for(y in m)w=s[y];return s.$active=!0,s}function b(e){if(e&&"object"==typeof e){for(var t in e)if("get"!==t&&"set"!==t)return!1;return"function"==typeof e.get}}function $(e,t){var n,t=0/0;return{get:function(){return this.$active&&p(this,e),t},set:function(a){if(t!==a){var r=t;n=w(a,t),n?t=n:(n=void 0,t=a),Object(n)===n&&(n.$pathname=e,n.$up=this),this.$active&&v.call(this,e,[t,r])}},enumerable:!0,configurable:!0}}function w(e,t,n,a){if(Array.isArray(e))return x(e,t,a);if(avalon.isPlainObject(e)){if(t){var r=Object.keys(e),i=Object.keys(t);if(r.join(";")===i.join(";")){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);return t}t.$active=!1}return y(e,{old:t,watch:a})}return n?e:void 0}function x(e,t,n){if(t){var a=[0,t.length].concat(e);return t.splice.apply(t,a),t}for(var r in kn)e[r]=kn[r];C(e,"$up",null),C(e,"$pathname",""),C(e,"$track",E(e.length)),e._=y({length:0/0},{watch:!0}),e._.length=e.length,e._.$watch("length",function(t,n){v.call(e.$up,e.$pathname+".length",[t,n])}),n&&C(e,"$watch",function(){return d.apply(e,arguments)}),Object.defineProperty(e,"$model",xn);for(var i=0,o=e.length;o>i;i++){var l=e[i]=w(e[i],0,1,1);Object(l)===l&&(l.$up=e)}return e}function C(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!1,configurable:!0})}function T(e){var t=avalon.type(e);if("array"===t){for(var n=[],a=0;aa;a++){n[a]=e[a];var i=t[a];i in n?(e[a]=n[i],delete n[i]):e[a]=e[i]}}function E(e){for(var t=[],n=0;e>n;n++)t[n]=nn("$proxy$each");return t}function N(e,t,n){switch(t){case"push":case"unshift":n=E(n.length);break;case"splice":if(n.length>2){{n[1],n.length-2}n=[n[0],n[1]].concat(E(n.length-2))}}Array.prototype[t].apply(e,n)}function A(e,t){t.oneTime||e&&avalon.Array.ensure(e,t)&&t.element&&(O(t,e),new Date-Sn>444&&L())}function M(e,t){for(var n,a=[],r=0;n=e[r++];)a.push(t?n.$id:n.$key);return a.join(";")}function S(e){if(!e.uniqueNumber){var t=e.element;e.uniqueNumber=t?1!==t.nodeType?e.type+(e.pos||0)+"-"+S(t.parentNode):e.name+"-"+S(t):++An}return e.uniqueNumber}function O(e,t){var n=e.lists||(e.lists=[]),a=S(e);avalon.Array.ensure(n,t),t.$uuid=t.$uuid||nn(),Mn[a]||(Mn[a]=1,Mn.push(e))}function L(e){for(var t=Mn.length,n=t,a=[],r={},i={};e=Mn[--t];){var o=e.type;i[o]?i[o]++:(i[o]=1,a.push(o))}var l=!1;if(a.forEach(function(e){On[e]!==i[e]&&(r[e]=1,l=!0)}),t=n,l)for(;e=Mn[--t];)if(null!==e.element){if(r[e.type]&&j(e.element)){Mn.splice(t,1),delete Mn[e.uniqueNumber];for(var s,c=e.lists,u=0;s=c[u++];)avalon.Array.remove(c,s),avalon.Array.remove(s,e);D(e)}}else Mn.splice(t,1);On=i,Sn=new Date}function D(e){delete Mn[e.uniqueNumber],e.element=null,e.rollback&&e.rollback();for(var t in e)e[t]=null}function j(e){try{{e.parentNode.nodeType}}catch(t){return!0}return e.ifRemove&&!Qt.contains(e.ifRemove)&&Bt===e.parentNode?(e.parentNode&&e.parentNode.removeChild(e),!0):e.msRetain?0:1===e.nodeType?!Qt.contains(e):!avalon.contains(Qt,e)}function H(e){return e.replace(/([a-z\d])([A-Z]+)/g,"$1-$2").toLowerCase()}function P(e){return e.indexOf("-")<0&&e.indexOf("_")<0?e:e.replace(/[-_][^-_]/g,function(e){return e.charAt(1).toUpperCase()})}function R(e){try{if("object"==typeof e)return e;e="true"===e?!0:"false"===e?!1:"null"===e?null:+e+""===e?+e:Bn.test(e)?JSON.parse(e):e}catch(t){}return e}function B(e){return e.window&&e.document?e:9===e.nodeType?e.defaultView:!1}function q(e,t){if(e.offsetWidth<=0){var n=getComputedStyle(e,null);if(In.test(n.display)){var a={node:e};for(var r in Vn)a[r]=n[r],e.style[r]=Vn[r];t.push(a)}var i=e.parentNode;i&&1===i.nodeType&&q(i,t)}}function F(e){var t=e.tagName.toLowerCase();return"input"===t&&/checkbox|radio/.test(e.type)?"checked":t}function _(e,t){var n=[],a=!!t;t=t||0;for(var i="unknown",o="",l=0;lu;u++)if(i.length){var d="vm"+o+"_"+u;s.push(d),c.push(t[u]),l.push.apply(l,I(i,t[u],d,n))}n.args=c;var v=n.type,p=t.map(function(e){return String(e.$id).replace(Gn,"$1")})+e+v,h=Jn.get(p);if(h){if("duplex"===v){var m=Jn.get(p+"setter");n.setter=m.apply(m,n.args)}return n.getter=h}if(l.length||l.push("fix"+o),"duplex"===v){var g={};l.forEach(function(e){var t=e.split("=");g[t[0].trim()]=t[1].trim()}),e=e.replace(/[\$\w]+/,function(e){return g[e]?g[e]:e});var y=r(s.concat("'use strict';return function(vvv){"+e+" = vvv\n}\n"));Jn.put(p+"setter",y),n.setter=y.apply(y,n.args)}if("on"===v){-1===e.indexOf("(")?e+=".call(this, $event)":e=e.replace("(",".call(this,"),s.push("$event"),e="\nreturn "+e+";";var b=e.lastIndexOf("\nreturn"),$=e.slice(0,b),w=e.slice(b);e=$+"\n"+w}else e="\nreturn "+e+";";return h=r(s.concat("'use strict';\nvar "+l.join(",\n")+e)),Jn.put(p,h)}function z(e){var t=hn.test(e);if(t){var n=rt(e);return 1===n.length?n[0].expr:n.map(function(e){return e.type?"("+e.expr+")":aa(e.expr)}).join(" + ")}return e}function W(e){return e=e.replace(Kn,"").replace(Qn,function(){return"],|"}).replace(ea,function(e,t){return"["+aa(t)}).replace(ta,function(){return'"],["'}).replace(na,function(){return'",'})+"]",r(["return ["+e+"]"])()}function U(e,t,n){var a=setTimeout(function(){var r=e.innerHTML;clearTimeout(a),r===n?t():U(e,t,r)})}function G(e,t){var n=e.getAttribute("avalonctrl")||t.$id;e.setAttribute("avalonctrl",n),t.$events&&(t.$events.expr=e.tagName+'[avalonctrl="'+n+'"]')}function Z(e,t){for(var n,a=0;n=e[a++];)n.vmodels=t,sn[n.type].init(n),avalon.injectBinding(n),n.getter&&1===n.element.nodeType&&n.element.removeAttribute(n.name);e.length=0}function J(e,t){return e.priority-t.priority}function K(e,t,a){var r=!0;if(t.length){for(var i,o=e.attributes,l=[],s={},c=0;i=o[c++];){var u=i.name;if(!s[u]&&(s[u]=1,i.specified&&(a=u.match(sa)))){var f=a[1],d=a[2]||"",v=i.value;if(ca[f]?(d=f,f="on"):ua[f]&&(d=f,f="attr",u="ms-"+f+"-"+d,n("warning!请改用"+u+"代替"+i.name+"!")),sn[f]){var p=v.replace(la,""),h=v!==p,m={type:f,param:d,element:e,name:u,expr:p,oneTime:h,priority:(sn[f].priority||10*f.charCodeAt(0))+(Number(d.replace(/\D/g,""))||0)};if("html"===f||"text"===f){var g=at(v).filters;m.expr=m.expr.replace(g,""),m.filters=g.replace(pa,function(){return m.type="html",m.group=1,""}).trim()}else if("duplex"===f)var y=u;else if("ms-if-loop"===u)m.priority+=100;else if("ms-attr-value"===u)var b=u;l.push(m)}}}if(l.length){for(l.sort(J),y&&b&&"text"===e.type&&n("warning!一个控件不能同时定义ms-attr-value与"+y),c=0;m=l[c];c++){if(f=m.type,fa.test(f))return Z(l.slice(0,c+1),t);r&&(r=!da.test(f))}Z(l,t)}}r&&!ra[e.tagName]&&(oa&&oa(e),et(e,t))}function Q(e){for(var t,n=e.attributes,a={},r=0;t=n[r++];)t.specified&&!va.test(t.name)&&(a[P(t.name)]=R(t.value));return a}function et(e,t){var n=avalon.slice(e.childNodes);tt(n,t)}function tt(e,t){for(var n,a=0;n=e[a++];)switch(n.nodeType){case 1:var r=n;if(nt(n,t),!r.msResolved&&r.parentNode&&1===r.parentNode.nodeType){var i=lt(r);if(i){var o=r.localName?r.localName.replace(i+":",""):r.nodeName,l=i+":"+P(o);ba.push({library:i,element:r,fullName:l,widget:o,vmodels:t,name:"widget"}),avalon.components[l]&&avalon.component(l)}}n.msHasEvent&&avalon.fireDom(n,"datasetchanged",{bubble:n.msHasEvent});break;case 3:hn.test(n.nodeValue)&&it(n,t,a)}}function nt(e,t,n){var a=e.getAttribute("ms-skip"),r=e.getAttributeNode("ms-important"),i=e.getAttributeNode("ms-controller");if("string"!=typeof a){if(n=r||i){var o=avalon.vmodels[n.value];if(!o)return;t=n===r?[o]:[o].concat(t),e.removeAttribute(n.name),e.classList.remove(n.name),G(e,o)}K(e,t)}}function at(e){if(e.indexOf("|")>0){var t=e.replace(ma,function(e){return Array(e.length+1).join("1")}),n=t.replace(ha,"ᄢ㍄").indexOf("|");if(n>-1)return{type:"text",filters:e.slice(n).trim(),expr:e.slice(0,n)}}return{type:"text",expr:e,filters:""}}function rt(e){for(var t,n,a=[],r=0;;){if(n=e.indexOf(vn,r),-1===n)break;if(t=e.slice(r,n),t&&a.push({expr:t}),r=n+vn.length,n=e.indexOf(pn,r),-1===n)break;t=e.slice(r,n),t&&a.push(at(t,r)),r=n+pn.length}return t=e.slice(r),t&&a.push({expr:t}),a}function it(e,t,n){var a=[],r=rt(e.data);if(r.length){for(var i,o=0;i=r[o++];){var l=Ht.createTextNode(i.expr);i.type&&(i.expr=i.expr.replace(la,function(){return i.oneTime=!0,""}),i.element=l,i.filters=i.filters.replace(pa,function(){return i.type="html",""}),i.pos=1e3*n+o,a.push(i)),en.appendChild(l)}e.parentNode.replaceChild(en,e),a.length&&Z(a,t)}}function ot(e,t){if(t)for(var n,a=0;n=e[a++];)if(n.hasOwnProperty(t)&&"object"==typeof n[t]){var r=n[t];return r.$model||r}return{}}function lt(e){if(e.scopeName&&"HTML"!==e.scopeName)return e.scopeName;var t=e.nodeName.toLowerCase(),n=t.indexOf(":");return n>0?t.slice(0,n):void 0}function st(e){return null==e?"":e}function ct(e,t,n){return t.param.replace(Yt,function(a){var r=avalon.duplexHooks[a];r&&"function"==typeof r[n]&&(e=r[n](e,t))}),e}function ut(){for(var e=Sa.length-1;e>=0;e--){var t=Sa[e];t()===!1&&Sa.splice(e,1)}Sa.length||clearInterval(Ma)}function ft(e,t){if(!e||1!==e.nodeType)return null;if(t)var n=t.effectName,a=t.effectDriver;else n=e.getAttribute("data-effect-name"),a=e.getAttribute("data-effect-driver");if(!n||!a)return null;var r=Ba.pop()||new pt;return r.el=e,r.driver=a,r.useCss="j"!==a,r.useCss&&(t&&avalon(e).addClass(t.effectClass),r.cssEvent="t"===a?La:Da),r.name=n,r.callbacks=avalon.effects[n]||{},r}function dt(e,t){var n=e.getAttribute("data-effect-name");if(n){t.effectName=n,t.effectDriver=e.getAttribute("data-effect-driver");var a=+e.getAttribute("data-effect-stagger");t.effectLeaveStagger=+e.getAttribute("data-effect-leave-stagger")||a,t.effectEnterStagger=+e.getAttribute("data-effect-enter-stagger")||a,t.effectClass=e.className||0/0}}function vt(e){return e.replace(/^[\S]/g,function(e){return e.toUpperCase()})}function pt(){}function ht(e,t){var n=e.callbacks[t+"Class"];return"string"==typeof n?n:"function"==typeof n?n():e.name+"-"+t}function mt(e,t,n){var a=e.callbacks[t];a&&a.call(e,e.el,n)}function gt(e,t,n){var a=e.templateCache&&e.templateCache[t];if(a){for(var r,i=Ht.createDocumentFragment();r=a.firstChild;)i.appendChild(r);return i}return avalon.parseHTML(n)}function yt(e){for(var t=Ht.createDocumentFragment(),n=0,a=e.length;a>n;n++)t.appendChild(e[n]);return t}function bt(e,t,n){for(var a,r=0;a=e[r++];)a.className===n.effectClass&&avalon.effect.apply(a,t,i,i,n)}function $t(e,t,n){return e?setTimeout(t,++n*e):t(),n}function wt(e,t){for(var n=en.cloneNode(!1),a=e,r=a.nodeValue,o=t&&Math.max(+t.staggerIndex,0),l=avalon.slice(a.parentNode.childNodes),s=l.indexOf(a);;){var c=l[--s];if(!c||0===String(c.nodeValue).indexOf(r))break;t&&c.className===t.effectClass?(e=c,function(e){t.staggerIndex=$t(t.effectLeaveStagger,function(){avalon.effect.apply(e,0,i,function(){n.appendChild(e)},t)},o)}(c)):n.insertBefore(c,n.firstChild)}return n.appendChild(a),n}function xt(e,t,n,a,r){var i=e.template.cloneNode(!0),o=avalon.slice(i.childNodes);i.appendChild(n.$anchor),r&&t.appendChild(i);var l=[n].concat(e.vmodels),s={nodes:o,vmodels:l,content:i};a.push(s)}function Ct(e){var t="object"===e.xtype?Nt:Tt,n=t(e),a=n.$anchor||(n.$anchor=e.element.cloneNode(!1));return a.nodeValue=e.signature,n.$outer=e.$outer,n}function Tt(e,t){for(var n=e.param||"el",a=0,r=Xa.length;r>a;a++){var i=Xa[a];if(i&&i.hasOwnProperty(n)){Xa.splice(a,1),t=i;break}}return t||(t=kt(n)),t}function kt(e){var t={$outer:{},$index:0,$oldIndex:0,$anchor:null,$first:!1,$last:!1,$remove:avalon.noop};t[e]=0/0;var n={$last:1,$first:1,$index:1};n[e]=1;var a=m(t,{force:n});return a.$id=nn("$proxy$each"),a}function Et(e,t,n){if("array"===n){e.$remove=function(){t.$repeat.removeAt(e.$index)};var a=t.param;e.$watch(a,function(n){var a=e.$index;t.$repeat[a]=n})}else e.$watch("$val",function(n){t.$repeat[e.$key]=n})}function Nt(){return za.pop()||At()}function At(){var e=m({$key:"",$val:0/0,$index:0,$oldIndex:0,$outer:{},$anchor:null},{force:{$key:1,$val:1,$index:1}});return e.$id=nn("$proxy$with"),e}function Mt(e,t,n){var a=e[t];if(a){var r=0===a.$id.indexOf("$proxy$each")?Xa:za;a.$outer={};for(var i in a.$events){var o=a.$events[i];Array.isArray(o)&&(o.length=0,i===n?a[n]=0/0:"$val"===i&&(a.$val=0/0))}r.unshift(a)>u.maxRepeatSize&&r.pop(),delete e[t]}}function St(e,t){var n="_"+e;if(!St[n]){var a=Ht.createElement(e);Qt.appendChild(a),t=Kt?getComputedStyle(a,null).display:a.currentStyle.display,Qt.removeChild(a),St[n]=t}return St[n]}function Ot(e,t,n,a){e=(e+"").replace(/[^0-9+\-Ee.]/g,"");var r=isFinite(+e)?+e:0,i=isFinite(+t)?Math.abs(t):3,o=a||",",l=n||".",s="",c=function(e,t){var n=Math.pow(10,t);return""+(Math.round(e*n)/n).toFixed(t)};return s=(i?c(r,i):""+Math.round(r)).split("."),s[0].length>3&&(s[0]=s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,o)),(s[1]||"").length');var Rt,Bt=Pt.firstChild,qt="$"+jt,Ft=e.require,_t=e.define,Vt={},It=/[^, ]+/g,Yt=/\w+/g,Xt=/^\[object SVG\w*Element\]$/,zt=/^\[object (?:Window|DOMWindow|global)\]$/,Wt=Object.prototype,Ut=Wt.hasOwnProperty,Gt=Wt.toString,Zt=Array.prototype,Jt=Zt.slice,Kt=e.dispatchEvent,Qt=Ht.documentElement,en=Ht.createDocumentFragment(),tn=(Ht.createElement("div"),{});"Boolean Number String Function Array Date RegExp Object Error".replace(It,function(e){tn["[object "+e+"]"]=e.toLowerCase()});var nn=function(e){return e=e||"avalon",String(Math.random()+Math.random()).replace(/\d\.\d{4}/,e)},an=l();avalon=function(e){return new avalon.init(e)},avalon.nextTick=new function(){function t(){for(var e=r.length,t=0;e>t;t++)r[t]();r=r.slice(e)}var n=e.setImmediate,a=e.MutationObserver;if(n)return n.bind(e);var r=[];if(a){var i=document.createTextNode("avalon");new a(t).observe(i,{characterData:!0});var o=!1;return function(e){r.push(e),o=!o,i.data=o}}return function(e){setTimeout(e,4)}},avalon.init=function(e){this[0]=this.element=e},avalon.fn=avalon.prototype=avalon.init.prototype,avalon.type=function(e){return null==e?String(e):"object"==typeof e||"function"==typeof e?tn[Gt.call(e)]||"object":typeof e};var rn=function(e){return"[object Function]"===Gt.call(e)};avalon.isFunction=rn,avalon.isWindow=function(e){return zt.test(Gt.call(e))},avalon.isPlainObject=function(e){return"[object Object]"===Gt.call(e)&&Object.getPrototypeOf(e)===Wt},avalon.mix=avalon.fn.mix=function(){var e,t,n,a,r,i,o=arguments[0]||{},l=1,s=arguments.length,c=!1;for("boolean"==typeof o&&(c=o,o=arguments[1]||{},l++),"object"==typeof o||rn(o)||(o={}),l===s&&(o=this,l--);s>l;l++)if(null!=(e=arguments[l]))for(t in e)n=o[t],a=e[t],o!==a&&(c&&a&&(avalon.isPlainObject(a)||(r=Array.isArray(a)))?(r?(r=!1,i=n&&Array.isArray(n)?n:[]):i=n&&avalon.isPlainObject(n)?n:{},o[t]=avalon.mix(c,i,a)):void 0!==a&&(o[t]=a));return o},avalon.mix({rword:It,subscribers:qt,version:1.53,ui:{},log:n,slice:function(e,t,n){return Jt.call(e,t,n)},noop:i,error:function(e,t){throw new(t||Error)(e)},oneObject:o,range:function(e,t,n){n||(n=1),null==t&&(t=e||0,e=0);for(var a=-1,r=Math.max(0,Math.ceil((t-e)/n)),i=new Array(r);++an&&t(n,e[n])!==!1;n++);else for(n in e)if(e.hasOwnProperty(n)&&t(n,e[n])===!1)break}},getWidgetData:function(e,t){var n=avalon(e).data(),a={};for(var r in n)0===r.indexOf(t)&&(a[r.replace(t,"").replace(/\w/,function(e){return e.toLowerCase()})]=n[r]);return a},Array:{ensure:function(e,t){return-1===e.indexOf(t)?e.push(t):void 0},removeAt:function(e,t){return!!e.splice(t,1).length},remove:function(e,t){var n=e.indexOf(t);return~n?avalon.Array.removeAt(e,n):!1}}});var on=avalon.bindingHandlers={},ln=avalon.bindingExecutors={},sn=avalon.directives={};avalon.directive=function(e,t){return on[e]=t.init=t.init||i,ln[e]=t.update=t.update||i,sn[e]=t};var cn=new function(){function e(e){this.size=0,this.limit=e,this.head=this.tail=void 0,this._keymap={}}var t=e.prototype;return t.put=function(e,t){var n={key:e,value:t};return this._keymap[e]=n,this.tail?(this.tail.newer=n,n.older=this.tail):this.head=n,this.tail=n,this.size===this.limit?this.shift():this.size++,t},t.shift=function(){var e=this.head;e&&(this.head=this.head.newer,this.head.older=e.newer=e.older=this._keymap[e.key]=void 0,delete this._keymap[e.key])},t.get=function(e){var t=this._keymap[e];if(void 0!==t)return t===this.tail?t.value:(t.newer&&(t===this.head&&(this.head=t.newer),t.newer.older=t.older),t.older&&(t.older.newer=t.newer),t.newer=void 0,t.older=this.tail,this.tail&&(this.tail.newer=t),this.tail=t,t.value)},e};if(Ht.contains||(Node.prototype.contains=function(e){return!!(16&this.compareDocumentPosition(e))}),avalon.contains=function(e,t){try{for(;t=t.parentNode;)if(t===e)return!0;return!1}catch(n){return!1}},e.SVGElement){var un="http://www.w3.org/2000/svg",fn=Ht.createElementNS(un,"svg");fn.innerHTML='',Xt.test(fn.firstChild)||Object.defineProperties(SVGElement.prototype,{outerHTML:{enumerable:!0,configurable:!0,get:function(){return(new XMLSerializer).serializeToString(this)},set:function(e){var t=this.tagName.toLowerCase(),n=this.parentNode,a=avalon.parseHTML(e);if("svg"===t)n.insertBefore(a,this);else{var r=Ht.createDocumentFragment();c(a,r),n.insertBefore(r,this)}n.removeChild(this)}},innerHTML:{enumerable:!0,configurable:!0,get:function(){var e=this.outerHTML,t=new RegExp("<"+this.nodeName+'\\b(?:(["\'])[^"]*?(\\1)|[^>])*>',"i"),n=new RegExp("$","i");return e.replace(t,"").replace(n,"")},set:function(e){if(avalon.clearHTML){avalon.clearHTML(this);var t=avalon.parseHTML(e);c(t,this)}}}})}var dn=avalon.eventHooks;"onmouseenter"in Qt||avalon.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){dn[e]={type:t,fn:function(t,n){return function(a){var r=a.relatedTarget;return r&&(r===t||16&t.compareDocumentPosition(r))?void 0:(delete a.type,a.type=e,n.call(t,a))}}}}),avalon.each({AnimationEvent:"animationend",WebKitAnimationEvent:"webkitAnimationEnd"},function(t,n){e[t]&&!dn.animationend&&(dn.animationend={type:n})}),void 0===Ht.onmousewheel&&(dn.mousewheel={type:"wheel",fn:function(e,t){return function(n){n.wheelDeltaY=n.wheelDelta=n.deltaY>0?-120:120,n.wheelDeltaX=0,Object.defineProperty(n,"type",{value:"mousewheel"}),t.call(e,n)}}});var vn,pn,hn,mn,gn,yn=/[-.*+?^${}()|[\]\/\\]/g,bn={loader:function(t){var n=Rt&&t;e.require=n?Rt:Ft,e.define=n?Rt.define:_t},interpolate:function(e){if(vn=e[0],pn=e[1],vn===pn){throw new SyntaxError("openTag!==closeTag")}u.openTag=vn,u.closeTag=pn;var t=f(vn),n=f(pn);hn=new RegExp(t+"(.*?)"+n),mn=new RegExp(t+"(.*?)"+n,"g"),gn=new RegExp(t+".*?"+n+"|\\sms-")}};u.async=!0,u.debug=!0,u.plugins=bn,u.plugins.interpolate(["{{","}}"]),u.paths={},u.shim={},u.maxRepeatSize=100,avalon.config=u;var $n=avalon.vmodels={};avalon.define=function(e){var t=e.$id;t||n("warning: vm必须指定$id");var a=m(e);return a.$id=t,$n[t]=a};var wn=o("$id,$watch,$fire,$events,$model,$skipArray,$active,$pathname,$up,$track,$accessors"),xn={get:function(){return T(this)},set:i,enumerable:!1,configurable:!0},Cn=["push","pop","shift","unshift","splice"],Tn=Array.prototype,kn={notify:function(){v.call(this.$up,this.$pathname)},set:function(e,t){if(e>>>0===e&&this[e]!==t){if(e>this.length)throw Error(e+"set方法的第一个参数不能大于原数组长度");v.call(this.$up,this.$pathname+".*",[t,this[e]]),this.splice(e,1,t)}},contains:function(e){return-1!==this.indexOf(e)},ensure:function(e){return this.contains(e)||this.push(e),this},pushArray:function(e){return this.push.apply(this,e)},remove:function(e){return this.removeAt(this.indexOf(e))},removeAt:function(e){return e>>>0===e?this.splice(e,1):[]},size:function(){return this._.length},removeAll:function(e){if(Array.isArray(e))for(var t=this.length-1;t>=0;t--)-1!==e.indexOf(this[t])&&(En.call(this.$track,t,1),En.call(this,t,1));else if("function"==typeof e)for(t=this.length-1;t>=0;t--){var n=this[t];e(n,t)&&(En.call(this.$track,t,1),En.call(this,t,1))}else En.call(this.$track,0,this.length),En.call(this,0,this.length);Kt||(this.$model=T(this)),this.notify(),this._.length=this.length},clear:function(){return this.removeAll()}},En=Tn.splice;Cn.forEach(function(e){var t=Tn[e];kn[e]=function(){for(var n=[],a=0,r=arguments.length;r>a;a++)n[a]=w(arguments[a],0,1,1);var i=t.apply(this,n);return N(this.$track,e,n),Kt||(this.$model=T(this)),this.notify(),this._.length=this.length,i}}),"sort,reverse".replace(It,function(e){kn[e]=function(){var t=this.concat(),n=this,a=Math.random(),r=[],i=!1;Tn[e].apply(n,arguments);for(var o=0,l=t.length;l>o;o++){var s=n[o],c=t[o];if(s===c)r.push(o);else{var u=t.indexOf(s);r.push(u),t[u]=a,i=!0}}return i&&(k(this.$track,r),Kt||(this.$model=T(this)),this.notify()),this}});var Nn=function(){var e,t=[];return{begin:function(n){t.push(e),e=n},end:function(){e=t.pop()},collectDependency:function(t){e&&e.callback(t)}}}();avalon.injectBinding=function(e){e.handler=e.handler||sn[e.type].update||i,e.update=function(){var t=!1;e.getter||(t=!0,Nn.begin({callback:function(t){A(t,e)}}),e.getter=X(e.expr,e.vmodels,e),e.observers.forEach(function(t){t.v.$watch(t.p,e)}),delete e.observers);try{var a,r,i=e.fireArgs;if(delete e.fireArgs,i?(a=i[0],r=i[1]):a="on"===e.type?e.getter+"":e.getter.apply(0,e.args),r="undefined"==typeof r?e.oldValue:r,e._filters&&(a=Qa.$filter.apply(0,[a].concat(e._filters))),e.signature){var o=avalon.type(a);if("array"!==o&&"object"!==o)throw Error("warning:"+e.expr+"只能是对象或数组");e.xtype=o;var l=M(e.proxies||[],o),s=a.$track||("array"===o?E(a.length):Object.keys(a));e.track=s,l!==s.join(";")&&(e.handler(a,r),e.oldValue=1)}else(Array.isArray(a)?a.length===(r&&r.length):1)?"oldValue"in e&&a===r||(e.handler(a,r),e.oldValue=a):(e.handler(a,r),e.oldValue=a.concat())}catch(c){delete e.getter,n("warning:exception throwed in [avalon.injectBinding] ",c);var u=e.element;u&&3===u.nodeType&&(u.nodeValue=vn+(e.oneTime?"::":"")+e.expr+pn)}finally{t&&Nn.end()}},e.update()};var An=0,Mn=avalon.$$subscribers=[],Sn=new Date,On={},Ln=new function(){avalon.mix(this,{option:Ht.createElement("select"),thead:Ht.createElement("table"),td:Ht.createElement("tr"),area:Ht.createElement("map"),tr:Ht.createElement("tbody"),col:Ht.createElement("colgroup"),legend:Ht.createElement("fieldset"),_default:Ht.createElement("div"),g:Ht.createElementNS("http://www.w3.org/2000/svg","svg")}),this.optgroup=this.option,this.tbody=this.tfoot=this.colgroup=this.caption=this.thead,this.th=this.td};String("circle,defs,ellipse,image,line,path,polygon,polyline,rect,symbol,text,use").replace(It,function(e){Ln[e]=Ln.g});var Dn=/<([\w:]+)/,jn=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Hn=o(["","text/javascript","text/ecmascript","application/ecmascript","application/javascript"]),Pn=Ht.createElement("script"),Rn=/<|&#?\w+;/;avalon.parseHTML=function(e){var t=en.cloneNode(!1);if("string"!=typeof e)return t;if(!Rn.test(e))return t.appendChild(Ht.createTextNode(e)),t;e=e.replace(jn,"<$1>").trim();var n,a=(Dn.exec(e)||["",""])[1].toLowerCase(),r=Ln[a]||Ln._default;r.innerHTML=e;var i=r.getElementsByTagName("script");if(i.length)for(var o,l=0;o=i[l++];)if(Hn[o.type]){var s=Pn.cloneNode(!1);Zt.forEach.call(o.attributes,function(e){s.setAttribute(e.name,e.value)}),s.text=o.text,o.parentNode.replaceChild(s,o)}for(;n=r.firstChild;)t.appendChild(n);return t},avalon.innerHTML=function(e,t){var n=this.parseHTML(t);this.clearHTML(e).appendChild(n)},avalon.clearHTML=function(e){for(e.textContent="";e.firstChild;)e.removeChild(e.firstChild);return e},"add,remove".replace(It,function(e){avalon.fn[e+"Class"]=function(t){var n=this[0];return t&&"string"==typeof t&&n&&1===n.nodeType&&t.replace(/\S+/g,function(t){n.classList[e](t)}),this}}),avalon.fn.mix({hasClass:function(e){var t=this[0]||{};return 1===t.nodeType&&t.classList.contains(e)},toggleClass:function(e,t){for(var n,a=0,r=String(e).split(/\s+/),i="boolean"==typeof t;n=r[a++];){var o=i?t:!this.hasClass(n);this[o?"addClass":"removeClass"](n)}return this},attr:function(e,t){return 2===arguments.length?(this[0].setAttribute(e,t),this):this[0].getAttribute(e)},data:function(e,t){switch(e="data-"+H(e||""),arguments.length){case 2:return this.attr(e,t),this;case 1:var n=this.attr(e);return R(n);case 0:var a={};return Zt.forEach.call(this[0].attributes,function(t){t&&(e=t.name,e.indexOf("data-")||(e=P(e.slice(5)),a[e]=R(t.value)))}),a}},removeData:function(e){return e="data-"+H(e),this[0].removeAttribute(e),this},css:function(e,t){if(avalon.isPlainObject(e))for(var n in e)avalon.css(this,n,e[n]);else var a=avalon.css(this,e,t);return void 0!==a?a:this},position:function(){var e,t,n=this[0],a={top:0,left:0};if(n)return"fixed"===this.css("position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),"HTML"!==e[0].tagName&&(a=e.offset()),a.top+=avalon.css(e[0],"borderTopWidth",!0),a.left+=avalon.css(e[0],"borderLeftWidth",!0),a.top-=e.scrollTop(),a.left-=e.scrollLeft()),{top:t.top-a.top-avalon.css(n,"marginTop",!0),left:t.left-a.left-avalon.css(n,"marginLeft",!0)}},offsetParent:function(){for(var e=this[0].offsetParent;e&&"static"===avalon.css(e,"position");)e=e.offsetParent;return avalon(e||Qt)},bind:function(e,t,n){return this[0]?avalon.bind(this[0],e,t,n):void 0},unbind:function(e,t,n){return this[0]&&avalon.unbind(this[0],e,t,n),this +},val:function(e){var t=this[0];if(t&&1===t.nodeType){var n=0===arguments.length,a=n?":get":":set",r=Yn[F(t)+a];if(r)var i=r(t,e);else{if(n)return(t.value||"").replace(/\r/g,"");t.value=e}}return n?i:this}}),Qt.dataset&&(avalon.fn.data=function(e,t){e=e&&P(e);var n=this[0].dataset;switch(arguments.length){case 2:return n[e]=t,this;case 1:return t=n[e],R(t);case 0:var r=a();for(e in n)r[e]=R(n[e]);return r}});var Bn=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/;avalon.parseJSON=JSON.parse,avalon.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){avalon.fn[e]=function(n){var a=this[0]||{},r=B(a),i="scrollTop"===e;return arguments.length?void(r?r.scrollTo(i?r[t]:n,i?n:r[t]):a[e]=n):r?r[t]:a[e]}});var qn=avalon.cssHooks=a(),Fn=["","-webkit-","-moz-","-ms-"],_n={"float":"cssFloat"};avalon.cssNumber=o("animationIterationCount,animationIterationCount,columnCount,order,flex,flexGrow,flexShrink,fillOpacity,fontWeight,lineHeight,opacity,orphans,widows,zIndex,zoom"),avalon.cssName=function(e,t,n){if(_n[e])return _n[e];t=t||Qt.style;for(var a=0,r=Fn.length;r>a;a++)if(n=P(Fn[a]+e),n in t)return _n[e]=n;return null},qn["@:set"]=function(e,t,n){e.style[t]=n},qn["@:get"]=function(e,t){if(!e||!e.style)throw new Error("getComputedStyle要求传入一个节点 "+e);var n,a=getComputedStyle(e);return a&&(n="filter"===t?a.getPropertyValue(t):a[t],""===n&&(n=e.style[t])),n},qn["opacity:get"]=function(e){var t=qn["@:get"](e,"opacity");return""===t?"1":t},"top,left".replace(It,function(e){qn[e+":get"]=function(t){var n=qn["@:get"](t,e);return/px$/.test(n)?n:avalon(t).position()[e]+"px"}});var Vn={position:"absolute",visibility:"hidden",display:"block"},In=/^(none|table(?!-c[ea]).+)/;"Width,Height".replace(It,function(e){var t=e.toLowerCase(),n="client"+e,a="scroll"+e,r="offset"+e;qn[t+":get"]=function(t,n,a){var i=-4;"number"==typeof a&&(i=a),n="Width"===e?["Left","Right"]:["Top","Bottom"];var o=t[r];return 2===i?o+avalon.css(t,"margin"+n[0],!0)+avalon.css(t,"margin"+n[1],!0):(0>i&&(o=o-avalon.css(t,"border"+n[0]+"Width",!0)-avalon.css(t,"border"+n[1]+"Width",!0)),-4===i&&(o=o-avalon.css(t,"padding"+n[0],!0)-avalon.css(t,"padding"+n[1],!0)),o)},qn[t+"&get"]=function(e){var n=[];q(e,n);for(var a,r=qn[t+":get"](e),i=0;a=n[i++];){e=a.node;for(var o in a)"string"==typeof a[o]&&(e.style[o]=a[o])}return r},avalon.fn[t]=function(i){var o=this[0];if(0===arguments.length){if(o.setTimeout)return o["inner"+e];if(9===o.nodeType){var l=o.documentElement;return Math.max(o.body[a],l[a],o.body[r],l[r],l[n])}return qn[t+"&get"](o)}return this.css(t,i)},avalon.fn["inner"+e]=function(){return qn[t+":get"](this[0],void 0,-2)},avalon.fn["outer"+e]=function(e){return qn[t+":get"](this[0],void 0,e===!0?2:0)}}),avalon.fn.offset=function(){var e=this[0];try{var t=e.getBoundingClientRect();if(t.width||t.height||e.getClientRects().length){var n=e.ownerDocument,a=n.documentElement,r=n.defaultView;return{top:t.top+r.pageYOffset-a.clientTop,left:t.left+r.pageXOffset-a.clientLeft}}}catch(i){return{left:0,top:0}}};var Yn={"select:get":function(e,t){for(var n,a=e.options,r=e.selectedIndex,i="select-one"===e.type||0>r,o=i?null:[],l=i?r+1:a.length,s=0>r?l:i?r:0;l>s;s++)if(n=a[s],(n.selected||s===r)&&!n.disabled){if(t=n.value,i)return t;o.push(t)}return o},"select:set":function(e,t,n){t=[].concat(t);for(var a,r=0;a=e.options[r++];)(a.selected=t.indexOf(a.value)>-1)&&(n=!0);n||(e.selectedIndex=-1)}},Xn={},zn=["break,case,catch,continue,debugger,default,delete,do,else,false","finally,for,function,if,in,instanceof,new,null,return,switch,this","throw,true,try,typeof,var,void,while,with","abstract,boolean,byte,char,class,const,double,enum,export,extends","final,float,goto,implements,import,int,interface,long,native","package,private,protected,public,short,static,super,synchronized","throws,transient,volatile","arguments,let,yield,undefined"].join(",");zn.replace(/\w+/g,function(e){Xn[e]=!0});var Wn=/[a-z_$]/i,Un=/[\s\uFEFF\xA0]/,Gn=/(\$proxy\$[a-z]+)\d+$/,Zn=new cn(218),Jn=new cn(128),Kn=/\)\s*$/,Qn=/\)\s*\|/g,ea=/\|\s*([$\w]+)/g,ta=/"\s*\["/g,na=/"\s*\(/g,aa=JSON.stringify;avalon.scan=function(e,t){e=e||Qt;var n=t?[].concat(t):[];nt(e,n)};var ra=o("area,base,basefont,br,col,command,embed,hr,img,input,link,meta,param,source,track,wbr,noscript,script,style,textarea".toUpperCase()),ia=function(e,t,n){var a=e.getAttribute(t);if(a)for(var r,i=0;r=n[i++];)if(r.hasOwnProperty(a)&&"function"==typeof r[a])return r[a]},oa=an&&e.MutationObserver?function(e){for(var t,n=e.firstChild;n;){var a=n.nextSibling;3===n.nodeType?t?(t.nodeValue+=n.nodeValue,e.removeChild(n)):t=n:t=null,n=a}}:0,la=/^\s*::/,sa=/ms-(\w+)-?(.*)/,ca=o("animationend,blur,change,input,click,dblclick,focus,keydown,keypress,keyup,mousedown,mouseenter,mouseleave,mousemove,mouseout,mouseover,mouseup,scan,scroll,submit"),ua=o("value,title,alt,checked,selected,disabled,readonly,enabled,href,src"),fa=/^if|widget|repeat$/,da=/^each|with|html|include$/,va=/^(ms-\S+|data-\S+|on[a-z]+|id|style|class|tabindex)$/,pa=/\|\s*html(?:\b|$)/,ha=/\|\|/g,ma=/(['"])(\\\1|.)+?\1/g,ga=function(){this.queue=[]};ga.prototype={render:function(e){if(!this.locked){this.locked=e?Qt.offsetHeight+10:1;var t=this;avalon.nextTick(function(){t.flush()})}},flush:function(){for(var e,t=0;e=this.queue[t++];)e.update();this.locked=0,this.queue=[]}};var ya=new ga,ba=[],$a=[],wa={$construct:function(){return avalon.mix.apply(null,arguments)},$ready:i,$init:i,$dispose:i,$container:null,$childReady:i,$replace:!1,$extend:null,$$template:function(e){return e}};avalon.components={},avalon.component=function(t,n){n&&(avalon.components[t]=avalon.mix({},wa,n));for(var a,r=0;a=ba[r];r++)t===a.fullName&&(ba.splice(r,1),r--,function(n,a,r,i){var o=1,l=n.library,s=avalon.libraries[l]||wa,c=Q(r),u=ot(n.vmodels,c.config||n.fullName),f=c.$id||c.identifier||nn(i);delete c.config,delete c.$id,delete c.identifier;var d={},v=avalon.components[a.$extend];v?(avalon.mix(!0,d,v),d=v.$construct.call(r,d,{},{})):avalon.mix(!0,d,a),d=avalon.components[t].$construct.call(r,d,u,c),d.$refs={},d.$id=f;var p=d.$slot,h=d.$replace,m=d.$container,g=d.$template;delete d.$slot,delete d.$replace,delete d.$container,delete d.$template,delete d.$construct;var y=avalon.define(d)||{};r.msResolved=1,y.$init(y,r),s.$init(y,r);for(var b,$,w=r.childNodes,x={},C=0;$=w[C++];){var T=1===$.nodeType&&$.getAttribute("slot")||p;T&&(x[T]?x[T].push($):x[T]=[$])}y.$$template&&(avalon.clearHTML(r),r.innerHTML=y.$$template(g));for(C in x)if(y.hasOwnProperty(C)){var k=x[C];if(k.length){for(var E=en.cloneNode(!0),N=0;b=k[N++];)E.appendChild(b);y[C]=E}x[C]=null}x=null;var A=r.firstChild;h&&(A=r.firstChild,r.parentNode.replaceChild(A,r),A.msResolved=1,r=n.element=A),m&&m.appendChild(r),avalon.fireDom(r,"datasetchanged",{library:l,vm:y,childReady:1});var M=0,S=avalon.bind(r,"datasetchanged",function(t){if(t.childReady&&t.library===l&&(o+=t.childReady,y!==t.vm&&(y.$refs[t.vm.$id]=t.vm,-1===t.childReady&&(M++,y.$childReady(y,r,t)),t.stopPropagation())),0===o){var a=setTimeout(function(){clearTimeout(a),y.$ready(y,r),s.$ready(y,r)},M?Math.max(17*M,100):17);avalon.unbind(r,"datasetchanged",S),n.rollback=function(){try{y.$dispose(y,r),s.$dispose(y,r)}catch(e){}delete avalon.vmodels[y.$id]},O(n,$a),e.chrome&&r.addEventListener("DOMNodeRemovedFromDocument",function(){setTimeout(L)})}});if(nt(r,[y].concat(n.vmodels)),avalon.vmodels[y.$id]=y,r.childNodes.length)var D=setTimeout(function(){clearTimeout(D),avalon.fireDom(r,"datasetchanged",{library:l,vm:y,childReady:-1})},17);else avalon.fireDom(r,"datasetchanged",{library:l,vm:y,childReady:-1})}(a,avalon.components[t],a.element,a.widget))},avalon.fireDom=function(e,t,n){if(Ht.createEvent){var a=Ht.createEvent("Events");a.initEvent(t,!0,!0,n),avalon.mix(a,n),e.dispatchEvent(a)}else Qt.contains(e)&&(a=Ht.createEventObject(),avalon.mix(a,n),e.fireEvent("on"+t,a))},avalon.libraries=[],avalon.library=function(e,t){Ht.namespaces&&Ht.namespaces.add(e,"http://www.w3.org/1999/xhtml"),avalon.libraries[e]=avalon.mix({$init:i,$ready:i,$dispose:i},t||{})},avalon.library("ms");var xa=["autofocus,autoplay,async,allowTransparency,checked,controls","declare,disabled,defer,defaultChecked,defaultSelected","contentEditable,isMap,loop,multiple,noHref,noResize,noShade","open,readOnly,selected"].join(","),Ca={};xa.replace(It,function(e){Ca[e.toLowerCase()]=e});var Ta={"accept-charset":"acceptCharset","char":"ch",charoff:"chOff","class":"className","for":"htmlFor","http-equiv":"httpEquiv"},ka=["accessKey,bgColor,cellPadding,cellSpacing,codeBase,codeType,colSpan","dateTime,defaultValue,frameBorder,longDesc,maxLength,marginWidth,marginHeight","rowSpan,tabIndex,useMap,vSpace,valueType,vAlign"].join(",");ka.replace(It,function(e){Ta[e.toLowerCase()]=e});var Ea=avalon.directive("attr",{init:function(e){if(e.expr=z(e.expr.trim()),"include"===e.type){var t=e.element;dt(t,e),e.includeRendered=ia(t,"data-include-rendered",e.vmodels),e.includeLoaded=ia(t,"data-include-loaded",e.vmodels);var n=e.includeReplace=!!avalon(t).data("includeReplace");avalon(t).data("includeCache")&&(e.templateCache={}),e.start=Ht.createComment("ms-include"),e.end=Ht.createComment("ms-include-end"),n?(e.element=e.end,e._element=t,t.parentNode.insertBefore(e.end,t),t.parentNode.insertBefore(e.start,e.end)):(t.insertBefore(e.start,t.firstChild),t.appendChild(e.end))}},update:function(t){var n=this.element,a=this.param;if("href"===a||"src"===a){if("string"!=typeof t||Qt.hasAttribute||(t=t.replace(/&/g,"&")),n[a]=t,e.chrome&&"EMBED"===n.tagName){var r=n.parentNode,i=document.createComment("ms-src");r.replaceChild(i,n),r.replaceChild(n,i)}}else{var o=t===!1||null===t||void 0===t;!Kt&&Ta[a]&&(a=Ta[a]);var l=Ca[a];if("boolean"==typeof n[l]&&(n[l]=!!t,t||(o=!0)),o)return n.removeAttribute(a);var s=Xt.test(n)?!1:Ht.namespaces&&isVML(n)?!0:a in n.cloneNode(!1);s?n[a]=t+"":n.setAttribute(a,t)}}});"title,alt,src,value,css,include,href".replace(It,function(e){sn[e]=Ea}),avalon.directive("class",{init:function(e){var t=e.param,a=e.type;if(!t||isFinite(t)?(e.param="",sn.effect.init(e)):(n("ms-"+a+'-xxx="yyy"这种用法已经过时,请使用ms-'+a+'="xxx:yyy"'),e.expr="["+aa(t)+","+e.expr+"]",e.oldStyle=t),"hover"===a||"active"===a){if(!e.hasBindEvent){var r=e.element,i=avalon(r),o="mouseenter",l="mouseleave";if("active"===a){r.tabIndex=r.tabIndex||-1,o="mousedown",l="mouseup";var s=i.bind("mouseleave",function(){e.toggleClass&&i.removeClass(e.newClass)})}}var c=i.bind(o,function(){e.toggleClass&&i.addClass(e.newClass)}),u=i.bind(l,function(){e.toggleClass&&i.removeClass(e.newClass)});e.rollback=function(){i.unbind("mouseleave",s),i.unbind(o,c),i.unbind(l,u)},e.hasBindEvent=!0}},update:function(e){var t=this,n=avalon(this.element);t.newClass=e[0],t.toggleClass=!!e[1],t.oldClass&&t.newClass!==t.oldClass&&n.removeClass(t.oldClass),t.oldClass=t.newClass,"class"===t.type&&(t.oldStyle?n.toggleClass(t.oldStyle,!!e[1]):n.toggleClass(t.newClass,t.toggleClass))}}),"hover,active".replace(It,function(e){sn[e]=sn["class"]}),avalon.directive("css",{init:sn.attr.init,update:function(e){avalon(this.element).css(this.param,e)}}),avalon.directive("data",{priority:100,update:function(e){var t=this.element,n="data-"+this.param;e&&"object"==typeof e?t[n]=e:t.setAttribute(n,String(e))}});{var Na=/^(?:checkbox|radio)$/,Aa=/^(?:radio|checked)$/;avalon.directive("duplex",{priority:2e3,init:function(e,t){function a(t){e.changed.call(this,t,e)}function r(){d=!0}function l(){d=!1}var s=e.element,c=e.vmodels;e.changed=ia(s,"data-duplex-changed",c)||i;var u=[],f=o("string,number,boolean,checked");"radio"===s.type&&""===e.param&&(e.param="checked"),e.param.replace(Yt,function(a){Na.test(s.type)&&Aa.test(a)&&("radio"===a&&n("ms-duplex-radio已经更名为ms-duplex-checked"),a="checked",e.isChecked=!0,e.xtype="radio"),"bool"===a?(a="boolean",n("ms-duplex-bool已经更名为ms-duplex-boolean")):"text"===a&&(a="string",n("ms-duplex-text已经更名为ms-duplex-string")),f[a]&&(t=!0),avalon.Array.ensure(u,a)}),t||u.push("string"),e.param=u.join("-"),e.changed=ia(s,"binding-duplex-changed",c)||i,e.xtype||(e.xtype="SELECT"===s.tagName?"select":"checkbox"===s.type?"checkbox":"radio"===s.type?"radio":/^change/.test(s.getAttribute("data-duplex-event"))?"change":"input"),e.bound=function(t,n){s.addEventListener(t,n,!1);var a=e.rollback;e.rollback=function(){s.avalonSetter=null,avalon.unbind(s,t,n),a&&a()}};var d=!1,v=function(){var t=s.value;if(!d&&t!==e.oldValue){var n=e.pipe(t,e,"get");e.setter(n),a.call(s,n)}};switch(e.xtype){case"radio":e.bound("click",function(){var t=e.pipe(s.value,e,"get");e.setter(t),a.call(s,t)});break;case"checkbox":e.bound("change",function(){var t=s.checked?"ensure":"remove",r=e.getter.apply(0,e.vmodels);Array.isArray(r)||(n("ms-duplex应用于checkbox上要对应一个数组"),r=[r]);var i=e.pipe(s.value,e,"get");avalon.Array[t](r,i),a.call(s,r)});break;case"change":e.bound("change",v);break;case"input":an?e.bound("input",v):(e.bound("input",v),e.bound("compositionstart",r),e.bound("compositionend",l),e.bound("DOMAutoComplete",v));break;case"select":e.bound("change",function(){var t=avalon(s).val();t=Array.isArray(t)?t.map(function(t){return e.pipe(t,e,"get")}):e.pipe(t,e,"get"),t+""!==e.oldValue&&(e.setter(t),a.call(s,t))})}"input"===e.xtype&&/^(text|password|hidden)/.test(s.type)&&Oa(function(){if(Qt.contains(s))e.oldValue!==s.value&&v();else if(!s.msRetain)return!1}),s.avalonSetter=v;for(var p in avalon.vmodels){var h=avalon.vmodels[p];h.$fire("avalon-ms-duplex-init",e)}var m=e.pipe||(e.pipe=ct);m(null,e,"init")},update:function(e){var t,n=this.element,a=this;switch(this.xtype){case"input":case"change":t=this.pipe(e,this,"set"),t!==this.oldValue&&(n.value=this.oldValue=t);break;case"radio":t=a.isChecked?!!e:e+""===n.value,n.checked=t;break;case"checkbox":var r=[].concat(e);t=this.pipe(n.value,this,"get"),n.checked=r.indexOf(t)>-1;break;case"select":a._value=e,n.msHasEvent="selectDuplex",avalon.bind(n,"datasetchanged",function(e){if("selectDuplex"===e.bubble){var t=a._value,r=Array.isArray(t)?t.map(String):t+"";avalon(n).val(r),n.oldValue=r+"",a.changed.call(n,r)}})}"select"!==a.xtype&&a.changed.call(n,t)}})}avalon.duplexHooks={checked:{get:function(e,t){return!t.element.oldValue}},string:{get:function(e){return e},set:st},"boolean":{get:function(e){return"true"===e},set:st},number:{get:function(e,t){var n=parseFloat(e);if(-e===-n)return n;var a=/strong|medium|weak/.exec(t.element.getAttribute("data-duplex-number"))||["medium"];switch(a[0]){case"strong":return 0;case"medium":return""===e?"":0;case"weak":return e}},set:st}};var Ma,Sa=[];avalon.tick=function(e){1===Sa.push(e)&&(Ma=setInterval(ut,60))};var Oa=i;!new function(){function e(e){t[this.tagName].call(this,e),"function"==typeof this.avalonSetter&&this.oldValue!==e&&this.avalonSetter()}try{var t={},n=HTMLInputElement.prototype,a=HTMLTextAreaElement.prototype,r=HTMLInputElement.prototype;Object.getOwnPropertyNames(r),t.INPUT=Object.getOwnPropertyDescriptor(n,"value").set,Object.defineProperty(n,"value",{set:e}),t.TEXTAREA=Object.getOwnPropertyDescriptor(a,"value").set,Object.defineProperty(a,"value",{set:e})}catch(i){Oa=avalon.tick}},avalon.directive("effect",{priority:5,init:function(e){var t,n,a=e.expr,r=a.replace(mn,function(e){return e.replace(/./g,"0")}).indexOf(":");-1===r?(t=a,n=!0):(t=a.slice(0,r),n=a.slice(r+1)),t=hn.test(a)?z(t):aa(t),e.expr="["+t+","+n+"]"},update:function(t){var n=t[0],a=this.element;if(a.getAttribute("data-effect-name")!==n){a.removeAttribute("data-effect-driver");var r=a.style,i=e.getComputedStyle?e.getComputedStyle(a):null,o=!1;if(i&&(ja||Ha)){var l=r[Pa]||i[Pa];l&&"0s"!==l&&(a.setAttribute("data-effect-driver","t"),o=!0),o||(l=r[Ra]||i[Ra],l&&"0s"!==l&&(a.setAttribute("data-effect-driver","a"),o=!0))}o||avalon.effects[n]&&(a.setAttribute("data-effect-driver","j"),o=!0),o&&a.setAttribute("data-effect-name",n)}}}),avalon.effects={},avalon.effect=function(e,t){avalon.effects[e]=t};var La,Da,ja=!1,Ha=!1,Pa=avalon.cssName("transition-duration"),Ra=avalon.cssName("animation-duration");!new function(){var t,n={TransitionEvent:"transitionend",WebKitTransitionEvent:"webkitTransitionEnd",OTransitionEvent:"oTransitionEnd",otransitionEvent:"otransitionEnd"};for(var a in n){if(e[a]){t=n[a];break}try{{document.createEvent(a)}t=n[a];break}catch(r){}}"string"==typeof t&&(ja=!0,La=t),n={AnimationEvent:"animationend",WebKitAnimationEvent:"webkitAnimationEnd"};var i;for(a in n)if(e[a]){i=n[a];break}"string"==typeof i&&(ja=!0,Da=i)};var Ba=[],qa=new ga;pt.prototype={contrustor:pt,enterClass:function(){return ht(this,"enter")},leaveClass:function(){return ht(this,"leave")},actionFun:function(e,t,n){if(!document.hidden){var a=this,r=a.el,i="leave"===e;e=i?"leave":"enter";var o=i?"enter":"leave";mt(a,"abort"+vt(o)),mt(a,"before"+vt(e)),i||t(r);var l=function(o){r.removeEventListener(a.cssEvent,a.cssCallback),i?(t(r),avalon(r).removeClass(a.cssClass)):"a"===a.driver&&avalon(r).removeClass(a.cssClass),o!==!0&&(mt(a,"after"+vt(e)),n&&n(r)),a.dispose()};a.useCss?(a.cssCallback&&a.cssCallback(!0),a.cssClass=ht(a,e),a.cssCallback=l,a.update=function(){r.addEventListener(a.cssEvent,a.cssCallback),i||"t"!==a.driver||avalon(r).removeClass(a.cssClass)},avalon(r).addClass(a.cssClass),qa.render(!0),qa.queue.push(a)):mt(a,e,l)}},enter:function(){this.actionFun.apply(this,["enter"].concat(avalon.slice(arguments)))},leave:function(){this.actionFun.apply(this,["leave"].concat(avalon.slice(arguments)))},dispose:function(){this.update=this.cssCallback=null,Ba.unshift(this)>100&&Ba.pop()}};var Fa=function(e,t){var n=Jt.call(arguments,0);"function"!=typeof n[2]&&n.splice(2,0,i),"function"!=typeof n[3]&&n.splice(3,0,i);var a=n[2],r=n[3],o=n[4],l=ft(e,o);if(!l)return a(),r(),!1;var s=t?"enter":"leave";l[s](a,r)};avalon.mix(avalon.effect,{apply:Fa,append:function(e,t,n,a){return Fa(e,1,function(){t.appendChild(e)},n,a)},before:function(e,t,n,a){return Fa(e,1,function(){t.parentNode.insertBefore(e,t)},n,a)},remove:function(e,t,n,a){return Fa(e,0,function(){e.parentNode===t&&t.removeChild(e)},n,a)}}),avalon.directive("html",{update:function(e){var t=this,n=this.element,a=1!==n.nodeType,r=a?n.parentNode:n;if(r){if(e=null==e?"":e,3===n.nodeType){var i=nn("html");r.insertBefore(Ht.createComment(i),n),t.element=Ht.createComment(i+":end"),r.replaceChild(t.element,n),n=t.element}if("object"!=typeof e)var o=avalon.parseHTML(String(e));else if(11===e.nodeType)o=e;else if(1===e.nodeType||e.item){var l=1===e.nodeType?e.childNodes:e.item;for(o=en.cloneNode(!0);l[0];)o.appendChild(l[0])}if(l=avalon.slice(o.childNodes),a){for(var s=n.nodeValue.slice(0,-4);;){var c=n.previousSibling;if(!c||8===c.nodeType&&c.nodeValue===s)break;r.removeChild(c)}r.insertBefore(o,n)}else avalon.clearHTML(n).appendChild(o);tt(l,t.vmodels)}}}),avalon.directive("if",{priority:10,update:function(e){function t(){r.getAttribute(a.name)&&(r.removeAttribute(a.name),K(r,a.vmodels)),a.rollback=null}var n,a=this,r=this.element,i=a.stamp=+new Date,o=function(){i===a.stamp&&(a.recoverNode=null)};a.recoverNode&&a.recoverNode();try{if(!r.parentNode)return;n=r.parentNode}catch(l){return}if(e){if(8===r.nodeType){var s=a.keep,c=avalon.effect.apply(s,1,function(){i===a.stamp&&(r.parentNode.replaceChild(s,r),r=a.element=s,s.getAttribute("_required")&&(r.required=!0,r.removeAttribute("_required")),r.querySelectorAll&&avalon.each(r.querySelectorAll("[_required=true]"),function(e){e.required=!0,e.removeAttribute("_required")}),t())},o);c=c===!1}c||t()}else if(1===r.nodeType){r.required===!0&&(r.required=!1,r.setAttribute("_required","true"));try{avalon.each(r.querySelectorAll(":required"),function(e){r.required=!1,e.setAttribute("_required","true")})}catch(l){}var u=a.element=Ht.createComment("ms-if"),f=r.nextSibling;a.recoverNode=function(){a.recoverNode=null,u.parentNode!==n&&(n.insertBefore(u,f),a.keep=r)},avalon.effect.apply(r,0,function(){a.recoverNode=null,i===a.stamp&&(r.parentNode.replaceChild(u,r),a.keep=r,Bt.appendChild(r),a.rollback=function(){r.parentNode===Bt&&Bt.removeChild(r)})},o)}}});var _a=function(){return new e.XMLHttpRequest},Va=avalon.templateCache={};avalon.directive("include",{init:sn.attr.init,update:function(e){var t=this,n=this.element,a=t.vmodels,r=t.includeRendered,i=t.effectName&&t.effectClass,o=t.templateCache,l=t.includeReplace,s=t.includeLoaded,c=l?n.parentNode:n,u=t._element;t.recoverNodes=t.recoverNodes||avalon.noop;var f=(l&&u.cloneNode(),function(f){var d=t._stamp=+new Date;if(s){var v=s.apply(c,[f].concat(a));"string"==typeof v&&(f=v)}r&&U(c,function(){r.call(c)},0/0);var p=t.includeLastID||"_default";t.includeLastID=e;var h=o&&o[p]||Ht.createElement(n.tagName||t._element.tagName);i&&(h.className=i,c.insertBefore(h,t.start)),(o||{})[p]=h;var m=t.recoverNodes();for(m&&c.insertBefore(m,t.end);;){var g=t.start.nextSibling;if(!g||g===h||g===t.end)break;h.appendChild(g)}avalon.effect.remove(h,c,function(){o&&d===t._stamp&&Bt.appendChild(h)},t);var y=c,b=avalon.noop,$=avalon.noop,w=gt(t,e,f),x=avalon.slice(w.childNodes);l&&i?(y=u,y.innerHTML="",y.setAttribute("ms-skip","true"),c.insertBefore(y,t.end.nextSibling),b=function(){y.insertBefore(w,null)},$=function(){t.recoverNodes=avalon.noop,d===t._stamp&&(w=yt(x),c.insertBefore(w,t.end),tt(x,a)),y.parentNode===c&&c.removeChild(y)},t.recoverNodes=function(){return t.recoverNodes=avalon.noop,yt(x)}):b=function(){c.insertBefore(w,t.end),tt(x,a)},avalon.effect.apply(y,"enter",b,$)});if("src"===t.param)if("string"==typeof Va[e])avalon.nextTick(function(){f(Va[e])});else if(Array.isArray(Va[e]))Va[e].push(f);else{var d=_a();d.onload=function(){for(var t,n=d.responseText,a=0;t=Va[e][a++];)t(n);Va[e]=n},Va[e]=[f],d.open("GET",e,!0),"withCredentials"in d&&(d.withCredentials=!0),d.setRequestHeader("X-Requested-With","XMLHttpRequest"),d.send(null)}else{var v=e&&1===e.nodeType?e:Ht.getElementById(e);v&&avalon.nextTick(function(){f(v.value||v.innerText||v.innerHTML)})}}});var Ia=/\(([^)]*)\)/,Ya=avalon.directive("on",{priority:3e3,init:function(e){var t=e.expr;e.type="on";var n=e.param.replace(/-\d+$/,"");if("function"==typeof Ya[n+"Hook"]&&Ya[n+"Hook"](e),t.indexOf("(")>0&&t.indexOf(")")>-1){var a=(t.match(Ia)||["",""])[1].trim();(""===a||"$event"===a)&&(t=t.replace(Ia,""))}e.expr=t},update:function(e){var t=this,n=this.element;e=function(e){var n=t.getter||i;return n.apply(this,t.args.concat(e))};var a=t.param.replace(/-\d+$/,"");if("scan"===a)e.call(n,{type:a});else if("function"==typeof t.specialBind)t.specialBind(n,e);else var r=avalon.bind(n,a,e);t.rollback=function(){"function"==typeof t.specialUnbind?t.specialUnbind():avalon.unbind(n,a,r)}}});avalon.directive("repeat",{priority:90,init:function(e){var t=e.type;e.cache={},e.enterCount=0;var n=e.element;if(1===n.nodeType){n.removeAttribute(e.name),dt(n,e),e.param=e.param||"el",e.sortedCallback=ia(n,"data-with-sorted",e.vmodels);var a=ia(n,"data-"+t+"-rendered",e.vmodels),r=nn(t),i=Ht.createComment(r+":start"),o=e.element=Ht.createComment(r+":end");if(e.signature=r,e.start=i,e.template=en.cloneNode(!1),"repeat"===t){var l=n.parentNode;l.replaceChild(o,n),l.insertBefore(i,o),e.template.appendChild(n)}else{for(;n.firstChild;)e.template.appendChild(n.firstChild);n.appendChild(i),n.appendChild(o),l=n}if(e.element=o,a)var s=avalon.bind(l,"datasetchanged",function(){a.apply(l,l.args),avalon.unbind(l,"datasetchanged",s),l.msRendered=a})}},update:function(e,t){var n=this,a=this.xtype;this.enterCount+=1;var r=!t;if(r){n.$outer={};var i="$key",o="$val";"array"===a&&(i="$first",o="$last");for(var l,s=0;l=n.vmodels[s++];)if(l.hasOwnProperty(i)&&l.hasOwnProperty(o)){n.$outer=l;break}}var c=this.track;if(n.sortedCallback){var f=n.sortedCallback.call($,c);f&&Array.isArray(f)&&(c=f)}var d="move";n.$repeat=e;var v=[],p=r&&en.cloneNode(!1),h=[],m=this.param,g=avalon.mix({},this.cache),y=this.element,b=c.length,$=y.parentNode;for(s=0;b>s;s++){var w=c[s],x=g[w];if(x)v.push({}),g[w]=!0;else{x=Ct(this),"array"===a?(d="add",x.$id=w,x[m]=e[s]):(d="append",x.$key=w,x.$val=e[w]),this.cache[w]=x;var C=x.$anchor||(x.$anchor=y.cloneNode(!1));C.nodeValue=this.signature,xt(n,p,x,v,r&&!n.effectDriver),Et(x,n,a)}1===this.enterCount&&(x.$active=!1,x.$oldIndex=x.$index,x.$active=!0,x.$index=s),"array"===a?(x.$first=0===s,x.$last=s===b-1):x.$val=T(e[w]),h.push(x)}if(this.proxies=h,r&&!n.effectDriver)$.insertBefore(p,y),v.forEach(function(e){tt(e.nodes||[],e.vmodels),e.nodes=e.vmodels=null});else{var k=n.staggerIndex=0;for(w in g)g[w]!==!0&&(d="del",wt(g[w].$anchor,n),Mt(this.cache,w,m),g[w]=null);for(s=0;b>s;s++){x=h[s],w="array"===a?x.$id:x.$key;var E=h[s-1],N=E?E.$anchor:n.start;g[w]?x.$index!==x.$oldIndex&&!function(e,t){k=$t(n.effectEnterStagger,function(){var a=wt(e.$anchor),r=avalon.slice(a.childNodes);$.insertBefore(a,t.nextSibling),bt(r,1,n)},k)}(x,N):!function(e,t){var a=e.nodes,r=e.vmodels;a&&(k=$t(n.effectEnterStagger,function(){$.insertBefore(e.content,t.nextSibling),tt(a,r),bt(a,1,n)},k)),e.nodes=e.vmodels=null}(v[s],N)}}if(!e.$track)for(w in this.cache)Mt(this.cache,w,m);!function(e){$.args=e,$.msRendered&&$.msRendered.apply($,e)}(u.newWatch?arguments:[d]);var A=setTimeout(function(){clearTimeout(A),avalon.fireDom($,"datasetchanged",{bubble:$.msHasEvent})});this.enterCount-=1}}),"with,each".replace(It,function(e){sn[e]=avalon.mix({},sn.repeat,{priority:1400})});var Xa=[],za=[];avalon.directive("text",{update:function(e){var t=this.element;if(e=null==e?"":e,3===t.nodeType)try{t.data=e}catch(n){}else t.textContent=e}}),avalon.parseDisplay=St,avalon.directive("visible",{init:function(){},update:function(e){var t=this.element,n=this,a=n.stamp=+new Date;e?(t.style.display="none",avalon.effect.apply(t,1,function(){if(a===n.stamp){var e=t.getAttribute("data-effect-driver")||"a";/^[atn]/.test(e)&&(this.effectName||(t.style.display=""),"none"===avalon(t).css("display")&&(t.style.display=St(t.nodeName)))}})):avalon.effect.apply(t,0,function(){a===n.stamp&&(t.style.display="none")})}});var Wa=/]*>([\S\s]*?)<\/script\s*>/gim,Ua=/\s+(on[^=\s]+)(?:=("[^"]*"|'[^']*'|[^\s>]+))?/g,Ga=/<\w+\b(?:(["'])[^"]*?(\1)|[^>])*>/gi,Za={a:/\b(href)\=("javascript[^"]*"|'javascript[^']*')/gi,img:/\b(src)\=("javascript[^"]*"|'javascript[^']*')/gi,form:/\b(action)\=("javascript[^"]*"|'javascript[^']*')/gi},Ja=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Ka=/([^\#-~| |!])/g,Qa=avalon.filters={uppercase:function(e){return e.toUpperCase()},lowercase:function(e){return e.toLowerCase()},truncate:function(e,t,n){return t=t||30,n="string"==typeof n?n:"...",e.length>t?e.slice(0,t-n.length)+n:String(e)},$filter:function(e){for(var t=1,n=arguments.length;n>t;t++){var a=arguments[t],r=avalon.filters[a[0]];if("function"==typeof r){var i=[e].concat(a.slice(1));e=r.apply(null,i)}}return e},camelize:P,sanitize:function(e){return e.replace(Wa,"").replace(Ga,function(e){var t=e.toLowerCase().match(/<(\w+)\s/);if(t){var n=Za[t[1]];n&&(e=e.replace(n,function(e,t,n){var a=n.charAt(0);return t+"="+a+"javascript:void(0)"+a}))}return e.replace(Ua," ").replace(/\s+/g," ")})},escape:function(e){return String(e).replace(/&/g,"&").replace(Ja,function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1);return"&#"+(1024*(t-55296)+(n-56320)+65536)+";"}).replace(Ka,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")},currency:function(e,t,n){return(t||"¥")+Ot(e,isFinite(n)?n:2)},number:Ot};!new function(){function e(e){return parseInt(e,10)||0}function t(e,t,n){var a="";for(0>e&&(a="-",e=-e),e=""+e;e.length0||o>-a)&&(o+=a),0===o&&-12===a&&(o=12),t(o,n,r)}}function a(e,t){return function(n,a){var r=n["get"+e](),i=(t?"SHORT"+e:e).toUpperCase();return a[i][r]}}function r(e){var n=-1*e.getTimezoneOffset(),a=n>=0?"+":"";return a+=t(Math[n>0?"floor":"ceil"](n/60),2)+t(Math.abs(n%60),2)}function i(e,t){return e.getHours()<12?t.AMPMS[0]:t.AMPMS[1]}var o={yyyy:n("FullYear",4),yy:n("FullYear",2,0,!0),y:n("FullYear",1),MMMM:a("Month"),MMM:a("Month",!0),MM:n("Month",2,1),M:n("Month",1,1),dd:n("Date",2),d:n("Date",1),HH:n("Hours",2),H:n("Hours",1),hh:n("Hours",2,-12),h:n("Hours",1,-12),mm:n("Minutes",2),m:n("Minutes",1),ss:n("Seconds",2),s:n("Seconds",1),sss:n("Milliseconds",3),EEEE:a("Day"),EEE:a("Day",!0),a:i,Z:r},l=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,s=/^\/Date\((\d+)\)\/$/;Qa.date=function(t,n){var a,r,i=Qa.date.locate,c="",u=[];if(n=n||"mediumDate",n=i[n]||n,"string"==typeof t)if(/^\d+$/.test(t))t=e(t);else if(s.test(t))t=+RegExp.$1;else{var f=t.trim(),d=[0,0,0,0,0,0,0],v=new Date(0);f=f.replace(/^(\d+)\D(\d+)\D(\d+)/,function(t,n,a,r){var i=4===r.length?[r,n,a]:[n,a,r];return d[0]=e(i[0]),d[1]=e(i[1])-1,d[2]=e(i[2]),""});var p=v.setFullYear,h=v.setHours;f=f.replace(/[T\s](\d+):(\d+):?(\d+)?\.?(\d)?/,function(t,n,a,r,i){return d[3]=e(n),d[4]=e(a),d[5]=e(r),i&&(d[6]=Math.round(1e3*parseFloat("0."+i))),""});var m=0,g=0;f=f.replace(/Z|([+-])(\d\d):?(\d\d)/,function(t,n,a,r){return p=v.setUTCFullYear,h=v.setUTCHours,n&&(m=e(n+a),g=e(n+r)),""}),d[3]-=m,d[4]-=g,p.apply(v,d.slice(0,3)),h.apply(v,d.slice(3)),t=v}if("number"==typeof t&&(t=new Date(t)),"date"===avalon.type(t)){for(;n;)r=l.exec(n),r?(u=u.concat(r.slice(1)),n=u.pop()):(u.push(n),n=null);return u.forEach(function(e){a=o[e],c+=a?a(t,i):e.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),c}};var c={AMPMS:{0:"上午",1:"下午"},DAY:{0:"星期日",1:"星期一",2:"星期二",3:"星期三",4:"星期四",5:"星期五",6:"星期六"},MONTH:{0:"1月",1:"2月",2:"3月",3:"4月",4:"5月",5:"6月",6:"7月",7:"8月",8:"9月",9:"10月",10:"11月",11:"12月"},SHORTDAY:{0:"周日",1:"周一",2:"周二",3:"周三",4:"周四",5:"周五",6:"周六"},fullDate:"y年M月d日EEEE",longDate:"y年M月d日",medium:"yyyy-M-d H:mm:ss",mediumDate:"yyyy-M-d",mediumTime:"H:mm:ss","short":"yy-M-d ah:mm",shortDate:"yy-M-d",shortTime:"ah:mm"};c.SHORTMONTH=c.MONTH,Qa.date.locate=c};var er,tr=[],nr=function(e){for(er=!0,Rt&&(modules["domReady!"].state=4,Rt.checkDeps());e=tr.shift();)e(avalon)};"complete"===Ht.readyState?setTimeout(nr):Ht.addEventListener("DOMContentLoaded",nr),e.addEventListener("load",nr),avalon.ready=function(e){er?e(avalon):tr.push(e)},avalon.config({loader:!0}),avalon.ready(function(){avalon.scan(Ht.body)});var ar=navigator.userAgent.toLowerCase(),rr=ar.indexOf("android")>0,ir=Lt(),or=avalon.gestureHooks={pointers:{},start:function(e,t){for(var n=0;n0){var o=70;i>o&&(i=o),r.duration+i>o&&(r.duration=o-i),r.duration+=i,r.lastTouch=Dt({},a),r.lastTime=Date.now(),r.deltaX=a.clientX-r.startTouch.clientX,r.deltaY=a.clientY-r.startTouch.clientY;var l=r.deltaX*r.deltaX,s=r.deltaY*r.deltaY;r.distance=Math.sqrt(l+s),r.isVertical=!(l>s),t(r,a)}}},end:function(e,t){for(var n=0;nn.offsetHeight){t=n,e.tapScrollParent=n;break}n=n.parentElement}while(n)}t&&(t.lastScrollTop=t.scrollTop)},touchHasMoved:function(e){var t=e.changedTouches[0],n=cr.touchBoundary;return Math.abs(t.pageX-cr.touchStartX)>n||Math.abs(t.pageY-cr.touchStartY)>n},findControl:function(e){return void 0!==e.control?e.control:e.htmlFor?document.getElementById(e.htmlFor):e.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")},findType:function(e){return rr&&"select"===e.tagName.toLowerCase()?"mousedown":"click"},sendClick:function(t,n){or.fire(t,"tap",{touchEvent:n});var a,r;document.activeElement&&document.activeElement!==t&&document.activeElement.blur(),r=n.changedTouches[0],a=document.createEvent("MouseEvents"),a.initMouseEvent(cr.findType(t),!0,!0,e,1,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),a.touchEvent=n,t.dispatchEvent(a)},touchstart:function(t){if(1!==t.targetTouches.length)return!0;var n=cr.fixTarget(t.target),a=t.targetTouches[0];if(ir){var r=e.getSelection();if(r.rangeCount&&!r.isCollapsed)return!0;var i=a.identifier;if(i&&isFinite(cr.lastTouchIdentifier)&&cr.lastTouchIdentifier===i)return t.preventDefault(),!1;cr.lastTouchIdentifier=i,cr.updateScrollParent(n)}cr.status="tapping",cr.startTime=Date.now(),cr.element=n,cr.pageX=a.pageX,cr.pageY=a.pageY,cr.startTime-cr.lastTimecr.tapDelay)return!0;cr.lastTime=a;var r=cr.startTime;if(cr.status=cr.startTime=0,targetTagName=n.tagName.toLowerCase(),"label"===targetTagName){or.fire(n,"tap",{touchEvent:t});var i=cr.findControl(n);i&&(cr.focus(n),n=i)}else if(cr.needFocus(n))return a-r>100||ir&&e.top!==e&&"input"===targetTagName?(cr.element=0,!1):(cr.focus(n),rr&&cr.sendClick(n,t),!1);if(ir){var o=n.tapScrollParent;if(o&&o.lastScrollTop!==o.scrollTop)return!0}cr.needClick(n)||(t.preventDefault(),cr.sendClick(n,t))},touchcancel:function(){cr.startTime=cr.element=0}};or.add("tap",cr);var ur={events:["longtap","doubletap"],cancelPress:function(e){clearTimeout(e.pressingHandler),e.pressingHandler=null},touchstart:function(e){or.start(e,function(t,n){t.pressingHandler=setTimeout(function(){"tapping"===t.status&&or.fire(e.target,"longtap",{touch:n,touchEvent:e}),ur.cancelPress(t)},500),1!==e.changedTouches.length&&(t.status=0)})},touchmove:function(e){or.move(e,function(e){e.distance>10&&e.pressingHandler&&(ur.cancelPress(e),"tapping"===e.status&&(e.status="panning"))})},touchend:function(e){or.end(e,function(t,n){ur.cancelPress(t),"tapping"===t.status&&(t.lastTime=Date.now(),ur.lastTap&&t.lastTime-ur.lastTap.lastTime<300&&or.fire(t.element,"doubletap",{touch:n,touchEvent:e}),ur.lastTap=t)})},touchcancel:function(e){or.end(e,function(e){ur.cancelPress(e)})}};or.add("press",ur);var fr={events:["swipe","swipeleft","swiperight","swipeup","swipedown"],getAngle:function(e,t){var n=Math.atan2(t,e),a=Math.round(180*n/Math.PI);return 0>a?360-Math.abs(a):a},getDirection:function(e,t){var n=fr.getAngle(e,t);return 45>=n&&n>=0?"left":360>=n&&n>=315?"left":n>=135&&225>=n?"right":n>45&&135>n?"down":"up"},touchstart:function(e){or.start(e,i)},touchmove:function(e){or.move(e,i)},touchend:function(e){1===e.changedTouches.length&&or.end(e,function(t,n){var a=t.distance>30&&t.distance/t.duration>.65;if(a){var r={deltaX:t.deltaX,deltaY:t.deltaY,touch:n,touchEvent:e,direction:fr.getDirection(t.deltaX,t.deltaY),isVertical:t.isVertical},i=t.element;or.fire(i,"swipe",r),or.fire(i,"swipe"+r.direction,r)}})}};fr.touchcancel=fr.touchend,or.add("swipe",fr),"function"==typeof define&&define.amd&&define("avalon",[],function(){return avalon});var dr=e.avalon;return avalon.noConflict=function(t){return t&&e.avalon===avalon&&(e.avalon=dr),avalon},void 0===t&&(e.avalon=avalon),avalon}); \ No newline at end of file diff --git a/dist/avalon.modern.js b/dist/avalon.modern.js index a72d50366..4e6982a4f 100644 --- a/dist/avalon.modern.js +++ b/dist/avalon.modern.js @@ -5,7 +5,7 @@ http://weibo.com/jslouvre/ Released under the MIT license - avalon.modern.js 1.5.3 built in 2015.10.4 + avalon.modern.js 1.5.3 built in 2015.10.9 support IE10+ and other browsers ==================================================*/ (function(global, factory) { @@ -870,7 +870,7 @@ function observeObject(source, options) { options = options || nullObject var force = options.force || nullObject var old = options.old - var oldAccessors = typeof old === "object" ? old.$accessors : nullObject + var oldAccessors = old && old.$accessors || nullObject var $vmodel = new Component() //要返回的对象, 它在IE6-8下可能被偷龙转凤 var accessors = {} //监控属性 var hasOwn = {} @@ -2678,10 +2678,10 @@ function scanExpr(str) { } function scanText(textNode, vmodels, index) { - var bindings = [] + var bindings = [], tokens = scanExpr(textNode.data) if (tokens.length) { - for (var i = 0; token = tokens[i++];) { + for (var i = 0, token; token = tokens[i++];) { var node = DOC.createTextNode(token.expr) //将文本转换为文本节点,并替换原来的文本节点 if (token.type) { token.expr = token.expr.replace(roneTime, function () { diff --git a/dist/avalon.modern.min.js b/dist/avalon.modern.min.js index 2ff4cee31..fb893cf17 100644 --- a/dist/avalon.modern.min.js +++ b/dist/avalon.modern.min.js @@ -1,3 +1,3 @@ -!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("Avalon requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(){avalon.config.debug&&console.log.apply(console,arguments)}function r(){return Object.create(null)}function i(e){return Function.apply(o,e)}function o(){}function l(e,t){"string"==typeof e&&(e=e.match(Vt)||[]);for(var n={},a=void 0!==t?t:1,r=0,i=e.length;i>r;r++)n[e[r]]=a;return n}function s(){if(e.VBArray){var t=document.documentMode;return t?t:e.XMLHttpRequest?7:6}return 0/0}function c(e){if(e&&"object"==typeof e){var t=e.length,n=Yt.call(e);if(/(Array|List|Collection|Map|Arguments)\]$/.test(n))return!0;if("[object Object]"===n&&t===t>>>0)return!0}return!1}function u(e,t){if(e&&e.childNodes)for(var n,a=e.childNodes,r=0;n=a[r++];)if(n.tagName){var i=Lt.createElementNS(cn,n.tagName.toLowerCase());Gt.forEach.call(n.attributes,function(e){i.setAttribute(e.name,e.value)}),u(n,i),t.appendChild(i)}}function f(e){for(var t in e)if(Xt.call(e,t)){var n=e[t];"function"==typeof f.plugins[t]?f.plugins[t](n):"object"==typeof f[t]?avalon.mix(f[t],n):f[t]=n}return this}function d(e){return(e+"").replace(gn,"\\$&")}function p(e,t){var n=this.$events||(this.$events={}),a=n[e]||(n[e]=[]);if("function"==typeof t){var r=t;r.uniqueNumber=Math.random(),t={element:Kt,type:"user-watcher",handler:o,vmodels:[this],expr:e,uniqueNumber:r.uniqueNumber},t.wildcard=/\*/.test(e)}if(t.update)t.oneTime||avalon.Array.ensure(a,t);else{if(/\w\.*\B/.test(e)){t.getter=o;var i=this;t.update=function(){var e=this.fireArgs||[];e[2]&&t.handler.apply(i,e),delete this.fireArgs},a.sync=!0,avalon.Array.ensure(a,t)}else avalon.injectBinding(t);r&&(t.handler=r)}return function(){t.update=t.getter=t.handler=o,t.element=Lt.createElement("a")}}function v(e,t){var n=this.$events;if(n&&n[e]){t&&(t[2]=e),m(n[e],t);var a=this.$up;a&&(this.$pathname&&v.call(a,this.$pathname+"."+e,t),v.call(a,"*."+e,t))}else if(a=this.$up){var r=this.$pathname+"."+e,i=r.split(".");-1===i.indexOf("*")?(v.call(a,r,t),i[1]="*",v.call(a,i.join("."),t)):v.call(a,r,t)}}function h(e,t){for(;;){if(e.$watch){var n=e.$events||(e.$events={}),a=n[t]||(n[t]=[]);return void An.collectDependency(a)}if(e=e.$up,!e)break;t=e.$pathname+"."+t}}function m(e,t){if(e){new Date-On>444&&"object"==typeof e[0]&&H();for(var n,a=[],r=[],i=0;n=e[i++];)"user-watcher"===n.type?a.push(n):r.push(n);if(f.async){for(ga.render(),i=0;n=r[i++];)if(n.update){var o=j(n);ga.queue[o]||(ga.queue[o]=1,ga.queue.push(n))}}else for(i=0;n=r[i++];)n.update&&n.update();for(i=0;n=a[i++];)(t&&t[2]===n.expr||n.wildcard)&&(n.fireArgs=t),n.update()}}function g(e,t){return t=t||{},t.watch=!0,b(e,t)}function y(){}function b(e,t){function a(e){return u[e]===!0}if(!e||e.$id&&e.$accessors)return e;t=t||_t;var r=t.force||_t,i=t.old,o="object"==typeof i?i.$accessors:_t,s=new y,c={},u={},f=[],d=[],h={};e.$skipArray&&(h=l(e.$skipArray),delete e.$skipArray);var m=e.$computed;if(m){delete e.$computed;for(var g in m)u[g]=!0,function(e,t){var n;c[e]={get:function(){return n=t.get.call(this)},set:function(a){if("function"==typeof t.set){var r=n;t.set.call(this,a);var i=this[e];this.$fire&&i!==r&&this.$fire(e,i,r)}},enumerable:!0,configurable:!0}}(g,m[g])}for(g in e){var b=e[g];$n[g]||(u[g]=!0),"function"==typeof b||b&&b.nodeType||!r[g]&&("$"===g.charAt(0)||$n[g]||h[g])?f.push(g):$(b)?(n("warning:计算属性建议放在$computed对象中统一定义"),function(e,t){var n;c[e]={get:function(){return n=t.get.call(this)},set:function(a){if("function"==typeof t.set){var r=n;t.set.call(this,a);var i=this[e];this.$fire&&i!==r&&this.$fire(e,i,r)}},enumerable:!0,configurable:!0}}(g,b)):(d.push(g),c[g]=o[g]?o[g]:x(g,b))}c.$model=xn,s=Object.defineProperties(s,c,e),f.forEach(function(t){s[t]=e[t]}),k(s,"$id","anonymous"),k(s,"$up",i?i.$up:null),k(s,"$track",Object.keys(u)),k(s,"$active",!1),k(s,"$pathname",i?i.$pathname:""),k(s,"$accessors",c),k(s,"hasOwnProperty",a),t.watch&&(k(s,"$watch",function(){return p.apply(s,arguments)}),k(s,"$fire",function(e,t){if(0===e.indexOf("all!")){var n=e.slice(4);for(var a in avalon.vmodels){var r=avalon.vmodels[a];r.$fire&&r.$fire.apply(r,[n,t])}}else v.call(s,e,[t])})),d.forEach(function(t){var n=s[t]=e[t];n&&"object"==typeof n&&(n.$up=s,n.$pathname=t),v.call(s,t)});for(g in m)b=s[g];return s.$active=!0,s}function $(e){if(e&&"object"==typeof e){for(var t in e)if("get"!==t&&"set"!==t)return!1;return"function"==typeof e.get}}function x(e,t){var n,t=0/0;return{get:function(){return this.$active&&h(this,e),t},set:function(a){if(t!==a){var r=t;n=w(a,t),n?t=n:(n=void 0,t=a),Object(n)===n&&(n.$pathname=e,n.$up=this),this.$active&&v.call(this,e,[t,r])}},enumerable:!0,configurable:!0}}function w(e,t,n,a){if(Array.isArray(e))return C(e,t,a);if(avalon.isPlainObject(e)){if(t){var r=Object.keys(e),i=Object.keys(t);if(r.join(";")===i.join(";")){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);return t}t.$active=!1}return b(e,{old:t,watch:a})}return n?e:void 0}function C(e,t,n){if(t){var a=[0,t.length].concat(e);return t.splice.apply(t,a),t}for(var r in kn)e[r]=kn[r];k(e,"$up",null),k(e,"$pathname",""),k(e,"$track",T(e.length)),e._=b({length:0/0},{watch:!0}),e._.length=e.length,e._.$watch("length",function(t,n){v.call(e.$up,e.$pathname+".length",[t,n])}),n&&k(e,"$watch",function(){return p.apply(e,arguments)}),Object.defineProperty(e,"$model",xn);for(var i=0,o=e.length;o>i;i++){var l=e[i]=w(e[i],0,1,1);Object(l)===l&&(l.$up=e)}return e}function k(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!1,configurable:!0})}function N(e){var t=avalon.type(e);if("array"===t){for(var n=[],a=0;aa;a++){n[a]=e[a];var i=t[a];i in n?(e[a]=n[i],delete n[i]):e[a]=e[i]}}function T(e){for(var t=[],n=0;e>n;n++)t[n]=tn("$proxy$each");return t}function E(e,t,n){switch(t){case"push":case"unshift":n=T(n.length);break;case"splice":if(n.length>2){{n[1],n.length-2}n=[n[0],n[1]].concat(T(n.length-2))}}Array.prototype[t].apply(e,n)}function O(e,t){t.oneTime||e&&avalon.Array.ensure(e,t)&&t.element&&(S(t,e),new Date-On>444&&H())}function M(e,t){for(var n,a=[],r=0;n=e[r++];)a.push(t?n.$id:n.$key);return a.join(";")}function j(e){if(!e.uniqueNumber){var t=e.element;e.uniqueNumber=t?1!==t.nodeType?e.type+(e.pos||0)+"-"+j(t.parentNode):e.name+"-"+j(t):++Tn}return e.uniqueNumber}function S(e,t){var n=e.lists||(e.lists=[]),a=j(e);avalon.Array.ensure(n,t),t.$uuid=t.$uuid||tn(),En[a]||(En[a]=1,En.push(e))}function H(e){for(var t=En.length,n=t,a=[],r={},i={};e=En[--t];){var o=e.type;i[o]?i[o]++:(i[o]=1,a.push(o))}var l=!1;if(a.forEach(function(e){Mn[e]!==i[e]&&(r[e]=1,l=!0)}),t=n,l)for(;e=En[--t];)if(null!==e.element){if(r[e.type]&&D(e.element)){En.splice(t,1),delete En[e.uniqueNumber];for(var s,c=e.lists,u=0;s=c[u++];)avalon.Array.remove(c,s),avalon.Array.remove(s,e);L(e)}}else En.splice(t,1);Mn=i,On=new Date}function L(e){delete En[e.uniqueNumber],e.element=null,e.rollback&&e.rollback();for(var t in e)e[t]=null}function D(e){try{{e.parentNode.nodeType}}catch(t){return!0}return e.ifRemove&&!Kt.contains(e.ifRemove)&&qt===e.parentNode?(e.parentNode&&e.parentNode.removeChild(e),!0):e.msRetain?0:1===e.nodeType?!Kt.contains(e):!avalon.contains(Kt,e)}function R(e){return e.replace(/([a-z\d])([A-Z]+)/g,"$1-$2").toLowerCase()}function q(e){return e.indexOf("-")<0&&e.indexOf("_")<0?e:e.replace(/[-_][^-_]/g,function(e){return e.charAt(1).toUpperCase()})}function B(e){try{if("object"==typeof e)return e;e="true"===e?!0:"false"===e?!1:"null"===e?null:+e+""===e?+e:qn.test(e)?JSON.parse(e):e}catch(t){}return e}function P(e){return e.window&&e.document?e:9===e.nodeType?e.defaultView:!1}function F(e,t){if(e.offsetWidth<=0){var n=getComputedStyle(e,null);if(Vn.test(n.display)){var a={node:e};for(var r in _n)a[r]=n[r],e.style[r]=_n[r];t.push(a)}var i=e.parentNode;i&&1===i.nodeType&&F(i,t)}}function _(e){var t=e.tagName.toLowerCase();return"input"===t&&/checkbox|radio/.test(e.type)?"checked":t}function V(e,t){var n=[],a=!!t;t=t||0;for(var r="unknown",o="",l=0;lu;u++)if(r.length){var d="vm"+o+"_"+u;s.push(d),c.push(t[u]),l.push.apply(l,U(r,t[u],d,n))}n.args=c;var p=n.type,v=t.map(function(e){return String(e.$id).replace(Yn,"$1")})+e+p,h=Zn.get(v);if(h){if("duplex"===p){var m=Zn.get(v+"setter");n.setter=m.apply(m,n.args)}return n.getter=h}if(l.length||l.push("fix"+o),"duplex"===p){var g={};l.forEach(function(e){var t=e.split("=");g[t[0].trim()]=t[1].trim()}),e=e.replace(/[\$\w]+/,function(e){return g[e]?g[e]:e});var y=i(s.concat("'use strict';return function(vvv){"+e+" = vvv\n}\n"));Zn.put(v+"setter",y),n.setter=y.apply(y,n.args)}if("on"===p){-1===e.indexOf("(")?e+=".call(this, $event)":e=e.replace("(",".call(this,"),s.push("$event"),e="\nreturn "+e+";";var b=e.lastIndexOf("\nreturn"),$=e.slice(0,b),x=e.slice(b);e=$+"\n"+x}else e="\nreturn "+e+";";return h=i(s.concat("'use strict';\nvar "+l.join(",\n")+e)),Zn.put(v,h)}function X(e){var t=vn.test(e);if(t){var n=it(e);return 1===n.length?n[0].expr:n.map(function(e){return e.type?"("+e.expr+")":na(e.expr)}).join(" + ")}return e}function Y(e){return e=e.replace(Jn,"").replace(Kn,function(){return"],|"}).replace(Qn,function(e,t){return"["+na(t)}).replace(ea,function(){return'"],["'}).replace(ta,function(){return'",'})+"]",i(["return ["+e+"]"])()}function G(e,t,n){var a=setTimeout(function(){var r=e.innerHTML;clearTimeout(a),r===n?t():G(e,t,r)})}function Z(e,t){var n=e.getAttribute("avalonctrl")||t.$id;e.setAttribute("avalonctrl",n),t.$events&&(t.$events.expr=e.tagName+'[avalonctrl="'+n+'"]')}function J(e,t){for(var n,a=0;n=e[a++];)n.vmodels=t,ln[n.type].init(n),avalon.injectBinding(n),n.getter&&1===n.element.nodeType&&n.element.removeAttribute(n.name);e.length=0}function K(e,t){return e.priority-t.priority}function Q(e,t,a){var r=!0;if(t.length){for(var i,o=e.attributes,l=[],s={},c=0;i=o[c++];){var u=i.name;if(!s[u]&&(s[u]=1,i.specified&&(a=u.match(la)))){var f=a[1],d=a[2]||"",p=i.value;if(sa[f]?(d=f,f="on"):ca[f]&&(d=f,f="attr",u="ms-"+f+"-"+d,n("warning!请改用"+u+"代替"+i.name+"!")),ln[f]){var v=p.replace(oa,""),h=p!==v,m={type:f,param:d,element:e,name:u,expr:v,oneTime:h,priority:(ln[f].priority||10*f.charCodeAt(0))+(Number(d.replace(/\D/g,""))||0)};if("html"===f||"text"===f){var g=rt(p).filters;m.expr=m.expr.replace(g,""),m.filters=g.replace(pa,function(){return m.type="html",m.group=1,""}).trim()}else if("duplex"===f)var y=u;else if("ms-if-loop"===u)m.priority+=100;else if("ms-attr-value"===u)var b=u;l.push(m)}}}if(l.length){for(l.sort(K),y&&b&&"text"===e.type&&n("warning!一个控件不能同时定义ms-attr-value与"+y),c=0;m=l[c];c++){if(f=m.type,ua.test(f))return J(l.slice(0,c+1),t);r&&(r=!fa.test(f))}J(l,t)}}r&&!aa[e.tagName]&&(ia&&ia(e),tt(e,t))}function et(e){for(var t,n=e.attributes,a={},r=0;t=n[r++];)t.specified&&!da.test(t.name)&&(a[q(t.name)]=B(t.value));return a}function tt(e,t){var n=avalon.slice(e.childNodes);nt(n,t)}function nt(e,t){for(var n,a=0;n=e[a++];)switch(n.nodeType){case 1:var r=n;if(at(n,t),!r.msResolved&&r.parentNode&&1===r.parentNode.nodeType){var i=st(r);if(i){var o=r.localName?r.localName.replace(i+":",""):r.nodeName,l=i+":"+q(o);ya.push({library:i,element:r,fullName:l,widget:o,vmodels:t,name:"widget"}),avalon.components[l]&&avalon.component(l)}}n.msHasEvent&&avalon.fireDom(n,"datasetchanged",{bubble:n.msHasEvent});break;case 3:vn.test(n.nodeValue)&&ot(n,t,a)}}function at(e,t,n){var a=e.getAttribute("ms-skip"),r=e.getAttributeNode("ms-important"),i=e.getAttributeNode("ms-controller");if("string"!=typeof a){if(n=r||i){var o=avalon.vmodels[n.value];if(!o)return;t=n===r?[o]:[o].concat(t),e.removeAttribute(n.name),e.classList.remove(n.name),Z(e,o)}Q(e,t)}}function rt(e){if(e.indexOf("|")>0){var t=e.replace(ha,function(e){return Array(e.length+1).join("1")}),n=t.replace(va,"ᄢ㍄").indexOf("|");if(n>-1)return{type:"text",filters:e.slice(n).trim(),expr:e.slice(0,n)}}return{type:"text",expr:e,filters:""}}function it(e){for(var t,n,a=[],r=0;;){if(n=e.indexOf(dn,r),-1===n)break;if(t=e.slice(r,n),t&&a.push({expr:t}),r=n+dn.length,n=e.indexOf(pn,r),-1===n)break;t=e.slice(r,n),t&&a.push(rt(t,r)),r=n+pn.length}return t=e.slice(r),t&&a.push({expr:t}),a}function ot(e,t,n){var a=[];if(tokens=it(e.data),tokens.length){for(var r=0;token=tokens[r++];){var i=Lt.createTextNode(token.expr);token.type&&(token.expr=token.expr.replace(oa,function(){return token.oneTime=!0,""}),token.element=i,token.filters=token.filters.replace(pa,function(){return token.type="html",""}),token.pos=1e3*n+r,a.push(token)),Qt.appendChild(i)}e.parentNode.replaceChild(Qt,e),a.length&&J(a,t)}}function lt(e,t){if(t)for(var n,a=0;n=e[a++];)if(n.hasOwnProperty(t)&&"object"==typeof n[t]){var r=n[t];return r.$model||r}return{}}function st(e){if(e.scopeName&&"HTML"!==e.scopeName)return e.scopeName;var t=e.nodeName.toLowerCase(),n=t.indexOf(":");return n>0?t.slice(0,n):void 0}function ct(e){return null==e?"":e}function ut(e,t,n){return t.param.replace(It,function(a){var r=avalon.duplexHooks[a];r&&"function"==typeof r[n]&&(e=r[n](e,t))}),e}function ft(){for(var e=Oa.length-1;e>=0;e--){var t=Oa[e];t()===!1&&Oa.splice(e,1)}Oa.length||clearInterval(Ea)}function dt(e,t){if(!e||1!==e.nodeType)return null;if(t)var n=t.effectName,a=t.effectDriver;else n=e.getAttribute("data-effect-name"),a=e.getAttribute("data-effect-driver");if(!n||!a)return null;var r=qa.pop()||new ht;return r.el=e,r.driver=a,r.useCss="j"!==a,r.useCss&&(t&&avalon(e).addClass(t.effectClass),r.cssEvent="t"===a?ja:Sa),r.name=n,r.callbacks=avalon.effects[n]||{},r}function pt(e,t){var n=e.getAttribute("data-effect-name");if(n){t.effectName=n,t.effectDriver=e.getAttribute("data-effect-driver");var a=+e.getAttribute("data-effect-stagger");t.effectLeaveStagger=+e.getAttribute("data-effect-leave-stagger")||a,t.effectEnterStagger=+e.getAttribute("data-effect-enter-stagger")||a,t.effectClass=e.className||0/0}}function vt(e){return e.replace(/^[\S]/g,function(e){return e.toUpperCase()})}function ht(){}function mt(e,t){var n=e.callbacks[t+"Class"];return"string"==typeof n?n:"function"==typeof n?n():e.name+"-"+t}function gt(e,t,n){var a=e.callbacks[t];a&&a.call(e,e.el,n)}function yt(e,t,n){var a=e.templateCache&&e.templateCache[t];if(a){for(var r,i=Lt.createDocumentFragment();r=a.firstChild;)i.appendChild(r);return i}return avalon.parseHTML(n)}function bt(e){for(var t=Lt.createDocumentFragment(),n=0,a=e.length;a>n;n++)t.appendChild(e[n]);return t}function $t(e,t,n){for(var a,r=0;a=e[r++];)a.className===n.effectClass&&avalon.effect.apply(a,t,o,o,n)}function xt(e,t,n){return e?setTimeout(t,++n*e):t(),n}function wt(e,t){for(var n=Qt.cloneNode(!1),a=e,r=a.nodeValue,i=t&&Math.max(+t.staggerIndex,0),l=avalon.slice(a.parentNode.childNodes),s=l.indexOf(a);;){var c=l[--s];if(!c||0===String(c.nodeValue).indexOf(r))break;t&&c.className===t.effectClass?(e=c,function(e){t.staggerIndex=xt(t.effectLeaveStagger,function(){avalon.effect.apply(e,0,o,function(){n.appendChild(e)},t)},i)}(c)):n.insertBefore(c,n.firstChild)}return n.appendChild(a),n}function Ct(e,t,n,a,r){var i=e.template.cloneNode(!0),o=avalon.slice(i.childNodes);i.appendChild(n.$anchor),r&&t.appendChild(i);var l=[n].concat(e.vmodels),s={nodes:o,vmodels:l,content:i};a.push(s)}function kt(e){var t="object"===e.xtype?Et:Nt,n=t(e),a=n.$anchor||(n.$anchor=e.element.cloneNode(!1));return a.nodeValue=e.signature,n.$outer=e.$outer,n}function Nt(e,t){for(var n=e.param||"el",a=0,r=Ua.length;r>a;a++){var i=Ua[a];if(i&&i.hasOwnProperty(n)){Ua.splice(a,1),t=i;break}}return t||(t=At(n)),t}function At(e){var t={$outer:{},$index:0,$oldIndex:0,$anchor:null,$first:!1,$last:!1,$remove:avalon.noop};t[e]=0/0;var n={$last:1,$first:1,$index:1};n[e]=1;var a=g(t,{force:n});return a.$id=tn("$proxy$each"),a}function Tt(e,t,n){if("array"===n){e.$remove=function(){t.$repeat.removeAt(e.$index)};var a=t.param;e.$watch(a,function(n){var a=e.$index;t.$repeat[a]=n})}else e.$watch("$val",function(n){t.$repeat[e.$key]=n})}function Et(){return za.pop()||Ot()}function Ot(){var e=g({$key:"",$val:0/0,$index:0,$oldIndex:0,$outer:{},$anchor:null},{force:{$key:1,$val:1,$index:1}});return e.$id=tn("$proxy$with"),e}function Mt(e,t,n){var a=e[t];if(a){var r=0===a.$id.indexOf("$proxy$each")?Ua:za;a.$outer={};for(var i in a.$events){var o=a.$events[i];Array.isArray(o)&&(o.length=0,i===n?a[n]=0/0:"$val"===i&&(a.$val=0/0))}r.unshift(a)>f.maxRepeatSize&&r.pop(),delete e[t]}}function jt(e,t){var n="_"+e;if(!jt[n]){var a=Lt.createElement(e);Kt.appendChild(a),t=Jt?getComputedStyle(a,null).display:a.currentStyle.display,Kt.removeChild(a),jt[n]=t}return jt[n]}function St(e,t,n,a){e=(e+"").replace(/[^0-9+\-Ee.]/g,"");var r=isFinite(+e)?+e:0,i=isFinite(+t)?Math.abs(t):3,o=a||",",l=n||".",s="",c=function(e,t){var n=Math.pow(10,t);return""+(Math.round(e*n)/n).toFixed(t)};return s=(i?c(r,i):""+Math.round(r)).split("."),s[0].length>3&&(s[0]=s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,o)),(s[1]||"").length');var Rt,qt=Dt.firstChild,Bt="$"+Ht,Pt=e.require,Ft=e.define,_t={},Vt=/[^, ]+/g,It=/\w+/g,Ut=/^\[object SVG\w*Element\]$/,zt=/^\[object (?:Window|DOMWindow|global)\]$/,Wt=Object.prototype,Xt=Wt.hasOwnProperty,Yt=Wt.toString,Gt=Array.prototype,Zt=Gt.slice,Jt=e.dispatchEvent,Kt=Lt.documentElement,Qt=Lt.createDocumentFragment(),en=(Lt.createElement("div"),{});"Boolean Number String Function Array Date RegExp Object Error".replace(Vt,function(e){en["[object "+e+"]"]=e.toLowerCase()});var tn=function(e){return e=e||"avalon",String(Math.random()+Math.random()).replace(/\d\.\d{4}/,e)},nn=s();avalon=function(e){return new avalon.init(e)},avalon.nextTick=new function(){function t(){for(var e=r.length,t=0;e>t;t++)r[t]();r=r.slice(e)}var n=e.setImmediate,a=e.MutationObserver;if(n)return n.bind(e);var r=[];if(a){var i=document.createTextNode("avalon");new a(t).observe(i,{characterData:!0});var o=!1;return function(e){r.push(e),o=!o,i.data=o}}return function(e){setTimeout(e,4)}},avalon.init=function(e){this[0]=this.element=e},avalon.fn=avalon.prototype=avalon.init.prototype,avalon.type=function(e){return null==e?String(e):"object"==typeof e||"function"==typeof e?en[Yt.call(e)]||"object":typeof e};var an=function(e){return"[object Function]"===Yt.call(e)};avalon.isFunction=an,avalon.isWindow=function(e){return zt.test(Yt.call(e))},avalon.isPlainObject=function(e){return"[object Object]"===Yt.call(e)&&Object.getPrototypeOf(e)===Wt},avalon.mix=avalon.fn.mix=function(){var e,t,n,a,r,i,o=arguments[0]||{},l=1,s=arguments.length,c=!1;for("boolean"==typeof o&&(c=o,o=arguments[1]||{},l++),"object"==typeof o||an(o)||(o={}),l===s&&(o=this,l--);s>l;l++)if(null!=(e=arguments[l]))for(t in e)n=o[t],a=e[t],o!==a&&(c&&a&&(avalon.isPlainObject(a)||(r=Array.isArray(a)))?(r?(r=!1,i=n&&Array.isArray(n)?n:[]):i=n&&avalon.isPlainObject(n)?n:{},o[t]=avalon.mix(c,i,a)):void 0!==a&&(o[t]=a));return o},avalon.mix({rword:Vt,subscribers:Bt,version:1.53,ui:{},log:n,slice:function(e,t,n){return Zt.call(e,t,n)},noop:o,error:function(e,t){throw new(t||Error)(e)},oneObject:l,range:function(e,t,n){n||(n=1),null==t&&(t=e||0,e=0);for(var a=-1,r=Math.max(0,Math.ceil((t-e)/n)),i=new Array(r);++an&&t(n,e[n])!==!1;n++);else for(n in e)if(e.hasOwnProperty(n)&&t(n,e[n])===!1)break}},getWidgetData:function(e,t){var n=avalon(e).data(),a={};for(var r in n)0===r.indexOf(t)&&(a[r.replace(t,"").replace(/\w/,function(e){return e.toLowerCase()})]=n[r]);return a},Array:{ensure:function(e,t){return-1===e.indexOf(t)?e.push(t):void 0},removeAt:function(e,t){return!!e.splice(t,1).length},remove:function(e,t){var n=e.indexOf(t);return~n?avalon.Array.removeAt(e,n):!1}}});var rn=avalon.bindingHandlers={},on=avalon.bindingExecutors={},ln=avalon.directives={};avalon.directive=function(e,t){return rn[e]=t.init=t.init||o,on[e]=t.update=t.update||o,ln[e]=t};var sn=new function(){function e(e){this.size=0,this.limit=e,this.head=this.tail=void 0,this._keymap={}}var t=e.prototype;return t.put=function(e,t){var n={key:e,value:t};return this._keymap[e]=n,this.tail?(this.tail.newer=n,n.older=this.tail):this.head=n,this.tail=n,this.size===this.limit?this.shift():this.size++,t},t.shift=function(){var e=this.head;e&&(this.head=this.head.newer,this.head.older=e.newer=e.older=this._keymap[e.key]=void 0,delete this._keymap[e.key])},t.get=function(e){var t=this._keymap[e];if(void 0!==t)return t===this.tail?t.value:(t.newer&&(t===this.head&&(this.head=t.newer),t.newer.older=t.older),t.older&&(t.older.newer=t.newer),t.newer=void 0,t.older=this.tail,this.tail&&(this.tail.newer=t),this.tail=t,t.value)},e};if(Lt.contains||(Node.prototype.contains=function(e){return!!(16&this.compareDocumentPosition(e))}),avalon.contains=function(e,t){try{for(;t=t.parentNode;)if(t===e)return!0;return!1}catch(n){return!1}},e.SVGElement){var cn="http://www.w3.org/2000/svg",un=Lt.createElementNS(cn,"svg");un.innerHTML='',Ut.test(un.firstChild)||Object.defineProperties(SVGElement.prototype,{outerHTML:{enumerable:!0,configurable:!0,get:function(){return(new XMLSerializer).serializeToString(this)},set:function(e){var t=this.tagName.toLowerCase(),n=this.parentNode,a=avalon.parseHTML(e);if("svg"===t)n.insertBefore(a,this);else{var r=Lt.createDocumentFragment();u(a,r),n.insertBefore(r,this)}n.removeChild(this)}},innerHTML:{enumerable:!0,configurable:!0,get:function(){var e=this.outerHTML,t=new RegExp("<"+this.nodeName+'\\b(?:(["\'])[^"]*?(\\1)|[^>])*>',"i"),n=new RegExp("$","i");return e.replace(t,"").replace(n,"")},set:function(e){if(avalon.clearHTML){avalon.clearHTML(this);var t=avalon.parseHTML(e);u(t,this)}}}})}var fn=avalon.eventHooks;"onmouseenter"in Kt||avalon.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){fn[e]={type:t,fn:function(t,n){return function(a){var r=a.relatedTarget;return r&&(r===t||16&t.compareDocumentPosition(r))?void 0:(delete a.type,a.type=e,n.call(t,a))}}}}),avalon.each({AnimationEvent:"animationend",WebKitAnimationEvent:"webkitAnimationEnd"},function(t,n){e[t]&&!fn.animationend&&(fn.animationend={type:n})}),void 0===Lt.onmousewheel&&(fn.mousewheel={type:"wheel",fn:function(e,t){return function(n){n.wheelDeltaY=n.wheelDelta=n.deltaY>0?-120:120,n.wheelDeltaX=0,Object.defineProperty(n,"type",{value:"mousewheel"}),t.call(e,n)}}});var dn,pn,vn,hn,mn,gn=/[-.*+?^${}()|[\]\/\\]/g,yn={loader:function(t){var n=Rt&&t;e.require=n?Rt:Pt,e.define=n?Rt.define:Ft},interpolate:function(e){if(dn=e[0],pn=e[1],dn===pn){throw new SyntaxError("openTag!==closeTag")}f.openTag=dn,f.closeTag=pn;var t=d(dn),n=d(pn);vn=new RegExp(t+"(.*?)"+n),hn=new RegExp(t+"(.*?)"+n,"g"),mn=new RegExp(t+".*?"+n+"|\\sms-")}};f.async=!0,f.debug=!0,f.plugins=yn,f.plugins.interpolate(["{{","}}"]),f.paths={},f.shim={},f.maxRepeatSize=100,avalon.config=f;var bn=avalon.vmodels={};avalon.define=function(e){var t=e.$id;t||n("warning: vm必须指定$id");var a=g(e);return a.$id=t,bn[t]=a};var $n=l("$id,$watch,$fire,$events,$model,$skipArray,$active,$pathname,$up,$track,$accessors"),xn={get:function(){return N(this)},set:o,enumerable:!1,configurable:!0},wn=["push","pop","shift","unshift","splice"],Cn=Array.prototype,kn={notify:function(){v.call(this.$up,this.$pathname)},set:function(e,t){if(e>>>0===e&&this[e]!==t){if(e>this.length)throw Error(e+"set方法的第一个参数不能大于原数组长度");v.call(this.$up,this.$pathname+".*",[t,this[e]]),this.splice(e,1,t)}},contains:function(e){return-1!==this.indexOf(e)},ensure:function(e){return this.contains(e)||this.push(e),this},pushArray:function(e){return this.push.apply(this,e)},remove:function(e){return this.removeAt(this.indexOf(e))},removeAt:function(e){return e>>>0===e?this.splice(e,1):[]},size:function(){return this._.length},removeAll:function(e){if(Array.isArray(e))for(var t=this.length-1;t>=0;t--)-1!==e.indexOf(this[t])&&(Nn.call(this.$track,t,1),Nn.call(this,t,1));else if("function"==typeof e)for(t=this.length-1;t>=0;t--){var n=this[t];e(n,t)&&(Nn.call(this.$track,t,1),Nn.call(this,t,1))}else Nn.call(this.$track,0,this.length),Nn.call(this,0,this.length);Jt||(this.$model=N(this)),this.notify(),this._.length=this.length},clear:function(){return this.removeAll()}},Nn=Cn.splice;wn.forEach(function(e){var t=Cn[e];kn[e]=function(){for(var n=[],a=0,r=arguments.length;r>a;a++)n[a]=w(arguments[a],0,1,1);var i=t.apply(this,n);return E(this.$track,e,n),Jt||(this.$model=N(this)),this.notify(),this._.length=this.length,i}}),"sort,reverse".replace(Vt,function(e){kn[e]=function(){var t=this.concat(),n=this,a=Math.random(),r=[],i=!1;Cn[e].apply(n,arguments);for(var o=0,l=t.length;l>o;o++){var s=n[o],c=t[o];if(s===c)r.push(o);else{var u=t.indexOf(s);r.push(u),t[u]=a,i=!0}}return i&&(A(this.$track,r),Jt||(this.$model=N(this)),this.notify()),this}});var An=function(){var e,t=[];return{begin:function(n){t.push(e),e=n},end:function(){e=t.pop()},collectDependency:function(t){e&&e.callback(t)}}}();avalon.injectBinding=function(e){e.handler=e.handler||ln[e.type].update||o,e.update=function(){var t=!1;e.getter||(t=!0,An.begin({callback:function(t){O(t,e)}}),e.getter=W(e.expr,e.vmodels,e),e.observers.forEach(function(t){t.v.$watch(t.p,e)}),delete e.observers);try{var a,r,i=e.fireArgs;if(delete e.fireArgs,i?(a=i[0],r=i[1]):a="on"===e.type?e.getter+"":e.getter.apply(0,e.args),r="undefined"==typeof r?e.oldValue:r,e._filters&&(a=Ka.$filter.apply(0,[a].concat(e._filters))),e.signature){var o=avalon.type(a);if("array"!==o&&"object"!==o)throw Error("warning:"+e.expr+"只能是对象或数组");e.xtype=o;var l=M(e.proxies||[],o),s=a.$track||("array"===o?T(a.length):Object.keys(a));e.track=s,l!==s.join(";")&&(e.handler(a,r),e.oldValue=1)}else(Array.isArray(a)?a.length===(r&&r.length):1)?"oldValue"in e&&a===r||(e.handler(a,r),e.oldValue=a):(e.handler(a,r),e.oldValue=a.concat())}catch(c){delete e.getter,n("warning:exception throwed in [avalon.injectBinding] ",c);var u=e.element;u&&3===u.nodeType&&(u.nodeValue=dn+(e.oneTime?"::":"")+e.expr+pn)}finally{t&&An.end()}},e.update()};var Tn=0,En=avalon.$$subscribers=[],On=new Date,Mn={},jn=new function(){avalon.mix(this,{option:Lt.createElement("select"),thead:Lt.createElement("table"),td:Lt.createElement("tr"),area:Lt.createElement("map"),tr:Lt.createElement("tbody"),col:Lt.createElement("colgroup"),legend:Lt.createElement("fieldset"),_default:Lt.createElement("div"),g:Lt.createElementNS("http://www.w3.org/2000/svg","svg")}),this.optgroup=this.option,this.tbody=this.tfoot=this.colgroup=this.caption=this.thead,this.th=this.td};String("circle,defs,ellipse,image,line,path,polygon,polyline,rect,symbol,text,use").replace(Vt,function(e){jn[e]=jn.g});var Sn=/<([\w:]+)/,Hn=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Ln=l(["","text/javascript","text/ecmascript","application/ecmascript","application/javascript"]),Dn=Lt.createElement("script"),Rn=/<|&#?\w+;/;avalon.parseHTML=function(e){var t=Qt.cloneNode(!1);if("string"!=typeof e)return t;if(!Rn.test(e))return t.appendChild(Lt.createTextNode(e)),t;e=e.replace(Hn,"<$1>").trim();var n,a=(Sn.exec(e)||["",""])[1].toLowerCase(),r=jn[a]||jn._default;r.innerHTML=e;var i=r.getElementsByTagName("script");if(i.length)for(var o,l=0;o=i[l++];)if(Ln[o.type]){var s=Dn.cloneNode(!1);Gt.forEach.call(o.attributes,function(e){s.setAttribute(e.name,e.value)}),s.text=o.text,o.parentNode.replaceChild(s,o)}for(;n=r.firstChild;)t.appendChild(n);return t},avalon.innerHTML=function(e,t){var n=this.parseHTML(t);this.clearHTML(e).appendChild(n)},avalon.clearHTML=function(e){for(e.textContent="";e.firstChild;)e.removeChild(e.firstChild);return e},"add,remove".replace(Vt,function(e){avalon.fn[e+"Class"]=function(t){var n=this[0];return t&&"string"==typeof t&&n&&1===n.nodeType&&t.replace(/\S+/g,function(t){n.classList[e](t)}),this}}),avalon.fn.mix({hasClass:function(e){var t=this[0]||{};return 1===t.nodeType&&t.classList.contains(e)},toggleClass:function(e,t){for(var n,a=0,r=String(e).split(/\s+/),i="boolean"==typeof t;n=r[a++];){var o=i?t:!this.hasClass(n);this[o?"addClass":"removeClass"](n)}return this},attr:function(e,t){return 2===arguments.length?(this[0].setAttribute(e,t),this):this[0].getAttribute(e)},data:function(e,t){switch(e="data-"+R(e||""),arguments.length){case 2:return this.attr(e,t),this;case 1:var n=this.attr(e);return B(n);case 0:var a={};return Gt.forEach.call(this[0].attributes,function(t){t&&(e=t.name,e.indexOf("data-")||(e=q(e.slice(5)),a[e]=B(t.value)))}),a}},removeData:function(e){return e="data-"+R(e),this[0].removeAttribute(e),this},css:function(e,t){if(avalon.isPlainObject(e))for(var n in e)avalon.css(this,n,e[n]);else var a=avalon.css(this,e,t);return void 0!==a?a:this},position:function(){var e,t,n=this[0],a={top:0,left:0};if(n)return"fixed"===this.css("position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),"HTML"!==e[0].tagName&&(a=e.offset()),a.top+=avalon.css(e[0],"borderTopWidth",!0),a.left+=avalon.css(e[0],"borderLeftWidth",!0),a.top-=e.scrollTop(),a.left-=e.scrollLeft()),{top:t.top-a.top-avalon.css(n,"marginTop",!0),left:t.left-a.left-avalon.css(n,"marginLeft",!0)}},offsetParent:function(){for(var e=this[0].offsetParent;e&&"static"===avalon.css(e,"position");)e=e.offsetParent;return avalon(e||Kt)},bind:function(e,t,n){return this[0]?avalon.bind(this[0],e,t,n):void 0},unbind:function(e,t,n){return this[0]&&avalon.unbind(this[0],e,t,n),this},val:function(e){var t=this[0];if(t&&1===t.nodeType){var n=0===arguments.length,a=n?":get":":set",r=In[_(t)+a]; -if(r)var i=r(t,e);else{if(n)return(t.value||"").replace(/\r/g,"");t.value=e}}return n?i:this}}),Kt.dataset&&(avalon.fn.data=function(e,t){e=e&&q(e);var n=this[0].dataset;switch(arguments.length){case 2:return n[e]=t,this;case 1:return t=n[e],B(t);case 0:var a=r();for(e in n)a[e]=B(n[e]);return a}});var qn=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/;avalon.parseJSON=JSON.parse,avalon.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){avalon.fn[e]=function(n){var a=this[0]||{},r=P(a),i="scrollTop"===e;return arguments.length?void(r?r.scrollTo(i?r[t]:n,i?n:r[t]):a[e]=n):r?r[t]:a[e]}});var Bn=avalon.cssHooks=r(),Pn=["","-webkit-","-moz-","-ms-"],Fn={"float":"cssFloat"};avalon.cssNumber=l("animationIterationCount,animationIterationCount,columnCount,order,flex,flexGrow,flexShrink,fillOpacity,fontWeight,lineHeight,opacity,orphans,widows,zIndex,zoom"),avalon.cssName=function(e,t,n){if(Fn[e])return Fn[e];t=t||Kt.style;for(var a=0,r=Pn.length;r>a;a++)if(n=q(Pn[a]+e),n in t)return Fn[e]=n;return null},Bn["@:set"]=function(e,t,n){e.style[t]=n},Bn["@:get"]=function(e,t){if(!e||!e.style)throw new Error("getComputedStyle要求传入一个节点 "+e);var n,a=getComputedStyle(e);return a&&(n="filter"===t?a.getPropertyValue(t):a[t],""===n&&(n=e.style[t])),n},Bn["opacity:get"]=function(e){var t=Bn["@:get"](e,"opacity");return""===t?"1":t},"top,left".replace(Vt,function(e){Bn[e+":get"]=function(t){var n=Bn["@:get"](t,e);return/px$/.test(n)?n:avalon(t).position()[e]+"px"}});var _n={position:"absolute",visibility:"hidden",display:"block"},Vn=/^(none|table(?!-c[ea]).+)/;"Width,Height".replace(Vt,function(e){var t=e.toLowerCase(),n="client"+e,a="scroll"+e,r="offset"+e;Bn[t+":get"]=function(t,n,a){var i=-4;"number"==typeof a&&(i=a),n="Width"===e?["Left","Right"]:["Top","Bottom"];var o=t[r];return 2===i?o+avalon.css(t,"margin"+n[0],!0)+avalon.css(t,"margin"+n[1],!0):(0>i&&(o=o-avalon.css(t,"border"+n[0]+"Width",!0)-avalon.css(t,"border"+n[1]+"Width",!0)),-4===i&&(o=o-avalon.css(t,"padding"+n[0],!0)-avalon.css(t,"padding"+n[1],!0)),o)},Bn[t+"&get"]=function(e){var n=[];F(e,n);for(var a,r=Bn[t+":get"](e),i=0;a=n[i++];){e=a.node;for(var o in a)"string"==typeof a[o]&&(e.style[o]=a[o])}return r},avalon.fn[t]=function(i){var o=this[0];if(0===arguments.length){if(o.setTimeout)return o["inner"+e];if(9===o.nodeType){var l=o.documentElement;return Math.max(o.body[a],l[a],o.body[r],l[r],l[n])}return Bn[t+"&get"](o)}return this.css(t,i)},avalon.fn["inner"+e]=function(){return Bn[t+":get"](this[0],void 0,-2)},avalon.fn["outer"+e]=function(e){return Bn[t+":get"](this[0],void 0,e===!0?2:0)}}),avalon.fn.offset=function(){var e=this[0];try{var t=e.getBoundingClientRect();if(t.width||t.height||e.getClientRects().length){var n=e.ownerDocument,a=n.documentElement,r=n.defaultView;return{top:t.top+r.pageYOffset-a.clientTop,left:t.left+r.pageXOffset-a.clientLeft}}}catch(i){return{left:0,top:0}}};var In={"select:get":function(e,t){for(var n,a=e.options,r=e.selectedIndex,i="select-one"===e.type||0>r,o=i?null:[],l=i?r+1:a.length,s=0>r?l:i?r:0;l>s;s++)if(n=a[s],(n.selected||s===r)&&!n.disabled){if(t=n.value,i)return t;o.push(t)}return o},"select:set":function(e,t,n){t=[].concat(t);for(var a,r=0;a=e.options[r++];)(a.selected=t.indexOf(a.value)>-1)&&(n=!0);n||(e.selectedIndex=-1)}},Un={},zn=["break,case,catch,continue,debugger,default,delete,do,else,false","finally,for,function,if,in,instanceof,new,null,return,switch,this","throw,true,try,typeof,var,void,while,with","abstract,boolean,byte,char,class,const,double,enum,export,extends","final,float,goto,implements,import,int,interface,long,native","package,private,protected,public,short,static,super,synchronized","throws,transient,volatile","arguments,let,yield,undefined"].join(",");zn.replace(/\w+/g,function(e){Un[e]=!0});var Wn=/[a-z_$]/i,Xn=/[\s\uFEFF\xA0]/,Yn=/(\$proxy\$[a-z]+)\d+$/,Gn=new sn(218),Zn=new sn(128),Jn=/\)\s*$/,Kn=/\)\s*\|/g,Qn=/\|\s*([$\w]+)/g,ea=/"\s*\["/g,ta=/"\s*\(/g,na=JSON.stringify;avalon.scan=function(e,t){e=e||Kt;var n=t?[].concat(t):[];at(e,n)};var aa=l("area,base,basefont,br,col,command,embed,hr,img,input,link,meta,param,source,track,wbr,noscript,script,style,textarea".toUpperCase()),ra=function(e,t,n){var a=e.getAttribute(t);if(a)for(var r,i=0;r=n[i++];)if(r.hasOwnProperty(a)&&"function"==typeof r[a])return r[a]},ia=nn&&e.MutationObserver?function(e){for(var t,n=e.firstChild;n;){var a=n.nextSibling;3===n.nodeType?t?(t.nodeValue+=n.nodeValue,e.removeChild(n)):t=n:t=null,n=a}}:0,oa=/^\s*::/,la=/ms-(\w+)-?(.*)/,sa=l("animationend,blur,change,input,click,dblclick,focus,keydown,keypress,keyup,mousedown,mouseenter,mouseleave,mousemove,mouseout,mouseover,mouseup,scan,scroll,submit"),ca=l("value,title,alt,checked,selected,disabled,readonly,enabled,href,src"),ua=/^if|widget|repeat$/,fa=/^each|with|html|include$/,da=/^(ms-\S+|data-\S+|on[a-z]+|id|style|class|tabindex)$/,pa=/\|\s*html(?:\b|$)/,va=/\|\|/g,ha=/(['"])(\\\1|.)+?\1/g,ma=function(){this.queue=[]};ma.prototype={render:function(e){if(!this.locked){this.locked=e?Kt.offsetHeight+10:1;var t=this;avalon.nextTick(function(){t.flush()})}},flush:function(){for(var e,t=0;e=this.queue[t++];)e.update();this.locked=0,this.queue=[]}};var ga=new ma,ya=[],ba=[],$a={$construct:function(){return avalon.mix.apply(null,arguments)},$ready:o,$init:o,$dispose:o,$container:null,$childReady:o,$replace:!1,$extend:null,$$template:function(e){return e}};avalon.components={},avalon.component=function(t,n){n&&(avalon.components[t]=avalon.mix({},$a,n));for(var a,r=0;a=ya[r];r++)t===a.fullName&&(ya.splice(r,1),r--,function(n,a,r,i){var o=1,l=n.library,s=avalon.libraries[l]||$a,c=et(r),u=lt(n.vmodels,c.config||n.fullName),f=c.$id||c.identifier||tn(i);delete c.config,delete c.$id,delete c.identifier;var d={},p=avalon.components[a.$extend];p?(avalon.mix(!0,d,p),d=p.$construct.call(r,d,{},{})):avalon.mix(!0,d,a),d=avalon.components[t].$construct.call(r,d,u,c),d.$refs={},d.$id=f;var v=d.$slot,h=d.$replace,m=d.$container,g=d.$template;delete d.$slot,delete d.$replace,delete d.$container,delete d.$template,delete d.$construct;var y=avalon.define(d)||{};r.msResolved=1,y.$init(y,r),s.$init(y,r);for(var b,$,x=r.childNodes,w={},C=0;$=x[C++];){var k=1===$.nodeType&&$.getAttribute("slot")||v;k&&(w[k]?w[k].push($):w[k]=[$])}y.$$template&&(avalon.clearHTML(r),r.innerHTML=y.$$template(g));for(C in w)if(y.hasOwnProperty(C)){var N=w[C];if(N.length){for(var A=Qt.cloneNode(!0),T=0;b=N[T++];)A.appendChild(b);y[C]=A}w[C]=null}w=null;var E=r.firstChild;h&&(E=r.firstChild,r.parentNode.replaceChild(E,r),E.msResolved=1,r=n.element=E),m&&m.appendChild(r),avalon.fireDom(r,"datasetchanged",{library:l,vm:y,childReady:1});var O=0,M=avalon.bind(r,"datasetchanged",function(t){if(t.childReady&&t.library===l&&(o+=t.childReady,y!==t.vm&&(y.$refs[t.vm.$id]=t.vm,-1===t.childReady&&(O++,y.$childReady(y,r,t)),t.stopPropagation())),0===o){var a=setTimeout(function(){clearTimeout(a),y.$ready(y,r),s.$ready(y,r)},O?Math.max(17*O,100):17);avalon.unbind(r,"datasetchanged",M),n.rollback=function(){try{y.$dispose(y,r),s.$dispose(y,r)}catch(e){}delete avalon.vmodels[y.$id]},S(n,ba),e.chrome&&r.addEventListener("DOMNodeRemovedFromDocument",function(){setTimeout(H)})}});if(at(r,[y].concat(n.vmodels)),avalon.vmodels[y.$id]=y,r.childNodes.length)var j=setTimeout(function(){clearTimeout(j),avalon.fireDom(r,"datasetchanged",{library:l,vm:y,childReady:-1})},17);else avalon.fireDom(r,"datasetchanged",{library:l,vm:y,childReady:-1})}(a,avalon.components[t],a.element,a.widget))},avalon.fireDom=function(e,t,n){if(Lt.createEvent){var a=Lt.createEvent("Events");a.initEvent(t,!0,!0,n),avalon.mix(a,n),e.dispatchEvent(a)}else Kt.contains(e)&&(a=Lt.createEventObject(),avalon.mix(a,n),e.fireEvent("on"+t,a))},avalon.libraries=[],avalon.library=function(e,t){Lt.namespaces&&Lt.namespaces.add(e,"http://www.w3.org/1999/xhtml"),avalon.libraries[e]=avalon.mix({$init:o,$ready:o,$dispose:o},t||{})},avalon.library("ms");var xa=["autofocus,autoplay,async,allowTransparency,checked,controls","declare,disabled,defer,defaultChecked,defaultSelected","contentEditable,isMap,loop,multiple,noHref,noResize,noShade","open,readOnly,selected"].join(","),wa={};xa.replace(Vt,function(e){wa[e.toLowerCase()]=e});var Ca={"accept-charset":"acceptCharset","char":"ch",charoff:"chOff","class":"className","for":"htmlFor","http-equiv":"httpEquiv"},ka=["accessKey,bgColor,cellPadding,cellSpacing,codeBase,codeType,colSpan","dateTime,defaultValue,frameBorder,longDesc,maxLength,marginWidth,marginHeight","rowSpan,tabIndex,useMap,vSpace,valueType,vAlign"].join(",");ka.replace(Vt,function(e){Ca[e.toLowerCase()]=e});var Na=avalon.directive("attr",{init:function(e){if(e.expr=X(e.expr.trim()),"include"===e.type){var t=e.element;pt(t,e),e.includeRendered=ra(t,"data-include-rendered",e.vmodels),e.includeLoaded=ra(t,"data-include-loaded",e.vmodels);var n=e.includeReplace=!!avalon(t).data("includeReplace");avalon(t).data("includeCache")&&(e.templateCache={}),e.start=Lt.createComment("ms-include"),e.end=Lt.createComment("ms-include-end"),n?(e.element=e.end,e._element=t,t.parentNode.insertBefore(e.end,t),t.parentNode.insertBefore(e.start,e.end)):(t.insertBefore(e.start,t.firstChild),t.appendChild(e.end))}},update:function(t){var n=this.element,a=this.param;if("href"===a||"src"===a){if("string"!=typeof t||Kt.hasAttribute||(t=t.replace(/&/g,"&")),n[a]=t,e.chrome&&"EMBED"===n.tagName){var r=n.parentNode,i=document.createComment("ms-src");r.replaceChild(i,n),r.replaceChild(n,i)}}else{var o=t===!1||null===t||void 0===t;!Jt&&Ca[a]&&(a=Ca[a]);var l=wa[a];if("boolean"==typeof n[l]&&(n[l]=!!t,t||(o=!0)),o)return n.removeAttribute(a);var s=Ut.test(n)?!1:Lt.namespaces&&isVML(n)?!0:a in n.cloneNode(!1);s?n[a]=t+"":n.setAttribute(a,t)}}});"title,alt,src,value,css,include,href".replace(Vt,function(e){ln[e]=Na}),avalon.directive("class",{init:function(e){var t=e.param,a=e.type;if(!t||isFinite(t)?(e.param="",ln.effect.init(e)):(n("ms-"+a+'-xxx="yyy"这种用法已经过时,请使用ms-'+a+'="xxx:yyy"'),e.expr="["+na(t)+","+e.expr+"]",e.oldStyle=t),"hover"===a||"active"===a){if(!e.hasBindEvent){var r=e.element,i=avalon(r),o="mouseenter",l="mouseleave";if("active"===a){r.tabIndex=r.tabIndex||-1,o="mousedown",l="mouseup";var s=i.bind("mouseleave",function(){e.toggleClass&&i.removeClass(e.newClass)})}}var c=i.bind(o,function(){e.toggleClass&&i.addClass(e.newClass)}),u=i.bind(l,function(){e.toggleClass&&i.removeClass(e.newClass)});e.rollback=function(){i.unbind("mouseleave",s),i.unbind(o,c),i.unbind(l,u)},e.hasBindEvent=!0}},update:function(e){var t=this,n=avalon(this.element);t.newClass=e[0],t.toggleClass=!!e[1],t.oldClass&&t.newClass!==t.oldClass&&n.removeClass(t.oldClass),t.oldClass=t.newClass,"class"===t.type&&(t.oldStyle?n.toggleClass(t.oldStyle,!!e[1]):n.toggleClass(t.newClass,t.toggleClass))}}),"hover,active".replace(Vt,function(e){ln[e]=ln["class"]}),avalon.directive("css",{init:ln.attr.init,update:function(e){avalon(this.element).css(this.param,e)}}),avalon.directive("data",{priority:100,update:function(e){var t=this.element,n="data-"+this.param;e&&"object"==typeof e?t[n]=e:t.setAttribute(n,String(e))}});{var Aa=/^(?:checkbox|radio)$/,Ta=/^(?:radio|checked)$/;avalon.directive("duplex",{priority:2e3,init:function(e,t){function a(t){e.changed.call(this,t,e)}function r(){d=!0}function i(){d=!1}var s=e.element,c=e.vmodels;e.changed=ra(s,"data-duplex-changed",c)||o;var u=[],f=l("string,number,boolean,checked");"radio"===s.type&&""===e.param&&(e.param="checked"),e.param.replace(It,function(a){Aa.test(s.type)&&Ta.test(a)&&("radio"===a&&n("ms-duplex-radio已经更名为ms-duplex-checked"),a="checked",e.isChecked=!0,e.xtype="radio"),"bool"===a?(a="boolean",n("ms-duplex-bool已经更名为ms-duplex-boolean")):"text"===a&&(a="string",n("ms-duplex-text已经更名为ms-duplex-string")),f[a]&&(t=!0),avalon.Array.ensure(u,a)}),t||u.push("string"),e.param=u.join("-"),e.changed=ra(s,"binding-duplex-changed",c)||o,e.xtype||(e.xtype="SELECT"===s.tagName?"select":"checkbox"===s.type?"checkbox":"radio"===s.type?"radio":/^change/.test(s.getAttribute("data-duplex-event"))?"change":"input"),e.bound=function(t,n){s.addEventListener(t,n,!1);var a=e.rollback;e.rollback=function(){s.avalonSetter=null,avalon.unbind(s,t,n),a&&a()}};var d=!1,p=function(){var t=s.value;if(!d&&t!==e.oldValue){var n=e.pipe(t,e,"get");e.setter(n),a.call(s,n)}};switch(e.xtype){case"radio":e.bound("click",function(){var t=e.pipe(s.value,e,"get");e.setter(t),a.call(s,t)});break;case"checkbox":e.bound("change",function(){var t=s.checked?"ensure":"remove",r=e.getter.apply(0,e.vmodels);Array.isArray(r)||(n("ms-duplex应用于checkbox上要对应一个数组"),r=[r]);var i=e.pipe(s.value,e,"get");avalon.Array[t](r,i),a.call(s,r)});break;case"change":e.bound("change",p);break;case"input":nn?e.bound("input",p):(e.bound("input",p),e.bound("compositionstart",r),e.bound("compositionend",i),e.bound("DOMAutoComplete",p));break;case"select":e.bound("change",function(){var t=avalon(s).val();t=Array.isArray(t)?t.map(function(t){return e.pipe(t,e,"get")}):e.pipe(t,e,"get"),t+""!==e.oldValue&&(e.setter(t),a.call(s,t))})}"input"===e.xtype&&/^(text|password|hidden)/.test(s.type)&&Ma(function(){if(Kt.contains(s))e.oldValue!==s.value&&p();else if(!s.msRetain)return!1}),s.avalonSetter=p;for(var v in avalon.vmodels){var h=avalon.vmodels[v];h.$fire("avalon-ms-duplex-init",e)}var m=e.pipe||(e.pipe=ut);m(null,e,"init")},update:function(e){var t,n=this.element,a=this;switch(this.xtype){case"input":case"change":t=this.pipe(e,this,"set"),t!==this.oldValue&&(n.value=this.oldValue=t);break;case"radio":t=a.isChecked?!!e:e+""===n.value,n.checked=t;break;case"checkbox":var r=[].concat(e);t=this.pipe(n.value,this,"get"),n.checked=r.indexOf(t)>-1;break;case"select":a._value=e,n.msHasEvent="selectDuplex",avalon.bind(n,"datasetchanged",function(e){if("selectDuplex"===e.bubble){var t=a._value,r=Array.isArray(t)?t.map(String):t+"";avalon(n).val(r),n.oldValue=r+"",a.changed.call(n,r)}})}"select"!==a.xtype&&a.changed.call(n,t)}})}avalon.duplexHooks={checked:{get:function(e,t){return!t.element.oldValue}},string:{get:function(e){return e},set:ct},"boolean":{get:function(e){return"true"===e},set:ct},number:{get:function(e,t){var n=parseFloat(e);if(-e===-n)return n;var a=/strong|medium|weak/.exec(t.element.getAttribute("data-duplex-number"))||["medium"];switch(a[0]){case"strong":return 0;case"medium":return""===e?"":0;case"weak":return e}},set:ct}};var Ea,Oa=[];avalon.tick=function(e){1===Oa.push(e)&&(Ea=setInterval(ft,60))};var Ma=o;!new function(){function e(e){t[this.tagName].call(this,e),"function"==typeof this.avalonSetter&&this.oldValue!==e&&this.avalonSetter()}try{var t={},n=HTMLInputElement.prototype,a=HTMLTextAreaElement.prototype,r=HTMLInputElement.prototype;Object.getOwnPropertyNames(r),t.INPUT=Object.getOwnPropertyDescriptor(n,"value").set,Object.defineProperty(n,"value",{set:e}),t.TEXTAREA=Object.getOwnPropertyDescriptor(a,"value").set,Object.defineProperty(a,"value",{set:e})}catch(i){Ma=avalon.tick}},avalon.directive("effect",{priority:5,init:function(e){var t,n,a=e.expr,r=a.replace(hn,function(e){return e.replace(/./g,"0")}).indexOf(":");-1===r?(t=a,n=!0):(t=a.slice(0,r),n=a.slice(r+1)),t=vn.test(a)?X(t):na(t),e.expr="["+t+","+n+"]"},update:function(t){var n=t[0],a=this.element;if(a.getAttribute("data-effect-name")!==n){a.removeAttribute("data-effect-driver");var r=a.style,i=e.getComputedStyle?e.getComputedStyle(a):null,o=!1;if(i&&(Ha||La)){var l=r[Da]||i[Da];l&&"0s"!==l&&(a.setAttribute("data-effect-driver","t"),o=!0),o||(l=r[Ra]||i[Ra],l&&"0s"!==l&&(a.setAttribute("data-effect-driver","a"),o=!0))}o||avalon.effects[n]&&(a.setAttribute("data-effect-driver","j"),o=!0),o&&a.setAttribute("data-effect-name",n)}}}),avalon.effects={},avalon.effect=function(e,t){avalon.effects[e]=t};var ja,Sa,Ha=!1,La=!1,Da=avalon.cssName("transition-duration"),Ra=avalon.cssName("animation-duration");!new function(){var t,n={TransitionEvent:"transitionend",WebKitTransitionEvent:"webkitTransitionEnd",OTransitionEvent:"oTransitionEnd",otransitionEvent:"otransitionEnd"};for(var a in n){if(e[a]){t=n[a];break}try{{document.createEvent(a)}t=n[a];break}catch(r){}}"string"==typeof t&&(Ha=!0,ja=t),n={AnimationEvent:"animationend",WebKitAnimationEvent:"webkitAnimationEnd"};var i;for(a in n)if(e[a]){i=n[a];break}"string"==typeof i&&(Ha=!0,Sa=i)};var qa=[],Ba=new ma;ht.prototype={contrustor:ht,enterClass:function(){return mt(this,"enter")},leaveClass:function(){return mt(this,"leave")},actionFun:function(e,t,n){if(!document.hidden){var a=this,r=a.el,i="leave"===e;e=i?"leave":"enter";var o=i?"enter":"leave";gt(a,"abort"+vt(o)),gt(a,"before"+vt(e)),i||t(r);var l=function(o){r.removeEventListener(a.cssEvent,a.cssCallback),i?(t(r),avalon(r).removeClass(a.cssClass)):"a"===a.driver&&avalon(r).removeClass(a.cssClass),o!==!0&&(gt(a,"after"+vt(e)),n&&n(r)),a.dispose()};a.useCss?(a.cssCallback&&a.cssCallback(!0),a.cssClass=mt(a,e),a.cssCallback=l,a.update=function(){r.addEventListener(a.cssEvent,a.cssCallback),i||"t"!==a.driver||avalon(r).removeClass(a.cssClass)},avalon(r).addClass(a.cssClass),Ba.render(!0),Ba.queue.push(a)):gt(a,e,l)}},enter:function(){this.actionFun.apply(this,["enter"].concat(avalon.slice(arguments)))},leave:function(){this.actionFun.apply(this,["leave"].concat(avalon.slice(arguments)))},dispose:function(){this.update=this.cssCallback=null,qa.unshift(this)>100&&qa.pop()}};var Pa=function(e,t){var n=Zt.call(arguments,0);"function"!=typeof n[2]&&n.splice(2,0,o),"function"!=typeof n[3]&&n.splice(3,0,o);var a=n[2],r=n[3],i=n[4],l=dt(e,i);if(!l)return a(),r(),!1;var s=t?"enter":"leave";l[s](a,r)};avalon.mix(avalon.effect,{apply:Pa,append:function(e,t,n,a){return Pa(e,1,function(){t.appendChild(e)},n,a)},before:function(e,t,n,a){return Pa(e,1,function(){t.parentNode.insertBefore(e,t)},n,a)},remove:function(e,t,n,a){return Pa(e,0,function(){e.parentNode===t&&t.removeChild(e)},n,a)}}),avalon.directive("html",{update:function(e){var t=this,n=this.element,a=1!==n.nodeType,r=a?n.parentNode:n;if(r){if(e=null==e?"":e,3===n.nodeType){var i=tn("html");r.insertBefore(Lt.createComment(i),n),t.element=Lt.createComment(i+":end"),r.replaceChild(t.element,n),n=t.element}if("object"!=typeof e)var o=avalon.parseHTML(String(e));else if(11===e.nodeType)o=e;else if(1===e.nodeType||e.item){var l=1===e.nodeType?e.childNodes:e.item;for(o=Qt.cloneNode(!0);l[0];)o.appendChild(l[0])}if(l=avalon.slice(o.childNodes),a){for(var s=n.nodeValue.slice(0,-4);;){var c=n.previousSibling;if(!c||8===c.nodeType&&c.nodeValue===s)break;r.removeChild(c)}r.insertBefore(o,n)}else avalon.clearHTML(n).appendChild(o);nt(l,t.vmodels)}}}),avalon.directive("if",{priority:10,update:function(e){function t(){r.getAttribute(a.name)&&(r.removeAttribute(a.name),Q(r,a.vmodels)),a.rollback=null}var n,a=this,r=this.element,i=a.stamp=+new Date,o=function(){i===a.stamp&&(a.recoverNode=null)};a.recoverNode&&a.recoverNode();try{if(!r.parentNode)return;n=r.parentNode}catch(l){return}if(e){if(8===r.nodeType){var s=a.keep,c=avalon.effect.apply(s,1,function(){i===a.stamp&&(r.parentNode.replaceChild(s,r),r=a.element=s,s.getAttribute("_required")&&(r.required=!0,r.removeAttribute("_required")),r.querySelectorAll&&avalon.each(r.querySelectorAll("[_required=true]"),function(e){e.required=!0,e.removeAttribute("_required")}),t())},o);c=c===!1}c||t()}else if(1===r.nodeType){r.required===!0&&(r.required=!1,r.setAttribute("_required","true"));try{avalon.each(r.querySelectorAll(":required"),function(e){r.required=!1,e.setAttribute("_required","true")})}catch(l){}var u=a.element=Lt.createComment("ms-if"),f=r.nextSibling;a.recoverNode=function(){a.recoverNode=null,u.parentNode!==n&&(n.insertBefore(u,f),a.keep=r)},avalon.effect.apply(r,0,function(){a.recoverNode=null,i===a.stamp&&(r.parentNode.replaceChild(u,r),a.keep=r,qt.appendChild(r),a.rollback=function(){r.parentNode===qt&&qt.removeChild(r)})},o)}}});var Fa=function(){return new e.XMLHttpRequest},_a=avalon.templateCache={};avalon.directive("include",{init:ln.attr.init,update:function(e){var t=this,n=this.element,a=t.vmodels,r=t.includeRendered,i=t.effectName&&t.effectClass,o=t.templateCache,l=t.includeReplace,s=t.includeLoaded,c=l?n.parentNode:n,u=t._element;t.recoverNodes=t.recoverNodes||avalon.noop;var f=(l&&u.cloneNode(),function(f){var d=t._stamp=+new Date;if(s){var p=s.apply(c,[f].concat(a));"string"==typeof p&&(f=p)}r&&G(c,function(){r.call(c)},0/0);var v=t.includeLastID||"_default";t.includeLastID=e;var h=o&&o[v]||Lt.createElement(n.tagName||t._element.tagName);i&&(h.className=i,c.insertBefore(h,t.start)),(o||{})[v]=h;var m=t.recoverNodes();for(m&&c.insertBefore(m,t.end);;){var g=t.start.nextSibling;if(!g||g===h||g===t.end)break;h.appendChild(g)}avalon.effect.remove(h,c,function(){o&&d===t._stamp&&qt.appendChild(h)},t);var y=c,b=avalon.noop,$=avalon.noop,x=yt(t,e,f),w=avalon.slice(x.childNodes);l&&i?(y=u,y.innerHTML="",y.setAttribute("ms-skip","true"),c.insertBefore(y,t.end.nextSibling),b=function(){y.insertBefore(x,null)},$=function(){t.recoverNodes=avalon.noop,d===t._stamp&&(x=bt(w),c.insertBefore(x,t.end),nt(w,a)),y.parentNode===c&&c.removeChild(y)},t.recoverNodes=function(){return t.recoverNodes=avalon.noop,bt(w)}):b=function(){c.insertBefore(x,t.end),nt(w,a)},avalon.effect.apply(y,"enter",b,$)});if("src"===t.param)if("string"==typeof _a[e])avalon.nextTick(function(){f(_a[e])});else if(Array.isArray(_a[e]))_a[e].push(f);else{var d=Fa();d.onload=function(){for(var t,n=d.responseText,a=0;t=_a[e][a++];)t(n);_a[e]=n},_a[e]=[f],d.open("GET",e,!0),"withCredentials"in d&&(d.withCredentials=!0),d.setRequestHeader("X-Requested-With","XMLHttpRequest"),d.send(null)}else{var p=e&&1===e.nodeType?e:Lt.getElementById(e);p&&avalon.nextTick(function(){f(p.value||p.innerText||p.innerHTML)})}}});var Va=/\(([^)]*)\)/,Ia=avalon.directive("on",{priority:3e3,init:function(e){var t=e.expr;e.type="on";var n=e.param.replace(/-\d+$/,"");if("function"==typeof Ia[n+"Hook"]&&Ia[n+"Hook"](e),t.indexOf("(")>0&&t.indexOf(")")>-1){var a=(t.match(Va)||["",""])[1].trim();(""===a||"$event"===a)&&(t=t.replace(Va,""))}e.expr=t},update:function(e){var t=this,n=this.element;e=function(e){var n=t.getter||o;return n.apply(this,t.args.concat(e))};var a=t.param.replace(/-\d+$/,"");if("scan"===a)e.call(n,{type:a});else if("function"==typeof t.specialBind)t.specialBind(n,e);else var r=avalon.bind(n,a,e);t.rollback=function(){"function"==typeof t.specialUnbind?t.specialUnbind():avalon.unbind(n,a,r)}}});avalon.directive("repeat",{priority:90,init:function(e){var t=e.type;e.cache={},e.enterCount=0;var n=e.element;if(1===n.nodeType){n.removeAttribute(e.name),pt(n,e),e.param=e.param||"el",e.sortedCallback=ra(n,"data-with-sorted",e.vmodels);var a=ra(n,"data-"+t+"-rendered",e.vmodels),r=tn(t),i=Lt.createComment(r+":start"),o=e.element=Lt.createComment(r+":end");if(e.signature=r,e.start=i,e.template=Qt.cloneNode(!1),"repeat"===t){var l=n.parentNode;l.replaceChild(o,n),l.insertBefore(i,o),e.template.appendChild(n)}else{for(;n.firstChild;)e.template.appendChild(n.firstChild);n.appendChild(i),n.appendChild(o),l=n}if(e.element=o,a)var s=avalon.bind(l,"datasetchanged",function(){a.apply(l,l.args),avalon.unbind(l,"datasetchanged",s),l.msRendered=a})}},update:function(e,t){var n=this,a=this.xtype;this.enterCount+=1;var r=!t;if(r){n.$outer={};var i="$key",o="$val";"array"===a&&(i="$first",o="$last");for(var l,s=0;l=n.vmodels[s++];)if(l.hasOwnProperty(i)&&l.hasOwnProperty(o)){n.$outer=l;break}}var c=this.track;if(n.sortedCallback){var u=n.sortedCallback.call($,c);u&&Array.isArray(u)&&(c=u)}var d="move";n.$repeat=e;var p=[],v=r&&Qt.cloneNode(!1),h=[],m=this.param,g=avalon.mix({},this.cache),y=this.element,b=c.length,$=y.parentNode;for(s=0;b>s;s++){var x=c[s],w=g[x];if(w)p.push({}),g[x]=!0;else{w=kt(this),"array"===a?(d="add",w.$id=x,w[m]=e[s]):(d="append",w.$key=x,w.$val=e[x]),this.cache[x]=w;var C=w.$anchor||(w.$anchor=y.cloneNode(!1));C.nodeValue=this.signature,Ct(n,v,w,p,r&&!n.effectDriver),Tt(w,n,a)}1===this.enterCount&&(w.$active=!1,w.$oldIndex=w.$index,w.$active=!0,w.$index=s),"array"===a?(w.$first=0===s,w.$last=s===b-1):w.$val=N(e[x]),h.push(w)}if(this.proxies=h,r&&!n.effectDriver)$.insertBefore(v,y),p.forEach(function(e){nt(e.nodes||[],e.vmodels),e.nodes=e.vmodels=null});else{var k=n.staggerIndex=0;for(x in g)g[x]!==!0&&(d="del",wt(g[x].$anchor,n),Mt(this.cache,x,m),g[x]=null);for(s=0;b>s;s++){w=h[s],x="array"===a?w.$id:w.$key;var A=h[s-1],T=A?A.$anchor:n.start;g[x]?w.$index!==w.$oldIndex&&!function(e,t){k=xt(n.effectEnterStagger,function(){var a=wt(e.$anchor),r=avalon.slice(a.childNodes);$.insertBefore(a,t.nextSibling),$t(r,1,n)},k)}(w,T):!function(e,t){var a=e.nodes,r=e.vmodels;a&&(k=xt(n.effectEnterStagger,function(){$.insertBefore(e.content,t.nextSibling),nt(a,r),$t(a,1,n)},k)),e.nodes=e.vmodels=null}(p[s],T)}}if(!e.$track)for(x in this.cache)Mt(this.cache,x,m);!function(e){$.args=e,$.msRendered&&$.msRendered.apply($,e)}(f.newWatch?arguments:[d]);var E=setTimeout(function(){clearTimeout(E),avalon.fireDom($,"datasetchanged",{bubble:$.msHasEvent})});this.enterCount-=1}}),"with,each".replace(Vt,function(e){ln[e]=avalon.mix({},ln.repeat,{priority:1400})});var Ua=[],za=[];avalon.directive("text",{update:function(e){var t=this.element;if(e=null==e?"":e,3===t.nodeType)try{t.data=e}catch(n){}else t.textContent=e}}),avalon.parseDisplay=jt,avalon.directive("visible",{init:function(){},update:function(e){var t=this.element,n=this,a=n.stamp=+new Date;e?(t.style.display="none",avalon.effect.apply(t,1,function(){if(a===n.stamp){var e=t.getAttribute("data-effect-driver")||"a";/^[atn]/.test(e)&&(this.effectName||(t.style.display=""),"none"===avalon(t).css("display")&&(t.style.display=jt(t.nodeName)))}})):avalon.effect.apply(t,0,function(){a===n.stamp&&(t.style.display="none")})}});var Wa=/]*>([\S\s]*?)<\/script\s*>/gim,Xa=/\s+(on[^=\s]+)(?:=("[^"]*"|'[^']*'|[^\s>]+))?/g,Ya=/<\w+\b(?:(["'])[^"]*?(\1)|[^>])*>/gi,Ga={a:/\b(href)\=("javascript[^"]*"|'javascript[^']*')/gi,img:/\b(src)\=("javascript[^"]*"|'javascript[^']*')/gi,form:/\b(action)\=("javascript[^"]*"|'javascript[^']*')/gi},Za=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Ja=/([^\#-~| |!])/g,Ka=avalon.filters={uppercase:function(e){return e.toUpperCase()},lowercase:function(e){return e.toLowerCase()},truncate:function(e,t,n){return t=t||30,n="string"==typeof n?n:"...",e.length>t?e.slice(0,t-n.length)+n:String(e)},$filter:function(e){for(var t=1,n=arguments.length;n>t;t++){var a=arguments[t],r=avalon.filters[a[0]];if("function"==typeof r){var i=[e].concat(a.slice(1));e=r.apply(null,i)}}return e},camelize:q,sanitize:function(e){return e.replace(Wa,"").replace(Ya,function(e){var t=e.toLowerCase().match(/<(\w+)\s/);if(t){var n=Ga[t[1]];n&&(e=e.replace(n,function(e,t,n){var a=n.charAt(0);return t+"="+a+"javascript:void(0)"+a}))}return e.replace(Xa," ").replace(/\s+/g," ")})},escape:function(e){return String(e).replace(/&/g,"&").replace(Za,function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1);return"&#"+(1024*(t-55296)+(n-56320)+65536)+";"}).replace(Ja,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")},currency:function(e,t,n){return(t||"¥")+St(e,isFinite(n)?n:2)},number:St};!new function(){function e(e){return parseInt(e,10)||0}function t(e,t,n){var a="";for(0>e&&(a="-",e=-e),e=""+e;e.length0||o>-a)&&(o+=a),0===o&&-12===a&&(o=12),t(o,n,r)}}function a(e,t){return function(n,a){var r=n["get"+e](),i=(t?"SHORT"+e:e).toUpperCase();return a[i][r]}}function r(e){var n=-1*e.getTimezoneOffset(),a=n>=0?"+":"";return a+=t(Math[n>0?"floor":"ceil"](n/60),2)+t(Math.abs(n%60),2)}function i(e,t){return e.getHours()<12?t.AMPMS[0]:t.AMPMS[1]}var o={yyyy:n("FullYear",4),yy:n("FullYear",2,0,!0),y:n("FullYear",1),MMMM:a("Month"),MMM:a("Month",!0),MM:n("Month",2,1),M:n("Month",1,1),dd:n("Date",2),d:n("Date",1),HH:n("Hours",2),H:n("Hours",1),hh:n("Hours",2,-12),h:n("Hours",1,-12),mm:n("Minutes",2),m:n("Minutes",1),ss:n("Seconds",2),s:n("Seconds",1),sss:n("Milliseconds",3),EEEE:a("Day"),EEE:a("Day",!0),a:i,Z:r},l=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,s=/^\/Date\((\d+)\)\/$/;Ka.date=function(t,n){var a,r,i=Ka.date.locate,c="",u=[];if(n=n||"mediumDate",n=i[n]||n,"string"==typeof t)if(/^\d+$/.test(t))t=e(t);else if(s.test(t))t=+RegExp.$1;else{var f=t.trim(),d=[0,0,0,0,0,0,0],p=new Date(0);f=f.replace(/^(\d+)\D(\d+)\D(\d+)/,function(t,n,a,r){var i=4===r.length?[r,n,a]:[n,a,r];return d[0]=e(i[0]),d[1]=e(i[1])-1,d[2]=e(i[2]),""});var v=p.setFullYear,h=p.setHours;f=f.replace(/[T\s](\d+):(\d+):?(\d+)?\.?(\d)?/,function(t,n,a,r,i){return d[3]=e(n),d[4]=e(a),d[5]=e(r),i&&(d[6]=Math.round(1e3*parseFloat("0."+i))),""});var m=0,g=0;f=f.replace(/Z|([+-])(\d\d):?(\d\d)/,function(t,n,a,r){return v=p.setUTCFullYear,h=p.setUTCHours,n&&(m=e(n+a),g=e(n+r)),""}),d[3]-=m,d[4]-=g,v.apply(p,d.slice(0,3)),h.apply(p,d.slice(3)),t=p}if("number"==typeof t&&(t=new Date(t)),"date"===avalon.type(t)){for(;n;)r=l.exec(n),r?(u=u.concat(r.slice(1)),n=u.pop()):(u.push(n),n=null);return u.forEach(function(e){a=o[e],c+=a?a(t,i):e.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),c}};var c={AMPMS:{0:"上午",1:"下午"},DAY:{0:"星期日",1:"星期一",2:"星期二",3:"星期三",4:"星期四",5:"星期五",6:"星期六"},MONTH:{0:"1月",1:"2月",2:"3月",3:"4月",4:"5月",5:"6月",6:"7月",7:"8月",8:"9月",9:"10月",10:"11月",11:"12月"},SHORTDAY:{0:"周日",1:"周一",2:"周二",3:"周三",4:"周四",5:"周五",6:"周六"},fullDate:"y年M月d日EEEE",longDate:"y年M月d日",medium:"yyyy-M-d H:mm:ss",mediumDate:"yyyy-M-d",mediumTime:"H:mm:ss","short":"yy-M-d ah:mm",shortDate:"yy-M-d",shortTime:"ah:mm"};c.SHORTMONTH=c.MONTH,Ka.date.locate=c};var Qa=avalon.modules={"domReady!":{exports:avalon,state:3},avalon:{exports:avalon,state:4}};Qa.exports=Qa.avalon,new function(){function t(e,t){var a="js";e=e.replace(/^(\w+)\!/,function(e,t){return a=t,""}),"ready"===a&&(n("debug: ready!已经被废弃,请使用domReady!"),a="domReady");var r="";e=e.replace(D,function(e){return r=e,""});var i="."+a,o=/js|css/.test(i)?i:"";e=e.replace(/\.[a-z0-9]+$/g,function(e){return e===i?(o=e,""):e});var l=avalon.mix({query:r,ext:o,res:a,name:e,toUrl:m},t);return l.toUrl(e),l}function i(e){var t=e.name,n=e.res,a=Qa[t],r=t&&e.urlNoQuery;if(a&&a.state>=1)return t;if(a=Qa[r],a&&a.state>=3)return Rt(a.deps||[],a.factory,r),r;if(t&&!a){a=Qa[r]={id:r,state:1};var i=function(r){L[n]=r,r.load(t,e,function(e){arguments.length&&void 0!==e&&(a.exports=e),a.state=4,c()})};L[n]?i(L[n]):Rt([n],i)}return t?r:n+"!"}function l(e,t){for(var n,a=0;n=e[a++];)if(4!==Qa[n].state&&(n===t||l(Qa[n].deps,t)))return!0}function s(e,t){var a=d(e.src);return e.onload=e.onerror=null,t?(setTimeout(function(){Dt.removeChild(e),e=null}),void n("debug: 加载 "+a+" 失败"+t+" "+!Qa[a].state)):!0}function c(){e:for(var e,t=N.length;e=N[--t];){var n=Qa[e],a=n.deps;if(a){for(var r,i=0;r=a[i];i++)if(4!==Object(Qa[r]).state)continue e;4!==n.state&&(N.splice(t,1),h(n.id,n.deps,n.factory),c())}}}function u(e,t,a){var r=Lt.createElement("script");r.className=Bt,r.onload=function(){var r=A.pop();r&&r.require(t),a&&a(),n("debug: 已成功加载 "+e),t&&N.push(t),c()},r.onerror=function(){s(r,!0)},Dt.insertBefore(r,Dt.firstChild),r.src=e,n("debug: 正准备加载 "+e)}function d(e){return(e||"").replace(D,"")}function p(e){return/^(?:[a-z]+:)?\/\//i.test(String(e))}function v(){var e;try{a.b.c()}catch(t){e=t.stack}if(e)return e=e.split(/[@ ]/g).pop(),e="("===e[0]?e.slice(1,-1):e.replace(/\s/,""),d(e.replace(/(:\d+)?:\d+$/i,""));for(var n,r=Dt.getElementsByTagName("script"),i=r.length;n=r[--i];)if(n.className===Bt&&"interactive"===n.readyState){var o=n.src;return n.className=d(o)}}function h(t,a,i){var o=Object(Qa[t]);o.state=4;for(var l,s=0,c=[];l=a[s++];)if("exports"===l){var u=o.exports||(o.exports=r());c.push(u)}else c.push(Qa[l].exports);try{var f=i.apply(e,c)}catch(d){n("执行["+t+"]模块的factory抛错: ",d)}return void 0!==f&&(o.exports=f),R.test(t)&&delete Qa[t],delete o.factory,f}function m(e){0===e.indexOf(this.res+"!")&&(e=e.slice(this.res.length+1));var t=e,n=0,a=this.baseUrl,r=this.parentUrl||a; -x(e,f.paths,function(e,a){t=t.replace(a,e),n=1}),n||x(e,f.packages,function(e,n,a){t=t.replace(a.name,a.location)}),this.mapUrl&&x(this.mapUrl,f.map,function(e){x(t,e,function(e,n){t=t.replace(n,e),r=a})});var i=this.ext;i&&n&&t.slice(-i.length)===i&&(t=t.slice(0,-i.length)),p(t)||(r=this.built||/^\w/.test(t)?a:r,t=C(r,t));var o=t+i;return t=o+this.query,o=t.replace(D,function(e){return this.query=e,""}),x(e,f.urlArgs,function(e){t+=(-1===t.indexOf("?")?"?":"&")+e}),this.url=t,this.urlNoQuery=o}function g(e,t,n){var a=$(e,t,n);return a.sort(w),a}function y(e){return new RegExp("^"+e+"(/|$)")}function b(t){return function(){var n;return t.init&&(n=t.init.apply(e,arguments)),n||t.exports&&k(t.exports)}}function $(e,t,n){var a=[];for(var r in e){var i={name:r,val:e[r]};a.push(i),i.reg="*"===r&&t?/^/:y(r),n&&"*"!==r&&(i.reg=new RegExp("/"+r.replace(/^\//,"")+"(/|$)"))}return a}function x(e,t,n){t=t||[];for(var a,r=0;a=t[r++];)if(a.reg.test(e))return n(a.val,a.name,a),!1}function w(e,t){var n=e.name,a=t.name;return"*"===a?-1:"*"===n?1:a.length-n.length}function C(e,t){if("/"!==e.charAt(e.length-1)&&(e+="/"),"./"===t.slice(0,2))return e+t.slice(2);if(".."===t.slice(0,2)){for(e+=t;q.test(e);)e=e.replace(q,"");return e}return"/"===t.slice(0,1)?e+t.slice(1):e+t}function k(t){if(!t)return t;var n=e;return t.split(".").forEach(function(e){n=n[e]}),n}var N=[],A=[],T=/\.js$/i,E=[],O=!1;Rt=avalon.require=function(e,n,a,l){if(O){Array.isArray(e)||avalon.error("require方法的第一个参数应为数组 "+e);var s=[],u=r(),d=a||"callback"+setTimeout("1");l=l||r(),l.baseUrl=f.baseUrl;var p=!!l.built;if(a&&(l.parentUrl=a.substr(0,a.lastIndexOf("/")),l.mapUrl=a.replace(T,"")),p){var v=t(l.defineName,l);d=v.urlNoQuery}else e.forEach(function(e){var n=t(e,l),a=i(n);a&&(u[a]||(s.push(a),u[a]="司徒正美"))});var h=Qa[d];h&&4===h.state||(Qa[d]={id:d,deps:p?e.concat():s,factory:n||o,state:3}),h||N.push(d),c()}else if(E.push(avalon.slice(arguments)),arguments.length<=2){O=!0;for(var m,g=E.splice(0,E.length);m=g.shift();)Rt.apply(null,m)}},Rt.define=function(e,t,n){"string"!=typeof e&&(n=t,t=e,e="anonymous"),Array.isArray(t)||(n=t,t=[]);var a={built:!O,defineName:e},r=[t,n,a];n.require=function(e){if(r.splice(2,0,e),Qa[e]){Qa[e].state=3;var t=!1;try{t=l(Qa[e].deps,e)}catch(a){}t&&avalon.error(e+"模块与之前的模块存在循环依赖,请不要直接用script标签引入"+e+"模块")}delete n.require,Rt.apply(null,r)};var i=a.built?"unknown":v();if(i){var o=Qa[i];o&&(o.state=2),n.require(i)}else A.push(n)},Rt.config=f,Rt.define.amd=Qa;var M=f["orig.paths"]=r(),j=f["orig.map"]=r(),S=f.packages=[],H=f["orig.args"]=r();avalon.mix(yn,{paths:function(e){avalon.mix(M,e),f.paths=g(M)},map:function(e){avalon.mix(j,e);var t=g(j,1,1);avalon.each(t,function(e,t){t.val=g(t.val)}),f.map=t},packages:function(e){e=e.concat(S);for(var t,n=r(),a=[],i=0;t=e[i++];){t="string"==typeof t?{name:t}:t;var o=t.name;if(!n[o]){var l=C(t.location||o,t.main||"main");l=l.replace(T,""),a.push(t),n[o]=t.location=l,t.reg=y(o)}}f.packages=a.sort()},urlArgs:function(e){"string"==typeof e&&(e={"*":e}),avalon.mix(H,e),f.urlArgs=g(H,1)},baseUrl:function(e){if(!p(e)){var t=Dt.getElementsByTagName("base")[0];t&&Dt.removeChild(t);var n=Lt.createElement("a");n.href=e,e=n.href,t&&Dt.insertBefore(t,Dt.firstChild)}e.length>3&&(f.baseUrl=e)},shim:function(e){for(var t in e){var n=e[t];Array.isArray(n)&&(n=e[t]={deps:n}),n.exportsFn||!n.exports&&!n.init||(n.exportsFn=b(n))}f.shim=e}});var L=Rt.plugins={domReady:{load:o},js:{load:function(e,t,n){var a=t.url,r=t.urlNoQuery,i=f.shim[e.replace(T,"")];i?Rt(i.deps||[],function(){var e=avalon.slice(arguments);u(a,r,function(){n(i.exportsFn?i.exportsFn.apply(0,e):void 0)})}):u(a,r)}},css:{load:function(e,t,a){var r=t.url;Dt.insertAdjacentHTML("afterBegin",''),n("debug: 已成功加载 "+r),a()}},text:{load:function(e,t,a){var r=t.url,i=Fa();i.onload=function(){var e=i.status;e>399&&600>e?avalon.error(r+" 对应资源不存在或没有开启 CORS"):(n("debug: 已成功加载 "+r),a(i.responseText))};var o="_="+(new Date-0),l=-1===r.indexOf("?")?r+"?"+o:r+"&"+o;i.open("GET",l,!0),"withCredentials"in i&&(i.withCredentials=!0),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.send(),n("debug: 正准备加载 "+r)}}};Rt.checkDeps=c;var D=/(\?[^#]*)$/,R=/^callback\d+$/,q=/\/\w+\/\.\./,B=Lt.scripts[Lt.scripts.length-1],P=B.getAttribute("data-main");if(P){yn.baseUrl(P);var F=f.baseUrl;f.baseUrl=F.slice(0,F.lastIndexOf("/")+1),u(F.replace(T,"")+".js")}else{var _=d(B.src);f.baseUrl=_.slice(0,_.lastIndexOf("/")+1)}};var er,tr=[],nr=function(e){for(er=!0,Rt&&(Qa["domReady!"].state=4,Rt.checkDeps());e=tr.shift();)e(avalon)};"complete"===Lt.readyState?setTimeout(nr):Lt.addEventListener("DOMContentLoaded",nr),e.addEventListener("load",nr),avalon.ready=function(e){er?e(avalon):tr.push(e)},avalon.config({loader:!0}),avalon.ready(function(){avalon.scan(Lt.body)}),"function"==typeof define&&define.amd&&define("avalon",[],function(){return avalon});var ar=e.avalon;return avalon.noConflict=function(t){return t&&e.avalon===avalon&&(e.avalon=ar),avalon},void 0===t&&(e.avalon=avalon),avalon}); \ No newline at end of file +!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("Avalon requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(){avalon.config.debug&&console.log.apply(console,arguments)}function r(){return Object.create(null)}function i(e){return Function.apply(o,e)}function o(){}function l(e,t){"string"==typeof e&&(e=e.match(Vt)||[]);for(var n={},a=void 0!==t?t:1,r=0,i=e.length;i>r;r++)n[e[r]]=a;return n}function s(){if(e.VBArray){var t=document.documentMode;return t?t:e.XMLHttpRequest?7:6}return 0/0}function c(e){if(e&&"object"==typeof e){var t=e.length,n=Yt.call(e);if(/(Array|List|Collection|Map|Arguments)\]$/.test(n))return!0;if("[object Object]"===n&&t===t>>>0)return!0}return!1}function u(e,t){if(e&&e.childNodes)for(var n,a=e.childNodes,r=0;n=a[r++];)if(n.tagName){var i=Lt.createElementNS(cn,n.tagName.toLowerCase());Gt.forEach.call(n.attributes,function(e){i.setAttribute(e.name,e.value)}),u(n,i),t.appendChild(i)}}function f(e){for(var t in e)if(Xt.call(e,t)){var n=e[t];"function"==typeof f.plugins[t]?f.plugins[t](n):"object"==typeof f[t]?avalon.mix(f[t],n):f[t]=n}return this}function d(e){return(e+"").replace(gn,"\\$&")}function p(e,t){var n=this.$events||(this.$events={}),a=n[e]||(n[e]=[]);if("function"==typeof t){var r=t;r.uniqueNumber=Math.random(),t={element:Kt,type:"user-watcher",handler:o,vmodels:[this],expr:e,uniqueNumber:r.uniqueNumber},t.wildcard=/\*/.test(e)}if(t.update)t.oneTime||avalon.Array.ensure(a,t);else{if(/\w\.*\B/.test(e)){t.getter=o;var i=this;t.update=function(){var e=this.fireArgs||[];e[2]&&t.handler.apply(i,e),delete this.fireArgs},a.sync=!0,avalon.Array.ensure(a,t)}else avalon.injectBinding(t);r&&(t.handler=r)}return function(){t.update=t.getter=t.handler=o,t.element=Lt.createElement("a")}}function v(e,t){var n=this.$events;if(n&&n[e]){t&&(t[2]=e),m(n[e],t);var a=this.$up;a&&(this.$pathname&&v.call(a,this.$pathname+"."+e,t),v.call(a,"*."+e,t))}else if(a=this.$up){var r=this.$pathname+"."+e,i=r.split(".");-1===i.indexOf("*")?(v.call(a,r,t),i[1]="*",v.call(a,i.join("."),t)):v.call(a,r,t)}}function h(e,t){for(;;){if(e.$watch){var n=e.$events||(e.$events={}),a=n[t]||(n[t]=[]);return void An.collectDependency(a)}if(e=e.$up,!e)break;t=e.$pathname+"."+t}}function m(e,t){if(e){new Date-On>444&&"object"==typeof e[0]&&H();for(var n,a=[],r=[],i=0;n=e[i++];)"user-watcher"===n.type?a.push(n):r.push(n);if(f.async){for(ga.render(),i=0;n=r[i++];)if(n.update){var o=j(n);ga.queue[o]||(ga.queue[o]=1,ga.queue.push(n))}}else for(i=0;n=r[i++];)n.update&&n.update();for(i=0;n=a[i++];)(t&&t[2]===n.expr||n.wildcard)&&(n.fireArgs=t),n.update()}}function g(e,t){return t=t||{},t.watch=!0,b(e,t)}function y(){}function b(e,t){function a(e){return u[e]===!0}if(!e||e.$id&&e.$accessors)return e;t=t||_t;var r=t.force||_t,i=t.old,o=i&&i.$accessors||_t,s=new y,c={},u={},f=[],d=[],h={};e.$skipArray&&(h=l(e.$skipArray),delete e.$skipArray);var m=e.$computed;if(m){delete e.$computed;for(var g in m)u[g]=!0,function(e,t){var n;c[e]={get:function(){return n=t.get.call(this)},set:function(a){if("function"==typeof t.set){var r=n;t.set.call(this,a);var i=this[e];this.$fire&&i!==r&&this.$fire(e,i,r)}},enumerable:!0,configurable:!0}}(g,m[g])}for(g in e){var b=e[g];$n[g]||(u[g]=!0),"function"==typeof b||b&&b.nodeType||!r[g]&&("$"===g.charAt(0)||$n[g]||h[g])?f.push(g):$(b)?(n("warning:计算属性建议放在$computed对象中统一定义"),function(e,t){var n;c[e]={get:function(){return n=t.get.call(this)},set:function(a){if("function"==typeof t.set){var r=n;t.set.call(this,a);var i=this[e];this.$fire&&i!==r&&this.$fire(e,i,r)}},enumerable:!0,configurable:!0}}(g,b)):(d.push(g),c[g]=o[g]?o[g]:x(g,b))}c.$model=xn,s=Object.defineProperties(s,c,e),f.forEach(function(t){s[t]=e[t]}),k(s,"$id","anonymous"),k(s,"$up",i?i.$up:null),k(s,"$track",Object.keys(u)),k(s,"$active",!1),k(s,"$pathname",i?i.$pathname:""),k(s,"$accessors",c),k(s,"hasOwnProperty",a),t.watch&&(k(s,"$watch",function(){return p.apply(s,arguments)}),k(s,"$fire",function(e,t){if(0===e.indexOf("all!")){var n=e.slice(4);for(var a in avalon.vmodels){var r=avalon.vmodels[a];r.$fire&&r.$fire.apply(r,[n,t])}}else v.call(s,e,[t])})),d.forEach(function(t){var n=s[t]=e[t];n&&"object"==typeof n&&(n.$up=s,n.$pathname=t),v.call(s,t)});for(g in m)b=s[g];return s.$active=!0,s}function $(e){if(e&&"object"==typeof e){for(var t in e)if("get"!==t&&"set"!==t)return!1;return"function"==typeof e.get}}function x(e,t){var n,t=0/0;return{get:function(){return this.$active&&h(this,e),t},set:function(a){if(t!==a){var r=t;n=w(a,t),n?t=n:(n=void 0,t=a),Object(n)===n&&(n.$pathname=e,n.$up=this),this.$active&&v.call(this,e,[t,r])}},enumerable:!0,configurable:!0}}function w(e,t,n,a){if(Array.isArray(e))return C(e,t,a);if(avalon.isPlainObject(e)){if(t){var r=Object.keys(e),i=Object.keys(t);if(r.join(";")===i.join(";")){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);return t}t.$active=!1}return b(e,{old:t,watch:a})}return n?e:void 0}function C(e,t,n){if(t){var a=[0,t.length].concat(e);return t.splice.apply(t,a),t}for(var r in kn)e[r]=kn[r];k(e,"$up",null),k(e,"$pathname",""),k(e,"$track",T(e.length)),e._=b({length:0/0},{watch:!0}),e._.length=e.length,e._.$watch("length",function(t,n){v.call(e.$up,e.$pathname+".length",[t,n])}),n&&k(e,"$watch",function(){return p.apply(e,arguments)}),Object.defineProperty(e,"$model",xn);for(var i=0,o=e.length;o>i;i++){var l=e[i]=w(e[i],0,1,1);Object(l)===l&&(l.$up=e)}return e}function k(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!1,configurable:!0})}function N(e){var t=avalon.type(e);if("array"===t){for(var n=[],a=0;aa;a++){n[a]=e[a];var i=t[a];i in n?(e[a]=n[i],delete n[i]):e[a]=e[i]}}function T(e){for(var t=[],n=0;e>n;n++)t[n]=tn("$proxy$each");return t}function E(e,t,n){switch(t){case"push":case"unshift":n=T(n.length);break;case"splice":if(n.length>2){{n[1],n.length-2}n=[n[0],n[1]].concat(T(n.length-2))}}Array.prototype[t].apply(e,n)}function O(e,t){t.oneTime||e&&avalon.Array.ensure(e,t)&&t.element&&(S(t,e),new Date-On>444&&H())}function M(e,t){for(var n,a=[],r=0;n=e[r++];)a.push(t?n.$id:n.$key);return a.join(";")}function j(e){if(!e.uniqueNumber){var t=e.element;e.uniqueNumber=t?1!==t.nodeType?e.type+(e.pos||0)+"-"+j(t.parentNode):e.name+"-"+j(t):++Tn}return e.uniqueNumber}function S(e,t){var n=e.lists||(e.lists=[]),a=j(e);avalon.Array.ensure(n,t),t.$uuid=t.$uuid||tn(),En[a]||(En[a]=1,En.push(e))}function H(e){for(var t=En.length,n=t,a=[],r={},i={};e=En[--t];){var o=e.type;i[o]?i[o]++:(i[o]=1,a.push(o))}var l=!1;if(a.forEach(function(e){Mn[e]!==i[e]&&(r[e]=1,l=!0)}),t=n,l)for(;e=En[--t];)if(null!==e.element){if(r[e.type]&&D(e.element)){En.splice(t,1),delete En[e.uniqueNumber];for(var s,c=e.lists,u=0;s=c[u++];)avalon.Array.remove(c,s),avalon.Array.remove(s,e);L(e)}}else En.splice(t,1);Mn=i,On=new Date}function L(e){delete En[e.uniqueNumber],e.element=null,e.rollback&&e.rollback();for(var t in e)e[t]=null}function D(e){try{{e.parentNode.nodeType}}catch(t){return!0}return e.ifRemove&&!Kt.contains(e.ifRemove)&&qt===e.parentNode?(e.parentNode&&e.parentNode.removeChild(e),!0):e.msRetain?0:1===e.nodeType?!Kt.contains(e):!avalon.contains(Kt,e)}function R(e){return e.replace(/([a-z\d])([A-Z]+)/g,"$1-$2").toLowerCase()}function q(e){return e.indexOf("-")<0&&e.indexOf("_")<0?e:e.replace(/[-_][^-_]/g,function(e){return e.charAt(1).toUpperCase()})}function B(e){try{if("object"==typeof e)return e;e="true"===e?!0:"false"===e?!1:"null"===e?null:+e+""===e?+e:qn.test(e)?JSON.parse(e):e}catch(t){}return e}function P(e){return e.window&&e.document?e:9===e.nodeType?e.defaultView:!1}function F(e,t){if(e.offsetWidth<=0){var n=getComputedStyle(e,null);if(Vn.test(n.display)){var a={node:e};for(var r in _n)a[r]=n[r],e.style[r]=_n[r];t.push(a)}var i=e.parentNode;i&&1===i.nodeType&&F(i,t)}}function _(e){var t=e.tagName.toLowerCase();return"input"===t&&/checkbox|radio/.test(e.type)?"checked":t}function V(e,t){var n=[],a=!!t;t=t||0;for(var r="unknown",o="",l=0;lu;u++)if(r.length){var d="vm"+o+"_"+u;s.push(d),c.push(t[u]),l.push.apply(l,U(r,t[u],d,n))}n.args=c;var p=n.type,v=t.map(function(e){return String(e.$id).replace(Yn,"$1")})+e+p,h=Zn.get(v);if(h){if("duplex"===p){var m=Zn.get(v+"setter");n.setter=m.apply(m,n.args)}return n.getter=h}if(l.length||l.push("fix"+o),"duplex"===p){var g={};l.forEach(function(e){var t=e.split("=");g[t[0].trim()]=t[1].trim()}),e=e.replace(/[\$\w]+/,function(e){return g[e]?g[e]:e});var y=i(s.concat("'use strict';return function(vvv){"+e+" = vvv\n}\n"));Zn.put(v+"setter",y),n.setter=y.apply(y,n.args)}if("on"===p){-1===e.indexOf("(")?e+=".call(this, $event)":e=e.replace("(",".call(this,"),s.push("$event"),e="\nreturn "+e+";";var b=e.lastIndexOf("\nreturn"),$=e.slice(0,b),x=e.slice(b);e=$+"\n"+x}else e="\nreturn "+e+";";return h=i(s.concat("'use strict';\nvar "+l.join(",\n")+e)),Zn.put(v,h)}function X(e){var t=vn.test(e);if(t){var n=it(e);return 1===n.length?n[0].expr:n.map(function(e){return e.type?"("+e.expr+")":na(e.expr)}).join(" + ")}return e}function Y(e){return e=e.replace(Jn,"").replace(Kn,function(){return"],|"}).replace(Qn,function(e,t){return"["+na(t)}).replace(ea,function(){return'"],["'}).replace(ta,function(){return'",'})+"]",i(["return ["+e+"]"])()}function G(e,t,n){var a=setTimeout(function(){var r=e.innerHTML;clearTimeout(a),r===n?t():G(e,t,r)})}function Z(e,t){var n=e.getAttribute("avalonctrl")||t.$id;e.setAttribute("avalonctrl",n),t.$events&&(t.$events.expr=e.tagName+'[avalonctrl="'+n+'"]')}function J(e,t){for(var n,a=0;n=e[a++];)n.vmodels=t,ln[n.type].init(n),avalon.injectBinding(n),n.getter&&1===n.element.nodeType&&n.element.removeAttribute(n.name);e.length=0}function K(e,t){return e.priority-t.priority}function Q(e,t,a){var r=!0;if(t.length){for(var i,o=e.attributes,l=[],s={},c=0;i=o[c++];){var u=i.name;if(!s[u]&&(s[u]=1,i.specified&&(a=u.match(la)))){var f=a[1],d=a[2]||"",p=i.value;if(sa[f]?(d=f,f="on"):ca[f]&&(d=f,f="attr",u="ms-"+f+"-"+d,n("warning!请改用"+u+"代替"+i.name+"!")),ln[f]){var v=p.replace(oa,""),h=p!==v,m={type:f,param:d,element:e,name:u,expr:v,oneTime:h,priority:(ln[f].priority||10*f.charCodeAt(0))+(Number(d.replace(/\D/g,""))||0)};if("html"===f||"text"===f){var g=rt(p).filters;m.expr=m.expr.replace(g,""),m.filters=g.replace(pa,function(){return m.type="html",m.group=1,""}).trim()}else if("duplex"===f)var y=u;else if("ms-if-loop"===u)m.priority+=100;else if("ms-attr-value"===u)var b=u;l.push(m)}}}if(l.length){for(l.sort(K),y&&b&&"text"===e.type&&n("warning!一个控件不能同时定义ms-attr-value与"+y),c=0;m=l[c];c++){if(f=m.type,ua.test(f))return J(l.slice(0,c+1),t);r&&(r=!fa.test(f))}J(l,t)}}r&&!aa[e.tagName]&&(ia&&ia(e),tt(e,t))}function et(e){for(var t,n=e.attributes,a={},r=0;t=n[r++];)t.specified&&!da.test(t.name)&&(a[q(t.name)]=B(t.value));return a}function tt(e,t){var n=avalon.slice(e.childNodes);nt(n,t)}function nt(e,t){for(var n,a=0;n=e[a++];)switch(n.nodeType){case 1:var r=n;if(at(n,t),!r.msResolved&&r.parentNode&&1===r.parentNode.nodeType){var i=st(r);if(i){var o=r.localName?r.localName.replace(i+":",""):r.nodeName,l=i+":"+q(o);ya.push({library:i,element:r,fullName:l,widget:o,vmodels:t,name:"widget"}),avalon.components[l]&&avalon.component(l)}}n.msHasEvent&&avalon.fireDom(n,"datasetchanged",{bubble:n.msHasEvent});break;case 3:vn.test(n.nodeValue)&&ot(n,t,a)}}function at(e,t,n){var a=e.getAttribute("ms-skip"),r=e.getAttributeNode("ms-important"),i=e.getAttributeNode("ms-controller");if("string"!=typeof a){if(n=r||i){var o=avalon.vmodels[n.value];if(!o)return;t=n===r?[o]:[o].concat(t),e.removeAttribute(n.name),e.classList.remove(n.name),Z(e,o)}Q(e,t)}}function rt(e){if(e.indexOf("|")>0){var t=e.replace(ha,function(e){return Array(e.length+1).join("1")}),n=t.replace(va,"ᄢ㍄").indexOf("|");if(n>-1)return{type:"text",filters:e.slice(n).trim(),expr:e.slice(0,n)}}return{type:"text",expr:e,filters:""}}function it(e){for(var t,n,a=[],r=0;;){if(n=e.indexOf(dn,r),-1===n)break;if(t=e.slice(r,n),t&&a.push({expr:t}),r=n+dn.length,n=e.indexOf(pn,r),-1===n)break;t=e.slice(r,n),t&&a.push(rt(t,r)),r=n+pn.length}return t=e.slice(r),t&&a.push({expr:t}),a}function ot(e,t,n){var a=[],r=it(e.data);if(r.length){for(var i,o=0;i=r[o++];){var l=Lt.createTextNode(i.expr);i.type&&(i.expr=i.expr.replace(oa,function(){return i.oneTime=!0,""}),i.element=l,i.filters=i.filters.replace(pa,function(){return i.type="html",""}),i.pos=1e3*n+o,a.push(i)),Qt.appendChild(l)}e.parentNode.replaceChild(Qt,e),a.length&&J(a,t)}}function lt(e,t){if(t)for(var n,a=0;n=e[a++];)if(n.hasOwnProperty(t)&&"object"==typeof n[t]){var r=n[t];return r.$model||r}return{}}function st(e){if(e.scopeName&&"HTML"!==e.scopeName)return e.scopeName;var t=e.nodeName.toLowerCase(),n=t.indexOf(":");return n>0?t.slice(0,n):void 0}function ct(e){return null==e?"":e}function ut(e,t,n){return t.param.replace(It,function(a){var r=avalon.duplexHooks[a];r&&"function"==typeof r[n]&&(e=r[n](e,t))}),e}function ft(){for(var e=Oa.length-1;e>=0;e--){var t=Oa[e];t()===!1&&Oa.splice(e,1)}Oa.length||clearInterval(Ea)}function dt(e,t){if(!e||1!==e.nodeType)return null;if(t)var n=t.effectName,a=t.effectDriver;else n=e.getAttribute("data-effect-name"),a=e.getAttribute("data-effect-driver");if(!n||!a)return null;var r=qa.pop()||new ht;return r.el=e,r.driver=a,r.useCss="j"!==a,r.useCss&&(t&&avalon(e).addClass(t.effectClass),r.cssEvent="t"===a?ja:Sa),r.name=n,r.callbacks=avalon.effects[n]||{},r}function pt(e,t){var n=e.getAttribute("data-effect-name");if(n){t.effectName=n,t.effectDriver=e.getAttribute("data-effect-driver");var a=+e.getAttribute("data-effect-stagger");t.effectLeaveStagger=+e.getAttribute("data-effect-leave-stagger")||a,t.effectEnterStagger=+e.getAttribute("data-effect-enter-stagger")||a,t.effectClass=e.className||0/0}}function vt(e){return e.replace(/^[\S]/g,function(e){return e.toUpperCase()})}function ht(){}function mt(e,t){var n=e.callbacks[t+"Class"];return"string"==typeof n?n:"function"==typeof n?n():e.name+"-"+t}function gt(e,t,n){var a=e.callbacks[t];a&&a.call(e,e.el,n)}function yt(e,t,n){var a=e.templateCache&&e.templateCache[t];if(a){for(var r,i=Lt.createDocumentFragment();r=a.firstChild;)i.appendChild(r);return i}return avalon.parseHTML(n)}function bt(e){for(var t=Lt.createDocumentFragment(),n=0,a=e.length;a>n;n++)t.appendChild(e[n]);return t}function $t(e,t,n){for(var a,r=0;a=e[r++];)a.className===n.effectClass&&avalon.effect.apply(a,t,o,o,n)}function xt(e,t,n){return e?setTimeout(t,++n*e):t(),n}function wt(e,t){for(var n=Qt.cloneNode(!1),a=e,r=a.nodeValue,i=t&&Math.max(+t.staggerIndex,0),l=avalon.slice(a.parentNode.childNodes),s=l.indexOf(a);;){var c=l[--s];if(!c||0===String(c.nodeValue).indexOf(r))break;t&&c.className===t.effectClass?(e=c,function(e){t.staggerIndex=xt(t.effectLeaveStagger,function(){avalon.effect.apply(e,0,o,function(){n.appendChild(e)},t)},i)}(c)):n.insertBefore(c,n.firstChild)}return n.appendChild(a),n}function Ct(e,t,n,a,r){var i=e.template.cloneNode(!0),o=avalon.slice(i.childNodes);i.appendChild(n.$anchor),r&&t.appendChild(i);var l=[n].concat(e.vmodels),s={nodes:o,vmodels:l,content:i};a.push(s)}function kt(e){var t="object"===e.xtype?Et:Nt,n=t(e),a=n.$anchor||(n.$anchor=e.element.cloneNode(!1));return a.nodeValue=e.signature,n.$outer=e.$outer,n}function Nt(e,t){for(var n=e.param||"el",a=0,r=Ua.length;r>a;a++){var i=Ua[a];if(i&&i.hasOwnProperty(n)){Ua.splice(a,1),t=i;break}}return t||(t=At(n)),t}function At(e){var t={$outer:{},$index:0,$oldIndex:0,$anchor:null,$first:!1,$last:!1,$remove:avalon.noop};t[e]=0/0;var n={$last:1,$first:1,$index:1};n[e]=1;var a=g(t,{force:n});return a.$id=tn("$proxy$each"),a}function Tt(e,t,n){if("array"===n){e.$remove=function(){t.$repeat.removeAt(e.$index)};var a=t.param;e.$watch(a,function(n){var a=e.$index;t.$repeat[a]=n})}else e.$watch("$val",function(n){t.$repeat[e.$key]=n})}function Et(){return za.pop()||Ot()}function Ot(){var e=g({$key:"",$val:0/0,$index:0,$oldIndex:0,$outer:{},$anchor:null},{force:{$key:1,$val:1,$index:1}});return e.$id=tn("$proxy$with"),e}function Mt(e,t,n){var a=e[t];if(a){var r=0===a.$id.indexOf("$proxy$each")?Ua:za;a.$outer={};for(var i in a.$events){var o=a.$events[i];Array.isArray(o)&&(o.length=0,i===n?a[n]=0/0:"$val"===i&&(a.$val=0/0))}r.unshift(a)>f.maxRepeatSize&&r.pop(),delete e[t]}}function jt(e,t){var n="_"+e;if(!jt[n]){var a=Lt.createElement(e);Kt.appendChild(a),t=Jt?getComputedStyle(a,null).display:a.currentStyle.display,Kt.removeChild(a),jt[n]=t}return jt[n]}function St(e,t,n,a){e=(e+"").replace(/[^0-9+\-Ee.]/g,"");var r=isFinite(+e)?+e:0,i=isFinite(+t)?Math.abs(t):3,o=a||",",l=n||".",s="",c=function(e,t){var n=Math.pow(10,t);return""+(Math.round(e*n)/n).toFixed(t)};return s=(i?c(r,i):""+Math.round(r)).split("."),s[0].length>3&&(s[0]=s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,o)),(s[1]||"").length');var Rt,qt=Dt.firstChild,Bt="$"+Ht,Pt=e.require,Ft=e.define,_t={},Vt=/[^, ]+/g,It=/\w+/g,Ut=/^\[object SVG\w*Element\]$/,zt=/^\[object (?:Window|DOMWindow|global)\]$/,Wt=Object.prototype,Xt=Wt.hasOwnProperty,Yt=Wt.toString,Gt=Array.prototype,Zt=Gt.slice,Jt=e.dispatchEvent,Kt=Lt.documentElement,Qt=Lt.createDocumentFragment(),en=(Lt.createElement("div"),{});"Boolean Number String Function Array Date RegExp Object Error".replace(Vt,function(e){en["[object "+e+"]"]=e.toLowerCase()});var tn=function(e){return e=e||"avalon",String(Math.random()+Math.random()).replace(/\d\.\d{4}/,e)},nn=s();avalon=function(e){return new avalon.init(e)},avalon.nextTick=new function(){function t(){for(var e=r.length,t=0;e>t;t++)r[t]();r=r.slice(e)}var n=e.setImmediate,a=e.MutationObserver;if(n)return n.bind(e);var r=[];if(a){var i=document.createTextNode("avalon");new a(t).observe(i,{characterData:!0});var o=!1;return function(e){r.push(e),o=!o,i.data=o}}return function(e){setTimeout(e,4)}},avalon.init=function(e){this[0]=this.element=e},avalon.fn=avalon.prototype=avalon.init.prototype,avalon.type=function(e){return null==e?String(e):"object"==typeof e||"function"==typeof e?en[Yt.call(e)]||"object":typeof e};var an=function(e){return"[object Function]"===Yt.call(e)};avalon.isFunction=an,avalon.isWindow=function(e){return zt.test(Yt.call(e))},avalon.isPlainObject=function(e){return"[object Object]"===Yt.call(e)&&Object.getPrototypeOf(e)===Wt},avalon.mix=avalon.fn.mix=function(){var e,t,n,a,r,i,o=arguments[0]||{},l=1,s=arguments.length,c=!1;for("boolean"==typeof o&&(c=o,o=arguments[1]||{},l++),"object"==typeof o||an(o)||(o={}),l===s&&(o=this,l--);s>l;l++)if(null!=(e=arguments[l]))for(t in e)n=o[t],a=e[t],o!==a&&(c&&a&&(avalon.isPlainObject(a)||(r=Array.isArray(a)))?(r?(r=!1,i=n&&Array.isArray(n)?n:[]):i=n&&avalon.isPlainObject(n)?n:{},o[t]=avalon.mix(c,i,a)):void 0!==a&&(o[t]=a));return o},avalon.mix({rword:Vt,subscribers:Bt,version:1.53,ui:{},log:n,slice:function(e,t,n){return Zt.call(e,t,n)},noop:o,error:function(e,t){throw new(t||Error)(e)},oneObject:l,range:function(e,t,n){n||(n=1),null==t&&(t=e||0,e=0);for(var a=-1,r=Math.max(0,Math.ceil((t-e)/n)),i=new Array(r);++an&&t(n,e[n])!==!1;n++);else for(n in e)if(e.hasOwnProperty(n)&&t(n,e[n])===!1)break}},getWidgetData:function(e,t){var n=avalon(e).data(),a={};for(var r in n)0===r.indexOf(t)&&(a[r.replace(t,"").replace(/\w/,function(e){return e.toLowerCase()})]=n[r]);return a},Array:{ensure:function(e,t){return-1===e.indexOf(t)?e.push(t):void 0},removeAt:function(e,t){return!!e.splice(t,1).length},remove:function(e,t){var n=e.indexOf(t);return~n?avalon.Array.removeAt(e,n):!1}}});var rn=avalon.bindingHandlers={},on=avalon.bindingExecutors={},ln=avalon.directives={};avalon.directive=function(e,t){return rn[e]=t.init=t.init||o,on[e]=t.update=t.update||o,ln[e]=t};var sn=new function(){function e(e){this.size=0,this.limit=e,this.head=this.tail=void 0,this._keymap={}}var t=e.prototype;return t.put=function(e,t){var n={key:e,value:t};return this._keymap[e]=n,this.tail?(this.tail.newer=n,n.older=this.tail):this.head=n,this.tail=n,this.size===this.limit?this.shift():this.size++,t},t.shift=function(){var e=this.head;e&&(this.head=this.head.newer,this.head.older=e.newer=e.older=this._keymap[e.key]=void 0,delete this._keymap[e.key])},t.get=function(e){var t=this._keymap[e];if(void 0!==t)return t===this.tail?t.value:(t.newer&&(t===this.head&&(this.head=t.newer),t.newer.older=t.older),t.older&&(t.older.newer=t.newer),t.newer=void 0,t.older=this.tail,this.tail&&(this.tail.newer=t),this.tail=t,t.value)},e};if(Lt.contains||(Node.prototype.contains=function(e){return!!(16&this.compareDocumentPosition(e))}),avalon.contains=function(e,t){try{for(;t=t.parentNode;)if(t===e)return!0;return!1}catch(n){return!1}},e.SVGElement){var cn="http://www.w3.org/2000/svg",un=Lt.createElementNS(cn,"svg");un.innerHTML='',Ut.test(un.firstChild)||Object.defineProperties(SVGElement.prototype,{outerHTML:{enumerable:!0,configurable:!0,get:function(){return(new XMLSerializer).serializeToString(this)},set:function(e){var t=this.tagName.toLowerCase(),n=this.parentNode,a=avalon.parseHTML(e);if("svg"===t)n.insertBefore(a,this);else{var r=Lt.createDocumentFragment();u(a,r),n.insertBefore(r,this)}n.removeChild(this)}},innerHTML:{enumerable:!0,configurable:!0,get:function(){var e=this.outerHTML,t=new RegExp("<"+this.nodeName+'\\b(?:(["\'])[^"]*?(\\1)|[^>])*>',"i"),n=new RegExp("$","i");return e.replace(t,"").replace(n,"")},set:function(e){if(avalon.clearHTML){avalon.clearHTML(this);var t=avalon.parseHTML(e);u(t,this)}}}})}var fn=avalon.eventHooks;"onmouseenter"in Kt||avalon.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){fn[e]={type:t,fn:function(t,n){return function(a){var r=a.relatedTarget;return r&&(r===t||16&t.compareDocumentPosition(r))?void 0:(delete a.type,a.type=e,n.call(t,a))}}}}),avalon.each({AnimationEvent:"animationend",WebKitAnimationEvent:"webkitAnimationEnd"},function(t,n){e[t]&&!fn.animationend&&(fn.animationend={type:n})}),void 0===Lt.onmousewheel&&(fn.mousewheel={type:"wheel",fn:function(e,t){return function(n){n.wheelDeltaY=n.wheelDelta=n.deltaY>0?-120:120,n.wheelDeltaX=0,Object.defineProperty(n,"type",{value:"mousewheel"}),t.call(e,n)}}});var dn,pn,vn,hn,mn,gn=/[-.*+?^${}()|[\]\/\\]/g,yn={loader:function(t){var n=Rt&&t;e.require=n?Rt:Pt,e.define=n?Rt.define:Ft},interpolate:function(e){if(dn=e[0],pn=e[1],dn===pn){throw new SyntaxError("openTag!==closeTag")}f.openTag=dn,f.closeTag=pn;var t=d(dn),n=d(pn);vn=new RegExp(t+"(.*?)"+n),hn=new RegExp(t+"(.*?)"+n,"g"),mn=new RegExp(t+".*?"+n+"|\\sms-")}};f.async=!0,f.debug=!0,f.plugins=yn,f.plugins.interpolate(["{{","}}"]),f.paths={},f.shim={},f.maxRepeatSize=100,avalon.config=f;var bn=avalon.vmodels={};avalon.define=function(e){var t=e.$id;t||n("warning: vm必须指定$id");var a=g(e);return a.$id=t,bn[t]=a};var $n=l("$id,$watch,$fire,$events,$model,$skipArray,$active,$pathname,$up,$track,$accessors"),xn={get:function(){return N(this)},set:o,enumerable:!1,configurable:!0},wn=["push","pop","shift","unshift","splice"],Cn=Array.prototype,kn={notify:function(){v.call(this.$up,this.$pathname)},set:function(e,t){if(e>>>0===e&&this[e]!==t){if(e>this.length)throw Error(e+"set方法的第一个参数不能大于原数组长度");v.call(this.$up,this.$pathname+".*",[t,this[e]]),this.splice(e,1,t)}},contains:function(e){return-1!==this.indexOf(e)},ensure:function(e){return this.contains(e)||this.push(e),this},pushArray:function(e){return this.push.apply(this,e)},remove:function(e){return this.removeAt(this.indexOf(e))},removeAt:function(e){return e>>>0===e?this.splice(e,1):[]},size:function(){return this._.length},removeAll:function(e){if(Array.isArray(e))for(var t=this.length-1;t>=0;t--)-1!==e.indexOf(this[t])&&(Nn.call(this.$track,t,1),Nn.call(this,t,1));else if("function"==typeof e)for(t=this.length-1;t>=0;t--){var n=this[t];e(n,t)&&(Nn.call(this.$track,t,1),Nn.call(this,t,1))}else Nn.call(this.$track,0,this.length),Nn.call(this,0,this.length);Jt||(this.$model=N(this)),this.notify(),this._.length=this.length},clear:function(){return this.removeAll()}},Nn=Cn.splice;wn.forEach(function(e){var t=Cn[e];kn[e]=function(){for(var n=[],a=0,r=arguments.length;r>a;a++)n[a]=w(arguments[a],0,1,1);var i=t.apply(this,n);return E(this.$track,e,n),Jt||(this.$model=N(this)),this.notify(),this._.length=this.length,i}}),"sort,reverse".replace(Vt,function(e){kn[e]=function(){var t=this.concat(),n=this,a=Math.random(),r=[],i=!1;Cn[e].apply(n,arguments);for(var o=0,l=t.length;l>o;o++){var s=n[o],c=t[o];if(s===c)r.push(o);else{var u=t.indexOf(s);r.push(u),t[u]=a,i=!0}}return i&&(A(this.$track,r),Jt||(this.$model=N(this)),this.notify()),this}});var An=function(){var e,t=[];return{begin:function(n){t.push(e),e=n},end:function(){e=t.pop()},collectDependency:function(t){e&&e.callback(t)}}}();avalon.injectBinding=function(e){e.handler=e.handler||ln[e.type].update||o,e.update=function(){var t=!1;e.getter||(t=!0,An.begin({callback:function(t){O(t,e)}}),e.getter=W(e.expr,e.vmodels,e),e.observers.forEach(function(t){t.v.$watch(t.p,e)}),delete e.observers);try{var a,r,i=e.fireArgs;if(delete e.fireArgs,i?(a=i[0],r=i[1]):a="on"===e.type?e.getter+"":e.getter.apply(0,e.args),r="undefined"==typeof r?e.oldValue:r,e._filters&&(a=Ka.$filter.apply(0,[a].concat(e._filters))),e.signature){var o=avalon.type(a);if("array"!==o&&"object"!==o)throw Error("warning:"+e.expr+"只能是对象或数组");e.xtype=o;var l=M(e.proxies||[],o),s=a.$track||("array"===o?T(a.length):Object.keys(a));e.track=s,l!==s.join(";")&&(e.handler(a,r),e.oldValue=1)}else(Array.isArray(a)?a.length===(r&&r.length):1)?"oldValue"in e&&a===r||(e.handler(a,r),e.oldValue=a):(e.handler(a,r),e.oldValue=a.concat())}catch(c){delete e.getter,n("warning:exception throwed in [avalon.injectBinding] ",c);var u=e.element;u&&3===u.nodeType&&(u.nodeValue=dn+(e.oneTime?"::":"")+e.expr+pn)}finally{t&&An.end()}},e.update()};var Tn=0,En=avalon.$$subscribers=[],On=new Date,Mn={},jn=new function(){avalon.mix(this,{option:Lt.createElement("select"),thead:Lt.createElement("table"),td:Lt.createElement("tr"),area:Lt.createElement("map"),tr:Lt.createElement("tbody"),col:Lt.createElement("colgroup"),legend:Lt.createElement("fieldset"),_default:Lt.createElement("div"),g:Lt.createElementNS("http://www.w3.org/2000/svg","svg")}),this.optgroup=this.option,this.tbody=this.tfoot=this.colgroup=this.caption=this.thead,this.th=this.td};String("circle,defs,ellipse,image,line,path,polygon,polyline,rect,symbol,text,use").replace(Vt,function(e){jn[e]=jn.g});var Sn=/<([\w:]+)/,Hn=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Ln=l(["","text/javascript","text/ecmascript","application/ecmascript","application/javascript"]),Dn=Lt.createElement("script"),Rn=/<|&#?\w+;/;avalon.parseHTML=function(e){var t=Qt.cloneNode(!1);if("string"!=typeof e)return t;if(!Rn.test(e))return t.appendChild(Lt.createTextNode(e)),t;e=e.replace(Hn,"<$1>").trim();var n,a=(Sn.exec(e)||["",""])[1].toLowerCase(),r=jn[a]||jn._default;r.innerHTML=e;var i=r.getElementsByTagName("script");if(i.length)for(var o,l=0;o=i[l++];)if(Ln[o.type]){var s=Dn.cloneNode(!1);Gt.forEach.call(o.attributes,function(e){s.setAttribute(e.name,e.value)}),s.text=o.text,o.parentNode.replaceChild(s,o)}for(;n=r.firstChild;)t.appendChild(n);return t},avalon.innerHTML=function(e,t){var n=this.parseHTML(t);this.clearHTML(e).appendChild(n)},avalon.clearHTML=function(e){for(e.textContent="";e.firstChild;)e.removeChild(e.firstChild);return e},"add,remove".replace(Vt,function(e){avalon.fn[e+"Class"]=function(t){var n=this[0];return t&&"string"==typeof t&&n&&1===n.nodeType&&t.replace(/\S+/g,function(t){n.classList[e](t)}),this}}),avalon.fn.mix({hasClass:function(e){var t=this[0]||{};return 1===t.nodeType&&t.classList.contains(e)},toggleClass:function(e,t){for(var n,a=0,r=String(e).split(/\s+/),i="boolean"==typeof t;n=r[a++];){var o=i?t:!this.hasClass(n);this[o?"addClass":"removeClass"](n)}return this},attr:function(e,t){return 2===arguments.length?(this[0].setAttribute(e,t),this):this[0].getAttribute(e)},data:function(e,t){switch(e="data-"+R(e||""),arguments.length){case 2:return this.attr(e,t),this;case 1:var n=this.attr(e);return B(n);case 0:var a={};return Gt.forEach.call(this[0].attributes,function(t){t&&(e=t.name,e.indexOf("data-")||(e=q(e.slice(5)),a[e]=B(t.value)))}),a}},removeData:function(e){return e="data-"+R(e),this[0].removeAttribute(e),this},css:function(e,t){if(avalon.isPlainObject(e))for(var n in e)avalon.css(this,n,e[n]);else var a=avalon.css(this,e,t);return void 0!==a?a:this},position:function(){var e,t,n=this[0],a={top:0,left:0};if(n)return"fixed"===this.css("position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),"HTML"!==e[0].tagName&&(a=e.offset()),a.top+=avalon.css(e[0],"borderTopWidth",!0),a.left+=avalon.css(e[0],"borderLeftWidth",!0),a.top-=e.scrollTop(),a.left-=e.scrollLeft()),{top:t.top-a.top-avalon.css(n,"marginTop",!0),left:t.left-a.left-avalon.css(n,"marginLeft",!0)}},offsetParent:function(){for(var e=this[0].offsetParent;e&&"static"===avalon.css(e,"position");)e=e.offsetParent;return avalon(e||Kt)},bind:function(e,t,n){return this[0]?avalon.bind(this[0],e,t,n):void 0},unbind:function(e,t,n){return this[0]&&avalon.unbind(this[0],e,t,n),this},val:function(e){var t=this[0];if(t&&1===t.nodeType){var n=0===arguments.length,a=n?":get":":set",r=In[_(t)+a];if(r)var i=r(t,e);else{if(n)return(t.value||"").replace(/\r/g,"");t.value=e +}}return n?i:this}}),Kt.dataset&&(avalon.fn.data=function(e,t){e=e&&q(e);var n=this[0].dataset;switch(arguments.length){case 2:return n[e]=t,this;case 1:return t=n[e],B(t);case 0:var a=r();for(e in n)a[e]=B(n[e]);return a}});var qn=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/;avalon.parseJSON=JSON.parse,avalon.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){avalon.fn[e]=function(n){var a=this[0]||{},r=P(a),i="scrollTop"===e;return arguments.length?void(r?r.scrollTo(i?r[t]:n,i?n:r[t]):a[e]=n):r?r[t]:a[e]}});var Bn=avalon.cssHooks=r(),Pn=["","-webkit-","-moz-","-ms-"],Fn={"float":"cssFloat"};avalon.cssNumber=l("animationIterationCount,animationIterationCount,columnCount,order,flex,flexGrow,flexShrink,fillOpacity,fontWeight,lineHeight,opacity,orphans,widows,zIndex,zoom"),avalon.cssName=function(e,t,n){if(Fn[e])return Fn[e];t=t||Kt.style;for(var a=0,r=Pn.length;r>a;a++)if(n=q(Pn[a]+e),n in t)return Fn[e]=n;return null},Bn["@:set"]=function(e,t,n){e.style[t]=n},Bn["@:get"]=function(e,t){if(!e||!e.style)throw new Error("getComputedStyle要求传入一个节点 "+e);var n,a=getComputedStyle(e);return a&&(n="filter"===t?a.getPropertyValue(t):a[t],""===n&&(n=e.style[t])),n},Bn["opacity:get"]=function(e){var t=Bn["@:get"](e,"opacity");return""===t?"1":t},"top,left".replace(Vt,function(e){Bn[e+":get"]=function(t){var n=Bn["@:get"](t,e);return/px$/.test(n)?n:avalon(t).position()[e]+"px"}});var _n={position:"absolute",visibility:"hidden",display:"block"},Vn=/^(none|table(?!-c[ea]).+)/;"Width,Height".replace(Vt,function(e){var t=e.toLowerCase(),n="client"+e,a="scroll"+e,r="offset"+e;Bn[t+":get"]=function(t,n,a){var i=-4;"number"==typeof a&&(i=a),n="Width"===e?["Left","Right"]:["Top","Bottom"];var o=t[r];return 2===i?o+avalon.css(t,"margin"+n[0],!0)+avalon.css(t,"margin"+n[1],!0):(0>i&&(o=o-avalon.css(t,"border"+n[0]+"Width",!0)-avalon.css(t,"border"+n[1]+"Width",!0)),-4===i&&(o=o-avalon.css(t,"padding"+n[0],!0)-avalon.css(t,"padding"+n[1],!0)),o)},Bn[t+"&get"]=function(e){var n=[];F(e,n);for(var a,r=Bn[t+":get"](e),i=0;a=n[i++];){e=a.node;for(var o in a)"string"==typeof a[o]&&(e.style[o]=a[o])}return r},avalon.fn[t]=function(i){var o=this[0];if(0===arguments.length){if(o.setTimeout)return o["inner"+e];if(9===o.nodeType){var l=o.documentElement;return Math.max(o.body[a],l[a],o.body[r],l[r],l[n])}return Bn[t+"&get"](o)}return this.css(t,i)},avalon.fn["inner"+e]=function(){return Bn[t+":get"](this[0],void 0,-2)},avalon.fn["outer"+e]=function(e){return Bn[t+":get"](this[0],void 0,e===!0?2:0)}}),avalon.fn.offset=function(){var e=this[0];try{var t=e.getBoundingClientRect();if(t.width||t.height||e.getClientRects().length){var n=e.ownerDocument,a=n.documentElement,r=n.defaultView;return{top:t.top+r.pageYOffset-a.clientTop,left:t.left+r.pageXOffset-a.clientLeft}}}catch(i){return{left:0,top:0}}};var In={"select:get":function(e,t){for(var n,a=e.options,r=e.selectedIndex,i="select-one"===e.type||0>r,o=i?null:[],l=i?r+1:a.length,s=0>r?l:i?r:0;l>s;s++)if(n=a[s],(n.selected||s===r)&&!n.disabled){if(t=n.value,i)return t;o.push(t)}return o},"select:set":function(e,t,n){t=[].concat(t);for(var a,r=0;a=e.options[r++];)(a.selected=t.indexOf(a.value)>-1)&&(n=!0);n||(e.selectedIndex=-1)}},Un={},zn=["break,case,catch,continue,debugger,default,delete,do,else,false","finally,for,function,if,in,instanceof,new,null,return,switch,this","throw,true,try,typeof,var,void,while,with","abstract,boolean,byte,char,class,const,double,enum,export,extends","final,float,goto,implements,import,int,interface,long,native","package,private,protected,public,short,static,super,synchronized","throws,transient,volatile","arguments,let,yield,undefined"].join(",");zn.replace(/\w+/g,function(e){Un[e]=!0});var Wn=/[a-z_$]/i,Xn=/[\s\uFEFF\xA0]/,Yn=/(\$proxy\$[a-z]+)\d+$/,Gn=new sn(218),Zn=new sn(128),Jn=/\)\s*$/,Kn=/\)\s*\|/g,Qn=/\|\s*([$\w]+)/g,ea=/"\s*\["/g,ta=/"\s*\(/g,na=JSON.stringify;avalon.scan=function(e,t){e=e||Kt;var n=t?[].concat(t):[];at(e,n)};var aa=l("area,base,basefont,br,col,command,embed,hr,img,input,link,meta,param,source,track,wbr,noscript,script,style,textarea".toUpperCase()),ra=function(e,t,n){var a=e.getAttribute(t);if(a)for(var r,i=0;r=n[i++];)if(r.hasOwnProperty(a)&&"function"==typeof r[a])return r[a]},ia=nn&&e.MutationObserver?function(e){for(var t,n=e.firstChild;n;){var a=n.nextSibling;3===n.nodeType?t?(t.nodeValue+=n.nodeValue,e.removeChild(n)):t=n:t=null,n=a}}:0,oa=/^\s*::/,la=/ms-(\w+)-?(.*)/,sa=l("animationend,blur,change,input,click,dblclick,focus,keydown,keypress,keyup,mousedown,mouseenter,mouseleave,mousemove,mouseout,mouseover,mouseup,scan,scroll,submit"),ca=l("value,title,alt,checked,selected,disabled,readonly,enabled,href,src"),ua=/^if|widget|repeat$/,fa=/^each|with|html|include$/,da=/^(ms-\S+|data-\S+|on[a-z]+|id|style|class|tabindex)$/,pa=/\|\s*html(?:\b|$)/,va=/\|\|/g,ha=/(['"])(\\\1|.)+?\1/g,ma=function(){this.queue=[]};ma.prototype={render:function(e){if(!this.locked){this.locked=e?Kt.offsetHeight+10:1;var t=this;avalon.nextTick(function(){t.flush()})}},flush:function(){for(var e,t=0;e=this.queue[t++];)e.update();this.locked=0,this.queue=[]}};var ga=new ma,ya=[],ba=[],$a={$construct:function(){return avalon.mix.apply(null,arguments)},$ready:o,$init:o,$dispose:o,$container:null,$childReady:o,$replace:!1,$extend:null,$$template:function(e){return e}};avalon.components={},avalon.component=function(t,n){n&&(avalon.components[t]=avalon.mix({},$a,n));for(var a,r=0;a=ya[r];r++)t===a.fullName&&(ya.splice(r,1),r--,function(n,a,r,i){var o=1,l=n.library,s=avalon.libraries[l]||$a,c=et(r),u=lt(n.vmodels,c.config||n.fullName),f=c.$id||c.identifier||tn(i);delete c.config,delete c.$id,delete c.identifier;var d={},p=avalon.components[a.$extend];p?(avalon.mix(!0,d,p),d=p.$construct.call(r,d,{},{})):avalon.mix(!0,d,a),d=avalon.components[t].$construct.call(r,d,u,c),d.$refs={},d.$id=f;var v=d.$slot,h=d.$replace,m=d.$container,g=d.$template;delete d.$slot,delete d.$replace,delete d.$container,delete d.$template,delete d.$construct;var y=avalon.define(d)||{};r.msResolved=1,y.$init(y,r),s.$init(y,r);for(var b,$,x=r.childNodes,w={},C=0;$=x[C++];){var k=1===$.nodeType&&$.getAttribute("slot")||v;k&&(w[k]?w[k].push($):w[k]=[$])}y.$$template&&(avalon.clearHTML(r),r.innerHTML=y.$$template(g));for(C in w)if(y.hasOwnProperty(C)){var N=w[C];if(N.length){for(var A=Qt.cloneNode(!0),T=0;b=N[T++];)A.appendChild(b);y[C]=A}w[C]=null}w=null;var E=r.firstChild;h&&(E=r.firstChild,r.parentNode.replaceChild(E,r),E.msResolved=1,r=n.element=E),m&&m.appendChild(r),avalon.fireDom(r,"datasetchanged",{library:l,vm:y,childReady:1});var O=0,M=avalon.bind(r,"datasetchanged",function(t){if(t.childReady&&t.library===l&&(o+=t.childReady,y!==t.vm&&(y.$refs[t.vm.$id]=t.vm,-1===t.childReady&&(O++,y.$childReady(y,r,t)),t.stopPropagation())),0===o){var a=setTimeout(function(){clearTimeout(a),y.$ready(y,r),s.$ready(y,r)},O?Math.max(17*O,100):17);avalon.unbind(r,"datasetchanged",M),n.rollback=function(){try{y.$dispose(y,r),s.$dispose(y,r)}catch(e){}delete avalon.vmodels[y.$id]},S(n,ba),e.chrome&&r.addEventListener("DOMNodeRemovedFromDocument",function(){setTimeout(H)})}});if(at(r,[y].concat(n.vmodels)),avalon.vmodels[y.$id]=y,r.childNodes.length)var j=setTimeout(function(){clearTimeout(j),avalon.fireDom(r,"datasetchanged",{library:l,vm:y,childReady:-1})},17);else avalon.fireDom(r,"datasetchanged",{library:l,vm:y,childReady:-1})}(a,avalon.components[t],a.element,a.widget))},avalon.fireDom=function(e,t,n){if(Lt.createEvent){var a=Lt.createEvent("Events");a.initEvent(t,!0,!0,n),avalon.mix(a,n),e.dispatchEvent(a)}else Kt.contains(e)&&(a=Lt.createEventObject(),avalon.mix(a,n),e.fireEvent("on"+t,a))},avalon.libraries=[],avalon.library=function(e,t){Lt.namespaces&&Lt.namespaces.add(e,"http://www.w3.org/1999/xhtml"),avalon.libraries[e]=avalon.mix({$init:o,$ready:o,$dispose:o},t||{})},avalon.library("ms");var xa=["autofocus,autoplay,async,allowTransparency,checked,controls","declare,disabled,defer,defaultChecked,defaultSelected","contentEditable,isMap,loop,multiple,noHref,noResize,noShade","open,readOnly,selected"].join(","),wa={};xa.replace(Vt,function(e){wa[e.toLowerCase()]=e});var Ca={"accept-charset":"acceptCharset","char":"ch",charoff:"chOff","class":"className","for":"htmlFor","http-equiv":"httpEquiv"},ka=["accessKey,bgColor,cellPadding,cellSpacing,codeBase,codeType,colSpan","dateTime,defaultValue,frameBorder,longDesc,maxLength,marginWidth,marginHeight","rowSpan,tabIndex,useMap,vSpace,valueType,vAlign"].join(",");ka.replace(Vt,function(e){Ca[e.toLowerCase()]=e});var Na=avalon.directive("attr",{init:function(e){if(e.expr=X(e.expr.trim()),"include"===e.type){var t=e.element;pt(t,e),e.includeRendered=ra(t,"data-include-rendered",e.vmodels),e.includeLoaded=ra(t,"data-include-loaded",e.vmodels);var n=e.includeReplace=!!avalon(t).data("includeReplace");avalon(t).data("includeCache")&&(e.templateCache={}),e.start=Lt.createComment("ms-include"),e.end=Lt.createComment("ms-include-end"),n?(e.element=e.end,e._element=t,t.parentNode.insertBefore(e.end,t),t.parentNode.insertBefore(e.start,e.end)):(t.insertBefore(e.start,t.firstChild),t.appendChild(e.end))}},update:function(t){var n=this.element,a=this.param;if("href"===a||"src"===a){if("string"!=typeof t||Kt.hasAttribute||(t=t.replace(/&/g,"&")),n[a]=t,e.chrome&&"EMBED"===n.tagName){var r=n.parentNode,i=document.createComment("ms-src");r.replaceChild(i,n),r.replaceChild(n,i)}}else{var o=t===!1||null===t||void 0===t;!Jt&&Ca[a]&&(a=Ca[a]);var l=wa[a];if("boolean"==typeof n[l]&&(n[l]=!!t,t||(o=!0)),o)return n.removeAttribute(a);var s=Ut.test(n)?!1:Lt.namespaces&&isVML(n)?!0:a in n.cloneNode(!1);s?n[a]=t+"":n.setAttribute(a,t)}}});"title,alt,src,value,css,include,href".replace(Vt,function(e){ln[e]=Na}),avalon.directive("class",{init:function(e){var t=e.param,a=e.type;if(!t||isFinite(t)?(e.param="",ln.effect.init(e)):(n("ms-"+a+'-xxx="yyy"这种用法已经过时,请使用ms-'+a+'="xxx:yyy"'),e.expr="["+na(t)+","+e.expr+"]",e.oldStyle=t),"hover"===a||"active"===a){if(!e.hasBindEvent){var r=e.element,i=avalon(r),o="mouseenter",l="mouseleave";if("active"===a){r.tabIndex=r.tabIndex||-1,o="mousedown",l="mouseup";var s=i.bind("mouseleave",function(){e.toggleClass&&i.removeClass(e.newClass)})}}var c=i.bind(o,function(){e.toggleClass&&i.addClass(e.newClass)}),u=i.bind(l,function(){e.toggleClass&&i.removeClass(e.newClass)});e.rollback=function(){i.unbind("mouseleave",s),i.unbind(o,c),i.unbind(l,u)},e.hasBindEvent=!0}},update:function(e){var t=this,n=avalon(this.element);t.newClass=e[0],t.toggleClass=!!e[1],t.oldClass&&t.newClass!==t.oldClass&&n.removeClass(t.oldClass),t.oldClass=t.newClass,"class"===t.type&&(t.oldStyle?n.toggleClass(t.oldStyle,!!e[1]):n.toggleClass(t.newClass,t.toggleClass))}}),"hover,active".replace(Vt,function(e){ln[e]=ln["class"]}),avalon.directive("css",{init:ln.attr.init,update:function(e){avalon(this.element).css(this.param,e)}}),avalon.directive("data",{priority:100,update:function(e){var t=this.element,n="data-"+this.param;e&&"object"==typeof e?t[n]=e:t.setAttribute(n,String(e))}});{var Aa=/^(?:checkbox|radio)$/,Ta=/^(?:radio|checked)$/;avalon.directive("duplex",{priority:2e3,init:function(e,t){function a(t){e.changed.call(this,t,e)}function r(){d=!0}function i(){d=!1}var s=e.element,c=e.vmodels;e.changed=ra(s,"data-duplex-changed",c)||o;var u=[],f=l("string,number,boolean,checked");"radio"===s.type&&""===e.param&&(e.param="checked"),e.param.replace(It,function(a){Aa.test(s.type)&&Ta.test(a)&&("radio"===a&&n("ms-duplex-radio已经更名为ms-duplex-checked"),a="checked",e.isChecked=!0,e.xtype="radio"),"bool"===a?(a="boolean",n("ms-duplex-bool已经更名为ms-duplex-boolean")):"text"===a&&(a="string",n("ms-duplex-text已经更名为ms-duplex-string")),f[a]&&(t=!0),avalon.Array.ensure(u,a)}),t||u.push("string"),e.param=u.join("-"),e.changed=ra(s,"binding-duplex-changed",c)||o,e.xtype||(e.xtype="SELECT"===s.tagName?"select":"checkbox"===s.type?"checkbox":"radio"===s.type?"radio":/^change/.test(s.getAttribute("data-duplex-event"))?"change":"input"),e.bound=function(t,n){s.addEventListener(t,n,!1);var a=e.rollback;e.rollback=function(){s.avalonSetter=null,avalon.unbind(s,t,n),a&&a()}};var d=!1,p=function(){var t=s.value;if(!d&&t!==e.oldValue){var n=e.pipe(t,e,"get");e.setter(n),a.call(s,n)}};switch(e.xtype){case"radio":e.bound("click",function(){var t=e.pipe(s.value,e,"get");e.setter(t),a.call(s,t)});break;case"checkbox":e.bound("change",function(){var t=s.checked?"ensure":"remove",r=e.getter.apply(0,e.vmodels);Array.isArray(r)||(n("ms-duplex应用于checkbox上要对应一个数组"),r=[r]);var i=e.pipe(s.value,e,"get");avalon.Array[t](r,i),a.call(s,r)});break;case"change":e.bound("change",p);break;case"input":nn?e.bound("input",p):(e.bound("input",p),e.bound("compositionstart",r),e.bound("compositionend",i),e.bound("DOMAutoComplete",p));break;case"select":e.bound("change",function(){var t=avalon(s).val();t=Array.isArray(t)?t.map(function(t){return e.pipe(t,e,"get")}):e.pipe(t,e,"get"),t+""!==e.oldValue&&(e.setter(t),a.call(s,t))})}"input"===e.xtype&&/^(text|password|hidden)/.test(s.type)&&Ma(function(){if(Kt.contains(s))e.oldValue!==s.value&&p();else if(!s.msRetain)return!1}),s.avalonSetter=p;for(var v in avalon.vmodels){var h=avalon.vmodels[v];h.$fire("avalon-ms-duplex-init",e)}var m=e.pipe||(e.pipe=ut);m(null,e,"init")},update:function(e){var t,n=this.element,a=this;switch(this.xtype){case"input":case"change":t=this.pipe(e,this,"set"),t!==this.oldValue&&(n.value=this.oldValue=t);break;case"radio":t=a.isChecked?!!e:e+""===n.value,n.checked=t;break;case"checkbox":var r=[].concat(e);t=this.pipe(n.value,this,"get"),n.checked=r.indexOf(t)>-1;break;case"select":a._value=e,n.msHasEvent="selectDuplex",avalon.bind(n,"datasetchanged",function(e){if("selectDuplex"===e.bubble){var t=a._value,r=Array.isArray(t)?t.map(String):t+"";avalon(n).val(r),n.oldValue=r+"",a.changed.call(n,r)}})}"select"!==a.xtype&&a.changed.call(n,t)}})}avalon.duplexHooks={checked:{get:function(e,t){return!t.element.oldValue}},string:{get:function(e){return e},set:ct},"boolean":{get:function(e){return"true"===e},set:ct},number:{get:function(e,t){var n=parseFloat(e);if(-e===-n)return n;var a=/strong|medium|weak/.exec(t.element.getAttribute("data-duplex-number"))||["medium"];switch(a[0]){case"strong":return 0;case"medium":return""===e?"":0;case"weak":return e}},set:ct}};var Ea,Oa=[];avalon.tick=function(e){1===Oa.push(e)&&(Ea=setInterval(ft,60))};var Ma=o;!new function(){function e(e){t[this.tagName].call(this,e),"function"==typeof this.avalonSetter&&this.oldValue!==e&&this.avalonSetter()}try{var t={},n=HTMLInputElement.prototype,a=HTMLTextAreaElement.prototype,r=HTMLInputElement.prototype;Object.getOwnPropertyNames(r),t.INPUT=Object.getOwnPropertyDescriptor(n,"value").set,Object.defineProperty(n,"value",{set:e}),t.TEXTAREA=Object.getOwnPropertyDescriptor(a,"value").set,Object.defineProperty(a,"value",{set:e})}catch(i){Ma=avalon.tick}},avalon.directive("effect",{priority:5,init:function(e){var t,n,a=e.expr,r=a.replace(hn,function(e){return e.replace(/./g,"0")}).indexOf(":");-1===r?(t=a,n=!0):(t=a.slice(0,r),n=a.slice(r+1)),t=vn.test(a)?X(t):na(t),e.expr="["+t+","+n+"]"},update:function(t){var n=t[0],a=this.element;if(a.getAttribute("data-effect-name")!==n){a.removeAttribute("data-effect-driver");var r=a.style,i=e.getComputedStyle?e.getComputedStyle(a):null,o=!1;if(i&&(Ha||La)){var l=r[Da]||i[Da];l&&"0s"!==l&&(a.setAttribute("data-effect-driver","t"),o=!0),o||(l=r[Ra]||i[Ra],l&&"0s"!==l&&(a.setAttribute("data-effect-driver","a"),o=!0))}o||avalon.effects[n]&&(a.setAttribute("data-effect-driver","j"),o=!0),o&&a.setAttribute("data-effect-name",n)}}}),avalon.effects={},avalon.effect=function(e,t){avalon.effects[e]=t};var ja,Sa,Ha=!1,La=!1,Da=avalon.cssName("transition-duration"),Ra=avalon.cssName("animation-duration");!new function(){var t,n={TransitionEvent:"transitionend",WebKitTransitionEvent:"webkitTransitionEnd",OTransitionEvent:"oTransitionEnd",otransitionEvent:"otransitionEnd"};for(var a in n){if(e[a]){t=n[a];break}try{{document.createEvent(a)}t=n[a];break}catch(r){}}"string"==typeof t&&(Ha=!0,ja=t),n={AnimationEvent:"animationend",WebKitAnimationEvent:"webkitAnimationEnd"};var i;for(a in n)if(e[a]){i=n[a];break}"string"==typeof i&&(Ha=!0,Sa=i)};var qa=[],Ba=new ma;ht.prototype={contrustor:ht,enterClass:function(){return mt(this,"enter")},leaveClass:function(){return mt(this,"leave")},actionFun:function(e,t,n){if(!document.hidden){var a=this,r=a.el,i="leave"===e;e=i?"leave":"enter";var o=i?"enter":"leave";gt(a,"abort"+vt(o)),gt(a,"before"+vt(e)),i||t(r);var l=function(o){r.removeEventListener(a.cssEvent,a.cssCallback),i?(t(r),avalon(r).removeClass(a.cssClass)):"a"===a.driver&&avalon(r).removeClass(a.cssClass),o!==!0&&(gt(a,"after"+vt(e)),n&&n(r)),a.dispose()};a.useCss?(a.cssCallback&&a.cssCallback(!0),a.cssClass=mt(a,e),a.cssCallback=l,a.update=function(){r.addEventListener(a.cssEvent,a.cssCallback),i||"t"!==a.driver||avalon(r).removeClass(a.cssClass)},avalon(r).addClass(a.cssClass),Ba.render(!0),Ba.queue.push(a)):gt(a,e,l)}},enter:function(){this.actionFun.apply(this,["enter"].concat(avalon.slice(arguments)))},leave:function(){this.actionFun.apply(this,["leave"].concat(avalon.slice(arguments)))},dispose:function(){this.update=this.cssCallback=null,qa.unshift(this)>100&&qa.pop()}};var Pa=function(e,t){var n=Zt.call(arguments,0);"function"!=typeof n[2]&&n.splice(2,0,o),"function"!=typeof n[3]&&n.splice(3,0,o);var a=n[2],r=n[3],i=n[4],l=dt(e,i);if(!l)return a(),r(),!1;var s=t?"enter":"leave";l[s](a,r)};avalon.mix(avalon.effect,{apply:Pa,append:function(e,t,n,a){return Pa(e,1,function(){t.appendChild(e)},n,a)},before:function(e,t,n,a){return Pa(e,1,function(){t.parentNode.insertBefore(e,t)},n,a)},remove:function(e,t,n,a){return Pa(e,0,function(){e.parentNode===t&&t.removeChild(e)},n,a)}}),avalon.directive("html",{update:function(e){var t=this,n=this.element,a=1!==n.nodeType,r=a?n.parentNode:n;if(r){if(e=null==e?"":e,3===n.nodeType){var i=tn("html");r.insertBefore(Lt.createComment(i),n),t.element=Lt.createComment(i+":end"),r.replaceChild(t.element,n),n=t.element}if("object"!=typeof e)var o=avalon.parseHTML(String(e));else if(11===e.nodeType)o=e;else if(1===e.nodeType||e.item){var l=1===e.nodeType?e.childNodes:e.item;for(o=Qt.cloneNode(!0);l[0];)o.appendChild(l[0])}if(l=avalon.slice(o.childNodes),a){for(var s=n.nodeValue.slice(0,-4);;){var c=n.previousSibling;if(!c||8===c.nodeType&&c.nodeValue===s)break;r.removeChild(c)}r.insertBefore(o,n)}else avalon.clearHTML(n).appendChild(o);nt(l,t.vmodels)}}}),avalon.directive("if",{priority:10,update:function(e){function t(){r.getAttribute(a.name)&&(r.removeAttribute(a.name),Q(r,a.vmodels)),a.rollback=null}var n,a=this,r=this.element,i=a.stamp=+new Date,o=function(){i===a.stamp&&(a.recoverNode=null)};a.recoverNode&&a.recoverNode();try{if(!r.parentNode)return;n=r.parentNode}catch(l){return}if(e){if(8===r.nodeType){var s=a.keep,c=avalon.effect.apply(s,1,function(){i===a.stamp&&(r.parentNode.replaceChild(s,r),r=a.element=s,s.getAttribute("_required")&&(r.required=!0,r.removeAttribute("_required")),r.querySelectorAll&&avalon.each(r.querySelectorAll("[_required=true]"),function(e){e.required=!0,e.removeAttribute("_required")}),t())},o);c=c===!1}c||t()}else if(1===r.nodeType){r.required===!0&&(r.required=!1,r.setAttribute("_required","true"));try{avalon.each(r.querySelectorAll(":required"),function(e){r.required=!1,e.setAttribute("_required","true")})}catch(l){}var u=a.element=Lt.createComment("ms-if"),f=r.nextSibling;a.recoverNode=function(){a.recoverNode=null,u.parentNode!==n&&(n.insertBefore(u,f),a.keep=r)},avalon.effect.apply(r,0,function(){a.recoverNode=null,i===a.stamp&&(r.parentNode.replaceChild(u,r),a.keep=r,qt.appendChild(r),a.rollback=function(){r.parentNode===qt&&qt.removeChild(r)})},o)}}});var Fa=function(){return new e.XMLHttpRequest},_a=avalon.templateCache={};avalon.directive("include",{init:ln.attr.init,update:function(e){var t=this,n=this.element,a=t.vmodels,r=t.includeRendered,i=t.effectName&&t.effectClass,o=t.templateCache,l=t.includeReplace,s=t.includeLoaded,c=l?n.parentNode:n,u=t._element;t.recoverNodes=t.recoverNodes||avalon.noop;var f=(l&&u.cloneNode(),function(f){var d=t._stamp=+new Date;if(s){var p=s.apply(c,[f].concat(a));"string"==typeof p&&(f=p)}r&&G(c,function(){r.call(c)},0/0);var v=t.includeLastID||"_default";t.includeLastID=e;var h=o&&o[v]||Lt.createElement(n.tagName||t._element.tagName);i&&(h.className=i,c.insertBefore(h,t.start)),(o||{})[v]=h;var m=t.recoverNodes();for(m&&c.insertBefore(m,t.end);;){var g=t.start.nextSibling;if(!g||g===h||g===t.end)break;h.appendChild(g)}avalon.effect.remove(h,c,function(){o&&d===t._stamp&&qt.appendChild(h)},t);var y=c,b=avalon.noop,$=avalon.noop,x=yt(t,e,f),w=avalon.slice(x.childNodes);l&&i?(y=u,y.innerHTML="",y.setAttribute("ms-skip","true"),c.insertBefore(y,t.end.nextSibling),b=function(){y.insertBefore(x,null)},$=function(){t.recoverNodes=avalon.noop,d===t._stamp&&(x=bt(w),c.insertBefore(x,t.end),nt(w,a)),y.parentNode===c&&c.removeChild(y)},t.recoverNodes=function(){return t.recoverNodes=avalon.noop,bt(w)}):b=function(){c.insertBefore(x,t.end),nt(w,a)},avalon.effect.apply(y,"enter",b,$)});if("src"===t.param)if("string"==typeof _a[e])avalon.nextTick(function(){f(_a[e])});else if(Array.isArray(_a[e]))_a[e].push(f);else{var d=Fa();d.onload=function(){for(var t,n=d.responseText,a=0;t=_a[e][a++];)t(n);_a[e]=n},_a[e]=[f],d.open("GET",e,!0),"withCredentials"in d&&(d.withCredentials=!0),d.setRequestHeader("X-Requested-With","XMLHttpRequest"),d.send(null)}else{var p=e&&1===e.nodeType?e:Lt.getElementById(e);p&&avalon.nextTick(function(){f(p.value||p.innerText||p.innerHTML)})}}});var Va=/\(([^)]*)\)/,Ia=avalon.directive("on",{priority:3e3,init:function(e){var t=e.expr;e.type="on";var n=e.param.replace(/-\d+$/,"");if("function"==typeof Ia[n+"Hook"]&&Ia[n+"Hook"](e),t.indexOf("(")>0&&t.indexOf(")")>-1){var a=(t.match(Va)||["",""])[1].trim();(""===a||"$event"===a)&&(t=t.replace(Va,""))}e.expr=t},update:function(e){var t=this,n=this.element;e=function(e){var n=t.getter||o;return n.apply(this,t.args.concat(e))};var a=t.param.replace(/-\d+$/,"");if("scan"===a)e.call(n,{type:a});else if("function"==typeof t.specialBind)t.specialBind(n,e);else var r=avalon.bind(n,a,e);t.rollback=function(){"function"==typeof t.specialUnbind?t.specialUnbind():avalon.unbind(n,a,r)}}});avalon.directive("repeat",{priority:90,init:function(e){var t=e.type;e.cache={},e.enterCount=0;var n=e.element;if(1===n.nodeType){n.removeAttribute(e.name),pt(n,e),e.param=e.param||"el",e.sortedCallback=ra(n,"data-with-sorted",e.vmodels);var a=ra(n,"data-"+t+"-rendered",e.vmodels),r=tn(t),i=Lt.createComment(r+":start"),o=e.element=Lt.createComment(r+":end");if(e.signature=r,e.start=i,e.template=Qt.cloneNode(!1),"repeat"===t){var l=n.parentNode;l.replaceChild(o,n),l.insertBefore(i,o),e.template.appendChild(n)}else{for(;n.firstChild;)e.template.appendChild(n.firstChild);n.appendChild(i),n.appendChild(o),l=n}if(e.element=o,a)var s=avalon.bind(l,"datasetchanged",function(){a.apply(l,l.args),avalon.unbind(l,"datasetchanged",s),l.msRendered=a})}},update:function(e,t){var n=this,a=this.xtype;this.enterCount+=1;var r=!t;if(r){n.$outer={};var i="$key",o="$val";"array"===a&&(i="$first",o="$last");for(var l,s=0;l=n.vmodels[s++];)if(l.hasOwnProperty(i)&&l.hasOwnProperty(o)){n.$outer=l;break}}var c=this.track;if(n.sortedCallback){var u=n.sortedCallback.call($,c);u&&Array.isArray(u)&&(c=u)}var d="move";n.$repeat=e;var p=[],v=r&&Qt.cloneNode(!1),h=[],m=this.param,g=avalon.mix({},this.cache),y=this.element,b=c.length,$=y.parentNode;for(s=0;b>s;s++){var x=c[s],w=g[x];if(w)p.push({}),g[x]=!0;else{w=kt(this),"array"===a?(d="add",w.$id=x,w[m]=e[s]):(d="append",w.$key=x,w.$val=e[x]),this.cache[x]=w;var C=w.$anchor||(w.$anchor=y.cloneNode(!1));C.nodeValue=this.signature,Ct(n,v,w,p,r&&!n.effectDriver),Tt(w,n,a)}1===this.enterCount&&(w.$active=!1,w.$oldIndex=w.$index,w.$active=!0,w.$index=s),"array"===a?(w.$first=0===s,w.$last=s===b-1):w.$val=N(e[x]),h.push(w)}if(this.proxies=h,r&&!n.effectDriver)$.insertBefore(v,y),p.forEach(function(e){nt(e.nodes||[],e.vmodels),e.nodes=e.vmodels=null});else{var k=n.staggerIndex=0;for(x in g)g[x]!==!0&&(d="del",wt(g[x].$anchor,n),Mt(this.cache,x,m),g[x]=null);for(s=0;b>s;s++){w=h[s],x="array"===a?w.$id:w.$key;var A=h[s-1],T=A?A.$anchor:n.start;g[x]?w.$index!==w.$oldIndex&&!function(e,t){k=xt(n.effectEnterStagger,function(){var a=wt(e.$anchor),r=avalon.slice(a.childNodes);$.insertBefore(a,t.nextSibling),$t(r,1,n)},k)}(w,T):!function(e,t){var a=e.nodes,r=e.vmodels;a&&(k=xt(n.effectEnterStagger,function(){$.insertBefore(e.content,t.nextSibling),nt(a,r),$t(a,1,n)},k)),e.nodes=e.vmodels=null}(p[s],T)}}if(!e.$track)for(x in this.cache)Mt(this.cache,x,m);!function(e){$.args=e,$.msRendered&&$.msRendered.apply($,e)}(f.newWatch?arguments:[d]);var E=setTimeout(function(){clearTimeout(E),avalon.fireDom($,"datasetchanged",{bubble:$.msHasEvent})});this.enterCount-=1}}),"with,each".replace(Vt,function(e){ln[e]=avalon.mix({},ln.repeat,{priority:1400})});var Ua=[],za=[];avalon.directive("text",{update:function(e){var t=this.element;if(e=null==e?"":e,3===t.nodeType)try{t.data=e}catch(n){}else t.textContent=e}}),avalon.parseDisplay=jt,avalon.directive("visible",{init:function(){},update:function(e){var t=this.element,n=this,a=n.stamp=+new Date;e?(t.style.display="none",avalon.effect.apply(t,1,function(){if(a===n.stamp){var e=t.getAttribute("data-effect-driver")||"a";/^[atn]/.test(e)&&(this.effectName||(t.style.display=""),"none"===avalon(t).css("display")&&(t.style.display=jt(t.nodeName)))}})):avalon.effect.apply(t,0,function(){a===n.stamp&&(t.style.display="none")})}});var Wa=/]*>([\S\s]*?)<\/script\s*>/gim,Xa=/\s+(on[^=\s]+)(?:=("[^"]*"|'[^']*'|[^\s>]+))?/g,Ya=/<\w+\b(?:(["'])[^"]*?(\1)|[^>])*>/gi,Ga={a:/\b(href)\=("javascript[^"]*"|'javascript[^']*')/gi,img:/\b(src)\=("javascript[^"]*"|'javascript[^']*')/gi,form:/\b(action)\=("javascript[^"]*"|'javascript[^']*')/gi},Za=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Ja=/([^\#-~| |!])/g,Ka=avalon.filters={uppercase:function(e){return e.toUpperCase()},lowercase:function(e){return e.toLowerCase()},truncate:function(e,t,n){return t=t||30,n="string"==typeof n?n:"...",e.length>t?e.slice(0,t-n.length)+n:String(e)},$filter:function(e){for(var t=1,n=arguments.length;n>t;t++){var a=arguments[t],r=avalon.filters[a[0]];if("function"==typeof r){var i=[e].concat(a.slice(1));e=r.apply(null,i)}}return e},camelize:q,sanitize:function(e){return e.replace(Wa,"").replace(Ya,function(e){var t=e.toLowerCase().match(/<(\w+)\s/);if(t){var n=Ga[t[1]];n&&(e=e.replace(n,function(e,t,n){var a=n.charAt(0);return t+"="+a+"javascript:void(0)"+a}))}return e.replace(Xa," ").replace(/\s+/g," ")})},escape:function(e){return String(e).replace(/&/g,"&").replace(Za,function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1);return"&#"+(1024*(t-55296)+(n-56320)+65536)+";"}).replace(Ja,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")},currency:function(e,t,n){return(t||"¥")+St(e,isFinite(n)?n:2)},number:St};!new function(){function e(e){return parseInt(e,10)||0}function t(e,t,n){var a="";for(0>e&&(a="-",e=-e),e=""+e;e.length0||o>-a)&&(o+=a),0===o&&-12===a&&(o=12),t(o,n,r)}}function a(e,t){return function(n,a){var r=n["get"+e](),i=(t?"SHORT"+e:e).toUpperCase();return a[i][r]}}function r(e){var n=-1*e.getTimezoneOffset(),a=n>=0?"+":"";return a+=t(Math[n>0?"floor":"ceil"](n/60),2)+t(Math.abs(n%60),2)}function i(e,t){return e.getHours()<12?t.AMPMS[0]:t.AMPMS[1]}var o={yyyy:n("FullYear",4),yy:n("FullYear",2,0,!0),y:n("FullYear",1),MMMM:a("Month"),MMM:a("Month",!0),MM:n("Month",2,1),M:n("Month",1,1),dd:n("Date",2),d:n("Date",1),HH:n("Hours",2),H:n("Hours",1),hh:n("Hours",2,-12),h:n("Hours",1,-12),mm:n("Minutes",2),m:n("Minutes",1),ss:n("Seconds",2),s:n("Seconds",1),sss:n("Milliseconds",3),EEEE:a("Day"),EEE:a("Day",!0),a:i,Z:r},l=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,s=/^\/Date\((\d+)\)\/$/;Ka.date=function(t,n){var a,r,i=Ka.date.locate,c="",u=[];if(n=n||"mediumDate",n=i[n]||n,"string"==typeof t)if(/^\d+$/.test(t))t=e(t);else if(s.test(t))t=+RegExp.$1;else{var f=t.trim(),d=[0,0,0,0,0,0,0],p=new Date(0);f=f.replace(/^(\d+)\D(\d+)\D(\d+)/,function(t,n,a,r){var i=4===r.length?[r,n,a]:[n,a,r];return d[0]=e(i[0]),d[1]=e(i[1])-1,d[2]=e(i[2]),""});var v=p.setFullYear,h=p.setHours;f=f.replace(/[T\s](\d+):(\d+):?(\d+)?\.?(\d)?/,function(t,n,a,r,i){return d[3]=e(n),d[4]=e(a),d[5]=e(r),i&&(d[6]=Math.round(1e3*parseFloat("0."+i))),""});var m=0,g=0;f=f.replace(/Z|([+-])(\d\d):?(\d\d)/,function(t,n,a,r){return v=p.setUTCFullYear,h=p.setUTCHours,n&&(m=e(n+a),g=e(n+r)),""}),d[3]-=m,d[4]-=g,v.apply(p,d.slice(0,3)),h.apply(p,d.slice(3)),t=p}if("number"==typeof t&&(t=new Date(t)),"date"===avalon.type(t)){for(;n;)r=l.exec(n),r?(u=u.concat(r.slice(1)),n=u.pop()):(u.push(n),n=null);return u.forEach(function(e){a=o[e],c+=a?a(t,i):e.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),c}};var c={AMPMS:{0:"上午",1:"下午"},DAY:{0:"星期日",1:"星期一",2:"星期二",3:"星期三",4:"星期四",5:"星期五",6:"星期六"},MONTH:{0:"1月",1:"2月",2:"3月",3:"4月",4:"5月",5:"6月",6:"7月",7:"8月",8:"9月",9:"10月",10:"11月",11:"12月"},SHORTDAY:{0:"周日",1:"周一",2:"周二",3:"周三",4:"周四",5:"周五",6:"周六"},fullDate:"y年M月d日EEEE",longDate:"y年M月d日",medium:"yyyy-M-d H:mm:ss",mediumDate:"yyyy-M-d",mediumTime:"H:mm:ss","short":"yy-M-d ah:mm",shortDate:"yy-M-d",shortTime:"ah:mm"};c.SHORTMONTH=c.MONTH,Ka.date.locate=c};var Qa=avalon.modules={"domReady!":{exports:avalon,state:3},avalon:{exports:avalon,state:4}};Qa.exports=Qa.avalon,new function(){function t(e,t){var a="js";e=e.replace(/^(\w+)\!/,function(e,t){return a=t,""}),"ready"===a&&(n("debug: ready!已经被废弃,请使用domReady!"),a="domReady");var r="";e=e.replace(D,function(e){return r=e,""});var i="."+a,o=/js|css/.test(i)?i:"";e=e.replace(/\.[a-z0-9]+$/g,function(e){return e===i?(o=e,""):e});var l=avalon.mix({query:r,ext:o,res:a,name:e,toUrl:m},t);return l.toUrl(e),l}function i(e){var t=e.name,n=e.res,a=Qa[t],r=t&&e.urlNoQuery;if(a&&a.state>=1)return t;if(a=Qa[r],a&&a.state>=3)return Rt(a.deps||[],a.factory,r),r;if(t&&!a){a=Qa[r]={id:r,state:1};var i=function(r){L[n]=r,r.load(t,e,function(e){arguments.length&&void 0!==e&&(a.exports=e),a.state=4,c()})};L[n]?i(L[n]):Rt([n],i)}return t?r:n+"!"}function l(e,t){for(var n,a=0;n=e[a++];)if(4!==Qa[n].state&&(n===t||l(Qa[n].deps,t)))return!0}function s(e,t){var a=d(e.src);return e.onload=e.onerror=null,t?(setTimeout(function(){Dt.removeChild(e),e=null}),void n("debug: 加载 "+a+" 失败"+t+" "+!Qa[a].state)):!0}function c(){e:for(var e,t=N.length;e=N[--t];){var n=Qa[e],a=n.deps;if(a){for(var r,i=0;r=a[i];i++)if(4!==Object(Qa[r]).state)continue e;4!==n.state&&(N.splice(t,1),h(n.id,n.deps,n.factory),c())}}}function u(e,t,a){var r=Lt.createElement("script");r.className=Bt,r.onload=function(){var r=A.pop();r&&r.require(t),a&&a(),n("debug: 已成功加载 "+e),t&&N.push(t),c()},r.onerror=function(){s(r,!0)},Dt.insertBefore(r,Dt.firstChild),r.src=e,n("debug: 正准备加载 "+e)}function d(e){return(e||"").replace(D,"")}function p(e){return/^(?:[a-z]+:)?\/\//i.test(String(e))}function v(){var e;try{a.b.c()}catch(t){e=t.stack}if(e)return e=e.split(/[@ ]/g).pop(),e="("===e[0]?e.slice(1,-1):e.replace(/\s/,""),d(e.replace(/(:\d+)?:\d+$/i,""));for(var n,r=Dt.getElementsByTagName("script"),i=r.length;n=r[--i];)if(n.className===Bt&&"interactive"===n.readyState){var o=n.src;return n.className=d(o)}}function h(t,a,i){var o=Object(Qa[t]);o.state=4;for(var l,s=0,c=[];l=a[s++];)if("exports"===l){var u=o.exports||(o.exports=r());c.push(u)}else c.push(Qa[l].exports);try{var f=i.apply(e,c)}catch(d){n("执行["+t+"]模块的factory抛错: ",d)}return void 0!==f&&(o.exports=f),R.test(t)&&delete Qa[t],delete o.factory,f}function m(e){0===e.indexOf(this.res+"!")&&(e=e.slice(this.res.length+1));var t=e,n=0,a=this.baseUrl,r=this.parentUrl||a;x(e,f.paths,function(e,a){t=t.replace(a,e),n=1}),n||x(e,f.packages,function(e,n,a){t=t.replace(a.name,a.location) +}),this.mapUrl&&x(this.mapUrl,f.map,function(e){x(t,e,function(e,n){t=t.replace(n,e),r=a})});var i=this.ext;i&&n&&t.slice(-i.length)===i&&(t=t.slice(0,-i.length)),p(t)||(r=this.built||/^\w/.test(t)?a:r,t=C(r,t));var o=t+i;return t=o+this.query,o=t.replace(D,function(e){return this.query=e,""}),x(e,f.urlArgs,function(e){t+=(-1===t.indexOf("?")?"?":"&")+e}),this.url=t,this.urlNoQuery=o}function g(e,t,n){var a=$(e,t,n);return a.sort(w),a}function y(e){return new RegExp("^"+e+"(/|$)")}function b(t){return function(){var n;return t.init&&(n=t.init.apply(e,arguments)),n||t.exports&&k(t.exports)}}function $(e,t,n){var a=[];for(var r in e){var i={name:r,val:e[r]};a.push(i),i.reg="*"===r&&t?/^/:y(r),n&&"*"!==r&&(i.reg=new RegExp("/"+r.replace(/^\//,"")+"(/|$)"))}return a}function x(e,t,n){t=t||[];for(var a,r=0;a=t[r++];)if(a.reg.test(e))return n(a.val,a.name,a),!1}function w(e,t){var n=e.name,a=t.name;return"*"===a?-1:"*"===n?1:a.length-n.length}function C(e,t){if("/"!==e.charAt(e.length-1)&&(e+="/"),"./"===t.slice(0,2))return e+t.slice(2);if(".."===t.slice(0,2)){for(e+=t;q.test(e);)e=e.replace(q,"");return e}return"/"===t.slice(0,1)?e+t.slice(1):e+t}function k(t){if(!t)return t;var n=e;return t.split(".").forEach(function(e){n=n[e]}),n}var N=[],A=[],T=/\.js$/i,E=[],O=!1;Rt=avalon.require=function(e,n,a,l){if(O){Array.isArray(e)||avalon.error("require方法的第一个参数应为数组 "+e);var s=[],u=r(),d=a||"callback"+setTimeout("1");l=l||r(),l.baseUrl=f.baseUrl;var p=!!l.built;if(a&&(l.parentUrl=a.substr(0,a.lastIndexOf("/")),l.mapUrl=a.replace(T,"")),p){var v=t(l.defineName,l);d=v.urlNoQuery}else e.forEach(function(e){var n=t(e,l),a=i(n);a&&(u[a]||(s.push(a),u[a]="司徒正美"))});var h=Qa[d];h&&4===h.state||(Qa[d]={id:d,deps:p?e.concat():s,factory:n||o,state:3}),h||N.push(d),c()}else if(E.push(avalon.slice(arguments)),arguments.length<=2){O=!0;for(var m,g=E.splice(0,E.length);m=g.shift();)Rt.apply(null,m)}},Rt.define=function(e,t,n){"string"!=typeof e&&(n=t,t=e,e="anonymous"),Array.isArray(t)||(n=t,t=[]);var a={built:!O,defineName:e},r=[t,n,a];n.require=function(e){if(r.splice(2,0,e),Qa[e]){Qa[e].state=3;var t=!1;try{t=l(Qa[e].deps,e)}catch(a){}t&&avalon.error(e+"模块与之前的模块存在循环依赖,请不要直接用script标签引入"+e+"模块")}delete n.require,Rt.apply(null,r)};var i=a.built?"unknown":v();if(i){var o=Qa[i];o&&(o.state=2),n.require(i)}else A.push(n)},Rt.config=f,Rt.define.amd=Qa;var M=f["orig.paths"]=r(),j=f["orig.map"]=r(),S=f.packages=[],H=f["orig.args"]=r();avalon.mix(yn,{paths:function(e){avalon.mix(M,e),f.paths=g(M)},map:function(e){avalon.mix(j,e);var t=g(j,1,1);avalon.each(t,function(e,t){t.val=g(t.val)}),f.map=t},packages:function(e){e=e.concat(S);for(var t,n=r(),a=[],i=0;t=e[i++];){t="string"==typeof t?{name:t}:t;var o=t.name;if(!n[o]){var l=C(t.location||o,t.main||"main");l=l.replace(T,""),a.push(t),n[o]=t.location=l,t.reg=y(o)}}f.packages=a.sort()},urlArgs:function(e){"string"==typeof e&&(e={"*":e}),avalon.mix(H,e),f.urlArgs=g(H,1)},baseUrl:function(e){if(!p(e)){var t=Dt.getElementsByTagName("base")[0];t&&Dt.removeChild(t);var n=Lt.createElement("a");n.href=e,e=n.href,t&&Dt.insertBefore(t,Dt.firstChild)}e.length>3&&(f.baseUrl=e)},shim:function(e){for(var t in e){var n=e[t];Array.isArray(n)&&(n=e[t]={deps:n}),n.exportsFn||!n.exports&&!n.init||(n.exportsFn=b(n))}f.shim=e}});var L=Rt.plugins={domReady:{load:o},js:{load:function(e,t,n){var a=t.url,r=t.urlNoQuery,i=f.shim[e.replace(T,"")];i?Rt(i.deps||[],function(){var e=avalon.slice(arguments);u(a,r,function(){n(i.exportsFn?i.exportsFn.apply(0,e):void 0)})}):u(a,r)}},css:{load:function(e,t,a){var r=t.url;Dt.insertAdjacentHTML("afterBegin",''),n("debug: 已成功加载 "+r),a()}},text:{load:function(e,t,a){var r=t.url,i=Fa();i.onload=function(){var e=i.status;e>399&&600>e?avalon.error(r+" 对应资源不存在或没有开启 CORS"):(n("debug: 已成功加载 "+r),a(i.responseText))};var o="_="+(new Date-0),l=-1===r.indexOf("?")?r+"?"+o:r+"&"+o;i.open("GET",l,!0),"withCredentials"in i&&(i.withCredentials=!0),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.send(),n("debug: 正准备加载 "+r)}}};Rt.checkDeps=c;var D=/(\?[^#]*)$/,R=/^callback\d+$/,q=/\/\w+\/\.\./,B=Lt.scripts[Lt.scripts.length-1],P=B.getAttribute("data-main");if(P){yn.baseUrl(P);var F=f.baseUrl;f.baseUrl=F.slice(0,F.lastIndexOf("/")+1),u(F.replace(T,"")+".js")}else{var _=d(B.src);f.baseUrl=_.slice(0,_.lastIndexOf("/")+1)}};var er,tr=[],nr=function(e){for(er=!0,Rt&&(Qa["domReady!"].state=4,Rt.checkDeps());e=tr.shift();)e(avalon)};"complete"===Lt.readyState?setTimeout(nr):Lt.addEventListener("DOMContentLoaded",nr),e.addEventListener("load",nr),avalon.ready=function(e){er?e(avalon):tr.push(e)},avalon.config({loader:!0}),avalon.ready(function(){avalon.scan(Lt.body)}),"function"==typeof define&&define.amd&&define("avalon",[],function(){return avalon});var ar=e.avalon;return avalon.noConflict=function(t){return t&&e.avalon===avalon&&(e.avalon=ar),avalon},void 0===t&&(e.avalon=avalon),avalon}); \ No newline at end of file diff --git a/dist/avalon.modern.shim.js b/dist/avalon.modern.shim.js index cdcfd0b31..30fd4dd42 100644 --- a/dist/avalon.modern.shim.js +++ b/dist/avalon.modern.shim.js @@ -5,7 +5,7 @@ http://weibo.com/jslouvre/ Released under the MIT license - avalon.modern.shim.js 1.5.3 built in 2015.10.4 + avalon.modern.shim.js 1.5.3 built in 2015.10.9 support IE10+ and other browsers ==================================================*/ (function(global, factory) { @@ -870,7 +870,7 @@ function observeObject(source, options) { options = options || nullObject var force = options.force || nullObject var old = options.old - var oldAccessors = typeof old === "object" ? old.$accessors : nullObject + var oldAccessors = old && old.$accessors || nullObject var $vmodel = new Component() //要返回的对象, 它在IE6-8下可能被偷龙转凤 var accessors = {} //监控属性 var hasOwn = {} @@ -2678,10 +2678,10 @@ function scanExpr(str) { } function scanText(textNode, vmodels, index) { - var bindings = [] + var bindings = [], tokens = scanExpr(textNode.data) if (tokens.length) { - for (var i = 0; token = tokens[i++];) { + for (var i = 0, token; token = tokens[i++];) { var node = DOC.createTextNode(token.expr) //将文本转换为文本节点,并替换原来的文本节点 if (token.type) { token.expr = token.expr.replace(roneTime, function () { diff --git a/dist/avalon.modern.shim.min.js b/dist/avalon.modern.shim.min.js index 82c9ba9d4..6308b6104 100644 --- a/dist/avalon.modern.shim.min.js +++ b/dist/avalon.modern.shim.min.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("Avalon requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(){avalon.config.debug&&console.log.apply(console,arguments)}function a(){return Object.create(null)}function r(e){return Function.apply(i,e)}function i(){}function o(e,t){"string"==typeof e&&(e=e.match(Ft)||[]);for(var n={},a=void 0!==t?t:1,r=0,i=e.length;i>r;r++)n[e[r]]=a;return n}function l(){if(e.VBArray){var t=document.documentMode;return t?t:e.XMLHttpRequest?7:6}return 0/0}function s(e){if(e&&"object"==typeof e){var t=e.length,n=Ut.call(e);if(/(Array|List|Collection|Map|Arguments)\]$/.test(n))return!0;if("[object Object]"===n&&t===t>>>0)return!0}return!1}function c(e,t){if(e&&e.childNodes)for(var n,a=e.childNodes,r=0;n=a[r++];)if(n.tagName){var i=Ht.createElementNS(sn,n.tagName.toLowerCase());Xt.forEach.call(n.attributes,function(e){i.setAttribute(e.name,e.value)}),c(n,i),t.appendChild(i)}}function u(e){for(var t in e)if(Yt.call(e,t)){var n=e[t];"function"==typeof u.plugins[t]?u.plugins[t](n):"object"==typeof u[t]?avalon.mix(u[t],n):u[t]=n}return this}function f(e){return(e+"").replace(mn,"\\$&")}function d(e,t){var n=this.$events||(this.$events={}),a=n[e]||(n[e]=[]);if("function"==typeof t){var r=t;r.uniqueNumber=Math.random(),t={element:Jt,type:"user-watcher",handler:i,vmodels:[this],expr:e,uniqueNumber:r.uniqueNumber},t.wildcard=/\*/.test(e)}if(t.update)t.oneTime||avalon.Array.ensure(a,t);else{if(/\w\.*\B/.test(e)){t.getter=i;var o=this;t.update=function(){var e=this.fireArgs||[];e[2]&&t.handler.apply(o,e),delete this.fireArgs},a.sync=!0,avalon.Array.ensure(a,t)}else avalon.injectBinding(t);r&&(t.handler=r)}return function(){t.update=t.getter=t.handler=i,t.element=Ht.createElement("a")}}function v(e,t){var n=this.$events;if(n&&n[e]){t&&(t[2]=e),h(n[e],t);var a=this.$up;a&&(this.$pathname&&v.call(a,this.$pathname+"."+e,t),v.call(a,"*."+e,t))}else if(a=this.$up){var r=this.$pathname+"."+e,i=r.split(".");-1===i.indexOf("*")?(v.call(a,r,t),i[1]="*",v.call(a,i.join("."),t)):v.call(a,r,t)}}function p(e,t){for(;;){if(e.$watch){var n=e.$events||(e.$events={}),a=n[t]||(n[t]=[]);return void Nn.collectDependency(a)}if(e=e.$up,!e)break;t=e.$pathname+"."+t}}function h(e,t){if(e){new Date-En>444&&"object"==typeof e[0]&&S();for(var n,a=[],r=[],i=0;n=e[i++];)"user-watcher"===n.type?a.push(n):r.push(n);if(u.async){for(ma.render(),i=0;n=r[i++];)if(n.update){var o=M(n);ma.queue[o]||(ma.queue[o]=1,ma.queue.push(n))}}else for(i=0;n=r[i++];)n.update&&n.update();for(i=0;n=a[i++];)(t&&t[2]===n.expr||n.wildcard)&&(n.fireArgs=t),n.update()}}function m(e,t){return t=t||{},t.watch=!0,y(e,t)}function g(){}function y(e,t){function a(e){return u[e]===!0}if(!e||e.$id&&e.$accessors)return e;t=t||_t;var r=t.force||_t,i=t.old,l="object"==typeof i?i.$accessors:_t,s=new g,c={},u={},f=[],p=[],h={};e.$skipArray&&(h=o(e.$skipArray),delete e.$skipArray);var m=e.$computed;if(m){delete e.$computed;for(var y in m)u[y]=!0,function(e,t){var n;c[e]={get:function(){return n=t.get.call(this)},set:function(a){if("function"==typeof t.set){var r=n;t.set.call(this,a);var i=this[e];this.$fire&&i!==r&&this.$fire(e,i,r)}},enumerable:!0,configurable:!0}}(y,m[y])}for(y in e){var x=e[y];bn[y]||(u[y]=!0),"function"==typeof x||x&&x.nodeType||!r[y]&&("$"===y.charAt(0)||bn[y]||h[y])?f.push(y):b(x)?(n("warning:计算属性建议放在$computed对象中统一定义"),function(e,t){var n;c[e]={get:function(){return n=t.get.call(this)},set:function(a){if("function"==typeof t.set){var r=n;t.set.call(this,a);var i=this[e];this.$fire&&i!==r&&this.$fire(e,i,r)}},enumerable:!0,configurable:!0}}(y,x)):(p.push(y),c[y]=l[y]?l[y]:$(y,x))}c.$model=$n,s=Object.defineProperties(s,c,e),f.forEach(function(t){s[t]=e[t]}),C(s,"$id","anonymous"),C(s,"$up",i?i.$up:null),C(s,"$track",Object.keys(u)),C(s,"$active",!1),C(s,"$pathname",i?i.$pathname:""),C(s,"$accessors",c),C(s,"hasOwnProperty",a),t.watch&&(C(s,"$watch",function(){return d.apply(s,arguments)}),C(s,"$fire",function(e,t){if(0===e.indexOf("all!")){var n=e.slice(4);for(var a in avalon.vmodels){var r=avalon.vmodels[a];r.$fire&&r.$fire.apply(r,[n,t])}}else v.call(s,e,[t])})),p.forEach(function(t){var n=s[t]=e[t];n&&"object"==typeof n&&(n.$up=s,n.$pathname=t),v.call(s,t)});for(y in m)x=s[y];return s.$active=!0,s}function b(e){if(e&&"object"==typeof e){for(var t in e)if("get"!==t&&"set"!==t)return!1;return"function"==typeof e.get}}function $(e,t){var n,t=0/0;return{get:function(){return this.$active&&p(this,e),t},set:function(a){if(t!==a){var r=t;n=x(a,t),n?t=n:(n=void 0,t=a),Object(n)===n&&(n.$pathname=e,n.$up=this),this.$active&&v.call(this,e,[t,r])}},enumerable:!0,configurable:!0}}function x(e,t,n,a){if(Array.isArray(e))return w(e,t,a);if(avalon.isPlainObject(e)){if(t){var r=Object.keys(e),i=Object.keys(t);if(r.join(";")===i.join(";")){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);return t}t.$active=!1}return y(e,{old:t,watch:a})}return n?e:void 0}function w(e,t,n){if(t){var a=[0,t.length].concat(e);return t.splice.apply(t,a),t}for(var r in Cn)e[r]=Cn[r];C(e,"$up",null),C(e,"$pathname",""),C(e,"$track",A(e.length)),e._=y({length:0/0},{watch:!0}),e._.length=e.length,e._.$watch("length",function(t,n){v.call(e.$up,e.$pathname+".length",[t,n])}),n&&C(e,"$watch",function(){return d.apply(e,arguments)}),Object.defineProperty(e,"$model",$n);for(var i=0,o=e.length;o>i;i++){var l=e[i]=x(e[i],0,1,1);Object(l)===l&&(l.$up=e)}return e}function C(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!1,configurable:!0})}function k(e){var t=avalon.type(e);if("array"===t){for(var n=[],a=0;aa;a++){n[a]=e[a];var i=t[a];i in n?(e[a]=n[i],delete n[i]):e[a]=e[i]}}function A(e){for(var t=[],n=0;e>n;n++)t[n]=en("$proxy$each");return t}function T(e,t,n){switch(t){case"push":case"unshift":n=A(n.length);break;case"splice":if(n.length>2){{n[1],n.length-2}n=[n[0],n[1]].concat(A(n.length-2))}}Array.prototype[t].apply(e,n)}function E(e,t){t.oneTime||e&&avalon.Array.ensure(e,t)&&t.element&&(j(t,e),new Date-En>444&&S())}function O(e,t){for(var n,a=[],r=0;n=e[r++];)a.push(t?n.$id:n.$key);return a.join(";")}function M(e){if(!e.uniqueNumber){var t=e.element;e.uniqueNumber=t?1!==t.nodeType?e.type+(e.pos||0)+"-"+M(t.parentNode):e.name+"-"+M(t):++An}return e.uniqueNumber}function j(e,t){var n=e.lists||(e.lists=[]),a=M(e);avalon.Array.ensure(n,t),t.$uuid=t.$uuid||en(),Tn[a]||(Tn[a]=1,Tn.push(e))}function S(e){for(var t=Tn.length,n=t,a=[],r={},i={};e=Tn[--t];){var o=e.type;i[o]?i[o]++:(i[o]=1,a.push(o))}var l=!1;if(a.forEach(function(e){On[e]!==i[e]&&(r[e]=1,l=!0)}),t=n,l)for(;e=Tn[--t];)if(null!==e.element){if(r[e.type]&&L(e.element)){Tn.splice(t,1),delete Tn[e.uniqueNumber];for(var s,c=e.lists,u=0;s=c[u++];)avalon.Array.remove(c,s),avalon.Array.remove(s,e);H(e)}}else Tn.splice(t,1);On=i,En=new Date}function H(e){delete Tn[e.uniqueNumber],e.element=null,e.rollback&&e.rollback();for(var t in e)e[t]=null}function L(e){try{{e.parentNode.nodeType}}catch(t){return!0}return e.ifRemove&&!Jt.contains(e.ifRemove)&&Rt===e.parentNode?(e.parentNode&&e.parentNode.removeChild(e),!0):e.msRetain?0:1===e.nodeType?!Jt.contains(e):!avalon.contains(Jt,e)}function D(e){return e.replace(/([a-z\d])([A-Z]+)/g,"$1-$2").toLowerCase()}function R(e){return e.indexOf("-")<0&&e.indexOf("_")<0?e:e.replace(/[-_][^-_]/g,function(e){return e.charAt(1).toUpperCase()})}function P(e){try{if("object"==typeof e)return e;e="true"===e?!0:"false"===e?!1:"null"===e?null:+e+""===e?+e:Rn.test(e)?JSON.parse(e):e}catch(t){}return e}function B(e){return e.window&&e.document?e:9===e.nodeType?e.defaultView:!1}function q(e,t){if(e.offsetWidth<=0){var n=getComputedStyle(e,null);if(Fn.test(n.display)){var a={node:e};for(var r in _n)a[r]=n[r],e.style[r]=_n[r];t.push(a)}var i=e.parentNode;i&&1===i.nodeType&&q(i,t)}}function _(e){var t=e.tagName.toLowerCase();return"input"===t&&/checkbox|radio/.test(e.type)?"checked":t}function F(e,t){var n=[],a=!!t;t=t||0;for(var i="unknown",o="",l=0;lu;u++)if(i.length){var d="vm"+o+"_"+u;s.push(d),c.push(t[u]),l.push.apply(l,I(i,t[u],d,n))}n.args=c;var v=n.type,p=t.map(function(e){return String(e.$id).replace(Un,"$1")})+e+v,h=Gn.get(p);if(h){if("duplex"===v){var m=Gn.get(p+"setter");n.setter=m.apply(m,n.args)}return n.getter=h}if(l.length||l.push("fix"+o),"duplex"===v){var g={};l.forEach(function(e){var t=e.split("=");g[t[0].trim()]=t[1].trim()}),e=e.replace(/[\$\w]+/,function(e){return g[e]?g[e]:e});var y=r(s.concat("'use strict';return function(vvv){"+e+" = vvv\n}\n"));Gn.put(p+"setter",y),n.setter=y.apply(y,n.args)}if("on"===v){-1===e.indexOf("(")?e+=".call(this, $event)":e=e.replace("(",".call(this,"),s.push("$event"),e="\nreturn "+e+";";var b=e.lastIndexOf("\nreturn"),$=e.slice(0,b),x=e.slice(b);e=$+"\n"+x}else e="\nreturn "+e+";";return h=r(s.concat("'use strict';\nvar "+l.join(",\n")+e)),Gn.put(p,h)}function Y(e){var t=vn.test(e);if(t){var n=rt(e);return 1===n.length?n[0].expr:n.map(function(e){return e.type?"("+e.expr+")":ta(e.expr)}).join(" + ")}return e}function U(e){return e=e.replace(Zn,"").replace(Jn,function(){return"],|"}).replace(Kn,function(e,t){return"["+ta(t)}).replace(Qn,function(){return'"],["'}).replace(ea,function(){return'",'})+"]",r(["return ["+e+"]"])()}function X(e,t,n){var a=setTimeout(function(){var r=e.innerHTML;clearTimeout(a),r===n?t():X(e,t,r)})}function G(e,t){var n=e.getAttribute("avalonctrl")||t.$id;e.setAttribute("avalonctrl",n),t.$events&&(t.$events.expr=e.tagName+'[avalonctrl="'+n+'"]')}function Z(e,t){for(var n,a=0;n=e[a++];)n.vmodels=t,on[n.type].init(n),avalon.injectBinding(n),n.getter&&1===n.element.nodeType&&n.element.removeAttribute(n.name);e.length=0}function J(e,t){return e.priority-t.priority}function K(e,t,a){var r=!0;if(t.length){for(var i,o=e.attributes,l=[],s={},c=0;i=o[c++];){var u=i.name;if(!s[u]&&(s[u]=1,i.specified&&(a=u.match(oa)))){var f=a[1],d=a[2]||"",v=i.value;if(la[f]?(d=f,f="on"):sa[f]&&(d=f,f="attr",u="ms-"+f+"-"+d,n("warning!请改用"+u+"代替"+i.name+"!")),on[f]){var p=v.replace(ia,""),h=v!==p,m={type:f,param:d,element:e,name:u,expr:p,oneTime:h,priority:(on[f].priority||10*f.charCodeAt(0))+(Number(d.replace(/\D/g,""))||0)};if("html"===f||"text"===f){var g=at(v).filters;m.expr=m.expr.replace(g,""),m.filters=g.replace(da,function(){return m.type="html",m.group=1,""}).trim()}else if("duplex"===f)var y=u;else if("ms-if-loop"===u)m.priority+=100;else if("ms-attr-value"===u)var b=u;l.push(m)}}}if(l.length){for(l.sort(J),y&&b&&"text"===e.type&&n("warning!一个控件不能同时定义ms-attr-value与"+y),c=0;m=l[c];c++){if(f=m.type,ca.test(f))return Z(l.slice(0,c+1),t);r&&(r=!ua.test(f))}Z(l,t)}}r&&!na[e.tagName]&&(ra&&ra(e),et(e,t))}function Q(e){for(var t,n=e.attributes,a={},r=0;t=n[r++];)t.specified&&!fa.test(t.name)&&(a[R(t.name)]=P(t.value));return a}function et(e,t){var n=avalon.slice(e.childNodes);tt(n,t)}function tt(e,t){for(var n,a=0;n=e[a++];)switch(n.nodeType){case 1:var r=n;if(nt(n,t),!r.msResolved&&r.parentNode&&1===r.parentNode.nodeType){var i=lt(r);if(i){var o=r.localName?r.localName.replace(i+":",""):r.nodeName,l=i+":"+R(o);ga.push({library:i,element:r,fullName:l,widget:o,vmodels:t,name:"widget"}),avalon.components[l]&&avalon.component(l)}}n.msHasEvent&&avalon.fireDom(n,"datasetchanged",{bubble:n.msHasEvent});break;case 3:vn.test(n.nodeValue)&&it(n,t,a)}}function nt(e,t,n){var a=e.getAttribute("ms-skip"),r=e.getAttributeNode("ms-important"),i=e.getAttributeNode("ms-controller");if("string"!=typeof a){if(n=r||i){var o=avalon.vmodels[n.value];if(!o)return;t=n===r?[o]:[o].concat(t),e.removeAttribute(n.name),e.classList.remove(n.name),G(e,o)}K(e,t)}}function at(e){if(e.indexOf("|")>0){var t=e.replace(pa,function(e){return Array(e.length+1).join("1")}),n=t.replace(va,"ᄢ㍄").indexOf("|");if(n>-1)return{type:"text",filters:e.slice(n).trim(),expr:e.slice(0,n)}}return{type:"text",expr:e,filters:""}}function rt(e){for(var t,n,a=[],r=0;;){if(n=e.indexOf(fn,r),-1===n)break;if(t=e.slice(r,n),t&&a.push({expr:t}),r=n+fn.length,n=e.indexOf(dn,r),-1===n)break;t=e.slice(r,n),t&&a.push(at(t,r)),r=n+dn.length}return t=e.slice(r),t&&a.push({expr:t}),a}function it(e,t,n){var a=[];if(tokens=rt(e.data),tokens.length){for(var r=0;token=tokens[r++];){var i=Ht.createTextNode(token.expr);token.type&&(token.expr=token.expr.replace(ia,function(){return token.oneTime=!0,""}),token.element=i,token.filters=token.filters.replace(da,function(){return token.type="html",""}),token.pos=1e3*n+r,a.push(token)),Kt.appendChild(i)}e.parentNode.replaceChild(Kt,e),a.length&&Z(a,t)}}function ot(e,t){if(t)for(var n,a=0;n=e[a++];)if(n.hasOwnProperty(t)&&"object"==typeof n[t]){var r=n[t];return r.$model||r}return{}}function lt(e){if(e.scopeName&&"HTML"!==e.scopeName)return e.scopeName;var t=e.nodeName.toLowerCase(),n=t.indexOf(":");return n>0?t.slice(0,n):void 0}function st(e){return null==e?"":e}function ct(e,t,n){return t.param.replace(Vt,function(a){var r=avalon.duplexHooks[a];r&&"function"==typeof r[n]&&(e=r[n](e,t))}),e}function ut(){for(var e=Ea.length-1;e>=0;e--){var t=Ea[e];t()===!1&&Ea.splice(e,1)}Ea.length||clearInterval(Ta)}function ft(e,t){if(!e||1!==e.nodeType)return null;if(t)var n=t.effectName,a=t.effectDriver;else n=e.getAttribute("data-effect-name"),a=e.getAttribute("data-effect-driver");if(!n||!a)return null;var r=Ra.pop()||new pt;return r.el=e,r.driver=a,r.useCss="j"!==a,r.useCss&&(t&&avalon(e).addClass(t.effectClass),r.cssEvent="t"===a?Ma:ja),r.name=n,r.callbacks=avalon.effects[n]||{},r}function dt(e,t){var n=e.getAttribute("data-effect-name");if(n){t.effectName=n,t.effectDriver=e.getAttribute("data-effect-driver");var a=+e.getAttribute("data-effect-stagger");t.effectLeaveStagger=+e.getAttribute("data-effect-leave-stagger")||a,t.effectEnterStagger=+e.getAttribute("data-effect-enter-stagger")||a,t.effectClass=e.className||0/0}}function vt(e){return e.replace(/^[\S]/g,function(e){return e.toUpperCase()})}function pt(){}function ht(e,t){var n=e.callbacks[t+"Class"];return"string"==typeof n?n:"function"==typeof n?n():e.name+"-"+t}function mt(e,t,n){var a=e.callbacks[t];a&&a.call(e,e.el,n)}function gt(e,t,n){var a=e.templateCache&&e.templateCache[t];if(a){for(var r,i=Ht.createDocumentFragment();r=a.firstChild;)i.appendChild(r);return i}return avalon.parseHTML(n)}function yt(e){for(var t=Ht.createDocumentFragment(),n=0,a=e.length;a>n;n++)t.appendChild(e[n]);return t}function bt(e,t,n){for(var a,r=0;a=e[r++];)a.className===n.effectClass&&avalon.effect.apply(a,t,i,i,n)}function $t(e,t,n){return e?setTimeout(t,++n*e):t(),n}function xt(e,t){for(var n=Kt.cloneNode(!1),a=e,r=a.nodeValue,o=t&&Math.max(+t.staggerIndex,0),l=avalon.slice(a.parentNode.childNodes),s=l.indexOf(a);;){var c=l[--s];if(!c||0===String(c.nodeValue).indexOf(r))break;t&&c.className===t.effectClass?(e=c,function(e){t.staggerIndex=$t(t.effectLeaveStagger,function(){avalon.effect.apply(e,0,i,function(){n.appendChild(e)},t)},o)}(c)):n.insertBefore(c,n.firstChild)}return n.appendChild(a),n}function wt(e,t,n,a,r){var i=e.template.cloneNode(!0),o=avalon.slice(i.childNodes);i.appendChild(n.$anchor),r&&t.appendChild(i);var l=[n].concat(e.vmodels),s={nodes:o,vmodels:l,content:i};a.push(s)}function Ct(e){var t="object"===e.xtype?Tt:kt,n=t(e),a=n.$anchor||(n.$anchor=e.element.cloneNode(!1));return a.nodeValue=e.signature,n.$outer=e.$outer,n}function kt(e,t){for(var n=e.param||"el",a=0,r=Ia.length;r>a;a++){var i=Ia[a];if(i&&i.hasOwnProperty(n)){Ia.splice(a,1),t=i;break}}return t||(t=Nt(n)),t}function Nt(e){var t={$outer:{},$index:0,$oldIndex:0,$anchor:null,$first:!1,$last:!1,$remove:avalon.noop};t[e]=0/0;var n={$last:1,$first:1,$index:1};n[e]=1;var a=m(t,{force:n});return a.$id=en("$proxy$each"),a}function At(e,t,n){if("array"===n){e.$remove=function(){t.$repeat.removeAt(e.$index)};var a=t.param;e.$watch(a,function(n){var a=e.$index;t.$repeat[a]=n})}else e.$watch("$val",function(n){t.$repeat[e.$key]=n})}function Tt(){return za.pop()||Et()}function Et(){var e=m({$key:"",$val:0/0,$index:0,$oldIndex:0,$outer:{},$anchor:null},{force:{$key:1,$val:1,$index:1}});return e.$id=en("$proxy$with"),e}function Ot(e,t,n){var a=e[t];if(a){var r=0===a.$id.indexOf("$proxy$each")?Ia:za;a.$outer={};for(var i in a.$events){var o=a.$events[i];Array.isArray(o)&&(o.length=0,i===n?a[n]=0/0:"$val"===i&&(a.$val=0/0))}r.unshift(a)>u.maxRepeatSize&&r.pop(),delete e[t]}}function Mt(e,t){var n="_"+e;if(!Mt[n]){var a=Ht.createElement(e);Jt.appendChild(a),t=Zt?getComputedStyle(a,null).display:a.currentStyle.display,Jt.removeChild(a),Mt[n]=t}return Mt[n]}function jt(e,t,n,a){e=(e+"").replace(/[^0-9+\-Ee.]/g,"");var r=isFinite(+e)?+e:0,i=isFinite(+t)?Math.abs(t):3,o=a||",",l=n||".",s="",c=function(e,t){var n=Math.pow(10,t);return""+(Math.round(e*n)/n).toFixed(t)};return s=(i?c(r,i):""+Math.round(r)).split("."),s[0].length>3&&(s[0]=s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,o)),(s[1]||"").length');var Dt,Rt=Lt.firstChild,Pt="$"+St,Bt=e.require,qt=e.define,_t={},Ft=/[^, ]+/g,Vt=/\w+/g,It=/^\[object SVG\w*Element\]$/,zt=/^\[object (?:Window|DOMWindow|global)\]$/,Wt=Object.prototype,Yt=Wt.hasOwnProperty,Ut=Wt.toString,Xt=Array.prototype,Gt=Xt.slice,Zt=e.dispatchEvent,Jt=Ht.documentElement,Kt=Ht.createDocumentFragment(),Qt=(Ht.createElement("div"),{});"Boolean Number String Function Array Date RegExp Object Error".replace(Ft,function(e){Qt["[object "+e+"]"]=e.toLowerCase()});var en=function(e){return e=e||"avalon",String(Math.random()+Math.random()).replace(/\d\.\d{4}/,e)},tn=l();avalon=function(e){return new avalon.init(e)},avalon.nextTick=new function(){function t(){for(var e=r.length,t=0;e>t;t++)r[t]();r=r.slice(e)}var n=e.setImmediate,a=e.MutationObserver;if(n)return n.bind(e);var r=[];if(a){var i=document.createTextNode("avalon");new a(t).observe(i,{characterData:!0});var o=!1;return function(e){r.push(e),o=!o,i.data=o}}return function(e){setTimeout(e,4)}},avalon.init=function(e){this[0]=this.element=e},avalon.fn=avalon.prototype=avalon.init.prototype,avalon.type=function(e){return null==e?String(e):"object"==typeof e||"function"==typeof e?Qt[Ut.call(e)]||"object":typeof e};var nn=function(e){return"[object Function]"===Ut.call(e)};avalon.isFunction=nn,avalon.isWindow=function(e){return zt.test(Ut.call(e))},avalon.isPlainObject=function(e){return"[object Object]"===Ut.call(e)&&Object.getPrototypeOf(e)===Wt},avalon.mix=avalon.fn.mix=function(){var e,t,n,a,r,i,o=arguments[0]||{},l=1,s=arguments.length,c=!1;for("boolean"==typeof o&&(c=o,o=arguments[1]||{},l++),"object"==typeof o||nn(o)||(o={}),l===s&&(o=this,l--);s>l;l++)if(null!=(e=arguments[l]))for(t in e)n=o[t],a=e[t],o!==a&&(c&&a&&(avalon.isPlainObject(a)||(r=Array.isArray(a)))?(r?(r=!1,i=n&&Array.isArray(n)?n:[]):i=n&&avalon.isPlainObject(n)?n:{},o[t]=avalon.mix(c,i,a)):void 0!==a&&(o[t]=a));return o},avalon.mix({rword:Ft,subscribers:Pt,version:1.53,ui:{},log:n,slice:function(e,t,n){return Gt.call(e,t,n)},noop:i,error:function(e,t){throw new(t||Error)(e)},oneObject:o,range:function(e,t,n){n||(n=1),null==t&&(t=e||0,e=0);for(var a=-1,r=Math.max(0,Math.ceil((t-e)/n)),i=new Array(r);++an&&t(n,e[n])!==!1;n++);else for(n in e)if(e.hasOwnProperty(n)&&t(n,e[n])===!1)break}},getWidgetData:function(e,t){var n=avalon(e).data(),a={};for(var r in n)0===r.indexOf(t)&&(a[r.replace(t,"").replace(/\w/,function(e){return e.toLowerCase()})]=n[r]);return a},Array:{ensure:function(e,t){return-1===e.indexOf(t)?e.push(t):void 0},removeAt:function(e,t){return!!e.splice(t,1).length},remove:function(e,t){var n=e.indexOf(t);return~n?avalon.Array.removeAt(e,n):!1}}});var an=avalon.bindingHandlers={},rn=avalon.bindingExecutors={},on=avalon.directives={};avalon.directive=function(e,t){return an[e]=t.init=t.init||i,rn[e]=t.update=t.update||i,on[e]=t};var ln=new function(){function e(e){this.size=0,this.limit=e,this.head=this.tail=void 0,this._keymap={}}var t=e.prototype;return t.put=function(e,t){var n={key:e,value:t};return this._keymap[e]=n,this.tail?(this.tail.newer=n,n.older=this.tail):this.head=n,this.tail=n,this.size===this.limit?this.shift():this.size++,t},t.shift=function(){var e=this.head;e&&(this.head=this.head.newer,this.head.older=e.newer=e.older=this._keymap[e.key]=void 0,delete this._keymap[e.key])},t.get=function(e){var t=this._keymap[e];if(void 0!==t)return t===this.tail?t.value:(t.newer&&(t===this.head&&(this.head=t.newer),t.newer.older=t.older),t.older&&(t.older.newer=t.newer),t.newer=void 0,t.older=this.tail,this.tail&&(this.tail.newer=t),this.tail=t,t.value)},e};if(Ht.contains||(Node.prototype.contains=function(e){return!!(16&this.compareDocumentPosition(e))}),avalon.contains=function(e,t){try{for(;t=t.parentNode;)if(t===e)return!0;return!1}catch(n){return!1}},e.SVGElement){var sn="http://www.w3.org/2000/svg",cn=Ht.createElementNS(sn,"svg");cn.innerHTML='',It.test(cn.firstChild)||Object.defineProperties(SVGElement.prototype,{outerHTML:{enumerable:!0,configurable:!0,get:function(){return(new XMLSerializer).serializeToString(this)},set:function(e){var t=this.tagName.toLowerCase(),n=this.parentNode,a=avalon.parseHTML(e);if("svg"===t)n.insertBefore(a,this);else{var r=Ht.createDocumentFragment();c(a,r),n.insertBefore(r,this)}n.removeChild(this)}},innerHTML:{enumerable:!0,configurable:!0,get:function(){var e=this.outerHTML,t=new RegExp("<"+this.nodeName+'\\b(?:(["\'])[^"]*?(\\1)|[^>])*>',"i"),n=new RegExp("$","i");return e.replace(t,"").replace(n,"")},set:function(e){if(avalon.clearHTML){avalon.clearHTML(this);var t=avalon.parseHTML(e);c(t,this)}}}})}var un=avalon.eventHooks;"onmouseenter"in Jt||avalon.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){un[e]={type:t,fn:function(t,n){return function(a){var r=a.relatedTarget;return r&&(r===t||16&t.compareDocumentPosition(r))?void 0:(delete a.type,a.type=e,n.call(t,a))}}}}),avalon.each({AnimationEvent:"animationend",WebKitAnimationEvent:"webkitAnimationEnd"},function(t,n){e[t]&&!un.animationend&&(un.animationend={type:n})}),void 0===Ht.onmousewheel&&(un.mousewheel={type:"wheel",fn:function(e,t){return function(n){n.wheelDeltaY=n.wheelDelta=n.deltaY>0?-120:120,n.wheelDeltaX=0,Object.defineProperty(n,"type",{value:"mousewheel"}),t.call(e,n)}}});var fn,dn,vn,pn,hn,mn=/[-.*+?^${}()|[\]\/\\]/g,gn={loader:function(t){var n=Dt&&t;e.require=n?Dt:Bt,e.define=n?Dt.define:qt},interpolate:function(e){if(fn=e[0],dn=e[1],fn===dn){throw new SyntaxError("openTag!==closeTag")}u.openTag=fn,u.closeTag=dn;var t=f(fn),n=f(dn);vn=new RegExp(t+"(.*?)"+n),pn=new RegExp(t+"(.*?)"+n,"g"),hn=new RegExp(t+".*?"+n+"|\\sms-")}};u.async=!0,u.debug=!0,u.plugins=gn,u.plugins.interpolate(["{{","}}"]),u.paths={},u.shim={},u.maxRepeatSize=100,avalon.config=u;var yn=avalon.vmodels={};avalon.define=function(e){var t=e.$id;t||n("warning: vm必须指定$id");var a=m(e);return a.$id=t,yn[t]=a};var bn=o("$id,$watch,$fire,$events,$model,$skipArray,$active,$pathname,$up,$track,$accessors"),$n={get:function(){return k(this)},set:i,enumerable:!1,configurable:!0},xn=["push","pop","shift","unshift","splice"],wn=Array.prototype,Cn={notify:function(){v.call(this.$up,this.$pathname)},set:function(e,t){if(e>>>0===e&&this[e]!==t){if(e>this.length)throw Error(e+"set方法的第一个参数不能大于原数组长度");v.call(this.$up,this.$pathname+".*",[t,this[e]]),this.splice(e,1,t)}},contains:function(e){return-1!==this.indexOf(e)},ensure:function(e){return this.contains(e)||this.push(e),this},pushArray:function(e){return this.push.apply(this,e)},remove:function(e){return this.removeAt(this.indexOf(e))},removeAt:function(e){return e>>>0===e?this.splice(e,1):[]},size:function(){return this._.length},removeAll:function(e){if(Array.isArray(e))for(var t=this.length-1;t>=0;t--)-1!==e.indexOf(this[t])&&(kn.call(this.$track,t,1),kn.call(this,t,1));else if("function"==typeof e)for(t=this.length-1;t>=0;t--){var n=this[t];e(n,t)&&(kn.call(this.$track,t,1),kn.call(this,t,1))}else kn.call(this.$track,0,this.length),kn.call(this,0,this.length);Zt||(this.$model=k(this)),this.notify(),this._.length=this.length},clear:function(){return this.removeAll()}},kn=wn.splice;xn.forEach(function(e){var t=wn[e];Cn[e]=function(){for(var n=[],a=0,r=arguments.length;r>a;a++)n[a]=x(arguments[a],0,1,1);var i=t.apply(this,n);return T(this.$track,e,n),Zt||(this.$model=k(this)),this.notify(),this._.length=this.length,i}}),"sort,reverse".replace(Ft,function(e){Cn[e]=function(){var t=this.concat(),n=this,a=Math.random(),r=[],i=!1;wn[e].apply(n,arguments);for(var o=0,l=t.length;l>o;o++){var s=n[o],c=t[o];if(s===c)r.push(o);else{var u=t.indexOf(s);r.push(u),t[u]=a,i=!0}}return i&&(N(this.$track,r),Zt||(this.$model=k(this)),this.notify()),this}});var Nn=function(){var e,t=[];return{begin:function(n){t.push(e),e=n},end:function(){e=t.pop()},collectDependency:function(t){e&&e.callback(t)}}}();avalon.injectBinding=function(e){e.handler=e.handler||on[e.type].update||i,e.update=function(){var t=!1;e.getter||(t=!0,Nn.begin({callback:function(t){E(t,e)}}),e.getter=W(e.expr,e.vmodels,e),e.observers.forEach(function(t){t.v.$watch(t.p,e)}),delete e.observers);try{var a,r,i=e.fireArgs;if(delete e.fireArgs,i?(a=i[0],r=i[1]):a="on"===e.type?e.getter+"":e.getter.apply(0,e.args),r="undefined"==typeof r?e.oldValue:r,e._filters&&(a=Ja.$filter.apply(0,[a].concat(e._filters))),e.signature){var o=avalon.type(a);if("array"!==o&&"object"!==o)throw Error("warning:"+e.expr+"只能是对象或数组");e.xtype=o;var l=O(e.proxies||[],o),s=a.$track||("array"===o?A(a.length):Object.keys(a));e.track=s,l!==s.join(";")&&(e.handler(a,r),e.oldValue=1)}else(Array.isArray(a)?a.length===(r&&r.length):1)?"oldValue"in e&&a===r||(e.handler(a,r),e.oldValue=a):(e.handler(a,r),e.oldValue=a.concat())}catch(c){delete e.getter,n("warning:exception throwed in [avalon.injectBinding] ",c);var u=e.element;u&&3===u.nodeType&&(u.nodeValue=fn+(e.oneTime?"::":"")+e.expr+dn)}finally{t&&Nn.end()}},e.update()};var An=0,Tn=avalon.$$subscribers=[],En=new Date,On={},Mn=new function(){avalon.mix(this,{option:Ht.createElement("select"),thead:Ht.createElement("table"),td:Ht.createElement("tr"),area:Ht.createElement("map"),tr:Ht.createElement("tbody"),col:Ht.createElement("colgroup"),legend:Ht.createElement("fieldset"),_default:Ht.createElement("div"),g:Ht.createElementNS("http://www.w3.org/2000/svg","svg")}),this.optgroup=this.option,this.tbody=this.tfoot=this.colgroup=this.caption=this.thead,this.th=this.td};String("circle,defs,ellipse,image,line,path,polygon,polyline,rect,symbol,text,use").replace(Ft,function(e){Mn[e]=Mn.g});var jn=/<([\w:]+)/,Sn=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Hn=o(["","text/javascript","text/ecmascript","application/ecmascript","application/javascript"]),Ln=Ht.createElement("script"),Dn=/<|&#?\w+;/;avalon.parseHTML=function(e){var t=Kt.cloneNode(!1);if("string"!=typeof e)return t;if(!Dn.test(e))return t.appendChild(Ht.createTextNode(e)),t;e=e.replace(Sn,"<$1>").trim();var n,a=(jn.exec(e)||["",""])[1].toLowerCase(),r=Mn[a]||Mn._default;r.innerHTML=e;var i=r.getElementsByTagName("script");if(i.length)for(var o,l=0;o=i[l++];)if(Hn[o.type]){var s=Ln.cloneNode(!1);Xt.forEach.call(o.attributes,function(e){s.setAttribute(e.name,e.value)}),s.text=o.text,o.parentNode.replaceChild(s,o)}for(;n=r.firstChild;)t.appendChild(n);return t},avalon.innerHTML=function(e,t){var n=this.parseHTML(t);this.clearHTML(e).appendChild(n)},avalon.clearHTML=function(e){for(e.textContent="";e.firstChild;)e.removeChild(e.firstChild);return e},"add,remove".replace(Ft,function(e){avalon.fn[e+"Class"]=function(t){var n=this[0];return t&&"string"==typeof t&&n&&1===n.nodeType&&t.replace(/\S+/g,function(t){n.classList[e](t)}),this}}),avalon.fn.mix({hasClass:function(e){var t=this[0]||{};return 1===t.nodeType&&t.classList.contains(e)},toggleClass:function(e,t){for(var n,a=0,r=String(e).split(/\s+/),i="boolean"==typeof t;n=r[a++];){var o=i?t:!this.hasClass(n);this[o?"addClass":"removeClass"](n)}return this},attr:function(e,t){return 2===arguments.length?(this[0].setAttribute(e,t),this):this[0].getAttribute(e)},data:function(e,t){switch(e="data-"+D(e||""),arguments.length){case 2:return this.attr(e,t),this;case 1:var n=this.attr(e);return P(n);case 0:var a={};return Xt.forEach.call(this[0].attributes,function(t){t&&(e=t.name,e.indexOf("data-")||(e=R(e.slice(5)),a[e]=P(t.value)))}),a}},removeData:function(e){return e="data-"+D(e),this[0].removeAttribute(e),this},css:function(e,t){if(avalon.isPlainObject(e))for(var n in e)avalon.css(this,n,e[n]);else var a=avalon.css(this,e,t);return void 0!==a?a:this},position:function(){var e,t,n=this[0],a={top:0,left:0};if(n)return"fixed"===this.css("position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),"HTML"!==e[0].tagName&&(a=e.offset()),a.top+=avalon.css(e[0],"borderTopWidth",!0),a.left+=avalon.css(e[0],"borderLeftWidth",!0),a.top-=e.scrollTop(),a.left-=e.scrollLeft()),{top:t.top-a.top-avalon.css(n,"marginTop",!0),left:t.left-a.left-avalon.css(n,"marginLeft",!0)}},offsetParent:function(){for(var e=this[0].offsetParent;e&&"static"===avalon.css(e,"position");)e=e.offsetParent;return avalon(e||Jt)},bind:function(e,t,n){return this[0]?avalon.bind(this[0],e,t,n):void 0},unbind:function(e,t,n){return this[0]&&avalon.unbind(this[0],e,t,n),this},val:function(e){var t=this[0];if(t&&1===t.nodeType){var n=0===arguments.length,a=n?":get":":set",r=Vn[_(t)+a]; -if(r)var i=r(t,e);else{if(n)return(t.value||"").replace(/\r/g,"");t.value=e}}return n?i:this}}),Jt.dataset&&(avalon.fn.data=function(e,t){e=e&&R(e);var n=this[0].dataset;switch(arguments.length){case 2:return n[e]=t,this;case 1:return t=n[e],P(t);case 0:var r=a();for(e in n)r[e]=P(n[e]);return r}});var Rn=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/;avalon.parseJSON=JSON.parse,avalon.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){avalon.fn[e]=function(n){var a=this[0]||{},r=B(a),i="scrollTop"===e;return arguments.length?void(r?r.scrollTo(i?r[t]:n,i?n:r[t]):a[e]=n):r?r[t]:a[e]}});var Pn=avalon.cssHooks=a(),Bn=["","-webkit-","-moz-","-ms-"],qn={"float":"cssFloat"};avalon.cssNumber=o("animationIterationCount,animationIterationCount,columnCount,order,flex,flexGrow,flexShrink,fillOpacity,fontWeight,lineHeight,opacity,orphans,widows,zIndex,zoom"),avalon.cssName=function(e,t,n){if(qn[e])return qn[e];t=t||Jt.style;for(var a=0,r=Bn.length;r>a;a++)if(n=R(Bn[a]+e),n in t)return qn[e]=n;return null},Pn["@:set"]=function(e,t,n){e.style[t]=n},Pn["@:get"]=function(e,t){if(!e||!e.style)throw new Error("getComputedStyle要求传入一个节点 "+e);var n,a=getComputedStyle(e);return a&&(n="filter"===t?a.getPropertyValue(t):a[t],""===n&&(n=e.style[t])),n},Pn["opacity:get"]=function(e){var t=Pn["@:get"](e,"opacity");return""===t?"1":t},"top,left".replace(Ft,function(e){Pn[e+":get"]=function(t){var n=Pn["@:get"](t,e);return/px$/.test(n)?n:avalon(t).position()[e]+"px"}});var _n={position:"absolute",visibility:"hidden",display:"block"},Fn=/^(none|table(?!-c[ea]).+)/;"Width,Height".replace(Ft,function(e){var t=e.toLowerCase(),n="client"+e,a="scroll"+e,r="offset"+e;Pn[t+":get"]=function(t,n,a){var i=-4;"number"==typeof a&&(i=a),n="Width"===e?["Left","Right"]:["Top","Bottom"];var o=t[r];return 2===i?o+avalon.css(t,"margin"+n[0],!0)+avalon.css(t,"margin"+n[1],!0):(0>i&&(o=o-avalon.css(t,"border"+n[0]+"Width",!0)-avalon.css(t,"border"+n[1]+"Width",!0)),-4===i&&(o=o-avalon.css(t,"padding"+n[0],!0)-avalon.css(t,"padding"+n[1],!0)),o)},Pn[t+"&get"]=function(e){var n=[];q(e,n);for(var a,r=Pn[t+":get"](e),i=0;a=n[i++];){e=a.node;for(var o in a)"string"==typeof a[o]&&(e.style[o]=a[o])}return r},avalon.fn[t]=function(i){var o=this[0];if(0===arguments.length){if(o.setTimeout)return o["inner"+e];if(9===o.nodeType){var l=o.documentElement;return Math.max(o.body[a],l[a],o.body[r],l[r],l[n])}return Pn[t+"&get"](o)}return this.css(t,i)},avalon.fn["inner"+e]=function(){return Pn[t+":get"](this[0],void 0,-2)},avalon.fn["outer"+e]=function(e){return Pn[t+":get"](this[0],void 0,e===!0?2:0)}}),avalon.fn.offset=function(){var e=this[0];try{var t=e.getBoundingClientRect();if(t.width||t.height||e.getClientRects().length){var n=e.ownerDocument,a=n.documentElement,r=n.defaultView;return{top:t.top+r.pageYOffset-a.clientTop,left:t.left+r.pageXOffset-a.clientLeft}}}catch(i){return{left:0,top:0}}};var Vn={"select:get":function(e,t){for(var n,a=e.options,r=e.selectedIndex,i="select-one"===e.type||0>r,o=i?null:[],l=i?r+1:a.length,s=0>r?l:i?r:0;l>s;s++)if(n=a[s],(n.selected||s===r)&&!n.disabled){if(t=n.value,i)return t;o.push(t)}return o},"select:set":function(e,t,n){t=[].concat(t);for(var a,r=0;a=e.options[r++];)(a.selected=t.indexOf(a.value)>-1)&&(n=!0);n||(e.selectedIndex=-1)}},In={},zn=["break,case,catch,continue,debugger,default,delete,do,else,false","finally,for,function,if,in,instanceof,new,null,return,switch,this","throw,true,try,typeof,var,void,while,with","abstract,boolean,byte,char,class,const,double,enum,export,extends","final,float,goto,implements,import,int,interface,long,native","package,private,protected,public,short,static,super,synchronized","throws,transient,volatile","arguments,let,yield,undefined"].join(",");zn.replace(/\w+/g,function(e){In[e]=!0});var Wn=/[a-z_$]/i,Yn=/[\s\uFEFF\xA0]/,Un=/(\$proxy\$[a-z]+)\d+$/,Xn=new ln(218),Gn=new ln(128),Zn=/\)\s*$/,Jn=/\)\s*\|/g,Kn=/\|\s*([$\w]+)/g,Qn=/"\s*\["/g,ea=/"\s*\(/g,ta=JSON.stringify;avalon.scan=function(e,t){e=e||Jt;var n=t?[].concat(t):[];nt(e,n)};var na=o("area,base,basefont,br,col,command,embed,hr,img,input,link,meta,param,source,track,wbr,noscript,script,style,textarea".toUpperCase()),aa=function(e,t,n){var a=e.getAttribute(t);if(a)for(var r,i=0;r=n[i++];)if(r.hasOwnProperty(a)&&"function"==typeof r[a])return r[a]},ra=tn&&e.MutationObserver?function(e){for(var t,n=e.firstChild;n;){var a=n.nextSibling;3===n.nodeType?t?(t.nodeValue+=n.nodeValue,e.removeChild(n)):t=n:t=null,n=a}}:0,ia=/^\s*::/,oa=/ms-(\w+)-?(.*)/,la=o("animationend,blur,change,input,click,dblclick,focus,keydown,keypress,keyup,mousedown,mouseenter,mouseleave,mousemove,mouseout,mouseover,mouseup,scan,scroll,submit"),sa=o("value,title,alt,checked,selected,disabled,readonly,enabled,href,src"),ca=/^if|widget|repeat$/,ua=/^each|with|html|include$/,fa=/^(ms-\S+|data-\S+|on[a-z]+|id|style|class|tabindex)$/,da=/\|\s*html(?:\b|$)/,va=/\|\|/g,pa=/(['"])(\\\1|.)+?\1/g,ha=function(){this.queue=[]};ha.prototype={render:function(e){if(!this.locked){this.locked=e?Jt.offsetHeight+10:1;var t=this;avalon.nextTick(function(){t.flush()})}},flush:function(){for(var e,t=0;e=this.queue[t++];)e.update();this.locked=0,this.queue=[]}};var ma=new ha,ga=[],ya=[],ba={$construct:function(){return avalon.mix.apply(null,arguments)},$ready:i,$init:i,$dispose:i,$container:null,$childReady:i,$replace:!1,$extend:null,$$template:function(e){return e}};avalon.components={},avalon.component=function(t,n){n&&(avalon.components[t]=avalon.mix({},ba,n));for(var a,r=0;a=ga[r];r++)t===a.fullName&&(ga.splice(r,1),r--,function(n,a,r,i){var o=1,l=n.library,s=avalon.libraries[l]||ba,c=Q(r),u=ot(n.vmodels,c.config||n.fullName),f=c.$id||c.identifier||en(i);delete c.config,delete c.$id,delete c.identifier;var d={},v=avalon.components[a.$extend];v?(avalon.mix(!0,d,v),d=v.$construct.call(r,d,{},{})):avalon.mix(!0,d,a),d=avalon.components[t].$construct.call(r,d,u,c),d.$refs={},d.$id=f;var p=d.$slot,h=d.$replace,m=d.$container,g=d.$template;delete d.$slot,delete d.$replace,delete d.$container,delete d.$template,delete d.$construct;var y=avalon.define(d)||{};r.msResolved=1,y.$init(y,r),s.$init(y,r);for(var b,$,x=r.childNodes,w={},C=0;$=x[C++];){var k=1===$.nodeType&&$.getAttribute("slot")||p;k&&(w[k]?w[k].push($):w[k]=[$])}y.$$template&&(avalon.clearHTML(r),r.innerHTML=y.$$template(g));for(C in w)if(y.hasOwnProperty(C)){var N=w[C];if(N.length){for(var A=Kt.cloneNode(!0),T=0;b=N[T++];)A.appendChild(b);y[C]=A}w[C]=null}w=null;var E=r.firstChild;h&&(E=r.firstChild,r.parentNode.replaceChild(E,r),E.msResolved=1,r=n.element=E),m&&m.appendChild(r),avalon.fireDom(r,"datasetchanged",{library:l,vm:y,childReady:1});var O=0,M=avalon.bind(r,"datasetchanged",function(t){if(t.childReady&&t.library===l&&(o+=t.childReady,y!==t.vm&&(y.$refs[t.vm.$id]=t.vm,-1===t.childReady&&(O++,y.$childReady(y,r,t)),t.stopPropagation())),0===o){var a=setTimeout(function(){clearTimeout(a),y.$ready(y,r),s.$ready(y,r)},O?Math.max(17*O,100):17);avalon.unbind(r,"datasetchanged",M),n.rollback=function(){try{y.$dispose(y,r),s.$dispose(y,r)}catch(e){}delete avalon.vmodels[y.$id]},j(n,ya),e.chrome&&r.addEventListener("DOMNodeRemovedFromDocument",function(){setTimeout(S)})}});if(nt(r,[y].concat(n.vmodels)),avalon.vmodels[y.$id]=y,r.childNodes.length)var H=setTimeout(function(){clearTimeout(H),avalon.fireDom(r,"datasetchanged",{library:l,vm:y,childReady:-1})},17);else avalon.fireDom(r,"datasetchanged",{library:l,vm:y,childReady:-1})}(a,avalon.components[t],a.element,a.widget))},avalon.fireDom=function(e,t,n){if(Ht.createEvent){var a=Ht.createEvent("Events");a.initEvent(t,!0,!0,n),avalon.mix(a,n),e.dispatchEvent(a)}else Jt.contains(e)&&(a=Ht.createEventObject(),avalon.mix(a,n),e.fireEvent("on"+t,a))},avalon.libraries=[],avalon.library=function(e,t){Ht.namespaces&&Ht.namespaces.add(e,"http://www.w3.org/1999/xhtml"),avalon.libraries[e]=avalon.mix({$init:i,$ready:i,$dispose:i},t||{})},avalon.library("ms");var $a=["autofocus,autoplay,async,allowTransparency,checked,controls","declare,disabled,defer,defaultChecked,defaultSelected","contentEditable,isMap,loop,multiple,noHref,noResize,noShade","open,readOnly,selected"].join(","),xa={};$a.replace(Ft,function(e){xa[e.toLowerCase()]=e});var wa={"accept-charset":"acceptCharset","char":"ch",charoff:"chOff","class":"className","for":"htmlFor","http-equiv":"httpEquiv"},Ca=["accessKey,bgColor,cellPadding,cellSpacing,codeBase,codeType,colSpan","dateTime,defaultValue,frameBorder,longDesc,maxLength,marginWidth,marginHeight","rowSpan,tabIndex,useMap,vSpace,valueType,vAlign"].join(",");Ca.replace(Ft,function(e){wa[e.toLowerCase()]=e});var ka=avalon.directive("attr",{init:function(e){if(e.expr=Y(e.expr.trim()),"include"===e.type){var t=e.element;dt(t,e),e.includeRendered=aa(t,"data-include-rendered",e.vmodels),e.includeLoaded=aa(t,"data-include-loaded",e.vmodels);var n=e.includeReplace=!!avalon(t).data("includeReplace");avalon(t).data("includeCache")&&(e.templateCache={}),e.start=Ht.createComment("ms-include"),e.end=Ht.createComment("ms-include-end"),n?(e.element=e.end,e._element=t,t.parentNode.insertBefore(e.end,t),t.parentNode.insertBefore(e.start,e.end)):(t.insertBefore(e.start,t.firstChild),t.appendChild(e.end))}},update:function(t){var n=this.element,a=this.param;if("href"===a||"src"===a){if("string"!=typeof t||Jt.hasAttribute||(t=t.replace(/&/g,"&")),n[a]=t,e.chrome&&"EMBED"===n.tagName){var r=n.parentNode,i=document.createComment("ms-src");r.replaceChild(i,n),r.replaceChild(n,i)}}else{var o=t===!1||null===t||void 0===t;!Zt&&wa[a]&&(a=wa[a]);var l=xa[a];if("boolean"==typeof n[l]&&(n[l]=!!t,t||(o=!0)),o)return n.removeAttribute(a);var s=It.test(n)?!1:Ht.namespaces&&isVML(n)?!0:a in n.cloneNode(!1);s?n[a]=t+"":n.setAttribute(a,t)}}});"title,alt,src,value,css,include,href".replace(Ft,function(e){on[e]=ka}),avalon.directive("class",{init:function(e){var t=e.param,a=e.type;if(!t||isFinite(t)?(e.param="",on.effect.init(e)):(n("ms-"+a+'-xxx="yyy"这种用法已经过时,请使用ms-'+a+'="xxx:yyy"'),e.expr="["+ta(t)+","+e.expr+"]",e.oldStyle=t),"hover"===a||"active"===a){if(!e.hasBindEvent){var r=e.element,i=avalon(r),o="mouseenter",l="mouseleave";if("active"===a){r.tabIndex=r.tabIndex||-1,o="mousedown",l="mouseup";var s=i.bind("mouseleave",function(){e.toggleClass&&i.removeClass(e.newClass)})}}var c=i.bind(o,function(){e.toggleClass&&i.addClass(e.newClass)}),u=i.bind(l,function(){e.toggleClass&&i.removeClass(e.newClass)});e.rollback=function(){i.unbind("mouseleave",s),i.unbind(o,c),i.unbind(l,u)},e.hasBindEvent=!0}},update:function(e){var t=this,n=avalon(this.element);t.newClass=e[0],t.toggleClass=!!e[1],t.oldClass&&t.newClass!==t.oldClass&&n.removeClass(t.oldClass),t.oldClass=t.newClass,"class"===t.type&&(t.oldStyle?n.toggleClass(t.oldStyle,!!e[1]):n.toggleClass(t.newClass,t.toggleClass))}}),"hover,active".replace(Ft,function(e){on[e]=on["class"]}),avalon.directive("css",{init:on.attr.init,update:function(e){avalon(this.element).css(this.param,e)}}),avalon.directive("data",{priority:100,update:function(e){var t=this.element,n="data-"+this.param;e&&"object"==typeof e?t[n]=e:t.setAttribute(n,String(e))}});{var Na=/^(?:checkbox|radio)$/,Aa=/^(?:radio|checked)$/;avalon.directive("duplex",{priority:2e3,init:function(e,t){function a(t){e.changed.call(this,t,e)}function r(){d=!0}function l(){d=!1}var s=e.element,c=e.vmodels;e.changed=aa(s,"data-duplex-changed",c)||i;var u=[],f=o("string,number,boolean,checked");"radio"===s.type&&""===e.param&&(e.param="checked"),e.param.replace(Vt,function(a){Na.test(s.type)&&Aa.test(a)&&("radio"===a&&n("ms-duplex-radio已经更名为ms-duplex-checked"),a="checked",e.isChecked=!0,e.xtype="radio"),"bool"===a?(a="boolean",n("ms-duplex-bool已经更名为ms-duplex-boolean")):"text"===a&&(a="string",n("ms-duplex-text已经更名为ms-duplex-string")),f[a]&&(t=!0),avalon.Array.ensure(u,a)}),t||u.push("string"),e.param=u.join("-"),e.changed=aa(s,"binding-duplex-changed",c)||i,e.xtype||(e.xtype="SELECT"===s.tagName?"select":"checkbox"===s.type?"checkbox":"radio"===s.type?"radio":/^change/.test(s.getAttribute("data-duplex-event"))?"change":"input"),e.bound=function(t,n){s.addEventListener(t,n,!1);var a=e.rollback;e.rollback=function(){s.avalonSetter=null,avalon.unbind(s,t,n),a&&a()}};var d=!1,v=function(){var t=s.value;if(!d&&t!==e.oldValue){var n=e.pipe(t,e,"get");e.setter(n),a.call(s,n)}};switch(e.xtype){case"radio":e.bound("click",function(){var t=e.pipe(s.value,e,"get");e.setter(t),a.call(s,t)});break;case"checkbox":e.bound("change",function(){var t=s.checked?"ensure":"remove",r=e.getter.apply(0,e.vmodels);Array.isArray(r)||(n("ms-duplex应用于checkbox上要对应一个数组"),r=[r]);var i=e.pipe(s.value,e,"get");avalon.Array[t](r,i),a.call(s,r)});break;case"change":e.bound("change",v);break;case"input":tn?e.bound("input",v):(e.bound("input",v),e.bound("compositionstart",r),e.bound("compositionend",l),e.bound("DOMAutoComplete",v));break;case"select":e.bound("change",function(){var t=avalon(s).val();t=Array.isArray(t)?t.map(function(t){return e.pipe(t,e,"get")}):e.pipe(t,e,"get"),t+""!==e.oldValue&&(e.setter(t),a.call(s,t))})}"input"===e.xtype&&/^(text|password|hidden)/.test(s.type)&&Oa(function(){if(Jt.contains(s))e.oldValue!==s.value&&v();else if(!s.msRetain)return!1}),s.avalonSetter=v;for(var p in avalon.vmodels){var h=avalon.vmodels[p];h.$fire("avalon-ms-duplex-init",e)}var m=e.pipe||(e.pipe=ct);m(null,e,"init")},update:function(e){var t,n=this.element,a=this;switch(this.xtype){case"input":case"change":t=this.pipe(e,this,"set"),t!==this.oldValue&&(n.value=this.oldValue=t);break;case"radio":t=a.isChecked?!!e:e+""===n.value,n.checked=t;break;case"checkbox":var r=[].concat(e);t=this.pipe(n.value,this,"get"),n.checked=r.indexOf(t)>-1;break;case"select":a._value=e,n.msHasEvent="selectDuplex",avalon.bind(n,"datasetchanged",function(e){if("selectDuplex"===e.bubble){var t=a._value,r=Array.isArray(t)?t.map(String):t+"";avalon(n).val(r),n.oldValue=r+"",a.changed.call(n,r)}})}"select"!==a.xtype&&a.changed.call(n,t)}})}avalon.duplexHooks={checked:{get:function(e,t){return!t.element.oldValue}},string:{get:function(e){return e},set:st},"boolean":{get:function(e){return"true"===e},set:st},number:{get:function(e,t){var n=parseFloat(e);if(-e===-n)return n;var a=/strong|medium|weak/.exec(t.element.getAttribute("data-duplex-number"))||["medium"];switch(a[0]){case"strong":return 0;case"medium":return""===e?"":0;case"weak":return e}},set:st}};var Ta,Ea=[];avalon.tick=function(e){1===Ea.push(e)&&(Ta=setInterval(ut,60))};var Oa=i;!new function(){function e(e){t[this.tagName].call(this,e),"function"==typeof this.avalonSetter&&this.oldValue!==e&&this.avalonSetter()}try{var t={},n=HTMLInputElement.prototype,a=HTMLTextAreaElement.prototype,r=HTMLInputElement.prototype;Object.getOwnPropertyNames(r),t.INPUT=Object.getOwnPropertyDescriptor(n,"value").set,Object.defineProperty(n,"value",{set:e}),t.TEXTAREA=Object.getOwnPropertyDescriptor(a,"value").set,Object.defineProperty(a,"value",{set:e})}catch(i){Oa=avalon.tick}},avalon.directive("effect",{priority:5,init:function(e){var t,n,a=e.expr,r=a.replace(pn,function(e){return e.replace(/./g,"0")}).indexOf(":");-1===r?(t=a,n=!0):(t=a.slice(0,r),n=a.slice(r+1)),t=vn.test(a)?Y(t):ta(t),e.expr="["+t+","+n+"]"},update:function(t){var n=t[0],a=this.element;if(a.getAttribute("data-effect-name")!==n){a.removeAttribute("data-effect-driver");var r=a.style,i=e.getComputedStyle?e.getComputedStyle(a):null,o=!1;if(i&&(Sa||Ha)){var l=r[La]||i[La];l&&"0s"!==l&&(a.setAttribute("data-effect-driver","t"),o=!0),o||(l=r[Da]||i[Da],l&&"0s"!==l&&(a.setAttribute("data-effect-driver","a"),o=!0))}o||avalon.effects[n]&&(a.setAttribute("data-effect-driver","j"),o=!0),o&&a.setAttribute("data-effect-name",n)}}}),avalon.effects={},avalon.effect=function(e,t){avalon.effects[e]=t};var Ma,ja,Sa=!1,Ha=!1,La=avalon.cssName("transition-duration"),Da=avalon.cssName("animation-duration");!new function(){var t,n={TransitionEvent:"transitionend",WebKitTransitionEvent:"webkitTransitionEnd",OTransitionEvent:"oTransitionEnd",otransitionEvent:"otransitionEnd"};for(var a in n){if(e[a]){t=n[a];break}try{{document.createEvent(a)}t=n[a];break}catch(r){}}"string"==typeof t&&(Sa=!0,Ma=t),n={AnimationEvent:"animationend",WebKitAnimationEvent:"webkitAnimationEnd"};var i;for(a in n)if(e[a]){i=n[a];break}"string"==typeof i&&(Sa=!0,ja=i)};var Ra=[],Pa=new ha;pt.prototype={contrustor:pt,enterClass:function(){return ht(this,"enter")},leaveClass:function(){return ht(this,"leave")},actionFun:function(e,t,n){if(!document.hidden){var a=this,r=a.el,i="leave"===e;e=i?"leave":"enter";var o=i?"enter":"leave";mt(a,"abort"+vt(o)),mt(a,"before"+vt(e)),i||t(r);var l=function(o){r.removeEventListener(a.cssEvent,a.cssCallback),i?(t(r),avalon(r).removeClass(a.cssClass)):"a"===a.driver&&avalon(r).removeClass(a.cssClass),o!==!0&&(mt(a,"after"+vt(e)),n&&n(r)),a.dispose()};a.useCss?(a.cssCallback&&a.cssCallback(!0),a.cssClass=ht(a,e),a.cssCallback=l,a.update=function(){r.addEventListener(a.cssEvent,a.cssCallback),i||"t"!==a.driver||avalon(r).removeClass(a.cssClass)},avalon(r).addClass(a.cssClass),Pa.render(!0),Pa.queue.push(a)):mt(a,e,l)}},enter:function(){this.actionFun.apply(this,["enter"].concat(avalon.slice(arguments)))},leave:function(){this.actionFun.apply(this,["leave"].concat(avalon.slice(arguments)))},dispose:function(){this.update=this.cssCallback=null,Ra.unshift(this)>100&&Ra.pop()}};var Ba=function(e,t){var n=Gt.call(arguments,0);"function"!=typeof n[2]&&n.splice(2,0,i),"function"!=typeof n[3]&&n.splice(3,0,i);var a=n[2],r=n[3],o=n[4],l=ft(e,o);if(!l)return a(),r(),!1;var s=t?"enter":"leave";l[s](a,r)};avalon.mix(avalon.effect,{apply:Ba,append:function(e,t,n,a){return Ba(e,1,function(){t.appendChild(e)},n,a)},before:function(e,t,n,a){return Ba(e,1,function(){t.parentNode.insertBefore(e,t)},n,a)},remove:function(e,t,n,a){return Ba(e,0,function(){e.parentNode===t&&t.removeChild(e)},n,a)}}),avalon.directive("html",{update:function(e){var t=this,n=this.element,a=1!==n.nodeType,r=a?n.parentNode:n;if(r){if(e=null==e?"":e,3===n.nodeType){var i=en("html");r.insertBefore(Ht.createComment(i),n),t.element=Ht.createComment(i+":end"),r.replaceChild(t.element,n),n=t.element}if("object"!=typeof e)var o=avalon.parseHTML(String(e));else if(11===e.nodeType)o=e;else if(1===e.nodeType||e.item){var l=1===e.nodeType?e.childNodes:e.item;for(o=Kt.cloneNode(!0);l[0];)o.appendChild(l[0])}if(l=avalon.slice(o.childNodes),a){for(var s=n.nodeValue.slice(0,-4);;){var c=n.previousSibling;if(!c||8===c.nodeType&&c.nodeValue===s)break;r.removeChild(c)}r.insertBefore(o,n)}else avalon.clearHTML(n).appendChild(o);tt(l,t.vmodels)}}}),avalon.directive("if",{priority:10,update:function(e){function t(){r.getAttribute(a.name)&&(r.removeAttribute(a.name),K(r,a.vmodels)),a.rollback=null}var n,a=this,r=this.element,i=a.stamp=+new Date,o=function(){i===a.stamp&&(a.recoverNode=null)};a.recoverNode&&a.recoverNode();try{if(!r.parentNode)return;n=r.parentNode}catch(l){return}if(e){if(8===r.nodeType){var s=a.keep,c=avalon.effect.apply(s,1,function(){i===a.stamp&&(r.parentNode.replaceChild(s,r),r=a.element=s,s.getAttribute("_required")&&(r.required=!0,r.removeAttribute("_required")),r.querySelectorAll&&avalon.each(r.querySelectorAll("[_required=true]"),function(e){e.required=!0,e.removeAttribute("_required")}),t())},o);c=c===!1}c||t()}else if(1===r.nodeType){r.required===!0&&(r.required=!1,r.setAttribute("_required","true"));try{avalon.each(r.querySelectorAll(":required"),function(e){r.required=!1,e.setAttribute("_required","true")})}catch(l){}var u=a.element=Ht.createComment("ms-if"),f=r.nextSibling;a.recoverNode=function(){a.recoverNode=null,u.parentNode!==n&&(n.insertBefore(u,f),a.keep=r)},avalon.effect.apply(r,0,function(){a.recoverNode=null,i===a.stamp&&(r.parentNode.replaceChild(u,r),a.keep=r,Rt.appendChild(r),a.rollback=function(){r.parentNode===Rt&&Rt.removeChild(r)})},o)}}});var qa=function(){return new e.XMLHttpRequest},_a=avalon.templateCache={};avalon.directive("include",{init:on.attr.init,update:function(e){var t=this,n=this.element,a=t.vmodels,r=t.includeRendered,i=t.effectName&&t.effectClass,o=t.templateCache,l=t.includeReplace,s=t.includeLoaded,c=l?n.parentNode:n,u=t._element;t.recoverNodes=t.recoverNodes||avalon.noop;var f=(l&&u.cloneNode(),function(f){var d=t._stamp=+new Date;if(s){var v=s.apply(c,[f].concat(a));"string"==typeof v&&(f=v)}r&&X(c,function(){r.call(c)},0/0);var p=t.includeLastID||"_default";t.includeLastID=e;var h=o&&o[p]||Ht.createElement(n.tagName||t._element.tagName);i&&(h.className=i,c.insertBefore(h,t.start)),(o||{})[p]=h;var m=t.recoverNodes();for(m&&c.insertBefore(m,t.end);;){var g=t.start.nextSibling;if(!g||g===h||g===t.end)break;h.appendChild(g)}avalon.effect.remove(h,c,function(){o&&d===t._stamp&&Rt.appendChild(h)},t);var y=c,b=avalon.noop,$=avalon.noop,x=gt(t,e,f),w=avalon.slice(x.childNodes);l&&i?(y=u,y.innerHTML="",y.setAttribute("ms-skip","true"),c.insertBefore(y,t.end.nextSibling),b=function(){y.insertBefore(x,null)},$=function(){t.recoverNodes=avalon.noop,d===t._stamp&&(x=yt(w),c.insertBefore(x,t.end),tt(w,a)),y.parentNode===c&&c.removeChild(y)},t.recoverNodes=function(){return t.recoverNodes=avalon.noop,yt(w)}):b=function(){c.insertBefore(x,t.end),tt(w,a)},avalon.effect.apply(y,"enter",b,$)});if("src"===t.param)if("string"==typeof _a[e])avalon.nextTick(function(){f(_a[e])});else if(Array.isArray(_a[e]))_a[e].push(f);else{var d=qa();d.onload=function(){for(var t,n=d.responseText,a=0;t=_a[e][a++];)t(n);_a[e]=n},_a[e]=[f],d.open("GET",e,!0),"withCredentials"in d&&(d.withCredentials=!0),d.setRequestHeader("X-Requested-With","XMLHttpRequest"),d.send(null)}else{var v=e&&1===e.nodeType?e:Ht.getElementById(e);v&&avalon.nextTick(function(){f(v.value||v.innerText||v.innerHTML)})}}});var Fa=/\(([^)]*)\)/,Va=avalon.directive("on",{priority:3e3,init:function(e){var t=e.expr;e.type="on";var n=e.param.replace(/-\d+$/,"");if("function"==typeof Va[n+"Hook"]&&Va[n+"Hook"](e),t.indexOf("(")>0&&t.indexOf(")")>-1){var a=(t.match(Fa)||["",""])[1].trim();(""===a||"$event"===a)&&(t=t.replace(Fa,""))}e.expr=t},update:function(e){var t=this,n=this.element;e=function(e){var n=t.getter||i;return n.apply(this,t.args.concat(e))};var a=t.param.replace(/-\d+$/,"");if("scan"===a)e.call(n,{type:a});else if("function"==typeof t.specialBind)t.specialBind(n,e);else var r=avalon.bind(n,a,e);t.rollback=function(){"function"==typeof t.specialUnbind?t.specialUnbind():avalon.unbind(n,a,r)}}});avalon.directive("repeat",{priority:90,init:function(e){var t=e.type;e.cache={},e.enterCount=0;var n=e.element;if(1===n.nodeType){n.removeAttribute(e.name),dt(n,e),e.param=e.param||"el",e.sortedCallback=aa(n,"data-with-sorted",e.vmodels);var a=aa(n,"data-"+t+"-rendered",e.vmodels),r=en(t),i=Ht.createComment(r+":start"),o=e.element=Ht.createComment(r+":end");if(e.signature=r,e.start=i,e.template=Kt.cloneNode(!1),"repeat"===t){var l=n.parentNode;l.replaceChild(o,n),l.insertBefore(i,o),e.template.appendChild(n)}else{for(;n.firstChild;)e.template.appendChild(n.firstChild);n.appendChild(i),n.appendChild(o),l=n}if(e.element=o,a)var s=avalon.bind(l,"datasetchanged",function(){a.apply(l,l.args),avalon.unbind(l,"datasetchanged",s),l.msRendered=a})}},update:function(e,t){var n=this,a=this.xtype;this.enterCount+=1;var r=!t;if(r){n.$outer={};var i="$key",o="$val";"array"===a&&(i="$first",o="$last");for(var l,s=0;l=n.vmodels[s++];)if(l.hasOwnProperty(i)&&l.hasOwnProperty(o)){n.$outer=l;break}}var c=this.track;if(n.sortedCallback){var f=n.sortedCallback.call($,c);f&&Array.isArray(f)&&(c=f)}var d="move";n.$repeat=e;var v=[],p=r&&Kt.cloneNode(!1),h=[],m=this.param,g=avalon.mix({},this.cache),y=this.element,b=c.length,$=y.parentNode;for(s=0;b>s;s++){var x=c[s],w=g[x];if(w)v.push({}),g[x]=!0;else{w=Ct(this),"array"===a?(d="add",w.$id=x,w[m]=e[s]):(d="append",w.$key=x,w.$val=e[x]),this.cache[x]=w;var C=w.$anchor||(w.$anchor=y.cloneNode(!1));C.nodeValue=this.signature,wt(n,p,w,v,r&&!n.effectDriver),At(w,n,a)}1===this.enterCount&&(w.$active=!1,w.$oldIndex=w.$index,w.$active=!0,w.$index=s),"array"===a?(w.$first=0===s,w.$last=s===b-1):w.$val=k(e[x]),h.push(w)}if(this.proxies=h,r&&!n.effectDriver)$.insertBefore(p,y),v.forEach(function(e){tt(e.nodes||[],e.vmodels),e.nodes=e.vmodels=null});else{var N=n.staggerIndex=0;for(x in g)g[x]!==!0&&(d="del",xt(g[x].$anchor,n),Ot(this.cache,x,m),g[x]=null);for(s=0;b>s;s++){w=h[s],x="array"===a?w.$id:w.$key;var A=h[s-1],T=A?A.$anchor:n.start;g[x]?w.$index!==w.$oldIndex&&!function(e,t){N=$t(n.effectEnterStagger,function(){var a=xt(e.$anchor),r=avalon.slice(a.childNodes);$.insertBefore(a,t.nextSibling),bt(r,1,n)},N)}(w,T):!function(e,t){var a=e.nodes,r=e.vmodels;a&&(N=$t(n.effectEnterStagger,function(){$.insertBefore(e.content,t.nextSibling),tt(a,r),bt(a,1,n)},N)),e.nodes=e.vmodels=null}(v[s],T)}}if(!e.$track)for(x in this.cache)Ot(this.cache,x,m);!function(e){$.args=e,$.msRendered&&$.msRendered.apply($,e)}(u.newWatch?arguments:[d]);var E=setTimeout(function(){clearTimeout(E),avalon.fireDom($,"datasetchanged",{bubble:$.msHasEvent})});this.enterCount-=1}}),"with,each".replace(Ft,function(e){on[e]=avalon.mix({},on.repeat,{priority:1400})});var Ia=[],za=[];avalon.directive("text",{update:function(e){var t=this.element;if(e=null==e?"":e,3===t.nodeType)try{t.data=e}catch(n){}else t.textContent=e}}),avalon.parseDisplay=Mt,avalon.directive("visible",{init:function(){},update:function(e){var t=this.element,n=this,a=n.stamp=+new Date;e?(t.style.display="none",avalon.effect.apply(t,1,function(){if(a===n.stamp){var e=t.getAttribute("data-effect-driver")||"a";/^[atn]/.test(e)&&(this.effectName||(t.style.display=""),"none"===avalon(t).css("display")&&(t.style.display=Mt(t.nodeName)))}})):avalon.effect.apply(t,0,function(){a===n.stamp&&(t.style.display="none")})}});var Wa=/]*>([\S\s]*?)<\/script\s*>/gim,Ya=/\s+(on[^=\s]+)(?:=("[^"]*"|'[^']*'|[^\s>]+))?/g,Ua=/<\w+\b(?:(["'])[^"]*?(\1)|[^>])*>/gi,Xa={a:/\b(href)\=("javascript[^"]*"|'javascript[^']*')/gi,img:/\b(src)\=("javascript[^"]*"|'javascript[^']*')/gi,form:/\b(action)\=("javascript[^"]*"|'javascript[^']*')/gi},Ga=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Za=/([^\#-~| |!])/g,Ja=avalon.filters={uppercase:function(e){return e.toUpperCase()},lowercase:function(e){return e.toLowerCase()},truncate:function(e,t,n){return t=t||30,n="string"==typeof n?n:"...",e.length>t?e.slice(0,t-n.length)+n:String(e)},$filter:function(e){for(var t=1,n=arguments.length;n>t;t++){var a=arguments[t],r=avalon.filters[a[0]];if("function"==typeof r){var i=[e].concat(a.slice(1));e=r.apply(null,i)}}return e},camelize:R,sanitize:function(e){return e.replace(Wa,"").replace(Ua,function(e){var t=e.toLowerCase().match(/<(\w+)\s/);if(t){var n=Xa[t[1]];n&&(e=e.replace(n,function(e,t,n){var a=n.charAt(0);return t+"="+a+"javascript:void(0)"+a}))}return e.replace(Ya," ").replace(/\s+/g," ")})},escape:function(e){return String(e).replace(/&/g,"&").replace(Ga,function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1);return"&#"+(1024*(t-55296)+(n-56320)+65536)+";"}).replace(Za,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")},currency:function(e,t,n){return(t||"¥")+jt(e,isFinite(n)?n:2)},number:jt};!new function(){function e(e){return parseInt(e,10)||0}function t(e,t,n){var a="";for(0>e&&(a="-",e=-e),e=""+e;e.length0||o>-a)&&(o+=a),0===o&&-12===a&&(o=12),t(o,n,r)}}function a(e,t){return function(n,a){var r=n["get"+e](),i=(t?"SHORT"+e:e).toUpperCase();return a[i][r]}}function r(e){var n=-1*e.getTimezoneOffset(),a=n>=0?"+":"";return a+=t(Math[n>0?"floor":"ceil"](n/60),2)+t(Math.abs(n%60),2)}function i(e,t){return e.getHours()<12?t.AMPMS[0]:t.AMPMS[1]}var o={yyyy:n("FullYear",4),yy:n("FullYear",2,0,!0),y:n("FullYear",1),MMMM:a("Month"),MMM:a("Month",!0),MM:n("Month",2,1),M:n("Month",1,1),dd:n("Date",2),d:n("Date",1),HH:n("Hours",2),H:n("Hours",1),hh:n("Hours",2,-12),h:n("Hours",1,-12),mm:n("Minutes",2),m:n("Minutes",1),ss:n("Seconds",2),s:n("Seconds",1),sss:n("Milliseconds",3),EEEE:a("Day"),EEE:a("Day",!0),a:i,Z:r},l=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,s=/^\/Date\((\d+)\)\/$/;Ja.date=function(t,n){var a,r,i=Ja.date.locate,c="",u=[];if(n=n||"mediumDate",n=i[n]||n,"string"==typeof t)if(/^\d+$/.test(t))t=e(t);else if(s.test(t))t=+RegExp.$1;else{var f=t.trim(),d=[0,0,0,0,0,0,0],v=new Date(0);f=f.replace(/^(\d+)\D(\d+)\D(\d+)/,function(t,n,a,r){var i=4===r.length?[r,n,a]:[n,a,r];return d[0]=e(i[0]),d[1]=e(i[1])-1,d[2]=e(i[2]),""});var p=v.setFullYear,h=v.setHours;f=f.replace(/[T\s](\d+):(\d+):?(\d+)?\.?(\d)?/,function(t,n,a,r,i){return d[3]=e(n),d[4]=e(a),d[5]=e(r),i&&(d[6]=Math.round(1e3*parseFloat("0."+i))),""});var m=0,g=0;f=f.replace(/Z|([+-])(\d\d):?(\d\d)/,function(t,n,a,r){return p=v.setUTCFullYear,h=v.setUTCHours,n&&(m=e(n+a),g=e(n+r)),""}),d[3]-=m,d[4]-=g,p.apply(v,d.slice(0,3)),h.apply(v,d.slice(3)),t=v}if("number"==typeof t&&(t=new Date(t)),"date"===avalon.type(t)){for(;n;)r=l.exec(n),r?(u=u.concat(r.slice(1)),n=u.pop()):(u.push(n),n=null);return u.forEach(function(e){a=o[e],c+=a?a(t,i):e.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),c}};var c={AMPMS:{0:"上午",1:"下午"},DAY:{0:"星期日",1:"星期一",2:"星期二",3:"星期三",4:"星期四",5:"星期五",6:"星期六"},MONTH:{0:"1月",1:"2月",2:"3月",3:"4月",4:"5月",5:"6月",6:"7月",7:"8月",8:"9月",9:"10月",10:"11月",11:"12月"},SHORTDAY:{0:"周日",1:"周一",2:"周二",3:"周三",4:"周四",5:"周五",6:"周六"},fullDate:"y年M月d日EEEE",longDate:"y年M月d日",medium:"yyyy-M-d H:mm:ss",mediumDate:"yyyy-M-d",mediumTime:"H:mm:ss","short":"yy-M-d ah:mm",shortDate:"yy-M-d",shortTime:"ah:mm"};c.SHORTMONTH=c.MONTH,Ja.date.locate=c};var Ka,Qa=[],er=function(e){for(Ka=!0,Dt&&(modules["domReady!"].state=4,Dt.checkDeps());e=Qa.shift();)e(avalon)};"complete"===Ht.readyState?setTimeout(er):Ht.addEventListener("DOMContentLoaded",er),e.addEventListener("load",er),avalon.ready=function(e){Ka?e(avalon):Qa.push(e)},avalon.config({loader:!0}),avalon.ready(function(){avalon.scan(Ht.body)}),"function"==typeof define&&define.amd&&define("avalon",[],function(){return avalon});var tr=e.avalon;return avalon.noConflict=function(t){return t&&e.avalon===avalon&&(e.avalon=tr),avalon},void 0===t&&(e.avalon=avalon),avalon}); \ No newline at end of file +!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("Avalon requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(){avalon.config.debug&&console.log.apply(console,arguments)}function a(){return Object.create(null)}function r(e){return Function.apply(i,e)}function i(){}function o(e,t){"string"==typeof e&&(e=e.match(Ft)||[]);for(var n={},a=void 0!==t?t:1,r=0,i=e.length;i>r;r++)n[e[r]]=a;return n}function l(){if(e.VBArray){var t=document.documentMode;return t?t:e.XMLHttpRequest?7:6}return 0/0}function s(e){if(e&&"object"==typeof e){var t=e.length,n=Ut.call(e);if(/(Array|List|Collection|Map|Arguments)\]$/.test(n))return!0;if("[object Object]"===n&&t===t>>>0)return!0}return!1}function c(e,t){if(e&&e.childNodes)for(var n,a=e.childNodes,r=0;n=a[r++];)if(n.tagName){var i=Ht.createElementNS(sn,n.tagName.toLowerCase());Xt.forEach.call(n.attributes,function(e){i.setAttribute(e.name,e.value)}),c(n,i),t.appendChild(i)}}function u(e){for(var t in e)if(Yt.call(e,t)){var n=e[t];"function"==typeof u.plugins[t]?u.plugins[t](n):"object"==typeof u[t]?avalon.mix(u[t],n):u[t]=n}return this}function f(e){return(e+"").replace(mn,"\\$&")}function d(e,t){var n=this.$events||(this.$events={}),a=n[e]||(n[e]=[]);if("function"==typeof t){var r=t;r.uniqueNumber=Math.random(),t={element:Jt,type:"user-watcher",handler:i,vmodels:[this],expr:e,uniqueNumber:r.uniqueNumber},t.wildcard=/\*/.test(e)}if(t.update)t.oneTime||avalon.Array.ensure(a,t);else{if(/\w\.*\B/.test(e)){t.getter=i;var o=this;t.update=function(){var e=this.fireArgs||[];e[2]&&t.handler.apply(o,e),delete this.fireArgs},a.sync=!0,avalon.Array.ensure(a,t)}else avalon.injectBinding(t);r&&(t.handler=r)}return function(){t.update=t.getter=t.handler=i,t.element=Ht.createElement("a")}}function v(e,t){var n=this.$events;if(n&&n[e]){t&&(t[2]=e),h(n[e],t);var a=this.$up;a&&(this.$pathname&&v.call(a,this.$pathname+"."+e,t),v.call(a,"*."+e,t))}else if(a=this.$up){var r=this.$pathname+"."+e,i=r.split(".");-1===i.indexOf("*")?(v.call(a,r,t),i[1]="*",v.call(a,i.join("."),t)):v.call(a,r,t)}}function p(e,t){for(;;){if(e.$watch){var n=e.$events||(e.$events={}),a=n[t]||(n[t]=[]);return void Nn.collectDependency(a)}if(e=e.$up,!e)break;t=e.$pathname+"."+t}}function h(e,t){if(e){new Date-En>444&&"object"==typeof e[0]&&S();for(var n,a=[],r=[],i=0;n=e[i++];)"user-watcher"===n.type?a.push(n):r.push(n);if(u.async){for(ma.render(),i=0;n=r[i++];)if(n.update){var o=M(n);ma.queue[o]||(ma.queue[o]=1,ma.queue.push(n))}}else for(i=0;n=r[i++];)n.update&&n.update();for(i=0;n=a[i++];)(t&&t[2]===n.expr||n.wildcard)&&(n.fireArgs=t),n.update()}}function m(e,t){return t=t||{},t.watch=!0,y(e,t)}function g(){}function y(e,t){function a(e){return u[e]===!0}if(!e||e.$id&&e.$accessors)return e;t=t||_t;var r=t.force||_t,i=t.old,l=i&&i.$accessors||_t,s=new g,c={},u={},f=[],p=[],h={};e.$skipArray&&(h=o(e.$skipArray),delete e.$skipArray);var m=e.$computed;if(m){delete e.$computed;for(var y in m)u[y]=!0,function(e,t){var n;c[e]={get:function(){return n=t.get.call(this)},set:function(a){if("function"==typeof t.set){var r=n;t.set.call(this,a);var i=this[e];this.$fire&&i!==r&&this.$fire(e,i,r)}},enumerable:!0,configurable:!0}}(y,m[y])}for(y in e){var x=e[y];bn[y]||(u[y]=!0),"function"==typeof x||x&&x.nodeType||!r[y]&&("$"===y.charAt(0)||bn[y]||h[y])?f.push(y):b(x)?(n("warning:计算属性建议放在$computed对象中统一定义"),function(e,t){var n;c[e]={get:function(){return n=t.get.call(this)},set:function(a){if("function"==typeof t.set){var r=n;t.set.call(this,a);var i=this[e];this.$fire&&i!==r&&this.$fire(e,i,r)}},enumerable:!0,configurable:!0}}(y,x)):(p.push(y),c[y]=l[y]?l[y]:$(y,x))}c.$model=$n,s=Object.defineProperties(s,c,e),f.forEach(function(t){s[t]=e[t]}),C(s,"$id","anonymous"),C(s,"$up",i?i.$up:null),C(s,"$track",Object.keys(u)),C(s,"$active",!1),C(s,"$pathname",i?i.$pathname:""),C(s,"$accessors",c),C(s,"hasOwnProperty",a),t.watch&&(C(s,"$watch",function(){return d.apply(s,arguments)}),C(s,"$fire",function(e,t){if(0===e.indexOf("all!")){var n=e.slice(4);for(var a in avalon.vmodels){var r=avalon.vmodels[a];r.$fire&&r.$fire.apply(r,[n,t])}}else v.call(s,e,[t])})),p.forEach(function(t){var n=s[t]=e[t];n&&"object"==typeof n&&(n.$up=s,n.$pathname=t),v.call(s,t)});for(y in m)x=s[y];return s.$active=!0,s}function b(e){if(e&&"object"==typeof e){for(var t in e)if("get"!==t&&"set"!==t)return!1;return"function"==typeof e.get}}function $(e,t){var n,t=0/0;return{get:function(){return this.$active&&p(this,e),t},set:function(a){if(t!==a){var r=t;n=x(a,t),n?t=n:(n=void 0,t=a),Object(n)===n&&(n.$pathname=e,n.$up=this),this.$active&&v.call(this,e,[t,r])}},enumerable:!0,configurable:!0}}function x(e,t,n,a){if(Array.isArray(e))return w(e,t,a);if(avalon.isPlainObject(e)){if(t){var r=Object.keys(e),i=Object.keys(t);if(r.join(";")===i.join(";")){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);return t}t.$active=!1}return y(e,{old:t,watch:a})}return n?e:void 0}function w(e,t,n){if(t){var a=[0,t.length].concat(e);return t.splice.apply(t,a),t}for(var r in Cn)e[r]=Cn[r];C(e,"$up",null),C(e,"$pathname",""),C(e,"$track",A(e.length)),e._=y({length:0/0},{watch:!0}),e._.length=e.length,e._.$watch("length",function(t,n){v.call(e.$up,e.$pathname+".length",[t,n])}),n&&C(e,"$watch",function(){return d.apply(e,arguments)}),Object.defineProperty(e,"$model",$n);for(var i=0,o=e.length;o>i;i++){var l=e[i]=x(e[i],0,1,1);Object(l)===l&&(l.$up=e)}return e}function C(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!1,configurable:!0})}function k(e){var t=avalon.type(e);if("array"===t){for(var n=[],a=0;aa;a++){n[a]=e[a];var i=t[a];i in n?(e[a]=n[i],delete n[i]):e[a]=e[i]}}function A(e){for(var t=[],n=0;e>n;n++)t[n]=en("$proxy$each");return t}function T(e,t,n){switch(t){case"push":case"unshift":n=A(n.length);break;case"splice":if(n.length>2){{n[1],n.length-2}n=[n[0],n[1]].concat(A(n.length-2))}}Array.prototype[t].apply(e,n)}function E(e,t){t.oneTime||e&&avalon.Array.ensure(e,t)&&t.element&&(j(t,e),new Date-En>444&&S())}function O(e,t){for(var n,a=[],r=0;n=e[r++];)a.push(t?n.$id:n.$key);return a.join(";")}function M(e){if(!e.uniqueNumber){var t=e.element;e.uniqueNumber=t?1!==t.nodeType?e.type+(e.pos||0)+"-"+M(t.parentNode):e.name+"-"+M(t):++An}return e.uniqueNumber}function j(e,t){var n=e.lists||(e.lists=[]),a=M(e);avalon.Array.ensure(n,t),t.$uuid=t.$uuid||en(),Tn[a]||(Tn[a]=1,Tn.push(e))}function S(e){for(var t=Tn.length,n=t,a=[],r={},i={};e=Tn[--t];){var o=e.type;i[o]?i[o]++:(i[o]=1,a.push(o))}var l=!1;if(a.forEach(function(e){On[e]!==i[e]&&(r[e]=1,l=!0)}),t=n,l)for(;e=Tn[--t];)if(null!==e.element){if(r[e.type]&&L(e.element)){Tn.splice(t,1),delete Tn[e.uniqueNumber];for(var s,c=e.lists,u=0;s=c[u++];)avalon.Array.remove(c,s),avalon.Array.remove(s,e);H(e)}}else Tn.splice(t,1);On=i,En=new Date}function H(e){delete Tn[e.uniqueNumber],e.element=null,e.rollback&&e.rollback();for(var t in e)e[t]=null}function L(e){try{{e.parentNode.nodeType}}catch(t){return!0}return e.ifRemove&&!Jt.contains(e.ifRemove)&&Rt===e.parentNode?(e.parentNode&&e.parentNode.removeChild(e),!0):e.msRetain?0:1===e.nodeType?!Jt.contains(e):!avalon.contains(Jt,e)}function D(e){return e.replace(/([a-z\d])([A-Z]+)/g,"$1-$2").toLowerCase()}function R(e){return e.indexOf("-")<0&&e.indexOf("_")<0?e:e.replace(/[-_][^-_]/g,function(e){return e.charAt(1).toUpperCase()})}function P(e){try{if("object"==typeof e)return e;e="true"===e?!0:"false"===e?!1:"null"===e?null:+e+""===e?+e:Rn.test(e)?JSON.parse(e):e}catch(t){}return e}function B(e){return e.window&&e.document?e:9===e.nodeType?e.defaultView:!1}function q(e,t){if(e.offsetWidth<=0){var n=getComputedStyle(e,null);if(Fn.test(n.display)){var a={node:e};for(var r in _n)a[r]=n[r],e.style[r]=_n[r];t.push(a)}var i=e.parentNode;i&&1===i.nodeType&&q(i,t)}}function _(e){var t=e.tagName.toLowerCase();return"input"===t&&/checkbox|radio/.test(e.type)?"checked":t}function F(e,t){var n=[],a=!!t;t=t||0;for(var i="unknown",o="",l=0;lu;u++)if(i.length){var d="vm"+o+"_"+u;s.push(d),c.push(t[u]),l.push.apply(l,I(i,t[u],d,n))}n.args=c;var v=n.type,p=t.map(function(e){return String(e.$id).replace(Un,"$1")})+e+v,h=Gn.get(p);if(h){if("duplex"===v){var m=Gn.get(p+"setter");n.setter=m.apply(m,n.args)}return n.getter=h}if(l.length||l.push("fix"+o),"duplex"===v){var g={};l.forEach(function(e){var t=e.split("=");g[t[0].trim()]=t[1].trim()}),e=e.replace(/[\$\w]+/,function(e){return g[e]?g[e]:e});var y=r(s.concat("'use strict';return function(vvv){"+e+" = vvv\n}\n"));Gn.put(p+"setter",y),n.setter=y.apply(y,n.args)}if("on"===v){-1===e.indexOf("(")?e+=".call(this, $event)":e=e.replace("(",".call(this,"),s.push("$event"),e="\nreturn "+e+";";var b=e.lastIndexOf("\nreturn"),$=e.slice(0,b),x=e.slice(b);e=$+"\n"+x}else e="\nreturn "+e+";";return h=r(s.concat("'use strict';\nvar "+l.join(",\n")+e)),Gn.put(p,h)}function Y(e){var t=vn.test(e);if(t){var n=rt(e);return 1===n.length?n[0].expr:n.map(function(e){return e.type?"("+e.expr+")":ta(e.expr)}).join(" + ")}return e}function U(e){return e=e.replace(Zn,"").replace(Jn,function(){return"],|"}).replace(Kn,function(e,t){return"["+ta(t)}).replace(Qn,function(){return'"],["'}).replace(ea,function(){return'",'})+"]",r(["return ["+e+"]"])()}function X(e,t,n){var a=setTimeout(function(){var r=e.innerHTML;clearTimeout(a),r===n?t():X(e,t,r)})}function G(e,t){var n=e.getAttribute("avalonctrl")||t.$id;e.setAttribute("avalonctrl",n),t.$events&&(t.$events.expr=e.tagName+'[avalonctrl="'+n+'"]')}function Z(e,t){for(var n,a=0;n=e[a++];)n.vmodels=t,on[n.type].init(n),avalon.injectBinding(n),n.getter&&1===n.element.nodeType&&n.element.removeAttribute(n.name);e.length=0}function J(e,t){return e.priority-t.priority}function K(e,t,a){var r=!0;if(t.length){for(var i,o=e.attributes,l=[],s={},c=0;i=o[c++];){var u=i.name;if(!s[u]&&(s[u]=1,i.specified&&(a=u.match(oa)))){var f=a[1],d=a[2]||"",v=i.value;if(la[f]?(d=f,f="on"):sa[f]&&(d=f,f="attr",u="ms-"+f+"-"+d,n("warning!请改用"+u+"代替"+i.name+"!")),on[f]){var p=v.replace(ia,""),h=v!==p,m={type:f,param:d,element:e,name:u,expr:p,oneTime:h,priority:(on[f].priority||10*f.charCodeAt(0))+(Number(d.replace(/\D/g,""))||0)};if("html"===f||"text"===f){var g=at(v).filters;m.expr=m.expr.replace(g,""),m.filters=g.replace(da,function(){return m.type="html",m.group=1,""}).trim()}else if("duplex"===f)var y=u;else if("ms-if-loop"===u)m.priority+=100;else if("ms-attr-value"===u)var b=u;l.push(m)}}}if(l.length){for(l.sort(J),y&&b&&"text"===e.type&&n("warning!一个控件不能同时定义ms-attr-value与"+y),c=0;m=l[c];c++){if(f=m.type,ca.test(f))return Z(l.slice(0,c+1),t);r&&(r=!ua.test(f))}Z(l,t)}}r&&!na[e.tagName]&&(ra&&ra(e),et(e,t))}function Q(e){for(var t,n=e.attributes,a={},r=0;t=n[r++];)t.specified&&!fa.test(t.name)&&(a[R(t.name)]=P(t.value));return a}function et(e,t){var n=avalon.slice(e.childNodes);tt(n,t)}function tt(e,t){for(var n,a=0;n=e[a++];)switch(n.nodeType){case 1:var r=n;if(nt(n,t),!r.msResolved&&r.parentNode&&1===r.parentNode.nodeType){var i=lt(r);if(i){var o=r.localName?r.localName.replace(i+":",""):r.nodeName,l=i+":"+R(o);ga.push({library:i,element:r,fullName:l,widget:o,vmodels:t,name:"widget"}),avalon.components[l]&&avalon.component(l)}}n.msHasEvent&&avalon.fireDom(n,"datasetchanged",{bubble:n.msHasEvent});break;case 3:vn.test(n.nodeValue)&&it(n,t,a)}}function nt(e,t,n){var a=e.getAttribute("ms-skip"),r=e.getAttributeNode("ms-important"),i=e.getAttributeNode("ms-controller");if("string"!=typeof a){if(n=r||i){var o=avalon.vmodels[n.value];if(!o)return;t=n===r?[o]:[o].concat(t),e.removeAttribute(n.name),e.classList.remove(n.name),G(e,o)}K(e,t)}}function at(e){if(e.indexOf("|")>0){var t=e.replace(pa,function(e){return Array(e.length+1).join("1")}),n=t.replace(va,"ᄢ㍄").indexOf("|");if(n>-1)return{type:"text",filters:e.slice(n).trim(),expr:e.slice(0,n)}}return{type:"text",expr:e,filters:""}}function rt(e){for(var t,n,a=[],r=0;;){if(n=e.indexOf(fn,r),-1===n)break;if(t=e.slice(r,n),t&&a.push({expr:t}),r=n+fn.length,n=e.indexOf(dn,r),-1===n)break;t=e.slice(r,n),t&&a.push(at(t,r)),r=n+dn.length}return t=e.slice(r),t&&a.push({expr:t}),a}function it(e,t,n){var a=[],r=rt(e.data);if(r.length){for(var i,o=0;i=r[o++];){var l=Ht.createTextNode(i.expr);i.type&&(i.expr=i.expr.replace(ia,function(){return i.oneTime=!0,""}),i.element=l,i.filters=i.filters.replace(da,function(){return i.type="html",""}),i.pos=1e3*n+o,a.push(i)),Kt.appendChild(l)}e.parentNode.replaceChild(Kt,e),a.length&&Z(a,t)}}function ot(e,t){if(t)for(var n,a=0;n=e[a++];)if(n.hasOwnProperty(t)&&"object"==typeof n[t]){var r=n[t];return r.$model||r}return{}}function lt(e){if(e.scopeName&&"HTML"!==e.scopeName)return e.scopeName;var t=e.nodeName.toLowerCase(),n=t.indexOf(":");return n>0?t.slice(0,n):void 0}function st(e){return null==e?"":e}function ct(e,t,n){return t.param.replace(Vt,function(a){var r=avalon.duplexHooks[a];r&&"function"==typeof r[n]&&(e=r[n](e,t))}),e}function ut(){for(var e=Ea.length-1;e>=0;e--){var t=Ea[e];t()===!1&&Ea.splice(e,1)}Ea.length||clearInterval(Ta)}function ft(e,t){if(!e||1!==e.nodeType)return null;if(t)var n=t.effectName,a=t.effectDriver;else n=e.getAttribute("data-effect-name"),a=e.getAttribute("data-effect-driver");if(!n||!a)return null;var r=Ra.pop()||new pt;return r.el=e,r.driver=a,r.useCss="j"!==a,r.useCss&&(t&&avalon(e).addClass(t.effectClass),r.cssEvent="t"===a?Ma:ja),r.name=n,r.callbacks=avalon.effects[n]||{},r}function dt(e,t){var n=e.getAttribute("data-effect-name");if(n){t.effectName=n,t.effectDriver=e.getAttribute("data-effect-driver");var a=+e.getAttribute("data-effect-stagger");t.effectLeaveStagger=+e.getAttribute("data-effect-leave-stagger")||a,t.effectEnterStagger=+e.getAttribute("data-effect-enter-stagger")||a,t.effectClass=e.className||0/0}}function vt(e){return e.replace(/^[\S]/g,function(e){return e.toUpperCase()})}function pt(){}function ht(e,t){var n=e.callbacks[t+"Class"];return"string"==typeof n?n:"function"==typeof n?n():e.name+"-"+t}function mt(e,t,n){var a=e.callbacks[t];a&&a.call(e,e.el,n)}function gt(e,t,n){var a=e.templateCache&&e.templateCache[t];if(a){for(var r,i=Ht.createDocumentFragment();r=a.firstChild;)i.appendChild(r);return i}return avalon.parseHTML(n)}function yt(e){for(var t=Ht.createDocumentFragment(),n=0,a=e.length;a>n;n++)t.appendChild(e[n]);return t}function bt(e,t,n){for(var a,r=0;a=e[r++];)a.className===n.effectClass&&avalon.effect.apply(a,t,i,i,n)}function $t(e,t,n){return e?setTimeout(t,++n*e):t(),n}function xt(e,t){for(var n=Kt.cloneNode(!1),a=e,r=a.nodeValue,o=t&&Math.max(+t.staggerIndex,0),l=avalon.slice(a.parentNode.childNodes),s=l.indexOf(a);;){var c=l[--s];if(!c||0===String(c.nodeValue).indexOf(r))break;t&&c.className===t.effectClass?(e=c,function(e){t.staggerIndex=$t(t.effectLeaveStagger,function(){avalon.effect.apply(e,0,i,function(){n.appendChild(e)},t)},o)}(c)):n.insertBefore(c,n.firstChild)}return n.appendChild(a),n}function wt(e,t,n,a,r){var i=e.template.cloneNode(!0),o=avalon.slice(i.childNodes);i.appendChild(n.$anchor),r&&t.appendChild(i);var l=[n].concat(e.vmodels),s={nodes:o,vmodels:l,content:i};a.push(s)}function Ct(e){var t="object"===e.xtype?Tt:kt,n=t(e),a=n.$anchor||(n.$anchor=e.element.cloneNode(!1));return a.nodeValue=e.signature,n.$outer=e.$outer,n}function kt(e,t){for(var n=e.param||"el",a=0,r=Ia.length;r>a;a++){var i=Ia[a];if(i&&i.hasOwnProperty(n)){Ia.splice(a,1),t=i;break}}return t||(t=Nt(n)),t}function Nt(e){var t={$outer:{},$index:0,$oldIndex:0,$anchor:null,$first:!1,$last:!1,$remove:avalon.noop};t[e]=0/0;var n={$last:1,$first:1,$index:1};n[e]=1;var a=m(t,{force:n});return a.$id=en("$proxy$each"),a}function At(e,t,n){if("array"===n){e.$remove=function(){t.$repeat.removeAt(e.$index)};var a=t.param;e.$watch(a,function(n){var a=e.$index;t.$repeat[a]=n})}else e.$watch("$val",function(n){t.$repeat[e.$key]=n})}function Tt(){return za.pop()||Et()}function Et(){var e=m({$key:"",$val:0/0,$index:0,$oldIndex:0,$outer:{},$anchor:null},{force:{$key:1,$val:1,$index:1}});return e.$id=en("$proxy$with"),e}function Ot(e,t,n){var a=e[t];if(a){var r=0===a.$id.indexOf("$proxy$each")?Ia:za;a.$outer={};for(var i in a.$events){var o=a.$events[i];Array.isArray(o)&&(o.length=0,i===n?a[n]=0/0:"$val"===i&&(a.$val=0/0))}r.unshift(a)>u.maxRepeatSize&&r.pop(),delete e[t]}}function Mt(e,t){var n="_"+e;if(!Mt[n]){var a=Ht.createElement(e);Jt.appendChild(a),t=Zt?getComputedStyle(a,null).display:a.currentStyle.display,Jt.removeChild(a),Mt[n]=t}return Mt[n]}function jt(e,t,n,a){e=(e+"").replace(/[^0-9+\-Ee.]/g,"");var r=isFinite(+e)?+e:0,i=isFinite(+t)?Math.abs(t):3,o=a||",",l=n||".",s="",c=function(e,t){var n=Math.pow(10,t);return""+(Math.round(e*n)/n).toFixed(t)};return s=(i?c(r,i):""+Math.round(r)).split("."),s[0].length>3&&(s[0]=s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,o)),(s[1]||"").length');var Dt,Rt=Lt.firstChild,Pt="$"+St,Bt=e.require,qt=e.define,_t={},Ft=/[^, ]+/g,Vt=/\w+/g,It=/^\[object SVG\w*Element\]$/,zt=/^\[object (?:Window|DOMWindow|global)\]$/,Wt=Object.prototype,Yt=Wt.hasOwnProperty,Ut=Wt.toString,Xt=Array.prototype,Gt=Xt.slice,Zt=e.dispatchEvent,Jt=Ht.documentElement,Kt=Ht.createDocumentFragment(),Qt=(Ht.createElement("div"),{});"Boolean Number String Function Array Date RegExp Object Error".replace(Ft,function(e){Qt["[object "+e+"]"]=e.toLowerCase()});var en=function(e){return e=e||"avalon",String(Math.random()+Math.random()).replace(/\d\.\d{4}/,e)},tn=l();avalon=function(e){return new avalon.init(e)},avalon.nextTick=new function(){function t(){for(var e=r.length,t=0;e>t;t++)r[t]();r=r.slice(e)}var n=e.setImmediate,a=e.MutationObserver;if(n)return n.bind(e);var r=[];if(a){var i=document.createTextNode("avalon");new a(t).observe(i,{characterData:!0});var o=!1;return function(e){r.push(e),o=!o,i.data=o}}return function(e){setTimeout(e,4)}},avalon.init=function(e){this[0]=this.element=e},avalon.fn=avalon.prototype=avalon.init.prototype,avalon.type=function(e){return null==e?String(e):"object"==typeof e||"function"==typeof e?Qt[Ut.call(e)]||"object":typeof e};var nn=function(e){return"[object Function]"===Ut.call(e)};avalon.isFunction=nn,avalon.isWindow=function(e){return zt.test(Ut.call(e))},avalon.isPlainObject=function(e){return"[object Object]"===Ut.call(e)&&Object.getPrototypeOf(e)===Wt},avalon.mix=avalon.fn.mix=function(){var e,t,n,a,r,i,o=arguments[0]||{},l=1,s=arguments.length,c=!1;for("boolean"==typeof o&&(c=o,o=arguments[1]||{},l++),"object"==typeof o||nn(o)||(o={}),l===s&&(o=this,l--);s>l;l++)if(null!=(e=arguments[l]))for(t in e)n=o[t],a=e[t],o!==a&&(c&&a&&(avalon.isPlainObject(a)||(r=Array.isArray(a)))?(r?(r=!1,i=n&&Array.isArray(n)?n:[]):i=n&&avalon.isPlainObject(n)?n:{},o[t]=avalon.mix(c,i,a)):void 0!==a&&(o[t]=a));return o},avalon.mix({rword:Ft,subscribers:Pt,version:1.53,ui:{},log:n,slice:function(e,t,n){return Gt.call(e,t,n)},noop:i,error:function(e,t){throw new(t||Error)(e)},oneObject:o,range:function(e,t,n){n||(n=1),null==t&&(t=e||0,e=0);for(var a=-1,r=Math.max(0,Math.ceil((t-e)/n)),i=new Array(r);++an&&t(n,e[n])!==!1;n++);else for(n in e)if(e.hasOwnProperty(n)&&t(n,e[n])===!1)break}},getWidgetData:function(e,t){var n=avalon(e).data(),a={};for(var r in n)0===r.indexOf(t)&&(a[r.replace(t,"").replace(/\w/,function(e){return e.toLowerCase()})]=n[r]);return a},Array:{ensure:function(e,t){return-1===e.indexOf(t)?e.push(t):void 0},removeAt:function(e,t){return!!e.splice(t,1).length},remove:function(e,t){var n=e.indexOf(t);return~n?avalon.Array.removeAt(e,n):!1}}});var an=avalon.bindingHandlers={},rn=avalon.bindingExecutors={},on=avalon.directives={};avalon.directive=function(e,t){return an[e]=t.init=t.init||i,rn[e]=t.update=t.update||i,on[e]=t};var ln=new function(){function e(e){this.size=0,this.limit=e,this.head=this.tail=void 0,this._keymap={}}var t=e.prototype;return t.put=function(e,t){var n={key:e,value:t};return this._keymap[e]=n,this.tail?(this.tail.newer=n,n.older=this.tail):this.head=n,this.tail=n,this.size===this.limit?this.shift():this.size++,t},t.shift=function(){var e=this.head;e&&(this.head=this.head.newer,this.head.older=e.newer=e.older=this._keymap[e.key]=void 0,delete this._keymap[e.key])},t.get=function(e){var t=this._keymap[e];if(void 0!==t)return t===this.tail?t.value:(t.newer&&(t===this.head&&(this.head=t.newer),t.newer.older=t.older),t.older&&(t.older.newer=t.newer),t.newer=void 0,t.older=this.tail,this.tail&&(this.tail.newer=t),this.tail=t,t.value)},e};if(Ht.contains||(Node.prototype.contains=function(e){return!!(16&this.compareDocumentPosition(e))}),avalon.contains=function(e,t){try{for(;t=t.parentNode;)if(t===e)return!0;return!1}catch(n){return!1}},e.SVGElement){var sn="http://www.w3.org/2000/svg",cn=Ht.createElementNS(sn,"svg");cn.innerHTML='',It.test(cn.firstChild)||Object.defineProperties(SVGElement.prototype,{outerHTML:{enumerable:!0,configurable:!0,get:function(){return(new XMLSerializer).serializeToString(this)},set:function(e){var t=this.tagName.toLowerCase(),n=this.parentNode,a=avalon.parseHTML(e);if("svg"===t)n.insertBefore(a,this);else{var r=Ht.createDocumentFragment();c(a,r),n.insertBefore(r,this)}n.removeChild(this)}},innerHTML:{enumerable:!0,configurable:!0,get:function(){var e=this.outerHTML,t=new RegExp("<"+this.nodeName+'\\b(?:(["\'])[^"]*?(\\1)|[^>])*>',"i"),n=new RegExp("$","i");return e.replace(t,"").replace(n,"")},set:function(e){if(avalon.clearHTML){avalon.clearHTML(this);var t=avalon.parseHTML(e);c(t,this)}}}})}var un=avalon.eventHooks;"onmouseenter"in Jt||avalon.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){un[e]={type:t,fn:function(t,n){return function(a){var r=a.relatedTarget;return r&&(r===t||16&t.compareDocumentPosition(r))?void 0:(delete a.type,a.type=e,n.call(t,a))}}}}),avalon.each({AnimationEvent:"animationend",WebKitAnimationEvent:"webkitAnimationEnd"},function(t,n){e[t]&&!un.animationend&&(un.animationend={type:n})}),void 0===Ht.onmousewheel&&(un.mousewheel={type:"wheel",fn:function(e,t){return function(n){n.wheelDeltaY=n.wheelDelta=n.deltaY>0?-120:120,n.wheelDeltaX=0,Object.defineProperty(n,"type",{value:"mousewheel"}),t.call(e,n)}}});var fn,dn,vn,pn,hn,mn=/[-.*+?^${}()|[\]\/\\]/g,gn={loader:function(t){var n=Dt&&t;e.require=n?Dt:Bt,e.define=n?Dt.define:qt},interpolate:function(e){if(fn=e[0],dn=e[1],fn===dn){throw new SyntaxError("openTag!==closeTag")}u.openTag=fn,u.closeTag=dn;var t=f(fn),n=f(dn);vn=new RegExp(t+"(.*?)"+n),pn=new RegExp(t+"(.*?)"+n,"g"),hn=new RegExp(t+".*?"+n+"|\\sms-")}};u.async=!0,u.debug=!0,u.plugins=gn,u.plugins.interpolate(["{{","}}"]),u.paths={},u.shim={},u.maxRepeatSize=100,avalon.config=u;var yn=avalon.vmodels={};avalon.define=function(e){var t=e.$id;t||n("warning: vm必须指定$id");var a=m(e);return a.$id=t,yn[t]=a};var bn=o("$id,$watch,$fire,$events,$model,$skipArray,$active,$pathname,$up,$track,$accessors"),$n={get:function(){return k(this)},set:i,enumerable:!1,configurable:!0},xn=["push","pop","shift","unshift","splice"],wn=Array.prototype,Cn={notify:function(){v.call(this.$up,this.$pathname)},set:function(e,t){if(e>>>0===e&&this[e]!==t){if(e>this.length)throw Error(e+"set方法的第一个参数不能大于原数组长度");v.call(this.$up,this.$pathname+".*",[t,this[e]]),this.splice(e,1,t)}},contains:function(e){return-1!==this.indexOf(e)},ensure:function(e){return this.contains(e)||this.push(e),this},pushArray:function(e){return this.push.apply(this,e)},remove:function(e){return this.removeAt(this.indexOf(e))},removeAt:function(e){return e>>>0===e?this.splice(e,1):[]},size:function(){return this._.length},removeAll:function(e){if(Array.isArray(e))for(var t=this.length-1;t>=0;t--)-1!==e.indexOf(this[t])&&(kn.call(this.$track,t,1),kn.call(this,t,1));else if("function"==typeof e)for(t=this.length-1;t>=0;t--){var n=this[t];e(n,t)&&(kn.call(this.$track,t,1),kn.call(this,t,1))}else kn.call(this.$track,0,this.length),kn.call(this,0,this.length);Zt||(this.$model=k(this)),this.notify(),this._.length=this.length},clear:function(){return this.removeAll()}},kn=wn.splice;xn.forEach(function(e){var t=wn[e];Cn[e]=function(){for(var n=[],a=0,r=arguments.length;r>a;a++)n[a]=x(arguments[a],0,1,1);var i=t.apply(this,n);return T(this.$track,e,n),Zt||(this.$model=k(this)),this.notify(),this._.length=this.length,i}}),"sort,reverse".replace(Ft,function(e){Cn[e]=function(){var t=this.concat(),n=this,a=Math.random(),r=[],i=!1;wn[e].apply(n,arguments);for(var o=0,l=t.length;l>o;o++){var s=n[o],c=t[o];if(s===c)r.push(o);else{var u=t.indexOf(s);r.push(u),t[u]=a,i=!0}}return i&&(N(this.$track,r),Zt||(this.$model=k(this)),this.notify()),this}});var Nn=function(){var e,t=[];return{begin:function(n){t.push(e),e=n},end:function(){e=t.pop()},collectDependency:function(t){e&&e.callback(t)}}}();avalon.injectBinding=function(e){e.handler=e.handler||on[e.type].update||i,e.update=function(){var t=!1;e.getter||(t=!0,Nn.begin({callback:function(t){E(t,e)}}),e.getter=W(e.expr,e.vmodels,e),e.observers.forEach(function(t){t.v.$watch(t.p,e)}),delete e.observers);try{var a,r,i=e.fireArgs;if(delete e.fireArgs,i?(a=i[0],r=i[1]):a="on"===e.type?e.getter+"":e.getter.apply(0,e.args),r="undefined"==typeof r?e.oldValue:r,e._filters&&(a=Ja.$filter.apply(0,[a].concat(e._filters))),e.signature){var o=avalon.type(a);if("array"!==o&&"object"!==o)throw Error("warning:"+e.expr+"只能是对象或数组");e.xtype=o;var l=O(e.proxies||[],o),s=a.$track||("array"===o?A(a.length):Object.keys(a));e.track=s,l!==s.join(";")&&(e.handler(a,r),e.oldValue=1)}else(Array.isArray(a)?a.length===(r&&r.length):1)?"oldValue"in e&&a===r||(e.handler(a,r),e.oldValue=a):(e.handler(a,r),e.oldValue=a.concat())}catch(c){delete e.getter,n("warning:exception throwed in [avalon.injectBinding] ",c);var u=e.element;u&&3===u.nodeType&&(u.nodeValue=fn+(e.oneTime?"::":"")+e.expr+dn)}finally{t&&Nn.end()}},e.update()};var An=0,Tn=avalon.$$subscribers=[],En=new Date,On={},Mn=new function(){avalon.mix(this,{option:Ht.createElement("select"),thead:Ht.createElement("table"),td:Ht.createElement("tr"),area:Ht.createElement("map"),tr:Ht.createElement("tbody"),col:Ht.createElement("colgroup"),legend:Ht.createElement("fieldset"),_default:Ht.createElement("div"),g:Ht.createElementNS("http://www.w3.org/2000/svg","svg")}),this.optgroup=this.option,this.tbody=this.tfoot=this.colgroup=this.caption=this.thead,this.th=this.td};String("circle,defs,ellipse,image,line,path,polygon,polyline,rect,symbol,text,use").replace(Ft,function(e){Mn[e]=Mn.g});var jn=/<([\w:]+)/,Sn=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Hn=o(["","text/javascript","text/ecmascript","application/ecmascript","application/javascript"]),Ln=Ht.createElement("script"),Dn=/<|&#?\w+;/;avalon.parseHTML=function(e){var t=Kt.cloneNode(!1);if("string"!=typeof e)return t;if(!Dn.test(e))return t.appendChild(Ht.createTextNode(e)),t;e=e.replace(Sn,"<$1>").trim();var n,a=(jn.exec(e)||["",""])[1].toLowerCase(),r=Mn[a]||Mn._default;r.innerHTML=e;var i=r.getElementsByTagName("script");if(i.length)for(var o,l=0;o=i[l++];)if(Hn[o.type]){var s=Ln.cloneNode(!1);Xt.forEach.call(o.attributes,function(e){s.setAttribute(e.name,e.value)}),s.text=o.text,o.parentNode.replaceChild(s,o)}for(;n=r.firstChild;)t.appendChild(n);return t},avalon.innerHTML=function(e,t){var n=this.parseHTML(t);this.clearHTML(e).appendChild(n)},avalon.clearHTML=function(e){for(e.textContent="";e.firstChild;)e.removeChild(e.firstChild);return e},"add,remove".replace(Ft,function(e){avalon.fn[e+"Class"]=function(t){var n=this[0];return t&&"string"==typeof t&&n&&1===n.nodeType&&t.replace(/\S+/g,function(t){n.classList[e](t)}),this}}),avalon.fn.mix({hasClass:function(e){var t=this[0]||{};return 1===t.nodeType&&t.classList.contains(e)},toggleClass:function(e,t){for(var n,a=0,r=String(e).split(/\s+/),i="boolean"==typeof t;n=r[a++];){var o=i?t:!this.hasClass(n);this[o?"addClass":"removeClass"](n)}return this},attr:function(e,t){return 2===arguments.length?(this[0].setAttribute(e,t),this):this[0].getAttribute(e)},data:function(e,t){switch(e="data-"+D(e||""),arguments.length){case 2:return this.attr(e,t),this;case 1:var n=this.attr(e);return P(n);case 0:var a={};return Xt.forEach.call(this[0].attributes,function(t){t&&(e=t.name,e.indexOf("data-")||(e=R(e.slice(5)),a[e]=P(t.value)))}),a}},removeData:function(e){return e="data-"+D(e),this[0].removeAttribute(e),this},css:function(e,t){if(avalon.isPlainObject(e))for(var n in e)avalon.css(this,n,e[n]);else var a=avalon.css(this,e,t);return void 0!==a?a:this},position:function(){var e,t,n=this[0],a={top:0,left:0};if(n)return"fixed"===this.css("position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),"HTML"!==e[0].tagName&&(a=e.offset()),a.top+=avalon.css(e[0],"borderTopWidth",!0),a.left+=avalon.css(e[0],"borderLeftWidth",!0),a.top-=e.scrollTop(),a.left-=e.scrollLeft()),{top:t.top-a.top-avalon.css(n,"marginTop",!0),left:t.left-a.left-avalon.css(n,"marginLeft",!0)}},offsetParent:function(){for(var e=this[0].offsetParent;e&&"static"===avalon.css(e,"position");)e=e.offsetParent;return avalon(e||Jt)},bind:function(e,t,n){return this[0]?avalon.bind(this[0],e,t,n):void 0},unbind:function(e,t,n){return this[0]&&avalon.unbind(this[0],e,t,n),this},val:function(e){var t=this[0];if(t&&1===t.nodeType){var n=0===arguments.length,a=n?":get":":set",r=Vn[_(t)+a];if(r)var i=r(t,e);else{if(n)return(t.value||"").replace(/\r/g,"");t.value=e +}}return n?i:this}}),Jt.dataset&&(avalon.fn.data=function(e,t){e=e&&R(e);var n=this[0].dataset;switch(arguments.length){case 2:return n[e]=t,this;case 1:return t=n[e],P(t);case 0:var r=a();for(e in n)r[e]=P(n[e]);return r}});var Rn=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/;avalon.parseJSON=JSON.parse,avalon.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){avalon.fn[e]=function(n){var a=this[0]||{},r=B(a),i="scrollTop"===e;return arguments.length?void(r?r.scrollTo(i?r[t]:n,i?n:r[t]):a[e]=n):r?r[t]:a[e]}});var Pn=avalon.cssHooks=a(),Bn=["","-webkit-","-moz-","-ms-"],qn={"float":"cssFloat"};avalon.cssNumber=o("animationIterationCount,animationIterationCount,columnCount,order,flex,flexGrow,flexShrink,fillOpacity,fontWeight,lineHeight,opacity,orphans,widows,zIndex,zoom"),avalon.cssName=function(e,t,n){if(qn[e])return qn[e];t=t||Jt.style;for(var a=0,r=Bn.length;r>a;a++)if(n=R(Bn[a]+e),n in t)return qn[e]=n;return null},Pn["@:set"]=function(e,t,n){e.style[t]=n},Pn["@:get"]=function(e,t){if(!e||!e.style)throw new Error("getComputedStyle要求传入一个节点 "+e);var n,a=getComputedStyle(e);return a&&(n="filter"===t?a.getPropertyValue(t):a[t],""===n&&(n=e.style[t])),n},Pn["opacity:get"]=function(e){var t=Pn["@:get"](e,"opacity");return""===t?"1":t},"top,left".replace(Ft,function(e){Pn[e+":get"]=function(t){var n=Pn["@:get"](t,e);return/px$/.test(n)?n:avalon(t).position()[e]+"px"}});var _n={position:"absolute",visibility:"hidden",display:"block"},Fn=/^(none|table(?!-c[ea]).+)/;"Width,Height".replace(Ft,function(e){var t=e.toLowerCase(),n="client"+e,a="scroll"+e,r="offset"+e;Pn[t+":get"]=function(t,n,a){var i=-4;"number"==typeof a&&(i=a),n="Width"===e?["Left","Right"]:["Top","Bottom"];var o=t[r];return 2===i?o+avalon.css(t,"margin"+n[0],!0)+avalon.css(t,"margin"+n[1],!0):(0>i&&(o=o-avalon.css(t,"border"+n[0]+"Width",!0)-avalon.css(t,"border"+n[1]+"Width",!0)),-4===i&&(o=o-avalon.css(t,"padding"+n[0],!0)-avalon.css(t,"padding"+n[1],!0)),o)},Pn[t+"&get"]=function(e){var n=[];q(e,n);for(var a,r=Pn[t+":get"](e),i=0;a=n[i++];){e=a.node;for(var o in a)"string"==typeof a[o]&&(e.style[o]=a[o])}return r},avalon.fn[t]=function(i){var o=this[0];if(0===arguments.length){if(o.setTimeout)return o["inner"+e];if(9===o.nodeType){var l=o.documentElement;return Math.max(o.body[a],l[a],o.body[r],l[r],l[n])}return Pn[t+"&get"](o)}return this.css(t,i)},avalon.fn["inner"+e]=function(){return Pn[t+":get"](this[0],void 0,-2)},avalon.fn["outer"+e]=function(e){return Pn[t+":get"](this[0],void 0,e===!0?2:0)}}),avalon.fn.offset=function(){var e=this[0];try{var t=e.getBoundingClientRect();if(t.width||t.height||e.getClientRects().length){var n=e.ownerDocument,a=n.documentElement,r=n.defaultView;return{top:t.top+r.pageYOffset-a.clientTop,left:t.left+r.pageXOffset-a.clientLeft}}}catch(i){return{left:0,top:0}}};var Vn={"select:get":function(e,t){for(var n,a=e.options,r=e.selectedIndex,i="select-one"===e.type||0>r,o=i?null:[],l=i?r+1:a.length,s=0>r?l:i?r:0;l>s;s++)if(n=a[s],(n.selected||s===r)&&!n.disabled){if(t=n.value,i)return t;o.push(t)}return o},"select:set":function(e,t,n){t=[].concat(t);for(var a,r=0;a=e.options[r++];)(a.selected=t.indexOf(a.value)>-1)&&(n=!0);n||(e.selectedIndex=-1)}},In={},zn=["break,case,catch,continue,debugger,default,delete,do,else,false","finally,for,function,if,in,instanceof,new,null,return,switch,this","throw,true,try,typeof,var,void,while,with","abstract,boolean,byte,char,class,const,double,enum,export,extends","final,float,goto,implements,import,int,interface,long,native","package,private,protected,public,short,static,super,synchronized","throws,transient,volatile","arguments,let,yield,undefined"].join(",");zn.replace(/\w+/g,function(e){In[e]=!0});var Wn=/[a-z_$]/i,Yn=/[\s\uFEFF\xA0]/,Un=/(\$proxy\$[a-z]+)\d+$/,Xn=new ln(218),Gn=new ln(128),Zn=/\)\s*$/,Jn=/\)\s*\|/g,Kn=/\|\s*([$\w]+)/g,Qn=/"\s*\["/g,ea=/"\s*\(/g,ta=JSON.stringify;avalon.scan=function(e,t){e=e||Jt;var n=t?[].concat(t):[];nt(e,n)};var na=o("area,base,basefont,br,col,command,embed,hr,img,input,link,meta,param,source,track,wbr,noscript,script,style,textarea".toUpperCase()),aa=function(e,t,n){var a=e.getAttribute(t);if(a)for(var r,i=0;r=n[i++];)if(r.hasOwnProperty(a)&&"function"==typeof r[a])return r[a]},ra=tn&&e.MutationObserver?function(e){for(var t,n=e.firstChild;n;){var a=n.nextSibling;3===n.nodeType?t?(t.nodeValue+=n.nodeValue,e.removeChild(n)):t=n:t=null,n=a}}:0,ia=/^\s*::/,oa=/ms-(\w+)-?(.*)/,la=o("animationend,blur,change,input,click,dblclick,focus,keydown,keypress,keyup,mousedown,mouseenter,mouseleave,mousemove,mouseout,mouseover,mouseup,scan,scroll,submit"),sa=o("value,title,alt,checked,selected,disabled,readonly,enabled,href,src"),ca=/^if|widget|repeat$/,ua=/^each|with|html|include$/,fa=/^(ms-\S+|data-\S+|on[a-z]+|id|style|class|tabindex)$/,da=/\|\s*html(?:\b|$)/,va=/\|\|/g,pa=/(['"])(\\\1|.)+?\1/g,ha=function(){this.queue=[]};ha.prototype={render:function(e){if(!this.locked){this.locked=e?Jt.offsetHeight+10:1;var t=this;avalon.nextTick(function(){t.flush()})}},flush:function(){for(var e,t=0;e=this.queue[t++];)e.update();this.locked=0,this.queue=[]}};var ma=new ha,ga=[],ya=[],ba={$construct:function(){return avalon.mix.apply(null,arguments)},$ready:i,$init:i,$dispose:i,$container:null,$childReady:i,$replace:!1,$extend:null,$$template:function(e){return e}};avalon.components={},avalon.component=function(t,n){n&&(avalon.components[t]=avalon.mix({},ba,n));for(var a,r=0;a=ga[r];r++)t===a.fullName&&(ga.splice(r,1),r--,function(n,a,r,i){var o=1,l=n.library,s=avalon.libraries[l]||ba,c=Q(r),u=ot(n.vmodels,c.config||n.fullName),f=c.$id||c.identifier||en(i);delete c.config,delete c.$id,delete c.identifier;var d={},v=avalon.components[a.$extend];v?(avalon.mix(!0,d,v),d=v.$construct.call(r,d,{},{})):avalon.mix(!0,d,a),d=avalon.components[t].$construct.call(r,d,u,c),d.$refs={},d.$id=f;var p=d.$slot,h=d.$replace,m=d.$container,g=d.$template;delete d.$slot,delete d.$replace,delete d.$container,delete d.$template,delete d.$construct;var y=avalon.define(d)||{};r.msResolved=1,y.$init(y,r),s.$init(y,r);for(var b,$,x=r.childNodes,w={},C=0;$=x[C++];){var k=1===$.nodeType&&$.getAttribute("slot")||p;k&&(w[k]?w[k].push($):w[k]=[$])}y.$$template&&(avalon.clearHTML(r),r.innerHTML=y.$$template(g));for(C in w)if(y.hasOwnProperty(C)){var N=w[C];if(N.length){for(var A=Kt.cloneNode(!0),T=0;b=N[T++];)A.appendChild(b);y[C]=A}w[C]=null}w=null;var E=r.firstChild;h&&(E=r.firstChild,r.parentNode.replaceChild(E,r),E.msResolved=1,r=n.element=E),m&&m.appendChild(r),avalon.fireDom(r,"datasetchanged",{library:l,vm:y,childReady:1});var O=0,M=avalon.bind(r,"datasetchanged",function(t){if(t.childReady&&t.library===l&&(o+=t.childReady,y!==t.vm&&(y.$refs[t.vm.$id]=t.vm,-1===t.childReady&&(O++,y.$childReady(y,r,t)),t.stopPropagation())),0===o){var a=setTimeout(function(){clearTimeout(a),y.$ready(y,r),s.$ready(y,r)},O?Math.max(17*O,100):17);avalon.unbind(r,"datasetchanged",M),n.rollback=function(){try{y.$dispose(y,r),s.$dispose(y,r)}catch(e){}delete avalon.vmodels[y.$id]},j(n,ya),e.chrome&&r.addEventListener("DOMNodeRemovedFromDocument",function(){setTimeout(S)})}});if(nt(r,[y].concat(n.vmodels)),avalon.vmodels[y.$id]=y,r.childNodes.length)var H=setTimeout(function(){clearTimeout(H),avalon.fireDom(r,"datasetchanged",{library:l,vm:y,childReady:-1})},17);else avalon.fireDom(r,"datasetchanged",{library:l,vm:y,childReady:-1})}(a,avalon.components[t],a.element,a.widget))},avalon.fireDom=function(e,t,n){if(Ht.createEvent){var a=Ht.createEvent("Events");a.initEvent(t,!0,!0,n),avalon.mix(a,n),e.dispatchEvent(a)}else Jt.contains(e)&&(a=Ht.createEventObject(),avalon.mix(a,n),e.fireEvent("on"+t,a))},avalon.libraries=[],avalon.library=function(e,t){Ht.namespaces&&Ht.namespaces.add(e,"http://www.w3.org/1999/xhtml"),avalon.libraries[e]=avalon.mix({$init:i,$ready:i,$dispose:i},t||{})},avalon.library("ms");var $a=["autofocus,autoplay,async,allowTransparency,checked,controls","declare,disabled,defer,defaultChecked,defaultSelected","contentEditable,isMap,loop,multiple,noHref,noResize,noShade","open,readOnly,selected"].join(","),xa={};$a.replace(Ft,function(e){xa[e.toLowerCase()]=e});var wa={"accept-charset":"acceptCharset","char":"ch",charoff:"chOff","class":"className","for":"htmlFor","http-equiv":"httpEquiv"},Ca=["accessKey,bgColor,cellPadding,cellSpacing,codeBase,codeType,colSpan","dateTime,defaultValue,frameBorder,longDesc,maxLength,marginWidth,marginHeight","rowSpan,tabIndex,useMap,vSpace,valueType,vAlign"].join(",");Ca.replace(Ft,function(e){wa[e.toLowerCase()]=e});var ka=avalon.directive("attr",{init:function(e){if(e.expr=Y(e.expr.trim()),"include"===e.type){var t=e.element;dt(t,e),e.includeRendered=aa(t,"data-include-rendered",e.vmodels),e.includeLoaded=aa(t,"data-include-loaded",e.vmodels);var n=e.includeReplace=!!avalon(t).data("includeReplace");avalon(t).data("includeCache")&&(e.templateCache={}),e.start=Ht.createComment("ms-include"),e.end=Ht.createComment("ms-include-end"),n?(e.element=e.end,e._element=t,t.parentNode.insertBefore(e.end,t),t.parentNode.insertBefore(e.start,e.end)):(t.insertBefore(e.start,t.firstChild),t.appendChild(e.end))}},update:function(t){var n=this.element,a=this.param;if("href"===a||"src"===a){if("string"!=typeof t||Jt.hasAttribute||(t=t.replace(/&/g,"&")),n[a]=t,e.chrome&&"EMBED"===n.tagName){var r=n.parentNode,i=document.createComment("ms-src");r.replaceChild(i,n),r.replaceChild(n,i)}}else{var o=t===!1||null===t||void 0===t;!Zt&&wa[a]&&(a=wa[a]);var l=xa[a];if("boolean"==typeof n[l]&&(n[l]=!!t,t||(o=!0)),o)return n.removeAttribute(a);var s=It.test(n)?!1:Ht.namespaces&&isVML(n)?!0:a in n.cloneNode(!1);s?n[a]=t+"":n.setAttribute(a,t)}}});"title,alt,src,value,css,include,href".replace(Ft,function(e){on[e]=ka}),avalon.directive("class",{init:function(e){var t=e.param,a=e.type;if(!t||isFinite(t)?(e.param="",on.effect.init(e)):(n("ms-"+a+'-xxx="yyy"这种用法已经过时,请使用ms-'+a+'="xxx:yyy"'),e.expr="["+ta(t)+","+e.expr+"]",e.oldStyle=t),"hover"===a||"active"===a){if(!e.hasBindEvent){var r=e.element,i=avalon(r),o="mouseenter",l="mouseleave";if("active"===a){r.tabIndex=r.tabIndex||-1,o="mousedown",l="mouseup";var s=i.bind("mouseleave",function(){e.toggleClass&&i.removeClass(e.newClass)})}}var c=i.bind(o,function(){e.toggleClass&&i.addClass(e.newClass)}),u=i.bind(l,function(){e.toggleClass&&i.removeClass(e.newClass)});e.rollback=function(){i.unbind("mouseleave",s),i.unbind(o,c),i.unbind(l,u)},e.hasBindEvent=!0}},update:function(e){var t=this,n=avalon(this.element);t.newClass=e[0],t.toggleClass=!!e[1],t.oldClass&&t.newClass!==t.oldClass&&n.removeClass(t.oldClass),t.oldClass=t.newClass,"class"===t.type&&(t.oldStyle?n.toggleClass(t.oldStyle,!!e[1]):n.toggleClass(t.newClass,t.toggleClass))}}),"hover,active".replace(Ft,function(e){on[e]=on["class"]}),avalon.directive("css",{init:on.attr.init,update:function(e){avalon(this.element).css(this.param,e)}}),avalon.directive("data",{priority:100,update:function(e){var t=this.element,n="data-"+this.param;e&&"object"==typeof e?t[n]=e:t.setAttribute(n,String(e))}});{var Na=/^(?:checkbox|radio)$/,Aa=/^(?:radio|checked)$/;avalon.directive("duplex",{priority:2e3,init:function(e,t){function a(t){e.changed.call(this,t,e)}function r(){d=!0}function l(){d=!1}var s=e.element,c=e.vmodels;e.changed=aa(s,"data-duplex-changed",c)||i;var u=[],f=o("string,number,boolean,checked");"radio"===s.type&&""===e.param&&(e.param="checked"),e.param.replace(Vt,function(a){Na.test(s.type)&&Aa.test(a)&&("radio"===a&&n("ms-duplex-radio已经更名为ms-duplex-checked"),a="checked",e.isChecked=!0,e.xtype="radio"),"bool"===a?(a="boolean",n("ms-duplex-bool已经更名为ms-duplex-boolean")):"text"===a&&(a="string",n("ms-duplex-text已经更名为ms-duplex-string")),f[a]&&(t=!0),avalon.Array.ensure(u,a)}),t||u.push("string"),e.param=u.join("-"),e.changed=aa(s,"binding-duplex-changed",c)||i,e.xtype||(e.xtype="SELECT"===s.tagName?"select":"checkbox"===s.type?"checkbox":"radio"===s.type?"radio":/^change/.test(s.getAttribute("data-duplex-event"))?"change":"input"),e.bound=function(t,n){s.addEventListener(t,n,!1);var a=e.rollback;e.rollback=function(){s.avalonSetter=null,avalon.unbind(s,t,n),a&&a()}};var d=!1,v=function(){var t=s.value;if(!d&&t!==e.oldValue){var n=e.pipe(t,e,"get");e.setter(n),a.call(s,n)}};switch(e.xtype){case"radio":e.bound("click",function(){var t=e.pipe(s.value,e,"get");e.setter(t),a.call(s,t)});break;case"checkbox":e.bound("change",function(){var t=s.checked?"ensure":"remove",r=e.getter.apply(0,e.vmodels);Array.isArray(r)||(n("ms-duplex应用于checkbox上要对应一个数组"),r=[r]);var i=e.pipe(s.value,e,"get");avalon.Array[t](r,i),a.call(s,r)});break;case"change":e.bound("change",v);break;case"input":tn?e.bound("input",v):(e.bound("input",v),e.bound("compositionstart",r),e.bound("compositionend",l),e.bound("DOMAutoComplete",v));break;case"select":e.bound("change",function(){var t=avalon(s).val();t=Array.isArray(t)?t.map(function(t){return e.pipe(t,e,"get")}):e.pipe(t,e,"get"),t+""!==e.oldValue&&(e.setter(t),a.call(s,t))})}"input"===e.xtype&&/^(text|password|hidden)/.test(s.type)&&Oa(function(){if(Jt.contains(s))e.oldValue!==s.value&&v();else if(!s.msRetain)return!1}),s.avalonSetter=v;for(var p in avalon.vmodels){var h=avalon.vmodels[p];h.$fire("avalon-ms-duplex-init",e)}var m=e.pipe||(e.pipe=ct);m(null,e,"init")},update:function(e){var t,n=this.element,a=this;switch(this.xtype){case"input":case"change":t=this.pipe(e,this,"set"),t!==this.oldValue&&(n.value=this.oldValue=t);break;case"radio":t=a.isChecked?!!e:e+""===n.value,n.checked=t;break;case"checkbox":var r=[].concat(e);t=this.pipe(n.value,this,"get"),n.checked=r.indexOf(t)>-1;break;case"select":a._value=e,n.msHasEvent="selectDuplex",avalon.bind(n,"datasetchanged",function(e){if("selectDuplex"===e.bubble){var t=a._value,r=Array.isArray(t)?t.map(String):t+"";avalon(n).val(r),n.oldValue=r+"",a.changed.call(n,r)}})}"select"!==a.xtype&&a.changed.call(n,t)}})}avalon.duplexHooks={checked:{get:function(e,t){return!t.element.oldValue}},string:{get:function(e){return e},set:st},"boolean":{get:function(e){return"true"===e},set:st},number:{get:function(e,t){var n=parseFloat(e);if(-e===-n)return n;var a=/strong|medium|weak/.exec(t.element.getAttribute("data-duplex-number"))||["medium"];switch(a[0]){case"strong":return 0;case"medium":return""===e?"":0;case"weak":return e}},set:st}};var Ta,Ea=[];avalon.tick=function(e){1===Ea.push(e)&&(Ta=setInterval(ut,60))};var Oa=i;!new function(){function e(e){t[this.tagName].call(this,e),"function"==typeof this.avalonSetter&&this.oldValue!==e&&this.avalonSetter()}try{var t={},n=HTMLInputElement.prototype,a=HTMLTextAreaElement.prototype,r=HTMLInputElement.prototype;Object.getOwnPropertyNames(r),t.INPUT=Object.getOwnPropertyDescriptor(n,"value").set,Object.defineProperty(n,"value",{set:e}),t.TEXTAREA=Object.getOwnPropertyDescriptor(a,"value").set,Object.defineProperty(a,"value",{set:e})}catch(i){Oa=avalon.tick}},avalon.directive("effect",{priority:5,init:function(e){var t,n,a=e.expr,r=a.replace(pn,function(e){return e.replace(/./g,"0")}).indexOf(":");-1===r?(t=a,n=!0):(t=a.slice(0,r),n=a.slice(r+1)),t=vn.test(a)?Y(t):ta(t),e.expr="["+t+","+n+"]"},update:function(t){var n=t[0],a=this.element;if(a.getAttribute("data-effect-name")!==n){a.removeAttribute("data-effect-driver");var r=a.style,i=e.getComputedStyle?e.getComputedStyle(a):null,o=!1;if(i&&(Sa||Ha)){var l=r[La]||i[La];l&&"0s"!==l&&(a.setAttribute("data-effect-driver","t"),o=!0),o||(l=r[Da]||i[Da],l&&"0s"!==l&&(a.setAttribute("data-effect-driver","a"),o=!0))}o||avalon.effects[n]&&(a.setAttribute("data-effect-driver","j"),o=!0),o&&a.setAttribute("data-effect-name",n)}}}),avalon.effects={},avalon.effect=function(e,t){avalon.effects[e]=t};var Ma,ja,Sa=!1,Ha=!1,La=avalon.cssName("transition-duration"),Da=avalon.cssName("animation-duration");!new function(){var t,n={TransitionEvent:"transitionend",WebKitTransitionEvent:"webkitTransitionEnd",OTransitionEvent:"oTransitionEnd",otransitionEvent:"otransitionEnd"};for(var a in n){if(e[a]){t=n[a];break}try{{document.createEvent(a)}t=n[a];break}catch(r){}}"string"==typeof t&&(Sa=!0,Ma=t),n={AnimationEvent:"animationend",WebKitAnimationEvent:"webkitAnimationEnd"};var i;for(a in n)if(e[a]){i=n[a];break}"string"==typeof i&&(Sa=!0,ja=i)};var Ra=[],Pa=new ha;pt.prototype={contrustor:pt,enterClass:function(){return ht(this,"enter")},leaveClass:function(){return ht(this,"leave")},actionFun:function(e,t,n){if(!document.hidden){var a=this,r=a.el,i="leave"===e;e=i?"leave":"enter";var o=i?"enter":"leave";mt(a,"abort"+vt(o)),mt(a,"before"+vt(e)),i||t(r);var l=function(o){r.removeEventListener(a.cssEvent,a.cssCallback),i?(t(r),avalon(r).removeClass(a.cssClass)):"a"===a.driver&&avalon(r).removeClass(a.cssClass),o!==!0&&(mt(a,"after"+vt(e)),n&&n(r)),a.dispose()};a.useCss?(a.cssCallback&&a.cssCallback(!0),a.cssClass=ht(a,e),a.cssCallback=l,a.update=function(){r.addEventListener(a.cssEvent,a.cssCallback),i||"t"!==a.driver||avalon(r).removeClass(a.cssClass)},avalon(r).addClass(a.cssClass),Pa.render(!0),Pa.queue.push(a)):mt(a,e,l)}},enter:function(){this.actionFun.apply(this,["enter"].concat(avalon.slice(arguments)))},leave:function(){this.actionFun.apply(this,["leave"].concat(avalon.slice(arguments)))},dispose:function(){this.update=this.cssCallback=null,Ra.unshift(this)>100&&Ra.pop()}};var Ba=function(e,t){var n=Gt.call(arguments,0);"function"!=typeof n[2]&&n.splice(2,0,i),"function"!=typeof n[3]&&n.splice(3,0,i);var a=n[2],r=n[3],o=n[4],l=ft(e,o);if(!l)return a(),r(),!1;var s=t?"enter":"leave";l[s](a,r)};avalon.mix(avalon.effect,{apply:Ba,append:function(e,t,n,a){return Ba(e,1,function(){t.appendChild(e)},n,a)},before:function(e,t,n,a){return Ba(e,1,function(){t.parentNode.insertBefore(e,t)},n,a)},remove:function(e,t,n,a){return Ba(e,0,function(){e.parentNode===t&&t.removeChild(e)},n,a)}}),avalon.directive("html",{update:function(e){var t=this,n=this.element,a=1!==n.nodeType,r=a?n.parentNode:n;if(r){if(e=null==e?"":e,3===n.nodeType){var i=en("html");r.insertBefore(Ht.createComment(i),n),t.element=Ht.createComment(i+":end"),r.replaceChild(t.element,n),n=t.element}if("object"!=typeof e)var o=avalon.parseHTML(String(e));else if(11===e.nodeType)o=e;else if(1===e.nodeType||e.item){var l=1===e.nodeType?e.childNodes:e.item;for(o=Kt.cloneNode(!0);l[0];)o.appendChild(l[0])}if(l=avalon.slice(o.childNodes),a){for(var s=n.nodeValue.slice(0,-4);;){var c=n.previousSibling;if(!c||8===c.nodeType&&c.nodeValue===s)break;r.removeChild(c)}r.insertBefore(o,n)}else avalon.clearHTML(n).appendChild(o);tt(l,t.vmodels)}}}),avalon.directive("if",{priority:10,update:function(e){function t(){r.getAttribute(a.name)&&(r.removeAttribute(a.name),K(r,a.vmodels)),a.rollback=null}var n,a=this,r=this.element,i=a.stamp=+new Date,o=function(){i===a.stamp&&(a.recoverNode=null)};a.recoverNode&&a.recoverNode();try{if(!r.parentNode)return;n=r.parentNode}catch(l){return}if(e){if(8===r.nodeType){var s=a.keep,c=avalon.effect.apply(s,1,function(){i===a.stamp&&(r.parentNode.replaceChild(s,r),r=a.element=s,s.getAttribute("_required")&&(r.required=!0,r.removeAttribute("_required")),r.querySelectorAll&&avalon.each(r.querySelectorAll("[_required=true]"),function(e){e.required=!0,e.removeAttribute("_required")}),t())},o);c=c===!1}c||t()}else if(1===r.nodeType){r.required===!0&&(r.required=!1,r.setAttribute("_required","true"));try{avalon.each(r.querySelectorAll(":required"),function(e){r.required=!1,e.setAttribute("_required","true")})}catch(l){}var u=a.element=Ht.createComment("ms-if"),f=r.nextSibling;a.recoverNode=function(){a.recoverNode=null,u.parentNode!==n&&(n.insertBefore(u,f),a.keep=r)},avalon.effect.apply(r,0,function(){a.recoverNode=null,i===a.stamp&&(r.parentNode.replaceChild(u,r),a.keep=r,Rt.appendChild(r),a.rollback=function(){r.parentNode===Rt&&Rt.removeChild(r)})},o)}}});var qa=function(){return new e.XMLHttpRequest},_a=avalon.templateCache={};avalon.directive("include",{init:on.attr.init,update:function(e){var t=this,n=this.element,a=t.vmodels,r=t.includeRendered,i=t.effectName&&t.effectClass,o=t.templateCache,l=t.includeReplace,s=t.includeLoaded,c=l?n.parentNode:n,u=t._element;t.recoverNodes=t.recoverNodes||avalon.noop;var f=(l&&u.cloneNode(),function(f){var d=t._stamp=+new Date;if(s){var v=s.apply(c,[f].concat(a));"string"==typeof v&&(f=v)}r&&X(c,function(){r.call(c)},0/0);var p=t.includeLastID||"_default";t.includeLastID=e;var h=o&&o[p]||Ht.createElement(n.tagName||t._element.tagName);i&&(h.className=i,c.insertBefore(h,t.start)),(o||{})[p]=h;var m=t.recoverNodes();for(m&&c.insertBefore(m,t.end);;){var g=t.start.nextSibling;if(!g||g===h||g===t.end)break;h.appendChild(g)}avalon.effect.remove(h,c,function(){o&&d===t._stamp&&Rt.appendChild(h)},t);var y=c,b=avalon.noop,$=avalon.noop,x=gt(t,e,f),w=avalon.slice(x.childNodes);l&&i?(y=u,y.innerHTML="",y.setAttribute("ms-skip","true"),c.insertBefore(y,t.end.nextSibling),b=function(){y.insertBefore(x,null)},$=function(){t.recoverNodes=avalon.noop,d===t._stamp&&(x=yt(w),c.insertBefore(x,t.end),tt(w,a)),y.parentNode===c&&c.removeChild(y)},t.recoverNodes=function(){return t.recoverNodes=avalon.noop,yt(w)}):b=function(){c.insertBefore(x,t.end),tt(w,a)},avalon.effect.apply(y,"enter",b,$)});if("src"===t.param)if("string"==typeof _a[e])avalon.nextTick(function(){f(_a[e])});else if(Array.isArray(_a[e]))_a[e].push(f);else{var d=qa();d.onload=function(){for(var t,n=d.responseText,a=0;t=_a[e][a++];)t(n);_a[e]=n},_a[e]=[f],d.open("GET",e,!0),"withCredentials"in d&&(d.withCredentials=!0),d.setRequestHeader("X-Requested-With","XMLHttpRequest"),d.send(null)}else{var v=e&&1===e.nodeType?e:Ht.getElementById(e);v&&avalon.nextTick(function(){f(v.value||v.innerText||v.innerHTML)})}}});var Fa=/\(([^)]*)\)/,Va=avalon.directive("on",{priority:3e3,init:function(e){var t=e.expr;e.type="on";var n=e.param.replace(/-\d+$/,"");if("function"==typeof Va[n+"Hook"]&&Va[n+"Hook"](e),t.indexOf("(")>0&&t.indexOf(")")>-1){var a=(t.match(Fa)||["",""])[1].trim();(""===a||"$event"===a)&&(t=t.replace(Fa,""))}e.expr=t},update:function(e){var t=this,n=this.element;e=function(e){var n=t.getter||i;return n.apply(this,t.args.concat(e))};var a=t.param.replace(/-\d+$/,"");if("scan"===a)e.call(n,{type:a});else if("function"==typeof t.specialBind)t.specialBind(n,e);else var r=avalon.bind(n,a,e);t.rollback=function(){"function"==typeof t.specialUnbind?t.specialUnbind():avalon.unbind(n,a,r)}}});avalon.directive("repeat",{priority:90,init:function(e){var t=e.type;e.cache={},e.enterCount=0;var n=e.element;if(1===n.nodeType){n.removeAttribute(e.name),dt(n,e),e.param=e.param||"el",e.sortedCallback=aa(n,"data-with-sorted",e.vmodels);var a=aa(n,"data-"+t+"-rendered",e.vmodels),r=en(t),i=Ht.createComment(r+":start"),o=e.element=Ht.createComment(r+":end");if(e.signature=r,e.start=i,e.template=Kt.cloneNode(!1),"repeat"===t){var l=n.parentNode;l.replaceChild(o,n),l.insertBefore(i,o),e.template.appendChild(n)}else{for(;n.firstChild;)e.template.appendChild(n.firstChild);n.appendChild(i),n.appendChild(o),l=n}if(e.element=o,a)var s=avalon.bind(l,"datasetchanged",function(){a.apply(l,l.args),avalon.unbind(l,"datasetchanged",s),l.msRendered=a})}},update:function(e,t){var n=this,a=this.xtype;this.enterCount+=1;var r=!t;if(r){n.$outer={};var i="$key",o="$val";"array"===a&&(i="$first",o="$last");for(var l,s=0;l=n.vmodels[s++];)if(l.hasOwnProperty(i)&&l.hasOwnProperty(o)){n.$outer=l;break}}var c=this.track;if(n.sortedCallback){var f=n.sortedCallback.call($,c);f&&Array.isArray(f)&&(c=f)}var d="move";n.$repeat=e;var v=[],p=r&&Kt.cloneNode(!1),h=[],m=this.param,g=avalon.mix({},this.cache),y=this.element,b=c.length,$=y.parentNode;for(s=0;b>s;s++){var x=c[s],w=g[x];if(w)v.push({}),g[x]=!0;else{w=Ct(this),"array"===a?(d="add",w.$id=x,w[m]=e[s]):(d="append",w.$key=x,w.$val=e[x]),this.cache[x]=w;var C=w.$anchor||(w.$anchor=y.cloneNode(!1));C.nodeValue=this.signature,wt(n,p,w,v,r&&!n.effectDriver),At(w,n,a)}1===this.enterCount&&(w.$active=!1,w.$oldIndex=w.$index,w.$active=!0,w.$index=s),"array"===a?(w.$first=0===s,w.$last=s===b-1):w.$val=k(e[x]),h.push(w)}if(this.proxies=h,r&&!n.effectDriver)$.insertBefore(p,y),v.forEach(function(e){tt(e.nodes||[],e.vmodels),e.nodes=e.vmodels=null});else{var N=n.staggerIndex=0;for(x in g)g[x]!==!0&&(d="del",xt(g[x].$anchor,n),Ot(this.cache,x,m),g[x]=null);for(s=0;b>s;s++){w=h[s],x="array"===a?w.$id:w.$key;var A=h[s-1],T=A?A.$anchor:n.start;g[x]?w.$index!==w.$oldIndex&&!function(e,t){N=$t(n.effectEnterStagger,function(){var a=xt(e.$anchor),r=avalon.slice(a.childNodes);$.insertBefore(a,t.nextSibling),bt(r,1,n)},N)}(w,T):!function(e,t){var a=e.nodes,r=e.vmodels;a&&(N=$t(n.effectEnterStagger,function(){$.insertBefore(e.content,t.nextSibling),tt(a,r),bt(a,1,n)},N)),e.nodes=e.vmodels=null}(v[s],T)}}if(!e.$track)for(x in this.cache)Ot(this.cache,x,m);!function(e){$.args=e,$.msRendered&&$.msRendered.apply($,e)}(u.newWatch?arguments:[d]);var E=setTimeout(function(){clearTimeout(E),avalon.fireDom($,"datasetchanged",{bubble:$.msHasEvent})});this.enterCount-=1}}),"with,each".replace(Ft,function(e){on[e]=avalon.mix({},on.repeat,{priority:1400})});var Ia=[],za=[];avalon.directive("text",{update:function(e){var t=this.element;if(e=null==e?"":e,3===t.nodeType)try{t.data=e}catch(n){}else t.textContent=e}}),avalon.parseDisplay=Mt,avalon.directive("visible",{init:function(){},update:function(e){var t=this.element,n=this,a=n.stamp=+new Date;e?(t.style.display="none",avalon.effect.apply(t,1,function(){if(a===n.stamp){var e=t.getAttribute("data-effect-driver")||"a";/^[atn]/.test(e)&&(this.effectName||(t.style.display=""),"none"===avalon(t).css("display")&&(t.style.display=Mt(t.nodeName)))}})):avalon.effect.apply(t,0,function(){a===n.stamp&&(t.style.display="none")})}});var Wa=/]*>([\S\s]*?)<\/script\s*>/gim,Ya=/\s+(on[^=\s]+)(?:=("[^"]*"|'[^']*'|[^\s>]+))?/g,Ua=/<\w+\b(?:(["'])[^"]*?(\1)|[^>])*>/gi,Xa={a:/\b(href)\=("javascript[^"]*"|'javascript[^']*')/gi,img:/\b(src)\=("javascript[^"]*"|'javascript[^']*')/gi,form:/\b(action)\=("javascript[^"]*"|'javascript[^']*')/gi},Ga=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Za=/([^\#-~| |!])/g,Ja=avalon.filters={uppercase:function(e){return e.toUpperCase()},lowercase:function(e){return e.toLowerCase()},truncate:function(e,t,n){return t=t||30,n="string"==typeof n?n:"...",e.length>t?e.slice(0,t-n.length)+n:String(e)},$filter:function(e){for(var t=1,n=arguments.length;n>t;t++){var a=arguments[t],r=avalon.filters[a[0]];if("function"==typeof r){var i=[e].concat(a.slice(1));e=r.apply(null,i)}}return e},camelize:R,sanitize:function(e){return e.replace(Wa,"").replace(Ua,function(e){var t=e.toLowerCase().match(/<(\w+)\s/);if(t){var n=Xa[t[1]];n&&(e=e.replace(n,function(e,t,n){var a=n.charAt(0);return t+"="+a+"javascript:void(0)"+a}))}return e.replace(Ya," ").replace(/\s+/g," ")})},escape:function(e){return String(e).replace(/&/g,"&").replace(Ga,function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1);return"&#"+(1024*(t-55296)+(n-56320)+65536)+";"}).replace(Za,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")},currency:function(e,t,n){return(t||"¥")+jt(e,isFinite(n)?n:2)},number:jt};!new function(){function e(e){return parseInt(e,10)||0}function t(e,t,n){var a="";for(0>e&&(a="-",e=-e),e=""+e;e.length0||o>-a)&&(o+=a),0===o&&-12===a&&(o=12),t(o,n,r)}}function a(e,t){return function(n,a){var r=n["get"+e](),i=(t?"SHORT"+e:e).toUpperCase();return a[i][r]}}function r(e){var n=-1*e.getTimezoneOffset(),a=n>=0?"+":"";return a+=t(Math[n>0?"floor":"ceil"](n/60),2)+t(Math.abs(n%60),2)}function i(e,t){return e.getHours()<12?t.AMPMS[0]:t.AMPMS[1]}var o={yyyy:n("FullYear",4),yy:n("FullYear",2,0,!0),y:n("FullYear",1),MMMM:a("Month"),MMM:a("Month",!0),MM:n("Month",2,1),M:n("Month",1,1),dd:n("Date",2),d:n("Date",1),HH:n("Hours",2),H:n("Hours",1),hh:n("Hours",2,-12),h:n("Hours",1,-12),mm:n("Minutes",2),m:n("Minutes",1),ss:n("Seconds",2),s:n("Seconds",1),sss:n("Milliseconds",3),EEEE:a("Day"),EEE:a("Day",!0),a:i,Z:r},l=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,s=/^\/Date\((\d+)\)\/$/;Ja.date=function(t,n){var a,r,i=Ja.date.locate,c="",u=[];if(n=n||"mediumDate",n=i[n]||n,"string"==typeof t)if(/^\d+$/.test(t))t=e(t);else if(s.test(t))t=+RegExp.$1;else{var f=t.trim(),d=[0,0,0,0,0,0,0],v=new Date(0);f=f.replace(/^(\d+)\D(\d+)\D(\d+)/,function(t,n,a,r){var i=4===r.length?[r,n,a]:[n,a,r];return d[0]=e(i[0]),d[1]=e(i[1])-1,d[2]=e(i[2]),""});var p=v.setFullYear,h=v.setHours;f=f.replace(/[T\s](\d+):(\d+):?(\d+)?\.?(\d)?/,function(t,n,a,r,i){return d[3]=e(n),d[4]=e(a),d[5]=e(r),i&&(d[6]=Math.round(1e3*parseFloat("0."+i))),""});var m=0,g=0;f=f.replace(/Z|([+-])(\d\d):?(\d\d)/,function(t,n,a,r){return p=v.setUTCFullYear,h=v.setUTCHours,n&&(m=e(n+a),g=e(n+r)),""}),d[3]-=m,d[4]-=g,p.apply(v,d.slice(0,3)),h.apply(v,d.slice(3)),t=v}if("number"==typeof t&&(t=new Date(t)),"date"===avalon.type(t)){for(;n;)r=l.exec(n),r?(u=u.concat(r.slice(1)),n=u.pop()):(u.push(n),n=null);return u.forEach(function(e){a=o[e],c+=a?a(t,i):e.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),c}};var c={AMPMS:{0:"上午",1:"下午"},DAY:{0:"星期日",1:"星期一",2:"星期二",3:"星期三",4:"星期四",5:"星期五",6:"星期六"},MONTH:{0:"1月",1:"2月",2:"3月",3:"4月",4:"5月",5:"6月",6:"7月",7:"8月",8:"9月",9:"10月",10:"11月",11:"12月"},SHORTDAY:{0:"周日",1:"周一",2:"周二",3:"周三",4:"周四",5:"周五",6:"周六"},fullDate:"y年M月d日EEEE",longDate:"y年M月d日",medium:"yyyy-M-d H:mm:ss",mediumDate:"yyyy-M-d",mediumTime:"H:mm:ss","short":"yy-M-d ah:mm",shortDate:"yy-M-d",shortTime:"ah:mm"};c.SHORTMONTH=c.MONTH,Ja.date.locate=c};var Ka,Qa=[],er=function(e){for(Ka=!0,Dt&&(modules["domReady!"].state=4,Dt.checkDeps());e=Qa.shift();)e(avalon)};"complete"===Ht.readyState?setTimeout(er):Ht.addEventListener("DOMContentLoaded",er),e.addEventListener("load",er),avalon.ready=function(e){Ka?e(avalon):Qa.push(e)},avalon.config({loader:!0}),avalon.ready(function(){avalon.scan(Ht.body)}),"function"==typeof define&&define.amd&&define("avalon",[],function(){return avalon});var tr=e.avalon;return avalon.noConflict=function(t){return t&&e.avalon===avalon&&(e.avalon=tr),avalon},void 0===t&&(e.avalon=avalon),avalon}); \ No newline at end of file diff --git a/dist/avalon.shim.js b/dist/avalon.shim.js index de3dcc76e..7da330517 100644 --- a/dist/avalon.shim.js +++ b/dist/avalon.shim.js @@ -5,7 +5,7 @@ http://weibo.com/jslouvre/ Released under the MIT license - avalon.shim.js 1.5.3 built in 2015.10.4 + avalon.shim.js 1.5.3 built in 2015.10.9 support IE6+ and other browsers ==================================================*/ (function(global, factory) { @@ -1128,7 +1128,7 @@ function observeObject(source, options) { options = options || nullObject var force = options.force || nullObject var old = options.old - var oldAccessors = typeof old === "object" ? old.$accessors : nullObject + var oldAccessors = old && old.$accessors || nullObject var $vmodel = new Component() //要返回的对象, 它在IE6-8下可能被偷龙转凤 var accessors = {} //监控属性 var hasOwn = {} @@ -3316,10 +3316,10 @@ function scanExpr(str) { } function scanText(textNode, vmodels, index) { - var bindings = [] + var bindings = [], tokens = scanExpr(textNode.data) if (tokens.length) { - for (var i = 0; token = tokens[i++];) { + for (var i = 0, token; token = tokens[i++];) { var node = DOC.createTextNode(token.expr) //将文本转换为文本节点,并替换原来的文本节点 if (token.type) { token.expr = token.expr.replace(roneTime, function () { diff --git a/dist/avalon.shim.min.js b/dist/avalon.shim.min.js index e218f0e1d..593bbccf5 100644 --- a/dist/avalon.shim.min.js +++ b/dist/avalon.shim.min.js @@ -1,3 +1,3 @@ -!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("Avalon requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(){e.console&&avalon.config.debug&&Function.apply.call(console.log,console,arguments)}function a(e){return Function.apply(r,e)}function r(){}function i(e,t){"string"==typeof e&&(e=e.match(Kt)||[]);for(var n={},a=void 0!==t?t:1,r=0,i=e.length;i>r;r++)n[e[r]]=a;return n}function o(){if(e.VBArray){var t=document.documentMode;return t?t:e.XMLHttpRequest?7:6}return 0/0}function l(e){return tn.test(rn.call(e))}function s(e,t){return e=Math.floor(e)||0,0>e?Math.max(t+e,0):Math.min(e,t)}function c(e){if(!e)return!1;var t=e.length;if(t===t>>>0){var n=rn.call(e).slice(8,-1);if(/(?:regexp|string|function|window|global)$/i.test(n))return!1;if("Array"===n)return!0;try{return{}.propertyIsEnumerable.call(e,"length")===!1?/^\s?function/.test(e.item||e.callee):!0}catch(a){return!e.window}}return!1}function u(e,t,n){var a="for(var "+e+"i=0,n = this.length; i < n; i++){"+t.replace("_","((i in this) && fn.call(scope,this[i],i,this))")+"}"+n;return Function("fn,scope",a)}function f(e,t){try{for(;t=t.parentNode;)if(t===e)return!0;return!1}catch(n){return!1}}function d(){return(new XMLSerializer).serializeToString(this)}function p(e,t){if(e&&e.childNodes)for(var n,a=e.childNodes,r=0;n=a[r++];)if(n.tagName){var i=It.createElementNS(En,n.tagName.toLowerCase());on.forEach.call(n.attributes,function(e){i.setAttribute(e.name,e.value)}),p(n,i),t.appendChild(i)}}function v(e){var t={};for(var n in e)t[n]=e[n];var a=t.target=e.srcElement;if(0===e.type.indexOf("key"))t.which=null!=e.charCode?e.charCode:e.keyCode;else if(_n.test(e.type)){var r=a.ownerDocument||It,i="BackCompat"===r.compatMode?r.body:r.documentElement;t.pageX=e.clientX+(i.scrollLeft>>0)-(i.clientLeft>>0),t.pageY=e.clientY+(i.scrollTop>>0)-(i.clientTop>>0),t.wheelDeltaY=t.wheelDelta,t.wheelDeltaX=0}return t.timeStamp=new Date-0,t.originalEvent=e,t.preventDefault=function(){e.returnValue=!1},t.stopPropagation=function(){e.cancelBubble=!0},t}function h(e){for(var t in e)if(an.call(e,t)){var n=e[t];"function"==typeof h.plugins[t]?h.plugins[t](n):"object"==typeof h[t]?avalon.mix(h[t],n):h[t]=n}return this}function m(e){return(e+"").replace(Fn,"\\$&")}function y(e,t){var n=this.$events||(this.$events={}),a=n[e]||(n[e]=[]);if("function"==typeof t){var i=t;i.uniqueNumber=Math.random(),t={element:cn,type:"user-watcher",handler:r,vmodels:[this],expr:e,uniqueNumber:i.uniqueNumber},t.wildcard=/\*/.test(e)}if(t.update)t.oneTime||avalon.Array.ensure(a,t);else{if(/\w\.*\B/.test(e)){t.getter=r;var o=this;t.update=function(){var e=this.fireArgs||[];e[2]&&t.handler.apply(o,e),delete this.fireArgs},a.sync=!0,avalon.Array.ensure(a,t)}else avalon.injectBinding(t);i&&(t.handler=i)}return function(){t.update=t.getter=t.handler=r,t.element=It.createElement("a")}}function g(e,t){var n=this.$events;if(n&&n[e]){t&&(t[2]=e),x(n[e],t);var a=this.$up;a&&(this.$pathname&&g.call(a,this.$pathname+"."+e,t),g.call(a,"*."+e,t))}else if(a=this.$up){var r=this.$pathname+"."+e,i=r.split(".");-1===i.indexOf("*")?(g.call(a,r,t),i[1]="*",g.call(a,i.join("."),t)):g.call(a,r,t)}}function b(e,t){for(;;){if(e.$watch){var n=e.$events||(e.$events={}),a=n[t]||(n[t]=[]);return void Qn.collectDependency(a)}if(e=e.$up,!e)break;t=e.$pathname+"."+t}}function x(e,t){if(e){new Date-na>444&&"object"==typeof e[0]&&F();for(var n,a=[],r=[],i=0;n=e[i++];)"user-watcher"===n.type?a.push(n):r.push(n);if(h.async){for(fr.render(),i=0;n=r[i++];)if(n.update){var o=H(n);fr.queue[o]||(fr.queue[o]=1,fr.queue.push(n))}}else for(i=0;n=r[i++];)n.update&&n.update();for(i=0;n=a[i++];)(t&&t[2]===n.expr||n.wildcard)&&(n.fireArgs=t),n.update()}}function $(e,t){return t=t||{},t.watch=!0,C(e,t)}function w(){}function C(e,t){function a(e){return u[e]===!0}if(!e||e.$id&&e.$accessors)return e;t=t||Zt;var r=t.force||Zt,o=t.old,l="object"==typeof o?o.$accessors:Zt,s=new w,c={},u={},f=[],d=[],p={};e.$skipArray&&(p=i(e.$skipArray),delete e.$skipArray);var v=e.$computed;if(v){delete e.$computed;for(var h in v)u[h]=!0,function(e,t){var n;c[e]={get:function(){return n=t.get.call(this)},set:function(a){if("function"==typeof t.set){var r=n;t.set.call(this,a);var i=this[e];this.$fire&&i!==r&&this.$fire(e,i,r)}},enumerable:!0,configurable:!0}}(h,v[h])}for(h in e){var m=e[h];qn[h]||(u[h]=!0),"function"==typeof m||m&&m.nodeType||!r[h]&&("$"===h.charAt(0)||qn[h]||p[h])?f.push(h):k(m)?(n("warning:计算属性建议放在$computed对象中统一定义"),function(e,t){var n;c[e]={get:function(){return n=t.get.call(this)},set:function(a){if("function"==typeof t.set){var r=n;t.set.call(this,a);var i=this[e];this.$fire&&i!==r&&this.$fire(e,i,r)}},enumerable:!0,configurable:!0}}(h,m)):(d.push(h),c[h]=l[h]?l[h]:N(h,m))}c.$model=Yn,s=zn(s,c,e),f.forEach(function(t){s[t]=e[t]}),A(s,"$id","anonymous"),A(s,"$up",o?o.$up:null),A(s,"$track",Object.keys(u)),A(s,"$active",!1),A(s,"$pathname",o?o.$pathname:""),A(s,"$accessors",c),A(s,"hasOwnProperty",a),t.watch&&(A(s,"$watch",function(){return y.apply(s,arguments)}),A(s,"$fire",function(e,t){if(0===e.indexOf("all!")){var n=e.slice(4);for(var a in avalon.vmodels){var r=avalon.vmodels[a];r.$fire&&r.$fire.apply(r,[n,t])}}else g.call(s,e,[t])})),d.forEach(function(t){var n=s[t]=e[t];n&&"object"==typeof n&&(n.$up=s,n.$pathname=t),g.call(s,t)});for(h in v)m=s[h];return s.$active=!0,s}function k(e){if(e&&"object"==typeof e){for(var t in e)if("get"!==t&&"set"!==t)return!1;return"function"==typeof e.get}}function N(e,t){var n;return t=0/0,{get:function(){return this.$active&&b(this,e),t},set:function(a){if(t!==a){var r=t;n=T(a,t),n?t=n:(n=void 0,t=a),Object(n)===n&&(n.$pathname=e,n.$up=this),this.$active&&g.call(this,e,[t,r])}},enumerable:!0,configurable:!0}}function T(e,t,n,a){if(Array.isArray(e))return E(e,t,a);if(avalon.isPlainObject(e)){if(t){var r=Xn(e),i=Xn(t);if(r.join(";")===i.join(";")){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);return t}t.$active=!1}return C(e,{old:t,watch:a})}return n?e:void 0}function E(e,t,n){if(t){var a=[0,t.length].concat(e);return t.splice.apply(t,a),t}for(var r in Zn)e[r]=Zn[r];A(e,"$up",null),A(e,"$pathname",""),A(e,"$track",M(e.length)),e._=C({length:0/0},{watch:!0}),e._.length=e.length,e._.$watch("length",function(t,n){g.call(e.$up,e.$pathname+".length",[t,n])}),n&&A(e,"$watch",function(){return y.apply(e,arguments)}),sn?Object.defineProperty(e,"$model",Yn):e.$model=_(e);for(var i=0,o=e.length;o>i;i++){var l=e[i]=T(e[i],0,1,1);Object(l)===l&&(l.$up=e)}return e}function A(e,t,n){In?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!1,configurable:!0}):e[t]=n}function _(e){var t=avalon.type(e);if("array"===t){for(var n=[],a=0;aa;a++){n[a]=e[a];var i=t[a];i in n?(e[a]=n[i],delete n[i]):e[a]=e[i]}}function M(e){for(var t=[],n=0;e>n;n++)t[n]=pn("$proxy$each");return t}function j(e,t,n){switch(t){case"push":case"unshift":n=M(n.length);break;case"splice":if(n.length>2){{n[1],n.length-2}n=[n[0],n[1]].concat(M(n.length-2))}}Array.prototype[t].apply(e,n)}function L(e,t){t.oneTime||e&&avalon.Array.ensure(e,t)&&t.element&&(P(t,e),new Date-na>444&&F())}function D(e,t){for(var n,a=[],r=0;n=e[r++];)a.push(t?n.$id:n.$key);return a.join(";")}function H(e){if(!e.uniqueNumber){var t=e.element;e.uniqueNumber=t?1!==t.nodeType?e.type+(e.pos||0)+"-"+H(t.parentNode):e.name+"-"+H(t):++ea}return e.uniqueNumber}function P(e,t){var n=e.lists||(e.lists=[]),a=H(e);avalon.Array.ensure(n,t),t.$uuid=t.$uuid||pn(),ta[a]||(ta[a]=1,ta.push(e))}function F(e){for(var t=ta.length,n=t,a=[],r={},i={};e=ta[--t];){var o=e.type;i[o]?i[o]++:(i[o]=1,a.push(o))}var l=!1;if(a.forEach(function(e){aa[e]!==i[e]&&(r[e]=1,l=!0)}),t=n,l)for(;e=ta[--t];)if(null!==e.element){if(r[e.type]&&R(e.element)){ta.splice(t,1),delete ta[e.uniqueNumber];for(var s,c=e.lists,u=0;s=c[u++];)avalon.Array.remove(c,s),avalon.Array.remove(s,e);B(e)}}else ta.splice(t,1);aa=i,na=new Date}function B(e){delete ta[e.uniqueNumber],e.element=null,e.rollback&&e.rollback();for(var t in e)e[t]=null}function R(e){try{{e.parentNode.nodeType}}catch(t){return!0}return e.ifRemove&&!cn.contains(e.ifRemove)&&Wt===e.parentNode?(e.parentNode&&e.parentNode.removeChild(e),!0):e.msRetain?0:1===e.nodeType?!cn.contains(e):!avalon.contains(cn,e)}function q(e){var t=e.nodeName;return t.toLowerCase()===t&&e.scopeName&&""===e.outerText}function V(e){"url(#default#VML)"!==e.currentStyle.behavior&&(e.style.behavior="url(#default#VML)",e.style.display="inline-block",e.style.zoom=1)}function I(e){return e.replace(/([a-z\d])([A-Z]+)/g,"$1-$2").toLowerCase()}function z(e){return!e||e.indexOf("-")<0&&e.indexOf("_")<0?e:e.replace(/[-_][^-_]/g,function(e){return e.charAt(1).toUpperCase()})}function W(e){if(!("classList"in e)){e.classList={node:e};for(var t in da)e.classList[t.slice(1)]=da[t]}return e.classList}function X(e){try{if("object"==typeof e)return e;e="true"===e?!0:"false"===e?!1:"null"===e?null:+e+""===e?+e:pa.test(e)?avalon.parseJSON(e):e}catch(t){}return e}function Y(e){return e.window&&e.document?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}function G(e,t){if(e.offsetWidth<=0){if(Aa.test(ga["@:get"](e,"display"))){var n={node:e};for(var a in Ea)n[a]=e.style[a],e.style[a]=Ea[a];t.push(n)}var r=e.parentNode;r&&1===r.nodeType&&G(r,t)}}function U(e){var t=e.tagName.toLowerCase();return"input"===t&&/checkbox|radio/.test(e.type)?"checked":t}function J(e,t){var n=[],r=!!t;t=t||0;for(var i="unknown",o="",l=0;lu;u++)if(i.length){var d="vm"+o+"_"+u;s.push(d),c.push(t[u]),l.push.apply(l,K(i,t[u],d,n))}n.args=c;var p=n.type,v=t.map(function(e){return String(e.$id).replace(Da,"$1")})+e+p,h=Pa.get(v);if(h){if("duplex"===p){var m=Pa.get(v+"setter");n.setter=m.apply(m,n.args)}return n.getter=h}if(l.length||l.push("fix"+o),"duplex"===p){var y={};l.forEach(function(e){var t=e.split("=");y[t[0].trim()]=t[1].trim()}),e=e.replace(/[\$\w]+/,function(e){return y[e]?y[e]:e});var g=a(s.concat("'use strict';return function(vvv){"+e+" = vvv\n}\n"));Pa.put(v+"setter",g),n.setter=g.apply(g,n.args)}if("on"===p){-1===e.indexOf("(")?e+=".call(this, $event)":e=e.replace("(",".call(this,"),s.push("$event"),e="\nreturn "+e+";";var b=e.lastIndexOf("\nreturn"),x=e.slice(0,b),$=e.slice(b);e=x+"\n"+$}else e="\nreturn "+e+";";return h=a(s.concat("'use strict';\nvar "+l.join(",\n")+e)),Pa.put(v,h)}function tt(e){var t=Dn.test(e);if(t){var n=pt(e);return 1===n.length?n[0].expr:n.map(function(e){return e.type?"("+e.expr+")":za(e.expr)}).join(" + ")}return e}function nt(e){return e=e.replace(Fa,"").replace(Ba,function(){return"],|"}).replace(Ra,function(e,t){return"["+za(t)}).replace(qa,function(){return'"],["'}).replace(Va,function(){return'",'})+"]",a(["return ["+e+"]"])()}function at(e,t,n){var a=setTimeout(function(){var r=e.innerHTML;clearTimeout(a),r===n?t():at(e,t,r)})}function rt(e,t){var n=e.getAttribute("avalonctrl")||t.$id;e.setAttribute("avalonctrl",n),t.$events&&(t.$events.expr=e.tagName+'[avalonctrl="'+n+'"]')}function it(e,t){for(var n,a=0;n=e[a++];)n.vmodels=t,xn[n.type].init(n),avalon.injectBinding(n),n.getter&&1===n.element.nodeType&&n.element.removeAttribute(n.name);e.length=0}function ot(e,t){return e.priority-t.priority}function lt(e,t,a){var r=!0;if(t.length){for(var i,o=ir?ir(e):e.attributes,l=[],s={},c=0;i=o[c++];){var u=i.name;if(!s[u]&&(s[u]=1,i.specified&&(a=u.match(Ua)))){var f=a[1],d=a[2]||"",p=i.value;if(Ja[f]?(d=f,f="on"):Za[f]&&(d=f,f="attr",u="ms-"+f+"-"+d,n("warning!请改用"+u+"代替"+i.name+"!")),xn[f]){var v=p.replace(Ga,""),h=p!==v,m={type:f,param:d,element:e,name:u,expr:v,oneTime:h,uniqueNumber:i.name+"-"+H(e),priority:(xn[f].priority||10*f.charCodeAt(0))+(Number(d.replace(/\D/g,""))||0)};if("html"===f||"text"===f){var y=dt(p).filters;m.expr=m.expr.replace(y,""),m.filters=y.replace(lr,function(){return m.type="html",m.group=1,""}).trim()}else if("duplex"===f)var g=u;else if("ms-if-loop"===u)m.priority+=100;else if("ms-attr-value"===u)var b=u;l.push(m)}}}if(l.length){for(l.sort(ot),g&&b&&"INPUT"===e.nodeName&&"text"===e.type&&n("warning!一个控件不能同时定义ms-attr-value与"+g),c=0;m=l[c];c++){if(f=m.type,Ka.test(f))return it(l.slice(0,c+1),t);r&&(r=!Qa.test(f))}it(l,t)}}r&&!Wa[e.tagName]&&(mt(e)?e.msResolved:1)&&(Ya&&Ya(e),ct(e,t))}function st(e){for(var t,n=ir?ir(e):e.attributes,a={},r=0;t=n[r++];)t.specified&&!or.test(t.name)&&(a[z(t.name)]=X(t.value));return a}function ct(e,t){var n=avalon.slice(e.childNodes);ut(n,t)}function ut(e,t){for(var n,a=0;n=e[a++];)switch(n.nodeType){case 1:var r=n;if(ft(n,t),!r.msResolved&&r.parentNode&&1===r.parentNode.nodeType){var i=mt(r);if(i){var o=r.localName?r.localName.replace(i+":",""):r.nodeName,l=i+":"+z(o);dr.push({library:i,element:r,fullName:l,widget:o,vmodels:t,name:"widget"}),avalon.components[l]&&avalon.component(l)}}n.msHasEvent&&avalon.fireDom(n,"datasetchanged",{bubble:n.msHasEvent});break;case 3:Dn.test(n.nodeValue)&&vt(n,t,a)}}function ft(e,t,a){var r=e.getAttribute("ms-skip");if(!e.getAttributeNode)return n("warning "+e.tagName+" no getAttributeNode method");var i=e.getAttributeNode("ms-important"),o=e.getAttributeNode("ms-controller");if("string"!=typeof r){if(a=i||o){var l=avalon.vmodels[a.value];if(!l)return;t=a===i?[l]:[l].concat(t);var s=a.name;e.removeAttribute(s),avalon(e).removeClass(s),rt(e,l)}lt(e,t)}}function dt(e){if(e.indexOf("|")>0){var t=e.replace(cr,function(e){return Array(e.length+1).join("1")}),n=t.replace(sr,"ᄢ㍄").indexOf("|");if(n>-1)return{type:"text",filters:e.slice(n).trim(),expr:e.slice(0,n)}}return{type:"text",expr:e,filters:""}}function pt(e){for(var t,n,a=[],r=0;;){if(n=e.indexOf(jn,r),-1===n)break;if(t=e.slice(r,n),t&&a.push({expr:t}),r=n+jn.length,n=e.indexOf(Ln,r),-1===n)break;t=e.slice(r,n),t&&a.push(dt(t,r)),r=n+Ln.length}return t=e.slice(r),t&&a.push({expr:t}),a}function vt(e,t,n){var a=[];if(tokens=pt(e.data),tokens.length){for(var r=0;token=tokens[r++];){var i=It.createTextNode(token.expr);token.type&&(token.expr=token.expr.replace(Ga,function(){return token.oneTime=!0,""}),token.element=i,token.filters=token.filters.replace(lr,function(){return token.type="html",""}),token.pos=1e3*n+r,a.push(token)),un.appendChild(i)}e.parentNode.replaceChild(un,e),a.length&&it(a,t)}}function ht(e,t){if(t)for(var n,a=0;n=e[a++];)if(n.hasOwnProperty(t)&&"object"==typeof n[t]){var r=n[t];return r.$model||r}return{}}function mt(e){if(e.scopeName&&"HTML"!==e.scopeName)return e.scopeName;var t=e.nodeName.toLowerCase(),n=t.indexOf(":");return n>0?t.slice(0,n):void 0}function yt(e){return null==e?"":e}function gt(e,t,n){return t.param.replace(Qt,function(a){var r=avalon.duplexHooks[a];r&&"function"==typeof r[n]&&(e=r[n](e,t))}),e}function bt(){for(var e=Cr.length-1;e>=0;e--){var t=Cr[e];t()===!1&&Cr.splice(e,1)}Cr.length||clearInterval(wr)}function xt(e,t){if(!e||1!==e.nodeType)return null;if(t)var n=t.effectName,a=t.effectDriver;else n=e.getAttribute("data-effect-name"),a=e.getAttribute("data-effect-driver");if(!n||!a)return null;var r=Sr.pop()||new Ct;return r.el=e,r.driver=a,r.useCss="j"!==a,r.useCss&&(t&&avalon(e).addClass(t.effectClass),r.cssEvent="t"===a?Nr:Tr),r.name=n,r.callbacks=avalon.effects[n]||{},r}function $t(e,t){var n=e.getAttribute("data-effect-name");if(n){t.effectName=n,t.effectDriver=e.getAttribute("data-effect-driver");var a=+e.getAttribute("data-effect-stagger");t.effectLeaveStagger=+e.getAttribute("data-effect-leave-stagger")||a,t.effectEnterStagger=+e.getAttribute("data-effect-enter-stagger")||a,t.effectClass=e.className||0/0}}function wt(e){return e.replace(/^[\S]/g,function(e){return e.toUpperCase()})}function Ct(){}function kt(e,t){var n=e.callbacks[t+"Class"];return"string"==typeof n?n:"function"==typeof n?n():e.name+"-"+t}function Nt(e,t,n){var a=e.callbacks[t];a&&a.call(e,e.el,n)}function Tt(e,t,n){var a=e.templateCache&&e.templateCache[t];if(a){for(var r,i=It.createDocumentFragment();r=a.firstChild;)i.appendChild(r);return i}return avalon.parseHTML(n)}function Et(e){for(var t=It.createDocumentFragment(),n=0,a=e.length;a>n;n++)t.appendChild(e[n]);return t}function At(e,t,n){for(var a,i=0;a=e[i++];)a.className===n.effectClass&&avalon.effect.apply(a,t,r,r,n)}function _t(e,t,n){return e?setTimeout(t,++n*e):t(),n}function Ot(e,t){for(var n=un.cloneNode(!1),a=e,i=a.nodeValue,o=t&&Math.max(+t.staggerIndex,0),l=avalon.slice(a.parentNode.childNodes),s=l.indexOf(a);;){var c=l[--s];if(!c||0===String(c.nodeValue).indexOf(i))break;t&&c.className===t.effectClass?(e=c,function(e){t.staggerIndex=_t(t.effectLeaveStagger,function(){avalon.effect.apply(e,0,r,function(){n.appendChild(e)},t)},o)}(c)):n.insertBefore(c,n.firstChild)}return n.appendChild(a),n}function St(e,t,n,a,r){var i=e.template.cloneNode(!0),o=avalon.slice(i.childNodes);i.appendChild(n.$anchor),r&&t.appendChild(i);var l=[n].concat(e.vmodels),s={nodes:o,vmodels:l,content:i};a.push(s)}function Mt(e){var t="object"===e.xtype?Ht:jt,n=t(e),a=n.$anchor||(n.$anchor=e.element.cloneNode(!1));return a.nodeValue=e.signature,n.$outer=e.$outer,n}function jt(e,t){for(var n=e.param||"el",a=0,r=Rr.length;r>a;a++){var i=Rr[a];if(i&&i.hasOwnProperty(n)){Rr.splice(a,1),t=i;break}}return t||(t=Lt(n)),t}function Lt(e){var t={$outer:{},$index:0,$oldIndex:0,$anchor:null,$first:!1,$last:!1,$remove:avalon.noop};t[e]=0/0;var n={$last:1,$first:1,$index:1};n[e]=1;var a=$(t,{force:n});return a.$id=pn("$proxy$each"),a}function Dt(e,t,n){if("array"===n){e.$remove=function(){t.$repeat.removeAt(e.$index)};var a=t.param;e.$watch(a,function(n){var a=e.$index;t.$repeat[a]=n})}else e.$watch("$val",function(n){t.$repeat[e.$key]=n})}function Ht(){return qr.pop()||Pt()}function Pt(){var e=$({$key:"",$val:0/0,$index:0,$oldIndex:0,$outer:{},$anchor:null},{force:{$key:1,$val:1,$index:1}});return e.$id=pn("$proxy$with"),e}function Ft(e,t,n){var a=e[t];if(a){var r=0===a.$id.indexOf("$proxy$each")?Rr:qr;a.$outer={};for(var i in a.$events){var o=a.$events[i];Array.isArray(o)&&(o.length=0,i===n?a[n]=0/0:"$val"===i&&(a.$val=0/0))}r.unshift(a)>h.maxRepeatSize&&r.pop(),delete e[t]}}function Bt(e,t){var n="_"+e;if(!Bt[n]){var a=It.createElement(e);cn.appendChild(a),t=sn?getComputedStyle(a,null).display:a.currentStyle.display,cn.removeChild(a),Bt[n]=t}return Bt[n]}function Rt(e,t,n,a){e=(e+"").replace(/[^0-9+\-Ee.]/g,"");var r=isFinite(+e)?+e:0,i=isFinite(+t)?Math.abs(t):3,o=a||",",l=n||".",s="",c=function(e,t){var n=Math.pow(10,t);return""+(Math.round(e*n)/n).toFixed(t)};return s=(i?c(r,i):""+Math.round(r)).split("."),s[0].length>3&&(s[0]=s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,o)),(s[1]||"").length.avalonHide{ display: none!important }",Wt.setAttribute("ms-skip","1"),Wt.className="avalonHide";var Xt,Yt=/\[native code\]/,Gt="$"+Vt,Ut=e.require,Jt=e.define,Zt={},Kt=/[^, ]+/g,Qt=/\w+/g,en=/^\[object SVG\w*Element\]$/,tn=/^\[object (?:Window|DOMWindow|global)\]$/,nn=Object.prototype,an=nn.hasOwnProperty,rn=nn.toString,on=Array.prototype,ln=on.slice,sn=e.dispatchEvent,cn=It.documentElement,un=It.createDocumentFragment(),fn=It.createElement("div"),dn={};"Boolean Number String Function Array Date RegExp Object Error".replace(Kt,function(e){dn["[object "+e+"]"]=e.toLowerCase()});var pn=function(e){return e=e||"avalon",String(Math.random()+Math.random()).replace(/\d\.\d{4}/,e)},vn=o();avalon=function(e){return new avalon.init(e)},avalon.nextTick=new function(){function t(){for(var e=r.length,t=0;e>t;t++)r[t]();r=r.slice(e)}var n=e.setImmediate,a=e.MutationObserver;if(n)return n.bind(e);var r=[];if(a){var i=document.createTextNode("avalon");new a(t).observe(i,{characterData:!0});var o=!1;return function(e){r.push(e),o=!o,i.data=o}}return function(e){setTimeout(e,4)}},avalon.init=function(e){this[0]=this.element=e},avalon.fn=avalon.prototype=avalon.init.prototype,avalon.type=function(e){return null==e?String(e):"object"==typeof e||"function"==typeof e?dn[rn.call(e)]||"object":typeof e};var hn="object"==typeof alert?function(e){try{return/^\s*\bfunction\b/.test(e+"")}catch(t){return!1}}:function(e){return"[object Function]"===rn.call(e)};avalon.isFunction=hn,avalon.isWindow=function(e){return e?e==e.document&&e.document!=e:!1},l(e)&&(avalon.isWindow=l);var mn;for(mn in avalon({}))break;var yn="0"!==mn;avalon.isPlainObject=function(e,t){if(!e||"object"!==avalon.type(e)||e.nodeType||avalon.isWindow(e))return!1;try{if(e.constructor&&!an.call(e,"constructor")&&!an.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}if(yn)for(t in e)return an.call(e,t);for(t in e);return void 0===t||an.call(e,t)},Yt.test(Object.getPrototypeOf)&&(avalon.isPlainObject=function(e){return"[object Object]"===rn.call(e)&&Object.getPrototypeOf(e)===nn}),avalon.mix=avalon.fn.mix=function(){var e,t,n,a,r,i,o=arguments[0]||{},l=1,s=arguments.length,c=!1;for("boolean"==typeof o&&(c=o,o=arguments[1]||{},l++),"object"==typeof o||hn(o)||(o={}),l===s&&(o=this,l--);s>l;l++)if(null!=(e=arguments[l]))for(t in e){n=o[t];try{a=e[t]}catch(u){continue}o!==a&&(c&&a&&(avalon.isPlainObject(a)||(r=Array.isArray(a)))?(r?(r=!1,i=n&&Array.isArray(n)?n:[]):i=n&&avalon.isPlainObject(n)?n:{},o[t]=avalon.mix(c,i,a)):void 0!==a&&(o[t]=a))}return o},avalon.mix({rword:Kt,subscribers:Gt,version:1.53,ui:{},log:n,slice:sn?function(e,t,n){return ln.call(e,t,n)}:function(e,t,n){var a=[],r=e.length;if(void 0===n&&(n=r),"number"==typeof n&&isFinite(n)){t=s(t,r),n=s(n,r);for(var i=t;n>i;++i)a[i-t]=e[i]}return a},noop:r,error:function(e,t){throw(t||Error)(e)},oneObject:i,range:function(e,t,n){n||(n=1),null==t&&(t=e||0,e=0);for(var a=-1,r=Math.max(0,Math.ceil((t-e)/n)),i=new Array(r);++an&&t(n,e[n])!==!1;n++);else for(n in e)if(e.hasOwnProperty(n)&&t(n,e[n])===!1)break}},getWidgetData:function(e,t){var n=avalon(e).data(),a={};for(var r in n)0===r.indexOf(t)&&(a[r.replace(t,"").replace(/\w/,function(e){return e.toLowerCase()})]=n[r]);return a},Array:{ensure:function(e,t){return-1===e.indexOf(t)?e.push(t):void 0},removeAt:function(e,t){return!!e.splice(t,1).length},remove:function(e,t){var n=e.indexOf(t);return~n?avalon.Array.removeAt(e,n):!1}}});var gn=avalon.bindingHandlers={},bn=avalon.bindingExecutors={},xn=avalon.directives={};avalon.directive=function(e,t){return gn[e]=t.init=t.init||r,bn[e]=t.update=t.update||r,xn[e]=t};var $n=new function(){function e(e){this.size=0,this.limit=e,this.head=this.tail=void 0,this._keymap={}}var t=e.prototype;return t.put=function(e,t){var n={key:e,value:t};return this._keymap[e]=n,this.tail?(this.tail.newer=n,n.older=this.tail):this.head=n,this.tail=n,this.size===this.limit?this.shift():this.size++,t},t.shift=function(){var e=this.head;e&&(this.head=this.head.newer,this.head.older=e.newer=e.older=this._keymap[e.key]=void 0,delete this._keymap[e.key])},t.get=function(e){var t=this._keymap[e];if(void 0!==t)return t===this.tail?t.value:(t.newer&&(t===this.head&&(this.head=t.newer),t.newer.older=t.older),t.older&&(t.older.newer=t.newer),t.newer=void 0,t.older=this.tail,this.tail&&(this.tail.newer=t),this.tail=t,t.value)},e};if(!"司徒正美".trim){var wn=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;String.prototype.trim=function(){return this.replace(wn,"")}}var Cn=!{toString:null}.propertyIsEnumerable("toString"),kn=function(){}.propertyIsEnumerable("prototype"),Nn=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Tn=Nn.length;if(Object.keys||(Object.keys=function(e){var t=[],n=kn&&"function"==typeof e;if("string"==typeof e||e&&e.callee)for(var a=0;al;l++){var s=Nn[l];o&&"constructor"===s||!an.call(e,s)||t.push(s)}return t}),Array.isArray||(Array.isArray=function(e){return"[object Array]"===rn.call(e)}),r.bind||(Function.prototype.bind=function(e){if(arguments.length<2&&void 0===e)return this;var t=this,n=arguments;return function(){var a,r=[];for(a=1;aa&&(a+=n);n>a;a++)if(this[a]===e)return a;return-1},lastIndexOf:function(e,t){var n=this.length,a=null==t?n-1:t;for(0>a&&(a=Math.max(0,n+a));a>=0;a--)if(this[a]===e)return a;return-1},forEach:u("","_",""),filter:u("r=[],j=0,","if(_)r[j++]=this[i]","return r"),map:u("r=[],","r[i]=_","return r"),some:u("","if(_)return true","return false"),every:u("","if(!_)return false","return true")}),avalon.contains=f,It.contains||(It.contains=function(e){return f(It,e)}),e.SVGElement){It.createTextNode("x").contains||(Node.prototype.contains=function(e){return!!(16&this.compareDocumentPosition(e))});var En="http://www.w3.org/2000/svg",An=It.createElementNS(En,"svg");An.innerHTML='',en.test(An.firstChild)||Object.defineProperties(SVGElement.prototype,{outerHTML:{enumerable:!0,configurable:!0,get:d,set:function(e){var t=this.tagName.toLowerCase(),n=this.parentNode,a=avalon.parseHTML(e);if("svg"===t)n.insertBefore(a,this);else{var r=It.createDocumentFragment();p(a,r),n.insertBefore(r,this)}n.removeChild(this)}},innerHTML:{enumerable:!0,configurable:!0,get:function(){var e=this.outerHTML,t=new RegExp("<"+this.nodeName+'\\b(?:(["\'])[^"]*?(\\1)|[^>])*>',"i"),n=new RegExp("$","i");return e.replace(t,"").replace(n,"")},set:function(e){if(avalon.clearHTML){avalon.clearHTML(this);var t=avalon.parseHTML(e);p(t,this)}}}})}!cn.outerHTML&&e.HTMLElement&&HTMLElement.prototype.__defineGetter__("outerHTML",d);var _n=/^(?:mouse|contextmenu|drag)|click/,On=avalon.eventHooks;if("onmouseenter"in cn||avalon.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){On[e]={type:t,fn:function(t,n){return function(a){var r=a.relatedTarget;return r&&(r===t||16&t.compareDocumentPosition(r))?void 0:(delete a.type,a.type=e,n.call(t,a))}}}}),avalon.each({AnimationEvent:"animationend",WebKitAnimationEvent:"webkitAnimationEnd"},function(t,n){e[t]&&!On.animationend&&(On.animationend={type:n})}),"oninput"in It.createElement("input")||(On.input={type:"propertychange",deel:function(e,t){return function(n){return"value"===n.propertyName?(n.type="input",t.call(e,n)):void 0}}}),void 0===It.onmousewheel){var Sn=void 0!==It.onwheel?"wheel":"DOMMouseScroll",Mn="wheel"===Sn?"deltaY":"detail";On.mousewheel={type:Sn,fn:function(e,t){return function(n){n.wheelDeltaY=n.wheelDelta=n[Mn]>0?-120:120,n.wheelDeltaX=0,Object.defineProperty&&Object.defineProperty(n,"type",{value:"mousewheel"}),t.call(e,n)}}}}var jn,Ln,Dn,Hn,Pn,Fn=/[-.*+?^${}()|[\]\/\\]/g,Bn={loader:function(t){var n=Xt&&t;e.require=n?Xt:Ut,e.define=n?Xt.define:Jt},interpolate:function(e){if(jn=e[0],Ln=e[1],jn===Ln){throw new SyntaxError("openTag!==closeTag")}h.openTag=jn,h.closeTag=Ln;var t=m(jn),n=m(Ln);Dn=new RegExp(t+"(.*?)"+n),Hn=new RegExp(t+"(.*?)"+n,"g"),Pn=new RegExp(t+".*?"+n+"|\\sms-")}};h.async=!0,h.debug=!0,h.plugins=Bn,h.plugins.interpolate(["{{","}}"]),h.paths={},h.shim={},h.maxRepeatSize=100,avalon.config=h;var Rn=avalon.vmodels={};avalon.define=function(e){var t=e.$id;t||n("warning: vm必须指定$id");var a=$(e);return a.$id=t,Rn[t]=a};var qn=i("$id,$watch,$fire,$events,$model,$skipArray,$active,$pathname,$up,$track,$accessors"),Vn=Object.defineProperty,In=!0;try{Vn({},"_",{value:"x"});var zn=Object.defineProperties}catch(Wn){In=!1}var Xn=Yt.test(Object.key)?Object.key:function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&!qn[n]&&t.push(n);return t},Yn={get:function(){return _(this)},set:r,enumerable:!1,configurable:!0};if(!In&&("__defineGetter__"in avalon&&(Vn=function(e,t,n){return"value"in n&&(e[t]=n.value),"get"in n&&e.__defineGetter__(t,n.get),"set"in n&&e.__defineSetter__(t,n.set),e},zn=function(e,t){for(var n in t)t.hasOwnProperty(n)&&Vn(e,n,t[n]);return e}),vn)){var Gn={};e.execScript(["Function parseVB(code)"," ExecuteGlobal(code)","End Function"].join("\n"),"VBScript"),zn=function(t,n,a){var r=[];r.push("\r\n Private [__data__], [__proxy__]"," Public Default Function [__const__](d"+Vt+", p"+Vt+")"," Set [__data__] = d"+Vt+": set [__proxy__] = p"+Vt," Set [__const__] = Me"," End Function");var i={};for(t in n)i[t]=!0,r.push(" Public Property Let ["+t+"](val"+Vt+")",' Call [__proxy__](Me,[__data__], "'+t+'", val'+Vt+")"," End Property"," Public Property Set ["+t+"](val"+Vt+")",' Call [__proxy__](Me,[__data__], "'+t+'", val'+Vt+")"," End Property"," Public Property Get ["+t+"]"," On Error Resume Next"," Set["+t+'] = [__proxy__](Me,[__data__],"'+t+'")'," If Err.Number <> 0 Then"," ["+t+'] = [__proxy__](Me,[__data__],"'+t+'")'," End If"," On Error Goto 0"," End Property");for(t in a)i[t]!==!0&&(i[t]=!0,r.push(" Public ["+t+"]"));for(t in qn)i[t]!==!0&&(i[t]=!0,r.push(" Public ["+t+"]"));r.push(" Public [hasOwnProperty]"),r.push("End Class");var o=r.join("\r\n"),l=Gn[o];l||(l=pn("VBClass"),e.parseVB("Class "+l+o),e.parseVB(["Function "+l+"Factory(a, b)"," Dim o"," Set o = (New "+l+")(a, b)"," Set "+l+"Factory = o","End Function"].join("\r\n")),Gn[o]=l);var s=e[l+"Factory"](n,O); -return s}}var Un=["push","pop","shift","unshift","splice"],Jn=Array.prototype,Zn={notify:function(){g.call(this.$up,this.$pathname)},set:function(e,t){if(e>>>0===e&&this[e]!==t){if(e>this.length)throw Error(e+"set方法的第一个参数不能大于原数组长度");g.call(this.$up,this.$pathname+".*",[t,this[e]]),this.splice(e,1,t)}},contains:function(e){return-1!==this.indexOf(e)},ensure:function(e){return this.contains(e)||this.push(e),this},pushArray:function(e){return this.push.apply(this,e)},remove:function(e){return this.removeAt(this.indexOf(e))},removeAt:function(e){return e>>>0===e?this.splice(e,1):[]},size:function(){return this._.length},removeAll:function(e){if(Array.isArray(e))for(var t=this.length-1;t>=0;t--)-1!==e.indexOf(this[t])&&(Kn.call(this.$track,t,1),Kn.call(this,t,1));else if("function"==typeof e)for(t=this.length-1;t>=0;t--){var n=this[t];e(n,t)&&(Kn.call(this.$track,t,1),Kn.call(this,t,1))}else Kn.call(this.$track,0,this.length),Kn.call(this,0,this.length);sn||(this.$model=_(this)),this.notify(),this._.length=this.length},clear:function(){return this.removeAll()}},Kn=Jn.splice;Un.forEach(function(e){var t=Jn[e];Zn[e]=function(){for(var n=[],a=0,r=arguments.length;r>a;a++)n[a]=T(arguments[a],0,1,1);var i=t.apply(this,n);return j(this.$track,e,n),sn||(this.$model=_(this)),this.notify(),this._.length=this.length,i}}),"sort,reverse".replace(Kt,function(e){Zn[e]=function(){var t=this.concat(),n=this,a=Math.random(),r=[],i=!1;Jn[e].apply(n,arguments);for(var o=0,l=t.length;l>o;o++){var s=n[o],c=t[o];if(s===c)r.push(o);else{var u=t.indexOf(s);r.push(u),t[u]=a,i=!0}}return i&&(S(this.$track,r),sn||(this.$model=_(this)),this.notify()),this}});var Qn=function(){var e,t=[];return{begin:function(n){t.push(e),e=n},end:function(){e=t.pop()},collectDependency:function(t){e&&e.callback(t)}}}();avalon.injectBinding=function(e){e.handler=e.handler||xn[e.type].update||r,e.update=function(){var t=!1;e.getter||(t=!0,Qn.begin({callback:function(t){L(t,e)}}),e.getter=et(e.expr,e.vmodels,e),e.observers.forEach(function(t){t.v.$watch(t.p,e)}),delete e.observers);try{var a,r,i=e.fireArgs;if(delete e.fireArgs,i?(a=i[0],r=i[1]):a="on"===e.type?e.getter+"":e.getter.apply(0,e.args),r="undefined"==typeof r?e.oldValue:r,e._filters&&(a=Gr.$filter.apply(0,[a].concat(e._filters))),e.signature){var o=avalon.type(a);if("array"!==o&&"object"!==o)throw Error("warning:"+e.expr+"只能是对象或数组");e.xtype=o;var l=D(e.proxies||[],o),s=a.$track||("array"===o?M(a.length):Object.keys(a));e.track=s,l!==s.join(";")&&(e.handler(a,r),e.oldValue=1)}else(Array.isArray(a)?a.length===(r&&r.length):1)?"oldValue"in e&&a===r||(e.handler(a,r),e.oldValue=a):(e.handler(a,r),e.oldValue=a.concat())}catch(c){delete e.getter,n("warning:exception throwed in [avalon.injectBinding] ",c);var u=e.element;u&&3===u.nodeType&&(u.nodeValue=jn+(e.oneTime?"::":"")+e.expr+Ln)}finally{t&&Qn.end()}},e.update()};var ea=0,ta=avalon.$$subscribers=[],na=new Date,aa={},ra={area:[1,"",""],param:[1,"",""],col:[2,"","
"],legend:[1,"
","
"],option:[1,""],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],g:[1,'',""],_default:sn?[0,"",""]:[1,"X
","
"]};ra.th=ra.td,ra.optgroup=ra.option,ra.tbody=ra.tfoot=ra.colgroup=ra.caption=ra.thead,String("circle,defs,ellipse,image,line,path,polygon,polyline,rect,symbol,text,use").replace(Kt,function(e){ra[e]=ra.g});var ia=/<([\w:]+)/,oa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,la=sn?/[^\d\D]/:/(<(?:script|link|style|meta|noscript))/gi,sa=i(["","text/javascript","text/ecmascript","application/ecmascript","application/javascript"]),ca=/<(?:tb|td|tf|th|tr|col|opt|leg|cap|area)/,ua=It.createElement("script"),fa=/<|&#?\w+;/;avalon.parseHTML=function(e){var t=un.cloneNode(!1);if("string"!=typeof e)return t;if(!fa.test(e))return t.appendChild(It.createTextNode(e)),t;e=e.replace(oa,"<$1>").trim();var n,a,r=(ia.exec(e)||["",""])[1].toLowerCase(),i=ra[r]||ra._default,o=fn;sn||(e=e.replace(la,"
$1")),o.innerHTML=i[1]+e+i[2];var l=o.getElementsByTagName("script");if(l.length)for(var s,c=0;s=l[c++];)sa[s.type]&&(a=ua.cloneNode(!1),on.forEach.call(s.attributes,function(e){e&&e.specified&&(a[e.name]=e.value,a.setAttribute(e.name,e.value))}),a.text=s.text,s.parentNode.replaceChild(a,s));if(!sn){var u="X
"===i[1]?o.lastChild.firstChild:o.lastChild;if(u&&"TABLE"===u.tagName&&"tbody"!==r)for(l=u.childNodes,c=0;s=l[c++];)if("TBODY"===s.tagName&&!s.innerHTML){u.removeChild(s);break}l=o.getElementsByTagName("br");for(var f=l.length;s=l[--f];)"msNoScope"===s.className&&s.parentNode.removeChild(s);for(l=o.all,c=0;s=l[c++];)q(s)&&V(s)}for(c=i[0];c--;o=o.lastChild);for(;n=o.firstChild;)t.appendChild(n);return t},avalon.innerHTML=function(e,t){if(!sn&&!la.test(t)&&!ca.test(t))try{return void(e.innerHTML=t)}catch(n){}var a=this.parseHTML(t);this.clearHTML(e).appendChild(a)},avalon.clearHTML=function(e){for(e.textContent="";e.firstChild;)e.removeChild(e.firstChild);return e};var da={_toString:function(){var e=this.node,t=e.className,n="string"==typeof t?t:t.baseVal;return n.split(/\s+/).join(" ")},_contains:function(e){return(" "+this+" ").indexOf(" "+e+" ")>-1},_add:function(e){this.contains(e)||this._set(this+" "+e)},_remove:function(e){this._set((" "+this+" ").replace(" "+e+" "," "))},__set:function(e){e=e.trim();var t=this.node;en.test(t)?t.setAttribute("class",e):t.className=e}};"add,remove".replace(Kt,function(e){avalon.fn[e+"Class"]=function(t){var n=this[0];return t&&"string"==typeof t&&n&&1===n.nodeType&&t.replace(/\S+/g,function(t){W(n)[e](t)}),this}}),avalon.fn.mix({hasClass:function(e){var t=this[0]||{};return 1===t.nodeType&&W(t).contains(e)},toggleClass:function(e,t){for(var n,a=0,r=String(e).split(/\s+/),i="boolean"==typeof t;n=r[a++];){var o=i?t:!this.hasClass(n);this[o?"addClass":"removeClass"](n)}return this},attr:function(e,t){return 2===arguments.length?(this[0].setAttribute(e,t),this):this[0].getAttribute(e)},data:function(e,t){switch(e="data-"+I(e||""),arguments.length){case 2:return this.attr(e,t),this;case 1:var n=this.attr(e);return X(n);case 0:var a={};return on.forEach.call(this[0].attributes,function(t){t&&(e=t.name,e.indexOf("data-")||(e=z(e.slice(5)),a[e]=X(t.value)))}),a}},removeData:function(e){return e="data-"+I(e),this[0].removeAttribute(e),this},css:function(e,t){if(avalon.isPlainObject(e))for(var n in e)avalon.css(this,n,e[n]);else var a=avalon.css(this,e,t);return void 0!==a?a:this},position:function(){var e,t,n=this[0],a={top:0,left:0};if(n)return"fixed"===this.css("position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),"HTML"!==e[0].tagName&&(a=e.offset()),a.top+=avalon.css(e[0],"borderTopWidth",!0),a.left+=avalon.css(e[0],"borderLeftWidth",!0),a.top-=e.scrollTop(),a.left-=e.scrollLeft()),{top:t.top-a.top-avalon.css(n,"marginTop",!0),left:t.left-a.left-avalon.css(n,"marginLeft",!0)}},offsetParent:function(){for(var e=this[0].offsetParent;e&&"static"===avalon.css(e,"position");)e=e.offsetParent;return avalon(e||cn)},bind:function(e,t,n){return this[0]?avalon.bind(this[0],e,t,n):void 0},unbind:function(e,t,n){return this[0]&&avalon.unbind(this[0],e,t,n),this},val:function(e){var t=this[0];if(t&&1===t.nodeType){var n=0===arguments.length,a=n?":get":":set",r=Oa[U(t)+a];if(r)var i=r(t,e);else{if(n)return(t.value||"").replace(/\r/g,"");t.value=e}}return n?i:this}});var pa=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,va=/^[\],:{}\s]*$/,ha=/(?:^|:|,)(?:\s*\[)+/g,ma=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,ya=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g;avalon.parseJSON=e.JSON?JSON.parse:function(e){if("string"==typeof e){if(e=e.trim(),e&&va.test(e.replace(ma,"@").replace(ya,"]").replace(ha,"")))return new Function("return "+e)();avalon.error("Invalid JSON: "+e)}return e},avalon.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){avalon.fn[e]=function(n){var a=this[0]||{},r=Y(a),i="scrollTop"===e;return arguments.length?void(r?r.scrollTo(i?avalon(r).scrollLeft():n,i?n:avalon(r).scrollTop()):a[e]=n):r?t in r?r[t]:cn[e]:a[e]}});var ga=avalon.cssHooks={},ba=["","-webkit-","-o-","-moz-","-ms-"],xa={"float":sn?"cssFloat":"styleFloat"};if(avalon.cssNumber=i("animationIterationCount,columnCount,order,flex,flexGrow,flexShrink,fillOpacity,fontWeight,lineHeight,opacity,orphans,widows,zIndex,zoom"),avalon.cssName=function(e,t,n){if(xa[e])return xa[e];t=t||cn.style;for(var a=0,r=ba.length;r>a;a++)if(n=z(ba[a]+e),n in t)return xa[e]=n;return null},ga["@:set"]=function(e,t,n){try{e.style[t]=n}catch(a){}},e.getComputedStyle)ga["@:get"]=function(e,t){if(!e||!e.style)throw new Error("getComputedStyle要求传入一个节点 "+e);var n,a=getComputedStyle(e,null);return a&&(n="filter"===t?a.getPropertyValue(t):a[t],""===n&&(n=e.style[t])),n},ga["opacity:get"]=function(e){var t=ga["@:get"](e,"opacity");return""===t?"1":t};else{var $a=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,wa=/^(top|right|bottom|left)$/,Ca=/alpha\([^)]*\)/i,ka=!!e.XDomainRequest,Na="DXImageTransform.Microsoft.Alpha",Ta={thin:ka?"1px":"2px",medium:ka?"3px":"4px",thick:ka?"5px":"6px"};ga["@:get"]=function(e,t){var n=e.currentStyle,a=n[t];if($a.test(a)&&!wa.test(a)){var r=e.style,i=r.left,o=e.runtimeStyle.left;e.runtimeStyle.left=n.left,r.left="fontSize"===t?"1em":a||0,a=r.pixelLeft+"px",r.left=i,e.runtimeStyle.left=o}return"medium"===a&&(t=t.replace("Width","Style"),"none"===n[t]&&(a="0px")),""===a?"auto":Ta[a]||a},ga["opacity:set"]=function(e,t,n){var a=e.style,r=isFinite(n)&&1>=n?"alpha(opacity="+100*n+")":"",i=a.filter||"";a.zoom=1,a.filter=(Ca.test(i)?i.replace(Ca,r):i+" "+r).trim(),a.filter||a.removeAttribute("filter")},ga["opacity:get"]=function(e){var t=e.filters.alpha||e.filters[Na],n=t&&t.enabled?t.opacity:100;return n/100+""}}"top,left".replace(Kt,function(e){ga[e+":get"]=function(t){var n=ga["@:get"](t,e);return/px$/.test(n)?n:avalon(t).position()[e]+"px"}});var Ea={position:"absolute",visibility:"hidden",display:"block"},Aa=/^(none|table(?!-c[ea]).+)/;"Width,Height".replace(Kt,function(e){var t=e.toLowerCase(),n="client"+e,a="scroll"+e,r="offset"+e;ga[t+":get"]=function(t,n,a){var i=-4;"number"==typeof a&&(i=a),n="Width"===e?["Left","Right"]:["Top","Bottom"];var o=t[r];return 2===i?o+avalon.css(t,"margin"+n[0],!0)+avalon.css(t,"margin"+n[1],!0):(0>i&&(o=o-avalon.css(t,"border"+n[0]+"Width",!0)-avalon.css(t,"border"+n[1]+"Width",!0)),-4===i&&(o=o-avalon.css(t,"padding"+n[0],!0)-avalon.css(t,"padding"+n[1],!0)),o)},ga[t+"&get"]=function(e){var n=[];G(e,n);for(var a,r=ga[t+":get"](e),i=0;a=n[i++];){e=a.node;for(var o in a)"string"==typeof a[o]&&(e.style[o]=a[o])}return r},avalon.fn[t]=function(i){var o=this[0];if(0===arguments.length){if(o.setTimeout)return o["inner"+e]||o.document.documentElement[n]||o.document.body[n];if(9===o.nodeType){var l=o.documentElement;return Math.max(o.body[a],l[a],o.body[r],l[r],l[n])}return ga[t+"&get"](o)}return this.css(t,i)},avalon.fn["inner"+e]=function(){return ga[t+":get"](this[0],void 0,-2)},avalon.fn["outer"+e]=function(e){return ga[t+":get"](this[0],void 0,e===!0?2:0)}}),avalon.fn.offset=function(){var e=this[0],t={left:0,top:0};if(!e||!e.tagName||!e.ownerDocument)return t;var n=e.ownerDocument,a=n.body,r=n.documentElement,i=n.defaultView||n.parentWindow;if(!avalon.contains(r,e))return t;e.getBoundingClientRect&&(t=e.getBoundingClientRect());var o=r.clientTop||a.clientTop,l=r.clientLeft||a.clientLeft,s=Math.max(i.pageYOffset||0,r.scrollTop,a.scrollTop),c=Math.max(i.pageXOffset||0,r.scrollLeft,a.scrollLeft);return{top:t.top+s-o,left:t.left+c-l}};var _a=/^]+))?)*\s+value[\s=]/i,Oa={"option:get":vn?function(e){return _a.test(e.outerHTML)?e.value:e.text.trim()}:function(e){return e.value},"select:get":function(e,t){for(var n,a=e.options,r=e.selectedIndex,i=Oa["option:get"],o="select-one"===e.type||0>r,l=o?null:[],s=o?r+1:a.length,c=0>r?s:o?r:0;s>c;c++)if(n=a[c],(n.selected||c===r)&&!n.disabled){if(t=i(n),o)return t;l.push(t)}return l},"select:set":function(e,t,n){t=[].concat(t);for(var a,r=Oa["option:get"],i=0;a=e.options[i++];)(a.selected=t.indexOf(r(a))>-1)&&(n=!0);n||(e.selectedIndex=-1)}},Sa={},Ma=["break,case,catch,continue,debugger,default,delete,do,else,false","finally,for,function,if,in,instanceof,new,null,return,switch,this","throw,true,try,typeof,var,void,while,with","abstract,boolean,byte,char,class,const,double,enum,export,extends","final,float,goto,implements,import,int,interface,long,native","package,private,protected,public,short,static,super,synchronized","throws,transient,volatile","arguments,let,yield,undefined"].join(",");Ma.replace(/\w+/g,function(e){Sa[e]=!0});var ja=/[a-z_$]/i,La=/[\s\uFEFF\xA0]/,Da=/(\$proxy\$[a-z]+)\d+$/,Ha=new $n(218),Pa=new $n(128),Fa=/\)\s*$/,Ba=/\)\s*\|/g,Ra=/\|\s*([$\w]+)/g,qa=/"\s*\["/g,Va=/"\s*\(/g,Ia={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},za=e.JSON&&JSON.stringify||function(e){return'"'+e.replace(/[\\\"\x00-\x1f]/g,function(e){var t=Ia[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"'};avalon.scan=function(e,t){e=e||cn;var n=t?[].concat(t):[];ft(e,n)};var Wa=i("area,base,basefont,br,col,command,embed,hr,img,input,link,meta,param,source,track,wbr,noscript,script,style,textarea".toUpperCase()),Xa=function(e,t,n){var a=e.getAttribute(t);if(a)for(var r,i=0;r=n[i++];)if(r.hasOwnProperty(a)&&"function"==typeof r[a])return r[a]},Ya=vn&&e.MutationObserver?function(e){for(var t,n=e.firstChild;n;){var a=n.nextSibling;3===n.nodeType?t?(t.nodeValue+=n.nodeValue,e.removeChild(n)):t=n:t=null,n=a}}:0,Ga=/^\s*::/,Ua=/ms-(\w+)-?(.*)/,Ja=i("animationend,blur,change,input,click,dblclick,focus,keydown,keypress,keyup,mousedown,mouseenter,mouseleave,mousemove,mouseout,mouseover,mouseup,scan,scroll,submit"),Za=i("value,title,alt,checked,selected,disabled,readonly,enabled,href,src"),Ka=/^if|widget|repeat$/,Qa=/^each|with|html|include$/;if(!sn)var er=new $n(512),tr=/\s+([^=\s]+)(?:=("[^"]*"|'[^']*'|[^\s>]+))?/g,nr=/^['"]/,ar=/<\w+\b(?:(["'])[^"]*?(\1)|[^>])*>/i,rr=/&/g,ir=function(e){var t=e.outerHTML;if("8?e.bound("input",p):e.bound("propertychange",function(e){"value"===e.propertyName&&p()}),e.bound("dragend",function(){setTimeout(function(){p()},17)})):(e.bound("input",p),e.bound("compositionstart",o),e.bound("compositionend",l),e.bound("DOMAutoComplete",p));break;case"select":e.bound("change",function(){var t=avalon(s).val();if(t=Array.isArray(t)?t.map(function(t){return e.pipe(t,e,"get")}):e.pipe(t,e,"get"),t+""!==e.oldValue)try{e.setter(t),a.call(s,t)}catch(r){n(r)}})}"input"===e.xtype&&/^(text|password|hidden)/.test(s.type)&&(s.avalonSetter=p,kr(function(){if(cn.contains(s))e.oldValue!==s.value&&p();else if(!s.msRetain)return!1}));for(var v in avalon.vmodels){var h=avalon.vmodels[v];h.$fire("avalon-ms-duplex-init",e)}var m=e.pipe||(e.pipe=gt);m(null,e,"init")},update:function(e){var t,n=this.element,a=this;switch(this.xtype){case"input":case"change":t=this.pipe(e,this,"set"),t!==this.oldValue&&(n.value=this.oldValue=t);break;case"radio":t=a.isChecked?!!e:e+""===n.value,6===vn?setTimeout(function(){n.defaultChecked=t,n.checked=t},31):n.checked=t;break;case"checkbox":var r=[].concat(e);t=this.pipe(n.value,this,"get"),n.checked=r.indexOf(t)>-1;break;case"select":a._value=e,n.msHasEvent="selectDuplex",avalon.bind(n,"datasetchanged",function(e){if("selectDuplex"===e.bubble){var t=a._value,r=Array.isArray(t)?t.map(String):t+"";avalon(n).val(r),n.oldValue=r+"",a.changed.call(n,r)}})}"select"!==a.xtype&&a.changed.call(n,t)}})}vn&&avalon.bind(It,"selectionchange",function(){var e=It.activeElement;e&&"function"==typeof e.avalonSetter&&e.avalonSetter()}),avalon.duplexHooks={checked:{get:function(e,t){return!t.oldValue}},string:{get:function(e){return e},set:yt},"boolean":{get:function(e){return"true"===e},set:yt},number:{get:function(e,t){var n=parseFloat(e+"");if(-e===-n)return n;var a=/strong|medium|weak/.exec(t.element.getAttribute("data-duplex-number"))||["medium"];switch(a[0]){case"strong":return 0;case"medium":return""===e?"":0;case"weak":return e}},set:yt}};var wr,Cr=[];avalon.tick=function(e){1===Cr.push(e)&&(wr=setInterval(bt,60))};var kr=r;!new function(){function e(e){t[this.tagName].call(this,e),"function"==typeof this.avalonSetter&&this.oldValue!==e&&this.avalonSetter()}try{var t={},n=HTMLInputElement.prototype,a=HTMLTextAreaElement.prototype,r=HTMLInputElement.prototype;Object.getOwnPropertyNames(r),t.INPUT=Object.getOwnPropertyDescriptor(n,"value").set,Object.defineProperty(n,"value",{set:e}),t.TEXTAREA=Object.getOwnPropertyDescriptor(a,"value").set,Object.defineProperty(a,"value",{set:e})}catch(i){kr=avalon.tick}},avalon.directive("effect",{priority:5,init:function(e){var t,n,a=e.expr,r=a.replace(Hn,function(e){return e.replace(/./g,"0")}).indexOf(":");-1===r?(t=a,n=!0):(t=a.slice(0,r),n=a.slice(r+1)),t=Dn.test(a)?tt(t):za(t),e.expr="["+t+","+n+"]"},update:function(t){var n=t[0],a=this.element;if(a.getAttribute("data-effect-name")!==n){a.removeAttribute("data-effect-driver");var r=a.style,i=e.getComputedStyle?e.getComputedStyle(a):null,o=!1;if(i&&(Er||Ar)){var l=r[_r]||i[_r];l&&"0s"!==l&&(a.setAttribute("data-effect-driver","t"),o=!0),o||(l=r[Or]||i[Or],l&&"0s"!==l&&(a.setAttribute("data-effect-driver","a"),o=!0))}o||avalon.effects[n]&&(a.setAttribute("data-effect-driver","j"),o=!0),o&&a.setAttribute("data-effect-name",n)}}}),avalon.effects={},avalon.effect=function(e,t){avalon.effects[e]=t};var Nr,Tr,Er=!1,Ar=!1,_r=avalon.cssName("transition-duration"),Or=avalon.cssName("animation-duration");!new function(){var t,n={TransitionEvent:"transitionend",WebKitTransitionEvent:"webkitTransitionEnd",OTransitionEvent:"oTransitionEnd",otransitionEvent:"otransitionEnd"};for(var a in n){if(e[a]){t=n[a];break}try{{document.createEvent(a)}t=n[a];break}catch(r){}}"string"==typeof t&&(Er=!0,Nr=t),n={AnimationEvent:"animationend",WebKitAnimationEvent:"webkitAnimationEnd"};var i;for(a in n)if(e[a]){i=n[a];break}"string"==typeof i&&(Er=!0,Tr=i)};var Sr=[],Mr=new ur;Ct.prototype={contrustor:Ct,enterClass:function(){return kt(this,"enter")},leaveClass:function(){return kt(this,"leave")},actionFun:function(e,t,n){if(!document.hidden){var a=this,r=a.el,i="leave"===e;e=i?"leave":"enter";var o=i?"enter":"leave";Nt(a,"abort"+wt(o)),Nt(a,"before"+wt(e)),i||t(r);var l=function(o){r.removeEventListener(a.cssEvent,a.cssCallback),i?(t(r),avalon(r).removeClass(a.cssClass)):"a"===a.driver&&avalon(r).removeClass(a.cssClass),o!==!0&&(Nt(a,"after"+wt(e)),n&&n(r)),a.dispose()};a.useCss?(a.cssCallback&&a.cssCallback(!0),a.cssClass=kt(a,e),a.cssCallback=l,a.update=function(){r.addEventListener(a.cssEvent,a.cssCallback),i||"t"!==a.driver||avalon(r).removeClass(a.cssClass)},avalon(r).addClass(a.cssClass),Mr.render(!0),Mr.queue.push(a)):Nt(a,e,l)}},enter:function(){this.actionFun.apply(this,["enter"].concat(avalon.slice(arguments)))},leave:function(){this.actionFun.apply(this,["leave"].concat(avalon.slice(arguments)))},dispose:function(){this.update=this.cssCallback=null,Sr.unshift(this)>100&&Sr.pop()}};var jr=function(e,t){var n=ln.call(arguments,0);"function"!=typeof n[2]&&n.splice(2,0,r),"function"!=typeof n[3]&&n.splice(3,0,r);var a=n[2],i=n[3],o=n[4],l=xt(e,o);if(!l)return a(),i(),!1;var s=t?"enter":"leave";l[s](a,i)};avalon.mix(avalon.effect,{apply:jr,append:function(e,t,n,a){return jr(e,1,function(){t.appendChild(e)},n,a)},before:function(e,t,n,a){return jr(e,1,function(){t.parentNode.insertBefore(e,t)},n,a)},remove:function(e,t,n,a){return jr(e,0,function(){e.parentNode===t&&t.removeChild(e)},n,a)}}),avalon.directive("html",{update:function(e){var t=this,n=this.element,a=1!==n.nodeType,r=a?n.parentNode:n;if(r){if(e=null==e?"":e,3===n.nodeType){var i=pn("html");r.insertBefore(It.createComment(i),n),t.element=It.createComment(i+":end"),r.replaceChild(t.element,n),n=t.element}if("object"!=typeof e)var o=avalon.parseHTML(String(e));else if(11===e.nodeType)o=e;else if(1===e.nodeType||e.item){var l=1===e.nodeType?e.childNodes:e.item;for(o=un.cloneNode(!0);l[0];)o.appendChild(l[0])}if(l=avalon.slice(o.childNodes),a){for(var s=n.nodeValue.slice(0,-4);;){var c=n.previousSibling;if(!c||8===c.nodeType&&c.nodeValue===s)break;r.removeChild(c)}r.insertBefore(o,n)}else avalon.clearHTML(n).appendChild(o);ut(l,t.vmodels)}}}),avalon.directive("if",{priority:10,update:function(e){function t(){r.getAttribute(a.name)&&(r.removeAttribute(a.name),lt(r,a.vmodels)),a.rollback=null}var n,a=this,r=this.element,i=a.stamp=+new Date,o=function(){i===a.stamp&&(a.recoverNode=null)};a.recoverNode&&a.recoverNode();try{if(!r.parentNode)return;n=r.parentNode}catch(l){return}if(e){if(8===r.nodeType){var s=a.keep,c=avalon.effect.apply(s,1,function(){i===a.stamp&&(r.parentNode.replaceChild(s,r),r=a.element=s,s.getAttribute("_required")&&(r.required=!0,r.removeAttribute("_required")),r.querySelectorAll&&avalon.each(r.querySelectorAll("[_required=true]"),function(e){e.required=!0,e.removeAttribute("_required")}),t())},o);c=c===!1}c||t()}else if(1===r.nodeType){r.required===!0&&(r.required=!1,r.setAttribute("_required","true"));try{avalon.each(r.querySelectorAll(":required"),function(e){r.required=!1,e.setAttribute("_required","true")})}catch(l){}var u=a.element=It.createComment("ms-if"),f=r.nextSibling;a.recoverNode=function(){a.recoverNode=null,u.parentNode!==n&&(n.insertBefore(u,f),a.keep=r)},avalon.effect.apply(r,0,function(){a.recoverNode=null,i===a.stamp&&(r.parentNode.replaceChild(u,r),a.keep=r,Wt.appendChild(r),a.rollback=function(){r.parentNode===Wt&&Wt.removeChild(r)})},o)}}});var Lr=/(?:[\s\S]+?)<\/noscript>/gim,Dr=/([\s\S]+?)<\/noscript>/im,Hr=function(){return new(e.XMLHttpRequest||ActiveXObject)("Microsoft.XMLHTTP")},Pr=avalon.templateCache={};avalon.directive("include",{init:xn.attr.init,update:function(e){var t=this,n=this.element,a=t.vmodels,r=t.includeRendered,i=t.effectName&&t.effectClass,o=t.templateCache,l=t.includeReplace,s=t.includeLoaded,c=l?n.parentNode:n,u=t._element;t.recoverNodes=t.recoverNodes||avalon.noop;var f=(l&&u.cloneNode(),function(f){var d=t._stamp=+new Date;if(s){var p=s.apply(c,[f].concat(a));"string"==typeof p&&(f=p)}r&&at(c,function(){r.call(c)},0/0);var v=t.includeLastID||"_default";t.includeLastID=e;var h=o&&o[v]||It.createElement(n.tagName||t._element.tagName);i&&(h.className=i,c.insertBefore(h,t.start)),(o||{})[v]=h;var m=t.recoverNodes();for(m&&c.insertBefore(m,t.end);;){var y=t.start.nextSibling;if(!y||y===h||y===t.end)break;h.appendChild(y)}avalon.effect.remove(h,c,function(){o&&d===t._stamp&&Wt.appendChild(h)},t);var g=c,b=avalon.noop,x=avalon.noop,$=Tt(t,e,f),w=avalon.slice($.childNodes);l&&i?(g=u,g.innerHTML="",g.setAttribute("ms-skip","true"),c.insertBefore(g,t.end.nextSibling),b=function(){g.insertBefore($,null)},x=function(){t.recoverNodes=avalon.noop,d===t._stamp&&($=Et(w),c.insertBefore($,t.end),ut(w,a)),g.parentNode===c&&c.removeChild(g)},t.recoverNodes=function(){return t.recoverNodes=avalon.noop,Et(w)}):b=function(){c.insertBefore($,t.end),ut(w,a)},avalon.effect.apply(g,"enter",b,x)});if("src"===t.param)if("string"==typeof Pr[e])avalon.nextTick(function(){f(Pr[e])});else if(Array.isArray(Pr[e]))Pr[e].push(f);else{var d=Hr();d.onreadystatechange=function(){if(4===d.readyState){var t=d.status;if(t>=200&&300>t||304===t||1223===t){for(var n,a=d.responseText,r=0;n=Pr[e][r++];)n(a);Pr[e]=a}}},Pr[e]=[f],d.open("GET",e,!0),"withCredentials"in d&&(d.withCredentials=!0),d.setRequestHeader("X-Requested-With","XMLHttpRequest"),d.send(null) -}else{var p=e&&1===e.nodeType?e:It.getElementById(e);if(p){if("NOSCRIPT"===p.tagName&&!p.innerHTML&&!p.fixIE78){d=Hr(),d.open("GET",location,!1),d.send(null);for(var v=It.getElementsByTagName("noscript"),h=(d.responseText||"").match(Lr)||[],m=h.length,y=0;m>y;y++){var g=v[y];g&&(g.style.display="none",g.fixIE78=(h[y].match(Dr)||[""," "])[1])}}avalon.nextTick(function(){f(p.fixIE78||p.value||p.innerText||p.innerHTML)})}}}});var Fr=/\(([^)]*)\)/,Br=avalon.directive("on",{priority:3e3,init:function(e){var t=e.expr;e.type="on";var n=e.param.replace(/-\d+$/,"");if("function"==typeof Br[n+"Hook"]&&Br[n+"Hook"](e),t.indexOf("(")>0&&t.indexOf(")")>-1){var a=(t.match(Fr)||["",""])[1].trim();(""===a||"$event"===a)&&(t=t.replace(Fr,""))}e.expr=t},update:function(e){var t=this,n=this.element;e=function(e){var n=t.getter||r;return n.apply(this,t.args.concat(e))};var a=t.param.replace(/-\d+$/,"");if("scan"===a)e.call(n,{type:a});else if("function"==typeof t.specialBind)t.specialBind(n,e);else var i=avalon.bind(n,a,e);t.rollback=function(){"function"==typeof t.specialUnbind?t.specialUnbind():avalon.unbind(n,a,i)}}});avalon.directive("repeat",{priority:90,init:function(e){var t=e.type;e.cache={},e.enterCount=0;var n=e.element;if(1===n.nodeType){n.removeAttribute(e.name),$t(n,e),e.param=e.param||"el",e.sortedCallback=Xa(n,"data-with-sorted",e.vmodels);var a=Xa(n,"data-"+t+"-rendered",e.vmodels),r=pn(t),i=It.createComment(r+":start"),o=e.element=It.createComment(r+":end");if(e.signature=r,e.start=i,e.template=un.cloneNode(!1),"repeat"===t){var l=n.parentNode;l.replaceChild(o,n),l.insertBefore(i,o),e.template.appendChild(n)}else{for(;n.firstChild;)e.template.appendChild(n.firstChild);n.appendChild(i),n.appendChild(o),l=n}if(e.element=o,a)var s=avalon.bind(l,"datasetchanged",function(){a.apply(l,l.args),avalon.unbind(l,"datasetchanged",s),l.msRendered=a})}},update:function(e,t){var n=this,a=this.xtype;this.enterCount+=1;var r=!t;if(r){n.$outer={};var i="$key",o="$val";"array"===a&&(i="$first",o="$last");for(var l,s=0;l=n.vmodels[s++];)if(l.hasOwnProperty(i)&&l.hasOwnProperty(o)){n.$outer=l;break}}var c=this.track;if(n.sortedCallback){var u=n.sortedCallback.call(x,c);u&&Array.isArray(u)&&(c=u)}var f="move";n.$repeat=e;var d=[],p=r&&un.cloneNode(!1),v=[],m=this.param,y=avalon.mix({},this.cache),g=this.element,b=c.length,x=g.parentNode;for(s=0;b>s;s++){var $=c[s],w=y[$];if(w)d.push({}),y[$]=!0;else{w=Mt(this),"array"===a?(f="add",w.$id=$,w[m]=e[s]):(f="append",w.$key=$,w.$val=e[$]),this.cache[$]=w;var C=w.$anchor||(w.$anchor=g.cloneNode(!1));C.nodeValue=this.signature,St(n,p,w,d,r&&!n.effectDriver),Dt(w,n,a)}1===this.enterCount&&(w.$active=!1,w.$oldIndex=w.$index,w.$active=!0,w.$index=s),"array"===a?(w.$first=0===s,w.$last=s===b-1):w.$val=_(e[$]),v.push(w)}if(this.proxies=v,r&&!n.effectDriver)x.insertBefore(p,g),d.forEach(function(e){ut(e.nodes||[],e.vmodels),e.nodes=e.vmodels=null});else{var k=n.staggerIndex=0;for($ in y)y[$]!==!0&&(f="del",Ot(y[$].$anchor,n),Ft(this.cache,$,m),y[$]=null);for(s=0;b>s;s++){w=v[s],$="array"===a?w.$id:w.$key;var N=v[s-1],T=N?N.$anchor:n.start;y[$]?w.$index!==w.$oldIndex&&!function(e,t){k=_t(n.effectEnterStagger,function(){var a=Ot(e.$anchor),r=avalon.slice(a.childNodes);x.insertBefore(a,t.nextSibling),At(r,1,n)},k)}(w,T):!function(e,t){var a=e.nodes,r=e.vmodels;a&&(k=_t(n.effectEnterStagger,function(){x.insertBefore(e.content,t.nextSibling),ut(a,r),At(a,1,n)},k)),e.nodes=e.vmodels=null}(d[s],T)}}if(!e.$track)for($ in this.cache)Ft(this.cache,$,m);!function(e){x.args=e,x.msRendered&&x.msRendered.apply(x,e)}(h.newWatch?arguments:[f]);var E=setTimeout(function(){clearTimeout(E),avalon.fireDom(x,"datasetchanged",{bubble:x.msHasEvent})});this.enterCount-=1}}),"with,each".replace(Kt,function(e){xn[e]=avalon.mix({},xn.repeat,{priority:1400})});var Rr=[],qr=[];avalon.directive("text",{update:function(e){var t=this.element;if(e=null==e?"":e,3===t.nodeType)try{t.data=e}catch(n){}else"textContent"in t?t.textContent=e:t.innerText=e}}),avalon.parseDisplay=Bt,avalon.directive("visible",{init:function(){},update:function(e){var t=this.element,n=this,a=n.stamp=+new Date;e?(t.style.display="none",avalon.effect.apply(t,1,function(){if(a===n.stamp){var e=t.getAttribute("data-effect-driver")||"a";/^[atn]/.test(e)&&(this.effectName||(t.style.display=""),"none"===avalon(t).css("display")&&(t.style.display=Bt(t.nodeName)))}})):avalon.effect.apply(t,0,function(){a===n.stamp&&(t.style.display="none")})}});var Vr=/]*>([\S\s]*?)<\/script\s*>/gim,Ir=/\s+(on[^=\s]+)(?:=("[^"]*"|'[^']*'|[^\s>]+))?/g,zr=/<\w+\b(?:(["'])[^"]*?(\1)|[^>])*>/gi,Wr={a:/\b(href)\=("javascript[^"]*"|'javascript[^']*')/gi,img:/\b(src)\=("javascript[^"]*"|'javascript[^']*')/gi,form:/\b(action)\=("javascript[^"]*"|'javascript[^']*')/gi},Xr=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Yr=/([^\#-~| |!])/g,Gr=avalon.filters={uppercase:function(e){return e.toUpperCase()},lowercase:function(e){return e.toLowerCase()},truncate:function(e,t,n){return t=t||30,n="string"==typeof n?n:"...",e.length>t?e.slice(0,t-n.length)+n:String(e)},$filter:function(e){for(var t=1,n=arguments.length;n>t;t++){var a=arguments[t],r=avalon.filters[a[0]];if("function"==typeof r){var i=[e].concat(a.slice(1));e=r.apply(null,i)}}return e},camelize:z,sanitize:function(e){return e.replace(Vr,"").replace(zr,function(e){var t=e.toLowerCase().match(/<(\w+)\s/);if(t){var n=Wr[t[1]];n&&(e=e.replace(n,function(e,t,n){var a=n.charAt(0);return t+"="+a+"javascript:void(0)"+a}))}return e.replace(Ir," ").replace(/\s+/g," ")})},escape:function(e){return String(e).replace(/&/g,"&").replace(Xr,function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1);return"&#"+(1024*(t-55296)+(n-56320)+65536)+";"}).replace(Yr,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")},currency:function(e,t,n){return(t||"¥")+Rt(e,isFinite(n)?n:2)},number:Rt};!new function(){function e(e){return parseInt(e,10)||0}function t(e,t,n){var a="";for(0>e&&(a="-",e=-e),e=""+e;e.length0||o>-a)&&(o+=a),0===o&&-12===a&&(o=12),t(o,n,r)}}function a(e,t){return function(n,a){var r=n["get"+e](),i=(t?"SHORT"+e:e).toUpperCase();return a[i][r]}}function r(e){var n=-1*e.getTimezoneOffset(),a=n>=0?"+":"";return a+=t(Math[n>0?"floor":"ceil"](n/60),2)+t(Math.abs(n%60),2)}function i(e,t){return e.getHours()<12?t.AMPMS[0]:t.AMPMS[1]}var o={yyyy:n("FullYear",4),yy:n("FullYear",2,0,!0),y:n("FullYear",1),MMMM:a("Month"),MMM:a("Month",!0),MM:n("Month",2,1),M:n("Month",1,1),dd:n("Date",2),d:n("Date",1),HH:n("Hours",2),H:n("Hours",1),hh:n("Hours",2,-12),h:n("Hours",1,-12),mm:n("Minutes",2),m:n("Minutes",1),ss:n("Seconds",2),s:n("Seconds",1),sss:n("Milliseconds",3),EEEE:a("Day"),EEE:a("Day",!0),a:i,Z:r},l=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,s=/^\/Date\((\d+)\)\/$/;Gr.date=function(t,n){var a,r,i=Gr.date.locate,c="",u=[];if(n=n||"mediumDate",n=i[n]||n,"string"==typeof t)if(/^\d+$/.test(t))t=e(t);else if(s.test(t))t=+RegExp.$1;else{var f=t.trim(),d=[0,0,0,0,0,0,0],p=new Date(0);f=f.replace(/^(\d+)\D(\d+)\D(\d+)/,function(t,n,a,r){var i=4===r.length?[r,n,a]:[n,a,r];return d[0]=e(i[0]),d[1]=e(i[1])-1,d[2]=e(i[2]),""});var v=p.setFullYear,h=p.setHours;f=f.replace(/[T\s](\d+):(\d+):?(\d+)?\.?(\d)?/,function(t,n,a,r,i){return d[3]=e(n),d[4]=e(a),d[5]=e(r),i&&(d[6]=Math.round(1e3*parseFloat("0."+i))),""});var m=0,y=0;f=f.replace(/Z|([+-])(\d\d):?(\d\d)/,function(t,n,a,r){return v=p.setUTCFullYear,h=p.setUTCHours,n&&(m=e(n+a),y=e(n+r)),""}),d[3]-=m,d[4]-=y,v.apply(p,d.slice(0,3)),h.apply(p,d.slice(3)),t=p}if("number"==typeof t&&(t=new Date(t)),"date"===avalon.type(t)){for(;n;)r=l.exec(n),r?(u=u.concat(r.slice(1)),n=u.pop()):(u.push(n),n=null);return u.forEach(function(e){a=o[e],c+=a?a(t,i):e.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),c}};var c={AMPMS:{0:"上午",1:"下午"},DAY:{0:"星期日",1:"星期一",2:"星期二",3:"星期三",4:"星期四",5:"星期五",6:"星期六"},MONTH:{0:"1月",1:"2月",2:"3月",3:"4月",4:"5月",5:"6月",6:"7月",7:"8月",8:"9月",9:"10月",10:"11月",11:"12月"},SHORTDAY:{0:"周日",1:"周一",2:"周二",3:"周三",4:"周四",5:"周五",6:"周六"},fullDate:"y年M月d日EEEE",longDate:"y年M月d日",medium:"yyyy-M-d H:mm:ss",mediumDate:"yyyy-M-d",mediumTime:"H:mm:ss","short":"yy-M-d ah:mm",shortDate:"yy-M-d",shortTime:"ah:mm"};c.SHORTMONTH=c.MONTH,Gr.date.locate=c};var Ur,Jr=[],Zr=function(e){for(Ur=!0,Xt&&(modules["domReady!"].state=4,Xt.checkDeps());e=Jr.shift();)e(avalon)};if("complete"===It.readyState)setTimeout(Zr);else if(sn)It.addEventListener("DOMContentLoaded",Zr);else{It.attachEvent("onreadystatechange",function(){"complete"===It.readyState&&Zr()});try{var Kr=null===e.frameElement}catch(Wn){}cn.doScroll&&Kr&&e.external&&qt()}avalon.bind(e,"load",Zr),avalon.ready=function(e){Ur?e(avalon):Jr.push(e)},avalon.config({loader:!0}),avalon.ready(function(){avalon.scan(It.body)}),"function"==typeof define&&define.amd&&define("avalon",[],function(){return avalon});var Qr=e.avalon;return avalon.noConflict=function(t){return t&&e.avalon===avalon&&(e.avalon=Qr),avalon},void 0===t&&(e.avalon=avalon),avalon}); \ No newline at end of file +!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("Avalon requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(){e.console&&avalon.config.debug&&Function.apply.call(console.log,console,arguments)}function a(e){return Function.apply(r,e)}function r(){}function i(e,t){"string"==typeof e&&(e=e.match(Kt)||[]);for(var n={},a=void 0!==t?t:1,r=0,i=e.length;i>r;r++)n[e[r]]=a;return n}function o(){if(e.VBArray){var t=document.documentMode;return t?t:e.XMLHttpRequest?7:6}return 0/0}function l(e){return tn.test(rn.call(e))}function s(e,t){return e=Math.floor(e)||0,0>e?Math.max(t+e,0):Math.min(e,t)}function c(e){if(!e)return!1;var t=e.length;if(t===t>>>0){var n=rn.call(e).slice(8,-1);if(/(?:regexp|string|function|window|global)$/i.test(n))return!1;if("Array"===n)return!0;try{return{}.propertyIsEnumerable.call(e,"length")===!1?/^\s?function/.test(e.item||e.callee):!0}catch(a){return!e.window}}return!1}function u(e,t,n){var a="for(var "+e+"i=0,n = this.length; i < n; i++){"+t.replace("_","((i in this) && fn.call(scope,this[i],i,this))")+"}"+n;return Function("fn,scope",a)}function f(e,t){try{for(;t=t.parentNode;)if(t===e)return!0;return!1}catch(n){return!1}}function d(){return(new XMLSerializer).serializeToString(this)}function p(e,t){if(e&&e.childNodes)for(var n,a=e.childNodes,r=0;n=a[r++];)if(n.tagName){var i=It.createElementNS(En,n.tagName.toLowerCase());on.forEach.call(n.attributes,function(e){i.setAttribute(e.name,e.value)}),p(n,i),t.appendChild(i)}}function v(e){var t={};for(var n in e)t[n]=e[n];var a=t.target=e.srcElement;if(0===e.type.indexOf("key"))t.which=null!=e.charCode?e.charCode:e.keyCode;else if(_n.test(e.type)){var r=a.ownerDocument||It,i="BackCompat"===r.compatMode?r.body:r.documentElement;t.pageX=e.clientX+(i.scrollLeft>>0)-(i.clientLeft>>0),t.pageY=e.clientY+(i.scrollTop>>0)-(i.clientTop>>0),t.wheelDeltaY=t.wheelDelta,t.wheelDeltaX=0}return t.timeStamp=new Date-0,t.originalEvent=e,t.preventDefault=function(){e.returnValue=!1},t.stopPropagation=function(){e.cancelBubble=!0},t}function h(e){for(var t in e)if(an.call(e,t)){var n=e[t];"function"==typeof h.plugins[t]?h.plugins[t](n):"object"==typeof h[t]?avalon.mix(h[t],n):h[t]=n}return this}function m(e){return(e+"").replace(Fn,"\\$&")}function y(e,t){var n=this.$events||(this.$events={}),a=n[e]||(n[e]=[]);if("function"==typeof t){var i=t;i.uniqueNumber=Math.random(),t={element:cn,type:"user-watcher",handler:r,vmodels:[this],expr:e,uniqueNumber:i.uniqueNumber},t.wildcard=/\*/.test(e)}if(t.update)t.oneTime||avalon.Array.ensure(a,t);else{if(/\w\.*\B/.test(e)){t.getter=r;var o=this;t.update=function(){var e=this.fireArgs||[];e[2]&&t.handler.apply(o,e),delete this.fireArgs},a.sync=!0,avalon.Array.ensure(a,t)}else avalon.injectBinding(t);i&&(t.handler=i)}return function(){t.update=t.getter=t.handler=r,t.element=It.createElement("a")}}function g(e,t){var n=this.$events;if(n&&n[e]){t&&(t[2]=e),x(n[e],t);var a=this.$up;a&&(this.$pathname&&g.call(a,this.$pathname+"."+e,t),g.call(a,"*."+e,t))}else if(a=this.$up){var r=this.$pathname+"."+e,i=r.split(".");-1===i.indexOf("*")?(g.call(a,r,t),i[1]="*",g.call(a,i.join("."),t)):g.call(a,r,t)}}function b(e,t){for(;;){if(e.$watch){var n=e.$events||(e.$events={}),a=n[t]||(n[t]=[]);return void Qn.collectDependency(a)}if(e=e.$up,!e)break;t=e.$pathname+"."+t}}function x(e,t){if(e){new Date-na>444&&"object"==typeof e[0]&&F();for(var n,a=[],r=[],i=0;n=e[i++];)"user-watcher"===n.type?a.push(n):r.push(n);if(h.async){for(fr.render(),i=0;n=r[i++];)if(n.update){var o=H(n);fr.queue[o]||(fr.queue[o]=1,fr.queue.push(n))}}else for(i=0;n=r[i++];)n.update&&n.update();for(i=0;n=a[i++];)(t&&t[2]===n.expr||n.wildcard)&&(n.fireArgs=t),n.update()}}function $(e,t){return t=t||{},t.watch=!0,C(e,t)}function w(){}function C(e,t){function a(e){return u[e]===!0}if(!e||e.$id&&e.$accessors)return e;t=t||Zt;var r=t.force||Zt,o=t.old,l=o&&o.$accessors||Zt,s=new w,c={},u={},f=[],d=[],p={};e.$skipArray&&(p=i(e.$skipArray),delete e.$skipArray);var v=e.$computed;if(v){delete e.$computed;for(var h in v)u[h]=!0,function(e,t){var n;c[e]={get:function(){return n=t.get.call(this)},set:function(a){if("function"==typeof t.set){var r=n;t.set.call(this,a);var i=this[e];this.$fire&&i!==r&&this.$fire(e,i,r)}},enumerable:!0,configurable:!0}}(h,v[h])}for(h in e){var m=e[h];qn[h]||(u[h]=!0),"function"==typeof m||m&&m.nodeType||!r[h]&&("$"===h.charAt(0)||qn[h]||p[h])?f.push(h):k(m)?(n("warning:计算属性建议放在$computed对象中统一定义"),function(e,t){var n;c[e]={get:function(){return n=t.get.call(this)},set:function(a){if("function"==typeof t.set){var r=n;t.set.call(this,a);var i=this[e];this.$fire&&i!==r&&this.$fire(e,i,r)}},enumerable:!0,configurable:!0}}(h,m)):(d.push(h),c[h]=l[h]?l[h]:N(h,m))}c.$model=Yn,s=zn(s,c,e),f.forEach(function(t){s[t]=e[t]}),A(s,"$id","anonymous"),A(s,"$up",o?o.$up:null),A(s,"$track",Object.keys(u)),A(s,"$active",!1),A(s,"$pathname",o?o.$pathname:""),A(s,"$accessors",c),A(s,"hasOwnProperty",a),t.watch&&(A(s,"$watch",function(){return y.apply(s,arguments)}),A(s,"$fire",function(e,t){if(0===e.indexOf("all!")){var n=e.slice(4);for(var a in avalon.vmodels){var r=avalon.vmodels[a];r.$fire&&r.$fire.apply(r,[n,t])}}else g.call(s,e,[t])})),d.forEach(function(t){var n=s[t]=e[t];n&&"object"==typeof n&&(n.$up=s,n.$pathname=t),g.call(s,t)});for(h in v)m=s[h];return s.$active=!0,s}function k(e){if(e&&"object"==typeof e){for(var t in e)if("get"!==t&&"set"!==t)return!1;return"function"==typeof e.get}}function N(e,t){var n;return t=0/0,{get:function(){return this.$active&&b(this,e),t},set:function(a){if(t!==a){var r=t;n=T(a,t),n?t=n:(n=void 0,t=a),Object(n)===n&&(n.$pathname=e,n.$up=this),this.$active&&g.call(this,e,[t,r])}},enumerable:!0,configurable:!0}}function T(e,t,n,a){if(Array.isArray(e))return E(e,t,a);if(avalon.isPlainObject(e)){if(t){var r=Xn(e),i=Xn(t);if(r.join(";")===i.join(";")){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);return t}t.$active=!1}return C(e,{old:t,watch:a})}return n?e:void 0}function E(e,t,n){if(t){var a=[0,t.length].concat(e);return t.splice.apply(t,a),t}for(var r in Zn)e[r]=Zn[r];A(e,"$up",null),A(e,"$pathname",""),A(e,"$track",M(e.length)),e._=C({length:0/0},{watch:!0}),e._.length=e.length,e._.$watch("length",function(t,n){g.call(e.$up,e.$pathname+".length",[t,n])}),n&&A(e,"$watch",function(){return y.apply(e,arguments)}),sn?Object.defineProperty(e,"$model",Yn):e.$model=_(e);for(var i=0,o=e.length;o>i;i++){var l=e[i]=T(e[i],0,1,1);Object(l)===l&&(l.$up=e)}return e}function A(e,t,n){In?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!1,configurable:!0}):e[t]=n}function _(e){var t=avalon.type(e);if("array"===t){for(var n=[],a=0;aa;a++){n[a]=e[a];var i=t[a];i in n?(e[a]=n[i],delete n[i]):e[a]=e[i]}}function M(e){for(var t=[],n=0;e>n;n++)t[n]=pn("$proxy$each");return t}function j(e,t,n){switch(t){case"push":case"unshift":n=M(n.length);break;case"splice":if(n.length>2){{n[1],n.length-2}n=[n[0],n[1]].concat(M(n.length-2))}}Array.prototype[t].apply(e,n)}function L(e,t){t.oneTime||e&&avalon.Array.ensure(e,t)&&t.element&&(P(t,e),new Date-na>444&&F())}function D(e,t){for(var n,a=[],r=0;n=e[r++];)a.push(t?n.$id:n.$key);return a.join(";")}function H(e){if(!e.uniqueNumber){var t=e.element;e.uniqueNumber=t?1!==t.nodeType?e.type+(e.pos||0)+"-"+H(t.parentNode):e.name+"-"+H(t):++ea}return e.uniqueNumber}function P(e,t){var n=e.lists||(e.lists=[]),a=H(e);avalon.Array.ensure(n,t),t.$uuid=t.$uuid||pn(),ta[a]||(ta[a]=1,ta.push(e))}function F(e){for(var t=ta.length,n=t,a=[],r={},i={};e=ta[--t];){var o=e.type;i[o]?i[o]++:(i[o]=1,a.push(o))}var l=!1;if(a.forEach(function(e){aa[e]!==i[e]&&(r[e]=1,l=!0)}),t=n,l)for(;e=ta[--t];)if(null!==e.element){if(r[e.type]&&R(e.element)){ta.splice(t,1),delete ta[e.uniqueNumber];for(var s,c=e.lists,u=0;s=c[u++];)avalon.Array.remove(c,s),avalon.Array.remove(s,e);B(e)}}else ta.splice(t,1);aa=i,na=new Date}function B(e){delete ta[e.uniqueNumber],e.element=null,e.rollback&&e.rollback();for(var t in e)e[t]=null}function R(e){try{{e.parentNode.nodeType}}catch(t){return!0}return e.ifRemove&&!cn.contains(e.ifRemove)&&Wt===e.parentNode?(e.parentNode&&e.parentNode.removeChild(e),!0):e.msRetain?0:1===e.nodeType?!cn.contains(e):!avalon.contains(cn,e)}function q(e){var t=e.nodeName;return t.toLowerCase()===t&&e.scopeName&&""===e.outerText}function V(e){"url(#default#VML)"!==e.currentStyle.behavior&&(e.style.behavior="url(#default#VML)",e.style.display="inline-block",e.style.zoom=1)}function I(e){return e.replace(/([a-z\d])([A-Z]+)/g,"$1-$2").toLowerCase()}function z(e){return!e||e.indexOf("-")<0&&e.indexOf("_")<0?e:e.replace(/[-_][^-_]/g,function(e){return e.charAt(1).toUpperCase()})}function W(e){if(!("classList"in e)){e.classList={node:e};for(var t in da)e.classList[t.slice(1)]=da[t]}return e.classList}function X(e){try{if("object"==typeof e)return e;e="true"===e?!0:"false"===e?!1:"null"===e?null:+e+""===e?+e:pa.test(e)?avalon.parseJSON(e):e}catch(t){}return e}function Y(e){return e.window&&e.document?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}function G(e,t){if(e.offsetWidth<=0){if(Aa.test(ga["@:get"](e,"display"))){var n={node:e};for(var a in Ea)n[a]=e.style[a],e.style[a]=Ea[a];t.push(n)}var r=e.parentNode;r&&1===r.nodeType&&G(r,t)}}function U(e){var t=e.tagName.toLowerCase();return"input"===t&&/checkbox|radio/.test(e.type)?"checked":t}function J(e,t){var n=[],r=!!t;t=t||0;for(var i="unknown",o="",l=0;lu;u++)if(i.length){var d="vm"+o+"_"+u;s.push(d),c.push(t[u]),l.push.apply(l,K(i,t[u],d,n))}n.args=c;var p=n.type,v=t.map(function(e){return String(e.$id).replace(Da,"$1")})+e+p,h=Pa.get(v);if(h){if("duplex"===p){var m=Pa.get(v+"setter");n.setter=m.apply(m,n.args)}return n.getter=h}if(l.length||l.push("fix"+o),"duplex"===p){var y={};l.forEach(function(e){var t=e.split("=");y[t[0].trim()]=t[1].trim()}),e=e.replace(/[\$\w]+/,function(e){return y[e]?y[e]:e});var g=a(s.concat("'use strict';return function(vvv){"+e+" = vvv\n}\n"));Pa.put(v+"setter",g),n.setter=g.apply(g,n.args)}if("on"===p){-1===e.indexOf("(")?e+=".call(this, $event)":e=e.replace("(",".call(this,"),s.push("$event"),e="\nreturn "+e+";";var b=e.lastIndexOf("\nreturn"),x=e.slice(0,b),$=e.slice(b);e=x+"\n"+$}else e="\nreturn "+e+";";return h=a(s.concat("'use strict';\nvar "+l.join(",\n")+e)),Pa.put(v,h)}function tt(e){var t=Dn.test(e);if(t){var n=pt(e);return 1===n.length?n[0].expr:n.map(function(e){return e.type?"("+e.expr+")":za(e.expr)}).join(" + ")}return e}function nt(e){return e=e.replace(Fa,"").replace(Ba,function(){return"],|"}).replace(Ra,function(e,t){return"["+za(t)}).replace(qa,function(){return'"],["'}).replace(Va,function(){return'",'})+"]",a(["return ["+e+"]"])()}function at(e,t,n){var a=setTimeout(function(){var r=e.innerHTML;clearTimeout(a),r===n?t():at(e,t,r)})}function rt(e,t){var n=e.getAttribute("avalonctrl")||t.$id;e.setAttribute("avalonctrl",n),t.$events&&(t.$events.expr=e.tagName+'[avalonctrl="'+n+'"]')}function it(e,t){for(var n,a=0;n=e[a++];)n.vmodels=t,xn[n.type].init(n),avalon.injectBinding(n),n.getter&&1===n.element.nodeType&&n.element.removeAttribute(n.name);e.length=0}function ot(e,t){return e.priority-t.priority}function lt(e,t,a){var r=!0;if(t.length){for(var i,o=ir?ir(e):e.attributes,l=[],s={},c=0;i=o[c++];){var u=i.name;if(!s[u]&&(s[u]=1,i.specified&&(a=u.match(Ua)))){var f=a[1],d=a[2]||"",p=i.value;if(Ja[f]?(d=f,f="on"):Za[f]&&(d=f,f="attr",u="ms-"+f+"-"+d,n("warning!请改用"+u+"代替"+i.name+"!")),xn[f]){var v=p.replace(Ga,""),h=p!==v,m={type:f,param:d,element:e,name:u,expr:v,oneTime:h,uniqueNumber:i.name+"-"+H(e),priority:(xn[f].priority||10*f.charCodeAt(0))+(Number(d.replace(/\D/g,""))||0)};if("html"===f||"text"===f){var y=dt(p).filters;m.expr=m.expr.replace(y,""),m.filters=y.replace(lr,function(){return m.type="html",m.group=1,""}).trim()}else if("duplex"===f)var g=u;else if("ms-if-loop"===u)m.priority+=100;else if("ms-attr-value"===u)var b=u;l.push(m)}}}if(l.length){for(l.sort(ot),g&&b&&"INPUT"===e.nodeName&&"text"===e.type&&n("warning!一个控件不能同时定义ms-attr-value与"+g),c=0;m=l[c];c++){if(f=m.type,Ka.test(f))return it(l.slice(0,c+1),t);r&&(r=!Qa.test(f))}it(l,t)}}r&&!Wa[e.tagName]&&(mt(e)?e.msResolved:1)&&(Ya&&Ya(e),ct(e,t))}function st(e){for(var t,n=ir?ir(e):e.attributes,a={},r=0;t=n[r++];)t.specified&&!or.test(t.name)&&(a[z(t.name)]=X(t.value));return a}function ct(e,t){var n=avalon.slice(e.childNodes);ut(n,t)}function ut(e,t){for(var n,a=0;n=e[a++];)switch(n.nodeType){case 1:var r=n;if(ft(n,t),!r.msResolved&&r.parentNode&&1===r.parentNode.nodeType){var i=mt(r);if(i){var o=r.localName?r.localName.replace(i+":",""):r.nodeName,l=i+":"+z(o);dr.push({library:i,element:r,fullName:l,widget:o,vmodels:t,name:"widget"}),avalon.components[l]&&avalon.component(l)}}n.msHasEvent&&avalon.fireDom(n,"datasetchanged",{bubble:n.msHasEvent});break;case 3:Dn.test(n.nodeValue)&&vt(n,t,a)}}function ft(e,t,a){var r=e.getAttribute("ms-skip");if(!e.getAttributeNode)return n("warning "+e.tagName+" no getAttributeNode method");var i=e.getAttributeNode("ms-important"),o=e.getAttributeNode("ms-controller");if("string"!=typeof r){if(a=i||o){var l=avalon.vmodels[a.value];if(!l)return;t=a===i?[l]:[l].concat(t);var s=a.name;e.removeAttribute(s),avalon(e).removeClass(s),rt(e,l)}lt(e,t)}}function dt(e){if(e.indexOf("|")>0){var t=e.replace(cr,function(e){return Array(e.length+1).join("1")}),n=t.replace(sr,"ᄢ㍄").indexOf("|");if(n>-1)return{type:"text",filters:e.slice(n).trim(),expr:e.slice(0,n)}}return{type:"text",expr:e,filters:""}}function pt(e){for(var t,n,a=[],r=0;;){if(n=e.indexOf(jn,r),-1===n)break;if(t=e.slice(r,n),t&&a.push({expr:t}),r=n+jn.length,n=e.indexOf(Ln,r),-1===n)break;t=e.slice(r,n),t&&a.push(dt(t,r)),r=n+Ln.length}return t=e.slice(r),t&&a.push({expr:t}),a}function vt(e,t,n){var a=[],r=pt(e.data);if(r.length){for(var i,o=0;i=r[o++];){var l=It.createTextNode(i.expr);i.type&&(i.expr=i.expr.replace(Ga,function(){return i.oneTime=!0,""}),i.element=l,i.filters=i.filters.replace(lr,function(){return i.type="html",""}),i.pos=1e3*n+o,a.push(i)),un.appendChild(l)}e.parentNode.replaceChild(un,e),a.length&&it(a,t)}}function ht(e,t){if(t)for(var n,a=0;n=e[a++];)if(n.hasOwnProperty(t)&&"object"==typeof n[t]){var r=n[t];return r.$model||r}return{}}function mt(e){if(e.scopeName&&"HTML"!==e.scopeName)return e.scopeName;var t=e.nodeName.toLowerCase(),n=t.indexOf(":");return n>0?t.slice(0,n):void 0}function yt(e){return null==e?"":e}function gt(e,t,n){return t.param.replace(Qt,function(a){var r=avalon.duplexHooks[a];r&&"function"==typeof r[n]&&(e=r[n](e,t))}),e}function bt(){for(var e=Cr.length-1;e>=0;e--){var t=Cr[e];t()===!1&&Cr.splice(e,1)}Cr.length||clearInterval(wr)}function xt(e,t){if(!e||1!==e.nodeType)return null;if(t)var n=t.effectName,a=t.effectDriver;else n=e.getAttribute("data-effect-name"),a=e.getAttribute("data-effect-driver");if(!n||!a)return null;var r=Sr.pop()||new Ct;return r.el=e,r.driver=a,r.useCss="j"!==a,r.useCss&&(t&&avalon(e).addClass(t.effectClass),r.cssEvent="t"===a?Nr:Tr),r.name=n,r.callbacks=avalon.effects[n]||{},r}function $t(e,t){var n=e.getAttribute("data-effect-name");if(n){t.effectName=n,t.effectDriver=e.getAttribute("data-effect-driver");var a=+e.getAttribute("data-effect-stagger");t.effectLeaveStagger=+e.getAttribute("data-effect-leave-stagger")||a,t.effectEnterStagger=+e.getAttribute("data-effect-enter-stagger")||a,t.effectClass=e.className||0/0}}function wt(e){return e.replace(/^[\S]/g,function(e){return e.toUpperCase()})}function Ct(){}function kt(e,t){var n=e.callbacks[t+"Class"];return"string"==typeof n?n:"function"==typeof n?n():e.name+"-"+t}function Nt(e,t,n){var a=e.callbacks[t];a&&a.call(e,e.el,n)}function Tt(e,t,n){var a=e.templateCache&&e.templateCache[t];if(a){for(var r,i=It.createDocumentFragment();r=a.firstChild;)i.appendChild(r);return i}return avalon.parseHTML(n)}function Et(e){for(var t=It.createDocumentFragment(),n=0,a=e.length;a>n;n++)t.appendChild(e[n]);return t}function At(e,t,n){for(var a,i=0;a=e[i++];)a.className===n.effectClass&&avalon.effect.apply(a,t,r,r,n)}function _t(e,t,n){return e?setTimeout(t,++n*e):t(),n}function Ot(e,t){for(var n=un.cloneNode(!1),a=e,i=a.nodeValue,o=t&&Math.max(+t.staggerIndex,0),l=avalon.slice(a.parentNode.childNodes),s=l.indexOf(a);;){var c=l[--s];if(!c||0===String(c.nodeValue).indexOf(i))break;t&&c.className===t.effectClass?(e=c,function(e){t.staggerIndex=_t(t.effectLeaveStagger,function(){avalon.effect.apply(e,0,r,function(){n.appendChild(e)},t)},o)}(c)):n.insertBefore(c,n.firstChild)}return n.appendChild(a),n}function St(e,t,n,a,r){var i=e.template.cloneNode(!0),o=avalon.slice(i.childNodes);i.appendChild(n.$anchor),r&&t.appendChild(i);var l=[n].concat(e.vmodels),s={nodes:o,vmodels:l,content:i};a.push(s)}function Mt(e){var t="object"===e.xtype?Ht:jt,n=t(e),a=n.$anchor||(n.$anchor=e.element.cloneNode(!1));return a.nodeValue=e.signature,n.$outer=e.$outer,n}function jt(e,t){for(var n=e.param||"el",a=0,r=Rr.length;r>a;a++){var i=Rr[a];if(i&&i.hasOwnProperty(n)){Rr.splice(a,1),t=i;break}}return t||(t=Lt(n)),t}function Lt(e){var t={$outer:{},$index:0,$oldIndex:0,$anchor:null,$first:!1,$last:!1,$remove:avalon.noop};t[e]=0/0;var n={$last:1,$first:1,$index:1};n[e]=1;var a=$(t,{force:n});return a.$id=pn("$proxy$each"),a}function Dt(e,t,n){if("array"===n){e.$remove=function(){t.$repeat.removeAt(e.$index)};var a=t.param;e.$watch(a,function(n){var a=e.$index;t.$repeat[a]=n})}else e.$watch("$val",function(n){t.$repeat[e.$key]=n})}function Ht(){return qr.pop()||Pt()}function Pt(){var e=$({$key:"",$val:0/0,$index:0,$oldIndex:0,$outer:{},$anchor:null},{force:{$key:1,$val:1,$index:1}});return e.$id=pn("$proxy$with"),e}function Ft(e,t,n){var a=e[t];if(a){var r=0===a.$id.indexOf("$proxy$each")?Rr:qr;a.$outer={};for(var i in a.$events){var o=a.$events[i];Array.isArray(o)&&(o.length=0,i===n?a[n]=0/0:"$val"===i&&(a.$val=0/0))}r.unshift(a)>h.maxRepeatSize&&r.pop(),delete e[t]}}function Bt(e,t){var n="_"+e;if(!Bt[n]){var a=It.createElement(e);cn.appendChild(a),t=sn?getComputedStyle(a,null).display:a.currentStyle.display,cn.removeChild(a),Bt[n]=t}return Bt[n]}function Rt(e,t,n,a){e=(e+"").replace(/[^0-9+\-Ee.]/g,"");var r=isFinite(+e)?+e:0,i=isFinite(+t)?Math.abs(t):3,o=a||",",l=n||".",s="",c=function(e,t){var n=Math.pow(10,t);return""+(Math.round(e*n)/n).toFixed(t)};return s=(i?c(r,i):""+Math.round(r)).split("."),s[0].length>3&&(s[0]=s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,o)),(s[1]||"").length.avalonHide{ display: none!important }",Wt.setAttribute("ms-skip","1"),Wt.className="avalonHide";var Xt,Yt=/\[native code\]/,Gt="$"+Vt,Ut=e.require,Jt=e.define,Zt={},Kt=/[^, ]+/g,Qt=/\w+/g,en=/^\[object SVG\w*Element\]$/,tn=/^\[object (?:Window|DOMWindow|global)\]$/,nn=Object.prototype,an=nn.hasOwnProperty,rn=nn.toString,on=Array.prototype,ln=on.slice,sn=e.dispatchEvent,cn=It.documentElement,un=It.createDocumentFragment(),fn=It.createElement("div"),dn={};"Boolean Number String Function Array Date RegExp Object Error".replace(Kt,function(e){dn["[object "+e+"]"]=e.toLowerCase()});var pn=function(e){return e=e||"avalon",String(Math.random()+Math.random()).replace(/\d\.\d{4}/,e)},vn=o();avalon=function(e){return new avalon.init(e)},avalon.nextTick=new function(){function t(){for(var e=r.length,t=0;e>t;t++)r[t]();r=r.slice(e)}var n=e.setImmediate,a=e.MutationObserver;if(n)return n.bind(e);var r=[];if(a){var i=document.createTextNode("avalon");new a(t).observe(i,{characterData:!0});var o=!1;return function(e){r.push(e),o=!o,i.data=o}}return function(e){setTimeout(e,4)}},avalon.init=function(e){this[0]=this.element=e},avalon.fn=avalon.prototype=avalon.init.prototype,avalon.type=function(e){return null==e?String(e):"object"==typeof e||"function"==typeof e?dn[rn.call(e)]||"object":typeof e};var hn="object"==typeof alert?function(e){try{return/^\s*\bfunction\b/.test(e+"")}catch(t){return!1}}:function(e){return"[object Function]"===rn.call(e)};avalon.isFunction=hn,avalon.isWindow=function(e){return e?e==e.document&&e.document!=e:!1},l(e)&&(avalon.isWindow=l);var mn;for(mn in avalon({}))break;var yn="0"!==mn;avalon.isPlainObject=function(e,t){if(!e||"object"!==avalon.type(e)||e.nodeType||avalon.isWindow(e))return!1;try{if(e.constructor&&!an.call(e,"constructor")&&!an.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}if(yn)for(t in e)return an.call(e,t);for(t in e);return void 0===t||an.call(e,t)},Yt.test(Object.getPrototypeOf)&&(avalon.isPlainObject=function(e){return"[object Object]"===rn.call(e)&&Object.getPrototypeOf(e)===nn}),avalon.mix=avalon.fn.mix=function(){var e,t,n,a,r,i,o=arguments[0]||{},l=1,s=arguments.length,c=!1;for("boolean"==typeof o&&(c=o,o=arguments[1]||{},l++),"object"==typeof o||hn(o)||(o={}),l===s&&(o=this,l--);s>l;l++)if(null!=(e=arguments[l]))for(t in e){n=o[t];try{a=e[t]}catch(u){continue}o!==a&&(c&&a&&(avalon.isPlainObject(a)||(r=Array.isArray(a)))?(r?(r=!1,i=n&&Array.isArray(n)?n:[]):i=n&&avalon.isPlainObject(n)?n:{},o[t]=avalon.mix(c,i,a)):void 0!==a&&(o[t]=a))}return o},avalon.mix({rword:Kt,subscribers:Gt,version:1.53,ui:{},log:n,slice:sn?function(e,t,n){return ln.call(e,t,n)}:function(e,t,n){var a=[],r=e.length;if(void 0===n&&(n=r),"number"==typeof n&&isFinite(n)){t=s(t,r),n=s(n,r);for(var i=t;n>i;++i)a[i-t]=e[i]}return a},noop:r,error:function(e,t){throw(t||Error)(e)},oneObject:i,range:function(e,t,n){n||(n=1),null==t&&(t=e||0,e=0);for(var a=-1,r=Math.max(0,Math.ceil((t-e)/n)),i=new Array(r);++an&&t(n,e[n])!==!1;n++);else for(n in e)if(e.hasOwnProperty(n)&&t(n,e[n])===!1)break}},getWidgetData:function(e,t){var n=avalon(e).data(),a={};for(var r in n)0===r.indexOf(t)&&(a[r.replace(t,"").replace(/\w/,function(e){return e.toLowerCase()})]=n[r]);return a},Array:{ensure:function(e,t){return-1===e.indexOf(t)?e.push(t):void 0},removeAt:function(e,t){return!!e.splice(t,1).length},remove:function(e,t){var n=e.indexOf(t);return~n?avalon.Array.removeAt(e,n):!1}}});var gn=avalon.bindingHandlers={},bn=avalon.bindingExecutors={},xn=avalon.directives={};avalon.directive=function(e,t){return gn[e]=t.init=t.init||r,bn[e]=t.update=t.update||r,xn[e]=t};var $n=new function(){function e(e){this.size=0,this.limit=e,this.head=this.tail=void 0,this._keymap={}}var t=e.prototype;return t.put=function(e,t){var n={key:e,value:t};return this._keymap[e]=n,this.tail?(this.tail.newer=n,n.older=this.tail):this.head=n,this.tail=n,this.size===this.limit?this.shift():this.size++,t},t.shift=function(){var e=this.head;e&&(this.head=this.head.newer,this.head.older=e.newer=e.older=this._keymap[e.key]=void 0,delete this._keymap[e.key])},t.get=function(e){var t=this._keymap[e];if(void 0!==t)return t===this.tail?t.value:(t.newer&&(t===this.head&&(this.head=t.newer),t.newer.older=t.older),t.older&&(t.older.newer=t.newer),t.newer=void 0,t.older=this.tail,this.tail&&(this.tail.newer=t),this.tail=t,t.value)},e};if(!"司徒正美".trim){var wn=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;String.prototype.trim=function(){return this.replace(wn,"")}}var Cn=!{toString:null}.propertyIsEnumerable("toString"),kn=function(){}.propertyIsEnumerable("prototype"),Nn=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Tn=Nn.length;if(Object.keys||(Object.keys=function(e){var t=[],n=kn&&"function"==typeof e;if("string"==typeof e||e&&e.callee)for(var a=0;al;l++){var s=Nn[l];o&&"constructor"===s||!an.call(e,s)||t.push(s)}return t}),Array.isArray||(Array.isArray=function(e){return"[object Array]"===rn.call(e)}),r.bind||(Function.prototype.bind=function(e){if(arguments.length<2&&void 0===e)return this;var t=this,n=arguments;return function(){var a,r=[];for(a=1;aa&&(a+=n);n>a;a++)if(this[a]===e)return a;return-1},lastIndexOf:function(e,t){var n=this.length,a=null==t?n-1:t;for(0>a&&(a=Math.max(0,n+a));a>=0;a--)if(this[a]===e)return a;return-1},forEach:u("","_",""),filter:u("r=[],j=0,","if(_)r[j++]=this[i]","return r"),map:u("r=[],","r[i]=_","return r"),some:u("","if(_)return true","return false"),every:u("","if(!_)return false","return true")}),avalon.contains=f,It.contains||(It.contains=function(e){return f(It,e)}),e.SVGElement){It.createTextNode("x").contains||(Node.prototype.contains=function(e){return!!(16&this.compareDocumentPosition(e))});var En="http://www.w3.org/2000/svg",An=It.createElementNS(En,"svg");An.innerHTML='',en.test(An.firstChild)||Object.defineProperties(SVGElement.prototype,{outerHTML:{enumerable:!0,configurable:!0,get:d,set:function(e){var t=this.tagName.toLowerCase(),n=this.parentNode,a=avalon.parseHTML(e);if("svg"===t)n.insertBefore(a,this);else{var r=It.createDocumentFragment();p(a,r),n.insertBefore(r,this)}n.removeChild(this)}},innerHTML:{enumerable:!0,configurable:!0,get:function(){var e=this.outerHTML,t=new RegExp("<"+this.nodeName+'\\b(?:(["\'])[^"]*?(\\1)|[^>])*>',"i"),n=new RegExp("$","i");return e.replace(t,"").replace(n,"")},set:function(e){if(avalon.clearHTML){avalon.clearHTML(this);var t=avalon.parseHTML(e);p(t,this)}}}})}!cn.outerHTML&&e.HTMLElement&&HTMLElement.prototype.__defineGetter__("outerHTML",d);var _n=/^(?:mouse|contextmenu|drag)|click/,On=avalon.eventHooks;if("onmouseenter"in cn||avalon.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){On[e]={type:t,fn:function(t,n){return function(a){var r=a.relatedTarget;return r&&(r===t||16&t.compareDocumentPosition(r))?void 0:(delete a.type,a.type=e,n.call(t,a))}}}}),avalon.each({AnimationEvent:"animationend",WebKitAnimationEvent:"webkitAnimationEnd"},function(t,n){e[t]&&!On.animationend&&(On.animationend={type:n})}),"oninput"in It.createElement("input")||(On.input={type:"propertychange",deel:function(e,t){return function(n){return"value"===n.propertyName?(n.type="input",t.call(e,n)):void 0}}}),void 0===It.onmousewheel){var Sn=void 0!==It.onwheel?"wheel":"DOMMouseScroll",Mn="wheel"===Sn?"deltaY":"detail";On.mousewheel={type:Sn,fn:function(e,t){return function(n){n.wheelDeltaY=n.wheelDelta=n[Mn]>0?-120:120,n.wheelDeltaX=0,Object.defineProperty&&Object.defineProperty(n,"type",{value:"mousewheel"}),t.call(e,n)}}}}var jn,Ln,Dn,Hn,Pn,Fn=/[-.*+?^${}()|[\]\/\\]/g,Bn={loader:function(t){var n=Xt&&t;e.require=n?Xt:Ut,e.define=n?Xt.define:Jt},interpolate:function(e){if(jn=e[0],Ln=e[1],jn===Ln){throw new SyntaxError("openTag!==closeTag")}h.openTag=jn,h.closeTag=Ln;var t=m(jn),n=m(Ln);Dn=new RegExp(t+"(.*?)"+n),Hn=new RegExp(t+"(.*?)"+n,"g"),Pn=new RegExp(t+".*?"+n+"|\\sms-")}};h.async=!0,h.debug=!0,h.plugins=Bn,h.plugins.interpolate(["{{","}}"]),h.paths={},h.shim={},h.maxRepeatSize=100,avalon.config=h;var Rn=avalon.vmodels={};avalon.define=function(e){var t=e.$id;t||n("warning: vm必须指定$id");var a=$(e);return a.$id=t,Rn[t]=a};var qn=i("$id,$watch,$fire,$events,$model,$skipArray,$active,$pathname,$up,$track,$accessors"),Vn=Object.defineProperty,In=!0;try{Vn({},"_",{value:"x"});var zn=Object.defineProperties}catch(Wn){In=!1}var Xn=Yt.test(Object.key)?Object.key:function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&!qn[n]&&t.push(n);return t},Yn={get:function(){return _(this)},set:r,enumerable:!1,configurable:!0};if(!In&&("__defineGetter__"in avalon&&(Vn=function(e,t,n){return"value"in n&&(e[t]=n.value),"get"in n&&e.__defineGetter__(t,n.get),"set"in n&&e.__defineSetter__(t,n.set),e},zn=function(e,t){for(var n in t)t.hasOwnProperty(n)&&Vn(e,n,t[n]);return e}),vn)){var Gn={};e.execScript(["Function parseVB(code)"," ExecuteGlobal(code)","End Function"].join("\n"),"VBScript"),zn=function(t,n,a){var r=[];r.push("\r\n Private [__data__], [__proxy__]"," Public Default Function [__const__](d"+Vt+", p"+Vt+")"," Set [__data__] = d"+Vt+": set [__proxy__] = p"+Vt," Set [__const__] = Me"," End Function");var i={};for(t in n)i[t]=!0,r.push(" Public Property Let ["+t+"](val"+Vt+")",' Call [__proxy__](Me,[__data__], "'+t+'", val'+Vt+")"," End Property"," Public Property Set ["+t+"](val"+Vt+")",' Call [__proxy__](Me,[__data__], "'+t+'", val'+Vt+")"," End Property"," Public Property Get ["+t+"]"," On Error Resume Next"," Set["+t+'] = [__proxy__](Me,[__data__],"'+t+'")'," If Err.Number <> 0 Then"," ["+t+'] = [__proxy__](Me,[__data__],"'+t+'")'," End If"," On Error Goto 0"," End Property");for(t in a)i[t]!==!0&&(i[t]=!0,r.push(" Public ["+t+"]"));for(t in qn)i[t]!==!0&&(i[t]=!0,r.push(" Public ["+t+"]"));r.push(" Public [hasOwnProperty]"),r.push("End Class");var o=r.join("\r\n"),l=Gn[o];l||(l=pn("VBClass"),e.parseVB("Class "+l+o),e.parseVB(["Function "+l+"Factory(a, b)"," Dim o"," Set o = (New "+l+")(a, b)"," Set "+l+"Factory = o","End Function"].join("\r\n")),Gn[o]=l);var s=e[l+"Factory"](n,O);return s}}var Un=["push","pop","shift","unshift","splice"],Jn=Array.prototype,Zn={notify:function(){g.call(this.$up,this.$pathname) +},set:function(e,t){if(e>>>0===e&&this[e]!==t){if(e>this.length)throw Error(e+"set方法的第一个参数不能大于原数组长度");g.call(this.$up,this.$pathname+".*",[t,this[e]]),this.splice(e,1,t)}},contains:function(e){return-1!==this.indexOf(e)},ensure:function(e){return this.contains(e)||this.push(e),this},pushArray:function(e){return this.push.apply(this,e)},remove:function(e){return this.removeAt(this.indexOf(e))},removeAt:function(e){return e>>>0===e?this.splice(e,1):[]},size:function(){return this._.length},removeAll:function(e){if(Array.isArray(e))for(var t=this.length-1;t>=0;t--)-1!==e.indexOf(this[t])&&(Kn.call(this.$track,t,1),Kn.call(this,t,1));else if("function"==typeof e)for(t=this.length-1;t>=0;t--){var n=this[t];e(n,t)&&(Kn.call(this.$track,t,1),Kn.call(this,t,1))}else Kn.call(this.$track,0,this.length),Kn.call(this,0,this.length);sn||(this.$model=_(this)),this.notify(),this._.length=this.length},clear:function(){return this.removeAll()}},Kn=Jn.splice;Un.forEach(function(e){var t=Jn[e];Zn[e]=function(){for(var n=[],a=0,r=arguments.length;r>a;a++)n[a]=T(arguments[a],0,1,1);var i=t.apply(this,n);return j(this.$track,e,n),sn||(this.$model=_(this)),this.notify(),this._.length=this.length,i}}),"sort,reverse".replace(Kt,function(e){Zn[e]=function(){var t=this.concat(),n=this,a=Math.random(),r=[],i=!1;Jn[e].apply(n,arguments);for(var o=0,l=t.length;l>o;o++){var s=n[o],c=t[o];if(s===c)r.push(o);else{var u=t.indexOf(s);r.push(u),t[u]=a,i=!0}}return i&&(S(this.$track,r),sn||(this.$model=_(this)),this.notify()),this}});var Qn=function(){var e,t=[];return{begin:function(n){t.push(e),e=n},end:function(){e=t.pop()},collectDependency:function(t){e&&e.callback(t)}}}();avalon.injectBinding=function(e){e.handler=e.handler||xn[e.type].update||r,e.update=function(){var t=!1;e.getter||(t=!0,Qn.begin({callback:function(t){L(t,e)}}),e.getter=et(e.expr,e.vmodels,e),e.observers.forEach(function(t){t.v.$watch(t.p,e)}),delete e.observers);try{var a,r,i=e.fireArgs;if(delete e.fireArgs,i?(a=i[0],r=i[1]):a="on"===e.type?e.getter+"":e.getter.apply(0,e.args),r="undefined"==typeof r?e.oldValue:r,e._filters&&(a=Gr.$filter.apply(0,[a].concat(e._filters))),e.signature){var o=avalon.type(a);if("array"!==o&&"object"!==o)throw Error("warning:"+e.expr+"只能是对象或数组");e.xtype=o;var l=D(e.proxies||[],o),s=a.$track||("array"===o?M(a.length):Object.keys(a));e.track=s,l!==s.join(";")&&(e.handler(a,r),e.oldValue=1)}else(Array.isArray(a)?a.length===(r&&r.length):1)?"oldValue"in e&&a===r||(e.handler(a,r),e.oldValue=a):(e.handler(a,r),e.oldValue=a.concat())}catch(c){delete e.getter,n("warning:exception throwed in [avalon.injectBinding] ",c);var u=e.element;u&&3===u.nodeType&&(u.nodeValue=jn+(e.oneTime?"::":"")+e.expr+Ln)}finally{t&&Qn.end()}},e.update()};var ea=0,ta=avalon.$$subscribers=[],na=new Date,aa={},ra={area:[1,"",""],param:[1,"",""],col:[2,"","
"],legend:[1,"
","
"],option:[1,""],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],g:[1,'',""],_default:sn?[0,"",""]:[1,"X
","
"]};ra.th=ra.td,ra.optgroup=ra.option,ra.tbody=ra.tfoot=ra.colgroup=ra.caption=ra.thead,String("circle,defs,ellipse,image,line,path,polygon,polyline,rect,symbol,text,use").replace(Kt,function(e){ra[e]=ra.g});var ia=/<([\w:]+)/,oa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,la=sn?/[^\d\D]/:/(<(?:script|link|style|meta|noscript))/gi,sa=i(["","text/javascript","text/ecmascript","application/ecmascript","application/javascript"]),ca=/<(?:tb|td|tf|th|tr|col|opt|leg|cap|area)/,ua=It.createElement("script"),fa=/<|&#?\w+;/;avalon.parseHTML=function(e){var t=un.cloneNode(!1);if("string"!=typeof e)return t;if(!fa.test(e))return t.appendChild(It.createTextNode(e)),t;e=e.replace(oa,"<$1>").trim();var n,a,r=(ia.exec(e)||["",""])[1].toLowerCase(),i=ra[r]||ra._default,o=fn;sn||(e=e.replace(la,"
$1")),o.innerHTML=i[1]+e+i[2];var l=o.getElementsByTagName("script");if(l.length)for(var s,c=0;s=l[c++];)sa[s.type]&&(a=ua.cloneNode(!1),on.forEach.call(s.attributes,function(e){e&&e.specified&&(a[e.name]=e.value,a.setAttribute(e.name,e.value))}),a.text=s.text,s.parentNode.replaceChild(a,s));if(!sn){var u="X
"===i[1]?o.lastChild.firstChild:o.lastChild;if(u&&"TABLE"===u.tagName&&"tbody"!==r)for(l=u.childNodes,c=0;s=l[c++];)if("TBODY"===s.tagName&&!s.innerHTML){u.removeChild(s);break}l=o.getElementsByTagName("br");for(var f=l.length;s=l[--f];)"msNoScope"===s.className&&s.parentNode.removeChild(s);for(l=o.all,c=0;s=l[c++];)q(s)&&V(s)}for(c=i[0];c--;o=o.lastChild);for(;n=o.firstChild;)t.appendChild(n);return t},avalon.innerHTML=function(e,t){if(!sn&&!la.test(t)&&!ca.test(t))try{return void(e.innerHTML=t)}catch(n){}var a=this.parseHTML(t);this.clearHTML(e).appendChild(a)},avalon.clearHTML=function(e){for(e.textContent="";e.firstChild;)e.removeChild(e.firstChild);return e};var da={_toString:function(){var e=this.node,t=e.className,n="string"==typeof t?t:t.baseVal;return n.split(/\s+/).join(" ")},_contains:function(e){return(" "+this+" ").indexOf(" "+e+" ")>-1},_add:function(e){this.contains(e)||this._set(this+" "+e)},_remove:function(e){this._set((" "+this+" ").replace(" "+e+" "," "))},__set:function(e){e=e.trim();var t=this.node;en.test(t)?t.setAttribute("class",e):t.className=e}};"add,remove".replace(Kt,function(e){avalon.fn[e+"Class"]=function(t){var n=this[0];return t&&"string"==typeof t&&n&&1===n.nodeType&&t.replace(/\S+/g,function(t){W(n)[e](t)}),this}}),avalon.fn.mix({hasClass:function(e){var t=this[0]||{};return 1===t.nodeType&&W(t).contains(e)},toggleClass:function(e,t){for(var n,a=0,r=String(e).split(/\s+/),i="boolean"==typeof t;n=r[a++];){var o=i?t:!this.hasClass(n);this[o?"addClass":"removeClass"](n)}return this},attr:function(e,t){return 2===arguments.length?(this[0].setAttribute(e,t),this):this[0].getAttribute(e)},data:function(e,t){switch(e="data-"+I(e||""),arguments.length){case 2:return this.attr(e,t),this;case 1:var n=this.attr(e);return X(n);case 0:var a={};return on.forEach.call(this[0].attributes,function(t){t&&(e=t.name,e.indexOf("data-")||(e=z(e.slice(5)),a[e]=X(t.value)))}),a}},removeData:function(e){return e="data-"+I(e),this[0].removeAttribute(e),this},css:function(e,t){if(avalon.isPlainObject(e))for(var n in e)avalon.css(this,n,e[n]);else var a=avalon.css(this,e,t);return void 0!==a?a:this},position:function(){var e,t,n=this[0],a={top:0,left:0};if(n)return"fixed"===this.css("position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),"HTML"!==e[0].tagName&&(a=e.offset()),a.top+=avalon.css(e[0],"borderTopWidth",!0),a.left+=avalon.css(e[0],"borderLeftWidth",!0),a.top-=e.scrollTop(),a.left-=e.scrollLeft()),{top:t.top-a.top-avalon.css(n,"marginTop",!0),left:t.left-a.left-avalon.css(n,"marginLeft",!0)}},offsetParent:function(){for(var e=this[0].offsetParent;e&&"static"===avalon.css(e,"position");)e=e.offsetParent;return avalon(e||cn)},bind:function(e,t,n){return this[0]?avalon.bind(this[0],e,t,n):void 0},unbind:function(e,t,n){return this[0]&&avalon.unbind(this[0],e,t,n),this},val:function(e){var t=this[0];if(t&&1===t.nodeType){var n=0===arguments.length,a=n?":get":":set",r=Oa[U(t)+a];if(r)var i=r(t,e);else{if(n)return(t.value||"").replace(/\r/g,"");t.value=e}}return n?i:this}});var pa=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,va=/^[\],:{}\s]*$/,ha=/(?:^|:|,)(?:\s*\[)+/g,ma=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,ya=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g;avalon.parseJSON=e.JSON?JSON.parse:function(e){if("string"==typeof e){if(e=e.trim(),e&&va.test(e.replace(ma,"@").replace(ya,"]").replace(ha,"")))return new Function("return "+e)();avalon.error("Invalid JSON: "+e)}return e},avalon.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){avalon.fn[e]=function(n){var a=this[0]||{},r=Y(a),i="scrollTop"===e;return arguments.length?void(r?r.scrollTo(i?avalon(r).scrollLeft():n,i?n:avalon(r).scrollTop()):a[e]=n):r?t in r?r[t]:cn[e]:a[e]}});var ga=avalon.cssHooks={},ba=["","-webkit-","-o-","-moz-","-ms-"],xa={"float":sn?"cssFloat":"styleFloat"};if(avalon.cssNumber=i("animationIterationCount,columnCount,order,flex,flexGrow,flexShrink,fillOpacity,fontWeight,lineHeight,opacity,orphans,widows,zIndex,zoom"),avalon.cssName=function(e,t,n){if(xa[e])return xa[e];t=t||cn.style;for(var a=0,r=ba.length;r>a;a++)if(n=z(ba[a]+e),n in t)return xa[e]=n;return null},ga["@:set"]=function(e,t,n){try{e.style[t]=n}catch(a){}},e.getComputedStyle)ga["@:get"]=function(e,t){if(!e||!e.style)throw new Error("getComputedStyle要求传入一个节点 "+e);var n,a=getComputedStyle(e,null);return a&&(n="filter"===t?a.getPropertyValue(t):a[t],""===n&&(n=e.style[t])),n},ga["opacity:get"]=function(e){var t=ga["@:get"](e,"opacity");return""===t?"1":t};else{var $a=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,wa=/^(top|right|bottom|left)$/,Ca=/alpha\([^)]*\)/i,ka=!!e.XDomainRequest,Na="DXImageTransform.Microsoft.Alpha",Ta={thin:ka?"1px":"2px",medium:ka?"3px":"4px",thick:ka?"5px":"6px"};ga["@:get"]=function(e,t){var n=e.currentStyle,a=n[t];if($a.test(a)&&!wa.test(a)){var r=e.style,i=r.left,o=e.runtimeStyle.left;e.runtimeStyle.left=n.left,r.left="fontSize"===t?"1em":a||0,a=r.pixelLeft+"px",r.left=i,e.runtimeStyle.left=o}return"medium"===a&&(t=t.replace("Width","Style"),"none"===n[t]&&(a="0px")),""===a?"auto":Ta[a]||a},ga["opacity:set"]=function(e,t,n){var a=e.style,r=isFinite(n)&&1>=n?"alpha(opacity="+100*n+")":"",i=a.filter||"";a.zoom=1,a.filter=(Ca.test(i)?i.replace(Ca,r):i+" "+r).trim(),a.filter||a.removeAttribute("filter")},ga["opacity:get"]=function(e){var t=e.filters.alpha||e.filters[Na],n=t&&t.enabled?t.opacity:100;return n/100+""}}"top,left".replace(Kt,function(e){ga[e+":get"]=function(t){var n=ga["@:get"](t,e);return/px$/.test(n)?n:avalon(t).position()[e]+"px"}});var Ea={position:"absolute",visibility:"hidden",display:"block"},Aa=/^(none|table(?!-c[ea]).+)/;"Width,Height".replace(Kt,function(e){var t=e.toLowerCase(),n="client"+e,a="scroll"+e,r="offset"+e;ga[t+":get"]=function(t,n,a){var i=-4;"number"==typeof a&&(i=a),n="Width"===e?["Left","Right"]:["Top","Bottom"];var o=t[r];return 2===i?o+avalon.css(t,"margin"+n[0],!0)+avalon.css(t,"margin"+n[1],!0):(0>i&&(o=o-avalon.css(t,"border"+n[0]+"Width",!0)-avalon.css(t,"border"+n[1]+"Width",!0)),-4===i&&(o=o-avalon.css(t,"padding"+n[0],!0)-avalon.css(t,"padding"+n[1],!0)),o)},ga[t+"&get"]=function(e){var n=[];G(e,n);for(var a,r=ga[t+":get"](e),i=0;a=n[i++];){e=a.node;for(var o in a)"string"==typeof a[o]&&(e.style[o]=a[o])}return r},avalon.fn[t]=function(i){var o=this[0];if(0===arguments.length){if(o.setTimeout)return o["inner"+e]||o.document.documentElement[n]||o.document.body[n];if(9===o.nodeType){var l=o.documentElement;return Math.max(o.body[a],l[a],o.body[r],l[r],l[n])}return ga[t+"&get"](o)}return this.css(t,i)},avalon.fn["inner"+e]=function(){return ga[t+":get"](this[0],void 0,-2)},avalon.fn["outer"+e]=function(e){return ga[t+":get"](this[0],void 0,e===!0?2:0)}}),avalon.fn.offset=function(){var e=this[0],t={left:0,top:0};if(!e||!e.tagName||!e.ownerDocument)return t;var n=e.ownerDocument,a=n.body,r=n.documentElement,i=n.defaultView||n.parentWindow;if(!avalon.contains(r,e))return t;e.getBoundingClientRect&&(t=e.getBoundingClientRect());var o=r.clientTop||a.clientTop,l=r.clientLeft||a.clientLeft,s=Math.max(i.pageYOffset||0,r.scrollTop,a.scrollTop),c=Math.max(i.pageXOffset||0,r.scrollLeft,a.scrollLeft);return{top:t.top+s-o,left:t.left+c-l}};var _a=/^]+))?)*\s+value[\s=]/i,Oa={"option:get":vn?function(e){return _a.test(e.outerHTML)?e.value:e.text.trim()}:function(e){return e.value},"select:get":function(e,t){for(var n,a=e.options,r=e.selectedIndex,i=Oa["option:get"],o="select-one"===e.type||0>r,l=o?null:[],s=o?r+1:a.length,c=0>r?s:o?r:0;s>c;c++)if(n=a[c],(n.selected||c===r)&&!n.disabled){if(t=i(n),o)return t;l.push(t)}return l},"select:set":function(e,t,n){t=[].concat(t);for(var a,r=Oa["option:get"],i=0;a=e.options[i++];)(a.selected=t.indexOf(r(a))>-1)&&(n=!0);n||(e.selectedIndex=-1)}},Sa={},Ma=["break,case,catch,continue,debugger,default,delete,do,else,false","finally,for,function,if,in,instanceof,new,null,return,switch,this","throw,true,try,typeof,var,void,while,with","abstract,boolean,byte,char,class,const,double,enum,export,extends","final,float,goto,implements,import,int,interface,long,native","package,private,protected,public,short,static,super,synchronized","throws,transient,volatile","arguments,let,yield,undefined"].join(",");Ma.replace(/\w+/g,function(e){Sa[e]=!0});var ja=/[a-z_$]/i,La=/[\s\uFEFF\xA0]/,Da=/(\$proxy\$[a-z]+)\d+$/,Ha=new $n(218),Pa=new $n(128),Fa=/\)\s*$/,Ba=/\)\s*\|/g,Ra=/\|\s*([$\w]+)/g,qa=/"\s*\["/g,Va=/"\s*\(/g,Ia={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},za=e.JSON&&JSON.stringify||function(e){return'"'+e.replace(/[\\\"\x00-\x1f]/g,function(e){var t=Ia[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"'};avalon.scan=function(e,t){e=e||cn;var n=t?[].concat(t):[];ft(e,n)};var Wa=i("area,base,basefont,br,col,command,embed,hr,img,input,link,meta,param,source,track,wbr,noscript,script,style,textarea".toUpperCase()),Xa=function(e,t,n){var a=e.getAttribute(t);if(a)for(var r,i=0;r=n[i++];)if(r.hasOwnProperty(a)&&"function"==typeof r[a])return r[a]},Ya=vn&&e.MutationObserver?function(e){for(var t,n=e.firstChild;n;){var a=n.nextSibling;3===n.nodeType?t?(t.nodeValue+=n.nodeValue,e.removeChild(n)):t=n:t=null,n=a}}:0,Ga=/^\s*::/,Ua=/ms-(\w+)-?(.*)/,Ja=i("animationend,blur,change,input,click,dblclick,focus,keydown,keypress,keyup,mousedown,mouseenter,mouseleave,mousemove,mouseout,mouseover,mouseup,scan,scroll,submit"),Za=i("value,title,alt,checked,selected,disabled,readonly,enabled,href,src"),Ka=/^if|widget|repeat$/,Qa=/^each|with|html|include$/;if(!sn)var er=new $n(512),tr=/\s+([^=\s]+)(?:=("[^"]*"|'[^']*'|[^\s>]+))?/g,nr=/^['"]/,ar=/<\w+\b(?:(["'])[^"]*?(\1)|[^>])*>/i,rr=/&/g,ir=function(e){var t=e.outerHTML;if("8?e.bound("input",p):e.bound("propertychange",function(e){"value"===e.propertyName&&p()}),e.bound("dragend",function(){setTimeout(function(){p()},17)})):(e.bound("input",p),e.bound("compositionstart",o),e.bound("compositionend",l),e.bound("DOMAutoComplete",p));break;case"select":e.bound("change",function(){var t=avalon(s).val();if(t=Array.isArray(t)?t.map(function(t){return e.pipe(t,e,"get")}):e.pipe(t,e,"get"),t+""!==e.oldValue)try{e.setter(t),a.call(s,t)}catch(r){n(r)}})}"input"===e.xtype&&/^(text|password|hidden)/.test(s.type)&&(s.avalonSetter=p,kr(function(){if(cn.contains(s))e.oldValue!==s.value&&p();else if(!s.msRetain)return!1}));for(var v in avalon.vmodels){var h=avalon.vmodels[v];h.$fire("avalon-ms-duplex-init",e)}var m=e.pipe||(e.pipe=gt);m(null,e,"init")},update:function(e){var t,n=this.element,a=this;switch(this.xtype){case"input":case"change":t=this.pipe(e,this,"set"),t!==this.oldValue&&(n.value=this.oldValue=t);break;case"radio":t=a.isChecked?!!e:e+""===n.value,6===vn?setTimeout(function(){n.defaultChecked=t,n.checked=t},31):n.checked=t;break;case"checkbox":var r=[].concat(e);t=this.pipe(n.value,this,"get"),n.checked=r.indexOf(t)>-1;break;case"select":a._value=e,n.msHasEvent="selectDuplex",avalon.bind(n,"datasetchanged",function(e){if("selectDuplex"===e.bubble){var t=a._value,r=Array.isArray(t)?t.map(String):t+"";avalon(n).val(r),n.oldValue=r+"",a.changed.call(n,r)}})}"select"!==a.xtype&&a.changed.call(n,t)}})}vn&&avalon.bind(It,"selectionchange",function(){var e=It.activeElement;e&&"function"==typeof e.avalonSetter&&e.avalonSetter()}),avalon.duplexHooks={checked:{get:function(e,t){return!t.oldValue}},string:{get:function(e){return e},set:yt},"boolean":{get:function(e){return"true"===e},set:yt},number:{get:function(e,t){var n=parseFloat(e+"");if(-e===-n)return n;var a=/strong|medium|weak/.exec(t.element.getAttribute("data-duplex-number"))||["medium"];switch(a[0]){case"strong":return 0;case"medium":return""===e?"":0;case"weak":return e}},set:yt}};var wr,Cr=[];avalon.tick=function(e){1===Cr.push(e)&&(wr=setInterval(bt,60))};var kr=r;!new function(){function e(e){t[this.tagName].call(this,e),"function"==typeof this.avalonSetter&&this.oldValue!==e&&this.avalonSetter()}try{var t={},n=HTMLInputElement.prototype,a=HTMLTextAreaElement.prototype,r=HTMLInputElement.prototype;Object.getOwnPropertyNames(r),t.INPUT=Object.getOwnPropertyDescriptor(n,"value").set,Object.defineProperty(n,"value",{set:e}),t.TEXTAREA=Object.getOwnPropertyDescriptor(a,"value").set,Object.defineProperty(a,"value",{set:e})}catch(i){kr=avalon.tick}},avalon.directive("effect",{priority:5,init:function(e){var t,n,a=e.expr,r=a.replace(Hn,function(e){return e.replace(/./g,"0")}).indexOf(":");-1===r?(t=a,n=!0):(t=a.slice(0,r),n=a.slice(r+1)),t=Dn.test(a)?tt(t):za(t),e.expr="["+t+","+n+"]"},update:function(t){var n=t[0],a=this.element;if(a.getAttribute("data-effect-name")!==n){a.removeAttribute("data-effect-driver");var r=a.style,i=e.getComputedStyle?e.getComputedStyle(a):null,o=!1;if(i&&(Er||Ar)){var l=r[_r]||i[_r];l&&"0s"!==l&&(a.setAttribute("data-effect-driver","t"),o=!0),o||(l=r[Or]||i[Or],l&&"0s"!==l&&(a.setAttribute("data-effect-driver","a"),o=!0))}o||avalon.effects[n]&&(a.setAttribute("data-effect-driver","j"),o=!0),o&&a.setAttribute("data-effect-name",n)}}}),avalon.effects={},avalon.effect=function(e,t){avalon.effects[e]=t};var Nr,Tr,Er=!1,Ar=!1,_r=avalon.cssName("transition-duration"),Or=avalon.cssName("animation-duration");!new function(){var t,n={TransitionEvent:"transitionend",WebKitTransitionEvent:"webkitTransitionEnd",OTransitionEvent:"oTransitionEnd",otransitionEvent:"otransitionEnd"};for(var a in n){if(e[a]){t=n[a];break}try{{document.createEvent(a)}t=n[a];break}catch(r){}}"string"==typeof t&&(Er=!0,Nr=t),n={AnimationEvent:"animationend",WebKitAnimationEvent:"webkitAnimationEnd"};var i;for(a in n)if(e[a]){i=n[a];break}"string"==typeof i&&(Er=!0,Tr=i)};var Sr=[],Mr=new ur;Ct.prototype={contrustor:Ct,enterClass:function(){return kt(this,"enter")},leaveClass:function(){return kt(this,"leave")},actionFun:function(e,t,n){if(!document.hidden){var a=this,r=a.el,i="leave"===e;e=i?"leave":"enter";var o=i?"enter":"leave";Nt(a,"abort"+wt(o)),Nt(a,"before"+wt(e)),i||t(r);var l=function(o){r.removeEventListener(a.cssEvent,a.cssCallback),i?(t(r),avalon(r).removeClass(a.cssClass)):"a"===a.driver&&avalon(r).removeClass(a.cssClass),o!==!0&&(Nt(a,"after"+wt(e)),n&&n(r)),a.dispose()};a.useCss?(a.cssCallback&&a.cssCallback(!0),a.cssClass=kt(a,e),a.cssCallback=l,a.update=function(){r.addEventListener(a.cssEvent,a.cssCallback),i||"t"!==a.driver||avalon(r).removeClass(a.cssClass)},avalon(r).addClass(a.cssClass),Mr.render(!0),Mr.queue.push(a)):Nt(a,e,l)}},enter:function(){this.actionFun.apply(this,["enter"].concat(avalon.slice(arguments)))},leave:function(){this.actionFun.apply(this,["leave"].concat(avalon.slice(arguments)))},dispose:function(){this.update=this.cssCallback=null,Sr.unshift(this)>100&&Sr.pop()}};var jr=function(e,t){var n=ln.call(arguments,0);"function"!=typeof n[2]&&n.splice(2,0,r),"function"!=typeof n[3]&&n.splice(3,0,r);var a=n[2],i=n[3],o=n[4],l=xt(e,o);if(!l)return a(),i(),!1;var s=t?"enter":"leave";l[s](a,i)};avalon.mix(avalon.effect,{apply:jr,append:function(e,t,n,a){return jr(e,1,function(){t.appendChild(e)},n,a)},before:function(e,t,n,a){return jr(e,1,function(){t.parentNode.insertBefore(e,t)},n,a)},remove:function(e,t,n,a){return jr(e,0,function(){e.parentNode===t&&t.removeChild(e)},n,a)}}),avalon.directive("html",{update:function(e){var t=this,n=this.element,a=1!==n.nodeType,r=a?n.parentNode:n;if(r){if(e=null==e?"":e,3===n.nodeType){var i=pn("html");r.insertBefore(It.createComment(i),n),t.element=It.createComment(i+":end"),r.replaceChild(t.element,n),n=t.element}if("object"!=typeof e)var o=avalon.parseHTML(String(e));else if(11===e.nodeType)o=e;else if(1===e.nodeType||e.item){var l=1===e.nodeType?e.childNodes:e.item;for(o=un.cloneNode(!0);l[0];)o.appendChild(l[0])}if(l=avalon.slice(o.childNodes),a){for(var s=n.nodeValue.slice(0,-4);;){var c=n.previousSibling;if(!c||8===c.nodeType&&c.nodeValue===s)break;r.removeChild(c)}r.insertBefore(o,n)}else avalon.clearHTML(n).appendChild(o);ut(l,t.vmodels)}}}),avalon.directive("if",{priority:10,update:function(e){function t(){r.getAttribute(a.name)&&(r.removeAttribute(a.name),lt(r,a.vmodels)),a.rollback=null}var n,a=this,r=this.element,i=a.stamp=+new Date,o=function(){i===a.stamp&&(a.recoverNode=null)};a.recoverNode&&a.recoverNode();try{if(!r.parentNode)return;n=r.parentNode}catch(l){return}if(e){if(8===r.nodeType){var s=a.keep,c=avalon.effect.apply(s,1,function(){i===a.stamp&&(r.parentNode.replaceChild(s,r),r=a.element=s,s.getAttribute("_required")&&(r.required=!0,r.removeAttribute("_required")),r.querySelectorAll&&avalon.each(r.querySelectorAll("[_required=true]"),function(e){e.required=!0,e.removeAttribute("_required")}),t())},o);c=c===!1}c||t()}else if(1===r.nodeType){r.required===!0&&(r.required=!1,r.setAttribute("_required","true"));try{avalon.each(r.querySelectorAll(":required"),function(e){r.required=!1,e.setAttribute("_required","true")})}catch(l){}var u=a.element=It.createComment("ms-if"),f=r.nextSibling;a.recoverNode=function(){a.recoverNode=null,u.parentNode!==n&&(n.insertBefore(u,f),a.keep=r)},avalon.effect.apply(r,0,function(){a.recoverNode=null,i===a.stamp&&(r.parentNode.replaceChild(u,r),a.keep=r,Wt.appendChild(r),a.rollback=function(){r.parentNode===Wt&&Wt.removeChild(r)})},o)}}});var Lr=/(?:[\s\S]+?)<\/noscript>/gim,Dr=/([\s\S]+?)<\/noscript>/im,Hr=function(){return new(e.XMLHttpRequest||ActiveXObject)("Microsoft.XMLHTTP")},Pr=avalon.templateCache={};avalon.directive("include",{init:xn.attr.init,update:function(e){var t=this,n=this.element,a=t.vmodels,r=t.includeRendered,i=t.effectName&&t.effectClass,o=t.templateCache,l=t.includeReplace,s=t.includeLoaded,c=l?n.parentNode:n,u=t._element;t.recoverNodes=t.recoverNodes||avalon.noop;var f=(l&&u.cloneNode(),function(f){var d=t._stamp=+new Date;if(s){var p=s.apply(c,[f].concat(a));"string"==typeof p&&(f=p)}r&&at(c,function(){r.call(c)},0/0);var v=t.includeLastID||"_default";t.includeLastID=e;var h=o&&o[v]||It.createElement(n.tagName||t._element.tagName);i&&(h.className=i,c.insertBefore(h,t.start)),(o||{})[v]=h;var m=t.recoverNodes();for(m&&c.insertBefore(m,t.end);;){var y=t.start.nextSibling;if(!y||y===h||y===t.end)break;h.appendChild(y)}avalon.effect.remove(h,c,function(){o&&d===t._stamp&&Wt.appendChild(h)},t);var g=c,b=avalon.noop,x=avalon.noop,$=Tt(t,e,f),w=avalon.slice($.childNodes);l&&i?(g=u,g.innerHTML="",g.setAttribute("ms-skip","true"),c.insertBefore(g,t.end.nextSibling),b=function(){g.insertBefore($,null)},x=function(){t.recoverNodes=avalon.noop,d===t._stamp&&($=Et(w),c.insertBefore($,t.end),ut(w,a)),g.parentNode===c&&c.removeChild(g)},t.recoverNodes=function(){return t.recoverNodes=avalon.noop,Et(w)}):b=function(){c.insertBefore($,t.end),ut(w,a)},avalon.effect.apply(g,"enter",b,x)});if("src"===t.param)if("string"==typeof Pr[e])avalon.nextTick(function(){f(Pr[e])});else if(Array.isArray(Pr[e]))Pr[e].push(f);else{var d=Hr();d.onreadystatechange=function(){if(4===d.readyState){var t=d.status;if(t>=200&&300>t||304===t||1223===t){for(var n,a=d.responseText,r=0;n=Pr[e][r++];)n(a);Pr[e]=a}}},Pr[e]=[f],d.open("GET",e,!0),"withCredentials"in d&&(d.withCredentials=!0),d.setRequestHeader("X-Requested-With","XMLHttpRequest"),d.send(null)}else{var p=e&&1===e.nodeType?e:It.getElementById(e);if(p){if("NOSCRIPT"===p.tagName&&!p.innerHTML&&!p.fixIE78){d=Hr(),d.open("GET",location,!1),d.send(null); +for(var v=It.getElementsByTagName("noscript"),h=(d.responseText||"").match(Lr)||[],m=h.length,y=0;m>y;y++){var g=v[y];g&&(g.style.display="none",g.fixIE78=(h[y].match(Dr)||[""," "])[1])}}avalon.nextTick(function(){f(p.fixIE78||p.value||p.innerText||p.innerHTML)})}}}});var Fr=/\(([^)]*)\)/,Br=avalon.directive("on",{priority:3e3,init:function(e){var t=e.expr;e.type="on";var n=e.param.replace(/-\d+$/,"");if("function"==typeof Br[n+"Hook"]&&Br[n+"Hook"](e),t.indexOf("(")>0&&t.indexOf(")")>-1){var a=(t.match(Fr)||["",""])[1].trim();(""===a||"$event"===a)&&(t=t.replace(Fr,""))}e.expr=t},update:function(e){var t=this,n=this.element;e=function(e){var n=t.getter||r;return n.apply(this,t.args.concat(e))};var a=t.param.replace(/-\d+$/,"");if("scan"===a)e.call(n,{type:a});else if("function"==typeof t.specialBind)t.specialBind(n,e);else var i=avalon.bind(n,a,e);t.rollback=function(){"function"==typeof t.specialUnbind?t.specialUnbind():avalon.unbind(n,a,i)}}});avalon.directive("repeat",{priority:90,init:function(e){var t=e.type;e.cache={},e.enterCount=0;var n=e.element;if(1===n.nodeType){n.removeAttribute(e.name),$t(n,e),e.param=e.param||"el",e.sortedCallback=Xa(n,"data-with-sorted",e.vmodels);var a=Xa(n,"data-"+t+"-rendered",e.vmodels),r=pn(t),i=It.createComment(r+":start"),o=e.element=It.createComment(r+":end");if(e.signature=r,e.start=i,e.template=un.cloneNode(!1),"repeat"===t){var l=n.parentNode;l.replaceChild(o,n),l.insertBefore(i,o),e.template.appendChild(n)}else{for(;n.firstChild;)e.template.appendChild(n.firstChild);n.appendChild(i),n.appendChild(o),l=n}if(e.element=o,a)var s=avalon.bind(l,"datasetchanged",function(){a.apply(l,l.args),avalon.unbind(l,"datasetchanged",s),l.msRendered=a})}},update:function(e,t){var n=this,a=this.xtype;this.enterCount+=1;var r=!t;if(r){n.$outer={};var i="$key",o="$val";"array"===a&&(i="$first",o="$last");for(var l,s=0;l=n.vmodels[s++];)if(l.hasOwnProperty(i)&&l.hasOwnProperty(o)){n.$outer=l;break}}var c=this.track;if(n.sortedCallback){var u=n.sortedCallback.call(x,c);u&&Array.isArray(u)&&(c=u)}var f="move";n.$repeat=e;var d=[],p=r&&un.cloneNode(!1),v=[],m=this.param,y=avalon.mix({},this.cache),g=this.element,b=c.length,x=g.parentNode;for(s=0;b>s;s++){var $=c[s],w=y[$];if(w)d.push({}),y[$]=!0;else{w=Mt(this),"array"===a?(f="add",w.$id=$,w[m]=e[s]):(f="append",w.$key=$,w.$val=e[$]),this.cache[$]=w;var C=w.$anchor||(w.$anchor=g.cloneNode(!1));C.nodeValue=this.signature,St(n,p,w,d,r&&!n.effectDriver),Dt(w,n,a)}1===this.enterCount&&(w.$active=!1,w.$oldIndex=w.$index,w.$active=!0,w.$index=s),"array"===a?(w.$first=0===s,w.$last=s===b-1):w.$val=_(e[$]),v.push(w)}if(this.proxies=v,r&&!n.effectDriver)x.insertBefore(p,g),d.forEach(function(e){ut(e.nodes||[],e.vmodels),e.nodes=e.vmodels=null});else{var k=n.staggerIndex=0;for($ in y)y[$]!==!0&&(f="del",Ot(y[$].$anchor,n),Ft(this.cache,$,m),y[$]=null);for(s=0;b>s;s++){w=v[s],$="array"===a?w.$id:w.$key;var N=v[s-1],T=N?N.$anchor:n.start;y[$]?w.$index!==w.$oldIndex&&!function(e,t){k=_t(n.effectEnterStagger,function(){var a=Ot(e.$anchor),r=avalon.slice(a.childNodes);x.insertBefore(a,t.nextSibling),At(r,1,n)},k)}(w,T):!function(e,t){var a=e.nodes,r=e.vmodels;a&&(k=_t(n.effectEnterStagger,function(){x.insertBefore(e.content,t.nextSibling),ut(a,r),At(a,1,n)},k)),e.nodes=e.vmodels=null}(d[s],T)}}if(!e.$track)for($ in this.cache)Ft(this.cache,$,m);!function(e){x.args=e,x.msRendered&&x.msRendered.apply(x,e)}(h.newWatch?arguments:[f]);var E=setTimeout(function(){clearTimeout(E),avalon.fireDom(x,"datasetchanged",{bubble:x.msHasEvent})});this.enterCount-=1}}),"with,each".replace(Kt,function(e){xn[e]=avalon.mix({},xn.repeat,{priority:1400})});var Rr=[],qr=[];avalon.directive("text",{update:function(e){var t=this.element;if(e=null==e?"":e,3===t.nodeType)try{t.data=e}catch(n){}else"textContent"in t?t.textContent=e:t.innerText=e}}),avalon.parseDisplay=Bt,avalon.directive("visible",{init:function(){},update:function(e){var t=this.element,n=this,a=n.stamp=+new Date;e?(t.style.display="none",avalon.effect.apply(t,1,function(){if(a===n.stamp){var e=t.getAttribute("data-effect-driver")||"a";/^[atn]/.test(e)&&(this.effectName||(t.style.display=""),"none"===avalon(t).css("display")&&(t.style.display=Bt(t.nodeName)))}})):avalon.effect.apply(t,0,function(){a===n.stamp&&(t.style.display="none")})}});var Vr=/]*>([\S\s]*?)<\/script\s*>/gim,Ir=/\s+(on[^=\s]+)(?:=("[^"]*"|'[^']*'|[^\s>]+))?/g,zr=/<\w+\b(?:(["'])[^"]*?(\1)|[^>])*>/gi,Wr={a:/\b(href)\=("javascript[^"]*"|'javascript[^']*')/gi,img:/\b(src)\=("javascript[^"]*"|'javascript[^']*')/gi,form:/\b(action)\=("javascript[^"]*"|'javascript[^']*')/gi},Xr=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Yr=/([^\#-~| |!])/g,Gr=avalon.filters={uppercase:function(e){return e.toUpperCase()},lowercase:function(e){return e.toLowerCase()},truncate:function(e,t,n){return t=t||30,n="string"==typeof n?n:"...",e.length>t?e.slice(0,t-n.length)+n:String(e)},$filter:function(e){for(var t=1,n=arguments.length;n>t;t++){var a=arguments[t],r=avalon.filters[a[0]];if("function"==typeof r){var i=[e].concat(a.slice(1));e=r.apply(null,i)}}return e},camelize:z,sanitize:function(e){return e.replace(Vr,"").replace(zr,function(e){var t=e.toLowerCase().match(/<(\w+)\s/);if(t){var n=Wr[t[1]];n&&(e=e.replace(n,function(e,t,n){var a=n.charAt(0);return t+"="+a+"javascript:void(0)"+a}))}return e.replace(Ir," ").replace(/\s+/g," ")})},escape:function(e){return String(e).replace(/&/g,"&").replace(Xr,function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1);return"&#"+(1024*(t-55296)+(n-56320)+65536)+";"}).replace(Yr,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")},currency:function(e,t,n){return(t||"¥")+Rt(e,isFinite(n)?n:2)},number:Rt};!new function(){function e(e){return parseInt(e,10)||0}function t(e,t,n){var a="";for(0>e&&(a="-",e=-e),e=""+e;e.length0||o>-a)&&(o+=a),0===o&&-12===a&&(o=12),t(o,n,r)}}function a(e,t){return function(n,a){var r=n["get"+e](),i=(t?"SHORT"+e:e).toUpperCase();return a[i][r]}}function r(e){var n=-1*e.getTimezoneOffset(),a=n>=0?"+":"";return a+=t(Math[n>0?"floor":"ceil"](n/60),2)+t(Math.abs(n%60),2)}function i(e,t){return e.getHours()<12?t.AMPMS[0]:t.AMPMS[1]}var o={yyyy:n("FullYear",4),yy:n("FullYear",2,0,!0),y:n("FullYear",1),MMMM:a("Month"),MMM:a("Month",!0),MM:n("Month",2,1),M:n("Month",1,1),dd:n("Date",2),d:n("Date",1),HH:n("Hours",2),H:n("Hours",1),hh:n("Hours",2,-12),h:n("Hours",1,-12),mm:n("Minutes",2),m:n("Minutes",1),ss:n("Seconds",2),s:n("Seconds",1),sss:n("Milliseconds",3),EEEE:a("Day"),EEE:a("Day",!0),a:i,Z:r},l=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,s=/^\/Date\((\d+)\)\/$/;Gr.date=function(t,n){var a,r,i=Gr.date.locate,c="",u=[];if(n=n||"mediumDate",n=i[n]||n,"string"==typeof t)if(/^\d+$/.test(t))t=e(t);else if(s.test(t))t=+RegExp.$1;else{var f=t.trim(),d=[0,0,0,0,0,0,0],p=new Date(0);f=f.replace(/^(\d+)\D(\d+)\D(\d+)/,function(t,n,a,r){var i=4===r.length?[r,n,a]:[n,a,r];return d[0]=e(i[0]),d[1]=e(i[1])-1,d[2]=e(i[2]),""});var v=p.setFullYear,h=p.setHours;f=f.replace(/[T\s](\d+):(\d+):?(\d+)?\.?(\d)?/,function(t,n,a,r,i){return d[3]=e(n),d[4]=e(a),d[5]=e(r),i&&(d[6]=Math.round(1e3*parseFloat("0."+i))),""});var m=0,y=0;f=f.replace(/Z|([+-])(\d\d):?(\d\d)/,function(t,n,a,r){return v=p.setUTCFullYear,h=p.setUTCHours,n&&(m=e(n+a),y=e(n+r)),""}),d[3]-=m,d[4]-=y,v.apply(p,d.slice(0,3)),h.apply(p,d.slice(3)),t=p}if("number"==typeof t&&(t=new Date(t)),"date"===avalon.type(t)){for(;n;)r=l.exec(n),r?(u=u.concat(r.slice(1)),n=u.pop()):(u.push(n),n=null);return u.forEach(function(e){a=o[e],c+=a?a(t,i):e.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),c}};var c={AMPMS:{0:"上午",1:"下午"},DAY:{0:"星期日",1:"星期一",2:"星期二",3:"星期三",4:"星期四",5:"星期五",6:"星期六"},MONTH:{0:"1月",1:"2月",2:"3月",3:"4月",4:"5月",5:"6月",6:"7月",7:"8月",8:"9月",9:"10月",10:"11月",11:"12月"},SHORTDAY:{0:"周日",1:"周一",2:"周二",3:"周三",4:"周四",5:"周五",6:"周六"},fullDate:"y年M月d日EEEE",longDate:"y年M月d日",medium:"yyyy-M-d H:mm:ss",mediumDate:"yyyy-M-d",mediumTime:"H:mm:ss","short":"yy-M-d ah:mm",shortDate:"yy-M-d",shortTime:"ah:mm"};c.SHORTMONTH=c.MONTH,Gr.date.locate=c};var Ur,Jr=[],Zr=function(e){for(Ur=!0,Xt&&(modules["domReady!"].state=4,Xt.checkDeps());e=Jr.shift();)e(avalon)};if("complete"===It.readyState)setTimeout(Zr);else if(sn)It.addEventListener("DOMContentLoaded",Zr);else{It.attachEvent("onreadystatechange",function(){"complete"===It.readyState&&Zr()});try{var Kr=null===e.frameElement}catch(Wn){}cn.doScroll&&Kr&&e.external&&qt()}avalon.bind(e,"load",Zr),avalon.ready=function(e){Ur?e(avalon):Jr.push(e)},avalon.config({loader:!0}),avalon.ready(function(){avalon.scan(It.body)}),"function"==typeof define&&define.amd&&define("avalon",[],function(){return avalon});var Qr=e.avalon;return avalon.noConflict=function(t){return t&&e.avalon===avalon&&(e.avalon=Qr),avalon},void 0===t&&(e.avalon=avalon),avalon}); \ No newline at end of file