UNPKG

capivarajs

Version:

Um framework para criação de componentes.

1 lines 85.9 kB
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=2)}([function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r,i=n(13),o=n.n(i),a=n(14),s=n.n(a),c=n(2),u=n(1),l=n(10);!function(t){function e(t,e){if(t)try{return l.a.exec(t,e)}catch(t){}}function n(t){return!!window.capivara.components[t.nodeName.toUpperCase()]}function r(t,e){return t&&t[u.a.SCOPE_ATTRIBUTE_NAME]&&e.add(t[u.a.SCOPE_ATTRIBUTE_NAME].scope),t&&t.parentNode?r(t.parentNode,e):e}function i(t,n,i){var o=Array.from(r(t,new Set)).reverse();return i&&o.push(i),e(n,o)}t.regexIndexOf=function(t,e,n){var r=t.substring(n||0).search(e);return r>=0?r+(n||0):r},t.evalInContext=e,t.getFirstKey=function(t){return(-1!==t.indexOf(".")?t.substring(0,t.indexOf(".")):t).replace(/ /g,"").split("(").join("").split(")").join("").replace(/!/g,"")},t.getAttributeCpShow=function(t){return t.getAttribute(u.a.SHOW_ATTRIBUTE_NAME)},t.getAttributeCpIf=function(t){return t.getAttribute(u.a.IF_ATTRIBUTE_NAME)},t.getAttributeCpElseIf=function(t){return t.getAttribute(u.a.ELSE_IF_ATTRIBUTE_NAME)},t.getAttributeCpElse=function(t){return t.getAttribute(u.a.ELSE_ATTRIBUTE_NAME)},t.getAttributeCpInit=function(t){return t.getAttribute(u.a.INIT_ATTRIBUTE_NAME)},t.getAttributeCpStyle=function(t){return t.getAttribute(u.a.STYLE_ATTRIBUTE_NAME)},t.getAttributeCpClass=function(t){return t.getAttribute(u.a.CLASS_ATTRIBUTE_NAME)},t.getAttributeCpSrc=function(t){return t.getAttribute(u.a.SRC_ATTRIBUTE_NAME)},t.getAttributeCpDisable=function(t){return t.getAttribute(u.a.DISABLE_ATTRIBUTE_NAME)},t.getAttributeCpFocus=function(t){return t.getAttribute(u.a.FOCUS_ATTRIBUTE_NAME)},t.getAttributeCpHide=function(t){return t.getAttribute(u.a.HIDE_ATTRIBUTE_NAME)},t.getAttributeCpBlur=function(t){return t.getAttribute(u.a.BLUR_ATTRIBUTE_NAME)},t.getScope=function(t){return t[u.a.SCOPE_ATTRIBUTE_NAME]},t.isComponent=n,t.insideComponent=function t(e){return!(!e||!e.parentNode)&&(!!n(e.parentNode)||t(e.parentNode))},t.executeFunctionCallback=function(t,e,n){return i(t,e,n)},t.isNative=function(t){return/{\s*\[native code]\s*}/.test(""+t)},t.destroyElement=function(t,e){t.$$cpDestroyed=!0,t.replaceWith&&t.replaceWith(e),c.default.destroyIfComponent(t)},t.createElement=function(t,e){t.$$cpDestroyed=!1,e.replaceWith&&e.replaceWith(t),c.default.constroyIfComponent(t,!0)},t.getAllScopes=r,t.evalInMultiContext=i,t.isValidCondition=function(t,e){return i(t,e)},t.appendBefore=function(t,e){t.parentNode.insertBefore(e,t)},t.appendAfter=function(t,e){t.parentNode.insertBefore(e,t.nextSibling)},t.setScopeId=function(t){t.id||(c.default.LAST_SCOPE_ID++,window.capivara.scopes.push(t),t.id=c.default.LAST_SCOPE_ID)},t.parentHasIgnore=function t(e){return!(!e.hasAttribute||!e.hasAttribute(u.a.IGNORE_BINDINGS)&&"CP-TRANSCLUDE"!==e.nodeName)||(e.parentNode?t(e.parentNode):void 0)},t.parentHasRepeat=function t(e){return e.classList&&e.classList.contains("binding-repeat")?e:e.parentNode?t(e.parentNode):void 0},t.getFunctionArgs=function(t){return(t+"").replace(/[/][/].*$/gm,"").replace(/\s+/g,"").replace(/[/][*][^/*]*[*][/]/g,"").split("){",1)[0].replace(/^[^(]*[(]/,"").replace(/=[^,]+/g,"").split(",").filter(Boolean)},t.deepText=function t(e){var n=[];if(e)for(e=e.firstChild;null!=e;)3===e.nodeType?n[n.length]=e:n=n.concat(t(e)),e=e.nextSibling;return n},t.get=function(t,e){return o()(t,e)},t.set=function(t,e,n){return s()(t,e,n)}}(r||(r={}))},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={SCOPE_ATTRIBUTE_NAME:"$scope",EVENT_ATTRIBUTE_NAME:"$event",REPEAT_ATTRIBUTE_NAME:"cp-repeat",REPEAT_INDEX_NAME:"$index",REPEAT_ATTRIBUTE_OPERATOR:"in",MODEL_ATTRIBUTE_NAME:"cp-model",CLICK_ATTRIBUTE_NAME:"cp-click",DBLCLICK_ATTRIBUTE_NAME:"cp-dblclick",SHOW_ATTRIBUTE_NAME:"cp-show",IF_ATTRIBUTE_NAME:"cp-if",STEP_ATTRIBUTE_NAME:"cp-step",MAX_ATTRIBUTE_NAME:"cp-max",MAX_LENGTH_ATTRIBUTE_NAME:"cp-maxlength",MIN_ATTRIBUTE_NAME:"cp-min",ELSE_ATTRIBUTE_NAME:"cp-else",ELSE_IF_ATTRIBUTE_NAME:"cp-else-if",INIT_ATTRIBUTE_NAME:"cp-init",STYLE_ATTRIBUTE_NAME:"cp-style",CLASS_ATTRIBUTE_NAME:"cp-class",SRC_ATTRIBUTE_NAME:"cp-src",KEY_ATTRIBUTE_NAME:"cp-key",ATTR_ATTRIBUTE_NAME:"cp-attr",DISABLE_ATTRIBUTE_NAME:"cp-disabled",START_INTERPOLATION:"[[",END_INTERPOLATION:"]]",IGNORE_BINDINGS:"cp-non-bindable",FOCUS_ATTRIBUTE_NAME:"cp-focus",HIDE_ATTRIBUTE_NAME:"cp-hide",BLUR_ATTRIBUTE_NAME:"cp-blur",TITLE_ATTRIBUTE_NAME:"cp-title",PLACEHOLDER_ATTRIBUTE_NAME:"cp-placeholder",MOUSE_ATTRIBUTE_NAME:"cp-mouse",CHANGE_ATTRIBUTE_NAME:"cp-change"}},function(t,e,n){"use strict";n.r(e);var r=n(10),i=n(7),o=function(t){return function(e){var n={template:t.template,style:t.style,constants:t.constants,functions:t.functions,bindings:t.bindings,controllerAs:t.controllerAs,controller:e};s.component(t.tag,n)}},a=function(t,e){this.$scope=t,this.$element=e};n.d(e,"Capivara",function(){return s}),n.d(e,"Component",function(){return o}),n.d(e,"Controller",function(){return a});var s=function(t,e){return t[e]?console.warn("Gee! CapivaraJS tried to load more than once."):(t[e]=new i.a,t[e].core={Eval:r.a,Component:o,Controller:a,Capivara:s}),t[e]}(window,"capivara");e.default=s},function(t,e,n){"use strict";var r,i,o;!function(t){var e="__observer__";function n(t,e,n){var r=t[e],i=r;delete t[e]&&Object.defineProperty(t,e,{get:function(){return i},set:function(o){r=i;var a=i=o;return r!==o&&n([{type:"update",object:t,name:e,oldValue:r}]),a},enumerable:!0,configurable:!0})}t.watchProperty=n,t.updateProperties=function(t,e,r){for(var i=t.added,a=t.deleted,s=!!i.length,c=!!a.length,u=t.all,l=u.length,p=[],h=0;h<l;h++)n(e,u[h],r),s&&h<=i.length&&p.push({type:"add",object:e,name:i[h]}),c&&h<=a.length&&p.push({type:"deleted",object:e,name:a[h]});o.destroy(e),o.create(e,r),r(p)},t.unWatchProperty=function(t,e){var n=t[e];delete t[e],t[e]=n},t.setDirtyCheck=function(t,n,r){Object.defineProperty(t,e,{enumerable:!1,configurable:!0,writable:!1,value:setInterval(r,n)})},t.clearDirtyCheck=function(t){clearInterval(t[e]),delete t[e]}}(r||(r={})),function(t){t.compare=function(t,e){if(!(t instanceof Array&&e instanceof Array))throw new TypeError("#compare accepts two parameters, both being Arrays.");if(t.length!==e.length)return!1;for(var n=0,r=t.length;n<r;n++)if(t[n]instanceof Array&&e[n]instanceof Array){if(!this.compare(t[n],e[n]))return!1}else if(t[n]!==e[n])return!1;return!0},t.diff=function(t,e){if(!(t&&e&&t instanceof Array&&e instanceof Array))throw new TypeError("#diff accepts two parameters, both being Arrays.");var n=[],r={},i=t.length,o=e.length;r.added=[],r.deleted=[],r.all=[];for(var a=0;a<i;a++)n[t[a]]=1;for(var s=0;s<o;s++)if(n[e[s]])try{delete n[e[s]]}catch(t){}else n[e[s]]=2;for(var c in n)c&&(r.all.push(c),1===n[c]?r.deleted.push(c):r.added.push(c));return r},t.keys=function(t){if("[object Object]"!==Object.prototype.toString.call(t)&&!Array.isArray(t))return[];var e=[];for(var n in t)n&&e.push(n);return e},t.clone=function(t){var e=[];for(var n in t)n&&(e[n]=t[n]);return e}}(i||(i={})),n.d(e,"a",function(){return o}),function(t){var e=new WeakMap;t.observe=function(t,n){if(t)if(e.has(t)){var r=e.get(t);r.push(n),e.set(t,r)}else e.set(t,[n]),this.create(t,function(n){(e.get(t)||[]).forEach(function(t){t(n)})})},t.unobserve=function(t){this.destroy(t),e.delete(t)},t.create=function(t,e,n){if(void 0===n&&(n=[]),t&&t.__observer__)return!1;n.push(t);var o=i.keys(t),a=o.length;r.setDirtyCheck(t,50,function(){i.compare(o,i.keys(t))||(r.updateProperties(i.diff(o,i.keys(t)),t,e),o=i.keys(t))});for(var s=0;s<a;s++)"[object Object]"===Object.prototype.toString.call(t[o[s]])||Array.isArray(t[o[s]])?-1!==n.indexOf(t[o[s]])||t[o[s]].__observer__||this.create(t[o[s]],e,n):r.watchProperty(t,o[s],e)},t.destroy=function(t,e){if(void 0===e&&(e=[]),!t||!t.__observer__)return!1;e.push(t);var n=Object.keys(t),i=n.length;r.clearDirtyCheck(t);for(var o=0;o<i;o++)"[object Object]"===Object.prototype.toString.call(t[n[o]])||Array.isArray(t[n[o]])?-1===e.indexOf(t[n[o]])&&t[n[o]].__observer__&&this.destroy(t[n[o]],e):r.unWatchProperty(t,n[o])}}(o||(o={}))},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n(11),i=function(t,e){e(new r.a(t).getScopeProxy())}},function(t,e,n){"use strict";var r,i,o=n(16),a=n.n(o),s=n(0),c=n(1),u=n(2),l=n(6),p=n(4),h=function(){function t(t){t&&(this.successor=t)}return t.prototype.getContext=function(t){return window[this.name]?this.process(t):this.successor?this.successor.getContext(t):void 0},t}(),f=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),d=function(t){function e(e){var n=t.call(this,e)||this;return n.name="ng",n}return f(e,t),e.prototype.process=function(t){var e=window[this.name].probe(t);if(e&&e._debugContext&&e._debugContext.context)return e._debugContext.context},e}(h),E=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),m=function(t){function e(e){var n=t.call(this,e)||this;return n.name="angular",n}return E(e,t),e.prototype.process=function(t){return window[this.name].element(t).scope()},e}(h),y=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_=function(t){function e(e){var n=t.call(this,e)||this;return n.name="capivara",n}return y(e,t),e.prototype.process=function(t){return s.a.isComponent(t)&&t.parentNode&&t.parentNode[c.a.SCOPE_ATTRIBUTE_NAME]?t.parentNode[c.a.SCOPE_ATTRIBUTE_NAME].scope:t&&t[c.a.SCOPE_ATTRIBUTE_NAME]?t[c.a.SCOPE_ATTRIBUTE_NAME].scope:void 0},e}(h),v=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),A=function(t){function e(e){var n=t.call(this,e)||this;return n.name="React",n}return v(e,t),e.prototype.constainsAttr=function(t,e){var n;for(var r in e)if(r.startsWith("__reactInternalInstance$")){n=r;break}return n},e.prototype.process=function(t){var e=this.constainsAttr("__reactInternalInstance$",t);if(e){var n=t[e];if(n&&n._debugOwner)return n._debugOwner.stateNode}else if(t.parentElement)return this.process(t.parentElement)},e.prototype.teste=function(t){return t.parentElement&&t.parentElement.startsWith("__reactInternalInstance$")?t.parentElement.startsWith("__reactInternalInstance$"):t.parentElement?this.teste(t.parentElement):void 0},e}(h),b=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),g=function(t){function e(e){var n=t.call(this,e)||this;return n.name="Vue",n}return b(e,t),e.prototype.process=function(t){return t.parentElement&&t.parentElement.__vue__?t.parentElement.__vue__:t.parentElement?this.process(t.parentElement):void 0},e}(h);(r||(r={})).getContext=function(t){return s.a.insideComponent(t)?(new _).getContext(t):new m(new d(new g(new A(new _)))).getContext(t)},(i||(i={})).getContext=function(t){return r.getContext(t)};var T=n(3);n.d(e,"a",function(){return C});var C=function(){function t(t,e){this.constantsValue={},this.functionsValue={},this.bindingsValue={},this.listenerContextBindings={},e.controllerAs=e.controllerAs||"$ctrl",this.element=t,this.element.$instance=this,this.config=e,this.config.controller=this.config.controller||function(){},this.renderTemplate(),this.destroyed=!0,this.registerController()}return t.prototype.renderTemplate=function(){if(this.config.template)if(DOMParser){var t=(new DOMParser).parseFromString(this.config.template,"text/html"),e=(new DOMParser).parseFromString(this.element.innerHTML,"text/html");e&&t&&e.querySelectorAll?(Array.from(e.querySelectorAll("cp-transclude")||[]).forEach(function(e){var n=e.getAttribute("name"),r=e.nodeName.toLowerCase()+(n?'[name="'+n+'"]':"");Array.from(t.querySelectorAll(r)||[]).forEach(function(t){Array.from(e.children).forEach(function(e){s.a.appendAfter(t,e)}),t.parentNode.removeChild(t)})}),this.element.innerHTML=t.body.innerHTML):this.element.innerHTML=this.config.template}else this.element.innerHTML=this.config.template},t.prototype.registerController=function(){var t=this;new p.a(this.element,function(e){t.componentScope=e})},t.prototype.initController=function(){var t;if(this.destroyed){if(this.destroyed=!1,this.config.controller){var e=[this.componentScope.element[c.a.SCOPE_ATTRIBUTE_NAME],this.componentScope.mapDom.element,this.componentScope.mapDom];this.componentScope[this.config.controllerAs]=new((t=this.config.controller).bind.apply(t,[void 0].concat(e)))}this.contextObj=i.getContext(this.element),this.applyConstantsComponentMagic(),this.applyFunctionsComponentMagic(),this.applyBindingsComponentMagic(),this.componentScope[this.config.controllerAs]&&this.componentScope[this.config.controllerAs].$onInit&&this.componentScope[this.config.controllerAs].$onInit(),Object.defineProperty(this.componentScope,"__$controllerAs__",{value:this.config.controllerAs,configurable:!0});var n=s.a.getScope(this.element);n.$emit("$onInit"),n.mapDom.reload()}},t.prototype.build=function(){this.applyConstantsComponentBuilder(),this.applyFunctionsComponentBuilder(),this.contextObj&&this.applyBindingsComponentBuilder();var t=s.a.getScope(this.element);t.scope.$ctrl.$onBuild&&t.scope.$ctrl.$onBuild()},t.prototype.create=function(){this.initController()},t.prototype.destroy=function(){var t=this;this.destroyed=!0,this.element[c.a.SCOPE_ATTRIBUTE_NAME].destroy(),T.a.unobserve(this.componentScope[this.config.controllerAs]),this.componentScope[this.config.controllerAs]&&this.componentScope[this.config.controllerAs].$destroy&&this.componentScope[this.config.controllerAs].$destroy(),this.componentScope[this.config.controllerAs]&&this.componentScope[this.config.controllerAs].$onDestroy&&this.componentScope[this.config.controllerAs].$onDestroy();try{window.capivara.scopes=window.capivara.scopes.filter(function(e){return e.id!==t.componentScope.element[c.a.SCOPE_ATTRIBUTE_NAME].id&&e.id!==t.contextObj.element[c.a.SCOPE_ATTRIBUTE_NAME].id})}catch(t){}},t.prototype.context=function(t){return this.contextObj=t,this},t.prototype.bindings=function(t){return void 0===t&&(t={}),this.contextObj?(this.bindingsValue=Object.assign(this.bindingsValue,t),this):(console.error("Bindings ainda não aplicados. Primeiro, é necessário informar o contexto."),this)},t.prototype.applyBindingsComponentBuilder=function(){var t=this;(this.config.bindings||[]).forEach(function(e){t.setAttributeValue(t.bindingsValue,e),t.createObserverContext(t.bindingsValue,e)}),this.createObserverScope(this.bindingsValue)},t.prototype.applyBindingsComponentMagic=function(){var t=this;s.a.getScope(this.element).scope[this.config.controllerAs].$bindings||(s.a.set(s.a.getScope(this.element).scope,this.config.controllerAs+".$bindings",{}),s.a.set(s.a.getScope(this.element).scope,"$bindings",{})),(this.config.bindings||[]).forEach(function(e){var n=e.replace(/([A-Z])/g,"-$1").toLowerCase(),r=t.element.getAttribute(n);r&&(t.bindingsValue[e]=r,t.setAttributeValue(t.bindingsValue,e),t.createObserverContext(t.bindingsValue,e))}),this.createObserverScope(this.bindingsValue)},t.prototype.createObserverScope=function(t){var e=this;void 0===t&&(t={});var n=s.a.getScope(this.element).scope[this.config.controllerAs];Object.defineProperty(n,"_$$checkBindings",{value:function(n){n.forEach(function(n){"update"===n.type&&t.hasOwnProperty(n.name)&&(s.a.set(e.contextObj,t[n.name],n.object[n.name]),e.forceUpdateContext())})},writable:!0,configurable:!0})},t.prototype.forceUpdateContext=function(){if(this.contextObj&&(this.contextObj.$forceUpdate&&this.contextObj.$forceUpdate(),this.contextObj.$apply&&this.contextObj.$apply(),this.contextObj.forceUpdate&&this.contextObj.forceUpdate(),window.ng)){var t=window.ng.probe(this.element);t&&t.injector.get(window.ng.coreTokens.ApplicationRef).tick()}},t.getFirstAttribute=function(t,e){return void 0===t&&(t={}),-1!==t[e].indexOf(".")?t[e].substring(0,t[e].indexOf(".")):t[e]},t.prototype.observeAndSetValues=function(t,e,n){var r=this;T.a.observe(t,function(){r.setAttributeValue(e,n)})},t.prototype.createObserverContext=function(e,n){var r=this;if(e[n])if(this.contextObj instanceof l.a)this.contextObj[this.config.controllerAs]?this.observeAndSetValues(this.contextObj[this.config.controllerAs],e,n):this.observeAndSetValues(this.contextObj,e,n);else{var i=t.getFirstAttribute(e,n);a.a.watch(this.contextObj,i,function(){r.setAttributeValue(e,n)},1)}},t.prototype.setAttributeRecursive=function(t,e){var n=this,r=s.a.getScope(t).scope,i=e.replace(/([A-Z])/g,"-$1").toLowerCase();Object.keys(u.Capivara.components).forEach(function(t){var o=t.toLowerCase();Array.from(n.element.querySelectorAll(o)).forEach(function(t){if(t.firstChild){var o=s.a.getScope(t.firstChild).scope;s.a.set(o[n.config.controllerAs],"$bindings."+e,s.a.get(r,t.getAttribute(i)))}})})},t.prototype.setAttributeValue=function(t,e){void 0===t&&(t={});var n=s.a.parentHasRepeat(this.element),r=s.a.getScope(this.element).scope;if(this.contextObj instanceof l.a&&t[e].startsWith(this.config.controllerAs)&&n){var i=s.a.getScope(n);i.$parent&&(s.a.set(r,this.config.controllerAs+".$bindings."+e,s.a.get(i.$parent.scope,t[e])),s.a.set(r,"$bindings."+e,s.a.get(i.$parent.scope,t[e])))}else s.a.set(r[this.config.controllerAs],"$bindings."+e,s.a.get(this.contextObj,t[e])),s.a.set(r,"$bindings."+e,s.a.get(this.contextObj,t[e]));this.setAttributeRecursive(this.element,e),r[this.config.controllerAs]&&r[this.config.controllerAs].$onChanges&&r[this.config.controllerAs].$onChanges()},t.prototype.constants=function(t){return void 0===t&&(t={}),this.constantsValue=t,this},t.prototype.applyConstantsComponentMagic=function(){var t=this;s.a.getScope(this.element).scope[this.config.controllerAs].$constants||(s.a.set(s.a.getScope(this.element).scope,this.config.controllerAs+".$constants",{}),s.a.set(s.a.getScope(this.element).scope,"$constants",{})),(this.config.constants||[]).forEach(function(e){var n=e.replace(/([A-Z])/g,"-$1").toLowerCase(),r=t.element.getAttribute(n);if(r){var i=s.a.evalInContext(r,t.contextObj);s.a.set(s.a.getScope(t.element).scope,t.config.controllerAs+".$constants."+e,i),s.a.set(s.a.getScope(t.element).scope,"$constants."+e,i)}})},t.prototype.applyConstantsComponentBuilder=function(){var t=this;(this.config.constants||[]).forEach(function(e){s.a.set(s.a.getScope(t.element).scope,t.config.controllerAs+".$constants."+e,t.constantsValue[e]),s.a.set(s.a.getScope(t.element).scope,"$constants."+e,t.constantsValue[e])})},t.prototype.functions=function(t){return void 0===t&&(t={}),this.functionsValue=t,this},t.prototype.applyFunctionsComponentMagic=function(){var t=this;s.a.getScope(this.element).scope[this.config.controllerAs].$functions||(s.a.set(s.a.getScope(this.element).scope,this.config.controllerAs+".$functions",{}),s.a.set(s.a.getScope(this.element).scope,"$functions",{})),(this.config.functions||[]).forEach(function(e){var n=e.replace(/([A-Z])/g,"-$1").toLowerCase(),r=t.element.getAttribute(n);if(r){var i=r.indexOf("("),o=-1!==i?s.a.get(t.contextObj,r.substring(0,i)):s.a.get(t.contextObj,r);o&&(Object.defineProperty(o,"__ctx__",{value:t.contextObj,configurable:!0}),s.a.set(s.a.getScope(t.element).scope,t.config.controllerAs+".$functions."+e,o),s.a.set(s.a.getScope(t.element).scope,"$functions."+e,o))}})},t.prototype.applyFunctionsComponentBuilder=function(){var t=this;(this.config.functions||[]).forEach(function(e){s.a.set(s.a.getScope(t.element).scope,t.config.controllerAs+".$functions."+e,t.functionsValue[e]),s.a.set(s.a.getScope(t.element).scope,"$functions."+e,t.functionsValue[e])})},t}()},function(t,e,n){"use strict";n.d(e,"a",function(){return o});var r=n(1),i=n(3),o=function(){function t(t,e,n){this.mapDom=e,this.element=n,this.createWatcherScope(t,this)}return t.prototype.createWatcherScope=function(t,e){var n=this;this.element.$instance&&t.$on("$onInit",function(){i.a.observe(e[n.element.$instance.config.controllerAs],function(i){i.length>0&&n.updateScopes(e.element[r.a.SCOPE_ATTRIBUTE_NAME]),t.$emit("$onChanges",i),n.executeObservers(e,"$onChanges",i),n.executeObservers(e,"_$$checkBindings",i)})})},t.prototype.updateScopes=function(t){t.$parent?this.updateScopes(t.$parent):t.mapDom.reload()},t.prototype.executeObservers=function(t,e,n){t[this.element.$instance.config.controllerAs][e]&&t[this.element.$instance.config.controllerAs][e](n)},t}()},function(t,e,n){"use strict";n.d(e,"a",function(){return s});var r=n(1),i=n(11),o=n(9),a=n(5),s=function(){function t(){var t=this;this.LAST_SCOPE_ID=0,this.DOMMutation=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,this.version="3.10.1",this.components={},this.scopes=[],this.$watchers=[],Element.prototype.hasOwnProperty("getAttributeStartingWith")||Object.defineProperty(Element.prototype,"getAttributeStartingWith",{value:function(t){return Array.from(this.attributes).filter(function(e){return 0===e.nodeName.indexOf(t)})},configurable:!0}),Element.prototype.hasOwnProperty("hasAttributeStartingWith")||Object.defineProperty(Element.prototype,"hasAttributeStartingWith",{value:function(t){return this.getAttributeStartingWith(t).length>0},configurable:!0}),"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll?setTimeout(function(){t.createListeners(),t.createComponents()}):document.addEventListener("DOMContentLoaded",function(e){t.createListeners(),t.createComponents()})}return t.prototype.createComponents=function(){var t=this;Object.keys(this.components).forEach(function(e){var n=document.querySelectorAll(e)||[];Array.from(n).forEach(function(e){t.constroyIfComponent(e)})})},t.prototype.hasRepeat=function(t){return t&&t.classList&&t.classList.contains("binding-repeat")},t.prototype.constroyIfComponent=function(t,e){var n=this,r=this.components[t.nodeName];!r||!e&&t.created||(t.created=!0,r.createNewInstance(t).create()),!t.children||!e&&this.hasRepeat(t)||(Array.from(t.children)||[]).forEach(function(t){n.constroyIfComponent(t,e)})},t.prototype.destroyIfComponent=function(t){var e=this;t.created=!1,t.$instance&&!t.$instance.destroyed&&t.$instance.destroy(),t.children&&(Array.from(t.children)||[]).forEach(function(t){return e.destroyIfComponent(t)})},t.prototype.onMutation=function(t){var e=this;(t||[]).forEach(function(t){"childList"===t.type&&((t&&t.addedNodes&&t.addedNodes.forEach?t.addedNodes:[]).forEach(function(t){e.constroyIfComponent(t)}),(t&&t.removedNodes&&t.removedNodes.forEach?t.removedNodes:[]).forEach(function(t){e.destroyIfComponent(t)}))})},t.prototype.createListeners=function(){var t=this;this.DOMMutation&&new this.DOMMutation(function(e){return t.onMutation(e)}).observe(document.body,{attributes:!1,childList:!0,subtree:!0,characterData:!1})},t.prototype.component=function(t,e){window.capivara.components[t]?console.error("A registered component with this name already exists."):window.capivara.components[t.toUpperCase()]=new o.a(t,e)},t.prototype.componentBuilder=function(t){return new Promise(function(e){var n,r=window.capivara.isElement(t)?[t]:Array.from(document.querySelectorAll("[\\#"+t+"]"));0===r.length&&console.error("CapivaraJS did not find its component with the hash "+t),setTimeout(function(){var i=(((r=window.capivara.isElement(t)?[t]:Array.from(document.querySelectorAll("[\\#"+t+"]")))||[]).forEach(function(t){window.capivara.components[t.nodeName]?n||(n=t.$instance):console.error("We did not find a registered entry under the name: "+t.nodeName)}),n);e(i)})})},t.prototype.controller=function(t,e){new a.a(t,{controller:e}).create()},t.prototype.isArray=function(t){return Array.isArray(t)||t instanceof Array},t.prototype.isObject=function(t){return null!==t&&"object"==typeof t},t.prototype.isObjectConstructor=function(t){return!!t&&"Object"===t.__proto__.constructor.name},t.prototype.isDate=function(t){return"[object Date]"===toString.call(t)},t.prototype.isElement=function(t){return!(!t||!(t.nodeName||t.prop&&t.attr&&t.find))},t.prototype.isFunction=function(t){return"function"==typeof t},t.prototype.isNumber=function(t){return"number"==typeof t},t.prototype.isString=function(t){return"string"==typeof t},t.prototype.merge=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Object.assign.apply(Object,t)},t.prototype.copy=function(t){return Object.assign(t)},t.prototype.replaceAll=function(t,e,n){return t.split(e).join(n)},t.prototype.constants=function(t){Object.keys(t).forEach(function(e){r.a[e]&&(r.a[e]=t[e])})},t.prototype.$on=function(t,e){window.capivara.$watchers.push({evtName:t,callback:e})},t.prototype.$emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];window.capivara.$watchers.filter(function(e){return e.evtName===t}).forEach(function(t){t.callback.apply(t,e)})},t.prototype.simpleCompare=function(t,e){return t===e||t!=t&&e!=e},t.prototype.isRegExp=function(t){return"[object RegExp]"===toString.call(t)},t.prototype.isDefined=function(t){return void 0!==t},t.prototype.isWindow=function(t){return t&&t.window===t},t.prototype.isScope=function(t){return t instanceof i.a},t.prototype.equals=function(t,e){if(t===e)return!0;if(null===t||null===e)return!1;if(t!=t&&e!=e)return!0;var n,r,i,o=typeof t;if(o===typeof e&&"object"===o){if(!this.isArray(t)){if(this.isDate(t))return!!this.isDate(e)&&this.simpleCompare(t.getTime(),e.getTime());if(this.isRegExp(t))return!!this.isRegExp(e)&&t.toString()===e.toString();if(this.isScope(t)||this.isScope(e)||this.isWindow(t)||this.isWindow(e)||this.isArray(e)||this.isDate(e)||this.isRegExp(e))return!1;for(r in i=Object.create(null),t)if("$"!==r.charAt(0)&&!this.isFunction(t[r])){if(!this.equals(t[r],e[r]))return!1;i[r]=!0}for(r in e)if(!(r in i)&&"$"!==r.charAt(0)&&this.isDefined(e[r])&&!this.isFunction(e[r]))return!1;return!0}if(!this.isArray(e))return!1;if((n=t.length)===e.length){for(r=0;r<n;r++)if(!this.equals(t[r],e[r]))return!1;return!0}}return!1},t}()},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",function(){return Eval});var _common__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(0),Eval;!function(Eval){function replaceAt(t,e,n,r,i){return t.slice(0,r)+t.slice(r,i).replace(e,n)+t.slice(i)}function getIndexStart(t,e){if(0===e)return 0;var n=function(e,r){var i=e-1;return-1===i?r:(r+=t[i].length,n(i,r))};return n(e,0)}function isVariable(t){void 0===t&&(t="");var e=t.charAt(0);return/[a-zA-Z]/g.test(e)||"$"===e||"_"===e}function evaluation(source,context,prefix){void 0===prefix&&(prefix="");var contexts=Array.isArray(context)?context:[context],referenceSelf="this."+(prefix?prefix+=".":""),regex=/\$*[a-z0-9.$]+\s*/gi,keys=source.match(regex);keys&&Array.isArray(keys)&&keys.forEach(function(t,e){var n=t.replace(/\s/g,""),r=getIndexStart(keys,e),i=r+source.substring(r,source.length).indexOf(n)+n.length;n.includes(referenceSelf)||(prefix.trim()?isVariable(n):contexts.filter(function(t){return t.hasOwnProperty(_common__WEBPACK_IMPORTED_MODULE_0__.a.getFirstKey(n))}).length>0)&&(source=replaceAt(source,n,""+referenceSelf+n,r,i))});try{return function executeCode(str){var _this=this;return(contexts||[]).forEach(function(t){return Object.keys(t).forEach(function(e){_this[e]||(_this[e]=t[e])})}),eval(str)}.call({},source)}catch(t){throw t}}function exec(t,e){try{var n=Array.isArray(e)?e:[e],r=Object.assign.apply(Object,[{}].concat(n)),i=Object.keys(r),o=i.map(function(t){return r[t]}),a=(new(Function.bind.apply(Function,[void 0].concat(i,["\n const value = "+t+";\n return value == undefined ? '' : Number.isNaN(value) ? 0 : value;\n "])))).apply(void 0,o);return void 0===a?evaluation(t,e):a}catch(n){return evaluation(t,e)}}Eval.replaceAt=replaceAt,Eval.getIndexStart=getIndexStart,Eval.isVariable=isVariable,Eval.evaluation=evaluation,Eval.exec=exec}(Eval||(Eval={}))},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n(5),i=function(){function t(t,e){this.componentName=t,this.config=e,this.customElementsVue()}return t.prototype.customElementsVue=function(){var t=this;window.Vue&&(window.Vue.config.ignoredElements=window.Vue.config.ignoredElements||[],0===window.Vue.config.ignoredElements.filter(function(e){return e===t.componentName}).length&&window.Vue.config.ignoredElements.push(this.componentName))},t.prototype.createNewInstance=function(t){return new r.a(t,this.config)},t}()},function(t,e,n){"use strict";n(7),n(4),n(5),n(9);var r=n(8);n.d(e,"a",function(){return r.a}),n(3)},function(t,e,n){"use strict";var r,i=n(0),o=n(1),a=function(){function t(t){this.element=t,this.events={},"string"==typeof t&&(t=document.querySelector(t))}return t.prototype.on=function(t,e){var n=this;this.events[t]?this.events[t].push(e):(this.events[t]=[e],this.onEvent||(this.onEvent=function(t){(n.events[t.type]||[]).forEach(function(e){return e(t)})}),this.element.addEventListener(t,this.onEvent))},t.prototype.destroy=function(){var t=this;Object.keys(this.events).forEach(function(e){t.element.removeEventListener(e,t.onEvent)})},t}(),s=n(8),c=n(2),u=function(){function t(t,e){var n=this;this.attributes=[],this.element=t,this.map=e,Array.from(this.element.attributes).forEach(function(t){if(t.nodeName&&t.nodeName.startsWith(o.a.ATTR_ATTRIBUTE_NAME)){if(!t.value)throw new Error("syntax error "+o.a.ATTR_ATTRIBUTE_NAME+" expected arguments");n.attributes.push(t.name)}})}return t.prototype.create=function(){this.init()},t.prototype.init=function(){var t=this;this.attributes.forEach(function(e){var n=t.element.getAttribute(e),r=e.replace(o.a.ATTR_ATTRIBUTE_NAME+".",""),a=i.a.evalInMultiContext(t.element,n);void 0===a||null===a?t.element.setAttribute(r,""):t.element.setAttribute(r,a)})},t}(),l=function(){function t(t,e){if(this.element=t,this.map=e,this.element.cpBlur=this,this.attribute=i.a.getAttributeCpBlur(this.element),void 0===this.attribute)throw new Error("syntax error "+o.a.BLUR_ATTRIBUTE_NAME+" expected arguments")}return t.prototype.create=function(){this.init()},t.prototype.onBlur=function(t){var e;i.a.executeFunctionCallback(t.target.cpBlur.element,t.target.cpBlur.attribute,((e={})[o.a.EVENT_ATTRIBUTE_NAME]=t,e))},t.prototype.init=function(){this.element.removeEventListener("blur",this.onBlur),this.element.addEventListener("blur",this.onBlur)},t}(),p=function(){function t(t,e){if(this.element=t,this.map=e,this.attribute=this.element.getAttribute(o.a.CHANGE_ATTRIBUTE_NAME),!this.attribute)throw new Error("syntax error "+o.a.CHANGE_ATTRIBUTE_NAME+" expected arguments");if(!this.element.hasAttribute(o.a.MODEL_ATTRIBUTE_NAME))throw new Error("syntax error "+o.a.MODEL_ATTRIBUTE_NAME+" expected arguments")}return t.prototype.create=function(){this.init()},t.prototype.onModelChange=function(t,e){i.a.executeFunctionCallback(this.element,this.attribute,{$newValue:t,$oldValue:e})},t.prototype.init=function(){var t=this.element.getAttribute(o.a.MODEL_ATTRIBUTE_NAME).replace(i.a.getScope(this.element).scope.__$controllerAs__+".","");i.a.getScope(this.element).$unwatch(t,this.onModelChange),i.a.getScope(this.element).$watch(t,this.onModelChange,this)},t}(),h=function(){function t(t,e){this.element=t,this.element.cpClass=this,this.map=e,this.attribute=i.a.getAttributeCpClass(this.element),this.elementComment=document.createComment("cpClass "+this.attribute),this.elmScope=i.a.getScope(t)}return t.prototype.create=function(){this.init()},t.prototype.setClassByObject=function(t){var e=this;t&&window.capivara.isObject(t)&&Object.keys(t).forEach(function(n){t[n]?e.addClass(n.replace(/ /g,"")):e.removeClass(n.replace(/ /g,""))})},t.prototype.init=function(){var t=this;try{this.attribute.split(",").map(function(e){return{key:e.substring(0,e.indexOf(":")).replace(/'/g,"").replace(/"/,"").replace(/{/g,"").replace(/}/,""),value:i.a.evalInMultiContext(t.element,e.substring(e.indexOf(":")+1,e.length).replace(/{/g,"").replace(/}/,""))}}).forEach(function(e){window.capivara.isObject(e.value)?t.setClassByObject(e.value):e.value?t.addClass(e.key.replace(/ /g,"")):t.removeClass(e.key.replace(/ /g,""))})}catch(t){}},t.prototype.removeClass=function(t){this.element.classList&&this.element.classList.contains(t)?this.element.classList.remove(t):this.element.classList||-1===this.element.className.indexOf(t)||(this.element.className=this.element.className.replace(t,""))},t.prototype.addClass=function(t){this.element.classList&&!this.element.classList.contains(t)?this.element.classList.add(t):this.element.classList||-1!==this.element.className.indexOf(t)||(this.element.className+=" "+t)},t}(),f=function(){function t(t,e){if(this.element=t,this.map=e,this.attribute=this.element.getAttribute(o.a.CLICK_ATTRIBUTE_NAME),this.eventName="click",this.attribute||(this.attribute=this.element.getAttribute(o.a.DBLCLICK_ATTRIBUTE_NAME),this.eventName="dblclick"),!this.attribute)throw new Error("syntax error cp-"+this.eventName+" expected arguments")}return t.prototype.create=function(){this.init()},t.prototype.getIndexRow=function(t){var e=i.a.get(i.a.getScope(t).scope,o.a.REPEAT_INDEX_NAME);return void 0===e&&t.parentNode?this.getIndexRow(t.parentNode):e},t.prototype.init=function(){var t=this,e=function(e){var n;t.attribute=t.attribute.trim(),i.a.executeFunctionCallback(t.element,t.attribute,((n={})[o.a.EVENT_ATTRIBUTE_NAME]=e,n))};this.element.removeEventListener(this.eventName,e),this.element.addEventListener(this.eventName,e)},t}(),d=function(){function t(t,e){if(this.element=t,this.attribute=i.a.getAttributeCpDisable(this.element),!this.attribute)throw new Error("syntax error "+o.a.DISABLE_ATTRIBUTE_NAME+" expected arguments")}return t.prototype.create=function(){this.init()},t.prototype.init=function(){try{JSON.parse(i.a.isValidCondition(this.element,i.a.getAttributeCpDisable(this.element)))?this.elementDisabled():this.elementEnabled()}catch(t){this.elementEnabled()}},t.prototype.elementDisabled=function(){this.element.setAttribute("disabled",!0)},t.prototype.elementEnabled=function(){this.element.removeAttribute("disabled")},t}(),E=function(){function t(t,e){if(this.element=t,i.a.getAttributeCpElse(this.element))throw new Error(o.a.ELSE_ATTRIBUTE_NAME+" don't expect arguments");this.prevElement=t.previousSibling,this.map=e,this.elementComment=document.createComment("cpElse")}return t.prototype.create=function(){if(!this.element.hasAttribute(o.a.REPEAT_ATTRIBUTE_NAME)){if(this.parentCondition=i.a.getScope(this.element).parentCondition,!this.parentCondition)throw new Error("syntax error "+o.a.ELSE_ATTRIBUTE_NAME+" used on element <"+this.element.nodeName.toLowerCase()+"> without corresponding "+o.a.IF_ATTRIBUTE_NAME+".");this.init()}},t.prototype.hasValidCondition=function(t,e){return t&&(t.hasAttribute&&t.hasAttribute(o.a.IF_ATTRIBUTE_NAME)||8===t.nodeType&&-1!==t.data.indexOf("cpIf"))?!(t.$$cpDestroyed||8===t.nodeType&&-1!==t.data.indexOf("cpIf")&&0===e.length):t&&t.previousSibling?(t.hasAttribute&&t.hasAttribute(o.a.ELSE_IF_ATTRIBUTE_NAME)&&e.push(t),this.hasValidCondition(t.previousSibling,e)):void 0},t.prototype.init=function(){if(this.element&&!this.element.hasAttribute(o.a.REPEAT_ATTRIBUTE_NAME))try{i.a.createElement(this.element,this.elementComment),this.hasValidCondition(this.element,[])&&i.a.destroyElement(this.element,this.elementComment)}catch(t){i.a.destroyElement(this.element,this.elementComment)}},t}(),m=function(){function t(t,e){if(this.element=t,this.element.cpElseIf=this,this.attribute=i.a.getAttributeCpElseIf(this.element),!this.attribute)throw new Error("syntax error "+o.a.ELSE_IF_ATTRIBUTE_NAME+" expected arguments");this.prevElement=t.previousSibling,this.map=e,this.elementComment=document.createComment("CPElseIf "+this.attribute)}return t.prototype.create=function(){if(!this.element.hasAttribute(o.a.REPEAT_ATTRIBUTE_NAME)){if(this.integrationCpElse(),this.parentCondition=i.a.getScope(this.element).parentCondition,!this.parentCondition)throw new Error("syntax error "+o.a.ELSE_IF_ATTRIBUTE_NAME+" used on element <"+this.element.nodeName.toLowerCase()+"> without corresponding "+o.a.IF_ATTRIBUTE_NAME+".");this.init()}},t.prototype.integrationCpElse=function(){var t=this.element.nextElementSibling;t&&(t.hasAttribute(o.a.ELSE_ATTRIBUTE_NAME)||t.hasAttribute(o.a.ELSE_IF_ATTRIBUTE_NAME))&&(i.a.getScope(t).parentCondition=this)},t.prototype.init=function(){if(this.element&&!this.element.hasAttribute(o.a.REPEAT_ATTRIBUTE_NAME))try{i.a.isValidCondition(this.parentCondition.element,i.a.getAttributeCpIf(this.parentCondition.element))?i.a.destroyElement(this.element,this.elementComment):(i.a.createElement(this.element,this.elementComment),i.a.isValidCondition(this.element,this.attribute)||i.a.destroyElement(this.element,this.elementComment))}catch(t){i.a.destroyElement(this.element,this.elementComment)}},t}(),y=function(){function t(t,e){if(this.element=t,this.map=e,this.element.cpFocus=this,this.attribute=i.a.getAttributeCpFocus(this.element),void 0===this.attribute)throw new Error("syntax error "+o.a.FOCUS_ATTRIBUTE_NAME+" expected arguments")}return t.prototype.create=function(){this.init()},t.prototype.onFocus=function(t){var e;i.a.executeFunctionCallback(t.target.cpFocus.element,t.target.cpFocus.attribute,((e={})[o.a.EVENT_ATTRIBUTE_NAME]=t,e))},t.prototype.init=function(){this.element.removeEventListener("focus",this.onFocus),this.element.addEventListener("focus",this.onFocus)},t}(),_=function(){function t(t,e){if(this.element=t,this.initialDisplay=this.element.style.display||"",this.map=e,this.attribute=i.a.getAttributeCpHide(this.element),!this.attribute)throw new Error("syntax error "+o.a.HIDE_ATTRIBUTE_NAME+" expected arguments")}return t.prototype.create=function(){this.init()},t.prototype.init=function(){try{i.a.isValidCondition(this.element,i.a.getAttributeCpHide(this.element))?this.hide():this.show()}catch(t){this.hide()}},t.prototype.hide=function(){this.element.style.display="none"},t.prototype.show=function(){this.element.style.display=this.initialDisplay},t}(),v=function(){function t(t,e){if(this.element=t,this.element.cpIf=this,this.map=e,this.attribute=i.a.getAttributeCpIf(this.element),!this.attribute)throw new Error("syntax error "+o.a.IF_ATTRIBUTE_NAME+" expected arguments");this.elementComment=document.createComment("cpIf "+this.attribute)}return t.prototype.create=function(){this.element.hasAttribute(o.a.REPEAT_ATTRIBUTE_NAME)||(this.integrationCpElse(),this.init())},t.prototype.integrationCpElse=function(){var t=this.element.nextElementSibling;t&&(t.hasAttribute(o.a.ELSE_ATTRIBUTE_NAME)||t.hasAttribute(o.a.ELSE_IF_ATTRIBUTE_NAME))&&(i.a.getScope(t).parentCondition=this)},t.prototype.init=function(){if(this.element&&!this.element.hasAttribute(o.a.REPEAT_ATTRIBUTE_NAME))try{i.a.isValidCondition(this.element,i.a.getAttributeCpIf(this.element))?i.a.createElement(this.element,this.elementComment):i.a.destroyElement(this.element,this.elementComment)}catch(t){i.a.destroyElement(this.element,this.elementComment)}},t}(),A=function(){function t(t,e){if(this.element=t,this.map=e,this.attribute=i.a.getAttributeCpInit(this.element),!this.attribute)throw new Error("syntax error "+o.a.INIT_ATTRIBUTE_NAME+" expected arguments")}return t.prototype.create=function(){this.init()},t.prototype.init=function(){this.attribute=this.attribute.trim(),i.a.evalInMultiContext(this.element,this.attribute)},t}();!function(t){t[t.BACKSPACE=8]="BACKSPACE",t[t.TAB=9]="TAB",t[t.ENTER=13]="ENTER",t[t.SHIFT=16]="SHIFT",t[t.CTRL=17]="CTRL",t[t.ALT=18]="ALT",t[t.PAUSEBREAK=19]="PAUSEBREAK",t[t.CAPSLOCK=20]="CAPSLOCK",t[t.ESCAPE=27]="ESCAPE",t[t.SPACE=32]="SPACE",t[t.PAGEUP=33]="PAGEUP",t[t.PAGEDOWN=34]="PAGEDOWN",t[t.END=35]="END",t[t.HOME=36]="HOME",t[t.LEFTARROW=37]="LEFTARROW",t[t.UPARROW=38]="UPARROW",t[t.RIGHTARROW=39]="RIGHTARROW",t[t.DOWNARROW=40]="DOWNARROW",t[t.INSERT=45]="INSERT",t[t.DELETE=46]="DELETE",t[t.ZERO=48]="ZERO",t[t.CLOSEDPAREN=48]="CLOSEDPAREN",t[t.ONE=49]="ONE",t[t.EXCLAMATIONMARK=49]="EXCLAMATIONMARK",t[t.TWO=50]="TWO",t[t.ATSIGN=50]="ATSIGN",t[t.THREE=51]="THREE",t[t.POUNDSIGN=51]="POUNDSIGN",t[t.HASH=51]="HASH",t[t.FOUR=52]="FOUR",t[t.DOLLARSIGN=52]="DOLLARSIGN",t[t.FIVE=53]="FIVE",t[t.PERCENTSIGN=53]="PERCENTSIGN",t[t.SIX=54]="SIX",t[t.CARET=54]="CARET",t[t.HAT=54]="HAT",t[t.SEVEN=55]="SEVEN",t[t.AMPERSAND=55]="AMPERSAND",t[t.EIGHT=56]="EIGHT",t[t.STAR=56]="STAR",t[t.ASTERIK=56]="ASTERIK",t[t.NINE=57]="NINE",t[t.OPENPAREN=57]="OPENPAREN",t[t.A=65]="A",t[t.B=66]="B",t[t.C=67]="C",t[t.D=68]="D",t[t.E=69]="E",t[t.F=70]="F",t[t.G=71]="G",t[t.H=72]="H",t[t.I=73]="I",t[t.J=74]="J",t[t.K=75]="K",t[t.L=76]="L",t[t.M=77]="M",t[t.N=78]="N",t[t.O=79]="O",t[t.P=80]="P",t[t.Q=81]="Q",t[t.R=82]="R",t[t.S=83]="S",t[t.T=84]="T",t[t.U=85]="U",t[t.V=86]="V",t[t.W=87]="W",t[t.X=88]="X",t[t.Y=89]="Y",t[t.Z=90]="Z",t[t.LEFTWINDOWKEY=91]="LEFTWINDOWKEY",t[t.RIGHTWINDOWKEY=92]="RIGHTWINDOWKEY",t[t.SELECTKEY=93]="SELECTKEY",t[t.NUMPAD0=96]="NUMPAD0",t[t.NUMPAD1=97]="NUMPAD1",t[t.NUMPAD2=98]="NUMPAD2",t[t.NUMPAD3=99]="NUMPAD3",t[t.NUMPAD4=100]="NUMPAD4",t[t.NUMPAD5=101]="NUMPAD5",t[t.NUMPAD6=102]="NUMPAD6",t[t.NUMPAD7=103]="NUMPAD7",t[t.NUMPAD8=104]="NUMPAD8",t[t.NUMPAD9=105]="NUMPAD9",t[t.MULTIPLY=106]="MULTIPLY",t[t.ADD=107]="ADD",t[t.SUBTRACT=109]="SUBTRACT",t[t.DECIMALPOINT=110]="DECIMALPOINT",t[t.DIVIDE=111]="DIVIDE",t[t.F1=112]="F1",t[t.F2=113]="F2",t[t.F3=114]="F3",t[t.F4=115]="F4",t[t.F5=116]="F5",t[t.F6=117]="F6",t[t.F7=118]="F7",t[t.F8=119]="F8",t[t.F9=120]="F9",t[t.F10=121]="F10",t[t.F11=122]="F11",t[t.F12=123]="F12",t[t.NUMLOCK=144]="NUMLOCK",t[t.SCROLLLOCK=145]="SCROLLLOCK",t[t.SEMICOLON=186]="SEMICOLON",t[t.EQUALS=187]="EQUALS",t[t.COMMA=188]="COMMA",t[t.DASH=189]="DASH",t[t.PERIOD=190]="PERIOD",t[t.UNDERSCORE=189]="UNDERSCORE",t[t.PLUSSIGN=187]="PLUSSIGN",t[t.FORWARDSLASH=191]="FORWARDSLASH",t[t.TILDE=192]="TILDE",t[t.GRAVEACCENT=192]="GRAVEACCENT",t[t.OPENBRACKET=219]="OPENBRACKET",t[t.CLOSEDBRACKET=221]="CLOSEDBRACKET",t[t.QUOTE=222]="QUOTE"}(r||(r={}));var b=function(){function t(t,e){var n=this;this.element=t,this.attributes=[],this.map=e,Array.from(this.element.attributes).forEach(function(t){if(t.nodeName&&t.nodeName.startsWith(o.a.KEY_ATTRIBUTE_NAME)){if(!t.value)throw new Error("syntax error "+o.a.KEY_ATTRIBUTE_NAME+" expected arguments");n.element[t.name]=n,n.attributes.push(t.name)}})}return t.prototype.create=function(){this.init()},t.prototype.onKeyPress=function(t){var e,n,a="cp-"+t.type;if(t.target&&t.target.hasAttributeStartingWith(a)){var s=t.target.getAttributeStartingWith(a)[0].name;if(-1===s.lastIndexOf("."))i.a.executeFunctionCallback(t.target[s].element,t.target[s].element.getAttribute(s),((e={})[o.a.EVENT_ATTRIBUTE_NAME]=t,e));else{var c=s.substring(s.lastIndexOf(".")+1),u=isNaN(c)?r[(c||"").toUpperCase()]:Number(c);void 0!==u&&t.keyCode===u&&i.a.executeFunctionCallback(t.target[s].element,t.target[s].element.getAttribute(s),((n={})[o.a.EVENT_ATTRIBUTE_NAME]=t,n))}}},t.prototype.init=function(){var t=this;this.attributes.forEach(function(e){var n=e.lastIndexOf("."),r=e.substring(0,-1===n?e.length:n).replace(o.a.KEY_ATTRIBUTE_NAME,"");t.element.removeEventListener("key"+r,t.onKeyPress),t.element.addEventListener("key"+r,t.onKeyPress)})},t}(),g=function(){function t(t,e){if(this.element=t,this.element.cpModel=this,this.map=e,this.attribute=this.element.getAttribute(o.a.MODEL_ATTRIBUTE_NAME),!this.attribute)throw new Error("syntax error "+o.a.MODEL_ATTRIBUTE_NAME+" expected arguments")}return t.prototype.create=function(t){this.init(),this.applyModelInValue()},t.prototype.init=function(){this.map.addCpModels(this),i.a.isComponent(this.element)||(this.element.removeEventListener("input",this.applyValueInModel),this.element.addEventListener("input",this.applyValueInModel))},t.prototype.applyModelInValue=function(){var t=i.a.get(i.a.getScope(this.element).scope,this.attribute);switch(this.element.type){case"date":this.element.valueAsDate&&this.element.valueAsDate.getTime()!==t.getTime()&&(this.element.valueAsDate=t||null);break;case"number":t!==this.element.valueAsNumber&&void 0!==t&&(this.element.valueAsNumber=t||null);break;default:this.element.value!==t&&(this.element.value=t||null)}},t.prototype.applyValueInModel=function(t){var e=(t?t.target||t.srcElement:this.element).cpModel;switch(e.element.type){case"date":i.a.set(i.a.getScope(e.element).scope,e.attribute,e.element.valueAsDate);break;case"number":i.a.set(i.a.getScope(e.element).scope,e.attribute,isNaN(e.element.valueAsNumber)?void 0:e.element.valueAsNumber);break;default:i.a.set(i.a.getScope(e.element).scope,e.attribute,e.element.value)}},t}(),T=function(){function t(t,e){var n=this;this.element=t,this.attributes=[],this.map=e,Array.from(this.element.attributes).forEach(function(t){if(t.nodeName&&t.nodeName.startsWith(o.a.MOUSE_ATTRIBUTE_NAME)){if(!t.value)throw new Error("syntax error "+o.a.MOUSE_ATTRIBUTE_NAME+" expected arguments");n.element[t.name]=n,n.attributes.push(t.name)}})}return t.prototype.create=function(){this.init()},t.prototype.onMouse=function(t){var e,n="cp-"+t.type;t.target&&t.target[n]&&i.a.executeFunctionCallback(t.target[n].element,t.target[n].element.getAttribute(n),((e={})[o.a.EVENT_ATTRIBUTE_NAME]=t,e))},t.prototype.init=function(){var t=this;this.attributes.forEach(function(e){var n=e.lastIndexOf("."),r=e.substring(0,-1===n?e.length:n).replace(o.a.MOUSE_ATTRIBUTE_NAME,"");t.element.removeEventListener("mouse"+r,function(e){return t.onMouse(e)}),t.element.addEventListener("mouse"+r,t.onMouse)})},t}(),C=n(15),I=n.n(C),N=n(4),w=function(){function t(t,e){this.lastArray=[],this.elms=[],this.element=t.cloneNode(!0),this.element.removeAttribute(o.a.REPEAT_ATTRIBUTE_NAME),this.element.classList.add("binding-repeat"),this.originalElement=t,this.map=e,this.attribute=t.getAttribute(o.a.REPEAT_ATTRIBUTE_NAME).replace(/\s+/g," "),this.regex=new RegExp("^[\\s*|\\S]+\\s+"+o.a.REPEAT_ATTRIBUTE_OPERATOR.replace(/ /g,"")+"\\s+\\S+\\s*","g");var n=this.attribute.match(this.regex);if(!this.attribute||!n||0===n.length)throw new Error("syntax error invalid "+o.a.REPEAT_ATTRIBUTE_NAME+" expresion: "+this.attribute);this.referenceNode=document.createComment("start repeat "+this.attribute),this.originalElement.parentNode.replaceChild&&this.originalElement.parentNode.replaceChild(this.referenceNode,this.originalElement)}return t.prototype.create=function(){var t=" "+o.a.REPEAT_ATTRIBUTE_OPERATOR+" ";this.attributeAlias=this.attribute.substring(0,this.attribute.indexOf(t)).replace(/ /g,""),this.attributeScope=this.attribute.substring(this.attribute.indexOf(t)+t.length,this.attribute.length).replace(/ /g,""),this.applyLoop()},t.prototype.applyLoop=function(){var t=i.a.evalInMultiContext(this.originalElement,this.attributeScope);t&&!I()(t,this.lastArray)&&(this.lastArray=t.slice(),this.removeChildes(),this.loop(t,this.attributeAlias))},t.prototype.removeChildes=function(){var t=this;this.elms.forEach(function(e){return t.referenceNode.parentNode.removeChild(e)})},t.prototype.loop=function(t,e){var n=this;this.elms=[];var r=this.referenceNode;t.forEach(function(t,a){var s=n.element.cloneNode(!0);new N.a(s,function(){}),i.a.appendAfter(r,s);var c=i.a.getScope(s);c.scope[e]=t,c.scope[o.a.REPEAT_INDEX_NAME]=a,c.$parent=i.a.getScope(n.referenceNode.parentNode),n.createChildrenComponents(s),r=s,n.elms.push(s)}),r&&i.a.appendAfter(r,this.referenceNode.parentNode.appendChild(document.createComment("end repeat "+this.attribute)))},t.prototype.createChildrenComponents=function(t){(Array.from(t.children)||[]).forEach(function(t){c.default.constroyIfComponent(t)})},t}(),O=function(){function t(t,e){if(this.element=t,this.initialDisplay=this.element.style.display||"",this.map=e,this.attribute=i.a.getAttributeCpShow(this.element),!this.attribute)throw new Error("syntax error "+o.a.SHOW_ATTRIBUTE_NAME+" expected arguments")}return t.prototype.create=function(){this.init()},t.prototype.init=function(){try{i.a.isValidCondition(this.element,i.a.getAttributeCpShow(this.element))?this.show():this.hide()}catch(t){this.hide()}},t.prototype.hide=function(){this.element.style.display="none"},t.prototype.show=function(){this.element.style.display=this.initialDisplay},t}(),S=function(){function t(t,e){this.element=t,this.element.cpStyle=this,this.map=e,this.attribute=i.a.getAttributeCpStyle(this.element),this.elementComment=document.createComment("cpStyle "+this.attribute),this.elmScope=i.a.getScope(t)}retu