forked from RubyLouvre/avalon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
avalon.mobile.min.js
94 lines (94 loc) · 46.5 KB
/
avalon.mobile.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
(function(p){function A(){}function B(b){v.console&&console.log(b)}function L(b){return null==b?String(b):"object"===typeof b||"function"===typeof b?Ea[ja.call(b)]||"object":typeof b}function H(b,d){"string"===typeof b&&(b=b.match(y)||[]);for(var c={},e=void 0!==d?d:1,f=0,g=b.length;f<g;f++)c[b[f]]=e;return c}function Fa(){return"avalon"+Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}function Ga(b){if(b&&"object"===typeof b){var d=b.length;b=ja.call(b);if(/(Array|List|Collection|Map|Arguments)\]$/.test(b)||
"[object Object]"===b&&+d===d&&!(d%1)&&0<=d)return!0}return!1}function M(b,d,c){if(Array.isArray(b)){var e=b.concat();b.length=0;b=lb(b);b.push.apply(b,e);return b}if("number"===typeof b.nodeType)return b;var f={};d=d||{};var g={},h={},e=[],l=c||{},k=b.$skipArray;c=0;for(var m;m=mb[c++];)delete b[m],h[m]=!0;if(Array.isArray(k))for(c=0;m=k[c++];)h[m]=!0;for(c in b)nb(c,b[c],d,h,g,e,l);f=Object.defineProperties(f,ob(g));for(m in h)f[m]=h[m];l.vmodel=f;f.$model=d;f.$events={};f.$id=Fa();f.$accessors=
g;f[z]=[];for(c in I)f[c]=I[c];Object.defineProperty(f,"hasOwnProperty",{value:function(b){return b in f.$model},writable:!1,enumerable:!1,configurable:!0});for(c=0;b=e[c++];)P[w]=b,b(),$(b),delete P[w];return f}function ob(b){var d={},c;for(c in b)d[c]={get:b[c],set:b[c],enumerable:!0,configurable:!0};return d}function nb(b,d,c,e,f,g,h){c[b]=d;if(e[b]||d&&d.nodeType||"$"===b[0]&&!h[b])return e[b]=d;var l=L(d);if("function"===l)return e[b]=d;var k,m;if("object"===l&&"function"===typeof d.get&&2>=
Object.keys(d).length){var n=d.set,q=d.get;k=function(d){var e=h.vmodel,f=c[b];if(arguments.length){if(!aa){if("function"===typeof n){var g=e.$events[b];e.$events[b]=[];n.call(e,d);e.$events[b]=g}if(!Q(m,d)){m=d;d=c[b]=q.call(e);if(ba&&(g=R[e.$id])&&g[b])g[b].$val=d;C(k);e.$events&&I.$fire.call(e,b,d,f)}}}else return avalon.openComputedCollect&&$(k),d=c[b]=q.call(e),Q(f,d)||(m=void 0,e.$events&&I.$fire.call(e,b,d,f)),d};g.push(k)}else ka.test(l)?(k=function(d){var e=k.$vmodel,f=e.$model;if(arguments.length){if(!aa&&
!Q(f,d)){d=k.$vmodel=qb(e,d,l);var g=la[d.$id];g&&g();g=h.vmodel;c[b]=d.$model;C(e);g.$events&&I.$fire.call(g,b,c[b],f)}}else return $(e),e},k.$vmodel=d.$model?d:M(d,d),c[b]=k.$vmodel.$model):(k=function(d){var e=c[b];if(arguments.length){if(!Q(e,d)){c[b]=d;var f=h.vmodel;if(ba){var g=R[f.$id];g&&g[b]&&(g[b].$val=d)}C(k);f.$events&&I.$fire.call(f,b,d,e)}}else return $(k),e},c[b]=d);k[z]=[];f[b]=k}function qb(b,d,c){if("array"===c){if(!Array.isArray(d))return b;d=d.concat();b.clear();b.push.apply(b,
d);return b}var e=b[z];R[b.$id]&&(ba--,delete R[b.$id]);var f=M(d);la[f.$id]=function(b){for(;b=e.shift();)(function(b){b.type&&avalon.nextTick(function(){b.rollback&&b.rollback();x[b.type](b,b.vmodels)})})(b);delete la[f.$id]};return f}function s(b){for(var d in b)if(Ia.call(b,d)){var c=b[d];if("function"===typeof s.plugins[d])s.plugins[d](c);else"object"===typeof s[d]?avalon.mix(s[d],c):s[d]=c}return this}function Ja(b){return b.replace(/([a-z\d])([A-Z]+)/g,"$1-$2").toLowerCase()}function ca(b){return 0>
b.indexOf("-")&&0>b.indexOf("_")?b:b.replace(/[-_][^-_]/g,function(b){return b.charAt(1).toUpperCase()})}function da(b){try{b="true"===b?!0:"false"===b?!1:"null"===b?null:+b+""===b?+b:rb.test(b)?JSON.parse(b):b}catch(d){}return b}function Ka(b,d){if(0>=b.offsetWidth){var c=getComputedStyle(b,null);if(sb.test(c.display)){var e={node:b},f;for(f in La)e[f]=c[f],b.style[f]=La[f];d.push(e)}(c=b.parentNode)&&1==c.nodeType&&Ka(c,d)}}function ma(b,d){P[w]=b;avalon.openComputedCollect=!0;var c=b.evaluator;
if(c)if("duplex"===b.type)b.handler();else try{b.handler(c.apply(0,b.args),b.element,b)}catch(e){delete b.evaluator,3===b.nodeType&&(b.node.data=S+b.value+T),B("error:evaluator of ["+b.value+"] throws error!")}else b();avalon.openComputedCollect=!1;delete P[w]}function $(b){P[w]&&(b=b[z])&&avalon.Array.ensure(b,P[w])}function C(b){var d=b[z];if(d&&d.length)for(var c=ea.call(arguments,1),e=d.length,f;f=d[--e];){var g=f.element;g&&!Ma.contains(g)&&!D.contains(g)?(d.splice(e,1),B("debug: remove "+f.name)):
"function"===typeof f?f.apply(0,c):f.getter?f.handler.apply(f,c):f.handler(f.evaluator.apply(0,f.args||[]),g,f)}}function Na(b,d){var c=NaN,e=setInterval(function(){var f=b.innerHTML;f===c?(clearInterval(e),d()):c=f},15)}function fa(b,d,c){c=b.getAttribute(na+"skip");var e=b.getAttributeNode(na+"important"),f=b.getAttributeNode(na+"controller");if("string"!==typeof c){if(c=e||f){f=U[c.value];if(!f)return;d=c===e?[f]:[f].concat(d);b.removeAttribute(c.name);b.classList.remove(c.name)}Oa(b,d)}}function oa(b,
d){for(var c=b.firstChild;c;){var e=c.nextSibling;if(1===c.nodeType)fa(c,d);else if(3===c.nodeType&&ga.test(c.data)){var f=d,g=[],h=pa(c.data);if(h.length){for(var l=0,k=void 0;k=h[l++];){var m=p.createTextNode(k.value);if(k.expr){var n=k.filters,k={type:"text",node:m,nodeType:3,value:k.value,filters:n};n&&-1!==n.indexOf("html")&&(avalon.Array.remove(n,"html"),k.type="html",k.replaceNodes=[m],n.length||delete g.filters);g.push(k)}F.appendChild(m)}c.parentNode.replaceChild(F,c);qa(g,f)}}c=e}}function Oa(b,
d){for(var c=b.attributes,e=[],f={},g,h=0,l;l=c[h++];)if(l.specified&&(g=l.name.match(tb))){var k=g[1],m=g[2]||"";f[l.name]=l.value;ub[k]&&(m=k,k="on");"function"===typeof x[k]&&(l={type:k,param:m,element:b,name:g[0],value:l.value,priority:k in Pa?Pa[k]:10*k.charCodeAt(0)+(Number(m)||0)},"if"===k&&"loop"===m&&(l.priority+=100),d.length&&(e.push(l),"widget"===k&&(b.msData=b.msData||f)))}f["ms-checked"]&&f["ms-duplex"]&&B("warning!\u4e00\u4e2a\u5143\u7d20\u4e0a\u4e0d\u80fd\u540c\u65f6\u5b9a\u4e49ms-checked\u4e0ems-duplex");
e.sort(function(b,d){return b.priority-d.priority});c=e[0]||{};switch(c.type){case "if":case "repeat":case "widget":qa([c],d);break;default:qa(e,d),!vb[b.tagName]&&ra.test(b.innerHTML+b.textContent)&&oa(b,d)}b.patchRepeat&&(b.patchRepeat(),b.patchRepeat=null)}function qa(b,d){for(var c=0,e;e=b[c++];)e.vmodels=d,x[e.type](e,d),e.evaluator&&e.name&&e.element.removeAttribute(e.name);b.length=0}function pa(b){var d=[],c;c=0;var e;do{e=b.indexOf(S,c);if(-1===e)break;(c=b.slice(c,e))&&d.push({value:c,expr:!1});
c=e+S.length;e=b.indexOf(T,c);if(-1===e)break;if(c=b.slice(c,e)){var f=[];0<c.indexOf("|")&&(c=c.replace(wb,"U2hvcnRDaXJjdWl0"),c=c.replace(xb,function(b,d,c){f.push(d+(c||""));return""}),c=c.replace(yb,"||"));d.push({value:c,expr:!0,filters:f.length?f:void 0})}c=e+T.length}while(1);(c=b.slice(c))&&d.push({value:c,expr:!1});return d}function zb(b,d,c,e){for(var f=[],g=" = "+c+".",h=b.length,l;l=b[--h];)d.hasOwnProperty(l)&&(f.push(l+g+l),"duplex"===e&&(b.get=c+"."+l),b.splice(h,1));return f}function Ab(b){var d=
{};return b.filter(function(b){if(!d[b.$id])return d[b.$id]=1,!0})}function Qa(b){function d(e,f){c.push(e)>b&&delete d[c.shift()];return d[e]=f}var c=[];return d}function W(b,d,c,e){var f=c.type,g="html"===f||"text"===f?c.filters:"",h=d.map(function(b){return b.$id.replace(Bb,"$1")})+b+f+g,l=Cb(b).concat(),k=[],m=[],n=[],q="";d=Ab(d);for(var u=0,q=d.length;u<q;u++)if(l.length){var Ha="vm"+w+"_"+u;m.push(Ha);n.push(d[u]);k.push.apply(k,zb(l,d[u],Ha,e))}g&&n.push(avalon.filters);c.args=n;if(d=sa[h])c.evaluator=
d;else{(q=k.join(", "))&&(q="var "+q);if(g){b="\nvar ret"+w+" = "+b;e=[];e.push(b,"\r\n");for(u=0;f=c.filters[u++];)g=f.indexOf("("),-1!==g?(b=f.slice(g+1,f.lastIndexOf(")")).trim(),b=","+b,f=f.slice(0,g).trim()):b="",e.push(" if(filters",w,".",f,"){\n\ttry{\nret",w," = filters",w,".",f,"(ret",w,b,")\n\t}catch(e){} \n}\n");b=e.join("");b+="\nreturn ret"+w;m.push("filters"+w)}else{if("duplex"===f){q="'use strict';\nreturn function(vvv){\n\t"+q+";\n\tif(!arguments.length){\n\t\treturn "+b+"\n\t}\n\t"+
(!Db.test(b)?l.get:b)+"= vvv;\n} ";try{d=Function.apply(A,m.concat(q)),c.evaluator=sa(h,d)}catch(pb){B("debug: parse error,"+pb.message)}return}"on"===f?(b=b.replace("(",".call(this,"),"$event"===e&&m.push(e),b="\nreturn "+b+";",e=b.lastIndexOf("\nreturn"),u=b.slice(0,e),b=b.slice(e),b=u+"\nif(avalon.openComputedCollect) return ;"+b):b="\nreturn "+b+";"}try{d=Function.apply(A,m.concat("'use strict';\n"+q+b)),c.evaluator=sa(h,d)}catch(N){B("debug: parse error,"+N.message)}finally{l=e=m=null}}}function G(b,
d,c,e){if(Array.isArray(e)){var f=e.map(function(b){var c={};return b.expr?W(b.value,d,c)||c:b.value});c.evaluator=function(){for(var b="",d=0,c;c=f[d++];)b+="string"===typeof c?c:c.evaluator.apply(0,c.args);return b};c.args=[]}else W(b,d,c,e);c.evaluator&&(c.handler=ta[c.handlerName||c.type],c.evaluator.toString=function(){return c.type+" binding to eval("+b+")"},ma(c))}function ua(b,d){b=b.toLowerCase();if(!ha[b]){var c=p.createElement(b);D.appendChild(c);d=getComputedStyle(c,null).display;D.removeChild(c);
ha[b]=d}return ha[b]}function Eb(){!this.disabled&&this.oldValue!==this.value&&avalon.fire(this,"input")}function Fb(){for(var b=X.length-1;0<=b;b--){var d=X[b];avalon.contains(D,d)?d.onTree&&d.onTree():d.msRetain||(d.offTree&&d.offTree(),X.splice(b,1))}X.length||clearInterval(Ra)}function Sa(b){1===X.push(b)&&(Ra=setInterval(Fb,30))}function Gb(b){Ta.call(this,b);b!==this.oldValue&&avalon.fire(this,"input")}function lb(b){var d=[];d.$id=Fa();d[z]=[];d.$model=b;d.$events={};d._=M({length:b.length});
d._.$watch("length",function(b,c){d.$fire("length",b,c)});for(var c in I)d[c]=I[c];avalon.mix(d,Ua);return d}function Va(b){for(var d=p.createTreeWalker(b,NodeFilter.SHOW_COMMENT,null,null),c,e=[];c=d.nextNode();)e.push(c);for(d=0;c=e[d++];)"ms-if"==c.nodeValue&&(c=c.elem,c.parentNode&&c.parentNode.removeChild(c));b.textContent=""}function Hb(b){var d=Y(this.callbackElement,this.callbackName,this.vmodels);if(d){var c=this.parent;Na(c,function(){d.apply(c,b)})}}function Wa(b,d,c,e){function f(){delete U[h];
b.group=1;if(!b.fastRepeat){b.group=l.childNodes.length;for(l.parentNode.removeChild(l);l.firstChild;)d.appendChild(l.firstChild);void 0!==f.node&&f.parent.insertBefore(d,f.node)}}var g=b.template.cloneNode(!0),h=e.$id,l=g.firstChild;b.fastRepeat||(l=p.createElement("msloop"),l.style.display="none",l.appendChild(g));l.setAttribute("ms-controller",h);c.push(l);d.appendChild(l);e.$outer=b.$outer;U[h]=e;return l.patchRepeat=f}function va(b,d,c){if(d.startRepeat){b=d.startRepeat;d=d.endRepeat;c+=1;for(var e=
0;e<c;e++)if(b=b.nextSibling,b==d)return d;return b}return b.childNodes[d.group*c]||null}function Xa(b,d,c){d*=c||1;for(c=F.cloneNode(!1);0<=--d;){var e=b.nextSibling;c.appendChild(b);b=e;if(!b)break}return c}function Ib(b,d,c){b=M({$key:b,$outer:c,$val:d},0,{$val:1,$key:1});b.$id="$proxy$with"+Math.random();return b}function Jb(b,d,c,e){var f=c.param||"el";b={$index:b,$itemName:f,$outer:c.$outer,$first:0===b,$last:b===e};b[f]=d;b.$remove=function(){return c.getter().removeAt(g.$index)};var g=M(b,
0,Kb);g.$id="$proxy$"+c.type+Math.random();return g}function ia(){r["ready!"].state=2;E.checkDeps();ia=A}var P={},w=Date.now(),z="$"+w,v=this||(0,eval)("this"),Lb=v.require,Mb=v.define,aa=!1,y=/[^, ]+/g,Ea={},wa=Object.prototype,Ia=wa.hasOwnProperty,na="ms-",D=p.documentElement,ja=wa.toString,O=Array.prototype,ea=O.slice,J=p.head,F=p.createDocumentFragment();"Boolean Number String Function Array Date RegExp Object Error".replace(y,function(b){Ea["[object "+b+"]"]=b.toLowerCase()});var ka=/^(?:object|array)$/,
Nb=/^\[object (Window|DOMWindow|global)\]$/;v.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=L;avalon.isWindow=function(b){return Nb.test(ja.call(b))};avalon.isPlainObject=function(b){return!!b&&"object"===typeof b&&Object.getPrototypeOf(b)===wa};avalon.mix=avalon.fn.mix=function(){var b,d,c,e,f,g=arguments[0]||{},h=1,l=arguments.length,k=!1;"boolean"===typeof g&&(k=g,g=arguments[1]||{},h++);
"object"!==typeof g&&"function"!==L(g)&&(g={});h===l&&(g=this,h--);for(;h<l;h++)if(null!=(b=arguments[h]))for(d in b)c=g[d],e=b[d],g!==e&&(k&&e&&(avalon.isPlainObject(e)||(f=Array.isArray(e)))?(f?(f=!1,c=c&&Array.isArray(c)?c:[]):c=c&&avalon.isPlainObject(c)?c:{},g[d]=avalon.mix(k,c,e)):void 0!==e&&(g[d]=e));return g};var xa=avalon.eventMap={};avalon.mix({rword:y,subscribers:z,version:1.26,ui:{},models:{},log:B,noop:A,error:function(b,d){throw new (d||Error)(b);},oneObject:H,range:function(b,d,c){c||
(c=1);null==d&&(d=b||0,b=0);var e=-1;d=Math.max(0,Math.ceil((d-b)/c));for(var f=Array(d);++e<d;)f[e]=b,b+=c;return f},slice:function(b,d,c){return ea.call(b,d,c)},contains:function(b,d){return b.contains(d)},bind:function(b,d,c,e){b.addEventListener(xa[d]||d,c,!!e);return c},unbind:function(b,d,c,e){b.removeEventListener(xa[d]||d,c||A,!!e)},fire:function(b,d){var c=p.createEvent("Event");c.initEvent(d,!0,!0);b.dispatchEvent(c)},css:function(b,d,c){b instanceof avalon&&(b=b[0]);var e=/[_-]/.test(d)?
ca(d):d;d=avalon.cssName(e)||e;if(void 0===c||"boolean"===typeof c)return e=t[e+":get"]||t["@:get"],b=e(b,d),!0===c?parseFloat(b)||0:b;""===c?b.style[d]="":null==c||c!==c||(isFinite(c)&&!avalon.cssNumber[e]&&(c+="px"),e=t[e+":set"]||t["@:set"],e(b,d,c))},each:function(b,d){if(b){var c=0;if(Ga(b))for(var e=b.length;c<e;c++)d(c,b[c]);else for(c in b)b.hasOwnProperty(c)&&d(c,b[c])}},getWidgetData:function(b,d){var c=avalon(b).data(),e={},f;for(f in c)0===f.indexOf(d)&&(e[f.replace(d,"").replace(/\w/,
function(b){return b.toLowerCase()})]=c[f]);return e},parseJSON:JSON.parse,Array:{ensure:function(b,d){-1===b.indexOf(d)&&b.push(d);return b},removeAt:function(b,d){return!!b.splice(d,1).length},remove:function(b,d){var c=b.indexOf(d);return~c?avalon.Array.removeAt(b,c):!1}}});avalon.isArrayLike=Ga;avalon.nextTick=v.setImmediate?setImmediate.bind(v):function(b){setTimeout(b,0)};D.contains||(Node.prototype.contains=function(b){return!!(this.compareDocumentPosition(b)&16)});var U=avalon.vmodels={};
avalon.define=function(b,d){U[b]&&B("warning: "+b+" \u5df2\u7ecf\u5b58\u5728\u4e8eavalon.vmodels\u4e2d");var c={$watch:A};d(c);c=M(c);aa=!0;d(c);aa=!1;c.$id=b;return U[b]=c};var mb=String("$id,$watch,$unwatch,$fire,$events,$model,$skipArray,$accessors,"+z).match(y),Q=Object.is||function(b,d){return 0===b&&0===d?1/b===1/d:b!==b?d!==d:b===d},R={},ba=0,la={},S,T,ga,Ya,ra,Za=/[-.*+?^${}()|[\]\/\\]/g,K={debug:function(b){v.console&&(console._log||(console._log=console.log),console.log=b?console._log:A)},
loader:function(b){v.define=b?E.define:Mb;v.require=b?E:Lb},interpolate:function(b){if(Array.isArray(b)&&b[0]&&b[1]&&b[0]!==b[1]){S=b[0];T=b[1];b=(S+"").replace(Za,"\\$&");var d=(T+"").replace(Za,"\\$&");ga=RegExp(b+"(.*?)"+d);Ya=RegExp(b+"(.*?)"+d,"g");ra=RegExp(b+".*?"+d+"|\\sms-")}}};s.plugins=K;s.plugins.interpolate(["{{","}}"]);s.paths={};s.shim={};avalon.config=s;var $a=/\S+/g;avalon.fn.mix({hasClass:function(b){var d=this[0]||{};return 1===d.nodeType&&d.classList.contains(b)},toggleClass:function(b,
d){var c=d,e,f=0,g=b.match($a)||[],h="boolean"===typeof d,l;if(l=(this[0]||{}).classList)for(;e=g[f++];)c=h?c:!l.contains(e),l[c?"add":"remove"](e);return this},attr:function(b,d){return 2===arguments.length?(this[0].setAttribute(b,d),this):this[0].getAttribute(b)},data:function(b,d){b="data-"+Ja(b||"");switch(arguments.length){case 2:return this.attr(b,d),this;case 1:var c=this.attr(b);return da(c);case 0:var e={};O.forEach.call(this[0].attributes,function(c){c&&(b=c.name,b.indexOf("data-")||(b=
ca(b.slice(5)),e[b]=da(c.value)))});return e}},removeData:function(b){b="data-"+Ja(b);this[0].removeAttribute(b);return this},css:function(b,d){if(avalon.isPlainObject(b))for(var c in b)avalon.css(this,c,b[c]);else var e=avalon.css(this,b,d);return void 0!==e?e:this},position:function(){var b,d,c=this[0],e={top:0,left:0};if(c)return"fixed"===this.css("position")?d=c.getBoundingClientRect():(b=this.offsetParent(),d=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:d.top-e.top-avalon.css(c,"marginTop",!0),left:d.left-e.left-avalon.css(c,"marginLeft",!0)}},offsetParent:function(){for(var b=this[0].offsetParent||D;b&&"HTML"!==b.tagName&&"static"===avalon.css(b,"position");)b=b.offsetParent;return avalon(b||D)},bind:function(b,d,c){if(this[0])return avalon.bind(this[0],b,d,c)},unbind:function(b,d,c){this[0]&&avalon.unbind(this[0],b,d,c);return this},val:function(b){var d=this[0];if(d&&1===d.nodeType){var c=
0===arguments.length,e=c?":get":":set",f=Ob,g;g=d.tagName.toLowerCase();g="input"===g&&/checkbox|radio/.test(d.type)?"checked":g;if(e=f[g+e])var h=e(d,b);else{if(c)return(d.value||"").replace(/\r/g,"");d.value=b}}return c?h:this}});"add,remove".replace(y,function(b){avalon.fn[b+"Class"]=function(d){var c=this[0];d&&("string"===typeof d&&c&&1==c.nodeType)&&d.replace($a,function(d){c.classList[b](d)});return this}});D.dataset&&(avalon.data=function(b,d){var c=this[0].dataset;switch(arguments.length){case 2:return c[b]=
d,this;case 1:return d=c[b],da(d);case 0:var e={};for(b in c)e[b]=da(c[b]);return e}});var rb=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/;avalon.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(b,d){avalon.fn[b]=function(c){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?c:avalon(f).scrollLeft(),g?c:avalon(f).scrollTop()):e[b]=c;else return f?f[d]:e[b]}});var t=avalon.cssHooks={},ab=["","-webkit-","-o-","-moz-","-ms-"],
ya={"float":"cssFloat",background:"backgroundColor"};avalon.cssNumber=H("columnCount,order,fillOpacity,fontWeight,lineHeight,opacity,orphans,widows,zIndex,zoom");avalon.cssName=function(b,d,c){if(ya[b])return ya[b];d=d||D.style;for(var e=0,f=ab.length;e<f;e++)if(c=ca(ab[e]+b),c in d)return ya[b]=c;return null};t["@:set"]=function(b,d,c){b.style[d]=c};t["@:get"]=function(b,d){var c,e=getComputedStyle(b,null);e&&(c=e.getPropertyValue(d),""===c&&(c=b.style[d]));return c};t["opacity:get"]=function(b){b=
t["@:get"](b,"opacity");return""===b?"1":b};"top,left".replace(y,function(b){t[b+":get"]=function(d){var c=t["@:get"](d,b);return/px$/.test(c)?c:avalon(d).position()[b]+"px"}});var La={position:"absolute",visibility:"hidden",display:"block"},sb=/^(none|table(?!-c[ea]).+)/;"Width,Height".replace(y,function(b){var d=b.toLowerCase(),c="client"+b,e="scroll"+b,f="offset"+b;t[d+":get"]=function(c,d,e){var f="content-box";"string"===typeof e&&(f=e);d="Width"===b?["Left","Right"]:["Top","Bottom"];switch(f){case "content-box":return c["client"+
b]-avalon.css(c,"padding"+d[0],!0)-avalon.css(c,"padding"+d[1],!0);case "padding-box":return c["client"+b];case "border-box":return c["offset"+b];case "margin-box":return c["offset"+b]+avalon.css(c,"margin"+d[0],!0)+avalon.css(c,"margin"+d[1],!0)}};t[d+"&get"]=function(b){var c=[];Ka(b,c);for(var e=t[d+":get"](b),f=0,m;m=c[f++];){b=m.node;for(var n in m)"string"===typeof m[n]&&(b.style[n]=m[n])}return e};avalon.fn[d]=function(g){var h=this[0];if(0===arguments.length){if(h.setTimeout)return h["inner"+
b];if(9===h.nodeType){var l=h.documentElement;return Math.max(h.body[e],l[e],h.body[f],l[f],l[c])}return t[d+"&get"](h)}return this.css(d,g)};avalon.fn["inner"+b]=function(){return t[d+":get"](this[0],void 0,"padding-box")};avalon.fn["outer"+b]=function(b){return t[d+":get"](this[0],void 0,!0===b?"border-box":"margin-box")}});avalon.fn.offset=function(){var b=this[0],d=b&&b.ownerDocument,c=d.defaultView,e=d.documentElement,f={left:0,top:0};if(!d||!e.contains(b))return f;"undefined"!==typeof b.getBoundingClientRect&&
(f=b.getBoundingClientRect());return{top:f.top+c.pageYOffset-e.clientTop,left:f.left+c.pageXOffset-e.clientLeft}};var Ob={"select:get":function(b,d){for(var c,e=b.options,f=b.selectedIndex,g="select-one"===b.type||0>f,h=g?null:[],l=g?f+1:e.length,k=0>f?l:g?f:0;k<l;k++)if(c=e[k],(c.selected||k===f)&&!c.disabled){d=c.value;if(g)return d;h.push(d)}return h},"select:set":function(b,d,c){d=[].concat(d);for(var e=0,f;f=b.options[e++];)if(f.selected=0<=d.indexOf(f.value))c=!0;c||(b.selectedIndex=-1)}},Pb=
/<([\w:]+)/,Qb=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Rb=H("text/javascript","text/ecmascript","application/ecmascript","application/javascript","text/vbscript"),bb=/<(?:tb|td|tf|th|tr|col|opt|leg|cap|area)/,cb=new function(){var b={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"),"*":p.createElement("div")};
b.optgroup=b.option;b.tbody=b.tfoot=b.colgroup=b.caption=b.thead;b.th=b.td;return b};avalon.clearHTML=function(b){b.textContent="";return b};var Sb=p.createElement("script");avalon.parseHTML=function(b){"string"!==typeof b&&(b+="");b=b.replace(Qb,"<$1></$2>").trim();if(Tb.createContextualFragment&&!bb.test(b)&&!/<script/i.test(b)){var d=p.createRange();d.selectNodeContents(D);return d.createContextualFragment(b)}var d=F.cloneNode(!1),c=(Pb.exec(b)||["",""])[1].toLowerCase();c in cb||(c="*");c=cb[c];
c.innerHTML=b;b=c.getElementsByTagName("script");var e;if(b.length)for(var f=0,g;g=b[f++];)if(!g.type||Rb[g.type])e=Sb.cloneNode(!1),O.forEach.call(g.attributes,function(b){b&&(e[b.name]=b.value)}),e.text=g.text,g.parentNode.replaceChild(e,g);for(;b=c.firstChild;)d.appendChild(b);return d};avalon.innerHTML=function(b,d){if(!/<script/i.test(d)&&!bb.test(d))b.innerHTML=d;else{var c=this.parseHTML(d);this.clearHTML(b).appendChild(c)}};var I={$watch:function(b,d){if("function"===typeof d){var c=this.$events[b];
c?c.push(d):this.$events[b]=[d]}else this.$events=this.$watch.backup;return this},$unwatch:function(b,d){var c=arguments.length;if(0===c)this.$watch.backup=this.$events,this.$events={};else if(1===c)this.$events[b]=[];else for(var c=this.$events[b]||[],e=c.length;0>~--e;)if(c[e]===d)return c.splice(e,1);return this},$fire:function(b){for(var d=this.$events[b]||[],c=this.$events.$all||[],e=ea.call(arguments,1),f=0,g;g=d[f++];)g.apply(this,e);for(f=0;g=c[f++];)g.apply(this,arguments)}};avalon.scan=
function(b,d){b=b||D;var c=d?[].concat(d):[];fa(b,c)};var vb=H("AREA,BASE,BASEFONT,BR,COL,COMMAND,EMBED,HR,IMG,INPUT,LINK,META,PARAM,SOURCE,TRACK,WBR,NOSCRIPT,NOSCRIPT,SCRIPT,STYLE,TEXTAREA"),tb=/ms-(\w+)-?(.*)/,Pa={"if":10,repeat:90,widget:110,each:1400,"with":1500,duplex:2E3,on:3E3},ub=H("dblclick,mouseout,click,mouseover,mouseenter,mouseleave,mousemove,mousedown,mouseup,keypress,keydown,keyup,blur,focus,change,animationend"),xb=/\|\s*(\w+)\s*(\([^)]*\))?/g,wb=/\|\|/g,yb=/U2hvcnRDaXJjdWl0/g,Ub=
/\/\*[\w\W]*?\*\/|\/\/[^\n]*\n|\/\/[^\n]*$|"(?:[^"\\]|\\[\w\W])*"|'(?:[^'\\]|\\[\w\W])*'|[\s\t\n]*\.[\s\t\n]*[$\w\.]+/g,Vb=/[^\w$]+/g,Wb=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,
"\\b|\\b")+"\\b"),"g"),Xb=/\b\d[^,]*/g,Yb=/^,+|,+$/g,za=Qa(512),Cb=function(b){b=","+b.trim();if(za[b])return za[b];for(var d=b.replace(Ub,"").replace(Vb,",").replace(Wb,"").replace(Xb,"").replace(Yb,"").split(/^$|,+/),c=[],e={},f=0;f<d.length;++f){var g=d[f];e[g]||(e[g]=c.push(g))}return za(b,c)},sa=Qa(256),Db=/\w\[.*\]|\w\.\w/,Bb=/(\$proxy\$[a-z]+)\d+$/;avalon.parseExprProxy=G;var ha=H("a,abbr,b,span,strong,em,font,i,kbd","inline");avalon.mix(ha,H("div,h1,h2,h3,h4,h5,h6,section,p","block"));avalon.parseDisplay=
ua;var Zb=function(b){return"table-cell"==getComputedStyle(b,null).display}(p.createElement("td")),db=/\(([^)]*)\)/;J.insertAdjacentHTML("afterBegin",'<style id="avalonStyle">.avalonHide{ display: none!important }</style>');var Y=function(b,d,c){if(b=b.getAttribute(d)){d=0;for(var e;e=c[d++];)if(e.hasOwnProperty(b)&&"function"===typeof e[b])return e[b]}},Aa={},Ma=p.createElement("div"),$b=/^\s+$/,ta=avalon.bindingExecutors={attr:function(b,d,c){function e(b){k&&(b=k.apply(d,[b].concat(h)));avalon.innerHTML(d,
b);oa(d,h);l&&Na(d,function(){l.call(d)})}var f=c.type,g=c.param;if("css"===f)avalon(d).css(g,b);else if("attr"===f)!1===b||null===b||void 0===b?d.removeAttribute(g):d.setAttribute(g,b);else if("include"===f&&b){var h=c.vmodels,l=Y(d,"data-include-rendered",h),k=Y(d,"data-include-loaded",h);if("src"===c.param)if(Aa[b])e(Aa[b]);else{var m=new v.XMLHttpRequest;m.onload=function(){var c=m.status;if(200<=c&&300>c||304===c)e(Aa[b]=m.responseText)};m.open("GET",b,!0);m.withCredentials=!0;m.setRequestHeader("X-Requested-With",
"XMLHttpRequest");m.send(null)}else{var n=b&&1==b.nodeType?b:p.getElementById(b);avalon.nextTick(function(){e(n.innerText||n.innerHTML)})}}else d[f]=b},"class":function(b,d,c){var e=avalon(d),f=c.type;if("class"===f&&c.param)e.toggleClass(c.param,!!b);else{var g=c._evaluator?!!c._evaluator.apply(d,c._args):!0,h=c._class||b;switch(f){case "class":g&&c.oldClass&&e.removeClass(c.oldClass);e.toggleClass(h,g);c.oldClass=h;break;case "hover":case "active":c.init||("hover"===f?(b="mouseenter",d="mouseleave"):
(d.tabIndex=d.tabIndex||-1,b="mousedown",d="mouseup",e.bind("mouseleave",function(){g&&e.removeClass(h)})),e.bind(b,function(){g&&e.addClass(h)}),e.bind(d,function(){g&&e.removeClass(h)}),c.init=1)}}},data:function(b,d,c){c="data-"+c.param;b&&"object"===typeof b?d[c]=b:d.setAttribute(c,String(b))},checked:function(b,d,c){c=c.type;"enabled"===c?d.disabled=!b:d["readonly"===c?"readOnly":c]=!!b},each:function(b,d,c){if(b){var e=this.group,f=this.startRepeat&&this.startRepeat.parentNode;f&&(this.parent=
f);var f=this.parent,g=this.proxies;if("del"===b||"move"===b)var h=va(f,this,d);switch(b){case "add":for(var l=c,k=this.getter().length-1,m=F.cloneNode(!1),e=[],n={},h=0,q=l.length;h<q;h++){var n=h+d,u=Jb(n,l[h],this,k);g.splice(n,0,u);n=Wa(this,m,e,u)}h=va(f,this,d);n.node=h;n.parent=f;f.insertBefore(m,h);for(h=0;f=e[h++];)fa(f,this.vmodels);break;case "del":g.splice(d,c);Va(Xa(h,e,c));break;case "index":for(k=g.length-1;c=g[d];d++)c.$index=d,c.$first=0===d,c.$last=d===k;break;case "clear":e=F.cloneNode(!1);
if(this.startRepeat)for(;;)if((f=this.startRepeat.nextSibling)&&f!==this.endRepeat)e.appendChild(f);else break;else for(;f.firstChild;)e.appendChild(f.firstChild);Va(e);g.length=0;break;case "move":if(m=g.splice(d,1)[0])g.splice(c,0,m),e=Xa(h,e),h=va(f,this,c),f.insertBefore(e,h);break;case "set":(u=g[d])&&(u[u.$itemName]=c);break;case "append":g=c;m=F.cloneNode(!1);h=Y(this.callbackElement,"data-with-sorted",this.vmodels);k=[];e=[];n={};for(l in d)d.hasOwnProperty(l)&&k.push(l);h&&(h=h.call(f,k))&&
(Array.isArray(h)&&h.length)&&(k=h);for(h=0;l=k[h++];)n=Wa(this,m,e,g[l]);n.parent=f;n.node=this.endRepeat||null;f.insertBefore(m,n.node);for(h=0;c=e[h++];)fa(c,this.vmodels)}Hb.call(this,arguments)}},html:function(b,d,c){b=null==b?"":b;d||(d=c.element=c.node.parentNode);if(c.replaceNodes){var e;if(11===b.nodeType)e=b;else if(1===b.nodeType||b.item){b=1===b.nodeType?b.childNodes:b.item?b:[];for(e=F.cloneNode(!0);b[0];)e.appendChild(b[0])}else e=avalon.parseHTML(b);b=avalon.slice(e.childNodes);d.insertBefore(e,
c.replaceNodes[0]||null);e=0;for(var f;f=c.replaceNodes[e++];)d.removeChild(f);c.replaceNodes=b}else avalon.innerHTML(d,b);avalon.nextTick(function(){oa(d,c.vmodels)})},"if":function(b,d,c){var e=c.placehoder;if(b){if(!c.msInDocument){c.msInDocument=!0;try{e.parentNode.replaceChild(d,e)}catch(f){B("debug: ms-if "+f.message)}}ra.test(d.outerHTML)&&Oa(d,c.vmodels)}else c.msInDocument&&(c.msInDocument=!1,d.parentNode.replaceChild(e,d),e.elem=d,Ma.appendChild(d))},on:function(b,d,c){var e=c.evaluator,
f=c.args,g=c.vmodels;b=c.hasArgs?function(b){return e.apply(this,f.concat(b))}:function(b){return e.apply(0,f).call(this,b)};d.$vmodel=g[0];d.$vmodels=g;c.param=c.param.replace(/-\d+$/,"");if("function"===typeof c.specialBind)c.specialBind(d,b);else var h=avalon.bind(d,c.param,b);c.rollback=function(){"function"===typeof c.specialUnbind?c.specialUnbind():avalon.unbind(d,c.param,h)};c.evaluator=c.handler=A},text:function(b,d,c){b=null==b?"":b;3===c.nodeType?c.node.data=b:(d||(d=c.element=c.node.parentNode),
d.textContent=b)},visible:function(b,d,c){d.style.display=b?c.display:"none"},widget:A},x=avalon.bindingHandlers={attr:function(b,d){var c=b.value.trim(),e=!0;-1<c.indexOf(S)&&2<c.indexOf(T)&&(e=!1,ga.test(c)&&(""===RegExp.rightContext&&""===RegExp.leftContext)&&(e=!0,c=RegExp.$1));b.handlerName="attr";G(c,d,b,e?null:pa(b.value))},"class":function(b,d){var c=b.param,e=b.value;b.handlerName="class";if(!c||isFinite(c)){b.param="";var f=e.replace(Ya,function(b){return Math.pow(10,b.length-1)}).indexOf(":");
if(-1===f)c=e;else if(c=e.slice(0,f),e=e.slice(f+1),W(e,d,b),b.evaluator)b._evaluator=b.evaluator,b._args=b.args;else return B("debug: ms-class '"+(e||"").trim()+"' \u4e0d\u5b58\u5728\u4e8eVM\u4e2d"),!1;e=ga.test(c);e||(b._class=c);G("",d,b,e?pa(c):null)}else"class"===b.type&&G(e,d,b)},checked:function(b,d){b.handlerName="checked";G(b.value,d,b)},duplex:function(b,d){var c=b.element;if("function"===typeof V[c.tagName]&&(b.changed=Y(c,"data-duplex-changed",d)||A,W(b.value,d,b,"duplex"),b.evaluator&&
b.args)){var e=c.form;e&&e.msValidate&&e.msValidate(c);b.bound=function(d,e){c.addEventListener(d,e);var h=b.rollback;b.rollback=function(){c.removeEventListener(d,e);h&&h()}};V[c.tagName](c,b.evaluator.apply(null,b.args),b)}},each:function(b,d){var c=b.type,e;W(b.value,d,b);"repeat"!==c&&B("warning:\u5efa\u8bae\u4f7f\u7528ms-repeat\u4ee3\u66ffms-each, ms-with, ms-repeat\u53ea\u5360\u7528\u4e00\u4e2a\u6807\u7b7e\u5e76\u4e14\u6027\u80fd\u66f4\u597d");var f=b.callbackElement=b.parent=b.element;b.getter=
function(){return this.evaluator.apply(0,this.args||[])};b.proxies=[];var g=!0;try{e=b.getter(),ka.test(L(e))&&(g=!1)}catch(h){}var l=F.cloneNode(!1);if("repeat"===c){var k=p.createComment("ms-repeat-start"),m=p.createComment("ms-repeat-end");b.element=b.parent=f.parentNode;b.startRepeat=k;b.endRepeat=m;f.removeAttribute(b.name);b.parent.replaceChild(m,f);b.parent.insertBefore(k,m);l.appendChild(f)}else for(;k=f.firstChild;)3===k.nodeType&&$b.test(k.data)?f.removeChild(k):l.appendChild(k);b.template=
l;b.rollback=function(){ta.each.call(b,"clear");var c=b.endRepeat,d=b.parent;d.insertBefore(b.template,c||null);c&&(d.removeChild(c),d.removeChild(b.startRepeat),b.element=b.callbackElement)};f=b.value.split(".")||[];if(1<f.length){f.pop();k=f[0];for(f=0;m=d[f++];)if(m&&m.hasOwnProperty(k)&&m[k][z]){m[k][z].push(b);break}}if(!g){b.callbackName="data-"+(c||"each")+"-rendered";b.handler=ta.each;b.$outer={};g="$key";k="$val";Array.isArray(e)&&(g="$first",k="$last");for(f=0;m=d[f++];)if(m.hasOwnProperty(g)&&
m.hasOwnProperty(k)){b.$outer=m;break}k=l.firstChild;b.fastRepeat=!!k&&1===k.nodeType&&l.lastChild===k&&!k.attributes["ms-controller"]&&!k.attributes["ms-important"];e[z]&&e[z].push(b);if(!Array.isArray(e)&&"each"!==c){var n=R[e.$id];if(!n){ba++;var n=R[e.$id]={},q;for(q in e)e.hasOwnProperty(q)&&"hasOwnProperty"!==q&&function(b,c){n[b]=Ib(b,c,{});n[b].$watch("$val",function(c){e[b]=c})}(q,e[q])}b.handler("append",e,n)}else b.handler("add",0,e)}},html:function(b,d){G(b.value,d,b)},"if":function(b,
d){b.element.removeAttribute(b.name);b.placehoder||(b.msInDocument=b.placehoder=p.createComment("ms-if"));b.vmodels=d;G(b.value,d,b)},on:function(b,d){var c=b.value,e="$event";if(0<c.indexOf("(")&&-1<c.indexOf(")")){var f=(c.match(db)||["",""])[1].trim();if(""===f||"$event"===f)e=void 0,c=c.replace(db,"")}else e=void 0;b.hasArgs=e;G(c,d,b,e)},visible:function(b,d){var c=b.element;if(!Zb&&!D.contains(c))var e=ua(c.tagName);e=e||avalon(c).css("display");b.display="none"===e?ua(c.tagName):e;G(b.value,
d,b)},widget:function(b,d){var c=b.value.match(y),e=b.element,f=c[0];if("$"===c[1]||!c[1])c[1]=f+setTimeout("1");b.value=c.join(",");var g=avalon.ui[f];if("function"===typeof g){d=e.vmodels||d;for(var h=c[2]||f,l=0,k;k=d[l++];)if(k.hasOwnProperty(h)&&"object"===typeof k[h]){var m=k;break}if(m){var n=m[h],n=n.$model||n,h=n[f+"Id"];"string"===typeof h&&(c[1]=h)}h=avalon.getWidgetData(e,c[0]);b[f+"Id"]=c[1];b[f+"Options"]=avalon.mix({},g.defaults,n||{},h);e.removeAttribute("ms-widget");var q=g(e,b,d)||
{};b.evaluator=A;e.msData["ms-widget-id"]=q.$id||"";q.hasOwnProperty("$init")&&q.$init();if(q.hasOwnProperty("$remove")){var u=function(){q.$remove();e.msData={};delete U[q.$id]};ac?e.addEventListener("DOMNodeRemoved",function(b){b.target===this&&!this.msRetain&&u()}):(e.offTree=u,Sa(e))}}else d.length&&(e.vmodels=d)}},ac=p.implementation.hasFeature("MutationEvents","2.0");"hover,active".replace(y,function(b){x[b]=x["class"]});"with,repeat".replace(y,function(b){x[b]=x.each});"disabled,enabled,readonly,selected".replace(y,
function(b){x[b]=x.checked});x.data=x.text=x.html;"title,alt,src,value,css,include,href".replace(y,function(b){x[b]=x.attr});var V=x.duplex;V.INPUT=function(b,d,c){function e(){n=!0}function f(){n=!1}var g=c.param,h=b.type,l=c.changed,k=c.bound,m=avalon(b),n=!1,q=function(){if(!n){var c=b.oldValue=b.value;!1!==m.data("duplex-observe")&&(d(c),l.call(b,c))}};c.handler=function(){var c=d();c!==b.value&&(b.value=c)};"checkbox"===h&&"radio"===g&&(h="radio");"radio"===h?(c.handler=function(){b.oldChecked=
b.checked=/bool|text/.test(g)?d()+""===b.value:!!d()},k(g?"change":"mousedown",function(){if(!1!==m.data("duplex-observe")){var c=b.value;"text"===g?d(c):"bool"===g?(c="true"===c,d(c)):(c=!b.oldChecked,d(c),b.checked=c);l.call(b,c)}})):"checkbox"===h?(c.handler=function(){var c=[].concat(d());b.checked=0<=c.indexOf(b.value)},k("change",function(){if(!1!==m.data("duplex-observe")){var c=b.checked?"ensure":"remove",e=d();if(Array.isArray(e))avalon.Array[c](e,b.value);else avalon.error("ms-duplex\u4f4d\u4e8echeckbox\u65f6\u8981\u6c42\u5bf9\u5e94\u4e00\u4e2a\u6570\u7ec4");
l.call(b,e)}})):(h=b.attributes["data-duplex-event"]||b.attributes["data-event"]||{},h=h.value,"change"===h?k("change",q):(k("input",q),k("compositionstart",e),k("compositionend",f)));b.oldValue=b.value;b.onTree=Eb;eb(b);ma(c)};var Ra,X=[],eb=A;try{var fb=HTMLInputElement.prototype,Ta;Ta=Object.getOwnPropertyDescriptor(fb,"value").set;Object.defineProperty(fb,"value",{set:Gb})}catch(bc){eb=Sa}V.SELECT=function(b,d,c){var e=avalon(b);c.handler=function(){var c=d(),c=c&&c.$model||c,c=Array.isArray(c)?
c.map(String):c+"";c+""!==b.oldValue&&(e.val(c),b.oldValue=c+"")};c.bound("change",function(){if(!1!==e.data("duplex-observe")){var f=e.val();f+""!==b.oldValue&&(d(f),b.oldValue=f+"");c.changed.call(b,f)}});var f=NaN,g=setInterval(function(){var d=b.innerHTML;d===f?(clearInterval(g),ma(c)):f=d},20)};V.TEXTAREA=V.INPUT;var gb={AnimationEvent:"animationend",WebKitAnimationEvent:"webkitAnimationEnd"},Ba;for(Ba in gb)if(/object|function/.test(typeof v[Ba])){xa.animationend=gb[Ba];break}if(!("onmouseenter"in
D)){var hb=avalon.bind,ib={mouseenter:"mouseover",mouseleave:"mouseout"};avalon.bind=function(b,d,c){return ib[d]?hb(b,ib[d],function(e){var f=e.relatedTarget;if(!f||f!==b&&!(b.compareDocumentPosition(f)&16))return delete e.type,e.type=d,c.call(b,e)}):hb(b,d,c)}}var Ca=O.splice,Ua={_splice:Ca,_add:function(b,d){var c=this.length;d="number"===typeof d?d:c;for(var c=[],e=0,f=b.length;e<f;e++){var g=c,h=e,l=b[e],k=L(l);ka.test(k)&&(l=l.$id?l:M(l,l));g[h]=l}Ca.apply(this,[d,0].concat(c));C(this,"add",
d,c);if(!this._stopFireLength)return this._.length=this.length},_del:function(b,d){var c=this._splice(b,d);c.length&&(C(this,"del",b,d),this._stopFireLength||(this._.length=this.length));return c},push:function(){O.push.apply(this.$model,arguments);var b=this._add(arguments);C(this,"index",2<b?b-2:0);return b},unshift:function(){O.unshift.apply(this.$model,arguments);var b=this._add(arguments,0);C(this,"index",arguments.length);return b},shift:function(){var b=this.$model.shift();this._del(0,1);C(this,
"index",0);return b},pop:function(){var b=this.$model.pop();this._del(this.length-1,1);return b},splice:function(b,d){var c=b,e=this.length;b=c===+c&&!(c%1)?0>c?-1*c>=e?0:c+e:c>e?e:c:0;c=Ca.apply(this.$model,arguments);e=[];this._stopFireLength=!0;c.length&&(e=this._del(b,c.length),2>=arguments.length&&C(this,"index",0));2<arguments.length&&this._add(ea.call(arguments,2),b);this._stopFireLength=!1;this._.length=this.length;return e},contains:function(b){return-1!==this.indexOf(b)},size:function(){return this._.length},
remove:function(b){return this.removeAt(this.indexOf(b))},removeAt:function(b){return this.splice(b,1)},clear:function(){this.$model.length=this.length=this._.length=0;C(this,"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 d=this.length-1;0<=d;d--)b(this[d],d)&&this.splice(d,1);else this.clear()},ensure:function(b){this.contains(b)||this.push(b);return this},set:function(b,d){if(0<=b){var c=L(d);d&&
d.$model&&(d=d.$model);var e=this[b];if("object"===c)for(var f in d)e.hasOwnProperty(f)&&(e[f]=d[f]);else"array"===c?e.clear().push.apply(e,d):e!==d&&(this[b]=d,this.$model[b]=d,C(this,"set",b,d))}return this}};"sort,reverse".replace(y,function(b){Ua[b]=function(){var d=this.$model,c=d.slice(0),e=!1;O[b].apply(d,arguments);for(var f=0,g=c.length;f<g;f++){var h=d[f];if(!Q(h,c[f])){e=!0;a:{for(var l=c,k=f,m=l.length;k<m;k++)if(Q(h,l[k])){h=k;break a}h=-1}l=this._splice(h,1)[0];k=c.splice(h,1)[0];this._splice(f,
0,l);c.splice(f,0,k);C(this,"move",h,f)}}e&&C(this,"index",0);return this}});var Tb=p.createRange(),Kb=H("$index,$first,$last"),Da=avalon.filters={uppercase:function(b){return b.toUpperCase()},lowercase:function(b){return b.toLowerCase()},truncate:function(b,d,c){d=d||30;c=void 0===c?"...":c;return b.length>d?b.slice(0,d-c.length)+c:String(b)},camelize:ca,escape:function(b){return String(b).replace(/&(?!\w+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,
"'")},currency:function(b,d){return(d||"\uffe5")+avalon.filters.number(b)},number:function(b,d,c,e){b=(b+"").replace(/[^0-9+\-Ee.]/g,"");b=!isFinite(+b)?0:+b;d=!isFinite(+d)?0:Math.abs(d);e=e||",";c=c||".";var f="",f=function(b,c){var d=Math.pow(10,c);return""+Math.round(b*d)/d},f=(d?f(b,d):""+Math.round(b)).split(".");3<f[0].length&&(f[0]=f[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,e));if((f[1]||"").length<d)f[1]=f[1]||"",f[1]+=Array(d-f[1].length+1).join("0");return f.join(c)}};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 d(c,d,e,f){return function(g){g=g["get"+c]();if(0<e||g>-e)g+=e;0===g&&-12===e&&(g=12);return b(g,d,f)}}function c(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(l)){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)));g.call(b,d,e,f,c)}return b}var f={yyyy:d("FullYear",4),yy:d("FullYear",2,0,!0),y:d("FullYear",1),MMMM:c("Month"),MMM:c("Month",!0),MM:d("Month",2,1),M:d("Month",1,1),dd:d("Date",2),d:d("Date",1),HH:d("Hours",2),H:d("Hours",1),hh:d("Hours",2,-12),h:d("Hours",1,-12),mm:d("Minutes",2),m:d("Minutes",1),ss:d("Seconds",
2),s:d("Seconds",1),sss:d("Milliseconds",3),EEEE:c("Day"),EEE:c("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=(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+$/,l=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/,k=/^(\d+)-(\d+)-(\d{4})$/,m=/^(\d+)\s+(\d+),(\d{4})$/;
Da.date=function(b,c){var d=Da.date.locate,l="",N=[],n,Z;c=c||"mediumDate";c=d[c]||c;if("string"===typeof b){if(h.test(b))b=parseInt(b,10);else{Z=b.trim();if(Z.match(k)||Z.match(m))b=RegExp.$3+"/"+RegExp.$1+"/"+RegExp.$2;b=e(b)}b=new Date(b)}"number"===typeof b&&(b=new Date(b));if("date"===L(b)){for(;c;)(Z=g.exec(c))?(N=N.concat(Z.slice(1)),c=N.pop()):(N.push(c),c=null);N.forEach(function(c){n=f[c];l+=n?n(b,d):c.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return l}};var n={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",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 ah:mm:ss",mediumDate:"yyyy-M-d",mediumTime:"ah:mm:ss","short":"yy-M-d ah:mm",shortDate:"yy-M-d",shortTime:"ah:mm"};n.SHORTMONTH=n.MONTH;Da.date.locate=n};var E,r=avalon.modules={"ready!":{exports:avalon},avalon:{exports:avalon,state:2}};new function(){function b(b){return(b||"").replace(/[?#].*/,"")}function d(b){var c;try{a.b.c()}catch(d){c=d.stack}if(c)return c=c.split(/[@ ]/g).pop(),c="("===c[0]?c.slice(1,-1):c.replace(/\s/,""),c.replace(/(:\d+)?:\d+$/i,
"");c=(b?p:J).getElementsByTagName("script");for(var e=c.length,f;f=c[--e];)if((b||f.className===z)&&"interactive"===f.readyState)return f.className=f.src}function c(b,d){for(var e in b)if("\u53f8\u5f92\u6b63\u7f8e"===b[e]&&2!==r[e].state&&(e===d||c(r[e].deps,d)))return!0}function e(){var b=k.length,c;a:for(;c=k[--b];){c=r[c];var d=c.deps,f;for(f in d)if(Ia.call(d,f)&&2!==r[f].state)continue a;2!==c.state&&(k.splice(b,1),l(c.id,c.args,c.factory),e())}}function f(c,d){var e=b(c.src);c.onload=c.onerror=
null;if(d)setTimeout(function(){J.removeChild(c)}),B("debug: \u52a0\u8f7d "+e+" \u5931\u8d25"+d+" "+!r[e].state);else return!0}function g(c,d,e,f){if("ready!"===c||r[c]&&2===r[c].state)return c;var g;c=c.replace(/^\w+!/,function(b){g=b.slice(0,-1);return""});g=g||"js";g=K[g]||A;"object"===typeof s.shim[c]&&(f=s.shim[c]);s.paths[c]&&(c=s.paths[c]);if(/^(\w+)(\d)?:.*/.test(c))e=c;else{d=d.substr(0,d.lastIndexOf("/"));var h=c.charAt(0);if("."!==h&&"/"!==h)e=n+c;else if("./"===c.slice(0,2))e=d+c.slice(1);
else if(".."===c.slice(0,2))for(e=d+"/"+c;u.test(e);)e=e.replace(u,"");else"/"===h?e=d+c:avalon.error("\u4e0d\u7b26\u5408\u6a21\u5757\u6807\u8bc6\u89c4\u5219: "+c)}c=b(e);(d=g.ext)&&c.slice(0-d.length)!==d&&(e+=d);s.nocache&&(e+=(-1===e.indexOf("?")?"?":"&")+Date.now());return g(e,f)}function h(b,c,d){var e=p.createElement("script");e.className=z;e.onload=function(){var e=m.pop();e&&e.delay(c);d&&d();B("debug: \u5df2\u6210\u529f\u52a0\u8f7d "+b)};e.onerror=function(){f(e,!0)};e.src=b;J.appendChild(e);
B("debug: \u6b63\u51c6\u5907\u52a0\u8f7d "+b)}function l(b,c,d){for(var e=0,f=[],g;g=c[e++];)f.push(r[g].exports);c=Object(r[b]);d=d.apply(v,f);c.state=2;void 0!==d&&(r[b].exports=d);return d}var k=[],m=[],n;K.js=function(c,d){var e=b(c);r[e]||(r[e]={id:e,exports:{}},d?E(d.deps||"",function(){h(c,e,function(){r[e].state=2;d.exports&&(r[e].exports="function"===typeof d.exports?d.exports():v[d.exports]);E.checkDeps()})}):h(c,e));return e};K.css=function(b){var c=b.replace(/(#.+|\W)/g,"");if(!p.getElementById(c)){var d=
p.createElement("link");d.rel="stylesheet";d.href=b;d.id=c;J.insertBefore(d,J.firstChild)}};K.css.ext=".css";K.js.ext=".js";K.text=function(b){var c=new XMLHttpRequest,d=b.replace(/[?#].*/,"");r[d]={};c.onload=function(){r[d].state=2;r[d].exports=c.responseText;E.checkDeps()};c.onerror=function(){avalon.error(b+" \u5bf9\u5e94\u8d44\u6e90\u4e0d\u5b58\u5728\u6216\u6ca1\u6709\u5f00\u542f CORS")};c.open("GET",b,!0);c.withCredentials=!0;c.setRequestHeader("X-Requested-With","XMLHttpRequest");c.send();
return d};"import"in p.createElement("link")&&(K.text=function(b){function c(d,f){f&&avalon.error(b+"\u5bf9\u5e94\u8d44\u6e90\u4e0d\u5b58\u5728\u6216\u6ca1\u6709\u5f00\u542f CORS");setTimeout(function(){J.removeChild(e)})}var d=b.replace(/[?#].*/,"");r[d]={};var e=p.createElement("link");e.rel="import";e.href=b;e.onload=function(){r[d].state=2;var b=this["import"];b&&(r[d].exports=b.documentElement.outerHTML,avalon.require.checkDeps());c(0,b)};e.onerror=c;J.appendChild(e);return d});var q=d(!0);q||
(q=avalon.slice(document.scripts).pop().src);q=b(q);n=s.base=q.slice(0,q.lastIndexOf("/")+1);var u=/\/\w+\/\.\./;E=avalon.require=function(b,c,d){var f={},h=[],m=0,q=0,p=d||"callback"+setTimeout("1");d=d||n;String(b).replace(y,function(b){if(b=g(b,d))m++,r[b]&&2===r[b].state&&q++,f[b]||(h.push(b),f[b]="\u53f8\u5f92\u6b63\u7f8e")});r[p]={id:p,factory:c,deps:f,args:h,state:1};m===q?l(p,h,c):k.unshift(p);e()};E.define=function(e,f,g){var h=avalon.slice(arguments);if("string"===typeof e)var k=h.shift();
"function"===typeof h[0]&&h.unshift([]);var l=r[k]&&1<=r[k].state?k:b(d());!r[l]&&k&&(r[l]={id:l,factory:g,state:1});g=h[1];g.id=k;g.delay=function(b){h.push(b);var d=!0;try{d=c(r[b].deps,b)}catch(e){}d&&avalon.error(b+"\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"+b+"\u6a21\u5757");delete g.delay;E.apply(null,h)};l?g.delay(l,h):m.push(g)};E.define.amd=r;E.config=s;E.checkDeps=e};var jb=
navigator.pointerEnabled,kb=navigator.msPointerEnabled;("ontouchstart"in v||kb||jb)&&function(){function b(){e.last&&(e.fire("hold"),e={})}function d(b){return("touch"===b.pointerType||b.pointerType===b.MSPOINTER_TYPE_TOUCH)&&b.isPrimary}function c(b,c){return b.type==="pointer"+c||b.type.toLowerCase()==="mspointer"+c}var e={},f,g,h,l,k,m,n,q,r=0,s=0,t=[],t=jb?["pointerdown","pointermove","pointerup","pointercancel"]:kb?["MSPointerDown","MSPointerMove","MSPointerUp","MSPointerCancel"]:["touchstart",
"touchmove","touchend","touchcancel"];p.addEventListener(t[0],function(g){if(!(n=c(g,"down"))||d(g))m=n?g:g.touches[0],g.touches&&(1===g.touches.length&&e.x2)&&(e.x2=e.y2=void 0),k=Date.now(),q=k-(e.last||k),g=m.target,e.el="tagName"in g?g:g.parentNode,clearTimeout(f),e.x1=m.pageX,e.y1=m.pageY,e.fire=function(b){avalon.fire(this.el,b)},0<q&&250>=q&&(e.isDoubleTap=!0),e.last=k,l=setTimeout(b,750)});p.addEventListener(t[1],function(b){if(!(n=c(b,"move"))||d(b))m=n?b:b.touches[0],clearTimeout(l),e.x2=
m.pageX,e.y2=m.pageY,r+=Math.abs(e.x1-e.x2),s+=Math.abs(e.y1-e.y2)});p.addEventListener(t[2],function(b){if(!(n=c(b,"up"))||d(b))clearTimeout(l),e.x2&&30<Math.abs(e.x1-e.x2)||e.y2&&30<Math.abs(e.y1-e.y2)?h=setTimeout(function(){e.fire("swipe");e.fire("swipe"+(Math.abs(e.x1-e.x2)>=Math.abs(e.y1-e.y2)?0<e.x1-e.x2?"left":"right":0<e.y1-e.y2?"up":"down"));e={}},0):"last"in e&&(30>r&&30>s?g=setTimeout(function(){e.fire("tap");e.isDoubleTap?(e.fire("doubletap"),e={}):f=setTimeout(function(){e.fire("singletap");
e={}},250)},0):e={}),r=s=0});p.addEventListener(t[3],function(){clearTimeout(f);clearTimeout(g);clearTimeout(h);clearTimeout(l);e={}})}();"complete"===p.readyState?setTimeout(ia):(p.addEventListener("DOMContentLoaded",ia),v.addEventListener("load",ia));avalon.ready=function(b){E("ready!",b)};avalon.config({loader:!0});avalon.ready(function(){for(var b=p.querySelectorAll("[ms-controller],[ms-important]"),d=[],c=0,e;e=b[c++];)if(!e.__root__){for(var f=e.querySelectorAll("[ms-controller],[ms-important]"),
g=0,h;h=f[g++];)h.__root__=!0;d.push(e)}for(c=0;e=d[c++];)avalon.scan(e)})})(document);