Skip to content

Instantly share code, notes, and snippets.

@vegarringdal
Last active January 19, 2018 14:49
Show Gist options
  • Save vegarringdal/8a61d479da82e76c6a88eddb5cb710d8 to your computer and use it in GitHub Desktop.
Save vegarringdal/8a61d479da82e76c6a88eddb5cb710d8 to your computer and use it in GitHub Desktop.
<template>
<hello-world style="background-color:${randomColor(myName)}" name.bind="myName"></hello-world>
<br>
<input value.bind="myName">
<template>
import html from './app.html!text';
export class App {
public myName = 'Superman';
public randomColor(name:string){
if(name === 'Superman'){
return' green';
} else {
let letters = '0123456789ABCDEF';
let color = '#';
for (var i = 0; i < 6; i++) {
color += letters[Math.floor(Math.random() * 16)];
}
return color;
}
}
// return template
public loadTemplate(){
return html
}
}
import { customElement, IElement, bindable } from 'mframejs';
@customElement('hello-world')
export class HelloWorld implements IElement {
@bindable() public name = 'World';
public loadTemplate() {
return '<template>Hello ${name}</template>';
}
}
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>GistRun</title>
<link rel="stylesheet" href="styles.css">
<script src="https://unpkg.com/[email protected]"></script>
<script src="https://unpkg.com/[email protected]/dist/system.src.js"></script>
<script>
System.import('x_module_config.js')
.then(function () { System.import('main') })
.catch(console.error.bind(console));
</script>
</head>
<body>
</body>
</html>
import { configure, MF } from 'mframejs';
import { App } from './app';
import { HelloWorld } from './helloworld.ts';
// configure it by setting where and our main class
configure(App).then((mf: MF) => {
// register our elements/attributes
mf.register(HelloWorld);
// start it
mf.start(document.body);
});
/* todo: add styles */
var versions = {
typescript: '@2.6.1',
tsLib: '@1.8.0',
pluginTypescript: '@5.3.1'
};
System.config({
transpiler: 'ts',
typescriptOptions: {
experimentalDecorators: true,
emitDecoratorMetadata: true
},
packages: {
app: {
main: './main.ts',
defaultExtension: 'ts'
},
mframejs: { defaultExtension: 'js' },
text: { defaultExtension: 'js' }
},
meta: {
'typescript': { 'exports': 'ts' },
"*.txt": {
"loader": "text"
},"*.html": {
"loader": "text"
}
},
paths: {
'npm:': 'https://unpkg.com/'
},
map: {
'app': './',
'ts': 'npm:plugin-typescript' + versions.pluginTypescript + '/lib/plugin.js',
'tslib': 'npm:tslib' + versions.tsLib,
'typescript': 'npm:typescript' + versions.typescript + '/lib/typescript.js',
'mframejs':'./x_module_mframe.js',
'text': './x_module_text.js'
}
});
!function(){var e={f:{},m:{},r:function(t){var r=e.m[t];if(r)return r.m.exports;var n=e.f[t];return n?((r=e.m[t]={}).exports={},r.m={exports:r.exports},n(r.m,r.exports),r.m.exports):void 0}};e.f[0]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(1);r.MF=n.MF,r.configure=n.configure,r.Router=n.Router,r.EventAggregator=n.EventAggregator,r.Logger=n.Logger;var i=e.r(7);r.ContainerClasses=i.ContainerClasses,r.ContainerAttributes=i.ContainerAttributes,r.ContainerElements=i.ContainerElements,r.ContainerValueConverters=i.ContainerValueConverters;var a=e.r(56);r.inject=a.inject,r.transient=a.transient,r.customAttribute=a.customAttribute,r.customElement=a.customElement,r.bindable=a.bindable,r.computedFrom=a.computedFrom,r.valueConverter=a.valueConverter,r.behavior=a.behavior,r.observable=a.observable;var s=e.r(17);r.BindingEngine=s.BindingEngine;var o=e.r(31);r.IElement=o.IElement,r.IAttribute=o.IAttribute,r.IControllerArray=o.IControllerArray,r.IControllerObject=o.IControllerObject,r.IRepeatCache=o.IRepeatCache,r.CONSTANTS=o.CONSTANTS},e.f[1]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(2);r.DomEventHandler=n.DomEventHandler;var i=e.r(3);r.EventAggregator=i.EventAggregator;var a=e.r(4);r.Queue=a.Queue;var s=e.r(5);r.Router=s.Router;var o=e.r(6);r.configure=o.configure;var l=e.r(13);r.MF=l.MF;var u=e.r(83);r.Cache=u.Cache;var h=e.r(84);r.Logger=h.Logger},e.f[2]=function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){return function(){}}();t.DomEventHandler=r},e.f[3]=function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this.channels={}}return e.prototype.publish=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(Array.isArray(this.channels[e]))for(var n=0,i=this.channels[e].length;n<i;n++)this.channels[e][n].apply(this,t)},e.prototype.unsubscribe=function(e,t){if(Array.isArray(this.channels[e]))for(var r=0,n=this.channels[e].length;r<n;r++)this.channels[e][r]===t&&this.channels[e].splice(r,1)},e.prototype.subscribe=function(e,t){Array.isArray(this.channels[e])||(this.channels[e]=[]),this.channels[e].push(t)},e}();t.EventAggregator=r},e.f[4]=function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this.count=0,this.tasks=[],this.topQueue=[],this.started=!1,this.index=-1}return e.prototype.finsished=function(){return 0===this.count},e.prototype.add=function(e){var t=this;this.count++,this.tasks.push(e),this.started||(this.started=!0,setTimeout(function(){t.flush()},0))},e.prototype.flush=function(){if(this.index<0){if(this.tasks.length<600)this.topQueue=this.tasks.slice(0,this.tasks.length),this.tasks=[];else{this.topQueue=this.tasks.slice(0,600);var e=this.tasks.slice(600,this.tasks.length);this.tasks=e}this.index=this.topQueue.length-1}0===this.topQueue.length&&(this.started=!1),this.runTasks()},e.prototype.reFlush=function(){var e=this;setTimeout(function(){e.flush()},0)},e.prototype.runTasks=function(){var e,t=this,r=this.topQueue[this.index];this.index--,e=function(){var r=t.topQueue[t.index];t.index--,r?(r.call(e),t.count--):t.index<0?t.reFlush():t.started=!1},r&&r.call(e),this.count--},e}();t.Queue=r},e.f[5]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(85),i=function(){function e(){var e=this;this.curRoute=0,this.started=!0,this.isNavigating=!0,this.started=!1,this.hash=window.location.hash,this.config={root:"#/",title:null,map:function(t){e.routes=t},loader:null}}return e.prototype.hashChange=function(){var e=this;this.isNavigating=!0,setTimeout(function(){if(e.hash=window.location.hash.slice(1).split("/"),"#/"!==window.location.hash&&""!==window.location.hash){var t=window.location.hash.slice(1).split("/"),r=!1;e.routes.forEach(function(n,i){t[1]===n.route&&(e.curRoute=i,r=!0)}),e.mainRouter&&r&&e.mainRouter.update()}""===window.location.hash&&(e.curRoute=0,e.mainRouter.update())},60)},e.prototype.init=function(){var e=this;if(this.started=!0,this.hash=this.config.root,this.title=this.config.title,window.addEventListener("hashchange",this.hashChange.bind(this)),this.routes.forEach(function(e){e.href="#/"+e.route}),"#/"!==window.location.hash&&""!==window.location.hash&&this.hash!==window.location.hash){this.hash=window.location.hash.slice(1).split("/");var t=!1;this.routes.forEach(function(r,n){e.hash[1]===r.route&&(e.curRoute=n,t=!0)}),this.mainRouter&&t&&this.mainRouter.update()}},e.prototype.getCurrentModule=function(){return this.routes[this.curRoute].modulePath},e.prototype.getCurrentClass=function(){return this.routes[this.curRoute].moduleClass},e.prototype.loadCurrentModule=function(){return n.__awaiter(this,void 0,void 0,function(){return n.__generator(this,function(e){switch(e.label){case 0:return[4,this.routes[this.curRoute].load()];case 1:return[2,e.sent()]}})})},e}();r.Router=i},e.f[6]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(85),i=e.r(7),a=e.r(13);r.configure=function(e){return n.__awaiter(this,void 0,void 0,function(){var t,r;return n.__generator(this,function(n){switch(n.label){case 0:return t=i.ContainerClasses.get(a.MF),r=i.ContainerClasses.get(e),null!==document.body?[3,1]:[2,new Promise(function(e){document.addEventListener("DOMContentLoaded",function(){e(t.setRootApp(r))})})];case 1:return[4,t.setRootApp(r)];case 2:return[2,n.sent()]}})})}},e.f[7]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(8);r.ContainerClasses=n.ContainerClasses;var i=e.r(9);r.ContainerAttributes=i.ContainerAttributes;var a=e.r(10);r.ContainerElements=a.ContainerElements;var s=e.r(11);r.ContainerValueConverters=s.ContainerValueConverters;var o=e.r(12);r.ContainerBehavior=o.ContainerBehavior},e.f[8]=function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=new Map,n=new Map,i=new Map,a=function(){function e(){}return e.get=function(e){return this.getInstance(e)},e.getInstance=function(e){return i.has(e)?this.create(e):(n.get(e)||n.set(e,this.create(e)),n.get(e))},e.create=function(e){var t=this,n=r.get(e)||[];return n=n.map(function(e){try{return t.get(e)}catch(t){return e}}),new(e.bind.apply(e,[void 0].concat(n)))},e.setDep=function(e,t){r.set(e,t)},e.regTransient=function(e){i.has(e)||i.set(e,null)},e}();t.ContainerClasses=a},e.f[9]=function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=new Map,n=function(){function e(){}return e.regAttribute=function(e,t){r.has(t)||r.set(t,e),r.has(t)||r.set(t,e)},e.findAttribute=function(e){return r.has(e)?r.get(e):null},e}();t.ContainerAttributes=n},e.f[10]=function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=new Map,n=function(){function e(){}return e.regElement=function(e,t){r.has(t)||r.set(t,e)},e.findElement=function(e){return r.has(e)?r.get(e):null},e}();t.ContainerElements=n},e.f[11]=function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=new Map,n=function(){function e(){}return e.regConverter=function(e,t){r.has(t)||r.set(t,e)},e.findConverter=function(e){return r.has(e)?r.get(e):null},e}();t.ContainerValueConverters=n},e.f[12]=function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=new Map,n=function(){function e(){}return e.regBehavior=function(e,t){r.has(t)||r.set(t,e)},e.findBehavior=function(e){return r.has(e)?r.get(e):null},e}();t.ContainerBehavior=n},e.f[13]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(85),i=e.r(14),a=e.r(3),s=e.r(56),o=e.r(5),l=e.r(4),u=e.r(66),h=e.r(71),c=e.r(73),d=function(){function e(e,t,r){this.count=0,this.eventAggregator=e,this.router=t,this.queue=r,window.Reflect||(window.Reflect=Object),this.register(h.MfRouter,c.ValueAttribute,c.IfAttribute,c.DelgateEventsAttribute,c.RepeatAttribute,c.MiscAttributes,c.CssAttribute,c.ModelAttribute,c.TriggerEventsAttribute,u.SignalBehavior,u.ThrottleBehavior,u.DebounceBehavior,u.TriggerBehavior)}return e.prototype.setRootApp=function(e){return this.app=e,this},e.prototype.start=function(e){return n.__awaiter(this,void 0,void 0,function(){return n.__generator(this,function(t){return this.node=e,this.app.configureRouter&&(this.app.configureRouter(this.router.config,this.router),this.router.init()),i.ViewParser.parseAndCreateElement(this.app,this.node,this),this.eventAggregator.publish("MF","MF started"),[2]})})},e.prototype.register=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e=n.__decorate([s.inject(a.EventAggregator,o.Router,l.Queue),n.__metadata("design:paramtypes",["function"==typeof(t=void 0!==a.EventAggregator&&a.EventAggregator)&&t||Object,"function"==typeof(r=void 0!==o.Router&&o.Router)&&r||Object,"function"==typeof(d=void 0!==l.Queue&&l.Queue)&&d||Object])],e);var t,r,d}();r.MF=d},e.f[14]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(15);r.AttributeController=n.AttributeController;var i=e.r(53);r.ElementController=i.ElementController;var a=e.r(55);r.InterpolateController=a.InterpolateController;var s=e.r(16);r.ViewController=s.ViewController;var o=e.r(54);r.ViewParser=o.ViewParser},e.f[15]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(16),i=e.r(7),a=e.r(17),s=e.r(1),o=function(){function e(e,t,r,a,o){this.parent=e,this.element=t,this.attribute=r,this.logger=s.Logger.getLogger(r.name,"attribute"),this.class=i.ContainerClasses.get(a),this.element=t,"if.bind"!==r.name&&"repeat.for"!==r.name||!e.$element?o.addAttribute(this):t&&!t.$view&&(t.$view=new n.ViewController(t),t.$view.addAttribute(this))}return e.prototype.init=function(){this.create()},e.prototype.create=function(){this.logger.log("created",this.attribute.name,this.attribute.value),this.class.$element=this.element,this.class.$parent=this.parent,this.class.$attribute=this.attribute,a.BindingEngine.subscribeClassMetaBinding(this.class),this.class.created&&this.class.created()},e.prototype.attached=function(){this.logger.log("attached",this.attribute.name,this.attribute.value),this.class.attached&&this.class.attached()},e.prototype.detached=function(){this.logger.log("detached",this.attribute.name,this.attribute.value),this.class.detached&&this.class.detached(),a.BindingEngine.unSubscribeClassMetaBinding(this.class),this.parent=null,this.element=null,this.attribute=null,this.class.$element=null,this.class.$parent=null,this.class.$attribute=null,this.class=null},e}();r.AttributeController=o},e.f[16]=function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){this.count=0,this.element=e}return e.prototype.addElement=function(e){this.count++,this.items||(this.items={}),this.items["e"+this.count]=e},e.prototype.addAttribute=function(e){this.count++,this.items||(this.items={}),this.items["a"+this.count]=e},e.prototype.addInterpolate=function(e){this.count++,this.items||(this.items={}),this.items["i"+this.count]=e},e.prototype.getElement=function(){return this.element},e.prototype.clearView=function(){for(var e in this.items)this.items[e].detached&&this.items[e].detached();this.items=null,this.element=null},e}();t.ViewController=r},e.f[17]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(18);r.BindingEngine=n.BindingEngine},e.f[18]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(19),i=e.r(20),a=e.r(23),s=e.r(28),o=e.r(41),l=e.r(42),u=e.r(44),h=e.r(45),c=e.r(46),d=e.r(50),p=e.r(51),f=e.r(52),v=e.r(1),b=function(){function e(){}return e.tokenizeParseAndTraverseAST=function(e,t){var r;if(v.Cache.expressionMapHas(e)){r=v.Cache.expressionMapGet(e).ast}else{var s=i.tokenize(e);r=a.generateAST(s)}return n.traverseAST(r,t)},e.tokenize=i.tokenize,e.traverseAST=n.traverseAST,e.generateAST=a.generateAST,e.valueConvert=n.valueConvert,e.getBehavior=n.getBehavior,e.createBindingExpression=s.createBindingExpression,e.setValue=o.setValue,e.subscribeClassProperty=l.subscribeClassProperty,e.unSubscribeClassProperty=u.unSubscribeClassProperty,e.evaluateExpression=h.evaluateExpression,e.subscribeClassArray=c.subscribeClassArray,e.unSubscribeClassArray=d.unSubscribeClassArray,e.unSubscribeClassMetaBinding=p.unSubscribeClassMetaBinding,e.subscribeClassMetaBinding=f.subscribeClassMetaBinding,e}();r.BindingEngine=b},e.f[19]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n,i,a=e.r(7),s={},o={},l=((i=function(){return function(){}}()).operator=function(e,t,r){switch(e){case"+":return t+r;case"-":return r?t-r:-t;case"*":return t*r;case"!":return!t;case"%":return t%r;case">":return t>r;case"<":return t<r;case">=":return t>=r;case"&&":return t&&r;case"||":return t||r;case"<=":return t<=r;case"===":return t===r;case"!==":return t!==r;case"/":return t/r;case"^":return t^r}},i.checkArity=function(e,t){var r;return e&&"literal"===e.arity&&(r=e.value),e&&"variable"===e.arity&&(r=l.variable(e,t)),e&&"binary"===e.arity&&(r=l.binary(e,t)),e&&"unary"===e.arity&&(r=l.binary(e,t)),e&&"ternary"===e.arity&&(r=l.ternary(e,t)),e&&"valueConverter"===e.arity&&(r=l.valueConverter(e,t)),r},i.variable=function(e,t){var r;try{switch(!0){case"null"===e.value&&"variable"===e.arity:return null;case"undefined"===e.value&&"variable"===e.arity:return;case"variable"===e.arity&&"string"==typeof e.value&&"TRUE"===e.value.toUpperCase():return!0;case"variable"===e.arity&&"string"==typeof e.value&&"FALSE"===e.value.toUpperCase():return!1}var n,i=void 0,a=void 0;s[e.value]?(i=s[e.value],a=o[e.value]):(i=e.value.split(/\.|\[([^\]]+)\]\.?/).filter(function(e){return e||null}),s[e.value]=i,o[e.value]="string"==typeof i[0]&&"$"!==i[0][0]);var l=t;t.isMultiContext&&(l=t.ctx);for(var u=0;u<i.length;u++)if(i[u])if(0===u){if(n=l[i[u]],a&&l&&l.overrideContext)for(;l.overrideContext;)i[u]in l.overrideContext&&(n=l.overrideContext[i[u]]),l=l.overrideContext}else n=n[i[u]];t.isMultiContext&&void 0===n&&(l=t,i.forEach(function(e,t){if(e)if(0===t){if(n=l[e],"string"==typeof e&&"$"!==e[0]&&l&&l.overrideContext)for(;l.overrideContext;)e in l.overrideContext&&(n=l.overrideContext[e]),l=l.overrideContext}else n=n[e]})),r=n}catch(e){}return r},i.binary=function(e,t){var r;if(e.isFunction){var n=[];e.second.forEach(function(e){n.push(l.evaluate(e,t))});var i=t;t.isMultiContext&&(i=t.ctx);var a=i[e.first.value];if(i&&i.overrideContext)for(;i.overrideContext;)i.overrideContext[e.first.value]&&(a=i.overrideContext[e.first.value]),i=i.overrideContext;return a.apply(i,n)}var s=l.checkArity(e.first,t);return r=l.checkArity(e.second,t),l.operator(e.value,s,r)},i.ternary=function(e,t){var r=l.checkArity(e.first,t),n=l.checkArity(e.second,t),i=l.checkArity(e.third,t);return r?n:i},i.valueConverter=function(e,t){var r,i=[];e.args.forEach(function(e){i.push(l.checkArity(e,t))});var s,o=a.ContainerValueConverters.findConverter(e.value);if(o){s=a.ContainerClasses.get(o);try{r=n?s.fromView.apply(t,i):s.toView.apply(t,i)}catch(t){console.log("value converter failed:"+e.value)}}else console.log("value converter does not exist:"+e.value);return r},i.evaluate=function(e,t){n=!1;for(var r=Array.isArray(e)?e:[e],i=[],a=0;a<r.length;a++){var s=void 0;switch(!0){case"literal"===r[a].arity:s=r[a].value;break;case"unary"===r[a].arity:case"binary"===r[a].arity:s=l.binary(r[a],t);break;case"variable"===r[a].arity:s=l.variable(r[a],t);break;case"ternary"===r[a].arity:s=l.ternary(r[a],t);break;case"behavior"===r[a].arity:break;case"valueConverter"===r[a].arity:s=l.valueConverter(r[a],t);break;default:console.log("unknown expression")}i.push(s)}return i.length>1?i.join(""):i[0]},i.traverseOnlyValueConverter=function(e,t,r){var i,s=[];t.args.forEach(function(e,t){t>0&&s.push(l.checkArity(e,r))}),s=[e].concat(s);var o,u=a.ContainerValueConverters.findConverter(t.value);if(u){o=a.ContainerClasses.get(u);try{i=n?o.fromView.apply(r,s):o.toView.apply(r,s)}catch(e){console.log("value converter failed:"+t.value)}}else console.log("value converter does not exist:"+t.value);return i},i.evaluateConverterFromViewOnly=function(e,t,r){var i=Array.isArray(e)?e:[e],a=[];n=!0;for(var s=!1,o=0;o<i.length;o++){var u=void 0;switch(!0){case"valueConverter"===i[o].arity:s=!0,u=l.traverseOnlyValueConverter(t,i[o],r)}u&&a.push(u)}return a.length>1?a.join(""):s?a[0]:t},i.getBehaviorFunctions=function(e){for(var t=Array.isArray(e)?e:[e],r=[],n=0;n<t.length;n++){var i=void 0;switch(!0){case"behavior"===t[n].arity:i={name:t[n].value,args:t[n].args.map(function(e){return e.value})}}i&&r.push(i)}return r},i);r.traverseAST=function(e,t){return l.evaluate(e,t)},r.valueConvert=function(e,t,r){return l.evaluateConverterFromViewOnly(e,r,t)},r.getBehavior=function(e){return l.getBehaviorFunctions(e)}},e.f[20]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(21);r.tokenize=function(e){return new n.Tokenizer(e).start()}},e.f[21]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=new(e.r(22).CharCodes),i=function(){function e(e){this.baseTokens=[],this.chars=[],this.curChar=null,this.curCharNo=0,this.curtype=null,this.expressionOriginal=e,this.isMix=-1!==e.indexOf("${"),this.isOutsideExpression=this.isMix,this.expression=this.trim(this.expressionOriginal),this.curtype=e.indexOf("${")>0?"string":null,this.curChar=this.expression.charCodeAt(this.curCharNo),this.expressionLength=this.expression.length}return e.prototype.start=function(){return this.generateBaseTokens(),this.baseTokens},e.prototype.trim=function(e){for(var t=this.isOutsideExpression,r="",i=0;i<e.length;i++)switch(!0){case t&&n.DOLLAR.has(e.charCodeAt(i))&&n.MUSTACHE_START.has(e.charCodeAt(i+1)):r+=e[i],t=!1;break;case!t&&n.MUSTACHE_END.has(e.charCodeAt(i)):r+=e[i],t=!0;break;case t&&!n.STRING_START_END.has(e.charCodeAt(i)):r+=e[i];break;case t&&n.STRING_START_END.has(e.charCodeAt(i)):r+=e[i],t=!1;break;case!t&&n.STRING_START_END.has(e.charCodeAt(i)):r+=e[i],t=!0;break;case!t&&n.WHITESPACE.has(e.charCodeAt(i)):break;case!t&&!n.WHITESPACE.has(e.charCodeAt(i)):r+=e[i]}return r},e.prototype.advance=function(){this.curCharNo++,this.curChar=this.expression.charCodeAt(this.curCharNo)},e.prototype.getString=function(){for(var e=n.STRING_START_END.has(this.curChar),t=this.expressionStart(),r=this.parsedAllChars();!e&&!t&&!r;)this.chars.push(this.curChar),this.advance(),e=n.STRING_START_END.has(this.curChar),t=this.expressionStart(),r=this.parsedAllChars();this.curtype&&this.addToken(),this.isOutsideExpression||!e||t||this.advance()},e.prototype.getNumber=function(){for(var e=n.REAL.has(this.curChar),t=this.expressionStart(),r=this.parsedAllChars();e&&!t&&!r;)this.chars.push(this.curChar),this.advance(),e=n.REAL.has(this.curChar),t=this.expressionStart(),r=this.parsedAllChars();this.addToken()},e.prototype.parsedAllChars=function(){return!(this.curCharNo<this.expressionLength)},e.prototype.getVariable=function(){for(var e=n.VARIABLE.has(this.curChar),t=this.expressionStart(),r=this.parsedAllChars();e&&!t&&!r;)this.chars.push(this.curChar),this.advance(),e=n.VARIABLE.has(this.curChar),t=this.expressionStart(),r=this.parsedAllChars();this.addToken()},e.prototype.getOperator=function(){var e=n.OPERATOR.has(this.curChar),t=this.expressionStart(),r=n.BRACKETLEFT.has(this.curChar),i=n.BRACKETRIGHT.has(this.curChar),a=this.negativeNumber(),s=this.parsedAllChars();if(r||i)this.chars.push(this.curChar),this.advance();else for(;e&&!t&&!s&&!r&&!i&&!a;)this.chars.push(this.curChar),this.advance(),e=n.OPERATOR.has(this.curChar),r=n.BRACKETLEFT.has(this.curChar),i=n.BRACKETRIGHT.has(this.curChar),t=this.expressionStart(),a=this.negativeNumber(),s=this.parsedAllChars();this.chars.length>0&&this.addToken(),a&&(this.curtype=null,this.chars.push(this.curChar),this.advance())},e.prototype.expressionStart=function(){var e=this.expression.charCodeAt(this.curCharNo),t=this.expression.charCodeAt(this.curCharNo+1);return n.DOLLAR.has(e)&&n.MUSTACHE_START.has(t)},e.prototype.negativeNumber=function(){var e=this.expression.charCodeAt(this.curCharNo-1),t=this.expression.charCodeAt(this.curCharNo),r=this.expression.charCodeAt(this.curCharNo+1);return n.OPERATOR.has(e)&&n.PLUS_OR_MINUS.has(t)&&n.NUMBERS.has(r)},e.prototype.addToken=function(){var e=this.chars.map(function(e){return String.fromCharCode(e)}).join("");this.baseTokens.push({type:this.curtype,value:"number"===this.curtype?parseFloat(e):e}),this.chars=[],this.curtype=null},e.prototype.generateBaseTokens=function(){for(var e=this.parsedAllChars();!e;){switch(!0){case this.expressionStart():this.isOutsideExpression=!1,this.curtype="operator",this.chars.push(";".charCodeAt(0)),this.addToken(),this.advance(),this.advance();break;case this.isOutsideExpression:this.getString();break;case null===this.curtype&&n.STRING_START_END.has(this.curChar):this.curtype="string",this.advance(),this.getString();break;case null===this.curtype&&n.MUSTACHE_END.has(this.curChar):this.isOutsideExpression=!0,this.curtype="operator",this.chars.push(";".charCodeAt(0)),this.addToken(),this.curtype="string",this.advance();break;case null===this.curtype&&n.NUMBERS.has(this.curChar):this.curtype="number",this.getNumber();break;case null===this.curtype&&n.VARIABLE.has(this.curChar):this.curtype="variable",this.getVariable();break;case null===this.curtype&&n.WHITESPACE.has(this.curChar):this.advance();break;case null===this.curtype&&n.OPERATOR.has(this.curChar):this.curtype="operator",this.getOperator();break;default:console.warn("bug tokenizer",String.fromCharCode(this.curChar)),console.warn("bug tokenizer",this.expression),this.advance()}e=this.parsedAllChars()}},e}();r.Tokenizer=i},e.f[22]=function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){return function(){var e=this;this.WHITESPACE=new Set,[32,10,13].map(function(t){return e.WHITESPACE.add(t)}),this.STRING_START_END=new Set,["'"].map(function(t){return e.STRING_START_END.add(t.charCodeAt(0))}),this.MINUS=new Set,["-"].map(function(t){return e.MINUS.add(t.charCodeAt(0))}),this.PLUS=new Set,["+"].map(function(t){return e.PLUS.add(t.charCodeAt(0))}),this.PLUS_OR_MINUS=new Set,["+","-"].map(function(t){return e.PLUS_OR_MINUS.add(t.charCodeAt(0))}),this.UNDERSCORE=new Set,["_"].map(function(t){return e.UNDERSCORE.add(t.charCodeAt(0))}),this.DOT=new Set,["."].map(function(t){return e.DOT.add(t.charCodeAt(0))}),this.BRACKETLEFT=new Set,["("].map(function(t){return e.BRACKETLEFT.add(t.charCodeAt(0))}),this.BRACKETRIGHT=new Set,[")"].map(function(t){return e.BRACKETRIGHT.add(t.charCodeAt(0))}),this.NOT=new Set,["!"].map(function(t){return e.NOT.add(t.charCodeAt(0))}),this.ASSIGN=new Set,["="].map(function(t){return e.ASSIGN.add(t.charCodeAt(0))}),this.OPERATOR=new Set,["=","!",">","<","+","-","*","/","%","^","(",")","|","&","?",":",","].map(function(t){return e.OPERATOR.add(t.charCodeAt(0))}),this.NUMBERS=new Set,["1","2","3","4","5","6","7","8","9","0"].map(function(t){return e.NUMBERS.add(t.charCodeAt(0))}),this.LETTERS_UPPER=new Set,["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"].map(function(t){return e.LETTERS_UPPER.add(t.charCodeAt(0))}),this.LETTERS_LOWER=new Set,["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"].map(function(t){return e.LETTERS_LOWER.add(t.charCodeAt(0))}),this.LETTERS=new Set,["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"].map(function(t){return e.LETTERS.add(t.charCodeAt(0))}),this.SQUARE_BRACKET_RIGHT=new Set,["["].map(function(t){return e.SQUARE_BRACKET_RIGHT.add(t.charCodeAt(0))}),this.SQUARE_BRACKET_LEFT=new Set,["["].map(function(t){return e.SQUARE_BRACKET_LEFT.add(t.charCodeAt(0))}),this.SQUARE_BRACKETS=new Set,["[","["].map(function(t){return e.SQUARE_BRACKETS.add(t.charCodeAt(0))}),this.DOLLAR=new Set,["$"].map(function(t){return e.DOLLAR.add(t.charCodeAt(0))}),this.MUSTACHE_START=new Set,["{"].map(function(t){return e.MUSTACHE_START.add(t.charCodeAt(0))}),this.MUSTACHE_END=new Set,["}"].map(function(t){return e.MUSTACHE_END.add(t.charCodeAt(0))}),this.REAL=new Set,["1","2","3","4","5","6","7","8","9","0","."].map(function(t){return e.REAL.add(t.charCodeAt(0))}),this.VARIABLE=new Set,["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","1","2","3","4","5","6","7","8","9","0",".","$","_","[","["].map(function(t){return e.VARIABLE.add(t.charCodeAt(0))})}}();t.CharCodes=r},e.f[23]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(24),i=e.r(26),a=e.r(27),s=new n.AST,o=new i.SymbolContainer;s.addSymbolContainer(o),a.addSymbols(s),r.generateAST=function(e){return s.start(e)}},e.f[24]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(25),i=function(){function e(){this.currentStatement=null,this.currentTokenIndex=0}return e.prototype.start=function(e){return this.tokens=e,this.currentStatement=null,this.currentTokenIndex=0,this.currentToken=null,this.advance(),this.statements()},e.prototype.addSymbolContainer=function(e){this.symbolContainer=e},e.prototype.symbol=function(e,t){var r=this.symbolContainer[e];return t=t||0,r?t>=r.lbp&&(r.lbp=t):((r=new n.SymbolTemplate).id=r.value=e,r.lbp=t,this.symbolContainer[e]=r),r},e.prototype.prefix=function(e,t){var r=this.symbol(e),n=this;return r.nud=t||function(){return this.first=n.expression(70),this.arity="unary",this},r},e.prototype.infix=function(e,t,r){var n=this.symbol(e,t),i=this;return n.led=r||function(e){return this.first=e,this.second=i.expression(t),this.arity="binary",this},n},e.prototype.infixr=function(e,t,r){var n=this.symbol(e,t),i=this;return n.led=r||function(e){return this.first=e,this.second=i.expression(t-1),this.arity="binary",this},n},e.prototype.statement=function(){var e=this.currentToken;return e.std?(this.advance(),e.std()):this.expression(0)},e.prototype.statements=function(){for(var e,t=[];"}"!==this.currentToken.id&&"(end)"!==this.currentToken.id;)e=this.statement(),this.currentStatement&&(this.currentStatement.args.unshift(t.pop()),this.currentStatement=null),e&&t.push(e);return 0===t.length?null:1===t.length?t[0]:t},e.prototype.advance=function(e){var t,r,n,i;if((n=this.tokens[this.currentTokenIndex])&&e&&n.id,!(this.currentTokenIndex>=this.tokens.length))return this.currentTokenIndex+=1,i=n.value,"variable"===(t=n.type)?(t="variable",r=this.symbolContainer["(variable)"]):"operator"===t?(r=this.symbolContainer[i])||console.log("Unknown operator.",n):"string"===t||"number"===t?(t="literal",r=this.symbolContainer["(literal)"]):console.log("Unexpected token.",n),this.currentToken=Object.create(r),this.currentToken.value=i,this.currentToken.arity=t,this.currentToken;this.currentToken=this.symbolContainer["(end)"]},e.prototype.expression=function(e){var t,r=this.currentToken;this.advance(),t=r.nud();try{for(;e<this.currentToken.lbp;)r=this.currentToken,this.advance(),t=r.led(t)}catch(e){console.log("parser fail")}return t},e}();r.AST=i},e.f[25]=function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){}return e.prototype.nud=function(){console.error("Undefined.")},e.prototype.led=function(){console.error("Missing operator.")},e}();t.SymbolTemplate=r},e.f[26]=function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){return function(){}}();t.SymbolContainer=r},e.f[27]=function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.addSymbols=function(e){var t=e;t.symbol("(literal)").nud=function(){return this},t.symbol("(variable)").nud=function(){return this},t.symbol("(function)").nud=function(){return this},t.symbol("(end)"),t.symbol("(name)"),t.symbol(":"),t.symbol(";"),t.symbol(")"),t.symbol("]"),t.symbol("}"),t.symbol(","),t.infix("+",50),t.infix("-",50),t.infix("*",60),t.infix("%",60),t.infix("/",60),t.infix("===",40),t.infix("!==",40),t.infix("<",40),t.infix("<=",40),t.infix(">",40),t.infix("^",70),t.infix(">=",40),t.infix("?",20,function(e){return this.first=e,this.second=t.expression(0),t.advance(":"),this.third=t.expression(0),this.arity="ternary",this}),t.infix(".",80,function(e){return this.first=e,"name"!==t.currentToken.arity&&t.currentToken.error("Expected a property name."),t.currentToken.arity="literal",this.second=t.currentToken,this.arity="binary",t.advance(),this}),t.infix("[",80,function(e){return this.first=e,this.second=t.expression(0),this.arity="binary",t.advance("]"),this}),t.infix("(",80,function(e){if(!e)return t.expression(0);var r=[];if(this.arity="binary",this.isFunction=!0,this.first=e,this.second=r,"unary"===e.arity&&"function"===e.id||"variable"===e.arity||"("===e.id||"&&"===e.id||"||"===e.id||"?"===e.id||e.error("Expected a variable name."),")"!==t.currentToken.id)for(;r.push(t.expression(0)),","===t.currentToken.id;)t.advance(",");return t.advance(")"),this}),t.prefix("-"),t.prefix("!"),t.prefix("typeof"),t.prefix("(",function(){var e=t.expression(0);return t.advance(")"),e}),t.infixr("&&",30),t.infixr("||",30),t.symbol("|").nud=function(){this.arity="valueConverter";var e=t.expression(0);this.value=e.value;var r=[];for(this.args=r;":"===t.currentToken.id;)t.advance(","),r.push(t.expression(0));return t.currentStatement=this,this},t.symbol("&").nud=function(){this.arity="behavior";var e=t.expression(0);this.value=e.value;var r=[];for(this.args=r;":"===t.currentToken.id;)t.advance(","),r.push(t.expression(0));return this},t.symbol(";").nud=function(){return null}}},e.f[28]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(20),i=e.r(23),a=e.r(29),s=e.r(1),o=e.r(31),l={},u=function(e,t){var r;l[e]?r=l[e]:(r=e.split(/\.|\[([^\]]+)\]\.?/).filter(function(e){return e||null})[0],l[e]=r);var n,i=t;if(t.isMultiContext&&(i=t.ctx),"string"==typeof r&&"$"!==r[0]&&i&&i.overrideContext)for(;i.overrideContext;)r in(i=i.overrideContext)&&(n=i);return n||t};r.createBindingExpression=function(e,t,r){var l,h,c,d;if(e){if(h=e,c=[],s.Cache.expressionMapHas(h))l=s.Cache.expressionMapGet(h),c=l.attributes,d=l.ast;else{var p=n.tokenize(h);d=i.generateAST(p),p.forEach(function(e){if("variable"===e.type){var r=u(e.value,t);"string"==typeof e.value&&"$"!==e.value[0]&&r&&r.__proto__&&r.__proto__[o.CONSTANTS.META_COMPUTEDFROM]&&r.__proto__[o.CONSTANTS.META_COMPUTEDFROM][e.value]?r.__proto__[o.CONSTANTS.META_COMPUTEDFROM][e.value].attributes.forEach(function(e){-1===c.indexOf(e)&&c.push(e)}):-1===c.indexOf(e.value)&&c.push(e.value)}}),s.Cache.expressionMapSet(h,{attributes:c,ast:d})}r.setAst(d);for(var f=0;f<c.length;f++){var v=u(c[f],t);a.ClassPropertyObserverCreator.create(v||t,c[f],r)}r.init()}},r.removeBindingExpression=function(e,t,r){if(e&&s.Cache.expressionMapHas(e))for(var n=s.Cache.expressionMapGet(e).attributes,i=0;i<n.length;i++){var o=u(n[i],t);a.ClassPropertyObserverCreator.remove(o||t,n[i],r)}}},e.f[29]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(30),i=function(){return function(){}}(),a=new Map,s=function(){function e(){}return e.create=function(t,r,n){this.classRef=t,a.has(r)?this.keyParts=a.get(r):(this.keyParts=r.split(/\.|\[([^\]]+)\]\.?/).filter(function(e){return e||null}),a.set(r,this.keyParts)),this.keyNo=0,this.keyBlock=this.keyParts[this.keyNo],e.processKeys(n),e.clear()},e.remove=function(t,r,n){this.classRef=t,a.has(r)?this.keyParts=a.get(r):(this.keyParts=r.split(/\.|\[([^\]]+)\]\.?/).filter(function(e){return e||null}),a.set(r,this.keyParts)),this.keyNo=0,this.keyBlock=this.keyParts[this.keyNo],e.removeKeys(n),e.clear()},e.clear=function(){this.classRef=null,this.keyParts=null,this.keyNo=null,this.keyBlock=null},e.nextKey=function(){this.keyNo++,this.keyBlock=this.keyParts[this.keyNo]},e.processKeys=function(e){this.classRef.__observer||(this.classRef.__observer=new i),this.classRef.__observer[this.keyBlock]?(this.classRef.__observer[this.keyBlock].subscribe(e),this.classRef.__observer[this.keyBlock].observe()):(this.classRef.__observer[this.keyBlock]=new n.ClassPropertyObserver(this.classRef,this.keyBlock),this.classRef.__observer[this.keyBlock].subscribe(e)),this.keyNo!==this.keyParts.length-1&&this.keyParts.length>1&&(this.classRef&&(this.classRef=this.classRef[this.keyBlock]),this.nextKey(),this.classRef&&this.processKeys(e))},e.removeKeys=function(e){this.classRef.__observer[this.keyBlock]&&this.classRef.__observer[this.keyBlock].unsubscribe(e),this.keyNo!==this.keyParts.length-1&&this.keyParts.length>1&&(this.classRef&&(this.classRef=this.classRef[this.keyBlock]),this.nextKey(),this.classRef&&this.removeKeys(e))},e}();r.ClassPropertyObserverCreator=s},e.f[30]=function(e,t){var r,n,i,a,s;Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){this._class=e,this.key=t,this.setterBind=this.setter.bind(this),this.getterBind=this.getter.bind(this),"object"==typeof this._class&&(this.value=this._class[this.key],this.observe())}return e.prototype.unsubscribe=function(e){this.c1===e&&(this.c1=null),this.c2===e&&(this.c2=null),this.c3===e&&(this.c3=null),this.c4===e&&(this.c4=null),this.c5===e&&(this.c5=null),this.callers&&-1!==this.callers.indexOf(e)&&this.callers.splice(this.callers.indexOf(e),1)},e.prototype.subscribe=function(e){this.c1!==e&&this.c2!==e&&this.c3!==e&&this.c4!==e&&this.c5!==e&&(this.c1?this.c2?this.c3?this.c4?this.c5?(this.callers||(this.callers=[]),-1===this.callers.indexOf(e)&&this.callers.push(e)):this.c5=e:this.c4=e:this.c3=e:this.c2=e:this.c1=e)},e.prototype.observe=function(){var e=Reflect.getOwnPropertyDescriptor(this._class.__proto__,this.key),t=null;e&&(t=e.get||e.set)&&console.log("skipping dirty observer - no-dirty //todo remove this message"),null===t&&(Reflect.defineProperty(this._class,this.key,{configurable:!0,enumerable:!0,set:this.setterBind,get:this.getterBind})||console.warn("This key could not be observed:"+this.key))},e.prototype.setter=function(e){if(e!==this.value&&("object"==typeof e&&(e&&e.__observer&&(e.__observer=null),e&&e.__observerArray&&(e.__observerArray=null)),this.value=e,this.c1&&(r=this.c1,this.c1=void 0,r.update()),this.c2&&(n=this.c2,this.c2=void 0,n.update()),this.c3&&(i=this.c3,this.c3=void 0,i.update()),this.c4&&(a=this.c4,this.c4=void 0,a.update()),this.c5&&(s=this.c5,this.c5=void 0,s.update()),this.callers&&this.callers.length>0)){var t=this.callers.slice();this.callers=[],t.forEach(function(e){e.update()})}},e.prototype.getter=function(){return this.value},e}();t.ClassPropertyObserver=o},e.f[31]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(32);r.IElement=n.IElement;var i=e.r(33);r.IAttribute=i.IAttribute;var a=e.r(34);r.IControllerArray=a.IControllerArray;var s=e.r(35);r.IControllerObject=s.IControllerObject;var o=e.r(36);r.IRepeatCache=o.IRepeatCache;var l=e.r(37);r.CONSTANTS=l.CONSTANTS;var u=e.r(38);r.IListener=u.IListener;var h=e.r(39);r.ITokens=h.ITokens;var c=e.r(40);r.INode=c.INode},e.f[32]=function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},e.f[33]=function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},e.f[34]=function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},e.f[35]=function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},e.f[36]=function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},e.f[37]=function(e,t){var r;Object.defineProperty(t,"__esModule",{value:!0}),(r=t.CONSTANTS||(t.CONSTANTS={}))[r.META_BINDABLE="__meta_bindable"]="META_BINDABLE",r[r.META_COMPUTEDFROM="__meta_computed_from"]="META_COMPUTEDFROM",r[r.ELEMENT_DETACH="__MF__detach"]="ELEMENT_DETACH",r[r.ELEMENT_BINDED="__MF__binded"]="ELEMENT_BINDED",r[r.ELEMENT_ADD="__MF__add"]="ELEMENT_ADD"},e.f[38]=function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},e.f[39]=function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},e.f[40]=function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},e.f[41]=function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r={},n=function(e,t){var n;r[e]?n=r[e]:(n=e.split(/\.|\[([^\]]+)\]\.?/).filter(function(e){return e||null})[0],r[e]=n);var i,a=t;if(t.isMultiContext&&(a=t.ctx),"string"==typeof n&&"$"!==n[0]&&a&&a.overrideContext)for(;a.overrideContext;)n in(a=a.overrideContext)&&(i=a);return i||t};t.setValue=function(e,t,r){e=n(t,e);var i=t.split(/\.|\[([^\]]+)\]\.?/).filter(function(e){return e||null});try{var a;i.length>1?i.forEach(function(t,n){t&&(n===i.length-1?a[t]=r:a=0===n?e[t]:a[t])}):e[t]=r}catch(n){try{console.warn("key not found, rebuilding",t);var s,o={};i.forEach(function(e,t){e&&(t===i.length-1?0===t?(o[e]={},s=o[e]):s[e]=r:0===t?(o[e]={},s=o[e]):(s[e]={},s=s[e]))});var l=e;i.forEach(function(e,t){e&&(t===i.length-1?l[e]||(l[e]=o[e]):(l[e]||(l[e]=o[e]),o=o[e],l=l[e]))})}catch(e){console.error("key not found",t)}}}},e.f[42]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(43);r.subscribeClassProperty=function(e,t,r){var i=new n.PropertyObserverHandler(t,r);i.bind(e),r.caller=i}},e.f[43]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(19),i=e.r(28),a=e.r(1),s=e.r(7),o=function(){function e(e,t){this.value=void 0,this.oldValue=void 0,this.newValue=void 0,this.isWaiting=!1,this.isNew=!0,this.expression=e,this.listener=t,this.queue=s.ContainerClasses.get(a.Queue)}return e.prototype.bind=function(e){this.observing=!0,this.context=e,i.createBindingExpression(this.expression,this.context,this)},e.prototype.setAst=function(e){this.ast=e,this.curBehavior||this.connectBehavior()},e.prototype.init=function(){if(this.isNew){this.isNew=!1;var e=this.value,t=n.traverseAST(this.ast,this.context);this.value=t,this.listenerCall(t,e),this.isNew=!1}},e.prototype.connectBehavior=function(){var e=this,t=n.getBehavior(this.ast);t&&t.forEach(function(t){if("signal"===name){var r=s.ContainerBehavior.findBehavior(t.name);r&&(e.curBehavior=new r(e,t.args))}})},e.prototype.update=function(){this.observing&&(this.oldValue=this.value,this.newValue=n.traverseAST(this.ast,this.context),this.oldValue!==this.newValue?(this.value=this.newValue,this.isWaiting||(this.isWaiting=!0,this.queue.add(this))):(this.oldValue=null,this.newValue=null),this.bind(this.context))},e.prototype.listenerCall=function(e,t){this.listener&&this.listener.call(e,t)},e.prototype.call=function(e){var t=this.newValue,r=this.oldValue;this.oldValue=null,this.newValue=null,this.listenerCall(t,r),this.isWaiting=!1,e()},e.prototype.unbind=function(){this.observing&&i.removeBindingExpression(this.expression,this.context,this),this.listener.caller=null,this.observing=!1,this.context=null,this.listener=null,this.value=null},e}();r.PropertyObserverHandler=o},e.f[44]=function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.unSubscribeClassProperty=function(e,t){t.caller&&t.caller.unbind()}},e.f[45]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(19),i=e.r(20),a=e.r(23),s=e.r(1);r.evaluateExpression=function(e,t){if(e){var r=void 0;if(s.Cache.astMapHas(e))r=s.Cache.astMapGet(e);else{var o=i.tokenize(e);r=a.generateAST(o),s.Cache.astMapSet(e,r)}return n.traverseAST(r,t)}return""}},e.f[46]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(47);r.subscribeClassArray=function(e,t,r){var i=new n.ArrayObserverHandler(t,r);i.bind(e),r.caller=i}},e.f[47]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(48),i=e.r(1),a=e.r(7),s=function(){function e(e,t){this.isWaiting=!1,this.data=void 0,this.expression=e,this.listener=t,this.isWaiting=null,this.queue=a.ContainerClasses.get(i.Queue)}return e.prototype.bind=function(e){this.observing=!0,this.context=e,n.ClassArrayObserverCreator.create(this.context,this.expression,this)},e.prototype.update=function(e){this.data=e,this.observing&&(this.isWaiting||(this.isWaiting=!0,this.queue.add(this)),this.bind(this.context))},e.prototype.call=function(e){var t=this.data;this.data=null,this.listener&&this.listener.call(t),this.isWaiting=!1,e()},e.prototype.unbind=function(){this.observing&&n.ClassArrayObserverCreator.remove(this.context,this.expression,this),this.listener.caller=null,this.listener=null,this.observing=!1,this.context=null,this.data=null,this.expression=null},e}();r.ArrayObserverHandler=s},e.f[48]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(49),i=function(){return function(){}}(),a={},s=function(){function e(){}return e.create=function(t,r,n){this.classRef=t,a[r]?this.keyParts=a[r]:(this.keyParts=r.split(/\.|\[([^\]]+)\]\.?/).filter(function(e){return e||null}),a[r]=this.keyParts),this.keyNo=0,this.keyBlock=this.keyParts[this.keyNo],e.processKeys(n),e.clear()},e.remove=function(t,r,n){this.classRef=t,a[r]?this.keyParts=a[r]:(this.keyParts=r.split(/\.|\[([^\]]+)\]\.?/).filter(function(e){return e||null}),a[r]=this.keyParts),this.keyNo=0,this.keyBlock=this.keyParts[this.keyNo],e.removeKeys(n),e.clear()},e.clear=function(){this.classRef=null,this.keyParts=null,this.keyNo=null,this.keyBlock=null},e.nextKey=function(){this.keyNo++,this.keyBlock=this.keyParts[this.keyNo]},e.processKeys=function(e){this.classRef.__observerArray||(this.classRef.__observerArray=new i),this.classRef.__observerArray[this.keyBlock]?(this.classRef.__observerArray[this.keyBlock].subscribe(e),this.classRef.__observerArray[this.keyBlock].observe()):(this.classRef.__observerArray[this.keyBlock]=new n.ClassArrayObserver(this.classRef,this.keyBlock),this.classRef.__observerArray[this.keyBlock].subscribe(e)),this.keyNo!==this.keyParts.length-1&&this.keyParts.length>1&&(this.classRef&&(this.classRef=this.classRef[this.keyBlock]),this.nextKey(),this.classRef&&this.processKeys(e))},e.removeKeys=function(e){this.classRef.__observerArray&&this.classRef.__observerArray[this.keyBlock]&&this.classRef.__observerArray[this.keyBlock].unsubscribe(e),this.keyNo!==this.keyParts.length-1&&this.keyParts.length>1&&(this.classRef&&(this.classRef=this.classRef[this.keyBlock]),this.nextKey(),this.classRef&&this.removeKeys(e))},e}();r.ClassArrayObserverCreator=s},e.f[49]=function(e,t){var r,n,i,a,s;Object.defineProperty(t,"__esModule",{value:!0});["pop","push","reverse","shift","sort","splice","unshift","sort"].forEach(function(e){var t=Array.prototype[e];Array.prototype[e]=function(){var r=t.apply(this,arguments);return this.__array_observer__class&&this.__array_observer__class.check(arguments,e),r}});var o=function(){function e(e,t){this.internalEvents=[],this.timer=null,this._class=e,this.key=t,"object"==typeof this._class&&this.observe()}return e.prototype.subscribe=function(e){this.c1!==e&&this.c2!==e&&this.c3!==e&&this.c4!==e&&this.c5!==e&&(this.c1?this.c2?this.c3?this.c4?this.c5?(this.callers||(this.callers=[]),-1===this.callers.indexOf(e)&&this.callers.push(e)):this.c5=e:this.c4=e:this.c3=e:this.c2=e:this.c1=e)},e.prototype.unsubscribe=function(e){this.c1===e&&(this.c1=null),this.c2===e&&(this.c2=null),this.c3===e&&(this.c3=null),this.c4===e&&(this.c4=null),this.c5===e&&(this.c5=null),this.callers&&-1!==this.callers.indexOf(e)&&this.callers.splice(this.callers.indexOf(e),1)},e.prototype.check=function(e,t){var o=this;clearTimeout(this.timer),this.timer=0,this.internalEvents.push({event:t,args:e}),this.timer=setTimeout(function(){if(o.c1&&(r=o.c1,o.c1=void 0,r.update(o.internalEvents)),o.c2&&(n=o.c2,o.c2=void 0,n.update(o.internalEvents)),o.c3&&(i=o.c3,o.c3=void 0,i.update(o.internalEvents)),o.c4&&(a=o.c4,o.c4=void 0,a.update(o.internalEvents)),o.c5&&(s=o.c5,o.c5=void 0,s.update(o.internalEvents)),o.callers&&o.callers.length>0){var e=o.callers.slice();o.callers=[],e.forEach(function(e){e.update(o.internalEvents)})}o.internalEvents=null,o.internalEvents=[]},0)},e.prototype.observe=function(){this._class[this.key].__array_observer__class=this},e}();t.ClassArrayObserver=o},e.f[50]=function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.unSubscribeClassArray=function(e,t){t.caller&&t.caller.unbind()}},e.f[51]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(31),i=e.r(44);r.unSubscribeClassMetaBinding=function(e){var t=e.__proto__[n.CONSTANTS.META_BINDABLE];if(t)for(var r=0,a=Object.keys(t);r<a.length;r++){var s=a[r],o=t[s].options.subscribeInternal;o&&i.unSubscribeClassProperty(e,o);var l=t[s].options.subscribeExternal;if(e.$parent&&l&&e.$element){var u=e.$element,h=t[s].options.attribute+".bind";u.getAttribute(h)&&i.unSubscribeClassProperty(e.$parent,l)}}}},e.f[52]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(42),i=e.r(18),a=e.r(31),s=function(){function e(e,t,r){this._class=e,this.key=t,this.meta=r}return e.prototype.call=function(e,t){if(t!==e){var r=this.key,n=this._class,i=this.meta;n[r+"Changed"]&&n[r+"Changed"](e,t),i[r].options.changeHandler&&n[i[r].options.changeHandler]("key",e,t),n.$parent&&r in n.$parent&&n.$parent[r]!==e&&(n.$parent[r]=e)}},e}();r.subscribeClassMetaBinding=function(e){var t=e.__proto__[a.CONSTANTS.META_BINDABLE];if(t)for(var r=Object.keys(t),o=function(a){var o=new s(e,a,t);if(n.subscribeClassProperty(e,a,o),t[a].options.subscribeInternal=o,!0===t[a].observableOnly);else if(e.$attributes&&!e.$attribute){if(e.$element&&e.$parent){var l=e.$element,u=t[a].options.attribute+".bind";if(d=l.getAttribute(u)){var h=Object.create({call:function(t,r){r!==t&&(e[a]=t)}});n.subscribeClassProperty(e.$parent,d,h),t[a].options.subscribeExternal=h}else u=""+t[a].options.attribute,(d=l.getAttribute(u))&&(-1!==d.indexOf("${")?(g=i.BindingEngine.tokenizeParseAndTraverseAST(d,e.$parent))&&(e[a]=g):e[a]=d)}}else if(e.$element&&e.$parent)if(1===r.length&&"value"===a){l=e.$element;var c=(u=e.$attribute.name).indexOf(".bind"),d=l.getAttribute(u);-1!==c?(h=Object.create({call:function(t,r){r!==t&&(e[a]=t)}}),n.subscribeClassProperty(e.$parent,d,h),t[a].options.subscribeExternal=h):(d=l.getAttribute(u))&&(-1!==d.indexOf("${")?(g=i.BindingEngine.tokenizeParseAndTraverseAST(d,e.$parent))&&(e[a]=g):e[a]=d)}else{l=e.$element;var p,f=e.$attribute.name,v=t[a].options.attribute+".bind",b=l.getAttribute(f)?l.getAttribute(f).split(";"):null;if(b)if(b.forEach(function(e){var t=e.split(":");t&&t[0].trim()===v&&(p=t[1])}),p)h=Object.create({call:function(t,r){r!==t&&(e[a]=t)}}),n.subscribeClassProperty(e.$parent,p,h),t[a].options.subscribeExternal=h;else{var y,g;v=""+t[a].options.attribute,b.forEach(function(e){var t=e.split(":");t&&t[0].trim()===v&&(y=t[1])}),y&&(-1!==y.indexOf("${")?(g=i.BindingEngine.tokenizeParseAndTraverseAST(y,e.$parent))&&(e[a]=g):e[a]=y)}}},l=0,u=r;l<u.length;l++)o(u[l])}},e.f[53]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(54),i=e.r(16),a=e.r(7),s=e.r(17),o=e.r(1),l=function(){function e(e,t,r,n,s){this._process=!0,this.logger=o.Logger.getLogger(t.tagName,"element"),this.parent=e,this.element=t,this.templateString=s,this._class=r||a.ContainerClasses.get(n),t&&!t.$view&&(t.$view=new i.ViewController(t),t.$view.addElement(this))}return e.prototype.init=function(){var e;if(this._class.$element=this.element,this._class.$parent=this.parent,this._class.$attributes=this.element.attributes,s.BindingEngine.subscribeClassMetaBinding(this._class),this.loadTemplate(),this.create(),this.processContent(),this._process&&(e=n.ViewParser.parseNodes(this.template,this._class,this.element.$view)),this._process)for(;this.template.childNodes.length;)this.element.appendChild(this.template.firstChild);return e.reverse(),this.contentProcessed(e),e},e.prototype.loadTemplate=function(){if(this.logger.log("loadTemplate"),!this._class.loadTemplate)throw new Error("loadTemplate missing");this.templateString=this.templateString||this._class.loadTemplate(),this.template=n.ViewParser.createTemplate(null,this.templateString)},e.prototype.create=function(){this.logger.log("create"),this._class.created&&this._class.created()},e.prototype.processContent=function(){this.logger.log("processContent"),this._class.processContent&&(this._process=this._class.processContent(this.template))},e.prototype.contentProcessed=function(e){this.logger.log("contentProcessed"),this._class.contentProcessed&&this._process&&this._class.contentProcessed(e)},e.prototype.attached=function(){this.logger.log("attached"),this._class.attached&&this._class.attached()},e.prototype.detached=function(){this.logger.log("detached"),this._class.detached&&this._class.detached(),s.BindingEngine.unSubscribeClassMetaBinding(this._class),this.parent=null,this.element=null,this._class.$element=null,this._class.$parent=null,this._class.$attributes=null,this._class=null},e}();r.ElementController=l},e.f[54]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(7),i=e.r(7),a=e.r(1),s=e.r(15),o=e.r(53),l=e.r(55),u=function(){function e(){}return e.parseAndCreateElement=function(e,t,r,n){var i=new o.ElementController(r,t,e,null,n),a=i.init();i.attached(),a.forEach(function(e){e.attached&&e.attached()})},e.cleanTemplate=function(e){var t=function(e){for(var r=0;r<e.childNodes.length;r++){var n=e.childNodes[r];8===n.nodeType||3===n.nodeType&&!/\S/.test(n.nodeValue)?(e.removeChild(n),r--):1===n.nodeType&&t(n),n=null}};t(e)},e.createTemplate=function(t,r){var n;if(a.Cache.templateMapHas(r))n=a.Cache.templateMapGet(r);else{var i=document.createElement("div");i.innerHTML=r.default||r;var s=i.firstElementChild;if(!s.content)for(s.content=document.createDocumentFragment();s.childNodes[0];)s.content.appendChild(s.childNodes[0]);n=document.createElement(t||"mf-template"),e.cleanTemplate(s.content),n.appendChild(s.content),a.Cache.templateMapSet(r,n)}var o=n.cloneNode(!0);return n=null,o},e.clearAllViews=function(e){for(var t,r=document.createNodeIterator(e,NodeFilter.SHOW_ALL,function(e){return e.$view?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT},!1);t=r.nextNode();)t.$view.clearView()},e.parseNodes=function(e,t,r){var a=[],u=function(e){for(var h=0;h<e.childNodes.length;h++){var c=!1,d=e.childNodes[h];if(d.getAttribute){var p=d.getAttributeNode("if.bind");if(p){c=!0;var f=i.ContainerAttributes.findAttribute(p.name),v=new s.AttributeController(t,d,p,f,r);r=d.$view?d.$view:r,v.init(),v&&a.push(v)}else{var b=d.getAttributeNode("repeat.for");if(b){c=!0;f=i.ContainerAttributes.findAttribute(b.name),v=new s.AttributeController(t,d,b,f,r);r=d.$view?d.$view:r,v.init(),v&&a.push(v)}}}if(!c)for(var y=d.attributes||[],g=0;g<y.length;g++){var m=y[g],C=i.ContainerAttributes.findAttribute(m.name);if(!C&&m.name&&!(C=i.ContainerAttributes.findAttribute(m.name.replace(".bind","")))&&m.name&&!(C=i.ContainerAttributes.findAttribute("mframejs-event-trigger."+m.name.split(".")[1]))&&m.name&&(C=i.ContainerAttributes.findAttribute("mframejs-event-delegate."+m.name.split(".")[1])),C){v=new s.AttributeController(t,d,m,C,r);r=d.$view?d.$view:r,v.init(),v&&a.push(v)}else{if(-1!==m.value.indexOf("${"))(A=new l.InterpolateController(t,m,r)).init(),a.push(A)}}if(!c){var A;if(d.textContent&&1!==d.nodeType)if(-1!==d.textContent.indexOf("${"))(A=new l.InterpolateController(t,d,r)).init(),a.push(A);if(1===d.nodeType){var _=n.ContainerElements.findElement(d.localName);if(_){var E=new o.ElementController(t,d,null,_,null);r=d.$view?d.$view:r;var T=E.init();a.push(E),a.push.apply(a,T)}else d.childNodes&&u(d)}}}};return u({childNodes:[e]}),a},e.parseNodesWithCache=function(e,t,r,n){for(var i,a=[],u=document.createTreeWalker(e,NodeFilter.SHOW_ALL,null,!1),h=0,c=r[0].last,d=0;d<r.length;d++){if(i=u.nextNode(),r[d].no===h)switch(r[d].type){case"attribute-interpolate":case"attribute":if("attribute"===r[d].type){var p=new s.AttributeController(t,i,i.attributes[r[d].attributeCount],r[d].set,n);n=i.$view?i.$view:n,p.init(),a.push(p)}else{var f=new l.InterpolateController(t,i.attributes[r[d].attributeCount],n);f.init(),a.push(f)}for(;r[d+1]&&r[d+1].no===h;)if("attribute"===r[++d].type){p=new s.AttributeController(t,i,i.attributes[r[d].attributeCount],r[d].set,n);n=i.$view?i.$view:n,p.init(),a.push(p)}else{var v=new l.InterpolateController(t,i.attributes[r[d].attributeCount],n);v.init(),a.push(v)}break;case"element":var b=new o.ElementController(t,i,null,r[d].set,null);n=i.$view?i.$view:n;var y=b.init();a.push(b),a.push.apply(a,y);break;case"interpolate":var g=new l.InterpolateController(t,i,n);g.init(),a.push(g)}if(++h>c)break}return a},e.createNodeParseCache=function(e){var t=[],r=-1,a=-1,s=0,o=function(e,l){for(var u=0;u<e.childNodes.length;u++){a++;var h=t.length,c=l||!1,d=e.childNodes[u];if(d.getAttribute&&!l)if(d.getAttribute("if.bind")){c=!0;var p=d.attributes||[];r=-1;for(var f=0;f<p.length;f++){if(r++,"if.bind"===(b=p[f]).name)(v=i.ContainerAttributes.findAttribute(b.name))&&(s=a,t.push({no:a,type:"attribute",attributeCount:r,set:v}))}}else{if(d.getAttribute("repeat.for")){c=!0;p=d.attributes||[];r=-1;for(f=0;f<p.length;f++){if(r++,"repeat.for"===(b=p[f]).name)(v=i.ContainerAttributes.findAttribute(b.name))&&(s=a,t.push({no:a,type:"attribute",attributeCount:r,set:v}))}}}if(!c&&!l){p=d.attributes||[];r=-1;for(f=0;f<p.length;f++){r++;var v,b=p[f];!(v=i.ContainerAttributes.findAttribute(b.name))&&b.name&&!(v=i.ContainerAttributes.findAttribute(b.name.replace(".bind","")))&&b.name&&!(v=i.ContainerAttributes.findAttribute("mframejs-event-trigger."+b.name.split(".")[1]))&&b.name&&(v=i.ContainerAttributes.findAttribute("mframejs-event-delegate."+b.name.split(".")[1])),v?(s=a,t.push({no:a,type:"attribute",attributeCount:r,set:v})):-1!==b.value.indexOf("${")&&(s=a,t.push({no:a,type:"attribute-interpolate",set:null,attributeCount:r}))}}if(!c&&!l)if(d.textContent&&1!==d.nodeType)-1!==d.textContent.indexOf("${")&&(s=a,t.push({no:a,type:"interpolate",set:null,attributeCount:null}));else if(1===d.nodeType){var y=n.ContainerElements.findElement(d.localName);y&&(s=a,t.push({no:a,type:"element",set:y,attributeCount:null}))}h===t.length&&t.push({no:a+99,type:null,set:null,attributeCount:null}),d.childNodes&&o(d,c)}};return o(e,!1),t[0].last=s,t},e}();r.ViewParser=u},e.f[55]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(17),i=e.r(1),a=function(){function e(e){this.firstRun=!0,this.name="Interpolate",this.node=e}return e.prototype.call=function(e,t){(t!==e||this.firstRun)&&(this.firstRun=!1,2===this.node.nodeType?this.node.value=e:this.node.data=e)},e}(),s=function(){function e(e,t,r){this.attr=!1,t.data||(this.attr=!0),this.logger=i.Logger.getLogger(this.attr?t.value.trim():t.data.trim(),"interpolate"),this.parent=e,this.node=t,r.addInterpolate(this)}return e.prototype.init=function(){this.logger.log("init"),this.subscribeInternal=new a(this.node),n.BindingEngine.subscribeClassProperty(this.parent,this.attr?this.node.value:this.node.data,this.subscribeInternal)},e.prototype.attached=function(){this.logger.log("attached")},e.prototype.detached=function(){this.logger.log("detached"),n.BindingEngine.unSubscribeClassProperty(this.parent,this.subscribeInternal),this.subscribeInternal=null,this.parent=null,this.node=null},e}();r.InterpolateController=s},e.f[56]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(57);r.inject=n.inject;var i=e.r(58);r.transient=i.transient;var a=e.r(59);r.customAttribute=a.customAttribute;var s=e.r(60);r.customElement=s.customElement;var o=e.r(61);r.bindable=o.bindable;var l=e.r(62);r.observable=l.observable;var u=e.r(63);r.computedFrom=u.computedFrom;var h=e.r(64);r.valueConverter=h.valueConverter;var c=e.r(65);r.behavior=c.behavior},e.f[57]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(7);r.inject=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){n.ContainerClasses.setDep(t,e)}}},e.f[58]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(7);r.transient=function(e){n.ContainerClasses.regTransient(e)}},e.f[59]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(7),i=e.r(7);r.customAttribute=function(e){return function(t){n.ContainerClasses.regTransient(t),i.ContainerAttributes.regAttribute(t,e)}}},e.f[60]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(7),i=e.r(7);r.customElement=function(e){return function(t){n.ContainerClasses.regTransient(t),i.ContainerElements.regElement(t,e)}}},e.f[61]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(31);r.bindable=function(e){var t;return t=e,function(r,i){r[n.CONSTANTS.META_BINDABLE]||(r[n.CONSTANTS.META_BINDABLE]={});var a=i.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/\s+/g,"-").toLowerCase();e&&(e.attribute||(e.attribute=a)),r[n.CONSTANTS.META_BINDABLE][i]||(r[n.CONSTANTS.META_BINDABLE][i]={key:i,options:t||{attribute:a}})}}},e.f[62]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(31);r.observable=function(e){var t;return t=e,function(r,i){r[n.CONSTANTS.META_BINDABLE]||(r[n.CONSTANTS.META_BINDABLE]={}),e&&(e.attribute||(e.attribute=null)),r[n.CONSTANTS.META_BINDABLE][i]||(r[n.CONSTANTS.META_BINDABLE][i]={key:i,observableOnly:!0,options:t||{attribute:null}})}}},e.f[63]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(31);r.computedFrom=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e=t,function(t,r){t[n.CONSTANTS.META_COMPUTEDFROM]||(t[n.CONSTANTS.META_COMPUTEDFROM]={}),t[n.CONSTANTS.META_COMPUTEDFROM][r]||(t[n.CONSTANTS.META_COMPUTEDFROM][r]={key:r,attributes:e||{attributes:[]}})}}},e.f[64]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(7),i=e.r(7);r.valueConverter=function(e){return function(t){n.ContainerClasses.regTransient(t),i.ContainerValueConverters.regConverter(t,e)}}},e.f[65]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(7),i=e.r(7);r.behavior=function(e){return function(t){n.ContainerClasses.regTransient(t),i.ContainerBehavior.regBehavior(t,e)}}},e.f[66]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(67);r.SignalBehavior=n.SignalBehavior;var i=e.r(68);r.ThrottleBehavior=i.ThrottleBehavior;var a=e.r(69);r.DebounceBehavior=a.DebounceBehavior;var s=e.r(70);r.TriggerBehavior=s.TriggerBehavior},e.f[67]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(85),i=e.r(56),a=e.r(1),s=e.r(7).ContainerClasses.get(a.EventAggregator),o=function(){function e(e,t){this.name=t[0]||"undefined",e.listener&&"Interpolate"===e.listener.name&&(e.unbindBackup=e.unbind,e.unbind=function(){this.unbindBackup()},s.subscribe("signal-"+this.name,function(){e.update()}))}return e=n.__decorate([i.behavior("signal"),n.__metadata("design:paramtypes",[Object,Object])],e)}();r.SignalBehavior=o},e.f[68]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(85),i=e.r(56),a=function(){function e(e,t){var r=t[0]||100;e.eventHandlerBinded&&(e.eventHandlerBindedBackup=e.eventHandlerBinded,e.detachedBackup=e.detached,e.detached=function(){e.detachedBackup()},e.eventHandlerBinded=function(){var t=this;this.timerBehavior||(this.timerBehavior=setTimeout(function(){e.eventHandlerBindedBackup(),t.timerBehavior=null},r))}.bind(e))}return e=n.__decorate([i.behavior("throttle"),n.__metadata("design:paramtypes",[Object,Object])],e)}();r.ThrottleBehavior=a},e.f[69]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(85),i=e.r(56),a=function(){function e(e,t){var r=t[0]||100;e.eventHandlerBinded&&(e.eventHandlerBindedBackup=e.eventHandlerBinded,e.detachedBackup=e.detached,e.detached=function(){e.detachedBackup()},e.eventHandlerBinded=function(){this.timerBehavior&&(clearTimeout(this.timerBehavior),this.timerBehavior=null),this.timerBehavior=setTimeout(function(){e.eventHandlerBindedBackup()},r)}.bind(e))}return e=n.__decorate([i.behavior("debounce"),n.__metadata("design:paramtypes",[Object,Object])],e)}();r.DebounceBehavior=a},e.f[70]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(85),i=e.r(56),a=function(){function e(e,t){var r=t;e.eventHandlerBinded&&"trigger"in e&&r&&(e.trigger=r)}return e=n.__decorate([i.behavior("updateTrigger"),n.__metadata("design:paramtypes",[Object,Object])],e)}();r.TriggerBehavior=a},e.f[71]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(72);r.MfRouter=n.MfRouter},e.f[72]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(85),i=e.r(5),a=e.r(3),s=e.r(60),o=e.r(57),l=e.r(8),u=e.r(14),h=function(){function e(e,t){this.router=t,this.eventAggregator=e,this.router.mainRouter||(this.router.mainRouter=this)}return e.prototype.created=function(){},e.prototype.attached=function(){this.started=!0,this.loaded||this.update()},e.prototype.detached=function(){},e.prototype.loadTemplateAsync=function(){return n.__awaiter(this,void 0,void 0,function(){var e,t,r;return n.__generator(this,function(n){switch(n.label){case 0:return this.started?[3,1]:[2,"<template></template>"];case 1:return n.trys.push([1,3,,4]),e=this.router.getCurrentModule(),[4,this.router.loadCurrentModule()];case 2:return void 0===(t=n.sent())&&console.warn("route not found"+e),r=l.ContainerClasses.get(t[this.router.getCurrentClass()]),this.instance=r,[2,r.loadTemplate()];case 3:return[2,"<template>"+n.sent()+"</template>"];case 4:return[2]}})})},e.prototype.loadTemplate=function(){return this.started&&console.log("Im not supposed to trigger, BUG!!!"),"<template></template>"},e.prototype.update=function(){var e=this,t=this.instance,r=!0;if(t&&t.canDeactivate&&(r=t.canDeactivate()),r){for(t&&(t.detached&&t.detached(),u.ViewParser.clearAllViews(t.$element),t.$element=null,t.$parent=null,t.$attributes=null,t.$element=null);this.$element.firstChild;)this.$element.removeChild(this.$element.firstChild);var n=document.createElement("view");this.loadTemplateAsync().then(function(t){e.loaded=!0,u.ViewParser.parseAndCreateElement(e.instance,n,e,t),e.$element.appendChild(n),e.router.isNavigating=!1,e.instance.activated&&e.instance.activated()})}},e=n.__decorate([s.customElement("mf-router"),o.inject(a.EventAggregator,i.Router),n.__metadata("design:paramtypes",["function"==typeof(t=void 0!==a.EventAggregator&&a.EventAggregator)&&t||Object,"function"==typeof(r=void 0!==i.Router&&i.Router)&&r||Object])],e);var t,r}();r.MfRouter=h},e.f[73]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(74);r.IfAttribute=n.IfAttribute;var i=e.r(75);r.ValueAttribute=i.ValueAttribute;var a=e.r(76);r.DelgateEventsAttribute=a.DelgateEventsAttribute;var s=e.r(77);r.TriggerEventsAttribute=s.TriggerEventsAttribute;var o=e.r(78);r.RepeatAttribute=o.RepeatAttribute;var l=e.r(80);r.MiscAttributes=l.MiscAttributes;var u=e.r(81);r.CssAttribute=u.CssAttribute;var h=e.r(82);r.ModelAttribute=h.ModelAttribute},e.f[74]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(85),i=e.r(56),a=e.r(14),s=e.r(17),o=function(){function e(){}return e.prototype.created=function(){this.value=this.$attribute.value,this.$element.attributes.removeNamedItem("if.bind"),this.$element&&this.$element.$view&&(this.$view=this.$element.$view),this.elementClone=this.$element.cloneNode(!0),this.anchor=document.createComment("mf-if-bind"),this.$view&&(this.anchor.$view=this.$view),this.$element.parentNode.insertBefore(this.anchor,this.$element),this.remove(),this.added=!1},e.prototype.attached=function(){var e=this;this.subscribeCall={name:"ifAttribute",value:this.value,call:function(t){switch(!0){case t&&!e.added:e.added=!0,e.add();break;case!t&&e.added:e.remove()}}},s.BindingEngine.subscribeClassProperty(this.$parent,this.value,this.subscribeCall)},e.prototype.detached=function(){s.BindingEngine.unSubscribeClassProperty(this.$parent,this.subscribeCall)},e.prototype.add=function(){var e=this.elementClone.cloneNode(!0);this.$element=e,e.$view=new a.ViewController(e);var t=[];t=a.ViewParser.parseNodes(this.$element,this.$parent,e.$view),this.anchor.parentNode.insertBefore(this.$element,this.anchor),t.forEach(function(e){e.attached&&e.attached()}),t=null},e.prototype.remove=function(){var e=this.$element;this.added&&(this.added=!1,a.ViewParser.clearAllViews(this.$element),this.$element=null),this.anchor.parentNode.removeChild(e),e=null},e=n.__decorate([i.customAttribute("if.bind"),n.__metadata("design:paramtypes",[])],e)}();r.IfAttribute=o},e.f[75]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(85),i=e.r(56),a=e.r(17),s=e.r(1),o=e.r(7),l=function(){function e(e){this.firstRun=!0,this.name="valueAttribute",this.node=e}return e.prototype.call=function(e,t){if((t!==e||this.firstRun)&&(this.firstRun=!1,t!==e))switch(!0){case"text"===this.node.type:this.node.value=e||"";break;case"checkbox"===this.node.type:var r=this.node.hasAttribute("model.bind")?this.node.getAttributeNode("model.bind"):null;if(r&&r.getContent)(h=r.getContent())&&(Array.isArray(e)?-1!==e.indexOf(h.value)?this.node.checked=!0:this.node.checked=!1:e===h.value?this.node.checked=!0:this.node.checked=!1);else Array.isArray(e)?console.log("error: value is array, this should not happen"):this.node.checked=e||!1;break;case"radio"===this.node.type:var n=null;if((n=this.node.form?this.node.form.querySelectorAll("[name="+this.node.name+"]"):document.querySelectorAll("[name="+this.node.name+"]"))&&n.length>0){var i=this.node.hasAttribute("model.bind")?this.node.getAttributeNode("model.bind"):null;if(i&&i.getContent)(h=i.getContent())&&e===h.value&&(this.node.checked=!0)}break;case"select-one"===this.node.type:for(var a=this.node.options,s=null,o=0;o<a.length;o++){var l=a[o].hasAttribute("model.bind")?a[o].getAttributeNode("model.bind"):null;if(l&&l.getContent)(h=l.getContent())&&(Array.isArray(e)?e[0]===h.value&&(s=o):e===h.value&&(s=o))}this.node.selectedIndex=s;break;case"select-multiple"===this.node.type:var u=this.node.options;for(o=0;o<u.length;o++){var h,c=u[o].hasAttribute("model.bind")?u[o].getAttributeNode("model.bind"):null;if(c&&c.getContent)(h=c.getContent())&&(Array.isArray(e)?(-1!==e.indexOf(h.value)?u[o].selected=!0:u[o].selected=!1,0===e.length&&null===h.value&&(u[o].selected=!0)):e===h.value?u[o].selected=!0:u[o].selected=!1)}}},e}(),u=function(){function e(){this.valueConverters=[],this.eventHandlerBinded=this.eventHandler.bind(this)}return e.prototype.created=function(){var e=this;switch(this.expressionValue=this.$attribute.value,this.attributeName=this.expressionValue.split("|")[0].trim().split("&")[0].trim(),this.trigger=null,this.name=this.$attribute.name,this.propertyChangeHandler=new l(this.$element),!0){case"INPUT"===this.$element.tagName&&"text"===this.$element.type||"TEXTAREA"===this.$element.tagName:a.BindingEngine.subscribeClassProperty(this.$parent,this.expressionValue,this.propertyChangeHandler),this.connectBehavior(),this.trigger?this.trigger.forEach(function(t){e.$element.addEventListener(t,e.eventHandlerBinded,!1)}):this.$element.addEventListener("input",this.eventHandlerBinded,!1);break;case"INPUT"===this.$element.tagName&&"checkbox"===this.$element.type:a.BindingEngine.subscribeClassProperty(this.$parent,this.expressionValue,this.propertyChangeHandler),this.connectBehavior(),this.trigger?this.trigger.forEach(function(t){e.$element.addEventListener(t,e.eventHandlerBinded,!1)}):this.$element.addEventListener("click",this.eventHandlerBinded,!1);break;case"INPUT"===this.$element.tagName&&"radio"===this.$element.type:a.BindingEngine.subscribeClassProperty(this.$parent,this.expressionValue,this.propertyChangeHandler),this.connectBehavior(),this.trigger?this.trigger.forEach(function(t){e.$element.addEventListener(t,e.eventHandlerBinded,!1)}):this.$element.addEventListener("click",this.eventHandlerBinded,!1);break;case"SELECT"===this.$element.tagName:a.BindingEngine.subscribeClassProperty(this.$parent,this.expressionValue,this.propertyChangeHandler),this.connectBehavior(),this.trigger?this.trigger.forEach(function(t){e.$element.addEventListener(t,e.eventHandlerBinded,!1)}):this.$element.addEventListener("change",this.eventHandlerBinded,!1)}},e.prototype.runValueConverter=function(e){var t=s.Cache.expressionMapGet(this.expressionValue);return a.BindingEngine.valueConvert(t.ast,this.$parent,e)},e.prototype.connectBehavior=function(){var e=this;if(-1!==this.expressionValue.indexOf("&")){var t=s.Cache.expressionMapGet(this.expressionValue);if(!t){var r=a.BindingEngine.tokenize(this.expressionValue);(t={}).ast=a.BindingEngine.generateAST(r)}var n=a.BindingEngine.getBehavior(t.ast);n&&n.forEach(function(t){var r=o.ContainerBehavior.findBehavior(t.name);if(r){var n=new r(e,t.args);n=n}})}},e.prototype.detached=function(){var e=this;switch(!0){case"INPUT"===this.$element.tagName&&"text"===this.$element.type||"TEXTAREA"===this.$element.tagName:this.trigger?this.trigger.forEach(function(t){e.$element.removeEventListener(t,e.eventHandlerBinded)}):this.$element.removeEventListener("input",this.eventHandlerBinded);break;case"INPUT"===this.$element.tagName&&"checkbox"===this.$element.type:this.trigger?this.trigger.forEach(function(t){e.$element.removeEventListener(t,e.eventHandlerBinded)}):this.$element.removeEventListener("click",this.eventHandlerBinded);break;case"INPUT"===this.$element.tagName&&"radio"===this.$element.type:this.trigger?this.trigger.forEach(function(t){e.$element.removeEventListener(t,e.eventHandlerBinded)}):this.$element.removeEventListener("click",this.eventHandlerBinded);break;case"SELECT"===this.$element.tagName:this.trigger?this.trigger.forEach(function(t){e.$element.removeEventListener(t,e.eventHandlerBinded)}):this.$element.removeEventListener("change",this.eventHandlerBinded);break;default:this.$attribute.$parent=null}this.propertyChangeHandler.caller&&a.BindingEngine.unSubscribeClassProperty(this.$parent,this.propertyChangeHandler)},e.prototype.eventHandler=function(){switch(!0){case"INPUT"===this.$element.tagName&&"text"===this.$element.type||"TEXTAREA"===this.$element.tagName:a.BindingEngine.setValue(this.$parent,this.attributeName,this.runValueConverter(this.$element.value));break;case"INPUT"===this.$element.tagName&&"checkbox"===this.$element.type:var e=this.$element.hasAttribute("model.bind")?this.$element.getAttributeNode("model.bind"):null;if(e){var t,r=e.getContent().value,n=a.BindingEngine.evaluateExpression(this.$attribute.nodeValue,this.$parent),i=Array.isArray(n),s=this.$element.checked;if(i)if(s)-1===(t=n.indexOf(r))&&(n=n.concat([this.runValueConverter(r)]),a.BindingEngine.setValue(this.$parent,this.attributeName,n));else-1!==(t=n.indexOf(r))?(n.splice(t,1),n.__array_observer__class||(n=n.slice()),a.BindingEngine.setValue(this.$parent,this.attributeName,n)):this.$element.checked=!1;else a.BindingEngine.setValue(this.$parent,this.attributeName,this.runValueConverter(r)||!1)}else a.BindingEngine.setValue(this.$parent,this.attributeName,this.$element.checked||!1);break;case"INPUT"===this.$element.tagName&&"radio"===this.$element.type:var o=this.$element.hasAttribute("model.bind")?this.$element.getAttributeNode("model.bind"):null;if(o){r=a.BindingEngine.evaluateExpression(o.nodeValue,o.getContent().$parent);a.BindingEngine.setValue(this.$parent,this.attributeName,this.runValueConverter(r))}else a.BindingEngine.setValue(this.$parent,this.attributeName,this.runValueConverter(this.$element.checked));break;case"SELECT"===this.$element.tagName:var l=a.BindingEngine.evaluateExpression(this.$attribute.nodeValue,this.$parent),u=Array.isArray(l),h=this.$element.selectedOptions.length,c=null;if(h>1){for(var d=[],p=0;p<h;p++){var f=(v=this.$element.selectedOptions[p]).hasAttribute("model.bind")?v.getAttributeNode("model.bind"):null;r=a.BindingEngine.evaluateExpression(f.nodeValue,f.getContent().$parent);d.push(this.runValueConverter(r))}c=d}else if(0===h)c=null;else{var v;f=(v=this.$element.selectedOptions[0]).hasAttribute("model.bind")?v.getAttributeNode("model.bind"):null;c=r=a.BindingEngine.evaluateExpression(f.nodeValue,f.getContent().$parent)}u?a.BindingEngine.setValue(this.$parent,this.attributeName,Array.isArray(c)?c:null===c?[]:[c]):a.BindingEngine.setValue(this.$parent,this.attributeName,Array.isArray(c)?c.map(function(e){return e}):c)}},e=n.__decorate([i.customAttribute("value.bind"),i.customAttribute("checked.bind"),n.__metadata("design:paramtypes",[])],e)}();r.ValueAttribute=u},e.f[76]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(85),i=e.r(56),a=e.r(17),s=e.r(7),o=e.r(1),l=function(){function e(){}return e.prototype.created=function(){this.name=this.$attribute.name.replace(".delegate",""),this.value=this.$attribute.value,this.expressionValue=this.$attribute.value,this.eventHandlerBinded=this.eventHandler.bind(this),this.connectBehavior(),this.$element.addEventListener(this.name,this.eventHandlerBinded,!1)},e.prototype.attached=function(){},e.prototype.detached=function(){this.$element.removeEventListener(this.name,this.eventHandlerBinded)},e.prototype.eventHandler=function(e){a.BindingEngine.tokenizeParseAndTraverseAST(this.value,{ctx:this.$parent,$event:e,isMultiContext:!0})},e.prototype.connectBehavior=function(){var e=this;if(-1!==this.expressionValue.indexOf("&")){var t=o.Cache.expressionMapGet(this.expressionValue);if(!t){var r=a.BindingEngine.tokenize(this.expressionValue);(t={}).ast=a.BindingEngine.generateAST(r)}var n=a.BindingEngine.getBehavior(t.ast);n&&n.forEach(function(t){var r=s.ContainerBehavior.findBehavior(t.name);if(r){var n=new r(e,t.args);n=n}})}},e=n.__decorate([i.customAttribute("mframejs-event-delegate.delegate"),n.__metadata("design:paramtypes",[])],e)}();r.DelgateEventsAttribute=l},e.f[77]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(85),i=e.r(56),a=e.r(17),s=e.r(7),o=e.r(1),l=function(){function e(){}return e.prototype.created=function(){this.name=this.$attribute.name.replace(".trigger",""),this.value=this.$attribute.value,this.expressionValue=this.$attribute.value,this.eventHandlerBinded=this.eventHandler.bind(this),this.connectBehavior(),this.$element.addEventListener(this.name,this.eventHandlerBinded,!1)},e.prototype.attached=function(){},e.prototype.detached=function(){this.$element.removeEventListener(this.name,this.eventHandlerBinded)},e.prototype.eventHandler=function(e){a.BindingEngine.tokenizeParseAndTraverseAST(this.value,{ctx:this.$parent,$event:e,isMultiContext:!0})},e.prototype.connectBehavior=function(){var e=this;if(-1!==this.expressionValue.indexOf("&")){var t=o.Cache.expressionMapGet(this.expressionValue);if(!t){var r=a.BindingEngine.tokenize(this.expressionValue);(t={}).ast=a.BindingEngine.generateAST(r)}var n=a.BindingEngine.getBehavior(t.ast);n&&n.forEach(function(t){var r=s.ContainerBehavior.findBehavior(t.name);if(r){var n=new r(e,t.args);n=n}})}},e=n.__decorate([i.customAttribute("mframejs-event-trigger.trigger"),n.__metadata("design:paramtypes",[])],e)}();r.TriggerEventsAttribute=l},e.f[78]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(85),i=e.r(56),a=e.r(14),s=e.r(14),o=e.r(17),l=e.r(79),u=function(){function e(){this.templateArray=[],this.arrayType="object"}return e.prototype.setArrayLocalVariables=function(e,t){e.$index=t,e.$even=t%2==0,e.$odd=t%2!=0},e.prototype.created=function(){this.value=this.$attribute.value,this.overrideContext=this.$parent,this.loopBinded=this.loopArray.bind(this),this.$element&&this.$element.$view&&(this.$view=this.$element.$view),this.$element.attributes.removeNamedItem("repeat.for"),this.elementClone=this.$element.cloneNode(!0),this.temp=document.createElement("div");var e=document.createElement("div");if(e.appendChild(this.elementClone),this.repeatTemplateCache=a.ViewParser.createNodeParseCache(e),this.anchor=document.createComment("mf-repeat-for"),this.$view&&(this.anchor.$view=this.$view),this.remove(),this.repeatForArray=this.value.split("of"),this.repeatForArray=this.repeatForArray.map(function(e){return e.trim()}),2!==this.repeatForArray.length)console.error("unknown expression in repeat:"+this.value);else{if(this.rowInstanceName=this.repeatForArray[0],this.arrayVariableName=this.repeatForArray[1],this.arrayExpression=this.repeatForArray[1],this.arrayVariableName.indexOf("|")){var t=this.arrayVariableName.split("|").map(function(e){return e.trim()});this.arrayVariableName=t[0]}this.$array=o.BindingEngine.evaluateExpression(this.arrayExpression,this.$parent);var r=this.$array;Array.isArray(r)?(this.subscribeArray(),this.subscribePropArray()):"number"==typeof r?(this.arrayType="number",this.subscribePropSimple()):"string"==typeof r?(this.arrayType="string",this.subscribePropSimple()):console.error("unknown type, only support array, string and number")}},e.prototype.loopArray=function(e,t,r){var n=this.$array;if(n)if(e){if(t)for(var i=this.templateArray.length-t,a=0;a<this.templateArray.length;a++)if(a<i)this.templateArray[a].ctx[this.rowInstanceName]!==n[a]&&(this.templateArray[a].ctx[this.rowInstanceName]=n[a]);else{var s=this.templateArray.pop();a--,this.clearInRow(s)}if(r)for(i=n.length-r,a=0;a<n.length;a++)a<i?this.templateArray[a].ctx[this.rowInstanceName]!==this.$array[a]&&(this.templateArray[a].ctx[this.rowInstanceName]=this.$array[a]):this.push(n[a])}else for(a=0;a<this.$array.length;a++)this.templateArray[a].ctx[this.rowInstanceName]!==n[a]&&(this.templateArray[a].ctx[this.rowInstanceName]=n[a])},e.prototype.detached=function(){this.clearTemplateArray(),this.arrayMethodCallHandler&&o.BindingEngine.unSubscribeClassArray(this.$parent,this.arrayMethodCallHandler),this.arrayPropertyChangeHandler&&o.BindingEngine.unSubscribeClassProperty(this.$parent,this.arrayPropertyChangeHandler),this.arrayPropertyChangeHandlerLocal&&o.BindingEngine.unSubscribeClassProperty(this.$parent,this.arrayPropertyChangeHandlerLocal),this.$array=null,this.arrayMethodCallHandler=null,this.arrayPropertyChangeHandler=null,this.arrayPropertyChangeHandlerLocal=null,this.propertyChangeHandlerSimple=null},e.prototype.attached=function(){var e=this;this.isAttached=!0,this.$array=o.BindingEngine.evaluateExpression(this.arrayExpression,this.$parent);var t=this.$array;if(Array.isArray(t))t.forEach(function(t){e.push(t)});else{if("number"===this.arrayType&&this.templateArray.length!==t){this.clearTemplateArray();for(var r=0;r<t;r++)this.push(r)}if("string"===this.arrayType){var n="string"==typeof t?t.length:0;if(this.templateArray.length!==n){this.clearTemplateArray();for(r=0;r<n;r++)this.push(t[r])}}}},e.prototype.subscribeArray=function(){this.arrayMethodCallHandler||(this.arrayMethodCallHandler=new l.ArrayMethodCallHandler(this)),o.BindingEngine.subscribeClassArray(this.$parent,this.arrayVariableName,this.arrayMethodCallHandler)},e.prototype.subscribePropArray=function(){if(this.arrayPropertyChangeHandler||(this.arrayPropertyChangeHandler=new l.ArrayPropertyChange(this)),o.BindingEngine.subscribeClassProperty(this.$parent,this.arrayVariableName,this.arrayPropertyChangeHandler),this.arrayVariableName!==this.arrayExpression){this.arrayPropertyChangeHandlerLocal||(this.arrayPropertyChangeHandlerLocal=new l.ArrayPropertyChange(this));var e=this.arrayExpression.replace(this.arrayVariableName,"$array");o.BindingEngine.subscribeClassProperty(this,e,this.arrayPropertyChangeHandlerLocal)}},e.prototype.subscribePropSimple=function(){this.propertyChangeHandlerSimple||(this.propertyChangeHandlerSimple=new l.PropertyChangeSimple(this)),o.BindingEngine.subscribeClassProperty(this.$parent,this.arrayVariableName,this.propertyChangeHandlerSimple)},e.prototype.push=function(e,t){var r=this.elementClone.cloneNode(!0),n={};n[this.rowInstanceName]=e,n.overrideContext=this.$parent,this.temp.appendChild(r),r.$view=new s.ViewController(r);var i=a.ViewParser.parseNodesWithCache(this.temp,n,this.repeatTemplateCache,r.$view);if(void 0===t){var o=this.templateArray.length;this.templateArray.push({ctx:n,template:r}),this.setArrayLocalVariables(n,this.templateArray.length-1),o?this.anchor.parentNode.insertBefore(r,this.templateArray[o-1].template.nextSibling):this.anchor.parentNode.insertBefore(r,this.anchor.nextSibling)}else this.templateArray.splice(t,0,{ctx:n,template:r}),this.templateArray[t+1]?this.anchor.parentNode.insertBefore(r,this.templateArray[t+1].template):this.anchor.parentNode.appendChild(r);i.forEach(function(e){e.attached&&e.attached()})},e.prototype.pop=function(){var e=this;if(this.templateArray.length>0){var t=this.templateArray.pop();this.clearInRow(t),this.templateArray.forEach(function(t,r){e.setArrayLocalVariables(t,r)})}},e.prototype.shift=function(){var e=this;if(this.templateArray.length>0){var t=this.templateArray.shift();this.clearInRow(t),this.templateArray.forEach(function(t,r){e.setArrayLocalVariables(t,r)})}},e.prototype.splice=function(e){var t=this;if(this.templateArray.length>0){for(var r=e[0],n=e[1],i=[],a=2;a<e.length;a++)e[a]&&i.push(e[a]);if(n)for(a=r+n-1;a>r-1;a--){var s=this.templateArray.splice(a,1)[0];this.clearInRow(s)}i.forEach(function(e){t.push(e,r)}),this.templateArray.forEach(function(e,r){t.setArrayLocalVariables(e,r)})}},e.prototype.clearTemplateArray=function(){var e=document.createElement("div");this.templateArray.forEach(function(t){e.appendChild(t.template)}),this.templateArray.forEach(function(e){a.ViewParser.clearAllViews(e.template)}),e=null,this.templateArray=[]},e.prototype.remove=function(){this.clearTemplateArray(),this.$element.parentNode.replaceChild(this.anchor,this.$element)},e.prototype.clearInRow=function(e){if(e){var t=e.template.parentNode.removeChild(e.template);a.ViewParser.clearAllViews(t),t=null}},e=n.__decorate([i.customAttribute("repeat.for"),n.__metadata("design:paramtypes",[])],e)}();r.RepeatAttribute=u},e.f[79]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(17),i=function(){function e(e){this.repeat=e,this.name="repeat"+this.repeat.value}return e.prototype.call=function(e){var t=this,r=!0;e.forEach(function(e){switch(e.event){case"push":for(var n=0;n<e.args.length;)t.repeat.push(e.args[n]),n++;break;case"reverse":case"sort":if(r){r=!1;var i=t.repeat.$array;i&&i.forEach(function(e,r){t.repeat.templateArray[r].ctx[t.repeat.rowInstanceName]=e,t.repeat.setArrayLocalVariables(t.repeat.templateArray[r].ctx,r)})}break;case"shift":t.repeat.shift();break;case"pop":t.repeat.pop();break;case"splice":t.repeat.splice(e.args)}})},e}();r.ArrayMethodCallHandler=i;var a=function(){function e(e,t){this.repeat=e,this.name="repeat"+this.repeat.value,this.expression=t}return e.prototype.call=function(){var e=this;if(this.repeat.isAttached){var t=n.BindingEngine.evaluateExpression(this.repeat.arrayExpression,this.repeat.$parent);if(t&&this.repeat.templateArray.length!==t.length)if(this.repeat.$array=t,0!==this.repeat.templateArray.length&&0!==t.length)this.repeat.templateArray.length>t.length?this.repeat.loopBinded(!0,this.repeat.templateArray.length-t.length,0):this.repeat.loopBinded(!0,0,t.length-this.repeat.templateArray.length),n.BindingEngine.unSubscribeClassArray(this.repeat.$parent,this.repeat.arrayMethodCallHandler),this.repeat.subscribeArray();else{this.repeat.clearTemplateArray();var r=n.BindingEngine.evaluateExpression(this.repeat.arrayExpression,this.repeat.$parent);r&&(r.forEach(function(t){e.repeat.push(t)}),n.BindingEngine.unSubscribeClassArray(this.repeat.$parent,this.repeat.arrayMethodCallHandler),this.repeat.subscribeArray(),r=null)}else this.repeat.$array=t,this.repeat.loopBinded(),n.BindingEngine.unSubscribeClassArray(this.repeat.$parent,this.repeat.arrayMethodCallHandler),t&&this.repeat.subscribeArray()}},e}();r.ArrayPropertyChange=a;var s=function(){function e(e){this.repeat=e,this.name="repeat"+this.repeat.value}return e.prototype.call=function(e){if(this.repeat.isAttached){if("string"===this.repeat.arrayType){var t="string"==typeof e?e.length:0;if(this.repeat.templateArray.length!==t){this.repeat.clearTemplateArray();for(var r=0;r<t;r++)this.repeat.push(e[r])}}if("number"===this.repeat.arrayType&&this.repeat.templateArray.length!==e){this.repeat.clearTemplateArray();for(r=0;r<e;r++)this.repeat.push(e)}}},e}();r.PropertyChangeSimple=s},e.f[80]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(85),i=e.r(56),a=e.r(17),s=function(){function e(){}return e.prototype.created=function(){var e=this;this.value=this.$attribute.value,this.name=this.$attribute.name.replace(".bind",""),this.init=!0,this.subscribeInternal={name:this.name+"Attribute(misc)",value:this.value,call:function(t,r){if(r!==t||e.init)switch(e.init=!1,e.name){case"readonly":t?e.$element.readOnly=t:e.$element.removeAttribute(e.name);break;case"disabled":t?e.$element.disabled=t:e.$element.removeAttribute(e.name);break;case"class":e.$element.className=t||"";break;case"show":e.$element.style.display=t?"block":"none";break;default:e.$element.setAttribute(e.name,t)}}},a.BindingEngine.subscribeClassProperty(this.$parent,this.value,this.subscribeInternal)},e.prototype.detached=function(){a.BindingEngine.unSubscribeClassProperty(this.$parent,this.subscribeInternal)},e.prototype.attached=function(){this.$element.removeAttribute(this.$attribute.name)},e=n.__decorate([i.customAttribute("href.bind"),i.customAttribute("readonly.bind"),i.customAttribute("disabled.bind"),i.customAttribute("show.bind"),i.customAttribute("class.bind"),n.__metadata("design:paramtypes",[])],e)}();r.MiscAttributes=s},e.f[81]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(85),i=e.r(56),a=e.r(17),s=function(){function e(){}return e.prototype.created=function(){var e=this;this.value=this.$attribute.value,this.$element.removeAttribute(this.$attribute.name),this.subscribeInternal={name:"cssAttribute:",value:this.value,call:function(t,r){r!==t&&e.splitAndInsert(t)}},a.BindingEngine.subscribeClassProperty(this.$parent,this.value,this.subscribeInternal)},e.prototype.splitAndInsert=function(e){var t=this;try{e.split(";").map(function(e){return e.split(":")}).map(function(e){return{attribute:e[0],value:e[1].replace(/ /g,"")}}).forEach(function(e){t.$element.style[e.attribute.trim()]=e.value.trim()})}catch(e){console.error("could not parse css values")}},e.prototype.detached=function(){a.BindingEngine.unSubscribeClassProperty(this.$parent,this.subscribeInternal)},e.prototype.attached=function(){},e=n.__decorate([i.customAttribute("css"),n.__metadata("design:paramtypes",[])],e)}();r.CssAttribute=s},e.f[82]=function(t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e.r(85),i=e.r(56),a=e.r(17),s=function(){function e(){}return e.prototype.created=function(){var e=this;this.$attribute.getContent=function(){return e},this.expression=this.$attribute.value,this.subscribeInternal={name:"modelAttribute:",value:this.value,call:function(t,r){r!==t&&(e.value=t)}},a.BindingEngine.subscribeClassProperty(this.$parent,this.expression,this.subscribeInternal)},e.prototype.detached=function(){this.$attribute.getContent=null},e=n.__decorate([i.customAttribute("model.bind")],e)}();r.ModelAttribute=s},e.f[83]=function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=new Map,n=new Map,i=new Map,a=new Map,s=function(){function e(){}return e.clear=function(){r.clear(),n.clear(),i.clear(),a.clear()},e.templateMapHas=function(e){return r.has(e)},e.templateMapSet=function(e,t){return r.set(e,t)},e.templateMapGet=function(e){return r.get(e)},e.expressionMapHas=function(e){return n.has(e)},e.expressionMapSet=function(e,t){return n.set(e,t)},e.expressionMapGet=function(e){return n.get(e)},e.astMapHas=function(e){return i.has(e)},e.astMapSet=function(e,t){return i.set(e,t)},e.astMapGet=function(e){return i.get(e)},e.splitMapHas=function(e){return a.has(e)},e.splitMapSet=function(e,t){return a.set(e,t)},e.splitMapGet=function(e){return a.get(e)},e}();t.Cache=s},e.f[84]=function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r,n=!1,i=1e4,a=function(){function e(e,t){this.id=i,i++,this.name=e,this.category=t||"unamed"}return e.getLogger=function(t,i){return n?new e(t,i):r},e.enable=function(){n=!0},e.disable=function(){n=!1},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];n&&console.log("Log["+this.id+"] - ["+this.category+"] - ["+this.name+"] ",e.join(" - "))},e}();t.Logger=a,r=new a("na","na")},e.f[85]=function(e,t){var r,n,i,a,s,o,l,u,h,c,d,p,f,v,b,y,g;!function(t){var r="object"==typeof self?self:"object"==typeof this?this:{};function n(e,t){return e!==r&&("function"==typeof Object.create?Object.defineProperty(e,"__esModule",{value:!0}):e.__esModule=!0),function(r,n){return e[r]=t?t(r,n):n}}"object"==typeof e.exports?t(n(r,n(e.exports))):t(n(r))}(function(e){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};r=function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)},n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},i=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&(r[n[i]]=e[n[i]])}return r},a=function(e,t,r,n){var i,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var o=e.length-1;o>=0;o--)(i=e[o])&&(s=(a<3?i(s):a>3?i(t,r,s):i(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s},s=function(e,t){return function(r,n){t(r,n,e)}},o=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function s(e){try{l(n.next(e))}catch(e){a(e)}}function o(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){e.done?i(e.value):new r(function(t){t(e.value)}).then(s,o)}l((n=n.apply(e,t||[])).next())})},u=function(e,t){var r,n,i,a,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function o(a){return function(o){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=n[2&a[0]?"return":a[0]?"throw":"next"])&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[0,i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,o])}}},h=function(e,t){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])},c=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}},d=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,a=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return s},p=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(d(arguments[t]));return e},f=function(e){return this instanceof f?(this.v=e,this):new f(e)},v=function(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(e,t||[]),a=[];return n={},s("next"),s("throw"),s("return"),n[Symbol.asyncIterator]=function(){return this},n;function s(e){i[e]&&(n[e]=function(t){return new Promise(function(r,n){a.push([e,t,r,n])>1||o(e,t)})})}function o(e,t){try{(r=i[e](t)).value instanceof f?Promise.resolve(r.value.v).then(l,u):h(a[0][2],r)}catch(e){h(a[0][3],e)}var r}function l(e){o("next",e)}function u(e){o("throw",e)}function h(e,t){e(t),a.shift(),a.length&&o(a[0][0],a[0][1])}},b=function(e){var t,r;return t={},n("next"),n("throw",function(e){throw e}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,i){e[n]&&(t[n]=function(t){return(r=!r)?{value:f(e[n](t)),done:"return"===n}:i?i(t):t})}},y=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator];return t?t.call(e):"function"==typeof c?c(e):e[Symbol.iterator]()},g=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},e("__extends",r),e("__assign",n),e("__rest",i),e("__decorate",a),e("__param",s),e("__metadata",o),e("__awaiter",l),e("__generator",u),e("__exportStar",h),e("__values",c),e("__read",d),e("__spread",p),e("__await",f),e("__asyncGenerator",v),e("__asyncDelegator",b),e("__asyncValues",y),e("__makeTemplateObject",g)})};window;var t=e.r(0);if(t)for(var r in t)window[r]=t[r]}();
exports.translate = function(load) {
if (this.builder && this.transpiler) {
load.metadata.format = 'esm';
return 'exp' + 'ort var __useDefault = ' + JSON.stringify(load.source) + '; exp' + 'ort default __useDefault;';
}
load.metadata.format = 'amd';
return 'def' + 'ine(function() {\nreturn ' + JSON.stringify(load.source) + ';\n});';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment