// Knockout JavaScript library v2.1.0pre // (c) Steven Sanderson - http://knockoutjs.com/ // License: MIT (http://www.opensource.org/licenses/mit-license.php) (function(window,document,navigator,undefined){ function l(A){throw A;}var m=void 0,n=!0,p=null,s=!1;function C(A){return function(){return A}} function D(A){var a="undefined"!==typeof A?A:{};a.b=function(b,c){for(var d=b.split("."),e=a,f=0;f",e[0];);return 4a.a.i(e,b[c])&&e.push(b[c]);return e},W:function(a,b){for(var a=a||[],e=[],c=0,f=a.length;ca.length?s:a.substring(0,b.length)===b},ob:function(a,b){for(var e="return ("+a+")",c=0;c",""]||!d.indexOf("",""]||(!d.indexOf("",""]||[0,"",""];b="ignored
"+d[1]+b+d[2]+"
";for("function"==typeof window.innerShiv?c.appendChild(window.innerShiv(b)):c.innerHTML=b;d[0]--;)c=c.lastChild;c=a.a.P(c.lastChild.childNodes)}return c};a.a.ua=function(b,c){a.a.ma(b);if(c!==p&&c!==m)if("string"!= typeof c&&(c=c.toString()),"undefined"!=typeof jQuery)jQuery(b).html(c);else for(var d=a.a.ra(c),e=0;e"},fb:function(a,b){var c=d[a];c===m&&l(Error("Couldn't find any memo with ID "+a+". Perhaps it's already been unmemoized."));try{return c.apply(p,b||[]),n}finally{delete d[a]}},gb:function(b,f){var d=[];c(b,d);for(var h=0,i=d.length;hc;c++)b=b();return b})};a.toJSON=function(b){b=a.cb(b); return a.a.wa(b)}})();a.b("toJS",a.cb);a.b("toJSON",a.toJSON);(function(){a.k={t:function(b){return"OPTION"==b.tagName?b.__ko__hasDomDataOptionValue__===n?a.a.e.get(b,a.c.options.qa):b.getAttribute("value"):"SELECT"==b.tagName?0<=b.selectedIndex?a.k.t(b.options[b.selectedIndex]):m:b.value},ba:function(b,c){if("OPTION"==b.tagName)switch(typeof c){case "string":a.a.e.set(b,a.c.options.qa,m);"__ko__hasDomDataOptionValue__"in b&&delete b.__ko__hasDomDataOptionValue__;b.value=c;break;default:a.a.e.set(b, a.c.options.qa,c),b.__ko__hasDomDataOptionValue__=n,b.value="number"===typeof c?c:""}else if("SELECT"==b.tagName){""==c&&(c=m);if(c===m)b.selectedIndex=-1;for(var d=b.options.length-1;0<=d;d--)if(a.k.t(b.options[d])==c){b.selectedIndex=d;break}if(!(1e.length)return[];"{"===e.charAt(0)&&(e=e.substring(1,e.length-1));for(var c=[],d=p,i,j=0;j$/:/^\s*ko\s+(.*\:.*)\s*$/,h=f?/^<\!--\s*\/ko\s*--\>$/:/^\s*\/ko\s*$/,i={ul:n,ol:n};a.f= {z:{},childNodes:function(a){return b(a)?d(a):a.childNodes},Ha:function(c){if(b(c))for(var c=a.f.childNodes(c),e=0,d=c.length;e"),s)}};a.c.uniqueName.sb=0;a.c.checked={init:function(b,c,d){a.a.u(b,"click",function(){var e;if("checkbox"== b.type)e=b.checked;else if("radio"==b.type&&b.checked)e=b.value;else return;var f=c();"checkbox"==b.type&&a.a.d(f)instanceof Array?(e=a.a.i(a.a.d(f),b.value),b.checked&&0>e?f.push(b.value):!b.checked&&0<=e&&f.splice(e,1)):a.S(f)?f()!==e&&f(e):(f=d("_ko_property_writers"))&&f.checked&&f.checked(e)});"radio"==b.type&&!b.name&&a.c.uniqueName.init(b,C(n))},update:function(b,c){var d=a.a.d(c());if("checkbox"==b.type)b.checked=d instanceof Array?0<=a.a.i(d,b.value):d;else if("radio"==b.type)b.checked=b.value== d}};a.c.attr={update:function(b,c){var d=a.a.d(c())||{},e;for(e in d)if("string"==typeof e){var f=a.a.d(d[e]);f===s||f===p||f===m?b.removeAttribute(e):b.setAttribute(e,f.toString())}}};a.c.hasfocus={init:function(b,c,d){function e(b){var e=c();b!=a.a.d(e)&&(a.S(e)?e(b):(e=d("_ko_property_writers"))&&e.hasfocus&&e.hasfocus(b))}a.a.u(b,"focus",function(){e(n)});a.a.u(b,"focusin",function(){e(n)});a.a.u(b,"blur",function(){e(s)});a.a.u(b,"focusout",function(){e(s)})},update:function(b,c){var d=a.a.d(c()); d?b.focus():b.blur();a.a.za(b,d?"focusin":"focusout")}};a.c.repeat={init:function(b,c,d,e,f){d={Ua:"$index",Ta:"$item"};c=a.a.d(c());if("object"==typeof c){if("index"in c)d.Ua=c.index;if("item"in c)d.Ta=c.item;if("bind"in c)d.Sa=c.bind}d.r=b.cloneNode(n);a.a.e.rb(d.r);d.r.removeAttribute("data-bind");b.style.display="none";for(b.disabled=n;b.firstChild;)b.removeChild(b.firstChild);d.jb=[];d.Va=a.p();d.$=m;f.$repeatOptions=d;return{controlsDescendantBindings:n}},update:function(b,c,d,e,f){var g=f.$repeatOptions, d=g.jb,e=b.parentNode,c=a.a.d(c());if("object"==typeof c)if("count"in c)c=a.a.d(c.count);else if("foreach"in c)g.$=a.a.d(c.foreach),c=g.$.length;g.Va.notifySubscribers();if(d.lengthc)for(;d.length>c;)a.removeNode(d.pop())}};a.c["switch"]={Fa:{},init:function(b,c,d,e,f){d=a.a.d(c());d===s&&l("cannot specify boolean false in switch binding");b=a.f.childNodes(b)[0];for(d={ca:m,K:[],ib:c,$default:this.Fa,$else:this.Fa,$value:d};c=b;)switch(b=a.f.nextSibling(c),c.nodeType){case 1:case 8:e=a.a.extend(a.a.extend(new a.C,f),d),a.V(e,c)}return{controlsDescendantBindings:n}}}; a.h.A["switch"]=s;a.f.z["switch"]=n;a.c["case"]={pb:function(b,c){var d=c.ca;if(d&&c.K[d-1]())return c.K[d](n),s;var e=a.a.d(b()),f=n;e!==c.$else&&(f=a.a.d(c.ib()),f="boolean"==typeof e?e:e instanceof Array?-1!==a.a.i(e,f):e==f);c.K[d](f);return f},m:function(b){return function(){return{"if":b,templateEngine:a.o.H}}},init:function(b,c,d,e,f){f.K||l("case binding must only be used with a switch binding");f.ca!==m&&l("case binding cannot be nested");f.ca=f.K.length;f.K.push(a.p(s));return a.c.template.init(b, this.m(m))},update:function(b,c,d,e,f){return a.c.template.update(b,this.m(this.pb(c,f)),d,e,f)}};a.h.A["case"]=s;a.f.z["case"]=n;a.c.withlight={init:function(){return{controlsDescendantBindings:n}},update:function(b,c,d,e,f){c=a.a.d(c());("object"!=typeof c||c===p)&&l(Error("withlight must be used with an object"));if(b.__ko_withlightInit__){for(;b.firstChild;)a.removeNode(b.firstChild);b.innerHTML=b.__ko_withlightInit__}else b.__ko_withlightInit__=b.innerHTML;f=f.createChildContext(c);for(c=b.childNodes[0];b= c;)c=a.f.nextSibling(b),(1===b.nodeType||8===b.nodeType)&&a.V(f,b)}};a.c["with"]={m:function(b){return function(){var c=b();return{"if":c,data:c,templateEngine:a.o.H}}},init:function(b,c){return a.c.template.init(b,a.c["with"].m(c))},update:function(b,c,d,e,f){return a.c.template.update(b,a.c["with"].m(c),d,e,f)}};a.h.A["with"]=s;a.f.z["with"]=n;a.c["if"]={m:function(b){return function(){return{"if":b(),templateEngine:a.o.H}}},init:function(b,c){return a.c.template.init(b,a.c["if"].m(c))},update:function(b, c,d,e,f){return a.c.template.update(b,a.c["if"].m(c),d,e,f)}};a.h.A["if"]=s;a.f.z["if"]=n;a.c.ifnot={m:function(b){return function(){return{ifnot:b(),templateEngine:a.o.H}}},init:function(b,c){return a.c.template.init(b,a.c.ifnot.m(c))},update:function(b,c,d,e,f){return a.c.template.update(b,a.c.ifnot.m(c),d,e,f)}};a.h.A.ifnot=s;a.f.z.ifnot=n;a.c.foreach={m:function(b){return function(){var c=b();return!c||"number"==typeof c.length?{foreach:c,templateEngine:a.o.H}:{foreach:c.data,comparer:c.comparer, includeDestroyed:c.includeDestroyed,afterAdd:c.afterAdd,beforeRemove:c.beforeRemove,afterRender:c.afterRender,templateEngine:a.o.H}}},init:function(b,c){return a.c.template.init(b,a.c.foreach.m(c))},update:function(b,c,d,e,f){return a.c.template.update(b,a.c.foreach.m(c),d,e,f)}};a.h.A.foreach=s;a.f.z.foreach=n;a.b("allowedVirtualElementBindings",a.f.z);a.v=function(){};a.v.prototype.renderTemplateSource=function(){l("Override renderTemplateSource")};a.v.prototype.createJavaScriptEvaluatorBlock=function(){l("Override createJavaScriptEvaluatorBlock")}; a.v.prototype.makeTemplateSource=function(b){if("string"==typeof b){var c=document.getElementById(b);c||l(Error("Cannot find template with ID "+b));return new a.n.g(c)}if(1==b.nodeType||8==b.nodeType)return new a.n.Q(b);l(Error("Unknown template type: "+b))};a.v.prototype.renderTemplate=function(a,c,d){return this.renderTemplateSource(this.makeTemplateSource(a),c,d)};a.v.prototype.isTemplateRewritten=function(a){return this.allowTemplateRewriting===s?n:this.Y&&this.Y[a]?n:this.makeTemplateSource(a).data("isRewritten")}; a.v.prototype.rewriteTemplate=function(a,c){var d=this.makeTemplateSource(a),e=c(d.text());d.text(e);d.data("isRewritten",n);if("string"==typeof a)this.Y=this.Y||{},this.Y[a]=n};a.b("templateEngine",a.v);a.aa=function(){function b(b,c,d){for(var b=a.h.Z(b),h=a.h.A,i=0;i/g;return{zb:function(b,c){c.isTemplateRewritten(b)||c.rewriteTemplate(b,function(b){return a.aa.Mb(b,c)})},Mb:function(a,f){return a.replace(c,function(a,c,d,e,k,o,q){return b(q,c,f)}).replace(d,function(a,c){return b(c,"<\!-- ko --\>",f)})},kb:function(b){return a.s.pa(function(c, d){c.nextSibling&&a.ea(c.nextSibling,b,d)})}}}();a.b("templateRewriting",a.aa);a.b("templateRewriting.applyMemoizedBindingsToNextSibling",a.aa.kb);(function(){a.n={};a.n.g=function(a){this.g=a};a.n.g.prototype.text=function(){var a=this.g.tagName.toLowerCase();if(0==arguments.length)return"script"==a?this.g.text:"textarea"==a?this.g.value:this.g.innerHTML;var c=arguments[0];"script"==a?this.g.text=c:this.g.value=c};a.n.g.prototype.data=function(b){if(1===arguments.length)return a.a.e.get(this.g,"templateSourceData_"+ b);a.a.e.set(this.g,"templateSourceData_"+b,arguments[1])};a.n.Q=function(a){this.g=a};a.n.Q.prototype=new a.n.g;a.n.Q.prototype.text=function(){if(0==arguments.length){var b=a.a.e.get(this.g,"__ko_anon_template__")||{};if(b.ya===m&&b.ia)b.ya=b.ia.innerHTML;return b.ya}a.a.e.set(this.g,"__ko_anon_template__",{ya:arguments[0]})};a.n.g.prototype.nodes=function(){if(0==arguments.length)return(a.a.e.get(this.g,"__ko_anon_template__")||{}).ia;a.a.e.set(this.g,"__ko_anon_template__",{ia:arguments[0]})}; a.b("templateSources",a.n);a.b("templateSources.domElement",a.n.g);a.b("templateSources.anonymousTemplate",a.n.Q)})();(function(){function b(a,b,c){for(var d=0;node=a[d];d++)node.parentNode===b&&(1===node.nodeType||8===node.nodeType)&&c(node)}function c(b,c,g,h,i){var i=i||{},j=i.templateEngine||d;a.aa.zb(g,j);g=j.renderTemplate(g,h,i);("number"!=typeof g.length||0a.a.Db)&&b.nodes?b.nodes():p;if(c)return a.a.P(c.cloneNode(n).childNodes);b=b.text();return a.a.ra(b)};a.o.H=new a.o;a.va(a.o.H);a.b("nativeTemplateEngine",a.o);(function(){a.oa= function(){var a=this.Ib=function(){if("undefined"==typeof jQuery||!jQuery.tmpl)return 0;try{if(0<=jQuery.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(a){}return 1}();this.renderTemplateSource=function(b,e,f){f=f||{};2>a&&l(Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later."));var g=b.data("precompiled");g||(g=b.text()||"",g=jQuery.template(p,"{{ko_with $item.koBindingContext}}"+g+"{{/ko_with}}"),b.data("precompiled",g));b=[e.$data];e=jQuery.extend({koBindingContext:e}, f.templateOptions);e=jQuery.tmpl(g,b,e);e.appendTo(document.createElement("div"));jQuery.fragments={};return e};this.createJavaScriptEvaluatorBlock=function(a){return"{{ko_code ((function() { return "+a+" })()) }}"};this.addTemplate=function(a,b){document.write("