single-spa
Advanced tools
Comparing version 5.9.4 to 5.9.5
@@ -1,2 +0,2 @@ | ||
/* single-spa@5.9.4 - ES2015 - dev */ | ||
/* single-spa@5.9.5 - ES2015 - dev */ | ||
var singleSpa = /*#__PURE__*/Object.freeze({ | ||
@@ -32,2 +32,3 @@ __proto__: null, | ||
get MOUNTED () { return MOUNTED; }, | ||
get UNLOADING () { return UNLOADING; }, | ||
get UNMOUNTING () { return UNMOUNTING; }, | ||
@@ -1638,3 +1639,3 @@ get SKIP_BECAUSE_BROKEN () { return SKIP_BECAUSE_BROKEN; } | ||
export { BOOTSTRAPPING, LOADING_SOURCE_CODE, LOAD_ERROR, MOUNTED, MOUNTING, NOT_BOOTSTRAPPED, NOT_LOADED, NOT_MOUNTED, SKIP_BECAUSE_BROKEN, UNMOUNTING, UPDATING, addErrorHandler, checkActivityFunctions, ensureJQuerySupport, getAppNames, getAppStatus, getMountedApps, mountRootParcel, navigateToUrl, pathToActiveWhen, registerApplication, removeErrorHandler, setBootstrapMaxTime, setMountMaxTime, setUnloadMaxTime, setUnmountMaxTime, start, triggerAppChange, unloadApplication, unregisterApplication }; | ||
export { BOOTSTRAPPING, LOADING_SOURCE_CODE, LOAD_ERROR, MOUNTED, MOUNTING, NOT_BOOTSTRAPPED, NOT_LOADED, NOT_MOUNTED, SKIP_BECAUSE_BROKEN, UNLOADING, UNMOUNTING, UPDATING, addErrorHandler, checkActivityFunctions, ensureJQuerySupport, getAppNames, getAppStatus, getMountedApps, mountRootParcel, navigateToUrl, pathToActiveWhen, registerApplication, removeErrorHandler, setBootstrapMaxTime, setMountMaxTime, setUnloadMaxTime, setUnmountMaxTime, start, triggerAppChange, unloadApplication, unregisterApplication }; | ||
//# sourceMappingURL=single-spa.dev.js.map |
@@ -1,3 +0,3 @@ | ||
/* single-spa@5.9.4 - ES2015 - prod */ | ||
var t=Object.freeze({__proto__:null,get start(){return Mt},get ensureJQuerySupport(){return st},get setBootstrapMaxTime(){return k},get setMountMaxTime(){return K},get setUnmountMaxTime(){return F},get setUnloadMaxTime(){return J},get registerApplication(){return gt},get unregisterApplication(){return vt},get getMountedApps(){return mt},get getAppStatus(){return wt},get unloadApplication(){return yt},get checkActivityFunctions(){return Et},get getAppNames(){return dt},get pathToActiveWhen(){return Tt},get navigateToUrl(){return Y},get triggerAppChange(){return St},get addErrorHandler(){return i},get removeErrorHandler(){return s},get mountRootParcel(){return x},get NOT_LOADED(){return c},get LOADING_SOURCE_CODE(){return l},get NOT_BOOTSTRAPPED(){return f},get BOOTSTRAPPING(){return p},get NOT_MOUNTED(){return h},get MOUNTING(){return m},get UPDATING(){return w},get LOAD_ERROR(){return E},get MOUNTED(){return d},get UNMOUNTING(){return g},get SKIP_BECAUSE_BROKEN(){return v}}),e=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}).CustomEvent,n=function(){try{var t=new e("cat",{detail:{foo:"bar"}});return"cat"===t.type&&"bar"===t.detail.foo}catch(t){}return!1}()?e:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(t,e){var n=document.createEvent("CustomEvent");return e?n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail):n.initCustomEvent(t,!1,!1,void 0),n}:function(t,e){var n=document.createEventObject();return n.type=t,e?(n.bubbles=Boolean(e.bubbles),n.cancelable=Boolean(e.cancelable),n.detail=e.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n};let r=[];function o(t,e,n){const o=a(t,e,n);r.length?r.forEach(t=>t(o)):setTimeout(()=>{throw o})}function i(t){if("function"!=typeof t)throw Error(u(28,!1));r.push(t)}function s(t){if("function"!=typeof t)throw Error(u(29,!1));let e=!1;return r=r.filter(n=>{const r=n===t;return e=e||r,!r}),e}function u(t,e,...n){return`single-spa minified message #${t}: ${e?e+" ":""}See https://single-spa.js.org/error/?code=${t}${n.length?`&arg=${n.join("&arg=")}`:""}`}function a(t,e,n){const r=`${b(e)} '${O(e)}' died in status ${e.status}: `;let o;if(t instanceof Error){try{t.message=r+t.message}catch(t){}o=t}else{console.warn(u(30,!1,e.status,O(e)));try{o=Error(r+JSON.stringify(t))}catch(e){o=t}}return o.appOrParcelName=O(e),e.status=n,o}const c="NOT_LOADED",l="LOADING_SOURCE_CODE",f="NOT_BOOTSTRAPPED",p="BOOTSTRAPPING",h="NOT_MOUNTED",m="MOUNTING",d="MOUNTED",w="UPDATING",g="UNMOUNTING",E="LOAD_ERROR",v="SKIP_BECAUSE_BROKEN";function y(t){return t.status===d}function P(t){try{return t.activeWhen(window.location)}catch(e){return o(e,t,v),!1}}function O(t){return t.name}function T(t){return Boolean(t.unmountThisParcel)}function b(t){return T(t)?"parcel":"application"}function A(){for(let t=arguments.length-1;t>0;t--)for(let e in arguments[t])"__proto__"!==e&&(arguments[t-1][e]=arguments[t][e]);return arguments[0]}function N(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return t[n];return null}function S(t){return t&&("function"==typeof t||(e=t,Array.isArray(e)&&!N(e,t=>"function"!=typeof t)));var e}function _(t,e){let n=t[e]||[];n=Array.isArray(n)?n:[n],0===n.length&&(n=[()=>Promise.resolve()]);const r=b(t),o=O(t);return function(t){return n.reduce((n,i,s)=>n.then(()=>{const n=i(t);return D(n)?n:Promise.reject(u(15,!1,r,o,e,s))}),Promise.resolve())}}function D(t){return t&&"function"==typeof t.then&&"function"==typeof t.catch}function U(t,e){return Promise.resolve().then(()=>t.status!==f?t:(t.status=p,t.bootstrap?H(t,"bootstrap").then(n).catch(n=>{if(e)throw a(n,t,v);return o(n,t,v),t}):Promise.resolve().then(n)));function n(){return t.status=h,t}}function M(t,e){return Promise.resolve().then(()=>{if(t.status!==d)return t;t.status=g;const n=Object.keys(t.parcels).map(e=>t.parcels[e].unmountThisParcel());return Promise.all(n).then(r,n=>r().then(()=>{const r=Error(n.message);if(e)throw a(r,t,v);o(r,t,v)})).then(()=>t);function r(){return H(t,"unmount").then(()=>{t.status=h}).catch(n=>{if(e)throw a(n,t,v);o(n,t,v)})}})}let j=!1,L=!1;function $(t,e){return Promise.resolve().then(()=>t.status!==h?t:(j||(window.dispatchEvent(new n("single-spa:before-first-mount")),j=!0),H(t,"mount").then(()=>(t.status=d,L||(window.dispatchEvent(new n("single-spa:first-mount")),L=!0),t)).catch(n=>{return t.status=d,M(t,!0).then(r,r);function r(){if(e)throw a(n,t,v);return o(n,t,v),t}})))}let R=0;const I={parcels:{}};function x(){return B.apply(I,arguments)}function B(t,e){const n=this;if(!t||"object"!=typeof t&&"function"!=typeof t)throw Error(u(2,!1));if(t.name&&"string"!=typeof t.name)throw Error(u(3,!1,typeof t.name));if("object"!=typeof e)throw Error(u(4,!1,name,typeof e));if(!e.domElement)throw Error(u(5,!1,name));const r=R++,o="function"==typeof t,i=o?t:()=>Promise.resolve(t),s={id:r,parcels:{},status:o?l:f,customProps:e,parentName:O(n),unmountThisParcel:()=>g.then(()=>{if(s.status!==d)throw Error(u(6,!1,name,s.status));return M(s,!0)}).then(t=>(s.parentName&&delete n.parcels[s.id],t)).then(t=>(E(t),t)).catch(t=>{throw s.status=v,y(t),t})};let c;n.parcels[r]=s;let p=i();if(!p||"function"!=typeof p.then)throw Error(u(7,!1));p=p.then(t=>{if(!t)throw Error(u(8,!1));const e=t.name||`parcel-${r}`;if(Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!S(t.bootstrap))throw Error(u(9,!1,e));if(!S(t.mount))throw Error(u(10,!1,e));if(!S(t.unmount))throw Error(u(11,!1,e));if(t.update&&!S(t.update))throw Error(u(12,!1,e));const n=_(t,"bootstrap"),o=_(t,"mount"),i=_(t,"unmount");s.status=f,s.name=e,s.bootstrap=n,s.mount=o,s.unmount=i,s.timeouts=Q(t.timeouts),t.update&&(s.update=_(t,"update"),c.update=function(t){return s.customProps=t,G(function(t){return Promise.resolve().then(()=>{if(t.status!==d)throw Error(u(32,!1,O(t)));return t.status=w,H(t,"update").then(()=>(t.status=d,t)).catch(e=>{throw a(e,t,v)})})}(s))})});const m=p.then(()=>U(s,!0)),g=m.then(()=>$(s,!0));let E,y;const P=new Promise((t,e)=>{E=t,y=e});return c={mount:()=>G(Promise.resolve().then(()=>{if(s.status!==h)throw Error(u(13,!1,name,s.status));return n.parcels[r]=s,$(s)})),unmount:()=>G(s.unmountThisParcel()),getStatus:()=>s.status,loadPromise:G(p),bootstrapPromise:G(m),mountPromise:G(g),unmountPromise:G(P)},c}function G(t){return t.then(()=>null)}function C(e){const n=O(e);let r="function"==typeof e.customProps?e.customProps(n,window.location):e.customProps;("object"!=typeof r||null===r||Array.isArray(r))&&(r={},console.warn(u(40,!1),n,r));const o=A({},r,{name:n,mountParcel:B.bind(e),singleSpa:t});return T(e)&&(o.unmountSelf=e.unmountThisParcel),o}const W={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:1e3},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},update:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3}};function k(t,e,n){if("number"!=typeof t||t<=0)throw Error(u(16,!1));W.bootstrap={millis:t,dieOnTimeout:e,warningMillis:n||1e3}}function K(t,e,n){if("number"!=typeof t||t<=0)throw Error(u(17,!1));W.mount={millis:t,dieOnTimeout:e,warningMillis:n||1e3}}function F(t,e,n){if("number"!=typeof t||t<=0)throw Error(u(18,!1));W.unmount={millis:t,dieOnTimeout:e,warningMillis:n||1e3}}function J(t,e,n){if("number"!=typeof t||t<=0)throw Error(u(19,!1));W.unload={millis:t,dieOnTimeout:e,warningMillis:n||1e3}}function H(t,e){const n=t.timeouts[e],r=n.warningMillis,o=b(t);return new Promise((i,s)=>{let a=!1,c=!1;t[e](C(t)).then(t=>{a=!0,i(t)}).catch(t=>{a=!0,s(t)}),setTimeout(()=>f(1),r),setTimeout(()=>f(!0),n.millis);const l=u(31,!1,e,o,O(t),n.millis);function f(t){if(!a)if(!0===t)c=!0,n.dieOnTimeout?s(Error(l)):console.error(l);else if(!c){const e=t,o=e*r;console.warn(l),o+r<n.millis&&setTimeout(()=>f(e+1),r)}}})}function Q(t){const e={};for(let n in W)e[n]=A({},W[n],t&&t[n]||{});return e}function V(t){return Promise.resolve().then(()=>{if(t.loadPromise)return t.loadPromise;if(t.status!==c&&t.status!==E)return t;let e,n;return t.status=l,t.loadPromise=Promise.resolve().then(()=>{const r=t.loadApp(C(t));if(!D(r))throw n=!0,Error(u(33,!1,O(t)));return r.then(n=>{let r;t.loadErrorTime=null,e=n,"object"!=typeof e&&(r=34),Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!S(e.bootstrap)&&(r=35),S(e.mount)||(r=36),S(e.unmount)||(r=37);const i=b(e);if(r){let n;try{n=JSON.stringify(e)}catch(t){}return console.error(u(r,!1,i,O(t),n),e),o(void 0,t,v),t}return e.devtools&&e.devtools.overlays&&(t.devtools.overlays=A({},t.devtools.overlays,e.devtools.overlays)),t.status=f,t.bootstrap=_(e,"bootstrap"),t.mount=_(e,"mount"),t.unmount=_(e,"unmount"),t.unload=_(e,"unload"),t.timeouts=Q(e.timeouts),delete t.loadPromise,t})}).catch(e=>{let r;return delete t.loadPromise,n?r=v:(r=E,t.loadErrorTime=(new Date).getTime()),o(e,t,r),t})})}const q="undefined"!=typeof window,z={hashchange:[],popstate:[]},X=["hashchange","popstate"];function Y(t){let e;if("string"==typeof t)e=t;else if(this&&this.href)e=this.href;else{if(!(t&&t.currentTarget&&t.currentTarget.href&&t.preventDefault))throw Error(u(14,!1));e=t.currentTarget.href,t.preventDefault()}const n=ot(window.location.href),r=ot(e);0===e.indexOf("#")?window.location.hash=r.hash:n.host!==r.host&&r.host?window.location.href=e:r.pathname===n.pathname&&r.search===n.search?window.location.hash=r.hash:window.history.pushState(null,null,e)}function Z(t){if(t){const e=t[0].type;X.indexOf(e)>=0&&z[e].forEach(e=>{try{e.apply(this,t)}catch(t){setTimeout(()=>{throw t})}})}}let tt;function et(){_t([],arguments)}function nt(t,e){return function(){const n=window.location.href,r=t.apply(this,arguments),o=window.location.href;return tt&&n===o||(jt()?window.dispatchEvent(rt(window.history.state,e)):_t([])),r}}function rt(t,e){let n;try{n=new PopStateEvent("popstate",{state:t})}catch(e){n=document.createEvent("PopStateEvent"),n.initPopStateEvent("popstate",!1,!1,t)}return n.singleSpa=!0,n.singleSpaTrigger=e,n}if(q){window.addEventListener("hashchange",et),window.addEventListener("popstate",et);const t=window.addEventListener,e=window.removeEventListener;window.addEventListener=function(e,n){if(!("function"==typeof n&&X.indexOf(e)>=0)||N(z[e],t=>t===n))return t.apply(this,arguments);z[e].push(n)},window.removeEventListener=function(t,n){if(!("function"==typeof n&&X.indexOf(t)>=0))return e.apply(this,arguments);z[t]=z[t].filter(t=>t!==n)},window.history.pushState=nt(window.history.pushState,"pushState"),window.history.replaceState=nt(window.history.replaceState,"replaceState"),window.singleSpaNavigate?console.warn(u(41,!1)):window.singleSpaNavigate=Y}function ot(t){const e=document.createElement("a");return e.href=t,e}let it=!1;function st(t=window.jQuery){if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!it){const e=t.fn.on,n=t.fn.off;t.fn.on=function(t,n){return ut.call(this,e,window.addEventListener,t,n,arguments)},t.fn.off=function(t,e){return ut.call(this,n,window.removeEventListener,t,e,arguments)},it=!0}}function ut(t,e,n,r,o){return"string"!=typeof n?t.apply(this,o):(n.split(/\s+/).forEach(t=>{X.indexOf(t)>=0&&(e(t,r),n=n.replace(t,""))}),""===n.trim()?this:t.apply(this,o))}const at={};function ct(t){return Promise.resolve().then(()=>{const e=at[O(t)];if(!e)return t;if(t.status===c)return lt(t,e),t;if("UNLOADING"===t.status)return e.promise.then(()=>t);if(t.status!==h&&t.status!==E)return t;const n=t.status===E?Promise.resolve():H(t,"unload");return t.status="UNLOADING",n.then(()=>(lt(t,e),t)).catch(n=>(function(t,e,n){delete at[O(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,o(n,t,v),e.reject(n)}(t,e,n),t))})}function lt(t,e){delete at[O(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=c,e.resolve()}function ft(t,e,n,r){at[O(t)]={app:t,resolve:n,reject:r},Object.defineProperty(at[O(t)],"promise",{get:e})}function pt(t){return at[t]}const ht=[];function mt(){return ht.filter(y).map(O)}function dt(){return ht.map(O)}function wt(t){const e=N(ht,e=>O(e)===t);return e?e.status:null}function gt(t,e,n,r){const o=function(t,e,n,r){const o={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"==typeof t?(function(t){if(Array.isArray(t)||null===t)throw Error(u(39,!1));const e=["name","app","activeWhen","customProps"],n=Object.keys(t).reduce((t,n)=>e.indexOf(n)>=0?t:t.concat(n),[]);if(0!==n.length)throw Error(u(38,!1,e.join(", "),n.join(", ")));if("string"!=typeof t.name||0===t.name.length)throw Error(u(20,!1));if("object"!=typeof t.app&&"function"!=typeof t.app)throw Error(u(20,!1));const r=t=>"string"==typeof t||"function"==typeof t;if(!(r(t.activeWhen)||Array.isArray(t.activeWhen)&&t.activeWhen.every(r)))throw Error(u(24,!1));if(!Ot(t.customProps))throw Error(u(22,!1))}(t),o.name=t.name,o.loadApp=t.app,o.activeWhen=t.activeWhen,o.customProps=t.customProps):(function(t,e,n,r){if("string"!=typeof t||0===t.length)throw Error(u(20,!1));if(!e)throw Error(u(23,!1));if("function"!=typeof n)throw Error(u(24,!1));if(!Ot(r))throw Error(u(22,!1))}(t,e,n,r),o.name=t,o.loadApp=e,o.activeWhen=n,o.customProps=r),o.loadApp="function"!=typeof(i=o.loadApp)?()=>Promise.resolve(i):i,o.customProps=function(t){return t||{}}(o.customProps),o.activeWhen=function(t){let e=Array.isArray(t)?t:[t];return e=e.map(t=>"function"==typeof t?t:Tt(t)),t=>e.some(e=>e(t))}(o.activeWhen),o;var i}(t,e,n,r);if(-1!==dt().indexOf(o.name))throw Error(u(21,!1,o.name));ht.push(A({loadErrorTime:null,status:c,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},o)),q&&(st(),_t())}function Et(t=window.location){return ht.filter(e=>e.activeWhen(t)).map(O)}function vt(t){if(0===ht.filter(e=>O(e)===t).length)throw Error(u(25,!1,t));return yt(t).then(()=>{const e=ht.map(O).indexOf(t);ht.splice(e,1)})}function yt(t,e={waitForUnmount:!1}){if("string"!=typeof t)throw Error(u(26,!1));const n=N(ht,e=>O(e)===t);if(!n)throw Error(u(27,!1,t));const r=pt(O(n));if(e&&e.waitForUnmount){if(r)return r.promise;{const t=new Promise((e,r)=>{ft(n,()=>t,e,r)});return t}}{let t;return r?(t=r.promise,Pt(n,r.resolve,r.reject)):t=new Promise((e,r)=>{ft(n,()=>t,e,r),Pt(n,e,r)}),t}}function Pt(t,e,n){M(t).then(ct).then(()=>{e(),setTimeout(()=>{_t()})}).catch(n)}function Ot(t){return!t||"function"==typeof t||"object"==typeof t&&null!==t&&!Array.isArray(t)}function Tt(t,e){const n=function(t,e){let n=0,r=!1,o="^";"/"!==t[0]&&(t="/"+t);for(let e=0;e<t.length;e++){const n=t[e],o=r&&"/"===n;(!r&&":"===n||o)&&i(e)}return i(t.length),new RegExp(o,"i");function i(i){const s=t.slice(n,i).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(o+=r?"[^/]+/?":s,i===t.length)if(r)e&&(o+="$");else{const t=e?"":".*";o="/"===o.charAt(o.length-1)?`${o}${t}$`:`${o}(/${t})?(#.*)?$`}r=!r,n=i}}(t,e);return t=>{let e=t.origin;e||(e=`${t.protocol}//${t.host}`);const r=t.href.replace(e,"").replace(t.search,"").split("?")[0];return n.test(r)}}let bt=!1,At=[],Nt=q&&window.location.href;function St(){return _t()}function _t(t=[],e){if(bt)return new Promise((t,n)=>{At.push({resolve:t,reject:n,eventArguments:e})});const{appsToUnload:r,appsToUnmount:o,appsToLoad:i,appsToMount:s}=function(){const t=[],e=[],n=[],r=[],o=(new Date).getTime();return ht.forEach(i=>{const s=i.status!==v&&P(i);switch(i.status){case E:s&&o-i.loadErrorTime>=200&&n.push(i);break;case c:case l:s&&n.push(i);break;case f:case h:!s&&pt(O(i))?t.push(i):s&&r.push(i);break;case d:s||e.push(i)}}),{appsToUnload:t,appsToUnmount:e,appsToLoad:n,appsToMount:r}}();let u,a=!1,p=Nt,m=Nt=window.location.href;return jt()?(bt=!0,u=r.concat(i,o,s),Promise.resolve().then(()=>{if(window.dispatchEvent(new n(0===u.length?"single-spa:before-no-app-change":"single-spa:before-app-change",T(!0))),window.dispatchEvent(new n("single-spa:before-routing-event",T(!0,{cancelNavigation:w}))),a)return window.dispatchEvent(new n("single-spa:before-mount-routing-event",T(!0))),g(),void Y(p);const e=r.map(ct),c=o.map(M).map(t=>t.then(ct)).concat(e),l=Promise.all(c);l.then(()=>{window.dispatchEvent(new n("single-spa:before-mount-routing-event",T(!0)))});const f=i.map(t=>V(t).then(t=>Dt(t,l))),h=s.filter(t=>i.indexOf(t)<0).map(t=>Dt(t,l));return l.catch(t=>{throw y(),t}).then(()=>(y(),Promise.all(f.concat(h)).catch(e=>{throw t.forEach(t=>t.reject(e)),e}).then(g)))})):(u=i,Promise.resolve().then(()=>{const t=i.map(V);return Promise.all(t).then(y).then(()=>[]).catch(t=>{throw y(),t})}));function w(){a=!0}function g(){const e=mt();t.forEach(t=>t.resolve(e));try{const t=0===u.length?"single-spa:no-app-change":"single-spa:app-change";window.dispatchEvent(new n(t,T())),window.dispatchEvent(new n("single-spa:routing-event",T()))}catch(t){setTimeout(()=>{throw t})}if(bt=!1,At.length>0){const t=At;At=[],_t(t)}return e}function y(){t.forEach(t=>{Z(t.eventArguments)}),Z(e)}function T(t=!1,n){const l={},f={[d]:[],[h]:[],[c]:[],[v]:[]};t?(i.concat(s).forEach((t,e)=>{g(t,d)}),r.forEach(t=>{g(t,c)}),o.forEach(t=>{g(t,h)})):u.forEach(t=>{g(t)});const w={detail:{newAppStatuses:l,appsByNewStatus:f,totalAppChanges:u.length,originalEvent:null==e?void 0:e[0],oldUrl:p,newUrl:m,navigationIsCanceled:a}};return n&&A(w.detail,n),w;function g(t,e){const n=O(t);e=e||wt(n),l[n]=e,(f[e]=f[e]||[]).push(n)}}}function Dt(t,e){return P(t)?U(t).then(t=>e.then(()=>P(t)?$(t):t)):e.then(()=>t)}let Ut=!1;function Mt(t){var e;Ut=!0,t&&t.urlRerouteOnly&&(e=t.urlRerouteOnly,tt=e),q&&_t()}function jt(){return Ut}q&&setTimeout(()=>{Ut||console.warn(u(1,!1))},5e3);var Lt={getRawAppData:function(){return[...ht]},reroute:_t,NOT_LOADED:c,toLoadPromise:V,toBootstrapPromise:U,unregisterApplication:vt};q&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=Lt);export{p as BOOTSTRAPPING,l as LOADING_SOURCE_CODE,E as LOAD_ERROR,d as MOUNTED,m as MOUNTING,f as NOT_BOOTSTRAPPED,c as NOT_LOADED,h as NOT_MOUNTED,v as SKIP_BECAUSE_BROKEN,g as UNMOUNTING,w as UPDATING,i as addErrorHandler,Et as checkActivityFunctions,st as ensureJQuerySupport,dt as getAppNames,wt as getAppStatus,mt as getMountedApps,x as mountRootParcel,Y as navigateToUrl,Tt as pathToActiveWhen,gt as registerApplication,s as removeErrorHandler,k as setBootstrapMaxTime,K as setMountMaxTime,J as setUnloadMaxTime,F as setUnmountMaxTime,Mt as start,St as triggerAppChange,yt as unloadApplication,vt as unregisterApplication}; | ||
/* single-spa@5.9.5 - ES2015 - prod */ | ||
var t=Object.freeze({__proto__:null,get start(){return jt},get ensureJQuerySupport(){return ut},get setBootstrapMaxTime(){return K},get setMountMaxTime(){return F},get setUnmountMaxTime(){return J},get setUnloadMaxTime(){return H},get registerApplication(){return Et},get unregisterApplication(){return yt},get getMountedApps(){return dt},get getAppStatus(){return gt},get unloadApplication(){return Pt},get checkActivityFunctions(){return vt},get getAppNames(){return wt},get pathToActiveWhen(){return bt},get navigateToUrl(){return Z},get triggerAppChange(){return _t},get addErrorHandler(){return i},get removeErrorHandler(){return s},get mountRootParcel(){return B},get NOT_LOADED(){return c},get LOADING_SOURCE_CODE(){return l},get NOT_BOOTSTRAPPED(){return f},get BOOTSTRAPPING(){return p},get NOT_MOUNTED(){return h},get MOUNTING(){return m},get UPDATING(){return w},get LOAD_ERROR(){return v},get MOUNTED(){return d},get UNLOADING(){return E},get UNMOUNTING(){return g},get SKIP_BECAUSE_BROKEN(){return y}}),e=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}).CustomEvent,n=function(){try{var t=new e("cat",{detail:{foo:"bar"}});return"cat"===t.type&&"bar"===t.detail.foo}catch(t){}return!1}()?e:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(t,e){var n=document.createEvent("CustomEvent");return e?n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail):n.initCustomEvent(t,!1,!1,void 0),n}:function(t,e){var n=document.createEventObject();return n.type=t,e?(n.bubbles=Boolean(e.bubbles),n.cancelable=Boolean(e.cancelable),n.detail=e.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n};let r=[];function o(t,e,n){const o=a(t,e,n);r.length?r.forEach(t=>t(o)):setTimeout(()=>{throw o})}function i(t){if("function"!=typeof t)throw Error(u(28,!1));r.push(t)}function s(t){if("function"!=typeof t)throw Error(u(29,!1));let e=!1;return r=r.filter(n=>{const r=n===t;return e=e||r,!r}),e}function u(t,e,...n){return`single-spa minified message #${t}: ${e?e+" ":""}See https://single-spa.js.org/error/?code=${t}${n.length?"&arg="+n.join("&arg="):""}`}function a(t,e,n){const r=`${A(e)} '${T(e)}' died in status ${e.status}: `;let o;if(t instanceof Error){try{t.message=r+t.message}catch(t){}o=t}else{console.warn(u(30,!1,e.status,T(e)));try{o=Error(r+JSON.stringify(t))}catch(e){o=t}}return o.appOrParcelName=T(e),e.status=n,o}const c="NOT_LOADED",l="LOADING_SOURCE_CODE",f="NOT_BOOTSTRAPPED",p="BOOTSTRAPPING",h="NOT_MOUNTED",m="MOUNTING",d="MOUNTED",w="UPDATING",g="UNMOUNTING",E="UNLOADING",v="LOAD_ERROR",y="SKIP_BECAUSE_BROKEN";function P(t){return t.status===d}function O(t){try{return t.activeWhen(window.location)}catch(e){return o(e,t,y),!1}}function T(t){return t.name}function b(t){return Boolean(t.unmountThisParcel)}function A(t){return b(t)?"parcel":"application"}function N(){for(let t=arguments.length-1;t>0;t--)for(let e in arguments[t])"__proto__"!==e&&(arguments[t-1][e]=arguments[t][e]);return arguments[0]}function S(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return t[n];return null}function _(t){return t&&("function"==typeof t||(e=t,Array.isArray(e)&&!S(e,t=>"function"!=typeof t)));var e}function D(t,e){let n=t[e]||[];n=Array.isArray(n)?n:[n],0===n.length&&(n=[()=>Promise.resolve()]);const r=A(t),o=T(t);return function(t){return n.reduce((n,i,s)=>n.then(()=>{const n=i(t);return U(n)?n:Promise.reject(u(15,!1,r,o,e,s))}),Promise.resolve())}}function U(t){return t&&"function"==typeof t.then&&"function"==typeof t.catch}function M(t,e){return Promise.resolve().then(()=>t.status!==f?t:(t.status=p,t.bootstrap?Q(t,"bootstrap").then(n).catch(n=>{if(e)throw a(n,t,y);return o(n,t,y),t}):Promise.resolve().then(n)));function n(){return t.status=h,t}}function j(t,e){return Promise.resolve().then(()=>{if(t.status!==d)return t;t.status=g;const n=Object.keys(t.parcels).map(e=>t.parcels[e].unmountThisParcel());return Promise.all(n).then(r,n=>r().then(()=>{const r=Error(n.message);if(e)throw a(r,t,y);o(r,t,y)})).then(()=>t);function r(){return Q(t,"unmount").then(()=>{t.status=h}).catch(n=>{if(e)throw a(n,t,y);o(n,t,y)})}})}let L=!1,$=!1;function R(t,e){return Promise.resolve().then(()=>t.status!==h?t:(L||(window.dispatchEvent(new n("single-spa:before-first-mount")),L=!0),Q(t,"mount").then(()=>(t.status=d,$||(window.dispatchEvent(new n("single-spa:first-mount")),$=!0),t)).catch(n=>{return t.status=d,j(t,!0).then(r,r);function r(){if(e)throw a(n,t,y);return o(n,t,y),t}})))}let I=0;const x={parcels:{}};function B(){return G.apply(x,arguments)}function G(t,e){const n=this;if(!t||"object"!=typeof t&&"function"!=typeof t)throw Error(u(2,!1));if(t.name&&"string"!=typeof t.name)throw Error(u(3,!1,typeof t.name));if("object"!=typeof e)throw Error(u(4,!1,name,typeof e));if(!e.domElement)throw Error(u(5,!1,name));const r=I++,o="function"==typeof t,i=o?t:()=>Promise.resolve(t),s={id:r,parcels:{},status:o?l:f,customProps:e,parentName:T(n),unmountThisParcel:()=>g.then(()=>{if(s.status!==d)throw Error(u(6,!1,name,s.status));return j(s,!0)}).then(t=>(s.parentName&&delete n.parcels[s.id],t)).then(t=>(E(t),t)).catch(t=>{throw s.status=y,v(t),t})};let c;n.parcels[r]=s;let p=i();if(!p||"function"!=typeof p.then)throw Error(u(7,!1));p=p.then(t=>{if(!t)throw Error(u(8,!1));const e=t.name||"parcel-"+r;if(Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!_(t.bootstrap))throw Error(u(9,!1,e));if(!_(t.mount))throw Error(u(10,!1,e));if(!_(t.unmount))throw Error(u(11,!1,e));if(t.update&&!_(t.update))throw Error(u(12,!1,e));const n=D(t,"bootstrap"),o=D(t,"mount"),i=D(t,"unmount");s.status=f,s.name=e,s.bootstrap=n,s.mount=o,s.unmount=i,s.timeouts=V(t.timeouts),t.update&&(s.update=D(t,"update"),c.update=function(t){return s.customProps=t,C(function(t){return Promise.resolve().then(()=>{if(t.status!==d)throw Error(u(32,!1,T(t)));return t.status=w,Q(t,"update").then(()=>(t.status=d,t)).catch(e=>{throw a(e,t,y)})})}(s))})});const m=p.then(()=>M(s,!0)),g=m.then(()=>R(s,!0));let E,v;const P=new Promise((t,e)=>{E=t,v=e});return c={mount:()=>C(Promise.resolve().then(()=>{if(s.status!==h)throw Error(u(13,!1,name,s.status));return n.parcels[r]=s,R(s)})),unmount:()=>C(s.unmountThisParcel()),getStatus:()=>s.status,loadPromise:C(p),bootstrapPromise:C(m),mountPromise:C(g),unmountPromise:C(P)},c}function C(t){return t.then(()=>null)}function W(e){const n=T(e);let r="function"==typeof e.customProps?e.customProps(n,window.location):e.customProps;("object"!=typeof r||null===r||Array.isArray(r))&&(r={},console.warn(u(40,!1),n,r));const o=N({},r,{name:n,mountParcel:G.bind(e),singleSpa:t});return b(e)&&(o.unmountSelf=e.unmountThisParcel),o}const k={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:1e3},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},update:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3}};function K(t,e,n){if("number"!=typeof t||t<=0)throw Error(u(16,!1));k.bootstrap={millis:t,dieOnTimeout:e,warningMillis:n||1e3}}function F(t,e,n){if("number"!=typeof t||t<=0)throw Error(u(17,!1));k.mount={millis:t,dieOnTimeout:e,warningMillis:n||1e3}}function J(t,e,n){if("number"!=typeof t||t<=0)throw Error(u(18,!1));k.unmount={millis:t,dieOnTimeout:e,warningMillis:n||1e3}}function H(t,e,n){if("number"!=typeof t||t<=0)throw Error(u(19,!1));k.unload={millis:t,dieOnTimeout:e,warningMillis:n||1e3}}function Q(t,e){const n=t.timeouts[e],r=n.warningMillis,o=A(t);return new Promise((i,s)=>{let a=!1,c=!1;t[e](W(t)).then(t=>{a=!0,i(t)}).catch(t=>{a=!0,s(t)}),setTimeout(()=>f(1),r),setTimeout(()=>f(!0),n.millis);const l=u(31,!1,e,o,T(t),n.millis);function f(t){if(!a)if(!0===t)c=!0,n.dieOnTimeout?s(Error(l)):console.error(l);else if(!c){const e=t,o=e*r;console.warn(l),o+r<n.millis&&setTimeout(()=>f(e+1),r)}}})}function V(t){const e={};for(let n in k)e[n]=N({},k[n],t&&t[n]||{});return e}function q(t){return Promise.resolve().then(()=>{if(t.loadPromise)return t.loadPromise;if(t.status!==c&&t.status!==v)return t;let e,n;return t.status=l,t.loadPromise=Promise.resolve().then(()=>{const r=t.loadApp(W(t));if(!U(r))throw n=!0,Error(u(33,!1,T(t)));return r.then(n=>{let r;t.loadErrorTime=null,e=n,"object"!=typeof e&&(r=34),Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!_(e.bootstrap)&&(r=35),_(e.mount)||(r=36),_(e.unmount)||(r=37);const i=A(e);if(r){let n;try{n=JSON.stringify(e)}catch(t){}return console.error(u(r,!1,i,T(t),n),e),o(void 0,t,y),t}return e.devtools&&e.devtools.overlays&&(t.devtools.overlays=N({},t.devtools.overlays,e.devtools.overlays)),t.status=f,t.bootstrap=D(e,"bootstrap"),t.mount=D(e,"mount"),t.unmount=D(e,"unmount"),t.unload=D(e,"unload"),t.timeouts=V(e.timeouts),delete t.loadPromise,t})}).catch(e=>{let r;return delete t.loadPromise,n?r=y:(r=v,t.loadErrorTime=(new Date).getTime()),o(e,t,r),t})})}const z="undefined"!=typeof window,X={hashchange:[],popstate:[]},Y=["hashchange","popstate"];function Z(t){let e;if("string"==typeof t)e=t;else if(this&&this.href)e=this.href;else{if(!(t&&t.currentTarget&&t.currentTarget.href&&t.preventDefault))throw Error(u(14,!1));e=t.currentTarget.href,t.preventDefault()}const n=it(window.location.href),r=it(e);0===e.indexOf("#")?window.location.hash=r.hash:n.host!==r.host&&r.host?window.location.href=e:r.pathname===n.pathname&&r.search===n.search?window.location.hash=r.hash:window.history.pushState(null,null,e)}function tt(t){if(t){const e=t[0].type;Y.indexOf(e)>=0&&X[e].forEach(e=>{try{e.apply(this,t)}catch(t){setTimeout(()=>{throw t})}})}}let et;function nt(){Dt([],arguments)}function rt(t,e){return function(){const n=window.location.href,r=t.apply(this,arguments),o=window.location.href;return et&&n===o||(Lt()?window.dispatchEvent(ot(window.history.state,e)):Dt([])),r}}function ot(t,e){let n;try{n=new PopStateEvent("popstate",{state:t})}catch(e){n=document.createEvent("PopStateEvent"),n.initPopStateEvent("popstate",!1,!1,t)}return n.singleSpa=!0,n.singleSpaTrigger=e,n}if(z){window.addEventListener("hashchange",nt),window.addEventListener("popstate",nt);const t=window.addEventListener,e=window.removeEventListener;window.addEventListener=function(e,n){if(!("function"==typeof n&&Y.indexOf(e)>=0)||S(X[e],t=>t===n))return t.apply(this,arguments);X[e].push(n)},window.removeEventListener=function(t,n){if(!("function"==typeof n&&Y.indexOf(t)>=0))return e.apply(this,arguments);X[t]=X[t].filter(t=>t!==n)},window.history.pushState=rt(window.history.pushState,"pushState"),window.history.replaceState=rt(window.history.replaceState,"replaceState"),window.singleSpaNavigate?console.warn(u(41,!1)):window.singleSpaNavigate=Z}function it(t){const e=document.createElement("a");return e.href=t,e}let st=!1;function ut(t=window.jQuery){if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!st){const e=t.fn.on,n=t.fn.off;t.fn.on=function(t,n){return at.call(this,e,window.addEventListener,t,n,arguments)},t.fn.off=function(t,e){return at.call(this,n,window.removeEventListener,t,e,arguments)},st=!0}}function at(t,e,n,r,o){return"string"!=typeof n?t.apply(this,o):(n.split(/\s+/).forEach(t=>{Y.indexOf(t)>=0&&(e(t,r),n=n.replace(t,""))}),""===n.trim()?this:t.apply(this,o))}const ct={};function lt(t){return Promise.resolve().then(()=>{const e=ct[T(t)];if(!e)return t;if(t.status===c)return ft(t,e),t;if(t.status===E)return e.promise.then(()=>t);if(t.status!==h&&t.status!==v)return t;const n=t.status===v?Promise.resolve():Q(t,"unload");return t.status=E,n.then(()=>(ft(t,e),t)).catch(n=>(function(t,e,n){delete ct[T(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,o(n,t,y),e.reject(n)}(t,e,n),t))})}function ft(t,e){delete ct[T(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=c,e.resolve()}function pt(t,e,n,r){ct[T(t)]={app:t,resolve:n,reject:r},Object.defineProperty(ct[T(t)],"promise",{get:e})}function ht(t){return ct[t]}const mt=[];function dt(){return mt.filter(P).map(T)}function wt(){return mt.map(T)}function gt(t){const e=S(mt,e=>T(e)===t);return e?e.status:null}function Et(t,e,n,r){const o=function(t,e,n,r){const o={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"==typeof t?(function(t){if(Array.isArray(t)||null===t)throw Error(u(39,!1));const e=["name","app","activeWhen","customProps"],n=Object.keys(t).reduce((t,n)=>e.indexOf(n)>=0?t:t.concat(n),[]);if(0!==n.length)throw Error(u(38,!1,e.join(", "),n.join(", ")));if("string"!=typeof t.name||0===t.name.length)throw Error(u(20,!1));if("object"!=typeof t.app&&"function"!=typeof t.app)throw Error(u(20,!1));const r=t=>"string"==typeof t||"function"==typeof t;if(!(r(t.activeWhen)||Array.isArray(t.activeWhen)&&t.activeWhen.every(r)))throw Error(u(24,!1));if(!Tt(t.customProps))throw Error(u(22,!1))}(t),o.name=t.name,o.loadApp=t.app,o.activeWhen=t.activeWhen,o.customProps=t.customProps):(function(t,e,n,r){if("string"!=typeof t||0===t.length)throw Error(u(20,!1));if(!e)throw Error(u(23,!1));if("function"!=typeof n)throw Error(u(24,!1));if(!Tt(r))throw Error(u(22,!1))}(t,e,n,r),o.name=t,o.loadApp=e,o.activeWhen=n,o.customProps=r),o.loadApp="function"!=typeof(i=o.loadApp)?()=>Promise.resolve(i):i,o.customProps=function(t){return t||{}}(o.customProps),o.activeWhen=function(t){let e=Array.isArray(t)?t:[t];return e=e.map(t=>"function"==typeof t?t:bt(t)),t=>e.some(e=>e(t))}(o.activeWhen),o;var i}(t,e,n,r);if(-1!==wt().indexOf(o.name))throw Error(u(21,!1,o.name));mt.push(N({loadErrorTime:null,status:c,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},o)),z&&(ut(),Dt())}function vt(t=window.location){return mt.filter(e=>e.activeWhen(t)).map(T)}function yt(t){if(0===mt.filter(e=>T(e)===t).length)throw Error(u(25,!1,t));return Pt(t).then(()=>{const e=mt.map(T).indexOf(t);mt.splice(e,1)})}function Pt(t,e={waitForUnmount:!1}){if("string"!=typeof t)throw Error(u(26,!1));const n=S(mt,e=>T(e)===t);if(!n)throw Error(u(27,!1,t));const r=ht(T(n));if(e&&e.waitForUnmount){if(r)return r.promise;{const t=new Promise((e,r)=>{pt(n,()=>t,e,r)});return t}}{let t;return r?(t=r.promise,Ot(n,r.resolve,r.reject)):t=new Promise((e,r)=>{pt(n,()=>t,e,r),Ot(n,e,r)}),t}}function Ot(t,e,n){j(t).then(lt).then(()=>{e(),setTimeout(()=>{Dt()})}).catch(n)}function Tt(t){return!t||"function"==typeof t||"object"==typeof t&&null!==t&&!Array.isArray(t)}function bt(t,e){const n=function(t,e){let n=0,r=!1,o="^";"/"!==t[0]&&(t="/"+t);for(let e=0;e<t.length;e++){const n=t[e],o=r&&"/"===n;(!r&&":"===n||o)&&i(e)}return i(t.length),new RegExp(o,"i");function i(i){const s=t.slice(n,i).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(o+=r?"[^/]+/?":s,i===t.length)if(r)e&&(o+="$");else{const t=e?"":".*";o="/"===o.charAt(o.length-1)?`${o}${t}$`:`${o}(/${t})?(#.*)?$`}r=!r,n=i}}(t,e);return t=>{let e=t.origin;e||(e=`${t.protocol}//${t.host}`);const r=t.href.replace(e,"").replace(t.search,"").split("?")[0];return n.test(r)}}let At=!1,Nt=[],St=z&&window.location.href;function _t(){return Dt()}function Dt(t=[],e){if(At)return new Promise((t,n)=>{Nt.push({resolve:t,reject:n,eventArguments:e})});const{appsToUnload:r,appsToUnmount:o,appsToLoad:i,appsToMount:s}=function(){const t=[],e=[],n=[],r=[],o=(new Date).getTime();return mt.forEach(i=>{const s=i.status!==y&&O(i);switch(i.status){case v:s&&o-i.loadErrorTime>=200&&n.push(i);break;case c:case l:s&&n.push(i);break;case f:case h:!s&&ht(T(i))?t.push(i):s&&r.push(i);break;case d:s||e.push(i)}}),{appsToUnload:t,appsToUnmount:e,appsToLoad:n,appsToMount:r}}();let u,a=!1,p=St,m=St=window.location.href;return Lt()?(At=!0,u=r.concat(i,o,s),Promise.resolve().then(()=>{if(window.dispatchEvent(new n(0===u.length?"single-spa:before-no-app-change":"single-spa:before-app-change",P(!0))),window.dispatchEvent(new n("single-spa:before-routing-event",P(!0,{cancelNavigation:w}))),a)return window.dispatchEvent(new n("single-spa:before-mount-routing-event",P(!0))),g(),void Z(p);const e=r.map(lt),c=o.map(j).map(t=>t.then(lt)).concat(e),l=Promise.all(c);l.then(()=>{window.dispatchEvent(new n("single-spa:before-mount-routing-event",P(!0)))});const f=i.map(t=>q(t).then(t=>Ut(t,l))),h=s.filter(t=>i.indexOf(t)<0).map(t=>Ut(t,l));return l.catch(t=>{throw E(),t}).then(()=>(E(),Promise.all(f.concat(h)).catch(e=>{throw t.forEach(t=>t.reject(e)),e}).then(g)))})):(u=i,Promise.resolve().then(()=>{const t=i.map(q);return Promise.all(t).then(E).then(()=>[]).catch(t=>{throw E(),t})}));function w(){a=!0}function g(){const e=dt();t.forEach(t=>t.resolve(e));try{const t=0===u.length?"single-spa:no-app-change":"single-spa:app-change";window.dispatchEvent(new n(t,P())),window.dispatchEvent(new n("single-spa:routing-event",P()))}catch(t){setTimeout(()=>{throw t})}if(At=!1,Nt.length>0){const t=Nt;Nt=[],Dt(t)}return e}function E(){t.forEach(t=>{tt(t.eventArguments)}),tt(e)}function P(t=!1,n){const l={},f={[d]:[],[h]:[],[c]:[],[y]:[]};t?(i.concat(s).forEach((t,e)=>{g(t,d)}),r.forEach(t=>{g(t,c)}),o.forEach(t=>{g(t,h)})):u.forEach(t=>{g(t)});const w={detail:{newAppStatuses:l,appsByNewStatus:f,totalAppChanges:u.length,originalEvent:null==e?void 0:e[0],oldUrl:p,newUrl:m,navigationIsCanceled:a}};return n&&N(w.detail,n),w;function g(t,e){const n=T(t);e=e||gt(n),l[n]=e,(f[e]=f[e]||[]).push(n)}}}function Ut(t,e){return O(t)?M(t).then(t=>e.then(()=>O(t)?R(t):t)):e.then(()=>t)}let Mt=!1;function jt(t){var e;Mt=!0,t&&t.urlRerouteOnly&&(e=t.urlRerouteOnly,et=e),z&&Dt()}function Lt(){return Mt}z&&setTimeout(()=>{Mt||console.warn(u(1,!1))},5e3);var $t={getRawAppData:function(){return[...mt]},reroute:Dt,NOT_LOADED:c,toLoadPromise:q,toBootstrapPromise:M,unregisterApplication:yt};z&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=$t);export{p as BOOTSTRAPPING,l as LOADING_SOURCE_CODE,v as LOAD_ERROR,d as MOUNTED,m as MOUNTING,f as NOT_BOOTSTRAPPED,c as NOT_LOADED,h as NOT_MOUNTED,y as SKIP_BECAUSE_BROKEN,E as UNLOADING,g as UNMOUNTING,w as UPDATING,i as addErrorHandler,vt as checkActivityFunctions,ut as ensureJQuerySupport,wt as getAppNames,gt as getAppStatus,dt as getMountedApps,B as mountRootParcel,Z as navigateToUrl,bt as pathToActiveWhen,Et as registerApplication,s as removeErrorHandler,K as setBootstrapMaxTime,F as setMountMaxTime,H as setUnloadMaxTime,J as setUnmountMaxTime,jt as start,_t as triggerAppChange,Pt as unloadApplication,yt as unregisterApplication}; | ||
//# sourceMappingURL=single-spa.min.js.map |
@@ -1,2 +0,2 @@ | ||
/* single-spa@5.9.4 - ESM - dev */ | ||
/* single-spa@5.9.5 - ESM - dev */ | ||
var singleSpa = /*#__PURE__*/Object.freeze({ | ||
@@ -32,2 +32,3 @@ __proto__: null, | ||
get MOUNTED () { return MOUNTED; }, | ||
get UNLOADING () { return UNLOADING; }, | ||
get UNMOUNTING () { return UNMOUNTING; }, | ||
@@ -1745,3 +1746,3 @@ get SKIP_BECAUSE_BROKEN () { return SKIP_BECAUSE_BROKEN; } | ||
export { BOOTSTRAPPING, LOADING_SOURCE_CODE, LOAD_ERROR, MOUNTED, MOUNTING, NOT_BOOTSTRAPPED, NOT_LOADED, NOT_MOUNTED, SKIP_BECAUSE_BROKEN, UNMOUNTING, UPDATING, addErrorHandler, checkActivityFunctions, ensureJQuerySupport, getAppNames, getAppStatus, getMountedApps, mountRootParcel, navigateToUrl, pathToActiveWhen, registerApplication, removeErrorHandler, setBootstrapMaxTime, setMountMaxTime, setUnloadMaxTime, setUnmountMaxTime, start, triggerAppChange, unloadApplication, unregisterApplication }; | ||
export { BOOTSTRAPPING, LOADING_SOURCE_CODE, LOAD_ERROR, MOUNTED, MOUNTING, NOT_BOOTSTRAPPED, NOT_LOADED, NOT_MOUNTED, SKIP_BECAUSE_BROKEN, UNLOADING, UNMOUNTING, UPDATING, addErrorHandler, checkActivityFunctions, ensureJQuerySupport, getAppNames, getAppStatus, getMountedApps, mountRootParcel, navigateToUrl, pathToActiveWhen, registerApplication, removeErrorHandler, setBootstrapMaxTime, setMountMaxTime, setUnloadMaxTime, setUnmountMaxTime, start, triggerAppChange, unloadApplication, unregisterApplication }; | ||
//# sourceMappingURL=single-spa.dev.js.map |
@@ -1,3 +0,3 @@ | ||
/* single-spa@5.9.4 - ESM - prod */ | ||
var t=Object.freeze({__proto__:null,get start(){return xt},get ensureJQuerySupport(){return ft},get setBootstrapMaxTime(){return F},get setMountMaxTime(){return J},get setUnmountMaxTime(){return H},get setUnloadMaxTime(){return Q},get registerApplication(){return Ot},get unregisterApplication(){return Tt},get getMountedApps(){return Et},get getAppStatus(){return Pt},get unloadApplication(){return At},get checkActivityFunctions(){return bt},get getAppNames(){return yt},get pathToActiveWhen(){return _t},get navigateToUrl(){return nt},get triggerAppChange(){return Mt},get addErrorHandler(){return a},get removeErrorHandler(){return c},get mountRootParcel(){return C},get NOT_LOADED(){return l},get LOADING_SOURCE_CODE(){return p},get NOT_BOOTSTRAPPED(){return h},get BOOTSTRAPPING(){return m},get NOT_MOUNTED(){return v},get MOUNTING(){return d},get UPDATING(){return g},get LOAD_ERROR(){return y},get MOUNTED(){return w},get UNMOUNTING(){return E},get SKIP_BECAUSE_BROKEN(){return P}});function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function e(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}var r=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}).CustomEvent,o=function(){try{var t=new r("cat",{detail:{foo:"bar"}});return"cat"===t.type&&"bar"===t.detail.foo}catch(t){}return!1}()?r:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(t,n){var e=document.createEvent("CustomEvent");return n?e.initCustomEvent(t,n.bubbles,n.cancelable,n.detail):e.initCustomEvent(t,!1,!1,void 0),e}:function(t,n){var e=document.createEventObject();return e.type=t,n?(e.bubbles=Boolean(n.bubbles),e.cancelable=Boolean(n.cancelable),e.detail=n.detail):(e.bubbles=!1,e.cancelable=!1,e.detail=void 0),e},i=[];function u(t,n,e){var r=f(t,n,e);i.length?i.forEach((function(t){return t(r)})):setTimeout((function(){throw r}))}function a(t){if("function"!=typeof t)throw Error(s(28,!1));i.push(t)}function c(t){if("function"!=typeof t)throw Error(s(29,!1));var n=!1;return i=i.filter((function(e){var r=e===t;return n=n||r,!r})),n}function s(t,n){for(var e=arguments.length,r=new Array(e>2?e-2:0),o=2;o<e;o++)r[o-2]=arguments[o];return"single-spa minified message #".concat(t,": ").concat(n?n+" ":"","See https://single-spa.js.org/error/?code=").concat(t).concat(r.length?"&arg=".concat(r.join("&arg=")):"")}function f(t,n,e){var r,o="".concat(N(n)," '").concat(T(n),"' died in status ").concat(n.status,": ");if(t instanceof Error){try{t.message=o+t.message}catch(t){}r=t}else{console.warn(s(30,!1,n.status,T(n)));try{r=Error(o+JSON.stringify(t))}catch(n){r=t}}return r.appOrParcelName=T(n),n.status=e,r}var l="NOT_LOADED",p="LOADING_SOURCE_CODE",h="NOT_BOOTSTRAPPED",m="BOOTSTRAPPING",v="NOT_MOUNTED",d="MOUNTING",w="MOUNTED",g="UPDATING",E="UNMOUNTING",y="LOAD_ERROR",P="SKIP_BECAUSE_BROKEN";function O(t){return t.status===w}function b(t){try{return t.activeWhen(window.location)}catch(n){return u(n,t,P),!1}}function T(t){return t.name}function A(t){return Boolean(t.unmountThisParcel)}function N(t){return A(t)?"parcel":"application"}function S(){for(var t=arguments.length-1;t>0;t--)for(var n in arguments[t])"__proto__"!==n&&(arguments[t-1][n]=arguments[t][n]);return arguments[0]}function _(t,n){for(var e=0;e<t.length;e++)if(n(t[e]))return t[e];return null}function D(t){return t&&("function"==typeof t||(n=t,Array.isArray(n)&&!_(n,(function(t){return"function"!=typeof t}))));var n}function U(t,n){var e=t[n]||[];0===(e=Array.isArray(e)?e:[e]).length&&(e=[function(){return Promise.resolve()}]);var r=N(t),o=T(t);return function(t){return e.reduce((function(e,i,u){return e.then((function(){var e=i(t);return j(e)?e:Promise.reject(s(15,!1,r,o,n,u))}))}),Promise.resolve())}}function j(t){return t&&"function"==typeof t.then&&"function"==typeof t.catch}function M(t,n){return Promise.resolve().then((function(){return t.status!==h?t:(t.status=m,t.bootstrap?V(t,"bootstrap").then(e).catch((function(e){if(n)throw f(e,t,P);return u(e,t,P),t})):Promise.resolve().then(e))}));function e(){return t.status=v,t}}function L(t,n){return Promise.resolve().then((function(){if(t.status!==w)return t;t.status=E;var e=Object.keys(t.parcels).map((function(n){return t.parcels[n].unmountThisParcel()}));return Promise.all(e).then(r,(function(e){return r().then((function(){var r=Error(e.message);if(n)throw f(r,t,P);u(r,t,P)}))})).then((function(){return t}));function r(){return V(t,"unmount").then((function(){t.status=v})).catch((function(e){if(n)throw f(e,t,P);u(e,t,P)}))}}))}var R=!1,I=!1;function x(t,n){return Promise.resolve().then((function(){return t.status!==v?t:(R||(window.dispatchEvent(new o("single-spa:before-first-mount")),R=!0),V(t,"mount").then((function(){return t.status=w,I||(window.dispatchEvent(new o("single-spa:first-mount")),I=!0),t})).catch((function(e){return t.status=w,L(t,!0).then(r,r);function r(){if(n)throw f(e,t,P);return u(e,t,P),t}})))}))}var B=0,G={parcels:{}};function C(){return W.apply(G,arguments)}function W(t,e){var r=this;if(!t||"object"!==n(t)&&"function"!=typeof t)throw Error(s(2,!1));if(t.name&&"string"!=typeof t.name)throw Error(s(3,!1,n(t.name)));if("object"!==n(e))throw Error(s(4,!1,name,n(e)));if(!e.domElement)throw Error(s(5,!1,name));var o,i=B++,u="function"==typeof t,a=u?t:function(){return Promise.resolve(t)},c={id:i,parcels:{},status:u?p:h,customProps:e,parentName:T(r),unmountThisParcel:function(){return y.then((function(){if(c.status!==w)throw Error(s(6,!1,name,c.status));return L(c,!0)})).then((function(t){return c.parentName&&delete r.parcels[c.id],t})).then((function(t){return m(t),t})).catch((function(t){throw c.status=P,d(t),t}))}};r.parcels[i]=c;var l=a();if(!l||"function"!=typeof l.then)throw Error(s(7,!1));var m,d,E=(l=l.then((function(t){if(!t)throw Error(s(8,!1));var n=t.name||"parcel-".concat(i);if(Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!D(t.bootstrap))throw Error(s(9,!1,n));if(!D(t.mount))throw Error(s(10,!1,n));if(!D(t.unmount))throw Error(s(11,!1,n));if(t.update&&!D(t.update))throw Error(s(12,!1,n));var e=U(t,"bootstrap"),r=U(t,"mount"),u=U(t,"unmount");c.status=h,c.name=n,c.bootstrap=e,c.mount=r,c.unmount=u,c.timeouts=q(t.timeouts),t.update&&(c.update=U(t,"update"),o.update=function(t){return c.customProps=t,$(function(t){return Promise.resolve().then((function(){if(t.status!==w)throw Error(s(32,!1,T(t)));return t.status=g,V(t,"update").then((function(){return t.status=w,t})).catch((function(n){throw f(n,t,P)}))}))}(c))})}))).then((function(){return M(c,!0)})),y=E.then((function(){return x(c,!0)})),O=new Promise((function(t,n){m=t,d=n}));return o={mount:function(){return $(Promise.resolve().then((function(){if(c.status!==v)throw Error(s(13,!1,name,c.status));return r.parcels[i]=c,x(c)})))},unmount:function(){return $(c.unmountThisParcel())},getStatus:function(){return c.status},loadPromise:$(l),bootstrapPromise:$(E),mountPromise:$(y),unmountPromise:$(O)}}function $(t){return t.then((function(){return null}))}function k(e){var r=T(e),o="function"==typeof e.customProps?e.customProps(r,window.location):e.customProps;("object"!==n(o)||null===o||Array.isArray(o))&&(o={},console.warn(s(40,!1),r,o));var i=S({},o,{name:r,mountParcel:W.bind(e),singleSpa:t});return A(e)&&(i.unmountSelf=e.unmountThisParcel),i}var K={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:1e3},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},update:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3}};function F(t,n,e){if("number"!=typeof t||t<=0)throw Error(s(16,!1));K.bootstrap={millis:t,dieOnTimeout:n,warningMillis:e||1e3}}function J(t,n,e){if("number"!=typeof t||t<=0)throw Error(s(17,!1));K.mount={millis:t,dieOnTimeout:n,warningMillis:e||1e3}}function H(t,n,e){if("number"!=typeof t||t<=0)throw Error(s(18,!1));K.unmount={millis:t,dieOnTimeout:n,warningMillis:e||1e3}}function Q(t,n,e){if("number"!=typeof t||t<=0)throw Error(s(19,!1));K.unload={millis:t,dieOnTimeout:n,warningMillis:e||1e3}}function V(t,n){var e=t.timeouts[n],r=e.warningMillis,o=N(t);return new Promise((function(i,u){var a=!1,c=!1;t[n](k(t)).then((function(t){a=!0,i(t)})).catch((function(t){a=!0,u(t)})),setTimeout((function(){return l(1)}),r),setTimeout((function(){return l(!0)}),e.millis);var f=s(31,!1,n,o,T(t),e.millis);function l(t){if(!a)if(!0===t)c=!0,e.dieOnTimeout?u(Error(f)):console.error(f);else if(!c){var n=t,o=n*r;console.warn(f),o+r<e.millis&&setTimeout((function(){return l(n+1)}),r)}}}))}function q(t){var n={};for(var e in K)n[e]=S({},K[e],t&&t[e]||{});return n}function z(t){return Promise.resolve().then((function(){return t.loadPromise?t.loadPromise:t.status!==l&&t.status!==y?t:(t.status=p,t.loadPromise=Promise.resolve().then((function(){var o=t.loadApp(k(t));if(!j(o))throw r=!0,Error(s(33,!1,T(t)));return o.then((function(r){var o;t.loadErrorTime=null,"object"!==n(e=r)&&(o=34),Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!D(e.bootstrap)&&(o=35),D(e.mount)||(o=36),D(e.unmount)||(o=37);var i=N(e);if(o){var a;try{a=JSON.stringify(e)}catch(t){}return console.error(s(o,!1,i,T(t),a),e),u(void 0,t,P),t}return e.devtools&&e.devtools.overlays&&(t.devtools.overlays=S({},t.devtools.overlays,e.devtools.overlays)),t.status=h,t.bootstrap=U(e,"bootstrap"),t.mount=U(e,"mount"),t.unmount=U(e,"unmount"),t.unload=U(e,"unload"),t.timeouts=q(e.timeouts),delete t.loadPromise,t}))})).catch((function(n){var e;return delete t.loadPromise,r?e=P:(e=y,t.loadErrorTime=(new Date).getTime()),u(n,t,e),t})));var e,r}))}var X,Y="undefined"!=typeof window,Z={hashchange:[],popstate:[]},tt=["hashchange","popstate"];function nt(t){var n;if("string"==typeof t)n=t;else if(this&&this.href)n=this.href;else{if(!(t&&t.currentTarget&&t.currentTarget.href&&t.preventDefault))throw Error(s(14,!1));n=t.currentTarget.href,t.preventDefault()}var e=ct(window.location.href),r=ct(n);0===n.indexOf("#")?window.location.hash=r.hash:e.host!==r.host&&r.host?window.location.href=n:r.pathname===e.pathname&&r.search===e.search?window.location.hash=r.hash:window.history.pushState(null,null,n)}function et(t){var n=this;if(t){var e=t[0].type;tt.indexOf(e)>=0&&Z[e].forEach((function(e){try{e.apply(n,t)}catch(t){setTimeout((function(){throw t}))}}))}}function rt(){Lt([],arguments)}function ot(t,n){return function(){var e=window.location.href,r=t.apply(this,arguments),o=window.location.href;return X&&e===o||(Bt()?window.dispatchEvent(it(window.history.state,n)):Lt([])),r}}function it(t,n){var e;try{e=new PopStateEvent("popstate",{state:t})}catch(n){(e=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,t)}return e.singleSpa=!0,e.singleSpaTrigger=n,e}if(Y){window.addEventListener("hashchange",rt),window.addEventListener("popstate",rt);var ut=window.addEventListener,at=window.removeEventListener;window.addEventListener=function(t,n){if(!("function"==typeof n&&tt.indexOf(t)>=0)||_(Z[t],(function(t){return t===n})))return ut.apply(this,arguments);Z[t].push(n)},window.removeEventListener=function(t,n){if(!("function"==typeof n&&tt.indexOf(t)>=0))return at.apply(this,arguments);Z[t]=Z[t].filter((function(t){return t!==n}))},window.history.pushState=ot(window.history.pushState,"pushState"),window.history.replaceState=ot(window.history.replaceState,"replaceState"),window.singleSpaNavigate?console.warn(s(41,!1)):window.singleSpaNavigate=nt}function ct(t){var n=document.createElement("a");return n.href=t,n}var st=!1;function ft(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!st){var n=t.fn.on,e=t.fn.off;t.fn.on=function(t,e){return lt.call(this,n,window.addEventListener,t,e,arguments)},t.fn.off=function(t,n){return lt.call(this,e,window.removeEventListener,t,n,arguments)},st=!0}}function lt(t,n,e,r,o){return"string"!=typeof e?t.apply(this,o):(e.split(/\s+/).forEach((function(t){tt.indexOf(t)>=0&&(n(t,r),e=e.replace(t,""))})),""===e.trim()?this:t.apply(this,o))}var pt={};function ht(t){return Promise.resolve().then((function(){var n=pt[T(t)];if(!n)return t;if(t.status===l)return mt(t,n),t;if("UNLOADING"===t.status)return n.promise.then((function(){return t}));if(t.status!==v&&t.status!==y)return t;var e=t.status===y?Promise.resolve():V(t,"unload");return t.status="UNLOADING",e.then((function(){return mt(t,n),t})).catch((function(e){return function(t,n,e){delete pt[T(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,u(e,t,P),n.reject(e)}(t,n,e),t}))}))}function mt(t,n){delete pt[T(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=l,n.resolve()}function vt(t,n,e,r){pt[T(t)]={app:t,resolve:e,reject:r},Object.defineProperty(pt[T(t)],"promise",{get:n})}function dt(t){return pt[t]}var wt=[];function gt(){var t=[],n=[],e=[],r=[],o=(new Date).getTime();return wt.forEach((function(i){var u=i.status!==P&&b(i);switch(i.status){case y:u&&o-i.loadErrorTime>=200&&e.push(i);break;case l:case p:u&&e.push(i);break;case h:case v:!u&&dt(T(i))?t.push(i):u&&r.push(i);break;case w:u||n.push(i)}})),{appsToUnload:t,appsToUnmount:n,appsToLoad:e,appsToMount:r}}function Et(){return wt.filter(O).map(T)}function yt(){return wt.map(T)}function Pt(t){var n=_(wt,(function(n){return T(n)===t}));return n?n.status:null}function Ot(t,e,r,o){var i=function(t,e,r,o){var i,u={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"===n(t)?(function(t){if(Array.isArray(t)||null===t)throw Error(s(39,!1));var e=["name","app","activeWhen","customProps"],r=Object.keys(t).reduce((function(t,n){return e.indexOf(n)>=0?t:t.concat(n)}),[]);if(0!==r.length)throw Error(s(38,!1,e.join(", "),r.join(", ")));if("string"!=typeof t.name||0===t.name.length)throw Error(s(20,!1));if("object"!==n(t.app)&&"function"!=typeof t.app)throw Error(s(20,!1));var o=function(t){return"string"==typeof t||"function"==typeof t};if(!(o(t.activeWhen)||Array.isArray(t.activeWhen)&&t.activeWhen.every(o)))throw Error(s(24,!1));if(!St(t.customProps))throw Error(s(22,!1))}(t),u.name=t.name,u.loadApp=t.app,u.activeWhen=t.activeWhen,u.customProps=t.customProps):(function(t,n,e,r){if("string"!=typeof t||0===t.length)throw Error(s(20,!1));if(!n)throw Error(s(23,!1));if("function"!=typeof e)throw Error(s(24,!1));if(!St(r))throw Error(s(22,!1))}(t,e,r,o),u.name=t,u.loadApp=e,u.activeWhen=r,u.customProps=o),u.loadApp="function"!=typeof(i=u.loadApp)?function(){return Promise.resolve(i)}:i,u.customProps=function(t){return t||{}}(u.customProps),u.activeWhen=function(t){var n=Array.isArray(t)?t:[t];return n=n.map((function(t){return"function"==typeof t?t:_t(t)})),function(t){return n.some((function(n){return n(t)}))}}(u.activeWhen),u}(t,e,r,o);if(-1!==yt().indexOf(i.name))throw Error(s(21,!1,i.name));wt.push(S({loadErrorTime:null,status:l,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},i)),Y&&(ft(),Lt())}function bt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location;return wt.filter((function(n){return n.activeWhen(t)})).map(T)}function Tt(t){if(0===wt.filter((function(n){return T(n)===t})).length)throw Error(s(25,!1,t));return At(t).then((function(){var n=wt.map(T).indexOf(t);wt.splice(n,1)}))}function At(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof t)throw Error(s(26,!1));var e=_(wt,(function(n){return T(n)===t}));if(!e)throw Error(s(27,!1,t));var r,o=dt(T(e));if(n&&n.waitForUnmount){if(o)return o.promise;var i=new Promise((function(t,n){vt(e,(function(){return i}),t,n)}));return i}return o?(r=o.promise,Nt(e,o.resolve,o.reject)):r=new Promise((function(t,n){vt(e,(function(){return r}),t,n),Nt(e,t,n)})),r}function Nt(t,n,e){L(t).then(ht).then((function(){n(),setTimeout((function(){Lt()}))})).catch(e)}function St(t){return!t||"function"==typeof t||"object"===n(t)&&null!==t&&!Array.isArray(t)}function _t(t,n){var e=function(t,n){var e=0,r=!1,o="^";"/"!==t[0]&&(t="/"+t);for(var i=0;i<t.length;i++){var u=t[i];(!r&&":"===u||r&&"/"===u)&&a(i)}return a(t.length),new RegExp(o,"i");function a(i){var u=t.slice(e,i).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(o+=r?"[^/]+/?":u,i===t.length)if(r)n&&(o+="$");else{var a=n?"":".*";o="/"===o.charAt(o.length-1)?"".concat(o).concat(a,"$"):"".concat(o,"(/").concat(a,")?(#.*)?$")}r=!r,e=i}}(t,n);return function(t){var n=t.origin;n||(n="".concat(t.protocol,"//").concat(t.host));var r=t.href.replace(n,"").replace(t.search,"").split("?")[0];return e.test(r)}}var Dt=!1,Ut=[],jt=Y&&window.location.href;function Mt(){return Lt()}function Lt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;if(Dt)return new Promise((function(t,e){Ut.push({resolve:t,reject:e,eventArguments:n})}));var r,i=gt(),u=i.appsToUnload,a=i.appsToUnmount,c=i.appsToLoad,s=i.appsToMount,f=!1,p=jt,h=jt=window.location.href;return Bt()?(Dt=!0,r=u.concat(c,a,s),g()):(r=c,d());function m(){f=!0}function d(){return Promise.resolve().then((function(){var t=c.map(z);return Promise.all(t).then(y).then((function(){return[]})).catch((function(t){throw y(),t}))}))}function g(){return Promise.resolve().then((function(){if(window.dispatchEvent(new o(0===r.length?"single-spa:before-no-app-change":"single-spa:before-app-change",O(!0))),window.dispatchEvent(new o("single-spa:before-routing-event",O(!0,{cancelNavigation:m}))),f)return window.dispatchEvent(new o("single-spa:before-mount-routing-event",O(!0))),E(),void nt(p);var n=u.map(ht),e=a.map(L).map((function(t){return t.then(ht)})).concat(n),i=Promise.all(e);i.then((function(){window.dispatchEvent(new o("single-spa:before-mount-routing-event",O(!0)))}));var l=c.map((function(t){return z(t).then((function(t){return Rt(t,i)}))})),h=s.filter((function(t){return c.indexOf(t)<0})).map((function(t){return Rt(t,i)}));return i.catch((function(t){throw y(),t})).then((function(){return y(),Promise.all(l.concat(h)).catch((function(n){throw t.forEach((function(t){return t.reject(n)})),n})).then(E)}))}))}function E(){var n=Et();t.forEach((function(t){return t.resolve(n)}));try{var e=0===r.length?"single-spa:no-app-change":"single-spa:app-change";window.dispatchEvent(new o(e,O())),window.dispatchEvent(new o("single-spa:routing-event",O()))}catch(t){setTimeout((function(){throw t}))}if(Dt=!1,Ut.length>0){var i=Ut;Ut=[],Lt(i)}return n}function y(){t.forEach((function(t){et(t.eventArguments)})),et(n)}function O(){var t,o=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=arguments.length>1?arguments[1]:void 0,m={},d=(e(t={},w,[]),e(t,v,[]),e(t,l,[]),e(t,P,[]),t);o?(c.concat(s).forEach((function(t,n){E(t,w)})),u.forEach((function(t){E(t,l)})),a.forEach((function(t){E(t,v)}))):r.forEach((function(t){E(t)}));var g={detail:{newAppStatuses:m,appsByNewStatus:d,totalAppChanges:r.length,originalEvent:null==n?void 0:n[0],oldUrl:p,newUrl:h,navigationIsCanceled:f}};return i&&S(g.detail,i),g;function E(t,n){var e=T(t);n=n||Pt(e),m[e]=n,(d[n]=d[n]||[]).push(e)}}}function Rt(t,n){return b(t)?M(t).then((function(t){return n.then((function(){return b(t)?x(t):t}))})):n.then((function(){return t}))}var It=!1;function xt(t){var n;It=!0,t&&t.urlRerouteOnly&&(n=t.urlRerouteOnly,X=n),Y&&Lt()}function Bt(){return It}Y&&setTimeout((function(){It||console.warn(s(1,!1))}),5e3);var Gt={getRawAppData:function(){return[].concat(wt)},reroute:Lt,NOT_LOADED:l,toLoadPromise:z,toBootstrapPromise:M,unregisterApplication:Tt};Y&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=Gt);export{m as BOOTSTRAPPING,p as LOADING_SOURCE_CODE,y as LOAD_ERROR,w as MOUNTED,d as MOUNTING,h as NOT_BOOTSTRAPPED,l as NOT_LOADED,v as NOT_MOUNTED,P as SKIP_BECAUSE_BROKEN,E as UNMOUNTING,g as UPDATING,a as addErrorHandler,bt as checkActivityFunctions,ft as ensureJQuerySupport,yt as getAppNames,Pt as getAppStatus,Et as getMountedApps,C as mountRootParcel,nt as navigateToUrl,_t as pathToActiveWhen,Ot as registerApplication,c as removeErrorHandler,F as setBootstrapMaxTime,J as setMountMaxTime,Q as setUnloadMaxTime,H as setUnmountMaxTime,xt as start,Mt as triggerAppChange,At as unloadApplication,Tt as unregisterApplication}; | ||
/* single-spa@5.9.5 - ESM - prod */ | ||
var t=Object.freeze({__proto__:null,get start(){return Bt},get ensureJQuerySupport(){return lt},get setBootstrapMaxTime(){return J},get setMountMaxTime(){return H},get setUnmountMaxTime(){return Q},get setUnloadMaxTime(){return V},get registerApplication(){return bt},get unregisterApplication(){return At},get getMountedApps(){return yt},get getAppStatus(){return Ot},get unloadApplication(){return Nt},get checkActivityFunctions(){return Tt},get getAppNames(){return Pt},get pathToActiveWhen(){return Dt},get navigateToUrl(){return et},get triggerAppChange(){return Lt},get addErrorHandler(){return a},get removeErrorHandler(){return c},get mountRootParcel(){return W},get NOT_LOADED(){return l},get LOADING_SOURCE_CODE(){return p},get NOT_BOOTSTRAPPED(){return h},get BOOTSTRAPPING(){return m},get NOT_MOUNTED(){return v},get MOUNTING(){return d},get UPDATING(){return g},get LOAD_ERROR(){return P},get MOUNTED(){return w},get UNLOADING(){return y},get UNMOUNTING(){return E},get SKIP_BECAUSE_BROKEN(){return O}});function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function e(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}var r=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}).CustomEvent,o=function(){try{var t=new r("cat",{detail:{foo:"bar"}});return"cat"===t.type&&"bar"===t.detail.foo}catch(t){}return!1}()?r:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(t,n){var e=document.createEvent("CustomEvent");return n?e.initCustomEvent(t,n.bubbles,n.cancelable,n.detail):e.initCustomEvent(t,!1,!1,void 0),e}:function(t,n){var e=document.createEventObject();return e.type=t,n?(e.bubbles=Boolean(n.bubbles),e.cancelable=Boolean(n.cancelable),e.detail=n.detail):(e.bubbles=!1,e.cancelable=!1,e.detail=void 0),e},i=[];function u(t,n,e){var r=f(t,n,e);i.length?i.forEach((function(t){return t(r)})):setTimeout((function(){throw r}))}function a(t){if("function"!=typeof t)throw Error(s(28,!1));i.push(t)}function c(t){if("function"!=typeof t)throw Error(s(29,!1));var n=!1;return i=i.filter((function(e){var r=e===t;return n=n||r,!r})),n}function s(t,n){for(var e=arguments.length,r=new Array(e>2?e-2:0),o=2;o<e;o++)r[o-2]=arguments[o];return"single-spa minified message #".concat(t,": ").concat(n?n+" ":"","See https://single-spa.js.org/error/?code=").concat(t).concat(r.length?"&arg=".concat(r.join("&arg=")):"")}function f(t,n,e){var r,o="".concat(S(n)," '").concat(A(n),"' died in status ").concat(n.status,": ");if(t instanceof Error){try{t.message=o+t.message}catch(t){}r=t}else{console.warn(s(30,!1,n.status,A(n)));try{r=Error(o+JSON.stringify(t))}catch(n){r=t}}return r.appOrParcelName=A(n),n.status=e,r}var l="NOT_LOADED",p="LOADING_SOURCE_CODE",h="NOT_BOOTSTRAPPED",m="BOOTSTRAPPING",v="NOT_MOUNTED",d="MOUNTING",w="MOUNTED",g="UPDATING",E="UNMOUNTING",y="UNLOADING",P="LOAD_ERROR",O="SKIP_BECAUSE_BROKEN";function b(t){return t.status===w}function T(t){try{return t.activeWhen(window.location)}catch(n){return u(n,t,O),!1}}function A(t){return t.name}function N(t){return Boolean(t.unmountThisParcel)}function S(t){return N(t)?"parcel":"application"}function _(){for(var t=arguments.length-1;t>0;t--)for(var n in arguments[t])"__proto__"!==n&&(arguments[t-1][n]=arguments[t][n]);return arguments[0]}function D(t,n){for(var e=0;e<t.length;e++)if(n(t[e]))return t[e];return null}function U(t){return t&&("function"==typeof t||(n=t,Array.isArray(n)&&!D(n,(function(t){return"function"!=typeof t}))));var n}function j(t,n){var e=t[n]||[];0===(e=Array.isArray(e)?e:[e]).length&&(e=[function(){return Promise.resolve()}]);var r=S(t),o=A(t);return function(t){return e.reduce((function(e,i,u){return e.then((function(){var e=i(t);return M(e)?e:Promise.reject(s(15,!1,r,o,n,u))}))}),Promise.resolve())}}function M(t){return t&&"function"==typeof t.then&&"function"==typeof t.catch}function L(t,n){return Promise.resolve().then((function(){return t.status!==h?t:(t.status=m,t.bootstrap?q(t,"bootstrap").then(e).catch((function(e){if(n)throw f(e,t,O);return u(e,t,O),t})):Promise.resolve().then(e))}));function e(){return t.status=v,t}}function R(t,n){return Promise.resolve().then((function(){if(t.status!==w)return t;t.status=E;var e=Object.keys(t.parcels).map((function(n){return t.parcels[n].unmountThisParcel()}));return Promise.all(e).then(r,(function(e){return r().then((function(){var r=Error(e.message);if(n)throw f(r,t,O);u(r,t,O)}))})).then((function(){return t}));function r(){return q(t,"unmount").then((function(){t.status=v})).catch((function(e){if(n)throw f(e,t,O);u(e,t,O)}))}}))}var I=!1,x=!1;function B(t,n){return Promise.resolve().then((function(){return t.status!==v?t:(I||(window.dispatchEvent(new o("single-spa:before-first-mount")),I=!0),q(t,"mount").then((function(){return t.status=w,x||(window.dispatchEvent(new o("single-spa:first-mount")),x=!0),t})).catch((function(e){return t.status=w,R(t,!0).then(r,r);function r(){if(n)throw f(e,t,O);return u(e,t,O),t}})))}))}var G=0,C={parcels:{}};function W(){return $.apply(C,arguments)}function $(t,e){var r=this;if(!t||"object"!==n(t)&&"function"!=typeof t)throw Error(s(2,!1));if(t.name&&"string"!=typeof t.name)throw Error(s(3,!1,n(t.name)));if("object"!==n(e))throw Error(s(4,!1,name,n(e)));if(!e.domElement)throw Error(s(5,!1,name));var o,i=G++,u="function"==typeof t,a=u?t:function(){return Promise.resolve(t)},c={id:i,parcels:{},status:u?p:h,customProps:e,parentName:A(r),unmountThisParcel:function(){return y.then((function(){if(c.status!==w)throw Error(s(6,!1,name,c.status));return R(c,!0)})).then((function(t){return c.parentName&&delete r.parcels[c.id],t})).then((function(t){return m(t),t})).catch((function(t){throw c.status=O,d(t),t}))}};r.parcels[i]=c;var l=a();if(!l||"function"!=typeof l.then)throw Error(s(7,!1));var m,d,E=(l=l.then((function(t){if(!t)throw Error(s(8,!1));var n=t.name||"parcel-".concat(i);if(Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!U(t.bootstrap))throw Error(s(9,!1,n));if(!U(t.mount))throw Error(s(10,!1,n));if(!U(t.unmount))throw Error(s(11,!1,n));if(t.update&&!U(t.update))throw Error(s(12,!1,n));var e=j(t,"bootstrap"),r=j(t,"mount"),u=j(t,"unmount");c.status=h,c.name=n,c.bootstrap=e,c.mount=r,c.unmount=u,c.timeouts=z(t.timeouts),t.update&&(c.update=j(t,"update"),o.update=function(t){return c.customProps=t,k(function(t){return Promise.resolve().then((function(){if(t.status!==w)throw Error(s(32,!1,A(t)));return t.status=g,q(t,"update").then((function(){return t.status=w,t})).catch((function(n){throw f(n,t,O)}))}))}(c))})}))).then((function(){return L(c,!0)})),y=E.then((function(){return B(c,!0)})),P=new Promise((function(t,n){m=t,d=n}));return o={mount:function(){return k(Promise.resolve().then((function(){if(c.status!==v)throw Error(s(13,!1,name,c.status));return r.parcels[i]=c,B(c)})))},unmount:function(){return k(c.unmountThisParcel())},getStatus:function(){return c.status},loadPromise:k(l),bootstrapPromise:k(E),mountPromise:k(y),unmountPromise:k(P)}}function k(t){return t.then((function(){return null}))}function K(e){var r=A(e),o="function"==typeof e.customProps?e.customProps(r,window.location):e.customProps;("object"!==n(o)||null===o||Array.isArray(o))&&(o={},console.warn(s(40,!1),r,o));var i=_({},o,{name:r,mountParcel:$.bind(e),singleSpa:t});return N(e)&&(i.unmountSelf=e.unmountThisParcel),i}var F={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:1e3},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},update:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3}};function J(t,n,e){if("number"!=typeof t||t<=0)throw Error(s(16,!1));F.bootstrap={millis:t,dieOnTimeout:n,warningMillis:e||1e3}}function H(t,n,e){if("number"!=typeof t||t<=0)throw Error(s(17,!1));F.mount={millis:t,dieOnTimeout:n,warningMillis:e||1e3}}function Q(t,n,e){if("number"!=typeof t||t<=0)throw Error(s(18,!1));F.unmount={millis:t,dieOnTimeout:n,warningMillis:e||1e3}}function V(t,n,e){if("number"!=typeof t||t<=0)throw Error(s(19,!1));F.unload={millis:t,dieOnTimeout:n,warningMillis:e||1e3}}function q(t,n){var e=t.timeouts[n],r=e.warningMillis,o=S(t);return new Promise((function(i,u){var a=!1,c=!1;t[n](K(t)).then((function(t){a=!0,i(t)})).catch((function(t){a=!0,u(t)})),setTimeout((function(){return l(1)}),r),setTimeout((function(){return l(!0)}),e.millis);var f=s(31,!1,n,o,A(t),e.millis);function l(t){if(!a)if(!0===t)c=!0,e.dieOnTimeout?u(Error(f)):console.error(f);else if(!c){var n=t,o=n*r;console.warn(f),o+r<e.millis&&setTimeout((function(){return l(n+1)}),r)}}}))}function z(t){var n={};for(var e in F)n[e]=_({},F[e],t&&t[e]||{});return n}function X(t){return Promise.resolve().then((function(){return t.loadPromise?t.loadPromise:t.status!==l&&t.status!==P?t:(t.status=p,t.loadPromise=Promise.resolve().then((function(){var o=t.loadApp(K(t));if(!M(o))throw r=!0,Error(s(33,!1,A(t)));return o.then((function(r){var o;t.loadErrorTime=null,"object"!==n(e=r)&&(o=34),Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!U(e.bootstrap)&&(o=35),U(e.mount)||(o=36),U(e.unmount)||(o=37);var i=S(e);if(o){var a;try{a=JSON.stringify(e)}catch(t){}return console.error(s(o,!1,i,A(t),a),e),u(void 0,t,O),t}return e.devtools&&e.devtools.overlays&&(t.devtools.overlays=_({},t.devtools.overlays,e.devtools.overlays)),t.status=h,t.bootstrap=j(e,"bootstrap"),t.mount=j(e,"mount"),t.unmount=j(e,"unmount"),t.unload=j(e,"unload"),t.timeouts=z(e.timeouts),delete t.loadPromise,t}))})).catch((function(n){var e;return delete t.loadPromise,r?e=O:(e=P,t.loadErrorTime=(new Date).getTime()),u(n,t,e),t})));var e,r}))}var Y,Z="undefined"!=typeof window,tt={hashchange:[],popstate:[]},nt=["hashchange","popstate"];function et(t){var n;if("string"==typeof t)n=t;else if(this&&this.href)n=this.href;else{if(!(t&&t.currentTarget&&t.currentTarget.href&&t.preventDefault))throw Error(s(14,!1));n=t.currentTarget.href,t.preventDefault()}var e=st(window.location.href),r=st(n);0===n.indexOf("#")?window.location.hash=r.hash:e.host!==r.host&&r.host?window.location.href=n:r.pathname===e.pathname&&r.search===e.search?window.location.hash=r.hash:window.history.pushState(null,null,n)}function rt(t){var n=this;if(t){var e=t[0].type;nt.indexOf(e)>=0&&tt[e].forEach((function(e){try{e.apply(n,t)}catch(t){setTimeout((function(){throw t}))}}))}}function ot(){Rt([],arguments)}function it(t,n){return function(){var e=window.location.href,r=t.apply(this,arguments),o=window.location.href;return Y&&e===o||(Gt()?window.dispatchEvent(ut(window.history.state,n)):Rt([])),r}}function ut(t,n){var e;try{e=new PopStateEvent("popstate",{state:t})}catch(n){(e=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,t)}return e.singleSpa=!0,e.singleSpaTrigger=n,e}if(Z){window.addEventListener("hashchange",ot),window.addEventListener("popstate",ot);var at=window.addEventListener,ct=window.removeEventListener;window.addEventListener=function(t,n){if(!("function"==typeof n&&nt.indexOf(t)>=0)||D(tt[t],(function(t){return t===n})))return at.apply(this,arguments);tt[t].push(n)},window.removeEventListener=function(t,n){if(!("function"==typeof n&&nt.indexOf(t)>=0))return ct.apply(this,arguments);tt[t]=tt[t].filter((function(t){return t!==n}))},window.history.pushState=it(window.history.pushState,"pushState"),window.history.replaceState=it(window.history.replaceState,"replaceState"),window.singleSpaNavigate?console.warn(s(41,!1)):window.singleSpaNavigate=et}function st(t){var n=document.createElement("a");return n.href=t,n}var ft=!1;function lt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!ft){var n=t.fn.on,e=t.fn.off;t.fn.on=function(t,e){return pt.call(this,n,window.addEventListener,t,e,arguments)},t.fn.off=function(t,n){return pt.call(this,e,window.removeEventListener,t,n,arguments)},ft=!0}}function pt(t,n,e,r,o){return"string"!=typeof e?t.apply(this,o):(e.split(/\s+/).forEach((function(t){nt.indexOf(t)>=0&&(n(t,r),e=e.replace(t,""))})),""===e.trim()?this:t.apply(this,o))}var ht={};function mt(t){return Promise.resolve().then((function(){var n=ht[A(t)];if(!n)return t;if(t.status===l)return vt(t,n),t;if(t.status===y)return n.promise.then((function(){return t}));if(t.status!==v&&t.status!==P)return t;var e=t.status===P?Promise.resolve():q(t,"unload");return t.status=y,e.then((function(){return vt(t,n),t})).catch((function(e){return function(t,n,e){delete ht[A(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,u(e,t,O),n.reject(e)}(t,n,e),t}))}))}function vt(t,n){delete ht[A(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=l,n.resolve()}function dt(t,n,e,r){ht[A(t)]={app:t,resolve:e,reject:r},Object.defineProperty(ht[A(t)],"promise",{get:n})}function wt(t){return ht[t]}var gt=[];function Et(){var t=[],n=[],e=[],r=[],o=(new Date).getTime();return gt.forEach((function(i){var u=i.status!==O&&T(i);switch(i.status){case P:u&&o-i.loadErrorTime>=200&&e.push(i);break;case l:case p:u&&e.push(i);break;case h:case v:!u&&wt(A(i))?t.push(i):u&&r.push(i);break;case w:u||n.push(i)}})),{appsToUnload:t,appsToUnmount:n,appsToLoad:e,appsToMount:r}}function yt(){return gt.filter(b).map(A)}function Pt(){return gt.map(A)}function Ot(t){var n=D(gt,(function(n){return A(n)===t}));return n?n.status:null}function bt(t,e,r,o){var i=function(t,e,r,o){var i,u={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"===n(t)?(function(t){if(Array.isArray(t)||null===t)throw Error(s(39,!1));var e=["name","app","activeWhen","customProps"],r=Object.keys(t).reduce((function(t,n){return e.indexOf(n)>=0?t:t.concat(n)}),[]);if(0!==r.length)throw Error(s(38,!1,e.join(", "),r.join(", ")));if("string"!=typeof t.name||0===t.name.length)throw Error(s(20,!1));if("object"!==n(t.app)&&"function"!=typeof t.app)throw Error(s(20,!1));var o=function(t){return"string"==typeof t||"function"==typeof t};if(!(o(t.activeWhen)||Array.isArray(t.activeWhen)&&t.activeWhen.every(o)))throw Error(s(24,!1));if(!_t(t.customProps))throw Error(s(22,!1))}(t),u.name=t.name,u.loadApp=t.app,u.activeWhen=t.activeWhen,u.customProps=t.customProps):(function(t,n,e,r){if("string"!=typeof t||0===t.length)throw Error(s(20,!1));if(!n)throw Error(s(23,!1));if("function"!=typeof e)throw Error(s(24,!1));if(!_t(r))throw Error(s(22,!1))}(t,e,r,o),u.name=t,u.loadApp=e,u.activeWhen=r,u.customProps=o),u.loadApp="function"!=typeof(i=u.loadApp)?function(){return Promise.resolve(i)}:i,u.customProps=function(t){return t||{}}(u.customProps),u.activeWhen=function(t){var n=Array.isArray(t)?t:[t];return n=n.map((function(t){return"function"==typeof t?t:Dt(t)})),function(t){return n.some((function(n){return n(t)}))}}(u.activeWhen),u}(t,e,r,o);if(-1!==Pt().indexOf(i.name))throw Error(s(21,!1,i.name));gt.push(_({loadErrorTime:null,status:l,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},i)),Z&&(lt(),Rt())}function Tt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location;return gt.filter((function(n){return n.activeWhen(t)})).map(A)}function At(t){if(0===gt.filter((function(n){return A(n)===t})).length)throw Error(s(25,!1,t));return Nt(t).then((function(){var n=gt.map(A).indexOf(t);gt.splice(n,1)}))}function Nt(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof t)throw Error(s(26,!1));var e=D(gt,(function(n){return A(n)===t}));if(!e)throw Error(s(27,!1,t));var r,o=wt(A(e));if(n&&n.waitForUnmount){if(o)return o.promise;var i=new Promise((function(t,n){dt(e,(function(){return i}),t,n)}));return i}return o?(r=o.promise,St(e,o.resolve,o.reject)):r=new Promise((function(t,n){dt(e,(function(){return r}),t,n),St(e,t,n)})),r}function St(t,n,e){R(t).then(mt).then((function(){n(),setTimeout((function(){Rt()}))})).catch(e)}function _t(t){return!t||"function"==typeof t||"object"===n(t)&&null!==t&&!Array.isArray(t)}function Dt(t,n){var e=function(t,n){var e=0,r=!1,o="^";"/"!==t[0]&&(t="/"+t);for(var i=0;i<t.length;i++){var u=t[i];(!r&&":"===u||r&&"/"===u)&&a(i)}return a(t.length),new RegExp(o,"i");function a(i){var u=t.slice(e,i).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(o+=r?"[^/]+/?":u,i===t.length)if(r)n&&(o+="$");else{var a=n?"":".*";o="/"===o.charAt(o.length-1)?"".concat(o).concat(a,"$"):"".concat(o,"(/").concat(a,")?(#.*)?$")}r=!r,e=i}}(t,n);return function(t){var n=t.origin;n||(n="".concat(t.protocol,"//").concat(t.host));var r=t.href.replace(n,"").replace(t.search,"").split("?")[0];return e.test(r)}}var Ut=!1,jt=[],Mt=Z&&window.location.href;function Lt(){return Rt()}function Rt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;if(Ut)return new Promise((function(t,e){jt.push({resolve:t,reject:e,eventArguments:n})}));var r,i=Et(),u=i.appsToUnload,a=i.appsToUnmount,c=i.appsToLoad,s=i.appsToMount,f=!1,p=Mt,h=Mt=window.location.href;return Gt()?(Ut=!0,r=u.concat(c,a,s),g()):(r=c,d());function m(){f=!0}function d(){return Promise.resolve().then((function(){var t=c.map(X);return Promise.all(t).then(y).then((function(){return[]})).catch((function(t){throw y(),t}))}))}function g(){return Promise.resolve().then((function(){if(window.dispatchEvent(new o(0===r.length?"single-spa:before-no-app-change":"single-spa:before-app-change",P(!0))),window.dispatchEvent(new o("single-spa:before-routing-event",P(!0,{cancelNavigation:m}))),f)return window.dispatchEvent(new o("single-spa:before-mount-routing-event",P(!0))),E(),void et(p);var n=u.map(mt),e=a.map(R).map((function(t){return t.then(mt)})).concat(n),i=Promise.all(e);i.then((function(){window.dispatchEvent(new o("single-spa:before-mount-routing-event",P(!0)))}));var l=c.map((function(t){return X(t).then((function(t){return It(t,i)}))})),h=s.filter((function(t){return c.indexOf(t)<0})).map((function(t){return It(t,i)}));return i.catch((function(t){throw y(),t})).then((function(){return y(),Promise.all(l.concat(h)).catch((function(n){throw t.forEach((function(t){return t.reject(n)})),n})).then(E)}))}))}function E(){var n=yt();t.forEach((function(t){return t.resolve(n)}));try{var e=0===r.length?"single-spa:no-app-change":"single-spa:app-change";window.dispatchEvent(new o(e,P())),window.dispatchEvent(new o("single-spa:routing-event",P()))}catch(t){setTimeout((function(){throw t}))}if(Ut=!1,jt.length>0){var i=jt;jt=[],Rt(i)}return n}function y(){t.forEach((function(t){rt(t.eventArguments)})),rt(n)}function P(){var t,o=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=arguments.length>1?arguments[1]:void 0,m={},d=(e(t={},w,[]),e(t,v,[]),e(t,l,[]),e(t,O,[]),t);o?(c.concat(s).forEach((function(t,n){E(t,w)})),u.forEach((function(t){E(t,l)})),a.forEach((function(t){E(t,v)}))):r.forEach((function(t){E(t)}));var g={detail:{newAppStatuses:m,appsByNewStatus:d,totalAppChanges:r.length,originalEvent:null==n?void 0:n[0],oldUrl:p,newUrl:h,navigationIsCanceled:f}};return i&&_(g.detail,i),g;function E(t,n){var e=A(t);n=n||Ot(e),m[e]=n,(d[n]=d[n]||[]).push(e)}}}function It(t,n){return T(t)?L(t).then((function(t){return n.then((function(){return T(t)?B(t):t}))})):n.then((function(){return t}))}var xt=!1;function Bt(t){var n;xt=!0,t&&t.urlRerouteOnly&&(n=t.urlRerouteOnly,Y=n),Z&&Rt()}function Gt(){return xt}Z&&setTimeout((function(){xt||console.warn(s(1,!1))}),5e3);var Ct={getRawAppData:function(){return[].concat(gt)},reroute:Rt,NOT_LOADED:l,toLoadPromise:X,toBootstrapPromise:L,unregisterApplication:At};Z&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=Ct);export{m as BOOTSTRAPPING,p as LOADING_SOURCE_CODE,P as LOAD_ERROR,w as MOUNTED,d as MOUNTING,h as NOT_BOOTSTRAPPED,l as NOT_LOADED,v as NOT_MOUNTED,O as SKIP_BECAUSE_BROKEN,y as UNLOADING,E as UNMOUNTING,g as UPDATING,a as addErrorHandler,Tt as checkActivityFunctions,lt as ensureJQuerySupport,Pt as getAppNames,Ot as getAppStatus,yt as getMountedApps,W as mountRootParcel,et as navigateToUrl,Dt as pathToActiveWhen,bt as registerApplication,c as removeErrorHandler,J as setBootstrapMaxTime,H as setMountMaxTime,V as setUnloadMaxTime,Q as setUnmountMaxTime,Bt as start,Lt as triggerAppChange,Nt as unloadApplication,At as unregisterApplication}; | ||
//# sourceMappingURL=single-spa.min.js.map |
@@ -1,3 +0,3 @@ | ||
/* single-spa@5.9.4 - SystemJS - prod */ | ||
System.register([],(function(t){"use strict";return{execute:function(){t({addErrorHandler:c,checkActivityFunctions:bt,ensureJQuerySupport:lt,getAppNames:Ot,getAppStatus:Tt,getMountedApps:yt,mountRootParcel:W,navigateToUrl:et,pathToActiveWhen:Ut,registerApplication:Pt,removeErrorHandler:s,setBootstrapMaxTime:H,setMountMaxTime:J,setUnloadMaxTime:V,setUnmountMaxTime:Q,start:Bt,triggerAppChange:Lt,unloadApplication:Nt,unregisterApplication:At});var n=Object.freeze({__proto__:null,get start(){return Bt},get ensureJQuerySupport(){return lt},get setBootstrapMaxTime(){return H},get setMountMaxTime(){return J},get setUnmountMaxTime(){return Q},get setUnloadMaxTime(){return V},get registerApplication(){return Pt},get unregisterApplication(){return At},get getMountedApps(){return yt},get getAppStatus(){return Tt},get unloadApplication(){return Nt},get checkActivityFunctions(){return bt},get getAppNames(){return Ot},get pathToActiveWhen(){return Ut},get navigateToUrl(){return et},get triggerAppChange(){return Lt},get addErrorHandler(){return c},get removeErrorHandler(){return s},get mountRootParcel(){return W},get NOT_LOADED(){return p},get LOADING_SOURCE_CODE(){return h},get NOT_BOOTSTRAPPED(){return m},get BOOTSTRAPPING(){return d},get NOT_MOUNTED(){return v},get MOUNTING(){return w},get UPDATING(){return E},get LOAD_ERROR(){return O},get MOUNTED(){return g},get UNMOUNTING(){return y},get SKIP_BECAUSE_BROKEN(){return T}});function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}var o=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}).CustomEvent,i=function(){try{var t=new o("cat",{detail:{foo:"bar"}});return"cat"===t.type&&"bar"===t.detail.foo}catch(t){}return!1}()?o:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(t,n){var e=document.createEvent("CustomEvent");return n?e.initCustomEvent(t,n.bubbles,n.cancelable,n.detail):e.initCustomEvent(t,!1,!1,void 0),e}:function(t,n){var e=document.createEventObject();return e.type=t,n?(e.bubbles=Boolean(n.bubbles),e.cancelable=Boolean(n.cancelable),e.detail=n.detail):(e.bubbles=!1,e.cancelable=!1,e.detail=void 0),e},u=[];function a(t,n,e){var r=l(t,n,e);u.length?u.forEach((function(t){return t(r)})):setTimeout((function(){throw r}))}function c(t){if("function"!=typeof t)throw Error(f(28,!1));u.push(t)}function s(t){if("function"!=typeof t)throw Error(f(29,!1));var n=!1;return u=u.filter((function(e){var r=e===t;return n=n||r,!r})),n}function f(t,n){for(var e=arguments.length,r=new Array(e>2?e-2:0),o=2;o<e;o++)r[o-2]=arguments[o];return"single-spa minified message #".concat(t,": ").concat(n?n+" ":"","See https://single-spa.js.org/error/?code=").concat(t).concat(r.length?"&arg=".concat(r.join("&arg=")):"")}function l(t,n,e){var r,o="".concat(S(n)," '").concat(A(n),"' died in status ").concat(n.status,": ");if(t instanceof Error){try{t.message=o+t.message}catch(t){}r=t}else{console.warn(f(30,!1,n.status,A(n)));try{r=Error(o+JSON.stringify(t))}catch(n){r=t}}return r.appOrParcelName=A(n),n.status=e,r}var p=t("NOT_LOADED","NOT_LOADED"),h=t("LOADING_SOURCE_CODE","LOADING_SOURCE_CODE"),m=t("NOT_BOOTSTRAPPED","NOT_BOOTSTRAPPED"),d=t("BOOTSTRAPPING","BOOTSTRAPPING"),v=t("NOT_MOUNTED","NOT_MOUNTED"),w=t("MOUNTING","MOUNTING"),g=t("MOUNTED","MOUNTED"),E=t("UPDATING","UPDATING"),y=t("UNMOUNTING","UNMOUNTING"),O=t("LOAD_ERROR","LOAD_ERROR"),T=t("SKIP_BECAUSE_BROKEN","SKIP_BECAUSE_BROKEN");function P(t){return t.status===g}function b(t){try{return t.activeWhen(window.location)}catch(n){return a(n,t,T),!1}}function A(t){return t.name}function N(t){return Boolean(t.unmountThisParcel)}function S(t){return N(t)?"parcel":"application"}function _(){for(var t=arguments.length-1;t>0;t--)for(var n in arguments[t])"__proto__"!==n&&(arguments[t-1][n]=arguments[t][n]);return arguments[0]}function U(t,n){for(var e=0;e<t.length;e++)if(n(t[e]))return t[e];return null}function D(t){return t&&("function"==typeof t||(n=t,Array.isArray(n)&&!U(n,(function(t){return"function"!=typeof t}))));var n}function M(t,n){var e=t[n]||[];0===(e=Array.isArray(e)?e:[e]).length&&(e=[function(){return Promise.resolve()}]);var r=S(t),o=A(t);return function(t){return e.reduce((function(e,i,u){return e.then((function(){var e=i(t);return j(e)?e:Promise.reject(f(15,!1,r,o,n,u))}))}),Promise.resolve())}}function j(t){return t&&"function"==typeof t.then&&"function"==typeof t.catch}function L(t,n){return Promise.resolve().then((function(){return t.status!==m?t:(t.status=d,t.bootstrap?q(t,"bootstrap").then(e).catch((function(e){if(n)throw l(e,t,T);return a(e,t,T),t})):Promise.resolve().then(e))}));function e(){return t.status=v,t}}function R(t,n){return Promise.resolve().then((function(){if(t.status!==g)return t;t.status=y;var e=Object.keys(t.parcels).map((function(n){return t.parcels[n].unmountThisParcel()}));return Promise.all(e).then(r,(function(e){return r().then((function(){var r=Error(e.message);if(n)throw l(r,t,T);a(r,t,T)}))})).then((function(){return t}));function r(){return q(t,"unmount").then((function(){t.status=v})).catch((function(e){if(n)throw l(e,t,T);a(e,t,T)}))}}))}var I=!1,x=!1;function B(t,n){return Promise.resolve().then((function(){return t.status!==v?t:(I||(window.dispatchEvent(new i("single-spa:before-first-mount")),I=!0),q(t,"mount").then((function(){return t.status=g,x||(window.dispatchEvent(new i("single-spa:first-mount")),x=!0),t})).catch((function(e){return t.status=g,R(t,!0).then(r,r);function r(){if(n)throw l(e,t,T);return a(e,t,T),t}})))}))}var G=0,C={parcels:{}};function W(){return $.apply(C,arguments)}function $(t,n){var r=this;if(!t||"object"!==e(t)&&"function"!=typeof t)throw Error(f(2,!1));if(t.name&&"string"!=typeof t.name)throw Error(f(3,!1,e(t.name)));if("object"!==e(n))throw Error(f(4,!1,name,e(n)));if(!n.domElement)throw Error(f(5,!1,name));var o,i=G++,u="function"==typeof t,a=u?t:function(){return Promise.resolve(t)},c={id:i,parcels:{},status:u?h:m,customProps:n,parentName:A(r),unmountThisParcel:function(){return y.then((function(){if(c.status!==g)throw Error(f(6,!1,name,c.status));return R(c,!0)})).then((function(t){return c.parentName&&delete r.parcels[c.id],t})).then((function(t){return p(t),t})).catch((function(t){throw c.status=T,d(t),t}))}};r.parcels[i]=c;var s=a();if(!s||"function"!=typeof s.then)throw Error(f(7,!1));var p,d,w=(s=s.then((function(t){if(!t)throw Error(f(8,!1));var n=t.name||"parcel-".concat(i);if(Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!D(t.bootstrap))throw Error(f(9,!1,n));if(!D(t.mount))throw Error(f(10,!1,n));if(!D(t.unmount))throw Error(f(11,!1,n));if(t.update&&!D(t.update))throw Error(f(12,!1,n));var e=M(t,"bootstrap"),r=M(t,"mount"),u=M(t,"unmount");c.status=m,c.name=n,c.bootstrap=e,c.mount=r,c.unmount=u,c.timeouts=z(t.timeouts),t.update&&(c.update=M(t,"update"),o.update=function(t){return c.customProps=t,k(function(t){return Promise.resolve().then((function(){if(t.status!==g)throw Error(f(32,!1,A(t)));return t.status=E,q(t,"update").then((function(){return t.status=g,t})).catch((function(n){throw l(n,t,T)}))}))}(c))})}))).then((function(){return L(c,!0)})),y=w.then((function(){return B(c,!0)})),O=new Promise((function(t,n){p=t,d=n}));return o={mount:function(){return k(Promise.resolve().then((function(){if(c.status!==v)throw Error(f(13,!1,name,c.status));return r.parcels[i]=c,B(c)})))},unmount:function(){return k(c.unmountThisParcel())},getStatus:function(){return c.status},loadPromise:k(s),bootstrapPromise:k(w),mountPromise:k(y),unmountPromise:k(O)}}function k(t){return t.then((function(){return null}))}function K(t){var r=A(t),o="function"==typeof t.customProps?t.customProps(r,window.location):t.customProps;("object"!==e(o)||null===o||Array.isArray(o))&&(o={},console.warn(f(40,!1),r,o));var i=_({},o,{name:r,mountParcel:$.bind(t),singleSpa:n});return N(t)&&(i.unmountSelf=t.unmountThisParcel),i}var F={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:1e3},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},update:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3}};function H(t,n,e){if("number"!=typeof t||t<=0)throw Error(f(16,!1));F.bootstrap={millis:t,dieOnTimeout:n,warningMillis:e||1e3}}function J(t,n,e){if("number"!=typeof t||t<=0)throw Error(f(17,!1));F.mount={millis:t,dieOnTimeout:n,warningMillis:e||1e3}}function Q(t,n,e){if("number"!=typeof t||t<=0)throw Error(f(18,!1));F.unmount={millis:t,dieOnTimeout:n,warningMillis:e||1e3}}function V(t,n,e){if("number"!=typeof t||t<=0)throw Error(f(19,!1));F.unload={millis:t,dieOnTimeout:n,warningMillis:e||1e3}}function q(t,n){var e=t.timeouts[n],r=e.warningMillis,o=S(t);return new Promise((function(i,u){var a=!1,c=!1;t[n](K(t)).then((function(t){a=!0,i(t)})).catch((function(t){a=!0,u(t)})),setTimeout((function(){return l(1)}),r),setTimeout((function(){return l(!0)}),e.millis);var s=f(31,!1,n,o,A(t),e.millis);function l(t){if(!a)if(!0===t)c=!0,e.dieOnTimeout?u(Error(s)):console.error(s);else if(!c){var n=t,o=n*r;console.warn(s),o+r<e.millis&&setTimeout((function(){return l(n+1)}),r)}}}))}function z(t){var n={};for(var e in F)n[e]=_({},F[e],t&&t[e]||{});return n}function X(t){return Promise.resolve().then((function(){return t.loadPromise?t.loadPromise:t.status!==p&&t.status!==O?t:(t.status=h,t.loadPromise=Promise.resolve().then((function(){var o=t.loadApp(K(t));if(!j(o))throw r=!0,Error(f(33,!1,A(t)));return o.then((function(r){var o;t.loadErrorTime=null,"object"!==e(n=r)&&(o=34),Object.prototype.hasOwnProperty.call(n,"bootstrap")&&!D(n.bootstrap)&&(o=35),D(n.mount)||(o=36),D(n.unmount)||(o=37);var i=S(n);if(o){var u;try{u=JSON.stringify(n)}catch(t){}return console.error(f(o,!1,i,A(t),u),n),a(void 0,t,T),t}return n.devtools&&n.devtools.overlays&&(t.devtools.overlays=_({},t.devtools.overlays,n.devtools.overlays)),t.status=m,t.bootstrap=M(n,"bootstrap"),t.mount=M(n,"mount"),t.unmount=M(n,"unmount"),t.unload=M(n,"unload"),t.timeouts=z(n.timeouts),delete t.loadPromise,t}))})).catch((function(n){var e;return delete t.loadPromise,r?e=T:(e=O,t.loadErrorTime=(new Date).getTime()),a(n,t,e),t})));var n,r}))}var Y,Z="undefined"!=typeof window,tt={hashchange:[],popstate:[]},nt=["hashchange","popstate"];function et(t){var n;if("string"==typeof t)n=t;else if(this&&this.href)n=this.href;else{if(!(t&&t.currentTarget&&t.currentTarget.href&&t.preventDefault))throw Error(f(14,!1));n=t.currentTarget.href,t.preventDefault()}var e=st(window.location.href),r=st(n);0===n.indexOf("#")?window.location.hash=r.hash:e.host!==r.host&&r.host?window.location.href=n:r.pathname===e.pathname&&r.search===e.search?window.location.hash=r.hash:window.history.pushState(null,null,n)}function rt(t){var n=this;if(t){var e=t[0].type;nt.indexOf(e)>=0&&tt[e].forEach((function(e){try{e.apply(n,t)}catch(t){setTimeout((function(){throw t}))}}))}}function ot(){Rt([],arguments)}function it(t,n){return function(){var e=window.location.href,r=t.apply(this,arguments),o=window.location.href;return Y&&e===o||(Gt()?window.dispatchEvent(ut(window.history.state,n)):Rt([])),r}}function ut(t,n){var e;try{e=new PopStateEvent("popstate",{state:t})}catch(n){(e=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,t)}return e.singleSpa=!0,e.singleSpaTrigger=n,e}if(Z){window.addEventListener("hashchange",ot),window.addEventListener("popstate",ot);var at=window.addEventListener,ct=window.removeEventListener;window.addEventListener=function(t,n){if(!("function"==typeof n&&nt.indexOf(t)>=0)||U(tt[t],(function(t){return t===n})))return at.apply(this,arguments);tt[t].push(n)},window.removeEventListener=function(t,n){if(!("function"==typeof n&&nt.indexOf(t)>=0))return ct.apply(this,arguments);tt[t]=tt[t].filter((function(t){return t!==n}))},window.history.pushState=it(window.history.pushState,"pushState"),window.history.replaceState=it(window.history.replaceState,"replaceState"),window.singleSpaNavigate?console.warn(f(41,!1)):window.singleSpaNavigate=et}function st(t){var n=document.createElement("a");return n.href=t,n}var ft=!1;function lt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!ft){var n=t.fn.on,e=t.fn.off;t.fn.on=function(t,e){return pt.call(this,n,window.addEventListener,t,e,arguments)},t.fn.off=function(t,n){return pt.call(this,e,window.removeEventListener,t,n,arguments)},ft=!0}}function pt(t,n,e,r,o){return"string"!=typeof e?t.apply(this,o):(e.split(/\s+/).forEach((function(t){nt.indexOf(t)>=0&&(n(t,r),e=e.replace(t,""))})),""===e.trim()?this:t.apply(this,o))}var ht={};function mt(t){return Promise.resolve().then((function(){var n=ht[A(t)];if(!n)return t;if(t.status===p)return dt(t,n),t;if("UNLOADING"===t.status)return n.promise.then((function(){return t}));if(t.status!==v&&t.status!==O)return t;var e=t.status===O?Promise.resolve():q(t,"unload");return t.status="UNLOADING",e.then((function(){return dt(t,n),t})).catch((function(e){return function(t,n,e){delete ht[A(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,a(e,t,T),n.reject(e)}(t,n,e),t}))}))}function dt(t,n){delete ht[A(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=p,n.resolve()}function vt(t,n,e,r){ht[A(t)]={app:t,resolve:e,reject:r},Object.defineProperty(ht[A(t)],"promise",{get:n})}function wt(t){return ht[t]}var gt=[];function Et(){var t=[],n=[],e=[],r=[],o=(new Date).getTime();return gt.forEach((function(i){var u=i.status!==T&&b(i);switch(i.status){case O:u&&o-i.loadErrorTime>=200&&e.push(i);break;case p:case h:u&&e.push(i);break;case m:case v:!u&&wt(A(i))?t.push(i):u&&r.push(i);break;case g:u||n.push(i)}})),{appsToUnload:t,appsToUnmount:n,appsToLoad:e,appsToMount:r}}function yt(){return gt.filter(P).map(A)}function Ot(){return gt.map(A)}function Tt(t){var n=U(gt,(function(n){return A(n)===t}));return n?n.status:null}function Pt(t,n,r,o){var i=function(t,n,r,o){var i,u={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"===e(t)?(function(t){if(Array.isArray(t)||null===t)throw Error(f(39,!1));var n=["name","app","activeWhen","customProps"],r=Object.keys(t).reduce((function(t,e){return n.indexOf(e)>=0?t:t.concat(e)}),[]);if(0!==r.length)throw Error(f(38,!1,n.join(", "),r.join(", ")));if("string"!=typeof t.name||0===t.name.length)throw Error(f(20,!1));if("object"!==e(t.app)&&"function"!=typeof t.app)throw Error(f(20,!1));var o=function(t){return"string"==typeof t||"function"==typeof t};if(!(o(t.activeWhen)||Array.isArray(t.activeWhen)&&t.activeWhen.every(o)))throw Error(f(24,!1));if(!_t(t.customProps))throw Error(f(22,!1))}(t),u.name=t.name,u.loadApp=t.app,u.activeWhen=t.activeWhen,u.customProps=t.customProps):(function(t,n,e,r){if("string"!=typeof t||0===t.length)throw Error(f(20,!1));if(!n)throw Error(f(23,!1));if("function"!=typeof e)throw Error(f(24,!1));if(!_t(r))throw Error(f(22,!1))}(t,n,r,o),u.name=t,u.loadApp=n,u.activeWhen=r,u.customProps=o),u.loadApp="function"!=typeof(i=u.loadApp)?function(){return Promise.resolve(i)}:i,u.customProps=function(t){return t||{}}(u.customProps),u.activeWhen=function(t){var n=Array.isArray(t)?t:[t];return n=n.map((function(t){return"function"==typeof t?t:Ut(t)})),function(t){return n.some((function(n){return n(t)}))}}(u.activeWhen),u}(t,n,r,o);if(-1!==Ot().indexOf(i.name))throw Error(f(21,!1,i.name));gt.push(_({loadErrorTime:null,status:p,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},i)),Z&&(lt(),Rt())}function bt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location;return gt.filter((function(n){return n.activeWhen(t)})).map(A)}function At(t){if(0===gt.filter((function(n){return A(n)===t})).length)throw Error(f(25,!1,t));return Nt(t).then((function(){var n=gt.map(A).indexOf(t);gt.splice(n,1)}))}function Nt(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof t)throw Error(f(26,!1));var e=U(gt,(function(n){return A(n)===t}));if(!e)throw Error(f(27,!1,t));var r,o=wt(A(e));if(n&&n.waitForUnmount){if(o)return o.promise;var i=new Promise((function(t,n){vt(e,(function(){return i}),t,n)}));return i}return o?(r=o.promise,St(e,o.resolve,o.reject)):r=new Promise((function(t,n){vt(e,(function(){return r}),t,n),St(e,t,n)})),r}function St(t,n,e){R(t).then(mt).then((function(){n(),setTimeout((function(){Rt()}))})).catch(e)}function _t(t){return!t||"function"==typeof t||"object"===e(t)&&null!==t&&!Array.isArray(t)}function Ut(t,n){var e=function(t,n){var e=0,r=!1,o="^";"/"!==t[0]&&(t="/"+t);for(var i=0;i<t.length;i++){var u=t[i];(!r&&":"===u||r&&"/"===u)&&a(i)}return a(t.length),new RegExp(o,"i");function a(i){var u=t.slice(e,i).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(o+=r?"[^/]+/?":u,i===t.length)if(r)n&&(o+="$");else{var a=n?"":".*";o="/"===o.charAt(o.length-1)?"".concat(o).concat(a,"$"):"".concat(o,"(/").concat(a,")?(#.*)?$")}r=!r,e=i}}(t,n);return function(t){var n=t.origin;n||(n="".concat(t.protocol,"//").concat(t.host));var r=t.href.replace(n,"").replace(t.search,"").split("?")[0];return e.test(r)}}var Dt=!1,Mt=[],jt=Z&&window.location.href;function Lt(){return Rt()}function Rt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;if(Dt)return new Promise((function(t,e){Mt.push({resolve:t,reject:e,eventArguments:n})}));var e,o=Et(),u=o.appsToUnload,a=o.appsToUnmount,c=o.appsToLoad,s=o.appsToMount,f=!1,l=jt,h=jt=window.location.href;return Gt()?(Dt=!0,e=u.concat(c,a,s),w()):(e=c,d());function m(){f=!0}function d(){return Promise.resolve().then((function(){var t=c.map(X);return Promise.all(t).then(y).then((function(){return[]})).catch((function(t){throw y(),t}))}))}function w(){return Promise.resolve().then((function(){if(window.dispatchEvent(new i(0===e.length?"single-spa:before-no-app-change":"single-spa:before-app-change",O(!0))),window.dispatchEvent(new i("single-spa:before-routing-event",O(!0,{cancelNavigation:m}))),f)return window.dispatchEvent(new i("single-spa:before-mount-routing-event",O(!0))),E(),void et(l);var n=u.map(mt),r=a.map(R).map((function(t){return t.then(mt)})).concat(n),o=Promise.all(r);o.then((function(){window.dispatchEvent(new i("single-spa:before-mount-routing-event",O(!0)))}));var p=c.map((function(t){return X(t).then((function(t){return It(t,o)}))})),h=s.filter((function(t){return c.indexOf(t)<0})).map((function(t){return It(t,o)}));return o.catch((function(t){throw y(),t})).then((function(){return y(),Promise.all(p.concat(h)).catch((function(n){throw t.forEach((function(t){return t.reject(n)})),n})).then(E)}))}))}function E(){var n=yt();t.forEach((function(t){return t.resolve(n)}));try{var r=0===e.length?"single-spa:no-app-change":"single-spa:app-change";window.dispatchEvent(new i(r,O())),window.dispatchEvent(new i("single-spa:routing-event",O()))}catch(t){setTimeout((function(){throw t}))}if(Dt=!1,Mt.length>0){var o=Mt;Mt=[],Rt(o)}return n}function y(){t.forEach((function(t){rt(t.eventArguments)})),rt(n)}function O(){var t,o=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=arguments.length>1?arguments[1]:void 0,m={},d=(r(t={},g,[]),r(t,v,[]),r(t,p,[]),r(t,T,[]),t);o?(c.concat(s).forEach((function(t,n){E(t,g)})),u.forEach((function(t){E(t,p)})),a.forEach((function(t){E(t,v)}))):e.forEach((function(t){E(t)}));var w={detail:{newAppStatuses:m,appsByNewStatus:d,totalAppChanges:e.length,originalEvent:null==n?void 0:n[0],oldUrl:l,newUrl:h,navigationIsCanceled:f}};return i&&_(w.detail,i),w;function E(t,n){var e=A(t);n=n||Tt(e),m[e]=n,(d[n]=d[n]||[]).push(e)}}}function It(t,n){return b(t)?L(t).then((function(t){return n.then((function(){return b(t)?B(t):t}))})):n.then((function(){return t}))}var xt=!1;function Bt(t){var n;xt=!0,t&&t.urlRerouteOnly&&(n=t.urlRerouteOnly,Y=n),Z&&Rt()}function Gt(){return xt}Z&&setTimeout((function(){xt||console.warn(f(1,!1))}),5e3);var Ct={getRawAppData:function(){return[].concat(gt)},reroute:Rt,NOT_LOADED:p,toLoadPromise:X,toBootstrapPromise:L,unregisterApplication:At};Z&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=Ct)}}})); | ||
/* single-spa@5.9.5 - SystemJS - prod */ | ||
System.register([],(function(t){"use strict";return{execute:function(){t({addErrorHandler:c,checkActivityFunctions:At,ensureJQuerySupport:pt,getAppNames:Tt,getAppStatus:Pt,getMountedApps:Ot,mountRootParcel:$,navigateToUrl:rt,pathToActiveWhen:Dt,registerApplication:bt,removeErrorHandler:s,setBootstrapMaxTime:J,setMountMaxTime:Q,setUnloadMaxTime:q,setUnmountMaxTime:V,start:Bt,triggerAppChange:Rt,unloadApplication:St,unregisterApplication:Nt});var n=Object.freeze({__proto__:null,get start(){return Bt},get ensureJQuerySupport(){return pt},get setBootstrapMaxTime(){return J},get setMountMaxTime(){return Q},get setUnmountMaxTime(){return V},get setUnloadMaxTime(){return q},get registerApplication(){return bt},get unregisterApplication(){return Nt},get getMountedApps(){return Ot},get getAppStatus(){return Pt},get unloadApplication(){return St},get checkActivityFunctions(){return At},get getAppNames(){return Tt},get pathToActiveWhen(){return Dt},get navigateToUrl(){return rt},get triggerAppChange(){return Rt},get addErrorHandler(){return c},get removeErrorHandler(){return s},get mountRootParcel(){return $},get NOT_LOADED(){return p},get LOADING_SOURCE_CODE(){return h},get NOT_BOOTSTRAPPED(){return m},get BOOTSTRAPPING(){return d},get NOT_MOUNTED(){return v},get MOUNTING(){return w},get UPDATING(){return E},get LOAD_ERROR(){return T},get MOUNTED(){return g},get UNLOADING(){return O},get UNMOUNTING(){return y},get SKIP_BECAUSE_BROKEN(){return P}});function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}var o=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}).CustomEvent,i=function(){try{var t=new o("cat",{detail:{foo:"bar"}});return"cat"===t.type&&"bar"===t.detail.foo}catch(t){}return!1}()?o:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(t,n){var e=document.createEvent("CustomEvent");return n?e.initCustomEvent(t,n.bubbles,n.cancelable,n.detail):e.initCustomEvent(t,!1,!1,void 0),e}:function(t,n){var e=document.createEventObject();return e.type=t,n?(e.bubbles=Boolean(n.bubbles),e.cancelable=Boolean(n.cancelable),e.detail=n.detail):(e.bubbles=!1,e.cancelable=!1,e.detail=void 0),e},u=[];function a(t,n,e){var r=l(t,n,e);u.length?u.forEach((function(t){return t(r)})):setTimeout((function(){throw r}))}function c(t){if("function"!=typeof t)throw Error(f(28,!1));u.push(t)}function s(t){if("function"!=typeof t)throw Error(f(29,!1));var n=!1;return u=u.filter((function(e){var r=e===t;return n=n||r,!r})),n}function f(t,n){for(var e=arguments.length,r=new Array(e>2?e-2:0),o=2;o<e;o++)r[o-2]=arguments[o];return"single-spa minified message #".concat(t,": ").concat(n?n+" ":"","See https://single-spa.js.org/error/?code=").concat(t).concat(r.length?"&arg=".concat(r.join("&arg=")):"")}function l(t,n,e){var r,o="".concat(_(n)," '").concat(N(n),"' died in status ").concat(n.status,": ");if(t instanceof Error){try{t.message=o+t.message}catch(t){}r=t}else{console.warn(f(30,!1,n.status,N(n)));try{r=Error(o+JSON.stringify(t))}catch(n){r=t}}return r.appOrParcelName=N(n),n.status=e,r}var p=t("NOT_LOADED","NOT_LOADED"),h=t("LOADING_SOURCE_CODE","LOADING_SOURCE_CODE"),m=t("NOT_BOOTSTRAPPED","NOT_BOOTSTRAPPED"),d=t("BOOTSTRAPPING","BOOTSTRAPPING"),v=t("NOT_MOUNTED","NOT_MOUNTED"),w=t("MOUNTING","MOUNTING"),g=t("MOUNTED","MOUNTED"),E=t("UPDATING","UPDATING"),y=t("UNMOUNTING","UNMOUNTING"),O=t("UNLOADING","UNLOADING"),T=t("LOAD_ERROR","LOAD_ERROR"),P=t("SKIP_BECAUSE_BROKEN","SKIP_BECAUSE_BROKEN");function b(t){return t.status===g}function A(t){try{return t.activeWhen(window.location)}catch(n){return a(n,t,P),!1}}function N(t){return t.name}function S(t){return Boolean(t.unmountThisParcel)}function _(t){return S(t)?"parcel":"application"}function U(){for(var t=arguments.length-1;t>0;t--)for(var n in arguments[t])"__proto__"!==n&&(arguments[t-1][n]=arguments[t][n]);return arguments[0]}function D(t,n){for(var e=0;e<t.length;e++)if(n(t[e]))return t[e];return null}function M(t){return t&&("function"==typeof t||(n=t,Array.isArray(n)&&!D(n,(function(t){return"function"!=typeof t}))));var n}function L(t,n){var e=t[n]||[];0===(e=Array.isArray(e)?e:[e]).length&&(e=[function(){return Promise.resolve()}]);var r=_(t),o=N(t);return function(t){return e.reduce((function(e,i,u){return e.then((function(){var e=i(t);return j(e)?e:Promise.reject(f(15,!1,r,o,n,u))}))}),Promise.resolve())}}function j(t){return t&&"function"==typeof t.then&&"function"==typeof t.catch}function R(t,n){return Promise.resolve().then((function(){return t.status!==m?t:(t.status=d,t.bootstrap?z(t,"bootstrap").then(e).catch((function(e){if(n)throw l(e,t,P);return a(e,t,P),t})):Promise.resolve().then(e))}));function e(){return t.status=v,t}}function I(t,n){return Promise.resolve().then((function(){if(t.status!==g)return t;t.status=y;var e=Object.keys(t.parcels).map((function(n){return t.parcels[n].unmountThisParcel()}));return Promise.all(e).then(r,(function(e){return r().then((function(){var r=Error(e.message);if(n)throw l(r,t,P);a(r,t,P)}))})).then((function(){return t}));function r(){return z(t,"unmount").then((function(){t.status=v})).catch((function(e){if(n)throw l(e,t,P);a(e,t,P)}))}}))}var x=!1,G=!1;function B(t,n){return Promise.resolve().then((function(){return t.status!==v?t:(x||(window.dispatchEvent(new i("single-spa:before-first-mount")),x=!0),z(t,"mount").then((function(){return t.status=g,G||(window.dispatchEvent(new i("single-spa:first-mount")),G=!0),t})).catch((function(e){return t.status=g,I(t,!0).then(r,r);function r(){if(n)throw l(e,t,P);return a(e,t,P),t}})))}))}var C=0,W={parcels:{}};function $(){return k.apply(W,arguments)}function k(t,n){var r=this;if(!t||"object"!==e(t)&&"function"!=typeof t)throw Error(f(2,!1));if(t.name&&"string"!=typeof t.name)throw Error(f(3,!1,e(t.name)));if("object"!==e(n))throw Error(f(4,!1,name,e(n)));if(!n.domElement)throw Error(f(5,!1,name));var o,i=C++,u="function"==typeof t,a=u?t:function(){return Promise.resolve(t)},c={id:i,parcels:{},status:u?h:m,customProps:n,parentName:N(r),unmountThisParcel:function(){return y.then((function(){if(c.status!==g)throw Error(f(6,!1,name,c.status));return I(c,!0)})).then((function(t){return c.parentName&&delete r.parcels[c.id],t})).then((function(t){return p(t),t})).catch((function(t){throw c.status=P,d(t),t}))}};r.parcels[i]=c;var s=a();if(!s||"function"!=typeof s.then)throw Error(f(7,!1));var p,d,w=(s=s.then((function(t){if(!t)throw Error(f(8,!1));var n=t.name||"parcel-".concat(i);if(Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!M(t.bootstrap))throw Error(f(9,!1,n));if(!M(t.mount))throw Error(f(10,!1,n));if(!M(t.unmount))throw Error(f(11,!1,n));if(t.update&&!M(t.update))throw Error(f(12,!1,n));var e=L(t,"bootstrap"),r=L(t,"mount"),u=L(t,"unmount");c.status=m,c.name=n,c.bootstrap=e,c.mount=r,c.unmount=u,c.timeouts=X(t.timeouts),t.update&&(c.update=L(t,"update"),o.update=function(t){return c.customProps=t,K(function(t){return Promise.resolve().then((function(){if(t.status!==g)throw Error(f(32,!1,N(t)));return t.status=E,z(t,"update").then((function(){return t.status=g,t})).catch((function(n){throw l(n,t,P)}))}))}(c))})}))).then((function(){return R(c,!0)})),y=w.then((function(){return B(c,!0)})),O=new Promise((function(t,n){p=t,d=n}));return o={mount:function(){return K(Promise.resolve().then((function(){if(c.status!==v)throw Error(f(13,!1,name,c.status));return r.parcels[i]=c,B(c)})))},unmount:function(){return K(c.unmountThisParcel())},getStatus:function(){return c.status},loadPromise:K(s),bootstrapPromise:K(w),mountPromise:K(y),unmountPromise:K(O)}}function K(t){return t.then((function(){return null}))}function F(t){var r=N(t),o="function"==typeof t.customProps?t.customProps(r,window.location):t.customProps;("object"!==e(o)||null===o||Array.isArray(o))&&(o={},console.warn(f(40,!1),r,o));var i=U({},o,{name:r,mountParcel:k.bind(t),singleSpa:n});return S(t)&&(i.unmountSelf=t.unmountThisParcel),i}var H={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:1e3},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},update:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3}};function J(t,n,e){if("number"!=typeof t||t<=0)throw Error(f(16,!1));H.bootstrap={millis:t,dieOnTimeout:n,warningMillis:e||1e3}}function Q(t,n,e){if("number"!=typeof t||t<=0)throw Error(f(17,!1));H.mount={millis:t,dieOnTimeout:n,warningMillis:e||1e3}}function V(t,n,e){if("number"!=typeof t||t<=0)throw Error(f(18,!1));H.unmount={millis:t,dieOnTimeout:n,warningMillis:e||1e3}}function q(t,n,e){if("number"!=typeof t||t<=0)throw Error(f(19,!1));H.unload={millis:t,dieOnTimeout:n,warningMillis:e||1e3}}function z(t,n){var e=t.timeouts[n],r=e.warningMillis,o=_(t);return new Promise((function(i,u){var a=!1,c=!1;t[n](F(t)).then((function(t){a=!0,i(t)})).catch((function(t){a=!0,u(t)})),setTimeout((function(){return l(1)}),r),setTimeout((function(){return l(!0)}),e.millis);var s=f(31,!1,n,o,N(t),e.millis);function l(t){if(!a)if(!0===t)c=!0,e.dieOnTimeout?u(Error(s)):console.error(s);else if(!c){var n=t,o=n*r;console.warn(s),o+r<e.millis&&setTimeout((function(){return l(n+1)}),r)}}}))}function X(t){var n={};for(var e in H)n[e]=U({},H[e],t&&t[e]||{});return n}function Y(t){return Promise.resolve().then((function(){return t.loadPromise?t.loadPromise:t.status!==p&&t.status!==T?t:(t.status=h,t.loadPromise=Promise.resolve().then((function(){var o=t.loadApp(F(t));if(!j(o))throw r=!0,Error(f(33,!1,N(t)));return o.then((function(r){var o;t.loadErrorTime=null,"object"!==e(n=r)&&(o=34),Object.prototype.hasOwnProperty.call(n,"bootstrap")&&!M(n.bootstrap)&&(o=35),M(n.mount)||(o=36),M(n.unmount)||(o=37);var i=_(n);if(o){var u;try{u=JSON.stringify(n)}catch(t){}return console.error(f(o,!1,i,N(t),u),n),a(void 0,t,P),t}return n.devtools&&n.devtools.overlays&&(t.devtools.overlays=U({},t.devtools.overlays,n.devtools.overlays)),t.status=m,t.bootstrap=L(n,"bootstrap"),t.mount=L(n,"mount"),t.unmount=L(n,"unmount"),t.unload=L(n,"unload"),t.timeouts=X(n.timeouts),delete t.loadPromise,t}))})).catch((function(n){var e;return delete t.loadPromise,r?e=P:(e=T,t.loadErrorTime=(new Date).getTime()),a(n,t,e),t})));var n,r}))}var Z,tt="undefined"!=typeof window,nt={hashchange:[],popstate:[]},et=["hashchange","popstate"];function rt(t){var n;if("string"==typeof t)n=t;else if(this&&this.href)n=this.href;else{if(!(t&&t.currentTarget&&t.currentTarget.href&&t.preventDefault))throw Error(f(14,!1));n=t.currentTarget.href,t.preventDefault()}var e=ft(window.location.href),r=ft(n);0===n.indexOf("#")?window.location.hash=r.hash:e.host!==r.host&&r.host?window.location.href=n:r.pathname===e.pathname&&r.search===e.search?window.location.hash=r.hash:window.history.pushState(null,null,n)}function ot(t){var n=this;if(t){var e=t[0].type;et.indexOf(e)>=0&&nt[e].forEach((function(e){try{e.apply(n,t)}catch(t){setTimeout((function(){throw t}))}}))}}function it(){It([],arguments)}function ut(t,n){return function(){var e=window.location.href,r=t.apply(this,arguments),o=window.location.href;return Z&&e===o||(Ct()?window.dispatchEvent(at(window.history.state,n)):It([])),r}}function at(t,n){var e;try{e=new PopStateEvent("popstate",{state:t})}catch(n){(e=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,t)}return e.singleSpa=!0,e.singleSpaTrigger=n,e}if(tt){window.addEventListener("hashchange",it),window.addEventListener("popstate",it);var ct=window.addEventListener,st=window.removeEventListener;window.addEventListener=function(t,n){if(!("function"==typeof n&&et.indexOf(t)>=0)||D(nt[t],(function(t){return t===n})))return ct.apply(this,arguments);nt[t].push(n)},window.removeEventListener=function(t,n){if(!("function"==typeof n&&et.indexOf(t)>=0))return st.apply(this,arguments);nt[t]=nt[t].filter((function(t){return t!==n}))},window.history.pushState=ut(window.history.pushState,"pushState"),window.history.replaceState=ut(window.history.replaceState,"replaceState"),window.singleSpaNavigate?console.warn(f(41,!1)):window.singleSpaNavigate=rt}function ft(t){var n=document.createElement("a");return n.href=t,n}var lt=!1;function pt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!lt){var n=t.fn.on,e=t.fn.off;t.fn.on=function(t,e){return ht.call(this,n,window.addEventListener,t,e,arguments)},t.fn.off=function(t,n){return ht.call(this,e,window.removeEventListener,t,n,arguments)},lt=!0}}function ht(t,n,e,r,o){return"string"!=typeof e?t.apply(this,o):(e.split(/\s+/).forEach((function(t){et.indexOf(t)>=0&&(n(t,r),e=e.replace(t,""))})),""===e.trim()?this:t.apply(this,o))}var mt={};function dt(t){return Promise.resolve().then((function(){var n=mt[N(t)];if(!n)return t;if(t.status===p)return vt(t,n),t;if(t.status===O)return n.promise.then((function(){return t}));if(t.status!==v&&t.status!==T)return t;var e=t.status===T?Promise.resolve():z(t,"unload");return t.status=O,e.then((function(){return vt(t,n),t})).catch((function(e){return function(t,n,e){delete mt[N(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,a(e,t,P),n.reject(e)}(t,n,e),t}))}))}function vt(t,n){delete mt[N(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=p,n.resolve()}function wt(t,n,e,r){mt[N(t)]={app:t,resolve:e,reject:r},Object.defineProperty(mt[N(t)],"promise",{get:n})}function gt(t){return mt[t]}var Et=[];function yt(){var t=[],n=[],e=[],r=[],o=(new Date).getTime();return Et.forEach((function(i){var u=i.status!==P&&A(i);switch(i.status){case T:u&&o-i.loadErrorTime>=200&&e.push(i);break;case p:case h:u&&e.push(i);break;case m:case v:!u&>(N(i))?t.push(i):u&&r.push(i);break;case g:u||n.push(i)}})),{appsToUnload:t,appsToUnmount:n,appsToLoad:e,appsToMount:r}}function Ot(){return Et.filter(b).map(N)}function Tt(){return Et.map(N)}function Pt(t){var n=D(Et,(function(n){return N(n)===t}));return n?n.status:null}function bt(t,n,r,o){var i=function(t,n,r,o){var i,u={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"===e(t)?(function(t){if(Array.isArray(t)||null===t)throw Error(f(39,!1));var n=["name","app","activeWhen","customProps"],r=Object.keys(t).reduce((function(t,e){return n.indexOf(e)>=0?t:t.concat(e)}),[]);if(0!==r.length)throw Error(f(38,!1,n.join(", "),r.join(", ")));if("string"!=typeof t.name||0===t.name.length)throw Error(f(20,!1));if("object"!==e(t.app)&&"function"!=typeof t.app)throw Error(f(20,!1));var o=function(t){return"string"==typeof t||"function"==typeof t};if(!(o(t.activeWhen)||Array.isArray(t.activeWhen)&&t.activeWhen.every(o)))throw Error(f(24,!1));if(!Ut(t.customProps))throw Error(f(22,!1))}(t),u.name=t.name,u.loadApp=t.app,u.activeWhen=t.activeWhen,u.customProps=t.customProps):(function(t,n,e,r){if("string"!=typeof t||0===t.length)throw Error(f(20,!1));if(!n)throw Error(f(23,!1));if("function"!=typeof e)throw Error(f(24,!1));if(!Ut(r))throw Error(f(22,!1))}(t,n,r,o),u.name=t,u.loadApp=n,u.activeWhen=r,u.customProps=o),u.loadApp="function"!=typeof(i=u.loadApp)?function(){return Promise.resolve(i)}:i,u.customProps=function(t){return t||{}}(u.customProps),u.activeWhen=function(t){var n=Array.isArray(t)?t:[t];return n=n.map((function(t){return"function"==typeof t?t:Dt(t)})),function(t){return n.some((function(n){return n(t)}))}}(u.activeWhen),u}(t,n,r,o);if(-1!==Tt().indexOf(i.name))throw Error(f(21,!1,i.name));Et.push(U({loadErrorTime:null,status:p,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},i)),tt&&(pt(),It())}function At(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location;return Et.filter((function(n){return n.activeWhen(t)})).map(N)}function Nt(t){if(0===Et.filter((function(n){return N(n)===t})).length)throw Error(f(25,!1,t));return St(t).then((function(){var n=Et.map(N).indexOf(t);Et.splice(n,1)}))}function St(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof t)throw Error(f(26,!1));var e=D(Et,(function(n){return N(n)===t}));if(!e)throw Error(f(27,!1,t));var r,o=gt(N(e));if(n&&n.waitForUnmount){if(o)return o.promise;var i=new Promise((function(t,n){wt(e,(function(){return i}),t,n)}));return i}return o?(r=o.promise,_t(e,o.resolve,o.reject)):r=new Promise((function(t,n){wt(e,(function(){return r}),t,n),_t(e,t,n)})),r}function _t(t,n,e){I(t).then(dt).then((function(){n(),setTimeout((function(){It()}))})).catch(e)}function Ut(t){return!t||"function"==typeof t||"object"===e(t)&&null!==t&&!Array.isArray(t)}function Dt(t,n){var e=function(t,n){var e=0,r=!1,o="^";"/"!==t[0]&&(t="/"+t);for(var i=0;i<t.length;i++){var u=t[i];(!r&&":"===u||r&&"/"===u)&&a(i)}return a(t.length),new RegExp(o,"i");function a(i){var u=t.slice(e,i).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(o+=r?"[^/]+/?":u,i===t.length)if(r)n&&(o+="$");else{var a=n?"":".*";o="/"===o.charAt(o.length-1)?"".concat(o).concat(a,"$"):"".concat(o,"(/").concat(a,")?(#.*)?$")}r=!r,e=i}}(t,n);return function(t){var n=t.origin;n||(n="".concat(t.protocol,"//").concat(t.host));var r=t.href.replace(n,"").replace(t.search,"").split("?")[0];return e.test(r)}}var Mt=!1,Lt=[],jt=tt&&window.location.href;function Rt(){return It()}function It(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;if(Mt)return new Promise((function(t,e){Lt.push({resolve:t,reject:e,eventArguments:n})}));var e,o=yt(),u=o.appsToUnload,a=o.appsToUnmount,c=o.appsToLoad,s=o.appsToMount,f=!1,l=jt,h=jt=window.location.href;return Ct()?(Mt=!0,e=u.concat(c,a,s),w()):(e=c,d());function m(){f=!0}function d(){return Promise.resolve().then((function(){var t=c.map(Y);return Promise.all(t).then(y).then((function(){return[]})).catch((function(t){throw y(),t}))}))}function w(){return Promise.resolve().then((function(){if(window.dispatchEvent(new i(0===e.length?"single-spa:before-no-app-change":"single-spa:before-app-change",O(!0))),window.dispatchEvent(new i("single-spa:before-routing-event",O(!0,{cancelNavigation:m}))),f)return window.dispatchEvent(new i("single-spa:before-mount-routing-event",O(!0))),E(),void rt(l);var n=u.map(dt),r=a.map(I).map((function(t){return t.then(dt)})).concat(n),o=Promise.all(r);o.then((function(){window.dispatchEvent(new i("single-spa:before-mount-routing-event",O(!0)))}));var p=c.map((function(t){return Y(t).then((function(t){return xt(t,o)}))})),h=s.filter((function(t){return c.indexOf(t)<0})).map((function(t){return xt(t,o)}));return o.catch((function(t){throw y(),t})).then((function(){return y(),Promise.all(p.concat(h)).catch((function(n){throw t.forEach((function(t){return t.reject(n)})),n})).then(E)}))}))}function E(){var n=Ot();t.forEach((function(t){return t.resolve(n)}));try{var r=0===e.length?"single-spa:no-app-change":"single-spa:app-change";window.dispatchEvent(new i(r,O())),window.dispatchEvent(new i("single-spa:routing-event",O()))}catch(t){setTimeout((function(){throw t}))}if(Mt=!1,Lt.length>0){var o=Lt;Lt=[],It(o)}return n}function y(){t.forEach((function(t){ot(t.eventArguments)})),ot(n)}function O(){var t,o=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=arguments.length>1?arguments[1]:void 0,m={},d=(r(t={},g,[]),r(t,v,[]),r(t,p,[]),r(t,P,[]),t);o?(c.concat(s).forEach((function(t,n){E(t,g)})),u.forEach((function(t){E(t,p)})),a.forEach((function(t){E(t,v)}))):e.forEach((function(t){E(t)}));var w={detail:{newAppStatuses:m,appsByNewStatus:d,totalAppChanges:e.length,originalEvent:null==n?void 0:n[0],oldUrl:l,newUrl:h,navigationIsCanceled:f}};return i&&U(w.detail,i),w;function E(t,n){var e=N(t);n=n||Pt(e),m[e]=n,(d[n]=d[n]||[]).push(e)}}}function xt(t,n){return A(t)?R(t).then((function(t){return n.then((function(){return A(t)?B(t):t}))})):n.then((function(){return t}))}var Gt=!1;function Bt(t){var n;Gt=!0,t&&t.urlRerouteOnly&&(n=t.urlRerouteOnly,Z=n),tt&&It()}function Ct(){return Gt}tt&&setTimeout((function(){Gt||console.warn(f(1,!1))}),5e3);var Wt={getRawAppData:function(){return[].concat(Et)},reroute:It,NOT_LOADED:p,toLoadPromise:Y,toBootstrapPromise:R,unregisterApplication:Nt};tt&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=Wt)}}})); | ||
//# sourceMappingURL=single-spa.min.js.map |
@@ -1,2 +0,2 @@ | ||
/* single-spa@5.9.4 - UMD - dev */ | ||
/* single-spa@5.9.5 - UMD - dev */ | ||
(function (global, factory) { | ||
@@ -38,2 +38,3 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
get MOUNTED () { return MOUNTED; }, | ||
get UNLOADING () { return UNLOADING; }, | ||
get UNMOUNTING () { return UNMOUNTING; }, | ||
@@ -1760,2 +1761,3 @@ get SKIP_BECAUSE_BROKEN () { return SKIP_BECAUSE_BROKEN; } | ||
exports.SKIP_BECAUSE_BROKEN = SKIP_BECAUSE_BROKEN; | ||
exports.UNLOADING = UNLOADING; | ||
exports.UNMOUNTING = UNMOUNTING; | ||
@@ -1762,0 +1764,0 @@ exports.UPDATING = UPDATING; |
@@ -1,3 +0,3 @@ | ||
/* single-spa@5.9.4 - UMD - prod */ | ||
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t=t||self).singleSpa={})}(this,(function(t){"use strict";var n=Object.freeze({__proto__:null,get start(){return Bt},get ensureJQuerySupport(){return lt},get setBootstrapMaxTime(){return H},get setMountMaxTime(){return J},get setUnmountMaxTime(){return Q},get setUnloadMaxTime(){return V},get registerApplication(){return Pt},get unregisterApplication(){return At},get getMountedApps(){return yt},get getAppStatus(){return Tt},get unloadApplication(){return Nt},get checkActivityFunctions(){return bt},get getAppNames(){return Ot},get pathToActiveWhen(){return Ut},get navigateToUrl(){return et},get triggerAppChange(){return Lt},get addErrorHandler(){return c},get removeErrorHandler(){return s},get mountRootParcel(){return W},get NOT_LOADED(){return p},get LOADING_SOURCE_CODE(){return h},get NOT_BOOTSTRAPPED(){return m},get BOOTSTRAPPING(){return d},get NOT_MOUNTED(){return v},get MOUNTING(){return w},get UPDATING(){return E},get LOAD_ERROR(){return O},get MOUNTED(){return g},get UNMOUNTING(){return y},get SKIP_BECAUSE_BROKEN(){return T}});function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}var o=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}).CustomEvent,i=function(){try{var t=new o("cat",{detail:{foo:"bar"}});return"cat"===t.type&&"bar"===t.detail.foo}catch(t){}return!1}()?o:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(t,n){var e=document.createEvent("CustomEvent");return n?e.initCustomEvent(t,n.bubbles,n.cancelable,n.detail):e.initCustomEvent(t,!1,!1,void 0),e}:function(t,n){var e=document.createEventObject();return e.type=t,n?(e.bubbles=Boolean(n.bubbles),e.cancelable=Boolean(n.cancelable),e.detail=n.detail):(e.bubbles=!1,e.cancelable=!1,e.detail=void 0),e},u=[];function a(t,n,e){var r=l(t,n,e);u.length?u.forEach((function(t){return t(r)})):setTimeout((function(){throw r}))}function c(t){if("function"!=typeof t)throw Error(f(28,!1));u.push(t)}function s(t){if("function"!=typeof t)throw Error(f(29,!1));var n=!1;return u=u.filter((function(e){var r=e===t;return n=n||r,!r})),n}function f(t,n){for(var e=arguments.length,r=new Array(e>2?e-2:0),o=2;o<e;o++)r[o-2]=arguments[o];return"single-spa minified message #".concat(t,": ").concat(n?n+" ":"","See https://single-spa.js.org/error/?code=").concat(t).concat(r.length?"&arg=".concat(r.join("&arg=")):"")}function l(t,n,e){var r,o="".concat(S(n)," '").concat(A(n),"' died in status ").concat(n.status,": ");if(t instanceof Error){try{t.message=o+t.message}catch(t){}r=t}else{console.warn(f(30,!1,n.status,A(n)));try{r=Error(o+JSON.stringify(t))}catch(n){r=t}}return r.appOrParcelName=A(n),n.status=e,r}var p="NOT_LOADED",h="LOADING_SOURCE_CODE",m="NOT_BOOTSTRAPPED",d="BOOTSTRAPPING",v="NOT_MOUNTED",w="MOUNTING",g="MOUNTED",E="UPDATING",y="UNMOUNTING",O="LOAD_ERROR",T="SKIP_BECAUSE_BROKEN";function P(t){return t.status===g}function b(t){try{return t.activeWhen(window.location)}catch(n){return a(n,t,T),!1}}function A(t){return t.name}function N(t){return Boolean(t.unmountThisParcel)}function S(t){return N(t)?"parcel":"application"}function _(){for(var t=arguments.length-1;t>0;t--)for(var n in arguments[t])"__proto__"!==n&&(arguments[t-1][n]=arguments[t][n]);return arguments[0]}function U(t,n){for(var e=0;e<t.length;e++)if(n(t[e]))return t[e];return null}function D(t){return t&&("function"==typeof t||(n=t,Array.isArray(n)&&!U(n,(function(t){return"function"!=typeof t}))));var n}function M(t,n){var e=t[n]||[];0===(e=Array.isArray(e)?e:[e]).length&&(e=[function(){return Promise.resolve()}]);var r=S(t),o=A(t);return function(t){return e.reduce((function(e,i,u){return e.then((function(){var e=i(t);return j(e)?e:Promise.reject(f(15,!1,r,o,n,u))}))}),Promise.resolve())}}function j(t){return t&&"function"==typeof t.then&&"function"==typeof t.catch}function L(t,n){return Promise.resolve().then((function(){return t.status!==m?t:(t.status=d,t.bootstrap?q(t,"bootstrap").then(e).catch((function(e){if(n)throw l(e,t,T);return a(e,t,T),t})):Promise.resolve().then(e))}));function e(){return t.status=v,t}}function R(t,n){return Promise.resolve().then((function(){if(t.status!==g)return t;t.status=y;var e=Object.keys(t.parcels).map((function(n){return t.parcels[n].unmountThisParcel()}));return Promise.all(e).then(r,(function(e){return r().then((function(){var r=Error(e.message);if(n)throw l(r,t,T);a(r,t,T)}))})).then((function(){return t}));function r(){return q(t,"unmount").then((function(){t.status=v})).catch((function(e){if(n)throw l(e,t,T);a(e,t,T)}))}}))}var I=!1,x=!1;function B(t,n){return Promise.resolve().then((function(){return t.status!==v?t:(I||(window.dispatchEvent(new i("single-spa:before-first-mount")),I=!0),q(t,"mount").then((function(){return t.status=g,x||(window.dispatchEvent(new i("single-spa:first-mount")),x=!0),t})).catch((function(e){return t.status=g,R(t,!0).then(r,r);function r(){if(n)throw l(e,t,T);return a(e,t,T),t}})))}))}var G=0,C={parcels:{}};function W(){return $.apply(C,arguments)}function $(t,n){var r=this;if(!t||"object"!==e(t)&&"function"!=typeof t)throw Error(f(2,!1));if(t.name&&"string"!=typeof t.name)throw Error(f(3,!1,e(t.name)));if("object"!==e(n))throw Error(f(4,!1,name,e(n)));if(!n.domElement)throw Error(f(5,!1,name));var o,i=G++,u="function"==typeof t,a=u?t:function(){return Promise.resolve(t)},c={id:i,parcels:{},status:u?h:m,customProps:n,parentName:A(r),unmountThisParcel:function(){return y.then((function(){if(c.status!==g)throw Error(f(6,!1,name,c.status));return R(c,!0)})).then((function(t){return c.parentName&&delete r.parcels[c.id],t})).then((function(t){return p(t),t})).catch((function(t){throw c.status=T,d(t),t}))}};r.parcels[i]=c;var s=a();if(!s||"function"!=typeof s.then)throw Error(f(7,!1));var p,d,w=(s=s.then((function(t){if(!t)throw Error(f(8,!1));var n=t.name||"parcel-".concat(i);if(Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!D(t.bootstrap))throw Error(f(9,!1,n));if(!D(t.mount))throw Error(f(10,!1,n));if(!D(t.unmount))throw Error(f(11,!1,n));if(t.update&&!D(t.update))throw Error(f(12,!1,n));var e=M(t,"bootstrap"),r=M(t,"mount"),u=M(t,"unmount");c.status=m,c.name=n,c.bootstrap=e,c.mount=r,c.unmount=u,c.timeouts=z(t.timeouts),t.update&&(c.update=M(t,"update"),o.update=function(t){return c.customProps=t,k(function(t){return Promise.resolve().then((function(){if(t.status!==g)throw Error(f(32,!1,A(t)));return t.status=E,q(t,"update").then((function(){return t.status=g,t})).catch((function(n){throw l(n,t,T)}))}))}(c))})}))).then((function(){return L(c,!0)})),y=w.then((function(){return B(c,!0)})),O=new Promise((function(t,n){p=t,d=n}));return o={mount:function(){return k(Promise.resolve().then((function(){if(c.status!==v)throw Error(f(13,!1,name,c.status));return r.parcels[i]=c,B(c)})))},unmount:function(){return k(c.unmountThisParcel())},getStatus:function(){return c.status},loadPromise:k(s),bootstrapPromise:k(w),mountPromise:k(y),unmountPromise:k(O)}}function k(t){return t.then((function(){return null}))}function K(t){var r=A(t),o="function"==typeof t.customProps?t.customProps(r,window.location):t.customProps;("object"!==e(o)||null===o||Array.isArray(o))&&(o={},console.warn(f(40,!1),r,o));var i=_({},o,{name:r,mountParcel:$.bind(t),singleSpa:n});return N(t)&&(i.unmountSelf=t.unmountThisParcel),i}var F={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:1e3},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},update:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3}};function H(t,n,e){if("number"!=typeof t||t<=0)throw Error(f(16,!1));F.bootstrap={millis:t,dieOnTimeout:n,warningMillis:e||1e3}}function J(t,n,e){if("number"!=typeof t||t<=0)throw Error(f(17,!1));F.mount={millis:t,dieOnTimeout:n,warningMillis:e||1e3}}function Q(t,n,e){if("number"!=typeof t||t<=0)throw Error(f(18,!1));F.unmount={millis:t,dieOnTimeout:n,warningMillis:e||1e3}}function V(t,n,e){if("number"!=typeof t||t<=0)throw Error(f(19,!1));F.unload={millis:t,dieOnTimeout:n,warningMillis:e||1e3}}function q(t,n){var e=t.timeouts[n],r=e.warningMillis,o=S(t);return new Promise((function(i,u){var a=!1,c=!1;t[n](K(t)).then((function(t){a=!0,i(t)})).catch((function(t){a=!0,u(t)})),setTimeout((function(){return l(1)}),r),setTimeout((function(){return l(!0)}),e.millis);var s=f(31,!1,n,o,A(t),e.millis);function l(t){if(!a)if(!0===t)c=!0,e.dieOnTimeout?u(Error(s)):console.error(s);else if(!c){var n=t,o=n*r;console.warn(s),o+r<e.millis&&setTimeout((function(){return l(n+1)}),r)}}}))}function z(t){var n={};for(var e in F)n[e]=_({},F[e],t&&t[e]||{});return n}function X(t){return Promise.resolve().then((function(){return t.loadPromise?t.loadPromise:t.status!==p&&t.status!==O?t:(t.status=h,t.loadPromise=Promise.resolve().then((function(){var o=t.loadApp(K(t));if(!j(o))throw r=!0,Error(f(33,!1,A(t)));return o.then((function(r){var o;t.loadErrorTime=null,"object"!==e(n=r)&&(o=34),Object.prototype.hasOwnProperty.call(n,"bootstrap")&&!D(n.bootstrap)&&(o=35),D(n.mount)||(o=36),D(n.unmount)||(o=37);var i=S(n);if(o){var u;try{u=JSON.stringify(n)}catch(t){}return console.error(f(o,!1,i,A(t),u),n),a(void 0,t,T),t}return n.devtools&&n.devtools.overlays&&(t.devtools.overlays=_({},t.devtools.overlays,n.devtools.overlays)),t.status=m,t.bootstrap=M(n,"bootstrap"),t.mount=M(n,"mount"),t.unmount=M(n,"unmount"),t.unload=M(n,"unload"),t.timeouts=z(n.timeouts),delete t.loadPromise,t}))})).catch((function(n){var e;return delete t.loadPromise,r?e=T:(e=O,t.loadErrorTime=(new Date).getTime()),a(n,t,e),t})));var n,r}))}var Y,Z="undefined"!=typeof window,tt={hashchange:[],popstate:[]},nt=["hashchange","popstate"];function et(t){var n;if("string"==typeof t)n=t;else if(this&&this.href)n=this.href;else{if(!(t&&t.currentTarget&&t.currentTarget.href&&t.preventDefault))throw Error(f(14,!1));n=t.currentTarget.href,t.preventDefault()}var e=st(window.location.href),r=st(n);0===n.indexOf("#")?window.location.hash=r.hash:e.host!==r.host&&r.host?window.location.href=n:r.pathname===e.pathname&&r.search===e.search?window.location.hash=r.hash:window.history.pushState(null,null,n)}function rt(t){var n=this;if(t){var e=t[0].type;nt.indexOf(e)>=0&&tt[e].forEach((function(e){try{e.apply(n,t)}catch(t){setTimeout((function(){throw t}))}}))}}function ot(){Rt([],arguments)}function it(t,n){return function(){var e=window.location.href,r=t.apply(this,arguments),o=window.location.href;return Y&&e===o||(Gt()?window.dispatchEvent(ut(window.history.state,n)):Rt([])),r}}function ut(t,n){var e;try{e=new PopStateEvent("popstate",{state:t})}catch(n){(e=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,t)}return e.singleSpa=!0,e.singleSpaTrigger=n,e}if(Z){window.addEventListener("hashchange",ot),window.addEventListener("popstate",ot);var at=window.addEventListener,ct=window.removeEventListener;window.addEventListener=function(t,n){if(!("function"==typeof n&&nt.indexOf(t)>=0)||U(tt[t],(function(t){return t===n})))return at.apply(this,arguments);tt[t].push(n)},window.removeEventListener=function(t,n){if(!("function"==typeof n&&nt.indexOf(t)>=0))return ct.apply(this,arguments);tt[t]=tt[t].filter((function(t){return t!==n}))},window.history.pushState=it(window.history.pushState,"pushState"),window.history.replaceState=it(window.history.replaceState,"replaceState"),window.singleSpaNavigate?console.warn(f(41,!1)):window.singleSpaNavigate=et}function st(t){var n=document.createElement("a");return n.href=t,n}var ft=!1;function lt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!ft){var n=t.fn.on,e=t.fn.off;t.fn.on=function(t,e){return pt.call(this,n,window.addEventListener,t,e,arguments)},t.fn.off=function(t,n){return pt.call(this,e,window.removeEventListener,t,n,arguments)},ft=!0}}function pt(t,n,e,r,o){return"string"!=typeof e?t.apply(this,o):(e.split(/\s+/).forEach((function(t){nt.indexOf(t)>=0&&(n(t,r),e=e.replace(t,""))})),""===e.trim()?this:t.apply(this,o))}var ht={};function mt(t){return Promise.resolve().then((function(){var n=ht[A(t)];if(!n)return t;if(t.status===p)return dt(t,n),t;if("UNLOADING"===t.status)return n.promise.then((function(){return t}));if(t.status!==v&&t.status!==O)return t;var e=t.status===O?Promise.resolve():q(t,"unload");return t.status="UNLOADING",e.then((function(){return dt(t,n),t})).catch((function(e){return function(t,n,e){delete ht[A(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,a(e,t,T),n.reject(e)}(t,n,e),t}))}))}function dt(t,n){delete ht[A(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=p,n.resolve()}function vt(t,n,e,r){ht[A(t)]={app:t,resolve:e,reject:r},Object.defineProperty(ht[A(t)],"promise",{get:n})}function wt(t){return ht[t]}var gt=[];function Et(){var t=[],n=[],e=[],r=[],o=(new Date).getTime();return gt.forEach((function(i){var u=i.status!==T&&b(i);switch(i.status){case O:u&&o-i.loadErrorTime>=200&&e.push(i);break;case p:case h:u&&e.push(i);break;case m:case v:!u&&wt(A(i))?t.push(i):u&&r.push(i);break;case g:u||n.push(i)}})),{appsToUnload:t,appsToUnmount:n,appsToLoad:e,appsToMount:r}}function yt(){return gt.filter(P).map(A)}function Ot(){return gt.map(A)}function Tt(t){var n=U(gt,(function(n){return A(n)===t}));return n?n.status:null}function Pt(t,n,r,o){var i=function(t,n,r,o){var i,u={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"===e(t)?(function(t){if(Array.isArray(t)||null===t)throw Error(f(39,!1));var n=["name","app","activeWhen","customProps"],r=Object.keys(t).reduce((function(t,e){return n.indexOf(e)>=0?t:t.concat(e)}),[]);if(0!==r.length)throw Error(f(38,!1,n.join(", "),r.join(", ")));if("string"!=typeof t.name||0===t.name.length)throw Error(f(20,!1));if("object"!==e(t.app)&&"function"!=typeof t.app)throw Error(f(20,!1));var o=function(t){return"string"==typeof t||"function"==typeof t};if(!(o(t.activeWhen)||Array.isArray(t.activeWhen)&&t.activeWhen.every(o)))throw Error(f(24,!1));if(!_t(t.customProps))throw Error(f(22,!1))}(t),u.name=t.name,u.loadApp=t.app,u.activeWhen=t.activeWhen,u.customProps=t.customProps):(function(t,n,e,r){if("string"!=typeof t||0===t.length)throw Error(f(20,!1));if(!n)throw Error(f(23,!1));if("function"!=typeof e)throw Error(f(24,!1));if(!_t(r))throw Error(f(22,!1))}(t,n,r,o),u.name=t,u.loadApp=n,u.activeWhen=r,u.customProps=o),u.loadApp="function"!=typeof(i=u.loadApp)?function(){return Promise.resolve(i)}:i,u.customProps=function(t){return t||{}}(u.customProps),u.activeWhen=function(t){var n=Array.isArray(t)?t:[t];return n=n.map((function(t){return"function"==typeof t?t:Ut(t)})),function(t){return n.some((function(n){return n(t)}))}}(u.activeWhen),u}(t,n,r,o);if(-1!==Ot().indexOf(i.name))throw Error(f(21,!1,i.name));gt.push(_({loadErrorTime:null,status:p,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},i)),Z&&(lt(),Rt())}function bt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location;return gt.filter((function(n){return n.activeWhen(t)})).map(A)}function At(t){if(0===gt.filter((function(n){return A(n)===t})).length)throw Error(f(25,!1,t));return Nt(t).then((function(){var n=gt.map(A).indexOf(t);gt.splice(n,1)}))}function Nt(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof t)throw Error(f(26,!1));var e=U(gt,(function(n){return A(n)===t}));if(!e)throw Error(f(27,!1,t));var r,o=wt(A(e));if(n&&n.waitForUnmount){if(o)return o.promise;var i=new Promise((function(t,n){vt(e,(function(){return i}),t,n)}));return i}return o?(r=o.promise,St(e,o.resolve,o.reject)):r=new Promise((function(t,n){vt(e,(function(){return r}),t,n),St(e,t,n)})),r}function St(t,n,e){R(t).then(mt).then((function(){n(),setTimeout((function(){Rt()}))})).catch(e)}function _t(t){return!t||"function"==typeof t||"object"===e(t)&&null!==t&&!Array.isArray(t)}function Ut(t,n){var e=function(t,n){var e=0,r=!1,o="^";"/"!==t[0]&&(t="/"+t);for(var i=0;i<t.length;i++){var u=t[i];(!r&&":"===u||r&&"/"===u)&&a(i)}return a(t.length),new RegExp(o,"i");function a(i){var u=t.slice(e,i).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(o+=r?"[^/]+/?":u,i===t.length)if(r)n&&(o+="$");else{var a=n?"":".*";o="/"===o.charAt(o.length-1)?"".concat(o).concat(a,"$"):"".concat(o,"(/").concat(a,")?(#.*)?$")}r=!r,e=i}}(t,n);return function(t){var n=t.origin;n||(n="".concat(t.protocol,"//").concat(t.host));var r=t.href.replace(n,"").replace(t.search,"").split("?")[0];return e.test(r)}}var Dt=!1,Mt=[],jt=Z&&window.location.href;function Lt(){return Rt()}function Rt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;if(Dt)return new Promise((function(t,e){Mt.push({resolve:t,reject:e,eventArguments:n})}));var e,o=Et(),u=o.appsToUnload,a=o.appsToUnmount,c=o.appsToLoad,s=o.appsToMount,f=!1,l=jt,h=jt=window.location.href;return Gt()?(Dt=!0,e=u.concat(c,a,s),w()):(e=c,d());function m(){f=!0}function d(){return Promise.resolve().then((function(){var t=c.map(X);return Promise.all(t).then(y).then((function(){return[]})).catch((function(t){throw y(),t}))}))}function w(){return Promise.resolve().then((function(){if(window.dispatchEvent(new i(0===e.length?"single-spa:before-no-app-change":"single-spa:before-app-change",O(!0))),window.dispatchEvent(new i("single-spa:before-routing-event",O(!0,{cancelNavigation:m}))),f)return window.dispatchEvent(new i("single-spa:before-mount-routing-event",O(!0))),E(),void et(l);var n=u.map(mt),r=a.map(R).map((function(t){return t.then(mt)})).concat(n),o=Promise.all(r);o.then((function(){window.dispatchEvent(new i("single-spa:before-mount-routing-event",O(!0)))}));var p=c.map((function(t){return X(t).then((function(t){return It(t,o)}))})),h=s.filter((function(t){return c.indexOf(t)<0})).map((function(t){return It(t,o)}));return o.catch((function(t){throw y(),t})).then((function(){return y(),Promise.all(p.concat(h)).catch((function(n){throw t.forEach((function(t){return t.reject(n)})),n})).then(E)}))}))}function E(){var n=yt();t.forEach((function(t){return t.resolve(n)}));try{var r=0===e.length?"single-spa:no-app-change":"single-spa:app-change";window.dispatchEvent(new i(r,O())),window.dispatchEvent(new i("single-spa:routing-event",O()))}catch(t){setTimeout((function(){throw t}))}if(Dt=!1,Mt.length>0){var o=Mt;Mt=[],Rt(o)}return n}function y(){t.forEach((function(t){rt(t.eventArguments)})),rt(n)}function O(){var t,o=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=arguments.length>1?arguments[1]:void 0,m={},d=(r(t={},g,[]),r(t,v,[]),r(t,p,[]),r(t,T,[]),t);o?(c.concat(s).forEach((function(t,n){E(t,g)})),u.forEach((function(t){E(t,p)})),a.forEach((function(t){E(t,v)}))):e.forEach((function(t){E(t)}));var w={detail:{newAppStatuses:m,appsByNewStatus:d,totalAppChanges:e.length,originalEvent:null==n?void 0:n[0],oldUrl:l,newUrl:h,navigationIsCanceled:f}};return i&&_(w.detail,i),w;function E(t,n){var e=A(t);n=n||Tt(e),m[e]=n,(d[n]=d[n]||[]).push(e)}}}function It(t,n){return b(t)?L(t).then((function(t){return n.then((function(){return b(t)?B(t):t}))})):n.then((function(){return t}))}var xt=!1;function Bt(t){var n;xt=!0,t&&t.urlRerouteOnly&&(n=t.urlRerouteOnly,Y=n),Z&&Rt()}function Gt(){return xt}Z&&setTimeout((function(){xt||console.warn(f(1,!1))}),5e3);var Ct={getRawAppData:function(){return[].concat(gt)},reroute:Rt,NOT_LOADED:p,toLoadPromise:X,toBootstrapPromise:L,unregisterApplication:At};Z&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=Ct),t.BOOTSTRAPPING=d,t.LOADING_SOURCE_CODE=h,t.LOAD_ERROR=O,t.MOUNTED=g,t.MOUNTING=w,t.NOT_BOOTSTRAPPED=m,t.NOT_LOADED=p,t.NOT_MOUNTED=v,t.SKIP_BECAUSE_BROKEN=T,t.UNMOUNTING=y,t.UPDATING=E,t.addErrorHandler=c,t.checkActivityFunctions=bt,t.ensureJQuerySupport=lt,t.getAppNames=Ot,t.getAppStatus=Tt,t.getMountedApps=yt,t.mountRootParcel=W,t.navigateToUrl=et,t.pathToActiveWhen=Ut,t.registerApplication=Pt,t.removeErrorHandler=s,t.setBootstrapMaxTime=H,t.setMountMaxTime=J,t.setUnloadMaxTime=V,t.setUnmountMaxTime=Q,t.start=Bt,t.triggerAppChange=Lt,t.unloadApplication=Nt,t.unregisterApplication=At,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
/* single-spa@5.9.5 - UMD - prod */ | ||
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t=t||self).singleSpa={})}(this,(function(t){"use strict";var n=Object.freeze({__proto__:null,get start(){return Bt},get ensureJQuerySupport(){return pt},get setBootstrapMaxTime(){return J},get setMountMaxTime(){return Q},get setUnmountMaxTime(){return V},get setUnloadMaxTime(){return q},get registerApplication(){return bt},get unregisterApplication(){return Nt},get getMountedApps(){return Ot},get getAppStatus(){return Pt},get unloadApplication(){return St},get checkActivityFunctions(){return At},get getAppNames(){return Tt},get pathToActiveWhen(){return Dt},get navigateToUrl(){return rt},get triggerAppChange(){return Rt},get addErrorHandler(){return c},get removeErrorHandler(){return s},get mountRootParcel(){return $},get NOT_LOADED(){return p},get LOADING_SOURCE_CODE(){return h},get NOT_BOOTSTRAPPED(){return m},get BOOTSTRAPPING(){return d},get NOT_MOUNTED(){return v},get MOUNTING(){return w},get UPDATING(){return E},get LOAD_ERROR(){return T},get MOUNTED(){return g},get UNLOADING(){return O},get UNMOUNTING(){return y},get SKIP_BECAUSE_BROKEN(){return P}});function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}var o=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}).CustomEvent,i=function(){try{var t=new o("cat",{detail:{foo:"bar"}});return"cat"===t.type&&"bar"===t.detail.foo}catch(t){}return!1}()?o:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(t,n){var e=document.createEvent("CustomEvent");return n?e.initCustomEvent(t,n.bubbles,n.cancelable,n.detail):e.initCustomEvent(t,!1,!1,void 0),e}:function(t,n){var e=document.createEventObject();return e.type=t,n?(e.bubbles=Boolean(n.bubbles),e.cancelable=Boolean(n.cancelable),e.detail=n.detail):(e.bubbles=!1,e.cancelable=!1,e.detail=void 0),e},u=[];function a(t,n,e){var r=l(t,n,e);u.length?u.forEach((function(t){return t(r)})):setTimeout((function(){throw r}))}function c(t){if("function"!=typeof t)throw Error(f(28,!1));u.push(t)}function s(t){if("function"!=typeof t)throw Error(f(29,!1));var n=!1;return u=u.filter((function(e){var r=e===t;return n=n||r,!r})),n}function f(t,n){for(var e=arguments.length,r=new Array(e>2?e-2:0),o=2;o<e;o++)r[o-2]=arguments[o];return"single-spa minified message #".concat(t,": ").concat(n?n+" ":"","See https://single-spa.js.org/error/?code=").concat(t).concat(r.length?"&arg=".concat(r.join("&arg=")):"")}function l(t,n,e){var r,o="".concat(_(n)," '").concat(N(n),"' died in status ").concat(n.status,": ");if(t instanceof Error){try{t.message=o+t.message}catch(t){}r=t}else{console.warn(f(30,!1,n.status,N(n)));try{r=Error(o+JSON.stringify(t))}catch(n){r=t}}return r.appOrParcelName=N(n),n.status=e,r}var p="NOT_LOADED",h="LOADING_SOURCE_CODE",m="NOT_BOOTSTRAPPED",d="BOOTSTRAPPING",v="NOT_MOUNTED",w="MOUNTING",g="MOUNTED",E="UPDATING",y="UNMOUNTING",O="UNLOADING",T="LOAD_ERROR",P="SKIP_BECAUSE_BROKEN";function b(t){return t.status===g}function A(t){try{return t.activeWhen(window.location)}catch(n){return a(n,t,P),!1}}function N(t){return t.name}function S(t){return Boolean(t.unmountThisParcel)}function _(t){return S(t)?"parcel":"application"}function U(){for(var t=arguments.length-1;t>0;t--)for(var n in arguments[t])"__proto__"!==n&&(arguments[t-1][n]=arguments[t][n]);return arguments[0]}function D(t,n){for(var e=0;e<t.length;e++)if(n(t[e]))return t[e];return null}function M(t){return t&&("function"==typeof t||(n=t,Array.isArray(n)&&!D(n,(function(t){return"function"!=typeof t}))));var n}function j(t,n){var e=t[n]||[];0===(e=Array.isArray(e)?e:[e]).length&&(e=[function(){return Promise.resolve()}]);var r=_(t),o=N(t);return function(t){return e.reduce((function(e,i,u){return e.then((function(){var e=i(t);return L(e)?e:Promise.reject(f(15,!1,r,o,n,u))}))}),Promise.resolve())}}function L(t){return t&&"function"==typeof t.then&&"function"==typeof t.catch}function R(t,n){return Promise.resolve().then((function(){return t.status!==m?t:(t.status=d,t.bootstrap?z(t,"bootstrap").then(e).catch((function(e){if(n)throw l(e,t,P);return a(e,t,P),t})):Promise.resolve().then(e))}));function e(){return t.status=v,t}}function I(t,n){return Promise.resolve().then((function(){if(t.status!==g)return t;t.status=y;var e=Object.keys(t.parcels).map((function(n){return t.parcels[n].unmountThisParcel()}));return Promise.all(e).then(r,(function(e){return r().then((function(){var r=Error(e.message);if(n)throw l(r,t,P);a(r,t,P)}))})).then((function(){return t}));function r(){return z(t,"unmount").then((function(){t.status=v})).catch((function(e){if(n)throw l(e,t,P);a(e,t,P)}))}}))}var x=!1,G=!1;function B(t,n){return Promise.resolve().then((function(){return t.status!==v?t:(x||(window.dispatchEvent(new i("single-spa:before-first-mount")),x=!0),z(t,"mount").then((function(){return t.status=g,G||(window.dispatchEvent(new i("single-spa:first-mount")),G=!0),t})).catch((function(e){return t.status=g,I(t,!0).then(r,r);function r(){if(n)throw l(e,t,P);return a(e,t,P),t}})))}))}var C=0,W={parcels:{}};function $(){return k.apply(W,arguments)}function k(t,n){var r=this;if(!t||"object"!==e(t)&&"function"!=typeof t)throw Error(f(2,!1));if(t.name&&"string"!=typeof t.name)throw Error(f(3,!1,e(t.name)));if("object"!==e(n))throw Error(f(4,!1,name,e(n)));if(!n.domElement)throw Error(f(5,!1,name));var o,i=C++,u="function"==typeof t,a=u?t:function(){return Promise.resolve(t)},c={id:i,parcels:{},status:u?h:m,customProps:n,parentName:N(r),unmountThisParcel:function(){return y.then((function(){if(c.status!==g)throw Error(f(6,!1,name,c.status));return I(c,!0)})).then((function(t){return c.parentName&&delete r.parcels[c.id],t})).then((function(t){return p(t),t})).catch((function(t){throw c.status=P,d(t),t}))}};r.parcels[i]=c;var s=a();if(!s||"function"!=typeof s.then)throw Error(f(7,!1));var p,d,w=(s=s.then((function(t){if(!t)throw Error(f(8,!1));var n=t.name||"parcel-".concat(i);if(Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!M(t.bootstrap))throw Error(f(9,!1,n));if(!M(t.mount))throw Error(f(10,!1,n));if(!M(t.unmount))throw Error(f(11,!1,n));if(t.update&&!M(t.update))throw Error(f(12,!1,n));var e=j(t,"bootstrap"),r=j(t,"mount"),u=j(t,"unmount");c.status=m,c.name=n,c.bootstrap=e,c.mount=r,c.unmount=u,c.timeouts=X(t.timeouts),t.update&&(c.update=j(t,"update"),o.update=function(t){return c.customProps=t,K(function(t){return Promise.resolve().then((function(){if(t.status!==g)throw Error(f(32,!1,N(t)));return t.status=E,z(t,"update").then((function(){return t.status=g,t})).catch((function(n){throw l(n,t,P)}))}))}(c))})}))).then((function(){return R(c,!0)})),y=w.then((function(){return B(c,!0)})),O=new Promise((function(t,n){p=t,d=n}));return o={mount:function(){return K(Promise.resolve().then((function(){if(c.status!==v)throw Error(f(13,!1,name,c.status));return r.parcels[i]=c,B(c)})))},unmount:function(){return K(c.unmountThisParcel())},getStatus:function(){return c.status},loadPromise:K(s),bootstrapPromise:K(w),mountPromise:K(y),unmountPromise:K(O)}}function K(t){return t.then((function(){return null}))}function F(t){var r=N(t),o="function"==typeof t.customProps?t.customProps(r,window.location):t.customProps;("object"!==e(o)||null===o||Array.isArray(o))&&(o={},console.warn(f(40,!1),r,o));var i=U({},o,{name:r,mountParcel:k.bind(t),singleSpa:n});return S(t)&&(i.unmountSelf=t.unmountThisParcel),i}var H={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:1e3},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},update:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3}};function J(t,n,e){if("number"!=typeof t||t<=0)throw Error(f(16,!1));H.bootstrap={millis:t,dieOnTimeout:n,warningMillis:e||1e3}}function Q(t,n,e){if("number"!=typeof t||t<=0)throw Error(f(17,!1));H.mount={millis:t,dieOnTimeout:n,warningMillis:e||1e3}}function V(t,n,e){if("number"!=typeof t||t<=0)throw Error(f(18,!1));H.unmount={millis:t,dieOnTimeout:n,warningMillis:e||1e3}}function q(t,n,e){if("number"!=typeof t||t<=0)throw Error(f(19,!1));H.unload={millis:t,dieOnTimeout:n,warningMillis:e||1e3}}function z(t,n){var e=t.timeouts[n],r=e.warningMillis,o=_(t);return new Promise((function(i,u){var a=!1,c=!1;t[n](F(t)).then((function(t){a=!0,i(t)})).catch((function(t){a=!0,u(t)})),setTimeout((function(){return l(1)}),r),setTimeout((function(){return l(!0)}),e.millis);var s=f(31,!1,n,o,N(t),e.millis);function l(t){if(!a)if(!0===t)c=!0,e.dieOnTimeout?u(Error(s)):console.error(s);else if(!c){var n=t,o=n*r;console.warn(s),o+r<e.millis&&setTimeout((function(){return l(n+1)}),r)}}}))}function X(t){var n={};for(var e in H)n[e]=U({},H[e],t&&t[e]||{});return n}function Y(t){return Promise.resolve().then((function(){return t.loadPromise?t.loadPromise:t.status!==p&&t.status!==T?t:(t.status=h,t.loadPromise=Promise.resolve().then((function(){var o=t.loadApp(F(t));if(!L(o))throw r=!0,Error(f(33,!1,N(t)));return o.then((function(r){var o;t.loadErrorTime=null,"object"!==e(n=r)&&(o=34),Object.prototype.hasOwnProperty.call(n,"bootstrap")&&!M(n.bootstrap)&&(o=35),M(n.mount)||(o=36),M(n.unmount)||(o=37);var i=_(n);if(o){var u;try{u=JSON.stringify(n)}catch(t){}return console.error(f(o,!1,i,N(t),u),n),a(void 0,t,P),t}return n.devtools&&n.devtools.overlays&&(t.devtools.overlays=U({},t.devtools.overlays,n.devtools.overlays)),t.status=m,t.bootstrap=j(n,"bootstrap"),t.mount=j(n,"mount"),t.unmount=j(n,"unmount"),t.unload=j(n,"unload"),t.timeouts=X(n.timeouts),delete t.loadPromise,t}))})).catch((function(n){var e;return delete t.loadPromise,r?e=P:(e=T,t.loadErrorTime=(new Date).getTime()),a(n,t,e),t})));var n,r}))}var Z,tt="undefined"!=typeof window,nt={hashchange:[],popstate:[]},et=["hashchange","popstate"];function rt(t){var n;if("string"==typeof t)n=t;else if(this&&this.href)n=this.href;else{if(!(t&&t.currentTarget&&t.currentTarget.href&&t.preventDefault))throw Error(f(14,!1));n=t.currentTarget.href,t.preventDefault()}var e=ft(window.location.href),r=ft(n);0===n.indexOf("#")?window.location.hash=r.hash:e.host!==r.host&&r.host?window.location.href=n:r.pathname===e.pathname&&r.search===e.search?window.location.hash=r.hash:window.history.pushState(null,null,n)}function ot(t){var n=this;if(t){var e=t[0].type;et.indexOf(e)>=0&&nt[e].forEach((function(e){try{e.apply(n,t)}catch(t){setTimeout((function(){throw t}))}}))}}function it(){It([],arguments)}function ut(t,n){return function(){var e=window.location.href,r=t.apply(this,arguments),o=window.location.href;return Z&&e===o||(Ct()?window.dispatchEvent(at(window.history.state,n)):It([])),r}}function at(t,n){var e;try{e=new PopStateEvent("popstate",{state:t})}catch(n){(e=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,t)}return e.singleSpa=!0,e.singleSpaTrigger=n,e}if(tt){window.addEventListener("hashchange",it),window.addEventListener("popstate",it);var ct=window.addEventListener,st=window.removeEventListener;window.addEventListener=function(t,n){if(!("function"==typeof n&&et.indexOf(t)>=0)||D(nt[t],(function(t){return t===n})))return ct.apply(this,arguments);nt[t].push(n)},window.removeEventListener=function(t,n){if(!("function"==typeof n&&et.indexOf(t)>=0))return st.apply(this,arguments);nt[t]=nt[t].filter((function(t){return t!==n}))},window.history.pushState=ut(window.history.pushState,"pushState"),window.history.replaceState=ut(window.history.replaceState,"replaceState"),window.singleSpaNavigate?console.warn(f(41,!1)):window.singleSpaNavigate=rt}function ft(t){var n=document.createElement("a");return n.href=t,n}var lt=!1;function pt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!lt){var n=t.fn.on,e=t.fn.off;t.fn.on=function(t,e){return ht.call(this,n,window.addEventListener,t,e,arguments)},t.fn.off=function(t,n){return ht.call(this,e,window.removeEventListener,t,n,arguments)},lt=!0}}function ht(t,n,e,r,o){return"string"!=typeof e?t.apply(this,o):(e.split(/\s+/).forEach((function(t){et.indexOf(t)>=0&&(n(t,r),e=e.replace(t,""))})),""===e.trim()?this:t.apply(this,o))}var mt={};function dt(t){return Promise.resolve().then((function(){var n=mt[N(t)];if(!n)return t;if(t.status===p)return vt(t,n),t;if(t.status===O)return n.promise.then((function(){return t}));if(t.status!==v&&t.status!==T)return t;var e=t.status===T?Promise.resolve():z(t,"unload");return t.status=O,e.then((function(){return vt(t,n),t})).catch((function(e){return function(t,n,e){delete mt[N(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,a(e,t,P),n.reject(e)}(t,n,e),t}))}))}function vt(t,n){delete mt[N(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=p,n.resolve()}function wt(t,n,e,r){mt[N(t)]={app:t,resolve:e,reject:r},Object.defineProperty(mt[N(t)],"promise",{get:n})}function gt(t){return mt[t]}var Et=[];function yt(){var t=[],n=[],e=[],r=[],o=(new Date).getTime();return Et.forEach((function(i){var u=i.status!==P&&A(i);switch(i.status){case T:u&&o-i.loadErrorTime>=200&&e.push(i);break;case p:case h:u&&e.push(i);break;case m:case v:!u&>(N(i))?t.push(i):u&&r.push(i);break;case g:u||n.push(i)}})),{appsToUnload:t,appsToUnmount:n,appsToLoad:e,appsToMount:r}}function Ot(){return Et.filter(b).map(N)}function Tt(){return Et.map(N)}function Pt(t){var n=D(Et,(function(n){return N(n)===t}));return n?n.status:null}function bt(t,n,r,o){var i=function(t,n,r,o){var i,u={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"===e(t)?(function(t){if(Array.isArray(t)||null===t)throw Error(f(39,!1));var n=["name","app","activeWhen","customProps"],r=Object.keys(t).reduce((function(t,e){return n.indexOf(e)>=0?t:t.concat(e)}),[]);if(0!==r.length)throw Error(f(38,!1,n.join(", "),r.join(", ")));if("string"!=typeof t.name||0===t.name.length)throw Error(f(20,!1));if("object"!==e(t.app)&&"function"!=typeof t.app)throw Error(f(20,!1));var o=function(t){return"string"==typeof t||"function"==typeof t};if(!(o(t.activeWhen)||Array.isArray(t.activeWhen)&&t.activeWhen.every(o)))throw Error(f(24,!1));if(!Ut(t.customProps))throw Error(f(22,!1))}(t),u.name=t.name,u.loadApp=t.app,u.activeWhen=t.activeWhen,u.customProps=t.customProps):(function(t,n,e,r){if("string"!=typeof t||0===t.length)throw Error(f(20,!1));if(!n)throw Error(f(23,!1));if("function"!=typeof e)throw Error(f(24,!1));if(!Ut(r))throw Error(f(22,!1))}(t,n,r,o),u.name=t,u.loadApp=n,u.activeWhen=r,u.customProps=o),u.loadApp="function"!=typeof(i=u.loadApp)?function(){return Promise.resolve(i)}:i,u.customProps=function(t){return t||{}}(u.customProps),u.activeWhen=function(t){var n=Array.isArray(t)?t:[t];return n=n.map((function(t){return"function"==typeof t?t:Dt(t)})),function(t){return n.some((function(n){return n(t)}))}}(u.activeWhen),u}(t,n,r,o);if(-1!==Tt().indexOf(i.name))throw Error(f(21,!1,i.name));Et.push(U({loadErrorTime:null,status:p,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},i)),tt&&(pt(),It())}function At(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location;return Et.filter((function(n){return n.activeWhen(t)})).map(N)}function Nt(t){if(0===Et.filter((function(n){return N(n)===t})).length)throw Error(f(25,!1,t));return St(t).then((function(){var n=Et.map(N).indexOf(t);Et.splice(n,1)}))}function St(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof t)throw Error(f(26,!1));var e=D(Et,(function(n){return N(n)===t}));if(!e)throw Error(f(27,!1,t));var r,o=gt(N(e));if(n&&n.waitForUnmount){if(o)return o.promise;var i=new Promise((function(t,n){wt(e,(function(){return i}),t,n)}));return i}return o?(r=o.promise,_t(e,o.resolve,o.reject)):r=new Promise((function(t,n){wt(e,(function(){return r}),t,n),_t(e,t,n)})),r}function _t(t,n,e){I(t).then(dt).then((function(){n(),setTimeout((function(){It()}))})).catch(e)}function Ut(t){return!t||"function"==typeof t||"object"===e(t)&&null!==t&&!Array.isArray(t)}function Dt(t,n){var e=function(t,n){var e=0,r=!1,o="^";"/"!==t[0]&&(t="/"+t);for(var i=0;i<t.length;i++){var u=t[i];(!r&&":"===u||r&&"/"===u)&&a(i)}return a(t.length),new RegExp(o,"i");function a(i){var u=t.slice(e,i).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(o+=r?"[^/]+/?":u,i===t.length)if(r)n&&(o+="$");else{var a=n?"":".*";o="/"===o.charAt(o.length-1)?"".concat(o).concat(a,"$"):"".concat(o,"(/").concat(a,")?(#.*)?$")}r=!r,e=i}}(t,n);return function(t){var n=t.origin;n||(n="".concat(t.protocol,"//").concat(t.host));var r=t.href.replace(n,"").replace(t.search,"").split("?")[0];return e.test(r)}}var Mt=!1,jt=[],Lt=tt&&window.location.href;function Rt(){return It()}function It(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;if(Mt)return new Promise((function(t,e){jt.push({resolve:t,reject:e,eventArguments:n})}));var e,o=yt(),u=o.appsToUnload,a=o.appsToUnmount,c=o.appsToLoad,s=o.appsToMount,f=!1,l=Lt,h=Lt=window.location.href;return Ct()?(Mt=!0,e=u.concat(c,a,s),w()):(e=c,d());function m(){f=!0}function d(){return Promise.resolve().then((function(){var t=c.map(Y);return Promise.all(t).then(y).then((function(){return[]})).catch((function(t){throw y(),t}))}))}function w(){return Promise.resolve().then((function(){if(window.dispatchEvent(new i(0===e.length?"single-spa:before-no-app-change":"single-spa:before-app-change",O(!0))),window.dispatchEvent(new i("single-spa:before-routing-event",O(!0,{cancelNavigation:m}))),f)return window.dispatchEvent(new i("single-spa:before-mount-routing-event",O(!0))),E(),void rt(l);var n=u.map(dt),r=a.map(I).map((function(t){return t.then(dt)})).concat(n),o=Promise.all(r);o.then((function(){window.dispatchEvent(new i("single-spa:before-mount-routing-event",O(!0)))}));var p=c.map((function(t){return Y(t).then((function(t){return xt(t,o)}))})),h=s.filter((function(t){return c.indexOf(t)<0})).map((function(t){return xt(t,o)}));return o.catch((function(t){throw y(),t})).then((function(){return y(),Promise.all(p.concat(h)).catch((function(n){throw t.forEach((function(t){return t.reject(n)})),n})).then(E)}))}))}function E(){var n=Ot();t.forEach((function(t){return t.resolve(n)}));try{var r=0===e.length?"single-spa:no-app-change":"single-spa:app-change";window.dispatchEvent(new i(r,O())),window.dispatchEvent(new i("single-spa:routing-event",O()))}catch(t){setTimeout((function(){throw t}))}if(Mt=!1,jt.length>0){var o=jt;jt=[],It(o)}return n}function y(){t.forEach((function(t){ot(t.eventArguments)})),ot(n)}function O(){var t,o=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=arguments.length>1?arguments[1]:void 0,m={},d=(r(t={},g,[]),r(t,v,[]),r(t,p,[]),r(t,P,[]),t);o?(c.concat(s).forEach((function(t,n){E(t,g)})),u.forEach((function(t){E(t,p)})),a.forEach((function(t){E(t,v)}))):e.forEach((function(t){E(t)}));var w={detail:{newAppStatuses:m,appsByNewStatus:d,totalAppChanges:e.length,originalEvent:null==n?void 0:n[0],oldUrl:l,newUrl:h,navigationIsCanceled:f}};return i&&U(w.detail,i),w;function E(t,n){var e=N(t);n=n||Pt(e),m[e]=n,(d[n]=d[n]||[]).push(e)}}}function xt(t,n){return A(t)?R(t).then((function(t){return n.then((function(){return A(t)?B(t):t}))})):n.then((function(){return t}))}var Gt=!1;function Bt(t){var n;Gt=!0,t&&t.urlRerouteOnly&&(n=t.urlRerouteOnly,Z=n),tt&&It()}function Ct(){return Gt}tt&&setTimeout((function(){Gt||console.warn(f(1,!1))}),5e3);var Wt={getRawAppData:function(){return[].concat(Et)},reroute:It,NOT_LOADED:p,toLoadPromise:Y,toBootstrapPromise:R,unregisterApplication:Nt};tt&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=Wt),t.BOOTSTRAPPING=d,t.LOADING_SOURCE_CODE=h,t.LOAD_ERROR=T,t.MOUNTED=g,t.MOUNTING=w,t.NOT_BOOTSTRAPPED=m,t.NOT_LOADED=p,t.NOT_MOUNTED=v,t.SKIP_BECAUSE_BROKEN=P,t.UNLOADING=O,t.UNMOUNTING=y,t.UPDATING=E,t.addErrorHandler=c,t.checkActivityFunctions=At,t.ensureJQuerySupport=pt,t.getAppNames=Tt,t.getAppStatus=Pt,t.getMountedApps=Ot,t.mountRootParcel=$,t.navigateToUrl=rt,t.pathToActiveWhen=Dt,t.registerApplication=bt,t.removeErrorHandler=s,t.setBootstrapMaxTime=J,t.setMountMaxTime=Q,t.setUnloadMaxTime=q,t.setUnmountMaxTime=V,t.start=Bt,t.triggerAppChange=Rt,t.unloadApplication=St,t.unregisterApplication=Nt,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=single-spa.min.js.map |
{ | ||
"name": "single-spa", | ||
"version": "5.9.4", | ||
"version": "5.9.5", | ||
"description": "The router for easy microfrontends", | ||
@@ -5,0 +5,0 @@ "main": "lib/umd/single-spa.min.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1212076
6531