@abtnode/blocklet-services 1.16.33-beta-20241011-054050-798b5f46 → 1.16.33-beta-20241014-122831-e6000fb8

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 (201) hide show
  1. package/api/index.js +25 -1
  2. package/api/libs/connect/session.js +8 -9
  3. package/api/routes/env.js +1 -1
  4. package/dist/assets/{Add-CjHtOOsW.js → Add-BJTt1kMd.js} +1 -1
  5. package/dist/assets/{Alert-C1AWoXzB.js → Alert-BteoTFtG.js} +1 -1
  6. package/dist/assets/{ArrowDropDown-5QQoKnLR.js → ArrowDropDown-ZRFTvvxb.js} +1 -1
  7. package/dist/assets/{Avatar-DD_manng.js → Avatar-CSR_wVns.js} +1 -1
  8. package/dist/assets/{ButtonGroup-Dslh4PgR.js → ButtonGroup-Ct_nK4NB.js} +1 -1
  9. package/dist/assets/{CheckCircle-D3la5wZJ.js → CheckCircle-HJjJffHP.js} +1 -1
  10. package/dist/assets/{ChevronLeft-CAbyk7Rn.js → ChevronLeft-DxSg89IP.js} +1 -1
  11. package/dist/assets/{ChevronRight-cHt6B2E_.js → ChevronRight-CM8FbE-F.js} +1 -1
  12. package/dist/assets/{Close-C9Al2sHH.js → Close-2YBZKk5C.js} +1 -1
  13. package/dist/assets/{CloseOutlined-vttxnPOn.js → CloseOutlined-CWTygaxG.js} +1 -1
  14. package/dist/assets/{Delete-DmUC02xh.js → Delete-CfrDr5ng.js} +1 -1
  15. package/dist/assets/{DeleteOutline-Dm_Nsq2F.js → DeleteOutline-BJKAWmBh.js} +1 -1
  16. package/dist/assets/{DialogContentText-Dd6Llavm.js → DialogContentText-DFstBMvJ.js} +1 -1
  17. package/dist/assets/{Done-DNj6bTeJ.js → Done-kYmL-w5Q.js} +1 -1
  18. package/dist/assets/{Download-Ce--U_BZ.js → Download-3i_H1QDL.js} +1 -1
  19. package/dist/assets/{Edit-BJPRqjE_.js → Edit-Byp7cAsU.js} +1 -1
  20. package/dist/assets/{EditIcon-BlL4geyW.js → EditIcon-CCkC5Xqt.js} +1 -1
  21. package/dist/assets/{Error-B3NgNRCx.js → Error-9xJSphOV.js} +1 -1
  22. package/dist/assets/{ExpandMore-DkLjJq9w.js → ExpandMore-DEkGngK0.js} +1 -1
  23. package/dist/assets/{FormControl-CBM31tVk.js → FormControl-B60-pCHh.js} +1 -1
  24. package/dist/assets/{FormControlLabel-Bid6aLDa.js → FormControlLabel-Bluo2zmp.js} +1 -1
  25. package/dist/assets/{FormGroup-CQ2r3LPd.js → FormGroup-DsI9QnWh.js} +1 -1
  26. package/dist/assets/{Google-BDEjIi3K.js → Google-Dxit-RJH.js} +1 -1
  27. package/dist/assets/{Grid-CosTfC_n.js → Grid-CNMlkE7r.js} +1 -1
  28. package/dist/assets/{Hidden-CbT0Nsko.js → Hidden-CDKfZsy3.js} +1 -1
  29. package/dist/assets/{InfoOutlined-B9EO-P9G.js → InfoOutlined-D15IdpTB.js} +1 -1
  30. package/dist/assets/{InputAdornment-CyPi6QAH.js → InputAdornment-D1s-TGB2.js} +1 -1
  31. package/dist/assets/{InputLabel-D4nkCqtD.js → InputLabel-Ou7BDwPq.js} +1 -1
  32. package/dist/assets/{LastPage-D5sEb42F.js → LastPage-3hVq4DnQ.js} +1 -1
  33. package/dist/assets/{Launch-KX5AwGaZ.js → Launch-hsZiLuPF.js} +1 -1
  34. package/dist/assets/{LaunchOutlined-CaL34FcQ.js → LaunchOutlined-CIPUHJYA.js} +1 -1
  35. package/dist/assets/{Link-C4c-c9oW.js → Link-CZ52DbXN.js} +1 -1
  36. package/dist/assets/{ListItemText-SZUZM8zJ.js → ListItemText-7iGJk7-i.js} +1 -1
  37. package/dist/assets/{LoadingButton-BHAAzaqd.js → LoadingButton-BWhIg3J5.js} +1 -1
  38. package/dist/assets/{LockIcon-D_fJE15j.js → LockIcon-D-dObf1I.js} +1 -1
  39. package/dist/assets/{Loop-CGMlnuX2.js → Loop-BZOn9fYq.js} +1 -1
  40. package/dist/assets/{Menu-C6gTV_C5.js → Menu-DSnQZg3F.js} +1 -1
  41. package/dist/assets/{MoreHoriz-91XyooIB.js → MoreHoriz-YKIrf1Wy.js} +1 -1
  42. package/dist/assets/{MoreVert-Dm5VmAN3.js → MoreVert-DHjA3d3K.js} +1 -1
  43. package/dist/assets/{OpenInNew-FWEY5jmN.js → OpenInNew-CI-gm1PI.js} +1 -1
  44. package/dist/assets/{Pagination-CrML4K_7.js → Pagination-C4NMVHZ6.js} +1 -1
  45. package/dist/assets/{PlayArrow-DDVBKikc.js → PlayArrow-Daa-8Tr0.js} +1 -1
  46. package/dist/assets/{QuestionMarkCircle-N_nyomRU.js → QuestionMarkCircle-C8hdkmtm.js} +1 -1
  47. package/dist/assets/{RadioGroup-DQS4l9Qs.js → RadioGroup-DwfAoVB4.js} +1 -1
  48. package/dist/assets/{Search-kaa4IwGB.js → Search-Bn8StOmd.js} +1 -1
  49. package/dist/assets/{Select-3MFmfiU2.js → Select-Djzas9fr.js} +2 -2
  50. package/dist/assets/{ServerLogo-BDPxuR0z.js → ServerLogo-DI-e9hMR.js} +1 -1
  51. package/dist/assets/{Skeleton-DghEtvL_.js → Skeleton-_Fn46ryV.js} +1 -1
  52. package/dist/assets/{Slider-DHap0Syp.js → Slider-BF_Z955S.js} +1 -1
  53. package/dist/assets/{Stack-DOuPfp9P.js → Stack-Bj4-8Xdh.js} +1 -1
  54. package/dist/assets/{Stepper-CEgSJjc5.js → Stepper-eH1_64jM.js} +1 -1
  55. package/dist/assets/{TextField-DFiFTqqd.js → TextField-5Z401EeH.js} +1 -1
  56. package/dist/assets/{Toolbar-Ch5_bErb.js → Toolbar-BaL7nrmh.js} +1 -1
  57. package/dist/assets/{ViewColumn-UerMI3fe.js → ViewColumn-DKpDa9q-.js} +1 -1
  58. package/dist/assets/{ViewList-JPiij74q.js → ViewList-GpC5PoCA.js} +1 -1
  59. package/dist/assets/{access-control-EjYGet_v.js → access-control-C6O5R0mf.js} +1 -1
  60. package/dist/assets/{actions-GskZx_ox.js → actions-Q879Pkne.js} +1 -1
  61. package/dist/assets/{add-component-core-C4W9lOMx.js → add-component-core-CG_HtNm5.js} +55 -55
  62. package/dist/assets/add-resource-JyZLI5Lv.js +1 -0
  63. package/dist/assets/{addon-BPs0htdJ.js → addon-BRVDzo3o.js} +1 -1
  64. package/dist/assets/{analytics-BGp8lvxJ.js → analytics-73N71qjk.js} +1 -1
  65. package/dist/assets/api-CwFLZZbF.js +1 -0
  66. package/dist/assets/{audit-logs-Cnci_r2o.js → audit-logs-puLYB2Eu.js} +1 -1
  67. package/dist/assets/base32-BLifBexi.js +1 -0
  68. package/dist/assets/{bundle-avatar-BuAV52Lr.js → bundle-avatar-DAWVEEnX.js} +1 -1
  69. package/dist/assets/{button-CdCaehQs.js → button-DCt8pvLU.js} +1 -1
  70. package/dist/assets/{click-to-copy-JKdxz45I.js → click-to-copy-BAgLXNYj.js} +1 -1
  71. package/dist/assets/{complete-lZpRAcrs.js → complete-CaqN1wDT.js} +2 -2
  72. package/dist/assets/{component-C0raFocJ.js → component-CgWtMuIX.js} +7 -7
  73. package/dist/assets/{config-BS0f8E6U.js → config-Bmvi5Dgu.js} +1 -1
  74. package/dist/assets/{config-CYMR43Uh.js → config-D0JIeiwj.js} +1 -1
  75. package/dist/assets/{config-navigation-DC5Unmga.js → config-navigation-YaYHtCvs.js} +1 -1
  76. package/dist/assets/confirm-BwEOtmhD.js +7 -0
  77. package/dist/assets/{connect-DNaSl255.js → connect-Dkgw0kOW.js} +1 -1
  78. package/dist/assets/{connect-CDiZvdtC.js → connect-DozpURrA.js} +1 -1
  79. package/dist/assets/{connect-to-D2CuNe81.js → connect-to-C-bgHPhl.js} +1 -1
  80. package/dist/assets/{content-layout-CANmEWo5.js → content-layout-D3ADfzfh.js} +1 -1
  81. package/dist/assets/{dashboard-H4MvXtMx.js → dashboard-DlMIs9-3.js} +3 -3
  82. package/dist/assets/{deprecate-CiQ3rCd1.js → deprecate-CoPtGyVZ.js} +1 -1
  83. package/dist/assets/{did-address-BnBtx4o3.js → did-address-DBf1riah.js} +1 -1
  84. package/dist/assets/domain-BRMsf-pW.js +9 -0
  85. package/dist/assets/domain-list-BZrfjdSX.js +15 -0
  86. package/dist/assets/{email-DyV-6FVc.js → email-VBqJZRKh.js} +3 -3
  87. package/dist/assets/emotion-cache.browser.esm-BlrvwZdS.js +1 -0
  88. package/dist/assets/{exchange-passport-Z_HeEHaC.js → exchange-passport-B5Oos4u1.js} +1 -1
  89. package/dist/assets/{fallback-BiNvsiaq.js → fallback-DZ0HiAyE.js} +1 -1
  90. package/dist/assets/{format-error-CFOsq4HX.js → format-error-CWBrNztU.js} +1 -1
  91. package/dist/assets/{fuel-yExjWSAI.js → fuel-BKQZySp3.js} +1 -1
  92. package/dist/assets/{fullpage-BBGvbVDW.js → fullpage-6nDK23_-.js} +1 -1
  93. package/dist/assets/{home-BRqwH5Nf.js → home-DLCLG-oW.js} +1 -1
  94. package/dist/assets/{iframe-DGAKfP0s.js → iframe-DNIQ3m8W.js} +1 -1
  95. package/dist/assets/{index-XgsqmBi5.js → index-B-dldycO.js} +2 -2
  96. package/dist/assets/{index-ljMFxTRJ.js → index-B5n-3ODS.js} +1 -1
  97. package/dist/assets/{index-CjmnCSHR.js → index-BAAuF9c0.js} +1 -1
  98. package/dist/assets/{index-Bwpc9lYR.js → index-BBCh-jGI.js} +4 -4
  99. package/dist/assets/{index-BF2VCknl.js → index-BOHZnM-f.js} +1 -1
  100. package/dist/assets/{index-CGMrZbj4.js → index-Bh0cHqWf.js} +1 -1
  101. package/dist/assets/{index-Pa_povbs.js → index-C2Oj8_Vp.js} +1 -1
  102. package/dist/assets/{index-DRy-NjFK.js → index-C9CaaXcC.js} +4 -4
  103. package/dist/assets/{index-AxsaK0fs.js → index-CEJ9f9RI.js} +1 -1
  104. package/dist/assets/{index-Cd-oyWSF.js → index-Ci4yVq3f.js} +1 -1
  105. package/dist/assets/{index-D09vFr6D.js → index-CmX29Bgi.js} +1 -1
  106. package/dist/assets/{index-D1cdkATF.js → index-CoMUsX4P.js} +1 -1
  107. package/dist/assets/{index-DMTI-fNK.js → index-CpVWvA1p.js} +1 -1
  108. package/dist/assets/{index-CpiJ7s5C.js → index-CuQ1TF8_.js} +1 -1
  109. package/dist/assets/{index-DdSurbTD.js → index-CxCjOkMI.js} +1 -1
  110. package/dist/assets/{index-DuBaIIFS.js → index-D0YyoivA.js} +1 -1
  111. package/dist/assets/{index--duswiri.js → index-DXCVFJye.js} +1 -1
  112. package/dist/assets/{index-CE8crdfZ.js → index-Dc12GNV6.js} +1 -1
  113. package/dist/assets/{index-CuFxdccR.js → index-DdX2_Z-V.js} +3 -3
  114. package/dist/assets/{index-B2buyTYt.js → index-Dfexb5ST.js} +1 -1
  115. package/dist/assets/{index-oadE3d-r.js → index-DhCJxv9H.js} +1 -1
  116. package/dist/assets/{index-Brct1h9T.js → index-DjThaPGX.js} +1 -1
  117. package/dist/assets/{index-BgbKLD3V.js → index-DmMbCKT9.js} +13 -13
  118. package/dist/assets/{index-DuPJDRpB.js → index-Dv2lov1Q.js} +1 -1
  119. package/dist/assets/{index-DPP6VPXO.js → index-DyJa5tHD.js} +1 -1
  120. package/dist/assets/{index-B7RmJs-M.js → index-J1nJUC6w.js} +1 -1
  121. package/dist/assets/{index-BzI1fpMA.js → index-Q8Ks2tIO.js} +1 -1
  122. package/dist/assets/{index-BCrKZebO.js → index-dRhRTsQa.js} +1 -1
  123. package/dist/assets/{index-fgn9vwq8.js → index-dffxGns1.js} +85 -85
  124. package/dist/assets/{index-CM4OpCGB.js → index-ffVCrZUo.js} +1 -1
  125. package/dist/assets/{index-BjRErSmf.js → index-honENBw_.js} +1 -1
  126. package/dist/assets/{index-DrKbE9ju.js → index-lfUisoFe.js} +1 -1
  127. package/dist/assets/{index-Bv3OaukA.js → index-lt9fyfgM.js} +1 -1
  128. package/dist/assets/{index.es-BAn09M1Y.js → index.es-rdKQq6rd.js} +3 -3
  129. package/dist/assets/{index.esm-B3pQyY3d.js → index.esm-CDLGF2Ok.js} +1 -1
  130. package/dist/assets/{invitation-X778y-7j.js → invitation-CBE8ayy2.js} +1 -1
  131. package/dist/assets/{invite-DW0gtypP.js → invite-DNxG5QuO.js} +1 -1
  132. package/dist/assets/{issue-passport-eUut_p6V.js → issue-passport-DVDraA8b.js} +1 -1
  133. package/dist/assets/{item-jVTYzTUh.js → item-B8ylzOyP.js} +1 -1
  134. package/dist/assets/{jss-plugin-props-sort.esm-BEeq9OWC.js → jss-plugin-props-sort.esm-DEXIj4QJ.js} +1 -1
  135. package/dist/assets/{launch-result-message-abpetv4C.js → launch-result-message-vOpiexOg.js} +1 -1
  136. package/dist/assets/{layout-CEo-nvMH.js → layout-DA_DkjrU.js} +1 -1
  137. package/dist/assets/{list-header-B0DU7iJ8.js → list-header-QKzq_2ym.js} +1 -1
  138. package/dist/assets/localization-CQeVg11p.js +1 -0
  139. package/dist/assets/{log-zgah1FFi.js → log-1cv4Nqfa.js} +9 -10
  140. package/dist/assets/{login-oauth-callback-Dm5-WEz0.js → login-oauth-callback-B7aUPsz7.js} +1 -1
  141. package/dist/assets/{login-BZkTkP-9.js → login-t064HeQt.js} +1 -1
  142. package/dist/assets/{logo-uploader-BtaIWDgJ.js → logo-uploader-VgurHgdV.js} +3 -3
  143. package/dist/assets/{lost-passport-B8wdBerz.js → lost-passport-D6flI-5R.js} +3 -3
  144. package/dist/assets/{lottie-CzdjuVhm.js → lottie-I_rH23zu.js} +1 -1
  145. package/dist/assets/{notifications-D0GXE82s.js → notifications-B6xLuzv9.js} +1 -1
  146. package/dist/assets/{open-window-C-80E_lx.js → open-window-rIdL53L3.js} +1 -1
  147. package/dist/assets/overview-DxvmGAnq.js +12 -0
  148. package/dist/assets/{page-header-CxkULuMr.js → page-header-C4ksffkd.js} +1 -1
  149. package/dist/assets/{permission-BbWaMmK6.js → permission-wKa_U1CI.js} +1 -1
  150. package/dist/assets/{preferences-W2NveEKa.js → preferences-DuMJNXnz.js} +1 -1
  151. package/dist/assets/publish-resource-0gS10xJs.js +1 -0
  152. package/dist/assets/{react-BfXkambL.js → react-B05mWmeW.js} +3 -3
  153. package/dist/assets/{redux-Bj5HJmsh.js → redux-DfuR4m7C.js} +1 -1
  154. package/dist/assets/{resource-dialog-B74wCZrY.js → resource-dialog-Diy0jeEC.js} +1 -1
  155. package/dist/assets/sdk-CDIje09E.js +1 -0
  156. package/dist/assets/{selector-CuYNfwOx.js → selector-46StcO3H.js} +1 -1
  157. package/dist/assets/session-D5nyg1yy.js +1 -0
  158. package/dist/assets/setup-8cMqYLJw.js +19 -0
  159. package/dist/assets/{shorten-label-DXOCGUmG.js → shorten-label-BgvIg6s3.js} +1 -1
  160. package/dist/assets/{slicedToArray-C0WlFNXN.js → slicedToArray-YsdZC5SZ.js} +2 -2
  161. package/dist/assets/{spaces-C30MN-fS.js → spaces-D3oDzkgq.js} +1 -1
  162. package/dist/assets/{start-BrD7qtd7.js → start-CO4thlbA.js} +1 -1
  163. package/dist/assets/{step-actions-pilBvcqr.js → step-actions-DClVmsb6.js} +1 -1
  164. package/dist/assets/{studio-B_REa37-.js → studio-CSSHBcHf.js} +1 -1
  165. package/dist/assets/{switch-control-BxJO_e5C.js → switch-control-CSffO3YM.js} +1 -1
  166. package/dist/assets/{toUpper-DduZg1wT.js → toUpper-B8JrOhOn.js} +1 -1
  167. package/dist/assets/{transfer-BrT_GwZC.js → transfer-BNl3sweY.js} +1 -1
  168. package/dist/assets/{trim-BAyy5nHT.js → trim-iOszuV5t.js} +1 -1
  169. package/dist/assets/{uniqBy-dnuDvtYO.js → uniqBy-lALGeXcn.js} +1 -1
  170. package/dist/assets/{unsubscribe-UP3-zTl3.js → unsubscribe-B0Fo_VJh.js} +1 -1
  171. package/dist/assets/{url-join-FMV_JPfK.js → url-join-BqiDhuv9.js} +1 -1
  172. package/dist/assets/{use-blocklet-info-for-connect-did-spaces-D7ja6RMG.js → use-blocklet-info-for-connect-did-spaces-tjiuk9k8.js} +1 -1
  173. package/dist/assets/{use-mobile-2Gfazu03.js → use-mobile-DM1Tj10j.js} +1 -1
  174. package/dist/assets/{useAsync-Bb8Vv9_h.js → useAsync-DoYCbZEG.js} +1 -1
  175. package/dist/assets/{useFormControl-CGJ6_pv6.js → useFormControl-tCmd2QIL.js} +1 -1
  176. package/dist/assets/{useLocalStorage-Dh2Sw2wx.js → useLocalStorage-BDGPbN_I.js} +1 -1
  177. package/dist/assets/{useSetState-DIdqG-wZ.js → useSetState-ChDKLQb-.js} +1 -1
  178. package/dist/assets/{useSlot-Suwkr6Il.js → useSlot-Hwx0G2AC.js} +1 -1
  179. package/dist/assets/{useSlotProps-Do3AixJL.js → useSlotProps-ClBKOVWk.js} +1 -1
  180. package/dist/assets/useThemeProps-C7VhBkC8.js +1 -0
  181. package/dist/assets/{user-center-D6fHk_Q6.js → user-center-Cv6HUKmm.js} +1 -1
  182. package/dist/assets/{user-sessions-3hW7A5O1.js → user-sessions-D1QtptvG.js} +1 -1
  183. package/dist/assets/{util-B4YWdsL1.js → util-DkfUxkyg.js} +1 -1
  184. package/dist/assets/{wrap-locale-Bx_1JQDo.js → wrap-locale-5MOyASYg.js} +1 -1
  185. package/dist/assets/{zh-tEPjXU3b.js → zh-AGc49itB.js} +1 -1
  186. package/dist/index.html +1 -1
  187. package/dist/service-worker.js +1 -1
  188. package/package.json +27 -26
  189. package/dist/assets/add-resource-HMG5CdPm.js +0 -1
  190. package/dist/assets/api-CTJQFV8E.js +0 -1
  191. package/dist/assets/confirm-DQ3CFWMW.js +0 -7
  192. package/dist/assets/domain-DWy85KB9.js +0 -9
  193. package/dist/assets/domain-list-DN84Sise.js +0 -15
  194. package/dist/assets/emotion-cache.browser.esm-BNDDTfYL.js +0 -1
  195. package/dist/assets/localization-taL-ipRT.js +0 -1
  196. package/dist/assets/overview-CwLJAe7-.js +0 -12
  197. package/dist/assets/publish-resource-DMHR6AkZ.js +0 -1
  198. package/dist/assets/sdk-DmxPo3pC.js +0 -1
  199. package/dist/assets/session-DAMa63sM.js +0 -1
  200. package/dist/assets/setup-CkAqZcwR.js +0 -19
  201. package/dist/assets/useThemeProps-Dc-5SZKE.js +0 -1
@@ -0,0 +1,9 @@
1
+ import{j as i,r,a0 as P,ak as C,a8 as T,fS as B,a5 as h,B as a,P as f,Z as w}from"./index-dffxGns1.js";import{D as E,a as b,A as I}from"./domain-list-BZrfjdSX.js";import{P as A}from"./page-header-C4ksffkd.js";import{_ as L}from"./useSetState-ChDKLQb-.js";import{S as p}from"./button-DCt8pvLU.js";import{S as W}from"./layout-DA_DkjrU.js";import{S as _}from"./step-actions-DClVmsb6.js";import"./trim-iOszuV5t.js";import"./Add-BJTt1kMd.js";import"./ExpandMore-DEkGngK0.js";import"./base32-BLifBexi.js";import"./LockIcon-D-dObf1I.js";import"./index-C2Oj8_Vp.js";import"./did-address-DBf1riah.js";import"./Link-CZ52DbXN.js";import"./permission-wKa_U1CI.js";import"./useAsync-DoYCbZEG.js";import"./session-D5nyg1yy.js";import"./confirm-BwEOtmhD.js";import"./DialogContentText-DFstBMvJ.js";import"./Alert-BteoTFtG.js";import"./useSlot-Hwx0G2AC.js";import"./format-error-CWBrNztU.js";import"./use-mobile-DM1Tj10j.js";import"./InfoOutlined-D15IdpTB.js";import"./OpenInNew-CI-gm1PI.js";import"./index-dRhRTsQa.js";import"./api-CwFLZZbF.js";import"./index-ffVCrZUo.js";import"./util-DkfUxkyg.js";import"./TextField-5Z401EeH.js";import"./FormControl-B60-pCHh.js";import"./useFormControl-tCmd2QIL.js";import"./InputLabel-Ou7BDwPq.js";import"./Select-Djzas9fr.js";import"./LoadingButton-BWhIg3J5.js";import"./useThemeProps-C7VhBkC8.js";import"./Delete-CfrDr5ng.js";import"./actions-Q879Pkne.js";import"./MoreHoriz-YKIrf1Wy.js";import"./ListItemText-7iGJk7-i.js";import"./content-layout-D3ADfzfh.js";function d({onNext:s,onPrevious:D}){var u,x;const{t:o}=r.useContext(P),[S,l]=r.useState(!1),{blocklet:e}=C(),[c,j]=r.useState(""),y=(((e==null?void 0:e.site)||{}).domainAliases||[]).map(t=>T.replaceSlotToIp(t.value,c)),[n,m]=L({domain:"",invalidDNSDomain:null,type:"",addDomainState:{text:""}}),v=(x=(u=e.environments)==null?void 0:u.find(t=>t.key==="BLOCKLET_APP_PK"))==null?void 0:x.value,g=y.find(t=>B.isDidDomain(t));return r.useEffect(()=>{h.get(`/dns-resolve?hostname=${window.location.hostname}`).then(({data:t})=>{j(t.address||"")}).catch(t=>{console.error(t.message)})},[]),i.jsxs(z,{children:[i.jsx("div",{className:"header",children:i.jsx(A,{title:o("setup.domain.title"),subTitle:o("setup.domain.subTitle"),onClickBack:D})}),i.jsxs(a,{className:"form",sx:{display:"flex",flexDirection:"column",gap:3,overflowY:"auto"},children:[i.jsxs(a,{children:[i.jsxs(a,{color:"text.primary",fontWeight:"fontWeightBold",fontSize:"1.125rem",children:[i.jsx(a,{display:"inline",children:o("setup.domain.skipStart")}),i.jsx(p,{variant:"text",size:"small",disabled:!!n.addDomainState.text,onClick:()=>s(),style:{paddingTop:0},children:i.jsx("span",{style:{textDecoration:"underline"},children:o("setup.domain.skip")})}),i.jsx(a,{display:"inline",children:o("setup.domain.skipEnd")})]}),i.jsx(a,{sx:{marginTop:"12px"},children:i.jsx(b,{listOnly:!0,inSetup:!0})})]}),i.jsxs(a,{children:[i.jsx(a,{fontWeight:"fontWeightBold",fontSize:"1.125rem",children:o("setup.domain.addTitle")}),i.jsx(I,{autoFocus:!1,appPk:v,appId:e.appPid,siteId:e.site.id,teamDid:e.meta.did,sx:{marginTop:"12px"},cnameDomain:g,currentIp:c,inBlockletSetup:!0,shouldCheckDomain:!0,resolveDomain:t=>h.get(`/dns-resolve?hostname=${t}`),onInputDomain:t=>{m({domain:t.domain,type:t.type}),l(t.error)},onStateChange:t=>m({addDomainState:t}),onSuccess:t=>{const k={domain:t.domain,type:t.type,nftDid:t.nftDid,chainHost:t.chainHost};m(k),s()},onError:l})]})]}),i.jsx(_,{mt:8,disabled:!!n.addDomainState.text,blocklet:e,onStartNow:()=>s("complete"),children:n.domain?i.jsx(p,{variant:"contained",loading:!!n.addDomainState.text,disabled:S||!!n.addDomainState.text||!n.domain,onClick:()=>s(),children:n.addDomainState.text||o("setup.next")}):i.jsx(p,{variant:"contained",disabled:!!n.addDomainState.text,onClick:()=>s(),children:o("setup.skip")})})]})}function Bt(s){return i.jsx(E,{children:i.jsx(d,{...s})})}d.propTypes={onNext:f.func,onPrevious:f.func};d.defaultProps={onNext:()=>{},onPrevious:()=>{}};const z=w(W)`
2
+ height: 100%;
3
+ overflow-y: hidden;
4
+ .form {
5
+ width: 100%;
6
+ height: 100%;
7
+ word-break: break-all;
8
+ }
9
+ `;export{Bt as default};
@@ -0,0 +1,15 @@
1
+ import{X as V,Y,j as e,P as n,fT as ot,fU as Le,cB as st,u as A,r as C,aP as O,aY as qe,aa as Te,a as z,n as W,t as N,fV as $e,eT as rt,fW as at,b7 as lt,B as u,$ as Me,aj as K,T as R,fX as ze,C as we,K as ct,c3 as dt,bD as Ae,fS as Fe,aT as Ne,a1 as H,aV as mt,bi as Be,c7 as Oe,c9 as We,cq as ut,bj as Ie,fY as pt,Z as ft,bl as xt,br as ht,fZ as gt,f_ as yt,a8 as Ee,aC as jt}from"./index-dffxGns1.js";import{t as ae}from"./trim-iOszuV5t.js";import{d as Dt}from"./Add-BJTt1kMd.js";import{d as vt}from"./ExpandMore-DEkGngK0.js";import{b as bt}from"./base32-BLifBexi.js";import{d as Ct}from"./LockIcon-D-dObf1I.js";import{E as St}from"./index-C2Oj8_Vp.js";import{W as Rt}from"./did-address-DBf1riah.js";import{_ as Tt,D as ke,w as Ue}from"./permission-wKa_U1CI.js";import{C as Z}from"./confirm-BwEOtmhD.js";import{A as He}from"./Alert-BteoTFtG.js";import{_ as le}from"./useSetState-ChDKLQb-.js";import{u as wt}from"./use-mobile-DM1Tj10j.js";import{d as At}from"./InfoOutlined-D15IdpTB.js";import{d as It}from"./OpenInNew-CI-gm1PI.js";import{r as Et}from"./index-dRhRTsQa.js";import{_ as kt}from"./useAsync-DoYCbZEG.js";import"./api-CwFLZZbF.js";import{I as Pt}from"./index-ffVCrZUo.js";import{p as Pe}from"./util-DkfUxkyg.js";import{L as _t}from"./Link-CZ52DbXN.js";import{T as Lt}from"./TextField-5Z401EeH.js";import{L as qt}from"./LoadingButton-BWhIg3J5.js";import{d as Ve}from"./Delete-CfrDr5ng.js";import{A as $t}from"./actions-Q879Pkne.js";import{L as Mt,a as zt}from"./ListItemText-7iGJk7-i.js";var ce={},Ft=Y;Object.defineProperty(ce,"__esModule",{value:!0});var ne=ce.default=void 0,Nt=Ft(V()),Bt=e;ne=ce.default=(0,Nt.default)((0,Bt.jsx)("path",{d:"M12.16 3h-.32L9.21 8.25h5.58zm4.3 5.25h5.16L19 3h-5.16zm4.92 1.5h-8.63V20.1zM11.25 20.1V9.75H2.62zM7.54 8.25 10.16 3H5L2.38 8.25z"}),"Diamond");var de={},Ot=Y;Object.defineProperty(de,"__esModule",{value:!0});var Ye=de.default=void 0,Wt=Ot(V()),Ut=e;Ye=de.default=(0,Wt.default)((0,Ut.jsx)("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess");const Ht=i=>["waiting","creating","renewaling"].includes(i);function me(i){var g,v;const{t}=A(),[s,o]=C.useState(!1),{inService:r}=O(),[a,l]=C.useState(null),{siteId:d,domain:m,onAdd:h,children:y,did:b}=i,[_,j]=C.useState(!1),{api:T,ws:{useSubscription:I}}=O(),{mode:E,actions:{refreshDomainStatus:p}}=qe(),w=Tt(async()=>{const{cert:x}=await T.findCertificateByDomain({input:{domain:m,did:b}});return x}),k=(x,L)=>{x.domain===m&&(j(!1),o(!1),r&&E!=="setup"&&(L==="success"?N.success(t("setup.domain.genCertSuccess",{domain:x.domain})):L==="error"&&N.error(t("setup.domain.genCertFailed",{domain:x.domain,message:x.message}))))};if(C.useEffect(()=>{var x;w.loading||j(Ht((x=w.value)==null?void 0:x.status))},[w.loading,(g=w.value)==null?void 0:g.status]),I(Te.BlockletEvents.certError,x=>k(x,"error")),I(Te.BlockletEvents.certIssued,x=>{w.retry(),p(x.domain),k(x,"success")}),w.loading||((v=w.value)==null?void 0:v.status)==="normal")return"";const D=()=>{o(!1),l(null)},c=async()=>{o(!0);try{await T.issueLetsEncryptCert({input:{siteId:d,domain:m,did:b,inBlockletSetup:E==="setup"}}),h(),j(!0)}catch(x){console.error(x),j(!1)}finally{o(!1),l(null)}},P={title:t("router.cert.genLetsEncryptCert.title"),description:e.jsxs("div",{children:[e.jsx(He,{severity:"success",children:t("router.cert.genLetsEncryptCert.dnsTip")}),t("router.cert.genLetsEncryptCert.description")]}),confirm:t("common.confirm"),onConfirm:c,onCancel:D},B=x=>{x.stopPropagation(),l(P)};return e.jsxs(e.Fragment,{children:[_?e.jsx(z,{title:t("router.cert.issuing"),children:e.jsx(W,{size:12})}):y({loading:s,open:B}),a&&e.jsx(Z,{color:"primary",title:a.title,description:a.description,confirm:a.confirm,params:a.params,onConfirm:a.onConfirm,onCancel:a.onCancel})]})}me.propTypes={domain:n.string.isRequired,did:n.string.isRequired,siteId:n.string.isRequired,onAdd:n.func,children:n.any};me.defaultProps={onAdd:()=>{},children:null};function ue(i){const{domain:t,domainStatus:s,...o}=i;return ot(t)||!Le(t)||st.isEmpty(s)||s!=null&&s.isHttps?"":e.jsx(me,{domain:t,...o})}ue.propTypes={domain:n.string.isRequired,domainStatus:n.shape({isHttps:n.bool}).isRequired,did:n.string.isRequired,onAdd:n.func,children:n.any};ue.defaultProps={onAdd:()=>{},children:null};var pe={},Vt=Y;Object.defineProperty(pe,"__esModule",{value:!0});var Ke=pe.default=void 0,Yt=Vt(V()),Kt=e;Ke=pe.default=(0,Yt.default)((0,Kt.jsx)("path",{d:"M17 20.41 18.41 19 15 15.59 13.59 17zM7.5 8H11v5.59L5.59 19 7 20.41l6-6V8h3.5L12 3.5z"}),"CallMerge");const Ze=C.createContext({}),{Provider:Zt,Consumer:Nn}=Ze;function Xt({children:i}){const[t,s]=le({domain:"",error:null}),{locale:o}=A(),r={error:t.error,domain:t.domain,setError:a=>{s({error:a})},setDomain:a=>{const l=ae(a),d=$e(l,o);s({domain:l,error:d})}};return e.jsx(Zt,{value:{value:r},children:i})}function Gt(){const{value:i}=C.useContext(Ze);return i}const{joinURL:_e}=rt,Qt=at,Xe="z2qaGosS3rZ7m5ttP3Nd4V4qczR9TryTcRV4p",Jt=async i=>{var d;if(!i||!(i!=null&&i.trim()))return null;const t=new URL(i);t.pathname="__blocklet__.js",t.searchParams.set("type","json");const{data:s}=await Qt.get(t.toString()),o=(d=s==null?void 0:s.componentMountPoints)==null?void 0:d.find(m=>m.did===Xe),r=new URL(i);r.pathname=o==null?void 0:o.mountPoint;const a=r.toString(),l=_e(a,"/api");return{base:a,api:l,domain:_e(l,"/domains")}};var en={DID_DOMAIN_SERVICE_DID:Xe,getDidDomainServiceURL:Jt},X={exports:{}};const tn=Et,nn=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"];class Ge extends Error{constructor(t){super(),t instanceof Error?(this.originalError=t,{message:t}=t):(this.originalError=new Error(t),this.originalError.stack=this.stack),this.name="AbortError",this.message=t}}const on=(i,t,s)=>{const o=s.retries-(t-1);return i.attemptNumber=t,i.retriesLeft=o,i},sn=i=>nn.includes(i),Qe=(i,t)=>new Promise((s,o)=>{t={onFailedAttempt:()=>{},retries:10,...t};const r=tn.operation(t);r.attempt(async a=>{try{s(await i(a))}catch(l){if(!(l instanceof Error)){o(new TypeError(`Non-error was thrown: "${l}". You should only throw errors.`));return}if(l instanceof Ge)r.stop(),o(l.originalError);else if(l instanceof TypeError&&!sn(l.message))r.stop(),o(l);else{on(l,a,t);try{await t.onFailedAttempt(l)}catch(d){o(d);return}r.retry(l)||o(r.mainError())}}})});X.exports=Qe;X.exports.default=Qe;X.exports.AbortError=Ge;var rn=X.exports;const an=lt(rn);function fe({domain:i,resolvedTarget:t,...s}){const{t:o,locale:r}=A();return e.jsxs(u,{sx:{backgroundColor:"rgb(236, 251, 253)",borderColor:"rgb(236, 251, 253)",borderRadius:"8px",padding:"12px"},...s,children:[e.jsxs(u,{display:"flex",children:[o("router.domain.setup.tipStart"),i&&e.jsx(u,{mx:.5,color:"primary.main",fontWeight:"fontWeightBold",children:i}),o("router.domain.setup.tipEnd"),":"]}),e.jsxs(u,{sx:{"&>div":{mb:0},marginTop:"8px"},children:[e.jsx(ie,{label:o("router.domain.setup.recordType"),value:"CNAME",locale:r}),e.jsx(ie,{label:o("router.domain.setup.recordValue"),value:t,locale:r})]})]})}fe.propTypes={domain:n.string,resolvedTarget:n.string.isRequired};fe.defaultProps={domain:""};function ie({locale:i,label:t,value:s}){const o=Me(a=>a.breakpoints.down("md")),r=K();return e.jsx(Pt,{name:t,nameWidth:120,children:e.jsxs(u,{sx:{display:"flex",alignItems:"center",lineHeight:1},children:[e.jsx(R,{component:"span",color:"primary.main",overflow:"auto",sx:o?{maxWidth:"95%",wordWrap:"break-word"}:{wordWrap:"break-word"},children:s}),e.jsx(ze,{content:s,locale:i,style:{marginLeft:"4px",color:r.palette.text.secondary}})]})})}ie.propTypes={locale:n.string.isRequired,label:n.string.isRequired,value:n.string.isRequired};function xe({siteId:i,teamDid:t,cnameDomain:s,defaultCustomDomain:o,onInputDomain:r,appId:a,appPk:l,onSuccess:d,onError:m,disabled:h,autoFocus:y,inBlockletSetup:b,shouldCheckDomain:_,onStateChange:j,currentIp:T,resolveDomain:I,...E}){const{t:p,locale:w}=A(),{api:k,info:D}=O(),c=Gt(),P=K(),B=wt({key:"sm"}),[g,v]=le({submittingDomain:!1,domain:o,error:null,type:D!=null&&D.nftDomainUrl?"nftDomain":"inputDomain",showNFTDomainAuth:!1,showDnsTip:!1}),x=kt(()=>en.getDidDomainServiceURL(D==null?void 0:D.nftDomainUrl));if(D!=null&&D.nftDomainUrl&&x.loading)return e.jsx(u,{...E,children:e.jsx(we,{relative:"parent",children:e.jsx(W,{})})});if(x.error)return e.jsx(u,{...E,children:e.jsx(we,{relative:"parent",children:x.error.message})});const L=x.value,et=()=>{v({invalidDNSDomain:null})},J=async f=>{j(p("setup.domain.addingDomain")),await k.addDomainAlias({input:{id:i,domainAlias:f,teamDid:t,inBlockletSetup:!0}}),v({submittingDomain:!1}),d({domain:f,type:"inputDomain"})},be=async({domain:f,type:S,nftDid:F,chainHost:q})=>{try{if(!_){if(S==="inputDomain"){await J(f);return}d({domain:f,type:S,nftDid:F,chainHost:q});return}j({text:p("setup.domain.checkingResolvable")});let $=30;const ee=3e3,it=$*1e3/ee,Se=setInterval(()=>{if($<=0){clearInterval(Se);return}j({text:`${p("setup.domain.checkingResolvable")} (${$--}s)`})},1e3),Re=await an(async()=>{const{data:M}=await I(f);if(!M.address)throw new Error("Cannot resolve domain");return M.address},{retries:it,minTimeout:ee,maxTimeout:ee,onFailedAttempt:console.error}).catch(console.error);if(clearInterval(Se),!Re){const M=p("setup.domain.cannotResolve",{domain:f});if(S==="nftDomain"){N.error(M),d({domain:f,type:"nftDomain"});return}j({text:""}),v({invalidDNSDomain:{domain:f,error:M},domain:f,type:S,submittingDomain:!1});return}if(Re!==T){const M=p("setup.domain.resolvedAddressError",{domain:f,curDomain:window.location.hostname});if(S==="nftDomain"){N.error(M),d({domain:f,type:"nftDomain"});return}j({text:""}),v({invalidDNSDomain:{domain:f,error:M},domain:f,type:S,submittingDomain:!1});return}if(S==="nftDomain"){d({domain:f,type:"nftDomain"});return}await J(f)}catch($){N.error($.message),j({text:""}),v({submittingDomain:!1})}},tt=async({domain:f,nftDid:S,chainHost:F})=>{try{const q=Pe(f);v({submittingDomain:!0}),await k.addDomainAlias({input:{id:i,type:"nft-domain",domainAlias:q,nftDid:S,chainHost:F,teamDid:t,inBlockletSetup:b}});const $="nftDomain";v({showNFTDomainAuth:!1,type:$}),await be({domain:q,type:$,nftDid:S,chainHost:F})}catch(q){N.error(q.message)}finally{v({showNFTDomainAuth:!1,submittingDomain:!1})}},nt=async()=>{try{v({submittingDomain:!0});const f=Pe(g.domain);if(D.nftDomainUrl&&L&&(await k.isDidDomain({input:{domain:f}})).value===!0){v({showNFTDomainAuth:!0});return}await be({domain:f,type:g.type})}catch(f){v({submittingDomain:!1}),c.setError(f.message)}},Ce=c.error||g.error;return e.jsx(u,{...E,children:e.jsxs(u,{sx:{display:"flex",flexDirection:"column",justifyContent:"flex-start",gap:"1em"},children:[e.jsxs(u,{sx:{display:"flex",flexDirection:"column",gap:"8px"},children:[D.nftDomainUrl&&L&&e.jsxs(u,{sx:{color:P.palette.text.primary},children:[e.jsx(R,{children:p("router.domainAlias.addDomainNFT.tips")}),e.jsxs(R,{component:"div",children:[p("router.domainAlias.addDomainNFT.buyTip"),e.jsxs(_t,{href:L.base,sx:{display:"inline-flex",alignItems:"center"},target:"_blank",children:[e.jsx("i",{children:p("router.domainAlias.addDomainNFT.buy")}),e.jsx(It,{fontSize:"small"})]})]})]}),e.jsx(Lt,{sx:{display:"block",marginTop:"8px"},label:p("router.domainAlias.add.domainDescription"),helperText:g.type==="inputDomain"&&Ce||p("router.domainAlias.add.helperText"),inputProps:{"data-cy":"domain-name-input"},fullWidth:!0,disabled:h,value:g.domain,size:"small",variant:"outlined",error:!!Ce&&g.type==="inputDomain",onChange:f=>{var q;const S=ae((q=f.target)==null?void 0:q.value);c.setDomain(S);const F=$e(S,w);v({domain:S,error:F,type:"inputDomain"}),r({domain:S,error:F,type:"inputDomain"})},autoFocus:y,onBlur:()=>{c.domain||(v({error:null}),c.setError(null))}}),e.jsx(u,{sx:{width:"100%",display:"flex",justifyContent:"flex-end"},children:e.jsx(qt,{"data-cy":"confirm-add-domain",fullWidth:B,variant:"contained",loading:g.submittingDomain,onClick:nt,children:p("common.add")})}),e.jsxs(u,{sx:{cursor:"pointer",fontSize:"14px",display:"flex",alignItems:"center",gap:"4px",lineHeight:1,color:P.palette.primary.main},onClick:()=>v({showDnsTip:!g.showDnsTip}),children:[e.jsx(At,{fontSize:"1em"}),p("router.domainAlias.showTipHint")]}),g.showDnsTip&&e.jsx(fe,{domain:g.domain,resolvedTarget:s,style:{marginTop:"4px"}})]}),g.invalidDNSDomain&&e.jsx(Z,{title:p("common.reminder"),description:p("setup.domain.invalidDNSReminder",{error:g.invalidDNSDomain.error}),color:"primary",confirm:p("setup.domain.continueAdd"),onConfirm:()=>J(g.invalidDNSDomain.domain,g.type),onCancel:et}),L&&e.jsx(ct,{open:g.showNFTDomainAuth,popup:!0,useSocket:!1,action:"authorize",baseUrl:L.api,checkFn:dt.create({baseURL:L.api}).get,extraParams:{delegatee:a,delegateePk:l,domain:g.domain},onSuccess:tt,onClose:()=>v({showNFTDomainAuth:!1,submittingDomain:!1}),checkTimeout:60*5e3,showDownload:!1,messages:{title:p("router.domainAlias.addDomainNFT.connect.title"),scan:p("router.domainAlias.addDomainNFT.connect.scan"),confirm:p("router.domainAlias.addDomainNFT.connect.confirm"),success:p("router.domainAlias.addDomainNFT.connect.success")}})]})})}xe.propTypes={siteId:n.string.isRequired,currentIp:n.string,teamDid:n.string.isRequired,cnameDomain:n.string.isRequired,defaultCustomDomain:n.string,onInputDomain:n.func,onSuccess:n.func,appId:n.string,appPk:n.string,disabled:n.bool,autoFocus:n.bool,inBlockletSetup:n.bool,shouldCheckDomain:n.bool,onStateChange:n.func,resolveDomain:n.func,onError:n.func};xe.defaultProps={defaultCustomDomain:"",currentIp:"",onInputDomain:Ae,onSuccess:Ae,appId:"",appPk:"",disabled:!1,autoFocus:!0,inBlockletSetup:!1,shouldCheckDomain:!1,onStateChange:()=>{},resolveDomain:()=>{},onError:()=>{}};function he({id:i,children:t,title:s,teamDid:o,systemDomains:r,appId:a,appPk:l}){const{t:d}=A(),[m,h]=le({loading:!1,confirmSetting:null}),y=r.find(T=>Fe.isDidDomain(T)),b=()=>{h({loading:!1,confirmSetting:null})},_={title:s||d("router.domainAlias.add.title"),description:function(I,E,p){return e.jsx(xe,{siteId:i,teamDid:o,cnameDomain:y,onSuccess:()=>h({confirmSetting:null}),onInputDomain:({domain:w,type:k,error:D})=>{E({...I,domain:w,type:k,__disableConfirm:!!D}),p(D)},appId:a,appPk:l})},confirm:d("common.confirm"),cancel:d("common.cancel"),params:{domain:"",__disableConfirm:!0},onCancel:b},j=T=>{T.stopPropagation(),h({confirmSetting:_})};return e.jsxs(e.Fragment,{children:[typeof t=="function"?t({loading:m.loading,open:j}):e.jsxs(Ne,{onClick:j,className:"rule-action","data-cy":"action-add-domain-alias",children:[m.loading?e.jsx(W,{size:16}):e.jsx(Ke,{style:{fontSize:18,marginRight:5}}),d("router.domainAlias.add.title")]}),m.confirmSetting&&e.jsx(Z,{title:m.confirmSetting.title,description:m.confirmSetting.description,confirm:m.confirmSetting.confirm,cancel:m.confirmSetting.cancel,params:m.confirmSetting.params,onCancel:m.confirmSetting.onCancel,showConfirm:!1,showCancel:!0,displayError:!1,color:"primary",loading:m.loading,maxWidth:"sm"})]})}he.propTypes={id:n.string.isRequired,children:n.any,title:n.string,teamDid:n.string,systemDomains:n.arrayOf(n.string).isRequired,appId:n.string,appPk:n.string.isRequired};he.defaultProps={children:null,title:"",teamDid:"",appId:null};function ln(i){return e.jsx(Xt,{children:e.jsx(he,{...i})})}function ge(i){const{t}=A(),[s,o]=C.useState(!1),[r,a]=C.useState(null),{id:l,domain:d,children:m,teamDid:h}=i,{api:y}=O(),b=()=>{o(!1),a(null)},_=async()=>{o(!0);try{await y.deleteDomainAlias({input:{id:l,domainAlias:d,teamDid:h}}),await mt(2e3)}catch(I){N.error(I.message)}finally{a(null),o(!1)}},j={title:t("router.domainAlias.delete.title"),description:t("router.domainAlias.delete.description"),confirm:t("common.confirm"),onConfirm:_,onCancel:b},T=I=>{I.stopPropagation(),a(j)};return e.jsxs(e.Fragment,{children:[typeof m=="function"?m({loading:s,open:T}):e.jsxs(H,{edge:"end",onClick:T,size:"small",className:"rule-action",color:"error","data-cy":"action-delete-domain-alias",children:[s?e.jsx(W,{size:16}):e.jsx(Ve,{style:{fontSize:16}}),t("router.domainAlias.delete.title")]}),r&&e.jsx(Z,{title:r.title,description:r.description,confirm:r.confirm,params:r.params,onConfirm:r.onConfirm,onCancel:r.onCancel})]})}ge.propTypes={id:n.string.isRequired,domain:n.string.isRequired,children:n.any,teamDid:n.string};ge.defaultProps={children:null,teamDid:""};function ye({site:i,domain:t,blocklet:s}){const{t:o}=A(),r=t.value===window.location.hostname;return e.jsx($t,{"data-cy":"domain-actions",size:"large",actions:[({close:a})=>{var l;return e.jsx(ge,{id:i.id,domain:t.value,teamDid:(l=s==null?void 0:s.meta)==null?void 0:l.did,children:({open:d})=>e.jsx(z,{title:r?o("blocklet.router.currentDomainTip"):"",children:e.jsx("span",{children:e.jsxs(Ne,{disabled:t.isProtected||r,dense:!0,onClick:m=>{a(),d(m)},"data-cy":"action-toggle-block",children:[e.jsx(Mt,{style:{minWidth:24,marginRight:8},children:e.jsx(Ve,{})}),e.jsx(zt,{primary:o("common.delete")})]},"remove")})})})}]})}ye.propTypes={site:n.object.isRequired,domain:n.object.isRequired,blocklet:n.object.isRequired};ye.defaultProps={};var je={},cn=Y;Object.defineProperty(je,"__esModule",{value:!0});var De=je.default=void 0,dn=cn(V()),mn=e;De=je.default=(0,dn.default)((0,mn.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1z"}),"Https");const G=n.shape({href:n.string,accessibility:n.shape({loading:n.bool,accessible:n.bool}),domainStatus:n.shape({isHttps:n.bool,matchedCert:n.object}),dns:n.shape({resolved:n.bool,ip:n.string})});function ve({certificate:i}){const[t,s]=C.useState(null),o=O(),{t:r,locale:a}=A(),l=h=>{s(h.currentTarget)},d=()=>{s(null)},m=!!t;return e.jsxs(e.Fragment,{children:[e.jsx(De,{"aria-owns":m?"mouse-over-popover":void 0,onMouseEnter:l,onMouseLeave:d,style:{color:"#44cdc6",fontSize:20,cursor:"pointer"}}),e.jsx(Be,{id:"mouse-over-popover",style:{pointerEvents:"none"},open:m,anchorEl:t,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:d,disableRestoreFocus:!0,children:e.jsx(Oe,{children:e.jsxs(We,{style:{display:"flex"},children:[e.jsx("div",{children:e.jsx("img",{src:`${o.imgPrefix}/https-certificate-icon.png`,alt:"certificate icon",style:{maxHeight:"100%",maxWidth:"100%"}})}),e.jsxs(R,{component:"div",style:{marginLeft:"16px"},children:[e.jsx(R,{component:"div",style:{fontWeight:"bold"},children:i.domain}),e.jsx(R,{component:"div",children:`${r("common.issuer")}: ${ut(i,"issuer.commonName","")}`}),e.jsx(R,{component:"div",children:`${r("router.cert.issuedOn")}: ${Ie(i.validFrom,a)}`}),e.jsx(R,{component:"div",children:`${r("router.cert.expiryOn")}: ${Ie(i.validTo,a)}`})]})]})})})]})}ve.propTypes={certificate:n.object};ve.defaultProps={certificate:{}};function U({domain:i,filters:t}){const{t:s}=A(),{value:o,domainStatus:r}=i;if(!Le(o))return null;let a=null,l=null;const{isHttps:d,matchedCert:m}=r;if(!pt(o)){const{dns:{resolved:y,ip:b}={}}=r;y||b==="127.0.0.1"?a=e.jsx(z,{title:s("router.domain.verify.ok"),children:e.jsx(ke,{color:"success"})}):a=e.jsx(z,{title:s("router.domain.verify.notResolved"),children:e.jsx(ke,{color:"error"})})}d?l=e.jsx(ve,{certificate:m}):l=e.jsx(z,{title:s("router.domain.https.bad"),children:e.jsx(De,{style:{color:"#D0021B",fontSize:20,cursor:"pointer"}})});const h=t.map(y=>y==="domain"?a:y==="http"?l:null);return C.createElement(C.Fragment,null,...h)}U.propTypes={domain:G.isRequired,filters:n.array};U.defaultProps={filters:["domain","http"]};const un=Ue(Q,"mutate_blocklets"),pn=Ue(Q,"",xt);function Je(i){const{inService:t}=O(),{blocklet:s,loadingRuntimeInfo:o}=qe();let r=un;return t&&(r=pn),e.jsx(r,{...i,blocklet:s,inService:t,loadingRuntimeInfo:o})}Je.propTypes={listOnly:n.bool};Je.defaultProps={listOnly:!1};function Q({hasPermission:i,blocklet:t,loadingRuntimeInfo:s,inService:o,listOnly:r}){var p,w,k,D;const{t:a}=A(),[l,d]=C.useState(!1),m=Me(c=>c.breakpoints.down("md")),h=C.useMemo(()=>{let c=i;return ht(t)&&(c=c&&o),c},[i,o,t]),{site:y}=t,b=C.useMemo(()=>{var c;return gt((c=t.site)==null?void 0:c.domainAliases)},[(p=t.site)==null?void 0:p.domainAliases]),_=[],j=[],T=bt.encode(t.appPid),I=(k=(w=t.environments)==null?void 0:w.find(c=>c.key==="BLOCKLET_APP_PK"))==null?void 0:k.value,E=yt(b);return b.forEach(c=>{const P=c.value||"";Fe.isDidDomain(P)&&!P.startsWith(T)?j.push(c):_.push(c)}),e.jsxs(e.Fragment,{children:[!r&&e.jsxs(e.Fragment,{children:[e.jsxs(u,{className:"title first",display:"flex",justifyContent:"space-between",alignItems:"center",children:[e.jsx(u,{children:a("common.domain")}),h&&e.jsx(ln,{id:y.id,title:a("router.domain.add.title"),teamDid:(D=t.meta)==null?void 0:D.did,appId:t.appPid,appPk:I,systemDomains:E==null?void 0:E.map(c=>c.value),children:({open:c})=>e.jsxs(H,{style:{marginLeft:16},variant:"contained",color:"primary","data-cy":"add-domain-alias",onClick:c,disabled:Ee.isInProgress(t.status),children:[e.jsx(Dt,{style:{fontSize:"1.3em",marginRight:4}}),a("common.add")]})})]}),Ee.isAccessible(t.status)===!1&&e.jsx(u,{mt:1.5,mb:1.5,children:e.jsx(He,{severity:"warning",children:a("blocklet.router.noRunning")})})]}),e.jsx(u,{sx:{display:"flex",flexDirection:"column",gap:1},children:(l?b:_).map(c=>{var B,g;const P=c.value;return e.jsxs(C.Fragment,{children:[m&&e.jsxs(u,{display:"flex",flexDirection:"column",children:[e.jsx(u,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:e.jsx(oe,{domain:c,target:"_blank",children:c.value})}),e.jsxs(u,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[e.jsxs(u,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:1},children:[e.jsx(U,{domain:c,filters:["domain"]},`${c.value}-domain`),e.jsx(re,{siteId:(B=t.site)==null?void 0:B.id,domain:c,blocklet:t,hasMutatePermission:h})]}),e.jsx(u,{sx:{button:{padding:0}},children:e.jsx(se,{hasMutatePermission:h,site:y,domain:c,blocklet:t})})]})]},P),!m&&e.jsxs(u,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[e.jsxs(u,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[e.jsx(U,{domain:c,filters:["domain"]},`${c.value}-domain`),e.jsx(u,{sx:{ml:2,mr:.5},children:e.jsx(oe,{domain:c,target:"_blank",children:c.value})}),e.jsx(re,{siteId:(g=t.site)==null?void 0:g.id,domain:c,blocklet:t,hasMutatePermission:h})]}),e.jsx(u,{sx:{button:{padding:0}},children:e.jsx(se,{hasMutatePermission:h,site:y,domain:c,blocklet:t})})]},P)]},P)})}),j.length>0&&e.jsx("div",{style:{marginLeft:"20px",marginTop:"12px"},children:e.jsx(H,{endIcon:l?e.jsx(Ye,{}):e.jsx(vt,{}),onClick:()=>d(!l),children:a(l?"common.collapseAll":"blocklet.router.showAllDomains")})}),!b.length&&(s?e.jsx(W,{size:16}):e.jsx(St,{children:a("common.empty")}))]})}Q.propTypes={hasPermission:n.bool,blocklet:n.object.isRequired,loadingRuntimeInfo:n.bool,inService:n.bool.isRequired,listOnly:n.bool};Q.defaultProps={hasPermission:!1,loadingRuntimeInfo:!1,listOnly:!1};function oe({domain:i,children:t,...s}){const{t:o,locale:r}=A(),{href:a,accessibility:l,value:d}=i,m=C.useCallback(()=>e.jsx(ze,{content:ae(d),locale:r,style:{marginLeft:"4px",color:"#999",fontSize:"0.8em",verticalAlign:"bottom"}}),[d,r]);return!l||l.loading?e.jsxs(te,{...s,children:[t,m(),e.jsx(z,{title:o("blocklet.router.checkUrlAccessible"),placement:"top-end",children:e.jsx("span",{className:"status",children:e.jsx(W,{size:12})})})]}):l.accessible?e.jsxs(te,{...s,children:[e.jsx(u,{component:"a",href:a,target:"_blank",rel:"noopener noreferrer",children:t}),m()]}):e.jsxs(te,{...s,children:[e.jsx(z,{title:o("blocklet.router.urlInaccessible"),placement:"top-end",children:e.jsx("span",{children:t})}),m()]})}oe.propTypes={domain:G.isRequired,children:n.any.isRequired};const te=ft.span`
2
+ &,
3
+ & > * {
4
+ color: #222;
5
+ font-size: 18px;
6
+ }
7
+
8
+ & > * {
9
+ word-break: break-all;
10
+ }
11
+
12
+ .status {
13
+ margin-left: 8px;
14
+ }
15
+ `;function se({hasMutatePermission:i,site:t,domain:s,blocklet:o}){const r=K(),{t:a}=A();return i&&!s.isProtected?e.jsx(ye,{site:t,domain:s,blocklet:o}):e.jsx(z,{title:a("blocklet.router.domainLockTooltip"),placement:"top",children:e.jsx(jt,{disabled:!0,size:"large",style:{pointerEvents:"auto",paddingTop:0,paddingBottom:0},children:e.jsx(Ct,{style:{fill:r.palette.text.disabled}})})})}se.propTypes={hasMutatePermission:n.bool.isRequired,site:n.object.isRequired,domain:G.isRequired,blocklet:n.object.isRequired};function re({siteId:i,domain:t,blocklet:s,hasMutatePermission:o}){const r=K(),{t:a}=A(),[l,d]=C.useState(null),m=y=>{d(y.currentTarget)},h=()=>{d(null)};return e.jsxs(u,{sx:{display:"flex",justifyContent:"flex-start",alignItems:"center",gap:1},children:[t.type==="nft-domain"&&e.jsxs(e.Fragment,{children:[e.jsx(ne,{onMouseEnter:m,onMouseLeave:h,style:{marginTop:"0.2em",cursor:"pointer",fill:r.palette.primary.main}}),e.jsx(Be,{id:"mouse-over-popover",style:{pointerEvents:"none"},open:!!l,anchorEl:l,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:h,disableRestoreFocus:!0,children:e.jsx(Oe,{children:e.jsxs(We,{style:{display:"flex",flexDirection:"column"},children:[e.jsxs(R,{component:"div",style:{display:"flex",alignItems:"center"},children:[e.jsx(ne,{style:{fill:r.palette.primary.main}}),e.jsx(R,{component:"span",style:{marginLeft:"8px",fontSize:"18px",fontWeight:"bolder"},children:a("router.domainAlias.nftDomain")})]}),e.jsxs(R,{component:"div",style:{display:"flex",marginTop:"12px"},children:[e.jsx(R,{component:"span",style:{width:"80px",marginRight:"8px"},children:a("common.domain")}),e.jsx(R,{component:"span",children:t.value})]}),e.jsxs(R,{component:"div",style:{display:"flex"},children:[e.jsx(R,{component:"span",style:{width:"80px",marginRight:"8px"},children:"NFT"}),e.jsx(Rt,{did:t.nftDid})]})]})})})]}),e.jsx(U,{domain:t,filters:["http"]},`${t.value}-http`),o&&e.jsx(ue,{siteId:i,domain:t.value,domainStatus:t.domainStatus,did:s.meta.did,children:({open:y})=>e.jsx(H,{sx:{padding:0},size:"small",onClick:b=>y(b),children:a("router.cert.genLetsEncryptCert.title")})})]})}re.propTypes={siteId:n.string.isRequired,domain:G.isRequired,blocklet:n.object.isRequired,hasMutatePermission:n.bool.isRequired};export{xe as A,Xt as D,Je as a};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BjRErSmf.js","assets/index-fgn9vwq8.js","assets/index-D8NuaJ66.css"])))=>i.map(i=>d[i]);
2
- import{G as f,X,Y as Z,j as e,r as a,d as J,u as ee,f as te,F as se,a3 as _,a5 as A,t as v,H as ne,T as j,b as R,D as ie,aD as ae,B as F,n as re,Z as oe}from"./index-fgn9vwq8.js";import{t as m}from"./trim-BAyy5nHT.js";import{F as ce}from"./fullpage-BBGvbVDW.js";import{f as b}from"./format-error-CFOsq4HX.js";import{d as le}from"./CheckCircle-D3la5wZJ.js";import{S as w}from"./Stack-DOuPfp9P.js";import{L as ue}from"./Link-C4c-c9oW.js";import{T as z}from"./TextField-DFiFTqqd.js";import"./FormControl-CBM31tVk.js";import"./useFormControl-CGJ6_pv6.js";import"./InputLabel-D4nkCqtD.js";import"./Select-3MFmfiU2.js";var H;(H=window.env)!=null&&H.groupPathPrefix;f.ROLES.ADMIN,f.ROLES.OWNER;const S=()=>{const{searchParams:u}=new URL(window.location.href);return u.get("fromWallet")==="1"};var P={},de=Z;Object.defineProperty(P,"__esModule",{value:!0});var M=P.default=void 0,pe=de(X()),fe=e;M=P.default=(0,pe.default)((0,fe.jsx)("path",{d:"M12 19c0-3.87 3.13-7 7-7 1.08 0 2.09.25 3 .68V6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h8.08c-.05-.33-.08-.66-.08-1M4 6l8 5 8-5v2l-8 5-8-5zm13.34 16-3.54-3.54 1.41-1.41 2.12 2.12 4.24-4.24L23 16.34z"}),"MarkEmailRead");const me=oe.form`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-honENBw_.js","assets/index-dffxGns1.js","assets/index-D8NuaJ66.css"])))=>i.map(i=>d[i]);
2
+ import{G as f,X,Y as Z,j as e,r as a,d as J,u as ee,f as te,F as se,a3 as _,a5 as A,t as v,H as ne,T as j,b as R,D as ie,aD as ae,B as F,n as re,Z as oe}from"./index-dffxGns1.js";import{t as m}from"./trim-iOszuV5t.js";import{F as ce}from"./fullpage-6nDK23_-.js";import{f as b}from"./format-error-CWBrNztU.js";import{d as le}from"./CheckCircle-HJjJffHP.js";import{S as w}from"./Stack-Bj4-8Xdh.js";import{L as ue}from"./Link-CZ52DbXN.js";import{T as z}from"./TextField-5Z401EeH.js";import"./FormControl-B60-pCHh.js";import"./useFormControl-tCmd2QIL.js";import"./InputLabel-Ou7BDwPq.js";import"./Select-Djzas9fr.js";var H;(H=window.env)!=null&&H.groupPathPrefix;f.ROLES.ADMIN,f.ROLES.OWNER;const S=()=>{const{searchParams:u}=new URL(window.location.href);return u.get("fromWallet")==="1"};var P={},de=Z;Object.defineProperty(P,"__esModule",{value:!0});var M=P.default=void 0,pe=de(X()),fe=e;M=P.default=(0,pe.default)((0,fe.jsx)("path",{d:"M12 19c0-3.87 3.13-7 7-7 1.08 0 2.09.25 3 .68V6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h8.08c-.05-.33-.08-.66-.08-1M4 6l8 5 8-5v2l-8 5-8-5zm13.34 16-3.54-3.54 1.41-1.41 2.12 2.12 4.24-4.24L23 16.34z"}),"MarkEmailRead");const me=oe.form`
3
3
  display: flex;
4
4
  flex-direction: column;
5
5
  align-items: center;
@@ -15,4 +15,4 @@ import{G as f,X,Y as Z,j as e,r as a,d as J,u as ee,f as te,F as se,a3 as _,a5 a
15
15
  div.Mui-focused input {
16
16
  caret-color: ${u=>u.theme.palette.primary.main};
17
17
  }
18
- `;function Ie(){var O,V;const u=a.useRef(null),{session:l,connectApi:I}=J(),{t:n,locale:g}=ee(),[h,N]=a.useState(((O=l.user)==null?void 0:O.email)||""),[r,T]=a.useState(""),[y,C]=a.useState(!1),[W,$]=a.useState(!1),[o,G]=a.useState(!1),[Y,K]=a.useState(!1),[x,q]=a.useState(!1),{wallet:d}=te(),[c]=se(),L=c.get("inviter")||localStorage.getItem("inviter"),p=c.get("updateKyc")==="1";a.useEffect(()=>{var i;(i=l.user)!=null&&i.emailVerified&&p&&(K(!0),setTimeout(()=>{if(d&&S()){_(()=>import("./index-BjRErSmf.js").then(t=>t.i),__vite__mapDeps([0,1,2])).then(t=>{t.call("arcClosePage")});return}window.location.href=c.get("redirect")||"/"},1e3))},[l.user,p,d,c]);const U=a.useCallback(async i=>{var t;i.preventDefault(),C(!0);try{await A.post("/kyc/email/send",{email:h}),G(!0),v.success(n("login.issueKyc.codeSentSuccess"))}catch(s){v.error(b(s)),(t=document.getElementById("email-input"))==null||t.focus()}finally{C(!1)}},[h,n]),k=a.useCallback(async i=>{var t;i&&i.preventDefault(),C(!0);try{await A.post("/kyc/email/verify",{code:r}),K(!0),I.open({locale:g,action:"issue-kyc",extraParams:{code:r,updateKyc:c.get("updateKyc")||"0",inviter:L||""},containerEl:u.current,className:"connect",popup:!1,saveConnect:!1,forceConnected:!0,messages:{title:n("login.issueKyc.claim"),scan:n("login.issueKyc.scan"),confirm:n("login.issueKyc.confirm"),success:n("login.issueKyc.success")},useSocket:!0,onSuccess:()=>{q(!0),I.close(),p?(l.refresh({showProgress:!1,forceRefreshToken:!0}),setTimeout(()=>{if(d&&S()){_(()=>import("./index-BjRErSmf.js").then(s=>s.i),__vite__mapDeps([0,1,2])).then(s=>{s.call("arcClosePage")});return}window.location.href=c.get("redirect")||"/"},1e3)):d&&S()&&_(()=>import("./index-BjRErSmf.js").then(s=>s.i),__vite__mapDeps([0,1,2])).then(s=>{s.call("arcClosePage")})},onError:s=>{v.error(b(s))}})}catch(s){K(!1),v.error(b(s)),(t=document.getElementById(`code-input-${m(r).length-1}`))==null||t.focus()}finally{C(!1)}},[r,g,c,p,d,L]);a.useEffect(()=>{o&&m(r).length===f.VERIFY_CODE_LENGTH&&k()},[r,k,o]);const Q=a.useCallback(()=>{$(!0),I.open({locale:g,action:"update-kyc",containerEl:u.current,className:"connect",popup:!1,saveConnect:!1,forceConnected:!0,messages:{title:n("login.updateKyc.title"),scan:n("login.updateKyc.scan"),confirm:n("login.updateKyc.confirm"),success:n("login.updateKyc.success")},useSocket:!0,onSuccess:()=>{l.refresh({showProgress:!1,forceRefreshToken:!0}),setTimeout(()=>{if(d&&S()){_(()=>import("./index-BjRErSmf.js").then(i=>i.i),__vite__mapDeps([0,1,2])).then(i=>{i.call("arcClosePage")});return}window.location.href=c.get("redirect")||"/"},2e3)},onError:i=>{v.error(b(i))}})},[g,c,d]),D=a.useCallback(i=>{if(!o)return;i.preventDefault();const t=m(i.clipboardData.getData("text/plain").slice(0,f.VERIFY_CODE_LENGTH));if(!/^\d+$/.test(t))return;T(t.padEnd(f.VERIFY_CODE_LENGTH," "));const s=document.getElementById(`code-input-${t.length}`);s&&s.focus()},[o]);return a.useEffect(()=>(document.addEventListener("paste",D),()=>{document.removeEventListener("paste",D)}),[D]),e.jsxs(ce,{did:(V=window.blocklet)==null?void 0:V.appPid,children:[e.jsx(ne,{children:e.jsx("title",{children:n("login.issueKyc.pageTitle")})}),e.jsxs(w,{direction:"column",justifyContent:"center",alignItems:"center",sx:{width:"560px",padding:"8px",boxSizing:"border-box",maxWidth:"100%",height:"100%"},children:[e.jsxs(w,{spacing:1,justifyContent:"center",alignItems:"center",sx:{mb:3},children:[x?e.jsx(le,{sx:{fontSize:72},color:"success"}):e.jsx(M,{sx:{fontSize:72},color:"primary"}),e.jsx(j,{variant:"h5",children:n("login.issueKyc.pageTitle")}),!x&&e.jsx(j,{variant:"body2",color:"text.secondary",sx:{textAlign:"center"},children:n("login.issueKyc.pageDescription")}),x&&e.jsx(j,{variant:"body1",sx:{textAlign:"center"},children:n("login.issueKyc.success")}),x&&e.jsx(R,{variant:"contained",color:"primary",component:ue,href:"/",size:"large",children:n("login.issueKyc.backToHome")}),!x&&l.user&&e.jsxs(w,{direction:"row",justifyContent:"center",alignItems:"center",spacing:1,children:[e.jsx(ie,{did:l.user.did,responsive:!0,copyable:!1,showQrcode:!1}),e.jsx(ae,{locale:g,session:l,showRole:!0,showManageBlocklet:!1})]})]}),e.jsx(F,{ref:u,sx:{width:"100%"},children:!Y&&!W&&e.jsxs(me,{onSubmit:o?k:U,children:[!o&&e.jsx(z,{type:"email",id:"email-input",placeholder:n("login.issueKyc.emailPlaceholder"),sx:{width:"100%",maxWidth:360},value:h,onChange:i=>N(i.target.value),disabled:y,required:!0}),o&&e.jsxs(w,{direction:"column",justifyContent:"center",alignItems:"center",spacing:2,children:[e.jsx(j,{variant:"body2",textAlign:"center",children:n("login.issueKyc.codeSentMessage",{email:h})}),e.jsx(F,{sx:{width:"100%",maxWidth:360,display:"flex",justifyContent:"space-between"},children:[...Array(f.VERIFY_CODE_LENGTH)].map((i,t)=>e.jsx(z,{value:m(r[t])||"",type:"number",inputProps:{maxLength:1,style:{textAlign:"center",fontSize:"1.5rem"},autoComplete:"off"},sx:{width:"14%"},onChange:s=>{var B;const E=r.split("");E[t]=s.target.value,T(E.join("")),s.target.value&&t<5&&((B=document.getElementById(`code-input-${t+1}`))==null||B.focus())},onKeyDown:s=>{var E;s.key==="Backspace"&&!m(r[t])&&t>0&&((E=document.getElementById(`code-input-${t-1}`))==null||E.focus())},disabled:y,required:!0,id:`code-input-${t}`,autoComplete:"off"},`code-input-${t}`))})]}),e.jsxs(w,{direction:"row",justifyContent:p?"space-between":"center",alignItems:"center",spacing:2,sx:{width:"100%",maxWidth:360},children:[p&&e.jsx(R,{variant:"text",disabled:y,onClick:Q,size:"large",children:n("login.updateKyc.button")}),e.jsx(R,{type:"submit",size:"large",variant:"contained",disabled:y||!h||o&&m(r).length!==f.VERIFY_CODE_LENGTH,sx:{width:p?"auto":"100%"},children:y?e.jsx(re,{size:24}):n(o?"login.issueKyc.verifyButton":"login.issueKyc.sendCodeButton")})]})]})})]})]})}export{Ie as default};
18
+ `;function Ie(){var O,V;const u=a.useRef(null),{session:l,connectApi:I}=J(),{t:n,locale:g}=ee(),[h,N]=a.useState(((O=l.user)==null?void 0:O.email)||""),[r,T]=a.useState(""),[y,C]=a.useState(!1),[W,$]=a.useState(!1),[o,G]=a.useState(!1),[Y,K]=a.useState(!1),[x,q]=a.useState(!1),{wallet:d}=te(),[c]=se(),L=c.get("inviter")||localStorage.getItem("inviter"),p=c.get("updateKyc")==="1";a.useEffect(()=>{var i;(i=l.user)!=null&&i.emailVerified&&p&&(K(!0),setTimeout(()=>{if(d&&S()){_(()=>import("./index-honENBw_.js").then(t=>t.i),__vite__mapDeps([0,1,2])).then(t=>{t.call("arcClosePage")});return}window.location.href=c.get("redirect")||"/"},1e3))},[l.user,p,d,c]);const U=a.useCallback(async i=>{var t;i.preventDefault(),C(!0);try{await A.post("/kyc/email/send",{email:h}),G(!0),v.success(n("login.issueKyc.codeSentSuccess"))}catch(s){v.error(b(s)),(t=document.getElementById("email-input"))==null||t.focus()}finally{C(!1)}},[h,n]),k=a.useCallback(async i=>{var t;i&&i.preventDefault(),C(!0);try{await A.post("/kyc/email/verify",{code:r}),K(!0),I.open({locale:g,action:"issue-kyc",extraParams:{code:r,updateKyc:c.get("updateKyc")||"0",inviter:L||""},containerEl:u.current,className:"connect",popup:!1,saveConnect:!1,forceConnected:!0,messages:{title:n("login.issueKyc.claim"),scan:n("login.issueKyc.scan"),confirm:n("login.issueKyc.confirm"),success:n("login.issueKyc.success")},useSocket:!0,onSuccess:()=>{q(!0),I.close(),p?(l.refresh({showProgress:!1,forceRefreshToken:!0}),setTimeout(()=>{if(d&&S()){_(()=>import("./index-honENBw_.js").then(s=>s.i),__vite__mapDeps([0,1,2])).then(s=>{s.call("arcClosePage")});return}window.location.href=c.get("redirect")||"/"},1e3)):d&&S()&&_(()=>import("./index-honENBw_.js").then(s=>s.i),__vite__mapDeps([0,1,2])).then(s=>{s.call("arcClosePage")})},onError:s=>{v.error(b(s))}})}catch(s){K(!1),v.error(b(s)),(t=document.getElementById(`code-input-${m(r).length-1}`))==null||t.focus()}finally{C(!1)}},[r,g,c,p,d,L]);a.useEffect(()=>{o&&m(r).length===f.VERIFY_CODE_LENGTH&&k()},[r,k,o]);const Q=a.useCallback(()=>{$(!0),I.open({locale:g,action:"update-kyc",containerEl:u.current,className:"connect",popup:!1,saveConnect:!1,forceConnected:!0,messages:{title:n("login.updateKyc.title"),scan:n("login.updateKyc.scan"),confirm:n("login.updateKyc.confirm"),success:n("login.updateKyc.success")},useSocket:!0,onSuccess:()=>{l.refresh({showProgress:!1,forceRefreshToken:!0}),setTimeout(()=>{if(d&&S()){_(()=>import("./index-honENBw_.js").then(i=>i.i),__vite__mapDeps([0,1,2])).then(i=>{i.call("arcClosePage")});return}window.location.href=c.get("redirect")||"/"},2e3)},onError:i=>{v.error(b(i))}})},[g,c,d]),D=a.useCallback(i=>{if(!o)return;i.preventDefault();const t=m(i.clipboardData.getData("text/plain").slice(0,f.VERIFY_CODE_LENGTH));if(!/^\d+$/.test(t))return;T(t.padEnd(f.VERIFY_CODE_LENGTH," "));const s=document.getElementById(`code-input-${t.length}`);s&&s.focus()},[o]);return a.useEffect(()=>(document.addEventListener("paste",D),()=>{document.removeEventListener("paste",D)}),[D]),e.jsxs(ce,{did:(V=window.blocklet)==null?void 0:V.appPid,children:[e.jsx(ne,{children:e.jsx("title",{children:n("login.issueKyc.pageTitle")})}),e.jsxs(w,{direction:"column",justifyContent:"center",alignItems:"center",sx:{width:"560px",padding:"8px",boxSizing:"border-box",maxWidth:"100%",height:"100%"},children:[e.jsxs(w,{spacing:1,justifyContent:"center",alignItems:"center",sx:{mb:3},children:[x?e.jsx(le,{sx:{fontSize:72},color:"success"}):e.jsx(M,{sx:{fontSize:72},color:"primary"}),e.jsx(j,{variant:"h5",children:n("login.issueKyc.pageTitle")}),!x&&e.jsx(j,{variant:"body2",color:"text.secondary",sx:{textAlign:"center"},children:n("login.issueKyc.pageDescription")}),x&&e.jsx(j,{variant:"body1",sx:{textAlign:"center"},children:n("login.issueKyc.success")}),x&&e.jsx(R,{variant:"contained",color:"primary",component:ue,href:"/",size:"large",children:n("login.issueKyc.backToHome")}),!x&&l.user&&e.jsxs(w,{direction:"row",justifyContent:"center",alignItems:"center",spacing:1,children:[e.jsx(ie,{did:l.user.did,responsive:!0,copyable:!1,showQrcode:!1}),e.jsx(ae,{locale:g,session:l,showRole:!0,showManageBlocklet:!1})]})]}),e.jsx(F,{ref:u,sx:{width:"100%"},children:!Y&&!W&&e.jsxs(me,{onSubmit:o?k:U,children:[!o&&e.jsx(z,{type:"email",id:"email-input",placeholder:n("login.issueKyc.emailPlaceholder"),sx:{width:"100%",maxWidth:360},value:h,onChange:i=>N(i.target.value),disabled:y,required:!0}),o&&e.jsxs(w,{direction:"column",justifyContent:"center",alignItems:"center",spacing:2,children:[e.jsx(j,{variant:"body2",textAlign:"center",children:n("login.issueKyc.codeSentMessage",{email:h})}),e.jsx(F,{sx:{width:"100%",maxWidth:360,display:"flex",justifyContent:"space-between"},children:[...Array(f.VERIFY_CODE_LENGTH)].map((i,t)=>e.jsx(z,{value:m(r[t])||"",type:"number",inputProps:{maxLength:1,style:{textAlign:"center",fontSize:"1.5rem"},autoComplete:"off"},sx:{width:"14%"},onChange:s=>{var B;const E=r.split("");E[t]=s.target.value,T(E.join("")),s.target.value&&t<5&&((B=document.getElementById(`code-input-${t+1}`))==null||B.focus())},onKeyDown:s=>{var E;s.key==="Backspace"&&!m(r[t])&&t>0&&((E=document.getElementById(`code-input-${t-1}`))==null||E.focus())},disabled:y,required:!0,id:`code-input-${t}`,autoComplete:"off"},`code-input-${t}`))})]}),e.jsxs(w,{direction:"row",justifyContent:p?"space-between":"center",alignItems:"center",spacing:2,sx:{width:"100%",maxWidth:360},children:[p&&e.jsx(R,{variant:"text",disabled:y,onClick:Q,size:"large",children:n("login.updateKyc.button")}),e.jsx(R,{type:"submit",size:"large",variant:"contained",disabled:y||!h||o&&m(r).length!==f.VERIFY_CODE_LENGTH,sx:{width:p?"auto":"100%"},children:y?e.jsx(re,{size:24}):n(o?"login.issueKyc.verifyButton":"login.issueKyc.sendCodeButton")})]})]})})]})]})}export{Ie as default};
@@ -0,0 +1 @@
1
+ import{cu as e,cv as r,cw as s}from"./index-dffxGns1.js";const a=e(r),t=e(s);export{t as a,a as r};
@@ -1 +1 @@
1
- import{r as C,u as T,e as j,j as e,C as k,n as W,B as v,K as I,t as m,G as R,M as S,S as L,v as U,x as b}from"./index-fgn9vwq8.js";import{F}from"./fullpage-BBGvbVDW.js";import{w as N}from"./wrap-locale-Bx_1JQDo.js";import"./Link-C4c-c9oW.js";function _({SessionContext:t,webWalletUrl:a,onSuccess:s}){var g,h;const{api:n,session:i}=C.useContext(t),{t:o,locale:u}=T(),w=j(),{searchParams:l}=new URL(window.location.href),x=l.get("redirect"),P=async(c,E)=>{s(c,E),await i.refresh(),m.success(o("exchangePassport.success")),setTimeout(()=>{if(x){const r=decodeURIComponent(x);r.startsWith(R.WELLKNOWN_SERVICE_PATH_PREFIX)?w(r,{replace:!0}):window.location=r}else window.location=window.env.pathPrefix||window.env.apiPrefix||"/"},3e3)},f=c=>{m.error(c.message)},p={},d=l.get("componentId");return d&&(p.componentId=d),i.loading?e.jsx(k,{children:e.jsx(W,{})}):e.jsx(F,{did:((g=window==null?void 0:window.blocklet)==null?void 0:g.appPid)||((h=window==null?void 0:window.env)==null?void 0:h.appPid),children:e.jsx(v,{sx:{width:"560px",maxWidth:"100%",height:"100%"},children:e.jsx(I,{className:"connect",action:"exchange-passport",checkFn:n.get,checkTimeout:10*60*1e3,webWalletUrl:a,onSuccess:P,onError:f,locale:u,messages:{title:o("exchangePassport.dialog.title"),scan:o("exchangePassport.dialog.scan"),confirm:o("exchangePassport.dialog.confirm"),success:o("exchangePassport.dialog.success")},extraParams:p,extraContent:null})})})}const B=N(_);function H(){const t=S(),a=(s,n)=>{s.sessionToken&&(U(n(s.sessionToken)),b(n(s.refreshToken)))};return e.jsx(B,{SessionContext:L,webWalletUrl:t,onSuccess:a})}export{H as default};
1
+ import{r as C,u as T,e as j,j as e,C as k,n as W,B as v,K as I,t as m,G as R,M as S,S as L,v as U,x as b}from"./index-dffxGns1.js";import{F}from"./fullpage-6nDK23_-.js";import{w as N}from"./wrap-locale-5MOyASYg.js";import"./Link-CZ52DbXN.js";function _({SessionContext:t,webWalletUrl:a,onSuccess:s}){var g,h;const{api:n,session:i}=C.useContext(t),{t:o,locale:u}=T(),w=j(),{searchParams:l}=new URL(window.location.href),x=l.get("redirect"),P=async(c,E)=>{s(c,E),await i.refresh(),m.success(o("exchangePassport.success")),setTimeout(()=>{if(x){const r=decodeURIComponent(x);r.startsWith(R.WELLKNOWN_SERVICE_PATH_PREFIX)?w(r,{replace:!0}):window.location=r}else window.location=window.env.pathPrefix||window.env.apiPrefix||"/"},3e3)},f=c=>{m.error(c.message)},p={},d=l.get("componentId");return d&&(p.componentId=d),i.loading?e.jsx(k,{children:e.jsx(W,{})}):e.jsx(F,{did:((g=window==null?void 0:window.blocklet)==null?void 0:g.appPid)||((h=window==null?void 0:window.env)==null?void 0:h.appPid),children:e.jsx(v,{sx:{width:"560px",maxWidth:"100%",height:"100%"},children:e.jsx(I,{className:"connect",action:"exchange-passport",checkFn:n.get,checkTimeout:10*60*1e3,webWalletUrl:a,onSuccess:P,onError:f,locale:u,messages:{title:o("exchangePassport.dialog.title"),scan:o("exchangePassport.dialog.scan"),confirm:o("exchangePassport.dialog.confirm"),success:o("exchangePassport.dialog.success")},extraParams:p,extraContent:null})})})}const B=N(_);function H(){const t=S(),a=(s,n)=>{s.sessionToken&&(U(n(s.sessionToken)),b(n(s.refreshToken)))};return e.jsx(B,{SessionContext:L,webWalletUrl:t,onSuccess:a})}export{H as default};
@@ -1,4 +1,4 @@
1
- import{P as e,j as o,bt as i,cc as a,a1 as l}from"./index-fgn9vwq8.js";function n({title:r,desc:s,retryFunc:t}){return o.jsxs(p,{role:"alert",children:[o.jsx("h3",{children:r}),o.jsx("pre",{children:s}),t&&o.jsx(l,{variant:"contained",color:"error",size:"small",onClick:t,children:"Try again"})]})}n.propTypes={title:e.string,desc:e.string.isRequired,retryFunc:e.func};n.defaultProps={title:"Something went wrong...",retryFunc:null};function c({error:r}){return o.jsx(n,{desc:r.message})}c.propTypes={error:e.instanceOf(Error).isRequired};e.instanceOf(Error).isRequired,e.func.isRequired;const p=i("div")`
1
+ import{P as e,j as o,bt as i,cc as a,a1 as l}from"./index-dffxGns1.js";function n({title:r,desc:s,retryFunc:t}){return o.jsxs(p,{role:"alert",children:[o.jsx("h3",{children:r}),o.jsx("pre",{children:s}),t&&o.jsx(l,{variant:"contained",color:"error",size:"small",onClick:t,children:"Try again"})]})}n.propTypes={title:e.string,desc:e.string.isRequired,retryFunc:e.func};n.defaultProps={title:"Something went wrong...",retryFunc:null};function c({error:r}){return o.jsx(n,{desc:r.message})}c.propTypes={error:e.instanceOf(Error).isRequired};e.instanceOf(Error).isRequired,e.func.isRequired;const p=i("div")`
2
2
  padding: 16px;
3
3
  border: 2px solid ${r=>r.theme.palette.error.main};
4
4
  border-radius: 4px;
@@ -1,2 +1,2 @@
1
- import{b7 as i}from"./index-fgn9vwq8.js";const f=a=>{const{details:t,errors:e,response:r}=a;return Array.isArray(e)?e.map(s=>s.message).join(`
1
+ import{b7 as i}from"./index-dffxGns1.js";const f=a=>{const{details:t,errors:e,response:r}=a;return Array.isArray(e)?e.map(s=>s.message).join(`
2
2
  `):Array.isArray(t)?`Validate failed: ${t.map(o=>{const n=o.message.replace(/["]/g,"'");return`${o.path.join(".")}: ${n}`}).join(";")}`:r?r.data.message?r.data.message:r.data.error?r.data.error:`Request failed: ${r.status} ${r.statusText}: ${JSON.stringify(r.data)}`:a.message};var m=f;const g=i(m);export{g as f};
@@ -1,4 +1,4 @@
1
- import{r as l,a0 as B,ak as N,d as W,j as e,B as t,n as v,c as L,K as I,P as p,Z as $}from"./index-fgn9vwq8.js";import{d as D}from"./Launch-KX5AwGaZ.js";import{W as E}from"./did-address-BnBtx4o3.js";import{P as T}from"./page-header-CxkULuMr.js";import{S as z}from"./layout-CEo-nvMH.js";import{S as A}from"./step-actions-pilBvcqr.js";import{S as u}from"./button-CdCaehQs.js";import{L as F}from"./Link-C4c-c9oW.js";import"./content-layout-CANmEWo5.js";function m({onNext:n,onPrevious:f}){const{locale:x,t:s}=l.useContext(B),{blocklet:a,gas:c,tokenInfo:h,actions:j}=N(),{api:y}=W(),[g,o]=l.useState(!1),{need:d="",current:k="",owe:r=99999,deficiency:C,symbol:S="",endpoint:i}=c||{},{origin:b="/"}=i?new URL(i):{};l.useEffect(()=>{const P=setInterval(()=>{j.refreshFuel()},2e3);return()=>{clearInterval(P)}},[]);const w=()=>{o(!1)};return c?e.jsxs(R,{children:[e.jsx("div",{className:"header",children:e.jsx(T,{title:s("setup.fuel.title"),onClickBack:f})}),e.jsxs(t,{className:"qr-body",children:[e.jsxs(t,{mb:6,className:"tip",children:[s("setup.fuel.tipStart").replace("slot",""),e.jsx("span",{className:"amount",children:`${d} ${S}`}),s("setup.fuel.tipEnd")]}),e.jsx(t,{fontSize:16,fontWeight:"fontWeightBold",mb:.5,children:s("setup.fuel.addressTitle")}),e.jsxs(t,{display:"flex",alignItems:"center",children:[e.jsx(E,{className:"address",did:a.appDid}),e.jsx(F,{style:{lineHeight:1},target:"_blank",href:L(b,"/explorer/accounts/",a.appDid),underline:"hover",children:e.jsx(D,{className:"icon-launch"})})]}),e.jsx(t,{my:2,children:e.jsx(u,{color:"primary",onClick:()=>o(!0),disabled:!r,children:s("setup.fuel.fuelApp")})}),e.jsx(I,{popup:!0,open:g,action:"fuel",checkFn:y.get,checkTimeout:10*60*1e3,onSuccess:w,onClose:()=>o(!1),locale:x,messages:{title:s("setup.connect.title"),scan:s("setup.connect.scan"),confirm:s("setup.connect.confirm"),success:s("setup.connect.success")},extraParams:{amount:C,...h,endpoint:i}}),e.jsxs(t,{display:"flex",color:"text.secondary",children:[e.jsxs(t,{display:"flex",children:[e.jsxs(t,{children:[s("setup.fuel.need"),":"]}),e.jsx(t,{ml:.5,color:"primary.main",fontWeight:"fontWeightBold",children:d})]}),e.jsxs(t,{display:"flex",ml:3,children:[e.jsxs(t,{children:[s("setup.fuel.current"),":"]}),e.jsx(t,{ml:.5,color:r>0?"error.main":"primary.main",fontWeight:"fontWeightBold",children:k})]})]})]}),e.jsx(A,{mt:8,children:e.jsx(u,{disabled:r>0,onClick:()=>n(),children:s("setup.next")})})]}):e.jsx(t,{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",children:e.jsx(v,{})})}m.propTypes={onNext:p.func,onPrevious:p.func};m.defaultProps={onNext:()=>{},onPrevious:()=>{}};const R=$(z)`
1
+ import{r as l,a0 as B,ak as N,d as W,j as e,B as t,n as v,c as L,K as I,P as p,Z as $}from"./index-dffxGns1.js";import{d as D}from"./Launch-hsZiLuPF.js";import{W as E}from"./did-address-DBf1riah.js";import{P as T}from"./page-header-C4ksffkd.js";import{S as z}from"./layout-DA_DkjrU.js";import{S as A}from"./step-actions-DClVmsb6.js";import{S as u}from"./button-DCt8pvLU.js";import{L as F}from"./Link-CZ52DbXN.js";import"./content-layout-D3ADfzfh.js";function m({onNext:n,onPrevious:f}){const{locale:x,t:s}=l.useContext(B),{blocklet:a,gas:c,tokenInfo:h,actions:j}=N(),{api:y}=W(),[g,o]=l.useState(!1),{need:d="",current:k="",owe:r=99999,deficiency:C,symbol:S="",endpoint:i}=c||{},{origin:b="/"}=i?new URL(i):{};l.useEffect(()=>{const P=setInterval(()=>{j.refreshFuel()},2e3);return()=>{clearInterval(P)}},[]);const w=()=>{o(!1)};return c?e.jsxs(R,{children:[e.jsx("div",{className:"header",children:e.jsx(T,{title:s("setup.fuel.title"),onClickBack:f})}),e.jsxs(t,{className:"qr-body",children:[e.jsxs(t,{mb:6,className:"tip",children:[s("setup.fuel.tipStart").replace("slot",""),e.jsx("span",{className:"amount",children:`${d} ${S}`}),s("setup.fuel.tipEnd")]}),e.jsx(t,{fontSize:16,fontWeight:"fontWeightBold",mb:.5,children:s("setup.fuel.addressTitle")}),e.jsxs(t,{display:"flex",alignItems:"center",children:[e.jsx(E,{className:"address",did:a.appDid}),e.jsx(F,{style:{lineHeight:1},target:"_blank",href:L(b,"/explorer/accounts/",a.appDid),underline:"hover",children:e.jsx(D,{className:"icon-launch"})})]}),e.jsx(t,{my:2,children:e.jsx(u,{color:"primary",onClick:()=>o(!0),disabled:!r,children:s("setup.fuel.fuelApp")})}),e.jsx(I,{popup:!0,open:g,action:"fuel",checkFn:y.get,checkTimeout:10*60*1e3,onSuccess:w,onClose:()=>o(!1),locale:x,messages:{title:s("setup.connect.title"),scan:s("setup.connect.scan"),confirm:s("setup.connect.confirm"),success:s("setup.connect.success")},extraParams:{amount:C,...h,endpoint:i}}),e.jsxs(t,{display:"flex",color:"text.secondary",children:[e.jsxs(t,{display:"flex",children:[e.jsxs(t,{children:[s("setup.fuel.need"),":"]}),e.jsx(t,{ml:.5,color:"primary.main",fontWeight:"fontWeightBold",children:d})]}),e.jsxs(t,{display:"flex",ml:3,children:[e.jsxs(t,{children:[s("setup.fuel.current"),":"]}),e.jsx(t,{ml:.5,color:r>0?"error.main":"primary.main",fontWeight:"fontWeightBold",children:k})]})]})]}),e.jsx(A,{mt:8,children:e.jsx(u,{disabled:r>0,onClick:()=>n(),children:s("setup.next")})})]}):e.jsx(t,{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",children:e.jsx(v,{})})}m.propTypes={onNext:p.func,onPrevious:p.func};m.defaultProps={onNext:()=>{},onPrevious:()=>{}};const R=$(z)`
2
2
  .qr-body {
3
3
  width: 580px;
4
4
  ${n=>n.theme.breakpoints.down("md")} {
@@ -1 +1 @@
1
- import{j as e,T as u,P as t,c6 as v,B as r,A as w,bE as a}from"./index-fgn9vwq8.js";import{L as h}from"./Link-C4c-c9oW.js";function x({linkProps:o,...d}){return e.jsxs(u,{...d,children:["Powered by"," ",e.jsx(h,{href:"https://www.arcblock.io",target:"_blank",underline:"hover",...o,children:"ArcBlock"}),"'s"," ",e.jsx(h,{href:"https://www.blocklet.io",target:"_blank",underline:"hover",...o,children:"Blocklet Technology"}),", the decentralized web engine."]})}x.propTypes={linkProps:t.object};x.defaultProps={linkProps:{}};const k="/.well-known/service/static/assets/login-bg-Cbfh9Uc2.png";function j({did:o,children:d,title:l,description:c,logo:n,logoSize:g,appUrl:i}){var f,p,m,y;if(!o)return d;let s;try{s=v(o)}catch{console.warn("Invalid did:",o)}const b=(globalThis==null?void 0:globalThis.blocklet)||(globalThis==null?void 0:globalThis.env)||{};return l===void 0&&(l=b.appName),c===void 0&&(c=b.appDescription),n===void 0&&(n=((f=globalThis==null?void 0:globalThis.blocklet)==null?void 0:f.appLogoRect)||((p=globalThis==null?void 0:globalThis.blocklet)==null?void 0:p.appLogo)||""),typeof n=="string"&&(n?n=e.jsx(r,{sx:{height:g,maxHeight:g,maxWidth:"50%",objectFit:"contain"},component:"img",src:n}):n=e.jsx(w,{size:g,did:o,src:n,variant:"rounded"})),typeof i=="string"&&(i=((m=globalThis==null?void 0:globalThis.blocklet)==null?void 0:m.appUrl)||"",!i&&(globalThis!=null&&globalThis.env)&&(i=(y=globalThis==null?void 0:globalThis.env)==null?void 0:y.baseUrl)),e.jsxs(r,{sx:{width:"100vw",height:"100vh",overflowX:"auto",display:"flex",backgroundColor:a.backgroundsBgSubtile},children:[e.jsxs(r,{sx:{position:"relative",fontSize:0,flex:30,display:{xs:"none",lg:"flex"},minWidth:"400px",backgroundColor:a.surfaceBgSubtitle},children:[e.jsx(r,{sx:{position:"absolute",top:0,bottom:0,left:0,right:0,background:s?`linear-gradient(0deg, ${s} 0%, ${s} 100%), url(${k}), lightgray 50% / cover no-repeat`:`url(${k}), lightgray 50% / cover no-repeat`,backgroundPosition:"center",backgroundSize:"cover",backgroundBlendMode:s?"soft-light, normal":"unset",mask:"linear-gradient(172deg, rgba(0, 0, 0, 0.0) 24.62%, rgba(0, 0, 0, 0.80) 44.47%, #000 100%)"}}),e.jsxs(r,{sx:{display:"flex",flexDirection:"column",position:"absolute",top:0,left:0,width:"100%",p:3},children:[i?e.jsx(r,{children:e.jsx(h,{href:i,underline:"none",color:"inherit",children:n})}):n,l&&e.jsx(u,{variant:"h5",sx:{mt:3,mb:1,p:0,mx:0,fontWeight:"bold"},children:i?e.jsx(h,{href:i,underline:"none",color:"inherit",children:l}):l}),c&&e.jsx(u,{variant:"body2",sx:{m:0,p:0,color:a.foregroundsFgSubtile,fontSize:"12px",lineHeight:"20px"},children:c})]}),e.jsx(x,{linkProps:{underline:"always",color:a.textSubtitle},sx:{zIndex:10,position:"absolute",bottom:40,left:20,right:20,textAlign:"center",fontSize:"12px",color:a.textSubtitle}})]}),e.jsx(r,{sx:{display:"flex",justifyContent:"center",alignItems:"center",flex:70,maxWidth:{xs:"100%",md:"90%"},margin:"auto",height:"auto"},children:d})]})}j.propTypes={did:t.string.isRequired,children:t.any.isRequired,title:t.any,description:t.any,logo:t.any,logoSize:t.number,appUrl:t.string};j.defaultProps={title:void 0,description:void 0,logo:void 0,logoSize:40,appUrl:""};export{j as F};
1
+ import{j as e,T as u,P as t,c6 as v,B as r,A as w,bE as a}from"./index-dffxGns1.js";import{L as h}from"./Link-CZ52DbXN.js";function x({linkProps:o,...d}){return e.jsxs(u,{...d,children:["Powered by"," ",e.jsx(h,{href:"https://www.arcblock.io",target:"_blank",underline:"hover",...o,children:"ArcBlock"}),"'s"," ",e.jsx(h,{href:"https://www.blocklet.io",target:"_blank",underline:"hover",...o,children:"Blocklet Technology"}),", the decentralized web engine."]})}x.propTypes={linkProps:t.object};x.defaultProps={linkProps:{}};const k="/.well-known/service/static/assets/login-bg-Cbfh9Uc2.png";function j({did:o,children:d,title:l,description:c,logo:n,logoSize:g,appUrl:i}){var f,p,m,y;if(!o)return d;let s;try{s=v(o)}catch{console.warn("Invalid did:",o)}const b=(globalThis==null?void 0:globalThis.blocklet)||(globalThis==null?void 0:globalThis.env)||{};return l===void 0&&(l=b.appName),c===void 0&&(c=b.appDescription),n===void 0&&(n=((f=globalThis==null?void 0:globalThis.blocklet)==null?void 0:f.appLogoRect)||((p=globalThis==null?void 0:globalThis.blocklet)==null?void 0:p.appLogo)||""),typeof n=="string"&&(n?n=e.jsx(r,{sx:{height:g,maxHeight:g,maxWidth:"50%",objectFit:"contain"},component:"img",src:n}):n=e.jsx(w,{size:g,did:o,src:n,variant:"rounded"})),typeof i=="string"&&(i=((m=globalThis==null?void 0:globalThis.blocklet)==null?void 0:m.appUrl)||"",!i&&(globalThis!=null&&globalThis.env)&&(i=(y=globalThis==null?void 0:globalThis.env)==null?void 0:y.baseUrl)),e.jsxs(r,{sx:{width:"100vw",height:"100vh",overflowX:"auto",display:"flex",backgroundColor:a.backgroundsBgSubtile},children:[e.jsxs(r,{sx:{position:"relative",fontSize:0,flex:30,display:{xs:"none",lg:"flex"},minWidth:"400px",backgroundColor:a.surfaceBgSubtitle},children:[e.jsx(r,{sx:{position:"absolute",top:0,bottom:0,left:0,right:0,background:s?`linear-gradient(0deg, ${s} 0%, ${s} 100%), url(${k}), lightgray 50% / cover no-repeat`:`url(${k}), lightgray 50% / cover no-repeat`,backgroundPosition:"center",backgroundSize:"cover",backgroundBlendMode:s?"soft-light, normal":"unset",mask:"linear-gradient(172deg, rgba(0, 0, 0, 0.0) 24.62%, rgba(0, 0, 0, 0.80) 44.47%, #000 100%)"}}),e.jsxs(r,{sx:{display:"flex",flexDirection:"column",position:"absolute",top:0,left:0,width:"100%",p:3},children:[i?e.jsx(r,{children:e.jsx(h,{href:i,underline:"none",color:"inherit",children:n})}):n,l&&e.jsx(u,{variant:"h5",sx:{mt:3,mb:1,p:0,mx:0,fontWeight:"bold"},children:i?e.jsx(h,{href:i,underline:"none",color:"inherit",children:l}):l}),c&&e.jsx(u,{variant:"body2",sx:{m:0,p:0,color:a.foregroundsFgSubtile,fontSize:"12px",lineHeight:"20px"},children:c})]}),e.jsx(x,{linkProps:{underline:"always",color:a.textSubtitle},sx:{zIndex:10,position:"absolute",bottom:40,left:20,right:20,textAlign:"center",fontSize:"12px",color:a.textSubtitle}})]}),e.jsx(r,{sx:{display:"flex",justifyContent:"center",alignItems:"center",flex:70,maxWidth:{xs:"100%",md:"90%"},margin:"auto",height:"auto"},children:d})]})}j.propTypes={did:t.string.isRequired,children:t.any.isRequired,title:t.any,description:t.any,logo:t.any,logoSize:t.number,appUrl:t.string};j.defaultProps={title:void 0,description:void 0,logo:void 0,logoSize:40,appUrl:""};export{j as F};
@@ -1 +1 @@
1
- import{j as o,B as e,a1 as t,L as r,G as i}from"./index-fgn9vwq8.js";import{S as n}from"./studio-B_REa37-.js";import"./index-Brct1h9T.js";import"./Menu-C6gTV_C5.js";import"./Toolbar-Ch5_bErb.js";import"./Hidden-CbT0Nsko.js";import"./fallback-BiNvsiaq.js";function d(){return o.jsx(n,{children:o.jsxs(e,{m:4,children:[o.jsx(t,{component:r,to:`${i.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/preferences`,size:"large",color:"primary",variant:"outlined",children:"Preference Builder"}),o.jsx(t,{component:r,style:{marginLeft:16},to:`${i.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/localization`,size:"large",color:"primary",variant:"outlined",children:"Localization"})]})})}export{d as default};
1
+ import{j as o,B as e,a1 as t,L as r,G as i}from"./index-dffxGns1.js";import{S as n}from"./studio-CSSHBcHf.js";import"./index-DjThaPGX.js";import"./Menu-DSnQZg3F.js";import"./Toolbar-BaL7nrmh.js";import"./Hidden-CDKfZsy3.js";import"./fallback-DZ0HiAyE.js";function d(){return o.jsx(n,{children:o.jsxs(e,{m:4,children:[o.jsx(t,{component:r,to:`${i.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/preferences`,size:"large",color:"primary",variant:"outlined",children:"Preference Builder"}),o.jsx(t,{component:r,style:{marginLeft:16},to:`${i.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/localization`,size:"large",color:"primary",variant:"outlined",children:"Localization"})]})})}export{d as default};
@@ -1 +1 @@
1
- import{eH as x,eI as E}from"./index-fgn9vwq8.js";const H=({url:r,allowFullScreen:o,position:a,display:u,height:i,width:c,overflow:y,styles:f,onLoad:p,onMouseOver:w,onMouseOut:b,scrolling:d,id:m,frameBorder:n,ariaHidden:O,sandbox:s,allow:j,className:g,title:h,ariaLabel:k,ariaLabelledby:I,name:P,target:v,loading:A,importance:F,referrerpolicy:M,allowpaymentrequest:S,src:$,key:q})=>{const t=x({src:$||r,target:v||null,style:{position:a||null,display:u||"initial",overflow:y||null},scrolling:d||null,allowpaymentrequest:S||null,importance:F||null,sandbox:s&&[...s].join(" ")||null,loading:A||null,styles:f||null,name:P||null,className:g||null,allowFullScreen:"allowFullScreen",referrerpolicy:M||null,title:h||null,allow:j||null,id:m||null,"aria-labelledby":I||null,"aria-hidden":O||null,"aria-label":k||null,width:c||null,height:i||null,onLoad:p||null,onMouseOver:w||null,onMouseOut:b||null,key:q||"iframe"});let l=Object.create(null);for(let e of Object.keys(t))t[e]!=null&&(l[e]=t[e]);for(let e of Object.keys(l.style))l.style[e]==null&&delete l.style[e];if(l.styles)for(let e of Object.keys(l.styles))l.styles.hasOwnProperty(e)&&(l.style[e]=l.styles[e]),Object.keys(l.styles).pop()==e&&delete l.styles;if(o)if("allow"in l){const e=l.allow.replace("fullscreen","");l.allow=`fullscreen ${e.trim()}`.trim()}else l.allow="fullscreen";return n>=0&&(l.style.hasOwnProperty("border")||(l.style.border=n)),E.createElement("iframe",Object.assign({},l))},N=H;export{N as I};
1
+ import{eI as x,eJ as E}from"./index-dffxGns1.js";const J=({url:r,allowFullScreen:o,position:a,display:u,height:i,width:c,overflow:y,styles:f,onLoad:p,onMouseOver:w,onMouseOut:b,scrolling:d,id:m,frameBorder:n,ariaHidden:O,sandbox:s,allow:j,className:g,title:h,ariaLabel:k,ariaLabelledby:I,name:P,target:v,loading:A,importance:F,referrerpolicy:M,allowpaymentrequest:S,src:$,key:q})=>{const t=x({src:$||r,target:v||null,style:{position:a||null,display:u||"initial",overflow:y||null},scrolling:d||null,allowpaymentrequest:S||null,importance:F||null,sandbox:s&&[...s].join(" ")||null,loading:A||null,styles:f||null,name:P||null,className:g||null,allowFullScreen:"allowFullScreen",referrerpolicy:M||null,title:h||null,allow:j||null,id:m||null,"aria-labelledby":I||null,"aria-hidden":O||null,"aria-label":k||null,width:c||null,height:i||null,onLoad:p||null,onMouseOver:w||null,onMouseOut:b||null,key:q||"iframe"});let l=Object.create(null);for(let e of Object.keys(t))t[e]!=null&&(l[e]=t[e]);for(let e of Object.keys(l.style))l.style[e]==null&&delete l.style[e];if(l.styles)for(let e of Object.keys(l.styles))l.styles.hasOwnProperty(e)&&(l.style[e]=l.styles[e]),Object.keys(l.styles).pop()==e&&delete l.styles;if(o)if("allow"in l){const e=l.allow.replace("fullscreen","");l.allow=`fullscreen ${e.trim()}`.trim()}else l.allow="fullscreen";return n>=0&&(l.style.hasOwnProperty("border")||(l.style.border=n)),E.createElement("iframe",Object.assign({},l))},N=J;export{N as I};
@@ -1,4 +1,4 @@
1
- var bt=Object.defineProperty;var yt=(e,t,n)=>t in e?bt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var D=(e,t,n)=>yt(e,typeof t!="symbol"?t+"":t,n);import{aG as xt,cP as wt,d5 as vt,aK as W,ck as V,r as A,aI as It,aJ as Ct,aO as ve,cK as St,ch as Tt,j as m,aM as Ie,aN as At,P as f,N as kt,l as Pt,aC as jt,bF as Ce,bm as Lt,bn as Mt,df as Ot,ai as Rt,bE as k,bk as Et,B as Nt,bB as _t,T as qt,dg as Ft,dh as Bt,a1 as $t,di as zt,bC as De,u as Ve,aD as Ht,f as Dt,E as Vt}from"./index-fgn9vwq8.js";import{D as Ut}from"./index-Brct1h9T.js";import{l as R,g as Qt,L as Gt}from"./MoreVert-Dm5VmAN3.js";import{L as Wt}from"./selector-CuYNfwOx.js";const Zt=["alignItems","autoFocus","component","children","dense","disableGutters","divider","focusVisibleClassName","selected","className"],Jt=(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.alignItems==="flex-start"&&t.alignItemsFlexStart,n.divider&&t.divider,!n.disableGutters&&t.gutters]},Xt=e=>{const{alignItems:t,classes:n,dense:r,disabled:o,disableGutters:s,divider:i,selected:a}=e,l=At({root:["root",r&&"dense",!s&&"gutters",i&&"divider",o&&"disabled",t==="flex-start"&&"alignItemsFlexStart",a&&"selected"]},Qt,n);return W({},n,l)},Yt=xt(wt,{shouldForwardProp:e=>vt(e)||e==="classes",name:"MuiListItemButton",slot:"Root",overridesResolver:Jt})(({theme:e,ownerState:t})=>W({display:"flex",flexGrow:1,justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minWidth:0,boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${R.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:V(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${R.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:V(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${R.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:V(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:V(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${R.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${R.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}},t.divider&&{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"},t.alignItems==="flex-start"&&{alignItems:"flex-start"},!t.disableGutters&&{paddingLeft:16,paddingRight:16},t.dense&&{paddingTop:4,paddingBottom:4})),Kt=A.forwardRef(function(t,n){const r=It({props:t,name:"MuiListItemButton"}),{alignItems:o="center",autoFocus:s=!1,component:i="div",children:a,dense:c=!1,disableGutters:l=!1,divider:u=!1,focusVisibleClassName:d,selected:p=!1,className:g}=r,b=Ct(r,Zt),x=A.useContext(ve),I=A.useMemo(()=>({dense:c||x.dense||!1,alignItems:o,disableGutters:l}),[o,x.dense,c,l]),T=A.useRef(null);St(()=>{s&&T.current&&T.current.focus()},[s]);const w=W({},r,{alignItems:o,dense:I.dense,disableGutters:l,divider:u,selected:p}),y=Xt(w),O=Tt(T,n);return m.jsx(ve.Provider,{value:I,children:m.jsx(Yt,W({ref:O,href:b.href||b.to,component:(b.href||b.to)&&i==="div"?"button":i,focusVisibleClassName:Ie(y.focusVisible,d),ownerState:w,className:Ie(y.root,g)},b,{classes:y,children:a}))})});/**
1
+ var bt=Object.defineProperty;var yt=(e,t,n)=>t in e?bt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var D=(e,t,n)=>yt(e,typeof t!="symbol"?t+"":t,n);import{aG as xt,cP as wt,d6 as vt,aK as W,ck as V,r as A,aI as It,aJ as Ct,aO as ve,cK as St,ch as Tt,j as m,aM as Ie,aN as At,P as f,N as jt,l as kt,aC as Pt,bF as Ce,bm as Lt,bn as Mt,dg as Ot,ai as Rt,bE as j,bk as Et,B as Nt,bB as _t,T as qt,dh as Ft,di as Bt,a1 as $t,dj as zt,bC as De,u as Ve,aD as Ht,f as Dt,E as Vt}from"./index-dffxGns1.js";import{D as Ut}from"./index-DjThaPGX.js";import{l as R,g as Qt,L as Gt}from"./MoreVert-DHjA3d3K.js";import{L as Wt}from"./selector-46StcO3H.js";const Zt=["alignItems","autoFocus","component","children","dense","disableGutters","divider","focusVisibleClassName","selected","className"],Jt=(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.alignItems==="flex-start"&&t.alignItemsFlexStart,n.divider&&t.divider,!n.disableGutters&&t.gutters]},Xt=e=>{const{alignItems:t,classes:n,dense:r,disabled:o,disableGutters:s,divider:i,selected:a}=e,l=At({root:["root",r&&"dense",!s&&"gutters",i&&"divider",o&&"disabled",t==="flex-start"&&"alignItemsFlexStart",a&&"selected"]},Qt,n);return W({},n,l)},Yt=xt(wt,{shouldForwardProp:e=>vt(e)||e==="classes",name:"MuiListItemButton",slot:"Root",overridesResolver:Jt})(({theme:e,ownerState:t})=>W({display:"flex",flexGrow:1,justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minWidth:0,boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${R.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:V(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${R.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:V(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${R.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:V(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:V(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${R.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${R.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}},t.divider&&{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"},t.alignItems==="flex-start"&&{alignItems:"flex-start"},!t.disableGutters&&{paddingLeft:16,paddingRight:16},t.dense&&{paddingTop:4,paddingBottom:4})),Kt=A.forwardRef(function(t,n){const r=It({props:t,name:"MuiListItemButton"}),{alignItems:o="center",autoFocus:s=!1,component:i="div",children:a,dense:c=!1,disableGutters:l=!1,divider:u=!1,focusVisibleClassName:d,selected:p=!1,className:g}=r,b=Ct(r,Zt),x=A.useContext(ve),I=A.useMemo(()=>({dense:c||x.dense||!1,alignItems:o,disableGutters:l}),[o,x.dense,c,l]),T=A.useRef(null);St(()=>{s&&T.current&&T.current.focus()},[s]);const w=W({},r,{alignItems:o,dense:I.dense,disableGutters:l,divider:u,selected:p}),y=Xt(w),O=Tt(T,n);return m.jsx(ve.Provider,{value:I,children:m.jsx(Yt,W({ref:O,href:b.href||b.to,component:(b.href||b.to)&&i==="div"?"button":i,focusVisibleClassName:Ie(y.focusVisible,d),ownerState:w,className:Ie(y.root,g)},b,{classes:y,children:a}))})});/**
2
2
  * (c) Iconify
3
3
  *
4
4
  * For the full copyright and license information, please view the license.txt
@@ -8,4 +8,4 @@ var bt=Object.defineProperty;var yt=(e,t,n)=>t in e?bt(e,t,{enumerable:!0,config
8
8
  *
9
9
  * @license MIT
10
10
  * @version 1.0.8
11
- */const Ue=Object.freeze({left:0,top:0,width:16,height:16}),Z=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),$=Object.freeze({...Ue,...Z}),re=Object.freeze({...$,body:"",hidden:!1}),en=Object.freeze({width:null,height:null}),Qe=Object.freeze({...en,...Z});function tn(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(o){for(;o<0;)o+=4;return o%4}if(n===""){const o=parseInt(e);return isNaN(o)?0:r(o)}else if(n!==e){let o=0;switch(n){case"%":o=25;break;case"deg":o=90}if(o){let s=parseFloat(e.slice(0,e.length-n.length));return isNaN(s)?0:(s=s/o,s%1===0?r(s):0)}}return t}const nn=/[\s,]+/;function on(e,t){t.split(nn).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}const Ge={...Qe,preserveAspectRatio:""};function Se(e){const t={...Ge},n=(r,o)=>e.getAttribute(r)||o;return t.width=n("width",null),t.height=n("height",null),t.rotate=tn(n("rotate","")),on(t,n("flip","")),t.preserveAspectRatio=n("preserveAspectRatio",n("preserveaspectratio","")),t}function rn(e,t){for(const n in Ge)if(e[n]!==t[n])return!0;return!1}const N=/^[a-z0-9]+(-[a-z0-9]+)*$/,z=(e,t,n,r="")=>{const o=e.split(":");if(e.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;r=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const a=o.pop(),c=o.pop(),l={provider:o.length>0?o[0]:r,prefix:c,name:a};return t&&!Q(l)?null:l}const s=o[0],i=s.split("-");if(i.length>1){const a={provider:r,prefix:i.shift(),name:i.join("-")};return t&&!Q(a)?null:a}if(n&&r===""){const a={provider:r,prefix:"",name:s};return t&&!Q(a,n)?null:a}return null},Q=(e,t)=>e?!!((e.provider===""||e.provider.match(N))&&(t&&e.prefix===""||e.prefix.match(N))&&e.name.match(N)):!1;function sn(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function Te(e,t){const n=sn(e,t);for(const r in re)r in Z?r in e&&!(r in n)&&(n[r]=Z[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function cn(e,t){const n=e.icons,r=e.aliases||Object.create(null),o=Object.create(null);function s(i){if(n[i])return o[i]=[];if(!(i in o)){o[i]=null;const a=r[i]&&r[i].parent,c=a&&s(a);c&&(o[i]=[a].concat(c))}return o[i]}return Object.keys(n).concat(Object.keys(r)).forEach(s),o}function an(e,t,n){const r=e.icons,o=e.aliases||Object.create(null);let s={};function i(a){s=Te(r[a]||o[a],s)}return i(t),n.forEach(i),Te(e,s)}function We(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(o=>{t(o,null),n.push(o)});const r=cn(e);for(const o in r){const s=r[o];s&&(t(o,an(e,o,s)),n.push(o))}return n}const ln={provider:"",aliases:{},not_found:{},...Ue};function ee(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function Ze(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!ee(e,ln))return null;const n=t.icons;for(const o in n){const s=n[o];if(!o.match(N)||typeof s.body!="string"||!ee(s,re))return null}const r=t.aliases||Object.create(null);for(const o in r){const s=r[o],i=s.parent;if(!o.match(N)||typeof i!="string"||!n[i]&&!r[i]||!ee(s,re))return null}return t}const J=Object.create(null);function un(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function j(e,t){const n=J[e]||(J[e]=Object.create(null));return n[t]||(n[t]=un(e,t))}function pe(e,t){return Ze(t)?We(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function fn(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}function dn(e,t){let n=[];return(typeof e=="string"?[e]:Object.keys(J)).forEach(o=>{(typeof o=="string"&&typeof t=="string"?[t]:Object.keys(J[o]||{})).forEach(i=>{const a=j(o,i);n=n.concat(Object.keys(a.icons).map(c=>(o!==""?"@"+o+":":"")+i+":"+c))})}),n}let q=!1;function Je(e){return typeof e=="boolean"&&(q=e),q}function F(e){const t=typeof e=="string"?z(e,!0,q):e;if(t){const n=j(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function Xe(e,t){const n=z(e,!0,q);if(!n)return!1;const r=j(n.provider,n.prefix);return fn(r,n.name,t)}function Ae(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),q&&!t&&!e.prefix){let o=!1;return Ze(e)&&(e.prefix="",We(e,(s,i)=>{i&&Xe(s,i)&&(o=!0)})),o}const n=e.prefix;if(!Q({provider:t,prefix:n,name:"a"}))return!1;const r=j(t,n);return!!pe(r,e)}function pn(e){return!!F(e)}function hn(e){const t=F(e);return t?{...$,...t}:null}function gn(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((o,s)=>o.provider!==s.provider?o.provider.localeCompare(s.provider):o.prefix!==s.prefix?o.prefix.localeCompare(s.prefix):o.name.localeCompare(s.name));let r={provider:"",prefix:"",name:""};return e.forEach(o=>{if(r.name===o.name&&r.prefix===o.prefix&&r.provider===o.provider)return;r=o;const s=o.provider,i=o.prefix,a=o.name,c=n[s]||(n[s]=Object.create(null)),l=c[i]||(c[i]=j(s,i));let u;a in l.icons?u=t.loaded:i===""||l.missing.has(a)?u=t.missing:u=t.pending;const d={provider:s,prefix:i,name:a};u.push(d)}),t}function Ye(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(o=>o.id!==t))})}function mn(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const r=e.provider,o=e.prefix;t.forEach(s=>{const i=s.icons,a=i.pending.length;i.pending=i.pending.filter(c=>{if(c.prefix!==o)return!0;const l=c.name;if(e.icons[l])i.loaded.push({provider:r,prefix:o,name:l});else if(e.missing.has(l))i.missing.push({provider:r,prefix:o,name:l});else return n=!0,!0;return!1}),i.pending.length!==a&&(n||Ye([e],s.id),s.callback(i.loaded.slice(0),i.missing.slice(0),i.pending.slice(0),s.abort))})}))}let bn=0;function yn(e,t,n){const r=bn++,o=Ye.bind(null,n,r);if(!t.pending.length)return o;const s={id:r,icons:t,callback:e,abort:o};return n.forEach(i=>{(i.loaderCallbacks||(i.loaderCallbacks=[])).push(s)}),o}const se=Object.create(null);function ke(e,t){se[e]=t}function ie(e){return se[e]||se[""]}function xn(e,t=!0,n=!1){const r=[];return e.forEach(o=>{const s=typeof o=="string"?z(o,t,n):o;s&&r.push(s)}),r}var wn={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function vn(e,t,n,r){const o=e.resources.length,s=e.random?Math.floor(Math.random()*o):e.index;let i;if(e.random){let h=e.resources.slice(0);for(i=[];h.length>1;){const v=Math.floor(Math.random()*h.length);i.push(h[v]),h=h.slice(0,v).concat(h.slice(v+1))}i=i.concat(h)}else i=e.resources.slice(s).concat(e.resources.slice(0,s));const a=Date.now();let c="pending",l=0,u,d=null,p=[],g=[];typeof r=="function"&&g.push(r);function b(){d&&(clearTimeout(d),d=null)}function x(){c==="pending"&&(c="aborted"),b(),p.forEach(h=>{h.status==="pending"&&(h.status="aborted")}),p=[]}function I(h,v){v&&(g=[]),typeof h=="function"&&g.push(h)}function T(){return{startTime:a,payload:t,status:c,queriesSent:l,queriesPending:p.length,subscribe:I,abort:x}}function w(){c="failed",g.forEach(h=>{h(void 0,u)})}function y(){p.forEach(h=>{h.status==="pending"&&(h.status="aborted")}),p=[]}function O(h,v,P){const S=v!=="success";switch(p=p.filter(L=>L!==h),c){case"pending":break;case"failed":if(S||!e.dataAfterTimeout)return;break;default:return}if(v==="abort"){u=P,w();return}if(S){u=P,p.length||(i.length?C():w());return}if(b(),y(),!e.random){const L=e.resources.indexOf(h.resource);L!==-1&&L!==e.index&&(e.index=L)}c="completed",g.forEach(L=>{L(P)})}function C(){if(c!=="pending")return;b();const h=i.shift();if(h===void 0){if(p.length){d=setTimeout(()=>{b(),c==="pending"&&(y(),w())},e.timeout);return}w();return}const v={status:"pending",resource:h,callback:(P,S)=>{O(v,P,S)}};p.push(v),l++,d=setTimeout(C,e.rotate),n(h,t,v.callback)}return setTimeout(C),T}function Ke(e){const t={...wn,...e};let n=[];function r(){n=n.filter(a=>a().status==="pending")}function o(a,c,l){const u=vn(t,a,c,(d,p)=>{r(),l&&l(d,p)});return n.push(u),u}function s(a){return n.find(c=>a(c))||null}return{query:o,find:s,setIndex:a=>{t.index=a},getIndex:()=>t.index,cleanup:r}}function he(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const Y=Object.create(null),E=["https://api.simplesvg.com","https://api.unisvg.com"],G=[];for(;E.length>0;)E.length===1||Math.random()>.5?G.push(E.shift()):G.push(E.pop());Y[""]=he({resources:["https://api.iconify.design"].concat(G)});function Pe(e,t){const n=he(t);return n===null?!1:(Y[e]=n,!0)}function K(e){return Y[e]}function In(){return Object.keys(Y)}function je(){}const te=Object.create(null);function Cn(e){if(!te[e]){const t=K(e);if(!t)return;const n=Ke(t),r={config:t,redundancy:n};te[e]=r}return te[e]}function et(e,t,n){let r,o;if(typeof e=="string"){const s=ie(e);if(!s)return n(void 0,424),je;o=s.send;const i=Cn(e);i&&(r=i.redundancy)}else{const s=he(e);if(s){r=Ke(s);const i=e.resources?e.resources[0]:"",a=ie(i);a&&(o=a.send)}}return!r||!o?(n(void 0,424),je):r.query(t,o,n)().abort}const Le="iconify2",B="iconify",tt=B+"-count",Me=B+"-version",nt=36e5,Sn=168;function ce(e,t){try{return e.getItem(t)}catch{}}function ge(e,t,n){try{return e.setItem(t,n),!0}catch{}}function Oe(e,t){try{e.removeItem(t)}catch{}}function ae(e,t){return ge(e,tt,t.toString())}function le(e){return parseInt(ce(e,tt))||0}const M={local:!0,session:!0},ot={local:new Set,session:new Set};let me=!1;function Tn(e){me=e}let U=typeof window>"u"?{}:window;function rt(e){const t=e+"Storage";try{if(U&&U[t]&&typeof U[t].length=="number")return U[t]}catch{}M[e]=!1}function st(e,t){const n=rt(e);if(!n)return;const r=ce(n,Me);if(r!==Le){if(r){const a=le(n);for(let c=0;c<a;c++)Oe(n,B+c.toString())}ge(n,Me,Le),ae(n,0);return}const o=Math.floor(Date.now()/nt)-Sn,s=a=>{const c=B+a.toString(),l=ce(n,c);if(typeof l=="string"){try{const u=JSON.parse(l);if(typeof u=="object"&&typeof u.cached=="number"&&u.cached>o&&typeof u.provider=="string"&&typeof u.data=="object"&&typeof u.data.prefix=="string"&&t(u,a))return!0}catch{}Oe(n,c)}};let i=le(n);for(let a=i-1;a>=0;a--)s(a)||(a===i-1?(i--,ae(n,i)):ot[e].add(a))}function it(){if(!me){Tn(!0);for(const e in M)st(e,t=>{const n=t.data,r=t.provider,o=n.prefix,s=j(r,o);if(!pe(s,n).length)return!1;const i=n.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,i):i,!0})}}function An(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const r in M)st(r,o=>{const s=o.data;return o.provider!==e.provider||s.prefix!==e.prefix||s.lastModified===t});return!0}function kn(e,t){me||it();function n(r){let o;if(!M[r]||!(o=rt(r)))return;const s=ot[r];let i;if(s.size)s.delete(i=Array.from(s).shift());else if(i=le(o),!ae(o,i+1))return;const a={cached:Math.floor(Date.now()/nt),provider:e.provider,data:t};return ge(o,B+i.toString(),JSON.stringify(a))}t.lastModified&&!An(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function Re(){}function Pn(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,mn(e)}))}function jn(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:r}=e,o=e.iconsToLoad;delete e.iconsToLoad;let s;if(!o||!(s=ie(n)))return;s.prepare(n,r,o).forEach(a=>{et(n,a,c=>{if(typeof c!="object")a.icons.forEach(l=>{e.missing.add(l)});else try{const l=pe(e,c);if(!l.length)return;const u=e.pendingIcons;u&&l.forEach(d=>{u.delete(d)}),kn(e,c)}catch(l){console.error(l)}Pn(e)})})}))}const be=(e,t)=>{const n=xn(e,!0,Je()),r=gn(n);if(!r.pending.length){let c=!0;return t&&setTimeout(()=>{c&&t(r.loaded,r.missing,r.pending,Re)}),()=>{c=!1}}const o=Object.create(null),s=[];let i,a;return r.pending.forEach(c=>{const{provider:l,prefix:u}=c;if(u===a&&l===i)return;i=l,a=u,s.push(j(l,u));const d=o[l]||(o[l]=Object.create(null));d[u]||(d[u]=[])}),r.pending.forEach(c=>{const{provider:l,prefix:u,name:d}=c,p=j(l,u),g=p.pendingIcons||(p.pendingIcons=new Set);g.has(d)||(g.add(d),o[l][u].push(d))}),s.forEach(c=>{const{provider:l,prefix:u}=c;o[l][u].length&&jn(c,o[l][u])}),t?yn(t,r,s):Re},Ln=e=>new Promise((t,n)=>{const r=typeof e=="string"?z(e,!0):e;if(!r){n(e);return}be([r||e],o=>{if(o.length&&r){const s=F(r);if(s){t({...$,...s});return}}n(e)})});function Mn(e){try{const t=typeof e=="string"?JSON.parse(e):e;if(typeof t.body=="string")return{...t}}catch{}}function On(e,t){const n=typeof e=="string"?z(e,!0,!0):null;if(!n){const s=Mn(e);return{value:e,data:s}}const r=F(n);if(r!==void 0||!n.prefix)return{value:e,name:n,data:r};const o=be([n],()=>t(e,n,F(n)));return{value:e,name:n,loading:o}}function ne(e){return e.hasAttribute("inline")}let ct=!1;try{ct=navigator.vendor.indexOf("Apple")===0}catch{}function Rn(e,t){switch(t){case"svg":case"bg":case"mask":return t}return t!=="style"&&(ct||e.indexOf("<a")===-1)?"svg":e.indexOf("currentColor")===-1?"bg":"mask"}const En=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Nn=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function ue(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(En);if(r===null||!r.length)return e;const o=[];let s=r.shift(),i=Nn.test(s);for(;;){if(i){const a=parseFloat(s);isNaN(a)?o.push(s):o.push(Math.ceil(a*t*n)/n)}else o.push(s);if(s=r.shift(),s===void 0)return o.join("");i=!i}}const _n=e=>e==="unset"||e==="undefined"||e==="none";function at(e,t){const n={...$,...e},r={...Qe,...t},o={left:n.left,top:n.top,width:n.width,height:n.height};let s=n.body;[n,r].forEach(b=>{const x=[],I=b.hFlip,T=b.vFlip;let w=b.rotate;I?T?w+=2:(x.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),x.push("scale(-1 1)"),o.top=o.left=0):T&&(x.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),x.push("scale(1 -1)"),o.top=o.left=0);let y;switch(w<0&&(w-=Math.floor(w/4)*4),w=w%4,w){case 1:y=o.height/2+o.top,x.unshift("rotate(90 "+y.toString()+" "+y.toString()+")");break;case 2:x.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:y=o.width/2+o.left,x.unshift("rotate(-90 "+y.toString()+" "+y.toString()+")");break}w%2===1&&(o.left!==o.top&&(y=o.left,o.left=o.top,o.top=y),o.width!==o.height&&(y=o.width,o.width=o.height,o.height=y)),x.length&&(s='<g transform="'+x.join(" ")+'">'+s+"</g>")});const i=r.width,a=r.height,c=o.width,l=o.height;let u,d;i===null?(d=a===null?"1em":a==="auto"?l:a,u=ue(d,c/l)):(u=i==="auto"?c:i,d=a===null?ue(u,l/c):a==="auto"?l:a);const p={},g=(b,x)=>{_n(x)||(p[b]=x.toString())};return g("width",u),g("height",d),p.viewBox=o.left.toString()+" "+o.top.toString()+" "+c.toString()+" "+l.toString(),{attributes:p,body:s}}const qn=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let X=qn();function Fn(e){X=e}function Bn(){return X}function $n(e,t){const n=K(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let o=0;n.resources.forEach(i=>{o=Math.max(o,i.length)});const s=t+".json?icons=";r=n.maxURL-o-n.path.length-s.length}return r}function zn(e){return e===404}const Hn=(e,t,n)=>{const r=[],o=$n(e,t),s="icons";let i={type:s,provider:e,prefix:t,icons:[]},a=0;return n.forEach((c,l)=>{a+=c.length+1,a>=o&&l>0&&(r.push(i),i={type:s,provider:e,prefix:t,icons:[]},a=c.length),i.icons.push(c)}),r.push(i),r};function Dn(e){if(typeof e=="string"){const t=K(e);if(t)return t.path}return"/"}const Vn=(e,t,n)=>{if(!X){n("abort",424);return}let r=Dn(t.provider);switch(t.type){case"icons":{const s=t.prefix,a=t.icons.join(","),c=new URLSearchParams({icons:a});r+=s+".json?"+c.toString();break}case"custom":{const s=t.uri;r+=s.slice(0,1)==="/"?s.slice(1):s;break}default:n("abort",400);return}let o=503;X(e+r).then(s=>{const i=s.status;if(i!==200){setTimeout(()=>{n(zn(i)?"abort":"next",i)});return}return o=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?n("abort",s):n("next",o)});return}setTimeout(()=>{n("success",s)})}).catch(()=>{n("next",o)})},Un={prepare:Hn,send:Vn};function Ee(e,t){switch(e){case"local":case"session":M[e]=t;break;case"all":for(const n in M)M[n]=t;break}}const oe="data-style";let lt="";function Qn(e){lt=e}function Ne(e,t){let n=Array.from(e.childNodes).find(r=>r.hasAttribute&&r.hasAttribute(oe));n||(n=document.createElement("style"),n.setAttribute(oe,oe),e.appendChild(n)),n.textContent=":host{display:inline-block;vertical-align:"+(t?"-0.125em":"0")+"}span,svg{display:block}"+lt}function ut(){ke("",Un),Je(!0);let e;try{e=window}catch{}if(e){if(it(),e.IconifyPreload!==void 0){const n=e.IconifyPreload,r="Invalid IconifyPreload syntax.";typeof n=="object"&&n!==null&&(n instanceof Array?n:[n]).forEach(o=>{try{(typeof o!="object"||o===null||o instanceof Array||typeof o.icons!="object"||typeof o.prefix!="string"||!Ae(o))&&console.error(r)}catch{console.error(r)}})}if(e.IconifyProviders!==void 0){const n=e.IconifyProviders;if(typeof n=="object"&&n!==null)for(const r in n){const o="IconifyProviders["+r+"] is invalid.";try{const s=n[r];if(typeof s!="object"||!s||s.resources===void 0)continue;Pe(r,s)||console.error(o)}catch{console.error(o)}}}}return{enableCache:n=>Ee(n,!0),disableCache:n=>Ee(n,!1),iconExists:pn,getIcon:hn,listIcons:dn,addIcon:Xe,addCollection:Ae,calculateSize:ue,buildIcon:at,loadIcons:be,loadIcon:Ln,addAPIProvider:Pe,appendCustomStyle:Qn,_api:{getAPIConfig:K,setAPIModule:ke,sendAPIQuery:et,setFetch:Fn,getFetch:Bn,listAPIProviders:In}}}function ft(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}function Gn(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function Wn(e){return"data:image/svg+xml,"+Gn(e)}function Zn(e){return'url("'+Wn(e)+'")'}const fe={"background-color":"currentColor"},dt={"background-color":"transparent"},_e={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},qe={"-webkit-mask":fe,mask:fe,background:dt};for(const e in qe){const t=qe[e];for(const n in _e)t[e+"-"+n]=_e[n]}function Fe(e){return e?e+(e.match(/^[-0-9.]+$/)?"px":""):"inherit"}function Jn(e,t,n){const r=document.createElement("span");let o=e.body;o.indexOf("<a")!==-1&&(o+="<!-- "+Date.now()+" -->");const s=e.attributes,i=ft(o,{...s,width:t.width+"",height:t.height+""}),a=Zn(i),c=r.style,l={"--svg":a,width:Fe(s.width),height:Fe(s.height),...n?fe:dt};for(const u in l)c.setProperty(u,l[u]);return r}let _;function Xn(){try{_=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{_=null}}function Yn(e){return _===void 0&&Xn(),_?_.createHTML(e):e}function Kn(e){const t=document.createElement("span"),n=e.attributes;let r="";n.width||(r="width: inherit;"),n.height||(r+="height: inherit;"),r&&(n.style=r);const o=ft(e.body,n);return t.innerHTML=Yn(o),t.firstChild}function Be(e,t){const n=t.icon.data,r=t.customisations,o=at(n,r);r.preserveAspectRatio&&(o.attributes.preserveAspectRatio=r.preserveAspectRatio);const s=t.renderedMode;let i;switch(s){case"svg":i=Kn(o);break;default:i=Jn(o,{...$,...n},s==="mask")}const a=Array.from(e.childNodes).find(c=>{const l=c.tagName&&c.tagName.toUpperCase();return l==="SPAN"||l==="SVG"});a?i.tagName==="SPAN"&&a.tagName===i.tagName?a.setAttribute("style",i.getAttribute("style")):e.replaceChild(i,a):e.appendChild(i)}function $e(e,t,n){const r=n&&(n.rendered?n:n.lastRender);return{rendered:!1,inline:t,icon:e,lastRender:r}}function eo(e="iconify-icon"){let t,n;try{t=window.customElements,n=window.HTMLElement}catch{return}if(!t||!n)return;const r=t.get(e);if(r)return r;const o=["icon","mode","inline","width","height","rotate","flip"],s=class extends n{constructor(){super();D(this,"_shadowRoot");D(this,"_state");D(this,"_checkQueued",!1);const c=this._shadowRoot=this.attachShadow({mode:"open"}),l=ne(this);Ne(c,l),this._state=$e({value:""},l),this._queueCheck()}static get observedAttributes(){return o.slice(0)}attributeChangedCallback(c){if(c==="inline"){const l=ne(this),u=this._state;l!==u.inline&&(u.inline=l,Ne(this._shadowRoot,l))}else this._queueCheck()}get icon(){const c=this.getAttribute("icon");if(c&&c.slice(0,1)==="{")try{return JSON.parse(c)}catch{}return c}set icon(c){typeof c=="object"&&(c=JSON.stringify(c)),this.setAttribute("icon",c)}get inline(){return ne(this)}set inline(c){c?this.setAttribute("inline","true"):this.removeAttribute("inline")}restartAnimation(){const c=this._state;if(c.rendered){const l=this._shadowRoot;if(c.renderedMode==="svg")try{l.lastChild.setCurrentTime(0);return}catch{}Be(l,c)}}get status(){const c=this._state;return c.rendered?"rendered":c.icon.data===null?"failed":"loading"}_queueCheck(){this._checkQueued||(this._checkQueued=!0,setTimeout(()=>{this._check()}))}_check(){if(!this._checkQueued)return;this._checkQueued=!1;const c=this._state,l=this.getAttribute("icon");if(l!==c.icon.value){this._iconChanged(l);return}if(!c.rendered)return;const u=this.getAttribute("mode"),d=Se(this);(c.attrMode!==u||rn(c.customisations,d))&&this._renderIcon(c.icon,d,u)}_iconChanged(c){const l=On(c,(u,d,p)=>{const g=this._state;if(g.rendered||this.getAttribute("icon")!==u)return;const b={value:u,name:d,data:p};b.data?this._gotIconData(b):g.icon=b});l.data?this._gotIconData(l):this._state=$e(l,this._state.inline,this._state)}_gotIconData(c){this._checkQueued=!1,this._renderIcon(c,Se(this),this.getAttribute("mode"))}_renderIcon(c,l,u){const d=Rn(c.data.body,u),p=this._state.inline;Be(this._shadowRoot,this._state={rendered:!0,icon:c,inline:p,customisations:l,attrMode:u,renderedMode:d})}};o.forEach(a=>{a in s.prototype||Object.defineProperty(s.prototype,a,{get:function(){return this.getAttribute(a)},set:function(c){c!==null?this.setAttribute(a,c):this.removeAttribute(a)}})});const i=ut();for(const a in i)s[a]=s.prototype[a]=i[a];return t.define(e,s),s}eo()||ut();const to=f.shape({appLogo:f.node,appName:f.string,theme:f.shape({background:f.string}),enableConnect:f.bool,enableLocale:f.bool,navigation:f.arrayOf(f.shape({title:f.oneOfType([f.string,f.object]),link:f.oneOfType([f.string,f.object]),icon:f.string,items:f.arrayOf(f.shape({title:f.oneOfType([f.string,f.object]),link:f.oneOfType([f.string,f.object])}))}))}),pt=f.shape({showText:f.bool,showRole:f.bool,switchDid:f.bool,switchProfile:f.bool,switchPassport:f.bool,disableLogout:f.bool,onLogin:f.func,onLogout:f.func,onSwitchDid:f.func,onSwitchProfile:f.func,onSwitchPassport:f.func,menu:f.array,menuRender:f.func,dark:f.bool,size:f.number}),H=(e,t,n="children")=>e.map(r=>Array.isArray(r[n])?t({...r,[n]:H(r[n],t,n)}):t(r)),no=(e,t="children")=>{const n=[];return H(e,r=>n.push(r),t),n},ye=(e,t,n="children")=>e.map(r=>({...r})).filter(r=>{const o=r[n];if(Array.isArray(o)){const i=ye(o,t,n);r[n]=i!=null&&i.length?i:void 0}const s={filteredChildren:r[n],isLeaf:!(o!=null&&o.length)};return t(r,s)}),oo=e=>/^https?:\/\//.test(e),ro=e=>{if(!e||!(e!=null&&e.startsWith("/")))return!1;const t=o=>o.endsWith("/")?o:`${o}/`,n=t(window.location.pathname),r=t(new URL(e,window.location.origin).pathname);return n.startsWith(r)},so=(e=[])=>{const t=e.map((r,o)=>({path:r,index:o})).filter(r=>ro(r.path));return t!=null&&t.length?t.slice(1).reduce((r,o)=>r.path.length>=o.path.length?r:o,t[0]).index:-1};var ze,He;const de=((ze=window==null?void 0:window.blocklet)==null?void 0:ze.groupPrefix)||((He=window==null?void 0:window.blocklet)==null?void 0:He.prefix)||"/",io=e=>{const t={...e},n=e==null?void 0:e.background;return typeof n=="string"?t.background={header:n,footer:n,default:n}:n&&typeof n=="object"&&(t.background={header:n.header||n.default,footer:n.footer||n.default,default:n.default}),t},ht=(e,t="en")=>{if(!(e!=null&&e.length))return e;const n=(o,s)=>typeof o=="string"?o:typeof o=="object"?o[s]||(o==null?void 0:o.en)||(o==null?void 0:o.zh):o,r=(o,s)=>{if(typeof o=="string"){if(oo(o)){const a=new URL(o);return a.searchParams.set("locale",s),a.href}const i=new URL(o,window.location.origin);return i.searchParams.set("locale",s),i.pathname+i.search}return typeof o=="object"?o[s]||(o==null?void 0:o.en)||(o==null?void 0:o.zh):o};return H(e,o=>{var s;return{...o,title:n(o.title,t),link:(s=o.items)!=null&&s.length?o.link:r(o.link,t),_rawLink:o.link}},"items")},co=e=>H(e,t=>t.role?{...t,role:Array.isArray(t.role)?t.role:[t.role]}:t,"items"),ao=e=>{if(!(e!=null&&e.length))return null;const t=co(e),n={header:[],footer:[],social:[],bottom:[],dashboard:[],sessionManager:[],userCenter:[]};return t.forEach(r=>{var o;r.section?Array.isArray(r.section)?r.section.forEach(s=>{var i;(i=n[s])==null||i.push(r)}):typeof r.section=="string"&&((o=n[r.section])==null||o.push(r)):n.header.push(r)}),n},lo=e=>{if(!e)return null;const t={...e};return t.theme=io(t.theme),t.navigation=ao(uo(t.navigation)),t},uo=(e=[])=>ye(e,(t,n)=>{var r;return!!t.link||((r=n.filteredChildren)==null?void 0:r.length)},"items"),gt=(e,t)=>ye(e,(n,r)=>{var s;const o=!n.role||t&&n.role.includes(t);return r.isLeaf?o:o&&((s=r.filteredChildren)==null?void 0:s.length)},"items"),fo={top:-960,width:960,height:960,body:'<path fill="currentColor" d="M510-600v-210q0-12.75 8.625-21.375T540-840h270q12.75 0 21.375 8.625T840-810v210q0 12.75-8.625 21.375T810-570H540q-12.75 0-21.375-8.625T510-600M120-480v-330q0-12.75 8.625-21.375T150-840h270q12.75 0 21.375 8.625T450-810v330q0 12.75-8.625 21.375T420-450H150q-12.75 0-21.375-8.625T120-480m390 330v-330q0-12.75 8.625-21.375T540-510h270q12.75 0 21.375 8.625T840-480v330q0 12.75-8.625 21.375T810-120H540q-12.75 0-21.375-8.625T510-150m-390 0v-210q0-12.75 8.625-21.375T150-390h270q12.75 0 21.375 8.625T450-360v210q0 12.75-8.625 21.375T420-120H150q-12.75 0-21.375-8.625T120-150m60-360h210v-270H180zm390 330h210v-270H570zm0-450h210v-150H570zM180-180h210v-150H180zm210-150"/>'},po={width:24,height:24,body:'<path fill="currentColor" d="M15.95 12.3L11.7 8.05q-.15-.15-.212-.325t-.063-.375q0-.2.063-.375t.212-.325l4.25-4.25q.15-.15.325-.212t.375-.063q.2 0 .375.063t.325.212l4.25 4.25q.15.15.213.325t.062.375q0 .2-.063.375t-.212.325l-4.25 4.25q-.15.15-.325.213t-.375.062q-.2 0-.375-.062t-.325-.213ZM3 10V4q0-.425.288-.713T4 3h6q.425 0 .713.288T11 4v6q0 .425-.288.713T10 11H4q-.425 0-.713-.288T3 10Zm10 10v-6q0-.425.288-.713T14 13h6q.425 0 .713.288T21 14v6q0 .425-.288.713T20 21h-6q-.425 0-.713-.288T13 20ZM3 20v-6q0-.425.288-.713T4 13h6q.425 0 .713.288T11 14v6q0 .425-.288.713T10 21H4q-.425 0-.713-.288T3 20ZM5 9h4V5H5v4Zm11.675 1.2L19.5 7.375L16.675 4.55L13.85 7.375l2.825 2.825ZM15 19h4v-4h-4v4ZM5 19h4v-4H5v4ZM9 9Zm4.85-1.625ZM9 15Zm6 0Z"/>'};function xe({session:e,locale:t,size:n}){const r=(window==null?void 0:window.blocklet)||{},o=(r.navigation||[]).filter(c=>c.section==="sessionManager"&&!["/sessionManager"].includes(c.id)).filter(c=>{var l;return!!((c==null?void 0:c.role)||[]).includes(((l=e==null?void 0:e.user)==null?void 0:l.role)||"guest")}).map(c=>{const l=((r==null?void 0:r.componentMountPoints)||[]).find(u=>c.component===u.name);return{...c,component:l}}),s=A.useRef(null),i=kt({open:!1}),a=Pt((c=!i.open)=>{i.open=c});return o.length===0||!(e!=null&&e.user)?null:m.jsxs(m.Fragment,{children:[m.jsx(jt,{size:"medium",ref:s,onClick:()=>a(),children:m.jsx(Ce,{icon:fo,fontSize:n,style:{transform:"scale(1.08)"}})}),m.jsx(Lt,{open:i.open,onClose:()=>a(!1),anchorEl:s.current,transition:!0,placement:"bottom-end",sx:{zIndex:1600},children:({TransitionProps:c})=>m.jsx(Mt,{onClickAway:l=>{l.preventDefault(),l.stopPropagation(),a(!1)},children:m.jsx(Ot,{...c,timeout:350,children:m.jsxs(Rt,{variant:"outlined",sx:{borderRadius:3,width:350,maxWidth:"90vw",borderColor:k.lineStep,p:2,border:"0 !important",boxShadow:`0px 8px 16px 0px ${k.gray6}, 0px 0px 0px 1px ${k.gray6}`},children:[m.jsx(Et,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, 100px)",gridAutoRows:"minmax(100px, max-content)",justifyContent:"space-between",maxHeight:350,overflowY:"auto",p:0},children:o.map(l=>{var u;return m.jsx(Gt,{disablePadding:!0,children:m.jsxs(Kt,{href:l.link,sx:{p:1,display:"flex",flexDirection:"column",alignItems:"center",gap:1,width:"100%",height:"100%",borderRadius:2,"&:hover":{backgroundColor:k.surfacePrimarySubtitle}},children:[(u=l==null?void 0:l.component)!=null&&u.did?m.jsx(Nt,{component:"img",src:`${_t}/blocklet/logo-bundle/${l.component.did}`,sx:{borderRadius:2,width:50,height:50,objectFit:"contain"}}):m.jsx(Ce,{fontSize:50,icon:l.icon||po,color:k.textSubtitle}),m.jsx(qt,{sx:{fontSize:"12px",color:k.textBase,textAlign:"center",lineHeight:"normal"},children:Ft(l.title,t)})]})},l.id)})}),m.jsx(Bt,{session:e,children:m.jsx($t,{variant:"outlined",fullWidth:!0,href:zt,sx:{mt:1,borderRadius:2,color:k.textBase,borderColor:k.lineBorderStrong,"&:hover":{color:k.primaryBase,borderColor:k.primaryBase}},children:t==="zh"?"管理":"Manage"})})]})})})})]})}xe.propTypes={session:f.object.isRequired,locale:f.string,size:f.number};xe.defaultProps={locale:"en",size:24};function we({formattedBlocklet:e,addons:t,sessionManagerProps:n}){var p,g,b,x;const r=A.useContext(De),{locale:o}=Ve()||{},{enableConnect:s=!0,enableLocale:i=!0}=e,a=!!((p=r==null?void 0:r.session)!=null&&p.user);let c=ht((g=e==null?void 0:e.navigation)==null?void 0:g.sessionManager,o)||[];c=gt(c,(x=(b=r==null?void 0:r.session)==null?void 0:b.user)==null?void 0:x.role);const u=(()=>{if(t&&typeof t!="function")return Array.isArray(t)?t:[t];let I=[];if(i&&o&&I.push(m.jsx(Wt,{showText:!1},"locale-selector")),s&&r){const T=[];a&&(c?c.slice(0,5):[]).forEach(y=>{T.push({label:y.title,icon:y.icon?m.jsx("iconify-icon",{icon:y.icon,height:24,style:{marginRight:8}}):null,component:"a",href:y.link,key:y.link})}),I.push(m.jsx(xe,{session:r.session,locale:o},"session-blocklet")),I.push(m.jsx(Ht,{session:r.session,locale:o,menu:T,showRole:!0,...n},"session-user"))}return typeof t=="function"&&(I=t(I)||[]),I})();return A.createElement(m.Fragment,null,...Array.isArray(u)?u:[u])}we.propTypes={formattedBlocklet:f.object.isRequired,addons:f.oneOfType([f.func,f.node]),sessionManagerProps:pt};we.defaultProps={addons:null,sessionManagerProps:{showRole:!0}};const ho=()=>{const e=Dt();A.useEffect(()=>{e.wallet&&Vt.call("arcHideTopBar","{}")},[e])};function mt({meta:e,fallbackUrl:t,invalidPathFallback:n,headerAddons:r,sessionManagerProps:o,links:s,...i}){var O;ho();const a=A.useContext(De),c=(O=a==null?void 0:a.session)==null?void 0:O.user,l=c==null?void 0:c.role,{locale:u}=Ve()||{},d=A.useMemo(()=>{const C=Object.assign({},window.blocklet,e);try{return lo(C)}catch(h){return console.error("Failed to format blocklet info",h,C),C}},[e]),{localizedNav:p,flattened:g,matchedIndex:b}=A.useMemo(()=>{var P;let C=ht((P=d==null?void 0:d.navigation)==null?void 0:P.dashboard,u)||[];C=gt(C,l),C=H(C,S=>({title:S.title,url:S.link,icon:S.icon?m.jsx("iconify-icon",{height:"100%",width:"100%",icon:S.icon}):null,external:!0,children:S.items}),"items");const h=no(C).filter(S=>!!S.url),v=so(h.map(S=>S.url));return v!==-1&&(h[v].active=!0),{localizedNav:C,flattened:h,matchedIndex:v}},[d,u,l]),x=typeof s=="function"?s(p):[...p,...s];if(A.useLayoutEffect(()=>{c&&!(g!=null&&g.length)&&t&&(window.location.href=t)},[t]),A.useLayoutEffect(()=>{c&&(g!=null&&g.length)&&b===-1&&n&&n()},[n,g,b]),!d.appName)return null;const{appLogo:I,appLogoRect:T,appName:w}=d,y=m.jsx(we,{formattedBlocklet:d,addons:r,sessionManagerProps:o});return m.jsx(Ut,{title:w,fullWidth:!0,sidebarWidth:128,legacy:!1,links:x,...i,headerProps:{homeLink:de,logo:m.jsx("img",{src:T||I,alt:"logo"}),addons:y,...i.headerProps}})}mt.propTypes={meta:to,fallbackUrl:f.string,invalidPathFallback:f.func,headerAddons:f.oneOfType([f.func,f.node]),sessionManagerProps:pt,links:f.oneOfType([f.array,f.func])};mt.defaultProps={meta:{},fallbackUrl:de,invalidPathFallback:null,headerAddons:void 0,sessionManagerProps:{showRole:!0,onLogout:()=>{window.location.href=de}},links:[]};export{to as B,mt as D,we as H,Kt as L,no as a,so as b,lo as f,ht as g,oo as i,H as m,de as p,ho as u};
11
+ */const Ue=Object.freeze({left:0,top:0,width:16,height:16}),Z=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),$=Object.freeze({...Ue,...Z}),re=Object.freeze({...$,body:"",hidden:!1}),en=Object.freeze({width:null,height:null}),Qe=Object.freeze({...en,...Z});function tn(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(o){for(;o<0;)o+=4;return o%4}if(n===""){const o=parseInt(e);return isNaN(o)?0:r(o)}else if(n!==e){let o=0;switch(n){case"%":o=25;break;case"deg":o=90}if(o){let s=parseFloat(e.slice(0,e.length-n.length));return isNaN(s)?0:(s=s/o,s%1===0?r(s):0)}}return t}const nn=/[\s,]+/;function on(e,t){t.split(nn).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}const Ge={...Qe,preserveAspectRatio:""};function Se(e){const t={...Ge},n=(r,o)=>e.getAttribute(r)||o;return t.width=n("width",null),t.height=n("height",null),t.rotate=tn(n("rotate","")),on(t,n("flip","")),t.preserveAspectRatio=n("preserveAspectRatio",n("preserveaspectratio","")),t}function rn(e,t){for(const n in Ge)if(e[n]!==t[n])return!0;return!1}const N=/^[a-z0-9]+(-[a-z0-9]+)*$/,z=(e,t,n,r="")=>{const o=e.split(":");if(e.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;r=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const a=o.pop(),c=o.pop(),l={provider:o.length>0?o[0]:r,prefix:c,name:a};return t&&!Q(l)?null:l}const s=o[0],i=s.split("-");if(i.length>1){const a={provider:r,prefix:i.shift(),name:i.join("-")};return t&&!Q(a)?null:a}if(n&&r===""){const a={provider:r,prefix:"",name:s};return t&&!Q(a,n)?null:a}return null},Q=(e,t)=>e?!!((e.provider===""||e.provider.match(N))&&(t&&e.prefix===""||e.prefix.match(N))&&e.name.match(N)):!1;function sn(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function Te(e,t){const n=sn(e,t);for(const r in re)r in Z?r in e&&!(r in n)&&(n[r]=Z[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function cn(e,t){const n=e.icons,r=e.aliases||Object.create(null),o=Object.create(null);function s(i){if(n[i])return o[i]=[];if(!(i in o)){o[i]=null;const a=r[i]&&r[i].parent,c=a&&s(a);c&&(o[i]=[a].concat(c))}return o[i]}return Object.keys(n).concat(Object.keys(r)).forEach(s),o}function an(e,t,n){const r=e.icons,o=e.aliases||Object.create(null);let s={};function i(a){s=Te(r[a]||o[a],s)}return i(t),n.forEach(i),Te(e,s)}function We(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(o=>{t(o,null),n.push(o)});const r=cn(e);for(const o in r){const s=r[o];s&&(t(o,an(e,o,s)),n.push(o))}return n}const ln={provider:"",aliases:{},not_found:{},...Ue};function ee(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function Ze(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!ee(e,ln))return null;const n=t.icons;for(const o in n){const s=n[o];if(!o.match(N)||typeof s.body!="string"||!ee(s,re))return null}const r=t.aliases||Object.create(null);for(const o in r){const s=r[o],i=s.parent;if(!o.match(N)||typeof i!="string"||!n[i]&&!r[i]||!ee(s,re))return null}return t}const J=Object.create(null);function un(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function P(e,t){const n=J[e]||(J[e]=Object.create(null));return n[t]||(n[t]=un(e,t))}function pe(e,t){return Ze(t)?We(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function fn(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}function dn(e,t){let n=[];return(typeof e=="string"?[e]:Object.keys(J)).forEach(o=>{(typeof o=="string"&&typeof t=="string"?[t]:Object.keys(J[o]||{})).forEach(i=>{const a=P(o,i);n=n.concat(Object.keys(a.icons).map(c=>(o!==""?"@"+o+":":"")+i+":"+c))})}),n}let q=!1;function Je(e){return typeof e=="boolean"&&(q=e),q}function F(e){const t=typeof e=="string"?z(e,!0,q):e;if(t){const n=P(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function Xe(e,t){const n=z(e,!0,q);if(!n)return!1;const r=P(n.provider,n.prefix);return fn(r,n.name,t)}function Ae(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),q&&!t&&!e.prefix){let o=!1;return Ze(e)&&(e.prefix="",We(e,(s,i)=>{i&&Xe(s,i)&&(o=!0)})),o}const n=e.prefix;if(!Q({provider:t,prefix:n,name:"a"}))return!1;const r=P(t,n);return!!pe(r,e)}function pn(e){return!!F(e)}function hn(e){const t=F(e);return t?{...$,...t}:null}function gn(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((o,s)=>o.provider!==s.provider?o.provider.localeCompare(s.provider):o.prefix!==s.prefix?o.prefix.localeCompare(s.prefix):o.name.localeCompare(s.name));let r={provider:"",prefix:"",name:""};return e.forEach(o=>{if(r.name===o.name&&r.prefix===o.prefix&&r.provider===o.provider)return;r=o;const s=o.provider,i=o.prefix,a=o.name,c=n[s]||(n[s]=Object.create(null)),l=c[i]||(c[i]=P(s,i));let u;a in l.icons?u=t.loaded:i===""||l.missing.has(a)?u=t.missing:u=t.pending;const d={provider:s,prefix:i,name:a};u.push(d)}),t}function Ye(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(o=>o.id!==t))})}function mn(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const r=e.provider,o=e.prefix;t.forEach(s=>{const i=s.icons,a=i.pending.length;i.pending=i.pending.filter(c=>{if(c.prefix!==o)return!0;const l=c.name;if(e.icons[l])i.loaded.push({provider:r,prefix:o,name:l});else if(e.missing.has(l))i.missing.push({provider:r,prefix:o,name:l});else return n=!0,!0;return!1}),i.pending.length!==a&&(n||Ye([e],s.id),s.callback(i.loaded.slice(0),i.missing.slice(0),i.pending.slice(0),s.abort))})}))}let bn=0;function yn(e,t,n){const r=bn++,o=Ye.bind(null,n,r);if(!t.pending.length)return o;const s={id:r,icons:t,callback:e,abort:o};return n.forEach(i=>{(i.loaderCallbacks||(i.loaderCallbacks=[])).push(s)}),o}const se=Object.create(null);function je(e,t){se[e]=t}function ie(e){return se[e]||se[""]}function xn(e,t=!0,n=!1){const r=[];return e.forEach(o=>{const s=typeof o=="string"?z(o,t,n):o;s&&r.push(s)}),r}var wn={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function vn(e,t,n,r){const o=e.resources.length,s=e.random?Math.floor(Math.random()*o):e.index;let i;if(e.random){let h=e.resources.slice(0);for(i=[];h.length>1;){const v=Math.floor(Math.random()*h.length);i.push(h[v]),h=h.slice(0,v).concat(h.slice(v+1))}i=i.concat(h)}else i=e.resources.slice(s).concat(e.resources.slice(0,s));const a=Date.now();let c="pending",l=0,u,d=null,p=[],g=[];typeof r=="function"&&g.push(r);function b(){d&&(clearTimeout(d),d=null)}function x(){c==="pending"&&(c="aborted"),b(),p.forEach(h=>{h.status==="pending"&&(h.status="aborted")}),p=[]}function I(h,v){v&&(g=[]),typeof h=="function"&&g.push(h)}function T(){return{startTime:a,payload:t,status:c,queriesSent:l,queriesPending:p.length,subscribe:I,abort:x}}function w(){c="failed",g.forEach(h=>{h(void 0,u)})}function y(){p.forEach(h=>{h.status==="pending"&&(h.status="aborted")}),p=[]}function O(h,v,k){const S=v!=="success";switch(p=p.filter(L=>L!==h),c){case"pending":break;case"failed":if(S||!e.dataAfterTimeout)return;break;default:return}if(v==="abort"){u=k,w();return}if(S){u=k,p.length||(i.length?C():w());return}if(b(),y(),!e.random){const L=e.resources.indexOf(h.resource);L!==-1&&L!==e.index&&(e.index=L)}c="completed",g.forEach(L=>{L(k)})}function C(){if(c!=="pending")return;b();const h=i.shift();if(h===void 0){if(p.length){d=setTimeout(()=>{b(),c==="pending"&&(y(),w())},e.timeout);return}w();return}const v={status:"pending",resource:h,callback:(k,S)=>{O(v,k,S)}};p.push(v),l++,d=setTimeout(C,e.rotate),n(h,t,v.callback)}return setTimeout(C),T}function Ke(e){const t={...wn,...e};let n=[];function r(){n=n.filter(a=>a().status==="pending")}function o(a,c,l){const u=vn(t,a,c,(d,p)=>{r(),l&&l(d,p)});return n.push(u),u}function s(a){return n.find(c=>a(c))||null}return{query:o,find:s,setIndex:a=>{t.index=a},getIndex:()=>t.index,cleanup:r}}function he(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const Y=Object.create(null),E=["https://api.simplesvg.com","https://api.unisvg.com"],G=[];for(;E.length>0;)E.length===1||Math.random()>.5?G.push(E.shift()):G.push(E.pop());Y[""]=he({resources:["https://api.iconify.design"].concat(G)});function ke(e,t){const n=he(t);return n===null?!1:(Y[e]=n,!0)}function K(e){return Y[e]}function In(){return Object.keys(Y)}function Pe(){}const te=Object.create(null);function Cn(e){if(!te[e]){const t=K(e);if(!t)return;const n=Ke(t),r={config:t,redundancy:n};te[e]=r}return te[e]}function et(e,t,n){let r,o;if(typeof e=="string"){const s=ie(e);if(!s)return n(void 0,424),Pe;o=s.send;const i=Cn(e);i&&(r=i.redundancy)}else{const s=he(e);if(s){r=Ke(s);const i=e.resources?e.resources[0]:"",a=ie(i);a&&(o=a.send)}}return!r||!o?(n(void 0,424),Pe):r.query(t,o,n)().abort}const Le="iconify2",B="iconify",tt=B+"-count",Me=B+"-version",nt=36e5,Sn=168;function ce(e,t){try{return e.getItem(t)}catch{}}function ge(e,t,n){try{return e.setItem(t,n),!0}catch{}}function Oe(e,t){try{e.removeItem(t)}catch{}}function ae(e,t){return ge(e,tt,t.toString())}function le(e){return parseInt(ce(e,tt))||0}const M={local:!0,session:!0},ot={local:new Set,session:new Set};let me=!1;function Tn(e){me=e}let U=typeof window>"u"?{}:window;function rt(e){const t=e+"Storage";try{if(U&&U[t]&&typeof U[t].length=="number")return U[t]}catch{}M[e]=!1}function st(e,t){const n=rt(e);if(!n)return;const r=ce(n,Me);if(r!==Le){if(r){const a=le(n);for(let c=0;c<a;c++)Oe(n,B+c.toString())}ge(n,Me,Le),ae(n,0);return}const o=Math.floor(Date.now()/nt)-Sn,s=a=>{const c=B+a.toString(),l=ce(n,c);if(typeof l=="string"){try{const u=JSON.parse(l);if(typeof u=="object"&&typeof u.cached=="number"&&u.cached>o&&typeof u.provider=="string"&&typeof u.data=="object"&&typeof u.data.prefix=="string"&&t(u,a))return!0}catch{}Oe(n,c)}};let i=le(n);for(let a=i-1;a>=0;a--)s(a)||(a===i-1?(i--,ae(n,i)):ot[e].add(a))}function it(){if(!me){Tn(!0);for(const e in M)st(e,t=>{const n=t.data,r=t.provider,o=n.prefix,s=P(r,o);if(!pe(s,n).length)return!1;const i=n.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,i):i,!0})}}function An(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const r in M)st(r,o=>{const s=o.data;return o.provider!==e.provider||s.prefix!==e.prefix||s.lastModified===t});return!0}function jn(e,t){me||it();function n(r){let o;if(!M[r]||!(o=rt(r)))return;const s=ot[r];let i;if(s.size)s.delete(i=Array.from(s).shift());else if(i=le(o),!ae(o,i+1))return;const a={cached:Math.floor(Date.now()/nt),provider:e.provider,data:t};return ge(o,B+i.toString(),JSON.stringify(a))}t.lastModified&&!An(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function Re(){}function kn(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,mn(e)}))}function Pn(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:r}=e,o=e.iconsToLoad;delete e.iconsToLoad;let s;if(!o||!(s=ie(n)))return;s.prepare(n,r,o).forEach(a=>{et(n,a,c=>{if(typeof c!="object")a.icons.forEach(l=>{e.missing.add(l)});else try{const l=pe(e,c);if(!l.length)return;const u=e.pendingIcons;u&&l.forEach(d=>{u.delete(d)}),jn(e,c)}catch(l){console.error(l)}kn(e)})})}))}const be=(e,t)=>{const n=xn(e,!0,Je()),r=gn(n);if(!r.pending.length){let c=!0;return t&&setTimeout(()=>{c&&t(r.loaded,r.missing,r.pending,Re)}),()=>{c=!1}}const o=Object.create(null),s=[];let i,a;return r.pending.forEach(c=>{const{provider:l,prefix:u}=c;if(u===a&&l===i)return;i=l,a=u,s.push(P(l,u));const d=o[l]||(o[l]=Object.create(null));d[u]||(d[u]=[])}),r.pending.forEach(c=>{const{provider:l,prefix:u,name:d}=c,p=P(l,u),g=p.pendingIcons||(p.pendingIcons=new Set);g.has(d)||(g.add(d),o[l][u].push(d))}),s.forEach(c=>{const{provider:l,prefix:u}=c;o[l][u].length&&Pn(c,o[l][u])}),t?yn(t,r,s):Re},Ln=e=>new Promise((t,n)=>{const r=typeof e=="string"?z(e,!0):e;if(!r){n(e);return}be([r||e],o=>{if(o.length&&r){const s=F(r);if(s){t({...$,...s});return}}n(e)})});function Mn(e){try{const t=typeof e=="string"?JSON.parse(e):e;if(typeof t.body=="string")return{...t}}catch{}}function On(e,t){const n=typeof e=="string"?z(e,!0,!0):null;if(!n){const s=Mn(e);return{value:e,data:s}}const r=F(n);if(r!==void 0||!n.prefix)return{value:e,name:n,data:r};const o=be([n],()=>t(e,n,F(n)));return{value:e,name:n,loading:o}}function ne(e){return e.hasAttribute("inline")}let ct=!1;try{ct=navigator.vendor.indexOf("Apple")===0}catch{}function Rn(e,t){switch(t){case"svg":case"bg":case"mask":return t}return t!=="style"&&(ct||e.indexOf("<a")===-1)?"svg":e.indexOf("currentColor")===-1?"bg":"mask"}const En=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Nn=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function ue(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(En);if(r===null||!r.length)return e;const o=[];let s=r.shift(),i=Nn.test(s);for(;;){if(i){const a=parseFloat(s);isNaN(a)?o.push(s):o.push(Math.ceil(a*t*n)/n)}else o.push(s);if(s=r.shift(),s===void 0)return o.join("");i=!i}}const _n=e=>e==="unset"||e==="undefined"||e==="none";function at(e,t){const n={...$,...e},r={...Qe,...t},o={left:n.left,top:n.top,width:n.width,height:n.height};let s=n.body;[n,r].forEach(b=>{const x=[],I=b.hFlip,T=b.vFlip;let w=b.rotate;I?T?w+=2:(x.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),x.push("scale(-1 1)"),o.top=o.left=0):T&&(x.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),x.push("scale(1 -1)"),o.top=o.left=0);let y;switch(w<0&&(w-=Math.floor(w/4)*4),w=w%4,w){case 1:y=o.height/2+o.top,x.unshift("rotate(90 "+y.toString()+" "+y.toString()+")");break;case 2:x.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:y=o.width/2+o.left,x.unshift("rotate(-90 "+y.toString()+" "+y.toString()+")");break}w%2===1&&(o.left!==o.top&&(y=o.left,o.left=o.top,o.top=y),o.width!==o.height&&(y=o.width,o.width=o.height,o.height=y)),x.length&&(s='<g transform="'+x.join(" ")+'">'+s+"</g>")});const i=r.width,a=r.height,c=o.width,l=o.height;let u,d;i===null?(d=a===null?"1em":a==="auto"?l:a,u=ue(d,c/l)):(u=i==="auto"?c:i,d=a===null?ue(u,l/c):a==="auto"?l:a);const p={},g=(b,x)=>{_n(x)||(p[b]=x.toString())};return g("width",u),g("height",d),p.viewBox=o.left.toString()+" "+o.top.toString()+" "+c.toString()+" "+l.toString(),{attributes:p,body:s}}const qn=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let X=qn();function Fn(e){X=e}function Bn(){return X}function $n(e,t){const n=K(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let o=0;n.resources.forEach(i=>{o=Math.max(o,i.length)});const s=t+".json?icons=";r=n.maxURL-o-n.path.length-s.length}return r}function zn(e){return e===404}const Hn=(e,t,n)=>{const r=[],o=$n(e,t),s="icons";let i={type:s,provider:e,prefix:t,icons:[]},a=0;return n.forEach((c,l)=>{a+=c.length+1,a>=o&&l>0&&(r.push(i),i={type:s,provider:e,prefix:t,icons:[]},a=c.length),i.icons.push(c)}),r.push(i),r};function Dn(e){if(typeof e=="string"){const t=K(e);if(t)return t.path}return"/"}const Vn=(e,t,n)=>{if(!X){n("abort",424);return}let r=Dn(t.provider);switch(t.type){case"icons":{const s=t.prefix,a=t.icons.join(","),c=new URLSearchParams({icons:a});r+=s+".json?"+c.toString();break}case"custom":{const s=t.uri;r+=s.slice(0,1)==="/"?s.slice(1):s;break}default:n("abort",400);return}let o=503;X(e+r).then(s=>{const i=s.status;if(i!==200){setTimeout(()=>{n(zn(i)?"abort":"next",i)});return}return o=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?n("abort",s):n("next",o)});return}setTimeout(()=>{n("success",s)})}).catch(()=>{n("next",o)})},Un={prepare:Hn,send:Vn};function Ee(e,t){switch(e){case"local":case"session":M[e]=t;break;case"all":for(const n in M)M[n]=t;break}}const oe="data-style";let lt="";function Qn(e){lt=e}function Ne(e,t){let n=Array.from(e.childNodes).find(r=>r.hasAttribute&&r.hasAttribute(oe));n||(n=document.createElement("style"),n.setAttribute(oe,oe),e.appendChild(n)),n.textContent=":host{display:inline-block;vertical-align:"+(t?"-0.125em":"0")+"}span,svg{display:block}"+lt}function ut(){je("",Un),Je(!0);let e;try{e=window}catch{}if(e){if(it(),e.IconifyPreload!==void 0){const n=e.IconifyPreload,r="Invalid IconifyPreload syntax.";typeof n=="object"&&n!==null&&(n instanceof Array?n:[n]).forEach(o=>{try{(typeof o!="object"||o===null||o instanceof Array||typeof o.icons!="object"||typeof o.prefix!="string"||!Ae(o))&&console.error(r)}catch{console.error(r)}})}if(e.IconifyProviders!==void 0){const n=e.IconifyProviders;if(typeof n=="object"&&n!==null)for(const r in n){const o="IconifyProviders["+r+"] is invalid.";try{const s=n[r];if(typeof s!="object"||!s||s.resources===void 0)continue;ke(r,s)||console.error(o)}catch{console.error(o)}}}}return{enableCache:n=>Ee(n,!0),disableCache:n=>Ee(n,!1),iconExists:pn,getIcon:hn,listIcons:dn,addIcon:Xe,addCollection:Ae,calculateSize:ue,buildIcon:at,loadIcons:be,loadIcon:Ln,addAPIProvider:ke,appendCustomStyle:Qn,_api:{getAPIConfig:K,setAPIModule:je,sendAPIQuery:et,setFetch:Fn,getFetch:Bn,listAPIProviders:In}}}function ft(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}function Gn(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function Wn(e){return"data:image/svg+xml,"+Gn(e)}function Zn(e){return'url("'+Wn(e)+'")'}const fe={"background-color":"currentColor"},dt={"background-color":"transparent"},_e={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},qe={"-webkit-mask":fe,mask:fe,background:dt};for(const e in qe){const t=qe[e];for(const n in _e)t[e+"-"+n]=_e[n]}function Fe(e){return e?e+(e.match(/^[-0-9.]+$/)?"px":""):"inherit"}function Jn(e,t,n){const r=document.createElement("span");let o=e.body;o.indexOf("<a")!==-1&&(o+="<!-- "+Date.now()+" -->");const s=e.attributes,i=ft(o,{...s,width:t.width+"",height:t.height+""}),a=Zn(i),c=r.style,l={"--svg":a,width:Fe(s.width),height:Fe(s.height),...n?fe:dt};for(const u in l)c.setProperty(u,l[u]);return r}let _;function Xn(){try{_=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{_=null}}function Yn(e){return _===void 0&&Xn(),_?_.createHTML(e):e}function Kn(e){const t=document.createElement("span"),n=e.attributes;let r="";n.width||(r="width: inherit;"),n.height||(r+="height: inherit;"),r&&(n.style=r);const o=ft(e.body,n);return t.innerHTML=Yn(o),t.firstChild}function Be(e,t){const n=t.icon.data,r=t.customisations,o=at(n,r);r.preserveAspectRatio&&(o.attributes.preserveAspectRatio=r.preserveAspectRatio);const s=t.renderedMode;let i;switch(s){case"svg":i=Kn(o);break;default:i=Jn(o,{...$,...n},s==="mask")}const a=Array.from(e.childNodes).find(c=>{const l=c.tagName&&c.tagName.toUpperCase();return l==="SPAN"||l==="SVG"});a?i.tagName==="SPAN"&&a.tagName===i.tagName?a.setAttribute("style",i.getAttribute("style")):e.replaceChild(i,a):e.appendChild(i)}function $e(e,t,n){const r=n&&(n.rendered?n:n.lastRender);return{rendered:!1,inline:t,icon:e,lastRender:r}}function eo(e="iconify-icon"){let t,n;try{t=window.customElements,n=window.HTMLElement}catch{return}if(!t||!n)return;const r=t.get(e);if(r)return r;const o=["icon","mode","inline","width","height","rotate","flip"],s=class extends n{constructor(){super();D(this,"_shadowRoot");D(this,"_state");D(this,"_checkQueued",!1);const c=this._shadowRoot=this.attachShadow({mode:"open"}),l=ne(this);Ne(c,l),this._state=$e({value:""},l),this._queueCheck()}static get observedAttributes(){return o.slice(0)}attributeChangedCallback(c){if(c==="inline"){const l=ne(this),u=this._state;l!==u.inline&&(u.inline=l,Ne(this._shadowRoot,l))}else this._queueCheck()}get icon(){const c=this.getAttribute("icon");if(c&&c.slice(0,1)==="{")try{return JSON.parse(c)}catch{}return c}set icon(c){typeof c=="object"&&(c=JSON.stringify(c)),this.setAttribute("icon",c)}get inline(){return ne(this)}set inline(c){c?this.setAttribute("inline","true"):this.removeAttribute("inline")}restartAnimation(){const c=this._state;if(c.rendered){const l=this._shadowRoot;if(c.renderedMode==="svg")try{l.lastChild.setCurrentTime(0);return}catch{}Be(l,c)}}get status(){const c=this._state;return c.rendered?"rendered":c.icon.data===null?"failed":"loading"}_queueCheck(){this._checkQueued||(this._checkQueued=!0,setTimeout(()=>{this._check()}))}_check(){if(!this._checkQueued)return;this._checkQueued=!1;const c=this._state,l=this.getAttribute("icon");if(l!==c.icon.value){this._iconChanged(l);return}if(!c.rendered)return;const u=this.getAttribute("mode"),d=Se(this);(c.attrMode!==u||rn(c.customisations,d))&&this._renderIcon(c.icon,d,u)}_iconChanged(c){const l=On(c,(u,d,p)=>{const g=this._state;if(g.rendered||this.getAttribute("icon")!==u)return;const b={value:u,name:d,data:p};b.data?this._gotIconData(b):g.icon=b});l.data?this._gotIconData(l):this._state=$e(l,this._state.inline,this._state)}_gotIconData(c){this._checkQueued=!1,this._renderIcon(c,Se(this),this.getAttribute("mode"))}_renderIcon(c,l,u){const d=Rn(c.data.body,u),p=this._state.inline;Be(this._shadowRoot,this._state={rendered:!0,icon:c,inline:p,customisations:l,attrMode:u,renderedMode:d})}};o.forEach(a=>{a in s.prototype||Object.defineProperty(s.prototype,a,{get:function(){return this.getAttribute(a)},set:function(c){c!==null?this.setAttribute(a,c):this.removeAttribute(a)}})});const i=ut();for(const a in i)s[a]=s.prototype[a]=i[a];return t.define(e,s),s}eo()||ut();const to=f.shape({appLogo:f.node,appName:f.string,theme:f.shape({background:f.string}),enableConnect:f.bool,enableLocale:f.bool,navigation:f.arrayOf(f.shape({title:f.oneOfType([f.string,f.object]),link:f.oneOfType([f.string,f.object]),icon:f.string,items:f.arrayOf(f.shape({title:f.oneOfType([f.string,f.object]),link:f.oneOfType([f.string,f.object])}))}))}),pt=f.shape({showText:f.bool,showRole:f.bool,switchDid:f.bool,switchProfile:f.bool,switchPassport:f.bool,disableLogout:f.bool,onLogin:f.func,onLogout:f.func,onSwitchDid:f.func,onSwitchProfile:f.func,onSwitchPassport:f.func,menu:f.array,menuRender:f.func,dark:f.bool,size:f.number}),H=(e,t,n="children")=>e.map(r=>Array.isArray(r[n])?t({...r,[n]:H(r[n],t,n)}):t(r)),no=(e,t="children")=>{const n=[];return H(e,r=>n.push(r),t),n},ye=(e,t,n="children")=>e.map(r=>({...r})).filter(r=>{const o=r[n];if(Array.isArray(o)){const i=ye(o,t,n);r[n]=i!=null&&i.length?i:void 0}const s={filteredChildren:r[n],isLeaf:!(o!=null&&o.length)};return t(r,s)}),oo=e=>/^https?:\/\//.test(e),ro=e=>{if(!e||!(e!=null&&e.startsWith("/")))return!1;const t=o=>o.endsWith("/")?o:`${o}/`,n=t(window.location.pathname),r=t(new URL(e,window.location.origin).pathname);return n.startsWith(r)},so=(e=[])=>{const t=e.map((r,o)=>({path:r,index:o})).filter(r=>ro(r.path));return t!=null&&t.length?t.slice(1).reduce((r,o)=>r.path.length>=o.path.length?r:o,t[0]).index:-1};var ze,He;const de=((ze=window==null?void 0:window.blocklet)==null?void 0:ze.groupPrefix)||((He=window==null?void 0:window.blocklet)==null?void 0:He.prefix)||"/",io=e=>{const t={...e},n=e==null?void 0:e.background;return typeof n=="string"?t.background={header:n,footer:n,default:n}:n&&typeof n=="object"&&(t.background={header:n.header||n.default,footer:n.footer||n.default,default:n.default}),t},ht=(e,t="en")=>{if(!(e!=null&&e.length))return e;const n=(o,s)=>typeof o=="string"?o:typeof o=="object"?o[s]||(o==null?void 0:o.en)||(o==null?void 0:o.zh):o,r=(o,s)=>{if(typeof o=="string"){if(oo(o)){const a=new URL(o);return a.searchParams.set("locale",s),a.href}const i=new URL(o,window.location.origin);return i.searchParams.set("locale",s),i.pathname+i.search}return typeof o=="object"?o[s]||(o==null?void 0:o.en)||(o==null?void 0:o.zh):o};return H(e,o=>{var s;return{...o,title:n(o.title,t),link:(s=o.items)!=null&&s.length?o.link:r(o.link,t),_rawLink:o.link}},"items")},co=e=>H(e,t=>t.role?{...t,role:Array.isArray(t.role)?t.role:[t.role]}:t,"items"),ao=e=>{if(!(e!=null&&e.length))return null;const t=co(e),n={header:[],footer:[],social:[],bottom:[],dashboard:[],sessionManager:[],userCenter:[]};return t.forEach(r=>{var o;r.section?Array.isArray(r.section)?r.section.forEach(s=>{var i;(i=n[s])==null||i.push(r)}):typeof r.section=="string"&&((o=n[r.section])==null||o.push(r)):n.header.push(r)}),n},lo=e=>{if(!e)return null;const t={...e};return t.theme=io(t.theme),t.navigation=ao(uo(t.navigation)),t},uo=(e=[])=>ye(e,(t,n)=>{var r;return!!t.link||((r=n.filteredChildren)==null?void 0:r.length)},"items"),gt=(e,t)=>ye(e,(n,r)=>{var s;const o=!n.role||t&&n.role.includes(t);return r.isLeaf?o:o&&((s=r.filteredChildren)==null?void 0:s.length)},"items"),fo={top:-960,width:960,height:960,body:'<path fill="currentColor" d="M510-600v-210q0-12.75 8.625-21.375T540-840h270q12.75 0 21.375 8.625T840-810v210q0 12.75-8.625 21.375T810-570H540q-12.75 0-21.375-8.625T510-600M120-480v-330q0-12.75 8.625-21.375T150-840h270q12.75 0 21.375 8.625T450-810v330q0 12.75-8.625 21.375T420-450H150q-12.75 0-21.375-8.625T120-480m390 330v-330q0-12.75 8.625-21.375T540-510h270q12.75 0 21.375 8.625T840-480v330q0 12.75-8.625 21.375T810-120H540q-12.75 0-21.375-8.625T510-150m-390 0v-210q0-12.75 8.625-21.375T150-390h270q12.75 0 21.375 8.625T450-360v210q0 12.75-8.625 21.375T420-120H150q-12.75 0-21.375-8.625T120-150m60-360h210v-270H180zm390 330h210v-270H570zm0-450h210v-150H570zM180-180h210v-150H180zm210-150"/>'},po={width:24,height:24,body:'<path fill="currentColor" d="M15.95 12.3L11.7 8.05q-.15-.15-.212-.325t-.063-.375q0-.2.063-.375t.212-.325l4.25-4.25q.15-.15.325-.212t.375-.063q.2 0 .375.063t.325.212l4.25 4.25q.15.15.213.325t.062.375q0 .2-.063.375t-.212.325l-4.25 4.25q-.15.15-.325.213t-.375.062q-.2 0-.375-.062t-.325-.213ZM3 10V4q0-.425.288-.713T4 3h6q.425 0 .713.288T11 4v6q0 .425-.288.713T10 11H4q-.425 0-.713-.288T3 10Zm10 10v-6q0-.425.288-.713T14 13h6q.425 0 .713.288T21 14v6q0 .425-.288.713T20 21h-6q-.425 0-.713-.288T13 20ZM3 20v-6q0-.425.288-.713T4 13h6q.425 0 .713.288T11 14v6q0 .425-.288.713T10 21H4q-.425 0-.713-.288T3 20ZM5 9h4V5H5v4Zm11.675 1.2L19.5 7.375L16.675 4.55L13.85 7.375l2.825 2.825ZM15 19h4v-4h-4v4ZM5 19h4v-4H5v4ZM9 9Zm4.85-1.625ZM9 15Zm6 0Z"/>'};function xe({session:e,locale:t,size:n}){const r=(window==null?void 0:window.blocklet)||{},o=(r.navigation||[]).filter(c=>c.section==="sessionManager"&&!["/sessionManager"].includes(c.id)).filter(c=>{var l;return!!((c==null?void 0:c.role)||[]).includes(((l=e==null?void 0:e.user)==null?void 0:l.role)||"guest")}).map(c=>{const l=((r==null?void 0:r.componentMountPoints)||[]).find(u=>c.component===u.name);return{...c,component:l}}),s=A.useRef(null),i=jt({open:!1}),a=kt((c=!i.open)=>{i.open=c});return o.length===0||!(e!=null&&e.user)?null:m.jsxs(m.Fragment,{children:[m.jsx(Pt,{size:"medium",ref:s,onClick:()=>a(),children:m.jsx(Ce,{icon:fo,fontSize:n,style:{transform:"scale(1.08)"}})}),m.jsx(Lt,{open:i.open,onClose:()=>a(!1),anchorEl:s.current,transition:!0,placement:"bottom-end",sx:{zIndex:1600},children:({TransitionProps:c})=>m.jsx(Mt,{onClickAway:l=>{l.preventDefault(),l.stopPropagation(),a(!1)},children:m.jsx(Ot,{...c,timeout:350,children:m.jsxs(Rt,{variant:"outlined",sx:{borderRadius:3,width:350,maxWidth:"90vw",borderColor:j.lineStep,p:2,border:"0 !important",boxShadow:`0px 8px 16px 0px ${j.gray6}, 0px 0px 0px 1px ${j.gray6}`},children:[m.jsx(Et,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, 100px)",gridAutoRows:"minmax(100px, max-content)",justifyContent:"space-between",maxHeight:350,overflowY:"auto",p:0},children:o.map(l=>{var u;return m.jsx(Gt,{disablePadding:!0,children:m.jsxs(Kt,{href:l.link,sx:{p:1,display:"flex",flexDirection:"column",alignItems:"center",gap:1,width:"100%",height:"100%",borderRadius:2,"&:hover":{backgroundColor:j.surfacePrimarySubtitle}},children:[(u=l==null?void 0:l.component)!=null&&u.did?m.jsx(Nt,{component:"img",src:`${_t}/blocklet/logo-bundle/${l.component.did}`,sx:{borderRadius:2,width:50,height:50,objectFit:"contain"}}):m.jsx(Ce,{fontSize:50,icon:l.icon||po,color:j.textSubtitle}),m.jsx(qt,{sx:{fontSize:"12px",color:j.textBase,textAlign:"center",lineHeight:"normal"},children:Ft(l.title,t)})]})},l.id)})}),m.jsx(Bt,{session:e,children:m.jsx($t,{variant:"outlined",fullWidth:!0,href:zt,sx:{mt:1,borderRadius:2,color:j.textBase,borderColor:j.lineBorderStrong,"&:hover":{color:j.primaryBase,borderColor:j.primaryBase}},children:t==="zh"?"管理":"Manage"})})]})})})})]})}xe.propTypes={session:f.object.isRequired,locale:f.string,size:f.number};xe.defaultProps={locale:"en",size:24};function we({formattedBlocklet:e,addons:t,sessionManagerProps:n}){var p,g,b,x;const r=A.useContext(De),{locale:o}=Ve()||{},{enableConnect:s=!0,enableLocale:i=!0}=e,a=!!((p=r==null?void 0:r.session)!=null&&p.user);let c=ht((g=e==null?void 0:e.navigation)==null?void 0:g.sessionManager,o)||[];c=gt(c,(x=(b=r==null?void 0:r.session)==null?void 0:b.user)==null?void 0:x.role);const u=(()=>{if(t&&typeof t!="function")return Array.isArray(t)?t:[t];let I=[];if(i&&o&&I.push(m.jsx(Wt,{showText:!1},"locale-selector")),s&&r){const T=[];a&&(c?c.slice(0,5):[]).forEach(y=>{T.push({label:y.title,icon:y.icon?m.jsx("iconify-icon",{icon:y.icon,height:24,style:{marginRight:8}}):null,component:"a",href:y.link,key:y.link})}),I.push(m.jsx(xe,{session:r.session,locale:o},"session-blocklet")),I.push(m.jsx(Ht,{session:r.session,locale:o,menu:T,showRole:!0,...n},"session-user"))}return typeof t=="function"&&(I=t(I)||[]),I})();return A.createElement(m.Fragment,null,...Array.isArray(u)?u:[u])}we.propTypes={formattedBlocklet:f.object.isRequired,addons:f.oneOfType([f.func,f.node]),sessionManagerProps:pt};we.defaultProps={addons:null,sessionManagerProps:{showRole:!0}};const ho=()=>{const e=Dt();A.useEffect(()=>{e.wallet&&Vt.call("arcHideTopBar","{}")},[e])};function mt({meta:e,fallbackUrl:t,invalidPathFallback:n,headerAddons:r,sessionManagerProps:o,links:s,...i}){var O;ho();const a=A.useContext(De),c=(O=a==null?void 0:a.session)==null?void 0:O.user,l=c==null?void 0:c.role,{locale:u}=Ve()||{},d=A.useMemo(()=>{const C=Object.assign({},window.blocklet,e);try{return lo(C)}catch(h){return console.error("Failed to format blocklet info",h,C),C}},[e]),{localizedNav:p,flattened:g,matchedIndex:b}=A.useMemo(()=>{var k;let C=ht((k=d==null?void 0:d.navigation)==null?void 0:k.dashboard,u)||[];C=gt(C,l),C=H(C,S=>({title:S.title,url:S.link,icon:S.icon?m.jsx("iconify-icon",{height:"100%",width:"100%",icon:S.icon}):null,external:!0,children:S.items}),"items");const h=no(C).filter(S=>!!S.url),v=so(h.map(S=>S.url));return v!==-1&&(h[v].active=!0),{localizedNav:C,flattened:h,matchedIndex:v}},[d,u,l]),x=typeof s=="function"?s(p):[...p,...s];if(A.useLayoutEffect(()=>{c&&!(g!=null&&g.length)&&t&&(window.location.href=t)},[t]),A.useLayoutEffect(()=>{c&&(g!=null&&g.length)&&b===-1&&n&&n()},[n,g,b]),!d.appName)return null;const{appLogo:I,appLogoRect:T,appName:w}=d,y=m.jsx(we,{formattedBlocklet:d,addons:r,sessionManagerProps:o});return m.jsx(Ut,{title:w,fullWidth:!0,sidebarWidth:128,legacy:!1,links:x,...i,headerProps:{homeLink:de,logo:m.jsx("img",{src:T||I,alt:"logo"}),addons:y,...i.headerProps}})}mt.propTypes={meta:to,fallbackUrl:f.string,invalidPathFallback:f.func,headerAddons:f.oneOfType([f.func,f.node]),sessionManagerProps:pt,links:f.oneOfType([f.array,f.func])};mt.defaultProps={meta:{},fallbackUrl:de,invalidPathFallback:null,headerAddons:void 0,sessionManagerProps:{showRole:!0,onLogout:()=>{window.location.href=de}},links:[]};export{to as B,mt as D,we as H,Kt as L,no as a,so as b,lo as f,ht as g,oo as i,H as m,de as p,ho as u};
@@ -1 +1 @@
1
- import{b7 as a}from"./index-fgn9vwq8.js";var e=i,s=/^(?:\w+:)?\/\/(\S+)$/,l=/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/,n=/^[^\s\.]+\.\S{2,}$/;function i(t){if(typeof t!="string")return!1;var o=t.match(s);if(!o)return!1;var r=o[1];return r?!!(l.test(r)||n.test(r)):!1}const c=a(e);export{c as i};
1
+ import{b7 as a}from"./index-dffxGns1.js";var e=i,s=/^(?:\w+:)?\/\/(\S+)$/,l=/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/,n=/^[^\s\.]+\.\S{2,}$/;function i(t){if(typeof t!="string")return!1;var o=t.match(s);if(!o)return!1;var r=o[1];return r?!!(l.test(r)||n.test(r)):!1}const c=a(e);export{c as i};
@@ -1,4 +1,4 @@
1
- import{r as h,a0 as g,aY as y,j as t,C as P,n as v,B as c,a1 as d,P as m,Z as w}from"./index-fgn9vwq8.js";import{P as T}from"./page-header-CxkULuMr.js";import{u as B}from"./index-DMTI-fNK.js";import{C as E,D,a as N}from"./connect-to-D2CuNe81.js";import{S as u}from"./step-actions-pilBvcqr.js";import{S as b}from"./layout-CEo-nvMH.js";import"./spaces-C30MN-fS.js";import"./index-ljMFxTRJ.js";import"./api-CTJQFV8E.js";import"./url-join-FMV_JPfK.js";import"./Skeleton-DghEtvL_.js";import"./Hidden-CbT0Nsko.js";import"./use-blocklet-info-for-connect-did-spaces-D7ja6RMG.js";import"./CloseOutlined-vttxnPOn.js";import"./did-address-BnBtx4o3.js";import"./Link-C4c-c9oW.js";import"./DeleteOutline-Dm_Nsq2F.js";import"./format-error-CFOsq4HX.js";import"./index-AxsaK0fs.js";import"./ExpandMore-DkLjJq9w.js";import"./ButtonGroup-Dslh4PgR.js";import"./DialogContentText-Dd6Llavm.js";import"./TextField-DFiFTqqd.js";import"./FormControl-CBM31tVk.js";import"./useFormControl-CGJ6_pv6.js";import"./InputLabel-D4nkCqtD.js";import"./Select-3MFmfiU2.js";import"./Alert-C1AWoXzB.js";import"./useSlot-Suwkr6Il.js";import"./content-layout-CANmEWo5.js";function l({onNext:r,onPrevious:x}){var s,n,p;const{t:e}=h.useContext(g),{blocklet:i}=y(),{spaceGateway:C,settingStorageEndpoint:j,updateSpaceGateway:f,hasStorageEndpoint:S,loading:o,storageEndpoint:a}=B();return o?t.jsx(P,{relative:"parent",children:t.jsx(v,{})}):t.jsxs(G,{children:[t.jsx("div",{className:"header",children:t.jsx(T,{title:e("setup.didSpace.title"),subTitle:e("setup.didSpace.subTitle"),onClickBack:x})}),t.jsx(c,{sx:{width:"100%",maxWidth:"720px"},children:S?t.jsx(E,{spaceGateway:C,settingStorageEndpoint:j}):t.jsx(D,{})}),((s=i==null?void 0:i.capabilities)==null?void 0:s.didSpace)&&t.jsx(c,{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"24px",children:t.jsx(N,{onConnect:f,storageEndpoint:a})}),((n=i==null?void 0:i.capabilities)==null?void 0:n.didSpace)==="required"&&t.jsx(u,{mt:8,children:t.jsx(d,{loading:o,variant:"contained",disabled:o||!a,onClick:()=>r(),children:e("setup.continue")})}),((p=i==null?void 0:i.capabilities)==null?void 0:p.didSpace)==="optional"&&t.jsx(u,{blocklet:i,onStartNow:()=>r("complete"),children:t.jsx(d,{className:"start-now",loading:o,variant:"contained",disabled:o,onClick:()=>r(),children:e(a?"setup.continue":"setup.skip")})})]})}l.propTypes={onNext:m.func,onPrevious:m.func};l.defaultProps={onNext:()=>{},onPrevious:()=>{}};const G=w(b)`
1
+ import{r as h,a0 as g,aY as y,j as t,C as P,n as v,B as c,a1 as d,P as m,Z as w}from"./index-dffxGns1.js";import{P as T}from"./page-header-C4ksffkd.js";import{u as B}from"./index-CpVWvA1p.js";import{C as E,D,a as N}from"./connect-to-C-bgHPhl.js";import{S as u}from"./step-actions-DClVmsb6.js";import{S as b}from"./layout-DA_DkjrU.js";import"./spaces-D3oDzkgq.js";import"./index-B5n-3ODS.js";import"./api-CwFLZZbF.js";import"./url-join-BqiDhuv9.js";import"./Skeleton-_Fn46ryV.js";import"./Hidden-CDKfZsy3.js";import"./use-blocklet-info-for-connect-did-spaces-tjiuk9k8.js";import"./CloseOutlined-CWTygaxG.js";import"./did-address-DBf1riah.js";import"./Link-CZ52DbXN.js";import"./DeleteOutline-BJKAWmBh.js";import"./format-error-CWBrNztU.js";import"./index-CEJ9f9RI.js";import"./ExpandMore-DEkGngK0.js";import"./ButtonGroup-Ct_nK4NB.js";import"./DialogContentText-DFstBMvJ.js";import"./TextField-5Z401EeH.js";import"./FormControl-B60-pCHh.js";import"./useFormControl-tCmd2QIL.js";import"./InputLabel-Ou7BDwPq.js";import"./Select-Djzas9fr.js";import"./Alert-BteoTFtG.js";import"./useSlot-Hwx0G2AC.js";import"./content-layout-D3ADfzfh.js";function l({onNext:r,onPrevious:x}){var s,n,p;const{t:e}=h.useContext(g),{blocklet:i}=y(),{spaceGateway:C,settingStorageEndpoint:j,updateSpaceGateway:f,hasStorageEndpoint:S,loading:o,storageEndpoint:a}=B();return o?t.jsx(P,{relative:"parent",children:t.jsx(v,{})}):t.jsxs(G,{children:[t.jsx("div",{className:"header",children:t.jsx(T,{title:e("setup.didSpace.title"),subTitle:e("setup.didSpace.subTitle"),onClickBack:x})}),t.jsx(c,{sx:{width:"100%",maxWidth:"720px"},children:S?t.jsx(E,{spaceGateway:C,settingStorageEndpoint:j}):t.jsx(D,{})}),((s=i==null?void 0:i.capabilities)==null?void 0:s.didSpace)&&t.jsx(c,{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"24px",children:t.jsx(N,{onConnect:f,storageEndpoint:a})}),((n=i==null?void 0:i.capabilities)==null?void 0:n.didSpace)==="required"&&t.jsx(u,{mt:8,children:t.jsx(d,{loading:o,variant:"contained",disabled:o||!a,onClick:()=>r(),children:e("setup.continue")})}),((p=i==null?void 0:i.capabilities)==null?void 0:p.didSpace)==="optional"&&t.jsx(u,{blocklet:i,onStartNow:()=>r("complete"),children:t.jsx(d,{className:"start-now",loading:o,variant:"contained",disabled:o,onClick:()=>r(),children:e(a?"setup.continue":"setup.skip")})})]})}l.propTypes={onNext:m.func,onPrevious:m.func};l.defaultProps={onNext:()=>{},onPrevious:()=>{}};const G=w(b)`
2
2
  height: 100%;
3
3
  overflow-y: auto;
4
4
  `;export{l as default};