@abtnode/blocklet-services 1.16.40-beta-20250305-001025-5ee639c9 → 1.16.40-beta-20250305-022942-dea362e4

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 (67) hide show
  1. package/api/services/studio/index.js +3 -3
  2. package/dist/assets/{access-control-DGnu8R-_.js → access-control-DPAjPJrm.js} +1 -1
  3. package/dist/assets/{add-component-core-Bbl0KUAk.js → add-component-core-s08ciPf7.js} +1 -1
  4. package/dist/assets/{add-resource-DtMCqT6r.js → add-resource-CVe7ZKgt.js} +1 -1
  5. package/dist/assets/{analytics-BpE1mSK8.js → analytics-BqkTOyTA.js} +1 -1
  6. package/dist/assets/{audit-logs-BniXTgud.js → audit-logs-YnCvzLMF.js} +1 -1
  7. package/dist/assets/{branding-Bo2bC8bs.js → branding-DufH4YY9.js} +2 -2
  8. package/dist/assets/{bundle-avatar-Sre-N_aE.js → bundle-avatar-DS4sS4Ug.js} +1 -1
  9. package/dist/assets/{complete-Bt6vm6Xh.js → complete-BrjCxDOq.js} +1 -1
  10. package/dist/assets/{component-Dc-fRks0.js → component-zxGl4zf8.js} +1 -1
  11. package/dist/assets/{config-Bs1nzYyR.js → config-CVwG5ii_.js} +1 -1
  12. package/dist/assets/{config-navigation-WPDlQ1RJ.js → config-navigation-ChjaLlA9.js} +3 -3
  13. package/dist/assets/{config-space-BwYNAO5S.js → config-space-DHtv33di.js} +1 -1
  14. package/dist/assets/{confirm-D9nnIOvs.js → confirm-Di8Vvymn.js} +1 -1
  15. package/dist/assets/{connect-BDN-wehP.js → connect-CykhV8jX.js} +1 -1
  16. package/dist/assets/{connect-CyW5d5Dv.js → connect-DpYoQ3xM.js} +1 -1
  17. package/dist/assets/{connect-to-Bl1JCiMg.js → connect-to-DGbSWMus.js} +1 -1
  18. package/dist/assets/{dashboard-DyGi-puS.js → dashboard-DdkKjU2L.js} +3 -3
  19. package/dist/assets/{delete-confirm-DZNkTsic.js → delete-confirm-B40CCTo2.js} +1 -1
  20. package/dist/assets/{domain-CoZiXxyK.js → domain-D37Iq-fb.js} +1 -1
  21. package/dist/assets/{domain-action-card-DatWnWEH.js → domain-action-card-B6iFs8uG.js} +1 -1
  22. package/dist/assets/{domains-Cczdqu0Z.js → domains-Bn5zR8JS.js} +1 -1
  23. package/dist/assets/{email-DALnM6tC.js → email-CnCbt9wS.js} +1 -1
  24. package/dist/assets/{exchange-passport-Bf-YSqcM.js → exchange-passport-BM0Ne4St.js} +1 -1
  25. package/dist/assets/{form-text-input-gQXonEjr.js → form-text-input-Bdb4wXRt.js} +1 -1
  26. package/dist/assets/{fuel-DqVOAgbE.js → fuel-B1DzM8DW.js} +1 -1
  27. package/dist/assets/{index-CpfGTKUf.js → index-0m-J-ZAX.js} +2 -2
  28. package/dist/assets/{index-Y6bMeXBB.js → index-8Xn_gix_.js} +1 -1
  29. package/dist/assets/{index-DZeG-UP6.js → index-B7_ziUTF.js} +1 -1
  30. package/dist/assets/{index-BUDaVPaJ.js → index-B9xDkTYZ.js} +4 -4
  31. package/dist/assets/{index-Zz9qzQ_9.js → index-BnIYxbxY.js} +1 -1
  32. package/dist/assets/{index-a-qtpRvq.js → index-CB8LRAXR.js} +3 -3
  33. package/dist/assets/{index-CR8UpawY.js → index-CENj2fOq.js} +1 -1
  34. package/dist/assets/{index-gpG3AUyG.js → index-DaVeYoNQ.js} +1 -1
  35. package/dist/assets/{index-BmW4nkqT.js → index-Deh5N0Ca.js} +1 -1
  36. package/dist/assets/{index-C6PabcPO.js → index-DqR_pNmL.js} +1 -1
  37. package/dist/assets/index-FDeY8Od4.js +138 -0
  38. package/dist/assets/{index-C-jNyGNZ.js → index-Fv88MhEb.js} +1 -1
  39. package/dist/assets/{index-Cszfyf7Q.js → index-Wl7uu5xS.js} +1 -1
  40. package/dist/assets/{index-bZdsGPmc.js → index-mso5VXSP.js} +1 -1
  41. package/dist/assets/{invitation-WgaVpLz-.js → invitation-nR3cIkjy.js} +1 -1
  42. package/dist/assets/{invite-CvRmEUzI.js → invite-D6h2Kml0.js} +1 -1
  43. package/dist/assets/{issue-passport-DvrxTzgL.js → issue-passport-CA5yDYxP.js} +1 -1
  44. package/dist/assets/{item-BmR66mZ6.js → item-Bhfjro40.js} +1 -1
  45. package/dist/assets/{layout-DTwYq-9q.js → layout-ZMeaWGok.js} +1 -1
  46. package/dist/assets/{list-BQIfnrdu.js → list-ChtSD939.js} +1 -1
  47. package/dist/assets/{log-MmG2K3Cy.js → log-MCKmey1M.js} +1 -1
  48. package/dist/assets/{login-D-xY5H2J.js → login-Bq2_5-hJ.js} +1 -1
  49. package/dist/assets/{logo-uploader-COOjI78W.js → logo-uploader-DeZeIw8p.js} +3 -3
  50. package/dist/assets/{lost-passport-XYMkiTwo.js → lost-passport-C9PbOpKs.js} +1 -1
  51. package/dist/assets/{overview-DhXk6dxJ.js → overview-DNIuos67.js} +1 -1
  52. package/dist/assets/{publish-resource-mmACXheB.js → publish-resource-Bu34onY2.js} +1 -1
  53. package/dist/assets/{relative-time-7jETcOaL.js → relative-time-Gzr-RzyU.js} +1 -1
  54. package/dist/assets/{setup-fPLYIoHX.js → setup-DwT-eZo_.js} +3 -3
  55. package/dist/assets/{start-R4emxzL_.js → start-BMPOdLHY.js} +1 -1
  56. package/dist/assets/{status-Cn67FaBl.js → status-DiWFAPO1.js} +1 -1
  57. package/dist/assets/{step-actions-BzTrLOhC.js → step-actions-D1-msdeY.js} +1 -1
  58. package/dist/assets/{traffic-DgHqx0ot.js → traffic-s8iVlNpL.js} +1 -1
  59. package/dist/assets/{transfer-CFTVWUIN.js → transfer-DOtiND1w.js} +1 -1
  60. package/dist/assets/{unsubscribe-ClBSlk0u.js → unsubscribe-DlO-9_z9.js} +1 -1
  61. package/dist/assets/{user-center-DlZwK1g7.js → user-center-BEC_SYzS.js} +1 -1
  62. package/dist/assets/{util-CuX2h5UG.js → util-iyBXvLTc.js} +1 -1
  63. package/dist/assets/{wrap-locale-CkbmGs8Q.js → wrap-locale-BtIDW28I.js} +1 -1
  64. package/dist/index.html +1 -1
  65. package/dist/service-worker.js +1 -1
  66. package/package.json +21 -21
  67. package/dist/assets/index-CsCfuYnX.js +0 -138
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-a-qtpRvq.js","assets/vendor-arcblock-Bv04Mkff.js","assets/vendor-react-DoD83n6N.js","assets/vendor-utils-oUOK1Lc7.js","assets/vendor-mui-core-Dh3XBxY7.js","assets/vendor-hooks-DlxYXMPL.js","assets/vendor-arcblock-DhgPdlEj.css","assets/index-BZu4MJFr.js","assets/index-CpfGTKUf.js","assets/index-tUQxVYYQ.js","assets/index-AgKpYdvC.css"])))=>i.map(i=>d[i]);
2
- import{r as w,k as St,l as st,L as ce,u as Yn,h as Zn,i as dt}from"./vendor-react-DoD83n6N.js";import{a1 as he,j as t,t as Be,a3 as u,aG as Vo,E as d,a4 as de,I as oe,T as O,bU as Wo,D as rt,aa as ae,ar as Kn,bM as Je,ad as Uo,aI as Xe,bn as xt,x as Z,a2 as Ze,P as Fo,G as Ho,v as It,$ as Go,aj as Jo,ak as ue,am as es,ac as Xo,r as Qo,bI as ts,K as Ve,y as Yo,M as Y,ae as je,aF as os,L as ns,z as ss,bj as rs,av as Zo,au as Ke,bq as ls,br as is,bV as cs,bW as as,aK as Ko,bF as ds,bO as us,bu as ps,bv as ut}from"./vendor-mui-core-Dh3XBxY7.js";import{z as me,C as _e,h as re,a6 as fs,f as fo,_ as en,ae as ho}from"./index-CpfGTKUf.js";import{a0 as be,b as J,e as Q,a3 as Ae,ad as tn,aX as on,ab as nn,_ as hs,aY as Dt,j as U,n as ms,aZ as bs,a_ as xs,z as gs,aE as ne,a$ as ks,aq as js,aO as Ie,a8 as Tt,b0 as ye,aj as ys,ao as vs}from"./vendor-arcblock-Bv04Mkff.js";import{d as _t}from"./Add-Cip-Q3Dt.js";import{d as ws}from"./Error-tDg6ei77.js";import{C as Pt}from"./confirm-D9nnIOvs.js";import{u as lt}from"./session-BqpWYLN3.js";import{W as mo}from"./did-address-nBrtfdFs.js";import{E as We,D as bo,C as xo,P as go}from"./react-beautiful-dnd.esm-Drgsy606.js";import{B as Lt}from"./bundle-avatar-Sre-N_aE.js";import{S as pe}from"./shorten-label-DXP5M5GB.js";import{U as Cs,x as ie,G as qt,C as sn}from"./vendor-utils-oUOK1Lc7.js";import{d as Rs}from"./Download-BcZsjfbS.js";import{C as rn}from"./click-to-copy-_PxhgXLr.js";import{d as Ss}from"./QuestionMarkCircle-DRDWkVkn.js";import{u as Is}from"./vendor-hooks-DlxYXMPL.js";import{_ as Se}from"./useSetState-BL3ktMon.js";import{c as $t}from"./index-tUQxVYYQ.js";import{E as Nt}from"./index-C24CwgC5.js";import{p as et}from"./index-Cszfyf7Q.js";import"./api-C4EBZ3D8.js";import{d as Ds}from"./ChevronRight-CMCOlQoz.js";import{T as Ts,a as _s}from"./vendor-mui-x-l1ezRCJc.js";import{d as ko}from"./DeleteOutline-f6Nb7LK2.js";import{c as Ps,A as ln,u as Ls,S as qs,U as $s,a as pt,b as cn,n as Ns,e as As,f as jo,g as Es,h as Ms}from"./item-BmR66mZ6.js";import{d as Os}from"./ArrowDropDown-_ravVKaf.js";import{f as De}from"./format-error-LAoTjvJe.js";import{d as zs}from"./Launch-COjc0xnX.js";import{M as Bs}from"./index-D-W1QzOs.js";import{r as Vs}from"./index-Mj8Kilqv.js";import{d as Ws}from"./Done-DcyOV4wB.js";import"./raf-schd.esm-GV-XhwE0.js";import"./delete-confirm-DZNkTsic.js";import"./get-safe-url-DnoVfY5w.js";var At={},Us=he;Object.defineProperty(At,"__esModule",{value:!0});var an=At.default=void 0,Fs=Us(be()),Hs=t;an=At.default=(0,Fs.default)((0,Hs.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 Et={},Gs=he;Object.defineProperty(Et,"__esModule",{value:!0});var dn=Et.default=void 0,Js=Gs(be()),Xs=t;dn=Et.default=(0,Js.default)((0,Xs.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 Mt={},Qs=he;Object.defineProperty(Mt,"__esModule",{value:!0});var un=Mt.default=void 0,Ys=Qs(be()),Zs=t;un=Mt.default=(0,Ys.default)((0,Zs.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 Ot({did:e,projectId:o,title:n,logo:r,describe:s}){const l=`${`${J.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e}/${o}/logo/upload`}/${r}`,[a,c]=w.useState(!1),f=Be(h=>h.breakpoints.down("md"));return t.jsxs(u,{sx:{display:"flex",flexDirection:"row",color:a?"primary.main":"grey.900",gap:1},onPointerEnter:()=>c(!0),onPointerLeave:()=>c(!1),children:[t.jsx(Vo,{sx:{borderRadius:1},src:l}),t.jsxs(u,{children:[t.jsx(pe,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:f?"primary.main":""},children:n||"/"}),t.jsx(pe,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:f||a?"primary.main":"grey.700"},children:s||"/"})]})]})}Ot.propTypes={projectId:d.string.isRequired,did:d.string.isRequired,title:d.string.isRequired,logo:d.string.isRequired,describe:d.string.isRequired};function zt({initUrl:e}){const o=St(),n=(e==null?void 0:e.searchParams.get("tenantScope"))||"",{t:r,locale:s}=Q(),{api:i}=me(),{api:l}=lt(),[a,c]=w.useState(!0),{blocklet:f}=_e(),[h,k]=w.useState(null),[x,p]=w.useState(!1),j=Be(m=>m.breakpoints.down("xl")),{componentDid:v=""}=st(),[I,g]=w.useState(null),b=()=>{i.getProjects({input:{did:f.meta.did,componentDid:v,tenantScope:n}}).then(m=>{const y=(m==null?void 0:m.projects)||[];c(!1),g(y)}).catch(m=>{c(!1),U.error(m.message)})},C=()=>{o(`${J.UNOWNED_DID}/create/none`,{replace:!0})},_=m=>{k(m)},T=()=>{c(!1),p(!0)},D=()=>{p(!1),k(null)},$=m=>{U.error(m.message),p(!1),k(null)},R=m=>{if(!(m!=null&&m.deleted)){U.error("Delete project failed");return}b(),p(!1),k(null)},A=(m,y,L)=>{let z=m==null?void 0:m.trim();return z?(z=ms.toAddress(z).toLocaleLowerCase(),L.some((B,S)=>{const P=y[S];return P&&B.searchable&&B.display!=="excluded"&&B.display!=="false"&&P.toLocaleLowerCase().includes(z)})):!0};if(w.useEffect(()=>{b()},[]),!I&&a)return t.jsx(u,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:t.jsx(We,{})});if(!I)return null;if(!I.length)return t.jsxs(u,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[t.jsx(u,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:r("blocklet.publish.blockletEmptyTip")}),t.jsx(u,{sx:{fontSize:14,color:"text.secondary",mb:3},children:r("blocklet.publish.createBlockletTip")}),t.jsx(Ae,{onClick:C,variant:"contained",children:r("blocklet.publish.createBlocklet")})]});const q=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:m=>{const y=I[m];return t.jsx(ce,{to:`${y.id}`,children:t.jsx(Ot,{did:f.meta.did,projectId:y.id,logo:y.blockletLogo,title:y.blockletTitle,describe:y.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{searchable:!1,customBodyRender:m=>m?t.jsx(tn,{type:"success",children:m}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:m=>m?t.jsx(mo,{size:14,compact:!0,responsive:!1,did:m}):null}},j||v?null:{label:r("common.createdBy"),name:"createdBy",options:{customBodyRender:m=>m?t.jsx(mo,{onClick:()=>{o(`/.well-known/service/admin/members?did=${m}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:m}):null}},j||v?null:{label:r("common.scope"),name:"componentDid",options:{customBodyRender:m=>{const y=(f.children||[]).find(L=>L.meta.did===m);return y?t.jsxs(u,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[t.jsx(Lt,{size:14,blocklet:y,ancestors:[f]}),t.jsx(u,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:y.meta.title})]},m):""}}},j||n?null:{label:r("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:m=>t.jsx(u,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:t.jsx(pe,{children:m})})}},{label:r("common.updatedAt"),name:"updatedAt",options:{searchable:!1,customBodyRender:m=>t.jsx(on,{value:Number(m),locale:s})}},{label:r("common.actions"),name:"actions",options:{searchable:!1,customBodyRenderLite:m=>{const y=I[m];return t.jsxs(u,{display:"flex",children:[t.jsx(ce,{to:`${y.id}/new-release/${y.lastReleaseId}`,children:t.jsx(de,{title:r("blocklet.publish.createRelease"),placement:"top",children:t.jsx(oe,{color:"primary","aria-label":"create",children:t.jsx(an,{style:{fontSize:18}})})})}),!!y.lastReleaseId&&t.jsx(de,{title:r("blocklet.publish.viewLastRelease",{name:y.blockletTitle}),placement:"top",children:t.jsx(oe,{color:"secondary","aria-label":"create",children:t.jsx(ce,{style:{display:"flex"},to:`${y.id}/view/${y.lastReleaseId}`,children:t.jsx(dn,{sx:{fontSize:18}})})})}),t.jsx(de,{title:r("blocklet.publish.delete",{name:y.blockletTitle}),placement:"top",children:t.jsx(oe,{color:"primary","aria-label":"delete",onClick:()=>_(y),children:t.jsx(nn,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),M=x?t.jsx(hs,{open:!0,popup:!0,onClose:D,action:"check-has-project-id",locale:s,checkFn:l.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:R,onError:$,extraParams:{projectId:h.id,did:f.meta.did,name:h.blockletTitle},messages:{title:r("blocklet.publish.deleteProject.title",{name:h.blockletTitle}),scan:r("blocklet.publish.deleteProject.scan",{name:h.blockletTitle}),confirm:r("blocklet.publish.deleteProject.confirm"),success:r("blocklet.publish.deleteProject.success")}}):null;return t.jsxs(u,{children:[t.jsxs(u,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[t.jsxs(u,{display:"flex",flexDirection:"row",alignItems:"center",children:[t.jsx(u,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:r("common.blockletStudio")}),t.jsx(de,{title:r("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:t.jsx(un,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),t.jsxs(Ae,{onClick:C,variant:"contained",children:[t.jsx(_t,{style:{fontSize:"1.3em",marginRight:4}}),r("blocklet.publish.createBlocklet")]})]}),t.jsx(Dt,{className:"main-table",locale:s,data:I,columns:q,options:{sort:!1,download:!1,filter:!1,print:!1,search:!0,viewColumns:!1,searchAlwaysOpen:!0,rowsPerPageOptions:[10,20,50,100],searchPlaceholder:r("blocklet.list.searchPlaceholder"),searchDebounceTime:400,customSearch:A}}),h&&t.jsx(Pt,{title:`${r("common.delete")} ${h.blockletTitle}`,description:r("blocklet.publish.deleteProject.description"),confirm:r("common.confirm"),onConfirm:T,onCancel:()=>k(null),children:t.jsx(u,{sx:{marginTop:2},children:[r("blocklet.publish.deleteProject.tip1"),r("blocklet.publish.deleteProject.tip2"),r("blocklet.publish.deleteProject.tip3")].map(m=>t.jsxs(u,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[t.jsx(ws,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),t.jsx(O,{component:"span",variant:"inherit",color:"text.secondary",children:m})]}))})}),M]})}zt.propTypes={initUrl:d.object};zt.defaultProps={initUrl:null};var Bt={},Ks=he;Object.defineProperty(Bt,"__esModule",{value:!0});var pn=Bt.default=void 0,er=Ks(be()),yo=t;pn=Bt.default=(0,er.default)([(0,yo.jsx)("path",{d:"M20 17H4V5h8V3H4c-1.11 0-2 .89-2 2v12c0 1.1.89 2 2 2h4v2h8v-2h4c1.1 0 2-.9 2-2v-3h-2z"},"0"),(0,yo.jsx)("path",{d:"m17 14 5-5-1.41-1.41L18 10.17V3h-2v7.17l-2.59-2.58L12 9z"},"1")],"InstallDesktop");const tr=(e,o)=>{if(!e)return"";try{return o?JSON.parse(e)[o]:JSON.parse(e)}catch{}return e},fn=tr;function or(){var $;const{t:e,locale:o}=Q(),{projectId:n}=st(),{api:r}=me(),[s,i]=w.useState(!0),{blocklet:l}=_e(),a=Be(R=>R.breakpoints.down("md")),[c,f]=w.useState(null),[h,k]=w.useState(null),[x,p]=w.useState(null),j=($=window.env)==null?void 0:$.serverEndpoint,v=()=>{r.getReleases({input:{did:l.meta.did,projectId:n}}).then(R=>{const A=(R==null?void 0:R.releases)||[];i(!1),f(A)}).catch(R=>{i(!1),U.error(R.message)})},I=()=>{r.doBatchQuery({getProject:{input:{did:l.meta.did,projectId:n}},getReleases:{input:{did:l.meta.did,projectId:n}}}).then(R=>{k(R.getProject.project||{}),f(R.getReleases.releases||[]),i(!1)}).catch(R=>{i(!1),U.error(R.message)})};w.useEffect(()=>{I()},[]);const[g,b]=w.useState(""),C=()=>{i(!1);const R=x.id;r.deleteRelease({input:{did:l.meta.did,projectId:n,releaseId:R}}).then(()=>{i(!1),v(),U.success(e("common.removeSuccess")),p(null)}).catch(A=>{i(!1),U.error(A.message)})},_=R=>{p(R)};if(!c&&s)return t.jsx(u,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:t.jsx(We,{})});if(!c)return null;const T=t.jsxs(Wo,{className:"breadcrumbs","aria-label":"breadcrumb",children:[t.jsx(ce,{to:"..",children:e("common.blockletStudio")}),t.jsx(O,{color:"text.primary",children:t.jsx(pe,{maxLength:a?6:30,children:h.blockletTitle})})]});if(!c.length)return t.jsxs(t.Fragment,{children:[T,t.jsxs(u,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[t.jsx(u,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:e("blocklet.publish.releaseEmptyTip")}),t.jsx(u,{sx:{fontSize:14,color:"text.secondary",mb:3},children:e("blocklet.publish.createReleaseTip")}),t.jsx(ce,{to:"create/none",children:t.jsx(Ae,{variant:"contained",children:e("blocklet.publish.createRelease")})})]})]});const D=[{label:e("common.version"),name:"blockletVersion",minWidth:160,options:{customBodyRenderLite:R=>{const A=c[R];return t.jsx(ce,{to:`view/${A.id}`,children:t.jsx(Ot,{did:l.meta.did,projectId:h.id,logo:A.blockletLogo,title:A.blockletVersion,describe:A.blockletTitle})})}}},{label:e("blocklet.publish.releaseNote"),name:"note",options:{customBodyRenderLite:R=>{const A=c[R];return t.jsx(O,{className:"note",children:fn(A.note,"note")})}}},{label:e("common.status"),name:"status",options:{customBodyRender:R=>t.jsx(tn,{type:R==="published"?"success":"warning",children:R==="published"?"Released":Cs(R)})}},{label:e("common.lastPublishedAt"),name:"updatedAt",options:{customBodyRenderLite:R=>{const A=c[R];return A.status!==re.PROJECT.RELEASE_STATUS.published?"":t.jsx(on,{value:Number(A.updatedAt),locale:o})}}},{label:e("common.actions"),name:"actions",options:{customBodyRenderLite:R=>{var L;const A=c[R];let q="",M="";const m=A.status==="published";if(m){const z=ie(j,`/api/project/${l.meta.did}/${h.id}/${h.lastReleaseId}/release/blocklet.json`),B=new URL(j);B.pathname=ie(B.pathname,"/launch-blocklet/agreement"),B.searchParams.set("blocklet_meta_url",z),q=B.href,M=ie(`${J.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${l.meta.did}/${h.id}/${h.lastReleaseId}/download/${(h.lastReleaseFiles||[])[0]}`)}const y=(L=h.blockletComponents)!=null&&L.some(z=>z.included)||A.uploadedResource?"pack":"resource";return t.jsxs(u,{display:"flex",alignItems:"center",children:[m&&y==="pack"&&t.jsx(de,{title:e("blocklet.publish.install",{name:h.blockletTitle}),placement:"top",children:t.jsx(oe,{color:"secondary","aria-label":"create",children:t.jsx("a",{style:{display:"flex"},href:q,target:"_blank",rel:"noreferrer",children:t.jsx(pn,{sx:{fontSize:18}})})})}),m&&t.jsx(de,{title:e("blocklet.publish.download",{name:h.blockletTitle}),placement:"top",children:t.jsx(oe,{color:"primary","aria-label":"download",children:t.jsx("a",{style:{display:"flex"},href:M,children:t.jsx(Rs,{sx:{fontSize:18}})})})}),t.jsx(de,{title:e("blocklet.publish.delete",{name:h.blockletTitle}),placement:"top",children:t.jsx(oe,{color:"primary","aria-label":"delete",onClick:()=>_(A),children:t.jsx(nn,{sx:{fontSize:18}})})})]})}}}];return t.jsxs(nr,{children:[t.jsxs(u,{className:"header",children:[T,t.jsxs(u,{display:"flex",alignItems:"center",gap:1,children:[t.jsx(Ae,{variant:"outlined",onClick:()=>{const R=ie(j,`/api/project/${l.meta.did}/${n}/blocklet.json`);b(R)},children:e("blocklet.publish.copyInstallUrl")}),t.jsx(ce,{to:"new-release/none",children:t.jsxs(Ae,{variant:"contained",children:[t.jsx(_t,{style:{fontSize:"1.3em",marginRight:4}}),e("blocklet.publish.createRelease")]})})]})]}),t.jsx(rt,{fullWidth:!0,maxWidth:"sm",open:g,onClose:()=>b(""),children:t.jsxs(u,{sx:{py:5,px:4,wordBreak:"break-all"},children:[t.jsx(O,{variant:"h6",sx:{mb:2},children:e("blocklet.publish.installResourceTip")}),t.jsx(rn,{children:g}),t.jsxs(O,{sx:{mt:2},children:[e("blocklet.publish.installResourceTip2"),t.jsx("a",{style:{marginLeft:4},href:"https://www.arcblock.io/docs/blocklet-developer/how-to-use-install-url",target:"_blank",rel:"noreferrer",children:e("blocklet.publish.installResourceHelp")})]})]})}),t.jsx(Dt,{className:"main-table",verticalKeyWidth:100,locale:o,data:c,columns:D,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1}}),x&&t.jsx(Pt,{title:e(`${e("common.delete")} ${x.blockletVersion}`),description:e("blocklet.publish.deleteReleaseTip"),confirm:e("common.confirm"),onConfirm:C,onCancel:()=>p(null)})]})}const nr=ae(u)`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CB8LRAXR.js","assets/vendor-arcblock-Bv04Mkff.js","assets/vendor-react-DoD83n6N.js","assets/vendor-utils-oUOK1Lc7.js","assets/vendor-mui-core-Dh3XBxY7.js","assets/vendor-hooks-DlxYXMPL.js","assets/vendor-arcblock-DhgPdlEj.css","assets/index-BZu4MJFr.js","assets/index-0m-J-ZAX.js","assets/index-tUQxVYYQ.js","assets/index-AgKpYdvC.css"])))=>i.map(i=>d[i]);
2
+ import{r as w,k as St,l as st,L as ce,u as Yn,h as Zn,i as dt}from"./vendor-react-DoD83n6N.js";import{a1 as he,j as t,t as Be,a3 as u,aG as Vo,E as d,a4 as de,I as oe,T as O,bU as Wo,D as rt,aa as ae,ar as Kn,bM as Je,ad as Uo,aI as Xe,bn as xt,x as Z,a2 as Ze,P as Fo,G as Ho,v as It,$ as Go,aj as Jo,ak as ue,am as es,ac as Xo,r as Qo,bI as ts,K as Ve,y as Yo,M as Y,ae as je,aF as os,L as ns,z as ss,bj as rs,av as Zo,au as Ke,bq as ls,br as is,bV as cs,bW as as,aK as Ko,bF as ds,bO as us,bu as ps,bv as ut}from"./vendor-mui-core-Dh3XBxY7.js";import{z as me,C as _e,h as re,a6 as fs,f as fo,_ as en,ae as ho}from"./index-0m-J-ZAX.js";import{a0 as be,b as J,e as Q,a3 as Ae,ad as tn,aX as on,ab as nn,_ as hs,aY as Dt,j as U,n as ms,aZ as bs,a_ as xs,z as gs,aE as ne,a$ as ks,aq as js,aO as Ie,a8 as Tt,b0 as ye,aj as ys,ao as vs}from"./vendor-arcblock-Bv04Mkff.js";import{d as _t}from"./Add-Cip-Q3Dt.js";import{d as ws}from"./Error-tDg6ei77.js";import{C as Pt}from"./confirm-Di8Vvymn.js";import{u as lt}from"./session-BqpWYLN3.js";import{W as mo}from"./did-address-nBrtfdFs.js";import{E as We,D as bo,C as xo,P as go}from"./react-beautiful-dnd.esm-Drgsy606.js";import{B as Lt}from"./bundle-avatar-DS4sS4Ug.js";import{S as pe}from"./shorten-label-DXP5M5GB.js";import{U as Cs,x as ie,G as qt,C as sn}from"./vendor-utils-oUOK1Lc7.js";import{d as Rs}from"./Download-BcZsjfbS.js";import{C as rn}from"./click-to-copy-_PxhgXLr.js";import{d as Ss}from"./QuestionMarkCircle-DRDWkVkn.js";import{u as Is}from"./vendor-hooks-DlxYXMPL.js";import{_ as Se}from"./useSetState-BL3ktMon.js";import{c as $t}from"./index-tUQxVYYQ.js";import{E as Nt}from"./index-C24CwgC5.js";import{p as et}from"./index-Wl7uu5xS.js";import"./api-C4EBZ3D8.js";import{d as Ds}from"./ChevronRight-CMCOlQoz.js";import{T as Ts,a as _s}from"./vendor-mui-x-l1ezRCJc.js";import{d as ko}from"./DeleteOutline-f6Nb7LK2.js";import{c as Ps,A as ln,u as Ls,S as qs,U as $s,a as pt,b as cn,n as Ns,e as As,f as jo,g as Es,h as Ms}from"./item-Bhfjro40.js";import{d as Os}from"./ArrowDropDown-_ravVKaf.js";import{f as De}from"./format-error-LAoTjvJe.js";import{d as zs}from"./Launch-COjc0xnX.js";import{M as Bs}from"./index-D-W1QzOs.js";import{r as Vs}from"./index-Mj8Kilqv.js";import{d as Ws}from"./Done-DcyOV4wB.js";import"./raf-schd.esm-GV-XhwE0.js";import"./delete-confirm-B40CCTo2.js";import"./get-safe-url-DnoVfY5w.js";var At={},Us=he;Object.defineProperty(At,"__esModule",{value:!0});var an=At.default=void 0,Fs=Us(be()),Hs=t;an=At.default=(0,Fs.default)((0,Hs.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 Et={},Gs=he;Object.defineProperty(Et,"__esModule",{value:!0});var dn=Et.default=void 0,Js=Gs(be()),Xs=t;dn=Et.default=(0,Js.default)((0,Xs.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 Mt={},Qs=he;Object.defineProperty(Mt,"__esModule",{value:!0});var un=Mt.default=void 0,Ys=Qs(be()),Zs=t;un=Mt.default=(0,Ys.default)((0,Zs.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 Ot({did:e,projectId:o,title:n,logo:r,describe:s}){const l=`${`${J.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e}/${o}/logo/upload`}/${r}`,[a,c]=w.useState(!1),f=Be(h=>h.breakpoints.down("md"));return t.jsxs(u,{sx:{display:"flex",flexDirection:"row",color:a?"primary.main":"grey.900",gap:1},onPointerEnter:()=>c(!0),onPointerLeave:()=>c(!1),children:[t.jsx(Vo,{sx:{borderRadius:1},src:l}),t.jsxs(u,{children:[t.jsx(pe,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:f?"primary.main":""},children:n||"/"}),t.jsx(pe,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:f||a?"primary.main":"grey.700"},children:s||"/"})]})]})}Ot.propTypes={projectId:d.string.isRequired,did:d.string.isRequired,title:d.string.isRequired,logo:d.string.isRequired,describe:d.string.isRequired};function zt({initUrl:e}){const o=St(),n=(e==null?void 0:e.searchParams.get("tenantScope"))||"",{t:r,locale:s}=Q(),{api:i}=me(),{api:l}=lt(),[a,c]=w.useState(!0),{blocklet:f}=_e(),[h,k]=w.useState(null),[x,p]=w.useState(!1),j=Be(m=>m.breakpoints.down("xl")),{componentDid:v=""}=st(),[I,g]=w.useState(null),b=()=>{i.getProjects({input:{did:f.meta.did,componentDid:v,tenantScope:n}}).then(m=>{const y=(m==null?void 0:m.projects)||[];c(!1),g(y)}).catch(m=>{c(!1),U.error(m.message)})},C=()=>{o(`${J.UNOWNED_DID}/create/none`,{replace:!0})},_=m=>{k(m)},T=()=>{c(!1),p(!0)},D=()=>{p(!1),k(null)},$=m=>{U.error(m.message),p(!1),k(null)},R=m=>{if(!(m!=null&&m.deleted)){U.error("Delete project failed");return}b(),p(!1),k(null)},A=(m,y,L)=>{let z=m==null?void 0:m.trim();return z?(z=ms.toAddress(z).toLocaleLowerCase(),L.some((B,S)=>{const P=y[S];return P&&B.searchable&&B.display!=="excluded"&&B.display!=="false"&&P.toLocaleLowerCase().includes(z)})):!0};if(w.useEffect(()=>{b()},[]),!I&&a)return t.jsx(u,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:t.jsx(We,{})});if(!I)return null;if(!I.length)return t.jsxs(u,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[t.jsx(u,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:r("blocklet.publish.blockletEmptyTip")}),t.jsx(u,{sx:{fontSize:14,color:"text.secondary",mb:3},children:r("blocklet.publish.createBlockletTip")}),t.jsx(Ae,{onClick:C,variant:"contained",children:r("blocklet.publish.createBlocklet")})]});const q=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:m=>{const y=I[m];return t.jsx(ce,{to:`${y.id}`,children:t.jsx(Ot,{did:f.meta.did,projectId:y.id,logo:y.blockletLogo,title:y.blockletTitle,describe:y.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{searchable:!1,customBodyRender:m=>m?t.jsx(tn,{type:"success",children:m}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:m=>m?t.jsx(mo,{size:14,compact:!0,responsive:!1,did:m}):null}},j||v?null:{label:r("common.createdBy"),name:"createdBy",options:{customBodyRender:m=>m?t.jsx(mo,{onClick:()=>{o(`/.well-known/service/admin/members?did=${m}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:m}):null}},j||v?null:{label:r("common.scope"),name:"componentDid",options:{customBodyRender:m=>{const y=(f.children||[]).find(L=>L.meta.did===m);return y?t.jsxs(u,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[t.jsx(Lt,{size:14,blocklet:y,ancestors:[f]}),t.jsx(u,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:y.meta.title})]},m):""}}},j||n?null:{label:r("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:m=>t.jsx(u,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:t.jsx(pe,{children:m})})}},{label:r("common.updatedAt"),name:"updatedAt",options:{searchable:!1,customBodyRender:m=>t.jsx(on,{value:Number(m),locale:s})}},{label:r("common.actions"),name:"actions",options:{searchable:!1,customBodyRenderLite:m=>{const y=I[m];return t.jsxs(u,{display:"flex",children:[t.jsx(ce,{to:`${y.id}/new-release/${y.lastReleaseId}`,children:t.jsx(de,{title:r("blocklet.publish.createRelease"),placement:"top",children:t.jsx(oe,{color:"primary","aria-label":"create",children:t.jsx(an,{style:{fontSize:18}})})})}),!!y.lastReleaseId&&t.jsx(de,{title:r("blocklet.publish.viewLastRelease",{name:y.blockletTitle}),placement:"top",children:t.jsx(oe,{color:"secondary","aria-label":"create",children:t.jsx(ce,{style:{display:"flex"},to:`${y.id}/view/${y.lastReleaseId}`,children:t.jsx(dn,{sx:{fontSize:18}})})})}),t.jsx(de,{title:r("blocklet.publish.delete",{name:y.blockletTitle}),placement:"top",children:t.jsx(oe,{color:"primary","aria-label":"delete",onClick:()=>_(y),children:t.jsx(nn,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),M=x?t.jsx(hs,{open:!0,popup:!0,onClose:D,action:"check-has-project-id",locale:s,checkFn:l.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:R,onError:$,extraParams:{projectId:h.id,did:f.meta.did,name:h.blockletTitle},messages:{title:r("blocklet.publish.deleteProject.title",{name:h.blockletTitle}),scan:r("blocklet.publish.deleteProject.scan",{name:h.blockletTitle}),confirm:r("blocklet.publish.deleteProject.confirm"),success:r("blocklet.publish.deleteProject.success")}}):null;return t.jsxs(u,{children:[t.jsxs(u,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[t.jsxs(u,{display:"flex",flexDirection:"row",alignItems:"center",children:[t.jsx(u,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:r("common.blockletStudio")}),t.jsx(de,{title:r("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:t.jsx(un,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),t.jsxs(Ae,{onClick:C,variant:"contained",children:[t.jsx(_t,{style:{fontSize:"1.3em",marginRight:4}}),r("blocklet.publish.createBlocklet")]})]}),t.jsx(Dt,{className:"main-table",locale:s,data:I,columns:q,options:{sort:!1,download:!1,filter:!1,print:!1,search:!0,viewColumns:!1,searchAlwaysOpen:!0,rowsPerPageOptions:[10,20,50,100],searchPlaceholder:r("blocklet.list.searchPlaceholder"),searchDebounceTime:400,customSearch:A}}),h&&t.jsx(Pt,{title:`${r("common.delete")} ${h.blockletTitle}`,description:r("blocklet.publish.deleteProject.description"),confirm:r("common.confirm"),onConfirm:T,onCancel:()=>k(null),children:t.jsx(u,{sx:{marginTop:2},children:[r("blocklet.publish.deleteProject.tip1"),r("blocklet.publish.deleteProject.tip2"),r("blocklet.publish.deleteProject.tip3")].map(m=>t.jsxs(u,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[t.jsx(ws,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),t.jsx(O,{component:"span",variant:"inherit",color:"text.secondary",children:m})]}))})}),M]})}zt.propTypes={initUrl:d.object};zt.defaultProps={initUrl:null};var Bt={},Ks=he;Object.defineProperty(Bt,"__esModule",{value:!0});var pn=Bt.default=void 0,er=Ks(be()),yo=t;pn=Bt.default=(0,er.default)([(0,yo.jsx)("path",{d:"M20 17H4V5h8V3H4c-1.11 0-2 .89-2 2v12c0 1.1.89 2 2 2h4v2h8v-2h4c1.1 0 2-.9 2-2v-3h-2z"},"0"),(0,yo.jsx)("path",{d:"m17 14 5-5-1.41-1.41L18 10.17V3h-2v7.17l-2.59-2.58L12 9z"},"1")],"InstallDesktop");const tr=(e,o)=>{if(!e)return"";try{return o?JSON.parse(e)[o]:JSON.parse(e)}catch{}return e},fn=tr;function or(){var $;const{t:e,locale:o}=Q(),{projectId:n}=st(),{api:r}=me(),[s,i]=w.useState(!0),{blocklet:l}=_e(),a=Be(R=>R.breakpoints.down("md")),[c,f]=w.useState(null),[h,k]=w.useState(null),[x,p]=w.useState(null),j=($=window.env)==null?void 0:$.serverEndpoint,v=()=>{r.getReleases({input:{did:l.meta.did,projectId:n}}).then(R=>{const A=(R==null?void 0:R.releases)||[];i(!1),f(A)}).catch(R=>{i(!1),U.error(R.message)})},I=()=>{r.doBatchQuery({getProject:{input:{did:l.meta.did,projectId:n}},getReleases:{input:{did:l.meta.did,projectId:n}}}).then(R=>{k(R.getProject.project||{}),f(R.getReleases.releases||[]),i(!1)}).catch(R=>{i(!1),U.error(R.message)})};w.useEffect(()=>{I()},[]);const[g,b]=w.useState(""),C=()=>{i(!1);const R=x.id;r.deleteRelease({input:{did:l.meta.did,projectId:n,releaseId:R}}).then(()=>{i(!1),v(),U.success(e("common.removeSuccess")),p(null)}).catch(A=>{i(!1),U.error(A.message)})},_=R=>{p(R)};if(!c&&s)return t.jsx(u,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:t.jsx(We,{})});if(!c)return null;const T=t.jsxs(Wo,{className:"breadcrumbs","aria-label":"breadcrumb",children:[t.jsx(ce,{to:"..",children:e("common.blockletStudio")}),t.jsx(O,{color:"text.primary",children:t.jsx(pe,{maxLength:a?6:30,children:h.blockletTitle})})]});if(!c.length)return t.jsxs(t.Fragment,{children:[T,t.jsxs(u,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[t.jsx(u,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:e("blocklet.publish.releaseEmptyTip")}),t.jsx(u,{sx:{fontSize:14,color:"text.secondary",mb:3},children:e("blocklet.publish.createReleaseTip")}),t.jsx(ce,{to:"create/none",children:t.jsx(Ae,{variant:"contained",children:e("blocklet.publish.createRelease")})})]})]});const D=[{label:e("common.version"),name:"blockletVersion",minWidth:160,options:{customBodyRenderLite:R=>{const A=c[R];return t.jsx(ce,{to:`view/${A.id}`,children:t.jsx(Ot,{did:l.meta.did,projectId:h.id,logo:A.blockletLogo,title:A.blockletVersion,describe:A.blockletTitle})})}}},{label:e("blocklet.publish.releaseNote"),name:"note",options:{customBodyRenderLite:R=>{const A=c[R];return t.jsx(O,{className:"note",children:fn(A.note,"note")})}}},{label:e("common.status"),name:"status",options:{customBodyRender:R=>t.jsx(tn,{type:R==="published"?"success":"warning",children:R==="published"?"Released":Cs(R)})}},{label:e("common.lastPublishedAt"),name:"updatedAt",options:{customBodyRenderLite:R=>{const A=c[R];return A.status!==re.PROJECT.RELEASE_STATUS.published?"":t.jsx(on,{value:Number(A.updatedAt),locale:o})}}},{label:e("common.actions"),name:"actions",options:{customBodyRenderLite:R=>{var L;const A=c[R];let q="",M="";const m=A.status==="published";if(m){const z=ie(j,`/api/project/${l.meta.did}/${h.id}/${h.lastReleaseId}/release/blocklet.json`),B=new URL(j);B.pathname=ie(B.pathname,"/launch-blocklet/agreement"),B.searchParams.set("blocklet_meta_url",z),q=B.href,M=ie(`${J.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${l.meta.did}/${h.id}/${h.lastReleaseId}/download/${(h.lastReleaseFiles||[])[0]}`)}const y=(L=h.blockletComponents)!=null&&L.some(z=>z.included)||A.uploadedResource?"pack":"resource";return t.jsxs(u,{display:"flex",alignItems:"center",children:[m&&y==="pack"&&t.jsx(de,{title:e("blocklet.publish.install",{name:h.blockletTitle}),placement:"top",children:t.jsx(oe,{color:"secondary","aria-label":"create",children:t.jsx("a",{style:{display:"flex"},href:q,target:"_blank",rel:"noreferrer",children:t.jsx(pn,{sx:{fontSize:18}})})})}),m&&t.jsx(de,{title:e("blocklet.publish.download",{name:h.blockletTitle}),placement:"top",children:t.jsx(oe,{color:"primary","aria-label":"download",children:t.jsx("a",{style:{display:"flex"},href:M,children:t.jsx(Rs,{sx:{fontSize:18}})})})}),t.jsx(de,{title:e("blocklet.publish.delete",{name:h.blockletTitle}),placement:"top",children:t.jsx(oe,{color:"primary","aria-label":"delete",onClick:()=>_(A),children:t.jsx(nn,{sx:{fontSize:18}})})})]})}}}];return t.jsxs(nr,{children:[t.jsxs(u,{className:"header",children:[T,t.jsxs(u,{display:"flex",alignItems:"center",gap:1,children:[t.jsx(Ae,{variant:"outlined",onClick:()=>{const R=ie(j,`/api/project/${l.meta.did}/${n}/blocklet.json`);b(R)},children:e("blocklet.publish.copyInstallUrl")}),t.jsx(ce,{to:"new-release/none",children:t.jsxs(Ae,{variant:"contained",children:[t.jsx(_t,{style:{fontSize:"1.3em",marginRight:4}}),e("blocklet.publish.createRelease")]})})]})]}),t.jsx(rt,{fullWidth:!0,maxWidth:"sm",open:g,onClose:()=>b(""),children:t.jsxs(u,{sx:{py:5,px:4,wordBreak:"break-all"},children:[t.jsx(O,{variant:"h6",sx:{mb:2},children:e("blocklet.publish.installResourceTip")}),t.jsx(rn,{children:g}),t.jsxs(O,{sx:{mt:2},children:[e("blocklet.publish.installResourceTip2"),t.jsx("a",{style:{marginLeft:4},href:"https://www.arcblock.io/docs/blocklet-developer/how-to-use-install-url",target:"_blank",rel:"noreferrer",children:e("blocklet.publish.installResourceHelp")})]})]})}),t.jsx(Dt,{className:"main-table",verticalKeyWidth:100,locale:o,data:c,columns:D,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1}}),x&&t.jsx(Pt,{title:e(`${e("common.delete")} ${x.blockletVersion}`),description:e("blocklet.publish.deleteReleaseTip"),confirm:e("common.confirm"),onConfirm:C,onCancel:()=>p(null)})]})}const nr=ae(u)`
3
3
  .header {
4
4
  display: flex;
5
5
  align-items: center;
@@ -129,7 +129,7 @@ import{r as w,k as St,l as st,L as ce,u as Yn,h as Zn,i as dt}from"./vendor-reac
129
129
  background: #fff;
130
130
  z-index: 10;
131
131
  }
132
- `;var Xt={},mr=he;Object.defineProperty(Xt,"__esModule",{value:!0});var gt=Xt.default=void 0,br=mr(be()),xr=t;gt=Xt.default=(0,br.default)((0,xr.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 wo="lastWantToConnectStoreId";function gr(e){var a,c;const[o,n]=w.useState(null),{session:r}=lt(),s=w.useCallback(f=>{n(f),localStorage.setItem(wo,f==null?void 0:f.id)},[n]),i=w.useMemo(()=>{var x,p,j,v;const f=localStorage.getItem(wo),h=f?(((x=e==null?void 0:e.settings)==null?void 0:x.storeList)||[]).find(I=>I.id===f):null;if(h)return h;let k=(((p=e==null?void 0:e.settings)==null?void 0:p.storeList)||[]).find(I=>{var g;return!(I.id!==J.BLOCKLET_STORE.id||I.scope&&I.scope!=="studio"&&I.scope!==((g=r==null?void 0:r.user)==null?void 0:g.did))});return k||(k=(v=(j=e==null?void 0:e.settings)==null?void 0:j.storeList)==null?void 0:v[0]),k},[(a=e==null?void 0:e.settings)==null?void 0:a.storeList,(c=r==null?void 0:r.user)==null?void 0:c.did]);return[o||i||{},s]}const ht={};async function gn(e,{interval:o=1e3,maxDuration:n=120*1e3,intervalFirst:r=4e3,timerKey:s=""}){ht[s]&&clearTimeout(ht[s]),await new Promise(a=>setTimeout(a,r));const i=Date.now(),l=async(a,c)=>{try{const f=await e();a(f)}catch(f){Date.now()-i>n?c(f):s?ht[s]=setTimeout(()=>l(a,c),o):setTimeout(()=>l(a,c),o)}};return new Promise(l)}function kr(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function jr(e,{did:o,projectId:n,messageId:r}){return gn(async()=>{var i;const s=await e.getProject({input:{did:o,projectId:n,messageId:r}});if(!((i=s==null?void 0:s.project)!=null&&i.blockletDid))throw new Error("Connected store not found");return s.project.blockletDid},{timerKey:"connect-studio"})}function yr(e,{did:o,projectId:n,storeId:r}){return gn(async()=>{var l,a;const s=await e.getProject({input:{did:o,projectId:n,messageId:""}});if(!((a=(l=s==null?void 0:s.project)==null?void 0:l.connectedStores)!=null&&a.length))throw new Error("Connected store not found");if(!s.project.connectedStores.find(c=>c.storeId===r))throw new Error("Connected store not found")},{timerKey:`connect-store-${r}`})}const kn=({fromBlocklet:e,nodeInfo:o,blocklet:n,userDid:r})=>{var l,a;const s=e?(l=n==null?void 0:n.meta)==null?void 0:l.did:o==null?void 0:o.did;let i=e?((a=n==null?void 0:n.settings)==null?void 0:a.storeList)||[]:(o==null?void 0:o.blockletRegistryList)||[];return Array.isArray(i)||(i=[]),i=i.filter(c=>c.protected||!c.scope||c.scope==="studio"||c.scope===r),{teamDid:s,storeList:i}};function Qt({blocklet:e,store:o={},onChangeStore:n,onClick:r,disabled:s,loading:i,componentDid:l}){var m,y,L;const{t:a}=Q(),{session:c}=lt(),{api:f,info:h,inService:k}=me(),x=_e(),[p,j]=w.useState(!1),v=w.useRef(null),[I,g]=w.useState(!1),[b,C]=w.useState(null),_=z=>{n(z),j(!1)},T=()=>{j(!p)},D=z=>{v.current&&v.current.contains(z.target)||j(!1)},$=()=>{g(!0)},R=()=>{g(!1)},A=async()=>{var z;if(b)try{await f.deleteBlockletStore({input:{teamDid:e.meta.did,url:b.url,projectId:"",scope:b.scope||"studio"}}),await((z=x==null?void 0:x.actions)==null?void 0:z.refreshBlocklet())}catch(B){U.error(`Remove Blocklet Store Error: ${De(B)}`)}finally{C(null)}},{storeList:q}=kn({fromBlocklet:k,blocklet:e,nodeInfo:h,componentDid:l,userDid:(m=c==null?void 0:c.user)==null?void 0:m.did}),M=(y=e==null?void 0:e.meta)==null?void 0:y.did;return t.jsxs(t.Fragment,{children:[t.jsxs(xt,{disabled:s,ref:v,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[t.jsxs(Z,{onClick:r,children:[i&&t.jsx(Ze,{size:14,sx:{mr:.5}}),`${a("common.connect")} ${o.name||""}`]}),t.jsx(Z,{size:"small","aria-controls":p?"split-button-menu":void 0,"aria-expanded":p?"true":void 0,"aria-label":"select merge strategy","aria-haspopup":"menu",onClick:T,children:t.jsx(Os,{})})]}),t.jsx(Fo,{sx:{zIndex:10},open:p,anchorEl:v.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:z})=>t.jsx(Ho,{...z,style:{transformOrigin:"center top"},children:t.jsx(It,{children:t.jsx(Go,{onClickAway:D,children:t.jsxs(Jo,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[q==null?void 0:q.map(B=>{var S;return t.jsxs(ue,{selected:B.id===(o==null?void 0:o.id),sx:{height:56},onClick:()=>_(B),children:[t.jsxs(u,{children:[t.jsx(pe,{sx:{fontSize:"16px"},maxLength:24,children:B.name}),t.jsx(pe,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:B.url})]}),Ps({store:B,userDid:(S=c==null?void 0:c.user)==null?void 0:S.did})&&t.jsx(oe,{sx:{ml:1},onClick:P=>{P.preventDefault(),P.stopPropagation(),C(B)},children:t.jsx(ne,{icon:"ic:outline-delete"})})]},B.url)}),t.jsx(es,{}),t.jsxs(ue,{onClick:$,children:[t.jsx(_t,{font:!0}),t.jsx(O,{variant:"inherit",children:a("store.blockletRegistry.addRegistry")})]})]})})})})}),I&&t.jsx(ln,{hiddenChildren:!0,open:!0,onClose:R,teamDid:M,storeList:q,scope:"studio",onAdd:(L=x==null?void 0:x.actions)==null?void 0:L.refreshBlocklet}),b&&t.jsx(Pt,{displayError:!0,title:`${a("common.delete")} ${b.name}`,description:a("blocklet.publish.deleteStoreTip",{name:b.name}),confirm:a("common.confirm"),onConfirm:A,onCancel:()=>C(null)})]})}Qt.propTypes={store:d.object,blocklet:d.object,onChangeStore:d.func.isRequired,onClick:d.func.isRequired,loading:d.bool.isRequired,disabled:d.bool.isRequired,componentDid:d.string.isRequired,projectType:d.string.isRequired,getData:d.func.isRequired};Qt.defaultProps={store:null,blocklet:null};var fe=w;const Ee=/^[a-z0-9]+(-[a-z0-9]+)*$/,it=(e,o,n,r="")=>{const s=e.split(":");if(e.slice(0,1)==="@"){if(s.length<2||s.length>3)return null;r=s.shift().slice(1)}if(s.length>3||!s.length)return null;if(s.length>1){const a=s.pop(),c=s.pop(),f={provider:s.length>0?s[0]:r,prefix:c,name:a};return o&&!Qe(f)?null:f}const i=s[0],l=i.split("-");if(l.length>1){const a={provider:r,prefix:l.shift(),name:l.join("-")};return o&&!Qe(a)?null:a}if(n&&r===""){const a={provider:r,prefix:"",name:i};return o&&!Qe(a,n)?null:a}return null},Qe=(e,o)=>e?!!((e.provider===""||e.provider.match(Ee))&&(o&&e.prefix===""||e.prefix.match(Ee))&&e.name.match(Ee)):!1,jn=Object.freeze({left:0,top:0,width:16,height:16}),tt=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Yt=Object.freeze({...jn,...tt}),kt=Object.freeze({...Yt,body:"",hidden:!1});function vr(e,o){const n={};!e.hFlip!=!o.hFlip&&(n.hFlip=!0),!e.vFlip!=!o.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(o.rotate||0))%4;return r&&(n.rotate=r),n}function Co(e,o){const n=vr(e,o);for(const r in kt)r in tt?r in e&&!(r in n)&&(n[r]=tt[r]):r in o?n[r]=o[r]:r in e&&(n[r]=e[r]);return n}function wr(e,o){const n=e.icons,r=e.aliases||Object.create(null),s=Object.create(null);function i(l){if(n[l])return s[l]=[];if(!(l in s)){s[l]=null;const a=r[l]&&r[l].parent,c=a&&i(a);c&&(s[l]=[a].concat(c))}return s[l]}return Object.keys(n).concat(Object.keys(r)).forEach(i),s}function Cr(e,o,n){const r=e.icons,s=e.aliases||Object.create(null);let i={};function l(a){i=Co(r[a]||s[a],i)}return l(o),n.forEach(l),Co(e,i)}function yn(e,o){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(s=>{o(s,null),n.push(s)});const r=wr(e);for(const s in r){const i=r[s];i&&(o(s,Cr(e,s,i)),n.push(s))}return n}const Rr={provider:"",aliases:{},not_found:{},...jn};function mt(e,o){for(const n in o)if(n in e&&typeof e[n]!=typeof o[n])return!1;return!0}function vn(e){if(typeof e!="object"||e===null)return null;const o=e;if(typeof o.prefix!="string"||!e.icons||typeof e.icons!="object"||!mt(e,Rr))return null;const n=o.icons;for(const s in n){const i=n[s];if(!s.match(Ee)||typeof i.body!="string"||!mt(i,kt))return null}const r=o.aliases||Object.create(null);for(const s in r){const i=r[s],l=i.parent;if(!s.match(Ee)||typeof l!="string"||!n[l]&&!r[l]||!mt(i,kt))return null}return o}const Ro=Object.create(null);function Sr(e,o){return{provider:e,prefix:o,icons:Object.create(null),missing:new Set}}function ve(e,o){const n=Ro[e]||(Ro[e]=Object.create(null));return n[o]||(n[o]=Sr(e,o))}function Zt(e,o){return vn(o)?yn(o,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function Ir(e,o,n){try{if(typeof n.body=="string")return e.icons[o]={...n},!0}catch{}return!1}let Oe=!1;function wn(e){return typeof e=="boolean"&&(Oe=e),Oe}function Dr(e){const o=typeof e=="string"?it(e,!0,Oe):e;if(o){const n=ve(o.provider,o.prefix),r=o.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function Tr(e,o){const n=it(e,!0,Oe);if(!n)return!1;const r=ve(n.provider,n.prefix);return Ir(r,n.name,o)}function _r(e,o){if(typeof e!="object")return!1;if(typeof o!="string"&&(o=e.provider||""),Oe&&!o&&!e.prefix){let s=!1;return vn(e)&&(e.prefix="",yn(e,(i,l)=>{l&&Tr(i,l)&&(s=!0)})),s}const n=e.prefix;if(!Qe({provider:o,prefix:n,name:"a"}))return!1;const r=ve(o,n);return!!Zt(r,e)}const Cn=Object.freeze({width:null,height:null}),Rn=Object.freeze({...Cn,...tt}),Pr=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Lr=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function So(e,o,n){if(o===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*o*n)/n;if(typeof e!="string")return e;const r=e.split(Pr);if(r===null||!r.length)return e;const s=[];let i=r.shift(),l=Lr.test(i);for(;;){if(l){const a=parseFloat(i);isNaN(a)?s.push(i):s.push(Math.ceil(a*o*n)/n)}else s.push(i);if(i=r.shift(),i===void 0)return s.join("");l=!l}}const qr=e=>e==="unset"||e==="undefined"||e==="none";function $r(e,o){const n={...Yt,...e},r={...Rn,...o},s={left:n.left,top:n.top,width:n.width,height:n.height};let i=n.body;[n,r].forEach(j=>{const v=[],I=j.hFlip,g=j.vFlip;let b=j.rotate;I?g?b+=2:(v.push("translate("+(s.width+s.left).toString()+" "+(0-s.top).toString()+")"),v.push("scale(-1 1)"),s.top=s.left=0):g&&(v.push("translate("+(0-s.left).toString()+" "+(s.height+s.top).toString()+")"),v.push("scale(1 -1)"),s.top=s.left=0);let C;switch(b<0&&(b-=Math.floor(b/4)*4),b=b%4,b){case 1:C=s.height/2+s.top,v.unshift("rotate(90 "+C.toString()+" "+C.toString()+")");break;case 2:v.unshift("rotate(180 "+(s.width/2+s.left).toString()+" "+(s.height/2+s.top).toString()+")");break;case 3:C=s.width/2+s.left,v.unshift("rotate(-90 "+C.toString()+" "+C.toString()+")");break}b%2===1&&(s.left!==s.top&&(C=s.left,s.left=s.top,s.top=C),s.width!==s.height&&(C=s.width,s.width=s.height,s.height=C)),v.length&&(i='<g transform="'+v.join(" ")+'">'+i+"</g>")});const l=r.width,a=r.height,c=s.width,f=s.height;let h,k;l===null?(k=a===null?"1em":a==="auto"?f:a,h=So(k,c/f)):(h=l==="auto"?c:l,k=a===null?So(h,f/c):a==="auto"?f:a);const x={},p=(j,v)=>{qr(v)||(x[j]=v.toString())};return p("width",h),p("height",k),x.viewBox=s.left.toString()+" "+s.top.toString()+" "+c.toString()+" "+f.toString(),{attributes:x,body:i}}const Nr=/\sid="(\S+)"/g,Ar="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let Er=0;function Mr(e,o=Ar){const n=[];let r;for(;r=Nr.exec(e);)n.push(r[1]);if(!n.length)return e;const s="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(i=>{const l=typeof o=="function"?o(i):o+(Er++).toString(),a=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+l+s+"$3")}),e=e.replace(new RegExp(s,"g"),""),e}const jt=Object.create(null);function Or(e,o){jt[e]=o}function yt(e){return jt[e]||jt[""]}function Kt(e){let o;if(typeof e.resources=="string")o=[e.resources];else if(o=e.resources,!(o instanceof Array)||!o.length)return null;return{resources:o,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const eo=Object.create(null),Ne=["https://api.simplesvg.com","https://api.unisvg.com"],Ye=[];for(;Ne.length>0;)Ne.length===1||Math.random()>.5?Ye.push(Ne.shift()):Ye.push(Ne.pop());eo[""]=Kt({resources:["https://api.iconify.design"].concat(Ye)});function zr(e,o){const n=Kt(o);return n===null?!1:(eo[e]=n,!0)}function to(e){return eo[e]}const Br=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let Io=Br();function Vr(e,o){const n=to(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let s=0;n.resources.forEach(l=>{s=Math.max(s,l.length)});const i=o+".json?icons=";r=n.maxURL-s-n.path.length-i.length}return r}function Wr(e){return e===404}const Ur=(e,o,n)=>{const r=[],s=Vr(e,o),i="icons";let l={type:i,provider:e,prefix:o,icons:[]},a=0;return n.forEach((c,f)=>{a+=c.length+1,a>=s&&f>0&&(r.push(l),l={type:i,provider:e,prefix:o,icons:[]},a=c.length),l.icons.push(c)}),r.push(l),r};function Fr(e){if(typeof e=="string"){const o=to(e);if(o)return o.path}return"/"}const Hr=(e,o,n)=>{if(!Io){n("abort",424);return}let r=Fr(o.provider);switch(o.type){case"icons":{const i=o.prefix,a=o.icons.join(","),c=new URLSearchParams({icons:a});r+=i+".json?"+c.toString();break}case"custom":{const i=o.uri;r+=i.slice(0,1)==="/"?i.slice(1):i;break}default:n("abort",400);return}let s=503;Io(e+r).then(i=>{const l=i.status;if(l!==200){setTimeout(()=>{n(Wr(l)?"abort":"next",l)});return}return s=501,i.json()}).then(i=>{if(typeof i!="object"||i===null){setTimeout(()=>{i===404?n("abort",i):n("next",s)});return}setTimeout(()=>{n("success",i)})}).catch(()=>{n("next",s)})},Gr={prepare:Ur,send:Hr};function Jr(e){const o={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((s,i)=>s.provider!==i.provider?s.provider.localeCompare(i.provider):s.prefix!==i.prefix?s.prefix.localeCompare(i.prefix):s.name.localeCompare(i.name));let r={provider:"",prefix:"",name:""};return e.forEach(s=>{if(r.name===s.name&&r.prefix===s.prefix&&r.provider===s.provider)return;r=s;const i=s.provider,l=s.prefix,a=s.name,c=n[i]||(n[i]=Object.create(null)),f=c[l]||(c[l]=ve(i,l));let h;a in f.icons?h=o.loaded:l===""||f.missing.has(a)?h=o.missing:h=o.pending;const k={provider:i,prefix:l,name:a};h.push(k)}),o}function Sn(e,o){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(s=>s.id!==o))})}function Xr(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const o=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!o.length)return;let n=!1;const r=e.provider,s=e.prefix;o.forEach(i=>{const l=i.icons,a=l.pending.length;l.pending=l.pending.filter(c=>{if(c.prefix!==s)return!0;const f=c.name;if(e.icons[f])l.loaded.push({provider:r,prefix:s,name:f});else if(e.missing.has(f))l.missing.push({provider:r,prefix:s,name:f});else return n=!0,!0;return!1}),l.pending.length!==a&&(n||Sn([e],i.id),i.callback(l.loaded.slice(0),l.missing.slice(0),l.pending.slice(0),i.abort))})}))}let Qr=0;function Yr(e,o,n){const r=Qr++,s=Sn.bind(null,n,r);if(!o.pending.length)return s;const i={id:r,icons:o,callback:e,abort:s};return n.forEach(l=>{(l.loaderCallbacks||(l.loaderCallbacks=[])).push(i)}),s}function Zr(e,o=!0,n=!1){const r=[];return e.forEach(s=>{const i=typeof s=="string"?it(s,o,n):s;i&&r.push(i)}),r}var Kr={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function el(e,o,n,r){const s=e.resources.length,i=e.random?Math.floor(Math.random()*s):e.index;let l;if(e.random){let D=e.resources.slice(0);for(l=[];D.length>1;){const $=Math.floor(Math.random()*D.length);l.push(D[$]),D=D.slice(0,$).concat(D.slice($+1))}l=l.concat(D)}else l=e.resources.slice(i).concat(e.resources.slice(0,i));const a=Date.now();let c="pending",f=0,h,k=null,x=[],p=[];typeof r=="function"&&p.push(r);function j(){k&&(clearTimeout(k),k=null)}function v(){c==="pending"&&(c="aborted"),j(),x.forEach(D=>{D.status==="pending"&&(D.status="aborted")}),x=[]}function I(D,$){$&&(p=[]),typeof D=="function"&&p.push(D)}function g(){return{startTime:a,payload:o,status:c,queriesSent:f,queriesPending:x.length,subscribe:I,abort:v}}function b(){c="failed",p.forEach(D=>{D(void 0,h)})}function C(){x.forEach(D=>{D.status==="pending"&&(D.status="aborted")}),x=[]}function _(D,$,R){const A=$!=="success";switch(x=x.filter(q=>q!==D),c){case"pending":break;case"failed":if(A||!e.dataAfterTimeout)return;break;default:return}if($==="abort"){h=R,b();return}if(A){h=R,x.length||(l.length?T():b());return}if(j(),C(),!e.random){const q=e.resources.indexOf(D.resource);q!==-1&&q!==e.index&&(e.index=q)}c="completed",p.forEach(q=>{q(R)})}function T(){if(c!=="pending")return;j();const D=l.shift();if(D===void 0){if(x.length){k=setTimeout(()=>{j(),c==="pending"&&(C(),b())},e.timeout);return}b();return}const $={status:"pending",resource:D,callback:(R,A)=>{_($,R,A)}};x.push($),f++,k=setTimeout(T,e.rotate),n(D,o,$.callback)}return setTimeout(T),g}function In(e){const o={...Kr,...e};let n=[];function r(){n=n.filter(a=>a().status==="pending")}function s(a,c,f){const h=el(o,a,c,(k,x)=>{r(),f&&f(k,x)});return n.push(h),h}function i(a){return n.find(c=>a(c))||null}return{query:s,find:i,setIndex:a=>{o.index=a},getIndex:()=>o.index,cleanup:r}}function Do(){}const bt=Object.create(null);function tl(e){if(!bt[e]){const o=to(e);if(!o)return;const n=In(o),r={config:o,redundancy:n};bt[e]=r}return bt[e]}function ol(e,o,n){let r,s;if(typeof e=="string"){const i=yt(e);if(!i)return n(void 0,424),Do;s=i.send;const l=tl(e);l&&(r=l.redundancy)}else{const i=Kt(e);if(i){r=In(i);const l=e.resources?e.resources[0]:"",a=yt(l);a&&(s=a.send)}}return!r||!s?(n(void 0,424),Do):r.query(o,s,n)().abort}const To="iconify2",ze="iconify",Dn=ze+"-count",_o=ze+"-version",Tn=36e5,nl=168;function vt(e,o){try{return e.getItem(o)}catch{}}function oo(e,o,n){try{return e.setItem(o,n),!0}catch{}}function Po(e,o){try{e.removeItem(o)}catch{}}function wt(e,o){return oo(e,Dn,o.toString())}function Ct(e){return parseInt(vt(e,Dn))||0}const ct={local:!0,session:!0},_n={local:new Set,session:new Set};let no=!1;function sl(e){no=e}let Ge=typeof window>"u"?{}:window;function Pn(e){const o=e+"Storage";try{if(Ge&&Ge[o]&&typeof Ge[o].length=="number")return Ge[o]}catch{}ct[e]=!1}function Ln(e,o){const n=Pn(e);if(!n)return;const r=vt(n,_o);if(r!==To){if(r){const a=Ct(n);for(let c=0;c<a;c++)Po(n,ze+c.toString())}oo(n,_o,To),wt(n,0);return}const s=Math.floor(Date.now()/Tn)-nl,i=a=>{const c=ze+a.toString(),f=vt(n,c);if(typeof f=="string"){try{const h=JSON.parse(f);if(typeof h=="object"&&typeof h.cached=="number"&&h.cached>s&&typeof h.provider=="string"&&typeof h.data=="object"&&typeof h.data.prefix=="string"&&o(h,a))return!0}catch{}Po(n,c)}};let l=Ct(n);for(let a=l-1;a>=0;a--)i(a)||(a===l-1?(l--,wt(n,l)):_n[e].add(a))}function qn(){if(!no){sl(!0);for(const e in ct)Ln(e,o=>{const n=o.data,r=o.provider,s=n.prefix,i=ve(r,s);if(!Zt(i,n).length)return!1;const l=n.lastModified||-1;return i.lastModifiedCached=i.lastModifiedCached?Math.min(i.lastModifiedCached,l):l,!0})}}function rl(e,o){const n=e.lastModifiedCached;if(n&&n>=o)return n===o;if(e.lastModifiedCached=o,n)for(const r in ct)Ln(r,s=>{const i=s.data;return s.provider!==e.provider||i.prefix!==e.prefix||i.lastModified===o});return!0}function ll(e,o){no||qn();function n(r){let s;if(!ct[r]||!(s=Pn(r)))return;const i=_n[r];let l;if(i.size)i.delete(l=Array.from(i).shift());else if(l=Ct(s),!wt(s,l+1))return;const a={cached:Math.floor(Date.now()/Tn),provider:e.provider,data:o};return oo(s,ze+l.toString(),JSON.stringify(a))}o.lastModified&&!rl(e,o.lastModified)||Object.keys(o.icons).length&&(o.not_found&&(o=Object.assign({},o),delete o.not_found),n("local")||n("session"))}function Lo(){}function il(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Xr(e)}))}function cl(e,o){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(o).sort():e.iconsToLoad=o,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:r}=e,s=e.iconsToLoad;delete e.iconsToLoad;let i;if(!s||!(i=yt(n)))return;i.prepare(n,r,s).forEach(a=>{ol(n,a,c=>{if(typeof c!="object")a.icons.forEach(f=>{e.missing.add(f)});else try{const f=Zt(e,c);if(!f.length)return;const h=e.pendingIcons;h&&f.forEach(k=>{h.delete(k)}),ll(e,c)}catch(f){console.error(f)}il(e)})})}))}const al=(e,o)=>{const n=Zr(e,!0,wn()),r=Jr(n);if(!r.pending.length){let c=!0;return o&&setTimeout(()=>{c&&o(r.loaded,r.missing,r.pending,Lo)}),()=>{c=!1}}const s=Object.create(null),i=[];let l,a;return r.pending.forEach(c=>{const{provider:f,prefix:h}=c;if(h===a&&f===l)return;l=f,a=h,i.push(ve(f,h));const k=s[f]||(s[f]=Object.create(null));k[h]||(k[h]=[])}),r.pending.forEach(c=>{const{provider:f,prefix:h,name:k}=c,x=ve(f,h),p=x.pendingIcons||(x.pendingIcons=new Set);p.has(k)||(p.add(k),s[f][h].push(k))}),i.forEach(c=>{const{provider:f,prefix:h}=c;s[f][h].length&&cl(c,s[f][h])}),o?Yr(o,r,i):Lo};function dl(e,o){const n={...e};for(const r in o){const s=o[r],i=typeof s;r in Cn?(s===null||s&&(i==="string"||i==="number"))&&(n[r]=s):i===typeof n[r]&&(n[r]=r==="rotate"?s%4:s)}return n}const ul=/[\s,]+/;function pl(e,o){o.split(ul).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function fl(e,o=0){const n=e.replace(/^-?[0-9.]*/,"");function r(s){for(;s<0;)s+=4;return s%4}if(n===""){const s=parseInt(e);return isNaN(s)?0:r(s)}else if(n!==e){let s=0;switch(n){case"%":s=25;break;case"deg":s=90}if(s){let i=parseFloat(e.slice(0,e.length-n.length));return isNaN(i)?0:(i=i/s,i%1===0?r(i):0)}}return o}function hl(e,o){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in o)n+=" "+r+'="'+o[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}function ml(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function bl(e){return"data:image/svg+xml,"+ml(e)}function xl(e){return'url("'+bl(e)+'")'}let Me;function gl(){try{Me=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{Me=null}}function kl(e){return Me===void 0&&gl(),Me?Me.createHTML(e):e}const $n={...Rn,inline:!1},jl={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},yl={display:"inline-block"},Rt={backgroundColor:"currentColor"},Nn={backgroundColor:"transparent"},qo={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},$o={WebkitMask:Rt,mask:Rt,background:Nn};for(const e in $o){const o=$o[e];for(const n in qo)o[e+n]=qo[n]}const vl={...$n,inline:!0};function No(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const wl=(e,o,n,r)=>{const s=n?vl:$n,i=dl(s,o),l=o.mode||"svg",a={},c=o.style||{},f={...l==="svg"?jl:{},ref:r};for(let g in o){const b=o[g];if(b!==void 0)switch(g){case"icon":case"style":case"children":case"onLoad":case"mode":case"_ref":case"_inline":break;case"inline":case"hFlip":case"vFlip":i[g]=b===!0||b==="true"||b===1;break;case"flip":typeof b=="string"&&pl(i,b);break;case"color":a.color=b;break;case"rotate":typeof b=="string"?i[g]=fl(b):typeof b=="number"&&(i[g]=b);break;case"ariaHidden":case"aria-hidden":b!==!0&&b!=="true"&&delete f["aria-hidden"];break;default:s[g]===void 0&&(f[g]=b)}}const h=$r(e,i),k=h.attributes;if(i.inline&&(a.verticalAlign="-0.125em"),l==="svg"){f.style={...a,...c},Object.assign(f,k);let g=0,b=o.id;return typeof b=="string"&&(b=b.replace(/-/g,"_")),f.dangerouslySetInnerHTML={__html:kl(Mr(h.body,b?()=>b+"ID"+g++:"iconifyReact"))},fe.createElement("svg",f)}const{body:x,width:p,height:j}=e,v=l==="mask"||(l==="bg"?!1:x.indexOf("currentColor")!==-1),I=hl(x,{...k,width:p+"",height:j+""});return f.style={...a,"--svg":xl(I),width:No(k.width),height:No(k.height),...yl,...v?Rt:Nn,...c},fe.createElement("span",f)};wn(!0);Or("",Gr);if(typeof document<"u"&&typeof window<"u"){qn();const e=window;if(e.IconifyPreload!==void 0){const o=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof o=="object"&&o!==null&&(o instanceof Array?o:[o]).forEach(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!_r(r))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const o=e.IconifyProviders;if(typeof o=="object"&&o!==null)for(let n in o){const r="IconifyProviders["+n+"] is invalid.";try{const s=o[n];if(typeof s!="object"||!s||s.resources===void 0)continue;zr(n,s)||console.error(r)}catch{console.error(r)}}}}class An extends fe.Component{constructor(o){super(o),this.state={icon:null}}_abortLoading(){this._loading&&(this._loading.abort(),this._loading=null)}_setData(o){this.state.icon!==o&&this.setState({icon:o})}_checkIcon(o){const n=this.state,r=this.props.icon;if(typeof r=="object"&&r!==null&&typeof r.body=="string"){this._icon="",this._abortLoading(),(o||n.icon===null)&&this._setData({data:r});return}let s;if(typeof r!="string"||(s=it(r,!1,!0))===null){this._abortLoading(),this._setData(null);return}const i=Dr(s);if(!i){(!this._loading||this._loading.name!==r)&&(this._abortLoading(),this._icon="",this._setData(null),i!==null&&(this._loading={name:r,abort:al([s],this._checkIcon.bind(this,!1))}));return}if(this._icon!==r||n.icon===null){this._abortLoading(),this._icon=r;const l=["iconify"];s.prefix!==""&&l.push("iconify--"+s.prefix),s.provider!==""&&l.push("iconify--"+s.provider),this._setData({data:i,classes:l}),this.props.onLoad&&this.props.onLoad(r)}}componentDidMount(){this._checkIcon(!1)}componentDidUpdate(o){o.icon!==this.props.icon&&this._checkIcon(!0)}componentWillUnmount(){this._abortLoading()}render(){const o=this.props,n=this.state.icon;if(n===null)return o.children?o.children:fe.createElement("span",{});let r=o;return n.classes&&(r={...o,className:(typeof o.className=="string"?o.className+" ":"")+n.classes.join(" ")}),wl({...Yt,...n.data},r,o._inline,o._ref)}}const Cl=fe.forwardRef(function(o,n){const r={...o,_ref:n,_inline:!1};return fe.createElement(An,r)});fe.forwardRef(function(o,n){const r={...o,_ref:n,_inline:!0};return fe.createElement(An,r)});var Rl=Cl;const Sl=e=>{const o=e.includes("youtube.com")||e.includes("youtu.be"),n=e.includes("vimeo.com");return o||n};function at({url:e,style:o,controls:n,modestbranding:r}){var a;const{t:s}=Q(),i=e.includes("youtube.com")||e.includes("youtu.be"),l=e.includes("vimeo.com");if(i){const c=((a=e.split("v=")[1])==null?void 0:a.split("&")[0])||e.split("/").pop();return t.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:(o==null?void 0:o.pointerEvents)||"auto"},children:t.jsx("iframe",{src:`https://www.youtube.com/embed/${c}?modestbranding=${r}&controls=${n}&rel=0`,title:"YouTube video player",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",...o},allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})})}if(l){const c=e.split("/").pop();return t.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:o.pointerEvents||"auto"},children:t.jsx("iframe",{src:`https://player.vimeo.com/video/${c}`,title:"Vimeo video player",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",...o},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0})})}return t.jsx(u,{style:{position:"relative",width:"100%",paddingTop:"56.25%"},children:t.jsxs(u,{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",backgroundColor:"rgba(0, 0, 0, 0.04)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",...o},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,children:[t.jsx(Rl,{icon:"carbon:video-off",style:{fontSize:40,marginBottom:"10px",opacity:.5}}),t.jsx(O,{variant:"body1",sx:{opacity:.5},children:s("studio.videoDialogNoSrc")})]})})}at.propTypes={url:d.string.isRequired,style:d.object,controls:d.number,modestbranding:d.number};at.defaultProps={style:{},controls:1,modestbranding:1};function En({setParams:e,onClose:o,params:n}){const{t:r}=Q(),[s,i]=w.useState(""),l=s&&n.blockletVideos.includes(s),a=Sl(s),c=()=>{e(f=>{const h=[...f.blockletVideos];return h.push(s),{...f,blockletVideos:h}}),o()};return t.jsxs(rt,{open:!0,fullWidth:!0,maxWidth:"sm",children:[t.jsx(Xo,{children:r("studio.videoDialogTitle")}),t.jsxs(Qo,{children:[t.jsx(ts,{fullWidth:!0,value:s,onChange:f=>i(f.target.value),placeholder:r("studio.videoInputLabel"),endAdornment:s?t.jsx(Ve,{position:"end",children:t.jsx(oe,{onClick:()=>i(""),children:t.jsx(js,{})})}):null,error:l}),l&&t.jsx(O,{variant:"body2",color:"error",children:r("studio.duplicateVideo")}),t.jsx(at,{url:s,style:{marginTop:"20px",borderRadius:"4px"}})]}),t.jsxs(Yo,{children:[t.jsx(Z,{onClick:()=>o(),children:r("studio.cancel")}),t.jsx(Z,{disabled:!a||l,onClick:c,children:r("studio.confirm")})]})]})}En.propTypes={onClose:d.func.isRequired,params:d.object.isRequired,setParams:d.func.isRequired};const Ao=w.lazy(()=>en(()=>import("./index-a-qtpRvq.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])).then(e=>({default:e.Uploader})));function Mn({projectId:e,readOnly:o,loading:n,blocklet:r,params:s,setParams:i,paramsErrTip:l,setParamsErrTip:a,setLoading:c,initUrl:f,initLogoUrl:h,setInitLogoUrl:k,componentDid:x}){const{t:p,locale:j}=Q(),{api:v}=me(),I=St(),g=w.useRef(null),b=w.useRef(null),[C,_]=gr(r),[T,D]=w.useState(!1),$=Ls({messageType:"connect-store-message",onOpen:()=>c(!0),onClose:()=>c(!1)}),R=async S=>{const P=setTimeout(()=>{c(!1)},2e4),W=await jr(v,S);c(!1),clearTimeout(P),window.parent.postMessage({event:"studioDialog.connected",componentDid:x},"*"),I(window.location.pathname.replace(`${J.UNOWNED_DID}/create`,`${W}/create`),{replace:!0})},A=()=>{if(!s.blockletTitle){U.error(p("blocklet.publish.errorTip.noTitle"));return}if(!(C!=null&&C.url)){U.error(p("blocklet.publish.noStoreSelected"));return}const S=kr();$(async(P,W)=>{var F,G,ee;try{const X=await v.connectByStudio({input:{did:(F=r==null?void 0:r.meta)==null?void 0:F.did,blockletTitle:s==null?void 0:s.blockletTitle,storeUrl:C.url,storeId:C.id,storeName:C.name,type:((G=s==null?void 0:s.blockletComponents)==null?void 0:G.length)>0?"pack":"resource",componentDid:x,messageId:S,tenantScope:(f==null?void 0:f.searchParams.get("tenantScope"))||""}});if(!(X!=null&&X.url)){U.error("failed to connect to store");return}W(X.url),R({did:(ee=r==null?void 0:r.meta)==null?void 0:ee.did,projectId:"",messageId:S})}catch(X){const se=De(X);U.error(se),c(!1)}})},q=`${J.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${r.meta.did}/${e}/logo/upload`,M=`${J.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${r.meta.did}/${e}/screenshot/upload`,m=s!=null&&s.blockletLogo?`${q}/${s.blockletLogo}`:`${J.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,y=((s==null?void 0:s.blockletScreenshots)||[]).filter(Boolean).map(S=>`${M}/${S}`),L=()=>o?!1:!e||e===J.UNOWNED_DID?(U.error(p("blocklet.publish.errorTip.noFirstDid")),!1):!0,z=S=>{if(!S.destination)return;const P=Array.from(s.blockletScreenshots),[W]=P.splice(S.source.index,1);P.splice(S.destination.index,0,W),i(F=>({...F,blockletScreenshots:P}))},B=S=>{if(!S.destination)return;const P=Array.from(s.blockletVideos),[W]=P.splice(S.source.index,1);P.splice(S.destination.index,0,W),i(F=>({...F,blockletVideos:P}))};return t.jsxs(Il,{children:[t.jsx(u,{display:"flex",className:"section",children:t.jsxs(u,{sx:{flex:1},children:[t.jsx(Y,{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:s.blockletTitle||"",onChange:S=>{a({blockletTitle:""}),i({blockletTitle:S.target.value})},error:!!l.blockletTitle,helperText:l.blockletTitle||""}),t.jsx(Y,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"export-blocklet-did",endAdornment:e===J.UNOWNED_DID&&t.jsx(Ve,{position:"end",children:t.jsx(Qt,{blocklet:r,store:C,componentDid:x,onChangeStore:_,disabled:!s.blockletTitle||o||n,loading:n,onClick:A})})},error:!!l.projectId,helperText:l.projectId||"",value:e===J.UNOWNED_DID?"":`did:abt:${e}`,sx:{mt:3}}),t.jsx(Y,{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:s.blockletDescription||"",onChange:S=>{a({blockletDescription:""}),i({blockletDescription:S.target.value})},error:!!l.blockletDescription,helperText:l.blockletDescription||"",sx:{mt:3}}),t.jsx(Y,{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:s.blockletHomepage||"",onChange:S=>{S.target.value&&!/^(http|https):\/\//.test(S.target.value)?a({blockletHomepage:p("blocklet.publish.errorTip.invalidUrl")}):a({blockletHomepage:""}),i({blockletHomepage:S.target.value})},error:!!l.blockletHomepage,helperText:l.blockletHomepage||"",sx:{mt:3}}),t.jsx(Y,{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:s.blockletCommunity||"",onChange:S=>{S.target.value&&!/^(http|https):\/\//.test(S.target.value)?a({blockletCommunity:p("blocklet.publish.errorTip.invalidUrl")}):a({blockletCommunity:""}),i({blockletCommunity:S.target.value})},error:!!l.blockletCommunity,helperText:l.blockletCommunity||"",sx:{mt:3}}),t.jsx(Y,{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:s.blockletSupport||"",onChange:S=>{S.target.value&&!/^(http|https):\/\//.test(S.target.value)&&!/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(S.target.value)?a({blockletSupport:p("blocklet.publish.errorTip.invalidUrlOrEmail")}):a({blockletSupport:""}),i({blockletSupport:S.target.value})},error:!!l.blockletSupport,helperText:l.blockletSupport||"",sx:{mt:3}}),t.jsx(Y,{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:s.blockletRepository||"",onChange:S=>{S.target.value&&!/^(git|https|svn)/.test(S.target.value)?a({blockletRepository:p("blocklet.publish.errorTip.invalidUrl")}):a({blockletRepository:""}),i({blockletRepository:S.target.value})},error:!!l.blockletRepository,helperText:l.blockletRepository||"",sx:{mt:3}})]})}),t.jsx(u,{display:"flex",mt:3,className:"section full-width",children:t.jsxs(u,{sx:{flex:1},children:[t.jsxs(u,{display:"flex",flexDirection:"row",flexWrap:"wrap",children:[t.jsxs(je,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[t.jsx(O,{variant:"subtitle1",sx:{fontWeight:"bold"},children:p("common.logo")}),t.jsxs(je,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[t.jsx(u,{children:t.jsxs(u,{component:"span",children:[t.jsxs(u,{component:"span",sx:{color:"#555"},children:[p("studio.type"),":"," "]}),t.jsx(u,{component:"span",sx:{color:"#007ec6"},children:"png, jpg, webp, svg"})]})}),t.jsx(u,{children:t.jsxs(u,{component:"span",children:[t.jsxs(u,{component:"span",sx:{color:"#555"},children:[p("studio.ratio"),":"," "]}),t.jsx(u,{component:"span",sx:{color:"#007ec6"},children:"256x256"})]})}),t.jsx(u,{children:t.jsxs(u,{component:"span",children:[t.jsxs(u,{component:"span",sx:{color:"#555"},children:[p("studio.size"),":"," "]}),t.jsx(u,{component:"span",sx:{color:"#007ec6"},children:"<500Kb"})]})})]})]}),t.jsx(u,{sx:{flex:1,cursor:o?"default":"pointer",display:"flex",alignItems:"flex-end"},children:t.jsx(Vo,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:h||m,onClick:()=>{var S;L()&&((S=g.current)==null||S.open())}})})]}),t.jsxs(u,{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap",children:[t.jsxs(je,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[t.jsx(O,{variant:"subtitle1",sx:{fontWeight:"bold"},children:p("common.screenshot")}),t.jsxs(je,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[t.jsx(u,{sx:{border:"none"},variant:"outlined",size:"small",children:t.jsxs(u,{component:"span",children:[t.jsxs(u,{component:"span",sx:{color:"#555"},children:[p("studio.ratio"),":"," "]}),t.jsx(u,{component:"span",sx:{color:"#007ec6"},children:"16 / 9"})]})}),t.jsx(u,{children:t.jsxs(u,{component:"span",children:[t.jsxs(u,{component:"span",sx:{color:"#555"},children:[p("studio.count"),":"," "]}),t.jsx(u,{component:"span",sx:{color:"#007ec6"},children:"1~5"})]})}),t.jsx(u,{children:t.jsxs(u,{component:"span",children:[t.jsxs(u,{component:"span",sx:{color:"#555"},children:[p("studio.size"),":"," "]}),t.jsx(u,{component:"span",sx:{color:"#007ec6"},children:"<5MB"})]})}),!o&&t.jsx(u,{children:t.jsxs(u,{component:"span",children:[t.jsxs(u,{component:"span",sx:{color:"#555"},children:[p("studio.order"),":"," "]}),t.jsx(u,{component:"span",sx:{color:"#007ec6"},children:p("studio.orderTip")})]})})]})]}),t.jsx(bo,{onDragEnd:o?void 0:z,children:t.jsx(xo,{droppableId:"screenshots",direction:"horizontal",isDropDisabled:o,children:(S,P)=>t.jsxs(u,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap",minHeight:160,background:P.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:P.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:S.innerRef,...S.droppableProps,children:[y.map((W,F)=>t.jsx(go,{draggableId:W,index:F,isDragDisabled:o,children:(G,ee)=>t.jsxs(u,{ref:G.innerRef,...G.draggableProps,className:"screenshot",sx:{transform:ee.isDragging?"scale(1.05)":"none",boxShadow:ee.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[t.jsx("img",{alt:"screenshot",src:W}),!o&&t.jsx(oe,{...G.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:t.jsx(gt,{})}),!o&&t.jsx(oe,{className:"action",onClick:()=>{i(X=>{const se=[...X.blockletScreenshots];return se.splice(F,1),{...X,blockletScreenshots:se}})},children:t.jsx(ko,{})})]})},W)),S.placeholder,y.length<5&&t.jsx(u,{sx:{width:240,height:135,background:"#eee",cursor:o?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{var W;L()&&((W=b.current)==null||W.open())},children:"+"})]})})})]}),t.jsxs(u,{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap",children:[t.jsxs(je,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[t.jsx(O,{variant:"subtitle1",sx:{fontWeight:"bold"},children:p("studio.video")}),t.jsxs(je,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[t.jsx(u,{children:t.jsxs(u,{component:"span",children:[t.jsxs(u,{component:"span",sx:{color:"#555"},children:[p("studio.videoType"),":"," "]}),t.jsxs(u,{component:"span",sx:{color:"#007ec6"},children:[t.jsx("a",{href:"https://www.youtube.com/",target:"_blank",rel:"noreferrer",children:"Youtube"}),","," ",t.jsx("a",{href:"https://vimeo.com/",target:"_blank",rel:"noreferrer",children:"Vimeo"})]})]})}),t.jsx(u,{children:t.jsxs(u,{component:"span",children:[t.jsxs(u,{component:"span",sx:{color:"#555"},children:[p("studio.count"),":"," "]}),t.jsx(u,{component:"span",sx:{color:"#007ec6"},children:"1~3"})]})}),!o&&t.jsx(u,{children:t.jsxs(u,{component:"span",children:[t.jsxs(u,{component:"span",sx:{color:"#555"},children:[p("studio.order"),":"," "]}),t.jsx(u,{component:"span",sx:{color:"#007ec6"},children:p("studio.orderTip")})]})})]})]}),t.jsx(bo,{onDragEnd:o?void 0:B,children:t.jsx(xo,{droppableId:"videos",direction:"horizontal",isDropDisabled:o,children:(S,P)=>t.jsxs(u,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap",minHeight:160,background:P.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:P.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:S.innerRef,...S.droppableProps,children:[s.blockletVideos.map((W,F)=>t.jsx(go,{draggableId:W,index:F,isDragDisabled:o,children:(G,ee)=>t.jsxs(u,{ref:G.innerRef,...G.draggableProps,className:"screenshot",sx:{transform:ee.isDragging?"scale(1.05)":"none",boxShadow:ee.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[t.jsx(at,{url:W,style:{pointerEvents:ee.isDragging?"none":"auto"}}),!o&&t.jsx(oe,{...G.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:t.jsx(gt,{})}),!o&&t.jsx(oe,{className:"action",onClick:()=>{i(X=>{const se=[...X.blockletVideos];return se.splice(F,1),{...X,blockletVideos:se}})},children:t.jsx(ko,{})})]})},W)),S.placeholder,s.blockletVideos.length<3&&t.jsx(u,{sx:{width:240,height:135,background:"#eee",cursor:o?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{L()&&D(!0)},children:"+"})]})})})]})]})}),t.jsxs(w.Suspense,{fallback:t.jsx(We,{}),children:[t.jsx(Ao,{ref:g,locale:j,popup:!0,onUploadFinish:S=>{var P;i({blockletLogo:S.data.filename}),k(""),(P=g.current)==null||P.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:q,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/png","image/jpeg","image/webp","application/svg+xml"],maxFileSize:1024*1024*.5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{minWidth:256,minHeight:256}}}},"uploader-logo"),T&&t.jsx(En,{onClose:()=>D(!1),params:s,setParams:i}),t.jsx(Ao,{ref:b,popup:!0,onUploadFinish:S=>{var P;i(W=>{var G;const F=W.blockletScreenshots||[];return F.push((G=S.data)==null?void 0:G.filename),{...W,blockletScreenshots:F}}),(P=b.current)==null||P.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:M,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","application/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-y.length}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,autoCropArea:1,aspectRatio:16/9,initialAspectRatio:16/9,croppedCanvasOptions:{minWidth:1280,minHeight:720,maxWidth:1280*2,maxHeight:720*2}}}},"uploader-screenshot")]})]})}Mn.propTypes={projectId:d.string.isRequired,readOnly:d.bool.isRequired,params:d.object.isRequired,setParams:d.func.isRequired,paramsErrTip:d.object.isRequired,setParamsErrTip:d.func.isRequired,loading:d.bool.isRequired,blocklet:d.object.isRequired,setLoading:d.func.isRequired,initUrl:d.object.isRequired,componentDid:d.isRequired,initLogoUrl:d.string.isRequired,setInitLogoUrl:d.func.isRequired};const Il=ae.div`
132
+ `;var Xt={},mr=he;Object.defineProperty(Xt,"__esModule",{value:!0});var gt=Xt.default=void 0,br=mr(be()),xr=t;gt=Xt.default=(0,br.default)((0,xr.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 wo="lastWantToConnectStoreId";function gr(e){var a,c;const[o,n]=w.useState(null),{session:r}=lt(),s=w.useCallback(f=>{n(f),localStorage.setItem(wo,f==null?void 0:f.id)},[n]),i=w.useMemo(()=>{var x,p,j,v;const f=localStorage.getItem(wo),h=f?(((x=e==null?void 0:e.settings)==null?void 0:x.storeList)||[]).find(I=>I.id===f):null;if(h)return h;let k=(((p=e==null?void 0:e.settings)==null?void 0:p.storeList)||[]).find(I=>{var g;return!(I.id!==J.BLOCKLET_STORE.id||I.scope&&I.scope!=="studio"&&I.scope!==((g=r==null?void 0:r.user)==null?void 0:g.did))});return k||(k=(v=(j=e==null?void 0:e.settings)==null?void 0:j.storeList)==null?void 0:v[0]),k},[(a=e==null?void 0:e.settings)==null?void 0:a.storeList,(c=r==null?void 0:r.user)==null?void 0:c.did]);return[o||i||{},s]}const ht={};async function gn(e,{interval:o=1e3,maxDuration:n=120*1e3,intervalFirst:r=4e3,timerKey:s=""}){ht[s]&&clearTimeout(ht[s]),await new Promise(a=>setTimeout(a,r));const i=Date.now(),l=async(a,c)=>{try{const f=await e();a(f)}catch(f){Date.now()-i>n?c(f):s?ht[s]=setTimeout(()=>l(a,c),o):setTimeout(()=>l(a,c),o)}};return new Promise(l)}function kr(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function jr(e,{did:o,projectId:n,messageId:r}){return gn(async()=>{var i;const s=await e.getProject({input:{did:o,projectId:n,messageId:r}});if(!((i=s==null?void 0:s.project)!=null&&i.blockletDid))throw new Error("Connected store not found");return s.project.blockletDid},{timerKey:"connect-studio"})}function yr(e,{did:o,projectId:n,storeId:r}){return gn(async()=>{var l,a;const s=await e.getProject({input:{did:o,projectId:n,messageId:""}});if(!((a=(l=s==null?void 0:s.project)==null?void 0:l.connectedStores)!=null&&a.length))throw new Error("Connected store not found");if(!s.project.connectedStores.find(c=>c.storeId===r))throw new Error("Connected store not found")},{timerKey:`connect-store-${r}`})}const kn=({fromBlocklet:e,nodeInfo:o,blocklet:n,userDid:r})=>{var l,a;const s=e?(l=n==null?void 0:n.meta)==null?void 0:l.did:o==null?void 0:o.did;let i=e?((a=n==null?void 0:n.settings)==null?void 0:a.storeList)||[]:(o==null?void 0:o.blockletRegistryList)||[];return Array.isArray(i)||(i=[]),i=i.filter(c=>c.protected||!c.scope||c.scope==="studio"||c.scope===r),{teamDid:s,storeList:i}};function Qt({blocklet:e,store:o={},onChangeStore:n,onClick:r,disabled:s,loading:i,componentDid:l}){var m,y,L;const{t:a}=Q(),{session:c}=lt(),{api:f,info:h,inService:k}=me(),x=_e(),[p,j]=w.useState(!1),v=w.useRef(null),[I,g]=w.useState(!1),[b,C]=w.useState(null),_=z=>{n(z),j(!1)},T=()=>{j(!p)},D=z=>{v.current&&v.current.contains(z.target)||j(!1)},$=()=>{g(!0)},R=()=>{g(!1)},A=async()=>{var z;if(b)try{await f.deleteBlockletStore({input:{teamDid:e.meta.did,url:b.url,projectId:"",scope:b.scope||"studio"}}),await((z=x==null?void 0:x.actions)==null?void 0:z.refreshBlocklet())}catch(B){U.error(`Remove Blocklet Store Error: ${De(B)}`)}finally{C(null)}},{storeList:q}=kn({fromBlocklet:k,blocklet:e,nodeInfo:h,componentDid:l,userDid:(m=c==null?void 0:c.user)==null?void 0:m.did}),M=(y=e==null?void 0:e.meta)==null?void 0:y.did;return t.jsxs(t.Fragment,{children:[t.jsxs(xt,{disabled:s,ref:v,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[t.jsxs(Z,{onClick:r,children:[i&&t.jsx(Ze,{size:14,sx:{mr:.5}}),`${a("common.connect")} ${o.name||""}`]}),t.jsx(Z,{size:"small","aria-controls":p?"split-button-menu":void 0,"aria-expanded":p?"true":void 0,"aria-label":"select merge strategy","aria-haspopup":"menu",onClick:T,children:t.jsx(Os,{})})]}),t.jsx(Fo,{sx:{zIndex:10},open:p,anchorEl:v.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:z})=>t.jsx(Ho,{...z,style:{transformOrigin:"center top"},children:t.jsx(It,{children:t.jsx(Go,{onClickAway:D,children:t.jsxs(Jo,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[q==null?void 0:q.map(B=>{var S;return t.jsxs(ue,{selected:B.id===(o==null?void 0:o.id),sx:{height:56},onClick:()=>_(B),children:[t.jsxs(u,{children:[t.jsx(pe,{sx:{fontSize:"16px"},maxLength:24,children:B.name}),t.jsx(pe,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:B.url})]}),Ps({store:B,userDid:(S=c==null?void 0:c.user)==null?void 0:S.did})&&t.jsx(oe,{sx:{ml:1},onClick:P=>{P.preventDefault(),P.stopPropagation(),C(B)},children:t.jsx(ne,{icon:"ic:outline-delete"})})]},B.url)}),t.jsx(es,{}),t.jsxs(ue,{onClick:$,children:[t.jsx(_t,{font:!0}),t.jsx(O,{variant:"inherit",children:a("store.blockletRegistry.addRegistry")})]})]})})})})}),I&&t.jsx(ln,{hiddenChildren:!0,open:!0,onClose:R,teamDid:M,storeList:q,scope:"studio",onAdd:(L=x==null?void 0:x.actions)==null?void 0:L.refreshBlocklet}),b&&t.jsx(Pt,{displayError:!0,title:`${a("common.delete")} ${b.name}`,description:a("blocklet.publish.deleteStoreTip",{name:b.name}),confirm:a("common.confirm"),onConfirm:A,onCancel:()=>C(null)})]})}Qt.propTypes={store:d.object,blocklet:d.object,onChangeStore:d.func.isRequired,onClick:d.func.isRequired,loading:d.bool.isRequired,disabled:d.bool.isRequired,componentDid:d.string.isRequired,projectType:d.string.isRequired,getData:d.func.isRequired};Qt.defaultProps={store:null,blocklet:null};var fe=w;const Ee=/^[a-z0-9]+(-[a-z0-9]+)*$/,it=(e,o,n,r="")=>{const s=e.split(":");if(e.slice(0,1)==="@"){if(s.length<2||s.length>3)return null;r=s.shift().slice(1)}if(s.length>3||!s.length)return null;if(s.length>1){const a=s.pop(),c=s.pop(),f={provider:s.length>0?s[0]:r,prefix:c,name:a};return o&&!Qe(f)?null:f}const i=s[0],l=i.split("-");if(l.length>1){const a={provider:r,prefix:l.shift(),name:l.join("-")};return o&&!Qe(a)?null:a}if(n&&r===""){const a={provider:r,prefix:"",name:i};return o&&!Qe(a,n)?null:a}return null},Qe=(e,o)=>e?!!((e.provider===""||e.provider.match(Ee))&&(o&&e.prefix===""||e.prefix.match(Ee))&&e.name.match(Ee)):!1,jn=Object.freeze({left:0,top:0,width:16,height:16}),tt=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Yt=Object.freeze({...jn,...tt}),kt=Object.freeze({...Yt,body:"",hidden:!1});function vr(e,o){const n={};!e.hFlip!=!o.hFlip&&(n.hFlip=!0),!e.vFlip!=!o.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(o.rotate||0))%4;return r&&(n.rotate=r),n}function Co(e,o){const n=vr(e,o);for(const r in kt)r in tt?r in e&&!(r in n)&&(n[r]=tt[r]):r in o?n[r]=o[r]:r in e&&(n[r]=e[r]);return n}function wr(e,o){const n=e.icons,r=e.aliases||Object.create(null),s=Object.create(null);function i(l){if(n[l])return s[l]=[];if(!(l in s)){s[l]=null;const a=r[l]&&r[l].parent,c=a&&i(a);c&&(s[l]=[a].concat(c))}return s[l]}return Object.keys(n).concat(Object.keys(r)).forEach(i),s}function Cr(e,o,n){const r=e.icons,s=e.aliases||Object.create(null);let i={};function l(a){i=Co(r[a]||s[a],i)}return l(o),n.forEach(l),Co(e,i)}function yn(e,o){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(s=>{o(s,null),n.push(s)});const r=wr(e);for(const s in r){const i=r[s];i&&(o(s,Cr(e,s,i)),n.push(s))}return n}const Rr={provider:"",aliases:{},not_found:{},...jn};function mt(e,o){for(const n in o)if(n in e&&typeof e[n]!=typeof o[n])return!1;return!0}function vn(e){if(typeof e!="object"||e===null)return null;const o=e;if(typeof o.prefix!="string"||!e.icons||typeof e.icons!="object"||!mt(e,Rr))return null;const n=o.icons;for(const s in n){const i=n[s];if(!s.match(Ee)||typeof i.body!="string"||!mt(i,kt))return null}const r=o.aliases||Object.create(null);for(const s in r){const i=r[s],l=i.parent;if(!s.match(Ee)||typeof l!="string"||!n[l]&&!r[l]||!mt(i,kt))return null}return o}const Ro=Object.create(null);function Sr(e,o){return{provider:e,prefix:o,icons:Object.create(null),missing:new Set}}function ve(e,o){const n=Ro[e]||(Ro[e]=Object.create(null));return n[o]||(n[o]=Sr(e,o))}function Zt(e,o){return vn(o)?yn(o,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function Ir(e,o,n){try{if(typeof n.body=="string")return e.icons[o]={...n},!0}catch{}return!1}let Oe=!1;function wn(e){return typeof e=="boolean"&&(Oe=e),Oe}function Dr(e){const o=typeof e=="string"?it(e,!0,Oe):e;if(o){const n=ve(o.provider,o.prefix),r=o.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function Tr(e,o){const n=it(e,!0,Oe);if(!n)return!1;const r=ve(n.provider,n.prefix);return Ir(r,n.name,o)}function _r(e,o){if(typeof e!="object")return!1;if(typeof o!="string"&&(o=e.provider||""),Oe&&!o&&!e.prefix){let s=!1;return vn(e)&&(e.prefix="",yn(e,(i,l)=>{l&&Tr(i,l)&&(s=!0)})),s}const n=e.prefix;if(!Qe({provider:o,prefix:n,name:"a"}))return!1;const r=ve(o,n);return!!Zt(r,e)}const Cn=Object.freeze({width:null,height:null}),Rn=Object.freeze({...Cn,...tt}),Pr=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Lr=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function So(e,o,n){if(o===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*o*n)/n;if(typeof e!="string")return e;const r=e.split(Pr);if(r===null||!r.length)return e;const s=[];let i=r.shift(),l=Lr.test(i);for(;;){if(l){const a=parseFloat(i);isNaN(a)?s.push(i):s.push(Math.ceil(a*o*n)/n)}else s.push(i);if(i=r.shift(),i===void 0)return s.join("");l=!l}}const qr=e=>e==="unset"||e==="undefined"||e==="none";function $r(e,o){const n={...Yt,...e},r={...Rn,...o},s={left:n.left,top:n.top,width:n.width,height:n.height};let i=n.body;[n,r].forEach(j=>{const v=[],I=j.hFlip,g=j.vFlip;let b=j.rotate;I?g?b+=2:(v.push("translate("+(s.width+s.left).toString()+" "+(0-s.top).toString()+")"),v.push("scale(-1 1)"),s.top=s.left=0):g&&(v.push("translate("+(0-s.left).toString()+" "+(s.height+s.top).toString()+")"),v.push("scale(1 -1)"),s.top=s.left=0);let C;switch(b<0&&(b-=Math.floor(b/4)*4),b=b%4,b){case 1:C=s.height/2+s.top,v.unshift("rotate(90 "+C.toString()+" "+C.toString()+")");break;case 2:v.unshift("rotate(180 "+(s.width/2+s.left).toString()+" "+(s.height/2+s.top).toString()+")");break;case 3:C=s.width/2+s.left,v.unshift("rotate(-90 "+C.toString()+" "+C.toString()+")");break}b%2===1&&(s.left!==s.top&&(C=s.left,s.left=s.top,s.top=C),s.width!==s.height&&(C=s.width,s.width=s.height,s.height=C)),v.length&&(i='<g transform="'+v.join(" ")+'">'+i+"</g>")});const l=r.width,a=r.height,c=s.width,f=s.height;let h,k;l===null?(k=a===null?"1em":a==="auto"?f:a,h=So(k,c/f)):(h=l==="auto"?c:l,k=a===null?So(h,f/c):a==="auto"?f:a);const x={},p=(j,v)=>{qr(v)||(x[j]=v.toString())};return p("width",h),p("height",k),x.viewBox=s.left.toString()+" "+s.top.toString()+" "+c.toString()+" "+f.toString(),{attributes:x,body:i}}const Nr=/\sid="(\S+)"/g,Ar="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let Er=0;function Mr(e,o=Ar){const n=[];let r;for(;r=Nr.exec(e);)n.push(r[1]);if(!n.length)return e;const s="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(i=>{const l=typeof o=="function"?o(i):o+(Er++).toString(),a=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+l+s+"$3")}),e=e.replace(new RegExp(s,"g"),""),e}const jt=Object.create(null);function Or(e,o){jt[e]=o}function yt(e){return jt[e]||jt[""]}function Kt(e){let o;if(typeof e.resources=="string")o=[e.resources];else if(o=e.resources,!(o instanceof Array)||!o.length)return null;return{resources:o,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const eo=Object.create(null),Ne=["https://api.simplesvg.com","https://api.unisvg.com"],Ye=[];for(;Ne.length>0;)Ne.length===1||Math.random()>.5?Ye.push(Ne.shift()):Ye.push(Ne.pop());eo[""]=Kt({resources:["https://api.iconify.design"].concat(Ye)});function zr(e,o){const n=Kt(o);return n===null?!1:(eo[e]=n,!0)}function to(e){return eo[e]}const Br=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let Io=Br();function Vr(e,o){const n=to(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let s=0;n.resources.forEach(l=>{s=Math.max(s,l.length)});const i=o+".json?icons=";r=n.maxURL-s-n.path.length-i.length}return r}function Wr(e){return e===404}const Ur=(e,o,n)=>{const r=[],s=Vr(e,o),i="icons";let l={type:i,provider:e,prefix:o,icons:[]},a=0;return n.forEach((c,f)=>{a+=c.length+1,a>=s&&f>0&&(r.push(l),l={type:i,provider:e,prefix:o,icons:[]},a=c.length),l.icons.push(c)}),r.push(l),r};function Fr(e){if(typeof e=="string"){const o=to(e);if(o)return o.path}return"/"}const Hr=(e,o,n)=>{if(!Io){n("abort",424);return}let r=Fr(o.provider);switch(o.type){case"icons":{const i=o.prefix,a=o.icons.join(","),c=new URLSearchParams({icons:a});r+=i+".json?"+c.toString();break}case"custom":{const i=o.uri;r+=i.slice(0,1)==="/"?i.slice(1):i;break}default:n("abort",400);return}let s=503;Io(e+r).then(i=>{const l=i.status;if(l!==200){setTimeout(()=>{n(Wr(l)?"abort":"next",l)});return}return s=501,i.json()}).then(i=>{if(typeof i!="object"||i===null){setTimeout(()=>{i===404?n("abort",i):n("next",s)});return}setTimeout(()=>{n("success",i)})}).catch(()=>{n("next",s)})},Gr={prepare:Ur,send:Hr};function Jr(e){const o={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((s,i)=>s.provider!==i.provider?s.provider.localeCompare(i.provider):s.prefix!==i.prefix?s.prefix.localeCompare(i.prefix):s.name.localeCompare(i.name));let r={provider:"",prefix:"",name:""};return e.forEach(s=>{if(r.name===s.name&&r.prefix===s.prefix&&r.provider===s.provider)return;r=s;const i=s.provider,l=s.prefix,a=s.name,c=n[i]||(n[i]=Object.create(null)),f=c[l]||(c[l]=ve(i,l));let h;a in f.icons?h=o.loaded:l===""||f.missing.has(a)?h=o.missing:h=o.pending;const k={provider:i,prefix:l,name:a};h.push(k)}),o}function Sn(e,o){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(s=>s.id!==o))})}function Xr(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const o=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!o.length)return;let n=!1;const r=e.provider,s=e.prefix;o.forEach(i=>{const l=i.icons,a=l.pending.length;l.pending=l.pending.filter(c=>{if(c.prefix!==s)return!0;const f=c.name;if(e.icons[f])l.loaded.push({provider:r,prefix:s,name:f});else if(e.missing.has(f))l.missing.push({provider:r,prefix:s,name:f});else return n=!0,!0;return!1}),l.pending.length!==a&&(n||Sn([e],i.id),i.callback(l.loaded.slice(0),l.missing.slice(0),l.pending.slice(0),i.abort))})}))}let Qr=0;function Yr(e,o,n){const r=Qr++,s=Sn.bind(null,n,r);if(!o.pending.length)return s;const i={id:r,icons:o,callback:e,abort:s};return n.forEach(l=>{(l.loaderCallbacks||(l.loaderCallbacks=[])).push(i)}),s}function Zr(e,o=!0,n=!1){const r=[];return e.forEach(s=>{const i=typeof s=="string"?it(s,o,n):s;i&&r.push(i)}),r}var Kr={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function el(e,o,n,r){const s=e.resources.length,i=e.random?Math.floor(Math.random()*s):e.index;let l;if(e.random){let D=e.resources.slice(0);for(l=[];D.length>1;){const $=Math.floor(Math.random()*D.length);l.push(D[$]),D=D.slice(0,$).concat(D.slice($+1))}l=l.concat(D)}else l=e.resources.slice(i).concat(e.resources.slice(0,i));const a=Date.now();let c="pending",f=0,h,k=null,x=[],p=[];typeof r=="function"&&p.push(r);function j(){k&&(clearTimeout(k),k=null)}function v(){c==="pending"&&(c="aborted"),j(),x.forEach(D=>{D.status==="pending"&&(D.status="aborted")}),x=[]}function I(D,$){$&&(p=[]),typeof D=="function"&&p.push(D)}function g(){return{startTime:a,payload:o,status:c,queriesSent:f,queriesPending:x.length,subscribe:I,abort:v}}function b(){c="failed",p.forEach(D=>{D(void 0,h)})}function C(){x.forEach(D=>{D.status==="pending"&&(D.status="aborted")}),x=[]}function _(D,$,R){const A=$!=="success";switch(x=x.filter(q=>q!==D),c){case"pending":break;case"failed":if(A||!e.dataAfterTimeout)return;break;default:return}if($==="abort"){h=R,b();return}if(A){h=R,x.length||(l.length?T():b());return}if(j(),C(),!e.random){const q=e.resources.indexOf(D.resource);q!==-1&&q!==e.index&&(e.index=q)}c="completed",p.forEach(q=>{q(R)})}function T(){if(c!=="pending")return;j();const D=l.shift();if(D===void 0){if(x.length){k=setTimeout(()=>{j(),c==="pending"&&(C(),b())},e.timeout);return}b();return}const $={status:"pending",resource:D,callback:(R,A)=>{_($,R,A)}};x.push($),f++,k=setTimeout(T,e.rotate),n(D,o,$.callback)}return setTimeout(T),g}function In(e){const o={...Kr,...e};let n=[];function r(){n=n.filter(a=>a().status==="pending")}function s(a,c,f){const h=el(o,a,c,(k,x)=>{r(),f&&f(k,x)});return n.push(h),h}function i(a){return n.find(c=>a(c))||null}return{query:s,find:i,setIndex:a=>{o.index=a},getIndex:()=>o.index,cleanup:r}}function Do(){}const bt=Object.create(null);function tl(e){if(!bt[e]){const o=to(e);if(!o)return;const n=In(o),r={config:o,redundancy:n};bt[e]=r}return bt[e]}function ol(e,o,n){let r,s;if(typeof e=="string"){const i=yt(e);if(!i)return n(void 0,424),Do;s=i.send;const l=tl(e);l&&(r=l.redundancy)}else{const i=Kt(e);if(i){r=In(i);const l=e.resources?e.resources[0]:"",a=yt(l);a&&(s=a.send)}}return!r||!s?(n(void 0,424),Do):r.query(o,s,n)().abort}const To="iconify2",ze="iconify",Dn=ze+"-count",_o=ze+"-version",Tn=36e5,nl=168;function vt(e,o){try{return e.getItem(o)}catch{}}function oo(e,o,n){try{return e.setItem(o,n),!0}catch{}}function Po(e,o){try{e.removeItem(o)}catch{}}function wt(e,o){return oo(e,Dn,o.toString())}function Ct(e){return parseInt(vt(e,Dn))||0}const ct={local:!0,session:!0},_n={local:new Set,session:new Set};let no=!1;function sl(e){no=e}let Ge=typeof window>"u"?{}:window;function Pn(e){const o=e+"Storage";try{if(Ge&&Ge[o]&&typeof Ge[o].length=="number")return Ge[o]}catch{}ct[e]=!1}function Ln(e,o){const n=Pn(e);if(!n)return;const r=vt(n,_o);if(r!==To){if(r){const a=Ct(n);for(let c=0;c<a;c++)Po(n,ze+c.toString())}oo(n,_o,To),wt(n,0);return}const s=Math.floor(Date.now()/Tn)-nl,i=a=>{const c=ze+a.toString(),f=vt(n,c);if(typeof f=="string"){try{const h=JSON.parse(f);if(typeof h=="object"&&typeof h.cached=="number"&&h.cached>s&&typeof h.provider=="string"&&typeof h.data=="object"&&typeof h.data.prefix=="string"&&o(h,a))return!0}catch{}Po(n,c)}};let l=Ct(n);for(let a=l-1;a>=0;a--)i(a)||(a===l-1?(l--,wt(n,l)):_n[e].add(a))}function qn(){if(!no){sl(!0);for(const e in ct)Ln(e,o=>{const n=o.data,r=o.provider,s=n.prefix,i=ve(r,s);if(!Zt(i,n).length)return!1;const l=n.lastModified||-1;return i.lastModifiedCached=i.lastModifiedCached?Math.min(i.lastModifiedCached,l):l,!0})}}function rl(e,o){const n=e.lastModifiedCached;if(n&&n>=o)return n===o;if(e.lastModifiedCached=o,n)for(const r in ct)Ln(r,s=>{const i=s.data;return s.provider!==e.provider||i.prefix!==e.prefix||i.lastModified===o});return!0}function ll(e,o){no||qn();function n(r){let s;if(!ct[r]||!(s=Pn(r)))return;const i=_n[r];let l;if(i.size)i.delete(l=Array.from(i).shift());else if(l=Ct(s),!wt(s,l+1))return;const a={cached:Math.floor(Date.now()/Tn),provider:e.provider,data:o};return oo(s,ze+l.toString(),JSON.stringify(a))}o.lastModified&&!rl(e,o.lastModified)||Object.keys(o.icons).length&&(o.not_found&&(o=Object.assign({},o),delete o.not_found),n("local")||n("session"))}function Lo(){}function il(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Xr(e)}))}function cl(e,o){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(o).sort():e.iconsToLoad=o,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:r}=e,s=e.iconsToLoad;delete e.iconsToLoad;let i;if(!s||!(i=yt(n)))return;i.prepare(n,r,s).forEach(a=>{ol(n,a,c=>{if(typeof c!="object")a.icons.forEach(f=>{e.missing.add(f)});else try{const f=Zt(e,c);if(!f.length)return;const h=e.pendingIcons;h&&f.forEach(k=>{h.delete(k)}),ll(e,c)}catch(f){console.error(f)}il(e)})})}))}const al=(e,o)=>{const n=Zr(e,!0,wn()),r=Jr(n);if(!r.pending.length){let c=!0;return o&&setTimeout(()=>{c&&o(r.loaded,r.missing,r.pending,Lo)}),()=>{c=!1}}const s=Object.create(null),i=[];let l,a;return r.pending.forEach(c=>{const{provider:f,prefix:h}=c;if(h===a&&f===l)return;l=f,a=h,i.push(ve(f,h));const k=s[f]||(s[f]=Object.create(null));k[h]||(k[h]=[])}),r.pending.forEach(c=>{const{provider:f,prefix:h,name:k}=c,x=ve(f,h),p=x.pendingIcons||(x.pendingIcons=new Set);p.has(k)||(p.add(k),s[f][h].push(k))}),i.forEach(c=>{const{provider:f,prefix:h}=c;s[f][h].length&&cl(c,s[f][h])}),o?Yr(o,r,i):Lo};function dl(e,o){const n={...e};for(const r in o){const s=o[r],i=typeof s;r in Cn?(s===null||s&&(i==="string"||i==="number"))&&(n[r]=s):i===typeof n[r]&&(n[r]=r==="rotate"?s%4:s)}return n}const ul=/[\s,]+/;function pl(e,o){o.split(ul).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function fl(e,o=0){const n=e.replace(/^-?[0-9.]*/,"");function r(s){for(;s<0;)s+=4;return s%4}if(n===""){const s=parseInt(e);return isNaN(s)?0:r(s)}else if(n!==e){let s=0;switch(n){case"%":s=25;break;case"deg":s=90}if(s){let i=parseFloat(e.slice(0,e.length-n.length));return isNaN(i)?0:(i=i/s,i%1===0?r(i):0)}}return o}function hl(e,o){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in o)n+=" "+r+'="'+o[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}function ml(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function bl(e){return"data:image/svg+xml,"+ml(e)}function xl(e){return'url("'+bl(e)+'")'}let Me;function gl(){try{Me=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{Me=null}}function kl(e){return Me===void 0&&gl(),Me?Me.createHTML(e):e}const $n={...Rn,inline:!1},jl={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},yl={display:"inline-block"},Rt={backgroundColor:"currentColor"},Nn={backgroundColor:"transparent"},qo={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},$o={WebkitMask:Rt,mask:Rt,background:Nn};for(const e in $o){const o=$o[e];for(const n in qo)o[e+n]=qo[n]}const vl={...$n,inline:!0};function No(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const wl=(e,o,n,r)=>{const s=n?vl:$n,i=dl(s,o),l=o.mode||"svg",a={},c=o.style||{},f={...l==="svg"?jl:{},ref:r};for(let g in o){const b=o[g];if(b!==void 0)switch(g){case"icon":case"style":case"children":case"onLoad":case"mode":case"_ref":case"_inline":break;case"inline":case"hFlip":case"vFlip":i[g]=b===!0||b==="true"||b===1;break;case"flip":typeof b=="string"&&pl(i,b);break;case"color":a.color=b;break;case"rotate":typeof b=="string"?i[g]=fl(b):typeof b=="number"&&(i[g]=b);break;case"ariaHidden":case"aria-hidden":b!==!0&&b!=="true"&&delete f["aria-hidden"];break;default:s[g]===void 0&&(f[g]=b)}}const h=$r(e,i),k=h.attributes;if(i.inline&&(a.verticalAlign="-0.125em"),l==="svg"){f.style={...a,...c},Object.assign(f,k);let g=0,b=o.id;return typeof b=="string"&&(b=b.replace(/-/g,"_")),f.dangerouslySetInnerHTML={__html:kl(Mr(h.body,b?()=>b+"ID"+g++:"iconifyReact"))},fe.createElement("svg",f)}const{body:x,width:p,height:j}=e,v=l==="mask"||(l==="bg"?!1:x.indexOf("currentColor")!==-1),I=hl(x,{...k,width:p+"",height:j+""});return f.style={...a,"--svg":xl(I),width:No(k.width),height:No(k.height),...yl,...v?Rt:Nn,...c},fe.createElement("span",f)};wn(!0);Or("",Gr);if(typeof document<"u"&&typeof window<"u"){qn();const e=window;if(e.IconifyPreload!==void 0){const o=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof o=="object"&&o!==null&&(o instanceof Array?o:[o]).forEach(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!_r(r))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const o=e.IconifyProviders;if(typeof o=="object"&&o!==null)for(let n in o){const r="IconifyProviders["+n+"] is invalid.";try{const s=o[n];if(typeof s!="object"||!s||s.resources===void 0)continue;zr(n,s)||console.error(r)}catch{console.error(r)}}}}class An extends fe.Component{constructor(o){super(o),this.state={icon:null}}_abortLoading(){this._loading&&(this._loading.abort(),this._loading=null)}_setData(o){this.state.icon!==o&&this.setState({icon:o})}_checkIcon(o){const n=this.state,r=this.props.icon;if(typeof r=="object"&&r!==null&&typeof r.body=="string"){this._icon="",this._abortLoading(),(o||n.icon===null)&&this._setData({data:r});return}let s;if(typeof r!="string"||(s=it(r,!1,!0))===null){this._abortLoading(),this._setData(null);return}const i=Dr(s);if(!i){(!this._loading||this._loading.name!==r)&&(this._abortLoading(),this._icon="",this._setData(null),i!==null&&(this._loading={name:r,abort:al([s],this._checkIcon.bind(this,!1))}));return}if(this._icon!==r||n.icon===null){this._abortLoading(),this._icon=r;const l=["iconify"];s.prefix!==""&&l.push("iconify--"+s.prefix),s.provider!==""&&l.push("iconify--"+s.provider),this._setData({data:i,classes:l}),this.props.onLoad&&this.props.onLoad(r)}}componentDidMount(){this._checkIcon(!1)}componentDidUpdate(o){o.icon!==this.props.icon&&this._checkIcon(!0)}componentWillUnmount(){this._abortLoading()}render(){const o=this.props,n=this.state.icon;if(n===null)return o.children?o.children:fe.createElement("span",{});let r=o;return n.classes&&(r={...o,className:(typeof o.className=="string"?o.className+" ":"")+n.classes.join(" ")}),wl({...Yt,...n.data},r,o._inline,o._ref)}}const Cl=fe.forwardRef(function(o,n){const r={...o,_ref:n,_inline:!1};return fe.createElement(An,r)});fe.forwardRef(function(o,n){const r={...o,_ref:n,_inline:!0};return fe.createElement(An,r)});var Rl=Cl;const Sl=e=>{const o=e.includes("youtube.com")||e.includes("youtu.be"),n=e.includes("vimeo.com");return o||n};function at({url:e,style:o,controls:n,modestbranding:r}){var a;const{t:s}=Q(),i=e.includes("youtube.com")||e.includes("youtu.be"),l=e.includes("vimeo.com");if(i){const c=((a=e.split("v=")[1])==null?void 0:a.split("&")[0])||e.split("/").pop();return t.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:(o==null?void 0:o.pointerEvents)||"auto"},children:t.jsx("iframe",{src:`https://www.youtube.com/embed/${c}?modestbranding=${r}&controls=${n}&rel=0`,title:"YouTube video player",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",...o},allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})})}if(l){const c=e.split("/").pop();return t.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:o.pointerEvents||"auto"},children:t.jsx("iframe",{src:`https://player.vimeo.com/video/${c}`,title:"Vimeo video player",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",...o},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0})})}return t.jsx(u,{style:{position:"relative",width:"100%",paddingTop:"56.25%"},children:t.jsxs(u,{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",backgroundColor:"rgba(0, 0, 0, 0.04)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",...o},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,children:[t.jsx(Rl,{icon:"carbon:video-off",style:{fontSize:40,marginBottom:"10px",opacity:.5}}),t.jsx(O,{variant:"body1",sx:{opacity:.5},children:s("studio.videoDialogNoSrc")})]})})}at.propTypes={url:d.string.isRequired,style:d.object,controls:d.number,modestbranding:d.number};at.defaultProps={style:{},controls:1,modestbranding:1};function En({setParams:e,onClose:o,params:n}){const{t:r}=Q(),[s,i]=w.useState(""),l=s&&n.blockletVideos.includes(s),a=Sl(s),c=()=>{e(f=>{const h=[...f.blockletVideos];return h.push(s),{...f,blockletVideos:h}}),o()};return t.jsxs(rt,{open:!0,fullWidth:!0,maxWidth:"sm",children:[t.jsx(Xo,{children:r("studio.videoDialogTitle")}),t.jsxs(Qo,{children:[t.jsx(ts,{fullWidth:!0,value:s,onChange:f=>i(f.target.value),placeholder:r("studio.videoInputLabel"),endAdornment:s?t.jsx(Ve,{position:"end",children:t.jsx(oe,{onClick:()=>i(""),children:t.jsx(js,{})})}):null,error:l}),l&&t.jsx(O,{variant:"body2",color:"error",children:r("studio.duplicateVideo")}),t.jsx(at,{url:s,style:{marginTop:"20px",borderRadius:"4px"}})]}),t.jsxs(Yo,{children:[t.jsx(Z,{onClick:()=>o(),children:r("studio.cancel")}),t.jsx(Z,{disabled:!a||l,onClick:c,children:r("studio.confirm")})]})]})}En.propTypes={onClose:d.func.isRequired,params:d.object.isRequired,setParams:d.func.isRequired};const Ao=w.lazy(()=>en(()=>import("./index-CB8LRAXR.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])).then(e=>({default:e.Uploader})));function Mn({projectId:e,readOnly:o,loading:n,blocklet:r,params:s,setParams:i,paramsErrTip:l,setParamsErrTip:a,setLoading:c,initUrl:f,initLogoUrl:h,setInitLogoUrl:k,componentDid:x}){const{t:p,locale:j}=Q(),{api:v}=me(),I=St(),g=w.useRef(null),b=w.useRef(null),[C,_]=gr(r),[T,D]=w.useState(!1),$=Ls({messageType:"connect-store-message",onOpen:()=>c(!0),onClose:()=>c(!1)}),R=async S=>{const P=setTimeout(()=>{c(!1)},2e4),W=await jr(v,S);c(!1),clearTimeout(P),window.parent.postMessage({event:"studioDialog.connected",componentDid:x},"*"),I(window.location.pathname.replace(`${J.UNOWNED_DID}/create`,`${W}/create`),{replace:!0})},A=()=>{if(!s.blockletTitle){U.error(p("blocklet.publish.errorTip.noTitle"));return}if(!(C!=null&&C.url)){U.error(p("blocklet.publish.noStoreSelected"));return}const S=kr();$(async(P,W)=>{var F,G,ee;try{const X=await v.connectByStudio({input:{did:(F=r==null?void 0:r.meta)==null?void 0:F.did,blockletTitle:s==null?void 0:s.blockletTitle,storeUrl:C.url,storeId:C.id,storeName:C.name,type:((G=s==null?void 0:s.blockletComponents)==null?void 0:G.length)>0?"pack":"resource",componentDid:x,messageId:S,tenantScope:(f==null?void 0:f.searchParams.get("tenantScope"))||""}});if(!(X!=null&&X.url)){U.error("failed to connect to store");return}W(X.url),R({did:(ee=r==null?void 0:r.meta)==null?void 0:ee.did,projectId:"",messageId:S})}catch(X){const se=De(X);U.error(se),c(!1)}})},q=`${J.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${r.meta.did}/${e}/logo/upload`,M=`${J.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${r.meta.did}/${e}/screenshot/upload`,m=s!=null&&s.blockletLogo?`${q}/${s.blockletLogo}`:`${J.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,y=((s==null?void 0:s.blockletScreenshots)||[]).filter(Boolean).map(S=>`${M}/${S}`),L=()=>o?!1:!e||e===J.UNOWNED_DID?(U.error(p("blocklet.publish.errorTip.noFirstDid")),!1):!0,z=S=>{if(!S.destination)return;const P=Array.from(s.blockletScreenshots),[W]=P.splice(S.source.index,1);P.splice(S.destination.index,0,W),i(F=>({...F,blockletScreenshots:P}))},B=S=>{if(!S.destination)return;const P=Array.from(s.blockletVideos),[W]=P.splice(S.source.index,1);P.splice(S.destination.index,0,W),i(F=>({...F,blockletVideos:P}))};return t.jsxs(Il,{children:[t.jsx(u,{display:"flex",className:"section",children:t.jsxs(u,{sx:{flex:1},children:[t.jsx(Y,{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:s.blockletTitle||"",onChange:S=>{a({blockletTitle:""}),i({blockletTitle:S.target.value})},error:!!l.blockletTitle,helperText:l.blockletTitle||""}),t.jsx(Y,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"export-blocklet-did",endAdornment:e===J.UNOWNED_DID&&t.jsx(Ve,{position:"end",children:t.jsx(Qt,{blocklet:r,store:C,componentDid:x,onChangeStore:_,disabled:!s.blockletTitle||o||n,loading:n,onClick:A})})},error:!!l.projectId,helperText:l.projectId||"",value:e===J.UNOWNED_DID?"":`did:abt:${e}`,sx:{mt:3}}),t.jsx(Y,{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:s.blockletDescription||"",onChange:S=>{a({blockletDescription:""}),i({blockletDescription:S.target.value})},error:!!l.blockletDescription,helperText:l.blockletDescription||"",sx:{mt:3}}),t.jsx(Y,{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:s.blockletHomepage||"",onChange:S=>{S.target.value&&!/^(http|https):\/\//.test(S.target.value)?a({blockletHomepage:p("blocklet.publish.errorTip.invalidUrl")}):a({blockletHomepage:""}),i({blockletHomepage:S.target.value})},error:!!l.blockletHomepage,helperText:l.blockletHomepage||"",sx:{mt:3}}),t.jsx(Y,{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:s.blockletCommunity||"",onChange:S=>{S.target.value&&!/^(http|https):\/\//.test(S.target.value)?a({blockletCommunity:p("blocklet.publish.errorTip.invalidUrl")}):a({blockletCommunity:""}),i({blockletCommunity:S.target.value})},error:!!l.blockletCommunity,helperText:l.blockletCommunity||"",sx:{mt:3}}),t.jsx(Y,{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:s.blockletSupport||"",onChange:S=>{S.target.value&&!/^(http|https):\/\//.test(S.target.value)&&!/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(S.target.value)?a({blockletSupport:p("blocklet.publish.errorTip.invalidUrlOrEmail")}):a({blockletSupport:""}),i({blockletSupport:S.target.value})},error:!!l.blockletSupport,helperText:l.blockletSupport||"",sx:{mt:3}}),t.jsx(Y,{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:s.blockletRepository||"",onChange:S=>{S.target.value&&!/^(git|https|svn)/.test(S.target.value)?a({blockletRepository:p("blocklet.publish.errorTip.invalidUrl")}):a({blockletRepository:""}),i({blockletRepository:S.target.value})},error:!!l.blockletRepository,helperText:l.blockletRepository||"",sx:{mt:3}})]})}),t.jsx(u,{display:"flex",mt:3,className:"section full-width",children:t.jsxs(u,{sx:{flex:1},children:[t.jsxs(u,{display:"flex",flexDirection:"row",flexWrap:"wrap",children:[t.jsxs(je,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[t.jsx(O,{variant:"subtitle1",sx:{fontWeight:"bold"},children:p("common.logo")}),t.jsxs(je,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[t.jsx(u,{children:t.jsxs(u,{component:"span",children:[t.jsxs(u,{component:"span",sx:{color:"#555"},children:[p("studio.type"),":"," "]}),t.jsx(u,{component:"span",sx:{color:"#007ec6"},children:"png, jpg, webp, svg"})]})}),t.jsx(u,{children:t.jsxs(u,{component:"span",children:[t.jsxs(u,{component:"span",sx:{color:"#555"},children:[p("studio.ratio"),":"," "]}),t.jsx(u,{component:"span",sx:{color:"#007ec6"},children:"256x256"})]})}),t.jsx(u,{children:t.jsxs(u,{component:"span",children:[t.jsxs(u,{component:"span",sx:{color:"#555"},children:[p("studio.size"),":"," "]}),t.jsx(u,{component:"span",sx:{color:"#007ec6"},children:"<500Kb"})]})})]})]}),t.jsx(u,{sx:{flex:1,cursor:o?"default":"pointer",display:"flex",alignItems:"flex-end"},children:t.jsx(Vo,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:h||m,onClick:()=>{var S;L()&&((S=g.current)==null||S.open())}})})]}),t.jsxs(u,{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap",children:[t.jsxs(je,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[t.jsx(O,{variant:"subtitle1",sx:{fontWeight:"bold"},children:p("common.screenshot")}),t.jsxs(je,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[t.jsx(u,{sx:{border:"none"},variant:"outlined",size:"small",children:t.jsxs(u,{component:"span",children:[t.jsxs(u,{component:"span",sx:{color:"#555"},children:[p("studio.ratio"),":"," "]}),t.jsx(u,{component:"span",sx:{color:"#007ec6"},children:"16 / 9"})]})}),t.jsx(u,{children:t.jsxs(u,{component:"span",children:[t.jsxs(u,{component:"span",sx:{color:"#555"},children:[p("studio.count"),":"," "]}),t.jsx(u,{component:"span",sx:{color:"#007ec6"},children:"1~5"})]})}),t.jsx(u,{children:t.jsxs(u,{component:"span",children:[t.jsxs(u,{component:"span",sx:{color:"#555"},children:[p("studio.size"),":"," "]}),t.jsx(u,{component:"span",sx:{color:"#007ec6"},children:"<5MB"})]})}),!o&&t.jsx(u,{children:t.jsxs(u,{component:"span",children:[t.jsxs(u,{component:"span",sx:{color:"#555"},children:[p("studio.order"),":"," "]}),t.jsx(u,{component:"span",sx:{color:"#007ec6"},children:p("studio.orderTip")})]})})]})]}),t.jsx(bo,{onDragEnd:o?void 0:z,children:t.jsx(xo,{droppableId:"screenshots",direction:"horizontal",isDropDisabled:o,children:(S,P)=>t.jsxs(u,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap",minHeight:160,background:P.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:P.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:S.innerRef,...S.droppableProps,children:[y.map((W,F)=>t.jsx(go,{draggableId:W,index:F,isDragDisabled:o,children:(G,ee)=>t.jsxs(u,{ref:G.innerRef,...G.draggableProps,className:"screenshot",sx:{transform:ee.isDragging?"scale(1.05)":"none",boxShadow:ee.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[t.jsx("img",{alt:"screenshot",src:W}),!o&&t.jsx(oe,{...G.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:t.jsx(gt,{})}),!o&&t.jsx(oe,{className:"action",onClick:()=>{i(X=>{const se=[...X.blockletScreenshots];return se.splice(F,1),{...X,blockletScreenshots:se}})},children:t.jsx(ko,{})})]})},W)),S.placeholder,y.length<5&&t.jsx(u,{sx:{width:240,height:135,background:"#eee",cursor:o?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{var W;L()&&((W=b.current)==null||W.open())},children:"+"})]})})})]}),t.jsxs(u,{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap",children:[t.jsxs(je,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[t.jsx(O,{variant:"subtitle1",sx:{fontWeight:"bold"},children:p("studio.video")}),t.jsxs(je,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[t.jsx(u,{children:t.jsxs(u,{component:"span",children:[t.jsxs(u,{component:"span",sx:{color:"#555"},children:[p("studio.videoType"),":"," "]}),t.jsxs(u,{component:"span",sx:{color:"#007ec6"},children:[t.jsx("a",{href:"https://www.youtube.com/",target:"_blank",rel:"noreferrer",children:"Youtube"}),","," ",t.jsx("a",{href:"https://vimeo.com/",target:"_blank",rel:"noreferrer",children:"Vimeo"})]})]})}),t.jsx(u,{children:t.jsxs(u,{component:"span",children:[t.jsxs(u,{component:"span",sx:{color:"#555"},children:[p("studio.count"),":"," "]}),t.jsx(u,{component:"span",sx:{color:"#007ec6"},children:"1~3"})]})}),!o&&t.jsx(u,{children:t.jsxs(u,{component:"span",children:[t.jsxs(u,{component:"span",sx:{color:"#555"},children:[p("studio.order"),":"," "]}),t.jsx(u,{component:"span",sx:{color:"#007ec6"},children:p("studio.orderTip")})]})})]})]}),t.jsx(bo,{onDragEnd:o?void 0:B,children:t.jsx(xo,{droppableId:"videos",direction:"horizontal",isDropDisabled:o,children:(S,P)=>t.jsxs(u,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap",minHeight:160,background:P.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:P.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:S.innerRef,...S.droppableProps,children:[s.blockletVideos.map((W,F)=>t.jsx(go,{draggableId:W,index:F,isDragDisabled:o,children:(G,ee)=>t.jsxs(u,{ref:G.innerRef,...G.draggableProps,className:"screenshot",sx:{transform:ee.isDragging?"scale(1.05)":"none",boxShadow:ee.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[t.jsx(at,{url:W,style:{pointerEvents:ee.isDragging?"none":"auto"}}),!o&&t.jsx(oe,{...G.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:t.jsx(gt,{})}),!o&&t.jsx(oe,{className:"action",onClick:()=>{i(X=>{const se=[...X.blockletVideos];return se.splice(F,1),{...X,blockletVideos:se}})},children:t.jsx(ko,{})})]})},W)),S.placeholder,s.blockletVideos.length<3&&t.jsx(u,{sx:{width:240,height:135,background:"#eee",cursor:o?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{L()&&D(!0)},children:"+"})]})})})]})]})}),t.jsxs(w.Suspense,{fallback:t.jsx(We,{}),children:[t.jsx(Ao,{ref:g,locale:j,popup:!0,onUploadFinish:S=>{var P;i({blockletLogo:S.data.filename}),k(""),(P=g.current)==null||P.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:q,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/png","image/jpeg","image/webp","application/svg+xml"],maxFileSize:1024*1024*.5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{minWidth:256,minHeight:256}}}},"uploader-logo"),T&&t.jsx(En,{onClose:()=>D(!1),params:s,setParams:i}),t.jsx(Ao,{ref:b,popup:!0,onUploadFinish:S=>{var P;i(W=>{var G;const F=W.blockletScreenshots||[];return F.push((G=S.data)==null?void 0:G.filename),{...W,blockletScreenshots:F}}),(P=b.current)==null||P.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:M,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","application/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-y.length}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,autoCropArea:1,aspectRatio:16/9,initialAspectRatio:16/9,croppedCanvasOptions:{minWidth:1280,minHeight:720,maxWidth:1280*2,maxHeight:720*2}}}},"uploader-screenshot")]})]})}Mn.propTypes={projectId:d.string.isRequired,readOnly:d.bool.isRequired,params:d.object.isRequired,setParams:d.func.isRequired,paramsErrTip:d.object.isRequired,setParamsErrTip:d.func.isRequired,loading:d.bool.isRequired,blocklet:d.object.isRequired,setLoading:d.func.isRequired,initUrl:d.object.isRequired,componentDid:d.isRequired,initLogoUrl:d.string.isRequired,setInitLogoUrl:d.func.isRequired};const Il=ae.div`
133
133
  margin-top: 24px;
134
134
  .screenshot {
135
135
  margin-bottom: 16px;
@@ -177,7 +177,7 @@ import{r as w,k as St,l as st,L as ce,u as Yn,h as Zn,i as dt}from"./vendor-reac
177
177
  padding-bottom: 12px;
178
178
  border-bottom: ${({theme:e})=>`1px solid ${e.palette.divider}`};
179
179
  }
180
- `;function Un({text:e}){return e?t.jsx(Bs,{wrapperElement:{"data-color-mode":"light"},source:ys.sanitize(e),rehypePlugins:[[Vs,{target:"_blank"}]]}):t.jsx(Te,{Icon:Nt})}Un.propTypes={text:d.string.isRequired};function Fn({params:e,setParams:o,paramsErrTip:n,loading:r,setParamsErrTip:s,readOnly:i}){var h;const{t:l}=Q(),[a,c]=w.useState(i?"preview":"write"),f=(k,x)=>{c(x)};return t.jsxs(u,{sx:{border:"1px solid #fff",width:"100%",borderRadius:2},children:[t.jsxs(u,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[t.jsx(O,{variant:"h6",fontWeight:"bold",sx:{},children:l("common.introduction")}),t.jsxs(Zo,{value:a,onChange:f,"aria-label":"wrapped label tabs example",children:[t.jsx(Ke,{value:"write",label:"Write"}),t.jsx(Ke,{value:"preview",label:"Preview"})]})]}),t.jsx(u,{display:a==="write"?"block":"none",sx:{width:"100%",marginTop:3},children:t.jsx(Y,{disabled:r||i,sx:{border:"none"},placeholder:`Blocklet ${l("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:i,endAdornment:t.jsxs(Ve,{position:"end",children:[((h=e==null?void 0:e.blockletIntroduction)==null?void 0:h.length)||0," / ",re.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:e.blockletIntroduction||"",onChange:k=>{s({blockletIntroduction:""}),o({blockletIntroduction:k.target.value.slice(0,re.PROJECT.MAX_INTRO_LENGTH)})},error:!!n.blockletIntroduction,helperText:n.blockletIntroduction||""})}),t.jsx(u,{display:a==="preview"?"block":"none",mt:3,children:t.jsx(Un,{text:e.blockletIntroduction||""})})]})}Fn.propTypes={params:d.object.isRequired,setParams:d.func.isRequired,paramsErrTip:d.object.isRequired,setParamsErrTip:d.func.isRequired,readOnly:d.bool.isRequired,loading:d.bool.isRequired};var lo={},El=he;Object.defineProperty(lo,"__esModule",{value:!0});var Hn=lo.default=void 0,Ml=El(be()),Mo=t;Hn=lo.default=(0,Ml.default)([(0,Mo.jsx)("circle",{cx:"12",cy:"19",r:"2"},"0"),(0,Mo.jsx)("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function io({step:e,ok:o,active:n,error:r}){let s="grey.500",i=e+1;return o&&(i=t.jsx(Ws,{sx:{fontSize:18,margin:0},color:"white"})),r||!o&&n>e?(s="error.main",i=t.jsx(Hn,{sx:{fontSize:18,margin:0},color:"white"})):n>=e&&(s="primary.main"),t.jsx(u,{width:24,height:24,bgcolor:s,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center",children:i})}io.propTypes={step:d.number,ok:d.bool,active:d.number,error:d.string};io.defaultProps={step:0,ok:!1,active:0,error:""};function Gn({steps:e,activeStep:o,setActiveStep:n,hasSelectedResources:r,params:s,loading:i,paramsErrTip:l,viewMode:a,projectId:c}){const{t:f}=Q(),h=()=>{n(j=>j+1)},k=()=>{n(j=>j-1)},x=j=>j===0?(l==null?void 0:l.blockletTitle)||(l==null?void 0:l.projectId)||(l==null?void 0:l.blockletDescription)||(l==null?void 0:l.blockletHomepage)||(l==null?void 0:l.blockletSupport)||(l==null?void 0:l.blockletCommunity)||(l==null?void 0:l.blockletRepository):j===2?(l==null?void 0:l.blockletResource)||(l==null?void 0:l.blockletDocker)||(l==null?void 0:l.dockerImageName):j>=4?(l==null?void 0:l.blockletVersion)||(l==null?void 0:l.note):"",p=a||zn({hasSelectedResources:r,params:s,projectId:c,t:f})===null;return t.jsxs(u,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid #ccc",borderRadius:2},children:[t.jsx(ls,{activeStep:o,orientation:"vertical",children:e.map((j,v)=>{const I={},g=i||!Nl({hasSelectedResources:r,params:s,projectId:c,step:v,t:f}),b=i?"":x(v);return b&&(I.optional=t.jsx(O,{variant:"caption",color:"error",children:b}),I.error=!0),t.jsxs(is,{children:[t.jsx(cs,{icon:t.jsx(io,{error:b,active:p?99:o,step:v,ok:g}),sx:{cursor:"pointer",color:b?"error.main":"inherit"},disabled:!1,onClick:()=>n(v),...I,children:t.jsx(O,{fontSize:"14px",fontWeight:"500",color:b||!g&&o>v?"error.main":"inherit",children:j.label})}),t.jsxs(as,{children:[t.jsx(O,{fontSize:12,children:j.description}),!p&&t.jsx(u,{sx:{mb:2},children:t.jsxs("div",{children:[v<e.length-1&&t.jsx(Z,{variant:"contained",onClick:h,sx:{mt:1,mr:1},disabled:b||!g,children:f("common.continue")}),v>0&&t.jsx(Z,{disabled:v===0,onClick:k,sx:{mt:1,mr:1},children:f("common.back")})]})})]})]},j.label)})}),o>=e.length-1&&t.jsx(It,{square:!0,elevation:0,sx:{p:3},children:t.jsx(O,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}Gn.propTypes={steps:d.array.isRequired,activeStep:d.number.isRequired,setActiveStep:d.func.isRequired,params:d.object.isRequired,viewMode:d.string.isRequired,loading:d.bool.isRequired,projectId:d.string.isRequired,hasSelectedResources:d.bool.isRequired,paramsErrTip:d.shape({projectId:d.string,blockletVersion:d.string,blockletTitle:d.string,blockletDescription:d.string,note:d.string,blockletResource:d.string,blockletHomepage:d.string,blockletSupport:d.string,blockletCommunity:d.string,blockletRepository:d.string,blockletDocker:d.object,dockerImageName:d.string}).isRequired};const Ol=[".zip",".gz"],zl=1024*1024*100,Bl=w.lazy(()=>en(()=>import("./index-a-qtpRvq.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])).then(e=>({default:e.Uploader})));function co({app:e,projectId:o,readOnly:n,params:r,setParams:s,setParamsErrTip:i,error:l}){const{t:a,locale:c}=Q(),f=w.useRef(null),h=()=>n?!1:!o||o===J.UNOWNED_DID?(U.error(a("blocklet.publish.errorTip.noFirstDid")),!1):!0,k=`${J.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e.meta.did}/${o}/resource/upload`;return t.jsxs(u,{sx:{mt:3},children:[t.jsx(O,{gutterBottom:!0,children:a("blocklet.publish.resourceUpload")}),t.jsxs(je,{direction:"row",alignItems:"center",spacing:1,sx:{flex:1,cursor:n?"default":"pointer"},children:[!!r.uploadedResource&&t.jsx(O,{component:"a",href:`${k}/params.uploadedResource`,children:r.uploadedResource}),!n&&t.jsx(Z,{variant:"outlined",size:"small",onClick:()=>{var x;h()&&((x=f.current)==null||x.open())},children:r.uploadedResource?a("common.change"):a("common.upload")})]}),t.jsx(w.Suspense,{fallback:t.jsx(We,{}),children:t.jsx(Bl,{ref:f,locale:c,popup:!0,onUploadFinish:x=>{var p;s({uploadedResource:x.data.filename}),i({blockletResource:""}),(p=f.current)==null||p.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:k,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileExts:Ol,maxFileSize:zl,maxNumberOfFiles:1}}},"uploader-resource")}),!!l&&t.jsx(u,{color:"error.main",mt:1,fontSize:14,children:l})]})}co.propTypes={app:d.object.isRequired,projectId:d.string.isRequired,readOnly:d.bool.isRequired,params:d.object.isRequired,setParams:d.func.isRequired,error:d.string.isRequired,setParamsErrTip:d.func.isRequired};co.defaultProps={};function ot({readOnly:e,params:o,setParams:n,paramsErrTip:r,setParamsErrTip:s,loading:i}){var a;const{t:l}=Q();return t.jsx(u,{display:"flex",mt:3,className:"section",children:t.jsxs(u,{sx:{flex:1},children:[t.jsx(Y,{required:!0,disabled:i||e,label:`Blocklet ${l("common.version")}`,placeholder:`Blocklet ${l("common.version")}`,InputProps:{"data-cy":"blocklet-version",readOnly:e},autoComplete:"off",variant:"outlined",fullWidth:!0,value:o.blockletVersion||"",onChange:c=>{s({blockletVersion:""}),n({blockletVersion:c.target.value})},error:!!r.blockletVersion,helperText:r.blockletVersion||""}),t.jsx(Y,{label:l("blocklet.publish.releaseNote"),autoComplete:"off",disabled:i||e,variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:e,endAdornment:t.jsxs(Ve,{position:"end",children:[((a=o==null?void 0:o.note)==null?void 0:a.length)||0," / ",re.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:o.note||"",onChange:c=>{s({note:""}),n({note:c.target.value.slice(0,re.PROJECT.MAX_NOTE_LENGTH)})},error:!!r.note,helperText:r.note||"",sx:{mt:3}})]})})}ot.propTypes={readOnly:d.bool.isRequired,params:d.object.isRequired,setParams:d.func.isRequired,paramsErrTip:d.object.isRequired,setParamsErrTip:d.func.isRequired,loading:d.bool.isRequired};ot.defaultProps={};function Jn(e){for(const o in e)typeof e[o]=="string"?e[o]=e[o].replace(/\\\\/g,"\\"):typeof e[o]=="object"&&e[o]!==null&&Jn(e[o]);return e}function nt({index:e,item:o,dockerParams:n,setDockerParams:r,dataKey:s,t:i,readOnly:l}){const a=(o==null?void 0:o.value)||"",[c,f]=w.useState(!1),h=()=>{var q;(q=n[s])==null||q.splice(e,1),r({...n,[s]:[...n[s]]})},k=(q,M)=>{var m;(m=n[s])!=null&&m[e]&&(M?(n[s][e].custom=n[s][e].value,n[s][e].value=`$${pt(o.key)}`):(n[s][e].value=n[s][e].custom||"",n[s][e].custom="")),r({...n,[s]:[...n[s]]})},x=(q,M)=>{var y;const m=((y=n[s][e])==null?void 0:y.value)||"";n[s][e]={...n[s][e],secure:M,value:M&&m===re.BLOCKLET_AUTOMATIC_ENV_VALUE?"":m},r({...n,[s]:[...n[s]]})},p=(q,M)=>{n[s][e]={...n[s][e],shared:M},r({...n,[s]:[...n[s]]})},j=(q,M)=>{var y;const m=((y=n[s][e])==null?void 0:y.value)||"";n[s][e]={...n[s][e],required:M,value:M&&m===re.BLOCKLET_AUTOMATIC_ENV_VALUE?"":m},r({...n,[s]:[...n[s]]})},v=(q,M)=>{n[s][e]={...n[s][e],value:M?re.BLOCKLET_AUTOMATIC_ENV_VALUE:"",secure:!1,required:!1},r({...n,[s]:[...n[s]]})},I=q=>{n[s][e]={...n[s][e],description:q.target.value},r({...n,[s]:[...n[s]]})},g=q=>{const M=q.target.value==="web"?"web":"docker";M==="web"&&n.dockerArgs.forEach(L=>{L.type="docker"});const y=`/${n.dockerImage.replace(/\W/g,"-")}-${e}`;n.dockerArgs[e]={...n.dockerArgs[e],type:M,path:M==="docker"?y:"/",protocol:"http",prefix:M==="docker"?y:"/",name:"publicUrl",port:"BLOCKLET_PORT"},r({...n,dockerArgs:[...n.dockerArgs]})},b=q=>{const M=q.target.value;n[s][e]={...n[s][e],prefix:M,path:M==="*"?"/":M},r({...n,[s]:[...n[s]]})},C=q=>{var M;(M=n[s])!=null&&M[e]&&(n[s][e].value=q.target.value),r({...n,[s]:[...n[s]]})},_=a===`$${pt(o.key)}`||o.custom,T=s==="dockerArgs"&&!cn[o.key],D=Ns[o.key],$=s==="dockerEnvs",R=o.key==="--publish";let A=o.key;return R&&o.type==="web"?A="--publish (Web)":$&&(A=`--env ${o.key}`),t.jsxs(u,{sx:{display:"flex",flexDirection:"row",gap:2,alignItems:"center"},children:[t.jsx(u,{sx:{width:250},children:t.jsx(O,{sx:{textOverflow:"ellipsis",width:"100%",overflow:"hidden"},children:A})}),t.jsxs(u,{sx:{display:"flex",flexDirection:"column",gap:1,flex:1},children:[t.jsx(Y,{disabled:l||_||T||o.value===re.BLOCKLET_AUTOMATIC_ENV_VALUE,placeholder:"",value:_?`$${pt(o.key)}`:a,sx:{flex:1},InputProps:{endAdornment:t.jsxs(Ve,{position:"end",sx:{zoom:.9},children:[(!(D||T)||$||R)&&t.jsx(oe,{onClick:()=>f(!0),children:t.jsx(ne,{icon:"icon-park-outline:setting-config"})}),!l&&t.jsx(oe,{onClick:h,color:T?"error":"default",children:t.jsx(ne,{icon:"ic:round-delete"})})]})},error:T,onChange:C}),T&&t.jsx(O,{variant:"caption",color:"error",children:i("blocklet.publish.docker.noAllowTheArg")}),o.key==="--publish"&&t.jsx(O,{variant:"caption",color:"text.secondary",children:i("blocklet.publish.docker.publishTips")}),o.key==="--volume"&&As[o.key](a)&&t.jsx(O,{variant:"caption",color:"error",children:i("blocklet.publish.docker.volumeTips")})]}),c&&t.jsx(Tt,{open:!0,fullWidth:!0,maxWidth:"sm",PaperProps:{style:{minHeight:0}},title:i($?"blocklet.publish.docker.modifyEnv":"blocklet.publish.docker.modifyParam"),onClose:()=>f(!1),children:t.jsxs(u,{sx:{display:"flex",flexDirection:"column",gap:1,paddingBottom:2},children:[D||T||$?null:t.jsxs(u,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[t.jsx(O,{children:i("blocklet.publish.docker.needCustomInput")}),t.jsx(ye,{disabled:l,checked:_,onChange:k,sx:{zoom:.9}})]}),$&&t.jsxs(u,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[t.jsx(O,{children:i("blocklet.publish.docker.shared")}),t.jsx(ye,{disabled:l,checked:o.shared,onChange:p,sx:{zoom:.9}})]}),$&&t.jsxs(u,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[t.jsx(O,{children:i("blocklet.publish.docker.required")}),t.jsx(ye,{disabled:l,checked:o.required,onChange:j,sx:{zoom:.9}})]}),$&&t.jsxs(u,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[t.jsx(O,{children:i("blocklet.publish.docker.secure")}),t.jsx(ye,{disabled:l,checked:o.secure,onChange:x,sx:{zoom:.9}})]}),$&&t.jsxs(u,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[t.jsx(O,{children:i("blocklet.publish.docker.autoGenerated")}),t.jsx(ye,{disabled:l,checked:o.value===re.BLOCKLET_AUTOMATIC_ENV_VALUE,onChange:v,sx:{zoom:.9}})]}),$&&t.jsxs(u,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[t.jsx(O,{sx:{flex:1},children:i("blocklet.publish.docker.description")}),t.jsx(Y,{disabled:l,value:o.description,onChange:I,sx:{flex:1},label:i("blocklet.publish.docker.description")})]}),R&&t.jsxs(u,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[t.jsx(O,{sx:{flex:1},children:i("blocklet.publish.docker.portType")}),t.jsxs(Ko,{value:o.type||"docker",onChange:g,children:[t.jsx(ue,{value:"docker",children:"Docker"}),t.jsx(ue,{value:"web",children:"Web"})]})]}),R&&o.type==="web"&&t.jsxs(u,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[t.jsx(O,{sx:{flex:1},children:i("blocklet.publish.docker.prefix")}),t.jsx(Y,{disabled:l,value:o.prefix,onChange:b,sx:{flex:1},label:i("blocklet.publish.docker.prefix")})]})]})})]})}nt.propTypes={dockerParams:d.object.isRequired,setDockerParams:d.func.isRequired,dataKey:d.string.isRequired,item:d.object.isRequired,t:d.func.isRequired,readOnly:d.bool.isRequired,index:d.number.isRequired};nt.defaultProps={};const Vl=`
180
+ `;function Un({text:e}){return e?t.jsx(Bs,{wrapperElement:{"data-color-mode":"light"},source:ys.sanitize(e),rehypePlugins:[[Vs,{target:"_blank"}]]}):t.jsx(Te,{Icon:Nt})}Un.propTypes={text:d.string.isRequired};function Fn({params:e,setParams:o,paramsErrTip:n,loading:r,setParamsErrTip:s,readOnly:i}){var h;const{t:l}=Q(),[a,c]=w.useState(i?"preview":"write"),f=(k,x)=>{c(x)};return t.jsxs(u,{sx:{border:"1px solid #fff",width:"100%",borderRadius:2},children:[t.jsxs(u,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[t.jsx(O,{variant:"h6",fontWeight:"bold",sx:{},children:l("common.introduction")}),t.jsxs(Zo,{value:a,onChange:f,"aria-label":"wrapped label tabs example",children:[t.jsx(Ke,{value:"write",label:"Write"}),t.jsx(Ke,{value:"preview",label:"Preview"})]})]}),t.jsx(u,{display:a==="write"?"block":"none",sx:{width:"100%",marginTop:3},children:t.jsx(Y,{disabled:r||i,sx:{border:"none"},placeholder:`Blocklet ${l("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:i,endAdornment:t.jsxs(Ve,{position:"end",children:[((h=e==null?void 0:e.blockletIntroduction)==null?void 0:h.length)||0," / ",re.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:e.blockletIntroduction||"",onChange:k=>{s({blockletIntroduction:""}),o({blockletIntroduction:k.target.value.slice(0,re.PROJECT.MAX_INTRO_LENGTH)})},error:!!n.blockletIntroduction,helperText:n.blockletIntroduction||""})}),t.jsx(u,{display:a==="preview"?"block":"none",mt:3,children:t.jsx(Un,{text:e.blockletIntroduction||""})})]})}Fn.propTypes={params:d.object.isRequired,setParams:d.func.isRequired,paramsErrTip:d.object.isRequired,setParamsErrTip:d.func.isRequired,readOnly:d.bool.isRequired,loading:d.bool.isRequired};var lo={},El=he;Object.defineProperty(lo,"__esModule",{value:!0});var Hn=lo.default=void 0,Ml=El(be()),Mo=t;Hn=lo.default=(0,Ml.default)([(0,Mo.jsx)("circle",{cx:"12",cy:"19",r:"2"},"0"),(0,Mo.jsx)("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function io({step:e,ok:o,active:n,error:r}){let s="grey.500",i=e+1;return o&&(i=t.jsx(Ws,{sx:{fontSize:18,margin:0},color:"white"})),r||!o&&n>e?(s="error.main",i=t.jsx(Hn,{sx:{fontSize:18,margin:0},color:"white"})):n>=e&&(s="primary.main"),t.jsx(u,{width:24,height:24,bgcolor:s,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center",children:i})}io.propTypes={step:d.number,ok:d.bool,active:d.number,error:d.string};io.defaultProps={step:0,ok:!1,active:0,error:""};function Gn({steps:e,activeStep:o,setActiveStep:n,hasSelectedResources:r,params:s,loading:i,paramsErrTip:l,viewMode:a,projectId:c}){const{t:f}=Q(),h=()=>{n(j=>j+1)},k=()=>{n(j=>j-1)},x=j=>j===0?(l==null?void 0:l.blockletTitle)||(l==null?void 0:l.projectId)||(l==null?void 0:l.blockletDescription)||(l==null?void 0:l.blockletHomepage)||(l==null?void 0:l.blockletSupport)||(l==null?void 0:l.blockletCommunity)||(l==null?void 0:l.blockletRepository):j===2?(l==null?void 0:l.blockletResource)||(l==null?void 0:l.blockletDocker)||(l==null?void 0:l.dockerImageName):j>=4?(l==null?void 0:l.blockletVersion)||(l==null?void 0:l.note):"",p=a||zn({hasSelectedResources:r,params:s,projectId:c,t:f})===null;return t.jsxs(u,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid #ccc",borderRadius:2},children:[t.jsx(ls,{activeStep:o,orientation:"vertical",children:e.map((j,v)=>{const I={},g=i||!Nl({hasSelectedResources:r,params:s,projectId:c,step:v,t:f}),b=i?"":x(v);return b&&(I.optional=t.jsx(O,{variant:"caption",color:"error",children:b}),I.error=!0),t.jsxs(is,{children:[t.jsx(cs,{icon:t.jsx(io,{error:b,active:p?99:o,step:v,ok:g}),sx:{cursor:"pointer",color:b?"error.main":"inherit"},disabled:!1,onClick:()=>n(v),...I,children:t.jsx(O,{fontSize:"14px",fontWeight:"500",color:b||!g&&o>v?"error.main":"inherit",children:j.label})}),t.jsxs(as,{children:[t.jsx(O,{fontSize:12,children:j.description}),!p&&t.jsx(u,{sx:{mb:2},children:t.jsxs("div",{children:[v<e.length-1&&t.jsx(Z,{variant:"contained",onClick:h,sx:{mt:1,mr:1},disabled:b||!g,children:f("common.continue")}),v>0&&t.jsx(Z,{disabled:v===0,onClick:k,sx:{mt:1,mr:1},children:f("common.back")})]})})]})]},j.label)})}),o>=e.length-1&&t.jsx(It,{square:!0,elevation:0,sx:{p:3},children:t.jsx(O,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}Gn.propTypes={steps:d.array.isRequired,activeStep:d.number.isRequired,setActiveStep:d.func.isRequired,params:d.object.isRequired,viewMode:d.string.isRequired,loading:d.bool.isRequired,projectId:d.string.isRequired,hasSelectedResources:d.bool.isRequired,paramsErrTip:d.shape({projectId:d.string,blockletVersion:d.string,blockletTitle:d.string,blockletDescription:d.string,note:d.string,blockletResource:d.string,blockletHomepage:d.string,blockletSupport:d.string,blockletCommunity:d.string,blockletRepository:d.string,blockletDocker:d.object,dockerImageName:d.string}).isRequired};const Ol=[".zip",".gz"],zl=1024*1024*100,Bl=w.lazy(()=>en(()=>import("./index-CB8LRAXR.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])).then(e=>({default:e.Uploader})));function co({app:e,projectId:o,readOnly:n,params:r,setParams:s,setParamsErrTip:i,error:l}){const{t:a,locale:c}=Q(),f=w.useRef(null),h=()=>n?!1:!o||o===J.UNOWNED_DID?(U.error(a("blocklet.publish.errorTip.noFirstDid")),!1):!0,k=`${J.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e.meta.did}/${o}/resource/upload`;return t.jsxs(u,{sx:{mt:3},children:[t.jsx(O,{gutterBottom:!0,children:a("blocklet.publish.resourceUpload")}),t.jsxs(je,{direction:"row",alignItems:"center",spacing:1,sx:{flex:1,cursor:n?"default":"pointer"},children:[!!r.uploadedResource&&t.jsx(O,{component:"a",href:`${k}/params.uploadedResource`,children:r.uploadedResource}),!n&&t.jsx(Z,{variant:"outlined",size:"small",onClick:()=>{var x;h()&&((x=f.current)==null||x.open())},children:r.uploadedResource?a("common.change"):a("common.upload")})]}),t.jsx(w.Suspense,{fallback:t.jsx(We,{}),children:t.jsx(Bl,{ref:f,locale:c,popup:!0,onUploadFinish:x=>{var p;s({uploadedResource:x.data.filename}),i({blockletResource:""}),(p=f.current)==null||p.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:k,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileExts:Ol,maxFileSize:zl,maxNumberOfFiles:1}}},"uploader-resource")}),!!l&&t.jsx(u,{color:"error.main",mt:1,fontSize:14,children:l})]})}co.propTypes={app:d.object.isRequired,projectId:d.string.isRequired,readOnly:d.bool.isRequired,params:d.object.isRequired,setParams:d.func.isRequired,error:d.string.isRequired,setParamsErrTip:d.func.isRequired};co.defaultProps={};function ot({readOnly:e,params:o,setParams:n,paramsErrTip:r,setParamsErrTip:s,loading:i}){var a;const{t:l}=Q();return t.jsx(u,{display:"flex",mt:3,className:"section",children:t.jsxs(u,{sx:{flex:1},children:[t.jsx(Y,{required:!0,disabled:i||e,label:`Blocklet ${l("common.version")}`,placeholder:`Blocklet ${l("common.version")}`,InputProps:{"data-cy":"blocklet-version",readOnly:e},autoComplete:"off",variant:"outlined",fullWidth:!0,value:o.blockletVersion||"",onChange:c=>{s({blockletVersion:""}),n({blockletVersion:c.target.value})},error:!!r.blockletVersion,helperText:r.blockletVersion||""}),t.jsx(Y,{label:l("blocklet.publish.releaseNote"),autoComplete:"off",disabled:i||e,variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:e,endAdornment:t.jsxs(Ve,{position:"end",children:[((a=o==null?void 0:o.note)==null?void 0:a.length)||0," / ",re.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:o.note||"",onChange:c=>{s({note:""}),n({note:c.target.value.slice(0,re.PROJECT.MAX_NOTE_LENGTH)})},error:!!r.note,helperText:r.note||"",sx:{mt:3}})]})})}ot.propTypes={readOnly:d.bool.isRequired,params:d.object.isRequired,setParams:d.func.isRequired,paramsErrTip:d.object.isRequired,setParamsErrTip:d.func.isRequired,loading:d.bool.isRequired};ot.defaultProps={};function Jn(e){for(const o in e)typeof e[o]=="string"?e[o]=e[o].replace(/\\\\/g,"\\"):typeof e[o]=="object"&&e[o]!==null&&Jn(e[o]);return e}function nt({index:e,item:o,dockerParams:n,setDockerParams:r,dataKey:s,t:i,readOnly:l}){const a=(o==null?void 0:o.value)||"",[c,f]=w.useState(!1),h=()=>{var q;(q=n[s])==null||q.splice(e,1),r({...n,[s]:[...n[s]]})},k=(q,M)=>{var m;(m=n[s])!=null&&m[e]&&(M?(n[s][e].custom=n[s][e].value,n[s][e].value=`$${pt(o.key)}`):(n[s][e].value=n[s][e].custom||"",n[s][e].custom="")),r({...n,[s]:[...n[s]]})},x=(q,M)=>{var y;const m=((y=n[s][e])==null?void 0:y.value)||"";n[s][e]={...n[s][e],secure:M,value:M&&m===re.BLOCKLET_AUTOMATIC_ENV_VALUE?"":m},r({...n,[s]:[...n[s]]})},p=(q,M)=>{n[s][e]={...n[s][e],shared:M},r({...n,[s]:[...n[s]]})},j=(q,M)=>{var y;const m=((y=n[s][e])==null?void 0:y.value)||"";n[s][e]={...n[s][e],required:M,value:M&&m===re.BLOCKLET_AUTOMATIC_ENV_VALUE?"":m},r({...n,[s]:[...n[s]]})},v=(q,M)=>{n[s][e]={...n[s][e],value:M?re.BLOCKLET_AUTOMATIC_ENV_VALUE:"",secure:!1,required:!1},r({...n,[s]:[...n[s]]})},I=q=>{n[s][e]={...n[s][e],description:q.target.value},r({...n,[s]:[...n[s]]})},g=q=>{const M=q.target.value==="web"?"web":"docker";M==="web"&&n.dockerArgs.forEach(L=>{L.type="docker"});const y=`/${n.dockerImage.replace(/\W/g,"-")}-${e}`;n.dockerArgs[e]={...n.dockerArgs[e],type:M,path:M==="docker"?y:"/",protocol:"http",prefix:M==="docker"?y:"/",name:"publicUrl",port:"BLOCKLET_PORT"},r({...n,dockerArgs:[...n.dockerArgs]})},b=q=>{const M=q.target.value;n[s][e]={...n[s][e],prefix:M,path:M==="*"?"/":M},r({...n,[s]:[...n[s]]})},C=q=>{var M;(M=n[s])!=null&&M[e]&&(n[s][e].value=q.target.value),r({...n,[s]:[...n[s]]})},_=a===`$${pt(o.key)}`||o.custom,T=s==="dockerArgs"&&!cn[o.key],D=Ns[o.key],$=s==="dockerEnvs",R=o.key==="--publish";let A=o.key;return R&&o.type==="web"?A="--publish (Web)":$&&(A=`--env ${o.key}`),t.jsxs(u,{sx:{display:"flex",flexDirection:"row",gap:2,alignItems:"center"},children:[t.jsx(u,{sx:{width:250},children:t.jsx(O,{sx:{textOverflow:"ellipsis",width:"100%",overflow:"hidden"},children:A})}),t.jsxs(u,{sx:{display:"flex",flexDirection:"column",gap:1,flex:1},children:[t.jsx(Y,{disabled:l||_||T||o.value===re.BLOCKLET_AUTOMATIC_ENV_VALUE,placeholder:"",value:_?`$${pt(o.key)}`:a,sx:{flex:1},InputProps:{endAdornment:t.jsxs(Ve,{position:"end",sx:{zoom:.9},children:[(!(D||T)||$||R)&&t.jsx(oe,{onClick:()=>f(!0),children:t.jsx(ne,{icon:"icon-park-outline:setting-config"})}),!l&&t.jsx(oe,{onClick:h,color:T?"error":"default",children:t.jsx(ne,{icon:"ic:round-delete"})})]})},error:T,onChange:C}),T&&t.jsx(O,{variant:"caption",color:"error",children:i("blocklet.publish.docker.noAllowTheArg")}),o.key==="--publish"&&t.jsx(O,{variant:"caption",color:"text.secondary",children:i("blocklet.publish.docker.publishTips")}),o.key==="--volume"&&As[o.key](a)&&t.jsx(O,{variant:"caption",color:"error",children:i("blocklet.publish.docker.volumeTips")})]}),c&&t.jsx(Tt,{open:!0,fullWidth:!0,maxWidth:"sm",PaperProps:{style:{minHeight:0}},title:i($?"blocklet.publish.docker.modifyEnv":"blocklet.publish.docker.modifyParam"),onClose:()=>f(!1),children:t.jsxs(u,{sx:{display:"flex",flexDirection:"column",gap:1,paddingBottom:2},children:[D||T||$?null:t.jsxs(u,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[t.jsx(O,{children:i("blocklet.publish.docker.needCustomInput")}),t.jsx(ye,{disabled:l,checked:_,onChange:k,sx:{zoom:.9}})]}),$&&t.jsxs(u,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[t.jsx(O,{children:i("blocklet.publish.docker.shared")}),t.jsx(ye,{disabled:l,checked:o.shared,onChange:p,sx:{zoom:.9}})]}),$&&t.jsxs(u,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[t.jsx(O,{children:i("blocklet.publish.docker.required")}),t.jsx(ye,{disabled:l,checked:o.required,onChange:j,sx:{zoom:.9}})]}),$&&t.jsxs(u,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[t.jsx(O,{children:i("blocklet.publish.docker.secure")}),t.jsx(ye,{disabled:l,checked:o.secure,onChange:x,sx:{zoom:.9}})]}),$&&t.jsxs(u,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[t.jsx(O,{children:i("blocklet.publish.docker.autoGenerated")}),t.jsx(ye,{disabled:l,checked:o.value===re.BLOCKLET_AUTOMATIC_ENV_VALUE,onChange:v,sx:{zoom:.9}})]}),$&&t.jsxs(u,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[t.jsx(O,{sx:{flex:1},children:i("blocklet.publish.docker.description")}),t.jsx(Y,{disabled:l,value:o.description,onChange:I,sx:{flex:1},label:i("blocklet.publish.docker.description")})]}),R&&t.jsxs(u,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[t.jsx(O,{sx:{flex:1},children:i("blocklet.publish.docker.portType")}),t.jsxs(Ko,{value:o.type||"docker",onChange:g,children:[t.jsx(ue,{value:"docker",children:"Docker"}),t.jsx(ue,{value:"web",children:"Web"})]})]}),R&&o.type==="web"&&t.jsxs(u,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[t.jsx(O,{sx:{flex:1},children:i("blocklet.publish.docker.prefix")}),t.jsx(Y,{disabled:l,value:o.prefix,onChange:b,sx:{flex:1},label:i("blocklet.publish.docker.prefix")})]})]})})]})}nt.propTypes={dockerParams:d.object.isRequired,setDockerParams:d.func.isRequired,dataKey:d.string.isRequired,item:d.object.isRequired,t:d.func.isRequired,readOnly:d.bool.isRequired,index:d.number.isRequired};nt.defaultProps={};const Vl=`
181
181
  docker run --name postgrest
182
182
  -p 3000:3000
183
183
  -e PGRST_DB_URI="postgres://username:password@host:port/database"
@@ -1,4 +1,4 @@
1
- import{r as H,t as ei,g as ti,e as Ur,a as ri}from"./vendor-react-DoD83n6N.js";import{a1 as hn,j as i,a3 as se,bF as Jt,bG as er,aK as tr,ak as jt,T as qe,M as Et,a2 as nt,bo as sr,ad as rt,E as B,aa as Te,a4 as ut,v as ni,x as gn,aG as ii,bi as oi,bj as ai,I as si,aE as ci,aI as li,bM as ui}from"./vendor-mui-core-Dh3XBxY7.js";import{p as Ie,B as rr,b as nr,U as fi,ap as di,n as qr,x as pi,y as mi}from"./vendor-utils-oUOK1Lc7.js";import{c as hi}from"./index-tUQxVYYQ.js";import{a0 as yn,b5 as ft,b6 as gi,b7 as yi,b8 as bn,b9 as bi,ba as vi,bb as xi,bc as vn,bd as wi,be as cr,bf as ji,bg as Ei,bh as Si,bi as Pi,o as lr,b4 as xn,m as Ci,n as Oi,e as _e,D as wn,E as Ai,a8 as Ge,a3 as je,av as Ii,_ as Ri,ag as Ni,a2 as dt,j as Ke,a1 as Ti,bj as jn,b as Ye,aw as En,bk as _i,aE as Di,ao as Ui,aI as qi,aX as Sn,ab as Li,aY as Pn,aQ as Cn,bl as ki,bm as Bi}from"./vendor-arcblock-Bv04Mkff.js";import{d as St}from"./Add-Cip-Q3Dt.js";import{d as Ki}from"./ViewList-BZ5ZAyNP.js";import{L as Fi,S as $i,d as On}from"./list-header-ZN_SAqiN.js";import{a0 as Mi,f as zi,z as Ce,ar as ur,m as Qe,a1 as Vi,O as Xe,as as Wi,h as Ze,C as An,at as In,b as Hi}from"./index-CpfGTKUf.js";import{z as Gi,u as fr,a as Rn,l as Yi}from"./vendor-hooks-DlxYXMPL.js";import{u as De,d as Lr,W as Nn}from"./dashboard-DyGi-puS.js";import{W as Pt}from"./did-address-nBrtfdFs.js";import{P as Be}from"./permission-DfwAG69G.js";import{C as Rt}from"./click-to-copy-_PxhgXLr.js";import{f as Fe}from"./format-error-LAoTjvJe.js";import{_ as Zi}from"./useAsync-HJBQVHgn.js";import{I as Pe}from"./index-DPFaqs63.js";import{d as Qi}from"./DeleteOutline-f6Nb7LK2.js";import{C as pt}from"./confirm-D9nnIOvs.js";import{u as mt}from"./session-BqpWYLN3.js";import{i as Tn,a as Ct,p as _n}from"./util-b7UGzXHn.js";import{b as Xi}from"./sdk-BAIH7jDs.js";import{p as Ji}from"./index-Cszfyf7Q.js";import{A as eo}from"./actions-B1PhmGqt.js";import{S as to}from"./shorten-label-DXP5M5GB.js";import"./useLocalStorage-Cd_KRSFh.js";import"./PlayArrow-BtE24rss.js";import"./get-safe-url-DnoVfY5w.js";import"./index-Y6bMeXBB.js";import"./useAsyncRetry-ru9OmM2c.js";import"./InfoOutlined-B6WkOk1K.js";import"./useSetState-BL3ktMon.js";import"./base32-BaFZoAVl.js";import"./MoreHoriz-CdM4YEUS.js";var dr={},ro=hn;Object.defineProperty(dr,"__esModule",{value:!0});var Dn=dr.default=void 0,no=ro(yn()),io=i;Dn=dr.default=(0,no.default)((0,io.jsx)("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8m0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4z"}),"Loop");var pr={};Object.defineProperty(pr,"__esModule",{value:!0});var Un=pr.default=void 0;oo(H);var et=i;function oo(e){return e&&e.__esModule?e:{default:e}}function kr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Br(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?kr(Object(r),!0).forEach(function(n){ao(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ao(e,t,r){return(t=so(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function so(e){var t=co(e,"string");return typeof t=="symbol"?t:t+""}function co(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var mr=function(t){return(0,et.jsxs)("svg",Br(Br({},t),{},{children:[(0,et.jsx)("g",{clipPath:"url(#clip0)",children:(0,et.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.99997 1.59778C8.19071 1.59778 7.39961 1.83775 6.72673 2.28736C6.05385 2.73697 5.5294 3.37601 5.21971 4.12367C4.91001 4.87134 4.82898 5.69405 4.98686 6.48777C5.14474 7.28149 5.53444 8.01056 6.10668 8.5828C6.67892 9.15504 7.408 9.54474 8.20172 9.70262C8.99544 9.8605 9.81815 9.77947 10.5658 9.46978C11.3135 9.16009 11.9525 8.63564 12.4021 7.96276C12.8517 7.28987 13.0917 6.49878 13.0917 5.68951C13.0917 4.60432 12.6606 3.56357 11.8933 2.79622C11.1259 2.02887 10.0852 1.59778 8.99997 1.59778ZM7.27426 3.9638C7.73195 3.50611 8.35271 3.24899 8.99997 3.24899C9.48266 3.24899 9.95452 3.39212 10.3559 3.66029C10.7572 3.92846 11.07 4.30962 11.2547 4.75556C11.4394 5.20151 11.4878 5.69222 11.3936 6.16563C11.2994 6.63905 11.067 7.07391 10.7257 7.41522C10.3844 7.75654 9.94951 7.98897 9.4761 8.08314C9.00268 8.17731 8.51197 8.12898 8.06603 7.94426C7.62008 7.75954 7.23892 7.44674 6.97075 7.04539C6.70258 6.64405 6.55945 6.1722 6.55945 5.68951C6.55945 5.04224 6.81658 4.42149 7.27426 3.9638ZM7.36691 10.3075C6.28172 10.3075 5.24097 10.7385 4.47362 11.5059C3.70627 12.2732 3.27518 13.314 3.27518 14.3992V17.121C3.27518 17.2763 3.4011 17.4022 3.55643 17.4022H4.64514C4.80047 17.4022 4.92639 17.2763 4.92639 17.121V14.3992C4.92639 13.7519 5.18351 13.1312 5.6412 12.6735C6.09889 12.2158 6.71964 11.9587 7.36691 11.9587H10.633C10.9535 11.9587 11.2709 12.0218 11.567 12.1444C11.8631 12.2671 12.1321 12.4469 12.3588 12.6735C12.5854 12.9001 12.7651 13.1691 12.8878 13.4652C13.0104 13.7613 13.0736 14.0787 13.0736 14.3992V17.121C13.0736 17.2763 13.1995 17.4022 13.3548 17.4022H14.4435C14.5989 17.4022 14.7248 17.2763 14.7248 17.121V14.3992C14.7248 13.314 14.2937 12.2732 13.5263 11.5059C12.759 10.7385 11.7182 10.3075 10.633 10.3075H7.36691Z"})}),(0,et.jsx)("defs",{children:(0,et.jsx)("clipPath",{id:"clip0",children:(0,et.jsx)("rect",{width:"18",height:"18",transform:"translate(0 0.5)"})})})]}))};mr.defaultProps={width:"18",height:"19",viewBox:"0 0 18 19",xmlns:"http://www.w3.org/2000/svg"};mr.displayName="person";Un=pr.default=mr;var xt={},lo=e=>encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),qn="%[a-f0-9]{2}",Kr=new RegExp("("+qn+")|([^%]+?)","gi"),Fr=new RegExp("("+qn+")+","gi");function ir(e,t){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;t=t||1;var r=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],ir(r),ir(n))}function uo(e){try{return decodeURIComponent(e)}catch{for(var t=e.match(Kr)||[],r=1;r<t.length;r++)e=ir(t,r).join(""),t=e.match(Kr)||[];return e}}function fo(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},r=Fr.exec(e);r;){try{t[r[0]]=decodeURIComponent(r[0])}catch{var n=uo(r[0]);n!==r[0]&&(t[r[0]]=n)}r=Fr.exec(e)}t["%C2"]="�";for(var s=Object.keys(t),l=0;l<s.length;l++){var h=s[l];e=e.replace(new RegExp(h,"g"),t[h])}return e}var po=function(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch{return fo(e)}},mo=(e,t)=>{if(!(typeof e=="string"&&typeof t=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(t==="")return[e];const r=e.indexOf(t);return r===-1?[e]:[e.slice(0,r),e.slice(r+t.length)]},ho=function(e,t){for(var r={},n=Object.keys(e),s=Array.isArray(t),l=0;l<n.length;l++){var h=n[l],C=e[h];(s?t.indexOf(h)!==-1:t(h,C,e))&&(r[h]=C)}return r};(function(e){const t=lo,r=po,n=mo,s=ho,l=a=>a==null;function h(a){switch(a.arrayFormat){case"index":return o=>(u,f)=>{const g=u.length;return f===void 0||a.skipNull&&f===null||a.skipEmptyString&&f===""?u:f===null?[...u,[x(o,a),"[",g,"]"].join("")]:[...u,[x(o,a),"[",x(g,a),"]=",x(f,a)].join("")]};case"bracket":return o=>(u,f)=>f===void 0||a.skipNull&&f===null||a.skipEmptyString&&f===""?u:f===null?[...u,[x(o,a),"[]"].join("")]:[...u,[x(o,a),"[]=",x(f,a)].join("")];case"comma":case"separator":return o=>(u,f)=>f==null||f.length===0?u:u.length===0?[[x(o,a),"=",x(f,a)].join("")]:[[u,x(f,a)].join(a.arrayFormatSeparator)];default:return o=>(u,f)=>f===void 0||a.skipNull&&f===null||a.skipEmptyString&&f===""?u:f===null?[...u,x(o,a)]:[...u,[x(o,a),"=",x(f,a)].join("")]}}function C(a){let o;switch(a.arrayFormat){case"index":return(u,f,g)=>{if(o=/\[(\d*)\]$/.exec(u),u=u.replace(/\[\d*\]$/,""),!o){g[u]=f;return}g[u]===void 0&&(g[u]={}),g[u][o[1]]=f};case"bracket":return(u,f,g)=>{if(o=/(\[\])$/.exec(u),u=u.replace(/\[\]$/,""),!o){g[u]=f;return}if(g[u]===void 0){g[u]=[f];return}g[u]=[].concat(g[u],f)};case"comma":case"separator":return(u,f,g)=>{const T=typeof f=="string"&&f.includes(a.arrayFormatSeparator),S=typeof f=="string"&&!T&&b(f,a).includes(a.arrayFormatSeparator);f=S?b(f,a):f;const X=T||S?f.split(a.arrayFormatSeparator).map(Z=>b(Z,a)):f===null?f:b(f,a);g[u]=X};default:return(u,f,g)=>{if(g[u]===void 0){g[u]=f;return}g[u]=[].concat(g[u],f)}}}function j(a){if(typeof a!="string"||a.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function x(a,o){return o.encode?o.strict?t(a):encodeURIComponent(a):a}function b(a,o){return o.decode?r(a):a}function _(a){return Array.isArray(a)?a.sort():typeof a=="object"?_(Object.keys(a)).sort((o,u)=>Number(o)-Number(u)).map(o=>a[o]):a}function E(a){const o=a.indexOf("#");return o!==-1&&(a=a.slice(0,o)),a}function P(a){let o="";const u=a.indexOf("#");return u!==-1&&(o=a.slice(u)),o}function d(a){a=E(a);const o=a.indexOf("?");return o===-1?"":a.slice(o+1)}function k(a,o){return o.parseNumbers&&!Number.isNaN(Number(a))&&typeof a=="string"&&a.trim()!==""?a=Number(a):o.parseBooleans&&a!==null&&(a.toLowerCase()==="true"||a.toLowerCase()==="false")&&(a=a.toLowerCase()==="true"),a}function w(a,o){o=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},o),j(o.arrayFormatSeparator);const u=C(o),f=Object.create(null);if(typeof a!="string"||(a=a.trim().replace(/^[?#&]/,""),!a))return f;for(const g of a.split("&")){if(g==="")continue;let[T,S]=n(o.decode?g.replace(/\+/g," "):g,"=");S=S===void 0?null:["comma","separator"].includes(o.arrayFormat)?S:b(S,o),u(b(T,o),S,f)}for(const g of Object.keys(f)){const T=f[g];if(typeof T=="object"&&T!==null)for(const S of Object.keys(T))T[S]=k(T[S],o);else f[g]=k(T,o)}return o.sort===!1?f:(o.sort===!0?Object.keys(f).sort():Object.keys(f).sort(o.sort)).reduce((g,T)=>{const S=f[T];return S&&typeof S=="object"&&!Array.isArray(S)?g[T]=_(S):g[T]=S,g},Object.create(null))}e.extract=d,e.parse=w,e.stringify=(a,o)=>{if(!a)return"";o=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},o),j(o.arrayFormatSeparator);const u=S=>o.skipNull&&l(a[S])||o.skipEmptyString&&a[S]==="",f=h(o),g={};for(const S of Object.keys(a))u(S)||(g[S]=a[S]);const T=Object.keys(g);return o.sort!==!1&&T.sort(o.sort),T.map(S=>{const X=a[S];return X===void 0?"":X===null?x(S,o):Array.isArray(X)?X.reduce(f(S),[]).join("&"):x(S,o)+"="+x(X,o)}).filter(S=>S.length>0).join("&")},e.parseUrl=(a,o)=>{o=Object.assign({decode:!0},o);const[u,f]=n(a,"#");return Object.assign({url:u.split("?")[0]||"",query:w(d(a),o)},o&&o.parseFragmentIdentifier&&f?{fragmentIdentifier:b(f,o)}:{})},e.stringifyUrl=(a,o)=>{o=Object.assign({encode:!0,strict:!0},o);const u=E(a.url).split("?")[0]||"",f=e.extract(a.url),g=e.parse(f,{sort:!1}),T=Object.assign(g,a.query);let S=e.stringify(T,o);S&&(S=`?${S}`);let X=P(a.url);return a.fragmentIdentifier&&(X=`#${x(a.fragmentIdentifier,o)}`),`${u}${S}${X}`},e.pick=(a,o,u)=>{u=Object.assign({parseFragmentIdentifier:!0},u);const{url:f,query:g,fragmentIdentifier:T}=e.parseUrl(a,u);return e.stringifyUrl({url:f,query:s(g,o),fragmentIdentifier:T},u)},e.exclude=(a,o,u)=>{const f=Array.isArray(o)?g=>!o.includes(g):(g,T)=>!o(g,T);return e.pick(a,f,u)}})(xt);const st=ei,go={parseNumbers:!1,parseBooleans:!1},yo={skipNull:!1,skipEmptyString:!1},bo=(e,t)=>{var r,n;const{navigateMode:s="push",parseOptions:l,stringifyOptions:h}={},C=Object.assign(Object.assign({},go),l),j=Object.assign(Object.assign({},yo),h),x=st.useLocation(),b=(r=st.useHistory)===null||r===void 0?void 0:r.call(st),_=(n=st.useNavigate)===null||n===void 0?void 0:n.call(st),E=Gi(),P=H.useRef(typeof e=="function"?e():e||{}),d=H.useMemo(()=>xt.parse(x.search,C),[x.search]),k=H.useMemo(()=>Object.assign(Object.assign({},P.current),d),[d]);return[k,fr(a=>{const o=typeof a=="function"?a(k):a;E(),b&&b[s]({hash:x.hash,search:xt.stringify(Object.assign(Object.assign({},d),o),j)||"?"},x.state),_&&_({hash:x.hash,search:xt.stringify(Object.assign(Object.assign({},d),o),j)||"?"},{replace:s==="replace",state:x.state})})]},vo=bo;var qt={exports:{}},Lt={},$r;function Ln(){if($r)return Lt;$r=1;function e(o){"@babel/helpers - typeof";return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},e(o)}function t(o,u,f){return Object.defineProperty(o,"prototype",{writable:!1}),o}function r(o,u){if(!(o instanceof u))throw new TypeError("Cannot call a class as a function")}function n(o,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");o.prototype=Object.create(u&&u.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,"prototype",{writable:!1}),u&&s(o,u)}function s(o,u){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(g,T){return g.__proto__=T,g},s(o,u)}function l(o){var u=j();return function(){var g=x(o),T;if(u){var S=x(this).constructor;T=Reflect.construct(g,arguments,S)}else T=g.apply(this,arguments);return h(this,T)}}function h(o,u){if(u&&(e(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return C(o)}function C(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}function j(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function x(o){return x=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(f){return f.__proto__||Object.getPrototypeOf(f)},x(o)}var b={},_,E;function P(o,u,f){f||(f=Error);function g(S,X,Z){return typeof u=="string"?u:u(S,X,Z)}var T=function(S){n(Z,S);var X=l(Z);function Z(G,Y,F){var V;return r(this,Z),V=X.call(this,g(G,Y,F)),V.code=o,V}return t(Z)}(f);b[o]=T}function d(o,u){if(Array.isArray(o)){var f=o.length;return o=o.map(function(g){return String(g)}),f>2?"one of ".concat(u," ").concat(o.slice(0,f-1).join(", "),", or ")+o[f-1]:f===2?"one of ".concat(u," ").concat(o[0]," or ").concat(o[1]):"of ".concat(u," ").concat(o[0])}else return"of ".concat(u," ").concat(String(o))}function k(o,u,f){return o.substr(0,u.length)===u}function w(o,u,f){return(f===void 0||f>o.length)&&(f=o.length),o.substring(f-u.length,f)===u}function a(o,u,f){return typeof f!="number"&&(f=0),f+u.length>o.length?!1:o.indexOf(u,f)!==-1}return P("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),P("ERR_INVALID_ARG_TYPE",function(o,u,f){_===void 0&&(_=or()),_(typeof o=="string","'name' must be a string");var g;typeof u=="string"&&k(u,"not ")?(g="must not be",u=u.replace(/^not /,"")):g="must be";var T;if(w(o," argument"))T="The ".concat(o," ").concat(g," ").concat(d(u,"type"));else{var S=a(o,".")?"property":"argument";T='The "'.concat(o,'" ').concat(S," ").concat(g," ").concat(d(u,"type"))}return T+=". Received type ".concat(e(f)),T},TypeError),P("ERR_INVALID_ARG_VALUE",function(o,u){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";E===void 0&&(E=ft);var g=E.inspect(u);return g.length>128&&(g="".concat(g.slice(0,128),"...")),"The argument '".concat(o,"' ").concat(f,". Received ").concat(g)},TypeError),P("ERR_INVALID_RETURN_VALUE",function(o,u,f){var g;return f&&f.constructor&&f.constructor.name?g="instance of ".concat(f.constructor.name):g="type ".concat(e(f)),"Expected ".concat(o,' to be returned from the "').concat(u,'"')+" function but got ".concat(g,".")},TypeError),P("ERR_MISSING_ARGS",function(){for(var o=arguments.length,u=new Array(o),f=0;f<o;f++)u[f]=arguments[f];_===void 0&&(_=or()),_(u.length>0,"At least one arg needs to be specified");var g="The ",T=u.length;switch(u=u.map(function(S){return'"'.concat(S,'"')}),T){case 1:g+="".concat(u[0]," argument");break;case 2:g+="".concat(u[0]," and ").concat(u[1]," arguments");break;default:g+=u.slice(0,T-1).join(", "),g+=", and ".concat(u[T-1]," arguments");break}return"".concat(g," must be specified")},TypeError),Lt.codes=b,Lt}var kt,Mr;function xo(){if(Mr)return kt;Mr=1;function e(O,A){var K=Object.keys(O);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(O);A&&(R=R.filter(function(W){return Object.getOwnPropertyDescriptor(O,W).enumerable})),K.push.apply(K,R)}return K}function t(O){for(var A=1;A<arguments.length;A++){var K=arguments[A]!=null?arguments[A]:{};A%2?e(Object(K),!0).forEach(function(R){r(O,R,K[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(O,Object.getOwnPropertyDescriptors(K)):e(Object(K)).forEach(function(R){Object.defineProperty(O,R,Object.getOwnPropertyDescriptor(K,R))})}return O}function r(O,A,K){return A=h(A),A in O?Object.defineProperty(O,A,{value:K,enumerable:!0,configurable:!0,writable:!0}):O[A]=K,O}function n(O,A){if(!(O instanceof A))throw new TypeError("Cannot call a class as a function")}function s(O,A){for(var K=0;K<A.length;K++){var R=A[K];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(O,h(R.key),R)}}function l(O,A,K){return A&&s(O.prototype,A),Object.defineProperty(O,"prototype",{writable:!1}),O}function h(O){var A=C(O,"string");return o(A)==="symbol"?A:String(A)}function C(O,A){if(o(O)!=="object"||O===null)return O;var K=O[Symbol.toPrimitive];if(K!==void 0){var R=K.call(O,A||"default");if(o(R)!=="object")return R;throw new TypeError("@@toPrimitive must return a primitive value.")}return(A==="string"?String:Number)(O)}function j(O,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function");O.prototype=Object.create(A&&A.prototype,{constructor:{value:O,writable:!0,configurable:!0}}),Object.defineProperty(O,"prototype",{writable:!1}),A&&w(O,A)}function x(O){var A=d();return function(){var R=a(O),W;if(A){var y=a(this).constructor;W=Reflect.construct(R,arguments,y)}else W=R.apply(this,arguments);return b(this,W)}}function b(O,A){if(A&&(o(A)==="object"||typeof A=="function"))return A;if(A!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _(O)}function _(O){if(O===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O}function E(O){var A=typeof Map=="function"?new Map:void 0;return E=function(R){if(R===null||!k(R))return R;if(typeof R!="function")throw new TypeError("Super expression must either be null or a function");if(typeof A<"u"){if(A.has(R))return A.get(R);A.set(R,W)}function W(){return P(R,arguments,a(this).constructor)}return W.prototype=Object.create(R.prototype,{constructor:{value:W,enumerable:!1,writable:!0,configurable:!0}}),w(W,R)},E(O)}function P(O,A,K){return d()?P=Reflect.construct.bind():P=function(W,y,p){var v=[null];v.push.apply(v,y);var D=Function.bind.apply(W,v),N=new D;return p&&w(N,p.prototype),N},P.apply(null,arguments)}function d(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function k(O){return Function.toString.call(O).indexOf("[native code]")!==-1}function w(O,A){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(R,W){return R.__proto__=W,R},w(O,A)}function a(O){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(K){return K.__proto__||Object.getPrototypeOf(K)},a(O)}function o(O){"@babel/helpers - typeof";return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(A){return typeof A}:function(A){return A&&typeof Symbol=="function"&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},o(O)}var u=ft,f=u.inspect,g=Ln(),T=g.codes.ERR_INVALID_ARG_TYPE;function S(O,A,K){return(K===void 0||K>O.length)&&(K=O.length),O.substring(K-A.length,K)===A}function X(O,A){if(A=Math.floor(A),O.length==0||A==0)return"";var K=O.length*A;for(A=Math.floor(Math.log(A)/Math.log(2));A;)O+=O,A--;return O+=O.substring(0,K-O.length),O}var Z="",G="",Y="",F="",V={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},be=10;function Q(O){var A=Object.keys(O),K=Object.create(Object.getPrototypeOf(O));return A.forEach(function(R){K[R]=O[R]}),Object.defineProperty(K,"message",{value:O.message}),K}function de(O){return f(O,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function xe(O,A,K){var R="",W="",y=0,p="",v=!1,D=de(O),N=D.split(`
1
+ import{r as H,t as ei,g as ti,e as Ur,a as ri}from"./vendor-react-DoD83n6N.js";import{a1 as hn,j as i,a3 as se,bF as Jt,bG as er,aK as tr,ak as jt,T as qe,M as Et,a2 as nt,bo as sr,ad as rt,E as B,aa as Te,a4 as ut,v as ni,x as gn,aG as ii,bi as oi,bj as ai,I as si,aE as ci,aI as li,bM as ui}from"./vendor-mui-core-Dh3XBxY7.js";import{p as Ie,B as rr,b as nr,U as fi,ap as di,n as qr,x as pi,y as mi}from"./vendor-utils-oUOK1Lc7.js";import{c as hi}from"./index-tUQxVYYQ.js";import{a0 as yn,b5 as ft,b6 as gi,b7 as yi,b8 as bn,b9 as bi,ba as vi,bb as xi,bc as vn,bd as wi,be as cr,bf as ji,bg as Ei,bh as Si,bi as Pi,o as lr,b4 as xn,m as Ci,n as Oi,e as _e,D as wn,E as Ai,a8 as Ge,a3 as je,av as Ii,_ as Ri,ag as Ni,a2 as dt,j as Ke,a1 as Ti,bj as jn,b as Ye,aw as En,bk as _i,aE as Di,ao as Ui,aI as qi,aX as Sn,ab as Li,aY as Pn,aQ as Cn,bl as ki,bm as Bi}from"./vendor-arcblock-Bv04Mkff.js";import{d as St}from"./Add-Cip-Q3Dt.js";import{d as Ki}from"./ViewList-BZ5ZAyNP.js";import{L as Fi,S as $i,d as On}from"./list-header-ZN_SAqiN.js";import{a0 as Mi,f as zi,z as Ce,ar as ur,m as Qe,a1 as Vi,O as Xe,as as Wi,h as Ze,C as An,at as In,b as Hi}from"./index-0m-J-ZAX.js";import{z as Gi,u as fr,a as Rn,l as Yi}from"./vendor-hooks-DlxYXMPL.js";import{u as De,d as Lr,W as Nn}from"./dashboard-DdkKjU2L.js";import{W as Pt}from"./did-address-nBrtfdFs.js";import{P as Be}from"./permission-DfwAG69G.js";import{C as Rt}from"./click-to-copy-_PxhgXLr.js";import{f as Fe}from"./format-error-LAoTjvJe.js";import{_ as Zi}from"./useAsync-HJBQVHgn.js";import{I as Pe}from"./index-DPFaqs63.js";import{d as Qi}from"./DeleteOutline-f6Nb7LK2.js";import{C as pt}from"./confirm-Di8Vvymn.js";import{u as mt}from"./session-BqpWYLN3.js";import{i as Tn,a as Ct,p as _n}from"./util-b7UGzXHn.js";import{b as Xi}from"./sdk-BAIH7jDs.js";import{p as Ji}from"./index-Wl7uu5xS.js";import{A as eo}from"./actions-B1PhmGqt.js";import{S as to}from"./shorten-label-DXP5M5GB.js";import"./useLocalStorage-Cd_KRSFh.js";import"./PlayArrow-BtE24rss.js";import"./get-safe-url-DnoVfY5w.js";import"./index-8Xn_gix_.js";import"./useAsyncRetry-ru9OmM2c.js";import"./InfoOutlined-B6WkOk1K.js";import"./useSetState-BL3ktMon.js";import"./base32-BaFZoAVl.js";import"./MoreHoriz-CdM4YEUS.js";var dr={},ro=hn;Object.defineProperty(dr,"__esModule",{value:!0});var Dn=dr.default=void 0,no=ro(yn()),io=i;Dn=dr.default=(0,no.default)((0,io.jsx)("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8m0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4z"}),"Loop");var pr={};Object.defineProperty(pr,"__esModule",{value:!0});var Un=pr.default=void 0;oo(H);var et=i;function oo(e){return e&&e.__esModule?e:{default:e}}function kr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Br(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?kr(Object(r),!0).forEach(function(n){ao(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ao(e,t,r){return(t=so(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function so(e){var t=co(e,"string");return typeof t=="symbol"?t:t+""}function co(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var mr=function(t){return(0,et.jsxs)("svg",Br(Br({},t),{},{children:[(0,et.jsx)("g",{clipPath:"url(#clip0)",children:(0,et.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.99997 1.59778C8.19071 1.59778 7.39961 1.83775 6.72673 2.28736C6.05385 2.73697 5.5294 3.37601 5.21971 4.12367C4.91001 4.87134 4.82898 5.69405 4.98686 6.48777C5.14474 7.28149 5.53444 8.01056 6.10668 8.5828C6.67892 9.15504 7.408 9.54474 8.20172 9.70262C8.99544 9.8605 9.81815 9.77947 10.5658 9.46978C11.3135 9.16009 11.9525 8.63564 12.4021 7.96276C12.8517 7.28987 13.0917 6.49878 13.0917 5.68951C13.0917 4.60432 12.6606 3.56357 11.8933 2.79622C11.1259 2.02887 10.0852 1.59778 8.99997 1.59778ZM7.27426 3.9638C7.73195 3.50611 8.35271 3.24899 8.99997 3.24899C9.48266 3.24899 9.95452 3.39212 10.3559 3.66029C10.7572 3.92846 11.07 4.30962 11.2547 4.75556C11.4394 5.20151 11.4878 5.69222 11.3936 6.16563C11.2994 6.63905 11.067 7.07391 10.7257 7.41522C10.3844 7.75654 9.94951 7.98897 9.4761 8.08314C9.00268 8.17731 8.51197 8.12898 8.06603 7.94426C7.62008 7.75954 7.23892 7.44674 6.97075 7.04539C6.70258 6.64405 6.55945 6.1722 6.55945 5.68951C6.55945 5.04224 6.81658 4.42149 7.27426 3.9638ZM7.36691 10.3075C6.28172 10.3075 5.24097 10.7385 4.47362 11.5059C3.70627 12.2732 3.27518 13.314 3.27518 14.3992V17.121C3.27518 17.2763 3.4011 17.4022 3.55643 17.4022H4.64514C4.80047 17.4022 4.92639 17.2763 4.92639 17.121V14.3992C4.92639 13.7519 5.18351 13.1312 5.6412 12.6735C6.09889 12.2158 6.71964 11.9587 7.36691 11.9587H10.633C10.9535 11.9587 11.2709 12.0218 11.567 12.1444C11.8631 12.2671 12.1321 12.4469 12.3588 12.6735C12.5854 12.9001 12.7651 13.1691 12.8878 13.4652C13.0104 13.7613 13.0736 14.0787 13.0736 14.3992V17.121C13.0736 17.2763 13.1995 17.4022 13.3548 17.4022H14.4435C14.5989 17.4022 14.7248 17.2763 14.7248 17.121V14.3992C14.7248 13.314 14.2937 12.2732 13.5263 11.5059C12.759 10.7385 11.7182 10.3075 10.633 10.3075H7.36691Z"})}),(0,et.jsx)("defs",{children:(0,et.jsx)("clipPath",{id:"clip0",children:(0,et.jsx)("rect",{width:"18",height:"18",transform:"translate(0 0.5)"})})})]}))};mr.defaultProps={width:"18",height:"19",viewBox:"0 0 18 19",xmlns:"http://www.w3.org/2000/svg"};mr.displayName="person";Un=pr.default=mr;var xt={},lo=e=>encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),qn="%[a-f0-9]{2}",Kr=new RegExp("("+qn+")|([^%]+?)","gi"),Fr=new RegExp("("+qn+")+","gi");function ir(e,t){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;t=t||1;var r=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],ir(r),ir(n))}function uo(e){try{return decodeURIComponent(e)}catch{for(var t=e.match(Kr)||[],r=1;r<t.length;r++)e=ir(t,r).join(""),t=e.match(Kr)||[];return e}}function fo(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},r=Fr.exec(e);r;){try{t[r[0]]=decodeURIComponent(r[0])}catch{var n=uo(r[0]);n!==r[0]&&(t[r[0]]=n)}r=Fr.exec(e)}t["%C2"]="�";for(var s=Object.keys(t),l=0;l<s.length;l++){var h=s[l];e=e.replace(new RegExp(h,"g"),t[h])}return e}var po=function(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch{return fo(e)}},mo=(e,t)=>{if(!(typeof e=="string"&&typeof t=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(t==="")return[e];const r=e.indexOf(t);return r===-1?[e]:[e.slice(0,r),e.slice(r+t.length)]},ho=function(e,t){for(var r={},n=Object.keys(e),s=Array.isArray(t),l=0;l<n.length;l++){var h=n[l],C=e[h];(s?t.indexOf(h)!==-1:t(h,C,e))&&(r[h]=C)}return r};(function(e){const t=lo,r=po,n=mo,s=ho,l=a=>a==null;function h(a){switch(a.arrayFormat){case"index":return o=>(u,f)=>{const g=u.length;return f===void 0||a.skipNull&&f===null||a.skipEmptyString&&f===""?u:f===null?[...u,[x(o,a),"[",g,"]"].join("")]:[...u,[x(o,a),"[",x(g,a),"]=",x(f,a)].join("")]};case"bracket":return o=>(u,f)=>f===void 0||a.skipNull&&f===null||a.skipEmptyString&&f===""?u:f===null?[...u,[x(o,a),"[]"].join("")]:[...u,[x(o,a),"[]=",x(f,a)].join("")];case"comma":case"separator":return o=>(u,f)=>f==null||f.length===0?u:u.length===0?[[x(o,a),"=",x(f,a)].join("")]:[[u,x(f,a)].join(a.arrayFormatSeparator)];default:return o=>(u,f)=>f===void 0||a.skipNull&&f===null||a.skipEmptyString&&f===""?u:f===null?[...u,x(o,a)]:[...u,[x(o,a),"=",x(f,a)].join("")]}}function C(a){let o;switch(a.arrayFormat){case"index":return(u,f,g)=>{if(o=/\[(\d*)\]$/.exec(u),u=u.replace(/\[\d*\]$/,""),!o){g[u]=f;return}g[u]===void 0&&(g[u]={}),g[u][o[1]]=f};case"bracket":return(u,f,g)=>{if(o=/(\[\])$/.exec(u),u=u.replace(/\[\]$/,""),!o){g[u]=f;return}if(g[u]===void 0){g[u]=[f];return}g[u]=[].concat(g[u],f)};case"comma":case"separator":return(u,f,g)=>{const T=typeof f=="string"&&f.includes(a.arrayFormatSeparator),S=typeof f=="string"&&!T&&b(f,a).includes(a.arrayFormatSeparator);f=S?b(f,a):f;const X=T||S?f.split(a.arrayFormatSeparator).map(Z=>b(Z,a)):f===null?f:b(f,a);g[u]=X};default:return(u,f,g)=>{if(g[u]===void 0){g[u]=f;return}g[u]=[].concat(g[u],f)}}}function j(a){if(typeof a!="string"||a.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function x(a,o){return o.encode?o.strict?t(a):encodeURIComponent(a):a}function b(a,o){return o.decode?r(a):a}function _(a){return Array.isArray(a)?a.sort():typeof a=="object"?_(Object.keys(a)).sort((o,u)=>Number(o)-Number(u)).map(o=>a[o]):a}function E(a){const o=a.indexOf("#");return o!==-1&&(a=a.slice(0,o)),a}function P(a){let o="";const u=a.indexOf("#");return u!==-1&&(o=a.slice(u)),o}function d(a){a=E(a);const o=a.indexOf("?");return o===-1?"":a.slice(o+1)}function k(a,o){return o.parseNumbers&&!Number.isNaN(Number(a))&&typeof a=="string"&&a.trim()!==""?a=Number(a):o.parseBooleans&&a!==null&&(a.toLowerCase()==="true"||a.toLowerCase()==="false")&&(a=a.toLowerCase()==="true"),a}function w(a,o){o=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},o),j(o.arrayFormatSeparator);const u=C(o),f=Object.create(null);if(typeof a!="string"||(a=a.trim().replace(/^[?#&]/,""),!a))return f;for(const g of a.split("&")){if(g==="")continue;let[T,S]=n(o.decode?g.replace(/\+/g," "):g,"=");S=S===void 0?null:["comma","separator"].includes(o.arrayFormat)?S:b(S,o),u(b(T,o),S,f)}for(const g of Object.keys(f)){const T=f[g];if(typeof T=="object"&&T!==null)for(const S of Object.keys(T))T[S]=k(T[S],o);else f[g]=k(T,o)}return o.sort===!1?f:(o.sort===!0?Object.keys(f).sort():Object.keys(f).sort(o.sort)).reduce((g,T)=>{const S=f[T];return S&&typeof S=="object"&&!Array.isArray(S)?g[T]=_(S):g[T]=S,g},Object.create(null))}e.extract=d,e.parse=w,e.stringify=(a,o)=>{if(!a)return"";o=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},o),j(o.arrayFormatSeparator);const u=S=>o.skipNull&&l(a[S])||o.skipEmptyString&&a[S]==="",f=h(o),g={};for(const S of Object.keys(a))u(S)||(g[S]=a[S]);const T=Object.keys(g);return o.sort!==!1&&T.sort(o.sort),T.map(S=>{const X=a[S];return X===void 0?"":X===null?x(S,o):Array.isArray(X)?X.reduce(f(S),[]).join("&"):x(S,o)+"="+x(X,o)}).filter(S=>S.length>0).join("&")},e.parseUrl=(a,o)=>{o=Object.assign({decode:!0},o);const[u,f]=n(a,"#");return Object.assign({url:u.split("?")[0]||"",query:w(d(a),o)},o&&o.parseFragmentIdentifier&&f?{fragmentIdentifier:b(f,o)}:{})},e.stringifyUrl=(a,o)=>{o=Object.assign({encode:!0,strict:!0},o);const u=E(a.url).split("?")[0]||"",f=e.extract(a.url),g=e.parse(f,{sort:!1}),T=Object.assign(g,a.query);let S=e.stringify(T,o);S&&(S=`?${S}`);let X=P(a.url);return a.fragmentIdentifier&&(X=`#${x(a.fragmentIdentifier,o)}`),`${u}${S}${X}`},e.pick=(a,o,u)=>{u=Object.assign({parseFragmentIdentifier:!0},u);const{url:f,query:g,fragmentIdentifier:T}=e.parseUrl(a,u);return e.stringifyUrl({url:f,query:s(g,o),fragmentIdentifier:T},u)},e.exclude=(a,o,u)=>{const f=Array.isArray(o)?g=>!o.includes(g):(g,T)=>!o(g,T);return e.pick(a,f,u)}})(xt);const st=ei,go={parseNumbers:!1,parseBooleans:!1},yo={skipNull:!1,skipEmptyString:!1},bo=(e,t)=>{var r,n;const{navigateMode:s="push",parseOptions:l,stringifyOptions:h}={},C=Object.assign(Object.assign({},go),l),j=Object.assign(Object.assign({},yo),h),x=st.useLocation(),b=(r=st.useHistory)===null||r===void 0?void 0:r.call(st),_=(n=st.useNavigate)===null||n===void 0?void 0:n.call(st),E=Gi(),P=H.useRef(typeof e=="function"?e():e||{}),d=H.useMemo(()=>xt.parse(x.search,C),[x.search]),k=H.useMemo(()=>Object.assign(Object.assign({},P.current),d),[d]);return[k,fr(a=>{const o=typeof a=="function"?a(k):a;E(),b&&b[s]({hash:x.hash,search:xt.stringify(Object.assign(Object.assign({},d),o),j)||"?"},x.state),_&&_({hash:x.hash,search:xt.stringify(Object.assign(Object.assign({},d),o),j)||"?"},{replace:s==="replace",state:x.state})})]},vo=bo;var qt={exports:{}},Lt={},$r;function Ln(){if($r)return Lt;$r=1;function e(o){"@babel/helpers - typeof";return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},e(o)}function t(o,u,f){return Object.defineProperty(o,"prototype",{writable:!1}),o}function r(o,u){if(!(o instanceof u))throw new TypeError("Cannot call a class as a function")}function n(o,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");o.prototype=Object.create(u&&u.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,"prototype",{writable:!1}),u&&s(o,u)}function s(o,u){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(g,T){return g.__proto__=T,g},s(o,u)}function l(o){var u=j();return function(){var g=x(o),T;if(u){var S=x(this).constructor;T=Reflect.construct(g,arguments,S)}else T=g.apply(this,arguments);return h(this,T)}}function h(o,u){if(u&&(e(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return C(o)}function C(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}function j(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function x(o){return x=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(f){return f.__proto__||Object.getPrototypeOf(f)},x(o)}var b={},_,E;function P(o,u,f){f||(f=Error);function g(S,X,Z){return typeof u=="string"?u:u(S,X,Z)}var T=function(S){n(Z,S);var X=l(Z);function Z(G,Y,F){var V;return r(this,Z),V=X.call(this,g(G,Y,F)),V.code=o,V}return t(Z)}(f);b[o]=T}function d(o,u){if(Array.isArray(o)){var f=o.length;return o=o.map(function(g){return String(g)}),f>2?"one of ".concat(u," ").concat(o.slice(0,f-1).join(", "),", or ")+o[f-1]:f===2?"one of ".concat(u," ").concat(o[0]," or ").concat(o[1]):"of ".concat(u," ").concat(o[0])}else return"of ".concat(u," ").concat(String(o))}function k(o,u,f){return o.substr(0,u.length)===u}function w(o,u,f){return(f===void 0||f>o.length)&&(f=o.length),o.substring(f-u.length,f)===u}function a(o,u,f){return typeof f!="number"&&(f=0),f+u.length>o.length?!1:o.indexOf(u,f)!==-1}return P("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),P("ERR_INVALID_ARG_TYPE",function(o,u,f){_===void 0&&(_=or()),_(typeof o=="string","'name' must be a string");var g;typeof u=="string"&&k(u,"not ")?(g="must not be",u=u.replace(/^not /,"")):g="must be";var T;if(w(o," argument"))T="The ".concat(o," ").concat(g," ").concat(d(u,"type"));else{var S=a(o,".")?"property":"argument";T='The "'.concat(o,'" ').concat(S," ").concat(g," ").concat(d(u,"type"))}return T+=". Received type ".concat(e(f)),T},TypeError),P("ERR_INVALID_ARG_VALUE",function(o,u){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";E===void 0&&(E=ft);var g=E.inspect(u);return g.length>128&&(g="".concat(g.slice(0,128),"...")),"The argument '".concat(o,"' ").concat(f,". Received ").concat(g)},TypeError),P("ERR_INVALID_RETURN_VALUE",function(o,u,f){var g;return f&&f.constructor&&f.constructor.name?g="instance of ".concat(f.constructor.name):g="type ".concat(e(f)),"Expected ".concat(o,' to be returned from the "').concat(u,'"')+" function but got ".concat(g,".")},TypeError),P("ERR_MISSING_ARGS",function(){for(var o=arguments.length,u=new Array(o),f=0;f<o;f++)u[f]=arguments[f];_===void 0&&(_=or()),_(u.length>0,"At least one arg needs to be specified");var g="The ",T=u.length;switch(u=u.map(function(S){return'"'.concat(S,'"')}),T){case 1:g+="".concat(u[0]," argument");break;case 2:g+="".concat(u[0]," and ").concat(u[1]," arguments");break;default:g+=u.slice(0,T-1).join(", "),g+=", and ".concat(u[T-1]," arguments");break}return"".concat(g," must be specified")},TypeError),Lt.codes=b,Lt}var kt,Mr;function xo(){if(Mr)return kt;Mr=1;function e(O,A){var K=Object.keys(O);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(O);A&&(R=R.filter(function(W){return Object.getOwnPropertyDescriptor(O,W).enumerable})),K.push.apply(K,R)}return K}function t(O){for(var A=1;A<arguments.length;A++){var K=arguments[A]!=null?arguments[A]:{};A%2?e(Object(K),!0).forEach(function(R){r(O,R,K[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(O,Object.getOwnPropertyDescriptors(K)):e(Object(K)).forEach(function(R){Object.defineProperty(O,R,Object.getOwnPropertyDescriptor(K,R))})}return O}function r(O,A,K){return A=h(A),A in O?Object.defineProperty(O,A,{value:K,enumerable:!0,configurable:!0,writable:!0}):O[A]=K,O}function n(O,A){if(!(O instanceof A))throw new TypeError("Cannot call a class as a function")}function s(O,A){for(var K=0;K<A.length;K++){var R=A[K];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(O,h(R.key),R)}}function l(O,A,K){return A&&s(O.prototype,A),Object.defineProperty(O,"prototype",{writable:!1}),O}function h(O){var A=C(O,"string");return o(A)==="symbol"?A:String(A)}function C(O,A){if(o(O)!=="object"||O===null)return O;var K=O[Symbol.toPrimitive];if(K!==void 0){var R=K.call(O,A||"default");if(o(R)!=="object")return R;throw new TypeError("@@toPrimitive must return a primitive value.")}return(A==="string"?String:Number)(O)}function j(O,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function");O.prototype=Object.create(A&&A.prototype,{constructor:{value:O,writable:!0,configurable:!0}}),Object.defineProperty(O,"prototype",{writable:!1}),A&&w(O,A)}function x(O){var A=d();return function(){var R=a(O),W;if(A){var y=a(this).constructor;W=Reflect.construct(R,arguments,y)}else W=R.apply(this,arguments);return b(this,W)}}function b(O,A){if(A&&(o(A)==="object"||typeof A=="function"))return A;if(A!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _(O)}function _(O){if(O===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O}function E(O){var A=typeof Map=="function"?new Map:void 0;return E=function(R){if(R===null||!k(R))return R;if(typeof R!="function")throw new TypeError("Super expression must either be null or a function");if(typeof A<"u"){if(A.has(R))return A.get(R);A.set(R,W)}function W(){return P(R,arguments,a(this).constructor)}return W.prototype=Object.create(R.prototype,{constructor:{value:W,enumerable:!1,writable:!0,configurable:!0}}),w(W,R)},E(O)}function P(O,A,K){return d()?P=Reflect.construct.bind():P=function(W,y,p){var v=[null];v.push.apply(v,y);var D=Function.bind.apply(W,v),N=new D;return p&&w(N,p.prototype),N},P.apply(null,arguments)}function d(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function k(O){return Function.toString.call(O).indexOf("[native code]")!==-1}function w(O,A){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(R,W){return R.__proto__=W,R},w(O,A)}function a(O){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(K){return K.__proto__||Object.getPrototypeOf(K)},a(O)}function o(O){"@babel/helpers - typeof";return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(A){return typeof A}:function(A){return A&&typeof Symbol=="function"&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},o(O)}var u=ft,f=u.inspect,g=Ln(),T=g.codes.ERR_INVALID_ARG_TYPE;function S(O,A,K){return(K===void 0||K>O.length)&&(K=O.length),O.substring(K-A.length,K)===A}function X(O,A){if(A=Math.floor(A),O.length==0||A==0)return"";var K=O.length*A;for(A=Math.floor(Math.log(A)/Math.log(2));A;)O+=O,A--;return O+=O.substring(0,K-O.length),O}var Z="",G="",Y="",F="",V={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},be=10;function Q(O){var A=Object.keys(O),K=Object.create(Object.getPrototypeOf(O));return A.forEach(function(R){K[R]=O[R]}),Object.defineProperty(K,"message",{value:O.message}),K}function de(O){return f(O,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function xe(O,A,K){var R="",W="",y=0,p="",v=!1,D=de(O),N=D.split(`
2
2
  `),q=de(A).split(`
3
3
  `),$=0,ne="";if(K==="strictEqual"&&o(O)==="object"&&o(A)==="object"&&O!==null&&A!==null&&(K="strictEqualObject"),N.length===1&&q.length===1&&N[0]!==q[0]){var ue=N[0].length+q[0].length;if(ue<=be){if((o(O)!=="object"||O===null)&&(o(A)!=="object"||A===null)&&(O!==0||A!==0))return"".concat(V[K],`
4
4