n.start=function(){this.enabled=j;this.e||(this.e=this.ba.setTimeout(this.va,this.U),this.Ba=ja())};n.stop=function(){this.enabled=m;this.e&&(this.ba.clearTimeout(this.e),this.e=k)};n.d=function(){Vb.j.d.call(this);this.stop();deletethis.ba};varXb="tick";functionX(a){this.sb=a;this.Aa=[]}y(X,N);varYb=[];functionZb(a,b,c,d,e){r(c)||(Yb[0]=c,c=Yb);for(varf=0;f<c.length;f++)a.Aa.push(T(b,c[f],d||a,e||m,a.sb||a));returna}function$b(a){B(a.Aa,Jb);a.Aa.length=0}X.prototype.d=function(){X.j.d.call(this);$b(this)};X.prototype.handleEvent=function(){g(Error("EventHandler.handleEvent not implemented"))};functionac(){O.call(this,"navigate")}y(ac,O);functionY(a,b,c,d){a&&!b&&g(Error("Can't use invisible history without providing a blank page."));vare;c?e=c:(e="history_state"+bc,document.write(ka(cc,e,e)),e=M(e));this.ia=e;this.c=c?L(c)?L(c).parentWindow||L(c).defaultView:window:window;this.lb=this.c.location.href.split("#")[0];this.ja=b;F&&!b&&(this.ja="https"==window.location.protocol?"https:///":'javascript:""');this.e=newVb(dc);this.R=!a;this.D=newX(this);if(a||F&&!ec)d?a=d:(a="history_iframe"+bc,b=this.ja?'src="'+na(this.ja)+'"':"",document.write(ka(fc,
pc.prototype.yb=function(){vara=this.T.s();B(this.ab||[],function(b){varc=b.$.exec(a);c&&b.mb.apply(this,c)},this)};functionqc(){}(function(a){a.Ra=function(){returna.ub||(a.ub=newa)}})(qc);qc.prototype.xb=0;qc.Ra();functionrc(a){this.I=a||mb()}y(rc,U);n=rc.prototype;n.tb=qc.Ra();n.K=k;n.i=m;n.h=k;n.l=k;n.o=k;n.f=k;n.n=k;n.jb=m;functionsc(a){returna.K||(a.K=":"+(a.tb.xb++).toString(36))}n.w=function(){returnthis.h};functiontc(a,b){a==b&&g(Error("Unable to set parent component"));b&&a.o&&a.K&&a.o.n&&a.K&&a.Kina.o.n&&a.o.n[a.K]&&a.o!=b&&g(Error("Unable to set parent component"));a.o=b;rc.j.Ga.call(a,b)}n.getParent=function(){returnthis.o};
n.Ga=function(a){this.o&&this.o!=a&&g(Error("Method not supported"));rc.j.Ga.call(this,a)};n.xa=function(){this.h=this.I.createElement("div")};n.C=function(){this.i=j;uc(this,function(a){!a.i&&a.w()&&a.C()})};functionvc(a){uc(a,function(a){a.i&&vc(a)});a.J&&$b(a.J);a.i=m}n.d=function(){rc.j.d.call(this);this.i&&vc(this);this.J&&(this.J.k(),deletethis.J);uc(this,function(a){a.k()});!this.jb&&this.h&&ub(this.h);this.o=this.l=this.h=this.n=this.f=k};functionuc(a,b){a.f&&B(a.f,b,i)}
n.removeChild=function(a,b){if(a){varc=u(a)?a:sc(a),a=this.n&&c?(cinthis.n?this.n[c]:i)||k:k;c&&a&&(ib(this.n,c),Ba(this.f,a),b&&(vc(a),a.h&&ub(a.h)),tc(a,k))}a||g(Error("Child is not in parent component"));returna};n.$a=function(a){for(;this.f&&0!=this.f.length;)this.removeChild(this.f?this.f[0]||k:k,a)};functionZ(a){this.I=mb();this.l=a;this.r={Ca:{},F:{}};this.N=[]}y(Z,rc);n=Z.prototype;n.remove=function(){ub(this.w());this.k()};n.rb=function(a,b){this.r.F[a]&&B(this.r.F[a],function(a){b.H||(!a.bb.length||ua(a.bb,function(a){returnda(a)?a(b):yb(b.target,a)}))&&a.ha.call(a.S,b)})};
Ec.prototype.refresh=function(){uc(this,function(a){a.k()});this.$a(j);B(Ub(this.l,this.Qa),function(a){vara=newDc(a),b=this.f?this.f.length:0;a.i&&!this.i&&g(Error("Component already rendered"));(0>b||b>(this.f?this.f.length:0))&&g(Error("Child component index out of bounds"));if(!this.n||!this.f)this.n={},this.f=[];if(a.getParent()==this)this.n[sc(a)]=a,Ba(this.f,a);else{varc=this.n,d=sc(a);dinc&&g(Error('The object already contains the key "'+d+'"'));c[d]=a}tc(a,this);za(this.f,a,b);a.i&&
functionPc(a,b){b.push('"',a.replace(Rc,function(a){if(ainQc)returnQc[a];varb=a.charCodeAt(0),e="\\u";16>b?e+="000":256>b?e+="00":4096>b&&(e+="0");returnQc[a]=e+b.toString(16)}),'"')};functionSc(){};functionTc(a){this.Y=a;this.cb=newMc}n=Tc.prototype;n.Y=k;n.cb=k;n.set=function(a,b){q(b)?this.Y.set(a,Nc(this.cb,b)):this.Y.remove(a)};n.get=function(a){a=this.Y.get(a);if(a!==k)try{returnLc(a)}catch(b){g("Storage: Invalid value was encountered")}};n.remove=function(a){this.Y.remove(a)};functionUc(){}y(Uc,Sc);functionVc(a){this.pa=a}y(Vc,Uc);Vc.prototype.set=function(a,b){try{this.pa.setItem(a,b)}catch(c){g("Storage mechanism: Quota exceeded")}};Vc.prototype.get=function(a){a=this.pa.getItem(a);if(u(a)||a===k)returna;g("Storage mechanism: Invalid value was encountered")};Vc.prototype.remove=function(a){this.pa.removeItem(a)};functionWc(){vara=k;try{a=window.localStorage||k}catch(b){}this.pa=a}y(Wc,Vc);functionXc(){this.qa=newTc(newWc)}Xc.prototype.create=function(a){varb;this.Na=this.Na||0;b=this.Na+++"|"+parseInt((newDate).getTime(),36);a.set("id",b)};Xc.prototype.Za=function(a){a.set(this.qa.get(a.get("id")))};Xc.prototype.update=function(a){this.qa.set(a.get("id"),a.ra())};functionYc(){Xc.call(this)}y(Yc,Xc);Yc.prototype.Za=function(a){varb=this.qa.get(a.get("id"))||[];B(b,function(b){b=newa.Va(b);a.add(b,0,j)});a.u()};functionZc(a){V.call(this,a);Rb(this,function(a){a=la(a);a.length||g(newPb);returna});Tb(this,function(){this.k()})}y(Zc,V);function$c(){W.call(this,{id:"todos-plastronjs",sync:newYc,schema:{completed:{get:function(){returnUb(this,function(a){returna.get("completed")})},wb:j}},modelType:Zc})}y($c,W);$c.prototype.ra=function(){returnC(Ub(this),function(a){returna.ra()})};varad=new$c,Kc=newEc(ad),$=Kc,bd=M("todoapp");$.i&&g(Error("Component already rendered"));if(bd){$.jb=j;if(!$.I||$.I.B!=L(bd))$.I=mb(bd);$.h=bd;$.C()}elseg(Error("Invalid element to decorate"));varcd=newpc;
n.appendChild=function(a,b){a.appendChild(b)};n.contains=Zb;function$b(a){this.Wb=a;this.Qa=[]}A($b,ia);varac=[];functionbc(a,b,c,d,e){r(c)||(ac[0]=c,c=ac);for(varf=0;f<c.length;f++)a.Qa.push(S(b,c[f],d||a,e||l,a.Wb||a));returna}functioncc(a){D(a.Qa,xb);a.Qa.length=0}$b.prototype.j=function(){$b.d.j.call(this);cc(this)};$b.prototype.handleEvent=function(){g(Error("EventHandler.handleEvent not implemented"))};functiondc(){O.call(this,"navigate")}A(dc,O);functionU(a,b,c,d){a&&!b&&g(Error("Can't use invisible history without providing a blank page."));vare;c?e=c:(e="history_state"+ec,document.write(ka(fc,e,e)),e=Nb(e));this.ra=e;this.i=c?Mb(c)?Mb(c).parentWindow||Mb(c).defaultView:window:window;this.Kb=this.i.location.href.split("#")[0];this.sa=b;I&&!b&&(this.sa="https"==window.location.protocol?"https:///":'javascript:""');this.l=newCb(gc);this.Y=!a;this.J=new$b(this);if(a||I&&!hc)d?a=d:(a="history_iframe"+ec,b=this.sa?'src="'+na(this.sa)+'"':
sc.prototype.cc=function(){vara=this.ca.z();a!=this.qa&&(this.dispatchEvent({type:"routeExpired",pc:this.qa,nc:a}),this.qa=a,D(this.yb||[],function(b){tc(b,a)},this))};functionuc(){}(function(a){a.pb=function(){returna.Zb||(a.Zb=newa)}})(uc);uc.prototype.ac=0;uc.pb();functionvc(a){this.aa=a||Kb()}A(vc,T);n=vc.prototype;n.Xb=uc.pb();n.S=k;n.g=l;n.f=k;n.c=k;n.s=k;n.b=k;n.m=k;n.Gb=l;functionwc(a){returna.S||(a.S=":"+(a.Xb.ac++).toString(36))}n.v=function(){returnthis.f};n.ab=function(a){this.f=a};functionxc(a,b){a==b&&g(Error("Unable to set parent component"));b&&a.s&&a.S&&a.s.m&&a.S&&a.Sina.s.m&&a.s.m[a.S]&&a.s!=b&&g(Error("Unable to set parent component"));a.s=b;vc.d.cb.call(a,b)}n.getParent=function(){returnthis.s};
n.cb=function(a){this.s&&this.s!=a&&g(Error("Method not supported"));vc.d.cb.call(this,a)};n.O=function(){this.f=this.aa.createElement("div")};functionyc(a,b,c){a.g&&g(Error("Component already rendered"));a.f||a.O();b?b.insertBefore(a.f,c||k):a.aa.P.body.appendChild(a.f);(!a.s||a.s.g)&&a.C()}n.C=function(){this.g=j;zc(this,function(a){!a.g&&a.v()&&a.C()})};functionAc(a){zc(a,function(a){a.g&&Ac(a)});a.R&&cc(a.R);a.g=l}
n.Z=function(a,b,c){a.g&&(c||!this.g)&&g(Error("Component already rendered"));(0>b||b>(this.b?this.b.length:0))&&g(Error("Child component index out of bounds"));if(!this.m||!this.b)this.m={},this.b=[];a.getParent()==this?(this.m[wc(a)]=a,Ca(this.b,a)):mb(this.m,wc(a),a);xc(a,this);Aa(this.b,a,b);a.g&&this.g&&a.getParent()==this?(c=this.D(),c.insertBefore(a.v(),c.childNodes[b]||k)):c?(this.f||this.O(),b=this.b?this.b[b+1]||k:k,yc(a,this.D(),b?b.f:k)):this.g&&!a.g&&a.f&&a.C()};n.D=function(){returnthis.f};
functionzc(a,b){a.b&&D(a.b,b,i)}n.removeChild=function(a,b){if(a){varc=t(a)?a:wc(a),a=this.m&&c?(cinthis.m?this.m[c]:i)||k:k;c&&a&&(lb(this.m,c),Ca(this.b,a),b&&(Ac(a),a.f&&Yb(a.f)),xc(a,k))}a||g(Error("Child is not in parent component"));returna};functionV(a){V.d.constructor.apply(this,H(arguments,1));this.r={Sa:{},F:{}};this.ia=[];this.na=[];this.bb(a);this.xa=this.pa=k}A(V,vc);n=V.prototype;n.ab=function(a){V.d.ab.call(this,a);this.pa||(this.pa=a)};n.D=function(){returnthis.pa||V.d.D.call(this)};
n.Z=function(a,b,c){if(I&&!M(9))V.d.Z.call(this,a,b,c);else{a.g&&(c||!this.g)&&g(Error("Component already rendered"));(0>b||b>(this.b?this.b.length:0))&&g(Error("Child component index out of bounds"));if(!this.m||!this.b)this.m={},this.b=[];a.getParent()==this?(nb(this.m,wc(a),a),Ca(this.b,a)):mb(this.m,wc(a),a);xc(a,this);Aa(this.b,a,b);if(c&&(!a.Yb||!this.Yb||a.getParent!=this)){this.f||this.O();vard=this.b?this.b[b+1]||k:k;yc(a,this.D(),d?d.f:k)}if(a.g&&this.g&&a.getParent()==this){vare=this.D();
n.La=function(){$c.d.La.call(this);this.G&&(D(G(this.Ua),function(a){a(this)},this),this.G=l);this.N&&(D(G(this.Ga),function(a){a(this)},this),this.h&&P(this.h,function(a,b){a.va&&D(this.oa,function(a){0<=C(a.A,b)&&a.K.apply(a.rb,Da(E(a.A,function(a){returnthis.get(a)},this)))},this)},this),this.N=l);D(this.Za,function(a){D(this.$a,function(b){a(b.n,b.id)})},this);this.$a=[];D(this.Ea,function(a){D(this.Fa,function(b){a(b)})},this);this.Fa=[]};functionad(){};functionbd(a){this.ha=a;this.Ab=newNc}n=bd.prototype;n.ha=k;n.Ab=k;n.set=function(a,b){q(b)?this.ha.set(a,Oc(this.Ab,b)):this.ha.remove(a)};n.get=function(a){a=this.ha.get(a);if(a!==k)try{returnMc(a)}catch(b){g("Storage: Invalid value was encountered")}};n.remove=function(a){this.ha.remove(a)};functioncd(){}A(cd,ad);functiondd(a){this.Aa=a}A(dd,cd);dd.prototype.set=function(a,b){try{this.Aa.setItem(a,b)}catch(c){g("Storage mechanism: Quota exceeded")}};dd.prototype.get=function(a){a=this.Aa.getItem(a);if(t(a)||a===k)returna;g("Storage mechanism: Invalid value was encountered")};dd.prototype.remove=function(a){this.Aa.removeItem(a)};functioned(){vara=k;try{a=window.localStorage||k}catch(b){}this.Aa=a}A(ed,dd);functionfd(){this.Ba=newbd(newed)}fd.prototype.create=function(a,b){varc;this.mb=this.mb||0;c=this.mb+++"|"+parseInt((newDate).getTime(),36);a.set("id",c);u(b)&&b.call(a,a)};fd.prototype.xb=function(a,b){a.set(this.Ba.get(a.get("id")));u(b)&&b.call(a,a)};fd.prototype.update=function(a,b){this.Ba.set(a.get("id"),a.eb());u(b)&&b.call(a,a)};functionYc(a,b,c){a.Ba.remove(b.get("id"));u(c)&&c.call(b,b)};functiongd(){fd.call(this)}A(gd,fd);gd.prototype.xb=function(a){varb=this.Ba.get(a.get("id"))||[];D(b,function(b){b=newa.Va(b);a.add(b,i,j)});a.$()};functionhd(a){Z.call(this,a);Wc(this,function(a){a=la(a);a.length||g(newUc);returna});Zc(this,function(){this.o()})}A(hd,Z);functionid(){$c.call(this,{id:"todos-plastronjs",sync:newgd,schema:{completed:{get:function(){returnthis.w("completed").length},va:j},allDone:{get:function(){returnthis.p.length==this.w("completed").length},set:function(a){D(this.w("none"),function(b){b.set("completed",a)})},va:j},active:{get:function(){returnthis.p.length-this.w("completed").length},va:j},total:{get:function(){returnthis.p.length},va:j}},modelType:hd});this.ka.xb(this,i);this.ma(this.save)}A(id,$c);
varjd={none:function(){returnj},active:function(a){return!a.get("completed")},completed:function(a){returna.get("completed")}};id.prototype.w=function(a){returnid.d.w.call(this,jd[a||this.get("filter")])};id.prototype.eb=function(){returnE(this.w("none"),function(a){returna.eb()})};varkd=newid,$=newLc(kd),ld=Nb("todoapp");$.g&&g(Error("Component already rendered"));if(ld){$.Gb=j;if(!$.aa||$.aa.P!=Mb(ld))$.aa=Kb(ld);$.f=ld;$.C()}elseg(Error("Invalid element to decorate"));varmd=newsc;md.ja("{/}",function(){kd.set("filter","none")});md.ja("/active",function(){kd.set("filter","active")});md.ja("/completed",function(){kd.set("filter","completed")});})();