@abtnode/blocklet-services 1.17.8-beta-20260116-080047-9fdd00d3 → 1.17.8-beta-20260119-102944-6ba93a16

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 (207) hide show
  1. package/dist/assets/{AdapterDayjs-BI3dme25.js → AdapterDayjs-CYW0YvmK.js} +1 -1
  2. package/dist/assets/{Google-BMSeyXdi.js → Google-DKRt92nm.js} +1 -1
  3. package/dist/assets/{access-control-CSfPgD_B.js → access-control-RI6LQbSm.js} +1 -1
  4. package/dist/assets/{actions-Ng-YRTer.js → actions-BlWED76c.js} +2 -2
  5. package/dist/assets/{actions-Dktj9pEF.js → actions-DydkTgA0.js} +1 -1
  6. package/dist/assets/{add-component-core-DOIm-W83.js → add-component-core-nc1ps0ni.js} +32 -32
  7. package/dist/assets/{add-resource-_wuuBiJJ.js → add-resource-BVOdOQSW.js} +1 -1
  8. package/dist/assets/{addon-N_sS-Sx6.js → addon-DfWedLEC.js} +1 -1
  9. package/dist/assets/{advanced-BhbxG-_n.js → advanced-CuKHqbLO.js} +2 -2
  10. package/dist/assets/{aigne-DElJAbjP.js → aigne-6nMSoyeQ.js} +1 -1
  11. package/dist/assets/{appearance-D71HSeGD.js → appearance-C9TkbSjV.js} +1 -1
  12. package/dist/assets/{ar-BHqjWgUQ.js → ar-DOhYGTlW.js} +1 -1
  13. package/dist/assets/{audit-logs-Ci_HlT4m.js → audit-logs-DKGke9hI.js} +2 -2
  14. package/dist/assets/{authorize-DQERA3Vv.js → authorize-DkSqywe8.js} +1 -1
  15. package/dist/assets/{base-chart-DWXZOkNE.js → base-chart-DcZV4ZCI.js} +1 -1
  16. package/dist/assets/{base32-Cpvj2sD4.js → base32-7iZvvdX8.js} +1 -1
  17. package/dist/assets/{bind-account-BIzFrnLk.js → bind-account-DOwM9Nhe.js} +1 -1
  18. package/dist/assets/branding-Cak2s8bn.js +1 -0
  19. package/dist/assets/{branding-BHJqY7Mz.js → branding-CwSyd5WC.js} +1 -1
  20. package/dist/assets/{branding-DAdwbyWZ.js → branding-lcfxmmPp.js} +1 -1
  21. package/dist/assets/{bundle-avatar-sDqev1Fh.js → bundle-avatar-DwiOyeMO.js} +1 -1
  22. package/dist/assets/button-uUU4Wycr.js +1 -0
  23. package/dist/assets/{click-to-copy-RBTqACSW.js → click-to-copy-BgIYUMoo.js} +1 -1
  24. package/dist/assets/{collapse-DWmyzfnW.js → collapse-RMuUWnK3.js} +1 -1
  25. package/dist/assets/{complete-D6XDZtnV.js → complete-Udiv_yFp.js} +1 -1
  26. package/dist/assets/{component-B2qSKMGx.js → component-CuKviNC8.js} +2 -2
  27. package/dist/assets/{config-oF-A1tKe.js → config-6IwEgT3b.js} +1 -1
  28. package/dist/assets/{config-Ca5tnO9j.js → config-CJwxv2uK.js} +1 -1
  29. package/dist/assets/{config-fYkZxdEr.js → config-D1OcHGlN.js} +4 -4
  30. package/dist/assets/{config-navigation-BEYJ5bSz.js → config-navigation-hDihVsjx.js} +2 -2
  31. package/dist/assets/{config-space-HmsYCb6s.js → config-space-DfstlHnF.js} +1 -1
  32. package/dist/assets/{confirm-DQYDHHdS.js → confirm-CdVn5WdC.js} +1 -1
  33. package/dist/assets/{connect-COLwEMSx.js → connect-CT2vMz6l.js} +3 -3
  34. package/dist/assets/{connect-ydb7rKXe.js → connect-DA7RO2yv.js} +1 -1
  35. package/dist/assets/{connect-BeWeBwCA.js → connect-Dy0Y8HRB.js} +1 -1
  36. package/dist/assets/{connect-to-C3ac4B-g.js → connect-to-CQMUbQkH.js} +1 -1
  37. package/dist/assets/{content-layout-CanSZTqf.js → content-layout-Dlmn5DW6.js} +1 -1
  38. package/dist/assets/{create-passport-svg-De1vqcmo.js → create-passport-svg-hldNORaB.js} +1 -1
  39. package/dist/assets/{createClass-CRUn7w67.js → createClass-CgfWUrk8.js} +1 -1
  40. package/dist/assets/{dashboard-BZiea8Z_.js → dashboard-BvI3ii8Z.js} +2 -2
  41. package/dist/assets/{de-QUGQFv2K.js → de-CtKPdGk6.js} +1 -1
  42. package/dist/assets/{delete-confirm-CpaOkuin.js → delete-confirm-CkiUXocp.js} +1 -1
  43. package/dist/assets/{did-address-DRYM96gB.js → did-address-CG36eCOx.js} +1 -1
  44. package/dist/assets/{domain-D9Kc4Rgt.js → domain-CDTeLbkZ.js} +1 -1
  45. package/dist/assets/{domain-action-card-ugKl692S.js → domain-action-card-kMPYS2Nj.js} +1 -1
  46. package/dist/assets/domains-TI6o1CvX.js +1 -0
  47. package/dist/assets/{email-DDyG3qPR.js → email-DHRHueET.js} +2 -2
  48. package/dist/assets/{empty-spinner-ChYvCNCV.js → empty-spinner-DB1GKIOS.js} +1 -1
  49. package/dist/assets/engine-D_fEFx9_.js +1 -0
  50. package/dist/assets/{es-C4w6cL07.js → es-BSYtSZPg.js} +1 -1
  51. package/dist/assets/{exchange-passport-DoiXZo5M.js → exchange-passport-Cc872mjQ.js} +1 -1
  52. package/dist/assets/{fallback-CZRO9TTQ.js → fallback-D-IHOW-7.js} +1 -1
  53. package/dist/assets/{form--iZWaH7Y.js → form-Co-tgocU.js} +1 -1
  54. package/dist/assets/{form-text-input-Cs-LuCu0.js → form-text-input-CPLafaTk.js} +1 -1
  55. package/dist/assets/{form-wrapper-EixE0Jkw.js → form-wrapper-kWYD3nZz.js} +1 -1
  56. package/dist/assets/{fr-Bq3UipEu.js → fr-C35fi7h9.js} +1 -1
  57. package/dist/assets/{fuel-C85y6XSK.js → fuel-BFx1ShM2.js} +1 -1
  58. package/dist/assets/{gen-access-key-DxF-VBeV.js → gen-access-key-DrgLVRbm.js} +1 -1
  59. package/dist/assets/{gen-simple-access-key-Cxq1_uy6.js → gen-simple-access-key-B24d6k7g.js} +1 -1
  60. package/dist/assets/get-safe-url-beob4f2C.js +1 -0
  61. package/dist/assets/{hi-DGZy0DLh.js → hi-5fpYJkiW.js} +1 -1
  62. package/dist/assets/{home-EzPPxjBW.js → home-Dw18IODa.js} +1 -1
  63. package/dist/assets/{id-DOzDilAf.js → id-DoVb0JYr.js} +1 -1
  64. package/dist/assets/{iframe-C5nvJ0m0.js → iframe-DUzp97tk.js} +1 -1
  65. package/dist/assets/{index-B3ArnS-X.js → index--WQuhwJL.js} +1 -1
  66. package/dist/assets/{index-Cw8Yly1u.js → index-2M4w6J9r.js} +1 -1
  67. package/dist/assets/{index-D3fA5iF-.js → index-3H6a5edM.js} +1 -1
  68. package/dist/assets/{index-_uJPC7_n.js → index-8RHrVCC6.js} +1 -1
  69. package/dist/assets/{index-BM9QepzF.js → index-B-8044Gs.js} +22 -11
  70. package/dist/assets/{index-Ba_SJ3UV.js → index-B6l4xGy5.js} +2 -2
  71. package/dist/assets/{index-CbZQvtgh.js → index-B9FojAjj.js} +1 -1
  72. package/dist/assets/{index-BQFgfBFX.js → index-BOPR4Iyc.js} +2 -2
  73. package/dist/assets/{index-VlFqUdI2.js → index-BUhEyicQ.js} +1 -1
  74. package/dist/assets/{index-DGU5RA0-.js → index-BeunkI-Z.js} +3 -3
  75. package/dist/assets/{index-_bvucGkF.js → index-Bo9KtpTY.js} +1 -1
  76. package/dist/assets/{index-r7svI4rK.js → index-Bpic07NM.js} +7 -7
  77. package/dist/assets/{index-BuucS_rQ.js → index-C1fKsLzf.js} +1 -1
  78. package/dist/assets/{index-D_ymA2Th.js → index-C4ZzROeE.js} +5 -5
  79. package/dist/assets/{index-sb6EjUcD.js → index-CEJb82tA.js} +1 -1
  80. package/dist/assets/{index-Ca33rdd_.js → index-CXp5SI_f.js} +82 -82
  81. package/dist/assets/{index-zkaWHEAS.js → index-C_kNXHsF.js} +1 -1
  82. package/dist/assets/{index-DvQIPWQ6.js → index-Cax1AxL9.js} +1 -1
  83. package/dist/assets/{index-Ca5zgzpl.js → index-CfvGuvbD.js} +1 -1
  84. package/dist/assets/{index-BbO4pSmm.js → index-CqCXPf7W.js} +1 -1
  85. package/dist/assets/{index-p0MfrvgW.js → index-Cx0E03Bs.js} +1 -1
  86. package/dist/assets/{index-CL5ZGYlc.js → index-D3BuekEe.js} +3 -3
  87. package/dist/assets/{index-D4_8N2le.js → index-D6pCyJv8.js} +1 -1
  88. package/dist/assets/{index-Ddl9fWMP.js → index-DFUM0Pvk.js} +1 -1
  89. package/dist/assets/{index-B3fG443w.js → index-DH4rC-7M.js} +1 -1
  90. package/dist/assets/{index-B2PeJoug.js → index-DKzBOJCu.js} +2 -2
  91. package/dist/assets/index-DL0wTcgx.js +1 -0
  92. package/dist/assets/{index-C9V4aWeM.js → index-DWHFecw2.js} +4 -4
  93. package/dist/assets/{index-Dxb3MonW.js → index-DcW3jqfL.js} +1 -1
  94. package/dist/assets/{index-CxOxF1pg.js → index-Di2nSesc.js} +1 -1
  95. package/dist/assets/{index-CiCryHDZ.js → index-DqcciDRh.js} +2 -2
  96. package/dist/assets/{index-DCxNOCc2.js → index-VKjWmvRV.js} +1 -1
  97. package/dist/assets/{index-DVOweIMx.js → index-Vf51dp11.js} +1 -1
  98. package/dist/assets/{index-2AyCotIy.js → index-ZzcJ7eKO.js} +1 -1
  99. package/dist/assets/{index-Bwibx9MU.js → index-bEFOmVth.js} +1 -1
  100. package/dist/assets/{info-outline-rounded-DVdLJtdi.js → info-outline-rounded-DlgANjBB.js} +1 -1
  101. package/dist/assets/{invitation-CUluW5mi.js → invitation-BP8hOEFv.js} +1 -1
  102. package/dist/assets/invitations-C8aZLxdl.js +3 -0
  103. package/dist/assets/{invite-zC3nU84H.js → invite-Cd5zEHFb.js} +1 -1
  104. package/dist/assets/{issue-passport-B_pYDft0.js → issue-passport-D7zqv3Al.js} +1 -1
  105. package/dist/assets/{item-DoUn7xhc.js → item-DNj7ORqk.js} +1 -1
  106. package/dist/assets/{ja-DMq-YXDX.js → ja-DZPUwZ9l.js} +1 -1
  107. package/dist/assets/{ko-BrYbXurh.js → ko-q4i4r9g6.js} +1 -1
  108. package/dist/assets/{landing-page-BJAji-kI.js → landing-page-JLA-ZD1t.js} +1 -1
  109. package/dist/assets/{launch-result-message-B2nhmkKt.js → launch-result-message-DJqF-slD.js} +1 -1
  110. package/dist/assets/{layout-CydCBGqn.js → layout-Cwvm7lmD.js} +1 -1
  111. package/dist/assets/{list-BIwaCPhs.js → list-3MUy-8Ol.js} +2 -2
  112. package/dist/assets/{list-CO8Xp7iX.js → list-BSXHuqLM.js} +1 -1
  113. package/dist/assets/{list-header-DQZTNnUc.js → list-header-BEZSwSji.js} +1 -1
  114. package/dist/assets/localization-Dond4H78.js +1 -0
  115. package/dist/assets/{log-JZXyzrRA.js → log-Bq445Z1e.js} +1 -1
  116. package/dist/assets/logger-CCAAJ2Xo.js +1 -0
  117. package/dist/assets/{login-CU5Tw5QB.js → login-dc2t9Qyo.js} +1 -1
  118. package/dist/assets/{login-method-item-KhJ672kA.js → login-method-item-CyTsqz88.js} +1 -1
  119. package/dist/assets/{login-oauth-callback-Bz7N73Sg.js → login-oauth-callback-Bext19kc.js} +1 -1
  120. package/dist/assets/{logo-uploader-DjKJkvts.js → logo-uploader-CyZuvhwV.js} +1 -1
  121. package/dist/assets/{lost-passport-CyJVtH1V.js → lost-passport-BiYg3QQI.js} +1 -1
  122. package/dist/assets/{metadata-CkzdOpl3.js → metadata-B2-Ltdko.js} +1 -1
  123. package/dist/assets/{nav-menu-5M0Q4jYU.js → nav-menu-DSdXRbfg.js} +1 -1
  124. package/dist/assets/{open-window-DphH3aTv.js → open-window-Dyu79ome.js} +1 -1
  125. package/dist/assets/over-due-invoice-payment-DzUsy6q0.js +1 -0
  126. package/dist/assets/{overview-CGIG2I_w.js → overview-0TBmi-_i.js} +1 -1
  127. package/dist/assets/{page-header-B0HpJClf.js → page-header-qdK3sAJh.js} +1 -1
  128. package/dist/assets/{passport-DKYg_d4G.js → passport-BhEaZ-sr.js} +1 -1
  129. package/dist/assets/{passport-item-CjcqN_g-.js → passport-item-DHwif94N.js} +1 -1
  130. package/dist/assets/{permission-DhyiLNfC.js → permission-CvrrGfG6.js} +1 -1
  131. package/dist/assets/preferences-BBSWzZiT.js +1 -0
  132. package/dist/assets/profile-embed-shcOdRUI.js +1 -0
  133. package/dist/assets/{provider-icon-DX-QfJQN.js → provider-icon-DO2PqSth.js} +1 -1
  134. package/dist/assets/{pt-Dl6732JN.js → pt-BFCHl6F1.js} +1 -1
  135. package/dist/assets/{publish-resource-vCC9AfJK.js → publish-resource-CMuHIOUf.js} +1 -1
  136. package/dist/assets/{react-beautiful-dnd.esm-bkXlrjYw.js → react-beautiful-dnd.esm-CWJ5I9Zv.js} +1 -1
  137. package/dist/assets/{react-stripe.esm-BBCEegrE.js → react-stripe.esm-B-FTN8ep.js} +1 -1
  138. package/dist/assets/{required-11pmtzQr.js → required-DnQpCGsD.js} +1 -1
  139. package/dist/assets/{ru-CVUeN9AX.js → ru-CSTl62kK.js} +1 -1
  140. package/dist/assets/{runtime-BjKYEBG_.js → runtime-B_ZLP4FF.js} +1 -1
  141. package/dist/assets/sdk-CktKu_IW.js +1 -0
  142. package/dist/assets/{section-ewv0pNWr.js → section-CZylgxjz.js} +1 -1
  143. package/dist/assets/{security-Xrnc8Gqe.js → security-DHRU8k0u.js} +1 -1
  144. package/dist/assets/{session-lE2gmzzF.js → session-Bp3LV7zJ.js} +1 -1
  145. package/dist/assets/{setup-p5LUFpYK.js → setup-B6-Ei_3X.js} +1 -1
  146. package/dist/assets/{shorten-label-1iJcvGQT.js → shorten-label-CuBHsWUR.js} +1 -1
  147. package/dist/assets/{simple-select-BKXEgxog.js → simple-select-nI-W90c_.js} +1 -1
  148. package/dist/assets/{spaces-Ckljlc4d.js → spaces-ix8u0ZiI.js} +1 -1
  149. package/dist/assets/{start-BE-C9MhV.js → start-oRp78RMQ.js} +1 -1
  150. package/dist/assets/{starting-progress-DC-J-5Os.js → starting-progress-CWp5fTY0.js} +1 -1
  151. package/dist/assets/{status-DR5t3VVx.js → status-Dn_LKaNp.js} +1 -1
  152. package/dist/assets/{step-actions-CArEuzNw.js → step-actions-DIZRcnXf.js} +1 -1
  153. package/dist/assets/{studio-BEzAGvQT.js → studio-CVIa8-XY.js} +1 -1
  154. package/dist/assets/{switch-CmVFEdik.js → switch-BbyTGEOo.js} +1 -1
  155. package/dist/assets/{switch-control-DbLHF-NB.js → switch-control-BRjXGc1d.js} +1 -1
  156. package/dist/assets/{table-tips-DQIh1EQR.js → table-tips-Dvmdodc5.js} +1 -1
  157. package/dist/assets/{team-7-48iuwj.js → team-BTz28XqK.js} +1 -1
  158. package/dist/assets/{th-32eBNQes.js → th-D75Dlluo.js} +1 -1
  159. package/dist/assets/theme-mode-toggle-D3bcd10D.js +1 -0
  160. package/dist/assets/{traffic-Dwd2RNqG.js → traffic-Cea69sMW.js} +1 -1
  161. package/dist/assets/{transfer-BwnSX6wY.js → transfer-BydXCVCg.js} +1 -1
  162. package/dist/assets/unsubscribe-BjAjx-Fl.js +1 -0
  163. package/dist/assets/{use-app-logo-BzsLZwwK.js → use-app-logo-IRizt64R.js} +1 -1
  164. package/dist/assets/{use-blocklet-logo-BWPJOOVd.js → use-blocklet-logo-Cf1j7pQz.js} +1 -1
  165. package/dist/assets/{use-mobile-DgmmfWdl.js → use-mobile-CyUZDIaX.js} +1 -1
  166. package/dist/assets/{use-mobile-BSL5RsRd.js → use-mobile-DFkQ5N0b.js} +1 -1
  167. package/dist/assets/{use-mobile-TAIHvgoJ.js → use-mobile-DwGMuJlg.js} +1 -1
  168. package/dist/assets/{use-server-logo-BLcfNvrR.js → use-server-logo-KZn9RrZd.js} +1 -1
  169. package/dist/assets/{use-window-close-D2_118dJ.js → use-window-close-Dpj5UcYT.js} +1 -1
  170. package/dist/assets/{useAsyncRetry-B-Txlvk6.js → useAsyncRetry-C4R9ufi-.js} +1 -1
  171. package/dist/assets/{useLocalStorage-D6axLnAi.js → useLocalStorage-BQfIniHX.js} +1 -1
  172. package/dist/assets/{user-center-DBscV1le.js → user-center-6K47tx8j.js} +5 -5
  173. package/dist/assets/{user-follower-Di51icra.js → user-follower-BwzTutxU.js} +1 -1
  174. package/dist/assets/{util-DCHBQZpP.js → util-DkTwHdRu.js} +1 -1
  175. package/dist/assets/{util-ad0rjUA1.js → util-DySzCymV.js} +1 -1
  176. package/dist/assets/{vendor-arcblock-ivFYo5vP.js → vendor-arcblock-Dll6qxMT.js} +1 -1
  177. package/dist/assets/{vendor-mui-core-D7t4vMS5.js → vendor-mui-core-CV-FnYH_.js} +1 -1
  178. package/dist/assets/{vendor-mui-x-BpPw6UfF.js → vendor-mui-x-DwN6dcQH.js} +1 -1
  179. package/dist/assets/{vendor-ux-Dl3wVbv_.js → vendor-ux-CLT2i3Pv.js} +2 -2
  180. package/dist/assets/{vi-DF8IinAc.js → vi-D1mKYrmb.js} +1 -1
  181. package/dist/assets/{wait-connect-DOIonmAv.js → wait-connect-q0_7mz_u.js} +1 -1
  182. package/dist/assets/wallet-hidden-topbar-joIVZ1nl.js +68 -0
  183. package/dist/assets/{wizard-CrkxQgBY.js → wizard-C5Kl-g70.js} +1 -1
  184. package/dist/assets/{wizard-components-BzPyRFRt.js → wizard-components-DQrlaeeW.js} +1 -1
  185. package/dist/assets/wrap-locale-5DJTJTXP.js +1 -0
  186. package/dist/assets/{zh-DQQBhbva.js → zh-CJ9vCpmv.js} +1 -1
  187. package/dist/assets/{zh-ByJkLAV1.js → zh-G2I44gfs.js} +1 -1
  188. package/dist/assets/{zh-tw-34G9tsUP.js → zh-tw-C4Juvs-i.js} +1 -1
  189. package/dist/index.html +1 -1
  190. package/package.json +31 -31
  191. package/dist/assets/branding-D-ShZ8m2.js +0 -1
  192. package/dist/assets/button-B_Qd9K_t.js +0 -1
  193. package/dist/assets/domains-B9b2gmbn.js +0 -1
  194. package/dist/assets/engine-L1SEogaX.js +0 -1
  195. package/dist/assets/get-safe-url-D4zRnTpF.js +0 -1
  196. package/dist/assets/index-BoJbHOhC.js +0 -1
  197. package/dist/assets/invitations-gJ3uAWGN.js +0 -3
  198. package/dist/assets/localization-BYdi6ljV.js +0 -1
  199. package/dist/assets/logger-BMHd-C1S.js +0 -1
  200. package/dist/assets/over-due-invoice-payment-DD_j5vb4.js +0 -1
  201. package/dist/assets/preferences-DHjRWgwZ.js +0 -1
  202. package/dist/assets/profile-embed-Gc79_Dhj.js +0 -1
  203. package/dist/assets/sdk-CXEy5Pgp.js +0 -1
  204. package/dist/assets/theme-mode-toggle-BltDSXhy.js +0 -1
  205. package/dist/assets/unsubscribe-CP0mTwWi.js +0 -1
  206. package/dist/assets/wallet-hidden-topbar-DKISAPb3.js +0 -68
  207. package/dist/assets/wrap-locale-BJF_SaOe.js +0 -1
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.__toCdnUrl("assets/vendor-ux-DYcPPYq2.css"),window.__toCdnUrl("assets/index-DrCTi6nm.css"),window.__toCdnUrl("assets/index-_3Fxot8G.css")])))=>i.map(i=>d[i]);
2
- import{r as k,u as Dt,m as rt,L as we,g as As,i as qs,k as Ns,l as bt}from"./vendor-react-DX7tU9aY.js";import{L as Oe,j as e,al as a,aY as Et,X as n,an as xe,I as ce,d4 as Ws,d5 as _s,ct as xo,c3 as nt,T as A,d6 as Os,bo as zs,s as go,cq as ko,d7 as Bs,d8 as Vs,Z as lt,aT as ve,aS as Us,d9 as Ms,a6 as He,b4 as it,cB as Lt,cQ as Fs,bR as Hs,bK as Me,bW as Gs,bI as et,R as J,a7 as Se,cF as Xs,Q as jo,N as yo,P as Pt,aj as wo,p as vo,M as be,a4 as Js,b1 as Co,a0 as Ro,c6 as Ks,C as Xe,aH as Ys,S as So,A as ne,b3 as Re,da as Xt,bB as tt,db as To,W as Io,U as $t,aN as Do,c1 as Zs,G as Eo,cT as Qs,aO as er,aP as tr,cU as or,cV as sr,bk as Lo,ar as rr,dc as nr,a2 as Po,a1 as ot,cW as Jt,bh as lr,bi as ir,dd as cr,de as ar,bN as vt,z as dr,F as ur,bJ as pr,bL as ft}from"./vendor-mui-core-D7t4vMS5.js";import{c as F,W as ke,V as Ie,w as hr,G as me,bk as mr,k as br,o as Kt,bo as fr,a7 as Yt,bg as xr,bp as gr,bq as kr,br as jr}from"./index-Ca33rdd_.js";import{v as yr,z as ue,x as At,D as $o,p as wr}from"./vendor-utils-BzQg432x.js";import{W as X,bC as Ao,bV as vr,b4 as $e,b9 as qo,bk as No,bW as Cr,aQ as qt,Q as _,bU as Nt,bX as Wt,Y as ae,_ as Wo,v as _e,aO as ct,bb as _o}from"./vendor-ux-Dl3wVbv_.js";import{C as at}from"./confirm-DQYDHHdS.js";import{u as ze}from"./session-lE2gmzzF.js";import{W as Ct}from"./did-address-DRYM96gB.js";import{E as Je}from"./empty-spinner-ChYvCNCV.js";import{B as _t}from"./bundle-avatar-sDqev1Fh.js";import{S as Te}from"./shorten-label-1iJcvGQT.js";import{L as Ot}from"./list-header-DQZTNnUc.js";import{C as Oo}from"./click-to-copy-RBTqACSW.js";import{t as Zt}from"./question-mark-circle.svg-B0bcUgC5.js";import{t as Rr,b as Sr}from"./vendor-hooks-DAZ1H6Va.js";import{u as Fe}from"./useSetState-CUbypYGT.js";import{e as Tr}from"./engine-L1SEogaX.js";import"./api-B8JXuhVp.js";import{T as Ir,S as Dr}from"./vendor-mui-x-BpPw6UfF.js";import{D as Qt,C as eo,P as to}from"./react-beautiful-dnd.esm-bkXlrjYw.js";import{u as zo,a as Er,b as Lr,d as Pr,e as $r}from"./wait-connect-DOIonmAv.js";import{f as ge}from"./index-DBs9Ljax.js";import{c as Ar,A as Bo,S as qr,U as Nr}from"./item-DoUn7xhc.js";import{D as Wr}from"./delete-confirm-CpaOkuin.js";import{g as Vo}from"./get-safe-url-D4zRnTpF.js";import{u as Pe}from"./index-zkaWHEAS.js";import{M as _r}from"./index-DvQIPWQ6.js";import{p as Or}from"./purify.es-HRjpPm7y.js";import{r as zr}from"./index-CbZQvtgh.js";import{B as te}from"./joi-browser.min-eEVeW7LC.js";import"./vendor-arcblock-ivFYo5vP.js";import"./raf-schd.esm-BZ-2sjAE.js";import"./joi-browser.min-CUdv8seQ.js";function zt({did:t,projectId:o,title:s,logo:r,describe:l}){const i=`${`${F.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${t}/${o}/logo/upload`}/${r}`,[d,u]=k.useState(!1),x=Oe(p=>p.breakpoints.down("md"));return e.jsxs(a,{sx:{display:"flex",flexDirection:"row",color:d?"primary.main":"grey.900",gap:1},onPointerEnter:()=>u(!0),onPointerLeave:()=>u(!1),children:[e.jsx(Et,{sx:{borderRadius:1},src:i}),e.jsxs(a,{children:[e.jsx(Te,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:x?"primary.main":""},children:s||"/"}),e.jsx(Te,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:x||d?"primary.main":"grey.700"},children:l||"/"})]})]})}zt.propTypes={projectId:n.string.isRequired,did:n.string.isRequired,title:n.string.isRequired,logo:n.string.isRequired,describe:n.string.isRequired};function Uo({initUrl:t=null}){const o=Dt(),s=t?.searchParams.get("tenantScope")||"",{t:r,locale:l}=X(),{api:c}=ke(),{api:i}=ze(),[d,u]=k.useState(!0),{blocklet:x}=Ie(),[p,m]=k.useState(null),[f,b]=k.useState(!1),h=Oe(E=>E.breakpoints.down("xl")),j=Oe(E=>E.breakpoints.down("md")),{componentDid:v=""}=rt(),[g,C]=k.useState(null),I=`publish-${x.meta.did}`,R=Ao(I),[y,T]=k.useState({searchText:R.searchText||"",pageSize:R.rowsPerPage||10,page:1}),O=()=>{c.getProjects({input:{did:x.meta.did,componentDid:v,tenantScope:s}}).then(E=>{const D=E?.projects||[];u(!1),C(D)}).catch(E=>{u(!1),_.error(E.message)})},N=()=>{o(`${F.UNOWNED_DID}/create/none/0.0.0`,{replace:!0})},z=E=>{m(E)},K=()=>{u(!1),b(!0)},L=()=>{b(!1),m(null)},$=E=>{_.error(E.message),b(!1),m(null)},w=E=>{if(!E?.deleted){_.error("Delete project failed");return}O(),b(!1),m(null)};k.useEffect(()=>{O()},[]);const S=k.useMemo(()=>{if(!y.searchText)return g;let E=y.searchText?.trim();return E?(E=vr(E).toLocaleLowerCase(),g.filter(D=>D.blockletTitle.toLowerCase().includes(E)||D.blockletDid.toLowerCase().includes(E))):g},[g,y.searchText]);if(!g&&d)return e.jsx(a,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:e.jsx(Je,{})});if(!g)return null;if(!g.length)return e.jsxs(a,{sx:{display:"flex",flexDirection:"column",alignItems:"center",pt:10},children:[e.jsx(a,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:r("blocklet.publish.blockletEmptyTip")}),e.jsx(a,{sx:{fontSize:14,color:"text.secondary",mb:3},children:r("blocklet.publish.createBlockletTip")}),e.jsx($e,{onClick:N,variant:"contained",children:r("blocklet.publish.createBlocklet")})]});const Z=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:E=>{const D=g[E];return e.jsx(we,{to:`${D.id}`,children:e.jsx(zt,{did:x.meta.did,projectId:D.id,logo:D.blockletLogo,title:D.blockletTitle,describe:D.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{searchable:!1,customBodyRender:E=>E?e.jsx(qo,{type:"success",children:E}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:E=>E?e.jsx(Ct,{size:14,compact:!0,responsive:!1,did:E}):null}},h||v?null:{label:r("common.createdBy"),name:"createdBy",options:{customBodyRender:E=>E?e.jsx(Ct,{onClick:()=>{o(`${F.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/members?did=${E}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:E}):null}},h||v?null:{label:r("common.scope"),name:"componentDid",options:{customBodyRender:E=>{const D=(x.children||[]).find(V=>V.meta.did===E);return D?e.jsxs(a,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start"},children:[e.jsx(_t,{size:14,blocklet:D,ancestors:[x]}),e.jsx(a,{sx:{ml:.5,color:"text.primary",fontSize:14},children:D.meta.title})]},E):""}}},h||s?null:{label:r("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:E=>e.jsx(a,{sx:{ml:.5,color:"text.primary",fontSize:14},children:e.jsx(Te,{children:E})})}},{label:r("common.updatedAt"),name:"updatedAt",options:{searchable:!1,customBodyRender:E=>e.jsx(No,{value:Number(E),locale:l})}},{label:r("common.actions"),name:"actions",options:{searchable:!1,customBodyRenderLite:E=>{const D=g[E];return e.jsxs(a,{sx:{display:"flex"},children:[e.jsx(we,{to:`${D.id}/new-release/none/${D.lastReleaseId}`,children:e.jsx(xe,{title:r("blocklet.publish.createRelease"),placement:"top",children:e.jsx(ce,{color:"primary","aria-label":"create",children:e.jsx(Ws,{style:{fontSize:18}})})})}),!!D.lastReleaseId&&e.jsx(xe,{title:r("blocklet.publish.viewLastRelease",{name:D.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"secondary","aria-label":"create",children:e.jsx(we,{style:{display:"flex"},to:`${D.id}/view/${D.lastReleaseId}/${D.blockletVersion}`,children:e.jsx(_s,{sx:{fontSize:18}})})})}),e.jsx(xe,{title:r("blocklet.publish.delete",{name:D.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"primary","aria-label":"delete",onClick:()=>z(D),children:e.jsx(xo,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),H=({page:E,rowsPerPage:D,searchText:V})=>{y.pageSize!==D?T(U=>({...U,searchText:"",pageSize:D,page:1})):y.page!==E+1?T(U=>({...U,searchText:"",page:E+1})):y.searchText!==V&&T(U=>({...U,searchText:V,page:1}))},Q=f?e.jsx(hr,{open:!0,popup:!0,onClose:L,action:"check-has-project-id",locale:l,checkFn:i.get,saveConnect:!1,forceConnected:!1,checkTimeout:300*1e3,onSuccess:w,onError:$,extraParams:{projectId:p.id,did:x.meta.did,name:p.blockletTitle},messages:{title:r("blocklet.publish.deleteProject.title",{name:p.blockletTitle}),scan:r("blocklet.publish.deleteProject.scan",{name:p.blockletTitle}),confirm:r("blocklet.publish.deleteProject.confirm"),success:r("blocklet.publish.deleteProject.success")}}):null;return e.jsxs(Br,{children:[e.jsx(Ot,{sx:{mb:2},left:e.jsxs(a,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[e.jsxs(A,{variant:"h4",children:[r("common.blocklets")," (",S.length,")"]}),e.jsx(xe,{title:r("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:e.jsx(Os,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(Cr,{options:{searchPlaceholder:r("blocklet.list.searchPlaceholder"),searchDebounceTime:600,searchAlwaysOpen:j},search:y.searchText,searchText:y.searchText,searchTextUpdate:E=>T(D=>({...D,searchText:E})),searchClose:()=>T(E=>({...E,searchText:""})),onSearchOpen:()=>{}}),e.jsxs($e,{onClick:N,variant:"contained",children:[e.jsx(nt,{style:{fontSize:"1.3em",marginRight:4}}),r("blocklet.publish.createBlocklet")]})]})}),e.jsx(qt,{className:"main-table",locale:l,data:S,columns:Z,options:{search:!1,sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,searchAlwaysOpen:!0,rowsPerPageOptions:[10,20,50,100]},durable:I,onChange:H}),p&&e.jsx(at,{title:`${r("common.delete")} ${p.blockletTitle}`,description:r("blocklet.publish.deleteProject.description"),confirm:r("common.confirm"),onConfirm:K,onCancel:()=>m(null),children:e.jsx(a,{sx:{marginTop:2},children:[r("blocklet.publish.deleteProject.tip1"),r("blocklet.publish.deleteProject.tip2"),r("blocklet.publish.deleteProject.tip3")].map(E=>e.jsxs(a,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[e.jsx(zs,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),e.jsx(A,{component:"span",variant:"inherit",sx:{color:"text.secondary"},children:E})]}))})}),Q]})}const Br=go(a)`
2
+ import{r as k,u as Dt,m as rt,L as we,g as As,i as qs,k as Ns,l as bt}from"./vendor-react-DX7tU9aY.js";import{L as Oe,j as e,al as a,aY as Et,X as n,an as xe,I as ce,d4 as Ws,d5 as _s,cr as xo,ct as nt,T as A,d6 as Os,bo as zs,s as go,co as ko,d7 as Bs,d8 as Vs,Z as lt,aT as ve,aS as Us,d9 as Ms,a6 as He,b4 as it,cB as Lt,cQ as Fs,bR as Hs,bK as Me,bW as Gs,bI as et,R as J,a7 as Se,cF as Xs,Q as jo,N as yo,P as Pt,aj as wo,p as vo,M as be,a4 as Js,b1 as Co,a0 as Ro,c3 as Ks,C as Xe,aH as Ys,S as So,A as ne,b3 as Re,da as Xt,bB as tt,db as To,W as Io,U as $t,aN as Do,cn as Zs,G as Eo,cT as Qs,aO as er,aP as tr,cU as or,cV as sr,bk as Lo,ar as rr,dc as nr,a2 as Po,a1 as ot,cW as Jt,bh as lr,bi as ir,dd as cr,de as ar,bN as vt,z as dr,F as ur,bJ as pr,bL as ft}from"./vendor-mui-core-CV-FnYH_.js";import{c as F,W as ke,V as Ie,w as hr,G as me,bk as mr,k as br,o as Kt,bo as fr,a7 as Yt,bg as xr,bp as gr,bq as kr,br as jr}from"./index-CXp5SI_f.js";import{v as yr,z as ue,x as At,D as $o,p as wr}from"./vendor-utils-BzQg432x.js";import{W as X,bE as Ao,bX as vr,b5 as $e,ba as qo,bm as No,bY as Cr,aR as qt,Q as _,bW as Nt,bZ as Wt,Y as ae,_ as Wo,v as _e,aO as ct,bc as _o}from"./vendor-ux-CLT2i3Pv.js";import{C as at}from"./confirm-CdVn5WdC.js";import{u as ze}from"./session-Bp3LV7zJ.js";import{W as Ct}from"./did-address-CG36eCOx.js";import{E as Je}from"./empty-spinner-DB1GKIOS.js";import{B as _t}from"./bundle-avatar-DwiOyeMO.js";import{S as Te}from"./shorten-label-CuBHsWUR.js";import{L as Ot}from"./list-header-BEZSwSji.js";import{C as Oo}from"./click-to-copy-BgIYUMoo.js";import{t as Zt}from"./question-mark-circle.svg-B0bcUgC5.js";import{t as Rr,b as Sr}from"./vendor-hooks-DAZ1H6Va.js";import{u as Fe}from"./useSetState-CUbypYGT.js";import{e as Tr}from"./engine-D_fEFx9_.js";import"./api-B8JXuhVp.js";import{T as Ir,S as Dr}from"./vendor-mui-x-DwN6dcQH.js";import{D as Qt,C as eo,P as to}from"./react-beautiful-dnd.esm-CWJ5I9Zv.js";import{u as zo,a as Er,b as Lr,d as Pr,e as $r}from"./wait-connect-q0_7mz_u.js";import{f as ge}from"./index-DBs9Ljax.js";import{c as Ar,A as Bo,S as qr,U as Nr}from"./item-DNj7ORqk.js";import{D as Wr}from"./delete-confirm-CkiUXocp.js";import{g as Vo}from"./get-safe-url-beob4f2C.js";import{u as Pe}from"./index-C_kNXHsF.js";import{M as _r}from"./index-Cax1AxL9.js";import{p as Or}from"./purify.es-HRjpPm7y.js";import{r as zr}from"./index-B9FojAjj.js";import{B as te}from"./joi-browser.min-eEVeW7LC.js";import"./vendor-arcblock-Dll6qxMT.js";import"./raf-schd.esm-BZ-2sjAE.js";import"./joi-browser.min-CUdv8seQ.js";function zt({did:t,projectId:o,title:s,logo:r,describe:l}){const i=`${`${F.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${t}/${o}/logo/upload`}/${r}`,[d,u]=k.useState(!1),x=Oe(p=>p.breakpoints.down("md"));return e.jsxs(a,{sx:{display:"flex",flexDirection:"row",color:d?"primary.main":"grey.900",gap:1},onPointerEnter:()=>u(!0),onPointerLeave:()=>u(!1),children:[e.jsx(Et,{sx:{borderRadius:1},src:i}),e.jsxs(a,{children:[e.jsx(Te,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:x?"primary.main":""},children:s||"/"}),e.jsx(Te,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:x||d?"primary.main":"grey.700"},children:l||"/"})]})]})}zt.propTypes={projectId:n.string.isRequired,did:n.string.isRequired,title:n.string.isRequired,logo:n.string.isRequired,describe:n.string.isRequired};function Uo({initUrl:t=null}){const o=Dt(),s=t?.searchParams.get("tenantScope")||"",{t:r,locale:l}=X(),{api:c}=ke(),{api:i}=ze(),[d,u]=k.useState(!0),{blocklet:x}=Ie(),[p,m]=k.useState(null),[f,b]=k.useState(!1),h=Oe(E=>E.breakpoints.down("xl")),j=Oe(E=>E.breakpoints.down("md")),{componentDid:v=""}=rt(),[g,C]=k.useState(null),I=`publish-${x.meta.did}`,R=Ao(I),[y,T]=k.useState({searchText:R.searchText||"",pageSize:R.rowsPerPage||10,page:1}),O=()=>{c.getProjects({input:{did:x.meta.did,componentDid:v,tenantScope:s}}).then(E=>{const D=E?.projects||[];u(!1),C(D)}).catch(E=>{u(!1),_.error(E.message)})},N=()=>{o(`${F.UNOWNED_DID}/create/none/0.0.0`,{replace:!0})},z=E=>{m(E)},K=()=>{u(!1),b(!0)},L=()=>{b(!1),m(null)},$=E=>{_.error(E.message),b(!1),m(null)},w=E=>{if(!E?.deleted){_.error("Delete project failed");return}O(),b(!1),m(null)};k.useEffect(()=>{O()},[]);const S=k.useMemo(()=>{if(!y.searchText)return g;let E=y.searchText?.trim();return E?(E=vr(E).toLocaleLowerCase(),g.filter(D=>D.blockletTitle.toLowerCase().includes(E)||D.blockletDid.toLowerCase().includes(E))):g},[g,y.searchText]);if(!g&&d)return e.jsx(a,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:e.jsx(Je,{})});if(!g)return null;if(!g.length)return e.jsxs(a,{sx:{display:"flex",flexDirection:"column",alignItems:"center",pt:10},children:[e.jsx(a,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:r("blocklet.publish.blockletEmptyTip")}),e.jsx(a,{sx:{fontSize:14,color:"text.secondary",mb:3},children:r("blocklet.publish.createBlockletTip")}),e.jsx($e,{onClick:N,variant:"contained",children:r("blocklet.publish.createBlocklet")})]});const Z=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:E=>{const D=g[E];return e.jsx(we,{to:`${D.id}`,children:e.jsx(zt,{did:x.meta.did,projectId:D.id,logo:D.blockletLogo,title:D.blockletTitle,describe:D.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{searchable:!1,customBodyRender:E=>E?e.jsx(qo,{type:"success",children:E}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:E=>E?e.jsx(Ct,{size:14,compact:!0,responsive:!1,did:E}):null}},h||v?null:{label:r("common.createdBy"),name:"createdBy",options:{customBodyRender:E=>E?e.jsx(Ct,{onClick:()=>{o(`${F.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/members?did=${E}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:E}):null}},h||v?null:{label:r("common.scope"),name:"componentDid",options:{customBodyRender:E=>{const D=(x.children||[]).find(V=>V.meta.did===E);return D?e.jsxs(a,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start"},children:[e.jsx(_t,{size:14,blocklet:D,ancestors:[x]}),e.jsx(a,{sx:{ml:.5,color:"text.primary",fontSize:14},children:D.meta.title})]},E):""}}},h||s?null:{label:r("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:E=>e.jsx(a,{sx:{ml:.5,color:"text.primary",fontSize:14},children:e.jsx(Te,{children:E})})}},{label:r("common.updatedAt"),name:"updatedAt",options:{searchable:!1,customBodyRender:E=>e.jsx(No,{value:Number(E),locale:l})}},{label:r("common.actions"),name:"actions",options:{searchable:!1,customBodyRenderLite:E=>{const D=g[E];return e.jsxs(a,{sx:{display:"flex"},children:[e.jsx(we,{to:`${D.id}/new-release/none/${D.lastReleaseId}`,children:e.jsx(xe,{title:r("blocklet.publish.createRelease"),placement:"top",children:e.jsx(ce,{color:"primary","aria-label":"create",children:e.jsx(Ws,{style:{fontSize:18}})})})}),!!D.lastReleaseId&&e.jsx(xe,{title:r("blocklet.publish.viewLastRelease",{name:D.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"secondary","aria-label":"create",children:e.jsx(we,{style:{display:"flex"},to:`${D.id}/view/${D.lastReleaseId}/${D.blockletVersion}`,children:e.jsx(_s,{sx:{fontSize:18}})})})}),e.jsx(xe,{title:r("blocklet.publish.delete",{name:D.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"primary","aria-label":"delete",onClick:()=>z(D),children:e.jsx(xo,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),H=({page:E,rowsPerPage:D,searchText:V})=>{y.pageSize!==D?T(U=>({...U,searchText:"",pageSize:D,page:1})):y.page!==E+1?T(U=>({...U,searchText:"",page:E+1})):y.searchText!==V&&T(U=>({...U,searchText:V,page:1}))},Q=f?e.jsx(hr,{open:!0,popup:!0,onClose:L,action:"check-has-project-id",locale:l,checkFn:i.get,saveConnect:!1,forceConnected:!1,checkTimeout:300*1e3,onSuccess:w,onError:$,extraParams:{projectId:p.id,did:x.meta.did,name:p.blockletTitle},messages:{title:r("blocklet.publish.deleteProject.title",{name:p.blockletTitle}),scan:r("blocklet.publish.deleteProject.scan",{name:p.blockletTitle}),confirm:r("blocklet.publish.deleteProject.confirm"),success:r("blocklet.publish.deleteProject.success")}}):null;return e.jsxs(Br,{children:[e.jsx(Ot,{sx:{mb:2},left:e.jsxs(a,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[e.jsxs(A,{variant:"h4",children:[r("common.blocklets")," (",S.length,")"]}),e.jsx(xe,{title:r("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:e.jsx(Os,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(Cr,{options:{searchPlaceholder:r("blocklet.list.searchPlaceholder"),searchDebounceTime:600,searchAlwaysOpen:j},search:y.searchText,searchText:y.searchText,searchTextUpdate:E=>T(D=>({...D,searchText:E})),searchClose:()=>T(E=>({...E,searchText:""})),onSearchOpen:()=>{}}),e.jsxs($e,{onClick:N,variant:"contained",children:[e.jsx(nt,{style:{fontSize:"1.3em",marginRight:4}}),r("blocklet.publish.createBlocklet")]})]})}),e.jsx(qt,{className:"main-table",locale:l,data:S,columns:Z,options:{search:!1,sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,searchAlwaysOpen:!0,rowsPerPageOptions:[10,20,50,100]},durable:I,onChange:H}),p&&e.jsx(at,{title:`${r("common.delete")} ${p.blockletTitle}`,description:r("blocklet.publish.deleteProject.description"),confirm:r("common.confirm"),onConfirm:K,onCancel:()=>m(null),children:e.jsx(a,{sx:{marginTop:2},children:[r("blocklet.publish.deleteProject.tip1"),r("blocklet.publish.deleteProject.tip2"),r("blocklet.publish.deleteProject.tip3")].map(E=>e.jsxs(a,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[e.jsx(zs,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),e.jsx(A,{component:"span",variant:"inherit",sx:{color:"text.secondary"},children:E})]}))})}),Q]})}const Br=go(a)`
3
3
  ${({theme:t})=>t.breakpoints.down("md")} {
4
4
  .MuiTableRow-root {
5
5
  border-color: ${({theme:t})=>t.palette.divider};
@@ -142,7 +142,7 @@ import{r as k,u as Dt,m as rt,L as we,g as As,i as qs,k as Ns,l as bt}from"./ven
142
142
  background: #fff;
143
143
  z-index: 10;
144
144
  }
145
- `,co="lastWantToConnectStoreId";function sn(t){const[o,s]=k.useState(null),{session:r}=ze(),l=k.useCallback(d=>{s(d),localStorage.setItem(co,d?.id)},[s]),c=k.useMemo(()=>{const d=localStorage.getItem(co),u=d?(t?.settings?.storeList||[]).find(p=>p.id===d):null;if(u)return u;let x=(t?.settings?.storeList||[]).find(p=>!(p.id!==F.BLOCKLET_STORE.id||p.scope&&p.scope!=="studio"&&p.scope!==r?.user?.did));return x||(x=t?.settings?.storeList?.[0]),x},[t?.settings?.storeList,r?.user?.did]);return[o||c||{},l]}const Bt=({fromBlocklet:t,nodeInfo:o,blocklet:s,userDid:r})=>{const l=t?s?.meta?.did:o?.did;let c=t?s?.settings?.storeList||[]:o?.blockletRegistryList||[];return Array.isArray(c)||(c=[]),c=c.filter(i=>i.protected||wr(i.scope)||i.scope==="studio"||i.scope===r),{teamDid:l,storeList:c}};function es({blocklet:t=null,store:o=null,onChangeStore:s,onClick:r,disabled:l,loading:c,componentDid:i}){const{t:d}=X(),{session:u}=ze(),{api:x,info:p,inService:m}=ke(),f=Ie(),[b,h]=k.useState(!1),j=k.useRef(null),[v,g]=k.useState(!1),[C,I]=k.useState(null),R=$=>{s($),h(!1)},y=()=>{h(!b)},T=$=>{j.current&&j.current.contains($.target)||h(!1)},O=()=>{g(!0)},N=()=>{g(!1)},z=async()=>{if(C)try{await x.deleteBlockletStore({input:{teamDid:t.meta.did,url:C.url,projectId:"",scope:C.scope||"studio"}}),await f?.actions?.refreshBlocklet()}catch($){_.error(`Remove Blocklet Store Error: ${ge($)}`)}finally{I(null)}},{storeList:K}=Bt({fromBlocklet:m,blocklet:t,nodeInfo:p,userDid:u?.user?.did}),L=t?.meta?.did;return e.jsxs(e.Fragment,{children:[e.jsxs(et,{disabled:l,ref:j,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[e.jsxs(J,{onClick:r,children:[c&&e.jsx(Se,{size:14,sx:{mr:.5}}),`${d("common.connect")} ${o.name||""}`]}),e.jsx(J,{size:"small","aria-controls":b?"split-button-menu":void 0,"aria-expanded":b?"true":void 0,"aria-label":"select merge strategy","aria-haspopup":"menu",onClick:y,children:e.jsx(Xs,{})})]}),e.jsx(jo,{sx:{zIndex:10},open:b,anchorEl:j.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:$})=>e.jsx(yo,{...$,style:{transformOrigin:"center top"},children:e.jsx(Pt,{children:e.jsx(wo,{onClickAway:T,children:e.jsxs(vo,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[K?.map(w=>e.jsxs(be,{selected:w.id===o?.id,sx:{height:56},onClick:()=>R(w),children:[e.jsxs(a,{children:[e.jsx(Te,{sx:{fontSize:"16px"},maxLength:24,children:w.name}),e.jsx(Te,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:w.url})]}),Ar({store:w,userDid:u?.user?.did})&&e.jsx(ce,{sx:{ml:1},onClick:S=>{S.preventDefault(),S.stopPropagation(),I(w)},children:e.jsx(ae,{icon:"ic:outline-delete"})})]},w.url)),e.jsx(Js,{}),e.jsxs(be,{onClick:O,children:[e.jsx(nt,{font:!0}),e.jsx(A,{variant:"inherit",children:d("store.blockletRegistry.addRegistry")})]})]})})})})}),v&&e.jsx(Bo,{hiddenChildren:!0,open:!0,onClose:N,teamDid:L,storeList:K,scope:"studio",onAdd:f?.actions?.refreshBlocklet}),C&&e.jsx(at,{displayError:!0,title:`${d("common.delete")} ${C.name}`,description:d("blocklet.publish.deleteStoreTip",{name:C.name}),confirm:d("common.confirm"),onConfirm:z,onCancel:()=>I(null)})]})}es.propTypes={store:n.object,blocklet:n.object,onChangeStore:n.func.isRequired,onClick:n.func.isRequired,loading:n.bool.isRequired,disabled:n.bool.isRequired,componentDid:n.string.isRequired,projectType:n.string.isRequired,getData:n.func.isRequired};const ts=(t,o,s)=>{const r=`${F.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${o.meta.did}/${s}/logo/upload`,l=`${F.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${o.meta.did}/${s}/screenshot/upload`,c=t?.blockletLogo?`${r}/${t.blockletLogo}`:`${F.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,i=(t?.blockletScreenshots||[]).filter(Boolean).map(d=>`${l}/${d}`);return{logoUrl:c,screenshotUrls:i,uploadLogoPrefix:r,uploadScreenshotPrefix:l}},rn=t=>{const o=t.includes("youtube.com")||t.includes("youtu.be"),s=t.includes("vimeo.com");return o||s};function Vt({url:t,style:o={},controls:s=1,modestbranding:r=1}){const{t:l}=X(),c=t.includes("youtube.com")||t.includes("youtu.be"),i=t.includes("vimeo.com");if(c){const d=t.split("v=")[1]?.split("&")[0]||t.split("/").pop();return e.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:o?.pointerEvents||"auto"},children:e.jsx("iframe",{src:`https://www.youtube.com/embed/${d}?modestbranding=${r}&controls=${s}&rel=0`,title:"YouTube video player",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",...o},allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})})}if(i){const d=t.split("/").pop();return e.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:o.pointerEvents||"auto"},children:e.jsx("iframe",{src:`https://player.vimeo.com/video/${d}`,title:"Vimeo video player",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",...o},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0})})}return e.jsx(a,{style:{position:"relative",width:"100%",paddingTop:"56.25%"},children:e.jsxs(a,{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",backgroundColor:"rgba(0, 0, 0, 0.04)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",...o},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,children:[e.jsx(ae,{icon:"carbon:video-off",style:{fontSize:40,marginBottom:"10px",opacity:.5}}),e.jsx(A,{variant:"body1",sx:{opacity:.5},children:l("studio.videoDialogNoSrc")})]})})}Vt.propTypes={url:n.string.isRequired,style:n.object,controls:n.number,modestbranding:n.number};function os({setParams:t,onClose:o,params:s}){const{t:r}=X(),[l,c]=k.useState(""),i=l&&s.blockletVideos.includes(l),d=rn(l),u=()=>{t(x=>{const p=[...x.blockletVideos];return p.push(l),{...x,blockletVideos:p}}),o()};return e.jsxs(lt,{open:!0,fullWidth:!0,maxWidth:"sm",children:[e.jsx(Co,{children:r("studio.videoDialogTitle")}),e.jsxs(Ro,{children:[e.jsx(Ks,{fullWidth:!0,value:l,onChange:x=>c(x.target.value),placeholder:r("studio.videoInputLabel"),endAdornment:l?e.jsx(Xe,{position:"end",children:e.jsx(ce,{onClick:()=>c(""),children:e.jsx(Ys,{})})}):null,error:i}),i&&e.jsx(A,{variant:"body2",color:"error",children:r("studio.duplicateVideo")}),e.jsx(Vt,{url:l,style:{marginTop:"20px",borderRadius:"4px"}})]}),e.jsxs(So,{children:[e.jsx(J,{onClick:()=>o(),children:r("studio.cancel")}),e.jsx(J,{disabled:!d||i,onClick:u,children:r("studio.confirm")})]})]})}os.propTypes={onClose:n.func.isRequired,params:n.object.isRequired,setParams:n.func.isRequired};function Rt({errors:t,storeList:o,...s}){const{t:r}=X();return e.jsxs(a,{...s,sx:[{color:"warning.main",fontSize:"14px",border:"1px solid rgba(214, 164, 64, 0.34)",borderRadius:"4px",py:2,px:1.5,position:"relative"},...Array.isArray(s.sx)?s.sx:[s.sx]],children:[e.jsx(A,{variant:"caption",sx:{fontWeight:"bold",position:"absolute",top:-10,left:12,backgroundColor:"white",px:1,width:"fit-content"},children:r("blocklet.publish.storeRule.warning")}),t&&Object.entries(t).map(([l,c])=>{const i=Object.values(c),d=o.find(u=>u.url===l);return i.length>0&&e.jsxs(a,{children:[e.jsx(xe,{title:l,children:e.jsx(a,{component:"span",sx:{cursor:"pointer"},children:d.name})}),i.map(u=>e.jsx(a,{component:"li",sx:{ml:2,wordBreak:!0},children:u},u))]},l)})]})}Rt.propTypes={errors:n.object.isRequired,storeList:n.array.isRequired};const ao=k.lazy(()=>Wo(()=>import("./index-CiCryHDZ.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(t=>({default:t.Uploader})));function ss({projectId:t,readOnly:o,loading:s,blocklet:r,params:l,setParams:c,paramsErrTip:i,setParamsErrTip:d,warning:u,setLoading:x,initUrl:p=null,initLogoUrl:m,setInitLogoUrl:f,componentDid:b=""}){const{t:h,locale:j}=X(),{api:v}=ke(),g=Dt(),C=k.useRef(null),I=k.useRef(null),[R,y]=sn(r),[T,O]=k.useState(!1),N=zo({messageType:"connect-store-message",onOpen:()=>x(!0),onClose:()=>x(!1)}),z=async q=>{const Y=setTimeout(()=>{x(!1)},2e4),G=await Lr(v,q);x(!1),clearTimeout(Y),window.parent.postMessage({event:"studioDialog.connected",componentDid:b},"*"),g(window.location.pathname.replace(`${F.UNOWNED_DID}/create`,`${G}/create`),{replace:!0})},K=()=>{if(!l.blockletTitle){_.error(h("blocklet.publish.errorTip.noTitle"));return}if(!R?.url){_.error(h("blocklet.publish.noStoreSelected"));return}const q=Er();N(async(Y,G)=>{try{const se=await v.connectByStudio({input:{did:r?.meta?.did,blockletTitle:l?.blockletTitle,storeUrl:R.url,storeId:R.id,storeName:R.name,type:l?.blockletComponents?.length>0?"pack":"resource",componentDid:b,messageId:q,tenantScope:p?.searchParams.get("tenantScope")||""}});if(!se?.url){_.error("failed to connect to store");return}G(se.url),z({did:r?.meta?.did,projectId:"",messageId:q})}catch(se){const de=ge(se);_.error(de),x(!1)}})},{logoUrl:L,screenshotUrls:$,uploadLogoPrefix:w,uploadScreenshotPrefix:S}=ts(l,r,t),{logoErrors:Z,screenshotErrors:H,storeList:Q,hasLogoWarning:E,hasScreenshotWarning:D}=u,V=()=>o?!1:!t||t===F.UNOWNED_DID?(_.error(h("blocklet.publish.errorTip.noFirstDid")),!1):!0,U=q=>{if(!q.destination)return;const Y=Array.from(l.blockletScreenshots),[G]=Y.splice(q.source.index,1);Y.splice(q.destination.index,0,G),c(se=>({...se,blockletScreenshots:Y}))},ee=q=>{if(!q.destination)return;const Y=Array.from(l.blockletVideos),[G]=Y.splice(q.source.index,1);Y.splice(q.destination.index,0,G),c(se=>({...se,blockletVideos:Y}))};return e.jsxs(nn,{children:[e.jsx(a,{className:"section",sx:{display:"flex"},children:e.jsxs(a,{sx:{flex:1},children:[e.jsx(ne,{disabled:s||o,label:`Blocklet ${h("common.title")}`,placeholder:`Blocklet ${h("common.title")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:l.blockletTitle||"",onChange:q=>{d({blockletTitle:""}),c({blockletTitle:q.target.value})},error:!!i.blockletTitle,helperText:i.blockletTitle||"",slotProps:{input:{"data-cy":"blocklet-title",readOnly:o}}}),e.jsx(ne,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",error:!!i.projectId,helperText:i.projectId||"",value:t===F.UNOWNED_DID?"":`did:abt:${t}`,sx:{mt:3},slotProps:{input:{"data-cy":"export-blocklet-did",endAdornment:t===F.UNOWNED_DID&&e.jsx(Xe,{position:"end",children:e.jsx(es,{blocklet:r,store:R,componentDid:b,onChangeStore:y,disabled:!l.blockletTitle||o||s,loading:s,onClick:K})})}}}),e.jsx(ne,{disabled:s||o,label:`Blocklet ${h("common.description")}`,placeholder:`Blocklet ${h("common.description")}`,required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletDescription||"",onChange:q=>{d({blockletDescription:""}),c({blockletDescription:q.target.value.slice(0,159)})},error:!!i.blockletDescription,helperText:i.blockletDescription||"",sx:{mt:3},slotProps:{input:{"data-cy":"blocklet-description",readOnly:o}}}),e.jsx(ne,{disabled:s||o,label:`Blocklet ${h("common.homepageTip")}`,placeholder:`Blocklet ${h("common.homepageTip")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletHomepage||"",onChange:q=>{q.target.value&&!/^(http|https):\/\//.test(q.target.value)?d({blockletHomepage:h("blocklet.publish.errorTip.invalidUrl")}):d({blockletHomepage:""}),c({blockletHomepage:q.target.value})},error:!!i.blockletHomepage,helperText:i.blockletHomepage||"",sx:{mt:3},slotProps:{input:{"data-cy":"blocklet-homepage",readOnly:o}}}),e.jsx(ne,{disabled:s||o,label:`Blocklet ${h("common.community")}`,placeholder:`Blocklet ${h("common.community")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletCommunity||"",onChange:q=>{q.target.value&&!/^(http|https):\/\//.test(q.target.value)?d({blockletCommunity:h("blocklet.publish.errorTip.invalidUrl")}):d({blockletCommunity:""}),c({blockletCommunity:q.target.value})},error:!!i.blockletCommunity,helperText:i.blockletCommunity||"",sx:{mt:3},slotProps:{input:{"data-cy":"blocklet-community",readOnly:o}}}),e.jsx(ne,{disabled:s||o,label:`Blocklet ${h("common.support")}`,placeholder:`Blocklet ${h("common.support")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletSupport||"",onChange:q=>{q.target.value&&!/^(http|https):\/\//.test(q.target.value)&&!/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(q.target.value)?d({blockletSupport:h("blocklet.publish.errorTip.invalidUrlOrEmail")}):d({blockletSupport:""}),c({blockletSupport:q.target.value})},error:!!i.blockletSupport,helperText:i.blockletSupport||"",sx:{mt:3},slotProps:{input:{"data-cy":"blocklet-support",readOnly:o}}}),e.jsx(ne,{disabled:s||o,label:`Blocklet ${h("common.repository")}`,placeholder:`Blocklet ${h("common.repository")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletRepository||"",onChange:q=>{q.target.value&&!/^(git|https|svn)/.test(q.target.value)?d({blockletRepository:h("blocklet.publish.errorTip.invalidUrl")}):d({blockletRepository:""}),c({blockletRepository:q.target.value})},error:!!i.blockletRepository,helperText:i.blockletRepository||"",sx:{mt:3},slotProps:{input:{"data-cy":"blocklet-repository",readOnly:o}}})]})}),e.jsx(a,{className:"section full-width",sx:{display:"flex",mt:3},children:e.jsxs(a,{sx:{flex:1,overflow:"hidden"},children:[e.jsxs(a,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap"},children:[e.jsxs(Re,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(A,{variant:"subtitle1",sx:{fontWeight:"bold"},children:h("common.logo")}),e.jsxs(Re,{direction:"column",spacing:1,sx:{alignItems:"flex-start",opacity:.8,fontSize:"12px"},children:[e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.type"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"png, jpg, webp, svg"})]})}),e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.ratio"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"256x256"})]})}),e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.size"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"<500Kb"})]})})]})]}),e.jsx(a,{sx:{flex:1,cursor:o?"default":"pointer",display:"flex",alignItems:"flex-end"},children:e.jsx(Et,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:m||L,onClick:()=>{V()&&C.current?.open()}})})]}),E&&e.jsx(Rt,{errors:Z,storeList:Q,mt:3}),e.jsxs(a,{sx:{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap"},children:[e.jsxs(Re,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(A,{variant:"subtitle1",sx:{fontWeight:"bold"},children:h("common.screenshot")}),e.jsxs(Re,{direction:"column",spacing:1,sx:{alignItems:"flex-start",opacity:.8,fontSize:"12px"},children:[e.jsx(a,{sx:{border:"none"},variant:"outlined",size:"small",children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.ratio"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"16 / 9"})]})}),e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.count"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"1~5"})]})}),e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.size"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"<5MB"})]})}),!o&&e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.order"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:h("studio.orderTip")})]})})]})]}),e.jsx(Qt,{onDragEnd:o?void 0:U,children:e.jsx(eo,{droppableId:"screenshots",direction:"horizontal",isDropDisabled:o,children:(q,Y)=>e.jsxs(a,{ref:q.innerRef,...q.droppableProps,sx:{display:"flex",alignItems:"center",flex:1,flexWrap:"wrap",minHeight:160,background:Y.isDraggingOver?"grey.100":"transparent",transition:"background-color 0.2s ease",border:Y.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},children:[$.map((G,se)=>e.jsx(to,{draggableId:G,index:se,isDragDisabled:o,children:(de,le)=>e.jsxs(a,{ref:de.innerRef,...de.draggableProps,className:"screenshot",sx:{transform:le.isDragging?"scale(1.05)":"none",boxShadow:le.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx("img",{alt:"screenshot",src:G}),!o&&e.jsx(ce,{...de.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:e.jsx(Xt,{})}),!o&&e.jsx(ce,{className:"action",onClick:()=>{c(pe=>{const he=[...pe.blockletScreenshots];return he.splice(se,1),{...pe,blockletScreenshots:he}})},children:e.jsx(tt,{})})]})},G)),q.placeholder,$.length<5&&e.jsx(a,{onClick:()=>{V()&&I.current?.open()},sx:{display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,width:240,height:135,background:"#eee",cursor:o?"default":"pointer",color:"#999",mb:2},children:"+"})]})})})]}),D&&e.jsx(Rt,{errors:H,storeList:Q}),e.jsxs(a,{sx:{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap"},children:[e.jsxs(Re,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(A,{variant:"subtitle1",sx:{fontWeight:"bold"},children:h("studio.video")}),e.jsxs(Re,{direction:"column",spacing:1,sx:{alignItems:"flex-start",opacity:.8,fontSize:"12px"},children:[e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.videoType"),":"," "]}),e.jsxs(a,{component:"span",sx:{color:"secondary.main"},children:[e.jsx("a",{href:"https://www.youtube.com/",target:"_blank",rel:"noreferrer",children:"Youtube"}),","," ",e.jsx("a",{href:"https://vimeo.com/",target:"_blank",rel:"noreferrer",children:"Vimeo"})]})]})}),e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.count"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"1~3"})]})}),!o&&e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.order"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:h("studio.orderTip")})]})})]})]}),e.jsx(Qt,{onDragEnd:o?void 0:ee,children:e.jsx(eo,{droppableId:"videos",direction:"horizontal",isDropDisabled:o,children:(q,Y)=>e.jsxs(a,{ref:q.innerRef,...q.droppableProps,sx:{display:"flex",alignItems:"center",flex:1,flexWrap:"wrap",minHeight:160,background:Y.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:Y.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},children:[l.blockletVideos.map((G,se)=>e.jsx(to,{draggableId:G,index:se,isDragDisabled:o,children:(de,le)=>e.jsxs(a,{ref:de.innerRef,...de.draggableProps,className:"screenshot",sx:{transform:le.isDragging?"scale(1.05)":"none",boxShadow:le.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx(Vt,{url:G,style:{pointerEvents:le.isDragging?"none":"auto"}}),!o&&e.jsx(ce,{...de.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:e.jsx(Xt,{})}),!o&&e.jsx(ce,{className:"action",onClick:()=>{c(pe=>{const he=[...pe.blockletVideos];return he.splice(se,1),{...pe,blockletVideos:he}})},children:e.jsx(tt,{})})]})},G)),q.placeholder,l.blockletVideos.length<3&&e.jsx(a,{onClick:()=>{V()&&O(!0)},sx:{display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,width:240,height:135,background:"#eee",cursor:o?"default":"pointer",color:"#999",mb:2},children:"+"})]})})})]})]})}),e.jsxs(k.Suspense,{fallback:e.jsx(Je,{}),children:[e.jsx(ao,{ref:C,locale:j,popup:!0,onUploadFinish:q=>{c({blockletLogo:q.data.filename}),f(""),C.current?.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:w,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/png","image/jpeg","image/webp","image/svg+xml"],maxFileSize:1024*1024*.5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{minWidth:256,minHeight:256}}}},"uploader-logo"),T&&e.jsx(os,{onClose:()=>O(!1),params:l,setParams:c}),e.jsx(ao,{ref:I,locale:j,popup:!0,onUploadFinish:q=>{c(Y=>{const G=Y.blockletScreenshots||[];return G.push(q.data?.filename),{...Y,blockletScreenshots:G}}),I.current?.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:S,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","image/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-$.length}},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,autoCropArea:1,aspectRatio:16/9,initialAspectRatio:16/9,croppedCanvasOptions:{minWidth:1280,minHeight:720,maxWidth:1280*2,maxHeight:720*2}}}},"uploader-screenshot")]})]})}ss.propTypes={projectId:n.string.isRequired,readOnly:n.bool.isRequired,params:n.object.isRequired,setParams:n.func.isRequired,paramsErrTip:n.object.isRequired,setParamsErrTip:n.func.isRequired,warning:n.object.isRequired,loading:n.bool.isRequired,blocklet:n.object.isRequired,setLoading:n.func.isRequired,initUrl:n.object,componentDid:n.string,initLogoUrl:n.string.isRequired,setInitLogoUrl:n.func.isRequired};const nn=ve.div`
145
+ `,co="lastWantToConnectStoreId";function sn(t){const[o,s]=k.useState(null),{session:r}=ze(),l=k.useCallback(d=>{s(d),localStorage.setItem(co,d?.id)},[s]),c=k.useMemo(()=>{const d=localStorage.getItem(co),u=d?(t?.settings?.storeList||[]).find(p=>p.id===d):null;if(u)return u;let x=(t?.settings?.storeList||[]).find(p=>!(p.id!==F.BLOCKLET_STORE.id||p.scope&&p.scope!=="studio"&&p.scope!==r?.user?.did));return x||(x=t?.settings?.storeList?.[0]),x},[t?.settings?.storeList,r?.user?.did]);return[o||c||{},l]}const Bt=({fromBlocklet:t,nodeInfo:o,blocklet:s,userDid:r})=>{const l=t?s?.meta?.did:o?.did;let c=t?s?.settings?.storeList||[]:o?.blockletRegistryList||[];return Array.isArray(c)||(c=[]),c=c.filter(i=>i.protected||wr(i.scope)||i.scope==="studio"||i.scope===r),{teamDid:l,storeList:c}};function es({blocklet:t=null,store:o=null,onChangeStore:s,onClick:r,disabled:l,loading:c,componentDid:i}){const{t:d}=X(),{session:u}=ze(),{api:x,info:p,inService:m}=ke(),f=Ie(),[b,h]=k.useState(!1),j=k.useRef(null),[v,g]=k.useState(!1),[C,I]=k.useState(null),R=$=>{s($),h(!1)},y=()=>{h(!b)},T=$=>{j.current&&j.current.contains($.target)||h(!1)},O=()=>{g(!0)},N=()=>{g(!1)},z=async()=>{if(C)try{await x.deleteBlockletStore({input:{teamDid:t.meta.did,url:C.url,projectId:"",scope:C.scope||"studio"}}),await f?.actions?.refreshBlocklet()}catch($){_.error(`Remove Blocklet Store Error: ${ge($)}`)}finally{I(null)}},{storeList:K}=Bt({fromBlocklet:m,blocklet:t,nodeInfo:p,userDid:u?.user?.did}),L=t?.meta?.did;return e.jsxs(e.Fragment,{children:[e.jsxs(et,{disabled:l,ref:j,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[e.jsxs(J,{onClick:r,children:[c&&e.jsx(Se,{size:14,sx:{mr:.5}}),`${d("common.connect")} ${o.name||""}`]}),e.jsx(J,{size:"small","aria-controls":b?"split-button-menu":void 0,"aria-expanded":b?"true":void 0,"aria-label":"select merge strategy","aria-haspopup":"menu",onClick:y,children:e.jsx(Xs,{})})]}),e.jsx(jo,{sx:{zIndex:10},open:b,anchorEl:j.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:$})=>e.jsx(yo,{...$,style:{transformOrigin:"center top"},children:e.jsx(Pt,{children:e.jsx(wo,{onClickAway:T,children:e.jsxs(vo,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[K?.map(w=>e.jsxs(be,{selected:w.id===o?.id,sx:{height:56},onClick:()=>R(w),children:[e.jsxs(a,{children:[e.jsx(Te,{sx:{fontSize:"16px"},maxLength:24,children:w.name}),e.jsx(Te,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:w.url})]}),Ar({store:w,userDid:u?.user?.did})&&e.jsx(ce,{sx:{ml:1},onClick:S=>{S.preventDefault(),S.stopPropagation(),I(w)},children:e.jsx(ae,{icon:"ic:outline-delete"})})]},w.url)),e.jsx(Js,{}),e.jsxs(be,{onClick:O,children:[e.jsx(nt,{font:!0}),e.jsx(A,{variant:"inherit",children:d("store.blockletRegistry.addRegistry")})]})]})})})})}),v&&e.jsx(Bo,{hiddenChildren:!0,open:!0,onClose:N,teamDid:L,storeList:K,scope:"studio",onAdd:f?.actions?.refreshBlocklet}),C&&e.jsx(at,{displayError:!0,title:`${d("common.delete")} ${C.name}`,description:d("blocklet.publish.deleteStoreTip",{name:C.name}),confirm:d("common.confirm"),onConfirm:z,onCancel:()=>I(null)})]})}es.propTypes={store:n.object,blocklet:n.object,onChangeStore:n.func.isRequired,onClick:n.func.isRequired,loading:n.bool.isRequired,disabled:n.bool.isRequired,componentDid:n.string.isRequired,projectType:n.string.isRequired,getData:n.func.isRequired};const ts=(t,o,s)=>{const r=`${F.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${o.meta.did}/${s}/logo/upload`,l=`${F.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${o.meta.did}/${s}/screenshot/upload`,c=t?.blockletLogo?`${r}/${t.blockletLogo}`:`${F.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,i=(t?.blockletScreenshots||[]).filter(Boolean).map(d=>`${l}/${d}`);return{logoUrl:c,screenshotUrls:i,uploadLogoPrefix:r,uploadScreenshotPrefix:l}},rn=t=>{const o=t.includes("youtube.com")||t.includes("youtu.be"),s=t.includes("vimeo.com");return o||s};function Vt({url:t,style:o={},controls:s=1,modestbranding:r=1}){const{t:l}=X(),c=t.includes("youtube.com")||t.includes("youtu.be"),i=t.includes("vimeo.com");if(c){const d=t.split("v=")[1]?.split("&")[0]||t.split("/").pop();return e.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:o?.pointerEvents||"auto"},children:e.jsx("iframe",{src:`https://www.youtube.com/embed/${d}?modestbranding=${r}&controls=${s}&rel=0`,title:"YouTube video player",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",...o},allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})})}if(i){const d=t.split("/").pop();return e.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:o.pointerEvents||"auto"},children:e.jsx("iframe",{src:`https://player.vimeo.com/video/${d}`,title:"Vimeo video player",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",...o},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0})})}return e.jsx(a,{style:{position:"relative",width:"100%",paddingTop:"56.25%"},children:e.jsxs(a,{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",backgroundColor:"rgba(0, 0, 0, 0.04)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",...o},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,children:[e.jsx(ae,{icon:"carbon:video-off",style:{fontSize:40,marginBottom:"10px",opacity:.5}}),e.jsx(A,{variant:"body1",sx:{opacity:.5},children:l("studio.videoDialogNoSrc")})]})})}Vt.propTypes={url:n.string.isRequired,style:n.object,controls:n.number,modestbranding:n.number};function os({setParams:t,onClose:o,params:s}){const{t:r}=X(),[l,c]=k.useState(""),i=l&&s.blockletVideos.includes(l),d=rn(l),u=()=>{t(x=>{const p=[...x.blockletVideos];return p.push(l),{...x,blockletVideos:p}}),o()};return e.jsxs(lt,{open:!0,fullWidth:!0,maxWidth:"sm",children:[e.jsx(Co,{children:r("studio.videoDialogTitle")}),e.jsxs(Ro,{children:[e.jsx(Ks,{fullWidth:!0,value:l,onChange:x=>c(x.target.value),placeholder:r("studio.videoInputLabel"),endAdornment:l?e.jsx(Xe,{position:"end",children:e.jsx(ce,{onClick:()=>c(""),children:e.jsx(Ys,{})})}):null,error:i}),i&&e.jsx(A,{variant:"body2",color:"error",children:r("studio.duplicateVideo")}),e.jsx(Vt,{url:l,style:{marginTop:"20px",borderRadius:"4px"}})]}),e.jsxs(So,{children:[e.jsx(J,{onClick:()=>o(),children:r("studio.cancel")}),e.jsx(J,{disabled:!d||i,onClick:u,children:r("studio.confirm")})]})]})}os.propTypes={onClose:n.func.isRequired,params:n.object.isRequired,setParams:n.func.isRequired};function Rt({errors:t,storeList:o,...s}){const{t:r}=X();return e.jsxs(a,{...s,sx:[{color:"warning.main",fontSize:"14px",border:"1px solid rgba(214, 164, 64, 0.34)",borderRadius:"4px",py:2,px:1.5,position:"relative"},...Array.isArray(s.sx)?s.sx:[s.sx]],children:[e.jsx(A,{variant:"caption",sx:{fontWeight:"bold",position:"absolute",top:-10,left:12,backgroundColor:"white",px:1,width:"fit-content"},children:r("blocklet.publish.storeRule.warning")}),t&&Object.entries(t).map(([l,c])=>{const i=Object.values(c),d=o.find(u=>u.url===l);return i.length>0&&e.jsxs(a,{children:[e.jsx(xe,{title:l,children:e.jsx(a,{component:"span",sx:{cursor:"pointer"},children:d.name})}),i.map(u=>e.jsx(a,{component:"li",sx:{ml:2,wordBreak:!0},children:u},u))]},l)})]})}Rt.propTypes={errors:n.object.isRequired,storeList:n.array.isRequired};const ao=k.lazy(()=>Wo(()=>import("./index-DqcciDRh.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(t=>({default:t.Uploader})));function ss({projectId:t,readOnly:o,loading:s,blocklet:r,params:l,setParams:c,paramsErrTip:i,setParamsErrTip:d,warning:u,setLoading:x,initUrl:p=null,initLogoUrl:m,setInitLogoUrl:f,componentDid:b=""}){const{t:h,locale:j}=X(),{api:v}=ke(),g=Dt(),C=k.useRef(null),I=k.useRef(null),[R,y]=sn(r),[T,O]=k.useState(!1),N=zo({messageType:"connect-store-message",onOpen:()=>x(!0),onClose:()=>x(!1)}),z=async q=>{const Y=setTimeout(()=>{x(!1)},2e4),G=await Lr(v,q);x(!1),clearTimeout(Y),window.parent.postMessage({event:"studioDialog.connected",componentDid:b},"*"),g(window.location.pathname.replace(`${F.UNOWNED_DID}/create`,`${G}/create`),{replace:!0})},K=()=>{if(!l.blockletTitle){_.error(h("blocklet.publish.errorTip.noTitle"));return}if(!R?.url){_.error(h("blocklet.publish.noStoreSelected"));return}const q=Er();N(async(Y,G)=>{try{const se=await v.connectByStudio({input:{did:r?.meta?.did,blockletTitle:l?.blockletTitle,storeUrl:R.url,storeId:R.id,storeName:R.name,type:l?.blockletComponents?.length>0?"pack":"resource",componentDid:b,messageId:q,tenantScope:p?.searchParams.get("tenantScope")||""}});if(!se?.url){_.error("failed to connect to store");return}G(se.url),z({did:r?.meta?.did,projectId:"",messageId:q})}catch(se){const de=ge(se);_.error(de),x(!1)}})},{logoUrl:L,screenshotUrls:$,uploadLogoPrefix:w,uploadScreenshotPrefix:S}=ts(l,r,t),{logoErrors:Z,screenshotErrors:H,storeList:Q,hasLogoWarning:E,hasScreenshotWarning:D}=u,V=()=>o?!1:!t||t===F.UNOWNED_DID?(_.error(h("blocklet.publish.errorTip.noFirstDid")),!1):!0,U=q=>{if(!q.destination)return;const Y=Array.from(l.blockletScreenshots),[G]=Y.splice(q.source.index,1);Y.splice(q.destination.index,0,G),c(se=>({...se,blockletScreenshots:Y}))},ee=q=>{if(!q.destination)return;const Y=Array.from(l.blockletVideos),[G]=Y.splice(q.source.index,1);Y.splice(q.destination.index,0,G),c(se=>({...se,blockletVideos:Y}))};return e.jsxs(nn,{children:[e.jsx(a,{className:"section",sx:{display:"flex"},children:e.jsxs(a,{sx:{flex:1},children:[e.jsx(ne,{disabled:s||o,label:`Blocklet ${h("common.title")}`,placeholder:`Blocklet ${h("common.title")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:l.blockletTitle||"",onChange:q=>{d({blockletTitle:""}),c({blockletTitle:q.target.value})},error:!!i.blockletTitle,helperText:i.blockletTitle||"",slotProps:{input:{"data-cy":"blocklet-title",readOnly:o}}}),e.jsx(ne,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",error:!!i.projectId,helperText:i.projectId||"",value:t===F.UNOWNED_DID?"":`did:abt:${t}`,sx:{mt:3},slotProps:{input:{"data-cy":"export-blocklet-did",endAdornment:t===F.UNOWNED_DID&&e.jsx(Xe,{position:"end",children:e.jsx(es,{blocklet:r,store:R,componentDid:b,onChangeStore:y,disabled:!l.blockletTitle||o||s,loading:s,onClick:K})})}}}),e.jsx(ne,{disabled:s||o,label:`Blocklet ${h("common.description")}`,placeholder:`Blocklet ${h("common.description")}`,required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletDescription||"",onChange:q=>{d({blockletDescription:""}),c({blockletDescription:q.target.value.slice(0,159)})},error:!!i.blockletDescription,helperText:i.blockletDescription||"",sx:{mt:3},slotProps:{input:{"data-cy":"blocklet-description",readOnly:o}}}),e.jsx(ne,{disabled:s||o,label:`Blocklet ${h("common.homepageTip")}`,placeholder:`Blocklet ${h("common.homepageTip")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletHomepage||"",onChange:q=>{q.target.value&&!/^(http|https):\/\//.test(q.target.value)?d({blockletHomepage:h("blocklet.publish.errorTip.invalidUrl")}):d({blockletHomepage:""}),c({blockletHomepage:q.target.value})},error:!!i.blockletHomepage,helperText:i.blockletHomepage||"",sx:{mt:3},slotProps:{input:{"data-cy":"blocklet-homepage",readOnly:o}}}),e.jsx(ne,{disabled:s||o,label:`Blocklet ${h("common.community")}`,placeholder:`Blocklet ${h("common.community")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletCommunity||"",onChange:q=>{q.target.value&&!/^(http|https):\/\//.test(q.target.value)?d({blockletCommunity:h("blocklet.publish.errorTip.invalidUrl")}):d({blockletCommunity:""}),c({blockletCommunity:q.target.value})},error:!!i.blockletCommunity,helperText:i.blockletCommunity||"",sx:{mt:3},slotProps:{input:{"data-cy":"blocklet-community",readOnly:o}}}),e.jsx(ne,{disabled:s||o,label:`Blocklet ${h("common.support")}`,placeholder:`Blocklet ${h("common.support")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletSupport||"",onChange:q=>{q.target.value&&!/^(http|https):\/\//.test(q.target.value)&&!/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(q.target.value)?d({blockletSupport:h("blocklet.publish.errorTip.invalidUrlOrEmail")}):d({blockletSupport:""}),c({blockletSupport:q.target.value})},error:!!i.blockletSupport,helperText:i.blockletSupport||"",sx:{mt:3},slotProps:{input:{"data-cy":"blocklet-support",readOnly:o}}}),e.jsx(ne,{disabled:s||o,label:`Blocklet ${h("common.repository")}`,placeholder:`Blocklet ${h("common.repository")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletRepository||"",onChange:q=>{q.target.value&&!/^(git|https|svn)/.test(q.target.value)?d({blockletRepository:h("blocklet.publish.errorTip.invalidUrl")}):d({blockletRepository:""}),c({blockletRepository:q.target.value})},error:!!i.blockletRepository,helperText:i.blockletRepository||"",sx:{mt:3},slotProps:{input:{"data-cy":"blocklet-repository",readOnly:o}}})]})}),e.jsx(a,{className:"section full-width",sx:{display:"flex",mt:3},children:e.jsxs(a,{sx:{flex:1,overflow:"hidden"},children:[e.jsxs(a,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap"},children:[e.jsxs(Re,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(A,{variant:"subtitle1",sx:{fontWeight:"bold"},children:h("common.logo")}),e.jsxs(Re,{direction:"column",spacing:1,sx:{alignItems:"flex-start",opacity:.8,fontSize:"12px"},children:[e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.type"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"png, jpg, webp, svg"})]})}),e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.ratio"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"256x256"})]})}),e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.size"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"<500Kb"})]})})]})]}),e.jsx(a,{sx:{flex:1,cursor:o?"default":"pointer",display:"flex",alignItems:"flex-end"},children:e.jsx(Et,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:m||L,onClick:()=>{V()&&C.current?.open()}})})]}),E&&e.jsx(Rt,{errors:Z,storeList:Q,mt:3}),e.jsxs(a,{sx:{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap"},children:[e.jsxs(Re,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(A,{variant:"subtitle1",sx:{fontWeight:"bold"},children:h("common.screenshot")}),e.jsxs(Re,{direction:"column",spacing:1,sx:{alignItems:"flex-start",opacity:.8,fontSize:"12px"},children:[e.jsx(a,{sx:{border:"none"},variant:"outlined",size:"small",children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.ratio"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"16 / 9"})]})}),e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.count"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"1~5"})]})}),e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.size"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"<5MB"})]})}),!o&&e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.order"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:h("studio.orderTip")})]})})]})]}),e.jsx(Qt,{onDragEnd:o?void 0:U,children:e.jsx(eo,{droppableId:"screenshots",direction:"horizontal",isDropDisabled:o,children:(q,Y)=>e.jsxs(a,{ref:q.innerRef,...q.droppableProps,sx:{display:"flex",alignItems:"center",flex:1,flexWrap:"wrap",minHeight:160,background:Y.isDraggingOver?"grey.100":"transparent",transition:"background-color 0.2s ease",border:Y.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},children:[$.map((G,se)=>e.jsx(to,{draggableId:G,index:se,isDragDisabled:o,children:(de,le)=>e.jsxs(a,{ref:de.innerRef,...de.draggableProps,className:"screenshot",sx:{transform:le.isDragging?"scale(1.05)":"none",boxShadow:le.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx("img",{alt:"screenshot",src:G}),!o&&e.jsx(ce,{...de.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:e.jsx(Xt,{})}),!o&&e.jsx(ce,{className:"action",onClick:()=>{c(pe=>{const he=[...pe.blockletScreenshots];return he.splice(se,1),{...pe,blockletScreenshots:he}})},children:e.jsx(tt,{})})]})},G)),q.placeholder,$.length<5&&e.jsx(a,{onClick:()=>{V()&&I.current?.open()},sx:{display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,width:240,height:135,background:"#eee",cursor:o?"default":"pointer",color:"#999",mb:2},children:"+"})]})})})]}),D&&e.jsx(Rt,{errors:H,storeList:Q}),e.jsxs(a,{sx:{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap"},children:[e.jsxs(Re,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(A,{variant:"subtitle1",sx:{fontWeight:"bold"},children:h("studio.video")}),e.jsxs(Re,{direction:"column",spacing:1,sx:{alignItems:"flex-start",opacity:.8,fontSize:"12px"},children:[e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.videoType"),":"," "]}),e.jsxs(a,{component:"span",sx:{color:"secondary.main"},children:[e.jsx("a",{href:"https://www.youtube.com/",target:"_blank",rel:"noreferrer",children:"Youtube"}),","," ",e.jsx("a",{href:"https://vimeo.com/",target:"_blank",rel:"noreferrer",children:"Vimeo"})]})]})}),e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.count"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"1~3"})]})}),!o&&e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.order"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:h("studio.orderTip")})]})})]})]}),e.jsx(Qt,{onDragEnd:o?void 0:ee,children:e.jsx(eo,{droppableId:"videos",direction:"horizontal",isDropDisabled:o,children:(q,Y)=>e.jsxs(a,{ref:q.innerRef,...q.droppableProps,sx:{display:"flex",alignItems:"center",flex:1,flexWrap:"wrap",minHeight:160,background:Y.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:Y.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},children:[l.blockletVideos.map((G,se)=>e.jsx(to,{draggableId:G,index:se,isDragDisabled:o,children:(de,le)=>e.jsxs(a,{ref:de.innerRef,...de.draggableProps,className:"screenshot",sx:{transform:le.isDragging?"scale(1.05)":"none",boxShadow:le.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx(Vt,{url:G,style:{pointerEvents:le.isDragging?"none":"auto"}}),!o&&e.jsx(ce,{...de.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:e.jsx(Xt,{})}),!o&&e.jsx(ce,{className:"action",onClick:()=>{c(pe=>{const he=[...pe.blockletVideos];return he.splice(se,1),{...pe,blockletVideos:he}})},children:e.jsx(tt,{})})]})},G)),q.placeholder,l.blockletVideos.length<3&&e.jsx(a,{onClick:()=>{V()&&O(!0)},sx:{display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,width:240,height:135,background:"#eee",cursor:o?"default":"pointer",color:"#999",mb:2},children:"+"})]})})})]})]})}),e.jsxs(k.Suspense,{fallback:e.jsx(Je,{}),children:[e.jsx(ao,{ref:C,locale:j,popup:!0,onUploadFinish:q=>{c({blockletLogo:q.data.filename}),f(""),C.current?.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:w,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/png","image/jpeg","image/webp","image/svg+xml"],maxFileSize:1024*1024*.5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{minWidth:256,minHeight:256}}}},"uploader-logo"),T&&e.jsx(os,{onClose:()=>O(!1),params:l,setParams:c}),e.jsx(ao,{ref:I,locale:j,popup:!0,onUploadFinish:q=>{c(Y=>{const G=Y.blockletScreenshots||[];return G.push(q.data?.filename),{...Y,blockletScreenshots:G}}),I.current?.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:S,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","image/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-$.length}},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,autoCropArea:1,aspectRatio:16/9,initialAspectRatio:16/9,croppedCanvasOptions:{minWidth:1280,minHeight:720,maxWidth:1280*2,maxHeight:720*2}}}},"uploader-screenshot")]})]})}ss.propTypes={projectId:n.string.isRequired,readOnly:n.bool.isRequired,params:n.object.isRequired,setParams:n.func.isRequired,paramsErrTip:n.object.isRequired,setParamsErrTip:n.func.isRequired,warning:n.object.isRequired,loading:n.bool.isRequired,blocklet:n.object.isRequired,setLoading:n.func.isRequired,initUrl:n.object,componentDid:n.string,initLogoUrl:n.string.isRequired,setInitLogoUrl:n.func.isRequired};const nn=ve.div`
146
146
  margin-top: 24px;
147
147
  .screenshot {
148
148
  margin-bottom: 16px;
@@ -190,7 +190,7 @@ import{r as k,u as Dt,m as rt,L as we,g as As,i as qs,k as Ns,l as bt}from"./ven
190
190
  padding-bottom: 12px;
191
191
  border-bottom: ${({theme:t})=>`1px solid ${t.palette.divider}`};
192
192
  }
193
- `;function bs({text:t}){const{palette:o}=Eo();return t?e.jsx(_r,{style:{backgroundColor:o.background.default,color:o.text.primary},wrapperElement:{"data-color-mode":"light"},source:Or.sanitize(t),rehypePlugins:[[zr,{target:"_blank"}]]}):e.jsx(Ge,{Icon:Wt})}bs.propTypes={text:n.string.isRequired};function fs({params:t,setParams:o,paramsErrTip:s,loading:r,setParamsErrTip:l,readOnly:c}){const{t:i}=X(),[d,u]=k.useState(c?"preview":"write"),x=(p,m)=>{u(m)};return e.jsxs(a,{sx:{border:"1px solid transparent",borderRadius:2},children:[e.jsxs(a,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[e.jsx(A,{variant:"h6",sx:{fontWeight:"bold"},children:i("common.introduction")}),e.jsxs(Po,{value:d,onChange:x,"aria-label":"wrapped label tabs example",children:[e.jsx(ot,{value:"write",label:"Write"}),e.jsx(ot,{value:"preview",label:"Preview"})]})]}),e.jsx(a,{sx:{display:d==="write"?"block":"none",width:"100%",marginTop:3},children:e.jsx(ne,{disabled:r||c,sx:{border:"none"},placeholder:`Blocklet ${i("common.introduction")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:t.blockletIntroduction||"",onChange:p=>{l({blockletIntroduction:""}),o({blockletIntroduction:p.target.value.slice(0,me.PROJECT.MAX_INTRO_LENGTH)})},error:!!s.blockletIntroduction,helperText:s.blockletIntroduction||"",slotProps:{input:{"data-cy":"export-blocklet-introduction",readOnly:c,endAdornment:e.jsxs(Xe,{position:"end",children:[t?.blockletIntroduction?.length||0," / ",me.PROJECT.MAX_INTRO_LENGTH]})}}})}),e.jsx(a,{sx:{display:d==="preview"?"block":"none",mt:3},children:e.jsx(bs,{text:t.blockletIntroduction||""})})]})}fs.propTypes={params:n.object.isRequired,setParams:n.func.isRequired,paramsErrTip:n.object.isRequired,setParamsErrTip:n.func.isRequired,readOnly:n.bool.isRequired,loading:n.bool.isRequired};function xs({step:t=0,ok:o=!1,active:s=0,error:r="",warning:l=!1}){let c="grey.500",i=t+1;return o&&(i=e.jsx(Lo,{sx:{fontSize:18,margin:0},color:"white"})),r||!o&&s>t?(c="error.main",i=e.jsx(Jt,{sx:{fontSize:18,margin:0},color:"white"})):l?(c="warning.main",i=e.jsx(Jt,{sx:{fontSize:18,margin:0},color:"white"})):s>=t&&(c="primary.main"),e.jsx(a,{sx:{width:24,height:24,bgcolor:c,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center"},children:i})}xs.propTypes={step:n.number,ok:n.bool,active:n.number,error:n.string,warning:n.bool};function gs({steps:t,activeStep:o,setActiveStep:s,hasSelectedResources:r=!1,params:l,loading:c,paramsErrTip:i,warning:d,viewMode:u="",projectId:x}){const{t:p}=X(),m=()=>{s(j=>j+1)},f=()=>{s(j=>j-1)},b=j=>j===0?i?.blockletTitle||i?.projectId||i?.blockletDescription||i?.blockletHomepage||i?.blockletSupport||i?.blockletCommunity||i?.blockletRepository:j===2?i?.blockletResource||i?.blockletDocker||i?.dockerImageName:j>=4?i?.blockletVersion||i?.note:"",h=u||rs({params:l,projectId:x,t:p})===null;return e.jsxs(a,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[e.jsx(lr,{activeStep:o,orientation:"vertical",children:t.map((j,v)=>{const g={},C=c||!un({params:l,projectId:x,step:v,t:p}),I=c?"":b(v);return I&&(g.optional=e.jsx(A,{variant:"caption",color:"error",sx:{wordBreak:"break-word"},children:I}),g.error=!0),e.jsxs(ir,{children:[e.jsx(cr,{icon:e.jsx(xs,{error:I,warning:v===0?d.hasWarning:!1,active:h?99:o,step:v,ok:C}),sx:{cursor:"pointer",color:I?"error.main":"inherit"},disabled:!1,onClick:()=>s(v),...g,children:e.jsx(A,{fontSize:"14px",fontWeight:"500",color:I||!C&&o>v?"error.main":"inherit",children:j.label})}),e.jsxs(ar,{children:[e.jsx(A,{fontSize:12,children:j.description}),!h&&e.jsx(a,{sx:{mb:2},children:e.jsxs("div",{children:[v<t.length-1&&e.jsx(J,{variant:"contained",onClick:m,sx:{mt:1,mr:1},disabled:I||!C,children:p("common.continue")}),v>0&&e.jsx(J,{disabled:v===0,onClick:f,sx:{mt:1,mr:1},children:p("common.back")})]})})]})]},j.label)})}),o>=t.length-1&&e.jsx(Pt,{square:!0,elevation:0,sx:{p:3},children:e.jsx(A,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}gs.propTypes={steps:n.array.isRequired,activeStep:n.number.isRequired,setActiveStep:n.func.isRequired,params:n.object.isRequired,viewMode:n.oneOfType([n.string,n.bool]),loading:n.bool.isRequired,projectId:n.string.isRequired,hasSelectedResources:n.oneOfType([n.string,n.bool]),warning:n.object.isRequired,paramsErrTip:n.shape({projectId:n.string,blockletVersion:n.string,blockletTitle:n.string,blockletDescription:n.string,note:n.string,blockletResource:n.string,blockletHomepage:n.string,blockletSupport:n.string,blockletCommunity:n.string,blockletRepository:n.string,blockletDocker:n.object,dockerImageName:n.string}).isRequired};const hn=[".zip",".gz"],mn=1024*1024*100,bn=k.lazy(()=>Wo(()=>import("./index-CiCryHDZ.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(t=>({default:t.Uploader})));function ks({app:t,projectId:o,readOnly:s,params:r,setParams:l,setParamsErrTip:c,error:i}){const{t:d,locale:u}=X(),x=k.useRef(null),p=()=>s?!1:!o||o===F.UNOWNED_DID?(_.error(d("blocklet.publish.errorTip.noFirstDid")),!1):!0,m=`${F.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${t.meta.did}/${o}/resource/upload`;return e.jsxs(a,{sx:{mt:3},children:[e.jsx(A,{gutterBottom:!0,children:d("blocklet.publish.resourceUpload")}),e.jsxs(Re,{direction:"row",spacing:1,sx:{alignItems:"center",flex:1,cursor:s?"default":"pointer"},children:[!!r.uploadedResource&&e.jsx(A,{component:"a",href:`${m}/params.uploadedResource`,children:r.uploadedResource}),!s&&e.jsx(J,{variant:"outlined",size:"small",onClick:()=>{p()&&x.current?.open()},children:r.uploadedResource?d("common.change"):d("common.upload")})]}),e.jsx(k.Suspense,{fallback:e.jsx(Je,{}),children:e.jsx(bn,{ref:x,locale:u,popup:!0,onUploadFinish:f=>{l({uploadedResource:f.data.filename}),c({blockletResource:""}),x.current?.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:m,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileExts:hn,maxFileSize:mn,maxNumberOfFiles:1}}},"uploader-resource")}),!!i&&e.jsx(a,{sx:{color:"error.main",mt:1,fontSize:14},children:i})]})}ks.propTypes={app:n.object.isRequired,projectId:n.string.isRequired,readOnly:n.bool.isRequired,params:n.object.isRequired,setParams:n.func.isRequired,error:n.string.isRequired,setParamsErrTip:n.func.isRequired};function Tt({readOnly:t,params:o,setParams:s,paramsErrTip:r,setParamsErrTip:l,loading:c}){const{t:i}=X();return e.jsx(a,{className:"section",sx:{display:"flex",mt:3},children:e.jsxs(a,{sx:{flex:1},children:[e.jsx(ne,{required:!0,disabled:c||t,label:`Blocklet ${i("common.version")}`,placeholder:`Blocklet ${i("common.version")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,value:o.blockletVersion||"",onChange:d=>{l({blockletVersion:""}),s({blockletVersion:d.target.value})},error:!!r.blockletVersion,helperText:r.blockletVersion||"",slotProps:{input:{"data-cy":"blocklet-version",readOnly:t}}}),e.jsx(ne,{label:i("blocklet.publish.releaseNote"),autoComplete:"off",disabled:c||t,variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,required:!0,value:o.note||"",onChange:d=>{l({note:""}),s({note:d.target.value.slice(0,me.PROJECT.MAX_NOTE_LENGTH)})},error:!!r.note,helperText:r.note||"",sx:{mt:3},slotProps:{input:{"data-cy":"release-note",readOnly:t,endAdornment:e.jsxs(Xe,{position:"end",children:[o?.note?.length||0," / ",me.PROJECT.MAX_NOTE_LENGTH]})}}})]})})}Tt.propTypes={readOnly:n.bool.isRequired,params:n.object.isRequired,setParams:n.func.isRequired,paramsErrTip:n.object.isRequired,setParamsErrTip:n.func.isRequired,loading:n.bool.isRequired};function js(t){for(const o in t)typeof t[o]=="string"?t[o]=t[o].replace(/\\\\/g,"\\"):typeof t[o]=="object"&&t[o]!==null&&js(t[o]);return t}const fn={"-a":"--attach","-d":"--detach","-e":"--env","-h":"--hostname","-i":"--interactive","-it":"-it","-rm":"-rm","-m":"--memory","-p":"--publish","-P":"--publish-all","-l":"--label","-n":"--name","-q":"--quiet","-x":"--x-registry","-t":"--tty","-u":"--user","-v":"--volume","-w":"--workdir","-cgroupns":"--cgroupns","-cpus":"--cpus","-g":"--gpus","-ip6":"--ip6","--read-only":"--read-only","--add-host":"--add-host","--attach":"--attach","--blkio-weight":"--blkio-weight","--blkio-weight-device":"--blkio-weight-device","--cap-add":"--cap-add","--cap-drop":"--cap-drop","--cgroup-parent":"--cgroup-parent","--cidfile":"--cidfile","--cpu-period":"--cpu-period","--cpu-quota":"--cpu-quota","--cpu-rt-period":"--cpu-rt-period","--cpu-rt-runtime":"--cpu-rt-runtime","--cpu-shares":"--cpu-shares","--cpus":"--cpus","--cpuset-cpus":"--cpuset-cpus","--cpuset-mems":"--cpuset-mems","--detach":"--detach","--detach-keys":"--detach-keys","--device":"--device","--device-cgroup-rule":"--device-cgroup-rule","--device-read-bps":"--device-read-bps","--device-read-iops":"--device-read-iops","--device-write-bps":"--device-write-bps","--device-write-iops":"--device-write-iops","--disable-content-trust":"--disable-content-trust","--dns":"--dns","--dns-opt":"--dns-opt","--dns-search":"--dns-search","--domainname":"--domainname","--entrypoint":"--entrypoint","--env":"--env","--env-file":"--env-file","--expose":"--expose","--gpus":"--gpus","--group-add":"--group-add","--health-cmd":"--health-cmd","--health-interval":"--health-interval","--health-retries":"--health-retries","--health-start-period":"--health-start-period","--health-timeout":"--health-timeout","--help":"--help","--hostname":"--hostname","--init":"--init","--interactive":"--interactive","--ip":"--ip","--ip6":"--ip6","--ipc":"--ipc","--isolation":"--isolation","--kernel-memory":"--kernel-memory","--label":"--label","--label-file":"--label-file","--link":"--link","--link-local-ip":"--link-local-ip","--log-driver":"--log-driver","--log-opt":"--log-opt","--mac-address":"--mac-address","--memory":"--memory","--memory-reservation":"--memory-reservation","--memory-swap":"--memory-swap","--memory-swappiness":"--memory-swappiness","--mount":"--mount","--name":"--name","--network":"--network","--network-alias":"--network-alias","--no-healthcheck":"--no-healthcheck","--oom-kill-disable":"--oom-kill-disable","--oom-score-adj":"--oom-score-adj","--pid":"--pid","--pids-limit":"--pids-limit","--platform":"--platform","--privileged":"--privileged","--publish":"--publish","--publish-all":"--publish-all","--pull":"--pull","--restart":"--restart","--rm":"--rm","--runtime":"--runtime","--security-opt":"--security-opt","--shm-size":"--shm-size","--stop-signal":"--stop-signal","--stop-timeout":"--stop-timeout","--storage-opt":"--storage-opt","--sysctl":"--sysctl","--tmpfs":"--tmpfs","--tty":"--tty","--ulimit":"--ulimit","--user":"--user","--userns":"--userns","--uts":"--uts","--volume":"--volume","--volume-driver":"--volume-driver","--volumes-from":"--volumes-from","--workdir":"--workdir"},Ut={"--env":!0,"--publish":!0,"--volume":!0,"--attach":!0,"--quiet":!0,"--entrypoint":!0,"--workdir":!0,"--cidfile":!0,"--detach-keys":!0,"--disable-content-trust":!0,"--domainname":!0,"--expose":!0,"--ip":!0,"--link-local-ip":!0,"--platform":!0},xn={"--volume":!0,"--publish":!0},gn=new Set(["--publish","--volume"]),ys=t=>{const[o]=t.split(":");return o?.startsWith("/")||o?.startsWith("./")||o?.startsWith("../")||o?.startsWith("~")||o?.startsWith("$BLOCKLET")};function kn(t){return t.map(o=>{if(o.key!=="--volume"||o.value.startsWith("$BLOCKLET_APP_DIR/")||o.value.startsWith("$BLOCKLET_DATA_DIR/"))return o;const[s,...r]=o.value.split(":");if(!s||!ys(o.value))return o;const l=s.startsWith("/")?`$BLOCKLET_DATA_DIR${s}`:`$BLOCKLET_DATA_DIR/${s}`;return{...o,value:[l,...r].join(":")}})}function jn(t){let o=!0;return t.find(r=>r.key==="--publish"&&r.type==="web")?t.map(r=>{if(r.key==="--publish"){const l={...r,type:o?"docker":r.type};return o=r.type==="web",l}return r}):t.map(r=>{if(r.key==="--publish"){const l={...r,type:o?"web":"docker"};return o=!1,l}return r})}function ho(t){if(!t)return{dockerArgs:[],dockerEnvs:[],dockerImage:"",dockerCommand:""};if(t=t.trim(),t.startsWith("$ docker run")&&(t=t.replace("$ docker run","docker run")),!t.startsWith("docker run"))return{dockerArgs:[],dockerEnvs:[],dockerImage:"",dockerCommand:""};const s=t.replace(/\\\n/g,"").replace(/\n/g," ").trim().match(/(?:[^\s"']+|'[^']*'|"[^"]*")+/g);if(!s)return{dockerArgs:[],dockerEnvs:[],dockerImage:"",dockerCommand:""};const r=[],l=[];let c=0,i="",d="";const u=[];for(;c<s.length;){const p=s[c];if(!p){c++;continue}if(p==="docker"||p==="run"){c++;continue}if((p==="-e"||p==="--env")&&c+1<s.length){const m=s[c+1]||"",[f,...b]=m.split("=");if(f){const h=b.join("=").replace(/^['"]|['"]$/g,"");l.push({key:f,value:h})}c+=2;continue}if(p.startsWith("-")&&u.length===0){const m=p.indexOf("=");let f=p,b=null;m!==-1&&(f=p.substring(0,m),b=p.substring(m+1).replace(/^['"]|['"]$/g,""));const h=fn[f];if(!h){c+=2;continue}if(h==="--publish"){let j="";if(b)j=b,r.push({key:h,value:j});else if(c+1<s.length&&!(s[c+1]||"").startsWith("-")){j=(s[c+1]||"").replace(/^['"]|['"]$/g,""),r.push({key:h,value:j}),c+=2;continue}else{r.push({key:h,value:"true"}),c++;continue}c++;continue}if(b!==null){r.push({key:h,value:b}),c++;continue}else if(c+1<s.length&&!(s[c+1]||"").startsWith("-")){const j=(s[c+1]||"").replace(/^['"]|['"]$/g,"");r.push({key:h,value:j}),c+=2;continue}else{r.push({key:h,value:"true"}),c++;continue}}u.push(p),c++}i=u[0]||"",d=u.slice(1).join(" ");const x=[];for(const p of r)p.name="",p.path="",p.prefix="",p.protocol="",p.proxyBehavior="service",p.type="docker",!(gn.has(p.key)&&p.value==="true")&&x.push(p);for(const p of l)p.custom="",p.description="",p.secure=!1,p.shared=!1,p.required=!1;return{dockerArgs:jn(kn(x)),dockerEnvs:l,dockerImage:i,dockerCommand:d}}function yn({dockerArgs:t,dockerEnvs:o,dockerImage:s,dockerCommand:r}){if(t.length===0&&o.length===0&&!s)return"";const l=["docker run \\"],c=new Set(["--publish","--volume","--expose","--device","--mount","--label","--cap-add","--cap-drop","--add-host","--dns","--network-alias","--sysctl","--ulimit","--network"]);for(const i of t){const{key:d,value:u}=i;if(c.has(d))if(u==="true")l.push(` ${d} \\`);else{const x=/[\s"']/g.test(u)?`"${u}"`:u;l.push(` ${d} ${x} \\`)}else if(!l.some(x=>x.startsWith(` ${d}`)))if(u==="true")l.push(` ${d} \\`);else{const x=/[\s"']/g.test(u)?`"${u}"`:u;l.push(` ${d} ${x} \\`)}}for(const i of o){const{key:d,value:u}=i,x=/["']/g.test(u)?u:`"${u}"`;l.push(` -e ${d}=${x} \\`)}return s&&l.push(` ${s} \\`),r&&l.push(` ${r} \\`),l[l.length-1]?.endsWith(" \\")&&(l[l.length-1]=(l[l.length-1]||"").slice(0,-2)),l.join(`
193
+ `;function bs({text:t}){const{palette:o}=Eo();return t?e.jsx(_r,{style:{backgroundColor:o.background.default,color:o.text.primary},wrapperElement:{"data-color-mode":"light"},source:Or.sanitize(t),rehypePlugins:[[zr,{target:"_blank"}]]}):e.jsx(Ge,{Icon:Wt})}bs.propTypes={text:n.string.isRequired};function fs({params:t,setParams:o,paramsErrTip:s,loading:r,setParamsErrTip:l,readOnly:c}){const{t:i}=X(),[d,u]=k.useState(c?"preview":"write"),x=(p,m)=>{u(m)};return e.jsxs(a,{sx:{border:"1px solid transparent",borderRadius:2},children:[e.jsxs(a,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[e.jsx(A,{variant:"h6",sx:{fontWeight:"bold"},children:i("common.introduction")}),e.jsxs(Po,{value:d,onChange:x,"aria-label":"wrapped label tabs example",children:[e.jsx(ot,{value:"write",label:"Write"}),e.jsx(ot,{value:"preview",label:"Preview"})]})]}),e.jsx(a,{sx:{display:d==="write"?"block":"none",width:"100%",marginTop:3},children:e.jsx(ne,{disabled:r||c,sx:{border:"none"},placeholder:`Blocklet ${i("common.introduction")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:t.blockletIntroduction||"",onChange:p=>{l({blockletIntroduction:""}),o({blockletIntroduction:p.target.value.slice(0,me.PROJECT.MAX_INTRO_LENGTH)})},error:!!s.blockletIntroduction,helperText:s.blockletIntroduction||"",slotProps:{input:{"data-cy":"export-blocklet-introduction",readOnly:c,endAdornment:e.jsxs(Xe,{position:"end",children:[t?.blockletIntroduction?.length||0," / ",me.PROJECT.MAX_INTRO_LENGTH]})}}})}),e.jsx(a,{sx:{display:d==="preview"?"block":"none",mt:3},children:e.jsx(bs,{text:t.blockletIntroduction||""})})]})}fs.propTypes={params:n.object.isRequired,setParams:n.func.isRequired,paramsErrTip:n.object.isRequired,setParamsErrTip:n.func.isRequired,readOnly:n.bool.isRequired,loading:n.bool.isRequired};function xs({step:t=0,ok:o=!1,active:s=0,error:r="",warning:l=!1}){let c="grey.500",i=t+1;return o&&(i=e.jsx(Lo,{sx:{fontSize:18,margin:0},color:"white"})),r||!o&&s>t?(c="error.main",i=e.jsx(Jt,{sx:{fontSize:18,margin:0},color:"white"})):l?(c="warning.main",i=e.jsx(Jt,{sx:{fontSize:18,margin:0},color:"white"})):s>=t&&(c="primary.main"),e.jsx(a,{sx:{width:24,height:24,bgcolor:c,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center"},children:i})}xs.propTypes={step:n.number,ok:n.bool,active:n.number,error:n.string,warning:n.bool};function gs({steps:t,activeStep:o,setActiveStep:s,hasSelectedResources:r=!1,params:l,loading:c,paramsErrTip:i,warning:d,viewMode:u="",projectId:x}){const{t:p}=X(),m=()=>{s(j=>j+1)},f=()=>{s(j=>j-1)},b=j=>j===0?i?.blockletTitle||i?.projectId||i?.blockletDescription||i?.blockletHomepage||i?.blockletSupport||i?.blockletCommunity||i?.blockletRepository:j===2?i?.blockletResource||i?.blockletDocker||i?.dockerImageName:j>=4?i?.blockletVersion||i?.note:"",h=u||rs({params:l,projectId:x,t:p})===null;return e.jsxs(a,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[e.jsx(lr,{activeStep:o,orientation:"vertical",children:t.map((j,v)=>{const g={},C=c||!un({params:l,projectId:x,step:v,t:p}),I=c?"":b(v);return I&&(g.optional=e.jsx(A,{variant:"caption",color:"error",sx:{wordBreak:"break-word"},children:I}),g.error=!0),e.jsxs(ir,{children:[e.jsx(cr,{icon:e.jsx(xs,{error:I,warning:v===0?d.hasWarning:!1,active:h?99:o,step:v,ok:C}),sx:{cursor:"pointer",color:I?"error.main":"inherit"},disabled:!1,onClick:()=>s(v),...g,children:e.jsx(A,{fontSize:"14px",fontWeight:"500",color:I||!C&&o>v?"error.main":"inherit",children:j.label})}),e.jsxs(ar,{children:[e.jsx(A,{fontSize:12,children:j.description}),!h&&e.jsx(a,{sx:{mb:2},children:e.jsxs("div",{children:[v<t.length-1&&e.jsx(J,{variant:"contained",onClick:m,sx:{mt:1,mr:1},disabled:I||!C,children:p("common.continue")}),v>0&&e.jsx(J,{disabled:v===0,onClick:f,sx:{mt:1,mr:1},children:p("common.back")})]})})]})]},j.label)})}),o>=t.length-1&&e.jsx(Pt,{square:!0,elevation:0,sx:{p:3},children:e.jsx(A,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}gs.propTypes={steps:n.array.isRequired,activeStep:n.number.isRequired,setActiveStep:n.func.isRequired,params:n.object.isRequired,viewMode:n.oneOfType([n.string,n.bool]),loading:n.bool.isRequired,projectId:n.string.isRequired,hasSelectedResources:n.oneOfType([n.string,n.bool]),warning:n.object.isRequired,paramsErrTip:n.shape({projectId:n.string,blockletVersion:n.string,blockletTitle:n.string,blockletDescription:n.string,note:n.string,blockletResource:n.string,blockletHomepage:n.string,blockletSupport:n.string,blockletCommunity:n.string,blockletRepository:n.string,blockletDocker:n.object,dockerImageName:n.string}).isRequired};const hn=[".zip",".gz"],mn=1024*1024*100,bn=k.lazy(()=>Wo(()=>import("./index-DqcciDRh.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(t=>({default:t.Uploader})));function ks({app:t,projectId:o,readOnly:s,params:r,setParams:l,setParamsErrTip:c,error:i}){const{t:d,locale:u}=X(),x=k.useRef(null),p=()=>s?!1:!o||o===F.UNOWNED_DID?(_.error(d("blocklet.publish.errorTip.noFirstDid")),!1):!0,m=`${F.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${t.meta.did}/${o}/resource/upload`;return e.jsxs(a,{sx:{mt:3},children:[e.jsx(A,{gutterBottom:!0,children:d("blocklet.publish.resourceUpload")}),e.jsxs(Re,{direction:"row",spacing:1,sx:{alignItems:"center",flex:1,cursor:s?"default":"pointer"},children:[!!r.uploadedResource&&e.jsx(A,{component:"a",href:`${m}/params.uploadedResource`,children:r.uploadedResource}),!s&&e.jsx(J,{variant:"outlined",size:"small",onClick:()=>{p()&&x.current?.open()},children:r.uploadedResource?d("common.change"):d("common.upload")})]}),e.jsx(k.Suspense,{fallback:e.jsx(Je,{}),children:e.jsx(bn,{ref:x,locale:u,popup:!0,onUploadFinish:f=>{l({uploadedResource:f.data.filename}),c({blockletResource:""}),x.current?.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:m,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileExts:hn,maxFileSize:mn,maxNumberOfFiles:1}}},"uploader-resource")}),!!i&&e.jsx(a,{sx:{color:"error.main",mt:1,fontSize:14},children:i})]})}ks.propTypes={app:n.object.isRequired,projectId:n.string.isRequired,readOnly:n.bool.isRequired,params:n.object.isRequired,setParams:n.func.isRequired,error:n.string.isRequired,setParamsErrTip:n.func.isRequired};function Tt({readOnly:t,params:o,setParams:s,paramsErrTip:r,setParamsErrTip:l,loading:c}){const{t:i}=X();return e.jsx(a,{className:"section",sx:{display:"flex",mt:3},children:e.jsxs(a,{sx:{flex:1},children:[e.jsx(ne,{required:!0,disabled:c||t,label:`Blocklet ${i("common.version")}`,placeholder:`Blocklet ${i("common.version")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,value:o.blockletVersion||"",onChange:d=>{l({blockletVersion:""}),s({blockletVersion:d.target.value})},error:!!r.blockletVersion,helperText:r.blockletVersion||"",slotProps:{input:{"data-cy":"blocklet-version",readOnly:t}}}),e.jsx(ne,{label:i("blocklet.publish.releaseNote"),autoComplete:"off",disabled:c||t,variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,required:!0,value:o.note||"",onChange:d=>{l({note:""}),s({note:d.target.value.slice(0,me.PROJECT.MAX_NOTE_LENGTH)})},error:!!r.note,helperText:r.note||"",sx:{mt:3},slotProps:{input:{"data-cy":"release-note",readOnly:t,endAdornment:e.jsxs(Xe,{position:"end",children:[o?.note?.length||0," / ",me.PROJECT.MAX_NOTE_LENGTH]})}}})]})})}Tt.propTypes={readOnly:n.bool.isRequired,params:n.object.isRequired,setParams:n.func.isRequired,paramsErrTip:n.object.isRequired,setParamsErrTip:n.func.isRequired,loading:n.bool.isRequired};function js(t){for(const o in t)typeof t[o]=="string"?t[o]=t[o].replace(/\\\\/g,"\\"):typeof t[o]=="object"&&t[o]!==null&&js(t[o]);return t}const fn={"-a":"--attach","-d":"--detach","-e":"--env","-h":"--hostname","-i":"--interactive","-it":"-it","-rm":"-rm","-m":"--memory","-p":"--publish","-P":"--publish-all","-l":"--label","-n":"--name","-q":"--quiet","-x":"--x-registry","-t":"--tty","-u":"--user","-v":"--volume","-w":"--workdir","-cgroupns":"--cgroupns","-cpus":"--cpus","-g":"--gpus","-ip6":"--ip6","--read-only":"--read-only","--add-host":"--add-host","--attach":"--attach","--blkio-weight":"--blkio-weight","--blkio-weight-device":"--blkio-weight-device","--cap-add":"--cap-add","--cap-drop":"--cap-drop","--cgroup-parent":"--cgroup-parent","--cidfile":"--cidfile","--cpu-period":"--cpu-period","--cpu-quota":"--cpu-quota","--cpu-rt-period":"--cpu-rt-period","--cpu-rt-runtime":"--cpu-rt-runtime","--cpu-shares":"--cpu-shares","--cpus":"--cpus","--cpuset-cpus":"--cpuset-cpus","--cpuset-mems":"--cpuset-mems","--detach":"--detach","--detach-keys":"--detach-keys","--device":"--device","--device-cgroup-rule":"--device-cgroup-rule","--device-read-bps":"--device-read-bps","--device-read-iops":"--device-read-iops","--device-write-bps":"--device-write-bps","--device-write-iops":"--device-write-iops","--disable-content-trust":"--disable-content-trust","--dns":"--dns","--dns-opt":"--dns-opt","--dns-search":"--dns-search","--domainname":"--domainname","--entrypoint":"--entrypoint","--env":"--env","--env-file":"--env-file","--expose":"--expose","--gpus":"--gpus","--group-add":"--group-add","--health-cmd":"--health-cmd","--health-interval":"--health-interval","--health-retries":"--health-retries","--health-start-period":"--health-start-period","--health-timeout":"--health-timeout","--help":"--help","--hostname":"--hostname","--init":"--init","--interactive":"--interactive","--ip":"--ip","--ip6":"--ip6","--ipc":"--ipc","--isolation":"--isolation","--kernel-memory":"--kernel-memory","--label":"--label","--label-file":"--label-file","--link":"--link","--link-local-ip":"--link-local-ip","--log-driver":"--log-driver","--log-opt":"--log-opt","--mac-address":"--mac-address","--memory":"--memory","--memory-reservation":"--memory-reservation","--memory-swap":"--memory-swap","--memory-swappiness":"--memory-swappiness","--mount":"--mount","--name":"--name","--network":"--network","--network-alias":"--network-alias","--no-healthcheck":"--no-healthcheck","--oom-kill-disable":"--oom-kill-disable","--oom-score-adj":"--oom-score-adj","--pid":"--pid","--pids-limit":"--pids-limit","--platform":"--platform","--privileged":"--privileged","--publish":"--publish","--publish-all":"--publish-all","--pull":"--pull","--restart":"--restart","--rm":"--rm","--runtime":"--runtime","--security-opt":"--security-opt","--shm-size":"--shm-size","--stop-signal":"--stop-signal","--stop-timeout":"--stop-timeout","--storage-opt":"--storage-opt","--sysctl":"--sysctl","--tmpfs":"--tmpfs","--tty":"--tty","--ulimit":"--ulimit","--user":"--user","--userns":"--userns","--uts":"--uts","--volume":"--volume","--volume-driver":"--volume-driver","--volumes-from":"--volumes-from","--workdir":"--workdir"},Ut={"--env":!0,"--publish":!0,"--volume":!0,"--attach":!0,"--quiet":!0,"--entrypoint":!0,"--workdir":!0,"--cidfile":!0,"--detach-keys":!0,"--disable-content-trust":!0,"--domainname":!0,"--expose":!0,"--ip":!0,"--link-local-ip":!0,"--platform":!0},xn={"--volume":!0,"--publish":!0},gn=new Set(["--publish","--volume"]),ys=t=>{const[o]=t.split(":");return o?.startsWith("/")||o?.startsWith("./")||o?.startsWith("../")||o?.startsWith("~")||o?.startsWith("$BLOCKLET")};function kn(t){return t.map(o=>{if(o.key!=="--volume"||o.value.startsWith("$BLOCKLET_APP_DIR/")||o.value.startsWith("$BLOCKLET_DATA_DIR/"))return o;const[s,...r]=o.value.split(":");if(!s||!ys(o.value))return o;const l=s.startsWith("/")?`$BLOCKLET_DATA_DIR${s}`:`$BLOCKLET_DATA_DIR/${s}`;return{...o,value:[l,...r].join(":")}})}function jn(t){let o=!0;return t.find(r=>r.key==="--publish"&&r.type==="web")?t.map(r=>{if(r.key==="--publish"){const l={...r,type:o?"docker":r.type};return o=r.type==="web",l}return r}):t.map(r=>{if(r.key==="--publish"){const l={...r,type:o?"web":"docker"};return o=!1,l}return r})}function ho(t){if(!t)return{dockerArgs:[],dockerEnvs:[],dockerImage:"",dockerCommand:""};if(t=t.trim(),t.startsWith("$ docker run")&&(t=t.replace("$ docker run","docker run")),!t.startsWith("docker run"))return{dockerArgs:[],dockerEnvs:[],dockerImage:"",dockerCommand:""};const s=t.replace(/\\\n/g,"").replace(/\n/g," ").trim().match(/(?:[^\s"']+|'[^']*'|"[^"]*")+/g);if(!s)return{dockerArgs:[],dockerEnvs:[],dockerImage:"",dockerCommand:""};const r=[],l=[];let c=0,i="",d="";const u=[];for(;c<s.length;){const p=s[c];if(!p){c++;continue}if(p==="docker"||p==="run"){c++;continue}if((p==="-e"||p==="--env")&&c+1<s.length){const m=s[c+1]||"",[f,...b]=m.split("=");if(f){const h=b.join("=").replace(/^['"]|['"]$/g,"");l.push({key:f,value:h})}c+=2;continue}if(p.startsWith("-")&&u.length===0){const m=p.indexOf("=");let f=p,b=null;m!==-1&&(f=p.substring(0,m),b=p.substring(m+1).replace(/^['"]|['"]$/g,""));const h=fn[f];if(!h){c+=2;continue}if(h==="--publish"){let j="";if(b)j=b,r.push({key:h,value:j});else if(c+1<s.length&&!(s[c+1]||"").startsWith("-")){j=(s[c+1]||"").replace(/^['"]|['"]$/g,""),r.push({key:h,value:j}),c+=2;continue}else{r.push({key:h,value:"true"}),c++;continue}c++;continue}if(b!==null){r.push({key:h,value:b}),c++;continue}else if(c+1<s.length&&!(s[c+1]||"").startsWith("-")){const j=(s[c+1]||"").replace(/^['"]|['"]$/g,"");r.push({key:h,value:j}),c+=2;continue}else{r.push({key:h,value:"true"}),c++;continue}}u.push(p),c++}i=u[0]||"",d=u.slice(1).join(" ");const x=[];for(const p of r)p.name="",p.path="",p.prefix="",p.protocol="",p.proxyBehavior="service",p.type="docker",!(gn.has(p.key)&&p.value==="true")&&x.push(p);for(const p of l)p.custom="",p.description="",p.secure=!1,p.shared=!1,p.required=!1;return{dockerArgs:jn(kn(x)),dockerEnvs:l,dockerImage:i,dockerCommand:d}}function yn({dockerArgs:t,dockerEnvs:o,dockerImage:s,dockerCommand:r}){if(t.length===0&&o.length===0&&!s)return"";const l=["docker run \\"],c=new Set(["--publish","--volume","--expose","--device","--mount","--label","--cap-add","--cap-drop","--add-host","--dns","--network-alias","--sysctl","--ulimit","--network"]);for(const i of t){const{key:d,value:u}=i;if(c.has(d))if(u==="true")l.push(` ${d} \\`);else{const x=/[\s"']/g.test(u)?`"${u}"`:u;l.push(` ${d} ${x} \\`)}else if(!l.some(x=>x.startsWith(` ${d}`)))if(u==="true")l.push(` ${d} \\`);else{const x=/[\s"']/g.test(u)?`"${u}"`:u;l.push(` ${d} ${x} \\`)}}for(const i of o){const{key:d,value:u}=i,x=/["']/g.test(u)?u:`"${u}"`;l.push(` -e ${d}=${x} \\`)}return s&&l.push(` ${s} \\`),r&&l.push(` ${r} \\`),l[l.length-1]?.endsWith(" \\")&&(l[l.length-1]=(l[l.length-1]||"").slice(0,-2)),l.join(`
194
194
  `)}const ws={"--volume":t=>{const[o]=t.split(":");return o?ys(t)&&!t.startsWith("$BLOCKLET_APP_DIR/")&&!t.startsWith("$BLOCKLET_DATA_DIR/")?"Volume must start with $BLOCKLET_APP_DIR or $BLOCKLET_DATA_DIR":t.indexOf("..")>-1?'Volume cannot contain ".."':"":"Volume must start with key:value"}},Qe=t=>t.replace(/^[-]+/,"").replace(/-([a-z])/g,(r,l)=>l.toUpperCase()),wn=t=>`--${t.replace(/([A-Z])/g,"-$1").toLowerCase()}`,vn=[" -- ","~","&","|",">","<","{","}","[","]",";","$","!","*","%","&&","||",","],Cn=["rm ","sudo "];function vs(t){if(t==="")return;if(/(\n|\\n|\\\n|\t|\\t|\\\t)/.test(t))throw new Error("Docker CMD is invalid");const s=t.toLocaleLowerCase();if(Cn.some(l=>s.indexOf(l)!==-1))throw new Error("Docker CMD is invalid");if(vn.some(l=>t.indexOf(l)!==-1))throw new Error("Docker CMD is invalid");if(!/^(?:(?:[a-zA-Z0-9\-_.\/:=\s]+)|(?:\@{1,2}[a-zA-Z_][a-zA-Z0-9_]*))+$/.test(t))throw new Error("Docker CMD is invalid")}const Rn=Array.from(new Set(Object.keys(Ut).map(Qe))),Sn=["publish","volume"];te.object({workdir:te.string().trim().optional(),image:te.string().trim().regex(/^[^\s]+$/).optional(),shell:te.string().trim().optional(),volumes:te.array().items(te.string().trim()).optional(),script:te.string().trim().optional(),installNodeModules:te.boolean().optional(),skipWrapDockerfile:te.boolean().optional(),tmpfs:te.string().trim().optional(),command:te.string().allow("").default("").optional().custom((t,o)=>{try{return vs(t),t}catch(s){return o.error("any.invalid",{message:s.message})}},"Docker CMD validation"),runBaseScript:te.boolean().optional(),...Rn.reduce((t,o)=>{const s=ws[wn(o)];return Sn.includes(o)?(t[o]=te.array().items(te.string().trim()).optional(),s?t[o]=te.array().items(te.string().trim().custom((r,l)=>{const c=s(r);return c?l.message(c):r})).optional():t[o]=te.array().items(te.string().trim()).optional(),t):(s?t[o]=te.string().trim().custom((r,l)=>{const c=s(r);return c?l.message(c):r}).optional():t[o]=te.string().trim().optional(),t)},{})}).optional();function It({index:t,item:o,dockerParams:s,setDockerParams:r,dataKey:l,t:c,readOnly:i}){const d=o?.value||"",[u,x]=k.useState(!1),p=()=>{s[l]?.splice(t,1),r({...s,[l]:[...s[l]]})},m=(L,$)=>{s[l]?.[t]&&($?(s[l][t].custom=s[l][t].value,s[l][t].value=`$${Qe(o.key)}`):(s[l][t].value=s[l][t].custom||"",s[l][t].custom="")),r({...s,[l]:[...s[l]]})},f=(L,$)=>{const w=s[l][t]?.value||"";s[l][t]={...s[l][t],secure:$,value:$&&w===me.BLOCKLET_AUTOMATIC_ENV_VALUE?"":w},r({...s,[l]:[...s[l]]})},b=(L,$)=>{s[l][t]={...s[l][t],shared:$},r({...s,[l]:[...s[l]]})},h=(L,$)=>{const w=s[l][t]?.value||"";s[l][t]={...s[l][t],required:$,value:$&&w===me.BLOCKLET_AUTOMATIC_ENV_VALUE?"":w},r({...s,[l]:[...s[l]]})},j=(L,$)=>{s[l][t]={...s[l][t],value:$?me.BLOCKLET_AUTOMATIC_ENV_VALUE:"",secure:!1,required:!1},r({...s,[l]:[...s[l]]})},v=L=>{s[l][t]={...s[l][t],description:L.target.value},r({...s,[l]:[...s[l]]})},g=L=>{const $=L.target.value==="web"?"web":"docker";$==="web"&&s.dockerArgs.forEach(Z=>{Z.type="docker"});const S=`/${s.dockerImage.replace(/\W/g,"-")}-${t}`;s.dockerArgs[t]={...s.dockerArgs[t],type:$,path:$==="docker"?S:"/",protocol:"http",prefix:$==="docker"?S:"/",name:"publicUrl",port:"BLOCKLET_PORT"},r({...s,dockerArgs:[...s.dockerArgs]})},C=L=>{s.dockerArgs[t]={...s.dockerArgs[t],proxyBehavior:L.target.value==="direct"?"direct":"service"},r({...s,dockerArgs:[...s.dockerArgs]})},I=L=>{const $=L.target.value;s[l][t]={...s[l][t],prefix:$,path:$==="*"?"/":$},r({...s,[l]:[...s[l]]})},R=L=>{s[l]?.[t]&&(s[l][t].value=L.target.value),r({...s,[l]:[...s[l]]})},y=d===`$${Qe(o.key)}`||o.custom,T=l==="dockerArgs"&&!Ut[o.key],O=xn[o.key],N=l==="dockerEnvs",z=o.key==="--publish";let K=o.key;return z&&o.type==="web"?K="--publish (Web)":N&&(K=`--env ${o.key}`),e.jsxs(a,{sx:{display:"flex",flexDirection:"row",gap:2,alignItems:"center"},children:[e.jsx(a,{sx:{width:250},children:e.jsx(A,{sx:{textOverflow:"ellipsis",width:"100%",overflow:"hidden"},children:K})}),e.jsxs(a,{sx:{display:"flex",flexDirection:"column",gap:1,flex:1},children:[e.jsx(ne,{disabled:i||y||T||o.value===me.BLOCKLET_AUTOMATIC_ENV_VALUE,placeholder:"",value:y?`$${Qe(o.key)}`:d,sx:{flex:1},error:T,onChange:R,slotProps:{input:{endAdornment:e.jsxs(Xe,{position:"end",sx:{zoom:.9},children:[(!(O||T)||N||z)&&e.jsx(ce,{onClick:()=>x(!0),children:e.jsx(ae,{icon:"icon-park-outline:setting-config"})}),!i&&e.jsx(ce,{onClick:p,color:T?"error":"default",children:e.jsx(ae,{icon:"ic:round-delete"})})]})}}}),T&&e.jsx(A,{variant:"caption",color:"error",children:c("blocklet.publish.docker.noAllowTheArg")}),o.key==="--publish"&&e.jsx(A,{variant:"caption",sx:{color:"text.secondary"},children:c("blocklet.publish.docker.publishTips")}),o.key==="--volume"&&ws[o.key](d)&&e.jsx(A,{variant:"caption",color:"error",children:c("blocklet.publish.docker.volumeTips")})]}),u&&e.jsx(ct,{open:!0,fullWidth:!0,maxWidth:"sm",PaperProps:{style:{minHeight:0}},title:c(N?"blocklet.publish.docker.modifyEnv":"blocklet.publish.docker.modifyParam"),onClose:()=>x(!1),children:e.jsxs(a,{sx:{display:"flex",flexDirection:"column",gap:1,paddingBottom:2},children:[O||T||N?null:e.jsxs(a,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{children:c("blocklet.publish.docker.needCustomInput")}),e.jsx(Pe,{disabled:i,checked:y,onChange:m,sx:{zoom:.9}})]}),N&&e.jsxs(a,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{children:c("blocklet.publish.docker.shared")}),e.jsx(Pe,{disabled:i,checked:o.shared,onChange:b,sx:{zoom:.9}})]}),N&&e.jsxs(a,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{children:c("blocklet.publish.docker.required")}),e.jsx(Pe,{disabled:i,checked:o.required,onChange:h,sx:{zoom:.9}})]}),N&&e.jsxs(a,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{children:c("blocklet.publish.docker.secure")}),e.jsx(Pe,{disabled:i,checked:o.secure,onChange:f,sx:{zoom:.9}})]}),N&&e.jsxs(a,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{children:c("blocklet.publish.docker.autoGenerated")}),e.jsx(Pe,{disabled:i,checked:o.value===me.BLOCKLET_AUTOMATIC_ENV_VALUE,onChange:j,sx:{zoom:.9}})]}),N&&e.jsxs(a,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{sx:{flex:1},children:c("blocklet.publish.docker.description")}),e.jsx(ne,{disabled:i,value:o.description,onChange:v,sx:{flex:1},label:c("blocklet.publish.docker.description")})]}),z&&e.jsxs(a,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{sx:{flex:1},children:c("blocklet.publish.docker.portType")}),e.jsxs(vt,{value:o.type||"docker",onChange:g,children:[e.jsx(be,{value:"docker",children:"Docker"}),e.jsx(be,{value:"web",children:"Web"})]})]}),z&&o.type==="web"&&e.jsxs(a,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{sx:{flex:1},children:c("blocklet.publish.docker.proxyBehavior")}),e.jsxs(vt,{value:o.proxyBehavior||"service",onChange:C,children:[e.jsx(be,{value:"service",children:c("blocklet.publish.docker.serviceProxy")}),e.jsx(be,{value:"direct",children:c("blocklet.publish.docker.directProxy")})]})]}),z&&o.type==="web"&&e.jsxs(a,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{sx:{flex:1},children:c("blocklet.publish.docker.prefix")}),e.jsx(ne,{disabled:i,value:o.prefix,onChange:I,sx:{flex:1},label:c("blocklet.publish.docker.prefix")})]})]})})]})}It.propTypes={dockerParams:n.object.isRequired,setDockerParams:n.func.isRequired,dataKey:n.string.isRequired,item:n.object.isRequired,t:n.func.isRequired,readOnly:n.bool.isRequired,index:n.number.isRequired};const Tn=`
195
195
  docker run --name postgrest
196
196
  -p 3000:3000
@@ -1,4 +1,4 @@
1
- import{M as p,j as e,R as m,bR as C,P as b,aj as B,p as L,bI as v,Q as P}from"./vendor-mui-core-D7t4vMS5.js";import{r as i}from"./vendor-react-DX7tU9aY.js";import{n as R}from"./vendor-utils-BzQg432x.js";import{l as f}from"./vendor-ux-Dl3wVbv_.js";function z(t,s){i.useEffect(()=>{function r(o){!t||!t.current||t.current.contains(o.target)||s(o)}return document.addEventListener("click",r,!0),()=>{document.removeEventListener("click",r,!0)}},[t,s])}function A({...t}){const{size:s="medium",color:r="primary",menu:o=[],children:c=null,variant:x="contained",onClick:h=R,menuButtonProps:j={},...g}=t,[k,l]=i.useState(!1),a=i.useRef(null),u=i.useRef(null),M=Array.isArray(o)?o.map((n,I)=>i.isValidElement(n)?n:i.createElement(p,{...n,key:I})):o,y=()=>{l(n=>!n)},d=n=>{a.current&&a.current.contains(n.target)||l(!1)};z(u,d);const E=n=>{n.target.closest(".MuiMenuItem-root")&&l(!1)};return e.jsxs(e.Fragment,{children:[e.jsxs(w,{variant:x,size:s,color:r,ref:a,...g,children:[typeof c=="function"?c():e.jsx(m,{onClick:h,color:r,children:c}),e.jsx(m,{onClick:y,color:r,...j,"aria-label":"more functions",children:e.jsx(C,{})})]}),e.jsx(V,{open:k,anchorEl:a.current,placement:"bottom-end",disablePortal:!1,children:e.jsx(b,{ref:u,children:e.jsx(B,{onClickAway:d,children:e.jsx(L,{onClick:E,children:M})})})})]})}A.Item=p;const w=f(v)`
1
+ import{M as p,j as e,R as m,bR as C,P as b,aj as B,p as L,bI as v,Q as P}from"./vendor-mui-core-CV-FnYH_.js";import{r as i}from"./vendor-react-DX7tU9aY.js";import{n as R}from"./vendor-utils-BzQg432x.js";import{l as f}from"./vendor-ux-CLT2i3Pv.js";function z(t,s){i.useEffect(()=>{function r(o){!t||!t.current||t.current.contains(o.target)||s(o)}return document.addEventListener("click",r,!0),()=>{document.removeEventListener("click",r,!0)}},[t,s])}function A({...t}){const{size:s="medium",color:r="primary",menu:o=[],children:c=null,variant:x="contained",onClick:h=R,menuButtonProps:j={},...g}=t,[k,l]=i.useState(!1),a=i.useRef(null),u=i.useRef(null),M=Array.isArray(o)?o.map((n,I)=>i.isValidElement(n)?n:i.createElement(p,{...n,key:I})):o,y=()=>{l(n=>!n)},d=n=>{a.current&&a.current.contains(n.target)||l(!1)};z(u,d);const E=n=>{n.target.closest(".MuiMenuItem-root")&&l(!1)};return e.jsxs(e.Fragment,{children:[e.jsxs(w,{variant:x,size:s,color:r,ref:a,...g,children:[typeof c=="function"?c():e.jsx(m,{onClick:h,color:r,children:c}),e.jsx(m,{onClick:y,color:r,...j,"aria-label":"more functions",children:e.jsx(C,{})})]}),e.jsx(V,{open:k,anchorEl:a.current,placement:"bottom-end",disablePortal:!1,children:e.jsx(b,{ref:u,children:e.jsx(B,{onClickAway:d,children:e.jsx(L,{onClick:E,children:M})})})})]})}A.Item=p;const w=f(v)`
2
2
  > .MuiButtonBase-root:last-of-type {
3
3
  min-width: 2em;
4
4
  padding-left: 0;
@@ -1,4 +1,4 @@
1
- import{r as b,g as We,a as $e}from"./vendor-react-DX7tU9aY.js";import{i as qe,r as Z}from"./vendor-hooks-DAZ1H6Va.js";import{j as e,al as t,aT as $,b3 as K,a7 as F,b4 as Ue,an as G,bd as He,V as Ge,T as O,a4 as Ke,X as S,A as E,M as Q,I as _,d_ as ge,c3 as ye,C as Ye,y as Ve,cr as Ze,cs as ee,c6 as Qe,F as Xe,bN as Je,s as es}from"./vendor-mui-core-D7t4vMS5.js";import{W as A,aO as W,bb as ss,aQ as ae,bk as se,Q as D,b4 as N,aP as re,bW as je,bV as ts,n as as,b9 as rs,bC as os}from"./vendor-ux-Dl3wVbv_.js";import{W as P,B as ns,M as be,c as M,F as J,V as is,o as ls,G as cs,f as V,c1 as ds}from"./index-Ca33rdd_.js";import{W as oe}from"./did-address-DRYM96gB.js";import{b as z}from"./team-7-48iuwj.js";import{r as ne,a as ie,b as le,c as ve,d as X,e as ps,u as us,f as ms}from"./passport-item-CjcqN_g-.js";import{p as Se}from"./util-DCHBQZpP.js";import{u as fs}from"./use-mobile-BSL5RsRd.js";import{O as H}from"./index-_bvucGkF.js";import{w as q,P as xs}from"./permission-DhyiLNfC.js";import{C as hs}from"./Google-BMSeyXdi.js";import{c as gs}from"./create-passport-svg-De1vqcmo.js";import{A as ys}from"./vendor-arcblock-ivFYo5vP.js";import{C as Y,aC as js}from"./vendor-utils-BzQg432x.js";import{e as Ce}from"./edit.svg-BGhTyO6h.js";import{h as ce,b as bs}from"./index-BQFgfBFX.js";import{C as Te}from"./confirm-DQYDHHdS.js";import{L as we}from"./list-header-DQZTNnUc.js";import{f as te}from"./index-DBs9Ljax.js";import{u as vs}from"./useSetState-CUbypYGT.js";import"./session-lE2gmzzF.js";import"./purify.es-HRjpPm7y.js";import"./wallet-hidden-topbar-DKISAPb3.js";import"./theme-mode-toggle-BltDSXhy.js";import"./use-mobile-DgmmfWdl.js";import"./index-sb6EjUcD.js";import"./isURL-CpQHQuaa.js";import"./isIP-BBY240SU.js";import"./use-blocklet-logo-BWPJOOVd.js";import"./use-app-logo-BzsLZwwK.js";import"./ua-parser-D6QF1h5N.js";import"./base32-Cpvj2sD4.js";import"./cloneDeep-YxES7wNt.js";import"./lock.svg-BOhdQlHW.js";const me="info";function Ie({createPassportSvg:c,passport:s,onCancel:p,onSwitchPassport:u=()=>{}}){const{t:f}=A(),i=qe({tab:me}),d={info:{label:f("common.basicInfo"),value:me,component:()=>e.jsx(De,{passport:s,createPassportSvg:c})},logs:{label:f("common.logs"),value:"logs",component:()=>e.jsx(Re,{passport:s})},related:{label:f("team.passport.related"),value:"related",component:()=>e.jsx(Ae,{passport:s,onSwitchPassport:u})}},l=Object.values(d).map(({label:h,value:m})=>({label:h,value:m})).filter(h=>h.value==="related"?s.parentDid:!0),r=d[i.tab]||d.info,n=h=>{i.tab=h};return e.jsx(W,{title:f("common.passport"),onClose:p,open:!0,PaperProps:{style:{maxWidth:800,minHeight:"80vh"}},fullWidth:!0,children:e.jsxs(Ss,{children:[e.jsx(t,{className:"tabs",children:e.jsx(ss,{tabs:l,current:i.tab,onChange:n,scrollButtons:"auto"})}),e.jsx(t,{className:"body",children:e.jsx(r.component,{})})]})})}Ie.propTypes={createPassportSvg:S.func.isRequired,passport:S.object.isRequired,onCancel:S.func.isRequired,onSwitchPassport:S.func};const Ss=$(t)`
1
+ import{r as b,g as We,a as $e}from"./vendor-react-DX7tU9aY.js";import{i as qe,r as Z}from"./vendor-hooks-DAZ1H6Va.js";import{j as e,al as t,aT as $,b3 as Y,a7 as F,b4 as Ue,an as G,bd as He,V as Ge,T as E,a4 as Ye,X as S,A as O,M as Q,I as _,d_ as ge,ct as ye,C as Ke,y as Ve,cp as Ze,cq as ee,c3 as Qe,F as Xe,bN as Je,s as es}from"./vendor-mui-core-CV-FnYH_.js";import{W as A,aO as W,bc as ss,aR as ae,bm as se,Q as D,b5 as N,aQ as re,bY as je,bX as ts,n as as,ba as rs,bE as os}from"./vendor-ux-CLT2i3Pv.js";import{W as P,B as ns,M as be,c as M,F as J,V as is,o as ls,G as cs,f as V,c1 as ds}from"./index-CXp5SI_f.js";import{W as oe}from"./did-address-CG36eCOx.js";import{b as z}from"./team-BTz28XqK.js";import{r as ne,a as ie,b as le,c as ve,d as X,e as ps,u as us,f as ms}from"./passport-item-DHwif94N.js";import{p as Se}from"./util-DkTwHdRu.js";import{u as fs}from"./use-mobile-DwGMuJlg.js";import{O as H}from"./index-Bo9KtpTY.js";import{w as q,P as xs}from"./permission-CvrrGfG6.js";import{C as hs}from"./Google-DKRt92nm.js";import{c as gs}from"./create-passport-svg-hldNORaB.js";import{A as ys}from"./vendor-arcblock-Dll6qxMT.js";import{C as K,aC as js}from"./vendor-utils-BzQg432x.js";import{e as Ce}from"./edit.svg-BGhTyO6h.js";import{h as ce,b as bs}from"./index-BOPR4Iyc.js";import{C as Te}from"./confirm-CdVn5WdC.js";import{L as we}from"./list-header-BEZSwSji.js";import{f as te}from"./index-DBs9Ljax.js";import{u as vs}from"./useSetState-CUbypYGT.js";import"./session-Bp3LV7zJ.js";import"./purify.es-HRjpPm7y.js";import"./wallet-hidden-topbar-joIVZ1nl.js";import"./theme-mode-toggle-D3bcd10D.js";import"./use-mobile-CyUZDIaX.js";import"./index-CEJb82tA.js";import"./isURL-CpQHQuaa.js";import"./isIP-BBY240SU.js";import"./use-blocklet-logo-Cf1j7pQz.js";import"./use-app-logo-IRizt64R.js";import"./ua-parser-D6QF1h5N.js";import"./base32-7iZvvdX8.js";import"./cloneDeep-YxES7wNt.js";import"./lock.svg-BOhdQlHW.js";const me="info";function Ie({createPassportSvg:c,passport:s,onCancel:p,onSwitchPassport:u=()=>{}}){const{t:f}=A(),i=qe({tab:me}),d={info:{label:f("common.basicInfo"),value:me,component:()=>e.jsx(De,{passport:s,createPassportSvg:c})},logs:{label:f("common.logs"),value:"logs",component:()=>e.jsx(ke,{passport:s})},related:{label:f("team.passport.related"),value:"related",component:()=>e.jsx(Ae,{passport:s,onSwitchPassport:u})}},l=Object.values(d).map(({label:h,value:m})=>({label:h,value:m})).filter(h=>h.value==="related"?s.parentDid:!0),r=d[i.tab]||d.info,n=h=>{i.tab=h};return e.jsx(W,{title:f("common.passport"),onClose:p,open:!0,PaperProps:{style:{maxWidth:800,minHeight:"80vh"}},fullWidth:!0,children:e.jsxs(Ss,{children:[e.jsx(t,{className:"tabs",children:e.jsx(ss,{tabs:l,current:i.tab,onChange:n,scrollButtons:"auto"})}),e.jsx(t,{className:"body",children:e.jsx(r.component,{})})]})})}Ie.propTypes={createPassportSvg:S.func.isRequired,passport:S.object.isRequired,onCancel:S.func.isRequired,onSwitchPassport:S.func};const Ss=$(t)`
2
2
  margin-top: -16px;
3
3
 
4
4
  .tabs {
@@ -9,7 +9,7 @@ import{r as b,g as We,a as $e}from"./vendor-react-DX7tU9aY.js";import{i as qe,r
9
9
  .body {
10
10
  margin-top: 24px;
11
11
  }
12
- `;function De({createPassportSvg:c,passport:s}){const{t:p,locale:u}=A(),{teamDid:f}=z(),{inService:i}=P(),d=fs(),l=[{items:[{label:p("common.role"),content:ne(s.title)},{label:p("common.did"),content:e.jsx(oe,{did:s.id})},{label:p("team.passport.status"),content:le(s.status)},{label:p("common.type"),content:e.jsx(t,{sx:{display:"flex",gap:1,flexWrap:"wrap"},children:(s.type||[]).map(n=>e.jsx(Ge,{label:n,variant:"outlined",size:"small",sx:{borderRadius:1}},n))})}]}],r=[{title:p("team.passport.owner"),items:[{label:p("team.passport.owner"),content:e.jsx(t,{children:ie(s.user,i)})}]},{title:p("common.timeInfo"),items:[{label:p("team.passport.issuanceTime"),content:s.issuanceDate?e.jsx(se,{value:s.issuanceDate,type:"all",locale:u}):"-"},{label:p("team.member.lastLogin"),content:s.lastLoginAt?e.jsx(se,{value:s.lastLoginAt,type:"all",locale:u}):"-"},{label:p("common.expires"),content:s.expirationDate?e.jsx(se,{value:s.expirationDate,type:"all",locale:u}):"-"}]},{title:p("blocklet.overview.source"),items:[{label:p("blocklet.overview.source"),content:X(s.source)}]}];return e.jsxs(Cs,{gap:3,children:[e.jsxs(t,{sx:{display:"flex",flexDirection:d?"column":"row",alignItems:d?"flex-start":"center",justifyContent:d?"center":"flex-start",width:"100%",overflow:"hidden",gap:d?2:4},children:[e.jsx(t,{sx:{display:"flex",width:"180px"},className:"passport-image",dangerouslySetInnerHTML:{__html:c({scope:s.scope,role:s.role,title:s.scope==="kyc"?s.name:s.title,issuer:s.issuer&&s.issuer.name,issuerDid:s.issuer&&s.issuer.id,ownerName:s.user?.fullName,ownerDid:s.user?.did,ownerAvatarUrl:s.user?.avatar?Se(s.user?.avatar,f,i):"",revoked:s.revoked,extra:s?.expirationDate?{key:"Exp",value:be(s.expirationDate).format("YYYY-MM-DD HH:mm:ss")}:null})}}),e.jsx(t,{className:"info-area",children:l.map(n=>e.jsxs(t,{children:[n.title&&e.jsx(O,{variant:"h6",sx:{mb:2},children:n.title}),e.jsx(t,{className:"info-grid",sx:{gap:"12px !important"},children:n.items.map(h=>e.jsxs(t,{className:"info-item",children:[e.jsx(t,{className:"info-label",sx:{maxWidth:40},children:e.jsx(O,{variant:"subtitle2",color:"textSecondary",children:h.label})}),e.jsx(t,{sx:{display:"flex",flexWrap:"wrap",gap:.5,minWidth:0},children:h.content})]},h.label))})]},n.title))})]}),e.jsx(Ke,{}),e.jsx(t,{className:"info-area",children:r.map(n=>e.jsxs(t,{children:[e.jsx(O,{variant:"h5",sx:{mb:1.5},children:n.title}),e.jsx(t,{className:"info-grid",children:n.items.map(h=>e.jsxs(t,{className:"info-item",children:[e.jsx(t,{className:"info-label",children:e.jsx(O,{variant:"subtitle2",color:"textSecondary",children:h.label})}),e.jsx(t,{sx:{minWidth:500},children:h.content})]},h.label))})]},n.title))})]})}De.propTypes={passport:S.object.isRequired,createPassportSvg:S.func.isRequired};const Cs=$(K)`
12
+ `;function De({createPassportSvg:c,passport:s}){const{t:p,locale:u}=A(),{teamDid:f}=z(),{inService:i}=P(),d=fs(),l=[{items:[{label:p("common.role"),content:ne(s.title)},{label:p("common.did"),content:e.jsx(oe,{did:s.id})},{label:p("team.passport.status"),content:le(s.status)},{label:p("common.type"),content:e.jsx(t,{sx:{display:"flex",gap:1,flexWrap:"wrap"},children:(s.type||[]).map(n=>e.jsx(Ge,{label:n,variant:"outlined",size:"small",sx:{borderRadius:1}},n))})}]}],r=[{title:p("team.passport.owner"),items:[{label:p("team.passport.owner"),content:e.jsx(t,{children:ie(s.user,i)})}]},{title:p("common.timeInfo"),items:[{label:p("team.passport.issuanceTime"),content:s.issuanceDate?e.jsx(se,{value:s.issuanceDate,type:"all",locale:u}):"-"},{label:p("team.member.lastLogin"),content:s.lastLoginAt?e.jsx(se,{value:s.lastLoginAt,type:"all",locale:u}):"-"},{label:p("common.expires"),content:s.expirationDate?e.jsx(se,{value:s.expirationDate,type:"all",locale:u}):"-"}]},{title:p("blocklet.overview.source"),items:[{label:p("blocklet.overview.source"),content:X(s.source)}]}];return e.jsxs(Cs,{gap:3,children:[e.jsxs(t,{sx:{display:"flex",flexDirection:d?"column":"row",alignItems:d?"flex-start":"center",justifyContent:d?"center":"flex-start",width:"100%",overflow:"hidden",gap:d?2:4},children:[e.jsx(t,{sx:{display:"flex",width:"180px"},className:"passport-image",dangerouslySetInnerHTML:{__html:c({scope:s.scope,role:s.role,title:s.scope==="kyc"?s.name:s.title,issuer:s.issuer&&s.issuer.name,issuerDid:s.issuer&&s.issuer.id,ownerName:s.user?.fullName,ownerDid:s.user?.did,ownerAvatarUrl:s.user?.avatar?Se(s.user?.avatar,f,i):"",revoked:s.revoked,extra:s?.expirationDate?{key:"Exp",value:be(s.expirationDate).format("YYYY-MM-DD HH:mm:ss")}:null})}}),e.jsx(t,{className:"info-area",children:l.map(n=>e.jsxs(t,{children:[n.title&&e.jsx(E,{variant:"h6",sx:{mb:2},children:n.title}),e.jsx(t,{className:"info-grid",sx:{gap:"12px !important"},children:n.items.map(h=>e.jsxs(t,{className:"info-item",children:[e.jsx(t,{className:"info-label",sx:{maxWidth:40},children:e.jsx(E,{variant:"subtitle2",color:"textSecondary",children:h.label})}),e.jsx(t,{sx:{display:"flex",flexWrap:"wrap",gap:.5,minWidth:0},children:h.content})]},h.label))})]},n.title))})]}),e.jsx(Ye,{}),e.jsx(t,{className:"info-area",children:r.map(n=>e.jsxs(t,{children:[e.jsx(E,{variant:"h5",sx:{mb:1.5},children:n.title}),e.jsx(t,{className:"info-grid",children:n.items.map(h=>e.jsxs(t,{className:"info-item",children:[e.jsx(t,{className:"info-label",children:e.jsx(E,{variant:"subtitle2",color:"textSecondary",children:h.label})}),e.jsx(t,{sx:{minWidth:500},children:h.content})]},h.label))})]},n.title))})]})}De.propTypes={passport:S.object.isRequired,createPassportSvg:S.func.isRequired};const Cs=$(Y)`
13
13
  .info-card {
14
14
  margin-bottom: 24px;
15
15
  overflow: hidden;
@@ -87,7 +87,7 @@ import{r as b,g as We,a as $e}from"./vendor-react-DX7tU9aY.js";import{i as qe,r
87
87
  margin: 0;
88
88
  }
89
89
  }
90
- `,Pe=10,ke=1;function Re({passport:c}){const{api:s}=P(),{teamDid:p}=z(),{t:u,locale:f}=A(),[i,d]=b.useState({pageSize:Pe,page:ke}),{data:l,loading:r}=Z(async()=>{const x={teamDid:p,query:{passportId:c.id},paging:{page:i.page,pageSize:i.pageSize}},a=await s.getPassportLogs({input:x});return{logs:a.passportLogs||[],total:a.paging.total}},{refreshDeps:[i.page,i.pageSize],onError:x=>D.error(x.message)}),n=b.useMemo(()=>l?.logs||[],[l?.logs]),h=x=>x.action===M.PASSPORT_LOG_ACTION.APPROVE||x.action===M.PASSPORT_LOG_ACTION.REVOKE?x?.metadata?.operator?.fullName?`${u("common.operator")}: ${x?.metadata?.operator?.fullName}`:null:x.action===M.PASSPORT_LOG_ACTION.ISSUE&&x.metadata?.action===M.PASSPORT_ISSUE_ACTION.ISSUE_ON_INVITE?x?.metadata?.inviter?.fullName?`${u("common.inviter")}: ${x?.metadata?.inviter?.fullName}`:null:`passportId: ${x.passportId}`,m=b.useMemo(()=>[{label:u("common.action"),name:"action",options:{customBodyRender:(x,{rowIndex:a})=>{const o=n[a];return e.jsx(G,{title:h(o),children:`${x} ${o.metadata?.action?`(${o.metadata.action})`:""}`})}}},{label:"IP",name:"operatorIp",options:{customBodyRender:x=>e.jsx(t,{sx:{display:"flex",alignItems:"center",gap:1},children:e.jsx("span",{children:x||"-"})})}},{label:"UA",width:250,name:"operatorUa",options:{customBodyRender:(x,{rowIndex:a})=>{const o=n[a];return e.jsxs(t,{sx:{display:"flex",alignItems:"center",gap:1},children:[o.operatorUa&&e.jsx(t,{children:ps(o.operatorUa)}),o.operatorUa&&e.jsx(G,{title:o.operatorUa,children:e.jsx(He,{fontSize:"small",color:"action",sx:{fontSize:16,cursor:"pointer"}})})]})}}},{label:u("common.createdAt"),name:"createdAt",options:{customBodyRender:x=>ns(x,f)}}],[u,f,n]),g=({page:x,rowsPerPage:a})=>{i.pageSize!==a?d(o=>({...o,pageSize:a,page:1})):i.page!==x+1&&d(o=>({...o,page:x+1}))},w={sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,search:!1,page:i.page-1,rowsPerPage:i.pageSize,count:l?.total||0};return r?e.jsx(t,{sx:{py:2},children:e.jsx(K,{direction:"row",spacing:1,sx:{position:"relative",pb:2},children:e.jsx(F,{})})}):e.jsx(t,{children:e.jsx(ae,{className:"logs-table",verticalKeyWidth:100,locale:f,data:n,columns:m,options:w,loading:r,onChange:g})})}Re.propTypes={passport:S.object.isRequired};function Ae({passport:c,onSwitchPassport:s}){const{api:p}=P(),{teamDid:u}=z(),{t:f,locale:i}=A(),[d,l]=b.useState({pageSize:Pe,page:ke}),{data:r,loading:n}=Z(async()=>{const a={teamDid:u,passportId:c.parentDid,paging:{page:d.page,pageSize:d.pageSize}},o=await p.getRelatedPassports({input:a});return{passports:o.passports||[],total:o.paging.total}},{refreshDeps:[d.page,d.pageSize],onError:a=>D.error(a.message)}),h=b.useMemo(()=>r?.passports||[],[r?.passports]),m=b.useMemo(()=>[{label:f("team.passport.role"),name:"role",options:{customBodyRender:ne}},{label:f("team.passport.owner"),name:"user",options:{customBodyRender:ie}},{label:f("team.passport.status"),name:"status",options:{customBodyRender:le}},{label:f("team.member.lastLogin"),name:"lastLoginAt",options:{customBodyRender:a=>ve(a,i)}},{label:f("blocklet.overview.source"),name:"source",options:{customBodyRender:X}}],[f,i]),g=({page:a,rowsPerPage:o})=>{d.pageSize!==o?l(v=>({...v,pageSize:o,page:1})):d.page!==a+1&&l(v=>({...v,page:a+1}))},w=b.useRef(null),x={sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,search:!1,page:d.page-1,rowsPerPage:d.pageSize,count:r?.total||0,onRowClick(a,{dataIndex:o},v){if(w.current?.contains(v.target)){const j=h[o];s(j)}}};return n?e.jsx(t,{sx:{py:2},children:e.jsx(K,{direction:"row",spacing:1,sx:{position:"relative",pb:2},children:e.jsx(F,{})})}):e.jsxs(K,{spacing:1,children:[e.jsx(Ue,{severity:"warning",children:f("team.passport.relatedDescription")}),e.jsx(t,{ref:w,sx:{".MuiTableRow-root":{cursor:"pointer"}},children:e.jsx(ae,{className:"related-table",verticalKeyWidth:100,locale:i,data:h.filter(a=>a.id!==c.id),columns:m,options:x,loading:n,onChange:g})})]})}Ae.propTypes={passport:S.object.isRequired,onSwitchPassport:S.func.isRequired};function de({onCancel:c,onSuccess:s}){const{api:p}=P(),{blocklet:u}=is(),{t:f}=A(),[i,d]=b.useState(!1),l=(u.environments.find(g=>g.key==="BLOCKLET_PASSPORT_COLOR")||{}).value||"auto",r=l==="auto"?ys(u.appDid):l,[n,h]=b.useState(r),m=async()=>{const g=[{key:cs.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_PASSPORT_COLOR,value:n}];try{d(!0),await p.configBlocklet({input:{did:u.meta.did,configs:g}}),s()}catch(w){D.error(w.message)}finally{d(!1)}};return e.jsx(W,{title:f("team.passport.color"),onClose:c,open:!0,fullWidth:!0,actions:e.jsxs(e.Fragment,{children:[e.jsx(N,{onClick:c,color:"inherit",children:f("common.cancel")}),e.jsxs(N,{onClick:m,color:"primary",disabled:i,variant:"contained",autoFocus:!0,"data-cy":"color-btn-confirm",children:[i&&e.jsx(F,{size:16}),f("common.save")]})]}),children:e.jsxs(t,{className:"dialog-content",sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:[e.jsx(hs,{disableAlpha:!0,color:n,onChange:g=>h(g.hex)}),e.jsx("div",{style:{width:220,marginLeft:24},dangerouslySetInnerHTML:{__html:gs({scope:"passport",role:"owner",title:"Owner",issuer:ls.getDisplayName(u),issuerDid:u.appDid,ownerName:"Your Name",ownerDid:u.appDid,preferredColor:n})}})]})})}const Ts=q(de,"mutate_team"),ws=q(de,"",J);function Is(c){const{inService:s}=P();return s?e.jsx(ws,{...c}):e.jsx(Ts,{...c})}de.propTypes={onCancel:S.func.isRequired,onSuccess:S.func.isRequired};var Le=function(s){return e.jsx("svg",{...s,children:e.jsx("path",{d:"M64.707 8.707a1 1 0 0 0 0-1.414L58.343.929a1 1 0 1 0-1.414 1.414L62.586 8l-5.657 5.657a1 1 0 0 0 1.414 1.414l6.364-6.364ZM0 9h64V7H0v2Z",fill:"#666"})})};Le.defaultProps={width:"65",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg"};const Ds=(c,s)=>c?!s.some(p=>!p.from.passport||!p.to.role):!1;function Ne({onCancel:c,onSuccess:s,data:p={},trustedPassports:u=[]}){const{api:f}=P(),{roles:i,teamDid:d}=z(),{t:l}=A(),[r,n]=b.useState(!1),[h,m]=b.useState(p.issuerDid||""),[g,w]=b.useState(p.remark||""),[x,a]=b.useState(Y(p.mappings)||[]),o=u.findIndex(j=>j.issuerDid===p.issuerDid),v=async()=>{if(r)return;const j={issuerDid:h,remark:g,mappings:x.map(T=>({...T,to:{...T.to,ttl:T.to.ttl||0}}))},C=[...u];o===-1?C.unshift(j):C[o]=j;try{n(!0),await f.configTrustedPassports({input:{teamDid:d,trustedPassports:C}}),await V(800),n(!1),D.success(l("common.saveSuccess")),s()}catch(T){n(!1),D.error(te(T))}};return e.jsx(W,{title:l("team.passport.trustedIssuers"),open:!0,showCloseButton:!1,PaperProps:{style:{minHeight:"80vh"}},fullWidth:!0,prepend:e.jsx(_,{onClick:c,"data-cy":"trusted-issuer-close",size:"large",children:e.jsx(ge,{})}),actions:e.jsxs(e.Fragment,{children:[e.jsx(N,{onClick:c,color:"inherit",children:l("common.cancel")}),e.jsxs(N,{onClick:()=>v(),color:"primary",disabled:!Ds(h,x)||!g||r,variant:"contained",autoFocus:!0,"data-cy":"save-mapping",children:[r&&e.jsx(F,{size:16}),l("common.save")]})]}),children:e.jsx(Ps,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx(E,{fullWidth:!0,"data-cy":"input-issuer-did",placeholder:l("team.passport.issuerDid"),value:h,onChange:j=>{m(j.target.value)}}),e.jsx(E,{style:{marginTop:16},fullWidth:!0,"data-cy":"input-issuer-remark",placeholder:l("common.remark"),value:g,onChange:j=>{w(j.target.value)}}),e.jsxs(t,{sx:{mt:"30px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsx(t,{className:"dialog-h1",children:l("team.passport.mappingRule")}),e.jsx(t,{children:e.jsx(N,{variant:"outlined",color:"primary","data-cy":"add-mapping",onClick:()=>{a(j=>{const C=[...j];return C.unshift({from:{passport:""},to:{role:M.ROLES.GUEST}}),C})},children:l("team.add")})})]}),e.jsxs(t,{className:"list",sx:{mt:-.5},children:[x.map((j,C)=>e.jsxs(t,{className:"mapping-item",sx:{display:"flex",alignItems:"center",justifyContent:"space-between",my:1},children:[e.jsxs(t,{sx:{display:"flex",alignItems:"center",flexGrow:1},children:[e.jsx(t,{sx:{flexGrow:1,flexBasis:1},children:e.jsx(E,{fullWidth:!0,size:"small","data-cy":`input-${C}-from`,placeholder:"Issuer’s Passport Name/ID *",value:j.from.passport,onChange:T=>{const{value:k}=T.target;a(L=>{const U=[...L];return U[C].from.passport=k,U})},sx:{"& .MuiInputBase-input::placeholder":{fontSize:14},"& .Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"primary.main"}}})}),e.jsx(t,{sx:{flexShrink:0,mx:1,width:65,height:16},children:e.jsx(Le,{})}),e.jsx(t,{sx:{flexGrow:1,flexBasis:1},children:e.jsx(E,{fullWidth:!0,size:"small",select:!0,value:j.to.role,onChange:T=>{a(k=>{const L=[...k];return L[C].to.role=T.target.value,L})},variant:"outlined",children:i.filter(T=>T.name!=="owner").map(T=>e.jsx(Q,{value:T.name,"data-cy":`passport-mapping-select-option-${T.name}`,children:e.jsx("span",{children:T.title||T.name})},T.name))})})]}),e.jsx(t,{sx:{flexShrink:0},children:e.jsx(_,{onClick:()=>{a(T=>{const k=[...T];return k.splice(C,1),k})},size:"large",children:e.jsx(ce,{})})})]},`mapping-${C}`)),!x.length&&e.jsx(t,{sx:{my:2,color:"text.secondary",fontSize:"16px"},children:e.jsx(re,{children:l("common.empty")})})]})]})})})}Ne.propTypes={onCancel:S.func.isRequired,onSuccess:S.func.isRequired,trustedPassports:S.array,data:S.object};const Ps=$.div`
90
+ `,Pe=10,Re=1;function ke({passport:c}){const{api:s}=P(),{teamDid:p}=z(),{t:u,locale:f}=A(),[i,d]=b.useState({pageSize:Pe,page:Re}),{data:l,loading:r}=Z(async()=>{const x={teamDid:p,query:{passportId:c.id},paging:{page:i.page,pageSize:i.pageSize}},a=await s.getPassportLogs({input:x});return{logs:a.passportLogs||[],total:a.paging.total}},{refreshDeps:[i.page,i.pageSize],onError:x=>D.error(x.message)}),n=b.useMemo(()=>l?.logs||[],[l?.logs]),h=x=>x.action===M.PASSPORT_LOG_ACTION.APPROVE||x.action===M.PASSPORT_LOG_ACTION.REVOKE?x?.metadata?.operator?.fullName?`${u("common.operator")}: ${x?.metadata?.operator?.fullName}`:null:x.action===M.PASSPORT_LOG_ACTION.ISSUE&&x.metadata?.action===M.PASSPORT_ISSUE_ACTION.ISSUE_ON_INVITE?x?.metadata?.inviter?.fullName?`${u("common.inviter")}: ${x?.metadata?.inviter?.fullName}`:null:`passportId: ${x.passportId}`,m=b.useMemo(()=>[{label:u("common.action"),name:"action",options:{customBodyRender:(x,{rowIndex:a})=>{const o=n[a];return e.jsx(G,{title:h(o),children:`${x} ${o.metadata?.action?`(${o.metadata.action})`:""}`})}}},{label:"IP",name:"operatorIp",options:{customBodyRender:x=>e.jsx(t,{sx:{display:"flex",alignItems:"center",gap:1},children:e.jsx("span",{children:x||"-"})})}},{label:"UA",width:250,name:"operatorUa",options:{customBodyRender:(x,{rowIndex:a})=>{const o=n[a];return e.jsxs(t,{sx:{display:"flex",alignItems:"center",gap:1},children:[o.operatorUa&&e.jsx(t,{children:ps(o.operatorUa)}),o.operatorUa&&e.jsx(G,{title:o.operatorUa,children:e.jsx(He,{fontSize:"small",color:"action",sx:{fontSize:16,cursor:"pointer"}})})]})}}},{label:u("common.createdAt"),name:"createdAt",options:{customBodyRender:x=>ns(x,f)}}],[u,f,n]),g=({page:x,rowsPerPage:a})=>{i.pageSize!==a?d(o=>({...o,pageSize:a,page:1})):i.page!==x+1&&d(o=>({...o,page:x+1}))},w={sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,search:!1,page:i.page-1,rowsPerPage:i.pageSize,count:l?.total||0};return r?e.jsx(t,{sx:{py:2},children:e.jsx(Y,{direction:"row",spacing:1,sx:{position:"relative",pb:2},children:e.jsx(F,{})})}):e.jsx(t,{children:e.jsx(ae,{className:"logs-table",verticalKeyWidth:100,locale:f,data:n,columns:m,options:w,loading:r,onChange:g})})}ke.propTypes={passport:S.object.isRequired};function Ae({passport:c,onSwitchPassport:s}){const{api:p}=P(),{teamDid:u}=z(),{t:f,locale:i}=A(),[d,l]=b.useState({pageSize:Pe,page:Re}),{data:r,loading:n}=Z(async()=>{const a={teamDid:u,passportId:c.parentDid,paging:{page:d.page,pageSize:d.pageSize}},o=await p.getRelatedPassports({input:a});return{passports:o.passports||[],total:o.paging.total}},{refreshDeps:[d.page,d.pageSize],onError:a=>D.error(a.message)}),h=b.useMemo(()=>r?.passports||[],[r?.passports]),m=b.useMemo(()=>[{label:f("team.passport.role"),name:"role",options:{customBodyRender:ne}},{label:f("team.passport.owner"),name:"user",options:{customBodyRender:ie}},{label:f("team.passport.status"),name:"status",options:{customBodyRender:le}},{label:f("team.member.lastLogin"),name:"lastLoginAt",options:{customBodyRender:a=>ve(a,i)}},{label:f("blocklet.overview.source"),name:"source",options:{customBodyRender:X}}],[f,i]),g=({page:a,rowsPerPage:o})=>{d.pageSize!==o?l(v=>({...v,pageSize:o,page:1})):d.page!==a+1&&l(v=>({...v,page:a+1}))},w=b.useRef(null),x={sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,search:!1,page:d.page-1,rowsPerPage:d.pageSize,count:r?.total||0,onRowClick(a,{dataIndex:o},v){if(w.current?.contains(v.target)){const j=h[o];s(j)}}};return n?e.jsx(t,{sx:{py:2},children:e.jsx(Y,{direction:"row",spacing:1,sx:{position:"relative",pb:2},children:e.jsx(F,{})})}):e.jsxs(Y,{spacing:1,children:[e.jsx(Ue,{severity:"warning",children:f("team.passport.relatedDescription")}),e.jsx(t,{ref:w,sx:{".MuiTableRow-root":{cursor:"pointer"}},children:e.jsx(ae,{className:"related-table",verticalKeyWidth:100,locale:i,data:h.filter(a=>a.id!==c.id),columns:m,options:x,loading:n,onChange:g})})]})}Ae.propTypes={passport:S.object.isRequired,onSwitchPassport:S.func.isRequired};function de({onCancel:c,onSuccess:s}){const{api:p}=P(),{blocklet:u}=is(),{t:f}=A(),[i,d]=b.useState(!1),l=(u.environments.find(g=>g.key==="BLOCKLET_PASSPORT_COLOR")||{}).value||"auto",r=l==="auto"?ys(u.appDid):l,[n,h]=b.useState(r),m=async()=>{const g=[{key:cs.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_PASSPORT_COLOR,value:n}];try{d(!0),await p.configBlocklet({input:{did:u.meta.did,configs:g}}),s()}catch(w){D.error(w.message)}finally{d(!1)}};return e.jsx(W,{title:f("team.passport.color"),onClose:c,open:!0,fullWidth:!0,actions:e.jsxs(e.Fragment,{children:[e.jsx(N,{onClick:c,color:"inherit",children:f("common.cancel")}),e.jsxs(N,{onClick:m,color:"primary",disabled:i,variant:"contained",autoFocus:!0,"data-cy":"color-btn-confirm",children:[i&&e.jsx(F,{size:16}),f("common.save")]})]}),children:e.jsxs(t,{className:"dialog-content",sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:[e.jsx(hs,{disableAlpha:!0,color:n,onChange:g=>h(g.hex)}),e.jsx("div",{style:{width:220,marginLeft:24},dangerouslySetInnerHTML:{__html:gs({scope:"passport",role:"owner",title:"Owner",issuer:ls.getDisplayName(u),issuerDid:u.appDid,ownerName:"Your Name",ownerDid:u.appDid,preferredColor:n})}})]})})}const Ts=q(de,"mutate_team"),ws=q(de,"",J);function Is(c){const{inService:s}=P();return s?e.jsx(ws,{...c}):e.jsx(Ts,{...c})}de.propTypes={onCancel:S.func.isRequired,onSuccess:S.func.isRequired};var Le=function(s){return e.jsx("svg",{...s,children:e.jsx("path",{d:"M64.707 8.707a1 1 0 0 0 0-1.414L58.343.929a1 1 0 1 0-1.414 1.414L62.586 8l-5.657 5.657a1 1 0 0 0 1.414 1.414l6.364-6.364ZM0 9h64V7H0v2Z",fill:"#666"})})};Le.defaultProps={width:"65",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg"};const Ds=(c,s)=>c?!s.some(p=>!p.from.passport||!p.to.role):!1;function Ne({onCancel:c,onSuccess:s,data:p={},trustedPassports:u=[]}){const{api:f}=P(),{roles:i,teamDid:d}=z(),{t:l}=A(),[r,n]=b.useState(!1),[h,m]=b.useState(p.issuerDid||""),[g,w]=b.useState(p.remark||""),[x,a]=b.useState(K(p.mappings)||[]),o=u.findIndex(j=>j.issuerDid===p.issuerDid),v=async()=>{if(r)return;const j={issuerDid:h,remark:g,mappings:x.map(T=>({...T,to:{...T.to,ttl:T.to.ttl||0}}))},C=[...u];o===-1?C.unshift(j):C[o]=j;try{n(!0),await f.configTrustedPassports({input:{teamDid:d,trustedPassports:C}}),await V(800),n(!1),D.success(l("common.saveSuccess")),s()}catch(T){n(!1),D.error(te(T))}};return e.jsx(W,{title:l("team.passport.trustedIssuers"),open:!0,showCloseButton:!1,PaperProps:{style:{minHeight:"80vh"}},fullWidth:!0,prepend:e.jsx(_,{onClick:c,"data-cy":"trusted-issuer-close",size:"large",children:e.jsx(ge,{})}),actions:e.jsxs(e.Fragment,{children:[e.jsx(N,{onClick:c,color:"inherit",children:l("common.cancel")}),e.jsxs(N,{onClick:()=>v(),color:"primary",disabled:!Ds(h,x)||!g||r,variant:"contained",autoFocus:!0,"data-cy":"save-mapping",children:[r&&e.jsx(F,{size:16}),l("common.save")]})]}),children:e.jsx(Ps,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx(O,{fullWidth:!0,"data-cy":"input-issuer-did",placeholder:l("team.passport.issuerDid"),value:h,onChange:j=>{m(j.target.value)}}),e.jsx(O,{style:{marginTop:16},fullWidth:!0,"data-cy":"input-issuer-remark",placeholder:l("common.remark"),value:g,onChange:j=>{w(j.target.value)}}),e.jsxs(t,{sx:{mt:"30px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsx(t,{className:"dialog-h1",children:l("team.passport.mappingRule")}),e.jsx(t,{children:e.jsx(N,{variant:"outlined",color:"primary","data-cy":"add-mapping",onClick:()=>{a(j=>{const C=[...j];return C.unshift({from:{passport:""},to:{role:M.ROLES.GUEST}}),C})},children:l("team.add")})})]}),e.jsxs(t,{className:"list",sx:{mt:-.5},children:[x.map((j,C)=>e.jsxs(t,{className:"mapping-item",sx:{display:"flex",alignItems:"center",justifyContent:"space-between",my:1},children:[e.jsxs(t,{sx:{display:"flex",alignItems:"center",flexGrow:1},children:[e.jsx(t,{sx:{flexGrow:1,flexBasis:1},children:e.jsx(O,{fullWidth:!0,size:"small","data-cy":`input-${C}-from`,placeholder:"Issuer’s Passport Name/ID *",value:j.from.passport,onChange:T=>{const{value:R}=T.target;a(L=>{const U=[...L];return U[C].from.passport=R,U})},sx:{"& .MuiInputBase-input::placeholder":{fontSize:14},"& .Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"primary.main"}}})}),e.jsx(t,{sx:{flexShrink:0,mx:1,width:65,height:16},children:e.jsx(Le,{})}),e.jsx(t,{sx:{flexGrow:1,flexBasis:1},children:e.jsx(O,{fullWidth:!0,size:"small",select:!0,value:j.to.role,onChange:T=>{a(R=>{const L=[...R];return L[C].to.role=T.target.value,L})},variant:"outlined",children:i.filter(T=>T.name!=="owner").map(T=>e.jsx(Q,{value:T.name,"data-cy":`passport-mapping-select-option-${T.name}`,children:e.jsx("span",{children:T.title||T.name})},T.name))})})]}),e.jsx(t,{sx:{flexShrink:0},children:e.jsx(_,{onClick:()=>{a(T=>{const R=[...T];return R.splice(C,1),R})},size:"large",children:e.jsx(ce,{})})})]},`mapping-${C}`)),!x.length&&e.jsx(t,{sx:{my:2,color:"text.secondary",fontSize:"16px"},children:e.jsx(re,{children:l("common.empty")})})]})]})})})}Ne.propTypes={onCancel:S.func.isRequired,onSuccess:S.func.isRequired,trustedPassports:S.array,data:S.object};const Ps=$.div`
91
91
  .dialog-h1 {
92
92
  font-size: 18px;
93
93
  }
@@ -99,7 +99,7 @@ import{r as b,g as We,a as $e}from"./vendor-react-DX7tU9aY.js";import{i as qe,r
99
99
  }
100
100
  }
101
101
  }
102
- `;function pe({onCancel:c,hasPermission:s=!1}){const{api:p}=P(),{teamDid:u,trustedPassports:f}=z(),{t:i}=A(),[d,l]=b.useState(null),[r,n]=b.useState(!1),[h,m]=b.useState(!1),[g,w]=b.useState(""),x=async o=>{if(r)return;const v=f.findIndex(C=>C.issuerDid===o);v===-1&&D.error("Cannot find passports");const j=[...f];j.splice(v,1);try{n(!0),await p.configTrustedPassports({input:{teamDid:u,trustedPassports:j}}),await V(800),n(!1),D.success(i("common.saveSuccess")),l(!1)}catch(C){n(!1),D.error(C.message)}},a=f.filter(o=>!g||o.issuerDid.toLowerCase().includes(g.toLowerCase()));return e.jsxs(W,{title:i("team.passport.trustedIssuers"),open:!0,onClose:c,fullWidth:!0,PaperProps:{style:{minHeight:"80vh"}},children:[e.jsx(Ls,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx("div",{className:"dialog-h1",children:i("team.passport.trustedPassportIssuers")}),e.jsx(we,{sx:{mt:3},actions:e.jsxs(e.Fragment,{children:[e.jsx(je,{options:{searchPlaceholder:i("team.passport.searchIssuerDid"),searchDebounceTime:600},search:g,searchText:g,searchTextUpdate:w,searchClose:()=>w(""),onSearchOpen:()=>{}}),s&&e.jsxs(N,{variant:"contained",color:"primary","data-cy":"add-trusted-issuer",onClick:()=>m({mode:"add"}),children:[e.jsx(ye,{style:{fontSize:16,marginRight:4}}),i("team.add")]})]})}),e.jsxs("div",{className:"list",children:[a.map(o=>e.jsxs(t,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mt:"20px"},children:[e.jsxs(t,{sx:{flexShrink:0},children:[e.jsx(oe,{copyable:!1,size:16,did:ts(o.issuerDid),showDidLogo:!1}),!!o.remark&&e.jsx(t,{sx:{fontSize:12,maxWidth:"300px"},children:o.remark})]}),e.jsx(t,{sx:{color:"gray",ml:"28px",flexGrow:1},children:o.mappings&&o.mappings.length?`${o.mappings.length} ${i("team.passport.mappingRule")}`:i("team.passport.defaultRule")}),e.jsxs(t,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:[e.jsx(_,{onClick:()=>m({mode:"update",data:Y(o)}),"data-cy":"edit-mapping-rule",size:"large",children:e.jsx(Ce,{})}),e.jsx(_,{"data-cy":"delete-mapping-rule",onClick:()=>l({title:i("common.delete"),description:i("common.delConfirmDescription",{data:o.issuerDid}),confirm:i("common.delConfirm"),cancel:i("common.cancel"),onConfirm:()=>x(o.issuerDid),onCancel:()=>{n(!1),l(null)}}),size:"large",children:e.jsx(ce,{})})]})]},o.issuerDid)),!f.length&&e.jsx(re,{children:i("common.empty")})]})]})}),h&&e.jsx(Ne,{mode:h.mode,data:h.data,trustedPassports:Y(f),onCancel:()=>m(null),onSuccess:()=>{m(null)}}),d&&e.jsx(Te,{title:d.title,description:d.description,confirm:d.confirm,cancel:d.cancel,params:d.params,onConfirm:d.onConfirm,onCancel:d.onCancel})]})}pe.propTypes={onCancel:S.func.isRequired,hasPermission:S.bool};const ks=q(pe,"mutate_team"),Rs=q(pe,"",J);function As(c){const{inService:s}=P();return s?e.jsx(Rs,{...c}):e.jsx(ks,{...c})}const Ls=$.div`
102
+ `;function pe({onCancel:c,hasPermission:s=!1}){const{api:p}=P(),{teamDid:u,trustedPassports:f}=z(),{t:i}=A(),[d,l]=b.useState(null),[r,n]=b.useState(!1),[h,m]=b.useState(!1),[g,w]=b.useState(""),x=async o=>{if(r)return;const v=f.findIndex(C=>C.issuerDid===o);v===-1&&D.error("Cannot find passports");const j=[...f];j.splice(v,1);try{n(!0),await p.configTrustedPassports({input:{teamDid:u,trustedPassports:j}}),await V(800),n(!1),D.success(i("common.saveSuccess")),l(!1)}catch(C){n(!1),D.error(C.message)}},a=f.filter(o=>!g||o.issuerDid.toLowerCase().includes(g.toLowerCase()));return e.jsxs(W,{title:i("team.passport.trustedIssuers"),open:!0,onClose:c,fullWidth:!0,PaperProps:{style:{minHeight:"80vh"}},children:[e.jsx(Ls,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx("div",{className:"dialog-h1",children:i("team.passport.trustedPassportIssuers")}),e.jsx(we,{sx:{mt:3},actions:e.jsxs(e.Fragment,{children:[e.jsx(je,{options:{searchPlaceholder:i("team.passport.searchIssuerDid"),searchDebounceTime:600},search:g,searchText:g,searchTextUpdate:w,searchClose:()=>w(""),onSearchOpen:()=>{}}),s&&e.jsxs(N,{variant:"contained",color:"primary","data-cy":"add-trusted-issuer",onClick:()=>m({mode:"add"}),children:[e.jsx(ye,{style:{fontSize:16,marginRight:4}}),i("team.add")]})]})}),e.jsxs("div",{className:"list",children:[a.map(o=>e.jsxs(t,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mt:"20px"},children:[e.jsxs(t,{sx:{flexShrink:0},children:[e.jsx(oe,{copyable:!1,size:16,did:ts(o.issuerDid),showDidLogo:!1}),!!o.remark&&e.jsx(t,{sx:{fontSize:12,maxWidth:"300px"},children:o.remark})]}),e.jsx(t,{sx:{color:"gray",ml:"28px",flexGrow:1},children:o.mappings&&o.mappings.length?`${o.mappings.length} ${i("team.passport.mappingRule")}`:i("team.passport.defaultRule")}),e.jsxs(t,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:[e.jsx(_,{onClick:()=>m({mode:"update",data:K(o)}),"data-cy":"edit-mapping-rule",size:"large",children:e.jsx(Ce,{})}),e.jsx(_,{"data-cy":"delete-mapping-rule",onClick:()=>l({title:i("common.delete"),description:i("common.delConfirmDescription",{data:o.issuerDid}),confirm:i("common.delConfirm"),cancel:i("common.cancel"),onConfirm:()=>x(o.issuerDid),onCancel:()=>{n(!1),l(null)}}),size:"large",children:e.jsx(ce,{})})]})]},o.issuerDid)),!f.length&&e.jsx(re,{children:i("common.empty")})]})]})}),h&&e.jsx(Ne,{mode:h.mode,data:h.data,trustedPassports:K(f),onCancel:()=>m(null),onSuccess:()=>{m(null)}}),d&&e.jsx(Te,{title:d.title,description:d.description,confirm:d.confirm,cancel:d.cancel,params:d.params,onConfirm:d.onConfirm,onCancel:d.onCancel})]})}pe.propTypes={onCancel:S.func.isRequired,hasPermission:S.bool};const Rs=q(pe,"mutate_team"),ks=q(pe,"",J);function As(c){const{inService:s}=P();return s?e.jsx(ks,{...c}):e.jsx(Rs,{...c})}const Ls=$.div`
103
103
  .list {
104
104
  .MuiIconButton-root {
105
105
  svg {
@@ -107,7 +107,7 @@ import{r as b,g as We,a as $e}from"./vendor-react-DX7tU9aY.js";import{i as qe,r
107
107
  }
108
108
  }
109
109
  }
110
- `;var Ns=js();const fe=We(Ns);function ze({onCancel:c,onSuccess:s,data:p={},trustedFactories:u=[]}){const{api:f}=P(),{roles:i,teamDid:d}=z(),{t:l}=A(),[r,n]=vs({loading:!1,fetching:!1,fetched:[],errored:[],factoryAddress:p.factoryAddress||"",remark:p.remark||"",role:p.passport?.role||"member",ttlPolicy:p.passport?.ttlPolicy||"never",ttl:fe(+p.passport?.ttl||365*24*60*60*1e3),error:""}),h=u.findIndex(a=>a.factoryAddress===p.factoryAddress),m=async()=>{if(r.loading)return;const{factoryAddress:a,remark:o,role:v,ttlPolicy:j,ttl:C}=r,T={factoryAddress:a,remark:o,passport:{role:v,ttlPolicy:j,ttl:j==="never"?0:fe(C)}},k=[...u];h===-1?k.unshift(T):k[h]=T;try{n({loading:!0}),await f.configTrustedFactories({input:{teamDid:d,trustedFactories:k}}),await V(800),D.success(l("common.saveSuccess")),s()}catch(L){console.error(L),D.error(te(L))}finally{n({loading:!1})}};b.useEffect(()=>{const a=r.fetched.find(v=>v.address===r.factoryAddress),o=r.errored.find(v=>v.address===r.factoryAddress);as(r.factoryAddress)&&!r.fetching&&!a&&!o&&(n({fetching:!0}),ds(M.MAIN_CHAIN_ENDPOINT).getFactoryState({address:r.factoryAddress}).then(j=>{j.state?n({fetching:!1,fetched:[...r.fetched.filter(C=>C.address!==r.factoryAddress),j.state],remark:j.state.name}):n({fetching:!1,errored:[...r.errored.filter(C=>C.address!==r.factoryAddress),{address:r.factoryAddress}],error:l("team.passport.factory404",r)})}).catch(j=>{console.error(j),n({fetching:!1,error:te(j)})}))},[r.factoryAddress,r.fetching]);let g=r.error;const w=r.factoryAddress?r.errored.find(a=>a.address===r.factoryAddress):null;!g&&w&&(g=l("team.passport.factory404",r));const x=r.factoryAddress?r.fetched.find(a=>a.address===r.factoryAddress):null;return!g&&x&&(g=x.description),g||(g=l("team.passport.factoryAddressTip")),e.jsx(W,{title:l("team.passport.trustedFactories"),open:!0,showCloseButton:!1,PaperProps:{style:{minHeight:"80vh"}},fullWidth:!0,prepend:e.jsx(_,{onClick:c,"data-cy":"close-trusted-factory",size:"large",children:e.jsx(ge,{})}),actions:e.jsxs(e.Fragment,{children:[e.jsx(N,{onClick:c,color:"inherit",children:l("common.cancel")}),e.jsxs(N,{onClick:()=>m(),color:"primary",disabled:!r.factoryAddress||!r.remark||!r.role||r.loading||r.error||w,variant:"contained",autoFocus:!0,"data-cy":"save-trusted-factory",children:[r.loading&&e.jsx(F,{size:16}),l("common.save")]})]}),children:e.jsx(zs,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx(E,{fullWidth:!0,error:!!r.error||!!w,"data-cy":"input-factory-address",label:l("team.passport.factoryAddress"),helperText:g,value:r.factoryAddress,onChange:a=>{n({factoryAddress:a.target.value,error:""})},slotProps:{input:{endAdornment:r.fetching?e.jsx(Ye,{position:"end",children:e.jsx(F,{size:16})}):null}}}),e.jsx(E,{style:{marginTop:32},fullWidth:!0,"data-cy":"input-factory-remark",label:l("common.remark"),value:r.remark,onChange:a=>{n({remark:a.target.value})}}),e.jsx(E,{style:{marginTop:32},fullWidth:!0,"data-cy":"input-passport-role",label:l("team.passport.role"),select:!0,value:r.role,onChange:a=>{n({role:a.target.value})},variant:"outlined",children:i.filter(a=>a.name!=="owner").map(a=>e.jsx(Q,{value:a.name,"data-cy":`passport-role-select-option-${a.name}`,children:e.jsx("span",{children:a.title||a.name})},a.name))}),e.jsxs("div",{style:{marginTop:32},children:[e.jsx(Ve,{children:l("team.passport.ttl")}),e.jsxs(Ze,{color:"primary",size:"small",value:r.ttlPolicy,exclusive:!0,style:{marginTop:16},onChange:(a,o)=>n({ttlPolicy:o}),"data-cy":"input-passport-ttl-since","aria-label":"Expire Policy",children:[e.jsx(ee,{value:"never","data-cy":"input-passport-ttl-never",children:e.jsx(G,{title:l("team.passport.ttlNeverTip"),children:e.jsx(O,{children:l("team.passport.ttlNever")})})}),e.jsx(ee,{value:"mint","data-cy":"input-passport-ttl-mint",children:e.jsx(G,{title:l("team.passport.ttlMintTip"),children:e.jsx(O,{children:l("team.passport.ttlMint")})})}),e.jsx(ee,{value:"exchange","data-cy":"input-passport-ttl-exchange",children:e.jsx(G,{title:l("team.passport.ttlExchangeTip"),children:e.jsx(O,{children:l("team.passport.ttlExchange")})})})]}),r.ttlPolicy!=="never"&&e.jsxs(e.Fragment,{children:[e.jsx(Qe,{fullWidth:!0,type:"text",style:{marginTop:16},"data-cy":"input-passport-ttl",value:r.ttl,onChange:a=>{n({ttl:a.target.value})}}),e.jsx(Xe,{children:l("team.passport.ttlTip")})]})]})]})})})}ze.propTypes={onCancel:S.func.isRequired,onSuccess:S.func.isRequired,trustedFactories:S.array,data:S.object};const zs=$.div`
110
+ `;var Ns=js();const fe=We(Ns);function ze({onCancel:c,onSuccess:s,data:p={},trustedFactories:u=[]}){const{api:f}=P(),{roles:i,teamDid:d}=z(),{t:l}=A(),[r,n]=vs({loading:!1,fetching:!1,fetched:[],errored:[],factoryAddress:p.factoryAddress||"",remark:p.remark||"",role:p.passport?.role||"member",ttlPolicy:p.passport?.ttlPolicy||"never",ttl:fe(+p.passport?.ttl||365*24*60*60*1e3),error:""}),h=u.findIndex(a=>a.factoryAddress===p.factoryAddress),m=async()=>{if(r.loading)return;const{factoryAddress:a,remark:o,role:v,ttlPolicy:j,ttl:C}=r,T={factoryAddress:a,remark:o,passport:{role:v,ttlPolicy:j,ttl:j==="never"?0:fe(C)}},R=[...u];h===-1?R.unshift(T):R[h]=T;try{n({loading:!0}),await f.configTrustedFactories({input:{teamDid:d,trustedFactories:R}}),await V(800),D.success(l("common.saveSuccess")),s()}catch(L){console.error(L),D.error(te(L))}finally{n({loading:!1})}};b.useEffect(()=>{const a=r.fetched.find(v=>v.address===r.factoryAddress),o=r.errored.find(v=>v.address===r.factoryAddress);as(r.factoryAddress)&&!r.fetching&&!a&&!o&&(n({fetching:!0}),ds(M.MAIN_CHAIN_ENDPOINT).getFactoryState({address:r.factoryAddress}).then(j=>{j.state?n({fetching:!1,fetched:[...r.fetched.filter(C=>C.address!==r.factoryAddress),j.state],remark:j.state.name}):n({fetching:!1,errored:[...r.errored.filter(C=>C.address!==r.factoryAddress),{address:r.factoryAddress}],error:l("team.passport.factory404",r)})}).catch(j=>{console.error(j),n({fetching:!1,error:te(j)})}))},[r.factoryAddress,r.fetching]);let g=r.error;const w=r.factoryAddress?r.errored.find(a=>a.address===r.factoryAddress):null;!g&&w&&(g=l("team.passport.factory404",r));const x=r.factoryAddress?r.fetched.find(a=>a.address===r.factoryAddress):null;return!g&&x&&(g=x.description),g||(g=l("team.passport.factoryAddressTip")),e.jsx(W,{title:l("team.passport.trustedFactories"),open:!0,showCloseButton:!1,PaperProps:{style:{minHeight:"80vh"}},fullWidth:!0,prepend:e.jsx(_,{onClick:c,"data-cy":"close-trusted-factory",size:"large",children:e.jsx(ge,{})}),actions:e.jsxs(e.Fragment,{children:[e.jsx(N,{onClick:c,color:"inherit",children:l("common.cancel")}),e.jsxs(N,{onClick:()=>m(),color:"primary",disabled:!r.factoryAddress||!r.remark||!r.role||r.loading||r.error||w,variant:"contained",autoFocus:!0,"data-cy":"save-trusted-factory",children:[r.loading&&e.jsx(F,{size:16}),l("common.save")]})]}),children:e.jsx(zs,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx(O,{fullWidth:!0,error:!!r.error||!!w,"data-cy":"input-factory-address",label:l("team.passport.factoryAddress"),helperText:g,value:r.factoryAddress,onChange:a=>{n({factoryAddress:a.target.value,error:""})},slotProps:{input:{endAdornment:r.fetching?e.jsx(Ke,{position:"end",children:e.jsx(F,{size:16})}):null}}}),e.jsx(O,{style:{marginTop:32},fullWidth:!0,"data-cy":"input-factory-remark",label:l("common.remark"),value:r.remark,onChange:a=>{n({remark:a.target.value})}}),e.jsx(O,{style:{marginTop:32},fullWidth:!0,"data-cy":"input-passport-role",label:l("team.passport.role"),select:!0,value:r.role,onChange:a=>{n({role:a.target.value})},variant:"outlined",children:i.filter(a=>a.name!=="owner").map(a=>e.jsx(Q,{value:a.name,"data-cy":`passport-role-select-option-${a.name}`,children:e.jsx("span",{children:a.title||a.name})},a.name))}),e.jsxs("div",{style:{marginTop:32},children:[e.jsx(Ve,{children:l("team.passport.ttl")}),e.jsxs(Ze,{color:"primary",size:"small",value:r.ttlPolicy,exclusive:!0,style:{marginTop:16},onChange:(a,o)=>n({ttlPolicy:o}),"data-cy":"input-passport-ttl-since","aria-label":"Expire Policy",children:[e.jsx(ee,{value:"never","data-cy":"input-passport-ttl-never",children:e.jsx(G,{title:l("team.passport.ttlNeverTip"),children:e.jsx(E,{children:l("team.passport.ttlNever")})})}),e.jsx(ee,{value:"mint","data-cy":"input-passport-ttl-mint",children:e.jsx(G,{title:l("team.passport.ttlMintTip"),children:e.jsx(E,{children:l("team.passport.ttlMint")})})}),e.jsx(ee,{value:"exchange","data-cy":"input-passport-ttl-exchange",children:e.jsx(G,{title:l("team.passport.ttlExchangeTip"),children:e.jsx(E,{children:l("team.passport.ttlExchange")})})})]}),r.ttlPolicy!=="never"&&e.jsxs(e.Fragment,{children:[e.jsx(Qe,{fullWidth:!0,type:"text",style:{marginTop:16},"data-cy":"input-passport-ttl",value:r.ttl,onChange:a=>{n({ttl:a.target.value})}}),e.jsx(Xe,{children:l("team.passport.ttlTip")})]})]})]})})})}ze.propTypes={onCancel:S.func.isRequired,onSuccess:S.func.isRequired,trustedFactories:S.array,data:S.object};const zs=$.div`
111
111
  .dialog-h1 {
112
112
  font-size: 18px;
113
113
  }
@@ -119,7 +119,7 @@ import{r as b,g as We,a as $e}from"./vendor-react-DX7tU9aY.js";import{i as qe,r
119
119
  }
120
120
  }
121
121
  }
122
- `;function ue({onCancel:c,hasPermission:s=!1}){const{api:p}=P(),{teamDid:u,trustedFactories:f}=z(),{t:i}=A(),[d,l]=b.useState(null),[r,n]=b.useState(!1),[h,m]=b.useState(null),[g,w]=b.useState(""),x=async o=>{if(!r)try{n(!0),await p.configTrustedFactories({input:{teamDid:u,trustedFactories:f.filter(v=>v.factoryAddress!==o)}}),await V(800),n(!1),D.success(i("common.saveSuccess")),l(null)}catch(v){n(!1),D.error(v.message)}},a=f.filter(o=>!g||o.factoryAddress.toLowerCase().includes(g.toLowerCase()));return e.jsxs(W,{title:i("team.passport.trustedFactories"),open:!0,onClose:c,fullWidth:!0,PaperProps:{style:{minHeight:"80vh"}},children:[e.jsx(Es,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx("div",{className:"dialog-h1",children:i("team.passport.trustedFactoriesTip")}),e.jsx(we,{sx:{mt:3},actions:e.jsxs(e.Fragment,{children:[e.jsx(je,{options:{searchPlaceholder:i("team.passport.searchFactoryAddress"),searchDebounceTime:600},search:g,searchText:g,searchTextUpdate:w,searchClose:()=>w(""),onSearchOpen:()=>{}}),s&&e.jsxs(N,{variant:"contained",color:"primary",size:"small","data-cy":"add-trusted-factory",onClick:()=>m({mode:"add"}),children:[e.jsx(ye,{style:{fontSize:16,marginRight:4}}),i("team.add")]})]})}),e.jsxs("div",{className:"list",children:[a.map(o=>e.jsxs(t,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mt:"20px"},children:[e.jsxs(t,{sx:{flexGrow:1},children:[e.jsx(oe,{copyable:!1,did:o.factoryAddress,size:16,showDidLogo:!1}),!!o.remark&&e.jsx(t,{sx:{fontSize:12,maxWidth:"300px"},children:o.remark})]}),e.jsx(t,{sx:{color:"gray",mr:"24px"},children:e.jsx(rs,{type:"success",children:o.passport.role})}),e.jsxs(t,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:[e.jsx(_,{onClick:()=>m({mode:"update",data:Y(o)}),"data-cy":"edit-trusted-factory",size:"large",children:e.jsx(Ce,{})}),e.jsx(_,{"data-cy":"delete-trusted-factory",onClick:()=>l({title:i("common.delete"),description:i("common.delConfirmDescription",{data:o.factoryAddress}),confirm:i("common.delConfirm"),cancel:i("common.cancel"),onConfirm:()=>x(o.factoryAddress),onCancel:()=>{n(!1),l(null)}}),size:"large",children:e.jsx(ce,{})})]})]},o.factoryAddress)),!f.length&&e.jsx(re,{children:i("common.empty")})]})]})}),h&&e.jsx(ze,{data:h.data,trustedFactories:Y(f),onCancel:()=>m(null),onSuccess:()=>{m(null)}}),d&&e.jsx(Te,{title:d.title,description:d.description,confirm:d.confirm,cancel:d.cancel,params:d.params,onConfirm:d.onConfirm,onCancel:d.onCancel})]})}ue.propTypes={onCancel:S.func.isRequired,hasPermission:S.bool};const Fs=q(ue,"mutate_team"),Bs=q(ue,"",J);function Os(c){const{inService:s}=P();return s?e.jsx(Bs,{...c}):e.jsx(Fs,{...c})}const Es=$.div`
122
+ `;function ue({onCancel:c,hasPermission:s=!1}){const{api:p}=P(),{teamDid:u,trustedFactories:f}=z(),{t:i}=A(),[d,l]=b.useState(null),[r,n]=b.useState(!1),[h,m]=b.useState(null),[g,w]=b.useState(""),x=async o=>{if(!r)try{n(!0),await p.configTrustedFactories({input:{teamDid:u,trustedFactories:f.filter(v=>v.factoryAddress!==o)}}),await V(800),n(!1),D.success(i("common.saveSuccess")),l(null)}catch(v){n(!1),D.error(v.message)}},a=f.filter(o=>!g||o.factoryAddress.toLowerCase().includes(g.toLowerCase()));return e.jsxs(W,{title:i("team.passport.trustedFactories"),open:!0,onClose:c,fullWidth:!0,PaperProps:{style:{minHeight:"80vh"}},children:[e.jsx(Os,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx("div",{className:"dialog-h1",children:i("team.passport.trustedFactoriesTip")}),e.jsx(we,{sx:{mt:3},actions:e.jsxs(e.Fragment,{children:[e.jsx(je,{options:{searchPlaceholder:i("team.passport.searchFactoryAddress"),searchDebounceTime:600},search:g,searchText:g,searchTextUpdate:w,searchClose:()=>w(""),onSearchOpen:()=>{}}),s&&e.jsxs(N,{variant:"contained",color:"primary",size:"small","data-cy":"add-trusted-factory",onClick:()=>m({mode:"add"}),children:[e.jsx(ye,{style:{fontSize:16,marginRight:4}}),i("team.add")]})]})}),e.jsxs("div",{className:"list",children:[a.map(o=>e.jsxs(t,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mt:"20px"},children:[e.jsxs(t,{sx:{flexGrow:1},children:[e.jsx(oe,{copyable:!1,did:o.factoryAddress,size:16,showDidLogo:!1}),!!o.remark&&e.jsx(t,{sx:{fontSize:12,maxWidth:"300px"},children:o.remark})]}),e.jsx(t,{sx:{color:"gray",mr:"24px"},children:e.jsx(rs,{type:"success",children:o.passport.role})}),e.jsxs(t,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:[e.jsx(_,{onClick:()=>m({mode:"update",data:K(o)}),"data-cy":"edit-trusted-factory",size:"large",children:e.jsx(Ce,{})}),e.jsx(_,{"data-cy":"delete-trusted-factory",onClick:()=>l({title:i("common.delete"),description:i("common.delConfirmDescription",{data:o.factoryAddress}),confirm:i("common.delConfirm"),cancel:i("common.cancel"),onConfirm:()=>x(o.factoryAddress),onCancel:()=>{n(!1),l(null)}}),size:"large",children:e.jsx(ce,{})})]})]},o.factoryAddress)),!f.length&&e.jsx(re,{children:i("common.empty")})]})]})}),h&&e.jsx(ze,{data:h.data,trustedFactories:K(f),onCancel:()=>m(null),onSuccess:()=>{m(null)}}),d&&e.jsx(Te,{title:d.title,description:d.description,confirm:d.confirm,cancel:d.cancel,params:d.params,onConfirm:d.onConfirm,onCancel:d.onCancel})]})}ue.propTypes={onCancel:S.func.isRequired,hasPermission:S.bool};const Fs=q(ue,"mutate_team"),Bs=q(ue,"",J);function Es(c){const{inService:s}=P();return s?e.jsx(Bs,{...c}):e.jsx(Fs,{...c})}const Os=$.div`
123
123
  .list {
124
124
  .MuiIconButton-root {
125
125
  svg {
@@ -127,7 +127,7 @@ import{r as b,g as We,a as $e}from"./vendor-react-DX7tU9aY.js";import{i as qe,r
127
127
  }
128
128
  }
129
129
  }
130
- `;function Fe({createPassportSvg:c}){const{t:s}=A(),{api:p,inService:u}=P(),{teamDid:f,refresh:i,enablePassportIssuance:d,isNodeTeam:l}=z(),[r,n]=b.useState(!1),[h,m]=b.useState(!1),[g,w]=b.useState(!1),[x,a]=b.useState(!1),[o,v]=b.useState(!1),j=async C=>{if(C.stopPropagation(),!x){a(!0);try{await p.configPassportIssuance({input:{teamDid:f,enable:!d}}),i(),await V(800),D.success(s("common.configSuccess"))}catch(T){D.error(T.message)}finally{a(!1)}}};return e.jsxs(t,{sx:{display:"flex",alignItems:"center",gap:1,ml:1},children:[e.jsx(xs,{permission:u?"":"mutate_team",role:u?J:[],children:e.jsx(H,{variant:"outlined",menuButtonProps:{"data-cy":"trusted-issuers-more"},menu:e.jsxs(e.Fragment,{children:[e.jsx(H.Item,{onClick:()=>m(!0),"data-cy":"config-trusted-issuers",children:e.jsxs(t,{children:[s("team.passport.trustedPassportIssuers"),e.jsx(t,{sx:{fontSize:12,color:"#888"},children:s("team.passport.trustedPassportIssuersTip")})]})}),e.jsx(H.Item,{onClick:()=>w(!0),"data-cy":"config-show-trusted-factories",children:e.jsxs(t,{children:[s("team.passport.configFactories"),e.jsx(t,{sx:{fontSize:12,color:"#888"},children:s("team.passport.configFactoriesTip")})]})}),e.jsx(H.Item,{"data-cy":"config-show-issue-passport",onClick:j,children:e.jsxs(t,{sx:{display:"flex",alignItems:"center"},children:[x&&e.jsx(F,{size:16,style:{marginRight:8}}),e.jsxs(t,{children:[s(d?"team.passport.disableIssuance":"team.passport.enableIssuance"),e.jsx(t,{sx:{fontSize:12,color:"#888"},children:s(d?"team.passport.disableIssuanceTip":"team.passport.enableIssuanceTip")})]})]})}),!l&&e.jsx(H.Item,{onClick:()=>n(!0),"data-cy":"config-passport-color",children:e.jsxs(t,{children:[s("team.passport.configColor"),e.jsx(t,{sx:{fontSize:12,color:"#888"},children:s("team.passport.configColorTip")})]})})]}),children:()=>e.jsx(N,{variant:"outlined",onClick:()=>{v(!0)},children:s("team.passport.view")})})}),h&&e.jsx(As,{onCancel:()=>m(!1)}),g&&e.jsx(Os,{onCancel:()=>w(!1)}),r&&e.jsx(Is,{onCancel:()=>n(!1),onSuccess:()=>n(!1)}),o&&e.jsx(W,{open:!0,maxWidth:"lg",onClose:()=>v(!1),onBackdropClick:()=>v(!1),onEscapeKeyDown:()=>v(!1),title:s("team.passport.view"),children:e.jsx(bs,{createPassportSvg:c,onCancel:()=>v(!1)})})]})}Fe.propTypes={createPassportSvg:S.func.isRequired};const xe="$all",he="",Be=$e.memo(({createPassportSvg:c,passport:s,teamDid:p,inService:u})=>e.jsx(t,{sx:{display:"flex"},dangerouslySetInnerHTML:{__html:c({scope:s.scope,role:s.role,title:s.scope==="kyc"?s.name:s.title,issuer:s.issuer&&s.issuer.name,issuerDid:s.issuer&&s.issuer.id,ownerName:s.user?.fullName,ownerDid:s.user?.did,ownerAvatarUrl:s.user?.avatar?Se(s.user?.avatar,p,u):"",revoked:s.revoked,width:"36px",extra:s?.expirationDate?{key:"Exp",value:be(s.expirationDate).format("YYYY-MM-DD HH:mm:ss")}:null})}}));Be.propTypes={passport:S.object.isRequired,createPassportSvg:S.func.isRequired,teamDid:S.string.isRequired,inService:S.bool.isRequired};function Ms({createPassportSvg:c}){const{api:s}=P(),{teamDid:p}=z(),{t:u,locale:f}=A(),{SYSTEM_ROLES:i}=us(),{inService:d}=P(),[l,r]=b.useState(!1),n=`passports-${p}`,h=os(n),[m,g]=b.useState({role:xe,status:he,searchText:h.searchText||"",pageSize:h.rowsPerPage||10,page:h.page?h.page+1:1}),{data:w,loading:x}=Z(async()=>(await s.getPassportRoleCounts({input:{teamDid:p}})).counts||[],{refreshDeps:[p]}),{data:a,loading:o}=Z(async()=>{const y={};m.role!==xe&&(y.role=m.role),m.status&&(y.status=m.status);const I=await s.getPassportsByRole({input:{teamDid:p,query:y,paging:{page:m.page,pageSize:m.pageSize}}});return{passports:I.passports||[],total:I.paging.total}},{refreshDeps:[m.role,m.status,m.page,m.pageSize],onError:y=>D.error(y.message)}),v=y=>w?.find(R=>R.key===y)?.value||0,j=b.useMemo(()=>Object.keys(i).map(y=>({name:y,title:i[y],num:v(y)})),[w,v]),C=b.useMemo(()=>[{label:u("team.passport.role"),name:"role",options:{customBodyRender:(y,{rowIndex:I})=>{const R=a?.passports[I];return e.jsxs(t,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(Be,{createPassportSvg:c,passport:R,teamDid:p}),e.jsx(t,{children:ne(R.title)})]})}}},{label:u("team.passport.owner"),name:"user",options:{customBodyRender:y=>ie(y,d)}},{label:u("team.passport.status"),name:"status",options:{customBodyRender:le}},{label:u("team.member.lastLogin"),name:"lastLoginAt",options:{customBodyRender:y=>ve(y,f)}},{label:u("common.address"),name:"id",options:{customBodyRender:ms}},{label:u("blocklet.overview.source"),name:"source",options:{customBodyRender:(y,{rowIndex:I})=>{const R=a?.passports[I];return R.parentDid?X("recover"):X(R.source)}}}],[u,f,a?.passports,p,c,d]),T=y=>{g(I=>({...I,role:y,page:1}))},k=({page:y,rowsPerPage:I,searchText:R})=>{m.pageSize!==I?g(B=>({...B,searchText:"",pageSize:I,page:1})):m.page!==y+1?g(B=>({...B,searchText:"",page:y+1})):m.searchText!==R&&g(B=>({...B,searchText:R,page:1}))},L=b.useRef(null),U=a?.passports||[],Oe=m.searchText?U.filter(y=>y.id.includes(m.searchText)||(y?.user?.fullName||"").includes(m.searchText)):U,Ee={sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,onRowClick(y,{dataIndex:I},R){if(L.current?.contains(R.target)){const B=a?.passports[I];r(B)}},page:m.page-1,rowsPerPage:m.pageSize,count:a?.total||0,searchDebounceTime:600},Me=y=>{g(I=>({...I,status:y.target.value,page:1}))},_e=e.jsxs(t,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsxs(t,{sx:{fontSize:16,fontWeight:400},children:[u("team.passport.status"),":"]}),e.jsxs(Je,{size:"small",value:m.status,onChange:Me,displayEmpty:!0,sx:{minWidth:120,height:36,".MuiSelect-select":{py:.5,px:1.5}},children:[e.jsx(Q,{value:he,children:u("common.all")}),Object.values(M.PASSPORT_STATUS).map(y=>e.jsx(Q,{value:y,sx:{py:1},children:u(`team.passport.statusMap.${y}`)},y))]})]});return x?e.jsx(t,{sx:{py:2},children:e.jsx(K,{direction:"row",spacing:1,sx:{justifyContent:"center",alignItems:"center",position:"relative",pb:2},children:e.jsx(F,{})})}):e.jsxs(_s,{children:[e.jsxs(t,{className:"main",sx:{display:"flex",mt:0,gap:3},children:[e.jsx(t,{className:"left",children:e.jsx(t,{className:"tabs",children:j.map(y=>e.jsxs(t,{className:`tab ${m.role===y.name?"active":""}`,onClick:()=>T(y.name),children:[e.jsx("span",{className:"text",children:y.title}),e.jsx(t,{sx:{color:"text.secondary"},children:y.num})]},y.name))})}),e.jsx(t,{ref:L,className:"right",children:e.jsx(ae,{className:"main-table",verticalKeyWidth:100,locale:f,durable:n,durableKeys:["page","rowsPerPage"],data:Oe,columns:C,options:Ee,loading:o,onChange:k,customButtons:[e.jsx(Fe,{createPassportSvg:c})],title:_e})})]}),l&&e.jsx(Ie,{createPassportSvg:c,onCancel:()=>r(null),passport:l,onSwitchPassport:r})]})}Ms.propTypes={createPassportSvg:S.func.isRequired};const _s=es(t)`
130
+ `;function Fe({createPassportSvg:c}){const{t:s}=A(),{api:p,inService:u}=P(),{teamDid:f,refresh:i,enablePassportIssuance:d,isNodeTeam:l}=z(),[r,n]=b.useState(!1),[h,m]=b.useState(!1),[g,w]=b.useState(!1),[x,a]=b.useState(!1),[o,v]=b.useState(!1),j=async C=>{if(C.stopPropagation(),!x){a(!0);try{await p.configPassportIssuance({input:{teamDid:f,enable:!d}}),i(),await V(800),D.success(s("common.configSuccess"))}catch(T){D.error(T.message)}finally{a(!1)}}};return e.jsxs(t,{sx:{display:"flex",alignItems:"center",gap:1,ml:1},children:[e.jsx(xs,{permission:u?"":"mutate_team",role:u?J:[],children:e.jsx(H,{variant:"outlined",menuButtonProps:{"data-cy":"trusted-issuers-more"},menu:e.jsxs(e.Fragment,{children:[e.jsx(H.Item,{onClick:()=>m(!0),"data-cy":"config-trusted-issuers",children:e.jsxs(t,{children:[s("team.passport.trustedPassportIssuers"),e.jsx(t,{sx:{fontSize:12,color:"#888"},children:s("team.passport.trustedPassportIssuersTip")})]})}),e.jsx(H.Item,{onClick:()=>w(!0),"data-cy":"config-show-trusted-factories",children:e.jsxs(t,{children:[s("team.passport.configFactories"),e.jsx(t,{sx:{fontSize:12,color:"#888"},children:s("team.passport.configFactoriesTip")})]})}),e.jsx(H.Item,{"data-cy":"config-show-issue-passport",onClick:j,children:e.jsxs(t,{sx:{display:"flex",alignItems:"center"},children:[x&&e.jsx(F,{size:16,style:{marginRight:8}}),e.jsxs(t,{children:[s(d?"team.passport.disableIssuance":"team.passport.enableIssuance"),e.jsx(t,{sx:{fontSize:12,color:"#888"},children:s(d?"team.passport.disableIssuanceTip":"team.passport.enableIssuanceTip")})]})]})}),!l&&e.jsx(H.Item,{onClick:()=>n(!0),"data-cy":"config-passport-color",children:e.jsxs(t,{children:[s("team.passport.configColor"),e.jsx(t,{sx:{fontSize:12,color:"#888"},children:s("team.passport.configColorTip")})]})})]}),children:()=>e.jsx(N,{variant:"outlined",onClick:()=>{v(!0)},children:s("team.passport.view")})})}),h&&e.jsx(As,{onCancel:()=>m(!1)}),g&&e.jsx(Es,{onCancel:()=>w(!1)}),r&&e.jsx(Is,{onCancel:()=>n(!1),onSuccess:()=>n(!1)}),o&&e.jsx(W,{open:!0,maxWidth:"lg",onClose:()=>v(!1),onBackdropClick:()=>v(!1),onEscapeKeyDown:()=>v(!1),title:s("team.passport.view"),children:e.jsx(bs,{createPassportSvg:c,onCancel:()=>v(!1)})})]})}Fe.propTypes={createPassportSvg:S.func.isRequired};const xe="$all",he="",Be=$e.memo(({createPassportSvg:c,passport:s,teamDid:p,inService:u})=>e.jsx(t,{sx:{display:"flex"},dangerouslySetInnerHTML:{__html:c({scope:s.scope,role:s.role,title:s.scope==="kyc"?s.name:s.title,issuer:s.issuer&&s.issuer.name,issuerDid:s.issuer&&s.issuer.id,ownerName:s.user?.fullName,ownerDid:s.user?.did,ownerAvatarUrl:s.user?.avatar?Se(s.user?.avatar,p,u):"",revoked:s.revoked,width:"36px",extra:s?.expirationDate?{key:"Exp",value:be(s.expirationDate).format("YYYY-MM-DD HH:mm:ss")}:null})}}));Be.propTypes={passport:S.object.isRequired,createPassportSvg:S.func.isRequired,teamDid:S.string.isRequired,inService:S.bool.isRequired};function Ms({createPassportSvg:c}){const{api:s}=P(),{teamDid:p}=z(),{t:u,locale:f}=A(),{SYSTEM_ROLES:i}=us(),{inService:d}=P(),[l,r]=b.useState(!1),n=`passports-${p}`,h=os(n),[m,g]=b.useState({role:xe,status:he,searchText:h.searchText||"",pageSize:h.rowsPerPage||10,page:h.page?h.page+1:1}),{data:w,loading:x}=Z(async()=>(await s.getPassportRoleCounts({input:{teamDid:p}})).counts||[],{refreshDeps:[p]}),{data:a,loading:o}=Z(async()=>{const y={};m.role!==xe&&(y.role=m.role),m.status&&(y.status=m.status);const I=await s.getPassportsByRole({input:{teamDid:p,query:y,paging:{page:m.page,pageSize:m.pageSize}}});return{passports:I.passports||[],total:I.paging.total}},{refreshDeps:[m.role,m.status,m.page,m.pageSize],onError:y=>D.error(y.message)}),v=y=>w?.find(k=>k.key===y)?.value||0,j=b.useMemo(()=>Object.keys(i).map(y=>({name:y,title:i[y],num:v(y)})),[w,v]),C=b.useMemo(()=>[{label:u("team.passport.role"),name:"role",options:{customBodyRender:(y,{rowIndex:I})=>{const k=a?.passports[I];return e.jsxs(t,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(Be,{createPassportSvg:c,passport:k,teamDid:p}),e.jsx(t,{children:ne(k.title)})]})}}},{label:u("team.passport.owner"),name:"user",options:{customBodyRender:y=>ie(y,d)}},{label:u("team.passport.status"),name:"status",options:{customBodyRender:le}},{label:u("team.member.lastLogin"),name:"lastLoginAt",options:{customBodyRender:y=>ve(y,f)}},{label:u("common.address"),name:"id",options:{customBodyRender:ms}},{label:u("blocklet.overview.source"),name:"source",options:{customBodyRender:(y,{rowIndex:I})=>{const k=a?.passports[I];return k.parentDid?X("recover"):X(k.source)}}}],[u,f,a?.passports,p,c,d]),T=y=>{g(I=>({...I,role:y,page:1}))},R=({page:y,rowsPerPage:I,searchText:k})=>{m.pageSize!==I?g(B=>({...B,searchText:"",pageSize:I,page:1})):m.page!==y+1?g(B=>({...B,searchText:"",page:y+1})):m.searchText!==k&&g(B=>({...B,searchText:k,page:1}))},L=b.useRef(null),U=a?.passports||[],Ee=m.searchText?U.filter(y=>y.id.includes(m.searchText)||(y?.user?.fullName||"").includes(m.searchText)):U,Oe={sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,onRowClick(y,{dataIndex:I},k){if(L.current?.contains(k.target)){const B=a?.passports[I];r(B)}},page:m.page-1,rowsPerPage:m.pageSize,count:a?.total||0,searchDebounceTime:600},Me=y=>{g(I=>({...I,status:y.target.value,page:1}))},_e=e.jsxs(t,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsxs(t,{sx:{fontSize:16,fontWeight:400},children:[u("team.passport.status"),":"]}),e.jsxs(Je,{size:"small",value:m.status,onChange:Me,displayEmpty:!0,sx:{minWidth:120,height:36,".MuiSelect-select":{py:.5,px:1.5}},children:[e.jsx(Q,{value:he,children:u("common.all")}),Object.values(M.PASSPORT_STATUS).map(y=>e.jsx(Q,{value:y,sx:{py:1},children:u(`team.passport.statusMap.${y}`)},y))]})]});return x?e.jsx(t,{sx:{py:2},children:e.jsx(Y,{direction:"row",spacing:1,sx:{justifyContent:"center",alignItems:"center",position:"relative",pb:2},children:e.jsx(F,{})})}):e.jsxs(_s,{children:[e.jsxs(t,{className:"main",sx:{display:"flex",mt:0,gap:3},children:[e.jsx(t,{className:"left",children:e.jsx(t,{className:"tabs",children:j.map(y=>e.jsxs(t,{className:`tab ${m.role===y.name?"active":""}`,onClick:()=>T(y.name),children:[e.jsx("span",{className:"text",children:y.title}),e.jsx(t,{sx:{color:"text.secondary"},children:y.num})]},y.name))})}),e.jsx(t,{ref:L,className:"right",children:e.jsx(ae,{className:"main-table",verticalKeyWidth:100,locale:f,durable:n,durableKeys:["page","rowsPerPage"],data:Ee,columns:C,options:Oe,loading:o,onChange:R,customButtons:[e.jsx(Fe,{createPassportSvg:c})],title:_e})})]}),l&&e.jsx(Ie,{createPassportSvg:c,onCancel:()=>r(null),passport:l,onSwitchPassport:r})]})}Ms.propTypes={createPassportSvg:S.func.isRequired};const _s=es(t)`
131
131
  .main {
132
132
  .left {
133
133
  width: 256px;
@@ -1,4 +1,4 @@
1
- import{r as u}from"./vendor-react-DX7tU9aY.js";import{X as o,j as e,al as j,aL as z,A,aT as K,cY as B,I as D,a7 as X,bk as M,ak as W,cG as G}from"./vendor-mui-core-D7t4vMS5.js";import{C as Y}from"./Google-BMSeyXdi.js";import{b3 as H}from"./vendor-ux-Dl3wVbv_.js";import{c as U}from"./create-passport-svg-De1vqcmo.js";import{A as $}from"./vendor-arcblock-ivFYo5vP.js";import{o as J}from"./index-Ca33rdd_.js";import{R as Q}from"./required-11pmtzQr.js";import{F as Z}from"./form-wrapper-EixE0Jkw.js";import{L as v}from"./logo-uploader-DjKJkvts.js";import{A as ee,a as ne,b as te}from"./collapse-DWmyzfnW.js";const T={description:o.string,editing:o.bool,onChange:o.func,required:o.bool,value:o.any,componentProps:o.object,render:o.func,renderFormItem:o.func};function S({editing:n,value:s,onChange:l}){const[i,c]=u.useState(!1),m=u.useRef(),f=u.useRef(s);u.useEffect(()=>{let a=null;return n&&(a=setTimeout(()=>{c(!0)},50)),()=>{clearTimeout(a)}},[n]);const h=a=>{f.current=a,l(a)},b=()=>{c(!1),l(f.current)},y=e.jsx(j,{className:"form-item-input slot",sx:{px:1},children:e.jsxs(j,{sx:{display:"flex",alignItems:"center"},children:[s,s!=="auto"&&e.jsx("div",{style:{marginLeft:4,backgroundColor:s,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),p=e.jsxs(j,{onKeyDown:b,sx:{display:"flex",flexGrow:1,alignItems:"center",height:"40px"},children:[e.jsx(j,{onClick:()=>c(!0),sx:{display:"flex",alignItems:"center"},children:e.jsx("div",{ref:m,style:{flexShrink:0,marginLeft:"8px",backgroundColor:s,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:s==="auto"?"default":"pointer"}})}),e.jsx(z,{open:i,anchorEl:m.current,onClose:()=>c(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:e.jsx(Y,{color:s,onChange:a=>h(a.hex)})})]});return n?p:y}S.propTypes=T;function N({editing:n,description:s,value:l,onChange:i,componentProps:c={},...m}){const{placeholder:f}=c,h=u.useRef(l),{t:b}=u.useContext(H),y=a=>{a.key==="Enter"&&i(h.current,"confirm")},p=a=>{h.current=a,i(a)};return n?e.jsx(A,{style:{flex:1},fullWidth:!0,value:l,onChange:a=>{a.persist(),p(a.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:s||f,onKeyDown:y,...m}):e.jsx(j,{className:"form-item-input slot",sx:{px:1},children:l||e.jsx("span",{className:"placeholder",children:b("common.requiredInputPlaceholder",{name:s||f})})})}N.propTypes=T;function O({editing:n,value:s,onChange:l,componentProps:i,...c}){const{blocklet:m}=i,f=s==="auto"?$(m.appDid):s;return e.jsxs(j,{sx:{display:"flex",alignItems:"center"},children:[e.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:U({title:"Owner",issuer:J.getDisplayName(m),issuerDid:m.appDid,ownerName:"Your Name",ownerDid:m.appDid,preferredColor:s||"auto"})}}),e.jsx(S,{...c,editing:n,value:n?f:s,onChange:l,componentProps:i})]})}O.propTypes={...T,componentProps:o.shape({blocklet:o.object.isRequired}).isRequired};const re=G`
1
+ import{r as u}from"./vendor-react-DX7tU9aY.js";import{X as o,j as e,al as j,aL as z,A,aT as K,cY as B,I as D,a7 as X,bk as M,ak as W,cG as G}from"./vendor-mui-core-CV-FnYH_.js";import{C as Y}from"./Google-DKRt92nm.js";import{b4 as H}from"./vendor-ux-CLT2i3Pv.js";import{c as U}from"./create-passport-svg-hldNORaB.js";import{A as $}from"./vendor-arcblock-Dll6qxMT.js";import{o as J}from"./index-CXp5SI_f.js";import{R as Q}from"./required-DnQpCGsD.js";import{F as Z}from"./form-wrapper-kWYD3nZz.js";import{L as v}from"./logo-uploader-CyZuvhwV.js";import{A as ee,a as ne,b as te}from"./collapse-RMuUWnK3.js";const T={description:o.string,editing:o.bool,onChange:o.func,required:o.bool,value:o.any,componentProps:o.object,render:o.func,renderFormItem:o.func};function S({editing:n,value:s,onChange:l}){const[i,c]=u.useState(!1),m=u.useRef(),f=u.useRef(s);u.useEffect(()=>{let a=null;return n&&(a=setTimeout(()=>{c(!0)},50)),()=>{clearTimeout(a)}},[n]);const h=a=>{f.current=a,l(a)},b=()=>{c(!1),l(f.current)},y=e.jsx(j,{className:"form-item-input slot",sx:{px:1},children:e.jsxs(j,{sx:{display:"flex",alignItems:"center"},children:[s,s!=="auto"&&e.jsx("div",{style:{marginLeft:4,backgroundColor:s,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),p=e.jsxs(j,{onKeyDown:b,sx:{display:"flex",flexGrow:1,alignItems:"center",height:"40px"},children:[e.jsx(j,{onClick:()=>c(!0),sx:{display:"flex",alignItems:"center"},children:e.jsx("div",{ref:m,style:{flexShrink:0,marginLeft:"8px",backgroundColor:s,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:s==="auto"?"default":"pointer"}})}),e.jsx(z,{open:i,anchorEl:m.current,onClose:()=>c(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:e.jsx(Y,{color:s,onChange:a=>h(a.hex)})})]});return n?p:y}S.propTypes=T;function N({editing:n,description:s,value:l,onChange:i,componentProps:c={},...m}){const{placeholder:f}=c,h=u.useRef(l),{t:b}=u.useContext(H),y=a=>{a.key==="Enter"&&i(h.current,"confirm")},p=a=>{h.current=a,i(a)};return n?e.jsx(A,{style:{flex:1},fullWidth:!0,value:l,onChange:a=>{a.persist(),p(a.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:s||f,onKeyDown:y,...m}):e.jsx(j,{className:"form-item-input slot",sx:{px:1},children:l||e.jsx("span",{className:"placeholder",children:b("common.requiredInputPlaceholder",{name:s||f})})})}N.propTypes=T;function O({editing:n,value:s,onChange:l,componentProps:i,...c}){const{blocklet:m}=i,f=s==="auto"?$(m.appDid):s;return e.jsxs(j,{sx:{display:"flex",alignItems:"center"},children:[e.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:U({title:"Owner",issuer:J.getDisplayName(m),issuerDid:m.appDid,ownerName:"Your Name",ownerDid:m.appDid,preferredColor:s||"auto"})}}),e.jsx(S,{...c,editing:n,value:n?f:s,onChange:l,componentProps:i})]})}O.propTypes={...T,componentProps:o.shape({blocklet:o.object.isRequired}).isRequired};const re=G`
2
2
  0%, 100% {
3
3
  transform: scale(1) translateX(0);
4
4
  }