@hsui/micro-app
Version:
Hundsun micro-app framework
3 lines • 73.4 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("lodash")):"function"==typeof define&&define.amd?define(["exports","lodash"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).microApp={},t._)}(this,(function(t,e){"use strict";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},n(t)}function r(){
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
r=function(){return t};var t={},e=Object.prototype,o=e.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function f(t,e,n,r){var o=Object.create((e&&e.prototype instanceof h?e:h).prototype),i=new S(r||[]);return o._invoke=function(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return _()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var u=P(a,n);if(u){if(u===p)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=l(t,e,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(t,n,i),o}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=f;var p={};function h(){}function d(){}function v(){}var m={};s(m,a,(function(){return this}));var y=Object.getPrototypeOf,w=y&&y(y(T([])));w&&w!==e&&o.call(w,a)&&(m=w);var g=v.prototype=h.prototype=Object.create(m);function b(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function r(i,a,u,c){var s=l(t[i],t,a);if("throw"!==s.type){var f=s.arg,p=f.value;return p&&"object"==n(p)&&o.call(p,"__await")?e.resolve(p.__await).then((function(t){r("next",t,u,c)}),(function(t){r("throw",t,u,c)})):e.resolve(p).then((function(t){f.value=t,u(f)}),(function(t){return r("throw",t,u,c)}))}c(s.arg)}var i;this._invoke=function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}}function P(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,P(t,e),"throw"===e.method))return p;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var r=l(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,p;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function T(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(o.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return r.next=r}}return{next:_}}function _(){return{value:void 0,done:!0}}return d.prototype=v,s(g,"constructor",v),s(v,"constructor",d),d.displayName=s(v,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,s(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(E.prototype),s(E.prototype,u,(function(){return this})),t.AsyncIterator=E,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new E(f(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),s(g,c,"Generator"),s(g,a,(function(){return this})),s(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=T,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],a=i.completion;if("root"===i.tryLoc)return n("end");if(this.prev>=i.tryLoc){var u=o.call(i,"catchLoc"),c=o.call(i,"finallyLoc");if(u&&c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(u){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(this.prev>=r.tryLoc&&o.call(r,"finallyLoc")&&r.finallyLoc>this.prev){var i=r;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:T(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},t}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function a(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach((function(e){o(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function u(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;i.length>r;r++)0>e.indexOf(n=i[r])&&(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;i.length>r;r++)0>e.indexOf(n=i[r])&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function c(t,e,n,r,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void n(t)}u.done?e(c):Promise.resolve(c).then(r,o)}function s(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){c(i,r,o,a,u,"next",t)}function u(t){c(i,r,o,a,u,"throw",t)}a(void 0)}))}}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);e>n;n++)r[n]=t[n];return r}function l(t,e){if(t){if("string"==typeof t)return f(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(t,e):void 0}}function p(t){return function(t){if(Array.isArray(t))return f(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||l(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var h=Object.freeze({__proto__:null,get start(){return Jt},get ensureJQuerySupport(){return Pt},get setBootstrapMaxTime(){return rt},get setMountMaxTime(){return ot},get setUnmountMaxTime(){return it},get setUnloadMaxTime(){return at},get registerApplication(){return Dt},get unregisterApplication(){return Ct},get getMountedApps(){return Lt},get getAppStatus(){return kt},get unloadApplication(){return Rt},get checkActivityFunctions(){return It},get getAppNames(){return Nt},get pathToActiveWhen(){return Ht},get navigateToUrl(){return dt},get triggerAppChange(){return $t},get addErrorHandler(){return b},get removeErrorHandler(){return E},get mountRootParcel(){return Z},get NOT_LOADED(){return x},get LOADING_SOURCE_CODE(){return S},get NOT_BOOTSTRAPPED(){return T},get BOOTSTRAPPING(){return _},get NOT_MOUNTED(){return M},get MOUNTING(){return A},get UPDATING(){return L},get LOAD_ERROR(){return k},get MOUNTED(){return j},get UNMOUNTING(){return N},get SKIP_BECAUSE_BROKEN(){return D}});function d(t){return(d="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 v(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var m=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}).CustomEvent,y=function(){try{var t=new m("cat",{detail:{foo:"bar"}});return"cat"===t.type&&"bar"===t.detail.foo}catch(t){}return!1}()?m:"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=!!e.bubbles,n.cancelable=!!e.cancelable,n.detail=e.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n},w=[];function g(t,e,n){var r=O(t,e,n);w.length?w.forEach((function(t){return t(r)})):setTimeout((function(){throw r}))}function b(t){if("function"!=typeof t)throw Error(P(28,!1));w.push(t)}function E(t){if("function"!=typeof t)throw Error(P(29,!1));var e=!1;return w=w.filter((function(n){var r=n===t;return e=e||r,!r})),e}function P(t,e){for(var n=arguments.length,r=Array(n>2?n-2:0),o=2;n>o;o++)r[o-2]=arguments[o];return"single-spa minified message #".concat(t,": ").concat(e?e+" ":"","See https://single-spa.js.org/error/?code=").concat(t).concat(r.length?"&arg=".concat(r.join("&arg=")):"")}function O(t,e,n){var r,o="".concat(U(e)," '").concat(R(e),"' died in status ").concat(e.status,": ");if(t instanceof Error){try{t.message=o+t.message}catch(t){}r=t}else{console.warn(P(30,!1,e.status,R(e)));try{r=Error(o+JSON.stringify(t))}catch(e){r=t}}return r.appOrParcelName=R(e),e.status=n,r}var x="NOT_LOADED",S="LOADING_SOURCE_CODE",T="NOT_BOOTSTRAPPED",_="BOOTSTRAPPING",M="NOT_MOUNTED",A="MOUNTING",j="MOUNTED",L="UPDATING",N="UNMOUNTING",k="LOAD_ERROR",D="SKIP_BECAUSE_BROKEN";function I(t){return t.status===j}function C(t){try{return t.activeWhen(window.location)}catch(e){return g(e,t,D),!1}}function R(t){return t.name}function G(t){return!!t.unmountThisParcel}function U(t){return G(t)?"parcel":"application"}function H(){for(var t=arguments.length-1;t>0;t--)for(var e in arguments[t])"__proto__"!==e&&(arguments[t-1][e]=arguments[t][e]);return arguments[0]}function B(t,e){for(var n=0;t.length>n;n++)if(e(t[n]))return t[n];return null}function W(t){return t&&("function"==typeof t||Array.isArray(e=t)&&!B(e,(function(t){return"function"!=typeof t})));var e}function F(t,e){var n=t[e]||[];0===(n=Array.isArray(n)?n:[n]).length&&(n=[function(){return Promise.resolve()}]);var r=U(t),o=R(t);return function(t){return n.reduce((function(n,i,a){return n.then((function(){var n=i(t);return $(n)?n:Promise.reject(P(15,!1,r,o,e,a))}))}),Promise.resolve())}}function $(t){return t&&"function"==typeof t.then&&"function"==typeof t.catch}function V(t,e){return Promise.resolve().then((function(){return t.status!==T?t:(t.status=_,t.bootstrap?ut(t,"bootstrap").then(n).catch((function(n){if(e)throw O(n,t,D);return g(n,t,D),t})):Promise.resolve().then(n))}));function n(){return t.status=M,t}}function Y(t,e){return Promise.resolve().then((function(){if(t.status!==j)return t;t.status=N;var n=Object.keys(t.parcels).map((function(e){return t.parcels[e].unmountThisParcel()}));return Promise.all(n).then(r,(function(n){return r().then((function(){var r=Error(n.message);if(e)throw O(r,t,D);g(r,t,D)}))})).then((function(){return t}));function r(){return ut(t,"unmount").then((function(){t.status=M})).catch((function(n){if(e)throw O(n,t,D);g(n,t,D)}))}}))}var q=!1,J=!1;function K(t,e){return Promise.resolve().then((function(){return t.status!==M?t:(q||(window.dispatchEvent(new y("single-spa:before-first-mount")),q=!0),ut(t,"mount").then((function(){return t.status=j,J||(window.dispatchEvent(new y("single-spa:first-mount")),J=!0),t})).catch((function(n){return t.status=j,Y(t,!0).then(r,r);function r(){if(e)throw O(n,t,D);return g(n,t,D),t}})))}))}var z=0,Q={parcels:{}};function Z(){return X.apply(Q,arguments)}function X(t,e){var n=this;if(!t||"object"!==d(t)&&"function"!=typeof t)throw Error(P(2,!1));if(t.name&&"string"!=typeof t.name)throw Error(P(3,!1,d(t.name)));if("object"!==d(e))throw Error(P(4,!1,name,d(e)));if(!e.domElement)throw Error(P(5,!1,name));var r,o=z++,i="function"==typeof t,a=i?t:function(){return Promise.resolve(t)},u={id:o,parcels:{},status:i?S:T,customProps:e,parentName:R(n),unmountThisParcel:function(){return p.then((function(){if(u.status!==j)throw Error(P(6,!1,name,u.status));return Y(u,!0)})).then((function(t){return u.parentName&&delete n.parcels[u.id],t})).then((function(t){return s(t),t})).catch((function(t){throw u.status=D,f(t),t}))}};n.parcels[o]=u;var c=a();if(!c||"function"!=typeof c.then)throw Error(P(7,!1));var s,f,l=(c=c.then((function(t){if(!t)throw Error(P(8,!1));var e=t.name||"parcel-".concat(o);if(Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!W(t.bootstrap))throw Error(P(9,!1,e));if(!W(t.mount))throw Error(P(10,!1,e));if(!W(t.unmount))throw Error(P(11,!1,e));if(t.update&&!W(t.update))throw Error(P(12,!1,e));var n=F(t,"bootstrap"),i=F(t,"mount"),a=F(t,"unmount");u.status=T,u.name=e,u.bootstrap=n,u.mount=i,u.unmount=a,u.timeouts=ct(t.timeouts),t.update&&(u.update=F(t,"update"),r.update=function(t){return u.customProps=t,tt(function(t){return Promise.resolve().then((function(){if(t.status!==j)throw Error(P(32,!1,R(t)));return t.status=L,ut(t,"update").then((function(){return t.status=j,t})).catch((function(e){throw O(e,t,D)}))}))}(u))})}))).then((function(){return V(u,!0)})),p=l.then((function(){return K(u,!0)})),h=new Promise((function(t,e){s=t,f=e}));return r={mount:function(){return tt(Promise.resolve().then((function(){if(u.status!==M)throw Error(P(13,!1,name,u.status));return n.parcels[o]=u,K(u)})))},unmount:function(){return tt(u.unmountThisParcel())},getStatus:function(){return u.status},loadPromise:tt(c),bootstrapPromise:tt(l),mountPromise:tt(p),unmountPromise:tt(h)}}function tt(t){return t.then((function(){return null}))}function et(t){var e=R(t),n="function"==typeof t.customProps?t.customProps(e,window.location):t.customProps;("object"!==d(n)||null===n||Array.isArray(n))&&(n={},console.warn(P(40,!1),e,n));var r=H({},n,{name:e,mountParcel:X.bind(t),singleSpa:h});return G(t)&&(r.unmountSelf=t.unmountThisParcel),r}var nt={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 rt(t,e,n){if("number"!=typeof t||0>=t)throw Error(P(16,!1));nt.bootstrap={millis:t,dieOnTimeout:e,warningMillis:n||1e3}}function ot(t,e,n){if("number"!=typeof t||0>=t)throw Error(P(17,!1));nt.mount={millis:t,dieOnTimeout:e,warningMillis:n||1e3}}function it(t,e,n){if("number"!=typeof t||0>=t)throw Error(P(18,!1));nt.unmount={millis:t,dieOnTimeout:e,warningMillis:n||1e3}}function at(t,e,n){if("number"!=typeof t||0>=t)throw Error(P(19,!1));nt.unload={millis:t,dieOnTimeout:e,warningMillis:n||1e3}}function ut(t,e){var n=t.timeouts[e],r=n.warningMillis,o=U(t);return new Promise((function(i,a){var u=!1,c=!1;t[e](et(t)).then((function(t){u=!0,i(t)})).catch((function(t){u=!0,a(t)})),setTimeout((function(){return f(1)}),r),setTimeout((function(){return f(!0)}),n.millis);var s=P(31,!1,e,o,R(t),n.millis);function f(t){if(!u)if(!0===t)c=!0,n.dieOnTimeout?a(Error(s)):console.error(s);else if(!c){var e=t,o=e*r;console.warn(s),n.millis>o+r&&setTimeout((function(){return f(e+1)}),r)}}}))}function ct(t){var e={};for(var n in nt)e[n]=H({},nt[n],t&&t[n]||{});return e}function st(t){return Promise.resolve().then((function(){return t.loadPromise?t.loadPromise:t.status!==x&&t.status!==k?t:(t.status=S,t.loadPromise=Promise.resolve().then((function(){var r=t.loadApp(et(t));if(!$(r))throw n=!0,Error(P(33,!1,R(t)));return r.then((function(n){var r;t.loadErrorTime=null,"object"!==d(e=n)&&(r=34),Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!W(e.bootstrap)&&(r=35),W(e.mount)||(r=36),W(e.unmount)||(r=37);var o=U(e);if(r){var i;try{i=JSON.stringify(e)}catch(t){}return console.error(P(r,!1,o,R(t),i),e),g(void 0,t,D),t}return e.devtools&&e.devtools.overlays&&(t.devtools.overlays=H({},t.devtools.overlays,e.devtools.overlays)),t.status=T,t.bootstrap=F(e,"bootstrap"),t.mount=F(e,"mount"),t.unmount=F(e,"unmount"),t.unload=F(e,"unload"),t.timeouts=ct(e.timeouts),delete t.loadPromise,t}))})).catch((function(e){var r;return delete t.loadPromise,n?r=D:(r=k,t.loadErrorTime=(new Date).getTime()),g(e,t,r),t})));var e,n}))}var ft,lt="undefined"!=typeof window,pt={hashchange:[],popstate:[]},ht=["hashchange","popstate"];function dt(t){var 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(P(14,!1));e=t.currentTarget.href,t.preventDefault()}var n=bt(window.location.href),r=bt(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 vt(t){var e=this;if(t){var n=t[0].type;ht.indexOf(n)>=0&&pt[n].forEach((function(n){try{n.apply(e,t)}catch(t){setTimeout((function(){throw t}))}}))}}function mt(){Vt([],arguments)}function yt(t,e){return function(){var n=window.location.href,r=t.apply(this,arguments),o=window.location.href;return ft&&n===o||(Kt()?window.dispatchEvent(function(t,e){var n;try{n=new PopStateEvent("popstate",{state:t})}catch(e){(n=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,t)}return n.singleSpa=!0,n.singleSpaTrigger=e,n}(window.history.state,e)):Vt([])),r}}if(lt){window.addEventListener("hashchange",mt),window.addEventListener("popstate",mt);var wt=window.addEventListener,gt=window.removeEventListener;window.addEventListener=function(t,e){if("function"!=typeof e||0>ht.indexOf(t)||B(pt[t],(function(t){return t===e})))return wt.apply(this,arguments);pt[t].push(e)},window.removeEventListener=function(t,e){if("function"!=typeof e||0>ht.indexOf(t))return gt.apply(this,arguments);pt[t]=pt[t].filter((function(t){return t!==e}))},window.history.pushState=yt(window.history.pushState,"pushState"),window.history.replaceState=yt(window.history.replaceState,"replaceState"),window.singleSpaNavigate?console.warn(P(41,!1)):window.singleSpaNavigate=dt}function bt(t){var e=document.createElement("a");return e.href=t,e}var Et=!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&&!Et){var e=t.fn.on,n=t.fn.off;t.fn.on=function(t,n){return Ot.call(this,e,window.addEventListener,t,n,arguments)},t.fn.off=function(t,e){return Ot.call(this,n,window.removeEventListener,t,e,arguments)},Et=!0}}function Ot(t,e,n,r,o){return"string"!=typeof n?t.apply(this,o):(n.split(/\s+/).forEach((function(t){ht.indexOf(t)>=0&&(e(t,r),n=n.replace(t,""))})),""===n.trim()?this:t.apply(this,o))}var xt={};function St(t){return Promise.resolve().then((function(){var e=xt[R(t)];if(!e)return t;if(t.status===x)return Tt(t,e),t;if("UNLOADING"===t.status)return e.promise.then((function(){return t}));if(t.status!==M&&t.status!==k)return t;var n=t.status===k?Promise.resolve():ut(t,"unload");return t.status="UNLOADING",n.then((function(){return Tt(t,e),t})).catch((function(n){return function(t,e,n){delete xt[R(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,g(n,t,D),e.reject(n)}(t,e,n),t}))}))}function Tt(t,e){delete xt[R(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=x,e.resolve()}function _t(t,e,n,r){xt[R(t)]={app:t,resolve:n,reject:r},Object.defineProperty(xt[R(t)],"promise",{get:e})}function Mt(t){return xt[t]}var At=[];function jt(){var t=[],e=[],n=[],r=[],o=(new Date).getTime();return At.forEach((function(i){var a=i.status!==D&&C(i);switch(i.status){case k:a&&o-i.loadErrorTime>=200&&n.push(i);break;case x:case S:a&&n.push(i);break;case T:case M:!a&&Mt(R(i))?t.push(i):a&&r.push(i);break;case j:a||e.push(i)}})),{appsToUnload:t,appsToUnmount:e,appsToLoad:n,appsToMount:r}}function Lt(){return At.filter(I).map(R)}function Nt(){return At.map(R)}function kt(t){var e=B(At,(function(e){return R(e)===t}));return e?e.status:null}function Dt(t,e,n,r){var o=function(t,e,n,r){var o,i={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"===d(t)?(function(t){if(Array.isArray(t)||null===t)throw Error(P(39,!1));var e=["name","app","activeWhen","customProps"],n=Object.keys(t).reduce((function(t,n){return 0>e.indexOf(n)?t.concat(n):t}),[]);if(0!==n.length)throw Error(P(38,!1,e.join(", "),n.join(", ")));if("string"!=typeof t.name||0===t.name.length)throw Error(P(20,!1));if("object"!==d(t.app)&&"function"!=typeof t.app)throw Error(P(20,!1));var r=function(t){return"string"==typeof t||"function"==typeof t};if(!(r(t.activeWhen)||Array.isArray(t.activeWhen)&&t.activeWhen.every(r)))throw Error(P(24,!1));if(!Ut(t.customProps))throw Error(P(22,!1))}(t),i.name=t.name,i.loadApp=t.app,i.activeWhen=t.activeWhen,i.customProps=t.customProps):(function(t,e,n,r){if("string"!=typeof t||0===t.length)throw Error(P(20,!1));if(!e)throw Error(P(23,!1));if("function"!=typeof n)throw Error(P(24,!1));if(!Ut(r))throw Error(P(22,!1))}(t,e,n,r),i.name=t,i.loadApp=e,i.activeWhen=n,i.customProps=r),i.loadApp="function"!=typeof(o=i.loadApp)?function(){return Promise.resolve(o)}:o,i.customProps=function(t){return t||{}}(i.customProps),i.activeWhen=function(t){var e=Array.isArray(t)?t:[t];return e=e.map((function(t){return"function"==typeof t?t:Ht(t)})),function(t){return e.some((function(e){return e(t)}))}}(i.activeWhen),i}(t,e,n,r);if(-1!==Nt().indexOf(o.name))throw Error(P(21,!1,o.name));At.push(H({loadErrorTime:null,status:x,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},o)),lt&&(Pt(),Vt())}function It(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location;return At.filter((function(e){return e.activeWhen(t)})).map(R)}function Ct(t){if(0===At.filter((function(e){return R(e)===t})).length)throw Error(P(25,!1,t));return Rt(t).then((function(){var e=At.map(R).indexOf(t);At.splice(e,1)}))}function Rt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof t)throw Error(P(26,!1));var n=B(At,(function(e){return R(e)===t}));if(!n)throw Error(P(27,!1,t));var r,o=Mt(R(n));if(e&&e.waitForUnmount){if(o)return o.promise;var i=new Promise((function(t,e){_t(n,(function(){return i}),t,e)}));return i}return o?(r=o.promise,Gt(n,o.resolve,o.reject)):r=new Promise((function(t,e){_t(n,(function(){return r}),t,e),Gt(n,t,e)})),r}function Gt(t,e,n){Y(t).then(St).then((function(){e(),setTimeout((function(){Vt()}))})).catch(n)}function Ut(t){return!t||"function"==typeof t||"object"===d(t)&&null!==t&&!Array.isArray(t)}function Ht(t,e){var n=function(t,e){var n=0,r=!1,o="^";"/"!==t[0]&&(t="/"+t);for(var i=0;t.length>i;i++){var a=t[i];(!r&&":"===a||r&&"/"===a)&&u(i)}return u(t.length),RegExp(o,"i");function u(i){var a=t.slice(n,i).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(o+=r?"[^/]+/?":a,i===t.length)if(r)e&&(o+="$");else{var u=e?"":".*";o="/"===o.charAt(o.length-1)?"".concat(o).concat(u,"$"):"".concat(o,"(/").concat(u,")?(#.*)?$")}r=!r,n=i}}(t,e);return function(t){var e=t.origin;e||(e="".concat(t.protocol,"//").concat(t.host));var r=t.href.replace(e,"").replace(t.search,"").split("?")[0];return n.test(r)}}var Bt=!1,Wt=[],Ft=lt&&window.location.href;function $t(){return Vt()}function Vt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1?arguments[1]:void 0;if(Bt)return new Promise((function(t,n){Wt.push({resolve:t,reject:n,eventArguments:e})}));var n,r=jt(),o=r.appsToUnload,i=r.appsToUnmount,a=r.appsToLoad,u=r.appsToMount,c=!1,s=Ft,f=Ft=window.location.href;return Kt()?(Bt=!0,n=o.concat(a,i,u),Promise.resolve().then((function(){if(window.dispatchEvent(new y(0===n.length?"single-spa:before-no-app-change":"single-spa:before-app-change",d(!0))),window.dispatchEvent(new y("single-spa:before-routing-event",d(!0,{cancelNavigation:l}))),c)return window.dispatchEvent(new y("single-spa:before-mount-routing-event",d(!0))),p(),void dt(s);var e=o.map(St),r=i.map(Y).map((function(t){return t.then(St)})).concat(e),f=Promise.all(r);f.then((function(){window.dispatchEvent(new y("single-spa:before-mount-routing-event",d(!0)))}));var v=a.map((function(t){return st(t).then((function(t){return Yt(t,f)}))})),m=u.filter((function(t){return 0>a.indexOf(t)})).map((function(t){return Yt(t,f)}));return f.catch((function(t){throw h(),t})).then((function(){return h(),Promise.all(v.concat(m)).catch((function(e){throw t.forEach((function(t){return t.reject(e)})),e})).then(p)}))}))):(n=a,Promise.resolve().then((function(){var t=a.map(st);return Promise.all(t).then(h).then((function(){return[]})).catch((function(t){throw h(),t}))})));function l(){c=!0}function p(){var e=Lt();t.forEach((function(t){return t.resolve(e)}));try{window.dispatchEvent(new y(0===n.length?"single-spa:no-app-change":"single-spa:app-change",d())),window.dispatchEvent(new y("single-spa:routing-event",d()))}catch(t){setTimeout((function(){throw t}))}if(Bt=!1,Wt.length>0){var r=Wt;Wt=[],Vt(r)}return e}function h(){t.forEach((function(t){vt(t.eventArguments)})),vt(e)}function d(){var t,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],l=arguments.length>1?arguments[1]:void 0,p={},h=(v(t={},j,[]),v(t,M,[]),v(t,x,[]),v(t,D,[]),t);r?(a.concat(u).forEach((function(t,e){m(t,j)})),o.forEach((function(t){m(t,x)})),i.forEach((function(t){m(t,M)}))):n.forEach((function(t){m(t)}));var d={detail:{newAppStatuses:p,appsByNewStatus:h,totalAppChanges:n.length,originalEvent:null==e?void 0:e[0],oldUrl:s,newUrl:f,navigationIsCanceled:c}};return l&&H(d.detail,l),d;function m(t,e){var n=R(t);e=e||kt(n),p[n]=e,(h[e]=h[e]||[]).push(n)}}}function Yt(t,e){return C(t)?V(t).then((function(t){return e.then((function(){return C(t)?K(t):t}))})):e.then((function(){return t}))}var qt=!1;function Jt(t){qt=!0,t&&t.urlRerouteOnly&&(ft=t.urlRerouteOnly),lt&&Vt()}function Kt(){return qt}function zt(t){return zt="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},zt(t)}lt&&setTimeout((function(){qt||console.warn(P(1,!1))}),5e3),lt&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods={getRawAppData:function(){return[].concat(At)},reroute:Vt,NOT_LOADED:x,toLoadPromise:st,toBootstrapPromise:V,unregisterApplication:Ct});var Qt=Object.assign;function Zt(t){return Zt="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},Zt(t)}function Xt(t){return function(t){if(Array.isArray(t))return te(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return te(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return te(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function te(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);e>n;n++)r[n]=t[n];return r}function ee(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ne(r.key),r)}}function ne(t){var e=function(t,e){if("object"!==Zt(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==Zt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Zt(e)?e:e+""}var re=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"HUI";!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.level="info",this.tagName=n,this.levels.forEach((function(t,n){var r,o,i;Qt(e,(r={},i=function(){var e=this,r=window.navigator.userAgent.toLowerCase(),o=null!==r.match(/msie/)||null!==r.match(/trident/),i=this.levels.findIndex((function(t){return t===e.level}));if(!o&&n>=i){for(var a=arguments.length,u=Array(a),c=0;a>c;c++)u[c]=arguments[c];console[t].apply(this,this._handleContent(t,u))}},(o=ne(o=t))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i,r))}))}var e,n,r;return e=t,n=[{key:"levels",get:function(){return["trace","debug","info","warn","error"]}},{key:"_handleContent",value:function(t,e){var n=function(t,e){var n=e,r={"M+":t.getMonth()+1,"d+":t.getDate(),"H+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds(),"q+":Math.floor((t.getMonth()+3)/3),S:t.getMilliseconds()};for(var o in/(y+)/.test(n)&&(n=n.replace(RegExp.$1,(t.getFullYear()+"").substr(4-RegExp.$1.length))),r)RegExp("("+o+")").test(n)&&(n=n.replace(RegExp.$1,1==RegExp.$1.length?r[o]:("00"+r[o]).substr((r[o]+"").length)));return n}(new Date,"yyyy-MM-dd HH:mm:ss.S"),r=t.toUpperCase(),o="[".concat(this.tagName,"] [").concat(n,"] [").concat(r,"]");return[e.reduce((function(t,e){return function(t){return"[object Number]"===Object.prototype.toString.call(t)}(e)?t+" %d":function(t){var e=zt(t);return null!==t&&("object"==e||"function"==e)}(e)?t+" %o":t+" %s"}),o)].concat(Xt(e))}},{key:"setLevel",value:function(t){this.levels.includes(t)&&(this.level=t)}}],n&&ee(e.prototype,n),r&&ee(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function oe(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t,e)||l(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var ie,ae,ue,ce="undefined"!=typeof navigator&&-1!==navigator.userAgent.indexOf("Trident");function se(t,e){if(!t.hasOwnProperty(e)||!isNaN(e)&&t.length>e)return!0;if(!ce)return!1;try{return t[e]&&"undefined"!=typeof window&&t[e].parent===window}catch(t){return!0}}function fe(t){var e=t.indexOf(">")+1,n=t.lastIndexOf("<");return t.substring(e,n)}function le(t){if("object"===n(t))return"/";try{var e=new URL(t,location.href),r=e.origin,o=e.pathname.split("/");return o.pop(),"".concat(r).concat(o.join("/"),"/")}catch(t){return console.warn(t),""}}var pe=window.requestIdleCallback||function(t){var e=Date.now();return setTimeout((function(){t({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-e))}})}),1)};var he={};var de=/(<script[\s\S]*?>)[\s\S]*?<\/script>/gi,ve=/<(script)\s+((?!type=('|")text\/ng\x2Dtemplate\3)[\s\S])*?>[\s\S]*?<\/\1>/i,me=/.*\ssrc=('|")?([^>'"\s]+)/,ye=/.*\stype=('|")?([^>'"\s]+)/,we=/.*\sentry\s*.*/,ge=/.*\sasync\s*.*/,be=/.*\snomodule\s*.*/,Ee=/.*\stype=('|")?module('|")?\s*.*/,Pe=/<(link)\s+[\s\S]*?>/gi,Oe=/\srel=('|")?(preload|prefetch)\1/,xe=/.*\shref=('|")?([^>'"\s]+)/,Se=/.*\sas=('|")?font\1.*/,Te=/<style[^>]*>[\s\S]*?<\/style>/gi,_e=/\s+rel=('|")?stylesheet\1.*/,Me=/.*\shref=('|")?([^>'"\s]+)/,Ae=/<!--([\s\S]*?)-->/g,je=/<link(\s+|\s+[\s\S]+\s+)ignore(\s*|\s+[\s\S]*|=[\s\S]*)>/i,Le=/<style(\s+|\s+[\s\S]+\s+)ignore(\s*|\s+[\s\S]*|=[\s\S]*)>/i,Ne=/<script(\s+|\s+[\s\S]+\s+)ignore(\s*|\s+[\s\S]*|=[\s\S]*)>/i;function ke(t){return t.startsWith("//")||t.startsWith("http://")||t.startsWith("https://")}function De(t,e){return""+new URL(t,e)}var Ie=function(t){return"\x3c!-- ".concat(arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"prefetch/preload":""," link ").concat(t," replaced by import-html-entry --\x3e")},Ce=function(t){return"\x3c!-- ".concat(arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"async":""," script ").concat(t," replaced by import-html-entry --\x3e")},Re="\x3c!-- inline scripts replaced by import-html-entry --\x3e",Ge=function(t){return"\x3c!-- ignore asset ".concat(t||"file"," replaced by import-html-entry --\x3e")},Ue=function(t,e){return"\x3c!-- ".concat(e?"nomodule":"module"," script ").concat(t," ignored by import-html-entry --\x3e")};function He(t,e,n){var r=[],o=[],i=null,a="noModule"in document.createElement("script"),u={template:t.replace(Ae,"").replace(Pe,(function(t){if(!!t.match(_e)){var n=t.match(Me),r=t.match(je);if(n){var i=n&&n[2],a=i;return i&&!ke(i)&&(a=De(i,e)),r?Ge(a):(o.push(a),Ie(a))}}if(t.match(Oe)&&t.match(xe)&&!t.match(Se)){var u=oe(t.match(xe),3);return Ie(u[2],!0)}return t})).replace(Te,(function(t){return Le.test(t)?Ge("style file"):t})).replace(de,(function(t,n){var o,u=n.match(Ne),c=a&&!!n.match(be)||!a&&!!n.match(Ee),s=n.match(ye);if((o=s&&s[2])&&-1===["text/javascript","module","application/javascript","text/ecmascript","application/ecmascript"].indexOf(o))return t;if(ve.test(t)&&n.match(me)){var f=n.match(we),l=n.match(me),p=l&&l[2];if(i&&f)throw new SyntaxError("You should not set multiply entry script!");if(p&&!ke(p)&&(p=De(p,e)),i=i||f&&p,u)return Ge(p||"js file");if(c)return Ue(p||"js file",a);if(p){var h=!!n.match(ge);return r.push(h?{async:!0,src:p}:p),Ce(p,h)}return t}return u?Ge("js file"):c?Ue("js file",a):(fe(t).split(/[\r\n]+/).every((function(t){return!t.trim()||t.trim().startsWith("//")}))||r.push(t),Re)})),scripts:r=r.filter((function(t){return!!t})),styles:o,entry:i||r[r.length-1]};return"function"==typeof n&&(u=n(u)),u}function Be(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function We(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Be(Object(n),!0).forEach((function(e){o(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Be(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Fe={},$e={},Ve={};if(!window.fetch)throw Error('[import-html-entry] Here is no "fetch" on the window env, you need to polyfill it');var Ye=window.fetch.bind(window);function qe(t){return t}function Je(t,e){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).fetch,r=t;return ze(e,void 0===n?Ye:n).then((function(t){return r=e.reduce((function(e,n,r){return e=e.replace(Ie(n),Ke(n)?"".concat(n):"<style>/* ".concat(n," */").concat(t[r],"</style>"))}),r),r}))}var Ke=function(t){return t.startsWith("<")};function ze(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ye;return Promise.all(t.map((function(t){return Ke(t)?fe(t):Fe[t]||(Fe[t]=e(t).then((function(t){return t.text()})))})))}function Qe(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ye,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=function(t){return $e[t]||($e[t]=e(t).then((function(e){if(e.status>=400)throw n(),Error("".concat(t," load failed with status ").concat(e.status));return e.text()})).catch((function(t){throw n(),t})))};return Promise.all(t.map((function(t){if("string"==typeof t)return Ke(t)?fe(t):r(t);var e=t.src;return t.async?{src:e,async:!0,content:new Promise((function(t,n){return pe((function(){return r(e).then(t,n)}))}))}:r(e)})))}function Ze(t,e){setTimeout((function(){throw console.error(e),t}))}function Xe(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=r.fetch,i=r.strictGlobal,a=void 0!==i&&i,u=r.success,c=r.error,s=r.beforeExec,f=void 0===s?function(){}:s,l=r.afterExec,p=void 0===l?function(){}:l,h=r.scopedGlobalVariables,d=void 0===h?[]:h;return Qe(e,void 0===o?Ye:o,void 0===c?function(){}:c).then((function(r){var o=function(t,e){var r=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.proxy,o=n.strictGlobal,i=n.scopedGlobalVariables,a=void 0===i?[]:i,u=Ke(t)?"":"//# sourceURL=".concat(t,"\n"),c=a.length?a.join(","):"";return(0,eval)("window").proxy=r,o?c?";with(window.proxy){(function(".concat(c,"){;").concat(e,"\n").concat(u,"}).bind(window)(").concat(c,")};"):";(function(window, self, globalThis){with(window){;".concat(e,"\n").concat(u,"}}).bind(window.proxy)(window.proxy, window.proxy, window.proxy);"):";(function(window, self, globalThis){;".concat(e,"\n").concat(u,"}).bind(window.proxy)(window.proxy, window.proxy, window.proxy);")}(t,f(e,t)||e,{proxy:n,strictGlobal:a,scopedGlobalVariables:d});!function(t,e){var n=t;he[n]||(he[n]=(0,eval)("(function(){".concat(e,"})"))),he[n].call(window)}(t,r),p(e,t)};function i(e,r,i){if(e===t){!function(t){for(var e in ie=ae=void 0,t)se(t,e)||(ie?ae||(ae=e):ie=e,ue=e)}(a?n:window);try{o(e,r);var u=n[function(t){var e,n=0,r=!1;for(var o in t)if(!se(t,o)){for(var i=0;i<window.frames.length&&!r;i++)if(window.frames[i]===t[o]){r=!0;break}if(!r&&(0===n&&o!==ie||1===n&&o!==ae))return o;n++,e=o}if(e!==ue)return e}(a?n:window)]||{};i(u)}catch(t){throw console.error("[import-html-entry]: error occurs while executing entry script ".concat(e)),t}}else if("string"==typeof r)try{o(e,r)}catch(t){Ze(t,"[import-html-entry]: error occurs while executing normal script ".concat(e))}else r.async&&(null==r||r.content.then((function(t){return o(r.src,t)})).catch((function(t){Ze(t,"[import-html-entry]: error occurs while executing async script ".concat(r.src))})))}function c(n,o){e.length>n&&(i(e[n],r[n],o),t||n!==e.length-1?c(n+1,o):o())}return new Promise((function(t){return c(0,u||t)}))}))}function tn(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Ye,r=!1,o=le,i=qe,a=e.postProcessTemplate;return"function"==typeof e?n=e:(e.fetch&&("function"==typeof e.fetch?n=e.fetch:(n=e.fetch.fn||Ye,r=!!e.fetch.autoDecodeResponse)),o=e.getPublicPath||e.getDomain||le,i=e.getTemplate||qe),Ve[t]||(Ve[t]=n(t).then((function(t){return function(t,e){if(!e)return t.text();if(!t.headers)return t.text();var n=t.headers.get("Content-Type");if(!n)return t.text();var r="utf-8",o=n.split(";");if(2===o.length){var i=oe(o[1].split("="),2)[1],a=i&&i.trim();a&&(r=a)}return"UTF-8"===r.toUpperCase()?t.text():t.blob().then((function(t){return new Promise((function(e,n){var o=new window.FileReader;o.onload=function(){e(o.result)},o.onerror=n,o.readAsText(t,r)}))}))}(t,r)})).then((function(e){var r=o(t),u=He(i(e),r,a),c=u.scripts,s=u.entry,f=u.styles;return Je(u.template,f,{fetch:n}).then((function(t){return{template:t,assetPublicPath:r,getExternalScripts:function(){return Qe(c,n)},getExternalStyleSheets:function(){return ze(f,n)},execScripts:function(t,e){return c.length?Xe(s,c,t,We({fetch:n,strictGlobal:e},arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})):Promise.resolve()}}}))})))}function en(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.fetch,o=void 0===r?Ye:r,i=n.getTemplate,a=void 0===i?qe:i,u=n.postProcessTemplate,c=n.getPublicPath||n.getDomain||le;if(!t)throw new SyntaxError("entry should not be empty!");if("string"==typeof t)return tn(t,{fetch:o,getPublicPath:c,getTemplate:a,postProcessTemplate:u});if(Array.isArray(t.scripts)||Array.isArray(t.styles)){var s=t.scripts,f=void 0===s?[]:s,l=t.styles,p=void 0===l?[]:l,h=t.html;return Je(a(function(t){return f.reduce((function(t,e){return"".concat(t).concat(Ce(e))}),t)}((e=void 0===h?"":h,p.reduceRight((function(t,e){return"".concat(Ie(e)).concat(t)}),e)))),p,{fetch:o}).then((function(e){return{template:e,assetPublicPath:c(t),getExternalScripts:function(){return Qe(f,o)},getExternalStyleSheets:function(){return ze(p,o)},execScripts:function(t,e){return f.length?Xe(f[f.length-1],f,t,We({fetch:o,strictGlobal:e},arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})):Promise.resolve()}}}))}throw new SyntaxError("entry scripts or styles should be array!")}var nn,rn={},on={};function an(t,n){Object.keys(on).forEach((function(r){on[r]instanceof Function&&on[r](e.cloneDeep(t),e.cloneDeep(n))}))}function un(t,n){return{onGlobalStateChange:function(n,r){if(n instanceof Function){if(on[t]&&console.warn("[hui] '".concat(t,"' global listener already exists before this, new listener will overwrite it.")),on[t]=n,r){var o=e.cloneDeep(rn);n(o,o)}}else console.error("[hui] callback must be function!")},setGlobalState:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t===rn)return console.warn("[hui] state has not changed!"),!1;var r=[],i=e.cloneDeep(rn);return rn=e.cloneDeep(Object.keys(t).reduce((function(e,i){return n||e.hasOwnProperty(i)?(r.push(i),Object.assign(e,o({},i,t[i]))):(console.warn("[hui] '".concat(i,"' not declared when init state!")),e)}),rn)),0===r.length?(console.warn("[hui] state has not changed!"),!1):(an(rn,i),!0)},offGlobalStateChange:function(){return delete on[t],!0}}}function cn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function sn(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function fn(t,e,n){return e&&sn(t.prototype,e),n&&sn(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function ln(t){return Array.isArray(t)?t:[t]}!function(t){t.Proxy="Proxy",t.Snapshot="Snapshot",t.LegacyProxy="LegacyProxy"}(nn||(nn={}));var pn=new WeakMap;var hn="function"==typeof document.all&&void 0===document.all,dn=new WeakMap,vn=function(t){if(dn.has(t))return!0;var e=hn?"function"==typeof t&&void 0!==t:"function"==typeof t;return e&&dn.set(t,e),e},mn=new WeakMap;function yn(t){var n=null!=t?t:{},r=n.mount,o=n.unmount;return e.isFunction(n.bootstrap)&&e.isFunction(r)&&e.isFunction(o)}var wn=fn((function t(){var e=this;cn(this,t),this.promise=void 0,this.resolve=void 0,this.reject=void 0,this.promise=new Promise((function(t,n){e.resolve=t,e.reject=n}))}));function gn(t){return"string"==typeof t?document.querySelector(t):t}var bn=Function("return this")();function En(t){bn.__currentRunningSandboxProxy__=t}Object.defineProperty(bn,"__currentRunningSandboxProxy__",{enumerable:!1,writable:!0});var Pn=new WeakMap;function On(t,e){if(vn(e)&&!function(t){if(mn.has(t))return mn.get(t);var e=0===t.name.indexOf("bound ")&&!t.hasOwnProperty("prototype");return mn.set(t,e),e}(e)&&!function(t){var e=t.prototype&&t.prototype.constructor===t&&Object.getOwnPropertyNames(t.prototype).length>1;if(e)return!0;if(pn.has(t))return pn.get(t);var n=e;if(!n){var r=""+t;n=/^function\b\s[A-Z].*/.test(r)||/^class\b/.test(r)}return pn.set(t,n),n}(e)){var n=Pn.get(e);if(n)return n;var r=Function.prototype.bind.call(e,t);for(var o in e)r[o]=e[o];return e.hasOwnProperty("prototype")&&!r.hasOwnProperty("prototype")&&Object.defineProperty(r,"prototype",{value:e.prototype,enumerable:!1,writable:!0}),Pn.set(e,r),r}return e}function xn(t,e,r){void 0===e&&r?delete window[t]:function(t,e){var n=Object.getOwnPropertyDescriptor(t,e);return!n||n.configurable}(window,t)&&"symbol"!==n(t)&&(Object.defineProperty(window,t,{writable:!0,configurable:!0}),window[t]=e)}var Sn=function(){function t(e){var n=this;cn(this,t),this.addedPropsMapInSandbox=new Map,this.modifiedPropsOriginalValueMapInSandbox=new Map,this.currentUpdatedPropsValueMap=new Map,this.name=void 0,this.proxy=void 0,this.type=void 0,this.sandboxRunning=!0,this.latestSetProp=null,this.name=e,this.type=nn.LegacyProxy;var r=this.addedPropsMapInSandbox,o=this.modifiedPropsOriginalValueMapInSandbox,i=this.currentUpdatedPropsValueMap,a=window,u=function(t,e,u){var c=3>=arguments.length||void 0===arguments[3]||arguments[3];return!n.sandboxRunning||(a.hasOwnProperty(t)?o.has(t)||o.set(t,u):r.set(t,e),i.set(t,e),c&&(a[t]=e),n.latestSetProp=t,!0)},c=new Proxy(Object.create(null),{set:function(t,e,n){return u(e,n,a[e],!0)},get:function(t,e){return"top"===e||"parent"===e||"window"===e||"self"===e?c:On(a,a[e])},has:function(t,e){return e in a},getOwnPropertyDescriptor:function(t,e){var n=Object.getOwnPropertyDescriptor(a,e);return n&&!n.configurable&&(n.configurable=!0),n},defineProperty:function(t,e,n){var r=a[e],o=Reflect.defineProperty(a,e,n);return u(e,a[e],r,!1),o}});this.proxy=c}return fn(t,[{key:"active",value:function(){this.sandboxRunning||this.currentUpdatedPropsValueMap.forEach((function(t,e){return xn(e,t)})),this.sandboxRunning=!0}},{key:"inactive",value:function(){this.modifiedPropsOriginalValueMapInSandbox.forEach((function(t,e){return xn(e,t)})),this.addedPropsMapInSandbox.forEach((function(t,e){return xn(e,void 0,!0)})),this.sandboxRunning=!1}}]),t}(),Tn={prefetch:!1,singular:!0,strictGlobal:!0,$$syncOnly:!1,logger:null},_n=HTMLHeadElement.prototype.appendChild,Mn=HTMLHeadElement.prototype.removeChild,An=HTMLBodyElement.prototype.appendChild,jn=HTMLBodyElement.prototype.removeChild,Ln=HTMLHeadElement.prototype.insertBefore,Nn=HTMLElement.prototype.removeChild,kn="SCRIPT",Dn="LINK",In="STYLE";function Cn(t){return(null==t?void 0:t.toUpperCase())===Dn||(null==t?void 0:t.toUpperCase())===In||(null==t?void 0:t.toUpperCase())===kn}function Rn(t){var e,n;return!t.textContent&&((null===(e=t.sheet)||void 0===e?void 0:e.cssRules.length)||(null===(n=Fn(t))||void 0===n?void 0:n.length))}function Gn(t,e){return Object.defineProperties(t,{srcElement:{get:e},target:{get:e}}),t}var Un=new WeakMap,Hn=new WeakMap,Bn=new WeakMap;function Wn(t){t.forEach((function(t){t instanceof HTMLStyleElement&&Rn(t)&&t.sheet&&Un.set(t,t.sheet.cssRules)}))}function Fn(t){return Un.get(t)}function $n(t){return function(n,r){var o=n,i=t.rawDOMAppendOrInsertBefore,a=t.isInvokedByMicroApp,u=t.containerConfigGetter;if(!Cn(o.tagName)||!a(o))return i.call(this,o,r);if(o.tagName){var c=u(o),s=c.appWrapperGetter,f=c.proxy,l=c.strictGlobal,p=c.dynamicStyleSheetElements,h=c.excludeAssetFilter;switch(o.tagName){case Dn:case In:var d=n,v=d.href;if(h&&v&&h(v))return i.call(this,o,r);var m=s();p.push(d);var y=m.contains(r)?r:null;return i.call(m,d,y);case kn:var w=o.src,g=o.text;if(h&&w&&h(w))return i.call(this,o,r);var b=s(),E=Tn.fetch,P=b.contains(r)?r:null;if(w){Xe(null,[w],f,{fetch:E,strictGlobal:l,beforeExec:function(){var t;(!(t=Object.getOwnPropertyDescriptor(document,"currentScript"))||t.configurable)&&Object.defineProperty(document,"currentScript",{get:function(){return o},configurable:!0})},success:function(){!function(t){var n=Gn(new CustomEvent("load"),(function(){return t}));e.isFunction(t.onload)?t.onload(n):t.dispatchEvent(n)}(o),o=null},error:function(){!function(t){var n=Gn(new CustomEvent("error"),(function(){return t}));e.isFunction(t.onerror)?t.onerror(n):t.dispatchEvent(n)}(o),o=null}});var O=document.createComment("dynamic script ".concat(w," replaced by hui"));return Hn.set(o,O),i.call(b,O,P)}Xe(null,["<script>".concat(g,"<\/script>")],f,{strictGlobal:l});var x=document.createComment("dynamic inline script replaced by by hui");return Hn.set(o,x),i.call(b,x,P)}}return i.ca