@abtnode/blocklet-services 1.16.43-beta-20250429-130236-269254ff → 1.16.43-beta-20250430-225854-7914dfe4

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 (156) hide show
  1. package/api/libs/connect/session.js +4 -2
  2. package/api/middlewares/ensure-blocklet.js +1 -1
  3. package/api/routes/user-session.js +4 -2
  4. package/api/services/auth/session.js +13 -8
  5. package/dist/assets/{AdapterDayjs-D5LoqHiU.js → AdapterDayjs-BWhMsmQP.js} +1 -1
  6. package/dist/assets/{ArrowDropDown-BCCa5uRn.js → ArrowDropDown-DUCtp8oo.js} +1 -1
  7. package/dist/assets/{CheckCircle-Bxk_pKUt.js → CheckCircle-yKW43XdV.js} +1 -1
  8. package/dist/assets/{ChevronLeft-DgTQnUwX.js → ChevronLeft-6AvuBihM.js} +1 -1
  9. package/dist/assets/{ChevronRight-C-lajCDc.js → ChevronRight-BsdsjNxw.js} +1 -1
  10. package/dist/assets/{DeleteOutline-Csdx_lih.js → DeleteOutline-D_I07sPe.js} +1 -1
  11. package/dist/assets/{Done-DjB4uf97.js → Done-DLTvHdZB.js} +1 -1
  12. package/dist/assets/{Download-CF6ZhZfD.js → Download-DKz_gZX5.js} +1 -1
  13. package/dist/assets/{Edit-C-zkyYSj.js → Edit-odNPT5GK.js} +1 -1
  14. package/dist/assets/{Error-DnzvDd2d.js → Error-js7ePZ5o.js} +1 -1
  15. package/dist/assets/{ExpandLess-DBN4huDO.js → ExpandLess-TUium4RQ.js} +1 -1
  16. package/dist/assets/{Google-VfyWFLKO.js → Google-C7d25Q5r.js} +1 -1
  17. package/dist/assets/{InfoOutlined-BMb9Zu84.js → InfoOutlined-BjII93aR.js} +1 -1
  18. package/dist/assets/{Launch-CVPYIHzD.js → Launch-ryL3I8d9.js} +1 -1
  19. package/dist/assets/{LaunchOutlined-faHvtBle.js → LaunchOutlined-D21Xchdf.js} +1 -1
  20. package/dist/assets/{MoreHoriz-CT231fLS.js → MoreHoriz-DHyMdwpT.js} +1 -1
  21. package/dist/assets/{PlayArrow-CVHX5RbU.js → PlayArrow-zDVVYX6u.js} +1 -1
  22. package/dist/assets/{TuneOutlined-DcBuSd1o.js → TuneOutlined-Bv7cSbWT.js} +1 -1
  23. package/dist/assets/{ViewList-rVo7d5VV.js → ViewList-Ca1IEB31.js} +1 -1
  24. package/dist/assets/{access-control-Cum8iIaB.js → access-control-CwSjARsN.js} +1 -1
  25. package/dist/assets/{actions-D-Helr6n.js → actions-BW0Vx00_.js} +1 -1
  26. package/dist/assets/{add-component-core-kWUUw0fB.js → add-component-core-DXp_ntZ3.js} +1 -1
  27. package/dist/assets/{add-resource-DEesv1LC.js → add-resource-CmPIp37F.js} +1 -1
  28. package/dist/assets/{addon-B5zwPHe5.js → addon-FArG2oUy.js} +1 -1
  29. package/dist/assets/{advanced-CjSPlkxp.js → advanced-mJXTlRFz.js} +2 -2
  30. package/dist/assets/api-Bf1onQOz.js +1 -0
  31. package/dist/assets/{appearance-rlMOco_Q.js → appearance-D9WrcbPF.js} +1 -1
  32. package/dist/assets/{audit-logs-BpacJ0mq.js → audit-logs-CVUuBgdy.js} +1 -1
  33. package/dist/assets/{authorize-Dup4yiJg.js → authorize-Bk0sIDAH.js} +1 -1
  34. package/dist/assets/{base32-yUUlhgnG.js → base32-C_EKY5vU.js} +1 -1
  35. package/dist/assets/{branding-BB4z7dex.js → branding-BoSHL25b.js} +2 -2
  36. package/dist/assets/{branding-3E94pu9e.js → branding-Cywl-fod.js} +4 -4
  37. package/dist/assets/{bundle-avatar-njRzpG6o.js → bundle-avatar-BXQsJw7m.js} +1 -1
  38. package/dist/assets/{button-DRqMfYjF.js → button-h00yLUET.js} +1 -1
  39. package/dist/assets/{click-to-copy-CSwBjJDI.js → click-to-copy-0s0a7Ak5.js} +1 -1
  40. package/dist/assets/{cloneDeep-Cg0h_FaY.js → cloneDeep-WT_kDeVd.js} +1 -1
  41. package/dist/assets/{complete-lhAOowgH.js → complete--raviZZ4.js} +1 -1
  42. package/dist/assets/{component-DG-t6Jac.js → component-C3maTG8x.js} +72 -69
  43. package/dist/assets/{config-Ct2icT-j.js → config-Die5cVWR.js} +1 -1
  44. package/dist/assets/{config-BWuaMoux.js → config-e3P85n7z.js} +1 -1
  45. package/dist/assets/{config-navigation-BZ3T8tYK.js → config-navigation-DhvlW96p.js} +6 -6
  46. package/dist/assets/{config-space-CKx83vmi.js → config-space-CHI2AzS5.js} +1 -1
  47. package/dist/assets/{confirm-Bj4L0Vn8.js → confirm-BqrhdaU7.js} +1 -1
  48. package/dist/assets/connect-DGOqnhoS.js +5 -0
  49. package/dist/assets/{connect-v2Zx9JEk.js → connect-cpTXz6hq.js} +1 -1
  50. package/dist/assets/{connect-to-lcfZI_0b.js → connect-to-C1xSYa-8.js} +1 -1
  51. package/dist/assets/dashboard-CvJ8cVy-.js +280 -0
  52. package/dist/assets/{delete-confirm-kpan5KFX.js → delete-confirm-CmXluMcs.js} +1 -1
  53. package/dist/assets/{did-address-CJZtrzhT.js → did-address-C6ni99I7.js} +1 -1
  54. package/dist/assets/{domain-C8nJlURa.js → domain-B7m2mZGp.js} +1 -1
  55. package/dist/assets/{domain-action-card-BZ3CFKs5.js → domain-action-card-DIGUxqW7.js} +1 -1
  56. package/dist/assets/domains-DV-Gl3-a.js +1 -0
  57. package/dist/assets/{dot-CaKxEi_0.js → dot-WAAJ-O65.js} +1 -1
  58. package/dist/assets/{email-BjCEb0WI.js → email-CxndZMem.js} +2 -2
  59. package/dist/assets/{exchange-passport-B_b6xNH8.js → exchange-passport-JjK-mItt.js} +1 -1
  60. package/dist/assets/{fuel-Dtvd1fJW.js → fuel-bktBZZhG.js} +1 -1
  61. package/dist/assets/{gen-access-key-DsGgHUvi.js → gen-access-key-CPCwDcVa.js} +1 -1
  62. package/dist/assets/{get-safe-url-BTmcSfZP.js → get-safe-url-C-CJKtkC.js} +1 -1
  63. package/dist/assets/{get-safe-url-BYr2jgRv.js → get-safe-url-cyoeQ7Mw.js} +1 -1
  64. package/dist/assets/{home-ClwQWk4f.js → home-BclSkhw2.js} +1 -1
  65. package/dist/assets/{iframe-B7H87IMw.js → iframe-DZlnwo40.js} +1 -1
  66. package/dist/assets/{index-C-rP7qS0.js → index--MMFwLMX.js} +1 -1
  67. package/dist/assets/{index-D9eW5l3E.js → index-17ov_POl.js} +1 -1
  68. package/dist/assets/index-BAstW3VS.js +137 -0
  69. package/dist/assets/{index-C1UHqpp3.js → index-Bdi900W2.js} +3 -3
  70. package/dist/assets/{index-CEmSUlto.js → index-BhX4Vx5B.js} +3 -3
  71. package/dist/assets/{index-2eL6Ndgh.js → index-BugTfB-J.js} +1 -1
  72. package/dist/assets/index-C-rU1lEd.js +10 -0
  73. package/dist/assets/{index-CVKN_Jn1.js → index-C0x4zVBW.js} +2 -2
  74. package/dist/assets/index-C4pzdyRW.js +1 -0
  75. package/dist/assets/{index-B9lBWxnt.js → index-C8EYAWok.js} +2 -2
  76. package/dist/assets/index-CLD6I2fv.js +6 -0
  77. package/dist/assets/{index-a0ZdM5aG.js → index-COTyGW2s.js} +1 -1
  78. package/dist/assets/{index-BDaAwySV.js → index-CiIQJxvH.js} +1 -1
  79. package/dist/assets/{index-Cb1OPKJL.js → index-CksPySYI.js} +86 -93
  80. package/dist/assets/{index-DHIWtN6I.js → index-DJeuTVoT.js} +7 -7
  81. package/dist/assets/{index-DyKjKMmu.js → index-DODYa3Im.js} +1 -1
  82. package/dist/assets/{index-B1ljmpu4.css → index-DOq-_YXu.css} +1 -1
  83. package/dist/assets/{index-i5c4XeO-.js → index-D_z5kVUS.js} +1 -1
  84. package/dist/assets/{index-Cx-tuAMi.js → index-DdLPuFP7.js} +1 -1
  85. package/dist/assets/{index-BUrD6xiH.js → index-DxR1P6Lh.js} +4 -4
  86. package/dist/assets/{index-BOvzhuNp.js → index-htPha6tP.js} +2 -2
  87. package/dist/assets/{invitation-DGRUoRzD.js → invitation-sucipANy.js} +8 -8
  88. package/dist/assets/{invite-uoA9amq7.js → invite-Bkpf8YcY.js} +1 -1
  89. package/dist/assets/{issue-passport-2LsCG1Ym.js → issue-passport-Dm4XKvqR.js} +1 -1
  90. package/dist/assets/{item-taL0aTyr.js → item-CCsztPdL.js} +2 -2
  91. package/dist/assets/landing-page-BJMRDSCP.js +1 -0
  92. package/dist/assets/{layout-DAempiIX.js → layout-DV03YuuA.js} +1 -1
  93. package/dist/assets/list-BgP6u-5j.js +236 -0
  94. package/dist/assets/localization-CTzQFuMS.js +1 -0
  95. package/dist/assets/{log-CL673QLU.js → log-B4LRFTNR.js} +1 -1
  96. package/dist/assets/{logger-OMyVyA8K.js → logger-8RyN9oiF.js} +1 -1
  97. package/dist/assets/{login-CsMJeMSS.js → login-B6TE3gqj.js} +1 -1
  98. package/dist/assets/{login-oauth-callback-Bh6TJ59S.js → login-oauth-callback-CPP0UVME.js} +1 -1
  99. package/dist/assets/{logo-uploader-DFGj09Gp.js → logo-uploader-DMxsEq63.js} +3 -4
  100. package/dist/assets/{lost-passport-D00cnWl_.js → lost-passport-ekwdQ24A.js} +1 -1
  101. package/dist/assets/{omit-1zyydTZL.js → omit-DNeUY6_X.js} +1 -1
  102. package/dist/assets/{open-window-xLNOSl03.js → open-window-BjXpEOv2.js} +1 -1
  103. package/dist/assets/{overview-Ds0WiSnv.js → overview-CJRHh92f.js} +1 -1
  104. package/dist/assets/{page-header-BXC_EZqA.js → page-header-MKUHlyAT.js} +1 -1
  105. package/dist/assets/{passport-item-Dpr4rKdD.js → passport-item-jrknj0MQ.js} +1 -1
  106. package/dist/assets/{permission-DDLyDuSn.js → permission-PNXSTeNL.js} +1 -1
  107. package/dist/assets/{preferences-DXw1rfcr.js → preferences-9BJlt30G.js} +1 -1
  108. package/dist/assets/{profile-embed-co2rsGfl.js → profile-embed-CIWdUuC6.js} +1 -1
  109. package/dist/assets/publish-resource-BQg2Vwb0.js +1 -0
  110. package/dist/assets/{react-beautiful-dnd.esm-CeODMcuS.js → react-beautiful-dnd.esm-C1Wt0pHO.js} +1 -1
  111. package/dist/assets/{relative-time-DlN06RKr.js → relative-time-cijkMMnc.js} +1 -1
  112. package/dist/assets/runtime-71FSw-R0.js +1 -0
  113. package/dist/assets/sdk-BXECCi1q.js +1 -0
  114. package/dist/assets/{security-CHs7ENbZ.js → security-Y5seZEn6.js} +1 -1
  115. package/dist/assets/{session-j-9KoWbs.js → session-DLQ0rbYE.js} +1 -1
  116. package/dist/assets/{setup-CGwOCqjv.js → setup-4hj9RPfM.js} +12 -7
  117. package/dist/assets/{spaces-CZHg-rr5.js → spaces-CP1iyRKS.js} +1 -1
  118. package/dist/assets/{start-Chlvxw3J.js → start-Bt5Vo3K8.js} +1 -1
  119. package/dist/assets/{starting-progress-DpqgCEFM.js → starting-progress-yIv14mT6.js} +1 -1
  120. package/dist/assets/{status-XLk6MkKv.js → status-BKlS-OSq.js} +1 -1
  121. package/dist/assets/{step-actions-hjC-pbPT.js → step-actions-DMwF4axn.js} +1 -1
  122. package/dist/assets/{studio-DrYhFxCD.js → studio-BR3c6nt5.js} +1 -1
  123. package/dist/assets/{switch-control-CqfXXgvP.js → switch-control-yJOWKqcv.js} +1 -1
  124. package/dist/assets/{traffic-Dbf1L1c0.js → traffic-BzRbyLJ-.js} +1 -1
  125. package/dist/assets/{transfer-GcIVZcyL.js → transfer-Ds9NQ12A.js} +1 -1
  126. package/dist/assets/{unsubscribe-D2dQlJJM.js → unsubscribe-hfXD8-ea.js} +1 -1
  127. package/dist/assets/use-blocklet-logo-BOYeM9RY.js +1 -0
  128. package/dist/assets/{useAsync-DXeWUWXr.js → useAsync-GjVghrwi.js} +1 -1
  129. package/dist/assets/{useLocalStorage-Cb6R1F6v.js → useLocalStorage-CXDkfohf.js} +1 -1
  130. package/dist/assets/{user-center-D7lo6m0u.js → user-center-CBh-mxjZ.js} +1 -1
  131. package/dist/assets/{util-BcFfyz6S.js → util-D-LnEy9h.js} +1 -1
  132. package/dist/assets/{util-BYQQqvk1.js → util-DJFgW-07.js} +1 -1
  133. package/dist/assets/{vendor-arcblock-CX-5Ex_f.js → vendor-arcblock-Dkhgjlzn.js} +81 -81
  134. package/dist/assets/{vendor-hooks-DpLLpTSZ.js → vendor-hooks-DXGUREV9.js} +1 -1
  135. package/dist/assets/{vendor-utils-BUwfcN20.js → vendor-utils-CjMBJT5V.js} +17 -17
  136. package/dist/assets/vendor-ux-did-connect-D4-ZeZHm.js +2292 -0
  137. package/dist/assets/{wrap-locale-CzSOEkvO.js → wrap-locale-Dob_mf2V.js} +1 -1
  138. package/dist/index.html +6 -6
  139. package/dist/service-worker.js +2 -2
  140. package/package.json +43 -43
  141. package/dist/assets/api-BkKTvlm_.js +0 -1
  142. package/dist/assets/connect-BoejDqj-.js +0 -5
  143. package/dist/assets/dashboard-0TEl6bJJ.js +0 -280
  144. package/dist/assets/domains-Cn_DfzNS.js +0 -1
  145. package/dist/assets/index-Bco7nZ5q.js +0 -6
  146. package/dist/assets/index-CjZLIV87.js +0 -10
  147. package/dist/assets/index-DAer_mWn.js +0 -137
  148. package/dist/assets/index-M6peJL7s.js +0 -1
  149. package/dist/assets/landing-page-EY5bGAu7.js +0 -1
  150. package/dist/assets/list-B1E5dxgu.js +0 -236
  151. package/dist/assets/localization-Di0I0VVv.js +0 -1
  152. package/dist/assets/publish-resource-CBR18Gc3.js +0 -1
  153. package/dist/assets/runtime-nJVx0iKJ.js +0 -1
  154. package/dist/assets/sdk-DICk2ZHP.js +0 -1
  155. package/dist/assets/use-blocklet-logo-DryhoHen.js +0 -1
  156. package/dist/assets/vendor-ux-did-connect-DVrP2LNw.js +0 -2295
@@ -1,29 +1,29 @@
1
- import{r as C}from"./vendor-react-DEoibe3W.js";import{u as I,$ as E,n as oe,a as N,b6 as xe,ar as ce,bQ as ae,b8 as fe,aE as ge,bx as ye,c5 as he,ab as je}from"./vendor-ux-did-connect-DVrP2LNw.js";import{r as le}from"./passport-item-Dpr4rKdD.js";import{l as $,z as B,aF as be,C as Ce,f as ke}from"./index-Cb1OPKJL.js";import{u as _}from"./dashboard-0TEl6bJJ.js";import{j as e,H as j,bp as O,bs as G,bo as H,q as Q,aa as f,al as V,O as F,ab as J,bt as ve,bS as Ke,ah as P,T as z,ad as re,ak as Te}from"./vendor-mui-core-B6POpIBB.js";import{O as Ae,$ as Se}from"./vendor-arcblock-CX-5Ex_f.js";import{T as de}from"./index-Cx-tuAMi.js";import{C as me}from"./confirm-Bj4L0Vn8.js";import{$ as we}from"./vendor-utils-BUwfcN20.js";import{C as M}from"./click-to-copy-CSwBjJDI.js";import{D as De}from"./delete-confirm-kpan5KFX.js";import{d as Ie}from"./Edit-C-zkyYSj.js";import{P as Re}from"./permission-DDLyDuSn.js";import{m as $e,G as Be}from"./vendor-hooks-DpLLpTSZ.js";import{U as _e,C as ze,I as Ne}from"./index-CjZLIV87.js";import{B as Pe}from"./bundle-avatar-njRzpG6o.js";import{p as Le}from"./util-BcFfyz6S.js";import{W as ie}from"./did-address-CJZtrzhT.js";import{f as Ue}from"./format-error-BrmqJs5a.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-Cb6R1F6v.js";import"./PlayArrow-CVHX5RbU.js";import"./get-safe-url-BYr2jgRv.js";import"./session-j-9KoWbs.js";import"./use-blocklet-logo-DryhoHen.js";import"./InfoOutlined-BMb9Zu84.js";import"./dot-CaKxEi_0.js";import"./useAsync-DXeWUWXr.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-BNUwcWCH.js";import"./vendor-mui-x-CATHW1QL.js";import"./AdapterDayjs-D5LoqHiU.js";import"./Phone-CKzC4712.js";import"./Location-BQhEvGNL.js";import"./Email-B0n6rLUZ.js";import"./Timezone-C3hiNX6j.js";import"./base32-yUUlhgnG.js";function X({value:t}){const{t:s,locale:u}=I(),l=new Date;return new Date(t)<l?e.jsxs("span",{style:{color:"red"},children:[e.jsx(E,{value:t,locale:u}),`${s("setting.accessKey.expired",{time:""})}`]}):$(t,u)}X.propTypes={value:j.string.isRequired};function Y({value:t,onChange:s,...u}){const{t:l}=I(),d=C.useMemo(()=>[{value:"signature",title:l("setting.accessKey.signature"),description:l("setting.accessKey.signatureDesc")},{value:"simple",title:l("setting.accessKey.simple"),description:l("setting.accessKey.simpleDesc")}],[l]);return e.jsxs(O,{style:{width:"100%"},variant:"outlined",...u,children:[e.jsx(G,{children:l("setting.accessKey.authType")}),e.jsx(H,{value:t,onChange:s,fullWidth:!0,label:l("setting.accessKey.authType"),children:d.map(n=>e.jsx(Q,{value:n.value,children:e.jsxs(f,{children:[e.jsx("span",{children:n.title}),e.jsx(f,{maxWidth:510,fontSize:12,color:"#999",whiteSpace:"normal",children:n.description})]})},n.value))})]})}Y.propTypes={value:j.string.isRequired,onChange:j.func.isRequired};const U=()=>{const t=oe.RBAC_CONFIG.roles.filter(d=>d.passport),{inService:s}=B(),{roles:u}=_(),l=[...t,...s?u:[]];return we(l,"name").filter(d=>d.name!==oe.ROLES.OWNER)};function Z(t){const{remark:s,onCreate:u}=t,{api:l}=B(),{teamDid:d}=_(),{t:n}=I(),[v,g]=C.useState(!1),[i,c]=C.useState(null),T=U(),k=()=>{g(!1),c(null)},b=async a=>{const{remark:y,passport:m,authType:o}=a;g(!0);const p=await l.createAccessKey({input:{teamDid:d,remark:y.trim(),passport:m,expireAt:a.expireAt?new Date(a.expireAt).getTime():null,authType:o}}),{data:w}=p;u(w),c(null),g(!1)},x={title:`${n("common.create")} ${n("accessKey")}`,description:(a,y,m)=>e.jsxs(V,{gap:3,children:[e.jsx(F,{label:n("setting.accessKey.tip"),autoComplete:"off",variant:"outlined",name:"remark",inputProps:{"data-cy":"remark-input"},fullWidth:!0,autoFocus:!0,margin:"dense",value:a.remark,onChange:o=>{y({...a,remark:o.target.value,__disableConfirm:!a.passport||!o.target.value.trim()}),o.target.value.trim()?m(""):m(n("setting.accessKey.remarkInvalid"))}}),e.jsxs(O,{style:{width:"100%"},variant:"outlined",children:[e.jsx(G,{children:n("setting.accessKey.passport")}),e.jsx(H,{"data-cy":"create-access-key-select-passport",value:a.passport,onChange:o=>{const p=o.target.value;m(null),y({...a,passport:p,__disableConfirm:!a.remark||!p})},fullWidth:!0,label:n("setting.accessKey.passport"),disabled:v,children:T.map(o=>e.jsx(Q,{value:o.name,"data-cy":`create-access-key-passport-option-${o.name}`,children:e.jsxs(f,{children:[e.jsx("span",{children:o.title||o.name}),e.jsx(f,{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify",children:o.description})]})},o.name))})]}),e.jsx(Y,{value:a.authType,onChange:o=>{y({...a,authType:o.target.value})}}),e.jsx(de,{placeholder:n("setting.accessKey.expireTime"),value:a.expireAt,onChange:o=>{y({...a,expireAt:o,__disableConfirm:!a.passport||!a.remark||!o})}})]}),confirm:n("common.confirm"),cancel:n("common.cancel"),color:"primary",params:{remark:s,authType:"signature",__disableConfirm:!s.trim()},onConfirm:b,onCancel:k};return e.jsxs(e.Fragment,{children:[e.jsxs(N,{edge:"end",variant:"contained",color:"primary","data-cy":"add-access-key-btn",onClick:()=>c(x),className:"rule-action",children:[v?e.jsx(J,{size:16}):e.jsx(Ae,{style:{fontSize:16}}),n("common.create")]}),i&&e.jsx(me,{title:i.title,description:i.description,confirm:i.confirm,color:i.color,cancel:i.cancel,params:i.params,onConfirm:i.onConfirm,onCancel:i.onCancel})]})}Z.propTypes={remark:j.string,onCreate:j.func};Z.defaultProps={onCreate:()=>{},remark:""};function ee(t){const{onConfirm:s,accessKeyId:u,accessKeySecret:l,hideSecret:d}=t,{t:n}=C.useContext(xe),[v,g]=C.useState(!1),[i,c]=C.useState(()=>d),T=()=>{c(!i)},k=a=>{g(a.target.checked)},b=C.useMemo(()=>{var a;return d?`const Client = require('@abtnode/client');
1
+ import{r as C}from"./vendor-react-DEoibe3W.js";import{u as I,$ as F,n as oe,a as N,b5 as xe,aq as ce,bP as ae,b7 as fe,aD as ge,bw as ye,c4 as he,ab as je}from"./vendor-ux-did-connect-D4-ZeZHm.js";import{r as le}from"./passport-item-jrknj0MQ.js";import{l as $,z as B,aF as be,C as Ce,f as ke}from"./index-CksPySYI.js";import{u as _}from"./dashboard-CvJ8cVy-.js";import{j as e,H as j,bp as O,bs as G,bo as H,q as V,aa as f,al as Q,O as M,ab as J,bt as ve,bS as Ke,ah as P,T as z,ad as re,ak as Te}from"./vendor-mui-core-B6POpIBB.js";import{O as Ae,$ as Se}from"./vendor-arcblock-Dkhgjlzn.js";import{T as de}from"./index-DdLPuFP7.js";import{C as me}from"./confirm-BqrhdaU7.js";import{$ as we}from"./vendor-utils-CjMBJT5V.js";import{C as E}from"./click-to-copy-0s0a7Ak5.js";import{D as De}from"./delete-confirm-CmXluMcs.js";import{d as Ie}from"./Edit-odNPT5GK.js";import{P as Re}from"./permission-PNXSTeNL.js";import{m as $e,G as Be}from"./vendor-hooks-DXGUREV9.js";import{U as _e,C as ze,I as Ne}from"./index-C-rU1lEd.js";import{B as Pe}from"./bundle-avatar-BXQsJw7m.js";import{p as qe}from"./util-D-LnEy9h.js";import{W as ie}from"./did-address-C6ni99I7.js";import{f as Le}from"./format-error-BrmqJs5a.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-CXDkfohf.js";import"./PlayArrow-zDVVYX6u.js";import"./get-safe-url-cyoeQ7Mw.js";import"./session-DLQ0rbYE.js";import"./use-blocklet-logo-BOYeM9RY.js";import"./InfoOutlined-BjII93aR.js";import"./dot-WAAJ-O65.js";import"./useAsync-GjVghrwi.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-BNUwcWCH.js";import"./vendor-mui-x-CATHW1QL.js";import"./AdapterDayjs-BWhMsmQP.js";import"./Phone-CKzC4712.js";import"./Location-BQhEvGNL.js";import"./Email-B0n6rLUZ.js";import"./Timezone-C3hiNX6j.js";import"./base32-C_EKY5vU.js";function X({value:t}){const{t:s,locale:u}=I(),l=new Date;return new Date(t)<l?e.jsxs("span",{style:{color:"red"},children:[e.jsx(F,{value:t,locale:u}),`${s("setting.accessKey.expired",{time:""})}`]}):$(t,u)}X.propTypes={value:j.string.isRequired};function Y({value:t,onChange:s,...u}){const{t:l}=I(),d=C.useMemo(()=>[{value:"signature",title:l("setting.accessKey.signature"),description:l("setting.accessKey.signatureDesc")},{value:"simple",title:l("setting.accessKey.simple"),description:l("setting.accessKey.simpleDesc")}],[l]);return e.jsxs(O,{style:{width:"100%"},variant:"outlined",...u,children:[e.jsx(G,{children:l("setting.accessKey.authType")}),e.jsx(H,{value:t,onChange:s,fullWidth:!0,label:l("setting.accessKey.authType"),children:d.map(n=>e.jsx(V,{value:n.value,children:e.jsxs(f,{children:[e.jsx("span",{children:n.title}),e.jsx(f,{maxWidth:510,fontSize:12,color:"#999",whiteSpace:"normal",children:n.description})]})},n.value))})]})}Y.propTypes={value:j.string.isRequired,onChange:j.func.isRequired};const L=()=>{const t=oe.RBAC_CONFIG.roles.filter(d=>d.passport),{inService:s}=B(),{roles:u}=_(),l=[...t,...s?u:[]];return we(l,"name").filter(d=>d.name!==oe.ROLES.OWNER)};function Z(t){const{remark:s,onCreate:u}=t,{api:l}=B(),{teamDid:d}=_(),{t:n}=I(),[v,g]=C.useState(!1),[i,c]=C.useState(null),T=L(),k=()=>{g(!1),c(null)},b=async a=>{const{remark:y,passport:m,authType:o}=a;g(!0);const p=await l.createAccessKey({input:{teamDid:d,remark:y.trim(),passport:m,expireAt:a.expireAt?new Date(a.expireAt).getTime():null,authType:o}}),{data:w}=p;u(w),c(null),g(!1)},x={title:`${n("common.create")} ${n("accessKey")}`,description:(a,y,m)=>e.jsxs(Q,{gap:3,children:[e.jsx(M,{label:n("setting.accessKey.tip"),autoComplete:"off",variant:"outlined",name:"remark",inputProps:{"data-cy":"remark-input"},fullWidth:!0,autoFocus:!0,margin:"dense",value:a.remark,onChange:o=>{y({...a,remark:o.target.value,__disableConfirm:!a.passport||!o.target.value.trim()}),o.target.value.trim()?m(""):m(n("setting.accessKey.remarkInvalid"))}}),e.jsxs(O,{style:{width:"100%"},variant:"outlined",children:[e.jsx(G,{children:n("setting.accessKey.passport")}),e.jsx(H,{"data-cy":"create-access-key-select-passport",value:a.passport,onChange:o=>{const p=o.target.value;m(null),y({...a,passport:p,__disableConfirm:!a.remark||!p})},fullWidth:!0,label:n("setting.accessKey.passport"),disabled:v,children:T.map(o=>e.jsx(V,{value:o.name,"data-cy":`create-access-key-passport-option-${o.name}`,children:e.jsxs(f,{children:[e.jsx("span",{children:o.title||o.name}),e.jsx(f,{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify",children:o.description})]})},o.name))})]}),e.jsx(Y,{value:a.authType,onChange:o=>{y({...a,authType:o.target.value})}}),e.jsx(de,{placeholder:n("setting.accessKey.expireTime"),value:a.expireAt,onChange:o=>{y({...a,expireAt:o,__disableConfirm:!a.passport||!a.remark||!o})}})]}),confirm:n("common.confirm"),cancel:n("common.cancel"),color:"primary",params:{remark:s,authType:"signature",__disableConfirm:!s.trim()},onConfirm:b,onCancel:k};return e.jsxs(e.Fragment,{children:[e.jsxs(N,{edge:"end",variant:"contained",color:"primary","data-cy":"add-access-key-btn",onClick:()=>c(x),className:"rule-action",children:[v?e.jsx(J,{size:16}):e.jsx(Ae,{style:{fontSize:16}}),n("common.create")]}),i&&e.jsx(me,{title:i.title,description:i.description,confirm:i.confirm,color:i.color,cancel:i.cancel,params:i.params,onConfirm:i.onConfirm,onCancel:i.onCancel})]})}Z.propTypes={remark:j.string,onCreate:j.func};Z.defaultProps={onCreate:()=>{},remark:""};function ee(t){const{onConfirm:s,accessKeyId:u,accessKeySecret:l,hideSecret:d}=t,{t:n}=C.useContext(xe),[v,g]=C.useState(!1),[i,c]=C.useState(()=>d),T=()=>{c(!i)},k=a=>{g(a.target.checked)},b=C.useMemo(()=>{var a;return d?`const Client = require('@abtnode/client');
2
2
 
3
3
  const client = new Client(fullEndpoint);
4
4
  client.setAuthAccessKey({
5
5
  accessKeyId: "${u}",
6
6
  accessKeySecret: "${l}",
7
7
  });
8
- `:`curl -H "Authorization: Bearer ${l}" "${(a=window.blocklet)==null?void 0:a.appUrl}/.well-known/service/api/did/session"`},[d,u,l]),x=C.useMemo(()=>{var a;return d?`blocklet deploy --endpoint ${(a=window.blocklet)==null?void 0:a.appUrl} --access-key ${u} --access-secret ${l} {blockletPath}/.blocklet/bundle;`:null},[d,u,l]);return e.jsxs(ce,{title:n("common.createSuccess"),fullWidth:!0,open:!0,disableEscapeKeyDown:!0,onClose:s,showCloseButton:!1,actions:e.jsx("div",{children:e.jsx(N,{disabled:d?!v:!1,onClick:s,color:"primary",autoFocus:!0,variant:"contained","data-cy":"submit-confirm-dialog",children:n("common.confirm")})}),"aria-labelledby":"simple-dialog-title",children:[e.jsx("div",{children:e.jsx(We,{children:n(d?"setting.accessKey.saveSecretTip":"setting.accessKey.viewSecret")})}),e.jsx("div",{style:{marginTop:"20px"}}),e.jsxs(q,{children:[e.jsx(W,{children:n("setting.accessKey.accessKeyId")}),e.jsx(M,{children:u})]}),e.jsxs(q,{children:[e.jsx(W,{children:n("setting.accessKey.accessKeySecret")}),i?e.jsx(N,{"data-cy":"show-secret-btn",color:"primary",onClick:T,children:n("setting.accessKey.showSecret")}):e.jsx(M,{children:l})]}),!i&&e.jsxs(q,{children:[e.jsx(W,{children:`Access Key ${n("setting.accessKey.usage")}`}),e.jsx(ae,{code:b,language:"javascript"}),x&&e.jsx(ae,{code:x,language:"bash"})]}),d&&e.jsx("div",{children:e.jsx(ve,{value:"end",disabled:i,control:e.jsx(Ke,{checked:v,onChange:k}),label:n("setting.accessKey.iKnow"),labelPlacement:"end"})})]})}ee.propTypes={accessKeyId:j.string.isRequired,accessKeySecret:j.string.isRequired,onConfirm:j.func,hideSecret:j.bool};ee.defaultProps={onConfirm:()=>{},hideSecret:!0};const W=P.div`
8
+ `:`curl -H "Authorization: Bearer ${l}" "${(a=window.blocklet)==null?void 0:a.appUrl}/.well-known/service/api/did/session"`},[d,u,l]),x=C.useMemo(()=>{var a;return d?`blocklet deploy --endpoint ${(a=window.blocklet)==null?void 0:a.appUrl} --access-key ${u} --access-secret ${l} {blockletPath}/.blocklet/bundle;`:null},[d,u,l]);return e.jsxs(ce,{title:n("common.createSuccess"),fullWidth:!0,open:!0,disableEscapeKeyDown:!0,onClose:s,showCloseButton:!1,actions:e.jsx("div",{children:e.jsx(N,{disabled:d?!v:!1,onClick:s,color:"primary",autoFocus:!0,variant:"contained","data-cy":"submit-confirm-dialog",children:n("common.confirm")})}),"aria-labelledby":"simple-dialog-title",children:[e.jsx("div",{children:e.jsx(Ue,{children:n(d?"setting.accessKey.saveSecretTip":"setting.accessKey.viewSecret")})}),e.jsx("div",{style:{marginTop:"20px"}}),e.jsxs(W,{children:[e.jsx(U,{children:n("setting.accessKey.accessKeyId")}),e.jsx(E,{children:u})]}),e.jsxs(W,{children:[e.jsx(U,{children:n("setting.accessKey.accessKeySecret")}),i?e.jsx(N,{"data-cy":"show-secret-btn",color:"primary",onClick:T,children:n("setting.accessKey.showSecret")}):e.jsx(E,{children:l})]}),!i&&e.jsxs(W,{children:[e.jsx(U,{children:`Access Key ${n("setting.accessKey.usage")}`}),e.jsx(ae,{code:b,language:"javascript"}),x&&e.jsx(ae,{code:x,language:"bash"})]}),d&&e.jsx("div",{children:e.jsx(ve,{value:"end",disabled:i,control:e.jsx(Ke,{checked:v,onChange:k}),label:n("setting.accessKey.iKnow"),labelPlacement:"end"})})]})}ee.propTypes={accessKeyId:j.string.isRequired,accessKeySecret:j.string.isRequired,onConfirm:j.func,hideSecret:j.bool};ee.defaultProps={onConfirm:()=>{},hideSecret:!0};const U=P.div`
9
9
  display: flex;
10
10
  justify-content: space-between;
11
11
  align-items: center;
12
12
  font-size: 16px;
13
13
  margin-bottom: 8px;
14
- `,q=P.div`
14
+ `,W=P.div`
15
15
  margin-bottom: 24px;
16
- `,We=P.div`
16
+ `,Ue=P.div`
17
17
  font-size: 16px;
18
18
  font-weight: bold;
19
- `;function te(t){const{t:s,locale:u}=I(),{api:l}=B(),{teamDid:d}=_(),[n,v]=C.useState(!1),[g,i]=C.useState(null),{accessKeyId:c,time:T,remark:k,onDelete:b=()=>{}}=t,x=()=>{v(!1),i(null)},a=async()=>{v(!0);try{await l.deleteAccessKey({input:{teamDid:d,accessKeyId:c}}),b()}catch(o){console.error(o)}finally{v(!1),i(null)}},y=o=>({key:`<b>${c}</b>`,name:`<b>${k}</b>`,time:$(o,u),timeAge:Se(new Date(o),be(u))}),m={keyName:k,title:s("setting.accessKey.title"),description:T?`${s("setting.accessKey.description",y(T))}`:`${s("setting.accessKey.descriptionNoTime",{key:`<b>${c}</b>`,name:`<b>${k}</b>`})}`,confirmPlaceholder:s("setting.accessKey.confirm_desc",{name:k}),confirm:s("common.delConfirm"),cancel:s("common.cancel"),onConfirm:a,onCancel:x};return e.jsxs(e.Fragment,{children:[e.jsxs(N,{edge:"end",onClick:o=>{o.stopPropagation(),i(m)},size:"small",className:"rule-action",color:"error",children:[n?e.jsx(J,{size:16}):e.jsx(fe,{style:{fontSize:16}}),s("common.delete")]}),g&&e.jsx(De,{keyName:g.keyName,title:g.title,description:g.description,confirmPlaceholder:g.confirmPlaceholder,confirm:g.confirm,cancel:g.cancel,params:g.params,onConfirm:g.onConfirm,onCancel:g.onCancel})]})}te.propTypes={accessKeyId:j.string.isRequired,time:j.string.isRequired,remark:j.string.isRequired,onDelete:j.func};te.defaultProps={onDelete:()=>{}};function se(t){const{accessKeyId:s,remark:u,onUpdate:l,passport:d,expireAt:n,authType:v}=t,{api:g}=B(),{teamDid:i}=_(),{t:c}=I(),[T,k]=C.useState(!1),[b,x]=C.useState(null),a=U(),y=()=>{k(!1),x(null)},m=async p=>{const{accessKeyId:w,remark:R="",passport:h,expireAt:D,authType:L}=p;k(!0),await g.updateAccessKey({input:{teamDid:i,accessKeyId:w,remark:R.trim(),passport:h,expireAt:D?new Date(D).getTime():null,authType:L}}),l(),x(null),k(!1)},o={title:`${c("common.update")} ${c("accessKey")}`,description:(p,w,R)=>e.jsxs(V,{gap:3,children:[e.jsx(F,{label:c("setting.accessKey.accessKeyId"),autoComplete:"off",variant:"outlined",name:"accessKeyId",fullWidth:!0,autoFocus:!0,margin:"dense",value:p.accessKeyId,disabled:!0}),e.jsx(F,{label:c("common.remark"),autoComplete:"off",variant:"outlined",name:"remark",fullWidth:!0,autoFocus:!0,value:p.remark,onChange:h=>{w({...p,remark:h.target.value,__disableConfirm:!h.target.value.trim()}),h.target.value.trim()?R(""):R(c("setting.accessKey.remarkInvalid"))}}),e.jsxs(O,{style:{width:"100%"},variant:"outlined",children:[e.jsx(G,{children:c("setting.accessKey.passport")}),e.jsx(H,{"data-cy":"update-access-key-select-passport",value:p.passport,onChange:h=>{const D=h.target.value;R(null),w({...p,passport:D,__disableConfirm:!p.remark||!D})},fullWidth:!0,label:c("setting.accessKey.passport"),disabled:T,children:a.map(h=>e.jsx(Q,{value:h.name,"data-cy":`update-access-key-passport-option-${h.name}`,children:e.jsxs(f,{children:[e.jsx("span",{children:h.title||h.name}),e.jsx(f,{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify",children:h.description})]})},h.name))})]}),e.jsx(Y,{disabled:!0,value:p.authType,onChange:h=>{w({...p,authType:h.target.value})}}),e.jsx(de,{placeholder:c("setting.accessKey.expireTime"),value:p.expireAt,onChange:h=>{w({...p,expireAt:h,__disableConfirm:!p.passport||!p.remark||!h})}})]}),confirm:c("common.confirm"),cancel:c("common.cancel"),color:"primary",params:{accessKeyId:s,remark:u,passport:d,expireAt:n,authType:v},onConfirm:m,onCancel:y};return e.jsxs(e.Fragment,{children:[e.jsxs(N,{edge:"end",onClick:p=>{p.stopPropagation(),x(o)},size:"small",className:"rule-action",color:"primary",children:[T?e.jsx(J,{size:16}):e.jsx(Ie,{style:{fontSize:16}}),c("common.update")]}),b&&e.jsx(me,{title:b.title,description:b.description,confirm:b.confirm,color:b.color,cancel:b.cancel,params:b.params,onConfirm:b.onConfirm,onCancel:b.onCancel})]})}se.propTypes={accessKeyId:j.string.isRequired,remark:j.string,passport:j.string,expireAt:j.string,authType:j.string,onUpdate:j.func};se.defaultProps={onUpdate:()=>{},remark:"",passport:"",expireAt:"",authType:"signature"};function ne({accessKey:t,onCancel:s}){const{t:u}=I();return e.jsx(ce,{title:u("accessKey"),onClose:s,open:!0,PaperProps:{style:{maxWidth:800}},fullWidth:!0,children:e.jsx(qe,{children:e.jsx(pe,{accessKey:t})})})}ne.propTypes={accessKey:j.object.isRequired,onCancel:j.func.isRequired};ne.defaultProps={};const qe=P(f)`
19
+ `;function te(t){const{t:s,locale:u}=I(),{api:l}=B(),{teamDid:d}=_(),[n,v]=C.useState(!1),[g,i]=C.useState(null),{accessKeyId:c,time:T,remark:k,onDelete:b=()=>{}}=t,x=()=>{v(!1),i(null)},a=async()=>{v(!0);try{await l.deleteAccessKey({input:{teamDid:d,accessKeyId:c}}),b()}catch(o){console.error(o)}finally{v(!1),i(null)}},y=o=>({key:`<b>${c}</b>`,name:`<b>${k}</b>`,time:$(o,u),timeAge:Se(new Date(o),be(u))}),m={keyName:k,title:s("setting.accessKey.title"),description:T?`${s("setting.accessKey.description",y(T))}`:`${s("setting.accessKey.descriptionNoTime",{key:`<b>${c}</b>`,name:`<b>${k}</b>`})}`,confirmPlaceholder:s("setting.accessKey.confirm_desc",{name:k}),confirm:s("common.delConfirm"),cancel:s("common.cancel"),onConfirm:a,onCancel:x};return e.jsxs(e.Fragment,{children:[e.jsxs(N,{edge:"end",onClick:o=>{o.stopPropagation(),i(m)},size:"small",className:"rule-action",color:"error",children:[n?e.jsx(J,{size:16}):e.jsx(fe,{style:{fontSize:16}}),s("common.delete")]}),g&&e.jsx(De,{keyName:g.keyName,title:g.title,description:g.description,confirmPlaceholder:g.confirmPlaceholder,confirm:g.confirm,cancel:g.cancel,params:g.params,onConfirm:g.onConfirm,onCancel:g.onCancel})]})}te.propTypes={accessKeyId:j.string.isRequired,time:j.string.isRequired,remark:j.string.isRequired,onDelete:j.func};te.defaultProps={onDelete:()=>{}};function se(t){const{accessKeyId:s,remark:u,onUpdate:l,passport:d,expireAt:n,authType:v}=t,{api:g}=B(),{teamDid:i}=_(),{t:c}=I(),[T,k]=C.useState(!1),[b,x]=C.useState(null),a=L(),y=()=>{k(!1),x(null)},m=async p=>{const{accessKeyId:w,remark:R="",passport:h,expireAt:D,authType:q}=p;k(!0),await g.updateAccessKey({input:{teamDid:i,accessKeyId:w,remark:R.trim(),passport:h,expireAt:D?new Date(D).getTime():null,authType:q}}),l(),x(null),k(!1)},o={title:`${c("common.update")} ${c("accessKey")}`,description:(p,w,R)=>e.jsxs(Q,{gap:3,children:[e.jsx(M,{label:c("setting.accessKey.accessKeyId"),autoComplete:"off",variant:"outlined",name:"accessKeyId",fullWidth:!0,autoFocus:!0,margin:"dense",value:p.accessKeyId,disabled:!0}),e.jsx(M,{label:c("common.remark"),autoComplete:"off",variant:"outlined",name:"remark",fullWidth:!0,autoFocus:!0,value:p.remark,onChange:h=>{w({...p,remark:h.target.value,__disableConfirm:!h.target.value.trim()}),h.target.value.trim()?R(""):R(c("setting.accessKey.remarkInvalid"))}}),e.jsxs(O,{style:{width:"100%"},variant:"outlined",children:[e.jsx(G,{children:c("setting.accessKey.passport")}),e.jsx(H,{"data-cy":"update-access-key-select-passport",value:p.passport,onChange:h=>{const D=h.target.value;R(null),w({...p,passport:D,__disableConfirm:!p.remark||!D})},fullWidth:!0,label:c("setting.accessKey.passport"),disabled:T,children:a.map(h=>e.jsx(V,{value:h.name,"data-cy":`update-access-key-passport-option-${h.name}`,children:e.jsxs(f,{children:[e.jsx("span",{children:h.title||h.name}),e.jsx(f,{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify",children:h.description})]})},h.name))})]}),e.jsx(Y,{disabled:!0,value:p.authType,onChange:h=>{w({...p,authType:h.target.value})}}),e.jsx(de,{placeholder:c("setting.accessKey.expireTime"),value:p.expireAt,onChange:h=>{w({...p,expireAt:h,__disableConfirm:!p.passport||!p.remark||!h})}})]}),confirm:c("common.confirm"),cancel:c("common.cancel"),color:"primary",params:{accessKeyId:s,remark:u,passport:d,expireAt:n,authType:v},onConfirm:m,onCancel:y};return e.jsxs(e.Fragment,{children:[e.jsxs(N,{edge:"end",onClick:p=>{p.stopPropagation(),x(o)},size:"small",className:"rule-action",color:"primary",children:[T?e.jsx(J,{size:16}):e.jsx(Ie,{style:{fontSize:16}}),c("common.update")]}),b&&e.jsx(me,{title:b.title,description:b.description,confirm:b.confirm,color:b.color,cancel:b.cancel,params:b.params,onConfirm:b.onConfirm,onCancel:b.onCancel})]})}se.propTypes={accessKeyId:j.string.isRequired,remark:j.string,passport:j.string,expireAt:j.string,authType:j.string,onUpdate:j.func};se.defaultProps={onUpdate:()=>{},remark:"",passport:"",expireAt:"",authType:"signature"};function ne({accessKey:t,onCancel:s}){const{t:u}=I();return e.jsx(ce,{title:u("accessKey"),onClose:s,open:!0,PaperProps:{style:{maxWidth:800}},fullWidth:!0,children:e.jsx(We,{children:e.jsx(pe,{accessKey:t})})})}ne.propTypes={accessKey:j.object.isRequired,onCancel:j.func.isRequired};ne.defaultProps={};const We=P(f)`
20
20
  margin-top: -16px;
21
21
 
22
22
  .tabs {
23
23
  margin-left: 0;
24
24
  margin-right: 0;
25
25
  }
26
- `;function pe({accessKey:t}){var a,y;const{t:s,locale:u}=I(),{api:l}=B(),{teamDid:d}=_(),{blocklet:n}=Ce(),v=U(),g=C.useCallback(async m=>m?(await l.getUser({input:{teamDid:d,user:{did:m}}})).user:null,[l,d]),i=$e(()=>g(t.createdBy),{}),c=((n==null?void 0:n.children)||[]).find(m=>{var o;return((o=m==null?void 0:m.meta)==null?void 0:o.did)===t.componentDid}),T=C.useMemo(()=>{var m;return Le((m=i==null?void 0:i.data)==null?void 0:m.avatar,d,!0)},[(a=i==null?void 0:i.data)==null?void 0:a.avatar,d]),k=v.find(m=>m.name===t.passport),b=k?k.title:t.passport,x=[{title:s("common.baseInfo"),items:[{label:s("setting.accessKey.accessKeyId"),content:e.jsx(ie,{did:t.accessKeyId,showQrcode:!0})},...t.authType==="simple"?[{label:s("setting.accessKey.accessKeySecret"),content:e.jsx(M,{children:`blocklet-${ge.toBase58(t.accessKeyPublic)}`})}]:[],{label:s("common.role"),content:e.jsx(f,{children:le(b,t.passport)})},{label:s("common.createdVia"),content:t.createdVia},{label:s("common.createdBy"),content:i!=null&&i.data?e.jsx(f,{sx:{display:"flex",alignItems:"center",".MuiAvatar-root":{width:32,height:32}},children:e.jsx(_e,{user:{...i.data,avatar:T},showDid:!0,cardType:ze.Detailed,infoType:Ne.Minimal,sx:{border:0,padding:0}})}):t.createdBy?e.jsx(ie,{did:t.createdBy,showQrcode:!0}):"-"}]},{title:s("common.timeInfo"),items:[{label:s("common.createdAt"),content:t.createdAt?$(t.createdAt,u):"-"},{label:s("common.lastUsedAt"),content:t.lastUsedAt?$(t.lastUsedAt,u):"-"},{label:s("common.expiredAt"),content:t.expireAt?e.jsx(X,{value:t.expireAt}):s("common.neverExpired")}]},{title:s("common.otherInfo"),items:[{label:s("setting.accessKey.authType"),content:t.authType},{label:s("common.remark"),content:t.remark},...t.authType!=="signature"?[{label:s("setting.accessKey.resourceType"),content:t.resourceType||"-"},{label:s("setting.accessKey.resourceId"),content:t.resourceId||"-"}]:[],...c?[{label:s("setting.accessKey.component"),content:e.jsxs(f,{width:{xs:250,sm:400},display:"flex",alignItems:"center",children:[e.jsx(Pe,{blocklet:c,ancestors:[n]}),e.jsx(f,{ml:"16px",sx:{minWidth:0},children:e.jsxs(f,{className:"component-header",children:[e.jsx(f,{className:"component-name",children:ke.getDisplayName(c,!0)}),e.jsx(f,{className:"component-version",children:(y=c==null?void 0:c.meta)==null?void 0:y.version})]})})]},c)}]:[]]}];return e.jsx(Ee,{gap:3,children:e.jsx(f,{className:"info-area",children:x.map(m=>e.jsxs(f,{mb:3,children:[e.jsx(z,{variant:"h6",sx:{mb:1.5},children:m.title}),e.jsx(f,{className:"info-grid",children:m.items.map(o=>e.jsxs(f,{className:"info-item",children:[e.jsx(f,{className:"info-label",children:e.jsx(z,{variant:"subtitle2",color:"textSecondary",children:o.label})}),e.jsx(f,{children:o.content})]},o.label))})]},m.title))})})}pe.propTypes={accessKey:j.object.isRequired};const Ee=P(V)`
26
+ `;function pe({accessKey:t}){var a,y;const{t:s,locale:u}=I(),{api:l}=B(),{teamDid:d}=_(),{blocklet:n}=Ce(),v=L(),g=C.useCallback(async m=>m?(await l.getUser({input:{teamDid:d,user:{did:m}}})).user:null,[l,d]),i=$e(()=>g(t.createdBy),{}),c=((n==null?void 0:n.children)||[]).find(m=>{var o;return((o=m==null?void 0:m.meta)==null?void 0:o.did)===t.componentDid}),T=C.useMemo(()=>{var m;return qe((m=i==null?void 0:i.data)==null?void 0:m.avatar,d,!0)},[(a=i==null?void 0:i.data)==null?void 0:a.avatar,d]),k=v.find(m=>m.name===t.passport),b=k?k.title:t.passport,x=[{title:s("common.baseInfo"),items:[{label:s("setting.accessKey.accessKeyId"),content:e.jsx(ie,{did:t.accessKeyId,showQrcode:!0})},...t.authType==="simple"?[{label:s("setting.accessKey.accessKeySecret"),content:e.jsx(E,{children:`blocklet-${ge.toBase58(t.accessKeyPublic)}`})}]:[],{label:s("common.role"),content:e.jsx(f,{children:le(b,t.passport)})},{label:s("common.createdVia"),content:t.createdVia},{label:s("common.createdBy"),content:i!=null&&i.data?e.jsx(f,{sx:{display:"flex",alignItems:"center",".MuiAvatar-root":{width:32,height:32}},children:e.jsx(_e,{user:{...i.data,avatar:T},showDid:!0,cardType:ze.Detailed,infoType:Ne.Minimal,sx:{border:0,padding:0}})}):t.createdBy?e.jsx(ie,{did:t.createdBy,showQrcode:!0}):"-"}]},{title:s("common.timeInfo"),items:[{label:s("common.createdAt"),content:t.createdAt?$(t.createdAt,u):"-"},{label:s("common.lastUsedAt"),content:t.lastUsedAt?$(t.lastUsedAt,u):"-"},{label:s("common.expiredAt"),content:t.expireAt?e.jsx(X,{value:t.expireAt}):s("common.neverExpired")}]},{title:s("common.otherInfo"),items:[{label:s("setting.accessKey.authType"),content:t.authType},{label:s("common.remark"),content:t.remark},...t.authType!=="signature"?[{label:s("setting.accessKey.resourceType"),content:t.resourceType||"-"},{label:s("setting.accessKey.resourceId"),content:t.resourceId||"-"}]:[],...c?[{label:s("setting.accessKey.component"),content:e.jsxs(f,{width:{xs:250,sm:400},display:"flex",alignItems:"center",children:[e.jsx(Pe,{blocklet:c,ancestors:[n]}),e.jsx(f,{ml:"16px",sx:{minWidth:0},children:e.jsxs(f,{className:"component-header",children:[e.jsx(f,{className:"component-name",children:ke.getDisplayName(c,!0)}),e.jsx(f,{className:"component-version",children:(y=c==null?void 0:c.meta)==null?void 0:y.version})]})})]},c)}]:[]]}];return e.jsx(Fe,{gap:3,children:e.jsx(f,{className:"info-area",children:x.map(m=>e.jsxs(f,{mb:3,children:[e.jsx(z,{variant:"h6",sx:{mb:1.5},children:m.title}),e.jsx(f,{className:"info-grid",children:m.items.map(o=>e.jsxs(f,{className:"info-item",children:[e.jsx(f,{className:"info-label",children:e.jsx(z,{variant:"subtitle2",color:"textSecondary",children:o.label})}),e.jsx(f,{children:o.content})]},o.label))})]},m.title))})})}pe.propTypes={accessKey:j.object.isRequired};const Fe=P(Q)`
27
27
  .info-card {
28
28
  margin-bottom: 24px;
29
29
  overflow: hidden;
@@ -96,4 +96,4 @@ client.setAuthAccessKey({
96
96
  margin: 0;
97
97
  }
98
98
  }
99
- `;function St(){var D,L;const{t,locale:s}=I(),{api:u,inService:l}=B(),{teamDid:d}=_(),[n,v]=C.useState({}),[g,i]=C.useState(null),c=U(),T=C.useRef(null),k=`access-keys-${d}`,b=ye(k),[x,a]=C.useState({searchText:b.searchText||"",pageSize:b.rowsPerPage||10,page:1}),y=Be(async()=>await u.getAccessKeys({input:{teamDid:d,paging:{page:x.page,pageSize:x.pageSize}}}),[x.page,x.pageSize]),{loading:m,error:o}=y,p=C.useMemo(()=>{var r;return((r=y.value)==null?void 0:r.list)||[]},[(D=y.value)==null?void 0:D.list]),w=C.useMemo(()=>[{label:t("common.name"),name:"remark",options:{customBodyRender:(r,{rowIndex:A})=>{const K=p[A];return e.jsx(f,{display:"flex",alignItems:"center",gap:2,children:e.jsx(z,{children:K.remark||"N/A"})})}}},{label:"Access Key ID",name:"accessKeyId",options:{customBodyRender:r=>e.jsx(he,{showDidLogo:!1,children:r})}},{label:t("common.role"),name:"passport",options:{customBodyRender:r=>{const A=c.find(S=>S.name===r),K=A?A.title:r;return e.jsx(f,{children:le(K,r)})}}},{label:t("common.createdVia"),name:"createdVia",options:{customBodyRender:r=>e.jsx(z,{children:r})}},{label:t("setting.accessKey.authType"),name:"authType",options:{customBodyRender:r=>e.jsx(z,{children:t(`setting.accessKey.${r}`)})}},{label:t("common.createdAt"),name:"createdAt",options:{customBodyRender:r=>e.jsx(re,{title:$(r,s),children:r?e.jsx(E,{value:r,locale:s}):"-"})}},{label:t("common.lastUsedAt"),name:"lastUsedAt",options:{customBodyRender:r=>e.jsx(re,{title:$(r,s),children:r?e.jsx(E,{value:r,locale:s}):"-"})}},{label:t("common.expiredAt"),name:"expireAt",options:{customBodyRender:r=>r?e.jsx(X,{value:r}):t("common.neverExpired")}},{label:t("common.actions"),name:"actions",width:100,options:{customBodyRender:(r,{rowIndex:A})=>{const K=p[A];return e.jsxs(f,{display:"flex",gap:1,children:[e.jsx(se,{...K,onUpdate:y.retry}),e.jsx(te,{accessKeyId:K.accessKeyId,time:K.lastUsedAt,remark:K.remark||"N/A",onDelete:y.retry})]})}}}],[p,s,t,y.retry,c]),R=({page:r,rowsPerPage:A,searchText:K})=>{x.pageSize!==A?a(S=>({...S,searchText:"",pageSize:A,page:1})):x.page!==r+1?a(S=>({...S,searchText:"",page:r+1})):x.searchText!==K&&a(S=>({...S,searchText:K,page:1}))},h=x.searchText?p.filter(r=>r.accessKeyId.toLowerCase().includes(x.searchText.toLowerCase())||(r.remark||"").toLowerCase().includes(x.searchText.toLowerCase())):p;return o?e.jsx(Te,{severity:"error",children:Ue(o)}):e.jsxs(f,{ref:T,sx:{".custom-toobar-btns":{gap:"8px"}},children:[e.jsx(je,{durable:k,durableKeys:["page","rowsPerPage"],data:h,columns:w,options:{sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,page:x.page-1,rowsPerPage:x.pageSize,count:((L=y.value)==null?void 0:L.count)||0,searchDebounceTime:600,onRowClick(r,{dataIndex:A},K){var S;if((S=T.current)!=null&&S.contains(K.target)){const ue=h[A];i(ue)}}},loading:m,onChange:R,customButtons:[e.jsx(Re,{permission:l?"":"mutate_accessKey",children:e.jsx(Z,{onCreate:r=>{const{accessKeyId:A,accessKeySecret:K,authType:S}=r;v({show:!0,accessKeyId:A,accessKeySecret:K,authType:S})}})})]}),n.show&&e.jsx(ee,{hideSecret:n.authType==="signature",onConfirm:()=>{y.retry(),v({show:!1})},...n}),g&&e.jsx(ne,{onCancel:()=>i(null),accessKey:g})]})}export{St as default};
99
+ `;function St(){var D,q;const{t,locale:s}=I(),{api:u,inService:l}=B(),{teamDid:d}=_(),[n,v]=C.useState({}),[g,i]=C.useState(null),c=L(),T=C.useRef(null),k=`access-keys-${d}`,b=ye(k),[x,a]=C.useState({searchText:b.searchText||"",pageSize:b.rowsPerPage||10,page:1}),y=Be(async()=>await u.getAccessKeys({input:{teamDid:d,paging:{page:x.page,pageSize:x.pageSize}}}),[x.page,x.pageSize]),{loading:m,error:o}=y,p=C.useMemo(()=>{var r;return((r=y.value)==null?void 0:r.list)||[]},[(D=y.value)==null?void 0:D.list]),w=C.useMemo(()=>[{label:t("common.name"),name:"remark",options:{customBodyRender:(r,{rowIndex:A})=>{const K=p[A];return e.jsx(f,{display:"flex",alignItems:"center",gap:2,children:e.jsx(z,{children:K.remark||"N/A"})})}}},{label:"Access Key ID",name:"accessKeyId",options:{customBodyRender:r=>e.jsx(he,{showDidLogo:!1,children:r})}},{label:t("common.role"),name:"passport",options:{customBodyRender:r=>{const A=c.find(S=>S.name===r),K=A?A.title:r;return e.jsx(f,{children:le(K,r)})}}},{label:t("common.createdVia"),name:"createdVia",options:{customBodyRender:r=>e.jsx(z,{children:r})}},{label:t("setting.accessKey.authType"),name:"authType",options:{customBodyRender:r=>e.jsx(z,{children:t(`setting.accessKey.${r}`)})}},{label:t("common.createdAt"),name:"createdAt",options:{customBodyRender:r=>e.jsx(re,{title:$(r,s),children:r?e.jsx(F,{value:r,locale:s}):"-"})}},{label:t("common.lastUsedAt"),name:"lastUsedAt",options:{customBodyRender:r=>e.jsx(re,{title:$(r,s),children:r?e.jsx(F,{value:r,locale:s}):"-"})}},{label:t("common.expiredAt"),name:"expireAt",options:{customBodyRender:r=>r?e.jsx(X,{value:r}):t("common.neverExpired")}},{label:t("common.actions"),name:"actions",width:100,options:{customBodyRender:(r,{rowIndex:A})=>{const K=p[A];return e.jsxs(f,{display:"flex",gap:1,children:[e.jsx(se,{...K,onUpdate:y.retry}),e.jsx(te,{accessKeyId:K.accessKeyId,time:K.lastUsedAt,remark:K.remark||"N/A",onDelete:y.retry})]})}}}],[p,s,t,y.retry,c]),R=({page:r,rowsPerPage:A,searchText:K})=>{x.pageSize!==A?a(S=>({...S,searchText:"",pageSize:A,page:1})):x.page!==r+1?a(S=>({...S,searchText:"",page:r+1})):x.searchText!==K&&a(S=>({...S,searchText:K,page:1}))},h=x.searchText?p.filter(r=>r.accessKeyId.toLowerCase().includes(x.searchText.toLowerCase())||(r.remark||"").toLowerCase().includes(x.searchText.toLowerCase())):p;return o?e.jsx(Te,{severity:"error",children:Le(o)}):e.jsxs(f,{ref:T,sx:{".custom-toobar-btns":{gap:"8px"}},children:[e.jsx(je,{durable:k,durableKeys:["page","rowsPerPage"],data:h,columns:w,options:{sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,page:x.page-1,rowsPerPage:x.pageSize,count:((q=y.value)==null?void 0:q.count)||0,searchDebounceTime:600,onRowClick(r,{dataIndex:A},K){var S;if((S=T.current)!=null&&S.contains(K.target)){const ue=h[A];i(ue)}}},loading:m,onChange:R,customButtons:[e.jsx(Re,{permission:l?"":"mutate_accessKey",children:e.jsx(Z,{onCreate:r=>{const{accessKeyId:A,accessKeySecret:K,authType:S}=r;v({show:!0,accessKeyId:A,accessKeySecret:K,authType:S})}})})]}),n.show&&e.jsx(ee,{hideSecret:n.authType==="signature",onConfirm:()=>{y.retry(),v({show:!1})},...n}),g&&e.jsx(ne,{onCancel:()=>i(null),accessKey:g})]})}export{St as default};
@@ -1 +1 @@
1
- import{v as b}from"./vendor-utils-BUwfcN20.js";function c(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function A(o,e){for(var r="",i=0,l=-1,t=0,n,f=0;f<=o.length;++f){if(f<o.length)n=o.charCodeAt(f);else{if(n===47)break;n=47}if(n===47){if(!(l===f-1||t===1))if(l!==f-1&&t===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var s=r.lastIndexOf("/");if(s!==r.length-1){s===-1?(r="",i=0):(r=r.slice(0,s),i=r.length-1-r.lastIndexOf("/")),l=f,t=0;continue}}else if(r.length===2||r.length===1){r="",i=0,l=f,t=0;continue}}e&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+o.slice(l+1,f):r=o.slice(l+1,f),i=f-l-1;l=f,t=0}else n===46&&t!==-1?++t:t=-1}return r}function h(o,e){var r=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+i:r+o+i:i}var g={resolve:function(){for(var e="",r=!1,i,l=arguments.length-1;l>=-1&&!r;l--){var t;l>=0?t=arguments[l]:(i===void 0&&(i=b.cwd()),t=i),c(t),t.length!==0&&(e=t+"/"+e,r=t.charCodeAt(0)===47)}return e=A(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(c(e),e.length===0)return".";var r=e.charCodeAt(0)===47,i=e.charCodeAt(e.length-1)===47;return e=A(e,!r),e.length===0&&!r&&(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return c(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var e,r=0;r<arguments.length;++r){var i=arguments[r];c(i),i.length>0&&(e===void 0?e=i:e+="/"+i)}return e===void 0?".":g.normalize(e)},relative:function(e,r){if(c(e),c(r),e===r||(e=g.resolve(e),r=g.resolve(r),e===r))return"";for(var i=1;i<e.length&&e.charCodeAt(i)===47;++i);for(var l=e.length,t=l-i,n=1;n<r.length&&r.charCodeAt(n)===47;++n);for(var f=r.length,s=f-n,v=t<s?t:s,u=-1,a=0;a<=v;++a){if(a===v){if(s>v){if(r.charCodeAt(n+a)===47)return r.slice(n+a+1);if(a===0)return r.slice(n+a)}else t>v&&(e.charCodeAt(i+a)===47?u=a:a===0&&(u=0));break}var m=e.charCodeAt(i+a),C=r.charCodeAt(n+a);if(m!==C)break;m===47&&(u=a)}var d="";for(a=i+u+1;a<=l;++a)(a===l||e.charCodeAt(a)===47)&&(d.length===0?d+="..":d+="/..");return d.length>0?d+r.slice(n+u):(n+=u,r.charCodeAt(n)===47&&++n,r.slice(n))},_makeLong:function(e){return e},dirname:function(e){if(c(e),e.length===0)return".";for(var r=e.charCodeAt(0),i=r===47,l=-1,t=!0,n=e.length-1;n>=1;--n)if(r=e.charCodeAt(n),r===47){if(!t){l=n;break}}else t=!1;return l===-1?i?"/":".":i&&l===1?"//":e.slice(0,l)},basename:function(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');c(e);var i=0,l=-1,t=!0,n;if(r!==void 0&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var f=r.length-1,s=-1;for(n=e.length-1;n>=0;--n){var v=e.charCodeAt(n);if(v===47){if(!t){i=n+1;break}}else s===-1&&(t=!1,s=n+1),f>=0&&(v===r.charCodeAt(f)?--f===-1&&(l=n):(f=-1,l=s))}return i===l?l=s:l===-1&&(l=e.length),e.slice(i,l)}else{for(n=e.length-1;n>=0;--n)if(e.charCodeAt(n)===47){if(!t){i=n+1;break}}else l===-1&&(t=!1,l=n+1);return l===-1?"":e.slice(i,l)}},extname:function(e){c(e);for(var r=-1,i=0,l=-1,t=!0,n=0,f=e.length-1;f>=0;--f){var s=e.charCodeAt(f);if(s===47){if(!t){i=f+1;break}continue}l===-1&&(t=!1,l=f+1),s===46?r===-1?r=f:n!==1&&(n=1):r!==-1&&(n=-1)}return r===-1||l===-1||n===0||n===1&&r===l-1&&r===i+1?"":e.slice(r,l)},format:function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return h("/",e)},parse:function(e){c(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var i=e.charCodeAt(0),l=i===47,t;l?(r.root="/",t=1):t=0;for(var n=-1,f=0,s=-1,v=!0,u=e.length-1,a=0;u>=t;--u){if(i=e.charCodeAt(u),i===47){if(!v){f=u+1;break}continue}s===-1&&(v=!1,s=u+1),i===46?n===-1?n=u:a!==1&&(a=1):n!==-1&&(a=-1)}return n===-1||s===-1||a===0||a===1&&n===s-1&&n===f+1?s!==-1&&(f===0&&l?r.base=r.name=e.slice(1,s):r.base=r.name=e.slice(f,s)):(f===0&&l?(r.name=e.slice(1,n),r.base=e.slice(1,s)):(r.name=e.slice(f,n),r.base=e.slice(f,s)),r.ext=e.slice(n,s)),f>0?r.dir=e.slice(0,f-1):l&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};g.posix=g;var y=g;export{y as p};
1
+ import{v as b}from"./vendor-utils-CjMBJT5V.js";function c(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function A(o,e){for(var r="",i=0,l=-1,t=0,n,f=0;f<=o.length;++f){if(f<o.length)n=o.charCodeAt(f);else{if(n===47)break;n=47}if(n===47){if(!(l===f-1||t===1))if(l!==f-1&&t===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var s=r.lastIndexOf("/");if(s!==r.length-1){s===-1?(r="",i=0):(r=r.slice(0,s),i=r.length-1-r.lastIndexOf("/")),l=f,t=0;continue}}else if(r.length===2||r.length===1){r="",i=0,l=f,t=0;continue}}e&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+o.slice(l+1,f):r=o.slice(l+1,f),i=f-l-1;l=f,t=0}else n===46&&t!==-1?++t:t=-1}return r}function h(o,e){var r=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+i:r+o+i:i}var g={resolve:function(){for(var e="",r=!1,i,l=arguments.length-1;l>=-1&&!r;l--){var t;l>=0?t=arguments[l]:(i===void 0&&(i=b.cwd()),t=i),c(t),t.length!==0&&(e=t+"/"+e,r=t.charCodeAt(0)===47)}return e=A(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(c(e),e.length===0)return".";var r=e.charCodeAt(0)===47,i=e.charCodeAt(e.length-1)===47;return e=A(e,!r),e.length===0&&!r&&(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return c(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var e,r=0;r<arguments.length;++r){var i=arguments[r];c(i),i.length>0&&(e===void 0?e=i:e+="/"+i)}return e===void 0?".":g.normalize(e)},relative:function(e,r){if(c(e),c(r),e===r||(e=g.resolve(e),r=g.resolve(r),e===r))return"";for(var i=1;i<e.length&&e.charCodeAt(i)===47;++i);for(var l=e.length,t=l-i,n=1;n<r.length&&r.charCodeAt(n)===47;++n);for(var f=r.length,s=f-n,v=t<s?t:s,u=-1,a=0;a<=v;++a){if(a===v){if(s>v){if(r.charCodeAt(n+a)===47)return r.slice(n+a+1);if(a===0)return r.slice(n+a)}else t>v&&(e.charCodeAt(i+a)===47?u=a:a===0&&(u=0));break}var m=e.charCodeAt(i+a),C=r.charCodeAt(n+a);if(m!==C)break;m===47&&(u=a)}var d="";for(a=i+u+1;a<=l;++a)(a===l||e.charCodeAt(a)===47)&&(d.length===0?d+="..":d+="/..");return d.length>0?d+r.slice(n+u):(n+=u,r.charCodeAt(n)===47&&++n,r.slice(n))},_makeLong:function(e){return e},dirname:function(e){if(c(e),e.length===0)return".";for(var r=e.charCodeAt(0),i=r===47,l=-1,t=!0,n=e.length-1;n>=1;--n)if(r=e.charCodeAt(n),r===47){if(!t){l=n;break}}else t=!1;return l===-1?i?"/":".":i&&l===1?"//":e.slice(0,l)},basename:function(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');c(e);var i=0,l=-1,t=!0,n;if(r!==void 0&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var f=r.length-1,s=-1;for(n=e.length-1;n>=0;--n){var v=e.charCodeAt(n);if(v===47){if(!t){i=n+1;break}}else s===-1&&(t=!1,s=n+1),f>=0&&(v===r.charCodeAt(f)?--f===-1&&(l=n):(f=-1,l=s))}return i===l?l=s:l===-1&&(l=e.length),e.slice(i,l)}else{for(n=e.length-1;n>=0;--n)if(e.charCodeAt(n)===47){if(!t){i=n+1;break}}else l===-1&&(t=!1,l=n+1);return l===-1?"":e.slice(i,l)}},extname:function(e){c(e);for(var r=-1,i=0,l=-1,t=!0,n=0,f=e.length-1;f>=0;--f){var s=e.charCodeAt(f);if(s===47){if(!t){i=f+1;break}continue}l===-1&&(t=!1,l=f+1),s===46?r===-1?r=f:n!==1&&(n=1):r!==-1&&(n=-1)}return r===-1||l===-1||n===0||n===1&&r===l-1&&r===i+1?"":e.slice(r,l)},format:function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return h("/",e)},parse:function(e){c(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var i=e.charCodeAt(0),l=i===47,t;l?(r.root="/",t=1):t=0;for(var n=-1,f=0,s=-1,v=!0,u=e.length-1,a=0;u>=t;--u){if(i=e.charCodeAt(u),i===47){if(!v){f=u+1;break}continue}s===-1&&(v=!1,s=u+1),i===46?n===-1?n=u:a!==1&&(a=1):n!==-1&&(a=-1)}return n===-1||s===-1||a===0||a===1&&n===s-1&&n===f+1?s!==-1&&(f===0&&l?r.base=r.name=e.slice(1,s):r.base=r.name=e.slice(f,s)):(f===0&&l?(r.name=e.slice(1,n),r.base=e.slice(1,s)):(r.name=e.slice(f,n),r.base=e.slice(f,s)),r.ext=e.slice(n,s)),f>0?r.dir=e.slice(0,f-1):l&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};g.posix=g;var y=g;export{y as p};
@@ -1 +1 @@
1
- .react-international-phone-country-selector{position:relative}.react-international-phone-country-selector-button{display:flex;height:var(--react-international-phone-height, 36px);box-sizing:border-box;align-items:center;justify-content:center;padding:0;border:1px solid var(--react-international-phone-country-selector-border-color, var(--react-international-phone-border-color, gainsboro));margin:0;-moz-appearance:button;appearance:button;-webkit-appearance:button;background-color:var(--react-international-phone-country-selector-background-color, var(--react-international-phone-background-color, white));cursor:pointer;text-transform:none;-webkit-user-select:none;user-select:none}.react-international-phone-country-selector-button:hover{background-color:var(--react-international-phone-country-selector-background-color-hover, whitesmoke)}.react-international-phone-country-selector-button--hide-dropdown{cursor:auto}.react-international-phone-country-selector-button--hide-dropdown:hover{background-color:transparent}.react-international-phone-country-selector-button__button-content{display:flex;align-items:center;justify-content:center}.react-international-phone-country-selector-button__flag-emoji{margin:0 4px}.react-international-phone-country-selector-button__flag-emoji--disabled{opacity:.75}.react-international-phone-country-selector-button__dropdown-arrow{border-top:var(--react-international-phone-country-selector-arrow-size, 4px) solid var(--react-international-phone-country-selector-arrow-color, #777);border-right:var(--react-international-phone-country-selector-arrow-size, 4px) solid transparent;border-left:var(--react-international-phone-country-selector-arrow-size, 4px) solid transparent;margin-right:4px;transition:all .1s ease-out}.react-international-phone-country-selector-button__dropdown-arrow--active{transform:rotateX(180deg)}.react-international-phone-country-selector-button__dropdown-arrow--disabled{border-top-color:var(--react-international-phone-disabled-country-selector-arrow-color, #999)}.react-international-phone-country-selector-button--disabled{background-color:var(--react-international-phone-disabled-country-selector-background-color, var(--react-international-phone-disabled-background-color, whitesmoke));cursor:auto}.react-international-phone-country-selector-button--disabled:hover{background-color:var(--react-international-phone-disabled-country-selector-background-color, var(--react-international-phone-disabled-background-color, whitesmoke))}.react-international-phone-flag-emoji{width:var(--react-international-phone-flag-width, 24px);height:var(--react-international-phone-flag-height, 24px);box-sizing:border-box}.react-international-phone-country-selector-dropdown{position:absolute;z-index:1;top:var(--react-international-phone-dropdown-left, 44px);left:var(--react-international-phone-dropdown-left, 0);display:flex;width:300px;max-height:200px;flex-direction:column;padding:4px 0;margin:0;background-color:var(--react-international-phone-dropdown-item-background-color, var(--react-international-phone-background-color, white));box-shadow:var(--react-international-phone-dropdown-shadow, 2px 2px 16px rgba(0, 0, 0, .25));color:var(--react-international-phone-dropdown-item-text-color, var(--react-international-phone-text-color, #222));list-style:none;overflow-y:scroll}.react-international-phone-country-selector-dropdown__list-item{display:flex;min-height:var(--react-international-phone-dropdown-item-height, 28px);box-sizing:border-box;align-items:center;padding:2px 8px}.react-international-phone-country-selector-dropdown__list-item-flag-emoji{margin-right:8px}.react-international-phone-country-selector-dropdown__list-item-country-name{margin-right:8px;font-size:var(--react-international-phone-dropdown-item-font-size, 14px)}.react-international-phone-country-selector-dropdown__list-item-dial-code{color:var(--react-international-phone-dropdown-item-dial-code-color, gray);font-size:var(--react-international-phone-dropdown-item-font-size, 14px)}.react-international-phone-country-selector-dropdown__list-item:hover{background-color:var(--react-international-phone-selected-dropdown-item-background-color, var(--react-international-phone-selected-dropdown-item-background-color, whitesmoke));cursor:pointer}.react-international-phone-country-selector-dropdown__list-item--selected,.react-international-phone-country-selector-dropdown__list-item--focused{background-color:var(--react-international-phone-selected-dropdown-item-background-color, whitesmoke);color:var(--react-international-phone-selected-dropdown-item-text-color, var(--react-international-phone-text-color, #222))}.react-international-phone-country-selector-dropdown__list-item--selected .react-international-phone-country-selector-dropdown__list-item-dial-code,.react-international-phone-country-selector-dropdown__list-item--focused .react-international-phone-country-selector-dropdown__list-item-dial-code{color:var(--react-international-phone-selected-dropdown-item-dial-code-color, var(--react-international-phone-dropdown-item-dial-code-color, gray))}.react-international-phone-country-selector-dropdown__list-item--focused{background-color:var(--react-international-phone-selected-dropdown-item-background-color, var(--react-international-phone-selected-dropdown-item-background-color, whitesmoke))}.react-international-phone-dial-code-preview{display:flex;align-items:center;justify-content:center;padding:0 8px;border:1px solid var(--react-international-phone-dial-code-preview-border-color, var(--react-international-phone-border-color, gainsboro));margin-right:-1px;background-color:var(--react-international-phone-dial-code-preview-background-color, var(--react-international-phone-background-color, white));color:var(--react-international-phone-dial-code-preview-text-color, var(--react-international-phone-text-color, #222));font-size:var(--react-international-phone-dial-code-preview-font-size, var(--react-international-phone-font-size, 13px))}.react-international-phone-dial-code-preview--disabled{background-color:var(--react-international-phone-dial-code-preview-disabled-background-color, var(--react-international-phone-disabled-background-color, whitesmoke));color:var(--react-international-phone-dial-code-preview-disabled-text-color, var(--react-international-phone-disabled-text-color, #666))}.react-international-phone-input-container{display:flex}.react-international-phone-input-container .react-international-phone-country-selector-button{border-radius:var(--react-international-phone-border-radius, 4px);margin-right:-1px;border-bottom-right-radius:0;border-top-right-radius:0}.react-international-phone-input-container .react-international-phone-input{overflow:visible;height:var(--react-international-phone-height, 36px);box-sizing:border-box;padding:0 8px;border:1px solid var(--react-international-phone-border-color, gainsboro);border-radius:var(--react-international-phone-border-radius, 4px);margin:0;background-color:var(--react-international-phone-background-color, white);border-bottom-left-radius:0;border-top-left-radius:0;color:var(--react-international-phone-text-color, #222);font-family:inherit;font-size:var(--react-international-phone-font-size, 13px)}.react-international-phone-input-container .react-international-phone-input:focus{outline:none}.react-international-phone-input-container .react-international-phone-input--disabled{background-color:var(--react-international-phone-disabled-background-color, whitesmoke);color:var(--react-international-phone-disabled-text-color, #666)}:root{--backgrounds-bg-base: #ffffff;--backgrounds-bg-base-hover: #f9fafb;--backgrounds-bg-base-pressed: #f3f4f6;--backgrounds-bg-component: #f1f3f5;--backgrounds-bg-component-hover: #e5e7eb;--backgrounds-bg-disabled: #f3f4f6;--backgrounds-bg-field: #f9fafb;--backgrounds-bg-field-hover: #f3f4f6;--backgrounds-bg-glass: #ffffffb8;--backgrounds-bg-highlight: #eff6ff;--backgrounds-bg-highlight-hover: #dbeafe;--backgrounds-bg-interactive: #3b82f6;--backgrounds-bg-interactive-hover: #2563eb;--backgrounds-bg-overlay: #03071266;--backgrounds-bg-subtle: #f9fafb;--backgrounds-bg-subtle-hover: #f3f4f6;--backgrounds-bg-subtle-pressed: #e5e7eb;--backgrounds-bg-switch-off: #e5e7eb;--backgrounds-bg-switch-off-hover: #d1d5db;--buttons-button-danger: #e11d48;--buttons-button-danger-hover: #be123c;--buttons-button-danger-pressed: #9f1239;--buttons-button-inverted: #030712;--buttons-button-inverted-hover: #111827;--buttons-button-inverted-pressed: #1f2937;--buttons-button-neutral: #ffffff;--buttons-button-neutral-hover: #f3f4f6;--buttons-button-neutral-pressed: #e5e7eb;--buttons-button-transparent: #ffffff00;--buttons-button-transparent-hover: #f3f4f6;--buttons-button-transparent-pressed: #e5e7eb;--foregrounds-fg-base: #030712;--foregrounds-fg-danger: #e11d48;--foregrounds-fg-disabled: #d1d5db;--foregrounds-fg-interactive: #3b82f6;--foregrounds-fg-interactive-hover: #2563eb;--foregrounds-fg-muted: #9ca3af;--foregrounds-fg-on-color: #ffffff;--foregrounds-fg-on-inverted: #ffffff;--foregrounds-fg-subtle: #4b5563;--others-spacer: #ffffff00;--shadows-card-hover-1: #03071214;--shadows-card-hover-2: #03071214;--shadows-card-hover-3: #0307121a;--shadows-card-rest-1: #03071214;--shadows-card-rest-2: #03071214;--shadows-card-rest-3: #0307120a;--shadows-danger-1: #e11d48;--shadows-error-2: #e11d4826;--shadows-flyout-1: #03071214;--shadows-flyout-2: #03071214;--shadows-interactive-with-active-1: #3b82f6;--shadows-interactive-with-active-2: #3b82f633;--shadows-interactive-with-shadow-1: #1e3a8a80;--shadows-interactive-with-shadow-2: #3b82f6;--shadows-modal-1: #ffffff;--shadows-modal-2: #e5e7eb66;--shadows-modal-3: #03071214;--shadows-modal-4: #03071214;--shadows-modal-5: #03071214;--shadows-switch-background-1: #0307120a;--shadows-switch-background-2: #0307120a;--shadows-switch-background-3: #0307120f;--shadows-switch-background-4: #03071205;--shadows-switch-background-5: #0307120a;--shadows-switch-handle-1: #ffffff;--shadows-switch-handle-2: #ffffff;--shadows-switch-handle-3: #03071205;--shadows-switch-handle-4: #03071205;--shadows-switch-handle-5: #0307120a;--shadows-switch-handle-6: #0307121f;--shadows-switch-handle-7: #03071214;--shadows-tooltip-1: #03071214;--shadows-tooltip-2: #03071214;--stroke-border-base: #eff1f5;--stroke-border-error: #e11d48;--stroke-border-interactive: #3b82f6;--stroke-border-loud: #030712;--stroke-border-strong: #d1d5db;--stroke-sep: #eff1f5;--tags-tag-blue-bg: #dbeafe;--tags-tag-blue-bg-hover: #bfdbfe;--tags-tag-blue-border: #bfdbfe;--tags-tag-blue-icon: #2563eb;--tags-tag-blue-text: #1d4ed8;--tags-tag-green-bg: #d1fae5;--tags-tag-green-bg-hover: #a7f3d0;--tags-tag-green-border: #a7f3d0;--tags-tag-green-icon: #059669;--tags-tag-green-text: #047857;--tags-tag-neutral-bg: #f3f4f6;--tags-tag-neutral-bg-hover: #e5e7eb;--tags-tag-neutral-border: #e5e7eb;--tags-tag-neutral-icon: #6b7280;--tags-tag-neutral-text: #4b5563;--tags-tag-orange-bg: #fef4c7;--tags-tag-orange-bg-hover: #fde68a;--tags-tag-orange-border: #fde68a;--tags-tag-orange-icon: #d97706;--tags-tag-orange-text: #b45309;--tags-tag-purple-bg: #ede9fe;--tags-tag-purple-bg-hover: #ddd6fe;--tags-tag-purple-border: #ddd6fe;--tags-tag-purple-icon: #7c3aed;--tags-tag-purple-text: #6d28d9;--tags-tag-red-bg: #ffe4e6;--tags-tag-red-bg-hover: #fecdd3;--tags-tag-red-border: #fecdd3;--tags-tag-red-icon: #e11d48;--tags-tag-red-text: #be123c;--radius-s: .25rem;--radius-m: .5rem;--radius-l: .75rem;--radius-round: 624.9375rem;--stroke-button-secondary-border: #e5e7eb}[data-theme=dark]{--backgrounds-bg-base: #1b1b1f;--backgrounds-bg-base-hover: #27282d;--backgrounds-bg-base-pressed: #2e3035;--backgrounds-bg-component: #27282d;--backgrounds-bg-component-hover: #27282d;--backgrounds-bg-disabled: #27282d;--backgrounds-bg-field: #27282d;--backgrounds-bg-field-hover: #2e3035;--backgrounds-bg-glass: #1b1b1fb8;--backgrounds-bg-highlight: #172554;--backgrounds-bg-highlight-hover: #1e3a8a;--backgrounds-bg-interactive: #60a5fa;--backgrounds-bg-interactive-hover: #60a5fa;--backgrounds-bg-overlay: #18181ab2;--backgrounds-bg-subtle: #18181a;--backgrounds-bg-subtle-hover: #1b1b1f;--backgrounds-bg-subtle-pressed: #27282d;--backgrounds-bg-switch-off: #35373c;--backgrounds-bg-switch-off-hover: #464b50;--buttons-button-danger: #9f1239;--buttons-button-danger-hover: #be123c;--buttons-button-danger-pressed: #e11d48;--buttons-button-inverted: #edeef0;--buttons-button-inverted-hover: #ffffff;--buttons-button-inverted-pressed: #edeef0;--buttons-button-neutral: #27282d;--buttons-button-neutral-hover: #35373c;--buttons-button-neutral-pressed: #3c3f44;--buttons-button-transparent: #ffffff00;--buttons-button-transparent-hover: #27282d;--buttons-button-transparent-pressed: #2e3035;--foregrounds-fg-base: #edeef0;--foregrounds-fg-danger: #fb7185;--foregrounds-fg-disabled: #3c3f44;--foregrounds-fg-interactive: #60a5fa;--foregrounds-fg-interactive-hover: #3b82f6;--foregrounds-fg-muted: #696e77;--foregrounds-fg-on-color: #ffffff;--foregrounds-fg-on-inverted: #0a0a0a;--foregrounds-fg-subtle: #adb1b8;--others-spacer: #ffffff;--shadows-card-hover-1: #ffffff1a;--shadows-card-hover-2: #ffffff29;--shadows-card-hover-3: #00000066;--shadows-card-rest-1: #ffffff1a;--shadows-card-rest-2: #ffffff29;--shadows-card-rest-3: #00000066;--shadows-danger-1: #f43f5e1a;--shadows-error-2: #e11d4840;--shadows-flyout-1: #ffffff1a;--shadows-flyout-2: #00000052;--shadows-interactive-with-active-1: #60a5fa;--shadows-interactive-with-active-2: #3b82f640;--shadows-interactive-with-shadow-1: #dbeafe80;--shadows-interactive-with-shadow-2: #60a5fa;--shadows-modal-1: #171717;--shadows-modal-2: #2e303566;--shadows-modal-3: #ffffff1a;--shadows-modal-4: #00000052;--shadows-modal-5: #00000052;--shadows-switch-background-1: #0000001a;--shadows-switch-background-2: #0000001a;--shadows-switch-background-3: #ffffff29;--shadows-switch-background-4: #0000001a;--shadows-switch-background-5: #00000033;--shadows-switch-handle-1: #ffffff;--shadows-switch-handle-2: #ffffff;--shadows-switch-handle-3: #00000029;--shadows-switch-handle-4: #0000001a;--shadows-switch-handle-5: #0000001a;--shadows-switch-handle-6: #0000001a;--shadows-switch-handle-7: #0000001a;--shadows-tooltip-1: #ffffff1a;--shadows-tooltip-2: #00000052;--stroke-border-base: #2e3035;--stroke-border-error: #f43f5e;--stroke-border-interactive: #60a5fa;--stroke-border-loud: #edeef0;--stroke-border-strong: #35373c;--stroke-sep: #2e3035;--tags-tag-blue-bg: #172554;--tags-tag-blue-bg-hover: #1e2a8a;--tags-tag-blue-border: #1e3a8a;--tags-tag-blue-icon: #1d4ed8;--tags-tag-blue-text: #3b82f6;--tags-tag-green-bg: #022c22;--tags-tag-green-bg-hover: #064e3b;--tags-tag-green-border: #064e3b;--tags-tag-green-icon: #047857;--tags-tag-green-text: #10b981;--tags-tag-neutral-bg: #2e3035;--tags-tag-neutral-bg-hover: #35373c;--tags-tag-neutral-border: #3c3f44;--tags-tag-neutral-icon: #7d828a;--tags-tag-neutral-text: #adb1b8;--tags-tag-orange-bg: #451a03;--tags-tag-orange-bg-hover: #78350f;--tags-tag-orange-border: #78350f;--tags-tag-orange-icon: #b45309;--tags-tag-orange-text: #f59e0b;--tags-tag-purple-bg: #2e1064;--tags-tag-purple-bg-hover: #4c1d95;--tags-tag-purple-border: #3c3f44;--tags-tag-purple-icon: #6d28d9;--tags-tag-purple-text: #8b5cf6;--tags-tag-red-bg: #4c0519;--tags-tag-red-bg-hover: #881337;--tags-tag-red-border: #881337;--tags-tag-red-icon: #f43f5e;--tags-tag-red-text: #ff6369;--radius-s: .25rem;--radius-m: .5rem;--radius-l: .75rem;--radius-round: 624.9375rem;--stroke-button-secondary-border: #27282d}
1
+ .react-international-phone-country-selector{position:relative}.react-international-phone-country-selector-button{display:flex;height:var(--react-international-phone-height, 36px);box-sizing:border-box;align-items:center;justify-content:center;padding:0;border:1px solid var(--react-international-phone-country-selector-border-color, var(--react-international-phone-border-color, gainsboro));margin:0;-moz-appearance:button;appearance:button;-webkit-appearance:button;background-color:var(--react-international-phone-country-selector-background-color, var(--react-international-phone-background-color, white));cursor:pointer;text-transform:none;-webkit-user-select:none;user-select:none}.react-international-phone-country-selector-button:hover{background-color:var(--react-international-phone-country-selector-background-color-hover, whitesmoke)}.react-international-phone-country-selector-button--hide-dropdown{cursor:auto}.react-international-phone-country-selector-button--hide-dropdown:hover{background-color:transparent}.react-international-phone-country-selector-button__button-content{display:flex;align-items:center;justify-content:center}.react-international-phone-country-selector-button__flag-emoji{margin:0 4px}.react-international-phone-country-selector-button__flag-emoji--disabled{opacity:.75}.react-international-phone-country-selector-button__dropdown-arrow{border-top:var(--react-international-phone-country-selector-arrow-size, 4px) solid var(--react-international-phone-country-selector-arrow-color, #777);border-right:var(--react-international-phone-country-selector-arrow-size, 4px) solid transparent;border-left:var(--react-international-phone-country-selector-arrow-size, 4px) solid transparent;margin-right:4px;transition:all .1s ease-out}.react-international-phone-country-selector-button__dropdown-arrow--active{transform:rotateX(180deg)}.react-international-phone-country-selector-button__dropdown-arrow--disabled{border-top-color:var(--react-international-phone-disabled-country-selector-arrow-color, #999)}.react-international-phone-country-selector-button--disabled{background-color:var(--react-international-phone-disabled-country-selector-background-color, var(--react-international-phone-disabled-background-color, whitesmoke));cursor:auto}.react-international-phone-country-selector-button--disabled:hover{background-color:var(--react-international-phone-disabled-country-selector-background-color, var(--react-international-phone-disabled-background-color, whitesmoke))}.react-international-phone-flag-emoji{width:var(--react-international-phone-flag-width, 24px);height:var(--react-international-phone-flag-height, 24px);box-sizing:border-box}.react-international-phone-country-selector-dropdown{position:absolute;z-index:1;top:var(--react-international-phone-dropdown-left, 44px);left:var(--react-international-phone-dropdown-left, 0);display:flex;width:300px;max-height:200px;flex-direction:column;padding:4px 0;margin:0;background-color:var(--react-international-phone-dropdown-item-background-color, var(--react-international-phone-background-color, white));box-shadow:var(--react-international-phone-dropdown-shadow, 2px 2px 16px rgba(0, 0, 0, .25));color:var(--react-international-phone-dropdown-item-text-color, var(--react-international-phone-text-color, #222));list-style:none;overflow-y:scroll}.react-international-phone-country-selector-dropdown__list-item{display:flex;min-height:var(--react-international-phone-dropdown-item-height, 28px);box-sizing:border-box;align-items:center;padding:2px 8px}.react-international-phone-country-selector-dropdown__list-item-flag-emoji{margin-right:8px}.react-international-phone-country-selector-dropdown__list-item-country-name{margin-right:8px;font-size:var(--react-international-phone-dropdown-item-font-size, 14px)}.react-international-phone-country-selector-dropdown__list-item-dial-code{color:var(--react-international-phone-dropdown-item-dial-code-color, gray);font-size:var(--react-international-phone-dropdown-item-font-size, 14px)}.react-international-phone-country-selector-dropdown__list-item:hover{background-color:var(--react-international-phone-selected-dropdown-item-background-color, var(--react-international-phone-selected-dropdown-item-background-color, whitesmoke));cursor:pointer}.react-international-phone-country-selector-dropdown__list-item--selected,.react-international-phone-country-selector-dropdown__list-item--focused{background-color:var(--react-international-phone-selected-dropdown-item-background-color, whitesmoke);color:var(--react-international-phone-selected-dropdown-item-text-color, var(--react-international-phone-text-color, #222))}.react-international-phone-country-selector-dropdown__list-item--selected .react-international-phone-country-selector-dropdown__list-item-dial-code,.react-international-phone-country-selector-dropdown__list-item--focused .react-international-phone-country-selector-dropdown__list-item-dial-code{color:var(--react-international-phone-selected-dropdown-item-dial-code-color, var(--react-international-phone-dropdown-item-dial-code-color, gray))}.react-international-phone-country-selector-dropdown__list-item--focused{background-color:var(--react-international-phone-selected-dropdown-item-background-color, var(--react-international-phone-selected-dropdown-item-background-color, whitesmoke))}.react-international-phone-dial-code-preview{display:flex;align-items:center;justify-content:center;padding:0 8px;border:1px solid var(--react-international-phone-dial-code-preview-border-color, var(--react-international-phone-border-color, gainsboro));margin-right:-1px;background-color:var(--react-international-phone-dial-code-preview-background-color, var(--react-international-phone-background-color, white));color:var(--react-international-phone-dial-code-preview-text-color, var(--react-international-phone-text-color, #222));font-size:var(--react-international-phone-dial-code-preview-font-size, var(--react-international-phone-font-size, 13px))}.react-international-phone-dial-code-preview--disabled{background-color:var(--react-international-phone-dial-code-preview-disabled-background-color, var(--react-international-phone-disabled-background-color, whitesmoke));color:var(--react-international-phone-dial-code-preview-disabled-text-color, var(--react-international-phone-disabled-text-color, #666))}.react-international-phone-input-container{display:flex}.react-international-phone-input-container .react-international-phone-country-selector-button{border-radius:var(--react-international-phone-border-radius, 4px);margin-right:-1px;border-bottom-right-radius:0;border-top-right-radius:0}.react-international-phone-input-container .react-international-phone-input{overflow:visible;height:var(--react-international-phone-height, 36px);box-sizing:border-box;padding:0 8px;border:1px solid var(--react-international-phone-border-color, gainsboro);border-radius:var(--react-international-phone-border-radius, 4px);margin:0;background-color:var(--react-international-phone-background-color, white);border-bottom-left-radius:0;border-top-left-radius:0;color:var(--react-international-phone-text-color, #222);font-family:inherit;font-size:var(--react-international-phone-font-size, 13px)}.react-international-phone-input-container .react-international-phone-input:focus{outline:none}.react-international-phone-input-container .react-international-phone-input--disabled{background-color:var(--react-international-phone-disabled-background-color, whitesmoke);color:var(--react-international-phone-disabled-text-color, #666)}:root{--backgrounds-bg-base: #ffffff;--backgrounds-bg-base-hover: #f9fafb;--backgrounds-bg-base-pressed: #f3f4f6;--backgrounds-bg-component: #f1f3f5;--backgrounds-bg-component-hover: #e5e7eb;--backgrounds-bg-disabled: #f3f4f6;--backgrounds-bg-field: #f9fafb;--backgrounds-bg-field-hover: #f3f4f6;--backgrounds-bg-glass: #ffffffb8;--backgrounds-bg-highlight: #eff6ff;--backgrounds-bg-highlight-hover: #dbeafe;--backgrounds-bg-interactive: #3b82f6;--backgrounds-bg-interactive-hover: #2563eb;--backgrounds-bg-overlay: #03071266;--backgrounds-bg-subtle: #f9fafb;--backgrounds-bg-subtle-hover: #f3f4f6;--backgrounds-bg-subtle-pressed: #e5e7eb;--backgrounds-bg-switch-off: #e5e7eb;--backgrounds-bg-switch-off-hover: #d1d5db;--buttons-button-danger: #e11d48;--buttons-button-danger-hover: #be123c;--buttons-button-danger-pressed: #9f1239;--buttons-button-inverted: #030712;--buttons-button-inverted-hover: #111827;--buttons-button-inverted-pressed: #1f2937;--buttons-button-neutral: #ffffff;--buttons-button-neutral-hover: #f3f4f6;--buttons-button-neutral-pressed: #e5e7eb;--buttons-button-transparent: #ffffff00;--buttons-button-transparent-hover: #f3f4f6;--buttons-button-transparent-pressed: #e5e7eb;--foregrounds-fg-base: #030712;--foregrounds-fg-danger: #e11d48;--foregrounds-fg-disabled: #d1d5db;--foregrounds-fg-interactive: #3b82f6;--foregrounds-fg-interactive-hover: #2563eb;--foregrounds-fg-muted: #9ca3af;--foregrounds-fg-on-color: #ffffff;--foregrounds-fg-on-inverted: #ffffff;--foregrounds-fg-subtle: #4b5563;--foregrounds-fg-border: #e0e0e0;--others-spacer: #ffffff00;--shadows-card-hover-1: #03071214;--shadows-card-hover-2: #03071214;--shadows-card-hover-3: #0307121a;--shadows-card-rest-1: #03071214;--shadows-card-rest-2: #03071214;--shadows-card-rest-3: #0307120a;--shadows-danger-1: #e11d48;--shadows-error-2: #e11d4826;--shadows-flyout-1: #03071214;--shadows-flyout-2: #03071214;--shadows-interactive-with-active-1: #3b82f6;--shadows-interactive-with-active-2: #3b82f633;--shadows-interactive-with-shadow-1: #1e3a8a80;--shadows-interactive-with-shadow-2: #3b82f6;--shadows-modal-1: #ffffff;--shadows-modal-2: #e5e7eb66;--shadows-modal-3: #03071214;--shadows-modal-4: #03071214;--shadows-modal-5: #03071214;--shadows-switch-background-1: #0307120a;--shadows-switch-background-2: #0307120a;--shadows-switch-background-3: #0307120f;--shadows-switch-background-4: #03071205;--shadows-switch-background-5: #0307120a;--shadows-switch-handle-1: #ffffff;--shadows-switch-handle-2: #ffffff;--shadows-switch-handle-3: #03071205;--shadows-switch-handle-4: #03071205;--shadows-switch-handle-5: #0307120a;--shadows-switch-handle-6: #0307121f;--shadows-switch-handle-7: #03071214;--shadows-tooltip-1: #03071214;--shadows-tooltip-2: #03071214;--stroke-border-base: #eff1f5;--stroke-border-error: #e11d48;--stroke-border-interactive: #3b82f6;--stroke-border-loud: #030712;--stroke-border-strong: #d1d5db;--stroke-sep: #eff1f5;--tags-tag-blue-bg: #dbeafe;--tags-tag-blue-bg-hover: #bfdbfe;--tags-tag-blue-border: #bfdbfe;--tags-tag-blue-icon: #2563eb;--tags-tag-blue-text: #1d4ed8;--tags-tag-green-bg: #d1fae5;--tags-tag-green-bg-hover: #a7f3d0;--tags-tag-green-border: #a7f3d0;--tags-tag-green-icon: #059669;--tags-tag-green-text: #047857;--tags-tag-neutral-bg: #f3f4f6;--tags-tag-neutral-bg-hover: #e5e7eb;--tags-tag-neutral-border: #e5e7eb;--tags-tag-neutral-icon: #6b7280;--tags-tag-neutral-text: #4b5563;--tags-tag-orange-bg: #fef4c7;--tags-tag-orange-bg-hover: #fde68a;--tags-tag-orange-border: #fde68a;--tags-tag-orange-icon: #d97706;--tags-tag-orange-text: #b45309;--tags-tag-purple-bg: #ede9fe;--tags-tag-purple-bg-hover: #ddd6fe;--tags-tag-purple-border: #ddd6fe;--tags-tag-purple-icon: #7c3aed;--tags-tag-purple-text: #6d28d9;--tags-tag-red-bg: #ffe4e6;--tags-tag-red-bg-hover: #fecdd3;--tags-tag-red-border: #fecdd3;--tags-tag-red-icon: #e11d48;--tags-tag-red-text: #be123c;--radius-s: .25rem;--radius-m: .5rem;--radius-l: .75rem;--radius-round: 624.9375rem;--stroke-button-secondary-border: #e5e7eb}[data-theme=dark]{--backgrounds-bg-base: #1b1b1f;--backgrounds-bg-base-hover: #27282d;--backgrounds-bg-base-pressed: #2e3035;--backgrounds-bg-component: #27282d;--backgrounds-bg-component-hover: #27282d;--backgrounds-bg-disabled: #27282d;--backgrounds-bg-field: #27282d;--backgrounds-bg-field-hover: #2e3035;--backgrounds-bg-glass: #1b1b1fb8;--backgrounds-bg-highlight: #172554;--backgrounds-bg-highlight-hover: #1e3a8a;--backgrounds-bg-interactive: #60a5fa;--backgrounds-bg-interactive-hover: #60a5fa;--backgrounds-bg-overlay: #18181ab2;--backgrounds-bg-subtle: #18181a;--backgrounds-bg-subtle-hover: #1b1b1f;--backgrounds-bg-subtle-pressed: #27282d;--backgrounds-bg-switch-off: #35373c;--backgrounds-bg-switch-off-hover: #464b50;--buttons-button-danger: #9f1239;--buttons-button-danger-hover: #be123c;--buttons-button-danger-pressed: #e11d48;--buttons-button-inverted: #edeef0;--buttons-button-inverted-hover: #ffffff;--buttons-button-inverted-pressed: #edeef0;--buttons-button-neutral: #27282d;--buttons-button-neutral-hover: #35373c;--buttons-button-neutral-pressed: #3c3f44;--buttons-button-transparent: #ffffff00;--buttons-button-transparent-hover: #27282d;--buttons-button-transparent-pressed: #2e3035;--foregrounds-fg-base: #edeef0;--foregrounds-fg-danger: #fb7185;--foregrounds-fg-disabled: #3c3f44;--foregrounds-fg-interactive: #60a5fa;--foregrounds-fg-interactive-hover: #3b82f6;--foregrounds-fg-muted: #696e77;--foregrounds-fg-on-color: #ffffff;--foregrounds-fg-on-inverted: #0a0a0a;--foregrounds-fg-subtle: #adb1b8;--others-spacer: #ffffff;--shadows-card-hover-1: #ffffff1a;--shadows-card-hover-2: #ffffff29;--shadows-card-hover-3: #00000066;--shadows-card-rest-1: #ffffff1a;--shadows-card-rest-2: #ffffff29;--shadows-card-rest-3: #00000066;--shadows-danger-1: #f43f5e1a;--shadows-error-2: #e11d4840;--shadows-flyout-1: #ffffff1a;--shadows-flyout-2: #00000052;--shadows-interactive-with-active-1: #60a5fa;--shadows-interactive-with-active-2: #3b82f640;--shadows-interactive-with-shadow-1: #dbeafe80;--shadows-interactive-with-shadow-2: #60a5fa;--shadows-modal-1: #171717;--shadows-modal-2: #2e303566;--shadows-modal-3: #ffffff1a;--shadows-modal-4: #00000052;--shadows-modal-5: #00000052;--shadows-switch-background-1: #0000001a;--shadows-switch-background-2: #0000001a;--shadows-switch-background-3: #ffffff29;--shadows-switch-background-4: #0000001a;--shadows-switch-background-5: #00000033;--shadows-switch-handle-1: #ffffff;--shadows-switch-handle-2: #ffffff;--shadows-switch-handle-3: #00000029;--shadows-switch-handle-4: #0000001a;--shadows-switch-handle-5: #0000001a;--shadows-switch-handle-6: #0000001a;--shadows-switch-handle-7: #0000001a;--shadows-tooltip-1: #ffffff1a;--shadows-tooltip-2: #00000052;--stroke-border-base: #2e3035;--stroke-border-error: #f43f5e;--stroke-border-interactive: #60a5fa;--stroke-border-loud: #edeef0;--stroke-border-strong: #35373c;--stroke-sep: #2e3035;--tags-tag-blue-bg: #172554;--tags-tag-blue-bg-hover: #1e2a8a;--tags-tag-blue-border: #1e3a8a;--tags-tag-blue-icon: #1d4ed8;--tags-tag-blue-text: #3b82f6;--tags-tag-green-bg: #022c22;--tags-tag-green-bg-hover: #064e3b;--tags-tag-green-border: #064e3b;--tags-tag-green-icon: #047857;--tags-tag-green-text: #10b981;--tags-tag-neutral-bg: #2e3035;--tags-tag-neutral-bg-hover: #35373c;--tags-tag-neutral-border: #3c3f44;--tags-tag-neutral-icon: #7d828a;--tags-tag-neutral-text: #adb1b8;--tags-tag-orange-bg: #451a03;--tags-tag-orange-bg-hover: #78350f;--tags-tag-orange-border: #78350f;--tags-tag-orange-icon: #b45309;--tags-tag-orange-text: #f59e0b;--tags-tag-purple-bg: #2e1064;--tags-tag-purple-bg-hover: #4c1d95;--tags-tag-purple-border: #3c3f44;--tags-tag-purple-icon: #6d28d9;--tags-tag-purple-text: #8b5cf6;--tags-tag-red-bg: #4c0519;--tags-tag-red-bg-hover: #881337;--tags-tag-red-border: #881337;--tags-tag-red-icon: #f43f5e;--tags-tag-red-text: #ff6369;--radius-s: .25rem;--radius-m: .5rem;--radius-l: .75rem;--radius-round: 624.9375rem;--stroke-button-secondary-border: #27282d}
@@ -1,4 +1,4 @@
1
- import{j as r,T as i}from"./vendor-mui-core-B6POpIBB.js";import{_ as p,am as x}from"./vendor-utils-BUwfcN20.js";import{s as c}from"./vendor-ux-did-connect-DVrP2LNw.js";function h({name:t,nameFormatter:a=o=>typeof o=="string"?o.split(" ").map(f=>p(x(f))).join(" "):o,layout:n="horizontal",children:e,valueComponent:l="div",nameWidth:s=90,...m}){return r.jsxs(u,{layout:n,width:s,...m,children:[r.jsx(i,{color:"textSecondary",className:"info-row__name",children:a(t)}),e&&r.jsx(i,{color:"textPrimary",component:l,className:"info-row__value",children:e})]})}const u=c("div")`
1
+ import{j as r,T as i}from"./vendor-mui-core-B6POpIBB.js";import{_ as p,am as x}from"./vendor-utils-CjMBJT5V.js";import{s as c}from"./vendor-ux-did-connect-D4-ZeZHm.js";function h({name:t,nameFormatter:a=o=>typeof o=="string"?o.split(" ").map(f=>p(x(f))).join(" "):o,layout:n="horizontal",children:e,valueComponent:l="div",nameWidth:s=90,...m}){return r.jsxs(u,{layout:n,width:s,...m,children:[r.jsx(i,{color:"textSecondary",className:"info-row__name",children:a(t)}),e&&r.jsx(i,{color:"textPrimary",component:l,className:"info-row__value",children:e})]})}const u=c("div")`
2
2
  display: flex;
3
3
  flex-direction: ${t=>t.layout==="vertical"?"column":"row"};
4
4
  justify-content: flex-start;
@@ -1 +1 @@
1
- import{r as h}from"./vendor-react-DEoibe3W.js";import{H as e,j as a,bp as Y,br as w,O as S,q as j,aa as v}from"./vendor-mui-core-B6POpIBB.js";import{t as s}from"./index-Cb1OPKJL.js";import{u as H}from"./vendor-ux-did-connect-DVrP2LNw.js";import{A as M}from"./vendor-arcblock-CX-5Ex_f.js";import{f as _}from"./vendor-hooks-DpLLpTSZ.js";import{L as A,D as C}from"./vendor-mui-x-CATHW1QL.js";import{A as y}from"./AdapterDayjs-D5LoqHiU.js";function x({value:r,onChange:i,error:m,helperText:u,label:t,timezone:n}){const f=n?s().tz(n):s(),p=_(()=>{let l=s();return r&&(l=n?s(r).tz(n):s(r)),l.format("YYYY-MM-DD[T]HH:mm")},[r,n]),D=l=>{const T=n?s(l).tz(n).format("YYYY-MM-DD HH:mm:00"):s(l).format("YYYY-MM-DD HH:mm:00");i(new Date(T))};return a.jsx(A,{dateAdapter:y,children:a.jsxs(Y,{fullWidth:!0,error:m,children:[a.jsx(C,{label:t,minDateTime:f,value:s(p),onChange:D,slotProps:{textField:{error:m,helperText:m?u:""}},format:"YYYY-MM-DD HH:mm"}),u&&a.jsx(w,{children:u})]})})}x.propTypes={value:e.oneOfType([e.string,e.instanceOf(Date)]),onChange:e.func.isRequired,error:e.bool,helperText:e.string,label:e.string,timezone:e.string};x.defaultProps={value:null,error:!1,helperText:"",label:"",timezone:""};function E(r){return a.jsx(M,{...r,width:20,height:20})}const c={MINUTES_30:30*60*1e3,HOUR_1:60*60*1e3,HOURS_3:3*60*60*1e3,DAY_1:24*60*60*1e3,DAYS_7:7*24*60*60*1e3,DAYS_30:30*24*60*60*1e3};function b({placeholder:r,value:i,onChange:m,timezone:u}){const{t}=H(),[n,f]=h.useState(i||""),[p,D]=h.useState(null),l=h.useMemo(()=>[{value:new Date(Date.now()+c.MINUTES_30),label:`30 ${t("common.minutes")}`},{value:new Date(Date.now()+c.HOUR_1),label:`1 ${t("common.hour")}`},{value:new Date(Date.now()+c.HOURS_3),label:`3 ${t("common.hours")}`},{value:new Date(Date.now()+c.DAY_1),label:`1 ${t("common.day")}`},{value:new Date(Date.now()+c.DAYS_7),label:`7 ${t("common.days")}`},{value:new Date(Date.now()+c.DAYS_30),label:`30 ${t("common.days")}`},{value:"custom",label:t("common.custom")}],[t]),T=o=>{if(f(o),o==="custom"){const d=s().toDate();D(d),m(d)}else m(o)},g=o=>{D(o),m(o)};return h.useEffect(()=>{i&&(l.find(d=>s(d.value).isSame(i))||(f("custom"),D(i)))},[]),a.jsxs(a.Fragment,{children:[a.jsx(Y,{fullWidth:!0,children:a.jsx(S,{select:!0,value:n,label:r||t("team.passport.passportExpireTime"),onChange:o=>T(o.target.value),variant:"outlined",SelectProps:{IconComponent:E},children:l.map(o=>a.jsx(j,{value:o.value,children:o.label},o.value))})}),n==="custom"&&a.jsx(v,{children:a.jsx(x,{value:p,onChange:g,label:t("team.passport.customExpireTime"),timezone:u,error:!p,helperText:p?void 0:t("team.passport.customExpireTime")})})]})}b.propTypes={value:e.oneOfType([e.string,e.instanceOf(Date)]),onChange:e.func.isRequired,timezone:e.string,placeholder:e.string};b.defaultProps={value:"",timezone:"",placeholder:""};export{b as T};
1
+ import{r as h}from"./vendor-react-DEoibe3W.js";import{H as e,j as a,bp as Y,br as w,O as S,q as j,aa as v}from"./vendor-mui-core-B6POpIBB.js";import{t as s}from"./index-CksPySYI.js";import{u as H}from"./vendor-ux-did-connect-D4-ZeZHm.js";import{A as M}from"./vendor-arcblock-Dkhgjlzn.js";import{f as _}from"./vendor-hooks-DXGUREV9.js";import{L as A,D as C}from"./vendor-mui-x-CATHW1QL.js";import{A as y}from"./AdapterDayjs-BWhMsmQP.js";function x({value:r,onChange:i,error:m,helperText:u,label:t,timezone:n}){const f=n?s().tz(n):s(),p=_(()=>{let l=s();return r&&(l=n?s(r).tz(n):s(r)),l.format("YYYY-MM-DD[T]HH:mm")},[r,n]),D=l=>{const T=n?s(l).tz(n).format("YYYY-MM-DD HH:mm:00"):s(l).format("YYYY-MM-DD HH:mm:00");i(new Date(T))};return a.jsx(A,{dateAdapter:y,children:a.jsxs(Y,{fullWidth:!0,error:m,children:[a.jsx(C,{label:t,minDateTime:f,value:s(p),onChange:D,slotProps:{textField:{error:m,helperText:m?u:""}},format:"YYYY-MM-DD HH:mm"}),u&&a.jsx(w,{children:u})]})})}x.propTypes={value:e.oneOfType([e.string,e.instanceOf(Date)]),onChange:e.func.isRequired,error:e.bool,helperText:e.string,label:e.string,timezone:e.string};x.defaultProps={value:null,error:!1,helperText:"",label:"",timezone:""};function E(r){return a.jsx(M,{...r,width:20,height:20})}const c={MINUTES_30:30*60*1e3,HOUR_1:60*60*1e3,HOURS_3:3*60*60*1e3,DAY_1:24*60*60*1e3,DAYS_7:7*24*60*60*1e3,DAYS_30:30*24*60*60*1e3};function b({placeholder:r,value:i,onChange:m,timezone:u}){const{t}=H(),[n,f]=h.useState(i||""),[p,D]=h.useState(null),l=h.useMemo(()=>[{value:new Date(Date.now()+c.MINUTES_30),label:`30 ${t("common.minutes")}`},{value:new Date(Date.now()+c.HOUR_1),label:`1 ${t("common.hour")}`},{value:new Date(Date.now()+c.HOURS_3),label:`3 ${t("common.hours")}`},{value:new Date(Date.now()+c.DAY_1),label:`1 ${t("common.day")}`},{value:new Date(Date.now()+c.DAYS_7),label:`7 ${t("common.days")}`},{value:new Date(Date.now()+c.DAYS_30),label:`30 ${t("common.days")}`},{value:"custom",label:t("common.custom")}],[t]),T=o=>{if(f(o),o==="custom"){const d=s().toDate();D(d),m(d)}else m(o)},g=o=>{D(o),m(o)};return h.useEffect(()=>{i&&(l.find(d=>s(d.value).isSame(i))||(f("custom"),D(i)))},[]),a.jsxs(a.Fragment,{children:[a.jsx(Y,{fullWidth:!0,children:a.jsx(S,{select:!0,value:n,label:r||t("team.passport.passportExpireTime"),onChange:o=>T(o.target.value),variant:"outlined",SelectProps:{IconComponent:E},children:l.map(o=>a.jsx(j,{value:o.value,children:o.label},o.value))})}),n==="custom"&&a.jsx(v,{children:a.jsx(x,{value:p,onChange:g,label:t("team.passport.customExpireTime"),timezone:u,error:!p,helperText:p?void 0:t("team.passport.customExpireTime")})})]})}b.propTypes={value:e.oneOfType([e.string,e.instanceOf(Date)]),onChange:e.func.isRequired,timezone:e.string,placeholder:e.string};b.defaultProps={value:"",timezone:"",placeholder:""};export{b as T};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-C1UHqpp3.js","assets/vendor-ux-did-connect-DVrP2LNw.js","assets/vendor-react-DEoibe3W.js","assets/vendor-utils-BUwfcN20.js","assets/vendor-mui-core-B6POpIBB.js","assets/vendor-hooks-DpLLpTSZ.js","assets/lottie-web-jYmAQWuC.js","assets/vendor-ux-did-connect-DpSGLE7B.css","assets/vendor-arcblock-CX-5Ex_f.js","assets/index-DyKjKMmu.js","assets/index-Cb1OPKJL.js","assets/index-B1ljmpu4.css","assets/index-DVQCgvFb.js","assets/index-AgKpYdvC.css"])))=>i.map(i=>d[i]);
2
- import{r as x,f as Tt,l as ct,L as ke,g as Mn,u as Un,i as Vn,j as jt}from"./vendor-react-DEoibe3W.js";import{a9 as Ce,j as e,v as Be,aa as c,be as $t,H as s,ad as je,I as ce,T as E,s as Fn,c7 as Oo,D as at,ah as ye,au as Hn,bS as Ke,ak as dt,bt as et,bx as tt,y as K,ab as Re,P as Wo,G as Bo,w as Pt,a7 as Mo,M as Uo,q as fe,X as Gn,aj as Vo,t as Fo,bV as Jn,N as Je,z as Ho,O as ne,al as ve,at as Go,L as Jo,A as _t,b6 as Xo,bK as Yo,by as Xn,e as Qo,aq as Yn,b$ as Qn,af as Zn,U as Zo,W as ot,bF as Kn,bG as es,c8 as ts,c9 as os,bo as wt,bp as ns,br as ss,bv as rs,bw as kt}from"./vendor-mui-core-B6POpIBB.js";import{z as ge,C as Se,af as ls,a7 as is,f as yo,ag as vo,ab as cs}from"./index-Cb1OPKJL.js";import{r as De,n as Y,u as Q,bx as Ko,k as as,a as qe,bb as en,$ as tn,b8 as on,at as ds,by as us,ab as qt,a2 as B,a7 as ps,I as ae,bz as hs,be as fs,b as We,ar as ut,b9 as ms,aw as nn}from"./vendor-ux-did-connect-DVrP2LNw.js";import{O as pt,c as he,q as bs,T as xs,_ as sn,V as _e,p as gs}from"./vendor-arcblock-CX-5Ex_f.js";import{d as js}from"./Error-DnzvDd2d.js";import{C as ht}from"./confirm-Bj4L0Vn8.js";import{u as Ue}from"./session-j-9KoWbs.js";import{W as Ct}from"./did-address-CJZtrzhT.js";import{E as Xe}from"./empty-spinner-BYUFR95o.js";import{B as Et}from"./bundle-avatar-njRzpG6o.js";import{S as we}from"./shorten-label-SbKUBkvs.js";import{L as Lt}from"./list-header-8k1_C0K0.js";import{_ as ks,A as de,p as Nt,E as rn}from"./vendor-utils-BUwfcN20.js";import{d as ys}from"./Download-CF6ZhZfD.js";import{C as ln}from"./click-to-copy-CSwBjJDI.js";import{Q as vs}from"./QuestionMarkCircle-DpFFQWud.js";import{u as Rs}from"./vendor-hooks-DpLLpTSZ.js";import{_ as Pe}from"./useSetState-CWq0AVWn.js";import{c as At}from"./index-DVQCgvFb.js";import{E as zt}from"./index-DIe9psLc.js";import"./api-BkKTvlm_.js";import{d as ws}from"./ChevronRight-C-lajCDc.js";import{T as Cs,a as Ss}from"./vendor-mui-x-CATHW1QL.js";import{d as nt}from"./DeleteOutline-Csdx_lih.js";import{D as Ro,C as wo,P as Co}from"./react-beautiful-dnd.esm-CeODMcuS.js";import{c as Ds,A as cn,u as an,S as Is,a as Ts,b as $s,e as Ps,U as _s,f as yt,g as dn,n as qs,h as Es,i as So,k as Ls,l as Ns}from"./item-taL0aTyr.js";import{d as As}from"./ArrowDropDown-BCCa5uRn.js";import{f as xe}from"./format-error-BrmqJs5a.js";import{d as un}from"./Launch-CVPYIHzD.js";import{d as pn}from"./Done-DjB4uf97.js";import{D as zs}from"./delete-confirm-kpan5KFX.js";import{g as hn}from"./get-safe-url-BYr2jgRv.js";import{M as Os}from"./index-CMFOn8T3.js";import{r as Ws}from"./index-Bt7GP-dU.js";import"./lottie-web-jYmAQWuC.js";import"./raf-schd.esm-B3j6BePR.js";var Ot={},Bs=Ce;Object.defineProperty(Ot,"__esModule",{value:!0});var fn=Ot.default=void 0,Ms=Bs(De()),Us=e;fn=Ot.default=(0,Ms.default)((0,Us.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 Wt={},Vs=Ce;Object.defineProperty(Wt,"__esModule",{value:!0});var mn=Wt.default=void 0,Fs=Vs(De()),Hs=e;mn=Wt.default=(0,Fs.default)((0,Hs.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 Bt={},Gs=Ce;Object.defineProperty(Bt,"__esModule",{value:!0});var bn=Bt.default=void 0,Js=Gs(De()),Xs=e;bn=Bt.default=(0,Js.default)((0,Xs.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 Mt({did:t,projectId:o,title:n,logo:l,describe:i}){const r=`${`${Y.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${t}/${o}/logo/upload`}/${l}`,[u,a]=x.useState(!1),f=Be(b=>b.breakpoints.down("md"));return e.jsxs(c,{sx:{display:"flex",flexDirection:"row",color:u?"primary.main":"grey.900",gap:1},onPointerEnter:()=>a(!0),onPointerLeave:()=>a(!1),children:[e.jsx($t,{sx:{borderRadius:1},src:r}),e.jsxs(c,{children:[e.jsx(we,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:f?"primary.main":""},children:n||"/"}),e.jsx(we,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:f||u?"primary.main":"grey.700"},children:i||"/"})]})]})}Mt.propTypes={projectId:s.string.isRequired,did:s.string.isRequired,title:s.string.isRequired,logo:s.string.isRequired,describe:s.string.isRequired};function Ut({initUrl:t}){const o=Tt(),n=(t==null?void 0:t.searchParams.get("tenantScope"))||"",{t:l,locale:i}=Q(),{api:d}=ge(),{api:r}=Ue(),[u,a]=x.useState(!0),{blocklet:f}=Se(),[b,j]=x.useState(null),[y,h]=x.useState(!1),p=Be(S=>S.breakpoints.down("xl")),v=Be(S=>S.breakpoints.down("md")),{componentDid:w=""}=ct(),[m,k]=x.useState(null),C=`publish-${f.meta.did}`,T=Ko(C),[$,I]=x.useState({searchText:T.searchText||"",pageSize:T.rowsPerPage||10,page:1}),L=()=>{d.getProjects({input:{did:f.meta.did,componentDid:w,tenantScope:n}}).then(S=>{const A=(S==null?void 0:S.projects)||[];a(!1),k(A)}).catch(S=>{a(!1),B.error(S.message)})},z=()=>{o(`${Y.UNOWNED_DID}/create/none`,{replace:!0})},q=S=>{j(S)},Z=()=>{a(!1),h(!0)},U=()=>{h(!1),j(null)},R=S=>{B.error(S.message),h(!1),j(null)},g=S=>{if(!(S!=null&&S.deleted)){B.error("Delete project failed");return}L(),h(!1),j(null)};x.useEffect(()=>{L()},[]);const D=x.useMemo(()=>{var A;if(!$.searchText)return m;let S=(A=$.searchText)==null?void 0:A.trim();return S?(S=as.toAddress(S).toLocaleLowerCase(),m.filter(H=>H.blockletTitle.toLowerCase().includes(S)||H.blockletDid.toLowerCase().includes(S))):m},[m,$.searchText]);if(!m&&u)return e.jsx(c,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:e.jsx(Xe,{})});if(!m)return null;if(!m.length)return e.jsxs(c,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[e.jsx(c,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:l("blocklet.publish.blockletEmptyTip")}),e.jsx(c,{sx:{fontSize:14,color:"text.secondary",mb:3},children:l("blocklet.publish.createBlockletTip")}),e.jsx(qe,{onClick:z,variant:"contained",children:l("blocklet.publish.createBlocklet")})]});const M=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:S=>{const A=m[S];return e.jsx(ke,{to:`${A.id}`,children:e.jsx(Mt,{did:f.meta.did,projectId:A.id,logo:A.blockletLogo,title:A.blockletTitle,describe:A.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{searchable:!1,customBodyRender:S=>S?e.jsx(en,{type:"success",children:S}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:S=>S?e.jsx(Ct,{size:14,compact:!0,responsive:!1,did:S}):null}},p||w?null:{label:l("common.createdBy"),name:"createdBy",options:{customBodyRender:S=>S?e.jsx(Ct,{onClick:()=>{o(`/.well-known/service/admin/members?did=${S}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:S}):null}},p||w?null:{label:l("common.scope"),name:"componentDid",options:{customBodyRender:S=>{const A=(f.children||[]).find(H=>H.meta.did===S);return A?e.jsxs(c,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[e.jsx(Et,{size:14,blocklet:A,ancestors:[f]}),e.jsx(c,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:A.meta.title})]},S):""}}},p||n?null:{label:l("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:S=>e.jsx(c,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:e.jsx(we,{children:S})})}},{label:l("common.updatedAt"),name:"updatedAt",options:{searchable:!1,customBodyRender:S=>e.jsx(tn,{value:Number(S),locale:i})}},{label:l("common.actions"),name:"actions",options:{searchable:!1,customBodyRenderLite:S=>{const A=m[S];return e.jsxs(c,{display:"flex",children:[e.jsx(ke,{to:`${A.id}/new-release/${A.lastReleaseId}`,children:e.jsx(je,{title:l("blocklet.publish.createRelease"),placement:"top",children:e.jsx(ce,{color:"primary","aria-label":"create",children:e.jsx(fn,{style:{fontSize:18}})})})}),!!A.lastReleaseId&&e.jsx(je,{title:l("blocklet.publish.viewLastRelease",{name:A.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"secondary","aria-label":"create",children:e.jsx(ke,{style:{display:"flex"},to:`${A.id}/view/${A.lastReleaseId}`,children:e.jsx(mn,{sx:{fontSize:18}})})})}),e.jsx(je,{title:l("blocklet.publish.delete",{name:A.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"primary","aria-label":"delete",onClick:()=>q(A),children:e.jsx(on,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),O=({page:S,rowsPerPage:A,searchText:H})=>{$.pageSize!==A?I(J=>({...J,searchText:"",pageSize:A,page:1})):$.page!==S+1?I(J=>({...J,searchText:"",page:S+1})):$.searchText!==H&&I(J=>({...J,searchText:H,page:1}))},G=y?e.jsx(ds,{open:!0,popup:!0,onClose:U,action:"check-has-project-id",locale:i,checkFn:r.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:g,onError:R,extraParams:{projectId:b.id,did:f.meta.did,name:b.blockletTitle},messages:{title:l("blocklet.publish.deleteProject.title",{name:b.blockletTitle}),scan:l("blocklet.publish.deleteProject.scan",{name:b.blockletTitle}),confirm:l("blocklet.publish.deleteProject.confirm"),success:l("blocklet.publish.deleteProject.success")}}):null;return e.jsxs(Ys,{children:[e.jsx(Lt,{sx:{mb:2},left:e.jsxs(c,{display:"flex",flexDirection:"row",alignItems:"center",children:[e.jsx(c,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:l("common.blockletStudio")}),e.jsx(je,{title:l("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:e.jsx(bn,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(us,{options:{searchPlaceholder:l("blocklet.list.searchPlaceholder"),searchDebounceTime:600,searchAlwaysOpen:v},search:$.searchText,searchText:$.searchText,searchTextUpdate:S=>I(A=>({...A,searchText:S})),searchClose:()=>I(S=>({...S,searchText:""})),onSearchOpen:()=>{}}),e.jsxs(qe,{onClick:z,variant:"contained",children:[e.jsx(pt,{style:{fontSize:"1.3em",marginRight:4}}),l("blocklet.publish.createBlocklet")]})]})}),e.jsx(qt,{className:"main-table",locale:i,data:D,columns:M,options:{search:!1,sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,searchAlwaysOpen:!0,rowsPerPageOptions:[10,20,50,100]},durable:C,onChange:O}),b&&e.jsx(ht,{title:`${l("common.delete")} ${b.blockletTitle}`,description:l("blocklet.publish.deleteProject.description"),confirm:l("common.confirm"),onConfirm:Z,onCancel:()=>j(null),children:e.jsx(c,{sx:{marginTop:2},children:[l("blocklet.publish.deleteProject.tip1"),l("blocklet.publish.deleteProject.tip2"),l("blocklet.publish.deleteProject.tip3")].map(S=>e.jsxs(c,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[e.jsx(js,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),e.jsx(E,{component:"span",variant:"inherit",color:"text.secondary",children:S})]}))})}),G]})}const Ys=Fn(c)`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Bdi900W2.js","assets/vendor-ux-did-connect-D4-ZeZHm.js","assets/vendor-react-DEoibe3W.js","assets/vendor-utils-CjMBJT5V.js","assets/vendor-mui-core-B6POpIBB.js","assets/vendor-hooks-DXGUREV9.js","assets/lottie-web-jYmAQWuC.js","assets/vendor-ux-did-connect-DpSGLE7B.css","assets/vendor-arcblock-Dkhgjlzn.js","assets/index-DODYa3Im.js","assets/index-CksPySYI.js","assets/index-DOq-_YXu.css","assets/index-DVQCgvFb.js","assets/index-AgKpYdvC.css"])))=>i.map(i=>d[i]);
2
+ import{r as x,f as Tt,l as ct,L as ke,g as Mn,u as Un,i as Vn,j as jt}from"./vendor-react-DEoibe3W.js";import{a9 as Ce,j as e,v as Be,aa as c,be as $t,H as s,ad as je,I as ce,T as E,s as Fn,c7 as Oo,D as at,ah as ye,au as Hn,bS as Ke,ak as dt,bt as et,bx as tt,y as K,ab as Re,P as Wo,G as Bo,w as Pt,a7 as Mo,M as Uo,q as fe,X as Gn,aj as Vo,t as Fo,bV as Jn,N as Je,z as Ho,O as ne,al as ve,at as Go,L as Jo,A as _t,b6 as Xo,bK as Yo,by as Xn,e as Qo,aq as Yn,b$ as Qn,af as Zn,U as Zo,W as ot,bF as Kn,bG as es,c8 as ts,c9 as os,bo as wt,bp as ns,br as ss,bv as rs,bw as kt}from"./vendor-mui-core-B6POpIBB.js";import{z as ge,C as Se,af as ls,a7 as is,f as yo,ag as vo,ab as cs}from"./index-CksPySYI.js";import{r as De,n as Y,u as Q,bw as Ko,k as as,a as qe,ba as en,$ as tn,b7 as on,as as ds,bx as us,ab as qt,a2 as B,a7 as ps,I as ae,by as hs,bd as fs,b as We,aq as ut,b8 as ms,av as nn}from"./vendor-ux-did-connect-D4-ZeZHm.js";import{O as pt,c as he,q as bs,T as xs,_ as sn,V as _e,p as gs}from"./vendor-arcblock-Dkhgjlzn.js";import{d as js}from"./Error-js7ePZ5o.js";import{C as ht}from"./confirm-BqrhdaU7.js";import{u as Ue}from"./session-DLQ0rbYE.js";import{W as Ct}from"./did-address-C6ni99I7.js";import{E as Xe}from"./empty-spinner-BYUFR95o.js";import{B as Et}from"./bundle-avatar-BXQsJw7m.js";import{S as we}from"./shorten-label-SbKUBkvs.js";import{L as Lt}from"./list-header-8k1_C0K0.js";import{_ as ks,A as de,p as Nt,E as rn}from"./vendor-utils-CjMBJT5V.js";import{d as ys}from"./Download-DKz_gZX5.js";import{C as ln}from"./click-to-copy-0s0a7Ak5.js";import{Q as vs}from"./QuestionMarkCircle-DpFFQWud.js";import{u as Rs}from"./vendor-hooks-DXGUREV9.js";import{_ as Pe}from"./useSetState-CWq0AVWn.js";import{c as At}from"./index-DVQCgvFb.js";import{E as zt}from"./index-DIe9psLc.js";import"./api-Bf1onQOz.js";import{d as ws}from"./ChevronRight-BsdsjNxw.js";import{T as Cs,a as Ss}from"./vendor-mui-x-CATHW1QL.js";import{d as nt}from"./DeleteOutline-D_I07sPe.js";import{D as Ro,C as wo,P as Co}from"./react-beautiful-dnd.esm-C1Wt0pHO.js";import{c as Ds,A as cn,u as an,S as Is,a as Ts,b as $s,e as Ps,U as _s,f as yt,g as dn,n as qs,h as Es,i as So,k as Ls,l as Ns}from"./item-CCsztPdL.js";import{d as As}from"./ArrowDropDown-DUCtp8oo.js";import{f as xe}from"./format-error-BrmqJs5a.js";import{d as un}from"./Launch-ryL3I8d9.js";import{d as pn}from"./Done-DLTvHdZB.js";import{D as zs}from"./delete-confirm-CmXluMcs.js";import{g as hn}from"./get-safe-url-cyoeQ7Mw.js";import{M as Os}from"./index-CMFOn8T3.js";import{r as Ws}from"./index-Bt7GP-dU.js";import"./lottie-web-jYmAQWuC.js";import"./raf-schd.esm-B3j6BePR.js";var Ot={},Bs=Ce;Object.defineProperty(Ot,"__esModule",{value:!0});var fn=Ot.default=void 0,Ms=Bs(De()),Us=e;fn=Ot.default=(0,Ms.default)((0,Us.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 Wt={},Vs=Ce;Object.defineProperty(Wt,"__esModule",{value:!0});var mn=Wt.default=void 0,Fs=Vs(De()),Hs=e;mn=Wt.default=(0,Fs.default)((0,Hs.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 Bt={},Gs=Ce;Object.defineProperty(Bt,"__esModule",{value:!0});var bn=Bt.default=void 0,Js=Gs(De()),Xs=e;bn=Bt.default=(0,Js.default)((0,Xs.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 Mt({did:t,projectId:o,title:n,logo:l,describe:i}){const r=`${`${Y.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${t}/${o}/logo/upload`}/${l}`,[u,a]=x.useState(!1),f=Be(b=>b.breakpoints.down("md"));return e.jsxs(c,{sx:{display:"flex",flexDirection:"row",color:u?"primary.main":"grey.900",gap:1},onPointerEnter:()=>a(!0),onPointerLeave:()=>a(!1),children:[e.jsx($t,{sx:{borderRadius:1},src:r}),e.jsxs(c,{children:[e.jsx(we,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:f?"primary.main":""},children:n||"/"}),e.jsx(we,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:f||u?"primary.main":"grey.700"},children:i||"/"})]})]})}Mt.propTypes={projectId:s.string.isRequired,did:s.string.isRequired,title:s.string.isRequired,logo:s.string.isRequired,describe:s.string.isRequired};function Ut({initUrl:t}){const o=Tt(),n=(t==null?void 0:t.searchParams.get("tenantScope"))||"",{t:l,locale:i}=Q(),{api:d}=ge(),{api:r}=Ue(),[u,a]=x.useState(!0),{blocklet:f}=Se(),[b,j]=x.useState(null),[y,h]=x.useState(!1),p=Be(S=>S.breakpoints.down("xl")),v=Be(S=>S.breakpoints.down("md")),{componentDid:w=""}=ct(),[m,k]=x.useState(null),C=`publish-${f.meta.did}`,T=Ko(C),[$,I]=x.useState({searchText:T.searchText||"",pageSize:T.rowsPerPage||10,page:1}),L=()=>{d.getProjects({input:{did:f.meta.did,componentDid:w,tenantScope:n}}).then(S=>{const A=(S==null?void 0:S.projects)||[];a(!1),k(A)}).catch(S=>{a(!1),B.error(S.message)})},z=()=>{o(`${Y.UNOWNED_DID}/create/none`,{replace:!0})},q=S=>{j(S)},Z=()=>{a(!1),h(!0)},U=()=>{h(!1),j(null)},R=S=>{B.error(S.message),h(!1),j(null)},g=S=>{if(!(S!=null&&S.deleted)){B.error("Delete project failed");return}L(),h(!1),j(null)};x.useEffect(()=>{L()},[]);const D=x.useMemo(()=>{var A;if(!$.searchText)return m;let S=(A=$.searchText)==null?void 0:A.trim();return S?(S=as.toAddress(S).toLocaleLowerCase(),m.filter(H=>H.blockletTitle.toLowerCase().includes(S)||H.blockletDid.toLowerCase().includes(S))):m},[m,$.searchText]);if(!m&&u)return e.jsx(c,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:e.jsx(Xe,{})});if(!m)return null;if(!m.length)return e.jsxs(c,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[e.jsx(c,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:l("blocklet.publish.blockletEmptyTip")}),e.jsx(c,{sx:{fontSize:14,color:"text.secondary",mb:3},children:l("blocklet.publish.createBlockletTip")}),e.jsx(qe,{onClick:z,variant:"contained",children:l("blocklet.publish.createBlocklet")})]});const M=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:S=>{const A=m[S];return e.jsx(ke,{to:`${A.id}`,children:e.jsx(Mt,{did:f.meta.did,projectId:A.id,logo:A.blockletLogo,title:A.blockletTitle,describe:A.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{searchable:!1,customBodyRender:S=>S?e.jsx(en,{type:"success",children:S}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:S=>S?e.jsx(Ct,{size:14,compact:!0,responsive:!1,did:S}):null}},p||w?null:{label:l("common.createdBy"),name:"createdBy",options:{customBodyRender:S=>S?e.jsx(Ct,{onClick:()=>{o(`/.well-known/service/admin/members?did=${S}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:S}):null}},p||w?null:{label:l("common.scope"),name:"componentDid",options:{customBodyRender:S=>{const A=(f.children||[]).find(H=>H.meta.did===S);return A?e.jsxs(c,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[e.jsx(Et,{size:14,blocklet:A,ancestors:[f]}),e.jsx(c,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:A.meta.title})]},S):""}}},p||n?null:{label:l("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:S=>e.jsx(c,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:e.jsx(we,{children:S})})}},{label:l("common.updatedAt"),name:"updatedAt",options:{searchable:!1,customBodyRender:S=>e.jsx(tn,{value:Number(S),locale:i})}},{label:l("common.actions"),name:"actions",options:{searchable:!1,customBodyRenderLite:S=>{const A=m[S];return e.jsxs(c,{display:"flex",children:[e.jsx(ke,{to:`${A.id}/new-release/${A.lastReleaseId}`,children:e.jsx(je,{title:l("blocklet.publish.createRelease"),placement:"top",children:e.jsx(ce,{color:"primary","aria-label":"create",children:e.jsx(fn,{style:{fontSize:18}})})})}),!!A.lastReleaseId&&e.jsx(je,{title:l("blocklet.publish.viewLastRelease",{name:A.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"secondary","aria-label":"create",children:e.jsx(ke,{style:{display:"flex"},to:`${A.id}/view/${A.lastReleaseId}`,children:e.jsx(mn,{sx:{fontSize:18}})})})}),e.jsx(je,{title:l("blocklet.publish.delete",{name:A.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"primary","aria-label":"delete",onClick:()=>q(A),children:e.jsx(on,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),O=({page:S,rowsPerPage:A,searchText:H})=>{$.pageSize!==A?I(J=>({...J,searchText:"",pageSize:A,page:1})):$.page!==S+1?I(J=>({...J,searchText:"",page:S+1})):$.searchText!==H&&I(J=>({...J,searchText:H,page:1}))},G=y?e.jsx(ds,{open:!0,popup:!0,onClose:U,action:"check-has-project-id",locale:i,checkFn:r.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:g,onError:R,extraParams:{projectId:b.id,did:f.meta.did,name:b.blockletTitle},messages:{title:l("blocklet.publish.deleteProject.title",{name:b.blockletTitle}),scan:l("blocklet.publish.deleteProject.scan",{name:b.blockletTitle}),confirm:l("blocklet.publish.deleteProject.confirm"),success:l("blocklet.publish.deleteProject.success")}}):null;return e.jsxs(Ys,{children:[e.jsx(Lt,{sx:{mb:2},left:e.jsxs(c,{display:"flex",flexDirection:"row",alignItems:"center",children:[e.jsx(c,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:l("common.blockletStudio")}),e.jsx(je,{title:l("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:e.jsx(bn,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(us,{options:{searchPlaceholder:l("blocklet.list.searchPlaceholder"),searchDebounceTime:600,searchAlwaysOpen:v},search:$.searchText,searchText:$.searchText,searchTextUpdate:S=>I(A=>({...A,searchText:S})),searchClose:()=>I(S=>({...S,searchText:""})),onSearchOpen:()=>{}}),e.jsxs(qe,{onClick:z,variant:"contained",children:[e.jsx(pt,{style:{fontSize:"1.3em",marginRight:4}}),l("blocklet.publish.createBlocklet")]})]})}),e.jsx(qt,{className:"main-table",locale:i,data:D,columns:M,options:{search:!1,sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,searchAlwaysOpen:!0,rowsPerPageOptions:[10,20,50,100]},durable:C,onChange:O}),b&&e.jsx(ht,{title:`${l("common.delete")} ${b.blockletTitle}`,description:l("blocklet.publish.deleteProject.description"),confirm:l("common.confirm"),onConfirm:Z,onCancel:()=>j(null),children:e.jsx(c,{sx:{marginTop:2},children:[l("blocklet.publish.deleteProject.tip1"),l("blocklet.publish.deleteProject.tip2"),l("blocklet.publish.deleteProject.tip3")].map(S=>e.jsxs(c,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[e.jsx(js,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),e.jsx(E,{component:"span",variant:"inherit",color:"text.secondary",children:S})]}))})}),G]})}const Ys=Fn(c)`
3
3
  ${({theme:t})=>t.breakpoints.down("md")} {
4
4
  .MuiTableRow-root {
5
5
  border-color: ${({theme:t})=>t.palette.divider};
@@ -142,7 +142,7 @@ import{r as x,f as Tt,l as ct,L as ke,g as Mn,u as Un,i as Vn,j as jt}from"./ven
142
142
  background: #fff;
143
143
  z-index: 10;
144
144
  }
145
- `;var Zt={},Sr=Ce;Object.defineProperty(Zt,"__esModule",{value:!0});var St=Zt.default=void 0,Dr=Sr(De()),Ir=e;St=Zt.default=(0,Dr.default)((0,Ir.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 Po="lastWantToConnectStoreId";function Tr(t){var u,a;const[o,n]=x.useState(null),{session:l}=Ue(),i=x.useCallback(f=>{n(f),localStorage.setItem(Po,f==null?void 0:f.id)},[n]),d=x.useMemo(()=>{var y,h,p,v;const f=localStorage.getItem(Po),b=f?(((y=t==null?void 0:t.settings)==null?void 0:y.storeList)||[]).find(w=>w.id===f):null;if(b)return b;let j=(((h=t==null?void 0:t.settings)==null?void 0:h.storeList)||[]).find(w=>{var m;return!(w.id!==Y.BLOCKLET_STORE.id||w.scope&&w.scope!=="studio"&&w.scope!==((m=l==null?void 0:l.user)==null?void 0:m.did))});return j||(j=(v=(p=t==null?void 0:t.settings)==null?void 0:p.storeList)==null?void 0:v[0]),j},[(u=t==null?void 0:t.settings)==null?void 0:u.storeList,(a=l==null?void 0:l.user)==null?void 0:a.did]);return[o||d||{},i]}const Rt={};async function Kt(t,{interval:o=1e3,maxDuration:n=120*1e3,intervalFirst:l=4e3,timerKey:i=""}){Rt[i]&&clearTimeout(Rt[i]),await new Promise(u=>setTimeout(u,l));const d=Date.now(),r=async(u,a)=>{try{const f=await t();u(f)}catch(f){Date.now()-d>n?a(f):i?Rt[i]=setTimeout(()=>r(u,a),o):setTimeout(()=>r(u,a),o)}};return new Promise(r)}function $r(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function Pr(t,{did:o,projectId:n,messageId:l}){return Kt(async()=>{var d;const i=await t.getProject({input:{did:o,projectId:n,messageId:l}});if(!((d=i==null?void 0:i.project)!=null&&d.blockletDid))throw new Error("Connected store not found");return i.project.blockletDid},{timerKey:"connect-studio"})}function _r(t,{did:o,projectId:n,storeId:l}){return Kt(async()=>{var r,u;const i=await t.getProject({input:{did:o,projectId:n,messageId:""}});if(!((u=(r=i==null?void 0:i.project)==null?void 0:r.connectedStores)!=null&&u.length))throw new Error("Connected store not found");if(!i.project.connectedStores.find(a=>a.storeId===l))throw new Error("Connected store not found")},{timerKey:`connect-store-${l}`})}function qr(t,{did:o,projectId:n,endpointId:l}){return Kt(async()=>{var r,u;const i=await t.getProject({input:{did:o,projectId:n,messageId:""}});if(!((u=(r=i==null?void 0:i.project)==null?void 0:r.connectedEndpoints)!=null&&u.length))throw new Error("Connected endpoint not found");if(!i.project.connectedEndpoints.find(a=>a.endpointId===l))throw new Error("Connected endpoint not found")},{timerKey:`connect-store-${l}`})}const Er=({fromBlocklet:t,nodeInfo:o,blocklet:n,userDid:l})=>{var r,u;const i=t?(r=n==null?void 0:n.meta)==null?void 0:r.did:o==null?void 0:o.did;let d=t?((u=n==null?void 0:n.settings)==null?void 0:u.storeList)||[]:(o==null?void 0:o.blockletRegistryList)||[];return Array.isArray(d)||(d=[]),d=d.filter(a=>a.protected||!a.scope||a.scope==="studio"||a.scope===l),{teamDid:i,storeList:d}},eo=Er;function to({blocklet:t,store:o={},onChangeStore:n,onClick:l,disabled:i,loading:d,componentDid:r}){var R,g,D;const{t:u}=Q(),{session:a}=Ue(),{api:f,info:b,inService:j}=ge(),y=Se(),[h,p]=x.useState(!1),v=x.useRef(null),[w,m]=x.useState(!1),[k,C]=x.useState(null),T=M=>{n(M),p(!1)},$=()=>{p(!h)},I=M=>{v.current&&v.current.contains(M.target)||p(!1)},L=()=>{m(!0)},z=()=>{m(!1)},q=async()=>{var M;if(k)try{await f.deleteBlockletStore({input:{teamDid:t.meta.did,url:k.url,projectId:"",scope:k.scope||"studio"}}),await((M=y==null?void 0:y.actions)==null?void 0:M.refreshBlocklet())}catch(O){B.error(`Remove Blocklet Store Error: ${xe(O)}`)}finally{C(null)}},{storeList:Z}=eo({fromBlocklet:j,blocklet:t,nodeInfo:b,componentDid:r,userDid:(R=a==null?void 0:a.user)==null?void 0:R.did}),U=(g=t==null?void 0:t.meta)==null?void 0:g.did;return e.jsxs(e.Fragment,{children:[e.jsxs(tt,{disabled:i,ref:v,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[e.jsxs(K,{onClick:l,children:[d&&e.jsx(Re,{size:14,sx:{mr:.5}}),`${u("common.connect")} ${o.name||""}`]}),e.jsx(K,{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:$,children:e.jsx(As,{})})]}),e.jsx(Wo,{sx:{zIndex:10},open:h,anchorEl:v.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:M})=>e.jsx(Bo,{...M,style:{transformOrigin:"center top"},children:e.jsx(Pt,{children:e.jsx(Mo,{onClickAway:I,children:e.jsxs(Uo,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[Z==null?void 0:Z.map(O=>{var G;return e.jsxs(fe,{selected:O.id===(o==null?void 0:o.id),sx:{height:56},onClick:()=>T(O),children:[e.jsxs(c,{children:[e.jsx(we,{sx:{fontSize:"16px"},maxLength:24,children:O.name}),e.jsx(we,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:O.url})]}),Ds({store:O,userDid:(G=a==null?void 0:a.user)==null?void 0:G.did})&&e.jsx(ce,{sx:{ml:1},onClick:S=>{S.preventDefault(),S.stopPropagation(),C(O)},children:e.jsx(ae,{icon:"ic:outline-delete"})})]},O.url)}),e.jsx(Gn,{}),e.jsxs(fe,{onClick:L,children:[e.jsx(pt,{font:!0}),e.jsx(E,{variant:"inherit",children:u("store.blockletRegistry.addRegistry")})]})]})})})})}),w&&e.jsx(cn,{hiddenChildren:!0,open:!0,onClose:z,teamDid:U,storeList:Z,scope:"studio",onAdd:(D=y==null?void 0:y.actions)==null?void 0:D.refreshBlocklet}),k&&e.jsx(ht,{displayError:!0,title:`${u("common.delete")} ${k.name}`,description:u("blocklet.publish.deleteStoreTip",{name:k.name}),confirm:u("common.confirm"),onConfirm:q,onCancel:()=>C(null)})]})}to.propTypes={store:s.object,blocklet:s.object,onChangeStore:s.func.isRequired,onClick:s.func.isRequired,loading:s.bool.isRequired,disabled:s.bool.isRequired,componentDid:s.string.isRequired,projectType:s.string.isRequired,getData:s.func.isRequired};to.defaultProps={store:null,blocklet:null};const Lr=(t,o,n)=>{const l=`${Y.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${o.meta.did}/${n}/logo/upload`,i=`${Y.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${o.meta.did}/${n}/screenshot/upload`,d=t!=null&&t.blockletLogo?`${l}/${t.blockletLogo}`:`${Y.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,r=((t==null?void 0:t.blockletScreenshots)||[]).filter(Boolean).map(u=>`${i}/${u}`);return{logoUrl:d,screenshotUrls:r,uploadLogoPrefix:l,uploadScreenshotPrefix:i}},Rn=Lr,Nr=t=>{const o=t.includes("youtube.com")||t.includes("youtu.be"),n=t.includes("vimeo.com");return o||n};function ft({url:t,style:o,controls:n,modestbranding:l}){var u;const{t:i}=Q(),d=t.includes("youtube.com")||t.includes("youtu.be"),r=t.includes("vimeo.com");if(d){const a=((u=t.split("v=")[1])==null?void 0:u.split("&")[0])||t.split("/").pop();return e.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:(o==null?void 0:o.pointerEvents)||"auto"},children:e.jsx("iframe",{src:`https://www.youtube.com/embed/${a}?modestbranding=${l}&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(r){const a=t.split("/").pop();return e.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:o.pointerEvents||"auto"},children:e.jsx("iframe",{src:`https://player.vimeo.com/video/${a}`,title:"Vimeo video player",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",...o},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0})})}return e.jsx(c,{style:{position:"relative",width:"100%",paddingTop:"56.25%"},children:e.jsxs(c,{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",backgroundColor:"rgba(0, 0, 0, 0.04)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",...o},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,children:[e.jsx(ae,{icon:"carbon:video-off",style:{fontSize:40,marginBottom:"10px",opacity:.5}}),e.jsx(E,{variant:"body1",sx:{opacity:.5},children:i("studio.videoDialogNoSrc")})]})})}ft.propTypes={url:s.string.isRequired,style:s.object,controls:s.number,modestbranding:s.number};ft.defaultProps={style:{},controls:1,modestbranding:1};function wn({setParams:t,onClose:o,params:n}){const{t:l}=Q(),[i,d]=x.useState(""),r=i&&n.blockletVideos.includes(i),u=Nr(i),a=()=>{t(f=>{const b=[...f.blockletVideos];return b.push(i),{...f,blockletVideos:b}}),o()};return e.jsxs(at,{open:!0,fullWidth:!0,maxWidth:"sm",children:[e.jsx(Vo,{children:l("studio.videoDialogTitle")}),e.jsxs(Fo,{children:[e.jsx(Jn,{fullWidth:!0,value:i,onChange:f=>d(f.target.value),placeholder:l("studio.videoInputLabel"),endAdornment:i?e.jsx(Je,{position:"end",children:e.jsx(ce,{onClick:()=>d(""),children:e.jsx(fs,{})})}):null,error:r}),r&&e.jsx(E,{variant:"body2",color:"error",children:l("studio.duplicateVideo")}),e.jsx(ft,{url:i,style:{marginTop:"20px",borderRadius:"4px"}})]}),e.jsxs(Ho,{children:[e.jsx(K,{onClick:()=>o(),children:l("studio.cancel")}),e.jsx(K,{disabled:!u||r,onClick:a,children:l("studio.confirm")})]})]})}wn.propTypes={onClose:s.func.isRequired,params:s.object.isRequired,setParams:s.func.isRequired};function Dt({errors:t,storeList:o,...n}){const{t:l}=Q();return e.jsxs(c,{...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:[e.jsx(E,{variant:"caption",sx:{fontWeight:"bold",position:"absolute",top:-10,left:12,backgroundColor:"white",px:1,width:"fit-content"},children:l("blocklet.publish.storeRule.warning")}),t&&Object.entries(t).map(([i,d])=>{const r=Object.values(d),u=o.find(a=>a.url===i);return r.length>0&&e.jsxs(c,{children:[e.jsx(je,{title:i,children:e.jsx(c,{component:"span",sx:{cursor:"pointer"},children:u.name})}),r.map(a=>e.jsx(c,{component:"li",ml:2,breakWords:!0,children:a},a))]},i)})]})}Dt.propTypes={errors:s.object.isRequired,storeList:s.array.isRequired};const _o=x.lazy(()=>sn(()=>import("./index-C1UHqpp3.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])).then(t=>({default:t.Uploader})));function Cn({projectId:t,readOnly:o,loading:n,blocklet:l,params:i,setParams:d,paramsErrTip:r,setParamsErrTip:u,warning:a,setLoading:f,initUrl:b,initLogoUrl:j,setInitLogoUrl:y,componentDid:h}){const{t:p,locale:v}=Q(),{api:w}=ge(),m=Tt(),k=x.useRef(null),C=x.useRef(null),[T,$]=Tr(l),[I,L]=x.useState(!1),z=an({messageType:"connect-store-message",onOpen:()=>f(!0),onClose:()=>f(!1)}),q=async _=>{const V=setTimeout(()=>{f(!1)},2e4),X=await Pr(w,_);f(!1),clearTimeout(V),window.parent.postMessage({event:"studioDialog.connected",componentDid:h},"*"),m(window.location.pathname.replace(`${Y.UNOWNED_DID}/create`,`${X}/create`),{replace:!0})},Z=()=>{if(!i.blockletTitle){B.error(p("blocklet.publish.errorTip.noTitle"));return}if(!(T!=null&&T.url)){B.error(p("blocklet.publish.noStoreSelected"));return}const _=$r();z(async(V,X)=>{var te,oe,ie;try{const ee=await w.connectByStudio({input:{did:(te=l==null?void 0:l.meta)==null?void 0:te.did,blockletTitle:i==null?void 0:i.blockletTitle,storeUrl:T.url,storeId:T.id,storeName:T.name,type:((oe=i==null?void 0:i.blockletComponents)==null?void 0:oe.length)>0?"pack":"resource",componentDid:h,messageId:_,tenantScope:(b==null?void 0:b.searchParams.get("tenantScope"))||""}});if(!(ee!=null&&ee.url)){B.error("failed to connect to store");return}X(ee.url),q({did:(ie=l==null?void 0:l.meta)==null?void 0:ie.did,projectId:"",messageId:_})}catch(ee){const ue=xe(ee);B.error(ue),f(!1)}})},{logoUrl:U,screenshotUrls:R,uploadLogoPrefix:g,uploadScreenshotPrefix:D}=Rn(i,l,t),{logoErrors:M,screenshotErrors:O,storeList:G,hasLogoWarning:S,hasScreenshotWarning:A}=a,H=()=>o?!1:!t||t===Y.UNOWNED_DID?(B.error(p("blocklet.publish.errorTip.noFirstDid")),!1):!0,J=_=>{if(!_.destination)return;const V=Array.from(i.blockletScreenshots),[X]=V.splice(_.source.index,1);V.splice(_.destination.index,0,X),d(te=>({...te,blockletScreenshots:V}))},Ie=_=>{if(!_.destination)return;const V=Array.from(i.blockletVideos),[X]=V.splice(_.source.index,1);V.splice(_.destination.index,0,X),d(te=>({...te,blockletVideos:V}))};return e.jsxs(Ar,{children:[e.jsx(c,{display:"flex",className:"section",children:e.jsxs(c,{sx:{flex:1},children:[e.jsx(ne,{disabled:n||o,label:`Blocklet ${p("common.title")}`,placeholder:`Blocklet ${p("common.title")}`,InputProps:{"data-cy":"blocklet-title",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:i.blockletTitle||"",onChange:_=>{u({blockletTitle:""}),d({blockletTitle:_.target.value})},error:!!r.blockletTitle,helperText:r.blockletTitle||""}),e.jsx(ne,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"export-blocklet-did",endAdornment:t===Y.UNOWNED_DID&&e.jsx(Je,{position:"end",children:e.jsx(to,{blocklet:l,store:T,componentDid:h,onChangeStore:$,disabled:!i.blockletTitle||o||n,loading:n,onClick:Z})})},error:!!r.projectId,helperText:r.projectId||"",value:t===Y.UNOWNED_DID?"":`did:abt:${t}`,sx:{mt:3}}),e.jsx(ne,{disabled:n||o,label:`Blocklet ${p("common.description")}`,placeholder:`Blocklet ${p("common.description")}`,InputProps:{"data-cy":"blocklet-description",readOnly:o},required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:i.blockletDescription||"",onChange:_=>{u({blockletDescription:""}),d({blockletDescription:_.target.value})},error:!!r.blockletDescription,helperText:r.blockletDescription||"",sx:{mt:3}}),e.jsx(ne,{disabled:n||o,label:`Blocklet ${p("common.homepageTip")}`,placeholder:`Blocklet ${p("common.homepageTip")}`,InputProps:{"data-cy":"blocklet-homepage",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:i.blockletHomepage||"",onChange:_=>{_.target.value&&!/^(http|https):\/\//.test(_.target.value)?u({blockletHomepage:p("blocklet.publish.errorTip.invalidUrl")}):u({blockletHomepage:""}),d({blockletHomepage:_.target.value})},error:!!r.blockletHomepage,helperText:r.blockletHomepage||"",sx:{mt:3}}),e.jsx(ne,{disabled:n||o,label:`Blocklet ${p("common.community")}`,placeholder:`Blocklet ${p("common.community")}`,InputProps:{"data-cy":"blocklet-community",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:i.blockletCommunity||"",onChange:_=>{_.target.value&&!/^(http|https):\/\//.test(_.target.value)?u({blockletCommunity:p("blocklet.publish.errorTip.invalidUrl")}):u({blockletCommunity:""}),d({blockletCommunity:_.target.value})},error:!!r.blockletCommunity,helperText:r.blockletCommunity||"",sx:{mt:3}}),e.jsx(ne,{disabled:n||o,label:`Blocklet ${p("common.support")}`,placeholder:`Blocklet ${p("common.support")}`,InputProps:{"data-cy":"blocklet-support",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:i.blockletSupport||"",onChange:_=>{_.target.value&&!/^(http|https):\/\//.test(_.target.value)&&!/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(_.target.value)?u({blockletSupport:p("blocklet.publish.errorTip.invalidUrlOrEmail")}):u({blockletSupport:""}),d({blockletSupport:_.target.value})},error:!!r.blockletSupport,helperText:r.blockletSupport||"",sx:{mt:3}}),e.jsx(ne,{disabled:n||o,label:`Blocklet ${p("common.repository")}`,placeholder:`Blocklet ${p("common.repository")}`,InputProps:{"data-cy":"blocklet-repository",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:i.blockletRepository||"",onChange:_=>{_.target.value&&!/^(git|https|svn)/.test(_.target.value)?u({blockletRepository:p("blocklet.publish.errorTip.invalidUrl")}):u({blockletRepository:""}),d({blockletRepository:_.target.value})},error:!!r.blockletRepository,helperText:r.blockletRepository||"",sx:{mt:3}})]})}),e.jsx(c,{display:"flex",mt:3,className:"section full-width",children:e.jsxs(c,{flex:1,overflow:"hidden",children:[e.jsxs(c,{display:"flex",flexDirection:"row",flexWrap:"wrap",children:[e.jsxs(ve,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(E,{variant:"subtitle1",sx:{fontWeight:"bold"},children:p("common.logo")}),e.jsxs(ve,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[p("studio.type"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:"png, jpg, webp, svg"})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[p("studio.ratio"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:"256x256"})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[p("studio.size"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:"<500Kb"})]})})]})]}),e.jsx(c,{sx:{flex:1,cursor:o?"default":"pointer",display:"flex",alignItems:"flex-end"},children:e.jsx($t,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:j||U,onClick:()=>{var _;H()&&((_=k.current)==null||_.open())}})})]}),S&&e.jsx(Dt,{errors:M,storeList:G,mt:3}),e.jsxs(c,{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap",children:[e.jsxs(ve,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(E,{variant:"subtitle1",sx:{fontWeight:"bold"},children:p("common.screenshot")}),e.jsxs(ve,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[e.jsx(c,{sx:{border:"none"},variant:"outlined",size:"small",children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[p("studio.ratio"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:"16 / 9"})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[p("studio.count"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:"1~5"})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[p("studio.size"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:"<5MB"})]})}),!o&&e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[p("studio.order"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:p("studio.orderTip")})]})})]})]}),e.jsx(Ro,{onDragEnd:o?void 0:J,children:e.jsx(wo,{droppableId:"screenshots",direction:"horizontal",isDropDisabled:o,children:(_,V)=>e.jsxs(c,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap",minHeight:160,background:V.isDraggingOver?"grey.100":"transparent",transition:"background-color 0.2s ease",border:V.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:_.innerRef,..._.droppableProps,children:[R.map((X,te)=>e.jsx(Co,{draggableId:X,index:te,isDragDisabled:o,children:(oe,ie)=>e.jsxs(c,{ref:oe.innerRef,...oe.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:[e.jsx("img",{alt:"screenshot",src:X}),!o&&e.jsx(ce,{...oe.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:e.jsx(St,{})}),!o&&e.jsx(ce,{className:"action",onClick:()=>{d(ee=>{const ue=[...ee.blockletScreenshots];return ue.splice(te,1),{...ee,blockletScreenshots:ue}})},children:e.jsx(nt,{})})]})},X)),_.placeholder,R.length<5&&e.jsx(c,{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 X;H()&&((X=C.current)==null||X.open())},children:"+"})]})})})]}),A&&e.jsx(Dt,{errors:O,storeList:G}),e.jsxs(c,{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap",children:[e.jsxs(ve,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(E,{variant:"subtitle1",sx:{fontWeight:"bold"},children:p("studio.video")}),e.jsxs(ve,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[p("studio.videoType"),":"," "]}),e.jsxs(c,{component:"span",sx:{color:"secondary.main"},children:[e.jsx("a",{href:"https://www.youtube.com/",target:"_blank",rel:"noreferrer",children:"Youtube"}),","," ",e.jsx("a",{href:"https://vimeo.com/",target:"_blank",rel:"noreferrer",children:"Vimeo"})]})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[p("studio.count"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:"1~3"})]})}),!o&&e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[p("studio.order"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:p("studio.orderTip")})]})})]})]}),e.jsx(Ro,{onDragEnd:o?void 0:Ie,children:e.jsx(wo,{droppableId:"videos",direction:"horizontal",isDropDisabled:o,children:(_,V)=>e.jsxs(c,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap",minHeight:160,background:V.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:V.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:_.innerRef,..._.droppableProps,children:[i.blockletVideos.map((X,te)=>e.jsx(Co,{draggableId:X,index:te,isDragDisabled:o,children:(oe,ie)=>e.jsxs(c,{ref:oe.innerRef,...oe.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:[e.jsx(ft,{url:X,style:{pointerEvents:ie.isDragging?"none":"auto"}}),!o&&e.jsx(ce,{...oe.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:e.jsx(St,{})}),!o&&e.jsx(ce,{className:"action",onClick:()=>{d(ee=>{const ue=[...ee.blockletVideos];return ue.splice(te,1),{...ee,blockletVideos:ue}})},children:e.jsx(nt,{})})]})},X)),_.placeholder,i.blockletVideos.length<3&&e.jsx(c,{sx:{width:240,height:135,background:"#eee",cursor:o?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{H()&&L(!0)},children:"+"})]})})})]})]})}),e.jsxs(x.Suspense,{fallback:e.jsx(Xe,{}),children:[e.jsx(_o,{ref:k,locale:v,popup:!0,onUploadFinish:_=>{var V;d({blockletLogo:_.data.filename}),y(""),(V=k.current)==null||V.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:g,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/png","image/jpeg","image/webp","image/svg+xml"],maxFileSize:1024*1024*.5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{minWidth:256,minHeight:256}}}},"uploader-logo"),I&&e.jsx(wn,{onClose:()=>L(!1),params:i,setParams:d}),e.jsx(_o,{ref:C,locale:v,popup:!0,onUploadFinish:_=>{var V;d(X=>{var oe;const te=X.blockletScreenshots||[];return te.push((oe=_.data)==null?void 0:oe.filename),{...X,blockletScreenshots:te}}),(V=C.current)==null||V.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:D,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","image/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-R.length}},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,autoCropArea:1,aspectRatio:16/9,initialAspectRatio:16/9,croppedCanvasOptions:{minWidth:1280,minHeight:720,maxWidth:1280*2,maxHeight:720*2}}}},"uploader-screenshot")]})]})}Cn.propTypes={projectId:s.string.isRequired,readOnly:s.bool.isRequired,params:s.object.isRequired,setParams:s.func.isRequired,paramsErrTip:s.object.isRequired,setParamsErrTip:s.func.isRequired,warning:s.object.isRequired,loading:s.bool.isRequired,blocklet:s.object.isRequired,setLoading:s.func.isRequired,initUrl:s.object.isRequired,componentDid:s.isRequired,initLogoUrl:s.string.isRequired,setInitLogoUrl:s.func.isRequired};const Ar=ye.div`
145
+ `;var Zt={},Sr=Ce;Object.defineProperty(Zt,"__esModule",{value:!0});var St=Zt.default=void 0,Dr=Sr(De()),Ir=e;St=Zt.default=(0,Dr.default)((0,Ir.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 Po="lastWantToConnectStoreId";function Tr(t){var u,a;const[o,n]=x.useState(null),{session:l}=Ue(),i=x.useCallback(f=>{n(f),localStorage.setItem(Po,f==null?void 0:f.id)},[n]),d=x.useMemo(()=>{var y,h,p,v;const f=localStorage.getItem(Po),b=f?(((y=t==null?void 0:t.settings)==null?void 0:y.storeList)||[]).find(w=>w.id===f):null;if(b)return b;let j=(((h=t==null?void 0:t.settings)==null?void 0:h.storeList)||[]).find(w=>{var m;return!(w.id!==Y.BLOCKLET_STORE.id||w.scope&&w.scope!=="studio"&&w.scope!==((m=l==null?void 0:l.user)==null?void 0:m.did))});return j||(j=(v=(p=t==null?void 0:t.settings)==null?void 0:p.storeList)==null?void 0:v[0]),j},[(u=t==null?void 0:t.settings)==null?void 0:u.storeList,(a=l==null?void 0:l.user)==null?void 0:a.did]);return[o||d||{},i]}const Rt={};async function Kt(t,{interval:o=1e3,maxDuration:n=120*1e3,intervalFirst:l=4e3,timerKey:i=""}){Rt[i]&&clearTimeout(Rt[i]),await new Promise(u=>setTimeout(u,l));const d=Date.now(),r=async(u,a)=>{try{const f=await t();u(f)}catch(f){Date.now()-d>n?a(f):i?Rt[i]=setTimeout(()=>r(u,a),o):setTimeout(()=>r(u,a),o)}};return new Promise(r)}function $r(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function Pr(t,{did:o,projectId:n,messageId:l}){return Kt(async()=>{var d;const i=await t.getProject({input:{did:o,projectId:n,messageId:l}});if(!((d=i==null?void 0:i.project)!=null&&d.blockletDid))throw new Error("Connected store not found");return i.project.blockletDid},{timerKey:"connect-studio"})}function _r(t,{did:o,projectId:n,storeId:l}){return Kt(async()=>{var r,u;const i=await t.getProject({input:{did:o,projectId:n,messageId:""}});if(!((u=(r=i==null?void 0:i.project)==null?void 0:r.connectedStores)!=null&&u.length))throw new Error("Connected store not found");if(!i.project.connectedStores.find(a=>a.storeId===l))throw new Error("Connected store not found")},{timerKey:`connect-store-${l}`})}function qr(t,{did:o,projectId:n,endpointId:l}){return Kt(async()=>{var r,u;const i=await t.getProject({input:{did:o,projectId:n,messageId:""}});if(!((u=(r=i==null?void 0:i.project)==null?void 0:r.connectedEndpoints)!=null&&u.length))throw new Error("Connected endpoint not found");if(!i.project.connectedEndpoints.find(a=>a.endpointId===l))throw new Error("Connected endpoint not found")},{timerKey:`connect-store-${l}`})}const Er=({fromBlocklet:t,nodeInfo:o,blocklet:n,userDid:l})=>{var r,u;const i=t?(r=n==null?void 0:n.meta)==null?void 0:r.did:o==null?void 0:o.did;let d=t?((u=n==null?void 0:n.settings)==null?void 0:u.storeList)||[]:(o==null?void 0:o.blockletRegistryList)||[];return Array.isArray(d)||(d=[]),d=d.filter(a=>a.protected||!a.scope||a.scope==="studio"||a.scope===l),{teamDid:i,storeList:d}},eo=Er;function to({blocklet:t,store:o={},onChangeStore:n,onClick:l,disabled:i,loading:d,componentDid:r}){var R,g,D;const{t:u}=Q(),{session:a}=Ue(),{api:f,info:b,inService:j}=ge(),y=Se(),[h,p]=x.useState(!1),v=x.useRef(null),[w,m]=x.useState(!1),[k,C]=x.useState(null),T=M=>{n(M),p(!1)},$=()=>{p(!h)},I=M=>{v.current&&v.current.contains(M.target)||p(!1)},L=()=>{m(!0)},z=()=>{m(!1)},q=async()=>{var M;if(k)try{await f.deleteBlockletStore({input:{teamDid:t.meta.did,url:k.url,projectId:"",scope:k.scope||"studio"}}),await((M=y==null?void 0:y.actions)==null?void 0:M.refreshBlocklet())}catch(O){B.error(`Remove Blocklet Store Error: ${xe(O)}`)}finally{C(null)}},{storeList:Z}=eo({fromBlocklet:j,blocklet:t,nodeInfo:b,componentDid:r,userDid:(R=a==null?void 0:a.user)==null?void 0:R.did}),U=(g=t==null?void 0:t.meta)==null?void 0:g.did;return e.jsxs(e.Fragment,{children:[e.jsxs(tt,{disabled:i,ref:v,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[e.jsxs(K,{onClick:l,children:[d&&e.jsx(Re,{size:14,sx:{mr:.5}}),`${u("common.connect")} ${o.name||""}`]}),e.jsx(K,{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:$,children:e.jsx(As,{})})]}),e.jsx(Wo,{sx:{zIndex:10},open:h,anchorEl:v.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:M})=>e.jsx(Bo,{...M,style:{transformOrigin:"center top"},children:e.jsx(Pt,{children:e.jsx(Mo,{onClickAway:I,children:e.jsxs(Uo,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[Z==null?void 0:Z.map(O=>{var G;return e.jsxs(fe,{selected:O.id===(o==null?void 0:o.id),sx:{height:56},onClick:()=>T(O),children:[e.jsxs(c,{children:[e.jsx(we,{sx:{fontSize:"16px"},maxLength:24,children:O.name}),e.jsx(we,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:O.url})]}),Ds({store:O,userDid:(G=a==null?void 0:a.user)==null?void 0:G.did})&&e.jsx(ce,{sx:{ml:1},onClick:S=>{S.preventDefault(),S.stopPropagation(),C(O)},children:e.jsx(ae,{icon:"ic:outline-delete"})})]},O.url)}),e.jsx(Gn,{}),e.jsxs(fe,{onClick:L,children:[e.jsx(pt,{font:!0}),e.jsx(E,{variant:"inherit",children:u("store.blockletRegistry.addRegistry")})]})]})})})})}),w&&e.jsx(cn,{hiddenChildren:!0,open:!0,onClose:z,teamDid:U,storeList:Z,scope:"studio",onAdd:(D=y==null?void 0:y.actions)==null?void 0:D.refreshBlocklet}),k&&e.jsx(ht,{displayError:!0,title:`${u("common.delete")} ${k.name}`,description:u("blocklet.publish.deleteStoreTip",{name:k.name}),confirm:u("common.confirm"),onConfirm:q,onCancel:()=>C(null)})]})}to.propTypes={store:s.object,blocklet:s.object,onChangeStore:s.func.isRequired,onClick:s.func.isRequired,loading:s.bool.isRequired,disabled:s.bool.isRequired,componentDid:s.string.isRequired,projectType:s.string.isRequired,getData:s.func.isRequired};to.defaultProps={store:null,blocklet:null};const Lr=(t,o,n)=>{const l=`${Y.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${o.meta.did}/${n}/logo/upload`,i=`${Y.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${o.meta.did}/${n}/screenshot/upload`,d=t!=null&&t.blockletLogo?`${l}/${t.blockletLogo}`:`${Y.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,r=((t==null?void 0:t.blockletScreenshots)||[]).filter(Boolean).map(u=>`${i}/${u}`);return{logoUrl:d,screenshotUrls:r,uploadLogoPrefix:l,uploadScreenshotPrefix:i}},Rn=Lr,Nr=t=>{const o=t.includes("youtube.com")||t.includes("youtu.be"),n=t.includes("vimeo.com");return o||n};function ft({url:t,style:o,controls:n,modestbranding:l}){var u;const{t:i}=Q(),d=t.includes("youtube.com")||t.includes("youtu.be"),r=t.includes("vimeo.com");if(d){const a=((u=t.split("v=")[1])==null?void 0:u.split("&")[0])||t.split("/").pop();return e.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:(o==null?void 0:o.pointerEvents)||"auto"},children:e.jsx("iframe",{src:`https://www.youtube.com/embed/${a}?modestbranding=${l}&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(r){const a=t.split("/").pop();return e.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:o.pointerEvents||"auto"},children:e.jsx("iframe",{src:`https://player.vimeo.com/video/${a}`,title:"Vimeo video player",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",...o},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0})})}return e.jsx(c,{style:{position:"relative",width:"100%",paddingTop:"56.25%"},children:e.jsxs(c,{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",backgroundColor:"rgba(0, 0, 0, 0.04)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",...o},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,children:[e.jsx(ae,{icon:"carbon:video-off",style:{fontSize:40,marginBottom:"10px",opacity:.5}}),e.jsx(E,{variant:"body1",sx:{opacity:.5},children:i("studio.videoDialogNoSrc")})]})})}ft.propTypes={url:s.string.isRequired,style:s.object,controls:s.number,modestbranding:s.number};ft.defaultProps={style:{},controls:1,modestbranding:1};function wn({setParams:t,onClose:o,params:n}){const{t:l}=Q(),[i,d]=x.useState(""),r=i&&n.blockletVideos.includes(i),u=Nr(i),a=()=>{t(f=>{const b=[...f.blockletVideos];return b.push(i),{...f,blockletVideos:b}}),o()};return e.jsxs(at,{open:!0,fullWidth:!0,maxWidth:"sm",children:[e.jsx(Vo,{children:l("studio.videoDialogTitle")}),e.jsxs(Fo,{children:[e.jsx(Jn,{fullWidth:!0,value:i,onChange:f=>d(f.target.value),placeholder:l("studio.videoInputLabel"),endAdornment:i?e.jsx(Je,{position:"end",children:e.jsx(ce,{onClick:()=>d(""),children:e.jsx(fs,{})})}):null,error:r}),r&&e.jsx(E,{variant:"body2",color:"error",children:l("studio.duplicateVideo")}),e.jsx(ft,{url:i,style:{marginTop:"20px",borderRadius:"4px"}})]}),e.jsxs(Ho,{children:[e.jsx(K,{onClick:()=>o(),children:l("studio.cancel")}),e.jsx(K,{disabled:!u||r,onClick:a,children:l("studio.confirm")})]})]})}wn.propTypes={onClose:s.func.isRequired,params:s.object.isRequired,setParams:s.func.isRequired};function Dt({errors:t,storeList:o,...n}){const{t:l}=Q();return e.jsxs(c,{...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:[e.jsx(E,{variant:"caption",sx:{fontWeight:"bold",position:"absolute",top:-10,left:12,backgroundColor:"white",px:1,width:"fit-content"},children:l("blocklet.publish.storeRule.warning")}),t&&Object.entries(t).map(([i,d])=>{const r=Object.values(d),u=o.find(a=>a.url===i);return r.length>0&&e.jsxs(c,{children:[e.jsx(je,{title:i,children:e.jsx(c,{component:"span",sx:{cursor:"pointer"},children:u.name})}),r.map(a=>e.jsx(c,{component:"li",ml:2,breakWords:!0,children:a},a))]},i)})]})}Dt.propTypes={errors:s.object.isRequired,storeList:s.array.isRequired};const _o=x.lazy(()=>sn(()=>import("./index-Bdi900W2.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])).then(t=>({default:t.Uploader})));function Cn({projectId:t,readOnly:o,loading:n,blocklet:l,params:i,setParams:d,paramsErrTip:r,setParamsErrTip:u,warning:a,setLoading:f,initUrl:b,initLogoUrl:j,setInitLogoUrl:y,componentDid:h}){const{t:p,locale:v}=Q(),{api:w}=ge(),m=Tt(),k=x.useRef(null),C=x.useRef(null),[T,$]=Tr(l),[I,L]=x.useState(!1),z=an({messageType:"connect-store-message",onOpen:()=>f(!0),onClose:()=>f(!1)}),q=async _=>{const V=setTimeout(()=>{f(!1)},2e4),X=await Pr(w,_);f(!1),clearTimeout(V),window.parent.postMessage({event:"studioDialog.connected",componentDid:h},"*"),m(window.location.pathname.replace(`${Y.UNOWNED_DID}/create`,`${X}/create`),{replace:!0})},Z=()=>{if(!i.blockletTitle){B.error(p("blocklet.publish.errorTip.noTitle"));return}if(!(T!=null&&T.url)){B.error(p("blocklet.publish.noStoreSelected"));return}const _=$r();z(async(V,X)=>{var te,oe,ie;try{const ee=await w.connectByStudio({input:{did:(te=l==null?void 0:l.meta)==null?void 0:te.did,blockletTitle:i==null?void 0:i.blockletTitle,storeUrl:T.url,storeId:T.id,storeName:T.name,type:((oe=i==null?void 0:i.blockletComponents)==null?void 0:oe.length)>0?"pack":"resource",componentDid:h,messageId:_,tenantScope:(b==null?void 0:b.searchParams.get("tenantScope"))||""}});if(!(ee!=null&&ee.url)){B.error("failed to connect to store");return}X(ee.url),q({did:(ie=l==null?void 0:l.meta)==null?void 0:ie.did,projectId:"",messageId:_})}catch(ee){const ue=xe(ee);B.error(ue),f(!1)}})},{logoUrl:U,screenshotUrls:R,uploadLogoPrefix:g,uploadScreenshotPrefix:D}=Rn(i,l,t),{logoErrors:M,screenshotErrors:O,storeList:G,hasLogoWarning:S,hasScreenshotWarning:A}=a,H=()=>o?!1:!t||t===Y.UNOWNED_DID?(B.error(p("blocklet.publish.errorTip.noFirstDid")),!1):!0,J=_=>{if(!_.destination)return;const V=Array.from(i.blockletScreenshots),[X]=V.splice(_.source.index,1);V.splice(_.destination.index,0,X),d(te=>({...te,blockletScreenshots:V}))},Ie=_=>{if(!_.destination)return;const V=Array.from(i.blockletVideos),[X]=V.splice(_.source.index,1);V.splice(_.destination.index,0,X),d(te=>({...te,blockletVideos:V}))};return e.jsxs(Ar,{children:[e.jsx(c,{display:"flex",className:"section",children:e.jsxs(c,{sx:{flex:1},children:[e.jsx(ne,{disabled:n||o,label:`Blocklet ${p("common.title")}`,placeholder:`Blocklet ${p("common.title")}`,InputProps:{"data-cy":"blocklet-title",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:i.blockletTitle||"",onChange:_=>{u({blockletTitle:""}),d({blockletTitle:_.target.value})},error:!!r.blockletTitle,helperText:r.blockletTitle||""}),e.jsx(ne,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"export-blocklet-did",endAdornment:t===Y.UNOWNED_DID&&e.jsx(Je,{position:"end",children:e.jsx(to,{blocklet:l,store:T,componentDid:h,onChangeStore:$,disabled:!i.blockletTitle||o||n,loading:n,onClick:Z})})},error:!!r.projectId,helperText:r.projectId||"",value:t===Y.UNOWNED_DID?"":`did:abt:${t}`,sx:{mt:3}}),e.jsx(ne,{disabled:n||o,label:`Blocklet ${p("common.description")}`,placeholder:`Blocklet ${p("common.description")}`,InputProps:{"data-cy":"blocklet-description",readOnly:o},required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:i.blockletDescription||"",onChange:_=>{u({blockletDescription:""}),d({blockletDescription:_.target.value})},error:!!r.blockletDescription,helperText:r.blockletDescription||"",sx:{mt:3}}),e.jsx(ne,{disabled:n||o,label:`Blocklet ${p("common.homepageTip")}`,placeholder:`Blocklet ${p("common.homepageTip")}`,InputProps:{"data-cy":"blocklet-homepage",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:i.blockletHomepage||"",onChange:_=>{_.target.value&&!/^(http|https):\/\//.test(_.target.value)?u({blockletHomepage:p("blocklet.publish.errorTip.invalidUrl")}):u({blockletHomepage:""}),d({blockletHomepage:_.target.value})},error:!!r.blockletHomepage,helperText:r.blockletHomepage||"",sx:{mt:3}}),e.jsx(ne,{disabled:n||o,label:`Blocklet ${p("common.community")}`,placeholder:`Blocklet ${p("common.community")}`,InputProps:{"data-cy":"blocklet-community",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:i.blockletCommunity||"",onChange:_=>{_.target.value&&!/^(http|https):\/\//.test(_.target.value)?u({blockletCommunity:p("blocklet.publish.errorTip.invalidUrl")}):u({blockletCommunity:""}),d({blockletCommunity:_.target.value})},error:!!r.blockletCommunity,helperText:r.blockletCommunity||"",sx:{mt:3}}),e.jsx(ne,{disabled:n||o,label:`Blocklet ${p("common.support")}`,placeholder:`Blocklet ${p("common.support")}`,InputProps:{"data-cy":"blocklet-support",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:i.blockletSupport||"",onChange:_=>{_.target.value&&!/^(http|https):\/\//.test(_.target.value)&&!/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(_.target.value)?u({blockletSupport:p("blocklet.publish.errorTip.invalidUrlOrEmail")}):u({blockletSupport:""}),d({blockletSupport:_.target.value})},error:!!r.blockletSupport,helperText:r.blockletSupport||"",sx:{mt:3}}),e.jsx(ne,{disabled:n||o,label:`Blocklet ${p("common.repository")}`,placeholder:`Blocklet ${p("common.repository")}`,InputProps:{"data-cy":"blocklet-repository",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:i.blockletRepository||"",onChange:_=>{_.target.value&&!/^(git|https|svn)/.test(_.target.value)?u({blockletRepository:p("blocklet.publish.errorTip.invalidUrl")}):u({blockletRepository:""}),d({blockletRepository:_.target.value})},error:!!r.blockletRepository,helperText:r.blockletRepository||"",sx:{mt:3}})]})}),e.jsx(c,{display:"flex",mt:3,className:"section full-width",children:e.jsxs(c,{flex:1,overflow:"hidden",children:[e.jsxs(c,{display:"flex",flexDirection:"row",flexWrap:"wrap",children:[e.jsxs(ve,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(E,{variant:"subtitle1",sx:{fontWeight:"bold"},children:p("common.logo")}),e.jsxs(ve,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[p("studio.type"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:"png, jpg, webp, svg"})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[p("studio.ratio"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:"256x256"})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[p("studio.size"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:"<500Kb"})]})})]})]}),e.jsx(c,{sx:{flex:1,cursor:o?"default":"pointer",display:"flex",alignItems:"flex-end"},children:e.jsx($t,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:j||U,onClick:()=>{var _;H()&&((_=k.current)==null||_.open())}})})]}),S&&e.jsx(Dt,{errors:M,storeList:G,mt:3}),e.jsxs(c,{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap",children:[e.jsxs(ve,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(E,{variant:"subtitle1",sx:{fontWeight:"bold"},children:p("common.screenshot")}),e.jsxs(ve,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[e.jsx(c,{sx:{border:"none"},variant:"outlined",size:"small",children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[p("studio.ratio"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:"16 / 9"})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[p("studio.count"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:"1~5"})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[p("studio.size"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:"<5MB"})]})}),!o&&e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[p("studio.order"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:p("studio.orderTip")})]})})]})]}),e.jsx(Ro,{onDragEnd:o?void 0:J,children:e.jsx(wo,{droppableId:"screenshots",direction:"horizontal",isDropDisabled:o,children:(_,V)=>e.jsxs(c,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap",minHeight:160,background:V.isDraggingOver?"grey.100":"transparent",transition:"background-color 0.2s ease",border:V.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:_.innerRef,..._.droppableProps,children:[R.map((X,te)=>e.jsx(Co,{draggableId:X,index:te,isDragDisabled:o,children:(oe,ie)=>e.jsxs(c,{ref:oe.innerRef,...oe.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:[e.jsx("img",{alt:"screenshot",src:X}),!o&&e.jsx(ce,{...oe.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:e.jsx(St,{})}),!o&&e.jsx(ce,{className:"action",onClick:()=>{d(ee=>{const ue=[...ee.blockletScreenshots];return ue.splice(te,1),{...ee,blockletScreenshots:ue}})},children:e.jsx(nt,{})})]})},X)),_.placeholder,R.length<5&&e.jsx(c,{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 X;H()&&((X=C.current)==null||X.open())},children:"+"})]})})})]}),A&&e.jsx(Dt,{errors:O,storeList:G}),e.jsxs(c,{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap",children:[e.jsxs(ve,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(E,{variant:"subtitle1",sx:{fontWeight:"bold"},children:p("studio.video")}),e.jsxs(ve,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[p("studio.videoType"),":"," "]}),e.jsxs(c,{component:"span",sx:{color:"secondary.main"},children:[e.jsx("a",{href:"https://www.youtube.com/",target:"_blank",rel:"noreferrer",children:"Youtube"}),","," ",e.jsx("a",{href:"https://vimeo.com/",target:"_blank",rel:"noreferrer",children:"Vimeo"})]})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[p("studio.count"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:"1~3"})]})}),!o&&e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[p("studio.order"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:p("studio.orderTip")})]})})]})]}),e.jsx(Ro,{onDragEnd:o?void 0:Ie,children:e.jsx(wo,{droppableId:"videos",direction:"horizontal",isDropDisabled:o,children:(_,V)=>e.jsxs(c,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap",minHeight:160,background:V.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:V.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:_.innerRef,..._.droppableProps,children:[i.blockletVideos.map((X,te)=>e.jsx(Co,{draggableId:X,index:te,isDragDisabled:o,children:(oe,ie)=>e.jsxs(c,{ref:oe.innerRef,...oe.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:[e.jsx(ft,{url:X,style:{pointerEvents:ie.isDragging?"none":"auto"}}),!o&&e.jsx(ce,{...oe.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:e.jsx(St,{})}),!o&&e.jsx(ce,{className:"action",onClick:()=>{d(ee=>{const ue=[...ee.blockletVideos];return ue.splice(te,1),{...ee,blockletVideos:ue}})},children:e.jsx(nt,{})})]})},X)),_.placeholder,i.blockletVideos.length<3&&e.jsx(c,{sx:{width:240,height:135,background:"#eee",cursor:o?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{H()&&L(!0)},children:"+"})]})})})]})]})}),e.jsxs(x.Suspense,{fallback:e.jsx(Xe,{}),children:[e.jsx(_o,{ref:k,locale:v,popup:!0,onUploadFinish:_=>{var V;d({blockletLogo:_.data.filename}),y(""),(V=k.current)==null||V.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:g,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/png","image/jpeg","image/webp","image/svg+xml"],maxFileSize:1024*1024*.5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{minWidth:256,minHeight:256}}}},"uploader-logo"),I&&e.jsx(wn,{onClose:()=>L(!1),params:i,setParams:d}),e.jsx(_o,{ref:C,locale:v,popup:!0,onUploadFinish:_=>{var V;d(X=>{var oe;const te=X.blockletScreenshots||[];return te.push((oe=_.data)==null?void 0:oe.filename),{...X,blockletScreenshots:te}}),(V=C.current)==null||V.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:D,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","image/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-R.length}},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,autoCropArea:1,aspectRatio:16/9,initialAspectRatio:16/9,croppedCanvasOptions:{minWidth:1280,minHeight:720,maxWidth:1280*2,maxHeight:720*2}}}},"uploader-screenshot")]})]})}Cn.propTypes={projectId:s.string.isRequired,readOnly:s.bool.isRequired,params:s.object.isRequired,setParams:s.func.isRequired,paramsErrTip:s.object.isRequired,setParamsErrTip:s.func.isRequired,warning:s.object.isRequired,loading:s.bool.isRequired,blocklet:s.object.isRequired,setLoading:s.func.isRequired,initUrl:s.object.isRequired,componentDid:s.isRequired,initLogoUrl:s.string.isRequired,setInitLogoUrl:s.func.isRequired};const Ar=ye.div`
146
146
  margin-top: 24px;
147
147
  .screenshot {
148
148
  margin-bottom: 16px;
@@ -190,7 +190,7 @@ import{r as x,f as Tt,l as ct,L as ke,g as Mn,u as Un,i as Vn,j as jt}from"./ven
190
190
  padding-bottom: 12px;
191
191
  border-bottom: ${({theme:t})=>`1px solid ${t.palette.divider}`};
192
192
  }
193
- `;function Pn({text:t}){const{palette:o}=Qo();return t?e.jsx(Os,{style:{backgroundColor:o.background.default,color:o.text.primary},wrapperElement:{"data-color-mode":"light"},source:gs.sanitize(t),rehypePlugins:[[Ws,{target:"_blank"}]]}):e.jsx(Me,{Icon:zt})}Pn.propTypes={text:s.string.isRequired};function _n({params:t,setParams:o,paramsErrTip:n,loading:l,setParamsErrTip:i,readOnly:d}){var b;const{t:r}=Q(),[u,a]=x.useState(d?"preview":"write"),f=(j,y)=>{a(y)};return e.jsxs(c,{sx:{border:"1px solid transparent",borderRadius:2},children:[e.jsxs(c,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[e.jsx(E,{variant:"h6",fontWeight:"bold",sx:{},children:r("common.introduction")}),e.jsxs(Zo,{value:u,onChange:f,"aria-label":"wrapped label tabs example",children:[e.jsx(ot,{value:"write",label:"Write"}),e.jsx(ot,{value:"preview",label:"Preview"})]})]}),e.jsx(c,{display:u==="write"?"block":"none",sx:{width:"100%",marginTop:3},children:e.jsx(ne,{disabled:l||d,sx:{border:"none"},placeholder:`Blocklet ${r("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:d,endAdornment:e.jsxs(Je,{position:"end",children:[((b=t==null?void 0:t.blockletIntroduction)==null?void 0:b.length)||0," / ",he.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:t.blockletIntroduction||"",onChange:j=>{i({blockletIntroduction:""}),o({blockletIntroduction:j.target.value.slice(0,he.PROJECT.MAX_INTRO_LENGTH)})},error:!!n.blockletIntroduction,helperText:n.blockletIntroduction||""})}),e.jsx(c,{display:u==="preview"?"block":"none",mt:3,children:e.jsx(Pn,{text:t.blockletIntroduction||""})})]})}_n.propTypes={params:s.object.isRequired,setParams:s.func.isRequired,paramsErrTip:s.object.isRequired,setParamsErrTip:s.func.isRequired,readOnly:s.bool.isRequired,loading:s.bool.isRequired};var uo={},Xr=Ce;Object.defineProperty(uo,"__esModule",{value:!0});var It=uo.default=void 0,Yr=Xr(De()),Lo=e;It=uo.default=(0,Yr.default)([(0,Lo.jsx)("circle",{cx:"12",cy:"19",r:"2"},"0"),(0,Lo.jsx)("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function po({step:t,ok:o,active:n,error:l,warning:i}){let d="grey.500",r=t+1;return o&&(r=e.jsx(pn,{sx:{fontSize:18,margin:0},color:"white"})),l||!o&&n>t?(d="error.main",r=e.jsx(It,{sx:{fontSize:18,margin:0},color:"white"})):i?(d="warning.main",r=e.jsx(It,{sx:{fontSize:18,margin:0},color:"white"})):n>=t&&(d="primary.main"),e.jsx(c,{width:24,height:24,bgcolor:d,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center",children:r})}po.propTypes={step:s.number,ok:s.bool,active:s.number,error:s.string,warning:s.bool};po.defaultProps={step:0,ok:!1,active:0,error:"",warning:!1};function qn({steps:t,activeStep:o,setActiveStep:n,hasSelectedResources:l,params:i,loading:d,paramsErrTip:r,warning:u,viewMode:a,projectId:f}){const{t:b}=Q(),j=()=>{n(v=>v+1)},y=()=>{n(v=>v-1)},h=v=>v===0?(r==null?void 0:r.blockletTitle)||(r==null?void 0:r.projectId)||(r==null?void 0:r.blockletDescription)||(r==null?void 0:r.blockletHomepage)||(r==null?void 0:r.blockletSupport)||(r==null?void 0:r.blockletCommunity)||(r==null?void 0:r.blockletRepository):v===2?(r==null?void 0:r.blockletResource)||(r==null?void 0:r.blockletDocker)||(r==null?void 0:r.dockerImageName):v>=4?(r==null?void 0:r.blockletVersion)||(r==null?void 0:r.note):"",p=a||Dn({hasSelectedResources:l,params:i,projectId:f,t:b})===null;return e.jsxs(c,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[e.jsx(Kn,{activeStep:o,orientation:"vertical",children:t.map((v,w)=>{const m={},k=d||!Fr({hasSelectedResources:l,params:i,projectId:f,step:w,t:b}),C=d?"":h(w);return C&&(m.optional=e.jsx(E,{variant:"caption",color:"error",sx:{wordBreak:"break-word"},children:C}),m.error=!0),e.jsxs(es,{children:[e.jsx(ts,{icon:e.jsx(po,{error:C,warning:w===0?u.hasWarning:!1,active:p?99:o,step:w,ok:k}),sx:{cursor:"pointer",color:C?"error.main":"inherit"},disabled:!1,onClick:()=>n(w),...m,children:e.jsx(E,{fontSize:"14px",fontWeight:"500",color:C||!k&&o>w?"error.main":"inherit",children:v.label})}),e.jsxs(os,{children:[e.jsx(E,{fontSize:12,children:v.description}),!p&&e.jsx(c,{sx:{mb:2},children:e.jsxs("div",{children:[w<t.length-1&&e.jsx(K,{variant:"contained",onClick:j,sx:{mt:1,mr:1},disabled:C||!k,children:b("common.continue")}),w>0&&e.jsx(K,{disabled:w===0,onClick:y,sx:{mt:1,mr:1},children:b("common.back")})]})})]})]},v.label)})}),o>=t.length-1&&e.jsx(Pt,{square:!0,elevation:0,sx:{p:3},children:e.jsx(E,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}qn.propTypes={steps:s.array.isRequired,activeStep:s.number.isRequired,setActiveStep:s.func.isRequired,params:s.object.isRequired,viewMode:s.string.isRequired,loading:s.bool.isRequired,projectId:s.string.isRequired,hasSelectedResources:s.bool.isRequired,warning:s.object.isRequired,paramsErrTip:s.shape({projectId:s.string,blockletVersion:s.string,blockletTitle:s.string,blockletDescription:s.string,note:s.string,blockletResource:s.string,blockletHomepage:s.string,blockletSupport:s.string,blockletCommunity:s.string,blockletRepository:s.string,blockletDocker:s.object,dockerImageName:s.string}).isRequired};const Qr=[".zip",".gz"],Zr=1024*1024*100,Kr=x.lazy(()=>sn(()=>import("./index-C1UHqpp3.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])).then(t=>({default:t.Uploader})));function ho({app:t,projectId:o,readOnly:n,params:l,setParams:i,setParamsErrTip:d,error:r}){const{t:u,locale:a}=Q(),f=x.useRef(null),b=()=>n?!1:!o||o===Y.UNOWNED_DID?(B.error(u("blocklet.publish.errorTip.noFirstDid")),!1):!0,j=`${Y.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${t.meta.did}/${o}/resource/upload`;return e.jsxs(c,{sx:{mt:3},children:[e.jsx(E,{gutterBottom:!0,children:u("blocklet.publish.resourceUpload")}),e.jsxs(ve,{direction:"row",alignItems:"center",spacing:1,sx:{flex:1,cursor:n?"default":"pointer"},children:[!!l.uploadedResource&&e.jsx(E,{component:"a",href:`${j}/params.uploadedResource`,children:l.uploadedResource}),!n&&e.jsx(K,{variant:"outlined",size:"small",onClick:()=>{var y;b()&&((y=f.current)==null||y.open())},children:l.uploadedResource?u("common.change"):u("common.upload")})]}),e.jsx(x.Suspense,{fallback:e.jsx(Xe,{}),children:e.jsx(Kr,{ref:f,locale:a,popup:!0,onUploadFinish:y=>{var h;i({uploadedResource:y.data.filename}),d({blockletResource:""}),(h=f.current)==null||h.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:j,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileExts:Qr,maxFileSize:Zr,maxNumberOfFiles:1}}},"uploader-resource")}),!!r&&e.jsx(c,{color:"error.main",mt:1,fontSize:14,children:r})]})}ho.propTypes={app:s.object.isRequired,projectId:s.string.isRequired,readOnly:s.bool.isRequired,params:s.object.isRequired,setParams:s.func.isRequired,error:s.string.isRequired,setParamsErrTip:s.func.isRequired};ho.defaultProps={};function lt({readOnly:t,params:o,setParams:n,paramsErrTip:l,setParamsErrTip:i,loading:d}){var u;const{t:r}=Q();return e.jsx(c,{display:"flex",mt:3,className:"section",children:e.jsxs(c,{sx:{flex:1},children:[e.jsx(ne,{required:!0,disabled:d||t,label:`Blocklet ${r("common.version")}`,placeholder:`Blocklet ${r("common.version")}`,InputProps:{"data-cy":"blocklet-version",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,value:o.blockletVersion||"",onChange:a=>{i({blockletVersion:""}),n({blockletVersion:a.target.value})},error:!!l.blockletVersion,helperText:l.blockletVersion||""}),e.jsx(ne,{label:r("blocklet.publish.releaseNote"),autoComplete:"off",disabled:d||t,variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:t,endAdornment:e.jsxs(Je,{position:"end",children:[((u=o==null?void 0:o.note)==null?void 0:u.length)||0," / ",he.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:o.note||"",onChange:a=>{i({note:""}),n({note:a.target.value.slice(0,he.PROJECT.MAX_NOTE_LENGTH)})},error:!!l.note,helperText:l.note||"",sx:{mt:3}})]})})}lt.propTypes={readOnly:s.bool.isRequired,params:s.object.isRequired,setParams:s.func.isRequired,paramsErrTip:s.object.isRequired,setParamsErrTip:s.func.isRequired,loading:s.bool.isRequired};lt.defaultProps={};function En(t){for(const o in t)typeof t[o]=="string"?t[o]=t[o].replace(/\\\\/g,"\\"):typeof t[o]=="object"&&t[o]!==null&&En(t[o]);return t}function it({index:t,item:o,dockerParams:n,setDockerParams:l,dataKey:i,t:d,readOnly:r}){const u=(o==null?void 0:o.value)||"",[a,f]=x.useState(!1),b=()=>{var U;(U=n[i])==null||U.splice(t,1),l({...n,[i]:[...n[i]]})},j=(U,R)=>{var g;(g=n[i])!=null&&g[t]&&(R?(n[i][t].custom=n[i][t].value,n[i][t].value=`$${yt(o.key)}`):(n[i][t].value=n[i][t].custom||"",n[i][t].custom="")),l({...n,[i]:[...n[i]]})},y=(U,R)=>{var D;const g=((D=n[i][t])==null?void 0:D.value)||"";n[i][t]={...n[i][t],secure:R,value:R&&g===he.BLOCKLET_AUTOMATIC_ENV_VALUE?"":g},l({...n,[i]:[...n[i]]})},h=(U,R)=>{n[i][t]={...n[i][t],shared:R},l({...n,[i]:[...n[i]]})},p=(U,R)=>{var D;const g=((D=n[i][t])==null?void 0:D.value)||"";n[i][t]={...n[i][t],required:R,value:R&&g===he.BLOCKLET_AUTOMATIC_ENV_VALUE?"":g},l({...n,[i]:[...n[i]]})},v=(U,R)=>{n[i][t]={...n[i][t],value:R?he.BLOCKLET_AUTOMATIC_ENV_VALUE:"",secure:!1,required:!1},l({...n,[i]:[...n[i]]})},w=U=>{n[i][t]={...n[i][t],description:U.target.value},l({...n,[i]:[...n[i]]})},m=U=>{const R=U.target.value==="web"?"web":"docker";R==="web"&&n.dockerArgs.forEach(M=>{M.type="docker"});const D=`/${n.dockerImage.replace(/\W/g,"-")}-${t}`;n.dockerArgs[t]={...n.dockerArgs[t],type:R,path:R==="docker"?D:"/",protocol:"http",prefix:R==="docker"?D:"/",name:"publicUrl",port:"BLOCKLET_PORT"},l({...n,dockerArgs:[...n.dockerArgs]})},k=U=>{n.dockerArgs[t]={...n.dockerArgs[t],proxyBehavior:U.target.value==="direct"?"direct":"service"},l({...n,dockerArgs:[...n.dockerArgs]})},C=U=>{const R=U.target.value;n[i][t]={...n[i][t],prefix:R,path:R==="*"?"/":R},l({...n,[i]:[...n[i]]})},T=U=>{var R;(R=n[i])!=null&&R[t]&&(n[i][t].value=U.target.value),l({...n,[i]:[...n[i]]})},$=u===`$${yt(o.key)}`||o.custom,I=i==="dockerArgs"&&!dn[o.key],L=qs[o.key],z=i==="dockerEnvs",q=o.key==="--publish";let Z=o.key;return q&&o.type==="web"?Z="--publish (Web)":z&&(Z=`--env ${o.key}`),e.jsxs(c,{sx:{display:"flex",flexDirection:"row",gap:2,alignItems:"center"},children:[e.jsx(c,{sx:{width:250},children:e.jsx(E,{sx:{textOverflow:"ellipsis",width:"100%",overflow:"hidden"},children:Z})}),e.jsxs(c,{sx:{display:"flex",flexDirection:"column",gap:1,flex:1},children:[e.jsx(ne,{disabled:r||$||I||o.value===he.BLOCKLET_AUTOMATIC_ENV_VALUE,placeholder:"",value:$?`$${yt(o.key)}`:u,sx:{flex:1},InputProps:{endAdornment:e.jsxs(Je,{position:"end",sx:{zoom:.9},children:[(!(L||I)||z||q)&&e.jsx(ce,{onClick:()=>f(!0),children:e.jsx(ae,{icon:"icon-park-outline:setting-config"})}),!r&&e.jsx(ce,{onClick:b,color:I?"error":"default",children:e.jsx(ae,{icon:"ic:round-delete"})})]})},error:I,onChange:T}),I&&e.jsx(E,{variant:"caption",color:"error",children:d("blocklet.publish.docker.noAllowTheArg")}),o.key==="--publish"&&e.jsx(E,{variant:"caption",color:"text.secondary",children:d("blocklet.publish.docker.publishTips")}),o.key==="--volume"&&Es[o.key](u)&&e.jsx(E,{variant:"caption",color:"error",children:d("blocklet.publish.docker.volumeTips")})]}),a&&e.jsx(ut,{open:!0,fullWidth:!0,maxWidth:"sm",PaperProps:{style:{minHeight:0}},title:d(z?"blocklet.publish.docker.modifyEnv":"blocklet.publish.docker.modifyParam"),onClose:()=>f(!1),children:e.jsxs(c,{sx:{display:"flex",flexDirection:"column",gap:1,paddingBottom:2},children:[L||I||z?null:e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(E,{children:d("blocklet.publish.docker.needCustomInput")}),e.jsx(_e,{disabled:r,checked:$,onChange:j,sx:{zoom:.9}})]}),z&&e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(E,{children:d("blocklet.publish.docker.shared")}),e.jsx(_e,{disabled:r,checked:o.shared,onChange:h,sx:{zoom:.9}})]}),z&&e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(E,{children:d("blocklet.publish.docker.required")}),e.jsx(_e,{disabled:r,checked:o.required,onChange:p,sx:{zoom:.9}})]}),z&&e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(E,{children:d("blocklet.publish.docker.secure")}),e.jsx(_e,{disabled:r,checked:o.secure,onChange:y,sx:{zoom:.9}})]}),z&&e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(E,{children:d("blocklet.publish.docker.autoGenerated")}),e.jsx(_e,{disabled:r,checked:o.value===he.BLOCKLET_AUTOMATIC_ENV_VALUE,onChange:v,sx:{zoom:.9}})]}),z&&e.jsxs(c,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(E,{sx:{flex:1},children:d("blocklet.publish.docker.description")}),e.jsx(ne,{disabled:r,value:o.description,onChange:w,sx:{flex:1},label:d("blocklet.publish.docker.description")})]}),q&&e.jsxs(c,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(E,{sx:{flex:1},children:d("blocklet.publish.docker.portType")}),e.jsxs(wt,{value:o.type||"docker",onChange:m,children:[e.jsx(fe,{value:"docker",children:"Docker"}),e.jsx(fe,{value:"web",children:"Web"})]})]}),q&&o.type==="web"&&e.jsxs(c,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(E,{sx:{flex:1},children:d("blocklet.publish.docker.proxyBehavior")}),e.jsxs(wt,{value:o.proxyBehavior||"service",onChange:k,children:[e.jsx(fe,{value:"service",children:d("blocklet.publish.docker.serviceProxy")}),e.jsx(fe,{value:"direct",children:d("blocklet.publish.docker.directProxy")})]})]}),q&&o.type==="web"&&e.jsxs(c,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(E,{sx:{flex:1},children:d("blocklet.publish.docker.prefix")}),e.jsx(ne,{disabled:r,value:o.prefix,onChange:C,sx:{flex:1},label:d("blocklet.publish.docker.prefix")})]})]})})]})}it.propTypes={dockerParams:s.object.isRequired,setDockerParams:s.func.isRequired,dataKey:s.string.isRequired,item:s.object.isRequired,t:s.func.isRequired,readOnly:s.bool.isRequired,index:s.number.isRequired};it.defaultProps={};const el=`
193
+ `;function Pn({text:t}){const{palette:o}=Qo();return t?e.jsx(Os,{style:{backgroundColor:o.background.default,color:o.text.primary},wrapperElement:{"data-color-mode":"light"},source:gs.sanitize(t),rehypePlugins:[[Ws,{target:"_blank"}]]}):e.jsx(Me,{Icon:zt})}Pn.propTypes={text:s.string.isRequired};function _n({params:t,setParams:o,paramsErrTip:n,loading:l,setParamsErrTip:i,readOnly:d}){var b;const{t:r}=Q(),[u,a]=x.useState(d?"preview":"write"),f=(j,y)=>{a(y)};return e.jsxs(c,{sx:{border:"1px solid transparent",borderRadius:2},children:[e.jsxs(c,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[e.jsx(E,{variant:"h6",fontWeight:"bold",sx:{},children:r("common.introduction")}),e.jsxs(Zo,{value:u,onChange:f,"aria-label":"wrapped label tabs example",children:[e.jsx(ot,{value:"write",label:"Write"}),e.jsx(ot,{value:"preview",label:"Preview"})]})]}),e.jsx(c,{display:u==="write"?"block":"none",sx:{width:"100%",marginTop:3},children:e.jsx(ne,{disabled:l||d,sx:{border:"none"},placeholder:`Blocklet ${r("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:d,endAdornment:e.jsxs(Je,{position:"end",children:[((b=t==null?void 0:t.blockletIntroduction)==null?void 0:b.length)||0," / ",he.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:t.blockletIntroduction||"",onChange:j=>{i({blockletIntroduction:""}),o({blockletIntroduction:j.target.value.slice(0,he.PROJECT.MAX_INTRO_LENGTH)})},error:!!n.blockletIntroduction,helperText:n.blockletIntroduction||""})}),e.jsx(c,{display:u==="preview"?"block":"none",mt:3,children:e.jsx(Pn,{text:t.blockletIntroduction||""})})]})}_n.propTypes={params:s.object.isRequired,setParams:s.func.isRequired,paramsErrTip:s.object.isRequired,setParamsErrTip:s.func.isRequired,readOnly:s.bool.isRequired,loading:s.bool.isRequired};var uo={},Xr=Ce;Object.defineProperty(uo,"__esModule",{value:!0});var It=uo.default=void 0,Yr=Xr(De()),Lo=e;It=uo.default=(0,Yr.default)([(0,Lo.jsx)("circle",{cx:"12",cy:"19",r:"2"},"0"),(0,Lo.jsx)("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function po({step:t,ok:o,active:n,error:l,warning:i}){let d="grey.500",r=t+1;return o&&(r=e.jsx(pn,{sx:{fontSize:18,margin:0},color:"white"})),l||!o&&n>t?(d="error.main",r=e.jsx(It,{sx:{fontSize:18,margin:0},color:"white"})):i?(d="warning.main",r=e.jsx(It,{sx:{fontSize:18,margin:0},color:"white"})):n>=t&&(d="primary.main"),e.jsx(c,{width:24,height:24,bgcolor:d,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center",children:r})}po.propTypes={step:s.number,ok:s.bool,active:s.number,error:s.string,warning:s.bool};po.defaultProps={step:0,ok:!1,active:0,error:"",warning:!1};function qn({steps:t,activeStep:o,setActiveStep:n,hasSelectedResources:l,params:i,loading:d,paramsErrTip:r,warning:u,viewMode:a,projectId:f}){const{t:b}=Q(),j=()=>{n(v=>v+1)},y=()=>{n(v=>v-1)},h=v=>v===0?(r==null?void 0:r.blockletTitle)||(r==null?void 0:r.projectId)||(r==null?void 0:r.blockletDescription)||(r==null?void 0:r.blockletHomepage)||(r==null?void 0:r.blockletSupport)||(r==null?void 0:r.blockletCommunity)||(r==null?void 0:r.blockletRepository):v===2?(r==null?void 0:r.blockletResource)||(r==null?void 0:r.blockletDocker)||(r==null?void 0:r.dockerImageName):v>=4?(r==null?void 0:r.blockletVersion)||(r==null?void 0:r.note):"",p=a||Dn({hasSelectedResources:l,params:i,projectId:f,t:b})===null;return e.jsxs(c,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[e.jsx(Kn,{activeStep:o,orientation:"vertical",children:t.map((v,w)=>{const m={},k=d||!Fr({hasSelectedResources:l,params:i,projectId:f,step:w,t:b}),C=d?"":h(w);return C&&(m.optional=e.jsx(E,{variant:"caption",color:"error",sx:{wordBreak:"break-word"},children:C}),m.error=!0),e.jsxs(es,{children:[e.jsx(ts,{icon:e.jsx(po,{error:C,warning:w===0?u.hasWarning:!1,active:p?99:o,step:w,ok:k}),sx:{cursor:"pointer",color:C?"error.main":"inherit"},disabled:!1,onClick:()=>n(w),...m,children:e.jsx(E,{fontSize:"14px",fontWeight:"500",color:C||!k&&o>w?"error.main":"inherit",children:v.label})}),e.jsxs(os,{children:[e.jsx(E,{fontSize:12,children:v.description}),!p&&e.jsx(c,{sx:{mb:2},children:e.jsxs("div",{children:[w<t.length-1&&e.jsx(K,{variant:"contained",onClick:j,sx:{mt:1,mr:1},disabled:C||!k,children:b("common.continue")}),w>0&&e.jsx(K,{disabled:w===0,onClick:y,sx:{mt:1,mr:1},children:b("common.back")})]})})]})]},v.label)})}),o>=t.length-1&&e.jsx(Pt,{square:!0,elevation:0,sx:{p:3},children:e.jsx(E,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}qn.propTypes={steps:s.array.isRequired,activeStep:s.number.isRequired,setActiveStep:s.func.isRequired,params:s.object.isRequired,viewMode:s.string.isRequired,loading:s.bool.isRequired,projectId:s.string.isRequired,hasSelectedResources:s.bool.isRequired,warning:s.object.isRequired,paramsErrTip:s.shape({projectId:s.string,blockletVersion:s.string,blockletTitle:s.string,blockletDescription:s.string,note:s.string,blockletResource:s.string,blockletHomepage:s.string,blockletSupport:s.string,blockletCommunity:s.string,blockletRepository:s.string,blockletDocker:s.object,dockerImageName:s.string}).isRequired};const Qr=[".zip",".gz"],Zr=1024*1024*100,Kr=x.lazy(()=>sn(()=>import("./index-Bdi900W2.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])).then(t=>({default:t.Uploader})));function ho({app:t,projectId:o,readOnly:n,params:l,setParams:i,setParamsErrTip:d,error:r}){const{t:u,locale:a}=Q(),f=x.useRef(null),b=()=>n?!1:!o||o===Y.UNOWNED_DID?(B.error(u("blocklet.publish.errorTip.noFirstDid")),!1):!0,j=`${Y.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${t.meta.did}/${o}/resource/upload`;return e.jsxs(c,{sx:{mt:3},children:[e.jsx(E,{gutterBottom:!0,children:u("blocklet.publish.resourceUpload")}),e.jsxs(ve,{direction:"row",alignItems:"center",spacing:1,sx:{flex:1,cursor:n?"default":"pointer"},children:[!!l.uploadedResource&&e.jsx(E,{component:"a",href:`${j}/params.uploadedResource`,children:l.uploadedResource}),!n&&e.jsx(K,{variant:"outlined",size:"small",onClick:()=>{var y;b()&&((y=f.current)==null||y.open())},children:l.uploadedResource?u("common.change"):u("common.upload")})]}),e.jsx(x.Suspense,{fallback:e.jsx(Xe,{}),children:e.jsx(Kr,{ref:f,locale:a,popup:!0,onUploadFinish:y=>{var h;i({uploadedResource:y.data.filename}),d({blockletResource:""}),(h=f.current)==null||h.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:j,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileExts:Qr,maxFileSize:Zr,maxNumberOfFiles:1}}},"uploader-resource")}),!!r&&e.jsx(c,{color:"error.main",mt:1,fontSize:14,children:r})]})}ho.propTypes={app:s.object.isRequired,projectId:s.string.isRequired,readOnly:s.bool.isRequired,params:s.object.isRequired,setParams:s.func.isRequired,error:s.string.isRequired,setParamsErrTip:s.func.isRequired};ho.defaultProps={};function lt({readOnly:t,params:o,setParams:n,paramsErrTip:l,setParamsErrTip:i,loading:d}){var u;const{t:r}=Q();return e.jsx(c,{display:"flex",mt:3,className:"section",children:e.jsxs(c,{sx:{flex:1},children:[e.jsx(ne,{required:!0,disabled:d||t,label:`Blocklet ${r("common.version")}`,placeholder:`Blocklet ${r("common.version")}`,InputProps:{"data-cy":"blocklet-version",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,value:o.blockletVersion||"",onChange:a=>{i({blockletVersion:""}),n({blockletVersion:a.target.value})},error:!!l.blockletVersion,helperText:l.blockletVersion||""}),e.jsx(ne,{label:r("blocklet.publish.releaseNote"),autoComplete:"off",disabled:d||t,variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:t,endAdornment:e.jsxs(Je,{position:"end",children:[((u=o==null?void 0:o.note)==null?void 0:u.length)||0," / ",he.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:o.note||"",onChange:a=>{i({note:""}),n({note:a.target.value.slice(0,he.PROJECT.MAX_NOTE_LENGTH)})},error:!!l.note,helperText:l.note||"",sx:{mt:3}})]})})}lt.propTypes={readOnly:s.bool.isRequired,params:s.object.isRequired,setParams:s.func.isRequired,paramsErrTip:s.object.isRequired,setParamsErrTip:s.func.isRequired,loading:s.bool.isRequired};lt.defaultProps={};function En(t){for(const o in t)typeof t[o]=="string"?t[o]=t[o].replace(/\\\\/g,"\\"):typeof t[o]=="object"&&t[o]!==null&&En(t[o]);return t}function it({index:t,item:o,dockerParams:n,setDockerParams:l,dataKey:i,t:d,readOnly:r}){const u=(o==null?void 0:o.value)||"",[a,f]=x.useState(!1),b=()=>{var U;(U=n[i])==null||U.splice(t,1),l({...n,[i]:[...n[i]]})},j=(U,R)=>{var g;(g=n[i])!=null&&g[t]&&(R?(n[i][t].custom=n[i][t].value,n[i][t].value=`$${yt(o.key)}`):(n[i][t].value=n[i][t].custom||"",n[i][t].custom="")),l({...n,[i]:[...n[i]]})},y=(U,R)=>{var D;const g=((D=n[i][t])==null?void 0:D.value)||"";n[i][t]={...n[i][t],secure:R,value:R&&g===he.BLOCKLET_AUTOMATIC_ENV_VALUE?"":g},l({...n,[i]:[...n[i]]})},h=(U,R)=>{n[i][t]={...n[i][t],shared:R},l({...n,[i]:[...n[i]]})},p=(U,R)=>{var D;const g=((D=n[i][t])==null?void 0:D.value)||"";n[i][t]={...n[i][t],required:R,value:R&&g===he.BLOCKLET_AUTOMATIC_ENV_VALUE?"":g},l({...n,[i]:[...n[i]]})},v=(U,R)=>{n[i][t]={...n[i][t],value:R?he.BLOCKLET_AUTOMATIC_ENV_VALUE:"",secure:!1,required:!1},l({...n,[i]:[...n[i]]})},w=U=>{n[i][t]={...n[i][t],description:U.target.value},l({...n,[i]:[...n[i]]})},m=U=>{const R=U.target.value==="web"?"web":"docker";R==="web"&&n.dockerArgs.forEach(M=>{M.type="docker"});const D=`/${n.dockerImage.replace(/\W/g,"-")}-${t}`;n.dockerArgs[t]={...n.dockerArgs[t],type:R,path:R==="docker"?D:"/",protocol:"http",prefix:R==="docker"?D:"/",name:"publicUrl",port:"BLOCKLET_PORT"},l({...n,dockerArgs:[...n.dockerArgs]})},k=U=>{n.dockerArgs[t]={...n.dockerArgs[t],proxyBehavior:U.target.value==="direct"?"direct":"service"},l({...n,dockerArgs:[...n.dockerArgs]})},C=U=>{const R=U.target.value;n[i][t]={...n[i][t],prefix:R,path:R==="*"?"/":R},l({...n,[i]:[...n[i]]})},T=U=>{var R;(R=n[i])!=null&&R[t]&&(n[i][t].value=U.target.value),l({...n,[i]:[...n[i]]})},$=u===`$${yt(o.key)}`||o.custom,I=i==="dockerArgs"&&!dn[o.key],L=qs[o.key],z=i==="dockerEnvs",q=o.key==="--publish";let Z=o.key;return q&&o.type==="web"?Z="--publish (Web)":z&&(Z=`--env ${o.key}`),e.jsxs(c,{sx:{display:"flex",flexDirection:"row",gap:2,alignItems:"center"},children:[e.jsx(c,{sx:{width:250},children:e.jsx(E,{sx:{textOverflow:"ellipsis",width:"100%",overflow:"hidden"},children:Z})}),e.jsxs(c,{sx:{display:"flex",flexDirection:"column",gap:1,flex:1},children:[e.jsx(ne,{disabled:r||$||I||o.value===he.BLOCKLET_AUTOMATIC_ENV_VALUE,placeholder:"",value:$?`$${yt(o.key)}`:u,sx:{flex:1},InputProps:{endAdornment:e.jsxs(Je,{position:"end",sx:{zoom:.9},children:[(!(L||I)||z||q)&&e.jsx(ce,{onClick:()=>f(!0),children:e.jsx(ae,{icon:"icon-park-outline:setting-config"})}),!r&&e.jsx(ce,{onClick:b,color:I?"error":"default",children:e.jsx(ae,{icon:"ic:round-delete"})})]})},error:I,onChange:T}),I&&e.jsx(E,{variant:"caption",color:"error",children:d("blocklet.publish.docker.noAllowTheArg")}),o.key==="--publish"&&e.jsx(E,{variant:"caption",color:"text.secondary",children:d("blocklet.publish.docker.publishTips")}),o.key==="--volume"&&Es[o.key](u)&&e.jsx(E,{variant:"caption",color:"error",children:d("blocklet.publish.docker.volumeTips")})]}),a&&e.jsx(ut,{open:!0,fullWidth:!0,maxWidth:"sm",PaperProps:{style:{minHeight:0}},title:d(z?"blocklet.publish.docker.modifyEnv":"blocklet.publish.docker.modifyParam"),onClose:()=>f(!1),children:e.jsxs(c,{sx:{display:"flex",flexDirection:"column",gap:1,paddingBottom:2},children:[L||I||z?null:e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(E,{children:d("blocklet.publish.docker.needCustomInput")}),e.jsx(_e,{disabled:r,checked:$,onChange:j,sx:{zoom:.9}})]}),z&&e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(E,{children:d("blocklet.publish.docker.shared")}),e.jsx(_e,{disabled:r,checked:o.shared,onChange:h,sx:{zoom:.9}})]}),z&&e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(E,{children:d("blocklet.publish.docker.required")}),e.jsx(_e,{disabled:r,checked:o.required,onChange:p,sx:{zoom:.9}})]}),z&&e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(E,{children:d("blocklet.publish.docker.secure")}),e.jsx(_e,{disabled:r,checked:o.secure,onChange:y,sx:{zoom:.9}})]}),z&&e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(E,{children:d("blocklet.publish.docker.autoGenerated")}),e.jsx(_e,{disabled:r,checked:o.value===he.BLOCKLET_AUTOMATIC_ENV_VALUE,onChange:v,sx:{zoom:.9}})]}),z&&e.jsxs(c,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(E,{sx:{flex:1},children:d("blocklet.publish.docker.description")}),e.jsx(ne,{disabled:r,value:o.description,onChange:w,sx:{flex:1},label:d("blocklet.publish.docker.description")})]}),q&&e.jsxs(c,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(E,{sx:{flex:1},children:d("blocklet.publish.docker.portType")}),e.jsxs(wt,{value:o.type||"docker",onChange:m,children:[e.jsx(fe,{value:"docker",children:"Docker"}),e.jsx(fe,{value:"web",children:"Web"})]})]}),q&&o.type==="web"&&e.jsxs(c,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(E,{sx:{flex:1},children:d("blocklet.publish.docker.proxyBehavior")}),e.jsxs(wt,{value:o.proxyBehavior||"service",onChange:k,children:[e.jsx(fe,{value:"service",children:d("blocklet.publish.docker.serviceProxy")}),e.jsx(fe,{value:"direct",children:d("blocklet.publish.docker.directProxy")})]})]}),q&&o.type==="web"&&e.jsxs(c,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(E,{sx:{flex:1},children:d("blocklet.publish.docker.prefix")}),e.jsx(ne,{disabled:r,value:o.prefix,onChange:C,sx:{flex:1},label:d("blocklet.publish.docker.prefix")})]})]})})]})}it.propTypes={dockerParams:s.object.isRequired,setDockerParams:s.func.isRequired,dataKey:s.string.isRequired,item:s.object.isRequired,t:s.func.isRequired,readOnly:s.bool.isRequired,index:s.number.isRequired};it.defaultProps={};const el=`
194
194
  docker run --name postgrest
195
195
  -p 3000:3000
196
196
  -e PGRST_DB_URI="postgres://username:password@host:port/database"