@abtnode/blocklet-services 1.16.33-beta-20241028-005826-60afb7c4 → 1.16.33-beta-20241029-014847-2937778a

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 (263) hide show
  1. package/api/libs/connect/session.js +5 -3
  2. package/api/libs/kyc.js +9 -0
  3. package/api/services/auth/index.js +11 -2
  4. package/api/services/kyc/index.js +56 -32
  5. package/api/util/attach-shared-utils.js +20 -15
  6. package/api/util/index.js +2 -2
  7. package/dist/assets/{Add-BQRw67Fa.js → Add-DEc5Gaew.js} +1 -1
  8. package/dist/assets/{Alert-Cb8GUvFi.js → Alert-CupQqU2h.js} +1 -1
  9. package/dist/assets/{ArrowDropDown-BRkkVMO8.js → ArrowDropDown-B1k8ApwT.js} +1 -1
  10. package/dist/assets/{Autocomplete-CiMJCI6q.js → Autocomplete-CjmKwyN3.js} +1 -1
  11. package/dist/assets/{Avatar-JUqpVuoZ.js → Avatar-DdU9cWoa.js} +1 -1
  12. package/dist/assets/{ButtonGroup-Dkr30o-y.js → ButtonGroup-DU8AIwgk.js} +1 -1
  13. package/dist/assets/{CSSTransition-CaK7nxWs.js → CSSTransition-DxkOmgMD.js} +1 -1
  14. package/dist/assets/{CheckCircle-dQlnEikR.js → CheckCircle-BbFAKZQz.js} +1 -1
  15. package/dist/assets/{ChevronLeft-D1jj_OCE.js → ChevronLeft-ZH0Y8QQ5.js} +1 -1
  16. package/dist/assets/{ChevronRight-4B8L2FvK.js → ChevronRight-CBiHXwpN.js} +1 -1
  17. package/dist/assets/{Close-D9t1V0bN.js → Close-D01F1-kH.js} +1 -1
  18. package/dist/assets/{CloseOutlined-_dO3T_PC.js → CloseOutlined-C_enpVct.js} +1 -1
  19. package/dist/assets/{Delete-C1RI7dqa.js → Delete-CghY174I.js} +1 -1
  20. package/dist/assets/{DeleteOutline-B7DWD_Pd.js → DeleteOutline-DTzpYuUU.js} +1 -1
  21. package/dist/assets/{DialogContentText-BGwSGY20.js → DialogContentText-KJ1VziGc.js} +1 -1
  22. package/dist/assets/{Done-B9inxpK9.js → Done-CRBMAgWC.js} +1 -1
  23. package/dist/assets/{Download-Chn_mucC.js → Download-0mTt88jR.js} +1 -1
  24. package/dist/assets/{EditIcon-Bxcvoews.js → EditIcon-BzYFGdY2.js} +1 -1
  25. package/dist/assets/{Error-CD7hXBjK.js → Error-D_y85can.js} +1 -1
  26. package/dist/assets/{ExpandMore-CZbzCTKg.js → ExpandMore-BW_GpjfP.js} +1 -1
  27. package/dist/assets/{FormControl-CVE9WL7K.js → FormControl-y2eP2gzP.js} +1 -1
  28. package/dist/assets/{FormControlLabel-DYWd7TcF.js → FormControlLabel-DsxW3p6G.js} +1 -1
  29. package/dist/assets/{FormGroup-DdQz-TwB.js → FormGroup-COgg0lwB.js} +1 -1
  30. package/dist/assets/{Google-DcVWJY2S.js → Google-CiCa62KH.js} +3 -3
  31. package/dist/assets/{Grid-BZnpkTQP.js → Grid-Dne3bmfg.js} +1 -1
  32. package/dist/assets/HelpOutline-X7u3GlNb.js +1 -0
  33. package/dist/assets/{Hidden-CbAVlEDm.js → Hidden-BnLj1Yrh.js} +1 -1
  34. package/dist/assets/{InfoOutlined-NM9liF3s.js → InfoOutlined-DKyb4neb.js} +1 -1
  35. package/dist/assets/{InputAdornment-Bpn9HTW3.js → InputAdornment-vYojJBmt.js} +1 -1
  36. package/dist/assets/{InputLabel-RH2D4KPR.js → InputLabel-DlIX2kte.js} +1 -1
  37. package/dist/assets/{LastPage-DWF6cED3.js → LastPage-BAT94flJ.js} +1 -1
  38. package/dist/assets/{Launch-B6giRvog.js → Launch-BMtVhnlU.js} +1 -1
  39. package/dist/assets/{LaunchOutlined-BbztgzUz.js → LaunchOutlined-JsW3bksQ.js} +1 -1
  40. package/dist/assets/{Link-mzUHhPTN.js → Link-BSkaanak.js} +1 -1
  41. package/dist/assets/ListItemButton-D3vwOyXA.js +1 -0
  42. package/dist/assets/{LoadingButton-BgKjZXkL.js → LoadingButton-BG7mJBjy.js} +1 -1
  43. package/dist/assets/{LockIcon-4PWP1bDL.js → LockIcon-CnRKDzuV.js} +1 -1
  44. package/dist/assets/{Loop-P56l68QD.js → Loop-C7A5hRBw.js} +1 -1
  45. package/dist/assets/{MarkEmailRead-DOjMeCFe.js → MarkEmailRead-DXHnM-5J.js} +1 -1
  46. package/dist/assets/{Menu-I0j8Ts_k.js → Menu-DAx78rf8.js} +1 -1
  47. package/dist/assets/{MoreHoriz-BihREYOu.js → MoreHoriz-Cix-ucsf.js} +1 -1
  48. package/dist/assets/{MoreVert-DDBU9EgD.js → MoreVert-pbCfz7_a.js} +1 -1
  49. package/dist/assets/{OpenInNew-DNUMd1Ki.js → OpenInNew-DH9cfgTx.js} +1 -1
  50. package/dist/assets/Pagination-ByraHmfi.js +2 -0
  51. package/dist/assets/{PlayArrow-m_SU1GSc.js → PlayArrow-DUPHdx2w.js} +1 -1
  52. package/dist/assets/{QuestionMarkCircle-L9oBHKLh.js → QuestionMarkCircle-Nkpa63G6.js} +1 -1
  53. package/dist/assets/{RadioGroup-BZc2gQ3J.js → RadioGroup-BFz6MuWT.js} +1 -1
  54. package/dist/assets/{Search-DcpIU2VO.js → Search-RYv9IOCL.js} +1 -1
  55. package/dist/assets/{Select-BjqrbqwY.js → Select-BJHtvl4z.js} +2 -2
  56. package/dist/assets/{ServerLogo-D3rrSDtL.js → ServerLogo-iBlSxiwt.js} +1 -1
  57. package/dist/assets/{Skeleton-cOZ7paOF.js → Skeleton-CCHHqylE.js} +4 -4
  58. package/dist/assets/{Slider-BPnwflNL.js → Slider-2IJG90i0.js} +1 -1
  59. package/dist/assets/{Stack-BpqXnyM6.js → Stack-CzT1qtfF.js} +1 -1
  60. package/dist/assets/{Stepper-cjIW0fgZ.js → Stepper-DIDg14Y1.js} +1 -1
  61. package/dist/assets/{TextField-PnwHOv_7.js → TextField-DNDZQTge.js} +1 -1
  62. package/dist/assets/{Toolbar-C46QlHj5.js → Toolbar-Czbh9Thi.js} +1 -1
  63. package/dist/assets/{Verified-kWQRhAzA.js → Verified-Bojb7V8h.js} +1 -1
  64. package/dist/assets/{ViewColumn-di8RRjuH.js → ViewColumn-adtX8zvr.js} +1 -1
  65. package/dist/assets/{ViewList-B-z7Gj50.js → ViewList-nMxoCPSk.js} +1 -1
  66. package/dist/assets/{access-control-HU86cVDN.js → access-control-DHNiwY6V.js} +1 -1
  67. package/dist/assets/{actions-DpdmI0vS.js → actions-DqT9_Wum.js} +1 -1
  68. package/dist/assets/{add-component-core-C12Yk8Zd.js → add-component-core-BubwveVU.js} +34 -34
  69. package/dist/assets/add-resource-Dm1L3xLV.js +1 -0
  70. package/dist/assets/{addon-CigkkKH3.js → addon-WHI8TbVR.js} +1 -1
  71. package/dist/assets/{analytics-B6_E7bBR.js → analytics-Ce6JyEG_.js} +8 -8
  72. package/dist/assets/api-DLSmmaM3.js +1 -0
  73. package/dist/assets/{ar-DPKr6aJE.js → ar-2TonDRvZ.js} +1 -1
  74. package/dist/assets/ar-j9K5GatZ.js +1 -0
  75. package/dist/assets/audit-logs-Dkx-0Fff.js +58 -0
  76. package/dist/assets/{base32-CEA8NAOs.js → base32-DAaLo59X.js} +1 -1
  77. package/dist/assets/{bundle-avatar-BEi2sYgQ.js → bundle-avatar-Dx1RwhB-.js} +1 -1
  78. package/dist/assets/{button-qSDF0MHZ.js → button-CHEw8JKq.js} +1 -1
  79. package/dist/assets/{click-to-copy-DNMw_CsM.js → click-to-copy-CerMtW1G.js} +1 -1
  80. package/dist/assets/{complete-ktDziJkp.js → complete-wWH5b1EO.js} +1 -1
  81. package/dist/assets/{component-cpm50z3M.js → component-OeCmXcvV.js} +46 -46
  82. package/dist/assets/{config-C98DoG5F.js → config-CzogNM6s.js} +1 -1
  83. package/dist/assets/{config-Cpoq5q2q.js → config-DsPwqf9s.js} +1 -1
  84. package/dist/assets/{config-navigation-DHqRxI1-.js → config-navigation-CqoSpRZ8.js} +5 -5
  85. package/dist/assets/{confirm-CHPPgJ5w.js → confirm-CDYYkoPB.js} +1 -1
  86. package/dist/assets/{connect-_wsn53RM.js → connect-BAaQDJdT.js} +1 -1
  87. package/dist/assets/{connect-CVt7hhhZ.js → connect-CoYghE61.js} +1 -1
  88. package/dist/assets/{connect-to-BhVu4jHm.js → connect-to-DV1E9V_T.js} +1 -1
  89. package/dist/assets/{content-layout-4m3OHN99.js → content-layout-CZivV9iw.js} +1 -1
  90. package/dist/assets/{dashboard-BuNhMwdN.js → dashboard-CMafJ63y.js} +9 -9
  91. package/dist/assets/{de-Cl5__jPN.js → de-B1aG8zWS.js} +1 -1
  92. package/dist/assets/de-BVh3hwT3.js +1 -0
  93. package/dist/assets/{deprecate-DovOjub0.js → deprecate-BG-RqYhQ.js} +1 -1
  94. package/dist/assets/{did-address-CdScrBCT.js → did-address-DvBIH5D8.js} +1 -1
  95. package/dist/assets/{domain-DnltSVJm.js → domain-DPG1LqVo.js} +1 -1
  96. package/dist/assets/{domain-list-CAkva7x_.js → domain-list-UwQfY0bQ.js} +1 -1
  97. package/dist/assets/email-D7QdjnnK.js +18 -0
  98. package/dist/assets/emotion-cache.browser.esm-BjIoAnXy.js +1 -0
  99. package/dist/assets/es-B78wkrSg.js +1 -0
  100. package/dist/assets/{es-BhoY4pub.js → es-BEwxvJ2s.js} +1 -1
  101. package/dist/assets/{exchange-passport-yUOmsAsG.js → exchange-passport-DCHiwggG.js} +1 -1
  102. package/dist/assets/{fallback-Ck0I8St3.js → fallback-C9ko-lGM.js} +1 -1
  103. package/dist/assets/{form-text-input-psgwvKm-.js → form-text-input-BBMy63E9.js} +2 -2
  104. package/dist/assets/{format-error-IawEMzuv.js → format-error-B-leFeoI.js} +1 -1
  105. package/dist/assets/fr-Cvy3dZN3.js +1 -0
  106. package/dist/assets/{fr-T--qF3dZ.js → fr-CyBvbwlz.js} +1 -1
  107. package/dist/assets/{fuel-DYf7OlG7.js → fuel-B8iWjDIC.js} +1 -1
  108. package/dist/assets/{fullpage-L8eyCcID.js → fullpage-CV1kAnQT.js} +1 -1
  109. package/dist/assets/{hi-Bkr9nxwZ.js → hi-CiLl3Zi6.js} +1 -1
  110. package/dist/assets/hi-nvWOxhan.js +1 -0
  111. package/dist/assets/{home-BaeqwiMV.js → home-CtjCpn32.js} +1 -1
  112. package/dist/assets/{id-BbxiX6aD.js → id-Cl0lvxW7.js} +1 -1
  113. package/dist/assets/id-FWMMrTxm.js +1 -0
  114. package/dist/assets/{iframe-D-vgaTgv.js → iframe-CNDgJKfZ.js} +1 -1
  115. package/dist/assets/{index-VWtFyzkK.js → index-B2w_BGLq.js} +1 -1
  116. package/dist/assets/{index-CB7LGtSy.js → index-BB2DzNFr.js} +1 -1
  117. package/dist/assets/{index-DH0OTY_E.js → index-BES9wlXn.js} +14 -13
  118. package/dist/assets/{index-BAQvuUj1.js → index-BEaq4bck.js} +1 -1
  119. package/dist/assets/{index-CUuwfStF.js → index-BJ0k59Tf.js} +1 -1
  120. package/dist/assets/{index-DZvaAYzJ.js → index-BSHqUvvB.js} +1 -1
  121. package/dist/assets/{index-DzjvRcZX.js → index-BWRuELFp.js} +1 -1
  122. package/dist/assets/index-BWW9wQ5i.js +1 -0
  123. package/dist/assets/{index-C46QsmAx.js → index-BkOrkopm.js} +1 -1
  124. package/dist/assets/{index-DTIMKD2Z.js → index-C-yt1SFf.js} +1 -1
  125. package/dist/assets/{index-CKJ-4t1N.js → index-CIO5rH3U.js} +1 -1
  126. package/dist/assets/{index-MuwP8CmB.js → index-CRupT51d.js} +4 -4
  127. package/dist/assets/index-CbJ7Ycw4.js +11 -0
  128. package/dist/assets/{index-BSfUxS10.js → index-Cdj39Rch.js} +1 -1
  129. package/dist/assets/{index-DLuD4Ybl.js → index-Ch6BfLs4.js} +1 -1
  130. package/dist/assets/{index-CvuYuNrC.js → index-Cj2lRUvU.js} +1 -1
  131. package/dist/assets/{index-Cicr8_v0.js → index-D0ZDnsBw.js} +5 -5
  132. package/dist/assets/{index-DpYNQxep.js → index-D0vpGtYa.js} +1 -1
  133. package/dist/assets/{index-D8UHLaZo.js → index-D2bv65kG.js} +1 -1
  134. package/dist/assets/{index-DtlYOQGh.js → index-D9IhBRcZ.js} +4 -4
  135. package/dist/assets/{index-C4OUjclt.js → index-DMhVY_t6.js} +1 -1
  136. package/dist/assets/{index-BYtyuTe_.js → index-DO83-4pr.js} +1 -1
  137. package/dist/assets/{index-CmMULrYg.js → index-DQGd2MHm.js} +1 -1
  138. package/dist/assets/{index-ClPetRXB.js → index-DUvxK_pJ.js} +1 -1
  139. package/dist/assets/index-DZZkPDZs.js +1 -0
  140. package/dist/assets/{index-Czj3ph5d.js → index-DqdPWHh8.js} +4 -4
  141. package/dist/assets/index-DrGG84yQ.js +316 -0
  142. package/dist/assets/{index-B714sBVK.js → index-Du1PLYcj.js} +1 -1
  143. package/dist/assets/{index-CPjnF38z.js → index-HSjmxikb.js} +1 -1
  144. package/dist/assets/{index-D5IcO7Vq.js → index-HsQ3WMC6.js} +1 -1
  145. package/dist/assets/{index-eMi3myGI.js → index-YhmyCsjd.js} +1 -1
  146. package/dist/assets/{index-DpBCF5xl.js → index-YwELWQn6.js} +5 -5
  147. package/dist/assets/{index-DFI3ASVb.js → index-l7ITn0fy.js} +1 -1
  148. package/dist/assets/{index-BNbx1KY2.js → index-ximM9jK2.js} +1 -1
  149. package/dist/assets/{index-DZJ5Xczt.js → index-yjZBmDn6.js} +1 -1
  150. package/dist/assets/{index.es-omOswc9R.js → index.es-LIQBW5LL.js} +3 -3
  151. package/dist/assets/{invitation-tEQ5ZLGQ.js → invitation-BQ9lcSxO.js} +1 -1
  152. package/dist/assets/{invite-BL9JwrO-.js → invite-QLtor_es.js} +1 -1
  153. package/dist/assets/isEmail-CcvzeVrs.js +1 -0
  154. package/dist/assets/{issue-passport-B4cIxbeW.js → issue-passport-BkxmOMBs.js} +1 -1
  155. package/dist/assets/{item--EFKzxT4.js → item-BAa88ldN.js} +1 -1
  156. package/dist/assets/ja-Be6ZrJ3j.js +1 -0
  157. package/dist/assets/{ja-B5UxYW93.js → ja-Uy7OpVJX.js} +1 -1
  158. package/dist/assets/{jss-plugin-props-sort.esm-CwzPC0-q.js → jss-plugin-props-sort.esm-K8zlWBTt.js} +1 -1
  159. package/dist/assets/ko-631_NPZL.js +1 -0
  160. package/dist/assets/{ko-CpyVmdoA.js → ko-RAcT5Den.js} +1 -1
  161. package/dist/assets/{launch-result-message-D3lgLPek.js → launch-result-message-BNRTOFqk.js} +1 -1
  162. package/dist/assets/{layout-CeB8tvZm.js → layout-BQshf_Yf.js} +1 -1
  163. package/dist/assets/{list-header-BEHCrfI7.js → list-header-C4fW2U4a.js} +1 -1
  164. package/dist/assets/localization-F2jCf7Q_.js +1 -0
  165. package/dist/assets/{log-BA8otNYe.js → log-9eHXCnTv.js} +1 -1
  166. package/dist/assets/{login-MJNn4jX3.js → login-DJz-LtJC.js} +1 -1
  167. package/dist/assets/{login-oauth-callback-a4ix1w_Y.js → login-oauth-callback-CbXMk1Ee.js} +1 -1
  168. package/dist/assets/logo-uploader-BeuKpE1k.js +133 -0
  169. package/dist/assets/{lost-passport-BqI_ADgq.js → lost-passport-71u3kgyM.js} +3 -3
  170. package/dist/assets/{lottie-CKskIEos.js → lottie-Bv4YQmjr.js} +1 -1
  171. package/dist/assets/notifications-CxETkPC8.js +65 -0
  172. package/dist/assets/{open-window-vG7gxIZq.js → open-window-C_Itzebs.js} +1 -1
  173. package/dist/assets/overview-DtN2iRHw.js +12 -0
  174. package/dist/assets/{page-header-CDbgUvxH.js → page-header-6ic_pmoK.js} +1 -1
  175. package/dist/assets/{permission-CC_4NjQs.js → permission-CRpG3m7P.js} +1 -1
  176. package/dist/assets/{preferences-AiiMUULa.js → preferences-5XMD5OzU.js} +1 -1
  177. package/dist/assets/{pt-DNYyqLg4.js → pt-BlLvTTrm.js} +1 -1
  178. package/dist/assets/pt-CTpkGCgP.js +1 -0
  179. package/dist/assets/publish-resource-u8MzIwsZ.js +1 -0
  180. package/dist/assets/{react-BeNwKB5d.js → react-DnVaFLUv.js} +3 -3
  181. package/dist/assets/{redux-CSFGRixa.js → redux-Ca86ARNo.js} +1 -1
  182. package/dist/assets/refType-DnzNeAJs.js +1 -0
  183. package/dist/assets/{resource-dialog-CE8xTvOH.js → resource-dialog-BSFeyQ_K.js} +1 -1
  184. package/dist/assets/ru-Culp1KLs.js +1 -0
  185. package/dist/assets/{ru-iLN_KAH_.js → ru-sSBv7F2t.js} +1 -1
  186. package/dist/assets/sdk-B-OBfaY_.js +1 -0
  187. package/dist/assets/{selector-D17_2gf0.js → selector-Ckqt3gtd.js} +3 -3
  188. package/dist/assets/session-BT3UDuRe.js +1 -0
  189. package/dist/assets/{setup-Ctq13rGM.js → setup-DCuRY7pY.js} +3 -3
  190. package/dist/assets/{shorten-label-DH9SHtdj.js → shorten-label-cwsaVcrz.js} +1 -1
  191. package/dist/assets/{simple-select-BxJC7ug8.js → simple-select-QvzQDazL.js} +1 -1
  192. package/dist/assets/{slicedToArray-iU9d1Nzl.js → slicedToArray-CJFgHG2-.js} +1 -1
  193. package/dist/assets/{spaces-zoAgXjLC.js → spaces-CUv_J9P5.js} +1 -1
  194. package/dist/assets/{start-DMZbLY0L.js → start-BTuxG98O.js} +1 -1
  195. package/dist/assets/{step-actions-oojkqr2w.js → step-actions-DVtaq0BG.js} +1 -1
  196. package/dist/assets/{studio-Dcd2i5DA.js → studio-B3HuTZPP.js} +1 -1
  197. package/dist/assets/{switch-control-DA8reBy9.js → switch-control-o6-nZs-T.js} +1 -1
  198. package/dist/assets/th-Dqms8yb0.js +1 -0
  199. package/dist/assets/{th-pEKbhX2z.js → th-Dv20telW.js} +1 -1
  200. package/dist/assets/{toUpper-SILegrQ3.js → toUpper-o91NwuX3.js} +1 -1
  201. package/dist/assets/{transfer-B7uXnaTg.js → transfer-BRjjFrH2.js} +1 -1
  202. package/dist/assets/{trim-DtY2mn6M.js → trim-5l2FIQ1V.js} +1 -1
  203. package/dist/assets/{uniqBy-CqrMZpMi.js → uniqBy-Chi1M0dq.js} +1 -1
  204. package/dist/assets/{unsubscribe-Dckvx5GC.js → unsubscribe-Cq_wq5vC.js} +1 -1
  205. package/dist/assets/{url-join-MhXUJvvH.js → url-join-Bx_A70NM.js} +1 -1
  206. package/dist/assets/{use-blocklet-info-for-connect-did-spaces-wq894EOf.js → use-blocklet-info-for-connect-did-spaces-CCqkRF8J.js} +1 -1
  207. package/dist/assets/{use-mobile-B1qMoH4W.js → use-mobile-eTkOLV75.js} +1 -1
  208. package/dist/assets/{useAsync-DwqCgR5n.js → useAsync-DOpY0MTF.js} +1 -1
  209. package/dist/assets/{useFormControl-581SE09O.js → useFormControl-CXaDIKmg.js} +1 -1
  210. package/dist/assets/{useLocalStorage-2QP2xSVk.js → useLocalStorage-Aaw2jy7u.js} +1 -1
  211. package/dist/assets/{useSetState-xUMH0B_e.js → useSetState-7DwsrT08.js} +1 -1
  212. package/dist/assets/useSlot-CDeXSS5P.js +1 -0
  213. package/dist/assets/{useSlotProps-CH7A38KN.js → useSlotProps-y4Nw2SFi.js} +1 -1
  214. package/dist/assets/useThemeProps-CBbxmVEG.js +1 -0
  215. package/dist/assets/user-center-B5dWtyO9.js +1 -0
  216. package/dist/assets/{user-sessions-BYM0F6ns.js → user-sessions-tail5lsl.js} +1 -1
  217. package/dist/assets/{util-CTLIHCQ7.js → util-C-9HO-wY.js} +1 -1
  218. package/dist/assets/{vi-CNA5ZRDz.js → vi-B-VzHaKw.js} +1 -1
  219. package/dist/assets/vi-DjcU4tKh.js +1 -0
  220. package/dist/assets/wrap-locale-CagvGD5F.js +1 -0
  221. package/dist/assets/zh-DWYwLndz.js +1 -0
  222. package/dist/assets/zh-tw-3Ki06u1b.js +1 -0
  223. package/dist/assets/{zh-tw-wIRljAO1.js → zh-tw-B7lbXLVn.js} +1 -1
  224. package/dist/assets/{zh-C91ux8Ex.js → zh-u8iElwOC.js} +1 -1
  225. package/dist/index.html +1 -1
  226. package/dist/service-worker.js +1 -1
  227. package/package.json +19 -19
  228. package/dist/assets/Pagination-DFhSxhpu.js +0 -2
  229. package/dist/assets/add-resource-B5PS9Yw0.js +0 -1
  230. package/dist/assets/api-BTWN6BD3.js +0 -1
  231. package/dist/assets/ar-BcsWe-M7.js +0 -1
  232. package/dist/assets/audit-logs-BCK2xbFz.js +0 -58
  233. package/dist/assets/de-f8XZAb4q.js +0 -1
  234. package/dist/assets/email-ByYt-V3O.js +0 -18
  235. package/dist/assets/emotion-cache.browser.esm-Bl95gpZS.js +0 -1
  236. package/dist/assets/es-Dkw0SgdE.js +0 -1
  237. package/dist/assets/fr-CutjrzQz.js +0 -1
  238. package/dist/assets/hi-BwtTylyX.js +0 -1
  239. package/dist/assets/id-Dz8dfVhg.js +0 -1
  240. package/dist/assets/index-BhWojJ48.js +0 -316
  241. package/dist/assets/index-b3txmGPa.js +0 -11
  242. package/dist/assets/index-e3kJGRQs.js +0 -1
  243. package/dist/assets/index-lIQZq2T1.js +0 -1
  244. package/dist/assets/ja-BZrZ4ULY.js +0 -1
  245. package/dist/assets/ko-DLaz-pjP.js +0 -1
  246. package/dist/assets/localization-DMO6m7q5.js +0 -1
  247. package/dist/assets/logo-uploader-D3WhF6vw.js +0 -133
  248. package/dist/assets/notifications-BuezJhNN.js +0 -65
  249. package/dist/assets/overview-pVXjVv4f.js +0 -12
  250. package/dist/assets/pt-CysEhQ_Z.js +0 -1
  251. package/dist/assets/publish-resource-C2uzL0M9.js +0 -1
  252. package/dist/assets/refType-D_QSkOey.js +0 -1
  253. package/dist/assets/ru-C-IO4heq.js +0 -1
  254. package/dist/assets/sdk-DxG_dISZ.js +0 -1
  255. package/dist/assets/session-D-foQV_d.js +0 -1
  256. package/dist/assets/th-Bd6_ise5.js +0 -1
  257. package/dist/assets/useSlot-1YlTOkWf.js +0 -1
  258. package/dist/assets/useThemeProps-2Eh-Pntu.js +0 -1
  259. package/dist/assets/user-center-DLGGLlGO.js +0 -1
  260. package/dist/assets/vi-BrQQz2Dk.js +0 -1
  261. package/dist/assets/wrap-locale-kin7AMXS.js +0 -1
  262. package/dist/assets/zh-BUjxGa7K.js +0 -1
  263. package/dist/assets/zh-tw-GFcs7F29.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/react-BeNwKB5d.js","assets/index-Cicr8_v0.js","assets/index-D8NuaJ66.css","assets/index-lIQZq2T1.js","assets/index-CUuwfStF.js","assets/index-C4OUjclt.js","assets/toUpper-SILegrQ3.js","assets/index-DpBCF5xl.js","assets/fallback-Ck0I8St3.js","assets/index-DTIMKD2Z.js","assets/Menu-I0j8Ts_k.js","assets/Toolbar-C46QlHj5.js","assets/Hidden-CbAVlEDm.js","assets/index-b3txmGPa.js","assets/MoreVert-DDBU9EgD.js","assets/FormControlLabel-DYWd7TcF.js","assets/useFormControl-581SE09O.js","assets/Stack-BpqXnyM6.js","assets/selector-D17_2gf0.js","assets/ExpandMore-CZbzCTKg.js","assets/Avatar-JUqpVuoZ.js","assets/useSlot-1YlTOkWf.js","assets/resource-dialog-CE8xTvOH.js","assets/index-D8UHLaZo.js","assets/emotion-cache.browser.esm-Bl95gpZS.js","assets/OpenInNew-DNUMd1Ki.js","assets/index-CB7LGtSy.js","assets/index-DZJ5Xczt.js","assets/CloseOutlined-_dO3T_PC.js","assets/Link-mzUHhPTN.js","assets/index-eMi3myGI.js","assets/index-BNbx1KY2.js","assets/index-ClPetRXB.js","assets/index-DZvaAYzJ.js","assets/useThemeProps-2Eh-Pntu.js","assets/Grid-BZnpkTQP.js","assets/index-CKJ-4t1N.js","assets/redux-CSFGRixa.js","assets/ViewColumn-di8RRjuH.js","assets/FormControl-CVE9WL7K.js","assets/FormGroup-DdQz-TwB.js","assets/Select-BjqrbqwY.js","assets/InputLabel-RH2D4KPR.js","assets/Delete-C1RI7dqa.js","assets/TextField-PnwHOv_7.js","assets/LastPage-DWF6cED3.js","assets/Search-DcpIU2VO.js","assets/index-BSfUxS10.js","assets/deprecate-DovOjub0.js","assets/url-join-MhXUJvvH.js","assets/uniqBy-CqrMZpMi.js","assets/purify.es-Bq0E5Q3l.js","assets/react-AgKpYdvC.css"])))=>i.map(i=>d[i]);
2
- import{at as d2,j as o,aG as se,cP as g0,aK as A,fG as X1,aJ as je,aE as $e,aF as Fe,T as G,r as R,aI as m1,aL as u2,aM as Ue,aN as qe,cW as p2,fH as l1,X as Se,Y as ke,B as z,n as Oe,P as h,$ as We,G as X,e as v1,u as te,aP as we,aY as Ve,bx as n1,a1 as e1,L as ue,bL as b0,a as ve,aC as ge,K as h2,t as $,Z as ae,dD as f2,aa as ye,c as pe,I as x2,bW as g1,ch as j0,cK as m2,cT as He,cU as w0,aj as v2,d9 as g2,cO as Je,bF as re,c3 as Qe,fs as b2,a8 as J1,fI as j2,b as ne,bm as R0,ej as C0,ai as b1,bn as y0,cy as z0,aT as Ae,aS as w2,a3 as S0,fJ as Q1,ff as Le,bk as R2,au as k0,d1 as C2,l as y2,aB as z2,aq as S2,ar as i1}from"./index-Cicr8_v0.js";import{d as j1}from"./Add-BQRw67Fa.js";import{d as I0,a as k2}from"./Delete-C1RI7dqa.js";import{d as I2}from"./Error-CD7hXBjK.js";import{D as w1}from"./index-DZvaAYzJ.js";import{T as M0,b as M2}from"./index-BYtyuTe_.js";import{C as R1}from"./confirm-CHPPgJ5w.js";import{u as s1}from"./session-D-foQV_d.js";import{W as Y1}from"./did-address-CdScrBCT.js";import{B as C1}from"./bundle-avatar-BEi2sYgQ.js";import{S as be}from"./shorten-label-DH9SHtdj.js";import{A as P0}from"./Avatar-JUqpVuoZ.js";import{d as P2}from"./Download-Chn_mucC.js";import{d as L2}from"./QuestionMarkCircle-L9oBHKLh.js";import{b as T2,c as Z1,T as N2}from"./index-eMi3myGI.js";import{_ as Pe}from"./useSetState-xUMH0B_e.js";import{c as y1}from"./index-C4OUjclt.js";import{C as u1,L as V2}from"./MoreVert-DDBU9EgD.js";import{A as L0}from"./Alert-Cb8GUvFi.js";import{p as t1}from"./index-DtlYOQGh.js";import"./api-BTWN6BD3.js";import{i as D2}from"./index-DZJ5Xczt.js";import{d as _2}from"./ExpandMore-CZbzCTKg.js";import{d as E2}from"./ChevronRight-4B8L2FvK.js";import{d as B2}from"./OpenInNew-DNUMd1Ki.js";import{u as T0}from"./useThemeProps-2Eh-Pntu.js";import{F as p1}from"./FormControlLabel-DYWd7TcF.js";import{u as A2}from"./useSlotProps-CH7A38KN.js";import{d as O2}from"./DeleteOutline-B7DWD_Pd.js";import{c as H2,A as N0,u as $2,S as F2,U as U2}from"./item--EFKzxT4.js";import{d as q2}from"./ArrowDropDown-BRkkVMO8.js";import{f as Ne}from"./format-error-IawEMzuv.js";import{B as h1}from"./ButtonGroup-Dkr30o-y.js";import{T as Te}from"./TextField-PnwHOv_7.js";import{I as z1}from"./InputAdornment-Bpn9HTW3.js";import{C as W2}from"./click-to-copy-DNMw_CsM.js";import{d as G2}from"./Launch-B6giRvog.js";import{S as e0}from"./index-ClPetRXB.js";import{M as K2}from"./index-D5IcO7Vq.js";import{p as X2}from"./purify.es-Bq0E5Q3l.js";import{r as J2}from"./index-VWtFyzkK.js";import{d as Q2}from"./Done-B9inxpK9.js";import{c as V0,d as D0,b as Y2,S as Z2,a as et}from"./Stepper-cjIW0fgZ.js";import{S as tt}from"./Stack-BpqXnyM6.js";import{R as ot,a as t0}from"./RadioGroup-BZc2gQ3J.js";import"./Grid-BZnpkTQP.js";import"./emotion-cache.browser.esm-Bl95gpZS.js";import"./index-CKJ-4t1N.js";import"./redux-CSFGRixa.js";import"./ViewColumn-di8RRjuH.js";import"./FormControl-CVE9WL7K.js";import"./useFormControl-581SE09O.js";import"./FormGroup-DdQz-TwB.js";import"./Select-BjqrbqwY.js";import"./InputLabel-RH2D4KPR.js";import"./LastPage-DWF6cED3.js";import"./Toolbar-C46QlHj5.js";import"./Search-DcpIU2VO.js";import"./index-BNbx1KY2.js";import"./DialogContentText-BGwSGY20.js";import"./Link-mzUHhPTN.js";import"./useSlot-1YlTOkWf.js";import"./jss-plugin-props-sort.esm-CwzPC0-q.js";const lt=d2(o.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreHoriz"),nt=["slots","slotProps"],st=se(g0)(({theme:e})=>A({display:"flex",marginLeft:`calc(${e.spacing(1)} * 0.5)`,marginRight:`calc(${e.spacing(1)} * 0.5)`},e.palette.mode==="light"?{backgroundColor:e.palette.grey[100],color:e.palette.grey[700]}:{backgroundColor:e.palette.grey[700],color:e.palette.grey[100]},{borderRadius:2,"&:hover, &:focus":A({},e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}),"&:active":A({boxShadow:e.shadows[0]},e.palette.mode==="light"?{backgroundColor:X1(e.palette.grey[200],.12)}:{backgroundColor:X1(e.palette.grey[600],.12)})})),rt=se(lt)({width:24,height:16});function it(e){const{slots:t={},slotProps:l={}}=e,s=je(e,nt),r=e;return o.jsx("li",{children:o.jsx(st,A({focusRipple:!0},s,{ownerState:r,children:o.jsx(rt,A({as:t.CollapsedIcon,ownerState:r},l.collapsedIcon))}))})}function at(e){return Fe("MuiBreadcrumbs",e)}const ct=$e("MuiBreadcrumbs",["root","ol","li","separator"]),dt=["children","className","component","slots","slotProps","expandText","itemsAfterCollapse","itemsBeforeCollapse","maxItems","separator"],ut=e=>{const{classes:t}=e;return qe({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},at,t)},pt=se(G,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,t)=>[{[`& .${ct.li}`]:t.li},t.root]})({}),ht=se("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(e,t)=>t.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),ft=se("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(e,t)=>t.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function xt(e,t,l,s){return e.reduce((r,c,i)=>(i<e.length-1?r=r.concat(c,o.jsx(ft,{"aria-hidden":!0,className:t,ownerState:s,children:l},`separator-${i}`)):r.push(c),r),[])}const _0=R.forwardRef(function(t,l){const s=m1({props:t,name:"MuiBreadcrumbs"}),{children:r,className:c,component:i="nav",slots:a={},slotProps:u={},expandText:f="Show path",itemsAfterCollapse:x=1,itemsBeforeCollapse:g=1,maxItems:y=8,separator:p="/"}=s,d=je(s,dt),[m,b]=R.useState(!1),v=A({},s,{component:i,expanded:m,expandText:f,itemsAfterCollapse:x,itemsBeforeCollapse:g,maxItems:y,separator:p}),C=ut(v),S=u2({elementType:a.CollapsedIcon,externalSlotProps:u.collapsedIcon,ownerState:v}),N=R.useRef(null),T=I=>{const U=()=>{b(!0);const V=N.current.querySelector("a[href],button,[tabindex]");V&&V.focus()};return g+x>=I.length?I:[...I.slice(0,g),o.jsx(it,{"aria-label":f,slots:{CollapsedIcon:a.CollapsedIcon},slotProps:{collapsedIcon:S},onClick:U},"ellipsis"),...I.slice(I.length-x,I.length)]},P=R.Children.toArray(r).filter(I=>R.isValidElement(I)).map((I,U)=>o.jsx("li",{className:C.li,children:I},`child-${U}`));return o.jsx(pt,A({ref:l,component:i,color:"text.secondary",className:Ue(C.root,c),ownerState:v},d,{children:o.jsx(ht,{className:C.ol,ref:N,ownerState:v,children:xt(m||y&&P.length<=y?P:T(P),C.separator,p,v)})}))});function mt(e){return Fe("MuiStepButton",e)}const o0=$e("MuiStepButton",["root","horizontal","vertical","touchRipple"]),vt=["children","className","icon","optional"],gt=e=>{const{classes:t,orientation:l}=e;return qe({root:["root",l],touchRipple:["touchRipple"]},mt,t)},bt=se(g0,{name:"MuiStepButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[{[`& .${o0.touchRipple}`]:t.touchRipple},t.root,t[l.orientation]]}})(({ownerState:e})=>A({width:"100%",padding:"24px 16px",margin:"-24px -16px",boxSizing:"content-box"},e.orientation==="vertical"&&{justifyContent:"flex-start",padding:"8px",margin:"-8px"},{[`& .${o0.touchRipple}`]:{color:"rgba(0, 0, 0, 0.3)"}})),jt=R.forwardRef(function(t,l){const s=m1({props:t,name:"MuiStepButton"}),{children:r,className:c,icon:i,optional:a}=s,u=je(s,vt),{disabled:f,active:x}=R.useContext(V0),{orientation:g}=R.useContext(D0),y=A({},s,{orientation:g}),p=gt(y),d={icon:i,optional:a},m=p2(r,["StepLabel"])?R.cloneElement(r,d):o.jsx(Y2,A({},d,{children:r}));return o.jsx(bt,A({focusRipple:!0,disabled:f,TouchRippleProps:{className:p.touchRipple},className:Ue(p.root,c),ref:l,ownerState:y,"aria-current":x?"step":void 0},u,{children:m}))});function wt(e){return Fe("MuiStepContent",e)}$e("MuiStepContent",["root","last","transition"]);const Rt=["children","className","TransitionComponent","transitionDuration","TransitionProps"],Ct=e=>{const{classes:t,last:l}=e;return qe({root:["root",l&&"last"],transition:["transition"]},wt,t)},yt=se("div",{name:"MuiStepContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.root,l.last&&t.last]}})(({ownerState:e,theme:t})=>A({marginLeft:12,paddingLeft:20,paddingRight:8,borderLeft:t.vars?`1px solid ${t.vars.palette.StepContent.border}`:`1px solid ${t.palette.mode==="light"?t.palette.grey[400]:t.palette.grey[600]}`},e.last&&{borderLeft:"none"})),zt=se(l1,{name:"MuiStepContent",slot:"Transition",overridesResolver:(e,t)=>t.transition})({}),St=R.forwardRef(function(t,l){const s=m1({props:t,name:"MuiStepContent"}),{children:r,className:c,TransitionComponent:i=l1,transitionDuration:a="auto",TransitionProps:u}=s,f=je(s,Rt);R.useContext(D0);const{active:x,last:g,expanded:y}=R.useContext(V0),p=A({},s,{last:g}),d=Ct(p);let m=a;return a==="auto"&&!i.muiSupportAuto&&(m=void 0),o.jsx(yt,A({className:Ue(d.root,c),ref:l,ownerState:p},f,{children:o.jsx(zt,A({as:i,in:x||y,className:d.transition,ownerState:p,timeout:m,unmountOnExit:!0},u,{children:r}))}))});var S1={},kt=ke;Object.defineProperty(S1,"__esModule",{value:!0});var E0=S1.default=void 0,It=kt(Se()),Mt=o;E0=S1.default=(0,It.default)((0,Mt.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-2 10h-4v4h-2v-4H7v-2h4V7h2v4h4z"}),"AddBox");var k1={},Pt=ke;Object.defineProperty(k1,"__esModule",{value:!0});var B0=k1.default=void 0,Lt=Pt(Se()),Tt=o;B0=k1.default=(0,Lt.default)((0,Tt.jsx)("path",{d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H15v-8h5V8zm-1 7V3.5L18.5 9zm4 12.66V16h5.66v2h-2.24l2.95 2.95-1.41 1.41L19 19.41v2.24h-2z"}),"FileOpen");var I1={},Nt=ke;Object.defineProperty(I1,"__esModule",{value:!0});var A0=I1.default=void 0,Vt=Nt(Se()),Dt=o;A0=I1.default=(0,Vt.default)((0,Dt.jsx)("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutlineOutlined");function Ie({size:e,...t}){return o.jsx(z,{display:"flex",mt:4,...t,children:o.jsx(Oe,{size:e})})}Ie.propTypes={size:h.number};Ie.defaultProps={size:24};function M1({did:e,projectId:t,title:l,logo:s,describe:r}){const i=`${`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e}/${t}/logo/upload`}/${s}`,[a,u]=R.useState(!1),f=We(x=>x.breakpoints.down("md"));return o.jsxs(z,{sx:{display:"flex",flexDirection:"row",color:a?"primary.main":"grey.900",gap:1},onPointerEnter:()=>u(!0),onPointerLeave:()=>u(!1),children:[o.jsx(P0,{sx:{borderRadius:1},src:i}),o.jsxs(z,{children:[o.jsx(be,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:f?"primary.main":""},children:l||"/"}),o.jsx(be,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:f||a?"primary.main":"grey.700"},children:r||"/"})]})]})}M1.propTypes={projectId:h.string.isRequired,did:h.string.isRequired,title:h.string.isRequired,logo:h.string.isRequired,describe:h.string.isRequired};function P1({initUrl:e}){const t=v1(),l=(e==null?void 0:e.searchParams.get("tenantScope"))||"",{t:s,locale:r}=te(),{api:c}=we(),{api:i}=s1(),[a,u]=R.useState(!0),{blocklet:f}=Ve(),[x,g]=R.useState(null),[y,p]=R.useState(!1),d=We(k=>k.breakpoints.down("xl")),{componentDid:m=""}=n1(),[b,v]=R.useState(null),C=()=>{c.getProjects({input:{did:f.meta.did,componentDid:m,tenantScope:l}}).then(k=>{const L=(k==null?void 0:k.projects)||[];u(!1),v(L)}).catch(k=>{u(!1),$.error(k.message)})},S=()=>{t(`${X.UNOWNED_DID}/create/none`,{replace:!0})},N=k=>{g(k)},T=()=>{u(!1),p(!0)},P=()=>{p(!1),g(null)},I=k=>{$.error(k.message),p(!1),g(null)},U=k=>{if(!(k!=null&&k.deleted)){$.error("Delete project failed");return}C(),p(!1),g(null)};if(R.useEffect(()=>{C()},[]),!b&&a)return o.jsx(z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:o.jsx(Ie,{})});if(!b)return null;if(!b.length)return o.jsxs(z,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[o.jsx(z,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:s("blocklet.publish.blockletEmptyTip")}),o.jsx(z,{sx:{fontSize:14,color:"text.secondary",mb:3},children:s("blocklet.publish.createBlockletTip")}),o.jsx(e1,{onClick:S,variant:"contained",children:s("blocklet.publish.createBlocklet")})]});const V=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:k=>{const L=b[k];return o.jsx(ue,{to:`${L.id}`,children:o.jsx(M1,{did:f.meta.did,projectId:L.id,logo:L.blockletLogo,title:L.blockletTitle,describe:L.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{customBodyRender:k=>k?o.jsx(M0,{type:"success",children:k}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:k=>k?o.jsx(Y1,{size:14,compact:!0,responsive:!1,did:k}):null}},d||m?null:{label:s("common.createdBy"),name:"createdBy",options:{customBodyRender:k=>k?o.jsx(Y1,{onClick:()=>{t(`/.well-known/service/admin/members?did=${k}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:k}):null}},d||m?null:{label:s("common.scope"),name:"componentDid",options:{customBodyRender:k=>{const L=(f.children||[]).find(E=>E.meta.did===k);return L?o.jsxs(z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(C1,{size:14,blocklet:L,ancestors:[f]}),o.jsx(z,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:L.meta.title})]},k):""}}},d||l?null:{label:s("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:k=>o.jsx(z,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:o.jsx(be,{children:k})})}},{label:s("common.updatedAt"),name:"updatedAt",options:{customBodyRender:k=>o.jsx(b0,{value:Number(k),locale:r})}},{label:s("common.actions"),name:"actions",options:{customBodyRenderLite:k=>{const L=b[k];return o.jsxs(z,{display:"flex",children:[o.jsx(ue,{to:`${L.id}/new-release/${L.lastReleaseId}`,children:o.jsx(ve,{title:s("blocklet.publish.createRelease"),placement:"top",children:o.jsx(ge,{color:"primary","aria-label":"create",children:o.jsx(E0,{style:{fontSize:18}})})})}),!!L.lastReleaseId&&o.jsx(ve,{title:s("blocklet.publish.viewLastRelease",{name:L.blockletTitle}),placement:"top",children:o.jsx(ge,{color:"secondary","aria-label":"create",children:o.jsx(ue,{style:{display:"flex"},to:`${L.id}/view/${L.lastReleaseId}`,children:o.jsx(B0,{sx:{fontSize:18}})})})}),o.jsx(ve,{title:s("blocklet.publish.delete",{name:L.blockletTitle}),placement:"top",children:o.jsx(ge,{color:"primary","aria-label":"delete",onClick:()=>N(L),children:o.jsx(I0,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),M=y?o.jsx(h2,{open:!0,popup:!0,onClose:P,action:"check-has-project-id",locale:r,checkFn:i.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:U,onError:I,extraParams:{projectId:x.id,did:f.meta.did,name:x.blockletTitle},messages:{title:s("blocklet.publish.deleteProject.title",{name:x.blockletTitle}),scan:s("blocklet.publish.deleteProject.scan",{name:x.blockletTitle}),confirm:s("blocklet.publish.deleteProject.confirm"),success:s("blocklet.publish.deleteProject.success")}}):null;return o.jsxs(_t,{children:[o.jsxs(z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[o.jsxs(z,{display:"flex",flexDirection:"row",alignItems:"center",children:[o.jsx(z,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:s("common.blockletStudio")}),o.jsx(ve,{title:s("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:o.jsx(A0,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),o.jsxs(e1,{onClick:S,variant:"contained",children:[o.jsx(j1,{style:{fontSize:"1.3em",marginRight:4}}),s("blocklet.publish.createBlocklet")]})]}),o.jsx(z,{mt:3}),o.jsx(w1,{className:"main-table",locale:r,data:b,columns:V,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1}}),x&&o.jsx(R1,{title:`${s("common.delete")} ${x.blockletTitle}`,description:s("blocklet.publish.deleteProject.description"),confirm:s("common.confirm"),onConfirm:T,onCancel:()=>g(null),children:o.jsx(z,{sx:{marginTop:2},children:[s("blocklet.publish.deleteProject.tip1"),s("blocklet.publish.deleteProject.tip2"),s("blocklet.publish.deleteProject.tip3")].map(k=>o.jsxs(z,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[o.jsx(I2,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),o.jsx(G,{component:"span",variant:"inherit",color:"text.secondary",children:k})]}))})}),M]})}P1.propTypes={initUrl:h.object};P1.defaultProps={initUrl:null};const _t=ae(z)`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/react-DnVaFLUv.js","assets/index-D0ZDnsBw.js","assets/index-D8NuaJ66.css","assets/index-DZZkPDZs.js","assets/index-BJ0k59Tf.js","assets/index-DMhVY_t6.js","assets/toUpper-o91NwuX3.js","assets/index-YwELWQn6.js","assets/fallback-C9ko-lGM.js","assets/index-C-yt1SFf.js","assets/Menu-DAx78rf8.js","assets/Toolbar-Czbh9Thi.js","assets/Hidden-BnLj1Yrh.js","assets/index-CbJ7Ycw4.js","assets/MoreVert-pbCfz7_a.js","assets/FormControlLabel-DsxW3p6G.js","assets/useFormControl-CXaDIKmg.js","assets/Stack-CzT1qtfF.js","assets/ListItemButton-D3vwOyXA.js","assets/selector-Ckqt3gtd.js","assets/ExpandMore-BW_GpjfP.js","assets/Avatar-DdU9cWoa.js","assets/useSlot-CDeXSS5P.js","assets/resource-dialog-BSFeyQ_K.js","assets/index-D2bv65kG.js","assets/emotion-cache.browser.esm-BjIoAnXy.js","assets/OpenInNew-DH9cfgTx.js","assets/index-BB2DzNFr.js","assets/index-yjZBmDn6.js","assets/CloseOutlined-C_enpVct.js","assets/Link-BSkaanak.js","assets/index-YhmyCsjd.js","assets/index-ximM9jK2.js","assets/index-DUvxK_pJ.js","assets/index-BSHqUvvB.js","assets/useThemeProps-CBbxmVEG.js","assets/Grid-Dne3bmfg.js","assets/index-CIO5rH3U.js","assets/redux-Ca86ARNo.js","assets/ViewColumn-adtX8zvr.js","assets/FormControl-y2eP2gzP.js","assets/FormGroup-COgg0lwB.js","assets/Select-BJHtvl4z.js","assets/InputLabel-DlIX2kte.js","assets/Delete-CghY174I.js","assets/TextField-DNDZQTge.js","assets/LastPage-BAT94flJ.js","assets/Search-RYv9IOCL.js","assets/index-Cdj39Rch.js","assets/deprecate-BG-RqYhQ.js","assets/url-join-Bx_A70NM.js","assets/uniqBy-Chi1M0dq.js","assets/purify.es-Bq0E5Q3l.js","assets/react-AgKpYdvC.css"])))=>i.map(i=>d[i]);
2
+ import{at as d2,j as o,aG as se,cQ as g0,aK as A,fG as X1,aJ as je,aE as $e,aF as Fe,T as G,r as R,aI as m1,aL as u2,aM as Ue,aN as qe,cX as p2,fH as l1,X as Se,Y as ke,B as z,n as Oe,P as h,$ as We,G as X,e as v1,u as te,aP as we,aY as Ve,bx as n1,a1 as e1,L as ue,bL as b0,a as ve,aC as ge,K as h2,t as $,Z as ae,dE as f2,aa as ye,c as pe,I as x2,bW as g1,ci as j0,cL as m2,cU as He,cV as w0,aj as v2,da as g2,cP as Je,bF as re,c3 as Qe,fs as b2,a8 as J1,fI as j2,b as ne,bm as R0,ek as C0,ai as b1,bn as y0,cz as z0,aT as Ae,aS as w2,a3 as S0,fJ as Q1,ff as Le,bk as R2,au as k0,d2 as C2,l as y2,aB as z2,aq as S2,ar as i1}from"./index-D0ZDnsBw.js";import{d as j1}from"./Add-DEc5Gaew.js";import{d as I0,a as k2}from"./Delete-CghY174I.js";import{d as I2}from"./Error-D_y85can.js";import{D as w1}from"./index-BSHqUvvB.js";import{T as M0,b as M2}from"./index-DO83-4pr.js";import{C as R1}from"./confirm-CDYYkoPB.js";import{u as s1}from"./session-BT3UDuRe.js";import{W as Y1}from"./did-address-DvBIH5D8.js";import{B as C1}from"./bundle-avatar-Dx1RwhB-.js";import{S as be}from"./shorten-label-cwsaVcrz.js";import{A as P0}from"./Avatar-DdU9cWoa.js";import{d as P2}from"./Download-0mTt88jR.js";import{d as L2}from"./QuestionMarkCircle-Nkpa63G6.js";import{b as T2,c as Z1,T as N2}from"./index-YhmyCsjd.js";import{_ as Pe}from"./useSetState-7DwsrT08.js";import{c as y1}from"./index-DMhVY_t6.js";import{C as u1,L as V2}from"./MoreVert-pbCfz7_a.js";import{A as L0}from"./Alert-CupQqU2h.js";import{p as t1}from"./index-D9IhBRcZ.js";import"./api-DLSmmaM3.js";import{i as D2}from"./index-yjZBmDn6.js";import{d as _2}from"./ExpandMore-BW_GpjfP.js";import{d as E2}from"./ChevronRight-CBiHXwpN.js";import{d as B2}from"./OpenInNew-DH9cfgTx.js";import{u as T0}from"./useThemeProps-CBbxmVEG.js";import{F as p1}from"./FormControlLabel-DsxW3p6G.js";import{u as A2}from"./useSlotProps-y4Nw2SFi.js";import{d as O2}from"./DeleteOutline-DTzpYuUU.js";import{c as H2,A as N0,u as $2,S as F2,U as U2}from"./item-BAa88ldN.js";import{d as q2}from"./ArrowDropDown-B1k8ApwT.js";import{f as Ne}from"./format-error-B-leFeoI.js";import{B as h1}from"./ButtonGroup-DU8AIwgk.js";import{T as Te}from"./TextField-DNDZQTge.js";import{I as z1}from"./InputAdornment-vYojJBmt.js";import{C as W2}from"./click-to-copy-CerMtW1G.js";import{d as G2}from"./Launch-BMtVhnlU.js";import{S as e0}from"./index-DUvxK_pJ.js";import{M as K2}from"./index-HsQ3WMC6.js";import{p as X2}from"./purify.es-Bq0E5Q3l.js";import{r as J2}from"./index-B2w_BGLq.js";import{d as Q2}from"./Done-CRBMAgWC.js";import{c as V0,d as D0,b as Y2,S as Z2,a as et}from"./Stepper-DIDg14Y1.js";import{S as tt}from"./Stack-CzT1qtfF.js";import{R as ot,a as t0}from"./RadioGroup-BFz6MuWT.js";import"./Grid-Dne3bmfg.js";import"./emotion-cache.browser.esm-BjIoAnXy.js";import"./index-CIO5rH3U.js";import"./redux-Ca86ARNo.js";import"./ViewColumn-adtX8zvr.js";import"./FormControl-y2eP2gzP.js";import"./useFormControl-CXaDIKmg.js";import"./FormGroup-COgg0lwB.js";import"./Select-BJHtvl4z.js";import"./InputLabel-DlIX2kte.js";import"./LastPage-BAT94flJ.js";import"./Toolbar-Czbh9Thi.js";import"./Search-RYv9IOCL.js";import"./index-ximM9jK2.js";import"./DialogContentText-KJ1VziGc.js";import"./Link-BSkaanak.js";import"./useSlot-CDeXSS5P.js";import"./jss-plugin-props-sort.esm-K8zlWBTt.js";const lt=d2(o.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreHoriz"),nt=["slots","slotProps"],st=se(g0)(({theme:e})=>A({display:"flex",marginLeft:`calc(${e.spacing(1)} * 0.5)`,marginRight:`calc(${e.spacing(1)} * 0.5)`},e.palette.mode==="light"?{backgroundColor:e.palette.grey[100],color:e.palette.grey[700]}:{backgroundColor:e.palette.grey[700],color:e.palette.grey[100]},{borderRadius:2,"&:hover, &:focus":A({},e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}),"&:active":A({boxShadow:e.shadows[0]},e.palette.mode==="light"?{backgroundColor:X1(e.palette.grey[200],.12)}:{backgroundColor:X1(e.palette.grey[600],.12)})})),rt=se(lt)({width:24,height:16});function it(e){const{slots:t={},slotProps:l={}}=e,s=je(e,nt),r=e;return o.jsx("li",{children:o.jsx(st,A({focusRipple:!0},s,{ownerState:r,children:o.jsx(rt,A({as:t.CollapsedIcon,ownerState:r},l.collapsedIcon))}))})}function at(e){return Fe("MuiBreadcrumbs",e)}const ct=$e("MuiBreadcrumbs",["root","ol","li","separator"]),dt=["children","className","component","slots","slotProps","expandText","itemsAfterCollapse","itemsBeforeCollapse","maxItems","separator"],ut=e=>{const{classes:t}=e;return qe({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},at,t)},pt=se(G,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,t)=>[{[`& .${ct.li}`]:t.li},t.root]})({}),ht=se("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(e,t)=>t.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),ft=se("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(e,t)=>t.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function xt(e,t,l,s){return e.reduce((r,c,i)=>(i<e.length-1?r=r.concat(c,o.jsx(ft,{"aria-hidden":!0,className:t,ownerState:s,children:l},`separator-${i}`)):r.push(c),r),[])}const _0=R.forwardRef(function(t,l){const s=m1({props:t,name:"MuiBreadcrumbs"}),{children:r,className:c,component:i="nav",slots:a={},slotProps:u={},expandText:f="Show path",itemsAfterCollapse:x=1,itemsBeforeCollapse:g=1,maxItems:y=8,separator:p="/"}=s,d=je(s,dt),[m,b]=R.useState(!1),v=A({},s,{component:i,expanded:m,expandText:f,itemsAfterCollapse:x,itemsBeforeCollapse:g,maxItems:y,separator:p}),C=ut(v),S=u2({elementType:a.CollapsedIcon,externalSlotProps:u.collapsedIcon,ownerState:v}),N=R.useRef(null),T=I=>{const U=()=>{b(!0);const V=N.current.querySelector("a[href],button,[tabindex]");V&&V.focus()};return g+x>=I.length?I:[...I.slice(0,g),o.jsx(it,{"aria-label":f,slots:{CollapsedIcon:a.CollapsedIcon},slotProps:{collapsedIcon:S},onClick:U},"ellipsis"),...I.slice(I.length-x,I.length)]},P=R.Children.toArray(r).filter(I=>R.isValidElement(I)).map((I,U)=>o.jsx("li",{className:C.li,children:I},`child-${U}`));return o.jsx(pt,A({ref:l,component:i,color:"text.secondary",className:Ue(C.root,c),ownerState:v},d,{children:o.jsx(ht,{className:C.ol,ref:N,ownerState:v,children:xt(m||y&&P.length<=y?P:T(P),C.separator,p,v)})}))});function mt(e){return Fe("MuiStepButton",e)}const o0=$e("MuiStepButton",["root","horizontal","vertical","touchRipple"]),vt=["children","className","icon","optional"],gt=e=>{const{classes:t,orientation:l}=e;return qe({root:["root",l],touchRipple:["touchRipple"]},mt,t)},bt=se(g0,{name:"MuiStepButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[{[`& .${o0.touchRipple}`]:t.touchRipple},t.root,t[l.orientation]]}})(({ownerState:e})=>A({width:"100%",padding:"24px 16px",margin:"-24px -16px",boxSizing:"content-box"},e.orientation==="vertical"&&{justifyContent:"flex-start",padding:"8px",margin:"-8px"},{[`& .${o0.touchRipple}`]:{color:"rgba(0, 0, 0, 0.3)"}})),jt=R.forwardRef(function(t,l){const s=m1({props:t,name:"MuiStepButton"}),{children:r,className:c,icon:i,optional:a}=s,u=je(s,vt),{disabled:f,active:x}=R.useContext(V0),{orientation:g}=R.useContext(D0),y=A({},s,{orientation:g}),p=gt(y),d={icon:i,optional:a},m=p2(r,["StepLabel"])?R.cloneElement(r,d):o.jsx(Y2,A({},d,{children:r}));return o.jsx(bt,A({focusRipple:!0,disabled:f,TouchRippleProps:{className:p.touchRipple},className:Ue(p.root,c),ref:l,ownerState:y,"aria-current":x?"step":void 0},u,{children:m}))});function wt(e){return Fe("MuiStepContent",e)}$e("MuiStepContent",["root","last","transition"]);const Rt=["children","className","TransitionComponent","transitionDuration","TransitionProps"],Ct=e=>{const{classes:t,last:l}=e;return qe({root:["root",l&&"last"],transition:["transition"]},wt,t)},yt=se("div",{name:"MuiStepContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.root,l.last&&t.last]}})(({ownerState:e,theme:t})=>A({marginLeft:12,paddingLeft:20,paddingRight:8,borderLeft:t.vars?`1px solid ${t.vars.palette.StepContent.border}`:`1px solid ${t.palette.mode==="light"?t.palette.grey[400]:t.palette.grey[600]}`},e.last&&{borderLeft:"none"})),zt=se(l1,{name:"MuiStepContent",slot:"Transition",overridesResolver:(e,t)=>t.transition})({}),St=R.forwardRef(function(t,l){const s=m1({props:t,name:"MuiStepContent"}),{children:r,className:c,TransitionComponent:i=l1,transitionDuration:a="auto",TransitionProps:u}=s,f=je(s,Rt);R.useContext(D0);const{active:x,last:g,expanded:y}=R.useContext(V0),p=A({},s,{last:g}),d=Ct(p);let m=a;return a==="auto"&&!i.muiSupportAuto&&(m=void 0),o.jsx(yt,A({className:Ue(d.root,c),ref:l,ownerState:p},f,{children:o.jsx(zt,A({as:i,in:x||y,className:d.transition,ownerState:p,timeout:m,unmountOnExit:!0},u,{children:r}))}))});var S1={},kt=ke;Object.defineProperty(S1,"__esModule",{value:!0});var E0=S1.default=void 0,It=kt(Se()),Mt=o;E0=S1.default=(0,It.default)((0,Mt.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-2 10h-4v4h-2v-4H7v-2h4V7h2v4h4z"}),"AddBox");var k1={},Pt=ke;Object.defineProperty(k1,"__esModule",{value:!0});var B0=k1.default=void 0,Lt=Pt(Se()),Tt=o;B0=k1.default=(0,Lt.default)((0,Tt.jsx)("path",{d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H15v-8h5V8zm-1 7V3.5L18.5 9zm4 12.66V16h5.66v2h-2.24l2.95 2.95-1.41 1.41L19 19.41v2.24h-2z"}),"FileOpen");var I1={},Nt=ke;Object.defineProperty(I1,"__esModule",{value:!0});var A0=I1.default=void 0,Vt=Nt(Se()),Dt=o;A0=I1.default=(0,Vt.default)((0,Dt.jsx)("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutlineOutlined");function Ie({size:e,...t}){return o.jsx(z,{display:"flex",mt:4,...t,children:o.jsx(Oe,{size:e})})}Ie.propTypes={size:h.number};Ie.defaultProps={size:24};function M1({did:e,projectId:t,title:l,logo:s,describe:r}){const i=`${`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e}/${t}/logo/upload`}/${s}`,[a,u]=R.useState(!1),f=We(x=>x.breakpoints.down("md"));return o.jsxs(z,{sx:{display:"flex",flexDirection:"row",color:a?"primary.main":"grey.900",gap:1},onPointerEnter:()=>u(!0),onPointerLeave:()=>u(!1),children:[o.jsx(P0,{sx:{borderRadius:1},src:i}),o.jsxs(z,{children:[o.jsx(be,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:f?"primary.main":""},children:l||"/"}),o.jsx(be,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:f||a?"primary.main":"grey.700"},children:r||"/"})]})]})}M1.propTypes={projectId:h.string.isRequired,did:h.string.isRequired,title:h.string.isRequired,logo:h.string.isRequired,describe:h.string.isRequired};function P1({initUrl:e}){const t=v1(),l=(e==null?void 0:e.searchParams.get("tenantScope"))||"",{t:s,locale:r}=te(),{api:c}=we(),{api:i}=s1(),[a,u]=R.useState(!0),{blocklet:f}=Ve(),[x,g]=R.useState(null),[y,p]=R.useState(!1),d=We(k=>k.breakpoints.down("xl")),{componentDid:m=""}=n1(),[b,v]=R.useState(null),C=()=>{c.getProjects({input:{did:f.meta.did,componentDid:m,tenantScope:l}}).then(k=>{const L=(k==null?void 0:k.projects)||[];u(!1),v(L)}).catch(k=>{u(!1),$.error(k.message)})},S=()=>{t(`${X.UNOWNED_DID}/create/none`,{replace:!0})},N=k=>{g(k)},T=()=>{u(!1),p(!0)},P=()=>{p(!1),g(null)},I=k=>{$.error(k.message),p(!1),g(null)},U=k=>{if(!(k!=null&&k.deleted)){$.error("Delete project failed");return}C(),p(!1),g(null)};if(R.useEffect(()=>{C()},[]),!b&&a)return o.jsx(z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:o.jsx(Ie,{})});if(!b)return null;if(!b.length)return o.jsxs(z,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[o.jsx(z,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:s("blocklet.publish.blockletEmptyTip")}),o.jsx(z,{sx:{fontSize:14,color:"text.secondary",mb:3},children:s("blocklet.publish.createBlockletTip")}),o.jsx(e1,{onClick:S,variant:"contained",children:s("blocklet.publish.createBlocklet")})]});const V=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:k=>{const L=b[k];return o.jsx(ue,{to:`${L.id}`,children:o.jsx(M1,{did:f.meta.did,projectId:L.id,logo:L.blockletLogo,title:L.blockletTitle,describe:L.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{customBodyRender:k=>k?o.jsx(M0,{type:"success",children:k}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:k=>k?o.jsx(Y1,{size:14,compact:!0,responsive:!1,did:k}):null}},d||m?null:{label:s("common.createdBy"),name:"createdBy",options:{customBodyRender:k=>k?o.jsx(Y1,{onClick:()=>{t(`/.well-known/service/admin/members?did=${k}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:k}):null}},d||m?null:{label:s("common.scope"),name:"componentDid",options:{customBodyRender:k=>{const L=(f.children||[]).find(E=>E.meta.did===k);return L?o.jsxs(z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(C1,{size:14,blocklet:L,ancestors:[f]}),o.jsx(z,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:L.meta.title})]},k):""}}},d||l?null:{label:s("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:k=>o.jsx(z,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:o.jsx(be,{children:k})})}},{label:s("common.updatedAt"),name:"updatedAt",options:{customBodyRender:k=>o.jsx(b0,{value:Number(k),locale:r})}},{label:s("common.actions"),name:"actions",options:{customBodyRenderLite:k=>{const L=b[k];return o.jsxs(z,{display:"flex",children:[o.jsx(ue,{to:`${L.id}/new-release/${L.lastReleaseId}`,children:o.jsx(ve,{title:s("blocklet.publish.createRelease"),placement:"top",children:o.jsx(ge,{color:"primary","aria-label":"create",children:o.jsx(E0,{style:{fontSize:18}})})})}),!!L.lastReleaseId&&o.jsx(ve,{title:s("blocklet.publish.viewLastRelease",{name:L.blockletTitle}),placement:"top",children:o.jsx(ge,{color:"secondary","aria-label":"create",children:o.jsx(ue,{style:{display:"flex"},to:`${L.id}/view/${L.lastReleaseId}`,children:o.jsx(B0,{sx:{fontSize:18}})})})}),o.jsx(ve,{title:s("blocklet.publish.delete",{name:L.blockletTitle}),placement:"top",children:o.jsx(ge,{color:"primary","aria-label":"delete",onClick:()=>N(L),children:o.jsx(I0,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),M=y?o.jsx(h2,{open:!0,popup:!0,onClose:P,action:"check-has-project-id",locale:r,checkFn:i.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:U,onError:I,extraParams:{projectId:x.id,did:f.meta.did,name:x.blockletTitle},messages:{title:s("blocklet.publish.deleteProject.title",{name:x.blockletTitle}),scan:s("blocklet.publish.deleteProject.scan",{name:x.blockletTitle}),confirm:s("blocklet.publish.deleteProject.confirm"),success:s("blocklet.publish.deleteProject.success")}}):null;return o.jsxs(_t,{children:[o.jsxs(z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[o.jsxs(z,{display:"flex",flexDirection:"row",alignItems:"center",children:[o.jsx(z,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:s("common.blockletStudio")}),o.jsx(ve,{title:s("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:o.jsx(A0,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),o.jsxs(e1,{onClick:S,variant:"contained",children:[o.jsx(j1,{style:{fontSize:"1.3em",marginRight:4}}),s("blocklet.publish.createBlocklet")]})]}),o.jsx(z,{mt:3}),o.jsx(w1,{className:"main-table",locale:r,data:b,columns:V,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1}}),x&&o.jsx(R1,{title:`${s("common.delete")} ${x.blockletTitle}`,description:s("blocklet.publish.deleteProject.description"),confirm:s("common.confirm"),onConfirm:T,onCancel:()=>g(null),children:o.jsx(z,{sx:{marginTop:2},children:[s("blocklet.publish.deleteProject.tip1"),s("blocklet.publish.deleteProject.tip2"),s("blocklet.publish.deleteProject.tip3")].map(k=>o.jsxs(z,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[o.jsx(I2,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),o.jsx(G,{component:"span",variant:"inherit",color:"text.secondary",children:k})]}))})}),M]})}P1.propTypes={initUrl:h.object};P1.defaultProps={initUrl:null};const _t=ae(z)`
3
3
  .main-table > div:first-child {
4
4
  display: none;
5
5
  }
@@ -133,7 +133,7 @@ import{at as d2,j as o,aG as se,cP as g0,aK as A,fG as X1,aJ as je,aE as $e,aF a
133
133
  background: #fff;
134
134
  z-index: 10;
135
135
  }
136
- `,c0="lastWantToConnectStoreId";function Kl(e){var a,u;const[t,l]=R.useState(null),{session:s}=s1(),r=R.useCallback(f=>{l(f),localStorage.setItem(c0,f==null?void 0:f.id)},[l]),c=R.useMemo(()=>{var y,p,d,m;const f=localStorage.getItem(c0),x=f?(((y=e==null?void 0:e.settings)==null?void 0:y.storeList)||[]).find(b=>b.id===f):null;if(x)return x;let g=(((p=e==null?void 0:e.settings)==null?void 0:p.storeList)||[]).find(b=>{var v;return!(b.id!==X.BLOCKLET_STORE.id||b.scope&&b.scope!=="studio"&&b.scope!==((v=s==null?void 0:s.user)==null?void 0:v.did))});return g||(g=(m=(d=e==null?void 0:e.settings)==null?void 0:d.storeList)==null?void 0:m[0]),g},[(a=e==null?void 0:e.settings)==null?void 0:a.storeList,(u=s==null?void 0:s.user)==null?void 0:u.did]);return[t||c||{},r]}const d1={};async function K0(e,{interval:t=1e3,maxDuration:l=120*1e3,intervalFirst:s=4e3,timerKey:r=""}){d1[r]&&clearTimeout(d1[r]),await new Promise(a=>setTimeout(a,s));const c=Date.now(),i=async(a,u)=>{try{const f=await e();a(f)}catch(f){Date.now()-c>l?u(f):r?d1[r]=setTimeout(()=>i(a,u),t):setTimeout(()=>i(a,u),t)}};return new Promise(i)}function Xl(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function Jl(e,{did:t,projectId:l,messageId:s}){return K0(async()=>{var c;const r=await e.getProject({input:{did:t,projectId:l,messageId:s}});if(!((c=r==null?void 0:r.project)!=null&&c.blockletDid))throw new Error("Connected store not found");return r.project.blockletDid},{timerKey:"connect-studio"})}function Ql(e,{did:t,projectId:l,storeId:s}){return K0(async()=>{var i,a;const r=await e.getProject({input:{did:t,projectId:l,messageId:""}});if(!((a=(i=r==null?void 0:r.project)==null?void 0:i.connectedStores)!=null&&a.length))throw new Error("Connected store not found");if(!r.project.connectedStores.find(u=>u.storeId===s))throw new Error("Connected store not found")},{timerKey:`connect-store-${s}`})}const X0=({fromBlocklet:e,nodeInfo:t,blocklet:l,userDid:s})=>{var i,a;const r=e?(i=l==null?void 0:l.meta)==null?void 0:i.did:t==null?void 0:t.did;let c=e?((a=l==null?void 0:l.settings)==null?void 0:a.storeList)||[]:(t==null?void 0:t.blockletRegistryList)||[];return Array.isArray(c)||(c=[]),c=c.filter(u=>u.protected||!u.scope||u.scope==="studio"||u.scope===s),{teamDid:r,storeList:c}};function H1({blocklet:e,store:t={},onChangeStore:l,onClick:s,disabled:r,loading:c,componentDid:i}){var L,E,B;const{t:a}=te(),{session:u}=s1(),{api:f,info:x,inService:g}=we(),y=Ve(),[p,d]=R.useState(!1),m=R.useRef(null),[b,v]=R.useState(!1),[C,S]=R.useState(null),N=O=>{l(O),d(!1)},T=()=>{d(!p)},P=O=>{m.current&&m.current.contains(O.target)||d(!1)},I=()=>{v(!0)},U=()=>{v(!1)},V=async()=>{var O;if(C)try{await f.deleteBlockletStore({input:{teamDid:e.meta.did,url:C.url,projectId:"",scope:C.scope||"studio"}}),await((O=y==null?void 0:y.actions)==null?void 0:O.refreshBlocklet())}catch(K){$.error(`Remove Blocklet Store Error: ${Ne(K)}`)}finally{S(null)}},{storeList:M}=X0({fromBlocklet:g,blocklet:e,nodeInfo:x,componentDid:i,userDid:(L=u==null?void 0:u.user)==null?void 0:L.did}),k=(E=e==null?void 0:e.meta)==null?void 0:E.did;return o.jsxs(o.Fragment,{children:[o.jsxs(h1,{disabled:r,ref:m,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[o.jsxs(ne,{onClick:s,children:[c&&o.jsx(Oe,{size:14,sx:{mr:.5}}),`${a("common.connect")} ${t.name||""}`]}),o.jsx(ne,{size:"small","aria-controls":p?"split-button-menu":void 0,"aria-expanded":p?"true":void 0,"aria-label":"select merge strategy","aria-haspopup":"menu",onClick:T,children:o.jsx(q2,{})})]}),o.jsx(R0,{sx:{zIndex:10},open:p,anchorEl:m.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:O})=>o.jsx(C0,{...O,style:{transformOrigin:"center top"},children:o.jsx(b1,{children:o.jsx(y0,{onClickAway:P,children:o.jsxs(z0,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[M==null?void 0:M.map(K=>{var J;return o.jsxs(Ae,{selected:K.id===(t==null?void 0:t.id),sx:{height:56},onClick:()=>N(K),children:[o.jsxs(z,{children:[o.jsx(be,{sx:{fontSize:"16px"},maxLength:24,children:K.name}),o.jsx(be,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:K.url})]}),H2({store:K,userDid:(J=u==null?void 0:u.user)==null?void 0:J.did})&&o.jsx(ge,{sx:{ml:1},onClick:W=>{W.preventDefault(),W.stopPropagation(),S(K)},children:o.jsx(re,{icon:"ic:outline-delete"})})]},K.url)}),o.jsx(w2,{}),o.jsxs(Ae,{onClick:I,children:[o.jsx(j1,{font:!0}),o.jsx(G,{variant:"inherit",children:a("store.blockletRegistry.addRegistry")})]})]})})})})}),b&&o.jsx(N0,{hiddenChildren:!0,open:!0,onClose:U,teamDid:k,storeList:M,scope:"studio",onAdd:(B=y==null?void 0:y.actions)==null?void 0:B.refreshBlocklet}),C&&o.jsx(R1,{displayError:!0,title:`${a("common.delete")} ${C.name}`,description:a("blocklet.publish.deleteStoreTip",{name:C.name}),confirm:a("common.confirm"),onConfirm:V,onCancel:()=>S(null)})]})}H1.propTypes={store:h.object,blocklet:h.object,onChangeStore:h.func.isRequired,onClick:h.func.isRequired,loading:h.bool.isRequired,disabled:h.bool.isRequired,componentDid:h.string.isRequired,projectType:h.string.isRequired,getData:h.func.isRequired};H1.defaultProps={store:null,blocklet:null};const d0=[".webp",".jpg",".jpeg",".png",".gif",".svg"],u0=1024*1024*10,p0=R.lazy(()=>S0(()=>import("./react-BeNwKB5d.js").then(e=>e.r),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52])).then(e=>({default:e.Uploader})));function J0({projectId:e,readOnly:t,loading:l,blocklet:s,params:r,setParams:c,paramsErrTip:i,setParamsErrTip:a,setLoading:u,initUrl:f,initLogoUrl:x,setInitLogoUrl:g,componentDid:y}){const{t:p}=te(),{api:d}=we(),m=v1(),b=R.useRef(null),v=R.useRef(null),[C,S]=Kl(s),N=$2({messageType:"connect-store-message",onOpen:()=>u(!0),onClose:()=>u(!1)}),T=async L=>{const E=setTimeout(()=>{u(!1)},2e4),B=await Jl(d,L);u(!1),clearTimeout(E),window.parent.postMessage({event:"studioDialog.connected",componentDid:y},"*"),m(window.location.pathname.replace(`${X.UNOWNED_DID}/create`,`${B}/create`),{replace:!0})},P=()=>{if(!r.blockletTitle){$.error(p("blocklet.publish.errorTip.noTitle"));return}if(!(C!=null&&C.url)){$.error(p("blocklet.publish.noStoreSelected"));return}const L=Xl();N(async(E,B)=>{var O,K,J;try{const W=await d.connectByStudio({input:{did:(O=s==null?void 0:s.meta)==null?void 0:O.did,blockletTitle:r==null?void 0:r.blockletTitle,storeUrl:C.url,storeId:C.id,storeName:C.name,type:((K=r==null?void 0:r.blockletComponents)==null?void 0:K.length)>0?"pack":"resource",componentDid:y,messageId:L,tenantScope:(f==null?void 0:f.searchParams.get("tenantScope"))||""}});if(!(W!=null&&W.url)){$.error("failed to connect to store");return}B(W.url),T({did:(J=s==null?void 0:s.meta)==null?void 0:J.did,projectId:"",messageId:L})}catch(W){const Z=Ne(W);$.error(Z),u(!1)}})},I=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${s.meta.did}/${e}/logo/upload`,U=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${s.meta.did}/${e}/screenshot/upload`,V=r!=null&&r.blockletLogo?`${I}/${r.blockletLogo}`:`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,M=((r==null?void 0:r.blockletScreenshots)||[]).filter(Boolean).map(L=>`${U}/${L}`),k=()=>t?!1:!e||e===X.UNOWNED_DID?($.error(p("blocklet.publish.errorTip.noFirstDid")),!1):!0;return o.jsxs(Yl,{children:[o.jsx(z,{display:"flex",className:"section",children:o.jsxs(z,{sx:{flex:1},children:[o.jsx(Te,{disabled:l||t,label:`Blocklet ${p("common.title")}`,placeholder:`Blocklet ${p("common.title")}`,InputProps:{"data-cy":"blocklet-title",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:r.blockletTitle||"",onChange:L=>{a({blockletTitle:""}),c({blockletTitle:L.target.value})},error:!!i.blockletTitle,helperText:i.blockletTitle||""}),o.jsx(Te,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"export-blocklet-did",endAdornment:e===X.UNOWNED_DID&&o.jsx(z1,{position:"end",children:o.jsx(H1,{blocklet:s,store:C,componentDid:y,onChangeStore:S,disabled:!r.blockletTitle||t||l,loading:l,onClick:P})})},error:!!i.projectId,helperText:i.projectId||"",value:e===X.UNOWNED_DID?"":`did:abt:${e}`,sx:{mt:3}}),o.jsx(Te,{disabled:l||t,label:`Blocklet ${p("common.description")}`,placeholder:`Blocklet ${p("common.description")}`,InputProps:{"data-cy":"blocklet-description",readOnly:t},required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:r.blockletDescription||"",onChange:L=>{a({blockletDescription:""}),c({blockletDescription:L.target.value})},error:!!i.blockletDescription,helperText:i.blockletDescription||"",sx:{mt:3}})]})}),o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(z,{sx:{flex:1},children:[o.jsxs(z,{display:"flex",children:[o.jsx(G,{variant:"subtitle1",sx:{mr:2},children:p("common.logo")}),o.jsx(z,{sx:{flex:1,cursor:t?"default":"pointer"},children:o.jsx(P0,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:x||V,onClick:()=>{k()&&b.current.open()}})})]}),o.jsxs(z,{display:"flex",mt:3,children:[o.jsx(G,{variant:"subtitle1",sx:{mr:2},children:p("common.screenshot")}),o.jsxs(z,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap"},children:[M.map((L,E)=>o.jsxs(z,{className:"screenshot",children:[o.jsx("img",{alt:"screenshot",src:L}),!t&&o.jsx(ge,{className:"action",onClick:()=>{c(B=>{const O=[...B.blockletScreenshots];return O.splice(E,1),{...B,blockletScreenshots:O}})},children:o.jsx(O2,{})})]},L)),M.length<5&&o.jsx(z,{sx:{width:200,height:140,background:"#eee",cursor:t?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{k()&&v.current.open()},children:"+"})]})]})]})}),o.jsxs(R.Suspense,{fallback:o.jsx(Ie,{}),children:[o.jsx(p0,{ref:b,popup:!0,onUploadFinish:L=>{c({blockletLogo:L.data.filename}),g(""),b.current.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:I,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:d0,maxFileSize:u0,maxNumberOfFiles:1}}},"uploader-logo"),o.jsx(p0,{ref:v,popup:!0,onUploadFinish:L=>{c(E=>{var O;const B=E.blockletScreenshots||[];return B.push((O=L.data)==null?void 0:O.filename),{...E,blockletScreenshots:B}}),v.current.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:U,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:d0,maxFileSize:u0,maxNumberOfFiles:5-M.length}}},"uploader-screenshot")]})]})}J0.propTypes={projectId:h.string.isRequired,readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,loading:h.bool.isRequired,blocklet:h.object.isRequired,setLoading:h.func.isRequired,initUrl:h.object.isRequired,componentDid:h.isRequired,initLogoUrl:h.string.isRequired,setInitLogoUrl:h.func.isRequired};const Yl=ae.div`
136
+ `,c0="lastWantToConnectStoreId";function Kl(e){var a,u;const[t,l]=R.useState(null),{session:s}=s1(),r=R.useCallback(f=>{l(f),localStorage.setItem(c0,f==null?void 0:f.id)},[l]),c=R.useMemo(()=>{var y,p,d,m;const f=localStorage.getItem(c0),x=f?(((y=e==null?void 0:e.settings)==null?void 0:y.storeList)||[]).find(b=>b.id===f):null;if(x)return x;let g=(((p=e==null?void 0:e.settings)==null?void 0:p.storeList)||[]).find(b=>{var v;return!(b.id!==X.BLOCKLET_STORE.id||b.scope&&b.scope!=="studio"&&b.scope!==((v=s==null?void 0:s.user)==null?void 0:v.did))});return g||(g=(m=(d=e==null?void 0:e.settings)==null?void 0:d.storeList)==null?void 0:m[0]),g},[(a=e==null?void 0:e.settings)==null?void 0:a.storeList,(u=s==null?void 0:s.user)==null?void 0:u.did]);return[t||c||{},r]}const d1={};async function K0(e,{interval:t=1e3,maxDuration:l=120*1e3,intervalFirst:s=4e3,timerKey:r=""}){d1[r]&&clearTimeout(d1[r]),await new Promise(a=>setTimeout(a,s));const c=Date.now(),i=async(a,u)=>{try{const f=await e();a(f)}catch(f){Date.now()-c>l?u(f):r?d1[r]=setTimeout(()=>i(a,u),t):setTimeout(()=>i(a,u),t)}};return new Promise(i)}function Xl(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function Jl(e,{did:t,projectId:l,messageId:s}){return K0(async()=>{var c;const r=await e.getProject({input:{did:t,projectId:l,messageId:s}});if(!((c=r==null?void 0:r.project)!=null&&c.blockletDid))throw new Error("Connected store not found");return r.project.blockletDid},{timerKey:"connect-studio"})}function Ql(e,{did:t,projectId:l,storeId:s}){return K0(async()=>{var i,a;const r=await e.getProject({input:{did:t,projectId:l,messageId:""}});if(!((a=(i=r==null?void 0:r.project)==null?void 0:i.connectedStores)!=null&&a.length))throw new Error("Connected store not found");if(!r.project.connectedStores.find(u=>u.storeId===s))throw new Error("Connected store not found")},{timerKey:`connect-store-${s}`})}const X0=({fromBlocklet:e,nodeInfo:t,blocklet:l,userDid:s})=>{var i,a;const r=e?(i=l==null?void 0:l.meta)==null?void 0:i.did:t==null?void 0:t.did;let c=e?((a=l==null?void 0:l.settings)==null?void 0:a.storeList)||[]:(t==null?void 0:t.blockletRegistryList)||[];return Array.isArray(c)||(c=[]),c=c.filter(u=>u.protected||!u.scope||u.scope==="studio"||u.scope===s),{teamDid:r,storeList:c}};function H1({blocklet:e,store:t={},onChangeStore:l,onClick:s,disabled:r,loading:c,componentDid:i}){var L,E,B;const{t:a}=te(),{session:u}=s1(),{api:f,info:x,inService:g}=we(),y=Ve(),[p,d]=R.useState(!1),m=R.useRef(null),[b,v]=R.useState(!1),[C,S]=R.useState(null),N=O=>{l(O),d(!1)},T=()=>{d(!p)},P=O=>{m.current&&m.current.contains(O.target)||d(!1)},I=()=>{v(!0)},U=()=>{v(!1)},V=async()=>{var O;if(C)try{await f.deleteBlockletStore({input:{teamDid:e.meta.did,url:C.url,projectId:"",scope:C.scope||"studio"}}),await((O=y==null?void 0:y.actions)==null?void 0:O.refreshBlocklet())}catch(K){$.error(`Remove Blocklet Store Error: ${Ne(K)}`)}finally{S(null)}},{storeList:M}=X0({fromBlocklet:g,blocklet:e,nodeInfo:x,componentDid:i,userDid:(L=u==null?void 0:u.user)==null?void 0:L.did}),k=(E=e==null?void 0:e.meta)==null?void 0:E.did;return o.jsxs(o.Fragment,{children:[o.jsxs(h1,{disabled:r,ref:m,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[o.jsxs(ne,{onClick:s,children:[c&&o.jsx(Oe,{size:14,sx:{mr:.5}}),`${a("common.connect")} ${t.name||""}`]}),o.jsx(ne,{size:"small","aria-controls":p?"split-button-menu":void 0,"aria-expanded":p?"true":void 0,"aria-label":"select merge strategy","aria-haspopup":"menu",onClick:T,children:o.jsx(q2,{})})]}),o.jsx(R0,{sx:{zIndex:10},open:p,anchorEl:m.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:O})=>o.jsx(C0,{...O,style:{transformOrigin:"center top"},children:o.jsx(b1,{children:o.jsx(y0,{onClickAway:P,children:o.jsxs(z0,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[M==null?void 0:M.map(K=>{var J;return o.jsxs(Ae,{selected:K.id===(t==null?void 0:t.id),sx:{height:56},onClick:()=>N(K),children:[o.jsxs(z,{children:[o.jsx(be,{sx:{fontSize:"16px"},maxLength:24,children:K.name}),o.jsx(be,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:K.url})]}),H2({store:K,userDid:(J=u==null?void 0:u.user)==null?void 0:J.did})&&o.jsx(ge,{sx:{ml:1},onClick:W=>{W.preventDefault(),W.stopPropagation(),S(K)},children:o.jsx(re,{icon:"ic:outline-delete"})})]},K.url)}),o.jsx(w2,{}),o.jsxs(Ae,{onClick:I,children:[o.jsx(j1,{font:!0}),o.jsx(G,{variant:"inherit",children:a("store.blockletRegistry.addRegistry")})]})]})})})})}),b&&o.jsx(N0,{hiddenChildren:!0,open:!0,onClose:U,teamDid:k,storeList:M,scope:"studio",onAdd:(B=y==null?void 0:y.actions)==null?void 0:B.refreshBlocklet}),C&&o.jsx(R1,{displayError:!0,title:`${a("common.delete")} ${C.name}`,description:a("blocklet.publish.deleteStoreTip",{name:C.name}),confirm:a("common.confirm"),onConfirm:V,onCancel:()=>S(null)})]})}H1.propTypes={store:h.object,blocklet:h.object,onChangeStore:h.func.isRequired,onClick:h.func.isRequired,loading:h.bool.isRequired,disabled:h.bool.isRequired,componentDid:h.string.isRequired,projectType:h.string.isRequired,getData:h.func.isRequired};H1.defaultProps={store:null,blocklet:null};const d0=[".webp",".jpg",".jpeg",".png",".gif",".svg"],u0=1024*1024*10,p0=R.lazy(()=>S0(()=>import("./react-DnVaFLUv.js").then(e=>e.r),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53])).then(e=>({default:e.Uploader})));function J0({projectId:e,readOnly:t,loading:l,blocklet:s,params:r,setParams:c,paramsErrTip:i,setParamsErrTip:a,setLoading:u,initUrl:f,initLogoUrl:x,setInitLogoUrl:g,componentDid:y}){const{t:p}=te(),{api:d}=we(),m=v1(),b=R.useRef(null),v=R.useRef(null),[C,S]=Kl(s),N=$2({messageType:"connect-store-message",onOpen:()=>u(!0),onClose:()=>u(!1)}),T=async L=>{const E=setTimeout(()=>{u(!1)},2e4),B=await Jl(d,L);u(!1),clearTimeout(E),window.parent.postMessage({event:"studioDialog.connected",componentDid:y},"*"),m(window.location.pathname.replace(`${X.UNOWNED_DID}/create`,`${B}/create`),{replace:!0})},P=()=>{if(!r.blockletTitle){$.error(p("blocklet.publish.errorTip.noTitle"));return}if(!(C!=null&&C.url)){$.error(p("blocklet.publish.noStoreSelected"));return}const L=Xl();N(async(E,B)=>{var O,K,J;try{const W=await d.connectByStudio({input:{did:(O=s==null?void 0:s.meta)==null?void 0:O.did,blockletTitle:r==null?void 0:r.blockletTitle,storeUrl:C.url,storeId:C.id,storeName:C.name,type:((K=r==null?void 0:r.blockletComponents)==null?void 0:K.length)>0?"pack":"resource",componentDid:y,messageId:L,tenantScope:(f==null?void 0:f.searchParams.get("tenantScope"))||""}});if(!(W!=null&&W.url)){$.error("failed to connect to store");return}B(W.url),T({did:(J=s==null?void 0:s.meta)==null?void 0:J.did,projectId:"",messageId:L})}catch(W){const Z=Ne(W);$.error(Z),u(!1)}})},I=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${s.meta.did}/${e}/logo/upload`,U=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${s.meta.did}/${e}/screenshot/upload`,V=r!=null&&r.blockletLogo?`${I}/${r.blockletLogo}`:`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,M=((r==null?void 0:r.blockletScreenshots)||[]).filter(Boolean).map(L=>`${U}/${L}`),k=()=>t?!1:!e||e===X.UNOWNED_DID?($.error(p("blocklet.publish.errorTip.noFirstDid")),!1):!0;return o.jsxs(Yl,{children:[o.jsx(z,{display:"flex",className:"section",children:o.jsxs(z,{sx:{flex:1},children:[o.jsx(Te,{disabled:l||t,label:`Blocklet ${p("common.title")}`,placeholder:`Blocklet ${p("common.title")}`,InputProps:{"data-cy":"blocklet-title",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:r.blockletTitle||"",onChange:L=>{a({blockletTitle:""}),c({blockletTitle:L.target.value})},error:!!i.blockletTitle,helperText:i.blockletTitle||""}),o.jsx(Te,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"export-blocklet-did",endAdornment:e===X.UNOWNED_DID&&o.jsx(z1,{position:"end",children:o.jsx(H1,{blocklet:s,store:C,componentDid:y,onChangeStore:S,disabled:!r.blockletTitle||t||l,loading:l,onClick:P})})},error:!!i.projectId,helperText:i.projectId||"",value:e===X.UNOWNED_DID?"":`did:abt:${e}`,sx:{mt:3}}),o.jsx(Te,{disabled:l||t,label:`Blocklet ${p("common.description")}`,placeholder:`Blocklet ${p("common.description")}`,InputProps:{"data-cy":"blocklet-description",readOnly:t},required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:r.blockletDescription||"",onChange:L=>{a({blockletDescription:""}),c({blockletDescription:L.target.value})},error:!!i.blockletDescription,helperText:i.blockletDescription||"",sx:{mt:3}})]})}),o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(z,{sx:{flex:1},children:[o.jsxs(z,{display:"flex",children:[o.jsx(G,{variant:"subtitle1",sx:{mr:2},children:p("common.logo")}),o.jsx(z,{sx:{flex:1,cursor:t?"default":"pointer"},children:o.jsx(P0,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:x||V,onClick:()=>{k()&&b.current.open()}})})]}),o.jsxs(z,{display:"flex",mt:3,children:[o.jsx(G,{variant:"subtitle1",sx:{mr:2},children:p("common.screenshot")}),o.jsxs(z,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap"},children:[M.map((L,E)=>o.jsxs(z,{className:"screenshot",children:[o.jsx("img",{alt:"screenshot",src:L}),!t&&o.jsx(ge,{className:"action",onClick:()=>{c(B=>{const O=[...B.blockletScreenshots];return O.splice(E,1),{...B,blockletScreenshots:O}})},children:o.jsx(O2,{})})]},L)),M.length<5&&o.jsx(z,{sx:{width:200,height:140,background:"#eee",cursor:t?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{k()&&v.current.open()},children:"+"})]})]})]})}),o.jsxs(R.Suspense,{fallback:o.jsx(Ie,{}),children:[o.jsx(p0,{ref:b,popup:!0,onUploadFinish:L=>{c({blockletLogo:L.data.filename}),g(""),b.current.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:I,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:d0,maxFileSize:u0,maxNumberOfFiles:1}}},"uploader-logo"),o.jsx(p0,{ref:v,popup:!0,onUploadFinish:L=>{c(E=>{var O;const B=E.blockletScreenshots||[];return B.push((O=L.data)==null?void 0:O.filename),{...E,blockletScreenshots:B}}),v.current.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:U,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:d0,maxFileSize:u0,maxNumberOfFiles:5-M.length}}},"uploader-screenshot")]})]})}J0.propTypes={projectId:h.string.isRequired,readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,loading:h.bool.isRequired,blocklet:h.object.isRequired,setLoading:h.func.isRequired,initUrl:h.object.isRequired,componentDid:h.isRequired,initLogoUrl:h.string.isRequired,setInitLogoUrl:h.func.isRequired};const Yl=ae.div`
137
137
  margin-top: 24px;
138
138
  .screenshot {
139
139
  margin-bottom: 16px;
@@ -178,7 +178,7 @@ import{at as d2,j as o,aG as se,cP as g0,aK as A,fG as X1,aJ as je,aE as $e,aF a
178
178
  padding-bottom: 12px;
179
179
  border-bottom: ${({theme:e})=>`1px solid ${e.palette.divider}`};
180
180
  }
181
- `;function o2({text:e}){return e?o.jsx(K2,{wrapperElement:{"data-color-mode":"light"},source:X2.sanitize(e),rehypePlugins:[[J2,{target:"_blank"}]]}):o.jsx(ze,{Icon:Ge})}o2.propTypes={text:h.string.isRequired};function l2({params:e,setParams:t,paramsErrTip:l,loading:s,setParamsErrTip:r,readOnly:c}){var x;const{t:i}=te(),[a,u]=R.useState(c?"preview":"write"),f=(g,y)=>{u(y)};return o.jsxs(z,{sx:{border:"1px solid #fff",width:"100%",borderRadius:2},children:[o.jsxs(z,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[o.jsx(G,{variant:"h6",fontWeight:"bold",sx:{},children:i("common.introduction")}),o.jsxs(T2,{value:a,onChange:f,"aria-label":"wrapped label tabs example",children:[o.jsx(Z1,{value:"write",label:"Write"}),o.jsx(Z1,{value:"preview",label:"Preview"})]})]}),o.jsx(z,{display:a==="write"?"block":"none",sx:{width:"100%",marginTop:3},children:o.jsx(Te,{disabled:s||c,sx:{border:"none"},placeholder:`Blocklet ${i("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:c,endAdornment:o.jsxs(z1,{position:"end",children:[((x=e==null?void 0:e.blockletIntroduction)==null?void 0:x.length)||0," / ",ye.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:e.blockletIntroduction||"",onChange:g=>{r({blockletIntroduction:""}),t({blockletIntroduction:g.target.value.slice(0,ye.PROJECT.MAX_INTRO_LENGTH)})},error:!!l.blockletIntroduction,helperText:l.blockletIntroduction||""})}),o.jsx(z,{display:a==="preview"?"block":"none",mt:3,children:o.jsx(o2,{text:e.blockletIntroduction||""})})]})}l2.propTypes={params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,readOnly:h.bool.isRequired,loading:h.bool.isRequired};var U1={},a3=ke;Object.defineProperty(U1,"__esModule",{value:!0});var n2=U1.default=void 0,c3=a3(Se()),f0=o;n2=U1.default=(0,c3.default)([(0,f0.jsx)("circle",{cx:"12",cy:"19",r:"2"},"0"),(0,f0.jsx)("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function q1({step:e,ok:t,active:l,error:s}){let r="grey.500",c=e+1;return t&&(c=o.jsx(Q2,{sx:{fontSize:18,margin:0},color:"white"})),s||!t&&l>e?(r="error.main",c=o.jsx(n2,{sx:{fontSize:18,margin:0},color:"white"})):l>=e&&(r="primary.main"),o.jsx(z,{width:24,height:24,bgcolor:r,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center",children:c})}q1.propTypes={step:h.number,ok:h.bool,active:h.number,error:h.string};q1.defaultProps={step:0,ok:!1,active:0,error:""};function s2({steps:e,activeStep:t,setActiveStep:l,hasSelectedResources:s,params:r,loading:c,paramsErrTip:i,viewMode:a,projectId:u}){const{t:f}=te(),x=()=>{l(d=>d+1)},g=()=>{l(d=>d-1)},y=d=>d===0?(i==null?void 0:i.blockletTitle)||(i==null?void 0:i.projectId)||(i==null?void 0:i.blockletDescription):d===2?i==null?void 0:i.blockletResource:d>=4?(i==null?void 0:i.blockletVersion)||(i==null?void 0:i.note):"",p=a||Y0({hasSelectedResources:s,params:r,projectId:u,t:f})===null;return o.jsxs(z,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid #ccc",borderRadius:2},children:[o.jsx(Z2,{activeStep:t,orientation:"vertical",children:e.map((d,m)=>{const b={},v=c||!r3({hasSelectedResources:s,params:r,projectId:u,step:m,t:f}),C=c?"":y(m);return C&&(b.optional=o.jsx(G,{variant:"caption",color:"error",children:C}),b.error=!0),o.jsxs(et,{children:[o.jsx(jt,{icon:o.jsx(q1,{error:C,active:p?99:t,step:m,ok:v}),sx:{cursor:"pointer",color:C?"error.main":"inherit"},disabled:!1,onClick:()=>l(m),...b,children:o.jsx(G,{fontSize:"14px",fontWeight:"500",color:C||!v&&t>m?"error.main":"inherit",children:d.label})}),o.jsxs(St,{children:[o.jsx(G,{fontSize:12,children:d.description}),!p&&o.jsx(z,{sx:{mb:2},children:o.jsxs("div",{children:[m<e.length-1&&o.jsx(ne,{variant:"contained",onClick:x,sx:{mt:1,mr:1},disabled:C||!v,children:f("common.continue")}),m>0&&o.jsx(ne,{disabled:m===0,onClick:g,sx:{mt:1,mr:1},children:f("common.back")})]})})]})]},d.label)})}),t>=e.length-1&&o.jsx(b1,{square:!0,elevation:0,sx:{p:3},children:o.jsx(G,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}s2.propTypes={steps:h.array.isRequired,activeStep:h.number.isRequired,setActiveStep:h.func.isRequired,params:h.object.isRequired,viewMode:h.string.isRequired,loading:h.bool.isRequired,projectId:h.string.isRequired,hasSelectedResources:h.bool.isRequired,paramsErrTip:h.shape({projectId:h.string,blockletVersion:h.string,blockletTitle:h.string,blockletDescription:h.string,note:h.string,blockletResource:h.string}).isRequired};const d3=[".zip",".gz"],u3=1024*1024*100,p3=R.lazy(()=>S0(()=>import("./react-BeNwKB5d.js").then(e=>e.r),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52])).then(e=>({default:e.Uploader})));function W1({app:e,projectId:t,readOnly:l,params:s,setParams:r,setParamsErrTip:c,error:i}){const{t:a}=te(),u=R.useRef(null),f=()=>l?!1:!t||t===X.UNOWNED_DID?($.error(a("blocklet.publish.errorTip.noFirstDid")),!1):!0,x=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e.meta.did}/${t}/resource/upload`;return o.jsxs(z,{sx:{mt:3},children:[o.jsx(G,{gutterBottom:!0,children:a("blocklet.publish.resourceUpload")}),o.jsxs(tt,{direction:"row",alignItems:"center",spacing:1,sx:{flex:1,cursor:l?"default":"pointer"},children:[!!s.uploadedResource&&o.jsx(G,{component:"a",href:`${x}/params.uploadedResource`,children:s.uploadedResource}),!l&&o.jsx(ne,{variant:"outlined",size:"small",onClick:()=>{var g;f()&&((g=u.current)==null||g.open())},children:s.uploadedResource?a("common.change"):a("common.upload")})]}),o.jsx(R.Suspense,{fallback:o.jsx(Ie,{}),children:o.jsx(p3,{ref:u,popup:!0,onUploadFinish:g=>{var y;r({uploadedResource:g.data.filename}),c({blockletResource:""}),(y=u.current)==null||y.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:x,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:d3,maxFileSize:u3,maxNumberOfFiles:1}}},"uploader-resource")}),!!i&&o.jsx(z,{color:"error.main",mt:1,fontSize:14,children:i})]})}W1.propTypes={app:h.object.isRequired,projectId:h.string.isRequired,readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,error:h.string.isRequired,setParamsErrTip:h.func.isRequired};W1.defaultProps={};function o1({readOnly:e,params:t,setParams:l,paramsErrTip:s,setParamsErrTip:r,loading:c}){var a;const{t:i}=te();return o.jsx(z,{display:"flex",mt:3,className:"section",children:o.jsxs(z,{sx:{flex:1},children:[o.jsx(Te,{required:!0,disabled:c||e,label:`Blocklet ${i("common.version")}`,placeholder:`Blocklet ${i("common.version")}`,InputProps:{"data-cy":"blocklet-version",readOnly:e},autoComplete:"off",variant:"outlined",fullWidth:!0,value:t.blockletVersion||"",onChange:u=>{r({blockletVersion:""}),l({blockletVersion:u.target.value})},error:!!s.blockletVersion,helperText:s.blockletVersion||""}),o.jsx(Te,{label:i("blocklet.publish.releaseNote"),autoComplete:"off",disabled:c||e,variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:e,endAdornment:o.jsxs(z1,{position:"end",children:[((a=t==null?void 0:t.note)==null?void 0:a.length)||0," / ",ye.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:t.note||"",onChange:u=>{r({note:""}),l({note:u.target.value.slice(0,ye.PROJECT.MAX_NOTE_LENGTH)})},error:!!s.note,helperText:s.note||"",sx:{mt:3}})]})})}o1.propTypes={readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,loading:h.bool.isRequired};o1.defaultProps={};function r2(e){for(const t in e)typeof e[t]=="string"?e[t]=e[t].replace(/\\\\/g,"\\"):typeof e[t]=="object"&&e[t]!==null&&r2(e[t]);return e}const h3=({tabs:e,blocklet:t,ancestors:l=[]})=>{const s=t.meta.did;e.push({label:o.jsxs(z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(C1,{size:24,blocklet:t,ancestors:l}),o.jsx(z,{ml:"4px",className:"text",children:o.jsx(z,{children:t.meta.title})})]},s),value:s})},x0=(e,t)=>{const l=g1(e,["blockletVersion","blockletTitle","blockletDescription","blockletLogo","blockletIntroduction","blockletScreenshots","connectedStores","blockletComponents","lastReleaseId","uploadedResource","autoUpload","possibleSameStore","note"]);return l.blockletComponents?l.blockletComponents=l.blockletComponents.map(s=>({...s,included:!0})):l.blockletComponents=(t.children||[]).map(s=>({did:s.meta.did,included:!1,required:!1})),l.resourceFromSelect=!l.uploadedResource,l},f3={0:"branding",1:"introduction",2:"resources",3:"blocklets",4:"version"},m0={branding:0,introduction:1,resources:2,blocklets:3,version:4};function G1({initUrl:e,...t}){var K1;const{projectId:l,mode:s,releaseId:r,componentDid:c=""}=n1(),{t:i}=te(),{blocklet:a}=Ve(),[u,f]=Pe({blockletScreenshots:[],publishedStoreIds:[],connectedStores:[],uploadedResource:"",resourceFromSelect:!0}),[x,g]=Pe({}),[y,p]=R.useState(!1),[d,m]=Pe(null),{api:b}=we(),v=We(D=>D.breakpoints.down("md")),[C,S]=R.useState({}),[N,T]=R.useState(!1),P=R.useRef({}),[I,U]=Pe({}),[V,M]=R.useState(""),[k,L]=Pe({}),E=e==null?void 0:e.searchParams.get("dependentComponentsMode"),B=E==="readonly",O=R.useMemo(()=>{const D={};return Object.keys(k).forEach(_=>{const Ce=k[_];Ce&&Ce.forEach(c2=>{D[c2]=!0})}),D},[k]),K=R.useCallback(D=>{B&&f({blockletComponents:[]}),L(D)},[B,L,f]),J=R.useCallback((...D)=>{U(...D),g({blockletResource:""})},[]),W=r==="none"?(u==null?void 0:u.lastReleaseId)||"":r,[Z,Me]=R.useState(s==="new-release"?4:0);R.useEffect(()=>{l&&g({projectId:""})},[l,g]);const he=R.useMemo(()=>{var D;return(D=u==null?void 0:u.blockletComponents)!=null&&D.some(_=>_.included)||Object.keys(O).length||u!=null&&u.uploadedResource?"pack":"resource"},[u==null?void 0:u.blockletComponents,u==null?void 0:u.uploadedResource,O]),ce=[],oe=((a==null?void 0:a.children)||[]).filter(D=>{var _;return(_=D.meta.resource)==null?void 0:_.exportApi}).filter(D=>!c||D.meta.did===c);oe.forEach(D=>{h3({tabs:ce,blocklet:D,t:i,ancestors:[a]})});const[ee,ie]=R.useState((K1=ce[0])==null?void 0:K1.value),fe=!N&&(d==null?void 0:d.status)==="published",Q=fe,xe=y2(()=>{if(!e)return;M(e.searchParams.get("logo")),f(_=>{var Ce;return{..._,blockletTitle:(_==null?void 0:_.blockletTitle)||e.searchParams.get("title"),blockletDescription:(_==null?void 0:_.blockletDescription)||e.searchParams.get("description"),blockletIntroduction:(_==null?void 0:_.blockletIntroduction)||e.searchParams.get("introduction")||e.searchParams.get("description"),blockletComponents:(Ce=_==null?void 0:_.blockletComponents)!=null&&Ce.length?_==null?void 0:_.blockletComponents:JSON.parse(e.searchParams.get("components")||"[]"),note:(_==null?void 0:_.note)||e.searchParams.get("note")||"No note"}});const D=e.searchParams.get("resources");try{const _=JSON.parse(D);S(_)}catch{}}),q=async()=>{if(W)try{const D=await b.getRelease({input:{did:a.meta.did,projectId:l,releaseId:W}});if(p(!1),!D.release){$.error("Release not found");return}D.release=r2(D.release),s!=="view"&&(D.release.note=""),f(_=>x0({..._,...D.release,blockletVersion:s==="create"||s==="new-release"?Le.inc(D.release.blockletVersion,"patch"):D.release.blockletVersion},a)),m(D.release)}catch(D){p(!1),$.error(Ne(D))}},le=async()=>{if(l===X.UNOWNED_DID){f({blockletVersion:"1.0.0",blockletTitle:""});return}if(!l){$.error(i("blocklet.publish.errorTip.noDid"));return}try{const _=(await b.getProject({input:{did:a.meta.did,projectId:l}})).project||{};_.blockletVersion?(s==="create"||s==="new-release")&&Le.valid(_.blockletVersion)&&(_.blockletVersion=Le.inc(_.blockletVersion,"patch")):_.blockletVersion="1.0.0";const Ce=x0(_,a);f(Ce),_.lastReleaseId||xe()}catch(D){$.error(Ne(D))}},H=R.useCallback(async()=>{p(!0);try{if(s==="view"){if(!W){$.error("Empty release id");return}await le(),await q();return}await le(),W&&(T(!0),await q())}finally{p(!1)}},[s,W]),Ke=D=>{f({blockletComponents:D})};R.useEffect(()=>{H()},[H]),R.useEffect(()=>{l===X.UNOWNED_DID&&(s==="create"||s==="new-release")&&e&&xe()},[l,e,s,xe]);const _e=R.useMemo(()=>!!Object.keys(I).find(D=>!!I[D].length),[I]);if(!u&&y)return o.jsx(Ie,{});if(!u)return null;const Ee=oe.find(D=>D.meta.did===ee);if(oe.every(D=>D.status!=="running")&&(oe!=null&&oe.length))return o.jsx(ze,{children:i("blocklet.publish.allComponentsNotRunning")});const Xe=D=>{ie(D)},F=e==null?void 0:e.searchParams.get("resourcesTitle"),Y=e==null?void 0:e.searchParams.get("componentsTitle"),de=[{label:i("blocklet.publish.branding"),description:i("blocklet.publish.steps.branding")},{label:i("common.introduction"),description:i("blocklet.publish.steps.introduction")},{label:F||i("blocklet.publish.resourceTitle"),description:i("blocklet.publish.steps.resources")},{label:Y||i("common.components"),description:i("blocklet.publish.steps.blocklets")},{label:i("blocklet.publish.versionTitle"),description:i("blocklet.publish.steps.version")}],a2=de[Z]||de[de.length-1],Re=f3[Z];return o.jsxs(x3,{...t,children:[o.jsx(t2,{blocklet:a,release:d,getData:H,getRelease:q,mode:s,params:u,setParams:f,setParamsErrTip:g,readOnly:Q,isPublished:fe,loading:y,setLoading:p,initLogoUrl:V,releaseId:W,projectId:l,projectType:he,resourceComponents:oe,resourceComponentsMap:k,resourceRelateComponents:O,resourceItem:Ee,saveSelectedEventsRef:P,hasSelectedResources:_e,releaseUsedLast:N,setReleaseUsedLast:T,setRelease:m}),o.jsxs(z,{display:"flex",flexDirection:"column",sx:{width:"100%"},children:[o.jsx(z,{pt:3}),o.jsxs(z,{sx:{gap:3},display:"flex",flexDirection:v?"column":"row",children:[!v&&o.jsx(s2,{steps:de,loading:y,viewMode:s==="view",params:u,hasSelectedResources:_e||u.uploadedResource,paramsErrTip:x,activeStep:Z,setActiveStep:Me,projectId:l,resourcesUrlTitle:F,componentsUrlTitle:Y}),o.jsxs(z,{flex:"1",maxWidth:"720px",children:[!v&&Re!=="introduction"&&o.jsxs(G,{variant:"h6",fontWeight:"bold",display:"flex",flexDirection:"row",alignItems:"center",children:[a2.label,Re==="branding"&&o.jsx(ve,{title:i("blocklet.publish.brandingHelp"),placement:"right",children:o.jsx(z,{component:"a",target:"_blank",href:"https://www.arcblock.io/docs/blocklet-store/en/blocklet-detail-page",sx:{paddingTop:1,marginLeft:1},style:{color:"gray"},children:o.jsx(L2,{})})})]}),(v||Re==="branding")&&o.jsx(z,{flexDirection:"column",children:o.jsx(J0,{projectId:l,setParams:f,setParamsErrTip:g,params:u,componentDid:c,blocklet:a,initUrl:e,loading:y,setLoading:p,paramsErrTip:x,readOnly:Q,initLogoUrl:V,setInitLogoUrl:M})}),v&&o.jsx(z,{flexDirection:"column",children:o.jsx(o1,{loading:y,params:u,paramsErrTip:x,setParams:f,setParamsErrTip:g,readOnly:Q})}),(v||Re==="introduction")&&o.jsx(z,{display:"flex",flexDirection:"column",sx:{mt:v?5:0,width:"100%"},children:o.jsx(l2,{loading:y,readOnly:Q,params:u,setParams:f,paramsErrTip:x,setParamsErrTip:g})}),v&&o.jsx(G,{variant:"h6",fontWeight:"bold",mt:5,children:de[m0.resources].label}),o.jsx(z,{display:v||Re==="resources"?"flex":"none",sx:{maxWidth:720},flexDirection:"column",children:o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(z,{sx:{flex:1},children:[o.jsxs(ot,{onChange:()=>f({resourceFromSelect:!u.resourceFromSelect}),children:[o.jsx(p1,{value:"select",disabled:Q,control:o.jsx(t0,{size:"small",checked:u.resourceFromSelect}),label:i("blocklet.publish.resourceSelect")}),o.jsx(p1,{value:"select",disabled:Q,control:o.jsx(t0,{size:"small",checked:!u.resourceFromSelect}),label:i("blocklet.publish.resourceUpload")})]}),u.resourceFromSelect&&o.jsxs(o.Fragment,{children:[!c&&o.jsx(N2,{tabs:ce,current:ee,onChange:Xe,sx:{ml:-2,mt:2,maxWidth:v?window.innerWidth-24:"100%"}}),o.jsx(O1,{loading:y,initialResources:C,saveSelectedEventsRef:P,selectedResourceIds:I,setSelectedResourceIds:J,setResourceComponentsMap:K,error:x.blockletResource,app:a,readOnly:Q,component:Ee,componentDid:c,initUrl:e,params:u,setParams:f,projectId:l===X.UNOWNED_DID?"":l,releaseUsedLast:N,release:{...d,id:W}})]}),!u.resourceFromSelect&&o.jsx(W1,{app:a,readOnly:Q,projectId:l===X.UNOWNED_DID?"":l,params:u,error:x.blockletResource,setParams:f,setParamsErrTip:g})]})})}),v&&o.jsx(G,{variant:"h6",fontWeight:"bold",mt:5,children:de[m0.blocklets].label}),(v||Re==="blocklets")&&o.jsx(z,{flexDirection:"column",children:o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsx(z,{sx:{flex:1},children:o.jsx(N1,{projectType:he,disabled:y||Q,app:a,value:(u==null?void 0:u.blockletComponents)||[],onChange:Ke,resourceRelateComponents:O,dependentComponentsMode:E})})})}),!v&&Re==="version"&&o.jsx(z,{flexDirection:"column",children:o.jsx(o1,{loading:y,params:u,paramsErrTip:x,setParams:f,setParamsErrTip:g,readOnly:Q})})]})]})]})]})}G1.propTypes={initUrl:h.object};G1.defaultProps={initUrl:null};const x3=ae.div`
181
+ `;function o2({text:e}){return e?o.jsx(K2,{wrapperElement:{"data-color-mode":"light"},source:X2.sanitize(e),rehypePlugins:[[J2,{target:"_blank"}]]}):o.jsx(ze,{Icon:Ge})}o2.propTypes={text:h.string.isRequired};function l2({params:e,setParams:t,paramsErrTip:l,loading:s,setParamsErrTip:r,readOnly:c}){var x;const{t:i}=te(),[a,u]=R.useState(c?"preview":"write"),f=(g,y)=>{u(y)};return o.jsxs(z,{sx:{border:"1px solid #fff",width:"100%",borderRadius:2},children:[o.jsxs(z,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[o.jsx(G,{variant:"h6",fontWeight:"bold",sx:{},children:i("common.introduction")}),o.jsxs(T2,{value:a,onChange:f,"aria-label":"wrapped label tabs example",children:[o.jsx(Z1,{value:"write",label:"Write"}),o.jsx(Z1,{value:"preview",label:"Preview"})]})]}),o.jsx(z,{display:a==="write"?"block":"none",sx:{width:"100%",marginTop:3},children:o.jsx(Te,{disabled:s||c,sx:{border:"none"},placeholder:`Blocklet ${i("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:c,endAdornment:o.jsxs(z1,{position:"end",children:[((x=e==null?void 0:e.blockletIntroduction)==null?void 0:x.length)||0," / ",ye.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:e.blockletIntroduction||"",onChange:g=>{r({blockletIntroduction:""}),t({blockletIntroduction:g.target.value.slice(0,ye.PROJECT.MAX_INTRO_LENGTH)})},error:!!l.blockletIntroduction,helperText:l.blockletIntroduction||""})}),o.jsx(z,{display:a==="preview"?"block":"none",mt:3,children:o.jsx(o2,{text:e.blockletIntroduction||""})})]})}l2.propTypes={params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,readOnly:h.bool.isRequired,loading:h.bool.isRequired};var U1={},a3=ke;Object.defineProperty(U1,"__esModule",{value:!0});var n2=U1.default=void 0,c3=a3(Se()),f0=o;n2=U1.default=(0,c3.default)([(0,f0.jsx)("circle",{cx:"12",cy:"19",r:"2"},"0"),(0,f0.jsx)("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function q1({step:e,ok:t,active:l,error:s}){let r="grey.500",c=e+1;return t&&(c=o.jsx(Q2,{sx:{fontSize:18,margin:0},color:"white"})),s||!t&&l>e?(r="error.main",c=o.jsx(n2,{sx:{fontSize:18,margin:0},color:"white"})):l>=e&&(r="primary.main"),o.jsx(z,{width:24,height:24,bgcolor:r,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center",children:c})}q1.propTypes={step:h.number,ok:h.bool,active:h.number,error:h.string};q1.defaultProps={step:0,ok:!1,active:0,error:""};function s2({steps:e,activeStep:t,setActiveStep:l,hasSelectedResources:s,params:r,loading:c,paramsErrTip:i,viewMode:a,projectId:u}){const{t:f}=te(),x=()=>{l(d=>d+1)},g=()=>{l(d=>d-1)},y=d=>d===0?(i==null?void 0:i.blockletTitle)||(i==null?void 0:i.projectId)||(i==null?void 0:i.blockletDescription):d===2?i==null?void 0:i.blockletResource:d>=4?(i==null?void 0:i.blockletVersion)||(i==null?void 0:i.note):"",p=a||Y0({hasSelectedResources:s,params:r,projectId:u,t:f})===null;return o.jsxs(z,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid #ccc",borderRadius:2},children:[o.jsx(Z2,{activeStep:t,orientation:"vertical",children:e.map((d,m)=>{const b={},v=c||!r3({hasSelectedResources:s,params:r,projectId:u,step:m,t:f}),C=c?"":y(m);return C&&(b.optional=o.jsx(G,{variant:"caption",color:"error",children:C}),b.error=!0),o.jsxs(et,{children:[o.jsx(jt,{icon:o.jsx(q1,{error:C,active:p?99:t,step:m,ok:v}),sx:{cursor:"pointer",color:C?"error.main":"inherit"},disabled:!1,onClick:()=>l(m),...b,children:o.jsx(G,{fontSize:"14px",fontWeight:"500",color:C||!v&&t>m?"error.main":"inherit",children:d.label})}),o.jsxs(St,{children:[o.jsx(G,{fontSize:12,children:d.description}),!p&&o.jsx(z,{sx:{mb:2},children:o.jsxs("div",{children:[m<e.length-1&&o.jsx(ne,{variant:"contained",onClick:x,sx:{mt:1,mr:1},disabled:C||!v,children:f("common.continue")}),m>0&&o.jsx(ne,{disabled:m===0,onClick:g,sx:{mt:1,mr:1},children:f("common.back")})]})})]})]},d.label)})}),t>=e.length-1&&o.jsx(b1,{square:!0,elevation:0,sx:{p:3},children:o.jsx(G,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}s2.propTypes={steps:h.array.isRequired,activeStep:h.number.isRequired,setActiveStep:h.func.isRequired,params:h.object.isRequired,viewMode:h.string.isRequired,loading:h.bool.isRequired,projectId:h.string.isRequired,hasSelectedResources:h.bool.isRequired,paramsErrTip:h.shape({projectId:h.string,blockletVersion:h.string,blockletTitle:h.string,blockletDescription:h.string,note:h.string,blockletResource:h.string}).isRequired};const d3=[".zip",".gz"],u3=1024*1024*100,p3=R.lazy(()=>S0(()=>import("./react-DnVaFLUv.js").then(e=>e.r),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53])).then(e=>({default:e.Uploader})));function W1({app:e,projectId:t,readOnly:l,params:s,setParams:r,setParamsErrTip:c,error:i}){const{t:a}=te(),u=R.useRef(null),f=()=>l?!1:!t||t===X.UNOWNED_DID?($.error(a("blocklet.publish.errorTip.noFirstDid")),!1):!0,x=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e.meta.did}/${t}/resource/upload`;return o.jsxs(z,{sx:{mt:3},children:[o.jsx(G,{gutterBottom:!0,children:a("blocklet.publish.resourceUpload")}),o.jsxs(tt,{direction:"row",alignItems:"center",spacing:1,sx:{flex:1,cursor:l?"default":"pointer"},children:[!!s.uploadedResource&&o.jsx(G,{component:"a",href:`${x}/params.uploadedResource`,children:s.uploadedResource}),!l&&o.jsx(ne,{variant:"outlined",size:"small",onClick:()=>{var g;f()&&((g=u.current)==null||g.open())},children:s.uploadedResource?a("common.change"):a("common.upload")})]}),o.jsx(R.Suspense,{fallback:o.jsx(Ie,{}),children:o.jsx(p3,{ref:u,popup:!0,onUploadFinish:g=>{var y;r({uploadedResource:g.data.filename}),c({blockletResource:""}),(y=u.current)==null||y.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:x,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:d3,maxFileSize:u3,maxNumberOfFiles:1}}},"uploader-resource")}),!!i&&o.jsx(z,{color:"error.main",mt:1,fontSize:14,children:i})]})}W1.propTypes={app:h.object.isRequired,projectId:h.string.isRequired,readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,error:h.string.isRequired,setParamsErrTip:h.func.isRequired};W1.defaultProps={};function o1({readOnly:e,params:t,setParams:l,paramsErrTip:s,setParamsErrTip:r,loading:c}){var a;const{t:i}=te();return o.jsx(z,{display:"flex",mt:3,className:"section",children:o.jsxs(z,{sx:{flex:1},children:[o.jsx(Te,{required:!0,disabled:c||e,label:`Blocklet ${i("common.version")}`,placeholder:`Blocklet ${i("common.version")}`,InputProps:{"data-cy":"blocklet-version",readOnly:e},autoComplete:"off",variant:"outlined",fullWidth:!0,value:t.blockletVersion||"",onChange:u=>{r({blockletVersion:""}),l({blockletVersion:u.target.value})},error:!!s.blockletVersion,helperText:s.blockletVersion||""}),o.jsx(Te,{label:i("blocklet.publish.releaseNote"),autoComplete:"off",disabled:c||e,variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:e,endAdornment:o.jsxs(z1,{position:"end",children:[((a=t==null?void 0:t.note)==null?void 0:a.length)||0," / ",ye.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:t.note||"",onChange:u=>{r({note:""}),l({note:u.target.value.slice(0,ye.PROJECT.MAX_NOTE_LENGTH)})},error:!!s.note,helperText:s.note||"",sx:{mt:3}})]})})}o1.propTypes={readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,loading:h.bool.isRequired};o1.defaultProps={};function r2(e){for(const t in e)typeof e[t]=="string"?e[t]=e[t].replace(/\\\\/g,"\\"):typeof e[t]=="object"&&e[t]!==null&&r2(e[t]);return e}const h3=({tabs:e,blocklet:t,ancestors:l=[]})=>{const s=t.meta.did;e.push({label:o.jsxs(z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(C1,{size:24,blocklet:t,ancestors:l}),o.jsx(z,{ml:"4px",className:"text",children:o.jsx(z,{children:t.meta.title})})]},s),value:s})},x0=(e,t)=>{const l=g1(e,["blockletVersion","blockletTitle","blockletDescription","blockletLogo","blockletIntroduction","blockletScreenshots","connectedStores","blockletComponents","lastReleaseId","uploadedResource","autoUpload","possibleSameStore","note"]);return l.blockletComponents?l.blockletComponents=l.blockletComponents.map(s=>({...s,included:!0})):l.blockletComponents=(t.children||[]).map(s=>({did:s.meta.did,included:!1,required:!1})),l.resourceFromSelect=!l.uploadedResource,l},f3={0:"branding",1:"introduction",2:"resources",3:"blocklets",4:"version"},m0={branding:0,introduction:1,resources:2,blocklets:3,version:4};function G1({initUrl:e,...t}){var K1;const{projectId:l,mode:s,releaseId:r,componentDid:c=""}=n1(),{t:i}=te(),{blocklet:a}=Ve(),[u,f]=Pe({blockletScreenshots:[],publishedStoreIds:[],connectedStores:[],uploadedResource:"",resourceFromSelect:!0}),[x,g]=Pe({}),[y,p]=R.useState(!1),[d,m]=Pe(null),{api:b}=we(),v=We(D=>D.breakpoints.down("md")),[C,S]=R.useState({}),[N,T]=R.useState(!1),P=R.useRef({}),[I,U]=Pe({}),[V,M]=R.useState(""),[k,L]=Pe({}),E=e==null?void 0:e.searchParams.get("dependentComponentsMode"),B=E==="readonly",O=R.useMemo(()=>{const D={};return Object.keys(k).forEach(_=>{const Ce=k[_];Ce&&Ce.forEach(c2=>{D[c2]=!0})}),D},[k]),K=R.useCallback(D=>{B&&f({blockletComponents:[]}),L(D)},[B,L,f]),J=R.useCallback((...D)=>{U(...D),g({blockletResource:""})},[]),W=r==="none"?(u==null?void 0:u.lastReleaseId)||"":r,[Z,Me]=R.useState(s==="new-release"?4:0);R.useEffect(()=>{l&&g({projectId:""})},[l,g]);const he=R.useMemo(()=>{var D;return(D=u==null?void 0:u.blockletComponents)!=null&&D.some(_=>_.included)||Object.keys(O).length||u!=null&&u.uploadedResource?"pack":"resource"},[u==null?void 0:u.blockletComponents,u==null?void 0:u.uploadedResource,O]),ce=[],oe=((a==null?void 0:a.children)||[]).filter(D=>{var _;return(_=D.meta.resource)==null?void 0:_.exportApi}).filter(D=>!c||D.meta.did===c);oe.forEach(D=>{h3({tabs:ce,blocklet:D,t:i,ancestors:[a]})});const[ee,ie]=R.useState((K1=ce[0])==null?void 0:K1.value),fe=!N&&(d==null?void 0:d.status)==="published",Q=fe,xe=y2(()=>{if(!e)return;M(e.searchParams.get("logo")),f(_=>{var Ce;return{..._,blockletTitle:(_==null?void 0:_.blockletTitle)||e.searchParams.get("title"),blockletDescription:(_==null?void 0:_.blockletDescription)||e.searchParams.get("description"),blockletIntroduction:(_==null?void 0:_.blockletIntroduction)||e.searchParams.get("introduction")||e.searchParams.get("description"),blockletComponents:(Ce=_==null?void 0:_.blockletComponents)!=null&&Ce.length?_==null?void 0:_.blockletComponents:JSON.parse(e.searchParams.get("components")||"[]"),note:(_==null?void 0:_.note)||e.searchParams.get("note")||"No note"}});const D=e.searchParams.get("resources");try{const _=JSON.parse(D);S(_)}catch{}}),q=async()=>{if(W)try{const D=await b.getRelease({input:{did:a.meta.did,projectId:l,releaseId:W}});if(p(!1),!D.release){$.error("Release not found");return}D.release=r2(D.release),s!=="view"&&(D.release.note=""),f(_=>x0({..._,...D.release,blockletVersion:s==="create"||s==="new-release"?Le.inc(D.release.blockletVersion,"patch"):D.release.blockletVersion},a)),m(D.release)}catch(D){p(!1),$.error(Ne(D))}},le=async()=>{if(l===X.UNOWNED_DID){f({blockletVersion:"1.0.0",blockletTitle:""});return}if(!l){$.error(i("blocklet.publish.errorTip.noDid"));return}try{const _=(await b.getProject({input:{did:a.meta.did,projectId:l}})).project||{};_.blockletVersion?(s==="create"||s==="new-release")&&Le.valid(_.blockletVersion)&&(_.blockletVersion=Le.inc(_.blockletVersion,"patch")):_.blockletVersion="1.0.0";const Ce=x0(_,a);f(Ce),_.lastReleaseId||xe()}catch(D){$.error(Ne(D))}},H=R.useCallback(async()=>{p(!0);try{if(s==="view"){if(!W){$.error("Empty release id");return}await le(),await q();return}await le(),W&&(T(!0),await q())}finally{p(!1)}},[s,W]),Ke=D=>{f({blockletComponents:D})};R.useEffect(()=>{H()},[H]),R.useEffect(()=>{l===X.UNOWNED_DID&&(s==="create"||s==="new-release")&&e&&xe()},[l,e,s,xe]);const _e=R.useMemo(()=>!!Object.keys(I).find(D=>!!I[D].length),[I]);if(!u&&y)return o.jsx(Ie,{});if(!u)return null;const Ee=oe.find(D=>D.meta.did===ee);if(oe.every(D=>D.status!=="running")&&(oe!=null&&oe.length))return o.jsx(ze,{children:i("blocklet.publish.allComponentsNotRunning")});const Xe=D=>{ie(D)},F=e==null?void 0:e.searchParams.get("resourcesTitle"),Y=e==null?void 0:e.searchParams.get("componentsTitle"),de=[{label:i("blocklet.publish.branding"),description:i("blocklet.publish.steps.branding")},{label:i("common.introduction"),description:i("blocklet.publish.steps.introduction")},{label:F||i("blocklet.publish.resourceTitle"),description:i("blocklet.publish.steps.resources")},{label:Y||i("common.components"),description:i("blocklet.publish.steps.blocklets")},{label:i("blocklet.publish.versionTitle"),description:i("blocklet.publish.steps.version")}],a2=de[Z]||de[de.length-1],Re=f3[Z];return o.jsxs(x3,{...t,children:[o.jsx(t2,{blocklet:a,release:d,getData:H,getRelease:q,mode:s,params:u,setParams:f,setParamsErrTip:g,readOnly:Q,isPublished:fe,loading:y,setLoading:p,initLogoUrl:V,releaseId:W,projectId:l,projectType:he,resourceComponents:oe,resourceComponentsMap:k,resourceRelateComponents:O,resourceItem:Ee,saveSelectedEventsRef:P,hasSelectedResources:_e,releaseUsedLast:N,setReleaseUsedLast:T,setRelease:m}),o.jsxs(z,{display:"flex",flexDirection:"column",sx:{width:"100%"},children:[o.jsx(z,{pt:3}),o.jsxs(z,{sx:{gap:3},display:"flex",flexDirection:v?"column":"row",children:[!v&&o.jsx(s2,{steps:de,loading:y,viewMode:s==="view",params:u,hasSelectedResources:_e||u.uploadedResource,paramsErrTip:x,activeStep:Z,setActiveStep:Me,projectId:l,resourcesUrlTitle:F,componentsUrlTitle:Y}),o.jsxs(z,{flex:"1",maxWidth:"720px",children:[!v&&Re!=="introduction"&&o.jsxs(G,{variant:"h6",fontWeight:"bold",display:"flex",flexDirection:"row",alignItems:"center",children:[a2.label,Re==="branding"&&o.jsx(ve,{title:i("blocklet.publish.brandingHelp"),placement:"right",children:o.jsx(z,{component:"a",target:"_blank",href:"https://www.arcblock.io/docs/blocklet-store/en/blocklet-detail-page",sx:{paddingTop:1,marginLeft:1},style:{color:"gray"},children:o.jsx(L2,{})})})]}),(v||Re==="branding")&&o.jsx(z,{flexDirection:"column",children:o.jsx(J0,{projectId:l,setParams:f,setParamsErrTip:g,params:u,componentDid:c,blocklet:a,initUrl:e,loading:y,setLoading:p,paramsErrTip:x,readOnly:Q,initLogoUrl:V,setInitLogoUrl:M})}),v&&o.jsx(z,{flexDirection:"column",children:o.jsx(o1,{loading:y,params:u,paramsErrTip:x,setParams:f,setParamsErrTip:g,readOnly:Q})}),(v||Re==="introduction")&&o.jsx(z,{display:"flex",flexDirection:"column",sx:{mt:v?5:0,width:"100%"},children:o.jsx(l2,{loading:y,readOnly:Q,params:u,setParams:f,paramsErrTip:x,setParamsErrTip:g})}),v&&o.jsx(G,{variant:"h6",fontWeight:"bold",mt:5,children:de[m0.resources].label}),o.jsx(z,{display:v||Re==="resources"?"flex":"none",sx:{maxWidth:720},flexDirection:"column",children:o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(z,{sx:{flex:1},children:[o.jsxs(ot,{onChange:()=>f({resourceFromSelect:!u.resourceFromSelect}),children:[o.jsx(p1,{value:"select",disabled:Q,control:o.jsx(t0,{size:"small",checked:u.resourceFromSelect}),label:i("blocklet.publish.resourceSelect")}),o.jsx(p1,{value:"select",disabled:Q,control:o.jsx(t0,{size:"small",checked:!u.resourceFromSelect}),label:i("blocklet.publish.resourceUpload")})]}),u.resourceFromSelect&&o.jsxs(o.Fragment,{children:[!c&&o.jsx(N2,{tabs:ce,current:ee,onChange:Xe,sx:{ml:-2,mt:2,maxWidth:v?window.innerWidth-24:"100%"}}),o.jsx(O1,{loading:y,initialResources:C,saveSelectedEventsRef:P,selectedResourceIds:I,setSelectedResourceIds:J,setResourceComponentsMap:K,error:x.blockletResource,app:a,readOnly:Q,component:Ee,componentDid:c,initUrl:e,params:u,setParams:f,projectId:l===X.UNOWNED_DID?"":l,releaseUsedLast:N,release:{...d,id:W}})]}),!u.resourceFromSelect&&o.jsx(W1,{app:a,readOnly:Q,projectId:l===X.UNOWNED_DID?"":l,params:u,error:x.blockletResource,setParams:f,setParamsErrTip:g})]})})}),v&&o.jsx(G,{variant:"h6",fontWeight:"bold",mt:5,children:de[m0.blocklets].label}),(v||Re==="blocklets")&&o.jsx(z,{flexDirection:"column",children:o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsx(z,{sx:{flex:1},children:o.jsx(N1,{projectType:he,disabled:y||Q,app:a,value:(u==null?void 0:u.blockletComponents)||[],onChange:Ke,resourceRelateComponents:O,dependentComponentsMode:E})})})}),!v&&Re==="version"&&o.jsx(z,{flexDirection:"column",children:o.jsx(o1,{loading:y,params:u,paramsErrTip:x,setParams:f,setParamsErrTip:g,readOnly:Q})})]})]})]})]})}G1.propTypes={initUrl:h.object};G1.defaultProps={initUrl:null};const x3=ae.div`
182
182
  .section {
183
183
  &.full-width {
184
184
  max-width: 100%;
@@ -0,0 +1,11 @@
1
+ var dt=Object.defineProperty;var ht=(e,n,t)=>n in e?dt(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var D=(e,n,t)=>ht(e,typeof n!="symbol"?n+"":n,t);import{P as f,r as j,N as pt,l as gt,j as m,aC as mt,bF as be,bm as yt,bn as bt,dh as wt,ai as xt,bE as C,bk as It,B as St,bB as vt,T as Tt,di as Ct,dj as At,a1 as jt,dk as Pt,bC as Fe,u as ze,aD as kt,f as Lt,E as Mt}from"./index-D0ZDnsBw.js";import{D as Et}from"./index-C-yt1SFf.js";import{L as Ot}from"./MoreVert-pbCfz7_a.js";import{L as Rt}from"./ListItemButton-D3vwOyXA.js";import{L as qt}from"./selector-Ckqt3gtd.js";/**
2
+ * (c) Iconify
3
+ *
4
+ * For the full copyright and license information, please view the license.txt
5
+ * files at https://github.com/iconify/iconify
6
+ *
7
+ * Licensed under MIT.
8
+ *
9
+ * @license MIT
10
+ * @version 1.0.8
11
+ */const He=Object.freeze({left:0,top:0,width:16,height:16}),V=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),F=Object.freeze({...He,...V}),te=Object.freeze({...F,body:"",hidden:!1}),_t=Object.freeze({width:null,height:null}),Be=Object.freeze({..._t,...V});function Nt(e,n=0){const t=e.replace(/^-?[0-9.]*/,"");function r(o){for(;o<0;)o+=4;return o%4}if(t===""){const o=parseInt(e);return isNaN(o)?0:r(o)}else if(t!==e){let o=0;switch(t){case"%":o=25;break;case"deg":o=90}if(o){let s=parseFloat(e.slice(0,e.length-t.length));return isNaN(s)?0:(s=s/o,s%1===0?r(s):0)}}return n}const Ft=/[\s,]+/;function zt(e,n){n.split(Ft).forEach(t=>{switch(t.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}const De={...Be,preserveAspectRatio:""};function we(e){const n={...De},t=(r,o)=>e.getAttribute(r)||o;return n.width=t("width",null),n.height=t("height",null),n.rotate=Nt(t("rotate","")),zt(n,t("flip","")),n.preserveAspectRatio=t("preserveAspectRatio",t("preserveaspectratio","")),n}function Ht(e,n){for(const t in De)if(e[t]!==n[t])return!0;return!1}const O=/^[a-z0-9]+(-[a-z0-9]+)*$/,z=(e,n,t,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 n&&!U(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 n&&!U(a)?null:a}if(t&&r===""){const a={provider:r,prefix:"",name:s};return n&&!U(a,t)?null:a}return null},U=(e,n)=>e?!!((e.provider===""||e.provider.match(O))&&(n&&e.prefix===""||e.prefix.match(O))&&e.name.match(O)):!1;function Bt(e,n){const t={};!e.hFlip!=!n.hFlip&&(t.hFlip=!0),!e.vFlip!=!n.vFlip&&(t.vFlip=!0);const r=((e.rotate||0)+(n.rotate||0))%4;return r&&(t.rotate=r),t}function xe(e,n){const t=Bt(e,n);for(const r in te)r in V?r in e&&!(r in t)&&(t[r]=V[r]):r in n?t[r]=n[r]:r in e&&(t[r]=e[r]);return t}function Dt(e,n){const t=e.icons,r=e.aliases||Object.create(null),o=Object.create(null);function s(i){if(t[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(t).concat(Object.keys(r)).forEach(s),o}function $t(e,n,t){const r=e.icons,o=e.aliases||Object.create(null);let s={};function i(a){s=xe(r[a]||o[a],s)}return i(n),t.forEach(i),xe(e,s)}function $e(e,n){const t=[];if(typeof e!="object"||typeof e.icons!="object")return t;e.not_found instanceof Array&&e.not_found.forEach(o=>{n(o,null),t.push(o)});const r=Dt(e);for(const o in r){const s=r[o];s&&(n(o,$t(e,o,s)),t.push(o))}return t}const Ut={provider:"",aliases:{},not_found:{},...He};function X(e,n){for(const t in n)if(t in e&&typeof e[t]!=typeof n[t])return!1;return!0}function Ue(e){if(typeof e!="object"||e===null)return null;const n=e;if(typeof n.prefix!="string"||!e.icons||typeof e.icons!="object"||!X(e,Ut))return null;const t=n.icons;for(const o in t){const s=t[o];if(!o.match(O)||typeof s.body!="string"||!X(s,te))return null}const r=n.aliases||Object.create(null);for(const o in r){const s=r[o],i=s.parent;if(!o.match(O)||typeof i!="string"||!t[i]&&!r[i]||!X(s,te))return null}return n}const Z=Object.create(null);function Qt(e,n){return{provider:e,prefix:n,icons:Object.create(null),missing:new Set}}function k(e,n){const t=Z[e]||(Z[e]=Object.create(null));return t[n]||(t[n]=Qt(e,n))}function ue(e,n){return Ue(n)?$e(n,(t,r)=>{r?e.icons[t]=r:e.missing.add(t)}):[]}function Vt(e,n,t){try{if(typeof t.body=="string")return e.icons[n]={...t},!0}catch{}return!1}function Zt(e,n){let t=[];return(typeof e=="string"?[e]:Object.keys(Z)).forEach(o=>{(typeof o=="string"&&typeof n=="string"?[n]:Object.keys(Z[o]||{})).forEach(i=>{const a=k(o,i);t=t.concat(Object.keys(a.icons).map(c=>(o!==""?"@"+o+":":"")+i+":"+c))})}),t}let q=!1;function Qe(e){return typeof e=="boolean"&&(q=e),q}function _(e){const n=typeof e=="string"?z(e,!0,q):e;if(n){const t=k(n.provider,n.prefix),r=n.name;return t.icons[r]||(t.missing.has(r)?null:void 0)}}function Ve(e,n){const t=z(e,!0,q);if(!t)return!1;const r=k(t.provider,t.prefix);return Vt(r,t.name,n)}function Ie(e,n){if(typeof e!="object")return!1;if(typeof n!="string"&&(n=e.provider||""),q&&!n&&!e.prefix){let o=!1;return Ue(e)&&(e.prefix="",$e(e,(s,i)=>{i&&Ve(s,i)&&(o=!0)})),o}const t=e.prefix;if(!U({provider:n,prefix:t,name:"a"}))return!1;const r=k(n,t);return!!ue(r,e)}function Wt(e){return!!_(e)}function Gt(e){const n=_(e);return n?{...F,...n}:null}function Jt(e){const n={loaded:[],missing:[],pending:[]},t=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=t[s]||(t[s]=Object.create(null)),l=c[i]||(c[i]=k(s,i));let u;a in l.icons?u=n.loaded:i===""||l.missing.has(a)?u=n.missing:u=n.pending;const d={provider:s,prefix:i,name:a};u.push(d)}),n}function Ze(e,n){e.forEach(t=>{const r=t.loaderCallbacks;r&&(t.loaderCallbacks=r.filter(o=>o.id!==n))})}function Xt(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const n=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!n.length)return;let t=!1;const r=e.provider,o=e.prefix;n.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 t=!0,!0;return!1}),i.pending.length!==a&&(t||Ze([e],s.id),s.callback(i.loaded.slice(0),i.missing.slice(0),i.pending.slice(0),s.abort))})}))}let Yt=0;function Kt(e,n,t){const r=Yt++,o=Ze.bind(null,t,r);if(!n.pending.length)return o;const s={id:r,icons:n,callback:e,abort:o};return t.forEach(i=>{(i.loaderCallbacks||(i.loaderCallbacks=[])).push(s)}),o}const ne=Object.create(null);function Se(e,n){ne[e]=n}function oe(e){return ne[e]||ne[""]}function en(e,n=!0,t=!1){const r=[];return e.forEach(o=>{const s=typeof o=="string"?z(o,n,t):o;s&&r.push(s)}),r}var tn={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function nn(e,n,t,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 I=Math.floor(Math.random()*h.length);i.push(h[I]),h=h.slice(0,I).concat(h.slice(I+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 w(){c==="pending"&&(c="aborted"),b(),p.forEach(h=>{h.status==="pending"&&(h.status="aborted")}),p=[]}function T(h,I){I&&(g=[]),typeof h=="function"&&g.push(h)}function A(){return{startTime:a,payload:n,status:c,queriesSent:l,queriesPending:p.length,subscribe:T,abort:w}}function x(){c="failed",g.forEach(h=>{h(void 0,u)})}function y(){p.forEach(h=>{h.status==="pending"&&(h.status="aborted")}),p=[]}function B(h,I,P){const v=I!=="success";switch(p=p.filter(L=>L!==h),c){case"pending":break;case"failed":if(v||!e.dataAfterTimeout)return;break;default:return}if(I==="abort"){u=P,x();return}if(v){u=P,p.length||(i.length?S():x());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 S(){if(c!=="pending")return;b();const h=i.shift();if(h===void 0){if(p.length){d=setTimeout(()=>{b(),c==="pending"&&(y(),x())},e.timeout);return}x();return}const I={status:"pending",resource:h,callback:(P,v)=>{B(I,P,v)}};p.push(I),l++,d=setTimeout(S,e.rotate),t(h,n,I.callback)}return setTimeout(S),A}function We(e){const n={...tn,...e};let t=[];function r(){t=t.filter(a=>a().status==="pending")}function o(a,c,l){const u=nn(n,a,c,(d,p)=>{r(),l&&l(d,p)});return t.push(u),u}function s(a){return t.find(c=>a(c))||null}return{query:o,find:s,setIndex:a=>{n.index=a},getIndex:()=>n.index,cleanup:r}}function fe(e){let n;if(typeof e.resources=="string")n=[e.resources];else if(n=e.resources,!(n instanceof Array)||!n.length)return null;return{resources:n,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 G=Object.create(null),E=["https://api.simplesvg.com","https://api.unisvg.com"],Q=[];for(;E.length>0;)E.length===1||Math.random()>.5?Q.push(E.shift()):Q.push(E.pop());G[""]=fe({resources:["https://api.iconify.design"].concat(Q)});function ve(e,n){const t=fe(n);return t===null?!1:(G[e]=t,!0)}function J(e){return G[e]}function on(){return Object.keys(G)}function Te(){}const Y=Object.create(null);function rn(e){if(!Y[e]){const n=J(e);if(!n)return;const t=We(n),r={config:n,redundancy:t};Y[e]=r}return Y[e]}function Ge(e,n,t){let r,o;if(typeof e=="string"){const s=oe(e);if(!s)return t(void 0,424),Te;o=s.send;const i=rn(e);i&&(r=i.redundancy)}else{const s=fe(e);if(s){r=We(s);const i=e.resources?e.resources[0]:"",a=oe(i);a&&(o=a.send)}}return!r||!o?(t(void 0,424),Te):r.query(n,o,t)().abort}const Ce="iconify2",N="iconify",Je=N+"-count",Ae=N+"-version",Xe=36e5,sn=168;function re(e,n){try{return e.getItem(n)}catch{}}function de(e,n,t){try{return e.setItem(n,t),!0}catch{}}function je(e,n){try{e.removeItem(n)}catch{}}function se(e,n){return de(e,Je,n.toString())}function ie(e){return parseInt(re(e,Je))||0}const M={local:!0,session:!0},Ye={local:new Set,session:new Set};let he=!1;function cn(e){he=e}let $=typeof window>"u"?{}:window;function Ke(e){const n=e+"Storage";try{if($&&$[n]&&typeof $[n].length=="number")return $[n]}catch{}M[e]=!1}function et(e,n){const t=Ke(e);if(!t)return;const r=re(t,Ae);if(r!==Ce){if(r){const a=ie(t);for(let c=0;c<a;c++)je(t,N+c.toString())}de(t,Ae,Ce),se(t,0);return}const o=Math.floor(Date.now()/Xe)-sn,s=a=>{const c=N+a.toString(),l=re(t,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"&&n(u,a))return!0}catch{}je(t,c)}};let i=ie(t);for(let a=i-1;a>=0;a--)s(a)||(a===i-1?(i--,se(t,i)):Ye[e].add(a))}function tt(){if(!he){cn(!0);for(const e in M)et(e,n=>{const t=n.data,r=n.provider,o=t.prefix,s=k(r,o);if(!ue(s,t).length)return!1;const i=t.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,i):i,!0})}}function an(e,n){const t=e.lastModifiedCached;if(t&&t>=n)return t===n;if(e.lastModifiedCached=n,t)for(const r in M)et(r,o=>{const s=o.data;return o.provider!==e.provider||s.prefix!==e.prefix||s.lastModified===n});return!0}function ln(e,n){he||tt();function t(r){let o;if(!M[r]||!(o=Ke(r)))return;const s=Ye[r];let i;if(s.size)s.delete(i=Array.from(s).shift());else if(i=ie(o),!se(o,i+1))return;const a={cached:Math.floor(Date.now()/Xe),provider:e.provider,data:n};return de(o,N+i.toString(),JSON.stringify(a))}n.lastModified&&!an(e,n.lastModified)||Object.keys(n.icons).length&&(n.not_found&&(n=Object.assign({},n),delete n.not_found),t("local")||t("session"))}function Pe(){}function un(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Xt(e)}))}function fn(e,n){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(n).sort():e.iconsToLoad=n,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:t,prefix:r}=e,o=e.iconsToLoad;delete e.iconsToLoad;let s;if(!o||!(s=oe(t)))return;s.prepare(t,r,o).forEach(a=>{Ge(t,a,c=>{if(typeof c!="object")a.icons.forEach(l=>{e.missing.add(l)});else try{const l=ue(e,c);if(!l.length)return;const u=e.pendingIcons;u&&l.forEach(d=>{u.delete(d)}),ln(e,c)}catch(l){console.error(l)}un(e)})})}))}const pe=(e,n)=>{const t=en(e,!0,Qe()),r=Jt(t);if(!r.pending.length){let c=!0;return n&&setTimeout(()=>{c&&n(r.loaded,r.missing,r.pending,Pe)}),()=>{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(k(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=k(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&&fn(c,o[l][u])}),n?Kt(n,r,s):Pe},dn=e=>new Promise((n,t)=>{const r=typeof e=="string"?z(e,!0):e;if(!r){t(e);return}pe([r||e],o=>{if(o.length&&r){const s=_(r);if(s){n({...F,...s});return}}t(e)})});function hn(e){try{const n=typeof e=="string"?JSON.parse(e):e;if(typeof n.body=="string")return{...n}}catch{}}function pn(e,n){const t=typeof e=="string"?z(e,!0,!0):null;if(!t){const s=hn(e);return{value:e,data:s}}const r=_(t);if(r!==void 0||!t.prefix)return{value:e,name:t,data:r};const o=pe([t],()=>n(e,t,_(t)));return{value:e,name:t,loading:o}}function K(e){return e.hasAttribute("inline")}let nt=!1;try{nt=navigator.vendor.indexOf("Apple")===0}catch{}function gn(e,n){switch(n){case"svg":case"bg":case"mask":return n}return n!=="style"&&(nt||e.indexOf("<a")===-1)?"svg":e.indexOf("currentColor")===-1?"bg":"mask"}const mn=/(-?[0-9.]*[0-9]+[0-9.]*)/g,yn=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function ce(e,n,t){if(n===1)return e;if(t=t||100,typeof e=="number")return Math.ceil(e*n*t)/t;if(typeof e!="string")return e;const r=e.split(mn);if(r===null||!r.length)return e;const o=[];let s=r.shift(),i=yn.test(s);for(;;){if(i){const a=parseFloat(s);isNaN(a)?o.push(s):o.push(Math.ceil(a*n*t)/t)}else o.push(s);if(s=r.shift(),s===void 0)return o.join("");i=!i}}const bn=e=>e==="unset"||e==="undefined"||e==="none";function ot(e,n){const t={...F,...e},r={...Be,...n},o={left:t.left,top:t.top,width:t.width,height:t.height};let s=t.body;[t,r].forEach(b=>{const w=[],T=b.hFlip,A=b.vFlip;let x=b.rotate;T?A?x+=2:(w.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),w.push("scale(-1 1)"),o.top=o.left=0):A&&(w.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),w.push("scale(1 -1)"),o.top=o.left=0);let y;switch(x<0&&(x-=Math.floor(x/4)*4),x=x%4,x){case 1:y=o.height/2+o.top,w.unshift("rotate(90 "+y.toString()+" "+y.toString()+")");break;case 2:w.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:y=o.width/2+o.left,w.unshift("rotate(-90 "+y.toString()+" "+y.toString()+")");break}x%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)),w.length&&(s='<g transform="'+w.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=ce(d,c/l)):(u=i==="auto"?c:i,d=a===null?ce(u,l/c):a==="auto"?l:a);const p={},g=(b,w)=>{bn(w)||(p[b]=w.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 wn=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let W=wn();function xn(e){W=e}function In(){return W}function Sn(e,n){const t=J(e);if(!t)return 0;let r;if(!t.maxURL)r=0;else{let o=0;t.resources.forEach(i=>{o=Math.max(o,i.length)});const s=n+".json?icons=";r=t.maxURL-o-t.path.length-s.length}return r}function vn(e){return e===404}const Tn=(e,n,t)=>{const r=[],o=Sn(e,n),s="icons";let i={type:s,provider:e,prefix:n,icons:[]},a=0;return t.forEach((c,l)=>{a+=c.length+1,a>=o&&l>0&&(r.push(i),i={type:s,provider:e,prefix:n,icons:[]},a=c.length),i.icons.push(c)}),r.push(i),r};function Cn(e){if(typeof e=="string"){const n=J(e);if(n)return n.path}return"/"}const An=(e,n,t)=>{if(!W){t("abort",424);return}let r=Cn(n.provider);switch(n.type){case"icons":{const s=n.prefix,a=n.icons.join(","),c=new URLSearchParams({icons:a});r+=s+".json?"+c.toString();break}case"custom":{const s=n.uri;r+=s.slice(0,1)==="/"?s.slice(1):s;break}default:t("abort",400);return}let o=503;W(e+r).then(s=>{const i=s.status;if(i!==200){setTimeout(()=>{t(vn(i)?"abort":"next",i)});return}return o=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?t("abort",s):t("next",o)});return}setTimeout(()=>{t("success",s)})}).catch(()=>{t("next",o)})},jn={prepare:Tn,send:An};function ke(e,n){switch(e){case"local":case"session":M[e]=n;break;case"all":for(const t in M)M[t]=n;break}}const ee="data-style";let rt="";function Pn(e){rt=e}function Le(e,n){let t=Array.from(e.childNodes).find(r=>r.hasAttribute&&r.hasAttribute(ee));t||(t=document.createElement("style"),t.setAttribute(ee,ee),e.appendChild(t)),t.textContent=":host{display:inline-block;vertical-align:"+(n?"-0.125em":"0")+"}span,svg{display:block}"+rt}function st(){Se("",jn),Qe(!0);let e;try{e=window}catch{}if(e){if(tt(),e.IconifyPreload!==void 0){const t=e.IconifyPreload,r="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(o=>{try{(typeof o!="object"||o===null||o instanceof Array||typeof o.icons!="object"||typeof o.prefix!="string"||!Ie(o))&&console.error(r)}catch{console.error(r)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(const r in t){const o="IconifyProviders["+r+"] is invalid.";try{const s=t[r];if(typeof s!="object"||!s||s.resources===void 0)continue;ve(r,s)||console.error(o)}catch{console.error(o)}}}}return{enableCache:t=>ke(t,!0),disableCache:t=>ke(t,!1),iconExists:Wt,getIcon:Gt,listIcons:Zt,addIcon:Ve,addCollection:Ie,calculateSize:ce,buildIcon:ot,loadIcons:pe,loadIcon:dn,addAPIProvider:ve,appendCustomStyle:Pn,_api:{getAPIConfig:J,setAPIModule:Se,sendAPIQuery:Ge,setFetch:xn,getFetch:In,listAPIProviders:on}}}function it(e,n){let t=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in n)t+=" "+r+'="'+n[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+t+">"+e+"</svg>"}function kn(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function Ln(e){return"data:image/svg+xml,"+kn(e)}function Mn(e){return'url("'+Ln(e)+'")'}const ae={"background-color":"currentColor"},ct={"background-color":"transparent"},Me={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},Ee={"-webkit-mask":ae,mask:ae,background:ct};for(const e in Ee){const n=Ee[e];for(const t in Me)n[e+"-"+t]=Me[t]}function Oe(e){return e?e+(e.match(/^[-0-9.]+$/)?"px":""):"inherit"}function En(e,n,t){const r=document.createElement("span");let o=e.body;o.indexOf("<a")!==-1&&(o+="<!-- "+Date.now()+" -->");const s=e.attributes,i=it(o,{...s,width:n.width+"",height:n.height+""}),a=Mn(i),c=r.style,l={"--svg":a,width:Oe(s.width),height:Oe(s.height),...t?ae:ct};for(const u in l)c.setProperty(u,l[u]);return r}let R;function On(){try{R=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{R=null}}function Rn(e){return R===void 0&&On(),R?R.createHTML(e):e}function qn(e){const n=document.createElement("span"),t=e.attributes;let r="";t.width||(r="width: inherit;"),t.height||(r+="height: inherit;"),r&&(t.style=r);const o=it(e.body,t);return n.innerHTML=Rn(o),n.firstChild}function Re(e,n){const t=n.icon.data,r=n.customisations,o=ot(t,r);r.preserveAspectRatio&&(o.attributes.preserveAspectRatio=r.preserveAspectRatio);const s=n.renderedMode;let i;switch(s){case"svg":i=qn(o);break;default:i=En(o,{...F,...t},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 qe(e,n,t){const r=t&&(t.rendered?t:t.lastRender);return{rendered:!1,inline:n,icon:e,lastRender:r}}function _n(e="iconify-icon"){let n,t;try{n=window.customElements,t=window.HTMLElement}catch{return}if(!n||!t)return;const r=n.get(e);if(r)return r;const o=["icon","mode","inline","width","height","rotate","flip"],s=class extends t{constructor(){super();D(this,"_shadowRoot");D(this,"_state");D(this,"_checkQueued",!1);const c=this._shadowRoot=this.attachShadow({mode:"open"}),l=K(this);Le(c,l),this._state=qe({value:""},l),this._queueCheck()}static get observedAttributes(){return o.slice(0)}attributeChangedCallback(c){if(c==="inline"){const l=K(this),u=this._state;l!==u.inline&&(u.inline=l,Le(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 K(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{}Re(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=we(this);(c.attrMode!==u||Ht(c.customisations,d))&&this._renderIcon(c.icon,d,u)}_iconChanged(c){const l=pn(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=qe(l,this._state.inline,this._state)}_gotIconData(c){this._checkQueued=!1,this._renderIcon(c,we(this),this.getAttribute("mode"))}_renderIcon(c,l,u){const d=gn(c.data.body,u),p=this._state.inline;Re(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=st();for(const a in i)s[a]=s.prototype[a]=i[a];return n.define(e,s),s}_n()||st();const Nn=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])}))}))}),at=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,n,t="children")=>e.map(r=>Array.isArray(r[t])?n({...r,[t]:H(r[t],n,t)}):n(r)),Fn=(e,n="children")=>{const t=[];return H(e,r=>t.push(r),n),t},ge=(e,n,t="children")=>e.map(r=>({...r})).filter(r=>{const o=r[t];if(Array.isArray(o)){const i=ge(o,n,t);r[t]=i!=null&&i.length?i:void 0}const s={filteredChildren:r[t],isLeaf:!(o!=null&&o.length)};return n(r,s)}),zn=e=>/^https?:\/\//.test(e),Hn=e=>{if(!e||!(e!=null&&e.startsWith("/")))return!1;const n=o=>o.endsWith("/")?o:`${o}/`,t=n(window.location.pathname),r=n(new URL(e,window.location.origin).pathname);return t.startsWith(r)},Bn=(e=[])=>{const n=e.map((r,o)=>({path:r,index:o})).filter(r=>Hn(r.path));return n!=null&&n.length?n.slice(1).reduce((r,o)=>r.path.length>=o.path.length?r:o,n[0]).index:-1};var _e,Ne;const le=((_e=window==null?void 0:window.blocklet)==null?void 0:_e.groupPrefix)||((Ne=window==null?void 0:window.blocklet)==null?void 0:Ne.prefix)||"/",Dn=e=>{const n={...e},t=e==null?void 0:e.background;return typeof t=="string"?n.background={header:t,footer:t,default:t}:t&&typeof t=="object"&&(n.background={header:t.header||t.default,footer:t.footer||t.default,default:t.default}),n},lt=(e,n="en")=>{if(!(e!=null&&e.length))return e;const t=(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(zn(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:t(o.title,n),link:(s=o.items)!=null&&s.length?o.link:r(o.link,n),_rawLink:o.link}},"items")},$n=e=>H(e,n=>n.role?{...n,role:Array.isArray(n.role)?n.role:[n.role]}:n,"items"),Un=e=>{if(!(e!=null&&e.length))return null;const n=$n(e),t={header:[],footer:[],social:[],bottom:[],dashboard:[],sessionManager:[],userCenter:[]};return n.forEach(r=>{var o;r.section?Array.isArray(r.section)?r.section.forEach(s=>{var i;(i=t[s])==null||i.push(r)}):typeof r.section=="string"&&((o=t[r.section])==null||o.push(r)):t.header.push(r)}),t},Qn=e=>{if(!e)return null;const n={...e};return n.theme=Dn(n.theme),n.navigation=Un(Vn(n.navigation)),n},Vn=(e=[])=>ge(e,(n,t)=>{var r;return!!n.link||((r=t.filteredChildren)==null?void 0:r.length)},"items"),ut=(e,n)=>ge(e,(t,r)=>{var s;const o=!t.role||n&&t.role.includes(n);return r.isLeaf?o:o&&((s=r.filteredChildren)==null?void 0:s.length)},"items"),Zn={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"/>'},Wn={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 me({session:e,locale:n,size:t}){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=j.useRef(null),i=pt({open:!1}),a=gt((c=!i.open)=>{i.open=c});return o.length===0||!(e!=null&&e.user)?null:m.jsxs(m.Fragment,{children:[m.jsx(mt,{size:"medium",ref:s,onClick:()=>a(),children:m.jsx(be,{icon:Zn,fontSize:t,style:{transform:"scale(1.08)"}})}),m.jsx(yt,{open:i.open,onClose:()=>a(!1),anchorEl:s.current,transition:!0,placement:"bottom-end",sx:{zIndex:1600},children:({TransitionProps:c})=>m.jsx(bt,{onClickAway:l=>{l.preventDefault(),l.stopPropagation(),a(!1)},children:m.jsx(wt,{...c,timeout:350,children:m.jsxs(xt,{variant:"outlined",sx:{borderRadius:3,width:350,maxWidth:"90vw",borderColor:C.lineStep,p:2,border:"0 !important",boxShadow:`0px 8px 16px 0px ${C.gray6}, 0px 0px 0px 1px ${C.gray6}`},children:[m.jsx(It,{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(Ot,{disablePadding:!0,children:m.jsxs(Rt,{href:l.link,sx:{p:1,display:"flex",flexDirection:"column",alignItems:"center",gap:1,width:"100%",height:"100%",borderRadius:2,"&:hover":{backgroundColor:C.surfacePrimarySubtitle}},children:[(u=l==null?void 0:l.component)!=null&&u.did?m.jsx(St,{component:"img",src:`${vt}/blocklet/logo-bundle/${l.component.did}`,sx:{borderRadius:2,width:50,height:50,objectFit:"contain"}}):m.jsx(be,{fontSize:50,icon:l.icon||Wn,color:C.textSubtitle}),m.jsx(Tt,{sx:{fontSize:"12px",color:C.textBase,textAlign:"center",lineHeight:"normal"},children:Ct(l.title,n)})]})},l.id)})}),m.jsx(At,{session:e,children:m.jsx(jt,{variant:"outlined",fullWidth:!0,href:Pt,sx:{mt:1,borderRadius:2,color:C.textBase,borderColor:C.lineBorderStrong,"&:hover":{color:C.primaryBase,borderColor:C.primaryBase}},children:n==="zh"?"管理":"Manage"})})]})})})})]})}me.propTypes={session:f.object.isRequired,locale:f.string,size:f.number};me.defaultProps={locale:"en",size:24};function ye({formattedBlocklet:e,addons:n,sessionManagerProps:t}){var p,g,b,w;const r=j.useContext(Fe),{locale:o}=ze()||{},{enableConnect:s=!0,enableLocale:i=!0}=e,a=!!((p=r==null?void 0:r.session)!=null&&p.user);let c=lt((g=e==null?void 0:e.navigation)==null?void 0:g.sessionManager,o)||[];c=ut(c,(w=(b=r==null?void 0:r.session)==null?void 0:b.user)==null?void 0:w.role);const u=(()=>{if(n&&typeof n!="function")return Array.isArray(n)?n:[n];let T=[];if(i&&o&&T.push(m.jsx(qt,{showText:!1},"locale-selector")),s&&r){const A=[];a&&(c?c.slice(0,5):[]).forEach(y=>{A.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})}),T.push(m.jsx(me,{session:r.session,locale:o},"session-blocklet")),T.push(m.jsx(kt,{session:r.session,locale:o,menu:A,showRole:!0,...t},"session-user"))}return typeof n=="function"&&(T=n(T)||[]),T})();return j.createElement(m.Fragment,null,...Array.isArray(u)?u:[u])}ye.propTypes={formattedBlocklet:f.object.isRequired,addons:f.oneOfType([f.func,f.node]),sessionManagerProps:at};ye.defaultProps={addons:null,sessionManagerProps:{showRole:!0}};const Gn=()=>{const e=Lt();j.useEffect(()=>{e.wallet&&Mt.call("arcHideTopBar","{}")},[e])};function ft({meta:e,fallbackUrl:n,invalidPathFallback:t,headerAddons:r,sessionManagerProps:o,links:s,...i}){var B;Gn();const a=j.useContext(Fe),c=(B=a==null?void 0:a.session)==null?void 0:B.user,l=c==null?void 0:c.role,{locale:u}=ze()||{},d=j.useMemo(()=>{const S=Object.assign({},window.blocklet,e);try{return Qn(S)}catch(h){return console.error("Failed to format blocklet info",h,S),S}},[e]),{localizedNav:p,flattened:g,matchedIndex:b}=j.useMemo(()=>{var P;let S=lt((P=d==null?void 0:d.navigation)==null?void 0:P.dashboard,u)||[];S=ut(S,l),S=H(S,v=>({title:v.title,url:v.link,icon:v.icon?m.jsx("iconify-icon",{height:"100%",width:"100%",icon:v.icon}):null,external:!0,children:v.items}),"items");const h=Fn(S).filter(v=>!!v.url),I=Bn(h.map(v=>v.url));return I!==-1&&(h[I].active=!0),{localizedNav:S,flattened:h,matchedIndex:I}},[d,u,l]),w=typeof s=="function"?s(p):[...p,...s];if(j.useLayoutEffect(()=>{c&&!(g!=null&&g.length)&&n&&(window.location.href=n)},[n]),j.useLayoutEffect(()=>{c&&(g!=null&&g.length)&&b===-1&&t&&t()},[t,g,b]),!d.appName)return null;const{appLogo:T,appLogoRect:A,appName:x}=d,y=m.jsx(ye,{formattedBlocklet:d,addons:r,sessionManagerProps:o});return m.jsx(Et,{title:x,fullWidth:!0,sidebarWidth:128,legacy:!1,links:w,...i,headerProps:{homeLink:le,logo:m.jsx("img",{src:A||T,alt:"logo"}),addons:y,...i.headerProps}})}ft.propTypes={meta:Nn,fallbackUrl:f.string,invalidPathFallback:f.func,headerAddons:f.oneOfType([f.func,f.node]),sessionManagerProps:at,links:f.oneOfType([f.array,f.func])};ft.defaultProps={meta:{},fallbackUrl:le,invalidPathFallback:null,headerAddons:void 0,sessionManagerProps:{showRole:!0,onLogout:()=>{window.location.href=le}},links:[]};export{Nn as B,ft as D,ye as H,Fn as a,Bn as b,Qn as f,lt as g,zn as i,H as m,le as p,Gn as u};
@@ -1 +1 @@
1
- import{eX as b}from"./index-Cicr8_v0.js";function c(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function A(o,e){for(var r="",i=0,l=-1,t=0,n,f=0;f<=o.length;++f){if(f<o.length)n=o.charCodeAt(f);else{if(n===47)break;n=47}if(n===47){if(!(l===f-1||t===1))if(l!==f-1&&t===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var s=r.lastIndexOf("/");if(s!==r.length-1){s===-1?(r="",i=0):(r=r.slice(0,s),i=r.length-1-r.lastIndexOf("/")),l=f,t=0;continue}}else if(r.length===2||r.length===1){r="",i=0,l=f,t=0;continue}}e&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+o.slice(l+1,f):r=o.slice(l+1,f),i=f-l-1;l=f,t=0}else n===46&&t!==-1?++t:t=-1}return r}function h(o,e){var r=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+i:r+o+i:i}var g={resolve:function(){for(var e="",r=!1,i,l=arguments.length-1;l>=-1&&!r;l--){var t;l>=0?t=arguments[l]:(i===void 0&&(i=b.cwd()),t=i),c(t),t.length!==0&&(e=t+"/"+e,r=t.charCodeAt(0)===47)}return e=A(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(c(e),e.length===0)return".";var r=e.charCodeAt(0)===47,i=e.charCodeAt(e.length-1)===47;return e=A(e,!r),e.length===0&&!r&&(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return c(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var e,r=0;r<arguments.length;++r){var i=arguments[r];c(i),i.length>0&&(e===void 0?e=i:e+="/"+i)}return e===void 0?".":g.normalize(e)},relative:function(e,r){if(c(e),c(r),e===r||(e=g.resolve(e),r=g.resolve(r),e===r))return"";for(var i=1;i<e.length&&e.charCodeAt(i)===47;++i);for(var l=e.length,t=l-i,n=1;n<r.length&&r.charCodeAt(n)===47;++n);for(var f=r.length,s=f-n,v=t<s?t:s,u=-1,a=0;a<=v;++a){if(a===v){if(s>v){if(r.charCodeAt(n+a)===47)return r.slice(n+a+1);if(a===0)return r.slice(n+a)}else t>v&&(e.charCodeAt(i+a)===47?u=a:a===0&&(u=0));break}var m=e.charCodeAt(i+a),C=r.charCodeAt(n+a);if(m!==C)break;m===47&&(u=a)}var d="";for(a=i+u+1;a<=l;++a)(a===l||e.charCodeAt(a)===47)&&(d.length===0?d+="..":d+="/..");return d.length>0?d+r.slice(n+u):(n+=u,r.charCodeAt(n)===47&&++n,r.slice(n))},_makeLong:function(e){return e},dirname:function(e){if(c(e),e.length===0)return".";for(var r=e.charCodeAt(0),i=r===47,l=-1,t=!0,n=e.length-1;n>=1;--n)if(r=e.charCodeAt(n),r===47){if(!t){l=n;break}}else t=!1;return l===-1?i?"/":".":i&&l===1?"//":e.slice(0,l)},basename:function(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');c(e);var i=0,l=-1,t=!0,n;if(r!==void 0&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var f=r.length-1,s=-1;for(n=e.length-1;n>=0;--n){var v=e.charCodeAt(n);if(v===47){if(!t){i=n+1;break}}else s===-1&&(t=!1,s=n+1),f>=0&&(v===r.charCodeAt(f)?--f===-1&&(l=n):(f=-1,l=s))}return i===l?l=s:l===-1&&(l=e.length),e.slice(i,l)}else{for(n=e.length-1;n>=0;--n)if(e.charCodeAt(n)===47){if(!t){i=n+1;break}}else l===-1&&(t=!1,l=n+1);return l===-1?"":e.slice(i,l)}},extname:function(e){c(e);for(var r=-1,i=0,l=-1,t=!0,n=0,f=e.length-1;f>=0;--f){var s=e.charCodeAt(f);if(s===47){if(!t){i=f+1;break}continue}l===-1&&(t=!1,l=f+1),s===46?r===-1?r=f:n!==1&&(n=1):r!==-1&&(n=-1)}return r===-1||l===-1||n===0||n===1&&r===l-1&&r===i+1?"":e.slice(r,l)},format:function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return h("/",e)},parse:function(e){c(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var i=e.charCodeAt(0),l=i===47,t;l?(r.root="/",t=1):t=0;for(var n=-1,f=0,s=-1,v=!0,u=e.length-1,a=0;u>=t;--u){if(i=e.charCodeAt(u),i===47){if(!v){f=u+1;break}continue}s===-1&&(v=!1,s=u+1),i===46?n===-1?n=u:a!==1&&(a=1):n!==-1&&(a=-1)}return n===-1||s===-1||a===0||a===1&&n===s-1&&n===f+1?s!==-1&&(f===0&&l?r.base=r.name=e.slice(1,s):r.base=r.name=e.slice(f,s)):(f===0&&l?(r.name=e.slice(1,n),r.base=e.slice(1,s)):(r.name=e.slice(f,n),r.base=e.slice(f,s)),r.ext=e.slice(n,s)),f>0?r.dir=e.slice(0,f-1):l&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};g.posix=g;var y=g;export{y as p};
1
+ import{eY as b}from"./index-D0ZDnsBw.js";function c(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function A(o,e){for(var r="",i=0,l=-1,t=0,n,f=0;f<=o.length;++f){if(f<o.length)n=o.charCodeAt(f);else{if(n===47)break;n=47}if(n===47){if(!(l===f-1||t===1))if(l!==f-1&&t===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var s=r.lastIndexOf("/");if(s!==r.length-1){s===-1?(r="",i=0):(r=r.slice(0,s),i=r.length-1-r.lastIndexOf("/")),l=f,t=0;continue}}else if(r.length===2||r.length===1){r="",i=0,l=f,t=0;continue}}e&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+o.slice(l+1,f):r=o.slice(l+1,f),i=f-l-1;l=f,t=0}else n===46&&t!==-1?++t:t=-1}return r}function h(o,e){var r=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+i:r+o+i:i}var g={resolve:function(){for(var e="",r=!1,i,l=arguments.length-1;l>=-1&&!r;l--){var t;l>=0?t=arguments[l]:(i===void 0&&(i=b.cwd()),t=i),c(t),t.length!==0&&(e=t+"/"+e,r=t.charCodeAt(0)===47)}return e=A(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(c(e),e.length===0)return".";var r=e.charCodeAt(0)===47,i=e.charCodeAt(e.length-1)===47;return e=A(e,!r),e.length===0&&!r&&(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return c(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var e,r=0;r<arguments.length;++r){var i=arguments[r];c(i),i.length>0&&(e===void 0?e=i:e+="/"+i)}return e===void 0?".":g.normalize(e)},relative:function(e,r){if(c(e),c(r),e===r||(e=g.resolve(e),r=g.resolve(r),e===r))return"";for(var i=1;i<e.length&&e.charCodeAt(i)===47;++i);for(var l=e.length,t=l-i,n=1;n<r.length&&r.charCodeAt(n)===47;++n);for(var f=r.length,s=f-n,v=t<s?t:s,u=-1,a=0;a<=v;++a){if(a===v){if(s>v){if(r.charCodeAt(n+a)===47)return r.slice(n+a+1);if(a===0)return r.slice(n+a)}else t>v&&(e.charCodeAt(i+a)===47?u=a:a===0&&(u=0));break}var m=e.charCodeAt(i+a),C=r.charCodeAt(n+a);if(m!==C)break;m===47&&(u=a)}var d="";for(a=i+u+1;a<=l;++a)(a===l||e.charCodeAt(a)===47)&&(d.length===0?d+="..":d+="/..");return d.length>0?d+r.slice(n+u):(n+=u,r.charCodeAt(n)===47&&++n,r.slice(n))},_makeLong:function(e){return e},dirname:function(e){if(c(e),e.length===0)return".";for(var r=e.charCodeAt(0),i=r===47,l=-1,t=!0,n=e.length-1;n>=1;--n)if(r=e.charCodeAt(n),r===47){if(!t){l=n;break}}else t=!1;return l===-1?i?"/":".":i&&l===1?"//":e.slice(0,l)},basename:function(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');c(e);var i=0,l=-1,t=!0,n;if(r!==void 0&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var f=r.length-1,s=-1;for(n=e.length-1;n>=0;--n){var v=e.charCodeAt(n);if(v===47){if(!t){i=n+1;break}}else s===-1&&(t=!1,s=n+1),f>=0&&(v===r.charCodeAt(f)?--f===-1&&(l=n):(f=-1,l=s))}return i===l?l=s:l===-1&&(l=e.length),e.slice(i,l)}else{for(n=e.length-1;n>=0;--n)if(e.charCodeAt(n)===47){if(!t){i=n+1;break}}else l===-1&&(t=!1,l=n+1);return l===-1?"":e.slice(i,l)}},extname:function(e){c(e);for(var r=-1,i=0,l=-1,t=!0,n=0,f=e.length-1;f>=0;--f){var s=e.charCodeAt(f);if(s===47){if(!t){i=f+1;break}continue}l===-1&&(t=!1,l=f+1),s===46?r===-1?r=f:n!==1&&(n=1):r!==-1&&(n=-1)}return r===-1||l===-1||n===0||n===1&&r===l-1&&r===i+1?"":e.slice(r,l)},format:function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return h("/",e)},parse:function(e){c(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var i=e.charCodeAt(0),l=i===47,t;l?(r.root="/",t=1):t=0;for(var n=-1,f=0,s=-1,v=!0,u=e.length-1,a=0;u>=t;--u){if(i=e.charCodeAt(u),i===47){if(!v){f=u+1;break}continue}s===-1&&(v=!1,s=u+1),i===46?n===-1?n=u:a!==1&&(a=1):n!==-1&&(a=-1)}return n===-1||s===-1||a===0||a===1&&n===s-1&&n===f+1?s!==-1&&(f===0&&l?r.base=r.name=e.slice(1,s):r.base=r.name=e.slice(f,s)):(f===0&&l?(r.name=e.slice(1,n),r.base=e.slice(1,s)):(r.name=e.slice(f,n),r.base=e.slice(f,s)),r.ext=e.slice(n,s)),f>0?r.dir=e.slice(0,f-1):l&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};g.posix=g;var y=g;export{y as p};
@@ -1 +1 @@
1
- import{b7 as j,cm as O}from"./index-Cicr8_v0.js";function m(i,t){for(var r=0;r<t.length;r++){const a=t[r];if(typeof a!="string"&&!Array.isArray(a)){for(const e in a)if(e!=="default"&&!(e in i)){const s=Object.getOwnPropertyDescriptor(a,e);s&&Object.defineProperty(i,e,s.get?s:{enumerable:!0,get:()=>a[e]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}var d={default:O,call:function(i,t,r){var a="";typeof t=="function"&&(r=t,t={});var e={data:t===void 0?null:t};if(typeof r=="function"){var s="dscb"+window.dscb++;window[s]=r,e._dscbstub=s}return e=JSON.stringify(e),window._dsbridge?a=_dsbridge.call(i,e):(window._dswk||navigator.userAgent.indexOf("_dsbridge")!=-1)&&(a=prompt("_dsbridge="+i,e)),JSON.parse(a||"{}").data},register:function(i,t,r){var a=r?window._dsaf:window._dsf;window._dsInit||(window._dsInit=!0,setTimeout(function(){d.call("_dsb.dsinit")},0)),typeof t=="object"?a._obs[i]=t:a[i]=t},registerAsyn:function(i,t){this.register(i,t,!0)},hasNativeMethod:function(i,t){return this.call("_dsb.hasNativeMethod",{name:i,type:t||"all"})},disableJavascriptDialogBlock:function(i){this.call("_dsb.disableJavascriptDialogBlock",{disable:i!==!1})}};(function(){if(!window._dsf){var i={_dsf:{_obs:{}},_dsaf:{_obs:{}},dscb:0,dsBridge:d,close:function(){d.call("_dsb.closePage")},_handleMessageFromNative:function(r){var a=JSON.parse(r.data),e={id:r.callbackId,complete:!0},s=this._dsf[r.method],o=this._dsaf[r.method],p=function(u,_){e.data=u.apply(_,a),d.call("_dsb.returnValue",e)},v=function(u,_){a.push(function(w,y){e.data=w,e.complete=y!==!1,d.call("_dsb.returnValue",e)}),u.apply(_,a)};if(s)p(s,this._dsf);else if(o)v(o,this._dsaf);else{var l=r.method.split(".");if(l.length<2)return;var b=l.pop(),g=l.join("."),c=this._dsf._obs,f=c[g]||{},n=f[b];if(n&&typeof n=="function"){p(n,f);return}if(c=this._dsaf._obs,f=c[g]||{},n=f[b],n&&typeof n=="function"){v(n,f);return}}}};for(var t in i)window[t]=i[t];d.register("_hasJavascriptMethod",function(r,a){var e=r.split(".");if(e.length<2)return!!(_dsf[e]||_dsaf[e]);var r=e.pop(),s=e.join("."),o=_dsf._obs[s]||_dsaf._obs[s];return o&&!!o[r]})}})();var h=d;const J=j(h),S=m({__proto__:null,default:J},[h]);export{S as i};
1
+ import{b7 as j,cn as O}from"./index-D0ZDnsBw.js";function J(i,t){for(var r=0;r<t.length;r++){const a=t[r];if(typeof a!="string"&&!Array.isArray(a)){for(const e in a)if(e!=="default"&&!(e in i)){const s=Object.getOwnPropertyDescriptor(a,e);s&&Object.defineProperty(i,e,s.get?s:{enumerable:!0,get:()=>a[e]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}var d={default:O,call:function(i,t,r){var a="";typeof t=="function"&&(r=t,t={});var e={data:t===void 0?null:t};if(typeof r=="function"){var s="dscb"+window.dscb++;window[s]=r,e._dscbstub=s}return e=JSON.stringify(e),window._dsbridge?a=_dsbridge.call(i,e):(window._dswk||navigator.userAgent.indexOf("_dsbridge")!=-1)&&(a=prompt("_dsbridge="+i,e)),JSON.parse(a||"{}").data},register:function(i,t,r){var a=r?window._dsaf:window._dsf;window._dsInit||(window._dsInit=!0,setTimeout(function(){d.call("_dsb.dsinit")},0)),typeof t=="object"?a._obs[i]=t:a[i]=t},registerAsyn:function(i,t){this.register(i,t,!0)},hasNativeMethod:function(i,t){return this.call("_dsb.hasNativeMethod",{name:i,type:t||"all"})},disableJavascriptDialogBlock:function(i){this.call("_dsb.disableJavascriptDialogBlock",{disable:i!==!1})}};(function(){if(!window._dsf){var i={_dsf:{_obs:{}},_dsaf:{_obs:{}},dscb:0,dsBridge:d,close:function(){d.call("_dsb.closePage")},_handleMessageFromNative:function(r){var a=JSON.parse(r.data),e={id:r.callbackId,complete:!0},s=this._dsf[r.method],o=this._dsaf[r.method],p=function(u,_){e.data=u.apply(_,a),d.call("_dsb.returnValue",e)},v=function(u,_){a.push(function(w,y){e.data=w,e.complete=y!==!1,d.call("_dsb.returnValue",e)}),u.apply(_,a)};if(s)p(s,this._dsf);else if(o)v(o,this._dsaf);else{var l=r.method.split(".");if(l.length<2)return;var b=l.pop(),g=l.join("."),c=this._dsf._obs,f=c[g]||{},n=f[b];if(n&&typeof n=="function"){p(n,f);return}if(c=this._dsaf._obs,f=c[g]||{},n=f[b],n&&typeof n=="function"){v(n,f);return}}}};for(var t in i)window[t]=i[t];d.register("_hasJavascriptMethod",function(r,a){var e=r.split(".");if(e.length<2)return!!(_dsf[e]||_dsaf[e]);var r=e.pop(),s=e.join("."),o=_dsf._obs[s]||_dsaf._obs[s];return o&&!!o[r]})}})();var h=d;const N=j(h),k=J({__proto__:null,default:N},[h]);export{k as i};
@@ -1,4 +1,4 @@
1
- import{r as r0,aY as hb,aP as aA,bX as nA,j as y,cn as WA,cB as tb,t as tA,aa as dA,P,Z as v0,n as YM,cC as KM,cu as iA,cm as QM,cq as db,b7 as rA,$ as Xb,ac as sA,cD as fA,cE as uA,cF as RA,cG as lA,cH as LA,cI as NA,T as BA,C as hA}from"./index-Cicr8_v0.js";import{g as XA,a as mA,b as TA}from"./spaces-zoAgXjLC.js";import{j as yA}from"./url-join-MhXUJvvH.js";import{S as a2}from"./Skeleton-cOZ7paOF.js";import{H as gA}from"./Hidden-CbAVlEDm.js";function _A(){const[M,b]=r0.useState(null),{blocklet:O}=hb();return r0.useEffect(()=>{b(XA(O))},[O]),{storageEndpoint:M}}const mb=r0.createContext({}),{Provider:SA,Consumer:R5}=mb;function Tb({children:M}){const[b,O]=r0.useState(!1),[c,q]=r0.useState(null),{blocklet:a,actions:{refreshBlocklet:t}}=hb(),{storageEndpoint:i}=_A(),{api:X}=aA();nA(async()=>{try{if(O(!0),tb.isEmpty(i)){q(null);return}const E=await mA(i);q(E)}catch(E){console.error(E),tA.error(E.message)}finally{O(!1)}},[i]);const R=()=>{q(null),t()},w=async E=>{q(E),await Q(E.endpoint),t()},Q=async E=>{await X.configBlocklet({input:{did:[a.meta.did],configs:[{key:dA.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT,value:E}]}}),t()};r0.useEffect(()=>{async function E(){if(!c)return;const D=await TA(c.endpoint,c.name),W0=tb.merge(c,{name:D});q(W0)}E()},[]);const _=!!(i&&c);return y.jsx(SA,{value:{loading:b,spaceGateway:c,deleteSpaceGateway:R,updateSpaceGateway:w,storageEndpoint:i,settingStorageEndpoint:Q,hasStorageEndpoint:_},children:M})}Tb.propTypes={children:WA.node.isRequired};Tb.defaultProps={};function l5(){return r0.useContext(mb)}function JM({value:M,size:b,style:O,...c}){return y.jsxs(kA,{style:{width:b,height:b,...O},...c,children:[y.jsx(YM,{variant:"determinate",role:"progressbar",value:100,size:b,"aria-label":"decorative progress bar",thickness:10,style:{color:"#dddddd"}}),y.jsx(YM,{variant:"determinate",value:M,role:"progressbar",size:b,thickness:10,"aria-label":"main progress bar"})]})}JM.propTypes={value:P.number.isRequired,size:P.number,style:P.object};JM.defaultProps={size:10,style:{}};const kA=v0.span`
1
+ import{r as r0,aY as hb,aP as aA,bX as nA,j as y,co as WA,cC as tb,t as tA,aa as dA,P,Z as v0,n as YM,cD as KM,cv as iA,cn as QM,cr as db,b7 as rA,$ as Xb,ac as sA,cE as fA,cF as uA,cG as RA,cH as lA,cI as LA,cJ as NA,T as BA,C as hA}from"./index-D0ZDnsBw.js";import{g as XA,a as mA,b as TA}from"./spaces-CUv_J9P5.js";import{j as yA}from"./url-join-Bx_A70NM.js";import{S as a2}from"./Skeleton-CCHHqylE.js";import{H as gA}from"./Hidden-BnLj1Yrh.js";function _A(){const[M,b]=r0.useState(null),{blocklet:O}=hb();return r0.useEffect(()=>{b(XA(O))},[O]),{storageEndpoint:M}}const mb=r0.createContext({}),{Provider:SA,Consumer:R5}=mb;function Tb({children:M}){const[b,O]=r0.useState(!1),[c,q]=r0.useState(null),{blocklet:a,actions:{refreshBlocklet:t}}=hb(),{storageEndpoint:i}=_A(),{api:X}=aA();nA(async()=>{try{if(O(!0),tb.isEmpty(i)){q(null);return}const E=await mA(i);q(E)}catch(E){console.error(E),tA.error(E.message)}finally{O(!1)}},[i]);const R=()=>{q(null),t()},w=async E=>{q(E),await Q(E.endpoint),t()},Q=async E=>{await X.configBlocklet({input:{did:[a.meta.did],configs:[{key:dA.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT,value:E}]}}),t()};r0.useEffect(()=>{async function E(){if(!c)return;const D=await TA(c.endpoint,c.name),W0=tb.merge(c,{name:D});q(W0)}E()},[]);const _=!!(i&&c);return y.jsx(SA,{value:{loading:b,spaceGateway:c,deleteSpaceGateway:R,updateSpaceGateway:w,storageEndpoint:i,settingStorageEndpoint:Q,hasStorageEndpoint:_},children:M})}Tb.propTypes={children:WA.node.isRequired};Tb.defaultProps={};function l5(){return r0.useContext(mb)}function JM({value:M,size:b,style:O,...c}){return y.jsxs(kA,{style:{width:b,height:b,...O},...c,children:[y.jsx(YM,{variant:"determinate",role:"progressbar",value:100,size:b,"aria-label":"decorative progress bar",thickness:10,style:{color:"#dddddd"}}),y.jsx(YM,{variant:"determinate",value:M,role:"progressbar",size:b,thickness:10,"aria-label":"main progress bar"})]})}JM.propTypes={value:P.number.isRequired,size:P.number,style:P.object};JM.defaultProps={size:10,style:{}};const kA=v0.span`
2
2
  display: inline-block;
3
3
  position: relative;
4
4
  > * {