diff --git a/dist/flair.app.js b/dist/flair.app.js
index 5f8a005a..0da43ee1 100644
--- a/dist/flair.app.js
+++ b/dist/flair.app.js
@@ -5,8 +5,8 @@
*
* Assembly: flair.app
* File: ./flair.app.js
- * Version: 0.6.82
- * Mon, 13 May 2019 19:15:31 GMT
+ * Version: 0.6.84
+ * Mon, 13 May 2019 19:21:49 GMT
*
* (c) 2017-2019 Vikas Burman
* MIT
@@ -701,12 +701,14 @@
};
const loadPreambles = async () => {
// load preambles
+ let preambleLoader = null;
for(let item of settings.boot.preambles) {
// get simple script file
item = which(item); // server/client specific version (although this will not be the case, generally)
if (item) { // in case no item is set for either server/client
// this loads it as a function which is called here
- await include(item)(flair);
+ preambleLoader = await include(item);
+ preambleLoader(flair);
}
}
};
@@ -2519,7 +2521,7 @@
AppDomain.context.current().currentAssemblyBeingLoaded('');
// register assembly definition object
- AppDomain.registerAdo('{"name":"flair.app","file":"./flair.app{.min}.js","mainAssembly":"flair","desc":"True Object Oriented JavaScript","title":"Flair.js","version":"0.6.82","lupdate":"Mon, 13 May 2019 19:15:31 GMT","builder":{"name":"flairBuild","version":"1","format":"fasm","formatVersion":"1","contains":["init","func","type","vars","reso","asst","rout","sreg"]},"copyright":"(c) 2017-2019 Vikas Burman","license":"MIT","types":["flair.app.Bootware","flair.app.Handler","flair.app.App","flair.app.Host","flair.ui.vue.VueComponentMembers","flair.api.RestHandler","flair.api.RestInterceptor","flair.app.BootEngine","flair.app.ClientHost","flair.app.ServerHost","flair.boot.ClientRouter","flair.boot.DIContainer","flair.boot.Middlewares","flair.boot.NodeEnv","flair.boot.ResHeaders","flair.boot.ServerRouter","flair.ui.ViewHandler","flair.ui.ViewInterceptor","flair.ui.ViewState","flair.ui.ViewTransition","flair.ui.vue.VueComponent","flair.ui.vue.VueDirective","flair.ui.vue.VueFilter","flair.ui.vue.VueLayout","flair.ui.vue.VueMixin","flair.ui.vue.VuePlugin","flair.ui.vue.VueSetup","flair.ui.vue.VueView"],"resources":[],"assets":[],"routes":[]}');
+ AppDomain.registerAdo('{"name":"flair.app","file":"./flair.app{.min}.js","mainAssembly":"flair","desc":"True Object Oriented JavaScript","title":"Flair.js","version":"0.6.84","lupdate":"Mon, 13 May 2019 19:21:49 GMT","builder":{"name":"flairBuild","version":"1","format":"fasm","formatVersion":"1","contains":["init","func","type","vars","reso","asst","rout","sreg"]},"copyright":"(c) 2017-2019 Vikas Burman","license":"MIT","types":["flair.app.Bootware","flair.app.Handler","flair.app.App","flair.app.Host","flair.ui.vue.VueComponentMembers","flair.api.RestHandler","flair.api.RestInterceptor","flair.app.BootEngine","flair.app.ClientHost","flair.app.ServerHost","flair.boot.ClientRouter","flair.boot.DIContainer","flair.boot.Middlewares","flair.boot.NodeEnv","flair.boot.ResHeaders","flair.boot.ServerRouter","flair.ui.ViewHandler","flair.ui.ViewInterceptor","flair.ui.ViewState","flair.ui.ViewTransition","flair.ui.vue.VueComponent","flair.ui.vue.VueDirective","flair.ui.vue.VueFilter","flair.ui.vue.VueLayout","flair.ui.vue.VueMixin","flair.ui.vue.VuePlugin","flair.ui.vue.VueSetup","flair.ui.vue.VueView"],"resources":[],"assets":[],"routes":[]}');
// assembly load complete
if (typeof onLoadComplete === 'function') {
diff --git a/dist/flair.app.min.js b/dist/flair.app.min.js
index 908a98cf..547de4d1 100644
--- a/dist/flair.app.min.js
+++ b/dist/flair.app.min.js
@@ -5,10 +5,10 @@
*
* Assembly: flair.app
* File: ./flair.app.js
- * Version: 0.6.82
- * Mon, 13 May 2019 19:15:31 GMT
+ * Version: 0.6.84
+ * Mon, 13 May 2019 19:21:49 GMT
*
* (c) 2017-2019 Vikas Burman
* MIT
*/
-!function(t,e){"use strict";"function"==typeof!0&&(!0).amd?(!0)(e):"object"==typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=e),module.exports=exports=e):t["flair.app"]=e}(this,async function(t,e){"use strict";const{Class:i,Struct:a,Enum:n,Interface:r,Mixin:s,Aspects:o,AppDomain:l,$$:c,attr:p,bring:h,Container:u,include:d,Port:f,on:m,post:y,telemetry:v,Reflector:w,Serializer:g,Tasks:$,as:b,is:x,isComplies:O,isDerivedFrom:V,isAbstract:A,isSealed:S,isStatic:F,isSingleton:I,isDeprecated:C,isImplements:E,isInstanceOf:M,isMixed:D,getAssembly:P,getAttr:L,getContext:H,getResource:j,getRoute:R,getType:T,ns:B,getTypeOf:k,getTypeName:W,typeOf:z,dispose:N,using:J,Args:U,Exception:q,noop:K,nip:G,nim:_,nie:Q,event:X}=t,{TaskInfo:Y}=t.Tasks,{env:Z}=t.options,{forEachAsync:tt,replaceAll:et,splitAndTrim:it,findIndexByProp:at,findItemByProp:nt,which:rt,guid:st,isArrowFunc:ot,isASyncFunc:lt,sieve:ct,deepMerge:pt,getLoadedScript:ht,b64EncodeUnicode:ut,b64DecodeUnicode:dt}=t.utils,{$$static:ft,$$abstract:mt,$$virtual:yt,$$override:vt,$$sealed:wt,$$private:gt,$$privateSet:$t,$$protected:bt,$$protectedSet:xt,$$readonly:Ot,$$async:Vt,$$overload:At,$$enumerate:St,$$dispose:Ft,$$post:It,$$on:Ct,$$timer:Et,$$type:Mt,$$args:Dt,$$inject:Pt,$$resource:Lt,$$asset:Ht,$$singleton:jt,$$serialize:Rt,$$deprecate:Tt,$$session:Bt,$$state:kt,$$conditional:Wt,$$noserialize:zt,$$ns:Nt}=c,Jt=Z.isServer||Z.isWorker?null:(!0).document,Ut=l.context.current().name,qt=e,Kt=qt.substr(0,qt.lastIndexOf("/")+1);l.loadPathOf("flair.app",Kt);let Gt=JSON.parse('{"host":"flair.app.ServerHost | flair.app.ClientHost","app":"flair.app.App","boot":{"files":[],"preambles":[],"bootwares":[]},"di":{"container":{}},"client":{"view":{"el":"main","title":"","transition":""},"url":{"404":"/404","hashbang":false,"i18n":false,"home":"/"},"vue":{"components":[],"filters":[],"mixins":[],"directives":[],"plugins":[],"pluginOptions":{}},"i18n":{"enabled":true,"locale":"en","locales":[{"code":"en","name":"English","native":"English"}]},"routing":{"mounts":{"main":"/"},"main-options":[],"main-interceptors":[]}},"server":{"express":{"server-http":{"enable":false,"port":80,"timeout":-1},"server-https":{"enable":false,"port":443,"timeout":-1,"privateKey":"","publicCert":""}},"envVars":{"vars":[],"options":{"overwrite":true}},"routing":{"mounts":{"main":"/"},"main-appSettings":[],"main-middlewares":[],"main-interceptors":[],"main-resHeaders":[]}}}'),_t=t.Port("settingsReader");if("function"==typeof _t){let t=_t("flair.app");t&&(Gt=pt([Gt,t],!1))}Gt=Object.freeze(Gt);let Qt=JSON.parse("{}");Qt=Object.freeze(Qt);let Xt=()=>{};return l.context.current().currentAssemblyBeingLoaded("./flair.app{.min}.js"),await(async()=>{c("abstract"),c("ns","flair.app"),i("Bootware",function(){c("virtual"),this.construct=((t,e,i)=>{let a=U("name: string, version: string","name: string, version: string, isMountSpecific: boolean","name: string, isMountSpecific: boolean","name: string")(t,e,i);a.throwOnError(this.construct),this.info=Object.freeze({name:a.values.name||"",version:a.values.version||"",isMountSpecific:a.values.isMountSpecific||!1})}),c("virtual"),c("async"),this.boot=K,c("readonly"),this.info=null,c("virtual"),c("async"),this.ready=K,c("virtual"),this.dispose=K})})(),await(async()=>{const{IDisposable:t}=B();c("ns","flair.app"),i("Handler",[t],function(){c("virtual"),this.construct=(()=>{}),c("virtual"),this.dispose=(()=>{})})})(),await(async()=>{const{IDisposable:t}=B(),{Bootware:e}=B("flair.app");c("ns","flair.app"),i("App",e,[t],function(){c("override"),this.construct=(t=>{let e=P(this);t(e.title,e.version)}),c("override"),c("sealed"),this.boot=(async t=>{t(),l.host().error.add(this.handleError)}),this.start=(async()=>{if(!Z.isServer&&!Z.isWorker){const{ViewState:t}=B("flair.ui");new t}await this.onStart()}),c("virtual"),c("async"),this.onStart=K,c("override"),c("sealed"),this.ready=(async()=>{await this.onReady()}),c("virtual"),c("async"),this.onReady=K,this.stop=(async()=>{if(!Z.isServer&&!Z.isWorker){const{ViewState:t}=B("flair.ui");(new t).clear()}await this.onStop()}),c("virtual"),c("async"),this.onStop=K,c("private"),this.handleError=(t=>{this.onError(t.error)}),c("virtual"),this.onError=(t=>{throw q.OperationFailed(t,this.onError)}),c("override"),this.dispose=(t=>{t(),l.host().error.remove(this.handleError)})})})(),await(async()=>{const{IDisposable:t}=B(),{Bootware:e}=B("flair.app");c("ns","flair.app"),i("Host",e,[t],function(){c("virtual"),c("async"),this.start=K,c("virtual"),c("async"),this.stop=K,this.error=X(t=>({error:t})),this.raiseError=(t=>{this.error(t)})})})(),await(async()=>{c("ns","flair.ui.vue"),s("VueComponentMembers",function(){var t=this;c("private"),this.define=(async()=>{const e=await d("vue/vue{.min}.js"),{ViewState:i}=B("flair.ui"),{VueFilter:a,VueMixin:n,VueDirective:r,VueComponent:s}=B("flair.ui.vue");let o=new i,l={},c=f("clientFile");if(this.style&&this.style.endsWith(".css")&&(this.style=await c(this.style)),this.html&&this.html.endsWith(".html")&&(this.html=await c(this.html)),Gt.client.i18n.enabled&&this.i18n){let t="";for(let e in this.i18n)this.i18n.hasOwnProperty(e)&&(t=this.$self.assemblyName+"/locales/"+this.locale()+"/"+this.i18n[e],this.i18n[e]=await c(t))}if(this.template?l.template=this.template:this.style&&this.html?l.template="
":this.html&&(l.template=this.html.trim()),this.render&&"function"==typeof this.render&&(l.render=this.render),"boolean"==typeof this.functional&&(l.functional=this.functional),this.computed)for(let t in this.computed)this.computed.hasOwnProperty(t)&&(l.computed=l.computed||{},l.computed[t]=this.computed[t]);if(this.state&&Array.isArray(this.state))for(let t of this.state){if(l.computed[t.name])throw q.InvalidDefinition(`Computed (state) property already defined. (${t.name})`);l.computed=l.computed||{},l.computed[t.name]={get:function(){return o.get(t.path,t.name)||t.value},set:function(e){o.set(t.path,t.name,e)}}}if(this.methods)for(let t in this.methods)this.methods.hasOwnProperty(t)&&(l.methods=l.methods||{},l.methods[t]=this.methods[t]);if(l.methods=l.methods||{},l.methods["path"]=(e=>t.path(e)),l.methods=l.methods||{},l.methods["route"]=((e,i)=>t.route(e,i)),Gt.client.i18n.enabled&&(l.methods["locale"]=(e=>t.locale(e)),l.methods["i18n"]=((e,i,a)=>t.i18n&&t.i18n[e]&&t.i18n[e][i]?t.i18n[e][i]||a||"(i18n: 404)":a||"(i18n: 404)")),this.watch)for(let t in this.watch)this.watch.hasOwnProperty(t)&&(l.watch=l.watch||{},l.watch[t]=this.watch[t]);if(this.lifecycle)for(let t in this.lifecycle)this.lifecycle.hasOwnProperty(t)&&(l[t]=this.lifecycle[t]);if(this.components&&Array.isArray(this.components)){let t=null,i=null;for(let a of this.components){if(!a.name)throw q.OperationFailed(`Component name cannot be empty. (${a.type})`);if(!a.type)throw q.OperationFailed(`Component type cannot be empty. (${a.name})`);if(!(t=b(await d(a.name),s)))throw q.InvalidArgument(a.type);try{if(i=new t,e.options.components[a.name])throw q.Duplicate(`Component already registered. (${a.name})`);if(i.components&&i.components[a.name])throw q.Duplicate(`Component already registered. (${a.name})`);i.components=i.components||{},i.components[a.name]=await i.factory()}catch(t){throw q.OperationFailed(`Component registration failed. (${a.type})`,t)}}}if(this.mixins&&Array.isArray(this.mixins)){let t=null,e=null;for(let i of this.mixins){if(!i.name)throw q.OperationFailed(`Mixin name cannot be empty. (${i.type})`);if(!i.type)throw q.OperationFailed(`Mixin type cannot be empty. (${i.name})`);if(!(t=b(await d(i.type),n)))throw q.InvalidArgument(i.type);try{if(e=new t,l.mixins&&l.mixins[i.name])throw q.Duplicate(`Mixin already registered. (${i.name})`);l.mixins=l.mixins||{},l.mixins[i.name]=await e.factory()}catch(t){throw q.OperationFailed(`Mixin registration failed. (${i.type})`,t)}}}if(this.directives&&Array.isArray(this.directives)){let t=null,e=null;for(let i of this.directives){if(!i.name)throw q.OperationFailed(`Directive name cannot be empty. (${i.type})`);if(!i.type)throw q.OperationFailed(`Directive type cannot be empty. (${i.name})`);if(!(t=b(await d(i.type),r)))throw q.InvalidArgument(i.type);try{if(e=new t,l.directives&&l.directives[i.name])throw q.Duplicate(`Directive already registered. (${i.name})`);l.directives=l.directives||{},l.directives[i.name]=await e.factory()}catch(t){throw q.OperationFailed(`Directive registration failed. (${i.type})`,t)}}}if(this.filters&&Array.isArray(this.filters)){let t=null,e=null;for(let i of this.filters){if(!i.name)throw q.OperationFailed(`Filter name cannot be empty. (${i.type})`);if(!i.type)throw q.OperationFailed(`Filter type cannot be empty. (${i.name})`);if(!(t=b(await d(i.type),a)))throw q.InvalidArgument(i.type);try{if(e=new t,l.filters&&l.filters[i.name])throw q.Duplicate(`Filter already registered. (${i.name})`);l.filters=l.filters||{},l.filters[i.name]=await e.factory()}catch(t){throw q.OperationFailed(`Filter registration failed. (${i.type})`,t)}}}return this.provide&&Array.isArray(this.provide)&&(l.provide=this.provide),this.inject&&Array.isArray(this.inject)&&(l.inject=this.inject),l}),c("protected"),this.locale=(t=>l.host().locale(t)),c("protected"),this.path=(t=>l.host().path(t)),c("protected"),this.route=((t,e)=>l.host().route(t,e)),c("protected"),this.i18n=null,c("protected"),this.style="",c("protected"),this.html="",c("protected"),this.template=null,c("protected"),this.render=null,c("protected"),this.functional=!1,c("protected"),this.computed=null,c("protected"),this.state=null,c("protected"),this.methods=null,c("protected"),this.watch=null,c("protected"),this.lifecycle=null,c("protected"),this.components=null,c("protected"),this.mixins=null,c("protected"),this.directives=null,c("protected"),this.filters=null,c("protected"),this.provide=null,c("protected"),this.inject=null})})(),await(async()=>{const{Handler:t}=B("flair.app");c("ns","flair.api"),i("RestHandler",t,function(){c("virtual"),this.get=K,c("virtual"),this.post=K,c("virtual"),this.put=K,c("virtual"),this.delete=K})})(),await(async()=>{c("ns","flair.api"),i("RestInterceptor",function(){c("virtual"),c("async"),this.run=K})})(),await(async()=>{const{Bootware:e}=B("flair.app");c("static"),c("ns","flair.app"),i("BootEngine",function(){this.start=async function(){let i=[],a=[];const n=async()=>{for(let t of Gt.boot.files)(t=rt(t))&&await d(t)},r=async()=>{for(let e of Gt.boot.preambles)(e=rt(e))&&await d(e)(t)},s=async()=>{let t=null,n=null,r=null;for(let s of Gt.boot.bootwares)(s=rt(s))&&(t=await d(s))&&"boolean"!=typeof t&&(n=b(t,e))&&(r=new n,i.push(r),r.info.isMountSpecific&&a.push(r))},o=async t=>{if(Z.isWorker){0!==a.length&&console.warn("Mount specific bootwares are not supported for worker environment. Revisit worker:flair.app->load setting.");for(let e of i)e.info.isMountSpecific||await e[t]()}else{let e=l.host().mounts,n=Object.keys(e),r="",s=null;s=e[r="main"];for(let e of i)await e[t](s);for(let i of n)if("main"!==i){s=e[i];for(let e of a)await e[t](s)}}},c=async()=>{const t=await d(Gt.host),e=await d(Gt.app);if(!Z.isWorker){let e=new t;await e.boot(),l.host(e)}await o("boot");let i=new e;await i.boot(),l.app(i)},p=async()=>{Z.isWorker||await l.host().start(),await l.app().start()},h=()=>new Promise((t,e)=>{"loading"!==document.readyState?t():(!0).document.addEventListener("DOMContentLoaded",()=>{t()})}),u=()=>new Promise((t,e)=>{(!0).document.addEventListener("deviceready",()=>{t()},!1)}),f=async()=>{Z.isClient&&!Z.isWorker&&(await h(),Z.isCordova&&await u()),Z.isWorker||await l.host().ready(),await o("ready"),await l.app().ready()};await n(),await r(),await s(),await c(),await p(),await f(),console.log("ready!")}})})(),await(async()=>{const{Host:t}=B("flair.app");c("sealed"),c("ns","flair.app"),i("ClientHost",t,function(){let t={},e=null;c("override"),this.construct=(t=>{t("Page","1.x")}),this.app={get:()=>this.mounts["main"].app,set:K},this.mounts={get:()=>t,set:K},c("state"),c("private"),this.currentLocale=Gt.client.i18n.locale,this.defaultLocale={get:()=>Gt.client.i18n.locale,set:K},this.supportedLocales={get:()=>Gt.client.i18n.locales.slice(),set:K},this.locale=((t,i)=>Gt.client.i18n.enabled?(t&&this.currentLocale!==t&&(this.currentLocale=t,i||(Gt.client.url.i18n?window.location.hash=this.replaceLocale((!0).location.hash):e&&e())),this.currentLocale):""),c("private"),this.cleanPath=(t=>("/"===t.substr(0,1)&&(t=t.substr(1)),"#!/"===t.substr(0,3)&&(t=t.substr(3)),"#!"===t.substr(0,2)&&(t=t.substr(2)),"#/"===t.substr(0,2)&&(t=t.substr(2)),"#"===t.substr(0,1)&&(t=t.substr(1)),"/"===t.substr(0,1)&&(t=t.substr(1)),t)),c("private"),this.extractLocale=(t=>{if(!Gt.client.url.i18n)return"";let e=t.indexOf("/");if(-1!==e){let i=t.substr(0,e);if(-1!==this.supportedLocales.indexOf(i))return i}return""}),c("private"),this.trimLocale=((t,e)=>{let i=e+"/",a=t.indexOf(i);return-1!==a?t.substr(a+i.length):t}),c("private"),this.replaceLocale=(t=>{if(Gt.client.url.i18n){t=this.cleanPath(t);let e=this.extractLocale(t);e&&(t=this.trimLocale(t,e)),t=this.path(t)}return t}),this.path=(t=>t?(t=this.cleanPath(t),t=Gt.client.url.hashbang?"/#!/"+t:"/#/"+t,Gt.client.i18n.enabled&&Gt.client.url.i18n&&(t=(this.currentLocale||this.defaultLocale)+"/"+t),t):""),this.route=((t,e)=>{if(!t)return;let i="",a=l.context.current().getRoute(t);if(a&&(i=a.path),i&&e){let t=i.indexOf(":"),a=-1,n="";for(;-1!==t;)n=-1===(a=i.substr(t+1).indexOf("/"))?i.substr(t+1):i.substr(t+1,a),t=(i=et(i,":"+n,e[n])).indexOf(":")}return this.path(i)}),c("override"),this.boot=(async e=>{e();const i=await d("page/page{.min}.js","page");let a=null,n="",r=null;const s=t=>{let e={},i=Gt.client.routing[`${t}-options`];if(i&&i.length>0)for(let t of i)e[t.name]=t.value;return e.click=!1,e.popstate=!1,e.dispatch=!1,e.hashbang=!1,e.decodeURLComponents=!0,e.window=!0,e};i(a=s("main"));let o=i;o.strict(a.strict),o.base("/");for(let e of Object.keys(Gt.client.routing.mounts))"main"===e?(n="/",r=o):(a=s(e),n=Gt.client.routing.mounts[e],(r=i.create(a)).strict(a.strict),r.base(n)),t[e]=Object.freeze({name:e,root:n,app:r});t=Object.freeze(t)}),c("override"),this.start=(async t=>{t(),e=(()=>{let t=this.cleanPath((!0).location.hash);if(Gt.client.i18n.enabled&&Gt.client.url.i18n){let e=this.extractLocale(t);e&&(t=this.trimLocale(t,e),this.locale(e,!0))}t=("/"!==t.substr(0,1)?"/":"")+t;let e=null,i="";for(let a of this.mounts)if(t.startsWith(a.root)){e=a.app,t=t.substr(a.root.length),i=a;break}e||(i="main",e=this.mounts[i]),"/"!==t.substr(0,1)&&(t="/"+t),setTimeout(()=>{try{e(t)}catch(t){this.error(t)}},0)})}),c("override"),this.ready=(async t=>{t(),(!0).addEventListener("hashchange",e),this.app.redirect(Gt.client.url.home),console.log(`${l.app().info.name}, v${l.app().info.version}`)}),c("override"),this.stop=(async t=>{t(),(!0).removeEventListener("hashchange",e)}),c("override"),this.dispose=(e=>{e(),t=null})})})(),await(async()=>{const{Host:t}=B("flair.app");c("sealed"),c("ns","flair.app"),i("ServerHost",t,function(){let t={},e=null,i=null,a=Gt.server.express["server-http"],n=Gt.server.express["server-https"];c("override"),this.construct=(t=>{t("Express","4.x")}),this.app={get:()=>this.mounts["main"].app,set:K},this.mounts={get:()=>t,set:K},c("override"),this.boot=(async e=>{e();const i=await d("express | x"),a=(t,e)=>{let i=Gt.server.routing[`${t}-appSettings`];if(i&&i.length>0)for(let t of i)e.set(t.name,t.value)};let n=i();a("main",n);let r="",s=null;for(let e of Object.keys(Gt.server.routing.mounts))"main"===e?(r="/",s=n):(r=Gt.server.routing.mounts[e],s=i()),t[e]=Object.freeze({name:e,root:r,app:s}),"main"!==e&&(a(e,s),n.use(r,s));t=Object.freeze(t)}),c("override"),this.start=(async t=>{t();const r=await d("fs | x"),s=await d("http | x"),o=await d("https | x"),c=await d("http-shutdown | x");if(a.enable&&((e=c(e=s.createServer(this.app))).on("error",t=>{this.error(t)}),-1!==a.timeout&&(e.timeout=a.timeout)),n.enable){const t=r.readFileSync(l.resolvePath(n.privateKey),"utf8"),e=r.readFileSync(l.resolvePath(n.publicCert),"utf8"),a={key:t,cert:e};(i=c(i=o.createServer(a,this.app))).on("error",t=>{this.error(t)}),-1!==n.timeout&&(i.timeout=n.timeout)}}),c("override"),this.ready=(t=>new Promise((r,s)=>{t();let o=a.port||80,c=process.env.PORT||n.port||443;e&&i?e.listen(o,()=>{i.listen(c,()=>{console.log(`${l.app().info.name}, v${l.app().info.version} (http: ${o}, https: ${c})`),r()})}):e?e.listen(o,()=>{console.log(`${l.app().info.name}, v${l.app().info.version} (http: ${o})`),r()}):i?i.listen(c,()=>{console.log(`${l.app().info.name}, v${l.app().info.version} (https: ${c})`),r()}):(console.log(`${l.app().info.name}, v${l.app().info.version}`),r())})),c("override"),this.stop=(async t=>{t(),e&&(console.log("http server is shutting down..."),e.shutdown(()=>{e=null,console.log("http server is cleanly shutdown!")})),i&&(console.log("https server is shutting down..."),i.shutdown(()=>{i=null,console.log("https server is cleanly shutdown!")}))}),c("override"),this.dispose=(e=>{e(),t=null})})})(),await(async()=>{const{Bootware:t}=B("flair.app");c("sealed"),c("ns","flair.boot"),i("ClientRouter",t,function(){const{ViewHandler:t,ViewInterceptor:e}=B("flair.ui");let i=null;c("override"),this.construct=(t=>{t("Client Router",!0)}),c("override"),this.boot=(async(a,n)=>{a(),i||(i=l.context.current().allRoutes(!0)).sort((t,e)=>t.indexe.index?1:0);const r=(t,e)=>new Promise((i,a)=>{try{let n;(new t).run(e).then(()=>{e.$stop?a():i()}).catch(a)}catch(t){a(t)}}),s=(t,i)=>tt(t,(t,a,n)=>{d(n).then(s=>{let o=b(s,e);o?r(o,i).then(t).catch(a):a(q.InvalidDefinition(`Invalid interceptor type. (${n})`))}).catch(a)});let o="view";for(let e of i)e.mount===n.name&&n.app(e.path,i=>{const a=t=>{l.host().raiseError(t)},r=t=>{n.app.redirect(t)},c=()=>{d(e.handler).then(n=>{let s=b(n,t);if(s)try{J(new s,t=>{t[o](i).then(()=>{i.handled=!0,i.$redirect&&r(i.$redirect)}).catch(a)})}catch(t){a(t)}else a(q.InvalidDefinition(`Invalid route handler. (${e.handler})`))}).catch(a)};i.$stop=!1,i.$redirect="";let p=Gt.client.routing[`${n.name}-interceptors`]||[];s(p,i).then(()=>{i.$stop?(i.handled=!0,i.$redirect&&r(i.$redirect)):c()}).catch(t=>{i.$stop?(i.handled=!0,i.$redirect&&r(i.$redirect)):a(t)})});n.app("*",t=>{let e=Gt.client.url["404"];e?(t.handled=!0,t.pathname!==e&&n.app.redirect(e)):(!0).history.back()})})})})(),await(async()=>{const{Bootware:t}=B("flair.app");c("sealed"),c("ns","flair.boot"),i("DIContainer",t,function(){c("override"),this.construct=(t=>{t("DI Container")}),c("override"),this.boot=(async t=>{t();let e=Gt.di.container;for(let t in e)e.hasOwnProperty(t)&&u.register(t,e[t])})})})(),await(async()=>{const{Bootware:t}=B("flair.app");c("sealed"),c("ns","flair.boot"),i("Middlewares",t,function(){c("override"),this.construct=(t=>{t("Express Middlewares",!0)}),c("override"),this.boot=(async(t,e)=>{t();let i=Gt.server.routing[`${e.name}-middlewares`];if(i&&i.length>0){let t=null,a=null;for(let n of i)if(n.name)try{t=require(n.name),a=n.func?t[n.func]:t;let i=[],r=null;n.args=n.args||[];for(let t of n.args){if("string"==typeof t&&t.startsWith("return "))r=new Function(t)();else if("object"==typeof t){for(let e in t)t.hasOwnProperty(e)&&"string"==typeof(r=t[e])&&r.startsWith("return ")&&(r=new Function(t)(),t[e]=r);r=t}else r=t;i.push(r)}e.app.use(a(...i))}catch(t){throw q.OperationFailed(`Middleware ${n.module} load failed.`,t,this.boot)}}})})})(),await(async()=>{const{Bootware:t}=B("flair.app");c("sealed"),c("ns","flair.boot"),i("NodeEnv",t,function(){c("override"),this.construct=(t=>{t("Node Server Environment")}),c("override"),this.boot=(async t=>{if(t(),Gt.server.envVars.vars.length>0){const t=await d("node-env-file | x");if(t)for(let e of Gt.server.envVars.vars)t(l.resolvePath(e),Gt.server.envVars.options)}})})})(),await(async()=>{const{Bootware:t}=B("flair.app");c("sealed"),c("ns","flair.boot"),i("ResHeaders",t,function(){c("override"),this.construct=(t=>{t("Server Response Headers",!0)}),c("override"),this.boot=(async(t,e)=>{t();let i=Gt[`${e.name}-resHeaders`];i&&i.length>0&&e.app.use((t,e,a)=>{for(let t of i)e.setHeader(t.name,t.value);a()})})})})(),await(async()=>{const{Bootware:t}=B("flair.app");c("sealed"),c("ns","flair.boot"),i("ServerRouter",t,function(){const{RestHandler:t,RestInterceptor:e}=B("flair.api");let i=null;c("override"),this.construct=(t=>{t("Server Router",!0)}),c("override"),this.boot=(async(a,n)=>{a(),i||(i=l.context.current().allRoutes(!0)).sort((t,e)=>t.indexe.index?1:0);let r=!1;const s=(t,e,i)=>new Promise((a,n)=>{try{let r;(new t).run(e,i).then(()=>{e.$stop?n():a()}).catch(n)}catch(t){n(t)}}),o=(t,i,a)=>tt(t,(t,n,r)=>{d(r).then(o=>{let l=b(o,e);l?s(l,i,a).then(t).catch(n):n(q.InvalidDefinition(`Invalid interceptor type. (${r})`))}).catch(n)});for(let e of i)e.mount===n.name&&e.verbs.forEach(i=>{n.app[i](e.path,(a,s,l)=>{const c=t=>{l(t)},p=t=>{t||l()},h=()=>{d(e.handler).then(n=>{let o=b(n,t);if(o)try{J(new o,t=>{(r=t[i](a,s))&&"function"==typeof r.then?r.then(t=>{p(t)}).catch(c):p(r)})}catch(t){c(t)}else c(q.InvalidDefinition(`Invalid route handler. ${e.handler}`))}).catch(c)};a.$stop=!1;let u=Gt.server.routing[`${n.name}-interceptors`]||[];o(u,a,s).then(()=>{a.$stop?s.end():h()}).catch(t=>{a.stop?s.end():c(t)})})});n.app.use((t,e,i)=>{var a=new Error("Not Found");a.status=404,i(a)}),Z.isProd,n.app.use((t,e,i)=>{i.status(t.status||500),e.xhr?i.status(500).send({error:t.toString()}):i.render("error",{message:t.message,error:t}),i.end()})})})})(),await(async()=>{const{Handler:t}=B("flair.app");c("ns","flair.ui"),i("ViewHandler",t,function(){let t="";c("override"),this.construct=((e,i,a,n)=>{e(),t=i||"main",this.viewTransition=n,this.title=this.title+(a?" - "+a:"")}),c("privateSet"),this.viewTransition="",c("protectedSet"),this.name="",c("protectedSet"),this.title="",c("protectedSet"),this.meta=null,this.view=(async e=>{const{ViewTransition:i}=B("flair.ui");if(this.name=this.name||this.$self.id+"_"+st(),this.viewTransition){let t=b(await d(this.viewTransition),i);this.viewTransition=t?new t:""}let a=Jt.createElement("div"),n=Jt.getElementById(t);a.id=this.name,a.setAttribute("hidden",""),n.appendChild(a),this.load(e,a),await this.swap()}),c("protected"),c("virtual"),c("async"),this.loadView=K,c("private"),this.swap=(async()=>{let e=Jt.getElementById(this.name);if(this.$static.currentView){let i=Jt.getElementById(this.$static.currentView),a;for(let t of this.meta)Jt.head.removeChild(Jt.querySelector('meta[name="'+t+'"]'));this.viewTransition?(await this.viewTransition.leave(i,e),await this.viewTransition.enter(e,i)):(i.hidden=!0,e.hidden=!1),Jt.getElementById(t).removeChild(i)}for(let t of this.meta){var i=document.createElement("meta");for(let e in t)i[e]=t[e];Jt.head.appendChild(i)}this.$static.currentView||(e.hidden=!1),Jt.title=this.title,this.$static.currentView=this.name,this.$static.currentViewMeta=this.meta}),c("static"),this.currentView="",c("static"),this.currentViewMeta=[]})})(),await(async()=>{c("ns","flair.ui"),i("ViewInterceptor",function(){c("virtual"),c("async"),this.run=K})})(),await(async()=>{c("singleton"),c("ns","flair.ui"),i("ViewState",function(){c("state"),c("private"),this.store={},this.get=((t,e)=>(t=t||"",e=e||"",this.store[t+"/"+e]||null)),this.set=((t,e,i)=>{t=t||"",e=e||"","boolean"==typeof i||i?this.store[t+"/"+e]=i:delete this.store[t+"/"+e]}),this.clear=(()=>{this.store=null})})})(),await(async()=>{c("ns","flair.ui"),i("ViewTransition",function(){c("virtual"),c("async"),this.enter=K,c("virtual"),c("async"),this.leave=K})})(),await(async()=>{const{VueComponentMembers:t}=B("flair.ui.vue");c("ns","flair.ui.vue"),i("VueComponent",[t],function(){this.factory=(async()=>{let t=this.define();return this.props&&Array.isArray(this.props)&&(t.props=this.props),this.data&&"function"==typeof this.data&&(t.data=this.data),this.name&&(t.name=this.name),this.model&&(t.model=this.model),"boolean"==typeof this.inheritAttrs&&(t.inheritAttrs=this.inheritAttrs),t}),c("protected"),this.props=null,c("protected"),this.data=null,c("protected"),this.model=null,c("protected"),this.inheritAttrs=null})})(),await(async()=>{c("ns","flair.ui.vue"),i("VueDirective",function(){c("virtual"),c("async"),this.factory=K})})(),await(async()=>{c("ns","flair.ui.vue"),i("VueFilter",function(){c("virtual"),c("async"),this.factory=K})})(),await(async()=>{c("ns","flair.ui.vue"),i("VueLayout",function(){c("protected"),this.html="",c("protected"),this.style="",c("protected"),this.viewArea="view",c("protectedSet"),this.areas=[],this.merge=(async t=>{let e=f("clientFile");this.style&&this.style.endsWith(".css")&&(this.style=await e(this.style)),this.html&&this.html.endsWith(".html")&&(this.html=await e(this.html));let i=Jt.createElement("div");if(this.style){let t=Jt.createElement("style");t.innerHTML=this.style.trim(),t.setAttribute("scoped",""),i.append(t)}if(this.html){let t=Jt.createElement("div");t.innerHTML=this.html.trim(),i.append(t)}this.viewArea=this.viewArea||"view";let a=i.content.getElementById(this.viewArea);a&&(a.innerHTML=t);let n=null;if(this.layout&&this.layout.areas&&Array.isArray(this.layout.areas))for(let t of this.layout.areas)if(n=i.content.getElementById(t.area)){let e=Jt.createElement("component");e.setAttribute("is",t.component),n.append(e)}return i.innerHTML})})})(),await(async()=>{c("ns","flair.ui.vue"),i("VueMixin",function(){c("virtual"),c("async"),this.factory=K})})(),await(async()=>{c("ns","flair.ui.vue"),i("VuePlugin",function(){this.construct=(t=>{Gt.client.vue.pluginOptions[t]&&(this.options=Object.assign({},Gt.client.vue.pluginOptions[t]))}),c("virtual"),c("async"),this.factory=K,this.options=null})})(),await(async()=>{const{Bootware:t}=B("flair.app");c("ns","flair.ui.vue"),i("VueSetup",t,function(){c("override"),this.construct=(t=>{t("Vue Setup")}),c("override"),this.boot=(async t=>{t();const e=await d("vue/vue{.min}.js"),{VueComponent:i,VueFilter:a,VueDirective:n,VuePlugin:r,VueMixin:s}=B("flair.ui.vue");let o=Gt.client.vue.plugins,l=null,c=null;for(let t of o){if(!t.name)throw q.OperationFailed(`Plugin name cannot be empty. (${t.type})`);if(!t.type)throw q.OperationFailed(`Plugin type cannot be empty. (${t.name})`);if(!(l=b(await d(t.type),r)))throw q.InvalidArgument(t.type);try{c=new l(t.name),e.use(await c.factory(),c.options||{})}catch(e){throw q.OperationFailed(`Plugin registration failed. (${t.type})`,e)}}let p=Gt.client.vue.mixins,h=null,u=null;for(let t of p){if(!t.name)throw q.OperationFailed(`Mixin name cannot be empty. (${t.type})`);if(!t.type)throw q.OperationFailed(`Mixin type cannot be empty. (${t.name})`);if(!(h=b(await d(t.type),s)))throw q.InvalidArgument(t.type);try{u=new h,e.mixin(await u.factory())}catch(e){throw q.OperationFailed(`Mixin registration failed. (${t.type})`,e)}}let f=Gt.client.vue.directives,m=null,y=null;for(let t of f){if(!t.name)throw q.OperationFailed(`Directive name cannot be empty. (${t.type})`);if(!t.type)throw q.OperationFailed(`Directive type cannot be empty. (${t.name})`);if(!(m=b(await d(t.type),n)))throw q.InvalidArgument(t.type);try{y=new m,e.directive(t.name,await y.factory())}catch(e){throw q.OperationFailed(`Directive registration failed. (${t.type})`,e)}}let v=Gt.client.vue.filters,w=null,g=null;for(let t of v){if(!t.name)throw q.OperationFailed(`Filter name cannot be empty. (${t.type})`);if(!t.type)throw q.OperationFailed(`Filter type cannot be empty. (${t.name})`);if(!(w=b(await d(t.type),a)))throw q.InvalidArgument(t.type);try{g=new w,e.filter(t.name,await g.factory())}catch(e){throw q.OperationFailed(`Filter registration failed. (${t.type})`,e)}}let $=Gt.client.vue.components,x=null,O=null;for(let t of $){if(!t.name)throw q.OperationFailed(`Component name cannot be empty. (${t.type})`);if(!t.type)throw q.OperationFailed(`Component type cannot be empty. (${t.name})`);if(!(x=b(await d(t.name),i)))throw q.InvalidArgument(t.type);try{if(O=new x,e.options.components[t.name])throw q.Duplicate(`Component already registered. (${t.name})`);e.component(t.name,await O.factory())}catch(e){throw q.OperationFailed(`Component registration failed. (${t.type})`,e)}}})})})(),await(async()=>{const{ViewHandler:t}=B("flair.ui"),{VueComponentMembers:e}=B("flair.ui.vue");c("ns","flair.ui.vue"),i("VueView",t,[e],function(){let t=!1;c("override"),this.construct=(t=>{t(Gt.client.view.el,Gt.client.view.title,Gt.client.view.transition)}),c("private"),this.factory=(async()=>{if(this.layout&&this.layout.areas&&Array.isArray(this.layout.areas)){this.components=this.components||[];for(let t of this.layout.areas)this.components.push({name:t.component,type:t.type})}let t=this.define();return t.el="#"+this.name,this.propsData&&(t.propsData=this.propsData),this.data&&"function"!=typeof this.data&&(t.data=this.data),this.layout&&(t.template=await this.layout.merge(t.template)),t}),c("protected"),c("override"),c("sealed"),this.loadView=(async(e,i,a)=>{if(!t){t=!0,e();const n=await d("vue/vue{.min}.js");await this.load(i,a),new n(await this.factory())}}),c("protected"),c("virtual"),c("async"),this.load=K,c("protected"),this.el=null,c("protected"),this.propsData=null,c("protected"),this.data=null,c("protected"),this.layout=null})})(),l.context.current().currentAssemblyBeingLoaded(""),l.registerAdo('{"name":"flair.app","file":"./flair.app{.min}.js","mainAssembly":"flair","desc":"True Object Oriented JavaScript","title":"Flair.js","version":"0.6.82","lupdate":"Mon, 13 May 2019 19:15:31 GMT","builder":{"name":"flairBuild","version":"1","format":"fasm","formatVersion":"1","contains":["init","func","type","vars","reso","asst","rout","sreg"]},"copyright":"(c) 2017-2019 Vikas Burman","license":"MIT","types":["flair.app.Bootware","flair.app.Handler","flair.app.App","flair.app.Host","flair.ui.vue.VueComponentMembers","flair.api.RestHandler","flair.api.RestInterceptor","flair.app.BootEngine","flair.app.ClientHost","flair.app.ServerHost","flair.boot.ClientRouter","flair.boot.DIContainer","flair.boot.Middlewares","flair.boot.NodeEnv","flair.boot.ResHeaders","flair.boot.ServerRouter","flair.ui.ViewHandler","flair.ui.ViewInterceptor","flair.ui.ViewState","flair.ui.ViewTransition","flair.ui.vue.VueComponent","flair.ui.vue.VueDirective","flair.ui.vue.VueFilter","flair.ui.vue.VueLayout","flair.ui.vue.VueMixin","flair.ui.vue.VuePlugin","flair.ui.vue.VueSetup","flair.ui.vue.VueView"],"resources":[],"assets":[],"routes":[]}'),Object.freeze({name:"flair.app",settings:Gt,config:Qt})});
\ No newline at end of file
+!function(t,e){"use strict";"function"==typeof!0&&(!0).amd?(!0)(e):"object"==typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=e),module.exports=exports=e):t["flair.app"]=e}(this,async function(t,e){"use strict";const{Class:i,Struct:a,Enum:n,Interface:r,Mixin:s,Aspects:o,AppDomain:l,$$:c,attr:p,bring:h,Container:u,include:d,Port:f,on:m,post:y,telemetry:v,Reflector:w,Serializer:g,Tasks:$,as:b,is:x,isComplies:O,isDerivedFrom:V,isAbstract:A,isSealed:S,isStatic:F,isSingleton:I,isDeprecated:C,isImplements:E,isInstanceOf:M,isMixed:D,getAssembly:P,getAttr:L,getContext:H,getResource:j,getRoute:R,getType:T,ns:B,getTypeOf:k,getTypeName:W,typeOf:z,dispose:N,using:J,Args:U,Exception:q,noop:K,nip:G,nim:_,nie:Q,event:X}=t,{TaskInfo:Y}=t.Tasks,{env:Z}=t.options,{forEachAsync:tt,replaceAll:et,splitAndTrim:it,findIndexByProp:at,findItemByProp:nt,which:rt,guid:st,isArrowFunc:ot,isASyncFunc:lt,sieve:ct,deepMerge:pt,getLoadedScript:ht,b64EncodeUnicode:ut,b64DecodeUnicode:dt}=t.utils,{$$static:ft,$$abstract:mt,$$virtual:yt,$$override:vt,$$sealed:wt,$$private:gt,$$privateSet:$t,$$protected:bt,$$protectedSet:xt,$$readonly:Ot,$$async:Vt,$$overload:At,$$enumerate:St,$$dispose:Ft,$$post:It,$$on:Ct,$$timer:Et,$$type:Mt,$$args:Dt,$$inject:Pt,$$resource:Lt,$$asset:Ht,$$singleton:jt,$$serialize:Rt,$$deprecate:Tt,$$session:Bt,$$state:kt,$$conditional:Wt,$$noserialize:zt,$$ns:Nt}=c,Jt=Z.isServer||Z.isWorker?null:(!0).document,Ut=l.context.current().name,qt=e,Kt=qt.substr(0,qt.lastIndexOf("/")+1);l.loadPathOf("flair.app",Kt);let Gt=JSON.parse('{"host":"flair.app.ServerHost | flair.app.ClientHost","app":"flair.app.App","boot":{"files":[],"preambles":[],"bootwares":[]},"di":{"container":{}},"client":{"view":{"el":"main","title":"","transition":""},"url":{"404":"/404","hashbang":false,"i18n":false,"home":"/"},"vue":{"components":[],"filters":[],"mixins":[],"directives":[],"plugins":[],"pluginOptions":{}},"i18n":{"enabled":true,"locale":"en","locales":[{"code":"en","name":"English","native":"English"}]},"routing":{"mounts":{"main":"/"},"main-options":[],"main-interceptors":[]}},"server":{"express":{"server-http":{"enable":false,"port":80,"timeout":-1},"server-https":{"enable":false,"port":443,"timeout":-1,"privateKey":"","publicCert":""}},"envVars":{"vars":[],"options":{"overwrite":true}},"routing":{"mounts":{"main":"/"},"main-appSettings":[],"main-middlewares":[],"main-interceptors":[],"main-resHeaders":[]}}}'),_t=t.Port("settingsReader");if("function"==typeof _t){let t=_t("flair.app");t&&(Gt=pt([Gt,t],!1))}Gt=Object.freeze(Gt);let Qt=JSON.parse("{}");Qt=Object.freeze(Qt);let Xt=()=>{};return l.context.current().currentAssemblyBeingLoaded("./flair.app{.min}.js"),await(async()=>{c("abstract"),c("ns","flair.app"),i("Bootware",function(){c("virtual"),this.construct=((t,e,i)=>{let a=U("name: string, version: string","name: string, version: string, isMountSpecific: boolean","name: string, isMountSpecific: boolean","name: string")(t,e,i);a.throwOnError(this.construct),this.info=Object.freeze({name:a.values.name||"",version:a.values.version||"",isMountSpecific:a.values.isMountSpecific||!1})}),c("virtual"),c("async"),this.boot=K,c("readonly"),this.info=null,c("virtual"),c("async"),this.ready=K,c("virtual"),this.dispose=K})})(),await(async()=>{const{IDisposable:t}=B();c("ns","flair.app"),i("Handler",[t],function(){c("virtual"),this.construct=(()=>{}),c("virtual"),this.dispose=(()=>{})})})(),await(async()=>{const{IDisposable:t}=B(),{Bootware:e}=B("flair.app");c("ns","flair.app"),i("App",e,[t],function(){c("override"),this.construct=(t=>{let e=P(this);t(e.title,e.version)}),c("override"),c("sealed"),this.boot=(async t=>{t(),l.host().error.add(this.handleError)}),this.start=(async()=>{if(!Z.isServer&&!Z.isWorker){const{ViewState:t}=B("flair.ui");new t}await this.onStart()}),c("virtual"),c("async"),this.onStart=K,c("override"),c("sealed"),this.ready=(async()=>{await this.onReady()}),c("virtual"),c("async"),this.onReady=K,this.stop=(async()=>{if(!Z.isServer&&!Z.isWorker){const{ViewState:t}=B("flair.ui");(new t).clear()}await this.onStop()}),c("virtual"),c("async"),this.onStop=K,c("private"),this.handleError=(t=>{this.onError(t.error)}),c("virtual"),this.onError=(t=>{throw q.OperationFailed(t,this.onError)}),c("override"),this.dispose=(t=>{t(),l.host().error.remove(this.handleError)})})})(),await(async()=>{const{IDisposable:t}=B(),{Bootware:e}=B("flair.app");c("ns","flair.app"),i("Host",e,[t],function(){c("virtual"),c("async"),this.start=K,c("virtual"),c("async"),this.stop=K,this.error=X(t=>({error:t})),this.raiseError=(t=>{this.error(t)})})})(),await(async()=>{c("ns","flair.ui.vue"),s("VueComponentMembers",function(){var t=this;c("private"),this.define=(async()=>{const e=await d("vue/vue{.min}.js"),{ViewState:i}=B("flair.ui"),{VueFilter:a,VueMixin:n,VueDirective:r,VueComponent:s}=B("flair.ui.vue");let o=new i,l={},c=f("clientFile");if(this.style&&this.style.endsWith(".css")&&(this.style=await c(this.style)),this.html&&this.html.endsWith(".html")&&(this.html=await c(this.html)),Gt.client.i18n.enabled&&this.i18n){let t="";for(let e in this.i18n)this.i18n.hasOwnProperty(e)&&(t=this.$self.assemblyName+"/locales/"+this.locale()+"/"+this.i18n[e],this.i18n[e]=await c(t))}if(this.template?l.template=this.template:this.style&&this.html?l.template="":this.html&&(l.template=this.html.trim()),this.render&&"function"==typeof this.render&&(l.render=this.render),"boolean"==typeof this.functional&&(l.functional=this.functional),this.computed)for(let t in this.computed)this.computed.hasOwnProperty(t)&&(l.computed=l.computed||{},l.computed[t]=this.computed[t]);if(this.state&&Array.isArray(this.state))for(let t of this.state){if(l.computed[t.name])throw q.InvalidDefinition(`Computed (state) property already defined. (${t.name})`);l.computed=l.computed||{},l.computed[t.name]={get:function(){return o.get(t.path,t.name)||t.value},set:function(e){o.set(t.path,t.name,e)}}}if(this.methods)for(let t in this.methods)this.methods.hasOwnProperty(t)&&(l.methods=l.methods||{},l.methods[t]=this.methods[t]);if(l.methods=l.methods||{},l.methods["path"]=(e=>t.path(e)),l.methods=l.methods||{},l.methods["route"]=((e,i)=>t.route(e,i)),Gt.client.i18n.enabled&&(l.methods["locale"]=(e=>t.locale(e)),l.methods["i18n"]=((e,i,a)=>t.i18n&&t.i18n[e]&&t.i18n[e][i]?t.i18n[e][i]||a||"(i18n: 404)":a||"(i18n: 404)")),this.watch)for(let t in this.watch)this.watch.hasOwnProperty(t)&&(l.watch=l.watch||{},l.watch[t]=this.watch[t]);if(this.lifecycle)for(let t in this.lifecycle)this.lifecycle.hasOwnProperty(t)&&(l[t]=this.lifecycle[t]);if(this.components&&Array.isArray(this.components)){let t=null,i=null;for(let a of this.components){if(!a.name)throw q.OperationFailed(`Component name cannot be empty. (${a.type})`);if(!a.type)throw q.OperationFailed(`Component type cannot be empty. (${a.name})`);if(!(t=b(await d(a.name),s)))throw q.InvalidArgument(a.type);try{if(i=new t,e.options.components[a.name])throw q.Duplicate(`Component already registered. (${a.name})`);if(i.components&&i.components[a.name])throw q.Duplicate(`Component already registered. (${a.name})`);i.components=i.components||{},i.components[a.name]=await i.factory()}catch(t){throw q.OperationFailed(`Component registration failed. (${a.type})`,t)}}}if(this.mixins&&Array.isArray(this.mixins)){let t=null,e=null;for(let i of this.mixins){if(!i.name)throw q.OperationFailed(`Mixin name cannot be empty. (${i.type})`);if(!i.type)throw q.OperationFailed(`Mixin type cannot be empty. (${i.name})`);if(!(t=b(await d(i.type),n)))throw q.InvalidArgument(i.type);try{if(e=new t,l.mixins&&l.mixins[i.name])throw q.Duplicate(`Mixin already registered. (${i.name})`);l.mixins=l.mixins||{},l.mixins[i.name]=await e.factory()}catch(t){throw q.OperationFailed(`Mixin registration failed. (${i.type})`,t)}}}if(this.directives&&Array.isArray(this.directives)){let t=null,e=null;for(let i of this.directives){if(!i.name)throw q.OperationFailed(`Directive name cannot be empty. (${i.type})`);if(!i.type)throw q.OperationFailed(`Directive type cannot be empty. (${i.name})`);if(!(t=b(await d(i.type),r)))throw q.InvalidArgument(i.type);try{if(e=new t,l.directives&&l.directives[i.name])throw q.Duplicate(`Directive already registered. (${i.name})`);l.directives=l.directives||{},l.directives[i.name]=await e.factory()}catch(t){throw q.OperationFailed(`Directive registration failed. (${i.type})`,t)}}}if(this.filters&&Array.isArray(this.filters)){let t=null,e=null;for(let i of this.filters){if(!i.name)throw q.OperationFailed(`Filter name cannot be empty. (${i.type})`);if(!i.type)throw q.OperationFailed(`Filter type cannot be empty. (${i.name})`);if(!(t=b(await d(i.type),a)))throw q.InvalidArgument(i.type);try{if(e=new t,l.filters&&l.filters[i.name])throw q.Duplicate(`Filter already registered. (${i.name})`);l.filters=l.filters||{},l.filters[i.name]=await e.factory()}catch(t){throw q.OperationFailed(`Filter registration failed. (${i.type})`,t)}}}return this.provide&&Array.isArray(this.provide)&&(l.provide=this.provide),this.inject&&Array.isArray(this.inject)&&(l.inject=this.inject),l}),c("protected"),this.locale=(t=>l.host().locale(t)),c("protected"),this.path=(t=>l.host().path(t)),c("protected"),this.route=((t,e)=>l.host().route(t,e)),c("protected"),this.i18n=null,c("protected"),this.style="",c("protected"),this.html="",c("protected"),this.template=null,c("protected"),this.render=null,c("protected"),this.functional=!1,c("protected"),this.computed=null,c("protected"),this.state=null,c("protected"),this.methods=null,c("protected"),this.watch=null,c("protected"),this.lifecycle=null,c("protected"),this.components=null,c("protected"),this.mixins=null,c("protected"),this.directives=null,c("protected"),this.filters=null,c("protected"),this.provide=null,c("protected"),this.inject=null})})(),await(async()=>{const{Handler:t}=B("flair.app");c("ns","flair.api"),i("RestHandler",t,function(){c("virtual"),this.get=K,c("virtual"),this.post=K,c("virtual"),this.put=K,c("virtual"),this.delete=K})})(),await(async()=>{c("ns","flair.api"),i("RestInterceptor",function(){c("virtual"),c("async"),this.run=K})})(),await(async()=>{const{Bootware:e}=B("flair.app");c("static"),c("ns","flair.app"),i("BootEngine",function(){this.start=async function(){let i=[],a=[];const n=async()=>{for(let t of Gt.boot.files)(t=rt(t))&&await d(t)},r=async()=>{let e=null;for(let i of Gt.boot.preambles)(i=rt(i))&&(e=await d(i))(t)},s=async()=>{let t=null,n=null,r=null;for(let s of Gt.boot.bootwares)(s=rt(s))&&(t=await d(s))&&"boolean"!=typeof t&&(n=b(t,e))&&(r=new n,i.push(r),r.info.isMountSpecific&&a.push(r))},o=async t=>{if(Z.isWorker){0!==a.length&&console.warn("Mount specific bootwares are not supported for worker environment. Revisit worker:flair.app->load setting.");for(let e of i)e.info.isMountSpecific||await e[t]()}else{let e=l.host().mounts,n=Object.keys(e),r="",s=null;s=e[r="main"];for(let e of i)await e[t](s);for(let i of n)if("main"!==i){s=e[i];for(let e of a)await e[t](s)}}},c=async()=>{const t=await d(Gt.host),e=await d(Gt.app);if(!Z.isWorker){let e=new t;await e.boot(),l.host(e)}await o("boot");let i=new e;await i.boot(),l.app(i)},p=async()=>{Z.isWorker||await l.host().start(),await l.app().start()},h=()=>new Promise((t,e)=>{"loading"!==document.readyState?t():(!0).document.addEventListener("DOMContentLoaded",()=>{t()})}),u=()=>new Promise((t,e)=>{(!0).document.addEventListener("deviceready",()=>{t()},!1)}),f=async()=>{Z.isClient&&!Z.isWorker&&(await h(),Z.isCordova&&await u()),Z.isWorker||await l.host().ready(),await o("ready"),await l.app().ready()};await n(),await r(),await s(),await c(),await p(),await f(),console.log("ready!")}})})(),await(async()=>{const{Host:t}=B("flair.app");c("sealed"),c("ns","flair.app"),i("ClientHost",t,function(){let t={},e=null;c("override"),this.construct=(t=>{t("Page","1.x")}),this.app={get:()=>this.mounts["main"].app,set:K},this.mounts={get:()=>t,set:K},c("state"),c("private"),this.currentLocale=Gt.client.i18n.locale,this.defaultLocale={get:()=>Gt.client.i18n.locale,set:K},this.supportedLocales={get:()=>Gt.client.i18n.locales.slice(),set:K},this.locale=((t,i)=>Gt.client.i18n.enabled?(t&&this.currentLocale!==t&&(this.currentLocale=t,i||(Gt.client.url.i18n?window.location.hash=this.replaceLocale((!0).location.hash):e&&e())),this.currentLocale):""),c("private"),this.cleanPath=(t=>("/"===t.substr(0,1)&&(t=t.substr(1)),"#!/"===t.substr(0,3)&&(t=t.substr(3)),"#!"===t.substr(0,2)&&(t=t.substr(2)),"#/"===t.substr(0,2)&&(t=t.substr(2)),"#"===t.substr(0,1)&&(t=t.substr(1)),"/"===t.substr(0,1)&&(t=t.substr(1)),t)),c("private"),this.extractLocale=(t=>{if(!Gt.client.url.i18n)return"";let e=t.indexOf("/");if(-1!==e){let i=t.substr(0,e);if(-1!==this.supportedLocales.indexOf(i))return i}return""}),c("private"),this.trimLocale=((t,e)=>{let i=e+"/",a=t.indexOf(i);return-1!==a?t.substr(a+i.length):t}),c("private"),this.replaceLocale=(t=>{if(Gt.client.url.i18n){t=this.cleanPath(t);let e=this.extractLocale(t);e&&(t=this.trimLocale(t,e)),t=this.path(t)}return t}),this.path=(t=>t?(t=this.cleanPath(t),t=Gt.client.url.hashbang?"/#!/"+t:"/#/"+t,Gt.client.i18n.enabled&&Gt.client.url.i18n&&(t=(this.currentLocale||this.defaultLocale)+"/"+t),t):""),this.route=((t,e)=>{if(!t)return;let i="",a=l.context.current().getRoute(t);if(a&&(i=a.path),i&&e){let t=i.indexOf(":"),a=-1,n="";for(;-1!==t;)n=-1===(a=i.substr(t+1).indexOf("/"))?i.substr(t+1):i.substr(t+1,a),t=(i=et(i,":"+n,e[n])).indexOf(":")}return this.path(i)}),c("override"),this.boot=(async e=>{e();const i=await d("page/page{.min}.js","page");let a=null,n="",r=null;const s=t=>{let e={},i=Gt.client.routing[`${t}-options`];if(i&&i.length>0)for(let t of i)e[t.name]=t.value;return e.click=!1,e.popstate=!1,e.dispatch=!1,e.hashbang=!1,e.decodeURLComponents=!0,e.window=!0,e};i(a=s("main"));let o=i;o.strict(a.strict),o.base("/");for(let e of Object.keys(Gt.client.routing.mounts))"main"===e?(n="/",r=o):(a=s(e),n=Gt.client.routing.mounts[e],(r=i.create(a)).strict(a.strict),r.base(n)),t[e]=Object.freeze({name:e,root:n,app:r});t=Object.freeze(t)}),c("override"),this.start=(async t=>{t(),e=(()=>{let t=this.cleanPath((!0).location.hash);if(Gt.client.i18n.enabled&&Gt.client.url.i18n){let e=this.extractLocale(t);e&&(t=this.trimLocale(t,e),this.locale(e,!0))}t=("/"!==t.substr(0,1)?"/":"")+t;let e=null,i="";for(let a of this.mounts)if(t.startsWith(a.root)){e=a.app,t=t.substr(a.root.length),i=a;break}e||(i="main",e=this.mounts[i]),"/"!==t.substr(0,1)&&(t="/"+t),setTimeout(()=>{try{e(t)}catch(t){this.error(t)}},0)})}),c("override"),this.ready=(async t=>{t(),(!0).addEventListener("hashchange",e),this.app.redirect(Gt.client.url.home),console.log(`${l.app().info.name}, v${l.app().info.version}`)}),c("override"),this.stop=(async t=>{t(),(!0).removeEventListener("hashchange",e)}),c("override"),this.dispose=(e=>{e(),t=null})})})(),await(async()=>{const{Host:t}=B("flair.app");c("sealed"),c("ns","flair.app"),i("ServerHost",t,function(){let t={},e=null,i=null,a=Gt.server.express["server-http"],n=Gt.server.express["server-https"];c("override"),this.construct=(t=>{t("Express","4.x")}),this.app={get:()=>this.mounts["main"].app,set:K},this.mounts={get:()=>t,set:K},c("override"),this.boot=(async e=>{e();const i=await d("express | x"),a=(t,e)=>{let i=Gt.server.routing[`${t}-appSettings`];if(i&&i.length>0)for(let t of i)e.set(t.name,t.value)};let n=i();a("main",n);let r="",s=null;for(let e of Object.keys(Gt.server.routing.mounts))"main"===e?(r="/",s=n):(r=Gt.server.routing.mounts[e],s=i()),t[e]=Object.freeze({name:e,root:r,app:s}),"main"!==e&&(a(e,s),n.use(r,s));t=Object.freeze(t)}),c("override"),this.start=(async t=>{t();const r=await d("fs | x"),s=await d("http | x"),o=await d("https | x"),c=await d("http-shutdown | x");if(a.enable&&((e=c(e=s.createServer(this.app))).on("error",t=>{this.error(t)}),-1!==a.timeout&&(e.timeout=a.timeout)),n.enable){const t=r.readFileSync(l.resolvePath(n.privateKey),"utf8"),e=r.readFileSync(l.resolvePath(n.publicCert),"utf8"),a={key:t,cert:e};(i=c(i=o.createServer(a,this.app))).on("error",t=>{this.error(t)}),-1!==n.timeout&&(i.timeout=n.timeout)}}),c("override"),this.ready=(t=>new Promise((r,s)=>{t();let o=a.port||80,c=process.env.PORT||n.port||443;e&&i?e.listen(o,()=>{i.listen(c,()=>{console.log(`${l.app().info.name}, v${l.app().info.version} (http: ${o}, https: ${c})`),r()})}):e?e.listen(o,()=>{console.log(`${l.app().info.name}, v${l.app().info.version} (http: ${o})`),r()}):i?i.listen(c,()=>{console.log(`${l.app().info.name}, v${l.app().info.version} (https: ${c})`),r()}):(console.log(`${l.app().info.name}, v${l.app().info.version}`),r())})),c("override"),this.stop=(async t=>{t(),e&&(console.log("http server is shutting down..."),e.shutdown(()=>{e=null,console.log("http server is cleanly shutdown!")})),i&&(console.log("https server is shutting down..."),i.shutdown(()=>{i=null,console.log("https server is cleanly shutdown!")}))}),c("override"),this.dispose=(e=>{e(),t=null})})})(),await(async()=>{const{Bootware:t}=B("flair.app");c("sealed"),c("ns","flair.boot"),i("ClientRouter",t,function(){const{ViewHandler:t,ViewInterceptor:e}=B("flair.ui");let i=null;c("override"),this.construct=(t=>{t("Client Router",!0)}),c("override"),this.boot=(async(a,n)=>{a(),i||(i=l.context.current().allRoutes(!0)).sort((t,e)=>t.indexe.index?1:0);const r=(t,e)=>new Promise((i,a)=>{try{let n;(new t).run(e).then(()=>{e.$stop?a():i()}).catch(a)}catch(t){a(t)}}),s=(t,i)=>tt(t,(t,a,n)=>{d(n).then(s=>{let o=b(s,e);o?r(o,i).then(t).catch(a):a(q.InvalidDefinition(`Invalid interceptor type. (${n})`))}).catch(a)});let o="view";for(let e of i)e.mount===n.name&&n.app(e.path,i=>{const a=t=>{l.host().raiseError(t)},r=t=>{n.app.redirect(t)},c=()=>{d(e.handler).then(n=>{let s=b(n,t);if(s)try{J(new s,t=>{t[o](i).then(()=>{i.handled=!0,i.$redirect&&r(i.$redirect)}).catch(a)})}catch(t){a(t)}else a(q.InvalidDefinition(`Invalid route handler. (${e.handler})`))}).catch(a)};i.$stop=!1,i.$redirect="";let p=Gt.client.routing[`${n.name}-interceptors`]||[];s(p,i).then(()=>{i.$stop?(i.handled=!0,i.$redirect&&r(i.$redirect)):c()}).catch(t=>{i.$stop?(i.handled=!0,i.$redirect&&r(i.$redirect)):a(t)})});n.app("*",t=>{let e=Gt.client.url["404"];e?(t.handled=!0,t.pathname!==e&&n.app.redirect(e)):(!0).history.back()})})})})(),await(async()=>{const{Bootware:t}=B("flair.app");c("sealed"),c("ns","flair.boot"),i("DIContainer",t,function(){c("override"),this.construct=(t=>{t("DI Container")}),c("override"),this.boot=(async t=>{t();let e=Gt.di.container;for(let t in e)e.hasOwnProperty(t)&&u.register(t,e[t])})})})(),await(async()=>{const{Bootware:t}=B("flair.app");c("sealed"),c("ns","flair.boot"),i("Middlewares",t,function(){c("override"),this.construct=(t=>{t("Express Middlewares",!0)}),c("override"),this.boot=(async(t,e)=>{t();let i=Gt.server.routing[`${e.name}-middlewares`];if(i&&i.length>0){let t=null,a=null;for(let n of i)if(n.name)try{t=require(n.name),a=n.func?t[n.func]:t;let i=[],r=null;n.args=n.args||[];for(let t of n.args){if("string"==typeof t&&t.startsWith("return "))r=new Function(t)();else if("object"==typeof t){for(let e in t)t.hasOwnProperty(e)&&"string"==typeof(r=t[e])&&r.startsWith("return ")&&(r=new Function(t)(),t[e]=r);r=t}else r=t;i.push(r)}e.app.use(a(...i))}catch(t){throw q.OperationFailed(`Middleware ${n.module} load failed.`,t,this.boot)}}})})})(),await(async()=>{const{Bootware:t}=B("flair.app");c("sealed"),c("ns","flair.boot"),i("NodeEnv",t,function(){c("override"),this.construct=(t=>{t("Node Server Environment")}),c("override"),this.boot=(async t=>{if(t(),Gt.server.envVars.vars.length>0){const t=await d("node-env-file | x");if(t)for(let e of Gt.server.envVars.vars)t(l.resolvePath(e),Gt.server.envVars.options)}})})})(),await(async()=>{const{Bootware:t}=B("flair.app");c("sealed"),c("ns","flair.boot"),i("ResHeaders",t,function(){c("override"),this.construct=(t=>{t("Server Response Headers",!0)}),c("override"),this.boot=(async(t,e)=>{t();let i=Gt[`${e.name}-resHeaders`];i&&i.length>0&&e.app.use((t,e,a)=>{for(let t of i)e.setHeader(t.name,t.value);a()})})})})(),await(async()=>{const{Bootware:t}=B("flair.app");c("sealed"),c("ns","flair.boot"),i("ServerRouter",t,function(){const{RestHandler:t,RestInterceptor:e}=B("flair.api");let i=null;c("override"),this.construct=(t=>{t("Server Router",!0)}),c("override"),this.boot=(async(a,n)=>{a(),i||(i=l.context.current().allRoutes(!0)).sort((t,e)=>t.indexe.index?1:0);let r=!1;const s=(t,e,i)=>new Promise((a,n)=>{try{let r;(new t).run(e,i).then(()=>{e.$stop?n():a()}).catch(n)}catch(t){n(t)}}),o=(t,i,a)=>tt(t,(t,n,r)=>{d(r).then(o=>{let l=b(o,e);l?s(l,i,a).then(t).catch(n):n(q.InvalidDefinition(`Invalid interceptor type. (${r})`))}).catch(n)});for(let e of i)e.mount===n.name&&e.verbs.forEach(i=>{n.app[i](e.path,(a,s,l)=>{const c=t=>{l(t)},p=t=>{t||l()},h=()=>{d(e.handler).then(n=>{let o=b(n,t);if(o)try{J(new o,t=>{(r=t[i](a,s))&&"function"==typeof r.then?r.then(t=>{p(t)}).catch(c):p(r)})}catch(t){c(t)}else c(q.InvalidDefinition(`Invalid route handler. ${e.handler}`))}).catch(c)};a.$stop=!1;let u=Gt.server.routing[`${n.name}-interceptors`]||[];o(u,a,s).then(()=>{a.$stop?s.end():h()}).catch(t=>{a.stop?s.end():c(t)})})});n.app.use((t,e,i)=>{var a=new Error("Not Found");a.status=404,i(a)}),Z.isProd,n.app.use((t,e,i)=>{i.status(t.status||500),e.xhr?i.status(500).send({error:t.toString()}):i.render("error",{message:t.message,error:t}),i.end()})})})})(),await(async()=>{const{Handler:t}=B("flair.app");c("ns","flair.ui"),i("ViewHandler",t,function(){let t="";c("override"),this.construct=((e,i,a,n)=>{e(),t=i||"main",this.viewTransition=n,this.title=this.title+(a?" - "+a:"")}),c("privateSet"),this.viewTransition="",c("protectedSet"),this.name="",c("protectedSet"),this.title="",c("protectedSet"),this.meta=null,this.view=(async e=>{const{ViewTransition:i}=B("flair.ui");if(this.name=this.name||this.$self.id+"_"+st(),this.viewTransition){let t=b(await d(this.viewTransition),i);this.viewTransition=t?new t:""}let a=Jt.createElement("div"),n=Jt.getElementById(t);a.id=this.name,a.setAttribute("hidden",""),n.appendChild(a),this.load(e,a),await this.swap()}),c("protected"),c("virtual"),c("async"),this.loadView=K,c("private"),this.swap=(async()=>{let e=Jt.getElementById(this.name);if(this.$static.currentView){let i=Jt.getElementById(this.$static.currentView),a;for(let t of this.meta)Jt.head.removeChild(Jt.querySelector('meta[name="'+t+'"]'));this.viewTransition?(await this.viewTransition.leave(i,e),await this.viewTransition.enter(e,i)):(i.hidden=!0,e.hidden=!1),Jt.getElementById(t).removeChild(i)}for(let t of this.meta){var i=document.createElement("meta");for(let e in t)i[e]=t[e];Jt.head.appendChild(i)}this.$static.currentView||(e.hidden=!1),Jt.title=this.title,this.$static.currentView=this.name,this.$static.currentViewMeta=this.meta}),c("static"),this.currentView="",c("static"),this.currentViewMeta=[]})})(),await(async()=>{c("ns","flair.ui"),i("ViewInterceptor",function(){c("virtual"),c("async"),this.run=K})})(),await(async()=>{c("singleton"),c("ns","flair.ui"),i("ViewState",function(){c("state"),c("private"),this.store={},this.get=((t,e)=>(t=t||"",e=e||"",this.store[t+"/"+e]||null)),this.set=((t,e,i)=>{t=t||"",e=e||"","boolean"==typeof i||i?this.store[t+"/"+e]=i:delete this.store[t+"/"+e]}),this.clear=(()=>{this.store=null})})})(),await(async()=>{c("ns","flair.ui"),i("ViewTransition",function(){c("virtual"),c("async"),this.enter=K,c("virtual"),c("async"),this.leave=K})})(),await(async()=>{const{VueComponentMembers:t}=B("flair.ui.vue");c("ns","flair.ui.vue"),i("VueComponent",[t],function(){this.factory=(async()=>{let t=this.define();return this.props&&Array.isArray(this.props)&&(t.props=this.props),this.data&&"function"==typeof this.data&&(t.data=this.data),this.name&&(t.name=this.name),this.model&&(t.model=this.model),"boolean"==typeof this.inheritAttrs&&(t.inheritAttrs=this.inheritAttrs),t}),c("protected"),this.props=null,c("protected"),this.data=null,c("protected"),this.model=null,c("protected"),this.inheritAttrs=null})})(),await(async()=>{c("ns","flair.ui.vue"),i("VueDirective",function(){c("virtual"),c("async"),this.factory=K})})(),await(async()=>{c("ns","flair.ui.vue"),i("VueFilter",function(){c("virtual"),c("async"),this.factory=K})})(),await(async()=>{c("ns","flair.ui.vue"),i("VueLayout",function(){c("protected"),this.html="",c("protected"),this.style="",c("protected"),this.viewArea="view",c("protectedSet"),this.areas=[],this.merge=(async t=>{let e=f("clientFile");this.style&&this.style.endsWith(".css")&&(this.style=await e(this.style)),this.html&&this.html.endsWith(".html")&&(this.html=await e(this.html));let i=Jt.createElement("div");if(this.style){let t=Jt.createElement("style");t.innerHTML=this.style.trim(),t.setAttribute("scoped",""),i.append(t)}if(this.html){let t=Jt.createElement("div");t.innerHTML=this.html.trim(),i.append(t)}this.viewArea=this.viewArea||"view";let a=i.content.getElementById(this.viewArea);a&&(a.innerHTML=t);let n=null;if(this.layout&&this.layout.areas&&Array.isArray(this.layout.areas))for(let t of this.layout.areas)if(n=i.content.getElementById(t.area)){let e=Jt.createElement("component");e.setAttribute("is",t.component),n.append(e)}return i.innerHTML})})})(),await(async()=>{c("ns","flair.ui.vue"),i("VueMixin",function(){c("virtual"),c("async"),this.factory=K})})(),await(async()=>{c("ns","flair.ui.vue"),i("VuePlugin",function(){this.construct=(t=>{Gt.client.vue.pluginOptions[t]&&(this.options=Object.assign({},Gt.client.vue.pluginOptions[t]))}),c("virtual"),c("async"),this.factory=K,this.options=null})})(),await(async()=>{const{Bootware:t}=B("flair.app");c("ns","flair.ui.vue"),i("VueSetup",t,function(){c("override"),this.construct=(t=>{t("Vue Setup")}),c("override"),this.boot=(async t=>{t();const e=await d("vue/vue{.min}.js"),{VueComponent:i,VueFilter:a,VueDirective:n,VuePlugin:r,VueMixin:s}=B("flair.ui.vue");let o=Gt.client.vue.plugins,l=null,c=null;for(let t of o){if(!t.name)throw q.OperationFailed(`Plugin name cannot be empty. (${t.type})`);if(!t.type)throw q.OperationFailed(`Plugin type cannot be empty. (${t.name})`);if(!(l=b(await d(t.type),r)))throw q.InvalidArgument(t.type);try{c=new l(t.name),e.use(await c.factory(),c.options||{})}catch(e){throw q.OperationFailed(`Plugin registration failed. (${t.type})`,e)}}let p=Gt.client.vue.mixins,h=null,u=null;for(let t of p){if(!t.name)throw q.OperationFailed(`Mixin name cannot be empty. (${t.type})`);if(!t.type)throw q.OperationFailed(`Mixin type cannot be empty. (${t.name})`);if(!(h=b(await d(t.type),s)))throw q.InvalidArgument(t.type);try{u=new h,e.mixin(await u.factory())}catch(e){throw q.OperationFailed(`Mixin registration failed. (${t.type})`,e)}}let f=Gt.client.vue.directives,m=null,y=null;for(let t of f){if(!t.name)throw q.OperationFailed(`Directive name cannot be empty. (${t.type})`);if(!t.type)throw q.OperationFailed(`Directive type cannot be empty. (${t.name})`);if(!(m=b(await d(t.type),n)))throw q.InvalidArgument(t.type);try{y=new m,e.directive(t.name,await y.factory())}catch(e){throw q.OperationFailed(`Directive registration failed. (${t.type})`,e)}}let v=Gt.client.vue.filters,w=null,g=null;for(let t of v){if(!t.name)throw q.OperationFailed(`Filter name cannot be empty. (${t.type})`);if(!t.type)throw q.OperationFailed(`Filter type cannot be empty. (${t.name})`);if(!(w=b(await d(t.type),a)))throw q.InvalidArgument(t.type);try{g=new w,e.filter(t.name,await g.factory())}catch(e){throw q.OperationFailed(`Filter registration failed. (${t.type})`,e)}}let $=Gt.client.vue.components,x=null,O=null;for(let t of $){if(!t.name)throw q.OperationFailed(`Component name cannot be empty. (${t.type})`);if(!t.type)throw q.OperationFailed(`Component type cannot be empty. (${t.name})`);if(!(x=b(await d(t.name),i)))throw q.InvalidArgument(t.type);try{if(O=new x,e.options.components[t.name])throw q.Duplicate(`Component already registered. (${t.name})`);e.component(t.name,await O.factory())}catch(e){throw q.OperationFailed(`Component registration failed. (${t.type})`,e)}}})})})(),await(async()=>{const{ViewHandler:t}=B("flair.ui"),{VueComponentMembers:e}=B("flair.ui.vue");c("ns","flair.ui.vue"),i("VueView",t,[e],function(){let t=!1;c("override"),this.construct=(t=>{t(Gt.client.view.el,Gt.client.view.title,Gt.client.view.transition)}),c("private"),this.factory=(async()=>{if(this.layout&&this.layout.areas&&Array.isArray(this.layout.areas)){this.components=this.components||[];for(let t of this.layout.areas)this.components.push({name:t.component,type:t.type})}let t=this.define();return t.el="#"+this.name,this.propsData&&(t.propsData=this.propsData),this.data&&"function"!=typeof this.data&&(t.data=this.data),this.layout&&(t.template=await this.layout.merge(t.template)),t}),c("protected"),c("override"),c("sealed"),this.loadView=(async(e,i,a)=>{if(!t){t=!0,e();const n=await d("vue/vue{.min}.js");await this.load(i,a),new n(await this.factory())}}),c("protected"),c("virtual"),c("async"),this.load=K,c("protected"),this.el=null,c("protected"),this.propsData=null,c("protected"),this.data=null,c("protected"),this.layout=null})})(),l.context.current().currentAssemblyBeingLoaded(""),l.registerAdo('{"name":"flair.app","file":"./flair.app{.min}.js","mainAssembly":"flair","desc":"True Object Oriented JavaScript","title":"Flair.js","version":"0.6.84","lupdate":"Mon, 13 May 2019 19:21:49 GMT","builder":{"name":"flairBuild","version":"1","format":"fasm","formatVersion":"1","contains":["init","func","type","vars","reso","asst","rout","sreg"]},"copyright":"(c) 2017-2019 Vikas Burman","license":"MIT","types":["flair.app.Bootware","flair.app.Handler","flair.app.App","flair.app.Host","flair.ui.vue.VueComponentMembers","flair.api.RestHandler","flair.api.RestInterceptor","flair.app.BootEngine","flair.app.ClientHost","flair.app.ServerHost","flair.boot.ClientRouter","flair.boot.DIContainer","flair.boot.Middlewares","flair.boot.NodeEnv","flair.boot.ResHeaders","flair.boot.ServerRouter","flair.ui.ViewHandler","flair.ui.ViewInterceptor","flair.ui.ViewState","flair.ui.ViewTransition","flair.ui.vue.VueComponent","flair.ui.vue.VueDirective","flair.ui.vue.VueFilter","flair.ui.vue.VueLayout","flair.ui.vue.VueMixin","flair.ui.vue.VuePlugin","flair.ui.vue.VueSetup","flair.ui.vue.VueView"],"resources":[],"assets":[],"routes":[]}'),Object.freeze({name:"flair.app",settings:Gt,config:Qt})});
\ No newline at end of file
diff --git a/dist/flair.app.min.js.gz b/dist/flair.app.min.js.gz
index f27354af..cc8f7e2c 100644
Binary files a/dist/flair.app.min.js.gz and b/dist/flair.app.min.js.gz differ
diff --git a/dist/flair.js b/dist/flair.js
index 6d6c5e8f..f112b38c 100644
--- a/dist/flair.js
+++ b/dist/flair.js
@@ -5,8 +5,8 @@
*
* Assembly: flair
* File: ./flair.js
- * Version: 0.6.82
- * Mon, 13 May 2019 19:15:28 GMT
+ * Version: 0.6.84
+ * Mon, 13 May 2019 19:21:46 GMT
*
* (c) 2017-2019 Vikas Burman
* MIT
@@ -7022,10 +7022,10 @@
name: 'flairjs',
title: 'Flair.js',
file: currentFile,
- version: '0.6.82',
+ version: '0.6.84',
copyright: '(c) 2017-2019 Vikas Burman',
license: 'MIT',
- lupdate: new Date('Mon, 13 May 2019 19:15:28 GMT')
+ lupdate: new Date('Mon, 13 May 2019 19:21:46 GMT')
});
// bundled assembly load process
@@ -7422,7 +7422,7 @@
AppDomain.context.current().currentAssemblyBeingLoaded('');
// register assembly definition object
- AppDomain.registerAdo('{"name":"flair","file":"./flair{.min}.js","mainAssembly":"flair","desc":"True Object Oriented JavaScript","title":"Flair.js","version":"0.6.82","lupdate":"Mon, 13 May 2019 19:15:28 GMT","builder":{"name":"flairBuild","version":"1","format":"fasm","formatVersion":"1","contains":["init","func","type","vars","reso","asst","rout","sreg"]},"copyright":"(c) 2017-2019 Vikas Burman","license":"MIT","types":["Aspect","Attribute","IDisposable","IProgressReporter","Task"],"resources":[],"assets":[],"routes":[]}');
+ AppDomain.registerAdo('{"name":"flair","file":"./flair{.min}.js","mainAssembly":"flair","desc":"True Object Oriented JavaScript","title":"Flair.js","version":"0.6.84","lupdate":"Mon, 13 May 2019 19:21:46 GMT","builder":{"name":"flairBuild","version":"1","format":"fasm","formatVersion":"1","contains":["init","func","type","vars","reso","asst","rout","sreg"]},"copyright":"(c) 2017-2019 Vikas Burman","license":"MIT","types":["Aspect","Attribute","IDisposable","IProgressReporter","Task"],"resources":[],"assets":[],"routes":[]}');
// assembly load complete
if (typeof onLoadComplete === 'function') {
diff --git a/dist/flair.min.js b/dist/flair.min.js
index b45872f5..856453e3 100644
--- a/dist/flair.min.js
+++ b/dist/flair.min.js
@@ -5,10 +5,10 @@
*
* Assembly: flair
* File: ./flair.js
- * Version: 0.6.82
- * Mon, 13 May 2019 19:15:28 GMT
+ * Version: 0.6.84
+ * Mon, 13 May 2019 19:21:46 GMT
*
* (c) 2017-2019 Vikas Burman
* MIT
*/
-!function(e,t){"use strict";"function"==typeof!0&&(!0).amd?(!0)(t):"object"==typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=t()),module.exports=exports=t()):e.flair=t()}(this,function(){"use strict";let e=new Function("try {return this===global;}catch(e){return false;}")(),t=e?!require("worker_threads").isMainThread:void 0!==!0,n=[],r=Symbol("[meta]"),i="modules",s=[],a={},o=["class","enum","interface","mixin","struct"],l=["instance","sinstance"],c="",u={},f={},p=!1,m=async(e,t)=>(p||(p=await m.AppDomain.boot(e,t)),m.AppDomain.app());if(e){let e=process.argv;t&&(e=require("worker_threads").workerData.argv);let n=e.findIndex(e=>!!e.startsWith("--flairSymbols"));-1!==n&&(c=e[n].substr(2).split("=")[1])}else c=(!0).flairSymbols||"";c&&(n=c.split(",").map(e=>e.trim())),a.symbols=Object.freeze(n),a.env=Object.freeze({type:e?"server":"client",isTesting:-1!==n.indexOf("TEST"),isServer:e,isClient:!e,isWorker:t,isMain:!t,cores:(e?require("os").cpus().length:(!0).navigator.hardwareConcurrency)||4,isCordova:!e&&!!(!0).cordova,isNodeWebkit:e&&process.versions["node-webkit"],isProd:-1===n.indexOf("DEBUG")&&-1!==n.indexOf("PROD"),isDebug:-1!==n.indexOf("DEBUG"),isAppMode:()=>p}),m.members=[],m.options=Object.freeze(a),m.env=m.options.env;const d=(e,t,n)=>{m[e]=Object.freeze(t),m.members.push(e),"function"==typeof n&&s.push(n)},h=()=>{};d("noop",h);const y={get:()=>{throw b.NotImplemented("prop",y.get)},set:()=>{throw b.NotImplemented("prop",y.set)},ni:!0};d("nip",y);const g=()=>{throw b.NotImplemented("func",g)};g.ni=!0,d("nim",g);const b=function(e,t,n,r){let i=new Error,s=b;switch(typeof e){case"string":switch(i.name=e,typeof t){case"string":switch(i.message=t,typeof n){case"object":i.error=n,"function"==typeof r&&(s=r);break;case"function":s=n;break}break;case"object":i.message=t.message||"",i.error=t,"function"==typeof n&&(s=n);break;case"function":s=t;break}break;case"object":i.name=e.name||"Unknown",i.message=e.message||"",i.error=e,"function"==typeof t&&(s=t);break}return i.name=i.name||"Undefined",i.name.endsWith("Exception")||(i.name+="Exception"),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(i,s),i.error&&(i.message+="["+i.error+"]"),Object.freeze(i)};b.InvalidArgument=((e,t=b.InvalidArgument)=>new b("InvalidArgument",`Argument type is invalid. (${e})`,t)),b.OperationFailed=((e,t,n=b.OperationFailed)=>new b("OperationFailed",`Operation failed with error. (${e})`,t,n)),b.Duplicate=((e,t=b.Duplicate)=>new b("Duplicate",`Item already exists.(${e})`,t)),b.NotFound=((e,t=b.NotFound)=>new b("NotFound",`Item not found. (${e})`,t)),b.InvalidDefinition=((e,t=b.InvalidDefinition)=>new b("InvalidDefinition",`Item definition is invalid. (${e})`,t)),b.InvalidOperation=((e,t=b.InvalidOperation)=>new b("InvalidOperation",`Operation is invalid in current context. (${e})`,t)),b.Circular=((e,t=b.Circular)=>new b("Circular",`Circular calls found. (${e})`,t)),b.NotImplemented=((e,t=b.NotImplemented)=>new b("NotImplemented",`Member is not implemented. (${e})`,t)),d("Exception",b);const v=()=>"_xxxxxxxx_xxxx_4xxx_yxxx_xxxxxxxxxxxx".replace(/[xy]/g,e=>{var t=16*Math.random()|0,n;return("x"==e?t:3&t|8).toString(16)}),w=(e,t)=>{if(t){if(-1!==e.indexOf("{.min}"))return a.env.isProd?e.replace("{.min}",".min"):e.replace("{.min}","")}else if(-1!==e.indexOf("|")){let t=e.split("|"),n="";return"x"===(n=a.env.isServer?t[0].trim():t[1].trim())&&(n=""),-1!==n.indexOf("~")&&(t=n.split("~"),"x"===(n=a.env.isWorker?t[1].trim():t[0].trim())&&(n="")),n}return e},x=e=>!e.hasOwnProperty("prototype")&&"Function"===e.constructor.name,O=e=>"AsyncFunction"===e.constructor.name,I=(e,t,n)=>e.findIndex(e=>e[t]===n),A=(e,t,n)=>{let r=e.findIndex(e=>e[t]===n);return-1!==r?e[r]:null},$=(e,t)=>(t||(t=","),e.split(t).map(e=>e.trim())),k=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),j=(e,t,n)=>e.replace(new RegExp(k(t),"g"),n),T=(e,t,n,r)=>{r||(r=[]);for(let i in t)if(t.hasOwnProperty(i)&&-1===r.indexOf(i)){if(!n&&i in e)continue;e[i]=t[i]}return e},P=t=>new Promise((n,r)=>{let i=null;(i=G(e?"serverFile":"clientFile"))(t).then(n).catch(r)}),S=(n,r,i)=>new Promise((s,a)=>{e?G("serverModule").require(n).then(s).catch(a):G("clientModule").require(n).then(e=>{e||"string"!=typeof r||(t?(e=(!0)[r]||null,i&&delete WorkerGlobalScope[r]):(e=(!0)[r]||null,i&&delete window[r])),e?s(e):s()}).catch(a)}),N=(t,n,r)=>new Promise((i,s)=>{let a=null;(a=G(e?"serverFetch":"clientFetch"))(t,n,r).then(i).catch(s)}),C=(e,t,n,r)=>{let i=t?$(t):Object.keys(e);const s=t=>{let s={};if(i.length>0)for(let e of i)s[e]=t[e];else for(let t in e)e.hasOwnProperty(t)&&(s[t]=e[t]);if(r)for(let e in r)s[e]=r[e];return n&&(s=Object.freeze(s)),s};if(Array.isArray(e)){let t=[];for(let n of e)t.push(s(n));return t}return s(e)},D=e=>btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function e(t,n){return String.fromCharCode("0x"+n)})),E=e=>decodeURIComponent(atob(e).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join("")),F=t=>{e?G("serverModule").undef(t):G("clientModule").undef(t)},z=(e,t)=>new Promise((n,r)=>{const i=e=>{e&&0!==e.length?Promise((n,r)=>{t(n,r,e.shift())}).then(()=>{i(e)}).catch(r):n()};i(e.slice())}),M=(e,t=!0)=>{const n=e=>e&&"object"==typeof e;return e.reduce((e,r)=>(Object.keys(r).forEach(i=>{const s=e[i],a=r[i];Array.isArray(s)&&Array.isArray(a)?e[i]=t?s.concat(...a):[].concat(...a):n(s)&&n(a)?e[i]=M([s,a],t):e[i]=a}),e),{})},R=(...n)=>{if(e||t)return"";let r="",i="",s=null;for(let e of n){for(let t of(!0).document.scripts)if(t.src.endsWith(e)){(s=(!0).document.createElement("a")).href=t.src,i=s.protocol+"//"+s.host+"/",s=null,r="./"+t.src.replace(i,"");break}if(r)break}return r},U=e=>{let t="";return void 0===e&&(t="undefined"),t||null!==e||(t="null"),t||"number"!=typeof e||!1!==isFinite(e)||(t="infinity"),!t&&Array.isArray(e)&&(t="array"),!t&&e instanceof Date&&(t="date"),!t&&e[r]&&(t=e[r].type),t||(t=typeof e),t};d("typeOf",U);const W=(e,t)=>{if(t[r]&&(t=t[r].name),"string"!==U(t))throw b.InvalidArgument("type",W);let n=!1;if(e)switch(t){case"NaN":n=isNaN(e);break;case"infinity":n="number"==typeof e&&!1===isFinite(e);break;case"array":case"Array":n=Array.isArray(e);break;case"date":case"Date":n=e instanceof Date;break;case"flairtype":n=e[r]&&-1!==o.indexOf(e[r].type);break;case"flairinstance":n=e[r]&&-1!==l.indexOf(e[r].type);break;case"flair":n=void 0!==e[r];break;case"cfunction":n="function"==typeof e&&!x(e);break;case"afunction":n="function"==typeof e&&x(e);break;default:n||(n=typeof e===t),!n&&e[r]&&(n||(n=t===e[r].type),n||-1===l.indexOf(e[r].type)||(n=we(e,t)),n||"class"!==e[r].type||(n=de(e,t)),n||-1===o.indexOf(e[r].type)||(n=e[r].name===t))}else switch(t){case"undefined":n=void 0===e;break;case"null":n=null===e;break;case"NaN":n=isNaN(e);break}return n};d("is",W);const q=(...e)=>{if(0===e.length)throw b.InvalidArgument("patterns",q);let t=(...n)=>{let r=null,i=null,s="",a="",o=-1,l=-1,c=!1,u=0,f="",p={raw:n||[],index:-1,isInvalid:!1,error:null,values:{}};if(e)for(let t of e){o++,l=-1,c=!1,u=0,r=t.split(",");for(let e of r){if(l++,2!==(i=e.split(":")).length?(s=`_${o}_${l}`,a=e.trim()||""):(s=i[0].trim()||"",a=i[1].trim()||""),l>p.raw.length){c=!1;break}if(!W(p.raw[l],a)){c=!1,f=s;break}p.values[s]=p.raw[l],c=!0,u++}if(c&&u===r.length){p.index=o;break}}return p.isInvalid=-1===p.index,p.error=p.isInvalid?b.InvalidArgument(f):null,p.throwOnError=(e=>{if(p.error)throw new b(p.error,e||t)}),Object.freeze(p)};return Object.freeze(t)};d("Args",q);const _=e=>{let t;return q("argsProcessor: undefined","argsProcessor: afunction")(e).throwOnError(_),(e=e||((...e)=>e)).event=!0,e};d("event",_);const L=_(()=>{throw b.NotImplemented("event",L)});L.ni=!0,d("nie",L);const B=function(e){let t={};e=e||"",this.add=((e,n)=>{let r;q("event: string, handler: afunction")(e,n).throwOnError(this.add),t[e]||(t[e]=[]),t[e].push(n)}),this.remove=((e,n)=>{let r;if(q("event: string, handler: afunction")(e,n).throwOnError(this.remove),t[e]){let r=t[e].indexOf(n);-1!==r&&t[e].splice(r,1)}}),this.dispatch=((n,r)=>{let i;q("event: string")(n).throwOnError(this.dispatch),t[n]&&t[n].forEach(t=>{setTimeout(()=>{t(Object.freeze({host:e,name:n,args:r||[]}))},0)})}),this.count=(e=>{let n;return q("event: string")(e).throwOnError(this.count),t[e]?t[e].length:0}),this.clear=(()=>{t={}})};let V={};const G=e=>{if("string"!=typeof e)throw b.InvalidArgument("name",G);return V[e]?V[e].handler?V[e].handler:V[e].inbuilt:null};G.define=((e,t,n)=>{let r=q("name: string, members: array, inbuilt: afunction","name: string, inbuilt: afunction","name: string, members: array","name: string")(e,t,n);if(r.throwOnError(G.define),V[e])throw b.Duplicate(e,G.define);V[e]={type:r.values.members?"object":"function",members:r.values.members||null,handler:null,inbuilt:r.values.inbuilt?r.values.inbuilt(a.env):null}}),G.connect=((e,t)=>{let n;if(q("name: string, handler: afunction")(e,t).throwOnError(G.connect),!V[e])throw b.NotFound(e,G.connect);let r=t(a.env);if(typeof r!==V[e].type)throw b.InvalidArgument("handler",G.connect);let i=V[e].members;if(i)for(let e of i)if(void 0===r[e])throw b.NotImplemented(e,G.connect);V[e].handler=r}),G.disconnect=(e=>{if("string"!=typeof e)throw b.InvalidArgument("name",G.disconnect);V[e]&&(V[e].handler=null)}),G.isDefined=(e=>{if("string"!=typeof e)throw b.InvalidArgument("name",G.isDefined);return!!V[e]}),G.isConnected=(e=>{if("string"!=typeof e)throw b.InvalidArgument("name",G.isConnected);return!V[e]||!V[e].handler}),d("Port",G,()=>{for(let e in V)V.hasOwnProperty(e)&&(V[e].handler=null);V={}});const J=function(e,t,n,i,s){let a={},l={},c={},u={},f={},p={},d={},h=!1,y="";this.name=e,this.domain=t,this.isUnloaded=(()=>h||t.isUnloaded()),this.unload=(()=>{if(!h){h=!0,delete s[e];for(let e in u)e.hasOwnProperty(e)&&Te(u[e]);a={},f={},p={},l={},c={},u={},d={}}}),this.current=(()=>{if(this.isUnloaded())throw b.InvalidOperation(`Context is already unloaded. (${this.name})`,this.current);return 0===i.length?n||this:i[i.length-1]}),this.registerType=(e=>{if(this.isUnloaded())throw b.InvalidOperation(`Context is already unloaded. (${this.name})`,this.registerType);let t="",n="",i=e[r];if(i.Type?(t=i.Type[r].name,n=i.Type[r].type):(t=i.name,n=i.type),-1===o.indexOf(n))throw b.InvalidArgument("Type",this.registerType);let s=t.substr(0,t.lastIndexOf(".")),u=t.replace(s+".","");if(a[t])throw b.Duplicate(t,this.registerType);if(l[t])throw b.Duplicate(`Already registered as Resource. (${t})`,this.registerType);if(c[t])throw b.Duplicate(`Already registered as Route. (${t})`,this.registerType);return a[t]=e,s?(d[s]||(d[s]={}),d[s][u]=e):d[u]=e,s}),this.getType=(e=>{if(this.isUnloaded())throw b.InvalidOperation(`Context is already unloaded. (${this.name})`,this.getType);if("string"!=typeof e)throw b.InvalidArgument("qualifiedName",this.getType);return a[e]||null}),this.ensureType=(e=>new Promise((n,r)=>{if(this.isUnloaded())return void r(b.InvalidOperation(`Context is already unloaded. (${this.name})`));if("string"!=typeof e)return void r(b.InvalidArgument("qualifiedName"));let i=this.getType(e);if(i)n(i);else{let s=t.resolve(e);s?this.loadAssembly(s).then(()=>{(i=this.getType(e))?n(i):r(b.OperationFailed(`Assembly could not be loaded. (${s})`))}).catch(r):r(b.NotFound(e))}})),this.allTypes=(()=>{if(this.isUnloaded())throw b.InvalidOperation(`Context is already unloaded. (${this.name})`,this.allTypes);return Object.keys(a)}),this.execute=((e,t)=>new Promise((n,r)=>{if(this.isUnloaded())return void r(b.InvalidOperation(`Context is already unloaded. (${this.name})`));e.type=e.type||"",e.typeArgs=e.typeArgs||[],e.func=e.func||"",e.args=e.args||[],e.ctx=e.ctx||{},e.keepAlive=void 0!==e.keepAlive&&e.keepAlive;const i=()=>new Promise((n,r)=>{let i=null;this.ensureType(e.type).then(s=>{try{i=new s(...e.typeArgs),"function"==typeof t&&W(i,"IProgressReporter")&&i.progress.add(t),n(i)}catch(e){r(e)}}).catch(r)}),s=t=>new Promise((n,r)=>{let i=null;(i=t[e.func](...e.args))&&"function"==typeof i.then?i.then(n).catch(r):n(i)});let a=null;e.keepAlive?u[e.type]?(a=u[e.type],s(a).then(n).catch(r)):i().then(t=>{a=t,u[e.type]=a,s(a).then(n).catch(r)}).catch(r):u[e.type]?(a=u[e.type],e.func?s(a).then(n).catch(r).finally(()=>{Te(a),delete u[e.type]}):(Te(a),delete u[e.type],n())):i().then(e=>{s(e).then(n).catch(r).finally(()=>{Te(e)})}).catch(r)})),this.namespace=(e=>{e&&"(root)"===e&&(e="");let t=null;return(t=e?d[e]||null:d)?Object.freeze(T({},t)):null}),this.currentAssemblyBeingLoaded=(e=>(void 0!==e&&(y=w(e,!0)),y));const g=(e,t,n,r)=>{"string"==typeof e&&!f[e]&&t&&n&&r&&(f[e]=Object.freeze(new H(t,n,r)),p[r.name]=f[e])};this.loadAssembly=(e=>new Promise((t,n)=>{if(this.isUnloaded())n(b.InvalidOperation(`Context is already unloaded. (${this.name})`));else if(f[e]||this.currentAssemblyBeingLoaded()===e)t();else{i.push(this);let r=this.domain.getAdo(e),s=e;s.startsWith("./")&&(s=s.substr(2)),s=r&&r.mainAssembly?this.domain.loadPathOf(r.mainAssembly)+s:this.domain.root()+s,F(s),S(s,r.name,!0).then(a=>{a(m,s).then(n=>{let s=this.current();i.pop(),g(e,r,s,n),t()}).catch(e=>{i.pop(),n(e)})}).catch(e=>{i.pop(),n(e)})}})),this.loadBundledAssembly=((e,t,n)=>{if(this.isUnloaded())throw b.InvalidOperation(`Context is already unloaded. (${this.name})`);let r={};i.push(this);let s=t;try{r=n(m,s);let t=this.current();i.pop();let a=this.domain.getAdo(e);g(e,a,t,r)}finally{i.pop()}return r}),this.getAssembly=(e=>{if(this.isUnloaded())throw b.InvalidOperation(`Context is already unloaded. (${this.name})`,this.getAssembly);if("string"!=typeof e)throw b.InvalidArgument("file",this.getAssembly);return f[e]||null}),this.getAssemblyByName=(e=>{if(this.isUnloaded())throw b.InvalidOperation(`Context is already unloaded. (${this.name})`,this.getAssemblyByName);if("string"!=typeof e)throw b.InvalidArgument("name",this.getAssemblyByName);return p[e]||null}),this.allAssemblies=(e=>{if(this.isUnloaded())throw b.InvalidOperation(`Context is already unloaded. (${this.name})`,this.allAssemblies);if(e){let e=[],t=Object.keys(f);for(let n of t)e.push(f[n]);return e}return Object.keys(f)}),this.registerResource=(e=>{if(this.isUnloaded())throw b.InvalidOperation(`Context is already unloaded. (${this.name})`,this.registerResource);if("string"!=typeof e.name||""===e.name||"string"!=typeof e.encodingType||""===e.encodingType||"string"!=typeof e.file||""===e.file||"string"!=typeof e.data||""===e.data)throw b.InvalidArgument("rdo",this.registerResource);let t=e.name.substr(0,e.name.lastIndexOf(".")),n=e.name.replace(t+".","");if(l[e.name])throw b.Duplicate(e.name,this.registerResource);if(a[e.name])throw b.Duplicate(`Already registered as Type. (${e.name})`,this.registerResource);if(c[e.name])throw b.Duplicate(`Already registered as Route. (${e.name})`,this.registerResource);return l[e.name]=Object.freeze(new X(e,t,this)),t?(d[t]||(d[t]={}),d[t][n]=l[e.name]):d[n]=l[e.name],t}),this.getResource=(e=>{if(this.isUnloaded())throw b.InvalidOperation(`Context is already unloaded. (${this.name})`,this.getResource);if("string"!=typeof e)throw b.InvalidArgument("qualifiedName",this.getResource);return l[e]||null}),this.allResources=(e=>{if(this.isUnloaded())throw b.InvalidOperation(`Context is already unloaded. (${this.name})`,this.allResources);if(e){let e=[],t=Object.keys(l);for(let n of t)e.push(l[n]);return e}return Object.keys(l)}),this.registerRoutes=((e,t)=>{if(this.isUnloaded())throw b.InvalidOperation(`Context is already unloaded. (${this.name})`,this.registerRoutes);for(let n of e){if("string"!=typeof n.name||""===n.name||"number"!=typeof n.index||"string"!=typeof n.mount||""===n.mount||"string"!=typeof n.path||""===n.path||"string"!=typeof n.handler||""===n.handler)throw b.InvalidArgument("route: "+n.name,this.registerRoutes);let e=n.name.substr(0,n.name.lastIndexOf(".")),r=n.name.replace(e+".","");if(c[n.name])throw b.Duplicate(n.name,this.registerRoutes);if(a[n.name])throw b.Duplicate(`Already registered as Type. (${n.name})`,this.registerRoutes);if(l[n.name])throw b.Duplicate(`Already registered as Resource. (${n.name})`,this.registerRoutes);c[n.name]=Object.freeze(new K(t,n,e,this)),e?(d[e]||(d[e]={}),d[e][r]=c[n.name]):d[r]=c[n.name]}}),this.getRoute=(e=>{if(this.isUnloaded())throw b.InvalidOperation(`Context is already unloaded. (${this.name})`,this.getRoute);if("string"!=typeof e)throw b.InvalidArgument("qualifiedName",this.getRoute);return c[e]||null}),this.allRoutes=(e=>{if(this.isUnloaded())throw b.InvalidOperation(`Context is already unloaded. (${this.name})`,this.allRoutes);if(e){let e=[],t=Object.keys(c);for(let n of t)e.push(c[n]);return e}return Object.keys(c)}),this.isBusy=(()=>!1),this.hasActiveInstances=(()=>Object.keys(u).length)},H=function(e,t,n){this.context=t,this.name=e.name,this.file=e.file,this.mainAssembly=e.mainAssembly,this.desc=e.desc,this.title=e.title,this.version=e.version,this.copyright=e.copyright,this.license=e.license,this.lupdate=e.lupdate,this.builder=e.builder.name,this.builderVersion=e.builder.version,this.format=Object.freeze({name:e.builder.format,version:e.builder.formatVersion,contains:e.builder.contains.slice()}),this.types=(()=>e.types.slice()),this.getType=(t=>{if("string"!=typeof t)throw b.InvalidArgument("qualifiedName",this.getType);if(-1===e.types.indexOf(t))throw b.NotFound(t,this.getType);return this.context.getType(t)}),this.getTypes=(t=>{if(["string","interface"]!==U(t))throw b.InvalidArgument("intf",this.getTypes);let n=[];for(let r of e.types)try{let e=this.context.getType(r);Ie(e,t)&&n.push(e)}catch(e){}return n}),this.resources=(()=>e.resources.slice()),this.getResource=(t=>{if("string"!=typeof t)throw b.InvalidArgument("qualifiedName",this.getResource);if(-1===e.resources.indexOf(t))throw b.NotFound(t,this.getResource);return this.context.getResource(t)}),this.routes=(()=>e.routes.slice()),this.getRoute=(t=>{if("string"!=typeof t)throw b.InvalidArgument("qualifiedName",this.getRoute);if(-1===e.routes.indexOf(t))throw b.NotFound(t,this.getRoute);return this.context.getRoute(t)}),this.assets=(()=>e.assets.slice()),this.assetsRoot=this.file.replace(".js","/"),this.getAsset=(t=>{if("string"!=typeof t)throw b.InvalidArgument("file",this.getAsset);let n=t.replace("./",this.assetsRoot);if(-1===e.assets.indexOf(t))throw b.NotFound(n,this.getAsset);return n}),this.config=(()=>n.config),this.settings=(()=>n.settings)},X=function(t,n,r){this.context=r,this.name=t.name,this.ns=n,this.assembly=(()=>r.getAssembly(w(t.asmFile,!0))||null),this.encodingType=t.encodingType,this.file=t.file,this.type=t.file.substr(t.file.lastIndexOf(".")+1).toLowerCase(),this.data=t.data;try{if(-1!==t.encodingType.indexOf("utf8;"))if(e){let e=Buffer.from(t.data,"base64");this.data=e.toString("utf8")}else this.data=E(t.data);else e&&(this.data=Buffer.from(t.data,"base64"))}catch(e){throw b.OperationFailed(`Resource data could not be decoded. (${t.name})`,X)}"json"===this.type&&(this.data=Object.freeze(JSON.parse(this.data)))},K=function(t,n,r,i){this.context=i,this.name=n.name,this.ns=r,this.assembly=(()=>i.getAssembly(t)||null),this.index=n.index,this.mount=n.mount,this.verbs=n.verbs||(e?["get"]:["view"]),this.path=n.path,this.handler=n.handler},Q=function(t,n){let r={},i=0,s=null,a=null;const o=function(){let e,t=null;const n=e=>{let n=e.data.func,r=null;const i=n=>{t.postMessage({data:{id:e.data.id,isComplete:!0,isError:!1,error:null,ctx:e.data.ctx,result:e.data.returnsAsIs?n:!!n}})},s=n=>{t.postMessage({data:{id:e.data.id,isComplete:!1,isError:!1,error:null,ctx:e.data.ctx,result:n}})},a=n=>{t.postMessage({data:{id:e.data.id,isComplete:!0,isError:!0,error:n?n.toString():"UnknownError",ctx:e.data.ctx,result:null}})},o=()=>{try{"alc"===e.data.obj&&"execute"===n&&e.data.args.push(e=>{s(e.args)});let t=r(...e.data.args);t&&"function"==typeof t.then?t.then(i).catch(a):i(t)}catch(e){a(e)}};switch(e.data.obj){case"ad":r=ee[n],o();break;case"alc":r=ee.contexts(e.data.name)[n],o();break}};if("<<{{isServer}}>>"=="true"){require("<<{{entryPoint}}>>");let e=require("worker_threads").parentPort;t=e,e.once("message",e=>{(t=e.privatePort).on("message",n)})}else importScripts("<<{{requirejs}}>>","<<{{entryPoint}}>>"),(t=this).onmessage=n};let l=o.toString().replace("<<{{entryPoint}}>>",ee.entryPoint());l=`(${l=(l=l.replace("<<{{requirejs}}>>",R("require.js","require.min.js"))).replace("<<{{isServer}}>>",e.toString())})();`;const c=(e,t,n,s,o,l,c)=>new Promise((u,f)=>{let p=v();r[p]={resolve:u,reject:f,progressListener:c},i++,a.postMessage({data:{id:p,obj:e,name:t,returnsAsIs:n,ctx:l||{},func:s,args:o&&Array.isArray(o)?o:[]}})}),u=e=>{if(r[e.data.id]){let t=r[e.data.id];e.data.isComplete?(delete r[e.data.id],i--,e.data.isError?t.reject(e.data.error):t.resolve(Object.freeze({ctx:e.data.ctx,result:e.data.result}))):"function"==typeof progressListener&&t.progressListener&&setTimeout(()=>{t.progressListener(Object.freeze({host:e.data.ctx._?e.data.ctx._.host:"",name:"progress",args:e.data.result}))},0)}else n(`Unknown operation is not supported. (${e.data.id})`)};if(e){const{Worker:e,MessageChannel:t}=require("worker_threads");a=new e(l,{eval:!0,workerData:{argv:process.argv}});const r=new t;a.postMessage({privatePort:r.port1},[r.port1]),r.port2.on("error",n),r.port2.on("message",u)}else{let e=new Blob([l]),t=(!0).URL.createObjectURL(e,{type:"application/javascript; charset=utf-8"});(a=new(!0).Worker(t)).onmessage=u,a.onerror=n}this.remoteCall=c,this.close=(()=>{e&&(s.close(),a.unref()),a.terminate()}),this.isBusy=(()=>i)},Y=function(e,t,n){let r=!1,i={},s=new Q(n,e=>{throw b.OperationFailed("Remote operation failed.",e)});this.name=e,this.isRemote=!0,this.isUnloaded=(()=>r),this.unload=(()=>{r||(r=!0,delete t[e],i={},s.remoteCall("ad","",!1,"unload").finally(()=>{s.close()}))}),this.context=Object.freeze(new Z("default",this,s)),this.contexts=(e=>i[e]||null),this.createContext=(e=>new Promise((t,n)=>{"string"!=typeof e||e&&"default"===e||i[e]?n(b.InvalidArguments("name")):s.remoteCall("ad","",!1,"createContext",[e]).then(r=>{if(r){let n=Object.freeze(new Z(e,this,s));i[e]=n,t(n)}else n(b.OperationFailed("Context could not be created."))}).catch(n)})),this.loadScripts=((...e)=>{if(this.isUnloaded())throw b.InvalidOperation(`AppDomain is already unloaded. (${this.name})`,this.loadScripts);return s.remoteCall("ad","",!1,"loadScripts",e)})},Z=function(e,t,n){let r=!1;this.name=e,this.domain=t,this.isUnloaded=(()=>r||t.isUnloaded()),this.unload=(()=>{r||(r=!0,n.remoteCall("alc",e,!1,"unload"))}),this.execute=((t,r)=>{if(this.isUnloaded())throw b.InvalidOperation(`Context is already unloaded. (${this.name})`,this.execute);let i=t.ctx||{};return i._={host:t.type},n.remoteCall("alc",e,!0,"execute",[t],i,r)}),this.loadAssembly=(t=>{if(this.isUnloaded())throw b.InvalidOperation(`Context is already unloaded. (${this.name})`,this.loadAssembly);return n.remoteCall("alc",e,!1,"loadAssembly",[t])}),this.isBusy=(()=>{if(this.isUnloaded())throw b.InvalidOperation(`Context is already unloaded. (${this.name})`,this.isBusy);return n.isBusy()}),this.hasActiveInstances=(()=>{n.remoteCall("alc",e,!1,"hasActiveInstances")})},ee=function(t){let n={},r={},i={},s={},a=[],o=[],l={},c="",f="",p=null,d=null,h=null,y=null,g=null,v=!1,x=!1;i[t]=this,this.name=t,this.isRemote=!1,this.isUnloaded=(()=>v),this.unload=(async()=>{if(!v){v=!0,d&&"function"==typeof d.stop&&(await d.stop(),Te(d)),h&&"function"==typeof h.stop&&(await h.stop(),Te(h));for(let e in s)s.hasOwnProperty(e)&&"function"==typeof s[e].unload&&s[e].unload();g();for(let e in i)i.hasOwnProperty(e)&&i[e]!==this&&i[e].unload();n={},r={},s={},i={},a=[],o=[],l={},c="",f="",p=null,d=null,h=null,y=null,g=null}}),this.createDomain=(e=>new Promise((t,n)=>{if("string"!=typeof e||e&&"default"===e||i[e])return void n(b.InvalidArguments("name"));let r=Object.freeze(new Y(e,i,o));i[e]=r,t(r)})),this.domains=(e=>i[e]||null);const O=()=>(y=new J("default",this,null,a,s),g=y.unload,delete y.unload,y=Object.freeze(y),s[y.name]=y,y);this.context=O(),this.contexts=(e=>s[e]||null),this.createContext=(e=>new Promise((t,n)=>{if("string"!=typeof e||e&&"default"===e||s[e])return void n(b.InvalidArguments("name"));let r=Object.freeze(new J(e,this,y,a,s));s[e]=r,t(r)})),this.registerAdo=(e=>{if("string"==typeof e&&(e=JSON.parse(e)),"array"!==U(e.types)||"array"!==U(e.resources)||"array"!==U(e.routes)||"array"!==U(e.assets)||"string"!=typeof e.name||"string"!=typeof e.file||""===e.file)throw b.InvalidArgument("ado",this.registerAdo);e.file=w(e.file,!0),n[e.file]||(n[e.file]=Object.freeze(e),e.types.forEach(t=>{if(r[t])throw b.Duplicate(t,this.registerAdo);r[t]=e.file}),e.resources.forEach(t=>{if(r[t])throw b.Duplicate(t,this.registerAdo);r[t]=e.file}),this.context.registerRoutes(e.routes,e.file),o.push(e))}),this.getAdo=(e=>{if("string"!=typeof e)throw b.InvalidArgument("file",this.getAdo);return n[e]||null}),this.allAdos=(()=>Object.keys(n)),this.resolve=(e=>{if("string"!=typeof e)throw b.InvalidArgument("qualifiedName",this.resolve);return r[e]||null}),this.allTypes=(()=>Object.keys(r)),this.boot=(async(t,n)=>{if(n=n||this.config(),!(t=t||this.entryPoint()))return console.log("No entry point defined, boot aborted."),!1;x&&(await this.unload(),v=!1,O()),this.root(e?process.cwd():"./"),t&&this.entryPoint(t),n&&await this.config(n);let r="";if(-1!==m.info.file.indexOf("flair.js")?r=m.info.file.replace("flair.js","preamble.js"):-1!==m.info.file.indexOf("flair.min.js")&&(r=m.info.file.replace("flair.min.js","preamble.js")),r){let e;(await je(r))(m)}let i=await je(u.bootEngine);return await i.start(),x=!0,!0}),this.config=(e=>!p&&e?new Promise((t,n)=>{je(e).then(e=>{p=e,t(Object.assign({},p))}).catch(n)}):p?Object.assign({},p):null),this.entryPoint=(e=>("string"!=typeof e||c||(c=e),c)),this.app=(e=>(e&&!d&&(d=e),d)),this.host=(e=>(e&&(h=e),h)),this.loadPathOf=((e,t)=>{if("string"!=typeof e)throw b.InvalidArgument("file",this.loadPath);return t&&(l[e]||(l[e]=t)),l[e]||""}),this.root=(e=>("string"!=typeof e||f||(f=e).endsWith("/")||(f+="/"),f)),this.resolvePath=(e=>{if("string"!=typeof e)throw b.InvalidArgument("path",this.resolvePath);return e.replace("./",this.root())}),this.loadScripts=((...e)=>new Promise((t,n)=>{try{ke(e,()=>{t()})}catch(e){n(e)}})),this.onError=(e=>{if(!h)throw e;h.raiseError(e)})};let te=new ee("default"),ne=te.unload;delete te.unload;const re=te;d("AppDomain",re,()=>{ne()});const ie=(e,t,n)=>{let i=q("obj: flairinstance, memberName: string","obj: flairinstance, memberName: string, attrName: string","obj: flairtype","obj: flairtype, attrName: string")(e,t,n);i.throwOnError(ie);let s=[],a=e[r],o=null,l=null;return i.values.attrName?(l=i.index>1?a.attrs.type.probe(i.values.attrName).current():a.attrs.members.probe(i.values.attrName,i.values.memberName).current())&&s.push(C(l,"name, isCustom, args, type",!0)):(o=i.index>1?a.attrs.type.all().current():a.attrs.members.all(i.values.memberName).current())&&s.push(...C(o,"name, isCustom, args, type",!0)),s};d("getAttr",ie);const se=e=>{let t=q("Type: flairtype","Type: flairinstance","Type: string")(e);t.throwOnError(se);let n=null,i="",s="";switch(t.index){case 0:n=e[r].assembly();break;case 1:n=e[r].Type[r].assembly();break;case 2:e.startsWith("[")&&e.endsWith("]")?(s=e.substr(1,e.length-2),n=re.context.getAssemblyByName(s)):(i=re.resolve(e))&&(n=re.context.getAssembly(i));break}return n};d("getAssembly",se);const ae=e=>{let t;return q("Type: string")(e).throwOnError(ae),re.resolve(e)};d("getAssemblyOf",ae);const oe=e=>{let t;return q("Type: flairtype")(e).throwOnError(oe),e[r].context};d("getContext",oe);const le=e=>{let t;q("qualifiedName: string")(e).throwOnError(le);let n=re.context.getResource(e)||null;return n?n.data:null};d("getResource",le);const ce=e=>{let t;q("qualifiedName: string")(e).throwOnError(ce),re.context.getRoute(e)};d("getRoute",ce);const ue=e=>{let t;return q("qualifiedName: string")(e).throwOnError(ue),re.context.getType(e)};d("getType",ue);const fe=e=>{let t;q("obj: flair")(e).throwOnError(fe);let n=e[r];return n&&n.Type||null};d("getTypeOf",fe);const pe=e=>{let t;q("obj: flair")(e).throwOnError(pe);let n=e[r].Type?e[r].Type[r]:e[r];return n&&n.name||""};d("getTypeName",pe);const me=(e,t)=>{let n;return q("name: undefined","name: string","name: string, asInType: string")(e,t).throwOnError(me),"string"==typeof t?new Promise((n,r)=>{je(t).then(()=>{n(re.context.namespace(e))}).catch(r)}):re.context.namespace(e)};d("ns",me);const de=(e,t)=>{if("class"!==U(e))throw b.InvalidArgument("Type",de);if(-1===["string","class"].indexOf(U(t)))throw b.InvalidArgument("Parent",de);return e[r].isDerivedFrom(t)};d("isDerivedFrom",de);const he=e=>{if("class"!==U(e))throw b.InvalidArgument("Type",he);return e[r].isAbstract()};d("isAbstract",he);const ye=e=>{if("class"!==U(e))throw b.InvalidArgument("Type",ye);return e[r].isSealed()};d("isSealed",ye);const ge=e=>{if("class"!==U(e))throw b.InvalidArgument("Type",ge);return e[r].isStatic()};d("isStatic",ge);const be=e=>{if("class"!==U(e))throw b.InvalidArgument("Type",be);return e[r].isSingleton()};d("isSingleton",be);const ve=e=>{if("class"!==U(e))throw b.InvalidArgument("Type",ve);return e[r].isDeprecated()};d("isDeprecated",ve);const we=(e,t)=>{let n=U(e),i=U(t),s=!1;if(-1===l.indexOf(n))throw b.InvalidArgument("obj",we);if(-1===o.indexOf(i)&&"string"!==i)throw b.InvalidArgument("Type",we);let a=e[r];switch(i){case"class":(s=a.isInstanceOf(t))||(s=a.Type[r].isDerivedFrom(t));break;case"struct":s=a.isInstanceOf(t);break;case"interface":s=a.isImplements(t);break;case"mixin":s=a.isMixed(t);break;case"string":(s=a.isInstanceOf(t))||"function"!=typeof a.isImplements||(s=a.isImplements(t)),s||"function"!=typeof a.isMixed||(s=a.isMixed(t));break}return s};d("isInstanceOf",we);const xe=(e,t)=>{if(t[r]&&(t=t[r].name),"string"!==U(t))throw b.InvalidArgument("type",xe);return W(e,t)?e:null};d("as",xe);const Oe=(e,t)=>{if(!e)throw b.InvalidArgument("obj",Oe);if("interface"!==U(t))throw b.InvalidArgument("intf",Oe);let n=!0;for(let i in t)if(t.hasOwnProperty(i)&&i!==r){if(!e[i]){n=!1;break}if("function"==typeof t[i]&&"function"!=typeof e[i]){n=!1;break}}return n};d("isComplies",Oe);const Ie=(e,t)=>{if(-1===["class","instance"].indexOf(U(e)))throw b.InvalidArgument("obj",Ie);if(-1===["string","interface"].indexOf(U(t)))throw b.InvalidArgument("intf",Ie);return e[r].isImplements(t)};d("isImplements",Ie);const Ae=(e,t)=>{if(-1===["class","instance"].indexOf(U(e)))throw b.InvalidArgument("obj",Ae);if(-1===["string","mixin"].indexOf(U(t)))throw b.InvalidArgument("mixin",Ae);return e[r].isMixed(t)};d("isMixed",Ae);const $e=[],ke=(t,n)=>{let r=q("deps: string, fn: afunction","deps: array, fn: afunction")(t,n);r.throwOnError(ke),0===r.index&&(t=[t]);let s=[],a=t.slice(),o=()=>{n(...s)},l=()=>{if(0!==a.length){let t=a.shift().trim(),n=null,r=e=>{if(t.startsWith("[")&&t.endsWith("]")&&-1===t.indexOf(".")){let e=t.substr(1,t.length-2).trim();"string"==typeof(n=Ye.resolve(e,!1))&&(t=n,n=null)}e()},o=e=>{-1===t.indexOf("/")&&((n=ue(t))||(n=le(t))),e()},c=e=>{if(-1===t.indexOf("/")){let r=ae(t);r?re.context.loadAssembly(r).then(()=>{(n=ue(t))||(n=le(t)),e()}).catch(e=>{throw b.OperationFailed(`Assembly could not be loaded. (${r})`,e,ke)}):e()}else e()},u=r=>{if(t.startsWith("./")){let i=t.substr(t.lastIndexOf(".")+1).toLowerCase();if(t=re.resolvePath(t),i)if("js"===i||"mjs"===i)t=w(t,!0),S(t).then(e=>{n=e||!0,r()}).catch(e=>{throw b.OperationFailed(`Module/File could not be loaded. (${t})`,e,ke)});else if(e)if("json"===i)S(t).then(e=>{n=e||!0,r()}).catch(e=>{throw b.OperationFailed(`Local Module/File could not be loaded. (${t})`,e,ke)});else{let e=require("fs");try{n=e.readFileSync(t),r()}catch(e){throw b.OperationFailed(`Local File could not be read. (${t})`,e,ke)}}else P(t).then(e=>{n=e,r()}).catch(e=>{throw b.OperationFailed(`File could not be loaded. (${t})`,e,ke)});else r()}else r()},f=r=>{t.startsWith("./")?r():(e||(t=`./${i}/${t}`),t=w(t,!0),S(t).then(e=>{n=e||!0,r()}).catch(e=>{throw b.OperationFailed(`Module could not be loaded. (${t})`,e,ke)}))},p=e=>{s.push(n),e||$e.pop(),l()};if(""===(t=w(t)))return n=!0,void p(!0);if(-1!==$e.indexOf(t))throw b.Circular(t,ke);$e.push(t),r(()=>{n?p():o(()=>{n?p():c(()=>{n?p():u(()=>{n?p():f(()=>{if(!n)throw b.OperationFailed(`Dependency could not be resolved. (${t})`,ke);p()})})})})})}else o()};l()};d("bring",ke,()=>{$e.length=0});const je=(e,t)=>new Promise((n,r)=>{if("string"==typeof e)try{ke([e],i=>{i?"boolean"!=typeof i||"string"!=typeof t||(i=(!0)[t])?n(i):r(b.OperationFailed(`Dependency object could not be located. (${e})`)):r(b.OperationFailed(`Dependency could not be resolved. (${e})`))})}catch(e){r(e)}else r(b.InvalidArgument("dep"))});d("include",je);const Te=e=>{let t=q("obj: instance","obj: boolean")(e);t.throwOnError(Te),1===t.index&&!0===e?(We(),s.forEach(e=>{e()}),s.length=0):"function"==typeof e[r].dispose&&e[r].dispose()};d("dispose",Te);const Pe=(e,t)=>{let n=q("obj: instance, fn: afunction","obj: string, fn: afunction")(e,t);if(n.throwOnError(Pe),1===n.index){let t=ue(e);if(!t)throw b.NotFound(e,Pe);e=new t}let i=null,s=!1,a=!1,o=()=>{s||"function"!=typeof e[r].dispose||(s=!0,e[r].dispose())};try{(i=t(e))&&"function"==typeof i.finally&&(a=!0,i=i.finally(()=>{o()}))}finally{a||o()}return i};d("using",Pe);const Se=(e,...t)=>{let n=q("name: string","name: Attribute")(e);n.throwOnError(Se);let i=null,s=null,a=null;if(0===n.index){if(!(a=De.inbuilt[e]||null)){if(!(i=ue(e)))throw b.NotFound(e,Se);e=i[r].name}}else e=(i=e)[r].name;if(-1!==I(De.bucket,"name",e))throw b.Duplicate(e,Se);if(i){try{s=new i(...t)}catch(e){throw new b(e,Se)}a=new Ne(s.constraints)}De.bucket.push({name:e,cfg:a,isCustom:null!==s,attr:s,args:t})},Ne=function(e,t){let n=q("isModifier: boolean, constraints: string","constraints: string","isModifier: boolean,")(e,t),r;return n.throwOnError(Ne),{isModifier:n.values.isModifier||!1,constraints:n.values.constraints}},Ce=(e,...t)=>Se(e,...t),De=Ce[r]=Object.freeze({bucket:[],inbuilt:Object.freeze({static:new Ne(!0,"(class && !$abstract) || ((class && (prop || func)) && !($abstract || $virtual || $override))"),abstract:new Ne(!0,"(class && !$sealed && !$static) || ((class && (prop || func || event)) && !($override || $sealed || $static))"),virtual:new Ne(!0,"class && (prop || func || construct || dispose || event) && !($abstract || $override || $sealed || $static)"),override:new Ne(!0,"(class && (prop || func || construct || dispose || event) && ((@virtual || @abstract || @override) && !(virtual || abstract)) && !(@sealed || $static))"),sealed:new Ne(!0,"(class || ((class && (prop || func || event)) && override))"),private:new Ne(!0,"(class || struct) && (prop || func || event) && !($protected || @private || $static)"),protected:new Ne(!0,"(class) && (prop || func || event) && !($private || $static)"),readonly:new Ne(!0,"(class || struct) && prop && !abstract"),async:new Ne(!0,"(class || struct) && func"),privateSet:new Ne(!0,"(class || struct) && prop && !($private || $static)"),protectedSet:new Ne(!0,"(class) && prop && !($protected || $private || $static)"),overload:new Ne("((class || struct) && (func || construct) && !($virtual || $abstract || $override || $args))"),enumerate:new Ne("(class || struct) && prop || func || event"),dispose:new Ne("class && prop"),post:new Ne("(class || struct) && event"),fetch:new Ne("(class || struct) && (func && async) && !(timer || on || @fetch)"),on:new Ne("class && func && !(event || $async || $args || $overload || $inject || $static)"),timer:new Ne("class && func && !(event || $async || $args || $inject || @timer || $static)"),type:new Ne("(class || struct) && prop"),args:new Ne("(class || struct) && (func || construct) && !$on && !$overload"),inject:new Ne("class && (prop || func || construct) && !(static || session || state)"),resource:new Ne("class && prop && !(session || state || inject || asset)"),asset:new Ne("class && prop && !(session || state || inject || resource)"),singleton:new Ne("(class && !(prop || func || event) && !($abstract || $static))"),serialize:new Ne("((class || struct) || ((class || struct) && prop)) && !($abstract || $static || noserialize)"),deprecate:new Ne("!construct && !dispose"),session:new Ne("(class && prop) && !($static || $state || $readonly || $abstract || $virtual)"),state:new Ne("(class && prop) && !($static || $session || $readonly || $abstract || $virtual)"),conditional:new Ne("(class || struct) && (prop || func || event)"),noserialize:new Ne("(class || struct) && prop"),aspects:new Ne("(class && func)"),ns:new Ne("(class || struct || mixin || interface || enum) && !(prop || func || event || construct || dispose)"),mixin:new Ne("class && (prop || func || event)"),interface:new Ne("class && (prop || func || event)")})});for(let e in De.inbuilt)De.inbuilt.hasOwnProperty(e)&&(Se[`$$${e}`]=((...t)=>{Se(e,...t)}));Ce.collect=(()=>{let e=De.bucket.slice();return Ce.clear(),e}),Ce.has=(e=>{if("string"!=typeof e)throw b.InvalidArgument("name");return-1!==De.bucket.findIndex(t=>t.name===e)}),Ce.get=(e=>{if("string"!=typeof e)throw b.InvalidArgument("name");let t=De.bucket.findIndex(t=>t.name===e);return-1!==t?De.bucket[t]:null}),Ce.count=(()=>De.bucket.length),Ce.clear=(()=>{De.bucket.length=0}),d("$$",Se);const Ee=(e,t,n,i,s)=>{let a=Ce.collect(),l=null,c=null,u=Fe(!0,e,t),f=Fe(!1,e,t),p="";if(i?(l=t.attrs.type,c=t.modifiers.type,p=`${t.name}`):(l=e.attrs.members[n],c=e.modifiers.members[n],p=`${e.name}::${n}`),!s)for(let e of a)if(e.isCustom)throw b.InvalidOperation(`Custom attribute cannot be applied. (${e.name})`,qe);const m=s=>{let a=!1,l=o,c=["prop","func","construct","dispose","event"],m=["static","abstract","sealed","virtual","override","private","privateSet","protected","protectedSet","readonly","async"],d=[],h=[],y=s.cfg.constraints;const g=e=>{let t={withWhat:"",matchType:"",original:e,name:"",value:!1};switch(e.substr(0,1)){case"$":t.matchType="anywhere",t.name=e.substr(1);break;case"@":t.matchType="inherited",t.name=e.substr(1);break;default:t.matchType="current",t.name=e;break}e.endsWith("^")?(t.withWhat="typeName",t.name=t.name.replace("^","")):-1!==l.indexOf(t.name)?(t.withWhat="typeType",t.matchType="current"):-1!==c.indexOf(t.name)?(t.withWhat="memberType",t.matchType="current"):m.indexOf(t.name)!==0-1?t.withWhat="modifier":t.withWhat="attribute","struct"===t.name?h.push(t):d.push(t)},v=()=>{let e=new RegExp("[^!&!|()]","g"),t="",n=[],r=0;for(;1&&null!==(t=e.exec(y));)n.push(t);t="",r=0;for(let e of n)r++," "!==e[0]?(t+=e[0],r===n.length&&(""!==t&&g(t),t="")):(""!==t&&g(t),t="");d=d.concat(h)};v();for(let s of d){switch(s.withWhat){case"typeName":switch(s.matchType){case"anywhere":s.value=s.name===t.name||t.Type[r].isDerivedFrom(s.name);break;case"inherited":s.value=t.Type[r].isDerivedFrom(s.name);break;case"current":s.value=s.name===t.name;break}break;case"typeType":s.value=t.type===s.name;break;case"memberType":s.value=!i&&e.members[n]===s.name;break;case"modifier":s.value=i?!!u.type.probe(s.name)[s.matchType]():!!u.members.probe(s.name,n)[s.matchType]();break;case"attribute":s.value=i?!!f.type.probe(s.name)[s.matchType]():!!f.members.probe(s.name,n)[s.matchType]();break}y=j(y,s.original,s.value.toString())}try{if(!(a=new Function("try {return ("+y+");}catch(e){return false;}")()))throw b.InvalidOperation(`${s.cfg.isModifier?"Modifier":"Attribute"} ${s.name} could not be applied. (${p} --\x3e [${y}])`,qe)}catch(e){throw b.OperationFailed(`${s.cfg.isModifier?"Modifier":"Attribute"} ${s.name} could not be applied. (${p} --\x3e [${y}])`,e,qe)}return a};for(let n of a)m(n)&&((n=C(n,null,!1,{type:i?t.name:e.name})).isCustom?l.push(n):n.cfg.isModifier?c.push(n):l.push(n))},Fe=(e,t,n)=>{let r=e?"modifiers":"attrs",i=(e,i,s,a)=>{let o=null;if(i&&"construct"===i&&(i="_construct"),i&&"dispose"===i&&(i="_dispose"),a)if(s){let t=n.previous();for(;1&&null!==t&&(t[r]&&t[r].type&&(o=A(t[r].type,"name",e)),!o);)t=t.previous()}else n[r]&&n[r].type&&(o=A(n[r].type,"name",e));else if(s){let n=t.previous();for(;1&&null!==n&&(n[r]&&n[r].members[i]&&(o=A(n[r].members[i],"name",e)),!o);)n=n.previous()}else t[r]&&t[r].members[i]&&(o=A(t[r].members[i],"name",e));return o},s=(e,t,n,r)=>null!==i(e,t,n,r);const a=(e,t)=>{let n;return Object.freeze({anywhere:()=>i(e,t,!1,!1)||i(e,t,!0,!1),current:()=>i(e,t,!1,!1),inherited:()=>i(e,t,!0,!1),only:Object.freeze({current:()=>i(e,t,!1,!1)&&!i(e,t,!0,!1),inherited:()=>!i(e,t,!1,!1)&&i(e,t,!0,!1)})})},o=e=>{let t;return Object.freeze({anywhere:()=>i(e,null,!1,!0)||i(e,null,!0,!0),current:()=>i(e,null,!1,!0),inherited:()=>i(e,null,!0,!0),only:Object.freeze({current:()=>i(e,null,!1,!0)&&!i(e,null,!0,!0),inherited:()=>!i(e,null,!1,!0)&&i(e,null,!0,!0)})})},l=e=>{let n=Object.freeze({current:()=>t[r].members[e].slice(),inherited:()=>{let n=[],i=null,s=t.previous();for(;1&&null!==s;)s[r]&&s[r].members&&(i=A(s[r].members,"name",e)),i&&n.push(...i),s=s.previous();return n},anywhere:()=>[...n.current(),...n.inherited()]});return n},c=()=>{let e=Object.freeze({current:()=>n[r].type.slice(),inherited:()=>{let e=[],t=null,i=n.previous();for(;1&&null!==i;)i[r]&&i[r].type&&(t=i[r].type.slice()),t&&e.push(...t),i=i.previous();return e},anywhere:()=>[...e.current(),...e.inherited()]});return e},u={type:Object.freeze({get:(e,t)=>i(e,null,t,!0),has:(e,t)=>s(e,null,t,!0),all:c,probe:o}),members:{get:(e,t,n)=>i(e,t,n,!1),has:(e,t,n)=>s(e,t,n,!1),all:l,probe:a}};return e&&(u.members.is=((e,t)=>{let n=a(e,t);switch(e){case"static":return n.anywhere();case"abstract":return n.anywhere()&&!(a("virtual",t).anywhere()||a("override",t).anywhere());case"virtual":return n.anywhere()&&!a("override",t).anywhere();case"override":return n.anywhere()&&!a("sealed",t).anywhere();case"sealed":return n.anywhere();case"private":return n.anywhere();case"protected":return n.anywhere();case"readonly":return n.anywhere();case"async":return n.anywhere()}}),u.members.type=(e=>{let n,r="";if(!("type"===t.level)){let n=t;for(;1&&null!==n&&(n.members[e]&&(r=n.members[e]),!r);)n=n.previous()}return r}),u.members.isProperty=(e=>"prop"===u.members.type(e)),u.members.isFunction=(e=>"func"===u.members.type(e)),u.members.isEvent=(e=>"event"===u.members.type(e))),u.members=Object.freeze(u.members),Object.freeze(u)},ze=e=>{let t={getType:function(){let e;return this.instance.def.Type}},n={id:v()};e.ex.instance=T(e.ex.instance,t,!1),e.mex.instance=T(e.mex.instance,n,!1);let r={getName:function(){let e;return this.type.def.name}},i={id:v()};e.ex.type=T(e.ex.type,r,!1),e.mex.type=T(e.mex.type,i,!1)},Me=(e,t,n,r,i,s)=>{let a={type:{Type:t,def:r,attrs:i,modifiers:s}};for(let t in e)e.hasOwnProperty(t)&&("function"==typeof e[t]?Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value:e[t].bind(a)}):Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value:e[t]}))},Re=(e,t,n,r,i,s,a,o,l,c)=>{let u={instance:{obj:t,def:i,attrs:a,modifiers:o},type:{Type:r,typeDef:s,attrs:l,modifiers:c}};for(let t in e)"function"==typeof e[t]?Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value:e[t].bind(u)}):Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value:e[t]})},Ue=(e,t,n,i,s,...o)=>{let l=t[r],c=l.def(),u="___flag___",f={_flagName:u};if(void 0!==i&&i===u?(f.isNeedProtected=!0,f.isTopLevelInstance=!1,f.staticInterface=e.static?s:null,f.args=o):(f.isNeedProtected=!1,f.isTopLevelInstance=!0,f.staticInterface=e.static?t:null,f.args=void 0!==i?void 0!==s?[i,s].concat(o):[i]:[]),e.singleton&&!c.staticConstructionCycle&&!$t&&f.isTopLevelInstance&&l.singleInstance.value)return l.singleInstance.value;let p={},m=null,d=null,y=null,g="_construct",v="_dispose",w={},I={},A=null,k={name:e.params.typeName,type:e.types.type,Type:t,level:"object",members:{},attrs:{members:{}},modifiers:{members:{}},previous:()=>A},P=null,S=!1,C=null,D=e.storage?G("sessionStorage"):null,E=e.storage?G("localStorage"):null;const F=Object.freeze({id:j(k.name,".","_"),name:k.name,assemblyName:ae(k.name),Type:k.Type,members:()=>{let e={};for(let t in k.members){e[t]={name:t,type:k.members[t],modifiers:[],attrs:[]};for(let n of k.modifiers.members[t])e[t].modifiers.push(n.name);for(let n of k.attrs.members[t])e[t].attrs.push(n.name);e[t].modifiers=Object.freeze(e[t].modifiers),e[t].attrs=Object.freeze(e[t].attrs),e[t]=Object.freeze(e[t])}return Object.freeze(e)}}),z=(e,t,n,r)=>{for(let i of ie.members.all(t).current())if(i.isCustom){if("prop"===n){let n=i.attr.decorateProperty(k.name,t,r);if(!n.get||!n.set)throw b.OperationFailed(`${i.name} decoration result is unexpected. (${k.name}::${t})`,qe);n.get=n.get.bind(e),n.set=n.set.bind(e),r=n}else{let s=null;if("func"===n){if(s=i.attr.decorateFunction(k.name,t,r),O(r)!==O(s))throw b.OperationFailed(`${i.name} decoration result is unexpected. (${k.name}::${t})`,qe)}else s=i.attr.decorateEvent(k.name,t,r);if(!s)throw b.OperationFailed(`${i.name} decoration result is unexpected. (${k.name}::${t})`,qe);r=s.bind(e)}i.attr=null}return r},M=(e,t,n)=>{let r=null,i=[];return i=st(k.name,e,n),k.aspects.members[e]=i,i.length>0&&(r=at(t,k.name,e,i))&&(t=r),t},R=()=>{let i=!1,s=e=>{Object.defineProperty(p,e,Object.getOwnPropertyDescriptor(n,e))},a=Object.getOwnPropertyDescriptor(n,r);a.enumerable=!1,Object.defineProperty(p,r,a),d=p[r];for(let e in n)if(i=!1,n.hasOwnProperty(e)&&e!==r){if(i=!0,k.members[e]?(re.members.probe("private",e).current()&&(i=!1),i&&re.members.probe("protected",e).current()&&!f.isNeedProtected&&(i=!1)):re.members.probe("protected",e).anywhere()&&!f.isNeedProtected&&(i=!1),i&&s(e),i&&re.members.isProperty(e))if(re.members.probe("privateSet",e).current()){let t=Object.getOwnPropertyDescriptor(p,e);t.set=h,Object.defineProperty(p,e,t)}else if(re.members.probe("protectedSet",e).current()&&!f.isNeedProtected){let t=Object.getOwnPropertyDescriptor(p,e);t.set=h,Object.defineProperty(p,e,t)}if(i&&re.members.is("abstract",e)){if(!f.isNeedProtected)throw b.NotImplemented(`Abstract member is not implemented. (${k.name}::${e})`,qe);if(!re.type.probe("abstract").current())throw b.InvalidDefinition(`Abstract member can exists only in abstract type. (${k.name}::${e})`,qe)}if(i){let t=ie.members.probe("enumerate",e).current();if(t&&!1===t.args[0]){let t=Object.getOwnPropertyDescriptor(p,e);t.enumerable=!1,Object.defineProperty(p,e,t)}}i&&!f.isNeedProtected&&re.members.isEvent(e)&&p[e].strip(p)}f.isTopLevelInstance&&(Re(e.ex.instance,p,p,t,k,c,ie,re,l.attrs,l.modifiers),Re(e.mex.instance,p,d,t,k,c,ie,re,l.attrs,l.modifiers)),f.isTopLevelInstance||(d.def=k)},_=(t,n)=>{if((-1===Object.keys(p).indexOf(t)||re.members.type(t)!==n[r].modifiers.members.type(t))&&("dispose"!==t||"function"!=typeof p[v]&&"function"!=typeof d.dispose))throw b.NotImplemented(`Interface member is not implemented. (${n[r].name+":"+t})`,qe);Ce("interface",n[r].name),Ee(k,c,t,!1,e.customAttrs)},V=()=>{if(k.interfaces){for(let e of k.interfaces)for(let t in e)e.hasOwnProperty(t)&&_(t,e);delete k.interfaces}},J=(t,n,r)=>{switch(-1!==["func","prop","event"].indexOf(n)&&t.startsWith("_")&&new b("InvalidName",`Name is not valid. (${k.name}::${t})`),n){case"func":if(!e.func)throw b.InvalidOperation(`Function cannot be defined on this type. (${k.name})`,qe);break;case"prop":if(!e.prop)throw b.InvalidOperation(`Property cannot be defined on this type. (${k.name})`,qe);break;case"event":if(!e.event)throw b.InvalidOperation(`Event cannot be defined on this type. (${k.name})`,qe);break;case"construct":if(!e.construct)throw b.InvalidOperation(`Constructor cannot be defined on this type. (${k.name})`,qe);n="func";break;case"dispose":if(!e.dispose)throw b.InvalidOperation(`Dispose cannot be defined on this type. (${k.name})`,qe);n="func";break}return n},H=(t,r,i)=>{let s=!0,o=ie.members.probe("conditional",t).current();if(o){let e=$(o.args[0]||[]);for(let t of e){if("test"!==(t=t.toLowerCase())||!a.env.isTesting){s=!1;break}if("server"!==t||!a.env.isServer){s=!1;break}if("client"!==t||!a.env.isClient){s=!1;break}if("worker"!==t||!a.env.isWorker){s=!1;break}if("main"!==t||!a.env.isMain){s=!1;break}if("debug"!==t||!a.env.isDebug){s=!1;break}if("prod"!==t||!a.env.isProd){s=!1;break}if("cordova"!==t||!a.env.isCordova){s=!1;break}if("nodewebkit"!==t||!a.env.isNodeWebkit){s=!1;break}if(-1===a.symbols.indexOf(t)){s=!1;break}}if(!s)return s}if(e.inheritance&&re.members.probe("abstract",t).current()&&!0!==i.ni)throw b.InvalidDefinition(`Abstract member must not be implemented. (${k.name}::${t})`,qe);if((o=re.type.probe("static").current())&&e.static)if(l.isStatic()){if(e.construct&&t===g&&0!==i.length)throw b.InvalidDefinition(`Static constructors cannot have arguments. (${k.name}::construct)`,qe);if(e.dispose&&t===v)throw b.InvalidDefinition(`Static types cannot have destructors. (${k.name}::dispose)`,qe)}else{if(e.construct&&t===g)throw b.InvalidDefinition(`Non-static types cannot have static constructors. (${k.name}::construct)`,qe);if(e.dispose&&t===v)throw b.InvalidDefinition(`Static destructors cannot be defined. (${k.name}::dispose)`,qe)}if(e.dispose&&t===v&&0!==i.length&&(i.length>1||1===i.length&&!re.members.probe("override",t).current()))throw b.InvalidDefinition(`Destructor method cannot have arguments. (${k.name}::dispose)`,qe);if(-1!==Object.keys(n).indexOf(t)&&(!e.inheritance||e.inheritance&&!re.members.probe("override",t).current()))throw b.Duplicate(k.name+"::"+t,qe);if(e.inheritance&&re.members.probe("override",t).current()){if(-1===Object.keys(n).indexOf(t))throw b.InvalidDefinition(`Member not found to override. (${k.name}::${t})`,qe);if(re.members.type(t)!==r)throw b.InvalidDefinition(`Overriding member type is invalid. (${k.name}::${t})`,qe)}if(e.static&&(re.members.probe("static",t).current()||l.isStatic()))if("func"===r){if(x(i))throw b.InvalidDefinition(`Static functions cannot be defined as an arrow function. (${k.name}::${t})`,qe)}else if("prop"===r){if(i.get&&"function"==typeof i.get&&x(i))throw b.InvalidDefinition(`Static property getters cannot be defined as an arrow function. (${k.name}::${t})`,qe);if(i.set&&"function"==typeof i.set&&x(i))throw b.InvalidDefinition(`Static property setters cannot be defined as an arrow function. (${k.name}::${t})`,qe)}if(e.storage&&ie.members.probe("session",t).current()&&i.get&&"function"==typeof i.get)throw b.InvalidDefinition(`Session properties cannot be defined with a custom getter/setter. (${k.name}::${t})`,qe);if(e.storage&&ie.members.probe("state",t).current()){if(i.get&&"function"==typeof i.get)throw b.InvalidDefinition(`State properties cannot be defined with a custom getter/setter. (${k.name}::${t})`,qe);if(!E)throw b.InvalidOperation("Port is not configured. (localStorage)",qe)}return s},X=(t,i,s)=>{let a={get:null,set:null},o=h,l=h,c=re.members.probe("readonly",t).anywhere(),u=re.members.probe("static",t).anywhere(),p=ie.members.probe("session",t).anywhere(),m=ie.members.probe("state",t).anywhere(),d=ie.members.probe("deprecate",t).current(),y=ie.members.probe("inject",t).current(),g=ie.members.probe("asset",t).current(),v=ie.members.probe("resource",t).current(),x=ie.members.probe("type",t).current(),O=null!==d,I=O?d.args[0]||`Event is marked as deprecate. (${k.name}::${t})`:"",A=w,$=n,j=k.name+"_"+t,T=!1,P=null;if(s&&(s.get||s.set)){if(!e.propGetterSetter)throw b.InvalidDefinition(`Getter/Setter are not allowed. (${k.name}::${t})`,qe);s.get&&"function"==typeof s.get&&(o=s.get),s.set&&"function"==typeof s.set&&(l=s.set),e.static&&u&&($=f.staticInterface),a.get=function(){return O&&console.log(I),o.apply($)}.bind($),a.set=function(e){if(O&&console.log(I),c&&!$[r].constructing)throw b.InvalidOperation(`Property is readonly. (${k.name}::${t})`,qe);if(x&&x.args[0]&&!W(e,x.args[0]))throw b.InvalidArgument("value",qe);return l.apply($,[e])}.bind($)}else{if(e.static&&u){if(A=f.staticInterface[r].props,$=f.staticInterface,x&&x.args[0]&&!W(s,x.args[0]))throw b.InvalidArgument("value",qe);A[j]=s}else if(e.storage&&(p||m)){if(T=!0,p?(A=D,j=n[r].id+"_"+j):A=E,ne(p?"session":"state",j),!A.key(j)){if(x&&x.args[0]&&!W(s,x.args[0]))throw b.InvalidArgument("value",qe);A.setItem(j,JSON.stringify({value:s}))}}else{if(x&&x.args[0]&&!W(s,x.args[0]))throw b.InvalidArgument("value",qe);if(e.numOnlyProps&&"number"!=typeof s)throw b.InvalidArgument("value",qe);A[j]=s}a.get=function(){return O&&console.log(I),T?JSON.parse(A.getItem(j)).value:A[j]}.bind($),a.set=function(e){if(O&&console.log(I),c&&!$[r].constructing)throw b.InvalidOperation(`Property is readonly. (${k.name}::${t})`,qe);if(x&&x.args[0]&&!W(e,x.args[0]))throw b.InvalidArgument("value",qe);T?A.setItem(j,JSON.stringify({value:e})):A[j]=e}.bind($)}if(y&&!u&&!T){let e=y.args[0],t=y.args.length>0?y.args[1]:[],n=y.args.length>1&&y.args[2],r=null;try{switch(U(e)){case"class":case"struct":r=t;break;case"string":if(r=ue(e)){if(-1===["class","struct"].indexOf(U(r)))throw b.InvalidArgument("inject",qe)}else P=Ye.resolve(e,t,n),Array.isArray(P)||(P=[P]);break;default:throw b.InvalidArgument("inject",qe)}!P&&r&&(P=[],t.length>0?P.push(new r(...t)):P.push(new r))}catch(e){throw new b(e,qe)}a.set(P)}if((ie.members.probe("dispose",t).anywhere()||y)&&ne("prop",t),(v||g)&&!T){let e=null;if(v)v.args[0]&&(e=le(v.args[0]));else if(g.args[0]){let t=g.args[0];t.startsWith("../")&&(t=t.substr(3)),t.startsWith("./")&&(t=t.substr(2)),t.startsWith("/")&&(t=t.substr(1)),e=ae(k.name)+"/"+t}e&&a.set(e)}return e.customAttrs&&(a=z($,t,i,a)),a},K=(t,r,i)=>{if("func"===r){let r=Ce.get("overload");if(r){let s,a=e.static&&re.members.probe("static",t).current()?f.staticInterface:n;if(Q(t,i,r),a[t]){if(Ce.count()>1)throw b.InvalidDefinition(`Overloaded function cannot define additional modifiers or attributes. (${k.name}::${t})`,qe);return!0}}}return!1},Q=(t,i,s)=>{let a=e.static&&re.members.probe("static",t).current(),o=a?f.staticInterface:n,l,c,u;(a?o[r].overloads:I)[t+"_"+$(s.args[0]).join("_")]=i},Y=(t,...i)=>{let s=e.static&&re.members.probe("static",t).current(),a=s?f.staticInterface:n,o=s?a[r].overloads:I,l="",c="";for(let e of i)l+="_"+typeof e;return l.startsWith("_")&&(l=l.substr(1)),o[c=t+"_"+l]||null},Z=(t,i,s)=>{let a=null,o=n,l=e.inheritance&&re.members.probe("override",t).current(),c=e.static&&re.members.probe("static",t).current(),u=re.members.probe("async",t).current(),p=ie.members.probe("deprecate",t).current(),m=ie.members.probe("inject",t).current(),d=ie.members.probe("on",t).current(),y=ie.members.probe("timer",t).current(),g=ie.members.probe("args",t).current(),v=ie.members.probe("aspects",t).current(),w=ie.members.probe("fetch",t).current(),x=ie.members.probe("overload",t).current(),I=null!==p,A=I?p.args[0]||`Function is marked as deprecate. (${k.name}::${t})`:"",$=null,j="",T="",P="",S=null,C=[];if(l?!0!==($=n[t].bind(o)).ni&&$!==h||($=null):c&&(o=f.staticInterface),m){let e=m.args[0],t=m.args.length>0?m.args[1]:[],n=m.args.length>1&&m.args[2];C=Ye.resolve(e,t,n),Array.isArray(C)||(C=[C])}if((u=u||O(s))?(w&&w.args.length>0?(j=w.args[0],T=w.args[1],P=w.args[2],S=((e={})=>(e.method=j,N(P,T,e)))):S=null,a=async function(...e){return new Promise(function(n,r){I&&console.log(A);let i=[];if($&&i.push($),S&&i.push(S),C.length>0&&i.push(C),g&&g.args.length>0){let t=q(...g.args)(...e);t.error&&r(t.error,s),i.push(t)}else i=i.concat(e);x&&(s=Y(t,...i));try{let e=s.apply(o,i);e&&"function"==typeof e.then?e.then(n).catch(e=>{r(e,s)}):n(e)}catch(e){r(e,s)}}.bind(o))}.bind(o)):a=function(...e){I&&console.log(A);let n=[];if($&&n.push($),C.length>0&&n.push(C),g&&g.args.length>0){let t=q(...g.args)(...e);t.throwOnError(qe),n.push(t)}else n=n.concat(e);return x&&(s=Y(t,...n)),s.apply(o,n)}.bind(o),e.customAttrs&&(a=z(o,t,i,a)),e.aop){let e=[];v&&v.args.length>0&&(v.args.forEach(e=>{if(!W(e,"Aspect"))throw b.InvalidArgument(`Only Aspect types can be statically weaved on function. (${k.name}::${t})`,qe)}),e=v.args),a=M(t,a,e)}if(d&&d.args.length>0&&(Xe(d.args[0],a),ne("handler",{name:d.args[0],handler:a})),y&&y.args.length>0){let e=!1,i=setInterval(()=>{o[r].constructing||e||(e=!0,n[t](),e=!1)},1e3*y.args[0]);ne("timer",i)}return a},ee=(t,i,s)=>{let a=null,o=null,l=null,c=null,u=e.inheritance&&re.members.probe("override",t).current(),f=ie.members.probe("deprecate",t).current(),m=ie.members.probe("post",t).current(),d=null!==f,h=d?f.args[0]||`Event is marked as deprecate. (${k.name}::${t})`:"",y=n;return C||(C=new B(k.name),ne("event",C)),u&&!0===(l=n[t][r].processor).ni&&(l=null),a=function(...e){return d&&console.log(h),c=l?[l].concat(e):e,s.apply(y,c)}.bind(y),e.customAttrs&&(a=z(y,t,i,a)),o=a,(a=function(...e){let n=e;"function"==typeof o&&(n=o(...e)),C.dispatch(t,n),m&&m.args.length>0&&Ke(m.args[0],n)}.bind(y))[r]=Object.freeze({processor:o}),a.add=(e=>{C.add(t,e)}),a.remove=(e=>{C.remove(t,e)}),a.strip=(e=>{let n=T({},a,!0,["strip"]);delete a.strip,delete e.strip,Object.defineProperty(p,t,{configurable:!0,enumerable:!0,value:Object.freeze(n)})}),a},te=(t,i,s)=>{if(i=J(t,i,s),K(t,i,s))return;k.members[t]=i,k.attrs.members[t]=[],k.modifiers.members[t]=[],e.aop&&(k.aspects={members:{}}),e.mixins&&null!==y&&Ce("mixin",y[r].name),Ee(k,c,t,!1,e.customAttrs);let a=null,o=e.static&&re.members.probe("static",t).current(),l=o?f.staticInterface:n;if(o){if(!c.staticConstructionCycle)return}else if(c.staticConstructionCycle)return;if(H(t,i,s))switch(i){case"func":a=Z(t,i,s),Object.defineProperty(l,t,{configurable:!0,enumerable:!0,value:a});break;case"prop":a=X(t,i,s),Object.defineProperty(l,t,{configurable:!0,enumerable:!0,get:a.get,set:a.set});break;case"event":a=ee(t,i,s),Object.defineProperty(l,t,{configurable:!0,enumerable:!0,value:a});break}},ne=(e,t)=>{m.disposables.push({type:e,data:t})},re=Fe(!0,k,c),ie=Fe(!1,k,c);if(e.inheritance){if(f.isTopLevelInstance&&!c.staticConstructionCycle&&!$t&&re.type.probe("abstract").current())throw b.InvalidOperation(`Cannot create instance of an abstract type. (${k.name})`,qe);let e=l.inherits,t=null;if(e){if((t=e[r]).isSealed()||t.isSingleton()||t.isStatic())throw b.InvalidDefinition(`Cannot inherit from a sealed, static or singleton type. (${t.name})`,qe);if(t.type!==l.type)throw b.InvalidDefinition(`Cannot inherit from another type family. (${t.type})`,qe);if(t.context&&t.context.isUnloaded())throw b.InvalidOperation(`Parent context is not active anymore. (${t.name})`,qe);n=new e(f._flagName,f.staticInterface,f.args),m=n[r],A=m.def,delete m.def}else if(l.context&&l.context.isUnloaded())throw b.InvalidOperation(`Type context is not active anymore. (${l.name})`,qe)}if(void 0===n[r]&&(n[r]={},m=n[r],e.dispose&&(m.disposables=[])),e.mixins&&(k.mixins=e.params.mixins),e.interfaces&&(k.interfaces=e.params.interfaces),m.type=e.types.instance,f.isTopLevelInstance&&(m.Type=t,e.new&&(m.isInstanceOf=(e=>{if(e[r]&&(e=e[r].name),!e)throw b.InvalidArgument("name",qe);return l.name===e||l.isDerivedFrom(e)})),e.mixins&&(m.isMixed=(e=>l.isMixed(e))),e.interfaces&&(m.isImplements=(e=>l.isImplements(e))),m.modifiers=re,m.attrs=ie,$t&&(m.def=k,m.typeDef=c,m.obj=n)),P=new Proxy({},{get:(t,r)=>{if(e.new){if("$self"===r)return F;if("$static"===r)return f.staticInterface}return n[r]},set:(t,r,i)=>{if(e.new&&-1!==["$self","$static"].indexOf(r))throw b.InvalidOperation(`Special members cannot be custom defined. (${r})`,qe);if(S){let e="";"construct"===r?(e="construct",r=g):"dispose"===r?(e="dispose",r=v):"function"==typeof i?!0===i.event?(i!==L&&delete i.event,e="event"):e="func":e="prop",te(r,e,i)}else{if("function"==typeof i)throw b.InvalidOperation(`Redefinition of members is not allowed. (${r})`,qe);n[r]=i}return!0}}),S=!0,e.mixins&&k.mixins&&!c.staticConstructionCycle){for(let e of k.mixins)y=e,e.apply(P),y=null;delete k.mixins}if(e.params.factory.apply(P),Ce.clear(),S=!1,f.isTopLevelInstance&&(e.construct&&"function"==typeof n[g]&&(m.construct=n[g],delete n[g]),e.dispose&&"function"==typeof n[v])){let e=n[v];delete n[v],m.dispose=(()=>{for(let e of m.disposables)switch(e.type){case"session":D.removeItem(e.data);break;case"state":E.removeItem(e.data);break;case"prop":n[e.data]=null;break;case"event":e.data.clear();break;case"handler":Xe(e.data.name,e.data.handler,!0);break;case"timer":clearInterval(e.data);break}"function"==typeof e&&e(),m.disposables.length=0,w=null,A=null,k=null,P=null,C=null,p=null,n=null})}return e.static&&l.isStatic()&&c.staticConstructionCycle&&t.construct&&"function"==typeof t[g]&&(l.construct=t[g],delete t[g]),R(),!e.interfaces||c.staticConstructionCycle||$t||V(),e.construct&&f.isTopLevelInstance&&!c.staticConstructionCycle&&!$t&&"function"==typeof d.construct&&(d.constructing=!0,d.construct(...f.args),delete d.constructing),e.construct&&c.staticConstructionCycle&&"function"==typeof l.construct&&(l.constructing=!0,l.construct(),delete l.constructing),!f.isTopLevelInstance||c.staticConstructionCycle||$t||e.singleton&&ie.type.probe("singleton").current()&&(l.singleInstance.value=p),!f.isTopLevelInstance||c.staticConstructionCycle||$t||(d=Object.freeze(d),p=Object.seal(p)),p},We=()=>{let t=G("sessionStorage");t?t.clear():e?(!0).sessionStorage&&delete global.sessionStorage:sessionStorage.clear()},qe=e=>{if(e.new=e.new||!1,e.mixins=e.mixins||!1,e.interfaces=e.interfaces||!1,e.inheritance=e.inheritance||!1,e.singleton=e.singleton||!1,e.static=e.static||!1,e.const=e.const||!1,e.func=e.func||!1,e.construct=e.construct||!1,e.dispose=e.dispose||!1,e.prop=e.prop||!1,e.propGetterSetter=e.propGetterSetter||!1,e.numOnlyProps=e.numOnlyProps||!1,e.event=e.event||!1,e.storage=e.storage||!1,e.aop=e.aop||!1,e.customAttrs=e.customAttrs||!1,e.types=e.types||{},e.types.instance=e.types.instance||"unknown",e.types.type=e.types.type||"unknown",e.params=e.params||{},e.params.typeName=e.params.typeName||"",e.params.inherits=e.params.inherits||null,e.params.mixinsAndInterfaces=e.params.mixinsAndInterfaces||null,e.params.factory=e.params.factory||null,e.mex=e.mex||{},e.mex.instance=e.mex&&e.mex.instance?e.mex.instance:{},e.mex.type=e.mex&&e.mex.type?e.mex.type:{},e.ex=e.ex||{},e.ex.instance=e.ex&&e.ex.instance?e.ex.instance:{},e.ex.type=e.ex&&e.ex.type?e.ex.type:{},e.params.ns="",e.params.mixins=[],e.params.interfaces=[],e.func||(e.construct=!1,e.dispose=!1),e.prop||(e.storage=!1),e.inheritance||(e.singleton=!1),e.func||e.prop||e.event||(e.aop=!1),e.new&&(e.const=!1),!e.params.typeName||-1!==e.params.typeName.indexOf("."))throw b.InvalidDefinition(`Type name is invalid. (${e.params.typeName})`,qe);let t=Ce.get("ns"),n=t?t.args[0]:"";if(n)switch(n){case"(auto)":throw b.InvalidDefinition(`Namespace '(auto)' should be used only when bundling the type in an assembly. (${n})`,qe);case"(root)":break;default:if(n.startsWith(".")||n.endsWith(".")||/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g.test(n))throw`Namespace name is invalid. (${n})`;e.params.typeName=n+"."+e.params.typeName,e.params.ns=n;break}if(e.params.mixinsAndInterfaces)for(let t of e.params.mixinsAndInterfaces)if(t[r])switch(t[r].type){case"mixin":e.params.mixins.push(t);break;case"interface":e.params.interfaces.push(t);break}delete e.params.mixinsAndInterfaces,ze(e);let i=re.context.current(),s=i.currentAssemblyBeingLoaded()||"",a=null,o=null;if(e.new)if(e.inheritance){if(e.params.inherits&&(ge(e.params.inherits)||be(e.params.inherits)||ye(e.params.inherits)))throw b.InvalidDefinition(`Cannot inherit from a sealed, static or singleton type. (${e.params.inherits[r].name})`,qe);a=function(t,n,...r){return Ue(e,a,{},t,n,...r)}}else a=function(...t){return Ue(e,a,{},null,null,...t)};else a=e.const?function(){return Ue(e,a,{})}:function(...t){if(new.target)throw b.InvalidOperation(`Construction cannot be done for this type. (${e.params.typeName})`,a);e.params.factory.apply(this,...t)};let l={name:e.params.typeName,type:e.types.type,Type:a,level:"type",attrs:{type:[]},modifiers:{type:[]},previous:()=>a[r].inherits?a[r].inherits[r].def():null};const c=Fe(!0,null,l),u=Fe(!1,null,l);if(a[r]={},(o=a[r]).name=e.params.typeName,o.type=e.types.type,o.namespace=null,o.assembly=(()=>i.getAssembly(s)||null),o.context=i,e.inheritance&&(o.inherits=e.params.inherits||null,o.isAbstract=(()=>!!c.type.probe("abstract").current()),o.isSealed=(()=>!!c.type.probe("sealed").current()),o.isDerivedFrom=(t=>{if(t[r]&&(t=t[r].name),"string"!=typeof t)throw b.InvalidArgument("name",o.isDerivedFrom);let n=!1,i=e.params.inherits;if(!n)for(;1&&null!==i;){if(i[r].name===t){n=!0;break}i=i[r].inherits}return n}),o.inherits)){let e=u.type.probe("deprecate").anywhere();if(e){let t=e.args[0]||`Type is marked as deprecated. (${o.name})`;console.log(t)}}if(e.static&&(o.isStatic=(()=>!!c.type.probe("static").current()),o.props={},o.overloads={}),e.singleton&&(o.isSingleton=(()=>!!u.type.probe("singleton").current()),o.singleInstance={value:null}),e.mixins&&(o.mixins=e.params.mixins,o.isMixed=(e=>{if(e[r]&&(e=e[r].name),"string"!=typeof e)throw b.InvalidArgument("name",o.isMixed);let t=!1,n=a;for(;1&&null!==n&&(n[r].mixins&&(t=-1!==A(n[r].mixins,"name",e)),!t);)n=n[r].inherits;return t})),e.interfaces&&(o.interfaces=e.params.interfaces,o.isImplements=(e=>{if(e[r]&&(e=e[r].name),"string"!=typeof e)throw b.InvalidArgument("name",o.isImplements);let t=!1,n=a;for(;1&&null!==n&&(n[r].interfaces&&(t=-1!==A(n[r].interfaces,"name",e)),!t);)n=n[r].inherits;return t})),o.isDeprecated=(()=>!!u.type.probe("deprecate").current()),o.def=(()=>l),o.modifiers=c,o.attrs=u,Ee(null,l,null,!0,e.customAttrs),e.static&&c.type.probe("static").current()){if(e.params.interfaces.length>0)throw b.InvalidDefinition("Static types cannot implement interfaces.",qe);if(e.params.mixins.length>0)throw b.InvalidDefinition("Static types cannot implement mixins.",qe)}if(e.static){let t=e.params.factory?e.params.factory.toString():"";if(o.isStatic()||-1!==t.indexOf(`$$('static')`)||-1!==t.indexOf(`$$("static")`)){l.staticConstructionCycle=!0;let e=new a;Te(e),delete l.staticConstructionCycle}}Me(e.ex.type,a,a,l,u,c),Me(e.mex.type,a,o,l,u,c);let f=null,p=!1;return e.static&&o.isStatic()||e.const?(f=new a,e.const&&(p=!0)):(p=!0,f=a),n&&(o.namespace=re.context.current().registerType(f)),a[r]=Object.freeze(o),p&&Object.freeze(f),f},_e=(e,t,n,r)=>{let i=q("name: string, inherits: class, factory: cfunction","name: string, inherits: class, mixints: array, factory: cfunction","name: string, factory: cfunction","name: string, mixints: array, factory: cfunction")(e,t,n,r);i.throwOnError(_e);let s={new:!0,mixins:!0,interfaces:!0,inheritance:!0,singleton:!0,static:!0,func:!0,construct:!0,dispose:!0,prop:!0,propGetterSetter:!0,event:!0,storage:!0,aop:!0,customAttrs:!0,types:{instance:"instance",type:"class"},params:{typeName:i.values.name,inherits:i.values.inherits,mixinsAndInterfaces:i.values.mixints,factory:i.values.factory},mex:{instance:{},type:{}},ex:{instance:{},type:{}}};return qe(s)};d("Class",_e);const Le=(e,t)=>{let n=q("name: string, factory: cfunction")(e,t);n.throwOnError(Le);let r={const:!0,func:!0,dispose:!0,prop:!0,propGetterSetter:!0,event:!0,types:{instance:"interface",type:"interface"},params:{typeName:n.values.name,factory:n.values.factory}};return qe(r)};d("Interface",Le);const Be=(e,t)=>{let n=q("name: string, factory: cfunction")(e,t);n.throwOnError(Be);let r={new:!0,func:!0,construct:!0,prop:!0,propGetterSetter:!0,types:{instance:"sinstance",type:"struct"},params:{typeName:n.values.name,factory:n.values.factory}};return qe(r)};d("Struct",Be);const Ve=(e,t)=>{let n=q("name: string, factory: cfunction")(e,t);n.throwOnError(Ve);let r={const:!0,prop:!0,numOnlyProps:!0,types:{instance:"enum",type:"enum"},params:{typeName:n.values.name,factory:n.values.factory},mex:{instance:{getName:function(e){let t=this.instance.obj,n=this.instance.def,r="";for(let i in n.members)if(n.members.hasOwnProperty(i)&&"prop"===n.members[i]&&t[i]===e){r=i;break}return r},getNames:function(){let e=this.instance.def,t=[];for(let n in e.members)e.members.hasOwnProperty(n)&&"prop"===e.members[n]&&t.push(n);return t},getValues:function(){let e=this.instance.def,t=this.instance.obj,n=[];for(let r in e.members)e.members.hasOwnProperty(r)&&"prop"===e.members[r]&&n.push(t[r]);return n}}}};return qe(r)};Ve.getName=((e,t)=>{let n;return q("enumType: enum, enumValue: number")(e,t).throwOnError(Ve.getName),e[r].getName(t)}),Ve.getNames=(e=>{let t;return q("enumType: enum")(e).throwOnError(Ve.getNames),e[r].getNames()}),Ve.getValues=(e=>{let t;return q("enumType: enum")(e).throwOnError(Ve.getValues),e[r].getValues()}),Ve.isDefined=((e,t)=>{let n=q("enumType: enum, nameOrValue: number","enumType: enum, nameOrValue: string")(e,t);return n.throwOnError(Ve.isDefined),1===n.index?-1!==e[r].getNames().indexOf(t):""!==e[r].getName(t)}),d("Enum",Ve);const Ge=(e,t)=>{let n=q("name: string, factory: cfunction")(e,t);n.throwOnError(Ge);let r={func:!0,prop:!0,propGetterSetter:!0,event:!0,customAttrs:!0,types:{type:"mixin"},params:{typeName:n.values.name,factory:n.values.factory}};return qe(r)};d("Mixin",Ge);const Je=new B,He=Je.dispatch,Xe=(e,t,n)=>{let r;q("event: string, handler: afunction")(e,t).throwOnError(Xe),n?Je.remove(e,t):Je.add(e,t)};d("on",Xe,()=>{Je.clear()});const Ke=(e,t)=>{if("string"!=typeof e)throw b.InvalidArgument("event",Ke);He(e,t)};d("post",Ke);let Qe={};const Ye={isRegistered:e=>{if("string"!=typeof e)throw b.InvalidArgument("alias",Ye.isRegistered);return void 0!==Qe[e]&&Qe[e].length>0},get:(e,t)=>{if("string"!=typeof e)throw b.InvalidArgument("alias",Ye.get);return t?Qe[e]?Qe[e].slice():[]:Qe[e]?Qe[e][0]:null},register:(e,t)=>{if("string"!=typeof e)throw b.InvalidArgument("alias",Ye.register);if(!t)throw b.InvalidArgument("item",Ye.register);if(-1!==e.indexOf("."))throw b.InvalidArgument("alias",Ye.register);"string"==typeof t&&((t=w(t)).endsWith(".js")||t.endsWith(".mjs"))&&(t=w(t,!0)),Qe[e]||(Qe[e]=[]),Qe[e].push(t)},resolve:(e,t,...n)=>{if("string"!=typeof e)throw b.InvalidArgument("alias",Ye.resolve);if("boolean"!=typeof t)throw b.InvalidArgument("isAll",Ye.resolve);let i=null;const s=e=>{let t=e;if("string"==typeof e)if(e.endsWith(".js")||e.endsWith(".mjs"));else{let t=ue(e);t&&(e=t)}if(-1!==["class","struct"].indexOf(U(e)))try{t=n?new e(...n):new e}catch(t){throw b.OperationFailed(`Type could not be instantiated. (${e[r].name})`,Ye.resolve)}return t};return Qe[e]&&Qe[e].length>0&&(t?(i=[],Qe[e].forEach(e=>{i.push(s(e))})):i=s(Qe[e][0])),i}};d("Container",Ye,()=>{Qe={}});let Ze=h,et=[],tt=500;const nt={on:(e,...t)=>{Ze===h&&("string"==typeof e?t.unshift(e):"function"==typeof e&&Xe("telemetry",e),Ze=((e,n)=>{if(0===t.length||-1!==t.indexOf(e)){let t=Object.freeze({type:e,data:n});et.push(t),et.length>tt-25&&et.splice(0,25),Ke("telemetry",t)}}))},collect:()=>{if(Ze!==h){let e=et.slice();return et.length=0,e}return[]},off:e=>Ze!==h?("function"==typeof e&&Xe("telemetry",e,!0),Ze=h,nt.collect()):[],isOn:()=>Ze!==h,types:Object.freeze({RAW:"raw",EXEC:"exec",INFO:"info",INCL:"incl"})};d("telemetry",nt,()=>{et.length=0});const rt=[],it={register:(e,t)=>{let n;q("pointcut: string, aspect: Aspect")(e,t).throwOnError(it.register);let r=e,i="",s="",a="",o="",l=null;-1!==r.indexOf(":")&&(r=(l=r.split(":"))[0].trim(),a=l[1].trim()||"*"),-1!==r.indexOf(".")?(i=r.substr(0,r.lastIndexOf(".")),s=r.substr(r.lastIndexOf(".")+1)):(i="",s=r),o=j(o=i+"/"+s+":"+a,".","[.]"),o=j(o,"?","."),o=j(o,"*",".*"),rt.push({rex:new RegExp(o),Aspect:t})}},st=(e,t,n)=>{let i=[],s="",a="",o=t.trim(),l="";return-1!==e.indexOf(".")?(s=e.substr(0,e.lastIndexOf(".")).trim(),a=e.substr(e.lastIndexOf(".")+1).trim()):(s="",a=e.trim()),l=s+"/"+a+":"+o,n&&i.push(...n),rt.forEach(e=>{e.rex.test(l)&&-1===I(i,"name",e.Aspect[r].name)&&i.push({name:e.Aspect[r].name,Aspect:e.Aspect})}),i},at=(e,t,n,r)=>{let i=[],s=[],a=[],o=null,l;for(let e of r)(o=new e.Aspect).before!==h&&i.push(o.before),o.around!==h&&a.push(o.around),o.after!==h&&s.push(o.after);return a.length>0&&a.reverse(),function(...r){let o=null,l=null,c={typeName:()=>t,funcName:()=>n,error:e=>(e&&(o=e),o),result:e=>(void 0!==e&&(l=e),l),args:()=>r,data:{}};for(let e of i)try{e(c)}catch(e){o=e}const u=e=>{for(let t of s)try{t(e)}catch(e){c.error(e)}};let f=e,p=null;for(let e of a)f=e(c,f);try{(p=f(...r))&&"function"==typeof p.then?c.result(new Promise((e,t)=>{p.then(t=>{c.result(t),u(c),e(c.result())}).catch(e=>{c.error(e),u(c),t(c.error())})})):(c.result(p),u(c))}catch(e){c.error(e)}return c.result()}};d("Aspects",it,()=>{rt.length=0});const ot=(e,t)=>{let n=null,i=null,s=t?JSON.parse(e):e,a=t?null:e[r].Type,o=a[r];const l=(e,t)=>{let n=e[r],i=n.attrs,s=n.modifiers,a=[],o=!1;for(let n in e)e.hasOwnProperty(n)&&n!==r&&((o=s.members.isProperty(n))&&(o=t?!i.members.probe("noserialize",n).anywhere():i.members.probe("serialize",n).anywhere())&&(o=!(s.members.is("private",n)||s.members.is("protected",n)||s.members.is("static",n)||s.members.is("readonly",n)||i.members.probe("resource",n).anywhere()||i.members.probe("asset",n).anywhere()||i.members.probe("inject",n).anywhere())),o&&a.push(n));return a};if(t){if(!s.type&&!s.data)throw b.InvalidArgument("json");if(!(a=ue(s.type)))throw b.NotFound(s.type,lt.deserialize);try{n=new a}catch(e){throw b.OperationFailed(`Object could not be deserialized. (${s.type})`,e,lt.deserialize)}i=o.attrs.type.probe("serialize").anywhere()?l(n,!0):l(n,!1);for(let e of i)n[e]=s.data[e]}else{i=o.attrs.type.probe("serialize").anywhere()?l(s,!0):l(s,!1),n={type:s[r].Type[r].name,data:{}};for(let e of i)n.data[e]=s[e];try{n=JSON.stringify(n)}catch(e){throw b.OperationFailed(`Object could not be serialized. (${s[r].Type[r].name})`,e,lt.serialize)}}return n},lt={serialize:e=>{if(l.indexOf(-1===U(e)))throw b.InvalidArgument("instance",lt.serialize);return ot(e)},deserialize:e=>{if(!e||"string"!=typeof e)throw b.InvalidArgument("json",lt.deserialize);return ot(e,!0)}};d("Serializer",lt);const ct=4*a.env.cores,ut=Math.round(ct/4),ft=[],pt=()=>{if(ft.length<=ut)return;let e=ft.slice(0),t=()=>{if(0!==e.length){let n=e.shift();n.context.isBusy()?t():n.context.hasActiveInstances().then(e=>{0===e?(n.unload(),ft.shift(),ft.length>ut&&t()):t()}).catch(()=>{t()})}};t()},mt=()=>new Promise((e,t)=>{let n=ft.slice(0),r=()=>{if(0!==n.length){let i=n.shift();i.context.isBusy()?r():i.context.hasActiveInstances().then(t=>{0===t?e(i):r()}).catch(t)}else ft.length{e(t)}).catch(t):t(b.OperationFailed("AppDomain pool limit reached."))};r()}),dt={TaskInfo:function(e,...t){if("string"!=typeof e)throw b.InvalidArgument("qualifiedName",dt.TaskInfo);return Object.freeze({type:e,typeArgs:t})},getHandle:(e,t)=>new Promise((n,r)=>{mt().then(r=>{let i;n({run:(...n)=>new Promise((i,s)=>{r.context.execute({type:e.type,typeArgs:e.typeArgs,func:"run",args:n,keepAlive:!0},t).then(i).catch(s)}),close:()=>new Promise((n,i)=>{r.context.execute({type:e.type,typeArgs:e.typeArgs,func:"",args:[],keepAlive:!1},t).then(n).catch(i).finally(pt)})})}).catch(r)}),invoke:(e,t)=>new Promise((n,r)=>{mt().then(i=>{i.context.execute({type:e.type,typeArgs:e.typeArgs,func:"run",args:[],keepAlive:!1},t).then(n).catch(r).finally(pt)}).catch(r)}),parallel:Object.freeze({invokeMany:(...e)=>{let t=[];for(let n of e)t.push(dt.invoke(n));return t},invoke:Object.freeze({any:(...e)=>Promise.race(dt.parallel.invokeMany(...e)),all:(...e)=>Promise.all(dt.parallel.invokeMany(...e)),each:(e,t,...n)=>new Promise((r,i)=>{let s=dt.parallel.invokeMany(...n),a=0;for(let n of s)n.then(e).catch(t).finally(()=>{a++,s.length===a&&r()})})})}),sequence:Object.freeze({invoke:(...e)=>new Promise((t,n)=>{let r=e.slice(0),i=[],s=()=>{if(0===r.length)return void t(...i);let e=r.shift();dt.invoke(e).then(e=>{i.push(e),s()}).catch(n)};r.length>0?s():t(...i)})})};d("Tasks",dt,()=>{ft.forEach(e=>{e.unload()}),ft.length=0});const ht=e=>{if(e.isServer){if(!(!0).sessionStorage){const e=function(){let e={};this.key=(t=>{if(!t)throw b.InvalidArgument("key",this.key);return!!e.key}),this.getItem=(t=>{if(!t)throw b.InvalidArgument("key",this.getItem);return e.key||null}),this.setItem=((t,n)=>{if(!t)throw b.InvalidArgument("key",this.setItem);if(void 0===n)throw b.InvalidArgument("value",this.setItem);e[t]=n}),this.removeItem=(t=>{if(!t)throw b.InvalidArgument("key",this.removeItem);delete e[t]}),this.clear=(()=>{e={}})};global.sessionStorage=new e}return(!0).sessionStorage}return(!0).sessionStorage};G.define("sessionStorage",["key","getItem","setItem","removeItem","clear"],ht);const yt=e=>e.isServer?ht(e):(!0).localStorage;G.define("localStorage",["key","getItem","setItem","removeItem","clear"],yt);const gt=e=>{let t={require:e=>new Promise((t,n)=>{if("string"==typeof e)try{t(require(e))}catch(e){n(new b(e))}else n(b.InvalidArgument("module"))}),undef:e=>{if("string"!=typeof e)throw b.InvalidArgument("module",t.undef);try{delete require.cache[require.resolve(e)]}catch(e){throw new b(e,t.undef)}}};return t};G.define("serverModule",["require","undef"],gt);const bt=e=>{let t={require:t=>new Promise((n,r)=>{if("string"!=typeof t)return void r(b.InvalidArgument("module"));let i=t.substr(t.lastIndexOf(".")+1).toLowerCase();try{if("undefined"!=typeof require)try{require([t],n,r)}catch(e){r(new b(e))}else if(e.isWorker)try{importScripts(t),n()}catch(e){r(new b(e))}else{let e=(!0).document.createElement("script");e.type="mjs"===i?"module":"text/javascript",e.name=t,e.src=t,e.onload=(()=>{n()}),e.onerror=(e=>{r(new b(e))}),(!0).document.head.appendChild(e)}}catch(e){r(new b(e))}}),undef:e=>{if("string"!=typeof e)throw b.InvalidArgument("module",t.undef);let n=null;(n=(!0).requirejs||null)&&n.undef(e)}};return t};G.define("clientModule",["require","undef"],bt);const vt=e=>e=>new Promise((t,n)=>{if("string"!=typeof e)return void n(b.InvalidArgument("file"));let r=e.substr(e.lastIndexOf(".")+1).toLowerCase();try{let i=null,s="";(i=e.startsWith("https")?require("https"):require("http")).get(e,e=>{e.on("data",e=>{s+=e}),e.on("end",()=>{let i=e.headers["content-type"];if("json"===r||/^application\/json/.test(i))try{let e=JSON.parse(s);t(e)}catch(e){n(new b(e))}else t(s)})}).on("error",e=>{n(new b(e))})}catch(e){n(new b(e))}});G.define("serverFile",vt);const wt=e=>e=>new Promise((t,n)=>{if("string"!=typeof e)return void n(b.InvalidArgument("file"));let r=e.substr(e.lastIndexOf(".")+1).toLowerCase();fetch(e).then(i=>{if(i.ok){let e=i.headers["content-type"];"json"===r||/^application\/json/.test(e)?i.json().then(t).catch(e=>{n(new b(e))}):i.text().then(t).catch(e=>{n(new b(e))})}else n(b.OperationFailed(e,i.status))}).catch(e=>{n(new b(e))})});G.define("clientFile",wt);const xt=e=>t=>{let n={},r=re.config();return r&&r[t]&&(n=M([n,r[t]],!1)),e.isWorker&&r&&r[`worker:${t}`]&&(n=M([n,r[`worker:${t}`]],!1)),n};G.define("settingsReader",xt);const Ot=(e,t,n,r)=>new Promise((i,s)=>{"string"==typeof t?"string"==typeof n&&-1!==["text","json","buffer","form","blob"].indexOf(n)?r?e(t,r).then(e=>{if(e.ok){let t="";switch(n){case"text":t="text";break;case"json":t="json";break;case"buffer":t="arrayBuffer";break;case"form":t="formData";break;case"blob":t="blob";break}e[t]().then(i).catch(e=>{s(new b(e))})}else s(b.OperationFailed(t,e.status))}).catch(e=>{s(new b(e))}):s(b.InvalidArgument("reqData")):s(b.InvalidArgument("resDataType")):s(b.InvalidArgument("url"))}),It=e=>(e,t,n)=>Ot(require("node-fetch"),e,t,n);G.define("serverFetch",It);const At=e=>(e,t,n)=>Ot(fetch,e,t,n);G.define("clientFetch",At);let $t=!1;const kt=[],jt=function(e){if(!e||!e[r]&&-1!==o.indexOf(e[r].type))throw b.InvalidArgument("Type",jt);let t=null,n=null,i=null,s=null,a=null,l=null,c=null;const u=function(e){this.getType=(()=>"modifier"),this.getName=(()=>e.name),this.getArgs=(()=>e.args.slice()),this.getConstraints=(()=>e.cfg.constraints)},f=function(e){this.getType=(()=>"attribute"),this.getName=(()=>e.name),this.getArgs=(()=>e.args.slice()),this.getConstraints=(()=>e.cfg.constraints),this.isCustom=(()=>e.isCustom)},p=function(){this.getTarget=(()=>i),this.getTargetType=(()=>t.type),this.getName=(()=>t.name||""),this.getType=(()=>t.type),this.getId=(()=>t.id),this.getNamespace=(()=>t.namespace),this.getAssembly=(()=>t.assembly()),this.getContext=(()=>t.context),this.isClass=(()=>"class"===t.type),this.isEnum=(()=>"enum"===t.type),this.isStruct=(()=>"struct"===t.type),this.isMixin=(()=>"mixin"===t.type),this.isInterface=(()=>"interface"===t.type),this.isDeprecated=(()=>t.isDeprecated()),this.getModifiers=(()=>{let e=[];for(let t of l.modifiers.type)e.push(u(t));return e}),this.getAttributes=(()=>{let e=[];for(let t of l.attrs.type)e.push(f(t));return e}),this.getAttribute=(e=>{if("string"!=typeof e)throw b.InvalidArgument("name",this.getAttribute);let t=A(l.attrs.type,"name",e);return t?f(t):null}),this.getModifier=(e=>{if("string"!=typeof e)throw b.InvalidArgument("name",this.getModifier);let t=A(l.modifiers.type,"name",e);return t?u(t):null})},m=function(e){e.getMixins=(()=>{let e=[];if(t.mixins)for(let n of t.mixins)e.push(jt(n));return e}),e.isMixed=(n=>{if(!n)throw b.InvalidArgument("name",e.isMixed);return!!t.isMixed&&t.isMixed(n)})},d=function(e){e.getInterfaces=(()=>{let e=[];if(t.interfaces)for(let n of t.interfaces)e.push(jt(n));return e}),e.isImplements=(n=>{if(!n)throw b.InvalidArgument("name",e.isImplements);return!!t.isImplements&&t.isImplements(n)})},h=function(e){e.getInstanceType=(()=>n.type),e.isInstanceOf=(t=>{if(!t)throw b.InvalidArgument("name",e.isInstanceOf);return!!n.isInstanceOf&&n.isInstanceOf(t)})},y=e=>{let t=n.def;for(;1&&null!==t&&!t.members[e];)t=t.previous();return t},g=()=>{let e=null,t=null;c={};for(let r in n.obj){switch((e=y(r)).members[r]){case"prop":t=new x(r,e);break;case"func":t=new O(r,e);break;case"event":t=new $(r,e);break;case"construct":t=new O(r,e);break;case"dispose":t=new O(r,e);break}c[r]=t}},v=()=>{c||g()},w=function(e,n){this.getType=(()=>"member"),this.getMemberType=(()=>n.members[e]),this.getName=(()=>e),this.getModifiers=(()=>{let t=[];for(let n of a.modifiers[e])t.push(u(n));return t}),this.getAttributes=(()=>{let t=[];for(let n of a.attrs[e])t.push(f(n));return t}),this.getAttribute=(t=>{if("string"!=typeof t)throw b.InvalidArgument("name",this.getAttribute);let n=A(a.attrs[e],"name",t);return n?f(n):null}),this.getModifier=(t=>{if("string"!=typeof t)throw b.InvalidArgument("name",this.getModifier);let n=A(a.modifiers[e],"name",t);return n?u(n):null}),this.isPrivate=(()=>null!==A(a.modifiers[e],"name","private")),this.isProtected=(()=>null!==A(a.modifiers[e],"name","protected")),this.isPublic=(()=>!this.isPrivate()&&!this.isProtected()),this.isStatic=(()=>null!==A(a.modifiers[e],"name","static")),this.isSealed=(()=>null!==A(a.modifiers[e],"name","sealed")),this.isAbstract=(()=>null!==A(a.modifiers[e],"name","abstract")),this.isVirtual=(()=>null!==A(a.modifiers[e],"name","virtual")),this.isOverride=(()=>null!==A(a.modifiers[e],"name","virtual")),this.isEnumerable=(()=>Object.getOwnPropertyDescriptor(s,e).enumerable),this.isDeprecated=(()=>null!==A(a.attrs[e],"name","deprecate")),this.isConditional=(()=>null!==A(a.attrs[e],"name","conditional")),this.isMixed=(()=>null!==A(a.attrs[e],"name","mixin")),this.isInterfaced=(()=>null!==A(a.attrs[e],"name","interface")),this.getMixin=(()=>{let n=null,r=A(a.attrs[e],"name","mixin");if(r&&t.mixins)for(let e of t.mixins)if(e===r.name){n=jt(e);break}return n}),this.getInterface=(()=>{let n=null,r=A(a.attrs[e],"name","interface");if(r&&t.interfaces)for(let e of t.interfaces)if(e===r.name){n=jt(e);break}return n})},x=function(e,t){let n=new w(e,t);return n.isReadOnly=(()=>null!==A(a.modifiers[e],"name","readonly")),n.isSerializable=(()=>null!==A(a.attrs[e],"name","serialize")||null===A(a.attrs[e],"name","noserialize")&&null!==A(l.attrs.type,"name","serialize")),n.getValueType=(()=>{let t=A(a.attrs[e],"name","type");if(t)return t.args[0]}),n.isDisposable=(()=>null!==A(a.attrs[e],"name","dispose")),n.isInjectable=(()=>null!==A(a.attrs[e],"name","inject")),n.isResource=(()=>null!==A(a.attrs[e],"name","resource")),n.isAsset=(()=>null!==A(a.attrs[e],"name","asset")),n.isSession=(()=>null!==A(a.attrs[e],"name","session")),n.isState=(()=>null!==A(a.attrs[e],"name","state")),n},O=function(e,t){let n=new w(e,t);return n.isASync=(()=>null!==A(a.modifiers[e],"name","async")),n.isConstructor=(()=>"_construct"===e),n.isDestructor=(()=>"_dispose"===e),n.isSub=(()=>null!==A(a.attrs[e],"name","on")),n.isTimered=(()=>null!==A(a.attrs[e],"name","timer")),n.isInjectable=(()=>null!==A(a.attrs[e],"name","inject")),n.getArgs=(()=>{let t=A(a.attrs[e],"name","args");return t?t.args.slice():null}),n.getAspects=(()=>{if(a.aspects&&a.aspects[e].length>0){let t=[];for(let n of a.aspects[e])t.push(jt(n));return t}return null}),n.getAspect=(t=>{if("string"!=typeof t)throw b.InvalidArgument("name",n.getAspect);if(a.aspects&&a.aspects[e].length>0){let n=A(a.aspects[e],"name",t);if(n)return jt(n)}return null}),n},$=function(e,t){let n=new w(e,t);return delete n.isStatic,n.isPub=(()=>null!==A(a.attrs[e],"name","post")),n},k=function(e){e.getMembers=(e=>{(e=e||{}).types=e.types||[],e.modifiers=e.modifiers||[],e.attrs=e.attrs||[],e.aspects=e.aspects||[],e.inherited=void 0===e.inherited||e.inherited,v();let t=null,n=!0,r=[];for(let i in c)if(n=!0,c.hasOwnProperty(i)){if(t=c[i],e.types.length>0&&-1===e.types.indexOf(t.getMemberType())&&(n=!1),!n||e.inherited||a.members[i]||(n=!1),n&&e.modifiers.length>0)for(let t of e.modifiers)if(-1===I(a.modifiers[i],"name",t)){n=!1;break}if(n&&e.attrs.length>0)for(let t of e.attrs)if(-1===I(a.attrs[i],"name",t)){n=!1;break}if(n&&e.aspects.length>0&&"func"===t.getMemberType())for(let t of e.aspects)if(-1===I(a.aspects[i],"name",t)){n=!1;break}n&&r.push(c[i])}return r}),e.getMember=(t=>{if("string"!=typeof t)throw b.InvalidArgument("memberName",e.getMember);return v(),c[t]||null})},j=function(){let e=new p;return e.getParent=(()=>null!==t.inherits?jt(t.inherits):null),e.isDerivedFrom=(n=>{if(!n)throw b.InvalidArgument("name",e.isDerivedFrom);return!!t.isDerivedFrom&&t.isDerivedFrom(n)}),e.getFamily=(()=>{let e=[],n=t.inherits;for(null!==t.inherits&&e.push(jt(t.inherits));1&&null!==n;)e.push(jt(n)),n=n[r].inherits;return e}),e.isSealed=(()=>!!t.isSealed&&t.isSealed()),e.isAbstract=(()=>!!t.isAbstract&&t.isAbstract()),m(e),d(e),e.isSerializable=(()=>null!==A(l.attrs.type,"name","serialize")),e.isStatic=(()=>!!t.isStatic&&t.isStatic()),e.isSingleton=(()=>!!t.isSingleton&&t.isSingleton()),e.isSingleInstanceCreated=(()=>!!t.singleInstance.value),h(e),k(e),e},T=function(){let e=new p;return e.isSerializable=(()=>null!==A(l.attrs.type,"name","serialize")),h(e),k(e),e},P=function(){let e=new p;return k(e),e},S=function(){let e=new p;return k(e),e},N=function(){let e=new p;return e.getNames=(()=>{let e=[];for(let t of Ve.getNames(s))e.push(x(t,a));return e}),e.getName=(t=>{if(!t)throw b.InvalidArgument("enumValue",e.getName);let n=Ve.getName(s,t);return n?x(n,a):null}),e.getValues=(()=>Ve.getValues(s)),e.isDefined=(t=>{if(!t)throw b.InvalidArgument("nameOrValue",e.isDefined);return Ve.isDefined(s,t)}),e};let C=null,D=null,E=!1;switch($t=!0,e[r].type){case"class":i=e,s=new e,E=!0,C=new j;break;case"struct":i=e,s=new e,E=!0,C=new T;break;case"enum":i=e[r].Type,s=e,C=new N;break;case"mixin":D=_e("temp",[i=e],function(){}),s=new D,E=!0,C=new P;break;case"interface":i=e[r].Type,s=e,C=new S;break}return $t=!1,E&&kt.push(s),t=i[r],n=s[r],a=n.def,l=n.typeDef,C};jt.dispose=(()=>{if(kt.length>0)for(let e of kt)Te(e);kt.length=0}),d("Reflector",jt,()=>{jt.dispose()});const Tt=()=>{};Tt.forEachAsync=z,Tt.replaceAll=j,Tt.splitAndTrim=$,Tt.findIndexByProp=I,Tt.findItemByProp=A,Tt.which=w,Tt.isArrowFunc=x,Tt.isASyncFunc=O,Tt.sieve=C,Tt.deepMerge=M,Tt.getLoadedScript=R,Tt.b64EncodeUnicode=D,Tt.b64DecodeUnicode=E,d("utils",Tt),m.members=Object.freeze(m.members);let Pt=e?__filename:t?self.location.href:R("flair.js","flair.min.js");m.info=Object.freeze({name:"flairjs",title:"Flair.js",file:Pt,version:"0.6.82",copyright:"(c) 2017-2019 Vikas Burman",license:"MIT",lupdate:new Date("Mon, 13 May 2019 19:15:28 GMT")});let St=w("./flair{.min}.js",!0);re.context.current().loadBundledAssembly(St,Pt,(e,t)=>{const{Class:n,Struct:r,Enum:i,Interface:s,Mixin:a,Aspects:o,AppDomain:l,$$:c,attr:u,bring:f,Container:p,include:m,Port:d,on:h,post:y,telemetry:g,Reflector:b,Serializer:v,Tasks:w,as:x,is:O,isComplies:I,isDerivedFrom:A,isAbstract:$,isSealed:k,isStatic:j,isSingleton:T,isDeprecated:P,isImplements:S,isInstanceOf:N,isMixed:C,getAssembly:D,getAttr:E,getContext:F,getResource:z,getRoute:M,getType:R,ns:U,getTypeOf:W,getTypeName:q,typeOf:_,dispose:L,using:B,Args:V,Exception:G,noop:J,nip:H,nim:X,nie:K,event:Q}=e,{TaskInfo:Y}=e.Tasks,{env:Z}=e.options,{forEachAsync:ee,replaceAll:te,splitAndTrim:ne,findIndexByProp:re,findItemByProp:ie,which:se,guid:ae,isArrowFunc:oe,isASyncFunc:le,sieve:ce,deepMerge:ue,getLoadedScript:fe,b64EncodeUnicode:pe,b64DecodeUnicode:me}=e.utils,{$$static:de,$$abstract:he,$$virtual:ye,$$override:ge,$$sealed:be,$$private:ve,$$privateSet:we,$$protected:xe,$$protectedSet:Oe,$$readonly:Ie,$$async:Ae,$$overload:$e,$$enumerate:ke,$$dispose:je,$$post:Te,$$on:Pe,$$timer:Se,$$type:Ne,$$args:Ce,$$inject:De,$$resource:Ee,$$asset:Fe,$$singleton:ze,$$serialize:Me,$$deprecate:Re,$$session:Ue,$$state:We,$$conditional:qe,$$noserialize:_e,$$ns:Le}=c,Be=Z.isServer||Z.isWorker?null:(!0).document,Ve=l.context.current().name,Ge=t,Je=Ge.substr(0,Ge.lastIndexOf("/")+1);l.loadPathOf("flair",Je);let He=JSON.parse('{"bootEngine":"flair.app.BootEngine"}'),Xe=e.Port("settingsReader");if("function"==typeof Xe){let e=Xe("flair");e&&(He=ue([He,e],!1))}He=Object.freeze(He);let Ke=JSON.parse("{}");return Ke=Object.freeze(Ke),l.context.current().currentAssemblyBeingLoaded("./flair{.min}.js"),c("abstract"),c("ns","(root)"),n("Aspect",function(){c("virtual"),this.before=X,c("virtual"),this.around=X,c("virtual"),this.after=X}),c("abstract"),c("ns","(root)"),n("Attribute",function(){c("virtual"),this.construct=(e=>{this.args=e}),c("readonly"),this.args=[],c("readonly"),this.constraints="",c("virtual"),this.decorateProperty=X,c("virtual"),this.decorateFunction=X,c("virtual"),this.decorateEvent=X}),c("ns","(root)"),s("IDisposable",function(){this.dispose=X}),c("ns","(root)"),s("IProgressReporter",function(){this.progress=K}),(()=>{const{IProgressReporter:e,IDisposable:t}=U();c("ns","(root)"),n("Task",[e,t],function(){let e=!1,t=!1,n=l.context.current().name;this.construct=((...e)=>{this.args=e,this.context=l.contexts(n),this.domain=this.context.domain}),c("abstract"),this.dispose=X,c("protected"),this.args=[],c("protected"),this.context=null,c("protected"),this.domain=null,this.run=(async(...n)=>{if(t)throw G.InvalidOperation("Task is already running",this.run);if(t=!0,!e)try{await this.setup(),e=!0}catch(e){throw t=!1,e}try{let e;return await this.onRun(...n)}catch(e){throw e}finally{t=!1}}),this.progress=Q(e=>({data:e})),c("virtual"),c("protected"),c("async"),this.setup=J,c("abstract"),c("protected"),c("async"),this.onRun=X})})(),l.context.current().currentAssemblyBeingLoaded(""),l.registerAdo('{"name":"flair","file":"./flair{.min}.js","mainAssembly":"flair","desc":"True Object Oriented JavaScript","title":"Flair.js","version":"0.6.82","lupdate":"Mon, 13 May 2019 19:15:28 GMT","builder":{"name":"flairBuild","version":"1","format":"fasm","formatVersion":"1","contains":["init","func","type","vars","reso","asst","rout","sreg"]},"copyright":"(c) 2017-2019 Vikas Burman","license":"MIT","types":["Aspect","Attribute","IDisposable","IProgressReporter","Task"],"resources":[],"assets":[],"routes":[]}'),"function"==typeof onLoadComplete&&onLoadComplete(),Object.freeze({name:"flair",settings:He,config:Ke})});let Nt=se("[flair]");return u=Nt.settings(),f=Nt.config(),Object.freeze(m)});
\ No newline at end of file
+!function(e,t){"use strict";"function"==typeof!0&&(!0).amd?(!0)(t):"object"==typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=t()),module.exports=exports=t()):e.flair=t()}(this,function(){"use strict";let e=new Function("try {return this===global;}catch(e){return false;}")(),t=e?!require("worker_threads").isMainThread:void 0!==!0,n=[],r=Symbol("[meta]"),i="modules",s=[],a={},o=["class","enum","interface","mixin","struct"],l=["instance","sinstance"],c="",u={},f={},p=!1,m=async(e,t)=>(p||(p=await m.AppDomain.boot(e,t)),m.AppDomain.app());if(e){let e=process.argv;t&&(e=require("worker_threads").workerData.argv);let n=e.findIndex(e=>!!e.startsWith("--flairSymbols"));-1!==n&&(c=e[n].substr(2).split("=")[1])}else c=(!0).flairSymbols||"";c&&(n=c.split(",").map(e=>e.trim())),a.symbols=Object.freeze(n),a.env=Object.freeze({type:e?"server":"client",isTesting:-1!==n.indexOf("TEST"),isServer:e,isClient:!e,isWorker:t,isMain:!t,cores:(e?require("os").cpus().length:(!0).navigator.hardwareConcurrency)||4,isCordova:!e&&!!(!0).cordova,isNodeWebkit:e&&process.versions["node-webkit"],isProd:-1===n.indexOf("DEBUG")&&-1!==n.indexOf("PROD"),isDebug:-1!==n.indexOf("DEBUG"),isAppMode:()=>p}),m.members=[],m.options=Object.freeze(a),m.env=m.options.env;const d=(e,t,n)=>{m[e]=Object.freeze(t),m.members.push(e),"function"==typeof n&&s.push(n)},h=()=>{};d("noop",h);const y={get:()=>{throw b.NotImplemented("prop",y.get)},set:()=>{throw b.NotImplemented("prop",y.set)},ni:!0};d("nip",y);const g=()=>{throw b.NotImplemented("func",g)};g.ni=!0,d("nim",g);const b=function(e,t,n,r){let i=new Error,s=b;switch(typeof e){case"string":switch(i.name=e,typeof t){case"string":switch(i.message=t,typeof n){case"object":i.error=n,"function"==typeof r&&(s=r);break;case"function":s=n;break}break;case"object":i.message=t.message||"",i.error=t,"function"==typeof n&&(s=n);break;case"function":s=t;break}break;case"object":i.name=e.name||"Unknown",i.message=e.message||"",i.error=e,"function"==typeof t&&(s=t);break}return i.name=i.name||"Undefined",i.name.endsWith("Exception")||(i.name+="Exception"),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(i,s),i.error&&(i.message+="["+i.error+"]"),Object.freeze(i)};b.InvalidArgument=((e,t=b.InvalidArgument)=>new b("InvalidArgument",`Argument type is invalid. (${e})`,t)),b.OperationFailed=((e,t,n=b.OperationFailed)=>new b("OperationFailed",`Operation failed with error. (${e})`,t,n)),b.Duplicate=((e,t=b.Duplicate)=>new b("Duplicate",`Item already exists.(${e})`,t)),b.NotFound=((e,t=b.NotFound)=>new b("NotFound",`Item not found. (${e})`,t)),b.InvalidDefinition=((e,t=b.InvalidDefinition)=>new b("InvalidDefinition",`Item definition is invalid. (${e})`,t)),b.InvalidOperation=((e,t=b.InvalidOperation)=>new b("InvalidOperation",`Operation is invalid in current context. (${e})`,t)),b.Circular=((e,t=b.Circular)=>new b("Circular",`Circular calls found. (${e})`,t)),b.NotImplemented=((e,t=b.NotImplemented)=>new b("NotImplemented",`Member is not implemented. (${e})`,t)),d("Exception",b);const v=()=>"_xxxxxxxx_xxxx_4xxx_yxxx_xxxxxxxxxxxx".replace(/[xy]/g,e=>{var t=16*Math.random()|0,n;return("x"==e?t:3&t|8).toString(16)}),w=(e,t)=>{if(t){if(-1!==e.indexOf("{.min}"))return a.env.isProd?e.replace("{.min}",".min"):e.replace("{.min}","")}else if(-1!==e.indexOf("|")){let t=e.split("|"),n="";return"x"===(n=a.env.isServer?t[0].trim():t[1].trim())&&(n=""),-1!==n.indexOf("~")&&(t=n.split("~"),"x"===(n=a.env.isWorker?t[1].trim():t[0].trim())&&(n="")),n}return e},x=e=>!e.hasOwnProperty("prototype")&&"Function"===e.constructor.name,O=e=>"AsyncFunction"===e.constructor.name,I=(e,t,n)=>e.findIndex(e=>e[t]===n),A=(e,t,n)=>{let r=e.findIndex(e=>e[t]===n);return-1!==r?e[r]:null},$=(e,t)=>(t||(t=","),e.split(t).map(e=>e.trim())),k=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),j=(e,t,n)=>e.replace(new RegExp(k(t),"g"),n),T=(e,t,n,r)=>{r||(r=[]);for(let i in t)if(t.hasOwnProperty(i)&&-1===r.indexOf(i)){if(!n&&i in e)continue;e[i]=t[i]}return e},P=t=>new Promise((n,r)=>{let i=null;(i=G(e?"serverFile":"clientFile"))(t).then(n).catch(r)}),S=(n,r,i)=>new Promise((s,a)=>{e?G("serverModule").require(n).then(s).catch(a):G("clientModule").require(n).then(e=>{e||"string"!=typeof r||(t?(e=(!0)[r]||null,i&&delete WorkerGlobalScope[r]):(e=(!0)[r]||null,i&&delete window[r])),e?s(e):s()}).catch(a)}),N=(t,n,r)=>new Promise((i,s)=>{let a=null;(a=G(e?"serverFetch":"clientFetch"))(t,n,r).then(i).catch(s)}),C=(e,t,n,r)=>{let i=t?$(t):Object.keys(e);const s=t=>{let s={};if(i.length>0)for(let e of i)s[e]=t[e];else for(let t in e)e.hasOwnProperty(t)&&(s[t]=e[t]);if(r)for(let e in r)s[e]=r[e];return n&&(s=Object.freeze(s)),s};if(Array.isArray(e)){let t=[];for(let n of e)t.push(s(n));return t}return s(e)},D=e=>btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function e(t,n){return String.fromCharCode("0x"+n)})),E=e=>decodeURIComponent(atob(e).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join("")),F=t=>{e?G("serverModule").undef(t):G("clientModule").undef(t)},z=(e,t)=>new Promise((n,r)=>{const i=e=>{e&&0!==e.length?Promise((n,r)=>{t(n,r,e.shift())}).then(()=>{i(e)}).catch(r):n()};i(e.slice())}),M=(e,t=!0)=>{const n=e=>e&&"object"==typeof e;return e.reduce((e,r)=>(Object.keys(r).forEach(i=>{const s=e[i],a=r[i];Array.isArray(s)&&Array.isArray(a)?e[i]=t?s.concat(...a):[].concat(...a):n(s)&&n(a)?e[i]=M([s,a],t):e[i]=a}),e),{})},R=(...n)=>{if(e||t)return"";let r="",i="",s=null;for(let e of n){for(let t of(!0).document.scripts)if(t.src.endsWith(e)){(s=(!0).document.createElement("a")).href=t.src,i=s.protocol+"//"+s.host+"/",s=null,r="./"+t.src.replace(i,"");break}if(r)break}return r},U=e=>{let t="";return void 0===e&&(t="undefined"),t||null!==e||(t="null"),t||"number"!=typeof e||!1!==isFinite(e)||(t="infinity"),!t&&Array.isArray(e)&&(t="array"),!t&&e instanceof Date&&(t="date"),!t&&e[r]&&(t=e[r].type),t||(t=typeof e),t};d("typeOf",U);const W=(e,t)=>{if(t[r]&&(t=t[r].name),"string"!==U(t))throw b.InvalidArgument("type",W);let n=!1;if(e)switch(t){case"NaN":n=isNaN(e);break;case"infinity":n="number"==typeof e&&!1===isFinite(e);break;case"array":case"Array":n=Array.isArray(e);break;case"date":case"Date":n=e instanceof Date;break;case"flairtype":n=e[r]&&-1!==o.indexOf(e[r].type);break;case"flairinstance":n=e[r]&&-1!==l.indexOf(e[r].type);break;case"flair":n=void 0!==e[r];break;case"cfunction":n="function"==typeof e&&!x(e);break;case"afunction":n="function"==typeof e&&x(e);break;default:n||(n=typeof e===t),!n&&e[r]&&(n||(n=t===e[r].type),n||-1===l.indexOf(e[r].type)||(n=we(e,t)),n||"class"!==e[r].type||(n=de(e,t)),n||-1===o.indexOf(e[r].type)||(n=e[r].name===t))}else switch(t){case"undefined":n=void 0===e;break;case"null":n=null===e;break;case"NaN":n=isNaN(e);break}return n};d("is",W);const q=(...e)=>{if(0===e.length)throw b.InvalidArgument("patterns",q);let t=(...n)=>{let r=null,i=null,s="",a="",o=-1,l=-1,c=!1,u=0,f="",p={raw:n||[],index:-1,isInvalid:!1,error:null,values:{}};if(e)for(let t of e){o++,l=-1,c=!1,u=0,r=t.split(",");for(let e of r){if(l++,2!==(i=e.split(":")).length?(s=`_${o}_${l}`,a=e.trim()||""):(s=i[0].trim()||"",a=i[1].trim()||""),l>p.raw.length){c=!1;break}if(!W(p.raw[l],a)){c=!1,f=s;break}p.values[s]=p.raw[l],c=!0,u++}if(c&&u===r.length){p.index=o;break}}return p.isInvalid=-1===p.index,p.error=p.isInvalid?b.InvalidArgument(f):null,p.throwOnError=(e=>{if(p.error)throw new b(p.error,e||t)}),Object.freeze(p)};return Object.freeze(t)};d("Args",q);const _=e=>{let t;return q("argsProcessor: undefined","argsProcessor: afunction")(e).throwOnError(_),(e=e||((...e)=>e)).event=!0,e};d("event",_);const L=_(()=>{throw b.NotImplemented("event",L)});L.ni=!0,d("nie",L);const B=function(e){let t={};e=e||"",this.add=((e,n)=>{let r;q("event: string, handler: afunction")(e,n).throwOnError(this.add),t[e]||(t[e]=[]),t[e].push(n)}),this.remove=((e,n)=>{let r;if(q("event: string, handler: afunction")(e,n).throwOnError(this.remove),t[e]){let r=t[e].indexOf(n);-1!==r&&t[e].splice(r,1)}}),this.dispatch=((n,r)=>{let i;q("event: string")(n).throwOnError(this.dispatch),t[n]&&t[n].forEach(t=>{setTimeout(()=>{t(Object.freeze({host:e,name:n,args:r||[]}))},0)})}),this.count=(e=>{let n;return q("event: string")(e).throwOnError(this.count),t[e]?t[e].length:0}),this.clear=(()=>{t={}})};let V={};const G=e=>{if("string"!=typeof e)throw b.InvalidArgument("name",G);return V[e]?V[e].handler?V[e].handler:V[e].inbuilt:null};G.define=((e,t,n)=>{let r=q("name: string, members: array, inbuilt: afunction","name: string, inbuilt: afunction","name: string, members: array","name: string")(e,t,n);if(r.throwOnError(G.define),V[e])throw b.Duplicate(e,G.define);V[e]={type:r.values.members?"object":"function",members:r.values.members||null,handler:null,inbuilt:r.values.inbuilt?r.values.inbuilt(a.env):null}}),G.connect=((e,t)=>{let n;if(q("name: string, handler: afunction")(e,t).throwOnError(G.connect),!V[e])throw b.NotFound(e,G.connect);let r=t(a.env);if(typeof r!==V[e].type)throw b.InvalidArgument("handler",G.connect);let i=V[e].members;if(i)for(let e of i)if(void 0===r[e])throw b.NotImplemented(e,G.connect);V[e].handler=r}),G.disconnect=(e=>{if("string"!=typeof e)throw b.InvalidArgument("name",G.disconnect);V[e]&&(V[e].handler=null)}),G.isDefined=(e=>{if("string"!=typeof e)throw b.InvalidArgument("name",G.isDefined);return!!V[e]}),G.isConnected=(e=>{if("string"!=typeof e)throw b.InvalidArgument("name",G.isConnected);return!V[e]||!V[e].handler}),d("Port",G,()=>{for(let e in V)V.hasOwnProperty(e)&&(V[e].handler=null);V={}});const J=function(e,t,n,i,s){let a={},l={},c={},u={},f={},p={},d={},h=!1,y="";this.name=e,this.domain=t,this.isUnloaded=(()=>h||t.isUnloaded()),this.unload=(()=>{if(!h){h=!0,delete s[e];for(let e in u)e.hasOwnProperty(e)&&Te(u[e]);a={},f={},p={},l={},c={},u={},d={}}}),this.current=(()=>{if(this.isUnloaded())throw b.InvalidOperation(`Context is already unloaded. (${this.name})`,this.current);return 0===i.length?n||this:i[i.length-1]}),this.registerType=(e=>{if(this.isUnloaded())throw b.InvalidOperation(`Context is already unloaded. (${this.name})`,this.registerType);let t="",n="",i=e[r];if(i.Type?(t=i.Type[r].name,n=i.Type[r].type):(t=i.name,n=i.type),-1===o.indexOf(n))throw b.InvalidArgument("Type",this.registerType);let s=t.substr(0,t.lastIndexOf(".")),u=t.replace(s+".","");if(a[t])throw b.Duplicate(t,this.registerType);if(l[t])throw b.Duplicate(`Already registered as Resource. (${t})`,this.registerType);if(c[t])throw b.Duplicate(`Already registered as Route. (${t})`,this.registerType);return a[t]=e,s?(d[s]||(d[s]={}),d[s][u]=e):d[u]=e,s}),this.getType=(e=>{if(this.isUnloaded())throw b.InvalidOperation(`Context is already unloaded. (${this.name})`,this.getType);if("string"!=typeof e)throw b.InvalidArgument("qualifiedName",this.getType);return a[e]||null}),this.ensureType=(e=>new Promise((n,r)=>{if(this.isUnloaded())return void r(b.InvalidOperation(`Context is already unloaded. (${this.name})`));if("string"!=typeof e)return void r(b.InvalidArgument("qualifiedName"));let i=this.getType(e);if(i)n(i);else{let s=t.resolve(e);s?this.loadAssembly(s).then(()=>{(i=this.getType(e))?n(i):r(b.OperationFailed(`Assembly could not be loaded. (${s})`))}).catch(r):r(b.NotFound(e))}})),this.allTypes=(()=>{if(this.isUnloaded())throw b.InvalidOperation(`Context is already unloaded. (${this.name})`,this.allTypes);return Object.keys(a)}),this.execute=((e,t)=>new Promise((n,r)=>{if(this.isUnloaded())return void r(b.InvalidOperation(`Context is already unloaded. (${this.name})`));e.type=e.type||"",e.typeArgs=e.typeArgs||[],e.func=e.func||"",e.args=e.args||[],e.ctx=e.ctx||{},e.keepAlive=void 0!==e.keepAlive&&e.keepAlive;const i=()=>new Promise((n,r)=>{let i=null;this.ensureType(e.type).then(s=>{try{i=new s(...e.typeArgs),"function"==typeof t&&W(i,"IProgressReporter")&&i.progress.add(t),n(i)}catch(e){r(e)}}).catch(r)}),s=t=>new Promise((n,r)=>{let i=null;(i=t[e.func](...e.args))&&"function"==typeof i.then?i.then(n).catch(r):n(i)});let a=null;e.keepAlive?u[e.type]?(a=u[e.type],s(a).then(n).catch(r)):i().then(t=>{a=t,u[e.type]=a,s(a).then(n).catch(r)}).catch(r):u[e.type]?(a=u[e.type],e.func?s(a).then(n).catch(r).finally(()=>{Te(a),delete u[e.type]}):(Te(a),delete u[e.type],n())):i().then(e=>{s(e).then(n).catch(r).finally(()=>{Te(e)})}).catch(r)})),this.namespace=(e=>{e&&"(root)"===e&&(e="");let t=null;return(t=e?d[e]||null:d)?Object.freeze(T({},t)):null}),this.currentAssemblyBeingLoaded=(e=>(void 0!==e&&(y=w(e,!0)),y));const g=(e,t,n,r)=>{"string"==typeof e&&!f[e]&&t&&n&&r&&(f[e]=Object.freeze(new H(t,n,r)),p[r.name]=f[e])};this.loadAssembly=(e=>new Promise((t,n)=>{if(this.isUnloaded())n(b.InvalidOperation(`Context is already unloaded. (${this.name})`));else if(f[e]||this.currentAssemblyBeingLoaded()===e)t();else{i.push(this);let r=this.domain.getAdo(e),s=e;s.startsWith("./")&&(s=s.substr(2)),s=r&&r.mainAssembly?this.domain.loadPathOf(r.mainAssembly)+s:this.domain.root()+s,F(s),S(s,r.name,!0).then(a=>{a(m,s).then(n=>{let s=this.current();i.pop(),g(e,r,s,n),t()}).catch(e=>{i.pop(),n(e)})}).catch(e=>{i.pop(),n(e)})}})),this.loadBundledAssembly=((e,t,n)=>{if(this.isUnloaded())throw b.InvalidOperation(`Context is already unloaded. (${this.name})`);let r={};i.push(this);let s=t;try{r=n(m,s);let t=this.current();i.pop();let a=this.domain.getAdo(e);g(e,a,t,r)}finally{i.pop()}return r}),this.getAssembly=(e=>{if(this.isUnloaded())throw b.InvalidOperation(`Context is already unloaded. (${this.name})`,this.getAssembly);if("string"!=typeof e)throw b.InvalidArgument("file",this.getAssembly);return f[e]||null}),this.getAssemblyByName=(e=>{if(this.isUnloaded())throw b.InvalidOperation(`Context is already unloaded. (${this.name})`,this.getAssemblyByName);if("string"!=typeof e)throw b.InvalidArgument("name",this.getAssemblyByName);return p[e]||null}),this.allAssemblies=(e=>{if(this.isUnloaded())throw b.InvalidOperation(`Context is already unloaded. (${this.name})`,this.allAssemblies);if(e){let e=[],t=Object.keys(f);for(let n of t)e.push(f[n]);return e}return Object.keys(f)}),this.registerResource=(e=>{if(this.isUnloaded())throw b.InvalidOperation(`Context is already unloaded. (${this.name})`,this.registerResource);if("string"!=typeof e.name||""===e.name||"string"!=typeof e.encodingType||""===e.encodingType||"string"!=typeof e.file||""===e.file||"string"!=typeof e.data||""===e.data)throw b.InvalidArgument("rdo",this.registerResource);let t=e.name.substr(0,e.name.lastIndexOf(".")),n=e.name.replace(t+".","");if(l[e.name])throw b.Duplicate(e.name,this.registerResource);if(a[e.name])throw b.Duplicate(`Already registered as Type. (${e.name})`,this.registerResource);if(c[e.name])throw b.Duplicate(`Already registered as Route. (${e.name})`,this.registerResource);return l[e.name]=Object.freeze(new X(e,t,this)),t?(d[t]||(d[t]={}),d[t][n]=l[e.name]):d[n]=l[e.name],t}),this.getResource=(e=>{if(this.isUnloaded())throw b.InvalidOperation(`Context is already unloaded. (${this.name})`,this.getResource);if("string"!=typeof e)throw b.InvalidArgument("qualifiedName",this.getResource);return l[e]||null}),this.allResources=(e=>{if(this.isUnloaded())throw b.InvalidOperation(`Context is already unloaded. (${this.name})`,this.allResources);if(e){let e=[],t=Object.keys(l);for(let n of t)e.push(l[n]);return e}return Object.keys(l)}),this.registerRoutes=((e,t)=>{if(this.isUnloaded())throw b.InvalidOperation(`Context is already unloaded. (${this.name})`,this.registerRoutes);for(let n of e){if("string"!=typeof n.name||""===n.name||"number"!=typeof n.index||"string"!=typeof n.mount||""===n.mount||"string"!=typeof n.path||""===n.path||"string"!=typeof n.handler||""===n.handler)throw b.InvalidArgument("route: "+n.name,this.registerRoutes);let e=n.name.substr(0,n.name.lastIndexOf(".")),r=n.name.replace(e+".","");if(c[n.name])throw b.Duplicate(n.name,this.registerRoutes);if(a[n.name])throw b.Duplicate(`Already registered as Type. (${n.name})`,this.registerRoutes);if(l[n.name])throw b.Duplicate(`Already registered as Resource. (${n.name})`,this.registerRoutes);c[n.name]=Object.freeze(new K(t,n,e,this)),e?(d[e]||(d[e]={}),d[e][r]=c[n.name]):d[r]=c[n.name]}}),this.getRoute=(e=>{if(this.isUnloaded())throw b.InvalidOperation(`Context is already unloaded. (${this.name})`,this.getRoute);if("string"!=typeof e)throw b.InvalidArgument("qualifiedName",this.getRoute);return c[e]||null}),this.allRoutes=(e=>{if(this.isUnloaded())throw b.InvalidOperation(`Context is already unloaded. (${this.name})`,this.allRoutes);if(e){let e=[],t=Object.keys(c);for(let n of t)e.push(c[n]);return e}return Object.keys(c)}),this.isBusy=(()=>!1),this.hasActiveInstances=(()=>Object.keys(u).length)},H=function(e,t,n){this.context=t,this.name=e.name,this.file=e.file,this.mainAssembly=e.mainAssembly,this.desc=e.desc,this.title=e.title,this.version=e.version,this.copyright=e.copyright,this.license=e.license,this.lupdate=e.lupdate,this.builder=e.builder.name,this.builderVersion=e.builder.version,this.format=Object.freeze({name:e.builder.format,version:e.builder.formatVersion,contains:e.builder.contains.slice()}),this.types=(()=>e.types.slice()),this.getType=(t=>{if("string"!=typeof t)throw b.InvalidArgument("qualifiedName",this.getType);if(-1===e.types.indexOf(t))throw b.NotFound(t,this.getType);return this.context.getType(t)}),this.getTypes=(t=>{if(["string","interface"]!==U(t))throw b.InvalidArgument("intf",this.getTypes);let n=[];for(let r of e.types)try{let e=this.context.getType(r);Ie(e,t)&&n.push(e)}catch(e){}return n}),this.resources=(()=>e.resources.slice()),this.getResource=(t=>{if("string"!=typeof t)throw b.InvalidArgument("qualifiedName",this.getResource);if(-1===e.resources.indexOf(t))throw b.NotFound(t,this.getResource);return this.context.getResource(t)}),this.routes=(()=>e.routes.slice()),this.getRoute=(t=>{if("string"!=typeof t)throw b.InvalidArgument("qualifiedName",this.getRoute);if(-1===e.routes.indexOf(t))throw b.NotFound(t,this.getRoute);return this.context.getRoute(t)}),this.assets=(()=>e.assets.slice()),this.assetsRoot=this.file.replace(".js","/"),this.getAsset=(t=>{if("string"!=typeof t)throw b.InvalidArgument("file",this.getAsset);let n=t.replace("./",this.assetsRoot);if(-1===e.assets.indexOf(t))throw b.NotFound(n,this.getAsset);return n}),this.config=(()=>n.config),this.settings=(()=>n.settings)},X=function(t,n,r){this.context=r,this.name=t.name,this.ns=n,this.assembly=(()=>r.getAssembly(w(t.asmFile,!0))||null),this.encodingType=t.encodingType,this.file=t.file,this.type=t.file.substr(t.file.lastIndexOf(".")+1).toLowerCase(),this.data=t.data;try{if(-1!==t.encodingType.indexOf("utf8;"))if(e){let e=Buffer.from(t.data,"base64");this.data=e.toString("utf8")}else this.data=E(t.data);else e&&(this.data=Buffer.from(t.data,"base64"))}catch(e){throw b.OperationFailed(`Resource data could not be decoded. (${t.name})`,X)}"json"===this.type&&(this.data=Object.freeze(JSON.parse(this.data)))},K=function(t,n,r,i){this.context=i,this.name=n.name,this.ns=r,this.assembly=(()=>i.getAssembly(t)||null),this.index=n.index,this.mount=n.mount,this.verbs=n.verbs||(e?["get"]:["view"]),this.path=n.path,this.handler=n.handler},Q=function(t,n){let r={},i=0,s=null,a=null;const o=function(){let e,t=null;const n=e=>{let n=e.data.func,r=null;const i=n=>{t.postMessage({data:{id:e.data.id,isComplete:!0,isError:!1,error:null,ctx:e.data.ctx,result:e.data.returnsAsIs?n:!!n}})},s=n=>{t.postMessage({data:{id:e.data.id,isComplete:!1,isError:!1,error:null,ctx:e.data.ctx,result:n}})},a=n=>{t.postMessage({data:{id:e.data.id,isComplete:!0,isError:!0,error:n?n.toString():"UnknownError",ctx:e.data.ctx,result:null}})},o=()=>{try{"alc"===e.data.obj&&"execute"===n&&e.data.args.push(e=>{s(e.args)});let t=r(...e.data.args);t&&"function"==typeof t.then?t.then(i).catch(a):i(t)}catch(e){a(e)}};switch(e.data.obj){case"ad":r=ee[n],o();break;case"alc":r=ee.contexts(e.data.name)[n],o();break}};if("<<{{isServer}}>>"=="true"){require("<<{{entryPoint}}>>");let e=require("worker_threads").parentPort;t=e,e.once("message",e=>{(t=e.privatePort).on("message",n)})}else importScripts("<<{{requirejs}}>>","<<{{entryPoint}}>>"),(t=this).onmessage=n};let l=o.toString().replace("<<{{entryPoint}}>>",ee.entryPoint());l=`(${l=(l=l.replace("<<{{requirejs}}>>",R("require.js","require.min.js"))).replace("<<{{isServer}}>>",e.toString())})();`;const c=(e,t,n,s,o,l,c)=>new Promise((u,f)=>{let p=v();r[p]={resolve:u,reject:f,progressListener:c},i++,a.postMessage({data:{id:p,obj:e,name:t,returnsAsIs:n,ctx:l||{},func:s,args:o&&Array.isArray(o)?o:[]}})}),u=e=>{if(r[e.data.id]){let t=r[e.data.id];e.data.isComplete?(delete r[e.data.id],i--,e.data.isError?t.reject(e.data.error):t.resolve(Object.freeze({ctx:e.data.ctx,result:e.data.result}))):"function"==typeof progressListener&&t.progressListener&&setTimeout(()=>{t.progressListener(Object.freeze({host:e.data.ctx._?e.data.ctx._.host:"",name:"progress",args:e.data.result}))},0)}else n(`Unknown operation is not supported. (${e.data.id})`)};if(e){const{Worker:e,MessageChannel:t}=require("worker_threads");a=new e(l,{eval:!0,workerData:{argv:process.argv}});const r=new t;a.postMessage({privatePort:r.port1},[r.port1]),r.port2.on("error",n),r.port2.on("message",u)}else{let e=new Blob([l]),t=(!0).URL.createObjectURL(e,{type:"application/javascript; charset=utf-8"});(a=new(!0).Worker(t)).onmessage=u,a.onerror=n}this.remoteCall=c,this.close=(()=>{e&&(s.close(),a.unref()),a.terminate()}),this.isBusy=(()=>i)},Y=function(e,t,n){let r=!1,i={},s=new Q(n,e=>{throw b.OperationFailed("Remote operation failed.",e)});this.name=e,this.isRemote=!0,this.isUnloaded=(()=>r),this.unload=(()=>{r||(r=!0,delete t[e],i={},s.remoteCall("ad","",!1,"unload").finally(()=>{s.close()}))}),this.context=Object.freeze(new Z("default",this,s)),this.contexts=(e=>i[e]||null),this.createContext=(e=>new Promise((t,n)=>{"string"!=typeof e||e&&"default"===e||i[e]?n(b.InvalidArguments("name")):s.remoteCall("ad","",!1,"createContext",[e]).then(r=>{if(r){let n=Object.freeze(new Z(e,this,s));i[e]=n,t(n)}else n(b.OperationFailed("Context could not be created."))}).catch(n)})),this.loadScripts=((...e)=>{if(this.isUnloaded())throw b.InvalidOperation(`AppDomain is already unloaded. (${this.name})`,this.loadScripts);return s.remoteCall("ad","",!1,"loadScripts",e)})},Z=function(e,t,n){let r=!1;this.name=e,this.domain=t,this.isUnloaded=(()=>r||t.isUnloaded()),this.unload=(()=>{r||(r=!0,n.remoteCall("alc",e,!1,"unload"))}),this.execute=((t,r)=>{if(this.isUnloaded())throw b.InvalidOperation(`Context is already unloaded. (${this.name})`,this.execute);let i=t.ctx||{};return i._={host:t.type},n.remoteCall("alc",e,!0,"execute",[t],i,r)}),this.loadAssembly=(t=>{if(this.isUnloaded())throw b.InvalidOperation(`Context is already unloaded. (${this.name})`,this.loadAssembly);return n.remoteCall("alc",e,!1,"loadAssembly",[t])}),this.isBusy=(()=>{if(this.isUnloaded())throw b.InvalidOperation(`Context is already unloaded. (${this.name})`,this.isBusy);return n.isBusy()}),this.hasActiveInstances=(()=>{n.remoteCall("alc",e,!1,"hasActiveInstances")})},ee=function(t){let n={},r={},i={},s={},a=[],o=[],l={},c="",f="",p=null,d=null,h=null,y=null,g=null,v=!1,x=!1;i[t]=this,this.name=t,this.isRemote=!1,this.isUnloaded=(()=>v),this.unload=(async()=>{if(!v){v=!0,d&&"function"==typeof d.stop&&(await d.stop(),Te(d)),h&&"function"==typeof h.stop&&(await h.stop(),Te(h));for(let e in s)s.hasOwnProperty(e)&&"function"==typeof s[e].unload&&s[e].unload();g();for(let e in i)i.hasOwnProperty(e)&&i[e]!==this&&i[e].unload();n={},r={},s={},i={},a=[],o=[],l={},c="",f="",p=null,d=null,h=null,y=null,g=null}}),this.createDomain=(e=>new Promise((t,n)=>{if("string"!=typeof e||e&&"default"===e||i[e])return void n(b.InvalidArguments("name"));let r=Object.freeze(new Y(e,i,o));i[e]=r,t(r)})),this.domains=(e=>i[e]||null);const O=()=>(y=new J("default",this,null,a,s),g=y.unload,delete y.unload,y=Object.freeze(y),s[y.name]=y,y);this.context=O(),this.contexts=(e=>s[e]||null),this.createContext=(e=>new Promise((t,n)=>{if("string"!=typeof e||e&&"default"===e||s[e])return void n(b.InvalidArguments("name"));let r=Object.freeze(new J(e,this,y,a,s));s[e]=r,t(r)})),this.registerAdo=(e=>{if("string"==typeof e&&(e=JSON.parse(e)),"array"!==U(e.types)||"array"!==U(e.resources)||"array"!==U(e.routes)||"array"!==U(e.assets)||"string"!=typeof e.name||"string"!=typeof e.file||""===e.file)throw b.InvalidArgument("ado",this.registerAdo);e.file=w(e.file,!0),n[e.file]||(n[e.file]=Object.freeze(e),e.types.forEach(t=>{if(r[t])throw b.Duplicate(t,this.registerAdo);r[t]=e.file}),e.resources.forEach(t=>{if(r[t])throw b.Duplicate(t,this.registerAdo);r[t]=e.file}),this.context.registerRoutes(e.routes,e.file),o.push(e))}),this.getAdo=(e=>{if("string"!=typeof e)throw b.InvalidArgument("file",this.getAdo);return n[e]||null}),this.allAdos=(()=>Object.keys(n)),this.resolve=(e=>{if("string"!=typeof e)throw b.InvalidArgument("qualifiedName",this.resolve);return r[e]||null}),this.allTypes=(()=>Object.keys(r)),this.boot=(async(t,n)=>{if(n=n||this.config(),!(t=t||this.entryPoint()))return console.log("No entry point defined, boot aborted."),!1;x&&(await this.unload(),v=!1,O()),this.root(e?process.cwd():"./"),t&&this.entryPoint(t),n&&await this.config(n);let r="";if(-1!==m.info.file.indexOf("flair.js")?r=m.info.file.replace("flair.js","preamble.js"):-1!==m.info.file.indexOf("flair.min.js")&&(r=m.info.file.replace("flair.min.js","preamble.js")),r){let e;(await je(r))(m)}let i=await je(u.bootEngine);return await i.start(),x=!0,!0}),this.config=(e=>!p&&e?new Promise((t,n)=>{je(e).then(e=>{p=e,t(Object.assign({},p))}).catch(n)}):p?Object.assign({},p):null),this.entryPoint=(e=>("string"!=typeof e||c||(c=e),c)),this.app=(e=>(e&&!d&&(d=e),d)),this.host=(e=>(e&&(h=e),h)),this.loadPathOf=((e,t)=>{if("string"!=typeof e)throw b.InvalidArgument("file",this.loadPath);return t&&(l[e]||(l[e]=t)),l[e]||""}),this.root=(e=>("string"!=typeof e||f||(f=e).endsWith("/")||(f+="/"),f)),this.resolvePath=(e=>{if("string"!=typeof e)throw b.InvalidArgument("path",this.resolvePath);return e.replace("./",this.root())}),this.loadScripts=((...e)=>new Promise((t,n)=>{try{ke(e,()=>{t()})}catch(e){n(e)}})),this.onError=(e=>{if(!h)throw e;h.raiseError(e)})};let te=new ee("default"),ne=te.unload;delete te.unload;const re=te;d("AppDomain",re,()=>{ne()});const ie=(e,t,n)=>{let i=q("obj: flairinstance, memberName: string","obj: flairinstance, memberName: string, attrName: string","obj: flairtype","obj: flairtype, attrName: string")(e,t,n);i.throwOnError(ie);let s=[],a=e[r],o=null,l=null;return i.values.attrName?(l=i.index>1?a.attrs.type.probe(i.values.attrName).current():a.attrs.members.probe(i.values.attrName,i.values.memberName).current())&&s.push(C(l,"name, isCustom, args, type",!0)):(o=i.index>1?a.attrs.type.all().current():a.attrs.members.all(i.values.memberName).current())&&s.push(...C(o,"name, isCustom, args, type",!0)),s};d("getAttr",ie);const se=e=>{let t=q("Type: flairtype","Type: flairinstance","Type: string")(e);t.throwOnError(se);let n=null,i="",s="";switch(t.index){case 0:n=e[r].assembly();break;case 1:n=e[r].Type[r].assembly();break;case 2:e.startsWith("[")&&e.endsWith("]")?(s=e.substr(1,e.length-2),n=re.context.getAssemblyByName(s)):(i=re.resolve(e))&&(n=re.context.getAssembly(i));break}return n};d("getAssembly",se);const ae=e=>{let t;return q("Type: string")(e).throwOnError(ae),re.resolve(e)};d("getAssemblyOf",ae);const oe=e=>{let t;return q("Type: flairtype")(e).throwOnError(oe),e[r].context};d("getContext",oe);const le=e=>{let t;q("qualifiedName: string")(e).throwOnError(le);let n=re.context.getResource(e)||null;return n?n.data:null};d("getResource",le);const ce=e=>{let t;q("qualifiedName: string")(e).throwOnError(ce),re.context.getRoute(e)};d("getRoute",ce);const ue=e=>{let t;return q("qualifiedName: string")(e).throwOnError(ue),re.context.getType(e)};d("getType",ue);const fe=e=>{let t;q("obj: flair")(e).throwOnError(fe);let n=e[r];return n&&n.Type||null};d("getTypeOf",fe);const pe=e=>{let t;q("obj: flair")(e).throwOnError(pe);let n=e[r].Type?e[r].Type[r]:e[r];return n&&n.name||""};d("getTypeName",pe);const me=(e,t)=>{let n;return q("name: undefined","name: string","name: string, asInType: string")(e,t).throwOnError(me),"string"==typeof t?new Promise((n,r)=>{je(t).then(()=>{n(re.context.namespace(e))}).catch(r)}):re.context.namespace(e)};d("ns",me);const de=(e,t)=>{if("class"!==U(e))throw b.InvalidArgument("Type",de);if(-1===["string","class"].indexOf(U(t)))throw b.InvalidArgument("Parent",de);return e[r].isDerivedFrom(t)};d("isDerivedFrom",de);const he=e=>{if("class"!==U(e))throw b.InvalidArgument("Type",he);return e[r].isAbstract()};d("isAbstract",he);const ye=e=>{if("class"!==U(e))throw b.InvalidArgument("Type",ye);return e[r].isSealed()};d("isSealed",ye);const ge=e=>{if("class"!==U(e))throw b.InvalidArgument("Type",ge);return e[r].isStatic()};d("isStatic",ge);const be=e=>{if("class"!==U(e))throw b.InvalidArgument("Type",be);return e[r].isSingleton()};d("isSingleton",be);const ve=e=>{if("class"!==U(e))throw b.InvalidArgument("Type",ve);return e[r].isDeprecated()};d("isDeprecated",ve);const we=(e,t)=>{let n=U(e),i=U(t),s=!1;if(-1===l.indexOf(n))throw b.InvalidArgument("obj",we);if(-1===o.indexOf(i)&&"string"!==i)throw b.InvalidArgument("Type",we);let a=e[r];switch(i){case"class":(s=a.isInstanceOf(t))||(s=a.Type[r].isDerivedFrom(t));break;case"struct":s=a.isInstanceOf(t);break;case"interface":s=a.isImplements(t);break;case"mixin":s=a.isMixed(t);break;case"string":(s=a.isInstanceOf(t))||"function"!=typeof a.isImplements||(s=a.isImplements(t)),s||"function"!=typeof a.isMixed||(s=a.isMixed(t));break}return s};d("isInstanceOf",we);const xe=(e,t)=>{if(t[r]&&(t=t[r].name),"string"!==U(t))throw b.InvalidArgument("type",xe);return W(e,t)?e:null};d("as",xe);const Oe=(e,t)=>{if(!e)throw b.InvalidArgument("obj",Oe);if("interface"!==U(t))throw b.InvalidArgument("intf",Oe);let n=!0;for(let i in t)if(t.hasOwnProperty(i)&&i!==r){if(!e[i]){n=!1;break}if("function"==typeof t[i]&&"function"!=typeof e[i]){n=!1;break}}return n};d("isComplies",Oe);const Ie=(e,t)=>{if(-1===["class","instance"].indexOf(U(e)))throw b.InvalidArgument("obj",Ie);if(-1===["string","interface"].indexOf(U(t)))throw b.InvalidArgument("intf",Ie);return e[r].isImplements(t)};d("isImplements",Ie);const Ae=(e,t)=>{if(-1===["class","instance"].indexOf(U(e)))throw b.InvalidArgument("obj",Ae);if(-1===["string","mixin"].indexOf(U(t)))throw b.InvalidArgument("mixin",Ae);return e[r].isMixed(t)};d("isMixed",Ae);const $e=[],ke=(t,n)=>{let r=q("deps: string, fn: afunction","deps: array, fn: afunction")(t,n);r.throwOnError(ke),0===r.index&&(t=[t]);let s=[],a=t.slice(),o=()=>{n(...s)},l=()=>{if(0!==a.length){let t=a.shift().trim(),n=null,r=e=>{if(t.startsWith("[")&&t.endsWith("]")&&-1===t.indexOf(".")){let e=t.substr(1,t.length-2).trim();"string"==typeof(n=Ye.resolve(e,!1))&&(t=n,n=null)}e()},o=e=>{-1===t.indexOf("/")&&((n=ue(t))||(n=le(t))),e()},c=e=>{if(-1===t.indexOf("/")){let r=ae(t);r?re.context.loadAssembly(r).then(()=>{(n=ue(t))||(n=le(t)),e()}).catch(e=>{throw b.OperationFailed(`Assembly could not be loaded. (${r})`,e,ke)}):e()}else e()},u=r=>{if(t.startsWith("./")){let i=t.substr(t.lastIndexOf(".")+1).toLowerCase();if(t=re.resolvePath(t),i)if("js"===i||"mjs"===i)t=w(t,!0),S(t).then(e=>{n=e||!0,r()}).catch(e=>{throw b.OperationFailed(`Module/File could not be loaded. (${t})`,e,ke)});else if(e)if("json"===i)S(t).then(e=>{n=e||!0,r()}).catch(e=>{throw b.OperationFailed(`Local Module/File could not be loaded. (${t})`,e,ke)});else{let e=require("fs");try{n=e.readFileSync(t),r()}catch(e){throw b.OperationFailed(`Local File could not be read. (${t})`,e,ke)}}else P(t).then(e=>{n=e,r()}).catch(e=>{throw b.OperationFailed(`File could not be loaded. (${t})`,e,ke)});else r()}else r()},f=r=>{t.startsWith("./")?r():(e||(t=`./${i}/${t}`),t=w(t,!0),S(t).then(e=>{n=e||!0,r()}).catch(e=>{throw b.OperationFailed(`Module could not be loaded. (${t})`,e,ke)}))},p=e=>{s.push(n),e||$e.pop(),l()};if(""===(t=w(t)))return n=!0,void p(!0);if(-1!==$e.indexOf(t))throw b.Circular(t,ke);$e.push(t),r(()=>{n?p():o(()=>{n?p():c(()=>{n?p():u(()=>{n?p():f(()=>{if(!n)throw b.OperationFailed(`Dependency could not be resolved. (${t})`,ke);p()})})})})})}else o()};l()};d("bring",ke,()=>{$e.length=0});const je=(e,t)=>new Promise((n,r)=>{if("string"==typeof e)try{ke([e],i=>{i?"boolean"!=typeof i||"string"!=typeof t||(i=(!0)[t])?n(i):r(b.OperationFailed(`Dependency object could not be located. (${e})`)):r(b.OperationFailed(`Dependency could not be resolved. (${e})`))})}catch(e){r(e)}else r(b.InvalidArgument("dep"))});d("include",je);const Te=e=>{let t=q("obj: instance","obj: boolean")(e);t.throwOnError(Te),1===t.index&&!0===e?(We(),s.forEach(e=>{e()}),s.length=0):"function"==typeof e[r].dispose&&e[r].dispose()};d("dispose",Te);const Pe=(e,t)=>{let n=q("obj: instance, fn: afunction","obj: string, fn: afunction")(e,t);if(n.throwOnError(Pe),1===n.index){let t=ue(e);if(!t)throw b.NotFound(e,Pe);e=new t}let i=null,s=!1,a=!1,o=()=>{s||"function"!=typeof e[r].dispose||(s=!0,e[r].dispose())};try{(i=t(e))&&"function"==typeof i.finally&&(a=!0,i=i.finally(()=>{o()}))}finally{a||o()}return i};d("using",Pe);const Se=(e,...t)=>{let n=q("name: string","name: Attribute")(e);n.throwOnError(Se);let i=null,s=null,a=null;if(0===n.index){if(!(a=De.inbuilt[e]||null)){if(!(i=ue(e)))throw b.NotFound(e,Se);e=i[r].name}}else e=(i=e)[r].name;if(-1!==I(De.bucket,"name",e))throw b.Duplicate(e,Se);if(i){try{s=new i(...t)}catch(e){throw new b(e,Se)}a=new Ne(s.constraints)}De.bucket.push({name:e,cfg:a,isCustom:null!==s,attr:s,args:t})},Ne=function(e,t){let n=q("isModifier: boolean, constraints: string","constraints: string","isModifier: boolean,")(e,t),r;return n.throwOnError(Ne),{isModifier:n.values.isModifier||!1,constraints:n.values.constraints}},Ce=(e,...t)=>Se(e,...t),De=Ce[r]=Object.freeze({bucket:[],inbuilt:Object.freeze({static:new Ne(!0,"(class && !$abstract) || ((class && (prop || func)) && !($abstract || $virtual || $override))"),abstract:new Ne(!0,"(class && !$sealed && !$static) || ((class && (prop || func || event)) && !($override || $sealed || $static))"),virtual:new Ne(!0,"class && (prop || func || construct || dispose || event) && !($abstract || $override || $sealed || $static)"),override:new Ne(!0,"(class && (prop || func || construct || dispose || event) && ((@virtual || @abstract || @override) && !(virtual || abstract)) && !(@sealed || $static))"),sealed:new Ne(!0,"(class || ((class && (prop || func || event)) && override))"),private:new Ne(!0,"(class || struct) && (prop || func || event) && !($protected || @private || $static)"),protected:new Ne(!0,"(class) && (prop || func || event) && !($private || $static)"),readonly:new Ne(!0,"(class || struct) && prop && !abstract"),async:new Ne(!0,"(class || struct) && func"),privateSet:new Ne(!0,"(class || struct) && prop && !($private || $static)"),protectedSet:new Ne(!0,"(class) && prop && !($protected || $private || $static)"),overload:new Ne("((class || struct) && (func || construct) && !($virtual || $abstract || $override || $args))"),enumerate:new Ne("(class || struct) && prop || func || event"),dispose:new Ne("class && prop"),post:new Ne("(class || struct) && event"),fetch:new Ne("(class || struct) && (func && async) && !(timer || on || @fetch)"),on:new Ne("class && func && !(event || $async || $args || $overload || $inject || $static)"),timer:new Ne("class && func && !(event || $async || $args || $inject || @timer || $static)"),type:new Ne("(class || struct) && prop"),args:new Ne("(class || struct) && (func || construct) && !$on && !$overload"),inject:new Ne("class && (prop || func || construct) && !(static || session || state)"),resource:new Ne("class && prop && !(session || state || inject || asset)"),asset:new Ne("class && prop && !(session || state || inject || resource)"),singleton:new Ne("(class && !(prop || func || event) && !($abstract || $static))"),serialize:new Ne("((class || struct) || ((class || struct) && prop)) && !($abstract || $static || noserialize)"),deprecate:new Ne("!construct && !dispose"),session:new Ne("(class && prop) && !($static || $state || $readonly || $abstract || $virtual)"),state:new Ne("(class && prop) && !($static || $session || $readonly || $abstract || $virtual)"),conditional:new Ne("(class || struct) && (prop || func || event)"),noserialize:new Ne("(class || struct) && prop"),aspects:new Ne("(class && func)"),ns:new Ne("(class || struct || mixin || interface || enum) && !(prop || func || event || construct || dispose)"),mixin:new Ne("class && (prop || func || event)"),interface:new Ne("class && (prop || func || event)")})});for(let e in De.inbuilt)De.inbuilt.hasOwnProperty(e)&&(Se[`$$${e}`]=((...t)=>{Se(e,...t)}));Ce.collect=(()=>{let e=De.bucket.slice();return Ce.clear(),e}),Ce.has=(e=>{if("string"!=typeof e)throw b.InvalidArgument("name");return-1!==De.bucket.findIndex(t=>t.name===e)}),Ce.get=(e=>{if("string"!=typeof e)throw b.InvalidArgument("name");let t=De.bucket.findIndex(t=>t.name===e);return-1!==t?De.bucket[t]:null}),Ce.count=(()=>De.bucket.length),Ce.clear=(()=>{De.bucket.length=0}),d("$$",Se);const Ee=(e,t,n,i,s)=>{let a=Ce.collect(),l=null,c=null,u=Fe(!0,e,t),f=Fe(!1,e,t),p="";if(i?(l=t.attrs.type,c=t.modifiers.type,p=`${t.name}`):(l=e.attrs.members[n],c=e.modifiers.members[n],p=`${e.name}::${n}`),!s)for(let e of a)if(e.isCustom)throw b.InvalidOperation(`Custom attribute cannot be applied. (${e.name})`,qe);const m=s=>{let a=!1,l=o,c=["prop","func","construct","dispose","event"],m=["static","abstract","sealed","virtual","override","private","privateSet","protected","protectedSet","readonly","async"],d=[],h=[],y=s.cfg.constraints;const g=e=>{let t={withWhat:"",matchType:"",original:e,name:"",value:!1};switch(e.substr(0,1)){case"$":t.matchType="anywhere",t.name=e.substr(1);break;case"@":t.matchType="inherited",t.name=e.substr(1);break;default:t.matchType="current",t.name=e;break}e.endsWith("^")?(t.withWhat="typeName",t.name=t.name.replace("^","")):-1!==l.indexOf(t.name)?(t.withWhat="typeType",t.matchType="current"):-1!==c.indexOf(t.name)?(t.withWhat="memberType",t.matchType="current"):m.indexOf(t.name)!==0-1?t.withWhat="modifier":t.withWhat="attribute","struct"===t.name?h.push(t):d.push(t)},v=()=>{let e=new RegExp("[^!&!|()]","g"),t="",n=[],r=0;for(;1&&null!==(t=e.exec(y));)n.push(t);t="",r=0;for(let e of n)r++," "!==e[0]?(t+=e[0],r===n.length&&(""!==t&&g(t),t="")):(""!==t&&g(t),t="");d=d.concat(h)};v();for(let s of d){switch(s.withWhat){case"typeName":switch(s.matchType){case"anywhere":s.value=s.name===t.name||t.Type[r].isDerivedFrom(s.name);break;case"inherited":s.value=t.Type[r].isDerivedFrom(s.name);break;case"current":s.value=s.name===t.name;break}break;case"typeType":s.value=t.type===s.name;break;case"memberType":s.value=!i&&e.members[n]===s.name;break;case"modifier":s.value=i?!!u.type.probe(s.name)[s.matchType]():!!u.members.probe(s.name,n)[s.matchType]();break;case"attribute":s.value=i?!!f.type.probe(s.name)[s.matchType]():!!f.members.probe(s.name,n)[s.matchType]();break}y=j(y,s.original,s.value.toString())}try{if(!(a=new Function("try {return ("+y+");}catch(e){return false;}")()))throw b.InvalidOperation(`${s.cfg.isModifier?"Modifier":"Attribute"} ${s.name} could not be applied. (${p} --\x3e [${y}])`,qe)}catch(e){throw b.OperationFailed(`${s.cfg.isModifier?"Modifier":"Attribute"} ${s.name} could not be applied. (${p} --\x3e [${y}])`,e,qe)}return a};for(let n of a)m(n)&&((n=C(n,null,!1,{type:i?t.name:e.name})).isCustom?l.push(n):n.cfg.isModifier?c.push(n):l.push(n))},Fe=(e,t,n)=>{let r=e?"modifiers":"attrs",i=(e,i,s,a)=>{let o=null;if(i&&"construct"===i&&(i="_construct"),i&&"dispose"===i&&(i="_dispose"),a)if(s){let t=n.previous();for(;1&&null!==t&&(t[r]&&t[r].type&&(o=A(t[r].type,"name",e)),!o);)t=t.previous()}else n[r]&&n[r].type&&(o=A(n[r].type,"name",e));else if(s){let n=t.previous();for(;1&&null!==n&&(n[r]&&n[r].members[i]&&(o=A(n[r].members[i],"name",e)),!o);)n=n.previous()}else t[r]&&t[r].members[i]&&(o=A(t[r].members[i],"name",e));return o},s=(e,t,n,r)=>null!==i(e,t,n,r);const a=(e,t)=>{let n;return Object.freeze({anywhere:()=>i(e,t,!1,!1)||i(e,t,!0,!1),current:()=>i(e,t,!1,!1),inherited:()=>i(e,t,!0,!1),only:Object.freeze({current:()=>i(e,t,!1,!1)&&!i(e,t,!0,!1),inherited:()=>!i(e,t,!1,!1)&&i(e,t,!0,!1)})})},o=e=>{let t;return Object.freeze({anywhere:()=>i(e,null,!1,!0)||i(e,null,!0,!0),current:()=>i(e,null,!1,!0),inherited:()=>i(e,null,!0,!0),only:Object.freeze({current:()=>i(e,null,!1,!0)&&!i(e,null,!0,!0),inherited:()=>!i(e,null,!1,!0)&&i(e,null,!0,!0)})})},l=e=>{let n=Object.freeze({current:()=>t[r].members[e].slice(),inherited:()=>{let n=[],i=null,s=t.previous();for(;1&&null!==s;)s[r]&&s[r].members&&(i=A(s[r].members,"name",e)),i&&n.push(...i),s=s.previous();return n},anywhere:()=>[...n.current(),...n.inherited()]});return n},c=()=>{let e=Object.freeze({current:()=>n[r].type.slice(),inherited:()=>{let e=[],t=null,i=n.previous();for(;1&&null!==i;)i[r]&&i[r].type&&(t=i[r].type.slice()),t&&e.push(...t),i=i.previous();return e},anywhere:()=>[...e.current(),...e.inherited()]});return e},u={type:Object.freeze({get:(e,t)=>i(e,null,t,!0),has:(e,t)=>s(e,null,t,!0),all:c,probe:o}),members:{get:(e,t,n)=>i(e,t,n,!1),has:(e,t,n)=>s(e,t,n,!1),all:l,probe:a}};return e&&(u.members.is=((e,t)=>{let n=a(e,t);switch(e){case"static":return n.anywhere();case"abstract":return n.anywhere()&&!(a("virtual",t).anywhere()||a("override",t).anywhere());case"virtual":return n.anywhere()&&!a("override",t).anywhere();case"override":return n.anywhere()&&!a("sealed",t).anywhere();case"sealed":return n.anywhere();case"private":return n.anywhere();case"protected":return n.anywhere();case"readonly":return n.anywhere();case"async":return n.anywhere()}}),u.members.type=(e=>{let n,r="";if(!("type"===t.level)){let n=t;for(;1&&null!==n&&(n.members[e]&&(r=n.members[e]),!r);)n=n.previous()}return r}),u.members.isProperty=(e=>"prop"===u.members.type(e)),u.members.isFunction=(e=>"func"===u.members.type(e)),u.members.isEvent=(e=>"event"===u.members.type(e))),u.members=Object.freeze(u.members),Object.freeze(u)},ze=e=>{let t={getType:function(){let e;return this.instance.def.Type}},n={id:v()};e.ex.instance=T(e.ex.instance,t,!1),e.mex.instance=T(e.mex.instance,n,!1);let r={getName:function(){let e;return this.type.def.name}},i={id:v()};e.ex.type=T(e.ex.type,r,!1),e.mex.type=T(e.mex.type,i,!1)},Me=(e,t,n,r,i,s)=>{let a={type:{Type:t,def:r,attrs:i,modifiers:s}};for(let t in e)e.hasOwnProperty(t)&&("function"==typeof e[t]?Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value:e[t].bind(a)}):Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value:e[t]}))},Re=(e,t,n,r,i,s,a,o,l,c)=>{let u={instance:{obj:t,def:i,attrs:a,modifiers:o},type:{Type:r,typeDef:s,attrs:l,modifiers:c}};for(let t in e)"function"==typeof e[t]?Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value:e[t].bind(u)}):Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value:e[t]})},Ue=(e,t,n,i,s,...o)=>{let l=t[r],c=l.def(),u="___flag___",f={_flagName:u};if(void 0!==i&&i===u?(f.isNeedProtected=!0,f.isTopLevelInstance=!1,f.staticInterface=e.static?s:null,f.args=o):(f.isNeedProtected=!1,f.isTopLevelInstance=!0,f.staticInterface=e.static?t:null,f.args=void 0!==i?void 0!==s?[i,s].concat(o):[i]:[]),e.singleton&&!c.staticConstructionCycle&&!$t&&f.isTopLevelInstance&&l.singleInstance.value)return l.singleInstance.value;let p={},m=null,d=null,y=null,g="_construct",v="_dispose",w={},I={},A=null,k={name:e.params.typeName,type:e.types.type,Type:t,level:"object",members:{},attrs:{members:{}},modifiers:{members:{}},previous:()=>A},P=null,S=!1,C=null,D=e.storage?G("sessionStorage"):null,E=e.storage?G("localStorage"):null;const F=Object.freeze({id:j(k.name,".","_"),name:k.name,assemblyName:ae(k.name),Type:k.Type,members:()=>{let e={};for(let t in k.members){e[t]={name:t,type:k.members[t],modifiers:[],attrs:[]};for(let n of k.modifiers.members[t])e[t].modifiers.push(n.name);for(let n of k.attrs.members[t])e[t].attrs.push(n.name);e[t].modifiers=Object.freeze(e[t].modifiers),e[t].attrs=Object.freeze(e[t].attrs),e[t]=Object.freeze(e[t])}return Object.freeze(e)}}),z=(e,t,n,r)=>{for(let i of ie.members.all(t).current())if(i.isCustom){if("prop"===n){let n=i.attr.decorateProperty(k.name,t,r);if(!n.get||!n.set)throw b.OperationFailed(`${i.name} decoration result is unexpected. (${k.name}::${t})`,qe);n.get=n.get.bind(e),n.set=n.set.bind(e),r=n}else{let s=null;if("func"===n){if(s=i.attr.decorateFunction(k.name,t,r),O(r)!==O(s))throw b.OperationFailed(`${i.name} decoration result is unexpected. (${k.name}::${t})`,qe)}else s=i.attr.decorateEvent(k.name,t,r);if(!s)throw b.OperationFailed(`${i.name} decoration result is unexpected. (${k.name}::${t})`,qe);r=s.bind(e)}i.attr=null}return r},M=(e,t,n)=>{let r=null,i=[];return i=st(k.name,e,n),k.aspects.members[e]=i,i.length>0&&(r=at(t,k.name,e,i))&&(t=r),t},R=()=>{let i=!1,s=e=>{Object.defineProperty(p,e,Object.getOwnPropertyDescriptor(n,e))},a=Object.getOwnPropertyDescriptor(n,r);a.enumerable=!1,Object.defineProperty(p,r,a),d=p[r];for(let e in n)if(i=!1,n.hasOwnProperty(e)&&e!==r){if(i=!0,k.members[e]?(re.members.probe("private",e).current()&&(i=!1),i&&re.members.probe("protected",e).current()&&!f.isNeedProtected&&(i=!1)):re.members.probe("protected",e).anywhere()&&!f.isNeedProtected&&(i=!1),i&&s(e),i&&re.members.isProperty(e))if(re.members.probe("privateSet",e).current()){let t=Object.getOwnPropertyDescriptor(p,e);t.set=h,Object.defineProperty(p,e,t)}else if(re.members.probe("protectedSet",e).current()&&!f.isNeedProtected){let t=Object.getOwnPropertyDescriptor(p,e);t.set=h,Object.defineProperty(p,e,t)}if(i&&re.members.is("abstract",e)){if(!f.isNeedProtected)throw b.NotImplemented(`Abstract member is not implemented. (${k.name}::${e})`,qe);if(!re.type.probe("abstract").current())throw b.InvalidDefinition(`Abstract member can exists only in abstract type. (${k.name}::${e})`,qe)}if(i){let t=ie.members.probe("enumerate",e).current();if(t&&!1===t.args[0]){let t=Object.getOwnPropertyDescriptor(p,e);t.enumerable=!1,Object.defineProperty(p,e,t)}}i&&!f.isNeedProtected&&re.members.isEvent(e)&&p[e].strip(p)}f.isTopLevelInstance&&(Re(e.ex.instance,p,p,t,k,c,ie,re,l.attrs,l.modifiers),Re(e.mex.instance,p,d,t,k,c,ie,re,l.attrs,l.modifiers)),f.isTopLevelInstance||(d.def=k)},_=(t,n)=>{if((-1===Object.keys(p).indexOf(t)||re.members.type(t)!==n[r].modifiers.members.type(t))&&("dispose"!==t||"function"!=typeof p[v]&&"function"!=typeof d.dispose))throw b.NotImplemented(`Interface member is not implemented. (${n[r].name+":"+t})`,qe);Ce("interface",n[r].name),Ee(k,c,t,!1,e.customAttrs)},V=()=>{if(k.interfaces){for(let e of k.interfaces)for(let t in e)e.hasOwnProperty(t)&&_(t,e);delete k.interfaces}},J=(t,n,r)=>{switch(-1!==["func","prop","event"].indexOf(n)&&t.startsWith("_")&&new b("InvalidName",`Name is not valid. (${k.name}::${t})`),n){case"func":if(!e.func)throw b.InvalidOperation(`Function cannot be defined on this type. (${k.name})`,qe);break;case"prop":if(!e.prop)throw b.InvalidOperation(`Property cannot be defined on this type. (${k.name})`,qe);break;case"event":if(!e.event)throw b.InvalidOperation(`Event cannot be defined on this type. (${k.name})`,qe);break;case"construct":if(!e.construct)throw b.InvalidOperation(`Constructor cannot be defined on this type. (${k.name})`,qe);n="func";break;case"dispose":if(!e.dispose)throw b.InvalidOperation(`Dispose cannot be defined on this type. (${k.name})`,qe);n="func";break}return n},H=(t,r,i)=>{let s=!0,o=ie.members.probe("conditional",t).current();if(o){let e=$(o.args[0]||[]);for(let t of e){if("test"!==(t=t.toLowerCase())||!a.env.isTesting){s=!1;break}if("server"!==t||!a.env.isServer){s=!1;break}if("client"!==t||!a.env.isClient){s=!1;break}if("worker"!==t||!a.env.isWorker){s=!1;break}if("main"!==t||!a.env.isMain){s=!1;break}if("debug"!==t||!a.env.isDebug){s=!1;break}if("prod"!==t||!a.env.isProd){s=!1;break}if("cordova"!==t||!a.env.isCordova){s=!1;break}if("nodewebkit"!==t||!a.env.isNodeWebkit){s=!1;break}if(-1===a.symbols.indexOf(t)){s=!1;break}}if(!s)return s}if(e.inheritance&&re.members.probe("abstract",t).current()&&!0!==i.ni)throw b.InvalidDefinition(`Abstract member must not be implemented. (${k.name}::${t})`,qe);if((o=re.type.probe("static").current())&&e.static)if(l.isStatic()){if(e.construct&&t===g&&0!==i.length)throw b.InvalidDefinition(`Static constructors cannot have arguments. (${k.name}::construct)`,qe);if(e.dispose&&t===v)throw b.InvalidDefinition(`Static types cannot have destructors. (${k.name}::dispose)`,qe)}else{if(e.construct&&t===g)throw b.InvalidDefinition(`Non-static types cannot have static constructors. (${k.name}::construct)`,qe);if(e.dispose&&t===v)throw b.InvalidDefinition(`Static destructors cannot be defined. (${k.name}::dispose)`,qe)}if(e.dispose&&t===v&&0!==i.length&&(i.length>1||1===i.length&&!re.members.probe("override",t).current()))throw b.InvalidDefinition(`Destructor method cannot have arguments. (${k.name}::dispose)`,qe);if(-1!==Object.keys(n).indexOf(t)&&(!e.inheritance||e.inheritance&&!re.members.probe("override",t).current()))throw b.Duplicate(k.name+"::"+t,qe);if(e.inheritance&&re.members.probe("override",t).current()){if(-1===Object.keys(n).indexOf(t))throw b.InvalidDefinition(`Member not found to override. (${k.name}::${t})`,qe);if(re.members.type(t)!==r)throw b.InvalidDefinition(`Overriding member type is invalid. (${k.name}::${t})`,qe)}if(e.static&&(re.members.probe("static",t).current()||l.isStatic()))if("func"===r){if(x(i))throw b.InvalidDefinition(`Static functions cannot be defined as an arrow function. (${k.name}::${t})`,qe)}else if("prop"===r){if(i.get&&"function"==typeof i.get&&x(i))throw b.InvalidDefinition(`Static property getters cannot be defined as an arrow function. (${k.name}::${t})`,qe);if(i.set&&"function"==typeof i.set&&x(i))throw b.InvalidDefinition(`Static property setters cannot be defined as an arrow function. (${k.name}::${t})`,qe)}if(e.storage&&ie.members.probe("session",t).current()&&i.get&&"function"==typeof i.get)throw b.InvalidDefinition(`Session properties cannot be defined with a custom getter/setter. (${k.name}::${t})`,qe);if(e.storage&&ie.members.probe("state",t).current()){if(i.get&&"function"==typeof i.get)throw b.InvalidDefinition(`State properties cannot be defined with a custom getter/setter. (${k.name}::${t})`,qe);if(!E)throw b.InvalidOperation("Port is not configured. (localStorage)",qe)}return s},X=(t,i,s)=>{let a={get:null,set:null},o=h,l=h,c=re.members.probe("readonly",t).anywhere(),u=re.members.probe("static",t).anywhere(),p=ie.members.probe("session",t).anywhere(),m=ie.members.probe("state",t).anywhere(),d=ie.members.probe("deprecate",t).current(),y=ie.members.probe("inject",t).current(),g=ie.members.probe("asset",t).current(),v=ie.members.probe("resource",t).current(),x=ie.members.probe("type",t).current(),O=null!==d,I=O?d.args[0]||`Event is marked as deprecate. (${k.name}::${t})`:"",A=w,$=n,j=k.name+"_"+t,T=!1,P=null;if(s&&(s.get||s.set)){if(!e.propGetterSetter)throw b.InvalidDefinition(`Getter/Setter are not allowed. (${k.name}::${t})`,qe);s.get&&"function"==typeof s.get&&(o=s.get),s.set&&"function"==typeof s.set&&(l=s.set),e.static&&u&&($=f.staticInterface),a.get=function(){return O&&console.log(I),o.apply($)}.bind($),a.set=function(e){if(O&&console.log(I),c&&!$[r].constructing)throw b.InvalidOperation(`Property is readonly. (${k.name}::${t})`,qe);if(x&&x.args[0]&&!W(e,x.args[0]))throw b.InvalidArgument("value",qe);return l.apply($,[e])}.bind($)}else{if(e.static&&u){if(A=f.staticInterface[r].props,$=f.staticInterface,x&&x.args[0]&&!W(s,x.args[0]))throw b.InvalidArgument("value",qe);A[j]=s}else if(e.storage&&(p||m)){if(T=!0,p?(A=D,j=n[r].id+"_"+j):A=E,ne(p?"session":"state",j),!A.key(j)){if(x&&x.args[0]&&!W(s,x.args[0]))throw b.InvalidArgument("value",qe);A.setItem(j,JSON.stringify({value:s}))}}else{if(x&&x.args[0]&&!W(s,x.args[0]))throw b.InvalidArgument("value",qe);if(e.numOnlyProps&&"number"!=typeof s)throw b.InvalidArgument("value",qe);A[j]=s}a.get=function(){return O&&console.log(I),T?JSON.parse(A.getItem(j)).value:A[j]}.bind($),a.set=function(e){if(O&&console.log(I),c&&!$[r].constructing)throw b.InvalidOperation(`Property is readonly. (${k.name}::${t})`,qe);if(x&&x.args[0]&&!W(e,x.args[0]))throw b.InvalidArgument("value",qe);T?A.setItem(j,JSON.stringify({value:e})):A[j]=e}.bind($)}if(y&&!u&&!T){let e=y.args[0],t=y.args.length>0?y.args[1]:[],n=y.args.length>1&&y.args[2],r=null;try{switch(U(e)){case"class":case"struct":r=t;break;case"string":if(r=ue(e)){if(-1===["class","struct"].indexOf(U(r)))throw b.InvalidArgument("inject",qe)}else P=Ye.resolve(e,t,n),Array.isArray(P)||(P=[P]);break;default:throw b.InvalidArgument("inject",qe)}!P&&r&&(P=[],t.length>0?P.push(new r(...t)):P.push(new r))}catch(e){throw new b(e,qe)}a.set(P)}if((ie.members.probe("dispose",t).anywhere()||y)&&ne("prop",t),(v||g)&&!T){let e=null;if(v)v.args[0]&&(e=le(v.args[0]));else if(g.args[0]){let t=g.args[0];t.startsWith("../")&&(t=t.substr(3)),t.startsWith("./")&&(t=t.substr(2)),t.startsWith("/")&&(t=t.substr(1)),e=ae(k.name)+"/"+t}e&&a.set(e)}return e.customAttrs&&(a=z($,t,i,a)),a},K=(t,r,i)=>{if("func"===r){let r=Ce.get("overload");if(r){let s,a=e.static&&re.members.probe("static",t).current()?f.staticInterface:n;if(Q(t,i,r),a[t]){if(Ce.count()>1)throw b.InvalidDefinition(`Overloaded function cannot define additional modifiers or attributes. (${k.name}::${t})`,qe);return!0}}}return!1},Q=(t,i,s)=>{let a=e.static&&re.members.probe("static",t).current(),o=a?f.staticInterface:n,l,c,u;(a?o[r].overloads:I)[t+"_"+$(s.args[0]).join("_")]=i},Y=(t,...i)=>{let s=e.static&&re.members.probe("static",t).current(),a=s?f.staticInterface:n,o=s?a[r].overloads:I,l="",c="";for(let e of i)l+="_"+typeof e;return l.startsWith("_")&&(l=l.substr(1)),o[c=t+"_"+l]||null},Z=(t,i,s)=>{let a=null,o=n,l=e.inheritance&&re.members.probe("override",t).current(),c=e.static&&re.members.probe("static",t).current(),u=re.members.probe("async",t).current(),p=ie.members.probe("deprecate",t).current(),m=ie.members.probe("inject",t).current(),d=ie.members.probe("on",t).current(),y=ie.members.probe("timer",t).current(),g=ie.members.probe("args",t).current(),v=ie.members.probe("aspects",t).current(),w=ie.members.probe("fetch",t).current(),x=ie.members.probe("overload",t).current(),I=null!==p,A=I?p.args[0]||`Function is marked as deprecate. (${k.name}::${t})`:"",$=null,j="",T="",P="",S=null,C=[];if(l?!0!==($=n[t].bind(o)).ni&&$!==h||($=null):c&&(o=f.staticInterface),m){let e=m.args[0],t=m.args.length>0?m.args[1]:[],n=m.args.length>1&&m.args[2];C=Ye.resolve(e,t,n),Array.isArray(C)||(C=[C])}if((u=u||O(s))?(w&&w.args.length>0?(j=w.args[0],T=w.args[1],P=w.args[2],S=((e={})=>(e.method=j,N(P,T,e)))):S=null,a=async function(...e){return new Promise(function(n,r){I&&console.log(A);let i=[];if($&&i.push($),S&&i.push(S),C.length>0&&i.push(C),g&&g.args.length>0){let t=q(...g.args)(...e);t.error&&r(t.error,s),i.push(t)}else i=i.concat(e);x&&(s=Y(t,...i));try{let e=s.apply(o,i);e&&"function"==typeof e.then?e.then(n).catch(e=>{r(e,s)}):n(e)}catch(e){r(e,s)}}.bind(o))}.bind(o)):a=function(...e){I&&console.log(A);let n=[];if($&&n.push($),C.length>0&&n.push(C),g&&g.args.length>0){let t=q(...g.args)(...e);t.throwOnError(qe),n.push(t)}else n=n.concat(e);return x&&(s=Y(t,...n)),s.apply(o,n)}.bind(o),e.customAttrs&&(a=z(o,t,i,a)),e.aop){let e=[];v&&v.args.length>0&&(v.args.forEach(e=>{if(!W(e,"Aspect"))throw b.InvalidArgument(`Only Aspect types can be statically weaved on function. (${k.name}::${t})`,qe)}),e=v.args),a=M(t,a,e)}if(d&&d.args.length>0&&(Xe(d.args[0],a),ne("handler",{name:d.args[0],handler:a})),y&&y.args.length>0){let e=!1,i=setInterval(()=>{o[r].constructing||e||(e=!0,n[t](),e=!1)},1e3*y.args[0]);ne("timer",i)}return a},ee=(t,i,s)=>{let a=null,o=null,l=null,c=null,u=e.inheritance&&re.members.probe("override",t).current(),f=ie.members.probe("deprecate",t).current(),m=ie.members.probe("post",t).current(),d=null!==f,h=d?f.args[0]||`Event is marked as deprecate. (${k.name}::${t})`:"",y=n;return C||(C=new B(k.name),ne("event",C)),u&&!0===(l=n[t][r].processor).ni&&(l=null),a=function(...e){return d&&console.log(h),c=l?[l].concat(e):e,s.apply(y,c)}.bind(y),e.customAttrs&&(a=z(y,t,i,a)),o=a,(a=function(...e){let n=e;"function"==typeof o&&(n=o(...e)),C.dispatch(t,n),m&&m.args.length>0&&Ke(m.args[0],n)}.bind(y))[r]=Object.freeze({processor:o}),a.add=(e=>{C.add(t,e)}),a.remove=(e=>{C.remove(t,e)}),a.strip=(e=>{let n=T({},a,!0,["strip"]);delete a.strip,delete e.strip,Object.defineProperty(p,t,{configurable:!0,enumerable:!0,value:Object.freeze(n)})}),a},te=(t,i,s)=>{if(i=J(t,i,s),K(t,i,s))return;k.members[t]=i,k.attrs.members[t]=[],k.modifiers.members[t]=[],e.aop&&(k.aspects={members:{}}),e.mixins&&null!==y&&Ce("mixin",y[r].name),Ee(k,c,t,!1,e.customAttrs);let a=null,o=e.static&&re.members.probe("static",t).current(),l=o?f.staticInterface:n;if(o){if(!c.staticConstructionCycle)return}else if(c.staticConstructionCycle)return;if(H(t,i,s))switch(i){case"func":a=Z(t,i,s),Object.defineProperty(l,t,{configurable:!0,enumerable:!0,value:a});break;case"prop":a=X(t,i,s),Object.defineProperty(l,t,{configurable:!0,enumerable:!0,get:a.get,set:a.set});break;case"event":a=ee(t,i,s),Object.defineProperty(l,t,{configurable:!0,enumerable:!0,value:a});break}},ne=(e,t)=>{m.disposables.push({type:e,data:t})},re=Fe(!0,k,c),ie=Fe(!1,k,c);if(e.inheritance){if(f.isTopLevelInstance&&!c.staticConstructionCycle&&!$t&&re.type.probe("abstract").current())throw b.InvalidOperation(`Cannot create instance of an abstract type. (${k.name})`,qe);let e=l.inherits,t=null;if(e){if((t=e[r]).isSealed()||t.isSingleton()||t.isStatic())throw b.InvalidDefinition(`Cannot inherit from a sealed, static or singleton type. (${t.name})`,qe);if(t.type!==l.type)throw b.InvalidDefinition(`Cannot inherit from another type family. (${t.type})`,qe);if(t.context&&t.context.isUnloaded())throw b.InvalidOperation(`Parent context is not active anymore. (${t.name})`,qe);n=new e(f._flagName,f.staticInterface,f.args),m=n[r],A=m.def,delete m.def}else if(l.context&&l.context.isUnloaded())throw b.InvalidOperation(`Type context is not active anymore. (${l.name})`,qe)}if(void 0===n[r]&&(n[r]={},m=n[r],e.dispose&&(m.disposables=[])),e.mixins&&(k.mixins=e.params.mixins),e.interfaces&&(k.interfaces=e.params.interfaces),m.type=e.types.instance,f.isTopLevelInstance&&(m.Type=t,e.new&&(m.isInstanceOf=(e=>{if(e[r]&&(e=e[r].name),!e)throw b.InvalidArgument("name",qe);return l.name===e||l.isDerivedFrom(e)})),e.mixins&&(m.isMixed=(e=>l.isMixed(e))),e.interfaces&&(m.isImplements=(e=>l.isImplements(e))),m.modifiers=re,m.attrs=ie,$t&&(m.def=k,m.typeDef=c,m.obj=n)),P=new Proxy({},{get:(t,r)=>{if(e.new){if("$self"===r)return F;if("$static"===r)return f.staticInterface}return n[r]},set:(t,r,i)=>{if(e.new&&-1!==["$self","$static"].indexOf(r))throw b.InvalidOperation(`Special members cannot be custom defined. (${r})`,qe);if(S){let e="";"construct"===r?(e="construct",r=g):"dispose"===r?(e="dispose",r=v):"function"==typeof i?!0===i.event?(i!==L&&delete i.event,e="event"):e="func":e="prop",te(r,e,i)}else{if("function"==typeof i)throw b.InvalidOperation(`Redefinition of members is not allowed. (${r})`,qe);n[r]=i}return!0}}),S=!0,e.mixins&&k.mixins&&!c.staticConstructionCycle){for(let e of k.mixins)y=e,e.apply(P),y=null;delete k.mixins}if(e.params.factory.apply(P),Ce.clear(),S=!1,f.isTopLevelInstance&&(e.construct&&"function"==typeof n[g]&&(m.construct=n[g],delete n[g]),e.dispose&&"function"==typeof n[v])){let e=n[v];delete n[v],m.dispose=(()=>{for(let e of m.disposables)switch(e.type){case"session":D.removeItem(e.data);break;case"state":E.removeItem(e.data);break;case"prop":n[e.data]=null;break;case"event":e.data.clear();break;case"handler":Xe(e.data.name,e.data.handler,!0);break;case"timer":clearInterval(e.data);break}"function"==typeof e&&e(),m.disposables.length=0,w=null,A=null,k=null,P=null,C=null,p=null,n=null})}return e.static&&l.isStatic()&&c.staticConstructionCycle&&t.construct&&"function"==typeof t[g]&&(l.construct=t[g],delete t[g]),R(),!e.interfaces||c.staticConstructionCycle||$t||V(),e.construct&&f.isTopLevelInstance&&!c.staticConstructionCycle&&!$t&&"function"==typeof d.construct&&(d.constructing=!0,d.construct(...f.args),delete d.constructing),e.construct&&c.staticConstructionCycle&&"function"==typeof l.construct&&(l.constructing=!0,l.construct(),delete l.constructing),!f.isTopLevelInstance||c.staticConstructionCycle||$t||e.singleton&&ie.type.probe("singleton").current()&&(l.singleInstance.value=p),!f.isTopLevelInstance||c.staticConstructionCycle||$t||(d=Object.freeze(d),p=Object.seal(p)),p},We=()=>{let t=G("sessionStorage");t?t.clear():e?(!0).sessionStorage&&delete global.sessionStorage:sessionStorage.clear()},qe=e=>{if(e.new=e.new||!1,e.mixins=e.mixins||!1,e.interfaces=e.interfaces||!1,e.inheritance=e.inheritance||!1,e.singleton=e.singleton||!1,e.static=e.static||!1,e.const=e.const||!1,e.func=e.func||!1,e.construct=e.construct||!1,e.dispose=e.dispose||!1,e.prop=e.prop||!1,e.propGetterSetter=e.propGetterSetter||!1,e.numOnlyProps=e.numOnlyProps||!1,e.event=e.event||!1,e.storage=e.storage||!1,e.aop=e.aop||!1,e.customAttrs=e.customAttrs||!1,e.types=e.types||{},e.types.instance=e.types.instance||"unknown",e.types.type=e.types.type||"unknown",e.params=e.params||{},e.params.typeName=e.params.typeName||"",e.params.inherits=e.params.inherits||null,e.params.mixinsAndInterfaces=e.params.mixinsAndInterfaces||null,e.params.factory=e.params.factory||null,e.mex=e.mex||{},e.mex.instance=e.mex&&e.mex.instance?e.mex.instance:{},e.mex.type=e.mex&&e.mex.type?e.mex.type:{},e.ex=e.ex||{},e.ex.instance=e.ex&&e.ex.instance?e.ex.instance:{},e.ex.type=e.ex&&e.ex.type?e.ex.type:{},e.params.ns="",e.params.mixins=[],e.params.interfaces=[],e.func||(e.construct=!1,e.dispose=!1),e.prop||(e.storage=!1),e.inheritance||(e.singleton=!1),e.func||e.prop||e.event||(e.aop=!1),e.new&&(e.const=!1),!e.params.typeName||-1!==e.params.typeName.indexOf("."))throw b.InvalidDefinition(`Type name is invalid. (${e.params.typeName})`,qe);let t=Ce.get("ns"),n=t?t.args[0]:"";if(n)switch(n){case"(auto)":throw b.InvalidDefinition(`Namespace '(auto)' should be used only when bundling the type in an assembly. (${n})`,qe);case"(root)":break;default:if(n.startsWith(".")||n.endsWith(".")||/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g.test(n))throw`Namespace name is invalid. (${n})`;e.params.typeName=n+"."+e.params.typeName,e.params.ns=n;break}if(e.params.mixinsAndInterfaces)for(let t of e.params.mixinsAndInterfaces)if(t[r])switch(t[r].type){case"mixin":e.params.mixins.push(t);break;case"interface":e.params.interfaces.push(t);break}delete e.params.mixinsAndInterfaces,ze(e);let i=re.context.current(),s=i.currentAssemblyBeingLoaded()||"",a=null,o=null;if(e.new)if(e.inheritance){if(e.params.inherits&&(ge(e.params.inherits)||be(e.params.inherits)||ye(e.params.inherits)))throw b.InvalidDefinition(`Cannot inherit from a sealed, static or singleton type. (${e.params.inherits[r].name})`,qe);a=function(t,n,...r){return Ue(e,a,{},t,n,...r)}}else a=function(...t){return Ue(e,a,{},null,null,...t)};else a=e.const?function(){return Ue(e,a,{})}:function(...t){if(new.target)throw b.InvalidOperation(`Construction cannot be done for this type. (${e.params.typeName})`,a);e.params.factory.apply(this,...t)};let l={name:e.params.typeName,type:e.types.type,Type:a,level:"type",attrs:{type:[]},modifiers:{type:[]},previous:()=>a[r].inherits?a[r].inherits[r].def():null};const c=Fe(!0,null,l),u=Fe(!1,null,l);if(a[r]={},(o=a[r]).name=e.params.typeName,o.type=e.types.type,o.namespace=null,o.assembly=(()=>i.getAssembly(s)||null),o.context=i,e.inheritance&&(o.inherits=e.params.inherits||null,o.isAbstract=(()=>!!c.type.probe("abstract").current()),o.isSealed=(()=>!!c.type.probe("sealed").current()),o.isDerivedFrom=(t=>{if(t[r]&&(t=t[r].name),"string"!=typeof t)throw b.InvalidArgument("name",o.isDerivedFrom);let n=!1,i=e.params.inherits;if(!n)for(;1&&null!==i;){if(i[r].name===t){n=!0;break}i=i[r].inherits}return n}),o.inherits)){let e=u.type.probe("deprecate").anywhere();if(e){let t=e.args[0]||`Type is marked as deprecated. (${o.name})`;console.log(t)}}if(e.static&&(o.isStatic=(()=>!!c.type.probe("static").current()),o.props={},o.overloads={}),e.singleton&&(o.isSingleton=(()=>!!u.type.probe("singleton").current()),o.singleInstance={value:null}),e.mixins&&(o.mixins=e.params.mixins,o.isMixed=(e=>{if(e[r]&&(e=e[r].name),"string"!=typeof e)throw b.InvalidArgument("name",o.isMixed);let t=!1,n=a;for(;1&&null!==n&&(n[r].mixins&&(t=-1!==A(n[r].mixins,"name",e)),!t);)n=n[r].inherits;return t})),e.interfaces&&(o.interfaces=e.params.interfaces,o.isImplements=(e=>{if(e[r]&&(e=e[r].name),"string"!=typeof e)throw b.InvalidArgument("name",o.isImplements);let t=!1,n=a;for(;1&&null!==n&&(n[r].interfaces&&(t=-1!==A(n[r].interfaces,"name",e)),!t);)n=n[r].inherits;return t})),o.isDeprecated=(()=>!!u.type.probe("deprecate").current()),o.def=(()=>l),o.modifiers=c,o.attrs=u,Ee(null,l,null,!0,e.customAttrs),e.static&&c.type.probe("static").current()){if(e.params.interfaces.length>0)throw b.InvalidDefinition("Static types cannot implement interfaces.",qe);if(e.params.mixins.length>0)throw b.InvalidDefinition("Static types cannot implement mixins.",qe)}if(e.static){let t=e.params.factory?e.params.factory.toString():"";if(o.isStatic()||-1!==t.indexOf(`$$('static')`)||-1!==t.indexOf(`$$("static")`)){l.staticConstructionCycle=!0;let e=new a;Te(e),delete l.staticConstructionCycle}}Me(e.ex.type,a,a,l,u,c),Me(e.mex.type,a,o,l,u,c);let f=null,p=!1;return e.static&&o.isStatic()||e.const?(f=new a,e.const&&(p=!0)):(p=!0,f=a),n&&(o.namespace=re.context.current().registerType(f)),a[r]=Object.freeze(o),p&&Object.freeze(f),f},_e=(e,t,n,r)=>{let i=q("name: string, inherits: class, factory: cfunction","name: string, inherits: class, mixints: array, factory: cfunction","name: string, factory: cfunction","name: string, mixints: array, factory: cfunction")(e,t,n,r);i.throwOnError(_e);let s={new:!0,mixins:!0,interfaces:!0,inheritance:!0,singleton:!0,static:!0,func:!0,construct:!0,dispose:!0,prop:!0,propGetterSetter:!0,event:!0,storage:!0,aop:!0,customAttrs:!0,types:{instance:"instance",type:"class"},params:{typeName:i.values.name,inherits:i.values.inherits,mixinsAndInterfaces:i.values.mixints,factory:i.values.factory},mex:{instance:{},type:{}},ex:{instance:{},type:{}}};return qe(s)};d("Class",_e);const Le=(e,t)=>{let n=q("name: string, factory: cfunction")(e,t);n.throwOnError(Le);let r={const:!0,func:!0,dispose:!0,prop:!0,propGetterSetter:!0,event:!0,types:{instance:"interface",type:"interface"},params:{typeName:n.values.name,factory:n.values.factory}};return qe(r)};d("Interface",Le);const Be=(e,t)=>{let n=q("name: string, factory: cfunction")(e,t);n.throwOnError(Be);let r={new:!0,func:!0,construct:!0,prop:!0,propGetterSetter:!0,types:{instance:"sinstance",type:"struct"},params:{typeName:n.values.name,factory:n.values.factory}};return qe(r)};d("Struct",Be);const Ve=(e,t)=>{let n=q("name: string, factory: cfunction")(e,t);n.throwOnError(Ve);let r={const:!0,prop:!0,numOnlyProps:!0,types:{instance:"enum",type:"enum"},params:{typeName:n.values.name,factory:n.values.factory},mex:{instance:{getName:function(e){let t=this.instance.obj,n=this.instance.def,r="";for(let i in n.members)if(n.members.hasOwnProperty(i)&&"prop"===n.members[i]&&t[i]===e){r=i;break}return r},getNames:function(){let e=this.instance.def,t=[];for(let n in e.members)e.members.hasOwnProperty(n)&&"prop"===e.members[n]&&t.push(n);return t},getValues:function(){let e=this.instance.def,t=this.instance.obj,n=[];for(let r in e.members)e.members.hasOwnProperty(r)&&"prop"===e.members[r]&&n.push(t[r]);return n}}}};return qe(r)};Ve.getName=((e,t)=>{let n;return q("enumType: enum, enumValue: number")(e,t).throwOnError(Ve.getName),e[r].getName(t)}),Ve.getNames=(e=>{let t;return q("enumType: enum")(e).throwOnError(Ve.getNames),e[r].getNames()}),Ve.getValues=(e=>{let t;return q("enumType: enum")(e).throwOnError(Ve.getValues),e[r].getValues()}),Ve.isDefined=((e,t)=>{let n=q("enumType: enum, nameOrValue: number","enumType: enum, nameOrValue: string")(e,t);return n.throwOnError(Ve.isDefined),1===n.index?-1!==e[r].getNames().indexOf(t):""!==e[r].getName(t)}),d("Enum",Ve);const Ge=(e,t)=>{let n=q("name: string, factory: cfunction")(e,t);n.throwOnError(Ge);let r={func:!0,prop:!0,propGetterSetter:!0,event:!0,customAttrs:!0,types:{type:"mixin"},params:{typeName:n.values.name,factory:n.values.factory}};return qe(r)};d("Mixin",Ge);const Je=new B,He=Je.dispatch,Xe=(e,t,n)=>{let r;q("event: string, handler: afunction")(e,t).throwOnError(Xe),n?Je.remove(e,t):Je.add(e,t)};d("on",Xe,()=>{Je.clear()});const Ke=(e,t)=>{if("string"!=typeof e)throw b.InvalidArgument("event",Ke);He(e,t)};d("post",Ke);let Qe={};const Ye={isRegistered:e=>{if("string"!=typeof e)throw b.InvalidArgument("alias",Ye.isRegistered);return void 0!==Qe[e]&&Qe[e].length>0},get:(e,t)=>{if("string"!=typeof e)throw b.InvalidArgument("alias",Ye.get);return t?Qe[e]?Qe[e].slice():[]:Qe[e]?Qe[e][0]:null},register:(e,t)=>{if("string"!=typeof e)throw b.InvalidArgument("alias",Ye.register);if(!t)throw b.InvalidArgument("item",Ye.register);if(-1!==e.indexOf("."))throw b.InvalidArgument("alias",Ye.register);"string"==typeof t&&((t=w(t)).endsWith(".js")||t.endsWith(".mjs"))&&(t=w(t,!0)),Qe[e]||(Qe[e]=[]),Qe[e].push(t)},resolve:(e,t,...n)=>{if("string"!=typeof e)throw b.InvalidArgument("alias",Ye.resolve);if("boolean"!=typeof t)throw b.InvalidArgument("isAll",Ye.resolve);let i=null;const s=e=>{let t=e;if("string"==typeof e)if(e.endsWith(".js")||e.endsWith(".mjs"));else{let t=ue(e);t&&(e=t)}if(-1!==["class","struct"].indexOf(U(e)))try{t=n?new e(...n):new e}catch(t){throw b.OperationFailed(`Type could not be instantiated. (${e[r].name})`,Ye.resolve)}return t};return Qe[e]&&Qe[e].length>0&&(t?(i=[],Qe[e].forEach(e=>{i.push(s(e))})):i=s(Qe[e][0])),i}};d("Container",Ye,()=>{Qe={}});let Ze=h,et=[],tt=500;const nt={on:(e,...t)=>{Ze===h&&("string"==typeof e?t.unshift(e):"function"==typeof e&&Xe("telemetry",e),Ze=((e,n)=>{if(0===t.length||-1!==t.indexOf(e)){let t=Object.freeze({type:e,data:n});et.push(t),et.length>tt-25&&et.splice(0,25),Ke("telemetry",t)}}))},collect:()=>{if(Ze!==h){let e=et.slice();return et.length=0,e}return[]},off:e=>Ze!==h?("function"==typeof e&&Xe("telemetry",e,!0),Ze=h,nt.collect()):[],isOn:()=>Ze!==h,types:Object.freeze({RAW:"raw",EXEC:"exec",INFO:"info",INCL:"incl"})};d("telemetry",nt,()=>{et.length=0});const rt=[],it={register:(e,t)=>{let n;q("pointcut: string, aspect: Aspect")(e,t).throwOnError(it.register);let r=e,i="",s="",a="",o="",l=null;-1!==r.indexOf(":")&&(r=(l=r.split(":"))[0].trim(),a=l[1].trim()||"*"),-1!==r.indexOf(".")?(i=r.substr(0,r.lastIndexOf(".")),s=r.substr(r.lastIndexOf(".")+1)):(i="",s=r),o=j(o=i+"/"+s+":"+a,".","[.]"),o=j(o,"?","."),o=j(o,"*",".*"),rt.push({rex:new RegExp(o),Aspect:t})}},st=(e,t,n)=>{let i=[],s="",a="",o=t.trim(),l="";return-1!==e.indexOf(".")?(s=e.substr(0,e.lastIndexOf(".")).trim(),a=e.substr(e.lastIndexOf(".")+1).trim()):(s="",a=e.trim()),l=s+"/"+a+":"+o,n&&i.push(...n),rt.forEach(e=>{e.rex.test(l)&&-1===I(i,"name",e.Aspect[r].name)&&i.push({name:e.Aspect[r].name,Aspect:e.Aspect})}),i},at=(e,t,n,r)=>{let i=[],s=[],a=[],o=null,l;for(let e of r)(o=new e.Aspect).before!==h&&i.push(o.before),o.around!==h&&a.push(o.around),o.after!==h&&s.push(o.after);return a.length>0&&a.reverse(),function(...r){let o=null,l=null,c={typeName:()=>t,funcName:()=>n,error:e=>(e&&(o=e),o),result:e=>(void 0!==e&&(l=e),l),args:()=>r,data:{}};for(let e of i)try{e(c)}catch(e){o=e}const u=e=>{for(let t of s)try{t(e)}catch(e){c.error(e)}};let f=e,p=null;for(let e of a)f=e(c,f);try{(p=f(...r))&&"function"==typeof p.then?c.result(new Promise((e,t)=>{p.then(t=>{c.result(t),u(c),e(c.result())}).catch(e=>{c.error(e),u(c),t(c.error())})})):(c.result(p),u(c))}catch(e){c.error(e)}return c.result()}};d("Aspects",it,()=>{rt.length=0});const ot=(e,t)=>{let n=null,i=null,s=t?JSON.parse(e):e,a=t?null:e[r].Type,o=a[r];const l=(e,t)=>{let n=e[r],i=n.attrs,s=n.modifiers,a=[],o=!1;for(let n in e)e.hasOwnProperty(n)&&n!==r&&((o=s.members.isProperty(n))&&(o=t?!i.members.probe("noserialize",n).anywhere():i.members.probe("serialize",n).anywhere())&&(o=!(s.members.is("private",n)||s.members.is("protected",n)||s.members.is("static",n)||s.members.is("readonly",n)||i.members.probe("resource",n).anywhere()||i.members.probe("asset",n).anywhere()||i.members.probe("inject",n).anywhere())),o&&a.push(n));return a};if(t){if(!s.type&&!s.data)throw b.InvalidArgument("json");if(!(a=ue(s.type)))throw b.NotFound(s.type,lt.deserialize);try{n=new a}catch(e){throw b.OperationFailed(`Object could not be deserialized. (${s.type})`,e,lt.deserialize)}i=o.attrs.type.probe("serialize").anywhere()?l(n,!0):l(n,!1);for(let e of i)n[e]=s.data[e]}else{i=o.attrs.type.probe("serialize").anywhere()?l(s,!0):l(s,!1),n={type:s[r].Type[r].name,data:{}};for(let e of i)n.data[e]=s[e];try{n=JSON.stringify(n)}catch(e){throw b.OperationFailed(`Object could not be serialized. (${s[r].Type[r].name})`,e,lt.serialize)}}return n},lt={serialize:e=>{if(l.indexOf(-1===U(e)))throw b.InvalidArgument("instance",lt.serialize);return ot(e)},deserialize:e=>{if(!e||"string"!=typeof e)throw b.InvalidArgument("json",lt.deserialize);return ot(e,!0)}};d("Serializer",lt);const ct=4*a.env.cores,ut=Math.round(ct/4),ft=[],pt=()=>{if(ft.length<=ut)return;let e=ft.slice(0),t=()=>{if(0!==e.length){let n=e.shift();n.context.isBusy()?t():n.context.hasActiveInstances().then(e=>{0===e?(n.unload(),ft.shift(),ft.length>ut&&t()):t()}).catch(()=>{t()})}};t()},mt=()=>new Promise((e,t)=>{let n=ft.slice(0),r=()=>{if(0!==n.length){let i=n.shift();i.context.isBusy()?r():i.context.hasActiveInstances().then(t=>{0===t?e(i):r()}).catch(t)}else ft.length{e(t)}).catch(t):t(b.OperationFailed("AppDomain pool limit reached."))};r()}),dt={TaskInfo:function(e,...t){if("string"!=typeof e)throw b.InvalidArgument("qualifiedName",dt.TaskInfo);return Object.freeze({type:e,typeArgs:t})},getHandle:(e,t)=>new Promise((n,r)=>{mt().then(r=>{let i;n({run:(...n)=>new Promise((i,s)=>{r.context.execute({type:e.type,typeArgs:e.typeArgs,func:"run",args:n,keepAlive:!0},t).then(i).catch(s)}),close:()=>new Promise((n,i)=>{r.context.execute({type:e.type,typeArgs:e.typeArgs,func:"",args:[],keepAlive:!1},t).then(n).catch(i).finally(pt)})})}).catch(r)}),invoke:(e,t)=>new Promise((n,r)=>{mt().then(i=>{i.context.execute({type:e.type,typeArgs:e.typeArgs,func:"run",args:[],keepAlive:!1},t).then(n).catch(r).finally(pt)}).catch(r)}),parallel:Object.freeze({invokeMany:(...e)=>{let t=[];for(let n of e)t.push(dt.invoke(n));return t},invoke:Object.freeze({any:(...e)=>Promise.race(dt.parallel.invokeMany(...e)),all:(...e)=>Promise.all(dt.parallel.invokeMany(...e)),each:(e,t,...n)=>new Promise((r,i)=>{let s=dt.parallel.invokeMany(...n),a=0;for(let n of s)n.then(e).catch(t).finally(()=>{a++,s.length===a&&r()})})})}),sequence:Object.freeze({invoke:(...e)=>new Promise((t,n)=>{let r=e.slice(0),i=[],s=()=>{if(0===r.length)return void t(...i);let e=r.shift();dt.invoke(e).then(e=>{i.push(e),s()}).catch(n)};r.length>0?s():t(...i)})})};d("Tasks",dt,()=>{ft.forEach(e=>{e.unload()}),ft.length=0});const ht=e=>{if(e.isServer){if(!(!0).sessionStorage){const e=function(){let e={};this.key=(t=>{if(!t)throw b.InvalidArgument("key",this.key);return!!e.key}),this.getItem=(t=>{if(!t)throw b.InvalidArgument("key",this.getItem);return e.key||null}),this.setItem=((t,n)=>{if(!t)throw b.InvalidArgument("key",this.setItem);if(void 0===n)throw b.InvalidArgument("value",this.setItem);e[t]=n}),this.removeItem=(t=>{if(!t)throw b.InvalidArgument("key",this.removeItem);delete e[t]}),this.clear=(()=>{e={}})};global.sessionStorage=new e}return(!0).sessionStorage}return(!0).sessionStorage};G.define("sessionStorage",["key","getItem","setItem","removeItem","clear"],ht);const yt=e=>e.isServer?ht(e):(!0).localStorage;G.define("localStorage",["key","getItem","setItem","removeItem","clear"],yt);const gt=e=>{let t={require:e=>new Promise((t,n)=>{if("string"==typeof e)try{t(require(e))}catch(e){n(new b(e))}else n(b.InvalidArgument("module"))}),undef:e=>{if("string"!=typeof e)throw b.InvalidArgument("module",t.undef);try{delete require.cache[require.resolve(e)]}catch(e){throw new b(e,t.undef)}}};return t};G.define("serverModule",["require","undef"],gt);const bt=e=>{let t={require:t=>new Promise((n,r)=>{if("string"!=typeof t)return void r(b.InvalidArgument("module"));let i=t.substr(t.lastIndexOf(".")+1).toLowerCase();try{if("undefined"!=typeof require)try{require([t],n,r)}catch(e){r(new b(e))}else if(e.isWorker)try{importScripts(t),n()}catch(e){r(new b(e))}else{let e=(!0).document.createElement("script");e.type="mjs"===i?"module":"text/javascript",e.name=t,e.src=t,e.onload=(()=>{n()}),e.onerror=(e=>{r(new b(e))}),(!0).document.head.appendChild(e)}}catch(e){r(new b(e))}}),undef:e=>{if("string"!=typeof e)throw b.InvalidArgument("module",t.undef);let n=null;(n=(!0).requirejs||null)&&n.undef(e)}};return t};G.define("clientModule",["require","undef"],bt);const vt=e=>e=>new Promise((t,n)=>{if("string"!=typeof e)return void n(b.InvalidArgument("file"));let r=e.substr(e.lastIndexOf(".")+1).toLowerCase();try{let i=null,s="";(i=e.startsWith("https")?require("https"):require("http")).get(e,e=>{e.on("data",e=>{s+=e}),e.on("end",()=>{let i=e.headers["content-type"];if("json"===r||/^application\/json/.test(i))try{let e=JSON.parse(s);t(e)}catch(e){n(new b(e))}else t(s)})}).on("error",e=>{n(new b(e))})}catch(e){n(new b(e))}});G.define("serverFile",vt);const wt=e=>e=>new Promise((t,n)=>{if("string"!=typeof e)return void n(b.InvalidArgument("file"));let r=e.substr(e.lastIndexOf(".")+1).toLowerCase();fetch(e).then(i=>{if(i.ok){let e=i.headers["content-type"];"json"===r||/^application\/json/.test(e)?i.json().then(t).catch(e=>{n(new b(e))}):i.text().then(t).catch(e=>{n(new b(e))})}else n(b.OperationFailed(e,i.status))}).catch(e=>{n(new b(e))})});G.define("clientFile",wt);const xt=e=>t=>{let n={},r=re.config();return r&&r[t]&&(n=M([n,r[t]],!1)),e.isWorker&&r&&r[`worker:${t}`]&&(n=M([n,r[`worker:${t}`]],!1)),n};G.define("settingsReader",xt);const Ot=(e,t,n,r)=>new Promise((i,s)=>{"string"==typeof t?"string"==typeof n&&-1!==["text","json","buffer","form","blob"].indexOf(n)?r?e(t,r).then(e=>{if(e.ok){let t="";switch(n){case"text":t="text";break;case"json":t="json";break;case"buffer":t="arrayBuffer";break;case"form":t="formData";break;case"blob":t="blob";break}e[t]().then(i).catch(e=>{s(new b(e))})}else s(b.OperationFailed(t,e.status))}).catch(e=>{s(new b(e))}):s(b.InvalidArgument("reqData")):s(b.InvalidArgument("resDataType")):s(b.InvalidArgument("url"))}),It=e=>(e,t,n)=>Ot(require("node-fetch"),e,t,n);G.define("serverFetch",It);const At=e=>(e,t,n)=>Ot(fetch,e,t,n);G.define("clientFetch",At);let $t=!1;const kt=[],jt=function(e){if(!e||!e[r]&&-1!==o.indexOf(e[r].type))throw b.InvalidArgument("Type",jt);let t=null,n=null,i=null,s=null,a=null,l=null,c=null;const u=function(e){this.getType=(()=>"modifier"),this.getName=(()=>e.name),this.getArgs=(()=>e.args.slice()),this.getConstraints=(()=>e.cfg.constraints)},f=function(e){this.getType=(()=>"attribute"),this.getName=(()=>e.name),this.getArgs=(()=>e.args.slice()),this.getConstraints=(()=>e.cfg.constraints),this.isCustom=(()=>e.isCustom)},p=function(){this.getTarget=(()=>i),this.getTargetType=(()=>t.type),this.getName=(()=>t.name||""),this.getType=(()=>t.type),this.getId=(()=>t.id),this.getNamespace=(()=>t.namespace),this.getAssembly=(()=>t.assembly()),this.getContext=(()=>t.context),this.isClass=(()=>"class"===t.type),this.isEnum=(()=>"enum"===t.type),this.isStruct=(()=>"struct"===t.type),this.isMixin=(()=>"mixin"===t.type),this.isInterface=(()=>"interface"===t.type),this.isDeprecated=(()=>t.isDeprecated()),this.getModifiers=(()=>{let e=[];for(let t of l.modifiers.type)e.push(u(t));return e}),this.getAttributes=(()=>{let e=[];for(let t of l.attrs.type)e.push(f(t));return e}),this.getAttribute=(e=>{if("string"!=typeof e)throw b.InvalidArgument("name",this.getAttribute);let t=A(l.attrs.type,"name",e);return t?f(t):null}),this.getModifier=(e=>{if("string"!=typeof e)throw b.InvalidArgument("name",this.getModifier);let t=A(l.modifiers.type,"name",e);return t?u(t):null})},m=function(e){e.getMixins=(()=>{let e=[];if(t.mixins)for(let n of t.mixins)e.push(jt(n));return e}),e.isMixed=(n=>{if(!n)throw b.InvalidArgument("name",e.isMixed);return!!t.isMixed&&t.isMixed(n)})},d=function(e){e.getInterfaces=(()=>{let e=[];if(t.interfaces)for(let n of t.interfaces)e.push(jt(n));return e}),e.isImplements=(n=>{if(!n)throw b.InvalidArgument("name",e.isImplements);return!!t.isImplements&&t.isImplements(n)})},h=function(e){e.getInstanceType=(()=>n.type),e.isInstanceOf=(t=>{if(!t)throw b.InvalidArgument("name",e.isInstanceOf);return!!n.isInstanceOf&&n.isInstanceOf(t)})},y=e=>{let t=n.def;for(;1&&null!==t&&!t.members[e];)t=t.previous();return t},g=()=>{let e=null,t=null;c={};for(let r in n.obj){switch((e=y(r)).members[r]){case"prop":t=new x(r,e);break;case"func":t=new O(r,e);break;case"event":t=new $(r,e);break;case"construct":t=new O(r,e);break;case"dispose":t=new O(r,e);break}c[r]=t}},v=()=>{c||g()},w=function(e,n){this.getType=(()=>"member"),this.getMemberType=(()=>n.members[e]),this.getName=(()=>e),this.getModifiers=(()=>{let t=[];for(let n of a.modifiers[e])t.push(u(n));return t}),this.getAttributes=(()=>{let t=[];for(let n of a.attrs[e])t.push(f(n));return t}),this.getAttribute=(t=>{if("string"!=typeof t)throw b.InvalidArgument("name",this.getAttribute);let n=A(a.attrs[e],"name",t);return n?f(n):null}),this.getModifier=(t=>{if("string"!=typeof t)throw b.InvalidArgument("name",this.getModifier);let n=A(a.modifiers[e],"name",t);return n?u(n):null}),this.isPrivate=(()=>null!==A(a.modifiers[e],"name","private")),this.isProtected=(()=>null!==A(a.modifiers[e],"name","protected")),this.isPublic=(()=>!this.isPrivate()&&!this.isProtected()),this.isStatic=(()=>null!==A(a.modifiers[e],"name","static")),this.isSealed=(()=>null!==A(a.modifiers[e],"name","sealed")),this.isAbstract=(()=>null!==A(a.modifiers[e],"name","abstract")),this.isVirtual=(()=>null!==A(a.modifiers[e],"name","virtual")),this.isOverride=(()=>null!==A(a.modifiers[e],"name","virtual")),this.isEnumerable=(()=>Object.getOwnPropertyDescriptor(s,e).enumerable),this.isDeprecated=(()=>null!==A(a.attrs[e],"name","deprecate")),this.isConditional=(()=>null!==A(a.attrs[e],"name","conditional")),this.isMixed=(()=>null!==A(a.attrs[e],"name","mixin")),this.isInterfaced=(()=>null!==A(a.attrs[e],"name","interface")),this.getMixin=(()=>{let n=null,r=A(a.attrs[e],"name","mixin");if(r&&t.mixins)for(let e of t.mixins)if(e===r.name){n=jt(e);break}return n}),this.getInterface=(()=>{let n=null,r=A(a.attrs[e],"name","interface");if(r&&t.interfaces)for(let e of t.interfaces)if(e===r.name){n=jt(e);break}return n})},x=function(e,t){let n=new w(e,t);return n.isReadOnly=(()=>null!==A(a.modifiers[e],"name","readonly")),n.isSerializable=(()=>null!==A(a.attrs[e],"name","serialize")||null===A(a.attrs[e],"name","noserialize")&&null!==A(l.attrs.type,"name","serialize")),n.getValueType=(()=>{let t=A(a.attrs[e],"name","type");if(t)return t.args[0]}),n.isDisposable=(()=>null!==A(a.attrs[e],"name","dispose")),n.isInjectable=(()=>null!==A(a.attrs[e],"name","inject")),n.isResource=(()=>null!==A(a.attrs[e],"name","resource")),n.isAsset=(()=>null!==A(a.attrs[e],"name","asset")),n.isSession=(()=>null!==A(a.attrs[e],"name","session")),n.isState=(()=>null!==A(a.attrs[e],"name","state")),n},O=function(e,t){let n=new w(e,t);return n.isASync=(()=>null!==A(a.modifiers[e],"name","async")),n.isConstructor=(()=>"_construct"===e),n.isDestructor=(()=>"_dispose"===e),n.isSub=(()=>null!==A(a.attrs[e],"name","on")),n.isTimered=(()=>null!==A(a.attrs[e],"name","timer")),n.isInjectable=(()=>null!==A(a.attrs[e],"name","inject")),n.getArgs=(()=>{let t=A(a.attrs[e],"name","args");return t?t.args.slice():null}),n.getAspects=(()=>{if(a.aspects&&a.aspects[e].length>0){let t=[];for(let n of a.aspects[e])t.push(jt(n));return t}return null}),n.getAspect=(t=>{if("string"!=typeof t)throw b.InvalidArgument("name",n.getAspect);if(a.aspects&&a.aspects[e].length>0){let n=A(a.aspects[e],"name",t);if(n)return jt(n)}return null}),n},$=function(e,t){let n=new w(e,t);return delete n.isStatic,n.isPub=(()=>null!==A(a.attrs[e],"name","post")),n},k=function(e){e.getMembers=(e=>{(e=e||{}).types=e.types||[],e.modifiers=e.modifiers||[],e.attrs=e.attrs||[],e.aspects=e.aspects||[],e.inherited=void 0===e.inherited||e.inherited,v();let t=null,n=!0,r=[];for(let i in c)if(n=!0,c.hasOwnProperty(i)){if(t=c[i],e.types.length>0&&-1===e.types.indexOf(t.getMemberType())&&(n=!1),!n||e.inherited||a.members[i]||(n=!1),n&&e.modifiers.length>0)for(let t of e.modifiers)if(-1===I(a.modifiers[i],"name",t)){n=!1;break}if(n&&e.attrs.length>0)for(let t of e.attrs)if(-1===I(a.attrs[i],"name",t)){n=!1;break}if(n&&e.aspects.length>0&&"func"===t.getMemberType())for(let t of e.aspects)if(-1===I(a.aspects[i],"name",t)){n=!1;break}n&&r.push(c[i])}return r}),e.getMember=(t=>{if("string"!=typeof t)throw b.InvalidArgument("memberName",e.getMember);return v(),c[t]||null})},j=function(){let e=new p;return e.getParent=(()=>null!==t.inherits?jt(t.inherits):null),e.isDerivedFrom=(n=>{if(!n)throw b.InvalidArgument("name",e.isDerivedFrom);return!!t.isDerivedFrom&&t.isDerivedFrom(n)}),e.getFamily=(()=>{let e=[],n=t.inherits;for(null!==t.inherits&&e.push(jt(t.inherits));1&&null!==n;)e.push(jt(n)),n=n[r].inherits;return e}),e.isSealed=(()=>!!t.isSealed&&t.isSealed()),e.isAbstract=(()=>!!t.isAbstract&&t.isAbstract()),m(e),d(e),e.isSerializable=(()=>null!==A(l.attrs.type,"name","serialize")),e.isStatic=(()=>!!t.isStatic&&t.isStatic()),e.isSingleton=(()=>!!t.isSingleton&&t.isSingleton()),e.isSingleInstanceCreated=(()=>!!t.singleInstance.value),h(e),k(e),e},T=function(){let e=new p;return e.isSerializable=(()=>null!==A(l.attrs.type,"name","serialize")),h(e),k(e),e},P=function(){let e=new p;return k(e),e},S=function(){let e=new p;return k(e),e},N=function(){let e=new p;return e.getNames=(()=>{let e=[];for(let t of Ve.getNames(s))e.push(x(t,a));return e}),e.getName=(t=>{if(!t)throw b.InvalidArgument("enumValue",e.getName);let n=Ve.getName(s,t);return n?x(n,a):null}),e.getValues=(()=>Ve.getValues(s)),e.isDefined=(t=>{if(!t)throw b.InvalidArgument("nameOrValue",e.isDefined);return Ve.isDefined(s,t)}),e};let C=null,D=null,E=!1;switch($t=!0,e[r].type){case"class":i=e,s=new e,E=!0,C=new j;break;case"struct":i=e,s=new e,E=!0,C=new T;break;case"enum":i=e[r].Type,s=e,C=new N;break;case"mixin":D=_e("temp",[i=e],function(){}),s=new D,E=!0,C=new P;break;case"interface":i=e[r].Type,s=e,C=new S;break}return $t=!1,E&&kt.push(s),t=i[r],n=s[r],a=n.def,l=n.typeDef,C};jt.dispose=(()=>{if(kt.length>0)for(let e of kt)Te(e);kt.length=0}),d("Reflector",jt,()=>{jt.dispose()});const Tt=()=>{};Tt.forEachAsync=z,Tt.replaceAll=j,Tt.splitAndTrim=$,Tt.findIndexByProp=I,Tt.findItemByProp=A,Tt.which=w,Tt.isArrowFunc=x,Tt.isASyncFunc=O,Tt.sieve=C,Tt.deepMerge=M,Tt.getLoadedScript=R,Tt.b64EncodeUnicode=D,Tt.b64DecodeUnicode=E,d("utils",Tt),m.members=Object.freeze(m.members);let Pt=e?__filename:t?self.location.href:R("flair.js","flair.min.js");m.info=Object.freeze({name:"flairjs",title:"Flair.js",file:Pt,version:"0.6.84",copyright:"(c) 2017-2019 Vikas Burman",license:"MIT",lupdate:new Date("Mon, 13 May 2019 19:21:46 GMT")});let St=w("./flair{.min}.js",!0);re.context.current().loadBundledAssembly(St,Pt,(e,t)=>{const{Class:n,Struct:r,Enum:i,Interface:s,Mixin:a,Aspects:o,AppDomain:l,$$:c,attr:u,bring:f,Container:p,include:m,Port:d,on:h,post:y,telemetry:g,Reflector:b,Serializer:v,Tasks:w,as:x,is:O,isComplies:I,isDerivedFrom:A,isAbstract:$,isSealed:k,isStatic:j,isSingleton:T,isDeprecated:P,isImplements:S,isInstanceOf:N,isMixed:C,getAssembly:D,getAttr:E,getContext:F,getResource:z,getRoute:M,getType:R,ns:U,getTypeOf:W,getTypeName:q,typeOf:_,dispose:L,using:B,Args:V,Exception:G,noop:J,nip:H,nim:X,nie:K,event:Q}=e,{TaskInfo:Y}=e.Tasks,{env:Z}=e.options,{forEachAsync:ee,replaceAll:te,splitAndTrim:ne,findIndexByProp:re,findItemByProp:ie,which:se,guid:ae,isArrowFunc:oe,isASyncFunc:le,sieve:ce,deepMerge:ue,getLoadedScript:fe,b64EncodeUnicode:pe,b64DecodeUnicode:me}=e.utils,{$$static:de,$$abstract:he,$$virtual:ye,$$override:ge,$$sealed:be,$$private:ve,$$privateSet:we,$$protected:xe,$$protectedSet:Oe,$$readonly:Ie,$$async:Ae,$$overload:$e,$$enumerate:ke,$$dispose:je,$$post:Te,$$on:Pe,$$timer:Se,$$type:Ne,$$args:Ce,$$inject:De,$$resource:Ee,$$asset:Fe,$$singleton:ze,$$serialize:Me,$$deprecate:Re,$$session:Ue,$$state:We,$$conditional:qe,$$noserialize:_e,$$ns:Le}=c,Be=Z.isServer||Z.isWorker?null:(!0).document,Ve=l.context.current().name,Ge=t,Je=Ge.substr(0,Ge.lastIndexOf("/")+1);l.loadPathOf("flair",Je);let He=JSON.parse('{"bootEngine":"flair.app.BootEngine"}'),Xe=e.Port("settingsReader");if("function"==typeof Xe){let e=Xe("flair");e&&(He=ue([He,e],!1))}He=Object.freeze(He);let Ke=JSON.parse("{}");return Ke=Object.freeze(Ke),l.context.current().currentAssemblyBeingLoaded("./flair{.min}.js"),c("abstract"),c("ns","(root)"),n("Aspect",function(){c("virtual"),this.before=X,c("virtual"),this.around=X,c("virtual"),this.after=X}),c("abstract"),c("ns","(root)"),n("Attribute",function(){c("virtual"),this.construct=(e=>{this.args=e}),c("readonly"),this.args=[],c("readonly"),this.constraints="",c("virtual"),this.decorateProperty=X,c("virtual"),this.decorateFunction=X,c("virtual"),this.decorateEvent=X}),c("ns","(root)"),s("IDisposable",function(){this.dispose=X}),c("ns","(root)"),s("IProgressReporter",function(){this.progress=K}),(()=>{const{IProgressReporter:e,IDisposable:t}=U();c("ns","(root)"),n("Task",[e,t],function(){let e=!1,t=!1,n=l.context.current().name;this.construct=((...e)=>{this.args=e,this.context=l.contexts(n),this.domain=this.context.domain}),c("abstract"),this.dispose=X,c("protected"),this.args=[],c("protected"),this.context=null,c("protected"),this.domain=null,this.run=(async(...n)=>{if(t)throw G.InvalidOperation("Task is already running",this.run);if(t=!0,!e)try{await this.setup(),e=!0}catch(e){throw t=!1,e}try{let e;return await this.onRun(...n)}catch(e){throw e}finally{t=!1}}),this.progress=Q(e=>({data:e})),c("virtual"),c("protected"),c("async"),this.setup=J,c("abstract"),c("protected"),c("async"),this.onRun=X})})(),l.context.current().currentAssemblyBeingLoaded(""),l.registerAdo('{"name":"flair","file":"./flair{.min}.js","mainAssembly":"flair","desc":"True Object Oriented JavaScript","title":"Flair.js","version":"0.6.84","lupdate":"Mon, 13 May 2019 19:21:46 GMT","builder":{"name":"flairBuild","version":"1","format":"fasm","formatVersion":"1","contains":["init","func","type","vars","reso","asst","rout","sreg"]},"copyright":"(c) 2017-2019 Vikas Burman","license":"MIT","types":["Aspect","Attribute","IDisposable","IProgressReporter","Task"],"resources":[],"assets":[],"routes":[]}'),"function"==typeof onLoadComplete&&onLoadComplete(),Object.freeze({name:"flair",settings:He,config:Ke})});let Nt=se("[flair]");return u=Nt.settings(),f=Nt.config(),Object.freeze(m)});
\ No newline at end of file
diff --git a/dist/flair.min.js.gz b/dist/flair.min.js.gz
index fbfdc9a0..99bb24ff 100644
Binary files a/dist/flair.min.js.gz and b/dist/flair.min.js.gz differ
diff --git a/dist/preamble.js b/dist/preamble.js
index ec16888e..a9d76528 100644
--- a/dist/preamble.js
+++ b/dist/preamble.js
@@ -1,7 +1,7 @@
/**
* @preserve
* Preamble for assemblies at: ./
- * Created: Mon, 13 May 2019 19:15:32 GMT
+ * Created: Mon, 13 May 2019 19:21:50 GMT
*/
(function(root, loader) {
'use strict';
@@ -19,7 +19,7 @@
})(this, function(flair) {
'use strict';
- flair.AppDomain.registerAdo(JSON.parse('{"name":"flair","file":"./flair{.min}.js","mainAssembly":"flair","desc":"True Object Oriented JavaScript","title":"Flair.js","version":"0.6.82","lupdate":"Mon, 13 May 2019 19:15:28 GMT","builder":{"name":"flairBuild","version":"1","format":"fasm","formatVersion":"1","contains":["init","func","type","vars","reso","asst","rout","sreg"]},"copyright":"(c) 2017-2019 Vikas Burman","license":"MIT","types":["Aspect","Attribute","IDisposable","IProgressReporter","Task"],"resources":[],"assets":[],"routes":[]}'));
- flair.AppDomain.registerAdo(JSON.parse('{"name":"flair.app","file":"./flair.app{.min}.js","mainAssembly":"flair","desc":"True Object Oriented JavaScript","title":"Flair.js","version":"0.6.82","lupdate":"Mon, 13 May 2019 19:15:31 GMT","builder":{"name":"flairBuild","version":"1","format":"fasm","formatVersion":"1","contains":["init","func","type","vars","reso","asst","rout","sreg"]},"copyright":"(c) 2017-2019 Vikas Burman","license":"MIT","types":["flair.app.Bootware","flair.app.Handler","flair.app.App","flair.app.Host","flair.ui.vue.VueComponentMembers","flair.api.RestHandler","flair.api.RestInterceptor","flair.app.BootEngine","flair.app.ClientHost","flair.app.ServerHost","flair.boot.ClientRouter","flair.boot.DIContainer","flair.boot.Middlewares","flair.boot.NodeEnv","flair.boot.ResHeaders","flair.boot.ServerRouter","flair.ui.ViewHandler","flair.ui.ViewInterceptor","flair.ui.ViewState","flair.ui.ViewTransition","flair.ui.vue.VueComponent","flair.ui.vue.VueDirective","flair.ui.vue.VueFilter","flair.ui.vue.VueLayout","flair.ui.vue.VueMixin","flair.ui.vue.VuePlugin","flair.ui.vue.VueSetup","flair.ui.vue.VueView"],"resources":[],"assets":[],"routes":[]}'));
+ flair.AppDomain.registerAdo(JSON.parse('{"name":"flair","file":"./flair{.min}.js","mainAssembly":"flair","desc":"True Object Oriented JavaScript","title":"Flair.js","version":"0.6.84","lupdate":"Mon, 13 May 2019 19:21:46 GMT","builder":{"name":"flairBuild","version":"1","format":"fasm","formatVersion":"1","contains":["init","func","type","vars","reso","asst","rout","sreg"]},"copyright":"(c) 2017-2019 Vikas Burman","license":"MIT","types":["Aspect","Attribute","IDisposable","IProgressReporter","Task"],"resources":[],"assets":[],"routes":[]}'));
+ flair.AppDomain.registerAdo(JSON.parse('{"name":"flair.app","file":"./flair.app{.min}.js","mainAssembly":"flair","desc":"True Object Oriented JavaScript","title":"Flair.js","version":"0.6.84","lupdate":"Mon, 13 May 2019 19:21:49 GMT","builder":{"name":"flairBuild","version":"1","format":"fasm","formatVersion":"1","contains":["init","func","type","vars","reso","asst","rout","sreg"]},"copyright":"(c) 2017-2019 Vikas Burman","license":"MIT","types":["flair.app.Bootware","flair.app.Handler","flair.app.App","flair.app.Host","flair.ui.vue.VueComponentMembers","flair.api.RestHandler","flair.api.RestInterceptor","flair.app.BootEngine","flair.app.ClientHost","flair.app.ServerHost","flair.boot.ClientRouter","flair.boot.DIContainer","flair.boot.Middlewares","flair.boot.NodeEnv","flair.boot.ResHeaders","flair.boot.ServerRouter","flair.ui.ViewHandler","flair.ui.ViewInterceptor","flair.ui.ViewState","flair.ui.ViewTransition","flair.ui.vue.VueComponent","flair.ui.vue.VueDirective","flair.ui.vue.VueFilter","flair.ui.vue.VueLayout","flair.ui.vue.VueMixin","flair.ui.vue.VuePlugin","flair.ui.vue.VueSetup","flair.ui.vue.VueView"],"resources":[],"assets":[],"routes":[]}'));
});
\ No newline at end of file
diff --git a/docs/v1/examples/js/flair.js b/docs/v1/examples/js/flair.js
index 6d6c5e8f..f112b38c 100644
--- a/docs/v1/examples/js/flair.js
+++ b/docs/v1/examples/js/flair.js
@@ -5,8 +5,8 @@
*
* Assembly: flair
* File: ./flair.js
- * Version: 0.6.82
- * Mon, 13 May 2019 19:15:28 GMT
+ * Version: 0.6.84
+ * Mon, 13 May 2019 19:21:46 GMT
*
* (c) 2017-2019 Vikas Burman
* MIT
@@ -7022,10 +7022,10 @@
name: 'flairjs',
title: 'Flair.js',
file: currentFile,
- version: '0.6.82',
+ version: '0.6.84',
copyright: '(c) 2017-2019 Vikas Burman',
license: 'MIT',
- lupdate: new Date('Mon, 13 May 2019 19:15:28 GMT')
+ lupdate: new Date('Mon, 13 May 2019 19:21:46 GMT')
});
// bundled assembly load process
@@ -7422,7 +7422,7 @@
AppDomain.context.current().currentAssemblyBeingLoaded('');
// register assembly definition object
- AppDomain.registerAdo('{"name":"flair","file":"./flair{.min}.js","mainAssembly":"flair","desc":"True Object Oriented JavaScript","title":"Flair.js","version":"0.6.82","lupdate":"Mon, 13 May 2019 19:15:28 GMT","builder":{"name":"flairBuild","version":"1","format":"fasm","formatVersion":"1","contains":["init","func","type","vars","reso","asst","rout","sreg"]},"copyright":"(c) 2017-2019 Vikas Burman","license":"MIT","types":["Aspect","Attribute","IDisposable","IProgressReporter","Task"],"resources":[],"assets":[],"routes":[]}');
+ AppDomain.registerAdo('{"name":"flair","file":"./flair{.min}.js","mainAssembly":"flair","desc":"True Object Oriented JavaScript","title":"Flair.js","version":"0.6.84","lupdate":"Mon, 13 May 2019 19:21:46 GMT","builder":{"name":"flairBuild","version":"1","format":"fasm","formatVersion":"1","contains":["init","func","type","vars","reso","asst","rout","sreg"]},"copyright":"(c) 2017-2019 Vikas Burman","license":"MIT","types":["Aspect","Attribute","IDisposable","IProgressReporter","Task"],"resources":[],"assets":[],"routes":[]}');
// assembly load complete
if (typeof onLoadComplete === 'function') {
diff --git a/package.json b/package.json
index ae55fe1d..824aceda 100644
--- a/package.json
+++ b/package.json
@@ -3,7 +3,7 @@
"title": "Flair.js",
"description": "True Object Oriented JavaScript",
"copyright": "(c) 2017-2019 Vikas Burman",
- "version": "0.6.82",
+ "version": "0.6.84",
"author": "Vikas Burman ",
"keywords": [
"javascript",
diff --git a/src/flair.app/flair.app/BootEngine.js b/src/flair.app/flair.app/BootEngine.js
index 560e8e24..66509079 100644
--- a/src/flair.app/flair.app/BootEngine.js
+++ b/src/flair.app/flair.app/BootEngine.js
@@ -22,12 +22,14 @@ Class('(auto)', function() {
};
const loadPreambles = async () => {
// load preambles
+ let preambleLoader = null;
for(let item of settings.boot.preambles) {
// get simple script file
item = which(item); // server/client specific version (although this will not be the case, generally)
if (item) { // in case no item is set for either server/client
// this loads it as a function which is called here
- await include(item)(flair);
+ preambleLoader = await include(item);
+ preambleLoader(flair);
}
}
};