(function(){function u(n){throw n;}function s(n){return function(){return n}}function h(h){function gt(n,i,u,f,e){var o=[],n=l.j(function(){var n=i(u,e)||[];0<o.length&&(l.a.Xa(k(o),n),f&&l.r.K(f,t,[u,n,e]));o.splice(0,o.length);l.a.P(o,n)},t,{W:n,Ja:function(){return 0==o.length||!l.a.X(o[0])}});return{M:o,j:n.oa()?n:r}}function k(n){for(;n.length&&!l.a.X(n[0]);)n.splice(0,1);if(1<n.length){for(var t=n[0],r=n[n.length-1],i=[t];t!==r;){if(t=t.nextSibling,!t)return;i.push(t)}Array.prototype.splice.apply(n,[0,n.length].concat(i))}return n}function ut(n,t,i,r,u){for(var o=Math.min,l=Math.max,s=[],a=n.length,f,h=t.length,c=h-a||1,w=a+h+1,v,p,b,n,y,t,e=0;e<=a;e++)for(p=v,s.push(v=[]),b=o(h,e+c),f=l(0,e-1);f<=b;f++)v[f]=f?e?n[e-1]===t[f-1]?p[f-1]:o(p[f]||w,v[f-1]||w)+1:f+1:e+1;for(o=[],l=[],c=[],e=a,f=h;e||f;)h=s[e][f]-1,f&&h===s[e][f-1]?l.push(o[o.length]={status:i,value:t[--f],index:f}):e&&h===s[e-1][f]?c.push(o[o.length]={status:r,value:n[--e],index:e}):(o.push({status:"retained",value:t[--f]}),--e);if(l.length&&c.length)for(n=10*a,t=i=0;(u||t<n)&&(y=l[i]);i++){for(r=0;s=c[r];r++)if(y.value===s.value){y.moved=s.index;s.moved=y.index;c.splice(r,1);t=r=0;break}t+=r}return o.reverse()}function ft(r,f,e,o,s){var s=s||{},h=r&&d(r),h=h&&h.ownerDocument,c=s.templateEngine||rt;l.ya.ub(e,c,h);e=c.renderTemplate(e,o,s,h);("number"!=typeof e.length||0<e.length&&"number"!=typeof e[0].nodeType)&&u(Error("Template engine must return an array of DOM nodes"));h=i;switch(f){case"replaceChildren":l.e.N(r,e);h=n;break;case"replaceNode":l.a.Xa(r,e);h=n;break;case"ignoreTargetNode":break;default:u(Error("Unknown renderMode: "+f))}return h&&(et(e,o),s.afterRender&&l.r.K(s.afterRender,t,[e,o.$data])),e}function d(n){return n.nodeType?n:0<n.length?n[0]:t}function et(n,t){if(n.length){var i=n[0],r=n[n.length-1];ot(i,r,function(n){l.Ca(t,n)});ot(i,r,function(n){l.s.hb(n,[t])})}}function ot(n,t,i){for(var r,t=l.e.nextSibling(t);n&&(r=n)!==t;)n=l.e.nextSibling(r),(1===r.nodeType||8===r.nodeType)&&i(r)}function st(n,t,i){for(var r,e,n=l.g.aa(n),o=l.g.Q,f=0;f<n.length;f++)r=n[f].key,o.hasOwnProperty(r)&&(e=o[r],"function"==typeof e?(r=e(n[f].value))&&u(Error(r)):e||u(Error("This template engine does not support the '"+r+"' binding within its templates")));return n="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+l.g.ba(n)+" } })()})",i.createJavaScriptEvaluatorBlock(n)+t}function ht(n,i,f,e){function c(n){return function(){return o[n]}}function a(){return o}var s=0,o,h;return l.j(function(){var y=f&&f instanceof l.z?f:new l.z(l.a.d(f)),p=y.$data,t,v;if(e&&l.cb(n,y),o=("function"==typeof i?i(y,n):i)||l.J.instance.getBindings(n,y)){if(0===s){s=1;for(t in o)v=l.c[t],v&&8===n.nodeType&&!l.e.I[t]&&u(Error("The binding '"+t+"' cannot be used with virtual elements")),v&&"function"==typeof v.init&&(v=v.init(n,c(t),a,p,y))&&v.controlsDescendantBindings&&(h!==r&&u(Error("Multiple bindings ("+h+" and "+t+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.")),h=t);s=2}if(2===s)for(t in o)(v=l.c[t])&&"function"==typeof v.update&&v.update(n,c(t),a,p,y)}},t,{W:n}),{Mb:h===r}}function ct(i,r,u){var e=n,f=1===r.nodeType;f&&l.e.Sa(r);(f&&u||l.J.instance.nodeHasBindings(r))&&(e=ht(r,t,i,u).Mb);e&&lt(i,r,!f)}function lt(n,t,i){for(var r=l.e.firstChild(t);t=r;)r=l.e.nextSibling(t),ct(n,t,i)}function at(n,i){var r=vt(n,i);return r?0<r.length?r[r.length-1].nextSibling:n.nextSibling:t}function vt(n,i){for(var r=n,f=1,e=[];r=r.nextSibling;){if(p(r)&&(f--,0===f))return e;e.push(r);a(r)&&f++}return i||u(Error("Cannot find closing comment tag to match: "+n.nodeValue)),t}function p(n){return 8==n.nodeType&&(b?n.text:n.nodeValue).match(fi)}function a(n){return 8==n.nodeType&&(b?n.text:n.nodeValue).match(ui)}function g(n,i){for(var r=t;n!=r;)r=n,n=n.replace(ti,function(n,t){return i[t]});return n}function ni(){var n=[],t=[];this.save=function(i,r){var u=l.a.i(n,i);0<=u?t[u]=r:(n.push(i),t.push(r))};this.get=function(i){return i=l.a.i(n,i),0<=i?t[i]:r}}function yt(n,i,u){function s(t){var f=i(n[t]),o;switch(typeof f){case"boolean":case"number":case"string":case"function":e[t]=f;break;case"object":case"undefined":o=u.get(f);e[t]=o!==r?o:yt(f,i,u)}}var e,o,f;if(u=u||new ni,n=i(n),!("object"==typeof n&&n!==t&&n!==r&&!(n instanceof Date)))return n;if(e=n instanceof Array?[]:{},u.save(n,e),o=n,o instanceof Array){for(f=0;f<o.length;f++)s(f);"function"==typeof o.toJSON&&s("toJSON")}else for(f in o)s(f);return e}function pt(n,i){var r;if(n)if(8==n.nodeType)r=l.s.Ta(n.nodeValue),r!=t&&i.push({rb:n,Eb:r});else if(1==n.nodeType)for(var r=0,u=n.childNodes,f=u.length;r<f;r++)pt(u[r],i)}function nt(t,r,u,f){l.c[t]={init:function(t){return l.a.f.set(t,it,{}),{controlsDescendantBindings:n}},update:function(t,i,e,o,s){var e=l.a.f.get(t,it),i=l.a.d(i()),o=!u!=!i,h=!e.Ya;(h||r||o!==e.pb)&&(h&&(e.Ya=l.a.Ha(l.e.childNodes(t),n)),o?(h||l.e.N(t,l.a.Ha(e.Ya)),l.Da(f?f(s,i):s,t)):l.e.Y(t),e.pb=o)}};l.g.Q[t]=i;l.e.I[t]=n}function wt(n,i,r){r&&i!==l.k.q(n)&&l.k.T(n,i);i!==l.k.q(n)&&l.r.K(l.a.Aa,t,[n,"change"])}var l="undefined"!=typeof h?h:{},w,v,bt,y,tt,it,kt,dt,rt;l.b=function(n,t){for(var i=n.split("."),r=l,u=0;u<i.length-1;u++)r=r[i[u]];r[i[i.length-1]]=t};l.p=function(n,t,i){n[t]=i};l.version="2.2.0";l.b("version",l.version);l.a=new function(){function p(n,t){if("input"!==l.a.u(n)||!n.type||"click"!=t.toLowerCase())return i;var r=n.type;return"checkbox"==r||"radio"==r}var d=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,s={},w={},a,v,y,b,k,h;s[/Firefox\/2/i.test(c.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"];s.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" ");for(a in s)if(v=s[a],v.length)for(y=0,b=v.length;y<b;y++)w[v[y]]=a;for(k={propertychange:n},s=3,a=e.createElement("div"),v=a.getElementsByTagName("i");a.innerHTML="<!--[if gt IE "+ ++s+"]><i><\/i><![endif]-->",v[0];);return h=4<s?s:r,{Ma:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],o:function(n,t){for(var i=0,r=n.length;i<r;i++)t(n[i])},i:function(n,t){if("function"==typeof Array.prototype.indexOf)return Array.prototype.indexOf.call(n,t);for(var i=0,r=n.length;i<r;i++)if(n[i]===t)return i;return-1},kb:function(n,i,r){for(var u=0,f=n.length;u<f;u++)if(i.call(r,n[u]))return n[u];return t},ga:function(n,t){var i=l.a.i(n,t);0<=i&&n.splice(i,1)},Fa:function(n){for(var n=n||[],i=[],t=0,r=n.length;t<r;t++)0>l.a.i(i,n[t])&&i.push(n[t]);return i},V:function(n,t){for(var n=n||[],r=[],i=0,u=n.length;i<u;i++)r.push(t(n[i]));return r},fa:function(n,t){for(var n=n||[],r=[],i=0,u=n.length;i<u;i++)t(n[i])&&r.push(n[i]);return r},P:function(n,t){if(t instanceof Array)n.push.apply(n,t);else for(var i=0,r=t.length;i<r;i++)n.push(t[i]);return n},extend:function(n,t){if(t)for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);return n},ka:function(n){for(;n.firstChild;)l.removeNode(n.firstChild)},Gb:function(n){for(var n=l.a.L(n),i=e.createElement("div"),t=0,r=n.length;t<r;t++)i.appendChild(l.A(n[t]));return i},Ha:function(t,i){for(var u,r=0,e=t.length,f=[];r<e;r++)u=t[r].cloneNode(n),f.push(i?l.A(u):u);return f},N:function(n,t){if(l.a.ka(n),t)for(var i=0,r=t.length;i<r;i++)n.appendChild(t[i])},Xa:function(n,t){var r=n.nodeType?[n]:n;if(0<r.length){for(var f=r[0],e=f.parentNode,i=0,u=t.length;i<u;i++)e.insertBefore(t[i],f);for(i=0,u=r.length;i<u;i++)l.removeNode(r[i])}},ab:function(n,t){7>h?n.setAttribute("selected",t):n.selected=t},D:function(n){return(n||"").replace(d,"")},Qb:function(n,t){for(var r,u=[],f=(n||"").split(t),i=0,e=f.length;i<e;i++)r=l.a.D(f[i]),""!==r&&u.push(r);return u},Nb:function(n,t){return n=n||"",t.length>n.length?i:n.substring(0,t.length)===t},sb:function(r,u){if(u.compareDocumentPosition)return 16==(u.compareDocumentPosition(r)&16);for(;r!=t;){if(r==u)return n;r=r.parentNode}return i},X:function(n){return l.a.sb(n,n.ownerDocument)},u:function(n){return n&&n.tagName&&n.tagName.toLowerCase()},n:function(t,r,e){var o=h&&k[r],s,e;o||"undefined"==typeof f?!o&&"function"==typeof t.addEventListener?t.addEventListener(r,e,i):"undefined"!=typeof t.attachEvent?t.attachEvent("on"+r,function(n){e.call(t,n)}):u(Error("Browser doesn't support addEventListener or attachEvent")):(p(t,r)&&(s=e,e=function(t,i){var r=this.checked;i&&(this.checked=i.mb!==n);s.call(this,t);this.checked=r}),f(t).bind(r,e))},Aa:function(t,r){if(t&&t.nodeType||u(Error("element must be a DOM node when calling triggerEvent")),"undefined"!=typeof f){var s=[];p(t,r)&&s.push({mb:t.checked});f(t).trigger(r,s)}else"function"==typeof e.createEvent?"function"==typeof t.dispatchEvent?(s=e.createEvent(w[r]||"HTMLEvents"),s.initEvent(r,n,n,o,0,0,0,0,0,i,i,i,i,0,t),t.dispatchEvent(s)):u(Error("The supplied element doesn't support dispatchEvent")):"undefined"!=typeof t.fireEvent?(p(t,r)&&(t.checked=t.checked!==n),t.fireEvent("on"+r)):u(Error("Browser doesn't support triggering events"))},d:function(n){return l.$(n)?n():n},ta:function(n){return l.$(n)?n.t():n},da:function(n,t,i){if(t){var u=/[\w-]+/g,r=n.className.match(u)||[];l.a.o(t.match(u),function(n){var t=l.a.i(r,n);0<=t?i||r.splice(t,1):i&&r.push(n)});n.className=r.join(" ")}},bb:function(n,i){var u=l.a.d(i),f;(u===t||u===r)&&(u="");3===n.nodeType?n.data=u:(f=l.e.firstChild(n),!f||3!=f.nodeType||l.e.nextSibling(f)?l.e.N(n,[e.createTextNode(u)]):f.data=u,l.a.vb(n))},$a:function(n,t){if(n.name=t,7>=h)try{n.mergeAttributes(e.createElement("<input name='"+n.name+"'/>"),i)}catch(r){}},vb:function(n){9<=h&&(n=1==n.nodeType?n:n.parentNode,n.style&&(n.style.zoom=n.style.zoom))},tb:function(n){if(9<=h){var t=n.style.width;n.style.width=0;n.style.width=t}},Kb:function(n,t){for(var n=l.a.d(n),t=l.a.d(t),r=[],i=n;i<=t;i++)r.push(i);return r},L:function(n){for(var i=[],t=0,r=n.length;t<r;t++)i.push(n[t]);return i},Ob:6===h,Pb:7===h,Z:h,Na:function(n,t){for(var r=l.a.L(n.getElementsByTagName("input")).concat(l.a.L(n.getElementsByTagName("textarea"))),f="string"==typeof t?function(n){return n.name===t}:function(n){return t.test(n.name)},u=[],i=r.length-1;0<=i;i--)f(r[i])&&u.push(r[i]);return u},Hb:function(n){return"string"==typeof n&&(n=l.a.D(n))?o.JSON&&o.JSON.parse?o.JSON.parse(n):new Function("return "+n)():t},wa:function(n,t,i){return("undefined"==typeof JSON||"undefined"==typeof JSON.stringify)&&u(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")),JSON.stringify(l.a.d(n),t,i)},Ib:function(n,t,i){var i=i||{},h=i.params||{},a=i.includeFields||this.Ma,c=n,o,s,f,t,r,u;if("object"==typeof n&&"form"===l.a.u(n))for(c=n.action,o=a.length-1;0<=o;o--)for(s=l.a.Na(n,a[o]),f=s.length-1;0<=f;f--)h[s[f].name]=s[f].value;t=l.a.d(t);r=e.createElement("form");r.style.display="none";r.action=c;r.method="post";for(u in t)n=e.createElement("input"),n.name=u,n.value=l.a.wa(l.a.d(t[u])),r.appendChild(n);for(u in h)n=e.createElement("input"),n.name=u,n.value=h[u],r.appendChild(n);e.body.appendChild(r);i.submitter?i.submitter(r):r.submit();setTimeout(function(){r.parentNode.removeChild(r)},0)}}};l.b("utils",l.a);l.b("utils.arrayForEach",l.a.o);l.b("utils.arrayFirst",l.a.kb);l.b("utils.arrayFilter",l.a.fa);l.b("utils.arrayGetDistinctValues",l.a.Fa);l.b("utils.arrayIndexOf",l.a.i);l.b("utils.arrayMap",l.a.V);l.b("utils.arrayPushAll",l.a.P);l.b("utils.arrayRemoveItem",l.a.ga);l.b("utils.extend",l.a.extend);l.b("utils.fieldsIncludedWithJsonPost",l.a.Ma);l.b("utils.getFormFields",l.a.Na);l.b("utils.peekObservable",l.a.ta);l.b("utils.postJson",l.a.Ib);l.b("utils.parseJson",l.a.Hb);l.b("utils.registerEventHandler",l.a.n);l.b("utils.stringifyJson",l.a.wa);l.b("utils.range",l.a.Kb);l.b("utils.toggleDomNodeCssClass",l.a.da);l.b("utils.triggerEvent",l.a.Aa);l.b("utils.unwrapObservable",l.a.d);Function.prototype.bind||(Function.prototype.bind=function(n){var i=this,t=Array.prototype.slice.call(arguments),n=t.shift();return function(){return i.apply(n,t.concat(Array.prototype.slice.call(arguments)))}});l.a.f=new function(){var e=0,u="__ko__"+(new Date).getTime(),f={};return{get:function(n,t){var u=l.a.f.getAll(n,i);return u===r?r:u[t]},set:function(t,u,f){f===r&&l.a.f.getAll(t,i)===r||(l.a.f.getAll(t,n)[u]=f)},getAll:function(n,t){var i=n[u];if(!i||!("null"!==i&&f[i])){if(!t)return r;i=n[u]="ko"+e++;f[i]={}}return f[i]},clear:function(r){var e=r[u];return e?(delete f[e],r[u]=t,n):i}}};l.b("utils.domData",l.a.f);l.b("utils.domData.clear",l.a.f.clear);l.a.F=new function(){function t(n,t){var i=l.a.f.get(n,o);return i===r&&t&&(i=[],l.a.f.set(n,o,i)),i}function e(n){var r=t(n,i),u;if(r)for(r=r.slice(0),u=0;u<r.length;u++)r[u](n);if(l.a.f.clear(n),"function"==typeof f&&"function"==typeof f.cleanData&&f.cleanData([n]),s[n.nodeType])for(r=n.firstChild;n=r;)r=n.nextSibling,8===n.nodeType&&e(n)}var o="__ko_domNodeDisposal__"+(new Date).getTime(),h={1:n,8:n,9:n},s={1:n,9:n};return{Ba:function(i,r){"function"!=typeof r&&u(Error("Callback must be a function"));t(i,n).push(r)},Wa:function(n,u){var f=t(n,i);f&&(l.a.ga(f,u),0==f.length&&l.a.f.set(n,o,r))},A:function(n){var t,i,r;if(h[n.nodeType]&&(e(n),s[n.nodeType]))for(t=[],l.a.P(t,n.getElementsByTagName("*")),i=0,r=t.length;i<r;i++)e(t[i]);return n},removeNode:function(n){l.A(n);n.parentNode&&n.parentNode.removeChild(n)}}};l.A=l.a.F.A;l.removeNode=l.a.F.removeNode;l.b("cleanNode",l.A);l.b("removeNode",l.removeNode);l.b("utils.domNodeDisposal",l.a.F);l.b("utils.domNodeDisposal.addDisposeCallback",l.a.F.Ba);l.b("utils.domNodeDisposal.removeDisposeCallback",l.a.F.Wa);l.a.sa=function(n){var t,i;if("undefined"!=typeof f){if((t=f.clean([n]))&&t[0]){for(n=t[0];n.parentNode&&11!==n.parentNode.nodeType;)n=n.parentNode;n.parentNode&&n.parentNode.removeChild(n)}}else{for(i=l.a.D(n).toLowerCase(),t=e.createElement("div"),i=i.match(/^<(thead|tbody|tfoot)/)&&[1,"<table>","<\/table>"]||!i.indexOf("<tr")&&[2,"<table><tbody>","<\/tbody><\/table>"]||(!i.indexOf("<td")||!i.indexOf("<th"))&&[3,"<table><tbody><tr>","<\/tr><\/tbody><\/table>"]||[0,"",""],n="ignored<div>"+i[1]+n+i[2]+"<\/div>","function"==typeof o.innerShiv?t.appendChild(o.innerShiv(n)):t.innerHTML=n;i[0]--;)t=t.lastChild;t=l.a.L(t.lastChild.childNodes)}return t};l.a.ca=function(n,i){if(l.a.ka(n),i=l.a.d(i),i!==t&&i!==r)if("string"!=typeof i&&(i=i.toString()),"undefined"!=typeof f)f(n).html(i);else for(var e=l.a.sa(i),u=0;u<e.length;u++)n.appendChild(e[u])};l.b("utils.parseHtmlFragment",l.a.sa);l.b("utils.setHtml",l.a.ca);w={};l.s={qa:function(n){"function"!=typeof n&&u(Error("You can only pass a function to ko.memoization.memoize()"));var t=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return w[t]=n,"<!--[ko_memo:"+t+"]-->"},gb:function(i,f){var e=w[i];e===r&&u(Error("Couldn't find any memo with ID "+i+". Perhaps it's already been unmemoized."));try{return e.apply(t,f||[]),n}finally{delete w[i]}},hb:function(n,t){var u=[],r,e,i,f;for(pt(n,u),r=0,e=u.length;r<e;r++)i=u[r].rb,f=[i],t&&l.a.P(f,t),l.s.gb(u[r].Eb,f),i.nodeValue="",i.parentNode&&i.parentNode.removeChild(i)},Ta:function(n){return(n=n.match(/^\[ko_memo\:(.*?)\]$/))?n[1]:t}};l.b("memoization",l.s);l.b("memoization.memoize",l.s.qa);l.b("memoization.unmemoize",l.s.gb);l.b("memoization.parseMemoText",l.s.Ta);l.b("memoization.unmemoizeDomNodeAndDescendants",l.s.hb);l.La={throttle:function(n,i){n.throttleEvaluation=i;var r=t;return l.j({read:n,write:function(t){clearTimeout(r);r=setTimeout(function(){n(t)},i)}})},notify:function(n,t){return n.equalityComparer="always"==t?s(i):l.m.fn.equalityComparer,n}};l.b("extenders",l.La);l.eb=function(n,t,i){this.target=n;this.ha=t;this.qb=i;l.p(this,"dispose",this.B)};l.eb.prototype.B=function(){this.Bb=n;this.qb()};l.S=function(){this.w={};l.a.extend(this,l.S.fn);l.p(this,"subscribe",this.xa);l.p(this,"extend",this.extend);l.p(this,"getSubscriptionsCount",this.xb)};l.S.fn={xa:function(n,t,i){var i=i||"change",n=t?n.bind(t):n,r=new l.eb(this,n,function(){l.a.ga(this.w[i],r)}.bind(this));return this.w[i]||(this.w[i]=[]),this.w[i].push(r),r},notifySubscribers:function(t,i){i=i||"change";this.w[i]&&l.r.K(function(){l.a.o(this.w[i].slice(0),function(i){i&&i.Bb!==n&&i.ha(t)})},this)},xb:function(){var t=0,n;for(n in this.w)this.w.hasOwnProperty(n)&&(t+=this.w[n].length);return t},extend:function(n){var t=this,i,r;if(n)for(i in n)r=l.La[i],"function"==typeof r&&(t=r(t,n[i]));return t}};l.Pa=function(n){return"function"==typeof n.xa&&"function"==typeof n.notifySubscribers};l.b("subscribable",l.S);l.b("isSubscribable",l.Pa);v=[];l.r={lb:function(n){v.push({ha:n,Ka:[]})},end:function(){v.pop()},Va:function(n){if(l.Pa(n)||u(Error("Only subscribable things can act as dependencies")),0<v.length){var t=v[v.length-1];!t||0<=l.a.i(t.Ka,n)||(t.Ka.push(n),t.ha(n))}},K:function(n,i,r){try{return v.push(t),n.apply(i,r||[])}finally{v.pop()}}};bt={undefined:n,boolean:n,number:n,string:n};l.m=function(n){function t(){return 0<arguments.length?(t.equalityComparer&&t.equalityComparer(i,arguments[0])||(t.H(),i=arguments[0],t.G()),this):(l.r.Va(t),i)}var i=n;return l.S.call(t),t.t=function(){return i},t.G=function(){t.notifySubscribers(i)},t.H=function(){t.notifySubscribers(i,"beforeChange")},l.a.extend(t,l.m.fn),l.p(t,"peek",t.t),l.p(t,"valueHasMutated",t.G),l.p(t,"valueWillMutate",t.H),t};l.m.fn={equalityComparer:function(n,r){return n===t||typeof n in bt?n===r:i}};y=l.m.Jb="__ko_proto__";l.m.fn[y]=l.m;l.la=function(u,f){return u===t||u===r||u[y]===r?i:u[y]===f?n:l.la(u[y],f)};l.$=function(n){return l.la(n,l.m)};l.Qa=function(t){return"function"==typeof t&&t[y]===l.m||"function"==typeof t&&t[y]===l.j&&t.yb?n:i};l.b("observable",l.m);l.b("isObservable",l.$);l.b("isWriteableObservable",l.Qa);l.R=function(n){0==arguments.length&&(n=[]);n===t||n===r||"length"in n||u(Error("The argument passed when initializing an observable array must be an array, or null, or undefined."));var i=l.m(n);return l.a.extend(i,l.R.fn),i};l.R.fn={remove:function(n){for(var u,r=this.t(),i=[],f="function"==typeof n?n:function(t){return t===n},t=0;t<r.length;t++)u=r[t],f(u)&&(0===i.length&&this.H(),i.push(u),r.splice(t,1),t--);return i.length&&this.G(),i},removeAll:function(n){if(n===r){var t=this.t(),i=t.slice(0);return this.H(),t.splice(0,t.length),this.G(),i}return n?this.remove(function(t){return 0<=l.a.i(n,t)}):[]},destroy:function(t){var r=this.t(),u="function"==typeof t?t:function(n){return n===t},i;for(this.H(),i=r.length-1;0<=i;i--)u(r[i])&&(r[i]._destroy=n);this.G()},destroyAll:function(t){return t===r?this.destroy(s(n)):t?this.destroy(function(n){return 0<=l.a.i(t,n)}):[]},indexOf:function(n){var t=this();return l.a.i(t,n)},replace:function(n,t){var i=this.indexOf(n);0<=i&&(this.H(),this.t()[i]=t,this.G())}};l.a.o("pop push reverse shift sort splice unshift".split(" "),function(n){l.R.fn[n]=function(){var t=this.t();return this.H(),t=t[n].apply(t,arguments),this.G(),t}});l.a.o(["slice"],function(n){l.R.fn[n]=function(){var t=this();return t[n].apply(t,arguments)}});l.b("observableArray",l.R);l.j=function(f,e,o){function g(){l.a.o(a,function(n){n.B()});a=[]}function ut(){var n=h.throttleEvaluation;n&&0<=n?(clearTimeout(it),it=setTimeout(v,n)):v()}function v(){var t,f,u;if(!d)if(p&&k())w();else{d=n;try{for(t=l.a.V(a,function(n){return n.target}),l.r.lb(function(n){var i;0<=(i=l.a.i(t,n))?t[i]=r:a.push(n.xa(ut))}),f=c.call(e),u=t.length-1;0<=u;u--)t[u]&&a.splice(u,1)[0].B();p=n;h.notifySubscribers(y,"beforeChange");y=f}finally{l.r.end()}h.notifySubscribers(y);d=i;a.length||w()}}function h(){return 0<arguments.length?("function"==typeof tt?tt.apply(e,arguments):u(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):(p||v(),l.r.Va(h),y)}function nt(){return!p||0<a.length}var y,p=i,d=i,c=f,rt,k;c&&"object"==typeof c?(o=c,c=o.read):(o=o||{},c||(c=o.read));"function"!=typeof c&&u(Error("Pass a function that returns the value of the ko.computed"));var tt=o.write,b=o.disposeWhenNodeIsRemoved||o.W||t,k=o.disposeWhen||o.Ja||s(i),w=g,a=[],it=t;return e||(e=o.owner),h.t=function(){return p||v(),y},h.wb=function(){return a.length},h.yb="function"==typeof o.write,h.B=function(){w()},h.oa=nt,l.S.call(h),l.a.extend(h,l.j.fn),l.p(h,"peek",h.t),l.p(h,"dispose",h.B),l.p(h,"isActive",h.oa),l.p(h,"getDependenciesCount",h.wb),o.deferEvaluation!==n&&v(),b&&nt()&&(w=function(){l.a.F.Wa(b,arguments.callee);g()},l.a.F.Ba(b,w),rt=k,k=function(){return!l.a.X(b)||rt()}),h};l.Ab=function(n){return l.la(n,l.j)};h=l.m.Jb;l.j[h]=l.m;l.j.fn={};l.j.fn[h]=l.j;l.b("dependentObservable",l.j);l.b("computed",l.j);l.b("isComputed",l.Ab);l.fb=function(n){return 0==arguments.length&&u(Error("When calling ko.toJS, pass the object you want to convert.")),yt(n,function(n){for(var t=0;l.$(n)&&10>t;t++)n=n();return n})};l.toJSON=function(n,t,i){return n=l.fb(n),l.a.wa(n,t,i)};l.b("toJS",l.fb);l.b("toJSON",l.toJSON);l.k={q:function(t){switch(l.a.u(t)){case"option":return t.__ko__hasDomDataOptionValue__===n?l.a.f.get(t,l.c.options.ra):7>=l.a.Z?t.getAttributeNode("value").specified?t.value:t.text:t.value;case"select":return 0<=t.selectedIndex?l.k.q(t.options[t.selectedIndex]):r;default:return t.value}},T:function(i,u){switch(l.a.u(i)){case"option":switch(typeof u){case"string":l.a.f.set(i,l.c.options.ra,r);"__ko__hasDomDataOptionValue__"in i&&delete i.__ko__hasDomDataOptionValue__;i.value=u;break;default:l.a.f.set(i,l.c.options.ra,u);i.__ko__hasDomDataOptionValue__=n;i.value="number"==typeof u?u:""}break;case"select":for(var f=i.options.length-1;0<=f;f--)if(l.k.q(i.options[f])==u){i.selectedIndex=f;break}break;default:(u===t||u===r)&&(u="");i.value=u}}};l.b("selectExtensions",l.k);l.b("selectExtensions.readValue",l.k.q);l.b("selectExtensions.writeValue",l.k.T);var ti=/\@ko_token_(\d+)\@/g,ii=["true","false"],ri=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i;l.g={Q:[],aa:function(n){var i=l.a.D(n),u;if(3>i.length)return[];"{"===i.charAt(0)&&(i=i.substring(1,i.length-1));for(var n=[],f=t,e,r=0;r<i.length;r++)if(u=i.charAt(r),f===t)switch(u){case'"':case"'":case"/":f=r;e=u}else if(u==e&&"\\"!==i.charAt(r-1)){u=i.substring(f,r+1);n.push(u);var h="@ko_token_"+(n.length-1)+"@",i=i.substring(0,f)+h+i.substring(r+1),r=r-(u.length-h.length),f=t}e=f=t;for(var o=0,s=t,r=0;r<i.length;r++){if(u=i.charAt(r),f===t)switch(u){case"{":f=r;s=u;e="}";break;case"(":f=r;s=u;e=")";break;case"[":f=r;s=u;e="]"}u===s?o++:u===e&&(o--,0===o&&(u=i.substring(f,r+1),n.push(u),h="@ko_token_"+(n.length-1)+"@",i=i.substring(0,f)+h+i.substring(r+1),r-=u.length-h.length,f=t))}for(e=[],i=i.split(","),f=0,r=i.length;f<r;f++)o=i[f],s=o.indexOf(":"),0<s&&s<o.length-1?(u=o.substring(s+1),e.push({key:g(o.substring(0,s),n),value:g(u,n)})):e.push({unknown:g(o,n)});return e},ba:function(n){for(var o,u,e="string"==typeof n?l.g.aa(n):n,f=[],n=[],r,s=0;r=e[s];s++)if(0<f.length&&f.push(","),r.key){n:{o=r.key;u=l.a.D(o);switch(u.length&&u.charAt(0)){case"'":case'"':break n;default:o="'"+u+"'"}}r=r.value;f.push(o);f.push(":");f.push(r);r=l.a.D(r);0<=l.a.i(ii,l.a.D(r).toLowerCase())?r=i:(u=r.match(ri),r=u===t?i:u[1]?"Object("+u[1]+")"+u[2]:r);r&&(0<n.length&&n.push(", "),n.push(o+" : function(__ko_value) { "+r+" = __ko_value; }"))}else r.unknown&&f.push(r.unknown);return e=f.join(""),0<n.length&&(e=e+", '_ko_property_writers' : { "+n.join("")+" } "),e},Db:function(t,r){for(var u=0;u<t.length;u++)if(l.a.D(t[u].key)==r)return n;return i},ea:function(n,t,i,r,u){n&&l.Qa(n)?u&&n.t()===r||n(r):(n=t()._ko_property_writers)&&n[i]&&n[i](r)}};l.b("expressionRewriting",l.g);l.b("expressionRewriting.bindingRewriteValidators",l.g.Q);l.b("expressionRewriting.parseObjectLiteral",l.g.aa);l.b("expressionRewriting.preProcessBindings",l.g.ba);l.b("jsonExpressionRewriting",l.g);l.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",l.g.ba);var b="<!--test-->"===e.createComment("test").text,ui=b?/^<\!--\s*ko(?:\s+(.+\s*\:[\s\S]*))?\s*--\>$/:/^\s*ko(?:\s+(.+\s*\:[\s\S]*))?\s*$/,fi=b?/^<\!--\s*\/ko\s*--\>$/:/^\s*\/ko\s*$/,ei={ul:n,ol:n};l.e={I:{},childNodes:function(n){return a(n)?vt(n):n.childNodes},Y:function(n){if(a(n))for(var n=l.e.childNodes(n),t=0,i=n.length;t<i;t++)l.removeNode(n[t]);else l.a.ka(n)},N:function(n,t){if(a(n)){l.e.Y(n);for(var r=n.nextSibling,i=0,u=t.length;i<u;i++)r.parentNode.insertBefore(t[i],r)}else l.a.N(n,t)},Ua:function(n,t){a(n)?n.parentNode.insertBefore(t,n.nextSibling):n.firstChild?n.insertBefore(t,n.firstChild):n.appendChild(t)},Oa:function(n,t,i){i?a(n)?n.parentNode.insertBefore(t,i.nextSibling):i.nextSibling?n.insertBefore(t,i.nextSibling):n.appendChild(t):l.e.Ua(n,t)},firstChild:function(n){return a(n)?!n.nextSibling||p(n.nextSibling)?t:n.nextSibling:n.firstChild},nextSibling:function(n){return a(n)&&(n=at(n)),n.nextSibling&&p(n.nextSibling)?t:n.nextSibling},ib:function(n){return(n=a(n))?n[1]:t},Sa:function(i){var e,r,u,f;if(ei[l.a.u(i)]&&(e=i.firstChild,e))do if(1===e.nodeType){if(r=e.firstChild,u=t,r)do u?u.push(r):a(r)?(f=at(r,n),f?r=f:u=[r]):p(r)&&(u=[r]);while(r=r.nextSibling);if(r=u)for(u=e.nextSibling,f=0;f<r.length;f++)u?i.insertBefore(r[f],u):i.appendChild(r[f])}while(e=e.nextSibling)}};l.b("virtualElements",l.e);l.b("virtualElements.allowedBindings",l.e.I);l.b("virtualElements.emptyNode",l.e.Y);l.b("virtualElements.insertAfter",l.e.Oa);l.b("virtualElements.prepend",l.e.Ua);l.b("virtualElements.setDomNodeChildren",l.e.N);l.J=function(){this.Ga={}};l.a.extend(l.J.prototype,{nodeHasBindings:function(n){switch(n.nodeType){case 1:return n.getAttribute("data-bind")!=t;case 8:return l.e.ib(n)!=t;default:return i}},getBindings:function(n,i){var r=this.getBindingsString(n,i);return r?this.parseBindingsString(r,i,n):t},getBindingsString:function(n){switch(n.nodeType){case 1:return n.getAttribute("data-bind");case 8:return l.e.ib(n);default:return t}},parseBindingsString:function(n,t,i){var r,f,e;try{return(r=this.Ga[n])||(f=this.Ga,e="with($context){with($data||{}){return{"+l.g.ba(n)+"}}}",r=f[n]=new Function("$context","$element",e)),r(t,i)}catch(o){u(Error("Unable to parse bindings.\nMessage: "+o+";\nBindings value: "+n))}}});l.J.instance=new l.J;l.b("bindingProvider",l.J);l.c={};l.z=function(n,t,i){t?(l.a.extend(this,t),this.$parentContext=t,this.$parent=t.$data,this.$parents=(t.$parents||[]).slice(0),this.$parents.unshift(this.$parent)):(this.$parents=[],this.$root=n,this.ko=l);this.$data=n;i&&(this[i]=n)};l.z.prototype.createChildContext=function(n,t){return new l.z(n,this,t)};l.z.prototype.extend=function(n){var t=l.a.extend(new l.z,this);return l.a.extend(t,n)};l.cb=function(n,t){if(2==arguments.length)l.a.f.set(n,"__ko_bindingContext__",t);else return l.a.f.get(n,"__ko_bindingContext__")};l.Ea=function(t,i,r){return 1===t.nodeType&&l.e.Sa(t),ht(t,i,r,n)};l.Da=function(t,i){(1===i.nodeType||8===i.nodeType)&&lt(t,i,n)};l.Ca=function(t,i){i&&1!==i.nodeType&&8!==i.nodeType&&u(Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node"));i=i||o.document.body;ct(t,i,n)};l.ja=function(n){switch(n.nodeType){case 1:case 8:var t=l.cb(n);if(t)return t;if(n.parentNode)return l.ja(n.parentNode)}return r};l.ob=function(n){return(n=l.ja(n))?n.$data:r};l.b("bindingHandlers",l.c);l.b("applyBindings",l.Ca);l.b("applyBindingsToDescendants",l.Da);l.b("applyBindingsToNode",l.Ea);l.b("contextFor",l.ja);l.b("dataFor",l.ob);tt={"class":"className","for":"htmlFor"};l.c.attr={update:function(n,u){var s=l.a.d(u())||{},f,e,o;for(f in s)"string"==typeof f&&(e=l.a.d(s[f]),o=e===i||e===t||e===r,o&&n.removeAttribute(f),8>=l.a.Z&&f in tt?(f=tt[f],o?n.removeAttribute(f):n[f]=e):o||n.setAttribute(f,e.toString()),"name"===f&&l.a.$a(n,o?"":e.toString()))}};l.c.checked={init:function(t,i,r){l.a.n(t,"click",function(){var u,f,e;if("checkbox"==t.type)u=t.checked;else if("radio"==t.type&&t.checked)u=t.value;else return;f=i();e=l.a.d(f);"checkbox"==t.type&&e instanceof Array?(u=l.a.i(e,t.value),t.checked&&0>u?f.push(t.value):!t.checked&&0<=u&&f.splice(u,1)):l.g.ea(f,r,"checked",u,n)});"radio"!=t.type||t.name||l.c.uniqueName.init(t,s(n))},update:function(n,t){var i=l.a.d(t());"checkbox"==n.type?n.checked=i instanceof Array?0<=l.a.i(i,n.value):i:"radio"==n.type&&(n.checked=n.value==i)}};l.c.css={update:function(t,r){var u=l.a.d(r()),f,e;if("object"==typeof u)for(f in u)e=l.a.d(u[f]),l.a.da(t,f,e);else u=String(u||""),l.a.da(t,t.__ko__cssValue,i),t.__ko__cssValue=u,l.a.da(t,u,n)}};l.c.enable={update:function(t,i){var r=l.a.d(i());r&&t.disabled?t.removeAttribute("disabled"):!r&&!t.disabled&&(t.disabled=n)}};l.c.disable={update:function(n,t){l.c.enable.update(n,function(){return!l.a.d(t())})}};l.c.event={init:function(t,r,u,f){var o=r()||{},e;for(e in o)(function(){var o=e;"string"==typeof o&&l.a.n(t,o,function(t){var s,h=r()[o],c,e;if(h){c=u();try{e=l.a.L(arguments);e.unshift(f);s=h.apply(f,e)}finally{s!==n&&(t.preventDefault?t.preventDefault():t.returnValue=i)}c[o+"Bubble"]===i&&(t.cancelBubble=n,t.stopPropagation&&t.stopPropagation())}})})()}};l.c.foreach={Ra:function(n){return function(){var i=n(),t=l.a.ta(i);return!t||"number"==typeof t.length?{foreach:i,templateEngine:l.C.na}:(l.a.d(i),{foreach:t.data,as:t.as,includeDestroyed:t.includeDestroyed,afterAdd:t.afterAdd,beforeRemove:t.beforeRemove,afterRender:t.afterRender,beforeMove:t.beforeMove,afterMove:t.afterMove,templateEngine:l.C.na})}},init:function(n,t){return l.c.template.init(n,l.c.foreach.Ra(t))},update:function(n,t,i,r,u){return l.c.template.update(n,l.c.foreach.Ra(t),i,r,u)}};l.g.Q.foreach=i;l.e.I.foreach=n;l.c.hasfocus={init:function(r,u,f){function e(t){r.__ko_hasfocusUpdating=n;var e=r.ownerDocument;"activeElement"in e&&(t=e.activeElement===r);e=u();l.g.ea(e,f,"hasfocus",t,n);r.__ko_hasfocusUpdating=i}var o=e.bind(t,n),s=e.bind(t,i);l.a.n(r,"focus",o);l.a.n(r,"focusin",o);l.a.n(r,"blur",s);l.a.n(r,"focusout",s)},update:function(n,i){var r=l.a.d(i());n.__ko_hasfocusUpdating||(r?n.focus():n.blur(),l.r.K(l.a.Aa,t,[n,r?"focusin":"focusout"]))}};l.c.html={init:function(){return{controlsDescendantBindings:n}},update:function(n,t){l.a.ca(n,t())}};it="__ko_withIfBindingData";nt("if");nt("ifnot",i,n);nt("with",n,i,function(n,t){return n.createChildContext(t)});l.c.options={update:function(t,i,f){var f,c,s,i,a,h;"select"!==l.a.u(t)&&u(Error("options binding applies only to SELECT elements"));for(var p=0==t.length,w=l.a.V(l.a.fa(t.childNodes,function(n){return n.tagName&&"option"===l.a.u(n)&&n.selected}),function(n){return l.k.q(n)||n.innerText||n.textContent}),b=t.scrollTop,o=l.a.d(i());0<t.length;)l.A(t.options[0]),t.remove(0);if(o){for(f=f(),c=f.optionsIncludeDestroyed,"number"!=typeof o.length&&(o=[o]),f.optionsCaption&&(s=e.createElement("option"),l.a.ca(s,f.optionsCaption),l.k.T(s,r),t.appendChild(s)),i=0,a=o.length;i<a;i++)if(h=o[i],!h||!h._destroy||c){var s=e.createElement("option"),v=function(n,t,i){var r=typeof t;return"function"==r?t(n):"string"==r?n[t]:i},y=v(h,f.optionsValue,h);l.k.T(s,l.a.d(y));h=v(h,f.optionsText,y);l.a.bb(s,h);t.appendChild(s)}for(o=t.getElementsByTagName("option"),i=c=0,a=o.length;i<a;i++)0<=l.a.i(w,l.k.q(o[i]))&&(l.a.ab(o[i],n),c++);t.scrollTop=b;p&&"value"in f&&wt(t,l.a.ta(f.value),n);l.a.tb(t)}}};l.c.options.ra="__ko.optionValueDomData__";l.c.selectedOptions={init:function(n,t,i){l.a.n(n,"change",function(){var u=t(),r=[];l.a.o(n.getElementsByTagName("option"),function(n){n.selected&&r.push(l.k.q(n))});l.g.ea(u,i,"value",r)})},update:function(n,t){"select"!=l.a.u(n)&&u(Error("values binding applies only to SELECT elements"));var i=l.a.d(t());i&&"number"==typeof i.length&&l.a.o(n.getElementsByTagName("option"),function(n){var t=0<=l.a.i(i,l.k.q(n));l.a.ab(n,t)})}};l.c.style={update:function(n,t){var r=l.a.d(t()||{}),i,u;for(i in r)"string"==typeof i&&(u=l.a.d(r[i]),n.style[i]=u||"")}};l.c.submit={init:function(t,r,f,e){"function"!=typeof r()&&u(Error("The value for a submit binding must be a function"));l.a.n(t,"submit",function(u){var f,o=r();try{f=o.call(e,t)}finally{f!==n&&(u.preventDefault?u.preventDefault():u.returnValue=i)}})}};l.c.text={update:function(n,t){l.a.bb(n,t())}};l.e.I.text=n;l.c.uniqueName={init:function(n,t){if(t()){var i="ko_unique_"+ ++l.c.uniqueName.nb;l.a.$a(n,i)}}};l.c.uniqueName.nb=0;l.c.value={init:function(t,r,u){function o(){s=i;var n=r(),f=l.k.q(t);l.g.ea(n,u,"value",f)}var f=["change"],e=u().valueUpdate,s=i;e&&("string"==typeof e&&(e=[e]),l.a.P(f,e),f=l.a.Fa(f));l.a.Z&&"input"==t.tagName.toLowerCase()&&"text"==t.type&&"off"!=t.autocomplete&&(!t.form||"off"!=t.form.autocomplete)&&-1==l.a.i(f,"propertychange")&&(l.a.n(t,"propertychange",function(){s=n}),l.a.n(t,"blur",function(){s&&o()}));l.a.o(f,function(n){var i=o;l.a.Nb(n,"after")&&(i=function(){setTimeout(o,0)},n=n.substring(5));l.a.n(t,n,i)})},update:function(t,r){var e="select"===l.a.u(t),f=l.a.d(r()),u=l.k.q(t),o=f!=u;0===f&&0!==u&&"0"!==u&&(o=n);o&&(u=function(){l.k.T(t,f)},u(),e&&setTimeout(u,0));e&&0<t.length&&wt(t,f,i)}};l.c.visible={update:function(n,t){var i=l.a.d(t()),r="none"!=n.style.display;i&&!r?n.style.display="":!i&&r&&(n.style.display="none")}};l.c.click={init:function(n,t,i,r){return l.c.event.init.call(this,n,function(){var n={};return n.click=t(),n},i,r)}};l.v=function(){};l.v.prototype.renderTemplateSource=function(){u(Error("Override renderTemplateSource"))};l.v.prototype.createJavaScriptEvaluatorBlock=function(){u(Error("Override createJavaScriptEvaluatorBlock"))};l.v.prototype.makeTemplateSource=function(n,t){if("string"==typeof n){var t=t||e,i=t.getElementById(n);return i||u(Error("Cannot find template with ID "+n)),new l.l.h(i)}if(1==n.nodeType||8==n.nodeType)return new l.l.O(n);u(Error("Unknown template type: "+n))};l.v.prototype.renderTemplate=function(n,t,i,r){return n=this.makeTemplateSource(n,r),this.renderTemplateSource(n,t,i)};l.v.prototype.isTemplateRewritten=function(t,r){return this.allowTemplateRewriting===i?n:this.makeTemplateSource(t,r).data("isRewritten")};l.v.prototype.rewriteTemplate=function(t,i,r){t=this.makeTemplateSource(t,r);i=i(t.text());t.text(i);t.data("isRewritten",n)};l.b("templateEngine",l.v);kt=/(<[a-z]+\d*(\s+(?!data-bind=)[a-z0-9\-]+(=(\"[^\"]*\"|\'[^\']*\'))?)*\s+)data-bind=(["'])([\s\S]*?)\5/gi;dt=/<\!--\s*ko\b\s*([\s\S]*?)\s*--\>/g;l.ya={ub:function(n,t,i){t.isTemplateRewritten(n,i)||t.rewriteTemplate(n,function(n){return l.ya.Fb(n,t)},i)},Fb:function(n,t){return n.replace(kt,function(n,i,r,u,f,e,o){return st(o,i,t)}).replace(dt,function(n,i){return st(i,"<!-- ko -->",t)})},jb:function(n){return l.s.qa(function(t,i){t.nextSibling&&l.Ea(t.nextSibling,n,i)})}};l.b("__tr_ambtns",l.ya.jb);l.l={};l.l.h=function(n){this.h=n};l.l.h.prototype.text=function(){var n=l.a.u(this.h),n="script"===n?"text":"textarea"===n?"value":"innerHTML",t;if(0==arguments.length)return this.h[n];t=arguments[0];"innerHTML"===n?l.a.ca(this.h,t):this.h[n]=t};l.l.h.prototype.data=function(n){if(1===arguments.length)return l.a.f.get(this.h,"templateSourceData_"+n);l.a.f.set(this.h,"templateSourceData_"+n,arguments[1])};l.l.O=function(n){this.h=n};l.l.O.prototype=new l.l.h;l.l.O.prototype.text=function(){if(0==arguments.length){var n=l.a.f.get(this.h,"__ko_anon_template__")||{};return n.za===r&&n.ia&&(n.za=n.ia.innerHTML),n.za}l.a.f.set(this.h,"__ko_anon_template__",{za:arguments[0]})};l.l.h.prototype.nodes=function(){if(0==arguments.length)return(l.a.f.get(this.h,"__ko_anon_template__")||{}).ia;l.a.f.set(this.h,"__ko_anon_template__",{ia:arguments[0]})};l.b("templateSources",l.l);l.b("templateSources.domElement",l.l.h);l.b("templateSources.anonymousTemplate",l.l.O);l.va=function(n){n==r||n instanceof l.v||u(Error("templateEngine must inherit from ko.templateEngine"));rt=n};l.ua=function(n,i,f,e,o){if(f=f||{},(f.templateEngine||rt)==r&&u(Error("Set a template engine before calling renderTemplate")),o=o||"replaceChildren",e){var s=d(e);return l.j(function(){var t=i&&i instanceof l.z?i:new l.z(l.a.d(i)),r="function"==typeof n?n(t.$data,t):n,t=ft(e,o,r,t,f);"replaceNode"==o&&(e=t,s=d(e))},t,{Ja:function(){return!s||!l.a.X(s)},W:s&&"replaceNode"==o?s.parentNode:s})}return l.s.qa(function(t){l.ua(n,i,f,t,"replaceNode")})};l.Lb=function(n,i,u,f,e){function s(n,t){et(t,o);u.afterRender&&u.afterRender(t,n)}function h(i,r){o=e.createChildContext(l.a.d(i),u.as);o.$index=r;var f="function"==typeof n?n(i,o):n;return ft(t,"ignoreTargetNode",f,o,u)}var o;return l.j(function(){var n=l.a.d(i)||[];"undefined"==typeof n.length&&(n=[n]);n=l.a.fa(n,function(n){return u.includeDestroyed||n===r||n===t||!l.a.d(n._destroy)});l.r.K(l.a.Za,t,[f,n,h,u,s])},t,{W:f})};l.c.template={init:function(t,i){var r=l.a.d(i());return"string"==typeof r||r.name||1!=t.nodeType&&8!=t.nodeType||(r=1==t.nodeType?t.childNodes:l.e.childNodes(t),r=l.a.Gb(r),new l.l.O(t).nodes(r)),{controlsDescendantBindings:n}},update:function(i,u,f,e,o){var u=l.a.d(u()),f={},e=n,s,h=t;"string"!=typeof u&&(f=u,u=f.name,"if"in f&&(e=l.a.d(f["if"])),e&&"ifnot"in f&&(e=!l.a.d(f.ifnot)),s=l.a.d(f.data));"foreach"in f?h=l.Lb(u||i,e&&f.foreach||[],f,i,o):e?(o="data"in f?o.createChildContext(s,f.as):o,h=l.ua(u||i,o,f,i)):l.e.Y(i);o=h;(s=l.a.f.get(i,"__ko__templateComputedDomDataKey__"))&&"function"==typeof s.B&&s.B();l.a.f.set(i,"__ko__templateComputedDomDataKey__",o&&o.oa()?o:r)}};l.g.Q.template=function(n){return n=l.g.aa(n),1==n.length&&n[0].unknown||l.g.Db(n,"name")?t:"This template engine does not support anonymous templates nested within its templates"};l.e.I.template=n;l.b("setTemplateEngine",l.va);l.b("renderTemplate",l.ua);l.a.Ia=function(n,t,i){return n=n||[],t=t||[],n.length<=t.length?ut(n,t,"added","deleted",i):ut(t,n,"deleted","added",i)};l.b("utils.compareArrays",l.a.Ia);l.a.Za=function(t,i,u,f,e){function rt(n,t){o=d[t];nt!==t&&(it[n]=o);o.ma(nt++);k(o.M);g.push(o);p.push(o)}function v(n,t){if(n)for(var i=0,r=t.length;i<r;i++)t[i]&&l.a.o(t[i].M,function(r){n(r,i,t[i].U)})}for(var ut,i=i||[],f=f||{},a=l.a.f.get(t,"setDomNodeChildrenFromArrayMapping_lastMappingResult")===r,d=l.a.f.get(t,"setDomNodeChildrenFromArrayMapping_lastMappingResult")||[],y=l.a.V(d,function(n){return n.U}),h=l.a.Ia(y,i),g=[],c=0,nt=0,tt=[],p=[],i=[],it=[],y=[],o,s=0,w,b;w=h[s];s++)switch(b=w.moved,w.status){case"deleted":b===r&&(o=d[c],o.j&&o.j.B(),tt.push.apply(tt,k(o.M)),f.beforeRemove&&(i[s]=o,p.push(o)));c++;break;case"retained":rt(s,c++);break;case"added":b!==r?rt(s,b):(o={U:w.value,ma:l.m(nt++)},g.push(o),p.push(o),a||(y[s]=o))}for(v(f.beforeMove,it),l.a.o(tt,f.beforeRemove?l.A:l.removeNode),s=0,a=l.e.firstChild(t);o=p[s];s++){for(o.M||l.a.extend(o,gt(t,u,o.U,e,o.ma)),c=0;h=o.M[c];a=h.nextSibling,ut=h,c++)h!==a&&l.e.Oa(t,h,ut);!o.zb&&e&&(e(o.U,o.M,o.ma),o.zb=n)}v(f.beforeRemove,i);v(f.afterMove,it);v(f.afterAdd,y);l.a.f.set(t,"setDomNodeChildrenFromArrayMapping_lastMappingResult",g)};l.b("utils.setDomNodeChildrenFromArrayMapping",l.a.Za);l.C=function(){this.allowTemplateRewriting=i};l.C.prototype=new l.v;l.C.prototype.renderTemplateSource=function(i){var r=!(9>l.a.Z)&&i.nodes?i.nodes():t;return r?l.a.L(r.cloneNode(n).childNodes):(i=i.text(),l.a.sa(i))};l.C.na=new l.C;l.va(l.C.na);l.b("nativeTemplateEngine",l.C);l.pa=function(){var n=this.Cb=function(){if("undefined"==typeof f||!f.tmpl)return 0;try{if(0<=f.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(n){}return 1}();this.renderTemplateSource=function(i,r,o){o=o||{};2>n&&u(Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later."));var s=i.data("precompiled");return s||(s=i.text()||"",s=f.template(t,"{{ko_with $item.koBindingContext}}"+s+"{{/ko_with}}"),i.data("precompiled",s)),i=[r.$data],r=f.extend({koBindingContext:r},o.templateOptions),r=f.tmpl(s,i,r),r.appendTo(e.createElement("div")),f.fragments={},r};this.createJavaScriptEvaluatorBlock=function(n){return"{{ko_code ((function() { return "+n+" })()) }}"};this.addTemplate=function(n,t){e.write("<script type='text/html' id='"+n+"'>"+t+"<\/script>")};0<n&&(f.tmpl.tag.ko_code={open:"__.push($1 || '');"},f.tmpl.tag.ko_with={open:"with($1) {",close:"} "})};l.pa.prototype=new l.v;h=new l.pa;0<h.Cb&&l.va(h);l.b("jqueryTmplTemplateEngine",l.pa)}var n=!0,t=null,i=!1,o=window,e=document,c=navigator,f=window.jQuery,r=void 0;"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?h(module.exports||exports):"function"==typeof define&&define.amd?define(["exports"],h):h(o.ko={});n})();Enumerable=function(){var y="Single:sequence contains more than one element.",e=!0,r=null,i=!1,n=function(n){this.GetEnumerator=n},l,o;n.Choice=function(){var t=arguments[0]instanceof Array?arguments[0]:arguments;return new n(function(){return new u(f.Blank,function(){return this.Yield(t[Math.floor(Math.random()*t.length)])},f.Blank)})};n.Cycle=function(){var t=arguments[0]instanceof Array?arguments[0]:arguments;return new n(function(){var n=0;return new u(f.Blank,function(){return n>=t.length&&(n=0),this.Yield(t[n++])},f.Blank)})};n.Empty=function(){return new n(function(){return new u(f.Blank,function(){return i},f.Blank)})};n.From=function(h){if(h==r)return n.Empty();if(h instanceof n)return h;if(typeof h==s.Number||typeof h==s.Boolean)return n.Repeat(h,1);if(typeof h==s.String)return new n(function(){var n=0;return new u(f.Blank,function(){return n<h.length?this.Yield(h.charAt(n++)):i},f.Blank)});if(typeof h!=s.Function){if(typeof h.length==s.Number)return new o(h);if(!(h instanceof Object)&&t.IsIEnumerable(h))return new n(function(){var t=e,n;return new u(function(){n=new Enumerator(h)},function(){return t?t=i:n.moveNext(),n.atEnd()?i:this.Yield(n.item())},f.Blank)})}return new n(function(){var n=[],t=0;return new u(function(){for(var t in h)h[t]instanceof Function||n.push({Key:t,Value:h[t]})},function(){return t<n.length?this.Yield(n[t++]):i},f.Blank)})};n.Return=function(t){return n.Repeat(t,1)};n.Matches=function(t,e,o){return o==r&&(o=""),e instanceof RegExp&&(o+=e.ignoreCase?"i":"",o+=e.multiline?"m":"",e=e.source),o.indexOf("g")===-1&&(o+="g"),new n(function(){var n;return new u(function(){n=new RegExp(e,o)},function(){var r=n.exec(t);return r?this.Yield(r):i},f.Blank)})};n.Range=function(t,i,u){return u==r&&(u=1),n.ToInfinity(t,u).Take(i)};n.RangeDown=function(t,i,u){return u==r&&(u=1),n.ToNegativeInfinity(t,u).Take(i)};n.RangeTo=function(t,i,u){return u==r&&(u=1),t<i?n.ToInfinity(t,u).TakeWhile(function(n){return n<=i}):n.ToNegativeInfinity(t,u).TakeWhile(function(n){return n>=i})};n.Repeat=function(t,i){return i!=r?n.Repeat(t).Take(i):new n(function(){return new u(f.Blank,function(){return this.Yield(t)},f.Blank)})};n.RepeatWithFinalize=function(i,f){return i=t.CreateLambda(i),f=t.CreateLambda(f),new n(function(){var n;return new u(function(){n=i()},function(){return this.Yield(n)},function(){n!=r&&(f(n),n=r)})})};n.Generate=function(i,e){return e!=r?n.Generate(i).Take(e):(i=t.CreateLambda(i),new n(function(){return new u(f.Blank,function(){return this.Yield(i())},f.Blank)}))};n.ToInfinity=function(t,i){return t==r&&(t=0),i==r&&(i=1),new n(function(){var n;return new u(function(){n=t-i},function(){return this.Yield(n+=i)},f.Blank)})};n.ToNegativeInfinity=function(t,i){return t==r&&(t=0),i==r&&(i=1),new n(function(){var n;return new u(function(){n=t+i},function(){return this.Yield(n-=i)},f.Blank)})};n.Unfold=function(r,o){return o=t.CreateLambda(o),new n(function(){var t=e,n;return new u(f.Blank,function(){return t?(t=i,n=r,this.Yield(n)):(n=o(n),this.Yield(n))},f.Blank)})};n.prototype={CascadeBreadthFirst:function(r,f){var o=this;return r=t.CreateLambda(r),f=t.CreateLambda(f),new n(function(){var s,c=0,h=[];return new u(function(){s=o.GetEnumerator()},function(){while(e){if(s.MoveNext())return h.push(s.Current()),this.Yield(f(s.Current(),c));var u=n.From(h).SelectMany(function(n){return r(n)});if(u.Any())c++,h=[],t.Dispose(s),s=u.GetEnumerator();else return i}},function(){t.Dispose(s)})})},CascadeDepthFirst:function(r,f){var o=this;return r=t.CreateLambda(r),f=t.CreateLambda(f),new n(function(){var h=[],s;return new u(function(){s=o.GetEnumerator()},function(){while(e){if(s.MoveNext()){var u=f(s.Current(),h.length);return h.push(s),s=n.From(r(s.Current())).GetEnumerator(),this.Yield(u)}if(h.length<=0)return i;t.Dispose(s);s=h.pop()}},function(){try{t.Dispose(s)}finally{n.From(h).ForEach(function(n){n.Dispose()})}})})},Flatten:function(){var o=this;return new n(function(){var h,s=r;return new u(function(){h=o.GetEnumerator()},function(){while(e){if(s!=r){if(s.MoveNext())return this.Yield(s.Current());s=r}if(h.MoveNext())if(h.Current()instanceof Array){t.Dispose(s);s=n.From(h.Current()).SelectMany(f.Identity).Flatten().GetEnumerator();continue}else return this.Yield(h.Current());return i}},function(){try{t.Dispose(h)}finally{t.Dispose(s)}})})},Pairwise:function(r){var f=this;return r=t.CreateLambda(r),new n(function(){var n;return new u(function(){n=f.GetEnumerator();n.MoveNext()},function(){var t=n.Current();return n.MoveNext()?this.Yield(r(t,n.Current())):i},function(){t.Dispose(n)})})},Scan:function(f,o,s){var h,c;return s!=r?this.Scan(f,o).Select(s):(o==r?(o=t.CreateLambda(f),h=i):(o=t.CreateLambda(o),h=e),c=this,new n(function(){var n,r,s=e;return new u(function(){n=c.GetEnumerator()},function(){if(s){if(s=i,h)return this.Yield(r=f);if(n.MoveNext())return this.Yield(r=n.Current())}return n.MoveNext()?this.Yield(r=o(r,n.Current())):i},function(){t.Dispose(n)})}))},Select:function(r){var f=this;return r=t.CreateLambda(r),new n(function(){var n,e=0;return new u(function(){n=f.GetEnumerator()},function(){return n.MoveNext()?this.Yield(r(n.Current(),e++)):i},function(){t.Dispose(n)})})},SelectMany:function(f,e){var o=this;return f=t.CreateLambda(f),e==r&&(e=function(n,t){return t}),e=t.CreateLambda(e),new n(function(){var h,s=undefined,c=0;return new u(function(){h=o.GetEnumerator()},function(){if(s===undefined&&!h.MoveNext())return i;do{if(s==r){var u=f(h.Current(),c++);s=n.From(u).GetEnumerator()}if(s.MoveNext())return this.Yield(e(h.Current(),s.Current()));t.Dispose(s);s=r}while(h.MoveNext());return i},function(){try{t.Dispose(h)}finally{t.Dispose(s)}})})},Where:function(r){r=t.CreateLambda(r);var f=this;return new n(function(){var n,e=0;return new u(function(){n=f.GetEnumerator()},function(){while(n.MoveNext())if(r(n.Current(),e++))return this.Yield(n.Current());return i},function(){t.Dispose(n)})})},OfType:function(n){var t;switch(n){case Number:t=s.Number;break;case String:t=s.String;break;case Boolean:t=s.Boolean;break;case Function:t=s.Function;break;default:t=r}return t===r?this.Where(function(t){return t instanceof n}):this.Where(function(n){return typeof n===t})},Zip:function(r,f){f=t.CreateLambda(f);var e=this;return new n(function(){var o,s,h=0;return new u(function(){o=e.GetEnumerator();s=n.From(r).GetEnumerator()},function(){return o.MoveNext()&&s.MoveNext()?this.Yield(f(o.Current(),s.Current(),h++)):i},function(){try{t.Dispose(o)}finally{t.Dispose(s)}})})},Join:function(o,s,h,c,l){s=t.CreateLambda(s);h=t.CreateLambda(h);c=t.CreateLambda(c);l=t.CreateLambda(l);var a=this;return new n(function(){var v,p,y=r,w=0;return new u(function(){v=a.GetEnumerator();p=n.From(o).ToLookup(h,f.Identity,l)},function(){for(var n,t;e;){if(y!=r){if(n=y[w++],n!==undefined)return this.Yield(c(v.Current(),n));n=r;w=0}if(v.MoveNext())t=s(v.Current()),y=p.Get(t).ToArray();else return i}},function(){t.Dispose(v)})})},GroupJoin:function(e,o,s,h,c){o=t.CreateLambda(o);s=t.CreateLambda(s);h=t.CreateLambda(h);c=t.CreateLambda(c);var l=this;return new n(function(){var a=l.GetEnumerator(),v=r;return new u(function(){a=l.GetEnumerator();v=n.From(e).ToLookup(s,f.Identity,c)},function(){if(a.MoveNext()){var n=v.Get(o(a.Current()));return this.Yield(h(a.Current(),n))}return i},function(){t.Dispose(a)})})},All:function(n){n=t.CreateLambda(n);var r=e;return this.ForEach(function(t){if(!n(t))return r=i,i}),r},Any:function(n){n=t.CreateLambda(n);var r=this.GetEnumerator();try{if(arguments.length==0)return r.MoveNext();while(r.MoveNext())if(n(r.Current()))return e;return i}finally{t.Dispose(r)}},Concat:function(f){var e=this;return new n(function(){var s,o;return new u(function(){s=e.GetEnumerator()},function(){if(o==r){if(s.MoveNext())return this.Yield(s.Current());o=n.From(f).GetEnumerator()}return o.MoveNext()?this.Yield(o.Current()):i},function(){try{t.Dispose(s)}finally{t.Dispose(o)}})})},Insert:function(r,f){var o=this;return new n(function(){var h,s,c=0,l=i;return new u(function(){h=o.GetEnumerator();s=n.From(f).GetEnumerator()},function(){return c==r&&s.MoveNext()?(l=e,this.Yield(s.Current())):h.MoveNext()?(c++,this.Yield(h.Current())):!l&&s.MoveNext()?this.Yield(s.Current()):i},function(){try{t.Dispose(h)}finally{t.Dispose(s)}})})},Alternate:function(t){return t=n.Return(t),this.SelectMany(function(i){return n.Return(i).Concat(t)}).TakeExceptLast()},Contains:function(n,r){r=t.CreateLambda(r);var u=this.GetEnumerator();try{while(u.MoveNext())if(r(u.Current())===n)return e;return i}finally{t.Dispose(u)}},DefaultIfEmpty:function(r){var f=this;return new n(function(){var n,o=e;return new u(function(){n=f.GetEnumerator()},function(){return n.MoveNext()?(o=i,this.Yield(n.Current())):o?(o=i,this.Yield(r)):i},function(){t.Dispose(n)})})},Distinct:function(t){return this.Except(n.Empty(),t)},Except:function(r,f){f=t.CreateLambda(f);var e=this;return new n(function(){var o,s;return new u(function(){o=e.GetEnumerator();s=new a(f);n.From(r).ForEach(function(n){s.Add(n)})},function(){while(o.MoveNext()){var n=o.Current();if(!s.Contains(n))return s.Add(n),this.Yield(n)}return i},function(){t.Dispose(o)})})},Intersect:function(r,f){f=t.CreateLambda(f);var e=this;return new n(function(){var o,s,h;return new u(function(){o=e.GetEnumerator();s=new a(f);n.From(r).ForEach(function(n){s.Add(n)});h=new a(f)},function(){while(o.MoveNext()){var n=o.Current();if(!h.Contains(n)&&s.Contains(n))return h.Add(n),this.Yield(n)}return i},function(){t.Dispose(o)})})},SequenceEqual:function(r,u){var o,f;u=t.CreateLambda(u);o=this.GetEnumerator();try{f=n.From(r).GetEnumerator();try{while(o.MoveNext())if(!f.MoveNext()||u(o.Current())!==u(f.Current()))return i;return f.MoveNext()?i:e}finally{t.Dispose(f)}}finally{t.Dispose(o)}},Union:function(r,f){f=t.CreateLambda(f);var e=this;return new n(function(){var h,o,s;return new u(function(){h=e.GetEnumerator();s=new a(f)},function(){var t;if(o===undefined){while(h.MoveNext())if(t=h.Current(),!s.Contains(t))return s.Add(t),this.Yield(t);o=n.From(r).GetEnumerator()}while(o.MoveNext())if(t=o.Current(),!s.Contains(t))return s.Add(t),this.Yield(t);return i},function(){try{t.Dispose(h)}finally{t.Dispose(o)}})})},OrderBy:function(n){return new h(this,n,i)},OrderByDescending:function(n){return new h(this,n,e)},Reverse:function(){var t=this;return new n(function(){var n,r;return new u(function(){n=t.ToArray();r=n.length},function(){return r>0?this.Yield(n[--r]):i},f.Blank)})},Shuffle:function(){var t=this;return new n(function(){var n;return new u(function(){n=t.ToArray()},function(){if(n.length>0){var t=Math.floor(Math.random()*n.length);return this.Yield(n.splice(t,1)[0])}return i},f.Blank)})},GroupBy:function(f,e,o,s){var h=this;return f=t.CreateLambda(f),e=t.CreateLambda(e),o!=r&&(o=t.CreateLambda(o)),s=t.CreateLambda(s),new n(function(){var n;return new u(function(){n=h.ToLookup(f,e,s).ToEnumerable().GetEnumerator()},function(){while(n.MoveNext())return o==r?this.Yield(n.Current()):this.Yield(o(n.Current().Key(),n.Current()));return i},function(){t.Dispose(n)})})},PartitionBy:function(f,o,s,h){var l=this,c;return f=t.CreateLambda(f),o=t.CreateLambda(o),h=t.CreateLambda(h),s==r?(c=i,s=function(n,t){return new v(n,t)}):(c=e,s=t.CreateLambda(s)),new n(function(){var r,v,y,a=[];return new u(function(){r=l.GetEnumerator();r.MoveNext()&&(v=f(r.Current()),y=h(v),a.push(o(r.Current())))},function(){for(var t,u;(t=r.MoveNext())==e;)if(y===h(f(r.Current())))a.push(o(r.Current()));else break;return a.length>0?(u=c?s(v,n.From(a)):s(v,a),t?(v=f(r.Current()),y=h(v),a=[o(r.Current())]):a=[],this.Yield(u)):i},function(){t.Dispose(r)})})},BufferWithCount:function(r){var f=this;return new n(function(){var n;return new u(function(){n=f.GetEnumerator()},function(){for(var t=[],u=0;n.MoveNext();)if(t.push(n.Current()),++u>=r)return this.Yield(t);return t.length>0?this.Yield(t):i},function(){t.Dispose(n)})})},Aggregate:function(n,t,i){return this.Scan(n,t,i).Last()},Average:function(n){n=t.CreateLambda(n);var i=0,r=0;return this.ForEach(function(t){i+=n(t);++r}),i/r},Count:function(n){n=n==r?f.True:t.CreateLambda(n);var i=0;return this.ForEach(function(t,r){n(t,r)&&++i}),i},Max:function(n){return n==r&&(n=f.Identity),this.Select(n).Aggregate(function(n,t){return n>t?n:t})},Min:function(n){return n==r&&(n=f.Identity),this.Select(n).Aggregate(function(n,t){return n<t?n:t})},MaxBy:function(n){return n=t.CreateLambda(n),this.Aggregate(function(t,i){return n(t)>n(i)?t:i})},MinBy:function(n){return n=t.CreateLambda(n),this.Aggregate(function(t,i){return n(t)<n(i)?t:i})},Sum:function(n){return n==r&&(n=f.Identity),this.Select(n).Aggregate(0,function(n,t){return n+t})},ElementAt:function(n){var t,r=i;if(this.ForEach(function(u,f){if(f==n)return t=u,r=e,i}),!r)throw new Error("index is less than 0 or greater than or equal to the number of elements in source.");return t},ElementAtOrDefault:function(n,t){var r,u=i;return this.ForEach(function(t,f){if(f==n)return r=t,u=e,i}),u?r:t},First:function(n){if(n!=r)return this.Where(n).First();var t,u=i;if(this.ForEach(function(n){return t=n,u=e,i}),!u)throw new Error("First:No element satisfies the condition.");return t},FirstOrDefault:function(n,t){if(t!=r)return this.Where(t).FirstOrDefault(n);var u,f=i;return this.ForEach(function(n){return u=n,f=e,i}),f?u:n},Last:function(n){if(n!=r)return this.Where(n).Last();var t,u=i;if(this.ForEach(function(n){u=e;t=n}),!u)throw new Error("Last:No element satisfies the condition.");return t},LastOrDefault:function(n,t){if(t!=r)return this.Where(t).LastOrDefault(n);var u,f=i;return this.ForEach(function(n){f=e;u=n}),f?u:n},Single:function(n){if(n!=r)return this.Where(n).Single();var u,t=i;if(this.ForEach(function(n){if(t)throw new Error(y);else t=e,u=n}),!t)throw new Error("Single:No element satisfies the condition.");return u},SingleOrDefault:function(n,t){if(t!=r)return this.Where(t).SingleOrDefault(n);var f,u=i;return this.ForEach(function(n){if(u)throw new Error(y);else u=e,f=n}),u?f:n},Skip:function(r){var f=this;return new n(function(){var n,e=0;return new u(function(){for(n=f.GetEnumerator();e++<r&&n.MoveNext(););},function(){return n.MoveNext()?this.Yield(n.Current()):i},function(){t.Dispose(n)})})},SkipWhile:function(r){r=t.CreateLambda(r);var f=this;return new n(function(){var n,s=0,o=i;return new u(function(){n=f.GetEnumerator()},function(){while(!o)if(n.MoveNext()){if(!r(n.Current(),s++))return o=e,this.Yield(n.Current());continue}else return i;return n.MoveNext()?this.Yield(n.Current()):i},function(){t.Dispose(n)})})},Take:function(r){var f=this;return new n(function(){var n,e=0;return new u(function(){n=f.GetEnumerator()},function(){return e++<r&&n.MoveNext()?this.Yield(n.Current()):i},function(){t.Dispose(n)})})},TakeWhile:function(r){r=t.CreateLambda(r);var f=this;return new n(function(){var n,e=0;return new u(function(){n=f.GetEnumerator()},function(){return n.MoveNext()&&r(n.Current(),e++)?this.Yield(n.Current()):i},function(){t.Dispose(n)})})},TakeExceptLast:function(f){f==r&&(f=1);var e=this;return new n(function(){if(f<=0)return e.GetEnumerator();var n,r=[];return new u(function(){n=e.GetEnumerator()},function(){while(n.MoveNext()){if(r.length==f)return r.push(n.Current()),this.Yield(r.shift());r.push(n.Current())}return i},function(){t.Dispose(n)})})},TakeFromLast:function(f){if(f<=0||f==r)return n.Empty();var e=this;return new n(function(){var h,o,s=[];return new u(function(){h=e.GetEnumerator()},function(){while(h.MoveNext())s.length==f&&s.shift(),s.push(h.Current());return o==r&&(o=n.From(s).GetEnumerator()),o.MoveNext()?this.Yield(o.Current()):i},function(){t.Dispose(o)})})},IndexOf:function(n){var t=r;return this.ForEach(function(i,r){if(i===n)return t=r,e}),t!==r?t:-1},LastIndexOf:function(n){var t=-1;return this.ForEach(function(i,r){i===n&&(t=r)}),t},ToArray:function(){var n=[];return this.ForEach(function(t){n.push(t)}),n},ToLookup:function(n,i,r){n=t.CreateLambda(n);i=t.CreateLambda(i);r=t.CreateLambda(r);var u=new a(r);return this.ForEach(function(t){var r=n(t),f=i(t),e=u.Get(r);e!==undefined?e.push(f):u.Add(r,[f])}),new w(u)},ToObject:function(n,i){n=t.CreateLambda(n);i=t.CreateLambda(i);var r={};return this.ForEach(function(t){r[n(t)]=i(t)}),r},ToDictionary:function(n,i,r){n=t.CreateLambda(n);i=t.CreateLambda(i);r=t.CreateLambda(r);var u=new a(r);return this.ForEach(function(t){u.Add(n(t),i(t))}),u},ToJSON:function(n,t){return JSON.stringify(this.ToArray(),n,t)},ToString:function(n,t){return n==r&&(n=""),t==r&&(t=f.Identity),this.Select(t).ToArray().join(n)},Do:function(r){var f=this;return r=t.CreateLambda(r),new n(function(){var n,e=0;return new u(function(){n=f.GetEnumerator()},function(){return n.MoveNext()?(r(n.Current(),e++),this.Yield(n.Current())):i},function(){t.Dispose(n)})})},ForEach:function(n){n=t.CreateLambda(n);var u=0,r=this.GetEnumerator();try{while(r.MoveNext())if(n(r.Current(),u++)===i)break}finally{t.Dispose(r)}},Write:function(n,u){n==r&&(n="");u=t.CreateLambda(u);var f=e;this.ForEach(function(t){f?f=i:document.write(n);document.write(u(t))})},WriteLine:function(n){n=t.CreateLambda(n);this.ForEach(function(t){document.write(n(t));document.write("<br />")})},Force:function(){var n=this.GetEnumerator();try{while(n.MoveNext());}finally{t.Dispose(n)}},Let:function(r){r=t.CreateLambda(r);var f=this;return new n(function(){var e;return new u(function(){e=n.From(r(f)).GetEnumerator()},function(){return e.MoveNext()?this.Yield(e.Current()):i},function(){t.Dispose(e)})})},Share:function(){var e=this,t;return new n(function(){return new u(function(){t==r&&(t=e.GetEnumerator())},function(){return t.MoveNext()?this.Yield(t.Current()):i},f.Blank)})},MemoizeAll:function(){var o=this,t,e;return new n(function(){var n=-1;return new u(function(){e==r&&(e=o.GetEnumerator(),t=[])},function(){return n++,t.length<=n?e.MoveNext()?this.Yield(t[n]=e.Current()):i:this.Yield(t[n])},f.Blank)})},Catch:function(r){r=t.CreateLambda(r);var f=this;return new n(function(){var n;return new u(function(){n=f.GetEnumerator()},function(){try{return n.MoveNext()?this.Yield(n.Current()):i}catch(t){return r(t),i}},function(){t.Dispose(n)})})},Finally:function(r){r=t.CreateLambda(r);var f=this;return new n(function(){var n;return new u(function(){n=f.GetEnumerator()},function(){return n.MoveNext()?this.Yield(n.Current()):i},function(){try{t.Dispose(n)}finally{r()}})})},Trace:function(n,i){return n==r&&(n="Trace"),i=t.CreateLambda(i),this.Do(function(t){console.log(n,":",i(t))})}};var f={Identity:function(n){return n},True:function(){return e},Blank:function(){}},s={Boolean:typeof e,Number:"number",String:"string",Object:"object",Undefined:typeof undefined,Function:typeof function(){}},t={CreateLambda:function(n){if(n==r)return f.Identity;if(typeof n==s.String){if(n=="")return f.Identity;if(n.indexOf("=>")==-1)return new Function("$,$$,$$$,$$$$","return "+n);var t=n.match(/^[(\s]*([^()]*?)[)\s]*=>(.*)/);return new Function(t[1],"return "+t[2])}return n},IsIEnumerable:function(n){if(typeof Enumerator!=s.Undefined)try{return new Enumerator(n),e}catch(t){}return i},Compare:function(n,t){return n===t?0:n>t?1:-1},Dispose:function(n){n!=r&&n.Dispose()}},c={Before:0,Running:1,After:2},u=function(n,t,r){var f=new p,u=c.Before;this.Current=f.Current;this.MoveNext=function(){try{switch(u){case c.Before:u=c.Running;n();case c.Running:return t.apply(f)?e:(this.Dispose(),i);case c.After:return i}}catch(r){this.Dispose();throw r;}};this.Dispose=function(){if(u==c.Running)try{r()}finally{u=c.After}}},p=function(){var n=r;this.Current=function(){return n};this.Yield=function(t){return n=t,e}},h=function(n,i,r,u){var f=this;f.source=n;f.keySelector=t.CreateLambda(i);f.descending=r;f.parent=u};h.prototype=new n;h.prototype.CreateOrderedEnumerable=function(n,t){return new h(this.source,n,t,this)};h.prototype.ThenBy=function(n){return this.CreateOrderedEnumerable(n,i)};h.prototype.ThenByDescending=function(n){return this.CreateOrderedEnumerable(n,e)};h.prototype.GetEnumerator=function(){var e=this,t,n,o=0;return new u(function(){t=[];n=[];e.source.ForEach(function(i,r){t.push(i);n.push(r)});var i=l.Create(e,r);i.GenerateKeys(t);n.sort(function(n,t){return i.Compare(n,t)})},function(){return o<n.length?this.Yield(t[n[o++]]):i},f.Blank)};l=function(n,t,i){var u=this;u.keySelector=n;u.descending=t;u.child=i;u.keys=r};l.Create=function(n,t){var i=new l(n.keySelector,n.descending,t);return n.parent!=r?l.Create(n.parent,i):i};l.prototype.GenerateKeys=function(n){for(var t=this,u=n.length,e=t.keySelector,f=new Array(u),i=0;i<u;i++)f[i]=e(n[i]);t.keys=f;t.child!=r&&t.child.GenerateKeys(n)};l.prototype.Compare=function(n,i){var u=this,f=t.Compare(u.keys[n],u.keys[i]);if(f==0){if(u.child!=r)return u.child.Compare(n,i);f=t.Compare(n,i)}return u.descending?-f:f};o=function(n){this.source=n};o.prototype=new n;o.prototype.Any=function(t){return t==r?this.source.length>0:n.prototype.Any.apply(this,arguments)};o.prototype.Count=function(t){return t==r?this.source.length:n.prototype.Count.apply(this,arguments)};o.prototype.ElementAt=function(t){return 0<=t&&t<this.source.length?this.source[t]:n.prototype.ElementAt.apply(this,arguments)};o.prototype.ElementAtOrDefault=function(n,t){return 0<=n&&n<this.source.length?this.source[n]:t};o.prototype.First=function(t){return t==r&&this.source.length>0?this.source[0]:n.prototype.First.apply(this,arguments)};o.prototype.FirstOrDefault=function(t,i){return i!=r?n.prototype.FirstOrDefault.apply(this,arguments):this.source.length>0?this.source[0]:t};o.prototype.Last=function(t){var i=this;return t==r&&i.source.length>0?i.source[i.source.length-1]:n.prototype.Last.apply(i,arguments)};o.prototype.LastOrDefault=function(t,i){var u=this;return i!=r?n.prototype.LastOrDefault.apply(u,arguments):u.source.length>0?u.source[u.source.length-1]:t};o.prototype.Skip=function(t){var r=this.source;return new n(function(){var n;return new u(function(){n=t<0?0:t},function(){return n<r.length?this.Yield(r[n++]):i},f.Blank)})};o.prototype.TakeExceptLast=function(n){return n==r&&(n=1),this.Take(this.source.length-n)};o.prototype.TakeFromLast=function(n){return this.Skip(this.source.length-n)};o.prototype.Reverse=function(){var t=this.source;return new n(function(){var n;return new u(function(){n=t.length},function(){return n>0?this.Yield(t[--n]):i},f.Blank)})};o.prototype.SequenceEqual=function(t,u){return(t instanceof o||t instanceof Array)&&u==r&&n.From(t).Count()!=this.Count()?i:n.prototype.SequenceEqual.apply(this,arguments)};o.prototype.ToString=function(t,i){return i!=r||!(this.source instanceof Array)?n.prototype.ToString.apply(this,arguments):(t==r&&(t=""),this.source.join(t))};o.prototype.GetEnumerator=function(){var n=this.source,t=0;return new u(f.Blank,function(){return t<n.length?this.Yield(n[t++]):i},f.Blank)};var a=function(){var t=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},o=function(n){return n===r?"null":n===undefined?"undefined":typeof n.toString===s.Function?n.toString():Object.prototype.toString.call(n)},l=function(n,t){var i=this;i.Key=n;i.Value=t;i.Prev=r;i.Next=r},h=function(){this.First=r;this.Last=r},c;return h.prototype={AddLast:function(n){var t=this;t.Last!=r?(t.Last.Next=n,n.Prev=t.Last,t.Last=n):t.First=t.Last=n},Replace:function(n,t){n.Prev!=r?(n.Prev.Next=t,t.Prev=n.Prev):this.First=t;n.Next!=r?(n.Next.Prev=t,t.Next=n.Next):this.Last=t},Remove:function(n){n.Prev!=r?n.Prev.Next=n.Next:this.First=n.Next;n.Next!=r?n.Next.Prev=n.Prev:this.Last=n.Prev}},c=function(n){var t=this;t.count=0;t.entryList=new h;t.buckets={};t.compareSelector=n==r?f.Identity:n},c.prototype={Add:function(n,i){var r=this,h=r.compareSelector(n),s=o(h),e=new l(n,i),u,f;if(t(r.buckets,s)){for(u=r.buckets[s],f=0;f<u.length;f++)if(r.compareSelector(u[f].Key)===h){r.entryList.Replace(u[f],e);u[f]=e;return}u.push(e)}else r.buckets[s]=[e];r.count++;r.entryList.AddLast(e)},Get:function(n){var i=this,e=i.compareSelector(n),s=o(e),u,r,f;if(!t(i.buckets,s))return undefined;for(u=i.buckets[s],r=0;r<u.length;r++)if(f=u[r],i.compareSelector(f.Key)===e)return f.Value;return undefined},Set:function(n,r){var f=this,c=f.compareSelector(n),a=o(c),s,u,h;if(t(f.buckets,a))for(s=f.buckets[a],u=0;u<s.length;u++)if(f.compareSelector(s[u].Key)===c)return h=new l(n,r),f.entryList.Replace(s[u],h),s[u]=h,e;return i},Contains:function(n){var r=this,s=r.compareSelector(n),h=o(s),f,u;if(!t(r.buckets,h))return i;for(f=r.buckets[h],u=0;u<f.length;u++)if(r.compareSelector(f[u].Key)===s)return e;return i},Clear:function(){this.count=0;this.buckets={};this.entryList=new h},Remove:function(n){var i=this,e=i.compareSelector(n),f=o(e),r,u;if(t(i.buckets,f))for(r=i.buckets[f],u=0;u<r.length;u++)if(i.compareSelector(r[u].Key)===e){i.entryList.Remove(r[u]);r.splice(u,1);r.length==0&&delete i.buckets[f];i.count--;return}},Count:function(){return this.count},ToEnumerable:function(){var t=this;return new n(function(){var n;return new u(function(){n=t.entryList.First},function(){if(n!=r){var t={Key:n.Key,Value:n.Value};return n=n.Next,this.Yield(t)}return i},f.Blank)})}},c}(),w=function(t){var i=this;i.Count=function(){return t.Count()};i.Get=function(i){return n.From(t.Get(i))};i.Contains=function(n){return t.Contains(n)};i.ToEnumerable=function(){return t.ToEnumerable().Select(function(n){return new v(n.Key,n.Value)})}},v=function(n,t){this.Key=function(){return n};o.call(this,t)};return v.prototype=new o,n}()