From 8cdc1d7c3acf277818e5fa0674703b64a0daeafb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=A3=8A?= Date: Mon, 25 Apr 2016 17:30:00 +0800 Subject: [PATCH] use 0.1.3 --- dist/nuclear.js | 6 ++++-- dist/nuclear.min.js | 2 +- src/nuclear.js | 6 ++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/dist/nuclear.js b/dist/nuclear.js index 64ac3ed72..ef64ca26d 100644 --- a/dist/nuclear.js +++ b/dist/nuclear.js @@ -36,8 +36,10 @@ Nuclear._mixObj = function (obj) { this.option = option; if (!this._nuclearParentEmpty) { this.parent = typeof selector === "string" ? document.querySelector(selector) : selector; - while (this.parent.firstChild) { - this.parent.removeChild(this.parent.firstChild); + if(document.body!==this.parent) { + while (this.parent.firstChild) { + this.parent.removeChild(this.parent.firstChild); + } } } else { this.parent = document.createElement("div"); diff --git a/dist/nuclear.min.js b/dist/nuclear.min.js index d7179f350..89cc4f535 100644 --- a/dist/nuclear.min.js +++ b/dist/nuclear.min.js @@ -3,4 +3,4 @@ * Github: https://github.com/AlloyTeam/Nuclear * MIT Licensed. */ -!function(e,t){"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?module.exports=t():"function"==typeof define&&define.cmd&&define(function(e,n,r){r.exports=t()}),e.Nuclear=t()}(window,function(){var e={};return e.create=function(t){e._mixObj(t);var n=this===e?e.Class:this,r=n.extend(t);return r.create=e.create,r},e._mixObj=function(t){t.ctor=function(t,n){if(this._ncInstanceId=e.getInstanceId(),window.Nuclear.instances[this._ncInstanceId]=this,this._nuclearParentEmpty=!n,this.HTML="",this.option=t,this._nuclearParentEmpty)this.parent=document.createElement("div");else for(this.parent="string"==typeof n?document.querySelector(n):n;this.parent.firstChild;)this.parent.removeChild(this.parent.firstChild);this.install&&this.install(),this._nuclearRef=[];for(var r in this)this.hasOwnProperty(r)&&this[r]&&this[r]._nuclearLocalRefresh&&(this[r]._nuclearParent=this,this._nuclearRef.push(this[r]));this._nuclearTimer=null,this._preNuclearTime=new Date,this.option&&e.observe(this.option,function(e,t,n,r){(!this.onOptionChange||this.onOptionChange&&this.onOptionChange(e,t,n,r)!==!1)&&(clearTimeout(this._nuclearTimer),new Date-this._preNuclearTime>40?(this._nuclearLocalRefresh(),this._preNuclearTime=new Date):this._nuclearTimer=setTimeout(function(){this._nuclearLocalRefresh()}.bind(this),40))}.bind(this)),this._nuclearRenderInfo={tpl:this._nuclearTplGenerator(),data:this.option,parent:this.parent},this.option._nuclearIndex=function(){return++window._nuclearIndex||(window._nuclearIndex=0)},this.option._resetNuclearIndex=function(){window._nuclearIndex=-1},this._nuclearRender(this._nuclearRenderInfo),this.installed&&this.installed()},t.refresh=function(){this._nuclearLocalRefresh()},t.render&&(t._nuclearTplGenerator=t.render),t.render=function(){return this._nuclearParentEmpty?this.HTML:this._nuclearTplGenerator()},t._nuclearRender=function(t){if(this.node)if(e.isUndefined(t.tpl))t.parent.removeChild(this.node),this.node=null,this.HTML="";else{var n=e.str2Dom(this._nuclearWrap(e.Tpl.render(e._fixEvent(e._fixTplIndex(t.tpl),this._ncInstanceId),t.data)));t.parent.replaceChild(n,this.node),this.node=n}else e.isUndefined(t.tpl)||(t.parent.insertAdjacentHTML("beforeEnd",this._nuclearWrap(e.Tpl.render(e._fixEvent(e._fixTplIndex(t.tpl),this._ncInstanceId),t.data))),this.node=t.parent.lastChild);window._nuclearIndex=null,this.node&&(this._nuclearId=e.getId(),this.node.setAttribute("data-nuclearId",this._nuclearId),this._mixNode(),t.refreshPart=this.node.querySelectorAll("*[nc-refresh]"),this.HTML=this.node.outerHTML,this._nuclearFix(),this.onRefresh&&this.onRefresh())},t._mixNode=function(){var e=this.node.querySelectorAll("*[nc-id]"),t=e.length;if(t>0)for(var n=0;t>n;n++){var r=e[n];this[r.getAttribute("nc-id")]=r}var o=this.node.querySelectorAll("*[nc-class]"),i=o.length;if(i>0)for(var s=0;i>s;s++){var a=o[s],c=a.getAttribute("nc-class");this[c]||(this[c]=[]),this[c].push(a)}},t._nuclearFix=function(){this._nuclearParent||this._nuclearFixOne(this)},t._nuclearFixOne=function(e){var t=e._nuclearRef.length;if(t>0)for(var n=0;t>n;n++){var r=e._nuclearRef[n];r.node=e.node.querySelector('*[data-nuclearId="'+r._nuclearId+'"]'),r.node&&(r._mixNode(),r._nuclearRenderInfo.refreshPart=r.node.querySelectorAll("*[nc-refresh]"),r._nuclearRenderInfo.parent=r.node.parentNode,this._nuclearFixOne(r),r.onRefresh&&r.onRefresh(),r.installed&&r.installed())}},t._nuclearWrap=function(e){var t="";return this.style&&(t=""),"
"+e+t+"
"},t._nuclearLocalRefresh=function(){var t=this._nuclearRenderInfo,n=t.refreshPart.length;if(t.tpl=this._nuclearTplGenerator(),n>0){var r=e.str2Dom(this._nuclearWrap(e.Tpl.render(e._fixEvent(e._fixTplIndex(t.tpl),this._ncInstanceId),t.data))).querySelectorAll("*[nc-refresh]");window._nuclearIndex=null;for(var o=0;n>o;o++){var i=t.refreshPart[o];i.parentNode&&i.parentNode.replaceChild(r[o],i)}t.refreshPart=r,this._mixNode(),this.HTML=this.node.outerHTML,this._nuclearFix(),this.onRefresh&&this.onRefresh()}else this._nuclearRender(t);e.refreshStyle()}},e._fixEvent=function(e,t){return e.replace(/<[\s\S]*?>/g,function(e){return e.replace(/(onabort|onblur|oncancel|oncanplay|oncanplaythrough|onchange|onclick|onclose|oncontextmenu|oncuechange|ondblclick|ondrag|ondragend|ondragenter|ondragleave|ondragover|ondragstart|ondrop|ondurationchange|onemptied|onended|onerror|onfocus|oninput|oninvalid|onkeydown|onkeypress|onkeyup|onload|onloadeddata|onloadedmetadata|onloadstart|onmousedown|onmouseenter|onmouseleave|onmousemove|onmouseout|onmouseover|onmouseup|onmousewheel|onpause|onplay|onplaying|onprogress|onratechange|onreset|onresize|onscroll|onseeked|onseeking|onselect|onshow|onstalled|onsubmit|onsuspend|ontimeupdate|ontoggle|onvolumechange|onwaiting|onautocomplete|onautocompleteerror|onbeforecopy|onbeforecut|onbeforepaste|oncopy|oncut|onpaste|onsearch|onselectstart|onwheel|onwebkitfullscreenchange|onwebkitfullscreenerror)=('|")/g,function(e,n,r,o,i){return"Nuclear.instances["===i.substr(e.length+o,18)?e:e+="Nuclear.instances["+t+"]."})})},e._fixTplIndex=function(e){return e.replace(/{{#[\s\S]*?{{@index}}/g,function(e){return"{{_resetNuclearIndex}}"+e.replace("{{@index}}","{{_nuclearIndex}}")})},e.str2Dom=function(e){var t={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],body:[0,"",""],_default:[1,"
","
"]};t.optgroup=t.option,t.tbody=t.tfoot=t.colgroup=t.caption=t.thead,t.th=t.td;var n=/<\s*\w.*?>/g.exec(e),r=document.createElement("div");if(null!=n){var o=n[0].replace(//g,"").split(" ")[0];if("body"===o.toLowerCase()){var i=document.createElement("body");r.innerHTML=e.replace(//g,"");var s=r.firstChild.attributes;i.innerHTML=e;for(var a=0;a"'\/]/g,function(e){return y[e]})}function s(t,r){function i(){if(x&&!P)for(;y.length;)delete v[y.pop()];else y=[];x=!1,P=!1}function s(e){if("string"==typeof e&&(e=e.split(b,2)),!d(e)||2!==e.length)throw new Error("Invalid tags: "+e);u=new RegExp(n(e[0])+"\\s*"),h=new RegExp("\\s*"+n(e[1])),p=new RegExp("\\s*"+n("}"+e[1]))}if(!t)return[];var u,h,p,f=[],v=[],y=[],x=!1,P=!1;s(r||e.tags);for(var I,T,C,$,E,R,A=new l(t);!A.eos();){if(I=A.pos,C=A.scanUntil(u))for(var k=0,S=C.length;S>k;++k)$=C.charAt(k),o($)?y.push(v.length):P=!0,v.push(["text",$,I,I+1]),I+=1,"\n"===$&&i();if(!A.scan(u))break;if(x=!0,T=A.scan(w)||"name",A.scan(g),"="===T?(C=A.scanUntil(m),A.scan(m),A.scanUntil(h)):"{"===T?(C=A.scanUntil(p),A.scan(_),A.scanUntil(h),T="&"):C=A.scanUntil(h),!A.scan(h))throw new Error("Unclosed tag at "+A.pos);if(E=[T,C,I,A.pos],v.push(E),"#"===T||"^"===T)f.push(E);else if("/"===T){if(R=f.pop(),!R)throw new Error('Unopened section "'+C+'" at '+I);if(R[1]!==C)throw new Error('Unclosed section "'+R[1]+'" at '+I)}else"name"===T||"{"===T||"&"===T?P=!0:"="===T&&s(C)}if(R=f.pop())throw new Error('Unclosed section "'+R[1]+'" at '+A.pos);return c(a(v))}function a(e){for(var t,n,r=[],o=0,i=e.length;i>o;++o)t=e[o],t&&("text"===t[0]&&n&&"text"===n[0]?(n[1]+=t[1],n[3]=t[3]):(r.push(t),n=t));return r}function c(e){for(var t,n,r=[],o=r,i=[],s=0,a=e.length;a>s;++s)switch(t=e[s],t[0]){case"#":case"^":o.push(t),i.push(t),o=t[4]=[];break;case"/":n=i.pop(),n[5]=t[2],o=i.length>0?i[i.length-1][4]:r;break;default:o.push(t)}return r}function l(e){this.string=e,this.tail=e,this.pos=0}function u(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function h(){this.cache={}}var p=Object.prototype.toString,d=Array.isArray||function(e){return"[object Array]"===p.call(e)},f=RegExp.prototype.test,v=/\S/,y={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},g=/\s*/,b=/\s+/,m=/\s*=/,_=/\s*\}/,w=/#|\^|\/|>|\{|&|=|!/;l.prototype.eos=function(){return""===this.tail},l.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var n=t[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n},l.prototype.scanUntil=function(e){var t,n=this.tail.search(e);switch(n){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,n),this.tail=this.tail.substring(n)}return this.pos+=t.length,t},u.prototype.push=function(e){return new u(e,this)},u.prototype.lookup=function(e){var n,r=this.cache;if(e in r)n=r[e];else{for(var o,i,s=this,a=!1;s;){if(e.indexOf(".")>0)for(n=s.view,o=e.split("."),i=0;null!=n&&ic;++c)s=void 0,o=e[c],i=o[0],"#"===i?s=this.renderSection(o,t,n,r):"^"===i?s=this.renderInverted(o,t,n,r):">"===i?s=this.renderPartial(o,t,n,r):"&"===i?s=this.unescapedValue(o,t):"name"===i?s=this.escapedValue(o,t):"text"===i&&(s=this.rawValue(o)),void 0!==s&&(a+=s);return a},h.prototype.renderSection=function(e,n,r,o){function i(e){return s.render(e,n,r)}var s=this,a="",c=n.lookup(e[1]);if(c){if(d(c))for(var l=0,u=c.length;u>l;++l)a+=this.renderTokens(e[4],n.push(c[l]),r,o);else if("object"==typeof c||"string"==typeof c||"number"==typeof c)a+=this.renderTokens(e[4],n.push(c),r,o);else if(t(c)){if("string"!=typeof o)throw new Error("Cannot use higher-order sections without the original template");c=c.call(n.view,o.slice(e[3],e[5]),i),null!=c&&(a+=c)}else a+=this.renderTokens(e[4],n,r,o);return a}},h.prototype.renderInverted=function(e,t,n,r){var o=t.lookup(e[1]);return!o||d(o)&&0===o.length?this.renderTokens(e[4],t,n,r):void 0},h.prototype.renderPartial=function(e,n,r){if(r){var o=t(r)?r(e[1]):r[e[1]];return null!=o?this.renderTokens(this.parse(o),n,r,o):void 0}},h.prototype.unescapedValue=function(e,t){var n=t.lookup(e[1]);return null!=n?n:void 0},h.prototype.escapedValue=function(t,n){var r=n.lookup(t[1]);return null!=r?e.escape(r):void 0},h.prototype.rawValue=function(e){return e[1]},e.name="mustache.js",e.version="2.0.0",e.tags=["{{","}}"];var x=new h;e.clearCache=function(){return x.clearCache()},e.parse=function(e,t){return x.parse(e,t)},e.render=function(e,t,n){return x.render(e,t,n)},e.to_html=function(n,r,o,i){var s=e.render(n,r,o);return t(i)?void i(s):s},e.escape=i,e.Scanner=l,e.Context=u,e.Writer=h}),function(){var t=function(e,n,r){var o=function(e,n,r){e.$observer||(e.$observer=this);var o=e.$observer,i=[];t.isArray(e)&&(0===e.length&&(e.$observeProps={},e.$observeProps.$observerPath="#"),o.mock(e));for(var s in e)e.hasOwnProperty(s)&&(r?t.isArray(n)&&t.isInArray(n,s)?(i.push(s),o.watch(e,s)):t.isString(n)&&s==n&&(i.push(s),o.watch(e,s)):(i.push(s),o.watch(e,s)));o.target=e,o.propertyChangedHandler||(o.propertyChangedHandler=[]);var a=r?r:n;o.propertyChangedHandler.push({all:!r,propChanged:a,eventPropArr:i})};return o.prototype={onPropertyChanged:function(e,n,r,o,i){if(n!==r&&this.propertyChangedHandler)for(var s=t._getRootName(e,i),a=0,c=this.propertyChangedHandler.length;c>a;a++){var l=this.propertyChangedHandler[a];(l.all||t.isInArray(l.eventPropArr,s)||0===s.indexOf("Array-"))&&l.propChanged.call(this.target,e,n,r,i)}0!==e.indexOf("Array-")&&"object"==typeof n&&this.watch(o,e,o.$observeProps.$observerPath)},mock:function(e){var n=this;t.methods.forEach(function(r){e[r]=function(){var e=Array.prototype.slice.call(this,0),o=Array.prototype[r].apply(this,Array.prototype.slice.call(arguments));if(new RegExp("\\b"+r+"\\b").test(t.triggerStr)){for(var i in this)this.hasOwnProperty(i)&&!t.isFunction(this[i])&&n.watch(this,i,this.$observeProps.$observerPath);n.onPropertyChanged("Array-"+r,this,e,this,this.$observeProps.$observerPath)}return o}})},watch:function(e,n,r){if("$observeProps"!==n&&"$observer"!==n&&!t.isFunction(e[n])){e.$observeProps||(e.$observeProps={}),void 0!==r?e.$observeProps.$observerPath=r:e.$observeProps.$observerPath="#";var o=this,i=e.$observeProps[n]=e[n];if(Object.defineProperty(e,n,{get:function(){return this.$observeProps[n]},set:function(t){var r=this.$observeProps[n];this.$observeProps[n]=t,o.onPropertyChanged(n,t,r,this,e.$observeProps.$observerPath)}}),"object"==typeof i){t.isArray(i)&&(this.mock(i),0===i.length&&(i.$observeProps||(i.$observeProps={}),void 0!==r?i.$observeProps.$observerPath=r:i.$observeProps.$observerPath="#"));for(var s in i)i.hasOwnProperty(s)&&this.watch(i,s,e.$observeProps.$observerPath+"-"+n)}}}},new o(e,n,r)};t.methods=["concat","every","filter","forEach","indexOf","join","lastIndexOf","map","pop","push","reduce","reduceRight","reverse","shift","slice","some","sort","splice","unshift","toLocaleString","toString","size"],t.triggerStr=["concat","pop","push","reverse","shift","sort","splice","unshift","size"].join(","),t.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},t.isString=function(e){return"string"==typeof e},t.isInArray=function(e,t){for(var n=e.length;--n>-1;)if(t===e[n])return!0;return!1},t.isFunction=function(e){return"[object Function]"==Object.prototype.toString.call(e)},t.twoWay=function(e,n,r,o){"object"==typeof e[n]&&"object"==typeof r[o]?(t(e,n,function(e,t){r[o]=this[n]}),t(r,o,function(t,r){e[n]=this[o]})):(t(e,n,function(e,t){r[o]=t}),t(r,o,function(t,r){e[n]=r}))},t._getRootName=function(e,t){return"#"===t?e:t.split("-")[1]},t.add=function(e,t,n){e[t]=n;var r=e.$observer;r.watch(e,t)},Array.prototype.size=function(e){this.length=e},e.observe=t}(),e.Class=function(){},e.Class.extend=function(t){function n(){this.ctor.apply(this,arguments)}var r=Object.create(this.prototype);for(var o in t)r[o]=t[o];return n.prototype=r,n.prototype._super=Object.create(this.prototype),n.prototype.constructor=n,n.extend=e.Class.extend,n},function(){function t(){var e=document.createElement("style");e.appendChild(document.createTextNode("")),document.head.appendChild(e),e.sheet.insertRule("body { visibility: hidden; }",0)}function n(e,t){var n=new RegExp("([^\r\n,{}]+)(,(?=[^}]*{)|s*{)","g");return e=e.replace(n,function(e,n,r){return n.match(/^\s*(@media|@keyframes|to|from|@font-face)/)?n+r:(n.match(/:scope/)&&(n=n.replace(/([^\s]*):scope/,function(e,t){return""===t?"> *":"> "+t})),n=n.replace(/^(\s*)/,"$1"+t+" "),n+r)})}function r(){var e=document.body.querySelectorAll("style[scoped]");if(0===e.length)return void(document.getElementsByTagName("body")[0].style.visibility="visible");var t=document.head||document.getElementsByTagName("head")[0];o&&t.removeChild(o),o=document.createElement("style");for(var r="",i=0;i40?(this._nuclearLocalRefresh(),this._preNuclearTime=new Date):this._nuclearTimer=setTimeout(function(){this._nuclearLocalRefresh()}.bind(this),40))}.bind(this)),this._nuclearRenderInfo={tpl:this._nuclearTplGenerator(),data:this.option,parent:this.parent},this.option._nuclearIndex=function(){return++window._nuclearIndex||(window._nuclearIndex=0)},this.option._resetNuclearIndex=function(){window._nuclearIndex=-1},this._nuclearRender(this._nuclearRenderInfo),this.installed&&this.installed()},t.refresh=function(){this._nuclearLocalRefresh()},t.render&&(t._nuclearTplGenerator=t.render),t.render=function(){return this._nuclearParentEmpty?this.HTML:this._nuclearTplGenerator()},t._nuclearRender=function(t){if(this.node)if(e.isUndefined(t.tpl))t.parent.removeChild(this.node),this.node=null,this.HTML="";else{var n=e.str2Dom(this._nuclearWrap(e.Tpl.render(e._fixEvent(e._fixTplIndex(t.tpl),this._ncInstanceId),t.data)));t.parent.replaceChild(n,this.node),this.node=n}else e.isUndefined(t.tpl)||(t.parent.insertAdjacentHTML("beforeEnd",this._nuclearWrap(e.Tpl.render(e._fixEvent(e._fixTplIndex(t.tpl),this._ncInstanceId),t.data))),this.node=t.parent.lastChild);window._nuclearIndex=null,this.node&&(this._nuclearId=e.getId(),this.node.setAttribute("data-nuclearId",this._nuclearId),this._mixNode(),t.refreshPart=this.node.querySelectorAll("*[nc-refresh]"),this.HTML=this.node.outerHTML,this._nuclearFix(),this.onRefresh&&this.onRefresh())},t._mixNode=function(){var e=this.node.querySelectorAll("*[nc-id]"),t=e.length;if(t>0)for(var n=0;t>n;n++){var r=e[n];this[r.getAttribute("nc-id")]=r}var o=this.node.querySelectorAll("*[nc-class]"),i=o.length;if(i>0)for(var s=0;i>s;s++){var a=o[s],c=a.getAttribute("nc-class");this[c]||(this[c]=[]),this[c].push(a)}},t._nuclearFix=function(){this._nuclearParent||this._nuclearFixOne(this)},t._nuclearFixOne=function(e){var t=e._nuclearRef.length;if(t>0)for(var n=0;t>n;n++){var r=e._nuclearRef[n];r.node=e.node.querySelector('*[data-nuclearId="'+r._nuclearId+'"]'),r.node&&(r._mixNode(),r._nuclearRenderInfo.refreshPart=r.node.querySelectorAll("*[nc-refresh]"),r._nuclearRenderInfo.parent=r.node.parentNode,this._nuclearFixOne(r),r.onRefresh&&r.onRefresh(),r.installed&&r.installed())}},t._nuclearWrap=function(e){var t="";return this.style&&(t=""),"
"+e+t+"
"},t._nuclearLocalRefresh=function(){var t=this._nuclearRenderInfo,n=t.refreshPart.length;if(t.tpl=this._nuclearTplGenerator(),n>0){var r=e.str2Dom(this._nuclearWrap(e.Tpl.render(e._fixEvent(e._fixTplIndex(t.tpl),this._ncInstanceId),t.data))).querySelectorAll("*[nc-refresh]");window._nuclearIndex=null;for(var o=0;n>o;o++){var i=t.refreshPart[o];i.parentNode&&i.parentNode.replaceChild(r[o],i)}t.refreshPart=r,this._mixNode(),this.HTML=this.node.outerHTML,this._nuclearFix(),this.onRefresh&&this.onRefresh()}else this._nuclearRender(t);e.refreshStyle()}},e._fixEvent=function(e,t){return e.replace(/<[\s\S]*?>/g,function(e){return e.replace(/(onabort|onblur|oncancel|oncanplay|oncanplaythrough|onchange|onclick|onclose|oncontextmenu|oncuechange|ondblclick|ondrag|ondragend|ondragenter|ondragleave|ondragover|ondragstart|ondrop|ondurationchange|onemptied|onended|onerror|onfocus|oninput|oninvalid|onkeydown|onkeypress|onkeyup|onload|onloadeddata|onloadedmetadata|onloadstart|onmousedown|onmouseenter|onmouseleave|onmousemove|onmouseout|onmouseover|onmouseup|onmousewheel|onpause|onplay|onplaying|onprogress|onratechange|onreset|onresize|onscroll|onseeked|onseeking|onselect|onshow|onstalled|onsubmit|onsuspend|ontimeupdate|ontoggle|onvolumechange|onwaiting|onautocomplete|onautocompleteerror|onbeforecopy|onbeforecut|onbeforepaste|oncopy|oncut|onpaste|onsearch|onselectstart|onwheel|onwebkitfullscreenchange|onwebkitfullscreenerror)=('|")/g,function(e,n,r,o,i){return"Nuclear.instances["===i.substr(e.length+o,18)?e:e+="Nuclear.instances["+t+"]."})})},e._fixTplIndex=function(e){return e.replace(/{{#[\s\S]*?{{@index}}/g,function(e){return"{{_resetNuclearIndex}}"+e.replace("{{@index}}","{{_nuclearIndex}}")})},e.str2Dom=function(e){var t={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],body:[0,"",""],_default:[1,"
","
"]};t.optgroup=t.option,t.tbody=t.tfoot=t.colgroup=t.caption=t.thead,t.th=t.td;var n=/<\s*\w.*?>/g.exec(e),r=document.createElement("div");if(null!=n){var o=n[0].replace(//g,"").split(" ")[0];if("body"===o.toLowerCase()){var i=document.createElement("body");r.innerHTML=e.replace(//g,"");var s=r.firstChild.attributes;i.innerHTML=e;for(var a=0;a"'\/]/g,function(e){return y[e]})}function s(t,r){function i(){if(x&&!P)for(;y.length;)delete v[y.pop()];else y=[];x=!1,P=!1}function s(e){if("string"==typeof e&&(e=e.split(b,2)),!d(e)||2!==e.length)throw new Error("Invalid tags: "+e);u=new RegExp(n(e[0])+"\\s*"),h=new RegExp("\\s*"+n(e[1])),p=new RegExp("\\s*"+n("}"+e[1]))}if(!t)return[];var u,h,p,f=[],v=[],y=[],x=!1,P=!1;s(r||e.tags);for(var I,T,C,$,E,R,A=new l(t);!A.eos();){if(I=A.pos,C=A.scanUntil(u))for(var k=0,S=C.length;S>k;++k)$=C.charAt(k),o($)?y.push(v.length):P=!0,v.push(["text",$,I,I+1]),I+=1,"\n"===$&&i();if(!A.scan(u))break;if(x=!0,T=A.scan(w)||"name",A.scan(g),"="===T?(C=A.scanUntil(m),A.scan(m),A.scanUntil(h)):"{"===T?(C=A.scanUntil(p),A.scan(_),A.scanUntil(h),T="&"):C=A.scanUntil(h),!A.scan(h))throw new Error("Unclosed tag at "+A.pos);if(E=[T,C,I,A.pos],v.push(E),"#"===T||"^"===T)f.push(E);else if("/"===T){if(R=f.pop(),!R)throw new Error('Unopened section "'+C+'" at '+I);if(R[1]!==C)throw new Error('Unclosed section "'+R[1]+'" at '+I)}else"name"===T||"{"===T||"&"===T?P=!0:"="===T&&s(C)}if(R=f.pop())throw new Error('Unclosed section "'+R[1]+'" at '+A.pos);return c(a(v))}function a(e){for(var t,n,r=[],o=0,i=e.length;i>o;++o)t=e[o],t&&("text"===t[0]&&n&&"text"===n[0]?(n[1]+=t[1],n[3]=t[3]):(r.push(t),n=t));return r}function c(e){for(var t,n,r=[],o=r,i=[],s=0,a=e.length;a>s;++s)switch(t=e[s],t[0]){case"#":case"^":o.push(t),i.push(t),o=t[4]=[];break;case"/":n=i.pop(),n[5]=t[2],o=i.length>0?i[i.length-1][4]:r;break;default:o.push(t)}return r}function l(e){this.string=e,this.tail=e,this.pos=0}function u(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function h(){this.cache={}}var p=Object.prototype.toString,d=Array.isArray||function(e){return"[object Array]"===p.call(e)},f=RegExp.prototype.test,v=/\S/,y={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},g=/\s*/,b=/\s+/,m=/\s*=/,_=/\s*\}/,w=/#|\^|\/|>|\{|&|=|!/;l.prototype.eos=function(){return""===this.tail},l.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var n=t[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n},l.prototype.scanUntil=function(e){var t,n=this.tail.search(e);switch(n){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,n),this.tail=this.tail.substring(n)}return this.pos+=t.length,t},u.prototype.push=function(e){return new u(e,this)},u.prototype.lookup=function(e){var n,r=this.cache;if(e in r)n=r[e];else{for(var o,i,s=this,a=!1;s;){if(e.indexOf(".")>0)for(n=s.view,o=e.split("."),i=0;null!=n&&ic;++c)s=void 0,o=e[c],i=o[0],"#"===i?s=this.renderSection(o,t,n,r):"^"===i?s=this.renderInverted(o,t,n,r):">"===i?s=this.renderPartial(o,t,n,r):"&"===i?s=this.unescapedValue(o,t):"name"===i?s=this.escapedValue(o,t):"text"===i&&(s=this.rawValue(o)),void 0!==s&&(a+=s);return a},h.prototype.renderSection=function(e,n,r,o){function i(e){return s.render(e,n,r)}var s=this,a="",c=n.lookup(e[1]);if(c){if(d(c))for(var l=0,u=c.length;u>l;++l)a+=this.renderTokens(e[4],n.push(c[l]),r,o);else if("object"==typeof c||"string"==typeof c||"number"==typeof c)a+=this.renderTokens(e[4],n.push(c),r,o);else if(t(c)){if("string"!=typeof o)throw new Error("Cannot use higher-order sections without the original template");c=c.call(n.view,o.slice(e[3],e[5]),i),null!=c&&(a+=c)}else a+=this.renderTokens(e[4],n,r,o);return a}},h.prototype.renderInverted=function(e,t,n,r){var o=t.lookup(e[1]);return!o||d(o)&&0===o.length?this.renderTokens(e[4],t,n,r):void 0},h.prototype.renderPartial=function(e,n,r){if(r){var o=t(r)?r(e[1]):r[e[1]];return null!=o?this.renderTokens(this.parse(o),n,r,o):void 0}},h.prototype.unescapedValue=function(e,t){var n=t.lookup(e[1]);return null!=n?n:void 0},h.prototype.escapedValue=function(t,n){var r=n.lookup(t[1]);return null!=r?e.escape(r):void 0},h.prototype.rawValue=function(e){return e[1]},e.name="mustache.js",e.version="2.0.0",e.tags=["{{","}}"];var x=new h;e.clearCache=function(){return x.clearCache()},e.parse=function(e,t){return x.parse(e,t)},e.render=function(e,t,n){return x.render(e,t,n)},e.to_html=function(n,r,o,i){var s=e.render(n,r,o);return t(i)?void i(s):s},e.escape=i,e.Scanner=l,e.Context=u,e.Writer=h}),function(){var t=function(e,n,r){var o=function(e,n,r){e.$observer||(e.$observer=this);var o=e.$observer,i=[];t.isArray(e)&&(0===e.length&&(e.$observeProps={},e.$observeProps.$observerPath="#"),o.mock(e));for(var s in e)e.hasOwnProperty(s)&&(r?t.isArray(n)&&t.isInArray(n,s)?(i.push(s),o.watch(e,s)):t.isString(n)&&s==n&&(i.push(s),o.watch(e,s)):(i.push(s),o.watch(e,s)));o.target=e,o.propertyChangedHandler||(o.propertyChangedHandler=[]);var a=r?r:n;o.propertyChangedHandler.push({all:!r,propChanged:a,eventPropArr:i})};return o.prototype={onPropertyChanged:function(e,n,r,o,i){if(n!==r&&this.propertyChangedHandler)for(var s=t._getRootName(e,i),a=0,c=this.propertyChangedHandler.length;c>a;a++){var l=this.propertyChangedHandler[a];(l.all||t.isInArray(l.eventPropArr,s)||0===s.indexOf("Array-"))&&l.propChanged.call(this.target,e,n,r,i)}0!==e.indexOf("Array-")&&"object"==typeof n&&this.watch(o,e,o.$observeProps.$observerPath)},mock:function(e){var n=this;t.methods.forEach(function(r){e[r]=function(){var e=Array.prototype.slice.call(this,0),o=Array.prototype[r].apply(this,Array.prototype.slice.call(arguments));if(new RegExp("\\b"+r+"\\b").test(t.triggerStr)){for(var i in this)this.hasOwnProperty(i)&&!t.isFunction(this[i])&&n.watch(this,i,this.$observeProps.$observerPath);n.onPropertyChanged("Array-"+r,this,e,this,this.$observeProps.$observerPath)}return o}})},watch:function(e,n,r){if("$observeProps"!==n&&"$observer"!==n&&!t.isFunction(e[n])){e.$observeProps||(e.$observeProps={}),void 0!==r?e.$observeProps.$observerPath=r:e.$observeProps.$observerPath="#";var o=this,i=e.$observeProps[n]=e[n];if(Object.defineProperty(e,n,{get:function(){return this.$observeProps[n]},set:function(t){var r=this.$observeProps[n];this.$observeProps[n]=t,o.onPropertyChanged(n,t,r,this,e.$observeProps.$observerPath)}}),"object"==typeof i){t.isArray(i)&&(this.mock(i),0===i.length&&(i.$observeProps||(i.$observeProps={}),void 0!==r?i.$observeProps.$observerPath=r:i.$observeProps.$observerPath="#"));for(var s in i)i.hasOwnProperty(s)&&this.watch(i,s,e.$observeProps.$observerPath+"-"+n)}}}},new o(e,n,r)};t.methods=["concat","every","filter","forEach","indexOf","join","lastIndexOf","map","pop","push","reduce","reduceRight","reverse","shift","slice","some","sort","splice","unshift","toLocaleString","toString","size"],t.triggerStr=["concat","pop","push","reverse","shift","sort","splice","unshift","size"].join(","),t.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},t.isString=function(e){return"string"==typeof e},t.isInArray=function(e,t){for(var n=e.length;--n>-1;)if(t===e[n])return!0;return!1},t.isFunction=function(e){return"[object Function]"==Object.prototype.toString.call(e)},t.twoWay=function(e,n,r,o){"object"==typeof e[n]&&"object"==typeof r[o]?(t(e,n,function(e,t){r[o]=this[n]}),t(r,o,function(t,r){e[n]=this[o]})):(t(e,n,function(e,t){r[o]=t}),t(r,o,function(t,r){e[n]=r}))},t._getRootName=function(e,t){return"#"===t?e:t.split("-")[1]},t.add=function(e,t,n){e[t]=n;var r=e.$observer;r.watch(e,t)},Array.prototype.size=function(e){this.length=e},e.observe=t}(),e.Class=function(){},e.Class.extend=function(t){function n(){this.ctor.apply(this,arguments)}var r=Object.create(this.prototype);for(var o in t)r[o]=t[o];return n.prototype=r,n.prototype._super=Object.create(this.prototype),n.prototype.constructor=n,n.extend=e.Class.extend,n},function(){function t(){var e=document.createElement("style");e.appendChild(document.createTextNode("")),document.head.appendChild(e),e.sheet.insertRule("body { visibility: hidden; }",0)}function n(e,t){var n=new RegExp("([^\r\n,{}]+)(,(?=[^}]*{)|s*{)","g");return e=e.replace(n,function(e,n,r){return n.match(/^\s*(@media|@keyframes|to|from|@font-face)/)?n+r:(n.match(/:scope/)&&(n=n.replace(/([^\s]*):scope/,function(e,t){return""===t?"> *":"> "+t})),n=n.replace(/^(\s*)/,"$1"+t+" "),n+r)})}function r(){var e=document.body.querySelectorAll("style[scoped]");if(0===e.length)return void(document.getElementsByTagName("body")[0].style.visibility="visible");var t=document.head||document.getElementsByTagName("head")[0];o&&t.removeChild(o),o=document.createElement("style");for(var r="",i=0;i