UNPKG

appblocks

Version:

A lightweight javascript library for building micro apps for the front-end.

3 lines (2 loc) 48.7 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).AppBlock=t()}(this,(function(){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e,t){return e(t={exports:{}},t.exports),t.exports}var n,r,o=function(e){return e&&e.Math===Math&&e},i=o("object"==typeof globalThis&&globalThis)||o("object"==typeof window&&window)||o("object"==typeof self&&self)||o("object"==typeof e&&e)||o("object"==typeof e&&e)||function(){return this}()||Function("return this")(),a=function(e){try{return!!e()}catch(e){return!0}},c=!a((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})),u=!a((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),f=Function.prototype.call,l=u?f.bind(f):function(){return f.apply(f,arguments)},s={}.propertyIsEnumerable,d=Object.getOwnPropertyDescriptor,p={f:d&&!s.call({1:2},1)?function(e){var t=d(this,e);return!!t&&t.enumerable}:s},h=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},v=Function.prototype,g=v.call,m=u&&v.bind.bind(g,g),b=u?m:function(e){return function(){return g.apply(e,arguments)}},y=b({}.toString),S=b("".slice),w=function(e){return S(y(e),8,-1)},E=Object,O=b("".split),x=a((function(){return!E("z").propertyIsEnumerable(0)}))?function(e){return"String"===w(e)?O(e,""):E(e)}:E,T=function(e){return null==e},j=TypeError,A=function(e){if(T(e))throw new j("Can't call method on "+e);return e},R=function(e){return x(A(e))},I="object"==typeof document&&document.all,M=void 0===I&&void 0!==I?function(e){return"function"==typeof e||e===I}:function(e){return"function"==typeof e},N=function(e){return"object"==typeof e?null!==e:M(e)},C=function(e,t){return arguments.length<2?(n=i[e],M(n)?n:void 0):i[e]&&i[e][t];var n},P=b({}.isPrototypeOf),L="undefined"!=typeof navigator&&String(navigator.userAgent)||"",k=i.process,F=i.Deno,D=k&&k.versions||F&&F.version,H=D&&D.v8;H&&(r=(n=H.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!r&&L&&(!(n=L.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=L.match(/Chrome\/(\d+)/))&&(r=+n[1]);var _=r,B=i.String,V=!!Object.getOwnPropertySymbols&&!a((function(){var e=Symbol("symbol detection");return!B(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&_&&_<41})),U=V&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,$=Object,q=U?function(e){return"symbol"==typeof e}:function(e){var t=C("Symbol");return M(t)&&P(t.prototype,$(e))},G=String,z=function(e){try{return G(e)}catch(e){return"Object"}},W=TypeError,K=function(e){if(M(e))return e;throw new W(z(e)+" is not a function")},X=function(e,t){var n=e[t];return T(n)?void 0:K(n)},Y=TypeError,J=Object.defineProperty,Q=function(e,t){try{J(i,e,{value:t,configurable:!0,writable:!0})}catch(n){i[e]=t}return t},Z=t((function(e){var t="__core-js_shared__",n=e.exports=i[t]||Q(t,{});(n.versions||(n.versions=[])).push({version:"3.36.0",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.36.0/LICENSE",source:"https://github.com/zloirock/core-js"})})),ee=function(e,t){return Z[e]||(Z[e]=t||{})},te=Object,ne=function(e){return te(A(e))},re=b({}.hasOwnProperty),oe=Object.hasOwn||function(e,t){return re(ne(e),t)},ie=0,ae=Math.random(),ce=b(1..toString),ue=function(e){return"Symbol("+(void 0===e?"":e)+")_"+ce(++ie+ae,36)},fe=i.Symbol,le=ee("wks"),se=U?fe.for||fe:fe&&fe.withoutSetter||ue,de=function(e){return oe(le,e)||(le[e]=V&&oe(fe,e)?fe[e]:se("Symbol."+e)),le[e]},pe=TypeError,he=de("toPrimitive"),ve=function(e,t){if(!N(e)||q(e))return e;var n,r=X(e,he);if(r){if(void 0===t&&(t="default"),n=l(r,e,t),!N(n)||q(n))return n;throw new pe("Can't convert object to primitive value")}return void 0===t&&(t="number"),function(e,t){var n,r;if("string"===t&&M(n=e.toString)&&!N(r=l(n,e)))return r;if(M(n=e.valueOf)&&!N(r=l(n,e)))return r;if("string"!==t&&M(n=e.toString)&&!N(r=l(n,e)))return r;throw new Y("Can't convert object to primitive value")}(e,t)},ge=function(e){var t=ve(e,"string");return q(t)?t:t+""},me=i.document,be=N(me)&&N(me.createElement),ye=function(e){return be?me.createElement(e):{}},Se=!c&&!a((function(){return 7!==Object.defineProperty(ye("div"),"a",{get:function(){return 7}}).a})),we=Object.getOwnPropertyDescriptor,Ee={f:c?we:function(e,t){if(e=R(e),t=ge(t),Se)try{return we(e,t)}catch(e){}if(oe(e,t))return h(!l(p.f,e,t),e[t])}},Oe=c&&a((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),xe=String,Te=TypeError,je=function(e){if(N(e))return e;throw new Te(xe(e)+" is not an object")},Ae=TypeError,Re=Object.defineProperty,Ie=Object.getOwnPropertyDescriptor,Me="enumerable",Ne="configurable",Ce="writable",Pe={f:c?Oe?function(e,t,n){if(je(e),t=ge(t),je(n),"function"==typeof e&&"prototype"===t&&"value"in n&&Ce in n&&!n[Ce]){var r=Ie(e,t);r&&r[Ce]&&(e[t]=n.value,n={configurable:Ne in n?n[Ne]:r[Ne],enumerable:Me in n?n[Me]:r[Me],writable:!1})}return Re(e,t,n)}:Re:function(e,t,n){if(je(e),t=ge(t),je(n),Se)try{return Re(e,t,n)}catch(e){}if("get"in n||"set"in n)throw new Ae("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},Le=c?function(e,t,n){return Pe.f(e,t,h(1,n))}:function(e,t,n){return e[t]=n,e},ke=Function.prototype,Fe=c&&Object.getOwnPropertyDescriptor,De=oe(ke,"name"),He={EXISTS:De,PROPER:De&&"something"===function(){}.name,CONFIGURABLE:De&&(!c||c&&Fe(ke,"name").configurable)},_e=b(Function.toString);M(Z.inspectSource)||(Z.inspectSource=function(e){return _e(e)});var Be,Ve,Ue,$e=Z.inspectSource,qe=i.WeakMap,Ge=M(qe)&&/native code/.test(String(qe)),ze=ee("keys"),We=function(e){return ze[e]||(ze[e]=ue(e))},Ke={},Xe="Object already initialized",Ye=i.TypeError,Je=i.WeakMap;if(Ge||Z.state){var Qe=Z.state||(Z.state=new Je);Qe.get=Qe.get,Qe.has=Qe.has,Qe.set=Qe.set,Be=function(e,t){if(Qe.has(e))throw new Ye(Xe);return t.facade=e,Qe.set(e,t),t},Ve=function(e){return Qe.get(e)||{}},Ue=function(e){return Qe.has(e)}}else{var Ze=We("state");Ke[Ze]=!0,Be=function(e,t){if(oe(e,Ze))throw new Ye(Xe);return t.facade=e,Le(e,Ze,t),t},Ve=function(e){return oe(e,Ze)?e[Ze]:{}},Ue=function(e){return oe(e,Ze)}}var et={set:Be,get:Ve,has:Ue,enforce:function(e){return Ue(e)?Ve(e):Be(e,{})},getterFor:function(e){return function(t){var n;if(!N(t)||(n=Ve(t)).type!==e)throw new Ye("Incompatible receiver, "+e+" required");return n}}},tt=t((function(e){var t=He.CONFIGURABLE,n=et.enforce,r=et.get,o=String,i=Object.defineProperty,u=b("".slice),f=b("".replace),l=b([].join),s=c&&!a((function(){return 8!==i((function(){}),"length",{value:8}).length})),d=String(String).split("String"),p=e.exports=function(e,r,a){"Symbol("===u(o(r),0,7)&&(r="["+f(o(r),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),a&&a.getter&&(r="get "+r),a&&a.setter&&(r="set "+r),(!oe(e,"name")||t&&e.name!==r)&&(c?i(e,"name",{value:r,configurable:!0}):e.name=r),s&&a&&oe(a,"arity")&&e.length!==a.arity&&i(e,"length",{value:a.arity});try{a&&oe(a,"constructor")&&a.constructor?c&&i(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var p=n(e);return oe(p,"source")||(p.source=l(d,"string"==typeof r?r:"")),e};Function.prototype.toString=p((function(){return M(this)&&r(this).source||$e(this)}),"toString")})),nt=function(e,t,n,r){r||(r={});var o=r.enumerable,i=void 0!==r.name?r.name:t;if(M(n)&&tt(n,i,r),r.global)o?e[t]=n:Q(t,n);else{try{r.unsafe?e[t]&&(o=!0):delete e[t]}catch(e){}o?e[t]=n:Pe.f(e,t,{value:n,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return e},rt=Math.ceil,ot=Math.floor,it=Math.trunc||function(e){var t=+e;return(t>0?ot:rt)(t)},at=function(e){var t=+e;return t!=t||0===t?0:it(t)},ct=Math.max,ut=Math.min,ft=function(e,t){var n=at(e);return n<0?ct(n+t,0):ut(n,t)},lt=Math.min,st=function(e){var t=at(e);return t>0?lt(t,9007199254740991):0},dt=function(e){return st(e.length)},pt=function(e){return function(t,n,r){var o=R(t),i=dt(o);if(0===i)return!e&&-1;var a,c=ft(r,i);if(e&&n!=n){for(;i>c;)if((a=o[c++])!=a)return!0}else for(;i>c;c++)if((e||c in o)&&o[c]===n)return e||c||0;return!e&&-1}},ht={includes:pt(!0),indexOf:pt(!1)},vt=ht.indexOf,gt=b([].push),mt=function(e,t){var n,r=R(e),o=0,i=[];for(n in r)!oe(Ke,n)&&oe(r,n)&&gt(i,n);for(;t.length>o;)oe(r,n=t[o++])&&(~vt(i,n)||gt(i,n));return i},bt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],yt=bt.concat("length","prototype"),St={f:Object.getOwnPropertyNames||function(e){return mt(e,yt)}},wt={f:Object.getOwnPropertySymbols},Et=b([].concat),Ot=C("Reflect","ownKeys")||function(e){var t=St.f(je(e)),n=wt.f;return n?Et(t,n(e)):t},xt=function(e,t,n){for(var r=Ot(t),o=Pe.f,i=Ee.f,a=0;a<r.length;a++){var c=r[a];oe(e,c)||n&&oe(n,c)||o(e,c,i(t,c))}},Tt=/#|\.prototype\./,jt=function(e,t){var n=Rt[At(e)];return n===Mt||n!==It&&(M(t)?a(t):!!t)},At=jt.normalize=function(e){return String(e).replace(Tt,".").toLowerCase()},Rt=jt.data={},It=jt.NATIVE="N",Mt=jt.POLYFILL="P",Nt=jt,Ct=Ee.f,Pt=function(e,t){var n,r,o,a,c,u=e.target,f=e.global,l=e.stat;if(n=f?i:l?i[u]||Q(u,{}):i[u]&&i[u].prototype)for(r in t){if(a=t[r],o=e.dontCallGetSet?(c=Ct(n,r))&&c.value:n[r],!Nt(f?r:u+(l?".":"#")+r,e.forced)&&void 0!==o){if(typeof a==typeof o)continue;xt(a,o)}(e.sham||o&&o.sham)&&Le(a,"sham",!0),nt(n,r,a,e)}},Lt=function(e){if("Function"===w(e))return b(e)},kt=Lt(Lt.bind),Ft=function(e,t){return K(e),void 0===t?e:u?kt(e,t):function(){return e.apply(t,arguments)}},Dt=Array.isArray||function(e){return"Array"===w(e)},Ht={};Ht[de("toStringTag")]="z";var _t="[object z]"===String(Ht),Bt=de("toStringTag"),Vt=Object,Ut="Arguments"===w(function(){return arguments}()),$t=_t?w:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Vt(e),Bt))?n:Ut?w(t):"Object"===(r=w(t))&&M(t.callee)?"Arguments":r},qt=function(){},Gt=C("Reflect","construct"),zt=/^\s*(?:class|function)\b/,Wt=b(zt.exec),Kt=!zt.test(qt),Xt=function(e){if(!M(e))return!1;try{return Gt(qt,[],e),!0}catch(e){return!1}},Yt=function(e){if(!M(e))return!1;switch($t(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Kt||!!Wt(zt,$e(e))}catch(e){return!0}};Yt.sham=!0;var Jt=!Gt||a((function(){var e;return Xt(Xt.call)||!Xt(Object)||!Xt((function(){e=!0}))||e}))?Yt:Xt,Qt=de("species"),Zt=Array,en=function(e,t){return new(function(e){var t;return Dt(e)&&(t=e.constructor,(Jt(t)&&(t===Zt||Dt(t.prototype))||N(t)&&null===(t=t[Qt]))&&(t=void 0)),void 0===t?Zt:t}(e))(0===t?0:t)},tn=b([].push),nn=function(e){var t=1===e,n=2===e,r=3===e,o=4===e,i=6===e,a=7===e,c=5===e||i;return function(u,f,l,s){for(var d,p,h=ne(u),v=x(h),g=dt(v),m=Ft(f,l),b=0,y=s||en,S=t?y(u,g):n||a?y(u,0):void 0;g>b;b++)if((c||b in v)&&(p=m(d=v[b],b,h),e))if(t)S[b]=p;else if(p)switch(e){case 3:return!0;case 5:return d;case 6:return b;case 2:tn(S,d)}else switch(e){case 4:return!1;case 7:tn(S,d)}return i?-1:r||o?o:S}},rn=function(e,t){var n=[][e];return!!n&&a((function(){n.call(null,t||function(){return 1},1)}))},on={forEach:nn(0),map:nn(1),filter:nn(2),some:nn(3),every:nn(4),find:nn(5),findIndex:nn(6),filterReject:nn(7)}.forEach,an=rn("forEach")?[].forEach:function(e){return on(this,e,arguments.length>1?arguments[1]:void 0)};Pt({target:"Array",proto:!0,forced:[].forEach!==an},{forEach:an});var cn=function(e,t,n){return n.get&&tt(n.get,t,{getter:!0}),n.set&&tt(n.set,t,{setter:!0}),Pe.f(e,t,n)},un=He.EXISTS,fn=Function.prototype,ln=b(fn.toString),sn=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,dn=b(sn.exec);c&&!un&&cn(fn,"name",{configurable:!0,get:function(){try{return dn(sn,ln(this))[1]}catch(e){return""}}});var pn=Object.keys||function(e){return mt(e,bt)},hn=Object.assign,vn=Object.defineProperty,gn=b([].concat),mn=!hn||a((function(){if(c&&1!==hn({b:1},hn(vn({},"a",{enumerable:!0,get:function(){vn(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol("assign detection"),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!==hn({},e)[n]||pn(hn({},t)).join("")!==r}))?function(e,t){for(var n=ne(e),r=arguments.length,o=1,i=wt.f,a=p.f;r>o;)for(var u,f=x(arguments[o++]),s=i?gn(pn(f),i(f)):pn(f),d=s.length,h=0;d>h;)u=s[h++],c&&!l(a,f,u)||(n[u]=f[u]);return n}:hn;Pt({target:"Object",stat:!0,arity:2,forced:Object.assign!==mn},{assign:mn});var bn=_t?{}.toString:function(){return"[object "+$t(this)+"]"};_t||nt(Object.prototype,"toString",bn,{unsafe:!0});var yn={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Sn=ye("span").classList,wn=Sn&&Sn.constructor&&Sn.constructor.prototype,En=wn===Object.prototype?void 0:wn,On=function(e){if(e&&e.forEach!==an)try{Le(e,"forEach",an)}catch(t){e.forEach=an}};for(var xn in yn)yn[xn]&&On(i[xn]&&i[xn].prototype);On(En);var Tn=function(){let e=new Set,t={morphStyle:"outerHTML",callbacks:{beforeNodeAdded:f,afterNodeAdded:f,beforeNodeMorphed:f,afterNodeMorphed:f,beforeNodeRemoved:f,afterNodeRemoved:f,beforeAttributeUpdated:f},head:{style:"merge",shouldPreserve:function(e){return"true"===e.getAttribute("im-preserve")},shouldReAppend:function(e){return"true"===e.getAttribute("im-re-append")},shouldRemove:f,afterHeadMorphed:f}};function n(e,t,r){if(r.head.block){let o=e.querySelector("head"),i=t.querySelector("head");if(o&&i){let a=u(i,o,r);return void Promise.all(a).then((function(){n(e,t,Object.assign(r,{head:{block:!1,ignore:!0}}))}))}}if("innerHTML"===r.morphStyle)return i(t,e,r),e.children;if("outerHTML"===r.morphStyle||null==r.morphStyle){let n=function(e,t,n){let r;r=e.firstChild;let o=r,i=0;for(;r;){let e=v(r,t,n);e>i&&(o=r,i=e),r=r.nextSibling}return o}(t,e,r),i=n?.previousSibling,a=n?.nextSibling,c=o(e,n,r);return n?function(e,t,n){let r=[],o=[];for(;null!=e;)r.push(e),e=e.previousSibling;for(;r.length>0;){let e=r.pop();o.push(e),t.parentElement.insertBefore(e,t)}o.push(t);for(;null!=n;)r.push(n),o.push(n),n=n.nextSibling;for(;r.length>0;)t.parentElement.insertBefore(r.pop(),t.nextSibling);return o}(i,c,a):[]}throw"Do not understand how to morph style "+r.morphStyle}function r(e,t){return t.ignoreActiveValue&&e===document.activeElement}function o(e,t,n){if(!n.ignoreActive||e!==document.activeElement)return null==t?!1===n.callbacks.beforeNodeRemoved(e)?e:(e.remove(),n.callbacks.afterNodeRemoved(e),null):s(e,t)?(!1===n.callbacks.beforeNodeMorphed(e,t)||(e instanceof HTMLHeadElement&&n.head.ignore||(e instanceof HTMLHeadElement&&"morph"!==n.head.style?u(t,e,n):(!function(e,t,n){let o=e.nodeType;if(1===o){const r=e.attributes,o=t.attributes;for(const e of r)a(e.name,t,"update",n)||t.getAttribute(e.name)!==e.value&&t.setAttribute(e.name,e.value);for(let r=o.length-1;0<=r;r--){const i=o[r];a(i.name,t,"remove",n)||(e.hasAttribute(i.name)||t.removeAttribute(i.name))}}8!==o&&3!==o||t.nodeValue!==e.nodeValue&&(t.nodeValue=e.nodeValue);r(t,n)||function(e,t,n){if(e instanceof HTMLInputElement&&t instanceof HTMLInputElement&&"file"!==e.type){let r=e.value,o=t.value;c(e,t,"checked",n),c(e,t,"disabled",n),e.hasAttribute("value")?r!==o&&(a("value",t,"update",n)||(t.setAttribute("value",r),t.value=r)):a("value",t,"remove",n)||(t.value="",t.removeAttribute("value"))}else if(e instanceof HTMLOptionElement)c(e,t,"selected",n);else if(e instanceof HTMLTextAreaElement&&t instanceof HTMLTextAreaElement){let r=e.value,o=t.value;if(a("value",t,"update",n))return;r!==o&&(t.value=r),t.firstChild&&t.firstChild.nodeValue!==r&&(t.firstChild.nodeValue=r)}}(e,t,n)}(t,e,n),r(e,n)||i(t,e,n))),n.callbacks.afterNodeMorphed(e,t)),e):!1===n.callbacks.beforeNodeRemoved(e)||!1===n.callbacks.beforeNodeAdded(t)?e:(e.parentElement.replaceChild(t,e),n.callbacks.afterNodeAdded(t),n.callbacks.afterNodeRemoved(e),t)}function i(e,t,n){let r,i=e.firstChild,a=t.firstChild;for(;i;){if(r=i,i=r.nextSibling,null==a){if(!1===n.callbacks.beforeNodeAdded(r))return;t.appendChild(r),n.callbacks.afterNodeAdded(r),y(n,r);continue}if(l(r,a,n)){o(a,r,n),a=a.nextSibling,y(n,r);continue}let c=p(e,t,r,a,n);if(c){a=d(a,c,n),o(c,r,n),y(n,r);continue}let u=h(e,t,r,a,n);if(u)a=d(a,u,n),o(u,r,n),y(n,r);else{if(!1===n.callbacks.beforeNodeAdded(r))return;t.insertBefore(r,a),n.callbacks.afterNodeAdded(r),y(n,r)}}for(;null!==a;){let e=a;a=a.nextSibling,g(e,n)}}function a(e,t,n,r){return!("value"!==e||!r.ignoreActiveValue||t!==document.activeElement)||!1===r.callbacks.beforeAttributeUpdated(e,t,n)}function c(e,t,n,r){if(e[n]!==t[n]){let o=a(n,t,"update",r);o||(t[n]=e[n]),e[n]?o||t.setAttribute(n,e[n]):a(n,t,"remove",r)||t.removeAttribute(n)}}function u(e,t,n){let r=[],o=[],i=[],a=[],c=n.head.style,u=new Map;for(const t of e.children)u.set(t.outerHTML,t);for(const e of t.children){let t=u.has(e.outerHTML),r=n.head.shouldReAppend(e),f=n.head.shouldPreserve(e);t||f?r?o.push(e):(u.delete(e.outerHTML),i.push(e)):"append"===c?r&&(o.push(e),a.push(e)):!1!==n.head.shouldRemove(e)&&o.push(e)}a.push(...u.values());let f=[];for(const e of a){let o=document.createRange().createContextualFragment(e.outerHTML).firstChild;if(!1!==n.callbacks.beforeNodeAdded(o)){if(o.href||o.src){let e=null,t=new Promise((function(t){e=t}));o.addEventListener("load",(function(){e()})),f.push(t)}t.appendChild(o),n.callbacks.afterNodeAdded(o),r.push(o)}}for(const e of o)!1!==n.callbacks.beforeNodeRemoved(e)&&(t.removeChild(e),n.callbacks.afterNodeRemoved(e));return n.head.afterHeadMorphed(t,{added:r,kept:i,removed:o}),f}function f(){}function l(e,t,n){return null!=e&&null!=t&&(e.nodeType===t.nodeType&&e.tagName===t.tagName&&(""!==e.id&&e.id===t.id||S(n,e,t)>0))}function s(e,t){return null!=e&&null!=t&&(e.nodeType===t.nodeType&&e.tagName===t.tagName)}function d(e,t,n){for(;e!==t;){let t=e;e=e.nextSibling,g(t,n)}return y(n,t),t.nextSibling}function p(e,t,n,r,o){let i=S(o,n,t);if(i>0){let t=r,a=0;for(;null!=t;){if(l(n,t,o))return t;if(a+=S(o,t,e),a>i)return null;t=t.nextSibling}}return null}function h(e,t,n,r,o){let i=r,a=n.nextSibling,c=0;for(;null!=i;){if(S(o,i,e)>0)return null;if(s(n,i))return i;if(s(a,i)&&(c++,a=a.nextSibling,c>=2))return null;i=i.nextSibling}return i}function v(e,t,n){return s(e,t)?.5+S(n,e,t):0}function g(e,t){y(t,e),!1!==t.callbacks.beforeNodeRemoved(e)&&(e.remove(),t.callbacks.afterNodeRemoved(e))}function m(e,t){return!e.deadIds.has(t)}function b(t,n,r){return(t.idMap.get(r)||e).has(n)}function y(t,n){let r=t.idMap.get(n)||e;for(const e of r)t.deadIds.add(e)}function S(t,n,r){let o=t.idMap.get(n)||e,i=0;for(const e of o)m(t,e)&&b(t,e,r)&&++i;return i}function w(e,t){let n=e.parentElement,r=e.querySelectorAll("[id]");for(const e of r){let r=e;for(;r!==n&&null!=r;){let n=t.get(r);null==n&&(n=new Set,t.set(r,n)),n.add(e.id),r=r.parentElement}}}function E(e,t){let n=new Map;return w(e,n),w(t,n),n}return{morph:function(e,r,o={}){e instanceof Document&&(e=e.documentElement),"string"==typeof r&&(r=function(e){let t=new DOMParser,n=e.replace(/<svg(\s[^>]*>|>)([\s\S]*?)<\/svg>/gim,"");if(n.match(/<\/html>/)||n.match(/<\/head>/)||n.match(/<\/body>/)){let r=t.parseFromString(e,"text/html");if(n.match(/<\/html>/))return r.generatedByIdiomorph=!0,r;{let e=r.firstChild;return e?(e.generatedByIdiomorph=!0,e):null}}{let n=t.parseFromString("<body><template>"+e+"</template></body>","text/html").body.querySelector("template").content;return n.generatedByIdiomorph=!0,n}}(r));let i=function(e){if(null==e){return document.createElement("div")}if(e.generatedByIdiomorph)return e;if(e instanceof Node){const t=document.createElement("div");return t.append(e),t}{const t=document.createElement("div");for(const n of[...e])t.append(n);return t}}(r),a=function(e,n,r){return r=function(e){let n={};return Object.assign(n,t),Object.assign(n,e),n.callbacks={},Object.assign(n.callbacks,t.callbacks),Object.assign(n.callbacks,e.callbacks),n.head={},Object.assign(n.head,t.head),Object.assign(n.head,e.head),n}(r),{target:e,newContent:n,config:r,morphStyle:r.morphStyle,ignoreActive:r.ignoreActive,ignoreActiveValue:r.ignoreActiveValue,idMap:E(e,n),deadIds:new Set,callbacks:r.callbacks,head:r.head}}(e,i,o);return n(e,i,a)},defaults:t}}();function jn(e){return jn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jn(e)}function An(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,c=[],u=!0,f=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);u=!0);}catch(e){f=!0,o=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(f)throw o}}return c}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Rn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Rn(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Rn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var In,Mn=c&&!Oe?Object.defineProperties:function(e,t){je(e);for(var n,r=R(t),o=pn(t),i=o.length,a=0;i>a;)Pe.f(e,n=o[a++],r[n]);return e},Nn={f:Mn},Cn=C("document","documentElement"),Pn="prototype",Ln="script",kn=We("IE_PROTO"),Fn=function(){},Dn=function(e){return"<"+Ln+">"+e+"</"+Ln+">"},Hn=function(e){e.write(Dn("")),e.close();var t=e.parentWindow.Object;return e=null,t},_n=function(){try{In=new ActiveXObject("htmlfile")}catch(e){}var e,t,n;_n="undefined"!=typeof document?document.domain&&In?Hn(In):(t=ye("iframe"),n="java"+Ln+":",t.style.display="none",Cn.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(Dn("document.F=Object")),e.close(),e.F):Hn(In);for(var r=bt.length;r--;)delete _n[Pn][bt[r]];return _n()};Ke[kn]=!0;var Bn=Object.create||function(e,t){var n;return null!==e?(Fn[Pn]=je(e),n=new Fn,Fn[Pn]=null,n[kn]=e):n=_n(),void 0===t?n:Nn.f(n,t)},Vn=Pe.f,Un=de("unscopables"),$n=Array.prototype;void 0===$n[Un]&&Vn($n,Un,{configurable:!0,value:Bn(null)});var qn,Gn=ht.includes;Pt({target:"Array",proto:!0,forced:a((function(){return!Array(1).includes()}))},{includes:function(e){return Gn(this,e,arguments.length>1?arguments[1]:void 0)}}),qn="includes",$n[Un][qn]=!0;var zn=function(e,t,n){c?Pe.f(e,t,h(0,n)):e[t]=n},Wn=de("species"),Kn=function(e){return _>=51||!a((function(){var t=[];return(t.constructor={})[Wn]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},Xn=b([].slice),Yn=Kn("slice"),Jn=de("species"),Qn=Array,Zn=Math.max;Pt({target:"Array",proto:!0,forced:!Yn},{slice:function(e,t){var n,r,o,i=R(this),a=dt(i),c=ft(e,a),u=ft(void 0===t?a:t,a);if(Dt(i)&&(n=i.constructor,(Jt(n)&&(n===Qn||Dt(n.prototype))||N(n)&&null===(n=n[Jn]))&&(n=void 0),n===Qn||void 0===n))return Xn(i,c,u);for(r=new(void 0===n?Qn:n)(Zn(u-c,0)),o=0;c<u;c++,o++)c in i&&zn(r,o,i[c]);return r.length=o,r}});var er,tr,nr=String,rr=function(e){if("Symbol"===$t(e))throw new TypeError("Cannot convert a Symbol value to a string");return nr(e)},or=function(){var e=je(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},ir=i.RegExp,ar=a((function(){var e=ir("a","y");return e.lastIndex=2,null!==e.exec("abcd")})),cr=ar||a((function(){return!ir("a","y").sticky})),ur={BROKEN_CARET:ar||a((function(){var e=ir("^r","gy");return e.lastIndex=2,null!==e.exec("str")})),MISSED_STICKY:cr,UNSUPPORTED_Y:ar},fr=i.RegExp,lr=a((function(){var e=fr(".","s");return!(e.dotAll&&e.test("\n")&&"s"===e.flags)})),sr=i.RegExp,dr=a((function(){var e=sr("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),pr=et.get,hr=ee("native-string-replace",String.prototype.replace),vr=RegExp.prototype.exec,gr=vr,mr=b("".charAt),br=b("".indexOf),yr=b("".replace),Sr=b("".slice),wr=(tr=/b*/g,l(vr,er=/a/,"a"),l(vr,tr,"a"),0!==er.lastIndex||0!==tr.lastIndex),Er=ur.BROKEN_CARET,Or=void 0!==/()??/.exec("")[1];(wr||Or||Er||lr||dr)&&(gr=function(e){var t,n,r,o,i,a,c,u=this,f=pr(u),s=rr(e),d=f.raw;if(d)return d.lastIndex=u.lastIndex,t=l(gr,d,s),u.lastIndex=d.lastIndex,t;var p=f.groups,h=Er&&u.sticky,v=l(or,u),g=u.source,m=0,b=s;if(h&&(v=yr(v,"y",""),-1===br(v,"g")&&(v+="g"),b=Sr(s,u.lastIndex),u.lastIndex>0&&(!u.multiline||u.multiline&&"\n"!==mr(s,u.lastIndex-1))&&(g="(?: "+g+")",b=" "+b,m++),n=new RegExp("^(?:"+g+")",v)),Or&&(n=new RegExp("^"+g+"$(?!\\s)",v)),wr&&(r=u.lastIndex),o=l(vr,h?n:u,b),h?o?(o.input=Sr(o.input,m),o[0]=Sr(o[0],m),o.index=u.lastIndex,u.lastIndex+=o[0].length):u.lastIndex=0:wr&&o&&(u.lastIndex=u.global?o.index+o[0].length:r),Or&&o&&o.length>1&&l(hr,o[0],n,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(o[i]=void 0)})),o&&p)for(o.groups=a=Bn(null),i=0;i<p.length;i++)a[(c=p[i])[0]]=o[c[1]];return o});var xr=gr;Pt({target:"RegExp",proto:!0,forced:/./.exec!==xr},{exec:xr});var Tr=de("match"),jr=TypeError,Ar=function(e){if(function(e){var t;return N(e)&&(void 0!==(t=e[Tr])?!!t:"RegExp"===w(e))}(e))throw new jr("The method doesn't accept regular expressions");return e},Rr=de("match"),Ir=b("".indexOf);Pt({target:"String",proto:!0,forced:!function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[Rr]=!1,"/./"[e](t)}catch(e){}}return!1}("includes")},{includes:function(e){return!!~Ir(rr(A(this)),rr(Ar(e)),arguments.length>1?arguments[1]:void 0)}});var Mr=de("species"),Nr=RegExp.prototype,Cr=function(e,t,n,r){var o=de(e),i=!a((function(){var t={};return t[o]=function(){return 7},7!==""[e](t)})),c=i&&!a((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[Mr]=function(){return n},n.flags="",n[o]=/./[o]),n.exec=function(){return t=!0,null},n[o](""),!t}));if(!i||!c||n){var u=/./[o],f=t(o,""[e],(function(e,t,n,r,o){var a=t.exec;return a===xr||a===Nr.exec?i&&!o?{done:!0,value:l(u,t,n,r)}:{done:!0,value:l(e,n,t,r)}:{done:!1}}));nt(String.prototype,e,f[0]),nt(Nr,o,f[1])}r&&Le(Nr[o],"sham",!0)},Pr=b("".charAt),Lr=b("".charCodeAt),kr=b("".slice),Fr=function(e){return function(t,n){var r,o,i=rr(A(t)),a=at(n),c=i.length;return a<0||a>=c?e?"":void 0:(r=Lr(i,a))<55296||r>56319||a+1===c||(o=Lr(i,a+1))<56320||o>57343?e?Pr(i,a):r:e?kr(i,a,a+2):o-56320+(r-55296<<10)+65536}},Dr={codeAt:Fr(!1),charAt:Fr(!0)}.charAt,Hr=function(e,t,n){return t+(n?Dr(e,t).length:1)},_r=TypeError,Br=function(e,t){var n=e.exec;if(M(n)){var r=l(n,e,t);return null!==r&&je(r),r}if("RegExp"===w(e))return l(xr,e,t);throw new _r("RegExp#exec called on incompatible receiver")};Cr("match",(function(e,t,n){return[function(t){var n=A(this),r=T(t)?void 0:X(t,e);return r?l(r,t,n):new RegExp(t)[e](rr(n))},function(e){var r=je(this),o=rr(e),i=n(t,r,o);if(i.done)return i.value;if(!r.global)return Br(r,o);var a=r.unicode;r.lastIndex=0;for(var c,u=[],f=0;null!==(c=Br(r,o));){var l=rr(c[0]);u[f]=l,""===l&&(r.lastIndex=Hr(o,st(r.lastIndex),a)),f++}return 0===f?null:u}]}));var Vr=Function.prototype,Ur=Vr.apply,$r=Vr.call,qr="object"==typeof Reflect&&Reflect.apply||(u?$r.bind(Ur):function(){return $r.apply(Ur,arguments)}),Gr=Math.floor,zr=b("".charAt),Wr=b("".replace),Kr=b("".slice),Xr=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Yr=/\$([$&'`]|\d{1,2})/g,Jr=function(e,t,n,r,o,i){var a=n+e.length,c=r.length,u=Yr;return void 0!==o&&(o=ne(o),u=Xr),Wr(i,u,(function(i,u){var f;switch(zr(u,0)){case"$":return"$";case"&":return e;case"`":return Kr(t,0,n);case"'":return Kr(t,a);case"<":f=o[Kr(u,1,-1)];break;default:var l=+u;if(0===l)return i;if(l>c){var s=Gr(l/10);return 0===s?i:s<=c?void 0===r[s-1]?zr(u,1):r[s-1]+zr(u,1):i}f=r[l-1]}return void 0===f?"":f}))},Qr=de("replace"),Zr=Math.max,eo=Math.min,to=b([].concat),no=b([].push),ro=b("".indexOf),oo=b("".slice),io="$0"==="a".replace(/./,"$0"),ao=!!/./[Qr]&&""===/./[Qr]("a","$0");Cr("replace",(function(e,t,n){var r=ao?"$":"$0";return[function(e,n){var r=A(this),o=T(e)?void 0:X(e,Qr);return o?l(o,e,r,n):l(t,rr(r),e,n)},function(e,o){var i=je(this),a=rr(e);if("string"==typeof o&&-1===ro(o,r)&&-1===ro(o,"$<")){var c=n(t,i,a,o);if(c.done)return c.value}var u=M(o);u||(o=rr(o));var f,l=i.global;l&&(f=i.unicode,i.lastIndex=0);for(var s,d=[];null!==(s=Br(i,a))&&(no(d,s),l);){""===rr(s[0])&&(i.lastIndex=Hr(a,st(i.lastIndex),f))}for(var p,h="",v=0,g=0;g<d.length;g++){for(var m,b=rr((s=d[g])[0]),y=Zr(eo(at(s.index),a.length),0),S=[],w=1;w<s.length;w++)no(S,void 0===(p=s[w])?p:String(p));var E=s.groups;if(u){var O=to([b],S,y,a);void 0!==E&&no(O,E),m=rr(qr(o,void 0,O))}else m=Jr(b,a,y,S,E,o);y>=v&&(h+=oo(a,v,y)+m,v=y+b.length)}return h+oo(a,v)}]}),!!a((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!io||ao);var co=function(e,t,n){var r,o=t[0],i=e;if(n&&o in n){if(!(t.length>1))return n[o];t.shift(),i=n[o]}else o in e.methods&&(t.shift(),r=e.methods[o](e));if(t.length>0)for(var a=0;a<t.length&&void 0!==(r=fo(i,t[a]));a++)i=r;return r},uo={getNode:function(e){return this.comp.el.querySelector(e)},getNodes:function(e){return this.comp.el.querySelectorAll(e)},appendIn:function(e,t){return t.innerHTML+=e},prependIn:function(e,t){return t.innerHTML=e+t.innerHTML}},fo=function(e,t){var n=e[t];if(void 0===n){var r=t.match(/\[(.*?)\]/g);if(r)for(var o=e[t.split("[")[0]],i=0;i<r.length;i++){if(i>0&&(o=n),void 0===(n=o[r[i].split("[")[1].split("]")[0]]))break}}return n},lo=TypeError,so=function(e){if(e>9007199254740991)throw lo("Maximum allowed index exceeded");return e},po=de("isConcatSpreadable"),ho=_>=51||!a((function(){var e=[];return e[po]=!1,e.concat()[0]!==e})),vo=function(e){if(!N(e))return!1;var t=e[po];return void 0!==t?!!t:Dt(e)};Pt({target:"Array",proto:!0,arity:1,forced:!ho||!Kn("concat")},{concat:function(e){var t,n,r,o,i,a=ne(this),c=en(a,0),u=0;for(t=-1,r=arguments.length;t<r;t++)if(vo(i=-1===t?a:arguments[t]))for(o=dt(i),so(u+o),n=0;n<o;n++,u++)n in i&&zn(c,u,i[n]);else so(u+1),zn(c,u++,i);return c.length=u,c}});var go=function(e,t){console.error("".concat(e.name,": ").concat(t))},mo={},bo=function(e,t,n){return n in mo?mo[n](e,t):(go(e,"".concat(n," is not a registered filter.")),t)},yo=function(e,t,n){jn(n);var r=t.replace(/{|}/g,"").split("."),o=co(e,r,n);return void 0===o?"":o},So=function(e,t,n){for(var r=t.attributes,o=0;o<r.length;o++){for(var i=r[o].value,a=void 0,c=function(){var t=a[0],r=An(t.match(/{([^|}]+)(\|[^}]+)?}/),3),o=r[1],c=r[2],u=c?c.split("|").slice(1):[],f=yo(e,o,n);u.forEach((function(t){f=bo(e,f,t)})),i=i.replace(t,f)};null!==(a=/{([^}]+)}/.exec(i));)c();r[o].value=i}},wo=function(e,t,n){for(var r=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,null,!1),o=[];r.nextNode();)o.push(r.currentNode);o.forEach((function(t){for(var r,o=t.nodeValue,i=function(){var i=r[0],a=An(i.match(/{([^|}]+)(\|[^}]+)?}/),3),c=a[1],u=a[2],f=u?u.split("|").slice(1):[],l=yo(e,c,n);if(f.forEach((function(t){if("asHTML"===t);else l=bo(e,l,t)})),f.includes("asHTML")){var s=document.createRange().createContextualFragment(l);return t.parentNode.insertBefore(s,t),t.parentNode.removeChild(t),1}o=o.replace(i,l)};null!==(r=/{([^}]+)}/.exec(o))&&!i(););t.parentNode&&(t.nodeValue=o)}))},Eo=ht.indexOf,Oo=Lt([].indexOf),xo=!!Oo&&1/Oo([1],1,-0)<0;Pt({target:"Array",proto:!0,forced:xo||!rn("indexOf")},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return xo?Oo(this,e,t)||0:Eo(this,e,t)}});var To=TypeError,jo=de("species"),Ao=function(e,t){var n,r=je(e).constructor;return void 0===r||T(n=je(r)[jo])?t:function(e){if(Jt(e))return e;throw new To(z(e)+" is not a constructor")}(n)},Ro=ur.UNSUPPORTED_Y,Io=Math.min,Mo=b([].push),No=b("".slice),Co=!a((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),Po="c"==="abbc".split(/(b)*/)[1]||4!=="test".split(/(?:)/,-1).length||2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length;Cr("split",(function(e,t,n){var r="0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:l(t,this,e,n)}:t;return[function(t,n){var o=A(this),i=T(t)?void 0:X(t,e);return i?l(i,t,o,n):l(r,rr(o),t,n)},function(e,o){var i=je(this),a=rr(e);if(!Po){var c=n(r,i,a,o,r!==t);if(c.done)return c.value}var u=Ao(i,RegExp),f=i.unicode,l=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(Ro?"g":"y"),s=new u(Ro?"^(?:"+i.source+")":i,l),d=void 0===o?4294967295:o>>>0;if(0===d)return[];if(0===a.length)return null===Br(s,a)?[a]:[];for(var p=0,h=0,v=[];h<a.length;){s.lastIndex=Ro?0:h;var g,m=Br(s,Ro?No(a,h):a);if(null===m||(g=Io(st(s.lastIndex+(Ro?h:0)),a.length))===p)h=Hr(a,h,f);else{if(Mo(v,No(a,p,h)),v.length===d)return v;for(var b=1;b<=m.length-1;b++)if(Mo(v,m[b]),v.length===d)return v;h=p=g}}return Mo(v,No(a,p)),v}]}),Po||!Co,Ro);var Lo,ko,Fo,Do,Ho=function e(t,n,r){var o=n.attributes;if(o){for(var i=0;i<o.length;i++)if(o[i].name in t.directives){var a=o[i].name;if(!1===t.directives[a](t,n,r))return void n.remove()}So(t,n,r)}if(n.hasChildNodes())for(var c=n.childElementCount-1;c>=0&&n.children[c];c--)e(t,n.children[c],r)},_o={"c-if":function(e,t,n){var r=t.getAttribute("c-if");null===r&&(r=t.getAttribute("c-ifnot"));var o=co(e,r.split("."),n);if(void 0===o)for(var i=[" == "," === "," !== "," != "," > "," < "," >= "," <= "],a=["boolean","number","undefined"],c=0;c<i.length;c++)if(r.includes(i[c])){var u=r,f=u.split(i[c]),l=co(e,f[0].split("."),n);if(!1===a.includes(String(jn(l))))return go(e,"".concat(f[0]," cannot be evaluated because it is not a boolean nor a number.")),!1;u=u.replace(f[0],l),o=(0,eval)(u)}return!([void 0,null,!1,0,""].indexOf(o)>-1)&&(t.removeAttribute("c-if"),!0)},"c-ifnot":function(e,t,n){var r=!_o["c-if"](e,t,n);return!0===r&&t.removeAttribute("c-ifnot"),r},"c-for":function(e,t,n){var r=t.getAttribute("c-for"),o=r.split(" in "),i=o[0],a=o[1].split(".");void 0===n&&(n={});var c=co(e,a,n);if(c){t.removeAttribute("c-for");for(var u=t.parentNode,f=0;f<c.length;f++){var l=c[f];n[i]=l;var s=t.cloneNode(!0);Ho(e,s,n),So(e,s,n),wo(e,s,n),i=(o=r.split(" in "))[0],u.appendChild(s)}return t.remove(),!0}return!1}},Bo="process"===w(i.process),Vo=String,Uo=TypeError,$o=function(e){if(function(e){return N(e)||null===e}(e))return e;throw new Uo("Can't set "+Vo(e)+" as a prototype")},qo=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{e=function(e,t,n){try{return b(K(Object.getOwnPropertyDescriptor(e,t)[n]))}catch(e){}}(Object.prototype,"__proto__","set"),e(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return je(n),$o(r),t?e(n,r):n.__proto__=r,n}}():void 0),Go=Pe.f,zo=de("toStringTag"),Wo=de("species"),Ko=TypeError,Xo=TypeError,Yo=function(e,t){if(e<t)throw new Xo("Not enough arguments");return e},Jo=/(?:ipad|iphone|ipod).*applewebkit/i.test(L),Qo=i.setImmediate,Zo=i.clearImmediate,ei=i.process,ti=i.Dispatch,ni=i.Function,ri=i.MessageChannel,oi=i.String,ii=0,ai={},ci="onreadystatechange";a((function(){Lo=i.location}));var ui=function(e){if(oe(ai,e)){var t=ai[e];delete ai[e],t()}},fi=function(e){return function(){ui(e)}},li=function(e){ui(e.data)},si=function(e){i.postMessage(oi(e),Lo.protocol+"//"+Lo.host)};Qo&&Zo||(Qo=function(e){Yo(arguments.length,1);var t=M(e)?e:ni(e),n=Xn(arguments,1);return ai[++ii]=function(){qr(t,void 0,n)},ko(ii),ii},Zo=function(e){delete ai[e]},Bo?ko=function(e){ei.nextTick(fi(e))}:ti&&ti.now?ko=function(e){ti.now(fi(e))}:ri&&!Jo?(Do=(Fo=new ri).port2,Fo.port1.onmessage=li,ko=Ft(Do.postMessage,Do)):i.addEventListener&&M(i.postMessage)&&!i.importScripts&&Lo&&"file:"!==Lo.protocol&&!a(si)?(ko=si,i.addEventListener("message",li,!1)):ko=ci in ye("script")?function(e){Cn.appendChild(ye("script"))[ci]=function(){Cn.removeChild(this),ui(e)}}:function(e){setTimeout(fi(e),0)});var di={set:Qo,clear:Zo},pi=Object.getOwnPropertyDescriptor,hi=function(){this.head=null,this.tail=null};hi.prototype={add:function(e){var t={item:e,next:null},n=this.tail;n?n.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}};var vi,gi,mi,bi,yi,Si=hi,wi=/ipad|iphone|ipod/i.test(L)&&"undefined"!=typeof Pebble,Ei=/web0s(?!.*chrome)/i.test(L),Oi=di.set,xi=i.MutationObserver||i.WebKitMutationObserver,Ti=i.document,ji=i.process,Ai=i.Promise,Ri=function(e){if(!c)return i[e];var t=pi(i,e);return t&&t.value}("queueMicrotask");if(!Ri){var Ii=new Si,Mi=function(){var e,t;for(Bo&&(e=ji.domain)&&e.exit();t=Ii.get();)try{t()}catch(e){throw Ii.head&&vi(),e}e&&e.enter()};Jo||Bo||Ei||!xi||!Ti?!wi&&Ai&&Ai.resolve?((bi=Ai.resolve(void 0)).constructor=Ai,yi=Ft(bi.then,bi),vi=function(){yi(Mi)}):Bo?vi=function(){ji.nextTick(Mi)}:(Oi=Ft(Oi,i),vi=function(){Oi(Mi)}):(gi=!0,mi=Ti.createTextNode(""),new xi(Mi).observe(mi,{characterData:!0}),vi=function(){mi.data=gi=!gi}),Ri=function(e){Ii.head||vi(),Ii.add(e)}}var Ni=Ri,Ci=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},Pi=i.Promise,Li="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,ki=!Li&&!Bo&&"object"==typeof window&&"object"==typeof document;Pi&&Pi.prototype;var Fi,Di,Hi,_i,Bi,Vi,Ui,$i=de("species"),qi=!1,Gi=M(i.PromiseRejectionEvent),zi=Nt("Promise",(function(){var e=$e(Pi),t=e!==String(Pi);if(!t&&66===_)return!0;if(!_||_<51||!/native code/.test(e)){var n=new Pi((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};if((n.constructor={})[$i]=r,!(qi=n.then((function(){}))instanceof r))return!0}return!t&&(ki||Li)&&!Gi})),Wi={CONSTRUCTOR:zi,REJECTION_EVENT:Gi,SUBCLASSING:qi},Ki=TypeError,Xi=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw new Ki("Bad Promise constructor");t=e,n=r})),this.resolve=K(t),this.reject=K(n)},Yi={f:function(e){return new Xi(e)}},Ji=di.set,Qi="Promise",Zi=Wi.CONSTRUCTOR,ea=Wi.REJECTION_EVENT,ta=Wi.SUBCLASSING,na=et.getterFor(Qi),ra=et.set,oa=Pi&&Pi.prototype,ia=Pi,aa=oa,ca=i.TypeError,ua=i.document,fa=i.process,la=Yi.f,sa=la,da=!!(ua&&ua.createEvent&&i.dispatchEvent),pa="unhandledrejection",ha=function(e){var t;return!(!N(e)||!M(t=e.then))&&t},va=function(e,t){var n,r,o,i=t.value,a=1===t.state,c=a?e.ok:e.fail,u=e.resolve,f=e.reject,s=e.domain;try{c?(a||(2===t.rejection&&Sa(t),t.rejection=1),!0===c?n=i:(s&&s.enter(),n=c(i),s&&(s.exit(),o=!0)),n===e.promise?f(new ca("Promise-chain cycle")):(r=ha(n))?l(r,n,u,f):u(n)):f(i)}catch(e){s&&!o&&s.exit(),f(e)}},ga=function(e,t){e.notified||(e.notified=!0,Ni((function(){for(var n,r=e.reactions;n=r.get();)va(n,e);e.notified=!1,t&&!e.rejection&&ba(e)})))},ma=function(e,t,n){var r,o;da?((r=ua.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),i.dispatchEvent(r)):r={promise:t,reason:n},!ea&&(o=i["on"+e])?o(r):e===pa&&function(e,t){try{1===arguments.length?console.error(e):console.error(e,t)}catch(e){}}("Unhandled promise rejection",n)},ba=function(e){l(Ji,i,(function(){var t,n=e.facade,r=e.value;if(ya(e)&&(t=Ci((function(){Bo?fa.emit("unhandledRejection",r,n):ma(pa,n,r)})),e.rejection=Bo||ya(e)?2:1,t.error))throw t.value}))},ya=function(e){return 1!==e.rejection&&!e.parent},Sa=function(e){l(Ji,i,(function(){var t=e.facade;Bo?fa.emit("rejectionHandled",t):ma("rejectionhandled",t,e.value)}))},wa=function(e,t,n){return function(r){e(t,r,n)}},Ea=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,ga(e,!0))},Oa=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw new ca("Promise can't be resolved itself");var r=ha(t);r?Ni((function(){var n={done:!1};try{l(r,t,wa(Oa,n,e),wa(Ea,n,e))}catch(t){Ea(n,t,e)}})):(e.value=t,e.state=1,ga(e,!1))}catch(t){Ea({done:!1},t,e)}}};if(Zi&&(aa=(ia=function(e){!function(e,t){if(P(t,e))return e;throw new Ko("Incorrect invocation")}(this,aa),K(e),l(Fi,this);var t=na(this);try{e(wa(Oa,t),wa(Ea,t))}catch(e){Ea(t,e)}}).prototype,(Fi=function(e){ra(this,{type:Qi,done:!1,notified:!1,parent:!1,reactions:new Si,rejection:!1,state:0,value:void 0})}).prototype=nt(aa,"then",(function(e,t){var n=na(this),r=la(Ao(this,ia));return n.parent=!0,r.ok=!M(e)||e,r.fail=M(t)&&t,r.domain=Bo?fa.domain:void 0,0===n.state?n.reactions.add(r):Ni((function(){va(r,n)})),r.promise})),Di=function(){var e=new Fi,t=na(e);this.promise=e,this.resolve=wa(Oa,t),this.reject=wa(Ea,t)},Yi.f=la=function(e){return e===ia||undefined===e?new Di(e):sa(e)},M(Pi)&&oa!==Object.prototype)){Hi=oa.then,ta||nt(oa,"then",(function(e,t){var n=this;return new ia((function(e,t){l(Hi,n,e,t)})).then(e,t)}),{unsafe:!0});try{delete oa.constructor}catch(e){}qo&&qo(oa,aa)}Pt({global:!0,constructor:!0,wrap:!0,forced:Zi},{Promise:ia}),Bi=Qi,Vi=!1,(_i=ia)&&!Vi&&(_i=_i.prototype),_i&&!oe(_i,zo)&&Go(_i,zo,{configurable:!0,value:Bi}),Ui=C(Qi),c&&Ui&&!Ui[Wo]&&cn(Ui,Wo,{configurable:!0,get:function(){return this}});var xa={},Ta=de("iterator"),ja=Array.prototype,Aa=de("iterator"),Ra=function(e){if(!T(e))return X(e,Aa)||X(e,"@@iterator")||xa[$t(e)]},Ia=TypeError,Ma=function(e,t,n){var r,o;je(e);try{if(!(r=X(e,"return"))){if("throw"===t)throw n;return n}r=l(r,e)}catch(e){o=!0,r=e}if("throw"===t)throw n;if(o)throw r;return je(r),n},Na=TypeError,Ca=function(e,t){this.stopped=e,this.result=t},Pa=Ca.prototype,La=function(e,t,n){var r,o,i,a,c,u,f,s,d=n&&n.that,p=!(!n||!n.AS_ENTRIES),h=!(!n||!n.IS_RECORD),v=!(!n||!n.IS_ITERATOR),g=!(!n||!n.INTERRUPTED),m=Ft(t,d),b=function(e){return r&&Ma(r,"normal",e),new Ca(!0,e)},y=function(e){return p?(je(e),g?m(e[0],e[1],b):m(e[0],e[1])):g?m(e,b):m(e)};if(h)r=e.iterator;else if(v)r=e;else{if(!(o=Ra(e)))throw new Na(z(e)+" is not iterable");if(void 0!==(s=o)&&(xa.Array===s||ja[Ta]===s)){for(i=0,a=dt(e);a>i;i++)if((c=y(e[i]))&&P(Pa,c))return c;return new Ca(!1)}r=function(e,t){var n=arguments.length<2?Ra(e):t;if(K(n))return je(l(n,e));throw new Ia(z(e)+" is not iterable")}(e,o)}for(u=h?e.next:r.next;!(f=l(u,r)).done;){try{c=y(f.value)}catch(e){Ma(r,"throw",e)}if("object"==typeof c&&c&&P(Pa,c))return c}return new Ca(!1)},ka=de("iterator"),Fa=!1;try{var Da=0,Ha={next:function(){return{done:!!Da++}},return:function(){Fa=!0}};Ha[ka]=function(){return this},Array.from(Ha,(function(){throw 2}))}catch(e){}var _a=Wi.CONSTRUCTOR||!function(e,t){try{if(!t&&!Fa)return!1}catch(e){return!1}var n=!1;try{var r={};r[ka]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n}((function(e){Pi.all(e).then(void 0,(function(){}))}));Pt({target:"Promise",stat:!0,forced:_a},{all:function(e){var t=this,n=Yi.f(t),r=n.resolve,o=n.reject,i=Ci((function(){var n=K(t.resolve),i=[],a=0,c=1;La(e,(function(e){var u=a++,f=!1;c++,l(n,t,e).then((function(e){f||(f=!0,i[u]=e,--c||r(i))}),o)})),--c||r(i)}));return i.error&&o(i.value),n.promise}});var Ba=Wi.CONSTRUCTOR,Va=Pi&&Pi.prototype;if(Pt({target:"Promise",proto:!0,forced:Ba,real:!0},{catch:function(e){return this.then(void 0,e)}}),M(Pi)){var Ua=C("Promise").prototype.catch;Va.catch!==Ua&&nt(Va,"catch",Ua,{unsafe:!0})}Pt({target:"Promise",stat:!0,forced:_a},{race:function(e){var t=this,n=Yi.f(t),r=n.reject,o=Ci((function(){var o=K(t.resolve);La(e,(function(e){l(o,t,e).then(n.resolve,r)}))}));return o.error&&r(o.value),n.promise}}),Pt({target:"Promise",stat:!0,forced:Wi.CONSTRUCTOR},{reject:function(e){var t=Yi.f(this);return(0,t.reject)(e),t.promise}});var $a=function(e,t){if(je(e),N(t)&&t.constructor===e)return t;var n=Yi.f(e);return(0,n.resolve)(t),n.promise},qa=Wi.CONSTRUCTOR;C("Promise"),Pt({target:"Promise",stat:!0,forced:qa},{resolve:function(e){return $a(this,e)}});var Ga=Pi&&Pi.prototype;if(Pt({target:"Promise",proto:!0,real:!0,forced:!!Pi&&a((function(){Ga.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=Ao(this,C("Promise")),n=M(e);return this.then(n?function(n){return $a(t,e()).then((function(){return n}))}:e,n?function(n){return $a(t,e()).then((function(){throw n}))}:e)}}),M(Pi)){var za=C("Promise").prototype.finally;Ga.finally!==za&&nt(Ga,"finally",za,{unsafe:!0})}var Wa="function"==typeof Bun&&Bun&&"string"==typeof Bun.version,Ka=i.Function,Xa=/MSIE .\./.test(L)||Wa&&function(){var e=i.Bun.version.split(".");return e.length<3||"0"===e[0]&&(e[1]<3||"3"===e[1]&&"0"===e[2])}(),Ya=function(e,t){var n=t?2:1;return Xa?function(r,o){var i=Yo(arguments.length,1)>n,a=M(r)?r:Ka(r),c=i?Xn(arguments,n):[],u=i?function(){qr(a,this,c)}:a;return t?e(u,o):e(u)}:e},Ja=Ya(i.setInterval,!0);Pt({global:!0,bind:!0,forced:i.setInterval!==Ja},{setInterval:Ja});var Qa=Ya(i.setTimeout,!0);Pt({global:!0,bind:!0,forced:i.setTimeout!==Qa},{setTimeout:Qa});return function(e){var t=this;return this.setData=function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]?this.data=e:Object.assign(this.data,e),this.render()},this.resetState=function(){this.state.loading=!1,this.state.error=!1,this.state.success=!1},this.axiosRequest=function(e,n,r){return function(e,t,n,r){if(!e.state.loading){e.resetState(),e.state.loading=!0;var o=r||0;e.render((function(){setTimeout((function(){axios.request(t).then((function(t){if(e.state.success=!0,n&&n.success instanceof Function){var r=n.success(t);r instanceof Object&&(t=r)}})).catch((function(t){e.state.error=!0,n&&n.error instanceof Function&&n.error(t)})).then((function(){e.state.loading=!1,n&&n.finally instanceof Function&&n.finally(),e.render()}))}),o)}))}}(t,e,n,r)},this.fetchRequest=function(e,n,r,o){return function(e,t,n,r,o){if(!e.state.loading){e.resetState(),e.state.loading=!0;var i=o||0;e.render((function(){setTimeout((function(){fetch(t,n).then((function(e){return e.json()})).then((function(t){t.error?(e.state.error=!0,r&&r.error instanceof Function&&r.error(t)):(e.state.success=!0,r&&r.success instanceof Function&&r.success(t))})).catch((function(t){e.state.error=!0,r&&r.error instanceof Function&&r.error(t)})).finally((function(){e.state.loading=!1,r&&r.finally instanceof Function&&r.finally(),e.render()}))}),i)}))}}(t,e,n,r,o)},this.prepareTmpDom=function(){var e=this,t=e.template.cloneNode(!0);return Ho(e,t),wo(e,t),t},this.render=function(e){var t=this;t.methods.beforeRender instanceof Function&&t.methods.beforeRender(t);var n=this.prepareTmpDom();"Idiomorph"===t.renderEngine?t.idiomorphRender(n):"plain"===t.renderEngine?t.plainRender(n):go(t,"".concat(t.renderEngine," renderEngine does not exist.")),t.methods.afterRender instanceof Function&&t.methods.afterRender(t),e instanceof Function&&e()},this.plainRender=function(e){this.el.innerHTML="",this.el.appendChild(e)},this.idiomorphRender=function(e){Tn.morph(this.el,e,{morphStyle:"innerHTML"})},this.Init=function(){var t=this;if(e.name?t.name=e.name:t.name="AppBlock",void 0===e)return!1;if(void 0!==e.el){if(null!==e.el){if(t.el=e.el,t.renderEngine=e.renderEngine?e.renderEngine:"Idiomorph",e.template)t.template=e.template.content;else for(t.template=document.createDocumentFragment();t.el.firstChild;)t.template.appendChild(t.el.firstChild);if(t.state={loading:!1,error:!1,success:!1},t.data={},e.data instanceof Object&&(t.data=e.data),t.utils=uo,t.utils.comp=t,t.methods={Parent:t,isLoading:function(e){return e.state.loading},isSuccessful:function(e){return e.state.success},hasError:function(e){return e.state.error},beforeRender:function(e){},afterRender:function(e){}},e.methods instanceof Object&&Object.assign(t.methods,e.methods),t.directives=_o,e.directives instanceof Object&&Object.assign(t.directives,e.directives),t.filters=mo,e.filters instanceof Object&&Object.assign(t.filters,e.filters),t.events={},e.events instanceof Object){Object.assign(t.events,e.events);var n=function(e){var n=e.split(" "),r=n[0],o=n[1];t.el.addEventListener(r,(function(n){t.el.querySelectorAll(o).forEach((function(r){n.srcElement===r&&t.events[e](n)}))}))};for(var r in t.events)n(r)}return t.events.Parent=t,t.render(),t}go(t,"The element you assigned to el is not present.")}else go(t,"el is empty. Please assign a DOM element to el.")},this.Init()}})); //# sourceMappingURL=appblocks.min.js.map