0;k=v[e];e++)if(t.value===k.value){t.moved=k.index;k.moved=t.index;v.splice(e,1);b=e=0;break}b+=e}}returng.reverse()}functionT(a,d,c,e,f){f=f||{};varg=a&&N(a),g=g&&g.ownerDocument,h=f.templateEngine||O;b.za.vb(c,h,g);c=h.renderTemplate(c,e,f,g);("number"!=typeofc.length||0<c.length&&"number"!=typeofc[0].nodeType)&&j(Error("Template engine must return an array of DOM nodes"));g=r;switch(d){case"replaceChildren":b.e.N(a,c);g=m;break;case"replaceNode":b.a.Ya(a,c);g=m;break;case"ignoreTargetNode":break;
e[g];"function"===typeofh?(g=h(a[f].value))&&j(Error(g)):h||j(Error("This template engine does not support the '"+g+"' binding within its templates"))}}a="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+b.g.ba(a)+" } })()})";returnc.createJavaScriptEvaluatorBlock(a)+d}functionX(a,d,c,e){functionf(a){returnfunction(){returnk[a]}}functiong(){returnk}varh=0,k,l;b.j(function(){varn=c&&cinstanceofb.z?c:newb.z(b.a.d(c)),q=n.$data;e&&b.eb(a,n);if(k=("function"==typeofd?
d(n,a):d)||b.J.instance.getBindings(a,n)){if(0===h){h=1;for(varsink){varv=b.c[s];v&&8===a.nodeType&&!b.e.I[s]&&j(Error("The binding '"+s+"' cannot be used with virtual elements"));if(v&&"function"==typeofv.init&&(v=(0,v.init)(a,f(s),g,q,n))&&v.controlsDescendantBindings)l!==I&&j(Error("Multiple bindings ("+l+" and "+s+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.")),l=s}h=2}if(2===h)for(sink)(v=b.c[s])&&"function"==
typeofv.update&&(0,v.update)(a,f(s),g,q,n)}},p,{W:a});return{Nb:l===I}}functionY(a,d,c){vare=m,f=1===d.nodeType;f&&b.e.Ta(d);if(f&&c||b.J.instance.nodeHasBindings(d))e=X(d,p,a,c).Nb;e&&Z(a,d,!f)}functionZ(a,d,c){for(vare=b.e.firstChild(d);d=e;)e=b.e.nextSibling(d),Y(a,d,c)}function$(a,b){varc=aa(a,b);returnc?0<c.length?c[c.length-1].nextSibling:a.nextSibling:p}functionaa(a,b){for(varc=a,e=1,f=[];c=c.nextSibling;){if(H(c)&&(e--,0===e))returnf;f.push(c);B(c)&&e++}b||j(Error("Cannot find closing comment tag to match: "+
d,function(a){c.call(b,a)}):j(Error("Browser doesn't support addEventListener or attachEvent"))},Ba:function(b,d){(!b||!b.nodeType)&&j(Error("element must be a DOM node when calling triggerEvent"));if("undefined"!=typeofF){varc=[];a(b,d)&&c.push({nb:b.checked});F(b).trigger(d,c)}else"function"==typeofy.createEvent?"function"==typeofb.dispatchEvent?(c=y.createEvent(e[d]||"HTMLEvents"),c.initEvent(d,m,m,x,0,0,0,0,0,r,r,r,r,0,b),b.dispatchEvent(c)):j(Error("The supplied element doesn't support dispatchEvent")):
"undefined"!=typeofb.fireEvent?(a(b,d)&&(b.checked=b.checked!==m),b.fireEvent("on"+d)):j(Error("Browser doesn't support triggering events"))},d:function(a){returnb.$(a)?a():a},ua:function(a){returnb.$(a)?a.t():a},da:function(a,d,c){if(d){vare=/[\w-]+/g,f=a.className.match(e)||[];b.a.o(d.match(e),function(a){vard=b.a.i(f,a);0<=d?c||f.splice(d,1):c&&f.push(a)});a.className=f.join(" ")}},cb:function(a,d){varc=b.a.d(d);if(c===p||c===I)c="";if(3===a.nodeType)a.data=c;else{vare=b.e.firstChild(a);
j(Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js"));returnJSON.stringify(b.a.d(a),d,c)},Jb:function(a,d,c){c=c||{};vare=c.params||{},f=c.includeFields||this.Na,g=a;if("object"==typeofa&&"form"===b.a.u(a))for(varg=a.action,h=f.length-1;0<=h;h--)for(vark=b.a.Oa(a,f[h]),l=k.length-1;0<=l;l--)e[k[l].name]=k[l].value;d=b.a.d(d);varn=y.createElement("form");
varc="__ko_domNodeDisposal__"+(newDate).getTime(),e={1:m,8:m,9:m},f={1:m,9:m};return{Ca:function(b,d){"function"!=typeofd&&j(Error("Callback must be a function"));a(b,m).push(d)},Xa:function(d,e){varf=a(d,r);f&&(b.a.ga(f,e),0==f.length&&b.a.f.set(d,c,I))},A:function(a){if(e[a.nodeType]&&(d(a),f[a.nodeType])){varc=[];b.a.P(c,a.getElementsByTagName("*"));for(vark=0,l=c.length;k<l;k++)d(c[k])}returna},removeNode:function(a){b.A(a);a.parentNode&&a.parentNode.removeChild(a)}}};b.A=b.a.F.A;b.removeNode=
"undefined"!=typeofF)F(a).html(d);elsefor(varc=b.a.ta(d),e=0;e<c.length;e++)a.appendChild(c[e])};b.b("utils.parseHtmlFragment",b.a.ta);b.b("utils.setHtml",b.a.ca);varR={};b.s={ra:function(a){"function"!=typeofa&&j(Error("You can only pass a function to ko.memoization.memoize()"));varb=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);R[b]=a;return"\x3c!--[ko_memo:"+b+"]--\x3e"},hb:function(a,b){varc=R[a];c===I&&j(Error("Couldn't find any memo with ID "+
a+". Perhaps it's already been unmemoized."));try{returnc.apply(p,b||[]),m}finally{deleteR[a]}},ib:function(a,d){varc=[];ca(a,c);for(vare=0,f=c.length;e<f;e++){varg=c[e].sb,h=[g];d&&b.a.P(h,d);b.s.hb(c[e].Fb,h);g.nodeValue="";g.parentNode&&g.parentNode.removeChild(g)}},Ua:function(a){return(a=a.match(/^\[ko_memo\:(.*?)\]$/))?a[1]:p}};b.b("memoization",b.s);b.b("memoization.memoize",b.s.ra);b.b("memoization.unmemoize",b.s.hb);b.b("memoization.parseMemoText",b.s.Ua);b.b("memoization.unmemoizeDomNodeAndDescendants",
b.Ma[c];"function"==typeofe&&(d=e(d,a[c]))}returnd}};b.Qa=function(a){return"function"==typeofa.ya&&"function"==typeofa.notifySubscribers};b.b("subscribable",b.S);b.b("isSubscribable",b.Qa);varC=[];b.r={mb:function(a){C.push({ha:a,La:[]})},end:function(){C.pop()},Wa:function(a){b.Qa(a)||j(Error("Only subscribable things can act as dependencies"));if(0<C.length){vard=C[C.length-1];d&&!(0<=b.a.i(d.La,a))&&(d.La.push(a),d.ha(a))}},K:function(a,b,c){try{returnC.push(p),a.apply(b,c||[])}finally{C.pop()}}};
b){returna===p||typeofainma?a===b:r}};varE=b.m.Kb="__ko_proto__";b.m.fn[E]=b.m;b.ma=function(a,d){returna===p||a===I||a[E]===I?r:a[E]===d?m:b.ma(a[E],d)};b.$=function(a){returnb.ma(a,b.m)};b.Ra=function(a){return"function"==typeofa&&a[E]===b.m||"function"==typeofa&&a[E]===b.j&&a.zb?m:r};b.b("observable",b.m);b.b("isObservable",b.$);b.b("isWriteableObservable",b.Ra);b.R=function(a){0==arguments.length&&(a=[]);a!==p&&(a!==I&&!("length"ina))&&j(Error("The argument passed when initializing an observable array must be an array, or null, or undefined."));
"beforeChange");l=c}finally{b.r.end()}h.notifySubscribers(l);q=r;z.length||A()}}functionh(){if(0<arguments.length)return"function"===typeofv?v.apply(d,arguments):j(Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.")),this;n||g();b.r.Wa(h);returnl}functionk(){return!n||0<z.length}varl,n=r,q=r,s=a;s&&"object"==typeofs?(c=s,s=c.read):(c=c||{},s||(s=c.read));"function"!=typeofs&&j(Error("Pass a function that returns the value of the ko.computed"));
b.Bb=function(a){returnb.ma(a,b.j)};w=b.m.Kb;b.j[w]=b.m;b.j.fn={};b.j.fn[w]=b.j;b.b("dependentObservable",b.j);b.b("computed",b.j);b.b("isComputed",b.Bb);b.gb=function(a){0==arguments.length&&j(Error("When calling ko.toJS, pass the object you want to convert."));returnba(a,function(a){for(varc=0;b.$(a)&&10>c;c++)a=a();returna})};b.toJSON=function(a,d,c){a=b.gb(a);returnb.a.xa(a,d,c)};b.b("toJS",b.gb);b.b("toJSON",b.toJSON);b.k={q:function(a){switch(b.a.u(a)){case"option":returna.__ko__hasDomDataOptionValue__===
p;case8:returnb.e.jb(a)!=p;default:returnr}},getBindings:function(a,b){varc=this.getBindingsString(a,b);returnc?this.parseBindingsString(c,b,a):p},getBindingsString:function(a){switch(a.nodeType){case1:returna.getAttribute("data-bind");case8:returnb.e.jb(a);default:returnp}},parseBindingsString:function(a,d,c){try{vare;if(!(e=this.Ha[a])){varf=this.Ha,g,h="with($context){with($data||{}){return{"+b.g.ba(a)+"}}}";g=newFunction("$context","$element",h);e=f[a]=g}returne(d,c)}catch(k){j(Error("Unable to parse bindings.\nMessage: "+
arguments.length)b.a.f.set(a,"__ko_bindingContext__",d);elsereturnb.a.f.get(a,"__ko_bindingContext__")};b.Fa=function(a,d,c){1===a.nodeType&&b.e.Ta(a);returnX(a,d,c,m)};b.Ea=function(a,b){(1===b.nodeType||8===b.nodeType)&&Z(a,b,m)};b.Da=function(a,b){b&&(1!==b.nodeType&&8!==b.nodeType)&&j(Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node"));b=b||x.document.body;Y(a,b,m)};b.ja=function(a){switch(a.nodeType){case1:case8:vard=b.eb(a);if(d)returnd;
b){returna.createChildContext(b)});b.c.options={update:function(a,d,c){"select"!==b.a.u(a)&&j(Error("options binding applies only to SELECT elements"));for(vare=0==a.length,f=b.a.V(b.a.fa(a.childNodes,function(a){returna.tagName&&"option"===b.a.u(a)&&a.selected}),function(a){returnb.k.q(a)||a.innerText||a.textContent}),g=a.scrollTop,h=b.a.d(d());0<a.length;)b.A(a.options[0]),a.remove(0);if(h){c=c();vark=c.optionsIncludeDestroyed;"number"!=typeofh.length&&(h=[h]);if(c.optionsCaption){varl=y.createElement("option");
b.c.options.sa="__ko.optionValueDomData__";b.c.selectedOptions={init:function(a,d,c){b.a.n(a,"change",function(){vare=d(),f=[];b.a.o(a.getElementsByTagName("option"),function(a){a.selected&&f.push(b.k.q(a))});b.g.ea(e,c,"value",f)})},update:function(a,d){"select"!=b.a.u(a)&&j(Error("values binding applies only to SELECT elements"));varc=b.a.d(d());c&&"number"==typeofc.length&&b.a.o(a.getElementsByTagName("option"),function(a){vard=0<=b.a.i(c,b.k.q(a));b.a.bb(a,d)})}};b.c.style={update:function(a,
d){varc=b.a.d(d()||{}),e;for(einc)if("string"==typeofe){varf=b.a.d(c[e]);a.style[e]=f||""}}};b.c.submit={init:function(a,d,c,e){"function"!=typeofd()&&j(Error("The value for a submit binding must be a function"));b.a.n(a,"submit",function(b){varc,h=d();try{c=h.call(e,a)}finally{c!==m&&(b.preventDefault?b.preventDefault():b.returnValue=r)}})}};b.c.text={update:function(a,d){b.a.cb(a,d())}};b.e.I.text=m;b.c.uniqueName={init:function(a,d){if(d()){varc="ko_unique_"+++b.c.uniqueName.ob;b.a.ab(a,
d,c){d.isTemplateRewritten(a,c)||d.rewriteTemplate(a,function(a){returnb.za.Gb(a,d)},c)},Gb:function(a,b){returna.replace(qa,function(a,e,f,g,h,k,l){returnW(l,e,b)}).replace(ra,function(a,e){returnW(e,"\x3c!-- ko --\x3e",b)})},kb:function(a){returnb.s.ra(function(d,c){d.nextSibling&&b.Fa(d.nextSibling,a,c)})}};b.b("__tr_ambtns",b.za.kb);b.l={};b.l.h=function(a){this.h=a};b.l.h.prototype.text=function(){vara=b.a.u(this.h),a="script"===a?"text":"textarea"===a?"value":"innerHTML";if(0==arguments.length)returnthis.h[a];
function(){if(0==arguments.length)return(b.a.f.get(this.h,"__ko_anon_template__")||{}).ia;b.a.f.set(this.h,"__ko_anon_template__",{ia:arguments[0]})};b.b("templateSources",b.l);b.b("templateSources.domElement",b.l.h);b.b("templateSources.anonymousTemplate",b.l.O);varO;b.wa=function(a){a!=I&&!(ainstanceofb.v)&&j(Error("templateEngine must inherit from ko.templateEngine"));O=a};b.va=function(a,d,c,e,f){c=c||{};(c.templateEngine||O)==I&&j(Error("Set a template engine before calling renderTemplate"));
b.g.Eb(a,"name")?p:"This template engine does not support anonymous templates nested within its templates"};b.e.I.template=m;b.b("setTemplateEngine",b.wa);b.b("renderTemplate",b.va);b.a.Ja=function(a,b,c){a=a||[];b=b||[];returna.length<=b.length?S(a,b,"added","deleted",c):S(b,a,"deleted","added",c)};b.b("utils.compareArrays",b.a.Ja);b.a.$a=function(a,d,c,e,f){functiong(a,b){t=l[b];w!==b&&(z[a]=t);t.na(w++);M(t.M);s.push(t);A.push(t)}functionh(a,c){if(a)for(vard=0,e=c.length;d<e;d++)c[d]&&b.a.o(c[d].M,
r};b.C.prototype=newb.v;b.C.prototype.renderTemplateSource=function(a){vard=!(9>b.a.Z)&&a.nodes?a.nodes():p;if(d)returnb.a.L(d.cloneNode(m).childNodes);a=a.text();returnb.a.ta(a)};b.C.oa=newb.C;b.wa(b.C.oa);b.b("nativeTemplateEngine",b.C);b.qa=function(){vara=this.Db=function(){if("undefined"==typeofF||!F.tmpl)return0;try{if(0<=F.tmpl.tag.tmpl.open.toString().indexOf("__"))return2}catch(a){}return1}();this.renderTemplateSource=function(b,c,e){e=e||{};2>a&&j(Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later."));