avalon-rails 1.3.9.1 → 1.3.9.1.20150212184918

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,122 +1,3 @@
1
- (function(t,W){"object"===typeof module&&"object"===typeof module.exports?module.exports=t.document?W(t,!0):function(t){if(!t.document)throw Error("Avalon requires a window with a document");return W(t)}:W(t)})("undefined"!==typeof window?window:this,function(t,W){function y(){avalon.config.debug&&console.log.apply(console,arguments)}function z(){}function P(b,c){"string"===typeof b&&(b=b.match(w)||[]);for(var d={},e=void 0!==c?c:1,f=0,g=b.length;f<g;f++)d[b[f]]=e;return d}function Na(b){function c(e,
2
- f){d.push(e)>b&&delete c[d.shift()];return c[e]=f}var d=[];return c}function s(b){for(var c in b)if(Oa.call(b,c)){var d=b[c];if("function"===typeof s.plugins[c])s.plugins[c](d);else"object"===typeof s[c]?avalon.mix(s[c],d):s[c]=d}return this}function Bb(b,c,d){if(Q(c)||c&&c.nodeType||-1!==d.indexOf(b)||-1!==Pa.indexOf(b))return!1;c=d.$special;return b&&"$"===b.charAt(0)&&!c[b]?!1:!0}function Cb(b,c,d,e){switch(b.type){case 0:var f=b.get;b=b.set;if(Q(b)){var g=e.$events,h=g[c];g[c]=[];b.call(e,d);
3
- g[c]=h}return f.call(e);case 1:return d;case 2:return d!==e.$model[c]&&(c=b.svmodel=Db(e,c,d,b.valueType),d=c.$model,(c=pa[c.$id])&&c()),d}}function I(b,c,d){if(Array.isArray(b)){var e=b.concat();b.length=0;c=Eb(b);c.pushArray(e);return c}if("number"===typeof b.nodeType||b.$id&&b.$events)return b;Array.isArray(b.$skipArray)||(b.$skipArray=[]);b.$skipArray.$special=c||{};var f={};d=d||{};var g={},h={},k=[];for(e in b)(function(c,e){d[c]=e;if(Bb(c,e,b.$skipArray)){g[c]=[];var l=avalon.type(e),q=function(b){var c=
4
- q._name,d=this,e=d.$model,f=e[c],g=d.$events;if(arguments.length){if(!qa){if(1!==q.type&&(b=Cb(q,c,b,d),!q.type))return;Qa(f,b)||(e[c]=b,g.$digest?q.pedding||(q.pedding=!0,setTimeout(function(){fa(g[c]);d.$events&&A.$fire.call(d,c,e[c],f);q.pedding=!1})):(fa(g[c]),d.$events&&A.$fire.call(d,c,b,f)))}}else{if(0===q.type)return b=q.get.call(d),f!==b&&(e[c]=b,g.$digest?q.pedding||(q.pedding=!0,setTimeout(function(){d.$events&&A.$fire.call(d,c,e[c],f);q.pedding=!1})):d.$events&&A.$fire.call(d,c,b,f)),
5
- b;Fb(g[c]);return q.svmodel||f}};"object"===l&&Q(e.get)&&2>=Object.keys(e).length?(q.set=e.set,q.get=e.get,q.type=0,k.push(function(){var b={evaluator:function(){b.type=new Date-0;b.element=null;d[c]=q.get.call(f)},element:F,type:new Date-0,handler:z,args:[]};Y[G]=b;q.call(f);delete Y[G]})):Ra.test(l)?(q.type=2,q.valueType=l,k.push(function(){var b=I(e,0,d[c]);q.svmodel=b;b.$events[J]=g[c]})):q.type=1;q._name=c;h[c]=q}})(e,b[e]);Pa.forEach(function(c){delete b[c];delete d[c]});var f=Gb(f,Hb(h),b),
6
- l;for(l in b)h[l]||(f[l]=b[l]);f.$id=K();f.$model=d;f.$events=g;for(e in A)c=A[e],R||(c=c.bind(f)),f[e]=c;Sa?Object.defineProperty(f,"hasOwnProperty",{value:function(b){return b in this.$model},writable:!1,enumerable:!1,configurable:!0}):f.hasOwnProperty=function(b){return b in f.$model};k.forEach(function(b){b()});return f}function Db(b,c,d,e){var f=b[c];if("array"===e){if(!Array.isArray(d)||f===d)return f;f._.$unwatch();f.clear();f._.$watch();f.pushArray(d.concat());return f}var g=b.$events[c];
7
- if(b=f.$events.$withProxyPool)ra(b,"with"),f.$events.$withProxyPool=null;var h=I(d);h.$events[J]=g;pa[h.$id]=function(b){for(;b=g.shift();)(function(b){avalon.nextTick(function(){b.type&&(b.rollback&&b.rollback(),u[b.type](b,b.vmodels))})})(b);delete pa[h.$id]};return h}function Eb(b){var c=[];c.$id=K();c.$model=b;c.$events={};c.$events[J]=[];c._=I({length:b.length});c._.$watch("length",function(b,d){c.$fire("length",b,d)});for(var d in A)c[d]=A[d];avalon.mix(c,Ta);return c}function T(b,c,d,e,f,g,
8
- h){for(var k=this.length,l=2;--l;){switch(b){case "add":var m=this.$model.slice(c,c+d).map(function(b){return Ra.test(avalon.type(b))?b.$id?b:I(b,0,b):b});sa.apply(this,[c,0].concat(m));this._fire("add",c,d);break;case "del":var n=this._splice(c,d);this._fire("del",c,d)}f&&(b=f,c=g,d=h,l=2,f=0)}this._fire("index",e);this.length!==k&&(this._.length=this.length);return n}function ta(b,c){for(var d={},e=0,f=c.length;e<f;e++){d[e]=b[e];var g=c[e];g in d?(b[e]=d[g],delete d[g]):b[e]=b[g]}}function ua(b){Y[G]=
9
- b;avalon.openComputedCollect=!0;var c=b.evaluator;if(c)try{var d=Ib.test(b.type)?b:c.apply(0,b.args);b.handler(d,b.element,b)}catch(e){delete b.evaluator,c=b.element,3===c.nodeType&&(d=c.parentNode,s.commentInterpolate?d.replaceChild(p.createComment(b.value),c):c.data=L+b.value+M)}avalon.openComputedCollect=!1;delete Y[G]}function Fb(b){var c=Y[G];b&&(c&&avalon.Array.ensure(b,c)&&c.element)&&va(c,b)}function va(b,c){b.$uuid=b.$uuid||K();c.$uuid=c.$uuid||K();var d={data:b,list:c,$$uuid:b.$uuid+c.$uuid};
10
- N[d.$$uuid]||(N[d.$$uuid]=1,N.push(d))}function Ua(b){b.element=null;b.rollback&&b.rollback();for(var c in b)b[c]=null}function Jb(b){try{if(!b.parentNode)return!0}catch(c){return!0}return b.msRetain?0:1===b.nodeType?"number"===typeof b.sourceIndex?0===b.sourceIndex:!B.contains(b):!avalon.contains(B,b)}function Va(){for(var b=N.length,c=b,d=0,e,f=[],g={},h={};e=N[--b];){var k=e.data;e=k.type;g[e]?g[e]++:(g[e]=1,f.push(e))}var l=!1;f.forEach(function(b){Wa[b]!==g[b]&&(h[b]=1,l=!0)});b=c;if(l)for(;e=
11
- N[--b];)k=e.data,void 0!==k.element&&(h[k.type]&&Jb(k.element))&&(d++,N.splice(b,1),delete N[e.$$uuid],avalon.Array.remove(e.list,k),Ua(k),e.data=e.list=null);Wa=g;Xa=new Date}function fa(b){if(b&&b.length){444<new Date-Xa&&"object"===typeof b[0]&&Va();for(var c=ga.call(arguments,1),d=b.length,e;e=b[--d];){var f=e.element;f&&f.parentNode&&(e.$repeat?e.handler.apply(e,c):"on"!==e.type&&e.handler((e.evaluator||z).apply(0,e.args||[]),f,e))}}}function ha(b,c,d){var e=setTimeout(function(){var f=b.innerHTML;
12
- clearTimeout(e);f===d?c():ha(b,c,f)})}function Ya(b,c){var d=b.getAttribute("avalonctrl")||c.$id;b.setAttribute("avalonctrl",d);c.$events.expr=b.tagName+'[avalonctrl="'+d+'"]'}function wa(b,c){for(var d=0,e;e=b[d++];)e.vmodels=c,u[e.type](e,c),e.evaluator&&(e.element&&1===e.element.nodeType)&&e.element.removeAttribute(e.name);b.length=0}function Kb(b,c){return b.priority-c.priority}function Za(b,c,d){d=b.getAttribute("ms-skip");var e=b.getAttributeNode("ms-important"),f=b.getAttributeNode("ms-controller");
13
- if("string"!==typeof d){if(d=e||f){f=avalon.vmodels[d.value];if(!f)return;c=d===e?[f]:[f].concat(c);b.removeAttribute(d.name);b.classList.remove(d.name);Ya(b,f)}$a(b,c)}}function Lb(b,c){for(var d=b.firstChild;d;){var e=d.nextSibling;ab(d,d.nodeType,c);d=e}}function ia(b,c){for(var d=0,e;e=b[d++];)ab(e,e.nodeType,c)}function ab(b,c,d){1===c?Za(b,d):3===c&&Z.test(b.data)?bb(b,d):s.commentInterpolate&&(8===c&&!Z.test(b.nodeValue))&&bb(b,d)}function $a(b,c){for(var d=b.hasAttributes()?avalon.slice(b.attributes):
14
- [],e=[],f={},g,h=0,k;k=d[h++];)if(k.specified&&(g=k.name.match(Mb))){var l=g[1],m=g[2]||"",n=k.value;k=k.name;f[k]=n;Nb[l]?(m=l,l="on"):Ob[l]&&(y("ms-"+l+"\u5df2\u7ecf\u88ab\u5e9f\u5f03,\u8bf7\u4f7f\u7528ms-attr-*\u4ee3\u66ff"),"enabled"===l&&(l="disabled",n="!("+n+")"),m=l,l="attr",b.removeAttribute(k),k="ms-attr-"+m,b.setAttribute(k,n),g=[k],f[k]=n);if("function"===typeof u[l]){var r={type:l,param:m,element:b,name:g[0],value:n,priority:l in cb?cb[l]:10*l.charCodeAt(0)+(Number(m)||0)};if("html"===
15
- l||"text"===l)m=xa(n),avalon.mix(r,m),r.filters=r.filters.replace(db,function(){r.type="html";r.group=1;return""});"ms-if-loop"===k&&(r.priority+=100);c.length&&(e.push(r),"widget"===l&&(b.msData=b.msData||f))}}f["ms-attr-checked"]&&f["ms-duplex"]&&y("warning!\u4e00\u4e2a\u5143\u7d20\u4e0a\u4e0d\u80fd\u540c\u65f6\u5b9a\u4e49ms-attr-checked\u4e0ems-duplex");e.sort(Kb);d=!0;for(h=0;r=e[h];h++){l=r.type;if(Pb.test(l))return wa(e.slice(0,h+1),c);d&&(d=!Qb.test(l))}wa(e,c);d&&(!Rb[b.tagName]&&eb.test(b.innerHTML+
16
- b.textContent))&&(fb&&fb(b),Lb(b,c))}function xa(b){if(0<b.indexOf("|")){var c=b.replace(Sb,"\u1122\u3344").indexOf("|");if(-1<c)return{filters:b.slice(c),value:b.slice(0,c),expr:!0}}return{value:b,filters:"",expr:!0}}function ya(b){var c=[],d;d=0;var e;do{e=b.indexOf(L,d);if(-1===e)break;(d=b.slice(d,e))&&c.push({value:d,filters:"",expr:!1});d=e+L.length;e=b.indexOf(M,d);if(-1===e)break;(d=b.slice(d,e))&&c.push(xa(d));d=e+M.length}while(1);(d=b.slice(d))&&c.push({value:d,expr:!1,filters:""});return c}
17
- function bb(b,c){var d=[];if(8===b.nodeType)var e=xa(b.nodeValue),f=[e];else f=ya(b.data);if(f.length){for(var g=0;e=f[g++];){var h=p.createTextNode(e.value);e.expr&&(e.type="text",e.element=h,e.filters=e.filters.replace(db,function(){e.type="html";e.group=1;return""}),d.push(e));U.appendChild(h)}b.parentNode.replaceChild(U,b);d.length&&wa(d,c)}}function gb(b){return b.replace(/([a-z\d])([A-Z]+)/g,"$1-$2").toLowerCase()}function ja(b){return 0>b.indexOf("-")&&0>b.indexOf("_")?b:b.replace(/[-_][^-_]/g,
18
- function(b){return b.charAt(1).toUpperCase()})}function ka(b){try{if("object"===typeof b)return b;b="true"===b?!0:"false"===b?!1:"null"===b?null:+b+""===b?+b:Tb.test(b)?JSON.parse(b):b}catch(c){}return b}function hb(b,c){if(0>=b.offsetWidth){var d=getComputedStyle(b,null);if(Ub.test(d.display)){var e={node:b},f;for(f in ib)e[f]=d[f],b.style[f]=ib[f];c.push(e)}(d=b.parentNode)&&1===d.nodeType&&hb(d,c)}}function Vb(b,c,d,e){for(var f=[],g=" = "+d+".",h=b.length,k;k=b[--h];)c.hasOwnProperty(k)&&(f.push(k+
19
- g+k),e.vars.push(k),"duplex"===e.type&&(b.get=d+"."+k),b.splice(h,1));return f}function jb(b){for(var c=[],d={},e=0;e<b.length;e++){var f=b[e],g=f&&"string"===typeof f.$id?f.$id:f;d[g]||(d[g]=c.push(f))}return c}function Wb(b,c){c=c.replace(Xb,"").replace(Yb,function(){return"],|"}).replace(Zb,function(b,c){return"["+kb(c)}).replace($b,function(){return'"],["'}).replace(ac,function(){return'",'})+"]";return"return avalon.filters.$filter("+b+", "+c+")"}function lb(b,c,d){var e=d.type,f=d.filters||
20
- "",g=c.map(function(b){return String(b.$id).replace(bc,"$1")})+b+e+f,h=cc(b).concat(),k=[],l=[],m=[],n="";c=jb(c);d.vars=[];for(var n=0,r=c.length;n<r;n++)if(h.length){var q="vm"+G+"_"+n;l.push(q);m.push(c[n]);k.push.apply(k,Vb(h,c[n],q,d))}if(k.length||"duplex"!==e)if("duplex"!==e&&(-1<b.indexOf("||")||-1<b.indexOf("&&"))&&d.vars.forEach(function(c){b=b.replace(RegExp("\\b"+c+"(?:\\.\\w+|\\[\\w+\\])+","ig"),function(d,e){var f=d.charAt(c.length),g=za?b.slice(e+d.length):RegExp.rightContext,g=/^\s*\(/.test(g);
21
- if("."===f||"["===f||g){f="var"+String(Math.random()).replace(/^0\./,"");if(g){g=d.split(".");if(2<g.length){var h=g.pop();k.push(f+" = "+g.join("."));return f+"."+h}return d}k.push(f+" = "+d);return f}return d})}),d.args=m,c=Aa[g])d.evaluator=c;else{(n=k.join(", "))&&(n="var "+n);if(/\S/.test(f)){if(!/text|html/.test(d.type))throw Error("ms-"+d.type+"\u4e0d\u652f\u6301\u8fc7\u6ee4\u5668");b="\nvar ret"+G+" = "+b+";\r\n";b+=Wb("ret"+G,f)}else{if("duplex"===e){e="'use strict';\nreturn function(vvv){\n\t"+
22
- n+";\n\tif(!arguments.length){\n\t\treturn "+b+"\n\t}\n\t"+(!dc.test(b)?h.get:b)+"= vvv;\n} ";try{c=Function.apply(z,l.concat(e)),d.evaluator=Aa(g,c)}catch(D){y("debug: parse error,"+D.message)}return}"on"===e?(b=-1===b.indexOf("(")?b+".call(this, $event)":b.replace("(",".call(this,"),l.push("$event"),b="\nreturn "+b+";",f=b.lastIndexOf("\nreturn"),e=b.slice(0,f),f=b.slice(f),b=e+"\n"+f):b="\nreturn "+b+";"}try{c=Function.apply(z,l.concat("'use strict';\n"+n+b)),d.evaluator=Aa(g,c)}catch(X){y("debug: parse error,"+
23
- X.message)}finally{h=textBuffer=l=null}}}function H(b,c,d,e,f){Array.isArray(e)&&(b=e.map(function(b){return b.expr?"("+b.value+")":kb(b.value)}).join(" + "));lb(b,c,d);d.evaluator&&!f&&(d.handler=E[d.handlerName||d.type],ua(d))}function $(b,c){var d="_"+b;if(!$[d]){var e=p.createElement(b);B.appendChild(e);c=R?getComputedStyle(e,null).display:e.currentStyle.display;B.removeChild(e);$[d]=c}return $[d]}function Ba(b){return null==b?"":b}function ec(b,c,d,e){c.param.replace(/\w+/g,function(e){(e=avalon.duplexHooks[e])&&
24
- "function"===typeof e[d]&&(b=e[d](b,c))});return b}function S(b,c,d){var e=p.createEvent("Events");e.initEvent(c,!0,!0);e.fireByAvalon=!0;d&&(e.detail=d);b.dispatchEvent(e)}function fc(){for(var b=aa.length-1;0<=b;b--)!1===(0,aa[b])()&&aa.splice(b,1);aa.length||clearInterval(mb)}function nb(b,c,d,e){var f=b.template.cloneNode(!0),g=avalon.slice(f.childNodes);d.$stamp&&f.insertBefore(d.$stamp,f.firstChild);c.appendChild(f);b=[d].concat(b.vmodels);e.push({nodes:g,vmodels:b})}function ob(b,c){var d=
25
- b.proxies[c];return d?d.$stamp:b.element}function Ca(b,c,d){for(;;){var e=c.previousSibling;if(!e)break;e.parentNode.removeChild(e);d&&d.call(e);if(e===b)break}}function gc(b){var c={$host:[],$outer:{},$stamp:1,$index:0,$first:!1,$last:!1,$remove:avalon.noop};c[b]={get:function(){return this.$host[this.$index]},set:function(b){this.$host.set(this.$index,b)}};var c=I(c,{$last:1,$first:1,$index:1}),d=c.$events;d[b]=d.$first=d.$last=d.$index;c.$id=K("$proxy$each");return c}function hc(b,c){for(var d=
26
- c.param||"el",e,f=0,g=la.length;f<g;f++){var h=la[f];h&&h.hasOwnProperty(d)&&(e=h,la.splice(f,1))}e||(e=gc(d));var k=c.$repeat,d=k.length-1;e.$index=b;e.$first=0===b;e.$last=b===d;e.$host=k;e.$outer=c.$outer;e.$stamp=c.clone.cloneNode(!1);e.$remove=function(){return k.removeAt(e.$index)};return e}function ic(){var b=I({$key:"",$outer:{},$host:{},$val:{get:function(){return this.$host[this.$key]},set:function(b){this.$host[this.$key]=b}}},{$val:1});b.$id=K("$proxy$with");return b}function jc(b,c){var d=
27
- pb.pop();d||(d=ic());var e=c.$repeat;d.$key=b;d.$host=e;d.$outer=c.$outer;e.$events?d.$events.$val=e.$events[b]:d.$events={};return d}function ra(b,c){var d="each"===c?la:pb;avalon.each(b,function(b,c){if(c.$events){for(var g in c.$events)Array.isArray(c.$events[g])&&(c.$events[g].forEach(function(b){"object"===typeof b&&Ua(b)}),c.$events[g].length=0);c.$host=c.$outer={};d.unshift(c)>s.maxRepeatSize&&d.pop()}});"each"===c&&(b.length=0)}function qb(b,c,d,e){b=(b+"").replace(/[^0-9+\-Ee.]/g,"");b=!isFinite(+b)?
28
- 0:+b;c=!isFinite(+c)?0:Math.abs(c);e="undefined"===typeof e?",":e;d="undefined"===typeof d?".":d;var f="",f=function(b,c){var d=Math.pow(10,c);return""+(Math.round(b*d)/d).toFixed(c)},f=(c?f(b,c):""+Math.round(b)).split(".");3<f[0].length&&(f[0]=f[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,e));if((f[1]||"").length<c)f[1]=f[1]||"",f[1]+=Array(c-f[1].length+1).join("0");return f.join(d)}function ba(){C?(v["ready!"].state=2,C.checkDeps()):rb.forEach(function(b){b(avalon)});ba=z}var G=Date.now(),p=t.document,
29
- F=p.head;F.insertAdjacentHTML("afterBegin",'<avalon ms-skip><style id="avalonStyle">.avalonHide{ display: none!important }</style></avalon>');var Da=F.firstChild,J="$"+G,kc=t.require,lc=t.define,qa=!1,w=/[^, ]+/g,Ra=/^(?:object|array)$/,sb=/^\[object SVG\w*Element\]$/,mc=/^\[object (?:Window|DOMWindow|global)\]$/,Ea=Object.prototype,Oa=Ea.hasOwnProperty,ca=Ea.toString,O=Array.prototype,ga=O.slice,Y={},R=t.dispatchEvent,B=p.documentElement,U=p.createDocumentFragment(),ma=p.createElement("div"),tb=
30
- {};"Boolean Number String Function Array Date RegExp Object Error".replace(w,function(b){tb["[object "+b+"]"]=b.toLowerCase()});var K=function(b){return((b||"avalon")+Math.random()+Math.random()).replace(/0\./g,"")},za=function(){if(t.VBArray){var b=document.documentMode;return b?b:t.XMLHttpRequest?7:6}return 0}();avalon=function(b){return new avalon.init(b)};avalon.init=function(b){this[0]=this.element=b};avalon.fn=avalon.prototype=avalon.init.prototype;avalon.type=function(b){return null==b?String(b):
31
- "object"===typeof b||"function"===typeof b?tb[ca.call(b)]||"object":typeof b};var Q=function(b){return"[object Function]"==ca.call(b)};avalon.isFunction=Q;avalon.isWindow=function(b){return mc.test(ca.call(b))};avalon.isPlainObject=function(b){return"[object Object]"===ca.call(b)&&Object.getPrototypeOf(b)===Ea};avalon.mix=avalon.fn.mix=function(){var b,c,d,e,f,g=arguments[0]||{},h=1,k=arguments.length,l=!1;"boolean"===typeof g&&(l=g,g=arguments[1]||{},h++);"object"!==typeof g&&!Q(g)&&(g={});h===k&&
32
- (g=this,h--);for(;h<k;h++)if(null!=(b=arguments[h]))for(c in b)d=g[c],e=b[c],g!==e&&(l&&e&&(avalon.isPlainObject(e)||(f=Array.isArray(e)))?(f?(f=!1,d=d&&Array.isArray(d)?d:[]):d=d&&avalon.isPlainObject(d)?d:{},g[c]=avalon.mix(l,d,e)):void 0!==e&&(g[c]=e));return g};avalon.mix({rword:w,subscribers:J,version:1.391,ui:{},log:y,slice:function(b,c,d){return ga.call(b,c,d)},noop:z,error:function(b,c){throw new (c||Error)(b);},oneObject:P,range:function(b,c,d){d||(d=1);null==c&&(c=b||0,b=0);var e=-1;c=Math.max(0,
33
- Math.ceil((c-b)/d));for(var f=Array(c);++e<c;)f[e]=b,b+=d;return f},eventHooks:{},bind:function(b,c,d,e){var f=avalon.eventHooks[c];"object"===typeof f&&(c=f.type,f.deel&&(d=f.deel(b,d)));b.addEventListener(c,d,!!e);return d},unbind:function(b,c,d,e){var f=avalon.eventHooks[c];d=d||z;"object"===typeof f&&(c=f.type);b.removeEventListener(c,d,!!e)},css:function(b,c,d){b instanceof avalon&&(b=b[0]);var e=/[_-]/.test(c)?ja(c):c;c=avalon.cssName(e)||e;if(void 0===d||"boolean"===typeof d)return e=x[e+":get"]||
34
- x["@:get"],"background"===c&&(c="backgroundColor"),b=e(b,c),!0===d?parseFloat(b)||0:b;""===d?b.style[c]="":null==d||d!==d||(isFinite(d)&&!avalon.cssNumber[e]&&(d+="px"),e=x[e+":set"]||x["@:set"],e(b,c,d))},each:function(b,c){if(b){var d=0,e;a:{if(b&&"object"===typeof b){e=b.length;var f=ca.call(b);if(/(Array|List|Collection|Map|Arguments)\]$/.test(f)){e=!0;break a}else if("[object Object]"===f&&e===e>>>0){e=!0;break a}}e=!1}if(e)for(e=b.length;d<e&&!1!==c(d,b[d]);d++);else for(d in b)if(b.hasOwnProperty(d)&&
35
- c(d,!1===b[d]))break}},getWidgetData:function(b,c){var d=avalon(b).data(),e={},f;for(f in d)0===f.indexOf(c)&&(e[f.replace(c,"").replace(/\w/,function(b){return b.toLowerCase()})]=d[f]);return e},Array:{ensure:function(b,c){if(-1===b.indexOf(c))return b.push(c)},removeAt:function(b,c){return!!b.splice(c,1).length},remove:function(b,c){var d=b.indexOf(c);return~d?avalon.Array.removeAt(b,d):!1}}});var u=avalon.bindingHandlers={},E=avalon.bindingExecutors={};avalon.nextTick=t.setImmediate?setImmediate.bind(t):
36
- function(b){setTimeout(b,0)};B.contains||(Node.prototype.contains=function(b){return!!(this.compareDocumentPosition(b)&16)});avalon.contains=function(b,c){try{for(;c=c.parentNode;)if(c===b)return!0;return!1}catch(d){return!1}};if(t.SVGElement){var ub=p.createElementNS("http://www.w3.org/2000/svg","svg");ub.innerHTML='<circle cx="50" cy="50" r="40" fill="red" />';if(!sb.test(ub.firstChild)){var Fa=function(b,c){if(b&&b.childNodes)for(var d=b.childNodes,e=0,f;f=d[e++];)if(f.tagName){var g=p.createElementNS("http://www.w3.org/2000/svg",
37
- f.tagName.toLowerCase());O.forEach.call(f.attributes,function(b){g.setAttribute(b.name,b.value)});Fa(f,g);c.appendChild(g)}};Object.defineProperties(SVGElement.prototype,{outerHTML:{enumerable:!0,configurable:!0,get:function(){return(new XMLSerializer).serializeToString(this)},set:function(b){var c=this.tagName.toLowerCase(),d=this.parentNode;b=avalon.parseHTML(b);"svg"===c?d.insertBefore(b,this):(c=p.createDocumentFragment(),Fa(b,c),d.insertBefore(c,this));d.removeChild(this)}},innerHTML:{enumerable:!0,
38
- configurable:!0,get:function(){var b=RegExp("</"+this.nodeName+">$","i");return this.outerHTML.replace(RegExp("<"+this.nodeName+'\\b(?:(["\'])[^"]*?(\\1)|[^>])*>',"i"),"").replace(b,"")},set:function(b){avalon.clearHTML&&(avalon.clearHTML(this),b=avalon.parseHTML(b),Fa(b,this))}}})}}var na=avalon.eventHooks;"onmouseenter"in B||avalon.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(b,c){na[b]={type:c,deel:function(c,e){return function(f){var g=f.relatedTarget;if(!g||g!==c&&!(c.compareDocumentPosition(g)&
39
- 16))return delete f.type,f.type=b,e.call(c,f)}}}});avalon.each({AnimationEvent:"animationend",WebKitAnimationEvent:"webkitAnimationEnd"},function(b,c){t[b]&&!na.animationend&&(na.animationend={type:c})});void 0===p.onmousewheel&&(na.mousewheel={type:"wheel",deel:function(b,c){return function(d){d.wheelDeltaY=d.wheelDelta=0<d.deltaY?-120:120;d.wheelDeltaX=0;Object.defineProperty(d,"type",{value:"mousewheel"});c.call(b,d)}}});var L,M,Z,vb,eb,wb=/[-.*+?^${}()|[\]\/\\]/g,C=z,da={loader:function(b){t.define=
40
- b?C.define:lc;t.require=b?C:kc},interpolate:function(b){L=b[0];M=b[1];if(L===M)throw new SyntaxError("openTag!==closeTag");if("\x3c!--,--\x3e"===b+"")s.commentInterpolate=!0;else{b=L+"test"+M;ma.innerHTML=b;if(ma.innerHTML!==b&&-1<ma.innerHTML.indexOf("&lt;"))throw new SyntaxError("\u6b64\u5b9a\u754c\u7b26\u4e0d\u5408\u6cd5");ma.innerHTML=""}b=(L+"").replace(wb,"\\$&");var c=(M+"").replace(wb,"\\$&");Z=RegExp(b+"(.*?)"+c);vb=RegExp(b+"(.*?)"+c,"g");eb=RegExp(b+".*?"+c+"|\\sms-")}};s.debug=!0;s.plugins=
41
- da;s.plugins.interpolate(["{{","}}"]);s.paths={};s.shim={};s.maxRepeatSize=100;avalon.config=s;var A={$watch:function(b,c){if("function"===typeof c){var d=this.$events[b];d?d.push(c):this.$events[b]=[c]}else this.$events=this.$watch.backup;return this},$unwatch:function(b,c){var d=arguments.length;if(0===d)this.$watch.backup=this.$events,this.$events={};else if(1===d)this.$events[b]=[];else for(var d=this.$events[b]||[],e=d.length;0>~--e;)if(d[e]===c)return d.splice(e,1);return this},$fire:function(b){var c;
42
- /^(\w+)!(\S+)$/.test(b)&&(c=RegExp.$1,b=RegExp.$2);var d=this.$events,e=ga.call(arguments,1),f=[b].concat(e);if("all"===c)for(var g in avalon.vmodels){var h=avalon.vmodels[g];h!==this&&h.$fire.apply(h,f)}else if("up"===c||"down"===c){var k=d.expr?p.querySelectorAll(d.expr):[];if(0!==k.length){for(g in avalon.vmodels)h=avalon.vmodels[g],h!==this&&h.$events.expr&&(e=p.querySelectorAll(h.$events.expr),0!==e.length&&Array.prototype.forEach.call(e,function(b){Array.prototype.forEach.call(k,function(d){if("down"===
43
- c?d.contains(b):b.contains(d))b._avalon=h})}));g=p.getElementsByTagName("*");var l=[];Array.prototype.forEach.call(g,function(b){b._avalon&&(l.push(b._avalon),b._avalon="",b.removeAttribute("_avalon"))});"up"===c&&l.reverse();for(g=0;(e=l[g++])&&!1!==e.$fire.apply(e,f););}}else{f=d[b]||[];d=d.$all||[];g=0;for(var m;m=f[g++];)Q(m)&&m.apply(this,e);for(g=0;m=d[g++];)Q(m)&&m.apply(this,arguments)}}},xb=avalon.vmodels={};avalon.define=function(b,c){var d=b.$id||b;d||y("warning: vm\u5fc5\u987b\u6307\u5b9a$id");
44
- xb[d]&&y("warning: "+d+" \u5df2\u7ecf\u5b58\u5728\u4e8eavalon.vmodels\u4e2d");if("object"===typeof b)var e=I(b);else e={$watch:z},c(e),e=I(e),qa=!0,c(e),qa=!1;e.$id=d;return xb[d]=e};var Pa="$id,$watch,$unwatch,$fire,$events,$model,$skipArray".match(w),pa={},nc=Object.defineProperty,Sa=!0;try{nc({},"_",{value:"x"});var Gb=Object.defineProperties}catch(Hc){Sa=!1}var Qa=Object.is||function(b,c){return 0===b&&0===c?1/b===1/c:b!==b?c!==c:b===c},Hb=R?function(b){var c={},d;for(d in b)c[d]={get:b[d],set:b[d],
45
- enumerable:!0,configurable:!0};return c}:function(b){return b},sa=O.splice,Ta={_splice:sa,_fire:function(b,c,d){fa(this.$events[J],b,c,d)},size:function(){return this._.length},pushArray:function(b){var c=b.length,d=this.length;c&&(O.push.apply(this.$model,b),T.call(this,"add",d,c,d));return c+d},push:function(){var b,c=arguments.length;for(b=0;b<c;b++);return this.pushArray(arguments)},unshift:function(){var b=arguments.length,c=this.length;b&&(O.unshift.apply(this.$model,arguments),T.call(this,
46
- "add",0,b,0));return b+c},shift:function(){if(this.length){var b=this.$model.shift();T.call(this,"del",0,1,0);return b}},pop:function(){var b=this.length;if(b){var c=this.$model.pop();T.call(this,"del",b-1,1,Math.max(0,b-2));return c}},splice:function(b){var c=arguments.length,d=[],e,f=sa.apply(this.$model,arguments);f.length&&(d.push("del",b,f.length,0),e=!0);2<c&&(e?d.splice(3,1,0,"add",b,c-2):d.push("add",b,c-2,0),e=!0);return e?T.apply(this,d):[]},contains:function(b){return-1!==this.indexOf(b)},
47
- remove:function(b){return this.removeAt(this.indexOf(b))},removeAt:function(b){return 0<=b?(this.$model.splice(b,1),T.call(this,"del",b,1,0)):[]},clear:function(){this.$model.length=this.length=this._.length=0;this._fire("clear",0);return this},removeAll:function(b){if(Array.isArray(b))b.forEach(function(b){this.remove(b)},this);else if("function"===typeof b)for(var c=this.length-1;0<=c;c--)b(this[c],c)&&this.removeAt(c);else this.clear()},ensure:function(b){this.contains(b)||this.push(b);return this},
48
- set:function(b,c){if(0<=b){var d=avalon.type(c);c&&c.$model&&(c=c.$model);var e=this[b];if("object"===d)for(var f in c)e.hasOwnProperty(f)&&(e[f]=c[f]);else"array"===d?e.clear().push.apply(e,c):e!==c&&(this[b]=c,this.$model[b]=c,this._fire("set",b,c))}return this}};"sort,reverse".replace(w,function(b){Ta[b]=function(){var c=this.$model,d=c.concat(),e=Math.random(),f=[],g;O[b].apply(c,arguments);for(var h=0,k=d.length;h<k;h++){var l=c[h];Qa(l,d[h])?f.push(h):(g=d.indexOf(l),f.push(g),d[g]=e,g=!0)}g&&
49
- (ta(this,f),this._fire("move",f),this._fire("index",0));return this}});var Ib=/^(duplex|on)$/,N=avalon.$$subscribers=[],Xa=new Date,Wa={},oa=new function(){avalon.mix(this,{option:p.createElement("select"),thead:p.createElement("table"),td:p.createElement("tr"),area:p.createElement("map"),tr:p.createElement("tbody"),col:p.createElement("colgroup"),legend:p.createElement("fieldset"),_default:p.createElement("div"),g:p.createElementNS("http://www.w3.org/2000/svg","svg")});this.optgroup=this.option;
50
- this.tbody=this.tfoot=this.colgroup=this.caption=this.thead;this.th=this.td};"circle,defs,ellipse,image,line,path,polygon,polyline,rect,symbol,text,use".replace(w,function(b){oa[b]=oa.g});var oc=/<([\w:]+)/,pc=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,qc=P(["","text/javascript","text/ecmascript","application/ecmascript","application/javascript"]),rc=p.createElement("script");avalon.parseHTML=function(b){if("string"!==typeof b)return p.createDocumentFragment();b=b.replace(pc,
51
- "<$1></$2>").trim();var c=(oc.exec(b)||["",""])[1].toLowerCase(),c=oa[c]||oa._default,d=U.cloneNode(!1);c.innerHTML=b;b=c.getElementsByTagName("script");if(b.length)for(var e=0,f;f=b[e++];)if(qc[f.type]){var g=rc.cloneNode(!1);O.forEach.call(f.attributes,function(b){g.setAttribute(b.name,b.value)});g.text=f.text;f.parentNode.replaceChild(g,f)}for(;b=c.firstChild;)d.appendChild(b);return d};avalon.innerHTML=function(b,c){var d=this.parseHTML(c);this.clearHTML(b).appendChild(d)};avalon.clearHTML=function(b){for(b.textContent=
52
- "";b.firstChild;)b.removeChild(b.firstChild);return b};avalon.scan=function(b,c,d){b=b||B;c=c?[].concat(c):[];Za(b,c)};var Rb=P("AREA,BASE,BASEFONT,BR,COL,COMMAND,EMBED,HR,IMG,INPUT,LINK,META,PARAM,SOURCE,TRACK,WBR,NOSCRIPT,SCRIPT,STYLE,TEXTAREA"),ea=function(b,c,d){if(b=b.getAttribute(c)){c=0;for(var e;e=d[c++];)if(e.hasOwnProperty(b)&&"function"===typeof e[b])return e[b]}},fb=za&&t.MutationObserver?function(b){for(var c=b.firstChild,d;c;){var e=c.nextSibling;3===c.nodeType?d?(d.nodeValue+=c.nodeValue,
53
- b.removeChild(c)):d=c:d=null;c=e}}:0,Mb=/ms-(\w+)-?(.*)/,cb={"if":10,repeat:90,data:100,widget:110,each:1400,"with":1500,duplex:2E3,on:3E3},Nb=P("animationend,blur,change,input,click,dblclick,focus,keydown,keypress,keyup,mousedown,mouseenter,mouseleave,mousemove,mouseout,mouseover,mouseup,scan,scroll,submit"),Ob=P("value,title,alt,checked,selected,disabled,readonly,enabled"),Pb=/^if|widget|repeat$/,Qb=/^each|with|html|include$/,db=/\|\s*html\s*/,Sb=/\|\|/g;"add,remove".replace(w,function(b){avalon.fn[b+
54
- "Class"]=function(c){var d=this[0];c&&("string"===typeof c&&d&&1===d.nodeType)&&c.replace(/\S+/g,function(c){d.classList[b](c)});return this}});avalon.fn.mix({hasClass:function(b){var c=this[0]||{};return 1===c.nodeType&&c.classList.contains(b)},toggleClass:function(b,c){for(var d,e=0,f=b.split(/\s+/),g="boolean"===typeof c;d=f[e++];)this[(g?c:!this.hasClass(d))?"addClass":"removeClass"](d);return this},attr:function(b,c){return 2===arguments.length?(this[0].setAttribute(b,c),this):this[0].getAttribute(b)},
55
- data:function(b,c){b="data-"+gb(b||"");switch(arguments.length){case 2:return this.attr(b,c),this;case 1:var d=this.attr(b);return ka(d);case 0:var e={};O.forEach.call(this[0].attributes,function(c){c&&(b=c.name,b.indexOf("data-")||(b=ja(b.slice(5)),e[b]=ka(c.value)))});return e}},removeData:function(b){b="data-"+gb(b);this[0].removeAttribute(b);return this},css:function(b,c){if(avalon.isPlainObject(b))for(var d in b)avalon.css(this,d,b[d]);else var e=avalon.css(this,b,c);return void 0!==e?e:this},
56
- position:function(){var b,c,d=this[0],e={top:0,left:0};if(d)return"fixed"===this.css("position")?c=d.getBoundingClientRect():(b=this.offsetParent(),c=this.offset(),"HTML"!==b[0].tagName&&(e=b.offset()),e.top+=avalon.css(b[0],"borderTopWidth",!0),e.left+=avalon.css(b[0],"borderLeftWidth",!0)),{top:c.top-e.top-avalon.css(d,"marginTop",!0),left:c.left-e.left-avalon.css(d,"marginLeft",!0)}},offsetParent:function(){for(var b=this[0].offsetParent;b&&"static"===avalon.css(b,"position");)b=b.offsetParent;
57
- return avalon(b)},bind:function(b,c,d){if(this[0])return avalon.bind(this[0],b,c,d)},unbind:function(b,c,d){this[0]&&avalon.unbind(this[0],b,c,d);return this},val:function(b){var c=this[0];if(c&&1===c.nodeType){var d=0===arguments.length,e=d?":get":":set",f=sc,g;g=c.tagName.toLowerCase();g="input"===g&&/checkbox|radio/.test(c.type)?"checked":g;if(e=f[g+e])var h=e(c,b);else{if(d)return(c.value||"").replace(/\r/g,"");c.value=b}}return d?h:this}});B.dataset&&(avalon.fn.data=function(b,c){var d=this[0].dataset;
58
- switch(arguments.length){case 2:return d[b]=c,this;case 1:return c=d[b],ka(c);case 0:var e={};for(b in d)e[b]=ka(d[b]);return e}});var Tb=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/;avalon.parseJSON=JSON.parse;avalon.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(b,c){avalon.fn[b]=function(d){var e=this[0]||{},f=e.window&&e.document?e:9===e.nodeType?e.defaultView:!1,g="scrollTop"===b;if(arguments.length)f?f.scrollTo(!g?d:avalon(f).scrollLeft(),g?d:avalon(f).scrollTop()):e[b]=d;else return f?
59
- f[c]:e[b]}});var x=avalon.cssHooks={},yb=["","-webkit-","-moz-","-ms-"],Ga={"float":"cssFloat"};avalon.cssNumber=P("columnCount,order,fillOpacity,fontWeight,lineHeight,opacity,orphans,widows,zIndex,zoom");avalon.cssName=function(b,c,d){if(Ga[b])return Ga[b];c=c||B.style;for(var e=0,f=yb.length;e<f;e++)if(d=ja(yb[e]+b),d in c)return Ga[b]=d;return null};x["@:set"]=function(b,c,d){b.style[c]=d};x["@:get"]=function(b,c){if(!b||!b.style)throw Error("getComputedStyle\u8981\u6c42\u4f20\u5165\u4e00\u4e2a\u8282\u70b9 "+
60
- b);var d,e=getComputedStyle(b,null);e&&(d="filter"===c?e.getPropertyValue(c):e[c],""===d&&(d=b.style[c]));return d};x["opacity:get"]=function(b){b=x["@:get"](b,"opacity");return""===b?"1":b};"top,left".replace(w,function(b){x[b+":get"]=function(c){var d=x["@:get"](c,b);return/px$/.test(d)?d:avalon(c).position()[b]+"px"}});var ib={position:"absolute",visibility:"hidden",display:"block"},Ub=/^(none|table(?!-c[ea]).+)/;"Width,Height".replace(w,function(b){var c=b.toLowerCase(),d="client"+b,e="scroll"+
61
- b,f="offset"+b;x[c+":get"]=function(c,d,e){var l=-4;"number"===typeof e&&(l=e);d="Width"===b?["Left","Right"]:["Top","Bottom"];e=c[f];if(2===l)return e+avalon.css(c,"margin"+d[0],!0)+avalon.css(c,"margin"+d[1],!0);0>l&&(e=e-avalon.css(c,"border"+d[0]+"Width",!0)-avalon.css(c,"border"+d[1]+"Width",!0));-4===l&&(e=e-avalon.css(c,"padding"+d[0],!0)-avalon.css(c,"padding"+d[1],!0));return e};x[c+"&get"]=function(b){var d=[];hb(b,d);for(var e=x[c+":get"](b),f=0,m;m=d[f++];){b=m.node;for(var n in m)"string"===
62
- typeof m[n]&&(b.style[n]=m[n])}return e};avalon.fn[c]=function(g){var h=this[0];if(0===arguments.length){if(h.setTimeout)return h["inner"+b];if(9===h.nodeType){var k=h.documentElement;return Math.max(h.body[e],k[e],h.body[f],k[f],k[d])}return x[c+"&get"](h)}return this.css(c,g)};avalon.fn["inner"+b]=function(){return x[c+":get"](this[0],void 0,-2)};avalon.fn["outer"+b]=function(b){return x[c+":get"](this[0],void 0,!0===b?2:0)}});avalon.fn.offset=function(){var b=this[0],c={left:0,top:0};if(!b||!b.tagName||
63
- !b.ownerDocument)return c;var d=b.ownerDocument,e=d.documentElement,d=d.defaultView;if(!e.contains(b))return c;void 0!==b.getBoundingClientRect&&(c=b.getBoundingClientRect());return{top:c.top+d.pageYOffset-e.clientTop,left:c.left+d.pageXOffset-e.clientLeft}};var sc={"select:get":function(b,c){for(var d,e=b.options,f=b.selectedIndex,g="select-one"===b.type||0>f,h=g?null:[],k=g?f+1:e.length,l=0>f?k:g?f:0;l<k;l++)if(d=e[l],(d.selected||l===f)&&!d.disabled){c=d.value;if(g)return c;h.push(c)}return h},
64
- "select:set":function(b,c,d){c=[].concat(c);for(var e=0,f;f=b.options[e++];)if(f.selected=-1<c.indexOf(f.value))d=!0;d||(b.selectedIndex=-1)}},kb=JSON.stringify,tc=/\/\*[\w\W]*?\*\/|\/\/[^\n]*\n|\/\/[^\n]*$|"(?:[^"\\]|\\[\w\W])*"|'(?:[^'\\]|\\[\w\W])*'|[\s\t\n]*\.[\s\t\n]*[$\w\.]+/g,uc=/[^\w$]+/g,vc=RegExp(""+("\\b"+"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".replace(/,/g,
65
- "\\b|\\b")+"\\b"),"g"),wc=/\b\d[^,]*/g,xc=/^,+|,+$/g,Ha=Na(512),cc=function(b){var c=","+b.trim();if(Ha[c])return Ha[c];b=b.replace(tc,"").replace(uc,",").replace(vc,"").replace(wc,"").replace(xc,"").split(/^$|,+/);return Ha(c,jb(b))},Aa=Na(128),dc=/\w\[.*\]|\w\.\w/,bc=/(\$proxy\$[a-z]+)\d+$/,Xb=/\)\s*$/,Yb=/\)\s*\|/g,Zb=/\|\s*([$\w]+)/g,$b=/"\s*\["/g,ac=/"\s*\(/g;avalon.parseExprProxy=H;var Ia={};"autofocus,autoplay,async,allowTransparency,checked,controls,declare,disabled,defer,defaultChecked,defaultSelectedcontentEditable,isMap,loop,multiple,noHref,noResize,noShade,open,readOnly,selected".replace(w,
66
- function(b){Ia[b.toLowerCase()]=b});var Ja={"accept-charset":"acceptCharset","char":"ch",charoff:"chOff","class":"className","for":"htmlFor","http-equiv":"httpEquiv"};"accessKey,bgColor,cellPadding,cellSpacing,codeBase,codeType,colSpan,dateTime,defaultValue,frameBorder,longDesc,maxLength,marginWidth,marginHeight,rowSpan,tabIndex,useMap,vSpace,valueType,vAlign".replace(w,function(b){Ja[b.toLowerCase()]=b});var yc=/<noscript.*?>(?:[\s\S]+?)<\/noscript>/img,zc=/<noscript.*?>([\s\S]+?)<\/noscript>/im,
67
- Ka=function(){return new (t.XMLHttpRequest||ActiveXObject)("Microsoft.XMLHTTP")},La=avalon.templateCache={};u.attr=function(b,c){var d=b.value.trim(),e=!0;-1<d.indexOf(L)&&2<d.indexOf(M)&&(e=!1,Z.test(d)&&(""===RegExp.rightContext&&""===RegExp.leftContext)&&(e=!0,d=RegExp.$1));if("include"===b.type){var f=b.element;b.includeRendered=ea(f,"data-include-rendered",c);b.includeLoaded=ea(f,"data-include-loaded",c);var g=b.includeReplaced=!!avalon(f).data("includeReplace");b.startInclude=p.createComment("ms-include");
68
- b.endInclude=p.createComment("ms-include-end");g?(b.element=b.startInclude,f.parentNode.insertBefore(b.startInclude,f),f.parentNode.insertBefore(b.endInclude,f.nextSibling)):(f.insertBefore(b.startInclude,f.firstChild),f.appendChild(b.endInclude))}b.handlerName="attr";H(d,c,b,e?0:ya(b.value))};E.attr=function(b,c,d){var e=d.type,f=d.param;if("css"===e)avalon(c).css(f,b);else if("attr"===e){if(Ia[f]&&(e=Ia[f],"boolean"===typeof c[e]))return c[e]=!!b;!R&&Ja[f]&&(f=Ja[f]);if(!1===b||null===b||void 0===
69
- b)return c.removeAttribute(f);(sb.test(c)?0:p.namespaces&&isVML(c)||f in c.cloneNode(!1))?c[f]=b:c.setAttribute(f,b)}else if("include"===e&&b){var g=d.vmodels,h=d.includeRendered,k=d.includeLoaded,l=d.includeReplaced?c.parentNode:c,m=function(b){k&&(b=k.apply(l,[b].concat(g)));for(h&&ha(l,function(){h.call(l)},NaN);;){var c=d.startInclude.nextSibling;if(c&&c!==d.endInclude)l.removeChild(c);else break}b=avalon.parseHTML(b);c=avalon.slice(b.childNodes);l.insertBefore(b,d.endInclude);ia(c,g)};if("src"===
70
- d.param)if(La[b])avalon.nextTick(function(){m(La[b])});else{var n=Ka();n.onreadystatechange=function(){if(4===n.readyState){var c=n.status;if(200<=c&&300>c||304===c||1223===c)m(La[b]=n.responseText)}};n.open("GET",b,!0);"withCredentials"in n&&(n.withCredentials=!0);n.setRequestHeader("X-Requested-With","XMLHttpRequest");n.send(null)}else{var r=b&&1===b.nodeType?b:p.getElementById(b);if(r){if("NOSCRIPT"===r.tagName&&!r.innerHTML&&!r.fixIE78){n=Ka();n.open("GET",location,!1);n.send(null);c=p.getElementsByTagName("noscript");
71
- for(var f=(n.responseText||"").match(yc)||[],e=f.length,q=0;q<e;q++){var D=c[q];D&&(D.style.display="none",D.fixIE78=(f[q].match(zc)||["","&nbsp;"])[1])}}avalon.nextTick(function(){m(r.fixIE78||r.value||r.innerText||r.innerHTML)})}}}else{if(!B.hasAttribute&&"string"===typeof b&&("src"===e||"href"===e))b=b.replace(/&amp;/g,"&");c[e]=b;t.chrome&&"EMBED"===c.tagName&&(f=c.parentNode,e=document.createComment("ms-src"),f.replaceChild(e,c),f.replaceChild(c,e))}};"title,alt,src,value,css,include,href".replace(w,
72
- function(b){u[b]=u.attr});u["class"]=function(b,c){var d=b.param,e=b.value;b.handlerName="class";if(!d||isFinite(d)){b.param="";var f=e.replace(vb,function(b){return b.replace(/./g,"0")}).indexOf(":");if(-1===f)d=e;else if(d=e.slice(0,f),e=e.slice(f+1),lb(e,c,b),b.evaluator)b._evaluator=b.evaluator,b._args=b.args;else return y("debug: ms-class '"+(e||"").trim()+"' \u4e0d\u5b58\u5728\u4e8eVM\u4e2d"),!1;e=Z.test(d);e||(b.immobileClass=d);H("",c,b,e?ya(d):0)}else b.immobileClass=b.oldStyle=b.param,H(e,
73
- c,b)};E["class"]=function(b,c,d){var e=avalon(c),f=d.type;if("class"===f&&d.oldStyle)e.toggleClass(d.oldStyle,!!b);else switch(d.toggleClass=d._evaluator?!!d._evaluator.apply(c,d._args):!0,d.newClass=d.immobileClass||b,d.oldClass&&d.newClass!==d.oldClass&&e.removeClass(d.oldClass),d.oldClass=d.newClass,f){case "class":e.toggleClass(d.newClass,d.toggleClass);break;case "hover":case "active":if(!d.hasBindEvent){var g="mouseenter",h="mouseleave";if("active"===f){c.tabIndex=c.tabIndex||-1;var g="mousedown",
74
- h="mouseup",k=e.bind("mouseleave",function(){d.toggleClass&&e.removeClass(d.newClass)})}var l=e.bind(g,function(){d.toggleClass&&e.addClass(d.newClass)}),m=e.bind(h,function(){d.toggleClass&&e.removeClass(d.newClass)});d.rollback=function(){e.unbind("mouseleave",k);e.unbind(g,l);e.unbind(h,m)};d.hasBindEvent=!0}}};"hover,active".replace(w,function(b){u[b]=u["class"]});E.data=function(b,c,d){d="data-"+d.param;b&&"object"===typeof b?c[d]=b:c.setAttribute(d,String(b))};E.text=function(b,c){b=null==b?
75
- "":b;if(3===c.nodeType)try{c.data=b}catch(d){}else c.textContent=b};E.html=function(b,c,d){b=null==b?"":b;var e="group"in d,f=e?c.parentNode:c;if(f){if(11!==b.nodeType)if(1===b.nodeType||b.item){var g=1===b.nodeType?b.childNodes:b.item?b:[];for(b=U.cloneNode(!0);g[0];)b.appendChild(g[0])}else b=avalon.parseHTML(b);var h=p.createComment("ms-html");if(e){f.insertBefore(h,c);for(var g=d.group,k=1;k<g;){var l=c.nextSibling;l&&(f.removeChild(l),k++)}f.removeChild(c);d.element=h}else avalon.clearHTML(f).appendChild(h);
76
- e&&(d.group=b.childNodes.length||1);g=avalon.slice(b.childNodes);g[0]&&(h.parentNode&&h.parentNode.replaceChild(b,h),e&&(d.element=g[0]));ia(g,d.vmodels)}};u["if"]=u.data=u.text=u.html=function(b,c){H(b.value,c,b)};E["if"]=function(b,c,d){b?(8===c.nodeType&&(c.parentNode.replaceChild(d.template,c),c=d.element=d.template),c.getAttribute(d.name)&&(c.removeAttribute(d.name),$a(c,d.vmodels)),d.rollback=null):1===c.nodeType&&(b=d.element=p.createComment("ms-if"),c.parentNode.replaceChild(b,c),d.template=
77
- c,Da.appendChild(c),d.rollback=function(){c.parentNode===Da&&Da.removeChild(c)})};avalon.parseDisplay=$;u.visible=function(b,c){var d=avalon(b.element),e=d.css("display");if("none"===e){var f=d[0].style,g=/visibility/i.test(f.cssText),h=d.css("visibility");f.display="";f.visibility="hidden";e=d.css("display");"none"===e&&(e=$(d[0].nodeName));f.visibility=g?h:""}b.display=e;H(b.value,c,b)};E.visible=function(b,c,d){c.style.display=b?d.display:"none"};var zb=/\(([^)]*)\)/;u.on=function(b,c){var d=b.value;
78
- b.type="on";var e=b.param.replace(/-\d+$/,"");if("function"===typeof u.on[e+"Hook"])u.on[e+"Hook"](b);if(0<d.indexOf("(")&&-1<d.indexOf(")")&&(e=(d.match(zb)||["",""])[1].trim(),""===e||"$event"===e))d=d.replace(zb,"");H(d,c,b)};E.on=function(b,c,d){b=function(b){return(d.evaluator||z).apply(this,d.args.concat(b))};var e=d.param.replace(/-\d+$/,"");if("scan"===e)b.call(c,{type:e});else if("function"===typeof d.specialBind)d.specialBind(c,b);else var f=avalon.bind(c,e,b);d.rollback=function(){"function"===
79
- typeof d.specialUnbind?d.specialUnbind():avalon.unbind(c,e,f)}};u.widget=function(b,c){var d=b.value.match(w),e=b.element,f=d[0],g=d[1];if(!g||"$"===g)g=K(f);var d=d[2]||f,h=avalon.ui[f];if("function"===typeof h){c=e.vmodels||c;for(var k=0,l;l=c[k++];)if(l.hasOwnProperty(d)&&"object"===typeof l[d]){var m=l[d],m=m.$model||m;break}m&&(k=m[f+"Id"],"string"===typeof k&&(g=k));k=avalon.getWidgetData(e,f);b.value=[f,g,d].join();b[f+"Id"]=g;b.evaluator=z;e.msData["ms-widget-id"]=g;var n=b[f+"Options"]=avalon.mix({},
80
- h.defaults,m||{},k);e.removeAttribute("ms-widget");var r=h(e,b,c)||{};r.$id?(avalon.vmodels[g]=r,Ya(e,r),r.hasOwnProperty("$init")&&r.$init(function(){avalon.scan(e,[r].concat(c));"function"===typeof n.onInit&&n.onInit.call(e,r,n,c)}),b.rollback=function(){try{r.widgetElement=null,r.$remove()}catch(b){}e.msData={};delete avalon.vmodels[r.$id]},va(b,Ac),t.chrome&&e.addEventListener("DOMNodeRemovedFromDocument",function(){setTimeout(Va)})):avalon.scan(e,c)}else c.length&&(e.vmodels=c)};var Ac=[],V=
81
- u.duplex=function(b,c){var d=b.element,e;H(b.value,c,b,0,1);b.changed=ea(d,"data-duplex-changed",c)||z;if(b.evaluator&&b.args){var f=[],g=P("string,number,boolean,checked");"radio"===d.type&&""===b.param&&(b.param="checked");d.msData&&(d.msData["ms-duplex"]=b.value);b.param.replace(/\w+/g,function(c){/^(checkbox|radio)$/.test(d.type)&&/^(radio|checked)$/.test(c)&&("radio"===c&&y("ms-duplex-radio\u5df2\u7ecf\u66f4\u540d\u4e3ams-duplex-checked"),c="checked",b.isChecked=!0);"bool"===c?(c="boolean",y("ms-duplex-bool\u5df2\u7ecf\u66f4\u540d\u4e3ams-duplex-boolean")):
82
- "text"===c&&(c="string",y("ms-duplex-text\u5df2\u7ecf\u66f4\u540d\u4e3ams-duplex-string"));g[c]&&(e=!0);avalon.Array.ensure(f,c)});e||f.push("string");b.param=f.join("-");b.bound=function(c,e){d.addEventListener?d.addEventListener(c,e,!1):d.attachEvent("on"+c,e);var f=b.rollback;b.rollback=function(){d.avalonSetter=null;avalon.unbind(d,c,e);f&&f()}};for(var h in avalon.vmodels)avalon.vmodels[h].$fire("avalon-ms-duplex-init",b);(b.pipe||(b.pipe=ec))(null,b,"init");h=d.tagName;V[h]&&V[h](d,b.evaluator.apply(null,
83
- b.args),b)}};avalon.duplexHooks={checked:{get:function(b,c){return!c.element.oldValue}},string:{get:function(b){return b},set:Ba},"boolean":{get:function(b){return"true"===b},set:Ba},number:{get:function(b){return isFinite(b)?parseFloat(b)||0:b},set:Ba}};var mb,aa=[];avalon.tick=function(b){1===aa.push(b)&&(mb=setInterval(fc,60))};var Ab=z;new function(){try{var b={},c=HTMLInputElement.prototype,d=HTMLTextAreaElement.prototype,e=function(c){avalon.contains(B,this)&&(b[this.tagName].call(this,c),this.avalonSetter&&
84
- this.avalonSetter())};Object.getOwnPropertyNames(HTMLInputElement.prototype);b.INPUT=Object.getOwnPropertyDescriptor(c,"value").set;Object.defineProperty(c,"value",{set:e});b.TEXTAREA=Object.getOwnPropertyDescriptor(d,"value").set;Object.defineProperty(d,"value",{set:e})}catch(f){Ab=avalon.tick}};V.INPUT=function(b,c,d){function e(b){d.changed.call(this,b,d)}function f(){n=!0}function g(){n=!1}function h(){if(!n){var f=b.oldValue=b.value,f=d.pipe(f,d,"get");!1!==m.data("duplex-observe")&&(c(f),e.call(b,
85
- f),m.data("duplex-focus")&&avalon.nextTick(function(){b.focus()}))}}var k=b.type,l=d.bound,m=avalon(b),n=!1;d.handler=function(){var e=d.pipe(c(),d,"set")+"";e!==b.oldValue&&(b.value=e)};d.isChecked||"radio"===b.type?(h=function(){if(!1!==m.data("duplex-observe")){var f=d.pipe(b.value,d,"get");c(f);e.call(b,f)}},d.handler=function(){var e=c();b.checked=b.oldValue=d.isChecked?!!e:e+""===b.value},l("click",h)):"checkbox"===k?(h=function(){if(!1!==m.data("duplex-observe")){var f=b.checked?"ensure":"remove",
86
- g=c();Array.isArray(g)||(y("ms-duplex\u5e94\u7528\u4e8echeckbox\u4e0a\u8981\u5bf9\u5e94\u4e00\u4e2a\u6570\u7ec4"),g=[g]);avalon.Array[f](g,d.pipe(b.value,d,"get"));e.call(b,g)}},d.handler=function(){var e=[].concat(c());b.checked=-1<e.indexOf(d.pipe(b.value,d,"get"))},l("change",h)):(k=b.getAttribute("data-duplex-event")||b.getAttribute("data-event")||"input",b.attributes["data-event"]&&y("data-event\u6307\u4ee4\u5df2\u7ecf\u5e9f\u5f03\uff0c\u8bf7\u6539\u7528data-duplex-event"),k.replace(w,function(b){switch(b){case "input":l("input",
87
- h);l("DOMAutoComplete",h);za||(l("compositionstart",f),l("compositionend",g));break;default:l(b,h)}}));/text|password/.test(b.type)&&Ab(function(){if(B.contains(b))b.value!==b.oldValue&&h();else if(!b.msRetain)return!1});b.avalonSetter=h;b.oldValue=b.value;ua(d);e.call(b,b.value)};V.TEXTAREA=V.INPUT;V.SELECT=function(b,c,d){var e=avalon(b);d.handler=function(){var d=c(),d=d&&d.$model||d;Array.isArray(d)?b.multiple||y("ms-duplex\u5728<select multiple=true>\u4e0a\u8981\u6c42\u5bf9\u5e94\u4e00\u4e2a\u6570\u7ec4"):
88
- b.multiple&&y("ms-duplex\u5728<select multiple=false>\u4e0d\u80fd\u5bf9\u5e94\u4e00\u4e2a\u6570\u7ec4");d=Array.isArray(d)?d.map(String):d+"";d+""!==b.oldValue&&(e.val(d),b.oldValue=d+"")};d.bound("change",function(){if(!1!==e.data("duplex-observe")){var f=e.val(),f=Array.isArray(f)?f.map(function(b){return d.pipe(b,d,"get")}):d.pipe(f,d,"get");f+""!==b.oldValue&&c(f);d.changed.call(b,f,d)}});ha(b,function(){ua(d);d.changed.call(b,c(),d)},NaN)};u.repeat=function(b,c){var d=b.type;H(b.value,c,b,0,
89
- 1);b.proxies=[];var e=!1;try{var f=b.$repeat=b.evaluator.apply(0,b.args||[]),g=avalon.type(f);"object"!==g&&"array"!==g&&(e=!0,avalon.log("warning:"+b.value+"\u5bf9\u5e94\u7c7b\u578b\u4e0d\u6b63\u786e"))}catch(h){e=!0,avalon.log("warning:"+b.value+"\u7f16\u8bd1\u51fa\u9519")}var k=b.value.split(".")||[];if(1<k.length){k.pop();for(var l=k[0],k=0,m;m=c[k++];)if(m&&m.hasOwnProperty(l)){k=m[l].$events||{};k[J]=k[J]||[];k[J].push(b);break}}k=b.element;k.removeAttribute(b.name);b.sortedCallback=ea(k,"data-with-sorted",
90
- c);b.renderedCallback=ea(k,"data-"+d+"-rendered",c);l=K(d);m=b.element=p.createComment(l+":end");b.clone=p.createComment(l);U.appendChild(m);"each"===d||"with"===d?(b.template=k.innerHTML.trim(),avalon.clearHTML(k).appendChild(m)):(b.template=k.outerHTML.trim(),k.parentNode.replaceChild(m,k));b.template=avalon.parseHTML(b.template);b.rollback=function(){var c=b.element;if(c){E.repeat.call(b,"clear");var d=c.parentNode,e=b.template,f=e.firstChild;d.replaceChild(e,c);(c=b.$stamp)&&c.parentNode&&c.parentNode.removeChild(c);
91
- b.element="repeat"===b.type?f:d}};if(!e){b.handler=E.repeat;b.$outer={};d="$key";e="$val";Array.isArray(f)&&(d="$first",e="$last");for(k=0;l=c[k++];)if(l.hasOwnProperty(d)&&l.hasOwnProperty(e)){b.$outer=l;break}d=f.$events;(e=(d||{})[J])&&avalon.Array.ensure(e,b)&&va(b,e);"object"===g?(b.$with=!0,g=!d?{}:d.$withProxyPool||(d.$withProxyPool={}),b.handler("append",f,g)):f.length&&b.handler("add",0,f.length)}};E.repeat=function(b,c,d){if(b){var e=this.element,f=e.parentNode,g=this.proxies,h=U.cloneNode(!1);
92
- switch(b){case "add":for(var e=c+d,k=this.$repeat.length-1,k=[],l=ob(this,c),m=c;m<e;m++){var n=hc(m,this);g.splice(m,0,n);nb(this,h,n,k)}f.insertBefore(h,l);for(m=0;h=k[m++];)ia(h.nodes,h.vmodels),h.nodes=h.vmodels=null;break;case "del":l=g[c].$stamp;e=ob(this,c+d);Ca(l,e);h=g.splice(c,d);ra(h,"each");break;case "clear":if(h=this.$stamp||g[0])l=h.$stamp||h,Ca(l,e);ra(g,"each");break;case "move":var l=g[0].$stamp,r=l.nodeValue,q=[],D=[];Ca(l,e,function(){D.unshift(this);this.nodeValue===r&&(q.unshift(D),
93
- D=[])});ta(g,c);for(ta(q,c);D=q.shift();)for(;k=D.shift();)h.appendChild(k);f.insertBefore(h,e);break;case "index":for(k=g.length-1;d=g[c];c++)d.$index=c,d.$first=0===c,d.$last=c===k;return;case "set":(n=g[c])&&fa(n.$events.$index);return;case "append":g=d;l=[];k=[];for(n in c)c.hasOwnProperty(n)&&"hasOwnProperty"!==n&&l.push(n);this.sortedCallback&&(m=this.sortedCallback.call(f,l))&&(Array.isArray(m)&&m.length)&&(l=m);for(m=0;n=l[m++];)"hasOwnProperty"!==n&&(g[n]||(g[n]=jc(n,this)),nb(this,h,g[n],
94
- k));m=this.$stamp=this.clone;f.insertBefore(m,e);f.insertBefore(h,e);for(m=0;h=k[m++];)ia(h.nodes,h.vmodels),h.nodes=h.vmodels=null}"clear"===b&&(b="del");var X=this.renderedCallback||z,p=arguments;ha(f,function(){X.apply(f,p);f.oldValue&&"SELECT"===f.tagName&&avalon(f).val(f.oldValue.split(","))},NaN)}};"with,each".replace(w,function(b){u[b]=u.repeat});var la=[],pb=[],Bc=/<script[^>]*>([\S\s]*?)<\/script\s*>/gim,Cc=/\s+(on[^=\s]+)(?:=("[^"]*"|'[^']*'|[^\s>]+))?/g,Dc=/<\w+\b(?:(["'])[^"]*?(\1)|[^>])*>/ig,
95
- Ec={a:/\b(href)\=("javascript[^"]*"|'javascript[^']*')/ig,img:/\b(src)\=("javascript[^"]*"|'javascript[^']*')/ig,form:/\b(action)\=("javascript[^"]*"|'javascript[^']*')/ig},Fc=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Gc=/([^\#-~| |!])/g,Ma=avalon.filters={uppercase:function(b){return b.toUpperCase()},lowercase:function(b){return b.toLowerCase()},truncate:function(b,c,d){c=c||30;d=void 0===d?"...":d;return b.length>c?b.slice(0,c-d.length)+d:String(b)},$filter:function(b){for(var c=1,d=arguments.length;c<
96
- d;c++){var e=arguments[c],f=avalon.filters[e.shift()];"function"===typeof f&&(e=[b].concat(e),b=f.apply(null,e))}return b},camelize:ja,sanitize:function(b){return b.replace(Bc,"").replace(Dc,function(b,d){var e=b.toLowerCase().match(/<(\w+)\s/);e&&(e=Ec[e[1]])&&(b=b.replace(e,function(b,c,d){b=d.charAt(0);return c+"="+b+"javascript:void(0)"+b}));return b.replace(Cc," ").replace(/\s+/g," ")})},escape:function(b){return String(b).replace(/&/g,"&amp;").replace(Fc,function(b){var d=b.charCodeAt(0);b=
97
- b.charCodeAt(1);return"&#"+(1024*(d-55296)+(b-56320)+65536)+";"}).replace(Gc,function(b){return"&#"+b.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")},currency:function(b,c,d){return(c||"\uffe5")+qb(b,isFinite(d)?d:2)},number:function(b,c){return qb(b,isFinite(c)?c:3)}};new function(){function b(b,c,d){var e="";0>b&&(e="-",b=-b);for(b=""+b;b.length<c;)b="0"+b;d&&(b=b.substr(b.length-c));return e+b}function c(c,d,e,f){return function(g){g=g["get"+c]();if(0<e||g>-e)g+=e;0===g&&-12===e&&
98
- (g=12);return b(g,d,f)}}function d(b,c){return function(d,e){var f=d["get"+b](),g=(c?"SHORT"+b:b).toUpperCase();return e[g][f]}}function e(b){var c;if(c=b.match(k)){b=new Date(0);var d=0,e=0,f=c[8]?b.setUTCFullYear:b.setFullYear,g=c[8]?b.setUTCHours:b.setHours;c[9]&&(d=parseInt(c[9]+c[10],10),e=parseInt(c[9]+c[11],10));f.call(b,parseInt(c[1],10),parseInt(c[2],10)-1,parseInt(c[3],10));d=parseInt(c[4]||0,10)-d;e=parseInt(c[5]||0,10)-e;f=parseInt(c[6]||0,10);c=Math.round(1E3*parseFloat("0."+(c[7]||0)));
99
- g.call(b,d,e,f,c)}return b}var f={yyyy:c("FullYear",4),yy:c("FullYear",2,0,!0),y:c("FullYear",1),MMMM:d("Month"),MMM:d("Month",!0),MM:c("Month",2,1),M:c("Month",1,1),dd:c("Date",2),d:c("Date",1),HH:c("Hours",2),H:c("Hours",1),hh:c("Hours",2,-12),h:c("Hours",1,-12),mm:c("Minutes",2),m:c("Minutes",1),ss:c("Seconds",2),s:c("Seconds",1),sss:c("Milliseconds",3),EEEE:d("Day"),EEE:d("Day",!0),a:function(b,c){return 12>b.getHours()?c.AMPMS[0]:c.AMPMS[1]},Z:function(c){c=-1*c.getTimezoneOffset();return c=
100
- (0<=c?"+":"")+(b(Math[0<c?"floor":"ceil"](c/60),2)+b(Math.abs(c%60),2))}},g=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,h=/^\d+$/,k=/^(\d{4})-?(\d+)-?(\d+)(?:T(\d+)(?::?(\d+)(?::?(\d+)(?:\.(\d+))?)?)?(Z|([+-])(\d+):?(\d+))?)?$/,l=/^(\d+)\D(\d+)\D(\d+)/;Ma.date=function(b,c){var d=Ma.date.locate,k="",m=[],p,s;c=c||"mediumDate";c=d[c]||c;"string"===typeof b&&(h.test(b)?b=parseInt(b,10):(b=b.trim().replace(l,function(b,c,d,e){return(4===e.length?[e,c,d]:[c,d,e]).join("-")}),
101
- b=e(b)),b=new Date(b));"number"===typeof b&&(b=new Date(b));if("date"===avalon.type(b)){for(;c;)(s=g.exec(c))?(m=m.concat(s.slice(1)),c=m.pop()):(m.push(c),c=null);m.forEach(function(c){p=f[c];k+=p?p(b,d):c.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return k}};var m={AMPMS:{"0":"\u4e0a\u5348",1:"\u4e0b\u5348"},DAY:{"0":"\u661f\u671f\u65e5",1:"\u661f\u671f\u4e00",2:"\u661f\u671f\u4e8c",3:"\u661f\u671f\u4e09",4:"\u661f\u671f\u56db",5:"\u661f\u671f\u4e94",6:"\u661f\u671f\u516d"},MONTH:{"0":"1\u6708",
102
- 1:"2\u6708",2:"3\u6708",3:"4\u6708",4:"5\u6708",5:"6\u6708",6:"7\u6708",7:"8\u6708",8:"9\u6708",9:"10\u6708",10:"11\u6708",11:"12\u6708"},SHORTDAY:{"0":"\u5468\u65e5",1:"\u5468\u4e00",2:"\u5468\u4e8c",3:"\u5468\u4e09",4:"\u5468\u56db",5:"\u5468\u4e94",6:"\u5468\u516d"},fullDate:"y\u5e74M\u6708d\u65e5EEEE",longDate:"y\u5e74M\u6708d\u65e5",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"};m.SHORTMONTH=m.MONTH;Ma.date.locate=
103
- m};var v=avalon.modules={"ready!":{exports:avalon},avalon:{exports:avalon,state:2}};v.exports=v.avalon;new function(){function b(c,d){for(var e in c)if("\u53f8\u5f92\u6b63\u7f8e"===c[e]&&2!==v[e].state&&(e===d||b(v[e].deps,d)))return!0}function c(b,c,d){var f=e(b.src);b.onload=b.onreadystatechange=b.onerror=null;if(c||d&&!v[f].state)setTimeout(function(){F.removeChild(b);b=null}),y("debug: \u52a0\u8f7d "+f+" \u5931\u8d25"+c+" "+!v[f].state);else return!0}function d(){var b=u.length,c;a:for(;c=u[--b];){var e=
104
- v[c];c=e.deps;for(var f in c)if(Oa.call(c,f)&&2!==v[f].state)continue a;if(2!==e.state){u.splice(b,1);c=e.id;var g=e.args,e=e.factory,h=Object(v[c]);h.state=2;for(var k=0,l=[],q=void 0;q=g[k++];)"exports"===q?(q=h.exports||(h.exports={}),l.push(q)):l.push(v[q].exports);g=e.apply(t,l);void 0!==g&&(v[c].exports=g);d()}}}function e(b){return(b||"").replace(H,"")}function f(b){return b?b.substr(0,b.lastIndexOf("/")):s.baseUrl?s.baseUrl:s.loaderUrl}function g(b){var c;try{a.b.c()}catch(d){c=d.stack,!c&&
105
- t.opera&&(c=(String(d).match(/of linked script \S+/g)||[]).join(" "))}if(c)return c=c.split(/[@ ]/g).pop(),c="("===c[0]?c.slice(1,-1):c.replace(/\s/,""),c.replace(/(:\d+)?:\d+$/i,"");for(var e=(b?p:F).getElementsByTagName("script"),f=e.length;c=e[--f];)if((b||c.className===J)&&"interactive"===c.readyState)return b="1"[0]?c.src:c.getAttribute("src",4),c.className=b}function h(b,c,d){if("ready!"===b||v[b]&&2===v[b].state)return b;var e="js";b=b.replace(/^(\w+)\!/,function(b,c){e=c;return""});var g=
106
- da[e]||z,h="",k=b.replace(H,function(b){h=b;return""}),l="";"js"===e&&(b=k=k.replace(/\.js$/i,""),l=".js");var q=0;r(k,s.paths,function(c,d){b=b.replace(d,c);q=1});q||r(k,s.packages,function(c,d,e){b=b.replace(e.name,e.location)});d&&r(d,s.map,function(c){r(b,c,function(c,d){b=b.replace(d,c)})});/^(?:[a-z]+:)?\/\//i.test(String(b))||(b=D(/\w/.test(b.charAt(0))?f():c,b));b+=l+h;r(k,s.urlArgs,function(c){b+=(-1===b.indexOf("?")?"?":"&")+c});return g(b,s.shim[k])}function k(b,e,f){var g=p.createElement("script");
107
- g.className=J;g[R?"onload":"onreadystatechange"]=function(){if(R||/loaded|complete/i.test(g.readyState)){var h=w.pop();h&&h.require(e);f&&f();c(g,!1,!R)&&(y("debug: \u5df2\u6210\u529f\u52a0\u8f7d "+b),u.push(e),d())}};g.onerror=function(){c(g,!0)};g.src=b;F.insertBefore(g,F.firstChild);y("debug: \u6b63\u51c6\u5907\u52a0\u8f7d "+b)}function l(b,c,d){var e=[],f;for(f in b)if(b.hasOwnProperty(f)){var g={name:f,val:b[f]};e.push(g);g.reg="*"===f&&c?/^/:RegExp("^"+f+"(/|$)");d&&"*"!==f&&(g.reg=RegExp("/"+
108
- f.replace(/^\//,"")+"(/|$)"))}e.sort(q);return e}function m(b){return function(){var c;b.init&&(c=b.init.apply(t,arguments));return c||b.exports&&X(b.exports)}}function n(b,c,d,e,f){return{id:b,state:c||1,factory:d||z,deps:e||{},args:f||[]}}function r(b,c,d){c=c||[];for(var e=0,f;f=c[e++];)if(f.reg.test(b))return d(f.val,f.name,f),!1}function q(b,c){var d=b.name,e=c.name;return"*"===e?-1:"*"===d?1:e.length-d.length}function D(b,c){"/"!==b.charAt(b.length-1)&&(b+="/");if("./"===c.slice(0,2))return b+
109
- c.slice(2);if(".."===c.slice(0,2)){for(b+=c;I.test(b);)b=b.replace(I,"");return b}return"/"===c.slice(0,1)?b+c.slice(1):b+c}function X(b){if(!b)return b;var c=t;b.split(".").forEach(function(b){c=c[b]});return c}var u=[],w=[];C=avalon.require=function(b,c,e){Array.isArray(b)||avalon.error("require\u7684\u7b2c\u4e00\u4e2a\u53c2\u6570\u5fc5\u987b\u662f\u4f9d\u8d56\u5217\u6570,\u7c7b\u578b\u4e3a\u6570\u7ec4 "+b);var g=[],k={},l=e||"callback"+setTimeout("1"),q=e&&e.replace(/\.js$/i,"");e=f(e);b.forEach(function(b){if((b=
110
- h(b,e,q))&&!k[b])g.push(b),k[b]="\u53f8\u5f92\u6b63\u7f8e"});b=v[l];if(!b||2!==b.state)v[l]=n(l,1,c,k,g);b||u.push(l);d()};C.define=function(c,d,f){var h=ga.call(arguments);if("string"===typeof c)var k=h.shift();"function"===typeof h[0]&&h.unshift([]);var l=v[k]&&1<=v[k].state?k:e(g());f=h[1];f.id=k;!v[l]&&k&&(v[l]=n(l,1,f));f.require=function(c){h.push(c);var d=!0;try{d=b(v[c].deps,c)}catch(e){}d&&avalon.error(c+"\u6a21\u5757\u4e0e\u4e4b\u524d\u7684\u6a21\u5757\u5b58\u5728\u5faa\u73af\u4f9d\u8d56\uff0c\u8bf7\u4e0d\u8981\u76f4\u63a5\u7528script\u6807\u7b7e\u5f15\u5165"+
111
- c+"\u6a21\u5757");delete f.require;C.apply(null,h)};l?f.require(l):w.push(f)};C.config=s;C.define.amd=v;var x=s["orig.paths"]={},B=s["orig.map"]={},E=s.packages=[],G=s["orig.args"]={};avalon.mix(da,{paths:function(b){avalon.mix(x,b);s.paths=l(x)},map:function(b){avalon.mix(B,b);b=l(B,1,1);avalon.each(b,function(b,c){c.val=l(c.val)});s.map=b},packages:function(b){b=b.concat(E);for(var c={},d=[],e=0,f;f=b[e++];){f="string"===typeof f?{name:f}:f;var g=f.name;if(!c[g]){var h=f.location?f.location:D(g,
112
- f.main||"main"),h=h.replace(/\.js$/i,"");d.push(f);c[g]=f.location=h;f.reg=RegExp("^"+g+"(/|$)")}}s.packages=d.sort()},urlArgs:function(b){"string"===typeof b&&(b={"*":b});avalon.mix(G,b);s.urlArgs=l(G,1)},baseUrl:function(b){if(!/^(?:[a-z]+:)?\/\//i.test(String(b))){var c=F.getElementsByTagName("base")[0];c&&F.removeChild(c);var d=p.createElement("a");d.href=b;b="1"[0]?d.href:d.getAttribute("href",4);c&&F.insertBefore(c,F.firstChild)}s.baseUrl=b},shim:function(b){for(var c in b){var d=b[c];Array.isArray(d)&&
113
- (d=b[c]={deps:d});if(!d.exportsFn&&(d.exports||d.init))d.exportsFn=m(d)}s.shim=b},js:function(b,c){var d=e(b);if(!v[d]){var f=v[d]=n(d);c?C(c.deps||[],function(){var e=avalon.slice(arguments);k(b,d,function(){f.state=2;c.exportsFn&&(f.exports=c.exportsFn.apply(0,e));C.checkDeps()})}):k(b,d)}return d},css:function(b){var c=e(b);if(!p.getElementById(c)){var d=p.createElement("link");d.rel="stylesheet";d.href=b;d.id=c;F.insertBefore(d,F.firstChild)}},text:function(b){var c=e(b);v[c]={};var d=Ka();d.onreadystatechange=
114
- function(){if(4===d.readyState){var e=d.status;399<e&&600>e?avalon.error(b+" \u5bf9\u5e94\u8d44\u6e90\u4e0d\u5b58\u5728\u6216\u6ca1\u6709\u5f00\u542f CORS"):(v[c].state=2,v[c].exports=d.responseText,C.checkDeps())}};d.open("GET",b,!0);"withCredentials"in d&&(d.withCredentials=!0);d.setRequestHeader("X-Requested-With","XMLHttpRequest");d.send();return c}});da.css.ext=".css";da.js.ext=".js";C.checkDeps=d;var H=/(\?[^#]*)$/,I=/\/\w+\/\.\./,A=g(!0);A||(A=p.scripts[p.scripts.length-1].src);A=e(A);s.loaderUrl=
115
- A.slice(0,A.lastIndexOf("/")+1)};var rb=[];"complete"===p.readyState?setTimeout(ba):(p.addEventListener("DOMContentLoaded",ba),t.addEventListener("load",ba));avalon.ready=function(b){C?C(["ready!"],b):ba===z?b(avalon):rb.push(b)};avalon.config({loader:!0});avalon.ready(function(){avalon.scan(p.body)});new function(){function b(b){var c=b.touches&&b.touches.length?b.touches:[b];b=b.changedTouches?b.changedTouches[0]:c[0];return{x:b.clientX,y:b.clientY}}function c(b){avalon(h.element).removeClass(p.activeClass);
116
- h.tapping&&(h.element=null)}var d=navigator.userAgent,e=0<d.indexOf("Android"),f=/iP(ad|hone|od)/.test(d),g=u.on,h={},d=navigator.pointerEnabled,k=navigator.msPointerEnabled,l=function(){var b=f||!1;try{var c=document.createElement("div");c.ontouchstart=function(){b=!0};var d=document.createEvent("TouchEvent");d.initTouchEvent("touchstart",!0,!0);c.dispatchEvent(d)}catch(e){}c=c.ontouchstart=null;return b}(),m=!(!l&&!d&&!k),n=["mousedown","mousemove","mouseup",""];l?n=["touchstart","touchmove","touchend",
117
- "touchcancel"]:d?n=["pointerdown","pointermove","pointerup","pointercancel"]:k&&(n=["MSPointerDown","MSPointerMove","MSPointerUp","MSPointerCancel"]);h={};document.addEventListener(n[1],c);document.addEventListener(n[2],function(d){var e=h.element;if(e){var f=b(d),g=Date.now()-h.startTime,k=Math.abs(h.x-f.x),l=Math.abs(h.y-f.y),m=!1;2===h.doubleIndex&&(h.doubleIndex=0,m=!0);if(30<k||30<l)f=Math.abs(h.x-f.x)>=Math.abs(h.y-f.y)?0<h.x-f.x?"left":"right":0<h.y-f.y?"up":"down",g={direction:f},S(e,"swipe",
118
- g),S(e,"swipe"+f,g);else if(p.canClick(e)){document.activeElement&&document.activeElement!==e&&document.activeElement.blur();var n;"label"===e.tagName.toLowerCase()&&(n=e.htmlFor?document.getElementById(e.htmlFor):null);n?p.focus(n):p.focus(e);avalon.fastclick.fireEvent(e,"click",d);S(e,"tap");n&&(avalon.fastclick.fireEvent(n,"click",d),S(e,"tap"));m&&(250>g&&(avalon.fastclick.fireEvent(e,"dblclick",d),S(e,"doubletap")),h.doubleIndex=0);750<g&&(S(e,"hold"),S(e,"longtap"))}c(d)}});n[3]&&document.addEventListener(n[3],
119
- c);g.clickHook=function(c){function d(e){var f=c.element;avalon.mix(h,b(e));h.startTime=Date.now();h.event=c.param;h.tapping=/click|tap$/.test(h.event);h.element=f;h.element!==f?(h.doubleIndex=1,h.doubleStartTime=Date.now()):h.doubleIndex=h.doubleIndex?2:1;h.tapping&&avalon.fastclick.canClick(f)&&avalon(f).addClass(p.activeClass)}if("click"===c.param?m:1)c.specialBind=function(b,e){b.addEventListener(n[0],d);b.addEventListener(c.param,function(c){("click"===c.type?c.hasFixClick:1)&&e.call(b,c)})},
120
- c.specialUnbind=function(){element.removeEventListener(n[0],d);element.removeEventListener(c.param,wrapCallback)}};var p=avalon.fastclick={activeClass:"ms-click-active",clickDuration:750,dragDistance:10,fireEvent:function(b,c,d){var e=document.createEvent("MouseEvents");e.initMouseEvent(c,!0,!0,t,1,d.screenX,d.screenY,d.clientX,d.clientY,!1,!1,!1,!1,0,null);Object.defineProperty(e,"hasFixClick",{get:function(){return"\u53f8\u5f92\u6b63\u7f8e"}});b.dispatchEvent(e)},focus:function(b){if(this.canFocus(b)){var c=
121
- b.value;b.value=c;f&&b.setSelectionRange&&0!==b.type.indexOf("date")&&"time"!==b.type?(c=c.length,b.setSelectionRange(c,c)):b.focus()}},canClick:function(b){switch(b.nodeName.toLowerCase()){case "textarea":case "select":case "input":return!b.disabled;default:return!0}},canFocus:function(b){switch(b.nodeName.toLowerCase()){case "textarea":return!0;case "select":return!e;case "input":switch(b.type){case "button":case "checkbox":case "file":case "image":case "radio":case "submit":return!1}return!b.disabled&&
122
- !b.readOnly;default:return!1}}};"swipe swipeleft swiperight swipeup swipedown doubletap tap longtap hold".split(" ").forEach(function(b){g[b+"Hook"]=g.clickHook})};"function"===typeof define&&define.amd&&define("avalon",[],function(){return avalon});avalon.noConflict=function(b){b&&t.avalon===avalon&&(t.avalon=avalon);return avalon};void 0===W&&(t.avalon=avalon);return avalon});
1
+ !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(){}function i(e,t){"string"==typeof e&&(e=e.match(bt)||[]);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(e){function t(a,r){return n.push(a)>e&&delete t[n.shift()],t[a]=r}var n=[];return t}function l(){if(e.VBArray){var t=document.documentMode;return t?t:e.XMLHttpRequest?7:6}return 0}function s(e){if(e&&"object"==typeof e){var t=e.length,n=kt.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=dt.createElementNS(Ft,n.tagName.toLowerCase());Tt.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(Et.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(zt,"\\$&")}function d(e,t,n){if(Pt(t)||t&&t.nodeType)return!1;if(-1!==n.indexOf(e))return!1;if(-1!==Kt.indexOf(e))return!1;var a=n.$special;return e&&"$"===e.charAt(0)&&!a[e]?!1:!0}function p(e,t,n,a){switch(e.type){case 0:var r=e.get,i=e.set;if(Pt(i)){var o=a.$events,l=o[t];o[t]=[],i.call(a,n),o[t]=l}return r.call(a);case 1:return n;case 2:if(n!==a.$model[t]){var s=e.svmodel=m(a,t,n,e.valueType);n=s.$model;var c=en[s.$id];c&&c()}return n}}function v(e,t,n){if(Array.isArray(e)){var a=e.concat();e.length=0;var i=g(e);return i.pushArray(a),i}if("number"==typeof e.nodeType)return e;if(e.$id&&e.$events)return e;Array.isArray(e.$skipArray)||(e.$skipArray=[]),e.$skipArray.$special=t||{};var o={};n=n||{};var l={},s={},c=[];for(var u in e)!function(t,a){if(n[t]=a,d(t,a,e.$skipArray)){l[t]=[];var i=avalon.type(a),u=function(e){var t=u._name,n=this,a=n.$model,r=a[t],i=n.$events;return arguments.length?void(yt||(1===u.type||(e=p(u,t,e,n),u.type))&&(on(r,e)||(a[t]=e,i.$digest?u.pedding||(u.pedding=!0,setTimeout(function(){T(i[t]),h(n,t,a[t],r),u.pedding=!1})):(T(i[t]),h(n,t,e,r))))):0===u.type?(e=u.get.call(n),r!==e&&(a[t]=e,i.$digest?u.pedding||(u.pedding=!0,setTimeout(function(){h(n,t,a[t],r),u.pedding=!1})):h(n,t,e,r)),e):($(i[t]),u.svmodel||r)};"object"===i&&Pt(a.get)&&Object.keys(a).length<=2?(u.set=a.set,u.get=a.get,u.type=0,c.push(function(){var e={evaluator:function(){e.type=Math.random(),e.element=null,n[t]=u.get.call(o)},element:pt,type:Math.random(),handler:r,args:[]};Mt[ft]=e,u.call(o),delete Mt[ft]})):xt.test(i)?(u.type=2,u.valueType=i,c.push(function(){var e=v(a,0,n[t]);u.svmodel=e,e.$events[ht]=l[t]})):u.type=1,u._name=t,s[t]=u}}(u,e[u]);Kt.forEach(function(t){delete e[t],delete n[t]}),o=an(o,ln(s),e);for(var f in e)s[f]||(o[f]=e[f]);o.$id=jt(),o.$model=n,o.$events=l;for(u in Zt){var m=Zt[u];Ot||(m=m.bind(o)),o[u]=m}return nn?Object.defineProperty(o,"hasOwnProperty",{value:function(e){return e in this.$model},writable:!1,enumerable:!1,configurable:!0}):o.hasOwnProperty=function(e){return e in o.$model},c.forEach(function(e){e()}),o}function h(e,t,n,a){e.$events&&Zt.$fire.call(e,t,n,a)}function m(e,t,n,a){var r=e[t];if("array"===a)return Array.isArray(n)&&r!==n?(r._.$unwatch(),r.clear(),r._.$watch(),r.pushArray(n.concat()),r):r;var i=e.$events[t],o=r.$events.$withProxyPool;o&&(lt(o,"with"),r.$events.$withProxyPool=null);var l=v(n);return l.$events[ht]=i,en[l.$id]=function(e){for(;e=i.shift();)!function(e){avalon.nextTick(function(){e.type&&(e.rollback&&e.rollback(),It[e.type](e,e.vmodels))})}(e);delete en[l.$id]},l}function g(e){var t=[];t.$id=jt(),t.$model=e,t.$events={},t.$events[ht]=[],t._=v({length:e.length}),t._.$watch("length",function(e,n){t.$fire("length",e,n)});for(var n in Zt)t[n]=Zt[n];return avalon.mix(t,cn),t}function y(e,t,n,a,r,i,o){for(var l=this.length,s=2;--s;){switch(e){case"add":var c=this.$model.slice(t,t+n).map(function(e){return xt.test(avalon.type(e))?e.$id?e:v(e,0,e):e});sn.apply(this,[t,0].concat(c)),this._fire("add",t,n);break;case"del":var u=this._splice(t,n);this._fire("del",t,n)}r&&(e=r,t=i,n=o,s=2,r=0)}return this._fire("index",a),this.length!==l&&(this._.length=this.length),u}function b(e,t){for(var n={},a=0,r=t.length;r>a;a++){n[a]=e[a];var i=t[a];i in n?(e[a]=n[i],delete n[i]):e[a]=e[i]}}function x(e){Mt[ft]=e,avalon.openComputedCollect=!0;var t=e.evaluator;if(t)try{var n=un.test(e.type)?e:t.apply(0,e.args);e.handler(n,e.element,e)}catch(a){delete e.evaluator;var r=e.element;if(3===r.nodeType){var i=r.parentNode;u.commentInterpolate?i.replaceChild(dt.createComment(e.value),r):r.data=Ut+e.value+Vt}}avalon.openComputedCollect=!1,delete Mt[ft]}function $(e){var t=Mt[ft];e&&t&&avalon.Array.ensure(e,t)&&t.element&&w(t,e)}function w(e,t){e.$uuid=e.$uuid||jt(),t.$uuid=t.$uuid||jt();var n={data:e,list:t,$$uuid:e.$uuid+t.$uuid};fn[n.$$uuid]||(fn[n.$$uuid]=1,fn.push(n))}function C(e){e.element=null,e.rollback&&e.rollback();for(var t in e)e[t]=null}function E(e){try{if(!e.parentNode)return!0}catch(t){return!0}return e.msRetain?0:1===e.nodeType?"number"==typeof e.sourceIndex?0===e.sourceIndex:!Nt.contains(e):!avalon.contains(Nt,e)}function k(){for(var e,t=fn.length,n=t,a=0,r=[],i={},o={};e=fn[--t];){var l=e.data,s=l.type;i[s]?i[s]++:(i[s]=1,r.push(s))}var c=!1;if(r.forEach(function(e){pn[e]!==i[e]&&(o[e]=1,c=!0)}),t=n,c)for(;e=fn[--t];)l=e.data,void 0!==l.element&&o[l.type]&&E(l.element)&&(a++,fn.splice(t,1),delete fn[e.$$uuid],avalon.Array.remove(e.list,l),C(l),e.data=e.list=null);pn=i,dn=new Date}function T(e){if(e&&e.length){new Date-dn>444&&"object"==typeof e[0]&&k();for(var t,n=At.call(arguments,1),a=e.length;t=e[--a];){var i=t.element;if(i&&i.parentNode)if(t.$repeat)t.handler.apply(t,n);else if("on"!==t.type){var o=t.evaluator||r;t.handler(o.apply(0,t.args||[]),i,t)}}}}function A(e,t,n){var a=setTimeout(function(){var r=e.innerHTML;clearTimeout(a),r===n?t():A(e,t,r)})}function M(e,t){var n=e.getAttribute("avalonctrl")||t.$id;e.setAttribute("avalonctrl",n),t.$events.expr=e.tagName+'[avalonctrl="'+n+'"]'}function O(e,t){for(var n,a=0;n=e[a++];)n.vmodels=t,It[n.type](n,t),n.evaluator&&n.element&&1===n.element.nodeType&&n.element.removeAttribute(n.name);e.length=0}function N(e,t){return e.priority-t.priority}function L(e,t){for(var a,r,i=e.hasAttributes()?avalon.slice(e.attributes):[],o=[],l={},s=0;r=i[s++];)if(r.specified&&(a=r.name.match(wn))){var c=a[1],u=a[2]||"",f=r.value,d=r.name;if(l[d]=f,En[c]?(u=c,c="on"):kn[c]&&(n("ms-"+c+"已经被废弃,请使用ms-attr-*代替"),"enabled"===c&&(c="disabled",f="!("+f+")"),u=c,c="attr",e.removeAttribute(d),d="ms-attr-"+u,e.setAttribute(d,f),a=[d],l[d]=f),"function"==typeof It[c]){var p={type:c,param:u,element:e,name:a[0],value:f,priority:c in Cn?Cn[c]:10*c.charCodeAt(0)+(Number(u)||0)};if("html"===c||"text"===c){var v=P(f);avalon.mix(p,v),p.filters=p.filters.replace(Mn,function(){return p.type="html",p.group=1,""})}"ms-if-loop"===d&&(p.priority+=100),t.length&&(o.push(p),"widget"===c&&(e.msData=e.msData||l))}}l["ms-attr-checked"]&&l["ms-duplex"]&&n("warning!一个元素上不能同时定义ms-attr-checked与ms-duplex"),o.sort(N);var h=!0;for(s=0;p=o[s];s++){if(c=p.type,Tn.test(c))return O(o.slice(0,s+1),t);h&&(h=!An.test(c))}O(o,t),h&&!bn[e.tagName]&&Xt.test(e.innerHTML+e.textContent)&&($n&&$n(e),S(e,t))}function S(e,t){for(var n=e.firstChild;n;){var a=n.nextSibling;j(n,n.nodeType,t),n=a}}function H(e,t){for(var n,a=0;n=e[a++];)j(n,n.nodeType,t)}function j(e,t,n){1===t?D(e,n):3===t&&qt.test(e.data)?R(e,n):u.commentInterpolate&&8===t&&!qt.test(e.nodeValue)&&R(e,n)}function D(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),M(e,o)}L(e,t)}}function P(e){if(e.indexOf("|")>0){var t=e.replace(rstringLiteral,function(e){return Math.pow(10,e.length)}),n=t.replace(On,"ᄢ㍄").indexOf("|");if(n>-1)return{filters:e.slice(n),value:e.slice(0,n),expr:!0}}return{value:e,filters:"",expr:!0}}function I(e){for(var t,n,a=[],r=0;;){if(n=e.indexOf(Ut,r),-1===n)break;if(t=e.slice(r,n),t&&a.push({value:t,filters:"",expr:!1}),r=n+Ut.length,n=e.indexOf(Vt,r),-1===n)break;t=e.slice(r,n),t&&a.push(P(t)),r=n+Vt.length}return t=e.slice(r),t&&a.push({value:t,expr:!1,filters:""}),a}function R(e,t){var n=[];if(8===e.nodeType)var a=P(e.nodeValue),r=[a];else r=I(e.data);if(r.length){for(var i=0;a=r[i++];){var o=dt.createTextNode(a.value);a.expr&&(a.type="text",a.element=o,a.filters=a.filters.replace(Mn,function(){return a.type="html",a.group=1,""}),n.push(a)),Lt.appendChild(o)}e.parentNode.replaceChild(Lt,e),n.length&&O(n,t)}}function F(e){return e.replace(/([a-z\d])([A-Z]+)/g,"$1-$2").toLowerCase()}function B(e){return e.indexOf("-")<0&&e.indexOf("_")<0?e:e.replace(/[-_][^-_]/g,function(e){return e.charAt(1).toUpperCase()})}function _(e){try{if("object"==typeof e)return e;e="true"===e?!0:"false"===e?!1:"null"===e?null:+e+""===e?+e:Nn.test(e)?JSON.parse(e):e}catch(t){}return e}function U(e){return e.window&&e.document?e:9===e.nodeType?e.defaultView:!1}function V(e,t){if(e.offsetWidth<=0){var n=getComputedStyle(e,null);if(Dn.test(n.display)){var a={node:e};for(var r in jn)a[r]=n[r],e.style[r]=jn[r];t.push(a)}var i=e.parentNode;i&&1===i.nodeType&&V(i,t)}}function q(e){var t=e.tagName.toLowerCase();return"input"===t&&/checkbox|radio/.test(e.type)?"checked":t}function W(e,t,n,a){for(var r,i=[],o=" = "+n+".",l=e.length;r=e[--l];)t.hasOwnProperty(r)&&(i.push(r+o+r),a.vars.push(r),"duplex"===a.type&&(e.get=n+"."+r),e.splice(l,1));return i}function X(e){for(var t=[],n={},a=0;a<e.length;a++){var r=e[a],i=r&&"string"==typeof r.$id?r.$id:r;n[i]||(n[i]=t.push(r))}return t}function z(e,t){return t=t.replace(Gn,"").replace(Zn,function(){return"],|"}).replace(Jn,function(e,t){return"["+In(t)}).replace(Qn,function(){return'"],["'}).replace(Kn,function(){return'",'})+"]","return avalon.filters.$filter("+e+", "+t+")"}function Y(e,t,a){var i=a.type,o=a.filters||"",l=t.map(function(e){return String(e.$id).replace(Yn,"$1")})+e+i+o,s=Wn(e).concat(),c=[],u=[],f=[],d="";t=X(t),a.vars=[];for(var p=0,v=t.length;v>p;p++)if(s.length){var h="vm"+ft+"_"+p;u.push(h),f.push(t[p]),c.push.apply(c,W(s,t[p],h,a))}if(c.length||"duplex"!==i){"duplex"!==i&&(e.indexOf("||")>-1||e.indexOf("&&")>-1)&&a.vars.forEach(function(t){var n=new RegExp("\\b"+t+"(?:\\.\\w+|\\[\\w+\\])+","ig");e=e.replace(n,function(n){var a=n.charAt(t.length),r=Dt?e.slice(arguments[1]+n.length):RegExp.rightContext,i=/^\s*\(/.test(r);if("."===a||"["===a||i){var o="var"+String(Math.random()).replace(/^0\./,"");if(i){var l=n.split(".");if(l.length>2){var s=l.pop();return c.push(o+" = "+l.join(".")),o+"."+s}return n}return c.push(o+" = "+n),o}return n})}),a.args=f;var m=Xn[l];if(m)return void(a.evaluator=m);if(d=c.join(", "),d&&(d="var "+d),/\S/.test(o)){if(!/text|html/.test(a.type))throw Error("ms-"+a.type+"不支持过滤器");e="\nvar ret"+ft+" = "+e+";\r\n",e+=z("ret"+ft,o)}else{if("duplex"===i){var g="'use strict';\nreturn function(vvv){\n "+d+";\n if(!arguments.length){\n return "+e+"\n }\n "+(zn.test(e)?e:s.get)+"= vvv;\n} ";try{m=Function.apply(r,u.concat(g)),a.evaluator=Xn(l,m)}catch(y){n("debug: parse error,"+y.message)}return}if("on"===i){-1===e.indexOf("(")?e+=".call(this, $event)":e=e.replace("(",".call(this,"),u.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+";"}try{m=Function.apply(r,u.concat("'use strict';\n"+d+e)),a.evaluator=Xn(l,m)}catch(y){n("debug: parse error,"+y.message)}finally{s=textBuffer=u=null}}}function G(e,t,n,a,r){Array.isArray(a)&&(e=a.map(function(e){return e.expr?"("+e.value+")":In(e.value)}).join(" + ")),Y(e,t,n),n.evaluator&&!r&&(n.handler=Rt[n.handlerName||n.type],x(n))}function Z(e){return null==e?"":e}function J(e,t,n){return t.param.replace(/\w+/g,function(a){var r=avalon.duplexHooks[a];r&&"function"==typeof r[n]&&(e=r[n](e,t))}),e}function Q(e,t,n){var a=dt.createEvent("Events");a.initEvent(t,!0,!0),a.fireByAvalon=!0,n&&(a.detail=n),e.dispatchEvent(a)}function K(){for(var e=ua.length-1;e>=0;e--){var t=ua[e];t()===!1&&ua.splice(e,1)}ua.length||clearInterval(ca)}function et(e,t,n,a){var r=e.template.cloneNode(!0),i=avalon.slice(r.childNodes);n.$stamp&&r.insertBefore(n.$stamp,r.firstChild),t.appendChild(r);var o=[n].concat(e.vmodels),l={nodes:i,vmodels:o};a.push(l)}function tt(e,t){var n=e.proxies[t];return n?n.$stamp:e.element}function nt(e,t,n){for(;;){var a=t.previousSibling;if(!a)break;if(a.parentNode.removeChild(a),n&&n.call(a),a===e)break}}function at(e){var t={$host:[],$outer:{},$stamp:1,$index:0,$first:!1,$last:!1,$remove:avalon.noop};t[e]={get:function(){return this.$host[this.$index]},set:function(e){this.$host.set(this.$index,e)}};var n={$last:1,$first:1,$index:1},a=v(t,n),r=a.$events;return r[e]=r.$first=r.$last=r.$index,a.$id=jt("$proxy$each"),a}function rt(e,t){for(var n,a=t.param||"el",r=0,i=pa.length;i>r;r++){var o=pa[r];o&&o.hasOwnProperty(a)&&(n=o,pa.splice(r,1))}n||(n=at(a));var l=t.$repeat,s=l.length-1;return n.$index=e,n.$first=0===e,n.$last=e===s,n.$host=l,n.$outer=t.$outer,n.$stamp=t.clone.cloneNode(!1),n.$remove=function(){return l.removeAt(n.$index)},n}function it(){var e=v({$key:"",$outer:{},$host:{},$val:{get:function(){return this.$host[this.$key]},set:function(e){this.$host[this.$key]=e}}},{$val:1});return e.$id=jt("$proxy$with"),e}function ot(e,t){var n=va.pop();n||(n=it());var a=t.$repeat;return n.$key=e,n.$host=a,n.$outer=t.$outer,a.$events?n.$events.$val=a.$events[e]:n.$events={},n}function lt(e,t){var n="each"===t?pa:va;avalon.each(e,function(e,t){if(t.$events){for(var a in t.$events)Array.isArray(t.$events[a])&&(t.$events[a].forEach(function(e){"object"==typeof e&&C(e)}),t.$events[a].length=0);t.$host=t.$outer={},n.unshift(t)>u.maxRepeatSize&&n.pop()}}),"each"===t&&(e.length=0)}function st(e,t){var n="_"+e;if(!st[n]){var a=dt.createElement(e);Nt.appendChild(a),t=Ot?getComputedStyle(a,null).display:a.currentStyle.display,Nt.removeChild(a),st[n]=t}return st[n]}function ct(e,t,n,a){e=(e+"").replace(/[^0-9+\-Ee.]/g,"");var r=isFinite(+e)?+e:0,i=isFinite(+t)?Math.abs(t):0,o="undefined"==typeof a?",":a,l="undefined"==typeof n?".":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<i&&(s[1]=s[1]||"",s[1]+=new Array(i-s[1].length+1).join("0")),s.join(l)}function ut(){Yt&&(Ca["domReady!"].state=4,Yt.checkDeps()),Ea.forEach(function(e){e(avalon)}),ut=r}var ft=Date.now(),dt=e.document,pt=dt.head;pt.insertAdjacentHTML("afterBegin",'<avalon ms-skip class="avalonHide"><style id="avalonStyle">.avalonHide{ display: none!important }</style></avalon>');var vt=pt.firstChild,ht="$"+ft,mt=e.require,gt=e.define,yt=!1,bt=/[^, ]+/g,xt=/^(?:object|array)$/,$t=/^\[object SVG\w*Element\]$/,wt=/^\[object (?:Window|DOMWindow|global)\]$/,Ct=Object.prototype,Et=Ct.hasOwnProperty,kt=Ct.toString,Tt=Array.prototype,At=Tt.slice,Mt={},Ot=e.dispatchEvent,Nt=dt.documentElement,Lt=dt.createDocumentFragment(),St=dt.createElement("div"),Ht={};"Boolean Number String Function Array Date RegExp Object Error".replace(bt,function(e){Ht["[object "+e+"]"]=e.toLowerCase()});var jt=function(e){return e=e||"avalon",(e+Math.random()+Math.random()).replace(/0\./g,"")},Dt=l();avalon=function(e){return new avalon.init(e)},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?Ht[kt.call(e)]||"object":typeof e};var Pt=function(e){return"[object Function]"===kt.call(e)};avalon.isFunction=Pt,avalon.isWindow=function(e){return wt.test(kt.call(e))},avalon.isPlainObject=function(e){return"[object Object]"===kt.call(e)&&Object.getPrototypeOf(e)===Ct},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||Pt(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:bt,subscribers:ht,version:1.391,ui:{},log:n,slice:function(e,t,n){return At.call(e,t,n)},noop:r,error:function(e,t){throw new(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);++a<r;)i[a]=e,e+=n;return i},eventHooks:{},bind:function(e,t,n,a){var r=avalon.eventHooks,i=r[t];return"object"==typeof i&&(t=i.type,i.deel&&(n=i.deel(e,t,n,!0))),n.unbind||e.addEventListener(t,n,!!a),n},unbind:function(e,t,n,a){var i=avalon.eventHooks,o=i[t],l=n||r;"object"==typeof o&&(t=o.type,o.deel&&(n=o.deel(e,t,n,!1))),e.removeEventListener(t,l,!!a)},css:function(e,t,n){e instanceof avalon&&(e=e[0]);var a,r=/[_-]/.test(t)?B(t):t;if(t=avalon.cssName(r)||r,void 0===n||"boolean"==typeof n){a=Ln[r+":get"]||Ln["@:get"],"background"===t&&(t="backgroundColor");var i=a(e,t);return n===!0?parseFloat(i)||0:i}if(""===n)e.style[t]="";else{if(null==n||n!==n)return;isFinite(n)&&!avalon.cssNumber[r]&&(n+="px"),a=Ln[r+":set"]||Ln["@:set"],a(e,t,n)}},each:function(e,t){if(e){var n=0;if(s(e))for(var a=e.length;a>n&&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 It=avalon.bindingHandlers={},Rt=avalon.bindingExecutors={};if(avalon.nextTick=e.setImmediate?setImmediate.bind(e):function(e){setTimeout(e,0)},Nt.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 Ft="http://www.w3.org/2000/svg",Bt=dt.createElementNS(Ft,"svg");Bt.innerHTML='<circle cx="50" cy="50" r="40" fill="red" />',$t.test(Bt.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=dt.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("</"+this.nodeName+">$","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 _t=avalon.eventHooks;"onmouseenter"in Nt||avalon.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){_t[e]={type:t,deel: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]&&!_t.animationend&&(_t.animationend={type:n})}),void 0===dt.onmousewheel&&(_t.mousewheel={type:"wheel",deel: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 Ut,Vt,qt,Wt,Xt,zt=/[-.*+?^${}()|[\]\/\\]/g,Yt=r,Gt={loader:function(t){e.define=t?Yt.define:gt,e.require=t?Yt:mt},interpolate:function(e){if(Ut=e[0],Vt=e[1],Ut===Vt)throw new SyntaxError("openTag!==closeTag");if(e+""=="<!--,-->")u.commentInterpolate=!0;else{var t=Ut+"test"+Vt;if(St.innerHTML=t,St.innerHTML!==t&&St.innerHTML.indexOf("&lt;")>-1)throw new SyntaxError("此定界符不合法");St.innerHTML=""}var n=f(Ut),a=f(Vt);qt=new RegExp(n+"(.*?)"+a),Wt=new RegExp(n+"(.*?)"+a,"g"),Xt=new RegExp(n+".*?"+a+"|\\sms-")}};u.debug=!0,u.plugins=Gt,u.plugins.interpolate(["{{","}}"]),u.paths={},u.shim={},u.maxRepeatSize=100,avalon.config=u;var Zt={$watch:function(e,t){if("function"==typeof t){var n=this.$events[e];n?n.push(t):this.$events[e]=[t]}else this.$events=this.$watch.backup;return this},$unwatch:function(e,t){var n=arguments.length;if(0===n)this.$watch.backup=this.$events,this.$events={};else if(1===n)this.$events[e]=[];else for(var a=this.$events[e]||[],r=a.length;~--r<0;)if(a[r]===t)return a.splice(r,1);return this},$fire:function(e){var t,n,a,r;/^(\w+)!(\S+)$/.test(e)&&(t=RegExp.$1,e=RegExp.$2);var i=this.$events,o=At.call(arguments,1),l=[e].concat(o);if("all"===t)for(n in avalon.vmodels)a=avalon.vmodels[n],a!==this&&a.$fire.apply(a,l);else if("up"===t||"down"===t){var s=i.expr?Jt(i.expr):[];if(0===s.length)return;for(n in avalon.vmodels)if(a=avalon.vmodels[n],a!==this&&a.$events.expr){var c=Jt(a.$events.expr);if(0===c.length)continue;Array.prototype.forEach.call(c,function(e){Array.prototype.forEach.call(s,function(n){var r="down"===t?n.contains(e):e.contains(n);r&&(e._avalon=a)})})}var u=dt.getElementsByTagName("*"),f=[];for(Array.prototype.forEach.call(u,function(e){e._avalon&&(f.push(e._avalon),e._avalon="",e.removeAttribute("_avalon"))}),"up"===t&&f.reverse(),n=0;(r=f[n++])&&r.$fire.apply(r,l)!==!1;);}else{var d=i[e]||[],p=i.$all||[];for(n=0;r=d[n++];)Pt(r)&&r.apply(this,o);for(n=0;r=p[n++];)Pt(r)&&r.apply(this,arguments)}}},Jt=function(e){return dt.querySelectorAll(e)},Qt=avalon.vmodels={};avalon.define=function(e,t){var a=e.$id||e;if(a||n("warning: vm必须指定$id"),Qt[a]&&n("warning: "+a+" 已经存在于avalon.vmodels中"),"object"==typeof e)var i=v(e);else{var o={$watch:r};t(o),i=v(o),yt=!0,t(i),yt=!1}return i.$id=a,Qt[a]=i};var Kt=String("$id,$watch,$unwatch,$fire,$events,$model,$skipArray").match(bt),en={},tn=Object.defineProperty,nn=!0;try{tn({},"_",{value:"x"});var an=Object.defineProperties}catch(rn){nn=!1}var on=Object.is||function(e,t){return 0===e&&0===t?1/e===1/t:e!==e?t!==t:e===t},ln=Ot?function(e){var t={};for(var n in e)t[n]={get:e[n],set:e[n],enumerable:!0,configurable:!0};return t}:function(e){return e},sn=Tt.splice,cn={_splice:sn,_fire:function(e,t,n){T(this.$events[ht],e,t,n)},size:function(){return this._.length},pushArray:function(e){var t=e.length,n=this.length;return t&&(Tt.push.apply(this.$model,e),y.call(this,"add",n,t,n)),t+n},push:function(){var e,t=[],n=arguments.length;for(e=0;n>e;e++)t[e]=arguments[e];return this.pushArray(arguments)},unshift:function(){var e=arguments.length,t=this.length;return e&&(Tt.unshift.apply(this.$model,arguments),y.call(this,"add",0,e,0)),e+t},shift:function(){if(this.length){var e=this.$model.shift();return y.call(this,"del",0,1,0),e}},pop:function(){var e=this.length;if(e){var t=this.$model.pop();return y.call(this,"del",e-1,1,Math.max(0,e-2)),t}},splice:function(e){var t,n=arguments.length,a=[],r=sn.apply(this.$model,arguments);return r.length&&(a.push("del",e,r.length,0),t=!0),n>2&&(t?a.splice(3,1,0,"add",e,n-2):a.push("add",e,n-2,0),t=!0),t?y.apply(this,a):[]},contains:function(e){return-1!==this.indexOf(e)},remove:function(e){return this.removeAt(this.indexOf(e))},removeAt:function(e){return e>=0?(this.$model.splice(e,1),y.call(this,"del",e,1,0)):[]},clear:function(){return this.$model.length=this.length=this._.length=0,this._fire("clear",0),this},removeAll:function(e){if(Array.isArray(e))e.forEach(function(e){this.remove(e)},this);else if("function"==typeof e)for(var t=this.length-1;t>=0;t--){var n=this[t];e(n,t)&&this.removeAt(t)}else this.clear()},ensure:function(e){return this.contains(e)||this.push(e),this},set:function(e,t){if(e>=0){var n=avalon.type(t);t&&t.$model&&(t=t.$model);var a=this[e];if("object"===n)for(var r in t)a.hasOwnProperty(r)&&(a[r]=t[r]);else"array"===n?a.clear().push.apply(a,t):a!==t&&(this[e]=t,this.$model[e]=t,this._fire("set",e,t))}return this}};"sort,reverse".replace(bt,function(e){cn[e]=function(){var t,n=this.$model,a=n.concat(),r=Math.random(),i=[];Tt[e].apply(n,arguments);for(var o=0,l=a.length;l>o;o++){var s=n[o],c=a[o];if(on(s,c))i.push(o);else{var u=a.indexOf(s);i.push(u),a[u]=r,t=!0}}return t&&(b(this,i),this._fire("move",i),this._fire("index",0)),this}});var un=/^(duplex|on)$/,fn=avalon.$$subscribers=[],dn=new Date,pn={},vn=new function(){avalon.mix(this,{option:dt.createElement("select"),thead:dt.createElement("table"),td:dt.createElement("tr"),area:dt.createElement("map"),tr:dt.createElement("tbody"),col:dt.createElement("colgroup"),legend:dt.createElement("fieldset"),_default:dt.createElement("div"),g:dt.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(bt,function(e){vn[e]=vn.g});var hn=/<([\w:]+)/,mn=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,gn=i(["","text/javascript","text/ecmascript","application/ecmascript","application/javascript"]),yn=dt.createElement("script");avalon.parseHTML=function(e){if("string"!=typeof e)return dt.createDocumentFragment();e=e.replace(mn,"<$1></$2>").trim();var t,n=(hn.exec(e)||["",""])[1].toLowerCase(),a=vn[n]||vn._default,r=Lt.cloneNode(!1);a.innerHTML=e;var i=a.getElementsByTagName("script");if(i.length)for(var o,l=0;o=i[l++];)if(gn[o.type]){var s=yn.cloneNode(!1);Tt.forEach.call(o.attributes,function(e){s.setAttribute(e.name,e.value)}),s.text=o.text,o.parentNode.replaceChild(s,o)}for(;t=a.firstChild;)r.appendChild(t);return r},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},avalon.scan=function(e,t){e=e||Nt;var n=t?[].concat(t):[];D(e,n)};var bn=i("area,base,basefont,br,col,command,embed,hr,img,input,link,meta,param,source,track,wbr,noscript,script,style,textarea".toUpperCase()),xn=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]},$n=Dt&&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,wn=/ms-(\w+)-?(.*)/,Cn={"if":10,repeat:90,data:100,widget:110,each:1400,"with":1500,duplex:2e3,on:3e3},En=i("animationend,blur,change,input,click,dblclick,focus,keydown,keypress,keyup,mousedown,mouseenter,mouseleave,mousemove,mouseout,mouseover,mouseup,scan,scroll,submit"),kn=i("value,title,alt,checked,selected,disabled,readonly,enabled"),Tn=/^if|widget|repeat$/,An=/^each|with|html|include$/,Mn=/\|\s*html\s*/,On=/\|\|/g;rstringLiteral=/(['"])(\\\1|.)+?\1/g,"add,remove".replace(bt,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=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-"+F(e||""),arguments.length){case 2:return this.attr(e,t),this;case 1:var n=this.attr(e);return _(n);case 0:var a={};return Tt.forEach.call(this[0].attributes,function(t){t&&(e=t.name,e.indexOf("data-")||(e=B(e.slice(5)),a[e]=_(t.value)))}),a}},removeData:function(e){return e="data-"+F(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)),{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)},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=Pn[q(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}}),Nt.dataset&&(avalon.fn.data=function(e,t){var n=this[0].dataset;switch(arguments.length){case 2:return n[e]=t,this;case 1:return t=n[e],_(t);case 0:var a={};for(var e in n)a[e]=_(n[e]);return a}});var Nn=/(?:\{[\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=U(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?r[t]:a[e]}});var Ln=avalon.cssHooks={},Sn=["","-webkit-","-moz-","-ms-"],Hn={"float":"cssFloat"};avalon.cssNumber=i("columnCount,order,fillOpacity,fontWeight,lineHeight,opacity,orphans,widows,zIndex,zoom"),avalon.cssName=function(e,t,n){if(Hn[e])return Hn[e];t=t||Nt.style;for(var a=0,r=Sn.length;r>a;a++)if(n=B(Sn[a]+e),n in t)return Hn[e]=n;return null},Ln["@:set"]=function(e,t,n){e.style[t]=n},Ln["@: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},Ln["opacity:get"]=function(e){var t=Ln["@:get"](e,"opacity");return""===t?"1":t},"top,left".replace(bt,function(e){Ln[e+":get"]=function(t){var n=Ln["@:get"](t,e);return/px$/.test(n)?n:avalon(t).position()[e]+"px"}});var jn={position:"absolute",visibility:"hidden",display:"block"},Dn=/^(none|table(?!-c[ea]).+)/;"Width,Height".replace(bt,function(e){var t=e.toLowerCase(),n="client"+e,a="scroll"+e,r="offset"+e;Ln[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)},Ln[t+"&get"]=function(e){var n=[];V(e,n);for(var a,r=Ln[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 Ln[t+"&get"](o)}return this.css(t,i)},avalon.fn["inner"+e]=function(){return Ln[t+":get"](this[0],void 0,-2)},avalon.fn["outer"+e]=function(e){return Ln[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.documentElement,r=n.defaultView;return a.contains(e)?(void 0!==e.getBoundingClientRect&&(t=e.getBoundingClientRect()),{top:t.top+r.pageYOffset-a.clientTop,left:t.left+r.pageXOffset-a.clientLeft}):t
2
+ };var Pn={"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=JSON.stringify,Rn="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",Fn=/\/\*[\w\W]*?\*\/|\/\/[^\n]*\n|\/\/[^\n]*$|"(?:[^"\\]|\\[\w\W])*"|'(?:[^'\\]|\\[\w\W])*'|[\s\t\n]*\.[\s\t\n]*[$\w\.]+/g,Bn=/[^\w$]+/g,_n=new RegExp(["\\b"+Rn.replace(/,/g,"\\b|\\b")+"\\b"].join("|"),"g"),Un=/\b\d[^,]*/g,Vn=/^,+|,+$/g,qn=o(512),Wn=function(e){var t=","+e.trim();if(qn[t])return qn[t];var n=e.replace(Fn,"").replace(Bn,",").replace(_n,"").replace(Un,"").replace(Vn,"").split(/^$|,+/);return qn(t,X(n))},Xn=o(128),zn=/\w\[.*\]|\w\.\w/,Yn=/(\$proxy\$[a-z]+)\d+$/,Gn=/\)\s*$/,Zn=/\)\s*\|/g,Jn=/\|\s*([$\w]+)/g,Qn=/"\s*\["/g,Kn=/"\s*\(/g;avalon.parseExprProxy=G;var ea="autofocus,autoplay,async,allowTransparency,checked,controls,declare,disabled,defer,defaultChecked,defaultSelectedcontentEditable,isMap,loop,multiple,noHref,noResize,noShade,open,readOnly,selected",ta={};ea.replace(bt,function(e){ta[e.toLowerCase()]=e});var na={"accept-charset":"acceptCharset","char":"ch",charoff:"chOff","class":"className","for":"htmlFor","http-equiv":"httpEquiv"},aa="accessKey,bgColor,cellPadding,cellSpacing,codeBase,codeType,colSpan,dateTime,defaultValue,frameBorder,longDesc,maxLength,marginWidth,marginHeight,rowSpan,tabIndex,useMap,vSpace,valueType,vAlign";aa.replace(bt,function(e){na[e.toLowerCase()]=e});var ra=/<noscript.*?>(?:[\s\S]+?)<\/noscript>/gim,ia=/<noscript.*?>([\s\S]+?)<\/noscript>/im,oa=function(){return new(e.XMLHttpRequest||ActiveXObject)("Microsoft.XMLHTTP")},la=avalon.templateCache={};It.attr=function(e,t){var n=e.value.trim(),a=!0;if(n.indexOf(Ut)>-1&&n.indexOf(Vt)>2&&(a=!1,qt.test(n)&&""===RegExp.rightContext&&""===RegExp.leftContext&&(a=!0,n=RegExp.$1)),"include"===e.type){var r=e.element;e.includeRendered=xn(r,"data-include-rendered",t),e.includeLoaded=xn(r,"data-include-loaded",t);var i=e.includeReplaced=!!avalon(r).data("includeReplace");e.startInclude=dt.createComment("ms-include"),e.endInclude=dt.createComment("ms-include-end"),i?(e.element=e.startInclude,r.parentNode.insertBefore(e.startInclude,r),r.parentNode.insertBefore(e.endInclude,r.nextSibling)):(r.insertBefore(e.startInclude,r.firstChild),r.appendChild(e.endInclude))}e.handlerName="attr",G(n,t,e,a?0:I(e.value))},Rt.attr=function(t,n,a){var r=a.type,i=a.param;if("css"===r)avalon(n).css(i,t);else if("attr"===r){if(ta[i]){var o=ta[i];if("boolean"==typeof n[o])return n[o]=!!t}var l=t===!1||null===t||void 0===t;if(!Ot&&na[i]&&(i=na[i]),l)return n.removeAttribute(i);var s=$t.test(n)?!1:dt.namespaces&&isVML(n)?!0:i in n.cloneNode(!1);s?n[i]=t:n.setAttribute(i,t)}else if("include"===r&&t){var c=a.vmodels,u=a.includeRendered,f=a.includeLoaded,d=a.includeReplaced,p=d?n.parentNode:n,v=function(e){for(f&&(e=f.apply(p,[e].concat(c))),u&&A(p,function(){u.call(p)},0/0);;){var t=a.startInclude.nextSibling;if(!t||t===a.endInclude)break;p.removeChild(t)}var n=avalon.parseHTML(e),r=avalon.slice(n.childNodes);p.insertBefore(n,a.endInclude),H(r,c)};if("src"===a.param)if(la[t])avalon.nextTick(function(){v(la[t])});else{var h=oa();h.onreadystatechange=function(){if(4===h.readyState){var e=h.status;(e>=200&&300>e||304===e||1223===e)&&v(la[t]=h.responseText)}},h.open("GET",t,!0),"withCredentials"in h&&(h.withCredentials=!0),h.setRequestHeader("X-Requested-With","XMLHttpRequest"),h.send(null)}else{var m=t&&1===t.nodeType?t:dt.getElementById(t);if(m){if("NOSCRIPT"===m.tagName&&!m.innerHTML&&!m.fixIE78){h=oa(),h.open("GET",location,!1),h.send(null);for(var g=dt.getElementsByTagName("noscript"),y=(h.responseText||"").match(ra)||[],b=y.length,x=0;b>x;x++){var $=g[x];$&&($.style.display="none",$.fixIE78=(y[x].match(ia)||["","&nbsp;"])[1])}}avalon.nextTick(function(){v(m.fixIE78||m.value||m.innerText||m.innerHTML)})}}}else if(Nt.hasAttribute||"string"!=typeof t||"src"!==r&&"href"!==r||(t=t.replace(/&amp;/g,"&")),n[r]=t,e.chrome&&"EMBED"===n.tagName){var w=n.parentNode,C=document.createComment("ms-src");w.replaceChild(C,n),w.replaceChild(n,C)}},"title,alt,src,value,css,include,href".replace(bt,function(e){It[e]=It.attr}),It["class"]=function(e,t){var a,r=e.param,i=e.value;if(e.handlerName="class",!r||isFinite(r)){e.param="";var o=i.replace(Wt,function(e){return e.replace(/./g,"0")}),l=o.indexOf(":");if(-1===l)var s=i;else{if(s=i.slice(0,l),a=i.slice(l+1),Y(a,t,e),!e.evaluator)return n("debug: ms-class '"+(a||"").trim()+"' 不存在于VM中"),!1;e._evaluator=e.evaluator,e._args=e.args}var c=qt.test(s);c||(e.immobileClass=s),G("",t,e,c?I(s):0)}else e.immobileClass=e.oldStyle=e.param,G(i,t,e)},Rt["class"]=function(e,t,n){var a=avalon(t),r=n.type;if("class"===r&&n.oldStyle)a.toggleClass(n.oldStyle,!!e);else switch(n.toggleClass=n._evaluator?!!n._evaluator.apply(t,n._args):!0,n.newClass=n.immobileClass||e,n.oldClass&&n.newClass!==n.oldClass&&a.removeClass(n.oldClass),n.oldClass=n.newClass,r){case"class":a.toggleClass(n.newClass,n.toggleClass);break;case"hover":case"active":if(!n.hasBindEvent){var i="mouseenter",o="mouseleave";if("active"===r){t.tabIndex=t.tabIndex||-1,i="mousedown",o="mouseup";var l=a.bind("mouseleave",function(){n.toggleClass&&a.removeClass(n.newClass)})}var s=a.bind(i,function(){n.toggleClass&&a.addClass(n.newClass)}),c=a.bind(o,function(){n.toggleClass&&a.removeClass(n.newClass)});n.rollback=function(){a.unbind("mouseleave",l),a.unbind(i,s),a.unbind(o,c)},n.hasBindEvent=!0}}},"hover,active".replace(bt,function(e){It[e]=It["class"]}),Rt.data=function(e,t,n){var a="data-"+n.param;e&&"object"==typeof e?t[a]=e:t.setAttribute(a,String(e))};var sa=It.duplex=function(e,t){var a,o=e.element;if(G(e.value,t,e,0,1),e.changed=xn(o,"data-duplex-changed",t)||r,e.evaluator&&e.args){var l=[],s=i("string,number,boolean,checked");"radio"===o.type&&""===e.param&&(e.param="checked"),o.msData&&(o.msData["ms-duplex"]=e.value),e.param.replace(/\w+/g,function(t){/^(checkbox|radio)$/.test(o.type)&&/^(radio|checked)$/.test(t)&&("radio"===t&&n("ms-duplex-radio已经更名为ms-duplex-checked"),t="checked",e.isChecked=!0),"bool"===t?(t="boolean",n("ms-duplex-bool已经更名为ms-duplex-boolean")):"text"===t&&(t="string",n("ms-duplex-text已经更名为ms-duplex-string")),s[t]&&(a=!0),avalon.Array.ensure(l,t)}),a||l.push("string"),e.param=l.join("-"),e.bound=function(t,n){o.addEventListener?o.addEventListener(t,n,!1):o.attachEvent("on"+t,n);var a=e.rollback;e.rollback=function(){o.avalonSetter=null,avalon.unbind(o,t,n),a&&a()}};for(var c in avalon.vmodels){var u=avalon.vmodels[c];u.$fire("avalon-ms-duplex-init",e)}var f=e.pipe||(e.pipe=J);f(null,e,"init");var d=o.tagName;sa[d]&&sa[d](o,e.evaluator.apply(null,e.args),e)}};avalon.duplexHooks={checked:{get:function(e,t){return!t.element.oldValue}},string:{get:function(e){return e},set:Z},"boolean":{get:function(e){return"true"===e},set:Z},number:{get:function(e){return isFinite(e)?parseFloat(e)||0:e},set:Z}};var ca,ua=[];avalon.tick=function(e){1===ua.push(e)&&(ca=setInterval(K,60))};var fa=r;!new function(){function e(e){avalon.contains(Nt,this)&&(t[this.tagName].call(this,e),this.avalonSetter&&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){fa=avalon.tick}},sa.INPUT=function(e,t,a){function r(e){a.changed.call(this,e,a)}function i(){f=!0}function o(){f=!1}function l(){if(!f){var n=e.oldValue=e.value,i=a.pipe(n,a,"get");u.data("duplex-observe")!==!1&&(t(i),r.call(e,i),u.data("duplex-focus")&&avalon.nextTick(function(){e.focus()}))}}var s=e.type,c=a.bound,u=avalon(e),f=!1;if(a.handler=function(){var n=a.pipe(t(),a,"set")+"";n!==e.oldValue&&(e.value=n)},a.isChecked||"radio"===e.type)l=function(){if(u.data("duplex-observe")!==!1){var n=a.pipe(e.value,a,"get");t(n),r.call(e,n)}},a.handler=function(){var n=t(),r=a.isChecked?!!n:n+""===e.value;e.checked=e.oldValue=r},c("click",l);else if("checkbox"===s)l=function(){if(u.data("duplex-observe")!==!1){var i=e.checked?"ensure":"remove",o=t();Array.isArray(o)||(n("ms-duplex应用于checkbox上要对应一个数组"),o=[o]),avalon.Array[i](o,a.pipe(e.value,a,"get")),r.call(e,o)}},a.handler=function(){var n=[].concat(t());e.checked=n.indexOf(a.pipe(e.value,a,"get"))>-1},c("change",l);else{var d=e.getAttribute("data-duplex-event")||e.getAttribute("data-event")||"input";e.attributes["data-event"]&&n("data-event指令已经废弃,请改用data-duplex-event"),d.replace(bt,function(e){switch(e){case"input":c("input",l),c("DOMAutoComplete",l),Dt||(c("compositionstart",i),c("compositionend",o));break;default:c(e,l)}})}/text|password/.test(e.type)&&fa(function(){if(Nt.contains(e))e.value!==e.oldValue&&l();else if(!e.msRetain)return!1}),e.avalonSetter=l,e.oldValue=e.value,x(a),r.call(e,e.value)},sa.TEXTAREA=sa.INPUT,sa.SELECT=function(e,t,a){function r(){if(i.data("duplex-observe")!==!1){var n=i.val();n=Array.isArray(n)?n.map(function(e){return a.pipe(e,a,"get")}):a.pipe(n,a,"get"),n+""!==e.oldValue&&t(n),a.changed.call(e,n,a)}}var i=avalon(e);a.handler=function(){var a=t();a=a&&a.$model||a,Array.isArray(a)?e.multiple||n("ms-duplex在<select multiple=true>上要求对应一个数组"):e.multiple&&n("ms-duplex在<select multiple=false>不能对应一个数组"),a=Array.isArray(a)?a.map(String):a+"",a+""!==e.oldValue&&(i.val(a),e.oldValue=a+"")},a.bound("change",r),A(e,function(){x(a),a.changed.call(e,t(),a)},0/0)},Rt.html=function(e,t,n){e=null==e?"":e;var a="group"in n,r=a?t.parentNode:t;if(r){if(11===e.nodeType)var i=e;else if(1===e.nodeType||e.item){var o=1===e.nodeType?e.childNodes:e.item?e:[];for(i=Lt.cloneNode(!0);o[0];)i.appendChild(o[0])}else i=avalon.parseHTML(e);var l=dt.createComment("ms-html");if(a){r.insertBefore(l,t);for(var s=n.group,c=1;s>c;){var u=t.nextSibling;u&&(r.removeChild(u),c++)}r.removeChild(t),n.element=l}else avalon.clearHTML(r).appendChild(l);a&&(n.group=i.childNodes.length||1),o=avalon.slice(i.childNodes),o[0]&&(l.parentNode&&l.parentNode.replaceChild(i,l),a&&(n.element=o[0])),H(o,n.vmodels)}},It["if"]=It.data=It.text=It.html=function(e,t){G(e.value,t,e)},Rt["if"]=function(e,t,n){if(e)8===t.nodeType&&(t.parentNode.replaceChild(n.template,t),t=n.element=n.template),t.getAttribute(n.name)&&(t.removeAttribute(n.name),L(t,n.vmodels)),n.rollback=null;else if(1===t.nodeType){var a=n.element=dt.createComment("ms-if");t.parentNode.replaceChild(a,t),n.template=t,vt.appendChild(t),n.rollback=function(){t.parentNode===vt&&vt.removeChild(t)}}};var da=/\(([^)]*)\)/;It.on=function(e,t){var n=e.value;e.type="on";var a=e.param.replace(/-\d+$/,"");if("function"==typeof It.on[a+"Hook"]&&It.on[a+"Hook"](e),n.indexOf("(")>0&&n.indexOf(")")>-1){var r=(n.match(da)||["",""])[1].trim();(""===r||"$event"===r)&&(n=n.replace(da,""))}G(n,t,e)},Rt.on=function(e,t,n){e=function(e){var t=n.evaluator||r;return t.apply(this,n.args.concat(e))};var a=n.param.replace(/-\d+$/,"");if("scan"===a)e.call(t,{type:a});else if("function"==typeof n.specialBind)n.specialBind(t,e);else var i=avalon.bind(t,a,e);n.rollback=function(){"function"==typeof n.specialUnbind?n.specialUnbind():avalon.unbind(t,a,i)}},It.repeat=function(e,t){var n=e.type;G(e.value,t,e,0,1),e.proxies=[];var a=!1;try{var r=e.$repeat=e.evaluator.apply(0,e.args||[]),i=avalon.type(r);"object"!==i&&"array"!==i&&(a=!0,avalon.log("warning:"+e.value+"对应类型不正确"))}catch(o){a=!0,avalon.log("warning:"+e.value+"编译出错")}var l=e.value.split(".")||[];if(l.length>1){l.pop();for(var s,c=l[0],u=0;s=t[u++];)if(s&&s.hasOwnProperty(c)){var f=s[c].$events||{};f[ht]=f[ht]||[],f[ht].push(e);break}}var d=e.element;d.removeAttribute(e.name),e.sortedCallback=xn(d,"data-with-sorted",t),e.renderedCallback=xn(d,"data-"+n+"-rendered",t);var p=jt(n),v=e.element=dt.createComment(p+":end");if(e.clone=dt.createComment(p),Lt.appendChild(v),"each"===n||"with"===n?(e.template=d.innerHTML.trim(),avalon.clearHTML(d).appendChild(v)):(e.template=d.outerHTML.trim(),d.parentNode.replaceChild(v,d)),e.template=avalon.parseHTML(e.template),e.rollback=function(){var t=e.element;if(t){Rt.repeat.call(e,"clear");var n=t.parentNode,a=e.template,r=a.firstChild;n.replaceChild(a,t);var i=e.$stamp;i&&i.parentNode&&i.parentNode.removeChild(i),r=e.element="repeat"===e.type?r:n}},!a){e.handler=Rt.repeat,e.$outer={};var h="$key",m="$val";for(Array.isArray(r)&&(h="$first",m="$last"),u=0;s=t[u++];)if(s.hasOwnProperty(h)&&s.hasOwnProperty(m)){e.$outer=s;break}var g=r.$events,y=(g||{})[ht];if(y&&avalon.Array.ensure(y,e)&&w(e,y),"object"===i){e.$with=!0;var b=g?g.$withProxyPool||(g.$withProxyPool={}):{};e.handler("append",r,b)}else r.length&&e.handler("add",0,r.length)}},Rt.repeat=function(e,t,n){if(e){var a=this,i=a.element,o=i.parentNode,l=a.proxies,s=Lt.cloneNode(!1);switch(e){case"add":for(var c,u=t+n,f=a.$repeat,d=f.length-1,p=[],v=tt(a,t),h=t;u>h;h++){var m=rt(h,a);l.splice(h,0,m),et(a,s,m,p)}for(o.insertBefore(s,v),h=0;c=p[h++];)H(c.nodes,c.vmodels),c.nodes=c.vmodels=null;break;case"del":v=l[t].$stamp,i=tt(a,t+n),nt(v,i);var g=l.splice(t,n);lt(g,"each");break;case"clear":var y=a.$stamp||l[0];y&&(v=y.$stamp||y,nt(v,i)),lt(l,"each");break;case"move":v=l[0].$stamp;var x,$=v.nodeValue,w=[],C=[];for(nt(v,i,function(){C.unshift(this),this.nodeValue===$&&(w.unshift(C),C=[])}),b(l,t),b(w,t);C=w.shift();)for(;x=C.shift();)s.appendChild(x);o.insertBefore(s,i);break;case"index":for(d=l.length-1;n=l[t];t++)n.$index=t,n.$first=0===t,n.$last=t===d;return;case"set":return m=l[t],void(m&&T(m.$events.$index));case"append":var E=n,k=[];p=[];for(var M in t)t.hasOwnProperty(M)&&"hasOwnProperty"!==M&&k.push(M);if(a.sortedCallback){var O=a.sortedCallback.call(o,k);O&&Array.isArray(O)&&O.length&&(k=O)}for(h=0;M=k[h++];)"hasOwnProperty"!==M&&(E[M]||(E[M]=ot(M,a)),et(a,s,E[M],p));var N=a.$stamp=a.clone;for(o.insertBefore(N,i),o.insertBefore(s,i),h=0;c=p[h++];)H(c.nodes,c.vmodels),c.nodes=c.vmodels=null}"clear"===e&&(e="del");var L=a.renderedCallback||r,S=arguments;A(o,function(){L.apply(o,S),o.oldValue&&"SELECT"===o.tagName&&avalon(o).val(o.oldValue.split(","))},0/0)}},"with,each".replace(bt,function(e){It[e]=It.repeat});var pa=[],va=[];Rt.text=function(e,t){if(e=null==e?"":e,3===t.nodeType)try{t.data=e}catch(n){}else t.textContent=e},avalon.parseDisplay=st,It.visible=function(e,t){var n=avalon(e.element),a=n.css("display");if("none"===a){var r=n[0].style,i=/visibility/i.test(r.cssText),o=n.css("visibility");r.display="",r.visibility="hidden",a=n.css("display"),"none"===a&&(a=st(n[0].nodeName)),r.visibility=i?o:""}e.display=a,G(e.value,t,e)},Rt.visible=function(e,t,n){t.style.display=e?n.display:"none"},It.widget=function(t,n){var a=t.value.match(bt),i=t.element,o=a[0],l=a[1];l&&"$"!==l||(l=jt(o));var s=a[2]||o,c=avalon.ui[o];if("function"==typeof c){n=i.vmodels||n;for(var u,f=0;u=n[f++];)if(u.hasOwnProperty(s)&&"object"==typeof u[s]){var d=u[s];d=d.$model||d;break}if(d){var p=d[o+"Id"];"string"==typeof p&&(l=p)}var v=avalon.getWidgetData(i,o);t.value=[o,l,s].join(","),t[o+"Id"]=l,t.evaluator=r,i.msData["ms-widget-id"]=l;var h=t[o+"Options"]=avalon.mix({},c.defaults,d||{},v);i.removeAttribute("ms-widget");var m=c(i,t,n)||{};m.$id?(avalon.vmodels[l]=m,M(i,m),m.hasOwnProperty("$init")&&m.$init(function(){avalon.scan(i,[m].concat(n)),"function"==typeof h.onInit&&h.onInit.call(i,m,h,n)}),t.rollback=function(){try{m.widgetElement=null,m.$remove()}catch(e){}i.msData={},delete avalon.vmodels[m.$id]},w(t,ha),e.chrome&&i.addEventListener("DOMNodeRemovedFromDocument",function(){setTimeout(k)})):avalon.scan(i,n)}else n.length&&(i.vmodels=n)};var ha=[],ma=/<script[^>]*>([\S\s]*?)<\/script\s*>/gim,ga=/\s+(on[^=\s]+)(?:=("[^"]*"|'[^']*'|[^\s>]+))?/g,ya=/<\w+\b(?:(["'])[^"]*?(\1)|[^>])*>/gi,ba={a:/\b(href)\=("javascript[^"]*"|'javascript[^']*')/gi,img:/\b(src)\=("javascript[^"]*"|'javascript[^']*')/gi,form:/\b(action)\=("javascript[^"]*"|'javascript[^']*')/gi},xa=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,$a=/([^\#-~| |!])/g,wa=avalon.filters={uppercase:function(e){return e.toUpperCase()},lowercase:function(e){return e.toLowerCase()},truncate:function(e,t,n){return t=t||30,n=void 0===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.shift()];if("function"==typeof r){var i=[e].concat(a);e=r.apply(null,i)}}return e},camelize:B,sanitize:function(e){return e.replace(ma,"").replace(ya,function(e){var t=e.toLowerCase().match(/<(\w+)\s/);if(t){var n=ba[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,"&amp;").replace(xa,function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1);return"&#"+(1024*(t-55296)+(n-56320)+65536)+";"}).replace($a,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")},currency:function(e,t,n){return(t||"¥")+ct(e,isFinite(n)?n:2)},number:function(e,t){return ct(e,isFinite(t)?t:3)}};!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.length<t;)e="0"+e;return n&&(e=e.substr(e.length-t)),a+e}function n(e,n,a,r){return function(i){var o=i["get"+e]();return(a>0||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+)\)\/$/;wa.date=function(t,n){var a,r,i=wa.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,wa.date.locate=c};var Ca=avalon.modules={"domReady!":{exports:avalon,state:3},avalon:{exports:avalon,state:4}};Ca.exports=Ca.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:h},t);return l.toUrl(e),l}function i(e){var t=e.name,n=e.res,a=Ca[t],r=t&&e.urlNoQuery;if(a&&a.state>=3)return t;if(a=Ca[r],a&&a.state>=3)return Yt(a.deps||[],a.factory,r),r;if(t&&!a){a=Ca[r]={id:r,state:1};var i=function(r){j[n]=r,r.load(t,e,function(e){arguments.length&&void 0!==e&&(a.exports=e),a.state=4,s()})};j[n]?i(j[n]):Yt([n],i)}return t?r:n+"!"}function o(e,t){for(var n,a=0;n=e[a++];)if(4!==Ca[n].state&&(n===t||o(Ca[n].deps,t)))return!0}function l(e,t){var a=f(e.src);return e.onload=e.onerror=null,t?(setTimeout(function(){pt.removeChild(e),e=null}),void n("debug: 加载 "+a+" 失败"+t+" "+!Ca[a].state)):!0}function s(){e:for(var e,t=E.length;e=E[--t];){var n=Ca[e],a=n.deps;if(a){for(var r,i=0;r=a[i];i++){var o=A[r];if(o&&(r=a[i]=o),4!==Object(Ca[r]).state)continue e}4!==n.state&&(E.splice(t,1),v(n.id,n.deps,n.factory),s())}}}function c(e,t,a){var r=dt.createElement("script");r.className=ht,r.onload=function(){var r=k.pop();r&&r.require(t),a&&a(),n("debug: 已成功加载 "+e),t&&E.push(t),s()},r.onerror=function(){l(r,!0)},pt.appendChild(r),r.src=e,n("debug: 正准备加载 "+e)}function f(e){return(e||"").replace(D,"")}function d(e){return/^(?:[a-z]+:)?\/\//i.test(String(e))}function p(){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/,""),f(e.replace(/(:\d+)?:\d+$/i,""));for(var n,r=pt.getElementsByTagName("script"),i=r.length;n=r[--i];)if(n.className===ht&&"interactive"===n.readyState){var o=n.src;return n.className=f(o)}}function v(t,n,a){var r=Object(Ca[t]);r.state=4;for(var i,o=0,l=[];i=n[o++];)if(i=A[i]||i,"exports"===i){var s=r.exports||(r.exports={});l.push(s)}else l.push(Ca[i].exports);var c=a.apply(e,l);return void 0!==c&&(r.exports=c),delete r.factory,c}function h(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,u.paths,function(e,a){t=t.replace(a,e),n=1}),n||x(e,u.packages,function(e,n,a){t=t.replace(a.name,a.location)}),this.mapUrl&&x(this.mapUrl,u.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)),d(t)||(r=this.built||/^\w/.test(t)?a:r,t=w(r,t));var o=t+i;return t=o+this.query,x(e,u.urlArgs,function(e){t+=(-1===t.indexOf("?")?"?":"&")+e}),this.url=t,this.urlNoQuery=o}function m(e,t,n){var a=b(e,t,n);return a.sort($),a}function g(e){return new RegExp("^"+e+"(/|$)")}function y(t){return function(){var n;return t.init&&(n=t.init.apply(e,arguments)),n||t.exports&&C(t.exports)}}function b(e,t,n){var a=[];for(var r in e)if(e.hasOwnProperty(r)){var i={name:r,val:e[r]};a.push(i),i.reg="*"===r&&t?/^/:g(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 $(e,t){var n=e.name,a=t.name;return"*"===a?-1:"*"===n?1:a.length-n.length}function w(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 E=[],k=[],T=/\.js$/i,A={},M=[],O=!1;Yt=avalon.require=function(e,n,a,o){if(O){Array.isArray(e)||avalon.error("require方法的第一个参数应为数组 "+e);var l=[],c={},f=a||"callback"+setTimeout("1");o=o||{},o.baseUrl=u.baseUrl;var d=!!o.built;if(a&&(o.parentUrl=a.substr(0,a.lastIndexOf("/")),o.mapUrl=a.replace(T,"")),d){var p=t(o.name,o);f=p.urlNoQuery}else e.forEach(function(e){var n=t(e,o),a=i(n);a&&(c[a]||(l.push(a),c[a]="司徒正美"))});var v=Ca[f];v&&4===v.state||(Ca[f]={id:f,deps:d?e.concat():l,factory:n||r,state:3}),v||E.push(f),s()}else if(M.push(avalon.slice(arguments)),arguments.length<=2){O=!0;for(var h,m=M.splice(0,M.length);h=m.shift();)Yt.apply(null,h)}},Yt.define=function(e,t,n){"string"!=typeof e&&(n=t,t=e,e="anonymous"),Array.isArray(t)||(n=t,t=[]);var a={built:!O,name:e},r=[t,n,a];n.require=function(e){if(r.splice(2,0,e),Ca[e]){Ca[e].state=3;var t=!1;try{t=o(Ca[e].deps,e)}catch(a){}t&&avalon.error(e+"模块与之前的模块存在循环依赖,请不要直接用script标签引入"+e+"模块")}delete n.require,Yt.apply(null,r)};var i=a.built?"unknown":p();if(i){var l=Ca[i];l&&(l.state=2),n.require(i)}else k.push(n)},Yt.config=u,Yt.define.amd=Ca;var N=u["orig.paths"]={},L=u["orig.map"]={},S=u.packages=[],H=u["orig.args"]={};avalon.mix(Gt,{paths:function(e){avalon.mix(N,e),u.paths=m(N)},map:function(e){avalon.mix(L,e);var t=m(L,1,1);avalon.each(t,function(e,t){t.val=m(t.val)}),u.map=t},packages:function(e){e=e.concat(S);for(var t,n={},a=[],r=0;t=e[r++];){t="string"==typeof t?{name:t}:t;var i=t.name;if(!n[i]){var o=t.location?t.location:w(i,t.main||"main");o=o.replace(T,""),a.push(t),n[i]=t.location=o,t.reg=g(i)}}u.packages=a.sort()},urlArgs:function(e){"string"==typeof e&&(e={"*":e}),avalon.mix(H,e),u.urlArgs=m(H,1)},baseUrl:function(e){if(!d(e)){var t=pt.querySelector("base");t&&pt.removeChild(t);var n=dt.createElement("a");n.href=e,e=n.href,t&&pt.insertBefore(t,pt.firstChild)}e.length>3&&(u.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=y(n))}u.shim=e}});var j=Yt.plugins={ready:{load:r},js:{load:function(e,t,n){var a=t.url,r=t.urlNoQuery,i=u.shim[e.replace(T,"")];i?Yt(i.deps||[],function(){var e=avalon.slice(arguments);c(a,r,function(){n(i.exportsFn?i.exportsFn.apply(0,e):void 0)})}):c(a,r)}},css:{load:function(e,t,a){var r=t.url,i=dt.createElement("link");i.rel="stylesheet",i.href=r,pt.appendChild(i),n("debug: 已成功加载 "+r),a()}},text:{load:function(e,t,a){var r=t.url,i=oa();i.onload=function(){var e=i.status;e>399&&600>e?avalon.error(r+" 对应资源不存在或没有开启 CORS"):a(i.responseText)},i.open("GET",r,!0),"withCredentials"in i&&(i.withCredentials=!0),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.send(),n("debug: 正准备加载 "+r)}}};Yt.checkDeps=s;var D=/(\?[^#]*)$/,P=/\/\w+\/\.\./,I=dt.scripts[dt.scripts.length-1],R=I.getAttribute("data-main");if(R){Gt.baseUrl(R);var F=u.baseUrl;u.baseUrl=F.slice(0,F.lastIndexOf("/")+1),c(F.replace(T,"")+".js")}else{var B=f(I.src);u.baseUrl=B.slice(0,B.lastIndexOf("/")+1)}};var Ea=[];"complete"===dt.readyState?setTimeout(ut):(dt.addEventListener("DOMContentLoaded",ut),e.addEventListener("load",ut)),avalon.ready=function(e){ut===r?e(avalon):Ea.push(e)},avalon.config({loader:!0}),avalon.ready(function(){avalon.scan(dt.body)}),new function(){function t(e,t,n,a){return Math.abs(e-t)>=Math.abs(n-a)?e-t>0?"left":"right":n-a>0?"up":"down"}function n(e){var t=e.touches&&e.touches.length?e.touches:[e],n=e.changedTouches?e.changedTouches[0]:t[0];return{x:n.clientX,y:n.clientY}}function a(e){var a=s.element;if(a){var r=n(e),i=Date.now()-s.startTime,o=Math.abs(s.x-r.x),l=Math.abs(s.y-r.y);if(2===s.doubleIndex&&avalon.config.stopZoom&&e.preventDefault(),o>30||l>30){var c=t(s.x,r.x,s.y,r.y),u={direction:c};Q(a,"swipe",u),Q(a,"swipe"+c,u)}else if(h.canClick(a)&&s.mx<h.dragDistance&&s.my<h.dragDistance){document.activeElement&&document.activeElement!==a&&document.activeElement.blur();var f;"label"===a.tagName.toLowerCase()&&(f=a.htmlFor?document.getElementById(a.htmlFor):null),h.focus(f?f:a),avalon.fastclick.fireEvent(a,"click",e),Q(a,"tap"),f&&(avalon.fastclick.fireEvent(f,"click",e),Q(a,"tap")),250>i&&(2==s.doubleIndex?(avalon.fastclick.fireEvent(a,"dblclick",e),Q(a,"doubletap"),s.doubleIndex=0):setTimeout(function(){s.doubleIndex=0},250)),i>h.clickDuration&&(Q(a,"hold"),Q(a,"longtap"),s.doubleIndex=0)}avalon(a).removeClass(h.activeClass),s.element=null}}var r=navigator.userAgent,i=r.indexOf("Android")>0,o=/iP(ad|hone|od)/.test(r),l=It.on,s={},c=navigator.pointerEnabled,u=navigator.msPointerEnabled,f=function(){var e=o||!1;try{var t=document.createElement("div");t.ontouchstart=function(){e=!0};var n=document.createEvent("TouchEvent");n.initUIEvent("touchstart",!0,!0),t.dispatchEvent(n)}catch(a){}return t=t.ontouchstart=null,e}(),d=!!(f||c||u),p=["mousedown","mousemove","mouseup",""];f?p=["touchstart","touchmove","touchend","touchcancel"]:c?p=["pointerdown","pointermove","pointerup","pointercancel"]:u&&(p=["MSPointerDown","MSPointerMove","MSPointerUp","MSPointerCancel"]);var v={underFrame:null,coordinates:[],addUnderFrame:function(e){var t=null;v.underFrame||(t=document.createElement("div"),t.style.cssText=["opacity: 0","display: none;","border-radius: 60px;","position: absolute;","z-index: 99999;","width: 60px;","height: 60px"].join(""),document.body.appendChild(t)),v.underFrame=t,t.style.top=e.changedTouches[0].clientY-30+"px",t.style.left=e.changedTouches[0].clientX-30+"px",t.style.display="block",setTimeout(function(){t.style.display="none"},360)},preventGhostClick:function(t,n){v.coordinates.push(t,n),e.setTimeout(v.pop,2500)},pop:function(){v.coordinates.splice(0,2)},onClick:function(e){for(var t=0;t<v.coordinates.length;t+=2){var n=v.coordinates[t],a=v.coordinates[t+1];Math.abs(e.clientX-n)<25&&Math.abs(e.clientY-a)<25&&(e.stopPropagation(),e.preventDefault())}}};d&&"click,tap".replace(/\w+/g,function(e){avalon.eventHooks[e]={type:e,deel:function(t,n,a,r){var i="ms"+e+"list",o=t[i]||(t[i]=[]);return t.msdispatch||(t.msdispatch=function(e){if(e.fireByAvalon)for(var n,a=0;n=o[a++];)n.call(t,e)},t.addEventListener(n,t.msdispatch)),r?o.push(a):avalon.Array.remove(o,a),a.unbind=!0,a}}}),document.addEventListener("click",v.onClick,!0),document.addEventListener(p[1],function(e){if(s.element){var t=n(e);s.mx+=Math.abs(s.cx-t.x),s.my+=Math.abs(s.cy-t.y),s.tapping&&(s.mx>h.dragDistance||s.my>h.dragDistance)&&(s.element=null)}}),document.addEventListener(p[2],a),p[3]&&document.addEventListener(p[3],a),l.clickHook=function(e){function t(t){var a=e.element;avalon.mix(s,n(t)),s.cx=s.x,s.cy=s.y,s.mx=0,s.my=0,s.event=e.param,s.tapping=/click|tap|hold$/.test(s.event),s.doubleIndex?s.doubleIndex=2:(s.doubleIndex=1,s.startTime=Date.now()),s.element=a,s.tapping&&avalon.fastclick.canClick(a)&&avalon(a).addClass(h.activeClass)}function a(e){return"click"===e}(a(e.param)?d:!0)&&(e.specialBind=function(n,a){n.addEventListener(p[0],t),e.msCallback=a,avalon.bind(n,e.param,a)},e.specialUnbind=function(){element.removeEventListener(p[0],t),avalon.bind(e.element,e.param,e.msCallback)})};var h=avalon.fastclick={activeClass:"ms-click-active",clickDuration:750,dragDistance:30,fireEvent:function(t,n,a){var r=document.createEvent("MouseEvents");r.initMouseEvent(n,!0,!0,e,1,a.screenX,a.screenY,a.clientX,a.clientY,!1,!1,!1,!1,0,null),Object.defineProperty(r,"fireByAvalon",{value:!0}),t.dispatchEvent(r)},focus:function(e){if(this.canFocus(e)){var t=e.value;if(e.value=t,o&&e.setSelectionRange&&0!==e.type.indexOf("date")&&"time"!==e.type){var n=t.length;e.setSelectionRange(n,n)}else e.focus()}},canClick:function(e){switch(e.nodeName.toLowerCase()){case"textarea":case"select":case"input":return!e.disabled;default:return!0}},canFocus:function(e){switch(e.nodeName.toLowerCase()){case"textarea":return!0;case"select":return!i;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}}};["swipe","swipeleft","swiperight","swipeup","swipedown","doubletap","tap","dblclick","longtap","hold"].forEach(function(e){l[e+"Hook"]=l.clickHook}),d&&(l[p[2]+"Hook"]=function(e){e.specialBind=function(t,a){var r=a;
3
+ t.hasAttribute("avoidFocus")&&(r=function(e){var t=n(e);v.preventGhostClick(t.x,t.y),v.addUnderFrame(e),a.apply(this,[].slice.call(arguments))}),e.msCallback=r,avalon.bind(t,e.param,r)},e.specialUnbind=function(){avalon.unbind(e.element,e.param,e.msCallback)}})},"function"==typeof define&&define.amd&&define("avalon",[],function(){return avalon});e.avalon;return avalon.noConflict=function(t){return t&&e.avalon===avalon&&(e.avalon=avalon),avalon},void 0===t&&(e.avalon=avalon),avalon});
@@ -5,7 +5,7 @@
5
5
  http://weibo.com/jslouvre/
6
6
 
7
7
  Released under the MIT license
8
- avalon.mobile.shim.js(去掉加载器与domReady) 1.391 build in 2015.1.31
8
+ avalon.mobile.shim.js(去掉加载器与domReady) 1.391 build in 2015.2.12
9
9
  upport IE6+ and other browsers
10
10
  ==================================================*/
11
11
  (function(global, factory) {
@@ -37,7 +37,7 @@ var expose = Date.now()
37
37
  //http://stackoverflow.com/questions/7290086/javascript-use-strict-and-nicks-find-global-function
38
38
  var DOC = window.document
39
39
  var head = DOC.head //HEAD元素
40
- head.insertAdjacentHTML("afterBegin", '<avalon ms-skip><style id="avalonStyle">.avalonHide{ display: none!important }</style></avalon>')
40
+ head.insertAdjacentHTML("afterBegin", '<avalon ms-skip class="avalonHide"><style id="avalonStyle">.avalonHide{ display: none!important }</style></avalon>')
41
41
  var ifGroup = head.firstChild
42
42
 
43
43
  function log() {
@@ -134,7 +134,7 @@ avalon.type = function(obj) { //取得目标的类型
134
134
  }
135
135
 
136
136
  var isFunction = function(fn) {
137
- return serialize.call(fn) == "[object Function]"
137
+ return serialize.call(fn) === "[object Function]"
138
138
  }
139
139
 
140
140
  avalon.isFunction = isFunction
@@ -244,7 +244,7 @@ avalon.mix({
244
244
  }
245
245
  var index = -1,
246
246
  length = Math.max(0, Math.ceil((end - start) / step)),
247
- result = Array(length)
247
+ result = new Array(length)
248
248
  while (++index < length) {
249
249
  result[index] = start
250
250
  start += step
@@ -284,10 +284,10 @@ avalon.mix({
284
284
  if (node instanceof avalon) {
285
285
  node = node[0]
286
286
  }
287
- var prop = /[_-]/.test(name) ? camelize(name) : name
287
+ var prop = /[_-]/.test(name) ? camelize(name) : name, fn
288
288
  name = avalon.cssName(prop) || prop
289
289
  if (value === void 0 || typeof value === "boolean") { //获取样式
290
- var fn = cssHooks[prop + ":get"] || cssHooks["@:get"]
290
+ fn = cssHooks[prop + ":get"] || cssHooks["@:get"]
291
291
  if (name === "background") {
292
292
  name = "backgroundColor"
293
293
  }
@@ -317,7 +317,7 @@ avalon.mix({
317
317
  }
318
318
  } else {
319
319
  for (i in obj) {
320
- if (obj.hasOwnProperty(i) && fn(i, obj[i] === false)) {
320
+ if (obj.hasOwnProperty(i) && fn(i, obj[i]) === false) {
321
321
  break
322
322
  }
323
323
  }
@@ -618,7 +618,7 @@ var EventBus = {
618
618
  return this
619
619
  },
620
620
  $fire: function(type) {
621
- var special
621
+ var special, i, v, callback
622
622
  if (/^(\w+)!(\S+)$/.test(type)) {
623
623
  special = RegExp.$1
624
624
  type = RegExp.$2
@@ -627,8 +627,8 @@ var EventBus = {
627
627
  var args = aslice.call(arguments, 1)
628
628
  var detail = [type].concat(args)
629
629
  if (special === "all") {
630
- for (var i in avalon.vmodels) {
631
- var v = avalon.vmodels[i]
630
+ for (i in avalon.vmodels) {
631
+ v = avalon.vmodels[i]
632
632
  if (v !== this) {
633
633
  v.$fire.apply(v, detail)
634
634
  }
@@ -637,8 +637,8 @@ var EventBus = {
637
637
  var elements = events.expr ? findNodes(events.expr) : []
638
638
  if (elements.length === 0)
639
639
  return
640
- for (var i in avalon.vmodels) {
641
- var v = avalon.vmodels[i]
640
+ for (i in avalon.vmodels) {
641
+ v = avalon.vmodels[i]
642
642
  if (v !== this) {
643
643
  if (v.$events.expr) {
644
644
  var eventNodes = findNodes(v.$events.expr)
@@ -671,19 +671,19 @@ var EventBus = {
671
671
  if (special === "up") {
672
672
  alls.reverse()
673
673
  }
674
- for (var i = 0, el; el = alls[i++]; ) {
675
- if (el.$fire.apply(el, detail) === false) {
674
+ for (i = 0; callback = alls[i++]; ) {
675
+ if (callback.$fire.apply(callback, detail) === false) {
676
676
  break
677
677
  }
678
678
  }
679
679
  } else {
680
680
  var callbacks = events[type] || []
681
681
  var all = events.$all || []
682
- for (var i = 0, callback; callback = callbacks[i++]; ) {
682
+ for (i = 0; callback = callbacks[i++]; ) {
683
683
  if (isFunction(callback))
684
684
  callback.apply(this, args)
685
685
  }
686
- for (var i = 0, callback; callback = all[i++]; ) {
686
+ for (i = 0; callback = all[i++]; ) {
687
687
  if (isFunction(callback))
688
688
  callback.apply(this, arguments)
689
689
  }
@@ -851,7 +851,7 @@ function modelFactory(source, $special, $model) {
851
851
  } else {
852
852
  if (accessor.type === 0) { //type 0 计算属性 1 监控属性 2 对象属性
853
853
  //计算属性不需要收集视图刷新函数,都是由其他监控属性代劳
854
- var newValue = accessor.get.call($vmodel)
854
+ newValue = accessor.get.call($vmodel)
855
855
  if (oldValue !== newValue) {
856
856
  $model[name] = newValue
857
857
  //这里不用同步视图
@@ -883,12 +883,12 @@ function modelFactory(source, $special, $model) {
883
883
  initCallbacks.push(function() {
884
884
  var data = {
885
885
  evaluator: function() {
886
- data.type = new Date - 0
886
+ data.type = Math.random(),
887
887
  data.element = null
888
888
  $model[name] = accessor.get.call($vmodel)
889
889
  },
890
890
  element: head,
891
- type: new Date - 0,
891
+ type: Math.random(),
892
892
  handler: noop,
893
893
  args: []
894
894
  }
@@ -929,7 +929,7 @@ function modelFactory(source, $special, $model) {
929
929
  $vmodel.$id = generateID()
930
930
  $vmodel.$model = $model
931
931
  $vmodel.$events = $events
932
- for (var i in EventBus) {
932
+ for ( i in EventBus) {
933
933
  var fn = EventBus[i]
934
934
  if (!W3C) { //在IE6-8下,VB对象的方法里的this并不指向自身,需要用bind处理一下
935
935
  fn = fn.bind($vmodel)
@@ -1371,7 +1371,7 @@ function removeSubscribers() {
1371
1371
  if (diff) {
1372
1372
  //avalon.log("有需要移除的元素")
1373
1373
  while (obj = $$subscribers[--i]) {
1374
- var data = obj.data
1374
+ data = obj.data
1375
1375
  if (data.element === void 0)
1376
1376
  continue
1377
1377
  if (needTest[data.type] && isRemove(data.element)) { //如果它没有在DOM树
@@ -1687,8 +1687,8 @@ function scanAttr(elem, vmodels) {
1687
1687
  }
1688
1688
  bindings.sort(bindingSorter)
1689
1689
  var scanNode = true
1690
- for (var i = 0, binding; binding = bindings[i]; i++) {
1691
- var type = binding.type
1690
+ for (i = 0; binding = bindings[i]; i++) {
1691
+ type = binding.type
1692
1692
  if (rnoscanAttrBinding.test(type)) {
1693
1693
  return executeBindings(bindings.slice(0, i + 1), vmodels)
1694
1694
  } else if (scanNode) {
@@ -1708,10 +1708,13 @@ var rhasHtml = /\|\s*html\s*/,
1708
1708
  r11a = /\|\|/g,
1709
1709
  rlt = /&lt;/g,
1710
1710
  rgt = /&gt;/g
1711
-
1711
+ rstringLiteral = /(['"])(\\\1|.)+?\1/g
1712
1712
  function getToken(value) {
1713
1713
  if (value.indexOf("|") > 0) {
1714
- var index = value.replace(r11a, "\u1122\u3344").indexOf("|") //干掉所有短路或
1714
+ var scapegoat = value.replace( rstringLiteral, function(_){
1715
+ return Math.pow(10,_.length)
1716
+ })
1717
+ var index = scapegoat.replace(r11a, "\u1122\u3344").indexOf("|") //干掉所有短路或
1715
1718
  if (index > -1) {
1716
1719
  return {
1717
1720
  filters: value.slice(index),
@@ -1775,7 +1778,7 @@ function scanText(textNode, vmodels) {
1775
1778
  tokens = scanExpr(textNode.data)
1776
1779
  }
1777
1780
  if (tokens.length) {
1778
- for (var i = 0, token; token = tokens[i++]; ) {
1781
+ for (var i = 0; token = tokens[i++]; ) {
1779
1782
  var node = DOC.createTextNode(token.value) //将文本转换为文本节点,并替换原来的文本节点
1780
1783
  if (token.expr) {
1781
1784
  token.type = "text"
@@ -2225,14 +2228,14 @@ var keywords =
2225
2228
  // 关键字
2226
2229
  "break,case,catch,continue,debugger,default,delete,do,else,false" +
2227
2230
  ",finally,for,function,if,in,instanceof,new,null,return,switch,this" +
2228
- ",throw,true,try,typeof,var,void,while,with"
2231
+ ",throw,true,try,typeof,var,void,while,with" +
2229
2232
  // 保留字
2230
- + ",abstract,boolean,byte,char,class,const,double,enum,export,extends" +
2233
+ ",abstract,boolean,byte,char,class,const,double,enum,export,extends" +
2231
2234
  ",final,float,goto,implements,import,int,interface,long,native" +
2232
2235
  ",package,private,protected,public,short,static,super,synchronized" +
2233
- ",throws,transient,volatile"
2236
+ ",throws,transient,volatile" +
2234
2237
  // ECMA 5 - use strict
2235
- + ",arguments,let,yield" + ",undefined"
2238
+ ",arguments,let,yield" + ",undefined"
2236
2239
  var rrexpstr = /\/\*[\w\W]*?\*\/|\/\/[^\n]*\n|\/\/[^\n]*$|"(?:[^"\\]|\\[\w\W])*"|'(?:[^'\\]|\\[\w\W])*'|[\s\t\n]*\.[\s\t\n]*[$\w\.]+/g
2237
2240
  var rsplit = /[^\w$]+/g
2238
2241
  var rkeywords = new RegExp(["\\b" + keywords.replace(/,/g, '\\b|\\b') + "\\b"].join('|'), 'g')
@@ -2372,7 +2375,7 @@ function parseExpr(code, scopes, data) {
2372
2375
  data.evaluator = fn
2373
2376
  return
2374
2377
  }
2375
- var prefix = assigns.join(", ")
2378
+ prefix = assigns.join(", ")
2376
2379
  if (prefix) {
2377
2380
  prefix = "var " + prefix
2378
2381
  }
@@ -2543,7 +2546,7 @@ bindingExecutors.attr = function(val, elem, data) {
2543
2546
  var loaded = data.includeLoaded
2544
2547
  var replace = data.includeReplaced
2545
2548
  var target = replace ? elem.parentNode : elem
2546
- function scanTemplate(text) {
2549
+ var scanTemplate = function(text) {
2547
2550
  if (loaded) {
2548
2551
  text = loaded.apply(target, [text].concat(vmodels))
2549
2552
  }
@@ -2593,7 +2596,7 @@ bindingExecutors.attr = function(val, elem, data) {
2593
2596
  var el = val && val.nodeType === 1 ? val : DOC.getElementById(val)
2594
2597
  if (el) {
2595
2598
  if (el.tagName === "NOSCRIPT" && !(el.innerHTML || el.fixIE78)) { //IE7-8 innerText,innerHTML都无法取得其内容,IE6能取得其innerHTML
2596
- var xhr = getXHR() //IE9-11与chrome的innerHTML会得到转义的内容,它们的innerText可以
2599
+ xhr = getXHR() //IE9-11与chrome的innerHTML会得到转义的内容,它们的innerText可以
2597
2600
  xhr.open("GET", location, false) //谢谢Nodejs 乱炖群 深圳-纯属虚构
2598
2601
  xhr.send(null)
2599
2602
  //http://bbs.csdn.net/topics/390349046?page=1#post-393492653
@@ -2784,7 +2787,7 @@ bindingExecutors.html = function(val, elem, data) {
2784
2787
  if (isHtmlFilter) {
2785
2788
  data.group = fragment.childNodes.length || 1
2786
2789
  }
2787
- var nodes = avalon.slice(fragment.childNodes)
2790
+ nodes = avalon.slice(fragment.childNodes)
2788
2791
  if (nodes[0]) {
2789
2792
  if (comment.parentNode)
2790
2793
  comment.parentNode.replaceChild(fragment, comment)
@@ -3372,9 +3375,9 @@ bindingHandlers.repeat = function(data, vmodels) {
3372
3375
  check0 = "$first"
3373
3376
  check1 = "$last"
3374
3377
  }
3375
- for (var i = 0, p; p = vmodels[i++]; ) {
3376
- if (p.hasOwnProperty(check0) && p.hasOwnProperty(check1)) {
3377
- data.$outer = p
3378
+ for (i = 0; v = vmodels[i++]; ) {
3379
+ if (v.hasOwnProperty(check0) && v.hasOwnProperty(check1)) {
3380
+ data.$outer = v
3378
3381
  break
3379
3382
  }
3380
3383
  }
@@ -3404,7 +3407,7 @@ bindingExecutors.repeat = function(method, pos, el) {
3404
3407
  var n = pos + el
3405
3408
  var array = data.$repeat
3406
3409
  var last = array.length - 1
3407
- var fragments = []
3410
+ var fragments = [], fragment
3408
3411
  var start = locateNode(data, pos)
3409
3412
  for (var i = pos; i < n; i++) {
3410
3413
  var proxy = eachProxyAgent(i, data)
@@ -3412,7 +3415,7 @@ bindingExecutors.repeat = function(method, pos, el) {
3412
3415
  shimController(data, transation, proxy, fragments)
3413
3416
  }
3414
3417
  parent.insertBefore(transation, start)
3415
- for (var i = 0, fragment; fragment = fragments[i++]; ) {
3418
+ for (i = 0; fragment = fragments[i++]; ) {
3416
3419
  scanNodeArray(fragment.nodes, fragment.vmodels)
3417
3420
  fragment.nodes = fragment.vmodels = null
3418
3421
  }
@@ -3454,7 +3457,7 @@ bindingExecutors.repeat = function(method, pos, el) {
3454
3457
  parent.insertBefore(transation, end)
3455
3458
  break
3456
3459
  case "index": //将proxies中的第pos个起的所有元素重新索引
3457
- var last = proxies.length - 1
3460
+ last = proxies.length - 1
3458
3461
  for (; el = proxies[pos]; pos++) {
3459
3462
  el.$index = pos
3460
3463
  el.$first = pos === 0
@@ -3462,7 +3465,7 @@ bindingExecutors.repeat = function(method, pos, el) {
3462
3465
  }
3463
3466
  return
3464
3467
  case "set": //将proxies中的第pos个元素的VM设置为el(pos为数字,el任意)
3465
- var proxy = proxies[pos]
3468
+ proxy = proxies[pos]
3466
3469
  if (proxy) {
3467
3470
  notifySubscribers(proxy.$events.$index)
3468
3471
  }
@@ -3470,7 +3473,7 @@ bindingExecutors.repeat = function(method, pos, el) {
3470
3473
  case "append": //将pos的键值对从el中取出(pos为一个普通对象,el为预先生成好的代理VM对象池)
3471
3474
  var pool = el
3472
3475
  var keys = []
3473
- var fragments = []
3476
+ fragments = []
3474
3477
  for (var key in pos) { //得到所有键名
3475
3478
  if (pos.hasOwnProperty(key) && key !== "hasOwnProperty") {
3476
3479
  keys.push(key)
@@ -3482,7 +3485,7 @@ bindingExecutors.repeat = function(method, pos, el) {
3482
3485
  keys = keys2
3483
3486
  }
3484
3487
  }
3485
- for (var i = 0, key; key = keys[i++]; ) {
3488
+ for (i = 0; key = keys[i++]; ) {
3486
3489
  if (key !== "hasOwnProperty") {
3487
3490
  if (!pool[key]) {
3488
3491
  pool[key] = withProxyAgent(key, data)
@@ -3493,7 +3496,7 @@ bindingExecutors.repeat = function(method, pos, el) {
3493
3496
  var comment = data.$stamp = data.clone
3494
3497
  parent.insertBefore(comment, end)
3495
3498
  parent.insertBefore(transation, end)
3496
- for (var i = 0, fragment; fragment = fragments[i++]; ) {
3499
+ for (i = 0; fragment = fragments[i++]; ) {
3497
3500
  scanNodeArray(fragment.nodes, fragment.vmodels)
3498
3501
  fragment.nodes = fragment.vmodels = null
3499
3502
  }
@@ -3897,6 +3900,7 @@ new function() {
3897
3900
  Z: timeZoneGetter
3898
3901
  }
3899
3902
  var rdateFormat = /((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/
3903
+ var raspnetjson = /^\/Date\((\d+)\)\/$/
3900
3904
  filters.date = function(date, format) {
3901
3905
  var locate = filters.date.locate,
3902
3906
  text = "",
@@ -3907,6 +3911,8 @@ new function() {
3907
3911
  if (typeof date === "string") {
3908
3912
  if (/^\d+$/.test(date)) {
3909
3913
  date = toInt(date)
3914
+ } else if (raspnetjson.test(date)) {
3915
+ date = +RegExp.$1
3910
3916
  } else {
3911
3917
  var trimDate = date.trim()
3912
3918
  var dateArray = [0, 0, 0, 0, 0, 0, 0]
@@ -3914,9 +3920,9 @@ new function() {
3914
3920
  //取得年月日
3915
3921
  trimDate = trimDate.replace(/^(\d+)\D(\d+)\D(\d+)/, function(_, a, b, c) {
3916
3922
  var array = c.length === 4 ? [c, a, b] : [a, b, c]
3917
- dateArray[0] = toInt(array[0]) //年
3923
+ dateArray[0] = toInt(array[0]) //年
3918
3924
  dateArray[1] = toInt(array[1]) - 1 //月
3919
- dateArray[2] = toInt(array[2])//日
3925
+ dateArray[2] = toInt(array[2]) //日
3920
3926
  return ""
3921
3927
  })
3922
3928
  var dateSetter = oDate.setFullYear
@@ -3925,10 +3931,9 @@ new function() {
3925
3931
  dateArray[3] = toInt(a) //小时
3926
3932
  dateArray[4] = toInt(b) //分钟
3927
3933
  dateArray[5] = toInt(c) //秒
3928
- if (d) {
3929
- dateArray[6] = Math.round(parseFloat("0." + d) * 1000) //毫秒
3934
+ if (d) { //毫秒
3935
+ dateArray[6] = Math.round(parseFloat("0." + d) * 1000)
3930
3936
  }
3931
- dateArray[6] = d || ""
3932
3937
  return ""
3933
3938
  })
3934
3939
  var tzHour = 0
@@ -4025,7 +4030,7 @@ new function() {
4025
4030
  var ua = navigator.userAgent
4026
4031
  var isAndroid = ua.indexOf("Android") > 0
4027
4032
  var isIOS = /iP(ad|hone|od)/.test(ua)
4028
- var self = bindingHandlers.on
4033
+ var me = bindingHandlers.on
4029
4034
  var touchProxy = {}
4030
4035
 
4031
4036
  var IE11touch = navigator.pointerEnabled
@@ -4039,7 +4044,7 @@ new function() {
4039
4044
  supported = true
4040
4045
  }
4041
4046
  var e = document.createEvent("TouchEvent")
4042
- e.initTouchEvent("touchstart", true, true)
4047
+ e.initUIEvent("touchstart", true, true)
4043
4048
  div.dispatchEvent(e)
4044
4049
  } catch (err) {
4045
4050
  }
@@ -4056,7 +4061,50 @@ new function() {
4056
4061
  } else if (IE9_10touch) {
4057
4062
  touchNames = ["MSPointerDown", "MSPointerMove", "MSPointerUp", "MSPointerCancel"]
4058
4063
  }
4059
-
4064
+ var clickbuster = {
4065
+ underFrame: null,
4066
+ coordinates: [],
4067
+ addUnderFrame: function(event) {
4068
+ var underFrame = null
4069
+ if(!clickbuster.underFrame) {
4070
+ underFrame = document.createElement('div');
4071
+ underFrame.style.cssText = [
4072
+ "opacity: 0",
4073
+ "display: none;",
4074
+ "border-radius: 60px;",
4075
+ "position: absolute;",
4076
+ "z-index: 99999;",
4077
+ "width: 60px;",
4078
+ "height: 60px"
4079
+ ].join("");
4080
+ document.body.appendChild(underFrame)
4081
+ }
4082
+ clickbuster.underFrame = underFrame
4083
+ underFrame.style.top = (event.changedTouches[0].clientY - 30) + "px"
4084
+ underFrame.style.left = (event.changedTouches[0].clientX - 30) + "px"
4085
+ underFrame.style.display = "block"
4086
+ setTimeout(function(){
4087
+ underFrame.style.display = "none"
4088
+ }, 360)
4089
+ },
4090
+ preventGhostClick: function(x, y) {
4091
+ clickbuster.coordinates.push(x, y);
4092
+ window.setTimeout(clickbuster.pop, 2500)
4093
+ },
4094
+ pop: function() {
4095
+ clickbuster.coordinates.splice(0, 2)
4096
+ },
4097
+ onClick: function(event) {
4098
+ for (var i = 0; i < clickbuster.coordinates.length; i += 2) {
4099
+ var x = clickbuster.coordinates[i]
4100
+ var y = clickbuster.coordinates[i + 1]
4101
+ if (Math.abs(event.clientX - x) < 25 && Math.abs(event.clientY - y) < 25) {
4102
+ event.stopPropagation();
4103
+ event.preventDefault();
4104
+ }
4105
+ }
4106
+ }
4107
+ }
4060
4108
 
4061
4109
  if (touchSupported) {
4062
4110
  //我们经由ms-click, ms-on-tap绑定事件, 其实没有直接绑在元素,全部放到一个数组中
@@ -4070,7 +4118,7 @@ new function() {
4070
4118
  var fns = el[listName] || (el[listName] = [])
4071
4119
  if (!el["msdispatch"]) {
4072
4120
  el["msdispatch"] = function(event) {
4073
- if (event.fireByAvalon) {
4121
+ if (event.fireByAvalon) {
4074
4122
  for (var i = 0, fn; fn = fns[i++]; ) {
4075
4123
  fn.call(el, event)
4076
4124
  }
@@ -4090,7 +4138,6 @@ new function() {
4090
4138
  })
4091
4139
  }
4092
4140
 
4093
- var touchProxy = {}
4094
4141
  //判定滑动方向
4095
4142
  function swipeDirection(x1, x2, y1, y2) {
4096
4143
  return Math.abs(x1 - x2) >=
@@ -4105,22 +4152,16 @@ new function() {
4105
4152
  }
4106
4153
  }
4107
4154
 
4108
- function touchend(event) {
4155
+ function touchend(event) {
4109
4156
  var element = touchProxy.element
4110
- if (!element)
4157
+ if (!element)
4111
4158
  return
4112
4159
  var e = getCoordinates(event)
4113
4160
  var diff = Date.now() - touchProxy.startTime //经过时间
4114
4161
  var totalX = Math.abs(touchProxy.x - e.x)
4115
4162
  var totalY = Math.abs(touchProxy.y - e.y)
4116
-
4117
- var canDoubleClick = false
4118
- if (touchProxy.doubleIndex === 2) {//如果已经点了两次,就可以触发dblclick 回调
4119
- touchProxy.doubleIndex = 0
4120
- canDoubleClick = true
4121
- if (avalon.config.stopZoom) {
4122
- event.preventDefault()
4123
- }
4163
+ if (touchProxy.doubleIndex === 2 && avalon.config.stopZoom) {//如果已经点了两次,就可以触发dblclick 回调
4164
+ event.preventDefault()
4124
4165
  }
4125
4166
  if (totalX > 30 || totalY > 30) {
4126
4167
  //如果用户滑动的距离有点大,就认为是swipe事件
@@ -4155,22 +4196,31 @@ new function() {
4155
4196
  avalon.fastclick.fireEvent(forElement, "click", event)
4156
4197
  W3CFire(element, "tap")//触发tap事件
4157
4198
  }
4158
- if (canDoubleClick) {
4159
- if (diff < 250) {
4199
+ if (diff < 250) {
4200
+ if (touchProxy.doubleIndex == 2) {
4160
4201
  avalon.fastclick.fireEvent(element, "dblclick", event)//触发dblclick事件
4161
4202
  W3CFire(element, "doubletap")//触发doubletap事件
4203
+ touchProxy.doubleIndex = 0
4204
+ } else {
4205
+ setTimeout(function() {
4206
+ touchProxy.doubleIndex = 0
4207
+ }, 250)
4162
4208
  }
4163
- touchProxy.doubleIndex = 0
4164
4209
  }
4210
+
4165
4211
  if (diff > fastclick.clickDuration) {
4166
4212
  W3CFire(element, "hold")
4167
4213
  W3CFire(element, "longtap")
4214
+ touchProxy.doubleIndex = 0
4168
4215
  }
4169
4216
  }
4170
4217
  }
4171
4218
  avalon(element).removeClass(fastclick.activeClass)
4172
4219
  touchProxy.element = null
4173
4220
  }
4221
+ // 避免被点击的元素下有input、textarea时会触发其focus从而调出键盘
4222
+ // http://hzxiaosheng.github.io/work/2014/09/13/click-event-300ms-delay-and-ghost-click-in-mobile-browser/
4223
+ document.addEventListener('click', clickbuster.onClick, true)
4174
4224
  document.addEventListener(touchNames[1], function(event) {
4175
4225
  if (!touchProxy.element)
4176
4226
  return
@@ -4181,11 +4231,12 @@ new function() {
4181
4231
  touchProxy.element = null
4182
4232
  }
4183
4233
  })
4234
+
4184
4235
  document.addEventListener(touchNames[2], touchend)
4185
4236
  if (touchNames[3]) {
4186
4237
  document.addEventListener(touchNames[3], touchend)
4187
4238
  }
4188
- self["clickHook"] = function(data) {
4239
+ me["clickHook"] = function(data) {
4189
4240
  function touchstart(event) {
4190
4241
  var element = data.element
4191
4242
  avalon.mix(touchProxy, getCoordinates(event))
@@ -4193,22 +4244,18 @@ new function() {
4193
4244
  touchProxy.cy = touchProxy.y
4194
4245
  touchProxy.mx = 0 //计算总结移动了多少距离,指在移动距离重分
4195
4246
  touchProxy.my = 0
4196
- touchProxy.startTime = Date.now()
4247
+ // touchProxy.startTime = Date.now()
4197
4248
  touchProxy.event = data.param
4198
4249
  touchProxy.tapping = /click|tap|hold$/.test(touchProxy.event)
4199
4250
 
4200
- touchProxy.element = element
4201
4251
  //--------------处理双击事件--------------
4202
- if (touchProxy.element !== element) {
4252
+ if (!touchProxy.doubleIndex) {
4203
4253
  touchProxy.doubleIndex = 1
4204
- touchProxy.doubleStartTime = Date.now()
4254
+ touchProxy.startTime = Date.now()
4205
4255
  } else {
4206
- if (!touchProxy.doubleIndex) {
4207
- touchProxy.doubleIndex = 1
4208
- } else {
4209
- touchProxy.doubleIndex = 2
4210
- }
4256
+ touchProxy.doubleIndex = 2
4211
4257
  }
4258
+ touchProxy.element = element
4212
4259
  if (touchProxy.tapping && avalon.fastclick.canClick(element)) {
4213
4260
  avalon(element).addClass(fastclick.activeClass)
4214
4261
  }
@@ -4294,9 +4341,28 @@ new function() {
4294
4341
 
4295
4342
 
4296
4343
  ["swipe", "swipeleft", "swiperight", "swipeup", "swipedown", "doubletap", "tap", "dblclick", "longtap", "hold"].forEach(function(method) {
4297
- self[method + "Hook"] = self["clickHook"]
4344
+ me[method + "Hook"] = me["clickHook"]
4298
4345
  })
4299
-
4346
+ if (touchSupported) {
4347
+ me[touchNames[2] + "Hook"] = function(data) {
4348
+ data.specialBind = function(element, callback) {
4349
+ var _callback = callback
4350
+ if (element.hasAttribute('avoidFocus')) {
4351
+ _callback = function(event) {
4352
+ var e = getCoordinates(event)
4353
+ clickbuster.preventGhostClick(e.x, e.y)
4354
+ clickbuster.addUnderFrame(event)
4355
+ callback.apply(this, [].slice.call(arguments))
4356
+ }
4357
+ }
4358
+ data.msCallback = _callback
4359
+ avalon.bind(element, data.param, _callback)
4360
+ }
4361
+ data.specialUnbind = function() {
4362
+ avalon.unbind(data.element, data.param, data.msCallback)
4363
+ }
4364
+ }
4365
+ }
4300
4366
  //各种摸屏事件的示意图 http://quojs.tapquo.com/ http://touch.code.baidu.com/
4301
4367
  }
4302
4368
 
@@ -4327,7 +4393,7 @@ new function() {
4327
4393
  }, 50)
4328
4394
  }
4329
4395
  avalon.ready = function(fn) {
4330
- loaded ? fn() : fns.push(fn)
4396
+ loaded ? fn(avalon) : fns.push(fn)
4331
4397
  }
4332
4398
  avalon.ready(function() {
4333
4399
  avalon.scan(DOC.body)