UNPKG

neft

Version:

Universal Platform

2 lines 341 kB
var Neft = (function(){var process="undefined"!=typeof global&&global.process||{env:{}};process.env.NEFT_PLATFORM="node",process.env.NEFT_SERVER="1",process.env.NEFT_NODE="1";var __modules=[function(exports){var module={exports:exports},require=__createRequire({"src/app":4,"src/utils":151,"src/signal":143,"src/dict":12,"src/list":53,"src/log":55,"src/resources":131,"src/renderer":97,"src/networking":61,"src/schema":133,"src/document":39,"src/assert":6,"src/db":11,"src/styles":146,"src/eventLoop":52,"src/tryCatch":148,"src/binding":7,"src/nml-parser":71}),exports=module.exports;return function(){(function(){"use strict";var exports;exports=module.exports=require("src/app"),exports.utils=require("src/utils"),exports.signal=require("src/signal"),exports.Dict=require("src/dict"),exports.List=require("src/list"),exports.log=require("src/log"),exports.Resources=require("src/resources"),exports.Renderer=require("src/renderer"),exports.Networking=require("src/networking"),exports.Schema=require("src/schema"),exports.Document=require("src/document"),exports.styles=require("src/styles"),exports.assert=require("src/assert"),exports.db=require("src/db"),exports.eventLoop=require("src/eventLoop"),exports.tryCatch=require("src/tryCatch"),exports.Binding=require("src/binding"),exports.native=function(){try{return require("src/native")}catch(t){}}(),exports.nmlParser=function(){try{return require("src/nml-parser")}catch(t){}}()}).call(this)}(),module.exports},function(exports){var module={exports:exports},require=__createRequire({}),exports=module.exports;return function(){"use strict";function t(t){return function(){var e=t.apply(this,arguments);return new Promise(function(t,n){function r(i,o){try{var s=e[i](o),u=s.value}catch(t){return void n(t)}return s.done?void t(u):Promise.resolve(u).then(function(t){r("next",t)},function(t){r("throw",t)})}return r("next")})}}function e(t){return a.isAbsolute(t)?t:a.join(b,t)}function n(t){return c.createHash(_).update(t).digest("hex")}function r(t){var e=u.readFileSync(t,"utf-8");return{hash:e.slice(0,x),code:e.slice(x)}}function i(t,e,n){var r=e+n;u.writeFileSync(t,r,"utf-8")}var o=function(){var e=t(regeneratorRuntime.mark(function t(e){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,P(e,"utf-8");case 2:return n=t.sent,t.abrupt("return",{hash:n.slice(0,x),code:n.slice(x)});case 4:case"end":return t.stop()}},t,this)}));return function(t){return e.apply(this,arguments)}}(),s=function(){var e=t(regeneratorRuntime.mark(function t(e,n,r){var i;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i=n+r,t.next=3,d(u.writeFile)(e,i,"utf-8");case 3:case"end":return t.stop()}},t,this)}));return function(t,n,r){return e.apply(this,arguments)}}(),u=require("fs-extra"),a=require("path"),c=require("crypto"),l=require("babel-core"),p=require("coffee-script"),h=require("js-yaml"),f=require("util"),d=f.promisify,_="sha",g=a.join(u.realpathSync("./"),"./build/tmp/"),m={presets:["es2015","es2016","es2017"],filename:"",babelrc:!1,ast:!1},y=[".coffee",".litcoffee"],v=[".yaml",".yml"],b=u.realpathSync("."),x=40,S=1e3,w=Object.create(null),P=d(u.readFile);u.ensureDirSync(g),process.on("exit",function(){for(var t=u.readdirSync(g),e=Date.now()-36e5,n=0;n<t.length;n++){var r=a.join(g,t[n]),i=u.statSync(r);i.atime<e&&u.unlinkSync(r)}}),exports.BABEL_OPTIONS=m,exports.compileFile=function(t,n){var r=e(n),i=a.extname(r);switch(i){case".coffee":return p.compile(t);case".litcoffee":return p.compile(t,{literate:!0});case".js":return m.filename=r,l.transform(t,m).code;case".yaml":case".yml":var o=h.safeLoad(t,{filename:r,json:!0});return JSON.stringify(o);case".nml":var s=require("src/nml-parser").bundle({nml:t,path:r}).bundle;return p.compile(s);default:return t}},exports.fileHash=function(){var e=t(regeneratorRuntime.mark(function t(e){var r;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,exports.getFile(e);case 2:return r=t.sent,t.abrupt("return",n(r));case 4:case"end":return t.stop()}},t,this)}));return function(t){return e.apply(this,arguments)}}(),exports.getFile=function(){var r=t(regeneratorRuntime.mark(function t(r){var i,c,l,p,h,f,_,m,y,v,b;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i=e(r),c=w[i],t.next=4,d(u.stat)(i);case 4:if(l=t.sent,l.isFile()){t.next=7;break}throw new TypeError("Path "+i+" is not a file");case 7:if(!c){t.next=10;break}if(!(l.mtime<c.mtime)){t.next=10;break}return t.abrupt("return",c.code);case 10:return p=void 0,h=void 0,f=n(i),_=a.join(g,f),m=void 0,t.prev=15,t.next=18,d(u.stat)(_);case 18:if(m=t.sent,!(m.mtime-S>=l.mtime)){t.next=25;break}return t.next=22,o(_);case 22:y=t.sent,p=y.code,h=y.hash;case 25:t.next=29;break;case 27:t.prev=27,t.t0=t.catch(15);case 29:if(void 0!==p){t.next=42;break}return t.next=32,d(u.readFile)(i,"utf-8");case 32:if(v=t.sent,!m){t.next=38;break}return t.next=36,o(_);case 36:b=t.sent,b.hash===n(v)&&(p=b.code);case 38:if(void 0!==p){t.next=42;break}return p=exports.compileFile(v,i),t.next=42,s(_,n(v),p);case 42:return c||(c=w[i]={mtime:0,code:""}),c.mtime=Date.now()-S,c.code=p,t.abrupt("return",p);case 46:case"end":return t.stop()}},t,this,[[15,27]])}));return function(t){return r.apply(this,arguments)}}(),exports.getFileSync=function(t){var o=e(t),s=w[o],c=u.statSync(o);if(!c.isFile())throw new TypeError("Path "+o+" is not a file");if(s&&c.mtime<s.mtime)return s.code;var l=void 0,p=void 0,h=n(o),f=a.join(g,h),d=void 0;try{if(d=u.statSync(f),d.mtime-S>=c.mtime){var _=r(f);l=_.code,p=_.hash}}catch(t){}if(void 0===l){var m=u.readFileSync(o,"utf-8");if(d){var y=r(f);y.hash===n(m)&&(l=y.code)}void 0===l&&(l=exports.compileFile(m,o),i(f,n(m),l))}return s||(s=w[o]={mtime:0,code:""}),s.mtime=Date.now()-S,s.code=l,l},exports.registerFilenameResolver=function(){var t=module.constructor,e=Object.create(null),n=t._resolveFilename;t._resolveFilename=function(t,r,i){var o=e[t];if(o)return o;var s=n(t,r,i);return"."!==t[0]&&(e[t]=s),s},exports.registerFilenameResolver=function(){}},exports.registerCoffeeScript=function(){function t(module,t){var e=exports.getFileSync(t);return module._compile(e,t)}for(var e=0;e<y.length;e++)require.extensions[y[e]]=t;exports.registerCoffeeScript=function(){}},exports.registerBabel=function(){var t=require.extensions[".js"];require.extensions[".js"]=function(module,e){if(e.indexOf("node_modules")>=0&&(e.indexOf("node_modules/neft")<0||e.indexOf("node_modules/neft/node_modules")>=0))return t(module,e);var n=exports.getFileSync(e);return module._compile(n,e)},exports.registerBabel=function(){}},exports.registerYaml=function(){function t(module,t){var e=exports.getFileSync(t);module.exports=JSON.parse(e)}for(var e=0;e<v.length;e++)require.extensions[v[e]]=t;exports.registerYaml=function(){}},exports.registerTxt=function(){var t=Object.create(null);return function(e){function n(module,t){module.exports=exports.getFileSync(t)}Array.isArray(e)||(e=[".txt"]);for(var r=0;r<e.length;r++){var i=e[r];t[i]||(t[i]=!0,require.extensions[i]=n)}}}(),exports.registerNml=function(){require.extensions[".nml"]=function(module,t){var e=exports.getFileSync(t);return module._compile(e,t)},exports.registerNml=function(){}},exports.register=function(){exports.registerFilenameResolver(),exports.registerCoffeeScript(),exports.registerBabel(),exports.registerYaml(),exports.registerTxt(),exports.registerNml()}}(),module.exports},function(exports){var module={exports:exports},exports=(__createRequire({}),module.exports);return function(){module.exports={name:"neft",version:"0.11.23",preferGlobal:!0,description:"Universal Platform",keywords:["framework","native","android","ios","webgl"],bin:{neft:"bin/neft.js"},main:"index.coffee",license:"Apache-2.0",homepage:"http://neft.io",author:"Krystian Kruk <krystian@neft.io>",contributors:[],repository:{type:"git",url:"https://github.com/Neft-io/neft.git"},bugs:"https://github.com/Neft-io/neft/issues",engines:{node:">=8.0.0"},scripts:{bundle:"cross-env NODE_PATH=./ coffee --nodejs --harmony scripts/bundle.coffee",test:"node ./bin/neft.js test","update-api-docs":"cross-env NODE_PATH=./ coffee scripts/api-docs.coffee",prepublishOnly:"npm run bundle"},dependencies:{acorn:"^5.2.1","babel-core":"6.22.1","babel-preset-es2015":"6.22.0","babel-preset-es2016":"6.22.0","babel-preset-es2017":"6.22.0",chokidar:"1.5.1","coffee-script":"1.10.0","cross-env":"1.0.8","form-data":"1.0.0-rc4","fs-extra":"0.30.0",glob:"7.0.3",htmlparser2:"3.9.0","http-server":"0.9.0",jimp:"0.2.27","js-yaml":"3.6.1",mkdirp:"0.5.1",mustache:"2.2.1","node-notifier":"4.6.0","node-static":"0.7.7",open:"0.0.5",pegjs:"0.10.0",pngjs:"3.0.0",qs:"6.2.0",semver:"5.1.0",slash:"1.0.0","uglify-js":"2.7.5",which:"1.2.12",xcode:"0.8.7"},devDependencies:{"coffee-coverage":"1.0.1",coveralls:"2.11.14","escape-html":"1.0.3",imgur:"0.2.1",istanbul:"^0.4.5",wd:"0.4.0"},android:{package:"io.neft.tests",versionCode:1,versionName:"1.0",application:{label:"Neft.io Tests"}},ios:{package:"io.neft.tests",application:{label:"Neft.io Tests"}}}}(),module.exports},function(exports){var module={exports:exports},require=__createRequire({"src/utils":151,"src/log":55,"src/dict":12,"src/document":39,"src/networking":61}),exports=module.exports;return function(){(function(){"use strict";var t,e,n,r,i,o,s,u;u=require("src/utils"),o=require("src/log"),i=require("fs"),s=require("path"),t=require("src/dict"),e=require("src/document"),n=require("src/networking"),o=o.scope("App","Bootstrap"),r='<!doctype html>\n<html>\n<head>\n <meta charset="utf-8">\n <title>${context.title}</title>\n <script type="text/javascript" src="${context.neftFilePath}"></script>\n <script type="text/javascript" src="${context.appFilePath}"></script>\n <meta name="viewport" content="width=device-width, initial-scale=1.0">\n <meta http-equiv="X-UA-Compatible" content="IE=Edge">\n</head>\n<body>\n <noscript>\n <meta http-equiv="refresh" content="0; url=${context.appTextModeUrl}"></meta>\n </noscript>\n</body>\n</html>',module.exports=function(t){var o,s,a,c,l,p,h,f,d,_,g,m,y,v,b,x,S,w;o="/app.js",p="/neft.js",a="./build/neft-html-release.js",c="./build/neft-webgl-release.js",s="./build/app-html-release.js",l="./build/app-webgl-release.js",d="_app_bootstrap",h="/neft-type=text",f="neft-type",w=e.fromHTML(d,r),e.parse(w),x=["app.js","favicon.ico","static"],S=function(){var t,e,n,r;for(n="",t=0,e=x.length;t<e;t++)r=x[t],n+=u.addSlashes(r)+"|";return n=n.slice(0,-1),new RegExp("^(?:"+n+")")}(),m=function(e){var n;return n=e.headers.cookie,n&&n.indexOf(f)!==-1?/neft\-type=([a-z]+)/.exec(n)[1]:t.config.type},_=g="",y=function(){try{_=i.readFileSync(s,"utf-8")}catch(t){}try{return g=i.readFileSync(l,"utf-8")}catch(t){}},new t.Route({uri:o,getData:function(t){var e;e="game"===m(this.request),g&&_||y(),e?t(null,g):t(null,_)}});try{v=i.readFileSync(a,"utf-8")}catch(t){}try{b=i.readFileSync(c,"utf-8")}catch(t){}return new t.Route({uri:p,getData:function(t){var e;e="game"===m(this.request),e?t(null,b):t(null,v)}}),new t.Route({uri:"favicon.ico",redirect:"static/favicon.ico"}),new t.Route({uri:"neft-type={type}{rest*}",getData:function(e){var n,r;return n=this.request,r=this.response,r.setHeader("Set-Cookie",f+"="+n.params.type+"; path=/;"),r.redirect(""+t.networking.url+n.params.rest)}}),new t.Route({uri:"*",getData:function(t){var e,r;return e=this.request,"text"===m(e)||e.headers["x-expected-type"]?this.next():(r=e.headers["user-agent"]||"",e.type!==n.Request.HTML_TYPE||S.test(e.uri)||u.has(r,"bot")||u.has(r,"Baiduspider")||u.has(r,"facebook")||u.has(r,"Links")?this.next():t(null))},destroyHTML:function(){return this.response.data.destroy()},toHTML:function(){return w.render(null,{title:t.config.title,appTextModeUrl:h+this.request.uri,neftFilePath:p,appFilePath:o})}})}}).call(this)}(),module.exports},function(exports){var module={exports:exports},require=__createRequire({"src/utils":151,"src/log":55,"src/signal":143,"src/db":11,"src/assert":6,"src/schema":133,"src/networking":61,"src/document":39,"src/renderer":97,"src/styles":146,"src/resources":131,"src/dict":12,"./route":5,"./bootstrap/route.node":3,"package.json":2}),exports=module.exports;return function(){(function(){"use strict";var t,e,n,r,i,o,s,u,a,c,l,p,h,exports,f,d,_;_=require("src/utils"),f=require("src/log"),d=require("src/signal"),h=require("src/db"),l=require("src/assert"),a=require("src/schema"),o=require("src/networking"),i=require("src/document"),s=require("src/renderer"),c=require("src/styles"),u=require("src/resources"),r=require("src/dict"),t=require("./route"),p=function(){try{return require("./bootstrap/route.node")}catch(t){}}(),e=/(.+)\.(?:node|server|client|browser|ios|android|native)/,n={title:"Neft.io Application",protocol:"http",port:3e3,host:"localhost",language:"en",type:"app"},exports=module.exports=function(a,l){var f,g,m,y,v,b,x,S,w,P,O,C,R,I,E,T,A,N,k,L,q,F,j,D,B,V,M,H,W,U,z;if(null==a&&(a={}),null==l&&(l={}),v=_.clone(n),v=_.mergeAll(v,a.config,l),m=new r,m.config=v,m.networking=new o({type:o.HTTP,protocol:v.protocol,port:parseInt(v.port,10),host:v.host,url:v.url,language:v.language}),m.routes={},m.styles={},m.components={},m.resources=function(){return a.resources?u.fromJSON(a.resources):new u}(),d.create(m,"onReady"),null==v.type&&(v.type="app"),m.Route=t(m),f="__neft_cookies",g=!process.env.NEFT_SERVER,m.cookies=r(),N=function(t){if(m.cookies=t,g)return t.set("sessionId",_.uid(16))},h.get(f,h.OBSERVABLE,function(t,e){var n;return e?N(e):(n=g?{clientId:_.uid(16)}:{},h.set(f,n,function(t){return h.get(f,h.OBSERVABLE,function(t,e){if(e)return N(e)})}))}),m.networking.onRequest(function(t,e){g?_.merge(t.cookies,m.cookies):_.merge(e.cookies,m.cookies),t.onLoadEnd.listeners.unshift(function(){var t,n,r;if(g){n=e.cookies;for(t in n)r=n[t],_.isEqual(m.cookies[t],r)||m.cookies.set(t,r)}},null)}),s.setResources(m.resources),s.setServerUrl(m.networking.url),s.onLinkUri(function(t){return m.networking.createLocalRequest({method:o.Request.GET,type:o.Request.HTML_TYPE,uri:t})}),m.documentScripts=_.arrayToObject(a.scripts,function(t,e){return e.name},function(t,e){return e.file}),i.Scripts.initialize(m.documentScripts),null!=a.styles)for(q=a.styles,x=0,C=q.length;x<C;x++)if(H=q[x],"windowItem"===(F=H.name)||"__windowItem__"===F){H.file._init({windowItem:null}),U=H.file._main({document:null});break}if(m.windowItem=z=null!=U?U.item:void 0,s.setWindowItem(z),null!=a.styles)for(W={windowItem:z},j=a.styles,w=0,R=j.length;w<R;w++)H=j[w],null!=H.name&&("windowItem"!==H.name&&H.file._init(W),m.styles[H.name]=H.file);if(c({windowStyle:U,styles:m.styles,queries:a.styleQueries,resources:m.resources}),"function"==typeof p&&p(m),S=function(t,n){var r,i,o,s,u,a,c;for(a=0,c=t.length;a<c;a++)s=t[a],null!=s.name&&"function"==typeof s.file&&(u=s.file(m),n[s.name]=u,(o=e.exec(s.name))&&(r=o[0],i=o[1],null!=n[i]&&_.isPlainObject(n[i])&&_.isPlainObject(u)&&(u=_.merge(Object.create(n[i]),u)),n[i]=u))},_.isObject(a.extensions))for(D=a.extensions,P=0,I=D.length;P<I;P++)(b=D[P])(m);for(exports.app={Route:m.Route},B=a.components,O=0,E=B.length;O<E;O++)y=B[O],null!=y.name&&(m.components[y.name]=i.fromJSON(y.file));S(a.routes,m.routes),V=m.routes;for(k in V){if(A=V[k],L={},_.isObject(A)&&!(A instanceof m.Route))for(T in A)a=A[T],_.isObject(a)?(M=new m.Route(T,a),L[M.name]=M):L[T]=a;m.routes[k]=L}return m.routes.index||(m.routes.index=new m.Route("get /",{})),m.onReady.emit(),m}}).call(this)}(),module.exports},function(exports){var module={exports:exports},require=__createRequire({"src/utils":151,"src/signal":143,"src/assert":6,"src/log":55,"src/schema":133,"src/networking":61,"src/document":39,"src/renderer":97,"src/dict":12}),exports=module.exports;return function(){(function(){"use strict";var t,e,n,r,i,o,s,u,a,c,l;l=require("src/utils"),c=require("src/signal"),u=require("src/assert"),a=require("src/log"),s=require("src/schema"),i=require("src/networking"),e=require("src/document"),o=require("src/renderer"),t=require("src/dict"),a=a.scope("App","Route"),r=process.env.NEFT_NODE,n=!r,module.exports=function(o){var u;return u=function(){function u(t,e,n){var r,u,a;l.isObject(t)?n=t:l.isObject(e)?n=e:l.isObject(n)||(n={}),"string"==typeof t&&"string"!=typeof e?n.uri=t:"string"==typeof t&&"string"==typeof e&&(null==n.method&&(n.method=t),null==n.uri&&(n.uri=e)),"function"==typeof e&&null==n.getData&&(n.getData=e),n=l.clone(n),"string"==typeof n.uri&&(u=n.uri.indexOf(" "),u!==-1&&(null==n.method&&(n.method=n.uri.slice(0,u)),n.uri=n.uri.slice(u+1)),n.uri=new i.Uri(n.uri)),null==n.method&&(n.method="get"),n.method=n.method.toLowerCase(),null!=n.schema&&l.isPlainObject(n.schema)&&(n.schema=new s(n.schema)),null!=n.redirect&&"string"==typeof n.redirect&&(n.redirect=new i.Uri(n.redirect)),l.isObject(n.toHTML)&&(n.toHTML=h(n.toHTML));for(r in n)a=n[r],this[r]=a;this.__id__=l.uid(),this.app=o,this.name||(this.name=m(this)),o.networking.createHandler({method:this.method,uri:this.uri,schema:this.schema,callback:l.bindFunctionContext(y,this)})}var p,h,f,d,_,g,m,y,v,b,x,S,w,P,O,C,R,I;return r?I=[]:R=Object.create(null),u.lastClientRoute=null,u.onLastClientRouteChange=c.create(),u.getTemplateComponent=function(){return r?function(e){var n,r;return n={app:o,routes:new t},r=o.components[e].render(null,n),I.push(r),r}:function(e){var n;return n={app:o,routes:new t},null!=R[e]?R[e]:R[e]=o.components[e].render(null,n)}}(),m=function(t){var e;for(e=t.uri._uri,e=e.replace(i.Uri.NAMES_RE,""),e=e.replace(/\*/g,"");e.indexOf("//")!==-1;)e=e.replace(/\/\//g,"/");return e=e.replace(/^\//,""),e=e.replace(/\/$/,"")},C=Object.create(null),b=Object.create(null),d=function(){var t;return t=function(t){var e;return e=Object.create(t),e.__hash__=l.uid(),"function"==typeof e.factory&&e.factory(),e},function(e){var n,r;return n=e.__id__,null==C[n]&&(C[n]=[]),r=C[n].pop()||t(e),r=Object.create(r),r.request=r.response=null,r.route=r,r._dataPrepared=!1,r._destroyComponentOnEnd=!1,r}}(),f=function(t){if(t.response.onSend.disconnect(v,t),delete b[t.__hash__],"function"==typeof t.destroy&&t.destroy(),t._dataPrepared)switch(t.request.type){case"text":"function"==typeof t.destroyText&&t.destroyText();break;case"json":"function"==typeof t.destroyJSON&&t.destroyJSON();break;case"html":"function"==typeof t.destroyHTML&&t.destroyHTML()}t._destroyComponentOnEnd&&t.response.data.destroy(),C[t.__id__].push(Object.getPrototypeOf(t)),u.lastClientRoute===t&&(u.lastClientRoute=null,u.onLastClientRouteChange.emit(t))},P=function(t){return t.data=t.getData()},w=function(t,e,n){if(null!=e){if(200===t.response.status&&(t.response.status=500),t._dataPrepared&&t.error===e)return!1;t.error=e}else{if(t._dataPrepared&&t.data===n)return!1;t.data=n}return!0},x=function(t){var n,r,i;switch(i=t.response,t.error,r=i.data,t.request.type){case"text":n=t.toText();break;case"json":n=t.toJSON();break;case"html":n=t.toHTML(),r instanceof e&&t._destroyComponentOnEnd&&(r.destroy(),i.data=null),n instanceof e||i.data!==r||(n=S.call(t,n))}return t._dataPrepared=!0,null!=n?i.data=n:i.data===r?i.data="":void 0},v=function(){(r||"html"!==this.request.type)&&(f(this),r&&l.has(I,this.response.data)&&(this.response.data.destroy(),l.remove(I,this.response.data)))},_=function(t){n&&t.response.data instanceof e&&(o.windowItem.node=t.response.data.node),t.response.pending&&t.response.send()},p=function(t,e){return!b[t.__hash__]&&(t.response.pending&&e(),!0)},y=function(t,e,r){var o,s,a,c,l,h;if(h=d(this),a=h.__hash__,n&&(u.lastClientRoute&&f(u.lastClientRoute),c=u.lastClientRoute,u.lastClientRoute=h,u.onLastClientRouteChange.emit(c)),h.request=t,h.response=e,b[a]=!0,e.onSend(v,h),"function"==typeof h.init&&h.init(),!b[a])return r();if(l=h.redirect,"function"==typeof l&&(l=h.redirect(),!b[a]))return r();if("string"==typeof l&&(l=new i.Uri(l)),l instanceof i.Uri)return void e.redirect(l.toString(t.params));if(s=h.getData,o=!1,"function"==typeof s)if(1===s.length)h.getData(function(t,e){if(o=!0,!p(h,r)&&w(h,t,e)&&(x(h),!p(h,r)))return _(h)});else{if(P(h),p(h,r))return;if(x(h),p(h,r))return;_(h)}else{if(x(h),p(h,r))return;_(h)}!o&&p(h,r)},u.prototype.next=function(){return f(this)},u.prototype.toJSON=function(){var t,e;return this.response.status<400?(null!=(e=this.data)&&"function"==typeof e.toJSON?e.toJSON():void 0)||this.data:("function"==typeof(t=this.error).toJSON?t.toJSON():void 0)||this.error},u.prototype.toText=function(){return this.response.status<400?this.data+"":this.error+""},O=function(){return this.method+" "+this.uri},g=function(){var t;if(t="components/"+this.name+".xhtml",o.components[t])return t},S=function(t){var e,n,r,i,s,c,l,p;return n=(null!=t?t.component:void 0)||g.call(this)||"components/index.xhtml",l=(null!=t?t.template:void 0)||n,p=(null!=t?t.use:void 0)||"body",r=a.time("Render"),n!==l&&(s=o.components[l])&&(c=u.getTemplateComponent(l),c.use(p,null)),(e=o.components[n])&&(i=e.render(null,this)),c?(i=null!=i?c.use(p,i):c,c.context.routes.has(p)&&c.context.routes.pop(p),c.context.routes.set(p,this),this._destroyComponentOnEnd=!1):this._destroyComponentOnEnd=!0,i},h=function(t){return function(){return S.call(this,t)}},u.prototype.toHTML=h({component:"",template:"",use:""}),u}()}}).call(this)}(),module.exports},function(exports){var module={exports:exports},require=__createRequire({"src/utils":151}),exports=module.exports;return function(){(function(){"use strict";var t,e,n,r,i=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},o={}.hasOwnProperty;r=require("src/utils"),e=module.exports=function(t,n){if(!t)return e.fail(t,!0,n,"==",e)},e.AssertionError=t=function(t){function e(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,this.scope=t.scope,this.message=e.generateMessage(this,t.message),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,t.stackStartFunction),"android"===process.env.NEFT_PLATFORM}var n;return i(e,t),n=function(t){var e;return r.isObject(t)&&(e=function(){try{return JSON.stringify(t)}catch(t){}}()),e||String(t)},e.generateMessage=function(t,e){return e||n(t.actual)+" "+t.operator+" "+n(t.expected)},e}(Error),n=function(t){var e;return e=function(n,r,i,o,s){throw new t.AssertionError({actual:n,expected:r,message:i,operator:o,scope:t._scope,stackStartFunction:s||e})}},e.scope=function(t){var i;return t=""+this._scope+t,i=function(t,n){return e(t,n)},r.merge(i,e),i.fail=n(i),i._scope=t,i},e.fail=n(e),e._scope="",e.ok=e,e.notOk=function(t,n){if(t)return this.fail(t,!0,n,"!=",e.notOk)},e.is=function(t,n,i){if(!r.is(t,n))return this.fail(t,n,i,"===",e.is)},e.isNot=function(t,n,i){if(r.is(t,n))return this.fail(t,n,i,"!==",e.isNot)},e.isDefined=function(t,n){if(null==t)return this.fail(t,null,n,"!=",e.isDefined)},e.isNotDefined=function(t,n){if(null!=t)return this.fail(t,null,n,"==",e.isNotDefined)},e.isPrimitive=function(t,n){if(!r.isPrimitive(t))return this.fail(t,"primitive",n,"is",e.isPrimitive)},e.isNotPrimitive=function(t,n){if(r.isPrimitive(t))return this.fail(t,"primitive",n,"isn't",e.isNotPrimitive)},e.isString=function(t,n){if("string"!=typeof t)return this.fail(t,"string",n,"is",e.isString)},e.isNotString=function(t,n){if("string"==typeof t)return this.fail(t,"string",n,"isn't",e.isNotString)},e.isFloat=function(t,n){if(!r.isFloat(t))return this.fail(t,"float",n,"is",e.isFloat)},e.isNotFloat=function(t,n){if(r.isFloat(t))return this.fail(t,"float",n,"isn't",e.isNotFloat)},e.isInteger=function(t,n){if(!r.isInteger(t))return this.fail(t,"integer",n,"is",e.isInteger)},e.isNotInteger=function(t,n){if(r.isInteger(t))return this.fail(t,"integer",n,"isn't",e.isNotInteger)},e.isBoolean=function(t,n){if("boolean"!=typeof t)return this.fail(t,"boolean",n,"is",e.isBoolean)},e.isNotBoolean=function(t,n){if("boolean"==typeof t)return this.fail(t,"boolean",n,"isn't",e.isNotBoolean)},e.isFunction=function(t,n){if("function"!=typeof t)return this.fail(t,"function",n,"is",e.isFunction)},e.isNotFunction=function(t,n){if("function"==typeof t)return this.fail(t,"function",n,"isn't",e.isNotFunction)},e.isObject=function(t,n){if(null===t||"object"!=typeof t)return this.fail(t,"object",n,"is",e.isObject)},e.isNotObject=function(t,n){if(null!==t&&"object"==typeof t)return this.fail(t,"object",n,"isn't",e.isNotObject)},e.isPlainObject=function(t,n){if(!r.isPlainObject(t))return this.fail(t,"plain object",n,"is",e.isPlainObject)},e.isNotPlainObject=function(t,n){if(r.isPlainObject(t))return this.fail(t,"plain object",n,"isn't",e.isNotPlainObject)},e.isArray=function(t,n){if(!Array.isArray(t))return this.fail(t,"array",n,"is",e.isArray)},e.isNotArray=function(t,n){if(Array.isArray(t))return this.fail(t,"array",n,"isn't",e.isNotArray)},e.isEqual=function(t,n,i,o){if("object"==typeof i&&(o=i,i=void 0),!r.isEqual(t,n,null!=o?o.maxDeep:void 0))return this.fail(t,n,i,"equal",e.isEqual)},e.isNotEqual=function(t,n,i,o){if("object"==typeof i&&(o=i,i=void 0),r.isEqual(t,n,null!=o?o.maxDeep:void 0))return this.fail(t,n,i,"isn't equal",e.isNotEqual)},e.instanceOf=function(t,n,r){var i;if(!(t instanceof n))return i=n.__path__||n.__name__||n.name||n,this.fail(t,i,r,"instanceof",e.instanceOf)},e.notInstanceOf=function(t,n,r){var i;if(t instanceof n)return i=n.__path__||n.__name__||n.name||n,this.fail(t,i,r,"instanceof",e.notInstanceOf)},e.lengthOf=function(t,n,r){if((null!=t?t.length:void 0)!==n)return this.fail(t,n,r,".length ===",e.lengthOf)},e.notLengthOf=function(t,n,r){if((null!=t?t.length:void 0)===n)return this.fail(t,n,r,".length !==",e.notLengthOf)},e.operator=function(t,n,r,i){var o;if(o=function(){switch(n){case">":return t>r;case">=":return t>=r;case"<":return t<r;case"<=":return t<=r;default:throw new TypeError("Unexpected operator `"+n+"`")}}(),!o)return this.fail(t,r,i,n,e.operator)},e.match=function(t,n,r){if(!n.test(t))return this.fail(t,n,r,"match",e.match)},e.notMatch=function(t,n,r){if(n.test(t))return this.fail(t,n,r,"not match",e.match)}}).call(this)}(),module.exports},function(exports){var module={exports:exports},require=__createRequire({"src/utils":151,"src/log":55,"src/assert":6,"src/dict":12,"src/list":53}),exports=module.exports;return function(){(function(){"use strict";var t,e,n,r,i,o,s,u,a,c;c=require("src/utils"),a=require("src/log"),o=require("src/assert"),n=require("src/dict"),r=require("src/list"),a=a.scope("Binding"),u=Array.isArray,i=50,s=function(){var t;return t=Object.create(null),function(e){return t[e]||(t[e]="on"+c.capitalize(e)+"Change")}}(),e=function(){function t(e,n,r,i){this.binding=e,this.prop=r,this.parent=i,this.handlerName=s(this.prop),this.isConnected=!1,u(n)?(this.itemId="",this.child=t.factory(this.binding,n[0],n[1],this),this.item=this.child.getValue()):(this.itemId=n,this.child=null,this.item=this.binding.getItemById(n)),this.connect()}var e;return e=[],t.factory=function(n,r,i,o){var s;return null==o&&(o=null),e.length>0&&(s=e.pop())?(t.call(s,n,r,i,o),s):new t(n,r,i,o)},t.prototype.getSignalChangeListener=function(){var t,e,r,i;return r=function(t,e){void 0!==e&&"string"==typeof t&&this.parent.prop!==t||this.parent.updateItem()},t=function(){this.binding.update()},i=function(t){this.prop===t&&this.parent.updateItem()},e=function(t){this.prop===t&&this.binding.update()},function(){return this.item instanceof n?this.parent?i:e:this.parent?r:t}}(),t.prototype.update=function(){return this.getSignalChangeListener().call(this)},t.prototype.connect=function(){var t,e;e=this.item,e&&(e instanceof n?(this.isConnected=!0,e.onChange(this.getSignalChangeListener(),this)):e instanceof r?(this.isConnected=!0,t=this.getSignalChangeListener(),e.onChange(t,this),e.onInsert(t,this),e.onPop(t,this)):(t=e[this.handlerName])&&(this.isConnected=!0,t(this.getSignalChangeListener(),this)))},t.prototype.disconnect=function(){var t,e;e=this.item,e&&this.isConnected&&(t=this.getSignalChangeListener(),e instanceof n?e.onChange.disconnect(t,this):e instanceof r?(e.onChange.disconnect(t,this),e.onInsert.disconnect(t,this),e.onPop.disconnect(t,this)):e[this.handlerName].disconnect(t,this)),this.isConnected=!1},t.prototype.updateItem=function(){var t,e;t=this.item,e=this.child?this.child.getValue():this.binding.getItemById(this.itemId),t&&!this.isConnected&&(this.connect(),t=null),t!==e&&(this.disconnect(),this.item=e,this.connect(),this.parent||this.binding.update()),this.parent&&this.parent.updateItem()},t.prototype.getValue=function(){return this.item?this.item[this.prop]:null},t.prototype.destroy=function(){var t;this.disconnect(),null!=(t=this.child)&&t.destroy(),e.push(this)},t}(),module.exports=t=function(){function t(t,e){this.ctx=e,this.func=t[0],this.args=null,this.connections||(this.connections=[])}return t.New=function(n,r,i){var o,s,a,c,l;for(null==i&&(i=new t(n,r)),o=i.connections,l=n[1],a=0,c=l.length;a<c;a++)s=l[a],u(s)&&o.push(e.factory(i,s[0],s[1]));return i},t.prototype.getItemById=function(t){throw new Error("Not implemented")},t.prototype.getValue=function(){throw new Error("Not implemented")},t.prototype.getDefaultValue=function(){switch(typeof this.getValue()){case"string":return"";case"number":return 0;case"boolean":return!1;default:return null}},t.prototype.setValue=function(t){throw new Error("Not implemented")},t.prototype.onError=function(t){},t.prototype.update=function(){var t;t=c.tryFunction(this.func,this.ctx,this.args),t instanceof Error&&(this.onError(t),t=this.getDefaultValue()),this.setValue(t)},t.prototype.getLoopDetectedErrorMessage=function(){return"Potential loop detected"},t.prototype.destroy=function(){for(var t;t=this.connections.pop();)t.destroy();this.args=null},t}()}).call(this)}(),module.exports},function(exports){var module={exports:exports},exports=(__createRequire({}),module.exports);return function(){(function(){"use strict";var t,e,n;exports.BINDING_THIS_TO_TARGET_OPTS=t=1,n=function(t,e){var n,r,i,o;for(i=t,n=r=0,o=e-1;r<o;n=r+=1)i+=t;return i},e=function(t,e){var n;if("["!==t[e])return!1;for(;e++<t.length;){if(n=t[e],"]"===n)return!0;if(!/[0-9]/.test(n))return!1}return!1},exports.isBinding=function(t){var e;try{return e=new Function("console","'use strict'; return "+t+";"),e.call(null),!1}catch(t){}return!0},exports.parse=function(r,i,o,s,u){var a,c,l,p,h,f,d,_,g,m,y,v,b,x,S,w,P,O,C,R,I;for(null==o&&(o=0),null==s&&(s={}),null==u&&(u=function(){return!1}),a=[""],r+=" ",b=null,g=!1,d=!1,h=m=0,x=r.length;m<x;h=++m)c=r[h],d&&"]"===c?d=!1:(_=!g&&e(r,h),"."!==c&&!_||!b?(b&&(g||/[a-zA-Z_0-9$]/.test(c))?b[b.length-1]+=c:/[a-zA-Z_$]/.test(c)?(b=[c],a.push(b)):null===b?a[a.length-1]+=c:(b=null,a.push(c)),"'"!==c&&'"'!==c||"\\"===r[h-1]||(g=!g)):(d=_,b.push("")));for(h=y=0,S=a.length;y<S;h=++y)if(l=a[h],"string"!=typeof l)if(l=("function"==typeof s.modifyBindingPart?s.modifyBindingPart(l):void 0)||l,f=l[0],"parent"===f||"nextSibling"===f||"previousSibling"===f||"target"===f||(null!=(R=s.globalIdToThis)?R[f]:void 0))l.unshift("this");else if(o&t&&"this"===f)l.splice(1,0,"target");else{if(i(f)&&(0===h||"."!==a[h-1][a[h-1].length-1]))continue;a[h]=l.join(".")}for(h=-1,C=a.length;++h<C;)if("string"==typeof a[h]){if("string"==typeof a[h-1])a[h-1]+=a[h];else if(""!==a[h].trim())continue;a.splice(h,1),C--}for(I="",p="",h=v=0,w=a.length;v<w;h=++v)if(l=a[h],"string"==typeof l)p+=l;else if(l.length>1)for(null!=a[h-1]&&I&&(I+=", "),I+=n("[",l.length-1),I+=u(l[0])?""+l[0]:"'"+l[0]+"'",p+="this"===l[0]?"this":""+l[0],l.shift(),h=O=0,P=l.length;O<P;h=++O)f=l[h],I+=", '"+f+"']",p+=isFinite(f)?"["+f+"]":"."+f;else p+="this"===l[0]?"this":""+l[0];return p=p.trim(),I=I.trim(),{hash:p,connections:I}}}).call(this)}(),module.exports},function(exports){var module={exports:exports},require=__createRequire({"src/utils":151,"./implementations/memory":10}),exports=module.exports;return function(){(function(){"use strict";var t;t=require("src/utils"),module.exports=function(){var t;return t=function(){try{return require("./implementations/browser"); }catch(t){}}(),t||(t=function(){try{return require("./implementations/native")}catch(t){}}()),t||(t=require("./implementations/memory")),t}()}).call(this)}(),module.exports},function(exports){var module={exports:exports},require=__createRequire({"src/utils":151}),exports=module.exports;return function(){(function(){"use strict";var t,e;e=require("src/utils"),t=Object.create(null),exports.get=function(n,r){var i;return i=t[n],i=e.cloneDeep(i),r(null,i)},exports.set=function(e,n,r){return t[e]=n,r(null)},exports.remove=function(e,n){return t[e]=void 0,n(null)}}).call(this)}(),module.exports},function(exports){var module={exports:exports},require=__createRequire({"src/utils":151,"src/assert":6,"src/list":53,"src/dict":12,"./implementation":9}),exports=module.exports;return function(){(function(){"use strict";var t,e,n,r,i,o,s,u,a,c,l,p,h=function(t,e){function n(){this.constructor=t}for(var r in e)f.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},f={}.hasOwnProperty;c=require("src/utils"),s=require("src/assert"),i=require("src/list"),r=require("src/dict"),s=s.scope("Database"),o=function(){},a=require("./implementation"),p=Object.create(null),l=Object.create(null),exports.OBSERVABLE=1<<29,t=exports.OBSERVABLE,exports.get=function(t,r,i){return"function"==typeof r&&(i=r,r=0),r&exports.OBSERVABLE&&null!=l[t]?i(null,l[t].spawn()):void a.get(t,function(o,s){var u;return null==o&&s?(r&exports.OBSERVABLE&&(Array.isArray(s)?s=new n(t,s,r):c.isObject(s)&&(s=new e(t,s,r)),s=(null!=(u=l[t])?u.spawn():void 0)||s),i(null,s)):i(o,s)})},exports.set=function(t,e,n){var r;null==n&&(n=o),null!=(r=l[t])&&r.disconnect(),a.set(t,e,n)},exports.remove=function(t,e,n){var r;null==n&&(n=o),"function"==typeof e&&(n=e,e=null),null!=e?exports.get(t,function(r,i){var o,s,u,p,h,f,d,_,g;if(null!=r)return n(r);if(!Array.isArray(i))return n(new Error("'"+t+"' is not an array"));if(_=l[t])if((s=_.items().indexOf(e))!==-1)_.pop(s);else for(g=_.items(),o=p=0,f=g.length;p<f;o=++p)if(u=g[o],c.isEqual(u,e)){_.pop(o);break}if((s=i.indexOf(e))!==-1)i.splice(s,1);else for(o=h=0,d=i.length;h<d;o=++h)if(u=i[o],c.isEqual(u,e)){i.splice(o,1);break}return a.set(t,i,n)}):(null!=(r=l[t])&&r.disconnect(),a.remove(t,n))},exports.append=function(t,e,n){null==n&&(n=o),exports.get(t,function(r,i){var o;return null!=r?n(r):(null==i&&(i=[]),Array.isArray(i)?(null!=(o=l[t])&&o.append(e),i.push(e),a.set(t,i,n)):n(new Error("'"+t+"' is not an array")))})},u=function(t,e){return c.defineProperty(t,e,null,function(){return Object.getPrototypeOf(this)[e]},function(t){return Object.getPrototypeOf(this)[e]=t})},n=function(t){function e(t,r,i){e.__super__.constructor.call(this,r),this._key=t,this._watchersCount=0,l[t]=this,this.onChange(n),this.onInsert(n),this.onPop(n)}var n;return h(e,t),n=function(t){this._watchersCount>0&&a.set(this._key,this._data,o)},e.prototype.spawn=function(){return this._watchersCount+=1,this},e.prototype.disconnect=function(){--p[this._key]||(l[this._key]=null)},e}(i),e=function(t){function e(t,r,i){e.__super__.constructor.call(this,r),c.defineProperty(this,"_key",0,t),c.defineProperty(this,"_watchersCount",c.WRITABLE,0),l[t]=this,this.onChange(n)}var n;return h(e,t),n=function(t){this._watchersCount>0&&a.set(this._key,this,o)},e.prototype.spawn=function(){return this._watchersCount+=1,this},e.prototype.disconnect=function(){--p[this._key]||(l[this._key]=null)},e}(r)}).call(this)}(),module.exports},function(exports){var module={exports:exports},require=__createRequire({"src/utils":151,"src/assert":6,"src/signal":143}),exports=module.exports;return function(){(function(){"use strict";var t,e,n,r,i=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},o={}.hasOwnProperty;r=require("src/utils"),e=require("src/assert"),n=require("src/signal"),module.exports=t=function(t){function e(t){return this instanceof e?(e.__super__.constructor.call(this),r.defineProperty(this,"_signals",r.WRITABLE,this._signals),r.defineProperty(this,"_keys",r.WRITABLE,null),r.defineProperty(this,"_values",r.WRITABLE,null),r.defineProperty(this,"_items",r.WRITABLE,null),r.defineProperty(this,"_dirty",r.WRITABLE,o),void(r.isObject(t)&&r.merge(this,t))):new e(t)}var o,s,u,a,c,l;return i(e,t),e.__name__="Dict",e.__path__="Dict",u=1,c=2,s=4,o=(s<<1)-1,e.fromJSON=function(t){return t=r.tryFunction(JSON.parse,JSON,[t],t),new e(t)},a=r.CONFIGURABLE|r.WRITABLE,r.defineProperty(e.prototype,"constructor",a,e),l=a,r.defineProperty(e.prototype,"length",l,function(){return this.keys().length},null),n.Emitter.createSignal(e,"onChange"),r.defineProperty(e.prototype,"set",a,function(t,e){var n;return n=this[t],n===e?e:(this[t]=e,this._dirty|=o,this.onChange.emit(t,n),e)}),r.defineProperty(e.prototype,"has",a,function(t){return void 0!==this[t]}),r.defineProperty(e.prototype,"extend",a,function(t){var e,n;for(e in t)n=t[e],t.hasOwnProperty(e)&&this.set(e,n);return this}),r.defineProperty(e.prototype,"pop",a,function(t){var e;return e=this[t],delete this[t],this._dirty|=o,this.onChange.emit(t,e),e}),r.defineProperty(e.prototype,"clear",a,function(){var t,e;for(t in this)e=this[t],this.pop(t)}),r.defineProperty(e.prototype,"keys",a,function(){var t,e,n,r;if(this._dirty&u){this._dirty^=u,t=null!=this._keys?this._keys:this._keys=[],e=0;for(n in this)r=this[n],t[e]=n,e++;t.length=e}return this._keys}),r.defineProperty(e.prototype,"values",a,function(){var t,e,n,r;if(this._dirty&c){this._dirty^=c,t=null!=this._values?this._values:this._values=[],e=0;for(n in this)r=this[n],t[e]=r,e++;t.length=e}return this._values}),r.defineProperty(e.prototype,"items",a,function(){var t,e,n,r;if(this._dirty&s){t=null!=this._values?this._values:this._values=[],e=0;for(n in this)r=this[n],null==t[e]&&(t[e]=["",null]),t[e][0]=n,t[e][1]=r,e++;t.length=e}return this._values}),e}(n.Emitter)}).call(this)}(),module.exports},function(exports){var module={exports:exports},require=__createRequire({"src/assert":6}),exports=module.exports;return function(){(function(){"use strict";var t;t=require("src/assert"),module.exports=function(t){var e;return e=function(){function e(t,e,n){this.file=t,this.node=e,this.elseNode=null!=n?n:null,"undefined"!=typeof elseNode&&null!==elseNode,this.node.onPropsChange(u,this)}var n,r,i,o,s,u;return e.__name__="Condition",e.__path__="File.Condition",r=e.JSON_CTOR_ID=t.JSON_CTORS.push(e)-1,s=1,o=s++,i=s++,n=e.JSON_ARGS_LENGTH=s,e._fromJSON=function(t,n,r){var s,u;return r||(u=t.node.getChildByAccessPath(n[o]),n[i]&&(s=t.node.getChildByAccessPath(n[i])),r=new e(t,u,s)),r},u=function(t){"n-if"===t&&this.update()},e.prototype.update=function(){var t,e;e=this.node.visible=!!this.node.props["n-if"],null!=(t=this.elseNode)&&(t.visible=!e)},e.prototype.render=function(){return this.update()},e.prototype.clone=function(t,n){var r,i;return i=t.node.getCopiedElement(this.node,n.node),this.elseNode&&(r=t.node.getCopiedElement(this.elseNode,n.node)),new e(n,i,r)},e.prototype.toJSON=function(t,e){var s;return e||(e=new Array(n),e[0]=r),e[o]=this.node.getAccessPath(this.file.node),e[i]=null!=(s=this.elseNode)?s.getAccessPath(this.file.node):void 0,e},e}()}}).call(this)}(),module.exports},function(exports){var module={exports:exports},require=__createRequire({"src/utils":151,"src/assert":6,"src/signal":143,"./element/text":20,"./element/tag":16,"./element/parser":15}),exports=module.exports;return function(){(function(){"use strict";var t,e,n,r,i,o,s,u=function(t,e){function n(){this.constructor=t}for(var r in e)a.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},a={}.hasOwnProperty;s=require("src/utils"),n=require("src/assert"),o=require("src/signal"),i=Array.isArray,e=o.Emitter,r=e.emitSignal,n=n.scope("View.Element"),t=function(t){function n(){e.call(this),this._parent=null,this._nextSibling=null,this._previousSibling=null,this._style=null,this._documentStyle=null,this._visible=!0,this._watchers=null,this._inWatchers=null,this._checkWatchers=0}var i,a,c,l,p,h;return u(n,t),n.__name__="Element",n.__path__="File.Element",n.JSON_CTORS=[],a=n.JSON_CTOR_ID=n.JSON_CTORS.push(n)-1,p=1,c=p++,i=n.JSON_ARGS_LENGTH=p,n.fromHTML=function(t){if("node"!==process.env.NEFT_PLATFORM)throw new Error("Creating Views from HTML files is allowed only on a server");return n.parser.parse(t)},n.fromJSON=function(t){return"string"==typeof t&&(t=JSON.parse(t)),n.JSON_CTORS[t[0]]._fromJSON(t)},n._fromJSON=function(t,e){return null==e&&(e=new n),e._visible=1===t[c],e},n.Text=require("./element/text")(n),n.Tag=l=require("./element/tag")(n),h=s.CONFIGURABLE,s.defineProperty(n.prototype,"index",h,function(){var t;return(null!=(t=this.parent)?t.children.indexOf(this):void 0)||0},function(t){var e,n,r,i,o,s,u;return!!(r=this._parent)&&(n=this.index,e=r.children,t>e.length&&(t=e.length),n!==t&&n!==t-1&&(null!=(i=this._previousSibling)&&(i._nextSibling=this._nextSibling),null!=(o=this._nextSibling)&&(o._previousSibling=this._previousSibling),e.splice(n,1),t>n&&t--,e.splice(t,0,this),this._previousSibling=e[t-1]||null,this._nextSibling=e[t+1]||null,null!=(s=this._previousSibling)&&(s._nextSibling=this),null!=(u=this._nextSibling)&&(u._previousSibling=this),!0))}),h=s.CONFIGURABLE,s.defineProperty(n.prototype,"nextSibling",h,function(){return this._nextSibling},null),h=s.CONFIGURABLE,s.defineProperty(n.prototype,"previousSibling",h,function(){return this._previousSibling},null),h=s.CONFIGURABLE,s.defineProperty(n.prototype,"parent",h,function(){return this._parent},function(t){var e,n,i,o,s,u,a;return i=this._parent,i!==t&&(this._parent&&(o=this._parent.children,this._nextSibling?this._previousSibling?(e=o.indexOf(this),o.splice(e,1)):o.shift():o.pop(),r(this._parent,"onChildrenChange",null,this),null!=(u=this._previousSibling)&&(u._nextSibling=this._nextSibling),null!=(a=this._nextSibling)&&(a._previousSibling=this._previousSibling),this._previousSibling=null,this._nextSibling=null),this._parent=s=t,s&&(n=this._parent.children,e=n.push(this)-1,r(s,"onChildrenChange",this),0===e?this._previousSibling=null:(this._previousSibling=n[e-1],this._previousSibling._nextSibling=this)),this._previousSibling,r(this,"onParentChange",i),l.query.checkWatchersDeeply(this,i),l.query.checkWatchersDeeply(this),!0)}),o.Emitter.createSignal(n,"onParentChange"),h=s.CONFIGURABLE,s.defineProperty(n.prototype,"style",h,function(){return this._style},function(t){var e;return e=this._style,e!==t&&(this._style=t,r(this,"onStyleChange",e,t),!0)}),o.Emitter.createSignal(n,"onStyleChange"),h=s.CONFIGURABLE,s.defineProperty(n.prototype,"visible",h,function(){return this._visible},function(t){var e;return e=this._visible,e!==t&&(this._visible=t,r(this,"onVisibleChange",e),!0)}),o.Emitter.createSignal(n,"onVisibleChange"),n.prototype.queryAllParents=l.query.queryAllParents,n.prototype.queryParents=l.query.queryParents,n.prototype.getAccessPath=function(t){var e,n,r;for(e=[],p=0,n=this,r=this;(r=n._parent)&&(e.push(r.children.indexOf(n)),n=r,r!==t););return e},n.prototype.clone=function(t){return null==t&&(t=new n),t._visible=this._visible,t},n.prototype.toJSON=function(t){return t||(t=new Array(i),t[0]=a),t[c]=this.visible?1:0,t},"node"===process.env.NEFT_PLATFORM&&(n.parser=require("./element/parser")(n)),n}(e),module.exports=t}).call(this)}(),module.exports},function(exports){var module={exports:exports},require=__createRequire({"src/utils":151,"src/log":55}),exports=module.exports;return function(){(function(){var t,e,n,r,i,o;o=require("src/utils"),e=require("htmlparser2"),n=require("src/log"),n=n.scope("Document"),t=o.uid(100),r=function(t,e){return e},i=function(t,e){return t},module.exports=function(n){var r,i;return i=n.Tag.extensions,r=function(){function t(t){this._callback=t,this._done=!1,this._tagStack=[],this.node=new n.Tag}return t.prototype.onreset=function(){return t.call(this,this._callback)},t.prototype.onend=function(){if(!this._done)return this._done=!0,this._callback(null,this.node)},t.prototype.onerror=function(t){return this._done=!0,this._callback(t,this.node)},t.prototype.onclosetag=function(t){var e;return e=this._tagStack.pop()},t.prototype._addDomElement=function(t){var e,n;e=o.last(this._tagStack)||this.node,n=e.children.push(t),t._parent=e,(t._previousSibling=e.children[n-2]||null)&&(t._previousSibling._nextSibling=t)},t.prototype.onopentag=function(t,e){var r;return r=new(i[t]||n.Tag),r.name=t,o.merge(r.props,e),this._addDomElement(r),this._tagStack.push(r)},t.prototype.ontext=function(t){var e;if(t.replace(/[\t\n]/gm,""))return e=new n.Text,e._text=t,this._addDomElement(e)},t.prototype.oncomment=function(){},t.prototype.oncdatastart=function(){},t.prototype.oncommentend=function(){},t.prototype.oncdataend=function(){},t.prototype.onprocessinginstruction=function(t,e){var r;return r=new n.Text,r._text="<"+e+">",this._addDomElement(r)},t}(),{parse:function(n){var i,o,s;return s=null,i=new r(function(t){return function(t,e){if(t)throw t;return s=e}}(this)),o=new e.Parser(i,{xmlMode:!0,recognizeSelfClosing:!0,lowerCaseAttributeNames:!1,lowerCaseTags:!1,recognizeCDATA:!0,decodeEntities:!0}),o._tokenizer._xmlMode=!1,o.onattribname=function(e){return function(n){return e.call(this,n),this._attribvalue=t}}(o.onattribname),o.onattribdata=function(e){return function(n){return this._attribvalue===t&&(this._attribvalue=""),e.call(this,n)}}(o.onattribdata),o.onattribend=function(e){return function(){return this._attribvalue===t&&(this._attribvalue="true"),e.call(this)}}(o.onattribend),o.write(n),o.end(),s}}}}).call(this)}(),module.exports},function(exports){var module={exports:exports},require=__createRequire({"src/utils":151,"src/assert":6,"src/signal":143,"./tag/query":18,"./tag/props":17,"./tag/stringify":19,"src/typed-array":149}),exports=module.exports;return function(){(function(){"use strict";var t,e,n,r,i,o,s,u,a=function(t,e){function n(){this.constructor=t}for(var r in e)c.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},c={}.hasOwnProperty;u=require("src/utils"),n=require("src/assert"),o=require("src/signal"),s=require("./tag/stringify"),e=require("src/typed-array"),r=o.Emitter.emitSignal,n=n.scope("View.Element.Tag"),i=function(t){return null!=t},t=/\#([^\s]+)/,module.exports=function(t){var n;return n=function(n){function r(){t.call(this),this.name="blank",this.children=[],this.props=new f(this)}var i,c,l,p,h,f,d,_;return a(r,n),r.Props=f=require("./tag/props")(r),r.DEFAULT_STRINGIFY_REPLACEMENTS=Object.create(null),r.extensions=Object.create(null),r.__name__="Tag",r.__path__="File.Element.Tag",p=r.JSON_CTOR_ID=t.JSON_CTORS.push(r)-1,d=t.JSON_ARGS_LENGTH,h=d++,l=d++,c=d++,i=r.JSON_ARGS_LENGTH=d,r._fromJSON=function(e,n){var i,o,s,a,p,f;for(null==n&&(n=new r),t._fromJSON(e,n),n.name=e[h],u.merge(n.props,e[c]),p=null,f=e[l],s=0,a=f.length;s<a;s++)i=f[s],o=t.fromJSON(i),n.children.push(o),o._parent=n,(o._previousSibling=p)&&(p._nextSibling=o),p=o;return n},o.Emitter.createSignal(r,"onChildrenChange"),o.Emitter.createSignal(r,"onPropsChange"),r.prototype.clone=function(t){return null==t&&(t=new r),r.__super__.clone.call(this,t),t.name=this.name,u.merge(t.props,this.props),t},r.prototype.cloneDeep=function(){var t,e,n,i,o,s,u;for(e=this.clone(),s=null,u=this.children,i=0,o=u.length;i<o;i++)t=u[i],n=t instanceof r?t.cloneDeep():t.clone(),e.children.push(n),n._parent=e,(n._previousSibling=s)&&(s._nextSibling=n),s=n;return e},r.prototype.getCopiedElement=function(){var t;return t=new e.Uint16(256),function(e,n){var r,i,o;if(e===this)return n;for(d=0,r=e;(o=r._parent)&&(t[d++]=o.children.indexOf(r),r=o,r!==this););for(r=n;d-- >0;)i=t[d],r=r.children[i];return r}}(),r.prototype.getChildByAccessPath=function(t){var e,n;for(e=this,n=t.length-1;n>=0;n+=-1)if(d=t[n],!(e=e.children[d]))return null;return e},r.query=_=require("./tag/query")(t,r),r.prototype.queryAll=_.queryAll,r.prototype.query=_.query,r.prototype.watch=_.watch,r.prototype.stringify=function(t){return null==t&&(t=r.DEFAULT_STRINGIFY_REPLACEMENTS),s.getOuterHTML(this,t)},r.prototype.stringifyChildren=function(t){return null==t&&(t=r.DEFAULT_STRINGIFY_REPLACEMENTS),s.getInnerHTML(this,t)},r.prototype.replace=function(t,e){var n;return n=this.children.indexOf(t),t.parent=void 0,e.parent=this,e.index=n,null},r.prototype.toJSON=function(t){var e,n,o,s,u;for(t||(t=new Array(i),t[0]=p),r.__super__.toJSON.call(this,t),t[h]=this.name,n=t[l]=[],t[c]=this.props,u=this.children,o=0,s=u.length;o<s;o++)e=u[o],n.push(e.toJSON());return t},r}(t)}}).call(this)}(),module.exports},function(exports){var module={exports:exports},require=__createRequire({"src/utils":151,"src/assert":6,"src/signal":143}),exports=module.exports;return function(){(function(){"use strict";var t,e,n,r;r=require("src/utils"),t=require("src/assert"),n=require("src/signal"),e=n.Emitter.emitSignal,module.exports=function(t){var n;return n=function(){function n(t){r.defineProperty(this,"_ref",0,t)}var i;return i=r.CONFIGURABLE|r.WRITABLE,r.defineProperty(n.prototype,"constructor",i,n),r.defineProperty(n.prototype,"item",i,function(t,e){var n,r,i;null==e&&(e=[]),e[0]=e[1]=void 0,n=0;for(r in this){if(i=this[r],this.hasOwnProperty(r)&&n===t){e[0]=r,e[1]=i;break}n++}return e}),r.defineProperty(n.prototype,"has",i,function(t){return this.hasOwnProperty(t)}),r.defineProperty(n.prototype,"set",i,function(n,r){var i;return i=this[n],i!==r&&(this[n]=r,e(this._ref,"onPropsChange",n,i),t.query.checkWatchersDeeply(this._ref),!0)}),n}()}}).call(this)}(),module.exports},function(exports){var module={exports:exports},require=__createRequire({"src/utils":151,"src/signal":143,"src/eventLoop":52,"src/assert":6}),exports=module.exports;return function(){(function(){"use strict";var t,e,n,r,i,o,s,u,a,c,l,p,h,f,d,_,g,m,y,v,b,x,S,w,P,O,C,R,I,E,T,A,N,k,L,q,F,j,D,B,V,M,H,W=function(t,e){function n(){this.constructor=t}for(var r in e