@openmrs/esm-extensions 3.2.1-pre.986 → 3.3.1-pre.1177
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +17 -0
- package/__mocks__/openmrs-esm-config.mock.tsx +1 -1
- package/dist/openmrs-esm-extensions.js +1 -1
- package/dist/openmrs-esm-extensions.js.map +1 -1
- package/jest.config.js +3 -2
- package/package.json +5 -5
- package/src/extensions.test.ts +10 -0
- package/src/extensions.ts +95 -25
- package/src/index.ts +0 -1
- package/src/public.ts +20 -0
- package/src/render.ts +22 -14
- package/src/store.ts +25 -31
- package/webpack.config.js +1 -1
- package/.babelrc +0 -7
- package/src/contexts.ts +0 -28
- package/src/setup-tests.js +0 -7
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
@openmrs/esm-extensions:build: cache hit, replaying output a984a82b1b0637a4
|
|
2
|
+
@openmrs/esm-extensions:build: $ webpack --mode=production
|
|
3
|
+
@openmrs/esm-extensions:build: asset [1m[32mopenmrs-esm-extensions.js[39m[22m 22.5 KiB [1m[32m[emitted][39m[22m [1m[32m[minimized][39m[22m (name: main) 1 related asset
|
|
4
|
+
@openmrs/esm-extensions:build: orphan modules 88 KiB [1m[33m[orphan][39m[22m 93 modules
|
|
5
|
+
@openmrs/esm-extensions:build: runtime modules 1.76 KiB 6 modules
|
|
6
|
+
@openmrs/esm-extensions:build: built modules 91.8 KiB [1m[33m[built][39m[22m
|
|
7
|
+
@openmrs/esm-extensions:build: cacheable modules 91.7 KiB
|
|
8
|
+
@openmrs/esm-extensions:build: modules by path [1m../../../node_modules/systemjs-webpack-interop/auto-public-path/*.js[39m[22m 935 bytes
|
|
9
|
+
@openmrs/esm-extensions:build: [1m../../../node_modules/systemjs-webpack-interop/auto-public-path/1.js[39m[22m 89 bytes [1m[33m[built][39m[22m [1m[33m[code generated][39m[22m
|
|
10
|
+
@openmrs/esm-extensions:build: [1m../../../node_modules/systemjs-webpack-interop/auto-public-path/auto-public-path.js[39m[22m 846 bytes [1m[33m[built][39m[22m [1m[33m[code generated][39m[22m
|
|
11
|
+
@openmrs/esm-extensions:build: [1m./src/index.ts + 93 modules[39m[22m 88.4 KiB [1m[33m[built][39m[22m [1m[33m[code generated][39m[22m
|
|
12
|
+
@openmrs/esm-extensions:build: [1m../../../node_modules/systemjs-webpack-interop/public-path.js[39m[22m 2.36 KiB [1m[33m[built][39m[22m [1m[33m[code generated][39m[22m
|
|
13
|
+
@openmrs/esm-extensions:build: modules by path [1mexternal "@openmrs/[39m[22m 84 bytes
|
|
14
|
+
@openmrs/esm-extensions:build: [1mexternal "@openmrs/esm-config"[39m[22m 42 bytes [1m[33m[built][39m[22m [1m[33m[code generated][39m[22m
|
|
15
|
+
@openmrs/esm-extensions:build: [1mexternal "@openmrs/esm-state"[39m[22m 42 bytes [1m[33m[built][39m[22m [1m[33m[code generated][39m[22m
|
|
16
|
+
@openmrs/esm-extensions:build: [1mexternal "single-spa"[39m[22m 42 bytes [1m[33m[built][39m[22m [1m[33m[code generated][39m[22m
|
|
17
|
+
@openmrs/esm-extensions:build: webpack 5.70.0 compiled [1m[32msuccessfully[39m[22m in 6595 ms
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const
|
|
1
|
+
export const getExtensionSlotConfigs = jest.fn().mockResolvedValue({});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["@openmrs/esm-config","@openmrs/esm-state","single-spa"],(function(t,e){var n={},r={},o={};return{setters:[function(t){n.configExtensionStore=t.configExtensionStore,n.getExtensionSlotConfigStore=t.getExtensionSlotConfigStore,n.navigate=t.navigate},function(t){r.createGlobalStore=t.createGlobalStore,r.getGlobalStore=t.getGlobalStore,r.update=t.update},function(t){o.mountRootParcel=t.mountRootParcel}],execute:function(){t((()=>{var t={968:(t,e,n)=>{const r=n(577).R;e.s=function(t){if(t||(t=1),!n.y.meta||!n.y.meta.url)throw console.error("__system_context__",n.y),Error("systemjs-webpack-interop was provided an unknown SystemJS context. Expected context.meta.url, but none was provided");n.p=r(n.y.meta.url,t)}},577:(t,e,n)=>{e.R=function(t,e){var n=document.createElement("a");n.href=t;for(var r="/"===n.pathname[0]?n.pathname:"/"+n.pathname,o=0,s=r.length;o!==e&&s>=0;)"/"===r[--s]&&o++;if(o!==e)throw Error("systemjs-webpack-interop: rootDirectoryLevel ("+e+") is greater than the number of directories ("+o+") in the URL path "+t);var i=r.slice(0,s+1);return n.protocol+"//"+n.host+i};Number.isInteger},824:t=>{"use strict";t.exports=n},685:t=>{"use strict";t.exports=r},645:t=>{"use strict";t.exports=o}},s={};function i(e){var n=s[e];if(void 0!==n)return n.exports;var r=s[e]={exports:{}};return t[e](r,r.exports,i),r.exports}i.y=e,i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;i.g.importScripts&&(t=i.g.location+"");var e=i.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var n=e.getElementsByTagName("script");n.length&&(t=n[n.length-1].src)}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=t})();var a={};return(0,i(968).s)(1),(()=>{"use strict";i.r(a),i.d(a,{attach:()=>me,checkStatus:()=>Pe,checkStatusFor:()=>ze,detach:()=>je,detachAll:()=>xe,extensionStore:()=>$e,getAssignedExtensions:()=>Oe,getConnectedExtensions:()=>we,getCustomProps:()=>Ne,getExtensionInternalStore:()=>ce,getExtensionNameFromId:()=>ve,getExtensionRegistration:()=>ge,getExtensionRegistrationFrom:()=>ye,getExtensionStore:()=>fe,pushNavigationContext:()=>n,registerExtension:()=>_e,registerExtensionSlot:()=>Ee,renderExtension:()=>Te,reset:()=>Ae,switchTo:()=>e,updateInternalExtensionStore:()=>le});var t=i(824);function e(e,n,r){(0,t.navigate)({to:n})}function n(t){return()=>{}}const r=function(t,e){return t===e||t!=t&&e!=e},o=function(t,e){for(var n=t.length;n--;)if(r(t[n][0],e))return n;return-1};var s=Array.prototype.splice;function c(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}c.prototype.clear=function(){this.__data__=[],this.size=0},c.prototype.delete=function(t){var e=this.__data__,n=o(e,t);return!(n<0||(n==e.length-1?e.pop():s.call(e,n,1),--this.size,0))},c.prototype.get=function(t){var e=this.__data__,n=o(e,t);return n<0?void 0:e[n][1]},c.prototype.has=function(t){return o(this.__data__,t)>-1},c.prototype.set=function(t,e){var n=this.__data__,r=o(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};const u=c,l="object"==typeof global&&global&&global.Object===Object&&global;var f="object"==typeof self&&self&&self.Object===Object&&self;const p=l||f||Function("return this")(),d=p.Symbol;var h=Object.prototype,b=h.hasOwnProperty,v=h.toString,y=d?d.toStringTag:void 0;var g=Object.prototype.toString;var _=d?d.toStringTag:void 0;const m=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":_&&_ in Object(t)?function(t){var e=b.call(t,y),n=t[y];try{t[y]=void 0;var r=!0}catch(t){}var o=v.call(t);return r&&(e?t[y]=n:delete t[y]),o}(t):function(t){return g.call(t)}(t)},j=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},x=function(t){if(!j(t))return!1;var e=m(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},S=p["__core-js_shared__"];var w,O=(w=/[^.]+$/.exec(S&&S.keys&&S.keys.IE_PROTO||""))?"Symbol(src)_1."+w:"";var E=Function.prototype.toString;const A=function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""};var P=/^\[object .+?Constructor\]$/,z=Function.prototype,N=Object.prototype,I=z.toString,T=N.hasOwnProperty,$=RegExp("^"+I.call(T).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const k=function(t){return!(!j(t)||(e=t,O&&O in e))&&(x(t)?$:P).test(A(t));var e},M=function(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return k(n)?n:void 0},F=M(p,"Map"),R=M(Object,"create");var C=Object.prototype.hasOwnProperty;var L=Object.prototype.hasOwnProperty;function B(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}B.prototype.clear=function(){this.__data__=R?R(null):{},this.size=0},B.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},B.prototype.get=function(t){var e=this.__data__;if(R){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return C.call(e,t)?e[t]:void 0},B.prototype.has=function(t){var e=this.__data__;return R?void 0!==e[t]:L.call(e,t)},B.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=R&&void 0===e?"__lodash_hash_undefined__":e,this};const D=B,G=function(t,e){var n,r,o=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map};function U(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}U.prototype.clear=function(){this.size=0,this.__data__={hash:new D,map:new(F||u),string:new D}},U.prototype.delete=function(t){var e=G(this,t).delete(t);return this.size-=e?1:0,e},U.prototype.get=function(t){return G(this,t).get(t)},U.prototype.has=function(t){return G(this,t).has(t)},U.prototype.set=function(t,e){var n=G(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};const V=U;function W(t){var e=this.__data__=new u(t);this.size=e.size}W.prototype.clear=function(){this.__data__=new u,this.size=0},W.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},W.prototype.get=function(t){return this.__data__.get(t)},W.prototype.has=function(t){return this.__data__.has(t)},W.prototype.set=function(t,e){var n=this.__data__;if(n instanceof u){var r=n.__data__;if(!F||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new V(r)}return n.set(t,e),this.size=n.size,this};const q=W;function J(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new V;++e<n;)this.add(t[e])}J.prototype.add=J.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},J.prototype.has=function(t){return this.__data__.has(t)};const H=J,K=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1},Q=function(t,e,n,r,o,s){var i=1&n,a=t.length,c=e.length;if(a!=c&&!(i&&c>a))return!1;var u=s.get(t),l=s.get(e);if(u&&l)return u==e&&l==t;var f=-1,p=!0,d=2&n?new H:void 0;for(s.set(t,e),s.set(e,t);++f<a;){var h=t[f],b=e[f];if(r)var v=i?r(b,h,f,e,t,s):r(h,b,f,t,e,s);if(void 0!==v){if(v)continue;p=!1;break}if(d){if(!K(e,(function(t,e){if(i=e,!d.has(i)&&(h===t||o(h,t,n,r,s)))return d.push(e);var i}))){p=!1;break}}else if(h!==b&&!o(h,b,n,r,s)){p=!1;break}}return s.delete(t),s.delete(e),p},X=p.Uint8Array,Y=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n},Z=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n};var tt=d?d.prototype:void 0,et=tt?tt.valueOf:void 0;const nt=Array.isArray;var rt=Object.prototype.propertyIsEnumerable,ot=Object.getOwnPropertySymbols;const st=ot?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var n=-1,r=null==t?0:t.length,o=0,s=[];++n<r;){var i=t[n];e(i,n,t)&&(s[o++]=i)}return s}(ot(t),(function(e){return rt.call(t,e)})))}:function(){return[]},it=function(t){return null!=t&&"object"==typeof t},at=function(t){return it(t)&&"[object Arguments]"==m(t)};var ct=Object.prototype,ut=ct.hasOwnProperty,lt=ct.propertyIsEnumerable,ft=at(function(){return arguments}())?at:function(t){return it(t)&&ut.call(t,"callee")&&!lt.call(t,"callee")};const pt=ft;var dt="object"==typeof exports&&exports&&!exports.nodeType&&exports,ht=dt&&"object"==typeof module&&module&&!module.nodeType&&module,bt=ht&&ht.exports===dt?p.Buffer:void 0;const vt=(bt?bt.isBuffer:void 0)||function(){return!1};var yt=/^(?:0|[1-9]\d*)$/;const gt=function(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&yt.test(t))&&t>-1&&t%1==0&&t<e},_t=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991};var mt={};mt["[object Float32Array]"]=mt["[object Float64Array]"]=mt["[object Int8Array]"]=mt["[object Int16Array]"]=mt["[object Int32Array]"]=mt["[object Uint8Array]"]=mt["[object Uint8ClampedArray]"]=mt["[object Uint16Array]"]=mt["[object Uint32Array]"]=!0,mt["[object Arguments]"]=mt["[object Array]"]=mt["[object ArrayBuffer]"]=mt["[object Boolean]"]=mt["[object DataView]"]=mt["[object Date]"]=mt["[object Error]"]=mt["[object Function]"]=mt["[object Map]"]=mt["[object Number]"]=mt["[object Object]"]=mt["[object RegExp]"]=mt["[object Set]"]=mt["[object String]"]=mt["[object WeakMap]"]=!1;var jt="object"==typeof exports&&exports&&!exports.nodeType&&exports,xt=jt&&"object"==typeof module&&module&&!module.nodeType&&module,St=xt&&xt.exports===jt&&l.process,wt=function(){try{return xt&&xt.require&&xt.require("util").types||St&&St.binding&&St.binding("util")}catch(t){}}(),Ot=wt&&wt.isTypedArray;const Et=Ot?(At=Ot,function(t){return At(t)}):function(t){return it(t)&&_t(t.length)&&!!mt[m(t)]};var At,Pt=Object.prototype.hasOwnProperty;const zt=function(t,e){var n=nt(t),r=!n&&pt(t),o=!n&&!r&&vt(t),s=!n&&!r&&!o&&Et(t),i=n||r||o||s,a=i?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],c=a.length;for(var u in t)!e&&!Pt.call(t,u)||i&&("length"==u||o&&("offset"==u||"parent"==u)||s&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||gt(u,c))||a.push(u);return a};var Nt=Object.prototype;const It=function(t,e){return function(n){return t(e(n))}}(Object.keys,Object);var Tt=Object.prototype.hasOwnProperty;const $t=function(t){if(n=(e=t)&&e.constructor,e!==("function"==typeof n&&n.prototype||Nt))return It(t);var e,n,r=[];for(var o in Object(t))Tt.call(t,o)&&"constructor"!=o&&r.push(o);return r},kt=function(t){return null!=(e=t)&&_t(e.length)&&!x(e)?zt(t):$t(t);var e},Mt=function(t){return function(t,e,n){var r=e(t);return nt(t)?r:function(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}(r,n(t))}(t,kt,st)};var Ft=Object.prototype.hasOwnProperty;const Rt=M(p,"DataView"),Ct=M(p,"Promise"),Lt=M(p,"Set"),Bt=M(p,"WeakMap");var Dt="[object Map]",Gt="[object Promise]",Ut="[object Set]",Vt="[object WeakMap]",Wt="[object DataView]",qt=A(Rt),Jt=A(F),Ht=A(Ct),Kt=A(Lt),Qt=A(Bt),Xt=m;(Rt&&Xt(new Rt(new ArrayBuffer(1)))!=Wt||F&&Xt(new F)!=Dt||Ct&&Xt(Ct.resolve())!=Gt||Lt&&Xt(new Lt)!=Ut||Bt&&Xt(new Bt)!=Vt)&&(Xt=function(t){var e=m(t),n="[object Object]"==e?t.constructor:void 0,r=n?A(n):"";if(r)switch(r){case qt:return Wt;case Jt:return Dt;case Ht:return Gt;case Kt:return Ut;case Qt:return Vt}return e});const Yt=Xt;var Zt="[object Arguments]",te="[object Array]",ee="[object Object]",ne=Object.prototype.hasOwnProperty;const re=function(t,e,n,o,s,i){var a=nt(t),c=nt(e),u=a?te:Yt(t),l=c?te:Yt(e),f=(u=u==Zt?ee:u)==ee,p=(l=l==Zt?ee:l)==ee,d=u==l;if(d&&vt(t)){if(!vt(e))return!1;a=!0,f=!1}if(d&&!f)return i||(i=new q),a||Et(t)?Q(t,e,n,o,s,i):function(t,e,n,o,s,i,a){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!i(new X(t),new X(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return r(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var c=Y;case"[object Set]":var u=1&o;if(c||(c=Z),t.size!=e.size&&!u)return!1;var l=a.get(t);if(l)return l==e;o|=2,a.set(t,e);var f=Q(c(t),c(e),o,s,i,a);return a.delete(t),f;case"[object Symbol]":if(et)return et.call(t)==et.call(e)}return!1}(t,e,u,n,o,s,i);if(!(1&n)){var h=f&&ne.call(t,"__wrapped__"),b=p&&ne.call(e,"__wrapped__");if(h||b){var v=h?t.value():t,y=b?e.value():e;return i||(i=new q),s(v,y,n,o,i)}}return!!d&&(i||(i=new q),function(t,e,n,r,o,s){var i=1&n,a=Mt(t),c=a.length;if(c!=Mt(e).length&&!i)return!1;for(var u=c;u--;){var l=a[u];if(!(i?l in e:Ft.call(e,l)))return!1}var f=s.get(t),p=s.get(e);if(f&&p)return f==e&&p==t;var d=!0;s.set(t,e),s.set(e,t);for(var h=i;++u<c;){var b=t[l=a[u]],v=e[l];if(r)var y=i?r(v,b,l,e,t,s):r(b,v,l,t,e,s);if(!(void 0===y?b===v||o(b,v,n,r,s):y)){d=!1;break}h||(h="constructor"==l)}if(d&&!h){var g=t.constructor,_=e.constructor;g==_||!("constructor"in t)||!("constructor"in e)||"function"==typeof g&&g instanceof g&&"function"==typeof _&&_ instanceof _||(d=!1)}return s.delete(t),s.delete(e),d}(t,e,n,o,s,i))},oe=function t(e,n,r,o,s){return e===n||(null==e||null==n||!it(e)&&!it(n)?e!=e&&n!=n:re(e,n,r,o,t,s))},se=function(t,e){return oe(t,e)};var ie=i(685);const ae=(0,ie.createGlobalStore)("extensionsInternal",{slots:{},extensions:{}}),ce=()=>(0,ie.getGlobalStore)("extensionsInternal",{slots:{},extensions:{}});let ue=Promise.resolve();function le(t){ue=ue.then((async()=>{const e=ae.getState(),n=await t(e);n!==e&&ae.setState(n)}))}const fe=()=>(0,ie.getGlobalStore)("extensions",{slots:{}});function pe(e){const n=[];for(let t of Object.values(e.extensions))for(let[e,r]of Object.entries(t.instances))for(let[o,s]of Object.entries(r))n.push({slotModuleName:e,extensionModuleName:t.moduleName,slotName:o,extensionId:s.id});se(t.configExtensionStore.getState().mountedExtensions,n)||t.configExtensionStore.setState({mountedExtensions:n})}pe(ae.getState()),ae.subscribe(pe);const de=ce(),he=fe();function be(t,e){return{moduleName:e,name:t,attachedIds:[],config:null}}function ve(t){const[e]=t.split("#");return e}function ye(t,e){const n=ve(e);return t.extensions[n]}function ge(t){return ye(de.getState(),t)}de.subscribe((t=>{const e={};for(let[n,r]of Object.entries(t.slots))if(r.moduleName){const t=Oe(n);e[n]={moduleName:r.moduleName,assignedExtensions:t}}he.setState({slots:e})}));const _e=de.action(((t,e)=>{t.extensions[e.name]={...e,instances:{}}}));function me(t,e){le((n=>{const r=n.slots[t];return r?{...n,slots:{...n.slots,[t]:{...r,attachedIds:[...r.attachedIds,e]}}}:{...n,slots:{...n.slots,[t]:{...be(t),attachedIds:[e]}}}}))}function je(t,e){le((n=>{const r=n.slots[t];return r&&r.attachedIds.includes(e)?{...n,slots:{...n.slots,[t]:{...r,attachedIds:r.attachedIds.filter((t=>t!==e))}}}:n}))}function xe(t){le((e=>{const n=e.slots[t];return n?{...e,slots:{...e.slots,[t]:{...n,attachedIds:[]}}}:e}))}function Se(t,e,n,r){const o=e.indexOf(t);if(-1!==o)return o;if(void 0!==n)return 1e3+n;{const e=r.indexOf(t);return-1!==e?2e3+e:-1}}function we(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=e??navigator.onLine;return t.filter((t=>ze(n,t.online,t.offline)))}function Oe(e){const n=de.getState(),r=function(t,e){const n=t.add||[],r=t.remove||[],o=t.order||[],{extensions:s}=de.getState();return[...e,...n].filter((t=>!r.includes(t))).sort(((t,n)=>{const r=Se(t,o,s[ve(t)].order,e),i=Se(n,o,s[ve(n)].order,e);return-1===i?-1:-1===r?1:r-i}))}((0,t.getExtensionSlotConfigStore)(e).getState().config,n.slots[e].attachedIds),o=[];for(let t of r){const e=ve(t),r=n.extensions[e];o.push({id:t,name:e,moduleName:r.moduleName,meta:r.meta,online:r.online,offline:r.offline})}return o}const Ee=de.action(((t,e,n)=>{const r=t.slots[n]?.moduleName;if(r&&r!=e)return console.warn(`An extension slot with the name '${n}' already exists. Refusing to register the same slot name twice (in "registerExtensionSlot"). The existing one is from module ${r}.`),t;if(r&&r==e)return t;if(t.slots[n])return{...t,slots:{...t.slots,[n]:{...t.slots[n],moduleName:e}}};const o=be(n,e);return{...t,slots:{...t.slots,[n]:o}}})),Ae=he.action((()=>({slots:{},extensions:{}})));function Pe(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=navigator.onLine;return ze(n,t,e)}function ze(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Boolean(t?e:n)}function Ne(t,e){const n=navigator.onLine?t:e;return"object"==typeof n?n:{}}var Ie=i(645);function Te(t,e,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:t=>t,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};const i=ve(r),a=ge(r);let c=!0,u=null;if(t){if(!a)throw Error(`Couldn't find extension '${i}' to attach to '${e}'`);const{load:l,online:f,offline:p,meta:d,moduleName:h}=a;Pe(f,p)&&(l().then((i=>{let{default:a,...l}=i;c&&(u=(0,Ie.mountRootParcel)(o(a??l),{...Ne(f,p),...s,_meta:d,_extensionContext:{extensionId:r,extensionSlotName:e,extensionSlotModuleName:n,extensionModuleName:h},domElement:t}))})),le((o=>(0,ie.update)(o,["extensions",i,"instances",n,e],{domElement:t,id:r}))))}else console.warn(`Tried to render ${r} into ${e} but no DOM element was available.`);return()=>{c=!1,u&&("MOUNTED"!==u.getStatus()?u.mountPromise.then((()=>{u&&u.unmount()})):u.unmount())}}const $e=ce()})(),a})())}}}));
|
|
1
|
+
System.register(["@openmrs/esm-config","@openmrs/esm-state","single-spa"],(function(t,e){var n={},r={},o={};return{setters:[function(t){n.configExtensionStore=t.configExtensionStore,n.getExtensionConfigFromStore=t.getExtensionConfigFromStore,n.getExtensionSlotConfig=t.getExtensionSlotConfig,n.getExtensionSlotConfigFromStore=t.getExtensionSlotConfigFromStore,n.getExtensionSlotsConfigStore=t.getExtensionSlotsConfigStore,n.getExtensionsConfigStore=t.getExtensionsConfigStore},function(t){r.createGlobalStore=t.createGlobalStore,r.getGlobalStore=t.getGlobalStore},function(t){o.mountRootParcel=t.mountRootParcel}],execute:function(){t((()=>{var t={968:(t,e,n)=>{const r=n(577).R;e.s=function(t){if(t||(t=1),!n.y.meta||!n.y.meta.url)throw console.error("__system_context__",n.y),Error("systemjs-webpack-interop was provided an unknown SystemJS context. Expected context.meta.url, but none was provided");n.p=r(n.y.meta.url,t)}},577:(t,e,n)=>{e.R=function(t,e){var n=document.createElement("a");n.href=t;for(var r="/"===n.pathname[0]?n.pathname:"/"+n.pathname,o=0,i=r.length;o!==e&&i>=0;)"/"===r[--i]&&o++;if(o!==e)throw Error("systemjs-webpack-interop: rootDirectoryLevel ("+e+") is greater than the number of directories ("+o+") in the URL path "+t);var a=r.slice(0,i+1);return n.protocol+"//"+n.host+a};Number.isInteger},824:t=>{"use strict";t.exports=n},685:t=>{"use strict";t.exports=r},645:t=>{"use strict";t.exports=o}},i={};function a(e){var n=i[e];if(void 0!==n)return n.exports;var r=i[e]={exports:{}};return t[e](r,r.exports,a),r.exports}a.y=e,a.d=(t,e)=>{for(var n in e)a.o(e,n)&&!a.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;a.g.importScripts&&(t=a.g.location+"");var e=a.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var n=e.getElementsByTagName("script");n.length&&(t=n[n.length-1].src)}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=t})();var s={};return(0,a(968).s)(1),(()=>{"use strict";a.r(s),a.d(s,{attach:()=>Ee,checkStatus:()=>Te,checkStatusFor:()=>ke,detach:()=>Ae,detachAll:()=>Pe,extensionStore:()=>We,getAssignedExtensions:()=>Ce,getConnectedExtensions:()=>Ne,getCustomProps:()=>Re,getExtensionInternalStore:()=>ae,getExtensionNameFromId:()=>Se,getExtensionRegistration:()=>we,getExtensionRegistrationFrom:()=>xe,getExtensionStore:()=>ce,registerExtension:()=>Oe,registerExtensionSlot:()=>Fe,renderExtension:()=>Ve,reset:()=>Me,updateInternalExtensionStore:()=>se});const t=function(t,e){return t===e||t!=t&&e!=e},e=function(e,n){for(var r=e.length;r--;)if(t(e[r][0],n))return r;return-1};var n=Array.prototype.splice;function r(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}r.prototype.clear=function(){this.__data__=[],this.size=0},r.prototype.delete=function(t){var r=this.__data__,o=e(r,t);return!(o<0||(o==r.length-1?r.pop():n.call(r,o,1),--this.size,0))},r.prototype.get=function(t){var n=this.__data__,r=e(n,t);return r<0?void 0:n[r][1]},r.prototype.has=function(t){return e(this.__data__,t)>-1},r.prototype.set=function(t,n){var r=this.__data__,o=e(r,t);return o<0?(++this.size,r.push([t,n])):r[o][1]=n,this};const o=r,i="object"==typeof global&&global&&global.Object===Object&&global;var c="object"==typeof self&&self&&self.Object===Object&&self;const u=i||c||Function("return this")(),l=u.Symbol;var f=Object.prototype,p=f.hasOwnProperty,d=f.toString,y=l?l.toStringTag:void 0;var v=Object.prototype.toString;var b=l?l.toStringTag:void 0;const h=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":b&&b in Object(t)?function(t){var e=p.call(t,y),n=t[y];try{t[y]=void 0;var r=!0}catch(t){}var o=d.call(t);return r&&(e?t[y]=n:delete t[y]),o}(t):function(t){return v.call(t)}(t)},g=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},m=function(t){if(!g(t))return!1;var e=h(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},_=u["__core-js_shared__"];var j,S=(j=/[^.]+$/.exec(_&&_.keys&&_.keys.IE_PROTO||""))?"Symbol(src)_1."+j:"";var x=Function.prototype.toString;const w=function(t){if(null!=t){try{return x.call(t)}catch(t){}try{return t+""}catch(t){}}return""};var O=/^\[object .+?Constructor\]$/,E=Function.prototype,A=Object.prototype,P=E.toString,I=A.hasOwnProperty,N=RegExp("^"+P.call(I).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const z=function(t){return!(!g(t)||(e=t,S&&S in e))&&(m(t)?N:O).test(w(t));var e},C=function(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return z(n)?n:void 0},F=C(u,"Map"),M=C(Object,"create");var T=Object.prototype.hasOwnProperty;var k=Object.prototype.hasOwnProperty;function R(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}R.prototype.clear=function(){this.__data__=M?M(null):{},this.size=0},R.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},R.prototype.get=function(t){var e=this.__data__;if(M){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return T.call(e,t)?e[t]:void 0},R.prototype.has=function(t){var e=this.__data__;return M?void 0!==e[t]:k.call(e,t)},R.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=M&&void 0===e?"__lodash_hash_undefined__":e,this};const $=R,D=function(t,e){var n,r,o=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map};function L(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}L.prototype.clear=function(){this.size=0,this.__data__={hash:new $,map:new(F||o),string:new $}},L.prototype.delete=function(t){var e=D(this,t).delete(t);return this.size-=e?1:0,e},L.prototype.get=function(t){return D(this,t).get(t)},L.prototype.has=function(t){return D(this,t).has(t)},L.prototype.set=function(t,e){var n=D(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};const U=L;function B(t){var e=this.__data__=new o(t);this.size=e.size}B.prototype.clear=function(){this.__data__=new o,this.size=0},B.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},B.prototype.get=function(t){return this.__data__.get(t)},B.prototype.has=function(t){return this.__data__.has(t)},B.prototype.set=function(t,e){var n=this.__data__;if(n instanceof o){var r=n.__data__;if(!F||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new U(r)}return n.set(t,e),this.size=n.size,this};const G=B;function V(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new U;++e<n;)this.add(t[e])}V.prototype.add=V.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},V.prototype.has=function(t){return this.__data__.has(t)};const W=V,q=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1},J=function(t,e,n,r,o,i){var a=1&n,s=t.length,c=e.length;if(s!=c&&!(a&&c>s))return!1;var u=i.get(t),l=i.get(e);if(u&&l)return u==e&&l==t;var f=-1,p=!0,d=2&n?new W:void 0;for(i.set(t,e),i.set(e,t);++f<s;){var y=t[f],v=e[f];if(r)var b=a?r(v,y,f,e,t,i):r(y,v,f,t,e,i);if(void 0!==b){if(b)continue;p=!1;break}if(d){if(!q(e,(function(t,e){if(a=e,!d.has(a)&&(y===t||o(y,t,n,r,i)))return d.push(e);var a}))){p=!1;break}}else if(y!==v&&!o(y,v,n,r,i)){p=!1;break}}return i.delete(t),i.delete(e),p},H=u.Uint8Array,K=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n},Q=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n};var X=l?l.prototype:void 0,Y=X?X.valueOf:void 0;const Z=Array.isArray;var tt=Object.prototype.propertyIsEnumerable,et=Object.getOwnPropertySymbols;const nt=et?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var n=-1,r=null==t?0:t.length,o=0,i=[];++n<r;){var a=t[n];e(a,n,t)&&(i[o++]=a)}return i}(et(t),(function(e){return tt.call(t,e)})))}:function(){return[]},rt=function(t){return null!=t&&"object"==typeof t},ot=function(t){return rt(t)&&"[object Arguments]"==h(t)};var it=Object.prototype,at=it.hasOwnProperty,st=it.propertyIsEnumerable,ct=ot(function(){return arguments}())?ot:function(t){return rt(t)&&at.call(t,"callee")&&!st.call(t,"callee")};const ut=ct;var lt="object"==typeof exports&&exports&&!exports.nodeType&&exports,ft=lt&&"object"==typeof module&&module&&!module.nodeType&&module,pt=ft&&ft.exports===lt?u.Buffer:void 0;const dt=(pt?pt.isBuffer:void 0)||function(){return!1};var yt=/^(?:0|[1-9]\d*)$/;const vt=function(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&yt.test(t))&&t>-1&&t%1==0&&t<e},bt=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991};var ht={};ht["[object Float32Array]"]=ht["[object Float64Array]"]=ht["[object Int8Array]"]=ht["[object Int16Array]"]=ht["[object Int32Array]"]=ht["[object Uint8Array]"]=ht["[object Uint8ClampedArray]"]=ht["[object Uint16Array]"]=ht["[object Uint32Array]"]=!0,ht["[object Arguments]"]=ht["[object Array]"]=ht["[object ArrayBuffer]"]=ht["[object Boolean]"]=ht["[object DataView]"]=ht["[object Date]"]=ht["[object Error]"]=ht["[object Function]"]=ht["[object Map]"]=ht["[object Number]"]=ht["[object Object]"]=ht["[object RegExp]"]=ht["[object Set]"]=ht["[object String]"]=ht["[object WeakMap]"]=!1;var gt="object"==typeof exports&&exports&&!exports.nodeType&&exports,mt=gt&&"object"==typeof module&&module&&!module.nodeType&&module,_t=mt&&mt.exports===gt&&i.process,jt=function(){try{return mt&&mt.require&&mt.require("util").types||_t&&_t.binding&&_t.binding("util")}catch(t){}}(),St=jt&&jt.isTypedArray;const xt=St?(wt=St,function(t){return wt(t)}):function(t){return rt(t)&&bt(t.length)&&!!ht[h(t)]};var wt,Ot=Object.prototype.hasOwnProperty;const Et=function(t,e){var n=Z(t),r=!n&&ut(t),o=!n&&!r&&dt(t),i=!n&&!r&&!o&&xt(t),a=n||r||o||i,s=a?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],c=s.length;for(var u in t)!e&&!Ot.call(t,u)||a&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||vt(u,c))||s.push(u);return s};var At=Object.prototype;const Pt=function(t,e){return function(n){return t(e(n))}}(Object.keys,Object);var It=Object.prototype.hasOwnProperty;const Nt=function(t){if(n=(e=t)&&e.constructor,e!==("function"==typeof n&&n.prototype||At))return Pt(t);var e,n,r=[];for(var o in Object(t))It.call(t,o)&&"constructor"!=o&&r.push(o);return r},zt=function(t){return null!=(e=t)&&bt(e.length)&&!m(e)?Et(t):Nt(t);var e},Ct=function(t){return function(t,e,n){var r=e(t);return Z(t)?r:function(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}(r,n(t))}(t,zt,nt)};var Ft=Object.prototype.hasOwnProperty;const Mt=C(u,"DataView"),Tt=C(u,"Promise"),kt=C(u,"Set"),Rt=C(u,"WeakMap");var $t="[object Map]",Dt="[object Promise]",Lt="[object Set]",Ut="[object WeakMap]",Bt="[object DataView]",Gt=w(Mt),Vt=w(F),Wt=w(Tt),qt=w(kt),Jt=w(Rt),Ht=h;(Mt&&Ht(new Mt(new ArrayBuffer(1)))!=Bt||F&&Ht(new F)!=$t||Tt&&Ht(Tt.resolve())!=Dt||kt&&Ht(new kt)!=Lt||Rt&&Ht(new Rt)!=Ut)&&(Ht=function(t){var e=h(t),n="[object Object]"==e?t.constructor:void 0,r=n?w(n):"";if(r)switch(r){case Gt:return Bt;case Vt:return $t;case Wt:return Dt;case qt:return Lt;case Jt:return Ut}return e});const Kt=Ht;var Qt="[object Arguments]",Xt="[object Array]",Yt="[object Object]",Zt=Object.prototype.hasOwnProperty;const te=function(e,n,r,o,i,a){var s=Z(e),c=Z(n),u=s?Xt:Kt(e),l=c?Xt:Kt(n),f=(u=u==Qt?Yt:u)==Yt,p=(l=l==Qt?Yt:l)==Yt,d=u==l;if(d&&dt(e)){if(!dt(n))return!1;s=!0,f=!1}if(d&&!f)return a||(a=new G),s||xt(e)?J(e,n,r,o,i,a):function(e,n,r,o,i,a,s){switch(r){case"[object DataView]":if(e.byteLength!=n.byteLength||e.byteOffset!=n.byteOffset)return!1;e=e.buffer,n=n.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=n.byteLength||!a(new H(e),new H(n)));case"[object Boolean]":case"[object Date]":case"[object Number]":return t(+e,+n);case"[object Error]":return e.name==n.name&&e.message==n.message;case"[object RegExp]":case"[object String]":return e==n+"";case"[object Map]":var c=K;case"[object Set]":var u=1&o;if(c||(c=Q),e.size!=n.size&&!u)return!1;var l=s.get(e);if(l)return l==n;o|=2,s.set(e,n);var f=J(c(e),c(n),o,i,a,s);return s.delete(e),f;case"[object Symbol]":if(Y)return Y.call(e)==Y.call(n)}return!1}(e,n,u,r,o,i,a);if(!(1&r)){var y=f&&Zt.call(e,"__wrapped__"),v=p&&Zt.call(n,"__wrapped__");if(y||v){var b=y?e.value():e,h=v?n.value():n;return a||(a=new G),i(b,h,r,o,a)}}return!!d&&(a||(a=new G),function(t,e,n,r,o,i){var a=1&n,s=Ct(t),c=s.length;if(c!=Ct(e).length&&!a)return!1;for(var u=c;u--;){var l=s[u];if(!(a?l in e:Ft.call(e,l)))return!1}var f=i.get(t),p=i.get(e);if(f&&p)return f==e&&p==t;var d=!0;i.set(t,e),i.set(e,t);for(var y=a;++u<c;){var v=t[l=s[u]],b=e[l];if(r)var h=a?r(b,v,l,e,t,i):r(v,b,l,t,e,i);if(!(void 0===h?v===b||o(v,b,n,r,i):h)){d=!1;break}y||(y="constructor"==l)}if(d&&!y){var g=t.constructor,m=e.constructor;g==m||!("constructor"in t)||!("constructor"in e)||"function"==typeof g&&g instanceof g&&"function"==typeof m&&m instanceof m||(d=!1)}return i.delete(t),i.delete(e),d}(e,n,r,o,i,a))},ee=function t(e,n,r,o,i){return e===n||(null==e||null==n||!rt(e)&&!rt(n)?e!=e&&n!=n:te(e,n,r,o,t,i))},ne=function(t,e){return ee(t,e)};var re=a(824),oe=a(685),ie=(0,oe.createGlobalStore)("extensionsInternal",{slots:{},extensions:{}}),ae=function(){return(0,oe.getGlobalStore)("extensionsInternal",{slots:{},extensions:{}})};function se(t){var e=ie.getState(),n=t(e);n!==e&&ie.setState(n)}var ce=function(){return(0,oe.getGlobalStore)("extensions",{slots:{}})};function ue(t){var e=[],n=!0,r=!1,o=void 0;try{for(var i,a=Object.values(t.extensions)[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var s=i.value,c=!0,u=!1,l=void 0;try{for(var f,p=s.instances[Symbol.iterator]();!(c=(f=p.next()).done);c=!0){var d=f.value;e.push({slotModuleName:d.slotModuleName,extensionModuleName:s.moduleName,slotName:d.slotName,extensionId:d.id})}}catch(t){u=!0,l=t}finally{try{c||null==p.return||p.return()}finally{if(u)throw l}}}}catch(t){r=!0,o=t}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}ne(re.configExtensionStore.getState().mountedExtensions,e)||re.configExtensionStore.setState({mountedExtensions:e})}function le(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function fe(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pe(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){fe(t,e,n[e])}))}return t}function de(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,s=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){s=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(t,e)||ve(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.")}()}function ye(t){return function(t){if(Array.isArray(t))return le(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||ve(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 ve(t,e){if(t){if("string"==typeof t)return le(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(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?le(t,e):void 0}}ue(ie.getState()),ie.subscribe(ue);var be=ae(),he=ce(),ge=(0,re.getExtensionSlotsConfigStore)(),me=(0,re.getExtensionsConfigStore)();function _e(t,e,n){var r={},o=!0,i=!1,a=void 0;try{for(var s,c=Object.entries(t.slots)[Symbol.iterator]();!(o=(s=c.next()).done);o=!0){var u=de(s.value,2),l=u[0],f=u[1],p=ze(l,t,(0,re.getExtensionSlotConfigFromStore)(e,f.name).config,n);r[l]={moduleName:f.moduleName,assignedExtensions:p}}}catch(t){i=!0,a=t}finally{try{o||null==c.return||c.return()}finally{if(i)throw a}}ne(he.getState().slots,r)||he.setState({slots:r})}function je(t,e){return{moduleName:e,name:t,attachedIds:[],config:null}}function Se(t){return de(t.split("#"),1)[0]}function xe(t,e){var n=Se(e);return t.extensions[n]}function we(t){return xe(be.getState(),t)}be.subscribe((function(t){_e(t,ge.getState(),me.getState())})),ge.subscribe((function(t){_e(be.getState(),t,me.getState())})),me.subscribe((function(t){_e(be.getState(),ge.getState(),t)}));var Oe=be.action((function(t,e){t.extensions[e.name]=pe({},e,{instances:[]})}));function Ee(t,e){se((function(n){var r=n.slots[t];return pe({},n,r?{slots:pe({},n.slots,fe({},t,pe({},r,{attachedIds:ye(r.attachedIds).concat([e])})))}:{slots:pe({},n.slots,fe({},t,pe({},je(t),{attachedIds:[e]})))})}))}function Ae(t,e){se((function(n){var r=n.slots[t];return r&&r.attachedIds.includes(e)?pe({},n,{slots:pe({},n.slots,fe({},t,pe({},r,{attachedIds:r.attachedIds.filter((function(t){return t!==e}))})))}):n}))}function Pe(t){se((function(e){var n=e.slots[t];return n?pe({},e,{slots:pe({},e.slots,fe({},t,pe({},n,{attachedIds:[]})))}):e}))}function Ie(t,e,n,r){var o=e.indexOf(t);if(-1!==o)return o;if(void 0!==n)return 1e3+n;var i=r.indexOf(t);return-1!==i?2e3+i:-1}function Ne(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=null!=e?e:navigator.onLine;return t.filter((function(t){return ke(n,t.online,t.offline)}))}function ze(t,e,n,r){var o=function(t,e){var n=t.add||[],r=t.remove||[],o=t.order||[],i=be.getState().extensions;return ye(e).concat(ye(n)).filter((function(t){return!r.includes(t)})).sort((function(t,n){var r,a,s=Ie(t,o,null===(r=i[Se(t)])||void 0===r?void 0:r.order,e),c=Ie(n,o,null===(a=i[Se(n)])||void 0===a?void 0:a.order,e);return-1===c?-1:-1===s?1:s-c}))}(n,e.slots[t].attachedIds),i=[],a=!0,s=!1,c=void 0;try{for(var u,l=o[Symbol.iterator]();!(a=(u=l.next()).done);a=!0){var f=u.value,p=(0,re.getExtensionConfigFromStore)(r,t,f).config,d=Se(f),y=e.extensions[d];y&&i.push({id:f,name:d,moduleName:y.moduleName,config:p,meta:y.meta,online:y.online,offline:y.offline})}}catch(t){s=!0,c=t}finally{try{a||null==l.return||l.return()}finally{if(s)throw c}}return i}function Ce(t){return ze(t,be.getState(),(0,re.getExtensionSlotConfig)(t).config,me.getState())}var Fe=be.action((function(t,e,n){var r,o=null===(r=t.slots[n])||void 0===r?void 0:r.moduleName;if(o&&o!=e)return console.warn("An extension slot with the name '".concat(n,'\' already exists. Refusing to register the same slot name twice (in "registerExtensionSlot"). The existing one is from module ').concat(o,".")),t;if(o&&o==e)return t;if(t.slots[n])return pe({},t,{slots:pe({},t.slots,fe({},n,pe({},t.slots[n],{moduleName:e})))});var i=je(n,e);return pe({},t,{slots:pe({},t.slots,fe({},n,i))})})),Me=he.action((function(){return{slots:{},extensions:{}}}));function Te(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=navigator.onLine;return ke(n,t,e)}function ke(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Boolean(t?e:n)}function Re(t,e){var n=navigator.onLine?t:e;return"object"==typeof n?n:{}}var $e=a(645);function De(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Le(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ue(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){Le(t,e,n[e])}))}return t}function Be(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;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function Ge(t){return function(t){if(Array.isArray(t))return De(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){if("string"==typeof t)return De(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(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?De(t,e):void 0}}(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 Ve(t,e,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(t){return t},i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},a=Se(r),s=we(r),c=!0,u=null;if(t){if(!s)throw Error("Couldn't find extension '".concat(a,"' to attach to '").concat(e,"'"));var l=s.load,f=s.online,p=s.offline,d=s.meta,y=s.moduleName;Te(f,p)&&(l().then((function(a){var s=a.default,l=Be(a,["default"]);c&&(u=(0,$e.mountRootParcel)(o(null!=s?s:l),Ue({},Re(f,p),i,{_meta:d,_extensionContext:{extensionId:r,extensionSlotName:e,extensionSlotModuleName:n,extensionModuleName:y},domElement:t})))})),se((function(o){var i={domElement:t,id:r,slotName:e,slotModuleName:n};return Ue({},o,{extensions:Ue({},o.extensions,Le({},a,Ue({},o.extensions[a],{instances:Ge(o.extensions[a].instances).concat([i])})))})})))}else console.warn("Tried to render ".concat(r," into ").concat(e," but no DOM element was available."));return function(){c=!1,u&&("MOUNTED"!==u.getStatus()?u.mountPromise.then((function(){u&&u.unmount()})):u.unmount())}}var We=ae()})(),s})())}}}));
|
|
2
2
|
//# sourceMappingURL=openmrs-esm-extensions.js.map
|