@abtnode/blocklet-services 1.16.42-beta-20250416-010627-a89e72e0 → 1.16.42

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 (81) hide show
  1. package/dist/assets/{access-control-7Ih10vY9.js → access-control-URJ2ACEE.js} +1 -1
  2. package/dist/assets/{add-component-core-DRJSzr-6.js → add-component-core-YuQ3TiFu.js} +1 -1
  3. package/dist/assets/{add-resource-VgacdokL.js → add-resource-DJW7iUoP.js} +1 -1
  4. package/dist/assets/{advanced-a-1InjKG.js → advanced-6m9VnipD.js} +1 -1
  5. package/dist/assets/{appearance-BWtF9DZd.js → appearance-Ks2n1JJ9.js} +1 -1
  6. package/dist/assets/{audit-logs-DqFf6jS-.js → audit-logs-CyUffLP5.js} +1 -1
  7. package/dist/assets/{authorize-BKpxW7YW.js → authorize-DCUCKc1-.js} +1 -1
  8. package/dist/assets/{branding-DoPxX3nU.js → branding-Cag0aDCR.js} +2 -2
  9. package/dist/assets/{branding--Qk4aIi4.js → branding-Dv6KIot-.js} +1 -1
  10. package/dist/assets/{bundle-avatar-DNxC8z4b.js → bundle-avatar-CSEBu3MU.js} +1 -1
  11. package/dist/assets/{complete-Cnzbqj4O.js → complete-BorStSwi.js} +1 -1
  12. package/dist/assets/{component-BBRNk4Tr.js → component-CGuQ2QSk.js} +1 -1
  13. package/dist/assets/{config-Ba-WdcGO.js → config-Co9p5iPr.js} +1 -1
  14. package/dist/assets/{config-navigation-CDw3CW3J.js → config-navigation-aTpclkWb.js} +3 -3
  15. package/dist/assets/{config-space-CSSDG-WO.js → config-space-Bc3ndGw-.js} +1 -1
  16. package/dist/assets/{confirm-BX8_-j-l.js → confirm-Fhl5qi_m.js} +1 -1
  17. package/dist/assets/{connect-ByA6PdRd.js → connect-Dds1wvN9.js} +1 -1
  18. package/dist/assets/connect-DigT1D00.js +5 -0
  19. package/dist/assets/{connect-to-yIsMDJbM.js → connect-to-BMDSElVg.js} +1 -1
  20. package/dist/assets/{dashboard-oxsbu66O.js → dashboard-D3KvORmC.js} +3 -3
  21. package/dist/assets/{delete-confirm-C0cAQSXq.js → delete-confirm-Dtzz6Jaz.js} +1 -1
  22. package/dist/assets/domain-BSF-ZwXV.js +9 -0
  23. package/dist/assets/{domain-action-card-BKzC5bbv.js → domain-action-card-ZJ-cQ-aa.js} +2 -2
  24. package/dist/assets/domains-DjSbrUlR.js +1 -0
  25. package/dist/assets/{email-B9kMynU0.js → email-zgArXfS8.js} +1 -1
  26. package/dist/assets/{exchange-passport-CgO3iLVh.js → exchange-passport-O7J_1njm.js} +1 -1
  27. package/dist/assets/{fuel-C6fpJHcg.js → fuel-BFFqH-nX.js} +1 -1
  28. package/dist/assets/{gen-access-key-jNw5st5h.js → gen-access-key-DhAGvo8z.js} +1 -1
  29. package/dist/assets/{index-B64a4BbE.js → index-BLv5CM0y.js} +3 -3
  30. package/dist/assets/{index-C1H5SEVx.js → index-BVgoikAb.js} +1 -1
  31. package/dist/assets/{index-DKLLCs8G.js → index-Bv-pwUe7.js} +1 -1
  32. package/dist/assets/{index-DIckhHU5.js → index-Bx2tzf6d.js} +1 -1
  33. package/dist/assets/{index-8Co4tmLR.js → index-C0Yvp1nU.js} +4 -4
  34. package/dist/assets/{index-BSlpaPEE.js → index-C4aiK5ag.js} +1 -1
  35. package/dist/assets/{index-Cv9H4C1K.js → index-C6B-01xU.js} +1 -1
  36. package/dist/assets/{index-tjRN_EVx.js → index-CWohFZPl.js} +2 -2
  37. package/dist/assets/{index-EBUaBME3.js → index-CuQlnfwu.js} +1 -1
  38. package/dist/assets/{index-CNl-IhR2.js → index-DHEDtVhz.js} +1 -1
  39. package/dist/assets/{index-B5bNvBjf.js → index-DWue5FZ4.js} +1 -1
  40. package/dist/assets/{index-BP62CTBB.js → index-DkIEu7Lb.js} +1 -1
  41. package/dist/assets/{index-PfRsNX8F.js → index-DwLhvC8N.js} +1 -1
  42. package/dist/assets/{index-DyO7bYXp.js → index-GP_jFykV.js} +1 -1
  43. package/dist/assets/{index-BS5tohCn.js → index-bQ-8RhFL.js} +1 -1
  44. package/dist/assets/{index-CyBxUW5e.js → index-uHTdpm71.js} +1 -1
  45. package/dist/assets/{invitation-DVbBeS8B.js → invitation-D6DHxZjO.js} +1 -1
  46. package/dist/assets/{invite-t8rB5ZWZ.js → invite-DIncZ5ep.js} +1 -1
  47. package/dist/assets/{issue-passport-CSlA5ioP.js → issue-passport-DBIo8EtU.js} +1 -1
  48. package/dist/assets/{item--dgEgBvz.js → item-D8zBx1dJ.js} +1 -1
  49. package/dist/assets/{layout-B4YOjaNK.js → layout-DbKPqvnm.js} +1 -1
  50. package/dist/assets/{list-Bny5F0T2.js → list-BTx_8ZHD.js} +1 -1
  51. package/dist/assets/{log-CP1_Zl5R.js → log-BKrMj0yE.js} +1 -1
  52. package/dist/assets/{login-C8k7kmim.js → login-3U6j8E6s.js} +1 -1
  53. package/dist/assets/{logo-uploader-zhddoC5p.js → logo-uploader-CcwN1uWX.js} +2 -2
  54. package/dist/assets/{lost-passport-Croi_0xR.js → lost-passport-BbPQj08X.js} +1 -1
  55. package/dist/assets/{overview-C8MR_9r7.js → overview-DFc4LXLh.js} +1 -1
  56. package/dist/assets/{passport-item-DDktLU4q.js → passport-item-BEGCAq1O.js} +1 -1
  57. package/dist/assets/{publish-resource-tDbEc2CN.js → publish-resource-CrvVpn2O.js} +1 -1
  58. package/dist/assets/{relative-time-DESntOZH.js → relative-time-BBLaQUJf.js} +1 -1
  59. package/dist/assets/{runtime-8Gq50HDL.js → runtime-A09BTZXh.js} +1 -1
  60. package/dist/assets/{security-CRd92J54.js → security-DM8YTbEj.js} +1 -1
  61. package/dist/assets/setup-Bb0ZZK40.js +19 -0
  62. package/dist/assets/{start-Df0wvo1-.js → start-BrRd22Kx.js} +1 -1
  63. package/dist/assets/{status-D7e11K9q.js → status-Cyln1yDP.js} +1 -1
  64. package/dist/assets/{step-actions-BAf7tRyq.js → step-actions-BnMmi82x.js} +1 -1
  65. package/dist/assets/{traffic-Brsh4OZD.js → traffic-CjCHxLye.js} +1 -1
  66. package/dist/assets/{transfer-CBAuvpGA.js → transfer-BYeu2CqJ.js} +1 -1
  67. package/dist/assets/{unsubscribe-Cyuj6w2n.js → unsubscribe-D7OPmQBG.js} +1 -1
  68. package/dist/assets/useAsync-DKE0K0bz.js +1 -0
  69. package/dist/assets/{useAsyncRetry-k063P8TB.js → useAsyncRetry-BBomZj1z.js} +2 -2
  70. package/dist/assets/{user-center-DOyIfHWq.js → user-center-BdWhBs4v.js} +1 -1
  71. package/dist/assets/{util-C9b90o5T.js → util-rMFbd0lA.js} +1 -1
  72. package/dist/assets/{wrap-locale--aKPMOdK.js → wrap-locale-DgmlMdxX.js} +1 -1
  73. package/dist/index.html +1 -1
  74. package/dist/service-worker.js +1 -1
  75. package/package.json +21 -21
  76. package/dist/assets/connect-DBfZH_8M.js +0 -5
  77. package/dist/assets/domain-BB7h2xMD.js +0 -9
  78. package/dist/assets/domains-CQPZJx98.js +0 -1
  79. package/dist/assets/setup-DXwqTfxV.js +0 -19
  80. package/dist/assets/useAsync-BmW5cnbx.js +0 -1
  81. package/dist/assets/useAsync-DkPaceIy.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-B64a4BbE.js","assets/vendor-ux-did-connect-CiLSrCOH.js","assets/vendor-react-DoD83n6N.js","assets/vendor-utils-CTIzdAFg.js","assets/vendor-mui-core-DxD1UA4o.js","assets/vendor-hooks-BwVH-TAd.js","assets/lottie-web-B6s7dDoL.js","assets/vendor-ux-did-connect-2GapMFC4.css","assets/vendor-arcblock-BtlDhznp.js","assets/index-C-7MyHbp.js","assets/index-tjRN_EVx.js","assets/index-tUQxVYYQ.js","assets/index-AgKpYdvC.css"])))=>i.map(i=>d[i]);
2
- import{r as j,k as gt,l as tt,L as xe,g as Rs,u as vs,h as Cs,i as ct}from"./vendor-react-DoD83n6N.js";import{a8 as ke,j as e,v as Le,aa as c,bl as wo,H as i,ab as me,I as ce,T as L,c0 as So,D as ot,ag as ge,au as ws,bO as Ge,aj as Io,bs as Xe,bw as ht,y as ne,a9 as Ye,P as Do,G as To,w as jt,a6 as _o,M as Po,q as fe,X as Ss,ai as $o,t as qo,bR as Is,N as Ve,z as Lo,O as se,ak as Se,av as Ds,L as Ts,A as _s,b5 as Ps,U as No,W as Qe,bB as $s,bC as qs,c1 as Ls,c2 as Ns,bn as ft,bo as As,bq as Es,bu as zs,bv as at}from"./vendor-mui-core-DxD1UA4o.js";import{z as ye,C as Ee,aa as Bs,a2 as Os,f as ro,ab as lo}from"./index-tjRN_EVx.js";import{r as Re,p as Y,u as oe,bM as Ao,l as Ws,B as Me,b3 as Eo,V as zo,b1 as Bo,am as Ms,bN as Vs,a5 as kt,Y as U,a1 as Us,h as ae,bO as Fs,b6 as Hs,g as qe,ak as yt,aq as Js}from"./vendor-ux-did-connect-CiLSrCOH.js";import{B as Rt,c as ue,l as Gs,I as Xs,_ as Oo,J as De,p as Ys}from"./vendor-arcblock-BtlDhznp.js";import{d as Qs}from"./Error-BnWmSZ5k.js";import{C as vt}from"./confirm-BX8_-j-l.js";import{u as Ue}from"./session-DaQ4KCFD.js";import{W as io}from"./did-address-GAxLGeWB.js";import{E as Fe}from"./empty-spinner-Ict2ItjU.js";import{B as Ct}from"./bundle-avatar-DNxC8z4b.js";import{S as je}from"./shorten-label-CwDvu4_S.js";import{L as wt}from"./list-header-Bm8u_Z_p.js";import{Z as Zs,y as be,I as St,D as Wo}from"./vendor-utils-CTIzdAFg.js";import{d as Ks}from"./Download-B0rKRcTB.js";import{C as Mo}from"./click-to-copy-Cygm8U3_.js";import{Q as en}from"./QuestionMarkCircle-B4EnwYju.js";import{u as tn}from"./vendor-hooks-BwVH-TAd.js";import{_ as Ie}from"./useSetState-BL3ktMon.js";import{c as It}from"./index-tUQxVYYQ.js";import{E as Dt}from"./index-D1fVmwHN.js";import"./api-3sG9at7i.js";import{d as on}from"./ChevronRight-CO9My6tF.js";import{T as sn,a as nn}from"./vendor-mui-x-Bit8yv3W.js";import{d as co}from"./DeleteOutline-7AloJjcV.js";import{D as ao,C as uo,P as po}from"./react-beautiful-dnd.esm-BQ3hEDNY.js";import{c as rn,A as Vo,u as ln,S as cn,U as an,a as dt,b as Uo,n as dn,e as un,f as ho,g as pn,h as hn}from"./item--dgEgBvz.js";import{d as fn}from"./ArrowDropDown-DO9H_COV.js";import{f as Ne}from"./format-error-LAoTjvJe.js";import{d as bn}from"./Launch-CIC8rZgo.js";import{M as xn}from"./index-O2l0NSUF.js";import{r as mn}from"./index-DkPKxdcu.js";import{d as gn}from"./Done-BXISjL2g.js";import"./lottie-web-B6s7dDoL.js";import"./raf-schd.esm-GV-XhwE0.js";import"./delete-confirm-C0cAQSXq.js";import"./get-safe-url-ZRaKUVld.js";var Tt={},jn=ke;Object.defineProperty(Tt,"__esModule",{value:!0});var Fo=Tt.default=void 0,kn=jn(Re()),yn=e;Fo=Tt.default=(0,kn.default)((0,yn.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 _t={},Rn=ke;Object.defineProperty(_t,"__esModule",{value:!0});var Ho=_t.default=void 0,vn=Rn(Re()),Cn=e;Ho=_t.default=(0,vn.default)((0,Cn.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 Pt={},wn=ke;Object.defineProperty(Pt,"__esModule",{value:!0});var Jo=Pt.default=void 0,Sn=wn(Re()),In=e;Jo=Pt.default=(0,Sn.default)((0,In.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 $t({did:t,projectId:o,title:s,logo:r,describe:l}){const n=`${`${Y.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${t}/${o}/logo/upload`}/${r}`,[u,d]=j.useState(!1),f=Le(x=>x.breakpoints.down("md"));return e.jsxs(c,{sx:{display:"flex",flexDirection:"row",color:u?"primary.main":"grey.900",gap:1},onPointerEnter:()=>d(!0),onPointerLeave:()=>d(!1),children:[e.jsx(wo,{sx:{borderRadius:1},src:n}),e.jsxs(c,{children:[e.jsx(je,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:f?"primary.main":""},children:s||"/"}),e.jsx(je,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:f||u?"primary.main":"grey.700"},children:l||"/"})]})]})}$t.propTypes={projectId:i.string.isRequired,did:i.string.isRequired,title:i.string.isRequired,logo:i.string.isRequired,describe:i.string.isRequired};function qt({initUrl:t}){const o=gt(),s=(t==null?void 0:t.searchParams.get("tenantScope"))||"",{t:r,locale:l}=oe(),{api:a}=ye(),{api:n}=Ue(),[u,d]=j.useState(!0),{blocklet:f}=Ee(),[x,S]=j.useState(null),[C,p]=j.useState(!1),h=Le(g=>g.breakpoints.down("xl")),R=Le(g=>g.breakpoints.down("md")),{componentDid:w=""}=tt(),[k,I]=j.useState(null),v=`publish-${f.meta.did}`,D=Ao(v),[_,q]=j.useState({searchText:D.searchText||"",pageSize:D.rowsPerPage||10,page:1}),E=()=>{a.getProjects({input:{did:f.meta.did,componentDid:w,tenantScope:s}}).then(g=>{const N=(g==null?void 0:g.projects)||[];d(!1),I(N)}).catch(g=>{d(!1),U.error(g.message)})},M=()=>{o(`${Y.UNOWNED_DID}/create/none`,{replace:!0})},$=g=>{S(g)},Q=()=>{d(!1),p(!0)},O=()=>{p(!1),S(null)},m=g=>{U.error(g.message),p(!1),S(null)},b=g=>{if(!(g!=null&&g.deleted)){U.error("Delete project failed");return}E(),p(!1),S(null)};j.useEffect(()=>{E()},[]);const y=j.useMemo(()=>{var N;if(!_.searchText)return k;let g=(N=_.searchText)==null?void 0:N.trim();return g?(g=Ws.toAddress(g).toLocaleLowerCase(),k.filter(H=>H.blockletTitle.toLowerCase().includes(g)||H.blockletDid.toLowerCase().includes(g))):k},[k,_.searchText]);if(!k&&u)return e.jsx(c,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:e.jsx(Fe,{})});if(!k)return null;if(!k.length)return e.jsxs(c,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[e.jsx(c,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:r("blocklet.publish.blockletEmptyTip")}),e.jsx(c,{sx:{fontSize:14,color:"text.secondary",mb:3},children:r("blocklet.publish.createBlockletTip")}),e.jsx(Me,{onClick:M,variant:"contained",children:r("blocklet.publish.createBlocklet")})]});const W=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:g=>{const N=k[g];return e.jsx(xe,{to:`${N.id}`,children:e.jsx($t,{did:f.meta.did,projectId:N.id,logo:N.blockletLogo,title:N.blockletTitle,describe:N.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{searchable:!1,customBodyRender:g=>g?e.jsx(Eo,{type:"success",children:g}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:g=>g?e.jsx(io,{size:14,compact:!0,responsive:!1,did:g}):null}},h||w?null:{label:r("common.createdBy"),name:"createdBy",options:{customBodyRender:g=>g?e.jsx(io,{onClick:()=>{o(`/.well-known/service/admin/members?did=${g}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:g}):null}},h||w?null:{label:r("common.scope"),name:"componentDid",options:{customBodyRender:g=>{const N=(f.children||[]).find(H=>H.meta.did===g);return N?e.jsxs(c,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[e.jsx(Ct,{size:14,blocklet:N,ancestors:[f]}),e.jsx(c,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:N.meta.title})]},g):""}}},h||s?null:{label:r("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:g=>e.jsx(c,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:e.jsx(je,{children:g})})}},{label:r("common.updatedAt"),name:"updatedAt",options:{searchable:!1,customBodyRender:g=>e.jsx(zo,{value:Number(g),locale:l})}},{label:r("common.actions"),name:"actions",options:{searchable:!1,customBodyRenderLite:g=>{const N=k[g];return e.jsxs(c,{display:"flex",children:[e.jsx(xe,{to:`${N.id}/new-release/${N.lastReleaseId}`,children:e.jsx(me,{title:r("blocklet.publish.createRelease"),placement:"top",children:e.jsx(ce,{color:"primary","aria-label":"create",children:e.jsx(Fo,{style:{fontSize:18}})})})}),!!N.lastReleaseId&&e.jsx(me,{title:r("blocklet.publish.viewLastRelease",{name:N.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"secondary","aria-label":"create",children:e.jsx(xe,{style:{display:"flex"},to:`${N.id}/view/${N.lastReleaseId}`,children:e.jsx(Ho,{sx:{fontSize:18}})})})}),e.jsx(me,{title:r("blocklet.publish.delete",{name:N.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"primary","aria-label":"delete",onClick:()=>$(N),children:e.jsx(Bo,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),z=({page:g,rowsPerPage:N,searchText:H})=>{_.pageSize!==N?q(J=>({...J,searchText:"",pageSize:N,page:1})):_.page!==g+1?q(J=>({...J,searchText:"",page:g+1})):_.searchText!==H&&q(J=>({...J,searchText:H,page:1}))},G=C?e.jsx(Ms,{open:!0,popup:!0,onClose:O,action:"check-has-project-id",locale:l,checkFn:n.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:b,onError:m,extraParams:{projectId:x.id,did:f.meta.did,name:x.blockletTitle},messages:{title:r("blocklet.publish.deleteProject.title",{name:x.blockletTitle}),scan:r("blocklet.publish.deleteProject.scan",{name:x.blockletTitle}),confirm:r("blocklet.publish.deleteProject.confirm"),success:r("blocklet.publish.deleteProject.success")}}):null;return e.jsxs(c,{children:[e.jsx(wt,{sx:{mb:2},left:e.jsxs(c,{display:"flex",flexDirection:"row",alignItems:"center",children:[e.jsx(c,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:r("common.blockletStudio")}),e.jsx(me,{title:r("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:e.jsx(Jo,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(Vs,{options:{searchPlaceholder:r("blocklet.list.searchPlaceholder"),searchDebounceTime:600,searchAlwaysOpen:R},search:_.searchText,searchText:_.searchText,searchTextUpdate:g=>q(N=>({...N,searchText:g})),searchClose:()=>q(g=>({...g,searchText:""})),onSearchOpen:()=>{}}),e.jsxs(Me,{onClick:M,variant:"contained",children:[e.jsx(Rt,{style:{fontSize:"1.3em",marginRight:4}}),r("blocklet.publish.createBlocklet")]})]})}),e.jsx(kt,{className:"main-table",locale:l,data:y,columns:W,options:{search:!1,sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,searchAlwaysOpen:!0,rowsPerPageOptions:[10,20,50,100]},durable:v,onChange:z}),x&&e.jsx(vt,{title:`${r("common.delete")} ${x.blockletTitle}`,description:r("blocklet.publish.deleteProject.description"),confirm:r("common.confirm"),onConfirm:Q,onCancel:()=>S(null),children:e.jsx(c,{sx:{marginTop:2},children:[r("blocklet.publish.deleteProject.tip1"),r("blocklet.publish.deleteProject.tip2"),r("blocklet.publish.deleteProject.tip3")].map(g=>e.jsxs(c,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[e.jsx(Qs,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),e.jsx(L,{component:"span",variant:"inherit",color:"text.secondary",children:g})]}))})}),G]})}qt.propTypes={initUrl:i.object};qt.defaultProps={initUrl:null};var Lt={},Dn=ke;Object.defineProperty(Lt,"__esModule",{value:!0});var Go=Lt.default=void 0,Tn=Dn(Re()),fo=e;Go=Lt.default=(0,Tn.default)([(0,fo.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,fo.jsx)("path",{d:"m17 14 5-5-1.41-1.41L18 10.17V3h-2v7.17l-2.59-2.58L12 9z"},"1")],"InstallDesktop");const _n=(t,o)=>{if(!t)return"";try{return o?JSON.parse(t)[o]:JSON.parse(t)}catch{}return t},Xo=_n;function Pn(){var m;const{t,locale:o}=oe(),{projectId:s}=tt(),{api:r}=ye(),[l,a]=j.useState(!0),{blocklet:n}=Ee(),u=Le(b=>b.breakpoints.down("md")),[d,f]=j.useState(null),[x,S]=j.useState(null),[C,p]=j.useState(null),h=(m=window.env)==null?void 0:m.serverEndpoint,R=`releases-${n.meta.did}-${s}`,w=Ao(R),[k,I]=j.useState({searchText:w.searchText||"",pageSize:w.rowsPerPage||10,page:1}),v=()=>{r.getReleases({input:{did:n.meta.did,projectId:s}}).then(b=>{const y=(b==null?void 0:b.releases)||[];a(!1),f(y)}).catch(b=>{a(!1),U.error(b.message)})},D=()=>{r.doBatchQuery({getProject:{input:{did:n.meta.did,projectId:s}},getReleases:{input:{did:n.meta.did,projectId:s}}}).then(b=>{S(b.getProject.project||{}),f(b.getReleases.releases||[]),a(!1)}).catch(b=>{a(!1),U.error(b.message)})};j.useEffect(()=>{D()},[]);const[_,q]=j.useState(""),E=()=>{a(!1);const b=C.id;r.deleteRelease({input:{did:n.meta.did,projectId:s,releaseId:b}}).then(()=>{a(!1),v(),U.success(t("common.removeSuccess")),p(null)}).catch(y=>{a(!1),U.error(y.message)})},M=b=>{p(b)};if(!d&&l)return e.jsx(c,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:e.jsx(Fe,{})});if(!d)return null;const $=e.jsxs(So,{className:"breadcrumbs","aria-label":"breadcrumb",children:[e.jsx(xe,{to:"..",children:t("common.blockletStudio")}),e.jsx(L,{color:"text.primary",children:e.jsx(je,{maxLength:u?6:30,children:x.blockletTitle})})]});if(!d.length)return e.jsxs(e.Fragment,{children:[$,e.jsxs(c,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[e.jsx(c,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:t("blocklet.publish.releaseEmptyTip")}),e.jsx(c,{sx:{fontSize:14,color:"text.secondary",mb:3},children:t("blocklet.publish.createReleaseTip")}),e.jsx(xe,{to:"create/none",children:e.jsx(Me,{variant:"contained",children:t("blocklet.publish.createRelease")})})]})]});const Q=[{label:t("common.version"),name:"blockletVersion",minWidth:160,options:{customBodyRenderLite:b=>{const y=d[b];return e.jsx(xe,{to:`view/${y.id}`,children:e.jsx($t,{did:n.meta.did,projectId:x.id,logo:y.blockletLogo,title:y.blockletVersion,describe:y.blockletTitle})})}}},{label:t("blocklet.publish.releaseNote"),name:"note",options:{customBodyRenderLite:b=>{const y=d[b];return e.jsx(L,{className:"note",children:Xo(y.note,"note")})}}},{label:t("common.status"),name:"status",options:{customBodyRender:b=>e.jsx(Eo,{type:b==="published"?"success":"warning",children:b==="published"?"Released":Zs(b)})}},{label:t("common.lastPublishedAt"),name:"updatedAt",options:{customBodyRenderLite:b=>{const y=d[b];return y.status!==ue.PROJECT.RELEASE_STATUS.published?"":e.jsx(zo,{value:Number(y.updatedAt),locale:o})}}},{label:t("common.actions"),name:"actions",options:{customBodyRenderLite:b=>{var N;const y=d[b];let W="",z="";const G=y.status==="published";if(G){const H=be(h,`/api/project/${n.meta.did}/${x.id}/${x.lastReleaseId}/release/blocklet.json`),J=new URL(h);J.pathname=be(J.pathname,"/launch-blocklet/agreement"),J.searchParams.set("blocklet_meta_url",H),W=J.href,z=be(`${Y.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${n.meta.did}/${x.id}/${x.lastReleaseId}/download/${(x.lastReleaseFiles||[])[0]}`)}const g=(N=x.blockletComponents)!=null&&N.some(H=>H.included)||y.uploadedResource?"pack":"resource";return e.jsxs(c,{display:"flex",alignItems:"center",children:[G&&g==="pack"&&e.jsx(me,{title:t("blocklet.publish.install",{name:x.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"secondary","aria-label":"create",children:e.jsx("a",{style:{display:"flex"},href:W,target:"_blank",rel:"noreferrer",children:e.jsx(Go,{sx:{fontSize:18}})})})}),G&&e.jsx(me,{title:t("blocklet.publish.download",{name:x.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"primary","aria-label":"download",children:e.jsx("a",{style:{display:"flex"},href:z,children:e.jsx(Ks,{sx:{fontSize:18}})})})}),e.jsx(me,{title:t("blocklet.publish.delete",{name:x.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"primary","aria-label":"delete",onClick:()=>M(y),children:e.jsx(Bo,{sx:{fontSize:18}})})})]})}}}],O=({page:b,rowsPerPage:y,searchText:W})=>{k.pageSize!==y?I(z=>({...z,searchText:"",pageSize:y,page:1})):k.page!==b+1?I(z=>({...z,searchText:"",page:b+1})):k.searchText!==W&&I(z=>({...z,searchText:W,page:1}))};return e.jsxs($n,{children:[e.jsx(wt,{sx:{mb:2},left:$,actions:e.jsxs(e.Fragment,{children:[e.jsx(Me,{variant:"outlined",onClick:()=>{const b=be(h,`/api/project/${n.meta.did}/${s}/blocklet.json`);q(b)},children:t("blocklet.publish.copyInstallUrl")}),e.jsx(xe,{to:"new-release/none",children:e.jsxs(Me,{variant:"contained",children:[e.jsx(Rt,{style:{fontSize:"1.3em",marginRight:4}}),t("blocklet.publish.createRelease")]})})]})}),e.jsx(ot,{fullWidth:!0,maxWidth:"sm",open:_,onClose:()=>q(""),children:e.jsxs(c,{sx:{py:5,px:4,wordBreak:"break-all"},children:[e.jsx(L,{variant:"h6",sx:{mb:2},children:t("blocklet.publish.installResourceTip")}),e.jsx(Mo,{children:_}),e.jsxs(L,{sx:{mt:2},children:[t("blocklet.publish.installResourceTip2"),e.jsx("a",{style:{marginLeft:4},href:"https://www.arcblock.io/docs/blocklet-developer/how-to-use-install-url",target:"_blank",rel:"noreferrer",children:t("blocklet.publish.installResourceHelp")})]})]})}),e.jsx(kt,{className:"main-table",verticalKeyWidth:100,locale:o,data:d,columns:Q,durable:R,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1},onChange:O}),C&&e.jsx(vt,{title:t(`${t("common.delete")} ${C.blockletVersion}`),description:t("blocklet.publish.deleteReleaseTip"),confirm:t("common.confirm"),onConfirm:E,onCancel:()=>p(null)})]})}const $n=ge(c)`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BLv5CM0y.js","assets/vendor-ux-did-connect-CiLSrCOH.js","assets/vendor-react-DoD83n6N.js","assets/vendor-utils-CTIzdAFg.js","assets/vendor-mui-core-DxD1UA4o.js","assets/vendor-hooks-BwVH-TAd.js","assets/lottie-web-B6s7dDoL.js","assets/vendor-ux-did-connect-2GapMFC4.css","assets/vendor-arcblock-BtlDhznp.js","assets/index-C-7MyHbp.js","assets/index-CWohFZPl.js","assets/index-tUQxVYYQ.js","assets/index-AgKpYdvC.css"])))=>i.map(i=>d[i]);
2
+ import{r as j,k as gt,l as tt,L as xe,g as Rs,u as vs,h as Cs,i as ct}from"./vendor-react-DoD83n6N.js";import{a8 as ke,j as e,v as Le,aa as c,bl as wo,H as i,ab as me,I as ce,T as L,c0 as So,D as ot,ag as ge,au as ws,bO as Ge,aj as Io,bs as Xe,bw as ht,y as ne,a9 as Ye,P as Do,G as To,w as jt,a6 as _o,M as Po,q as fe,X as Ss,ai as $o,t as qo,bR as Is,N as Ve,z as Lo,O as se,ak as Se,av as Ds,L as Ts,A as _s,b5 as Ps,U as No,W as Qe,bB as $s,bC as qs,c1 as Ls,c2 as Ns,bn as ft,bo as As,bq as Es,bu as zs,bv as at}from"./vendor-mui-core-DxD1UA4o.js";import{z as ye,C as Ee,aa as Bs,a2 as Os,f as ro,ab as lo}from"./index-CWohFZPl.js";import{r as Re,p as Y,u as oe,bM as Ao,l as Ws,B as Me,b3 as Eo,V as zo,b1 as Bo,am as Ms,bN as Vs,a5 as kt,Y as U,a1 as Us,h as ae,bO as Fs,b6 as Hs,g as qe,ak as yt,aq as Js}from"./vendor-ux-did-connect-CiLSrCOH.js";import{B as Rt,c as ue,l as Gs,I as Xs,_ as Oo,J as De,p as Ys}from"./vendor-arcblock-BtlDhznp.js";import{d as Qs}from"./Error-BnWmSZ5k.js";import{C as vt}from"./confirm-Fhl5qi_m.js";import{u as Ue}from"./session-DaQ4KCFD.js";import{W as io}from"./did-address-GAxLGeWB.js";import{E as Fe}from"./empty-spinner-Ict2ItjU.js";import{B as Ct}from"./bundle-avatar-CSEBu3MU.js";import{S as je}from"./shorten-label-CwDvu4_S.js";import{L as wt}from"./list-header-Bm8u_Z_p.js";import{Z as Zs,y as be,I as St,D as Wo}from"./vendor-utils-CTIzdAFg.js";import{d as Ks}from"./Download-B0rKRcTB.js";import{C as Mo}from"./click-to-copy-Cygm8U3_.js";import{Q as en}from"./QuestionMarkCircle-B4EnwYju.js";import{u as tn}from"./vendor-hooks-BwVH-TAd.js";import{_ as Ie}from"./useSetState-BL3ktMon.js";import{c as It}from"./index-tUQxVYYQ.js";import{E as Dt}from"./index-D1fVmwHN.js";import"./api-3sG9at7i.js";import{d as on}from"./ChevronRight-CO9My6tF.js";import{T as sn,a as nn}from"./vendor-mui-x-Bit8yv3W.js";import{d as co}from"./DeleteOutline-7AloJjcV.js";import{D as ao,C as uo,P as po}from"./react-beautiful-dnd.esm-BQ3hEDNY.js";import{c as rn,A as Vo,u as ln,S as cn,U as an,a as dt,b as Uo,n as dn,e as un,f as ho,g as pn,h as hn}from"./item-D8zBx1dJ.js";import{d as fn}from"./ArrowDropDown-DO9H_COV.js";import{f as Ne}from"./format-error-LAoTjvJe.js";import{d as bn}from"./Launch-CIC8rZgo.js";import{M as xn}from"./index-O2l0NSUF.js";import{r as mn}from"./index-DkPKxdcu.js";import{d as gn}from"./Done-BXISjL2g.js";import"./lottie-web-B6s7dDoL.js";import"./raf-schd.esm-GV-XhwE0.js";import"./delete-confirm-Dtzz6Jaz.js";import"./get-safe-url-ZRaKUVld.js";var Tt={},jn=ke;Object.defineProperty(Tt,"__esModule",{value:!0});var Fo=Tt.default=void 0,kn=jn(Re()),yn=e;Fo=Tt.default=(0,kn.default)((0,yn.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 _t={},Rn=ke;Object.defineProperty(_t,"__esModule",{value:!0});var Ho=_t.default=void 0,vn=Rn(Re()),Cn=e;Ho=_t.default=(0,vn.default)((0,Cn.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 Pt={},wn=ke;Object.defineProperty(Pt,"__esModule",{value:!0});var Jo=Pt.default=void 0,Sn=wn(Re()),In=e;Jo=Pt.default=(0,Sn.default)((0,In.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 $t({did:t,projectId:o,title:s,logo:r,describe:l}){const n=`${`${Y.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${t}/${o}/logo/upload`}/${r}`,[u,d]=j.useState(!1),f=Le(x=>x.breakpoints.down("md"));return e.jsxs(c,{sx:{display:"flex",flexDirection:"row",color:u?"primary.main":"grey.900",gap:1},onPointerEnter:()=>d(!0),onPointerLeave:()=>d(!1),children:[e.jsx(wo,{sx:{borderRadius:1},src:n}),e.jsxs(c,{children:[e.jsx(je,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:f?"primary.main":""},children:s||"/"}),e.jsx(je,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:f||u?"primary.main":"grey.700"},children:l||"/"})]})]})}$t.propTypes={projectId:i.string.isRequired,did:i.string.isRequired,title:i.string.isRequired,logo:i.string.isRequired,describe:i.string.isRequired};function qt({initUrl:t}){const o=gt(),s=(t==null?void 0:t.searchParams.get("tenantScope"))||"",{t:r,locale:l}=oe(),{api:a}=ye(),{api:n}=Ue(),[u,d]=j.useState(!0),{blocklet:f}=Ee(),[x,S]=j.useState(null),[C,p]=j.useState(!1),h=Le(g=>g.breakpoints.down("xl")),R=Le(g=>g.breakpoints.down("md")),{componentDid:w=""}=tt(),[k,I]=j.useState(null),v=`publish-${f.meta.did}`,D=Ao(v),[_,q]=j.useState({searchText:D.searchText||"",pageSize:D.rowsPerPage||10,page:1}),E=()=>{a.getProjects({input:{did:f.meta.did,componentDid:w,tenantScope:s}}).then(g=>{const N=(g==null?void 0:g.projects)||[];d(!1),I(N)}).catch(g=>{d(!1),U.error(g.message)})},M=()=>{o(`${Y.UNOWNED_DID}/create/none`,{replace:!0})},$=g=>{S(g)},Q=()=>{d(!1),p(!0)},O=()=>{p(!1),S(null)},m=g=>{U.error(g.message),p(!1),S(null)},b=g=>{if(!(g!=null&&g.deleted)){U.error("Delete project failed");return}E(),p(!1),S(null)};j.useEffect(()=>{E()},[]);const y=j.useMemo(()=>{var N;if(!_.searchText)return k;let g=(N=_.searchText)==null?void 0:N.trim();return g?(g=Ws.toAddress(g).toLocaleLowerCase(),k.filter(H=>H.blockletTitle.toLowerCase().includes(g)||H.blockletDid.toLowerCase().includes(g))):k},[k,_.searchText]);if(!k&&u)return e.jsx(c,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:e.jsx(Fe,{})});if(!k)return null;if(!k.length)return e.jsxs(c,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[e.jsx(c,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:r("blocklet.publish.blockletEmptyTip")}),e.jsx(c,{sx:{fontSize:14,color:"text.secondary",mb:3},children:r("blocklet.publish.createBlockletTip")}),e.jsx(Me,{onClick:M,variant:"contained",children:r("blocklet.publish.createBlocklet")})]});const W=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:g=>{const N=k[g];return e.jsx(xe,{to:`${N.id}`,children:e.jsx($t,{did:f.meta.did,projectId:N.id,logo:N.blockletLogo,title:N.blockletTitle,describe:N.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{searchable:!1,customBodyRender:g=>g?e.jsx(Eo,{type:"success",children:g}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:g=>g?e.jsx(io,{size:14,compact:!0,responsive:!1,did:g}):null}},h||w?null:{label:r("common.createdBy"),name:"createdBy",options:{customBodyRender:g=>g?e.jsx(io,{onClick:()=>{o(`/.well-known/service/admin/members?did=${g}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:g}):null}},h||w?null:{label:r("common.scope"),name:"componentDid",options:{customBodyRender:g=>{const N=(f.children||[]).find(H=>H.meta.did===g);return N?e.jsxs(c,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[e.jsx(Ct,{size:14,blocklet:N,ancestors:[f]}),e.jsx(c,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:N.meta.title})]},g):""}}},h||s?null:{label:r("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:g=>e.jsx(c,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:e.jsx(je,{children:g})})}},{label:r("common.updatedAt"),name:"updatedAt",options:{searchable:!1,customBodyRender:g=>e.jsx(zo,{value:Number(g),locale:l})}},{label:r("common.actions"),name:"actions",options:{searchable:!1,customBodyRenderLite:g=>{const N=k[g];return e.jsxs(c,{display:"flex",children:[e.jsx(xe,{to:`${N.id}/new-release/${N.lastReleaseId}`,children:e.jsx(me,{title:r("blocklet.publish.createRelease"),placement:"top",children:e.jsx(ce,{color:"primary","aria-label":"create",children:e.jsx(Fo,{style:{fontSize:18}})})})}),!!N.lastReleaseId&&e.jsx(me,{title:r("blocklet.publish.viewLastRelease",{name:N.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"secondary","aria-label":"create",children:e.jsx(xe,{style:{display:"flex"},to:`${N.id}/view/${N.lastReleaseId}`,children:e.jsx(Ho,{sx:{fontSize:18}})})})}),e.jsx(me,{title:r("blocklet.publish.delete",{name:N.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"primary","aria-label":"delete",onClick:()=>$(N),children:e.jsx(Bo,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),z=({page:g,rowsPerPage:N,searchText:H})=>{_.pageSize!==N?q(J=>({...J,searchText:"",pageSize:N,page:1})):_.page!==g+1?q(J=>({...J,searchText:"",page:g+1})):_.searchText!==H&&q(J=>({...J,searchText:H,page:1}))},G=C?e.jsx(Ms,{open:!0,popup:!0,onClose:O,action:"check-has-project-id",locale:l,checkFn:n.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:b,onError:m,extraParams:{projectId:x.id,did:f.meta.did,name:x.blockletTitle},messages:{title:r("blocklet.publish.deleteProject.title",{name:x.blockletTitle}),scan:r("blocklet.publish.deleteProject.scan",{name:x.blockletTitle}),confirm:r("blocklet.publish.deleteProject.confirm"),success:r("blocklet.publish.deleteProject.success")}}):null;return e.jsxs(c,{children:[e.jsx(wt,{sx:{mb:2},left:e.jsxs(c,{display:"flex",flexDirection:"row",alignItems:"center",children:[e.jsx(c,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:r("common.blockletStudio")}),e.jsx(me,{title:r("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:e.jsx(Jo,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(Vs,{options:{searchPlaceholder:r("blocklet.list.searchPlaceholder"),searchDebounceTime:600,searchAlwaysOpen:R},search:_.searchText,searchText:_.searchText,searchTextUpdate:g=>q(N=>({...N,searchText:g})),searchClose:()=>q(g=>({...g,searchText:""})),onSearchOpen:()=>{}}),e.jsxs(Me,{onClick:M,variant:"contained",children:[e.jsx(Rt,{style:{fontSize:"1.3em",marginRight:4}}),r("blocklet.publish.createBlocklet")]})]})}),e.jsx(kt,{className:"main-table",locale:l,data:y,columns:W,options:{search:!1,sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,searchAlwaysOpen:!0,rowsPerPageOptions:[10,20,50,100]},durable:v,onChange:z}),x&&e.jsx(vt,{title:`${r("common.delete")} ${x.blockletTitle}`,description:r("blocklet.publish.deleteProject.description"),confirm:r("common.confirm"),onConfirm:Q,onCancel:()=>S(null),children:e.jsx(c,{sx:{marginTop:2},children:[r("blocklet.publish.deleteProject.tip1"),r("blocklet.publish.deleteProject.tip2"),r("blocklet.publish.deleteProject.tip3")].map(g=>e.jsxs(c,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[e.jsx(Qs,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),e.jsx(L,{component:"span",variant:"inherit",color:"text.secondary",children:g})]}))})}),G]})}qt.propTypes={initUrl:i.object};qt.defaultProps={initUrl:null};var Lt={},Dn=ke;Object.defineProperty(Lt,"__esModule",{value:!0});var Go=Lt.default=void 0,Tn=Dn(Re()),fo=e;Go=Lt.default=(0,Tn.default)([(0,fo.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,fo.jsx)("path",{d:"m17 14 5-5-1.41-1.41L18 10.17V3h-2v7.17l-2.59-2.58L12 9z"},"1")],"InstallDesktop");const _n=(t,o)=>{if(!t)return"";try{return o?JSON.parse(t)[o]:JSON.parse(t)}catch{}return t},Xo=_n;function Pn(){var m;const{t,locale:o}=oe(),{projectId:s}=tt(),{api:r}=ye(),[l,a]=j.useState(!0),{blocklet:n}=Ee(),u=Le(b=>b.breakpoints.down("md")),[d,f]=j.useState(null),[x,S]=j.useState(null),[C,p]=j.useState(null),h=(m=window.env)==null?void 0:m.serverEndpoint,R=`releases-${n.meta.did}-${s}`,w=Ao(R),[k,I]=j.useState({searchText:w.searchText||"",pageSize:w.rowsPerPage||10,page:1}),v=()=>{r.getReleases({input:{did:n.meta.did,projectId:s}}).then(b=>{const y=(b==null?void 0:b.releases)||[];a(!1),f(y)}).catch(b=>{a(!1),U.error(b.message)})},D=()=>{r.doBatchQuery({getProject:{input:{did:n.meta.did,projectId:s}},getReleases:{input:{did:n.meta.did,projectId:s}}}).then(b=>{S(b.getProject.project||{}),f(b.getReleases.releases||[]),a(!1)}).catch(b=>{a(!1),U.error(b.message)})};j.useEffect(()=>{D()},[]);const[_,q]=j.useState(""),E=()=>{a(!1);const b=C.id;r.deleteRelease({input:{did:n.meta.did,projectId:s,releaseId:b}}).then(()=>{a(!1),v(),U.success(t("common.removeSuccess")),p(null)}).catch(y=>{a(!1),U.error(y.message)})},M=b=>{p(b)};if(!d&&l)return e.jsx(c,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:e.jsx(Fe,{})});if(!d)return null;const $=e.jsxs(So,{className:"breadcrumbs","aria-label":"breadcrumb",children:[e.jsx(xe,{to:"..",children:t("common.blockletStudio")}),e.jsx(L,{color:"text.primary",children:e.jsx(je,{maxLength:u?6:30,children:x.blockletTitle})})]});if(!d.length)return e.jsxs(e.Fragment,{children:[$,e.jsxs(c,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[e.jsx(c,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:t("blocklet.publish.releaseEmptyTip")}),e.jsx(c,{sx:{fontSize:14,color:"text.secondary",mb:3},children:t("blocklet.publish.createReleaseTip")}),e.jsx(xe,{to:"create/none",children:e.jsx(Me,{variant:"contained",children:t("blocklet.publish.createRelease")})})]})]});const Q=[{label:t("common.version"),name:"blockletVersion",minWidth:160,options:{customBodyRenderLite:b=>{const y=d[b];return e.jsx(xe,{to:`view/${y.id}`,children:e.jsx($t,{did:n.meta.did,projectId:x.id,logo:y.blockletLogo,title:y.blockletVersion,describe:y.blockletTitle})})}}},{label:t("blocklet.publish.releaseNote"),name:"note",options:{customBodyRenderLite:b=>{const y=d[b];return e.jsx(L,{className:"note",children:Xo(y.note,"note")})}}},{label:t("common.status"),name:"status",options:{customBodyRender:b=>e.jsx(Eo,{type:b==="published"?"success":"warning",children:b==="published"?"Released":Zs(b)})}},{label:t("common.lastPublishedAt"),name:"updatedAt",options:{customBodyRenderLite:b=>{const y=d[b];return y.status!==ue.PROJECT.RELEASE_STATUS.published?"":e.jsx(zo,{value:Number(y.updatedAt),locale:o})}}},{label:t("common.actions"),name:"actions",options:{customBodyRenderLite:b=>{var N;const y=d[b];let W="",z="";const G=y.status==="published";if(G){const H=be(h,`/api/project/${n.meta.did}/${x.id}/${x.lastReleaseId}/release/blocklet.json`),J=new URL(h);J.pathname=be(J.pathname,"/launch-blocklet/agreement"),J.searchParams.set("blocklet_meta_url",H),W=J.href,z=be(`${Y.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${n.meta.did}/${x.id}/${x.lastReleaseId}/download/${(x.lastReleaseFiles||[])[0]}`)}const g=(N=x.blockletComponents)!=null&&N.some(H=>H.included)||y.uploadedResource?"pack":"resource";return e.jsxs(c,{display:"flex",alignItems:"center",children:[G&&g==="pack"&&e.jsx(me,{title:t("blocklet.publish.install",{name:x.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"secondary","aria-label":"create",children:e.jsx("a",{style:{display:"flex"},href:W,target:"_blank",rel:"noreferrer",children:e.jsx(Go,{sx:{fontSize:18}})})})}),G&&e.jsx(me,{title:t("blocklet.publish.download",{name:x.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"primary","aria-label":"download",children:e.jsx("a",{style:{display:"flex"},href:z,children:e.jsx(Ks,{sx:{fontSize:18}})})})}),e.jsx(me,{title:t("blocklet.publish.delete",{name:x.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"primary","aria-label":"delete",onClick:()=>M(y),children:e.jsx(Bo,{sx:{fontSize:18}})})})]})}}}],O=({page:b,rowsPerPage:y,searchText:W})=>{k.pageSize!==y?I(z=>({...z,searchText:"",pageSize:y,page:1})):k.page!==b+1?I(z=>({...z,searchText:"",page:b+1})):k.searchText!==W&&I(z=>({...z,searchText:W,page:1}))};return e.jsxs($n,{children:[e.jsx(wt,{sx:{mb:2},left:$,actions:e.jsxs(e.Fragment,{children:[e.jsx(Me,{variant:"outlined",onClick:()=>{const b=be(h,`/api/project/${n.meta.did}/${s}/blocklet.json`);q(b)},children:t("blocklet.publish.copyInstallUrl")}),e.jsx(xe,{to:"new-release/none",children:e.jsxs(Me,{variant:"contained",children:[e.jsx(Rt,{style:{fontSize:"1.3em",marginRight:4}}),t("blocklet.publish.createRelease")]})})]})}),e.jsx(ot,{fullWidth:!0,maxWidth:"sm",open:_,onClose:()=>q(""),children:e.jsxs(c,{sx:{py:5,px:4,wordBreak:"break-all"},children:[e.jsx(L,{variant:"h6",sx:{mb:2},children:t("blocklet.publish.installResourceTip")}),e.jsx(Mo,{children:_}),e.jsxs(L,{sx:{mt:2},children:[t("blocklet.publish.installResourceTip2"),e.jsx("a",{style:{marginLeft:4},href:"https://www.arcblock.io/docs/blocklet-developer/how-to-use-install-url",target:"_blank",rel:"noreferrer",children:t("blocklet.publish.installResourceHelp")})]})]})}),e.jsx(kt,{className:"main-table",verticalKeyWidth:100,locale:o,data:d,columns:Q,durable:R,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1},onChange:O}),C&&e.jsx(vt,{title:t(`${t("common.delete")} ${C.blockletVersion}`),description:t("blocklet.publish.deleteReleaseTip"),confirm:t("common.confirm"),onConfirm:E,onCancel:()=>p(null)})]})}const $n=ge(c)`
3
3
  .main-table > div:first-child {
4
4
  display: none;
5
5
  }
@@ -125,7 +125,7 @@ import{r as j,k as gt,l as tt,L as xe,g as Rs,u as vs,h as Cs,i as ct}from"./ven
125
125
  background: #fff;
126
126
  z-index: 10;
127
127
  }
128
- `;var Mt={},sr=ke;Object.defineProperty(Mt,"__esModule",{value:!0});var bt=Mt.default=void 0,nr=sr(Re()),rr=e;bt=Mt.default=(0,nr.default)((0,rr.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 go="lastWantToConnectStoreId";function lr(t){var u,d;const[o,s]=j.useState(null),{session:r}=Ue(),l=j.useCallback(f=>{s(f),localStorage.setItem(go,f==null?void 0:f.id)},[s]),a=j.useMemo(()=>{var C,p,h,R;const f=localStorage.getItem(go),x=f?(((C=t==null?void 0:t.settings)==null?void 0:C.storeList)||[]).find(w=>w.id===f):null;if(x)return x;let S=(((p=t==null?void 0:t.settings)==null?void 0:p.storeList)||[]).find(w=>{var k;return!(w.id!==Y.BLOCKLET_STORE.id||w.scope&&w.scope!=="studio"&&w.scope!==((k=r==null?void 0:r.user)==null?void 0:k.did))});return S||(S=(R=(h=t==null?void 0:t.settings)==null?void 0:h.storeList)==null?void 0:R[0]),S},[(u=t==null?void 0:t.settings)==null?void 0:u.storeList,(d=r==null?void 0:r.user)==null?void 0:d.did]);return[o||a||{},l]}const pt={};async function es(t,{interval:o=1e3,maxDuration:s=120*1e3,intervalFirst:r=4e3,timerKey:l=""}){pt[l]&&clearTimeout(pt[l]),await new Promise(u=>setTimeout(u,r));const a=Date.now(),n=async(u,d)=>{try{const f=await t();u(f)}catch(f){Date.now()-a>s?d(f):l?pt[l]=setTimeout(()=>n(u,d),o):setTimeout(()=>n(u,d),o)}};return new Promise(n)}function ir(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function cr(t,{did:o,projectId:s,messageId:r}){return es(async()=>{var a;const l=await t.getProject({input:{did:o,projectId:s,messageId:r}});if(!((a=l==null?void 0:l.project)!=null&&a.blockletDid))throw new Error("Connected store not found");return l.project.blockletDid},{timerKey:"connect-studio"})}function ar(t,{did:o,projectId:s,storeId:r}){return es(async()=>{var n,u;const l=await t.getProject({input:{did:o,projectId:s,messageId:""}});if(!((u=(n=l==null?void 0:l.project)==null?void 0:n.connectedStores)!=null&&u.length))throw new Error("Connected store not found");if(!l.project.connectedStores.find(d=>d.storeId===r))throw new Error("Connected store not found")},{timerKey:`connect-store-${r}`})}const dr=({fromBlocklet:t,nodeInfo:o,blocklet:s,userDid:r})=>{var n,u;const l=t?(n=s==null?void 0:s.meta)==null?void 0:n.did:o==null?void 0:o.did;let a=t?((u=s==null?void 0:s.settings)==null?void 0:u.storeList)||[]:(o==null?void 0:o.blockletRegistryList)||[];return Array.isArray(a)||(a=[]),a=a.filter(d=>d.protected||!d.scope||d.scope==="studio"||d.scope===r),{teamDid:l,storeList:a}},Vt=dr;function Ut({blocklet:t,store:o={},onChangeStore:s,onClick:r,disabled:l,loading:a,componentDid:n}){var m,b,y;const{t:u}=oe(),{session:d}=Ue(),{api:f,info:x,inService:S}=ye(),C=Ee(),[p,h]=j.useState(!1),R=j.useRef(null),[w,k]=j.useState(!1),[I,v]=j.useState(null),D=W=>{s(W),h(!1)},_=()=>{h(!p)},q=W=>{R.current&&R.current.contains(W.target)||h(!1)},E=()=>{k(!0)},M=()=>{k(!1)},$=async()=>{var W;if(I)try{await f.deleteBlockletStore({input:{teamDid:t.meta.did,url:I.url,projectId:"",scope:I.scope||"studio"}}),await((W=C==null?void 0:C.actions)==null?void 0:W.refreshBlocklet())}catch(z){U.error(`Remove Blocklet Store Error: ${Ne(z)}`)}finally{v(null)}},{storeList:Q}=Vt({fromBlocklet:S,blocklet:t,nodeInfo:x,componentDid:n,userDid:(m=d==null?void 0:d.user)==null?void 0:m.did}),O=(b=t==null?void 0:t.meta)==null?void 0:b.did;return e.jsxs(e.Fragment,{children:[e.jsxs(ht,{disabled:l,ref:R,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[e.jsxs(ne,{onClick:r,children:[a&&e.jsx(Ye,{size:14,sx:{mr:.5}}),`${u("common.connect")} ${o.name||""}`]}),e.jsx(ne,{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:_,children:e.jsx(fn,{})})]}),e.jsx(Do,{sx:{zIndex:10},open:p,anchorEl:R.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:W})=>e.jsx(To,{...W,style:{transformOrigin:"center top"},children:e.jsx(jt,{children:e.jsx(_o,{onClickAway:q,children:e.jsxs(Po,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[Q==null?void 0:Q.map(z=>{var G;return e.jsxs(fe,{selected:z.id===(o==null?void 0:o.id),sx:{height:56},onClick:()=>D(z),children:[e.jsxs(c,{children:[e.jsx(je,{sx:{fontSize:"16px"},maxLength:24,children:z.name}),e.jsx(je,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:z.url})]}),rn({store:z,userDid:(G=d==null?void 0:d.user)==null?void 0:G.did})&&e.jsx(ce,{sx:{ml:1},onClick:g=>{g.preventDefault(),g.stopPropagation(),v(z)},children:e.jsx(ae,{icon:"ic:outline-delete"})})]},z.url)}),e.jsx(Ss,{}),e.jsxs(fe,{onClick:E,children:[e.jsx(Rt,{font:!0}),e.jsx(L,{variant:"inherit",children:u("store.blockletRegistry.addRegistry")})]})]})})})})}),w&&e.jsx(Vo,{hiddenChildren:!0,open:!0,onClose:M,teamDid:O,storeList:Q,scope:"studio",onAdd:(y=C==null?void 0:C.actions)==null?void 0:y.refreshBlocklet}),I&&e.jsx(vt,{displayError:!0,title:`${u("common.delete")} ${I.name}`,description:u("blocklet.publish.deleteStoreTip",{name:I.name}),confirm:u("common.confirm"),onConfirm:$,onCancel:()=>v(null)})]})}Ut.propTypes={store:i.object,blocklet:i.object,onChangeStore:i.func.isRequired,onClick:i.func.isRequired,loading:i.bool.isRequired,disabled:i.bool.isRequired,componentDid:i.string.isRequired,projectType:i.string.isRequired,getData:i.func.isRequired};Ut.defaultProps={store:null,blocklet:null};const ur=(t,o,s)=>{const r=`${Y.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${o.meta.did}/${s}/logo/upload`,l=`${Y.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${o.meta.did}/${s}/screenshot/upload`,a=t!=null&&t.blockletLogo?`${r}/${t.blockletLogo}`:`${Y.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,n=((t==null?void 0:t.blockletScreenshots)||[]).filter(Boolean).map(u=>`${l}/${u}`);return{logoUrl:a,screenshotUrls:n,uploadLogoPrefix:r,uploadScreenshotPrefix:l}},ts=ur,pr=t=>{const o=t.includes("youtube.com")||t.includes("youtu.be"),s=t.includes("vimeo.com");return o||s};function st({url:t,style:o,controls:s,modestbranding:r}){var u;const{t:l}=oe(),a=t.includes("youtube.com")||t.includes("youtu.be"),n=t.includes("vimeo.com");if(a){const d=((u=t.split("v=")[1])==null?void 0:u.split("&")[0])||t.split("/").pop();return e.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:(o==null?void 0:o.pointerEvents)||"auto"},children:e.jsx("iframe",{src:`https://www.youtube.com/embed/${d}?modestbranding=${r}&controls=${s}&rel=0`,title:"YouTube video player",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",...o},allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})})}if(n){const d=t.split("/").pop();return e.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:o.pointerEvents||"auto"},children:e.jsx("iframe",{src:`https://player.vimeo.com/video/${d}`,title:"Vimeo video player",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",...o},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0})})}return e.jsx(c,{style:{position:"relative",width:"100%",paddingTop:"56.25%"},children:e.jsxs(c,{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",backgroundColor:"rgba(0, 0, 0, 0.04)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",...o},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,children:[e.jsx(ae,{icon:"carbon:video-off",style:{fontSize:40,marginBottom:"10px",opacity:.5}}),e.jsx(L,{variant:"body1",sx:{opacity:.5},children:l("studio.videoDialogNoSrc")})]})})}st.propTypes={url:i.string.isRequired,style:i.object,controls:i.number,modestbranding:i.number};st.defaultProps={style:{},controls:1,modestbranding:1};function os({setParams:t,onClose:o,params:s}){const{t:r}=oe(),[l,a]=j.useState(""),n=l&&s.blockletVideos.includes(l),u=pr(l),d=()=>{t(f=>{const x=[...f.blockletVideos];return x.push(l),{...f,blockletVideos:x}}),o()};return e.jsxs(ot,{open:!0,fullWidth:!0,maxWidth:"sm",children:[e.jsx($o,{children:r("studio.videoDialogTitle")}),e.jsxs(qo,{children:[e.jsx(Is,{fullWidth:!0,value:l,onChange:f=>a(f.target.value),placeholder:r("studio.videoInputLabel"),endAdornment:l?e.jsx(Ve,{position:"end",children:e.jsx(ce,{onClick:()=>a(""),children:e.jsx(Hs,{})})}):null,error:n}),n&&e.jsx(L,{variant:"body2",color:"error",children:r("studio.duplicateVideo")}),e.jsx(st,{url:l,style:{marginTop:"20px",borderRadius:"4px"}})]}),e.jsxs(Lo,{children:[e.jsx(ne,{onClick:()=>o(),children:r("studio.cancel")}),e.jsx(ne,{disabled:!u||n,onClick:d,children:r("studio.confirm")})]})]})}os.propTypes={onClose:i.func.isRequired,params:i.object.isRequired,setParams:i.func.isRequired};function xt({errors:t,storeList:o,...s}){const{t:r}=oe();return e.jsxs(c,{...s,color:"warning.main",fontSize:"14px",sx:{border:"1px solid rgba(214, 164, 64, 0.34)",borderRadius:"4px",py:2,px:1.5,position:"relative"},children:[e.jsx(L,{variant:"caption",sx:{fontWeight:"bold",position:"absolute",top:-10,left:12,backgroundColor:"white",px:1,width:"fit-content"},children:r("blocklet.publish.storeRule.warning")}),t&&Object.entries(t).map(([l,a])=>{const n=Object.values(a),u=o.find(d=>d.url===l);return n.length>0&&e.jsxs(c,{children:[e.jsx(me,{title:l,children:e.jsx(c,{component:"span",sx:{cursor:"pointer"},children:u.name})}),n.map(d=>e.jsx(c,{component:"li",ml:2,breakWords:!0,children:d},d))]},l)})]})}xt.propTypes={errors:i.object.isRequired,storeList:i.array.isRequired};const jo=j.lazy(()=>Oo(()=>import("./index-B64a4BbE.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])).then(t=>({default:t.Uploader})));function ss({projectId:t,readOnly:o,loading:s,blocklet:r,params:l,setParams:a,paramsErrTip:n,setParamsErrTip:u,warning:d,setLoading:f,initUrl:x,initLogoUrl:S,setInitLogoUrl:C,componentDid:p}){const{t:h,locale:R}=oe(),{api:w}=ye(),k=gt(),I=j.useRef(null),v=j.useRef(null),[D,_]=lr(r),[q,E]=j.useState(!1),M=ln({messageType:"connect-store-message",onOpen:()=>f(!0),onClose:()=>f(!1)}),$=async P=>{const F=setTimeout(()=>{f(!1)},2e4),X=await cr(w,P);f(!1),clearTimeout(F),window.parent.postMessage({event:"studioDialog.connected",componentDid:p},"*"),k(window.location.pathname.replace(`${Y.UNOWNED_DID}/create`,`${X}/create`),{replace:!0})},Q=()=>{if(!l.blockletTitle){U.error(h("blocklet.publish.errorTip.noTitle"));return}if(!(D!=null&&D.url)){U.error(h("blocklet.publish.noStoreSelected"));return}const P=ir();M(async(F,X)=>{var ee,Z,ie;try{const K=await w.connectByStudio({input:{did:(ee=r==null?void 0:r.meta)==null?void 0:ee.did,blockletTitle:l==null?void 0:l.blockletTitle,storeUrl:D.url,storeId:D.id,storeName:D.name,type:((Z=l==null?void 0:l.blockletComponents)==null?void 0:Z.length)>0?"pack":"resource",componentDid:p,messageId:P,tenantScope:(x==null?void 0:x.searchParams.get("tenantScope"))||""}});if(!(K!=null&&K.url)){U.error("failed to connect to store");return}X(K.url),$({did:(ie=r==null?void 0:r.meta)==null?void 0:ie.did,projectId:"",messageId:P})}catch(K){const de=Ne(K);U.error(de),f(!1)}})},{logoUrl:O,screenshotUrls:m,uploadLogoPrefix:b,uploadScreenshotPrefix:y}=ts(l,r,t),{logoErrors:W,screenshotErrors:z,storeList:G,hasLogoWarning:g,hasScreenshotWarning:N}=d,H=()=>o?!1:!t||t===Y.UNOWNED_DID?(U.error(h("blocklet.publish.errorTip.noFirstDid")),!1):!0,J=P=>{if(!P.destination)return;const F=Array.from(l.blockletScreenshots),[X]=F.splice(P.source.index,1);F.splice(P.destination.index,0,X),a(ee=>({...ee,blockletScreenshots:F}))},ze=P=>{if(!P.destination)return;const F=Array.from(l.blockletVideos),[X]=F.splice(P.source.index,1);F.splice(P.destination.index,0,X),a(ee=>({...ee,blockletVideos:F}))};return e.jsxs(hr,{children:[e.jsx(c,{display:"flex",className:"section",children:e.jsxs(c,{sx:{flex:1},children:[e.jsx(se,{disabled:s||o,label:`Blocklet ${h("common.title")}`,placeholder:`Blocklet ${h("common.title")}`,InputProps:{"data-cy":"blocklet-title",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:l.blockletTitle||"",onChange:P=>{u({blockletTitle:""}),a({blockletTitle:P.target.value})},error:!!n.blockletTitle,helperText:n.blockletTitle||""}),e.jsx(se,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"export-blocklet-did",endAdornment:t===Y.UNOWNED_DID&&e.jsx(Ve,{position:"end",children:e.jsx(Ut,{blocklet:r,store:D,componentDid:p,onChangeStore:_,disabled:!l.blockletTitle||o||s,loading:s,onClick:Q})})},error:!!n.projectId,helperText:n.projectId||"",value:t===Y.UNOWNED_DID?"":`did:abt:${t}`,sx:{mt:3}}),e.jsx(se,{disabled:s||o,label:`Blocklet ${h("common.description")}`,placeholder:`Blocklet ${h("common.description")}`,InputProps:{"data-cy":"blocklet-description",readOnly:o},required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletDescription||"",onChange:P=>{u({blockletDescription:""}),a({blockletDescription:P.target.value})},error:!!n.blockletDescription,helperText:n.blockletDescription||"",sx:{mt:3}}),e.jsx(se,{disabled:s||o,label:`Blocklet ${h("common.homepageTip")}`,placeholder:`Blocklet ${h("common.homepageTip")}`,InputProps:{"data-cy":"blocklet-homepage",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletHomepage||"",onChange:P=>{P.target.value&&!/^(http|https):\/\//.test(P.target.value)?u({blockletHomepage:h("blocklet.publish.errorTip.invalidUrl")}):u({blockletHomepage:""}),a({blockletHomepage:P.target.value})},error:!!n.blockletHomepage,helperText:n.blockletHomepage||"",sx:{mt:3}}),e.jsx(se,{disabled:s||o,label:`Blocklet ${h("common.community")}`,placeholder:`Blocklet ${h("common.community")}`,InputProps:{"data-cy":"blocklet-community",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletCommunity||"",onChange:P=>{P.target.value&&!/^(http|https):\/\//.test(P.target.value)?u({blockletCommunity:h("blocklet.publish.errorTip.invalidUrl")}):u({blockletCommunity:""}),a({blockletCommunity:P.target.value})},error:!!n.blockletCommunity,helperText:n.blockletCommunity||"",sx:{mt:3}}),e.jsx(se,{disabled:s||o,label:`Blocklet ${h("common.support")}`,placeholder:`Blocklet ${h("common.support")}`,InputProps:{"data-cy":"blocklet-support",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletSupport||"",onChange:P=>{P.target.value&&!/^(http|https):\/\//.test(P.target.value)&&!/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(P.target.value)?u({blockletSupport:h("blocklet.publish.errorTip.invalidUrlOrEmail")}):u({blockletSupport:""}),a({blockletSupport:P.target.value})},error:!!n.blockletSupport,helperText:n.blockletSupport||"",sx:{mt:3}}),e.jsx(se,{disabled:s||o,label:`Blocklet ${h("common.repository")}`,placeholder:`Blocklet ${h("common.repository")}`,InputProps:{"data-cy":"blocklet-repository",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletRepository||"",onChange:P=>{P.target.value&&!/^(git|https|svn)/.test(P.target.value)?u({blockletRepository:h("blocklet.publish.errorTip.invalidUrl")}):u({blockletRepository:""}),a({blockletRepository:P.target.value})},error:!!n.blockletRepository,helperText:n.blockletRepository||"",sx:{mt:3}})]})}),e.jsx(c,{display:"flex",mt:3,className:"section full-width",children:e.jsxs(c,{flex:1,overflow:"hidden",children:[e.jsxs(c,{display:"flex",flexDirection:"row",flexWrap:"wrap",children:[e.jsxs(Se,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(L,{variant:"subtitle1",sx:{fontWeight:"bold"},children:h("common.logo")}),e.jsxs(Se,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[h("studio.type"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"#007ec6"},children:"png, jpg, webp, svg"})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[h("studio.ratio"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"#007ec6"},children:"256x256"})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[h("studio.size"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"#007ec6"},children:"<500Kb"})]})})]})]}),e.jsx(c,{sx:{flex:1,cursor:o?"default":"pointer",display:"flex",alignItems:"flex-end"},children:e.jsx(wo,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:S||O,onClick:()=>{var P;H()&&((P=I.current)==null||P.open())}})})]}),g&&e.jsx(xt,{errors:W,storeList:G,mt:3}),e.jsxs(c,{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap",children:[e.jsxs(Se,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(L,{variant:"subtitle1",sx:{fontWeight:"bold"},children:h("common.screenshot")}),e.jsxs(Se,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[e.jsx(c,{sx:{border:"none"},variant:"outlined",size:"small",children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[h("studio.ratio"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"#007ec6"},children:"16 / 9"})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[h("studio.count"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"#007ec6"},children:"1~5"})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[h("studio.size"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"#007ec6"},children:"<5MB"})]})}),!o&&e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[h("studio.order"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"#007ec6"},children:h("studio.orderTip")})]})})]})]}),e.jsx(ao,{onDragEnd:o?void 0:J,children:e.jsx(uo,{droppableId:"screenshots",direction:"horizontal",isDropDisabled:o,children:(P,F)=>e.jsxs(c,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap",minHeight:160,background:F.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:F.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:P.innerRef,...P.droppableProps,children:[m.map((X,ee)=>e.jsx(po,{draggableId:X,index:ee,isDragDisabled:o,children:(Z,ie)=>e.jsxs(c,{ref:Z.innerRef,...Z.draggableProps,className:"screenshot",sx:{transform:ie.isDragging?"scale(1.05)":"none",boxShadow:ie.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx("img",{alt:"screenshot",src:X}),!o&&e.jsx(ce,{...Z.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:e.jsx(bt,{})}),!o&&e.jsx(ce,{className:"action",onClick:()=>{a(K=>{const de=[...K.blockletScreenshots];return de.splice(ee,1),{...K,blockletScreenshots:de}})},children:e.jsx(co,{})})]})},X)),P.placeholder,m.length<5&&e.jsx(c,{sx:{width:240,height:135,background:"#eee",cursor:o?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{var X;H()&&((X=v.current)==null||X.open())},children:"+"})]})})})]}),N&&e.jsx(xt,{errors:z,storeList:G}),e.jsxs(c,{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap",children:[e.jsxs(Se,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(L,{variant:"subtitle1",sx:{fontWeight:"bold"},children:h("studio.video")}),e.jsxs(Se,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[h("studio.videoType"),":"," "]}),e.jsxs(c,{component:"span",sx:{color:"#007ec6"},children:[e.jsx("a",{href:"https://www.youtube.com/",target:"_blank",rel:"noreferrer",children:"Youtube"}),","," ",e.jsx("a",{href:"https://vimeo.com/",target:"_blank",rel:"noreferrer",children:"Vimeo"})]})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[h("studio.count"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"#007ec6"},children:"1~3"})]})}),!o&&e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[h("studio.order"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"#007ec6"},children:h("studio.orderTip")})]})})]})]}),e.jsx(ao,{onDragEnd:o?void 0:ze,children:e.jsx(uo,{droppableId:"videos",direction:"horizontal",isDropDisabled:o,children:(P,F)=>e.jsxs(c,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap",minHeight:160,background:F.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:F.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:P.innerRef,...P.droppableProps,children:[l.blockletVideos.map((X,ee)=>e.jsx(po,{draggableId:X,index:ee,isDragDisabled:o,children:(Z,ie)=>e.jsxs(c,{ref:Z.innerRef,...Z.draggableProps,className:"screenshot",sx:{transform:ie.isDragging?"scale(1.05)":"none",boxShadow:ie.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx(st,{url:X,style:{pointerEvents:ie.isDragging?"none":"auto"}}),!o&&e.jsx(ce,{...Z.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:e.jsx(bt,{})}),!o&&e.jsx(ce,{className:"action",onClick:()=>{a(K=>{const de=[...K.blockletVideos];return de.splice(ee,1),{...K,blockletVideos:de}})},children:e.jsx(co,{})})]})},X)),P.placeholder,l.blockletVideos.length<3&&e.jsx(c,{sx:{width:240,height:135,background:"#eee",cursor:o?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{H()&&E(!0)},children:"+"})]})})})]})]})}),e.jsxs(j.Suspense,{fallback:e.jsx(Fe,{}),children:[e.jsx(jo,{ref:I,locale:R,popup:!0,onUploadFinish:P=>{var F;a({blockletLogo:P.data.filename}),C(""),(F=I.current)==null||F.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:b,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/png","image/jpeg","image/webp","image/svg+xml"],maxFileSize:1024*1024*.5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{minWidth:256,minHeight:256}}}},"uploader-logo"),q&&e.jsx(os,{onClose:()=>E(!1),params:l,setParams:a}),e.jsx(jo,{ref:v,locale:R,popup:!0,onUploadFinish:P=>{var F;a(X=>{var Z;const ee=X.blockletScreenshots||[];return ee.push((Z=P.data)==null?void 0:Z.filename),{...X,blockletScreenshots:ee}}),(F=v.current)==null||F.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:y,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","image/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-m.length}},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,autoCropArea:1,aspectRatio:16/9,initialAspectRatio:16/9,croppedCanvasOptions:{minWidth:1280,minHeight:720,maxWidth:1280*2,maxHeight:720*2}}}},"uploader-screenshot")]})]})}ss.propTypes={projectId:i.string.isRequired,readOnly:i.bool.isRequired,params:i.object.isRequired,setParams:i.func.isRequired,paramsErrTip:i.object.isRequired,setParamsErrTip:i.func.isRequired,warning:i.object.isRequired,loading:i.bool.isRequired,blocklet:i.object.isRequired,setLoading:i.func.isRequired,initUrl:i.object.isRequired,componentDid:i.isRequired,initLogoUrl:i.string.isRequired,setInitLogoUrl:i.func.isRequired};const hr=ge.div`
128
+ `;var Mt={},sr=ke;Object.defineProperty(Mt,"__esModule",{value:!0});var bt=Mt.default=void 0,nr=sr(Re()),rr=e;bt=Mt.default=(0,nr.default)((0,rr.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 go="lastWantToConnectStoreId";function lr(t){var u,d;const[o,s]=j.useState(null),{session:r}=Ue(),l=j.useCallback(f=>{s(f),localStorage.setItem(go,f==null?void 0:f.id)},[s]),a=j.useMemo(()=>{var C,p,h,R;const f=localStorage.getItem(go),x=f?(((C=t==null?void 0:t.settings)==null?void 0:C.storeList)||[]).find(w=>w.id===f):null;if(x)return x;let S=(((p=t==null?void 0:t.settings)==null?void 0:p.storeList)||[]).find(w=>{var k;return!(w.id!==Y.BLOCKLET_STORE.id||w.scope&&w.scope!=="studio"&&w.scope!==((k=r==null?void 0:r.user)==null?void 0:k.did))});return S||(S=(R=(h=t==null?void 0:t.settings)==null?void 0:h.storeList)==null?void 0:R[0]),S},[(u=t==null?void 0:t.settings)==null?void 0:u.storeList,(d=r==null?void 0:r.user)==null?void 0:d.did]);return[o||a||{},l]}const pt={};async function es(t,{interval:o=1e3,maxDuration:s=120*1e3,intervalFirst:r=4e3,timerKey:l=""}){pt[l]&&clearTimeout(pt[l]),await new Promise(u=>setTimeout(u,r));const a=Date.now(),n=async(u,d)=>{try{const f=await t();u(f)}catch(f){Date.now()-a>s?d(f):l?pt[l]=setTimeout(()=>n(u,d),o):setTimeout(()=>n(u,d),o)}};return new Promise(n)}function ir(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function cr(t,{did:o,projectId:s,messageId:r}){return es(async()=>{var a;const l=await t.getProject({input:{did:o,projectId:s,messageId:r}});if(!((a=l==null?void 0:l.project)!=null&&a.blockletDid))throw new Error("Connected store not found");return l.project.blockletDid},{timerKey:"connect-studio"})}function ar(t,{did:o,projectId:s,storeId:r}){return es(async()=>{var n,u;const l=await t.getProject({input:{did:o,projectId:s,messageId:""}});if(!((u=(n=l==null?void 0:l.project)==null?void 0:n.connectedStores)!=null&&u.length))throw new Error("Connected store not found");if(!l.project.connectedStores.find(d=>d.storeId===r))throw new Error("Connected store not found")},{timerKey:`connect-store-${r}`})}const dr=({fromBlocklet:t,nodeInfo:o,blocklet:s,userDid:r})=>{var n,u;const l=t?(n=s==null?void 0:s.meta)==null?void 0:n.did:o==null?void 0:o.did;let a=t?((u=s==null?void 0:s.settings)==null?void 0:u.storeList)||[]:(o==null?void 0:o.blockletRegistryList)||[];return Array.isArray(a)||(a=[]),a=a.filter(d=>d.protected||!d.scope||d.scope==="studio"||d.scope===r),{teamDid:l,storeList:a}},Vt=dr;function Ut({blocklet:t,store:o={},onChangeStore:s,onClick:r,disabled:l,loading:a,componentDid:n}){var m,b,y;const{t:u}=oe(),{session:d}=Ue(),{api:f,info:x,inService:S}=ye(),C=Ee(),[p,h]=j.useState(!1),R=j.useRef(null),[w,k]=j.useState(!1),[I,v]=j.useState(null),D=W=>{s(W),h(!1)},_=()=>{h(!p)},q=W=>{R.current&&R.current.contains(W.target)||h(!1)},E=()=>{k(!0)},M=()=>{k(!1)},$=async()=>{var W;if(I)try{await f.deleteBlockletStore({input:{teamDid:t.meta.did,url:I.url,projectId:"",scope:I.scope||"studio"}}),await((W=C==null?void 0:C.actions)==null?void 0:W.refreshBlocklet())}catch(z){U.error(`Remove Blocklet Store Error: ${Ne(z)}`)}finally{v(null)}},{storeList:Q}=Vt({fromBlocklet:S,blocklet:t,nodeInfo:x,componentDid:n,userDid:(m=d==null?void 0:d.user)==null?void 0:m.did}),O=(b=t==null?void 0:t.meta)==null?void 0:b.did;return e.jsxs(e.Fragment,{children:[e.jsxs(ht,{disabled:l,ref:R,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[e.jsxs(ne,{onClick:r,children:[a&&e.jsx(Ye,{size:14,sx:{mr:.5}}),`${u("common.connect")} ${o.name||""}`]}),e.jsx(ne,{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:_,children:e.jsx(fn,{})})]}),e.jsx(Do,{sx:{zIndex:10},open:p,anchorEl:R.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:W})=>e.jsx(To,{...W,style:{transformOrigin:"center top"},children:e.jsx(jt,{children:e.jsx(_o,{onClickAway:q,children:e.jsxs(Po,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[Q==null?void 0:Q.map(z=>{var G;return e.jsxs(fe,{selected:z.id===(o==null?void 0:o.id),sx:{height:56},onClick:()=>D(z),children:[e.jsxs(c,{children:[e.jsx(je,{sx:{fontSize:"16px"},maxLength:24,children:z.name}),e.jsx(je,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:z.url})]}),rn({store:z,userDid:(G=d==null?void 0:d.user)==null?void 0:G.did})&&e.jsx(ce,{sx:{ml:1},onClick:g=>{g.preventDefault(),g.stopPropagation(),v(z)},children:e.jsx(ae,{icon:"ic:outline-delete"})})]},z.url)}),e.jsx(Ss,{}),e.jsxs(fe,{onClick:E,children:[e.jsx(Rt,{font:!0}),e.jsx(L,{variant:"inherit",children:u("store.blockletRegistry.addRegistry")})]})]})})})})}),w&&e.jsx(Vo,{hiddenChildren:!0,open:!0,onClose:M,teamDid:O,storeList:Q,scope:"studio",onAdd:(y=C==null?void 0:C.actions)==null?void 0:y.refreshBlocklet}),I&&e.jsx(vt,{displayError:!0,title:`${u("common.delete")} ${I.name}`,description:u("blocklet.publish.deleteStoreTip",{name:I.name}),confirm:u("common.confirm"),onConfirm:$,onCancel:()=>v(null)})]})}Ut.propTypes={store:i.object,blocklet:i.object,onChangeStore:i.func.isRequired,onClick:i.func.isRequired,loading:i.bool.isRequired,disabled:i.bool.isRequired,componentDid:i.string.isRequired,projectType:i.string.isRequired,getData:i.func.isRequired};Ut.defaultProps={store:null,blocklet:null};const ur=(t,o,s)=>{const r=`${Y.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${o.meta.did}/${s}/logo/upload`,l=`${Y.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${o.meta.did}/${s}/screenshot/upload`,a=t!=null&&t.blockletLogo?`${r}/${t.blockletLogo}`:`${Y.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,n=((t==null?void 0:t.blockletScreenshots)||[]).filter(Boolean).map(u=>`${l}/${u}`);return{logoUrl:a,screenshotUrls:n,uploadLogoPrefix:r,uploadScreenshotPrefix:l}},ts=ur,pr=t=>{const o=t.includes("youtube.com")||t.includes("youtu.be"),s=t.includes("vimeo.com");return o||s};function st({url:t,style:o,controls:s,modestbranding:r}){var u;const{t:l}=oe(),a=t.includes("youtube.com")||t.includes("youtu.be"),n=t.includes("vimeo.com");if(a){const d=((u=t.split("v=")[1])==null?void 0:u.split("&")[0])||t.split("/").pop();return e.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:(o==null?void 0:o.pointerEvents)||"auto"},children:e.jsx("iframe",{src:`https://www.youtube.com/embed/${d}?modestbranding=${r}&controls=${s}&rel=0`,title:"YouTube video player",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",...o},allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})})}if(n){const d=t.split("/").pop();return e.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:o.pointerEvents||"auto"},children:e.jsx("iframe",{src:`https://player.vimeo.com/video/${d}`,title:"Vimeo video player",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",...o},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0})})}return e.jsx(c,{style:{position:"relative",width:"100%",paddingTop:"56.25%"},children:e.jsxs(c,{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",backgroundColor:"rgba(0, 0, 0, 0.04)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",...o},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,children:[e.jsx(ae,{icon:"carbon:video-off",style:{fontSize:40,marginBottom:"10px",opacity:.5}}),e.jsx(L,{variant:"body1",sx:{opacity:.5},children:l("studio.videoDialogNoSrc")})]})})}st.propTypes={url:i.string.isRequired,style:i.object,controls:i.number,modestbranding:i.number};st.defaultProps={style:{},controls:1,modestbranding:1};function os({setParams:t,onClose:o,params:s}){const{t:r}=oe(),[l,a]=j.useState(""),n=l&&s.blockletVideos.includes(l),u=pr(l),d=()=>{t(f=>{const x=[...f.blockletVideos];return x.push(l),{...f,blockletVideos:x}}),o()};return e.jsxs(ot,{open:!0,fullWidth:!0,maxWidth:"sm",children:[e.jsx($o,{children:r("studio.videoDialogTitle")}),e.jsxs(qo,{children:[e.jsx(Is,{fullWidth:!0,value:l,onChange:f=>a(f.target.value),placeholder:r("studio.videoInputLabel"),endAdornment:l?e.jsx(Ve,{position:"end",children:e.jsx(ce,{onClick:()=>a(""),children:e.jsx(Hs,{})})}):null,error:n}),n&&e.jsx(L,{variant:"body2",color:"error",children:r("studio.duplicateVideo")}),e.jsx(st,{url:l,style:{marginTop:"20px",borderRadius:"4px"}})]}),e.jsxs(Lo,{children:[e.jsx(ne,{onClick:()=>o(),children:r("studio.cancel")}),e.jsx(ne,{disabled:!u||n,onClick:d,children:r("studio.confirm")})]})]})}os.propTypes={onClose:i.func.isRequired,params:i.object.isRequired,setParams:i.func.isRequired};function xt({errors:t,storeList:o,...s}){const{t:r}=oe();return e.jsxs(c,{...s,color:"warning.main",fontSize:"14px",sx:{border:"1px solid rgba(214, 164, 64, 0.34)",borderRadius:"4px",py:2,px:1.5,position:"relative"},children:[e.jsx(L,{variant:"caption",sx:{fontWeight:"bold",position:"absolute",top:-10,left:12,backgroundColor:"white",px:1,width:"fit-content"},children:r("blocklet.publish.storeRule.warning")}),t&&Object.entries(t).map(([l,a])=>{const n=Object.values(a),u=o.find(d=>d.url===l);return n.length>0&&e.jsxs(c,{children:[e.jsx(me,{title:l,children:e.jsx(c,{component:"span",sx:{cursor:"pointer"},children:u.name})}),n.map(d=>e.jsx(c,{component:"li",ml:2,breakWords:!0,children:d},d))]},l)})]})}xt.propTypes={errors:i.object.isRequired,storeList:i.array.isRequired};const jo=j.lazy(()=>Oo(()=>import("./index-BLv5CM0y.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])).then(t=>({default:t.Uploader})));function ss({projectId:t,readOnly:o,loading:s,blocklet:r,params:l,setParams:a,paramsErrTip:n,setParamsErrTip:u,warning:d,setLoading:f,initUrl:x,initLogoUrl:S,setInitLogoUrl:C,componentDid:p}){const{t:h,locale:R}=oe(),{api:w}=ye(),k=gt(),I=j.useRef(null),v=j.useRef(null),[D,_]=lr(r),[q,E]=j.useState(!1),M=ln({messageType:"connect-store-message",onOpen:()=>f(!0),onClose:()=>f(!1)}),$=async P=>{const F=setTimeout(()=>{f(!1)},2e4),X=await cr(w,P);f(!1),clearTimeout(F),window.parent.postMessage({event:"studioDialog.connected",componentDid:p},"*"),k(window.location.pathname.replace(`${Y.UNOWNED_DID}/create`,`${X}/create`),{replace:!0})},Q=()=>{if(!l.blockletTitle){U.error(h("blocklet.publish.errorTip.noTitle"));return}if(!(D!=null&&D.url)){U.error(h("blocklet.publish.noStoreSelected"));return}const P=ir();M(async(F,X)=>{var ee,Z,ie;try{const K=await w.connectByStudio({input:{did:(ee=r==null?void 0:r.meta)==null?void 0:ee.did,blockletTitle:l==null?void 0:l.blockletTitle,storeUrl:D.url,storeId:D.id,storeName:D.name,type:((Z=l==null?void 0:l.blockletComponents)==null?void 0:Z.length)>0?"pack":"resource",componentDid:p,messageId:P,tenantScope:(x==null?void 0:x.searchParams.get("tenantScope"))||""}});if(!(K!=null&&K.url)){U.error("failed to connect to store");return}X(K.url),$({did:(ie=r==null?void 0:r.meta)==null?void 0:ie.did,projectId:"",messageId:P})}catch(K){const de=Ne(K);U.error(de),f(!1)}})},{logoUrl:O,screenshotUrls:m,uploadLogoPrefix:b,uploadScreenshotPrefix:y}=ts(l,r,t),{logoErrors:W,screenshotErrors:z,storeList:G,hasLogoWarning:g,hasScreenshotWarning:N}=d,H=()=>o?!1:!t||t===Y.UNOWNED_DID?(U.error(h("blocklet.publish.errorTip.noFirstDid")),!1):!0,J=P=>{if(!P.destination)return;const F=Array.from(l.blockletScreenshots),[X]=F.splice(P.source.index,1);F.splice(P.destination.index,0,X),a(ee=>({...ee,blockletScreenshots:F}))},ze=P=>{if(!P.destination)return;const F=Array.from(l.blockletVideos),[X]=F.splice(P.source.index,1);F.splice(P.destination.index,0,X),a(ee=>({...ee,blockletVideos:F}))};return e.jsxs(hr,{children:[e.jsx(c,{display:"flex",className:"section",children:e.jsxs(c,{sx:{flex:1},children:[e.jsx(se,{disabled:s||o,label:`Blocklet ${h("common.title")}`,placeholder:`Blocklet ${h("common.title")}`,InputProps:{"data-cy":"blocklet-title",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:l.blockletTitle||"",onChange:P=>{u({blockletTitle:""}),a({blockletTitle:P.target.value})},error:!!n.blockletTitle,helperText:n.blockletTitle||""}),e.jsx(se,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"export-blocklet-did",endAdornment:t===Y.UNOWNED_DID&&e.jsx(Ve,{position:"end",children:e.jsx(Ut,{blocklet:r,store:D,componentDid:p,onChangeStore:_,disabled:!l.blockletTitle||o||s,loading:s,onClick:Q})})},error:!!n.projectId,helperText:n.projectId||"",value:t===Y.UNOWNED_DID?"":`did:abt:${t}`,sx:{mt:3}}),e.jsx(se,{disabled:s||o,label:`Blocklet ${h("common.description")}`,placeholder:`Blocklet ${h("common.description")}`,InputProps:{"data-cy":"blocklet-description",readOnly:o},required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletDescription||"",onChange:P=>{u({blockletDescription:""}),a({blockletDescription:P.target.value})},error:!!n.blockletDescription,helperText:n.blockletDescription||"",sx:{mt:3}}),e.jsx(se,{disabled:s||o,label:`Blocklet ${h("common.homepageTip")}`,placeholder:`Blocklet ${h("common.homepageTip")}`,InputProps:{"data-cy":"blocklet-homepage",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletHomepage||"",onChange:P=>{P.target.value&&!/^(http|https):\/\//.test(P.target.value)?u({blockletHomepage:h("blocklet.publish.errorTip.invalidUrl")}):u({blockletHomepage:""}),a({blockletHomepage:P.target.value})},error:!!n.blockletHomepage,helperText:n.blockletHomepage||"",sx:{mt:3}}),e.jsx(se,{disabled:s||o,label:`Blocklet ${h("common.community")}`,placeholder:`Blocklet ${h("common.community")}`,InputProps:{"data-cy":"blocklet-community",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletCommunity||"",onChange:P=>{P.target.value&&!/^(http|https):\/\//.test(P.target.value)?u({blockletCommunity:h("blocklet.publish.errorTip.invalidUrl")}):u({blockletCommunity:""}),a({blockletCommunity:P.target.value})},error:!!n.blockletCommunity,helperText:n.blockletCommunity||"",sx:{mt:3}}),e.jsx(se,{disabled:s||o,label:`Blocklet ${h("common.support")}`,placeholder:`Blocklet ${h("common.support")}`,InputProps:{"data-cy":"blocklet-support",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletSupport||"",onChange:P=>{P.target.value&&!/^(http|https):\/\//.test(P.target.value)&&!/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(P.target.value)?u({blockletSupport:h("blocklet.publish.errorTip.invalidUrlOrEmail")}):u({blockletSupport:""}),a({blockletSupport:P.target.value})},error:!!n.blockletSupport,helperText:n.blockletSupport||"",sx:{mt:3}}),e.jsx(se,{disabled:s||o,label:`Blocklet ${h("common.repository")}`,placeholder:`Blocklet ${h("common.repository")}`,InputProps:{"data-cy":"blocklet-repository",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletRepository||"",onChange:P=>{P.target.value&&!/^(git|https|svn)/.test(P.target.value)?u({blockletRepository:h("blocklet.publish.errorTip.invalidUrl")}):u({blockletRepository:""}),a({blockletRepository:P.target.value})},error:!!n.blockletRepository,helperText:n.blockletRepository||"",sx:{mt:3}})]})}),e.jsx(c,{display:"flex",mt:3,className:"section full-width",children:e.jsxs(c,{flex:1,overflow:"hidden",children:[e.jsxs(c,{display:"flex",flexDirection:"row",flexWrap:"wrap",children:[e.jsxs(Se,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(L,{variant:"subtitle1",sx:{fontWeight:"bold"},children:h("common.logo")}),e.jsxs(Se,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[h("studio.type"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"#007ec6"},children:"png, jpg, webp, svg"})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[h("studio.ratio"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"#007ec6"},children:"256x256"})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[h("studio.size"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"#007ec6"},children:"<500Kb"})]})})]})]}),e.jsx(c,{sx:{flex:1,cursor:o?"default":"pointer",display:"flex",alignItems:"flex-end"},children:e.jsx(wo,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:S||O,onClick:()=>{var P;H()&&((P=I.current)==null||P.open())}})})]}),g&&e.jsx(xt,{errors:W,storeList:G,mt:3}),e.jsxs(c,{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap",children:[e.jsxs(Se,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(L,{variant:"subtitle1",sx:{fontWeight:"bold"},children:h("common.screenshot")}),e.jsxs(Se,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[e.jsx(c,{sx:{border:"none"},variant:"outlined",size:"small",children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[h("studio.ratio"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"#007ec6"},children:"16 / 9"})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[h("studio.count"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"#007ec6"},children:"1~5"})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[h("studio.size"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"#007ec6"},children:"<5MB"})]})}),!o&&e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[h("studio.order"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"#007ec6"},children:h("studio.orderTip")})]})})]})]}),e.jsx(ao,{onDragEnd:o?void 0:J,children:e.jsx(uo,{droppableId:"screenshots",direction:"horizontal",isDropDisabled:o,children:(P,F)=>e.jsxs(c,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap",minHeight:160,background:F.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:F.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:P.innerRef,...P.droppableProps,children:[m.map((X,ee)=>e.jsx(po,{draggableId:X,index:ee,isDragDisabled:o,children:(Z,ie)=>e.jsxs(c,{ref:Z.innerRef,...Z.draggableProps,className:"screenshot",sx:{transform:ie.isDragging?"scale(1.05)":"none",boxShadow:ie.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx("img",{alt:"screenshot",src:X}),!o&&e.jsx(ce,{...Z.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:e.jsx(bt,{})}),!o&&e.jsx(ce,{className:"action",onClick:()=>{a(K=>{const de=[...K.blockletScreenshots];return de.splice(ee,1),{...K,blockletScreenshots:de}})},children:e.jsx(co,{})})]})},X)),P.placeholder,m.length<5&&e.jsx(c,{sx:{width:240,height:135,background:"#eee",cursor:o?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{var X;H()&&((X=v.current)==null||X.open())},children:"+"})]})})})]}),N&&e.jsx(xt,{errors:z,storeList:G}),e.jsxs(c,{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap",children:[e.jsxs(Se,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(L,{variant:"subtitle1",sx:{fontWeight:"bold"},children:h("studio.video")}),e.jsxs(Se,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[h("studio.videoType"),":"," "]}),e.jsxs(c,{component:"span",sx:{color:"#007ec6"},children:[e.jsx("a",{href:"https://www.youtube.com/",target:"_blank",rel:"noreferrer",children:"Youtube"}),","," ",e.jsx("a",{href:"https://vimeo.com/",target:"_blank",rel:"noreferrer",children:"Vimeo"})]})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[h("studio.count"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"#007ec6"},children:"1~3"})]})}),!o&&e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[h("studio.order"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"#007ec6"},children:h("studio.orderTip")})]})})]})]}),e.jsx(ao,{onDragEnd:o?void 0:ze,children:e.jsx(uo,{droppableId:"videos",direction:"horizontal",isDropDisabled:o,children:(P,F)=>e.jsxs(c,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap",minHeight:160,background:F.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:F.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:P.innerRef,...P.droppableProps,children:[l.blockletVideos.map((X,ee)=>e.jsx(po,{draggableId:X,index:ee,isDragDisabled:o,children:(Z,ie)=>e.jsxs(c,{ref:Z.innerRef,...Z.draggableProps,className:"screenshot",sx:{transform:ie.isDragging?"scale(1.05)":"none",boxShadow:ie.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx(st,{url:X,style:{pointerEvents:ie.isDragging?"none":"auto"}}),!o&&e.jsx(ce,{...Z.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:e.jsx(bt,{})}),!o&&e.jsx(ce,{className:"action",onClick:()=>{a(K=>{const de=[...K.blockletVideos];return de.splice(ee,1),{...K,blockletVideos:de}})},children:e.jsx(co,{})})]})},X)),P.placeholder,l.blockletVideos.length<3&&e.jsx(c,{sx:{width:240,height:135,background:"#eee",cursor:o?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{H()&&E(!0)},children:"+"})]})})})]})]})}),e.jsxs(j.Suspense,{fallback:e.jsx(Fe,{}),children:[e.jsx(jo,{ref:I,locale:R,popup:!0,onUploadFinish:P=>{var F;a({blockletLogo:P.data.filename}),C(""),(F=I.current)==null||F.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:b,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/png","image/jpeg","image/webp","image/svg+xml"],maxFileSize:1024*1024*.5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{minWidth:256,minHeight:256}}}},"uploader-logo"),q&&e.jsx(os,{onClose:()=>E(!1),params:l,setParams:a}),e.jsx(jo,{ref:v,locale:R,popup:!0,onUploadFinish:P=>{var F;a(X=>{var Z;const ee=X.blockletScreenshots||[];return ee.push((Z=P.data)==null?void 0:Z.filename),{...X,blockletScreenshots:ee}}),(F=v.current)==null||F.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:y,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","image/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-m.length}},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,autoCropArea:1,aspectRatio:16/9,initialAspectRatio:16/9,croppedCanvasOptions:{minWidth:1280,minHeight:720,maxWidth:1280*2,maxHeight:720*2}}}},"uploader-screenshot")]})]})}ss.propTypes={projectId:i.string.isRequired,readOnly:i.bool.isRequired,params:i.object.isRequired,setParams:i.func.isRequired,paramsErrTip:i.object.isRequired,setParamsErrTip:i.func.isRequired,warning:i.object.isRequired,loading:i.bool.isRequired,blocklet:i.object.isRequired,setLoading:i.func.isRequired,initUrl:i.object.isRequired,componentDid:i.isRequired,initLogoUrl:i.string.isRequired,setInitLogoUrl:i.func.isRequired};const hr=ge.div`
129
129
  margin-top: 24px;
130
130
  .screenshot {
131
131
  margin-bottom: 16px;
@@ -173,7 +173,7 @@ import{r as j,k as gt,l as tt,L as xe,g as Rs,u as vs,h as Cs,i as ct}from"./ven
173
173
  padding-bottom: 12px;
174
174
  border-bottom: ${({theme:t})=>`1px solid ${t.palette.divider}`};
175
175
  }
176
- `;function as({text:t}){return t?e.jsx(xn,{wrapperElement:{"data-color-mode":"light"},source:Ys.sanitize(t),rehypePlugins:[[mn,{target:"_blank"}]]}):e.jsx(Ae,{Icon:Dt})}as.propTypes={text:i.string.isRequired};function ds({params:t,setParams:o,paramsErrTip:s,loading:r,setParamsErrTip:l,readOnly:a}){var x;const{t:n}=oe(),[u,d]=j.useState(a?"preview":"write"),f=(S,C)=>{d(C)};return e.jsxs(c,{sx:{border:"1px solid #fff",width:"100%",borderRadius:2},children:[e.jsxs(c,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[e.jsx(L,{variant:"h6",fontWeight:"bold",sx:{},children:n("common.introduction")}),e.jsxs(No,{value:u,onChange:f,"aria-label":"wrapped label tabs example",children:[e.jsx(Qe,{value:"write",label:"Write"}),e.jsx(Qe,{value:"preview",label:"Preview"})]})]}),e.jsx(c,{display:u==="write"?"block":"none",sx:{width:"100%",marginTop:3},children:e.jsx(se,{disabled:r||a,sx:{border:"none"},placeholder:`Blocklet ${n("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:a,endAdornment:e.jsxs(Ve,{position:"end",children:[((x=t==null?void 0:t.blockletIntroduction)==null?void 0:x.length)||0," / ",ue.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:t.blockletIntroduction||"",onChange:S=>{l({blockletIntroduction:""}),o({blockletIntroduction:S.target.value.slice(0,ue.PROJECT.MAX_INTRO_LENGTH)})},error:!!s.blockletIntroduction,helperText:s.blockletIntroduction||""})}),e.jsx(c,{display:u==="preview"?"block":"none",mt:3,children:e.jsx(as,{text:t.blockletIntroduction||""})})]})}ds.propTypes={params:i.object.isRequired,setParams:i.func.isRequired,paramsErrTip:i.object.isRequired,setParamsErrTip:i.func.isRequired,readOnly:i.bool.isRequired,loading:i.bool.isRequired};var Jt={},vr=ke;Object.defineProperty(Jt,"__esModule",{value:!0});var mt=Jt.default=void 0,Cr=vr(Re()),yo=e;mt=Jt.default=(0,Cr.default)([(0,yo.jsx)("circle",{cx:"12",cy:"19",r:"2"},"0"),(0,yo.jsx)("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function Gt({step:t,ok:o,active:s,error:r,warning:l}){let a="grey.500",n=t+1;return o&&(n=e.jsx(gn,{sx:{fontSize:18,margin:0},color:"white"})),r||!o&&s>t?(a="error.main",n=e.jsx(mt,{sx:{fontSize:18,margin:0},color:"white"})):l?(a="warning.main",n=e.jsx(mt,{sx:{fontSize:18,margin:0},color:"white"})):s>=t&&(a="primary.main"),e.jsx(c,{width:24,height:24,bgcolor:a,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center",children:n})}Gt.propTypes={step:i.number,ok:i.bool,active:i.number,error:i.string,warning:i.bool};Gt.defaultProps={step:0,ok:!1,active:0,error:"",warning:!1};function us({steps:t,activeStep:o,setActiveStep:s,hasSelectedResources:r,params:l,loading:a,paramsErrTip:n,warning:u,viewMode:d,projectId:f}){const{t:x}=oe(),S=()=>{s(R=>R+1)},C=()=>{s(R=>R-1)},p=R=>R===0?(n==null?void 0:n.blockletTitle)||(n==null?void 0:n.projectId)||(n==null?void 0:n.blockletDescription)||(n==null?void 0:n.blockletHomepage)||(n==null?void 0:n.blockletSupport)||(n==null?void 0:n.blockletCommunity)||(n==null?void 0:n.blockletRepository):R===2?(n==null?void 0:n.blockletResource)||(n==null?void 0:n.blockletDocker)||(n==null?void 0:n.dockerImageName):R>=4?(n==null?void 0:n.blockletVersion)||(n==null?void 0:n.note):"",h=d||rs({hasSelectedResources:r,params:l,projectId:f,t:x})===null;return e.jsxs(c,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid #ccc",borderRadius:2},children:[e.jsx($s,{activeStep:o,orientation:"vertical",children:t.map((R,w)=>{const k={},I=a||!yr({hasSelectedResources:r,params:l,projectId:f,step:w,t:x}),v=a?"":p(w);return v&&(k.optional=e.jsx(L,{variant:"caption",color:"error",children:v}),k.error=!0),e.jsxs(qs,{children:[e.jsx(Ls,{icon:e.jsx(Gt,{error:v,warning:w===0?u.hasWarning:!1,active:h?99:o,step:w,ok:I}),sx:{cursor:"pointer",color:v?"error.main":"inherit"},disabled:!1,onClick:()=>s(w),...k,children:e.jsx(L,{fontSize:"14px",fontWeight:"500",color:v||!I&&o>w?"error.main":"inherit",children:R.label})}),e.jsxs(Ns,{children:[e.jsx(L,{fontSize:12,children:R.description}),!h&&e.jsx(c,{sx:{mb:2},children:e.jsxs("div",{children:[w<t.length-1&&e.jsx(ne,{variant:"contained",onClick:S,sx:{mt:1,mr:1},disabled:v||!I,children:x("common.continue")}),w>0&&e.jsx(ne,{disabled:w===0,onClick:C,sx:{mt:1,mr:1},children:x("common.back")})]})})]})]},R.label)})}),o>=t.length-1&&e.jsx(jt,{square:!0,elevation:0,sx:{p:3},children:e.jsx(L,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}us.propTypes={steps:i.array.isRequired,activeStep:i.number.isRequired,setActiveStep:i.func.isRequired,params:i.object.isRequired,viewMode:i.string.isRequired,loading:i.bool.isRequired,projectId:i.string.isRequired,hasSelectedResources:i.bool.isRequired,warning:i.object.isRequired,paramsErrTip:i.shape({projectId:i.string,blockletVersion:i.string,blockletTitle:i.string,blockletDescription:i.string,note:i.string,blockletResource:i.string,blockletHomepage:i.string,blockletSupport:i.string,blockletCommunity:i.string,blockletRepository:i.string,blockletDocker:i.object,dockerImageName:i.string}).isRequired};const wr=[".zip",".gz"],Sr=1024*1024*100,Ir=j.lazy(()=>Oo(()=>import("./index-B64a4BbE.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])).then(t=>({default:t.Uploader})));function Xt({app:t,projectId:o,readOnly:s,params:r,setParams:l,setParamsErrTip:a,error:n}){const{t:u,locale:d}=oe(),f=j.useRef(null),x=()=>s?!1:!o||o===Y.UNOWNED_DID?(U.error(u("blocklet.publish.errorTip.noFirstDid")),!1):!0,S=`${Y.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${t.meta.did}/${o}/resource/upload`;return e.jsxs(c,{sx:{mt:3},children:[e.jsx(L,{gutterBottom:!0,children:u("blocklet.publish.resourceUpload")}),e.jsxs(Se,{direction:"row",alignItems:"center",spacing:1,sx:{flex:1,cursor:s?"default":"pointer"},children:[!!r.uploadedResource&&e.jsx(L,{component:"a",href:`${S}/params.uploadedResource`,children:r.uploadedResource}),!s&&e.jsx(ne,{variant:"outlined",size:"small",onClick:()=>{var C;x()&&((C=f.current)==null||C.open())},children:r.uploadedResource?u("common.change"):u("common.upload")})]}),e.jsx(j.Suspense,{fallback:e.jsx(Fe,{}),children:e.jsx(Ir,{ref:f,locale:d,popup:!0,onUploadFinish:C=>{var p;l({uploadedResource:C.data.filename}),a({blockletResource:""}),(p=f.current)==null||p.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:S,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileExts:wr,maxFileSize:Sr,maxNumberOfFiles:1}}},"uploader-resource")}),!!n&&e.jsx(c,{color:"error.main",mt:1,fontSize:14,children:n})]})}Xt.propTypes={app:i.object.isRequired,projectId:i.string.isRequired,readOnly:i.bool.isRequired,params:i.object.isRequired,setParams:i.func.isRequired,error:i.string.isRequired,setParamsErrTip:i.func.isRequired};Xt.defaultProps={};function Ke({readOnly:t,params:o,setParams:s,paramsErrTip:r,setParamsErrTip:l,loading:a}){var u;const{t:n}=oe();return e.jsx(c,{display:"flex",mt:3,className:"section",children:e.jsxs(c,{sx:{flex:1},children:[e.jsx(se,{required:!0,disabled:a||t,label:`Blocklet ${n("common.version")}`,placeholder:`Blocklet ${n("common.version")}`,InputProps:{"data-cy":"blocklet-version",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,value:o.blockletVersion||"",onChange:d=>{l({blockletVersion:""}),s({blockletVersion:d.target.value})},error:!!r.blockletVersion,helperText:r.blockletVersion||""}),e.jsx(se,{label:n("blocklet.publish.releaseNote"),autoComplete:"off",disabled:a||t,variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:t,endAdornment:e.jsxs(Ve,{position:"end",children:[((u=o==null?void 0:o.note)==null?void 0:u.length)||0," / ",ue.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:o.note||"",onChange:d=>{l({note:""}),s({note:d.target.value.slice(0,ue.PROJECT.MAX_NOTE_LENGTH)})},error:!!r.note,helperText:r.note||"",sx:{mt:3}})]})})}Ke.propTypes={readOnly:i.bool.isRequired,params:i.object.isRequired,setParams:i.func.isRequired,paramsErrTip:i.object.isRequired,setParamsErrTip:i.func.isRequired,loading:i.bool.isRequired};Ke.defaultProps={};function ps(t){for(const o in t)typeof t[o]=="string"?t[o]=t[o].replace(/\\\\/g,"\\"):typeof t[o]=="object"&&t[o]!==null&&ps(t[o]);return t}function et({index:t,item:o,dockerParams:s,setDockerParams:r,dataKey:l,t:a,readOnly:n}){const u=(o==null?void 0:o.value)||"",[d,f]=j.useState(!1),x=()=>{var O;(O=s[l])==null||O.splice(t,1),r({...s,[l]:[...s[l]]})},S=(O,m)=>{var b;(b=s[l])!=null&&b[t]&&(m?(s[l][t].custom=s[l][t].value,s[l][t].value=`$${dt(o.key)}`):(s[l][t].value=s[l][t].custom||"",s[l][t].custom="")),r({...s,[l]:[...s[l]]})},C=(O,m)=>{var y;const b=((y=s[l][t])==null?void 0:y.value)||"";s[l][t]={...s[l][t],secure:m,value:m&&b===ue.BLOCKLET_AUTOMATIC_ENV_VALUE?"":b},r({...s,[l]:[...s[l]]})},p=(O,m)=>{s[l][t]={...s[l][t],shared:m},r({...s,[l]:[...s[l]]})},h=(O,m)=>{var y;const b=((y=s[l][t])==null?void 0:y.value)||"";s[l][t]={...s[l][t],required:m,value:m&&b===ue.BLOCKLET_AUTOMATIC_ENV_VALUE?"":b},r({...s,[l]:[...s[l]]})},R=(O,m)=>{s[l][t]={...s[l][t],value:m?ue.BLOCKLET_AUTOMATIC_ENV_VALUE:"",secure:!1,required:!1},r({...s,[l]:[...s[l]]})},w=O=>{s[l][t]={...s[l][t],description:O.target.value},r({...s,[l]:[...s[l]]})},k=O=>{const m=O.target.value==="web"?"web":"docker";m==="web"&&s.dockerArgs.forEach(W=>{W.type="docker"});const y=`/${s.dockerImage.replace(/\W/g,"-")}-${t}`;s.dockerArgs[t]={...s.dockerArgs[t],type:m,path:m==="docker"?y:"/",protocol:"http",prefix:m==="docker"?y:"/",name:"publicUrl",port:"BLOCKLET_PORT"},r({...s,dockerArgs:[...s.dockerArgs]})},I=O=>{s.dockerArgs[t]={...s.dockerArgs[t],proxyBehavior:O.target.value==="direct"?"direct":"service"},r({...s,dockerArgs:[...s.dockerArgs]})},v=O=>{const m=O.target.value;s[l][t]={...s[l][t],prefix:m,path:m==="*"?"/":m},r({...s,[l]:[...s[l]]})},D=O=>{var m;(m=s[l])!=null&&m[t]&&(s[l][t].value=O.target.value),r({...s,[l]:[...s[l]]})},_=u===`$${dt(o.key)}`||o.custom,q=l==="dockerArgs"&&!Uo[o.key],E=dn[o.key],M=l==="dockerEnvs",$=o.key==="--publish";let Q=o.key;return $&&o.type==="web"?Q="--publish (Web)":M&&(Q=`--env ${o.key}`),e.jsxs(c,{sx:{display:"flex",flexDirection:"row",gap:2,alignItems:"center"},children:[e.jsx(c,{sx:{width:250},children:e.jsx(L,{sx:{textOverflow:"ellipsis",width:"100%",overflow:"hidden"},children:Q})}),e.jsxs(c,{sx:{display:"flex",flexDirection:"column",gap:1,flex:1},children:[e.jsx(se,{disabled:n||_||q||o.value===ue.BLOCKLET_AUTOMATIC_ENV_VALUE,placeholder:"",value:_?`$${dt(o.key)}`:u,sx:{flex:1},InputProps:{endAdornment:e.jsxs(Ve,{position:"end",sx:{zoom:.9},children:[(!(E||q)||M||$)&&e.jsx(ce,{onClick:()=>f(!0),children:e.jsx(ae,{icon:"icon-park-outline:setting-config"})}),!n&&e.jsx(ce,{onClick:x,color:q?"error":"default",children:e.jsx(ae,{icon:"ic:round-delete"})})]})},error:q,onChange:D}),q&&e.jsx(L,{variant:"caption",color:"error",children:a("blocklet.publish.docker.noAllowTheArg")}),o.key==="--publish"&&e.jsx(L,{variant:"caption",color:"text.secondary",children:a("blocklet.publish.docker.publishTips")}),o.key==="--volume"&&un[o.key](u)&&e.jsx(L,{variant:"caption",color:"error",children:a("blocklet.publish.docker.volumeTips")})]}),d&&e.jsx(yt,{open:!0,fullWidth:!0,maxWidth:"sm",PaperProps:{style:{minHeight:0}},title:a(M?"blocklet.publish.docker.modifyEnv":"blocklet.publish.docker.modifyParam"),onClose:()=>f(!1),children:e.jsxs(c,{sx:{display:"flex",flexDirection:"column",gap:1,paddingBottom:2},children:[E||q||M?null:e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(L,{children:a("blocklet.publish.docker.needCustomInput")}),e.jsx(De,{disabled:n,checked:_,onChange:S,sx:{zoom:.9}})]}),M&&e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(L,{children:a("blocklet.publish.docker.shared")}),e.jsx(De,{disabled:n,checked:o.shared,onChange:p,sx:{zoom:.9}})]}),M&&e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(L,{children:a("blocklet.publish.docker.required")}),e.jsx(De,{disabled:n,checked:o.required,onChange:h,sx:{zoom:.9}})]}),M&&e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(L,{children:a("blocklet.publish.docker.secure")}),e.jsx(De,{disabled:n,checked:o.secure,onChange:C,sx:{zoom:.9}})]}),M&&e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(L,{children:a("blocklet.publish.docker.autoGenerated")}),e.jsx(De,{disabled:n,checked:o.value===ue.BLOCKLET_AUTOMATIC_ENV_VALUE,onChange:R,sx:{zoom:.9}})]}),M&&e.jsxs(c,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(L,{sx:{flex:1},children:a("blocklet.publish.docker.description")}),e.jsx(se,{disabled:n,value:o.description,onChange:w,sx:{flex:1},label:a("blocklet.publish.docker.description")})]}),$&&e.jsxs(c,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(L,{sx:{flex:1},children:a("blocklet.publish.docker.portType")}),e.jsxs(ft,{value:o.type||"docker",onChange:k,children:[e.jsx(fe,{value:"docker",children:"Docker"}),e.jsx(fe,{value:"web",children:"Web"})]})]}),$&&o.type==="web"&&e.jsxs(c,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(L,{sx:{flex:1},children:a("blocklet.publish.docker.proxyBehavior")}),e.jsxs(ft,{value:o.proxyBehavior||"service",onChange:I,children:[e.jsx(fe,{value:"service",children:a("blocklet.publish.docker.serviceProxy")}),e.jsx(fe,{value:"direct",children:a("blocklet.publish.docker.directProxy")})]})]}),$&&o.type==="web"&&e.jsxs(c,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(L,{sx:{flex:1},children:a("blocklet.publish.docker.prefix")}),e.jsx(se,{disabled:n,value:o.prefix,onChange:v,sx:{flex:1},label:a("blocklet.publish.docker.prefix")})]})]})})]})}et.propTypes={dockerParams:i.object.isRequired,setDockerParams:i.func.isRequired,dataKey:i.string.isRequired,item:i.object.isRequired,t:i.func.isRequired,readOnly:i.bool.isRequired,index:i.number.isRequired};et.defaultProps={};const Dr=`
176
+ `;function as({text:t}){return t?e.jsx(xn,{wrapperElement:{"data-color-mode":"light"},source:Ys.sanitize(t),rehypePlugins:[[mn,{target:"_blank"}]]}):e.jsx(Ae,{Icon:Dt})}as.propTypes={text:i.string.isRequired};function ds({params:t,setParams:o,paramsErrTip:s,loading:r,setParamsErrTip:l,readOnly:a}){var x;const{t:n}=oe(),[u,d]=j.useState(a?"preview":"write"),f=(S,C)=>{d(C)};return e.jsxs(c,{sx:{border:"1px solid #fff",width:"100%",borderRadius:2},children:[e.jsxs(c,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[e.jsx(L,{variant:"h6",fontWeight:"bold",sx:{},children:n("common.introduction")}),e.jsxs(No,{value:u,onChange:f,"aria-label":"wrapped label tabs example",children:[e.jsx(Qe,{value:"write",label:"Write"}),e.jsx(Qe,{value:"preview",label:"Preview"})]})]}),e.jsx(c,{display:u==="write"?"block":"none",sx:{width:"100%",marginTop:3},children:e.jsx(se,{disabled:r||a,sx:{border:"none"},placeholder:`Blocklet ${n("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:a,endAdornment:e.jsxs(Ve,{position:"end",children:[((x=t==null?void 0:t.blockletIntroduction)==null?void 0:x.length)||0," / ",ue.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:t.blockletIntroduction||"",onChange:S=>{l({blockletIntroduction:""}),o({blockletIntroduction:S.target.value.slice(0,ue.PROJECT.MAX_INTRO_LENGTH)})},error:!!s.blockletIntroduction,helperText:s.blockletIntroduction||""})}),e.jsx(c,{display:u==="preview"?"block":"none",mt:3,children:e.jsx(as,{text:t.blockletIntroduction||""})})]})}ds.propTypes={params:i.object.isRequired,setParams:i.func.isRequired,paramsErrTip:i.object.isRequired,setParamsErrTip:i.func.isRequired,readOnly:i.bool.isRequired,loading:i.bool.isRequired};var Jt={},vr=ke;Object.defineProperty(Jt,"__esModule",{value:!0});var mt=Jt.default=void 0,Cr=vr(Re()),yo=e;mt=Jt.default=(0,Cr.default)([(0,yo.jsx)("circle",{cx:"12",cy:"19",r:"2"},"0"),(0,yo.jsx)("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function Gt({step:t,ok:o,active:s,error:r,warning:l}){let a="grey.500",n=t+1;return o&&(n=e.jsx(gn,{sx:{fontSize:18,margin:0},color:"white"})),r||!o&&s>t?(a="error.main",n=e.jsx(mt,{sx:{fontSize:18,margin:0},color:"white"})):l?(a="warning.main",n=e.jsx(mt,{sx:{fontSize:18,margin:0},color:"white"})):s>=t&&(a="primary.main"),e.jsx(c,{width:24,height:24,bgcolor:a,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center",children:n})}Gt.propTypes={step:i.number,ok:i.bool,active:i.number,error:i.string,warning:i.bool};Gt.defaultProps={step:0,ok:!1,active:0,error:"",warning:!1};function us({steps:t,activeStep:o,setActiveStep:s,hasSelectedResources:r,params:l,loading:a,paramsErrTip:n,warning:u,viewMode:d,projectId:f}){const{t:x}=oe(),S=()=>{s(R=>R+1)},C=()=>{s(R=>R-1)},p=R=>R===0?(n==null?void 0:n.blockletTitle)||(n==null?void 0:n.projectId)||(n==null?void 0:n.blockletDescription)||(n==null?void 0:n.blockletHomepage)||(n==null?void 0:n.blockletSupport)||(n==null?void 0:n.blockletCommunity)||(n==null?void 0:n.blockletRepository):R===2?(n==null?void 0:n.blockletResource)||(n==null?void 0:n.blockletDocker)||(n==null?void 0:n.dockerImageName):R>=4?(n==null?void 0:n.blockletVersion)||(n==null?void 0:n.note):"",h=d||rs({hasSelectedResources:r,params:l,projectId:f,t:x})===null;return e.jsxs(c,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid #ccc",borderRadius:2},children:[e.jsx($s,{activeStep:o,orientation:"vertical",children:t.map((R,w)=>{const k={},I=a||!yr({hasSelectedResources:r,params:l,projectId:f,step:w,t:x}),v=a?"":p(w);return v&&(k.optional=e.jsx(L,{variant:"caption",color:"error",children:v}),k.error=!0),e.jsxs(qs,{children:[e.jsx(Ls,{icon:e.jsx(Gt,{error:v,warning:w===0?u.hasWarning:!1,active:h?99:o,step:w,ok:I}),sx:{cursor:"pointer",color:v?"error.main":"inherit"},disabled:!1,onClick:()=>s(w),...k,children:e.jsx(L,{fontSize:"14px",fontWeight:"500",color:v||!I&&o>w?"error.main":"inherit",children:R.label})}),e.jsxs(Ns,{children:[e.jsx(L,{fontSize:12,children:R.description}),!h&&e.jsx(c,{sx:{mb:2},children:e.jsxs("div",{children:[w<t.length-1&&e.jsx(ne,{variant:"contained",onClick:S,sx:{mt:1,mr:1},disabled:v||!I,children:x("common.continue")}),w>0&&e.jsx(ne,{disabled:w===0,onClick:C,sx:{mt:1,mr:1},children:x("common.back")})]})})]})]},R.label)})}),o>=t.length-1&&e.jsx(jt,{square:!0,elevation:0,sx:{p:3},children:e.jsx(L,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}us.propTypes={steps:i.array.isRequired,activeStep:i.number.isRequired,setActiveStep:i.func.isRequired,params:i.object.isRequired,viewMode:i.string.isRequired,loading:i.bool.isRequired,projectId:i.string.isRequired,hasSelectedResources:i.bool.isRequired,warning:i.object.isRequired,paramsErrTip:i.shape({projectId:i.string,blockletVersion:i.string,blockletTitle:i.string,blockletDescription:i.string,note:i.string,blockletResource:i.string,blockletHomepage:i.string,blockletSupport:i.string,blockletCommunity:i.string,blockletRepository:i.string,blockletDocker:i.object,dockerImageName:i.string}).isRequired};const wr=[".zip",".gz"],Sr=1024*1024*100,Ir=j.lazy(()=>Oo(()=>import("./index-BLv5CM0y.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])).then(t=>({default:t.Uploader})));function Xt({app:t,projectId:o,readOnly:s,params:r,setParams:l,setParamsErrTip:a,error:n}){const{t:u,locale:d}=oe(),f=j.useRef(null),x=()=>s?!1:!o||o===Y.UNOWNED_DID?(U.error(u("blocklet.publish.errorTip.noFirstDid")),!1):!0,S=`${Y.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${t.meta.did}/${o}/resource/upload`;return e.jsxs(c,{sx:{mt:3},children:[e.jsx(L,{gutterBottom:!0,children:u("blocklet.publish.resourceUpload")}),e.jsxs(Se,{direction:"row",alignItems:"center",spacing:1,sx:{flex:1,cursor:s?"default":"pointer"},children:[!!r.uploadedResource&&e.jsx(L,{component:"a",href:`${S}/params.uploadedResource`,children:r.uploadedResource}),!s&&e.jsx(ne,{variant:"outlined",size:"small",onClick:()=>{var C;x()&&((C=f.current)==null||C.open())},children:r.uploadedResource?u("common.change"):u("common.upload")})]}),e.jsx(j.Suspense,{fallback:e.jsx(Fe,{}),children:e.jsx(Ir,{ref:f,locale:d,popup:!0,onUploadFinish:C=>{var p;l({uploadedResource:C.data.filename}),a({blockletResource:""}),(p=f.current)==null||p.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:S,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileExts:wr,maxFileSize:Sr,maxNumberOfFiles:1}}},"uploader-resource")}),!!n&&e.jsx(c,{color:"error.main",mt:1,fontSize:14,children:n})]})}Xt.propTypes={app:i.object.isRequired,projectId:i.string.isRequired,readOnly:i.bool.isRequired,params:i.object.isRequired,setParams:i.func.isRequired,error:i.string.isRequired,setParamsErrTip:i.func.isRequired};Xt.defaultProps={};function Ke({readOnly:t,params:o,setParams:s,paramsErrTip:r,setParamsErrTip:l,loading:a}){var u;const{t:n}=oe();return e.jsx(c,{display:"flex",mt:3,className:"section",children:e.jsxs(c,{sx:{flex:1},children:[e.jsx(se,{required:!0,disabled:a||t,label:`Blocklet ${n("common.version")}`,placeholder:`Blocklet ${n("common.version")}`,InputProps:{"data-cy":"blocklet-version",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,value:o.blockletVersion||"",onChange:d=>{l({blockletVersion:""}),s({blockletVersion:d.target.value})},error:!!r.blockletVersion,helperText:r.blockletVersion||""}),e.jsx(se,{label:n("blocklet.publish.releaseNote"),autoComplete:"off",disabled:a||t,variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:t,endAdornment:e.jsxs(Ve,{position:"end",children:[((u=o==null?void 0:o.note)==null?void 0:u.length)||0," / ",ue.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:o.note||"",onChange:d=>{l({note:""}),s({note:d.target.value.slice(0,ue.PROJECT.MAX_NOTE_LENGTH)})},error:!!r.note,helperText:r.note||"",sx:{mt:3}})]})})}Ke.propTypes={readOnly:i.bool.isRequired,params:i.object.isRequired,setParams:i.func.isRequired,paramsErrTip:i.object.isRequired,setParamsErrTip:i.func.isRequired,loading:i.bool.isRequired};Ke.defaultProps={};function ps(t){for(const o in t)typeof t[o]=="string"?t[o]=t[o].replace(/\\\\/g,"\\"):typeof t[o]=="object"&&t[o]!==null&&ps(t[o]);return t}function et({index:t,item:o,dockerParams:s,setDockerParams:r,dataKey:l,t:a,readOnly:n}){const u=(o==null?void 0:o.value)||"",[d,f]=j.useState(!1),x=()=>{var O;(O=s[l])==null||O.splice(t,1),r({...s,[l]:[...s[l]]})},S=(O,m)=>{var b;(b=s[l])!=null&&b[t]&&(m?(s[l][t].custom=s[l][t].value,s[l][t].value=`$${dt(o.key)}`):(s[l][t].value=s[l][t].custom||"",s[l][t].custom="")),r({...s,[l]:[...s[l]]})},C=(O,m)=>{var y;const b=((y=s[l][t])==null?void 0:y.value)||"";s[l][t]={...s[l][t],secure:m,value:m&&b===ue.BLOCKLET_AUTOMATIC_ENV_VALUE?"":b},r({...s,[l]:[...s[l]]})},p=(O,m)=>{s[l][t]={...s[l][t],shared:m},r({...s,[l]:[...s[l]]})},h=(O,m)=>{var y;const b=((y=s[l][t])==null?void 0:y.value)||"";s[l][t]={...s[l][t],required:m,value:m&&b===ue.BLOCKLET_AUTOMATIC_ENV_VALUE?"":b},r({...s,[l]:[...s[l]]})},R=(O,m)=>{s[l][t]={...s[l][t],value:m?ue.BLOCKLET_AUTOMATIC_ENV_VALUE:"",secure:!1,required:!1},r({...s,[l]:[...s[l]]})},w=O=>{s[l][t]={...s[l][t],description:O.target.value},r({...s,[l]:[...s[l]]})},k=O=>{const m=O.target.value==="web"?"web":"docker";m==="web"&&s.dockerArgs.forEach(W=>{W.type="docker"});const y=`/${s.dockerImage.replace(/\W/g,"-")}-${t}`;s.dockerArgs[t]={...s.dockerArgs[t],type:m,path:m==="docker"?y:"/",protocol:"http",prefix:m==="docker"?y:"/",name:"publicUrl",port:"BLOCKLET_PORT"},r({...s,dockerArgs:[...s.dockerArgs]})},I=O=>{s.dockerArgs[t]={...s.dockerArgs[t],proxyBehavior:O.target.value==="direct"?"direct":"service"},r({...s,dockerArgs:[...s.dockerArgs]})},v=O=>{const m=O.target.value;s[l][t]={...s[l][t],prefix:m,path:m==="*"?"/":m},r({...s,[l]:[...s[l]]})},D=O=>{var m;(m=s[l])!=null&&m[t]&&(s[l][t].value=O.target.value),r({...s,[l]:[...s[l]]})},_=u===`$${dt(o.key)}`||o.custom,q=l==="dockerArgs"&&!Uo[o.key],E=dn[o.key],M=l==="dockerEnvs",$=o.key==="--publish";let Q=o.key;return $&&o.type==="web"?Q="--publish (Web)":M&&(Q=`--env ${o.key}`),e.jsxs(c,{sx:{display:"flex",flexDirection:"row",gap:2,alignItems:"center"},children:[e.jsx(c,{sx:{width:250},children:e.jsx(L,{sx:{textOverflow:"ellipsis",width:"100%",overflow:"hidden"},children:Q})}),e.jsxs(c,{sx:{display:"flex",flexDirection:"column",gap:1,flex:1},children:[e.jsx(se,{disabled:n||_||q||o.value===ue.BLOCKLET_AUTOMATIC_ENV_VALUE,placeholder:"",value:_?`$${dt(o.key)}`:u,sx:{flex:1},InputProps:{endAdornment:e.jsxs(Ve,{position:"end",sx:{zoom:.9},children:[(!(E||q)||M||$)&&e.jsx(ce,{onClick:()=>f(!0),children:e.jsx(ae,{icon:"icon-park-outline:setting-config"})}),!n&&e.jsx(ce,{onClick:x,color:q?"error":"default",children:e.jsx(ae,{icon:"ic:round-delete"})})]})},error:q,onChange:D}),q&&e.jsx(L,{variant:"caption",color:"error",children:a("blocklet.publish.docker.noAllowTheArg")}),o.key==="--publish"&&e.jsx(L,{variant:"caption",color:"text.secondary",children:a("blocklet.publish.docker.publishTips")}),o.key==="--volume"&&un[o.key](u)&&e.jsx(L,{variant:"caption",color:"error",children:a("blocklet.publish.docker.volumeTips")})]}),d&&e.jsx(yt,{open:!0,fullWidth:!0,maxWidth:"sm",PaperProps:{style:{minHeight:0}},title:a(M?"blocklet.publish.docker.modifyEnv":"blocklet.publish.docker.modifyParam"),onClose:()=>f(!1),children:e.jsxs(c,{sx:{display:"flex",flexDirection:"column",gap:1,paddingBottom:2},children:[E||q||M?null:e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(L,{children:a("blocklet.publish.docker.needCustomInput")}),e.jsx(De,{disabled:n,checked:_,onChange:S,sx:{zoom:.9}})]}),M&&e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(L,{children:a("blocklet.publish.docker.shared")}),e.jsx(De,{disabled:n,checked:o.shared,onChange:p,sx:{zoom:.9}})]}),M&&e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(L,{children:a("blocklet.publish.docker.required")}),e.jsx(De,{disabled:n,checked:o.required,onChange:h,sx:{zoom:.9}})]}),M&&e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(L,{children:a("blocklet.publish.docker.secure")}),e.jsx(De,{disabled:n,checked:o.secure,onChange:C,sx:{zoom:.9}})]}),M&&e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(L,{children:a("blocklet.publish.docker.autoGenerated")}),e.jsx(De,{disabled:n,checked:o.value===ue.BLOCKLET_AUTOMATIC_ENV_VALUE,onChange:R,sx:{zoom:.9}})]}),M&&e.jsxs(c,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(L,{sx:{flex:1},children:a("blocklet.publish.docker.description")}),e.jsx(se,{disabled:n,value:o.description,onChange:w,sx:{flex:1},label:a("blocklet.publish.docker.description")})]}),$&&e.jsxs(c,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(L,{sx:{flex:1},children:a("blocklet.publish.docker.portType")}),e.jsxs(ft,{value:o.type||"docker",onChange:k,children:[e.jsx(fe,{value:"docker",children:"Docker"}),e.jsx(fe,{value:"web",children:"Web"})]})]}),$&&o.type==="web"&&e.jsxs(c,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(L,{sx:{flex:1},children:a("blocklet.publish.docker.proxyBehavior")}),e.jsxs(ft,{value:o.proxyBehavior||"service",onChange:I,children:[e.jsx(fe,{value:"service",children:a("blocklet.publish.docker.serviceProxy")}),e.jsx(fe,{value:"direct",children:a("blocklet.publish.docker.directProxy")})]})]}),$&&o.type==="web"&&e.jsxs(c,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(L,{sx:{flex:1},children:a("blocklet.publish.docker.prefix")}),e.jsx(se,{disabled:n,value:o.prefix,onChange:v,sx:{flex:1},label:a("blocklet.publish.docker.prefix")})]})]})})]})}et.propTypes={dockerParams:i.object.isRequired,setDockerParams:i.func.isRequired,dataKey:i.string.isRequired,item:i.object.isRequired,t:i.func.isRequired,readOnly:i.bool.isRequired,index:i.number.isRequired};et.defaultProps={};const Dr=`
177
177
  docker run --name postgrest
178
178
  -p 3000:3000
179
179
  -e PGRST_DB_URI="postgres://username:password@host:port/database"
@@ -1,4 +1,4 @@
1
- import{r as Y,t as Fn,g as $n,e as Or,a as Vn}from"./vendor-react-DoD83n6N.js";import{a8 as rn,j as n,aa as ne,bo as Gt,br as Qt,bn as Xt,q as wt,T as Be,O as lt,a9 as rt,bx as ir,aj as tt,H as K,ag as je,ab as ut,w as zn,y as nn,bl as Wn,b4 as Hn,b5 as Zn,I as Yn,bk as Gn,bs as Qn,bO as Xn}from"./vendor-mui-core-DxD1UA4o.js";import{p as Ie,B as Jt,c as er,Z as Jn,as as ei,n as Rr,y as ti,z as ri}from"./vendor-utils-CTIzdAFg.js";import{r as on,bQ as ft,bR as ni,bS as ii,bT as an,bU as oi,bV as ai,bW as si,bX as sn,bY as ci,bZ as or,b_ as li,bA as ui,b$ as fi,c0 as di,aF as ar,c1 as cn,aE as pi,l as mi,u as Te,X as ln,W as hi,ak as Ze,B as Ee,k as gi,am as yi,d as vi,a$ as dt,Y as Me,bH as bi,p as Ye,_ as un,ag as xi,h as wi,aq as Ei,b1 as ji,a5 as fn,a4 as dn,bM as Si,V as Ci}from"./vendor-ux-did-connect-CiLSrCOH.js";import{c as Ge,N as Pi,M as pn,B as Et,w as Ai,O as Ii}from"./vendor-arcblock-BtlDhznp.js";import{d as Oi}from"./ViewList-BzGRahvc.js";import{Y as Ri,f as Ti,z as Pe,ao as sr,l as Qe,Z as Ni,M as Xe,ap as Di,C as mn,aq as hn,t as _i,b as Li}from"./index-tjRN_EVx.js";import{k as Ui,u as cr,a as lr,l as ki}from"./vendor-hooks-BwVH-TAd.js";import{u as Ne,d as Tr,W as gn}from"./dashboard-oxsbu66O.js";import{W as jt}from"./did-address-GAxLGeWB.js";import{P as Ke}from"./permission-C5Df-sxb.js";import{C as It}from"./click-to-copy-Cygm8U3_.js";import{T as yn}from"./index-CyBxUW5e.js";import{f as Fe}from"./format-error-LAoTjvJe.js";import{u as qi}from"./useAsync-DkPaceIy.js";import{I as Ce}from"./index-BRz2myBK.js";import{d as Bi}from"./DeleteOutline-7AloJjcV.js";import{C as pt}from"./confirm-BX8_-j-l.js";import{u as mt}from"./session-DaQ4KCFD.js";import{i as vn,a as St,p as bn}from"./util-Csa0tyHO.js";import{b as Ki}from"./sdk-DRKovxXZ.js";import{A as Mi}from"./actions-BOikuUJD.js";import{S as Fi}from"./shorten-label-CwDvu4_S.js";import"./lottie-web-B6s7dDoL.js";import"./useLocalStorage-BXnF_60k.js";import"./PlayArrow-NjIpSDwJ.js";import"./get-safe-url-ZRaKUVld.js";import"./index-DIckhHU5.js";import"./useAsyncRetry-k063P8TB.js";import"./useAsync-BmW5cnbx.js";import"./InfoOutlined-DO0_Vjz-.js";import"./useSetState-BL3ktMon.js";import"./use-mobile-CHMVa8_W.js";import"./vendor-mui-x-Bit8yv3W.js";import"./AdapterDayjs-B7fWFwN5.js";import"./base32-CQfYcymN.js";import"./MoreHoriz-B8cBSV22.js";var ur={},$i=rn;Object.defineProperty(ur,"__esModule",{value:!0});var xn=ur.default=void 0,Vi=$i(on()),zi=n;xn=ur.default=(0,Vi.default)((0,zi.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 fr=function(e){return n.jsxs("svg",{...e,children:[n.jsx("g",{clipPath:"url(#clip0)",children:n.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"})}),n.jsx("defs",{children:n.jsx("clipPath",{id:"clip0",children:n.jsx("rect",{width:"18",height:"18",transform:"translate(0 0.5)"})})})]})};fr.defaultProps={width:"18",height:"19",viewBox:"0 0 18 19",xmlns:"http://www.w3.org/2000/svg"};fr.displayName="person";const Wi=fr;var dr=function(e){return n.jsxs("svg",{...e,children:[n.jsx("path",{d:"M1.25 2.7087C1.25 2.24826 1.62326 1.875 2.0837 1.875H14.339C14.7995 1.875 15.1727 2.24826 15.1727 2.7087V9.31574C15.1727 9.77618 14.7995 10.1494 14.339 10.1494C13.8786 10.1494 13.5053 9.77618 13.5053 9.31574V3.54239H2.91739V16.7565H6.53772H8.34788H9.32435C9.78479 16.7565 10.158 17.1297 10.158 17.5902C10.158 18.0506 9.78479 18.4239 9.32435 18.4239H8.34788H2.0837C1.62326 18.4239 1.25 18.0506 1.25 17.5902V2.7087Z"}),n.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.21129 7.91935C7.70481 7.91935 7.29422 8.32993 7.29422 8.83641C7.29422 9.34289 7.70481 9.75348 8.21129 9.75348C8.71777 9.75348 9.12836 9.34289 9.12836 8.83641C9.12836 8.32993 8.71777 7.91935 8.21129 7.91935ZM5.62683 8.83641C5.62683 7.40905 6.78393 6.25195 8.21129 6.25195C9.63865 6.25195 10.7957 7.40905 10.7957 8.83641C10.7957 10.2638 9.63865 11.4209 8.21129 11.4209C6.78393 11.4209 5.62683 10.2638 5.62683 8.83641Z"}),n.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.62683 13.2133C5.62683 12.7529 6.00009 12.3796 6.46053 12.3796H9.96205C10.4225 12.3796 10.7957 12.7529 10.7957 13.2133C10.7957 13.6737 10.4225 14.047 9.96205 14.047H6.46053C6.00009 14.047 5.62683 13.6737 5.62683 13.2133Z"}),n.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.6406 11.3125C15.8547 11.3125 16.0503 11.434 16.145 11.626L17.1779 13.7184L19.4876 14.056C19.6994 14.087 19.8753 14.2355 19.9413 14.4391C20.0074 14.6427 19.9521 14.8662 19.7987 15.0156L18.1279 16.643L18.5222 18.9421C18.5584 19.1532 18.4716 19.3665 18.2984 19.4923C18.1252 19.6182 17.8955 19.6347 17.706 19.5351L15.6406 18.4489L13.5753 19.5351C13.3858 19.6347 13.1561 19.6182 12.9829 19.4923C12.8096 19.3665 12.7229 19.1532 12.7591 18.9421L13.1534 16.643L11.4825 15.0156C11.3292 14.8662 11.2739 14.6427 11.3399 14.4391C11.406 14.2355 11.5818 14.087 11.7937 14.056L14.1034 13.7184L15.1362 11.626C15.231 11.434 15.4265 11.3125 15.6406 11.3125ZM15.6406 13.1458L14.9815 14.4813C14.8996 14.6471 14.7414 14.7621 14.5584 14.7889L13.0835 15.0044L14.1503 16.0435C14.283 16.1727 14.3435 16.359 14.3122 16.5416L14.0606 18.0088L15.3788 17.3155C15.5427 17.2293 15.7386 17.2293 15.9025 17.3155L17.2207 18.0088L16.969 16.5416C16.9377 16.359 16.9983 16.1727 17.131 16.0435L18.1978 15.0044L16.7229 14.7889C16.5399 14.7621 16.3817 14.6471 16.2998 14.4813L15.6406 13.1458Z"})]})};dr.defaultProps={width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"};dr.displayName="external-issuer";const wn=dr;var bt={},Hi=e=>encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),En="%[a-f0-9]{2}",Nr=new RegExp("("+En+")|([^%]+?)","gi"),Dr=new RegExp("("+En+")+","gi");function tr(e,t){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;t=t||1;var r=e.slice(0,t),i=e.slice(t);return Array.prototype.concat.call([],tr(r),tr(i))}function Zi(e){try{return decodeURIComponent(e)}catch{for(var t=e.match(Nr)||[],r=1;r<t.length;r++)e=tr(t,r).join(""),t=e.match(Nr)||[];return e}}function Yi(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},r=Dr.exec(e);r;){try{t[r[0]]=decodeURIComponent(r[0])}catch{var i=Zi(r[0]);i!==r[0]&&(t[r[0]]=i)}r=Dr.exec(e)}t["%C2"]="�";for(var c=Object.keys(t),l=0;l<c.length;l++){var m=c[l];e=e.replace(new RegExp(m,"g"),t[m])}return e}var Gi=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 Yi(e)}},Qi=(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)]},Xi=function(e,t){for(var r={},i=Object.keys(e),c=Array.isArray(t),l=0;l<i.length;l++){var m=i[l],P=e[m];(c?t.indexOf(m)!==-1:t(m,P,e))&&(r[m]=P)}return r};(function(e){const t=Hi,r=Gi,i=Qi,c=Xi,l=a=>a==null;function m(a){switch(a.arrayFormat){case"index":return o=>(u,d)=>{const x=u.length;return d===void 0||a.skipNull&&d===null||a.skipEmptyString&&d===""?u:d===null?[...u,[b(o,a),"[",x,"]"].join("")]:[...u,[b(o,a),"[",b(x,a),"]=",b(d,a)].join("")]};case"bracket":return o=>(u,d)=>d===void 0||a.skipNull&&d===null||a.skipEmptyString&&d===""?u:d===null?[...u,[b(o,a),"[]"].join("")]:[...u,[b(o,a),"[]=",b(d,a)].join("")];case"comma":case"separator":return o=>(u,d)=>d==null||d.length===0?u:u.length===0?[[b(o,a),"=",b(d,a)].join("")]:[[u,b(d,a)].join(a.arrayFormatSeparator)];default:return o=>(u,d)=>d===void 0||a.skipNull&&d===null||a.skipEmptyString&&d===""?u:d===null?[...u,b(o,a)]:[...u,[b(o,a),"=",b(d,a)].join("")]}}function P(a){let o;switch(a.arrayFormat){case"index":return(u,d,x)=>{if(o=/\[(\d*)\]$/.exec(u),u=u.replace(/\[\d*\]$/,""),!o){x[u]=d;return}x[u]===void 0&&(x[u]={}),x[u][o[1]]=d};case"bracket":return(u,d,x)=>{if(o=/(\[\])$/.exec(u),u=u.replace(/\[\]$/,""),!o){x[u]=d;return}if(x[u]===void 0){x[u]=[d];return}x[u]=[].concat(x[u],d)};case"comma":case"separator":return(u,d,x)=>{const C=typeof d=="string"&&d.includes(a.arrayFormatSeparator),j=typeof d=="string"&&!C&&h(d,a).includes(a.arrayFormatSeparator);d=j?h(d,a):d;const X=C||j?d.split(a.arrayFormatSeparator).map(G=>h(G,a)):d===null?d:h(d,a);x[u]=X};default:return(u,d,x)=>{if(x[u]===void 0){x[u]=d;return}x[u]=[].concat(x[u],d)}}}function E(a){if(typeof a!="string"||a.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function b(a,o){return o.encode?o.strict?t(a):encodeURIComponent(a):a}function h(a,o){return o.decode?r(a):a}function N(a){return Array.isArray(a)?a.sort():typeof a=="object"?N(Object.keys(a)).sort((o,u)=>Number(o)-Number(u)).map(o=>a[o]):a}function S(a){const o=a.indexOf("#");return o!==-1&&(a=a.slice(0,o)),a}function A(a){let o="";const u=a.indexOf("#");return u!==-1&&(o=a.slice(u)),o}function y(a){a=S(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),E(o.arrayFormatSeparator);const u=P(o),d=Object.create(null);if(typeof a!="string"||(a=a.trim().replace(/^[?#&]/,""),!a))return d;for(const x of a.split("&")){if(x==="")continue;let[C,j]=i(o.decode?x.replace(/\+/g," "):x,"=");j=j===void 0?null:["comma","separator"].includes(o.arrayFormat)?j:h(j,o),u(h(C,o),j,d)}for(const x of Object.keys(d)){const C=d[x];if(typeof C=="object"&&C!==null)for(const j of Object.keys(C))C[j]=k(C[j],o);else d[x]=k(C,o)}return o.sort===!1?d:(o.sort===!0?Object.keys(d).sort():Object.keys(d).sort(o.sort)).reduce((x,C)=>{const j=d[C];return j&&typeof j=="object"&&!Array.isArray(j)?x[C]=N(j):x[C]=j,x},Object.create(null))}e.extract=y,e.parse=w,e.stringify=(a,o)=>{if(!a)return"";o=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},o),E(o.arrayFormatSeparator);const u=j=>o.skipNull&&l(a[j])||o.skipEmptyString&&a[j]==="",d=m(o),x={};for(const j of Object.keys(a))u(j)||(x[j]=a[j]);const C=Object.keys(x);return o.sort!==!1&&C.sort(o.sort),C.map(j=>{const X=a[j];return X===void 0?"":X===null?b(j,o):Array.isArray(X)?X.reduce(d(j),[]).join("&"):b(j,o)+"="+b(X,o)}).filter(j=>j.length>0).join("&")},e.parseUrl=(a,o)=>{o=Object.assign({decode:!0},o);const[u,d]=i(a,"#");return Object.assign({url:u.split("?")[0]||"",query:w(y(a),o)},o&&o.parseFragmentIdentifier&&d?{fragmentIdentifier:h(d,o)}:{})},e.stringifyUrl=(a,o)=>{o=Object.assign({encode:!0,strict:!0},o);const u=S(a.url).split("?")[0]||"",d=e.extract(a.url),x=e.parse(d,{sort:!1}),C=Object.assign(x,a.query);let j=e.stringify(C,o);j&&(j=`?${j}`);let X=A(a.url);return a.fragmentIdentifier&&(X=`#${b(a.fragmentIdentifier,o)}`),`${u}${j}${X}`},e.pick=(a,o,u)=>{u=Object.assign({parseFragmentIdentifier:!0},u);const{url:d,query:x,fragmentIdentifier:C}=e.parseUrl(a,u);return e.stringifyUrl({url:d,query:c(x,o),fragmentIdentifier:C},u)},e.exclude=(a,o,u)=>{const d=Array.isArray(o)?x=>!o.includes(x):(x,C)=>!o(x,C);return e.pick(a,d,u)}})(bt);const at=Fn,Ji={parseNumbers:!1,parseBooleans:!1},eo={skipNull:!1,skipEmptyString:!1},to=(e,t)=>{var r,i;const{navigateMode:c="push",parseOptions:l,stringifyOptions:m}={},P=Object.assign(Object.assign({},Ji),l),E=Object.assign(Object.assign({},eo),m),b=at.useLocation(),h=(r=at.useHistory)===null||r===void 0?void 0:r.call(at),N=(i=at.useNavigate)===null||i===void 0?void 0:i.call(at),S=Ui(),A=Y.useRef(typeof e=="function"?e():e||{}),y=Y.useMemo(()=>bt.parse(b.search,P),[b.search]),k=Y.useMemo(()=>Object.assign(Object.assign({},A.current),y),[y]);return[k,cr(a=>{const o=typeof a=="function"?a(k):a;S(),h&&h[c]({hash:b.hash,search:bt.stringify(Object.assign(Object.assign({},y),o),E)||"?"},b.state),N&&N({hash:b.hash,search:bt.stringify(Object.assign(Object.assign({},y),o),E)||"?"},{replace:c==="replace",state:b.state})})]},ro=to;var _t={exports:{}},Lt={},_r;function jn(){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,d){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 i(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&&c(o,u)}function c(o,u){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,C){return x.__proto__=C,x},c(o,u)}function l(o){var u=E();return function(){var x=b(o),C;if(u){var j=b(this).constructor;C=Reflect.construct(x,arguments,j)}else C=x.apply(this,arguments);return m(this,C)}}function m(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 P(o)}function P(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}function E(){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 b(o){return b=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(d){return d.__proto__||Object.getPrototypeOf(d)},b(o)}var h={},N,S;function A(o,u,d){d||(d=Error);function x(j,X,G){return typeof u=="string"?u:u(j,X,G)}var C=function(j){i(G,j);var X=l(G);function G(Z,W,F){var H;return r(this,G),H=X.call(this,x(Z,W,F)),H.code=o,H}return t(G)}(d);h[o]=C}function y(o,u){if(Array.isArray(o)){var d=o.length;return o=o.map(function(x){return String(x)}),d>2?"one of ".concat(u," ").concat(o.slice(0,d-1).join(", "),", or ")+o[d-1]:d===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,d){return o.substr(0,u.length)===u}function w(o,u,d){return(d===void 0||d>o.length)&&(d=o.length),o.substring(d-u.length,d)===u}function a(o,u,d){return typeof d!="number"&&(d=0),d+u.length>o.length?!1:o.indexOf(u,d)!==-1}return A("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),A("ERR_INVALID_ARG_TYPE",function(o,u,d){N===void 0&&(N=rr()),N(typeof o=="string","'name' must be a string");var x;typeof u=="string"&&k(u,"not ")?(x="must not be",u=u.replace(/^not /,"")):x="must be";var C;if(w(o," argument"))C="The ".concat(o," ").concat(x," ").concat(y(u,"type"));else{var j=a(o,".")?"property":"argument";C='The "'.concat(o,'" ').concat(j," ").concat(x," ").concat(y(u,"type"))}return C+=". Received type ".concat(e(d)),C},TypeError),A("ERR_INVALID_ARG_VALUE",function(o,u){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";S===void 0&&(S=ft);var x=S.inspect(u);return x.length>128&&(x="".concat(x.slice(0,128),"...")),"The argument '".concat(o,"' ").concat(d,". Received ").concat(x)},TypeError),A("ERR_INVALID_RETURN_VALUE",function(o,u,d){var x;return d&&d.constructor&&d.constructor.name?x="instance of ".concat(d.constructor.name):x="type ".concat(e(d)),"Expected ".concat(o,' to be returned from the "').concat(u,'"')+" function but got ".concat(x,".")},TypeError),A("ERR_MISSING_ARGS",function(){for(var o=arguments.length,u=new Array(o),d=0;d<o;d++)u[d]=arguments[d];N===void 0&&(N=rr()),N(u.length>0,"At least one arg needs to be specified");var x="The ",C=u.length;switch(u=u.map(function(j){return'"'.concat(j,'"')}),C){case 1:x+="".concat(u[0]," argument");break;case 2:x+="".concat(u[0]," and ").concat(u[1]," arguments");break;default:x+=u.slice(0,C-1).join(", "),x+=", and ".concat(u[C-1]," arguments");break}return"".concat(x," must be specified")},TypeError),Lt.codes=h,Lt}var Ut,Lr;function no(){if(Lr)return Ut;Lr=1;function e(I,O){var M=Object.keys(I);if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols(I);O&&(B=B.filter(function(q){return Object.getOwnPropertyDescriptor(I,q).enumerable})),M.push.apply(M,B)}return M}function t(I){for(var O=1;O<arguments.length;O++){var M=arguments[O]!=null?arguments[O]:{};O%2?e(Object(M),!0).forEach(function(B){r(I,B,M[B])}):Object.getOwnPropertyDescriptors?Object.defineProperties(I,Object.getOwnPropertyDescriptors(M)):e(Object(M)).forEach(function(B){Object.defineProperty(I,B,Object.getOwnPropertyDescriptor(M,B))})}return I}function r(I,O,M){return O=m(O),O in I?Object.defineProperty(I,O,{value:M,enumerable:!0,configurable:!0,writable:!0}):I[O]=M,I}function i(I,O){if(!(I instanceof O))throw new TypeError("Cannot call a class as a function")}function c(I,O){for(var M=0;M<O.length;M++){var B=O[M];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(I,m(B.key),B)}}function l(I,O,M){return O&&c(I.prototype,O),Object.defineProperty(I,"prototype",{writable:!1}),I}function m(I){var O=P(I,"string");return o(O)==="symbol"?O:String(O)}function P(I,O){if(o(I)!=="object"||I===null)return I;var M=I[Symbol.toPrimitive];if(M!==void 0){var B=M.call(I,O||"default");if(o(B)!=="object")return B;throw new TypeError("@@toPrimitive must return a primitive value.")}return(O==="string"?String:Number)(I)}function E(I,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function");I.prototype=Object.create(O&&O.prototype,{constructor:{value:I,writable:!0,configurable:!0}}),Object.defineProperty(I,"prototype",{writable:!1}),O&&w(I,O)}function b(I){var O=y();return function(){var B=a(I),q;if(O){var g=a(this).constructor;q=Reflect.construct(B,arguments,g)}else q=B.apply(this,arguments);return h(this,q)}}function h(I,O){if(O&&(o(O)==="object"||typeof O=="function"))return O;if(O!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return N(I)}function N(I){if(I===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I}function S(I){var O=typeof Map=="function"?new Map:void 0;return S=function(B){if(B===null||!k(B))return B;if(typeof B!="function")throw new TypeError("Super expression must either be null or a function");if(typeof O<"u"){if(O.has(B))return O.get(B);O.set(B,q)}function q(){return A(B,arguments,a(this).constructor)}return q.prototype=Object.create(B.prototype,{constructor:{value:q,enumerable:!1,writable:!0,configurable:!0}}),w(q,B)},S(I)}function A(I,O,M){return y()?A=Reflect.construct.bind():A=function(q,g,p){var v=[null];v.push.apply(v,g);var _=Function.bind.apply(q,v),R=new _;return p&&w(R,p.prototype),R},A.apply(null,arguments)}function y(){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(I){return Function.toString.call(I).indexOf("[native code]")!==-1}function w(I,O){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(B,q){return B.__proto__=q,B},w(I,O)}function a(I){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(M){return M.__proto__||Object.getPrototypeOf(M)},a(I)}function o(I){"@babel/helpers - typeof";return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(O){return typeof O}:function(O){return O&&typeof Symbol=="function"&&O.constructor===Symbol&&O!==Symbol.prototype?"symbol":typeof O},o(I)}var u=ft,d=u.inspect,x=jn(),C=x.codes.ERR_INVALID_ARG_TYPE;function j(I,O,M){return(M===void 0||M>I.length)&&(M=I.length),I.substring(M-O.length,M)===O}function X(I,O){if(O=Math.floor(O),I.length==0||O==0)return"";var M=I.length*O;for(O=Math.floor(Math.log(O)/Math.log(2));O;)I+=I,O--;return I+=I.substring(0,M-I.length),I}var G="",Z="",W="",F="",H={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:"},pe=10;function Q(I){var O=Object.keys(I),M=Object.create(Object.getPrototypeOf(I));return O.forEach(function(B){M[B]=I[B]}),Object.defineProperty(M,"message",{value:I.message}),M}function fe(I){return d(I,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function Ae(I,O,M){var B="",q="",g=0,p="",v=!1,_=fe(I),R=_.split(`
1
+ import{r as Y,t as Fn,g as $n,e as Or,a as Vn}from"./vendor-react-DoD83n6N.js";import{a8 as rn,j as n,aa as ne,bo as Gt,br as Qt,bn as Xt,q as wt,T as Be,O as lt,a9 as rt,bx as ir,aj as tt,H as K,ag as je,ab as ut,w as zn,y as nn,bl as Wn,b4 as Hn,b5 as Zn,I as Yn,bk as Gn,bs as Qn,bO as Xn}from"./vendor-mui-core-DxD1UA4o.js";import{p as Ie,B as Jt,c as er,Z as Jn,as as ei,n as Rr,y as ti,z as ri}from"./vendor-utils-CTIzdAFg.js";import{r as on,bQ as ft,bR as ni,bS as ii,bT as an,bU as oi,bV as ai,bW as si,bX as sn,bY as ci,bZ as or,b_ as li,bA as ui,b$ as fi,c0 as di,aF as ar,c1 as cn,aE as pi,l as mi,u as Te,X as ln,W as hi,ak as Ze,B as Ee,k as gi,am as yi,d as vi,a$ as dt,Y as Me,bH as bi,p as Ye,_ as un,ag as xi,h as wi,aq as Ei,b1 as ji,a5 as fn,a4 as dn,bM as Si,V as Ci}from"./vendor-ux-did-connect-CiLSrCOH.js";import{c as Ge,N as Pi,M as pn,B as Et,w as Ai,O as Ii}from"./vendor-arcblock-BtlDhznp.js";import{d as Oi}from"./ViewList-BzGRahvc.js";import{Y as Ri,f as Ti,z as Pe,ao as sr,l as Qe,Z as Ni,M as Xe,ap as Di,C as mn,aq as hn,t as _i,b as Li}from"./index-CWohFZPl.js";import{k as Ui,u as cr,a as lr,l as ki}from"./vendor-hooks-BwVH-TAd.js";import{u as Ne,d as Tr,W as gn}from"./dashboard-D3KvORmC.js";import{W as jt}from"./did-address-GAxLGeWB.js";import{P as Ke}from"./permission-C5Df-sxb.js";import{C as It}from"./click-to-copy-Cygm8U3_.js";import{T as yn}from"./index-uHTdpm71.js";import{f as Fe}from"./format-error-LAoTjvJe.js";import{_ as qi}from"./useAsync-DKE0K0bz.js";import{I as Ce}from"./index-BRz2myBK.js";import{d as Bi}from"./DeleteOutline-7AloJjcV.js";import{C as pt}from"./confirm-Fhl5qi_m.js";import{u as mt}from"./session-DaQ4KCFD.js";import{i as vn,a as St,p as bn}from"./util-Csa0tyHO.js";import{b as Ki}from"./sdk-DRKovxXZ.js";import{A as Mi}from"./actions-BOikuUJD.js";import{S as Fi}from"./shorten-label-CwDvu4_S.js";import"./lottie-web-B6s7dDoL.js";import"./useLocalStorage-BXnF_60k.js";import"./PlayArrow-NjIpSDwJ.js";import"./get-safe-url-ZRaKUVld.js";import"./index-Bx2tzf6d.js";import"./useAsyncRetry-BBomZj1z.js";import"./InfoOutlined-DO0_Vjz-.js";import"./useSetState-BL3ktMon.js";import"./use-mobile-CHMVa8_W.js";import"./vendor-mui-x-Bit8yv3W.js";import"./AdapterDayjs-B7fWFwN5.js";import"./base32-CQfYcymN.js";import"./MoreHoriz-B8cBSV22.js";var ur={},$i=rn;Object.defineProperty(ur,"__esModule",{value:!0});var xn=ur.default=void 0,Vi=$i(on()),zi=n;xn=ur.default=(0,Vi.default)((0,zi.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 fr=function(e){return n.jsxs("svg",{...e,children:[n.jsx("g",{clipPath:"url(#clip0)",children:n.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"})}),n.jsx("defs",{children:n.jsx("clipPath",{id:"clip0",children:n.jsx("rect",{width:"18",height:"18",transform:"translate(0 0.5)"})})})]})};fr.defaultProps={width:"18",height:"19",viewBox:"0 0 18 19",xmlns:"http://www.w3.org/2000/svg"};fr.displayName="person";const Wi=fr;var dr=function(e){return n.jsxs("svg",{...e,children:[n.jsx("path",{d:"M1.25 2.7087C1.25 2.24826 1.62326 1.875 2.0837 1.875H14.339C14.7995 1.875 15.1727 2.24826 15.1727 2.7087V9.31574C15.1727 9.77618 14.7995 10.1494 14.339 10.1494C13.8786 10.1494 13.5053 9.77618 13.5053 9.31574V3.54239H2.91739V16.7565H6.53772H8.34788H9.32435C9.78479 16.7565 10.158 17.1297 10.158 17.5902C10.158 18.0506 9.78479 18.4239 9.32435 18.4239H8.34788H2.0837C1.62326 18.4239 1.25 18.0506 1.25 17.5902V2.7087Z"}),n.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.21129 7.91935C7.70481 7.91935 7.29422 8.32993 7.29422 8.83641C7.29422 9.34289 7.70481 9.75348 8.21129 9.75348C8.71777 9.75348 9.12836 9.34289 9.12836 8.83641C9.12836 8.32993 8.71777 7.91935 8.21129 7.91935ZM5.62683 8.83641C5.62683 7.40905 6.78393 6.25195 8.21129 6.25195C9.63865 6.25195 10.7957 7.40905 10.7957 8.83641C10.7957 10.2638 9.63865 11.4209 8.21129 11.4209C6.78393 11.4209 5.62683 10.2638 5.62683 8.83641Z"}),n.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.62683 13.2133C5.62683 12.7529 6.00009 12.3796 6.46053 12.3796H9.96205C10.4225 12.3796 10.7957 12.7529 10.7957 13.2133C10.7957 13.6737 10.4225 14.047 9.96205 14.047H6.46053C6.00009 14.047 5.62683 13.6737 5.62683 13.2133Z"}),n.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.6406 11.3125C15.8547 11.3125 16.0503 11.434 16.145 11.626L17.1779 13.7184L19.4876 14.056C19.6994 14.087 19.8753 14.2355 19.9413 14.4391C20.0074 14.6427 19.9521 14.8662 19.7987 15.0156L18.1279 16.643L18.5222 18.9421C18.5584 19.1532 18.4716 19.3665 18.2984 19.4923C18.1252 19.6182 17.8955 19.6347 17.706 19.5351L15.6406 18.4489L13.5753 19.5351C13.3858 19.6347 13.1561 19.6182 12.9829 19.4923C12.8096 19.3665 12.7229 19.1532 12.7591 18.9421L13.1534 16.643L11.4825 15.0156C11.3292 14.8662 11.2739 14.6427 11.3399 14.4391C11.406 14.2355 11.5818 14.087 11.7937 14.056L14.1034 13.7184L15.1362 11.626C15.231 11.434 15.4265 11.3125 15.6406 11.3125ZM15.6406 13.1458L14.9815 14.4813C14.8996 14.6471 14.7414 14.7621 14.5584 14.7889L13.0835 15.0044L14.1503 16.0435C14.283 16.1727 14.3435 16.359 14.3122 16.5416L14.0606 18.0088L15.3788 17.3155C15.5427 17.2293 15.7386 17.2293 15.9025 17.3155L17.2207 18.0088L16.969 16.5416C16.9377 16.359 16.9983 16.1727 17.131 16.0435L18.1978 15.0044L16.7229 14.7889C16.5399 14.7621 16.3817 14.6471 16.2998 14.4813L15.6406 13.1458Z"})]})};dr.defaultProps={width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"};dr.displayName="external-issuer";const wn=dr;var bt={},Hi=e=>encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),En="%[a-f0-9]{2}",Nr=new RegExp("("+En+")|([^%]+?)","gi"),Dr=new RegExp("("+En+")+","gi");function tr(e,t){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;t=t||1;var r=e.slice(0,t),i=e.slice(t);return Array.prototype.concat.call([],tr(r),tr(i))}function Zi(e){try{return decodeURIComponent(e)}catch{for(var t=e.match(Nr)||[],r=1;r<t.length;r++)e=tr(t,r).join(""),t=e.match(Nr)||[];return e}}function Yi(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},r=Dr.exec(e);r;){try{t[r[0]]=decodeURIComponent(r[0])}catch{var i=Zi(r[0]);i!==r[0]&&(t[r[0]]=i)}r=Dr.exec(e)}t["%C2"]="�";for(var c=Object.keys(t),l=0;l<c.length;l++){var m=c[l];e=e.replace(new RegExp(m,"g"),t[m])}return e}var Gi=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 Yi(e)}},Qi=(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)]},Xi=function(e,t){for(var r={},i=Object.keys(e),c=Array.isArray(t),l=0;l<i.length;l++){var m=i[l],P=e[m];(c?t.indexOf(m)!==-1:t(m,P,e))&&(r[m]=P)}return r};(function(e){const t=Hi,r=Gi,i=Qi,c=Xi,l=a=>a==null;function m(a){switch(a.arrayFormat){case"index":return o=>(u,d)=>{const x=u.length;return d===void 0||a.skipNull&&d===null||a.skipEmptyString&&d===""?u:d===null?[...u,[b(o,a),"[",x,"]"].join("")]:[...u,[b(o,a),"[",b(x,a),"]=",b(d,a)].join("")]};case"bracket":return o=>(u,d)=>d===void 0||a.skipNull&&d===null||a.skipEmptyString&&d===""?u:d===null?[...u,[b(o,a),"[]"].join("")]:[...u,[b(o,a),"[]=",b(d,a)].join("")];case"comma":case"separator":return o=>(u,d)=>d==null||d.length===0?u:u.length===0?[[b(o,a),"=",b(d,a)].join("")]:[[u,b(d,a)].join(a.arrayFormatSeparator)];default:return o=>(u,d)=>d===void 0||a.skipNull&&d===null||a.skipEmptyString&&d===""?u:d===null?[...u,b(o,a)]:[...u,[b(o,a),"=",b(d,a)].join("")]}}function P(a){let o;switch(a.arrayFormat){case"index":return(u,d,x)=>{if(o=/\[(\d*)\]$/.exec(u),u=u.replace(/\[\d*\]$/,""),!o){x[u]=d;return}x[u]===void 0&&(x[u]={}),x[u][o[1]]=d};case"bracket":return(u,d,x)=>{if(o=/(\[\])$/.exec(u),u=u.replace(/\[\]$/,""),!o){x[u]=d;return}if(x[u]===void 0){x[u]=[d];return}x[u]=[].concat(x[u],d)};case"comma":case"separator":return(u,d,x)=>{const C=typeof d=="string"&&d.includes(a.arrayFormatSeparator),j=typeof d=="string"&&!C&&h(d,a).includes(a.arrayFormatSeparator);d=j?h(d,a):d;const X=C||j?d.split(a.arrayFormatSeparator).map(G=>h(G,a)):d===null?d:h(d,a);x[u]=X};default:return(u,d,x)=>{if(x[u]===void 0){x[u]=d;return}x[u]=[].concat(x[u],d)}}}function E(a){if(typeof a!="string"||a.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function b(a,o){return o.encode?o.strict?t(a):encodeURIComponent(a):a}function h(a,o){return o.decode?r(a):a}function N(a){return Array.isArray(a)?a.sort():typeof a=="object"?N(Object.keys(a)).sort((o,u)=>Number(o)-Number(u)).map(o=>a[o]):a}function S(a){const o=a.indexOf("#");return o!==-1&&(a=a.slice(0,o)),a}function A(a){let o="";const u=a.indexOf("#");return u!==-1&&(o=a.slice(u)),o}function y(a){a=S(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),E(o.arrayFormatSeparator);const u=P(o),d=Object.create(null);if(typeof a!="string"||(a=a.trim().replace(/^[?#&]/,""),!a))return d;for(const x of a.split("&")){if(x==="")continue;let[C,j]=i(o.decode?x.replace(/\+/g," "):x,"=");j=j===void 0?null:["comma","separator"].includes(o.arrayFormat)?j:h(j,o),u(h(C,o),j,d)}for(const x of Object.keys(d)){const C=d[x];if(typeof C=="object"&&C!==null)for(const j of Object.keys(C))C[j]=k(C[j],o);else d[x]=k(C,o)}return o.sort===!1?d:(o.sort===!0?Object.keys(d).sort():Object.keys(d).sort(o.sort)).reduce((x,C)=>{const j=d[C];return j&&typeof j=="object"&&!Array.isArray(j)?x[C]=N(j):x[C]=j,x},Object.create(null))}e.extract=y,e.parse=w,e.stringify=(a,o)=>{if(!a)return"";o=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},o),E(o.arrayFormatSeparator);const u=j=>o.skipNull&&l(a[j])||o.skipEmptyString&&a[j]==="",d=m(o),x={};for(const j of Object.keys(a))u(j)||(x[j]=a[j]);const C=Object.keys(x);return o.sort!==!1&&C.sort(o.sort),C.map(j=>{const X=a[j];return X===void 0?"":X===null?b(j,o):Array.isArray(X)?X.reduce(d(j),[]).join("&"):b(j,o)+"="+b(X,o)}).filter(j=>j.length>0).join("&")},e.parseUrl=(a,o)=>{o=Object.assign({decode:!0},o);const[u,d]=i(a,"#");return Object.assign({url:u.split("?")[0]||"",query:w(y(a),o)},o&&o.parseFragmentIdentifier&&d?{fragmentIdentifier:h(d,o)}:{})},e.stringifyUrl=(a,o)=>{o=Object.assign({encode:!0,strict:!0},o);const u=S(a.url).split("?")[0]||"",d=e.extract(a.url),x=e.parse(d,{sort:!1}),C=Object.assign(x,a.query);let j=e.stringify(C,o);j&&(j=`?${j}`);let X=A(a.url);return a.fragmentIdentifier&&(X=`#${b(a.fragmentIdentifier,o)}`),`${u}${j}${X}`},e.pick=(a,o,u)=>{u=Object.assign({parseFragmentIdentifier:!0},u);const{url:d,query:x,fragmentIdentifier:C}=e.parseUrl(a,u);return e.stringifyUrl({url:d,query:c(x,o),fragmentIdentifier:C},u)},e.exclude=(a,o,u)=>{const d=Array.isArray(o)?x=>!o.includes(x):(x,C)=>!o(x,C);return e.pick(a,d,u)}})(bt);const at=Fn,Ji={parseNumbers:!1,parseBooleans:!1},eo={skipNull:!1,skipEmptyString:!1},to=(e,t)=>{var r,i;const{navigateMode:c="push",parseOptions:l,stringifyOptions:m}={},P=Object.assign(Object.assign({},Ji),l),E=Object.assign(Object.assign({},eo),m),b=at.useLocation(),h=(r=at.useHistory)===null||r===void 0?void 0:r.call(at),N=(i=at.useNavigate)===null||i===void 0?void 0:i.call(at),S=Ui(),A=Y.useRef(typeof e=="function"?e():e||{}),y=Y.useMemo(()=>bt.parse(b.search,P),[b.search]),k=Y.useMemo(()=>Object.assign(Object.assign({},A.current),y),[y]);return[k,cr(a=>{const o=typeof a=="function"?a(k):a;S(),h&&h[c]({hash:b.hash,search:bt.stringify(Object.assign(Object.assign({},y),o),E)||"?"},b.state),N&&N({hash:b.hash,search:bt.stringify(Object.assign(Object.assign({},y),o),E)||"?"},{replace:c==="replace",state:b.state})})]},ro=to;var _t={exports:{}},Lt={},_r;function jn(){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,d){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 i(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&&c(o,u)}function c(o,u){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,C){return x.__proto__=C,x},c(o,u)}function l(o){var u=E();return function(){var x=b(o),C;if(u){var j=b(this).constructor;C=Reflect.construct(x,arguments,j)}else C=x.apply(this,arguments);return m(this,C)}}function m(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 P(o)}function P(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}function E(){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 b(o){return b=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(d){return d.__proto__||Object.getPrototypeOf(d)},b(o)}var h={},N,S;function A(o,u,d){d||(d=Error);function x(j,X,G){return typeof u=="string"?u:u(j,X,G)}var C=function(j){i(G,j);var X=l(G);function G(Z,W,F){var H;return r(this,G),H=X.call(this,x(Z,W,F)),H.code=o,H}return t(G)}(d);h[o]=C}function y(o,u){if(Array.isArray(o)){var d=o.length;return o=o.map(function(x){return String(x)}),d>2?"one of ".concat(u," ").concat(o.slice(0,d-1).join(", "),", or ")+o[d-1]:d===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,d){return o.substr(0,u.length)===u}function w(o,u,d){return(d===void 0||d>o.length)&&(d=o.length),o.substring(d-u.length,d)===u}function a(o,u,d){return typeof d!="number"&&(d=0),d+u.length>o.length?!1:o.indexOf(u,d)!==-1}return A("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),A("ERR_INVALID_ARG_TYPE",function(o,u,d){N===void 0&&(N=rr()),N(typeof o=="string","'name' must be a string");var x;typeof u=="string"&&k(u,"not ")?(x="must not be",u=u.replace(/^not /,"")):x="must be";var C;if(w(o," argument"))C="The ".concat(o," ").concat(x," ").concat(y(u,"type"));else{var j=a(o,".")?"property":"argument";C='The "'.concat(o,'" ').concat(j," ").concat(x," ").concat(y(u,"type"))}return C+=". Received type ".concat(e(d)),C},TypeError),A("ERR_INVALID_ARG_VALUE",function(o,u){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";S===void 0&&(S=ft);var x=S.inspect(u);return x.length>128&&(x="".concat(x.slice(0,128),"...")),"The argument '".concat(o,"' ").concat(d,". Received ").concat(x)},TypeError),A("ERR_INVALID_RETURN_VALUE",function(o,u,d){var x;return d&&d.constructor&&d.constructor.name?x="instance of ".concat(d.constructor.name):x="type ".concat(e(d)),"Expected ".concat(o,' to be returned from the "').concat(u,'"')+" function but got ".concat(x,".")},TypeError),A("ERR_MISSING_ARGS",function(){for(var o=arguments.length,u=new Array(o),d=0;d<o;d++)u[d]=arguments[d];N===void 0&&(N=rr()),N(u.length>0,"At least one arg needs to be specified");var x="The ",C=u.length;switch(u=u.map(function(j){return'"'.concat(j,'"')}),C){case 1:x+="".concat(u[0]," argument");break;case 2:x+="".concat(u[0]," and ").concat(u[1]," arguments");break;default:x+=u.slice(0,C-1).join(", "),x+=", and ".concat(u[C-1]," arguments");break}return"".concat(x," must be specified")},TypeError),Lt.codes=h,Lt}var Ut,Lr;function no(){if(Lr)return Ut;Lr=1;function e(I,O){var M=Object.keys(I);if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols(I);O&&(B=B.filter(function(q){return Object.getOwnPropertyDescriptor(I,q).enumerable})),M.push.apply(M,B)}return M}function t(I){for(var O=1;O<arguments.length;O++){var M=arguments[O]!=null?arguments[O]:{};O%2?e(Object(M),!0).forEach(function(B){r(I,B,M[B])}):Object.getOwnPropertyDescriptors?Object.defineProperties(I,Object.getOwnPropertyDescriptors(M)):e(Object(M)).forEach(function(B){Object.defineProperty(I,B,Object.getOwnPropertyDescriptor(M,B))})}return I}function r(I,O,M){return O=m(O),O in I?Object.defineProperty(I,O,{value:M,enumerable:!0,configurable:!0,writable:!0}):I[O]=M,I}function i(I,O){if(!(I instanceof O))throw new TypeError("Cannot call a class as a function")}function c(I,O){for(var M=0;M<O.length;M++){var B=O[M];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(I,m(B.key),B)}}function l(I,O,M){return O&&c(I.prototype,O),Object.defineProperty(I,"prototype",{writable:!1}),I}function m(I){var O=P(I,"string");return o(O)==="symbol"?O:String(O)}function P(I,O){if(o(I)!=="object"||I===null)return I;var M=I[Symbol.toPrimitive];if(M!==void 0){var B=M.call(I,O||"default");if(o(B)!=="object")return B;throw new TypeError("@@toPrimitive must return a primitive value.")}return(O==="string"?String:Number)(I)}function E(I,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function");I.prototype=Object.create(O&&O.prototype,{constructor:{value:I,writable:!0,configurable:!0}}),Object.defineProperty(I,"prototype",{writable:!1}),O&&w(I,O)}function b(I){var O=y();return function(){var B=a(I),q;if(O){var g=a(this).constructor;q=Reflect.construct(B,arguments,g)}else q=B.apply(this,arguments);return h(this,q)}}function h(I,O){if(O&&(o(O)==="object"||typeof O=="function"))return O;if(O!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return N(I)}function N(I){if(I===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I}function S(I){var O=typeof Map=="function"?new Map:void 0;return S=function(B){if(B===null||!k(B))return B;if(typeof B!="function")throw new TypeError("Super expression must either be null or a function");if(typeof O<"u"){if(O.has(B))return O.get(B);O.set(B,q)}function q(){return A(B,arguments,a(this).constructor)}return q.prototype=Object.create(B.prototype,{constructor:{value:q,enumerable:!1,writable:!0,configurable:!0}}),w(q,B)},S(I)}function A(I,O,M){return y()?A=Reflect.construct.bind():A=function(q,g,p){var v=[null];v.push.apply(v,g);var _=Function.bind.apply(q,v),R=new _;return p&&w(R,p.prototype),R},A.apply(null,arguments)}function y(){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(I){return Function.toString.call(I).indexOf("[native code]")!==-1}function w(I,O){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(B,q){return B.__proto__=q,B},w(I,O)}function a(I){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(M){return M.__proto__||Object.getPrototypeOf(M)},a(I)}function o(I){"@babel/helpers - typeof";return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(O){return typeof O}:function(O){return O&&typeof Symbol=="function"&&O.constructor===Symbol&&O!==Symbol.prototype?"symbol":typeof O},o(I)}var u=ft,d=u.inspect,x=jn(),C=x.codes.ERR_INVALID_ARG_TYPE;function j(I,O,M){return(M===void 0||M>I.length)&&(M=I.length),I.substring(M-O.length,M)===O}function X(I,O){if(O=Math.floor(O),I.length==0||O==0)return"";var M=I.length*O;for(O=Math.floor(Math.log(O)/Math.log(2));O;)I+=I,O--;return I+=I.substring(0,M-I.length),I}var G="",Z="",W="",F="",H={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:"},pe=10;function Q(I){var O=Object.keys(I),M=Object.create(Object.getPrototypeOf(I));return O.forEach(function(B){M[B]=I[B]}),Object.defineProperty(M,"message",{value:I.message}),M}function fe(I){return d(I,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function Ae(I,O,M){var B="",q="",g=0,p="",v=!1,_=fe(I),R=_.split(`
2
2
  `),L=fe(O).split(`
3
3
  `),V=0,ie="";if(M==="strictEqual"&&o(I)==="object"&&o(O)==="object"&&I!==null&&O!==null&&(M="strictEqualObject"),R.length===1&&L.length===1&&R[0]!==L[0]){var ce=R[0].length+L[0].length;if(ce<=pe){if((o(I)!=="object"||I===null)&&(o(O)!=="object"||O===null)&&(I!==0||O!==0))return"".concat(H[M],`
4
4
 
@@ -1,4 +1,4 @@
1
- import{u as ne,Y as U,cd as Ee,ce as Ue,o as le,h as K,cb as We,cc as Me,aa as _e,ab as $e,a9 as Ve,cf as Ne,b1 as Ce,p as he,r as Je,a$ as X,cg as xe,ak as je,B as z,c2 as He,a4 as Ke,ch as Ge,a5 as Ze,a1 as Ye,_ as Xe,aq as De}from"./vendor-ux-did-connect-CiLSrCOH.js";import{u as p,a as se,f as te,c as Qe}from"./vendor-hooks-BwVH-TAd.js";import{r as R}from"./vendor-react-DoD83n6N.js";import{j as e,aa as m,bs as W,bo as E,O as B,y as $,H as N,T as fe,I as ae,X as re,ag as Re,ak as H,cx as et,a8 as tt,e as be,a9 as ge,a5 as Ae,ab as nt}from"./vendor-mui-core-DxD1UA4o.js";import{I as Y,a2 as st,b as qe,C as ot,n as Z,aE as at,y as rt,z as it}from"./vendor-utils-CTIzdAFg.js";import{a as oe,S as I,C,f as Fe}from"./dashboard-oxsbu66O.js";import{z as J,C as V}from"./index-tjRN_EVx.js";import{S as ie}from"./switch-control-DPANzJ8H.js";import{K as lt}from"./keyboard-arrow-down-rounded-DadBVmpO.js";import{B as Pe,J as ct,c as dt}from"./vendor-arcblock-BtlDhznp.js";import{I as ut}from"./index-BRz2myBK.js";import{b as mt}from"./base32-CQfYcymN.js";import{u as pt}from"./use-mobile-BHPd3bDQ.js";import"./lottie-web-B6s7dDoL.js";import"./useLocalStorage-BXnF_60k.js";import"./confirm-BX8_-j-l.js";import"./format-error-LAoTjvJe.js";import"./PlayArrow-NjIpSDwJ.js";import"./get-safe-url-ZRaKUVld.js";import"./index-DIckhHU5.js";import"./session-DaQ4KCFD.js";import"./useAsyncRetry-k063P8TB.js";import"./useAsync-BmW5cnbx.js";import"./InfoOutlined-DO0_Vjz-.js";import"./useSetState-BL3ktMon.js";import"./use-mobile-CHMVa8_W.js";const ce={enabled:!1,domain:"",clientId:"",clientSecret:""};function ht(){var b,y,i;const{api:S}=J(),{blocklet:r}=V(),{t:n}=ne(),s=(b=r==null?void 0:r.meta)==null?void 0:b.did,w=Object.assign({...ce},((i=(y=r==null?void 0:r.settings)==null?void 0:y.oauth)==null?void 0:i.auth0)||{}),{handleSubmit:t,control:f,formState:c,watch:h,reset:l}=oe({defaultValues:Y(w,Object.keys(ce))}),d=h("enabled"),k=p(async a=>{var T,o;try{const{blocklet:j}=await S.configOAuth({input:{did:s,oauth:JSON.stringify({auth0:a})}}),u=Object.assign({...ce},((o=(T=j==null?void 0:j.settings)==null?void 0:T.oauth)==null?void 0:o.auth0)||{});l(u),U.success(n("oauth.saveSuccess"))}catch(j){U.error(j.message||n("oauth.saveFailed"))}}),L=p(a=>a!=null&&a.trim()?!0:n("oauth.auth0.domainDescription")),x=p(a=>a!=null&&a.trim()?!0:n("oauth.auth0.clientIdDescription")),g=p(a=>a!=null&&a.trim()?!0:n("oauth.auth0.clientSecretDescription")),v=p(()=>!0);return e.jsx(m,{children:e.jsxs("form",{onSubmit:t(k),disabled:!0,children:[e.jsx(I,{title:n("oauth.auth0.enable"),mb:2.5,children:e.jsx(C,{name:"enabled",control:f,render:({field:a})=>e.jsx(W,{control:e.jsx(ie,{sx:{ml:1},checked:a.value,...a})})})}),e.jsx(I,{title:n("oauth.auth0.domain"),children:e.jsx(C,{name:"domain",control:f,rules:{validate:d?L:v},render:({field:a})=>{var T;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...a,size:"small",label:n("oauth.auth0.domain"),error:!!c.errors[a.name],helperText:((T=c.errors[a.name])==null?void 0:T.message)||" ",disabled:!d})})}})}),e.jsx(I,{title:n("oauth.auth0.clientId"),children:e.jsx(C,{name:"clientId",control:f,rules:{validate:d?x:v},render:({field:a})=>{var T;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...a,size:"small",label:n("oauth.auth0.clientId"),error:!!c.errors[a.name],helperText:((T=c.errors[a.name])==null?void 0:T.message)||" ",disabled:!d})})}})}),e.jsx(I,{title:n("oauth.auth0.clientSecret"),children:e.jsx(C,{name:"clientSecret",control:f,rules:{validate:d?g:v},render:({field:a})=>{var T;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...a,size:"small",type:"password",label:n("oauth.auth0.clientSecret"),error:!!c.errors[a.name],helperText:((T=c.errors[a.name])==null?void 0:T.message)||" ",disabled:!d})})}})}),e.jsx($,{type:"submit",variant:"contained",onSubmit:t(k),disabled:!c.isDirty,children:n("oauth.save")})]})})}const de={enabled:!1,clientId:"",clientSecret:""};function xt(){var v,b,y;const{api:S}=J(),{blocklet:r}=V(),{t:n}=ne(),s=(v=r==null?void 0:r.meta)==null?void 0:v.did,w=Object.assign({...de},((y=(b=r==null?void 0:r.settings)==null?void 0:b.oauth)==null?void 0:y.github)||{}),{handleSubmit:t,control:f,formState:c,watch:h,reset:l}=oe({defaultValues:Y(w,Object.keys(de))}),d=h("enabled"),k=p(async i=>{var a,T;try{const{blocklet:o}=await S.configOAuth({input:{did:s,oauth:JSON.stringify({github:i})}}),j=Object.assign({...de},((T=(a=o==null?void 0:o.settings)==null?void 0:a.oauth)==null?void 0:T.github)||{});l(j),U.success(n("oauth.saveSuccess"))}catch(o){U.error(o.message||n("oauth.saveFailed"))}}),L=p(i=>i!=null&&i.trim()?!0:n("oauth.github.clientIdDescription")),x=p(i=>i!=null&&i.trim()?!0:n("oauth.github.clientSecretDescription")),g=p(()=>!0);return e.jsx(m,{children:e.jsxs("form",{onSubmit:t(k),disabled:!0,children:[e.jsx(I,{title:n("oauth.github.enable"),mb:2.5,children:e.jsx(C,{name:"enabled",control:f,render:({field:i})=>e.jsx(W,{control:e.jsx(ie,{sx:{ml:1},checked:i.value,...i})})})}),e.jsx(I,{title:n("oauth.github.clientId"),children:e.jsx(C,{name:"clientId",control:f,rules:{validate:d?L:g},render:({field:i})=>{var a;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...i,size:"small",label:n("oauth.github.clientId"),error:!!c.errors[i.name],helperText:((a=c.errors[i.name])==null?void 0:a.message)||" ",disabled:!d})})}})}),e.jsx(I,{title:n("oauth.github.clientSecret"),children:e.jsx(C,{name:"clientSecret",control:f,rules:{validate:d?x:g},render:({field:i})=>{var a;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...i,size:"small",type:"password",label:n("oauth.github.clientSecret"),error:!!c.errors[i.name],helperText:((a=c.errors[i.name])==null?void 0:a.message)||" ",disabled:!d})})}})}),e.jsx($,{type:"submit",variant:"contained",onSubmit:t(k),disabled:!c.isDirty,children:n("oauth.save")})]})})}const ue={enabled:!1,clientId:"",clientSecret:""};function ft(){var v,b,y;const{api:S}=J(),{blocklet:r}=V(),{t:n}=ne(),s=(v=r==null?void 0:r.meta)==null?void 0:v.did,w=Object.assign({...ue},((y=(b=r==null?void 0:r.settings)==null?void 0:b.oauth)==null?void 0:y.google)||{}),{handleSubmit:t,control:f,formState:c,watch:h,reset:l}=oe({defaultValues:Y(w,Object.keys(ue))}),d=h("enabled"),k=p(async i=>{var a,T;try{const{blocklet:o}=await S.configOAuth({input:{did:s,oauth:JSON.stringify({google:i})}}),j=Object.assign({...ue},((T=(a=o==null?void 0:o.settings)==null?void 0:a.oauth)==null?void 0:T.google)||{});l(j),U.success(n("oauth.saveSuccess"))}catch(o){U.error(o.message||n("oauth.saveFailed"))}}),L=p(i=>i!=null&&i.trim()?!0:n("oauth.google.clientIdDescription")),x=p(i=>i!=null&&i.trim()?!0:n("oauth.google.clientSecretDescription")),g=p(()=>!0);return e.jsx(m,{children:e.jsxs("form",{onSubmit:t(k),disabled:!0,children:[e.jsx(I,{title:n("oauth.google.enable"),mb:2.5,children:e.jsx(C,{name:"enabled",control:f,render:({field:i})=>e.jsx(W,{control:e.jsx(ie,{sx:{ml:1},checked:i.value,...i})})})}),e.jsx(I,{title:n("oauth.google.clientId"),children:e.jsx(C,{name:"clientId",control:f,rules:{validate:d?L:g},render:({field:i})=>{var a;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...i,size:"small",label:n("oauth.google.clientId"),error:!!c.errors[i.name],helperText:((a=c.errors[i.name])==null?void 0:a.message)||" ",disabled:!d})})}})}),e.jsx(I,{title:n("oauth.google.clientSecret"),children:e.jsx(C,{name:"clientSecret",control:f,rules:{validate:d?x:g},render:({field:i})=>{var a;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...i,size:"small",type:"password",label:n("oauth.google.clientSecret"),error:!!c.errors[i.name],helperText:((a=c.errors[i.name])==null?void 0:a.message)||" ",disabled:!d})})}})}),e.jsx($,{type:"submit",variant:"contained",onSubmit:t(k),disabled:!c.isDirty,children:n("oauth.save")})]})})}const me={enabled:!1,teamId:"",serviceId:"",keyId:"",authKey:"",bundleId:""};function gt(){var i,a,T;const{api:S}=J(),{blocklet:r}=V(),{t:n}=ne(),s=(i=r==null?void 0:r.meta)==null?void 0:i.did,w=Object.assign({...me},((T=(a=r==null?void 0:r.settings)==null?void 0:a.oauth)==null?void 0:T.apple)||{}),{handleSubmit:t,control:f,formState:c,watch:h,reset:l}=oe({defaultValues:Y(w,Object.keys(me))}),d=h("enabled"),k=p(async o=>{var j,u;try{const{blocklet:P}=await S.configOAuth({input:{did:s,oauth:JSON.stringify({apple:o})}}),A=Object.assign({...me},((u=(j=P==null?void 0:P.settings)==null?void 0:j.oauth)==null?void 0:u.apple)||{});l(A),U.success(n("oauth.saveSuccess"))}catch(P){U.error(P.message||n("oauth.saveFailed"))}}),L=p(o=>o!=null&&o.trim()?!0:n("oauth.apple.teamIdDescription")),x=p(o=>o!=null&&o.trim()?!0:n("oauth.apple.serviceIdDescription")),g=p(o=>o!=null&&o.trim()?!0:n("oauth.apple.keyIdDescription")),v=p(o=>o!=null&&o.trim()?!0:n("oauth.apple.authKeyDescription")),b=p(o=>o!=null&&o.trim()?!0:n("oauth.apple.bundleIdDescription")),y=p(()=>!0);return e.jsx(m,{children:e.jsxs("form",{onSubmit:t(k),disabled:!0,children:[e.jsx(I,{title:n("oauth.apple.enable"),mb:2.5,children:e.jsx(C,{name:"enabled",control:f,render:({field:o})=>e.jsx(W,{control:e.jsx(ie,{sx:{ml:1},checked:o.value,...o})})})}),e.jsx(I,{title:n("oauth.apple.teamId"),children:e.jsx(C,{name:"teamId",control:f,rules:{validate:d?L:y},render:({field:o})=>{var j;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...o,size:"small",label:n("oauth.apple.teamId"),error:!!c.errors[o.name],helperText:((j=c.errors[o.name])==null?void 0:j.message)||" ",disabled:!d})})}})}),e.jsx(I,{title:n("oauth.apple.bundleId"),children:e.jsx(C,{name:"bundleId",control:f,rules:{validate:d?b:y},render:({field:o})=>{var j;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...o,size:"small",label:n("oauth.apple.bundleId"),error:!!c.errors[o.name],helperText:((j=c.errors[o.name])==null?void 0:j.message)||" ",disabled:!d})})}})}),e.jsx(I,{title:n("oauth.apple.serviceId"),children:e.jsx(C,{name:"serviceId",control:f,rules:{validate:d?x:y},render:({field:o})=>{var j;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...o,size:"small",label:n("oauth.apple.serviceId"),error:!!c.errors[o.name],helperText:((j=c.errors[o.name])==null?void 0:j.message)||" ",disabled:!d})})}})}),e.jsx(I,{title:n("oauth.apple.keyId"),children:e.jsx(C,{name:"keyId",control:f,rules:{validate:d?g:y},render:({field:o})=>{var j;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...o,size:"small",label:n("oauth.apple.keyId"),error:!!c.errors[o.name],helperText:((j=c.errors[o.name])==null?void 0:j.message)||" ",disabled:!d})})}})}),e.jsx(I,{title:n("oauth.apple.authKey"),children:e.jsx(C,{name:"authKey",control:f,rules:{validate:d?v:y},render:({field:o})=>{var j;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...o,size:"small",type:"password",label:n("oauth.apple.authKey"),multiline:!0,rows:4,error:!!c.errors[o.name],helperText:((j=c.errors[o.name])==null?void 0:j.message)||" ",disabled:!d})})}})}),e.jsx($,{type:"submit",variant:"contained",onSubmit:t(k),disabled:!c.isDirty,children:n("oauth.save")})]})})}const jt={width:24,height:24,body:'<path fill="currentColor" d="M9 20q-.825 0-1.413-.588T7 18q0-.825.588-1.413T9 16q.825 0 1.413.588T11 18q0 .825-.588 1.413T9 20Zm6 0q-.825 0-1.413-.588T13 18q0-.825.588-1.413T15 16q.825 0 1.413.588T17 18q0 .825-.588 1.413T15 20Zm-6-6q-.825 0-1.413-.588T7 12q0-.825.588-1.413T9 10q.825 0 1.413.588T11 12q0 .825-.588 1.413T9 14Zm6 0q-.825 0-1.413-.588T13 12q0-.825.588-1.413T15 10q.825 0 1.413.588T17 12q0 .825-.588 1.413T15 14ZM9 8q-.825 0-1.413-.588T7 6q0-.825.588-1.413T9 4q.825 0 1.413.588T11 6q0 .825-.588 1.413T9 8Zm6 0q-.825 0-1.413-.588T13 6q0-.825.588-1.413T15 4q.825 0 1.413.588T17 6q0 .825-.588 1.413T15 8Z"/>'};function ve({title:S,id:r,children:n,index:s,onMove:w,defaultExpand:t,onEnd:f}){const[c,h]=R.useState(t),l=R.useRef(null),d=R.useRef(null),[{handlerId:k},L]=Ee({accept:"dragItem",collect(y){return{handlerId:y.getHandlerId()}},hover(y,i){var _,Q;if(!l.current)return;const a=y.index,T=s;if(a===T)return;const o=(_=l.current)==null?void 0:_.getBoundingClientRect(),j=(Q=d.current)==null?void 0:Q.getBoundingClientRect(),u=(j.bottom-j.top)/2,A=i.getClientOffset().y-o.top;a<T&&A<u||a>T&&A>u||(w(a,T),y.index=T)}}),[{isDragging:x},g]=Ue({item:{index:s,type:"dragItem"},collect:y=>({isDragging:y.isDragging()}),end:f});g(d),L(l);const v=x?.5:1,b=p(y=>{y.preventDefault(),y.stopPropagation(),h(!c)});return e.jsxs(m,{ref:l,children:[e.jsxs(m,{sx:{cursor:"pointer","&:hover":{backgroundColor:le.backgroundsBgSubtileHover}},ref:d,"data-handler-id":k,children:[e.jsxs(m,{sx:{py:2,px:1,opacity:v,display:"flex",alignItems:"center",gap:.5},draggable:!1,onClick:b,children:[e.jsx(m,{sx:{pointerEvents:"auto",cursor:"grab","&:active":{cursor:"grabbing"},fontSize:0,color:le.textMuted,"&:hover":{color:le.textSubtitle}},children:e.jsx(K,{fontSize:20,icon:jt})}),e.jsx(fe,{sx:{flex:1},children:S}),e.jsx(ae,{size:"small",sx:{pointerEvents:"auto",transform:c?"":"rotate(180deg)",transition:"transform 0.3s ease"},children:e.jsx(K,{icon:lt,style:{transform:"scale(1.5)"}})})]}),e.jsx(re,{})]}),e.jsx(m,{sx:{pl:4,py:2.5,display:c?"block":"none"},children:n})]})}ve.propTypes={title:N.string.isRequired,id:N.string.isRequired,children:N.node.isRequired,index:N.number.isRequired,onMove:N.func.isRequired,onEnd:N.func.isRequired,defaultExpand:N.bool};ve.defaultProps={defaultExpand:!1};const bt=[{name:"github",title:"GitHub",icon:e.jsx(K,{icon:_e}),component:e.jsx(xt,{})},{name:"google",title:"Google",icon:e.jsx(K,{icon:$e}),component:e.jsx(ft,{})},{name:"apple",title:"Apple",icon:e.jsx(K,{icon:Ve}),component:e.jsx(gt,{})},{name:"auth0",title:"Auth0",icon:e.jsx(K,{icon:Ne}),component:e.jsx(ht,{})}],vt=["github","google","apple","auth0"];function yt(){var k,L;const{api:S}=J(),{blocklet:r}=V(),n=(k=r==null?void 0:r.meta)==null?void 0:k.did,s=((L=r==null?void 0:r.settings)==null?void 0:L.oauth)||{},w=Object.keys(s).sort((x,g)=>{var v,b,y;return((v=s[x])==null?void 0:v.order)!==void 0&&((b=s[g])==null?void 0:b.order)!==void 0?s[x].order-s[g].order:((y=s[x])==null?void 0:y.order)!==void 0?-1:1});for(const x of vt)w.includes(x)||w.push(x);const t=se(w.reduce((x,g,v)=>Object.assign(x,{[g]:v}),{})),f=te(()=>{const x=[...bt];return x.sort((g,v)=>t[g.name]-t[v.name]),x},[t.auth0,t.github,t.google]),c={};typeof window<"u"&&(c.context=window);const h=p(async x=>{const g={};Object.keys(x).forEach(v=>{g[v]={order:x[v]}}),await S.configOAuth({input:{did:n,oauth:JSON.stringify(g)}})}),l=p((x,g)=>{const v=f[x],b=f[g];t[v.name]=g,t[b.name]=x}),d=p(async()=>{await h(t)});return e.jsx(m,{sx:{".section-left":{width:"160px"}},children:e.jsx(We,{backend:Me,...c,children:f.map((x,g)=>e.jsx(ve,{index:g,id:x.name,title:x.title,icon:x.icon,onMove:l,onEnd:d,defaultExpand:x.enabled,children:x.component},x.name))})})}const G={ttl:he.SESSION_TTL,cacheTtl:he.SESSION_CACHE_TTL,email:{enabled:!1,requireVerified:!1,requireUnique:!1,trustOauthProviders:!1,trustedIssuers:[],enableDomainBlackList:!1,domainBlackList:[],enableDomainWhiteList:!1,domainWhiteList:[]},phone:{enabled:!1,requireVerified:!1,requireUnique:!1,regionBlackList:[],trustedIssuers:[]}};function M(S){return e.jsx(ct,{...S,sx:{transform:"scale(0.75)"}})}function pe(S,r=!1){const n=r?S.ttl*86400:S.ttl/86400;return{...S,ttl:n}}function St(){var o,j;const{api:S}=J(),{blocklet:r}=V(),n=(o=r==null?void 0:r.meta)==null?void 0:o.did,s=st({},G,((j=r==null?void 0:r.settings)==null?void 0:j.session)||{});qe(s.ttl)&&(s.ttl=G.ttl),qe(s.cacheTtl)&&(s.cacheTtl=G.cacheTtl),s.phone||(s.phone=G.phone),s.email||(s.email=G.email);const{handleSubmit:w,control:t,formState:f,reset:c,watch:h}=oe({defaultValues:Y(pe(s),["ttl","cacheTtl","email","phone"])}),{t:l}=ne(),d=h("email.enabled"),k=h("phone.enabled"),L=h("email.enableDomainBlackList"),x=h("email.enableDomainWhiteList"),{fields:g,append:v,remove:b}=Fe({control:t,name:"email.domainBlackList"}),{fields:y,append:i,remove:a}=Fe({control:t,name:"email.domainWhiteList"}),T=p(async u=>{var P;try{const{blocklet:A}=await S.updateAppSessionConfig({input:{did:n,config:ot(pe(u,!0),["phone"])}}),_=Object.assign({},G,Y(((P=A==null?void 0:A.settings)==null?void 0:P.session)||{},["ttl","cacheTtl","email","phone"]));c(pe(_)),U.success(l("common.configSuccess"))}catch(A){U.error(A.message)}});return e.jsx(wt,{onSubmit:w(T),children:e.jsxs(H,{direction:"column",gap:6,children:[e.jsxs(m,{children:[e.jsxs(m,{children:[e.jsx(fe,{variant:"h6",fontWeight:600,children:l("blocklet.config.session.profile")}),e.jsx(m,{component:re,my:3})]}),e.jsxs(H,{gap:2,children:[e.jsx(I,{title:l("blocklet.config.session.fullNameEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(M,{disabled:!0,checked:!0})})}),e.jsx(I,{title:l("blocklet.config.session.avatarEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(M,{disabled:!0,checked:!0})})}),e.jsx(I,{title:l("blocklet.config.session.emailEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(C,{name:"email.enabled",control:t,render:({field:u})=>e.jsx(M,{...u,checked:u.value})})})}),d&&e.jsxs(H,{direction:"column",ml:2,children:[e.jsx(I,{title:l("blocklet.config.session.emailRequireVerified"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(C,{name:"email.requireVerified",control:t,render:({field:u})=>e.jsx(W,{sx:{mt:1},control:e.jsx(M,{...u,checked:u.value})})})})}),e.jsx(I,{title:l("blocklet.config.session.emailRequireUnique"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(C,{name:"email.requireUnique",control:t,render:({field:u})=>e.jsx(W,{sx:{mt:1},control:e.jsx(M,{...u,checked:u.value})})})})}),e.jsx(I,{title:l("blocklet.config.session.emailTrustOauthProviders"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(C,{name:"email.trustOauthProviders",control:t,render:({field:u})=>e.jsx(W,{sx:{mt:1},control:e.jsx(M,{...u,checked:u.value})})})})}),e.jsx(I,{title:l("blocklet.config.session.enableDomainBlackList"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(C,{name:"email.enableDomainBlackList",control:t,render:({field:u})=>e.jsx(W,{sx:{mt:1},control:e.jsx(M,{...u,checked:u.value})})})})}),L&&e.jsxs(m,{children:[g.map((u,P)=>e.jsxs(H,{direction:"row",alignItems:"center",my:1,maxWidth:"720px",children:[e.jsx(C,{name:`email.domainBlackList.${P}`,control:t,render:A=>e.jsx(B,{...A.field,size:"small",fullWidth:!0})}),e.jsx(ae,{onClick:()=>b(P),children:e.jsx(Ce,{})})]},u.id)),e.jsx($,{startIcon:e.jsx(Pe,{}),onClick:()=>v(""),children:l("blocklet.config.session.addDomain")})]}),e.jsx(I,{title:l("blocklet.config.session.enableDomainWhiteList"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(C,{name:"email.enableDomainWhiteList",control:t,render:({field:u})=>e.jsx(W,{sx:{mt:1},control:e.jsx(M,{...u,checked:u.value})})})})}),x&&e.jsxs(m,{children:[y.map((u,P)=>e.jsxs(H,{direction:"row",alignItems:"center",my:1,maxWidth:"720px",children:[e.jsx(C,{name:`email.domainWhiteList.${P}`,control:t,render:A=>e.jsx(B,{...A.field,size:"small",fullWidth:!0})}),e.jsx(ae,{onClick:()=>a(P),children:e.jsx(Ce,{})})]},u.id)),e.jsx($,{startIcon:e.jsx(Pe,{}),onClick:()=>i(""),children:l("blocklet.config.session.addDomain")})]})]}),e.jsxs(m,{sx:{display:"none"},children:[e.jsx(I,{title:l("blocklet.config.session.phoneEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(C,{name:"phone.enabled",control:t,disabled:!0,render:({field:u})=>e.jsx(W,{sx:{mt:1},control:e.jsx(M,{...u,checked:u.value})})})})}),k&&e.jsxs(H,{direction:"column",ml:2,mt:1,children:[e.jsx(I,{title:l("blocklet.config.session.phoneRequireVerified"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(C,{name:"phone.requireVerified",control:t,render:({field:u})=>e.jsx(W,{control:e.jsx(M,{...u,checked:u.value})})})})}),e.jsx(I,{title:l("blocklet.config.session.phoneRequireUnique"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(C,{name:"phone.requireUnique",control:t,render:({field:u})=>e.jsx(W,{control:e.jsx(M,{...u,checked:u.value})})})})})]})]})]})]}),e.jsxs(m,{children:[e.jsx(fe,{variant:"h6",fontWeight:600,children:l("blocklet.config.session.period")}),e.jsx(m,{component:re,my:3}),e.jsx(H,{direction:"column",spacing:2,children:e.jsx(C,{name:"ttl",control:t,rules:{min:1,max:30},render:({field:u})=>e.jsx(E,{fullWidth:!0,sx:{mb:2},children:e.jsx(I,{title:l("blocklet.config.session.ttl",{day:u.value}),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{maxWidth:500,ml:1},children:e.jsx(et,{...u,defaultValue:7,step:1,marks:[{value:1,label:l("blocklet.config.session.day",{day:1})},{value:7,label:l("blocklet.config.session.days",{day:7})},{value:14,label:l("blocklet.config.session.days",{day:14})},{value:21,label:l("blocklet.config.session.days",{day:21})},{value:30,label:l("blocklet.config.session.days",{day:30})}],min:1,max:30,valueLabelDisplay:"auto"})})})})})})]}),e.jsx(m,{children:e.jsx($,{type:"submit",variant:"contained",disabled:!f.isDirty,children:l("oauth.save")})})]})})}const wt=Re.form`
1
+ import{u as ne,Y as U,cd as Ee,ce as Ue,o as le,h as K,cb as We,cc as Me,aa as _e,ab as $e,a9 as Ve,cf as Ne,b1 as Ce,p as he,r as Je,a$ as X,cg as xe,ak as je,B as z,c2 as He,a4 as Ke,ch as Ge,a5 as Ze,a1 as Ye,_ as Xe,aq as De}from"./vendor-ux-did-connect-CiLSrCOH.js";import{u as p,a as se,f as te,c as Qe}from"./vendor-hooks-BwVH-TAd.js";import{r as R}from"./vendor-react-DoD83n6N.js";import{j as e,aa as m,bs as W,bo as E,O as B,y as $,H as N,T as fe,I as ae,X as re,ag as Re,ak as H,cx as et,a8 as tt,e as be,a9 as ge,a5 as Ae,ab as nt}from"./vendor-mui-core-DxD1UA4o.js";import{I as Y,a2 as st,b as qe,C as ot,n as Z,aE as at,y as rt,z as it}from"./vendor-utils-CTIzdAFg.js";import{a as oe,S as I,C,f as Fe}from"./dashboard-D3KvORmC.js";import{z as J,C as V}from"./index-CWohFZPl.js";import{S as ie}from"./switch-control-DPANzJ8H.js";import{K as lt}from"./keyboard-arrow-down-rounded-DadBVmpO.js";import{B as Pe,J as ct,c as dt}from"./vendor-arcblock-BtlDhznp.js";import{I as ut}from"./index-BRz2myBK.js";import{b as mt}from"./base32-CQfYcymN.js";import{u as pt}from"./use-mobile-BHPd3bDQ.js";import"./lottie-web-B6s7dDoL.js";import"./useLocalStorage-BXnF_60k.js";import"./confirm-Fhl5qi_m.js";import"./format-error-LAoTjvJe.js";import"./PlayArrow-NjIpSDwJ.js";import"./get-safe-url-ZRaKUVld.js";import"./index-Bx2tzf6d.js";import"./session-DaQ4KCFD.js";import"./useAsyncRetry-BBomZj1z.js";import"./useAsync-DKE0K0bz.js";import"./InfoOutlined-DO0_Vjz-.js";import"./useSetState-BL3ktMon.js";import"./use-mobile-CHMVa8_W.js";const ce={enabled:!1,domain:"",clientId:"",clientSecret:""};function ht(){var b,y,i;const{api:S}=J(),{blocklet:r}=V(),{t:n}=ne(),s=(b=r==null?void 0:r.meta)==null?void 0:b.did,w=Object.assign({...ce},((i=(y=r==null?void 0:r.settings)==null?void 0:y.oauth)==null?void 0:i.auth0)||{}),{handleSubmit:t,control:f,formState:c,watch:h,reset:l}=oe({defaultValues:Y(w,Object.keys(ce))}),d=h("enabled"),k=p(async a=>{var T,o;try{const{blocklet:j}=await S.configOAuth({input:{did:s,oauth:JSON.stringify({auth0:a})}}),u=Object.assign({...ce},((o=(T=j==null?void 0:j.settings)==null?void 0:T.oauth)==null?void 0:o.auth0)||{});l(u),U.success(n("oauth.saveSuccess"))}catch(j){U.error(j.message||n("oauth.saveFailed"))}}),L=p(a=>a!=null&&a.trim()?!0:n("oauth.auth0.domainDescription")),x=p(a=>a!=null&&a.trim()?!0:n("oauth.auth0.clientIdDescription")),g=p(a=>a!=null&&a.trim()?!0:n("oauth.auth0.clientSecretDescription")),v=p(()=>!0);return e.jsx(m,{children:e.jsxs("form",{onSubmit:t(k),disabled:!0,children:[e.jsx(I,{title:n("oauth.auth0.enable"),mb:2.5,children:e.jsx(C,{name:"enabled",control:f,render:({field:a})=>e.jsx(W,{control:e.jsx(ie,{sx:{ml:1},checked:a.value,...a})})})}),e.jsx(I,{title:n("oauth.auth0.domain"),children:e.jsx(C,{name:"domain",control:f,rules:{validate:d?L:v},render:({field:a})=>{var T;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...a,size:"small",label:n("oauth.auth0.domain"),error:!!c.errors[a.name],helperText:((T=c.errors[a.name])==null?void 0:T.message)||" ",disabled:!d})})}})}),e.jsx(I,{title:n("oauth.auth0.clientId"),children:e.jsx(C,{name:"clientId",control:f,rules:{validate:d?x:v},render:({field:a})=>{var T;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...a,size:"small",label:n("oauth.auth0.clientId"),error:!!c.errors[a.name],helperText:((T=c.errors[a.name])==null?void 0:T.message)||" ",disabled:!d})})}})}),e.jsx(I,{title:n("oauth.auth0.clientSecret"),children:e.jsx(C,{name:"clientSecret",control:f,rules:{validate:d?g:v},render:({field:a})=>{var T;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...a,size:"small",type:"password",label:n("oauth.auth0.clientSecret"),error:!!c.errors[a.name],helperText:((T=c.errors[a.name])==null?void 0:T.message)||" ",disabled:!d})})}})}),e.jsx($,{type:"submit",variant:"contained",onSubmit:t(k),disabled:!c.isDirty,children:n("oauth.save")})]})})}const de={enabled:!1,clientId:"",clientSecret:""};function xt(){var v,b,y;const{api:S}=J(),{blocklet:r}=V(),{t:n}=ne(),s=(v=r==null?void 0:r.meta)==null?void 0:v.did,w=Object.assign({...de},((y=(b=r==null?void 0:r.settings)==null?void 0:b.oauth)==null?void 0:y.github)||{}),{handleSubmit:t,control:f,formState:c,watch:h,reset:l}=oe({defaultValues:Y(w,Object.keys(de))}),d=h("enabled"),k=p(async i=>{var a,T;try{const{blocklet:o}=await S.configOAuth({input:{did:s,oauth:JSON.stringify({github:i})}}),j=Object.assign({...de},((T=(a=o==null?void 0:o.settings)==null?void 0:a.oauth)==null?void 0:T.github)||{});l(j),U.success(n("oauth.saveSuccess"))}catch(o){U.error(o.message||n("oauth.saveFailed"))}}),L=p(i=>i!=null&&i.trim()?!0:n("oauth.github.clientIdDescription")),x=p(i=>i!=null&&i.trim()?!0:n("oauth.github.clientSecretDescription")),g=p(()=>!0);return e.jsx(m,{children:e.jsxs("form",{onSubmit:t(k),disabled:!0,children:[e.jsx(I,{title:n("oauth.github.enable"),mb:2.5,children:e.jsx(C,{name:"enabled",control:f,render:({field:i})=>e.jsx(W,{control:e.jsx(ie,{sx:{ml:1},checked:i.value,...i})})})}),e.jsx(I,{title:n("oauth.github.clientId"),children:e.jsx(C,{name:"clientId",control:f,rules:{validate:d?L:g},render:({field:i})=>{var a;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...i,size:"small",label:n("oauth.github.clientId"),error:!!c.errors[i.name],helperText:((a=c.errors[i.name])==null?void 0:a.message)||" ",disabled:!d})})}})}),e.jsx(I,{title:n("oauth.github.clientSecret"),children:e.jsx(C,{name:"clientSecret",control:f,rules:{validate:d?x:g},render:({field:i})=>{var a;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...i,size:"small",type:"password",label:n("oauth.github.clientSecret"),error:!!c.errors[i.name],helperText:((a=c.errors[i.name])==null?void 0:a.message)||" ",disabled:!d})})}})}),e.jsx($,{type:"submit",variant:"contained",onSubmit:t(k),disabled:!c.isDirty,children:n("oauth.save")})]})})}const ue={enabled:!1,clientId:"",clientSecret:""};function ft(){var v,b,y;const{api:S}=J(),{blocklet:r}=V(),{t:n}=ne(),s=(v=r==null?void 0:r.meta)==null?void 0:v.did,w=Object.assign({...ue},((y=(b=r==null?void 0:r.settings)==null?void 0:b.oauth)==null?void 0:y.google)||{}),{handleSubmit:t,control:f,formState:c,watch:h,reset:l}=oe({defaultValues:Y(w,Object.keys(ue))}),d=h("enabled"),k=p(async i=>{var a,T;try{const{blocklet:o}=await S.configOAuth({input:{did:s,oauth:JSON.stringify({google:i})}}),j=Object.assign({...ue},((T=(a=o==null?void 0:o.settings)==null?void 0:a.oauth)==null?void 0:T.google)||{});l(j),U.success(n("oauth.saveSuccess"))}catch(o){U.error(o.message||n("oauth.saveFailed"))}}),L=p(i=>i!=null&&i.trim()?!0:n("oauth.google.clientIdDescription")),x=p(i=>i!=null&&i.trim()?!0:n("oauth.google.clientSecretDescription")),g=p(()=>!0);return e.jsx(m,{children:e.jsxs("form",{onSubmit:t(k),disabled:!0,children:[e.jsx(I,{title:n("oauth.google.enable"),mb:2.5,children:e.jsx(C,{name:"enabled",control:f,render:({field:i})=>e.jsx(W,{control:e.jsx(ie,{sx:{ml:1},checked:i.value,...i})})})}),e.jsx(I,{title:n("oauth.google.clientId"),children:e.jsx(C,{name:"clientId",control:f,rules:{validate:d?L:g},render:({field:i})=>{var a;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...i,size:"small",label:n("oauth.google.clientId"),error:!!c.errors[i.name],helperText:((a=c.errors[i.name])==null?void 0:a.message)||" ",disabled:!d})})}})}),e.jsx(I,{title:n("oauth.google.clientSecret"),children:e.jsx(C,{name:"clientSecret",control:f,rules:{validate:d?x:g},render:({field:i})=>{var a;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...i,size:"small",type:"password",label:n("oauth.google.clientSecret"),error:!!c.errors[i.name],helperText:((a=c.errors[i.name])==null?void 0:a.message)||" ",disabled:!d})})}})}),e.jsx($,{type:"submit",variant:"contained",onSubmit:t(k),disabled:!c.isDirty,children:n("oauth.save")})]})})}const me={enabled:!1,teamId:"",serviceId:"",keyId:"",authKey:"",bundleId:""};function gt(){var i,a,T;const{api:S}=J(),{blocklet:r}=V(),{t:n}=ne(),s=(i=r==null?void 0:r.meta)==null?void 0:i.did,w=Object.assign({...me},((T=(a=r==null?void 0:r.settings)==null?void 0:a.oauth)==null?void 0:T.apple)||{}),{handleSubmit:t,control:f,formState:c,watch:h,reset:l}=oe({defaultValues:Y(w,Object.keys(me))}),d=h("enabled"),k=p(async o=>{var j,u;try{const{blocklet:P}=await S.configOAuth({input:{did:s,oauth:JSON.stringify({apple:o})}}),A=Object.assign({...me},((u=(j=P==null?void 0:P.settings)==null?void 0:j.oauth)==null?void 0:u.apple)||{});l(A),U.success(n("oauth.saveSuccess"))}catch(P){U.error(P.message||n("oauth.saveFailed"))}}),L=p(o=>o!=null&&o.trim()?!0:n("oauth.apple.teamIdDescription")),x=p(o=>o!=null&&o.trim()?!0:n("oauth.apple.serviceIdDescription")),g=p(o=>o!=null&&o.trim()?!0:n("oauth.apple.keyIdDescription")),v=p(o=>o!=null&&o.trim()?!0:n("oauth.apple.authKeyDescription")),b=p(o=>o!=null&&o.trim()?!0:n("oauth.apple.bundleIdDescription")),y=p(()=>!0);return e.jsx(m,{children:e.jsxs("form",{onSubmit:t(k),disabled:!0,children:[e.jsx(I,{title:n("oauth.apple.enable"),mb:2.5,children:e.jsx(C,{name:"enabled",control:f,render:({field:o})=>e.jsx(W,{control:e.jsx(ie,{sx:{ml:1},checked:o.value,...o})})})}),e.jsx(I,{title:n("oauth.apple.teamId"),children:e.jsx(C,{name:"teamId",control:f,rules:{validate:d?L:y},render:({field:o})=>{var j;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...o,size:"small",label:n("oauth.apple.teamId"),error:!!c.errors[o.name],helperText:((j=c.errors[o.name])==null?void 0:j.message)||" ",disabled:!d})})}})}),e.jsx(I,{title:n("oauth.apple.bundleId"),children:e.jsx(C,{name:"bundleId",control:f,rules:{validate:d?b:y},render:({field:o})=>{var j;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...o,size:"small",label:n("oauth.apple.bundleId"),error:!!c.errors[o.name],helperText:((j=c.errors[o.name])==null?void 0:j.message)||" ",disabled:!d})})}})}),e.jsx(I,{title:n("oauth.apple.serviceId"),children:e.jsx(C,{name:"serviceId",control:f,rules:{validate:d?x:y},render:({field:o})=>{var j;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...o,size:"small",label:n("oauth.apple.serviceId"),error:!!c.errors[o.name],helperText:((j=c.errors[o.name])==null?void 0:j.message)||" ",disabled:!d})})}})}),e.jsx(I,{title:n("oauth.apple.keyId"),children:e.jsx(C,{name:"keyId",control:f,rules:{validate:d?g:y},render:({field:o})=>{var j;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...o,size:"small",label:n("oauth.apple.keyId"),error:!!c.errors[o.name],helperText:((j=c.errors[o.name])==null?void 0:j.message)||" ",disabled:!d})})}})}),e.jsx(I,{title:n("oauth.apple.authKey"),children:e.jsx(C,{name:"authKey",control:f,rules:{validate:d?v:y},render:({field:o})=>{var j;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...o,size:"small",type:"password",label:n("oauth.apple.authKey"),multiline:!0,rows:4,error:!!c.errors[o.name],helperText:((j=c.errors[o.name])==null?void 0:j.message)||" ",disabled:!d})})}})}),e.jsx($,{type:"submit",variant:"contained",onSubmit:t(k),disabled:!c.isDirty,children:n("oauth.save")})]})})}const jt={width:24,height:24,body:'<path fill="currentColor" d="M9 20q-.825 0-1.413-.588T7 18q0-.825.588-1.413T9 16q.825 0 1.413.588T11 18q0 .825-.588 1.413T9 20Zm6 0q-.825 0-1.413-.588T13 18q0-.825.588-1.413T15 16q.825 0 1.413.588T17 18q0 .825-.588 1.413T15 20Zm-6-6q-.825 0-1.413-.588T7 12q0-.825.588-1.413T9 10q.825 0 1.413.588T11 12q0 .825-.588 1.413T9 14Zm6 0q-.825 0-1.413-.588T13 12q0-.825.588-1.413T15 10q.825 0 1.413.588T17 12q0 .825-.588 1.413T15 14ZM9 8q-.825 0-1.413-.588T7 6q0-.825.588-1.413T9 4q.825 0 1.413.588T11 6q0 .825-.588 1.413T9 8Zm6 0q-.825 0-1.413-.588T13 6q0-.825.588-1.413T15 4q.825 0 1.413.588T17 6q0 .825-.588 1.413T15 8Z"/>'};function ve({title:S,id:r,children:n,index:s,onMove:w,defaultExpand:t,onEnd:f}){const[c,h]=R.useState(t),l=R.useRef(null),d=R.useRef(null),[{handlerId:k},L]=Ee({accept:"dragItem",collect(y){return{handlerId:y.getHandlerId()}},hover(y,i){var _,Q;if(!l.current)return;const a=y.index,T=s;if(a===T)return;const o=(_=l.current)==null?void 0:_.getBoundingClientRect(),j=(Q=d.current)==null?void 0:Q.getBoundingClientRect(),u=(j.bottom-j.top)/2,A=i.getClientOffset().y-o.top;a<T&&A<u||a>T&&A>u||(w(a,T),y.index=T)}}),[{isDragging:x},g]=Ue({item:{index:s,type:"dragItem"},collect:y=>({isDragging:y.isDragging()}),end:f});g(d),L(l);const v=x?.5:1,b=p(y=>{y.preventDefault(),y.stopPropagation(),h(!c)});return e.jsxs(m,{ref:l,children:[e.jsxs(m,{sx:{cursor:"pointer","&:hover":{backgroundColor:le.backgroundsBgSubtileHover}},ref:d,"data-handler-id":k,children:[e.jsxs(m,{sx:{py:2,px:1,opacity:v,display:"flex",alignItems:"center",gap:.5},draggable:!1,onClick:b,children:[e.jsx(m,{sx:{pointerEvents:"auto",cursor:"grab","&:active":{cursor:"grabbing"},fontSize:0,color:le.textMuted,"&:hover":{color:le.textSubtitle}},children:e.jsx(K,{fontSize:20,icon:jt})}),e.jsx(fe,{sx:{flex:1},children:S}),e.jsx(ae,{size:"small",sx:{pointerEvents:"auto",transform:c?"":"rotate(180deg)",transition:"transform 0.3s ease"},children:e.jsx(K,{icon:lt,style:{transform:"scale(1.5)"}})})]}),e.jsx(re,{})]}),e.jsx(m,{sx:{pl:4,py:2.5,display:c?"block":"none"},children:n})]})}ve.propTypes={title:N.string.isRequired,id:N.string.isRequired,children:N.node.isRequired,index:N.number.isRequired,onMove:N.func.isRequired,onEnd:N.func.isRequired,defaultExpand:N.bool};ve.defaultProps={defaultExpand:!1};const bt=[{name:"github",title:"GitHub",icon:e.jsx(K,{icon:_e}),component:e.jsx(xt,{})},{name:"google",title:"Google",icon:e.jsx(K,{icon:$e}),component:e.jsx(ft,{})},{name:"apple",title:"Apple",icon:e.jsx(K,{icon:Ve}),component:e.jsx(gt,{})},{name:"auth0",title:"Auth0",icon:e.jsx(K,{icon:Ne}),component:e.jsx(ht,{})}],vt=["github","google","apple","auth0"];function yt(){var k,L;const{api:S}=J(),{blocklet:r}=V(),n=(k=r==null?void 0:r.meta)==null?void 0:k.did,s=((L=r==null?void 0:r.settings)==null?void 0:L.oauth)||{},w=Object.keys(s).sort((x,g)=>{var v,b,y;return((v=s[x])==null?void 0:v.order)!==void 0&&((b=s[g])==null?void 0:b.order)!==void 0?s[x].order-s[g].order:((y=s[x])==null?void 0:y.order)!==void 0?-1:1});for(const x of vt)w.includes(x)||w.push(x);const t=se(w.reduce((x,g,v)=>Object.assign(x,{[g]:v}),{})),f=te(()=>{const x=[...bt];return x.sort((g,v)=>t[g.name]-t[v.name]),x},[t.auth0,t.github,t.google]),c={};typeof window<"u"&&(c.context=window);const h=p(async x=>{const g={};Object.keys(x).forEach(v=>{g[v]={order:x[v]}}),await S.configOAuth({input:{did:n,oauth:JSON.stringify(g)}})}),l=p((x,g)=>{const v=f[x],b=f[g];t[v.name]=g,t[b.name]=x}),d=p(async()=>{await h(t)});return e.jsx(m,{sx:{".section-left":{width:"160px"}},children:e.jsx(We,{backend:Me,...c,children:f.map((x,g)=>e.jsx(ve,{index:g,id:x.name,title:x.title,icon:x.icon,onMove:l,onEnd:d,defaultExpand:x.enabled,children:x.component},x.name))})})}const G={ttl:he.SESSION_TTL,cacheTtl:he.SESSION_CACHE_TTL,email:{enabled:!1,requireVerified:!1,requireUnique:!1,trustOauthProviders:!1,trustedIssuers:[],enableDomainBlackList:!1,domainBlackList:[],enableDomainWhiteList:!1,domainWhiteList:[]},phone:{enabled:!1,requireVerified:!1,requireUnique:!1,regionBlackList:[],trustedIssuers:[]}};function M(S){return e.jsx(ct,{...S,sx:{transform:"scale(0.75)"}})}function pe(S,r=!1){const n=r?S.ttl*86400:S.ttl/86400;return{...S,ttl:n}}function St(){var o,j;const{api:S}=J(),{blocklet:r}=V(),n=(o=r==null?void 0:r.meta)==null?void 0:o.did,s=st({},G,((j=r==null?void 0:r.settings)==null?void 0:j.session)||{});qe(s.ttl)&&(s.ttl=G.ttl),qe(s.cacheTtl)&&(s.cacheTtl=G.cacheTtl),s.phone||(s.phone=G.phone),s.email||(s.email=G.email);const{handleSubmit:w,control:t,formState:f,reset:c,watch:h}=oe({defaultValues:Y(pe(s),["ttl","cacheTtl","email","phone"])}),{t:l}=ne(),d=h("email.enabled"),k=h("phone.enabled"),L=h("email.enableDomainBlackList"),x=h("email.enableDomainWhiteList"),{fields:g,append:v,remove:b}=Fe({control:t,name:"email.domainBlackList"}),{fields:y,append:i,remove:a}=Fe({control:t,name:"email.domainWhiteList"}),T=p(async u=>{var P;try{const{blocklet:A}=await S.updateAppSessionConfig({input:{did:n,config:ot(pe(u,!0),["phone"])}}),_=Object.assign({},G,Y(((P=A==null?void 0:A.settings)==null?void 0:P.session)||{},["ttl","cacheTtl","email","phone"]));c(pe(_)),U.success(l("common.configSuccess"))}catch(A){U.error(A.message)}});return e.jsx(wt,{onSubmit:w(T),children:e.jsxs(H,{direction:"column",gap:6,children:[e.jsxs(m,{children:[e.jsxs(m,{children:[e.jsx(fe,{variant:"h6",fontWeight:600,children:l("blocklet.config.session.profile")}),e.jsx(m,{component:re,my:3})]}),e.jsxs(H,{gap:2,children:[e.jsx(I,{title:l("blocklet.config.session.fullNameEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(M,{disabled:!0,checked:!0})})}),e.jsx(I,{title:l("blocklet.config.session.avatarEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(M,{disabled:!0,checked:!0})})}),e.jsx(I,{title:l("blocklet.config.session.emailEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(C,{name:"email.enabled",control:t,render:({field:u})=>e.jsx(M,{...u,checked:u.value})})})}),d&&e.jsxs(H,{direction:"column",ml:2,children:[e.jsx(I,{title:l("blocklet.config.session.emailRequireVerified"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(C,{name:"email.requireVerified",control:t,render:({field:u})=>e.jsx(W,{sx:{mt:1},control:e.jsx(M,{...u,checked:u.value})})})})}),e.jsx(I,{title:l("blocklet.config.session.emailRequireUnique"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(C,{name:"email.requireUnique",control:t,render:({field:u})=>e.jsx(W,{sx:{mt:1},control:e.jsx(M,{...u,checked:u.value})})})})}),e.jsx(I,{title:l("blocklet.config.session.emailTrustOauthProviders"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(C,{name:"email.trustOauthProviders",control:t,render:({field:u})=>e.jsx(W,{sx:{mt:1},control:e.jsx(M,{...u,checked:u.value})})})})}),e.jsx(I,{title:l("blocklet.config.session.enableDomainBlackList"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(C,{name:"email.enableDomainBlackList",control:t,render:({field:u})=>e.jsx(W,{sx:{mt:1},control:e.jsx(M,{...u,checked:u.value})})})})}),L&&e.jsxs(m,{children:[g.map((u,P)=>e.jsxs(H,{direction:"row",alignItems:"center",my:1,maxWidth:"720px",children:[e.jsx(C,{name:`email.domainBlackList.${P}`,control:t,render:A=>e.jsx(B,{...A.field,size:"small",fullWidth:!0})}),e.jsx(ae,{onClick:()=>b(P),children:e.jsx(Ce,{})})]},u.id)),e.jsx($,{startIcon:e.jsx(Pe,{}),onClick:()=>v(""),children:l("blocklet.config.session.addDomain")})]}),e.jsx(I,{title:l("blocklet.config.session.enableDomainWhiteList"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(C,{name:"email.enableDomainWhiteList",control:t,render:({field:u})=>e.jsx(W,{sx:{mt:1},control:e.jsx(M,{...u,checked:u.value})})})})}),x&&e.jsxs(m,{children:[y.map((u,P)=>e.jsxs(H,{direction:"row",alignItems:"center",my:1,maxWidth:"720px",children:[e.jsx(C,{name:`email.domainWhiteList.${P}`,control:t,render:A=>e.jsx(B,{...A.field,size:"small",fullWidth:!0})}),e.jsx(ae,{onClick:()=>a(P),children:e.jsx(Ce,{})})]},u.id)),e.jsx($,{startIcon:e.jsx(Pe,{}),onClick:()=>i(""),children:l("blocklet.config.session.addDomain")})]})]}),e.jsxs(m,{sx:{display:"none"},children:[e.jsx(I,{title:l("blocklet.config.session.phoneEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(C,{name:"phone.enabled",control:t,disabled:!0,render:({field:u})=>e.jsx(W,{sx:{mt:1},control:e.jsx(M,{...u,checked:u.value})})})})}),k&&e.jsxs(H,{direction:"column",ml:2,mt:1,children:[e.jsx(I,{title:l("blocklet.config.session.phoneRequireVerified"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(C,{name:"phone.requireVerified",control:t,render:({field:u})=>e.jsx(W,{control:e.jsx(M,{...u,checked:u.value})})})})}),e.jsx(I,{title:l("blocklet.config.session.phoneRequireUnique"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(C,{name:"phone.requireUnique",control:t,render:({field:u})=>e.jsx(W,{control:e.jsx(M,{...u,checked:u.value})})})})})]})]})]})]}),e.jsxs(m,{children:[e.jsx(fe,{variant:"h6",fontWeight:600,children:l("blocklet.config.session.period")}),e.jsx(m,{component:re,my:3}),e.jsx(H,{direction:"column",spacing:2,children:e.jsx(C,{name:"ttl",control:t,rules:{min:1,max:30},render:({field:u})=>e.jsx(E,{fullWidth:!0,sx:{mb:2},children:e.jsx(I,{title:l("blocklet.config.session.ttl",{day:u.value}),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{maxWidth:500,ml:1},children:e.jsx(et,{...u,defaultValue:7,step:1,marks:[{value:1,label:l("blocklet.config.session.day",{day:1})},{value:7,label:l("blocklet.config.session.days",{day:7})},{value:14,label:l("blocklet.config.session.days",{day:14})},{value:21,label:l("blocklet.config.session.days",{day:21})},{value:30,label:l("blocklet.config.session.days",{day:30})}],min:1,max:30,valueLabelDisplay:"auto"})})})})})})]}),e.jsx(m,{children:e.jsx($,{type:"submit",variant:"contained",disabled:!f.isDirty,children:l("oauth.save")})})]})})}const wt=Re.form`
2
2
  max-width: 1536px;
3
3
 
4
4
  .advanced-config {