UNPKG

argon

Version:

Argon framework provides set of tools to build front-end applications for AEM

2 lines (1 loc) 49.2 kB
import t from"argon-logger";import{router as e,route as r,unroute as n,param as o}from"silkrouter";var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function a(t,e){return t(e={exports:{}},e.exports),e.exports}var s=function(t){return t&&t.Math==Math&&t},c=s("object"==typeof globalThis&&globalThis)||s("object"==typeof window&&window)||s("object"==typeof self&&self)||s("object"==typeof i&&i)||Function("return this")(),u=function(t){try{return!!t()}catch(t){return!0}},f=!u((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})),l=function(t){return"object"==typeof t?null!==t:"function"==typeof t},p=c.document,h=l(p)&&l(p.createElement),d=function(t){return h?p.createElement(t):{}},y=!f&&!u((function(){return 7!=Object.defineProperty(d("div"),"a",{get:function(){return 7}}).a})),g=function(t){if(!l(t))throw TypeError(String(t)+" is not an object");return t},v=function(t,e){if(!l(t))return t;var r,n;if(e&&"function"==typeof(r=t.toString)&&!l(n=r.call(t)))return n;if("function"==typeof(r=t.valueOf)&&!l(n=r.call(t)))return n;if(!e&&"function"==typeof(r=t.toString)&&!l(n=r.call(t)))return n;throw TypeError("Can't convert object to primitive value")},b=Object.defineProperty,m={f:f?b:function(t,e,r){if(g(t),e=v(e,!0),g(r),y)try{return b(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},w=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},E=f?function(t,e,r){return m.f(t,e,w(1,r))}:function(t,e,r){return t[e]=r,t},O=function(t,e){try{E(c,t,e)}catch(r){c[t]=e}return e},j=c["__core-js_shared__"]||O("__core-js_shared__",{}),T=a((function(t){(t.exports=function(t,e){return j[t]||(j[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.4.8",mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})})),A={}.hasOwnProperty,S=function(t,e){return A.call(t,e)},P=0,L=Math.random(),_=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++P+L).toString(36)},R=!!Object.getOwnPropertySymbols&&!u((function(){return!String(Symbol())})),x=R&&!Symbol.sham&&"symbol"==typeof Symbol(),C=T("wks"),I=c.Symbol,k=x?I:_,D=function(t){return S(C,t)||(R&&S(I,t)?C[t]=I[t]:C[t]=k("Symbol."+t)),C[t]},M={};M[D("toStringTag")]="z";var F="[object z]"===String(M),B=Function.toString;"function"!=typeof j.inspectSource&&(j.inspectSource=function(t){return B.call(t)});var N,U,q,G=j.inspectSource,H=c.WeakMap,$="function"==typeof H&&/native code/.test(G(H)),V=T("keys"),W=function(t){return V[t]||(V[t]=_(t))},z={},Y=c.WeakMap;if($){var J=new Y,K=J.get,X=J.has,Q=J.set;N=function(t,e){return Q.call(J,t,e),e},U=function(t){return K.call(J,t)||{}},q=function(t){return X.call(J,t)}}else{var Z=W("state");z[Z]=!0,N=function(t,e){return E(t,Z,e),e},U=function(t){return S(t,Z)?t[Z]:{}},q=function(t){return S(t,Z)}}var tt={set:N,get:U,has:q,enforce:function(t){return q(t)?U(t):N(t,{})},getterFor:function(t){return function(e){var r;if(!l(e)||(r=U(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}}},et=a((function(t){var e=tt.get,r=tt.enforce,n=String(String).split("String");(t.exports=function(t,e,o,i){var a=!!i&&!!i.unsafe,s=!!i&&!!i.enumerable,u=!!i&&!!i.noTargetGet;"function"==typeof o&&("string"!=typeof e||S(o,"name")||E(o,"name",e),r(o).source=n.join("string"==typeof e?e:"")),t!==c?(a?!u&&t[e]&&(s=!0):delete t[e],s?t[e]=o:E(t,e,o)):s?t[e]=o:O(e,o)})(Function.prototype,"toString",(function(){return"function"==typeof this&&e(this).source||G(this)}))})),rt={}.toString,nt=function(t){return rt.call(t).slice(8,-1)},ot=D("toStringTag"),it="Arguments"==nt(function(){return arguments}()),at=F?nt:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),ot))?r:it?nt(e):"Object"==(n=nt(e))&&"function"==typeof e.callee?"Arguments":n},st=F?{}.toString:function(){return"[object "+at(this)+"]"};F||et(Object.prototype,"toString",st,{unsafe:!0});var ct,ut,ft,lt=Math.ceil,pt=Math.floor,ht=function(t){return isNaN(t=+t)?0:(t>0?pt:lt)(t)},dt=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},yt=function(t){return function(e,r){var n,o,i=String(dt(e)),a=ht(r),s=i.length;return a<0||a>=s?t?"":void 0:(n=i.charCodeAt(a))<55296||n>56319||a+1===s||(o=i.charCodeAt(a+1))<56320||o>57343?t?i.charAt(a):n:t?i.slice(a,a+2):o-56320+(n-55296<<10)+65536}},gt={codeAt:yt(!1),charAt:yt(!0)},vt={}.propertyIsEnumerable,bt=Object.getOwnPropertyDescriptor,mt={f:bt&&!vt.call({1:2},1)?function(t){var e=bt(this,t);return!!e&&e.enumerable}:vt},wt="".split,Et=u((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==nt(t)?wt.call(t,""):Object(t)}:Object,Ot=function(t){return Et(dt(t))},jt=Object.getOwnPropertyDescriptor,Tt={f:f?jt:function(t,e){if(t=Ot(t),e=v(e,!0),y)try{return jt(t,e)}catch(t){}if(S(t,e))return w(!mt.f.call(t,e),t[e])}},At=c,St=function(t){return"function"==typeof t?t:void 0},Pt=function(t,e){return arguments.length<2?St(At[t])||St(c[t]):At[t]&&At[t][e]||c[t]&&c[t][e]},Lt=Math.min,_t=function(t){return t>0?Lt(ht(t),9007199254740991):0},Rt=Math.max,xt=Math.min,Ct=function(t){return function(e,r,n){var o,i=Ot(e),a=_t(i.length),s=function(t,e){var r=ht(t);return r<0?Rt(r+e,0):xt(r,e)}(n,a);if(t&&r!=r){for(;a>s;)if((o=i[s++])!=o)return!0}else for(;a>s;s++)if((t||s in i)&&i[s]===r)return t||s||0;return!t&&-1}},It={includes:Ct(!0),indexOf:Ct(!1)},kt=It.indexOf,Dt=function(t,e){var r,n=Ot(t),o=0,i=[];for(r in n)!S(z,r)&&S(n,r)&&i.push(r);for(;e.length>o;)S(n,r=e[o++])&&(~kt(i,r)||i.push(r));return i},Mt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ft=Mt.concat("length","prototype"),Bt={f:Object.getOwnPropertyNames||function(t){return Dt(t,Ft)}},Nt={f:Object.getOwnPropertySymbols},Ut=Pt("Reflect","ownKeys")||function(t){var e=Bt.f(g(t)),r=Nt.f;return r?e.concat(r(t)):e},qt=function(t,e){for(var r=Ut(e),n=m.f,o=Tt.f,i=0;i<r.length;i++){var a=r[i];S(t,a)||n(t,a,o(e,a))}},Gt=/#|\.prototype\./,Ht=function(t,e){var r=Vt[$t(t)];return r==zt||r!=Wt&&("function"==typeof e?u(e):!!e)},$t=Ht.normalize=function(t){return String(t).replace(Gt,".").toLowerCase()},Vt=Ht.data={},Wt=Ht.NATIVE="N",zt=Ht.POLYFILL="P",Yt=Ht,Jt=Tt.f,Kt=function(t,e){var r,n,o,i,a,s=t.target,u=t.global,f=t.stat;if(r=u?c:f?c[s]||O(s,{}):(c[s]||{}).prototype)for(n in e){if(i=e[n],o=t.noTargetGet?(a=Jt(r,n))&&a.value:r[n],!Yt(u?n:s+(f?".":"#")+n,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;qt(i,o)}(t.sham||o&&o.sham)&&E(i,"sham",!0),et(r,n,i,t)}},Xt=function(t){return Object(dt(t))},Qt=!u((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),Zt=W("IE_PROTO"),te=Object.prototype,ee=Qt?Object.getPrototypeOf:function(t){return t=Xt(t),S(t,Zt)?t[Zt]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?te:null},re=D("iterator"),ne=!1;[].keys&&("next"in(ft=[].keys())?(ut=ee(ee(ft)))!==Object.prototype&&(ct=ut):ne=!0),null==ct&&(ct={}),S(ct,re)||E(ct,re,(function(){return this}));var oe={IteratorPrototype:ct,BUGGY_SAFARI_ITERATORS:ne},ie=Object.keys||function(t){return Dt(t,Mt)},ae=f?Object.defineProperties:function(t,e){g(t);for(var r,n=ie(e),o=n.length,i=0;o>i;)m.f(t,r=n[i++],e[r]);return t},se=Pt("document","documentElement"),ce=W("IE_PROTO"),ue=function(){},fe=function(){var t,e=d("iframe"),r=Mt.length;for(e.style.display="none",se.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),fe=t.F;r--;)delete fe.prototype[Mt[r]];return fe()},le=Object.create||function(t,e){var r;return null!==t?(ue.prototype=g(t),r=new ue,ue.prototype=null,r[ce]=t):r=fe(),void 0===e?r:ae(r,e)};z[ce]=!0;var pe=m.f,he=D("toStringTag"),de=function(t,e,r){t&&!S(t=r?t:t.prototype,he)&&pe(t,he,{configurable:!0,value:e})},ye={},ge=oe.IteratorPrototype,ve=function(){return this},be=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(r,[]),e=r instanceof Array}catch(t){}return function(r,n){return g(r),function(t){if(!l(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype")}(n),e?t.call(r,n):r.__proto__=n,r}}():void 0),me=oe.IteratorPrototype,we=oe.BUGGY_SAFARI_ITERATORS,Ee=D("iterator"),Oe=function(){return this},je=function(t,e,r,n,o,i,a){!function(t,e,r){var n=e+" Iterator";t.prototype=le(ge,{next:w(1,r)}),de(t,n,!1),ye[n]=ve}(r,e,n);var s,c,u,f=function(t){if(t===o&&y)return y;if(!we&&t in h)return h[t];switch(t){case"keys":case"values":case"entries":return function(){return new r(this,t)}}return function(){return new r(this)}},l=e+" Iterator",p=!1,h=t.prototype,d=h[Ee]||h["@@iterator"]||o&&h[o],y=!we&&d||f(o),g="Array"==e&&h.entries||d;if(g&&(s=ee(g.call(new t)),me!==Object.prototype&&s.next&&(ee(s)!==me&&(be?be(s,me):"function"!=typeof s[Ee]&&E(s,Ee,Oe)),de(s,l,!0))),"values"==o&&d&&"values"!==d.name&&(p=!0,y=function(){return d.call(this)}),h[Ee]!==y&&E(h,Ee,y),ye[e]=y,o)if(c={values:f("values"),keys:i?y:f("keys"),entries:f("entries")},a)for(u in c)!we&&!p&&u in h||et(h,u,c[u]);else Kt({target:e,proto:!0,forced:we||p},c);return c},Te=gt.charAt,Ae=tt.set,Se=tt.getterFor("String Iterator");je(String,"String",(function(t){Ae(this,{type:"String Iterator",string:String(t),index:0})}),(function(){var t,e=Se(this),r=e.string,n=e.index;return n>=r.length?{value:void 0,done:!0}:(t=Te(r,n),e.index+=t.length,{value:t,done:!1})}));var Pe={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},Le=D("unscopables"),_e=Array.prototype;null==_e[Le]&&E(_e,Le,le(null));var Re=function(t){_e[Le][t]=!0},xe=tt.set,Ce=tt.getterFor("Array Iterator"),Ie=je(Array,"Array",(function(t,e){xe(this,{type:"Array Iterator",target:Ot(t),index:0,kind:e})}),(function(){var t=Ce(this),e=t.target,r=t.kind,n=t.index++;return!e||n>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:e[n],done:!1}:{value:[n,e[n]],done:!1}}),"values");ye.Arguments=ye.Array,Re("keys"),Re("values"),Re("entries");var ke=D("iterator"),De=D("toStringTag"),Me=Ie.values;for(var Fe in Pe){var Be=c[Fe],Ne=Be&&Be.prototype;if(Ne){if(Ne[ke]!==Me)try{E(Ne,ke,Me)}catch(t){Ne[ke]=Me}if(Ne[De]||E(Ne,De,Fe),Pe[Fe])for(var Ue in Ie)if(Ne[Ue]!==Ie[Ue])try{E(Ne,Ue,Ie[Ue])}catch(t){Ne[Ue]=Ie[Ue]}}}var qe=c.Promise,Ge=D("species"),He=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t},$e=D("iterator"),Ve=Array.prototype,We=function(t,e,r){if(He(t),void 0===e)return t;switch(r){case 0:return function(){return t.call(e)};case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,o){return t.call(e,r,n,o)}}return function(){return t.apply(e,arguments)}},ze=D("iterator"),Ye=function(t,e,r,n){try{return n?e(g(r)[0],r[1]):e(r)}catch(e){var o=t.return;throw void 0!==o&&g(o.call(t)),e}},Je=a((function(t){var e=function(t,e){this.stopped=t,this.result=e};(t.exports=function(t,r,n,o,i){var a,s,c,u,f,l,p,h,d=We(r,n,o?2:1);if(i)a=t;else{if("function"!=typeof(s=function(t){if(null!=t)return t[ze]||t["@@iterator"]||ye[at(t)]}(t)))throw TypeError("Target is not iterable");if(void 0!==(h=s)&&(ye.Array===h||Ve[$e]===h)){for(c=0,u=_t(t.length);u>c;c++)if((f=o?d(g(p=t[c])[0],p[1]):d(t[c]))&&f instanceof e)return f;return new e(!1)}a=s.call(t)}for(l=a.next;!(p=l.call(a)).done;)if("object"==typeof(f=Ye(a,d,p.value,o))&&f&&f instanceof e)return f;return new e(!1)}).stop=function(t){return new e(!0,t)}})),Ke=D("iterator"),Xe=!1;try{var Qe=0,Ze={next:function(){return{done:!!Qe++}},return:function(){Xe=!0}};Ze[Ke]=function(){return this},Array.from(Ze,(function(){throw 2}))}catch(t){}var tr,er,rr,nr=D("species"),or=function(t,e){var r,n=g(t).constructor;return void 0===n||null==(r=g(n)[nr])?e:He(r)},ir=Pt("navigator","userAgent")||"",ar=/(iphone|ipod|ipad).*applewebkit/i.test(ir),sr=c.location,cr=c.setImmediate,ur=c.clearImmediate,fr=c.process,lr=c.MessageChannel,pr=c.Dispatch,hr=0,dr={},yr=function(t){if(dr.hasOwnProperty(t)){var e=dr[t];delete dr[t],e()}},gr=function(t){return function(){yr(t)}},vr=function(t){yr(t.data)},br=function(t){c.postMessage(t+"",sr.protocol+"//"+sr.host)};cr&&ur||(cr=function(t){for(var e=[],r=1;arguments.length>r;)e.push(arguments[r++]);return dr[++hr]=function(){("function"==typeof t?t:Function(t)).apply(void 0,e)},tr(hr),hr},ur=function(t){delete dr[t]},"process"==nt(fr)?tr=function(t){fr.nextTick(gr(t))}:pr&&pr.now?tr=function(t){pr.now(gr(t))}:lr&&!ar?(rr=(er=new lr).port2,er.port1.onmessage=vr,tr=We(rr.postMessage,rr,1)):!c.addEventListener||"function"!=typeof postMessage||c.importScripts||u(br)?tr="onreadystatechange"in d("script")?function(t){se.appendChild(d("script")).onreadystatechange=function(){se.removeChild(this),yr(t)}}:function(t){setTimeout(gr(t),0)}:(tr=br,c.addEventListener("message",vr,!1)));var mr,wr,Er,Or,jr,Tr,Ar,Sr,Pr={set:cr,clear:ur},Lr=Tt.f,_r=Pr.set,Rr=c.MutationObserver||c.WebKitMutationObserver,xr=c.process,Cr=c.Promise,Ir="process"==nt(xr),kr=Lr(c,"queueMicrotask"),Dr=kr&&kr.value;Dr||(mr=function(){var t,e;for(Ir&&(t=xr.domain)&&t.exit();wr;){e=wr.fn,wr=wr.next;try{e()}catch(t){throw wr?Or():Er=void 0,t}}Er=void 0,t&&t.enter()},Ir?Or=function(){xr.nextTick(mr)}:Rr&&!ar?(jr=!0,Tr=document.createTextNode(""),new Rr(mr).observe(Tr,{characterData:!0}),Or=function(){Tr.data=jr=!jr}):Cr&&Cr.resolve?(Ar=Cr.resolve(void 0),Sr=Ar.then,Or=function(){Sr.call(Ar,mr)}):Or=function(){_r.call(c,mr)});var Mr,Fr,Br=Dr||function(t){var e={fn:t,next:void 0};Er&&(Er.next=e),wr||(wr=e,Or()),Er=e},Nr=function(t){var e,r;this.promise=new t((function(t,n){if(void 0!==e||void 0!==r)throw TypeError("Bad Promise constructor");e=t,r=n})),this.resolve=He(e),this.reject=He(r)},Ur={f:function(t){return new Nr(t)}},qr=function(t,e){if(g(t),l(e)&&e.constructor===t)return e;var r=Ur.f(t);return(0,r.resolve)(e),r.promise},Gr=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},Hr=c.process,$r=Hr&&Hr.versions,Vr=$r&&$r.v8;Vr?Fr=(Mr=Vr.split("."))[0]+Mr[1]:ir&&(!(Mr=ir.match(/Edge\/(\d+)/))||Mr[1]>=74)&&(Mr=ir.match(/Chrome\/(\d+)/))&&(Fr=Mr[1]);var Wr,zr,Yr,Jr,Kr=Fr&&+Fr,Xr=Pr.set,Qr=D("species"),Zr="Promise",tn=tt.get,en=tt.set,rn=tt.getterFor(Zr),nn=qe,on=c.TypeError,an=c.document,sn=c.process,cn=Pt("fetch"),un=Ur.f,fn=un,ln="process"==nt(sn),pn=!!(an&&an.createEvent&&c.dispatchEvent),hn=Yt(Zr,(function(){if(!(G(nn)!==String(nn))){if(66===Kr)return!0;if(!ln&&"function"!=typeof PromiseRejectionEvent)return!0}if(Kr>=51&&/native code/.test(nn))return!1;var t=nn.resolve(1),e=function(t){t((function(){}),(function(){}))};return(t.constructor={})[Qr]=e,!(t.then((function(){}))instanceof e)})),dn=hn||!function(t,e){if(!e&&!Xe)return!1;var r=!1;try{var n={};n[Ke]=function(){return{next:function(){return{done:r=!0}}}},t(n)}catch(t){}return r}((function(t){nn.all(t).catch((function(){}))})),yn=function(t){var e;return!(!l(t)||"function"!=typeof(e=t.then))&&e},gn=function(t,e,r){if(!e.notified){e.notified=!0;var n=e.reactions;Br((function(){for(var o=e.value,i=1==e.state,a=0;n.length>a;){var s,c,u,f=n[a++],l=i?f.ok:f.fail,p=f.resolve,h=f.reject,d=f.domain;try{l?(i||(2===e.rejection&&wn(t,e),e.rejection=1),!0===l?s=o:(d&&d.enter(),s=l(o),d&&(d.exit(),u=!0)),s===f.promise?h(on("Promise-chain cycle")):(c=yn(s))?c.call(s,p,h):p(s)):h(o)}catch(t){d&&!u&&d.exit(),h(t)}}e.reactions=[],e.notified=!1,r&&!e.rejection&&bn(t,e)}))}},vn=function(t,e,r){var n,o;pn?((n=an.createEvent("Event")).promise=e,n.reason=r,n.initEvent(t,!1,!0),c.dispatchEvent(n)):n={promise:e,reason:r},(o=c["on"+t])?o(n):"unhandledrejection"===t&&function(t,e){var r=c.console;r&&r.error&&(1===arguments.length?r.error(t):r.error(t,e))}("Unhandled promise rejection",r)},bn=function(t,e){Xr.call(c,(function(){var r,n=e.value;if(mn(e)&&(r=Gr((function(){ln?sn.emit("unhandledRejection",n,t):vn("unhandledrejection",t,n)})),e.rejection=ln||mn(e)?2:1,r.error))throw r.value}))},mn=function(t){return 1!==t.rejection&&!t.parent},wn=function(t,e){Xr.call(c,(function(){ln?sn.emit("rejectionHandled",t):vn("rejectionhandled",t,e.value)}))},En=function(t,e,r,n){return function(o){t(e,r,o,n)}},On=function(t,e,r,n){e.done||(e.done=!0,n&&(e=n),e.value=r,e.state=2,gn(t,e,!0))},jn=function(t,e,r,n){if(!e.done){e.done=!0,n&&(e=n);try{if(t===r)throw on("Promise can't be resolved itself");var o=yn(r);o?Br((function(){var n={done:!1};try{o.call(r,En(jn,t,n,e),En(On,t,n,e))}catch(r){On(t,n,r,e)}})):(e.value=r,e.state=1,gn(t,e,!1))}catch(r){On(t,{done:!1},r,e)}}};hn&&(nn=function(t){!function(t,e,r){if(!(t instanceof e))throw TypeError("Incorrect "+(r?r+" ":"")+"invocation")}(this,nn,Zr),He(t),Wr.call(this);var e=tn(this);try{t(En(jn,this,e),En(On,this,e))}catch(t){On(this,e,t)}},(Wr=function(t){en(this,{type:Zr,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=function(t,e,r){for(var n in e)et(t,n,e[n],r);return t}(nn.prototype,{then:function(t,e){var r=rn(this),n=un(or(this,nn));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=ln?sn.domain:void 0,r.parent=!0,r.reactions.push(n),0!=r.state&&gn(this,r,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),zr=function(){var t=new Wr,e=tn(t);this.promise=t,this.resolve=En(jn,t,e),this.reject=En(On,t,e)},Ur.f=un=function(t){return t===nn||t===Yr?new zr(t):fn(t)},"function"==typeof qe&&(Jr=qe.prototype.then,et(qe.prototype,"then",(function(t,e){var r=this;return new nn((function(t,e){Jr.call(r,t,e)})).then(t,e)}),{unsafe:!0}),"function"==typeof cn&&Kt({global:!0,enumerable:!0,forced:!0},{fetch:function(t){return qr(nn,cn.apply(c,arguments))}}))),Kt({global:!0,wrap:!0,forced:hn},{Promise:nn}),de(nn,Zr,!1),function(t){var e=Pt(t),r=m.f;f&&e&&!e[Ge]&&r(e,Ge,{configurable:!0,get:function(){return this}})}(Zr),Yr=Pt(Zr),Kt({target:Zr,stat:!0,forced:hn},{reject:function(t){var e=un(this);return e.reject.call(void 0,t),e.promise}}),Kt({target:Zr,stat:!0,forced:hn},{resolve:function(t){return qr(this,t)}}),Kt({target:Zr,stat:!0,forced:dn},{all:function(t){var e=this,r=un(e),n=r.resolve,o=r.reject,i=Gr((function(){var r=He(e.resolve),i=[],a=0,s=1;Je(t,(function(t){var c=a++,u=!1;i.push(void 0),s++,r.call(e,t).then((function(t){u||(u=!0,i[c]=t,--s||n(i))}),o)})),--s||n(i)}));return i.error&&o(i.value),r.promise},race:function(t){var e=this,r=un(e),n=r.reject,o=Gr((function(){var o=He(e.resolve);Je(t,(function(t){o.call(e,t).then(r.resolve,n)}))}));return o.error&&n(o.value),r.promise}}),Kt({target:"Promise",stat:!0},{allSettled:function(t){var e=this,r=Ur.f(e),n=r.resolve,o=r.reject,i=Gr((function(){var r=He(e.resolve),o=[],i=0,a=1;Je(t,(function(t){var s=i++,c=!1;o.push(void 0),a++,r.call(e,t).then((function(t){c||(c=!0,o[s]={status:"fulfilled",value:t},--a||n(o))}),(function(t){c||(c=!0,o[s]={status:"rejected",reason:t},--a||n(o))}))})),--a||n(o)}));return i.error&&o(i.value),r.promise}});var Tn=!!qe&&u((function(){qe.prototype.finally.call({then:function(){}},(function(){}))}));Kt({target:"Promise",proto:!0,real:!0,forced:Tn},{finally:function(t){var e=or(this,Pt("Promise")),r="function"==typeof t;return this.then(r?function(r){return qr(e,t()).then((function(){return r}))}:t,r?function(r){return qr(e,t()).then((function(){throw r}))}:t)}}),"function"!=typeof qe||qe.prototype.finally||et(qe.prototype,"finally",Pt("Promise").prototype.finally);At.Promise;var An=tt.set,Sn=tt.getterFor("AggregateError"),Pn=function(t,e){var r=this;if(!(r instanceof Pn))return new Pn(t,e);be&&(r=be(new Error(e),ee(r)));var n=[];return Je(t,n.push,n),f?An(r,{errors:n,type:"AggregateError"}):r.errors=n,void 0!==e&&E(r,"message",String(e)),r};Pn.prototype=le(Error.prototype,{constructor:w(5,Pn),message:w(5,""),name:w(5,"AggregateError")}),f&&m.f(Pn.prototype,"errors",{get:function(){return Sn(this).errors},configurable:!0}),Kt({global:!0},{AggregateError:Pn}),Kt({target:"Promise",stat:!0},{try:function(t){var e=Ur.f(this),r=Gr(t);return(r.error?e.reject:e.resolve)(r.value),e.promise}});Kt({target:"Promise",stat:!0},{any:function(t){var e=this,r=Ur.f(e),n=r.resolve,o=r.reject,i=Gr((function(){var r=He(e.resolve),i=[],a=0,s=1,c=!1;Je(t,(function(t){var u=a++,f=!1;i.push(void 0),s++,r.call(e,t).then((function(t){f||c||(c=!0,n(t))}),(function(t){f||c||(f=!0,i[u]=t,--s||o(new(Pt("AggregateError"))(i,"No one promise resolved")))}))})),--s||o(new(Pt("AggregateError"))(i,"No one promise resolved"))}));return i.error&&o(i.value),r.promise}});const Ln="init.core",_n="Promise returned an invalid response.\nFollowing are the valid signatures:\n1. { template, target, data }\n2. { template, target, error },\n3. { target, html }",Rn="Couldn't resolve target reference.",xn='HTML or Promise returned by "render" method is invalid.\nHint: If you are using "render.fn" module to render components, use spread operator while combining it with regular HTML:\ne.g. return [\'<div>Regular HTML</div>\', ...render.fn({ ... })];',Cn="Target template is missing.",In="Provided URL is invalid.",kn='Invalid schema for URL object. Allowed fields are "path" and "data".',Dn="Please provide a valid template name.",Mn="Please provide a valid selector.",Fn="Render requires a template object.",Bn="Invalid route object. Routes should be passed using below format:\n[\n {\n route: '/path/to/route',\n component: 'ComponentClassName'\n },\n ...\n]",Nn="Provided route is not defined!";var Un=It.includes;Kt({target:"Array",proto:!0},{includes:function(t){return Un(this,t,arguments.length>1?arguments[1]:void 0)}}),Re("includes");var qn=Function.call,Gn=function(t,e,r){return We(qn,c[t].prototype[e],r)};Gn("Array","includes");if(void 0===window.CustomEvent){const t=function(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};const r=document.createEvent("CustomEvent");return r.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),r};t.prototype=window.Event.prototype,window.CustomEvent=t}function Hn(t){return"string"==typeof t||t instanceof Wn||t instanceof Node||t instanceof NodeList||Array.isArray(t)}function $n(t){return t&&"object"==typeof t?JSON.stringify(t):t}function Vn(t){let e="";if("string"==typeof t)for(let r=0;r<t.length;r++)t.charCodeAt(r)>=65&&t.charCodeAt(r)<=90?e+=`-${t.charAt(r).toLowerCase()}`:e+=t.charAt(r);return e}class Wn{constructor(t,e){if(this.length=0,Hn(t)){if("string"==typeof t){const r="<"===t.trim().charAt(0);if(e=e||r)if(r){const e=document.createElement("div");e.innerHTML=t,t=e.childNodes}else{const e=document.createDocumentFragment();e.appendChild(document.createTextNode(t)),t=[e]}else t=document.querySelectorAll(t)}t instanceof Node&&(t=[t]);for(let e=0;e<t.length;e++)[1,9,11].includes(t[e].nodeType)&&(this[this.length++]=t[e])}}trigger(t,e){return this.each(r=>{const n=new window.CustomEvent(t,{bubbles:!0,cancelable:!0,detail:e||[]});r.dispatchEvent(n)}),this}on(t,e,r,n,o){const i=this;return 2===arguments.length&&(n=e,e=void 0),3===arguments.length&&("boolean"==typeof r&&(o=r,n=e,e=r=void 0),"function"==typeof r&&(n=r,Hn(e)?r=void 0:(r=e,e=void 0))),4===arguments.length&&"boolean"==typeof n&&(o=n,n=r,Hn(e)?r=void 0:(r=e,e=void 0)),this.each(a=>{a.addEventListener(t,(function(t){t.data=r;let o=[t];if(Array.isArray(t.detail)&&(o=o.concat(t.detail)),e){const r=i.find(e).add(i).has(t.target);r.length&&n.apply(r[0],o)}else n.apply(this,o)}),o)}),this}html(t){return void 0===t?this.map(t=>t.innerHTML).join(""):(null!==t&&this.each(e=>{e.innerHTML=t.toString()}),this)}append(t){return this.each((e,r)=>{new Wn(t,"string"==typeof t).clone(0===r).each(t=>{e.appendChild(t)})}),this}prepend(t){const e=this.children().detach();this.append(t).append(e)}detach(){const t=document.createDocumentFragment();return this.each(e=>{t.appendChild(e)}),new Wn([t])}children(){const t=[];return this.each(e=>{t.push(...e.childNodes)}),new Wn(t)}has(t){const e=new Wn(t),r=[];return this.each(t=>{e.each(e=>{t!==e&&!t.contains(e)||r.includes(t)||r.push(t)})}),new Wn(r)}contains(t){return this.has(t).length>0}filter(t){const e=new Wn;return"function"==typeof t&&this.each((r,n)=>{t.apply(r,[r,n])&&(e[e.length++]=r)}),e}clone(t){return t?this:new Wn(this.map(t=>t.cloneNode(!0)))}map(t){const e=[];return"function"==typeof t&&this.each((r,n)=>{e.push(t.apply(r,[r,n]))}),e}each(t){if("function"==typeof t)for(let e=0;e<this.length;e++)t.apply(this[e],[this[e],e]);return this}find(t){const e=[];return"string"==typeof t&&this.each(r=>{new Wn(r.querySelectorAll(t)).each(t=>{e.includes(t)||e.push(t)})}),new Wn(e)}data(t,e){if(1===arguments.length){if("string"==typeof t)return function(t){switch(t){case"true":return!0;case"false":return!1;case"NaN":return NaN;case"null":case"NULL":return null;case"undefined":return;default:return isNaN(t)?t:+t}}(this.attr(`data-${Vn(t)}`));if(t&&"object"==typeof t){const e={};Object.keys(t).forEach(r=>{e[`data-${Vn(r)}`]=t[r]}),this.attr(e)}return this}return 2===arguments.length&&this.attr(`data-${Vn(t)}`,e),this}attr(t,e){return 1===arguments.length?"string"==typeof t?function(t){if("string"==typeof t)try{return JSON.parse(t)}catch(t){}return t}(this[0].getAttribute(t)):(t&&"object"==typeof t&&Object.keys(t).forEach(e=>{this[0].setAttribute(Vn(e),$n(t[e]))}),this):(2===arguments.length&&"string"==typeof t&&this[0].setAttribute(Vn(t),$n(e)),this)}add(t){return new Wn(t).each(t=>{this.filter(e=>e===t).length||(this[this.length++]=t)}),this}empty(){return this.html("")}}function zn(t){return["complete","interactive"].includes(this.readyState())&&"function"==typeof t}class Yn extends Wn{constructor(...t){super(...t)}ready(t){return zn.apply(this,[t])?setTimeout(t.bind(this[0]),0):this.on("DOMContentLoaded",()=>{zn.apply(this,[t])&&t.apply(this[0])}),this}readyState(){return this[0].readyState}}function Jn(){let t=Array.prototype.slice.call(arguments);if("function"==typeof t[0]){const e=t[0];return t=[document],new Yn(...t).ready(e)}return arguments[0]===document?new Yn(...t):new Wn(...t)}const Kn=new t;function Xn(t,e){return!(!t||"object"!=typeof t)&&Object.prototype.hasOwnProperty.call(t,e)}class Qn{constructor(t,n){if(this.subscriptions=[],this.hashMode=n,!Array.isArray(t))throw new TypeError(Bn);{const o=[],i=[];t.forEach(t=>{if(!Xn(t,"component"))throw new TypeError(Bn);if(Xn(t,"route")){const e=`${n?"#":""}${t.route}`;o.includes(e)||o.push(e)}else if(Xn(t,"error")){const e=`${n?"#":""}${t.error}`;o.includes(e)||o.push(e),i.includes(e)||i.push(e)}}),this.routeList=t,this.routeFn=t=>{if(n&&t.hash||!n)if(o.includes(t.route)){const{data:e,params:r,query:n,route:o}=t;this.currentRoute={route:o,data:e,params:r,query:n},this.subscriptions.forEach(t=>{t.apply(this,[this.currentRoute])})}else{if(!i.length)throw new Error(Nn);e.set(i[0],!0)}},r(this.routeFn),!window.location.hash&&n&&e.set("#/",!0)}}routes(){return this.routeList.map(t=>({route:`${this.hashMode?"#":""}${t.route}`,component:t.component}))}destroy(){this.subscriptions.length=0,n(this.routeFn)}navigate(){return e.set(...arguments),this}subscribe(t){return"function"!=typeof t||this.subscriptions.includes(t)||this.subscriptions.push(t),this}}function Zn(){return new Qn(...arguments)}const to=Jn(document.body);function eo(t,e){const r=Jn(e||this.root);r[r.data("rendered")?"append":"html"](t),r.data("rendered",!0)}function ro(t){const e=Jn(t);return 1===e.length&&e[0]===this.root?Jn(this.root):Jn(this.root).find(t)}function no(t){try{const e=ro.apply(this,[t.target]),r=t.data||t.error,n=t.template;let o=t.html;if(!e.length)throw new Error(Rn);o=n?n(r):$n(r),eo.apply(this,[o,e]),to.trigger(Ln,[this.root])}catch(t){Kn.error("[Argon]:",t)}}function oo(t){(Array.isArray(t)?t:[t]).forEach(t=>{if("string"==typeof t)eo.apply(this,[t]),to.trigger(Ln,[this.root]);else if("function"==typeof t)eo.apply(this,[t()]),to.trigger(Ln,[this.root]);else if(t&&"object"==typeof t){if(Array.isArray(t))throw new TypeError(_n);no.apply(this,[t])}})}function io(t){t.then(t=>{oo.apply(this,[t])}).catch(t=>{"function"==typeof this.onError&&(oo.apply(this,[t]),this.onError(t))})}function ao(t,e){const{route:r,data:n,params:o,query:i}=t.currentRoute,a=t.routes().filter(t=>t.route===r).map(t=>t.component);Jn(this.root).data("rendered","false").data("module",[...e,...a].join(",")),to.trigger(Ln,[this.parent,{data:n,params:o,query:i}])}function so(t){try{const e=Jn(this.root).data("module"),r=[];if("string"==typeof e&&r.push(...e.split(",").map(t=>t.trim())),t instanceof Qn){const e=this.doDestroy;this.doDestroy=()=>{t.destroy(),"function"==typeof e&&e.apply(this)},t.currentRoute&&ao.apply(this,[t,r]),t.subscribe(()=>{ao.apply(this,[t,r])})}else if("string"==typeof t)eo.apply(this,[t]);else if("function"==typeof t)eo.apply(this,[t()]);else{if(!Array.isArray(t)&&!t.then)throw new TypeError(xn);(t=t.length?t:[t]).forEach(t=>{if("string"==typeof t)eo.apply(this,[t]);else if("function"==typeof t)eo.apply(this,[t()]);else{if(!t.then)throw new TypeError(xn);io.apply(this,[t])}})}}catch(t){Kn.error("[Argon]:",t)}}class co{constructor({root:t,parent:e,routeData:r}){this.root=t,this.parent=e,this.routeData=r}init(){"function"==typeof this.doInit&&this.doInit(this.root,this.parent),"function"==typeof this.render&&so.apply(this,[this.render()])}}var uo=Object.assign,fo=Object.defineProperty,lo=!uo||u((function(){if(f&&1!==uo({b:1},uo(fo({},"a",{enumerable:!0,get:function(){fo(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},r=Symbol();return t[r]=7,"abcdefghijklmnopqrst".split("").forEach((function(t){e[t]=t})),7!=uo({},t)[r]||"abcdefghijklmnopqrst"!=ie(uo({},e)).join("")}))?function(t,e){for(var r=Xt(t),n=arguments.length,o=1,i=Nt.f,a=mt.f;n>o;)for(var s,c=Et(arguments[o++]),u=i?ie(c).concat(i(c)):ie(c),l=u.length,p=0;l>p;)s=u[p++],f&&!a.call(c,s)||(r[s]=c[s]);return r}:uo;Kt({target:"Object",stat:!0,forced:Object.assign!==lo},{assign:lo});At.Object.assign;var po=D("match"),ho=function(t){if(function(t){var e;return l(t)&&(void 0!==(e=t[po])?!!e:"RegExp"==nt(t))}(t))throw TypeError("The method doesn't accept regular expressions");return t},yo=D("match");Kt({target:"String",proto:!0,forced:!function(t){var e=/./;try{"/./"[t](e)}catch(r){try{return e[yo]=!1,"/./"[t](e)}catch(t){}}return!1}("includes")},{includes:function(t){return!!~String(dt(this)).indexOf(ho(t),arguments.length>1?arguments[1]:void 0)}});Gn("String","includes");var go={searchParams:"URLSearchParams"in self,iterable:"Symbol"in self&&"iterator"in Symbol,blob:"FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in self,arrayBuffer:"ArrayBuffer"in self};if(go.arrayBuffer)var vo=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],bo=ArrayBuffer.isView||function(t){return t&&vo.indexOf(Object.prototype.toString.call(t))>-1};function mo(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function wo(t){return"string"!=typeof t&&(t=String(t)),t}function Eo(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return go.iterable&&(e[Symbol.iterator]=function(){return e}),e}function Oo(t){this.map={},t instanceof Oo?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function jo(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function To(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function Ao(t){var e=new FileReader,r=To(e);return e.readAsArrayBuffer(t),r}function So(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function Po(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:go.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:go.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:go.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():go.arrayBuffer&&go.blob&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=So(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):go.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||bo(t))?this._bodyArrayBuffer=So(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):go.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},go.blob&&(this.blob=function(){var t=jo(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?jo(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(Ao)}),this.text=function(){var t=jo(this);if(t)return t;if(this._bodyBlob)return function(t){var e=new FileReader,r=To(e);return e.readAsText(t),r}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},go.formData&&(this.formData=function(){return this.text().then(Ro)}),this.json=function(){return this.text().then(JSON.parse)},this}Oo.prototype.append=function(t,e){t=mo(t),e=wo(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},Oo.prototype.delete=function(t){delete this.map[mo(t)]},Oo.prototype.get=function(t){return t=mo(t),this.has(t)?this.map[t]:null},Oo.prototype.has=function(t){return this.map.hasOwnProperty(mo(t))},Oo.prototype.set=function(t,e){this.map[mo(t)]=wo(e)},Oo.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},Oo.prototype.keys=function(){var t=[];return this.forEach((function(e,r){t.push(r)})),Eo(t)},Oo.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),Eo(t)},Oo.prototype.entries=function(){var t=[];return this.forEach((function(e,r){t.push([r,e])})),Eo(t)},go.iterable&&(Oo.prototype[Symbol.iterator]=Oo.prototype.entries);var Lo=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function _o(t,e){var r,n,o=(e=e||{}).body;if(t instanceof _o){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new Oo(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,o||null==t._bodyInit||(o=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new Oo(e.headers)),this.method=(r=e.method||this.method||"GET",n=r.toUpperCase(),Lo.indexOf(n)>-1?n:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function Ro(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(o))}})),e}function xo(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new Oo(e.headers),this.url=e.url||"",this._initBody(t)}_o.prototype.clone=function(){return new _o(this,{body:this._bodyInit})},Po.call(_o.prototype),Po.call(xo.prototype),xo.prototype.clone=function(){return new xo(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Oo(this.headers),url:this.url})},xo.error=function(){var t=new xo(null,{status:0,statusText:""});return t.type="error",t};var Co=[301,302,303,307,308];xo.redirect=function(t,e){if(-1===Co.indexOf(e))throw new RangeError("Invalid status code");return new xo(null,{status:e,headers:{location:t}})};var Io=self.DOMException;try{new Io}catch(t){(Io=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack}).prototype=Object.create(Error.prototype),Io.prototype.constructor=Io}function ko(t,e){return new Promise((function(r,n){var o=new _o(t,e);if(o.signal&&o.signal.aborted)return n(new Io("Aborted","AbortError"));var i=new XMLHttpRequest;function a(){i.abort()}i.onload=function(){var t,e,n={status:i.status,statusText:i.statusText,headers:(t=i.getAllResponseHeaders()||"",e=new Oo,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();e.append(n,o)}})),e)};n.url="responseURL"in i?i.responseURL:n.headers.get("X-Request-URL");var o="response"in i?i.response:i.responseText;r(new xo(o,n))},i.onerror=function(){n(new TypeError("Network request failed"))},i.ontimeout=function(){n(new TypeError("Network request failed"))},i.onabort=function(){n(new Io("Aborted","AbortError"))},i.open(o.method,o.url,!0),"include"===o.credentials?i.withCredentials=!0:"omit"===o.credentials&&(i.withCredentials=!1),"responseType"in i&&go.blob&&(i.responseType="blob"),o.headers.forEach((function(t,e){i.setRequestHeader(e,t)})),o.signal&&(o.signal.addEventListener("abort",a),i.onreadystatechange=function(){4===i.readyState&&o.signal.removeEventListener("abort",a)}),i.send(void 0===o._bodyInit?null:o._bodyInit)}))}ko.polyfill=!0,self.fetch||(self.fetch=ko,self.Headers=Oo,self.Request=_o,self.Response=xo),function(){function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function r(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}function n(t){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function s(t,e,r){return(s="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var o=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=n(t)););return t}(t,e);if(o){var i=Object.getOwnPropertyDescriptor(o,e);return i.get?i.get.call(r):i.value}})(t,e,r||t)}var c=function(){function e(){t(this,e),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return r(e,[{key:"addEventListener",value:function(t,e){t in this.listeners||(this.listeners[t]=[]),this.listeners[t].push(e)}},{key:"removeEventListener",value:function(t,e){if(t in this.listeners)for(var r=this.listeners[t],n=0,o=r.length;n<o;n++)if(r[n]===e)return void r.splice(n,1)}},{key:"dispatchEvent",value:function(t){var e=this;if(t.type in this.listeners){for(var r=function(r){setTimeout((function(){return r.call(e,t)}))},n=this.listeners[t.type],o=0,i=n.length;o<i;o++)r(n[o]);return!t.defaultPrevented}}}]),e}(),u=function(e){function i(){var e;return t(this,i),(e=function(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?a(t):e}(this,n(i).call(this))).listeners||c.call(a(e)),Object.defineProperty(a(e),"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(a(e),"onabort",{value:null,writable:!0,configurable:!0}),e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&o(t,e)}(i,e),r(i,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(t){"abort"===t.type&&(this.aborted=!0,"function"==typeof this.onabort&&this.onabort.call(this,t)),s(n(i.prototype),"dispatchEvent",this).call(this,t)}}]),i}(c),f=function(){function e(){t(this,e),Object.defineProperty(this,"signal",{value:new u,writable:!0,configurable:!0})}return r(e,[{key:"abort",value:function(){var t;try{t=new Event("abort")}catch(e){"undefined"!=typeof document?document.createEvent?(t=document.createEvent("Event")).initEvent("abort",!1,!1):(t=document.createEventObject()).type="abort":t={type:"abort",bubbles:!1,cancelable:!1}}this.signal.dispatchEvent(t)}},{key:"toString",value:function(){return"[object AbortController]"}}]),e}();function l(t){return t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):"function"==typeof t.Request&&!t.Request.prototype.hasOwnProperty("signal")||!t.AbortController}"undefined"!=typeof Symbol&&Symbol.toStringTag&&(f.prototype[Symbol.toStringTag]="AbortController",u.prototype[Symbol.toStringTag]="AbortSignal"),function(t){if(l(t))if(t.fetch){var e=function(t){"function"==typeof t&&(t={fetch:t});var e=t,r=e.fetch,n=e.Request,o=void 0===n?r.Request:n,i=e.AbortController,a=e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,s=void 0!==a&&a;if(!l({fetch:r,Request:o,AbortController:i,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s}))return{fetch:r,Request:c};var c=o;(c&&!c.prototype.hasOwnProperty("signal")||s)&&((c=function(t,e){var r;e&&e.signal&&(r=e.signal,delete e.signal);var n=new o(t,e);return r&&Object.defineProperty(n,"signal",{writable:!1,enumerable:!1,configurable:!0,value:r}),n}).prototype=o.prototype);var u=r;return{fetch:function(t,e){var r=c&&c.prototype.isPrototypeOf(t)?t.signal:e?e.signal:void 0;if(r){var n;try{n=new DOMException("Aborted","AbortError")}catch(t){(n=new Error("Aborted")).name="AbortError"}if(r.aborted)return Promise.reject(n);var o=new Promise((function(t,e){r.addEventListener("abort",(function(){return e(n)}),{once:!0})}));return e&&e.signal&&delete e.signal,Promise.race([o,u(t,e)])}return u(t,e)},Request:c}}(t),r=e.fetch,n=e.Request;t.fetch=r,t.Request=n,Object.defineProperty(t,"AbortController",{writable:!0,enumerable:!1,configurable:!0,value:f}),Object.defineProperty(t,"AbortSignal",{writable:!0,enumerable:!1,configurable:!0,value:u})}else console.warn("fetch() is not available, cannot install abortcontroller-polyfill")}("undefined"!=typeof self?self:i)}();const Do=[];class Mo{constructor(t,e){e||(e={}),this.url=t,this.config=e,this.controller=new window.AbortController;const r=this.controller.signal;this.fetch=window.fetch(t,Object.assign(e,{signal:r}))}abort(){this.controller.abort()}then(...t){return this.fetch.then(...t)}catch(...t){return this.fetch.catch(...t)}}function Fo(t,e){const r=Do.filter(e=>{return e.url.split("?")[0]===t.split("?")[0]});r.forEach(t=>{e&&t.abort(),r.splice(r.indexOf(t),1)})}function Bo(t,e={}){if(t&&"string"==typeof t){e.cancellable&&(Fo(t,e.cancellable),delete e.cancellable);const r=new Mo(t,e);return Do.push(r),r.then(()=>Fo(t)).catch(()=>Fo(t)),r}throw new TypeError(In)}function No(){return Bo.apply(this,arguments)}const Uo={GET:"GET",POST:"POST",PUT:"PUT",DELETE:"DELETE",HEAD:"HEAD"};function qo(t){return t&&"object"==typeof t&&!Array.isArray(t)}function Go(t){const{config:e}=this,{data:r}=t;"string"!=typeof r&&r&&"object"==typeof r&&(!function(t){const e=t.fetchOptions;return"json"===t.requestDataType||e&&e.headers&&"application/json"===e.headers["Content-Type"]}(e)?t.data=o(r):t.data=JSON.stringify(r))}function Ho(t){const e=Object.keys(t);if(1===e.length&&"path"===e[0])return t;if(2===e.length&&e.includes("path")&&e.includes("data"))return Go.apply(this,[t]),t;throw new Error(kn)}function $o(t){if("string"==typeof t){const[e,r]=t.split("?");return[{path:e,data:r}]}if(t&&"object"==typeof t){if(Array.isArray(t))return t.map(t=>{if("string"==typeof t){const[e,r]=t.split("?");return{path:e,data:r}}if(qo(t))return Ho.apply(this,[t])});if(qo(t))return[Ho.apply(this,[t])]}throw new TypeError(In)}function Vo(){const{config:t}=this,{template:e}=t;return"function"==typeof t.beforeRender&&t.beforeRender.apply(t,[t.data]),new Promise((r,n)=>{const o={template:null,target:t.target};e?this.templateMap[e]?r(Object.assign(o,{template:this.templateMap[e],data:t.data})):n(Object.assign(o,{error:Cn})):n(Object.assign(o,{error:Dn}))})}function Wo(t,e,r){const n="template"===r?Dn:Mn;if(t&&"string"==typeof t||"target"===r&&Hn(t)){const r=[];for(let n=0;n<e;n++)r.push(t);return r}if(Array.isArray(t))return t.map(t=>{if(t&&"string"==typeof t||"target"===r&&Hn(t))return t;throw new TypeError(n)});throw new TypeError(n)}function zo(t,e,r){if([Uo.GET,Uo.DELETE].includes(e)){return No(t.data?`${t.path}?${t.data}`:t.path,Object.assign({},r))}return No(t.path,Object.assign({},r,{body:t.data}))}function Yo(t,e,r,n,o){Vo.apply({config:{template:t,target:e,data:r},templateMap:this.templateMap}).then(n).catch(o)}function Jo(t,e,r,n){t||(t=null,r=Cn),n({template:t,target:e,error:r})}function Ko(){const{config:t,URLs:e}=this;let{fetchOptions:r,template:n,target:o}=t;n=Wo(n,e.length,"template"),o=Wo(o,e.length,"target");const i=r.method||Uo.GET,a=e.map((t,e)=>new Promise((a,s)=>{zo(t,i,r).then(t=>t.json()).then(t=>{Yo.apply(this,[n[e],o[e],t,a,s])}).catch(t=>{Jo.apply(this,[this.templateMap[n[e]],o[e],t,s])})}));return e.length=0,a}function Xo(t,e,r,n,o){const{config:i,URLs:a}=this;let{fetchOptions:s}=i;if(a.length>=1){const i=s.method||Uo.GET;t.push(new Promise((c,u)=>{const f=a.splice(0,1)[0],l=e.splice(0,1)[0],p=r.splice(0,1)[0];zo(f,i,s).then(t=>t.json()).then(i=>{Yo.apply(this,[l,p,i,c,u]),Xo.apply(this,[t,e,r,n,o])}).catch(t=>{Jo.apply(this,[this.templateMap[l],p,t,u])})}))}else Promise.all(t).then(n).catch(o)}function Qo(){const{config:t}=this;try{if(this.URLs=$o.apply(this,[t.url]),this.URLs.length){if(t.parallel)return Ko.apply(this);let{template:e,target:r}=t;return e=Wo(e,this.URLs.length,"template"),r=Wo(r,this.URLs.length,"target"),[new Promise((t,n)=>{Xo.apply(this,[[],e,r,t,n])})]}throw new TypeError(In)}catch(t){Kn.error("[Webpack]:",t)}}function Zo(t={}){return t.fetchOptions||(t.fetchOptions={}),this.config=Object.assign({parallel:!0},t),t.url?Qo.apply(this):[Vo.apply(this)]}function ti(t){if("string"==typeof t){if(this.templateMap[t])return this.templateMap[t];throw new TypeError(Cn)}throw new TypeError(Dn)}class ei{constructor(t){if(!t)throw new TypeError(Fn);this.templateMap=t,this.URLs=[],this.config={}}fn(){return Zo.apply(this,arguments)}get(){return ti.apply(this,arguments)}}function ri({RefClass:t,root:e,parent:r,routeData:n}){"function"==typeof t&&(this.ref=new t({root:e,parent:r,routeData:n}),"function"==typeof this.ref.init?(this.ref.init(),Kn.log(`[Webpack]: component "${this.name}" has been initialized.`)):Kn.error(`[Webpack]: component "${this.name}" does not have an init method.`))}const ni=Jn(document.body),oi=[];function ii(t=Jn(document),e,r){const n=[];Jn(t).find("[data-module]").each(e=>{const r=Jn(e).data("module");"string"==typeof r&&r.split(",").forEach(r=>{r=r.trim(),n.filter(t=>t.root===e&&t.name===r).length||n.push({root:e,parent:t,name:r})})});const o=function(t,e){const r=oi.filter(t=>t.parent===e);for(r.forEach(t=>{oi.splice(oi.indexOf(t),1)});0!==t.length;){const e=t.splice(0,1),n=r.filter(t=>t.root===e[0].root&&t.name===e[0].name);n.length?n.forEach(t=>{oi.push(...r.splice(r.indexOf(t),1))}):oi.push(...e)}if(r.length)for(;0!==r.length;)r.splice(0,1).forEach(t=>{t.ref&&"function"==typeof t.ref.doDestroy&&(t.ref.doDestroy(),Kn.log(`[Webpack]: component "${t.name}" has been destroyed.`))});return oi.filter(t=>!t.imported)}(n,t);o.length&&o.forEach(t=>{t.imported=!0,e(t,(function(e){this.chunked=!0,ri.call(t,{RefClass:e.default,root:this.root,parent:this.parent,routeData:r})}))})}class ai{static init(t,e){ii.apply(this,[t,e]),ni.on(Ln,(...t)=>{const[,r,n]=t;ii.apply(this,[r,e,n])})}}export{Jn as $,co as Component,ai as Core,ei as Render,Zn as router};