@abtnode/blocklet-services 1.16.41-beta-20250318-123609-b48bb2d7 → 1.16.41-beta-20250319-034744-5c62f533

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 (148) hide show
  1. package/api/libs/open-graph/index.js +21 -11
  2. package/api/libs/open-graph/template.js +42 -2
  3. package/api/services/auth/connect/receive-transfer-app-owner.js +15 -3
  4. package/dist/assets/{ArrowDropDown-Do4OWmCn.js → ArrowDropDown-ydRfHJ2x.js} +1 -1
  5. package/dist/assets/{CheckCircle-DDHElFhm.js → CheckCircle-DgSwRUf8.js} +1 -1
  6. package/dist/assets/{ChevronLeft-CLfrYODg.js → ChevronLeft-CqDoHwdJ.js} +1 -1
  7. package/dist/assets/{ChevronRight-OJJ2SUEU.js → ChevronRight-Bpkf9aqI.js} +1 -1
  8. package/dist/assets/{DeleteOutline-C954mj84.js → DeleteOutline-D4DYIaUj.js} +1 -1
  9. package/dist/assets/{Done-BXwXbLQs.js → Done-B8c93MpP.js} +1 -1
  10. package/dist/assets/{Download-OmIe8_8C.js → Download-DANYdeZR.js} +1 -1
  11. package/dist/assets/{Error-CXMTbOyQ.js → Error-wKO1hXtU.js} +1 -1
  12. package/dist/assets/{ExpandLess-xJAJmJam.js → ExpandLess-BqrBuxL9.js} +1 -1
  13. package/dist/assets/{Google-jC4aGgA_.js → Google-CBPWeaVC.js} +4 -4
  14. package/dist/assets/{InfoOutlined-Dto4CBtr.js → InfoOutlined-HP5LuELQ.js} +1 -1
  15. package/dist/assets/{Launch-Do09YVNX.js → Launch-XvyEoGhF.js} +1 -1
  16. package/dist/assets/{LaunchOutlined-DyT6-6Gt.js → LaunchOutlined-BfbVRiJT.js} +1 -1
  17. package/dist/assets/{MoreHoriz-CU3bPiks.js → MoreHoriz-Cv3BqpRU.js} +1 -1
  18. package/dist/assets/{PlayArrow-DsdnOq2p.js → PlayArrow-DI84Lay5.js} +1 -1
  19. package/dist/assets/{ViewList-B2mYqtoR.js → ViewList-DLzG9ldE.js} +1 -1
  20. package/dist/assets/{access-control-BWBOA4g6.js → access-control-DyHt8ppX.js} +1 -1
  21. package/dist/assets/{actions-4OuC0GHy.js → actions-CBPbCBQc.js} +1 -1
  22. package/dist/assets/add-component-core-DOdhiJes.js +765 -0
  23. package/dist/assets/add-resource-CGPM0kPR.js +1 -0
  24. package/dist/assets/{addon-D4YcNftH.js → addon-bbJfiLal.js} +1 -1
  25. package/dist/assets/{analytics-BZzzJZSo.js → analytics-BRjS4mY-.js} +1 -1
  26. package/dist/assets/api-CvDkueg1.js +1 -0
  27. package/dist/assets/{ar-BVbwKJY8.js → ar-A7PXaQSB.js} +1 -1
  28. package/dist/assets/{audit-logs-JO59CyGM.js → audit-logs-D1W37Cj4.js} +1 -1
  29. package/dist/assets/{base32-BjPUfmet.js → base32-gJJTbpiB.js} +1 -1
  30. package/dist/assets/{branding-CR1e2n6E.js → branding-DR3Jnq-d.js} +2 -2
  31. package/dist/assets/{bundle-avatar-Chdo4m6E.js → bundle-avatar-Eqwd2qUG.js} +1 -1
  32. package/dist/assets/{button-BSP6Y6OJ.js → button-BqyvGZC-.js} +1 -1
  33. package/dist/assets/{click-to-copy-fQS5t8fq.js → click-to-copy-Dc16fHKA.js} +1 -1
  34. package/dist/assets/{complete--VG1kQVy.js → complete-BzSPyjUA.js} +1 -1
  35. package/dist/assets/{component-DfQn7Awf.js → component--_f-xKi7.js} +1 -1
  36. package/dist/assets/{config-C-1jeE31.js → config-BDpdqYom.js} +1 -1
  37. package/dist/assets/{config-mzUmZpxy.js → config-C3tQWDAE.js} +1 -1
  38. package/dist/assets/config-navigation-BrXS6Zm4.js +29 -0
  39. package/dist/assets/{config-space-6wpekLZ1.js → config-space-BZu4nd7t.js} +1 -1
  40. package/dist/assets/{confirm-CVR4a5FI.js → confirm-CCmbVvGp.js} +1 -1
  41. package/dist/assets/{connect-DG6frz_Q.js → connect-Bgm2clKz.js} +1 -1
  42. package/dist/assets/{connect-D_mrUgoL.js → connect-C1EdscR7.js} +1 -1
  43. package/dist/assets/{connect-to-BhxyRPHq.js → connect-to-CAjdR1Vi.js} +1 -1
  44. package/dist/assets/{dashboard-DE28EHHN.js → dashboard-C2dbiNOp.js} +3 -3
  45. package/dist/assets/{de-nWUnqN3q.js → de-DQLOqs4x.js} +1 -1
  46. package/dist/assets/{delete-confirm-CCY-Xpk5.js → delete-confirm-CVo1ye7X.js} +1 -1
  47. package/dist/assets/{did-address-Dx-4WAXQ.js → did-address-DIKoCoBp.js} +1 -1
  48. package/dist/assets/{domain-DHb1Ps_o.js → domain-BQkRhwGe.js} +1 -1
  49. package/dist/assets/{domain-action-card-BNfDBQhX.js → domain-action-card-Dlgq4rsm.js} +1 -1
  50. package/dist/assets/domains-DaOwHgX-.js +1 -0
  51. package/dist/assets/{email-B20szkwm.js → email-BHF0jLjs.js} +1 -1
  52. package/dist/assets/{es-C7damQG2.js → es-Wyib4tkS.js} +1 -1
  53. package/dist/assets/{exchange-passport-DbZWgurv.js → exchange-passport-C6TpmUyM.js} +1 -1
  54. package/dist/assets/{form-text-input-BTiyCo4F.js → form-text-input-C8x5debf.js} +1 -1
  55. package/dist/assets/{fr-D3MUmftb.js → fr-CTdi8lPh.js} +1 -1
  56. package/dist/assets/{fuel-SLm_JOs-.js → fuel-DQMzXBHQ.js} +1 -1
  57. package/dist/assets/{fullpage-50xw6Dda.js → fullpage-kiX9qo3H.js} +1 -1
  58. package/dist/assets/{get-safe-url-C42wIqi-.js → get-safe-url-BvS0hy8W.js} +1 -1
  59. package/dist/assets/{get-safe-url-Cn4KEro2.js → get-safe-url-CXJBjnNj.js} +1 -1
  60. package/dist/assets/{hi-DLH2NuCr.js → hi-Dk3MVpw6.js} +1 -1
  61. package/dist/assets/{home-CUlFLl78.js → home-CfRR-l78.js} +1 -1
  62. package/dist/assets/{id-C_OpwsKG.js → id-BqyOVEFD.js} +1 -1
  63. package/dist/assets/{iframe-BfxIVBTL.js → iframe-C0FAfo1V.js} +1 -1
  64. package/dist/assets/{index-CKGdCheG.js → index-BL64rJ3g.js} +1 -1
  65. package/dist/assets/{index-DNxvGCUa.js → index-BVjGveR4.js} +1 -1
  66. package/dist/assets/{index-xfe9Dcxz.js → index-BsMTGy4m.js} +1 -1
  67. package/dist/assets/{index-DOilqSvA.js → index-Bv_udrJr.js} +1 -1
  68. package/dist/assets/{index-Do_PTy2g.js → index-CYdNDqQ1.js} +8 -8
  69. package/dist/assets/{index-CbiypPHS.js → index-CmyG8bip.js} +1 -1
  70. package/dist/assets/{index-mkd7rmEP.js → index-D2qwAqco.js} +1 -1
  71. package/dist/assets/{index-F9fg_Rq5.js → index-D5rqbUOM.js} +1 -1
  72. package/dist/assets/{index-CPUTxynZ.js → index-D8WxMgot.js} +14 -14
  73. package/dist/assets/{index-D3BxoukB.js → index-DJJGXGi6.js} +1 -1
  74. package/dist/assets/{index-D_zMGAKU.js → index-DQKEK30u.js} +1 -1
  75. package/dist/assets/{index-BFV3n5Hy.js → index-Dal_0cM6.js} +1 -1
  76. package/dist/assets/{index-CyTMvqg2.js → index-Db8S8FOW.js} +1 -1
  77. package/dist/assets/{index-B6Y7SW3z.js → index-DojJOk-8.js} +1 -1
  78. package/dist/assets/index-Dv43WFu_.js +220 -0
  79. package/dist/assets/{index-DI6dvNrm.js → index-Hc4fe8tE.js} +1 -1
  80. package/dist/assets/{index-BCtCJuih.js → index-KP4WZslk.js} +1 -1
  81. package/dist/assets/{invitation-BuB1-TxL.js → invitation-CDtK_Uyv.js} +1 -1
  82. package/dist/assets/{invite-C8_Fxnwn.js → invite-DSQnWK9o.js} +1 -1
  83. package/dist/assets/{issue-passport-BjcOuQDv.js → issue-passport-Bb_7kKPQ.js} +1 -1
  84. package/dist/assets/{item-3tNefK7M.js → item-C1U0HVPR.js} +1 -1
  85. package/dist/assets/{ja-rh-7J19i.js → ja-BIiN349J.js} +1 -1
  86. package/dist/assets/{ko-DxXSLIu1.js → ko-D9z_sjE3.js} +1 -1
  87. package/dist/assets/{layout-ceT4Awul.js → layout-Bkn9nC3f.js} +1 -1
  88. package/dist/assets/{list-BaQMMWrO.js → list-BIXoIHH2.js} +2 -1
  89. package/dist/assets/localization-Cf41fenL.js +1 -0
  90. package/dist/assets/{log-CNHqg8uo.js → log-CuiY798z.js} +1 -1
  91. package/dist/assets/{login-DXKAfWij.js → login-Ds2aHi-M.js} +1 -1
  92. package/dist/assets/{login-oauth-callback-20hVf_bH.js → login-oauth-callback-DAKHXtVv.js} +1 -1
  93. package/dist/assets/{logo-uploader-Dh1aL_OF.js → logo-uploader-DQCS5qZW.js} +3 -3
  94. package/dist/assets/{lost-passport-CZEU6dJY.js → lost-passport-DdbK0_Yc.js} +1 -1
  95. package/dist/assets/{omit-BySqlv7K.js → omit-DVwO9e3E.js} +1 -1
  96. package/dist/assets/{open-window-D4nELhWH.js → open-window-yeboX1Ru.js} +1 -1
  97. package/dist/assets/{overview-xXsfHZEs.js → overview-DFNGZZos.js} +1 -1
  98. package/dist/assets/{page-header-C2MPWR-H.js → page-header-DyeTxe1U.js} +1 -1
  99. package/dist/assets/{permission-DXzAY72t.js → permission-ZvUR5Tj-.js} +1 -1
  100. package/dist/assets/{preferences-D2Jg5k10.js → preferences-Dx29Tgc2.js} +1 -1
  101. package/dist/assets/{profile-embed-BDQR5OIg.js → profile-embed-C_yYlnVt.js} +1 -1
  102. package/dist/assets/{pt-q0ZSfFth.js → pt-DbNy95wU.js} +1 -1
  103. package/dist/assets/publish-resource-CPSJ7Gd2.js +1 -0
  104. package/dist/assets/{react-beautiful-dnd.esm-Z01y4hUy.js → react-beautiful-dnd.esm-DcDZ_Ghe.js} +1 -1
  105. package/dist/assets/{relative-time-wZZM9yTU.js → relative-time-xM8Zc84I.js} +1 -1
  106. package/dist/assets/{ru-CK3mPXUk.js → ru-BEliZjDL.js} +1 -1
  107. package/dist/assets/sdk-CVa22Xgm.js +1 -0
  108. package/dist/assets/{session-BcGa2Lwu.js → session-CD9NaM-v.js} +1 -1
  109. package/dist/assets/setup-CkUck5w6.js +19 -0
  110. package/dist/assets/{start-nMBbzJog.js → start-CRCAeTDI.js} +1 -1
  111. package/dist/assets/{status-CW8cLZwc.js → status-D8ugfvVU.js} +1 -1
  112. package/dist/assets/{step-actions-D4sVdJ5W.js → step-actions-C83ykph7.js} +1 -1
  113. package/dist/assets/{studio-oozJB1Q3.js → studio-Cb_GlvSi.js} +1 -1
  114. package/dist/assets/{switch-control-G4nR-MQG.js → switch-control-CJ1duVKM.js} +1 -1
  115. package/dist/assets/{th-DBezSIJU.js → th-KPXdcBJ0.js} +1 -1
  116. package/dist/assets/{traffic-ChHSyQUx.js → traffic-DjeUj5sV.js} +1 -1
  117. package/dist/assets/{transfer-AGCuXVp7.js → transfer-B_MO7Mf7.js} +1 -1
  118. package/dist/assets/{unsubscribe-D2HmFcyp.js → unsubscribe-ajBobtwD.js} +1 -1
  119. package/dist/assets/{useAsync-CDzQ0uN6.js → useAsync-D2OhgEkV.js} +1 -1
  120. package/dist/assets/{useAsyncRetry-CcF3e_P6.js → useAsyncRetry-CEJwVPZ6.js} +1 -1
  121. package/dist/assets/{useLocalStorage-Nwt6lPBi.js → useLocalStorage-CtbpqE0c.js} +1 -1
  122. package/dist/assets/{user-center-Q-dkmQTy.js → user-center-D62gRjAl.js} +1 -1
  123. package/dist/assets/{util-DfhJqpch.js → util-CohOBosL.js} +1 -1
  124. package/dist/assets/{util-ChHwCleX.js → util-CzgwETtC.js} +1 -1
  125. package/dist/assets/{vendor-arcblock-BkdpkIRL.js → vendor-arcblock-E5QJEgSK.js} +1 -1
  126. package/dist/assets/{vendor-hooks-DbRTDIFw.js → vendor-hooks-CYyfK9g3.js} +1 -1
  127. package/dist/assets/{vendor-utils-DJ1bmiuG.js → vendor-utils-CbeKtci8.js} +1 -1
  128. package/dist/assets/{vendor-ux-did-connect-BUS40ceY.js → vendor-ux-did-connect-D75Zatzm.js} +44 -44
  129. package/dist/assets/{vi-hjA0ec5w.js → vi-ChkGdSKU.js} +1 -1
  130. package/dist/assets/wrap-locale-lZatlhee.js +1 -0
  131. package/dist/assets/{zh-BIwal6DF.js → zh-DDAGRLEd.js} +1 -1
  132. package/dist/assets/{zh-tw-Bj9DYpoo.js → zh-tw-DIWT2k6_.js} +1 -1
  133. package/dist/images/banner.png +0 -0
  134. package/dist/index.html +5 -5
  135. package/dist/service-worker.js +1 -1
  136. package/package.json +28 -28
  137. package/dist/assets/add-component-core-BJzkE6_k.js +0 -765
  138. package/dist/assets/add-resource-CFUb5VgO.js +0 -1
  139. package/dist/assets/api-D2GjOmnt.js +0 -1
  140. package/dist/assets/cloneDeep-SKWOTeUJ.js +0 -1
  141. package/dist/assets/config-navigation-Dm_JpS-L.js +0 -26
  142. package/dist/assets/domains-CO5BsFN8.js +0 -1
  143. package/dist/assets/index-Bm1Z6vIr.js +0 -220
  144. package/dist/assets/localization-UtRmFKb1.js +0 -1
  145. package/dist/assets/publish-resource-DDV8cXFW.js +0 -1
  146. package/dist/assets/sdk-msG4TyIo.js +0 -1
  147. package/dist/assets/setup-C9iZjtRd.js +0 -19
  148. package/dist/assets/wrap-locale-DnXm9Rv3.js +0 -1
@@ -1,220 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CPUTxynZ.js","assets/vendor-ux-did-connect-BUS40ceY.js","assets/vendor-react-DoD83n6N.js","assets/vendor-utils-DJ1bmiuG.js","assets/vendor-mui-core-O22FPGM4.js","assets/vendor-hooks-DbRTDIFw.js","assets/lottie-web-B6s7dDoL.js","assets/vendor-ux-did-connect-DhgPdlEj.css","assets/vendor-arcblock-BkdpkIRL.js","assets/index-D_zMGAKU.js","assets/index-Do_PTy2g.js","assets/index-tUQxVYYQ.js","assets/index-AgKpYdvC.css"])))=>i.map(i=>d[i]);
2
- import{r as v,k as zt,l as pt,L as be,u as Cs,h as Rs,i as yt}from"./vendor-react-DoD83n6N.js";import{a1 as ye,j as t,t as Ae,a3 as u,bg as un,E as d,a4 as xe,I as ce,T as E,bV as pn,D as ft,a9 as ge,as as Ss,bO as ot,ac as fn,bn as nt,bq as Dt,x as ne,a2 as lt,P as hn,G as mn,v as Bt,$ as bn,am as xn,ai as he,ak as Is,ab as gn,r as kn,bK as Ds,K as Qe,y as jn,M as oe,ad as Ie,at as Ts,L as _s,z as Ps,b2 as Ls,ar as yn,aq as it,bv as qs,bw as $s,bW as Ns,bX as As,bi as Tt,bj as Es,bl as Os,bz as Ms,bA as vt}from"./vendor-mui-core-O22FPGM4.js";import{z as ve,C as Me,h as ue,a5 as zs,f as No,ad as Ao}from"./index-Do_PTy2g.js";import{r as we,p as G,u as te,aj as Bs,B as Fe,a$ as vn,R as wn,aZ as Cn,am as Ws,bk as Vs,a2 as Wt,V,_ as Us,i as ae,bl as Fs,b4 as Hs,ai as Ne,ak as Vt,aq as Gs}from"./vendor-ux-did-connect-BUS40ceY.js";import{h as Ut,n as Js,q as Xs,_ as Rn,r as Te,p as Qs}from"./vendor-arcblock-BkdpkIRL.js";import{d as Ys}from"./Error-CXMTbOyQ.js";import{C as Ft}from"./confirm-CVR4a5FI.js";import{u as Ye}from"./session-BcGa2Lwu.js";import{W as Eo}from"./did-address-Dx-4WAXQ.js";import{E as Ze,D as Oo,C as Mo,P as zo}from"./react-beautiful-dnd.esm-Z01y4hUy.js";import{B as Ht}from"./bundle-avatar-Chdo4m6E.js";import{S as ke}from"./shorten-label-DXrhdUJE.js";import{L as Gt}from"./list-header-Bzt7zKtS.js";import{X as Zs,x as me,G as Jt,C as Sn}from"./vendor-utils-DJ1bmiuG.js";import{d as Ks}from"./Download-OmIe8_8C.js";import{C as In}from"./click-to-copy-fQS5t8fq.js";import{Q as er}from"./QuestionMarkCircle-D4HZAY1P.js";import{u as tr}from"./vendor-hooks-DbRTDIFw.js";import{_ as De}from"./useSetState-BL3ktMon.js";import{c as Xt}from"./index-tUQxVYYQ.js";import{E as Qt}from"./index-C46rA4HG.js";import{p as ct}from"./index-B6Y7SW3z.js";import"./api-D2GjOmnt.js";import{d as or}from"./ChevronRight-OJJ2SUEU.js";import{T as nr,a as sr}from"./vendor-mui-x-K-9WHqhO.js";import{d as Bo}from"./DeleteOutline-C954mj84.js";import{c as rr,A as Dn,u as lr,S as ir,U as cr,a as wt,b as Tn,n as ar,e as dr,f as Wo,g as ur,h as pr}from"./item-3tNefK7M.js";import{d as fr}from"./ArrowDropDown-Do4OWmCn.js";import{f as Ee}from"./format-error-LAoTjvJe.js";import{d as hr}from"./Launch-Do09YVNX.js";import{M as mr}from"./index-oXEi5lCg.js";import{r as br}from"./index-Aq7Gmh7c.js";import{d as xr}from"./Done-BXwXbLQs.js";import"./lottie-web-B6s7dDoL.js";import"./raf-schd.esm-GV-XhwE0.js";import"./delete-confirm-CCY-Xpk5.js";import"./get-safe-url-C42wIqi-.js";var Yt={},gr=ye;Object.defineProperty(Yt,"__esModule",{value:!0});var _n=Yt.default=void 0,kr=gr(we()),jr=t;_n=Yt.default=(0,kr.default)((0,jr.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-2 10h-4v4h-2v-4H7v-2h4V7h2v4h4z"}),"AddBox");var Zt={},yr=ye;Object.defineProperty(Zt,"__esModule",{value:!0});var Pn=Zt.default=void 0,vr=yr(we()),wr=t;Pn=Zt.default=(0,vr.default)((0,wr.jsx)("path",{d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H15v-8h5V8zm-1 7V3.5L18.5 9zm4 12.66V16h5.66v2h-2.24l2.95 2.95-1.41 1.41L19 19.41v2.24h-2z"}),"FileOpen");var Kt={},Cr=ye;Object.defineProperty(Kt,"__esModule",{value:!0});var Ln=Kt.default=void 0,Rr=Cr(we()),Sr=t;Ln=Kt.default=(0,Rr.default)((0,Sr.jsx)("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutlineOutlined");function eo({did:e,projectId:o,title:n,logo:r,describe:s}){const l=`${`${G.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e}/${o}/logo/upload`}/${r}`,[a,c]=v.useState(!1),p=Ae(f=>f.breakpoints.down("md"));return t.jsxs(u,{sx:{display:"flex",flexDirection:"row",color:a?"primary.main":"grey.900",gap:1},onPointerEnter:()=>c(!0),onPointerLeave:()=>c(!1),children:[t.jsx(un,{sx:{borderRadius:1},src:l}),t.jsxs(u,{children:[t.jsx(ke,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:p?"primary.main":""},children:n||"/"}),t.jsx(ke,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:p||a?"primary.main":"grey.700"},children:s||"/"})]})]})}eo.propTypes={projectId:d.string.isRequired,did:d.string.isRequired,title:d.string.isRequired,logo:d.string.isRequired,describe:d.string.isRequired};function to({initUrl:e}){const o=zt(),n=(e==null?void 0:e.searchParams.get("tenantScope"))||"",{t:r,locale:s}=te(),{api:i}=ve(),{api:l}=Ye(),[a,c]=v.useState(!0),{blocklet:p}=Me(),[f,g]=v.useState(null),[k,h]=v.useState(!1),m=Ae(C=>C.breakpoints.down("xl")),w=Ae(C=>C.breakpoints.down("md")),{componentDid:D=""}=pt(),[x,b]=v.useState(null),[j,_]=v.useState(""),N=()=>{i.getProjects({input:{did:p.meta.did,componentDid:D,tenantScope:n}}).then(C=>{const P=(C==null?void 0:C.projects)||[];c(!1),b(P)}).catch(C=>{c(!1),V.error(C.message)})},R=()=>{o(`${G.UNOWNED_DID}/create/none`,{replace:!0})},q=C=>{g(C)},S=()=>{c(!1),h(!0)},I=()=>{h(!1),g(null)},W=C=>{V.error(C.message),h(!1),g(null)},z=C=>{if(!(C!=null&&C.deleted)){V.error("Delete project failed");return}N(),h(!1),g(null)};v.useEffect(()=>{N()},[]);const y=v.useMemo(()=>{if(!j)return x;let C=j==null?void 0:j.trim();return C?(C=Bs.toAddress(C).toLocaleLowerCase(),x.filter(P=>P.blockletTitle.toLowerCase().includes(C)||P.blockletDid.toLowerCase().includes(C))):x},[x,j]);if(!x&&a)return t.jsx(u,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:t.jsx(Ze,{})});if(!x)return null;if(!x.length)return t.jsxs(u,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[t.jsx(u,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:r("blocklet.publish.blockletEmptyTip")}),t.jsx(u,{sx:{fontSize:14,color:"text.secondary",mb:3},children:r("blocklet.publish.createBlockletTip")}),t.jsx(Fe,{onClick:R,variant:"contained",children:r("blocklet.publish.createBlocklet")})]});const T=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:C=>{const P=x[C];return t.jsx(be,{to:`${P.id}`,children:t.jsx(eo,{did:p.meta.did,projectId:P.id,logo:P.blockletLogo,title:P.blockletTitle,describe:P.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{searchable:!1,customBodyRender:C=>C?t.jsx(vn,{type:"success",children:C}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:C=>C?t.jsx(Eo,{size:14,compact:!0,responsive:!1,did:C}):null}},m||D?null:{label:r("common.createdBy"),name:"createdBy",options:{customBodyRender:C=>C?t.jsx(Eo,{onClick:()=>{o(`/.well-known/service/admin/members?did=${C}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:C}):null}},m||D?null:{label:r("common.scope"),name:"componentDid",options:{customBodyRender:C=>{const P=(p.children||[]).find(J=>J.meta.did===C);return P?t.jsxs(u,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[t.jsx(Ht,{size:14,blocklet:P,ancestors:[p]}),t.jsx(u,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:P.meta.title})]},C):""}}},m||n?null:{label:r("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:C=>t.jsx(u,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:t.jsx(ke,{children:C})})}},{label:r("common.updatedAt"),name:"updatedAt",options:{searchable:!1,customBodyRender:C=>t.jsx(wn,{value:Number(C),locale:s})}},{label:r("common.actions"),name:"actions",options:{searchable:!1,customBodyRenderLite:C=>{const P=x[C];return t.jsxs(u,{display:"flex",children:[t.jsx(be,{to:`${P.id}/new-release/${P.lastReleaseId}`,children:t.jsx(xe,{title:r("blocklet.publish.createRelease"),placement:"top",children:t.jsx(ce,{color:"primary","aria-label":"create",children:t.jsx(_n,{style:{fontSize:18}})})})}),!!P.lastReleaseId&&t.jsx(xe,{title:r("blocklet.publish.viewLastRelease",{name:P.blockletTitle}),placement:"top",children:t.jsx(ce,{color:"secondary","aria-label":"create",children:t.jsx(be,{style:{display:"flex"},to:`${P.id}/view/${P.lastReleaseId}`,children:t.jsx(Pn,{sx:{fontSize:18}})})})}),t.jsx(xe,{title:r("blocklet.publish.delete",{name:P.blockletTitle}),placement:"top",children:t.jsx(ce,{color:"primary","aria-label":"delete",onClick:()=>q(P),children:t.jsx(Cn,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),$=k?t.jsx(Ws,{open:!0,popup:!0,onClose:I,action:"check-has-project-id",locale:s,checkFn:l.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:z,onError:W,extraParams:{projectId:f.id,did:p.meta.did,name:f.blockletTitle},messages:{title:r("blocklet.publish.deleteProject.title",{name:f.blockletTitle}),scan:r("blocklet.publish.deleteProject.scan",{name:f.blockletTitle}),confirm:r("blocklet.publish.deleteProject.confirm"),success:r("blocklet.publish.deleteProject.success")}}):null;return t.jsxs(u,{children:[t.jsx(Gt,{sx:{mb:2},left:t.jsxs(u,{display:"flex",flexDirection:"row",alignItems:"center",children:[t.jsx(u,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:r("common.blockletStudio")}),t.jsx(xe,{title:r("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:t.jsx(Ln,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),actions:t.jsxs(t.Fragment,{children:[t.jsx(Vs,{options:{searchPlaceholder:r("blocklet.list.searchPlaceholder"),searchDebounceTime:600,searchAlwaysOpen:w},search:j,searchText:j,searchTextUpdate:_,searchClose:()=>_(""),onSearchOpen:()=>{}}),t.jsxs(Fe,{onClick:R,variant:"contained",children:[t.jsx(Ut,{style:{fontSize:"1.3em",marginRight:4}}),r("blocklet.publish.createBlocklet")]})]})}),t.jsx(Wt,{className:"main-table",locale:s,data:y,columns:T,options:{search:!1,sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,searchAlwaysOpen:!0,rowsPerPageOptions:[10,20,50,100]}}),f&&t.jsx(Ft,{title:`${r("common.delete")} ${f.blockletTitle}`,description:r("blocklet.publish.deleteProject.description"),confirm:r("common.confirm"),onConfirm:S,onCancel:()=>g(null),children:t.jsx(u,{sx:{marginTop:2},children:[r("blocklet.publish.deleteProject.tip1"),r("blocklet.publish.deleteProject.tip2"),r("blocklet.publish.deleteProject.tip3")].map(C=>t.jsxs(u,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[t.jsx(Ys,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),t.jsx(E,{component:"span",variant:"inherit",color:"text.secondary",children:C})]}))})}),$]})}to.propTypes={initUrl:d.object};to.defaultProps={initUrl:null};var oo={},Ir=ye;Object.defineProperty(oo,"__esModule",{value:!0});var qn=oo.default=void 0,Dr=Ir(we()),Vo=t;qn=oo.default=(0,Dr.default)([(0,Vo.jsx)("path",{d:"M20 17H4V5h8V3H4c-1.11 0-2 .89-2 2v12c0 1.1.89 2 2 2h4v2h8v-2h4c1.1 0 2-.9 2-2v-3h-2z"},"0"),(0,Vo.jsx)("path",{d:"m17 14 5-5-1.41-1.41L18 10.17V3h-2v7.17l-2.59-2.58L12 9z"},"1")],"InstallDesktop");const Tr=(e,o)=>{if(!e)return"";try{return o?JSON.parse(e)[o]:JSON.parse(e)}catch{}return e},$n=Tr;function _r(){var q;const{t:e,locale:o}=te(),{projectId:n}=pt(),{api:r}=ve(),[s,i]=v.useState(!0),{blocklet:l}=Me(),a=Ae(S=>S.breakpoints.down("md")),[c,p]=v.useState(null),[f,g]=v.useState(null),[k,h]=v.useState(null),m=(q=window.env)==null?void 0:q.serverEndpoint,w=()=>{r.getReleases({input:{did:l.meta.did,projectId:n}}).then(S=>{const I=(S==null?void 0:S.releases)||[];i(!1),p(I)}).catch(S=>{i(!1),V.error(S.message)})},D=()=>{r.doBatchQuery({getProject:{input:{did:l.meta.did,projectId:n}},getReleases:{input:{did:l.meta.did,projectId:n}}}).then(S=>{g(S.getProject.project||{}),p(S.getReleases.releases||[]),i(!1)}).catch(S=>{i(!1),V.error(S.message)})};v.useEffect(()=>{D()},[]);const[x,b]=v.useState(""),j=()=>{i(!1);const S=k.id;r.deleteRelease({input:{did:l.meta.did,projectId:n,releaseId:S}}).then(()=>{i(!1),w(),V.success(e("common.removeSuccess")),h(null)}).catch(I=>{i(!1),V.error(I.message)})},_=S=>{h(S)};if(!c&&s)return t.jsx(u,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:t.jsx(Ze,{})});if(!c)return null;const N=t.jsxs(pn,{className:"breadcrumbs","aria-label":"breadcrumb",children:[t.jsx(be,{to:"..",children:e("common.blockletStudio")}),t.jsx(E,{color:"text.primary",children:t.jsx(ke,{maxLength:a?6:30,children:f.blockletTitle})})]});if(!c.length)return t.jsxs(t.Fragment,{children:[N,t.jsxs(u,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[t.jsx(u,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:e("blocklet.publish.releaseEmptyTip")}),t.jsx(u,{sx:{fontSize:14,color:"text.secondary",mb:3},children:e("blocklet.publish.createReleaseTip")}),t.jsx(be,{to:"create/none",children:t.jsx(Fe,{variant:"contained",children:e("blocklet.publish.createRelease")})})]})]});const R=[{label:e("common.version"),name:"blockletVersion",minWidth:160,options:{customBodyRenderLite:S=>{const I=c[S];return t.jsx(be,{to:`view/${I.id}`,children:t.jsx(eo,{did:l.meta.did,projectId:f.id,logo:I.blockletLogo,title:I.blockletVersion,describe:I.blockletTitle})})}}},{label:e("blocklet.publish.releaseNote"),name:"note",options:{customBodyRenderLite:S=>{const I=c[S];return t.jsx(E,{className:"note",children:$n(I.note,"note")})}}},{label:e("common.status"),name:"status",options:{customBodyRender:S=>t.jsx(vn,{type:S==="published"?"success":"warning",children:S==="published"?"Released":Zs(S)})}},{label:e("common.lastPublishedAt"),name:"updatedAt",options:{customBodyRenderLite:S=>{const I=c[S];return I.status!==ue.PROJECT.RELEASE_STATUS.published?"":t.jsx(wn,{value:Number(I.updatedAt),locale:o})}}},{label:e("common.actions"),name:"actions",options:{customBodyRenderLite:S=>{var $;const I=c[S];let W="",z="";const y=I.status==="published";if(y){const C=me(m,`/api/project/${l.meta.did}/${f.id}/${f.lastReleaseId}/release/blocklet.json`),P=new URL(m);P.pathname=me(P.pathname,"/launch-blocklet/agreement"),P.searchParams.set("blocklet_meta_url",C),W=P.href,z=me(`${G.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${l.meta.did}/${f.id}/${f.lastReleaseId}/download/${(f.lastReleaseFiles||[])[0]}`)}const T=($=f.blockletComponents)!=null&&$.some(C=>C.included)||I.uploadedResource?"pack":"resource";return t.jsxs(u,{display:"flex",alignItems:"center",children:[y&&T==="pack"&&t.jsx(xe,{title:e("blocklet.publish.install",{name:f.blockletTitle}),placement:"top",children:t.jsx(ce,{color:"secondary","aria-label":"create",children:t.jsx("a",{style:{display:"flex"},href:W,target:"_blank",rel:"noreferrer",children:t.jsx(qn,{sx:{fontSize:18}})})})}),y&&t.jsx(xe,{title:e("blocklet.publish.download",{name:f.blockletTitle}),placement:"top",children:t.jsx(ce,{color:"primary","aria-label":"download",children:t.jsx("a",{style:{display:"flex"},href:z,children:t.jsx(Ks,{sx:{fontSize:18}})})})}),t.jsx(xe,{title:e("blocklet.publish.delete",{name:f.blockletTitle}),placement:"top",children:t.jsx(ce,{color:"primary","aria-label":"delete",onClick:()=>_(I),children:t.jsx(Cn,{sx:{fontSize:18}})})})]})}}}];return t.jsxs(Pr,{children:[t.jsx(Gt,{sx:{mb:2},left:N,actions:t.jsxs(t.Fragment,{children:[t.jsx(Fe,{variant:"outlined",onClick:()=>{const S=me(m,`/api/project/${l.meta.did}/${n}/blocklet.json`);b(S)},children:e("blocklet.publish.copyInstallUrl")}),t.jsx(be,{to:"new-release/none",children:t.jsxs(Fe,{variant:"contained",children:[t.jsx(Ut,{style:{fontSize:"1.3em",marginRight:4}}),e("blocklet.publish.createRelease")]})})]})}),t.jsx(ft,{fullWidth:!0,maxWidth:"sm",open:x,onClose:()=>b(""),children:t.jsxs(u,{sx:{py:5,px:4,wordBreak:"break-all"},children:[t.jsx(E,{variant:"h6",sx:{mb:2},children:e("blocklet.publish.installResourceTip")}),t.jsx(In,{children:x}),t.jsxs(E,{sx:{mt:2},children:[e("blocklet.publish.installResourceTip2"),t.jsx("a",{style:{marginLeft:4},href:"https://www.arcblock.io/docs/blocklet-developer/how-to-use-install-url",target:"_blank",rel:"noreferrer",children:e("blocklet.publish.installResourceHelp")})]})]})}),t.jsx(Wt,{className:"main-table",verticalKeyWidth:100,locale:o,data:c,columns:R,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1}}),k&&t.jsx(Ft,{title:e(`${e("common.delete")} ${k.blockletVersion}`),description:e("blocklet.publish.deleteReleaseTip"),confirm:e("common.confirm"),onConfirm:j,onCancel:()=>h(null)})]})}const Pr=ge(u)`
3
- .main-table > div:first-child {
4
- display: none;
5
- }
6
- .note {
7
- word-break: break-all;
8
- white-space: pre-line;
9
- }
10
- `;var no={},Lr=ye;Object.defineProperty(no,"__esModule",{value:!0});var Nn=no.default=void 0,qr=Lr(we()),$r=t;Nn=no.default=(0,qr.default)((0,$r.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20m6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9"}),"DoDisturbAlt");function Oe({children:e,Icon:o}){return t.jsxs(Ss,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",paddingTop:"10px",margin:"10px 0px"},children:[t.jsx(u,{sx:{opacity:.3,fontSize:32},children:t.jsx(o,{})}),t.jsx(u,{sx:{mb:2,opacity:.7,fontSize:"small",color:"action"},children:e})]})}Oe.propTypes={children:d.node.isRequired,Icon:d.elementType};Oe.defaultProps={Icon:Nn};function so({value:e,app:o,onChange:n,onChangeBlockletResourceType:r,disabled:s,resourceRelateComponents:i,projectType:l,dependentComponentsMode:a,blockletResourceType:c}){const{t:p,locale:f}=te(),g=a==="readonly",k=v.useMemo(()=>{const j=e.reduce((_,N)=>(_[N.did]=N.included,_),{});return(o.children||[]).filter(_=>g?i[_.meta.did]||j[_.meta.did]:!0)},[o.children,e,i,g]),h=v.useMemo(()=>k.map(j=>e.find(N=>N.did===j.meta.did)||{did:j.meta.did}),[k,e]),m=h.reduce((j,_)=>(j[_.did]=Jt(_,["required","included"]),j),{}),w=j=>{const _=h.map(N=>{if(N.did===j){const R=!N.included;return{...N,included:R,required:R}}return N});n(_)},D=j=>{const _=h.map(N=>N.did===j?{...N,required:!N.required}:N);n(_)},x=j=>{r(j.target.checked?"resource":"")},b=[{label:p("common.name"),name:"meta.title",width:200,options:{customBodyRenderLite:j=>{var R;const _=k[j],N=(R=m[_.meta.did])==null?void 0:R.included;return t.jsxs(u,{display:"flex",alignItems:"center",children:[t.jsx(Ht,{size:24,blocklet:_,ancestors:[o]}),t.jsx(u,{ml:"4px",className:Xt("text",{excluded:!N}),children:t.jsx(u,{children:_.meta.title})})]})}}},{label:p("blocklet.publish.componentIncluded"),width:100,options:{customBodyRenderLite:j=>{var q;const _=k[j],N=i[_.meta.did],R=!!((q=m[_.meta.did])!=null&&q.included);return t.jsx(ot,{size:"small",checked:N||R,onClick:()=>w(_.meta.did),disabled:g||N||s})}}},{label:p("blocklet.publish.componentForceRequired"),width:100,options:{customBodyRenderLite:j=>{var S,I;const _=k[j],N=i[_.meta.did],R=!!((S=m[_.meta.did])!=null&&S.included),q=!!((I=m[_.meta.did])!=null&&I.required);return t.jsx(ot,{size:"small",checked:N||q&&R,onClick:()=>D(_.meta.did),disabled:g||N||s||!R})}}}];return t.jsx(Nr,{children:k!=null&&k.length?t.jsxs(t.Fragment,{children:[t.jsxs(fn,{severity:"info",style:{width:"100%"},children:[t.jsx(u,{display:"flex",alignItems:"center",rel:"noreferrer",ml:"13px",children:p(l==="pack"?"blocklet.publish.packTip":"blocklet.publish.resourceTip")}),t.jsxs(u,{component:"label",style:{cursor:"pointer"},children:[t.jsx(ot,{size:"small",style:{marginLeft:"0px"},disabled:s,checked:c==="resource",onChange:x}),p("blocklet.publish.forceResourceBlocklet")]})]}),t.jsx(Wt,{className:"main-table",verticalKeyWidth:100,locale:f,data:k,columns:b,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1,rowsPerPage:50}})]}):t.jsx(Oe,{Icon:Qt,children:p("blocklet.publish.blockletEmptyTip")})})}so.propTypes={app:d.object.isRequired,value:d.arrayOf(d.shape({did:d.string.isRequired,required:d.bool,included:d.bool})),onChange:d.func,onChangeBlockletResourceType:d.func,disabled:d.bool,dependentComponentsMode:d.string,resourceRelateComponents:d.object,blockletResourceType:d.string,projectType:d.string.isRequired};so.defaultProps={value:[],onChange:()=>{},onChangeBlockletResourceType:()=>{},disabled:!1,dependentComponentsMode:"auto",blockletResourceType:"",resourceRelateComponents:{}};const Nr=ge(u)`
11
- .main-table {
12
- .text.excluded {
13
- color: #999;
14
- }
15
- width: 400px;
16
- ${({theme:e})=>e.breakpoints.down("md")} {
17
- width: 100%;
18
- }
19
- > div:first-child {
20
- display: none;
21
- }
22
- .MuiTableCell-head {
23
- padding-top: 0;
24
- padding-bottom: 0;
25
- }
26
- .MuiTableCell-body {
27
- padding-top: 6px;
28
- padding-bottom: 6px;
29
- }
30
- .datatable-footer {
31
- display: none;
32
- }
33
- }
34
- `;function Ar(e,o){const n=new Set(o||[]),r=[];function s(i){n.has(i==null?void 0:i.id)&&r.push(i==null?void 0:i.id),i!=null&&i.children&&i.children.forEach(s)}return(e||[]).forEach(s),r}function ro({src:e,alt:o,...n}){const[r,s]=v.useState(!1),i=v.useRef(null);return v.useEffect(()=>{if(!("IntersectionObserver"in window))return s(!0),()=>{};const l=new IntersectionObserver(a=>{a.forEach(c=>{c.isIntersecting&&(s(!0),l.disconnect())})},{threshold:.1});return i.current&&l.observe(i.current),()=>{l.disconnect()}},[]),t.jsx("img",{ref:i,src:r?e:void 0,alt:o,...n})}ro.propTypes={src:d.string.isRequired,alt:d.string};ro.defaultProps={alt:""};function lo({data:e,lazy:o,...n}){return!e||!e.length?null:t.jsx(Er,{...n,children:e.map(r=>t.jsx("a",{href:r.url,target:"_blank",rel:"noreferrer",children:o?t.jsx(ro,{src:r.url,alt:r.alt||""}):t.jsx("img",{src:r.url,alt:r.alt||""})},r.url))})}lo.propTypes={data:d.arrayOf(d.shape({url:d.string,alt:d.string})),lazy:d.bool};lo.defaultProps={data:[],lazy:!1};const Er=ge(u)`
35
- display: flex;
36
- justify-content: flex-start;
37
- flex-wrap: wrap;
38
- margin-bottom: -12px;
39
- a {
40
- display: flex;
41
- }
42
- img {
43
- height: 128px;
44
- cursor: pointer;
45
- margin-right: 12px;
46
- margin-bottom: 12px;
47
- }
48
- `,Ct=(e,o)=>{const n=[...e];for(;n.length>0;){const r=n.shift();if(r.id===o)return r;r.children&&n.push(...r.children)}return[]};function io({icon:e}){return e?Us(e)?t.jsx("img",{className:"resource-icon",src:e,alt:"icon"}):t.jsx(ae,{className:"resource-icon",icon:e}):null}io.propTypes={icon:d.string};io.defaultProps={icon:""};function co({disabled:e,data:o,onChange:n,value:r}){const s=r;function i(h,m=[]){return m.push(h.id),h.children&&h.children.forEach(w=>i(w,m)),m}const l=h=>i(Ct(o,h)),a=(h,m=[])=>{const w=Ct(o,h);return w.parent?(m.push(w.parent),a(w.parent,m)):m};function c(h,m){const w=l(h.id),D=w.indexOf(h.id);return w.splice(D,1),w.every(x=>s.concat(m).includes(x))}const p=(h,m)=>{h.stopPropagation();const w=l(m),D=a(m);if(s.includes(m)){const x=s.filter(b=>!w.concat(D).includes(b));n(x)}else{const x=w;for(let b=0;b<D.length;++b)c(Ct(o,D[b]),x)&&x.push(D[b]);n([...s].concat(x))}},f=h=>{h.stopPropagation()},g=o.some(h=>{var m;return((m=h.children)==null?void 0:m.length)>0}),k=h=>{var b;const m=s.indexOf(h.id)!==-1,w=Array.isArray(h.children),D=l(h.id),x=w&&!m&&s.some(j=>D.includes(j));return t.jsx(nr,{nodeId:h.id,label:t.jsx(nt,{onClick:f,control:t.jsx(ot,{size:"small",checked:m,indeterminate:x,tabIndex:-1,disableRipple:!0,onClick:j=>p(j,h.id),disabled:h.disabled||e}),label:t.jsxs(u,{className:"content",children:[t.jsxs(u,{display:"flex",alignItems:"center",children:[h.icon&&t.jsx(io,{icon:h.icon}),t.jsx(u,{className:"name",children:h.name}),h.url&&t.jsx("a",{href:h.url,target:"_blank",rel:"noreferrer",className:"link",children:t.jsx(Xs,{className:"link-icon"})})]}),!!h.description&&t.jsx(u,{className:"description",children:h.description}),!!((b=h.images)!=null&&b.length)&&t.jsx(lo,{className:"images",data:h.images,lazy:!0})]})}),children:w?h.children.map(k):null},h.id)};return t.jsx(Or,{className:Xt(!g&&"no-children"),multiSelect:!0,defaultCollapseIcon:t.jsx(Js,{}),defaultExpandIcon:t.jsx(or,{}),selected:s,children:o.map(h=>k(h))})}co.propTypes={data:d.array,value:d.array,onChange:d.func,disabled:d.bool};co.defaultProps={data:[],value:[],onChange:()=>{},disabled:!1};const Or=ge(sr)`
49
- &.no-children {
50
- .MuiTreeItem-content {
51
- padding: 0;
52
- .MuiTreeItem-iconContainer {
53
- display: none;
54
- }
55
- .MuiTreeItem-label {
56
- padding-left: 0;
57
- }
58
- }
59
- }
60
- .MuiTreeItem-content {
61
- align-items: flex-start;
62
- .MuiTreeItem-iconContainer {
63
- transform: translateY(10px);
64
- }
65
- &.Mui-selected {
66
- background-color: transparent;
67
- }
68
- }
69
- .MuiTreeItem-label {
70
- cursor: default;
71
- }
72
- .MuiFormControlLabel-root {
73
- align-items: flex-start;
74
- }
75
- .content {
76
- padding-top: 6px;
77
- }
78
- .name {
79
- font-size: 16px;
80
- font-weight: 700;
81
- }
82
- .resource-icon {
83
- margin-right: 2px;
84
- font-size: 16px;
85
- }
86
- img.resource-icon {
87
- width: 1rem;
88
- height: 1rem;
89
- }
90
- .link {
91
- margin-left: 8px;
92
- font-size: 16px;
93
- color: ${({theme:e})=>e.palette.primary.main};
94
- display: flex;
95
- }
96
- .link-icon {
97
- font-size: inherit;
98
- }
99
- .description {
100
- font-size: 14px;
101
- color: ${({theme:e})=>e.palette.text.secondary};
102
- }
103
- `,Uo={},Mr=(e,o,{key:n,cacheTime:r=1e3*3}={})=>{const s=n+JSON.stringify({params:o}),i=Uo[s];if(i&&i.timestamp>Date.now()-r)return i.promise;const l=e(...o);return Uo[s]={promise:l,timestamp:Date.now()},l},An=Mr,En=(e,o)=>(e.forEach(n=>{o&&(n.parent=o),(n.children||[]).forEach(r=>{r.parent=n.id,En(r.children||[],r.id)})}),e),On=(e,o,n,r,s)=>{const{exportApi:i="/"}=(e==null?void 0:e.meta.resource)||{},l=new URL(me("http://127.0.0.1",e==null?void 0:e.mountPoint,i||"/").replace(/\/+/g,"/"));return l.searchParams.set("projectId",o),l.searchParams.set("releaseId",n),l.searchParams.set("local",r),s&&l.searchParams.set("resourcesParams",s.searchParams.get("resourcesParams")),`${l.pathname}${l.search}`},zr=async({api:e,appDid:o,component:n,projectId:r,releaseId:s,locale:i,initUrl:l,resources:a})=>{let c;if(l&&l.searchParams.get("resourcesParams"))try{c=JSON.parse(l.searchParams.get("resourcesParams"))}catch(p){V.error(p.message);return}await Sn.post(On(n,r,s,i,l),{resources:a,projectId:r,releaseId:s,locale:i,...c?{resourcesParams:c}:{}},{headers:{"x-csrf-token":Fs()},timeout:10*60*1e3}),await e.updateSelectedResources({input:{did:o,projectId:r,releaseId:s,componentDid:n.meta.did,resources:a}})},Br=(e,o)=>{if(!e)return{};const n=o.reduce((s,i)=>(s[i]=!0,s),{}),r=(s,i)=>(s.forEach(l=>{var a;n[l.id]&&((a=l.dependentComponents)!=null&&a.length)&&l.dependentComponents.forEach(c=>{i[c]=!0}),l.children&&r(l.children,i)}),i);return r(e,{})};function ao({app:e,component:o,projectId:n,release:r,loading:s,error:i,saveSelectedEventsRef:l,readOnly:a,componentDid:c,initialResources:p={},setResourceComponentsMap:f,selectedResourceIds:g,setSelectedResourceIds:k,showTree:h,initUrl:m}){var z;const{t:w,locale:D}=te(),{api:x}=ve(),[b,j]=De({}),_=v.useRef({}),N=v.useRef(!1),R=r.id;_.current.projectId=n,_.current.releaseId=R;const q=(y,T,$)=>{if(!T)return;const C=Br(T,$);f==null||f({[y]:Object.keys(C)})},S=y=>{l.current[o.meta.did]={resources:y,component:o},k({[o.meta.did]:y}),q(o.meta.did,b[o.meta.did],y)},I=v.useCallback(async y=>{var T;try{const $=await An(Sn.get,[On(y,n,R,D,m),{timeout:6e4}],{key:"getResources"});return En(((T=$==null?void 0:$.data)==null?void 0:T.resources)||[])}catch{return[]}},[n,R,D,m]);v.useEffect(()=>{b[o==null?void 0:o.meta.did]||I(o).then(y=>{j({[o==null?void 0:o.meta.did]:y})}).catch(y=>{V.error(y.message)})},[o,j,b,I]),v.useEffect(()=>{R&&n&&!N.current&&ct(e.children.map(y=>async()=>{var T,$;if(!(c&&c!==y.meta.did)&&!(!(y!=null&&y.mountPoint)||!zs.hasStartEngine(y==null?void 0:y.meta)||!(($=(T=y==null?void 0:y.meta)==null?void 0:T.resource)!=null&&$.exportApi)))try{const C=await I(y);j({[y==null?void 0:y.meta.did]:C});const P=await x.getSelectedResources({input:{did:e.meta.did,projectId:n,releaseId:R,componentDid:y.meta.did}}),J=(P==null?void 0:P.resources)||[];J!=null&&J.length&&(k({[y.meta.did]:Ar(C,J)}),q(y.meta.did,C,J),a||(l.current[y==null?void 0:y.meta.did]={resources:J,component:y}))}catch(C){V.error(C.message)}}),{concurrency:2}).then(()=>{N.current=!0})},[R,n,a,D,m,j]),v.useEffect(()=>{p&&Object.keys(p).length&&ct(e.children.map(async y=>{const T=p[y.meta.did];if(T!=null&&T.length){const $=await I(y);k({[y.meta.did]:T}),q(y.meta.did,$,T),a||(l.current[y==null?void 0:y.meta.did]={resources:T,component:y})}}))},[e,p,a]);let W=null;return(!o||!((z=b[o.meta.did])!=null&&z.length))&&(W=t.jsx(Oe,{Icon:Qt,children:w("blocklet.publish.resourceEmptyTip",{name:No.getDisplayName(o)})})),(o==null?void 0:o.status)!=="running"&&(W=t.jsx(Oe,{children:w("blocklet.publish.componentNotRunning",{name:No.getDisplayName(o)})})),t.jsxs(t.Fragment,{children:[t.jsx(Wr,{className:Xt(i&&"error"),children:h&&t.jsx(u,{pb:2,width:"100%",children:W||t.jsx(co,{data:b[o.meta.did]||[],value:g[o.meta.did]||[],onChange:S,disabled:s||a})})}),!!i&&t.jsx(u,{color:"error.main",mt:1,fontSize:14,children:i})]})}ao.propTypes={component:d.object.isRequired,app:d.object.isRequired,projectId:d.string.isRequired,error:d.string,saveSelectedEventsRef:d.object.isRequired,readOnly:d.bool.isRequired,loading:d.bool.isRequired,release:d.shape({id:d.string.isRequired,status:d.string}),initialResources:d.object,initUrl:d.object,setResourceComponentsMap:d.func,componentDid:d.string,selectedResourceIds:d.array.isRequired,setSelectedResourceIds:d.func.isRequired,showTree:d.bool.isRequired};ao.defaultProps={error:"",release:{id:""},initUrl:null,initialResources:{},setResourceComponentsMap:()=>{},componentDid:""};const Wr=ge(u)`
104
- border: 1px solid #ccc;
105
- max-height: 600px;
106
- width: 100%;
107
- &.error {
108
- border-color: ${e=>e.theme.palette.error.main};
109
- }
110
- border-radius: 4px;
111
- padding: 16px;
112
- padding-bottom: 0px;
113
- overflow-y: auto;
114
- .footer {
115
- border-top: 1px solid #ddd;
116
- display: flex;
117
- padding: 12px 0;
118
- margin-top: 12px;
119
- position: sticky;
120
- bottom: 0;
121
- background: #fff;
122
- z-index: 10;
123
- }
124
- `;var uo={},Vr=ye;Object.defineProperty(uo,"__esModule",{value:!0});var _t=uo.default=void 0,Ur=Vr(we()),Fr=t;_t=uo.default=(0,Ur.default)((0,Fr.jsx)("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"DragIndicator");const Fo="lastWantToConnectStoreId";function Hr(e){var a,c;const[o,n]=v.useState(null),{session:r}=Ye(),s=v.useCallback(p=>{n(p),localStorage.setItem(Fo,p==null?void 0:p.id)},[n]),i=v.useMemo(()=>{var k,h,m,w;const p=localStorage.getItem(Fo),f=p?(((k=e==null?void 0:e.settings)==null?void 0:k.storeList)||[]).find(D=>D.id===p):null;if(f)return f;let g=(((h=e==null?void 0:e.settings)==null?void 0:h.storeList)||[]).find(D=>{var x;return!(D.id!==G.BLOCKLET_STORE.id||D.scope&&D.scope!=="studio"&&D.scope!==((x=r==null?void 0:r.user)==null?void 0:x.did))});return g||(g=(w=(m=e==null?void 0:e.settings)==null?void 0:m.storeList)==null?void 0:w[0]),g},[(a=e==null?void 0:e.settings)==null?void 0:a.storeList,(c=r==null?void 0:r.user)==null?void 0:c.did]);return[o||i||{},s]}const Rt={};async function Mn(e,{interval:o=1e3,maxDuration:n=120*1e3,intervalFirst:r=4e3,timerKey:s=""}){Rt[s]&&clearTimeout(Rt[s]),await new Promise(a=>setTimeout(a,r));const i=Date.now(),l=async(a,c)=>{try{const p=await e();a(p)}catch(p){Date.now()-i>n?c(p):s?Rt[s]=setTimeout(()=>l(a,c),o):setTimeout(()=>l(a,c),o)}};return new Promise(l)}function Gr(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function Jr(e,{did:o,projectId:n,messageId:r}){return Mn(async()=>{var i;const s=await e.getProject({input:{did:o,projectId:n,messageId:r}});if(!((i=s==null?void 0:s.project)!=null&&i.blockletDid))throw new Error("Connected store not found");return s.project.blockletDid},{timerKey:"connect-studio"})}function Xr(e,{did:o,projectId:n,storeId:r}){return Mn(async()=>{var l,a;const s=await e.getProject({input:{did:o,projectId:n,messageId:""}});if(!((a=(l=s==null?void 0:s.project)==null?void 0:l.connectedStores)!=null&&a.length))throw new Error("Connected store not found");if(!s.project.connectedStores.find(c=>c.storeId===r))throw new Error("Connected store not found")},{timerKey:`connect-store-${r}`})}const Qr=({fromBlocklet:e,nodeInfo:o,blocklet:n,userDid:r})=>{var l,a;const s=e?(l=n==null?void 0:n.meta)==null?void 0:l.did:o==null?void 0:o.did;let i=e?((a=n==null?void 0:n.settings)==null?void 0:a.storeList)||[]:(o==null?void 0:o.blockletRegistryList)||[];return Array.isArray(i)||(i=[]),i=i.filter(c=>c.protected||!c.scope||c.scope==="studio"||c.scope===r),{teamDid:s,storeList:i}},po=Qr;function fo({blocklet:e,store:o={},onChangeStore:n,onClick:r,disabled:s,loading:i,componentDid:l}){var y,T,$;const{t:a}=te(),{session:c}=Ye(),{api:p,info:f,inService:g}=ve(),k=Me(),[h,m]=v.useState(!1),w=v.useRef(null),[D,x]=v.useState(!1),[b,j]=v.useState(null),_=C=>{n(C),m(!1)},N=()=>{m(!h)},R=C=>{w.current&&w.current.contains(C.target)||m(!1)},q=()=>{x(!0)},S=()=>{x(!1)},I=async()=>{var C;if(b)try{await p.deleteBlockletStore({input:{teamDid:e.meta.did,url:b.url,projectId:"",scope:b.scope||"studio"}}),await((C=k==null?void 0:k.actions)==null?void 0:C.refreshBlocklet())}catch(P){V.error(`Remove Blocklet Store Error: ${Ee(P)}`)}finally{j(null)}},{storeList:W}=po({fromBlocklet:g,blocklet:e,nodeInfo:f,componentDid:l,userDid:(y=c==null?void 0:c.user)==null?void 0:y.did}),z=(T=e==null?void 0:e.meta)==null?void 0:T.did;return t.jsxs(t.Fragment,{children:[t.jsxs(Dt,{disabled:s,ref:w,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[t.jsxs(ne,{onClick:r,children:[i&&t.jsx(lt,{size:14,sx:{mr:.5}}),`${a("common.connect")} ${o.name||""}`]}),t.jsx(ne,{size:"small","aria-controls":h?"split-button-menu":void 0,"aria-expanded":h?"true":void 0,"aria-label":"select merge strategy","aria-haspopup":"menu",onClick:N,children:t.jsx(fr,{})})]}),t.jsx(hn,{sx:{zIndex:10},open:h,anchorEl:w.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:C})=>t.jsx(mn,{...C,style:{transformOrigin:"center top"},children:t.jsx(Bt,{children:t.jsx(bn,{onClickAway:R,children:t.jsxs(xn,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[W==null?void 0:W.map(P=>{var J;return t.jsxs(he,{selected:P.id===(o==null?void 0:o.id),sx:{height:56},onClick:()=>_(P),children:[t.jsxs(u,{children:[t.jsx(ke,{sx:{fontSize:"16px"},maxLength:24,children:P.name}),t.jsx(ke,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:P.url})]}),rr({store:P,userDid:(J=c==null?void 0:c.user)==null?void 0:J.did})&&t.jsx(ce,{sx:{ml:1},onClick:F=>{F.preventDefault(),F.stopPropagation(),j(P)},children:t.jsx(ae,{icon:"ic:outline-delete"})})]},P.url)}),t.jsx(Is,{}),t.jsxs(he,{onClick:q,children:[t.jsx(Ut,{font:!0}),t.jsx(E,{variant:"inherit",children:a("store.blockletRegistry.addRegistry")})]})]})})})})}),D&&t.jsx(Dn,{hiddenChildren:!0,open:!0,onClose:S,teamDid:z,storeList:W,scope:"studio",onAdd:($=k==null?void 0:k.actions)==null?void 0:$.refreshBlocklet}),b&&t.jsx(Ft,{displayError:!0,title:`${a("common.delete")} ${b.name}`,description:a("blocklet.publish.deleteStoreTip",{name:b.name}),confirm:a("common.confirm"),onConfirm:I,onCancel:()=>j(null)})]})}fo.propTypes={store:d.object,blocklet:d.object,onChangeStore:d.func.isRequired,onClick:d.func.isRequired,loading:d.bool.isRequired,disabled:d.bool.isRequired,componentDid:d.string.isRequired,projectType:d.string.isRequired,getData:d.func.isRequired};fo.defaultProps={store:null,blocklet:null};const Yr=(e,o,n)=>{const r=`${G.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${o.meta.did}/${n}/logo/upload`,s=`${G.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${o.meta.did}/${n}/screenshot/upload`,i=e!=null&&e.blockletLogo?`${r}/${e.blockletLogo}`:`${G.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,l=((e==null?void 0:e.blockletScreenshots)||[]).filter(Boolean).map(a=>`${s}/${a}`);return{logoUrl:i,screenshotUrls:l,uploadLogoPrefix:r,uploadScreenshotPrefix:s}},zn=Yr;var je=v;const He=/^[a-z0-9]+(-[a-z0-9]+)*$/,ht=(e,o,n,r="")=>{const s=e.split(":");if(e.slice(0,1)==="@"){if(s.length<2||s.length>3)return null;r=s.shift().slice(1)}if(s.length>3||!s.length)return null;if(s.length>1){const a=s.pop(),c=s.pop(),p={provider:s.length>0?s[0]:r,prefix:c,name:a};return o&&!st(p)?null:p}const i=s[0],l=i.split("-");if(l.length>1){const a={provider:r,prefix:l.shift(),name:l.join("-")};return o&&!st(a)?null:a}if(n&&r===""){const a={provider:r,prefix:"",name:i};return o&&!st(a,n)?null:a}return null},st=(e,o)=>e?!!((e.provider===""||e.provider.match(He))&&(o&&e.prefix===""||e.prefix.match(He))&&e.name.match(He)):!1,Bn=Object.freeze({left:0,top:0,width:16,height:16}),at=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),ho=Object.freeze({...Bn,...at}),Pt=Object.freeze({...ho,body:"",hidden:!1});function Zr(e,o){const n={};!e.hFlip!=!o.hFlip&&(n.hFlip=!0),!e.vFlip!=!o.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(o.rotate||0))%4;return r&&(n.rotate=r),n}function Ho(e,o){const n=Zr(e,o);for(const r in Pt)r in at?r in e&&!(r in n)&&(n[r]=at[r]):r in o?n[r]=o[r]:r in e&&(n[r]=e[r]);return n}function Kr(e,o){const n=e.icons,r=e.aliases||Object.create(null),s=Object.create(null);function i(l){if(n[l])return s[l]=[];if(!(l in s)){s[l]=null;const a=r[l]&&r[l].parent,c=a&&i(a);c&&(s[l]=[a].concat(c))}return s[l]}return Object.keys(n).concat(Object.keys(r)).forEach(i),s}function el(e,o,n){const r=e.icons,s=e.aliases||Object.create(null);let i={};function l(a){i=Ho(r[a]||s[a],i)}return l(o),n.forEach(l),Ho(e,i)}function Wn(e,o){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(s=>{o(s,null),n.push(s)});const r=Kr(e);for(const s in r){const i=r[s];i&&(o(s,el(e,s,i)),n.push(s))}return n}const tl={provider:"",aliases:{},not_found:{},...Bn};function St(e,o){for(const n in o)if(n in e&&typeof e[n]!=typeof o[n])return!1;return!0}function Vn(e){if(typeof e!="object"||e===null)return null;const o=e;if(typeof o.prefix!="string"||!e.icons||typeof e.icons!="object"||!St(e,tl))return null;const n=o.icons;for(const s in n){const i=n[s];if(!s.match(He)||typeof i.body!="string"||!St(i,Pt))return null}const r=o.aliases||Object.create(null);for(const s in r){const i=r[s],l=i.parent;if(!s.match(He)||typeof l!="string"||!n[l]&&!r[l]||!St(i,Pt))return null}return o}const Go=Object.create(null);function ol(e,o){return{provider:e,prefix:o,icons:Object.create(null),missing:new Set}}function _e(e,o){const n=Go[e]||(Go[e]=Object.create(null));return n[o]||(n[o]=ol(e,o))}function mo(e,o){return Vn(o)?Wn(o,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function nl(e,o,n){try{if(typeof n.body=="string")return e.icons[o]={...n},!0}catch{}return!1}let Je=!1;function Un(e){return typeof e=="boolean"&&(Je=e),Je}function sl(e){const o=typeof e=="string"?ht(e,!0,Je):e;if(o){const n=_e(o.provider,o.prefix),r=o.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function rl(e,o){const n=ht(e,!0,Je);if(!n)return!1;const r=_e(n.provider,n.prefix);return nl(r,n.name,o)}function ll(e,o){if(typeof e!="object")return!1;if(typeof o!="string"&&(o=e.provider||""),Je&&!o&&!e.prefix){let s=!1;return Vn(e)&&(e.prefix="",Wn(e,(i,l)=>{l&&rl(i,l)&&(s=!0)})),s}const n=e.prefix;if(!st({provider:o,prefix:n,name:"a"}))return!1;const r=_e(o,n);return!!mo(r,e)}const Fn=Object.freeze({width:null,height:null}),Hn=Object.freeze({...Fn,...at}),il=/(-?[0-9.]*[0-9]+[0-9.]*)/g,cl=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Jo(e,o,n){if(o===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*o*n)/n;if(typeof e!="string")return e;const r=e.split(il);if(r===null||!r.length)return e;const s=[];let i=r.shift(),l=cl.test(i);for(;;){if(l){const a=parseFloat(i);isNaN(a)?s.push(i):s.push(Math.ceil(a*o*n)/n)}else s.push(i);if(i=r.shift(),i===void 0)return s.join("");l=!l}}const al=e=>e==="unset"||e==="undefined"||e==="none";function dl(e,o){const n={...ho,...e},r={...Hn,...o},s={left:n.left,top:n.top,width:n.width,height:n.height};let i=n.body;[n,r].forEach(m=>{const w=[],D=m.hFlip,x=m.vFlip;let b=m.rotate;D?x?b+=2:(w.push("translate("+(s.width+s.left).toString()+" "+(0-s.top).toString()+")"),w.push("scale(-1 1)"),s.top=s.left=0):x&&(w.push("translate("+(0-s.left).toString()+" "+(s.height+s.top).toString()+")"),w.push("scale(1 -1)"),s.top=s.left=0);let j;switch(b<0&&(b-=Math.floor(b/4)*4),b=b%4,b){case 1:j=s.height/2+s.top,w.unshift("rotate(90 "+j.toString()+" "+j.toString()+")");break;case 2:w.unshift("rotate(180 "+(s.width/2+s.left).toString()+" "+(s.height/2+s.top).toString()+")");break;case 3:j=s.width/2+s.left,w.unshift("rotate(-90 "+j.toString()+" "+j.toString()+")");break}b%2===1&&(s.left!==s.top&&(j=s.left,s.left=s.top,s.top=j),s.width!==s.height&&(j=s.width,s.width=s.height,s.height=j)),w.length&&(i='<g transform="'+w.join(" ")+'">'+i+"</g>")});const l=r.width,a=r.height,c=s.width,p=s.height;let f,g;l===null?(g=a===null?"1em":a==="auto"?p:a,f=Jo(g,c/p)):(f=l==="auto"?c:l,g=a===null?Jo(f,p/c):a==="auto"?p:a);const k={},h=(m,w)=>{al(w)||(k[m]=w.toString())};return h("width",f),h("height",g),k.viewBox=s.left.toString()+" "+s.top.toString()+" "+c.toString()+" "+p.toString(),{attributes:k,body:i}}const ul=/\sid="(\S+)"/g,pl="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let fl=0;function hl(e,o=pl){const n=[];let r;for(;r=ul.exec(e);)n.push(r[1]);if(!n.length)return e;const s="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(i=>{const l=typeof o=="function"?o(i):o+(fl++).toString(),a=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+l+s+"$3")}),e=e.replace(new RegExp(s,"g"),""),e}const Lt=Object.create(null);function ml(e,o){Lt[e]=o}function qt(e){return Lt[e]||Lt[""]}function bo(e){let o;if(typeof e.resources=="string")o=[e.resources];else if(o=e.resources,!(o instanceof Array)||!o.length)return null;return{resources:o,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const xo=Object.create(null),Ue=["https://api.simplesvg.com","https://api.unisvg.com"],rt=[];for(;Ue.length>0;)Ue.length===1||Math.random()>.5?rt.push(Ue.shift()):rt.push(Ue.pop());xo[""]=bo({resources:["https://api.iconify.design"].concat(rt)});function bl(e,o){const n=bo(o);return n===null?!1:(xo[e]=n,!0)}function go(e){return xo[e]}const xl=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let Xo=xl();function gl(e,o){const n=go(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let s=0;n.resources.forEach(l=>{s=Math.max(s,l.length)});const i=o+".json?icons=";r=n.maxURL-s-n.path.length-i.length}return r}function kl(e){return e===404}const jl=(e,o,n)=>{const r=[],s=gl(e,o),i="icons";let l={type:i,provider:e,prefix:o,icons:[]},a=0;return n.forEach((c,p)=>{a+=c.length+1,a>=s&&p>0&&(r.push(l),l={type:i,provider:e,prefix:o,icons:[]},a=c.length),l.icons.push(c)}),r.push(l),r};function yl(e){if(typeof e=="string"){const o=go(e);if(o)return o.path}return"/"}const vl=(e,o,n)=>{if(!Xo){n("abort",424);return}let r=yl(o.provider);switch(o.type){case"icons":{const i=o.prefix,a=o.icons.join(","),c=new URLSearchParams({icons:a});r+=i+".json?"+c.toString();break}case"custom":{const i=o.uri;r+=i.slice(0,1)==="/"?i.slice(1):i;break}default:n("abort",400);return}let s=503;Xo(e+r).then(i=>{const l=i.status;if(l!==200){setTimeout(()=>{n(kl(l)?"abort":"next",l)});return}return s=501,i.json()}).then(i=>{if(typeof i!="object"||i===null){setTimeout(()=>{i===404?n("abort",i):n("next",s)});return}setTimeout(()=>{n("success",i)})}).catch(()=>{n("next",s)})},wl={prepare:jl,send:vl};function Cl(e){const o={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((s,i)=>s.provider!==i.provider?s.provider.localeCompare(i.provider):s.prefix!==i.prefix?s.prefix.localeCompare(i.prefix):s.name.localeCompare(i.name));let r={provider:"",prefix:"",name:""};return e.forEach(s=>{if(r.name===s.name&&r.prefix===s.prefix&&r.provider===s.provider)return;r=s;const i=s.provider,l=s.prefix,a=s.name,c=n[i]||(n[i]=Object.create(null)),p=c[l]||(c[l]=_e(i,l));let f;a in p.icons?f=o.loaded:l===""||p.missing.has(a)?f=o.missing:f=o.pending;const g={provider:i,prefix:l,name:a};f.push(g)}),o}function Gn(e,o){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(s=>s.id!==o))})}function Rl(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const o=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!o.length)return;let n=!1;const r=e.provider,s=e.prefix;o.forEach(i=>{const l=i.icons,a=l.pending.length;l.pending=l.pending.filter(c=>{if(c.prefix!==s)return!0;const p=c.name;if(e.icons[p])l.loaded.push({provider:r,prefix:s,name:p});else if(e.missing.has(p))l.missing.push({provider:r,prefix:s,name:p});else return n=!0,!0;return!1}),l.pending.length!==a&&(n||Gn([e],i.id),i.callback(l.loaded.slice(0),l.missing.slice(0),l.pending.slice(0),i.abort))})}))}let Sl=0;function Il(e,o,n){const r=Sl++,s=Gn.bind(null,n,r);if(!o.pending.length)return s;const i={id:r,icons:o,callback:e,abort:s};return n.forEach(l=>{(l.loaderCallbacks||(l.loaderCallbacks=[])).push(i)}),s}function Dl(e,o=!0,n=!1){const r=[];return e.forEach(s=>{const i=typeof s=="string"?ht(s,o,n):s;i&&r.push(i)}),r}var Tl={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function _l(e,o,n,r){const s=e.resources.length,i=e.random?Math.floor(Math.random()*s):e.index;let l;if(e.random){let R=e.resources.slice(0);for(l=[];R.length>1;){const q=Math.floor(Math.random()*R.length);l.push(R[q]),R=R.slice(0,q).concat(R.slice(q+1))}l=l.concat(R)}else l=e.resources.slice(i).concat(e.resources.slice(0,i));const a=Date.now();let c="pending",p=0,f,g=null,k=[],h=[];typeof r=="function"&&h.push(r);function m(){g&&(clearTimeout(g),g=null)}function w(){c==="pending"&&(c="aborted"),m(),k.forEach(R=>{R.status==="pending"&&(R.status="aborted")}),k=[]}function D(R,q){q&&(h=[]),typeof R=="function"&&h.push(R)}function x(){return{startTime:a,payload:o,status:c,queriesSent:p,queriesPending:k.length,subscribe:D,abort:w}}function b(){c="failed",h.forEach(R=>{R(void 0,f)})}function j(){k.forEach(R=>{R.status==="pending"&&(R.status="aborted")}),k=[]}function _(R,q,S){const I=q!=="success";switch(k=k.filter(W=>W!==R),c){case"pending":break;case"failed":if(I||!e.dataAfterTimeout)return;break;default:return}if(q==="abort"){f=S,b();return}if(I){f=S,k.length||(l.length?N():b());return}if(m(),j(),!e.random){const W=e.resources.indexOf(R.resource);W!==-1&&W!==e.index&&(e.index=W)}c="completed",h.forEach(W=>{W(S)})}function N(){if(c!=="pending")return;m();const R=l.shift();if(R===void 0){if(k.length){g=setTimeout(()=>{m(),c==="pending"&&(j(),b())},e.timeout);return}b();return}const q={status:"pending",resource:R,callback:(S,I)=>{_(q,S,I)}};k.push(q),p++,g=setTimeout(N,e.rotate),n(R,o,q.callback)}return setTimeout(N),x}function Jn(e){const o={...Tl,...e};let n=[];function r(){n=n.filter(a=>a().status==="pending")}function s(a,c,p){const f=_l(o,a,c,(g,k)=>{r(),p&&p(g,k)});return n.push(f),f}function i(a){return n.find(c=>a(c))||null}return{query:s,find:i,setIndex:a=>{o.index=a},getIndex:()=>o.index,cleanup:r}}function Qo(){}const It=Object.create(null);function Pl(e){if(!It[e]){const o=go(e);if(!o)return;const n=Jn(o),r={config:o,redundancy:n};It[e]=r}return It[e]}function Ll(e,o,n){let r,s;if(typeof e=="string"){const i=qt(e);if(!i)return n(void 0,424),Qo;s=i.send;const l=Pl(e);l&&(r=l.redundancy)}else{const i=bo(e);if(i){r=Jn(i);const l=e.resources?e.resources[0]:"",a=qt(l);a&&(s=a.send)}}return!r||!s?(n(void 0,424),Qo):r.query(o,s,n)().abort}const Yo="iconify2",Xe="iconify",Xn=Xe+"-count",Zo=Xe+"-version",Qn=36e5,ql=168;function $t(e,o){try{return e.getItem(o)}catch{}}function ko(e,o,n){try{return e.setItem(o,n),!0}catch{}}function Ko(e,o){try{e.removeItem(o)}catch{}}function Nt(e,o){return ko(e,Xn,o.toString())}function At(e){return parseInt($t(e,Xn))||0}const mt={local:!0,session:!0},Yn={local:new Set,session:new Set};let jo=!1;function $l(e){jo=e}let tt=typeof window>"u"?{}:window;function Zn(e){const o=e+"Storage";try{if(tt&&tt[o]&&typeof tt[o].length=="number")return tt[o]}catch{}mt[e]=!1}function Kn(e,o){const n=Zn(e);if(!n)return;const r=$t(n,Zo);if(r!==Yo){if(r){const a=At(n);for(let c=0;c<a;c++)Ko(n,Xe+c.toString())}ko(n,Zo,Yo),Nt(n,0);return}const s=Math.floor(Date.now()/Qn)-ql,i=a=>{const c=Xe+a.toString(),p=$t(n,c);if(typeof p=="string"){try{const f=JSON.parse(p);if(typeof f=="object"&&typeof f.cached=="number"&&f.cached>s&&typeof f.provider=="string"&&typeof f.data=="object"&&typeof f.data.prefix=="string"&&o(f,a))return!0}catch{}Ko(n,c)}};let l=At(n);for(let a=l-1;a>=0;a--)i(a)||(a===l-1?(l--,Nt(n,l)):Yn[e].add(a))}function es(){if(!jo){$l(!0);for(const e in mt)Kn(e,o=>{const n=o.data,r=o.provider,s=n.prefix,i=_e(r,s);if(!mo(i,n).length)return!1;const l=n.lastModified||-1;return i.lastModifiedCached=i.lastModifiedCached?Math.min(i.lastModifiedCached,l):l,!0})}}function Nl(e,o){const n=e.lastModifiedCached;if(n&&n>=o)return n===o;if(e.lastModifiedCached=o,n)for(const r in mt)Kn(r,s=>{const i=s.data;return s.provider!==e.provider||i.prefix!==e.prefix||i.lastModified===o});return!0}function Al(e,o){jo||es();function n(r){let s;if(!mt[r]||!(s=Zn(r)))return;const i=Yn[r];let l;if(i.size)i.delete(l=Array.from(i).shift());else if(l=At(s),!Nt(s,l+1))return;const a={cached:Math.floor(Date.now()/Qn),provider:e.provider,data:o};return ko(s,Xe+l.toString(),JSON.stringify(a))}o.lastModified&&!Nl(e,o.lastModified)||Object.keys(o.icons).length&&(o.not_found&&(o=Object.assign({},o),delete o.not_found),n("local")||n("session"))}function en(){}function El(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Rl(e)}))}function Ol(e,o){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(o).sort():e.iconsToLoad=o,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:r}=e,s=e.iconsToLoad;delete e.iconsToLoad;let i;if(!s||!(i=qt(n)))return;i.prepare(n,r,s).forEach(a=>{Ll(n,a,c=>{if(typeof c!="object")a.icons.forEach(p=>{e.missing.add(p)});else try{const p=mo(e,c);if(!p.length)return;const f=e.pendingIcons;f&&p.forEach(g=>{f.delete(g)}),Al(e,c)}catch(p){console.error(p)}El(e)})})}))}const Ml=(e,o)=>{const n=Dl(e,!0,Un()),r=Cl(n);if(!r.pending.length){let c=!0;return o&&setTimeout(()=>{c&&o(r.loaded,r.missing,r.pending,en)}),()=>{c=!1}}const s=Object.create(null),i=[];let l,a;return r.pending.forEach(c=>{const{provider:p,prefix:f}=c;if(f===a&&p===l)return;l=p,a=f,i.push(_e(p,f));const g=s[p]||(s[p]=Object.create(null));g[f]||(g[f]=[])}),r.pending.forEach(c=>{const{provider:p,prefix:f,name:g}=c,k=_e(p,f),h=k.pendingIcons||(k.pendingIcons=new Set);h.has(g)||(h.add(g),s[p][f].push(g))}),i.forEach(c=>{const{provider:p,prefix:f}=c;s[p][f].length&&Ol(c,s[p][f])}),o?Il(o,r,i):en};function zl(e,o){const n={...e};for(const r in o){const s=o[r],i=typeof s;r in Fn?(s===null||s&&(i==="string"||i==="number"))&&(n[r]=s):i===typeof n[r]&&(n[r]=r==="rotate"?s%4:s)}return n}const Bl=/[\s,]+/;function Wl(e,o){o.split(Bl).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function Vl(e,o=0){const n=e.replace(/^-?[0-9.]*/,"");function r(s){for(;s<0;)s+=4;return s%4}if(n===""){const s=parseInt(e);return isNaN(s)?0:r(s)}else if(n!==e){let s=0;switch(n){case"%":s=25;break;case"deg":s=90}if(s){let i=parseFloat(e.slice(0,e.length-n.length));return isNaN(i)?0:(i=i/s,i%1===0?r(i):0)}}return o}function Ul(e,o){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in o)n+=" "+r+'="'+o[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}function Fl(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function Hl(e){return"data:image/svg+xml,"+Fl(e)}function Gl(e){return'url("'+Hl(e)+'")'}let Ge;function Jl(){try{Ge=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{Ge=null}}function Xl(e){return Ge===void 0&&Jl(),Ge?Ge.createHTML(e):e}const ts={...Hn,inline:!1},Ql={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},Yl={display:"inline-block"},Et={backgroundColor:"currentColor"},os={backgroundColor:"transparent"},tn={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},on={WebkitMask:Et,mask:Et,background:os};for(const e in on){const o=on[e];for(const n in tn)o[e+n]=tn[n]}const Zl={...ts,inline:!0};function nn(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const Kl=(e,o,n,r)=>{const s=n?Zl:ts,i=zl(s,o),l=o.mode||"svg",a={},c=o.style||{},p={...l==="svg"?Ql:{},ref:r};for(let x in o){const b=o[x];if(b!==void 0)switch(x){case"icon":case"style":case"children":case"onLoad":case"mode":case"_ref":case"_inline":break;case"inline":case"hFlip":case"vFlip":i[x]=b===!0||b==="true"||b===1;break;case"flip":typeof b=="string"&&Wl(i,b);break;case"color":a.color=b;break;case"rotate":typeof b=="string"?i[x]=Vl(b):typeof b=="number"&&(i[x]=b);break;case"ariaHidden":case"aria-hidden":b!==!0&&b!=="true"&&delete p["aria-hidden"];break;default:s[x]===void 0&&(p[x]=b)}}const f=dl(e,i),g=f.attributes;if(i.inline&&(a.verticalAlign="-0.125em"),l==="svg"){p.style={...a,...c},Object.assign(p,g);let x=0,b=o.id;return typeof b=="string"&&(b=b.replace(/-/g,"_")),p.dangerouslySetInnerHTML={__html:Xl(hl(f.body,b?()=>b+"ID"+x++:"iconifyReact"))},je.createElement("svg",p)}const{body:k,width:h,height:m}=e,w=l==="mask"||(l==="bg"?!1:k.indexOf("currentColor")!==-1),D=Ul(k,{...g,width:h+"",height:m+""});return p.style={...a,"--svg":Gl(D),width:nn(g.width),height:nn(g.height),...Yl,...w?Et:os,...c},je.createElement("span",p)};Un(!0);ml("",wl);if(typeof document<"u"&&typeof window<"u"){es();const e=window;if(e.IconifyPreload!==void 0){const o=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof o=="object"&&o!==null&&(o instanceof Array?o:[o]).forEach(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!ll(r))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const o=e.IconifyProviders;if(typeof o=="object"&&o!==null)for(let n in o){const r="IconifyProviders["+n+"] is invalid.";try{const s=o[n];if(typeof s!="object"||!s||s.resources===void 0)continue;bl(n,s)||console.error(r)}catch{console.error(r)}}}}class ns extends je.Component{constructor(o){super(o),this.state={icon:null}}_abortLoading(){this._loading&&(this._loading.abort(),this._loading=null)}_setData(o){this.state.icon!==o&&this.setState({icon:o})}_checkIcon(o){const n=this.state,r=this.props.icon;if(typeof r=="object"&&r!==null&&typeof r.body=="string"){this._icon="",this._abortLoading(),(o||n.icon===null)&&this._setData({data:r});return}let s;if(typeof r!="string"||(s=ht(r,!1,!0))===null){this._abortLoading(),this._setData(null);return}const i=sl(s);if(!i){(!this._loading||this._loading.name!==r)&&(this._abortLoading(),this._icon="",this._setData(null),i!==null&&(this._loading={name:r,abort:Ml([s],this._checkIcon.bind(this,!1))}));return}if(this._icon!==r||n.icon===null){this._abortLoading(),this._icon=r;const l=["iconify"];s.prefix!==""&&l.push("iconify--"+s.prefix),s.provider!==""&&l.push("iconify--"+s.provider),this._setData({data:i,classes:l}),this.props.onLoad&&this.props.onLoad(r)}}componentDidMount(){this._checkIcon(!1)}componentDidUpdate(o){o.icon!==this.props.icon&&this._checkIcon(!0)}componentWillUnmount(){this._abortLoading()}render(){const o=this.props,n=this.state.icon;if(n===null)return o.children?o.children:je.createElement("span",{});let r=o;return n.classes&&(r={...o,className:(typeof o.className=="string"?o.className+" ":"")+n.classes.join(" ")}),Kl({...ho,...n.data},r,o._inline,o._ref)}}const ei=je.forwardRef(function(o,n){const r={...o,_ref:n,_inline:!1};return je.createElement(ns,r)});je.forwardRef(function(o,n){const r={...o,_ref:n,_inline:!0};return je.createElement(ns,r)});var ti=ei;const oi=e=>{const o=e.includes("youtube.com")||e.includes("youtu.be"),n=e.includes("vimeo.com");return o||n};function bt({url:e,style:o,controls:n,modestbranding:r}){var a;const{t:s}=te(),i=e.includes("youtube.com")||e.includes("youtu.be"),l=e.includes("vimeo.com");if(i){const c=((a=e.split("v=")[1])==null?void 0:a.split("&")[0])||e.split("/").pop();return t.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:(o==null?void 0:o.pointerEvents)||"auto"},children:t.jsx("iframe",{src:`https://www.youtube.com/embed/${c}?modestbranding=${r}&controls=${n}&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(l){const c=e.split("/").pop();return t.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:o.pointerEvents||"auto"},children:t.jsx("iframe",{src:`https://player.vimeo.com/video/${c}`,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 t.jsx(u,{style:{position:"relative",width:"100%",paddingTop:"56.25%"},children:t.jsxs(u,{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:[t.jsx(ti,{icon:"carbon:video-off",style:{fontSize:40,marginBottom:"10px",opacity:.5}}),t.jsx(E,{variant:"body1",sx:{opacity:.5},children:s("studio.videoDialogNoSrc")})]})})}bt.propTypes={url:d.string.isRequired,style:d.object,controls:d.number,modestbranding:d.number};bt.defaultProps={style:{},controls:1,modestbranding:1};function ss({setParams:e,onClose:o,params:n}){const{t:r}=te(),[s,i]=v.useState(""),l=s&&n.blockletVideos.includes(s),a=oi(s),c=()=>{e(p=>{const f=[...p.blockletVideos];return f.push(s),{...p,blockletVideos:f}}),o()};return t.jsxs(ft,{open:!0,fullWidth:!0,maxWidth:"sm",children:[t.jsx(gn,{children:r("studio.videoDialogTitle")}),t.jsxs(kn,{children:[t.jsx(Ds,{fullWidth:!0,value:s,onChange:p=>i(p.target.value),placeholder:r("studio.videoInputLabel"),endAdornment:s?t.jsx(Qe,{position:"end",children:t.jsx(ce,{onClick:()=>i(""),children:t.jsx(Hs,{})})}):null,error:l}),l&&t.jsx(E,{variant:"body2",color:"error",children:r("studio.duplicateVideo")}),t.jsx(bt,{url:s,style:{marginTop:"20px",borderRadius:"4px"}})]}),t.jsxs(jn,{children:[t.jsx(ne,{onClick:()=>o(),children:r("studio.cancel")}),t.jsx(ne,{disabled:!a||l,onClick:c,children:r("studio.confirm")})]})]})}ss.propTypes={onClose:d.func.isRequired,params:d.object.isRequired,setParams:d.func.isRequired};function Ot({errors:e,storeList:o,...n}){const{t:r}=te();return t.jsxs(u,{...n,color:"warning.main",fontSize:"14px",sx:{border:"1px solid rgba(214, 164, 64, 0.34)",borderRadius:"4px",py:2,px:1.5,position:"relative"},children:[t.jsx(E,{variant:"caption",sx:{fontWeight:"bold",position:"absolute",top:-10,left:12,backgroundColor:"white",px:1,width:"fit-content"},children:r("blocklet.publish.storeRule.warning")}),e&&Object.entries(e).map(([s,i])=>{const l=Object.values(i),a=o.find(c=>c.url===s);return l.length>0&&t.jsxs(u,{children:[t.jsx(xe,{title:s,children:t.jsx(u,{component:"span",sx:{cursor:"pointer"},children:a.name})}),l.map(c=>t.jsx(u,{component:"li",ml:2,breakWords:!0,children:c},c))]},s)})]})}Ot.propTypes={errors:d.object.isRequired,storeList:d.array.isRequired};const sn=v.lazy(()=>Rn(()=>import("./index-CPUTxynZ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])).then(e=>({default:e.Uploader})));function rs({projectId:e,readOnly:o,loading:n,blocklet:r,params:s,setParams:i,paramsErrTip:l,setParamsErrTip:a,warning:c,setLoading:p,initUrl:f,initLogoUrl:g,setInitLogoUrl:k,componentDid:h}){const{t:m,locale:w}=te(),{api:D}=ve(),x=zt(),b=v.useRef(null),j=v.useRef(null),[_,N]=Hr(r),[R,q]=v.useState(!1),S=lr({messageType:"connect-store-message",onOpen:()=>p(!0),onClose:()=>p(!1)}),I=async A=>{const U=setTimeout(()=>{p(!1)},2e4),H=await Jr(D,A);p(!1),clearTimeout(U),window.parent.postMessage({event:"studioDialog.connected",componentDid:h},"*"),x(window.location.pathname.replace(`${G.UNOWNED_DID}/create`,`${H}/create`),{replace:!0})},W=()=>{if(!s.blockletTitle){V.error(m("blocklet.publish.errorTip.noTitle"));return}if(!(_!=null&&_.url)){V.error(m("blocklet.publish.noStoreSelected"));return}const A=Gr();S(async(U,H)=>{var Y,X,ie;try{const Q=await D.connectByStudio({input:{did:(Y=r==null?void 0:r.meta)==null?void 0:Y.did,blockletTitle:s==null?void 0:s.blockletTitle,storeUrl:_.url,storeId:_.id,storeName:_.name,type:((X=s==null?void 0:s.blockletComponents)==null?void 0:X.length)>0?"pack":"resource",componentDid:h,messageId:A,tenantScope:(f==null?void 0:f.searchParams.get("tenantScope"))||""}});if(!(Q!=null&&Q.url)){V.error("failed to connect to store");return}H(Q.url),I({did:(ie=r==null?void 0:r.meta)==null?void 0:ie.did,projectId:"",messageId:A})}catch(Q){const de=Ee(Q);V.error(de),p(!1)}})},{logoUrl:z,screenshotUrls:y,uploadLogoPrefix:T,uploadScreenshotPrefix:$}=zn(s,r,e),{logoErrors:C,screenshotErrors:P,storeList:J,hasLogoWarning:F,hasScreenshotWarning:le}=c,K=()=>o?!1:!e||e===G.UNOWNED_DID?(V.error(m("blocklet.publish.errorTip.noFirstDid")),!1):!0,ee=A=>{if(!A.destination)return;const U=Array.from(s.blockletScreenshots),[H]=U.splice(A.source.index,1);U.splice(A.destination.index,0,H),i(Y=>({...Y,blockletScreenshots:U}))},ze=A=>{if(!A.destination)return;const U=Array.from(s.blockletVideos),[H]=U.splice(A.source.index,1);U.splice(A.destination.index,0,H),i(Y=>({...Y,blockletVideos:U}))};return t.jsxs(ni,{children:[t.jsx(u,{display:"flex",className:"section",children:t.jsxs(u,{sx:{flex:1},children:[t.jsx(oe,{disabled:n||o,label:`Blocklet ${m("common.title")}`,placeholder:`Blocklet ${m("common.title")}`,InputProps:{"data-cy":"blocklet-title",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:s.blockletTitle||"",onChange:A=>{a({blockletTitle:""}),i({blockletTitle:A.target.value})},error:!!l.blockletTitle,helperText:l.blockletTitle||""}),t.jsx(oe,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"export-blocklet-did",endAdornment:e===G.UNOWNED_DID&&t.jsx(Qe,{position:"end",children:t.jsx(fo,{blocklet:r,store:_,componentDid:h,onChangeStore:N,disabled:!s.blockletTitle||o||n,loading:n,onClick:W})})},error:!!l.projectId,helperText:l.projectId||"",value:e===G.UNOWNED_DID?"":`did:abt:${e}`,sx:{mt:3}}),t.jsx(oe,{disabled:n||o,label:`Blocklet ${m("common.description")}`,placeholder:`Blocklet ${m("common.description")}`,InputProps:{"data-cy":"blocklet-description",readOnly:o},required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:s.blockletDescription||"",onChange:A=>{a({blockletDescription:""}),i({blockletDescription:A.target.value})},error:!!l.blockletDescription,helperText:l.blockletDescription||"",sx:{mt:3}}),t.jsx(oe,{disabled:n||o,label:`Blocklet ${m("common.homepageTip")}`,placeholder:`Blocklet ${m("common.homepageTip")}`,InputProps:{"data-cy":"blocklet-homepage",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:s.blockletHomepage||"",onChange:A=>{A.target.value&&!/^(http|https):\/\//.test(A.target.value)?a({blockletHomepage:m("blocklet.publish.errorTip.invalidUrl")}):a({blockletHomepage:""}),i({blockletHomepage:A.target.value})},error:!!l.blockletHomepage,helperText:l.blockletHomepage||"",sx:{mt:3}}),t.jsx(oe,{disabled:n||o,label:`Blocklet ${m("common.community")}`,placeholder:`Blocklet ${m("common.community")}`,InputProps:{"data-cy":"blocklet-community",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:s.blockletCommunity||"",onChange:A=>{A.target.value&&!/^(http|https):\/\//.test(A.target.value)?a({blockletCommunity:m("blocklet.publish.errorTip.invalidUrl")}):a({blockletCommunity:""}),i({blockletCommunity:A.target.value})},error:!!l.blockletCommunity,helperText:l.blockletCommunity||"",sx:{mt:3}}),t.jsx(oe,{disabled:n||o,label:`Blocklet ${m("common.support")}`,placeholder:`Blocklet ${m("common.support")}`,InputProps:{"data-cy":"blocklet-support",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:s.blockletSupport||"",onChange:A=>{A.target.value&&!/^(http|https):\/\//.test(A.target.value)&&!/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(A.target.value)?a({blockletSupport:m("blocklet.publish.errorTip.invalidUrlOrEmail")}):a({blockletSupport:""}),i({blockletSupport:A.target.value})},error:!!l.blockletSupport,helperText:l.blockletSupport||"",sx:{mt:3}}),t.jsx(oe,{disabled:n||o,label:`Blocklet ${m("common.repository")}`,placeholder:`Blocklet ${m("common.repository")}`,InputProps:{"data-cy":"blocklet-repository",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:s.blockletRepository||"",onChange:A=>{A.target.value&&!/^(git|https|svn)/.test(A.target.value)?a({blockletRepository:m("blocklet.publish.errorTip.invalidUrl")}):a({blockletRepository:""}),i({blockletRepository:A.target.value})},error:!!l.blockletRepository,helperText:l.blockletRepository||"",sx:{mt:3}})]})}),t.jsx(u,{display:"flex",mt:3,className:"section full-width",children:t.jsxs(u,{flex:1,overflow:"hidden",children:[t.jsxs(u,{display:"flex",flexDirection:"row",flexWrap:"wrap",children:[t.jsxs(Ie,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[t.jsx(E,{variant:"subtitle1",sx:{fontWeight:"bold"},children:m("common.logo")}),t.jsxs(Ie,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[t.jsx(u,{children:t.jsxs(u,{component:"span",children:[t.jsxs(u,{component:"span",sx:{color:"#555"},children:[m("studio.type"),":"," "]}),t.jsx(u,{component:"span",sx:{color:"#007ec6"},children:"png, jpg, webp, svg"})]})}),t.jsx(u,{children:t.jsxs(u,{component:"span",children:[t.jsxs(u,{component:"span",sx:{color:"#555"},children:[m("studio.ratio"),":"," "]}),t.jsx(u,{component:"span",sx:{color:"#007ec6"},children:"256x256"})]})}),t.jsx(u,{children:t.jsxs(u,{component:"span",children:[t.jsxs(u,{component:"span",sx:{color:"#555"},children:[m("studio.size"),":"," "]}),t.jsx(u,{component:"span",sx:{color:"#007ec6"},children:"<500Kb"})]})})]})]}),t.jsx(u,{sx:{flex:1,cursor:o?"default":"pointer",display:"flex",alignItems:"flex-end"},children:t.jsx(un,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:g||z,onClick:()=>{var A;K()&&((A=b.current)==null||A.open())}})})]}),F&&t.jsx(Ot,{errors:C,storeList:J,mt:3}),t.jsxs(u,{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap",children:[t.jsxs(Ie,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[t.jsx(E,{variant:"subtitle1",sx:{fontWeight:"bold"},children:m("common.screenshot")}),t.jsxs(Ie,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[t.jsx(u,{sx:{border:"none"},variant:"outlined",size:"small",children:t.jsxs(u,{component:"span",children:[t.jsxs(u,{component:"span",sx:{color:"#555"},children:[m("studio.ratio"),":"," "]}),t.jsx(u,{component:"span",sx:{color:"#007ec6"},children:"16 / 9"})]})}),t.jsx(u,{children:t.jsxs(u,{component:"span",children:[t.jsxs(u,{component:"span",sx:{color:"#555"},children:[m("studio.count"),":"," "]}),t.jsx(u,{component:"span",sx:{color:"#007ec6"},children:"1~5"})]})}),t.jsx(u,{children:t.jsxs(u,{component:"span",children:[t.jsxs(u,{component:"span",sx:{color:"#555"},children:[m("studio.size"),":"," "]}),t.jsx(u,{component:"span",sx:{color:"#007ec6"},children:"<5MB"})]})}),!o&&t.jsx(u,{children:t.jsxs(u,{component:"span",children:[t.jsxs(u,{component:"span",sx:{color:"#555"},children:[m("studio.order"),":"," "]}),t.jsx(u,{component:"span",sx:{color:"#007ec6"},children:m("studio.orderTip")})]})})]})]}),t.jsx(Oo,{onDragEnd:o?void 0:ee,children:t.jsx(Mo,{droppableId:"screenshots",direction:"horizontal",isDropDisabled:o,children:(A,U)=>t.jsxs(u,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap",minHeight:160,background:U.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:U.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:A.innerRef,...A.droppableProps,children:[y.map((H,Y)=>t.jsx(zo,{draggableId:H,index:Y,isDragDisabled:o,children:(X,ie)=>t.jsxs(u,{ref:X.innerRef,...X.draggableProps,className:"screenshot",sx:{transform:ie.isDragging?"scale(1.05)":"none",boxShadow:ie.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[t.jsx("img",{alt:"screenshot",src:H}),!o&&t.jsx(ce,{...X.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:t.jsx(_t,{})}),!o&&t.jsx(ce,{className:"action",onClick:()=>{i(Q=>{const de=[...Q.blockletScreenshots];return de.splice(Y,1),{...Q,blockletScreenshots:de}})},children:t.jsx(Bo,{})})]})},H)),A.placeholder,y.length<5&&t.jsx(u,{sx:{width:240,height:135,background:"#eee",cursor:o?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{var H;K()&&((H=j.current)==null||H.open())},children:"+"})]})})})]}),le&&t.jsx(Ot,{errors:P,storeList:J}),t.jsxs(u,{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap",children:[t.jsxs(Ie,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[t.jsx(E,{variant:"subtitle1",sx:{fontWeight:"bold"},children:m("studio.video")}),t.jsxs(Ie,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[t.jsx(u,{children:t.jsxs(u,{component:"span",children:[t.jsxs(u,{component:"span",sx:{color:"#555"},children:[m("studio.videoType"),":"," "]}),t.jsxs(u,{component:"span",sx:{color:"#007ec6"},children:[t.jsx("a",{href:"https://www.youtube.com/",target:"_blank",rel:"noreferrer",children:"Youtube"}),","," ",t.jsx("a",{href:"https://vimeo.com/",target:"_blank",rel:"noreferrer",children:"Vimeo"})]})]})}),t.jsx(u,{children:t.jsxs(u,{component:"span",children:[t.jsxs(u,{component:"span",sx:{color:"#555"},children:[m("studio.count"),":"," "]}),t.jsx(u,{component:"span",sx:{color:"#007ec6"},children:"1~3"})]})}),!o&&t.jsx(u,{children:t.jsxs(u,{component:"span",children:[t.jsxs(u,{component:"span",sx:{color:"#555"},children:[m("studio.order"),":"," "]}),t.jsx(u,{component:"span",sx:{color:"#007ec6"},children:m("studio.orderTip")})]})})]})]}),t.jsx(Oo,{onDragEnd:o?void 0:ze,children:t.jsx(Mo,{droppableId:"videos",direction:"horizontal",isDropDisabled:o,children:(A,U)=>t.jsxs(u,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap",minHeight:160,background:U.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:U.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:A.innerRef,...A.droppableProps,children:[s.blockletVideos.map((H,Y)=>t.jsx(zo,{draggableId:H,index:Y,isDragDisabled:o,children:(X,ie)=>t.jsxs(u,{ref:X.innerRef,...X.draggableProps,className:"screenshot",sx:{transform:ie.isDragging?"scale(1.05)":"none",boxShadow:ie.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[t.jsx(bt,{url:H,style:{pointerEvents:ie.isDragging?"none":"auto"}}),!o&&t.jsx(ce,{...X.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:t.jsx(_t,{})}),!o&&t.jsx(ce,{className:"action",onClick:()=>{i(Q=>{const de=[...Q.blockletVideos];return de.splice(Y,1),{...Q,blockletVideos:de}})},children:t.jsx(Bo,{})})]})},H)),A.placeholder,s.blockletVideos.length<3&&t.jsx(u,{sx:{width:240,height:135,background:"#eee",cursor:o?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{K()&&q(!0)},children:"+"})]})})})]})]})}),t.jsxs(v.Suspense,{fallback:t.jsx(Ze,{}),children:[t.jsx(sn,{ref:b,locale:w,popup:!0,onUploadFinish:A=>{var U;i({blockletLogo:A.data.filename}),k(""),(U=b.current)==null||U.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:T,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/png","image/jpeg","image/webp","application/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"),R&&t.jsx(ss,{onClose:()=>q(!1),params:s,setParams:i}),t.jsx(sn,{ref:j,popup:!0,onUploadFinish:A=>{var U;i(H=>{var X;const Y=H.blockletScreenshots||[];return Y.push((X=A.data)==null?void 0:X.filename),{...H,blockletScreenshots:Y}}),(U=j.current)==null||U.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:$,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","application/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-y.length}},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,autoCropArea:1,aspectRatio:16/9,initialAspectRatio:16/9,croppedCanvasOptions:{minWidth:1280,minHeight:720,maxWidth:1280*2,maxHeight:720*2}}}},"uploader-screenshot")]})]})}rs.propTypes={projectId:d.string.isRequired,readOnly:d.bool.isRequired,params:d.object.isRequired,setParams:d.func.isRequired,paramsErrTip:d.object.isRequired,setParamsErrTip:d.func.isRequired,warning:d.object.isRequired,loading:d.bool.isRequired,blocklet:d.object.isRequired,setLoading:d.func.isRequired,initUrl:d.object.isRequired,componentDid:d.isRequired,initLogoUrl:d.string.isRequired,setInitLogoUrl:d.func.isRequired};const ni=ge.div`
125
- margin-top: 24px;
126
- .screenshot {
127
- margin-bottom: 16px;
128
- max-width: 240px;
129
- max-height: 135px;
130
- width: 240px;
131
- height: 135px;
132
- overflow: hidden;
133
- display: flex;
134
- align-items: center;
135
- justify-content: center;
136
- background-color: #eee;
137
- margin-right: 16px;
138
- position: relative;
139
- .action {
140
- visibility: hidden;
141
- position: absolute;
142
- width: 42px;
143
- height: 42px;
144
- right: 6px;
145
- top: 6px;
146
- border-radius: 4px;
147
- background-color: rgba(0, 0, 0, 1);
148
- color: rgba(255, 255, 255, 1);
149
- }
150
- &:hover .action {
151
- visibility: visible;
152
- }
153
- }
154
- .screenshot img {
155
- width: 100%; /* 图像宽度填充容器 */
156
- height: auto; /* 图像高度自适应 */
157
- }
158
- `;var yo={},si=ye;Object.defineProperty(yo,"__esModule",{value:!0});var ls=yo.default=void 0,ri=si(we()),li=t;ls=yo.default=(0,ri.default)((0,li.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M14 13v4h-4v-4H7l4.65-4.65c.2-.2.51-.2.71 0L17 13z"}),"CloudUploadRounded");const ii=(e,o,n,r)=>{const s=e?[...e]:[],i=((o==null?void 0:o.children)||[]).reduce((l,a)=>(l[a.meta.did]=!0,l),{});return Object.keys(n).forEach(l=>{if(!i[l])return;let a=!1;r||s.forEach(c=>{c.did===l&&(c.included=!0,c.required=!0,a=!0)}),a||s.push({did:l,included:!0,required:!0})}),s},ci=async e=>{if(typeof e!="string")throw new Error("URL must be a string");try{const o=e.split("/").pop().split("?")[0],r=await(await fetch(e)).blob();return new File([r],o,{type:r.type})}catch{throw new Error("Failed to convert Logo URL to file")}};function*ai(e,o){let n=0;for(;n<e.size;)yield e.slice(n,n+o),n+=o}const di=async({did:e,projectId:o,uploadType:n="logo",imageUrl:r})=>{const s=await ci(r);new FormData().append("file",s);const l={uploaderId:"Uploader",relativePath:encodeURIComponent(s.name),name:encodeURIComponent(s.name),type:s.type},c=(await Ao.post(me(G.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/project",e,o,n,"upload"),null,{headers:{"Tus-Resumable":"1.0.0","Upload-Length":s.size,"X-Uploader-File-Ext":s.name.split(".").pop(),"Upload-Metadata":Object.keys(l).map(k=>`${k} ${btoa(l[k])}`).join(",")}})).headers.location,p=2*1024*1024;let f=0,g="";for(const k of ai(s,p)){const h=await Ao.patch(me(G.WELLKNOWN_SERVICE_PATH_PREFIX,c),k,{headers:{"Tus-Resumable":"1.0.0","Upload-Offset":f,"Content-Type":"application/offset+octet-stream"}});f+=k.size,g=h.data.filename}return g},is=({params:e,projectId:o,status:n,t:r})=>{const s=[];return e.blockletTitle||s.push({param:"blockletTitle",message:r("blocklet.publish.errorTip.noTitle")}),(!o||o===G.UNOWNED_DID)&&s.push({param:"projectId",message:r("blocklet.publish.errorTip.noDid")}),e.blockletVersion?Ne.valid(e.blockletVersion)||s.push({param:"blockletVersion",message:r("blocklet.publish.errorTip.inValidVersion")}):s.push({param:"blockletVersion",message:r("blocklet.publish.errorTip.noVersion")}),n===ue.PROJECT.RELEASE_STATUS.published&&(e.blockletDescription||s.push({param:"blockletDescription",message:r("blocklet.publish.errorTip.noDescription")}),e.note||s.push({param:"note",message:r("blocklet.publish.errorTip.noNote")})),s.length?s:null},ui=({params:e,step:o,t:n,projectId:r})=>{if(o===0){if(!e.blockletTitle)return n("blocklet.publish.errorTip.noTitle");if(!r||r===G.UNOWNED_DID)return n("blocklet.publish.errorTip.noDid");if(!e.blockletDescription)return n("blocklet.publish.errorTip.noDescription")}if(o>=4){if(!e.blockletVersion)return n("blocklet.publish.errorTip.noVersion");if(!Ne.valid(e.blockletVersion))return n("blocklet.publish.errorTip.inValidVersion");if(!e.note)return n("blocklet.publish.errorTip.noNote")}return""};function vo({blocklet:e,releaseId:o,connectedStores:n,projectId:r,releaseType:s,publishedStoreIds:i,onPublish:l,onDelete:a,warning:c,projectType:p,componentDid:f,onOpenConnectStore:g,behavior:k,onSelectConnectStore:h}){var N,R;const{t:m}=te(),{actions:{refreshBlocklet:w}}=Me(),{session:D}=Ye(),{storeList:x}=po({fromBlocklet:!0,blocklet:e,componentDid:f,userDid:(N=D==null?void 0:D.user)==null?void 0:N.did}),b=v.useMemo(()=>n!=null&&n.length?n==null?void 0:n.reduce((q,S)=>(q[S.storeId]=S,q),{}):{},[n]),j=(R=e==null?void 0:e.meta)==null?void 0:R.did,_={};return Object.entries((c==null?void 0:c.logoErrors)||{}).forEach(([q,S])=>{const I=Object.values(S);I.length>0&&(_[q]=I)}),Object.entries((c==null?void 0:c.screenshotErrors)||{}).forEach(([q,S])=>{const I=Object.values(S);I.length>0&&(_[q]=_[q]?[..._[q],...I]:I)}),t.jsxs(t.Fragment,{children:[k==="connect"&&!!(x!=null&&x.length)&&t.jsx(fn,{severity:"info",style:{width:"100%"},children:t.jsxs(u,{color:Ts[400],component:"a",href:p==="pack"?"https://www.arcblock.io/docs/blocklet-developer/en/5PXToZve-5IXAN1bc8rkpxAc":"https://www.arcblock.io/docs/blocklet-developer/en/hB5VWLfg9VnbWsL1JGLuLUfW",target:"_blank",display:"flex",alignItems:"center",rel:"noreferrer",children:[m(p==="pack"?"blocklet.publish.whyCantSeeInStore":"blocklet.publish.whyCantSeeResourceBlockletInStore"),t.jsx(hr,{sx:{marginLeft:1}})]})}),t.jsx(_s,{children:x==null?void 0:x.map(q=>t.jsx(Ps,{"data-cy":"store-switch",children:t.jsx(Ls,{children:t.jsx(ir,{behavior:k,onSelectConnectStore:h,releaseId:o,projectId:r,releaseType:s,kind:"publish",teamDid:j,warningList:_[q.url],store:q,published:(i==null?void 0:i.indexOf(q.id))>-1,connectedStore:b[q.id],onPublish:l,onDelete:a,scope:q.scope||"studio",onOpenConnectStore:g})})},q.url))}),t.jsx(Dn,{teamDid:j,storeList:x,scope:"studio",onAdd:w})]})}vo.propTypes={blocklet:d.object.isRequired,projectId:d.string.isRequired,releaseId:d.string.isRequired,releaseType:d.string.isRequired,onPublish:d.func,onDelete:d.func,publishedStoreIds:d.arrayOf(d.string),connectedStores:d.arrayOf(d.object).isRequired,projectType:d.string,componentDid:d.string,warning:d.object,onOpenConnectStore:d.func,onSelectConnectStore:d.func,behavior:d.string};vo.defaultProps={projectType:"",componentDid:"",publishedStoreIds:[],onPublish:()=>{},onDelete:()=>{},warning:{},onOpenConnectStore:()=>{},onSelectConnectStore:()=>{},behavior:"connect"};function cs({did:e,params:o,setParams:n,projectId:r,open:s,onClose:i}){const{t:l}=te(),[a,c]=v.useState(!1),{api:p}=ve(),[f,g]=v.useState(!1),[k,h]=v.useState(!1),m=()=>{g(o.autoUpload),h(o.possibleSameStore),c(!1),i(!1)},w=async()=>{c(!0);try{await p.updateProject({input:{did:e,projectId:r,blockletTitle:o.blockletTitle||"",blockletDescription:o.blockletDescription||"",blockletIntroduction:o.blockletIntroduction||"",autoUpload:!!f,possibleSameStore:!!k}}),n({autoUpload:f,possibleSameStore:k}),i(!1)}catch(x){V.error(x.message)}c(!1)};v.useEffect(()=>{g(o.autoUpload),h(o.possibleSameStore)},[o]);const D=!!(r&&r!==G.UNOWNED_DID);return t.jsx(Vt,{title:l("blocklet.publish.projectSettings"),disableEscapeKeyDown:!0,disablePortal:!1,fullWidth:!0,open:s,onClose:m,actions:t.jsxs(t.Fragment,{children:[t.jsx(ne,{onClick:x=>{x.stopPropagation(),i()},color:"inherit",children:l("common.cancel")}),D&&t.jsxs(ne,{onClick:x=>{x.stopPropagation(),w()},color:"primary","data-cy":"install-blocklet-next-step",disabled:a,variant:"contained",autoFocus:!0,children:[a&&t.jsx(lt,{size:16}),l("common.confirm")]})]}),children:D?t.jsxs(u,{component:"label",sx:{display:"flex",flexDirection:"column",gap:2},children:[t.jsxs(u,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[t.jsx(u,{component:ae,icon:"ph:upload",sx:{fontSize:24,mr:2}}),t.jsx(E,{variant:"body1",sx:{flex:1},children:l("blocklet.publish.autoUploadTip")}),t.jsx(Te,{checked:f,onChange:(x,b)=>g(b)})]}),t.jsxs(u,{component:"label",sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[t.jsx(u,{component:ae,icon:"fluent-mdl2:merge-duplicate",sx:{fontSize:24,mr:2}}),t.jsx(E,{variant:"body1",sx:{flex:1},children:l("blocklet.publish.possibleSameStoreTip")}),t.jsx(Te,{checked:k,onChange:(x,b)=>h(b)})]})]}):t.jsxs(u,{sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:[t.jsx(u,{component:ae,icon:"ph:empty",sx:{fontSize:40,mb:3,opacity:.6}}),t.jsx(E,{variant:"body1",sx:{flex:1},children:l("blocklet.publish.needProjectId")})]})})}cs.propTypes={did:d.string.isRequired,params:d.object.isRequired,open:d.bool.isRequired,onClose:d.func.isRequired,setParams:d.func.isRequired,projectId:d.string.isRequired};function as({downloadUrl:e,installUrl:o,handleSetTip:n,isPack:r,disabled:s}){const{t:i}=te(),[l,a]=v.useState(!1),c=v.useRef(null),p=()=>{a(!l)},f=g=>{c.current&&c.current.contains(g.target)||a(!1)};return t.jsxs(t.Fragment,{children:[t.jsx(ne,{disabled:s,ref:c,onClick:p,children:t.jsx(u,{component:ae,sx:{fontSize:18},icon:"bxs:download"})}),t.jsx(hn,{sx:{zIndex:10},open:l,anchorEl:c.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:g})=>t.jsx(mn,{...g,style:{transformOrigin:"center top"},children:t.jsx(Bt,{children:t.jsx(bn,{onClickAway:f,children:t.jsxs(xn,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[r&&t.jsx(u,{component:"a",href:o,target:"_blank",rel:"noreferrer",sx:{textDecoration:"none"},children:t.jsxs(he,{sx:{color:"#333"},children:[t.jsx(u,{component:ae,sx:{mr:1},icon:"ic:round-install-desktop"}),t.jsx(E,{variant:"inherit",children:i("blocklet.publish.installToThisServer")})]})}),t.jsxs(he,{onClick:n,children:[t.jsx(u,{component:ae,sx:{mr:1},icon:"iconamoon:copy"}),t.jsx(E,{variant:"inherit",children:i("blocklet.publish.copyInstallUrl")})]}),t.jsx(u,{component:"a",href:e,target:"_blank",rel:"noreferrer",sx:{textDecoration:"none"},children:t.jsxs(he,{sx:{color:"#333"},children:[t.jsx(u,{component:ae,sx:{mr:1},icon:"ph:download"}),t.jsx(E,{variant:"inherit",children:i("common.download")})]})})]})})})})})]})}as.propTypes={disabled:d.bool.isRequired,isPack:d.bool.isRequired,downloadUrl:d.string.isRequired,installUrl:d.string.isRequired,handleSetTip:d.func.isRequired};var dn;const rn=(dn=window.env)==null?void 0:dn.serverEndpoint;function ds({projectId:e,params:o,setParamsErrTip:n,initUrl:r,setParams:s,mode:i,loading:l,blocklet:a,release:c,isPublished:p,releaseId:f,getData:g,getRelease:k,paramsErrTip:h,warning:m,componentDid:w,resourceRelateComponents:D,disabledSelectComponents:x,saveSelectedEventsRef:b,hasSelectedResources:j,initLogoUrl:_,setLoading:N,releaseUsedLast:R,setReleaseUsedLast:q,projectType:S}){var de;const{t:I,locale:W}=te(),{api:z}=ve(),y=zt(),[T,$]=v.useState(!1),[C,P]=v.useState(!1),[J,F]=v.useState(),le=Ae(Z=>Z.breakpoints.down("md")),K=v.useMemo(()=>{var Z;return o!=null&&o.blockletResourceType?o==null?void 0:o.blockletResourceType:((Z=o==null?void 0:o.blockletComponents)==null?void 0:Z.length)>0?(o==null?void 0:o.blockletComponents.find(M=>M.included))?"resource":"pack":"resource"},[o==null?void 0:o.blockletComponents,o==null?void 0:o.blockletResourceType]),ee=()=>{window.parent.postMessage({event:"studioDialog.uploaded",componentDid:w},"*"),k()},ze=async Z=>{var Ke,We,re,Le;if(h!=null&&h.blockletHomepage||h!=null&&h.blockletSupport||h!=null&&h.blockletCommunity){V.error((h==null?void 0:h.blockletHomepage)||(h==null?void 0:h.blockletSupport)||(h==null?void 0:h.blockletCommunity));return}const Ce=is({params:o,hasSelectedResources:j,projectId:e,status:Z,t:I});if(Ce){V.error(Ce.map(B=>B.message).join("; ")),n(Ce.reduce((B,se)=>({...B,[se.param]:se.message}),{}));return}const M={...o};if(M.blockletComponents=ii(M.blockletComponents,a,D,x),M.blockletVersion=Ne.valid(M.blockletVersion),!M.blockletVersion){V.error("Invalid Blocklet Version"),n({blockletVersion:"Invalid Blocklet Version"});return}if(_)try{const B=await di({did:a.meta.did,projectId:e,imageUrl:_});M.blockletLogo=B,s({blockletLogo:B})}catch(B){V.error(B.message);return}if(o.resourceFromSelect){M.uploadedResource="";try{const B=Object.keys(b.current);await ct(B.map(se=>()=>{const qe=b.current[se];return zr({api:z,locale:W,projectId:e,releaseId:R?"":f,appDid:a.meta.did,component:qe.component,resources:qe.resources,initUrl:r})}),{concurrency:2})}catch(B){V.error(((re=(We=(Ke=B==null?void 0:B.response)==null?void 0:Ke.data)==null?void 0:We.error)==null?void 0:re.message)||B.message),n({blockletResource:"Invalid save the resource"});return}}else(Le=o.blockletDocker)!=null&&Le.dockerImage||(M.blockletComponents=[]);M.blockletTitle=(M.blockletTitle||"").trim(),M.blockletDescription=(M.blockletDescription||"").trim(),M.blockletSupport=(M.blockletSupport||"").trim(),M.blockletHomepage=(M.blockletHomepage||"").trim(),M.blockletCommunity=(M.blockletCommunity||"").trim(),M.blockletRepository=(M.blockletRepository||"").trim(),M.blockletIntroduction=(M.blockletIntroduction||"").trim(),M.note=(M.note||"").trim(),M.blockletComponents=((M==null?void 0:M.blockletComponents)||[]).filter(B=>B.included).map(B=>Jt(B,["did","required"])).map(JSON.stringify),M.contentType!=="docker"&&(M.blockletDocker={dockerImage:"",dockerCommand:"",dockerArgs:[],dockerEnvs:[]}),M.blockletDocker.dockerImage=M.blockletDocker.dockerImage||"",M.blockletDocker.dockerArgs.length>0&&M.blockletDocker.dockerArgs.forEach(B=>{B.proxyBehavior=B.proxyBehavior||"service"});try{await z.createRelease({input:{...M,note:JSON.stringify({note:M.note}),did:a.meta.did,projectId:e,releaseId:R?"":f,status:Z}}),Z==="draft"?V.success(I("blocklet.publish.saveDraftSuccess")):(q(!1),V.success(I("blocklet.publish.createReleaseSuccess")),window.parent.postMessage({event:"studioDialog.released",componentDid:w},"*")),n({blockletResource:"",blockletTitle:"",blockletDescription:"",blockletVersion:"",blockletLogo:"",projectId:"",blockletIntroduction:"",note:""})}catch(B){const se=Ee(B);V.error(se),(/resource/.test(se)||/zip/.test(se))&&n({blockletResource:se});return}const Pe=await z.getProject({input:{did:a.meta.did,projectId:e}}),Be=Pe.project.lastReleaseId;o.autoUpload&&await ct(Pe.project.connectedStores.map(B=>async()=>{try{const se=await z.publishToStore({input:{did:a.meta.did,storeId:B.storeId,storeName:B.storeName,projectId:e,releaseId:Be,type:K}});V.success(t.jsx(cr,{storeName:B.storeName,storeUrl:B.storeUrl,developerDid:B.developerDid,published:se.url==="published"}),{duration:1e4})}catch(se){V.error(Ee(se))}}),{concurrency:4}),ee==null||ee(),y(`../${e}/view/${Be}`,{replace:!0})},A=Z=>(N(!0),ze(Z).finally(()=>{N(!1)})),U=async Z=>{await Xr(z,Z),g()},H=()=>{P(!0)},Y=me(rn,`/api/project/${a.meta.did}/${e}/${f}/release/blocklet.json`),X=new URL(rn);X.pathname=me(X.pathname,"/launch-blocklet/agreement"),X.searchParams.set("blocklet_meta_url",Y);const ie=X.href,Q=()=>F(Y);return t.jsxs(t.Fragment,{children:[t.jsx(pi,{className:"sticky-header",children:t.jsx(Gt,{left:t.jsxs(pn,{className:"breadcrumbs","aria-label":"breadcrumb",children:[t.jsx(be,{to:"../",children:I("common.blockletStudio")}),e===G.UNOWNED_DID?t.jsx(E,{color:"text.primary",children:t.jsx(ke,{maxLength:le?6:30,children:(o==null?void 0:o.blockletTitle)||"Blocklet"})}):t.jsx(be,{to:`../${e}`,children:t.jsx(ke,{maxLength:le?6:30,children:(o==null?void 0:o.blockletTitle)||"Blocklet"})}),t.jsx(E,{color:"text.primary",children:i==="create"?I("common.create"):(o==null?void 0:o.blockletVersion)||I("common.edit")})]}),actions:t.jsxs(t.Fragment,{children:[!p&&t.jsxs(Dt,{disabled:l,variant:"contained",children:[t.jsxs(ne,{variant:"contained",onClick:()=>A(ue.PROJECT.RELEASE_STATUS.published),children:[l&&t.jsx(lt,{size:14,sx:{mr:.5},color:"inherit"}),I("blocklet.publish.createRelease")]}),t.jsx(ne,{variant:"contained",onClick:H,children:t.jsx(ae,{icon:"mage:settings-fill",fontSize:"16px"})})]}),p&&t.jsxs(t.Fragment,{children:[t.jsx(ft,{fullWidth:!0,maxWidth:"sm",open:J,onClose:()=>F(""),children:t.jsxs(u,{sx:{py:5,px:4,wordBreak:"break-all"},children:[t.jsx(E,{variant:"h6",sx:{mb:2},children:I("blocklet.publish.installResourceTip")}),t.jsx(In,{children:J}),t.jsxs(E,{sx:{mt:2},children:[I("blocklet.publish.installResourceTip2"),t.jsx("a",{style:{marginLeft:4},href:"https://www.arcblock.io/docs/blocklet-developer/how-to-use-install-url",target:"_blank",rel:"noreferrer",children:I("blocklet.publish.installResourceHelp")})]})]})}),t.jsxs(Dt,{disabled:l,variant:"contained",children:[t.jsxs(ne,{onClick:()=>$(!0),children:[l?t.jsx(lt,{size:14,sx:{mr:1},color:"inherit"}):t.jsx(ls,{sx:{fontSize:"1.3em",mr:1}}),I(le?"common.upload":"blocklet.publish.connectOrUpload")]}),t.jsx(as,{isPack:K==="pack",downloadUrl:me(`${G.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${a.meta.did}/${e}/${f}/download/${(c.files||[])[0]}`),installUrl:ie,handleSetTip:Q}),t.jsx(ne,{onClick:H,children:t.jsx(ae,{icon:"mage:settings-fill",fontSize:"16px"})})]})]})]})})}),t.jsx(Vt,{title:I("blocklet.publish.connectOrUpload"),disableEscapeKeyDown:!0,disablePortal:!1,fullWidth:!0,open:T,onClose:()=>$(!1),children:t.jsx(vo,{projectType:S,blocklet:a,releaseType:K,projectId:e,releaseId:f,componentDid:w,warning:m,onPublish:ee,onOpenConnectStore:U,onDelete:g,connectedStores:o.connectedStores||[],publishedStoreIds:c==null?void 0:c.publishedStoreIds})}),t.jsx(cs,{did:(de=a==null?void 0:a.meta)==null?void 0:de.did,params:o,projectId:e,open:C,setParams:s,onClose:()=>P(!1)})]})}ds.propTypes={projectId:d.string.isRequired,params:d.object.isRequired,mode:d.string.isRequired,loading:d.bool.isRequired,blocklet:d.object.isRequired,release:d.object.isRequired,isPublished:d.bool.isRequired,releaseId:d.string.isRequired,getData:d.func.isRequired,getRelease:d.func.isRequired,componentDid:d.string.isRequired,resourceRelateComponents:d.object.isRequired,disabledSelectComponents:d.bool.isRequired,saveSelectedEventsRef:d.object.isRequired,hasSelectedResources:d.bool.isRequired,initLogoUrl:d.string.isRequired,setLoading:d.func.isRequired,releaseUsedLast:d.bool.isRequired,setReleaseUsedLast:d.func.isRequired,projectType:d.string.isRequired,setParamsErrTip:d.func.isRequired,warning:d.object.isRequired,setParams:d.func.isRequired,initUrl:d.object.isRequired,paramsErrTip:d.object.isRequired};const pi=ge.div`
159
- .sticky-header {
160
- margin-top: -12px;
161
- padding: 12px 0;
162
- position: sticky;
163
- top: 0;
164
- z-index: 99;
165
- display: flex;
166
- align-items: center;
167
- justify-content: space-between;
168
- background-color: #fff;
169
- padding-bottom: 12px;
170
- border-bottom: ${({theme:e})=>`1px solid ${e.palette.divider}`};
171
- }
172
- `;function us({text:e}){return e?t.jsx(mr,{wrapperElement:{"data-color-mode":"light"},source:Qs.sanitize(e),rehypePlugins:[[br,{target:"_blank"}]]}):t.jsx(Oe,{Icon:Qt})}us.propTypes={text:d.string.isRequired};function ps({params:e,setParams:o,paramsErrTip:n,loading:r,setParamsErrTip:s,readOnly:i}){var f;const{t:l}=te(),[a,c]=v.useState(i?"preview":"write"),p=(g,k)=>{c(k)};return t.jsxs(u,{sx:{border:"1px solid #fff",width:"100%",borderRadius:2},children:[t.jsxs(u,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[t.jsx(E,{variant:"h6",fontWeight:"bold",sx:{},children:l("common.introduction")}),t.jsxs(yn,{value:a,onChange:p,"aria-label":"wrapped label tabs example",children:[t.jsx(it,{value:"write",label:"Write"}),t.jsx(it,{value:"preview",label:"Preview"})]})]}),t.jsx(u,{display:a==="write"?"block":"none",sx:{width:"100%",marginTop:3},children:t.jsx(oe,{disabled:r||i,sx:{border:"none"},placeholder:`Blocklet ${l("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:i,endAdornment:t.jsxs(Qe,{position:"end",children:[((f=e==null?void 0:e.blockletIntroduction)==null?void 0:f.length)||0," / ",ue.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:e.blockletIntroduction||"",onChange:g=>{s({blockletIntroduction:""}),o({blockletIntroduction:g.target.value.slice(0,ue.PROJECT.MAX_INTRO_LENGTH)})},error:!!n.blockletIntroduction,helperText:n.blockletIntroduction||""})}),t.jsx(u,{display:a==="preview"?"block":"none",mt:3,children:t.jsx(us,{text:e.blockletIntroduction||""})})]})}ps.propTypes={params:d.object.isRequired,setParams:d.func.isRequired,paramsErrTip:d.object.isRequired,setParamsErrTip:d.func.isRequired,readOnly:d.bool.isRequired,loading:d.bool.isRequired};var wo={},fi=ye;Object.defineProperty(wo,"__esModule",{value:!0});var Mt=wo.default=void 0,hi=fi(we()),ln=t;Mt=wo.default=(0,hi.default)([(0,ln.jsx)("circle",{cx:"12",cy:"19",r:"2"},"0"),(0,ln.jsx)("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function Co({step:e,ok:o,active:n,error:r,warning:s}){let i="grey.500",l=e+1;return o&&(l=t.jsx(xr,{sx:{fontSize:18,margin:0},color:"white"})),r||!o&&n>e?(i="error.main",l=t.jsx(Mt,{sx:{fontSize:18,margin:0},color:"white"})):s?(i="warning.main",l=t.jsx(Mt,{sx:{fontSize:18,margin:0},color:"white"})):n>=e&&(i="primary.main"),t.jsx(u,{width:24,height:24,bgcolor:i,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center",children:l})}Co.propTypes={step:d.number,ok:d.bool,active:d.number,error:d.string,warning:d.bool};Co.defaultProps={step:0,ok:!1,active:0,error:"",warning:!1};function fs({steps:e,activeStep:o,setActiveStep:n,hasSelectedResources:r,params:s,loading:i,paramsErrTip:l,warning:a,viewMode:c,projectId:p}){const{t:f}=te(),g=()=>{n(w=>w+1)},k=()=>{n(w=>w-1)},h=w=>w===0?(l==null?void 0:l.blockletTitle)||(l==null?void 0:l.projectId)||(l==null?void 0:l.blockletDescription)||(l==null?void 0:l.blockletHomepage)||(l==null?void 0:l.blockletSupport)||(l==null?void 0:l.blockletCommunity)||(l==null?void 0:l.blockletRepository):w===2?(l==null?void 0:l.blockletResource)||(l==null?void 0:l.blockletDocker)||(l==null?void 0:l.dockerImageName):w>=4?(l==null?void 0:l.blockletVersion)||(l==null?void 0:l.note):"",m=c||is({hasSelectedResources:r,params:s,projectId:p,t:f})===null;return t.jsxs(u,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid #ccc",borderRadius:2},children:[t.jsx(qs,{activeStep:o,orientation:"vertical",children:e.map((w,D)=>{const x={},b=i||!ui({hasSelectedResources:r,params:s,projectId:p,step:D,t:f}),j=i?"":h(D);return j&&(x.optional=t.jsx(E,{variant:"caption",color:"error",children:j}),x.error=!0),t.jsxs($s,{children:[t.jsx(Ns,{icon:t.jsx(Co,{error:j,warning:D===0?a.hasWarning:!1,active:m?99:o,step:D,ok:b}),sx:{cursor:"pointer",color:j?"error.main":"inherit"},disabled:!1,onClick:()=>n(D),...x,children:t.jsx(E,{fontSize:"14px",fontWeight:"500",color:j||!b&&o>D?"error.main":"inherit",children:w.label})}),t.jsxs(As,{children:[t.jsx(E,{fontSize:12,children:w.description}),!m&&t.jsx(u,{sx:{mb:2},children:t.jsxs("div",{children:[D<e.length-1&&t.jsx(ne,{variant:"contained",onClick:g,sx:{mt:1,mr:1},disabled:j||!b,children:f("common.continue")}),D>0&&t.jsx(ne,{disabled:D===0,onClick:k,sx:{mt:1,mr:1},children:f("common.back")})]})})]})]},w.label)})}),o>=e.length-1&&t.jsx(Bt,{square:!0,elevation:0,sx:{p:3},children:t.jsx(E,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}fs.propTypes={steps:d.array.isRequired,activeStep:d.number.isRequired,setActiveStep:d.func.isRequired,params:d.object.isRequired,viewMode:d.string.isRequired,loading:d.bool.isRequired,projectId:d.string.isRequired,hasSelectedResources:d.bool.isRequired,warning:d.object.isRequired,paramsErrTip:d.shape({projectId:d.string,blockletVersion:d.string,blockletTitle:d.string,blockletDescription:d.string,note:d.string,blockletResource:d.string,blockletHomepage:d.string,blockletSupport:d.string,blockletCommunity:d.string,blockletRepository:d.string,blockletDocker:d.object,dockerImageName:d.string}).isRequired};const mi=[".zip",".gz"],bi=1024*1024*100,xi=v.lazy(()=>Rn(()=>import("./index-CPUTxynZ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])).then(e=>({default:e.Uploader})));function Ro({app:e,projectId:o,readOnly:n,params:r,setParams:s,setParamsErrTip:i,error:l}){const{t:a,locale:c}=te(),p=v.useRef(null),f=()=>n?!1:!o||o===G.UNOWNED_DID?(V.error(a("blocklet.publish.errorTip.noFirstDid")),!1):!0,g=`${G.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e.meta.did}/${o}/resource/upload`;return t.jsxs(u,{sx:{mt:3},children:[t.jsx(E,{gutterBottom:!0,children:a("blocklet.publish.resourceUpload")}),t.jsxs(Ie,{direction:"row",alignItems:"center",spacing:1,sx:{flex:1,cursor:n?"default":"pointer"},children:[!!r.uploadedResource&&t.jsx(E,{component:"a",href:`${g}/params.uploadedResource`,children:r.uploadedResource}),!n&&t.jsx(ne,{variant:"outlined",size:"small",onClick:()=>{var k;f()&&((k=p.current)==null||k.open())},children:r.uploadedResource?a("common.change"):a("common.upload")})]}),t.jsx(v.Suspense,{fallback:t.jsx(Ze,{}),children:t.jsx(xi,{ref:p,locale:c,popup:!0,onUploadFinish:k=>{var h;s({uploadedResource:k.data.filename}),i({blockletResource:""}),(h=p.current)==null||h.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:g,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileExts:mi,maxFileSize:bi,maxNumberOfFiles:1}}},"uploader-resource")}),!!l&&t.jsx(u,{color:"error.main",mt:1,fontSize:14,children:l})]})}Ro.propTypes={app:d.object.isRequired,projectId:d.string.isRequired,readOnly:d.bool.isRequired,params:d.object.isRequired,setParams:d.func.isRequired,error:d.string.isRequired,setParamsErrTip:d.func.isRequired};Ro.defaultProps={};function dt({readOnly:e,params:o,setParams:n,paramsErrTip:r,setParamsErrTip:s,loading:i}){var a;const{t:l}=te();return t.jsx(u,{display:"flex",mt:3,className:"section",children:t.jsxs(u,{sx:{flex:1},children:[t.jsx(oe,{required:!0,disabled:i||e,label:`Blocklet ${l("common.version")}`,placeholder:`Blocklet ${l("common.version")}`,InputProps:{"data-cy":"blocklet-version",readOnly:e},autoComplete:"off",variant:"outlined",fullWidth:!0,value:o.blockletVersion||"",onChange:c=>{s({blockletVersion:""}),n({blockletVersion:c.target.value})},error:!!r.blockletVersion,helperText:r.blockletVersion||""}),t.jsx(oe,{label:l("blocklet.publish.releaseNote"),autoComplete:"off",disabled:i||e,variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:e,endAdornment:t.jsxs(Qe,{position:"end",children:[((a=o==null?void 0:o.note)==null?void 0:a.length)||0," / ",ue.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:o.note||"",onChange:c=>{s({note:""}),n({note:c.target.value.slice(0,ue.PROJECT.MAX_NOTE_LENGTH)})},error:!!r.note,helperText:r.note||"",sx:{mt:3}})]})})}dt.propTypes={readOnly:d.bool.isRequired,params:d.object.isRequired,setParams:d.func.isRequired,paramsErrTip:d.object.isRequired,setParamsErrTip:d.func.isRequired,loading:d.bool.isRequired};dt.defaultProps={};function hs(e){for(const o in e)typeof e[o]=="string"?e[o]=e[o].replace(/\\\\/g,"\\"):typeof e[o]=="object"&&e[o]!==null&&hs(e[o]);return e}function ut({index:e,item:o,dockerParams:n,setDockerParams:r,dataKey:s,t:i,readOnly:l}){const a=(o==null?void 0:o.value)||"",[c,p]=v.useState(!1),f=()=>{var z;(z=n[s])==null||z.splice(e,1),r({...n,[s]:[...n[s]]})},g=(z,y)=>{var T;(T=n[s])!=null&&T[e]&&(y?(n[s][e].custom=n[s][e].value,n[s][e].value=`$${wt(o.key)}`):(n[s][e].value=n[s][e].custom||"",n[s][e].custom="")),r({...n,[s]:[...n[s]]})},k=(z,y)=>{var $;const T=(($=n[s][e])==null?void 0:$.value)||"";n[s][e]={...n[s][e],secure:y,value:y&&T===ue.BLOCKLET_AUTOMATIC_ENV_VALUE?"":T},r({...n,[s]:[...n[s]]})},h=(z,y)=>{n[s][e]={...n[s][e],shared:y},r({...n,[s]:[...n[s]]})},m=(z,y)=>{var $;const T=(($=n[s][e])==null?void 0:$.value)||"";n[s][e]={...n[s][e],required:y,value:y&&T===ue.BLOCKLET_AUTOMATIC_ENV_VALUE?"":T},r({...n,[s]:[...n[s]]})},w=(z,y)=>{n[s][e]={...n[s][e],value:y?ue.BLOCKLET_AUTOMATIC_ENV_VALUE:"",secure:!1,required:!1},r({...n,[s]:[...n[s]]})},D=z=>{n[s][e]={...n[s][e],description:z.target.value},r({...n,[s]:[...n[s]]})},x=z=>{const y=z.target.value==="web"?"web":"docker";y==="web"&&n.dockerArgs.forEach(C=>{C.type="docker"});const $=`/${n.dockerImage.replace(/\W/g,"-")}-${e}`;n.dockerArgs[e]={...n.dockerArgs[e],type:y,path:y==="docker"?$:"/",protocol:"http",prefix:y==="docker"?$:"/",name:"publicUrl",port:"BLOCKLET_PORT"},r({...n,dockerArgs:[...n.dockerArgs]})},b=z=>{n.dockerArgs[e]={...n.dockerArgs[e],proxyBehavior:z.target.value==="direct"?"direct":"service"},r({...n,dockerArgs:[...n.dockerArgs]})},j=z=>{const y=z.target.value;n[s][e]={...n[s][e],prefix:y,path:y==="*"?"/":y},r({...n,[s]:[...n[s]]})},_=z=>{var y;(y=n[s])!=null&&y[e]&&(n[s][e].value=z.target.value),r({...n,[s]:[...n[s]]})},N=a===`$${wt(o.key)}`||o.custom,R=s==="dockerArgs"&&!Tn[o.key],q=ar[o.key],S=s==="dockerEnvs",I=o.key==="--publish";let W=o.key;return I&&o.type==="web"?W="--publish (Web)":S&&(W=`--env ${o.key}`),t.jsxs(u,{sx:{display:"flex",flexDirection:"row",gap:2,alignItems:"center"},children:[t.jsx(u,{sx:{width:250},children:t.jsx(E,{sx:{textOverflow:"ellipsis",width:"100%",overflow:"hidden"},children:W})}),t.jsxs(u,{sx:{display:"flex",flexDirection:"column",gap:1,flex:1},children:[t.jsx(oe,{disabled:l||N||R||o.value===ue.BLOCKLET_AUTOMATIC_ENV_VALUE,placeholder:"",value:N?`$${wt(o.key)}`:a,sx:{flex:1},InputProps:{endAdornment:t.jsxs(Qe,{position:"end",sx:{zoom:.9},children:[(!(q||R)||S||I)&&t.jsx(ce,{onClick:()=>p(!0),children:t.jsx(ae,{icon:"icon-park-outline:setting-config"})}),!l&&t.jsx(ce,{onClick:f,color:R?"error":"default",children:t.jsx(ae,{icon:"ic:round-delete"})})]})},error:R,onChange:_}),R&&t.jsx(E,{variant:"caption",color:"error",children:i("blocklet.publish.docker.noAllowTheArg")}),o.key==="--publish"&&t.jsx(E,{variant:"caption",color:"text.secondary",children:i("blocklet.publish.docker.publishTips")}),o.key==="--volume"&&dr[o.key](a)&&t.jsx(E,{variant:"caption",color:"error",children:i("blocklet.publish.docker.volumeTips")})]}),c&&t.jsx(Vt,{open:!0,fullWidth:!0,maxWidth:"sm",PaperProps:{style:{minHeight:0}},title:i(S?"blocklet.publish.docker.modifyEnv":"blocklet.publish.docker.modifyParam"),onClose:()=>p(!1),children:t.jsxs(u,{sx:{display:"flex",flexDirection:"column",gap:1,paddingBottom:2},children:[q||R||S?null:t.jsxs(u,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[t.jsx(E,{children:i("blocklet.publish.docker.needCustomInput")}),t.jsx(Te,{disabled:l,checked:N,onChange:g,sx:{zoom:.9}})]}),S&&t.jsxs(u,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[t.jsx(E,{children:i("blocklet.publish.docker.shared")}),t.jsx(Te,{disabled:l,checked:o.shared,onChange:h,sx:{zoom:.9}})]}),S&&t.jsxs(u,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[t.jsx(E,{children:i("blocklet.publish.docker.required")}),t.jsx(Te,{disabled:l,checked:o.required,onChange:m,sx:{zoom:.9}})]}),S&&t.jsxs(u,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[t.jsx(E,{children:i("blocklet.publish.docker.secure")}),t.jsx(Te,{disabled:l,checked:o.secure,onChange:k,sx:{zoom:.9}})]}),S&&t.jsxs(u,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[t.jsx(E,{children:i("blocklet.publish.docker.autoGenerated")}),t.jsx(Te,{disabled:l,checked:o.value===ue.BLOCKLET_AUTOMATIC_ENV_VALUE,onChange:w,sx:{zoom:.9}})]}),S&&t.jsxs(u,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[t.jsx(E,{sx:{flex:1},children:i("blocklet.publish.docker.description")}),t.jsx(oe,{disabled:l,value:o.description,onChange:D,sx:{flex:1},label:i("blocklet.publish.docker.description")})]}),I&&t.jsxs(u,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[t.jsx(E,{sx:{flex:1},children:i("blocklet.publish.docker.portType")}),t.jsxs(Tt,{value:o.type||"docker",onChange:x,children:[t.jsx(he,{value:"docker",children:"Docker"}),t.jsx(he,{value:"web",children:"Web"})]})]}),I&&o.type==="web"&&t.jsxs(u,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[t.jsx(E,{sx:{flex:1},children:i("blocklet.publish.docker.proxyBehavior")}),t.jsxs(Tt,{value:o.proxyBehavior||"service",onChange:b,children:[t.jsx(he,{value:"service",children:i("blocklet.publish.docker.serviceProxy")}),t.jsx(he,{value:"direct",children:i("blocklet.publish.docker.directProxy")})]})]}),I&&o.type==="web"&&t.jsxs(u,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[t.jsx(E,{sx:{flex:1},children:i("blocklet.publish.docker.prefix")}),t.jsx(oe,{disabled:l,value:o.prefix,onChange:j,sx:{flex:1},label:i("blocklet.publish.docker.prefix")})]})]})})]})}ut.propTypes={dockerParams:d.object.isRequired,setDockerParams:d.func.isRequired,dataKey:d.string.isRequired,item:d.object.isRequired,t:d.func.isRequired,readOnly:d.bool.isRequired,index:d.number.isRequired};ut.defaultProps={};const gi=`
173
- docker run --name postgrest
174
- -p 3000:3000
175
- -e PGRST_DB_URI="postgres://username:password@host:port/database"
176
- -e PGRST_DB_SCHEMA="public"
177
- -e PGRST_DB_ANON_ROLE="anon"
178
- postgrest/postgrest
179
- `.trim();function So({readOnly:e,paramsErrTip:o,setParamsErrTip:n,error:r,params:s,setParams:i}){const{t:l}=te(),[a,c]=v.useState("dockerParams"),[p,f]=v.useState(""),[g,k]=v.useState(!1),[h,m]=v.useState("--volume"),[w,D]=v.useState(""),[x,b]=v.useState(Wo(p)),j=x.dockerArgs||[],_=x.dockerEnvs||[],N=x.dockerImage||"",R=x.dockerCommand||"",q=T=>{const{value:$}=T.target;f($)};v.useEffect(()=>{s.blockletDocker&&s.blockletDocker.dockerImage&&!N&&b(s.blockletDocker)},[s,N,b]);const S=T=>{const $=Wo(T.target.value);b(C=>{let P,J=!1;return $.dockerArgs.forEach(F=>{const le=C.dockerArgs.find(K=>K.key===F.key);le&&(Object.entries(le).forEach(([K,ee])=>{ee!=null&&K!=="value"&&(F[K]=ee)}),F.proxyBehavior=F.proxyBehavior||"server",F.type==="web"&&(F.path="/",F.protocol="http",F.prefix="/",F.name="publicUrl",F.port="BLOCKLET_PORT",J=!0),!P&&F.key==="--publish"&&(P=F))}),!J&&P&&(P.type="web",P.path="/",P.protocol="http",P.prefix="/",P.name="publicUrl",P.port="BLOCKLET_PORT"),$.dockerEnvs.forEach(F=>{const le=C.dockerEnvs.find(K=>K.key===F.key);le&&Object.entries(le).forEach(([K,ee])=>{ee!=null&&K!=="value"&&(F[K]=ee)})}),$})},I=()=>{if(k(!1),h==="--env"){b({...x,dockerEnvs:[..._,{key:w,value:"",custom:"",secure:!1,shared:!1,required:!1,description:w}]}),D("");return}b({...x,dockerArgs:[...j,{key:h,value:"",type:"docker",name:"",path:"",prefix:"",protocol:""}]})},W=()=>{k(!1),D("")},z=T=>{const{value:$}=T.target;b({...x,dockerImage:$}),$.indexOf(" ")>-1?n({...o,dockerImageName:l("blocklet.publish.docker.dockerImageNameError")}):n({...o,dockerImageName:""})},y=T=>{const{value:$}=T.target;b({...x,dockerCommand:$});try{pr($),n({...o,dockerCMD:""})}catch{n({...o,dockerCMD:l("blocklet.publish.docker.dockerCMDError")})}};return v.useEffect(()=>{a==="dockerCommand"&&f(ur(x))},[x,a]),v.useEffect(()=>{i(T=>({...T,blockletDocker:{dockerImage:x.dockerImage,dockerCommand:x.dockerCommand,dockerArgs:x.dockerArgs,dockerEnvs:x.dockerEnvs}}))},[x,i]),t.jsxs(u,{sx:{mt:3},children:[t.jsxs(u,{sx:{width:"100%",display:"flex",flexDirection:"column",gap:2},children:[t.jsx(u,{sx:{borderBottom:1,borderColor:"divider",mb:2},children:t.jsxs(yn,{value:a,onChange:(T,$)=>c($),children:[t.jsx(it,{value:"dockerParams",label:l("blocklet.publish.docker.dockerParams")}),t.jsx(it,{value:"dockerCommand",label:l("blocklet.publish.docker.dockerCommand")})]})}),a==="dockerCommand"&&t.jsx(oe,{disabled:e,label:l("blocklet.publish.docker.pleaseInputDockerCommand"),placeholder:gi,InputProps:{"data-cy":"blocklet-docker-command",readOnly:e},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,spellCheck:!1,minRows:10,value:p,onChange:q,onBlur:S}),a==="dockerParams"&&t.jsxs(u,{sx:{display:"flex",flexDirection:"column",gap:2},children:[t.jsx(oe,{disabled:e,label:l("blocklet.publish.docker.dockerImageName"),placeholder:"Example: docker.io/postgrest/postgrest:latest",value:N,sx:{flex:1},color:o.dockerImageName?"error":"primary",error:!!o.dockerImageName,helperText:o.dockerImageName||"",onChange:z}),t.jsx(oe,{disabled:e,label:`Docker CMD (${l("common.optional")})`,placeholder:"Docker CMD",value:R,sx:{flex:1},color:o.dockerCMD?"error":"primary",error:!!o.dockerCMD,helperText:o.dockerCMD||"",onChange:y}),t.jsx(u,{sx:{height:4}}),j.map((T,$)=>t.jsx(ut,{index:$,item:T,dockerParams:x,setDockerParams:b,dataKey:"dockerArgs",t:l,readOnly:e},`${T.key}-${$}`)),_.map((T,$)=>t.jsx(ut,{index:$,item:T,dockerParams:x,setDockerParams:b,dataKey:"dockerEnvs",t:l,readOnly:e},`${T.key}-${$}`)),!e&&t.jsxs(u,{sx:{display:"flex",flexDirection:"row",gap:2,alignItems:"center"},children:[t.jsx(u,{sx:{flex:1}}),t.jsx(ne,{onClick:()=>k(!0),children:l("blocklet.publish.docker.addItem")})]})]})]}),!!r&&t.jsx(u,{color:"error.main",mt:1,fontSize:14,children:r}),g&&t.jsxs(ft,{fullWidth:!0,open:!0,children:[t.jsx(gn,{children:l("blocklet.publish.docker.addItem")}),t.jsx(kn,{children:t.jsxs(Es,{sx:{mt:1,width:"100%",minWidth:480,maxWidth:"100%"},children:[t.jsx(Tt,{labelId:"demo-simple-select-helper-label",id:"demo-simple-select-helper",value:h,sx:{width:"100%"},onChange:T=>m(T.target.value),children:Object.keys(Tn).map(T=>t.jsx(he,{value:T,children:T}))}),h==="--publish"&&t.jsx(E,{variant:"caption",color:"text.secondary",children:l("blocklet.publish.docker.publishTips")}),h==="--volume"&&t.jsx(E,{variant:"caption",color:"text.secondary",children:l("blocklet.publish.docker.volumeTips")}),h==="--env"&&t.jsxs(u,{sx:{mt:3,width:"100%"},children:[t.jsx(oe,{value:w,onChange:T=>D(T.target.value),sx:{width:"100%"},label:l("blocklet.publish.docker.envKey")}),t.jsx(Os,{children:l("blocklet.publish.docker.dockerArgValue")})]})]})}),t.jsxs(jn,{children:[t.jsx(ne,{onClick:W,children:l("common.cancel")}),t.jsx(ne,{onClick:I,children:l("common.confirm")})]})]})]})}So.propTypes={readOnly:d.bool.isRequired,params:d.object.isRequired,setParams:d.func.isRequired,error:d.string.isRequired,setParamsErrTip:d.func.isRequired,paramsErrTip:d.func.isRequired};So.defaultProps={};const ki=({tabs:e,blocklet:o,ancestors:n=[]})=>{const r=o.meta.did;e.push({label:t.jsxs(u,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[t.jsx(Ht,{size:24,blocklet:o,ancestors:n}),t.jsx(u,{ml:"4px",className:"text",children:t.jsx(u,{children:o.meta.title})})]},r),value:r})},cn=(e,o)=>{const n=Jt(e,["blockletVersion","blockletTitle","blockletDescription","blockletLogo","blockletIntroduction","blockletVideos","blockletScreenshots","blockletResourceType","blockletSupport","blockletHomepage","blockletCommunity","blockletRepository","blockletDocker","contentType","connectedStores","blockletComponents","lastReleaseId","uploadedResource","autoUpload","possibleSameStore","note"]);return n.blockletComponents?n.blockletComponents=n.blockletComponents.map(r=>({...r,included:!0})):n.blockletComponents=(o.children||[]).map(r=>({did:r.meta.did,included:!1,required:!1})),n},ji={0:"branding",1:"introduction",2:"resources",3:"blocklets",4:"version"},an={branding:0,introduction:1,resources:2,blocklets:3,version:4};function Io({initUrl:e,...o}){var _o,Po;const{projectId:n,mode:r,releaseId:s,componentDid:i=""}=pt(),{t:l}=te(),{blocklet:a}=Me(),[c,p]=De({blockletScreenshots:[],blockletVideos:[],publishedStoreIds:[],connectedStores:[],uploadedResource:"",contentType:"blocklet",blockletResourceType:"",blockletSupport:"",blockletCommunity:"",blockletHomepage:"",blockletRepository:"",blockletDocker:{dockerImage:"",dockerArgs:[],dockerEnvs:[]}}),[f,g]=De({}),[k,h]=De({}),[m,w]=v.useState(!1),[D,x]=De(null),{api:b}=ve(),j=Ae(L=>L.breakpoints.down("md")),[_,N]=v.useState({}),[R,q]=v.useState(!1),S=v.useRef({}),[I,W]=De({}),[z,y]=v.useState(""),[T,$]=De({}),C=e==null?void 0:e.searchParams.get("dependentComponentsMode"),P=C==="readonly",{session:J}=Ye(),{storeList:F}=po({fromBlocklet:!0,blocklet:a,componentDid:i,userDid:(_o=J==null?void 0:J.user)==null?void 0:_o.did}),[le,K]=v.useState([]);v.useEffect(()=>{Array.isArray(F)&&F.length>0&&Promise.all(F.map(async L=>({...(await(await fetch(`${L.url}/__blocklet__.js?type=json`)).json()).preferences,storeInfo:L}))).then(L=>{K(L)})},[F.length]),v.useEffect(()=>{const L={},O={},{logoUrl:pe,screenshotUrls:Re}=zn(c,a,n);Promise.all(le.map(async fe=>{const{maxImageCount:$e,minImageCount:xt,logoImageType:Se,imageMinHeight:Lo,imageMinWidth:qo}=fe,et=Array.isArray(Se)?Se:Se.split(",");L[fe.storeInfo.url]||(L[fe.storeInfo.url]={}),O[fe.storeInfo.url]||(O[fe.storeInfo.url]={});const gt=O[fe.storeInfo.url],ks=L[fe.storeInfo.url];Number($e)<=Re.length&&(gt.maxImageCount=l("blocklet.publish.storeRule.maxImageCount",{max:$e,count:Re.length,unit:$e>1?l("blocklet.publish.storeRule.screenshots"):l("blocklet.publish.storeRule.screenshot")})),Number(fe.minImageCount)>Re.length&&(gt.minImageCount=l("blocklet.publish.storeRule.minImageCount",{min:xt,count:Re.length,unit:xt>1?l("blocklet.publish.storeRule.screenshots"):l("blocklet.publish.storeRule.screenshot")}));const $o=pe?pe.split(".").pop():"";$o&&!(et.includes("jpg")?[...et,"jpeg"]:et).includes($o)&&(ks.logoFormat=l("blocklet.publish.storeRule.logoFormat",{format:et.join(",")})),await Promise.all(Re.map((js,kt)=>{const jt=new Image;return jt.src=js,new Promise(ys=>{jt.onload=()=>{const{width:vs,height:ws}=jt;if(vs<Number(qo)||ws<Number(Lo)){let Ve="";switch(kt+1){case 1:Ve=l("blocklet.publish.storeRule.first");break;case 2:Ve=l("blocklet.publish.storeRule.second");break;case 3:Ve=l("blocklet.publish.storeRule.third");break;default:Ve=`${kt+1}`;break}gt[`imageSize-${kt+1}`]=l("blocklet.publish.storeRule.minImageSize",{width:qo,height:Lo,name:Ve})}ys()}})}))})).then(()=>{const fe=Object.values(L).some(Se=>Object.values(Se).length>0),$e=Object.values(O).some(Se=>Object.values(Se).length>0);h({logoErrors:L,screenshotErrors:O,storeList:F,hasWarning:fe||$e,hasLogoWarning:fe,hasScreenshotWarning:$e})})},[c,a.did,n,le,l]);const ee=v.useMemo(()=>{const L={};return Object.keys(T).forEach(O=>{const pe=T[O];pe&&pe.forEach(Re=>{L[Re]=!0})}),L},[T]),ze=v.useCallback(L=>{P&&p({blockletComponents:[]}),$(L)},[P,$,p]),A=v.useCallback((...L)=>{W(...L),g({blockletResource:"",blockletDocker:""})},[]),U=s==="none"?(c==null?void 0:c.lastReleaseId)||"":s,[H,Y]=v.useState(r==="new-release"?4:0),X=e==null?void 0:e.searchParams.get("resourcesTitle"),ie=e==null?void 0:e.searchParams.get("componentsTitle"),Q=[{label:l("blocklet.publish.branding"),description:l("blocklet.publish.steps.branding")},{label:l("common.introduction"),description:l("blocklet.publish.steps.introduction")},{label:X||l("blocklet.publish.resourceTitle"),description:l("blocklet.publish.steps.resources")},{label:ie||l("common.components"),description:l("blocklet.publish.steps.blocklets")},{label:l("blocklet.publish.versionTitle"),description:l("blocklet.publish.steps.version")}],de=Q[H]||Q[Q.length-1],Z=ji[H];v.useEffect(()=>{n&&g({projectId:""})},[n,g]);const Ce=v.useMemo(()=>{var L;return(c==null?void 0:c.blockletResourceType)==="resource"?"resource":(L=c==null?void 0:c.blockletComponents)!=null&&L.some(O=>O.included)||Object.keys(ee).length||c!=null&&c.uploadedResource?"pack":"resource"},[c==null?void 0:c.blockletComponents,c==null?void 0:c.uploadedResource,ee,c==null?void 0:c.blockletResourceType]),M=[],Pe=((a==null?void 0:a.children)||[]).filter(L=>{var O;return(O=L.meta.resource)==null?void 0:O.exportApi}).filter(L=>!i||L.meta.did===i);Pe.forEach(L=>{ki({tabs:M,blocklet:L,t:l,ancestors:[a]})});const[Be,Ke]=v.useState((Po=M[0])==null?void 0:Po.value),We=!R&&(D==null?void 0:D.status)==="published",re=We,Le=tr(()=>{if(!e)return;y(e.searchParams.get("logo")),p(O=>{var pe;return{...O,blockletTitle:(O==null?void 0:O.blockletTitle)||e.searchParams.get("title"),blockletDescription:(O==null?void 0:O.blockletDescription)||e.searchParams.get("description"),blockletIntroduction:(O==null?void 0:O.blockletIntroduction)||e.searchParams.get("introduction")||e.searchParams.get("description"),blockletComponents:(pe=O==null?void 0:O.blockletComponents)!=null&&pe.length?O==null?void 0:O.blockletComponents:JSON.parse(e.searchParams.get("components")||"[]"),note:(O==null?void 0:O.note)||e.searchParams.get("note")||"No note"}});const L=e.searchParams.get("resources");try{const O=JSON.parse(L);N(O)}catch{}}),B=async()=>{if(U)try{const L=await b.getRelease({input:{did:a.meta.did,projectId:n,releaseId:U}});if(w(!1),!L.release){V.error("Release not found");return}L.release.note=$n(L.release.note,"note"),L.release=hs(L.release),r!=="view"&&(L.release.note=""),p(O=>cn({...O,...L.release,blockletVersion:r==="create"||r==="new-release"?Ne.inc(L.release.blockletVersion,"patch"):L.release.blockletVersion},a)),x(L.release)}catch(L){w(!1),V.error(Ee(L))}},se=async()=>{if(n===G.UNOWNED_DID){p({blockletVersion:"0.0.1",blockletTitle:""});return}if(!n){V.error(l("blocklet.publish.errorTip.noDid"));return}try{const O=(await An(b.getProject,[{input:{did:a.meta.did,projectId:n}}],{key:"getProject"})).project||{};O.blockletVersion?(r==="create"||r==="new-release")&&Ne.valid(O.blockletVersion)&&(O.blockletVersion=Ne.inc(O.blockletVersion,"patch")):O.blockletVersion="0.0.1";const pe=cn(O,a);p(pe),O.lastReleaseId||Le()}catch(L){V.error(Ee(L))}},qe=v.useCallback(async()=>{w(!0);try{if(r==="view"){if(!U){V.error("Empty release id");return}await se(),await B();return}await se(),U&&(q(!0),await B())}finally{w(!1)}},[r,U]),bs=L=>{p({blockletComponents:L})},xs=L=>{p({blockletResourceType:L})};v.useEffect(()=>{qe()},[qe]),v.useEffect(()=>{n===G.UNOWNED_DID&&(r==="create"||r==="new-release")&&e&&Le()},[n,e,r,Le]),v.useEffect(()=>{c.contentType==="docker"?p({resourceFromSelect:!1}):c.contentType==="blocklet"?p({resourceFromSelect:!0}):c.contentType==="upload"&&p({resourceFromSelect:!1})},[c.contentType,p]);const Do=v.useMemo(()=>!!Object.keys(I).find(L=>!!I[L].length),[I]);if(!c&&m)return t.jsx(Ze,{});if(!c)return null;const To=Pe.find(L=>L.meta.did===Be),gs=L=>{Ke(L)};return t.jsxs(yi,{...o,children:[t.jsx(ds,{blocklet:a,release:D,getData:qe,getRelease:B,mode:r,params:c,setParams:p,setParamsErrTip:g,warning:k,readOnly:re,isPublished:We,loading:m,setLoading:w,initLogoUrl:z,releaseId:U,projectId:n,projectType:Ce,resourceComponents:Pe,resourceComponentsMap:T,resourceRelateComponents:ee,resourceItem:To,saveSelectedEventsRef:S,hasSelectedResources:Do,releaseUsedLast:R,setReleaseUsedLast:q,setRelease:x,paramsErrTip:f}),t.jsxs(u,{display:"flex",flexDirection:"column",sx:{width:"100%"},children:[t.jsx(u,{pt:3}),t.jsxs(u,{sx:{gap:3},display:"flex",flexDirection:j?"column":"row",children:[!j&&t.jsx(fs,{steps:Q,loading:m,viewMode:r==="view",params:c,hasSelectedResources:Do||c.uploadedResource,paramsErrTip:f,warning:k,activeStep:H,setActiveStep:Y,projectId:n,resourcesUrlTitle:X,componentsUrlTitle:ie}),t.jsxs(u,{flex:"1",maxWidth:"720px",children:[!j&&Z!=="introduction"&&t.jsxs(E,{variant:"h6",fontWeight:"bold",display:"flex",flexDirection:"row",alignItems:"center",children:[de.label,Z==="branding"&&t.jsx(xe,{title:l("blocklet.publish.brandingHelp"),placement:"right",children:t.jsx(u,{component:"a",target:"_blank",href:"https://www.arcblock.io/docs/blocklet-store/en/blocklet-detail-page",sx:{paddingTop:1,marginLeft:1},style:{color:"gray"},children:t.jsx(er,{})})})]}),(j||Z==="branding")&&t.jsx(u,{flexDirection:"column",children:t.jsx(rs,{projectId:n,setParams:p,setParamsErrTip:g,warning:k,params:c,componentDid:i,blocklet:a,initUrl:e,loading:m,setLoading:w,paramsErrTip:f,readOnly:re,initLogoUrl:z,setInitLogoUrl:y})}),j&&t.jsx(u,{flexDirection:"column",children:t.jsx(dt,{loading:m,params:c,paramsErrTip:f,setParams:p,setParamsErrTip:g,readOnly:re})}),(j||Z==="introduction")&&t.jsx(u,{display:"flex",flexDirection:"column",sx:{mt:j?5:0,width:"100%"},children:t.jsx(ps,{loading:m,readOnly:re,params:c,setParams:p,paramsErrTip:f,setParamsErrTip:g})}),j&&t.jsx(E,{variant:"h6",fontWeight:"bold",mt:5,children:Q[an.resources].label}),t.jsx(u,{sx:{maxWidth:720},display:j||Z==="resources"?"flex":"none",flexDirection:"column",children:t.jsx(u,{display:"flex",mt:3,className:"section full-width",children:t.jsxs(u,{sx:{flex:1},children:[t.jsxs(Ms,{onChange:L=>p({contentType:L.target.value}),children:[t.jsx(nt,{value:"blocklet",disabled:re,control:t.jsx(vt,{size:"small",checked:c.contentType==="blocklet"}),label:l("blocklet.publish.resourceSelect")}),t.jsx(nt,{value:"upload",disabled:re,control:t.jsx(vt,{size:"small",checked:c.contentType==="upload"}),label:l("blocklet.publish.resourceUpload")}),t.jsx(nt,{value:"docker",disabled:re,control:t.jsx(vt,{size:"small",checked:c.contentType==="docker"}),label:l("blocklet.publish.resourceDocker")})]}),t.jsxs(u,{display:c.contentType==="blocklet"?"block":"none",children:[!i&&t.jsx(Gs,{tabs:M,current:Be,onChange:gs,sx:{ml:-2,mt:2,maxWidth:j?window.innerWidth-24:"100%"}}),t.jsx(ao,{loading:m,initialResources:_,saveSelectedEventsRef:S,selectedResourceIds:I,setSelectedResourceIds:A,setResourceComponentsMap:ze,error:f.blockletResource,app:a,readOnly:re,component:To,componentDid:i,initUrl:e,params:c,showTree:c.contentType==="blocklet",setParams:p,projectId:n===G.UNOWNED_DID?"":n,releaseUsedLast:R,release:{...D,id:U}})]}),c.contentType==="upload"&&t.jsx(Ro,{app:a,readOnly:re,projectId:n===G.UNOWNED_DID?"":n,params:c,error:f.blockletResource,setParams:p,setParamsErrTip:g}),c.contentType==="docker"&&t.jsx(So,{app:a,readOnly:re,projectId:n===G.UNOWNED_DID?"":n,params:c,error:f.blockletResource,setParams:p,setParamsErrTip:g,paramsErrTip:f})]})})}),j&&t.jsx(E,{variant:"h6",fontWeight:"bold",mt:5,children:Q[an.blocklets].label}),(j||Z==="blocklets")&&t.jsx(u,{flexDirection:"column",children:t.jsx(u,{display:"flex",mt:3,className:"section full-width",children:t.jsx(u,{sx:{flex:1},children:t.jsx(so,{projectType:Ce,disabled:m||re,app:a,value:(c==null?void 0:c.blockletComponents)||[],blockletResourceType:(c==null?void 0:c.blockletResourceType)||"",onChange:bs,onChangeBlockletResourceType:xs,resourceRelateComponents:ee,dependentComponentsMode:C})})})}),!j&&Z==="version"&&t.jsx(u,{flexDirection:"column",children:t.jsx(dt,{loading:m,params:c,paramsErrTip:f,setParams:p,setParamsErrTip:g,readOnly:re})})]})]})]})]})}Io.propTypes={initUrl:d.object};Io.defaultProps={initUrl:null};const yi=ge.div`
180
- .section {
181
- &.full-width {
182
- max-width: 100%;
183
- }
184
- .MuiTypography-h3 {
185
- font-size: 1.1rem;
186
- font-weight: 700;
187
- }
188
- .left {
189
- flex-shrink: 0;
190
- width: 140px;
191
- }
192
- .MuiTabs-indicator {
193
- display: none;
194
- }
195
- .MuiTypography-subtitle1 {
196
- width: 120px;
197
- font-weight: 700;
198
- font-size: 1rem;
199
- ${({theme:e})=>e.breakpoints.down("sm")} {
200
- width: 80px;
201
- }
202
- }
203
- }
204
- .MuiButtonBase-root {
205
- a {
206
- color: inherit;
207
- }
208
- }
209
- .MuiInputBase-multiline .MuiInputAdornment-positionEnd {
210
- align-self: flex-end;
211
- .MuiTypography-root {
212
- font-size: 0.8rem;
213
- }
214
- font-size: 0.8rem;
215
- }
216
- `;function ms({padding:e,initUrl:o}){const{blocklet:n}=Me(),r=Cs(),{componentDid:s}=pt();if(v.useEffect(()=>{if(s&&window.parent){const l=`${r.pathname}${r.search}`;window.parent.postMessage({event:"popstate",page:"publish",componentDid:s,path:l},"*")}},[s,r]),!n)return null;const i={};return e&&(i.padding=e),t.jsx(vi,{style:i,children:t.jsxs(Rs,{children:[t.jsx(yt,{path:"/",element:t.jsx(to,{initUrl:o})}),t.jsx(yt,{path:"/:projectId",element:t.jsx(_r,{})}),t.jsx(yt,{path:"/:projectId/:mode/:releaseId",element:t.jsx(Io,{initUrl:o})})]})})}ms.propTypes={padding:d.oneOfType([d.string,d.number]),initUrl:d.object};ms.defaultProps={padding:"",initUrl:null};const vi=ge(u)`
217
- a {
218
- color: ${({theme:e})=>e.palette.primary.main};
219
- }
220
- `;export{ms as default};
@@ -1 +0,0 @@
1
- import{j as o}from"./vendor-mui-core-O22FPGM4.js";import"./vendor-react-DoD83n6N.js";import{S as t}from"./studio-oozJB1Q3.js";import"./vendor-ux-did-connect-BUS40ceY.js";import"./vendor-utils-DJ1bmiuG.js";import"./vendor-hooks-DbRTDIFw.js";import"./lottie-web-B6s7dDoL.js";import"./vendor-arcblock-BkdpkIRL.js";function e(){return o.jsx(t,{children:"Coming soon..."})}export{e as default};
@@ -1 +0,0 @@
1
- import{t as n,j as i,a3 as l}from"./vendor-mui-core-O22FPGM4.js";import{l as d,r as c}from"./vendor-react-DoD83n6N.js";import{u,ak as h}from"./vendor-ux-did-connect-BUS40ceY.js";import g from"./index-Bm1Z6vIr.js";import"./vendor-utils-DJ1bmiuG.js";import"./vendor-hooks-DbRTDIFw.js";import"./lottie-web-B6s7dDoL.js";import"./index-Do_PTy2g.js";import"./vendor-arcblock-BkdpkIRL.js";import"./Error-CXMTbOyQ.js";import"./confirm-CVR4a5FI.js";import"./format-error-LAoTjvJe.js";import"./session-BcGa2Lwu.js";import"./did-address-Dx-4WAXQ.js";import"./react-beautiful-dnd.esm-Z01y4hUy.js";import"./raf-schd.esm-GV-XhwE0.js";import"./bundle-avatar-Chdo4m6E.js";import"./shorten-label-DXrhdUJE.js";import"./list-header-Bzt7zKtS.js";import"./Download-OmIe8_8C.js";import"./click-to-copy-fQS5t8fq.js";import"./QuestionMarkCircle-D4HZAY1P.js";import"./useSetState-BL3ktMon.js";import"./index-tUQxVYYQ.js";import"./index-C46rA4HG.js";import"./index-B6Y7SW3z.js";import"./api-D2GjOmnt.js";import"./ChevronRight-OJJ2SUEU.js";import"./vendor-mui-x-K-9WHqhO.js";import"./DeleteOutline-C954mj84.js";import"./item-3tNefK7M.js";import"./Launch-Do09YVNX.js";import"./Done-BXwXbLQs.js";import"./delete-confirm-CCY-Xpk5.js";import"./get-safe-url-C42wIqi-.js";import"./ArrowDropDown-Do4OWmCn.js";import"./index-oXEi5lCg.js";import"./index-Aq7Gmh7c.js";const r=new URL(window.location.href),s=r.searchParams.get("mode")==="dialog",w=s?"":r.searchParams.get("padding")||"";function to(){const{t:p}=u(),{componentDid:o}=d(),m=n(t=>t.breakpoints.down("md")),a=t=>{t.stopPropagation(),window.parent.postMessage({event:"resourceDialog.close",componentDid:o},"*")};c.useEffect(()=>{window.parent.postMessage({event:"resourceDialog.loaded",componentDid:o},"*")},[o]);const e=i.jsx(g,{padding:w,initUrl:r});return s?i.jsx(h,{className:"studio-dialog",title:p("blocklet.publish.blockletStudio"),maxWidth:!1,fullWidth:!1,PaperProps:{style:m?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:a,showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:i.jsx(l,{sx:{height:"72vh",overflow:"auto",position:"relative"},children:e})}):e}export{to as default};
@@ -1 +0,0 @@
1
- import{Q as o}from"./vendor-ux-did-connect-BUS40ceY.js";const e=new o;export{e as b};
@@ -1,19 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/connect-D_mrUgoL.js","assets/vendor-mui-core-O22FPGM4.js","assets/vendor-react-DoD83n6N.js","assets/vendor-utils-DJ1bmiuG.js","assets/useAsync-CDzQ0uN6.js","assets/vendor-hooks-DbRTDIFw.js","assets/vendor-ux-did-connect-BUS40ceY.js","assets/lottie-web-B6s7dDoL.js","assets/vendor-ux-did-connect-DhgPdlEj.css","assets/index-Do_PTy2g.js","assets/vendor-arcblock-BkdpkIRL.js","assets/config-C-1jeE31.js","assets/index-CKGdCheG.js","assets/Done-BXwXbLQs.js","assets/Google-jC4aGgA_.js","assets/cloneDeep-SKWOTeUJ.js","assets/logo-uploader-Dh1aL_OF.js","assets/index-tUQxVYYQ.js","assets/page-header-C2MPWR-H.js","assets/layout-ceT4Awul.js","assets/content-layout--DV54O6i.js","assets/step-actions-D4sVdJ5W.js","assets/button-BSP6Y6OJ.js","assets/index-BFV3n5Hy.js","assets/config-space-6wpekLZ1.js","assets/api-D2GjOmnt.js","assets/connect-to-BhxyRPHq.js","assets/DeleteOutline-C954mj84.js","assets/format-error-LAoTjvJe.js","assets/domain-DHb1Ps_o.js","assets/domain-action-card-BNfDBQhX.js","assets/ExpandLess-xJAJmJam.js","assets/permission-DXzAY72t.js","assets/session-BcGa2Lwu.js","assets/useAsyncRetry-CcF3e_P6.js","assets/confirm-CVR4a5FI.js","assets/actions-4OuC0GHy.js","assets/MoreHoriz-CU3bPiks.js","assets/delete-confirm-CCY-Xpk5.js","assets/click-to-copy-fQS5t8fq.js","assets/shorten-label-DXrhdUJE.js","assets/util-DfhJqpch.js","assets/useSetState-BL3ktMon.js","assets/InfoOutlined-Dto4CBtr.js","assets/index-F9fg_Rq5.js","assets/CheckCircle-DDHElFhm.js","assets/access-control-BWBOA4g6.js","assets/config-mzUmZpxy.js","assets/fuel-SLm_JOs-.js","assets/Launch-Do09YVNX.js","assets/did-address-Dx-4WAXQ.js","assets/complete--VG1kQVy.js","assets/launch-result-message-WNYdod-D.js","assets/get-safe-url-Cn4KEro2.js"])))=>i.map(i=>d[i]);
2
- import{S as Q,_ as d,L as W}from"./vendor-arcblock-BkdpkIRL.js";import{j as e,a9 as T,t as q,e as K,bt as G,a3 as X,a2 as J,b3 as Y}from"./vendor-mui-core-O22FPGM4.js";import{f as ee,k as te,r as i,h as se,i as c,j as oe}from"./vendor-react-DoD83n6N.js";import{x as o}from"./vendor-utils-DJ1bmiuG.js";import{u as ae,aN as ne,p as V}from"./vendor-ux-did-connect-BUS40ceY.js";import{C as re}from"./config-space-6wpekLZ1.js";import{H as ie}from"./addon-D4YcNftH.js";import{S as le}from"./ServerLogo-Ck0Cn0r-.js";import{o as pe,u as ce,q as k,r as de,t as ue,P as A,N as Le,f as me,S as he,h as _}from"./index-Do_PTy2g.js";import{g as fe}from"./get-safe-url-Cn4KEro2.js";import"./vendor-hooks-DbRTDIFw.js";import"./lottie-web-B6s7dDoL.js";import"./api-D2GjOmnt.js";import"./QuestionMarkCircle-D4HZAY1P.js";var E=function(m){return e.jsxs("svg",{...m,children:[e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.152 10.6417L31.72 0L13.288 10.6417V24.7942L1 31.8887V53.1722L19.432 63.8139L31.6902 56.7366L31.72 56.7538L31.7498 56.7366L44.008 63.8139L62.44 53.1722V31.8887L50.152 24.7942V10.6417ZM60.52 32.9972L48.232 25.9027V11.7502L31.72 2.21703L15.208 11.7502V25.9028L2.92 32.9972V52.0636L19.432 61.5968L31.6902 54.5196L31.72 54.5368L31.7498 54.5196L44.008 61.5968L60.52 52.0636V32.9972Z",fill:"url(#paint0_linear_615_426)"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.1521 24.8307L31.7201 14.189L13.2881 24.8307V46.1141L31.7201 56.7558L50.1521 46.1141V24.8307ZM15.2081 25.9392L31.7201 16.406L48.2321 25.9392V45.0056L31.7201 54.5388L15.2081 45.0056V25.9392ZM28.5464 23.0464C28.6641 22.6342 29.0408 22.3501 29.4695 22.3501H33.9707C34.3993 22.3501 34.776 22.6342 34.8938 23.0464L35.7504 26.0447L37.8696 27.2681L40.8945 26.5109C41.3103 26.4068 41.7447 26.591 41.959 26.9622L44.2096 30.8604C44.424 31.2316 44.3662 31.6998 44.0682 32.0079L41.8999 34.2489V36.6959L44.0682 38.9369C44.3662 39.245 44.424 39.7133 44.2096 40.0845L41.959 43.9827C41.7447 44.3539 41.3103 44.538 40.8945 44.4339L37.8696 43.6767L35.7504 44.9002L34.8938 47.8984C34.776 48.3106 34.3993 48.5947 33.9707 48.5947H29.4695C29.0408 48.5947 28.6641 48.3106 28.5464 47.8984L27.6897 44.9002L25.5706 43.6767L22.5457 44.4339C22.1299 44.538 21.6955 44.3539 21.4812 43.9827L19.2305 40.0845C19.0162 39.7133 19.0739 39.245 19.372 38.9369L21.5402 36.6959V34.2489L19.372 32.0079C19.0739 31.6998 19.0162 31.2316 19.2305 30.8604L21.4812 26.9622C21.6955 26.591 22.1299 26.4068 22.5457 26.5109L25.5706 27.2681L27.6897 26.0447L28.5464 23.0464ZM28.9861 27.5132C29.2018 27.3887 29.3607 27.1851 29.4292 26.9456L30.1936 24.2701H33.2466L34.011 26.9456C34.0794 27.1851 34.2383 27.3887 34.4541 27.5132L37.2459 29.1251C37.4617 29.2497 37.7174 29.2855 37.9591 29.225L40.6583 28.5493L42.1848 31.1932L40.25 33.193C40.0768 33.372 39.9799 33.6114 39.9799 33.8605V37.0843C39.9799 37.3334 40.0768 37.5728 40.25 37.7518L42.1848 39.7516L40.6583 42.3955L37.9591 41.7198C37.7174 41.6593 37.4617 41.6951 37.2459 41.8197L34.4541 43.4316C34.2383 43.5561 34.0794 43.7597 34.011 43.9992L33.2466 46.6747H30.1936L29.4292 43.9992C29.3607 43.7597 29.2018 43.5561 28.9861 43.4316L26.1942 41.8197C25.9785 41.6951 25.7228 41.6593 25.4811 41.7198L22.7819 42.3955L21.2554 39.7516L23.1902 37.7518C23.3634 37.5728 23.4602 37.3334 23.4602 37.0843V33.8605C23.4602 33.6114 23.3634 33.372 23.1902 33.193L21.2554 31.1932L22.7819 28.5493L25.4811 29.225C25.7228 29.2855 25.9785 29.2497 26.1942 29.1251L28.9861 27.5132ZM31.7201 41.6407C28.3134 41.6407 25.5517 38.8791 25.5517 35.4724C25.5517 32.0657 28.3134 29.3041 31.7201 29.3041C35.1268 29.3041 37.8884 32.0657 37.8884 35.4724C37.8884 38.8791 35.1268 41.6407 31.7201 41.6407ZM35.9684 35.4724C35.9684 37.8187 34.0664 39.7207 31.7201 39.7207C29.3738 39.7207 27.4717 37.8187 27.4717 35.4724C27.4717 33.1261 29.3738 31.2241 31.7201 31.2241C34.0664 31.2241 35.9684 33.1261 35.9684 35.4724Z",fill:"url(#paint1_linear_615_426)"}),e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:"paint0_linear_615_426",x1:"31.72",y1:"95.7208",x2:"95.488",y2:"34.3249",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#0FA4B7"}),e.jsx("stop",{offset:"0.494757",stopColor:"#1DC1C7"}),e.jsx("stop",{offset:"1",stopColor:"#2BE0D7"})]}),e.jsxs("linearGradient",{id:"paint1_linear_615_426",x1:"28.4374",y1:"99.2464",x2:"98.7613",y2:"44.9372",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#0FA4B7"}),e.jsx("stop",{offset:"0.494757",stopColor:"#1DC1C7"}),e.jsx("stop",{offset:"1",stopColor:"#2BE0D7"})]})]})]})};E.defaultProps={width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg"};E.displayName="server-logo-notext";const xe=E,_e=T.span`
3
- color: ${m=>m.theme.palette.error.main};
4
- &::before {
5
- content: '*';
6
- }
7
- `,C=_e,Ce=i.lazy(()=>d(()=>import("./connect-D_mrUgoL.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]))),Ee=i.lazy(()=>d(()=>import("./config-C-1jeE31.js"),__vite__mapDeps([11,1,2,3,6,5,7,8,12,13,14,15,9,10,16,17,18,19,20,21,22]))),ge=i.lazy(()=>d(()=>import("./index-BFV3n5Hy.js"),__vite__mapDeps([23,1,2,6,3,5,7,8,18,9,10,24,25,26,27,28,21,19,20]))),je=i.lazy(()=>d(()=>import("./domain-DHb1Ps_o.js"),__vite__mapDeps([29,1,2,9,10,6,3,5,7,8,30,31,32,33,34,4,35,28,36,37,38,39,40,41,42,43,25,44,45,18,22,19,20,21]))),ye=i.lazy(()=>d(()=>import("./access-control-BWBOA4g6.js"),__vite__mapDeps([46,1,2,6,3,5,7,8,47,18,9,10,19,20,21,22]))),ve=i.lazy(()=>d(()=>import("./fuel-SLm_JOs-.js"),__vite__mapDeps([48,1,2,3,49,6,5,7,8,50,18,9,10,19,20,21,22]))),Pe=i.lazy(()=>d(()=>import("./complete--VG1kQVy.js"),__vite__mapDeps([51,1,2,6,3,5,7,8,9,10,52,53,22,19,20])));function be(){var R,w,I;const m=q(a=>a.breakpoints.down("md")),N=K(),{t,locale:$}=ae(),[g,B]=ee(),h=te(),{meta:u,blocklet:r,actions:l,loading:D}=pe(),O=localStorage.getItem("blocklet-server-url"),{session:j}=ce(),M=k("fromLauncher"),y=k("visitorId");y&&(ne(y),g.delete("visitorId"),B(g)),i.useEffect(()=>{de(),j.user&&(l==null||l.refreshMeta(),l==null||l.refreshBlocklet({showError:!1}))},[j.user]),i.useEffect(()=>{l.refreshFuel({showError:!1})},[(R=r==null?void 0:r.meta)==null?void 0:R.did]);const s=`${V.WELLKNOWN_SERVICE_PATH_PREFIX}/setup`,U=a=>{var f;const n=(f=a==null?void 0:a.capabilities)==null?void 0:f.didSpace;return n?n===_.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||n===_.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP?{key:"did-space",name:e.jsxs(e.Fragment,{children:[t("setup.steps.didSpace")," ",e.jsx(C,{})]}),path:o(s,"did-space")}:n===_.BLOCKLET_APP_SPACE_REQUIREMENT.OPTIONAL?{key:"did-space",name:e.jsx(e.Fragment,{children:t("setup.steps.didSpace")}),path:o(s,"did-space")}:(console.warn(`capabilities.didSpace cannot take the value ${n}`),null):null},p=[{key:"access",name:t("setup.steps.access"),path:o(s,"access")},{key:"domain",name:t("setup.domain.title"),path:o(s,"domain")},U(r),{key:"config",name:e.jsxs(e.Fragment,{children:[t("setup.steps.config")," ",ue(u)&&e.jsx(C,{})]}),path:o(s,"config")},(I=(w=u==null?void 0:u.requirements)==null?void 0:w.fuels)!=null&&I.length?{key:"fuel",name:e.jsxs(e.Fragment,{children:[t("setup.steps.fuel")," ",e.jsx(C,{})]}),path:o(s,"fuel")}:null].filter(Boolean),x=p.findIndex(a=>`${A.replace(/\/$/,"")}${s}/${a.key}`===window.location.pathname),F=o(A,V.WELLKNOWN_SERVICE_PATH_PREFIX,`/blocklet/logo?v=${r==null?void 0:r.updatedAt}`),b=async a=>{const{search:n}=new URL(window.location.href);if(!a)p[x+1]?h(`${o(s,p[x+1].key)}${n}`):h(`${o(s,"complete")}${n}`);else{const f=p.findIndex(z=>z.key===a);f>-1?h(`${o(s,p[f].key)}${n}`):h(`${o(s,"complete")}${n}`)}await l.refreshBlocklet()},H=()=>{h(-1)};function L(a,n){return e.jsxs(Ce,{children:[!r&&e.jsx(X,{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",children:e.jsx(J,{})}),r&&e.jsx(a,{blocklet:r,...n,onNext:b,onPrevious:H,buttonText:x===p.length-1?t("setup.startNow"):""})]})}const v=()=>{window.open(fe(O,{allowDomains:null}))},Z=m?e.jsx(xe,{onClick:v,width:"32",height:"32",style:{cursor:"pointer"}}):e.jsx(le,{onClick:v,width:"128",height:"48",style:{marginTop:-1,cursor:"pointer"}}),P=[{key:"install",name:t("launchBlocklet.steps.installApp"),path:o(s,"install")},{key:"setup",name:t("setup.steps.launchApp"),children:p}];let S=[{key:"agreement",name:t("launchBlocklet.introduction"),path:o(s,"agreement")},...P];return M&&(S=[{key:"purchase-space",name:t("launchBlocklet.steps.purchaseSpace")},{key:"prepare-space",name:t("launchBlocklet.steps.prepareSpace")},...P]),e.jsx(Q,{steps:S,children:e.jsx(Le,{children:e.jsxs(re,{children:[e.jsx(G,{styles:Se}),e.jsx(Re,{locale:$,loading:D,blockletMeta:{...u,title:me.getDisplayName({...r,meta:u})},navLogo:Z,pcWidth:"80%",style:{height:"100%"},logoUrl:F,useOfSkeleton:!1,headerEndAddons:e.jsx(ie,{SessionContext:he,sessionManagerProps:{disableLogout:!0}}),theme:N,launchingText:t("setup.title"),children:e.jsxs(se,{children:[e.jsx(c,{path:"access",element:L(ye)}),e.jsx(c,{path:"domain",element:L(je)}),e.jsx(c,{path:"did-space",element:L(ge)}),e.jsx(c,{path:"config",element:L(Ee)}),e.jsx(c,{path:"fuel",element:L(ve)}),e.jsx(c,{path:"complete",element:L(Pe)}),e.jsx(c,{path:"*",element:e.jsx(oe,{to:`access${window.location.search}`,replace:!0})})]})})]})})})}const Se=Y`
8
- html,
9
- body,
10
- #app,
11
- #app > .wrapper {
12
- height: 100%;
13
- }
14
- `,Re=T(W)`
15
- .layout-content {
16
- min-width: 0;
17
- flex: 1 1 0;
18
- }
19
- `;export{be as default};
@@ -1 +0,0 @@
1
- import{aw as _,ao as i}from"./vendor-ux-did-connect-BUS40ceY.js";import{_ as e}from"./vendor-arcblock-BkdpkIRL.js";import{y as a}from"./index-Do_PTy2g.js";import{j as r}from"./vendor-mui-core-O22FPGM4.js";const u={en:_(a),ar:()=>e(()=>import("./ar-BVbwKJY8.js"),[]).then(t=>_(t.default)),de:()=>e(()=>import("./de-nWUnqN3q.js"),[]).then(t=>_(t.default)),es:()=>e(()=>import("./es-C7damQG2.js"),[]).then(t=>_(t.default)),fr:()=>e(()=>import("./fr-D3MUmftb.js"),[]).then(t=>_(t.default)),hi:()=>e(()=>import("./hi-DLH2NuCr.js"),[]).then(t=>_(t.default)),id:()=>e(()=>import("./id-C_OpwsKG.js"),[]).then(t=>_(t.default)),ja:()=>e(()=>import("./ja-rh-7J19i.js"),[]).then(t=>_(t.default)),ko:()=>e(()=>import("./ko-DxXSLIu1.js"),[]).then(t=>_(t.default)),pt:()=>e(()=>import("./pt-q0ZSfFth.js"),[]).then(t=>_(t.default)),ru:()=>e(()=>import("./ru-CK3mPXUk.js"),[]).then(t=>_(t.default)),th:()=>e(()=>import("./th-DBezSIJU.js"),[]).then(t=>_(t.default)),vi:()=>e(()=>import("./vi-hjA0ec5w.js"),[]).then(t=>_(t.default)),"zh-TW":()=>e(()=>import("./zh-tw-Bj9DYpoo.js"),[]).then(t=>_(t.default)),zh:()=>e(()=>import("./zh-BIwal6DF.js"),[]).then(t=>_(t.default))};function f(t){return function(o){return r.jsx(i,{translations:u,children:r.jsx(t,{...o})})}}export{f as w};