@abtnode/blocklet-services 1.16.47-beta-20250717-221700-2d886a18 → 1.16.47-beta-20250721-025348-9ccb2d62

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 (188) hide show
  1. package/dist/assets/{AdapterDayjs-BZTfQON9.js → AdapterDayjs-Dc_cn1Wv.js} +1 -1
  2. package/dist/assets/{Community-CcMMU0U0.js → Community-ClHGTbNM.js} +1 -1
  3. package/dist/assets/{Google-BdWLCoXr.js → Google-BYGsR9Bd.js} +1 -1
  4. package/dist/assets/{Holiday-CQ56q1Zn.js → Holiday-D8fmDxt6.js} +1 -1
  5. package/dist/assets/{Meeting-BloE6sJb.js → Meeting-CF7NtQe5.js} +1 -1
  6. package/dist/assets/{OffSick-BDgahXbb.js → OffSick-CWwGwWYY.js} +1 -1
  7. package/dist/assets/{WorkingRemotely-Dy2yEuOf.js → WorkingRemotely-CD8ntsiV.js} +1 -1
  8. package/dist/assets/{access-control-Ccw74KG_.js → access-control-oCszV5zC.js} +1 -1
  9. package/dist/assets/{actions-C731b1S-.js → actions-CeSIZN0M.js} +1 -1
  10. package/dist/assets/{add-component-core-CbHoe5zJ.js → add-component-core-GYYnyhPI.js} +1 -1
  11. package/dist/assets/{add-resource-Cq_fc1jD.js → add-resource-vcL8WXJK.js} +1 -1
  12. package/dist/assets/{addon-DZMRJstX.js → addon-m7dEcFSm.js} +1 -1
  13. package/dist/assets/{advanced-2-zZxGm_.js → advanced-BhS7b_np.js} +1 -1
  14. package/dist/assets/api-BV16dSSm.js +1 -0
  15. package/dist/assets/{appearance-DpzMSH9F.js → appearance-BF-F41U0.js} +1 -1
  16. package/dist/assets/{arrow-down.svg-CAhyD6_b.js → arrow-down.svg-6steA5un.js} +1 -1
  17. package/dist/assets/{audit-logs-ChoY3Mh6.js → audit-logs-gbfUafHi.js} +1 -1
  18. package/dist/assets/{authorize-CRwwOLYT.js → authorize-Bfey1QAy.js} +1 -1
  19. package/dist/assets/{base-chart-ChlMjzcv.js → base-chart-u6OIGONc.js} +1 -1
  20. package/dist/assets/{base32-CkijRzDY.js → base32-DBDFptL1.js} +1 -1
  21. package/dist/assets/{branding-BFlQm__X.js → branding-Co1T-6R4.js} +1 -1
  22. package/dist/assets/{branding-1Tnui43I.js → branding-itFeNCQ6.js} +2 -2
  23. package/dist/assets/{bundle-avatar-cdYjPEnW.js → bundle-avatar-DkLBEfff.js} +1 -1
  24. package/dist/assets/button-Cnj6R5bV.js +1 -0
  25. package/dist/assets/click-to-copy-m7BzOuWH.js +1 -0
  26. package/dist/assets/cloneDeep-BpNWeRQ9.js +1 -0
  27. package/dist/assets/{collapse-DGb2BFlZ.js → collapse-DfvukfIl.js} +1 -1
  28. package/dist/assets/{complete-B-DZw0Xp.js → complete-B4B7REuC.js} +1 -1
  29. package/dist/assets/{component-B7p437A9.js → component-DMzCzNlm.js} +3 -3
  30. package/dist/assets/{config-CpnLJaUO.js → config-D-z5vAfP.js} +1 -1
  31. package/dist/assets/{config-CxEXdwoA.js → config-D3XTFUmZ.js} +1 -1
  32. package/dist/assets/{config-navigation-CU19NqaO.js → config-navigation-CfGhB5-E.js} +3 -3
  33. package/dist/assets/{config-space-B6WEaHVR.js → config-space-a6OXiuM7.js} +1 -1
  34. package/dist/assets/{confirm-B0IPtkVS.js → confirm-B4BzkG04.js} +1 -1
  35. package/dist/assets/{connect-BOc7_s4F.js → connect-B-9mXcqo.js} +1 -1
  36. package/dist/assets/{connect-NXiMoe1T.js → connect-JlblxSAY.js} +1 -1
  37. package/dist/assets/{connect-to-RFZZSI5s.js → connect-to-BL3HAXmC.js} +1 -1
  38. package/dist/assets/{content-layout-Ctpah7wH.js → content-layout-BaDbLmL5.js} +1 -1
  39. package/dist/assets/{createClass-Bj7mZfZB.js → createClass-g8bSPTyV.js} +1 -1
  40. package/dist/assets/{dashboard-ClQmhIHS.js → dashboard-CBpVHcLw.js} +3 -3
  41. package/dist/assets/{delete-confirm-DeAivjJv.js → delete-confirm-DhfRzwF1.js} +1 -1
  42. package/dist/assets/{did-address-D7SiJUQw.js → did-address-CdYAzzjR.js} +1 -1
  43. package/dist/assets/{domain-action-card-BMJauDDL.js → domain-action-card-B-0EUHm9.js} +1 -1
  44. package/dist/assets/{domain-Cx4UiImS.js → domain-q2p-uq0P.js} +1 -1
  45. package/dist/assets/domains-BvFskQMv.js +1 -0
  46. package/dist/assets/{dot-CAD4z94Q.js → dot-OPeVWPUi.js} +1 -1
  47. package/dist/assets/{edit.svg-D-deOViK.js → edit.svg-DycWG9v3.js} +1 -1
  48. package/dist/assets/{email-_MWdgnCs.js → email-BTKvn_fl.js} +3 -3
  49. package/dist/assets/{empty-spinner-DoD2SObf.js → empty-spinner-C6wgiyAQ.js} +1 -1
  50. package/dist/assets/engine-DHKpyPwC.js +1 -0
  51. package/dist/assets/{exchange-passport-B5Avk2mv.js → exchange-passport-B-9fNsX9.js} +1 -1
  52. package/dist/assets/{form-Cfox3G5b.js → form-BX4g8soo.js} +1 -1
  53. package/dist/assets/{fuel--qkuIoAW.js → fuel-DYTqXaPb.js} +1 -1
  54. package/dist/assets/{gen-access-key-B4DsFFIf.js → gen-access-key-DVBJadXn.js} +2 -2
  55. package/dist/assets/get-safe-url-Ce6hawV-.js +1 -0
  56. package/dist/assets/{home-DIigPTxS.js → home-BL8xoBlc.js} +1 -1
  57. package/dist/assets/{iframe-CQ_bWNrw.js → iframe-BTaRNGRY.js} +1 -1
  58. package/dist/assets/{index-8pSMU0so.js → index-5klv_mrK.js} +1 -1
  59. package/dist/assets/{index-pq4T68Se.js → index-B9-tuTku.js} +4 -4
  60. package/dist/assets/{index-B_4qd0Ji.js → index-B9GdL3BM.js} +1 -1
  61. package/dist/assets/{index-CSSFAW5K.js → index-BC395sak.js} +1 -1
  62. package/dist/assets/{index-MGxe3V9B.js → index-BPy8_fa2.js} +1 -1
  63. package/dist/assets/{index-Bo6LJIBD.js → index-BUJ5QfC4.js} +3 -3
  64. package/dist/assets/index-BVPDkm__.js +1 -0
  65. package/dist/assets/{index-C5pKXOxF.js → index-BaBIefeb.js} +1 -1
  66. package/dist/assets/{index-D1bv9ooM.js → index-Bo2cFOuR.js} +1 -1
  67. package/dist/assets/{index-DYbAE8u5.js → index-C-AuC2Mk.js} +1 -1
  68. package/dist/assets/{index-BEyKlMs9.js → index-CW67obch.js} +1 -1
  69. package/dist/assets/{index-BsdYXeYP.js → index-C_CqbmyE.js} +1 -1
  70. package/dist/assets/{index-C0HBWMaK.js → index-Cbxz8oHT.js} +1 -1
  71. package/dist/assets/{index-CnoeBPbk.js → index-CeczUnUx.js} +1 -1
  72. package/dist/assets/{index-dIkcxCDN.js → index-CgCJ2qDh.js} +5 -5
  73. package/dist/assets/{index-DawEtQPD.js → index-CgRDnxac.js} +1 -1
  74. package/dist/assets/{index-C-vjjw9E.js → index-CgdhTqWX.js} +1 -1
  75. package/dist/assets/{index-BGTKxy_q.js → index-D3qROm47.js} +1 -1
  76. package/dist/assets/{index-D27Eda5K.js → index-D6kePAD5.js} +1 -1
  77. package/dist/assets/{index-BpL1e-bN.js → index-D8X_0Jj0.js} +1 -1
  78. package/dist/assets/{index-DEPyMifK.js → index-DUnVGFh6.js} +1 -1
  79. package/dist/assets/{index--E0qCGk-.js → index-D_5DFMMK.js} +1 -1
  80. package/dist/assets/{index-DdCAwzrE.js → index-DcwzA8G_.js} +1 -1
  81. package/dist/assets/{index-ChVoQcrO.js → index-DjKmasIZ.js} +1 -1
  82. package/dist/assets/{index-CQb3b4r6.js → index-DseoFU10.js} +1 -1
  83. package/dist/assets/{index-b_dnNRMF.js → index-Dy8syryD.js} +1 -1
  84. package/dist/assets/{index-thbUUXKQ.js → index-DyH1BrER.js} +1 -1
  85. package/dist/assets/{index-Dl1q-Vpb.js → index-EIX4798q.js} +1 -1
  86. package/dist/assets/{index-BcuyH8tS.js → index-LvmCZD51.js} +3 -3
  87. package/dist/assets/{index-Dhyyek4_.js → index-SrN5SE_r.js} +1 -1
  88. package/dist/assets/{index-BEq2q2jr.js → index-cCGBx0sL.js} +1 -1
  89. package/dist/assets/{index-CjiaOjxw.js → index-gkhmzgqt.js} +1 -1
  90. package/dist/assets/{index-Bv6qc7SO.js → index-lf4wyjkd.js} +1 -1
  91. package/dist/assets/{index-CzB-WPWn.js → index-n78OcMXJ.js} +1 -1
  92. package/dist/assets/{index.esm-BONQrRCU.js → index.esm-JPZAjt0x.js} +1 -1
  93. package/dist/assets/{invitation-D4tu3NNd.js → invitation-CC5hPf7T.js} +1 -1
  94. package/dist/assets/{invite-DdCiERzE.js → invite-CreQ98MA.js} +1 -1
  95. package/dist/assets/{issue-passport-CmU7CVx7.js → issue-passport-CIYcm6iB.js} +1 -1
  96. package/dist/assets/{item-7fmoiGq1.js → item-C8OCvu8j.js} +1 -1
  97. package/dist/assets/{landing-page-DrswynDN.js → landing-page-DOi_4Ca6.js} +1 -1
  98. package/dist/assets/{launch-result-message-BlpIIvzr.js → launch-result-message-Dwnqr8Lq.js} +1 -1
  99. package/dist/assets/{layout-u6VjgU9W.js → layout-CIen07bA.js} +1 -1
  100. package/dist/assets/{list-s4SRm3p5.js → list-B8ZhwNC1.js} +1 -1
  101. package/dist/assets/{list-DLQOcQSS.js → list-DZy6xsmU.js} +2 -2
  102. package/dist/assets/{list-header-BROuC1JD.js → list-header-CGX6Hi0X.js} +1 -1
  103. package/dist/assets/localization-CKs8paiI.js +1 -0
  104. package/dist/assets/{lock.svg-xPuKHQ-O.js → lock.svg-COUP8tyO.js} +1 -1
  105. package/dist/assets/{log-BCe-iHkk.js → log-C9DU0cCG.js} +1 -1
  106. package/dist/assets/logger-BAwrOeMG.js +1 -0
  107. package/dist/assets/{login-CJ9QT17a.js → login-Bnu0F5eS.js} +1 -1
  108. package/dist/assets/{login-oauth-callback-Bn54mlE7.js → login-oauth-callback-C2SqP1bW.js} +1 -1
  109. package/dist/assets/{logo-uploader-Cct_Tgp9.js → logo-uploader-DgG1moIj.js} +3 -3
  110. package/dist/assets/{lost-passport-JFuuT2LW.js → lost-passport-DtNgA2rm.js} +3 -3
  111. package/dist/assets/{lottie-react.esm-Bqal_rmd.js → lottie-react.esm-M5fKy3fg.js} +1 -1
  112. package/dist/assets/omit-CxEI1_wm.js +1 -0
  113. package/dist/assets/{open-window-okQkGylu.js → open-window-RuAUils2.js} +1 -1
  114. package/dist/assets/{over-due-invoice-payment-CorS-0Po.js → over-due-invoice-payment-DhK6jNNQ.js} +1 -1
  115. package/dist/assets/{overview-CDbOiDio.js → overview-BVSh5o7h.js} +1 -1
  116. package/dist/assets/{page-header-BuVm9h5d.js → page-header-BycH8S9r.js} +1 -1
  117. package/dist/assets/{passport-item-BejfMK1X.js → passport-item-D7sQ_FxN.js} +1 -1
  118. package/dist/assets/{permission-B4PsiDVD.js → permission-C79TpiNV.js} +1 -1
  119. package/dist/assets/preferences-DfEKF75U.js +1 -0
  120. package/dist/assets/profile-embed-LKUTgx9A.js +1 -0
  121. package/dist/assets/publish-resource-BzjWpXe-.js +1 -0
  122. package/dist/assets/{question-mark-circle.svg-YsMacl4Q.js → question-mark-circle.svg-B4stD6SS.js} +1 -1
  123. package/dist/assets/{raf-schd.esm-BZ5FB5HD.js → raf-schd.esm-CHNehTG3.js} +1 -1
  124. package/dist/assets/{react-beautiful-dnd.esm-ByowwdW2.js → react-beautiful-dnd.esm-DwkY3sYg.js} +1 -1
  125. package/dist/assets/{react-stripe.esm-DjDk8Ggj.js → react-stripe.esm-BGPt6Wk8.js} +1 -1
  126. package/dist/assets/{runtime-DaXsDIcp.js → runtime-Sobb0AXT.js} +1 -1
  127. package/dist/assets/{sanitize-CCb_t50W.js → sanitize-DSvGhymV.js} +1 -1
  128. package/dist/assets/sdk-DzqJHXyQ.js +1 -0
  129. package/dist/assets/{section-BkD2aamt.js → section-BqJWD2MT.js} +1 -1
  130. package/dist/assets/{security-BGWWSAkV.js → security-BwF3YzTL.js} +1 -1
  131. package/dist/assets/{server-logo-notext.svg-BqCXmsOm.js → server-logo-notext.svg-CKQB0tIp.js} +1 -1
  132. package/dist/assets/session-BV5HR2vD.js +1 -0
  133. package/dist/assets/{setup-9fDp38sd.js → setup-Bll35TpG.js} +3 -3
  134. package/dist/assets/{shorten-label-BG5illgA.js → shorten-label-BKNhALWt.js} +1 -1
  135. package/dist/assets/{simple-select-BMWDBGsb.js → simple-select-DiucBfFO.js} +1 -1
  136. package/dist/assets/{spaces-CISW823t.js → spaces-D2uHzDSf.js} +1 -1
  137. package/dist/assets/{start-BtjRI2FT.js → start-CCbI2h7_.js} +1 -1
  138. package/dist/assets/{starting-progress-BvCdculj.js → starting-progress-C2KBufhS.js} +1 -1
  139. package/dist/assets/{status-kBSo0EE3.js → status-fhCB_pM_.js} +1 -1
  140. package/dist/assets/{step-actions-CSysf55Z.js → step-actions-C6aMtUZh.js} +1 -1
  141. package/dist/assets/{studio-DRi8O4nl.js → studio-B-QwZrdc.js} +1 -1
  142. package/dist/assets/{switch-control-BE5x5QTG.js → switch-control-88oLMAWm.js} +1 -1
  143. package/dist/assets/{table-tips-BfdUOZWj.js → table-tips-ZIxKRomr.js} +1 -1
  144. package/dist/assets/{team-DA9xMdEQ.js → team-DplrCM_m.js} +1 -1
  145. package/dist/assets/{traffic-BQj5L64I.js → traffic-BU5sjdLg.js} +1 -1
  146. package/dist/assets/{transfer-DQ-esQ54.js → transfer-DWvn8JDa.js} +1 -1
  147. package/dist/assets/{unsubscribe-dC1x4NuC.js → unsubscribe-DPIGic1H.js} +1 -1
  148. package/dist/assets/{use-mobile-DHiqEjn5.js → use-mobile-BhzP2Rp3.js} +1 -1
  149. package/dist/assets/{use-mobile-DapluIyS.js → use-mobile-BtGrkCtZ.js} +1 -1
  150. package/dist/assets/{use-server-logo-BBlO0k2-.js → use-server-logo-BFuFRBQG.js} +1 -1
  151. package/dist/assets/useAsync-DGzYJlYv.js +1 -0
  152. package/dist/assets/{useAsync-Dk1Ydzz6.js → useAsync-DcK0UTnz.js} +1 -1
  153. package/dist/assets/{useLocalStorage-CVZc_3z4.js → useLocalStorage-BRPtTalQ.js} +1 -1
  154. package/dist/assets/{useSetState-BWrXo9eH.js → useSetState-DFuQZPPV.js} +1 -1
  155. package/dist/assets/{user-center-Dx-CKzHU.js → user-center-D4QgyhnU.js} +4 -4
  156. package/dist/assets/{user-sessions-CP2hMWvQ.js → user-sessions-C2LvHnd6.js} +1 -1
  157. package/dist/assets/{util-DLU48yb8.js → util-BGfTex9R.js} +1 -1
  158. package/dist/assets/{util-Cn9ZyU8l.js → util-DtXj9fc3.js} +1 -1
  159. package/dist/assets/{vendor-arcblock-BEuhHuNQ.js → vendor-arcblock-B78OG6SS.js} +1 -1
  160. package/dist/assets/{vendor-hooks-uwq5Zgdd.js → vendor-hooks-HB6DqcLv.js} +1 -1
  161. package/dist/assets/{vendor-mui-core-BwwTYUH3.js → vendor-mui-core-DWYIngcn.js} +1 -1
  162. package/dist/assets/{vendor-mui-x-DDx3HEvj.js → vendor-mui-x-nEbm5eNb.js} +1 -1
  163. package/dist/assets/vendor-react-Dvs43sk9.js +37 -0
  164. package/dist/assets/{vendor-utils-DQY0X1ND.js → vendor-utils-J7aLFpEq.js} +1 -1
  165. package/dist/assets/{vendor-ux-BglKGRhr.js → vendor-ux-Dln42oC3.js} +1 -1
  166. package/dist/assets/{wrap-locale-DOTYikON.js → wrap-locale-BylAyLRV.js} +1 -1
  167. package/dist/assets/{zh-BcwVs5BX.js → zh-C3O8IIjK.js} +1 -1
  168. package/dist/index.html +7 -7
  169. package/dist/service-worker.js +1 -1
  170. package/package.json +24 -24
  171. package/dist/assets/api-CpymM8cn.js +0 -1
  172. package/dist/assets/button-CWzJXH1i.js +0 -1
  173. package/dist/assets/click-to-copy-DPQ0tcO7.js +0 -1
  174. package/dist/assets/cloneDeep-BnFQZ0zY.js +0 -1
  175. package/dist/assets/domains-D8HTnCBf.js +0 -1
  176. package/dist/assets/engine-C3CQWke3.js +0 -1
  177. package/dist/assets/get-safe-url-Cch2GZCp.js +0 -1
  178. package/dist/assets/index-C4mYBCsd.js +0 -1
  179. package/dist/assets/localization-CJSvysj8.js +0 -1
  180. package/dist/assets/logger-Cf2apEtv.js +0 -1
  181. package/dist/assets/omit-pzenKe9G.js +0 -1
  182. package/dist/assets/preferences-DmEdhu1e.js +0 -1
  183. package/dist/assets/profile-embed-BK2tobXZ.js +0 -1
  184. package/dist/assets/publish-resource-M4It07oz.js +0 -1
  185. package/dist/assets/sdk-CzxAlOgp.js +0 -1
  186. package/dist/assets/session-DgH_dTEB.js +0 -1
  187. package/dist/assets/useAsync-CQLW7qpa.js +0 -1
  188. package/dist/assets/vendor-react-x2lQvn4m.js +0 -38
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BcuyH8tS.js","assets/index-dIkcxCDN.js","assets/vendor-mui-core-BwwTYUH3.js","assets/vendor-react-x2lQvn4m.js","assets/vendor-ux-BglKGRhr.js","assets/vendor-utils-DQY0X1ND.js","assets/vendor-hooks-uwq5Zgdd.js","assets/lottie-web-4koyQiv_.js","assets/vendor-ux-DYcPPYq2.css","assets/vendor-arcblock-BEuhHuNQ.js","assets/index-DrVXX4fX.css","assets/index-MGxe3V9B.js","assets/index-DRYJ0xIl.js","assets/index-B5LvOF-F.css"])))=>i.map(i=>d[i]);
2
- import{r as k,i as Et,j as nt,L as we,g as go,k as Ns,l as _s,m as bt}from"./vendor-react-x2lQvn4m.js";import{J as Oe,j as e,ak as a,b4 as Pt,W as r,am as ke,I as ce,dz as Ws,dA as Os,c9 as ko,cd as rt,dB as zs,a_ as Bs,T as A,s as jo,dC as yo,dD as Vs,cM as Us,Y as lt,at as ve,av as Ms,dE as Fs,a5 as Ye,aX as it,bc as Lt,c6 as Hs,bf as Js,b6 as Ze,d6 as Gs,bg as et,Q as X,a6 as Se,c0 as Xs,O as wo,K as vo,P as $t,ai as Co,o as Ro,M as be,a3 as Ks,bB as So,$ as To,bv as Ys,A as He,aJ as Zs,R as Do,z as re,b1 as Re,dF as Kt,bR as tt,dG as Io,V as Eo,S as At,aP as Po,bC as Qs,D as Lo,cs as en,aQ as tn,aR as on,ct as sn,cu as nn,bH as $o,aq as rn,dH as ln,a1 as Ao,a0 as ot,bi as Yt,bE as cn,bF as an,dI as dn,dJ as un,bb as Ct,y as pn,F as hn,bp as mn,bq as ft}from"./vendor-mui-core-BwwTYUH3.js";import{c as F,O as ge,Z as De,$ as bn,M as me,c3 as fn,N as xn,f as Zt,c4 as gn,c5 as Qt,ai as We,a_ as kn,bD as jn,c6 as yn,c7 as wn,c8 as vn}from"./index-dIkcxCDN.js";import{T as G,L as qo,q as Cn,n as $e,a0 as No,z as _o,M as Rn,D as qt,H as W,A as Nt,aP as _t,I as ae,_ as Wo,a as ct,h as Oo}from"./vendor-ux-BglKGRhr.js";import{C as at}from"./confirm-B0IPtkVS.js";import{u as ze}from"./session-DgH_dTEB.js";import{W as Rt}from"./did-address-D7SiJUQw.js";import{E as Je}from"./empty-spinner-DoD2SObf.js";import{B as Wt}from"./bundle-avatar-cdYjPEnW.js";import{S as Te}from"./shorten-label-BG5illgA.js";import{L as Ot}from"./list-header-BROuC1JD.js";import{K as Sn,C as ue,A as zt,D as zo}from"./vendor-utils-DQY0X1ND.js";import{C as Bo}from"./click-to-copy-DPQ0tcO7.js";import{t as Tn}from"./question-mark-circle.svg-YsMacl4Q.js";import{l as Dn,b as In}from"./vendor-hooks-uwq5Zgdd.js";import{u as Me}from"./useSetState-BWrXo9eH.js";import{e as En}from"./engine-C3CQWke3.js";import"./api-CpymM8cn.js";import{T as Pn,S as Ln}from"./vendor-mui-x-DDx3HEvj.js";import{D as eo,C as to,P as oo}from"./react-beautiful-dnd.esm-ByowwdW2.js";import{c as $n,A as Vo,u as Uo,S as An,U as qn,r as Nn}from"./item-7fmoiGq1.js";import{f as xe}from"./index-DBs9Ljax.js";import{D as _n}from"./delete-confirm-DeAivjJv.js";import{g as Mo}from"./get-safe-url-Cch2GZCp.js";import{u as Le}from"./index-Dhyyek4_.js";import{M as Wn}from"./index-BEyKlMs9.js";import{r as On}from"./index-C5pKXOxF.js";import"./vendor-arcblock-BEuhHuNQ.js";import"./lottie-web-4koyQiv_.js";import"./raf-schd.esm-BZ5FB5HD.js";function Bt({did:t,projectId:o,title:s,logo:n,describe:l}){const i=`${`${F.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${t}/${o}/logo/upload`}/${n}`,[d,u]=k.useState(!1),f=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(Pt,{sx:{borderRadius:1},src:i}),e.jsxs(a,{children:[e.jsx(Te,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:f?"primary.main":""},children:s||"/"}),e.jsx(Te,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:f||d?"primary.main":"grey.700"},children:l||"/"})]})]})}Bt.propTypes={projectId:r.string.isRequired,did:r.string.isRequired,title:r.string.isRequired,logo:r.string.isRequired,describe:r.string.isRequired};function Fo({initUrl:t=null}){const o=Et(),s=t?.searchParams.get("tenantScope")||"",{t:n,locale:l}=G(),{api:c}=ge(),{api:i}=ze(),[d,u]=k.useState(!0),{blocklet:f}=De(),[p,m]=k.useState(null),[x,b]=k.useState(!1),h=Oe(E=>E.breakpoints.down("xl")),j=Oe(E=>E.breakpoints.down("md")),{componentDid:v=""}=nt(),[g,C]=k.useState(null),D=`publish-${f.meta.did}`,R=qo(D),[y,T]=k.useState({searchText:R.searchText||"",pageSize:R.rowsPerPage||10,page:1}),O=()=>{c.getProjects({input:{did:f.meta.did,componentDid:v,tenantScope:s}}).then(E=>{const I=E?.projects||[];u(!1),C(I)}).catch(E=>{u(!1),W.error(E.message)})},N=()=>{o(`${F.UNOWNED_DID}/create/none/0.0.0`,{replace:!0})},z=E=>{m(E)},K=()=>{u(!1),b(!0)},P=()=>{b(!1),m(null)},L=E=>{W.error(E.message),b(!1),m(null)},w=E=>{if(!E?.deleted){W.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=Cn.toAddress(E).toLocaleLowerCase(),g.filter(I=>I.blockletTitle.toLowerCase().includes(E)||I.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:n("blocklet.publish.blockletEmptyTip")}),e.jsx(a,{sx:{fontSize:14,color:"text.secondary",mb:3},children:n("blocklet.publish.createBlockletTip")}),e.jsx($e,{onClick:N,variant:"contained",children:n("blocklet.publish.createBlocklet")})]});const Z=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:E=>{const I=g[E];return e.jsx(we,{to:`${I.id}`,children:e.jsx(Bt,{did:f.meta.did,projectId:I.id,logo:I.blockletLogo,title:I.blockletTitle,describe:I.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{searchable:!1,customBodyRender:E=>E?e.jsx(No,{type:"success",children:E}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:E=>E?e.jsx(Rt,{size:14,compact:!0,responsive:!1,did:E}):null}},h||v?null:{label:n("common.createdBy"),name:"createdBy",options:{customBodyRender:E=>E?e.jsx(Rt,{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:n("common.scope"),name:"componentDid",options:{customBodyRender:E=>{const I=(f.children||[]).find(V=>V.meta.did===E);return I?e.jsxs(a,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start"},children:[e.jsx(Wt,{size:14,blocklet:I,ancestors:[f]}),e.jsx(a,{sx:{ml:.5,color:"text.primary",fontSize:14},children:I.meta.title})]},E):""}}},h||s?null:{label:n("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:n("common.updatedAt"),name:"updatedAt",options:{searchable:!1,customBodyRender:E=>e.jsx(_o,{value:Number(E),locale:l})}},{label:n("common.actions"),name:"actions",options:{searchable:!1,customBodyRenderLite:E=>{const I=g[E];return e.jsxs(a,{sx:{display:"flex"},children:[e.jsx(we,{to:`${I.id}/new-release/none/${I.lastReleaseId}`,children:e.jsx(ke,{title:n("blocklet.publish.createRelease"),placement:"top",children:e.jsx(ce,{color:"primary","aria-label":"create",children:e.jsx(Ws,{style:{fontSize:18}})})})}),!!I.lastReleaseId&&e.jsx(ke,{title:n("blocklet.publish.viewLastRelease",{name:I.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"secondary","aria-label":"create",children:e.jsx(we,{style:{display:"flex"},to:`${I.id}/view/${I.lastReleaseId}/${I.blockletVersion}`,children:e.jsx(Os,{sx:{fontSize:18}})})})}),e.jsx(ke,{title:n("blocklet.publish.delete",{name:I.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"primary","aria-label":"delete",onClick:()=>z(I),children:e.jsx(ko,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),H=({page:E,rowsPerPage:I,searchText:V})=>{y.pageSize!==I?T(U=>({...U,searchText:"",pageSize:I,page:1})):y.page!==E+1?T(U=>({...U,searchText:"",page:E+1})):y.searchText!==V&&T(U=>({...U,searchText:V,page:1}))},Q=x?e.jsx(bn,{open:!0,popup:!0,onClose:P,action:"check-has-project-id",locale:l,checkFn:i.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:w,onError:L,extraParams:{projectId:p.id,did:f.meta.did,name:p.blockletTitle},messages:{title:n("blocklet.publish.deleteProject.title",{name:p.blockletTitle}),scan:n("blocklet.publish.deleteProject.scan",{name:p.blockletTitle}),confirm:n("blocklet.publish.deleteProject.confirm"),success:n("blocklet.publish.deleteProject.success")}}):null;return e.jsxs(zn,{children:[e.jsx(Ot,{sx:{mb:2},left:e.jsxs(a,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[e.jsx(a,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:n("common.blockletStudio")}),e.jsx(ke,{title:n("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:e.jsx(zs,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(Rn,{options:{searchPlaceholder:n("blocklet.list.searchPlaceholder"),searchDebounceTime:600,searchAlwaysOpen:j},search:y.searchText,searchText:y.searchText,searchTextUpdate:E=>T(I=>({...I,searchText:E})),searchClose:()=>T(E=>({...E,searchText:""})),onSearchOpen:()=>{}}),e.jsxs($e,{onClick:N,variant:"contained",children:[e.jsx(rt,{style:{fontSize:"1.3em",marginRight:4}}),n("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:D,onChange:H}),p&&e.jsx(at,{title:`${n("common.delete")} ${p.blockletTitle}`,description:n("blocklet.publish.deleteProject.description"),confirm:n("common.confirm"),onConfirm:K,onCancel:()=>m(null),children:e.jsx(a,{sx:{marginTop:2},children:[n("blocklet.publish.deleteProject.tip1"),n("blocklet.publish.deleteProject.tip2"),n("blocklet.publish.deleteProject.tip3")].map(E=>e.jsxs(a,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[e.jsx(Bs,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),e.jsx(A,{component:"span",variant:"inherit",sx:{color:"text.secondary"},children:E})]}))})}),Q]})}const zn=jo(a)`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-LvmCZD51.js","assets/index-CgCJ2qDh.js","assets/vendor-mui-core-DWYIngcn.js","assets/vendor-react-Dvs43sk9.js","assets/vendor-ux-Dln42oC3.js","assets/vendor-utils-J7aLFpEq.js","assets/vendor-hooks-HB6DqcLv.js","assets/lottie-web-4koyQiv_.js","assets/vendor-ux-DYcPPYq2.css","assets/vendor-arcblock-B78OG6SS.js","assets/index-DrVXX4fX.css","assets/index-BPy8_fa2.js","assets/index-DRYJ0xIl.js","assets/index-B5LvOF-F.css"])))=>i.map(i=>d[i]);
2
+ import{r as k,i as Et,j as nt,L as we,g as go,k as Ns,l as _s,m as bt}from"./vendor-react-Dvs43sk9.js";import{J as Oe,j as e,ak as a,b4 as Pt,W as r,am as ke,I as ce,dz as Ws,dA as Os,c9 as ko,cd as rt,dB as zs,a_ as Bs,T as A,s as jo,dC as yo,dD as Vs,cM as Us,Y as lt,at as ve,av as Ms,dE as Fs,a5 as Ye,aX as it,bc as Lt,c6 as Hs,bf as Js,b6 as Ze,d6 as Gs,bg as et,Q as X,a6 as Se,c0 as Xs,O as wo,K as vo,P as $t,ai as Co,o as Ro,M as be,a3 as Ks,bB as So,$ as To,bv as Ys,A as He,aJ as Zs,R as Do,z as re,b1 as Re,dF as Kt,bR as tt,dG as Io,V as Eo,S as At,aP as Po,bC as Qs,D as Lo,cs as en,aQ as tn,aR as on,ct as sn,cu as nn,bH as $o,aq as rn,dH as ln,a1 as Ao,a0 as ot,bi as Yt,bE as cn,bF as an,dI as dn,dJ as un,bb as Ct,y as pn,F as hn,bp as mn,bq as ft}from"./vendor-mui-core-DWYIngcn.js";import{c as F,O as ge,Z as De,$ as bn,M as me,c3 as fn,N as xn,f as Zt,c4 as gn,c5 as Qt,ai as We,a_ as kn,bD as jn,c6 as yn,c7 as wn,c8 as vn}from"./index-CgCJ2qDh.js";import{T as G,L as qo,q as Cn,n as $e,a0 as No,z as _o,M as Rn,D as qt,H as W,A as Nt,aP as _t,I as ae,_ as Wo,a as ct,h as Oo}from"./vendor-ux-Dln42oC3.js";import{C as at}from"./confirm-B4BzkG04.js";import{u as ze}from"./session-BV5HR2vD.js";import{W as Rt}from"./did-address-CdYAzzjR.js";import{E as Je}from"./empty-spinner-C6wgiyAQ.js";import{B as Wt}from"./bundle-avatar-DkLBEfff.js";import{S as Te}from"./shorten-label-BKNhALWt.js";import{L as Ot}from"./list-header-CGX6Hi0X.js";import{K as Sn,C as ue,A as zt,D as zo}from"./vendor-utils-J7aLFpEq.js";import{C as Bo}from"./click-to-copy-m7BzOuWH.js";import{t as Tn}from"./question-mark-circle.svg-B4stD6SS.js";import{l as Dn,b as In}from"./vendor-hooks-HB6DqcLv.js";import{u as Me}from"./useSetState-DFuQZPPV.js";import{e as En}from"./engine-DHKpyPwC.js";import"./api-BV16dSSm.js";import{T as Pn,S as Ln}from"./vendor-mui-x-nEbm5eNb.js";import{D as eo,C as to,P as oo}from"./react-beautiful-dnd.esm-DwkY3sYg.js";import{c as $n,A as Vo,u as Uo,S as An,U as qn,r as Nn}from"./item-C8OCvu8j.js";import{f as xe}from"./index-DBs9Ljax.js";import{D as _n}from"./delete-confirm-DhfRzwF1.js";import{g as Mo}from"./get-safe-url-Ce6hawV-.js";import{u as Le}from"./index-SrN5SE_r.js";import{M as Wn}from"./index-CW67obch.js";import{r as On}from"./index-BaBIefeb.js";import"./vendor-arcblock-B78OG6SS.js";import"./lottie-web-4koyQiv_.js";import"./raf-schd.esm-CHNehTG3.js";function Bt({did:t,projectId:o,title:s,logo:n,describe:l}){const i=`${`${F.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${t}/${o}/logo/upload`}/${n}`,[d,u]=k.useState(!1),f=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(Pt,{sx:{borderRadius:1},src:i}),e.jsxs(a,{children:[e.jsx(Te,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:f?"primary.main":""},children:s||"/"}),e.jsx(Te,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:f||d?"primary.main":"grey.700"},children:l||"/"})]})]})}Bt.propTypes={projectId:r.string.isRequired,did:r.string.isRequired,title:r.string.isRequired,logo:r.string.isRequired,describe:r.string.isRequired};function Fo({initUrl:t=null}){const o=Et(),s=t?.searchParams.get("tenantScope")||"",{t:n,locale:l}=G(),{api:c}=ge(),{api:i}=ze(),[d,u]=k.useState(!0),{blocklet:f}=De(),[p,m]=k.useState(null),[x,b]=k.useState(!1),h=Oe(E=>E.breakpoints.down("xl")),j=Oe(E=>E.breakpoints.down("md")),{componentDid:v=""}=nt(),[g,C]=k.useState(null),D=`publish-${f.meta.did}`,R=qo(D),[y,T]=k.useState({searchText:R.searchText||"",pageSize:R.rowsPerPage||10,page:1}),O=()=>{c.getProjects({input:{did:f.meta.did,componentDid:v,tenantScope:s}}).then(E=>{const I=E?.projects||[];u(!1),C(I)}).catch(E=>{u(!1),W.error(E.message)})},N=()=>{o(`${F.UNOWNED_DID}/create/none/0.0.0`,{replace:!0})},z=E=>{m(E)},K=()=>{u(!1),b(!0)},P=()=>{b(!1),m(null)},L=E=>{W.error(E.message),b(!1),m(null)},w=E=>{if(!E?.deleted){W.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=Cn.toAddress(E).toLocaleLowerCase(),g.filter(I=>I.blockletTitle.toLowerCase().includes(E)||I.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:n("blocklet.publish.blockletEmptyTip")}),e.jsx(a,{sx:{fontSize:14,color:"text.secondary",mb:3},children:n("blocklet.publish.createBlockletTip")}),e.jsx($e,{onClick:N,variant:"contained",children:n("blocklet.publish.createBlocklet")})]});const Z=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:E=>{const I=g[E];return e.jsx(we,{to:`${I.id}`,children:e.jsx(Bt,{did:f.meta.did,projectId:I.id,logo:I.blockletLogo,title:I.blockletTitle,describe:I.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{searchable:!1,customBodyRender:E=>E?e.jsx(No,{type:"success",children:E}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:E=>E?e.jsx(Rt,{size:14,compact:!0,responsive:!1,did:E}):null}},h||v?null:{label:n("common.createdBy"),name:"createdBy",options:{customBodyRender:E=>E?e.jsx(Rt,{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:n("common.scope"),name:"componentDid",options:{customBodyRender:E=>{const I=(f.children||[]).find(V=>V.meta.did===E);return I?e.jsxs(a,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start"},children:[e.jsx(Wt,{size:14,blocklet:I,ancestors:[f]}),e.jsx(a,{sx:{ml:.5,color:"text.primary",fontSize:14},children:I.meta.title})]},E):""}}},h||s?null:{label:n("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:n("common.updatedAt"),name:"updatedAt",options:{searchable:!1,customBodyRender:E=>e.jsx(_o,{value:Number(E),locale:l})}},{label:n("common.actions"),name:"actions",options:{searchable:!1,customBodyRenderLite:E=>{const I=g[E];return e.jsxs(a,{sx:{display:"flex"},children:[e.jsx(we,{to:`${I.id}/new-release/none/${I.lastReleaseId}`,children:e.jsx(ke,{title:n("blocklet.publish.createRelease"),placement:"top",children:e.jsx(ce,{color:"primary","aria-label":"create",children:e.jsx(Ws,{style:{fontSize:18}})})})}),!!I.lastReleaseId&&e.jsx(ke,{title:n("blocklet.publish.viewLastRelease",{name:I.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"secondary","aria-label":"create",children:e.jsx(we,{style:{display:"flex"},to:`${I.id}/view/${I.lastReleaseId}/${I.blockletVersion}`,children:e.jsx(Os,{sx:{fontSize:18}})})})}),e.jsx(ke,{title:n("blocklet.publish.delete",{name:I.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"primary","aria-label":"delete",onClick:()=>z(I),children:e.jsx(ko,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),H=({page:E,rowsPerPage:I,searchText:V})=>{y.pageSize!==I?T(U=>({...U,searchText:"",pageSize:I,page:1})):y.page!==E+1?T(U=>({...U,searchText:"",page:E+1})):y.searchText!==V&&T(U=>({...U,searchText:V,page:1}))},Q=x?e.jsx(bn,{open:!0,popup:!0,onClose:P,action:"check-has-project-id",locale:l,checkFn:i.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:w,onError:L,extraParams:{projectId:p.id,did:f.meta.did,name:p.blockletTitle},messages:{title:n("blocklet.publish.deleteProject.title",{name:p.blockletTitle}),scan:n("blocklet.publish.deleteProject.scan",{name:p.blockletTitle}),confirm:n("blocklet.publish.deleteProject.confirm"),success:n("blocklet.publish.deleteProject.success")}}):null;return e.jsxs(zn,{children:[e.jsx(Ot,{sx:{mb:2},left:e.jsxs(a,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[e.jsx(a,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:n("common.blockletStudio")}),e.jsx(ke,{title:n("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:e.jsx(zs,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(Rn,{options:{searchPlaceholder:n("blocklet.list.searchPlaceholder"),searchDebounceTime:600,searchAlwaysOpen:j},search:y.searchText,searchText:y.searchText,searchTextUpdate:E=>T(I=>({...I,searchText:E})),searchClose:()=>T(E=>({...E,searchText:""})),onSearchOpen:()=>{}}),e.jsxs($e,{onClick:N,variant:"contained",children:[e.jsx(rt,{style:{fontSize:"1.3em",marginRight:4}}),n("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:D,onChange:H}),p&&e.jsx(at,{title:`${n("common.delete")} ${p.blockletTitle}`,description:n("blocklet.publish.deleteProject.description"),confirm:n("common.confirm"),onConfirm:K,onCancel:()=>m(null),children:e.jsx(a,{sx:{marginTop:2},children:[n("blocklet.publish.deleteProject.tip1"),n("blocklet.publish.deleteProject.tip2"),n("blocklet.publish.deleteProject.tip3")].map(E=>e.jsxs(a,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[e.jsx(Bs,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),e.jsx(A,{component:"span",variant:"inherit",sx:{color:"text.secondary"},children:E})]}))})}),Q]})}const zn=jo(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,i as Et,j as nt,L as we,g as go,k as Ns,l as _s,m as bt}from"./ven
142
142
  background: #fff;
143
143
  z-index: 10;
144
144
  }
145
- `,ao="lastWantToConnectStoreId";function or(t){const[o,s]=k.useState(null),{session:n}=ze(),l=k.useCallback(d=>{s(d),localStorage.setItem(ao,d?.id)},[s]),c=k.useMemo(()=>{const d=localStorage.getItem(ao),u=d?(t?.settings?.storeList||[]).find(p=>p.id===d):null;if(u)return u;let f=(t?.settings?.storeList||[]).find(p=>!(p.id!==F.BLOCKLET_STORE.id||p.scope&&p.scope!=="studio"&&p.scope!==n?.user?.did));return f||(f=t?.settings?.storeList?.[0]),f},[t?.settings?.storeList,n?.user?.did]);return[o||c||{},l]}const vt={};async function Vt(t,{interval:o=1e3,maxDuration:s=120*1e3,intervalFirst:n=4e3,timerKey:l=""}){vt[l]&&clearTimeout(vt[l]),await new Promise(d=>setTimeout(d,n));const c=Date.now(),i=async(d,u)=>{try{const f=await t();d(f)}catch(f){Date.now()-c>s?u(f):l?vt[l]=setTimeout(()=>i(d,u),o):setTimeout(()=>i(d,u),o)}};return new Promise(i)}function sr(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function nr(t,{did:o,projectId:s,messageId:n}){return Vt(async()=>{const l=await t.getProject({input:{did:o,projectId:s,messageId:n}});if(!l?.project?.blockletDid)throw new Error("Connected store not found");return l.project.blockletDid},{timerKey:"connect-studio"})}function rr(t,{did:o,projectId:s,storeId:n}){return Vt(async()=>{const l=await t.getProject({input:{did:o,projectId:s,messageId:""}});if(!l?.project?.connectedStores?.length)throw new Error("Connected store not found");if(!l.project.connectedStores.find(i=>i.storeId===n))throw new Error("Connected store not found")},{timerKey:`connect-store-${n}`})}function lr(t,{did:o,projectId:s,endpointId:n}){return Vt(async()=>{const l=await t.getProject({input:{did:o,projectId:s,messageId:""}});if(!l?.project?.connectedEndpoints?.length)throw new Error("Connected endpoint not found");if(!l.project.connectedEndpoints.find(i=>i.endpointId===n))throw new Error("Connected endpoint not found")},{timerKey:`connect-store-${n}`})}const Ut=({fromBlocklet:t,nodeInfo:o,blocklet:s,userDid:n})=>{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||!i.scope||i.scope==="studio"||i.scope===n),{teamDid:l,storeList:c}};function os({blocklet:t=null,store:o=null,onChangeStore:s,onClick:n,disabled:l,loading:c,componentDid:i}){const{t:d}=G(),{session:u}=ze(),{api:f,info:p,inService:m}=ge(),x=De(),[b,h]=k.useState(!1),j=k.useRef(null),[v,g]=k.useState(!1),[C,D]=k.useState(null),R=L=>{s(L),h(!1)},y=()=>{h(!b)},T=L=>{j.current&&j.current.contains(L.target)||h(!1)},O=()=>{g(!0)},N=()=>{g(!1)},z=async()=>{if(C)try{await f.deleteBlockletStore({input:{teamDid:t.meta.did,url:C.url,projectId:"",scope:C.scope||"studio"}}),await x?.actions?.refreshBlocklet()}catch(L){W.error(`Remove Blocklet Store Error: ${xe(L)}`)}finally{D(null)}},{storeList:K}=Ut({fromBlocklet:m,blocklet:t,nodeInfo:p,userDid:u?.user?.did}),P=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(X,{onClick:n,children:[c&&e.jsx(Se,{size:14,sx:{mr:.5}}),`${d("common.connect")} ${o.name||""}`]}),e.jsx(X,{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(wo,{sx:{zIndex:10},open:b,anchorEl:j.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:L})=>e.jsx(vo,{...L,style:{transformOrigin:"center top"},children:e.jsx($t,{children:e.jsx(Co,{onClickAway:T,children:e.jsxs(Ro,{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})]}),$n({store:w,userDid:u?.user?.did})&&e.jsx(ce,{sx:{ml:1},onClick:S=>{S.preventDefault(),S.stopPropagation(),D(w)},children:e.jsx(ae,{icon:"ic:outline-delete"})})]},w.url)),e.jsx(Ks,{}),e.jsxs(be,{onClick:O,children:[e.jsx(rt,{font:!0}),e.jsx(A,{variant:"inherit",children:d("store.blockletRegistry.addRegistry")})]})]})})})})}),v&&e.jsx(Vo,{hiddenChildren:!0,open:!0,onClose:N,teamDid:P,storeList:K,scope:"studio",onAdd:x?.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:()=>D(null)})]})}os.propTypes={store:r.object,blocklet:r.object,onChangeStore:r.func.isRequired,onClick:r.func.isRequired,loading:r.bool.isRequired,disabled:r.bool.isRequired,componentDid:r.string.isRequired,projectType:r.string.isRequired,getData:r.func.isRequired};const ss=(t,o,s)=>{const n=`${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?`${n}/${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:n,uploadScreenshotPrefix:l}},ir=t=>{const o=t.includes("youtube.com")||t.includes("youtu.be"),s=t.includes("vimeo.com");return o||s};function Mt({url:t,style:o={},controls:s=1,modestbranding:n=1}){const{t:l}=G(),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=${n}&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")})]})})}Mt.propTypes={url:r.string.isRequired,style:r.object,controls:r.number,modestbranding:r.number};function ns({setParams:t,onClose:o,params:s}){const{t:n}=G(),[l,c]=k.useState(""),i=l&&s.blockletVideos.includes(l),d=ir(l),u=()=>{t(f=>{const p=[...f.blockletVideos];return p.push(l),{...f,blockletVideos:p}}),o()};return e.jsxs(lt,{open:!0,fullWidth:!0,maxWidth:"sm",children:[e.jsx(So,{children:n("studio.videoDialogTitle")}),e.jsxs(To,{children:[e.jsx(Ys,{fullWidth:!0,value:l,onChange:f=>c(f.target.value),placeholder:n("studio.videoInputLabel"),endAdornment:l?e.jsx(He,{position:"end",children:e.jsx(ce,{onClick:()=>c(""),children:e.jsx(Zs,{})})}):null,error:i}),i&&e.jsx(A,{variant:"body2",color:"error",children:n("studio.duplicateVideo")}),e.jsx(Mt,{url:l,style:{marginTop:"20px",borderRadius:"4px"}})]}),e.jsxs(Do,{children:[e.jsx(X,{onClick:()=>o(),children:n("studio.cancel")}),e.jsx(X,{disabled:!d||i,onClick:u,children:n("studio.confirm")})]})]})}ns.propTypes={onClose:r.func.isRequired,params:r.object.isRequired,setParams:r.func.isRequired};function St({errors:t,storeList:o,...s}){const{t:n}=G();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:n("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(ke,{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)})]})}St.propTypes={errors:r.object.isRequired,storeList:r.array.isRequired};const uo=k.lazy(()=>Wo(()=>import("./index-BcuyH8tS.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])).then(t=>({default:t.Uploader})));function rs({projectId:t,readOnly:o,loading:s,blocklet:n,params:l,setParams:c,paramsErrTip:i,setParamsErrTip:d,warning:u,setLoading:f,initUrl:p=null,initLogoUrl:m,setInitLogoUrl:x,componentDid:b=""}){const{t:h,locale:j}=G(),{api:v}=ge(),g=Et(),C=k.useRef(null),D=k.useRef(null),[R,y]=or(n),[T,O]=k.useState(!1),N=Uo({messageType:"connect-store-message",onOpen:()=>f(!0),onClose:()=>f(!1)}),z=async q=>{const Y=setTimeout(()=>{f(!1)},2e4),J=await nr(v,q);f(!1),clearTimeout(Y),window.parent.postMessage({event:"studioDialog.connected",componentDid:b},"*"),g(window.location.pathname.replace(`${F.UNOWNED_DID}/create`,`${J}/create`),{replace:!0})},K=()=>{if(!l.blockletTitle){W.error(h("blocklet.publish.errorTip.noTitle"));return}if(!R?.url){W.error(h("blocklet.publish.noStoreSelected"));return}const q=sr();N(async(Y,J)=>{try{const se=await v.connectByStudio({input:{did:n?.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){W.error("failed to connect to store");return}J(se.url),z({did:n?.meta?.did,projectId:"",messageId:q})}catch(se){const de=xe(se);W.error(de),f(!1)}})},{logoUrl:P,screenshotUrls:L,uploadLogoPrefix:w,uploadScreenshotPrefix:S}=ss(l,n,t),{logoErrors:Z,screenshotErrors:H,storeList:Q,hasLogoWarning:E,hasScreenshotWarning:I}=u,V=()=>o?!1:!t||t===F.UNOWNED_DID?(W.error(h("blocklet.publish.errorTip.noFirstDid")),!1):!0,U=q=>{if(!q.destination)return;const Y=Array.from(l.blockletScreenshots),[J]=Y.splice(q.source.index,1);Y.splice(q.destination.index,0,J),c(se=>({...se,blockletScreenshots:Y}))},ee=q=>{if(!q.destination)return;const Y=Array.from(l.blockletVideos),[J]=Y.splice(q.source.index,1);Y.splice(q.destination.index,0,J),c(se=>({...se,blockletVideos:Y}))};return e.jsxs(cr,{children:[e.jsx(a,{className:"section",sx:{display:"flex"},children:e.jsxs(a,{sx:{flex:1},children:[e.jsx(re,{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(re,{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(He,{position:"end",children:e.jsx(os,{blocklet:n,store:R,componentDid:b,onChangeStore:y,disabled:!l.blockletTitle||o||s,loading:s,onClick:K})})}}}),e.jsx(re,{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(re,{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(re,{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(re,{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(re,{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(Pt,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:m||P,onClick:()=>{V()&&C.current?.open()}})})]}),E&&e.jsx(St,{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(eo,{onDragEnd:o?void 0:U,children:e.jsx(to,{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:[L.map((J,se)=>e.jsx(oo,{draggableId:J,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:J}),!o&&e.jsx(ce,{...de.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:e.jsx(Kt,{})}),!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,{})})]})},J)),q.placeholder,L.length<5&&e.jsx(a,{onClick:()=>{V()&&D.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:"+"})]})})})]}),I&&e.jsx(St,{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(eo,{onDragEnd:o?void 0:ee,children:e.jsx(to,{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((J,se)=>e.jsx(oo,{draggableId:J,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(Mt,{url:J,style:{pointerEvents:le.isDragging?"none":"auto"}}),!o&&e.jsx(ce,{...de.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:e.jsx(Kt,{})}),!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,{})})]})},J)),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(uo,{ref:C,locale:j,popup:!0,onUploadFinish:q=>{c({blockletLogo:q.data.filename}),x(""),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(ns,{onClose:()=>O(!1),params:l,setParams:c}),e.jsx(uo,{ref:D,locale:j,popup:!0,onUploadFinish:q=>{c(Y=>{const J=Y.blockletScreenshots||[];return J.push(q.data?.filename),{...Y,blockletScreenshots:J}}),D.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-L.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")]})]})}rs.propTypes={projectId:r.string.isRequired,readOnly:r.bool.isRequired,params:r.object.isRequired,setParams:r.func.isRequired,paramsErrTip:r.object.isRequired,setParamsErrTip:r.func.isRequired,warning:r.object.isRequired,loading:r.bool.isRequired,blocklet:r.object.isRequired,setLoading:r.func.isRequired,initUrl:r.object,componentDid:r.string,initLogoUrl:r.string.isRequired,setInitLogoUrl:r.func.isRequired};const cr=ve.div`
145
+ `,ao="lastWantToConnectStoreId";function or(t){const[o,s]=k.useState(null),{session:n}=ze(),l=k.useCallback(d=>{s(d),localStorage.setItem(ao,d?.id)},[s]),c=k.useMemo(()=>{const d=localStorage.getItem(ao),u=d?(t?.settings?.storeList||[]).find(p=>p.id===d):null;if(u)return u;let f=(t?.settings?.storeList||[]).find(p=>!(p.id!==F.BLOCKLET_STORE.id||p.scope&&p.scope!=="studio"&&p.scope!==n?.user?.did));return f||(f=t?.settings?.storeList?.[0]),f},[t?.settings?.storeList,n?.user?.did]);return[o||c||{},l]}const vt={};async function Vt(t,{interval:o=1e3,maxDuration:s=120*1e3,intervalFirst:n=4e3,timerKey:l=""}){vt[l]&&clearTimeout(vt[l]),await new Promise(d=>setTimeout(d,n));const c=Date.now(),i=async(d,u)=>{try{const f=await t();d(f)}catch(f){Date.now()-c>s?u(f):l?vt[l]=setTimeout(()=>i(d,u),o):setTimeout(()=>i(d,u),o)}};return new Promise(i)}function sr(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function nr(t,{did:o,projectId:s,messageId:n}){return Vt(async()=>{const l=await t.getProject({input:{did:o,projectId:s,messageId:n}});if(!l?.project?.blockletDid)throw new Error("Connected store not found");return l.project.blockletDid},{timerKey:"connect-studio"})}function rr(t,{did:o,projectId:s,storeId:n}){return Vt(async()=>{const l=await t.getProject({input:{did:o,projectId:s,messageId:""}});if(!l?.project?.connectedStores?.length)throw new Error("Connected store not found");if(!l.project.connectedStores.find(i=>i.storeId===n))throw new Error("Connected store not found")},{timerKey:`connect-store-${n}`})}function lr(t,{did:o,projectId:s,endpointId:n}){return Vt(async()=>{const l=await t.getProject({input:{did:o,projectId:s,messageId:""}});if(!l?.project?.connectedEndpoints?.length)throw new Error("Connected endpoint not found");if(!l.project.connectedEndpoints.find(i=>i.endpointId===n))throw new Error("Connected endpoint not found")},{timerKey:`connect-store-${n}`})}const Ut=({fromBlocklet:t,nodeInfo:o,blocklet:s,userDid:n})=>{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||!i.scope||i.scope==="studio"||i.scope===n),{teamDid:l,storeList:c}};function os({blocklet:t=null,store:o=null,onChangeStore:s,onClick:n,disabled:l,loading:c,componentDid:i}){const{t:d}=G(),{session:u}=ze(),{api:f,info:p,inService:m}=ge(),x=De(),[b,h]=k.useState(!1),j=k.useRef(null),[v,g]=k.useState(!1),[C,D]=k.useState(null),R=L=>{s(L),h(!1)},y=()=>{h(!b)},T=L=>{j.current&&j.current.contains(L.target)||h(!1)},O=()=>{g(!0)},N=()=>{g(!1)},z=async()=>{if(C)try{await f.deleteBlockletStore({input:{teamDid:t.meta.did,url:C.url,projectId:"",scope:C.scope||"studio"}}),await x?.actions?.refreshBlocklet()}catch(L){W.error(`Remove Blocklet Store Error: ${xe(L)}`)}finally{D(null)}},{storeList:K}=Ut({fromBlocklet:m,blocklet:t,nodeInfo:p,userDid:u?.user?.did}),P=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(X,{onClick:n,children:[c&&e.jsx(Se,{size:14,sx:{mr:.5}}),`${d("common.connect")} ${o.name||""}`]}),e.jsx(X,{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(wo,{sx:{zIndex:10},open:b,anchorEl:j.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:L})=>e.jsx(vo,{...L,style:{transformOrigin:"center top"},children:e.jsx($t,{children:e.jsx(Co,{onClickAway:T,children:e.jsxs(Ro,{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})]}),$n({store:w,userDid:u?.user?.did})&&e.jsx(ce,{sx:{ml:1},onClick:S=>{S.preventDefault(),S.stopPropagation(),D(w)},children:e.jsx(ae,{icon:"ic:outline-delete"})})]},w.url)),e.jsx(Ks,{}),e.jsxs(be,{onClick:O,children:[e.jsx(rt,{font:!0}),e.jsx(A,{variant:"inherit",children:d("store.blockletRegistry.addRegistry")})]})]})})})})}),v&&e.jsx(Vo,{hiddenChildren:!0,open:!0,onClose:N,teamDid:P,storeList:K,scope:"studio",onAdd:x?.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:()=>D(null)})]})}os.propTypes={store:r.object,blocklet:r.object,onChangeStore:r.func.isRequired,onClick:r.func.isRequired,loading:r.bool.isRequired,disabled:r.bool.isRequired,componentDid:r.string.isRequired,projectType:r.string.isRequired,getData:r.func.isRequired};const ss=(t,o,s)=>{const n=`${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?`${n}/${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:n,uploadScreenshotPrefix:l}},ir=t=>{const o=t.includes("youtube.com")||t.includes("youtu.be"),s=t.includes("vimeo.com");return o||s};function Mt({url:t,style:o={},controls:s=1,modestbranding:n=1}){const{t:l}=G(),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=${n}&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")})]})})}Mt.propTypes={url:r.string.isRequired,style:r.object,controls:r.number,modestbranding:r.number};function ns({setParams:t,onClose:o,params:s}){const{t:n}=G(),[l,c]=k.useState(""),i=l&&s.blockletVideos.includes(l),d=ir(l),u=()=>{t(f=>{const p=[...f.blockletVideos];return p.push(l),{...f,blockletVideos:p}}),o()};return e.jsxs(lt,{open:!0,fullWidth:!0,maxWidth:"sm",children:[e.jsx(So,{children:n("studio.videoDialogTitle")}),e.jsxs(To,{children:[e.jsx(Ys,{fullWidth:!0,value:l,onChange:f=>c(f.target.value),placeholder:n("studio.videoInputLabel"),endAdornment:l?e.jsx(He,{position:"end",children:e.jsx(ce,{onClick:()=>c(""),children:e.jsx(Zs,{})})}):null,error:i}),i&&e.jsx(A,{variant:"body2",color:"error",children:n("studio.duplicateVideo")}),e.jsx(Mt,{url:l,style:{marginTop:"20px",borderRadius:"4px"}})]}),e.jsxs(Do,{children:[e.jsx(X,{onClick:()=>o(),children:n("studio.cancel")}),e.jsx(X,{disabled:!d||i,onClick:u,children:n("studio.confirm")})]})]})}ns.propTypes={onClose:r.func.isRequired,params:r.object.isRequired,setParams:r.func.isRequired};function St({errors:t,storeList:o,...s}){const{t:n}=G();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:n("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(ke,{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)})]})}St.propTypes={errors:r.object.isRequired,storeList:r.array.isRequired};const uo=k.lazy(()=>Wo(()=>import("./index-LvmCZD51.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])).then(t=>({default:t.Uploader})));function rs({projectId:t,readOnly:o,loading:s,blocklet:n,params:l,setParams:c,paramsErrTip:i,setParamsErrTip:d,warning:u,setLoading:f,initUrl:p=null,initLogoUrl:m,setInitLogoUrl:x,componentDid:b=""}){const{t:h,locale:j}=G(),{api:v}=ge(),g=Et(),C=k.useRef(null),D=k.useRef(null),[R,y]=or(n),[T,O]=k.useState(!1),N=Uo({messageType:"connect-store-message",onOpen:()=>f(!0),onClose:()=>f(!1)}),z=async q=>{const Y=setTimeout(()=>{f(!1)},2e4),J=await nr(v,q);f(!1),clearTimeout(Y),window.parent.postMessage({event:"studioDialog.connected",componentDid:b},"*"),g(window.location.pathname.replace(`${F.UNOWNED_DID}/create`,`${J}/create`),{replace:!0})},K=()=>{if(!l.blockletTitle){W.error(h("blocklet.publish.errorTip.noTitle"));return}if(!R?.url){W.error(h("blocklet.publish.noStoreSelected"));return}const q=sr();N(async(Y,J)=>{try{const se=await v.connectByStudio({input:{did:n?.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){W.error("failed to connect to store");return}J(se.url),z({did:n?.meta?.did,projectId:"",messageId:q})}catch(se){const de=xe(se);W.error(de),f(!1)}})},{logoUrl:P,screenshotUrls:L,uploadLogoPrefix:w,uploadScreenshotPrefix:S}=ss(l,n,t),{logoErrors:Z,screenshotErrors:H,storeList:Q,hasLogoWarning:E,hasScreenshotWarning:I}=u,V=()=>o?!1:!t||t===F.UNOWNED_DID?(W.error(h("blocklet.publish.errorTip.noFirstDid")),!1):!0,U=q=>{if(!q.destination)return;const Y=Array.from(l.blockletScreenshots),[J]=Y.splice(q.source.index,1);Y.splice(q.destination.index,0,J),c(se=>({...se,blockletScreenshots:Y}))},ee=q=>{if(!q.destination)return;const Y=Array.from(l.blockletVideos),[J]=Y.splice(q.source.index,1);Y.splice(q.destination.index,0,J),c(se=>({...se,blockletVideos:Y}))};return e.jsxs(cr,{children:[e.jsx(a,{className:"section",sx:{display:"flex"},children:e.jsxs(a,{sx:{flex:1},children:[e.jsx(re,{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(re,{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(He,{position:"end",children:e.jsx(os,{blocklet:n,store:R,componentDid:b,onChangeStore:y,disabled:!l.blockletTitle||o||s,loading:s,onClick:K})})}}}),e.jsx(re,{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(re,{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(re,{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(re,{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(re,{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(Pt,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:m||P,onClick:()=>{V()&&C.current?.open()}})})]}),E&&e.jsx(St,{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(eo,{onDragEnd:o?void 0:U,children:e.jsx(to,{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:[L.map((J,se)=>e.jsx(oo,{draggableId:J,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:J}),!o&&e.jsx(ce,{...de.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:e.jsx(Kt,{})}),!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,{})})]})},J)),q.placeholder,L.length<5&&e.jsx(a,{onClick:()=>{V()&&D.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:"+"})]})})})]}),I&&e.jsx(St,{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(eo,{onDragEnd:o?void 0:ee,children:e.jsx(to,{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((J,se)=>e.jsx(oo,{draggableId:J,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(Mt,{url:J,style:{pointerEvents:le.isDragging?"none":"auto"}}),!o&&e.jsx(ce,{...de.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:e.jsx(Kt,{})}),!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,{})})]})},J)),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(uo,{ref:C,locale:j,popup:!0,onUploadFinish:q=>{c({blockletLogo:q.data.filename}),x(""),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(ns,{onClose:()=>O(!1),params:l,setParams:c}),e.jsx(uo,{ref:D,locale:j,popup:!0,onUploadFinish:q=>{c(Y=>{const J=Y.blockletScreenshots||[];return J.push(q.data?.filename),{...Y,blockletScreenshots:J}}),D.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-L.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")]})]})}rs.propTypes={projectId:r.string.isRequired,readOnly:r.bool.isRequired,params:r.object.isRequired,setParams:r.func.isRequired,paramsErrTip:r.object.isRequired,setParamsErrTip:r.func.isRequired,warning:r.object.isRequired,loading:r.bool.isRequired,blocklet:r.object.isRequired,setLoading:r.func.isRequired,initUrl:r.object,componentDid:r.string,initLogoUrl:r.string.isRequired,setInitLogoUrl:r.func.isRequired};const cr=ve.div`
146
146
  margin-top: 24px;
147
147
  .screenshot {
148
148
  margin-bottom: 16px;
@@ -190,7 +190,7 @@ import{r as k,i as Et,j as nt,L as we,g as go,k as Ns,l as _s,m as bt}from"./ven
190
190
  padding-bottom: 12px;
191
191
  border-bottom: ${({theme:t})=>`1px solid ${t.palette.divider}`};
192
192
  }
193
- `;function xs({text:t}){const{palette:o}=Lo();return t?e.jsx(Wn,{style:{backgroundColor:o.background.default,color:o.text.primary},wrapperElement:{"data-color-mode":"light"},source:jn.sanitize(t),rehypePlugins:[[On,{target:"_blank"}]]}):e.jsx(Fe,{Icon:_t})}xs.propTypes={text:r.string.isRequired};function gs({params:t,setParams:o,paramsErrTip:s,loading:n,setParamsErrTip:l,readOnly:c}){const{t:i}=G(),[d,u]=k.useState(c?"preview":"write"),f=(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(Ao,{value:d,onChange:f,"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(re,{disabled:n||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(He,{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(xs,{text:t.blockletIntroduction||""})})]})}gs.propTypes={params:r.object.isRequired,setParams:r.func.isRequired,paramsErrTip:r.object.isRequired,setParamsErrTip:r.func.isRequired,readOnly:r.bool.isRequired,loading:r.bool.isRequired};function ks({step:t=0,ok:o=!1,active:s=0,error:n="",warning:l=!1}){let c="grey.500",i=t+1;return o&&(i=e.jsx($o,{sx:{fontSize:18,margin:0},color:"white"})),n||!o&&s>t?(c="error.main",i=e.jsx(Yt,{sx:{fontSize:18,margin:0},color:"white"})):l?(c="warning.main",i=e.jsx(Yt,{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})}ks.propTypes={step:r.number,ok:r.bool,active:r.number,error:r.string,warning:r.bool};function js({steps:t,activeStep:o,setActiveStep:s,hasSelectedResources:n=!1,params:l,loading:c,paramsErrTip:i,warning:d,viewMode:u="",projectId:f}){const{t:p}=G(),m=()=>{s(j=>j+1)},x=()=>{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||ls({params:l,projectId:f,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(cn,{activeStep:o,orientation:"vertical",children:t.map((j,v)=>{const g={},C=c||!hr({params:l,projectId:f,step:v,t:p}),D=c?"":b(v);return D&&(g.optional=e.jsx(A,{variant:"caption",color:"error",sx:{wordBreak:"break-word"},children:D}),g.error=!0),e.jsxs(an,{children:[e.jsx(dn,{icon:e.jsx(ks,{error:D,warning:v===0?d.hasWarning:!1,active:h?99:o,step:v,ok:C}),sx:{cursor:"pointer",color:D?"error.main":"inherit"},disabled:!1,onClick:()=>s(v),...g,children:e.jsx(A,{fontSize:"14px",fontWeight:"500",color:D||!C&&o>v?"error.main":"inherit",children:j.label})}),e.jsxs(un,{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(X,{variant:"contained",onClick:m,sx:{mt:1,mr:1},disabled:D||!C,children:p("common.continue")}),v>0&&e.jsx(X,{disabled:v===0,onClick:x,sx:{mt:1,mr:1},children:p("common.back")})]})})]})]},j.label)})}),o>=t.length-1&&e.jsx($t,{square:!0,elevation:0,sx:{p:3},children:e.jsx(A,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}js.propTypes={steps:r.array.isRequired,activeStep:r.number.isRequired,setActiveStep:r.func.isRequired,params:r.object.isRequired,viewMode:r.oneOfType([r.string,r.bool]),loading:r.bool.isRequired,projectId:r.string.isRequired,hasSelectedResources:r.oneOfType([r.string,r.bool]),warning:r.object.isRequired,paramsErrTip:r.shape({projectId:r.string,blockletVersion:r.string,blockletTitle:r.string,blockletDescription:r.string,note:r.string,blockletResource:r.string,blockletHomepage:r.string,blockletSupport:r.string,blockletCommunity:r.string,blockletRepository:r.string,blockletDocker:r.object,dockerImageName:r.string}).isRequired};const br=[".zip",".gz"],fr=1024*1024*100,xr=k.lazy(()=>Wo(()=>import("./index-BcuyH8tS.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])).then(t=>({default:t.Uploader})));function ys({app:t,projectId:o,readOnly:s,params:n,setParams:l,setParamsErrTip:c,error:i}){const{t:d,locale:u}=G(),f=k.useRef(null),p=()=>s?!1:!o||o===F.UNOWNED_DID?(W.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:[!!n.uploadedResource&&e.jsx(A,{component:"a",href:`${m}/params.uploadedResource`,children:n.uploadedResource}),!s&&e.jsx(X,{variant:"outlined",size:"small",onClick:()=>{p()&&f.current?.open()},children:n.uploadedResource?d("common.change"):d("common.upload")})]}),e.jsx(k.Suspense,{fallback:e.jsx(Je,{}),children:e.jsx(xr,{ref:f,locale:u,popup:!0,onUploadFinish:x=>{l({uploadedResource:x.data.filename}),c({blockletResource:""}),f.current?.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:m,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileExts:br,maxFileSize:fr,maxNumberOfFiles:1}}},"uploader-resource")}),!!i&&e.jsx(a,{sx:{color:"error.main",mt:1,fontSize:14},children:i})]})}ys.propTypes={app:r.object.isRequired,projectId:r.string.isRequired,readOnly:r.bool.isRequired,params:r.object.isRequired,setParams:r.func.isRequired,error:r.string.isRequired,setParamsErrTip:r.func.isRequired};function Dt({readOnly:t,params:o,setParams:s,paramsErrTip:n,setParamsErrTip:l,loading:c}){const{t:i}=G();return e.jsx(a,{className:"section",sx:{display:"flex",mt:3},children:e.jsxs(a,{sx:{flex:1},children:[e.jsx(re,{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:!!n.blockletVersion,helperText:n.blockletVersion||"",slotProps:{input:{"data-cy":"blocklet-version",readOnly:t}}}),e.jsx(re,{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:!!n.note,helperText:n.note||"",sx:{mt:3},slotProps:{input:{"data-cy":"release-note",readOnly:t,endAdornment:e.jsxs(He,{position:"end",children:[o?.note?.length||0," / ",me.PROJECT.MAX_NOTE_LENGTH]})}}})]})})}Dt.propTypes={readOnly:r.bool.isRequired,params:r.object.isRequired,setParams:r.func.isRequired,paramsErrTip:r.object.isRequired,setParamsErrTip:r.func.isRequired,loading:r.bool.isRequired};function ws(t){for(const o in t)typeof t[o]=="string"?t[o]=t[o].replace(/\\\\/g,"\\"):typeof t[o]=="object"&&t[o]!==null&&ws(t[o]);return t}var gr=Nn();const oe=go(gr),kr={"-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"},Ft={"--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},jr={"--volume":!0,"--publish":!0},yr=new Set(["--publish","--volume"]),vs=t=>{const[o]=t.split(":");return o?.startsWith("/")||o?.startsWith("./")||o?.startsWith("../")||o?.startsWith("~")||o?.startsWith("$BLOCKLET")};function wr(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,...n]=o.value.split(":");if(!s||!vs(o.value))return o;const l=s.startsWith("/")?`$BLOCKLET_DATA_DIR${s}`:`$BLOCKLET_DATA_DIR/${s}`;return{...o,value:[l,...n].join(":")}})}function vr(t){let o=!0;return t.find(n=>n.key==="--publish"&&n.type==="web")?t.map(n=>{if(n.key==="--publish"){const l={...n,type:o?"docker":n.type};return o=n.type==="web",l}return n}):t.map(n=>{if(n.key==="--publish"){const l={...n,type:o?"web":"docker"};return o=!1,l}return n})}function mo(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 n=[],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]||"",[x,...b]=m.split("=");if(x){const h=b.join("=").replace(/^['"]|['"]$/g,"");l.push({key:x,value:h})}c+=2;continue}if(p.startsWith("-")&&u.length===0){const m=p.indexOf("=");let x=p,b=null;m!==-1&&(x=p.substring(0,m),b=p.substring(m+1).replace(/^['"]|['"]$/g,""));const h=kr[x];if(!h){c+=2;continue}if(h==="--publish"){let j="";if(b)j=b,n.push({key:h,value:j});else if(c+1<s.length&&!(s[c+1]||"").startsWith("-")){j=(s[c+1]||"").replace(/^['"]|['"]$/g,""),n.push({key:h,value:j}),c+=2;continue}else{n.push({key:h,value:"true"}),c++;continue}c++;continue}if(b!==null){n.push({key:h,value:b}),c++;continue}else if(c+1<s.length&&!(s[c+1]||"").startsWith("-")){const j=(s[c+1]||"").replace(/^['"]|['"]$/g,"");n.push({key:h,value:j}),c+=2;continue}else{n.push({key:h,value:"true"}),c++;continue}}u.push(p),c++}i=u[0]||"",d=u.slice(1).join(" ");const f=[];for(const p of n)p.name="",p.path="",p.prefix="",p.protocol="",p.proxyBehavior="service",p.type="docker",!(yr.has(p.key)&&p.value==="true")&&f.push(p);for(const p of l)p.custom="",p.description="",p.secure=!1,p.shared=!1,p.required=!1;return{dockerArgs:vr(wr(f)),dockerEnvs:l,dockerImage:i,dockerCommand:d}}function Cr({dockerArgs:t,dockerEnvs:o,dockerImage:s,dockerCommand:n}){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 f=/[\s"']/g.test(u)?`"${u}"`:u;l.push(` ${d} ${f} \\`)}else if(!l.some(f=>f.startsWith(` ${d}`)))if(u==="true")l.push(` ${d} \\`);else{const f=/[\s"']/g.test(u)?`"${u}"`:u;l.push(` ${d} ${f} \\`)}}for(const i of o){const{key:d,value:u}=i,f=/["']/g.test(u)?u:`"${u}"`;l.push(` -e ${d}=${f} \\`)}return s&&l.push(` ${s} \\`),n&&l.push(` ${n} \\`),l[l.length-1]?.endsWith(" \\")&&(l[l.length-1]=(l[l.length-1]||"").slice(0,-2)),l.join(`
193
+ `;function xs({text:t}){const{palette:o}=Lo();return t?e.jsx(Wn,{style:{backgroundColor:o.background.default,color:o.text.primary},wrapperElement:{"data-color-mode":"light"},source:jn.sanitize(t),rehypePlugins:[[On,{target:"_blank"}]]}):e.jsx(Fe,{Icon:_t})}xs.propTypes={text:r.string.isRequired};function gs({params:t,setParams:o,paramsErrTip:s,loading:n,setParamsErrTip:l,readOnly:c}){const{t:i}=G(),[d,u]=k.useState(c?"preview":"write"),f=(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(Ao,{value:d,onChange:f,"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(re,{disabled:n||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(He,{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(xs,{text:t.blockletIntroduction||""})})]})}gs.propTypes={params:r.object.isRequired,setParams:r.func.isRequired,paramsErrTip:r.object.isRequired,setParamsErrTip:r.func.isRequired,readOnly:r.bool.isRequired,loading:r.bool.isRequired};function ks({step:t=0,ok:o=!1,active:s=0,error:n="",warning:l=!1}){let c="grey.500",i=t+1;return o&&(i=e.jsx($o,{sx:{fontSize:18,margin:0},color:"white"})),n||!o&&s>t?(c="error.main",i=e.jsx(Yt,{sx:{fontSize:18,margin:0},color:"white"})):l?(c="warning.main",i=e.jsx(Yt,{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})}ks.propTypes={step:r.number,ok:r.bool,active:r.number,error:r.string,warning:r.bool};function js({steps:t,activeStep:o,setActiveStep:s,hasSelectedResources:n=!1,params:l,loading:c,paramsErrTip:i,warning:d,viewMode:u="",projectId:f}){const{t:p}=G(),m=()=>{s(j=>j+1)},x=()=>{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||ls({params:l,projectId:f,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(cn,{activeStep:o,orientation:"vertical",children:t.map((j,v)=>{const g={},C=c||!hr({params:l,projectId:f,step:v,t:p}),D=c?"":b(v);return D&&(g.optional=e.jsx(A,{variant:"caption",color:"error",sx:{wordBreak:"break-word"},children:D}),g.error=!0),e.jsxs(an,{children:[e.jsx(dn,{icon:e.jsx(ks,{error:D,warning:v===0?d.hasWarning:!1,active:h?99:o,step:v,ok:C}),sx:{cursor:"pointer",color:D?"error.main":"inherit"},disabled:!1,onClick:()=>s(v),...g,children:e.jsx(A,{fontSize:"14px",fontWeight:"500",color:D||!C&&o>v?"error.main":"inherit",children:j.label})}),e.jsxs(un,{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(X,{variant:"contained",onClick:m,sx:{mt:1,mr:1},disabled:D||!C,children:p("common.continue")}),v>0&&e.jsx(X,{disabled:v===0,onClick:x,sx:{mt:1,mr:1},children:p("common.back")})]})})]})]},j.label)})}),o>=t.length-1&&e.jsx($t,{square:!0,elevation:0,sx:{p:3},children:e.jsx(A,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}js.propTypes={steps:r.array.isRequired,activeStep:r.number.isRequired,setActiveStep:r.func.isRequired,params:r.object.isRequired,viewMode:r.oneOfType([r.string,r.bool]),loading:r.bool.isRequired,projectId:r.string.isRequired,hasSelectedResources:r.oneOfType([r.string,r.bool]),warning:r.object.isRequired,paramsErrTip:r.shape({projectId:r.string,blockletVersion:r.string,blockletTitle:r.string,blockletDescription:r.string,note:r.string,blockletResource:r.string,blockletHomepage:r.string,blockletSupport:r.string,blockletCommunity:r.string,blockletRepository:r.string,blockletDocker:r.object,dockerImageName:r.string}).isRequired};const br=[".zip",".gz"],fr=1024*1024*100,xr=k.lazy(()=>Wo(()=>import("./index-LvmCZD51.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])).then(t=>({default:t.Uploader})));function ys({app:t,projectId:o,readOnly:s,params:n,setParams:l,setParamsErrTip:c,error:i}){const{t:d,locale:u}=G(),f=k.useRef(null),p=()=>s?!1:!o||o===F.UNOWNED_DID?(W.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:[!!n.uploadedResource&&e.jsx(A,{component:"a",href:`${m}/params.uploadedResource`,children:n.uploadedResource}),!s&&e.jsx(X,{variant:"outlined",size:"small",onClick:()=>{p()&&f.current?.open()},children:n.uploadedResource?d("common.change"):d("common.upload")})]}),e.jsx(k.Suspense,{fallback:e.jsx(Je,{}),children:e.jsx(xr,{ref:f,locale:u,popup:!0,onUploadFinish:x=>{l({uploadedResource:x.data.filename}),c({blockletResource:""}),f.current?.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:m,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileExts:br,maxFileSize:fr,maxNumberOfFiles:1}}},"uploader-resource")}),!!i&&e.jsx(a,{sx:{color:"error.main",mt:1,fontSize:14},children:i})]})}ys.propTypes={app:r.object.isRequired,projectId:r.string.isRequired,readOnly:r.bool.isRequired,params:r.object.isRequired,setParams:r.func.isRequired,error:r.string.isRequired,setParamsErrTip:r.func.isRequired};function Dt({readOnly:t,params:o,setParams:s,paramsErrTip:n,setParamsErrTip:l,loading:c}){const{t:i}=G();return e.jsx(a,{className:"section",sx:{display:"flex",mt:3},children:e.jsxs(a,{sx:{flex:1},children:[e.jsx(re,{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:!!n.blockletVersion,helperText:n.blockletVersion||"",slotProps:{input:{"data-cy":"blocklet-version",readOnly:t}}}),e.jsx(re,{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:!!n.note,helperText:n.note||"",sx:{mt:3},slotProps:{input:{"data-cy":"release-note",readOnly:t,endAdornment:e.jsxs(He,{position:"end",children:[o?.note?.length||0," / ",me.PROJECT.MAX_NOTE_LENGTH]})}}})]})})}Dt.propTypes={readOnly:r.bool.isRequired,params:r.object.isRequired,setParams:r.func.isRequired,paramsErrTip:r.object.isRequired,setParamsErrTip:r.func.isRequired,loading:r.bool.isRequired};function ws(t){for(const o in t)typeof t[o]=="string"?t[o]=t[o].replace(/\\\\/g,"\\"):typeof t[o]=="object"&&t[o]!==null&&ws(t[o]);return t}var gr=Nn();const oe=go(gr),kr={"-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"},Ft={"--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},jr={"--volume":!0,"--publish":!0},yr=new Set(["--publish","--volume"]),vs=t=>{const[o]=t.split(":");return o?.startsWith("/")||o?.startsWith("./")||o?.startsWith("../")||o?.startsWith("~")||o?.startsWith("$BLOCKLET")};function wr(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,...n]=o.value.split(":");if(!s||!vs(o.value))return o;const l=s.startsWith("/")?`$BLOCKLET_DATA_DIR${s}`:`$BLOCKLET_DATA_DIR/${s}`;return{...o,value:[l,...n].join(":")}})}function vr(t){let o=!0;return t.find(n=>n.key==="--publish"&&n.type==="web")?t.map(n=>{if(n.key==="--publish"){const l={...n,type:o?"docker":n.type};return o=n.type==="web",l}return n}):t.map(n=>{if(n.key==="--publish"){const l={...n,type:o?"web":"docker"};return o=!1,l}return n})}function mo(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 n=[],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]||"",[x,...b]=m.split("=");if(x){const h=b.join("=").replace(/^['"]|['"]$/g,"");l.push({key:x,value:h})}c+=2;continue}if(p.startsWith("-")&&u.length===0){const m=p.indexOf("=");let x=p,b=null;m!==-1&&(x=p.substring(0,m),b=p.substring(m+1).replace(/^['"]|['"]$/g,""));const h=kr[x];if(!h){c+=2;continue}if(h==="--publish"){let j="";if(b)j=b,n.push({key:h,value:j});else if(c+1<s.length&&!(s[c+1]||"").startsWith("-")){j=(s[c+1]||"").replace(/^['"]|['"]$/g,""),n.push({key:h,value:j}),c+=2;continue}else{n.push({key:h,value:"true"}),c++;continue}c++;continue}if(b!==null){n.push({key:h,value:b}),c++;continue}else if(c+1<s.length&&!(s[c+1]||"").startsWith("-")){const j=(s[c+1]||"").replace(/^['"]|['"]$/g,"");n.push({key:h,value:j}),c+=2;continue}else{n.push({key:h,value:"true"}),c++;continue}}u.push(p),c++}i=u[0]||"",d=u.slice(1).join(" ");const f=[];for(const p of n)p.name="",p.path="",p.prefix="",p.protocol="",p.proxyBehavior="service",p.type="docker",!(yr.has(p.key)&&p.value==="true")&&f.push(p);for(const p of l)p.custom="",p.description="",p.secure=!1,p.shared=!1,p.required=!1;return{dockerArgs:vr(wr(f)),dockerEnvs:l,dockerImage:i,dockerCommand:d}}function Cr({dockerArgs:t,dockerEnvs:o,dockerImage:s,dockerCommand:n}){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 f=/[\s"']/g.test(u)?`"${u}"`:u;l.push(` ${d} ${f} \\`)}else if(!l.some(f=>f.startsWith(` ${d}`)))if(u==="true")l.push(` ${d} \\`);else{const f=/[\s"']/g.test(u)?`"${u}"`:u;l.push(` ${d} ${f} \\`)}}for(const i of o){const{key:d,value:u}=i,f=/["']/g.test(u)?u:`"${u}"`;l.push(` -e ${d}=${f} \\`)}return s&&l.push(` ${s} \\`),n&&l.push(` ${n} \\`),l[l.length-1]?.endsWith(" \\")&&(l[l.length-1]=(l[l.length-1]||"").slice(0,-2)),l.join(`
194
194
  `)}const Cs={"--volume":t=>{const[o]=t.split(":");return o?vs(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,(n,l)=>l.toUpperCase()),Rr=t=>`--${t.replace(/([A-Z])/g,"-$1").toLowerCase()}`,Sr=[" -- ","~","&","|",">","<","{","}","[","]",";","$","!","*","%","&&","||",","],Tr=["rm ","sudo "];function Rs(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(Tr.some(l=>s.indexOf(l)!==-1))throw new Error("Docker CMD is invalid");if(Sr.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 Dr=Array.from(new Set(Object.keys(Ft).map(Qe))),Ir=["publish","volume"];oe.object({workdir:oe.string().trim().optional(),image:oe.string().trim().regex(/^[^\s]+$/).optional(),shell:oe.string().trim().optional(),volumes:oe.array().items(oe.string().trim()).optional(),script:oe.string().trim().optional(),installNodeModules:oe.boolean().optional(),skipWrapDockerfile:oe.boolean().optional(),command:oe.string().allow("").default("").optional().custom((t,o)=>{try{return Rs(t),t}catch(s){return o.error("any.invalid",{message:s.message})}},"Docker CMD validation"),runBaseScript:oe.boolean().optional(),...Dr.reduce((t,o)=>{const s=Cs[Rr(o)];return Ir.includes(o)?(t[o]=oe.array().items(oe.string().trim()).optional(),s?t[o]=oe.array().items(oe.string().trim().custom((n,l)=>{const c=s(n);return c?l.message(c):n})).optional():t[o]=oe.array().items(oe.string().trim()).optional(),t):(s?t[o]=oe.string().trim().custom((n,l)=>{const c=s(n);return c?l.message(c):n}).optional():t[o]=oe.string().trim().optional(),t)},{})}).optional();function It({index:t,item:o,dockerParams:s,setDockerParams:n,dataKey:l,t:c,readOnly:i}){const d=o?.value||"",[u,f]=k.useState(!1),p=()=>{s[l]?.splice(t,1),n({...s,[l]:[...s[l]]})},m=(P,L)=>{s[l]?.[t]&&(L?(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="")),n({...s,[l]:[...s[l]]})},x=(P,L)=>{const w=s[l][t]?.value||"";s[l][t]={...s[l][t],secure:L,value:L&&w===me.BLOCKLET_AUTOMATIC_ENV_VALUE?"":w},n({...s,[l]:[...s[l]]})},b=(P,L)=>{s[l][t]={...s[l][t],shared:L},n({...s,[l]:[...s[l]]})},h=(P,L)=>{const w=s[l][t]?.value||"";s[l][t]={...s[l][t],required:L,value:L&&w===me.BLOCKLET_AUTOMATIC_ENV_VALUE?"":w},n({...s,[l]:[...s[l]]})},j=(P,L)=>{s[l][t]={...s[l][t],value:L?me.BLOCKLET_AUTOMATIC_ENV_VALUE:"",secure:!1,required:!1},n({...s,[l]:[...s[l]]})},v=P=>{s[l][t]={...s[l][t],description:P.target.value},n({...s,[l]:[...s[l]]})},g=P=>{const L=P.target.value==="web"?"web":"docker";L==="web"&&s.dockerArgs.forEach(Z=>{Z.type="docker"});const S=`/${s.dockerImage.replace(/\W/g,"-")}-${t}`;s.dockerArgs[t]={...s.dockerArgs[t],type:L,path:L==="docker"?S:"/",protocol:"http",prefix:L==="docker"?S:"/",name:"publicUrl",port:"BLOCKLET_PORT"},n({...s,dockerArgs:[...s.dockerArgs]})},C=P=>{s.dockerArgs[t]={...s.dockerArgs[t],proxyBehavior:P.target.value==="direct"?"direct":"service"},n({...s,dockerArgs:[...s.dockerArgs]})},D=P=>{const L=P.target.value;s[l][t]={...s[l][t],prefix:L,path:L==="*"?"/":L},n({...s,[l]:[...s[l]]})},R=P=>{s[l]?.[t]&&(s[l][t].value=P.target.value),n({...s,[l]:[...s[l]]})},y=d===`$${Qe(o.key)}`||o.custom,T=l==="dockerArgs"&&!Ft[o.key],O=jr[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(re,{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(He,{position:"end",sx:{zoom:.9},children:[(!(O||T)||N||z)&&e.jsx(ce,{onClick:()=>f(!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"&&Cs[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:()=>f(!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(Le,{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(Le,{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(Le,{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(Le,{disabled:i,checked:o.secure,onChange:x,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(Le,{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(re,{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(Ct,{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(Ct,{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(re,{disabled:i,value:o.prefix,onChange:D,sx:{flex:1},label:c("blocklet.publish.docker.prefix")})]})]})})]})}It.propTypes={dockerParams:r.object.isRequired,setDockerParams:r.func.isRequired,dataKey:r.string.isRequired,item:r.object.isRequired,t:r.func.isRequired,readOnly:r.bool.isRequired,index:r.number.isRequired};const Er=`
195
195
  docker run --name postgrest
196
196
  -p 3000:3000
@@ -1,4 +1,4 @@
1
- import{j as e,y as Pt,bb as Pe,M as ae,ak as u,Q as _,W as c,J as xe,bX as Rt,I as N,aN as It,T as R,aj as Tt,b5 as Be,P as Le,b6 as Y,a5 as $e,z as Ze,A as Ye,cl as At,bf as Mt,U as ke,dj as zt,dk as Et,at as ee,dl as Bt,a6 as Q,n as le,D as Lt,dm as $t,ar as We,b1 as Re,dn as Wt,as as Dt,aX as Nt,am as X,bp as Ot,bq as ve,a$ as Ft,d6 as Ut}from"./vendor-mui-core-BwwTYUH3.js";import{r as j,a as Ht,u as qt,j as _t}from"./vendor-react-x2lQvn4m.js";import{a as Gt,C as Kt,bx as Vt,c as Ie,d as Qt,N as Zt,by as Yt,aH as Te,K as fe,a$ as Xt,b0 as Jt,bz as er,W as De,aJ as tr,X as rr,bA as nr,H as or}from"./index-dIkcxCDN.js";import{t as Xe,Z as sr,a8 as ir,R as Ne,D as ar,C as ce,n as q,A as lr}from"./vendor-utils-DQY0X1ND.js";import{b as Ae,I as L,T as B,aw as cr,C as Je,ax as dr,H as U,ay as ur,az as pr,aA as Oe,e as xr,n as et,aB as fr,aC as hr,aD as A,v as gr,u as mr,$ as tt,c as rt,aE as je,aF as br,s as yr,o as de,z as Fe,D as vr}from"./vendor-ux-BglKGRhr.js";import{a as P,h as nt,k as te,g as G,b as z,j as jr}from"./vendor-hooks-uwq5Zgdd.js";import{l as ot}from"./arrow-down.svg-CAhyD6_b.js";import{N as Cr}from"./list-s4SRm3p5.js";import{d as wr}from"./search-4YYphs0l.js";import{B as Ue}from"./bundle-avatar-cdYjPEnW.js";import{j as He,T as kr}from"./team-DA9xMdEQ.js";import{b as Sr,d as Pr,a as Rr,c as Ir,e as Tr,f as Ar,g as Mr,h as zr,W as Er}from"./user-center-Dx-CKzHU.js";import{N as st,U as it}from"./index-DEPyMifK.js";import Br from"./index-BpL1e-bN.js";import{u as he}from"./use-mobile-DapluIyS.js";import{f as J}from"./index-DBs9Ljax.js";import{u as at}from"./index-Dhyyek4_.js";import{d as Lr}from"./github-icon-CH2zo-td.js";import{U as Ce}from"./user-sessions-CP2hMWvQ.js";import $r from"./index-D27Eda5K.js";import{o as Wr}from"./vendor-arcblock-BEuhHuNQ.js";import{c as Dr,b as ue,a as Nr,S as Or}from"./index-b_dnNRMF.js";import"./index-BGTKxy_q.js";import"./index-BojVbZw0.js";import"./lottie-web-4koyQiv_.js";import"./server-logo-notext.svg-BqCXmsOm.js";import"./index-DdCAwzrE.js";import"./util-Cn9ZyU8l.js";import"./base32-CkijRzDY.js";import"./session-DgH_dTEB.js";import"./index-Bv6qc7SO.js";import"./api-CpymM8cn.js";import"./table-tips-BfdUOZWj.js";import"./use-mobile-DHiqEjn5.js";import"./passport-item-BejfMK1X.js";import"./did-address-D7SiJUQw.js";import"./index-CQb3b4r6.js";import"./vendor-mui-x-DDx3HEvj.js";import"./AdapterDayjs-BZTfQON9.js";import"./confirm-B0IPtkVS.js";import"./click-to-copy-DPQ0tcO7.js";import"./delete-confirm-DeAivjJv.js";import"./permission-B4PsiDVD.js";import"./actions-C731b1S-.js";import"./index-DRYJ0xIl.js";function Fr(){let t=new Map;function a({root:n,rootMargin:i,threshold:o}){let s=t.get(n);s||(s=new Map,t.set(n,s));let d=JSON.stringify({rootMargin:i,threshold:o}),p=s.get(d);if(!p){let r=new Map;p={observer:new IntersectionObserver(f=>{f.forEach(h=>{r.get(h.target)?.(h)})},{root:n,rootMargin:i,threshold:o}),entryCallbacks:r},s.set(d,p)}return{observe:(r,f)=>{p.entryCallbacks.set(r,f),p.observer.observe(r)},unobserve:r=>{p.entryCallbacks.delete(r),p.observer.unobserve(r)}}}return{getObserver:a}}var Ur="0px",Hr=[0],qr=Fr();function _r(t){let a=t?.rootMargin??Ur,n=t?.threshold??Hr,i=j.useRef(null),o=j.useRef(null),s=j.useRef(null),[d,p]=j.useState(),r=j.useCallback(()=>{let w=i.current;if(!w){p(void 0);return}let v=qr.getObserver({root:o.current,rootMargin:a,threshold:n});v.observe(w,g=>{p(g)}),s.current=v},[a,n]),f=j.useCallback(()=>{let w=s.current,v=i.current;v&&w?.unobserve(v),s.current=null},[]),h=j.useCallback(w=>{f(),i.current=w,r()},[r,f]),x=j.useCallback(w=>{f(),o.current=w,r()},[r,f]);return[h,{entry:d,rootRef:x}]}var Gr=_r;function Kr(t){let[a,n]=Gr(t),i=!!n.entry?.isIntersecting,[o,s]=j.useState(i);return i&&!o&&s(!0),[a,{...n,isVisible:i,wasEverVisible:o}]}var Vr=Kr,Qr=100;function Zr({loading:t,hasNextPage:a,onLoadMore:n,rootMargin:i,disabled:o,delayInMs:s=Qr}){let d=j.useRef(n),[p,{rootRef:r,isVisible:f}]=Vr({rootMargin:i});j.useEffect(()=>{d.current=n},[n]);let h=!o&&!t&&f&&a;return j.useEffect(()=>{if(h){let x=setTimeout(()=>{d.current()},s);return()=>{clearTimeout(x)}}},[h,s]),[p,{rootRef:r}]}var Yr=Zr;const we={info:"#3B82F6",success:"#10B981",warning:"#F59E0B",error:"#EF4444"};pe.propTypes={severity:c.oneOf(["info","success","warning","error",""]).isRequired,size:c.number};function pe({severity:t,size:a=8}){return we[t]?e.jsx(u,{component:"span",sx:{display:"inline-block",width:a,height:a,borderRadius:"50%",backgroundColor:we[t]||we.info}}):null}lt.propTypes={theme:c.string,type:c.oneOf(["button","line","select"]),onSelectType:c.func,extra:c.node,loading:c.bool,currentTab:c.oneOf(["info","success","warning","error",""])};function lt({theme:t="dark",type:a="button",onSelectType:n,extra:i=void 0,currentTab:o="",loading:s=!1,...d}){const{t:p}=j.useContext(Ae),r=[{label:p("notification.allSeverity"),value:""},{label:p("notification.severityType.info"),value:"info"},{label:p("notification.severityType.success"),value:"success"},{label:p("notification.severityType.warning"),value:"warning"},{label:p("notification.severityType.error"),value:"error"}],f=m=>{(m!==o||!s)&&n(m)},h=j.useMemo(()=>{const m={width:"100%",bgcolor:t==="dark"?"#F9FAFB":"",overflowY:"auto",paddingTop:a==="select"?"0":"5px",whiteSpace:"nowrap",borderRadius:0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"8px"};return a==="line"?Object.assign(m,{}):m},[a,t]),x=(m,y,b)=>e.jsx(_,{disabled:s,onClick:()=>f(m.value),className:`profile-button ${y?"active":""}`,...d,children:m.label},m.value||b),w=(m,y,b)=>e.jsx(_,{variant:"text",disabled:s,onClick:()=>f(m.value),className:`profile-line-button ${y?"active":""}`,...d,children:m.label},m.value||b),v=()=>r?.map((m,y)=>{const b=o===m?.value;return a==="line"?e.jsx(j.Fragment,{children:w(m,b,y)},m.value||y):e.jsx(j.Fragment,{children:x(m,b,y)},m.value||y)}),g=m=>{const{value:y}=m.target;f(y==="all"?"":y)};return a==="select"?e.jsx(Pt,{sx:{maxWidth:300},children:e.jsx(Pe,{value:o||"all",onChange:g,size:"small",label:"Severity",IconComponent:m=>e.jsx(ot,{...m,width:20,height:20}),MenuProps:{autoFocus:!1,PaperProps:{style:{maxHeight:400,overflowY:"auto",borderRadius:"8px",boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},variant:"outlined",sx:{fieldset:{border:"none"}},children:r.map((m,y)=>e.jsx(ae,{value:m.value||"all",children:e.jsxs(u,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(pe,{severity:m.value}),m.label]})},m.value||y))})}):e.jsxs(u,{className:"severity-tabs",sx:h,children:[e.jsx(u,{sx:{...a==="line"?{flex:1,borderBottom:"1px solid",borderColor:"grey.200"}:{display:"flex",gap:"24px"}},children:v()}),i]})}ct.propTypes={paging:c.objectOf(c.any).isRequired,loading:c.bool.isRequired,onChange:c.func.isRequired};function ct({loading:t,paging:a,onChange:n}){const{t:i}=j.useContext(Ae),o=xe(r=>r.breakpoints.down("md"));if(a.pageCount<=0||o)return null;const s=(r,f)=>{n({page:f+1})},d=r=>{const f=Number(r.target.value);n({page:1,pageSize:f})},p=a.page-1<=0?0:a.page-1;return e.jsx(u,{className:"notification-pagination",sx:{mt:2,display:"flex",justifyContent:"flex-end"},children:e.jsx(Rt,{component:"div",disabled:t,count:a.total,page:p,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:i("pagination.rowsPerPage"),labelDisplayedRows:({from:r,to:f,count:h})=>`${r}–${f} / ${h!==-1?h:`${i()}more than ${f}`}`,rowsPerPage:a.pageSize,onPageChange:s,onRowsPerPageChange:d})})}const Xr=j.memo(ct),Jr={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4h16v2.172a2 2 0 0 1-.586 1.414L15 12v7l-6 2v-8.5L4.52 7.572A2 2 0 0 1 4 6.227V4z"/>'},qe=6,_e={"& .MuiCheckbox-root":{padding:"4px"},"& .MuiCheckbox-root .MuiSvgIcon-root":{fontSize:"1.35rem"},"& .MuiCheckbox-root:not(.Mui-checked)":{color:"divider"},"& .MuiCheckbox-root.Mui-checked":{color:"primary.main"},"& .MuiCheckbox-root .css-i4bv87-MuiSvgIcon-root":{width:"1.1em",height:"1.1em"},"& .MuiCheckbox-root svg":{stroke:"divider",strokeWidth:.7}},en={border:"1px solid",borderColor:"divider",borderRadius:1,overflow:"hidden",backgroundColor:"background.paper",backgroundImage:"none",transition:"all 0.2s ease-in-out"},Ge=()=>({...en,width:"calc(50% - 8px)"});dt.propTypes={loading:c.bool,type:c.oneOf(["server","service"]),onFilterChange:c.func,blockletMap:c.object,filterType:c.oneOf(["component","entity"]),selectedId:c.array,severity:c.array,enableMarkAllAsRead:c.bool,unReadCount:c.number,onReadFilterChange:c.func,currentReadFilter:c.string};function dt({onFilterChange:t=()=>{},loading:a=!1,type:n="service",blockletMap:i={},filterType:o="component",selectedId:s=[],severity:d=[],enableMarkAllAsRead:p=!0,unReadCount:r=0,onReadFilterChange:f=()=>{},currentReadFilter:h="all"}){const{t:x}=j.useContext(Ae),[w,v]=j.useState(null),g=!!w,[m,y]=j.useState(s),[b,I]=j.useState(d),[M,D]=j.useState(!1),[$,H]=j.useState(""),[k,S]=j.useState([]);j.useEffect(()=>{y(s),I(d)},[s,d]);const W=[{label:x("notification.filterType.all"),value:"all"},{label:x("notification.filterType.unread"),value:"unread"}],K=l=>{(l!==h||!a)&&f(l)},Z=[{label:x("notification.severityType.info"),value:"info"},{label:x("notification.severityType.success"),value:"success"},{label:x("notification.severityType.warning"),value:"warning"},{label:x("notification.severityType.error"),value:"error"}],re=l=>{v(l.currentTarget),H(""),D(!1)},ge=()=>{v(null)},ne=l=>{const C=m.includes(l)?m.filter(T=>T!==l):[...m,l];y(C),t({id:C,severity:b})},oe=l=>{const C=b.includes(l)?b.filter(T=>T!==l):[...b,l];I(C),t({severity:C,id:m})},me=l=>{H(l.target.value)},be=()=>{D(!M)},V=Ht.useMemo(()=>{if(!i.size)return[];const l=[];return o==="component"&&l.push({label:x("notification.system"),id:"system"}),Array.from(i).forEach(([,C])=>{const T=C.did||C.meta?.did,E=C.title||C.meta?.title||"",F=C.appPid||C.appDid;(o==="component"&&F!==T||o==="entity"&&F===T)&&l.push({label:E,id:T,blocklet:C,ancestors:C.ancestors})}),l},[i,o,x]);j.useEffect(()=>{if($.trim()==="")S(V);else{const l=$.toLowerCase(),C=V.filter(T=>T.label.toLowerCase().includes(l));S(C)}},[$,V]);const ye=$.trim()!==""||M?k:k.slice(0,qe);return e.jsxs(u,{children:[e.jsxs(u,{sx:{display:"flex",justifyContent:p?"space-between":"flex-end",alignItems:"flex-start",flexWrap:"wrap",gap:1},children:[p&&e.jsx(u,{sx:{display:"flex",gap:1.5},children:W.map(l=>e.jsxs(_,{disabled:a,onClick:()=>K(l.value),className:`profile-button ${h===l.value?"active":""}`,sx:{...n==="service"&&h===l.value?{color:"secondary.main"}:{},color:"red",fontWeight:h===l.value?"bold":"normal"},children:[l.label,l.value==="unread"&&r>0&&` (${r})`]},l.value))}),e.jsxs(u,{sx:{display:"flex",justifyContent:"flex-end",gap:2},children:[e.jsx(N,{size:"small",onClick:re,disabled:a,sx:{minWidth:"auto",borderRadius:1,border:"1px solid",borderColor:"divider","&:hover":{backgroundColor:"action.hover"}},children:e.jsx(L,{icon:Jr,hFlip:!0})}),e.jsx(It,{open:g,anchorEl:w,onClose:ge,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{p:3,width:450,maxHeight:500,overflowY:"auto",backgroundColor:"background.paper",backgroundImage:"none",borderRadius:1,boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},children:e.jsxs(u,{children:[e.jsxs(u,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,height:"28px"},children:[e.jsx(R,{variant:"subtitle1",sx:{fontWeight:"bold"},children:x("notification.severity")}),e.jsx(u,{sx:{minWidth:"60px",display:"flex",justifyContent:"flex-end"},children:(m.length>0||b.length>0)&&e.jsx(_,{size:"small",onClick:()=>{y([]),I([]),t({severity:[],id:[]})},startIcon:e.jsx(Tt,{fontSize:"small"}),sx:{color:"text.secondary",textTransform:"none",minWidth:"auto","&:hover":{backgroundColor:"transparent"},"& .MuiButton-startIcon":{marginRight:"2px"}},children:x("notification.clear")})})]}),e.jsx(u,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(Be,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2,flex:1},children:Z.map(l=>e.jsx(Le,{elevation:0,sx:Ge(b.includes(l.value)),children:e.jsx(Y,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{display:"flex",alignItems:"center",gap:1,fontSize:"0.875rem"},..._e},control:e.jsx($e,{checked:b.includes(l.value),onChange:()=>oe(l.value),disabled:a,size:"small"}),label:e.jsxs(u,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5},children:[e.jsx(pe,{severity:l.value}),l.label]})})},l.value))})}),e.jsxs(u,{sx:{mb:2},children:[e.jsxs(u,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,mb:1.5},children:[e.jsx(R,{variant:"subtitle1",sx:{fontWeight:"bold",width:"calc(100% - 36px)"},children:x("notification.from")}),e.jsx(u,{sx:{display:"flex",alignItems:"center",width:"calc(100% - 36px)"},children:e.jsx(Ze,{size:"small",placeholder:"search",value:$,onChange:me,sx:{width:"100%","& .MuiOutlinedInput-input":{padding:"6px 4px 6px 0"},".MuiOutlinedInput-root":{"&:hover":{fieldset:{borderColor:"divider"}},"&.Mui-focused":{fieldset:{borderColor:"divider"}}},fieldset:{borderColor:"divider"}},slotProps:{input:{size:"small",startAdornment:e.jsx(Ye,{position:"start",sx:{marginRight:"2px"},children:e.jsx(L,{icon:wr})})}}})})]}),e.jsx(Be,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2},children:ye.map(l=>e.jsx(Le,{elevation:0,sx:Ge(m.includes(l.id)),children:e.jsx(Y,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{fontSize:"0.875rem",width:"calc(100% - 36px)"},..._e},control:e.jsx($e,{checked:m.includes(l.id),onChange:()=>ne(l.id),disabled:a,size:"small"}),label:e.jsxs(u,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,minWidth:0,width:"100%"},children:[l.blocklet&&e.jsx(Ue,{size:20,blocklet:l.blocklet,ancestors:l.ancestors,style:{borderRadius:4,flexShrink:0}}),e.jsx(R,{noWrap:!0,variant:"body2",component:"span",title:l.label,sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},children:l.label})]})})},l.id))}),k.length>qe&&$.trim()===""&&e.jsx(_,{fullWidth:!0,size:"small",onClick:be,sx:{mt:1},endIcon:M?e.jsx(At,{}):e.jsx(Mt,{})})]})]})})]})]}),m.length>0||b.length>0?e.jsxs(u,{className:"notification-filter-content",sx:{display:"flex",flexWrap:"wrap",gap:1,mt:2},children:[b.map(l=>{const C=Z.find(T=>T.value===l);return e.jsx(ke,{label:e.jsxs(u,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(pe,{severity:l}),C?C.label:l]}),onDelete:()=>oe(l),size:"small",variant:"outlined",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`severity-${l}`)}),m.map(l=>{const C=V.find(T=>T.id===l);return e.jsx(ke,{label:e.jsxs(u,{sx:{display:"flex",alignItems:"center",gap:.5},children:[C?.blocklet&&e.jsx(Ue,{size:16,blocklet:C.blocklet,ancestors:C.ancestors,style:{borderRadius:4,flexShrink:0}}),C?C.label:l]}),variant:"outlined",onDelete:()=>ne(l),size:"small",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`component-${l}`)})]}):null]})}const tn=ee(Bt)`
1
+ import{j as e,y as Pt,bb as Pe,M as ae,ak as u,Q as _,W as c,J as xe,bX as Rt,I as N,aN as It,T as R,aj as Tt,b5 as Be,P as Le,b6 as Y,a5 as $e,z as Ze,A as Ye,cl as At,bf as Mt,U as ke,dj as zt,dk as Et,at as ee,dl as Bt,a6 as Q,n as le,D as Lt,dm as $t,ar as We,b1 as Re,dn as Wt,as as Dt,aX as Nt,am as X,bp as Ot,bq as ve,a$ as Ft,d6 as Ut}from"./vendor-mui-core-DWYIngcn.js";import{r as j,a as Ht,u as qt,j as _t}from"./vendor-react-Dvs43sk9.js";import{a as Gt,C as Kt,bx as Vt,c as Ie,d as Qt,N as Zt,by as Yt,aH as Te,K as fe,a$ as Xt,b0 as Jt,bz as er,W as De,aJ as tr,X as rr,bA as nr,H as or}from"./index-CgCJ2qDh.js";import{t as Xe,Z as sr,a8 as ir,R as Ne,D as ar,C as ce,n as q,A as lr}from"./vendor-utils-J7aLFpEq.js";import{b as Ae,I as L,T as B,aw as cr,C as Je,ax as dr,H as U,ay as ur,az as pr,aA as Oe,e as xr,n as et,aB as fr,aC as hr,aD as A,v as gr,u as mr,$ as tt,c as rt,aE as je,aF as br,s as yr,o as de,z as Fe,D as vr}from"./vendor-ux-Dln42oC3.js";import{a as P,h as nt,k as te,g as G,b as z,j as jr}from"./vendor-hooks-HB6DqcLv.js";import{l as ot}from"./arrow-down.svg-6steA5un.js";import{N as Cr}from"./list-B8ZhwNC1.js";import{d as wr}from"./search-4YYphs0l.js";import{B as Ue}from"./bundle-avatar-DkLBEfff.js";import{j as He,T as kr}from"./team-DplrCM_m.js";import{b as Sr,d as Pr,a as Rr,c as Ir,e as Tr,f as Ar,g as Mr,h as zr,W as Er}from"./user-center-D4QgyhnU.js";import{N as st,U as it}from"./index-DUnVGFh6.js";import Br from"./index-D8X_0Jj0.js";import{u as he}from"./use-mobile-BtGrkCtZ.js";import{f as J}from"./index-DBs9Ljax.js";import{u as at}from"./index-SrN5SE_r.js";import{d as Lr}from"./github-icon-CH2zo-td.js";import{U as Ce}from"./user-sessions-C2LvHnd6.js";import $r from"./index-D6kePAD5.js";import{o as Wr}from"./vendor-arcblock-B78OG6SS.js";import{c as Dr,b as ue,a as Nr,S as Or}from"./index-Dy8syryD.js";import"./index-D3qROm47.js";import"./index-BojVbZw0.js";import"./lottie-web-4koyQiv_.js";import"./server-logo-notext.svg-CKQB0tIp.js";import"./index-DcwzA8G_.js";import"./util-DtXj9fc3.js";import"./base32-DBDFptL1.js";import"./session-BV5HR2vD.js";import"./index-lf4wyjkd.js";import"./api-BV16dSSm.js";import"./table-tips-ZIxKRomr.js";import"./use-mobile-BhzP2Rp3.js";import"./passport-item-D7sQ_FxN.js";import"./did-address-CdYAzzjR.js";import"./index-DseoFU10.js";import"./vendor-mui-x-nEbm5eNb.js";import"./AdapterDayjs-Dc_cn1Wv.js";import"./confirm-B4BzkG04.js";import"./click-to-copy-m7BzOuWH.js";import"./delete-confirm-DhfRzwF1.js";import"./permission-C79TpiNV.js";import"./actions-CeSIZN0M.js";import"./index-DRYJ0xIl.js";function Fr(){let t=new Map;function a({root:n,rootMargin:i,threshold:o}){let s=t.get(n);s||(s=new Map,t.set(n,s));let d=JSON.stringify({rootMargin:i,threshold:o}),p=s.get(d);if(!p){let r=new Map;p={observer:new IntersectionObserver(f=>{f.forEach(h=>{r.get(h.target)?.(h)})},{root:n,rootMargin:i,threshold:o}),entryCallbacks:r},s.set(d,p)}return{observe:(r,f)=>{p.entryCallbacks.set(r,f),p.observer.observe(r)},unobserve:r=>{p.entryCallbacks.delete(r),p.observer.unobserve(r)}}}return{getObserver:a}}var Ur="0px",Hr=[0],qr=Fr();function _r(t){let a=t?.rootMargin??Ur,n=t?.threshold??Hr,i=j.useRef(null),o=j.useRef(null),s=j.useRef(null),[d,p]=j.useState(),r=j.useCallback(()=>{let w=i.current;if(!w){p(void 0);return}let v=qr.getObserver({root:o.current,rootMargin:a,threshold:n});v.observe(w,g=>{p(g)}),s.current=v},[a,n]),f=j.useCallback(()=>{let w=s.current,v=i.current;v&&w?.unobserve(v),s.current=null},[]),h=j.useCallback(w=>{f(),i.current=w,r()},[r,f]),x=j.useCallback(w=>{f(),o.current=w,r()},[r,f]);return[h,{entry:d,rootRef:x}]}var Gr=_r;function Kr(t){let[a,n]=Gr(t),i=!!n.entry?.isIntersecting,[o,s]=j.useState(i);return i&&!o&&s(!0),[a,{...n,isVisible:i,wasEverVisible:o}]}var Vr=Kr,Qr=100;function Zr({loading:t,hasNextPage:a,onLoadMore:n,rootMargin:i,disabled:o,delayInMs:s=Qr}){let d=j.useRef(n),[p,{rootRef:r,isVisible:f}]=Vr({rootMargin:i});j.useEffect(()=>{d.current=n},[n]);let h=!o&&!t&&f&&a;return j.useEffect(()=>{if(h){let x=setTimeout(()=>{d.current()},s);return()=>{clearTimeout(x)}}},[h,s]),[p,{rootRef:r}]}var Yr=Zr;const we={info:"#3B82F6",success:"#10B981",warning:"#F59E0B",error:"#EF4444"};pe.propTypes={severity:c.oneOf(["info","success","warning","error",""]).isRequired,size:c.number};function pe({severity:t,size:a=8}){return we[t]?e.jsx(u,{component:"span",sx:{display:"inline-block",width:a,height:a,borderRadius:"50%",backgroundColor:we[t]||we.info}}):null}lt.propTypes={theme:c.string,type:c.oneOf(["button","line","select"]),onSelectType:c.func,extra:c.node,loading:c.bool,currentTab:c.oneOf(["info","success","warning","error",""])};function lt({theme:t="dark",type:a="button",onSelectType:n,extra:i=void 0,currentTab:o="",loading:s=!1,...d}){const{t:p}=j.useContext(Ae),r=[{label:p("notification.allSeverity"),value:""},{label:p("notification.severityType.info"),value:"info"},{label:p("notification.severityType.success"),value:"success"},{label:p("notification.severityType.warning"),value:"warning"},{label:p("notification.severityType.error"),value:"error"}],f=m=>{(m!==o||!s)&&n(m)},h=j.useMemo(()=>{const m={width:"100%",bgcolor:t==="dark"?"#F9FAFB":"",overflowY:"auto",paddingTop:a==="select"?"0":"5px",whiteSpace:"nowrap",borderRadius:0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"8px"};return a==="line"?Object.assign(m,{}):m},[a,t]),x=(m,y,b)=>e.jsx(_,{disabled:s,onClick:()=>f(m.value),className:`profile-button ${y?"active":""}`,...d,children:m.label},m.value||b),w=(m,y,b)=>e.jsx(_,{variant:"text",disabled:s,onClick:()=>f(m.value),className:`profile-line-button ${y?"active":""}`,...d,children:m.label},m.value||b),v=()=>r?.map((m,y)=>{const b=o===m?.value;return a==="line"?e.jsx(j.Fragment,{children:w(m,b,y)},m.value||y):e.jsx(j.Fragment,{children:x(m,b,y)},m.value||y)}),g=m=>{const{value:y}=m.target;f(y==="all"?"":y)};return a==="select"?e.jsx(Pt,{sx:{maxWidth:300},children:e.jsx(Pe,{value:o||"all",onChange:g,size:"small",label:"Severity",IconComponent:m=>e.jsx(ot,{...m,width:20,height:20}),MenuProps:{autoFocus:!1,PaperProps:{style:{maxHeight:400,overflowY:"auto",borderRadius:"8px",boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},variant:"outlined",sx:{fieldset:{border:"none"}},children:r.map((m,y)=>e.jsx(ae,{value:m.value||"all",children:e.jsxs(u,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(pe,{severity:m.value}),m.label]})},m.value||y))})}):e.jsxs(u,{className:"severity-tabs",sx:h,children:[e.jsx(u,{sx:{...a==="line"?{flex:1,borderBottom:"1px solid",borderColor:"grey.200"}:{display:"flex",gap:"24px"}},children:v()}),i]})}ct.propTypes={paging:c.objectOf(c.any).isRequired,loading:c.bool.isRequired,onChange:c.func.isRequired};function ct({loading:t,paging:a,onChange:n}){const{t:i}=j.useContext(Ae),o=xe(r=>r.breakpoints.down("md"));if(a.pageCount<=0||o)return null;const s=(r,f)=>{n({page:f+1})},d=r=>{const f=Number(r.target.value);n({page:1,pageSize:f})},p=a.page-1<=0?0:a.page-1;return e.jsx(u,{className:"notification-pagination",sx:{mt:2,display:"flex",justifyContent:"flex-end"},children:e.jsx(Rt,{component:"div",disabled:t,count:a.total,page:p,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:i("pagination.rowsPerPage"),labelDisplayedRows:({from:r,to:f,count:h})=>`${r}–${f} / ${h!==-1?h:`${i()}more than ${f}`}`,rowsPerPage:a.pageSize,onPageChange:s,onRowsPerPageChange:d})})}const Xr=j.memo(ct),Jr={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4h16v2.172a2 2 0 0 1-.586 1.414L15 12v7l-6 2v-8.5L4.52 7.572A2 2 0 0 1 4 6.227V4z"/>'},qe=6,_e={"& .MuiCheckbox-root":{padding:"4px"},"& .MuiCheckbox-root .MuiSvgIcon-root":{fontSize:"1.35rem"},"& .MuiCheckbox-root:not(.Mui-checked)":{color:"divider"},"& .MuiCheckbox-root.Mui-checked":{color:"primary.main"},"& .MuiCheckbox-root .css-i4bv87-MuiSvgIcon-root":{width:"1.1em",height:"1.1em"},"& .MuiCheckbox-root svg":{stroke:"divider",strokeWidth:.7}},en={border:"1px solid",borderColor:"divider",borderRadius:1,overflow:"hidden",backgroundColor:"background.paper",backgroundImage:"none",transition:"all 0.2s ease-in-out"},Ge=()=>({...en,width:"calc(50% - 8px)"});dt.propTypes={loading:c.bool,type:c.oneOf(["server","service"]),onFilterChange:c.func,blockletMap:c.object,filterType:c.oneOf(["component","entity"]),selectedId:c.array,severity:c.array,enableMarkAllAsRead:c.bool,unReadCount:c.number,onReadFilterChange:c.func,currentReadFilter:c.string};function dt({onFilterChange:t=()=>{},loading:a=!1,type:n="service",blockletMap:i={},filterType:o="component",selectedId:s=[],severity:d=[],enableMarkAllAsRead:p=!0,unReadCount:r=0,onReadFilterChange:f=()=>{},currentReadFilter:h="all"}){const{t:x}=j.useContext(Ae),[w,v]=j.useState(null),g=!!w,[m,y]=j.useState(s),[b,I]=j.useState(d),[M,D]=j.useState(!1),[$,H]=j.useState(""),[k,S]=j.useState([]);j.useEffect(()=>{y(s),I(d)},[s,d]);const W=[{label:x("notification.filterType.all"),value:"all"},{label:x("notification.filterType.unread"),value:"unread"}],K=l=>{(l!==h||!a)&&f(l)},Z=[{label:x("notification.severityType.info"),value:"info"},{label:x("notification.severityType.success"),value:"success"},{label:x("notification.severityType.warning"),value:"warning"},{label:x("notification.severityType.error"),value:"error"}],re=l=>{v(l.currentTarget),H(""),D(!1)},ge=()=>{v(null)},ne=l=>{const C=m.includes(l)?m.filter(T=>T!==l):[...m,l];y(C),t({id:C,severity:b})},oe=l=>{const C=b.includes(l)?b.filter(T=>T!==l):[...b,l];I(C),t({severity:C,id:m})},me=l=>{H(l.target.value)},be=()=>{D(!M)},V=Ht.useMemo(()=>{if(!i.size)return[];const l=[];return o==="component"&&l.push({label:x("notification.system"),id:"system"}),Array.from(i).forEach(([,C])=>{const T=C.did||C.meta?.did,E=C.title||C.meta?.title||"",F=C.appPid||C.appDid;(o==="component"&&F!==T||o==="entity"&&F===T)&&l.push({label:E,id:T,blocklet:C,ancestors:C.ancestors})}),l},[i,o,x]);j.useEffect(()=>{if($.trim()==="")S(V);else{const l=$.toLowerCase(),C=V.filter(T=>T.label.toLowerCase().includes(l));S(C)}},[$,V]);const ye=$.trim()!==""||M?k:k.slice(0,qe);return e.jsxs(u,{children:[e.jsxs(u,{sx:{display:"flex",justifyContent:p?"space-between":"flex-end",alignItems:"flex-start",flexWrap:"wrap",gap:1},children:[p&&e.jsx(u,{sx:{display:"flex",gap:1.5},children:W.map(l=>e.jsxs(_,{disabled:a,onClick:()=>K(l.value),className:`profile-button ${h===l.value?"active":""}`,sx:{...n==="service"&&h===l.value?{color:"secondary.main"}:{},color:"red",fontWeight:h===l.value?"bold":"normal"},children:[l.label,l.value==="unread"&&r>0&&` (${r})`]},l.value))}),e.jsxs(u,{sx:{display:"flex",justifyContent:"flex-end",gap:2},children:[e.jsx(N,{size:"small",onClick:re,disabled:a,sx:{minWidth:"auto",borderRadius:1,border:"1px solid",borderColor:"divider","&:hover":{backgroundColor:"action.hover"}},children:e.jsx(L,{icon:Jr,hFlip:!0})}),e.jsx(It,{open:g,anchorEl:w,onClose:ge,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{p:3,width:450,maxHeight:500,overflowY:"auto",backgroundColor:"background.paper",backgroundImage:"none",borderRadius:1,boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},children:e.jsxs(u,{children:[e.jsxs(u,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,height:"28px"},children:[e.jsx(R,{variant:"subtitle1",sx:{fontWeight:"bold"},children:x("notification.severity")}),e.jsx(u,{sx:{minWidth:"60px",display:"flex",justifyContent:"flex-end"},children:(m.length>0||b.length>0)&&e.jsx(_,{size:"small",onClick:()=>{y([]),I([]),t({severity:[],id:[]})},startIcon:e.jsx(Tt,{fontSize:"small"}),sx:{color:"text.secondary",textTransform:"none",minWidth:"auto","&:hover":{backgroundColor:"transparent"},"& .MuiButton-startIcon":{marginRight:"2px"}},children:x("notification.clear")})})]}),e.jsx(u,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(Be,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2,flex:1},children:Z.map(l=>e.jsx(Le,{elevation:0,sx:Ge(b.includes(l.value)),children:e.jsx(Y,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{display:"flex",alignItems:"center",gap:1,fontSize:"0.875rem"},..._e},control:e.jsx($e,{checked:b.includes(l.value),onChange:()=>oe(l.value),disabled:a,size:"small"}),label:e.jsxs(u,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5},children:[e.jsx(pe,{severity:l.value}),l.label]})})},l.value))})}),e.jsxs(u,{sx:{mb:2},children:[e.jsxs(u,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,mb:1.5},children:[e.jsx(R,{variant:"subtitle1",sx:{fontWeight:"bold",width:"calc(100% - 36px)"},children:x("notification.from")}),e.jsx(u,{sx:{display:"flex",alignItems:"center",width:"calc(100% - 36px)"},children:e.jsx(Ze,{size:"small",placeholder:"search",value:$,onChange:me,sx:{width:"100%","& .MuiOutlinedInput-input":{padding:"6px 4px 6px 0"},".MuiOutlinedInput-root":{"&:hover":{fieldset:{borderColor:"divider"}},"&.Mui-focused":{fieldset:{borderColor:"divider"}}},fieldset:{borderColor:"divider"}},slotProps:{input:{size:"small",startAdornment:e.jsx(Ye,{position:"start",sx:{marginRight:"2px"},children:e.jsx(L,{icon:wr})})}}})})]}),e.jsx(Be,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2},children:ye.map(l=>e.jsx(Le,{elevation:0,sx:Ge(m.includes(l.id)),children:e.jsx(Y,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{fontSize:"0.875rem",width:"calc(100% - 36px)"},..._e},control:e.jsx($e,{checked:m.includes(l.id),onChange:()=>ne(l.id),disabled:a,size:"small"}),label:e.jsxs(u,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,minWidth:0,width:"100%"},children:[l.blocklet&&e.jsx(Ue,{size:20,blocklet:l.blocklet,ancestors:l.ancestors,style:{borderRadius:4,flexShrink:0}}),e.jsx(R,{noWrap:!0,variant:"body2",component:"span",title:l.label,sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},children:l.label})]})})},l.id))}),k.length>qe&&$.trim()===""&&e.jsx(_,{fullWidth:!0,size:"small",onClick:be,sx:{mt:1},endIcon:M?e.jsx(At,{}):e.jsx(Mt,{})})]})]})})]})]}),m.length>0||b.length>0?e.jsxs(u,{className:"notification-filter-content",sx:{display:"flex",flexWrap:"wrap",gap:1,mt:2},children:[b.map(l=>{const C=Z.find(T=>T.value===l);return e.jsx(ke,{label:e.jsxs(u,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(pe,{severity:l}),C?C.label:l]}),onDelete:()=>oe(l),size:"small",variant:"outlined",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`severity-${l}`)}),m.map(l=>{const C=V.find(T=>T.id===l);return e.jsx(ke,{label:e.jsxs(u,{sx:{display:"flex",alignItems:"center",gap:.5},children:[C?.blocklet&&e.jsx(Ue,{size:16,blocklet:C.blocklet,ancestors:C.ancestors,style:{borderRadius:4,flexShrink:0}}),C?C.label:l]}),variant:"outlined",onDelete:()=>ne(l),size:"small",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`component-${l}`)})]}):null]})}const tn=ee(Bt)`
2
2
  position: fixed;
3
3
  bottom: 20px;
4
4
  right: 20px;
@@ -1 +1 @@
1
- import{j as t,ak as s,T as n,W as i}from"./vendor-mui-core-BwwTYUH3.js";import{T as f}from"./vendor-ux-BglKGRhr.js";import{L as g,r as k}from"./vendor-react-x2lQvn4m.js";import"./index-dIkcxCDN.js";import"./vendor-utils-DQY0X1ND.js";import"./vendor-hooks-uwq5Zgdd.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-BEuhHuNQ.js";const l=(e,o)=>[e,...Array.isArray(o)?o:[o]],a=(e=2)=>({overflow:"hidden",textOverflow:"ellipsis",wordBreak:"break-word",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical"});function p({sx:e={},...o}){const r=l({display:"flex",flexWrap:"wrap",mx:-1},e);return t.jsx(s,{sx:r,...o})}p.propTypes={sx:i.object};function w({icon:e}){const[o,r]=k.useState(!1);return!e||o?null:typeof e=="string"?t.jsx(s,{component:"img",src:e,alt:"",sx:{width:1,height:1},onError:()=>r(!0)}):e}w.propTypes={icon:i.oneOfType([i.string,i.node]).isRequired};function b({title:e,desc:o,extra:r,cover:c,icon:d,to:x,sx:h}){const m=l({position:"relative",flexBasis:{xs:"100%",sm:"50%",md:"33.33%",lg:"25%"},maxWidth:{xs:"100%",sm:"50%",md:"33.33%",lg:"25%"},mb:{xs:2,md:6},px:1},h);return t.jsx(s,{sx:m,children:t.jsx(s,{component:g,to:x,target:"_blank",sx:{display:"flex",flexDirection:"column",gap:1,height:1,pt:0,color:"inherit",textDecoration:"none",borderRadius:1,cursor:"pointer"},children:t.jsxs(s,{children:[t.jsxs(s,{sx:{position:"relative"},children:[c,d&&t.jsx(s,{sx:{position:"absolute",top:44,left:16,zIndex:1,width:56,height:56},children:t.jsx(w,{icon:d})})]}),t.jsx(n,{sx:{mt:1,fontSize:"1.25rem",fontWeight:600,...a()},children:e}),o&&t.jsx(n,{variant:"body2",sx:{my:1,...a(),color:"text.secondary"},children:o}),r]})})})}b.propTypes={title:i.string.isRequired,desc:i.string.isRequired,extra:i.node.isRequired,cover:i.string.isRequired,icon:i.string.isRequired,to:i.string.isRequired,sx:i.object.isRequired};const j="/.well-known/service/static/assets/doc-board-bg-DWZHV9Ng.png";function u({board:e,sx:o,...r}){return t.jsx(b,{date:e.createdAt,sx:o,to:e.link,title:e.title,desc:e.desc,cover:t.jsx(s,{sx:{position:"relative",paddingTop:`${9/16*100}%`,border:1,borderColor:"divider",borderRadius:1,overflow:"hidden"},children:t.jsx(s,{component:"img",src:j,alt:"",sx:{position:"absolute",top:0,left:0,width:1,filter:c=>c.palette.mode==="dark"?"brightness(0.28) contrast(1.1)":"none"}})}),icon:e.icon,...r})}u.propTypes={board:i.object.isRequired,sx:i.object.isRequired};function I(){const{locale:e}=f(),o=[{id:"1",title:"Blocklet Platform",desc:"Guide to understand and build on our blocklet platform",icon:"https://www.arcblock.io/favicon.ico",link:`https://www.arcblock.io/docs/blocklet-developer/${e}/getting-started`},{id:"2",title:"Create Blocklet",desc:"Build blocklet with just one command line.",icon:"https://www.arcblock.io/favicon.ico",link:`https://www.arcblock.io/docs/createblocklet/${e}/quick-start`},{id:"3",title:"Blocklet Launcher",desc:"Streamlining Blocklet Launching.",icon:"https://www.arcblock.io/docs/uploads/5a4f4716bc8061532a535fe816a9169c.png",link:`https://www.arcblock.io/docs/launcher/${e}/launcher-welcome`},{id:"4",title:"DID Spaces",desc:"Digital Spaces for Decentralized Identity (DID)",icon:"https://www.arcblock.io/docs/uploads/3a8b142d7c940c57eced71eddba2ff19.png",link:`https://www.arcblock.io/docs/did-spaces/${e}/did-spaces-getting-started`},{id:"5",title:"DID Wallet",desc:"DID Wallet Support docs",icon:"https://www.arcblock.io/docs/uploads/59ddb28f405ee670428e5fe1ff12d104.png",link:`https://www.arcblock.io/docs/did-wallet/${e}/get-started`},{id:"6",title:"DID Names",desc:"Naming Service based on NFT and verifiable credentials",icon:"https://www.didnames.io/favicon.ico?imageFilter=resize&w=32",link:`https://www.arcblock.io/docs/did-domain/${e}/did-domain-faq`},{id:"7",title:"Blockchain",desc:"The ledger for ArcBlock ecosystem",icon:"https://www.arcblock.io/docs/uploads/4a20c152faae0f104ed0815ff3b8b48b.png",link:`https://www.arcblock.io/docs/blockchain/${e}/blockchain-how-to-guides`},{id:"8",title:"DID Connect",desc:"The open protocol and development kit for connecting users and dapps",icon:"https://www.arcblock.io/docs/uploads/d189118f89b56e9d5b03ad5a0212a4ab.png",link:`https://www.arcblock.io/docs/did-connect/${e}/developer-guides`}];return t.jsx(p,{children:o.map(r=>t.jsx(u,{board:r},r.id))})}export{I as default};
1
+ import{j as t,ak as s,T as n,W as i}from"./vendor-mui-core-DWYIngcn.js";import{T as f}from"./vendor-ux-Dln42oC3.js";import{L as g,r as k}from"./vendor-react-Dvs43sk9.js";import"./index-CgCJ2qDh.js";import"./vendor-utils-J7aLFpEq.js";import"./vendor-hooks-HB6DqcLv.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-B78OG6SS.js";const l=(e,o)=>[e,...Array.isArray(o)?o:[o]],a=(e=2)=>({overflow:"hidden",textOverflow:"ellipsis",wordBreak:"break-word",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical"});function p({sx:e={},...o}){const r=l({display:"flex",flexWrap:"wrap",mx:-1},e);return t.jsx(s,{sx:r,...o})}p.propTypes={sx:i.object};function w({icon:e}){const[o,r]=k.useState(!1);return!e||o?null:typeof e=="string"?t.jsx(s,{component:"img",src:e,alt:"",sx:{width:1,height:1},onError:()=>r(!0)}):e}w.propTypes={icon:i.oneOfType([i.string,i.node]).isRequired};function b({title:e,desc:o,extra:r,cover:c,icon:d,to:x,sx:h}){const m=l({position:"relative",flexBasis:{xs:"100%",sm:"50%",md:"33.33%",lg:"25%"},maxWidth:{xs:"100%",sm:"50%",md:"33.33%",lg:"25%"},mb:{xs:2,md:6},px:1},h);return t.jsx(s,{sx:m,children:t.jsx(s,{component:g,to:x,target:"_blank",sx:{display:"flex",flexDirection:"column",gap:1,height:1,pt:0,color:"inherit",textDecoration:"none",borderRadius:1,cursor:"pointer"},children:t.jsxs(s,{children:[t.jsxs(s,{sx:{position:"relative"},children:[c,d&&t.jsx(s,{sx:{position:"absolute",top:44,left:16,zIndex:1,width:56,height:56},children:t.jsx(w,{icon:d})})]}),t.jsx(n,{sx:{mt:1,fontSize:"1.25rem",fontWeight:600,...a()},children:e}),o&&t.jsx(n,{variant:"body2",sx:{my:1,...a(),color:"text.secondary"},children:o}),r]})})})}b.propTypes={title:i.string.isRequired,desc:i.string.isRequired,extra:i.node.isRequired,cover:i.string.isRequired,icon:i.string.isRequired,to:i.string.isRequired,sx:i.object.isRequired};const j="/.well-known/service/static/assets/doc-board-bg-DWZHV9Ng.png";function u({board:e,sx:o,...r}){return t.jsx(b,{date:e.createdAt,sx:o,to:e.link,title:e.title,desc:e.desc,cover:t.jsx(s,{sx:{position:"relative",paddingTop:`${9/16*100}%`,border:1,borderColor:"divider",borderRadius:1,overflow:"hidden"},children:t.jsx(s,{component:"img",src:j,alt:"",sx:{position:"absolute",top:0,left:0,width:1,filter:c=>c.palette.mode==="dark"?"brightness(0.28) contrast(1.1)":"none"}})}),icon:e.icon,...r})}u.propTypes={board:i.object.isRequired,sx:i.object.isRequired};function I(){const{locale:e}=f(),o=[{id:"1",title:"Blocklet Platform",desc:"Guide to understand and build on our blocklet platform",icon:"https://www.arcblock.io/favicon.ico",link:`https://www.arcblock.io/docs/blocklet-developer/${e}/getting-started`},{id:"2",title:"Create Blocklet",desc:"Build blocklet with just one command line.",icon:"https://www.arcblock.io/favicon.ico",link:`https://www.arcblock.io/docs/createblocklet/${e}/quick-start`},{id:"3",title:"Blocklet Launcher",desc:"Streamlining Blocklet Launching.",icon:"https://www.arcblock.io/docs/uploads/5a4f4716bc8061532a535fe816a9169c.png",link:`https://www.arcblock.io/docs/launcher/${e}/launcher-welcome`},{id:"4",title:"DID Spaces",desc:"Digital Spaces for Decentralized Identity (DID)",icon:"https://www.arcblock.io/docs/uploads/3a8b142d7c940c57eced71eddba2ff19.png",link:`https://www.arcblock.io/docs/did-spaces/${e}/did-spaces-getting-started`},{id:"5",title:"DID Wallet",desc:"DID Wallet Support docs",icon:"https://www.arcblock.io/docs/uploads/59ddb28f405ee670428e5fe1ff12d104.png",link:`https://www.arcblock.io/docs/did-wallet/${e}/get-started`},{id:"6",title:"DID Names",desc:"Naming Service based on NFT and verifiable credentials",icon:"https://www.didnames.io/favicon.ico?imageFilter=resize&w=32",link:`https://www.arcblock.io/docs/did-domain/${e}/did-domain-faq`},{id:"7",title:"Blockchain",desc:"The ledger for ArcBlock ecosystem",icon:"https://www.arcblock.io/docs/uploads/4a20c152faae0f104ed0815ff3b8b48b.png",link:`https://www.arcblock.io/docs/blockchain/${e}/blockchain-how-to-guides`},{id:"8",title:"DID Connect",desc:"The open protocol and development kit for connecting users and dapps",icon:"https://www.arcblock.io/docs/uploads/d189118f89b56e9d5b03ad5a0212a4ab.png",link:`https://www.arcblock.io/docs/did-connect/${e}/developer-guides`}];return t.jsx(p,{children:o.map(r=>t.jsx(u,{board:r},r.id))})}export{I as default};
@@ -1 +1 @@
1
- import{p as k}from"./vendor-react-x2lQvn4m.js";var m,C;function S(){if(C)return m;C=1;function v(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function A(o,e){for(var r="",i=0,f=-1,t=0,n,l=0;l<=o.length;++l){if(l<o.length)n=o.charCodeAt(l);else{if(n===47)break;n=47}if(n===47){if(!(f===l-1||t===1))if(f!==l-1&&t===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var s=r.lastIndexOf("/");if(s!==r.length-1){s===-1?(r="",i=0):(r=r.slice(0,s),i=r.length-1-r.lastIndexOf("/")),f=l,t=0;continue}}else if(r.length===2||r.length===1){r="",i=0,f=l,t=0;continue}}e&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+o.slice(f+1,l):r=o.slice(f+1,l),i=l-f-1;f=l,t=0}else n===46&&t!==-1?++t:t=-1}return r}function b(o,e){var r=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+i:r+o+i:i}var g={resolve:function(){for(var e="",r=!1,i,f=arguments.length-1;f>=-1&&!r;f--){var t;f>=0?t=arguments[f]:(i===void 0&&(i=k.cwd()),t=i),v(t),t.length!==0&&(e=t+"/"+e,r=t.charCodeAt(0)===47)}return e=A(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(v(e),e.length===0)return".";var r=e.charCodeAt(0)===47,i=e.charCodeAt(e.length-1)===47;return e=A(e,!r),e.length===0&&!r&&(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return v(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var e,r=0;r<arguments.length;++r){var i=arguments[r];v(i),i.length>0&&(e===void 0?e=i:e+="/"+i)}return e===void 0?".":g.normalize(e)},relative:function(e,r){if(v(e),v(r),e===r||(e=g.resolve(e),r=g.resolve(r),e===r))return"";for(var i=1;i<e.length&&e.charCodeAt(i)===47;++i);for(var f=e.length,t=f-i,n=1;n<r.length&&r.charCodeAt(n)===47;++n);for(var l=r.length,s=l-n,c=t<s?t:s,u=-1,a=0;a<=c;++a){if(a===c){if(s>c){if(r.charCodeAt(n+a)===47)return r.slice(n+a+1);if(a===0)return r.slice(n+a)}else t>c&&(e.charCodeAt(i+a)===47?u=a:a===0&&(u=0));break}var h=e.charCodeAt(i+a),y=r.charCodeAt(n+a);if(h!==y)break;h===47&&(u=a)}var d="";for(a=i+u+1;a<=f;++a)(a===f||e.charCodeAt(a)===47)&&(d.length===0?d+="..":d+="/..");return d.length>0?d+r.slice(n+u):(n+=u,r.charCodeAt(n)===47&&++n,r.slice(n))},_makeLong:function(e){return e},dirname:function(e){if(v(e),e.length===0)return".";for(var r=e.charCodeAt(0),i=r===47,f=-1,t=!0,n=e.length-1;n>=1;--n)if(r=e.charCodeAt(n),r===47){if(!t){f=n;break}}else t=!1;return f===-1?i?"/":".":i&&f===1?"//":e.slice(0,f)},basename:function(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');v(e);var i=0,f=-1,t=!0,n;if(r!==void 0&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var l=r.length-1,s=-1;for(n=e.length-1;n>=0;--n){var c=e.charCodeAt(n);if(c===47){if(!t){i=n+1;break}}else s===-1&&(t=!1,s=n+1),l>=0&&(c===r.charCodeAt(l)?--l===-1&&(f=n):(l=-1,f=s))}return i===f?f=s:f===-1&&(f=e.length),e.slice(i,f)}else{for(n=e.length-1;n>=0;--n)if(e.charCodeAt(n)===47){if(!t){i=n+1;break}}else f===-1&&(t=!1,f=n+1);return f===-1?"":e.slice(i,f)}},extname:function(e){v(e);for(var r=-1,i=0,f=-1,t=!0,n=0,l=e.length-1;l>=0;--l){var s=e.charCodeAt(l);if(s===47){if(!t){i=l+1;break}continue}f===-1&&(t=!1,f=l+1),s===46?r===-1?r=l:n!==1&&(n=1):r!==-1&&(n=-1)}return r===-1||f===-1||n===0||n===1&&r===f-1&&r===i+1?"":e.slice(r,f)},format:function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return b("/",e)},parse:function(e){v(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var i=e.charCodeAt(0),f=i===47,t;f?(r.root="/",t=1):t=0;for(var n=-1,l=0,s=-1,c=!0,u=e.length-1,a=0;u>=t;--u){if(i=e.charCodeAt(u),i===47){if(!c){l=u+1;break}continue}s===-1&&(c=!1,s=u+1),i===46?n===-1?n=u:a!==1&&(a=1):n!==-1&&(a=-1)}return n===-1||s===-1||a===0||a===1&&n===s-1&&n===l+1?s!==-1&&(l===0&&f?r.base=r.name=e.slice(1,s):r.base=r.name=e.slice(l,s)):(l===0&&f?(r.name=e.slice(1,n),r.base=e.slice(1,s)):(r.name=e.slice(l,n),r.base=e.slice(l,s)),r.ext=e.slice(n,s)),l>0?r.dir=e.slice(0,l-1):f&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return g.posix=g,m=g,m}export{S as r};
1
+ import{p as k}from"./vendor-react-Dvs43sk9.js";var m,C;function S(){if(C)return m;C=1;function v(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function A(o,e){for(var r="",i=0,f=-1,t=0,n,l=0;l<=o.length;++l){if(l<o.length)n=o.charCodeAt(l);else{if(n===47)break;n=47}if(n===47){if(!(f===l-1||t===1))if(f!==l-1&&t===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var s=r.lastIndexOf("/");if(s!==r.length-1){s===-1?(r="",i=0):(r=r.slice(0,s),i=r.length-1-r.lastIndexOf("/")),f=l,t=0;continue}}else if(r.length===2||r.length===1){r="",i=0,f=l,t=0;continue}}e&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+o.slice(f+1,l):r=o.slice(f+1,l),i=l-f-1;f=l,t=0}else n===46&&t!==-1?++t:t=-1}return r}function b(o,e){var r=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+i:r+o+i:i}var g={resolve:function(){for(var e="",r=!1,i,f=arguments.length-1;f>=-1&&!r;f--){var t;f>=0?t=arguments[f]:(i===void 0&&(i=k.cwd()),t=i),v(t),t.length!==0&&(e=t+"/"+e,r=t.charCodeAt(0)===47)}return e=A(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(v(e),e.length===0)return".";var r=e.charCodeAt(0)===47,i=e.charCodeAt(e.length-1)===47;return e=A(e,!r),e.length===0&&!r&&(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return v(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var e,r=0;r<arguments.length;++r){var i=arguments[r];v(i),i.length>0&&(e===void 0?e=i:e+="/"+i)}return e===void 0?".":g.normalize(e)},relative:function(e,r){if(v(e),v(r),e===r||(e=g.resolve(e),r=g.resolve(r),e===r))return"";for(var i=1;i<e.length&&e.charCodeAt(i)===47;++i);for(var f=e.length,t=f-i,n=1;n<r.length&&r.charCodeAt(n)===47;++n);for(var l=r.length,s=l-n,c=t<s?t:s,u=-1,a=0;a<=c;++a){if(a===c){if(s>c){if(r.charCodeAt(n+a)===47)return r.slice(n+a+1);if(a===0)return r.slice(n+a)}else t>c&&(e.charCodeAt(i+a)===47?u=a:a===0&&(u=0));break}var h=e.charCodeAt(i+a),y=r.charCodeAt(n+a);if(h!==y)break;h===47&&(u=a)}var d="";for(a=i+u+1;a<=f;++a)(a===f||e.charCodeAt(a)===47)&&(d.length===0?d+="..":d+="/..");return d.length>0?d+r.slice(n+u):(n+=u,r.charCodeAt(n)===47&&++n,r.slice(n))},_makeLong:function(e){return e},dirname:function(e){if(v(e),e.length===0)return".";for(var r=e.charCodeAt(0),i=r===47,f=-1,t=!0,n=e.length-1;n>=1;--n)if(r=e.charCodeAt(n),r===47){if(!t){f=n;break}}else t=!1;return f===-1?i?"/":".":i&&f===1?"//":e.slice(0,f)},basename:function(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');v(e);var i=0,f=-1,t=!0,n;if(r!==void 0&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var l=r.length-1,s=-1;for(n=e.length-1;n>=0;--n){var c=e.charCodeAt(n);if(c===47){if(!t){i=n+1;break}}else s===-1&&(t=!1,s=n+1),l>=0&&(c===r.charCodeAt(l)?--l===-1&&(f=n):(l=-1,f=s))}return i===f?f=s:f===-1&&(f=e.length),e.slice(i,f)}else{for(n=e.length-1;n>=0;--n)if(e.charCodeAt(n)===47){if(!t){i=n+1;break}}else f===-1&&(t=!1,f=n+1);return f===-1?"":e.slice(i,f)}},extname:function(e){v(e);for(var r=-1,i=0,f=-1,t=!0,n=0,l=e.length-1;l>=0;--l){var s=e.charCodeAt(l);if(s===47){if(!t){i=l+1;break}continue}f===-1&&(t=!1,f=l+1),s===46?r===-1?r=l:n!==1&&(n=1):r!==-1&&(n=-1)}return r===-1||f===-1||n===0||n===1&&r===f-1&&r===i+1?"":e.slice(r,f)},format:function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return b("/",e)},parse:function(e){v(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var i=e.charCodeAt(0),f=i===47,t;f?(r.root="/",t=1):t=0;for(var n=-1,l=0,s=-1,c=!0,u=e.length-1,a=0;u>=t;--u){if(i=e.charCodeAt(u),i===47){if(!c){l=u+1;break}continue}s===-1&&(c=!1,s=u+1),i===46?n===-1?n=u:a!==1&&(a=1):n!==-1&&(a=-1)}return n===-1||s===-1||a===0||a===1&&n===s-1&&n===l+1?s!==-1&&(l===0&&f?r.base=r.name=e.slice(1,s):r.base=r.name=e.slice(l,s)):(l===0&&f?(r.name=e.slice(1,n),r.base=e.slice(1,s)):(r.name=e.slice(l,n),r.base=e.slice(l,s)),r.ext=e.slice(n,s)),l>0?r.dir=e.slice(0,l-1):f&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return g.posix=g,m=g,m}export{S as r};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/lottie-react.esm-Bqal_rmd.js","assets/vendor-react-x2lQvn4m.js"])))=>i.map(i=>d[i]);
2
- import{j as e,ak as s,bY as h,T as k,z as G,bp as V,b6 as U,bq as q,c8 as O,Q as R,at as I,ar as B,c9 as X,ca as J,cb as W,I as Y,cc as H,D as K,aj as Q}from"./vendor-mui-core-BwwTYUH3.js";import{r as j}from"./vendor-react-x2lQvn4m.js";import{p as Z,g as N,u as ee,j as te,e as oe}from"./vendor-hooks-uwq5Zgdd.js";import{G as re,R as ie,_ as C}from"./vendor-ux-BglKGRhr.js";import{X as se}from"./vendor-utils-DQY0X1ND.js";import{getAIKitComponent as ne}from"./index-BcuyH8tS.js";import"./lottie-web-4koyQiv_.js";import"./index-dIkcxCDN.js";import"./vendor-arcblock-BEuhHuNQ.js";import"./index-MGxe3V9B.js";import"./index-DRYJ0xIl.js";const T=j.createContext({}),D=()=>j.useContext(T);function ae({children:o,restrictions:f,i18n:d,theme:r}){const[n,b]=Z({loading:!1}),c=i=>b(g=>({...g,loading:i})),x=j.useMemo(()=>({...n,onLoading:c,restrictions:f,i18n:d}),[n]);return e.jsx(re,{theme:r,children:e.jsx(T.Provider,{value:x,children:o})})}const le=["1024x1024","1024x1792","1792x1024"],de=["256x256","512x512","1024x1024"],ce=[{label:"DALL·E 3",value:"dall-e-3"},{label:"DALL·E 2",value:"dall-e-2"}];function pe({onSubmit:o}){const{loading:f,i18n:d}=D(),r=N({model:"dall-e-3",prompt:"",size:"1024x1024",number:1}),n=()=>{const i=JSON.parse(JSON.stringify(r));Object.values(r).every(y=>!!y)&&o(i)},{run:b}=ee(n,{wait:500}),c={width:"100%",pl:1,pr:1},x=r.model==="dall-e-2"?de:le;return e.jsxs(xe,{onSubmit:i=>i.preventDefault(),children:[e.jsx(s,{sx:{flex:1,overflowY:"auto",overflowX:"hidden",m:2,mb:0},children:e.jsxs(h,{container:!0,sx:{gap:2.5},children:[e.jsxs(h,{size:12,children:[e.jsx(k,{gutterBottom:!0,className:"title label",sx:{color:"text.primary"},children:d("aiImagePrompt")}),e.jsx(G,{sx:{width:1,mt:1},size:"small",type:"text",required:!0,placeholder:d("aiImagePromptTip"),multiline:!0,minRows:5,maxRows:6,value:r.prompt??"",onChange:i=>{i.stopPropagation(),r.prompt=i.target.value},slotProps:{htmlInput:{maxLength:1e3}}})]}),e.jsxs(h,{size:12,children:[e.jsx(k,{gutterBottom:!0,className:"title label",sx:{color:"text.primary"},children:`${d("aiImageModel")}`}),e.jsx(V,{row:!0,sx:{".MuiFormControlLabel-label":{fontSize:"12px",color:"text.primary"}},value:r.model,onChange:i=>{r.number=1,r.size="1024x1024",r.model=i.target.value},children:ce.map(i=>e.jsx(U,{value:i.value,control:e.jsx(q,{size:"small"}),label:i.label},i.label))})]}),e.jsxs(h,{size:12,children:[e.jsx(k,{gutterBottom:!0,className:"title label",sx:{color:"text.primary"},children:`${d("aiImageSize")}: ${r.size}`}),e.jsx(h,{container:!0,sx:{gap:2.5,pt:1},children:e.jsx(s,{sx:{flex:1},children:e.jsx(s,{...c,children:e.jsx(O,{size:"small",min:0,max:x.length-1,step:1,value:x.findIndex(i=>i==r.size),onChange:(i,g)=>{r.size=x[g]}})})})})]}),r.model==="dall-e-2"&&e.jsxs(h,{size:12,children:[e.jsx(k,{gutterBottom:!0,className:"title label",sx:{color:"text.primary"},children:`${d("aiImageNumber")}: ${r.number}`}),e.jsx(s,{...c,children:e.jsx(O,{size:"small",defaultValue:1,valueLabelDisplay:"auto",step:1,min:1,max:10,value:r.number,onChange:(i,g)=>{i.stopPropagation(),r.number=Number(g)}})})]})]})}),e.jsx(R,{sx:{m:2,transition:"all 0.3s"},className:"submit-ai",variant:"contained",onClick:b,disabled:f,children:d(f?"aiImageGenerating":"aiImageGenerate")},f?"loading-submit":"submit")]})}const xe=I(s)`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/lottie-react.esm-M5fKy3fg.js","assets/vendor-react-Dvs43sk9.js"])))=>i.map(i=>d[i]);
2
+ import{j as e,ak as s,bY as h,T as k,z as G,bp as V,b6 as U,bq as q,c8 as O,Q as R,at as I,ar as B,c9 as X,ca as J,cb as W,I as Y,cc as H,D as K,aj as Q}from"./vendor-mui-core-DWYIngcn.js";import{r as j}from"./vendor-react-Dvs43sk9.js";import{p as Z,g as N,u as ee,j as te,e as oe}from"./vendor-hooks-HB6DqcLv.js";import{G as re,R as ie,_ as C}from"./vendor-ux-Dln42oC3.js";import{X as se}from"./vendor-utils-J7aLFpEq.js";import{getAIKitComponent as ne}from"./index-LvmCZD51.js";import"./lottie-web-4koyQiv_.js";import"./index-CgCJ2qDh.js";import"./vendor-arcblock-B78OG6SS.js";import"./index-BPy8_fa2.js";import"./index-DRYJ0xIl.js";const T=j.createContext({}),D=()=>j.useContext(T);function ae({children:o,restrictions:f,i18n:d,theme:r}){const[n,b]=Z({loading:!1}),c=i=>b(g=>({...g,loading:i})),x=j.useMemo(()=>({...n,onLoading:c,restrictions:f,i18n:d}),[n]);return e.jsx(re,{theme:r,children:e.jsx(T.Provider,{value:x,children:o})})}const le=["1024x1024","1024x1792","1792x1024"],de=["256x256","512x512","1024x1024"],ce=[{label:"DALL·E 3",value:"dall-e-3"},{label:"DALL·E 2",value:"dall-e-2"}];function pe({onSubmit:o}){const{loading:f,i18n:d}=D(),r=N({model:"dall-e-3",prompt:"",size:"1024x1024",number:1}),n=()=>{const i=JSON.parse(JSON.stringify(r));Object.values(r).every(y=>!!y)&&o(i)},{run:b}=ee(n,{wait:500}),c={width:"100%",pl:1,pr:1},x=r.model==="dall-e-2"?de:le;return e.jsxs(xe,{onSubmit:i=>i.preventDefault(),children:[e.jsx(s,{sx:{flex:1,overflowY:"auto",overflowX:"hidden",m:2,mb:0},children:e.jsxs(h,{container:!0,sx:{gap:2.5},children:[e.jsxs(h,{size:12,children:[e.jsx(k,{gutterBottom:!0,className:"title label",sx:{color:"text.primary"},children:d("aiImagePrompt")}),e.jsx(G,{sx:{width:1,mt:1},size:"small",type:"text",required:!0,placeholder:d("aiImagePromptTip"),multiline:!0,minRows:5,maxRows:6,value:r.prompt??"",onChange:i=>{i.stopPropagation(),r.prompt=i.target.value},slotProps:{htmlInput:{maxLength:1e3}}})]}),e.jsxs(h,{size:12,children:[e.jsx(k,{gutterBottom:!0,className:"title label",sx:{color:"text.primary"},children:`${d("aiImageModel")}`}),e.jsx(V,{row:!0,sx:{".MuiFormControlLabel-label":{fontSize:"12px",color:"text.primary"}},value:r.model,onChange:i=>{r.number=1,r.size="1024x1024",r.model=i.target.value},children:ce.map(i=>e.jsx(U,{value:i.value,control:e.jsx(q,{size:"small"}),label:i.label},i.label))})]}),e.jsxs(h,{size:12,children:[e.jsx(k,{gutterBottom:!0,className:"title label",sx:{color:"text.primary"},children:`${d("aiImageSize")}: ${r.size}`}),e.jsx(h,{container:!0,sx:{gap:2.5,pt:1},children:e.jsx(s,{sx:{flex:1},children:e.jsx(s,{...c,children:e.jsx(O,{size:"small",min:0,max:x.length-1,step:1,value:x.findIndex(i=>i==r.size),onChange:(i,g)=>{r.size=x[g]}})})})})]}),r.model==="dall-e-2"&&e.jsxs(h,{size:12,children:[e.jsx(k,{gutterBottom:!0,className:"title label",sx:{color:"text.primary"},children:`${d("aiImageNumber")}: ${r.number}`}),e.jsx(s,{...c,children:e.jsx(O,{size:"small",defaultValue:1,valueLabelDisplay:"auto",step:1,min:1,max:10,value:r.number,onChange:(i,g)=>{i.stopPropagation(),r.number=Number(g)}})})]})]})}),e.jsx(R,{sx:{m:2,transition:"all 0.3s"},className:"submit-ai",variant:"contained",onClick:b,disabled:f,children:d(f?"aiImageGenerating":"aiImageGenerate")},f?"loading-submit":"submit")]})}const xe=I(s)`
3
3
  display: flex;
4
4
  flex-direction: column;
5
5
  height: 100%;
@@ -93,7 +93,7 @@ import{j as e,ak as s,bY as h,T as k,z as G,bp as V,b6 as U,bq as q,c8 as O,Q as
93
93
  & path:last-child {
94
94
  fill: white;
95
95
  }
96
- `,ge=j.lazy(()=>C(()=>import("./lottie-react.esm-Bqal_rmd.js"),__vite__mapDeps([0,1])).then(o=>({default:o.Player})));function L({src:o}){return e.jsx(ge,{src:o,loop:!0,autoplay:!0})}function be({options:o,handleApi:f,onSelect:d,onFinish:r,onClose:n,isMobile:b}){const{loading:c,onLoading:x,restrictions:i,i18n:g}=D(),[a,y]=j.useState([]),[m,z]=j.useState(),_=K(),S=i?.maxNumberOfFiles,[p,P]=j.useState({}),u=N({}),A=Object.keys(u).filter(t=>u[t]);j.useEffect(()=>{m&&!p.error&&C(()=>import("./lottie-error-DeJ4jU66.js"),[]).then(t=>{P(l=>({...l,error:t.default}))}),o&&!a.length&&!p.loading&&C(()=>import("./lottie-loading-Npqo86wA.js"),[]).then(t=>{P(l=>({...l,loading:t.default}))}),!o&&!p.welcome&&C(()=>import("./lottie-welcome-oyMgXGo-.js"),[]).then(t=>{P(l=>({...l,welcome:t.default}))})},[m,o,a.length,p]),te(async()=>{if(o){z(void 0),x(!0);try{const t=await f({...o,responseFormat:"b64_json"});if(t.data){const w=(t.data||[]).map(v=>({src:`data:image/png;base64,${v.b64Json||v.b64_json}`,width:o.size?Number((o.size||"").split("x")[0]):1024,alt:o.prompt}));y(a?[...w,...a]:w)}else z(t)}catch(t){console.error("AIImage generate error: ",t),z(t?.response?.data||t)}finally{x(!1),r()}}},[o?.number,o?.prompt,o?.size]);const E=t=>{const l=Object.keys(u).filter(v=>u[v]);if(S?l.length<S:!0)u[t]?u[t]=!1:u[t]=!0;else{const v=l.pop();v!==t&&(u[v]=!1),u[t]=!u[t]}},F=t=>{if(a){const l=a.findIndex(w=>w.src===t);l>-1&&(u[t]=!1,a.splice(l,1),y([...a]))}},$=()=>{const t={width:document.querySelector(".photo-item img")?.offsetWidth||0,height:document.querySelector(".photo-item img")?.offsetHeight||0};return e.jsx(e.Fragment,{children:Array.from({length:o?.number||1}).map((l,w)=>e.jsx(h,{children:e.jsx(B,{className:"lazy-image-skeleton",animation:"wave",variant:"rectangular",style:{borderRadius:"12px",...t}})},w))})},M=()=>m?e.jsxs(s,{sx:{width:300,height:300,m:"auto"},children:[p.error&&e.jsx(L,{src:p.error},"error"),e.jsx(s,{sx:{textAlign:"center",color:"#25292F",wordBreak:"break-all"},children:m?.message})]}):a&&Array.isArray(a)&&a.length>0?e.jsxs(e.Fragment,{children:[e.jsx(s,{sx:{flexGrow:1,height:0,overflowX:"hidden",overflowY:"auto"},children:e.jsx(ye,{sx:b?{p:0,border:"none !important"}:{p:2},children:e.jsxs(h,{spacing:2,container:!0,className:"photo-wrapper",children:[c&&e.jsx($,{}),a.map((t,l)=>e.jsx(h,{className:"photo-item",children:e.jsx(ue,{...t,selected:u[t.src],style:{objectFit:"cover",cursor:"pointer",transition:"all 0.3s",border:u[t.src]?`2px solid ${_.palette.primary.main}`:"2px solid transparent",WebkitUserDrag:"none",width:"100%",height:"100%"},onClick:()=>{E(t.src)},onDelete:()=>{F(t.src)}})},t.src))]})})}),e.jsxs(s,{sx:{mt:2,display:"flex",justifyContent:n?"space-between":"flex-end",button:{borderRadius:"30px",height:40,textTransform:"none"}},children:[n&&typeof n=="function"&&e.jsx(R,{color:"primary",variant:"outlined",onClick:n,children:e.jsx(Q,{})}),e.jsx(R,{color:"primary",variant:"contained",disabled:!A.length||c,onClick:()=>{const t=se(a,"src");d(A.map(l=>t[l]))},children:A.length?g("aiImageSelectedUse"):g("aiImageSelectedTip")})]})]}):o?e.jsx(s,{sx:{width:220,height:220,m:"auto"},children:p.loading&&e.jsx(L,{src:p.loading},"loading")}):e.jsx(s,{sx:{width:300,height:300,m:"auto"},children:p.welcome&&e.jsx(L,{src:p.welcome},"welcome")});return e.jsx(je,{children:M()})}const je=I(s)`
96
+ `,ge=j.lazy(()=>C(()=>import("./lottie-react.esm-M5fKy3fg.js"),__vite__mapDeps([0,1])).then(o=>({default:o.Player})));function L({src:o}){return e.jsx(ge,{src:o,loop:!0,autoplay:!0})}function be({options:o,handleApi:f,onSelect:d,onFinish:r,onClose:n,isMobile:b}){const{loading:c,onLoading:x,restrictions:i,i18n:g}=D(),[a,y]=j.useState([]),[m,z]=j.useState(),_=K(),S=i?.maxNumberOfFiles,[p,P]=j.useState({}),u=N({}),A=Object.keys(u).filter(t=>u[t]);j.useEffect(()=>{m&&!p.error&&C(()=>import("./lottie-error-DeJ4jU66.js"),[]).then(t=>{P(l=>({...l,error:t.default}))}),o&&!a.length&&!p.loading&&C(()=>import("./lottie-loading-Npqo86wA.js"),[]).then(t=>{P(l=>({...l,loading:t.default}))}),!o&&!p.welcome&&C(()=>import("./lottie-welcome-oyMgXGo-.js"),[]).then(t=>{P(l=>({...l,welcome:t.default}))})},[m,o,a.length,p]),te(async()=>{if(o){z(void 0),x(!0);try{const t=await f({...o,responseFormat:"b64_json"});if(t.data){const w=(t.data||[]).map(v=>({src:`data:image/png;base64,${v.b64Json||v.b64_json}`,width:o.size?Number((o.size||"").split("x")[0]):1024,alt:o.prompt}));y(a?[...w,...a]:w)}else z(t)}catch(t){console.error("AIImage generate error: ",t),z(t?.response?.data||t)}finally{x(!1),r()}}},[o?.number,o?.prompt,o?.size]);const E=t=>{const l=Object.keys(u).filter(v=>u[v]);if(S?l.length<S:!0)u[t]?u[t]=!1:u[t]=!0;else{const v=l.pop();v!==t&&(u[v]=!1),u[t]=!u[t]}},F=t=>{if(a){const l=a.findIndex(w=>w.src===t);l>-1&&(u[t]=!1,a.splice(l,1),y([...a]))}},$=()=>{const t={width:document.querySelector(".photo-item img")?.offsetWidth||0,height:document.querySelector(".photo-item img")?.offsetHeight||0};return e.jsx(e.Fragment,{children:Array.from({length:o?.number||1}).map((l,w)=>e.jsx(h,{children:e.jsx(B,{className:"lazy-image-skeleton",animation:"wave",variant:"rectangular",style:{borderRadius:"12px",...t}})},w))})},M=()=>m?e.jsxs(s,{sx:{width:300,height:300,m:"auto"},children:[p.error&&e.jsx(L,{src:p.error},"error"),e.jsx(s,{sx:{textAlign:"center",color:"#25292F",wordBreak:"break-all"},children:m?.message})]}):a&&Array.isArray(a)&&a.length>0?e.jsxs(e.Fragment,{children:[e.jsx(s,{sx:{flexGrow:1,height:0,overflowX:"hidden",overflowY:"auto"},children:e.jsx(ye,{sx:b?{p:0,border:"none !important"}:{p:2},children:e.jsxs(h,{spacing:2,container:!0,className:"photo-wrapper",children:[c&&e.jsx($,{}),a.map((t,l)=>e.jsx(h,{className:"photo-item",children:e.jsx(ue,{...t,selected:u[t.src],style:{objectFit:"cover",cursor:"pointer",transition:"all 0.3s",border:u[t.src]?`2px solid ${_.palette.primary.main}`:"2px solid transparent",WebkitUserDrag:"none",width:"100%",height:"100%"},onClick:()=>{E(t.src)},onDelete:()=>{F(t.src)}})},t.src))]})})}),e.jsxs(s,{sx:{mt:2,display:"flex",justifyContent:n?"space-between":"flex-end",button:{borderRadius:"30px",height:40,textTransform:"none"}},children:[n&&typeof n=="function"&&e.jsx(R,{color:"primary",variant:"outlined",onClick:n,children:e.jsx(Q,{})}),e.jsx(R,{color:"primary",variant:"contained",disabled:!A.length||c,onClick:()=>{const t=se(a,"src");d(A.map(l=>t[l]))},children:A.length?g("aiImageSelectedUse"):g("aiImageSelectedTip")})]})]}):o?e.jsx(s,{sx:{width:220,height:220,m:"auto"},children:p.loading&&e.jsx(L,{src:p.loading},"loading")}):e.jsx(s,{sx:{width:300,height:300,m:"auto"},children:p.welcome&&e.jsx(L,{src:p.welcome},"welcome")});return e.jsx(je,{children:M()})}const je=I(s)`
97
97
  min-height: 100%;
98
98
  display: flex;
99
99
  flex-direction: column;
@@ -0,0 +1 @@
1
+ import{j as t,at as r}from"./vendor-mui-core-DWYIngcn.js";import{r as s}from"./vendor-react-Dvs43sk9.js";import{b as a}from"./vendor-ux-Dln42oC3.js";import{t as n}from"./index-CgCJ2qDh.js";import"./vendor-utils-J7aLFpEq.js";import"./vendor-hooks-HB6DqcLv.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-B78OG6SS.js";function l(){const{t:o}=s.useContext(a);return t.jsx(i,{style:{paddingTop:"25vh"},children:t.jsx(n,{status:"404",description:o("noMatch.desc"),style:{backgroundColor:"transparent"}})})}const i=r.main``;export{l as default};
@@ -1 +1 @@
1
- import{c as A,v as R,p as w,s as p}from"./index-BEyKlMs9.js";const O=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,x=/^[a-zA-Z]:\\/;function N(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return x.test(e)?!1:O.test(e)}const _=["http","https"],z=["nofollow"],L={};function T(e){const r=e||L,g=r.protocols||_,u=A(r.test);return function(h){R(h,"element",function(t,y,E){if(t.tagName==="a"&&typeof t.properties.href=="string"&&u(t,y,E)){const o=t.properties.href;if(N(o)?g.includes(o.slice(0,o.indexOf(":"))):o.startsWith("//")){const n=s(r.content,t),c=n&&!Array.isArray(n)?[n]:n,i=s(r.rel,t)||z,a=typeof i=="string"?w(i):i,f=s(r.target,t),l=s(r.properties,t);if(l&&Object.assign(t.properties,p(l)),a.length>0&&(t.properties.rel=[...a]),f&&(t.properties.target=f),c){const m=s(r.contentProperties,t)||{};t.children.push({type:"element",tagName:"span",properties:p(m),children:p(c)})}}}})}}function s(e,r){return typeof e=="function"?e(r):e}export{T as r};
1
+ import{c as A,v as R,p as w,s as p}from"./index-CW67obch.js";const O=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,x=/^[a-zA-Z]:\\/;function N(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return x.test(e)?!1:O.test(e)}const _=["http","https"],z=["nofollow"],L={};function T(e){const r=e||L,g=r.protocols||_,u=A(r.test);return function(h){R(h,"element",function(t,y,E){if(t.tagName==="a"&&typeof t.properties.href=="string"&&u(t,y,E)){const o=t.properties.href;if(N(o)?g.includes(o.slice(0,o.indexOf(":"))):o.startsWith("//")){const n=s(r.content,t),c=n&&!Array.isArray(n)?[n]:n,i=s(r.rel,t)||z,a=typeof i=="string"?w(i):i,f=s(r.target,t),l=s(r.properties,t);if(l&&Object.assign(t.properties,p(l)),a.length>0&&(t.properties.rel=[...a]),f&&(t.properties.target=f),c){const m=s(r.contentProperties,t)||{};t.children.push({type:"element",tagName:"span",properties:p(m),children:p(c)})}}}})}}function s(e,r){return typeof e=="function"?e(r):e}export{T as r};