single-spa
Version:
The router for easy microfrontends
4 lines (3 loc) • 21.3 kB
JavaScript
/* single-spa@6.0.3 - ESM ES5 - prod */
var t=Object.freeze({__proto__:null,get start(){return Ct},get ensureJQuerySupport(){return ht},get setBootstrapMaxTime(){return J},get setMountMaxTime(){return Q},get setUnmountMaxTime(){return V},get setUnloadMaxTime(){return q},get registerApplication(){return Nt},get unregisterApplication(){return _t},get getMountedApps(){return Ot},get getAppStatus(){return Tt},get unloadApplication(){return Dt},get checkActivityFunctions(){return St},get getAppNames(){return bt},get pathToActiveWhen(){return Mt},get navigateToUrl(){return et},get patchHistoryApi(){return ft},get triggerAppChange(){return It},get addErrorHandler(){return a},get removeErrorHandler(){return c},get mountRootParcel(){return $},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 E},get UNMOUNTING(){return y},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 r(t,n,r){return n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t}var e=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}).CustomEvent,o=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,n){var r=document.createEvent("CustomEvent");return n?r.initCustomEvent(t,n.bubbles,n.cancelable,n.detail):r.initCustomEvent(t,!1,!1,void 0),r}:function(t,n){var r=document.createEventObject();return r.type=t,n?(r.bubbles=Boolean(n.bubbles),r.cancelable=Boolean(n.cancelable),r.detail=n.detail):(r.bubbles=!1,r.cancelable=!1,r.detail=void 0),r},i=[];function u(t,n,r){var e=f(t,n,r);i.length?i.forEach((function(t){return t(e)})):setTimeout((function(){throw e}))}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(r){var e=r===t;return n=n||e,!e})),n}function s(t,n){for(var r=arguments.length,e=new Array(r>2?r-2:0),o=2;o<r;o++)e[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(e.length?"&arg=".concat(e.join("&arg=")):"")}function f(t,n,r){var e,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){}e=t}else{console.warn(s(30,!1,n.status,A(n)));try{e=Error(o+JSON.stringify(t))}catch(n){e=t}}return e.appOrParcelName=A(n),n.status=r,e}var l="NOT_LOADED",p="LOADING_SOURCE_CODE",h="NOT_BOOTSTRAPPED",m="BOOTSTRAPPING",v="NOT_MOUNTED",d="MOUNTING",w="MOUNTED",g="UPDATING",y="UNMOUNTING",E="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 r=0;r<t.length;r++)if(n(t[r]))return t[r];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 r=t[n]||[];0===(r=Array.isArray(r)?r:[r]).length&&(r=[function(){return Promise.resolve()}]);var e=S(t),o=A(t);return function(t){return r.reduce((function(r,i,u){return r.then((function(){var r=i(t);return M(r)?r:Promise.reject(s(15,!1,e,o,n,u))}))}),Promise.resolve())}}function M(t){return t&&"function"==typeof t.then&&"function"==typeof t.catch}var L=[];function R(t,n){return Promise.resolve().then((function(){return t.status!==h?t:(t.status=m,t.bootstrap?z(t,"bootstrap").then(r).catch((function(r){if(n)throw f(r,t,O);return u(r,t,O),t})):Promise.resolve().then(r))}));function r(){return t.status=v,t}}function x(t,n){return Promise.resolve().then((function(){if(t.status!==w)return t;t.status=y;var r=Object.keys(t.parcels).map((function(n){return t.parcels[n].unmountThisParcel()}));return Promise.all(r).then(e,(function(r){return e().then((function(){var e=Error(r.message);if(n)throw f(e,t,O);u(e,t,O)}))})).then((function(){return t}));function e(){return z(t,"unmount").then((function(){t.status=v}),(function(r){if(n)throw f(r,t,O);u(r,t,O)}))}}))}var I=!1,B=!1;function G(t,n){return Promise.resolve().then((function(){return t.status!==v?t:(I||(window.dispatchEvent(new o("single-spa:before-first-mount")),I=!0),t.status=d,z(t,"mount").then((function(){return t.status=w,B||(window.dispatchEvent(new o("single-spa:first-mount")),B=!0),t})).catch((function(r){return t.status=w,x(t,!0).then(e,e);function e(){if(n)throw f(r,t,O);return u(r,t,O),t}})))}))}var W=0,C={parcels:{}};function $(){return k.apply(C,arguments)}function k(t,r){var e=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)));var o=W++,i=t.name||"parcel-".concat(o);if("object"!==n(r))throw Error(s(4,!1,i,n(r)));if(!r.domElement)throw Error(s(5,!1,i));var u,a="function"==typeof t,c=a?t:function(){return Promise.resolve(t)},l={id:o,parcels:{},status:a?p:h,customProps:r,parentName:A(e),unmountThisParcel:function(){return P.then((function(){if(l.status!==w)throw Error(s(6,!1,i,l.status));return x(l,!0)})).then((function(t){return l.parentName&&delete e.parcels[l.id],t})).then((function(t){return d(t),t})).catch((function(t){throw l.status=O,y(t),t}))}};e.parcels[o]=l;var m=c();if(!m||"function"!=typeof m.then)throw Error(s(7,!1));var d,y,E=(m=m.then((function(t){if(!t)throw Error(s(8,!1));if(i=t.name||"parcel-".concat(o),Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!U(t.bootstrap))throw Error(s(9,!1,i));if(!U(t.mount))throw Error(s(10,!1,i));if(!U(t.unmount))throw Error(s(11,!1,i));if(t.update&&!U(t.update))throw Error(s(12,!1,i));var n=j(t,"bootstrap"),r=j(t,"mount"),e=j(t,"unmount");l.status=h,l.name=i,l.bootstrap=n,l.mount=r,l.unmount=e,l.timeouts=X(t.timeouts),t.update&&(l.update=j(t,"update"),u.update=function(t){return l.customProps=t,F((n=l,Promise.resolve().then((function(){if(n.status!==w)throw Error(s(32,!1,A(n)));return n.status=g,z(n,"update").then((function(){return n.status=w,n})).catch((function(t){throw f(t,n,O)}))}))));var n})}))).then((function(){return R(l,!0)})),P=E.then((function(){return G(l,!0)})),b=new Promise((function(t,n){d=t,y=n}));return u={mount:function(){return F(Promise.resolve().then((function(){if(l.status!==v)throw Error(s(13,!1,i,l.status));return e.parcels[o]=l,G(l)})))},unmount:function(){return F(l.unmountThisParcel())},getStatus:function(){return l.status},loadPromise:F(m),bootstrapPromise:F(E),mountPromise:F(P),unmountPromise:F(b)}}function F(t){return t.then((function(){return null}))}function K(r){var e=A(r),o="function"==typeof r.customProps?r.customProps(e,window.location):r.customProps;("object"!==n(o)||null===o||Array.isArray(o))&&(o={},console.warn(s(40,!1),e,o));var i=_({},o,{name:e,mountParcel:k.bind(r),singleSpa:t});return N(r)&&(i.unmountSelf=r.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,r){if("number"!=typeof t||t<=0)throw Error(s(16,!1));H.bootstrap={millis:t,dieOnTimeout:n,warningMillis:r||1e3}}function Q(t,n,r){if("number"!=typeof t||t<=0)throw Error(s(17,!1));H.mount={millis:t,dieOnTimeout:n,warningMillis:r||1e3}}function V(t,n,r){if("number"!=typeof t||t<=0)throw Error(s(18,!1));H.unmount={millis:t,dieOnTimeout:n,warningMillis:r||1e3}}function q(t,n,r){if("number"!=typeof t||t<=0)throw Error(s(19,!1));H.unload={millis:t,dieOnTimeout:n,warningMillis:r||1e3}}function z(t,n){var r=t.timeouts[n],e=r.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)}),e),setTimeout((function(){return l(!0)}),r.millis);var f=s(31,!1,n,o,A(t),r.millis);function l(t){if(!a)if(!0===t)c=!0,r.dieOnTimeout?u(Error(f)):console.error(f);else if(!c){var n=t,o=n*e;console.warn(f),o+e<r.millis&&setTimeout((function(){return l(n+1)}),e)}}}))}function X(t){var n={};for(var r in H)n[r]=_({},H[r],t&&t[r]||{});return n}function Y(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 e=!0,Error(s(33,!1,A(t)));return o.then((function(e){var o;t.loadErrorTime=null,"object"!==n(r=e)&&(o=34),Object.prototype.hasOwnProperty.call(r,"bootstrap")&&!U(r.bootstrap)&&(o=35),U(r.mount)||(o=36),U(r.unmount)||(o=37);var i=S(r);if(o){var a;try{a=JSON.stringify(r)}catch(t){}return console.error(s(o,!1,i,A(t),a),r),u(void 0,t,O),t}return r.devtools&&r.devtools.overlays&&(t.devtools.overlays=_({},t.devtools.overlays,r.devtools.overlays)),t.status=h,t.bootstrap=j(r,"bootstrap"),t.mount=j(r,"mount"),t.unmount=j(r,"unmount"),t.unload=j(r,"unload"),t.timeouts=X(r.timeouts),delete t.loadPromise,t}))})).catch((function(n){var r;return delete t.loadPromise,e?r=O:(r=P,t.loadErrorTime=(new Date).getTime()),u(n,t,r),t})));var r,e}))}var Z,tt="undefined"!=typeof window,nt={hashchange:[],popstate:[]},rt=["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 r=lt(window.location.href),e=lt(n);0===n.indexOf("#")?window.location.hash=e.hash:r.host!==e.host&&e.host?window.location.href=n:e.pathname===r.pathname&&e.search===r.search?window.location.hash=e.hash:window.history.pushState(null,null,n)}function ot(t){var n=this;if(t){var r=t[0].type;rt.indexOf(r)>=0&&nt[r].forEach((function(r){try{r.apply(n,t)}catch(t){setTimeout((function(){throw t}))}}))}}function it(){Bt([],arguments)}function ut(t,n){return function(){var r=window.location.href,e=t.apply(this,arguments),o=window.location.href;return Z&&r===o||window.dispatchEvent(at(window.history.state,n)),e}}function at(t,n){var r;try{r=new PopStateEvent("popstate",{state:t})}catch(n){(r=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,t)}return r.singleSpa=!0,r.singleSpaTrigger=n,r}var ct=null,st=!1;function ft(t){if(st)throw Error(s(43,!1));Z=!t||!t.hasOwnProperty("urlRerouteOnly")||t.urlRerouteOnly,st=!0,ct=window.history.replaceState,window.addEventListener("hashchange",it),window.addEventListener("popstate",it);var n=window.addEventListener,r=window.removeEventListener;window.addEventListener=function(t,r){if(!("function"==typeof r&&rt.indexOf(t)>=0)||D(nt[t],(function(t){return t===r})))return n.apply(this,arguments);nt[t].push(r)},window.removeEventListener=function(t,n){return"function"==typeof n&&rt.indexOf(t)>=0&&(nt[t]=nt[t].filter((function(t){return t!==n}))),r.apply(this,arguments)},window.history.pushState=ut(window.history.pushState,"pushState"),window.history.replaceState=ut(ct,"replaceState")}function lt(t){var n=document.createElement("a");return n.href=t,n}tt&&(window.singleSpaNavigate?console.warn(s(41,!1)):window.singleSpaNavigate=et);var pt=!1;function ht(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!pt){var n=t.fn.on,r=t.fn.off;t.fn.on=function(t,r){return mt.call(this,n,window.addEventListener,t,r,arguments)},t.fn.off=function(t,n){return mt.call(this,r,window.removeEventListener,t,n,arguments)},pt=!0}}function mt(t,n,r,e,o){return"string"!=typeof r?t.apply(this,o):(r.split(/\s+/).forEach((function(t){rt.indexOf(t)>=0&&(n(t,e),r=r.replace(t,""))})),""===r.trim()?this:t.apply(this,o))}var vt={};function dt(t){return Promise.resolve().then((function(){var n=vt[A(t)];if(!n)return t;if(t.status===l)return wt(t,n),t;if(t.status===E)return n.promise.then((function(){return t}));if(t.status!==v&&t.status!==P)return t;var r=t.status===P?Promise.resolve():z(t,"unload");return t.status=E,r.then((function(){return wt(t,n),t})).catch((function(r){return function(t,n,r){delete vt[A(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,u(r,t,O),n.reject(r)}(t,n,r),t}))}))}function wt(t,n){delete vt[A(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=l,n.resolve()}function gt(t,n,r,e){vt[A(t)]={app:t,resolve:r,reject:e},Object.defineProperty(vt[A(t)],"promise",{get:n})}function yt(t){return vt[t]}var Et=[];function Pt(){var t=[],n=[],r=[],e=[],o=(new Date).getTime();return Et.forEach((function(i){var u=i.status!==O&&T(i);switch(i.status){case P:u&&o-i.loadErrorTime>=200&&r.push(i);break;case l:case p:u&&r.push(i);break;case h:case v:!u&&yt(A(i))?t.push(i):u&&e.push(i);break;case w:u||n.push(i)}})),{appsToUnload:t,appsToUnmount:n,appsToLoad:r,appsToMount:e}}function Ot(){return Et.filter(b).map(A)}function bt(){return Et.map(A)}function Tt(t){var n=D(Et,(function(n){return A(n)===t}));return n?n.status:null}var At=!1;function Nt(t,r,e,o){var i=function(t,r,e,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 r=["name","app","activeWhen","customProps"],e=Object.keys(t).reduce((function(t,n){return r.indexOf(n)>=0?t:t.concat(n)}),[]);if(0!==e.length)throw Error(s(38,!1,r.join(", "),e.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(!jt(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,r,e){if("string"!=typeof t||0===t.length)throw Error(s(20,!1));if(!n)throw Error(s(23,!1));if("function"!=typeof r)throw Error(s(24,!1));if(!jt(e))throw Error(s(22,!1))}(t,r,e,o),u.name=t,u.loadApp=r,u.activeWhen=e,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:Mt(t)})),function(t){return n.some((function(n){return n(t)}))}}(u.activeWhen),u}(t,r,e,o);if($t()||At||(At=!0,setTimeout((function(){$t()||console.warn(s(1,!1))}),5e3)),-1!==bt().indexOf(i.name))throw Error(s(21,!1,i.name));Et.push(_({loadErrorTime:null,status:l,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},i)),tt&&(ht(),Bt())}function St(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location;return Et.filter((function(n){return n.activeWhen(t)})).map(A)}function _t(t){if(0===Et.filter((function(n){return A(n)===t})).length)throw Error(s(25,!1,t));return(tt?Dt(t,{waitForUnmount:!1}):Promise.resolve()).then((function(){var n=Et.map(A).indexOf(t);Et.splice(n,1)}))}function Dt(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof t)throw Error(s(26,!1));var r=D(Et,(function(n){return A(n)===t}));if(!r)throw Error(s(27,!1,t));var e,o=yt(A(r));if(n&&n.waitForUnmount){if(o)return o.promise;var i=new Promise((function(t,n){gt(r,(function(){return i}),t,n)}));return i}return o?(e=o.promise,Ut(r,o.resolve,o.reject)):e=new Promise((function(t,n){gt(r,(function(){return e}),t,n),Ut(r,t,n)})),e}function Ut(t,n,r){Promise.resolve().then((function(){if(D(St(),(function(n){return n===A(t)})))return It()})).then((function(){return x(t).then(dt).then((function(){n(),setTimeout((function(){Bt()}))}))})).catch(r)}function jt(t){return!t||"function"==typeof t||"object"===n(t)&&null!==t&&!Array.isArray(t)}function Mt(t,n){var r=function(t,n){var r=0,e=!1,o="^";"/"!==t[0]&&(t="/"+t);for(var i=0;i<t.length;i++){var u=t[i];(!e&&":"===u||e&&"/"===u)&&a(i)}return a(t.length),new RegExp(o,"i");function a(i){var u=t.slice(r,i).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(o+=e?"[^/]+/?":u,i===t.length)if(e)n&&(o+="$");else{var a=n?"":".*";o="/"===o.charAt(o.length-1)?"".concat(o).concat(a,"$"):"".concat(o,"(/").concat(a,")?(#.*)?$")}e=!e,r=i}}(t,n);return function(t){var n=t.origin;n||(n="".concat(t.protocol,"//").concat(t.host));var e=t.href.replace(n,"").replace(t.search,"").split("?")[0];return r.test(e)}}var Lt=!1,Rt=[],xt=tt&&window.location.href;function It(){return Bt()}function Bt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,e=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Lt)return new Promise((function(t,r){Rt.push({resolve:t,reject:r,eventArguments:n})}));var i,u=Pt(),a=u.appsToUnload,c=u.appsToUnmount,f=u.appsToLoad,p=u.appsToMount,h=[],m=xt,d=xt=window.location.href;return $t()?(Lt=!0,i=a.concat(f,c,p),E()):(i=f,y());function g(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n="function"==typeof(null==t?void 0:t.then)?t:Promise.resolve(t);h.push(n.catch((function(t){return console.warn(Error(s(42,!1))),console.warn(t),!1})))}function y(){return Promise.resolve().then((function(){var t=f.map(Y);return Promise.all(t).then(b).then((function(){return[]})).catch((function(t){throw b(),t})).finally((function(){}))}))}function E(){return Promise.resolve().then((function(){return N(0===i.length?"before-no-app-change":"before-app-change",T(!0)),N("before-routing-event",T(!0,{cancelNavigation:g})),Promise.all(h).then((function(r){if(r.some((function(t){return t})))return ct.call(window.history,history.state,"",m.substring(location.origin.length)),xt=location.href,Lt=!1,Bt(t,n,!0);var e=a.map(dt),o=c.map(x).map((function(t){return t.then(dt)})).concat(e),i=Promise.all(o);i.then((function(){N("before-mount-routing-event",T(!0))}),(function(t){throw t}));var u=f.map((function(t){return Y(t).then((function(t){return Gt(t,i)}))})),s=p.filter((function(t){return f.indexOf(t)<0})).map((function(t){return Gt(t,i)}));return i.catch((function(t){throw b(),t})).then((function(){return b(),Promise.all(u.concat(s)).catch((function(n){throw t.forEach((function(t){return t.reject(n)})),n})).then(P).then((function(){}),(function(t){throw t}))}))}))}))}function P(){var n=Ot();t.forEach((function(t){return t.resolve(n)}));try{N(0===i.length?"no-app-change":"app-change",T()),N("routing-event",T())}catch(t){setTimeout((function(){throw t}))}if(Lt=!1,Rt.length>0){var r=Rt;Rt=[],Bt(r)}return n}function b(){e||(t.forEach((function(t){ot(t.eventArguments)})),ot(n))}function T(){var t,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=arguments.length>1?arguments[1]:void 0,u={},s=(r(t={},w,[]),r(t,v,[]),r(t,l,[]),r(t,O,[]),t);e?(f.concat(p).forEach((function(t,n){g(t,w)})),a.forEach((function(t){g(t,l)})),c.forEach((function(t){g(t,v)}))):i.forEach((function(t){g(t)}));var h={detail:{newAppStatuses:u,appsByNewStatus:s,totalAppChanges:i.length,originalEvent:null==n?void 0:n[0],oldUrl:m,newUrl:d}};return o&&_(h.detail,o),h;function g(t,n){var r=A(t);n=n||Tt(r),u[r]=n,(s[n]=s[n]||[]).push(r)}}function N(t,n){e||window.dispatchEvent(new o("single-spa:".concat(t),n))}}function Gt(t,n){return T(t)?R(t).then((function(t){return n.then((function(){return T(t)?G(t):t}))})):n.then((function(){return t}))}var Wt=!1;function Ct(t){Wt=!0,tt&&(ft(t),Bt())}function $t(){return Wt}var kt={getRawAppData:function(){return[].concat(Et)},reroute:Bt,NOT_LOADED:l,toLoadPromise:Y,toBootstrapPromise:R,unregisterApplication:_t,getProfilerData:function(){return L}};tt&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=kt);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,E as UNLOADING,y as UNMOUNTING,g as UPDATING,a as addErrorHandler,St as checkActivityFunctions,ht as ensureJQuerySupport,bt as getAppNames,Tt as getAppStatus,Ot as getMountedApps,$ as mountRootParcel,et as navigateToUrl,ft as patchHistoryApi,Mt as pathToActiveWhen,Nt as registerApplication,c as removeErrorHandler,J as setBootstrapMaxTime,Q as setMountMaxTime,q as setUnloadMaxTime,V as setUnmountMaxTime,Ct as start,It as triggerAppChange,Dt as unloadApplication,_t as unregisterApplication};
//# sourceMappingURL=single-spa.min.js.map