text: !function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";n.r(e);const i=Object.create(Array.prototype),o=Array.prototype.slice;["push","pop","shift","unshift","splice","sort","reverse"].forEach(function(t){const e=Array.prototype[t];i[t]=function(){const n=m.getListenerWithData(this),i=o.call(arguments,0),r=e.apply(this,i);switch(t){case"pop":case"shift":break;case"push":case"unshift":i.forEach(m.listen);break;case"splice":i.slice(2).forEach(m.listen)}return n.notifyWatchers(),r}});var r=i;let s=0;const c=[];class a{constructor(){}init(t,e,n){return this.__id__=s++,this.node=t,this.data=e,this.updateFn=n,this.update=function(){a.globalWatcher=this,(0,this.updateFn)(this.node,this.data),a.globalWatcher=null},this.listeners=[],this}addListener(t){this.listeners.indexOf(t)<0&&this.listeners.push(t)}removeListener(t){const e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)}remove(){a.globalWatcher===this&&(a.globalWatcher=null),this.listeners.forEach(t=>{t.removeWatcher(this)}),this.node=this.data=this.update=this.updateFn=this.listeners=null,a.collect(this)}static watch(t,e,n){const i=a.create(t,e,n);return i.update(),i}static create(...t){return(c.length?c.pop():new a).init(...t)}static collect(t){c.push(t)}static clearCache(){c.length=0}}var u=a;function l(t,e){if(t.__listener__)return t.__listener__;const n=e||f.create(t);return t&&"object"==typeof t&&Object.defineProperty(t,"__listener__",{value:n,enumerable:!1,writable:!0,configurable:!0}),n}let h=0;const d=[];class f{constructor(){}init(t){return this.__id__=++h,this.value=t,this.watcherList=[],this.setValueQueue=[],this.setValuePromise=null,this}remove(){this.watcherList.forEach(t=>{t.removeListener(this)}),this.value=this.watcherList=this.setValueQueue=this.setValuePromise=null,f.collect(this)}getValue(){return this.addWatcher(),this.value}setValue(t){this.setValueQueue.push(t),this.setValuePromise||(this.setValuePromise=Promise.resolve().then(()=>{if(this.setValueQueue.length){const t=this.setValueQueue.pop();t!==this.value&&(l(t,this),f.listen(t),f.unListen(this.value),this.value=t,this.notifyWatchers()),this.setValueQueue.length=0}this.setValuePromise=null}))}addWatcher(){u.globalWatcher&&this.watcherList.indexOf(u.globalWatcher)<0&&this.watcherList.push(u.globalWatcher)}removeWatcher(t){const e=this.watcherList.indexOf(t);e>-1&&this.watcherList.splice(e,1)}notifyWatchers(){this.watcherList&&this.watcherList.forEach(t=>{t&&t.update(this)})}removeItemsFromArray(t){t.length&&t.forEach(function(t){f.unListen(t,!0)})}removeItemFromArray(t){f.unListen(t,!0)}static listen(t){if(!t||"object"!=typeof t)return;Array.isArray(t)?(t.__proto__=r,t.forEach(f.listen)):Object.keys(t).forEach(function(e){f.listen(t[e]),function(t,e,n){Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){return n.getValue()},set:function(t){n.setValue(t)}})}(t,e,l(t[e]))})}static unListen(t,e){}static getListenerWithData(t){return t.__listener__}static create(t){return(d.length?d.pop():new f).init(t)}static collect(t){d.push(t)}static cleanCache(){d.length=0}}var m=f;function p(t){return t.nextSibling}var g={replaceOldWithNew:function(t,e,n){(n||t.parentNode).replaceChild(e,t)},appendChildToParent:function(t,e){e.appendChild(t)},getParentNode:function(t){return t.parentNode},getNextSibling:p,getPreviousSibling:function(t){return t.previousSibling},getTextContent:function(t){return t.textContent},setTextContent:function(t,e){t.textContent=e},getAttributeNames:function(t){return t.getAttributeNames()},getAttribute:function(t,e){return t.getAttribute(e)},setAttribute:function(t,e,n){t.setAttribute(e,n)},getNodeType:function(t){return t.nodeType},getNodeName:function(t){return t.nodeName},removeNode:function(t,e){(e||t.parentNode&&t.parentNode).removeChild(t)},cloneNode:function(t){return t.cloneNode(!0)},getFirstChild:function(t){return t.firstChild},insertNewBeforeOld:function(t,e,n){(n||e.parentNode).insertBefore(t,e)},insertNewAfterOld:function(t,e,n){(n||e.parentNode).insertBefore(t,p(e))},removeAttribute:function(t,e){t.removeAttribute(e)},createTextNode:function(t){return document.createTextNode(t)},setValue:function(t,e){t.value=e},setInnerText:function(t,e){t.innerText=e},setInnerHTML:function(t,e){t.innerHTML=e},addEventListener:function(t,e,n,i){t.addEventListener(e,n,i)},createElement:function(t){return document.createElement(t)},createFragment:function(){return document.createDocumentFragment()},addClass:function(t,e){if(e&&(e=e.trim()))if(t.classList)t.classList.add(e);else{const n=" "+(t.getAttribute("class")||"")+" ";n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}},removeClass:function(t,e){if(e&&(e=e.trim()))if(t.classList)t.classList.remove(e);else{const n=" "+(t.getAttribute("class")||"")+" ";n.indexOf(" "+e+" ")>=0&&t.setAttribute("class",n.replace(" "+e+" ","").trim())}}};function b(t,e,n){if(!t)return;let i;n||(i=g.getNextSibling(t));const o=g.getNodeName(t),r=e.getComponent(o.toLowerCase());if(r)e.initComponent(t,e,r);else switch(g.getNodeType(t)){case 3:!function(t,e,n){let i=0;const o=[];let r;for(;;){const e=t.indexOf("{{",i);if(!(e>-1)){o.push(t.slice(i));break}{o.push(t.slice(i,e));const n=t.indexOf("}}",e+2);n>-1&&(r=!0,o.push(_(t.slice(e+2,n))),i=n+2)}}if(!r)return;u.watch(e,n,function(t,e){g.setTextContent(t,o.map(function(t){return"function"==typeof t?t(e):t}).join(""))})}(g.getTextContent(t),t,e);break;case 1:let n=!0;const i=g.getAttributeNames(t);if(i.indexOf(":for-array")>-1)n=!1,function(t,e){const n=g.getAttribute(t,":for-array"),i=g.getAttribute(t,":for-item"),o=g.getAttribute(t,":for-index");g.removeAttribute(t,":for-array"),g.removeAttribute(t,":for-item"),g.removeAttribute(t,":for-index");const r=_(n),s=g.createTextNode(""),c=g.createTextNode(""),a=g.getParentNode(t);function l(t,n){const r=Object.create(e);return o&&(r[o]=n,m.listen(r)),Object.defineProperty(r,i,{value:t,enumerable:!1,writable:!1,configurable:!0}),r}g.replaceOldWithNew(t,c,a),g.insertNewBeforeOld(s,c,a);let h=[],d=[],f=[],p=[];u.watch(t,e,function(t,e){const n=r(e);let i=0,u=0;const m=n.length,v=h.length;let w=[],_=g.getNextSibling(s);for(;_!==c;)w.push(_),_=g.getNextSibling(_);let x=s;for(;u<m||i<v;){const e=u<m?n[u]:void 0,r=i<v?h[i]:void 0;i<v&&d[i];let s=i<v?w[i]:void 0;if(r===e){f[u]=e;const t=i<v?d[i]:void 0;p[u]=t,o&&(t[o]=u),x=w[i],u++,i++;continue}if(void 0===e){w[i]&&g.removeNode(w[i],a),x=w[++i];continue}const c=h.indexOf(e),_=n.indexOf(r);if(c>=0&&_>=0){const t=w[c];f[u]=e;const n=d[c];p[u]=n,o&&(n[o]=u),w[c]=null,g.insertNewAfterOld(t,x),x=t,u++}else if(-1!=c)-1==_&&(i++,r)&&(x=g.getNextSibling(s),g.removeNode(s));else{const n=g.cloneNode(t);g.insertNewAfterOld(n,x,a),x=g.getNextSibling(n);const i=l(e,u);f[u]=e,p[u]=i,b(n,i,!0),x=g.getPreviousSibling(x),u++}}let y=h;h=f,f=y,y=d,d=p,p=y,f.length=p.length=0})}(t,e);else{let o;(o=i.indexOf(":if"))>-1&&(n=!1,i[o]=null,function(t,e){const n=g.getAttribute(t,":if");g.removeAttribute(t,":if");const i=_(n),o=g.createTextNode("");let r;u.watch(t,e,function(t,e,n){const s=!!i(e);s!==r&&(void 0===r?s?b(g.getFirstChild(t),e):g.replaceOldWithNew(t,o):s?(g.replaceOldWithNew(o,t),b(g.getFirstChild(t),e)):g.replaceOldWithNew(t,o),r=s)})}(t,e)),(o=i.indexOf(":model"))>-1&&(i[o]=null,function(t,e){const n=g.getAttribute(t,":model");g.removeAttribute(t,":model");const i=_(n),o=function(t){let e=x[t];e||(e=x[t]=new Function("__scope__, value","with(__scope__){"+t+"= value}"));return e}(n);g.addEventListener(t,"input",function(){o(e,this.value)}),u.watch(t,e,function(t,e){g.setValue(t,i(e))})}(t,e)),(o=i.indexOf(":text"))>-1&&(i[o]=null,function(t,e){const n=g.getAttribute(t,":text");g.removeAttribute(t,":text");const i=_(n);u.watch(t,e,function(t,e){g.setInnerText(t,i(e))})}(t,e)),(o=i.indexOf(":show"))>-1&&(i[o]=null,function(t,e){const n=g.getAttribute(t,":show");g.removeAttribute(t,":show");const i=_(n);u.watch(t,e,function(t,e){t.style.display=i(e)?"":"none"})}(t,e)),(o=i.indexOf(":html"))>-1&&(i[o]=null,function(t,e){const n=g.getAttribute(t,":html");g.removeAttribute(t,":html");const i=_(n);u.watch(t,e,function(t,e){g.setInnerHTML(t,i(e))})}(t,e)),(o=i.indexOf(":class"))>-1&&(i[o]=null,function(t,e){const n=g.getAttribute(t,":class");g.removeAttribute(t,":class");const i=_(n);u.watch(t,e,function(t,e){const n=i(e);switch(Object.prototype.toString.call(n)){case"[object Object]":Object.keys(n).forEach(function(e){g[n[e]?"addClass":"removeClass"](t,e)})}})}(t,e)),(o=i.indexOf(":style"))>-1&&(i[o]=null,function(t,e){const n=g.getAttribute(t,":style");g.removeAttribute(t,":style");const i=_(n);u.watch(t,e,function(t,e){const n=i(e);switch(Object.prototype.toString.call(n)){case"[object Object]":Object.keys(n).forEach(function(e){const i=n[e];i.indexOf("important")>-1?t.style.setProperty(e,i.replace("!important",""),"important"):t.style.setProperty(e,i)})}})}(t,e)),i.forEach(function(n,o){if(null!==n)return 0==n.indexOf(":on-")?(i[o]=null,void function(t,e,n){const i=g.getAttribute(e,t);g.removeAttribute(e,t);const o=function(t){let e=v[t];e||(e=v[t]=new Function("e, __scope__","with(__scope__) {try{"+t+"}catch(e){console.error(e);}}"));return e}(i);g.addEventListener(e,t.slice(4),function(t){o(t,n)},!1)}(n,t,e)):void(0==n.indexOf(":")&&(i[o]=null,function(t,e,n){const i=g.getAttribute(e,t);g.removeAttribute(e,t);const o=_(i);t=t.slice(1),u.watch(e,n,function(e,n){g.setAttribute(e,t,o(n))})}(n,t,e)))})}n&&b(g.getFirstChild(t),e)}n||b(i,e)}const v={};const w={};function _(t){let e=w[t];return e||(e=w[t]=new Function("__scope__","with(__scope__) {            try{                return "+t+'} catch(e) {                console.error(e);                return ""            }        }')),e}const x={};var y=function(t,e,n,i){const o=g.createElement("div"),r=g.createFragment();g.setInnerHTML(o,t),b(g.getFirstChild(o),e);let s=g.getFirstChild(o);for(;s;)g.appendChildToParent(s,r),s=g.getFirstChild(o);n&&(i?g.replaceOldWithNew(n,r):(g.setInnerHTML(n,""),g.appendChildToParent(r,n)))};let T=0;class O{constructor(){}init(t){return Object.assign(this,t.data()),m.listen(this),this.el=t.el,this._components=t.components||{},this.__id__=++T,Object.assign(this,t.methods),y(t.template||this.el&&this.el.innerHTML||"",this,this.el),this}getComponent(t){return this._components[t.toLowerCase()]||O.getComponent(t.toLowerCase())}isComponent(t){return!(!this._components[t.toLowerCase()]&&!O.getComponent(t.toLowerCase()))}initComponent(...t){return O.initComponent(...t)}static create(t){return(new O).init(t)}static component(){}static getComponent(){}static initComponent(){}static create(t){return(new O).init(t)}}var A=O;const N="not allow to write from child";const C={},L=[];let j=0;class P extends A{constructor(){super()}init(t,e,n){return Object.assign(this,n.data()),m.listen(this),Array.isArray(n.props)&&n.props.forEach(t=>{Object.defineProperty(this,t,{get:function(){return function t(e){return"object"!=typeof e?e:new Proxy(e,{get:function(e,n){return t(e[n])},set:function(t,e,n){return console.error(N,e,n),!0}})}(e[t])},set:function(e){console.error(N,t,e)}})}),this.el=t,this.__id__=++j,this._components=n.components||{},Object.assign(this,n.methods),y(n.template||this.el&&this.el.innerHTML||"",this,this.el,!0),this}remove(){}static create(t,e,n){return(L.length?L.pop():new P).init(t,e,n)}static collect(t){L.push(t)}static cleanCache(){L.length=0}}A.component=function(t,e){C[t.toLowerCase()]=e},A.getComponent=function(t){return C[t.toLowerCase()]},A.initComponent=function(t,e,n){return P.create(t,e,n)};const E=[function(){return Math.random()-.5},function(t,e){return t.id-e.id},function(t,e){return e.id-t.id}];A.component("go-fire",{data:()=>({count:0}),props:["todos","newTodoText","addTime"],template:'<button :on-click="add()">You clicked me {{count}} times.</button>        start: {{addTime.start}} newTodoText: {{newTodoText}} todos.length {{todos.length}}        <br />',methods:{add(){this.count+=1,this.todos[0].id=Math.random()}}});window.vm=A.create({el:document.querySelector("#todo-list-example"),data:()=>({newTodoText:"",todos:[{id:1,title:"Feed the cat",children:[{name:1}]},{id:2,title:"Eat the cat",children:[{name:2}]}],nextTodoId:3,timeStart:"",timeEnd:"",timeCost:"",addTime:{start:"",end:"",cost:""},removeTime:{start:"",end:"",cost:""}}),methods:{removeTo0(){this.removeTime.start=Date.now(),this.removeTime.end="",this.remove()},remove(){if(0==this.todos.length)return this.removeTime.end=Date.now(),void(this.removeTime.cost=this.removeTime.end-this.removeTime.start);const t=Math.random()*this.todos.length|0;this.todos.splice(t,1),requestAnimationFrame(()=>{this.remove()})},addTo1000(){this.addTime.start=Date.now(),this.addTime.end="",this.add()},add(){if(1e3==this.todos.length)return this.addTime.end=Date.now(),void(this.addTime.cost=this.addTime.end-this.addTime.start);this.addNewTodo(),requestAnimationFrame(()=>{this.add()})},addNewTodo(){this.todos.splice(Math.random()*this.todos.length|0,0,{id:this.nextTodoId++,title:Math.random().toString().slice(2,10*Math.random()|0),children:[{name:Math.random().toString().slice(2,6)}]})},sort(t){this.todos.sort(E[0|t])}}})}]);