v(f);if(cinstanceofp)returnc.toDOM(a||d);d=m.createTextNode(""+c)}a&&a.parentNode&&a.parentNode.replaceChild(d,a);returnd};p.prototype.reload=function(){vara=m;try{varb=this.toDOM();a.replaceChild(b,a.documentElement);if(a.createStyleSheet){for(vard=b.firstChild;d&&"HEAD"!==(d.tagName||"");)d=d.nextSibling;for(varf=d&&d.firstChild;f;){if("LINK"===(f.tagName||""))f.href=f.href;f=f.nextSibling}}}catch(c){a=a.open("text/html"),a.write(""+this),a.close()}};returnx}(document,window.ScriptEngineMajorVersion);vartodos=todos||{};todos.views=todos.views||{};todos.views.Stats=duel(["","",["$if",{test:function(a){returna.total}},["footer",{"class":"footer"},"",["span",{"class":"todo-count"},["strong",function(a){returna.active}],"",function(a){return1===a.active?"item":"items"}," left"],"","",["!"," Hidden if no completed items are left \u2193 "],"",["$if",{test:function(a){returna.completed}},["button",{"class":"clear-completed",onclick:function(){returntodos.actions.clearOnClick}},"Clear completed"]]]]]);vartodos=todos||{};todos.views=todos.views||{};
todos.views.Tasks=duel(["","",["$if",{test:function(a){returna.tasks&&a.tasks.length}},["section",{"class":"main"},"",["input",{"class":"toggle-all",type:"checkbox",checked:function(a){return!a.stats.active},onchange:function(){returntodos.actions.toggleOnChange}}],"",["label",{"for":"toggle-all"},"Mark all as complete"],"",["ul",{"class":"todo-list"},"",["$for",{each:function(a){returna.tasks}},"",["$call",{view:function(){returntodos.views.Task}}]],""]]]]);vartodos=todos||{};todos.views=todos.views||{};todos.views.TodoApp=duel(["section",{"class":"todoapp"},"",["header",{"class":"header"},"",["h1","todos"],"",["input",{"class":"new-todo",placeholder:"What needs to be done?",autofocus:!0,onblur:function(){returntodos.actions.add_blur},onkeydown:function(){returntodos.actions.addOnKeydown}}],""],"",["$call",{view:function(){returntodos.views.Tasks},data:function(a){returna}}],"",["$call",{view:function(){returntodos.views.Stats},data:function(a){returna.stats}}]]);vartodos=todos||{};