iobroker.javascript 9.0.17 → 9.1.0

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.
Files changed (159) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +17 -10
  3. package/admin/assets/OpenAiDialog-Dx-XNET0.js +13 -0
  4. package/admin/assets/{Save-DXaUpIPM.js → Save-Cld9qv9i.js} +1 -1
  5. package/admin/assets/ScriptEditor-BVaX7Hcs.js +2 -0
  6. package/admin/assets/ScriptEditorVanillaMonaco-yq11eIYC.js +1 -0
  7. package/admin/assets/createSvgIcon-DPvF8xqu.js +8 -0
  8. package/admin/assets/hostInit-LzITLWDa.js +1 -0
  9. package/admin/assets/index-BkyLyaYT.js +8 -0
  10. package/admin/assets/index-CLJ6-h9Q.js +1 -0
  11. package/admin/assets/index-COZhHfBn.js +1230 -0
  12. package/admin/assets/index-CVZSzCXy.js +1 -0
  13. package/admin/assets/index-Cu-TydZj.js +5 -0
  14. package/admin/assets/index-D8iYqogF.js +16 -0
  15. package/admin/assets/index-DlDUIfpA.js +193 -0
  16. package/admin/assets/index-Dnbw7_L3.js +986 -0
  17. package/admin/assets/index-Dsh1HfIY.js +1 -0
  18. package/admin/assets/index-gIA8x-8f.js +1 -0
  19. package/admin/assets/inheritsLoose-B0Ba5G9z.js +29 -0
  20. package/admin/assets/iobroker_javascript__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-DkBjPSMw.js +1 -0
  21. package/admin/assets/iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-QWG5Arqe.js +1 -0
  22. package/admin/assets/iobroker_javascript__loadShare__prop_mf_2_types__loadShare__.mjs-BCtSFofY.js +1 -0
  23. package/admin/assets/iobroker_javascript__loadShare__react__loadShare__.mjs-CTZOFJS2.js +1 -0
  24. package/admin/assets/iobroker_javascript__loadShare__react__loadShare__.mjs_commonjs-proxy-CE9lvhW8.js +1 -0
  25. package/admin/assets/iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs-DeVAS-oa.js +1 -0
  26. package/admin/assets/iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-RQRRZMX5.js +1 -0
  27. package/admin/assets/localSharedImportMap-AxgBkrOR.js +1 -0
  28. package/admin/assets/useTheme-hy6f3gra.js +1 -0
  29. package/admin/assets/virtualExposes-BPsCufin.js +1 -0
  30. package/admin/assets/virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-C9suQF96.js +8 -0
  31. package/admin/custom/assets/Components-FfVbavBM.js +1 -0
  32. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-B7D2xOvV.js +1 -0
  33. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare___mf_0_iobroker_mf_1_json_mf_2_config__loadShare__.mjs-ClsgYnEX.js +1 -0
  34. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare___mf_0_mui_mf_1_icons_mf_2_material__loadShare__.mjs-B551AMx-.js +1 -0
  35. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-KsT5vKjV.js +1 -0
  36. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare___mf_0_mui_mf_1_x_mf_2_date_mf_2_pickers__loadShare__.mjs-DgHZUNxn.js +1 -0
  37. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare__leaflet__loadShare__.mjs-BYONkEgA.js +1 -0
  38. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare__react__loadShare__.mjs-0SjJESw9.js +1 -0
  39. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare__react__loadShare__.mjs_commonjs-proxy-CInLgMWW.js +1 -0
  40. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare__react_mf_2_dom__loadShare__.mjs-CL--xmjC.js +1 -0
  41. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-CorOEig8.js +1 -0
  42. package/admin/custom/assets/DefaultPropsProvider-CGb21NGY.js +1 -0
  43. package/admin/custom/assets/TextField-DNzklBSl.js +139 -0
  44. package/admin/custom/assets/ThemeProvider-B4G3jidj.js +29 -0
  45. package/admin/custom/assets/blue-CagzI6CQ.js +1 -0
  46. package/admin/custom/assets/createSvgIcon-ZdrQ8zSU.js +1 -0
  47. package/admin/custom/assets/createTheme-Wd4QxQE0.js +8 -0
  48. package/admin/custom/assets/defaultTheme-F2iJF2G2.js +1 -0
  49. package/admin/custom/assets/hostInit-iUL-wyj1.js +1 -0
  50. package/admin/custom/assets/index-AZB1OHDH.js +1 -0
  51. package/admin/custom/assets/index-Be7j5wvd.js +1523 -0
  52. package/admin/custom/assets/index-BptSiKBK.js +55 -0
  53. package/admin/custom/assets/index-Bvwv5H7k.js +1 -0
  54. package/admin/custom/assets/index-C0RmLaAj.js +1 -0
  55. package/admin/custom/assets/index-CYc31Gwg.js +960 -0
  56. package/admin/custom/assets/index-CmJ8HzSc.js +1 -0
  57. package/admin/custom/assets/index-D0iTiVVG.js +8 -0
  58. package/admin/custom/assets/index-DNdWk-cT.js +1 -0
  59. package/admin/custom/assets/index-Dp7A3XHd.js +7 -0
  60. package/admin/custom/assets/index-YBvFYuP6.js +31 -0
  61. package/admin/custom/assets/index-huvZQhZw.js +1 -0
  62. package/admin/custom/assets/index-iRHaQfi-.js +1 -0
  63. package/admin/custom/assets/isSameWeek-DDsSIa_t.js +1 -0
  64. package/admin/custom/assets/jsx-runtime-DfVU3AZG.js +1 -0
  65. package/admin/custom/assets/leaflet-src-k2rCV-Ix.js +1 -0
  66. package/admin/custom/assets/localSharedImportMap-BRxFonIn.js +1 -0
  67. package/admin/custom/assets/useTheme-BfhDdtAr.js +1 -0
  68. package/admin/custom/assets/useTheme-DWZ6jNyq.js +1 -0
  69. package/admin/custom/assets/virtualExposes-DyedJotb.js +2 -0
  70. package/admin/custom/assets/virtual_mf-REMOTE_ENTRY_ID_ConfigCustomJavascriptSet__customComponents_js-BtJxKB87.js +8 -0
  71. package/admin/custom/customComponents.js +1 -2
  72. package/admin/i18n/de.json +10 -1
  73. package/admin/i18n/en.json +10 -1
  74. package/admin/i18n/es.json +10 -1
  75. package/admin/i18n/fr.json +10 -1
  76. package/admin/i18n/it.json +10 -1
  77. package/admin/i18n/nl.json +10 -1
  78. package/admin/i18n/pl.json +10 -1
  79. package/admin/i18n/pt.json +10 -1
  80. package/admin/i18n/ru.json +10 -1
  81. package/admin/i18n/uk.json +10 -1
  82. package/admin/i18n/zh-cn.json +10 -1
  83. package/admin/jsonConfig.json +195 -130
  84. package/admin/mf-manifest.json +1 -1
  85. package/admin/remoteEntry.js +1 -2
  86. package/admin/tab.html +13 -8
  87. package/build/lib/javascript.d.ts +4 -2
  88. package/build/lib/mirror.js +21 -18
  89. package/build/lib/mirror.js.map +1 -1
  90. package/build/lib/nodeModulesManagement.js +3 -2
  91. package/build/lib/nodeModulesManagement.js.map +1 -1
  92. package/build/lib/protectFs.js +27 -12
  93. package/build/lib/protectFs.js.map +1 -1
  94. package/build/lib/sandbox.js +3 -3
  95. package/build/lib/sandbox.js.map +1 -1
  96. package/build/lib/tools.js +7 -2
  97. package/build/lib/tools.js.map +1 -1
  98. package/build/main.js +237 -20
  99. package/build/main.js.map +1 -1
  100. package/build/types.d.ts +6 -1
  101. package/docs/de/README.md +75 -0
  102. package/docs/en/README.md +75 -0
  103. package/io-package.json +32 -28
  104. package/package.json +14 -14
  105. package/admin/assets/OpenAiDialog-BX-z5kNr.js +0 -36
  106. package/admin/assets/ScriptEditor-DhkUQSDz.js +0 -2
  107. package/admin/assets/ScriptEditorVanillaMonaco-CJS71hoK.js +0 -1
  108. package/admin/assets/_commonjsHelpers-Cpj98o6Y.js +0 -1
  109. package/admin/assets/createSvgIcon-DlIk-fDn.js +0 -30
  110. package/admin/assets/hostInit-OBG53iVO.js +0 -2
  111. package/admin/assets/index-BWM5lJbO.js +0 -193
  112. package/admin/assets/index-Br_QjNUk.js +0 -942
  113. package/admin/assets/index-C3P3FHiC.js +0 -16
  114. package/admin/assets/index-Cjl4b70e.js +0 -5
  115. package/admin/assets/index-DBgNhNiJ.js +0 -1294
  116. package/admin/assets/index-DQiceR5U.js +0 -1
  117. package/admin/assets/index-DZ3lKVw8.js +0 -1
  118. package/admin/assets/index-Do-nCdWy.js +0 -9
  119. package/admin/assets/index-DwcZPzOL.js +0 -24
  120. package/admin/assets/index-VCnuVxRc.js +0 -1
  121. package/admin/assets/inheritsLoose-DNrhibGS.js +0 -36
  122. package/admin/assets/iobroker_javascript__loadShare__react__loadShare__-i8pXne9X.js +0 -1
  123. package/admin/assets/iobroker_javascript__mf_v__runtimeInit__mf_v__-DZdFIfoQ.js +0 -5
  124. package/admin/assets/useTheme-DakN8Abq.js +0 -1
  125. package/admin/assets/virtualExposes-BIHI7g3E.js +0 -1
  126. package/admin/custom/assets/Components-DjQ_LxKw.js +0 -1
  127. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__-DaN0pfsw.js +0 -1
  128. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare___mf_0_mui_mf_1_material__loadShare__-BqzgglHd.js +0 -1
  129. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare__react__loadShare__-BNbscXK6.js +0 -1
  130. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare__react_mf_2_dom__loadShare__-N2_tx_mJ.js +0 -1
  131. package/admin/custom/assets/ConfigCustomJavascriptSet__mf_v__runtimeInit__mf_v__-jdUmHa_i.js +0 -5
  132. package/admin/custom/assets/DefaultPropsProvider-B8ZCC-c2.js +0 -1
  133. package/admin/custom/assets/DefaultPropsProvider-DfdXSIBu.js +0 -1
  134. package/admin/custom/assets/FilledInput-CSjr0QT8.js +0 -2
  135. package/admin/custom/assets/Tabs-CiTQkBjL.js +0 -138
  136. package/admin/custom/assets/ThemeProvider-C50pIiW4.js +0 -29
  137. package/admin/custom/assets/_commonjsHelpers-CE1G-McA.js +0 -1
  138. package/admin/custom/assets/createSvgIcon-C7qUEvjp.js +0 -1
  139. package/admin/custom/assets/createTheme-Bm92JF8u.js +0 -8
  140. package/admin/custom/assets/defaultTheme-BlO0eCf6.js +0 -1
  141. package/admin/custom/assets/hostInit-BJ6gSofk.js +0 -2
  142. package/admin/custom/assets/index-4wMOc304.js +0 -1
  143. package/admin/custom/assets/index-5CTGLw4h.js +0 -55
  144. package/admin/custom/assets/index-BkjEWGjf.js +0 -1
  145. package/admin/custom/assets/index-Bym4WjyH.js +0 -908
  146. package/admin/custom/assets/index-COcxCdeX.js +0 -8
  147. package/admin/custom/assets/index-CnpybLRW.js +0 -1
  148. package/admin/custom/assets/index-Db8nkuMR.js +0 -7
  149. package/admin/custom/assets/index-DcK0RDrH.js +0 -1
  150. package/admin/custom/assets/index-Df6OaCxx.js +0 -1
  151. package/admin/custom/assets/index-Dx7rDE4p.js +0 -1
  152. package/admin/custom/assets/index-t-NMdeH5.js +0 -31
  153. package/admin/custom/assets/index-u8R8UVCf.js +0 -1393
  154. package/admin/custom/assets/jsx-runtime-C1csJtRx.js +0 -1
  155. package/admin/custom/assets/leaflet-src-DpWQqQWv.js +0 -1
  156. package/admin/custom/assets/useEnhancedEffect-aUb-5tTL.js +0 -1
  157. package/admin/custom/assets/useTheme-Cgjfsi-1.js +0 -1
  158. package/admin/custom/assets/useTheme-DFGylj2o.js +0 -1
  159. package/admin/custom/assets/virtualExposes-C_DtjFte.js +0 -2
@@ -1 +0,0 @@
1
- import{j as t}from"./createSvgIcon-DlIk-fDn.js";import{i as u}from"./iobroker_javascript__loadShare__react__loadShare__-i8pXne9X.js";import{u as pe,a as xe,i as x,M as X,C as te,G as be,b as Ce,c as he,I as we,S as J,d as ve,e as le,j as je,D as Ie,f as Oe}from"./index-DBgNhNiJ.js";import{i as N,C as Se}from"./index-Cjl4b70e.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./iobroker_javascript__mf_v__runtimeInit__mf_v__-DZdFIfoQ.js";import"./inheritsLoose-DNrhibGS.js";import"./preload-helper-BDBacUwf.js";function Ae(n){const s=pe().getMonitor(),[i,r]=xe(s,n);return u.useEffect(()=>s.subscribeToOffsetChange(r)),u.useEffect(()=>s.subscribeToStateChange(r)),i}let V;function ye(){return V||(V=new Image,V.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),V}const De="_wrapperRules_nnott_1",ke="_rootWrapper_nnott_9",Ne="_addClass_nnott_14",ne={wrapperRules:De,rootWrapper:ke,addClass:Ne},$e="_switchesItem_10ls3_1",Be="_switchesItemActive_10ls3_28",Ee="_iconTheme_10ls3_36",se={switchesItem:$e,switchesItemActive:Be,iconTheme:Ee},ue=({name:n,id:e,active:s,icon:i,adapter:r,socket:o,onDoubleClick:c,title:l,onTouchMove:d,style:I})=>t.jsxs("div",{onDoubleClick:c,onTouchMove:d,title:l?x.I18n.t(l):void 0,className:x.Utils.clsx(se.switchesItem,s&&se.switchesItemActive,`block-${e}`),children:[t.jsx(X,{iconName:i,className:se.iconTheme,adapter:r,socket:o,style:I}),t.jsx("span",{children:n?x.I18n.t(n):""})]},e),Me="_cardStyle_8rq8v_1",qe="_cardStyleActive_8rq8v_17",He="_controlMenu_8rq8v_22",Te="_closeBtn_8rq8v_31",We="_isDelete_8rq8v_73",Pe="_drag_mobile_8rq8v_90",G={cardStyle:Me,cardStyleActive:qe,controlMenu:He,closeBtn:Te,isDelete:We,drag_mobile:Pe};function K(n,e,s){let i;switch(n){case"actions":if(s==="else")return i={...e,actions:{...e[n],else:[...e[n].else]}},i;if(s==="then")return i={...e,actions:{...e[n],then:[...e[n].then]}},i;throw console.error(`Unknown additionalParameter: ${s}`),new Error(`Unknown additionalParameter: ${s}`);case"triggers":return i={...e,triggers:[...e.triggers]},i;case"conditions":return i={...e,conditions:[...e.conditions]},i;default:throw new Error(`Unknown name: ${n}`)}}function z(n,e,s,i){var r;switch(n){case"actions":return e.actions[s]=e.actions[s].filter(o=>o._id!==i),e;case"conditions":return e.conditions[s]=(r=e.conditions[s])==null?void 0:r.filter(o=>o._id!==i),e;case"triggers":default:return e.triggers=e.triggers.filter(o=>o._id!==i),e}}function Fe(n,e,s){const{_id:i,acceptedBy:r}=n;let o;if(!r||!e[r])return console.warn(`Cannot find ${r}`),e;switch(r){case"actions":if(o=e.actions[s].find(c=>c._id===i),!o)console.warn(`Cannot find ${i}`);else{const c=e.actions[s].indexOf(o);e.actions[s][c]=n}return e;case"conditions":if(o=e.conditions[s].find(c=>c._id===i),!o)console.warn(`Cannot find ${i}`);else{const c=e.conditions[s].indexOf(o);e.conditions[s][c]=n}return e;default:if(o=e.triggers.find(c=>c._id===i),!o)console.warn(`Cannot find ${i}`);else{const c=e.triggers.indexOf(o);e.triggers[c]=n}return e}}const me=u.memo(n=>{var B;const{setUserRules:e,userRules:s,_id:i,id:r,blockValue:o,active:c,acceptedBy:l,isTourOpen:d,setTourStep:I,tourStep:S}=n,[O,_]=u.useState(null),{blocks:a,socket:k,onUpdate:H,setOnUpdate:w,onDebugMessage:f,enableSimulation:b}=u.useContext(te),p=u.useCallback(m=>a==null?void 0:a.find(C=>C.getStaticData().id===m),[a]),h=u.useCallback(m=>{const C=Fe(m,s,o);C&&e(C)},[s]),v=m=>{m.currentTarget!==O&&_(m.currentTarget)},M=()=>_(null),W=u.useMemo(()=>{const m=p(r)||be;return t.jsx(m,{...n,notFound:!p(r),isTourOpen:d,setTourStep:I,tourStep:S,onUpdate:H,setOnUpdate:w,enableSimulation:b,onDebugMessage:f,onChange:h,className:void 0,socket:k})},[s,H,f,b]),[$,q]=u.useState(!1);return t.jsxs("div",{onMouseMove:v,onMouseEnter:v,onMouseLeave:M,onMouseDown:m=>{if(m.ctrlKey){let C;const j=K(l,s,o);l==="conditions"?(C=j.conditions[o].find(g=>g._id===i),C&&j.conditions[o].splice(j.conditions[o].indexOf(C),0,{...C,_id:Date.now()})):l==="actions"?(C=j.actions[o].find(g=>g._id===i),C&&j.actions[o].splice(j.actions[o].indexOf(C),0,{...C,_id:Date.now()})):(C=j.triggers.find(g=>g._id===i),C&&j.triggers.splice(j[l].indexOf(C),0,{...C,_id:Date.now()})),e(j)}},id:"height",style:c?{width:(((B=document.getElementById("width"))==null?void 0:B.clientWidth)||0)-70}:void 0,className:`${G.cardStyle} ${c?G.cardStyleActive:null} ${$?G.isDelete:null}`,children:[t.jsx("div",{className:G.drag_mobile}),W,e&&t.jsx("div",{className:G.controlMenu,style:O?{opacity:1}:{opacity:0},children:t.jsx("div",{onClick:()=>{let m=K(l,s,o);m=z(l,m,o,i),q(!0),setTimeout(()=>{l==="triggers"&&w(!0),e(m)},300)},className:G.closeBtn})})]})}),Ue={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},Je=(n,e,s)=>{if(!n||!e)return{display:"none"};let{x:i,y:r}=e;const o=`translate(${i}px, ${r}px)`;return{transform:o,WebkitTransform:o}},Le=n=>{const{itemType:e,isDragging:s,item:i,initialOffset:r,currentOffset:o,targetIds:c}=Ae(d=>({item:d.getItem(),itemType:d.getItemType(),initialOffset:d.getInitialSourceClientOffset(),currentOffset:d.getSourceClientOffset(),isDragging:d.isDragging(),targetIds:d.getTargetIds()})),l=()=>{switch(e){case"box":return c.length?t.jsx(me,{active:!0,...i,allBlocks:n.allBlocks}):t.jsx(ue,{active:!0,...i,socket:n.socket});default:return null}};return s?t.jsx("div",{style:Ue,children:t.jsx("div",{style:Je(r,o),children:l()})}):null},ze="_border_wrpm3_1",Ge="_emptyBlockStyle_wrpm3_6",Ke="_emptyBlock_wrpm3_6",Qe="_selectOnChange_wrpm3_22",Xe="_selectOnChangeHelp_wrpm3_28",Ye="_selectOnChangeHelpIcon_wrpm3_34",Ze="_emptyBlockNone_wrpm3_49",Ve="_mainBlockItemRules_wrpm3_55",Re="_nameBlockItems_wrpm3_63",et="_contentBlockItem_wrpm3_73",tt="_wrapperMargin_wrpm3_81",nt="_contentHeightOn_wrpm3_87",st="_contentHeightOff_wrpm3_99",ot="_cardAdd_wrpm3_105",it="_blockCardAdd_wrpm3_125",ct="_addClassOverflow_wrpm3_136",at="_addClassHeight_wrpm3_140",D={border:ze,emptyBlockStyle:Ge,emptyBlock:Ke,selectOnChange:Qe,selectOnChangeHelp:Xe,selectOnChangeHelpIcon:Ye,emptyBlockNone:Ze,mainBlockItemRules:Ve,nameBlockItems:Re,contentBlockItem:et,wrapperMargin:tt,contentHeightOn:nt,contentHeightOff:st,cardAdd:ot,blockCardAdd:it,addClassOverflow:ct,addClassHeight:at};function re(n,e){const[s,i]=u.useState(window.localStorage.getItem(e)?JSON.parse(window.localStorage.getItem(e)||""):n);return[s,o=>{window.localStorage.setItem(e,JSON.stringify(o)),i(o)},!!window.localStorage.getItem(e)]}function rt(n,e){let s=0,i=null,r;return function(...o){const c=Date.now();r=o,c-s>=e?(s=c,n.apply(this,o)):i||(i=setTimeout(()=>{s=Date.now(),i=null,n.apply(this,r)},e-(c-s)))}}function ee(n){if(Array.isArray(n))return n.map(e=>ee(e));if(typeof n=="function")return n.bind(null);if(n&&typeof n=="object"){const e={};return Object.keys(n).forEach(s=>{e[s]=ee(n[s])}),e}return n}const oe=rt((n,e)=>n(e),0);function R(n,e){const s=e.find(i=>i._id===n);return{card:s,index:s?e.indexOf(s):-1}}function ie(n,e,s,i,r,o,c,l,d){const{card:I,index:S}=R(n,s);if(!(S<e&&l<d)&&!(S>e&&l>d)&&I&&S!==e){const O=ee(s);O.splice(S,1),O.splice(e,0,I);const _=ee(r);switch(o){case"actions":_.actions[c]=O,oe(i,_);return;case"conditions":_.conditions[c]=O,oe(i,_);return;default:_.triggers=O,oe(i,_);return}}}const lt="_drag_7xfhc_1",dt="_root_7xfhc_11",de={drag:lt,root:dt},_e=({typeBlock:n,allProperties:e,id:s,isActive:i,setUserRules:r,userRules:o,children:c,_id:l,blockValue:d})=>{const{setOnUpdate:I}=u.useContext(te),[{opacity:S},O,_]=Ce({type:"box",item:()=>({...e,id:s,isActive:i,_id:l}),end:(w,f)=>{const{acceptedBy:b}=w,p=f.getDropResult();let h;if(!p)return typeof l=="number"&&!f.getTargetIds().length&&(h=K(b,o,d),h=z(b,h,d,l),r(h)),null;if(p.blockValue!==d){const v=typeof l=="number"?l:Date.now();h=K(b,o,p.blockValue);const M={id:w.id,acceptedBy:w.acceptedBy};switch(b){case"actions":return d&&(h=z("actions",h,d,v)),h=z("actions",h,p.blockValue,v),h.actions[p.blockValue].push({...M,_id:v}),r(h);case"conditions":return typeof d=="number"&&(h=z("conditions",h,d,v)),h=z("conditions",h,p.blockValue,v),h.conditions[p.blockValue].push({...M,_id:v}),r(h);default:return I(!0),h=z("triggers",h,p.blockValue,v),h.triggers.push({...M,_id:v}),r(h)}}},collect:w=>({opacity:w.isDragging()?.4:1,isDragging:w.isDragging()})}),a=u.useRef(null),[,k]=he({accept:"box",canDrop:()=>!1,hover({_id:w,acceptedBy:f},b){var W;if(!a.current||n!==f)return;const p=(W=a.current)==null?void 0:W.getBoundingClientRect(),h=(p.bottom-p.top)/2,v=b.getClientOffset(),M=((v==null?void 0:v.y)||0)-p.top;if(l&&w!==l)switch(f){case"actions":if(d==="then"||d==="else"){const{index:$}=R(l,o.actions[d]);$!==w&&ie(w,$,o[f][d],r,o,f,d,M,h)}return;case"conditions":if(typeof d=="number"){const{index:$}=R(l,o[f][d]);$!==w&&ie(w,$,o[f][d],r,o,f,d,M,h)}return;default:{const{index:$}=R(l,o[f]);$!==w&&ie(w,$,o[f],r,o,f,void 0,M,h);return}}}});u.useEffect(()=>{_(ye(),{captureDraggingState:!0})},[]),O(k(a));const H=window.innerWidth<600;return t.jsxs("div",{ref:H&&l?null:a,className:de.root,style:{opacity:S},children:[t.jsx("div",{className:l?de.drag:null,ref:l&&H?a:null}),c]})},ft=({onClose:n,open:e})=>t.jsxs(N.Dialog,{open:e,onClose:n,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[t.jsx(N.DialogContent,{children:t.jsxs("div",{style:{fontSize:"1rem",fontFamily:'"Roboto", "Helvetica", "Arial", sans-serif',fontWeight:400,lineHeight:1.5,letterSpacing:"0.00938em"},children:[t.jsx("h3",{children:x.I18n.t("On condition change")}),t.jsx("div",{children:x.I18n.t("help_on_change")}),t.jsx("h3",{children:x.I18n.t("Just check")}),t.jsx("div",{children:x.I18n.t("help_just_check")})]})}),t.jsx(N.DialogActions,{children:t.jsx(N.Button,{onClick:n,color:"primary",autoFocus:!0,startIcon:t.jsx(Se,{}),children:x.I18n.t("OK")})})]}),gt=({onClose:n,open:e})=>t.jsxs(N.Dialog,{open:e,onClose:n,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[t.jsx(N.DialogContent,{children:t.jsxs(N.DialogContentText,{id:"alert-dialog-description",children:[t.jsx("h3",{children:x.I18n.t("On condition change")}),t.jsx("div",{children:x.I18n.t("help_on_change")}),t.jsx("h3",{children:x.I18n.t("Just check")}),t.jsx("div",{children:x.I18n.t("help_just_check")})]})}),t.jsx(N.DialogActions,{children:t.jsx(N.Button,{onClick:n,color:"primary",autoFocus:!0,children:x.I18n.t("OK")})})]}),fe=({size:n,blockValue:e,boolean:s,typeBlock:i,userRules:r,setUserRules:o,animation:c,setTourStep:l,tourStep:d,isTourOpen:I,theme:S,themeType:O,themeName:_})=>{var T;const[a,k]=u.useState(!1),[H,w]=u.useState(!1),[f,b]=u.useState(!1),[p,h]=u.useState("");s===void 0&&(s=!0);const v=he({accept:"box",drop:()=>({blockValue:e}),hover:({acceptedBy:A,_id:L},Y)=>{k(A===i),b(!!L),h(Y.getHandlerId()||"")},canDrop:({acceptedBy:A})=>(w(A===i),A===i),collect:A=>{var L;return{isOver:A.isOver(),canDrop:((L=A.getItem())==null?void 0:L.acceptedBy)===i,offset:A.getClientOffset(),targetId:A.getHandlerId()}}}),M=v[0],{canDrop:W,isOver:$,offset:q,targetId:B}=M,m=v[1];u.useEffect(()=>{h("")},[q]);const C=W&&$;let j="";C?j=a?"#00fb003d":"#fb00002e":W?j=H?"#00fb003d":"#fb00002e":q&&(j=B===p?"#fb00002e":"");let g;return i==="actions"?g=r.actions[e]:i==="conditions"?g=r.conditions[e]:g=r.triggers,t.jsx("div",{ref:m,style:{backgroundColor:j},className:`${x.Utils.clsx(D.contentBlockItem,n&&D.addClassHeight)} ${s?c?D.contentHeightOn:null:D.contentHeightOff}`,children:t.jsxs("div",{className:D.wrapperMargin,children:[g.map(A=>t.jsx(_e,{typeBlock:i,...A,blockValue:e,allProperties:A,userRules:r,setUserRules:o,children:t.jsx(me,{...A,isTourOpen:I,setTourStep:l,tourStep:d,settings:A,blockValue:e,userRules:r,setUserRules:o,theme:S,themeType:O,themeName:_})},A._id)),t.jsx("div",{style:C&&a&&!f?{height:((T=document.getElementById("height"))==null?void 0:T.clientHeight)||200}:void 0,className:`${D.emptyBlockStyle} ${C&&a&&!f?D.emptyBlock:D.emptyBlockNone}`})]})})},ce=({size:n,typeBlock:e,name:s,nameAdditionally:i,additionally:r,border:o,userRules:c,setUserRules:l,iconName:d,adapter:I,socket:S,setTourStep:O,tourStep:_,isTourOpen:a,theme:k,themeType:H,themeName:w})=>{const[f,b,p]=re(e==="actions"?!1:[],`additionallyClickItems_${e}`),[h,v]=u.useState(!1),[M,W]=u.useState(!1);u.useEffect(()=>{if(e==="conditions"&&(f==null?void 0:f.length)!==c.conditions.length-1){const B=[];c.conditions.forEach((m,C)=>{C>0&&B.push({_id:Date.now(),open:!0})}),b([...f,...B])}e==="actions"&&!p&&c.actions.else.length&&b(!0)},[]);const[$,q]=u.useState(!1);return t.jsxs("div",{className:`${x.Utils.clsx(D.mainBlockItemRules,n&&D.addClassOverflow)} ${o&&!n?D.border:null}`,children:[t.jsxs("span",{id:"width",className:D.nameBlockItems,children:[t.jsx(X,{iconName:d,className:D.iconThemCard,adapter:I,socket:S}),s]}),e==="conditions"?t.jsxs("div",{style:{width:"100%"},children:[t.jsxs(N.Select,{variant:"standard",className:D.selectOnChange,value:c.justCheck||!1,onChange:B=>{const m=K("conditions",c);m.justCheck=B.target.value==="true",l(m)},children:[t.jsx(N.MenuItem,{value:"false",children:x.I18n.t("on condition change")}),t.jsx(N.MenuItem,{value:"true",children:x.I18n.t("just check")})]}),t.jsx(N.IconButton,{size:"small",title:x.I18n.t("Explanation"),className:D.selectOnChangeHelp,onClick:()=>v(!0),children:t.jsx(we,{className:D.selectOnChangeHelpIcon})})]}):null,t.jsx(fe,{setTourStep:O,tourStep:_,isTourOpen:a,blockValue:e==="actions"?"then":e==="conditions"?0:e,typeBlock:e,setUserRules:l,userRules:c,theme:k,themeName:w,themeType:H,size:n}),r&&[...Array(e==="actions"?1:c.conditions.length-1)].map((B,m)=>{const C=(j=m)=>e==="actions"?!!f:!!f.find((g,T)=>T===j&&g.open);return t.jsxs(u.Fragment,{children:[t.jsxs("div",{onClick:()=>{if(e==="actions")return b(!f),null;let j=JSON.parse(JSON.stringify(f));if(c.conditions[m+1].length)return j[m].open=!j[m].open,b(j),null;j=j.filter((g,T)=>T!==m),b(j),q(m),setTimeout(()=>{q(!1),l({...c,conditions:[...c.conditions.filter((g,T)=>T!==m+1)]})},250)},className:D.blockCardAdd,children:[C()?"-":"+",t.jsx("div",{className:D.cardAdd,children:i})]},m),t.jsx(fe,{blockValue:e==="actions"?"else":e==="conditions"?m+1:e,typeBlock:e,setUserRules:l,userRules:c,boolean:C(),animation:$===m,size:n,theme:k,themeName:w,themeType:H})]},`${m}_block_${e}`)}),r&&e==="conditions"&&t.jsxs("div",{onClick:()=>{b([...f,{_id:Date.now(),open:!0}]),l({...c,conditions:[...c.conditions,[]]}),q(c.conditions.length-1),setTimeout(()=>q(!1),1e3)},className:D.blockCardAdd,children:["+",t.jsx("div",{className:D.cardAdd,children:i})]}),t.jsx(ft,{open:h,onClose:()=>v(!1)}),t.jsx(gt,{open:M,onClose:()=>W(!1)})]})},ht="_menuRules_1qqcb_1",ut="_switchesRenderWrapper_1qqcb_13",mt="_menuOff_1qqcb_22",_t="_menuTitle_1qqcb_28",pt="_marginAuto_1qqcb_42",xt="_inputWidth_1qqcb_47",bt="_menuWrapper_1qqcb_52",Ct="_hamburgerWrapper_1qqcb_57",wt="_hamburgerOff_1qqcb_74",vt="_nothingFound_1qqcb_82",jt="_resetSearch_1qqcb_89",It="_controlPanel_1qqcb_101",Ot="_controlPanelAppBar_1qqcb_112",St="_addClassMenu_1qqcb_126",At="_addClassBackground_1qqcb_132",yt="_addClassPosition_1qqcb_136",E={menuRules:ht,switchesRenderWrapper:ut,menuOff:mt,menuTitle:_t,marginAuto:pt,inputWidth:xt,menuWrapper:bt,hamburgerWrapper:Ct,hamburgerOff:wt,nothingFound:vt,resetSearch:jt,controlPanel:It,controlPanelAppBar:Ot,addClassMenu:St,addClassBackground:At,addClassPosition:yt},Dt=n=>{const{allProperties:e,allProperties:{acceptedBy:s,id:i},setUserRules:r,userRules:o,setTourStep:c,tourStep:l,isTourOpen:d,onTouchMove:I,isActive:S}=n;return t.jsx(_e,{allProperties:e,id:e.id,isActive:S,setUserRules:r,userRules:o,children:t.jsx(ue,{onDoubleClick:()=>{d&&l===J.addScheduleByDoubleClick&&i==="TriggerScheduleBlock"&&c(J.openTagsMenu),d&&l===J.addActionPrintText&&i==="ActionPrintText"&&c(J.showJavascript);const O=Date.now();let _;switch(s){case"actions":_="then";break;case"conditions":_=o[s].length-1;break}const a=K(s,o,_),k={id:i,_id:O,acceptedBy:s};_!==void 0?s==="actions"?a.actions[_].push({...k}):s==="conditions"&&a.conditions[_].push({...k}):a.triggers.push({...k}),r(a)},...n,...e,onTouchMove:I})})},kt="_hamburgerMenu_hqnsm_8",Nt="_animate_hqnsm_21",ge={hamburgerMenu:kt,animate:Nt};function $t({bool:n}){return t.jsx("div",{className:`${ge.hamburgerMenu} ${n?ge.animate:""}`})}const Bt=({addClass:n,setAllBlocks:e,allBlocks:s,userRules:i,onChangeBlocks:r,setTourStep:o,tourStep:c,isTourOpen:l})=>{const{blocks:d,socket:I}=u.useContext(te),[S,O]=re(!1,"hamburgerOnOff"),[_,a]=re({text:"",type:"triggers",index:0},"filterControlPanel"),k=(f=_.text,b=_.type)=>{if(!d)return;let p=[...d];p=p.filter(h=>{if(!f)return!0;const{name:v}=h.getStaticData();return v&&x.I18n.t(v).toLowerCase().includes(f.toLowerCase())}),p=p.filter(h=>b===h.getStaticData().acceptedBy),e(p)},H=(f,b)=>{l&&b===0&&c===J.selectTriggers&&o(J.addScheduleByDoubleClick),l&&b===2&&c===J.selectActions&&o(J.addActionPrintText),a({..._,index:b,type:["triggers","conditions","actions"][b]}),k(_.text,["triggers","conditions","actions"][b])},w=f=>({id:`scrollable-force-tab-${f}`,"aria-controls":`scrollable-force-tabpanel-${f}`});return u.useEffect(()=>{k()},[d]),t.jsx(N.ClickAwayListener,{mouseEvent:!1,touchEvent:"onTouchStart",onClickAway:()=>O(!0),children:t.jsxs("div",{className:x.Utils.clsx(E.menuWrapper,n[1035]&&E.addClassMenu),children:[t.jsx("div",{className:`${E.hamburgerWrapper} ${S?E.hamburgerOff:null}`,onClick:()=>O(!S),children:t.jsx($t,{bool:!S})}),t.jsxs("div",{className:`${x.Utils.clsx(E.menuRules,n[1035]&&E.addClassBackground,n[835]&&E.addClassPosition)} ${S?E.menuOff:null}`,children:[t.jsx("div",{className:E.controlPanel,children:t.jsx(N.AppBar,{className:E.controlPanelAppBar,position:"static",children:t.jsxs(N.Tabs,{value:_.index,onChange:H,children:[t.jsx(N.Tab,{className:"blocks-triggers",title:x.I18n.t("Triggers"),icon:t.jsx(X,{iconName:"FlashOn"}),...w(0)}),t.jsx(N.Tab,{title:x.I18n.t("Conditions"),className:"blocks-conditions",icon:t.jsx(X,{iconName:"Help"}),...w(1)}),t.jsx(N.Tab,{title:x.I18n.t("Actions"),className:"blocks-actions",icon:t.jsx(X,{iconName:"PlayForWork"}),...w(2)})]})})}),t.jsx("div",{className:E.switchesRenderWrapper,children:t.jsxs("span",{children:[s.map(f=>{const{name:b,id:p,icon:h,adapter:v}=f.getStaticData();return t.jsx(u.Fragment,{children:t.jsx(Dt,{adapter:v,allProperties:f.getStaticData(),icon:h,id:p,isActive:!1,isTourOpen:l,name:b,onTouchMove:()=>O(!0),setTourStep:o,setUserRules:r,socket:I,tourStep:c,userRules:i})},p)}),!s.length&&t.jsxs("div",{className:E.nothingFound,children:[x.I18n.t("Nothing found"),"...",t.jsx("div",{className:E.resetSearch,onClick:()=>{a({..._,text:""}),k("")},children:x.I18n.t("reset search")})]})]})}),t.jsx("div",{className:x.Utils.clsx(E.menuTitle,E.marginAuto)}),t.jsx(ve,{className:E.inputWidth,fullWidth:!0,customValue:!0,value:_.text,size:"small",autoComplete:"off",label:x.I18n.t("search"),variant:"outlined",onChange:f=>{a({..._,text:f}),k(f)}})]})]})})};let ae=[];const Ut=({code:n,onChange:e,themeName:s,themeType:i,theme:r,setTourStep:o,tourStep:c,isTourOpen:l,command:d,scriptId:I,changed:S,running:O})=>{var j;const{blocks:_,socket:a,setOnUpdate:k,setOnDebugMessage:H,setEnableSimulation:w}=u.useContext(te),[f,b]=u.useState([]),[p,h]=u.useState(le(n)),[v,M]=u.useState(""),[W,$]=u.useState(!1);u.useEffect(()=>{let g,T;const A=(F,y)=>{F===`${g}.alive`&&T!==(y==null?void 0:y.val)&&(T=!!(y!=null&&y.val),T&&g&&(a==null||a.sendTo(g.replace(/^system\.adapter\./,""),"rulesOn",I)))},L=(F,y)=>{var U,Q;a&&g!==((U=y==null?void 0:y.common)==null?void 0:U.engine)&&(g&&(a.unsubscribeState(`${g}.alive`,A),T&&a.sendTo(g.replace(/^system\.adapter\./,""),"rulesOn",I)),g=(Q=y==null?void 0:y.common)==null?void 0:Q.engine,g&&g&&a.subscribeState(`${g}.alive`,A))},Y=(F,y)=>{if(y)try{const U=JSON.parse(y.val),Q=Date.now();if(U.ruleId===I&&Q-U.ts<1e3){const P=[...ae,{blockId:U.blockId,data:U.data,ts:U.ts}];P.length>200&&P.splice(0,200-P.length);for(let Z=P.length-1;Z>=0;Z--)if(P[Z].ts<Q-5e3){P.splice(0,Z);break}console.log(`Debug1: ${JSON.stringify(ae)}`),console.log(`Debug2: ${JSON.stringify(P)}`),ae=P,H(P)}}catch{console.error(`Cannot parse: ${y.val}`)}};return a==null||a.getObject(I).then(F=>{var y;g=(y=F==null?void 0:F.common)==null?void 0:y.engine,a.subscribeObject(I,L),g&&(a.subscribeState(`${g}.alive`,A),a.subscribeState(`${g.replace(/^system\.adapter\./,"")}.debug.rules`,Y))}),function(){a==null||a.unsubscribeState(I,A),g&&(a==null||a.unsubscribeObject(`${g}.alive`,L),T&&(a==null||a.sendTo(g.replace(/^system\.adapter\./,""),"rulesOff",I)),a==null||a.unsubscribeState(`${g.replace(/^system\.adapter\./,"")}.debug.rules`,Y))}},[]),u.useEffect(()=>{w(!S&&O)},[S,O,w]),u.useEffect(()=>{d&&(M(d),W||$(!0))},[d]),u.useEffect(()=>{const g=le(n);JSON.stringify(g)!==JSON.stringify(p)&&(h(g),k(!0))},[n]),u.useEffect(()=>{document.getElementsByTagName("HTML")[0].className=s||"blue"},[s]);const q=u.useCallback(g=>{h(g),_&&e(je(g,_))},[_,e]),B=u.useRef(null),[m,C]=u.useState({835:!1,1035:!1});return u.useEffect(()=>{B.current&&(B.current.clientWidth<=1035&&C({835:!1,1035:!0}),B.current.clientWidth<=835&&C({1035:!0,835:!0}),B.current.clientWidth>1035&&C({835:!1,1035:!1}))},[((j=B.current)==null?void 0:j.clientWidth)||0]),!_||!a?null:t.jsxs("div",{className:ne.wrapperRules,ref:B,children:[t.jsx(Le,{allBlocks:f,socket:a}),W?v==="export"?t.jsx(Ie,{scriptId:I,themeType:i,onClose:()=>$(!1),text:JSON.stringify(p,null,2)}):t.jsx(Oe,{themeType:i,onClose:g=>{$(!1),g&&q(JSON.parse(g))}}):null,t.jsxs("div",{className:x.Utils.clsx(ne.rootWrapper,m[835]&&ne.addClass),children:[t.jsx(Bt,{setAllBlocks:b,allBlocks:f,userRules:p,onChangeBlocks:q,setTourStep:o,tourStep:c,addClass:m,isTourOpen:l}),t.jsx(ce,{socket:a,setUserRules:q,userRules:p,isTourOpen:l,setTourStep:o,tourStep:c,name:`${x.I18n.t("when")}...`,typeBlock:"triggers",iconName:"FlashOn",size:m[835],themeType:i,themeName:s,theme:r}),t.jsx(ce,{socket:a,setUserRules:q,isTourOpen:l,setTourStep:o,tourStep:c,userRules:p,name:`...${x.I18n.t("and")}...`,typeBlock:"conditions",iconName:"Help",nameAdditionally:x.I18n.t("or"),additionally:!0,border:!0,size:m[835],themeType:i,themeName:s,theme:r}),t.jsx(ce,{socket:a,setUserRules:q,isTourOpen:l,setTourStep:o,tourStep:c,userRules:p,name:`...${x.I18n.t("then")}`,typeBlock:"actions",iconName:"PlayForWork",nameAdditionally:x.I18n.t("else"),additionally:!0,size:m[835],themeType:i,themeName:s,theme:r})]})]},"rulesEditor")};export{Ut as default};
@@ -1,36 +0,0 @@
1
- import{g as Be}from"./_commonjsHelpers-Cpj98o6Y.js";import{a as gt,b as bt}from"./iobroker_javascript__mf_v__runtimeInit__mf_v__-DZdFIfoQ.js";import{i,a as Ct}from"./iobroker_javascript__loadShare__react__loadShare__-i8pXne9X.js";import{ai as Qe,aj as vt,ak as Ze,al as Fe,am as _t,an as $t,ao as xt,ap as Mt,j as b,aq as Et,ar as Tt,as as wt,u as Pt,at as jt,n as et,au as kt,T as N,b as Ot,ad as It,h as At}from"./createSvgIcon-DlIk-fDn.js";const{loadShare:Lt}=bt,{initPromise:Rt}=gt,Dt=Rt.then(e=>Lt("react-dom",{customShareInfo:{shareConfig:{singleton:!0,strictVersion:!1,requiredVersion:"*"}}})),Vt=await Dt.then(e=>e());var Nt=Vt;const jr=Be(Nt);var tt={exports:{}},d={};/** @license React v16.13.1
2
- * react-is.production.min.js
3
- *
4
- * Copyright (c) Facebook, Inc. and its affiliates.
5
- *
6
- * This source code is licensed under the MIT license found in the
7
- * LICENSE file in the root directory of this source tree.
8
- */var C=typeof Symbol=="function"&&Symbol.for,ye=C?Symbol.for("react.element"):60103,pe=C?Symbol.for("react.portal"):60106,J=C?Symbol.for("react.fragment"):60107,X=C?Symbol.for("react.strict_mode"):60108,W=C?Symbol.for("react.profiler"):60114,B=C?Symbol.for("react.provider"):60109,Q=C?Symbol.for("react.context"):60110,Se=C?Symbol.for("react.async_mode"):60111,Z=C?Symbol.for("react.concurrent_mode"):60111,ee=C?Symbol.for("react.forward_ref"):60112,te=C?Symbol.for("react.suspense"):60113,Ft=C?Symbol.for("react.suspense_list"):60120,re=C?Symbol.for("react.memo"):60115,oe=C?Symbol.for("react.lazy"):60116,Kt=C?Symbol.for("react.block"):60121,qt=C?Symbol.for("react.fundamental"):60117,Gt=C?Symbol.for("react.responder"):60118,zt=C?Symbol.for("react.scope"):60119;function M(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case ye:switch(e=e.type,e){case Se:case Z:case J:case W:case X:case te:return e;default:switch(e=e&&e.$$typeof,e){case Q:case ee:case oe:case re:case B:return e;default:return t}}case pe:return t}}}function rt(e){return M(e)===Z}d.AsyncMode=Se;d.ConcurrentMode=Z;d.ContextConsumer=Q;d.ContextProvider=B;d.Element=ye;d.ForwardRef=ee;d.Fragment=J;d.Lazy=oe;d.Memo=re;d.Portal=pe;d.Profiler=W;d.StrictMode=X;d.Suspense=te;d.isAsyncMode=function(e){return rt(e)||M(e)===Se};d.isConcurrentMode=rt;d.isContextConsumer=function(e){return M(e)===Q};d.isContextProvider=function(e){return M(e)===B};d.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===ye};d.isForwardRef=function(e){return M(e)===ee};d.isFragment=function(e){return M(e)===J};d.isLazy=function(e){return M(e)===oe};d.isMemo=function(e){return M(e)===re};d.isPortal=function(e){return M(e)===pe};d.isProfiler=function(e){return M(e)===W};d.isStrictMode=function(e){return M(e)===X};d.isSuspense=function(e){return M(e)===te};d.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===J||e===Z||e===W||e===X||e===te||e===Ft||typeof e=="object"&&e!==null&&(e.$$typeof===oe||e.$$typeof===re||e.$$typeof===B||e.$$typeof===Q||e.$$typeof===ee||e.$$typeof===qt||e.$$typeof===Gt||e.$$typeof===zt||e.$$typeof===Kt)};d.typeOf=M;tt.exports=d;var Ht=tt.exports,ge=Ht,Ut={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Yt={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Jt={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},ot={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},be={};be[ge.ForwardRef]=Jt;be[ge.Memo]=ot;function Ke(e){return ge.isMemo(e)?ot:be[e.$$typeof]||Ut}var Xt=Object.defineProperty,Wt=Object.getOwnPropertyNames,qe=Object.getOwnPropertySymbols,Bt=Object.getOwnPropertyDescriptor,Qt=Object.getPrototypeOf,Ge=Object.prototype;function nt(e,t,r){if(typeof t!="string"){if(Ge){var o=Qt(t);o&&o!==Ge&&nt(e,o,r)}var c=Wt(t);qe&&(c=c.concat(qe(t)));for(var s=Ke(e),n=Ke(t),l=0;l<c.length;++l){var a=c[l];if(!Yt[a]&&!(r&&r[a])&&!(n&&n[a])&&!(s&&s[a])){var S=Bt(t,a);try{Xt(e,a,S)}catch{}}}}return e}var Zt=nt;const kr=Be(Zt);var ze=function(t,r){var o=arguments;if(r==null||!$t.call(r,"css"))return i.createElement.apply(void 0,o);var c=o.length,s=new Array(c);s[0]=xt,s[1]=Mt(t,r);for(var n=2;n<c;n++)s[n]=o[n];return i.createElement.apply(null,s)};(function(e){var t;t||(t=e.JSX||(e.JSX={}))})(ze||(ze={}));var er=vt(function(e,t){var r=e.styles,o=Qe([r],void 0,i.useContext(Ze)),c=i.useRef();return Fe(function(){var s=t.key+"-global",n=new t.sheet.constructor({key:s,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),l=!1,a=document.querySelector('style[data-emotion="'+s+" "+o.name+'"]');return t.sheet.tags.length&&(n.before=t.sheet.tags[0]),a!==null&&(l=!0,a.setAttribute("data-emotion",s),n.hydrate([a])),c.current=[n,l],function(){n.flush()}},[t]),Fe(function(){var s=c.current,n=s[0],l=s[1];if(l){s[1]=!1;return}if(o.next!==void 0&&_t(t,o.next,!0),n.tags.length){var a=n.tags[n.tags.length-1].nextElementSibling;n.before=a,n.flush()}t.insert("",o,n,!1)},[t,o.name]),null});function tr(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Qe(t)}function Or(){var e=tr.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}const fe=new Map,rr=(e,t)=>{const r=Tt(e);return r.sheet=new t({key:r.key,nonce:r.sheet.nonce,container:r.sheet.container,speedy:r.sheet.isSpeedy,prepend:r.sheet.prepend,insertionPoint:r.sheet.insertionPoint}),r};let I;if(typeof document=="object"&&(I=document.querySelector('[name="emotion-insertion-point"]'),!I)){I=document.createElement("meta"),I.setAttribute("name","emotion-insertion-point"),I.setAttribute("content","");const e=document.querySelector("head");e&&e.prepend(I)}function or(e,t){if(e||t){class r extends wt{insert(s,n){return this.key&&this.key.endsWith("global")&&(this.before=I),super.insert(s,n)}}const o=rr({key:"css",insertionPoint:e?I:void 0},r);if(t){const c=o.insert;o.insert=(...s)=>(s[1].styles.match(/^@layer\s+[^{]*$/)||(s[1].styles=`@layer mui {${s[1].styles}}`),c(...s))}return o}}function Ir(e){const{injectFirst:t,enableCssLayer:r,children:o}=e,c=i.useMemo(()=>{const s=`${t}-${r}`;if(typeof document=="object"&&fe.has(s))return fe.get(s);const n=or(t,r);return fe.set(s,n),n},[t,r]);return c?b.jsx(Et,{value:c,children:o}):o}function nr(e){return e==null||Object.keys(e).length===0}function st(e){const{styles:t,defaultTheme:r={}}=e,o=typeof t=="function"?c=>t(nr(c)?r:c):t;return b.jsx(er,{styles:o})}function de(e){const t=jt(e);return e!==t&&t.styles?(t.styles.match(/^@layer\s+[^{]*$/)||(t.styles=`@layer global{${t.styles}}`),t):e}function sr({styles:e,themeId:t,defaultTheme:r={}}){const o=Pt(r),c=t&&o[t]||o;let s=typeof e=="function"?e(c):e;return c.modularCssLayers&&(Array.isArray(s)?s=s.map(n=>de(typeof n=="function"?n(c):n)):s=de(s)),b.jsx(st,{styles:s})}const ct=typeof window<"u"?i.useLayoutEffect:i.useEffect;let He=0;function cr(e){const[t,r]=i.useState(e),o=e||t;return i.useEffect(()=>{t==null&&(He+=1,r(`mui-${He}`))},[t]),o}const ir={...Ct},Ue=ir.useId;function ar(e){if(Ue!==void 0){const t=Ue();return e??t}return cr(e)}const it=i.createContext(null);function Ce(){return i.useContext(it)}const lr=typeof Symbol=="function"&&Symbol.for,ur=lr?Symbol.for("mui.nested"):"__THEME_NESTED__";function fr(e,t){return typeof t=="function"?t(e):{...e,...t}}function dr(e){const{children:t,theme:r}=e,o=Ce(),c=i.useMemo(()=>{const s=o===null?{...r}:fr(o,r);return s!=null&&(s[ur]=o!==null),s},[r,o]);return b.jsx(it.Provider,{value:c,children:t})}const at=i.createContext();function mr({value:e,...t}){return b.jsx(at.Provider,{value:e??!0,...t})}const Ar=()=>i.useContext(at)??!1;function hr(e){const t=et(),r=ar()||"",{modularCssLayers:o}=e;let c="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return!o||t!==null?c="":typeof o=="string"?c=o.replace(/mui(?!\.)/g,c):c=`@layer ${c};`,ct(()=>{var l,a;const s=document.querySelector("head");if(!s)return;const n=s.firstChild;if(c){if(n&&((l=n.hasAttribute)!=null&&l.call(n,"data-mui-layer-order"))&&n.getAttribute("data-mui-layer-order")===r)return;const S=document.createElement("style");S.setAttribute("data-mui-layer-order",r),S.textContent=c,s.prepend(S)}else(a=s.querySelector(`style[data-mui-layer-order="${r}"]`))==null||a.remove()},[c,r]),c?b.jsx(sr,{styles:c}):null}const Ye={};function Je(e,t,r,o=!1){return i.useMemo(()=>{const c=e&&t[e]||t;if(typeof r=="function"){const s=r(c),n=e?{...t,[e]:s}:s;return o?()=>n:n}return e?{...t,[e]:r}:{...t,...r}},[e,t,r,o])}function lt(e){const{children:t,theme:r,themeId:o}=e,c=et(Ye),s=Ce()||Ye,n=Je(o,c,r),l=Je(o,s,r,!0),a=(o?n[o]:n).direction==="rtl",S=hr(n);return b.jsx(dr,{theme:l,children:b.jsx(Ze.Provider,{value:n,children:b.jsx(mr,{value:a,children:b.jsxs(kt,{value:o?n[o].components:n.components,children:[S,t]})})})})}const ve="mode",_e="color-scheme",yr="data-color-scheme";function pr(e){const{defaultMode:t="system",defaultLightColorScheme:r="light",defaultDarkColorScheme:o="dark",modeStorageKey:c=ve,colorSchemeStorageKey:s=_e,attribute:n=yr,colorSchemeNode:l="document.documentElement",nonce:a}=e||{};let S="",v=n;if(n==="class"&&(v=".%s"),n==="data"&&(v="[data-%s]"),v.startsWith(".")){const p=v.substring(1);S+=`${l}.classList.remove('${p}'.replace('%s', light), '${p}'.replace('%s', dark));
9
- ${l}.classList.add('${p}'.replace('%s', colorScheme));`}const P=v.match(/\[([^\]]+)\]/);if(P){const[p,h]=P[1].split("=");h||(S+=`${l}.removeAttribute('${p}'.replace('%s', light));
10
- ${l}.removeAttribute('${p}'.replace('%s', dark));`),S+=`
11
- ${l}.setAttribute('${p}'.replace('%s', colorScheme), ${h?`${h}.replace('%s', colorScheme)`:'""'});`}else S+=`${l}.setAttribute('${v}', colorScheme);`;return b.jsx("script",{suppressHydrationWarning:!0,nonce:typeof window>"u"?a:"",dangerouslySetInnerHTML:{__html:`(function() {
12
- try {
13
- let colorScheme = '';
14
- const mode = localStorage.getItem('${c}') || '${t}';
15
- const dark = localStorage.getItem('${s}-dark') || '${o}';
16
- const light = localStorage.getItem('${s}-light') || '${r}';
17
- if (mode === 'system') {
18
- // handle system mode
19
- const mql = window.matchMedia('(prefers-color-scheme: dark)');
20
- if (mql.matches) {
21
- colorScheme = dark
22
- } else {
23
- colorScheme = light
24
- }
25
- }
26
- if (mode === 'light') {
27
- colorScheme = light;
28
- }
29
- if (mode === 'dark') {
30
- colorScheme = dark;
31
- }
32
- if (colorScheme) {
33
- ${S}
34
- }
35
- } catch(e){}})();`}},"mui-color-scheme-init")}function Sr(){}const gr=({key:e,storageWindow:t})=>(!t&&typeof window<"u"&&(t=window),{get(r){if(typeof window>"u")return;if(!t)return r;let o;try{o=t.localStorage.getItem(e)}catch{}return o||r},set:r=>{if(t)try{t.localStorage.setItem(e,r)}catch{}},subscribe:r=>{if(!t)return Sr;const o=c=>{const s=c.newValue;c.key===e&&r(s)};return t.addEventListener("storage",o),()=>{t.removeEventListener("storage",o)}}});function me(){}function Xe(e){if(typeof window<"u"&&typeof window.matchMedia=="function"&&e==="system")return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function ut(e,t){if(e.mode==="light"||e.mode==="system"&&e.systemMode==="light")return t("light");if(e.mode==="dark"||e.mode==="system"&&e.systemMode==="dark")return t("dark")}function br(e){return ut(e,t=>{if(t==="light")return e.lightColorScheme;if(t==="dark")return e.darkColorScheme})}function Cr(e){const{defaultMode:t="light",defaultLightColorScheme:r,defaultDarkColorScheme:o,supportedColorSchemes:c=[],modeStorageKey:s=ve,colorSchemeStorageKey:n=_e,storageWindow:l=typeof window>"u"?void 0:window,storageManager:a=gr,noSsr:S=!1}=e,v=c.join(","),P=c.length>1,p=i.useMemo(()=>a==null?void 0:a({key:s,storageWindow:l}),[a,s,l]),h=i.useMemo(()=>a==null?void 0:a({key:`${n}-light`,storageWindow:l}),[a,n,l]),g=i.useMemo(()=>a==null?void 0:a({key:`${n}-dark`,storageWindow:l}),[a,n,l]),[k,R]=i.useState(()=>{const u=(p==null?void 0:p.get(t))||t,f=(h==null?void 0:h.get(r))||r,m=(g==null?void 0:g.get(o))||o;return{mode:u,systemMode:Xe(u),lightColorScheme:f,darkColorScheme:m}}),[A,ne]=i.useState(S||!P);i.useEffect(()=>{ne(!0)},[]);const F=br(k),K=i.useCallback(u=>{R(f=>{if(u===f.mode)return f;const m=u??t;return p==null||p.set(m),{...f,mode:m,systemMode:Xe(m)}})},[p,t]),D=i.useCallback(u=>{u?typeof u=="string"?u&&!v.includes(u)?console.error(`\`${u}\` does not exist in \`theme.colorSchemes\`.`):R(f=>{const m={...f};return ut(f,y=>{y==="light"&&(h==null||h.set(u),m.lightColorScheme=u),y==="dark"&&(g==null||g.set(u),m.darkColorScheme=u)}),m}):R(f=>{const m={...f},y=u.light===null?r:u.light,L=u.dark===null?o:u.dark;return y&&(v.includes(y)?(m.lightColorScheme=y,h==null||h.set(y)):console.error(`\`${y}\` does not exist in \`theme.colorSchemes\`.`)),L&&(v.includes(L)?(m.darkColorScheme=L,g==null||g.set(L)):console.error(`\`${L}\` does not exist in \`theme.colorSchemes\`.`)),m}):R(f=>(h==null||h.set(r),g==null||g.set(o),{...f,lightColorScheme:r,darkColorScheme:o}))},[v,h,g,r,o]),q=i.useCallback(u=>{k.mode==="system"&&R(f=>{const m=u!=null&&u.matches?"dark":"light";return f.systemMode===m?f:{...f,systemMode:m}})},[k.mode]),U=i.useRef(q);return U.current=q,i.useEffect(()=>{if(typeof window.matchMedia!="function"||!P)return;const u=(...m)=>U.current(...m),f=window.matchMedia("(prefers-color-scheme: dark)");return f.addListener(u),u(f),()=>{f.removeListener(u)}},[P]),i.useEffect(()=>{if(P){const u=(p==null?void 0:p.subscribe(y=>{(!y||["light","dark","system"].includes(y))&&K(y||t)}))||me,f=(h==null?void 0:h.subscribe(y=>{(!y||v.match(y))&&D({light:y})}))||me,m=(g==null?void 0:g.subscribe(y=>{(!y||v.match(y))&&D({dark:y})}))||me;return()=>{u(),f(),m()}}},[D,K,v,t,l,P,p,h,g]),{...k,mode:A?k.mode:void 0,systemMode:A?k.systemMode:void 0,colorScheme:A?F:void 0,setMode:K,setColorScheme:D}}const vr="*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function _r(e){const{themeId:t,theme:r={},modeStorageKey:o=ve,colorSchemeStorageKey:c=_e,disableTransitionOnChange:s=!1,defaultColorScheme:n,resolveTheme:l}=e,a={allColorSchemes:[],colorScheme:void 0,darkColorScheme:void 0,lightColorScheme:void 0,mode:void 0,setColorScheme:()=>{},setMode:()=>{},systemMode:void 0},S=i.createContext(void 0),v=()=>i.useContext(S)||a,P={},p={};function h(A){var Re,De,Ve,Ne;const{children:ne,theme:F,modeStorageKey:K=o,colorSchemeStorageKey:D=c,disableTransitionOnChange:q=s,storageManager:U,storageWindow:u=typeof window>"u"?void 0:window,documentNode:f=typeof document>"u"?void 0:document,colorSchemeNode:m=typeof document>"u"?void 0:document.documentElement,disableNestedContext:y=!1,disableStyleSheetGeneration:L=!1,defaultMode:dt="system",noSsr:mt}=A,se=i.useRef(!1),ce=Ce(),ie=i.useContext(S),ae=!!ie&&!y,$e=i.useMemo(()=>F||(typeof r=="function"?r():r),[F]),xe=$e[t],E=xe||$e,{colorSchemes:O=P,components:Me=p,cssVarPrefix:le}=E,Ee=Object.keys(O).filter(_=>!!O[_]).join(","),V=i.useMemo(()=>Ee.split(","),[Ee]),Te=typeof n=="string"?n:n.light,we=typeof n=="string"?n:n.dark,ht=O[Te]&&O[we]?dt:((De=(Re=O[E.defaultColorScheme])==null?void 0:Re.palette)==null?void 0:De.mode)||((Ve=E.palette)==null?void 0:Ve.mode),{mode:yt,setMode:Pe,systemMode:je,lightColorScheme:ke,darkColorScheme:Oe,colorScheme:pt,setColorScheme:Ie}=Cr({supportedColorSchemes:V,defaultLightColorScheme:Te,defaultDarkColorScheme:we,modeStorageKey:K,colorSchemeStorageKey:D,defaultMode:ht,storageManager:U,storageWindow:u,noSsr:mt});let ue=yt,T=pt;ae&&(ue=ie.mode,T=ie.colorScheme);const G=i.useMemo(()=>{var H;const _=T||E.defaultColorScheme,$=((H=E.generateThemeVars)==null?void 0:H.call(E))||E.vars,x={...E,components:Me,colorSchemes:O,cssVarPrefix:le,vars:$};if(typeof x.generateSpacing=="function"&&(x.spacing=x.generateSpacing()),_){const w=O[_];w&&typeof w=="object"&&Object.keys(w).forEach(j=>{w[j]&&typeof w[j]=="object"?x[j]={...x[j],...w[j]}:x[j]=w[j]})}return l?l(x):x},[E,T,Me,O,le]),z=E.colorSchemeSelector;ct(()=>{if(T&&m&&z&&z!=="media"){const _=z;let $=z;if(_==="class"&&($=".%s"),_==="data"&&($="[data-%s]"),_!=null&&_.startsWith("data-")&&!_.includes("%s")&&($=`[${_}="%s"]`),$.startsWith("."))m.classList.remove(...V.map(x=>$.substring(1).replace("%s",x))),m.classList.add($.substring(1).replace("%s",T));else{const x=$.replace("%s",T).match(/\[([^\]]+)\]/);if(x){const[H,w]=x[1].split("=");w||V.forEach(j=>{m.removeAttribute(H.replace(T,j))}),m.setAttribute(H,w?w.replace(/"|'/g,""):"")}else m.setAttribute($,T)}}},[T,z,m,V]),i.useEffect(()=>{let _;if(q&&se.current&&f){const $=f.createElement("style");$.appendChild(f.createTextNode(vr)),f.head.appendChild($),window.getComputedStyle(f.body),_=setTimeout(()=>{f.head.removeChild($)},1)}return()=>{clearTimeout(_)}},[T,q,f]),i.useEffect(()=>(se.current=!0,()=>{se.current=!1}),[]);const St=i.useMemo(()=>({allColorSchemes:V,colorScheme:T,darkColorScheme:Oe,lightColorScheme:ke,mode:ue,setColorScheme:Ie,setMode:Pe,systemMode:je}),[V,T,Oe,ke,ue,Ie,Pe,je,G.colorSchemeSelector]);let Ae=!0;(L||E.cssVariables===!1||ae&&(ce==null?void 0:ce.cssVarPrefix)===le)&&(Ae=!1);const Le=b.jsxs(i.Fragment,{children:[b.jsx(lt,{themeId:xe?t:void 0,theme:G,children:ne}),Ae&&b.jsx(st,{styles:((Ne=G.generateStyleSheets)==null?void 0:Ne.call(G))||[]})]});return ae?Le:b.jsx(S.Provider,{value:St,children:Le})}const g=typeof n=="string"?n:n.light,k=typeof n=="string"?n:n.dark;return{CssVarsProvider:h,useColorScheme:v,getInitColorSchemeScript:A=>pr({colorSchemeStorageKey:c,defaultLightColorScheme:g,defaultDarkColorScheme:k,modeStorageKey:o,...A})}}function $r({theme:e,...t}){const r=N in e?e[N]:void 0;return b.jsx(lt,{...t,themeId:r?N:void 0,theme:r||e})}const Y={colorSchemeStorageKey:"mui-color-scheme",defaultLightColorScheme:"light",defaultDarkColorScheme:"dark",modeStorageKey:"mui-mode"},{CssVarsProvider:ft,useColorScheme:Lr,getInitColorSchemeScript:xr}=_r({themeId:N,theme:()=>Ot({cssVariables:!0}),colorSchemeStorageKey:Y.colorSchemeStorageKey,modeStorageKey:Y.modeStorageKey,defaultColorScheme:{light:Y.defaultLightColorScheme,dark:Y.defaultDarkColorScheme},resolveTheme:e=>{const t={...e,typography:It(e.palette,e.typography)};return t.unstable_sx=function(o){return At({sx:o,theme:this})},t}});function Rr(e){return b.jsx(ft,{...e})}let We=!1;const Dr=e=>(We||(console.warn(["MUI: The getInitColorSchemeScript function has been deprecated.","","You should use `import InitColorSchemeScript from '@mui/material/InitColorSchemeScript'`","and replace the function call with `<InitColorSchemeScript />` instead."].join(`
36
- `)),We=!0),xr(e)),Mr=ft;function Vr({theme:e,...t}){const r=i.useMemo(()=>{if(typeof e=="function")return e;const o=N in e?e[N]:e;return"colorSchemes"in o?null:"vars"in o?e:{...e,vars:null}},[e]);return r?b.jsx($r,{theme:r,...t}):b.jsx(Mr,{theme:e,...t})}const Nr={50:"#fffde7",100:"#fff9c4",200:"#fff59d",300:"#fff176",400:"#ffee58",500:"#ffeb3b",600:"#fdd835",700:"#fbc02d",800:"#f9a825",900:"#f57f17",A100:"#ffff8d",A200:"#ffff00",A400:"#ffea00",A700:"#ffd600"};function Fr(e,t){if(e==null)return{};var r={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.indexOf(o)!==-1)continue;r[o]=e[o]}return r}function he(e,t){return he=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},he(e,t)}function Kr(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,he(e,t)}export{Mr as C,Rr as E,sr as G,jr as R,Ir as S,Vr as T,Kr as _,Fr as a,ar as b,tr as c,Ar as d,Lr as e,Dr as g,Nt as i,Or as k,kr as m,ct as u,Nr as y};
@@ -1 +0,0 @@
1
- import{g as i}from"./_commonjsHelpers-Cpj98o6Y.js";import{a as _,b as c}from"./iobroker_javascript__mf_v__runtimeInit__mf_v__-DZdFIfoQ.js";function f(e,s){for(var o=0;o<s.length;o++){const r=s[o];if(typeof r!="string"&&!Array.isArray(r)){for(const t in r)if(t!=="default"&&!(t in e)){const a=Object.getOwnPropertyDescriptor(r,t);a&&Object.defineProperty(e,t,a.get?a:{enumerable:!0,get:()=>r[t]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const{loadShare:l}=c,{initPromise:u}=_,p=u.then(e=>l("react",{customShareInfo:{shareConfig:{singleton:!0,strictVersion:!1,requiredVersion:"*"}}})),m=await p.then(e=>e());var n=m;const d=i(n),h=f({__proto__:null,default:d},[n]);export{d as R,h as a,n as i};
@@ -1,5 +0,0 @@
1
- var index_cjs$3={},index_cjs$2={},polyfills_cjs$1={};function _extends$2(){return _extends$2=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},_extends$2.apply(this,arguments)}function _object_without_properties_loose(t,e){if(t==null)return{};var r={},o=Object.keys(t),n,i;for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&(r[n]=t[n]);return r}polyfills_cjs$1._extends=_extends$2;polyfills_cjs$1._object_without_properties_loose=_object_without_properties_loose;var index_cjs$1={},polyfills_cjs={};function _extends$1(){return _extends$1=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},_extends$1.apply(this,arguments)}polyfills_cjs._=_extends$1;var define_process_env_default={},polyfills$1=polyfills_cjs;const FederationModuleManifest="federation-manifest.json",MANIFEST_EXT=".json",BROWSER_LOG_KEY="FEDERATION_DEBUG",NameTransformSymbol={AT:"@",HYPHEN:"-",SLASH:"/"},NameTransformMap={[NameTransformSymbol.AT]:"scope_",[NameTransformSymbol.HYPHEN]:"_",[NameTransformSymbol.SLASH]:"__"},EncodedNameTransformMap={[NameTransformMap[NameTransformSymbol.AT]]:NameTransformSymbol.AT,[NameTransformMap[NameTransformSymbol.HYPHEN]]:NameTransformSymbol.HYPHEN,[NameTransformMap[NameTransformSymbol.SLASH]]:NameTransformSymbol.SLASH},SEPARATOR=":",ManifestFileName="mf-manifest.json",StatsFileName="mf-stats.json",MFModuleType={NPM:"npm",APP:"app"},MODULE_DEVTOOL_IDENTIFIER="__MF_DEVTOOLS_MODULE_INFO__",ENCODE_NAME_PREFIX="ENCODE_NAME_PREFIX",TEMP_DIR=".federation",MFPrefetchCommon={identifier:"MFDataPrefetch",globalKey:"__PREFETCH__",library:"mf-data-prefetch",exportsKey:"__PREFETCH_EXPORTS__",fileName:"bootstrap.js"};var ContainerPlugin=Object.freeze({__proto__:null}),ContainerReferencePlugin=Object.freeze({__proto__:null}),ModuleFederationPlugin=Object.freeze({__proto__:null}),SharePlugin=Object.freeze({__proto__:null});function isBrowserEnv(){return typeof window<"u"&&typeof window.document<"u"}function isReactNativeEnv(){var t;return typeof navigator<"u"&&((t=navigator)==null?void 0:t.product)==="ReactNative"}function isBrowserDebug(){try{if(isBrowserEnv()&&window.localStorage)return!!localStorage.getItem(BROWSER_LOG_KEY)}catch{return!1}return!1}function isDebugMode(){return typeof process<"u"&&define_process_env_default&&define_process_env_default.FEDERATION_DEBUG?!!define_process_env_default.FEDERATION_DEBUG:typeof FEDERATION_DEBUG<"u"&&FEDERATION_DEBUG?!0:isBrowserDebug()}const getProcessEnv=function(){return typeof process<"u"&&define_process_env_default?define_process_env_default:{}},LOG_CATEGORY$1="[ Federation Runtime ]",parseEntry=(t,e,r=SEPARATOR)=>{const o=t.split(r),n=getProcessEnv().NODE_ENV==="development"&&e,i="*",a=s=>s.startsWith("http")||s.includes(MANIFEST_EXT);if(o.length>=2){let[s,...l]=o;t.startsWith(r)&&(s=o.slice(0,2).join(r),l=[n||o.slice(2).join(r)]);let c=n||l.join(r);return a(c)?{name:s,entry:c}:{name:s,version:c||i}}else if(o.length===1){const[s]=o;return n&&a(n)?{name:s,entry:n}:{name:s,version:n||i}}else throw`Invalid entry value: ${t}`},composeKeyWithSeparator=function(...t){return t.length?t.reduce((e,r)=>r?e?`${e}${SEPARATOR}${r}`:r:e,""):""},encodeName=function(t,e="",r=!1){try{const o=r?".js":"";return`${e}${t.replace(new RegExp(`${NameTransformSymbol.AT}`,"g"),NameTransformMap[NameTransformSymbol.AT]).replace(new RegExp(`${NameTransformSymbol.HYPHEN}`,"g"),NameTransformMap[NameTransformSymbol.HYPHEN]).replace(new RegExp(`${NameTransformSymbol.SLASH}`,"g"),NameTransformMap[NameTransformSymbol.SLASH])}${o}`}catch(o){throw o}},decodeName=function(t,e,r){try{let o=t;if(e){if(!o.startsWith(e))return o;o=o.replace(new RegExp(e,"g"),"")}return o=o.replace(new RegExp(`${NameTransformMap[NameTransformSymbol.AT]}`,"g"),EncodedNameTransformMap[NameTransformMap[NameTransformSymbol.AT]]).replace(new RegExp(`${NameTransformMap[NameTransformSymbol.SLASH]}`,"g"),EncodedNameTransformMap[NameTransformMap[NameTransformSymbol.SLASH]]).replace(new RegExp(`${NameTransformMap[NameTransformSymbol.HYPHEN]}`,"g"),EncodedNameTransformMap[NameTransformMap[NameTransformSymbol.HYPHEN]]),r&&(o=o.replace(".js","")),o}catch(o){throw o}},generateExposeFilename=(t,e)=>{if(!t)return"";let r=t;return r==="."&&(r="default_export"),r.startsWith("./")&&(r=r.replace("./","")),encodeName(r,"__federation_expose_",e)},generateShareFilename=(t,e)=>t?encodeName(t,"__federation_shared_",e):"",getResourceUrl=(t,e)=>{if("getPublicPath"in t){let r;return t.getPublicPath.startsWith("function")?r=new Function("return "+t.getPublicPath)()():r=new Function(t.getPublicPath)(),`${r}${e}`}else return"publicPath"in t?!isBrowserEnv()&&!isReactNativeEnv()&&"ssrPublicPath"in t?`${t.ssrPublicPath}${e}`:`${t.publicPath}${e}`:(console.warn("Cannot get resource URL. If in debug mode, please ignore.",t,e),"")},assert$1=(t,e)=>{t||error$1(e)},error$1=t=>{throw new Error(`${LOG_CATEGORY$1}: ${t}`)},warn$1=t=>{console.warn(`${LOG_CATEGORY$1}: ${t}`)};function safeToString(t){try{return JSON.stringify(t,null,2)}catch{return""}}const VERSION_PATTERN_REGEXP=/^([\d^=v<>~]|[*xX]$)/;function isRequiredVersion(t){return VERSION_PATTERN_REGEXP.test(t)}const simpleJoinRemoteEntry=(t,e)=>{if(!t)return e;const o=(n=>{if(n===".")return"";if(n.startsWith("./"))return n.replace("./","");if(n.startsWith("/")){const i=n.slice(1);return i.endsWith("/")?i.slice(0,-1):i}return n})(t);return o?o.endsWith("/")?`${o}${e}`:`${o}/${e}`:e};function inferAutoPublicPath(t){return t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")}function generateSnapshotFromManifest(t,e={}){var r,o;const{remotes:n={},overrides:i={},version:a}=e;let s;const l=()=>"publicPath"in t.metaData?t.metaData.publicPath==="auto"&&a?inferAutoPublicPath(a):t.metaData.publicPath:t.metaData.getPublicPath,c=Object.keys(i);let u={};if(!Object.keys(n).length){var d;u=((d=t.remotes)==null?void 0:d.reduce((E,S)=>{let T;const $=S.federationContainerName;return c.includes($)?T=i[$]:"version"in S?T=S.version:T=S.entry,E[$]={matchedVersion:T},E},{}))||{}}Object.keys(n).forEach(E=>u[E]={matchedVersion:c.includes(E)?i[E]:n[E]});const{remoteEntry:{path:h,name:p,type:_},types:y,buildInfo:{buildVersion:m},globalName:g,ssrRemoteEntry:I}=t.metaData,{exposes:b}=t;let R={version:a||"",buildVersion:m,globalName:g,remoteEntry:simpleJoinRemoteEntry(h,p),remoteEntryType:_,remoteTypes:simpleJoinRemoteEntry(y.path,y.name),remoteTypesZip:y.zip||"",remoteTypesAPI:y.api||"",remotesInfo:u,shared:t==null?void 0:t.shared.map(E=>({assets:E.assets,sharedName:E.name,version:E.version})),modules:b==null?void 0:b.map(E=>({moduleName:E.name,modulePath:E.path,assets:E.assets}))};if((r=t.metaData)!=null&&r.prefetchInterface){const E=t.metaData.prefetchInterface;R=polyfills$1._({},R,{prefetchInterface:E})}if((o=t.metaData)!=null&&o.prefetchEntry){const{path:E,name:S,type:T}=t.metaData.prefetchEntry;R=polyfills$1._({},R,{prefetchEntry:simpleJoinRemoteEntry(E,S),prefetchEntryType:T})}if("publicPath"in t.metaData?s=polyfills$1._({},R,{publicPath:l(),ssrPublicPath:t.metaData.ssrPublicPath}):s=polyfills$1._({},R,{getPublicPath:l()}),I){const E=simpleJoinRemoteEntry(I.path,I.name);s.ssrRemoteEntry=E,s.ssrRemoteEntryType=I.type||"commonjs-module"}return s}function isManifestProvider(t){return!!("remoteEntry"in t&&t.remoteEntry.includes(MANIFEST_EXT))}const PREFIX="[ Module Federation ]";let Logger=class{setPrefix(e){this.prefix=e}log(...e){console.log(this.prefix,...e)}warn(...e){console.log(this.prefix,...e)}error(...e){console.log(this.prefix,...e)}success(...e){console.log(this.prefix,...e)}info(...e){console.log(this.prefix,...e)}ready(...e){console.log(this.prefix,...e)}debug(...e){isDebugMode()&&console.log(this.prefix,...e)}constructor(e){this.prefix=e}};function createLogger(t){return new Logger(t)}const logger$1=createLogger(PREFIX);async function safeWrapper$1(t,e){try{return await t()}catch(r){!e&&warn$1(r);return}}function isStaticResourcesEqual$1(t,e){const r=/^(https?:)?\/\//i,o=t.replace(r,"").replace(/\/$/,""),n=e.replace(r,"").replace(/\/$/,"");return o===n}function createScript(t){let e=null,r=!0,o=2e4,n;const i=document.getElementsByTagName("script");for(let s=0;s<i.length;s++){const l=i[s],c=l.getAttribute("src");if(c&&isStaticResourcesEqual$1(c,t.url)){e=l,r=!1;break}}if(!e){const s=t.attrs;e=document.createElement("script"),e.type=(s==null?void 0:s.type)==="module"?"module":"text/javascript";let l;t.createScriptHook&&(l=t.createScriptHook(t.url,t.attrs),l instanceof HTMLScriptElement?e=l:typeof l=="object"&&("script"in l&&l.script&&(e=l.script),"timeout"in l&&l.timeout&&(o=l.timeout))),e.src||(e.src=t.url),s&&!l&&Object.keys(s).forEach(c=>{e&&(c==="async"||c==="defer"?e[c]=s[c]:e.getAttribute(c)||e.setAttribute(c,s[c]))})}const a=async(s,l)=>{clearTimeout(n);const c=()=>{(l==null?void 0:l.type)==="error"?t!=null&&t.onErrorCallback&&(t==null||t.onErrorCallback(l)):t!=null&&t.cb&&(t==null||t.cb())};if(e&&(e.onerror=null,e.onload=null,safeWrapper$1(()=>{const{needDeleteScript:u=!0}=t;u&&e!=null&&e.parentNode&&e.parentNode.removeChild(e)}),s&&typeof s=="function")){const u=s(l);if(u instanceof Promise){const d=await u;return c(),d}return c(),u}c()};return e.onerror=a.bind(null,e.onerror),e.onload=a.bind(null,e.onload),n=setTimeout(()=>{a(null,new Error(`Remote script "${t.url}" time-outed.`))},o),{script:e,needAttach:r}}function createLink(t){let e=null,r=!0;const o=document.getElementsByTagName("link");for(let i=0;i<o.length;i++){const a=o[i],s=a.getAttribute("href"),l=a.getAttribute("rel");if(s&&isStaticResourcesEqual$1(s,t.url)&&l===t.attrs.rel){e=a,r=!1;break}}if(!e){e=document.createElement("link"),e.setAttribute("href",t.url);let i;const a=t.attrs;t.createLinkHook&&(i=t.createLinkHook(t.url,a),i instanceof HTMLLinkElement&&(e=i)),a&&!i&&Object.keys(a).forEach(s=>{e&&!e.getAttribute(s)&&e.setAttribute(s,a[s])})}const n=(i,a)=>{const s=()=>{(a==null?void 0:a.type)==="error"?t!=null&&t.onErrorCallback&&(t==null||t.onErrorCallback(a)):t!=null&&t.cb&&(t==null||t.cb())};if(e&&(e.onerror=null,e.onload=null,safeWrapper$1(()=>{const{needDeleteLink:l=!0}=t;l&&e!=null&&e.parentNode&&e.parentNode.removeChild(e)}),i)){const l=i(a);return s(),l}s()};return e.onerror=n.bind(null,e.onerror),e.onload=n.bind(null,e.onload),{link:e,needAttach:r}}function loadScript(t,e){const{attrs:r={},createScriptHook:o}=e;return new Promise((n,i)=>{const{script:a,needAttach:s}=createScript({url:t,cb:n,onErrorCallback:i,attrs:polyfills$1._({fetchpriority:"high"},r),createScriptHook:o,needDeleteScript:!0});s&&document.head.appendChild(a)})}const sdkImportCache=new Map;function importNodeModule(t){if(!t)throw new Error("import specifier is required");if(sdkImportCache.has(t))return sdkImportCache.get(t);const r=new Function("name","return import(name)")(t).then(o=>o).catch(o=>{throw console.error(`Error importing module ${t}:`,o),sdkImportCache.delete(t),o});return sdkImportCache.set(t,r),r}const loadNodeFetch=async()=>{const t=await importNodeModule("node-fetch");return t.default||t},lazyLoaderHookFetch=async(t,e,r)=>{const n=await((i,a)=>r.lifecycle.fetch.emit(i,a))(t,e||{});return!n||!(n instanceof Response)?(typeof fetch>"u"?await loadNodeFetch():fetch)(t,e||{}):n},createScriptNode=typeof ENV_TARGET>"u"||ENV_TARGET!=="web"?(url,cb,attrs,loaderHook)=>{if(loaderHook!=null&&loaderHook.createScriptHook){const t=loaderHook.createScriptHook(url);t&&typeof t=="object"&&"url"in t&&(url=t.url)}let urlObj;try{urlObj=new URL(url)}catch(t){console.error("Error constructing URL:",t),cb(new Error(`Invalid URL: ${t}`));return}const getFetch=async()=>loaderHook!=null&&loaderHook.fetch?(t,e)=>lazyLoaderHookFetch(t,e,loaderHook):typeof fetch>"u"?loadNodeFetch():fetch,handleScriptFetch=async(f,urlObj)=>{try{var _vm_constants;const res=await f(urlObj.href),data=await res.text(),[path,vm]=await Promise.all([importNodeModule("path"),importNodeModule("vm")]),scriptContext={exports:{},module:{exports:{}}},urlDirname=urlObj.pathname.split("/").slice(0,-1).join("/"),filename=path.basename(urlObj.pathname);var _vm_constants_USE_MAIN_CONTEXT_DEFAULT_LOADER;const script=new vm.Script(`(function(exports, module, require, __dirname, __filename) {${data}
2
- })`,{filename,importModuleDynamically:(_vm_constants_USE_MAIN_CONTEXT_DEFAULT_LOADER=(_vm_constants=vm.constants)==null?void 0:_vm_constants.USE_MAIN_CONTEXT_DEFAULT_LOADER)!=null?_vm_constants_USE_MAIN_CONTEXT_DEFAULT_LOADER:importNodeModule});script.runInThisContext()(scriptContext.exports,scriptContext.module,eval("require"),urlDirname,filename);const exportedInterface=scriptContext.module.exports||scriptContext.exports;if(attrs&&exportedInterface&&attrs.globalName){const t=exportedInterface[attrs.globalName]||exportedInterface;cb(void 0,t);return}cb(void 0,exportedInterface)}catch(t){cb(t instanceof Error?t:new Error(`Script execution error: ${t}`))}};getFetch().then(async t=>{if((attrs==null?void 0:attrs.type)==="esm"||(attrs==null?void 0:attrs.type)==="module")return loadModule(urlObj.href,{fetch:t,vm:await importNodeModule("vm")}).then(async e=>{await e.evaluate(),cb(void 0,e.namespace)}).catch(e=>{cb(e instanceof Error?e:new Error(`Script execution error: ${e}`))});handleScriptFetch(t,urlObj)}).catch(t=>{cb(t)})}:(t,e,r,o)=>{e(new Error("createScriptNode is disabled in non-Node.js environment"))},loadScriptNode=typeof ENV_TARGET>"u"||ENV_TARGET!=="web"?(t,e)=>new Promise((r,o)=>{createScriptNode(t,(n,i)=>{if(n)o(n);else{var a,s;const l=(e==null||(a=e.attrs)==null?void 0:a.globalName)||`__FEDERATION_${e==null||(s=e.attrs)==null?void 0:s.name}:custom__`,c=globalThis[l]=i;r(c)}},e.attrs,e.loaderHook)}):(t,e)=>{throw new Error("loadScriptNode is disabled in non-Node.js environment")},esmModuleCache=new Map;async function loadModule(t,e){if(esmModuleCache.has(t))return esmModuleCache.get(t);const{fetch:r,vm:o}=e,i=await(await r(t)).text(),a=new o.SourceTextModule(i,{importModuleDynamically:async(s,l)=>{const c=new URL(s,t).href;return loadModule(c,e)}});return esmModuleCache.set(t,a),await a.link(async s=>{const l=new URL(s,t).href;return await loadModule(l,e)}),a}function normalizeOptions(t,e,r){return function(o){if(o===!1)return!1;if(typeof o>"u")return t?e:!1;if(o===!0)return e;if(o&&typeof o=="object")return polyfills$1._({},e,o);throw new Error(`Unexpected type for \`${r}\`, expect boolean/undefined/object, got: ${typeof o}`)}}const createModuleFederationConfig=t=>t;index_cjs$1.BROWSER_LOG_KEY=BROWSER_LOG_KEY;index_cjs$1.ENCODE_NAME_PREFIX=ENCODE_NAME_PREFIX;index_cjs$1.EncodedNameTransformMap=EncodedNameTransformMap;index_cjs$1.FederationModuleManifest=FederationModuleManifest;index_cjs$1.MANIFEST_EXT=MANIFEST_EXT;index_cjs$1.MFModuleType=MFModuleType;index_cjs$1.MFPrefetchCommon=MFPrefetchCommon;index_cjs$1.MODULE_DEVTOOL_IDENTIFIER=MODULE_DEVTOOL_IDENTIFIER;index_cjs$1.ManifestFileName=ManifestFileName;index_cjs$1.NameTransformMap=NameTransformMap;index_cjs$1.NameTransformSymbol=NameTransformSymbol;index_cjs$1.SEPARATOR=SEPARATOR;index_cjs$1.StatsFileName=StatsFileName;index_cjs$1.TEMP_DIR=TEMP_DIR;index_cjs$1.assert=assert$1;index_cjs$1.composeKeyWithSeparator=composeKeyWithSeparator;index_cjs$1.containerPlugin=ContainerPlugin;index_cjs$1.containerReferencePlugin=ContainerReferencePlugin;index_cjs$1.createLink=createLink;index_cjs$1.createLogger=createLogger;index_cjs$1.createModuleFederationConfig=createModuleFederationConfig;index_cjs$1.createScript=createScript;index_cjs$1.createScriptNode=createScriptNode;index_cjs$1.decodeName=decodeName;index_cjs$1.encodeName=encodeName;index_cjs$1.error=error$1;index_cjs$1.generateExposeFilename=generateExposeFilename;index_cjs$1.generateShareFilename=generateShareFilename;index_cjs$1.generateSnapshotFromManifest=generateSnapshotFromManifest;index_cjs$1.getProcessEnv=getProcessEnv;index_cjs$1.getResourceUrl=getResourceUrl;index_cjs$1.inferAutoPublicPath=inferAutoPublicPath;index_cjs$1.isBrowserEnv=isBrowserEnv;index_cjs$1.isDebugMode=isDebugMode;index_cjs$1.isManifestProvider=isManifestProvider;index_cjs$1.isReactNativeEnv=isReactNativeEnv;index_cjs$1.isRequiredVersion=isRequiredVersion;index_cjs$1.isStaticResourcesEqual=isStaticResourcesEqual$1;index_cjs$1.loadScript=loadScript;index_cjs$1.loadScriptNode=loadScriptNode;index_cjs$1.logger=logger$1;index_cjs$1.moduleFederationPlugin=ModuleFederationPlugin;index_cjs$1.normalizeOptions=normalizeOptions;index_cjs$1.parseEntry=parseEntry;index_cjs$1.safeToString=safeToString;index_cjs$1.safeWrapper=safeWrapper$1;index_cjs$1.sharePlugin=SharePlugin;index_cjs$1.simpleJoinRemoteEntry=simpleJoinRemoteEntry;index_cjs$1.warn=warn$1;var index_cjs={};const RUNTIME_001="RUNTIME-001",RUNTIME_002="RUNTIME-002",RUNTIME_003="RUNTIME-003",RUNTIME_004="RUNTIME-004",RUNTIME_005="RUNTIME-005",RUNTIME_006="RUNTIME-006",RUNTIME_007="RUNTIME-007",RUNTIME_008="RUNTIME-008",RUNTIME_009="RUNTIME-009",TYPE_001="TYPE-001",BUILD_001="BUILD-001",BUILD_002="BUILD-002",getDocsUrl=t=>`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${t.split("-")[0].toLowerCase()}/${t}`,getShortErrorMsg=(t,e,r,o)=>{const n=[`${[e[t]]} #${t}`];return r&&n.push(`args: ${JSON.stringify(r)}`),n.push(getDocsUrl(t)),o&&n.push(`Original Error Message:
3
- ${o}`),n.join(`
4
- `)};function _extends(){return _extends=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},_extends.apply(this,arguments)}const runtimeDescMap={[RUNTIME_001]:"Failed to get remoteEntry exports.",[RUNTIME_002]:'The remote entry interface does not contain "init"',[RUNTIME_003]:"Failed to get manifest.",[RUNTIME_004]:"Failed to locate remote.",[RUNTIME_005]:"Invalid loadShareSync function call from bundler runtime",[RUNTIME_006]:"Invalid loadShareSync function call from runtime",[RUNTIME_007]:"Failed to get remote snapshot.",[RUNTIME_008]:"Failed to load script resources.",[RUNTIME_009]:"Please call createInstance first."},typeDescMap={[TYPE_001]:"Failed to generate type declaration. Execute the below cmd to reproduce and fix the error."},buildDescMap={[BUILD_001]:"Failed to find expose module.",[BUILD_002]:"PublicPath is required in prod mode."},errorDescMap=_extends({},runtimeDescMap,typeDescMap,buildDescMap);index_cjs.BUILD_001=BUILD_001;index_cjs.BUILD_002=BUILD_002;index_cjs.RUNTIME_001=RUNTIME_001;index_cjs.RUNTIME_002=RUNTIME_002;index_cjs.RUNTIME_003=RUNTIME_003;index_cjs.RUNTIME_004=RUNTIME_004;index_cjs.RUNTIME_005=RUNTIME_005;index_cjs.RUNTIME_006=RUNTIME_006;index_cjs.RUNTIME_007=RUNTIME_007;index_cjs.RUNTIME_008=RUNTIME_008;index_cjs.RUNTIME_009=RUNTIME_009;index_cjs.TYPE_001=TYPE_001;index_cjs.buildDescMap=buildDescMap;index_cjs.errorDescMap=errorDescMap;index_cjs.getShortErrorMsg=getShortErrorMsg;index_cjs.runtimeDescMap=runtimeDescMap;index_cjs.typeDescMap=typeDescMap;var polyfills=polyfills_cjs$1,sdk=index_cjs$1,errorCodes$1=index_cjs;const LOG_CATEGORY="[ Federation Runtime ]",logger=sdk.createLogger(LOG_CATEGORY);function assert(t,e){t||error(e)}function error(t){throw t instanceof Error?(t.message.startsWith(LOG_CATEGORY)||(t.message=`${LOG_CATEGORY}: ${t.message}`),t):new Error(`${LOG_CATEGORY}: ${t}`)}function warn(t){t instanceof Error&&(t.message.startsWith(LOG_CATEGORY)||(t.message=`${LOG_CATEGORY}: ${t.message}`)),logger.warn(t)}function addUniqueItem(t,e){return t.findIndex(r=>r===e)===-1&&t.push(e),t}function getFMId(t){return"version"in t&&t.version?`${t.name}:${t.version}`:"entry"in t&&t.entry?`${t.name}:${t.entry}`:`${t.name}`}function isRemoteInfoWithEntry(t){return typeof t.entry<"u"}function isPureRemoteEntry(t){return!t.entry.includes(".json")}async function safeWrapper(t,e){try{return await t()}catch(r){!e&&warn(r);return}}function isObject(t){return t&&typeof t=="object"}const objectToString=Object.prototype.toString;function isPlainObject(t){return objectToString.call(t)==="[object Object]"}function isStaticResourcesEqual(t,e){const r=/^(https?:)?\/\//i,o=t.replace(r,"").replace(/\/$/,""),n=e.replace(r,"").replace(/\/$/,"");return o===n}function arrayOptions(t){return Array.isArray(t)?t:[t]}function getRemoteEntryInfoFromSnapshot(t){const e={url:"",type:"global",globalName:""};return sdk.isBrowserEnv()||sdk.isReactNativeEnv()?"remoteEntry"in t?{url:t.remoteEntry,type:t.remoteEntryType,globalName:t.globalName}:e:"ssrRemoteEntry"in t?{url:t.ssrRemoteEntry||e.url,type:t.ssrRemoteEntryType||e.type,globalName:t.globalName}:e}const processModuleAlias=(t,e)=>{let r;return t.endsWith("/")?r=t.slice(0,-1):r=t,e.startsWith(".")&&(e=e.slice(1)),r=r+e,r},CurrentGlobal=typeof globalThis=="object"?globalThis:window,nativeGlobal=(()=>{try{return document.defaultView}catch{return CurrentGlobal}})(),Global=nativeGlobal;function definePropertyGlobalVal(t,e,r){Object.defineProperty(t,e,{value:r,configurable:!1,writable:!0})}function includeOwnProperty(t,e){return Object.hasOwnProperty.call(t,e)}includeOwnProperty(CurrentGlobal,"__GLOBAL_LOADING_REMOTE_ENTRY__")||definePropertyGlobalVal(CurrentGlobal,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});const globalLoading=CurrentGlobal.__GLOBAL_LOADING_REMOTE_ENTRY__;function setGlobalDefaultVal(t){var e,r,o,n,i,a;includeOwnProperty(t,"__VMOK__")&&!includeOwnProperty(t,"__FEDERATION__")&&definePropertyGlobalVal(t,"__FEDERATION__",t.__VMOK__),includeOwnProperty(t,"__FEDERATION__")||(definePropertyGlobalVal(t,"__FEDERATION__",{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map}),definePropertyGlobalVal(t,"__VMOK__",t.__FEDERATION__));var s;(s=(e=t.__FEDERATION__).__GLOBAL_PLUGIN__)!=null||(e.__GLOBAL_PLUGIN__=[]);var l;(l=(r=t.__FEDERATION__).__INSTANCES__)!=null||(r.__INSTANCES__=[]);var c;(c=(o=t.__FEDERATION__).moduleInfo)!=null||(o.moduleInfo={});var u;(u=(n=t.__FEDERATION__).__SHARE__)!=null||(n.__SHARE__={});var d;(d=(i=t.__FEDERATION__).__MANIFEST_LOADING__)!=null||(i.__MANIFEST_LOADING__={});var h;(h=(a=t.__FEDERATION__).__PRELOADED_MAP__)!=null||(a.__PRELOADED_MAP__=new Map)}setGlobalDefaultVal(CurrentGlobal);setGlobalDefaultVal(nativeGlobal);function resetFederationGlobalInfo(){CurrentGlobal.__FEDERATION__.__GLOBAL_PLUGIN__=[],CurrentGlobal.__FEDERATION__.__INSTANCES__=[],CurrentGlobal.__FEDERATION__.moduleInfo={},CurrentGlobal.__FEDERATION__.__SHARE__={},CurrentGlobal.__FEDERATION__.__MANIFEST_LOADING__={},Object.keys(globalLoading).forEach(t=>{delete globalLoading[t]})}function setGlobalFederationInstance(t){CurrentGlobal.__FEDERATION__.__INSTANCES__.push(t)}function getGlobalFederationConstructor(){return CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__}function setGlobalFederationConstructor(t,e=sdk.isDebugMode()){e&&(CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__=t,CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="0.18.4")}function getInfoWithoutType(t,e){if(typeof e=="string"){if(t[e])return{value:t[e],key:e};{const o=Object.keys(t);for(const n of o){const[i,a]=n.split(":"),s=`${i}:${e}`,l=t[s];if(l)return{value:l,key:s}}return{value:void 0,key:e}}}else throw new Error("key must be string")}const getGlobalSnapshot=()=>nativeGlobal.__FEDERATION__.moduleInfo,getTargetSnapshotInfoByModuleInfo=(t,e)=>{const r=getFMId(t),o=getInfoWithoutType(e,r).value;if(o&&!o.version&&"version"in t&&t.version&&(o.version=t.version),o)return o;if("version"in t&&t.version){const{version:n}=t,i=polyfills._object_without_properties_loose(t,["version"]),a=getFMId(i),s=getInfoWithoutType(nativeGlobal.__FEDERATION__.moduleInfo,a).value;if((s==null?void 0:s.version)===n)return s}},getGlobalSnapshotInfoByModuleInfo=t=>getTargetSnapshotInfoByModuleInfo(t,nativeGlobal.__FEDERATION__.moduleInfo),setGlobalSnapshotInfoByModuleInfo=(t,e)=>{const r=getFMId(t);return nativeGlobal.__FEDERATION__.moduleInfo[r]=e,nativeGlobal.__FEDERATION__.moduleInfo},addGlobalSnapshot=t=>(nativeGlobal.__FEDERATION__.moduleInfo=polyfills._extends({},nativeGlobal.__FEDERATION__.moduleInfo,t),()=>{const e=Object.keys(t);for(const r of e)delete nativeGlobal.__FEDERATION__.moduleInfo[r]}),getRemoteEntryExports=(t,e)=>{const r=e||`__FEDERATION_${t}:custom__`,o=CurrentGlobal[r];return{remoteEntryKey:r,entryExports:o}},registerGlobalPlugins=t=>{const{__GLOBAL_PLUGIN__:e}=nativeGlobal.__FEDERATION__;t.forEach(r=>{e.findIndex(o=>o.name===r.name)===-1?e.push(r):warn(`The plugin ${r.name} has been registered.`)})},getGlobalHostPlugins=()=>nativeGlobal.__FEDERATION__.__GLOBAL_PLUGIN__,getPreloaded=t=>CurrentGlobal.__FEDERATION__.__PRELOADED_MAP__.get(t),setPreloaded=t=>CurrentGlobal.__FEDERATION__.__PRELOADED_MAP__.set(t,!0),DEFAULT_SCOPE="default",DEFAULT_REMOTE_TYPE="global",buildIdentifier="[0-9A-Za-z-]+",build=`(?:\\+(${buildIdentifier}(?:\\.${buildIdentifier})*))`,numericIdentifier="0|[1-9]\\d*",numericIdentifierLoose="[0-9]+",nonNumericIdentifier="\\d*[a-zA-Z-][a-zA-Z0-9-]*",preReleaseIdentifierLoose=`(?:${numericIdentifierLoose}|${nonNumericIdentifier})`,preReleaseLoose=`(?:-?(${preReleaseIdentifierLoose}(?:\\.${preReleaseIdentifierLoose})*))`,preReleaseIdentifier=`(?:${numericIdentifier}|${nonNumericIdentifier})`,preRelease=`(?:-(${preReleaseIdentifier}(?:\\.${preReleaseIdentifier})*))`,xRangeIdentifier=`${numericIdentifier}|x|X|\\*`,xRangePlain=`[v=\\s]*(${xRangeIdentifier})(?:\\.(${xRangeIdentifier})(?:\\.(${xRangeIdentifier})(?:${preRelease})?${build}?)?)?`,hyphenRange=`^\\s*(${xRangePlain})\\s+-\\s+(${xRangePlain})\\s*$`,mainVersionLoose=`(${numericIdentifierLoose})\\.(${numericIdentifierLoose})\\.(${numericIdentifierLoose})`,loosePlain=`[v=\\s]*${mainVersionLoose}${preReleaseLoose}?${build}?`,gtlt="((?:<|>)?=?)",comparatorTrim=`(\\s*)${gtlt}\\s*(${loosePlain}|${xRangePlain})`,loneTilde="(?:~>?)",tildeTrim=`(\\s*)${loneTilde}\\s+`,loneCaret="(?:\\^)",caretTrim=`(\\s*)${loneCaret}\\s+`,star="(<|>)?=?\\s*\\*",caret=`^${loneCaret}${xRangePlain}$`,mainVersion=`(${numericIdentifier})\\.(${numericIdentifier})\\.(${numericIdentifier})`,fullPlain=`v?${mainVersion}${preRelease}?${build}?`,tilde=`^${loneTilde}${xRangePlain}$`,xRange=`^${gtlt}\\s*${xRangePlain}$`,comparator=`^${gtlt}\\s*(${fullPlain})$|^$`,gte0="^\\s*>=\\s*0.0.0\\s*$";function parseRegex(t){return new RegExp(t)}function isXVersion(t){return!t||t.toLowerCase()==="x"||t==="*"}function pipe(...t){return e=>t.reduce((r,o)=>o(r),e)}function extractComparator(t){return t.match(parseRegex(comparator))}function combineVersion(t,e,r,o){const n=`${t}.${e}.${r}`;return o?`${n}-${o}`:n}function parseHyphen(t){return t.replace(parseRegex(hyphenRange),(e,r,o,n,i,a,s,l,c,u,d,h)=>(isXVersion(o)?r="":isXVersion(n)?r=`>=${o}.0.0`:isXVersion(i)?r=`>=${o}.${n}.0`:r=`>=${r}`,isXVersion(c)?l="":isXVersion(u)?l=`<${Number(c)+1}.0.0-0`:isXVersion(d)?l=`<${c}.${Number(u)+1}.0-0`:h?l=`<=${c}.${u}.${d}-${h}`:l=`<=${l}`,`${r} ${l}`.trim()))}function parseComparatorTrim(t){return t.replace(parseRegex(comparatorTrim),"$1$2$3")}function parseTildeTrim(t){return t.replace(parseRegex(tildeTrim),"$1~")}function parseCaretTrim(t){return t.replace(parseRegex(caretTrim),"$1^")}function parseCarets(t){return t.trim().split(/\s+/).map(e=>e.replace(parseRegex(caret),(r,o,n,i,a)=>isXVersion(o)?"":isXVersion(n)?`>=${o}.0.0 <${Number(o)+1}.0.0-0`:isXVersion(i)?o==="0"?`>=${o}.${n}.0 <${o}.${Number(n)+1}.0-0`:`>=${o}.${n}.0 <${Number(o)+1}.0.0-0`:a?o==="0"?n==="0"?`>=${o}.${n}.${i}-${a} <${o}.${n}.${Number(i)+1}-0`:`>=${o}.${n}.${i}-${a} <${o}.${Number(n)+1}.0-0`:`>=${o}.${n}.${i}-${a} <${Number(o)+1}.0.0-0`:o==="0"?n==="0"?`>=${o}.${n}.${i} <${o}.${n}.${Number(i)+1}-0`:`>=${o}.${n}.${i} <${o}.${Number(n)+1}.0-0`:`>=${o}.${n}.${i} <${Number(o)+1}.0.0-0`)).join(" ")}function parseTildes(t){return t.trim().split(/\s+/).map(e=>e.replace(parseRegex(tilde),(r,o,n,i,a)=>isXVersion(o)?"":isXVersion(n)?`>=${o}.0.0 <${Number(o)+1}.0.0-0`:isXVersion(i)?`>=${o}.${n}.0 <${o}.${Number(n)+1}.0-0`:a?`>=${o}.${n}.${i}-${a} <${o}.${Number(n)+1}.0-0`:`>=${o}.${n}.${i} <${o}.${Number(n)+1}.0-0`)).join(" ")}function parseXRanges(t){return t.split(/\s+/).map(e=>e.trim().replace(parseRegex(xRange),(r,o,n,i,a,s)=>{const l=isXVersion(n),c=l||isXVersion(i),u=c||isXVersion(a);return o==="="&&u&&(o=""),s="",l?o===">"||o==="<"?"<0.0.0-0":"*":o&&u?(c&&(i=0),a=0,o===">"?(o=">=",c?(n=Number(n)+1,i=0,a=0):(i=Number(i)+1,a=0)):o==="<="&&(o="<",c?n=Number(n)+1:i=Number(i)+1),o==="<"&&(s="-0"),`${o+n}.${i}.${a}${s}`):c?`>=${n}.0.0${s} <${Number(n)+1}.0.0-0`:u?`>=${n}.${i}.0${s} <${n}.${Number(i)+1}.0-0`:r})).join(" ")}function parseStar(t){return t.trim().replace(parseRegex(star),"")}function parseGTE0(t){return t.trim().replace(parseRegex(gte0),"")}function compareAtom(t,e){return t=Number(t)||t,e=Number(e)||e,t>e?1:t===e?0:-1}function comparePreRelease(t,e){const{preRelease:r}=t,{preRelease:o}=e;if(r===void 0&&o)return 1;if(r&&o===void 0)return-1;if(r===void 0&&o===void 0)return 0;for(let n=0,i=r.length;n<=i;n++){const a=r[n],s=o[n];if(a!==s)return a===void 0&&s===void 0?0:a?s?compareAtom(a,s):-1:1}return 0}function compareVersion(t,e){return compareAtom(t.major,e.major)||compareAtom(t.minor,e.minor)||compareAtom(t.patch,e.patch)||comparePreRelease(t,e)}function eq(t,e){return t.version===e.version}function compare(t,e){switch(t.operator){case"":case"=":return eq(t,e);case">":return compareVersion(t,e)<0;case">=":return eq(t,e)||compareVersion(t,e)<0;case"<":return compareVersion(t,e)>0;case"<=":return eq(t,e)||compareVersion(t,e)>0;case void 0:return!0;default:return!1}}function parseComparatorString(t){return pipe(parseCarets,parseTildes,parseXRanges,parseStar)(t)}function parseRange(t){return pipe(parseHyphen,parseComparatorTrim,parseTildeTrim,parseCaretTrim)(t.trim()).split(/\s+/).join(" ")}function satisfy(t,e){if(!t)return!1;const r=extractComparator(t);if(!r)return!1;const[,o,,n,i,a,s]=r,l={operator:o,version:combineVersion(n,i,a,s),major:n,minor:i,patch:a,preRelease:s==null?void 0:s.split(".")},c=e.split("||");for(const u of c){const d=u.trim();if(!d||d==="*"||d==="x")return!0;try{const h=parseRange(d);if(!h.trim())return!0;const p=h.split(" ").map(m=>parseComparatorString(m)).join(" ");if(!p.trim())return!0;const _=p.split(/\s+/).map(m=>parseGTE0(m)).filter(Boolean);if(_.length===0)continue;let y=!0;for(const m of _){const g=extractComparator(m);if(!g){y=!1;break}const[,I,,b,R,E,S]=g,T={operator:I,version:combineVersion(b,R,E,S),major:b,minor:R,patch:E,preRelease:S==null?void 0:S.split(".")};if(!compare(T,l)){y=!1;break}}if(y)return!0}catch(h){console.error(`[semver] Error processing range part "${d}":`,h);continue}}return!1}function formatShare(t,e,r,o){let n;"get"in t?n=t.get:"lib"in t?n=()=>Promise.resolve(t.lib):n=()=>Promise.resolve(()=>{throw new Error(`Can not get shared '${r}'!`)});var i,a,s;return polyfills._extends({deps:[],useIn:[],from:e,loading:null},t,{shareConfig:polyfills._extends({requiredVersion:`^${t.version}`,singleton:!1,eager:!1,strictVersion:!1},t.shareConfig),get:n,loaded:t!=null&&t.loaded||"lib"in t?!0:void 0,version:(i=t.version)!=null?i:"0",scope:Array.isArray(t.scope)?t.scope:[(a=t.scope)!=null?a:"default"],strategy:((s=t.strategy)!=null?s:o)||"version-first"})}function formatShareConfigs(t,e){const r=e.shared||{},o=e.name,n=Object.keys(r).reduce((a,s)=>{const l=arrayOptions(r[s]);return a[s]=a[s]||[],l.forEach(c=>{a[s].push(formatShare(c,o,s,e.shareStrategy))}),a},{}),i=polyfills._extends({},t.shared);return Object.keys(n).forEach(a=>{i[a]?n[a].forEach(s=>{i[a].find(c=>c.version===s.version)||i[a].push(s)}):i[a]=n[a]}),{shared:i,shareInfos:n}}function versionLt(t,e){const r=o=>{if(!Number.isNaN(Number(o))){const i=o.split(".");let a=o;for(let s=0;s<3-i.length;s++)a+=".0";return a}return o};return!!satisfy(r(t),`<=${r(e)}`)}const findVersion=(t,e)=>{const r=e||function(o,n){return versionLt(o,n)};return Object.keys(t).reduce((o,n)=>!o||r(o,n)||o==="0"?n:o,0)},isLoaded=t=>!!t.loaded||typeof t.lib=="function",isLoading=t=>!!t.loading;function findSingletonVersionOrderByVersion(t,e,r){const o=t[e][r],n=function(i,a){return!isLoaded(o[i])&&versionLt(i,a)};return findVersion(t[e][r],n)}function findSingletonVersionOrderByLoaded(t,e,r){const o=t[e][r],n=function(i,a){const s=l=>isLoaded(l)||isLoading(l);return s(o[a])?s(o[i])?!!versionLt(i,a):!0:s(o[i])?!1:versionLt(i,a)};return findVersion(t[e][r],n)}function getFindShareFunction(t){return t==="loaded-first"?findSingletonVersionOrderByLoaded:findSingletonVersionOrderByVersion}function getRegisteredShare(t,e,r,o){if(!t)return;const{shareConfig:n,scope:i=DEFAULT_SCOPE,strategy:a}=r,s=Array.isArray(i)?i:[i];for(const l of s)if(n&&t[l]&&t[l][e]){const{requiredVersion:c}=n,d=getFindShareFunction(a)(t,l,e),h=()=>{if(n.singleton){if(typeof c=="string"&&!satisfy(d,c)){const y=`Version ${d} from ${d&&t[l][e][d].from} of shared singleton module ${e} does not satisfy the requirement of ${r.from} which needs ${c})`;n.strictVersion?error(y):warn(y)}return t[l][e][d]}else{if(c===!1||c==="*"||satisfy(d,c))return t[l][e][d];for(const[y,m]of Object.entries(t[l][e]))if(satisfy(y,c))return m}},p={shareScopeMap:t,scope:l,pkgName:e,version:d,GlobalFederation:Global.__FEDERATION__,resolver:h};return(o.emit(p)||p).resolver()}}function getGlobalShareScope(){return Global.__FEDERATION__.__SHARE__}function getTargetSharedOptions(t){const{pkgName:e,extraOptions:r,shareInfos:o}=t,n=s=>{if(!s)return;const l={};s.forEach(d=>{l[d.version]=d});const u=findVersion(l,function(d,h){return!isLoaded(l[d])&&versionLt(d,h)});return l[u]};var i;const a=(i=r==null?void 0:r.resolver)!=null?i:n;return Object.assign({},a(o[e]),r==null?void 0:r.customShareInfo)}function getBuilderId$1(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}function matchRemoteWithNameAndExpose(t,e){for(const r of t){const o=e.startsWith(r.name);let n=e.replace(r.name,"");if(o){if(n.startsWith("/")){const s=r.name;return n=`.${n}`,{pkgNameOrAlias:s,expose:n,remote:r}}else if(n==="")return{pkgNameOrAlias:r.name,expose:".",remote:r}}const i=r.alias&&e.startsWith(r.alias);let a=r.alias&&e.replace(r.alias,"");if(r.alias&&i){if(a&&a.startsWith("/")){const s=r.alias;return a=`.${a}`,{pkgNameOrAlias:s,expose:a,remote:r}}else if(a==="")return{pkgNameOrAlias:r.alias,expose:".",remote:r}}}}function matchRemote(t,e){for(const r of t)if(e===r.name||r.alias&&e===r.alias)return r}function registerPlugins$1(t,e){const r=getGlobalHostPlugins(),o=[e.hooks,e.remoteHandler.hooks,e.sharedHandler.hooks,e.snapshotHandler.hooks,e.loaderHook,e.bridgeHook];return r.length>0&&r.forEach(n=>{t!=null&&t.find(i=>i.name!==n.name)&&t.push(n)}),t&&t.length>0&&t.forEach(n=>{o.forEach(i=>{i.applyPlugin(n,e)})}),t}const importCallback=".then(callbacks[0]).catch(callbacks[1])";async function loadEsmEntry({entry:t,remoteEntryExports:e}){return new Promise((r,o)=>{try{e?r(e):typeof FEDERATION_ALLOW_NEW_FUNCTION<"u"?new Function("callbacks",`import("${t}")${importCallback}`)([r,o]):import(t).then(r).catch(o)}catch(n){o(n)}})}async function loadSystemJsEntry({entry:t,remoteEntryExports:e}){return new Promise((r,o)=>{try{e?r(e):typeof __system_context__>"u"?System.import(t).then(r).catch(o):new Function("callbacks",`System.import("${t}")${importCallback}`)([r,o])}catch(n){o(n)}})}function handleRemoteEntryLoaded(t,e,r){const{remoteEntryKey:o,entryExports:n}=getRemoteEntryExports(t,e);return assert(n,errorCodes$1.getShortErrorMsg(errorCodes$1.RUNTIME_001,errorCodes$1.runtimeDescMap,{remoteName:t,remoteEntryUrl:r,remoteEntryKey:o})),n}async function loadEntryScript({name:t,globalName:e,entry:r,loaderHook:o,getEntryUrl:n}){const{entryExports:i}=getRemoteEntryExports(t,e);if(i)return i;const a=n?n(r):r;return sdk.loadScript(a,{attrs:{},createScriptHook:(s,l)=>{const c=o.lifecycle.createScript.emit({url:s,attrs:l});if(c&&(c instanceof HTMLScriptElement||"script"in c||"timeout"in c))return c}}).then(()=>handleRemoteEntryLoaded(t,e,r)).catch(s=>{throw assert(void 0,errorCodes$1.getShortErrorMsg(errorCodes$1.RUNTIME_008,errorCodes$1.runtimeDescMap,{remoteName:t,resourceUrl:r})),s})}async function loadEntryDom({remoteInfo:t,remoteEntryExports:e,loaderHook:r,getEntryUrl:o}){const{entry:n,entryGlobalName:i,name:a,type:s}=t;switch(s){case"esm":case"module":return loadEsmEntry({entry:n,remoteEntryExports:e});case"system":return loadSystemJsEntry({entry:n,remoteEntryExports:e});default:return loadEntryScript({entry:n,globalName:i,name:a,loaderHook:r,getEntryUrl:o})}}async function loadEntryNode({remoteInfo:t,loaderHook:e}){const{entry:r,entryGlobalName:o,name:n,type:i}=t,{entryExports:a}=getRemoteEntryExports(n,o);return a||sdk.loadScriptNode(r,{attrs:{name:n,globalName:o,type:i},loaderHook:{createScriptHook:(s,l={})=>{const c=e.lifecycle.createScript.emit({url:s,attrs:l});if(c&&"url"in c)return c}}}).then(()=>handleRemoteEntryLoaded(n,o,r)).catch(s=>{throw s})}function getRemoteEntryUniqueKey(t){const{entry:e,name:r}=t;return sdk.composeKeyWithSeparator(r,e)}async function getRemoteEntry(t){const{origin:e,remoteEntryExports:r,remoteInfo:o,getEntryUrl:n}=t,i=getRemoteEntryUniqueKey(o);if(r)return r;if(!globalLoading[i]){const a=e.remoteHandler.hooks.lifecycle.loadEntry,s=e.loaderHook;globalLoading[i]=a.emit({loaderHook:s,remoteInfo:o,remoteEntryExports:r}).then(l=>l||((typeof ENV_TARGET<"u"?ENV_TARGET==="web":sdk.isBrowserEnv())?loadEntryDom({remoteInfo:o,remoteEntryExports:r,loaderHook:s,getEntryUrl:n}):loadEntryNode({remoteInfo:o,loaderHook:s})))}return globalLoading[i]}function getRemoteInfo(t){return polyfills._extends({},t,{entry:"entry"in t?t.entry:"",type:t.type||DEFAULT_REMOTE_TYPE,entryGlobalName:t.entryGlobalName||t.name,shareScope:t.shareScope||DEFAULT_SCOPE})}function defaultPreloadArgs(t){return polyfills._extends({resourceCategory:"sync",share:!0,depsRemote:!0,prefetchInterface:!1},t)}function formatPreloadArgs(t,e){return e.map(r=>{const o=matchRemote(t,r.nameOrAlias);return assert(o,`Unable to preload ${r.nameOrAlias} as it is not included in ${!o&&sdk.safeToString({remoteInfo:o,remotes:t})}`),{remote:o,preloadConfig:defaultPreloadArgs(r)}})}function normalizePreloadExposes(t){return t?t.map(e=>e==="."?e:e.startsWith("./")?e.replace("./",""):e):[]}function preloadAssets(t,e,r,o=!0){const{cssAssets:n,jsAssetsWithoutEntry:i,entryAssets:a}=r;if(e.options.inBrowser){if(a.forEach(s=>{const{moduleInfo:l}=s,c=e.moduleCache.get(t.name);getRemoteEntry(c?{origin:e,remoteInfo:l,remoteEntryExports:c.remoteEntryExports}:{origin:e,remoteInfo:l,remoteEntryExports:void 0})}),o){const s={rel:"preload",as:"style"};n.forEach(l=>{const{link:c,needAttach:u}=sdk.createLink({url:l,cb:()=>{},attrs:s,createLinkHook:(d,h)=>{const p=e.loaderHook.lifecycle.createLink.emit({url:d,attrs:h});if(p instanceof HTMLLinkElement)return p}});u&&document.head.appendChild(c)})}else{const s={rel:"stylesheet",type:"text/css"};n.forEach(l=>{const{link:c,needAttach:u}=sdk.createLink({url:l,cb:()=>{},attrs:s,createLinkHook:(d,h)=>{const p=e.loaderHook.lifecycle.createLink.emit({url:d,attrs:h});if(p instanceof HTMLLinkElement)return p},needDeleteLink:!1});u&&document.head.appendChild(c)})}if(o){const s={rel:"preload",as:"script"};i.forEach(l=>{const{link:c,needAttach:u}=sdk.createLink({url:l,cb:()=>{},attrs:s,createLinkHook:(d,h)=>{const p=e.loaderHook.lifecycle.createLink.emit({url:d,attrs:h});if(p instanceof HTMLLinkElement)return p}});u&&document.head.appendChild(c)})}else{const s={fetchpriority:"high",type:(t==null?void 0:t.type)==="module"?"module":"text/javascript"};i.forEach(l=>{const{script:c,needAttach:u}=sdk.createScript({url:l,cb:()=>{},attrs:s,createScriptHook:(d,h)=>{const p=e.loaderHook.lifecycle.createScript.emit({url:d,attrs:h});if(p instanceof HTMLScriptElement)return p},needDeleteScript:!0});u&&document.head.appendChild(c)})}}}const ShareUtils={getRegisteredShare,getGlobalShareScope},GlobalUtils={Global,nativeGlobal,resetFederationGlobalInfo,setGlobalFederationInstance,getGlobalFederationConstructor,setGlobalFederationConstructor,getInfoWithoutType,getGlobalSnapshot,getTargetSnapshotInfoByModuleInfo,getGlobalSnapshotInfoByModuleInfo,setGlobalSnapshotInfoByModuleInfo,addGlobalSnapshot,getRemoteEntryExports,registerGlobalPlugins,getGlobalHostPlugins,getPreloaded,setPreloaded};var helpers={global:GlobalUtils,share:ShareUtils,utils:{matchRemoteWithNameAndExpose,preloadAssets,getRemoteInfo}};let Module=class{async getEntry(){if(this.remoteEntryExports)return this.remoteEntryExports;let e;try{e=await getRemoteEntry({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports})}catch(r){const o=getRemoteEntryUniqueKey(this.remoteInfo);if(r instanceof Error&&r.message.includes(errorCodes$1.RUNTIME_008))e=await this.host.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry,origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports,globalLoading,uniqueKey:o});else throw r}return assert(e,`remoteEntryExports is undefined
5
- ${sdk.safeToString(this.remoteInfo)}`),this.remoteEntryExports=e,this.remoteEntryExports}async get(e,r,o,n){const{loadFactory:i=!0}=o||{loadFactory:!0},a=await this.getEntry();if(!this.inited){const d=this.host.shareScopeMap,h=Array.isArray(this.remoteInfo.shareScope)?this.remoteInfo.shareScope:[this.remoteInfo.shareScope];h.length||h.push("default"),h.forEach(g=>{d[g]||(d[g]={})});const p=d[h[0]],_=[],y={version:this.remoteInfo.version||"",shareScopeKeys:Array.isArray(this.remoteInfo.shareScope)?h:this.remoteInfo.shareScope||"default"};Object.defineProperty(y,"shareScopeMap",{value:d,enumerable:!1});const m=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:p,remoteEntryInitOptions:y,initScope:_,remoteInfo:this.remoteInfo,origin:this.host});typeof(a==null?void 0:a.init)>"u"&&error(errorCodes$1.getShortErrorMsg(errorCodes$1.RUNTIME_002,errorCodes$1.runtimeDescMap,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName})),await a.init(m.shareScope,m.initScope,m.remoteEntryInitOptions),await this.host.hooks.lifecycle.initContainer.emit(polyfills._extends({},m,{id:e,remoteSnapshot:n,remoteEntryExports:a}))}this.lib=a,this.inited=!0;let s;s=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:a,expose:r,moduleInfo:this.remoteInfo}),s||(s=await a.get(r)),assert(s,`${getFMId(this.remoteInfo)} remote don't export ${r}.`);const l=processModuleAlias(this.remoteInfo.name,r),c=this.wraperFactory(s,l);return i?await c():c}wraperFactory(e,r){function o(n,i){n&&typeof n=="object"&&Object.isExtensible(n)&&!Object.getOwnPropertyDescriptor(n,Symbol.for("mf_module_id"))&&Object.defineProperty(n,Symbol.for("mf_module_id"),{value:i,enumerable:!1})}return e instanceof Promise?async()=>{const n=await e();return o(n,r),n}:()=>{const n=e();return o(n,r),n}}constructor({remoteInfo:e,host:r}){this.inited=!1,this.lib=void 0,this.remoteInfo=e,this.host=r}};class SyncHook{on(e){typeof e=="function"&&this.listeners.add(e)}once(e){const r=this;this.on(function o(...n){return r.remove(o),e.apply(null,n)})}emit(...e){let r;return this.listeners.size>0&&this.listeners.forEach(o=>{r=o(...e)}),r}remove(e){this.listeners.delete(e)}removeAll(){this.listeners.clear()}constructor(e){this.type="",this.listeners=new Set,e&&(this.type=e)}}class AsyncHook extends SyncHook{emit(...e){let r;const o=Array.from(this.listeners);if(o.length>0){let n=0;const i=a=>a===!1?!1:n<o.length?Promise.resolve(o[n++].apply(null,e)).then(i):a;r=i()}return Promise.resolve(r)}}function checkReturnData(t,e){if(!isObject(e))return!1;if(t!==e){for(const r in t)if(!(r in e))return!1}return!0}class SyncWaterfallHook extends SyncHook{emit(e){isObject(e)||error(`The data for the "${this.type}" hook should be an object.`);for(const r of this.listeners)try{const o=r(e);if(checkReturnData(e,o))e=o;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(o){warn(o),this.onerror(o)}return e}constructor(e){super(),this.onerror=error,this.type=e}}class AsyncWaterfallHook extends SyncHook{emit(e){isObject(e)||error(`The response data for the "${this.type}" hook must be an object.`);const r=Array.from(this.listeners);if(r.length>0){let o=0;const n=a=>(warn(a),this.onerror(a),e),i=a=>{if(checkReturnData(e,a)){if(e=a,o<r.length)try{return Promise.resolve(r[o++](e)).then(i,n)}catch(s){return n(s)}}else this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`);return e};return Promise.resolve(i(e))}return Promise.resolve(e)}constructor(e){super(),this.onerror=error,this.type=e}}class PluginSystem{applyPlugin(e,r){assert(isPlainObject(e),"Plugin configuration is invalid.");const o=e.name;assert(o,"A name must be provided by the plugin."),this.registerPlugins[o]||(this.registerPlugins[o]=e,e.apply==null||e.apply.call(e,r),Object.keys(this.lifecycle).forEach(n=>{const i=e[n];i&&this.lifecycle[n].on(i)}))}removePlugin(e){assert(e,"A name is required.");const r=this.registerPlugins[e];assert(r,`The plugin "${e}" is not registered.`),Object.keys(r).forEach(o=>{o!=="name"&&this.lifecycle[o].remove(r[o])})}constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}}function assignRemoteInfo(t,e){const r=getRemoteEntryInfoFromSnapshot(e);r.url||error(`The attribute remoteEntry of ${t.name} must not be undefined.`);let o=sdk.getResourceUrl(e,r.url);!sdk.isBrowserEnv()&&!o.startsWith("http")&&(o=`https:${o}`),t.type=r.type,t.entryGlobalName=r.globalName,t.entry=o,t.version=e.version,t.buildVersion=e.buildVersion}function snapshotPlugin(){return{name:"snapshot-plugin",async afterResolve(t){const{remote:e,pkgNameOrAlias:r,expose:o,origin:n,remoteInfo:i,id:a}=t;if(!isRemoteInfoWithEntry(e)||!isPureRemoteEntry(e)){const{remoteSnapshot:s,globalSnapshot:l}=await n.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:e,id:a});assignRemoteInfo(i,s);const c={remote:e,preloadConfig:{nameOrAlias:r,exposes:[o],resourceCategory:"sync",share:!1,depsRemote:!1}},u=await n.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:n,preloadOptions:c,remoteInfo:i,remote:e,remoteSnapshot:s,globalSnapshot:l});return u&&preloadAssets(i,n,u,!1),polyfills._extends({},t,{remoteSnapshot:s})}return t}}}function splitId(t){const e=t.split(":");return e.length===1?{name:e[0],version:void 0}:e.length===2?{name:e[0],version:e[1]}:{name:e[1],version:e[2]}}function traverseModuleInfo(t,e,r,o,n={},i){const a=getFMId(e),{value:s}=getInfoWithoutType(t,a),l=i||s;if(l&&!sdk.isManifestProvider(l)&&(r(l,e,o),l.remotesInfo)){const c=Object.keys(l.remotesInfo);for(const u of c){if(n[u])continue;n[u]=!0;const d=splitId(u),h=l.remotesInfo[u];traverseModuleInfo(t,{name:d.name,version:h.matchedVersion},r,!1,n,void 0)}}}const isExisted=(t,e)=>document.querySelector(`${t}[${t==="link"?"href":"src"}="${e}"]`);function generatePreloadAssets(t,e,r,o,n){const i=[],a=[],s=[],l=new Set,c=new Set,{options:u}=t,{preloadConfig:d}=e,{depsRemote:h}=d;if(traverseModuleInfo(o,r,(m,g,I)=>{let b;if(I)b=d;else if(Array.isArray(h)){const M=h.find(N=>N.nameOrAlias===g.name||N.nameOrAlias===g.alias);if(!M)return;b=defaultPreloadArgs(M)}else if(h===!0)b=d;else return;const R=sdk.getResourceUrl(m,getRemoteEntryInfoFromSnapshot(m).url);R&&s.push({name:g.name,moduleInfo:{name:g.name,entry:R,type:"remoteEntryType"in m?m.remoteEntryType:"global",entryGlobalName:"globalName"in m?m.globalName:g.name,shareScope:"",version:"version"in m?m.version:void 0},url:R});let E="modules"in m?m.modules:[];const S=normalizePreloadExposes(b.exposes);if(S.length&&"modules"in m){var T;E=m==null||(T=m.modules)==null?void 0:T.reduce((M,N)=>((S==null?void 0:S.indexOf(N.moduleName))!==-1&&M.push(N),M),[])}function $(M){const N=M.map(v=>sdk.getResourceUrl(m,v));return b.filter?N.filter(b.filter):N}if(E){const M=E.length;for(let N=0;N<M;N++){const v=E[N],A=`${g.name}/${v.moduleName}`;t.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:v.moduleName==="."?g.name:A,name:g.name,remoteSnapshot:m,preloadConfig:b,remote:g,origin:t}),!getPreloaded(A)&&(b.resourceCategory==="all"?(i.push(...$(v.assets.css.async)),i.push(...$(v.assets.css.sync)),a.push(...$(v.assets.js.async)),a.push(...$(v.assets.js.sync))):(b.resourceCategory="sync")&&(i.push(...$(v.assets.css.sync)),a.push(...$(v.assets.js.sync))),setPreloaded(A))}}},!0,{},n),n.shared&&n.shared.length>0){const m=(g,I)=>{const b=getRegisteredShare(t.shareScopeMap,I.sharedName,g,t.sharedHandler.hooks.lifecycle.resolveShare);b&&typeof b.lib=="function"&&(I.assets.js.sync.forEach(R=>{l.add(R)}),I.assets.css.sync.forEach(R=>{c.add(R)}))};n.shared.forEach(g=>{var I;const b=(I=u.shared)==null?void 0:I[g.sharedName];if(!b)return;const R=g.version?b.find(S=>S.version===g.version):b;if(!R)return;arrayOptions(R).forEach(S=>{m(S,g)})})}const _=a.filter(m=>!l.has(m)&&!isExisted("script",m));return{cssAssets:i.filter(m=>!c.has(m)&&!isExisted("link",m)),jsAssetsWithoutEntry:_,entryAssets:s.filter(m=>!isExisted("script",m.url))}}const generatePreloadAssetsPlugin=function(){return{name:"generate-preload-assets-plugin",async generatePreloadAssets(t){const{origin:e,preloadOptions:r,remoteInfo:o,remote:n,globalSnapshot:i,remoteSnapshot:a}=t;return sdk.isBrowserEnv()?isRemoteInfoWithEntry(n)&&isPureRemoteEntry(n)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:n.name,url:n.entry,moduleInfo:{name:o.name,entry:n.entry,type:o.type||"global",entryGlobalName:"",shareScope:""}}]}:(assignRemoteInfo(o,a),generatePreloadAssets(e,r,o,i,a)):{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]}}}};function getGlobalRemoteInfo(t,e){const r=getGlobalSnapshotInfoByModuleInfo({name:e.name,version:e.options.version}),o=r&&"remotesInfo"in r&&r.remotesInfo&&getInfoWithoutType(r.remotesInfo,t.name).value;return o&&o.matchedVersion?{hostGlobalSnapshot:r,globalSnapshot:getGlobalSnapshot(),remoteSnapshot:getGlobalSnapshotInfoByModuleInfo({name:t.name,version:o.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:getGlobalSnapshot(),remoteSnapshot:getGlobalSnapshotInfoByModuleInfo({name:t.name,version:"version"in t?t.version:void 0})}}class SnapshotHandler{async loadRemoteSnapshotInfo({moduleInfo:e,id:r,expose:o}){const{options:n}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options:n,moduleInfo:e});let i=getGlobalSnapshotInfoByModuleInfo({name:this.HostInstance.options.name,version:this.HostInstance.options.version});i||(i={version:this.HostInstance.options.version||"",remoteEntry:"",remotesInfo:{}},addGlobalSnapshot({[this.HostInstance.options.name]:i})),i&&"remotesInfo"in i&&!getInfoWithoutType(i.remotesInfo,e.name).value&&("version"in e||"entry"in e)&&(i.remotesInfo=polyfills._extends({},i==null?void 0:i.remotesInfo,{[e.name]:{matchedVersion:"version"in e?e.version:e.entry}}));const{hostGlobalSnapshot:a,remoteSnapshot:s,globalSnapshot:l}=this.getGlobalRemoteInfo(e),{remoteSnapshot:c,globalSnapshot:u}=await this.hooks.lifecycle.loadSnapshot.emit({options:n,moduleInfo:e,hostGlobalSnapshot:a,remoteSnapshot:s,globalSnapshot:l});let d,h;if(c)if(sdk.isManifestProvider(c)){const p=sdk.isBrowserEnv()?c.remoteEntry:c.ssrRemoteEntry||c.remoteEntry||"",_=await this.getManifestJson(p,e,{}),y=setGlobalSnapshotInfoByModuleInfo(polyfills._extends({},e,{entry:p}),_);d=_,h=y}else{const{remoteSnapshot:p}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:c,from:"global"});d=p,h=u}else if(isRemoteInfoWithEntry(e)){const p=await this.getManifestJson(e.entry,e,{}),_=setGlobalSnapshotInfoByModuleInfo(e,p),{remoteSnapshot:y}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:p,from:"global"});d=y,h=_}else error(errorCodes$1.getShortErrorMsg(errorCodes$1.RUNTIME_007,errorCodes$1.runtimeDescMap,{hostName:e.name,hostVersion:e.version,globalSnapshot:JSON.stringify(u)}));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:r,host:this.HostInstance,options:n,moduleInfo:e,remoteSnapshot:d}),{remoteSnapshot:d,globalSnapshot:h}}getGlobalRemoteInfo(e){return getGlobalRemoteInfo(e,this.HostInstance)}async getManifestJson(e,r,o){const n=async()=>{let a=this.manifestCache.get(e);if(a)return a;try{let s=await this.loaderHook.lifecycle.fetch.emit(e,{});(!s||!(s instanceof Response))&&(s=await fetch(e,{})),a=await s.json()}catch(s){a=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:s,from:"runtime",lifecycle:"afterResolve",origin:this.HostInstance}),a||(delete this.manifestLoading[e],error(errorCodes$1.getShortErrorMsg(errorCodes$1.RUNTIME_003,errorCodes$1.runtimeDescMap,{manifestUrl:e,moduleName:r.name,hostName:this.HostInstance.options.name},`${s}`)))}return assert(a.metaData&&a.exposes&&a.shared,`${e} is not a federation manifest`),this.manifestCache.set(e,a),a},i=async()=>{const a=await n(),s=sdk.generateSnapshotFromManifest(a,{version:e}),{remoteSnapshot:l}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:r,manifestJson:a,remoteSnapshot:s,manifestUrl:e,from:"manifest"});return l};return this.manifestLoading[e]||(this.manifestLoading[e]=i().then(a=>a)),this.manifestLoading[e]}constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new PluginSystem({beforeLoadRemoteSnapshot:new AsyncHook("beforeLoadRemoteSnapshot"),loadSnapshot:new AsyncWaterfallHook("loadGlobalSnapshot"),loadRemoteSnapshot:new AsyncWaterfallHook("loadRemoteSnapshot"),afterLoadSnapshot:new AsyncWaterfallHook("afterLoadSnapshot")}),this.manifestLoading=Global.__FEDERATION__.__MANIFEST_LOADING__,this.HostInstance=e,this.loaderHook=e.loaderHook}}class SharedHandler{registerShared(e,r){const{shareInfos:o,shared:n}=formatShareConfigs(e,r);return Object.keys(o).forEach(a=>{o[a].forEach(l=>{!getRegisteredShare(this.shareScopeMap,a,l,this.hooks.lifecycle.resolveShare)&&l&&l.lib&&this.setShared({pkgName:a,lib:l.lib,get:l.get,loaded:!0,shared:l,from:r.name})})}),{shareInfos:o,shared:n}}async loadShare(e,r){const{host:o}=this,n=getTargetSharedOptions({pkgName:e,extraOptions:r,shareInfos:o.options.shared});n!=null&&n.scope&&await Promise.all(n.scope.map(async c=>{await Promise.all(this.initializeSharing(c,{strategy:n.strategy}))}));const i=await this.hooks.lifecycle.beforeLoadShare.emit({pkgName:e,shareInfo:n,shared:o.options.shared,origin:o}),{shareInfo:a}=i;assert(a,`Cannot find ${e} Share in the ${o.options.name}. Please ensure that the ${e} Share parameters have been injected`);const s=getRegisteredShare(this.shareScopeMap,e,a,this.hooks.lifecycle.resolveShare),l=c=>{c.useIn||(c.useIn=[]),addUniqueItem(c.useIn,o.options.name)};if(s&&s.lib)return l(s),s.lib;if(s&&s.loading&&!s.loaded){const c=await s.loading;return s.loaded=!0,s.lib||(s.lib=c),l(s),c}else if(s){const u=(async()=>{const d=await s.get();return l(s),s.loaded=!0,s.lib=d,d})();return this.setShared({pkgName:e,loaded:!1,shared:s,from:o.options.name,lib:null,loading:u}),u}else{if(r!=null&&r.customShareInfo)return!1;const u=(async()=>{const d=await a.get();a.lib=d,a.loaded=!0,l(a);const h=getRegisteredShare(this.shareScopeMap,e,a,this.hooks.lifecycle.resolveShare);return h&&(h.lib=d,h.loaded=!0,h.from=a.from),d})();return this.setShared({pkgName:e,loaded:!1,shared:a,from:o.options.name,lib:null,loading:u}),u}}initializeSharing(e=DEFAULT_SCOPE,r){const{host:o}=this,n=r==null?void 0:r.from,i=r==null?void 0:r.strategy;let a=r==null?void 0:r.initScope;const s=[];if(n!=="build"){const{initTokens:_}=this;a||(a=[]);let y=_[e];if(y||(y=_[e]={from:this.host.name}),a.indexOf(y)>=0)return s;a.push(y)}const l=this.shareScopeMap,c=o.options.name;l[e]||(l[e]={});const u=l[e],d=(_,y)=>{var m;const{version:g,eager:I}=y;u[_]=u[_]||{};const b=u[_],R=b[g],E=!!(R&&(R.eager||(m=R.shareConfig)!=null&&m.eager));(!R||R.strategy!=="loaded-first"&&!R.loaded&&(!I!=!E?I:c>R.from))&&(b[g]=y)},h=_=>_&&_.init&&_.init(l[e],a),p=async _=>{const{module:y}=await o.remoteHandler.getRemoteModuleAndOptions({id:_});if(y.getEntry){let m;try{m=await y.getEntry()}catch(g){m=await o.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:_,error:g,from:"runtime",lifecycle:"beforeLoadShare",origin:o})}y.inited||(await h(m),y.inited=!0)}};return Object.keys(o.options.shared).forEach(_=>{o.options.shared[_].forEach(m=>{m.scope.includes(e)&&d(_,m)})}),(o.options.shareStrategy==="version-first"||i==="version-first")&&o.options.remotes.forEach(_=>{_.shareScope===e&&s.push(p(_.name))}),s}loadShareSync(e,r){const{host:o}=this,n=getTargetSharedOptions({pkgName:e,extraOptions:r,shareInfos:o.options.shared});n!=null&&n.scope&&n.scope.forEach(s=>{this.initializeSharing(s,{strategy:n.strategy})});const i=getRegisteredShare(this.shareScopeMap,e,n,this.hooks.lifecycle.resolveShare),a=s=>{s.useIn||(s.useIn=[]),addUniqueItem(s.useIn,o.options.name)};if(i){if(typeof i.lib=="function")return a(i),i.loaded||(i.loaded=!0,i.from===o.options.name&&(n.loaded=!0)),i.lib;if(typeof i.get=="function"){const s=i.get();if(!(s instanceof Promise))return a(i),this.setShared({pkgName:e,loaded:!0,from:o.options.name,lib:s,shared:i}),s}}if(n.lib)return n.loaded||(n.loaded=!0),n.lib;if(n.get){const s=n.get();if(s instanceof Promise){const l=(r==null?void 0:r.from)==="build"?errorCodes$1.RUNTIME_005:errorCodes$1.RUNTIME_006;throw new Error(errorCodes$1.getShortErrorMsg(l,errorCodes$1.runtimeDescMap,{hostName:o.options.name,sharedPkgName:e}))}return n.lib=s,this.setShared({pkgName:e,loaded:!0,from:o.options.name,lib:n.lib,shared:n}),n.lib}throw new Error(errorCodes$1.getShortErrorMsg(errorCodes$1.RUNTIME_006,errorCodes$1.runtimeDescMap,{hostName:o.options.name,sharedPkgName:e}))}initShareScopeMap(e,r,o={}){const{host:n}=this;this.shareScopeMap[e]=r,this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope:r,options:n.options,origin:n,scopeName:e,hostShareScopeMap:o.hostShareScopeMap})}setShared({pkgName:e,shared:r,from:o,lib:n,loading:i,loaded:a,get:s}){const{version:l,scope:c="default"}=r,u=polyfills._object_without_properties_loose(r,["version","scope"]);(Array.isArray(c)?c:[c]).forEach(h=>{if(this.shareScopeMap[h]||(this.shareScopeMap[h]={}),this.shareScopeMap[h][e]||(this.shareScopeMap[h][e]={}),!this.shareScopeMap[h][e][l]){this.shareScopeMap[h][e][l]=polyfills._extends({version:l,scope:["default"]},u,{lib:n,loaded:a,loading:i}),s&&(this.shareScopeMap[h][e][l].get=s);return}const p=this.shareScopeMap[h][e][l];i&&!p.loading&&(p.loading=i),a&&!p.loaded&&(p.loaded=a),o&&p.from!==o&&(p.from=o)})}_setGlobalShareScopeMap(e){const r=getGlobalShareScope(),o=e.id||e.name;o&&!r[o]&&(r[o]=this.shareScopeMap)}constructor(e){this.hooks=new PluginSystem({afterResolve:new AsyncWaterfallHook("afterResolve"),beforeLoadShare:new AsyncWaterfallHook("beforeLoadShare"),loadShare:new AsyncHook,resolveShare:new SyncWaterfallHook("resolveShare"),initContainerShareScopeMap:new SyncWaterfallHook("initContainerShareScopeMap")}),this.host=e,this.shareScopeMap={},this.initTokens={},this._setGlobalShareScopeMap(e.options)}}class RemoteHandler{formatAndRegisterRemote(e,r){return(r.remotes||[]).reduce((n,i)=>(this.registerRemote(i,n,{force:!1}),n),e.remotes)}setIdToRemoteMap(e,r){const{remote:o,expose:n}=r,{name:i,alias:a}=o;if(this.idToRemoteMap[e]={name:o.name,expose:n},a&&e.startsWith(i)){const s=e.replace(i,a);this.idToRemoteMap[s]={name:o.name,expose:n};return}if(a&&e.startsWith(a)){const s=e.replace(a,i);this.idToRemoteMap[s]={name:o.name,expose:n}}}async loadRemote(e,r){const{host:o}=this;try{const{loadFactory:n=!0}=r||{loadFactory:!0},{module:i,moduleOptions:a,remoteMatchInfo:s}=await this.getRemoteModuleAndOptions({id:e}),{pkgNameOrAlias:l,remote:c,expose:u,id:d,remoteSnapshot:h}=s,p=await i.get(d,u,r,h),_=await this.hooks.lifecycle.onLoad.emit({id:d,pkgNameOrAlias:l,expose:u,exposeModule:n?p:void 0,exposeModuleFactory:n?void 0:p,remote:c,options:a,moduleInstance:i,origin:o});return this.setIdToRemoteMap(e,s),typeof _=="function"?_:p}catch(n){const{from:i="runtime"}=r||{from:"runtime"},a=await this.hooks.lifecycle.errorLoadRemote.emit({id:e,error:n,from:i,lifecycle:"onLoad",origin:o});if(!a)throw n;return a}}async preloadRemote(e){const{host:r}=this;await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:e,options:r.options,origin:r});const o=formatPreloadArgs(r.options.remotes,e);await Promise.all(o.map(async n=>{const{remote:i}=n,a=getRemoteInfo(i),{globalSnapshot:s,remoteSnapshot:l}=await r.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:i}),c=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:r,preloadOptions:n,remote:i,remoteInfo:a,globalSnapshot:s,remoteSnapshot:l});c&&preloadAssets(a,r,c)}))}registerRemotes(e,r){const{host:o}=this;e.forEach(n=>{this.registerRemote(n,o.options.remotes,{force:r==null?void 0:r.force})})}async getRemoteModuleAndOptions(e){const{host:r}=this,{id:o}=e;let n;try{n=await this.hooks.lifecycle.beforeRequest.emit({id:o,options:r.options,origin:r})}catch(_){if(n=await this.hooks.lifecycle.errorLoadRemote.emit({id:o,options:r.options,origin:r,from:"runtime",error:_,lifecycle:"beforeRequest"}),!n)throw _}const{id:i}=n,a=matchRemoteWithNameAndExpose(r.options.remotes,i);assert(a,errorCodes$1.getShortErrorMsg(errorCodes$1.RUNTIME_004,errorCodes$1.runtimeDescMap,{hostName:r.options.name,requestId:i}));const{remote:s}=a,l=getRemoteInfo(s),c=await r.sharedHandler.hooks.lifecycle.afterResolve.emit(polyfills._extends({id:i},a,{options:r.options,origin:r,remoteInfo:l})),{remote:u,expose:d}=c;assert(u&&d,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${i}.`);let h=r.moduleCache.get(u.name);const p={host:r,remoteInfo:l};return h||(h=new Module(p),r.moduleCache.set(u.name,h)),{module:h,moduleOptions:p,remoteMatchInfo:c}}registerRemote(e,r,o){const{host:n}=this,i=()=>{if(e.alias){const s=r.find(l=>{var c;return e.alias&&(l.name.startsWith(e.alias)||((c=l.alias)==null?void 0:c.startsWith(e.alias)))});assert(!s,`The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${s&&s.name} name or alias`)}"entry"in e&&sdk.isBrowserEnv()&&!e.entry.startsWith("http")&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||(e.shareScope=DEFAULT_SCOPE),e.type||(e.type=DEFAULT_REMOTE_TYPE)};this.hooks.lifecycle.beforeRegisterRemote.emit({remote:e,origin:n});const a=r.find(s=>s.name===e.name);if(!a)i(),r.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:n});else{const s=[`The remote "${e.name}" is already registered.`,"Please note that overriding it may cause unexpected errors."];o!=null&&o.force&&(this.removeRemote(a),i(),r.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:n}),sdk.warn(s.join(" ")))}}removeRemote(e){try{const{host:o}=this,{name:n}=e,i=o.options.remotes.findIndex(s=>s.name===n);i!==-1&&o.options.remotes.splice(i,1);const a=o.moduleCache.get(e.name);if(a){const s=a.remoteInfo,l=s.entryGlobalName;if(CurrentGlobal[l]){var r;(r=Object.getOwnPropertyDescriptor(CurrentGlobal,l))!=null&&r.configurable?delete CurrentGlobal[l]:CurrentGlobal[l]=void 0}const c=getRemoteEntryUniqueKey(a.remoteInfo);globalLoading[c]&&delete globalLoading[c],o.snapshotHandler.manifestCache.delete(s.entry);let u=s.buildVersion?sdk.composeKeyWithSeparator(s.name,s.buildVersion):s.name;const d=CurrentGlobal.__FEDERATION__.__INSTANCES__.findIndex(p=>s.buildVersion?p.options.id===u:p.name===u);if(d!==-1){const p=CurrentGlobal.__FEDERATION__.__INSTANCES__[d];u=p.options.id||u;const _=getGlobalShareScope();let y=!0;const m=[];Object.keys(_).forEach(g=>{const I=_[g];I&&Object.keys(I).forEach(b=>{const R=I[b];R&&Object.keys(R).forEach(E=>{const S=R[E];S&&Object.keys(S).forEach(T=>{const $=S[T];$&&typeof $=="object"&&$.from===s.name&&($.loaded||$.loading?($.useIn=$.useIn.filter(M=>M!==s.name),$.useIn.length?y=!1:m.push([g,b,E,T])):m.push([g,b,E,T]))})})})}),y&&(p.shareScopeMap={},delete _[u]),m.forEach(([g,I,b,R])=>{var E,S,T;(T=_[g])==null||(S=T[I])==null||(E=S[b])==null||delete E[R]}),CurrentGlobal.__FEDERATION__.__INSTANCES__.splice(d,1)}const{hostGlobalSnapshot:h}=getGlobalRemoteInfo(e,o);if(h){const p=h&&"remotesInfo"in h&&h.remotesInfo&&getInfoWithoutType(h.remotesInfo,e.name).key;p&&(delete h.remotesInfo[p],Global.__FEDERATION__.__MANIFEST_LOADING__[p]&&delete Global.__FEDERATION__.__MANIFEST_LOADING__[p])}o.moduleCache.delete(e.name)}}catch(o){logger.log("removeRemote fail: ",o)}}constructor(e){this.hooks=new PluginSystem({beforeRegisterRemote:new SyncWaterfallHook("beforeRegisterRemote"),registerRemote:new SyncWaterfallHook("registerRemote"),beforeRequest:new AsyncWaterfallHook("beforeRequest"),onLoad:new AsyncHook("onLoad"),handlePreloadModule:new SyncHook("handlePreloadModule"),errorLoadRemote:new AsyncHook("errorLoadRemote"),beforePreloadRemote:new AsyncHook("beforePreloadRemote"),generatePreloadAssets:new AsyncHook("generatePreloadAssets"),afterPreloadRemote:new AsyncHook,loadEntry:new AsyncHook}),this.host=e,this.idToRemoteMap={}}}const USE_SNAPSHOT=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN=="boolean"?!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN:!0;class ModuleFederation{initOptions(e){this.registerPlugins(e.plugins);const r=this.formatOptions(this.options,e);return this.options=r,r}async loadShare(e,r){return this.sharedHandler.loadShare(e,r)}loadShareSync(e,r){return this.sharedHandler.loadShareSync(e,r)}initializeSharing(e=DEFAULT_SCOPE,r){return this.sharedHandler.initializeSharing(e,r)}initRawContainer(e,r,o){const n=getRemoteInfo({name:e,entry:r}),i=new Module({host:this,remoteInfo:n});return i.remoteEntryExports=o,this.moduleCache.set(e,i),i}async loadRemote(e,r){return this.remoteHandler.loadRemote(e,r)}async preloadRemote(e){return this.remoteHandler.preloadRemote(e)}initShareScopeMap(e,r,o={}){this.sharedHandler.initShareScopeMap(e,r,o)}formatOptions(e,r){const{shared:o}=formatShareConfigs(e,r),{userOptions:n,options:i}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions:r,options:e,shareInfo:o}),a=this.remoteHandler.formatAndRegisterRemote(i,n),{shared:s}=this.sharedHandler.registerShared(i,n),l=[...i.plugins];n.plugins&&n.plugins.forEach(u=>{l.includes(u)||l.push(u)});const c=polyfills._extends({},e,r,{plugins:l,remotes:a,shared:s});return this.hooks.lifecycle.init.emit({origin:this,options:c}),c}registerPlugins(e){const r=registerPlugins$1(e,this);this.options.plugins=this.options.plugins.reduce((o,n)=>(n&&o&&!o.find(i=>i.name===n.name)&&o.push(n),o),r||[])}registerRemotes(e,r){return this.remoteHandler.registerRemotes(e,r)}registerShared(e){this.sharedHandler.registerShared(this.options,polyfills._extends({},this.options,{shared:e}))}constructor(e){this.hooks=new PluginSystem({beforeInit:new SyncWaterfallHook("beforeInit"),init:new SyncHook,beforeInitContainer:new AsyncWaterfallHook("beforeInitContainer"),initContainer:new AsyncWaterfallHook("initContainer")}),this.version="0.18.4",this.moduleCache=new Map,this.loaderHook=new PluginSystem({getModuleInfo:new SyncHook,createScript:new SyncHook,createLink:new SyncHook,fetch:new AsyncHook,loadEntryError:new AsyncHook,getModuleFactory:new AsyncHook}),this.bridgeHook=new PluginSystem({beforeBridgeRender:new SyncHook,afterBridgeRender:new SyncHook,beforeBridgeDestroy:new SyncHook,afterBridgeDestroy:new SyncHook});const r=USE_SNAPSHOT?[snapshotPlugin(),generatePreloadAssetsPlugin()]:[],o={id:getBuilderId$1(),name:e.name,plugins:r,remotes:[],shared:{},inBrowser:sdk.isBrowserEnv()};this.name=e.name,this.options=o,this.snapshotHandler=new SnapshotHandler(this),this.sharedHandler=new SharedHandler(this),this.remoteHandler=new RemoteHandler(this),this.shareScopeMap=this.sharedHandler.shareScopeMap,this.registerPlugins([...o.plugins,...e.plugins||[]]),this.options=this.formatOptions(o,e)}}var index=Object.freeze({__proto__:null});index_cjs$2.loadScript=sdk.loadScript;index_cjs$2.loadScriptNode=sdk.loadScriptNode;index_cjs$2.CurrentGlobal=CurrentGlobal;index_cjs$2.Global=Global;index_cjs$2.Module=Module;index_cjs$2.ModuleFederation=ModuleFederation;index_cjs$2.addGlobalSnapshot=addGlobalSnapshot;index_cjs$2.assert=assert;index_cjs$2.getGlobalFederationConstructor=getGlobalFederationConstructor;index_cjs$2.getGlobalSnapshot=getGlobalSnapshot;index_cjs$2.getInfoWithoutType=getInfoWithoutType;index_cjs$2.getRegisteredShare=getRegisteredShare;index_cjs$2.getRemoteEntry=getRemoteEntry;index_cjs$2.getRemoteInfo=getRemoteInfo;index_cjs$2.helpers=helpers;index_cjs$2.isStaticResourcesEqual=isStaticResourcesEqual;index_cjs$2.matchRemoteWithNameAndExpose=matchRemoteWithNameAndExpose;index_cjs$2.registerGlobalPlugins=registerGlobalPlugins;index_cjs$2.resetFederationGlobalInfo=resetFederationGlobalInfo;index_cjs$2.safeWrapper=safeWrapper;index_cjs$2.satisfy=satisfy;index_cjs$2.setGlobalFederationConstructor=setGlobalFederationConstructor;index_cjs$2.setGlobalFederationInstance=setGlobalFederationInstance;index_cjs$2.types=index;var utils_cjs={},runtimeCore$1=index_cjs$2;function getBuilderId(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}function getGlobalFederationInstance(t,e){const r=getBuilderId();return runtimeCore$1.CurrentGlobal.__FEDERATION__.__INSTANCES__.find(o=>!!(r&&o.options.id===r||o.options.name===t&&!o.options.version&&!e||o.options.name===t&&e&&o.options.version===e))}utils_cjs.getGlobalFederationInstance=getGlobalFederationInstance;var runtimeCore=index_cjs$2,errorCodes=index_cjs,utils=utils_cjs;function createInstance(t){const e=runtimeCore.getGlobalFederationConstructor()||runtimeCore.ModuleFederation,r=new e(t);return runtimeCore.setGlobalFederationInstance(r),r}let FederationInstance=null;function init(t){const e=utils.getGlobalFederationInstance(t.name,t.version);return e?(e.initOptions(t),FederationInstance||(FederationInstance=e),e):(FederationInstance=createInstance(t),FederationInstance)}function loadRemote(...t){return runtimeCore.assert(FederationInstance,errorCodes.getShortErrorMsg(errorCodes.RUNTIME_009,errorCodes.runtimeDescMap)),FederationInstance.loadRemote.apply(FederationInstance,t)}function loadShare(...t){return runtimeCore.assert(FederationInstance,errorCodes.getShortErrorMsg(errorCodes.RUNTIME_009,errorCodes.runtimeDescMap)),FederationInstance.loadShare.apply(FederationInstance,t)}function loadShareSync(...t){return runtimeCore.assert(FederationInstance,errorCodes.getShortErrorMsg(errorCodes.RUNTIME_009,errorCodes.runtimeDescMap)),FederationInstance.loadShareSync.apply(FederationInstance,t)}function preloadRemote(...t){return runtimeCore.assert(FederationInstance,errorCodes.getShortErrorMsg(errorCodes.RUNTIME_009,errorCodes.runtimeDescMap)),FederationInstance.preloadRemote.apply(FederationInstance,t)}function registerRemotes(...t){return runtimeCore.assert(FederationInstance,errorCodes.getShortErrorMsg(errorCodes.RUNTIME_009,errorCodes.runtimeDescMap)),FederationInstance.registerRemotes.apply(FederationInstance,t)}function registerPlugins(...t){return runtimeCore.assert(FederationInstance,errorCodes.getShortErrorMsg(errorCodes.RUNTIME_009,errorCodes.runtimeDescMap)),FederationInstance.registerPlugins.apply(FederationInstance,t)}function getInstance(){return FederationInstance}function registerShared(...t){return runtimeCore.assert(FederationInstance,errorCodes.getShortErrorMsg(errorCodes.RUNTIME_009,errorCodes.runtimeDescMap)),FederationInstance.registerShared.apply(FederationInstance,t)}runtimeCore.setGlobalFederationConstructor(runtimeCore.ModuleFederation);index_cjs$3.Module=runtimeCore.Module;index_cjs$3.ModuleFederation=runtimeCore.ModuleFederation;index_cjs$3.getRemoteEntry=runtimeCore.getRemoteEntry;index_cjs$3.getRemoteInfo=runtimeCore.getRemoteInfo;index_cjs$3.loadScript=runtimeCore.loadScript;index_cjs$3.loadScriptNode=runtimeCore.loadScriptNode;index_cjs$3.registerGlobalPlugins=runtimeCore.registerGlobalPlugins;index_cjs$3.createInstance=createInstance;index_cjs$3.getInstance=getInstance;var init_1=index_cjs$3.init=init,loadRemote_1=index_cjs$3.loadRemote=loadRemote;index_cjs$3.loadShare=loadShare;index_cjs$3.loadShareSync=loadShareSync;index_cjs$3.preloadRemote=preloadRemote;index_cjs$3.registerPlugins=registerPlugins;var registerRemotes_1=index_cjs$3.registerRemotes=registerRemotes;index_cjs$3.registerShared=registerShared;let initResolve,initReject;const initPromise=new Promise((t,e)=>{initResolve=t,initReject=e});var iobroker_javascript__mf_v__runtimeInit__mf_v__={initPromise,initResolve,initReject};export{iobroker_javascript__mf_v__runtimeInit__mf_v__ as a,index_cjs$3 as b,init_1 as i,loadRemote_1 as l,registerRemotes_1 as r};
@@ -1 +0,0 @@
1
- import"./iobroker_javascript__loadShare__react__loadShare__-i8pXne9X.js";import{u as t,T as m,F as s}from"./createSvgIcon-DlIk-fDn.js";function r(){const e=t(s);return e[m]||e}export{r as u};
@@ -1 +0,0 @@
1
- const e={};export{e as default};