@abtnode/blocklet-services 1.17.6 → 1.17.7-beta-20251223-090654-55d57623

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 (121) hide show
  1. package/api/services/notification/queue.js +4 -0
  2. package/dist/assets/{access-control-BhOT85R4.js → access-control-CcqhN9eH.js} +1 -1
  3. package/dist/assets/{add-component-core-heDvzsX8.js → add-component-core-C7Ksojy0.js} +1 -1
  4. package/dist/assets/{add-resource-BkuSIexh.js → add-resource-CyoiDXcs.js} +1 -1
  5. package/dist/assets/{addon-B_DwHOas.js → addon-DbU0Ni5H.js} +1 -1
  6. package/dist/assets/{advanced-swM31Eiv.js → advanced-DyGgZSKn.js} +1 -1
  7. package/dist/assets/{aigne-CQrMsm7D.js → aigne-Biwp5TgZ.js} +1 -1
  8. package/dist/assets/{appearance-1Y_gCbL9.js → appearance-CP2saN8e.js} +1 -1
  9. package/dist/assets/{audit-logs-CHjIu_sG.js → audit-logs-ClC8rsLg.js} +1 -1
  10. package/dist/assets/{authorize-BjNz4CIx.js → authorize-C8addT1l.js} +1 -1
  11. package/dist/assets/{bind-account-Cp_jRmuc.js → bind-account-C3ikaqbA.js} +1 -1
  12. package/dist/assets/{branding-Cy4S7ifJ.js → branding-BWDcuHK0.js} +1 -1
  13. package/dist/assets/{branding-DclrAcmZ.js → branding-BYJ9wBmN.js} +1 -1
  14. package/dist/assets/{branding-BkFb6cTS.js → branding-eZco46gS.js} +1 -1
  15. package/dist/assets/{bundle-avatar-BZ_OHQ8d.js → bundle-avatar-CBW9tbvC.js} +1 -1
  16. package/dist/assets/{complete-BBxVJgzT.js → complete-owQjgqP2.js} +1 -1
  17. package/dist/assets/{component-DTec6zax.js → component-CZUGuhBp.js} +2 -2
  18. package/dist/assets/{config-uF2iao7N.js → config-BwLMiIKp.js} +1 -1
  19. package/dist/assets/{config-Bu8dI7mW.js → config-C9Q_3I9H.js} +1 -1
  20. package/dist/assets/{config-B6DS9_16.js → config-DPHytSzB.js} +1 -1
  21. package/dist/assets/{config-navigation-hnPNfA90.js → config-navigation-DRx0q2MD.js} +2 -2
  22. package/dist/assets/{config-space-OgBdtdQ7.js → config-space-B7BwTKLT.js} +1 -1
  23. package/dist/assets/{confirm-btfSjmnK.js → confirm-D3ZOq19V.js} +1 -1
  24. package/dist/assets/{connect-0rgz4tLV.js → connect-DC4M6Sfk.js} +1 -1
  25. package/dist/assets/{connect-C_8n2GAP.js → connect-b5hYafr7.js} +1 -1
  26. package/dist/assets/{connect-to-_CNpUNET.js → connect-to-BqMkANDm.js} +1 -1
  27. package/dist/assets/{dashboard-C0oSA3oj.js → dashboard-DPCpuxBj.js} +2 -2
  28. package/dist/assets/{delete-confirm-dqp-ol9_.js → delete-confirm-CvVgX89H.js} +1 -1
  29. package/dist/assets/{domain-C8SVzMQz.js → domain-DBV8eBwE.js} +1 -1
  30. package/dist/assets/{domain-action-card-B9GypCwf.js → domain-action-card-BTzoEvCg.js} +1 -1
  31. package/dist/assets/{domains-CiKmqXgC.js → domains-3VVRUwD7.js} +1 -1
  32. package/dist/assets/{email-Dg6hVyjU.js → email-CJqJ73o8.js} +1 -1
  33. package/dist/assets/engine-Ctj5gh6M.js +1 -0
  34. package/dist/assets/{exchange-passport-DBGg6mtf.js → exchange-passport-CWSz84jX.js} +1 -1
  35. package/dist/assets/{form-ayzBN20_.js → form-BDqnlPbC.js} +1 -1
  36. package/dist/assets/{fuel-Vs28WoOz.js → fuel-DS6CQdbE.js} +1 -1
  37. package/dist/assets/{gen-access-key-BzRnSZMg.js → gen-access-key-DSBH6387.js} +1 -1
  38. package/dist/assets/{gen-simple-access-key-ClX05cKV.js → gen-simple-access-key-OIDIjNLc.js} +1 -1
  39. package/dist/assets/{get-safe-url-BW-k89rQ.js → get-safe-url-BIGE7_Qp.js} +1 -1
  40. package/dist/assets/{home-Ds1wkYQ9.js → home-C6D8L8l9.js} +1 -1
  41. package/dist/assets/{iframe-CXruOREe.js → iframe-8V4ttVHV.js} +1 -1
  42. package/dist/assets/{index-DVQWYAIC.js → index-BAErdc3T.js} +1 -1
  43. package/dist/assets/{index-LIDGq9IJ.js → index-BB3pIdTj.js} +1 -1
  44. package/dist/assets/{index-B4oHJYN3.js → index-BDPrAFK5.js} +1 -1
  45. package/dist/assets/{index-C8ve20rA.js → index-BMBR4jWm.js} +1 -1
  46. package/dist/assets/{index-CF3y44xd.js → index-BQFqfTN1.js} +1 -1
  47. package/dist/assets/{index-Bgm1pC2t.js → index-Bik7zY2I.js} +1 -1
  48. package/dist/assets/{index-Cn9-WXPN.js → index-BmEXU6vj.js} +1 -1
  49. package/dist/assets/{index-DQ6KmrJ_.js → index-BoNPkce-.js} +1 -1
  50. package/dist/assets/{index-DgEP8auA.js → index-Bu1nTc5x.js} +1 -1
  51. package/dist/assets/{index-BAO6XTWC.js → index-CA8KVVfT.js} +1 -1
  52. package/dist/assets/{index-DwK0GIrs.js → index-CDZlfV0h.js} +65 -65
  53. package/dist/assets/{index-BmSuXiNh.js → index-COc3cI68.js} +1 -1
  54. package/dist/assets/{index-C6f1LKt3.js → index-C_0pT37U.js} +1 -1
  55. package/dist/assets/{index-jh20BesS.js → index-CbA_EJi-.js} +1 -1
  56. package/dist/assets/{index-u9yYWXco.js → index-CtBJPFT5.js} +2 -2
  57. package/dist/assets/{index-DajrAixi.js → index-D1ZBWiBh.js} +1 -1
  58. package/dist/assets/{index-BqmdsAZZ.js → index-DK6Ws14k.js} +1 -1
  59. package/dist/assets/{index-D-q1dCoY.js → index-DbhZjmcw.js} +1 -1
  60. package/dist/assets/{index-B88jTj-J.js → index-DfH5MtA4.js} +1 -1
  61. package/dist/assets/{index-DooQPBUl.js → index-YVLFMapw.js} +1 -1
  62. package/dist/assets/{index-DG2f1wAe.js → index-f9kknM1U.js} +1 -1
  63. package/dist/assets/{index-BvsQyxi_.js → index-fvFGLK4q.js} +3 -3
  64. package/dist/assets/{index-Bcpfja_q.js → index-qF59ePP4.js} +1 -1
  65. package/dist/assets/{index-DQ5hcDOb.js → index-qXLxdehr.js} +1 -1
  66. package/dist/assets/{index-B5Fc7Exm.js → index-qbQiaInB.js} +1 -1
  67. package/dist/assets/{index-B1BMtpDu.js → index-sxg2jpz1.js} +1 -1
  68. package/dist/assets/{invitation-BcEFpMQA.js → invitation-BL-oq-bZ.js} +1 -1
  69. package/dist/assets/{invitations-DmsPff5b.js → invitations-D_WuwVBY.js} +1 -1
  70. package/dist/assets/{invite-GF63A7GD.js → invite-CZXWbdah.js} +1 -1
  71. package/dist/assets/{isURL-CkV6bNHJ.js → isURL-CRNOx2AN.js} +1 -1
  72. package/dist/assets/{issue-passport-BXOKXvyV.js → issue-passport-C8DmKg9H.js} +1 -1
  73. package/dist/assets/{item-BSFssoYN.js → item-NbVFwplA.js} +1 -1
  74. package/dist/assets/{landing-page-BE08UeOH.js → landing-page-CBmSfoFm.js} +1 -1
  75. package/dist/assets/{layout-BPsPNtH9.js → layout-BFN2VPgc.js} +1 -1
  76. package/dist/assets/{list-CLOYr71b.js → list-BHVkP4fU.js} +1 -1
  77. package/dist/assets/{list-Byc72bDA.js → list-D6uynRH5.js} +1 -1
  78. package/dist/assets/{localization-L4ZbLe_a.js → localization-DnFDOrOQ.js} +1 -1
  79. package/dist/assets/{log-D198F7U3.js → log-CzJDSGek.js} +1 -1
  80. package/dist/assets/{login-wDtMfbHT.js → login-CU3trWD-.js} +1 -1
  81. package/dist/assets/{login-oauth-callback-CC9N1S9d.js → login-oauth-callback-37mFmo_M.js} +1 -1
  82. package/dist/assets/{logo-uploader-BL-x4TAv.js → logo-uploader-CdD4-48m.js} +1 -1
  83. package/dist/assets/{lost-passport-CKHtQDwr.js → lost-passport-C9Hyh4Ed.js} +1 -1
  84. package/dist/assets/{open-window-CU415CjG.js → open-window-0VJZR9pK.js} +1 -1
  85. package/dist/assets/{over-due-invoice-payment-Bux67LFM.js → over-due-invoice-payment-1xzXw3lQ.js} +1 -1
  86. package/dist/assets/{overview-DLpRsiS6.js → overview-BJcUiexv.js} +1 -1
  87. package/dist/assets/{passport-jAMdp3_i.js → passport-CWGJXEtt.js} +1 -1
  88. package/dist/assets/{passport-item-regWhYCV.js → passport-item-Bu_f0D0b.js} +1 -1
  89. package/dist/assets/{permission-PnySJGEl.js → permission-ZblvP8BW.js} +1 -1
  90. package/dist/assets/{preferences-BdtsycEO.js → preferences-DEzl011I.js} +1 -1
  91. package/dist/assets/{profile-embed-BjhIRlnb.js → profile-embed-iCopDM3E.js} +1 -1
  92. package/dist/assets/{publish-resource-B_cHs_c_.js → publish-resource-uZOmj-Xz.js} +1 -1
  93. package/dist/assets/{runtime-B9zsyQJH.js → runtime-Cucy5KcL.js} +1 -1
  94. package/dist/assets/sdk-aly4y-HK.js +1 -0
  95. package/dist/assets/{security-DsvOVk8Y.js → security-B5St5gtl.js} +1 -1
  96. package/dist/assets/{session-nLCSznMa.js → session-BqnhIOZD.js} +1 -1
  97. package/dist/assets/{setup-D28cEOB_.js → setup-DAJjDkED.js} +1 -1
  98. package/dist/assets/{spaces-B6hICxl4.js → spaces-CWRlaHIZ.js} +1 -1
  99. package/dist/assets/{start-D6x0fYx9.js → start-BnztTpX3.js} +1 -1
  100. package/dist/assets/{starting-progress-D4qoLrH0.js → starting-progress-CGjjGpuY.js} +1 -1
  101. package/dist/assets/{status-BOjZ6Vaq.js → status-Bk4He7Xx.js} +1 -1
  102. package/dist/assets/{step-actions-Cfagh9Pk.js → step-actions-CNIiIH7j.js} +1 -1
  103. package/dist/assets/{studio-D_ap2IaO.js → studio-BasxWENX.js} +1 -1
  104. package/dist/assets/{team-BETRxUUw.js → team-CF6hrmVi.js} +1 -1
  105. package/dist/assets/{traffic-CYr-3G37.js → traffic-C3uP0LAp.js} +1 -1
  106. package/dist/assets/{transfer-Cg9oSSyL.js → transfer-IX3OJWyW.js} +1 -1
  107. package/dist/assets/{unsubscribe-Csiks0SI.js → unsubscribe-BvvM7eMA.js} +1 -1
  108. package/dist/assets/{use-app-logo-BgQdzlhG.js → use-app-logo-7cAapfl7.js} +1 -1
  109. package/dist/assets/{user-center-CGXOHu_w.js → user-center-ChblBbZV.js} +1 -1
  110. package/dist/assets/{user-follower-__aq0tH0.js → user-follower-CVGmlOad.js} +1 -1
  111. package/dist/assets/{util-Bps9wpLH.js → util-4RKb-Srn.js} +1 -1
  112. package/dist/assets/{util-D27AtnBb.js → util-DE6S-EwK.js} +1 -1
  113. package/dist/assets/{wait-connect-AqdGAvY7.js → wait-connect-COGsNIA_.js} +1 -1
  114. package/dist/assets/{wizard-asHyteJr.js → wizard-5PG9Y1qa.js} +1 -1
  115. package/dist/assets/{wizard-components-YsOxzGWe.js → wizard-components-BgKNgavh.js} +1 -1
  116. package/dist/assets/{wrap-locale-Dfmt13Mn.js → wrap-locale-DJbgvexA.js} +1 -1
  117. package/dist/assets/{zh-DEgV10nE.js → zh-CeRIETvo.js} +1 -1
  118. package/dist/index.html +1 -1
  119. package/package.json +23 -23
  120. package/dist/assets/engine-0ct2xW2c.js +0 -1
  121. package/dist/assets/sdk-CkLW4ZmH.js +0 -1
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.__toCdnUrl("assets/vendor-ux-DYcPPYq2.css"),window.__toCdnUrl("assets/index-DrVXX4fX.css"),window.__toCdnUrl("assets/index-gnjjKJuC.css"),window.__toCdnUrl("assets/add-component-core-G0iZE90Q.css")])))=>i.map(i=>d[i]);
2
- import{j as i,W as y,aZ as Je,ak as j,D as V,J as ce,ah as et,ao as ts,bc as ns,I as tt,aj as os,at as nt,bE as Dn,bF as Tn,bG as An,am as Se,a6 as Z,bb as Be,bH as Gt,U as ie,aN as Mn,T as B,s as Pt,ar as ss,n as Ye,b6 as Rn,Y as Pn,bI as rs,bJ as is,bK as as,Q as St,bL as ls,bM as cs,bN as us,bO as ds,bP as fs,bQ as ps,bR as ms,bS as hs,bT as gs,bU as bs,aQ as xs,aR as vs,a3 as ys,M as ws,aO as Ss,aP as ks,bV as Cs,bW as js,bX as Qt,bY as Xt,be as _s}from"./vendor-mui-core-DnR6WYuU.js";import{r as m,u as On,g as Es,L as Ot,i as Is,a as Ls,m as Ds}from"./vendor-react-CTtPmzVP.js";import{Y as G,Z as F,c as T,l as Ts,q as $,_ as As,$ as Nn,Q as de,a0 as $n,a1 as Ms,a2 as Rs,a3 as Ps,a4 as Os,a5 as Ns,a6 as $s,a7 as Bs,a8 as Hs,a9 as Us,aa as zs,ab as ct,ac as Vs,ad as Fs,ae as Ws,u as Bn,G as Nt,y as ot,af as Ys,k as qs,ag as Ks,A as Jt,ah as en,v as Zs,x as Gs,E as Qs,C as ge,B as Xs,D as Js,P as er,J as He,ai as ut,h as tn,aj as tr,e as nr,ak as or,al as Hn,am as sr,V as nn,an as rr,ao as ir}from"./index-DwK0GIrs.js";import{o as qe}from"./vendor-arcblock-CPCSE54a.js";import{V as R,w as $t,H as J,aH as Un,aG as ar,aU as lr,aT as zn,z as pe,ag as cr,aV as ur,s as dr,u as fr,aW as pr,M as Vn,a0 as on,aX as mr,_ as I}from"./vendor-ux-DfSgTRg5.js";import{a as K,b as Fn,d as Bt,x as hr,q as gr}from"./vendor-hooks-cYMUGE4V.js";import{a6 as br,r as Wn,a7 as xr,i as vr,J as Yn,C as te,$ as yr,e as wr}from"./vendor-utils-drLlzTVq.js";import{u as st}from"./session-nLCSznMa.js";import{f as Ht}from"./index-DBs9Ljax.js";import{i as Sr,u as kr,M as Cr,a as jr,b as Ce,T as _r,N as Er}from"./team-BETRxUUw.js";import{D as Ir,u as ne}from"./useAsyncRetry--1T7wYe2.js";import{u as qn}from"./useSetState-L-f8mSga.js";import{x as Lr,d as Dr}from"./index-LIDGq9IJ.js";import"./zh-DEgV10nE.js";import{O as Tr}from"./over-due-invoice-payment-Bux67LFM.js";import{u as sn}from"./useLocalStorage-BV1BIwfo.js";import{C as rn}from"./confirm-btfSjmnK.js";import{g as dt}from"./get-safe-url-BW-k89rQ.js";import{c as an}from"./passport-jAMdp3_i.js";import{g as Ar}from"./spaces-B6hICxl4.js";const Kn=m.createContext({});function Zn({children:e,type:t="blocklets"}){const[n,s]=m.useState([]),o=m.useRef([]),r=c=>{if(!o.current.includes(c)){const u=[...o.current,c];s(u),o.current=u}},a=c=>{if(o.current.includes(c)){const u=o.current.filter(d=>d!==c);s(u),o.current=u}},l=c=>{const u=n.filter(f=>c.find(p=>p===f));br(u,n).forEach(f=>a(f))};return i.jsx(Kn.Provider,{value:{type:t,deletingBlocklets:n,addDeletingDid:r,removeDeletingDid:a,matchDeletingDid:l},children:e})}Zn.propTypes={type:y.string,children:y.node.isRequired};function pc(){return m.useContext(Kn)}const Mr=e=>{const t={};let n=null;return $.forEachBlockletSync(e,s=>{t[s.meta.bundleDid]?n=$.getDisplayName(s,!0):s.meta.bundleDid&&(t[s.meta.bundleDid]=!0)}),n},Rr=(e,t,n)=>{const{hostname:s,href:o}=e;if(!t)return o;if(n){const a=/\d+[-.]\d+[-.]\d+[-.]\d+/.exec(s);if(!a)return o;const l=a[0],u=((t.site?.domainAliases||[]).map(d=>d.value).filter(Boolean).find(d=>d.endsWith(T.DEFAULT_DID_DOMAIN))||"").replace(`.${T.DEFAULT_DID_DOMAIN}`,"");return u?o.replace(s,`${u}-${l}.${T.DEFAULT_IP_DOMAIN_SUFFIX}`):o}return o.replace(t.meta.bundleDid,t.appPid)};function Pr(){const{t:e}=R(),{api:t}=st(),{blocklet:n}=G(),{inService:s}=F(),[o,r]=m.useState(!1),[a,l]=m.useState(5),c=n&&n.structVersion!==T.APP_STRUCT_VERSION,u=()=>{try{if($.isBlockletRunning(n)){J.error(e("blocklet.migrate.tip.running"));return}const p=Mr(n);if(p){J.error(e("blocklet.migrate.tip.duplicate",{name:p}));return}r(!0)}catch(p){J.error(Ht(p))}},d=()=>{const p=Rr(window.location,n,s);setTimeout(()=>{window.location.href=p},5e3),l(5),setInterval(()=>{l(b=>b-1)},1e3)},f=()=>r(!1);return[c&&i.jsxs(Je,{severity:"warning",style:{margin:"12px 0"},children:[i.jsxs(j,{sx:{display:"flex",alignItems:"center"},children:[i.jsx($t,{variant:"contained",size:"small",color:"primary",onClick:()=>u(),style:{marginRight:8},children:e("blocklet.migrate.intro.l1")}),i.jsx("span",{children:e("blocklet.migrate.intro.l2")})]}),["l3","l4","l5","l6"].map(p=>i.jsx(j,{sx:{display:"flex",alignItems:"center"},children:e(`blocklet.migrate.intro.${p}`)},p))]},"alert"),n&&i.jsx(Ts,{popup:!0,open:o,saveConnect:!1,forceConnected:!1,action:"migrate-app-to-struct-v2",checkFn:t.get,checkTimeout:5*60*1e3,onSuccess:d,extraParams:{appDid:n.appDid,did:n.meta.did,wt:As(n,!0),title:$.getDisplayName(n)},messages:{title:e("blocklet.migrate.title"),scan:e("blocklet.migrate.scan"),confirm:e("blocklet.migrate.confirm"),success:a>=0?e("blocklet.migrate.success",{sec:a}):"Redirecting..."},onClose:f},"connect")]}function Or(){const e=V();return[...e.breakpoints.keys].reverse().reduce((n,s)=>{const o=ce(e.breakpoints.up(s));return!n&&o?s:n},null)||"xs"}function Nr(e){return i.jsx(et,{...e,children:i.jsx("path",{d:"M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41 10.59L10 14.17L17.59 6.58L19 8L10 17Z"})})}function $r(e){return i.jsx(et,{...e,children:i.jsx("path",{d:"M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"})})}function Br(e){return i.jsx(et,{...e,children:i.jsx("path",{d:"M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2, 6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12, 13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z"})})}function Hr(e){return i.jsx(et,{...e,children:i.jsx("path",{d:"M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12A10,10 0 0,0 12,2Z"})})}const Re={fontSize:20,marginInlineEnd:8},Ur={success:i.jsx(Nr,{style:Re}),warning:i.jsx($r,{style:Re}),error:i.jsx(Br,{style:Re}),info:i.jsx(Hr,{style:Re})},zr={xl:"400px",lg:"400px",md:"400px",sm:"300px"};function Gn({keyId:e,notification:t={},viewAllUrl:n,content:s=null},o){const r=V(),a=Ur[t.severity],{closeSnackbar:l}=Un(),c=()=>l(e),u=On(),d=()=>{l(e),u(n)},f=K(()=>Sr(t),[t]),p=K(()=>t?.activity,[t]),b=kr({activity:p,users:[t?.actorInfo],actors:[t?.activity?.actor],extra:{linkColor:r.palette.primary.main,userDid:t?.receivers?.[0]?.did}}),h=Or();return i.jsxs(j,{component:ar,ref:o,sx:[{...r.typography.body2,display:"flex",backgroundColor:r.palette.background.default,color:"#fff",alignItems:"center",pl:2.5,pr:2,py:.75,borderRadius:"4px",boxShadow:"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)",width:zr[h]},t.severity==="success"?{backgroundColor:`${ts[600]} !important`}:{},t.severity==="error"?{backgroundColor:`${r.palette.error.dark} !important`}:{},t.severity==="info"?{backgroundColor:`${r.palette.primary.main} !important`}:{},t.severity==="warning"?{backgroundColor:`${ns[700]} !important`}:{}],children:[i.jsxs(j,{sx:{display:"flex",alignItems:"center",py:1,flex:1},children:[a,i.jsx(Fr,{onClick:d,sx:{flex:1},children:i.jsx(j,{children:f?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"title",children:b}),p.meta?i.jsx(Cr,{meta:p.meta,type:p.type,sx:{display:"-webkit-box",overflow:"hidden",textOverflow:"ellipsis",WebkitLineClamp:3,WebkitBoxOrient:"vertical",color:"#fff"}}):null]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"title",children:t.title}),s||i.jsx("span",{className:"desc",children:t.description})]})})})]}),i.jsx(j,{sx:{display:"flex",alignItems:"center",ml:"auto",mr:-1,width:44},children:i.jsx(tt,{"aria-label":"close",color:"inherit",onClick:c,size:"large",children:i.jsx(j,{component:os,sx:{fontSize:20}})},"close")})]})}const Vr=m.forwardRef(Gn);Gn.propTypes={viewAllUrl:y.string.isRequired,keyId:y.number.isRequired,notification:y.object.isRequired,content:y.node};const Fr=nt.div`
2
+ import{j as i,W as y,aZ as Je,ak as j,D as V,J as ce,ah as et,ao as ts,bc as ns,I as tt,aj as os,at as nt,bE as Dn,bF as Tn,bG as An,am as Se,a6 as Z,bb as Be,bH as Gt,U as ie,aN as Mn,T as B,s as Pt,ar as ss,n as Ye,b6 as Rn,Y as Pn,bI as rs,bJ as is,bK as as,Q as St,bL as ls,bM as cs,bN as us,bO as ds,bP as fs,bQ as ps,bR as ms,bS as hs,bT as gs,bU as bs,aQ as xs,aR as vs,a3 as ys,M as ws,aO as Ss,aP as ks,bV as Cs,bW as js,bX as Qt,bY as Xt,be as _s}from"./vendor-mui-core-DnR6WYuU.js";import{r as m,u as On,g as Es,L as Ot,i as Is,a as Ls,m as Ds}from"./vendor-react-CTtPmzVP.js";import{Y as G,Z as F,c as T,l as Ts,q as $,_ as As,$ as Nn,Q as de,a0 as $n,a1 as Ms,a2 as Rs,a3 as Ps,a4 as Os,a5 as Ns,a6 as $s,a7 as Bs,a8 as Hs,a9 as Us,aa as zs,ab as ct,ac as Vs,ad as Fs,ae as Ws,u as Bn,G as Nt,y as ot,af as Ys,k as qs,ag as Ks,A as Jt,ah as en,v as Zs,x as Gs,E as Qs,C as ge,B as Xs,D as Js,P as er,J as He,ai as ut,h as tn,aj as tr,e as nr,ak as or,al as Hn,am as sr,V as nn,an as rr,ao as ir}from"./index-CDZlfV0h.js";import{o as qe}from"./vendor-arcblock-CPCSE54a.js";import{V as R,w as $t,H as J,aH as Un,aG as ar,aU as lr,aT as zn,z as pe,ag as cr,aV as ur,s as dr,u as fr,aW as pr,M as Vn,a0 as on,aX as mr,_ as I}from"./vendor-ux-DfSgTRg5.js";import{a as K,b as Fn,d as Bt,x as hr,q as gr}from"./vendor-hooks-cYMUGE4V.js";import{a6 as br,r as Wn,a7 as xr,i as vr,J as Yn,C as te,$ as yr,e as wr}from"./vendor-utils-drLlzTVq.js";import{u as st}from"./session-BqnhIOZD.js";import{f as Ht}from"./index-DBs9Ljax.js";import{i as Sr,u as kr,M as Cr,a as jr,b as Ce,T as _r,N as Er}from"./team-CF6hrmVi.js";import{D as Ir,u as ne}from"./useAsyncRetry--1T7wYe2.js";import{u as qn}from"./useSetState-L-f8mSga.js";import{x as Lr,d as Dr}from"./index-BB3pIdTj.js";import"./zh-CeRIETvo.js";import{O as Tr}from"./over-due-invoice-payment-1xzXw3lQ.js";import{u as sn}from"./useLocalStorage-BV1BIwfo.js";import{C as rn}from"./confirm-D3ZOq19V.js";import{g as dt}from"./get-safe-url-BIGE7_Qp.js";import{c as an}from"./passport-CWGJXEtt.js";import{g as Ar}from"./spaces-CWRlaHIZ.js";const Kn=m.createContext({});function Zn({children:e,type:t="blocklets"}){const[n,s]=m.useState([]),o=m.useRef([]),r=c=>{if(!o.current.includes(c)){const u=[...o.current,c];s(u),o.current=u}},a=c=>{if(o.current.includes(c)){const u=o.current.filter(d=>d!==c);s(u),o.current=u}},l=c=>{const u=n.filter(f=>c.find(p=>p===f));br(u,n).forEach(f=>a(f))};return i.jsx(Kn.Provider,{value:{type:t,deletingBlocklets:n,addDeletingDid:r,removeDeletingDid:a,matchDeletingDid:l},children:e})}Zn.propTypes={type:y.string,children:y.node.isRequired};function pc(){return m.useContext(Kn)}const Mr=e=>{const t={};let n=null;return $.forEachBlockletSync(e,s=>{t[s.meta.bundleDid]?n=$.getDisplayName(s,!0):s.meta.bundleDid&&(t[s.meta.bundleDid]=!0)}),n},Rr=(e,t,n)=>{const{hostname:s,href:o}=e;if(!t)return o;if(n){const a=/\d+[-.]\d+[-.]\d+[-.]\d+/.exec(s);if(!a)return o;const l=a[0],u=((t.site?.domainAliases||[]).map(d=>d.value).filter(Boolean).find(d=>d.endsWith(T.DEFAULT_DID_DOMAIN))||"").replace(`.${T.DEFAULT_DID_DOMAIN}`,"");return u?o.replace(s,`${u}-${l}.${T.DEFAULT_IP_DOMAIN_SUFFIX}`):o}return o.replace(t.meta.bundleDid,t.appPid)};function Pr(){const{t:e}=R(),{api:t}=st(),{blocklet:n}=G(),{inService:s}=F(),[o,r]=m.useState(!1),[a,l]=m.useState(5),c=n&&n.structVersion!==T.APP_STRUCT_VERSION,u=()=>{try{if($.isBlockletRunning(n)){J.error(e("blocklet.migrate.tip.running"));return}const p=Mr(n);if(p){J.error(e("blocklet.migrate.tip.duplicate",{name:p}));return}r(!0)}catch(p){J.error(Ht(p))}},d=()=>{const p=Rr(window.location,n,s);setTimeout(()=>{window.location.href=p},5e3),l(5),setInterval(()=>{l(b=>b-1)},1e3)},f=()=>r(!1);return[c&&i.jsxs(Je,{severity:"warning",style:{margin:"12px 0"},children:[i.jsxs(j,{sx:{display:"flex",alignItems:"center"},children:[i.jsx($t,{variant:"contained",size:"small",color:"primary",onClick:()=>u(),style:{marginRight:8},children:e("blocklet.migrate.intro.l1")}),i.jsx("span",{children:e("blocklet.migrate.intro.l2")})]}),["l3","l4","l5","l6"].map(p=>i.jsx(j,{sx:{display:"flex",alignItems:"center"},children:e(`blocklet.migrate.intro.${p}`)},p))]},"alert"),n&&i.jsx(Ts,{popup:!0,open:o,saveConnect:!1,forceConnected:!1,action:"migrate-app-to-struct-v2",checkFn:t.get,checkTimeout:5*60*1e3,onSuccess:d,extraParams:{appDid:n.appDid,did:n.meta.did,wt:As(n,!0),title:$.getDisplayName(n)},messages:{title:e("blocklet.migrate.title"),scan:e("blocklet.migrate.scan"),confirm:e("blocklet.migrate.confirm"),success:a>=0?e("blocklet.migrate.success",{sec:a}):"Redirecting..."},onClose:f},"connect")]}function Or(){const e=V();return[...e.breakpoints.keys].reverse().reduce((n,s)=>{const o=ce(e.breakpoints.up(s));return!n&&o?s:n},null)||"xs"}function Nr(e){return i.jsx(et,{...e,children:i.jsx("path",{d:"M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41 10.59L10 14.17L17.59 6.58L19 8L10 17Z"})})}function $r(e){return i.jsx(et,{...e,children:i.jsx("path",{d:"M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"})})}function Br(e){return i.jsx(et,{...e,children:i.jsx("path",{d:"M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2, 6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12, 13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z"})})}function Hr(e){return i.jsx(et,{...e,children:i.jsx("path",{d:"M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12A10,10 0 0,0 12,2Z"})})}const Re={fontSize:20,marginInlineEnd:8},Ur={success:i.jsx(Nr,{style:Re}),warning:i.jsx($r,{style:Re}),error:i.jsx(Br,{style:Re}),info:i.jsx(Hr,{style:Re})},zr={xl:"400px",lg:"400px",md:"400px",sm:"300px"};function Gn({keyId:e,notification:t={},viewAllUrl:n,content:s=null},o){const r=V(),a=Ur[t.severity],{closeSnackbar:l}=Un(),c=()=>l(e),u=On(),d=()=>{l(e),u(n)},f=K(()=>Sr(t),[t]),p=K(()=>t?.activity,[t]),b=kr({activity:p,users:[t?.actorInfo],actors:[t?.activity?.actor],extra:{linkColor:r.palette.primary.main,userDid:t?.receivers?.[0]?.did}}),h=Or();return i.jsxs(j,{component:ar,ref:o,sx:[{...r.typography.body2,display:"flex",backgroundColor:r.palette.background.default,color:"#fff",alignItems:"center",pl:2.5,pr:2,py:.75,borderRadius:"4px",boxShadow:"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)",width:zr[h]},t.severity==="success"?{backgroundColor:`${ts[600]} !important`}:{},t.severity==="error"?{backgroundColor:`${r.palette.error.dark} !important`}:{},t.severity==="info"?{backgroundColor:`${r.palette.primary.main} !important`}:{},t.severity==="warning"?{backgroundColor:`${ns[700]} !important`}:{}],children:[i.jsxs(j,{sx:{display:"flex",alignItems:"center",py:1,flex:1},children:[a,i.jsx(Fr,{onClick:d,sx:{flex:1},children:i.jsx(j,{children:f?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"title",children:b}),p.meta?i.jsx(Cr,{meta:p.meta,type:p.type,sx:{display:"-webkit-box",overflow:"hidden",textOverflow:"ellipsis",WebkitLineClamp:3,WebkitBoxOrient:"vertical",color:"#fff"}}):null]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"title",children:t.title}),s||i.jsx("span",{className:"desc",children:t.description})]})})})]}),i.jsx(j,{sx:{display:"flex",alignItems:"center",ml:"auto",mr:-1,width:44},children:i.jsx(tt,{"aria-label":"close",color:"inherit",onClick:c,size:"large",children:i.jsx(j,{component:os,sx:{fontSize:20}})},"close")})]})}const Vr=m.forwardRef(Gn);Gn.propTypes={viewAllUrl:y.string.isRequired,keyId:y.number.isRequired,notification:y.object.isRequired,content:y.node};const Fr=nt.div`
3
3
  cursor: pointer;
4
4
  display: flex;
5
5
  flex-direction: column;
@@ -58,7 +58,7 @@ ${s}
58
58
  font-size: 10px;
59
59
  }
60
60
  }
61
- `,sl=m.memo(Vo);function Y({component:e=void 0}){const{blocklet:t}=G();return e?i.jsx(j,{className:"page-content",children:i.jsx(m.Suspense,{fallback:i.jsx(qe,{relative:"parent",children:i.jsx(Z,{})}),children:m.isValidElement(e)?e:Ls.createElement(e,{blocklet:t})})}):null}Y.propTypes={component:y.any};const rl=m.lazy(()=>I(()=>import("./overview-DLpRsiS6.js"),__vite__mapDeps([0,1]),import.meta.url)),il=m.lazy(()=>I(()=>import("./component-DTec6zax.js"),__vite__mapDeps([0,1,2,3]),import.meta.url)),al=m.lazy(()=>I(()=>import("./advanced-swM31Eiv.js"),__vite__mapDeps([0,1]),import.meta.url));function ll(){const e=V(),{info:t,inService:n}=F(),{t:s}=R(),{navItem:o,updateAppInfo:r,TabComponent:a}=W(),{blocklet:l,actions:{refreshBlocklet:c}}=G(),u=!l||or(l.status)?[]:$.getAppMissingConfigs(l),f=!!(n?window.env?.gateway?.wafPolicy?.enabled:t?.routing.wafPolicy?.enabled)&&(l?.settings?.gateway?.wafPolicy?.enabled??!0);m.useEffect(()=>{r({name:o?.title||"",description:o?.description||s("navigation.overviewDesc")})},[o,s,r]),m.useEffect(()=>{r({actions:l?i.jsx(sl,{className:"page-actions",hasPermission:!0,blocklet:l,onStart:()=>{},onComplete:({error:h}={})=>{h&&J.error(h.message)},variant:"group"}):null})},[l,r]),m.useEffect(()=>{const b=[];l&&b.push(i.jsx(Do,{"data-cy":"blocklet-status","status-blocklet-did":l.meta?.did,status:l.status,source:l.source,progress:l.progress,style:{lineHeight:e.spacing(3),height:e.spacing(3)}},"blocklet-status")),b.push({label:"WAF",value:f?"ON":"OFF",to:`${o?.link}/settings`}),r({badges:b})},[l,r,f,o?.link,e]);const p=m.useMemo(()=>[{label:s("common.overview"),value:"overview",render:rl},{label:i.jsx(_s,{"data-cy":"blocklet-list",color:"error",variant:"dot",invisible:!u.length,children:s("common.components")}),labelText:s("common.components"),value:"components",render:il},{label:s("common.globalSettings"),value:"settings",render:i.jsx(al,{blocklet:l,onUpdate:c})}],[s,u.length,l,c]);return m.useEffect(()=>{r({tabs:p})},[p,r]),i.jsx(Y,{component:a})}const cl=m.lazy(()=>I(()=>import("./traffic-CYr-3G37.js").then(e=>e.t),__vite__mapDeps([0,1]),import.meta.url)),ul=m.lazy(()=>I(()=>import("./audit-logs-CHjIu_sG.js"),__vite__mapDeps([0,1,2]),import.meta.url)),dl=m.lazy(()=>I(()=>import("./log-D198F7U3.js"),__vite__mapDeps([0,1]),import.meta.url)),fl=m.lazy(()=>I(()=>import("./runtime-B9zsyQJH.js"),__vite__mapDeps([0,1]),import.meta.url));function pl(){const{t:e}=R(),{navItem:t,updateAppInfo:n,TabComponent:s}=W(),{blocklet:o,client:r,did:a}=G(),{teamDid:l}=Ce(),{api:c}=F(),u=o?.meta?.did,d=ne(()=>c.getBlockletBaseInfo({input:{teamDid:l}}),[l,c]);m.useEffect(()=>{n({name:t?.title||"",description:t?.description||e("navigation.operationsDesc")})},[t,e,n]),m.useEffect(()=>{const p=[],{totalRequests:b=0,failedRequests:h=0}=d.value?.traffic??{},{cpuUsage:g=0,memoryUsage:v=0}=d.value?.appRuntimeInfo??{};p.push({variant:"number",label:e("analytics.traffic.totalRequests"),value:b,round:0,to:`${t.link}/analytics`,loading:d.loading}),p.push({variant:"number",label:e("analytics.traffic.failedRequests"),value:h,round:0,to:`${t.link}/analytics`,loading:d.loading}),p.push({label:e("blocklet.runtimeInfo.cpuUsage"),value:`${g.toFixed(1)}%`,to:`${t.link}/performance`,loading:d.loading}),p.push({label:e("blocklet.runtimeInfo.memoryUsage"),value:Hn(v),to:`${t.link}/performance`,loading:d.loading}),n({badges:p})},[n,d.value,d.loading,t?.link,e]);const f=m.useMemo(()=>[o?.children?.length&&o.structVersion===T.APP_STRUCT_VERSION&&{label:e("common.logs"),value:"logs",render:dl},{label:e("common.auditLogs"),value:"audit-logs",render:i.jsx(ul,{scope:u,categories:["blocklet","team","security","certificates","gateway"]})},{label:e("common.performance"),value:"performance",render:i.jsx(fl,{client:r,did:a})},{label:e("common.analytics"),value:"analytics",render:i.jsx(cl,{client:r,did:a})}].filter(Boolean),[e,o,r,a,u]);return m.useEffect(()=>{n({tabs:f})},[f,n]),i.jsx(Y,{component:s})}const ml=m.lazy(()=>I(()=>import("./index-DooQPBUl.js"),__vite__mapDeps([0,1]),import.meta.url)),hl=m.lazy(()=>I(()=>import("./index-jh20BesS.js"),__vite__mapDeps([0,1]),import.meta.url)),gl=m.lazy(()=>I(()=>import("./list-Byc72bDA.js"),__vite__mapDeps([0,1]),import.meta.url));function bl(){const{t:e}=R(),{navItem:t,updateAppInfo:n,TabComponent:s}=W(),{api:o}=F(),{teamDid:r}=Ce(),{session:a}=st(),l=m.useMemo(()=>a?.user?.role&&Nt.includes(a.user.role),[a]),c=ne(()=>o.getBlockletBaseInfo({input:{teamDid:r}}),[r,o]);m.useEffect(()=>{n({name:t?.title||"",description:t?.description||e("navigation.integrationsDesc")})},[t,e,n]),m.useEffect(()=>{const d=[],{webhooks:f=0,accessKeys:p=0,oauthApps:b=0}=c.value?.integrations??{};d.push({variant:"number",label:"Webhooks",value:f,to:`${t.link}/webhooks`,loading:c.loading}),d.push({variant:"number",label:"API Keys",value:p,to:`${t.link}/access-keys`,loading:c.loading}),d.push({variant:"number",label:"OAuth Apps",value:b,to:`${t.link}/oauth`,loading:c.loading}),n({badges:d})},[n,c.value,c.loading,t.link]);const u=m.useMemo(()=>[l&&{label:"Webhooks",value:"webhooks",render:i.jsx(ml,{})},{label:e("common.accessKeys"),value:"access-keys",render:i.jsx(hl,{})},{label:e("common.oauth"),value:"oauth",render:i.jsx(gl,{})}].filter(Boolean),[l,e]);return m.useEffect(()=>{n({tabs:u})},[u,n]),i.jsx(Y,{component:s})}var Fo=function(t){return i.jsx("svg",{...t,children:i.jsx("path",{d:"M79.425.7c5.688 0 10.3 4.612 10.3 10.3v43.234c0 5.689-4.612 10.3-10.3 10.3H11.156c-5.688 0-10.3-4.611-10.3-10.3v-.215h4.6v.215a5.7 5.7 0 0 0 5.7 5.7h68.269a5.7 5.7 0 0 0 5.7-5.7V11a5.7 5.7 0 0 0-5.7-5.7H11.156a5.7 5.7 0 0 0-5.7 5.7v.49h-4.6V11C.856 5.312 5.468.7 11.156.7h68.269ZM11.293 17.691c2.945 0 5.495.62 7.65 1.86 2.182 1.211 3.879 2.929 5.088 5.154 1.21 2.225 1.814 4.845 1.814 7.86 0 2.985-.604 5.577-1.814 7.774a12.78 12.78 0 0 1-5.088 5.112c-2.155 1.211-4.706 1.818-7.65 1.818H1V17.69h10.293ZM35.206 47.27h-5.324V17.69h5.324V47.27ZM50.883 17.69c2.944 0 5.494.62 7.65 1.86 2.182 1.21 3.878 2.929 5.087 5.154 1.21 2.225 1.815 4.846 1.815 7.86 0 2.985-.606 5.577-1.815 7.774a12.78 12.78 0 0 1-5.087 5.112c-2.156 1.211-4.706 1.818-7.65 1.818H40.59V17.69h10.293Zm22.595 19.066a2.98 2.98 0 1 1-.001 5.958 2.98 2.98 0 0 1 .001-5.958ZM6.325 42.494h4.812c2.97 0 5.257-.874 6.861-2.62 1.604-1.775 2.405-4.211 2.405-7.31 0-3.126-.801-5.591-2.405-7.394-1.604-1.803-3.89-2.704-6.861-2.704H6.324v20.028Zm39.59 0h4.81c2.971 0 5.26-.873 6.863-2.62 1.603-1.775 2.405-4.211 2.405-7.31 0-3.126-.801-5.591-2.405-7.394-1.604-1.803-3.892-2.704-6.862-2.704h-4.81v20.028Zm27.564-19.637a2.978 2.978 0 1 1 0 5.957 2.978 2.978 0 0 1 0-5.957Z",fill:"currentColor"})})};Fo.defaultProps={viewBox:"0 0 24 17",xmlns:"http://www.w3.org/2000/svg"};function Wo({width:e=24,color:t="black",backgroundColor:n="transparent"}){return i.jsx(j,{component:"span",sx:{width:e,display:"inline-block",verticalAlign:"middle",color:t,backgroundColor:n,fontSize:0},children:i.jsx(Fo,{viewBox:"0 0 90 65",xmlns:"http://www.w3.org/2000/svg",style:{position:"relative",top:-1,lineHeight:1}})})}Wo.propTypes={width:y.number,color:y.string,backgroundColor:y.string};const xl=m.lazy(()=>I(()=>import("./index-B88jTj-J.js"),__vite__mapDeps([0,1]),import.meta.url)),vl=m.lazy(()=>I(()=>import("./index-DajrAixi.js").then(e=>e.i),__vite__mapDeps([0,1]),import.meta.url)),yl=m.lazy(()=>I(()=>import("./index-BAO6XTWC.js"),__vite__mapDeps([0,1]),import.meta.url)),wl=m.lazy(()=>I(()=>import("./index-BmSuXiNh.js"),__vite__mapDeps([0,1]),import.meta.url)),Sl=m.lazy(()=>I(()=>import("./security-DsvOVk8Y.js"),__vite__mapDeps([0,1]),import.meta.url));function kl(){const{t:e,locale:t}=R(),{navItem:n,updateAppInfo:s,TabComponent:o}=W(),{blocklet:r}=G(),{api:a}=F(),{teamDid:l}=Ce(),c=m.useMemo(()=>wr(r,"settings.org.enabled",!1),[r]),u=ne(()=>a.getBlockletBaseInfo({input:{teamDid:l}}),[l,a]),d=ne(async()=>{if(!r?.meta?.did)return null;const{securityRules:h}=await a.getBlockletSecurityRules({input:{did:r.meta.did,includeDisabled:!0}});return h.find(g=>g.id===T.SECURITY_RULE_DEFAULT_ID)},[r?.meta?.did,a]),f=m.useMemo(()=>{const h=r?.settings?.oauth||{},g=[];return["github","google","apple","twitter","auth0"].forEach(v=>{h[v]?.enabled&&g.push({name:v,icon:`simple-icons:${v}`,title:He.PROVIDER_NAME[v]||v})}),g},[r?.settings?.oauth]),p=m.useMemo(()=>(r?.settings?.federated?.sites||[]).length>0,[r?.settings?.federated?.sites]);m.useEffect(()=>{const h=e("navigation.didConnectDesc"),g=e("common.poweredBy",{brand:"$placeholder"}),v=h?h.slice(-1):"",[C,x]=g.split("$placeholder");s({name:n?.title||"",description:i.jsxs("span",{children:[h," ",C,i.jsxs("a",{href:`https://www.didconnect.io/${t}`,target:"_blank",style:{color:"#5bbec5"},rel:"noreferrer",children:[i.jsx(Wo,{color:"#5bbec5"})," Connect"]}),x," ",v]})})},[n,e,t,s]),m.useEffect(()=>{const h=[],{users:g=0}=u.value?.user??{},{passports:v=0}=u.value?.passport??{};h.push({variant:"number",label:e("common.members"),value:g,to:`${n.link}/members`,round:0}),h.push({variant:"number",label:e("team.member.passports"),value:v,to:`${n.link}/passports`,round:0}),f.length>0&&h.push({label:e("oauth.oauth"),value:i.jsx(Rn,{direction:"row",spacing:.5,children:f.map(x=>i.jsx(pe,{icon:x.icon}))}),to:`${n.link}/settings`}),h.push({label:e("oauth.federated"),value:p?"ON":"OFF",to:`${n.link}/settings`});const C=d.value?.accessPolicy?.name;C&&h.push({label:e("accessPolicy.title"),value:C,to:`${n.link}/security`}),s({badges:h})},[s,u.value,u.loading,e,f,p,d.value,d.loading,n.link]);const b=m.useMemo(()=>[{label:e("common.members"),value:"members",render:i.jsx(xl,{type:"blocklet",createPassportSvg:an})},c&&{label:e("common.orgs"),value:"orgs",render:i.jsx(vl,{editable:!1,mode:"dashboard",layout:"table"})},{label:e("team.member.passports"),value:"passports",render:i.jsx(yl,{createPassportSvg:an})},{label:e("common.setting"),value:"settings",render:i.jsx(wl,{orientation:"vertical"})},{label:e("common.policies"),value:"security",render:i.jsx(Sl,{})}].filter(Boolean),[e,c]);return m.useEffect(()=>{s({tabs:b})},[b,s]),i.jsx(Y,{component:o})}const Cl=m.lazy(()=>I(()=>import("./domains-CiKmqXgC.js"),__vite__mapDeps([0,1]),import.meta.url)),jl=m.lazy(()=>I(()=>import("./branding-DclrAcmZ.js"),__vite__mapDeps([0,1]),import.meta.url)),_l=m.lazy(()=>I(()=>import("./appearance-1Y_gCbL9.js"),__vite__mapDeps([0,1]),import.meta.url)),El=m.lazy(()=>I(()=>import("./config-navigation-hnPNfA90.js"),__vite__mapDeps([0,1]),import.meta.url));function Il(){const{t:e}=R(),{navItem:t,updateAppInfo:n,TabComponent:s}=W(),{blocklet:o,actions:{refreshBlocklet:r}}=G(),a=m.useMemo(()=>o?{domainCount:(o?.site?.domainAliases||[]).length}:null,[o]),l=m.useMemo(()=>o?.settings?.theme?.name??"Default",[o]);m.useEffect(()=>{n({name:t?.title||"",description:t?.description||e("navigation.websiteDesc")})},[t,e,n]),m.useEffect(()=>{const u=[],{domainCount:d=0}=a;u.push({variant:"number",label:e("common.domains"),value:d,to:`${t.link}/domains`}),u.push({label:e("common.theme"),value:l,to:`${t.link}/theming`}),n({badges:u})},[n,a,l,e,t.link]);const c=m.useMemo(()=>[{label:e("common.domains"),value:"domains",render:Cl},{label:e("common.branding"),value:"branding",render:i.jsx(jl,{blocklet:o,onUpdate:r})},{label:e("common.theming"),value:"theming",render:i.jsx(_l,{})},{label:e("common.navigation"),value:"navigation",render:El}],[e,o,r]);return m.useEffect(()=>{n({tabs:c})},[c,n]),i.jsx(Y,{component:s})}const Ll=m.lazy(()=>I(()=>import("./index-DQ6KmrJ_.js"),__vite__mapDeps([0,1]),import.meta.url)),Dl=m.lazy(()=>I(()=>import("./index-B1BMtpDu.js"),__vite__mapDeps([0,1]),import.meta.url));function Tl(){const{t:e}=R(),{navItem:t,updateAppInfo:n,TabComponent:s}=W(),{blocklet:o}=G(),{session:r}=st(),{teamDid:a}=Ce(),l=m.useMemo(()=>r?.user?.role&&Nt.includes(r.user.role),[r]),c=ne(async()=>(await sr.get(`${T.WELLKNOWN_BLOCKLET_HEALTH_PATH}/notification`,{params:{since:"24h"}})).data?.data,[a]),u=m.useMemo(()=>{const f=o?.settings?.notification||{},p=[];return p.push({name:"Email",icon:"lucide:mail",enabled:f.email?.enabled}),p.push({name:"Push Kit",icon:"lucide:bell",enabled:f.pushKit?.enabled}),p.push({name:"Wallet",icon:"lucide:wallet",enabled:!0}),p.push({name:"Webhook",icon:"lucide:webhook",enabled:!0}),p},[o]);m.useEffect(()=>{n({name:t?.title||"",description:t?.description||e("navigation.websiteDesc")})},[t,e,n]),m.useEffect(()=>{const f=[],p=c.value?.channels||[];let b=0,h=0;Object.values(p).forEach(g=>{b+=g.state?.total??0,h+=g.state?.success??0}),f.push({label:`${e("notification.sendStatus.success")}(24h)`,value:i.jsxs("span",{children:[h," / ",b]}),to:`${t.link}/notifications`}),u.forEach(g=>{f.push({label:g.name,value:g.enabled?"ON":"OFF",to:`${t.link}/settings`})}),n({badges:f})},[n,u,c.value,e,t.link]);const d=m.useMemo(()=>[{label:e("notification.history"),value:"notifications",render:l?i.jsx(Ll,{blocklet:o}):i.jsx(nn,{status:403})},{label:e("common.settings"),value:"settings",render:l?i.jsx(Dl,{}):i.jsx(nn,{status:403})}].filter(Boolean),[l,e,o]);return m.useEffect(()=>{n({tabs:d})},[d,n]),i.jsx(Y,{component:s})}const Al=m.lazy(()=>I(()=>import("./config-uF2iao7N.js").then(e=>e.c),__vite__mapDeps([0,1]),import.meta.url)),Ml=m.lazy(()=>I(()=>import("./index-C8ve20rA.js"),__vite__mapDeps([0,1]),import.meta.url));function Rl(){const{t:e}=R(),{navItem:t,updateAppInfo:n,TabComponent:s}=W();m.useEffect(()=>{const r=t?.description||i.jsx(j,{dangerouslySetInnerHTML:{__html:e("navigation.aigneDesc",{aigneHubUrl:"https://store.blocklet.dev/blocklets/z8ia3xzq2tMq8CRHfaXj1BTYJyYnEcHbqP8cJ",mcpUrl:"https://modelcontextprotocol.io/"})}});n({name:t?.title||"",description:r})},[t,e,n]),m.useEffect(()=>{n({badges:[]})},[n]);const o=m.useMemo(()=>[{label:e("setup.steps.aigne"),value:"aigne-config",render:i.jsx(j,{sx:{maxWidth:1536},children:i.jsx(Al,{})})},{label:e("common.mcpServers"),value:"mcp-servers",render:i.jsx(Ml,{})}],[e]);return m.useEffect(()=>{n({tabs:o})},[o,n]),i.jsx(Y,{component:s})}const Pl=e=>m.createElement("svg",{viewBox:"0 0 24 17",xmlns:"http://www.w3.org/2000/svg",...e},m.createElement("path",{d:"M79.4248 0.700195C85.1132 0.700234 89.7244 5.31169 89.7246 11V54.2344C89.7244 59.9227 85.1132 64.5341 79.4248 64.5342H11.1562C5.46786 64.5342 0.856682 59.9227 0.856445 54.2344V54.0186H5.45605V54.2344C5.45629 57.3822 8.00837 59.9336 11.1562 59.9336H79.4248C82.5726 59.9336 85.1248 57.3822 85.125 54.2344V11C85.1248 7.8522 82.5727 5.29984 79.4248 5.2998H11.1562C8.00837 5.2998 5.45629 7.85217 5.45605 11V11.4893H0.856445V11C0.856676 5.31166 5.46786 0.700195 11.1562 0.700195H79.4248ZM11.293 17.6914C14.2375 17.6914 16.7876 18.3114 18.9434 19.5508C21.1254 20.762 22.8219 22.4798 24.0312 24.7051C25.2406 26.9304 25.8447 29.5504 25.8447 32.5645C25.8447 35.5502 25.2405 38.1418 24.0312 40.3389C22.8219 42.536 21.1255 44.2399 18.9434 45.4512C16.7875 46.6624 14.2375 47.2686 11.293 47.2686H1V17.6914H11.293ZM35.2061 47.2686H29.8818V17.6914H35.2061V47.2686ZM50.8828 17.6914C53.8272 17.6914 56.3774 18.3114 58.5332 19.5508C60.7151 20.7619 62.4108 22.48 63.6201 24.7051C64.8295 26.9304 65.4346 29.5505 65.4346 32.5645C65.4346 35.5503 64.8295 38.1417 63.6201 40.3389C62.4108 42.5359 60.7152 44.2399 58.5332 45.4512C56.3774 46.6624 53.8272 47.2685 50.8828 47.2686H40.5898V17.6914H50.8828ZM73.4785 36.7568C75.1235 36.7568 76.457 38.0913 76.457 39.7363C76.4568 41.3811 75.1234 42.7148 73.4785 42.7148C71.8338 42.7147 70.5003 41.381 70.5 39.7363C70.5 38.0914 71.8336 36.757 73.4785 36.7568ZM6.32422 42.4941H11.1357C14.1064 42.4941 16.3934 41.6204 17.9971 39.874C19.6008 38.0994 20.4023 35.663 20.4023 32.5645C20.4023 29.4378 19.6008 26.9727 17.9971 25.1699C16.3934 23.3674 14.1063 22.4659 11.1357 22.4658H6.32422V42.4941ZM45.9141 42.4941H50.7246C53.6954 42.4941 55.9832 41.6205 57.5869 39.874C59.1905 38.0994 59.9922 35.6628 59.9922 32.5645C59.9922 29.4378 59.1906 26.9727 57.5869 25.1699C55.9832 23.3672 53.6954 22.4658 50.7246 22.4658H45.9141V42.4941ZM73.4785 22.8574C75.1235 22.8574 76.457 24.1909 76.457 25.8359C76.457 27.4809 75.1235 28.8145 73.4785 28.8145C71.8336 28.8143 70.5 27.4808 70.5 25.8359C70.5 24.191 71.8337 22.8576 73.4785 22.8574Z",fill:"currentColor"}));function Yo({width:e=24,color:t="black",backgroundColor:n="transparent"}){return i.jsx(j,{component:"span",sx:{width:e,display:"inline-block",verticalAlign:"middle",color:t,backgroundColor:n,fontSize:0},children:i.jsx(Pl,{viewBox:"0 0 90 65",xmlns:"http://www.w3.org/2000/svg",style:{position:"relative",top:-1,lineHeight:1}})})}Yo.propTypes={width:y.number,color:y.string,backgroundColor:y.string};function Ol(){const{api:e}=F(),{blocklet:t}=G(),{data:n,loading:s}=gr(()=>e.getBlocklet({input:{did:t?.meta?.did,attachDiskInfo:!0,attachRuntimeInfo:!0}}),{ready:!!t?.meta?.did,refreshDeps:[t?.meta?.did]});return{blocklet:n?.blocklet??null,loading:s}}const Nl=m.lazy(()=>I(()=>import("./index-Bcpfja_q.js"),__vite__mapDeps([0,1]),import.meta.url));function $l(){const{palette:e}=V(),{t,locale:n}=R(),{navItem:s,updateAppInfo:o,TabComponent:r}=W(),{blocklet:a}=G(),{blocklet:l,loading:c}=Ol(),u=m.useMemo(()=>!!Ar(a?.environments),[a?.environments]);m.useEffect(()=>{const f=t("navigation.didSpacesDesc"),p=t("common.poweredBy",{brand:"$placeholder"}),b=f?f.slice(-1):"",[h,g]=p.split("$placeholder");o({name:s?.title||"",description:i.jsxs("span",{children:[f," ",h,i.jsxs("a",{href:`https://www.didspaces.com/${n}`,target:"_blank",style:{color:"#876bf4"},rel:"noreferrer",children:[i.jsx(Yo,{color:"#876bf4"})," Spaces"]}),g," ",b]})})},[s,t,n,o]),m.useEffect(()=>{const f=[];f.push({variant:"state",value:t(u?"storage.spaces.connected.tag":"storage.spaces.disconnected.tag"),color:u?"success":e.text.secondary,loading:c}),f.push({label:t("blocklet.runtimeInfo.dataStorage"),value:Hn(l?.diskInfo?.data??0),loading:c}),o({badges:f})},[o,u,l,c,t,e]);const d=m.useMemo(()=>[{label:t("common.backup"),value:"did-spaces",render:i.jsx(Nl,{navOrientation:"horizontal"})}],[t]);return m.useEffect(()=>{o({tabs:d})},[d,o]),i.jsx(Y,{component:r})}const Bl=m.lazy(()=>I(()=>import("./index-BvsQyxi_.js"),__vite__mapDeps([0,1,2]),import.meta.url));function Hl(){const{t:e}=R(),{navItem:t,updateAppInfo:n,TabComponent:s}=W(),{teamDid:o}=Ce(),{api:r}=F(),a=ne(()=>r.getBlockletBaseInfo({input:{teamDid:o}}),[o,r]);m.useEffect(()=>{n({name:t?.title||"",description:t?.description||e("navigation.publishDesc")})},[t,e,n]),m.useEffect(()=>{const c=[],{blocklets:u=0,releases:d=0}=a.value?.studio??{};c.push({variant:"number",label:e("common.blocklets"),value:u,round:0,loading:a.loading}),c.push({variant:"number",label:e("common.releases"),value:d,round:0,loading:a.loading}),n({badges:c})},[n,a.value,a.loading,e]);const l=m.useMemo(()=>[{label:e("common.blocklets"),value:"publish",render:i.jsx(Bl,{})}],[e]);return m.useEffect(()=>{n({tabs:l})},[l,n]),i.jsx(Y,{component:s})}const Ul=new Map([["overview",ll],["operations",pl],["integrations",bl],["did-connect",kl],["website",Il],["notification",Tl],["aigne",Rl],["did-spaces",$l],["publish",Hl]]),zl=te(T.WELLKNOWN_SERVICE_PATH_PREFIX,"user","notifications"),Vl=e=>{const{enqueueSnackbar:t}=Un(),n=m.useCallback(s=>Yn(zl,{id:s.id,severity:s.severity||"all",componentDid:s.source==="system"?"system":s.componentDid||"all"}),[]);ir(`${e}/${T.EVENTS.NOTIFICATION_BLOCKLET_CREATE}`,s=>{const o=n(s),{severity:r,description:a}=s||{},l=["error","warning"].includes(r)||s.sticky;s.source==="system"&&t(a,{variant:r,autoHideDuration:l?null:5e3,anchorOrigin:{vertical:"top",horizontal:"center"},content:c=>i.jsx(Vr,{viewAllUrl:o,keyId:c,notification:s,content:i.jsx(Er,{notification:s,minimal:!0,rows:0})})})},[],"user")};function Fl(){const{t:e}=R(),t=On(),{app:n="overview",tab:s}=Ds(),{blocklet:o,refreshFlag:r}=ot(),{session:a}=st(),l=K(()=>a?.user?.did,[a]);Vl(l);const c=Ul.get(n),u=K(()=>te(T.WELLKNOWN_BLOCKLET_ADMIN_PATH,n),[n]),d=K(()=>(o?.site?.domainAliases||[]).map(h=>h.value),[o]),f=K(()=>{if(!o)return!0;try{const h=o.configs?.find(v=>v.key==="BLOCKLET_APP_URL")?.value;if(!h||!d.length)return!0;const{host:g}=new URL(h);return d.some(v=>v===g)}catch{return!1}},[o,d]),p=m.useCallback(h=>{t(`${T.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/${n}/${h}`)},[t,n]),b=o?i.jsx(Zn,{type:"components",children:i.jsx(c,{})}):i.jsx(qe,{relative:"parent",children:i.jsx(Z,{})});return i.jsx(_r,{children:i.jsx(Uo,{appPath:u,appTab:s,onAppTabChange:p,children:i.jsxs(Yl,{children:[!f&&i.jsx(Je,{severity:"warning",sx:{mb:2,py:2},action:i.jsxs(j,{sx:{display:"flex",gap:1,alignItems:"center"},children:[i.jsx(St,{size:"small",onClick:()=>{t(`${T.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/website/branding`)},children:e("invalidAppUrl.viewConfig")}),i.jsx(St,{variant:"contained",size:"small",onClick:()=>{t(`${T.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/website/domains`)},children:e("invalidAppUrl.viewDomains")})]}),children:e("invalidAppUrl.desc")}),i.jsx(Pr,{}),i.jsx(Xa,{}),b]})},`${r}`)})}function Wl(){const{blocklet:e}=ot(),t=e?.meta?.did;return m.useEffect(()=>{const n=rr();return t&&n.connect(),()=>{t&&n.isConnected()&&n.disconnect()}},[t]),i.jsx(Fl,{})}const Yl=nt.main`
61
+ `,sl=m.memo(Vo);function Y({component:e=void 0}){const{blocklet:t}=G();return e?i.jsx(j,{className:"page-content",children:i.jsx(m.Suspense,{fallback:i.jsx(qe,{relative:"parent",children:i.jsx(Z,{})}),children:m.isValidElement(e)?e:Ls.createElement(e,{blocklet:t})})}):null}Y.propTypes={component:y.any};const rl=m.lazy(()=>I(()=>import("./overview-BJcUiexv.js"),__vite__mapDeps([0,1]),import.meta.url)),il=m.lazy(()=>I(()=>import("./component-CZUGuhBp.js"),__vite__mapDeps([0,1,2,3]),import.meta.url)),al=m.lazy(()=>I(()=>import("./advanced-DyGgZSKn.js"),__vite__mapDeps([0,1]),import.meta.url));function ll(){const e=V(),{info:t,inService:n}=F(),{t:s}=R(),{navItem:o,updateAppInfo:r,TabComponent:a}=W(),{blocklet:l,actions:{refreshBlocklet:c}}=G(),u=!l||or(l.status)?[]:$.getAppMissingConfigs(l),f=!!(n?window.env?.gateway?.wafPolicy?.enabled:t?.routing.wafPolicy?.enabled)&&(l?.settings?.gateway?.wafPolicy?.enabled??!0);m.useEffect(()=>{r({name:o?.title||"",description:o?.description||s("navigation.overviewDesc")})},[o,s,r]),m.useEffect(()=>{r({actions:l?i.jsx(sl,{className:"page-actions",hasPermission:!0,blocklet:l,onStart:()=>{},onComplete:({error:h}={})=>{h&&J.error(h.message)},variant:"group"}):null})},[l,r]),m.useEffect(()=>{const b=[];l&&b.push(i.jsx(Do,{"data-cy":"blocklet-status","status-blocklet-did":l.meta?.did,status:l.status,source:l.source,progress:l.progress,style:{lineHeight:e.spacing(3),height:e.spacing(3)}},"blocklet-status")),b.push({label:"WAF",value:f?"ON":"OFF",to:`${o?.link}/settings`}),r({badges:b})},[l,r,f,o?.link,e]);const p=m.useMemo(()=>[{label:s("common.overview"),value:"overview",render:rl},{label:i.jsx(_s,{"data-cy":"blocklet-list",color:"error",variant:"dot",invisible:!u.length,children:s("common.components")}),labelText:s("common.components"),value:"components",render:il},{label:s("common.globalSettings"),value:"settings",render:i.jsx(al,{blocklet:l,onUpdate:c})}],[s,u.length,l,c]);return m.useEffect(()=>{r({tabs:p})},[p,r]),i.jsx(Y,{component:a})}const cl=m.lazy(()=>I(()=>import("./traffic-C3uP0LAp.js").then(e=>e.t),__vite__mapDeps([0,1]),import.meta.url)),ul=m.lazy(()=>I(()=>import("./audit-logs-ClC8rsLg.js"),__vite__mapDeps([0,1,2]),import.meta.url)),dl=m.lazy(()=>I(()=>import("./log-CzJDSGek.js"),__vite__mapDeps([0,1]),import.meta.url)),fl=m.lazy(()=>I(()=>import("./runtime-Cucy5KcL.js"),__vite__mapDeps([0,1]),import.meta.url));function pl(){const{t:e}=R(),{navItem:t,updateAppInfo:n,TabComponent:s}=W(),{blocklet:o,client:r,did:a}=G(),{teamDid:l}=Ce(),{api:c}=F(),u=o?.meta?.did,d=ne(()=>c.getBlockletBaseInfo({input:{teamDid:l}}),[l,c]);m.useEffect(()=>{n({name:t?.title||"",description:t?.description||e("navigation.operationsDesc")})},[t,e,n]),m.useEffect(()=>{const p=[],{totalRequests:b=0,failedRequests:h=0}=d.value?.traffic??{},{cpuUsage:g=0,memoryUsage:v=0}=d.value?.appRuntimeInfo??{};p.push({variant:"number",label:e("analytics.traffic.totalRequests"),value:b,round:0,to:`${t.link}/analytics`,loading:d.loading}),p.push({variant:"number",label:e("analytics.traffic.failedRequests"),value:h,round:0,to:`${t.link}/analytics`,loading:d.loading}),p.push({label:e("blocklet.runtimeInfo.cpuUsage"),value:`${g.toFixed(1)}%`,to:`${t.link}/performance`,loading:d.loading}),p.push({label:e("blocklet.runtimeInfo.memoryUsage"),value:Hn(v),to:`${t.link}/performance`,loading:d.loading}),n({badges:p})},[n,d.value,d.loading,t?.link,e]);const f=m.useMemo(()=>[o?.children?.length&&o.structVersion===T.APP_STRUCT_VERSION&&{label:e("common.logs"),value:"logs",render:dl},{label:e("common.auditLogs"),value:"audit-logs",render:i.jsx(ul,{scope:u,categories:["blocklet","team","security","certificates","gateway"]})},{label:e("common.performance"),value:"performance",render:i.jsx(fl,{client:r,did:a})},{label:e("common.analytics"),value:"analytics",render:i.jsx(cl,{client:r,did:a})}].filter(Boolean),[e,o,r,a,u]);return m.useEffect(()=>{n({tabs:f})},[f,n]),i.jsx(Y,{component:s})}const ml=m.lazy(()=>I(()=>import("./index-YVLFMapw.js"),__vite__mapDeps([0,1]),import.meta.url)),hl=m.lazy(()=>I(()=>import("./index-CbA_EJi-.js"),__vite__mapDeps([0,1]),import.meta.url)),gl=m.lazy(()=>I(()=>import("./list-D6uynRH5.js"),__vite__mapDeps([0,1]),import.meta.url));function bl(){const{t:e}=R(),{navItem:t,updateAppInfo:n,TabComponent:s}=W(),{api:o}=F(),{teamDid:r}=Ce(),{session:a}=st(),l=m.useMemo(()=>a?.user?.role&&Nt.includes(a.user.role),[a]),c=ne(()=>o.getBlockletBaseInfo({input:{teamDid:r}}),[r,o]);m.useEffect(()=>{n({name:t?.title||"",description:t?.description||e("navigation.integrationsDesc")})},[t,e,n]),m.useEffect(()=>{const d=[],{webhooks:f=0,accessKeys:p=0,oauthApps:b=0}=c.value?.integrations??{};d.push({variant:"number",label:"Webhooks",value:f,to:`${t.link}/webhooks`,loading:c.loading}),d.push({variant:"number",label:"API Keys",value:p,to:`${t.link}/access-keys`,loading:c.loading}),d.push({variant:"number",label:"OAuth Apps",value:b,to:`${t.link}/oauth`,loading:c.loading}),n({badges:d})},[n,c.value,c.loading,t.link]);const u=m.useMemo(()=>[l&&{label:"Webhooks",value:"webhooks",render:i.jsx(ml,{})},{label:e("common.accessKeys"),value:"access-keys",render:i.jsx(hl,{})},{label:e("common.oauth"),value:"oauth",render:i.jsx(gl,{})}].filter(Boolean),[l,e]);return m.useEffect(()=>{n({tabs:u})},[u,n]),i.jsx(Y,{component:s})}var Fo=function(t){return i.jsx("svg",{...t,children:i.jsx("path",{d:"M79.425.7c5.688 0 10.3 4.612 10.3 10.3v43.234c0 5.689-4.612 10.3-10.3 10.3H11.156c-5.688 0-10.3-4.611-10.3-10.3v-.215h4.6v.215a5.7 5.7 0 0 0 5.7 5.7h68.269a5.7 5.7 0 0 0 5.7-5.7V11a5.7 5.7 0 0 0-5.7-5.7H11.156a5.7 5.7 0 0 0-5.7 5.7v.49h-4.6V11C.856 5.312 5.468.7 11.156.7h68.269ZM11.293 17.691c2.945 0 5.495.62 7.65 1.86 2.182 1.211 3.879 2.929 5.088 5.154 1.21 2.225 1.814 4.845 1.814 7.86 0 2.985-.604 5.577-1.814 7.774a12.78 12.78 0 0 1-5.088 5.112c-2.155 1.211-4.706 1.818-7.65 1.818H1V17.69h10.293ZM35.206 47.27h-5.324V17.69h5.324V47.27ZM50.883 17.69c2.944 0 5.494.62 7.65 1.86 2.182 1.21 3.878 2.929 5.087 5.154 1.21 2.225 1.815 4.846 1.815 7.86 0 2.985-.606 5.577-1.815 7.774a12.78 12.78 0 0 1-5.087 5.112c-2.156 1.211-4.706 1.818-7.65 1.818H40.59V17.69h10.293Zm22.595 19.066a2.98 2.98 0 1 1-.001 5.958 2.98 2.98 0 0 1 .001-5.958ZM6.325 42.494h4.812c2.97 0 5.257-.874 6.861-2.62 1.604-1.775 2.405-4.211 2.405-7.31 0-3.126-.801-5.591-2.405-7.394-1.604-1.803-3.89-2.704-6.861-2.704H6.324v20.028Zm39.59 0h4.81c2.971 0 5.26-.873 6.863-2.62 1.603-1.775 2.405-4.211 2.405-7.31 0-3.126-.801-5.591-2.405-7.394-1.604-1.803-3.892-2.704-6.862-2.704h-4.81v20.028Zm27.564-19.637a2.978 2.978 0 1 1 0 5.957 2.978 2.978 0 0 1 0-5.957Z",fill:"currentColor"})})};Fo.defaultProps={viewBox:"0 0 24 17",xmlns:"http://www.w3.org/2000/svg"};function Wo({width:e=24,color:t="black",backgroundColor:n="transparent"}){return i.jsx(j,{component:"span",sx:{width:e,display:"inline-block",verticalAlign:"middle",color:t,backgroundColor:n,fontSize:0},children:i.jsx(Fo,{viewBox:"0 0 90 65",xmlns:"http://www.w3.org/2000/svg",style:{position:"relative",top:-1,lineHeight:1}})})}Wo.propTypes={width:y.number,color:y.string,backgroundColor:y.string};const xl=m.lazy(()=>I(()=>import("./index-DfH5MtA4.js"),__vite__mapDeps([0,1]),import.meta.url)),vl=m.lazy(()=>I(()=>import("./index-D1ZBWiBh.js").then(e=>e.i),__vite__mapDeps([0,1]),import.meta.url)),yl=m.lazy(()=>I(()=>import("./index-CA8KVVfT.js"),__vite__mapDeps([0,1]),import.meta.url)),wl=m.lazy(()=>I(()=>import("./index-COc3cI68.js"),__vite__mapDeps([0,1]),import.meta.url)),Sl=m.lazy(()=>I(()=>import("./security-B5St5gtl.js"),__vite__mapDeps([0,1]),import.meta.url));function kl(){const{t:e,locale:t}=R(),{navItem:n,updateAppInfo:s,TabComponent:o}=W(),{blocklet:r}=G(),{api:a}=F(),{teamDid:l}=Ce(),c=m.useMemo(()=>wr(r,"settings.org.enabled",!1),[r]),u=ne(()=>a.getBlockletBaseInfo({input:{teamDid:l}}),[l,a]),d=ne(async()=>{if(!r?.meta?.did)return null;const{securityRules:h}=await a.getBlockletSecurityRules({input:{did:r.meta.did,includeDisabled:!0}});return h.find(g=>g.id===T.SECURITY_RULE_DEFAULT_ID)},[r?.meta?.did,a]),f=m.useMemo(()=>{const h=r?.settings?.oauth||{},g=[];return["github","google","apple","twitter","auth0"].forEach(v=>{h[v]?.enabled&&g.push({name:v,icon:`simple-icons:${v}`,title:He.PROVIDER_NAME[v]||v})}),g},[r?.settings?.oauth]),p=m.useMemo(()=>(r?.settings?.federated?.sites||[]).length>0,[r?.settings?.federated?.sites]);m.useEffect(()=>{const h=e("navigation.didConnectDesc"),g=e("common.poweredBy",{brand:"$placeholder"}),v=h?h.slice(-1):"",[C,x]=g.split("$placeholder");s({name:n?.title||"",description:i.jsxs("span",{children:[h," ",C,i.jsxs("a",{href:`https://www.didconnect.io/${t}`,target:"_blank",style:{color:"#5bbec5"},rel:"noreferrer",children:[i.jsx(Wo,{color:"#5bbec5"})," Connect"]}),x," ",v]})})},[n,e,t,s]),m.useEffect(()=>{const h=[],{users:g=0}=u.value?.user??{},{passports:v=0}=u.value?.passport??{};h.push({variant:"number",label:e("common.members"),value:g,to:`${n.link}/members`,round:0}),h.push({variant:"number",label:e("team.member.passports"),value:v,to:`${n.link}/passports`,round:0}),f.length>0&&h.push({label:e("oauth.oauth"),value:i.jsx(Rn,{direction:"row",spacing:.5,children:f.map(x=>i.jsx(pe,{icon:x.icon}))}),to:`${n.link}/settings`}),h.push({label:e("oauth.federated"),value:p?"ON":"OFF",to:`${n.link}/settings`});const C=d.value?.accessPolicy?.name;C&&h.push({label:e("accessPolicy.title"),value:C,to:`${n.link}/security`}),s({badges:h})},[s,u.value,u.loading,e,f,p,d.value,d.loading,n.link]);const b=m.useMemo(()=>[{label:e("common.members"),value:"members",render:i.jsx(xl,{type:"blocklet",createPassportSvg:an})},c&&{label:e("common.orgs"),value:"orgs",render:i.jsx(vl,{editable:!1,mode:"dashboard",layout:"table"})},{label:e("team.member.passports"),value:"passports",render:i.jsx(yl,{createPassportSvg:an})},{label:e("common.setting"),value:"settings",render:i.jsx(wl,{orientation:"vertical"})},{label:e("common.policies"),value:"security",render:i.jsx(Sl,{})}].filter(Boolean),[e,c]);return m.useEffect(()=>{s({tabs:b})},[b,s]),i.jsx(Y,{component:o})}const Cl=m.lazy(()=>I(()=>import("./domains-3VVRUwD7.js"),__vite__mapDeps([0,1]),import.meta.url)),jl=m.lazy(()=>I(()=>import("./branding-BYJ9wBmN.js"),__vite__mapDeps([0,1]),import.meta.url)),_l=m.lazy(()=>I(()=>import("./appearance-CP2saN8e.js"),__vite__mapDeps([0,1]),import.meta.url)),El=m.lazy(()=>I(()=>import("./config-navigation-DRx0q2MD.js"),__vite__mapDeps([0,1]),import.meta.url));function Il(){const{t:e}=R(),{navItem:t,updateAppInfo:n,TabComponent:s}=W(),{blocklet:o,actions:{refreshBlocklet:r}}=G(),a=m.useMemo(()=>o?{domainCount:(o?.site?.domainAliases||[]).length}:null,[o]),l=m.useMemo(()=>o?.settings?.theme?.name??"Default",[o]);m.useEffect(()=>{n({name:t?.title||"",description:t?.description||e("navigation.websiteDesc")})},[t,e,n]),m.useEffect(()=>{const u=[],{domainCount:d=0}=a;u.push({variant:"number",label:e("common.domains"),value:d,to:`${t.link}/domains`}),u.push({label:e("common.theme"),value:l,to:`${t.link}/theming`}),n({badges:u})},[n,a,l,e,t.link]);const c=m.useMemo(()=>[{label:e("common.domains"),value:"domains",render:Cl},{label:e("common.branding"),value:"branding",render:i.jsx(jl,{blocklet:o,onUpdate:r})},{label:e("common.theming"),value:"theming",render:i.jsx(_l,{})},{label:e("common.navigation"),value:"navigation",render:El}],[e,o,r]);return m.useEffect(()=>{n({tabs:c})},[c,n]),i.jsx(Y,{component:s})}const Ll=m.lazy(()=>I(()=>import("./index-BoNPkce-.js"),__vite__mapDeps([0,1]),import.meta.url)),Dl=m.lazy(()=>I(()=>import("./index-sxg2jpz1.js"),__vite__mapDeps([0,1]),import.meta.url));function Tl(){const{t:e}=R(),{navItem:t,updateAppInfo:n,TabComponent:s}=W(),{blocklet:o}=G(),{session:r}=st(),{teamDid:a}=Ce(),l=m.useMemo(()=>r?.user?.role&&Nt.includes(r.user.role),[r]),c=ne(async()=>(await sr.get(`${T.WELLKNOWN_BLOCKLET_HEALTH_PATH}/notification`,{params:{since:"24h"}})).data?.data,[a]),u=m.useMemo(()=>{const f=o?.settings?.notification||{},p=[];return p.push({name:"Email",icon:"lucide:mail",enabled:f.email?.enabled}),p.push({name:"Push Kit",icon:"lucide:bell",enabled:f.pushKit?.enabled}),p.push({name:"Wallet",icon:"lucide:wallet",enabled:!0}),p.push({name:"Webhook",icon:"lucide:webhook",enabled:!0}),p},[o]);m.useEffect(()=>{n({name:t?.title||"",description:t?.description||e("navigation.websiteDesc")})},[t,e,n]),m.useEffect(()=>{const f=[],p=c.value?.channels||[];let b=0,h=0;Object.values(p).forEach(g=>{b+=g.state?.total??0,h+=g.state?.success??0}),f.push({label:`${e("notification.sendStatus.success")}(24h)`,value:i.jsxs("span",{children:[h," / ",b]}),to:`${t.link}/notifications`}),u.forEach(g=>{f.push({label:g.name,value:g.enabled?"ON":"OFF",to:`${t.link}/settings`})}),n({badges:f})},[n,u,c.value,e,t.link]);const d=m.useMemo(()=>[{label:e("notification.history"),value:"notifications",render:l?i.jsx(Ll,{blocklet:o}):i.jsx(nn,{status:403})},{label:e("common.settings"),value:"settings",render:l?i.jsx(Dl,{}):i.jsx(nn,{status:403})}].filter(Boolean),[l,e,o]);return m.useEffect(()=>{n({tabs:d})},[d,n]),i.jsx(Y,{component:s})}const Al=m.lazy(()=>I(()=>import("./config-BwLMiIKp.js").then(e=>e.c),__vite__mapDeps([0,1]),import.meta.url)),Ml=m.lazy(()=>I(()=>import("./index-BMBR4jWm.js"),__vite__mapDeps([0,1]),import.meta.url));function Rl(){const{t:e}=R(),{navItem:t,updateAppInfo:n,TabComponent:s}=W();m.useEffect(()=>{const r=t?.description||i.jsx(j,{dangerouslySetInnerHTML:{__html:e("navigation.aigneDesc",{aigneHubUrl:"https://store.blocklet.dev/blocklets/z8ia3xzq2tMq8CRHfaXj1BTYJyYnEcHbqP8cJ",mcpUrl:"https://modelcontextprotocol.io/"})}});n({name:t?.title||"",description:r})},[t,e,n]),m.useEffect(()=>{n({badges:[]})},[n]);const o=m.useMemo(()=>[{label:e("setup.steps.aigne"),value:"aigne-config",render:i.jsx(j,{sx:{maxWidth:1536},children:i.jsx(Al,{})})},{label:e("common.mcpServers"),value:"mcp-servers",render:i.jsx(Ml,{})}],[e]);return m.useEffect(()=>{n({tabs:o})},[o,n]),i.jsx(Y,{component:s})}const Pl=e=>m.createElement("svg",{viewBox:"0 0 24 17",xmlns:"http://www.w3.org/2000/svg",...e},m.createElement("path",{d:"M79.4248 0.700195C85.1132 0.700234 89.7244 5.31169 89.7246 11V54.2344C89.7244 59.9227 85.1132 64.5341 79.4248 64.5342H11.1562C5.46786 64.5342 0.856682 59.9227 0.856445 54.2344V54.0186H5.45605V54.2344C5.45629 57.3822 8.00837 59.9336 11.1562 59.9336H79.4248C82.5726 59.9336 85.1248 57.3822 85.125 54.2344V11C85.1248 7.8522 82.5727 5.29984 79.4248 5.2998H11.1562C8.00837 5.2998 5.45629 7.85217 5.45605 11V11.4893H0.856445V11C0.856676 5.31166 5.46786 0.700195 11.1562 0.700195H79.4248ZM11.293 17.6914C14.2375 17.6914 16.7876 18.3114 18.9434 19.5508C21.1254 20.762 22.8219 22.4798 24.0312 24.7051C25.2406 26.9304 25.8447 29.5504 25.8447 32.5645C25.8447 35.5502 25.2405 38.1418 24.0312 40.3389C22.8219 42.536 21.1255 44.2399 18.9434 45.4512C16.7875 46.6624 14.2375 47.2686 11.293 47.2686H1V17.6914H11.293ZM35.2061 47.2686H29.8818V17.6914H35.2061V47.2686ZM50.8828 17.6914C53.8272 17.6914 56.3774 18.3114 58.5332 19.5508C60.7151 20.7619 62.4108 22.48 63.6201 24.7051C64.8295 26.9304 65.4346 29.5505 65.4346 32.5645C65.4346 35.5503 64.8295 38.1417 63.6201 40.3389C62.4108 42.5359 60.7152 44.2399 58.5332 45.4512C56.3774 46.6624 53.8272 47.2685 50.8828 47.2686H40.5898V17.6914H50.8828ZM73.4785 36.7568C75.1235 36.7568 76.457 38.0913 76.457 39.7363C76.4568 41.3811 75.1234 42.7148 73.4785 42.7148C71.8338 42.7147 70.5003 41.381 70.5 39.7363C70.5 38.0914 71.8336 36.757 73.4785 36.7568ZM6.32422 42.4941H11.1357C14.1064 42.4941 16.3934 41.6204 17.9971 39.874C19.6008 38.0994 20.4023 35.663 20.4023 32.5645C20.4023 29.4378 19.6008 26.9727 17.9971 25.1699C16.3934 23.3674 14.1063 22.4659 11.1357 22.4658H6.32422V42.4941ZM45.9141 42.4941H50.7246C53.6954 42.4941 55.9832 41.6205 57.5869 39.874C59.1905 38.0994 59.9922 35.6628 59.9922 32.5645C59.9922 29.4378 59.1906 26.9727 57.5869 25.1699C55.9832 23.3672 53.6954 22.4658 50.7246 22.4658H45.9141V42.4941ZM73.4785 22.8574C75.1235 22.8574 76.457 24.1909 76.457 25.8359C76.457 27.4809 75.1235 28.8145 73.4785 28.8145C71.8336 28.8143 70.5 27.4808 70.5 25.8359C70.5 24.191 71.8337 22.8576 73.4785 22.8574Z",fill:"currentColor"}));function Yo({width:e=24,color:t="black",backgroundColor:n="transparent"}){return i.jsx(j,{component:"span",sx:{width:e,display:"inline-block",verticalAlign:"middle",color:t,backgroundColor:n,fontSize:0},children:i.jsx(Pl,{viewBox:"0 0 90 65",xmlns:"http://www.w3.org/2000/svg",style:{position:"relative",top:-1,lineHeight:1}})})}Yo.propTypes={width:y.number,color:y.string,backgroundColor:y.string};function Ol(){const{api:e}=F(),{blocklet:t}=G(),{data:n,loading:s}=gr(()=>e.getBlocklet({input:{did:t?.meta?.did,attachDiskInfo:!0,attachRuntimeInfo:!0}}),{ready:!!t?.meta?.did,refreshDeps:[t?.meta?.did]});return{blocklet:n?.blocklet??null,loading:s}}const Nl=m.lazy(()=>I(()=>import("./index-qF59ePP4.js"),__vite__mapDeps([0,1]),import.meta.url));function $l(){const{palette:e}=V(),{t,locale:n}=R(),{navItem:s,updateAppInfo:o,TabComponent:r}=W(),{blocklet:a}=G(),{blocklet:l,loading:c}=Ol(),u=m.useMemo(()=>!!Ar(a?.environments),[a?.environments]);m.useEffect(()=>{const f=t("navigation.didSpacesDesc"),p=t("common.poweredBy",{brand:"$placeholder"}),b=f?f.slice(-1):"",[h,g]=p.split("$placeholder");o({name:s?.title||"",description:i.jsxs("span",{children:[f," ",h,i.jsxs("a",{href:`https://www.didspaces.com/${n}`,target:"_blank",style:{color:"#876bf4"},rel:"noreferrer",children:[i.jsx(Yo,{color:"#876bf4"})," Spaces"]}),g," ",b]})})},[s,t,n,o]),m.useEffect(()=>{const f=[];f.push({variant:"state",value:t(u?"storage.spaces.connected.tag":"storage.spaces.disconnected.tag"),color:u?"success":e.text.secondary,loading:c}),f.push({label:t("blocklet.runtimeInfo.dataStorage"),value:Hn(l?.diskInfo?.data??0),loading:c}),o({badges:f})},[o,u,l,c,t,e]);const d=m.useMemo(()=>[{label:t("common.backup"),value:"did-spaces",render:i.jsx(Nl,{navOrientation:"horizontal"})}],[t]);return m.useEffect(()=>{o({tabs:d})},[d,o]),i.jsx(Y,{component:r})}const Bl=m.lazy(()=>I(()=>import("./index-fvFGLK4q.js"),__vite__mapDeps([0,1,2]),import.meta.url));function Hl(){const{t:e}=R(),{navItem:t,updateAppInfo:n,TabComponent:s}=W(),{teamDid:o}=Ce(),{api:r}=F(),a=ne(()=>r.getBlockletBaseInfo({input:{teamDid:o}}),[o,r]);m.useEffect(()=>{n({name:t?.title||"",description:t?.description||e("navigation.publishDesc")})},[t,e,n]),m.useEffect(()=>{const c=[],{blocklets:u=0,releases:d=0}=a.value?.studio??{};c.push({variant:"number",label:e("common.blocklets"),value:u,round:0,loading:a.loading}),c.push({variant:"number",label:e("common.releases"),value:d,round:0,loading:a.loading}),n({badges:c})},[n,a.value,a.loading,e]);const l=m.useMemo(()=>[{label:e("common.blocklets"),value:"publish",render:i.jsx(Bl,{})}],[e]);return m.useEffect(()=>{n({tabs:l})},[l,n]),i.jsx(Y,{component:s})}const Ul=new Map([["overview",ll],["operations",pl],["integrations",bl],["did-connect",kl],["website",Il],["notification",Tl],["aigne",Rl],["did-spaces",$l],["publish",Hl]]),zl=te(T.WELLKNOWN_SERVICE_PATH_PREFIX,"user","notifications"),Vl=e=>{const{enqueueSnackbar:t}=Un(),n=m.useCallback(s=>Yn(zl,{id:s.id,severity:s.severity||"all",componentDid:s.source==="system"?"system":s.componentDid||"all"}),[]);ir(`${e}/${T.EVENTS.NOTIFICATION_BLOCKLET_CREATE}`,s=>{const o=n(s),{severity:r,description:a}=s||{},l=["error","warning"].includes(r)||s.sticky;s.source==="system"&&t(a,{variant:r,autoHideDuration:l?null:5e3,anchorOrigin:{vertical:"top",horizontal:"center"},content:c=>i.jsx(Vr,{viewAllUrl:o,keyId:c,notification:s,content:i.jsx(Er,{notification:s,minimal:!0,rows:0})})})},[],"user")};function Fl(){const{t:e}=R(),t=On(),{app:n="overview",tab:s}=Ds(),{blocklet:o,refreshFlag:r}=ot(),{session:a}=st(),l=K(()=>a?.user?.did,[a]);Vl(l);const c=Ul.get(n),u=K(()=>te(T.WELLKNOWN_BLOCKLET_ADMIN_PATH,n),[n]),d=K(()=>(o?.site?.domainAliases||[]).map(h=>h.value),[o]),f=K(()=>{if(!o)return!0;try{const h=o.configs?.find(v=>v.key==="BLOCKLET_APP_URL")?.value;if(!h||!d.length)return!0;const{host:g}=new URL(h);return d.some(v=>v===g)}catch{return!1}},[o,d]),p=m.useCallback(h=>{t(`${T.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/${n}/${h}`)},[t,n]),b=o?i.jsx(Zn,{type:"components",children:i.jsx(c,{})}):i.jsx(qe,{relative:"parent",children:i.jsx(Z,{})});return i.jsx(_r,{children:i.jsx(Uo,{appPath:u,appTab:s,onAppTabChange:p,children:i.jsxs(Yl,{children:[!f&&i.jsx(Je,{severity:"warning",sx:{mb:2,py:2},action:i.jsxs(j,{sx:{display:"flex",gap:1,alignItems:"center"},children:[i.jsx(St,{size:"small",onClick:()=>{t(`${T.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/website/branding`)},children:e("invalidAppUrl.viewConfig")}),i.jsx(St,{variant:"contained",size:"small",onClick:()=>{t(`${T.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/website/domains`)},children:e("invalidAppUrl.viewDomains")})]}),children:e("invalidAppUrl.desc")}),i.jsx(Pr,{}),i.jsx(Xa,{}),b]})},`${r}`)})}function Wl(){const{blocklet:e}=ot(),t=e?.meta?.did;return m.useEffect(()=>{const n=rr();return t&&n.connect(),()=>{t&&n.isConnected()&&n.disconnect()}},[t]),i.jsx(Fl,{})}const Yl=nt.main`
62
62
  .page-header {
63
63
  display: flex;
64
64
  justify-content: space-between;
@@ -1 +1 @@
1
- import{j as e,ak as o,aZ as h,T as j,z as g,W as i}from"./vendor-mui-core-DnR6WYuU.js";import{V as _}from"./vendor-ux-DfSgTRg5.js";import{C as b}from"./click-to-copy-B2HIKJMV.js";import{C as k}from"./confirm-btfSjmnK.js";function R({title:c,description:l,confirmPlaceholder:m,cancel:d="",confirm:u="Confirm",params:p={},onCancel:f=()=>{},onConfirm:C,keyName:t}){const{t:a}=_(),n={title:()=>e.jsx(o,{children:c}),description:(s,y)=>{const x=r=>{y({...r,__disableConfirm:r.__disableConfirm})};return e.jsxs(o,{children:[e.jsx(h,{severity:"warning",style:{width:"100%"},children:a("common.notice")}),e.jsx(o,{sx:{my:3,b:{wordBreak:"break-word"}},dangerouslySetInnerHTML:{__html:l}}),e.jsxs(o,{style:{marginBottom:24},children:[a("common.click"),":",e.jsx(b,{"data-cy":"click-copy",children:t})]}),e.jsx(j,{component:"div",children:e.jsx(g,{label:m,autoComplete:"off","data-cy":"delete-confirm-input",variant:"outlined",fullWidth:!0,autoFocus:!0,value:s.inputVal,onChange:r=>{x({...s,inputVal:r.target.value,__disableConfirm:t!==r.target.value})}})})]})},confirm:u,cancel:d,onConfirm:C,onCancel:f,params:{inputVal:"",__disableConfirm:!0,...p}};return e.jsx(k,{title:n.title,description:n.description,confirm:n.confirm,cancel:n.cancel,params:n.params,onConfirm:n.onConfirm,onCancel:n.onCancel})}R.propTypes={title:i.any.isRequired,keyName:i.any.isRequired,description:i.any.isRequired,confirmPlaceholder:i.any.isRequired,cancel:i.string,confirm:i.string,params:i.object,onCancel:i.func,onConfirm:i.func.isRequired};export{R as D};
1
+ import{j as e,ak as o,aZ as h,T as j,z as g,W as i}from"./vendor-mui-core-DnR6WYuU.js";import{V as _}from"./vendor-ux-DfSgTRg5.js";import{C as b}from"./click-to-copy-B2HIKJMV.js";import{C as k}from"./confirm-D3ZOq19V.js";function R({title:c,description:l,confirmPlaceholder:m,cancel:d="",confirm:u="Confirm",params:p={},onCancel:f=()=>{},onConfirm:C,keyName:t}){const{t:a}=_(),n={title:()=>e.jsx(o,{children:c}),description:(s,y)=>{const x=r=>{y({...r,__disableConfirm:r.__disableConfirm})};return e.jsxs(o,{children:[e.jsx(h,{severity:"warning",style:{width:"100%"},children:a("common.notice")}),e.jsx(o,{sx:{my:3,b:{wordBreak:"break-word"}},dangerouslySetInnerHTML:{__html:l}}),e.jsxs(o,{style:{marginBottom:24},children:[a("common.click"),":",e.jsx(b,{"data-cy":"click-copy",children:t})]}),e.jsx(j,{component:"div",children:e.jsx(g,{label:m,autoComplete:"off","data-cy":"delete-confirm-input",variant:"outlined",fullWidth:!0,autoFocus:!0,value:s.inputVal,onChange:r=>{x({...s,inputVal:r.target.value,__disableConfirm:t!==r.target.value})}})})]})},confirm:u,cancel:d,onConfirm:C,onCancel:f,params:{inputVal:"",__disableConfirm:!0,...p}};return e.jsx(k,{title:n.title,description:n.description,confirm:n.confirm,cancel:n.cancel,params:n.params,onConfirm:n.onConfirm,onCancel:n.onCancel})}R.propTypes={title:i.any.isRequired,keyName:i.any.isRequired,description:i.any.isRequired,confirmPlaceholder:i.any.isRequired,cancel:i.string,confirm:i.string,params:i.object,onCancel:i.func,onConfirm:i.func.isRequired};export{R as D};
@@ -1,4 +1,4 @@
1
- import{j as o,ak as i,at as g,W as u}from"./vendor-mui-core-DnR6WYuU.js";import{y as v,q as C,aA as b,o as B}from"./index-DwK0GIrs.js";import{D as E,a as I,b as w}from"./domain-action-card-B9GypCwf.js";import{aT as T}from"./vendor-ux-DfSgTRg5.js";import{a as A}from"./page-header-CHAwrgX-.js";import{r,j as W}from"./vendor-react-CTtPmzVP.js";import{u as L}from"./useSetState-L-f8mSga.js";import{S as x}from"./button-D6RwAFss.js";import{S as $}from"./layout-BPsPNtH9.js";import{S as z}from"./step-actions-Cfagh9Pk.js";import"./vendor-arcblock-CPCSE54a.js";import"./vendor-utils-drLlzTVq.js";import"./vendor-hooks-cYMUGE4V.js";import"./lottie-web-4koyQiv_.js";import"./permission-PnySJGEl.js";import"./session-nLCSznMa.js";import"./useAsyncRetry--1T7wYe2.js";import"./useAsync-xXSiXzwr.js";import"./confirm-btfSjmnK.js";import"./index-DBs9Ljax.js";import"./actions-Dfiiwkit.js";import"./delete-confirm-dqp-ol9_.js";import"./click-to-copy-B2HIKJMV.js";import"./useAsync-VEqKX7rF.js";import"./index-BP_Fl0Mu.js";import"./util-D27AtnBb.js";import"./engine-0ct2xW2c.js";import"./content-layout-DmSBGGVm.js";import"./use-mobile-D5clNlrm.js";function h({onNext:a=()=>{},onPrevious:f=()=>{}}){const{t:s}=r.useContext(T),[D,d]=r.useState(!1),{blocklet:e}=v(),[p,S]=r.useState(""),j=((e?.site||{}).domainAliases||[]).map(t=>C.replaceSlotToIp(t.value,p)),[n,m]=L({domain:"",invalidDNSDomain:null,type:"",addDomainState:{text:""}}),c=e.environments?.find(t=>t.key==="BLOCKLET_APP_PK")?.value,y=j.find(t=>b.isDidDomain(t)),[l,P]=W();return r.useEffect(()=>{B.get(`/dns-resolve?hostname=${window.location.hostname}`).then(({data:t})=>{S(t.address||"")}).catch(t=>{console.error(t.message)})},[]),o.jsxs(H,{children:[o.jsx(i,{className:"header",children:o.jsx(A,{title:s("setup.domain.title"),subTitle:s("setup.domain.subTitle"),onClickBack:f})}),o.jsxs(i,{className:"form form-container",sx:{display:"flex",flexDirection:"column",gap:3,overflowY:"auto"},children:[o.jsxs(i,{children:[o.jsx(i,{sx:{color:"text.primary",fontWeight:"fontWeightBold",fontSize:"1.125rem"},children:o.jsx(i,{sx:{display:"inline"},children:`${s("setup.domain.buyOrConnect")} (${s("common.optional")})`})}),o.jsx(i,{sx:{mt:1},children:o.jsx(I,{blocklet:e,bugDidDomainProps:{appPk:c,appId:e.appPid,siteId:e.site.id,teamDid:e.meta.did,inBlockletSetup:!0},connectDomainProps:{autoFocus:!1,appPk:c,appId:e.appPid,siteId:e.site.id,teamDid:e.meta.did,cnameDomain:y,currentIp:p,inBlockletSetup:!0,shouldCheckDomain:!0,onInputDomain:t=>{m({domain:t.domain,type:t.type}),d(t.error)},onStateChange:t=>m({addDomainState:t}),onSuccess:t=>{const k={domain:t.domain,type:t.type,nftDid:t.nftDid,chainHost:t.chainHost};l.set("redirect",t.domain),P(l,{replace:!0}),m(k),a()},onError:d}})})]}),o.jsx(i,{children:o.jsx(w,{inSetup:!0,showAllDomains:!0,systemTips:o.jsx(i,{sx:{color:"text.primary",fontWeight:"fontWeightBold",fontSize:"1.125rem",mb:1},children:o.jsx(i,{sx:{display:"inline"},children:s("setup.domain.skipDescription")})})})})]}),o.jsx(z,{mt:8,disabled:!!n.addDomainState.text,blocklet:e,onStartNow:()=>a("complete"),children:n.domain?o.jsx(x,{variant:"contained",loading:!!n.addDomainState.text,disabled:D||!!n.addDomainState.text||!n.domain,onClick:()=>a(),children:n.addDomainState.text||s("setup.continue")}):o.jsx(x,{variant:"contained",disabled:!!n.addDomainState.text,onClick:()=>a(),children:s("setup.continue")})})]})}function ht(a){return o.jsx(E,{children:o.jsx(h,{...a})})}h.propTypes={onNext:u.func,onPrevious:u.func};const H=g($)`
1
+ import{j as o,ak as i,at as g,W as u}from"./vendor-mui-core-DnR6WYuU.js";import{y as v,q as C,aA as b,o as B}from"./index-CDZlfV0h.js";import{D as E,a as I,b as w}from"./domain-action-card-BTzoEvCg.js";import{aT as T}from"./vendor-ux-DfSgTRg5.js";import{a as A}from"./page-header-CHAwrgX-.js";import{r,j as W}from"./vendor-react-CTtPmzVP.js";import{u as L}from"./useSetState-L-f8mSga.js";import{S as x}from"./button-D6RwAFss.js";import{S as $}from"./layout-BFN2VPgc.js";import{S as z}from"./step-actions-CNIiIH7j.js";import"./vendor-arcblock-CPCSE54a.js";import"./vendor-utils-drLlzTVq.js";import"./vendor-hooks-cYMUGE4V.js";import"./lottie-web-4koyQiv_.js";import"./permission-ZblvP8BW.js";import"./session-BqnhIOZD.js";import"./useAsyncRetry--1T7wYe2.js";import"./useAsync-xXSiXzwr.js";import"./confirm-D3ZOq19V.js";import"./index-DBs9Ljax.js";import"./actions-Dfiiwkit.js";import"./delete-confirm-CvVgX89H.js";import"./click-to-copy-B2HIKJMV.js";import"./useAsync-VEqKX7rF.js";import"./index-BP_Fl0Mu.js";import"./util-DE6S-EwK.js";import"./engine-Ctj5gh6M.js";import"./content-layout-DmSBGGVm.js";import"./use-mobile-D5clNlrm.js";function h({onNext:a=()=>{},onPrevious:f=()=>{}}){const{t:s}=r.useContext(T),[D,d]=r.useState(!1),{blocklet:e}=v(),[p,S]=r.useState(""),j=((e?.site||{}).domainAliases||[]).map(t=>C.replaceSlotToIp(t.value,p)),[n,m]=L({domain:"",invalidDNSDomain:null,type:"",addDomainState:{text:""}}),c=e.environments?.find(t=>t.key==="BLOCKLET_APP_PK")?.value,y=j.find(t=>b.isDidDomain(t)),[l,P]=W();return r.useEffect(()=>{B.get(`/dns-resolve?hostname=${window.location.hostname}`).then(({data:t})=>{S(t.address||"")}).catch(t=>{console.error(t.message)})},[]),o.jsxs(H,{children:[o.jsx(i,{className:"header",children:o.jsx(A,{title:s("setup.domain.title"),subTitle:s("setup.domain.subTitle"),onClickBack:f})}),o.jsxs(i,{className:"form form-container",sx:{display:"flex",flexDirection:"column",gap:3,overflowY:"auto"},children:[o.jsxs(i,{children:[o.jsx(i,{sx:{color:"text.primary",fontWeight:"fontWeightBold",fontSize:"1.125rem"},children:o.jsx(i,{sx:{display:"inline"},children:`${s("setup.domain.buyOrConnect")} (${s("common.optional")})`})}),o.jsx(i,{sx:{mt:1},children:o.jsx(I,{blocklet:e,bugDidDomainProps:{appPk:c,appId:e.appPid,siteId:e.site.id,teamDid:e.meta.did,inBlockletSetup:!0},connectDomainProps:{autoFocus:!1,appPk:c,appId:e.appPid,siteId:e.site.id,teamDid:e.meta.did,cnameDomain:y,currentIp:p,inBlockletSetup:!0,shouldCheckDomain:!0,onInputDomain:t=>{m({domain:t.domain,type:t.type}),d(t.error)},onStateChange:t=>m({addDomainState:t}),onSuccess:t=>{const k={domain:t.domain,type:t.type,nftDid:t.nftDid,chainHost:t.chainHost};l.set("redirect",t.domain),P(l,{replace:!0}),m(k),a()},onError:d}})})]}),o.jsx(i,{children:o.jsx(w,{inSetup:!0,showAllDomains:!0,systemTips:o.jsx(i,{sx:{color:"text.primary",fontWeight:"fontWeightBold",fontSize:"1.125rem",mb:1},children:o.jsx(i,{sx:{display:"inline"},children:s("setup.domain.skipDescription")})})})})]}),o.jsx(z,{mt:8,disabled:!!n.addDomainState.text,blocklet:e,onStartNow:()=>a("complete"),children:n.domain?o.jsx(x,{variant:"contained",loading:!!n.addDomainState.text,disabled:D||!!n.addDomainState.text||!n.domain,onClick:()=>a(),children:n.addDomainState.text||s("setup.continue")}):o.jsx(x,{variant:"contained",disabled:!!n.addDomainState.text,onClick:()=>a(),children:s("setup.continue")})})]})}function ht(a){return o.jsx(E,{children:o.jsx(h,{...a})})}h.propTypes={onNext:u.func,onPrevious:u.func};const H=g($)`
2
2
  height: 100%;
3
3
  overflow-y: hidden;
4
4
 
@@ -1,4 +1,4 @@
1
- import{v as bn,T as vn,V as A,aJ as Cn,H as E,w as te,aN as wn,b9 as Ue}from"./vendor-ux-DfSgTRg5.js";import{j as e,dh as Ne,cP as Sn,ak as h,a6 as U,bu as Rn,T as R,aZ as ye,D as H,J as ie,am as L,aN as $e,W as t,cu as _e,M as Oe,aO as An,aP as kn,cQ as Tn,c5 as In,co as Pn,di as qn,dj as En,b6 as W,P as We,c0 as Ln,b0 as Fn,at as Mn,bb as Bn,bj as zn,dk as Un,dl as Nn,dm as $n,dn as Te,dp as _,dq as _n,z as On,n as Wn,bl as Hn,dr as Vn,bi as Gn}from"./vendor-mui-core-DnR6WYuU.js";import{C as ee,J as Jn,a as Zn,e as Qn,T as je,as as Kn,at as Yn,n as Z}from"./vendor-utils-drLlzTVq.js";import{r as j,e as He,g as Xn}from"./vendor-react-CTtPmzVP.js";import{u as se}from"./useSetState-L-f8mSga.js";import{x as et,q as nt,b as Q,t as tt,E as it}from"./vendor-hooks-cYMUGE4V.js";import{bw as Ve,be as Ge,c3 as st,c4 as Je,Z as F,Y as oe,J as Ie,e as ot,a1 as Pe,c5 as rt,G as at,ag as lt,c6 as Ze,aA as fe,c7 as Qe,bV as ct,c8 as dt,c9 as mt,b0 as ut,q as xe,bz as pt,ca as ft}from"./index-DwK0GIrs.js";import{w as Ke}from"./permission-PnySJGEl.js";import{u as xt,D as qe}from"./useAsyncRetry--1T7wYe2.js";import{C as re}from"./confirm-btfSjmnK.js";import{A as ht}from"./actions-Dfiiwkit.js";import{D as gt}from"./delete-confirm-dqp-ol9_.js";import{o as Ee}from"./vendor-arcblock-CPCSE54a.js";import{u as Dt}from"./useAsync-VEqKX7rF.js";import{f as N}from"./index-DBs9Ljax.js";import{v as yt}from"./index-BP_Fl0Mu.js";import{g as jt,p as Le}from"./util-D27AtnBb.js";import{C as bt}from"./click-to-copy-B2HIKJMV.js";const vt=Ve({});vt.interceptors.request.use(n=>{const i=window.blocklet?window.blocklet.prefix:"/";return n.baseURL=i||"",n.url=ee("/api",String(n.url)),n.timeout=2e5,n.params=n.params||{},new URLSearchParams(n.url.split("?")[1]).has("locale")||(n.params.locale=bn()),n},n=>Promise.reject(n));const Ye=(...n)=>Ve(...n),Ct=(n,i)=>i?n?[n,...Array.isArray(i)?i:[i]]:i:n,wt=(n,{width:i=600,height:o=700,name:a="did-domain:popup"}={})=>{const s=window.screenX+(window.innerWidth-i)/2,r=window.screenY+(window.innerHeight-o)/2,u=[`left=${s}`,`top=${r}`,`width=${i}`,`height=${o}`,"resizable=no","scrollbars=yes","status=yes","popup=yes"],l=window.open("",a,u.join(","));if(l===null)throw new Error("Failed to open popup");return l.location.href=Jn(n,{opener:window.location.origin}),l},St="z2qaGosS3rZ7m5ttP3Nd4V4qczR9TryTcRV4p",Xe=async n=>{if(!n||!n?.trim())return null;const i=Ye(),o=new URL(n);o.pathname="__blocklet__.js",o.searchParams.set("type","json");const{data:a}=await i.get(o.toString()),s=a?.componentMountPoints?.find(m=>m.did===St),r=new URL(n);r.pathname=s?.mountPoint;const u=r.toString(),l=ee(u,"/api");return{base:u,api:l}},Rt=Ge({embed:{iconTip:"Click to view subscription details"},buy:{button:{title:"Buy DID Domain"},status:{inProgress:"Please wait while we are processing your request, the domain will be automatically resolved to the current app after the purchase...",success:"Purchase completed!"},error:{failedToCreateSession:"Failed to create session"}}}),At=Ge({embed:{iconTip:"点击查看订阅详情"},buy:{button:{title:"购买 DID 域名"},status:{inProgress:"请稍等,我们正在处理您的请求,购买域名后会自动解析到当前的应用...",success:"购买完成!"},error:{failedToCreateSession:"创建会话失败"}}}),kt={zh:At,en:Rt},Tt=async({didDomainURL:n,delegatee:i,delegateePk:o})=>{const a=await Xe(n);if(!a)return null;const s=Ye({baseURL:a.api}),{data:r}=await s.post("/payment/session",{delegatee:i,delegateePk:o});return{sessionId:r.sessionId,baseURL:a.base}};function It({delegatee:n,delegateePk:i,didDomainURL:o,locale:a,title:s="",onSuccess:r=()=>{},...u}){const{t:l}=A(),[m,p]=et({currentState:1}),f=j.useRef(null),c=nt(async()=>{const d=await Tt({didDomainURL:o,delegatee:n,delegateePk:i});return d},{debounceWait:500,debounceLeading:!0,debounceTrailing:!1,debounceMaxWait:3e3,refreshDeps:[],onError(d){console.error(d)}}),g=Q(d=>{d.data.type==="didDomain.success"&&(r?.({nftDid:d.data?.nftDid,domain:d.data?.domain,chainHost:d.data?.chainHost}),f.current?.close(),f.current=null,p({currentState:4}),setTimeout(()=>{p({currentState:8})},2e3))});tt(()=>{try{window.removeEventListener("message",g),f.current?.close(),f.current=null}catch(d){console.warn("Failed to close popup",d)}});const y=Q(()=>{p({currentState:1})}),x=Q(()=>{if(p({currentState:2}),!c.data){console.error("Failed to create session");return}b({sessionId:c.data.sessionId,baseURL:c.data.baseURL})}),b=Q(({sessionId:d,baseURL:w})=>{window.addEventListener("message",g);const C=new URL(w);C.searchParams.set("sessionId",d),C.searchParams.set("locale",a),C.searchParams.set("embed","1"),f.current=wt(C.toString());const q=setInterval(()=>{f.current?.closed&&(clearInterval(q),y())},1e3);return()=>clearInterval(q)});return e.jsxs(e.Fragment,{children:[e.jsx(Ne,{loading:c.loading,onClick:x,variant:"contained",startIcon:e.jsx(Sn,{}),...u,children:s||l("buy.button.title")}),e.jsxs(Cn,{fullWidth:!0,maxWidth:"xs",open:m.currentState>1&&m.currentState<8,onClose:y,children:[!c.error&&e.jsxs(h,{sx:{display:"flex",alignItems:"center",flexDirection:"column",gap:2},children:[m.currentState===2&&e.jsx(U,{size:50}),m.currentState===4&&e.jsx(Rn,{sx:{color:"primary.main",fontSize:"5rem"}}),m.currentState===2&&e.jsx(R,{children:l("buy.status.inProgress")}),m.currentState===4&&e.jsx(R,{children:l("buy.status.success")})]}),c.error&&e.jsx(ye,{severity:"error",children:l("buy.error.failedToCreateSession")})]})]})}function Pt(n){return e.jsx(vn,{locale:n.locale,translations:kt,children:e.jsx(It,{...n})})}function qt({nftDid:n,didDomainURL:i,locale:o,sx:a={}}){const{t:s}=A(),[r,u]=se({safeIframeRef:null,popoverAnchorEl:null}),l=j.useRef(null),m=H(),p=ie(m.breakpoints.down("md")),f=x=>{u({popoverAnchorEl:x.currentTarget})},c=()=>{u({popoverAnchorEl:null})},g=it(async()=>{const x=await Xe(i);return x?x.base:null});if(!g.value)return null;if(g.loading)return e.jsx(U,{});const y=ee(g.value,`/embed/domain?nft-did=${n}&locale=${o}`);return e.jsxs(e.Fragment,{children:[e.jsx(L,{title:s("embed.iconTip"),children:e.jsx(h,{component:"img",src:ee(i,"/.well-known/service/blocklet/logo"),alt:"logo",onClick:f,sx:[{width:16,height:16},Ct({cursor:"pointer"},a)]})}),e.jsx($e,{id:"popover-info",open:!!r.popoverAnchorEl,anchorEl:r.popoverAnchorEl,onClose:c,anchorOrigin:{vertical:"bottom",horizontal:"right"},children:e.jsx("iframe",{ref:l,title:s("common.subscription"),width:p?"320px":"400px",height:"350px",style:{border:0,display:"block"},src:y})})]})}const Et=n=>["waiting","creating","renewaling"].includes(n);function en({siteId:n,domain:i,onAdd:o=()=>{},children:a=null,did:s,issuing:r=!1,setIssuing:u=()=>{}}){const{t:l}=A(),[m,p]=j.useState(!1),{inService:f}=F(),[c,g]=j.useState(null),{api:y,ws:{useSubscription:x}}=F(),{mode:b,actions:{refreshDomainStatus:d}}=oe(),w=xt(async()=>{const{cert:T}=await y.findCertificateByDomain({input:{domain:i,did:s}});return T}),C=(T,S)=>{T.domain===i&&(u(!1),p(!1),f&&b!=="setup"&&(S==="success"?E.success(l("setup.domain.genCertSuccess",{domain:T.domain})):S==="error"&&E.error(l("setup.domain.genCertFailed",{domain:T.domain,message:T.message}))))};if(j.useEffect(()=>{w.loading||u(Et(w.value?.status))},[w.loading,w.value?.status,u]),x(Ie.BlockletEvents.certError,T=>C(T,"error")),x(Ie.BlockletEvents.certIssued,T=>{w.retry(),d(T.domain),C(T,"success")}),w.loading||w.value?.status==="normal")return"";const q=()=>{p(!1),g(null)},B=async()=>{p(!0);try{await y.issueLetsEncryptCert({input:{siteId:n,domain:i,did:s,inBlockletSetup:b==="setup"}}),o(),u(!0)}catch(T){console.error(T),u(!1)}finally{p(!1),g(null)}},M={title:l("router.cert.genLetsEncryptCert.title"),description:e.jsxs("div",{children:[e.jsx(ye,{severity:"success",children:l("router.cert.genLetsEncryptCert.dnsTip")}),l("router.cert.genLetsEncryptCert.description")]}),confirm:l("common.confirm"),onConfirm:B,onCancel:q},z=T=>{T.stopPropagation(),g(M)};return e.jsxs(e.Fragment,{children:[r?e.jsx(L,{title:l("router.cert.issuing"),children:e.jsx(U,{size:13,style:{fontSize:"13px"}})}):a({loading:m,open:z}),c&&e.jsx(re,{color:"primary",title:c.title,description:c.description,confirm:c.confirm,params:c.params,onConfirm:c.onConfirm,onCancel:c.onCancel})]})}en.propTypes={domain:t.string.isRequired,did:t.string.isRequired,siteId:t.string.isRequired,onAdd:t.func,children:t.any,issuing:t.bool,setIssuing:t.func};function nn({domain:n,domainStatus:i,did:o,onAdd:a=()=>{},children:s=null,issuing:r=!1,setIssuing:u=()=>{},...l}){return st(n)||!Je(n)||Zn(i)||i?.isHttps?"":e.jsx(en,{...l,domain:n,did:o,onAdd:a,issuing:r,setIssuing:u,children:s})}nn.propTypes={domain:t.string.isRequired,domainStatus:t.shape({isHttps:t.bool}).isRequired,did:t.string.isRequired,onAdd:t.func,children:t.any,issuing:t.bool,setIssuing:t.func};function tn({id:n,domain:i,children:o=null,teamDid:a="",onDelete:s=null}){const{t:r}=A(),[u,l]=j.useState(!1),[m,p]=j.useState(null),{api:f}=F(),c=()=>{l(!1),p(null)},g=async()=>{l(!0);try{await f.deleteDomainAlias({input:{id:n,domainAlias:i,teamDid:a}}),s?.(),await ot(2e3)}catch(b){E.error(b.message)}finally{p(null),l(!1)}},y={keyName:i,title:r("router.domainAlias.delete.title"),description:r("router.domainAlias.delete.description",{domain:i}),confirmPlaceholder:r("router.domainAlias.delete.confirmPlaceholder",{domain:i}),confirm:r("common.delete"),onConfirm:g,onCancel:c},x=b=>{b.stopPropagation(),p(y)};return e.jsxs(e.Fragment,{children:[typeof o=="function"?o({loading:u,open:x}):e.jsxs(te,{edge:"end",onClick:x,size:"small",className:"rule-action",color:"error","data-cy":"action-delete-domain-alias",children:[u?e.jsx(U,{size:16}):e.jsx(_e,{style:{fontSize:16}}),r("common.delete")]}),m&&e.jsx(gt,{keyName:m.keyName,title:m.title,description:m.description,confirmPlaceholder:m.confirmPlaceholder,confirm:m.confirm,params:m.params,onConfirm:m.onConfirm,onCancel:m.onCancel})]})}tn.propTypes={id:t.string.isRequired,domain:t.string.isRequired,children:t.any,teamDid:t.string,onDelete:t.func};function sn({site:n,domain:i,blocklet:o,onDelete:a=()=>{}}){const{t:s}=A(),r=i.value===window.location.hostname;return e.jsx(ht,{"data-cy":"domain-actions",size:"large",actions:[({close:u})=>e.jsx(tn,{id:n.id,domain:i.value,teamDid:o?.meta?.did,onDelete:a,children:({open:l})=>e.jsx(L,{title:r?s("blocklet.router.currentDomainTip"):"",children:e.jsx("span",{children:e.jsxs(Oe,{disabled:i.isProtected||r,dense:!0,onClick:m=>{u(),l(m)},"data-cy":"action-toggle-block",children:[e.jsx(An,{style:{minWidth:24,marginRight:8},children:e.jsx(_e,{})}),e.jsx(kn,{primary:s("common.delete")})]},"remove")})})})]})}sn.propTypes={site:t.object.isRequired,domain:t.object.isRequired,blocklet:t.object.isRequired,onDelete:t.func};const ae=t.shape({href:t.string,accessibility:t.shape({loading:t.bool,accessible:t.bool}),domainStatus:t.shape({isHttps:t.bool,matchedCert:t.object}),dns:t.shape({resolved:t.bool,ip:t.string})});function on({certificate:n={}}){const[i,o]=j.useState(null),a=F(),{t:s,locale:r}=A(),u=p=>{o(p.currentTarget)},l=()=>{o(null)},m=!!i;return e.jsxs(e.Fragment,{children:[e.jsx(Tn,{"aria-owns":m?"mouse-over-popover":void 0,onMouseEnter:u,onMouseLeave:l,style:{color:"#44cdc6",fontSize:"1em",cursor:"pointer"}}),e.jsx($e,{id:"mouse-over-popover",style:{pointerEvents:"none"},open:m,anchorEl:i,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:l,disableRestoreFocus:!0,children:e.jsx(In,{children:e.jsxs(Pn,{style:{display:"flex"},children:[e.jsx("div",{children:e.jsx("img",{src:`${a.imgPrefix}/https-certificate-icon.png`,alt:"certificate icon",style:{maxHeight:"100%",maxWidth:"100%"}})}),e.jsxs(R,{component:"div",style:{marginLeft:"16px"},children:[e.jsx(R,{component:"div",style:{fontWeight:"bold"},children:n.domain}),e.jsx(R,{component:"div",children:`${s("common.issuer")}: ${Qn(n,"issuer.commonName","")}`}),e.jsx(R,{component:"div",children:`${s("router.cert.issuedOn")}: ${Pe(n.validFrom,r)}`}),e.jsx(R,{component:"div",children:`${s("router.cert.expiryOn")}: ${Pe(n.validTo,r)}`})]})]})})})]})}on.propTypes={certificate:t.object};function ne({domain:n,filters:i=["domain","http"]}){const{t:o}=A(),{value:a,domainStatus:s}=n;if(!Je(a))return null;let r=null,u=null;const{isHttps:l,matchedCert:m}=s,{dns:{ip:p,isDnsResolved:f,isCnameMatch:c}={}}=s,g=f&&c;rt(a)||(g||p==="127.0.0.1"?r=e.jsx(L,{title:o("router.domain.verify.ok"),children:e.jsx(qe,{color:"success"})}):r=e.jsx(L,{title:o("router.domain.verify.notResolved"),children:e.jsx(qe,{color:"error"})})),g?l?u=e.jsx(on,{certificate:m}):u=e.jsx(L,{title:o("router.domain.https.bad"),children:e.jsx(qn,{style:{color:"#D0021B",fontSize:"1em",cursor:"pointer"}})}):u=e.jsx(L,{title:o("router.domain.verify.notResolved"),children:e.jsx(En,{style:{color:"#D0021B",fontSize:"1em",cursor:"pointer"}})});const y=i.map(x=>x==="domain"?r:x==="http"?u:null);return j.createElement(j.Fragment,null,...y)}ne.propTypes={domain:ae.isRequired,filters:t.array};const Lt=Ke(be,"mutate_blocklets"),Ft=Ke(be,"",at);function pi(n){const{inService:i}=F(),{blocklet:o,loadingRuntimeInfo:a}=oe();let s=Lt;return i&&(s=Ft),e.jsx(s,{...n,blocklet:o,inService:i,loadingRuntimeInfo:a})}const Fe="nft-domain";function be({hasPermission:n=!1,blocklet:i,loadingRuntimeInfo:o=!1,inService:a=!1,showAllDomains:s=!1,updateBlockletDomainAliases:r=()=>{},systemTips:u=null}){const{t:l}=A(),m=ie(d=>d.breakpoints.down("md")),p=j.useMemo(()=>{let d=n;return lt(i)&&(d=d&&a),d},[n,a,i]),{site:f}=i,c=j.useMemo(()=>Ze(i.site?.domainAliases),[i.site?.domainAliases]),g=j.useMemo(()=>c.filter(d=>!fe.isCustomDomain(d.value)),[c]),y=j.useMemo(()=>c.filter(d=>fe.isCustomDomain(d.value)),[c]),x=j.useMemo(()=>y.filter(d=>d.type!==Fe),[y]),b=j.useMemo(()=>y.filter(d=>d.type===Fe),[y]);return e.jsxs(e.Fragment,{children:[e.jsxs(W,{sx:{gap:3},children:[!!b.length&&e.jsx(X,{title:l("common.didDomains"),description:l("common.didDomainsDescription"),domains:b,hasMutatePermission:p,blocklet:i,site:f,mobile:m,showAllDomains:s,updateBlockletDomainAliases:r}),!!x.length&&e.jsx(X,{title:l("common.manualDomains"),description:l("common.manualDomainsDescription"),domains:x,hasMutatePermission:p,blocklet:i,site:f,mobile:m,showAllDomains:s,updateBlockletDomainAliases:r}),!!g.length&&e.jsxs(h,{children:[u,e.jsx(X,{title:l("common.systemDomains"),description:l("common.systemDomainsDescription"),domains:g,hasMutatePermission:p,blocklet:i,site:f,mobile:m,updateBlockletDomainAliases:r})]})]}),!c.length&&(o?e.jsx(U,{size:16}):e.jsx(wn,{children:l("common.empty")}))]})}be.propTypes={hasPermission:t.bool,blocklet:t.object.isRequired,loadingRuntimeInfo:t.bool,inService:t.bool.isRequired,showAllDomains:t.bool,updateBlockletDomainAliases:t.func,systemTips:t.node};function K({children:n=null}){return e.jsx(h,{component:"span",sx:{verticalAlign:"bottom"},children:n})}K.propTypes={children:t.node};function he({domain:n,children:i,suffix:o=null,...a}){const{t:s,locale:r}=A(),u=H(),{href:l,accessibility:m,value:p}=n,f=j.useCallback(()=>e.jsx(Ue,{content:je(p),locale:r,style:{marginLeft:"4px",color:u.palette.text.secondary,fontSize:"0.8em"}}),[p,r,u]);return!m||m.loading?e.jsxs(me,{component:"span",...a,children:[e.jsx(L,{title:void 0,placement:"top-end",children:e.jsx(h,{component:"span",children:i})}),f(),e.jsx(K,{children:o}),e.jsx(L,{title:s("blocklet.router.checkUrlAccessible"),placement:"top-end",children:e.jsx(h,{component:"span",className:"status",children:e.jsx(U,{size:13,style:{fontSize:"13px"}})})})]}):m.accessible?e.jsxs(me,{component:"span",...a,children:[e.jsx(h,{component:"a",href:l,target:"_blank",rel:"noopener noreferrer",sx:{color:n.loading?"text.disabled":void 0},children:e.jsx(L,{title:void 0,placement:"top-end",children:e.jsx(h,{component:"span",children:i})})}),f(),e.jsx(K,{children:o})]}):e.jsxs(me,{component:"span",...a,children:[e.jsx(L,{title:s("blocklet.router.urlInaccessible"),placement:"top-end",children:e.jsx(h,{component:"span",children:i})}),!n.loading&&f(),e.jsx(K,{children:o})]})}he.propTypes={domain:ae.isRequired,children:t.any.isRequired,suffix:t.node};const me=Mn(h)`
1
+ import{v as bn,T as vn,V as A,aJ as Cn,H as E,w as te,aN as wn,b9 as Ue}from"./vendor-ux-DfSgTRg5.js";import{j as e,dh as Ne,cP as Sn,ak as h,a6 as U,bu as Rn,T as R,aZ as ye,D as H,J as ie,am as L,aN as $e,W as t,cu as _e,M as Oe,aO as An,aP as kn,cQ as Tn,c5 as In,co as Pn,di as qn,dj as En,b6 as W,P as We,c0 as Ln,b0 as Fn,at as Mn,bb as Bn,bj as zn,dk as Un,dl as Nn,dm as $n,dn as Te,dp as _,dq as _n,z as On,n as Wn,bl as Hn,dr as Vn,bi as Gn}from"./vendor-mui-core-DnR6WYuU.js";import{C as ee,J as Jn,a as Zn,e as Qn,T as je,as as Kn,at as Yn,n as Z}from"./vendor-utils-drLlzTVq.js";import{r as j,e as He,g as Xn}from"./vendor-react-CTtPmzVP.js";import{u as se}from"./useSetState-L-f8mSga.js";import{x as et,q as nt,b as Q,t as tt,E as it}from"./vendor-hooks-cYMUGE4V.js";import{bw as Ve,be as Ge,c3 as st,c4 as Je,Z as F,Y as oe,J as Ie,e as ot,a1 as Pe,c5 as rt,G as at,ag as lt,c6 as Ze,aA as fe,c7 as Qe,bV as ct,c8 as dt,c9 as mt,b0 as ut,q as xe,bz as pt,ca as ft}from"./index-CDZlfV0h.js";import{w as Ke}from"./permission-ZblvP8BW.js";import{u as xt,D as qe}from"./useAsyncRetry--1T7wYe2.js";import{C as re}from"./confirm-D3ZOq19V.js";import{A as ht}from"./actions-Dfiiwkit.js";import{D as gt}from"./delete-confirm-CvVgX89H.js";import{o as Ee}from"./vendor-arcblock-CPCSE54a.js";import{u as Dt}from"./useAsync-VEqKX7rF.js";import{f as N}from"./index-DBs9Ljax.js";import{v as yt}from"./index-BP_Fl0Mu.js";import{g as jt,p as Le}from"./util-DE6S-EwK.js";import{C as bt}from"./click-to-copy-B2HIKJMV.js";const vt=Ve({});vt.interceptors.request.use(n=>{const i=window.blocklet?window.blocklet.prefix:"/";return n.baseURL=i||"",n.url=ee("/api",String(n.url)),n.timeout=2e5,n.params=n.params||{},new URLSearchParams(n.url.split("?")[1]).has("locale")||(n.params.locale=bn()),n},n=>Promise.reject(n));const Ye=(...n)=>Ve(...n),Ct=(n,i)=>i?n?[n,...Array.isArray(i)?i:[i]]:i:n,wt=(n,{width:i=600,height:o=700,name:a="did-domain:popup"}={})=>{const s=window.screenX+(window.innerWidth-i)/2,r=window.screenY+(window.innerHeight-o)/2,u=[`left=${s}`,`top=${r}`,`width=${i}`,`height=${o}`,"resizable=no","scrollbars=yes","status=yes","popup=yes"],l=window.open("",a,u.join(","));if(l===null)throw new Error("Failed to open popup");return l.location.href=Jn(n,{opener:window.location.origin}),l},St="z2qaGosS3rZ7m5ttP3Nd4V4qczR9TryTcRV4p",Xe=async n=>{if(!n||!n?.trim())return null;const i=Ye(),o=new URL(n);o.pathname="__blocklet__.js",o.searchParams.set("type","json");const{data:a}=await i.get(o.toString()),s=a?.componentMountPoints?.find(m=>m.did===St),r=new URL(n);r.pathname=s?.mountPoint;const u=r.toString(),l=ee(u,"/api");return{base:u,api:l}},Rt=Ge({embed:{iconTip:"Click to view subscription details"},buy:{button:{title:"Buy DID Domain"},status:{inProgress:"Please wait while we are processing your request, the domain will be automatically resolved to the current app after the purchase...",success:"Purchase completed!"},error:{failedToCreateSession:"Failed to create session"}}}),At=Ge({embed:{iconTip:"点击查看订阅详情"},buy:{button:{title:"购买 DID 域名"},status:{inProgress:"请稍等,我们正在处理您的请求,购买域名后会自动解析到当前的应用...",success:"购买完成!"},error:{failedToCreateSession:"创建会话失败"}}}),kt={zh:At,en:Rt},Tt=async({didDomainURL:n,delegatee:i,delegateePk:o})=>{const a=await Xe(n);if(!a)return null;const s=Ye({baseURL:a.api}),{data:r}=await s.post("/payment/session",{delegatee:i,delegateePk:o});return{sessionId:r.sessionId,baseURL:a.base}};function It({delegatee:n,delegateePk:i,didDomainURL:o,locale:a,title:s="",onSuccess:r=()=>{},...u}){const{t:l}=A(),[m,p]=et({currentState:1}),f=j.useRef(null),c=nt(async()=>{const d=await Tt({didDomainURL:o,delegatee:n,delegateePk:i});return d},{debounceWait:500,debounceLeading:!0,debounceTrailing:!1,debounceMaxWait:3e3,refreshDeps:[],onError(d){console.error(d)}}),g=Q(d=>{d.data.type==="didDomain.success"&&(r?.({nftDid:d.data?.nftDid,domain:d.data?.domain,chainHost:d.data?.chainHost}),f.current?.close(),f.current=null,p({currentState:4}),setTimeout(()=>{p({currentState:8})},2e3))});tt(()=>{try{window.removeEventListener("message",g),f.current?.close(),f.current=null}catch(d){console.warn("Failed to close popup",d)}});const y=Q(()=>{p({currentState:1})}),x=Q(()=>{if(p({currentState:2}),!c.data){console.error("Failed to create session");return}b({sessionId:c.data.sessionId,baseURL:c.data.baseURL})}),b=Q(({sessionId:d,baseURL:w})=>{window.addEventListener("message",g);const C=new URL(w);C.searchParams.set("sessionId",d),C.searchParams.set("locale",a),C.searchParams.set("embed","1"),f.current=wt(C.toString());const q=setInterval(()=>{f.current?.closed&&(clearInterval(q),y())},1e3);return()=>clearInterval(q)});return e.jsxs(e.Fragment,{children:[e.jsx(Ne,{loading:c.loading,onClick:x,variant:"contained",startIcon:e.jsx(Sn,{}),...u,children:s||l("buy.button.title")}),e.jsxs(Cn,{fullWidth:!0,maxWidth:"xs",open:m.currentState>1&&m.currentState<8,onClose:y,children:[!c.error&&e.jsxs(h,{sx:{display:"flex",alignItems:"center",flexDirection:"column",gap:2},children:[m.currentState===2&&e.jsx(U,{size:50}),m.currentState===4&&e.jsx(Rn,{sx:{color:"primary.main",fontSize:"5rem"}}),m.currentState===2&&e.jsx(R,{children:l("buy.status.inProgress")}),m.currentState===4&&e.jsx(R,{children:l("buy.status.success")})]}),c.error&&e.jsx(ye,{severity:"error",children:l("buy.error.failedToCreateSession")})]})]})}function Pt(n){return e.jsx(vn,{locale:n.locale,translations:kt,children:e.jsx(It,{...n})})}function qt({nftDid:n,didDomainURL:i,locale:o,sx:a={}}){const{t:s}=A(),[r,u]=se({safeIframeRef:null,popoverAnchorEl:null}),l=j.useRef(null),m=H(),p=ie(m.breakpoints.down("md")),f=x=>{u({popoverAnchorEl:x.currentTarget})},c=()=>{u({popoverAnchorEl:null})},g=it(async()=>{const x=await Xe(i);return x?x.base:null});if(!g.value)return null;if(g.loading)return e.jsx(U,{});const y=ee(g.value,`/embed/domain?nft-did=${n}&locale=${o}`);return e.jsxs(e.Fragment,{children:[e.jsx(L,{title:s("embed.iconTip"),children:e.jsx(h,{component:"img",src:ee(i,"/.well-known/service/blocklet/logo"),alt:"logo",onClick:f,sx:[{width:16,height:16},Ct({cursor:"pointer"},a)]})}),e.jsx($e,{id:"popover-info",open:!!r.popoverAnchorEl,anchorEl:r.popoverAnchorEl,onClose:c,anchorOrigin:{vertical:"bottom",horizontal:"right"},children:e.jsx("iframe",{ref:l,title:s("common.subscription"),width:p?"320px":"400px",height:"350px",style:{border:0,display:"block"},src:y})})]})}const Et=n=>["waiting","creating","renewaling"].includes(n);function en({siteId:n,domain:i,onAdd:o=()=>{},children:a=null,did:s,issuing:r=!1,setIssuing:u=()=>{}}){const{t:l}=A(),[m,p]=j.useState(!1),{inService:f}=F(),[c,g]=j.useState(null),{api:y,ws:{useSubscription:x}}=F(),{mode:b,actions:{refreshDomainStatus:d}}=oe(),w=xt(async()=>{const{cert:T}=await y.findCertificateByDomain({input:{domain:i,did:s}});return T}),C=(T,S)=>{T.domain===i&&(u(!1),p(!1),f&&b!=="setup"&&(S==="success"?E.success(l("setup.domain.genCertSuccess",{domain:T.domain})):S==="error"&&E.error(l("setup.domain.genCertFailed",{domain:T.domain,message:T.message}))))};if(j.useEffect(()=>{w.loading||u(Et(w.value?.status))},[w.loading,w.value?.status,u]),x(Ie.BlockletEvents.certError,T=>C(T,"error")),x(Ie.BlockletEvents.certIssued,T=>{w.retry(),d(T.domain),C(T,"success")}),w.loading||w.value?.status==="normal")return"";const q=()=>{p(!1),g(null)},B=async()=>{p(!0);try{await y.issueLetsEncryptCert({input:{siteId:n,domain:i,did:s,inBlockletSetup:b==="setup"}}),o(),u(!0)}catch(T){console.error(T),u(!1)}finally{p(!1),g(null)}},M={title:l("router.cert.genLetsEncryptCert.title"),description:e.jsxs("div",{children:[e.jsx(ye,{severity:"success",children:l("router.cert.genLetsEncryptCert.dnsTip")}),l("router.cert.genLetsEncryptCert.description")]}),confirm:l("common.confirm"),onConfirm:B,onCancel:q},z=T=>{T.stopPropagation(),g(M)};return e.jsxs(e.Fragment,{children:[r?e.jsx(L,{title:l("router.cert.issuing"),children:e.jsx(U,{size:13,style:{fontSize:"13px"}})}):a({loading:m,open:z}),c&&e.jsx(re,{color:"primary",title:c.title,description:c.description,confirm:c.confirm,params:c.params,onConfirm:c.onConfirm,onCancel:c.onCancel})]})}en.propTypes={domain:t.string.isRequired,did:t.string.isRequired,siteId:t.string.isRequired,onAdd:t.func,children:t.any,issuing:t.bool,setIssuing:t.func};function nn({domain:n,domainStatus:i,did:o,onAdd:a=()=>{},children:s=null,issuing:r=!1,setIssuing:u=()=>{},...l}){return st(n)||!Je(n)||Zn(i)||i?.isHttps?"":e.jsx(en,{...l,domain:n,did:o,onAdd:a,issuing:r,setIssuing:u,children:s})}nn.propTypes={domain:t.string.isRequired,domainStatus:t.shape({isHttps:t.bool}).isRequired,did:t.string.isRequired,onAdd:t.func,children:t.any,issuing:t.bool,setIssuing:t.func};function tn({id:n,domain:i,children:o=null,teamDid:a="",onDelete:s=null}){const{t:r}=A(),[u,l]=j.useState(!1),[m,p]=j.useState(null),{api:f}=F(),c=()=>{l(!1),p(null)},g=async()=>{l(!0);try{await f.deleteDomainAlias({input:{id:n,domainAlias:i,teamDid:a}}),s?.(),await ot(2e3)}catch(b){E.error(b.message)}finally{p(null),l(!1)}},y={keyName:i,title:r("router.domainAlias.delete.title"),description:r("router.domainAlias.delete.description",{domain:i}),confirmPlaceholder:r("router.domainAlias.delete.confirmPlaceholder",{domain:i}),confirm:r("common.delete"),onConfirm:g,onCancel:c},x=b=>{b.stopPropagation(),p(y)};return e.jsxs(e.Fragment,{children:[typeof o=="function"?o({loading:u,open:x}):e.jsxs(te,{edge:"end",onClick:x,size:"small",className:"rule-action",color:"error","data-cy":"action-delete-domain-alias",children:[u?e.jsx(U,{size:16}):e.jsx(_e,{style:{fontSize:16}}),r("common.delete")]}),m&&e.jsx(gt,{keyName:m.keyName,title:m.title,description:m.description,confirmPlaceholder:m.confirmPlaceholder,confirm:m.confirm,params:m.params,onConfirm:m.onConfirm,onCancel:m.onCancel})]})}tn.propTypes={id:t.string.isRequired,domain:t.string.isRequired,children:t.any,teamDid:t.string,onDelete:t.func};function sn({site:n,domain:i,blocklet:o,onDelete:a=()=>{}}){const{t:s}=A(),r=i.value===window.location.hostname;return e.jsx(ht,{"data-cy":"domain-actions",size:"large",actions:[({close:u})=>e.jsx(tn,{id:n.id,domain:i.value,teamDid:o?.meta?.did,onDelete:a,children:({open:l})=>e.jsx(L,{title:r?s("blocklet.router.currentDomainTip"):"",children:e.jsx("span",{children:e.jsxs(Oe,{disabled:i.isProtected||r,dense:!0,onClick:m=>{u(),l(m)},"data-cy":"action-toggle-block",children:[e.jsx(An,{style:{minWidth:24,marginRight:8},children:e.jsx(_e,{})}),e.jsx(kn,{primary:s("common.delete")})]},"remove")})})})]})}sn.propTypes={site:t.object.isRequired,domain:t.object.isRequired,blocklet:t.object.isRequired,onDelete:t.func};const ae=t.shape({href:t.string,accessibility:t.shape({loading:t.bool,accessible:t.bool}),domainStatus:t.shape({isHttps:t.bool,matchedCert:t.object}),dns:t.shape({resolved:t.bool,ip:t.string})});function on({certificate:n={}}){const[i,o]=j.useState(null),a=F(),{t:s,locale:r}=A(),u=p=>{o(p.currentTarget)},l=()=>{o(null)},m=!!i;return e.jsxs(e.Fragment,{children:[e.jsx(Tn,{"aria-owns":m?"mouse-over-popover":void 0,onMouseEnter:u,onMouseLeave:l,style:{color:"#44cdc6",fontSize:"1em",cursor:"pointer"}}),e.jsx($e,{id:"mouse-over-popover",style:{pointerEvents:"none"},open:m,anchorEl:i,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:l,disableRestoreFocus:!0,children:e.jsx(In,{children:e.jsxs(Pn,{style:{display:"flex"},children:[e.jsx("div",{children:e.jsx("img",{src:`${a.imgPrefix}/https-certificate-icon.png`,alt:"certificate icon",style:{maxHeight:"100%",maxWidth:"100%"}})}),e.jsxs(R,{component:"div",style:{marginLeft:"16px"},children:[e.jsx(R,{component:"div",style:{fontWeight:"bold"},children:n.domain}),e.jsx(R,{component:"div",children:`${s("common.issuer")}: ${Qn(n,"issuer.commonName","")}`}),e.jsx(R,{component:"div",children:`${s("router.cert.issuedOn")}: ${Pe(n.validFrom,r)}`}),e.jsx(R,{component:"div",children:`${s("router.cert.expiryOn")}: ${Pe(n.validTo,r)}`})]})]})})})]})}on.propTypes={certificate:t.object};function ne({domain:n,filters:i=["domain","http"]}){const{t:o}=A(),{value:a,domainStatus:s}=n;if(!Je(a))return null;let r=null,u=null;const{isHttps:l,matchedCert:m}=s,{dns:{ip:p,isDnsResolved:f,isCnameMatch:c}={}}=s,g=f&&c;rt(a)||(g||p==="127.0.0.1"?r=e.jsx(L,{title:o("router.domain.verify.ok"),children:e.jsx(qe,{color:"success"})}):r=e.jsx(L,{title:o("router.domain.verify.notResolved"),children:e.jsx(qe,{color:"error"})})),g?l?u=e.jsx(on,{certificate:m}):u=e.jsx(L,{title:o("router.domain.https.bad"),children:e.jsx(qn,{style:{color:"#D0021B",fontSize:"1em",cursor:"pointer"}})}):u=e.jsx(L,{title:o("router.domain.verify.notResolved"),children:e.jsx(En,{style:{color:"#D0021B",fontSize:"1em",cursor:"pointer"}})});const y=i.map(x=>x==="domain"?r:x==="http"?u:null);return j.createElement(j.Fragment,null,...y)}ne.propTypes={domain:ae.isRequired,filters:t.array};const Lt=Ke(be,"mutate_blocklets"),Ft=Ke(be,"",at);function pi(n){const{inService:i}=F(),{blocklet:o,loadingRuntimeInfo:a}=oe();let s=Lt;return i&&(s=Ft),e.jsx(s,{...n,blocklet:o,inService:i,loadingRuntimeInfo:a})}const Fe="nft-domain";function be({hasPermission:n=!1,blocklet:i,loadingRuntimeInfo:o=!1,inService:a=!1,showAllDomains:s=!1,updateBlockletDomainAliases:r=()=>{},systemTips:u=null}){const{t:l}=A(),m=ie(d=>d.breakpoints.down("md")),p=j.useMemo(()=>{let d=n;return lt(i)&&(d=d&&a),d},[n,a,i]),{site:f}=i,c=j.useMemo(()=>Ze(i.site?.domainAliases),[i.site?.domainAliases]),g=j.useMemo(()=>c.filter(d=>!fe.isCustomDomain(d.value)),[c]),y=j.useMemo(()=>c.filter(d=>fe.isCustomDomain(d.value)),[c]),x=j.useMemo(()=>y.filter(d=>d.type!==Fe),[y]),b=j.useMemo(()=>y.filter(d=>d.type===Fe),[y]);return e.jsxs(e.Fragment,{children:[e.jsxs(W,{sx:{gap:3},children:[!!b.length&&e.jsx(X,{title:l("common.didDomains"),description:l("common.didDomainsDescription"),domains:b,hasMutatePermission:p,blocklet:i,site:f,mobile:m,showAllDomains:s,updateBlockletDomainAliases:r}),!!x.length&&e.jsx(X,{title:l("common.manualDomains"),description:l("common.manualDomainsDescription"),domains:x,hasMutatePermission:p,blocklet:i,site:f,mobile:m,showAllDomains:s,updateBlockletDomainAliases:r}),!!g.length&&e.jsxs(h,{children:[u,e.jsx(X,{title:l("common.systemDomains"),description:l("common.systemDomainsDescription"),domains:g,hasMutatePermission:p,blocklet:i,site:f,mobile:m,updateBlockletDomainAliases:r})]})]}),!c.length&&(o?e.jsx(U,{size:16}):e.jsx(wn,{children:l("common.empty")}))]})}be.propTypes={hasPermission:t.bool,blocklet:t.object.isRequired,loadingRuntimeInfo:t.bool,inService:t.bool.isRequired,showAllDomains:t.bool,updateBlockletDomainAliases:t.func,systemTips:t.node};function K({children:n=null}){return e.jsx(h,{component:"span",sx:{verticalAlign:"bottom"},children:n})}K.propTypes={children:t.node};function he({domain:n,children:i,suffix:o=null,...a}){const{t:s,locale:r}=A(),u=H(),{href:l,accessibility:m,value:p}=n,f=j.useCallback(()=>e.jsx(Ue,{content:je(p),locale:r,style:{marginLeft:"4px",color:u.palette.text.secondary,fontSize:"0.8em"}}),[p,r,u]);return!m||m.loading?e.jsxs(me,{component:"span",...a,children:[e.jsx(L,{title:void 0,placement:"top-end",children:e.jsx(h,{component:"span",children:i})}),f(),e.jsx(K,{children:o}),e.jsx(L,{title:s("blocklet.router.checkUrlAccessible"),placement:"top-end",children:e.jsx(h,{component:"span",className:"status",children:e.jsx(U,{size:13,style:{fontSize:"13px"}})})})]}):m.accessible?e.jsxs(me,{component:"span",...a,children:[e.jsx(h,{component:"a",href:l,target:"_blank",rel:"noopener noreferrer",sx:{color:n.loading?"text.disabled":void 0},children:e.jsx(L,{title:void 0,placement:"top-end",children:e.jsx(h,{component:"span",children:i})})}),f(),e.jsx(K,{children:o})]}):e.jsxs(me,{component:"span",...a,children:[e.jsx(L,{title:s("blocklet.router.urlInaccessible"),placement:"top-end",children:e.jsx(h,{component:"span",children:i})}),!n.loading&&f(),e.jsx(K,{children:o})]})}he.propTypes={domain:ae.isRequired,children:t.any.isRequired,suffix:t.node};const me=Mn(h)`
2
2
  display: inline-block;
3
3
  vertical-align: middle;
4
4
 
@@ -1 +1 @@
1
- import{r as m}from"./vendor-react-CTtPmzVP.js";import{V as n}from"./vendor-ux-DfSgTRg5.js";import{Y as p,Z as l,ag as c,q as u}from"./index-DwK0GIrs.js";import{a as x,b as d}from"./domain-action-card-B9GypCwf.js";import{j as t,ak as k,b6 as f,aZ as h}from"./vendor-mui-core-DnR6WYuU.js";import"./vendor-utils-drLlzTVq.js";import"./vendor-hooks-cYMUGE4V.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CPCSE54a.js";import"./useSetState-L-f8mSga.js";import"./permission-PnySJGEl.js";import"./session-nLCSznMa.js";import"./useAsyncRetry--1T7wYe2.js";import"./useAsync-xXSiXzwr.js";import"./confirm-btfSjmnK.js";import"./index-DBs9Ljax.js";import"./actions-Dfiiwkit.js";import"./delete-confirm-dqp-ol9_.js";import"./click-to-copy-B2HIKJMV.js";import"./useAsync-VEqKX7rF.js";import"./index-BP_Fl0Mu.js";import"./util-D27AtnBb.js";import"./engine-0ct2xW2c.js";function z(){const{blocklet:o,actions:{updateBlockletDomainAliases:i}}=p(),{inService:r}=l(),{t:e}=n(),a=m.useMemo(()=>{let s=!0;return c(o)&&(s=s&&r),s},[r,o]);return t.jsxs(k,{component:f,sx:{gap:3,maxWidth:820},children:[t.jsxs(t.Fragment,{children:[u.isAccessible(o.status)===!1&&t.jsx(h,{severity:"warning",children:e("blocklet.router.noRunning")}),a&&t.jsx(x,{blocklet:o,updateBlockletDomainAliases:i,connectDomainProps:{shouldCheckDomain:!0}})]}),t.jsx(d,{showAllDomains:!0,updateBlockletDomainAliases:i})]})}export{z as default};
1
+ import{r as m}from"./vendor-react-CTtPmzVP.js";import{V as n}from"./vendor-ux-DfSgTRg5.js";import{Y as p,Z as l,ag as c,q as u}from"./index-CDZlfV0h.js";import{a as x,b as d}from"./domain-action-card-BTzoEvCg.js";import{j as t,ak as k,b6 as f,aZ as h}from"./vendor-mui-core-DnR6WYuU.js";import"./vendor-utils-drLlzTVq.js";import"./vendor-hooks-cYMUGE4V.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CPCSE54a.js";import"./useSetState-L-f8mSga.js";import"./permission-ZblvP8BW.js";import"./session-BqnhIOZD.js";import"./useAsyncRetry--1T7wYe2.js";import"./useAsync-xXSiXzwr.js";import"./confirm-D3ZOq19V.js";import"./index-DBs9Ljax.js";import"./actions-Dfiiwkit.js";import"./delete-confirm-CvVgX89H.js";import"./click-to-copy-B2HIKJMV.js";import"./useAsync-VEqKX7rF.js";import"./index-BP_Fl0Mu.js";import"./util-DE6S-EwK.js";import"./engine-Ctj5gh6M.js";function z(){const{blocklet:o,actions:{updateBlockletDomainAliases:i}}=p(),{inService:r}=l(),{t:e}=n(),a=m.useMemo(()=>{let s=!0;return c(o)&&(s=s&&r),s},[r,o]);return t.jsxs(k,{component:f,sx:{gap:3,maxWidth:820},children:[t.jsxs(t.Fragment,{children:[u.isAccessible(o.status)===!1&&t.jsx(h,{severity:"warning",children:e("blocklet.router.noRunning")}),a&&t.jsx(x,{blocklet:o,updateBlockletDomainAliases:i,connectDomainProps:{shouldCheckDomain:!0}})]}),t.jsx(d,{showAllDomains:!0,updateBlockletDomainAliases:i})]})}export{z as default};
@@ -1,4 +1,4 @@
1
- import{V as M,aa as q,_ as w,H as C,J as Q,aL as J}from"./vendor-ux-DfSgTRg5.js";import{j as t,b6 as f,bu as X,cl as Z,T as b,Q as T,bb as ee,ak as B,z as O,a6 as te,at as se}from"./vendor-mui-core-DnR6WYuU.js";import{r as n,j as ie}from"./vendor-react-CTtPmzVP.js";import{T as g}from"./vendor-utils-drLlzTVq.js";import{u as ne,m as h,o as $,c as j,H as oe,aV as re}from"./index-DwK0GIrs.js";import{l as ae}from"./vendor-arcblock-CPCSE54a.js";import{K as ce}from"./landing-page-BE08UeOH.js";import{f as _}from"./index-DBs9Ljax.js";import{g as D}from"./get-safe-url-BW-k89rQ.js";import"./vendor-hooks-cYMUGE4V.js";import"./lottie-web-4koyQiv_.js";const le=se.form`
1
+ import{V as M,aa as q,_ as w,H as C,J as Q,aL as J}from"./vendor-ux-DfSgTRg5.js";import{j as t,b6 as f,bu as X,cl as Z,T as b,Q as T,bb as ee,ak as B,z as O,a6 as te,at as se}from"./vendor-mui-core-DnR6WYuU.js";import{r as n,j as ie}from"./vendor-react-CTtPmzVP.js";import{T as g}from"./vendor-utils-drLlzTVq.js";import{u as ne,m as h,o as $,c as j,H as oe,aV as re}from"./index-CDZlfV0h.js";import{l as ae}from"./vendor-arcblock-CPCSE54a.js";import{K as ce}from"./landing-page-CBmSfoFm.js";import{f as _}from"./index-DBs9Ljax.js";import{g as D}from"./get-safe-url-BIGE7_Qp.js";import"./vendor-hooks-cYMUGE4V.js";import"./lottie-web-4koyQiv_.js";const le=se.form`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  align-items: center;
@@ -0,0 +1 @@
1
+ import{bS as e}from"./index-CDZlfV0h.js";var i=e();export{i as e};
@@ -1 +1 @@
1
- import{j as e,a6 as P,ak as E}from"./vendor-mui-core-DnR6WYuU.js";import{r as j,u as k}from"./vendor-react-CTtPmzVP.js";import{o as T}from"./vendor-arcblock-CPCSE54a.js";import{V as C,H as d,ar as W}from"./vendor-ux-DfSgTRg5.js";import{l as I,c as R,j as S,a as v,d as U}from"./index-DwK0GIrs.js";import{K as L}from"./landing-page-BE08UeOH.js";import{w as N}from"./wrap-locale-Dfmt13Mn.js";import{g as b}from"./get-safe-url-BW-k89rQ.js";import"./vendor-utils-drLlzTVq.js";import"./vendor-hooks-cYMUGE4V.js";import"./lottie-web-4koyQiv_.js";import"./index-D-q1dCoY.js";function _({SessionContext:n,webWalletUrl:a,onSuccess:o}){const{api:t,session:i}=j.useContext(n),{t:s,locale:h}=C(),f=k(),{searchParams:p}=new URL(window.location.href),l=p.get("redirect"),g=async(r,w)=>{o(r,w),await i.refresh(),d.success(s("exchangePassport.success")),setTimeout(()=>{if(l){const c=decodeURIComponent(l);c.startsWith(R.WELLKNOWN_SERVICE_PATH_PREFIX)?f(c,{replace:!0}):window.location.href=b(c)}else window.location.href=window.env.pathPrefix||window.env.apiPrefix||"/"},3e3)},u=r=>{d.error(r.message)},m={},x=p.get("componentId");return x&&(m.componentId=x),i.loading?e.jsx(T,{children:e.jsx(P,{})}):e.jsx(L,{did:window?.blocklet?.appPid||window?.env?.appPid,children:e.jsx(E,{sx:{maxWidth:"100%",height:"100%"},children:e.jsx(I,{popup:!0,open:!0,className:"connect",action:"exchange-passport",checkFn:t.get,checkTimeout:10*60*1e3,webWalletUrl:a,onSuccess:g,onError:u,locale:h,messages:{title:s("exchangePassport.dialog.title"),scan:s("exchangePassport.dialog.scan"),confirm:s("exchangePassport.dialog.confirm"),success:s("exchangePassport.dialog.success")},extraParams:m,extraContent:null,hideCloseButton:!0})})})}const B=N(_);function G(){const n=W(),a=(o,t)=>{o.sessionToken&&(v(t(o.sessionToken)),U(t(o.refreshToken)))};return e.jsx(B,{SessionContext:S,webWalletUrl:n,onSuccess:a})}export{G as default};
1
+ import{j as e,a6 as P,ak as E}from"./vendor-mui-core-DnR6WYuU.js";import{r as j,u as k}from"./vendor-react-CTtPmzVP.js";import{o as T}from"./vendor-arcblock-CPCSE54a.js";import{V as C,H as d,ar as W}from"./vendor-ux-DfSgTRg5.js";import{l as I,c as R,j as S,a as v,d as U}from"./index-CDZlfV0h.js";import{K as L}from"./landing-page-CBmSfoFm.js";import{w as N}from"./wrap-locale-DJbgvexA.js";import{g as b}from"./get-safe-url-BIGE7_Qp.js";import"./vendor-utils-drLlzTVq.js";import"./vendor-hooks-cYMUGE4V.js";import"./lottie-web-4koyQiv_.js";import"./index-DbhZjmcw.js";function _({SessionContext:n,webWalletUrl:a,onSuccess:o}){const{api:t,session:i}=j.useContext(n),{t:s,locale:h}=C(),f=k(),{searchParams:p}=new URL(window.location.href),l=p.get("redirect"),g=async(r,w)=>{o(r,w),await i.refresh(),d.success(s("exchangePassport.success")),setTimeout(()=>{if(l){const c=decodeURIComponent(l);c.startsWith(R.WELLKNOWN_SERVICE_PATH_PREFIX)?f(c,{replace:!0}):window.location.href=b(c)}else window.location.href=window.env.pathPrefix||window.env.apiPrefix||"/"},3e3)},u=r=>{d.error(r.message)},m={},x=p.get("componentId");return x&&(m.componentId=x),i.loading?e.jsx(T,{children:e.jsx(P,{})}):e.jsx(L,{did:window?.blocklet?.appPid||window?.env?.appPid,children:e.jsx(E,{sx:{maxWidth:"100%",height:"100%"},children:e.jsx(I,{popup:!0,open:!0,className:"connect",action:"exchange-passport",checkFn:t.get,checkTimeout:10*60*1e3,webWalletUrl:a,onSuccess:g,onError:u,locale:h,messages:{title:s("exchangePassport.dialog.title"),scan:s("exchangePassport.dialog.scan"),confirm:s("exchangePassport.dialog.confirm"),success:s("exchangePassport.dialog.success")},extraParams:m,extraContent:null,hideCloseButton:!0})})})}const B=N(_);function G(){const n=W(),a=(o,t)=>{o.sessionToken&&(v(t(o.sessionToken)),U(t(o.refreshToken)))};return e.jsx(B,{SessionContext:S,webWalletUrl:n,onSuccess:a})}export{G as default};
@@ -1,4 +1,4 @@
1
- import{D as S,j as o,a6 as B,T,bm as k}from"./vendor-mui-core-DnR6WYuU.js";import{o as M}from"./vendor-arcblock-CPCSE54a.js";import{V as P,aJ as F}from"./vendor-ux-DfSgTRg5.js";import{r as w}from"./vendor-react-CTtPmzVP.js";import{x as E}from"./vendor-hooks-cYMUGE4V.js";import{c0 as D,ax as I}from"./index-DwK0GIrs.js";import"./vendor-utils-drLlzTVq.js";import"./lottie-web-4koyQiv_.js";const{Elements:R,PaymentElement:z,useElements:N,useStripe:O,loadStripe:V,LinkAuthenticationElement:W}=globalThis.__STRIPE_COMPONENTS__,$=k("div")`
1
+ import{D as S,j as o,a6 as B,T,bm as k}from"./vendor-mui-core-DnR6WYuU.js";import{o as M}from"./vendor-arcblock-CPCSE54a.js";import{V as P,aJ as F}from"./vendor-ux-DfSgTRg5.js";import{r as w}from"./vendor-react-CTtPmzVP.js";import{x as E}from"./vendor-hooks-cYMUGE4V.js";import{c0 as D,ax as I}from"./index-CDZlfV0h.js";import"./vendor-utils-drLlzTVq.js";import"./lottie-web-4koyQiv_.js";const{Elements:R,PaymentElement:z,useElements:N,useStripe:O,loadStripe:V,LinkAuthenticationElement:W}=globalThis.__STRIPE_COMPONENTS__,$=k("div")`
2
2
  width: 100%;
3
3
  opacity: 0;
4
4
  transition: opacity 300ms ease;
@@ -1,4 +1,4 @@
1
- import{j as e,ak as s,a6 as w,bb as B,cC as N,at as I,W as d}from"./vendor-mui-core-DnR6WYuU.js";import{r as l}from"./vendor-react-CTtPmzVP.js";import{C as v}from"./vendor-utils-drLlzTVq.js";import{aT as L}from"./vendor-ux-DfSgTRg5.js";import{y as $,u as E,l as T}from"./index-DwK0GIrs.js";import{W as z}from"./did-address-DqhneWXa.js";import{a as A}from"./page-header-CHAwrgX-.js";import{S as D}from"./layout-BPsPNtH9.js";import{S as F}from"./step-actions-Cfagh9Pk.js";import{S as m}from"./button-D6RwAFss.js";import"./vendor-hooks-cYMUGE4V.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CPCSE54a.js";import"./content-layout-DmSBGGVm.js";import"./use-mobile-D5clNlrm.js";function P({onNext:n=()=>{},onPrevious:u=()=>{}}){const{locale:x,t}=l.useContext(L),{blocklet:a,gas:c,tokenInfo:f,actions:h}=$(),{api:j}=E(),[y,o]=l.useState(!1),{need:p="",current:g="",owe:r=99999,deficiency:b,symbol:k="",endpoint:i}=c||{},{origin:C="/"}=i?new URL(i):{};l.useEffect(()=>{const W=setInterval(()=>{h.refreshFuel()},2e3);return()=>{clearInterval(W)}},[]);const S=()=>{o(!1)};return c?e.jsxs(R,{children:[e.jsx("div",{className:"header",children:e.jsx(A,{title:t("setup.fuel.title"),onClickBack:u})}),e.jsxs(s,{className:"qr-body",children:[e.jsxs(s,{className:"tip",sx:{mb:6},children:[t("setup.fuel.tipStart").replace("slot",""),e.jsx("span",{className:"amount",children:`${p} ${k}`}),t("setup.fuel.tipEnd")]}),e.jsx(s,{sx:{fontSize:16,fontWeight:"fontWeightBold",mb:.5},children:t("setup.fuel.addressTitle")}),e.jsxs(s,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(z,{className:"address",did:a.appDid}),e.jsx(B,{style:{lineHeight:1},target:"_blank",href:v(C,"/explorer/accounts/",a.appDid),underline:"hover",children:e.jsx(N,{className:"icon-launch"})})]}),e.jsx(s,{sx:{my:2},children:e.jsx(m,{color:"primary",onClick:()=>o(!0),disabled:!r,children:t("setup.fuel.fuelApp")})}),e.jsx(T,{popup:!0,open:y,action:"fuel",checkFn:j.get,checkTimeout:10*60*1e3,onSuccess:S,onClose:()=>o(!1),locale:x,messages:{title:t("setup.connect.title"),scan:t("setup.connect.scan"),confirm:t("setup.connect.confirm"),success:t("setup.connect.success")},extraParams:{amount:b,...f,endpoint:i}}),e.jsxs(s,{sx:{display:"flex",color:"text.secondary"},children:[e.jsxs(s,{sx:{display:"flex"},children:[e.jsxs(s,{children:[t("setup.fuel.need"),":"]}),e.jsx(s,{sx:{ml:.5,color:"primary.main",fontWeight:"fontWeightBold"},children:p})]}),e.jsxs(s,{sx:{display:"flex",ml:3},children:[e.jsxs(s,{children:[t("setup.fuel.current"),":"]}),e.jsx(s,{sx:{ml:.5,color:r>0?"error.main":"primary.main",fontWeight:"fontWeightBold"},children:g})]})]})]}),e.jsx(F,{mt:8,children:e.jsx(m,{disabled:r>0,onClick:()=>n(),children:t("setup.next")})})]}):e.jsx(s,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"},children:e.jsx(w,{})})}P.propTypes={onNext:d.func,onPrevious:d.func};const R=I(D)`
1
+ import{j as e,ak as s,a6 as w,bb as B,cC as N,at as I,W as d}from"./vendor-mui-core-DnR6WYuU.js";import{r as l}from"./vendor-react-CTtPmzVP.js";import{C as v}from"./vendor-utils-drLlzTVq.js";import{aT as L}from"./vendor-ux-DfSgTRg5.js";import{y as $,u as E,l as T}from"./index-CDZlfV0h.js";import{W as z}from"./did-address-DqhneWXa.js";import{a as A}from"./page-header-CHAwrgX-.js";import{S as D}from"./layout-BFN2VPgc.js";import{S as F}from"./step-actions-CNIiIH7j.js";import{S as m}from"./button-D6RwAFss.js";import"./vendor-hooks-cYMUGE4V.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CPCSE54a.js";import"./content-layout-DmSBGGVm.js";import"./use-mobile-D5clNlrm.js";function P({onNext:n=()=>{},onPrevious:u=()=>{}}){const{locale:x,t}=l.useContext(L),{blocklet:a,gas:c,tokenInfo:f,actions:h}=$(),{api:j}=E(),[y,o]=l.useState(!1),{need:p="",current:g="",owe:r=99999,deficiency:b,symbol:k="",endpoint:i}=c||{},{origin:C="/"}=i?new URL(i):{};l.useEffect(()=>{const W=setInterval(()=>{h.refreshFuel()},2e3);return()=>{clearInterval(W)}},[]);const S=()=>{o(!1)};return c?e.jsxs(R,{children:[e.jsx("div",{className:"header",children:e.jsx(A,{title:t("setup.fuel.title"),onClickBack:u})}),e.jsxs(s,{className:"qr-body",children:[e.jsxs(s,{className:"tip",sx:{mb:6},children:[t("setup.fuel.tipStart").replace("slot",""),e.jsx("span",{className:"amount",children:`${p} ${k}`}),t("setup.fuel.tipEnd")]}),e.jsx(s,{sx:{fontSize:16,fontWeight:"fontWeightBold",mb:.5},children:t("setup.fuel.addressTitle")}),e.jsxs(s,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(z,{className:"address",did:a.appDid}),e.jsx(B,{style:{lineHeight:1},target:"_blank",href:v(C,"/explorer/accounts/",a.appDid),underline:"hover",children:e.jsx(N,{className:"icon-launch"})})]}),e.jsx(s,{sx:{my:2},children:e.jsx(m,{color:"primary",onClick:()=>o(!0),disabled:!r,children:t("setup.fuel.fuelApp")})}),e.jsx(T,{popup:!0,open:y,action:"fuel",checkFn:j.get,checkTimeout:10*60*1e3,onSuccess:S,onClose:()=>o(!1),locale:x,messages:{title:t("setup.connect.title"),scan:t("setup.connect.scan"),confirm:t("setup.connect.confirm"),success:t("setup.connect.success")},extraParams:{amount:b,...f,endpoint:i}}),e.jsxs(s,{sx:{display:"flex",color:"text.secondary"},children:[e.jsxs(s,{sx:{display:"flex"},children:[e.jsxs(s,{children:[t("setup.fuel.need"),":"]}),e.jsx(s,{sx:{ml:.5,color:"primary.main",fontWeight:"fontWeightBold"},children:p})]}),e.jsxs(s,{sx:{display:"flex",ml:3},children:[e.jsxs(s,{children:[t("setup.fuel.current"),":"]}),e.jsx(s,{sx:{ml:.5,color:r>0?"error.main":"primary.main",fontWeight:"fontWeightBold"},children:g})]})]})]}),e.jsx(F,{mt:8,children:e.jsx(m,{disabled:r>0,onClick:()=>n(),children:t("setup.next")})})]}):e.jsx(s,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"},children:e.jsx(w,{})})}P.propTypes={onNext:d.func,onPrevious:d.func};const R=I(D)`
2
2
  .qr-body {
3
3
  width: 580px;
4
4
  ${n=>n.theme.breakpoints.down("md")} {
@@ -1 +1 @@
1
- import{D as E,j as e,Q as S,cm as P,bu as R,ak as r,T as c,a6 as _}from"./vendor-mui-core-DnR6WYuU.js";import{u as I,s as L,c as N,V as p,t as T,b9 as W}from"./index-DwK0GIrs.js";import{o as A}from"./vendor-arcblock-CPCSE54a.js";import{aT as D}from"./vendor-ux-DfSgTRg5.js";import{g as U,b as j}from"./vendor-hooks-cYMUGE4V.js";import{u as z,r as i,j as F}from"./vendor-react-CTtPmzVP.js";import{K as a}from"./landing-page-BE08UeOH.js";import{C as K}from"./vendor-utils-drLlzTVq.js";import{u as M}from"./use-window-close-DDL8fcOm.js";import"./lottie-web-4koyQiv_.js";function Z(){const m=z(),l=i.useRef(null),{t:s,locale:d}=i.useContext(D),{api:x,connectApi:f}=I(),[h]=F(),w=E(),k=M(),n=U({ready:!1,success:!1,error:null,invalidSession:!1}),b=()=>{try{const t=new URL(window.location.href);if(t.hash.includes("invalid")){n.invalidSession=!0;return}const u=t.searchParams.get("__connect_url__"),v=T(u);if(!W(v))throw new Error("No token");n.ready=!0}catch{n.invalidSession=!0,m("#invalid",{replace:!0})}};i.useLayoutEffect(()=>b(),[]);const C=j(t=>{n.error=t.message,window.opener?.postMessage({type:"connect-endpoint-message",error:n.error},"*"),m("#invalid",{replace:!0})}),g=j(()=>{window.opener?.postMessage({type:"connect-endpoint-message",success:!0},"*"),n.success=!0}),o=h.get("source")||"Generate Access Key";i.useEffect(()=>{l.current&&n.ready&&f.open({locale:d,containerEl:l.current,action:"gen-access-key",extraParams:{remark:o},checkFn:x.get,saveConnect:!1,forceConnected:!1,className:"connect",popup:!1,baseUrl:window.location.origin,prefix:K(window.location.origin,N.WELLKNOWN_SERVICE_PATH_PREFIX,L),messages:{title:s("connectCli.title"),scan:s("connectCli.scan"),confirm:s("auth.confirm"),success:s("connectCli.success")},onSuccess:g,onError:C},{locale:d})},[f,n.ready,x,C,g,d,s,o]);const y=e.jsx(S,{variant:"outlined",color:"primary",size:"small",startIcon:e.jsx(P,{}),href:"/",style:{borderRadius:4},children:s("connectCli.home")});if(n.invalidSession)return e.jsx(a,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(p,{style:{backgroundColor:"transparent"},status:"error",title:s("connectCli.invalidSession"),description:s("connectCli.invalidSessionDesc"),extra:y})},"invalid");if(n.error){const t=n.error,u=y;return e.jsx(a,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(p,{style:{backgroundColor:"transparent"},status:"error",title:s("connectCli.connectionError"),description:t,extra:u})},"error")}return n.success?(h.has("closeOnSuccess")&&k(),e.jsx(a,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(p,{style:{backgroundColor:"transparent"},status:"info",icon:e.jsx(R,{style:{color:w.palette.success.main,fontSize:72}}),title:s("connectCli.success",{source:o}),description:`${s("connectCli.successDesc",{source:o})} ${s("connectCli.upload")}`})},"success")):n.ready?e.jsx(a,{did:window.blocklet?.appPid,standalone:!0,children:e.jsxs(r,{sx:{maxWidth:"100%",height:"100%"},children:[e.jsxs(r,{sx:{mb:5},children:[e.jsx(c,{variant:"h4",component:"h1",sx:{mb:1,fontWeight:"bold",textAlign:"center"},children:s("connectCli.tips.title")}),e.jsxs(r,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"center"},children:[e.jsx(c,{sx:{color:"text.secondary"},children:s("connectCli.tips.item1")}),e.jsx(c,{sx:{color:"text.secondary"},children:s("connectCli.tips.item2")}),e.jsx(c,{sx:{color:"text.secondary"},children:s("connectCli.tips.item3")})]})]}),e.jsx(r,{sx:{display:"inline-block"},ref:l})]})},"ready"):e.jsx(A,{children:e.jsx(_,{})})}export{Z as default};
1
+ import{D as E,j as e,Q as S,cm as P,bu as R,ak as r,T as c,a6 as _}from"./vendor-mui-core-DnR6WYuU.js";import{u as I,s as L,c as N,V as p,t as T,b9 as W}from"./index-CDZlfV0h.js";import{o as A}from"./vendor-arcblock-CPCSE54a.js";import{aT as D}from"./vendor-ux-DfSgTRg5.js";import{g as U,b as j}from"./vendor-hooks-cYMUGE4V.js";import{u as z,r as i,j as F}from"./vendor-react-CTtPmzVP.js";import{K as a}from"./landing-page-CBmSfoFm.js";import{C as K}from"./vendor-utils-drLlzTVq.js";import{u as M}from"./use-window-close-DDL8fcOm.js";import"./lottie-web-4koyQiv_.js";function Z(){const m=z(),l=i.useRef(null),{t:s,locale:d}=i.useContext(D),{api:x,connectApi:f}=I(),[h]=F(),w=E(),k=M(),n=U({ready:!1,success:!1,error:null,invalidSession:!1}),b=()=>{try{const t=new URL(window.location.href);if(t.hash.includes("invalid")){n.invalidSession=!0;return}const u=t.searchParams.get("__connect_url__"),v=T(u);if(!W(v))throw new Error("No token");n.ready=!0}catch{n.invalidSession=!0,m("#invalid",{replace:!0})}};i.useLayoutEffect(()=>b(),[]);const C=j(t=>{n.error=t.message,window.opener?.postMessage({type:"connect-endpoint-message",error:n.error},"*"),m("#invalid",{replace:!0})}),g=j(()=>{window.opener?.postMessage({type:"connect-endpoint-message",success:!0},"*"),n.success=!0}),o=h.get("source")||"Generate Access Key";i.useEffect(()=>{l.current&&n.ready&&f.open({locale:d,containerEl:l.current,action:"gen-access-key",extraParams:{remark:o},checkFn:x.get,saveConnect:!1,forceConnected:!1,className:"connect",popup:!1,baseUrl:window.location.origin,prefix:K(window.location.origin,N.WELLKNOWN_SERVICE_PATH_PREFIX,L),messages:{title:s("connectCli.title"),scan:s("connectCli.scan"),confirm:s("auth.confirm"),success:s("connectCli.success")},onSuccess:g,onError:C},{locale:d})},[f,n.ready,x,C,g,d,s,o]);const y=e.jsx(S,{variant:"outlined",color:"primary",size:"small",startIcon:e.jsx(P,{}),href:"/",style:{borderRadius:4},children:s("connectCli.home")});if(n.invalidSession)return e.jsx(a,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(p,{style:{backgroundColor:"transparent"},status:"error",title:s("connectCli.invalidSession"),description:s("connectCli.invalidSessionDesc"),extra:y})},"invalid");if(n.error){const t=n.error,u=y;return e.jsx(a,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(p,{style:{backgroundColor:"transparent"},status:"error",title:s("connectCli.connectionError"),description:t,extra:u})},"error")}return n.success?(h.has("closeOnSuccess")&&k(),e.jsx(a,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(p,{style:{backgroundColor:"transparent"},status:"info",icon:e.jsx(R,{style:{color:w.palette.success.main,fontSize:72}}),title:s("connectCli.success",{source:o}),description:`${s("connectCli.successDesc",{source:o})} ${s("connectCli.upload")}`})},"success")):n.ready?e.jsx(a,{did:window.blocklet?.appPid,standalone:!0,children:e.jsxs(r,{sx:{maxWidth:"100%",height:"100%"},children:[e.jsxs(r,{sx:{mb:5},children:[e.jsx(c,{variant:"h4",component:"h1",sx:{mb:1,fontWeight:"bold",textAlign:"center"},children:s("connectCli.tips.title")}),e.jsxs(r,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"center"},children:[e.jsx(c,{sx:{color:"text.secondary"},children:s("connectCli.tips.item1")}),e.jsx(c,{sx:{color:"text.secondary"},children:s("connectCli.tips.item2")}),e.jsx(c,{sx:{color:"text.secondary"},children:s("connectCli.tips.item3")})]})]}),e.jsx(r,{sx:{display:"inline-block"},ref:l})]})},"ready"):e.jsx(A,{children:e.jsx(_,{})})}export{Z as default};
@@ -1 +1 @@
1
- import{j as e,ak as a,T as w,a6 as M,b6 as Y,Q as K,bb as Z,D as X,aZ as W,a_ as F,bu as ee}from"./vendor-mui-core-DnR6WYuU.js";import{r as d,u as se,j as ne}from"./vendor-react-CTtPmzVP.js";import{b6 as te,ba as oe,bb as re,bc as ie,bd as ae,u as ce,o as le,t as H,V as ue,am as de,c as pe}from"./index-DwK0GIrs.js";import{n as S,ac as he,C as O}from"./vendor-utils-drLlzTVq.js";import{g as J,b as p,z as xe,w as fe}from"./vendor-hooks-cYMUGE4V.js";import{M as $,V as Q,x as ge,K as V,P as me}from"./vendor-ux-DfSgTRg5.js";import{o as je}from"./vendor-arcblock-CPCSE54a.js";import{K as we}from"./landing-page-BE08UeOH.js";import{u as ye}from"./use-window-close-DDL8fcOm.js";import"./lottie-web-4koyQiv_.js";function Ce({requestAppInfo:l,currentAppInfo:y}){return e.jsxs(a,{sx:{textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",gap:2},children:[e.jsxs(a,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx($,{src:y.appLogo,alt:"Server",width:48,height:48,useProxyFallback:!0}),e.jsxs(a,{sx:{mx:2,display:"flex",alignItems:"center","& .dot":{width:8,height:8,borderRadius:"50%",bgcolor:"grey.500",mx:.5}},children:[e.jsx(a,{className:"dot"}),e.jsx(a,{className:"dot"}),e.jsx(a,{className:"dot"})]}),e.jsx($,{src:l.appLogo,alt:l.appName,width:48,height:48,useProxyFallback:!0})]}),e.jsxs(w,{sx:{mb:1,fontSize:"1.2rem"},children:["Authorize"," ",e.jsx(a,{component:"span",sx:{color:"primary.main"},children:l.appName})]})]})}const Ae={en:{notThis:"Not you?",useAnother:"Use another account",authorize:"Authorize",connect:"Connect",cancel:"Cancel"},zh:{notThis:"不是这个?",useAnother:"使用其他账户",authorize:"授权",connect:"Connect",cancel:"取消"}};function be({session:l,requestAppInfo:y,currentAppInfo:T,children:k=null,userInfo:s=void 0,hideSwitchConnect:N=!1,hideAuthorize:t=!1,hideCancel:L=!1,hideButton:_=!1,notThisText:I=void 0,authorizeText:o=void 0,connectText:c=void 0,cancelText:P=void 0,useAnotherText:C=void 0,slotProps:h=void 0,onConnect:R=S,onAuthorize:f=S,onSwitchConnect:v=S,onSwitchPassport:A=S,onCancel:D=S,ref:E,disableAuthorizeButton:z=!1}){const r=J({loading:!1}),{locale:b="en"}=Q()||{},g=p((B,j={})=>ge(Ae,B,b,"en",j)),x=p(()=>{r.loading=!1}),U=p(()=>{r.loading=!0,R?.(x)}),q=p(()=>{r.loading=!0,v?.(x)}),n=p(()=>{r.loading=!0,f?.(x)}),i=p(()=>{r.loading=!0,A?.(x)}),u=p(()=>{D?.()});if(d.useImperativeHandle(E,()=>({closeLoading:x})),l.loading||!l.initialized)return e.jsx(je,{children:e.jsx(M,{})});const m=s??l?.user;return e.jsx(we,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(a,{...h?.root,sx:V({width:420,maxWidth:"100%"},h?.root?.sx),children:e.jsx(te,{hideCloseButton:!0,...h?.didConnectContainer,children:e.jsxs(a,{...h?.contentContainer,sx:V({display:"flex",flexDirection:"column",gap:1.5,p:{xs:2,lg:3,xl:4},pt:{xs:3,xl:4},bgcolor:"background.paper"},h?.contentContainer?.sx),children:[e.jsx(Ce,{requestAppInfo:y,currentAppInfo:T}),m?e.jsxs(e.Fragment,{children:[e.jsx(oe,{user:m,showDid:!0,cardType:ie.Detailed,infoType:re.Minimal,renderTopRightContent:()=>e.jsx(ae,{user:m,switchPassport:i})}),e.jsx(a,{})]}):null,k,_?null:e.jsxs(e.Fragment,{children:[e.jsx(a,{sx:{border:"1px solid",borderColor:"divider",borderRadius:2,overflow:"hidden",my:1}}),e.jsxs(Y,{direction:"row",spacing:2,children:[L?null:e.jsx(K,{color:"inherit",variant:"outlined",size:"large",fullWidth:!0,onClick:u,sx:{color:"grey.500"},children:P||g("cancel")}),m&&!t?e.jsxs(K,{variant:"contained",size:"large",fullWidth:!0,onClick:n,disabled:r.loading||z,children:[r.loading?e.jsx(M,{size:20,sx:{mr:1}}):null,o||g("authorize")]}):e.jsxs(K,{variant:"contained",size:"large",fullWidth:!0,disabled:r.loading||z,onClick:U,children:[r.loading?e.jsx(M,{size:20,sx:{mr:1}}):null,c||g("connect")]})]})]}),N||!m?null:e.jsx(a,{sx:{textAlign:"center"},children:e.jsxs(w,{variant:"body2",sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:1},children:[I||g("notThis")," ",e.jsx(Z,{underline:"hover",onClick:q,sx:{cursor:"pointer"},children:C||g("useAnother")})]})})]})})})})}const Se=O(window.location.origin,pe.WELLKNOWN_BLOCKLET_USER_PATH,"settings#user-center-access-key-setting"),G=3e3;function De(){const l=d.useRef(null),[y,T]=d.useState(),[k]=xe({targetDate:y}),{session:s}=ce(),N=X(),t=J({ready:!1,success:!1,error:null,invalidSession:!1,token:null}),[L,_]=fe("currentUserInfo",{defaultValue:null}),I=se(),{t:o}=Q(),[c]=ne(),P=ye(),[,C]=d.useState(!0),[h,R]=d.useState({appName:c.get("cli")?c.get("appName")??o("aigne.cli"):"",appLogo:c.get("cli")?c.get("appLogo"):""}),f=c.get("required_roles")||"",v=d.useMemo(()=>{const n=f.split(",")||[];if(n.length===0)return n;const i=he([s.user?.role,(s.user?.passports||[]).map(u=>u.role)].flat().filter(Boolean));return i.length===0?i:n.filter(u=>i.includes(u.toLocaleLowerCase().trim()))},[s.user,f]),A=v.join(","),D=s.user&&f?v.length>0:!0,E=async()=>{C(!0);try{const n=c.get("__url__"),i=n?H(n):null;if(!i){C(!1);return}const u="__blocklet__.js?type=json",B=new URL(i).origin,{data:j}=await de.get(O(B,u));R({appName:j?.appName,appUrl:j?.appUrl,appLogo:O(j?.appUrl,j?.appLogo)})}catch(n){console.error(n)}finally{C(!1)}};d.useEffect(()=>{s.user&&_(s.user)},[s.user]);const z=()=>{E(),s.user&&_(s.user);try{const n=new URL(window.location.href);if(n.hash.includes("invalid")){t.invalidSession=!0;return}const i=n.searchParams.get("__token__"),u=i?H(i):null;if(!u)throw new Error("No token");t.token=u,t.ready=!0}catch(n){t.invalidSession=!0,t.error=n.message,window.opener?.postMessage({type:"connect-aigne-message",error:n.message},"*"),I("#invalid",{replace:!0})}};d.useLayoutEffect(()=>z(),[]);const r=window.blocklet,b=c.get("source")||"Generate Access Key",g=p(async n=>{try{await le.post("/access-key/authorize",{source:b,sid:t.token,requiredRoles:A}),t.success=!0,window.opener?.postMessage({type:"connect-aigne-message",success:!0},"*"),c.has("closeOnSuccess")&&(T(Date.now()+G),setTimeout(()=>P(),G))}catch(i){console.error(i)}finally{n()}}),x=p(()=>{s.login()}),U=p(()=>{window.close()});d.useEffect(()=>{s.initialized&&!s.user&&(me()||x())},[s?.user,s?.initialized,x]),d.useEffect(()=>{s.open||l.current?.closeLoading?.()},[s.open]);const q=()=>t.error?e.jsxs(W,{severity:"error",children:[e.jsx(F,{children:o("aigne.notAuthorized")}),t.error]}):t.success?e.jsx(ue,{style:{backgroundColor:"transparent"},status:"info",icon:e.jsx(ee,{style:{color:N.palette.success.main,fontSize:72}}),title:o("connectCli.success",{source:b}),description:`${o("connectCli.successDesc",{source:b})} ${c.has("closeOnSuccess")?o("connectCli.closeDelay",{seconds:Math.ceil(k/1e3)}):""}`}):e.jsxs(W,{severity:"info",children:[e.jsx(F,{children:o("aigne.connectTo",{appName:r.appName})}),f&&e.jsx(w,{component:"li",variant:"body2",children:A?o("aigne.accessTips.switchPassport",{required_roles:A}):o("aigne.accessTips.switchPassportRequired",{required_roles:f})}),e.jsx(w,{component:"li",variant:"body2",children:o("aigne.accessTips.tips1",{appName:h.appName,accessAppName:r.appName})}),e.jsx(w,{component:"li",variant:"body2",children:o("aigne.accessTips.tips2",{appName:h.appName})}),e.jsx(w,{component:"li",variant:"body2",sx:{"& a":{color:"inherit",textDecoration:"underline"}},dangerouslySetInnerHTML:{__html:o("aigne.accessTips.tips3",{url:Se,accessAppName:r.appName})}})]});return e.jsx(be,{ref:l,session:s,requestAppInfo:h,currentAppInfo:r,userInfo:L,onAuthorize:g,onConnect:x,onSwitchConnect:s.switchDid,onCancel:U,hideAuthorize:!!t.error,hideSwitchConnect:t.success,hideButton:t.success,authorizeText:o("common.approve"),onSwitchPassport:s.switchDid,slotProps:{root:{sx:{width:500}}},disableAuthorizeButton:!D,children:q()})}export{De as default};
1
+ import{j as e,ak as a,T as w,a6 as M,b6 as Y,Q as K,bb as Z,D as X,aZ as W,a_ as F,bu as ee}from"./vendor-mui-core-DnR6WYuU.js";import{r as d,u as se,j as ne}from"./vendor-react-CTtPmzVP.js";import{b6 as te,ba as oe,bb as re,bc as ie,bd as ae,u as ce,o as le,t as H,V as ue,am as de,c as pe}from"./index-CDZlfV0h.js";import{n as S,ac as he,C as O}from"./vendor-utils-drLlzTVq.js";import{g as J,b as p,z as xe,w as fe}from"./vendor-hooks-cYMUGE4V.js";import{M as $,V as Q,x as ge,K as V,P as me}from"./vendor-ux-DfSgTRg5.js";import{o as je}from"./vendor-arcblock-CPCSE54a.js";import{K as we}from"./landing-page-CBmSfoFm.js";import{u as ye}from"./use-window-close-DDL8fcOm.js";import"./lottie-web-4koyQiv_.js";function Ce({requestAppInfo:l,currentAppInfo:y}){return e.jsxs(a,{sx:{textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",gap:2},children:[e.jsxs(a,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx($,{src:y.appLogo,alt:"Server",width:48,height:48,useProxyFallback:!0}),e.jsxs(a,{sx:{mx:2,display:"flex",alignItems:"center","& .dot":{width:8,height:8,borderRadius:"50%",bgcolor:"grey.500",mx:.5}},children:[e.jsx(a,{className:"dot"}),e.jsx(a,{className:"dot"}),e.jsx(a,{className:"dot"})]}),e.jsx($,{src:l.appLogo,alt:l.appName,width:48,height:48,useProxyFallback:!0})]}),e.jsxs(w,{sx:{mb:1,fontSize:"1.2rem"},children:["Authorize"," ",e.jsx(a,{component:"span",sx:{color:"primary.main"},children:l.appName})]})]})}const Ae={en:{notThis:"Not you?",useAnother:"Use another account",authorize:"Authorize",connect:"Connect",cancel:"Cancel"},zh:{notThis:"不是这个?",useAnother:"使用其他账户",authorize:"授权",connect:"Connect",cancel:"取消"}};function be({session:l,requestAppInfo:y,currentAppInfo:T,children:k=null,userInfo:s=void 0,hideSwitchConnect:N=!1,hideAuthorize:t=!1,hideCancel:L=!1,hideButton:_=!1,notThisText:I=void 0,authorizeText:o=void 0,connectText:c=void 0,cancelText:P=void 0,useAnotherText:C=void 0,slotProps:h=void 0,onConnect:R=S,onAuthorize:f=S,onSwitchConnect:v=S,onSwitchPassport:A=S,onCancel:D=S,ref:E,disableAuthorizeButton:z=!1}){const r=J({loading:!1}),{locale:b="en"}=Q()||{},g=p((B,j={})=>ge(Ae,B,b,"en",j)),x=p(()=>{r.loading=!1}),U=p(()=>{r.loading=!0,R?.(x)}),q=p(()=>{r.loading=!0,v?.(x)}),n=p(()=>{r.loading=!0,f?.(x)}),i=p(()=>{r.loading=!0,A?.(x)}),u=p(()=>{D?.()});if(d.useImperativeHandle(E,()=>({closeLoading:x})),l.loading||!l.initialized)return e.jsx(je,{children:e.jsx(M,{})});const m=s??l?.user;return e.jsx(we,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(a,{...h?.root,sx:V({width:420,maxWidth:"100%"},h?.root?.sx),children:e.jsx(te,{hideCloseButton:!0,...h?.didConnectContainer,children:e.jsxs(a,{...h?.contentContainer,sx:V({display:"flex",flexDirection:"column",gap:1.5,p:{xs:2,lg:3,xl:4},pt:{xs:3,xl:4},bgcolor:"background.paper"},h?.contentContainer?.sx),children:[e.jsx(Ce,{requestAppInfo:y,currentAppInfo:T}),m?e.jsxs(e.Fragment,{children:[e.jsx(oe,{user:m,showDid:!0,cardType:ie.Detailed,infoType:re.Minimal,renderTopRightContent:()=>e.jsx(ae,{user:m,switchPassport:i})}),e.jsx(a,{})]}):null,k,_?null:e.jsxs(e.Fragment,{children:[e.jsx(a,{sx:{border:"1px solid",borderColor:"divider",borderRadius:2,overflow:"hidden",my:1}}),e.jsxs(Y,{direction:"row",spacing:2,children:[L?null:e.jsx(K,{color:"inherit",variant:"outlined",size:"large",fullWidth:!0,onClick:u,sx:{color:"grey.500"},children:P||g("cancel")}),m&&!t?e.jsxs(K,{variant:"contained",size:"large",fullWidth:!0,onClick:n,disabled:r.loading||z,children:[r.loading?e.jsx(M,{size:20,sx:{mr:1}}):null,o||g("authorize")]}):e.jsxs(K,{variant:"contained",size:"large",fullWidth:!0,disabled:r.loading||z,onClick:U,children:[r.loading?e.jsx(M,{size:20,sx:{mr:1}}):null,c||g("connect")]})]})]}),N||!m?null:e.jsx(a,{sx:{textAlign:"center"},children:e.jsxs(w,{variant:"body2",sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:1},children:[I||g("notThis")," ",e.jsx(Z,{underline:"hover",onClick:q,sx:{cursor:"pointer"},children:C||g("useAnother")})]})})]})})})})}const Se=O(window.location.origin,pe.WELLKNOWN_BLOCKLET_USER_PATH,"settings#user-center-access-key-setting"),G=3e3;function De(){const l=d.useRef(null),[y,T]=d.useState(),[k]=xe({targetDate:y}),{session:s}=ce(),N=X(),t=J({ready:!1,success:!1,error:null,invalidSession:!1,token:null}),[L,_]=fe("currentUserInfo",{defaultValue:null}),I=se(),{t:o}=Q(),[c]=ne(),P=ye(),[,C]=d.useState(!0),[h,R]=d.useState({appName:c.get("cli")?c.get("appName")??o("aigne.cli"):"",appLogo:c.get("cli")?c.get("appLogo"):""}),f=c.get("required_roles")||"",v=d.useMemo(()=>{const n=f.split(",")||[];if(n.length===0)return n;const i=he([s.user?.role,(s.user?.passports||[]).map(u=>u.role)].flat().filter(Boolean));return i.length===0?i:n.filter(u=>i.includes(u.toLocaleLowerCase().trim()))},[s.user,f]),A=v.join(","),D=s.user&&f?v.length>0:!0,E=async()=>{C(!0);try{const n=c.get("__url__"),i=n?H(n):null;if(!i){C(!1);return}const u="__blocklet__.js?type=json",B=new URL(i).origin,{data:j}=await de.get(O(B,u));R({appName:j?.appName,appUrl:j?.appUrl,appLogo:O(j?.appUrl,j?.appLogo)})}catch(n){console.error(n)}finally{C(!1)}};d.useEffect(()=>{s.user&&_(s.user)},[s.user]);const z=()=>{E(),s.user&&_(s.user);try{const n=new URL(window.location.href);if(n.hash.includes("invalid")){t.invalidSession=!0;return}const i=n.searchParams.get("__token__"),u=i?H(i):null;if(!u)throw new Error("No token");t.token=u,t.ready=!0}catch(n){t.invalidSession=!0,t.error=n.message,window.opener?.postMessage({type:"connect-aigne-message",error:n.message},"*"),I("#invalid",{replace:!0})}};d.useLayoutEffect(()=>z(),[]);const r=window.blocklet,b=c.get("source")||"Generate Access Key",g=p(async n=>{try{await le.post("/access-key/authorize",{source:b,sid:t.token,requiredRoles:A}),t.success=!0,window.opener?.postMessage({type:"connect-aigne-message",success:!0},"*"),c.has("closeOnSuccess")&&(T(Date.now()+G),setTimeout(()=>P(),G))}catch(i){console.error(i)}finally{n()}}),x=p(()=>{s.login()}),U=p(()=>{window.close()});d.useEffect(()=>{s.initialized&&!s.user&&(me()||x())},[s?.user,s?.initialized,x]),d.useEffect(()=>{s.open||l.current?.closeLoading?.()},[s.open]);const q=()=>t.error?e.jsxs(W,{severity:"error",children:[e.jsx(F,{children:o("aigne.notAuthorized")}),t.error]}):t.success?e.jsx(ue,{style:{backgroundColor:"transparent"},status:"info",icon:e.jsx(ee,{style:{color:N.palette.success.main,fontSize:72}}),title:o("connectCli.success",{source:b}),description:`${o("connectCli.successDesc",{source:b})} ${c.has("closeOnSuccess")?o("connectCli.closeDelay",{seconds:Math.ceil(k/1e3)}):""}`}):e.jsxs(W,{severity:"info",children:[e.jsx(F,{children:o("aigne.connectTo",{appName:r.appName})}),f&&e.jsx(w,{component:"li",variant:"body2",children:A?o("aigne.accessTips.switchPassport",{required_roles:A}):o("aigne.accessTips.switchPassportRequired",{required_roles:f})}),e.jsx(w,{component:"li",variant:"body2",children:o("aigne.accessTips.tips1",{appName:h.appName,accessAppName:r.appName})}),e.jsx(w,{component:"li",variant:"body2",children:o("aigne.accessTips.tips2",{appName:h.appName})}),e.jsx(w,{component:"li",variant:"body2",sx:{"& a":{color:"inherit",textDecoration:"underline"}},dangerouslySetInnerHTML:{__html:o("aigne.accessTips.tips3",{url:Se,accessAppName:r.appName})}})]});return e.jsx(be,{ref:l,session:s,requestAppInfo:h,currentAppInfo:r,userInfo:L,onAuthorize:g,onConnect:x,onSwitchConnect:s.switchDid,onCancel:U,hideAuthorize:!!t.error,hideSwitchConnect:t.success,hideButton:t.success,authorizeText:o("common.approve"),onSwitchPassport:s.switchDid,slotProps:{root:{sx:{width:500}}},disableAuthorizeButton:!D,children:q()})}export{De as default};
@@ -1 +1 @@
1
- import{b8 as t}from"./index-DwK0GIrs.js";import{H as e}from"./vendor-ux-DfSgTRg5.js";function c(...o){try{return t(...o)}catch(r){throw e.error("Invalid redirect url"),console.error("Invalid redirect url",r),r}}export{c as g};
1
+ import{b8 as t}from"./index-CDZlfV0h.js";import{H as e}from"./vendor-ux-DfSgTRg5.js";function c(...o){try{return t(...o)}catch(r){throw e.error("Invalid redirect url"),console.error("Invalid redirect url",r),r}}export{c as g};
@@ -1 +1 @@
1
- import{j as o,b6 as n}from"./vendor-mui-core-DnR6WYuU.js";import{L as r}from"./vendor-react-CTtPmzVP.js";import{w as i}from"./vendor-ux-DfSgTRg5.js";import{c as t}from"./index-DwK0GIrs.js";import{S as e}from"./studio-D_ap2IaO.js";import"./vendor-utils-drLlzTVq.js";import"./vendor-hooks-cYMUGE4V.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CPCSE54a.js";import"./index-LIDGq9IJ.js";function L(){return o.jsx(e,{children:o.jsxs(n,{direction:"row",spacing:2,sx:{m:4},children:[o.jsx(i,{component:r,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/preferences`,size:"large",color:"primary",variant:"outlined",children:"Preference Builder"}),o.jsx(i,{component:r,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/branding`,size:"large",color:"primary",variant:"outlined",children:"Branding Images"}),o.jsx(i,{component:r,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/localization`,size:"large",color:"primary",variant:"outlined",children:"Localization"})]})})}export{L as default};
1
+ import{j as o,b6 as n}from"./vendor-mui-core-DnR6WYuU.js";import{L as r}from"./vendor-react-CTtPmzVP.js";import{w as i}from"./vendor-ux-DfSgTRg5.js";import{c as t}from"./index-CDZlfV0h.js";import{S as e}from"./studio-BasxWENX.js";import"./vendor-utils-drLlzTVq.js";import"./vendor-hooks-cYMUGE4V.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CPCSE54a.js";import"./index-BB3pIdTj.js";function L(){return o.jsx(e,{children:o.jsxs(n,{direction:"row",spacing:2,sx:{m:4},children:[o.jsx(i,{component:r,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/preferences`,size:"large",color:"primary",variant:"outlined",children:"Preference Builder"}),o.jsx(i,{component:r,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/branding`,size:"large",color:"primary",variant:"outlined",children:"Branding Images"}),o.jsx(i,{component:r,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/localization`,size:"large",color:"primary",variant:"outlined",children:"Localization"})]})})}export{L as default};
@@ -1 +1 @@
1
- import{a as E}from"./vendor-react-CTtPmzVP.js";import{bA as L}from"./index-DwK0GIrs.js";const $=({url:r,allowFullScreen:o,position:a,display:i,height:u,width:y,overflow:c,styles:f,onLoad:p,onMouseOver:b,onMouseOut:m,scrolling:w,id:d,frameBorder:n,ariaHidden:O,sandbox:s,allow:j,className:g,title:h,ariaLabel:k,ariaLabelledby:A,name:P,target:v,loading:F,importance:I,referrerpolicy:M,allowpaymentrequest:S,src:q,key:x})=>{const t=L({src:q||r,target:v||null,style:{position:a||null,display:i||"initial",overflow:c||null},scrolling:w||null,allowpaymentrequest:S||null,importance:I||null,sandbox:s&&[...s].join(" ")||null,loading:F||null,styles:f||null,name:P||null,className:g||null,allowFullScreen:"allowFullScreen",referrerpolicy:M||null,title:h||null,allow:j||null,id:d||null,"aria-labelledby":A||null,"aria-hidden":O||null,"aria-label":k||null,width:y||null,height:u||null,onLoad:p||null,onMouseOver:b||null,onMouseOut:m||null,key:x||"iframe"});let l=Object.create(null);for(let e of Object.keys(t))t[e]!=null&&(l[e]=t[e]);for(let e of Object.keys(l.style))l.style[e]==null&&delete l.style[e];if(l.styles)for(let e of Object.keys(l.styles))l.styles.hasOwnProperty(e)&&(l.style[e]=l.styles[e]),Object.keys(l.styles).pop()==e&&delete l.styles;if(o)if("allow"in l){const e=l.allow.replace("fullscreen","");l.allow=`fullscreen ${e.trim()}`.trim()}else l.allow="fullscreen";return n>=0&&(l.style.hasOwnProperty("border")||(l.style.border=n)),E.createElement("iframe",Object.assign({},l))};export{$ as I};
1
+ import{a as E}from"./vendor-react-CTtPmzVP.js";import{bA as L}from"./index-CDZlfV0h.js";const $=({url:r,allowFullScreen:o,position:a,display:i,height:u,width:y,overflow:c,styles:f,onLoad:p,onMouseOver:b,onMouseOut:m,scrolling:w,id:d,frameBorder:n,ariaHidden:O,sandbox:s,allow:j,className:g,title:h,ariaLabel:k,ariaLabelledby:A,name:P,target:v,loading:F,importance:I,referrerpolicy:M,allowpaymentrequest:S,src:q,key:x})=>{const t=L({src:q||r,target:v||null,style:{position:a||null,display:i||"initial",overflow:c||null},scrolling:w||null,allowpaymentrequest:S||null,importance:I||null,sandbox:s&&[...s].join(" ")||null,loading:F||null,styles:f||null,name:P||null,className:g||null,allowFullScreen:"allowFullScreen",referrerpolicy:M||null,title:h||null,allow:j||null,id:d||null,"aria-labelledby":A||null,"aria-hidden":O||null,"aria-label":k||null,width:y||null,height:u||null,onLoad:p||null,onMouseOver:b||null,onMouseOut:m||null,key:x||"iframe"});let l=Object.create(null);for(let e of Object.keys(t))t[e]!=null&&(l[e]=t[e]);for(let e of Object.keys(l.style))l.style[e]==null&&delete l.style[e];if(l.styles)for(let e of Object.keys(l.styles))l.styles.hasOwnProperty(e)&&(l.style[e]=l.styles[e]),Object.keys(l.styles).pop()==e&&delete l.styles;if(o)if("allow"in l){const e=l.allow.replace("fullscreen","");l.allow=`fullscreen ${e.trim()}`.trim()}else l.allow="fullscreen";return n>=0&&(l.style.hasOwnProperty("border")||(l.style.border=n)),E.createElement("iframe",Object.assign({},l))};export{$ as I};
@@ -1,4 +1,4 @@
1
- import{r as u}from"./vendor-react-CTtPmzVP.js";import{W as o,j as e,ak as j,aN as L,z as A,at as K,cZ as B,I as P,a6 as W,by as M,aj as X,cH as H}from"./vendor-mui-core-DnR6WYuU.js";import{C as G}from"./Google-Cwpw9PRe.js";import{aT as U}from"./vendor-ux-DfSgTRg5.js";import{c as Y}from"./create-passport-svg-BQhmIwWD.js";import{A as Z}from"./vendor-arcblock-CPCSE54a.js";import{q as $}from"./index-DwK0GIrs.js";import{R as J}from"./required-BQln5OcV.js";import{F as Q}from"./form-wrapper-PT5ZzMQy.js";import{L as v}from"./logo-uploader-BL-x4TAv.js";import{A as ee,a as ne,b as te}from"./collapse-B7gUzFaX.js";const T={description:o.string,editing:o.bool,onChange:o.func,required:o.bool,value:o.any,componentProps:o.object,render:o.func,renderFormItem:o.func};function S({editing:n,value:s,onChange:l}){const[i,c]=u.useState(!1),m=u.useRef(),f=u.useRef(s);u.useEffect(()=>{let a=null;return n&&(a=setTimeout(()=>{c(!0)},50)),()=>{clearTimeout(a)}},[n]);const h=a=>{f.current=a,l(a)},b=()=>{c(!1),l(f.current)},y=e.jsx(j,{className:"form-item-input slot",sx:{px:1},children:e.jsxs(j,{sx:{display:"flex",alignItems:"center"},children:[s,s!=="auto"&&e.jsx("div",{style:{marginLeft:4,backgroundColor:s,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),p=e.jsxs(j,{onKeyDown:b,sx:{display:"flex",flexGrow:1,alignItems:"center",height:"40px"},children:[e.jsx(j,{onClick:()=>c(!0),sx:{display:"flex",alignItems:"center"},children:e.jsx("div",{ref:m,style:{flexShrink:0,marginLeft:"8px",backgroundColor:s,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:s==="auto"?"default":"pointer"}})}),e.jsx(L,{open:i,anchorEl:m.current,onClose:()=>c(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:e.jsx(G,{color:s,onChange:a=>h(a.hex)})})]});return n?p:y}S.propTypes=T;function D({editing:n,description:s,value:l,onChange:i,componentProps:c={},...m}){const{placeholder:f}=c,h=u.useRef(l),{t:b}=u.useContext(U),y=a=>{a.key==="Enter"&&i(h.current,"confirm")},p=a=>{h.current=a,i(a)};return n?e.jsx(A,{style:{flex:1},fullWidth:!0,value:l,onChange:a=>{a.persist(),p(a.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:s||f,onKeyDown:y,...m}):e.jsx(j,{className:"form-item-input slot",sx:{px:1},children:l||e.jsx("span",{className:"placeholder",children:b("common.requiredInputPlaceholder",{name:s||f})})})}D.propTypes=T;function O({editing:n,value:s,onChange:l,componentProps:i,...c}){const{blocklet:m}=i,f=s==="auto"?Z(m.appDid):s;return e.jsxs(j,{sx:{display:"flex",alignItems:"center"},children:[e.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:Y({title:"Owner",issuer:$.getDisplayName(m),issuerDid:m.appDid,ownerName:"Your Name",ownerDid:m.appDid,preferredColor:s||"auto"})}}),e.jsx(S,{...c,editing:n,value:n?f:s,onChange:l,componentProps:i})]})}O.propTypes={...T,componentProps:o.shape({blocklet:o.object.isRequired}).isRequired};const re=H`
1
+ import{r as u}from"./vendor-react-CTtPmzVP.js";import{W as o,j as e,ak as j,aN as L,z as A,at as K,cZ as B,I as P,a6 as W,by as M,aj as X,cH as H}from"./vendor-mui-core-DnR6WYuU.js";import{C as G}from"./Google-Cwpw9PRe.js";import{aT as U}from"./vendor-ux-DfSgTRg5.js";import{c as Y}from"./create-passport-svg-BQhmIwWD.js";import{A as Z}from"./vendor-arcblock-CPCSE54a.js";import{q as $}from"./index-CDZlfV0h.js";import{R as J}from"./required-BQln5OcV.js";import{F as Q}from"./form-wrapper-PT5ZzMQy.js";import{L as v}from"./logo-uploader-CdD4-48m.js";import{A as ee,a as ne,b as te}from"./collapse-B7gUzFaX.js";const T={description:o.string,editing:o.bool,onChange:o.func,required:o.bool,value:o.any,componentProps:o.object,render:o.func,renderFormItem:o.func};function S({editing:n,value:s,onChange:l}){const[i,c]=u.useState(!1),m=u.useRef(),f=u.useRef(s);u.useEffect(()=>{let a=null;return n&&(a=setTimeout(()=>{c(!0)},50)),()=>{clearTimeout(a)}},[n]);const h=a=>{f.current=a,l(a)},b=()=>{c(!1),l(f.current)},y=e.jsx(j,{className:"form-item-input slot",sx:{px:1},children:e.jsxs(j,{sx:{display:"flex",alignItems:"center"},children:[s,s!=="auto"&&e.jsx("div",{style:{marginLeft:4,backgroundColor:s,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),p=e.jsxs(j,{onKeyDown:b,sx:{display:"flex",flexGrow:1,alignItems:"center",height:"40px"},children:[e.jsx(j,{onClick:()=>c(!0),sx:{display:"flex",alignItems:"center"},children:e.jsx("div",{ref:m,style:{flexShrink:0,marginLeft:"8px",backgroundColor:s,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:s==="auto"?"default":"pointer"}})}),e.jsx(L,{open:i,anchorEl:m.current,onClose:()=>c(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:e.jsx(G,{color:s,onChange:a=>h(a.hex)})})]});return n?p:y}S.propTypes=T;function D({editing:n,description:s,value:l,onChange:i,componentProps:c={},...m}){const{placeholder:f}=c,h=u.useRef(l),{t:b}=u.useContext(U),y=a=>{a.key==="Enter"&&i(h.current,"confirm")},p=a=>{h.current=a,i(a)};return n?e.jsx(A,{style:{flex:1},fullWidth:!0,value:l,onChange:a=>{a.persist(),p(a.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:s||f,onKeyDown:y,...m}):e.jsx(j,{className:"form-item-input slot",sx:{px:1},children:l||e.jsx("span",{className:"placeholder",children:b("common.requiredInputPlaceholder",{name:s||f})})})}D.propTypes=T;function O({editing:n,value:s,onChange:l,componentProps:i,...c}){const{blocklet:m}=i,f=s==="auto"?Z(m.appDid):s;return e.jsxs(j,{sx:{display:"flex",alignItems:"center"},children:[e.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:Y({title:"Owner",issuer:$.getDisplayName(m),issuerDid:m.appDid,ownerName:"Your Name",ownerDid:m.appDid,preferredColor:s||"auto"})}}),e.jsx(S,{...c,editing:n,value:n?f:s,onChange:l,componentProps:i})]})}O.propTypes={...T,componentProps:o.shape({blocklet:o.object.isRequired}).isRequired};const re=H`
2
2
  0%, 100% {
3
3
  transform: scale(1) translateX(0);
4
4
  }
@@ -1,4 +1,4 @@
1
- import{j as a,D as M,T as _,cg as T,Q as W,ch as q,aV as X,ak as h,ci as Y,aU as Z,av as B,f as C,cj as J,ck as K}from"./vendor-mui-core-DnR6WYuU.js";import{r as d,i as L,L as z,n as ee,o as ae}from"./vendor-react-CTtPmzVP.js";import{H as E,b5 as te}from"./index-DwK0GIrs.js";import{e as ie}from"./vendor-hooks-cYMUGE4V.js";import{M as re,l as m,b3 as A,b4 as S}from"./vendor-ux-DfSgTRg5.js";import{z as oe}from"./vendor-arcblock-CPCSE54a.js";const H=d.createContext(null),se=e=>{const i=d.use(H);return d.useLayoutEffect(()=>{},[]),i};function le({children:e=void 0,...i}){const[t,r]=d.useState({inFullPage:!1,showToggleButton:!1,headerVisibleInFullPage:!0,footerVisibleInFullPage:!1,sidebarVisibleInFullPage:!1}),s=()=>{r(o=>({...o,inFullPage:!o.inFullPage}))},l=d.useMemo(()=>({...t,headerVisible:!t.inFullPage||t.headerVisibleInFullPage,footerVisible:!t.inFullPage||t.footerVisibleInFullPage,sidebarVisible:!t.inFullPage||t.sidebarVisibleInFullPage,toggleFullPage:s,configure:o=>r(n=>({...n,...o}))}),[t]);return a.jsx(H,{value:l,...i,children:e})}function ne({name:e,size:i=36,alt:t="",color:r="#000000",prefix:s="/images",showBadge:l=!1,style:o={},...n}){const c=`${s}/${e}-${r.replace(/^#/,"")}.png`;return a.jsxs(de,{style:{width:i,height:i},children:[a.jsx(re,{width:i,height:i,alt:t||e,src:c,style:Object.assign({width:i},o),...n}),l&&a.jsx("i",{className:"badge-point"})]})}const de=m("div")`
1
+ import{j as a,D as M,T as _,cg as T,Q as W,ch as q,aV as X,ak as h,ci as Y,aU as Z,av as B,f as C,cj as J,ck as K}from"./vendor-mui-core-DnR6WYuU.js";import{r as d,i as L,L as z,n as ee,o as ae}from"./vendor-react-CTtPmzVP.js";import{H as E,b5 as te}from"./index-CDZlfV0h.js";import{e as ie}from"./vendor-hooks-cYMUGE4V.js";import{M as re,l as m,b3 as A,b4 as S}from"./vendor-ux-DfSgTRg5.js";import{z as oe}from"./vendor-arcblock-CPCSE54a.js";const H=d.createContext(null),se=e=>{const i=d.use(H);return d.useLayoutEffect(()=>{},[]),i};function le({children:e=void 0,...i}){const[t,r]=d.useState({inFullPage:!1,showToggleButton:!1,headerVisibleInFullPage:!0,footerVisibleInFullPage:!1,sidebarVisibleInFullPage:!1}),s=()=>{r(o=>({...o,inFullPage:!o.inFullPage}))},l=d.useMemo(()=>({...t,headerVisible:!t.inFullPage||t.headerVisibleInFullPage,footerVisible:!t.inFullPage||t.footerVisibleInFullPage,sidebarVisible:!t.inFullPage||t.sidebarVisibleInFullPage,toggleFullPage:s,configure:o=>r(n=>({...n,...o}))}),[t]);return a.jsx(H,{value:l,...i,children:e})}function ne({name:e,size:i=36,alt:t="",color:r="#000000",prefix:s="/images",showBadge:l=!1,style:o={},...n}){const c=`${s}/${e}-${r.replace(/^#/,"")}.png`;return a.jsxs(de,{style:{width:i,height:i},children:[a.jsx(re,{width:i,height:i,alt:t||e,src:c,style:Object.assign({width:i},o),...n}),l&&a.jsx("i",{className:"badge-point"})]})}const de=m("div")`
2
2
  position: relative;
3
3
  .badge-point {
4
4
  position: absolute;
@@ -1,4 +1,4 @@
1
- import{B as qr}from"./vendor-utils-drLlzTVq.js";import{p as ae}from"./vendor-react-CTtPmzVP.js";import{bm as Se,cs as jr,j as xr,ct as Nr,cu as _r,cv as Kr,i as Sr,cw as Tr,cx as ke,cy as Ur,cz as Br,bj as Dr,cA as Mr,p as Lr,r as Cr}from"./vendor-ux-DfSgTRg5.js";import{co as Or,cf as Vr}from"./index-DwK0GIrs.js";var Pe={exports:{}},Re={},Je;function Ar(){if(Je)return Re;Je=1;function h(u){"@babel/helpers - typeof";return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},h(u)}function g(u,p,S){return Object.defineProperty(u,"prototype",{writable:!1}),u}function s(u,p){if(!(u instanceof p))throw new TypeError("Cannot call a class as a function")}function b(u,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function");u.prototype=Object.create(p&&p.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),Object.defineProperty(u,"prototype",{writable:!1}),p&&_(u,p)}function _(u,p){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(N,B){return N.__proto__=B,N},_(u,p)}function L(u){var p=n();return function(){var N=e(u),B;if(p){var K=e(this).constructor;B=Reflect.construct(N,arguments,K)}else B=N.apply(this,arguments);return E(this,B)}}function E(u,p){if(p&&(h(p)==="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return f(u)}function f(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function n(){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 e(u){return e=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(S){return S.__proto__||Object.getPrototypeOf(S)},e(u)}var r={},d,y;function l(u,p,S){S||(S=Error);function N(K,H,V){return typeof p=="string"?p:p(K,H,V)}var B=function(K){b(V,K);var H=L(V);function V(W,te,Z){var J;return s(this,V),J=H.call(this,N(W,te,Z)),J.code=u,J}return g(V)}(S);r[u]=B}function q(u,p){if(Array.isArray(u)){var S=u.length;return u=u.map(function(N){return String(N)}),S>2?"one of ".concat(p," ").concat(u.slice(0,S-1).join(", "),", or ")+u[S-1]:S===2?"one of ".concat(p," ").concat(u[0]," or ").concat(u[1]):"of ".concat(p," ").concat(u[0])}else return"of ".concat(p," ").concat(String(u))}function O(u,p,S){return u.substr(0,p.length)===p}function A(u,p,S){return(S===void 0||S>u.length)&&(S=u.length),u.substring(S-p.length,S)===p}function j(u,p,S){return typeof S!="number"&&(S=0),S+p.length>u.length?!1:u.indexOf(p,S)!==-1}return l("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),l("ERR_INVALID_ARG_TYPE",function(u,p,S){d===void 0&&(d=We()),d(typeof u=="string","'name' must be a string");var N;typeof p=="string"&&O(p,"not ")?(N="must not be",p=p.replace(/^not /,"")):N="must be";var B;if(A(u," argument"))B="The ".concat(u," ").concat(N," ").concat(q(p,"type"));else{var K=j(u,".")?"property":"argument";B='The "'.concat(u,'" ').concat(K," ").concat(N," ").concat(q(p,"type"))}return B+=". Received type ".concat(h(S)),B},TypeError),l("ERR_INVALID_ARG_VALUE",function(u,p){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";y===void 0&&(y=Se());var N=y.inspect(p);return N.length>128&&(N="".concat(N.slice(0,128),"...")),"The argument '".concat(u,"' ").concat(S,". Received ").concat(N)},TypeError),l("ERR_INVALID_RETURN_VALUE",function(u,p,S){var N;return S&&S.constructor&&S.constructor.name?N="instance of ".concat(S.constructor.name):N="type ".concat(h(S)),"Expected ".concat(u,' to be returned from the "').concat(p,'"')+" function but got ".concat(N,".")},TypeError),l("ERR_MISSING_ARGS",function(){for(var u=arguments.length,p=new Array(u),S=0;S<u;S++)p[S]=arguments[S];d===void 0&&(d=We()),d(p.length>0,"At least one arg needs to be specified");var N="The ",B=p.length;switch(p=p.map(function(K){return'"'.concat(K,'"')}),B){case 1:N+="".concat(p[0]," argument");break;case 2:N+="".concat(p[0]," and ").concat(p[1]," arguments");break;default:N+=p.slice(0,B-1).join(", "),N+=", and ".concat(p[B-1]," arguments");break}return"".concat(N," must be specified")},TypeError),Re.codes=r,Re}var Ie,Qe;function Fr(){if(Qe)return Ie;Qe=1;function h(v,m){var U=Object.keys(v);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(v);m&&(x=x.filter(function(C){return Object.getOwnPropertyDescriptor(v,C).enumerable})),U.push.apply(U,x)}return U}function g(v){for(var m=1;m<arguments.length;m++){var U=arguments[m]!=null?arguments[m]:{};m%2?h(Object(U),!0).forEach(function(x){s(v,x,U[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(U)):h(Object(U)).forEach(function(x){Object.defineProperty(v,x,Object.getOwnPropertyDescriptor(U,x))})}return v}function s(v,m,U){return m=E(m),m in v?Object.defineProperty(v,m,{value:U,enumerable:!0,configurable:!0,writable:!0}):v[m]=U,v}function b(v,m){if(!(v instanceof m))throw new TypeError("Cannot call a class as a function")}function _(v,m){for(var U=0;U<m.length;U++){var x=m[U];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(v,E(x.key),x)}}function L(v,m,U){return m&&_(v.prototype,m),Object.defineProperty(v,"prototype",{writable:!1}),v}function E(v){var m=f(v,"string");return u(m)==="symbol"?m:String(m)}function f(v,m){if(u(v)!=="object"||v===null)return v;var U=v[Symbol.toPrimitive];if(U!==void 0){var x=U.call(v,m);if(u(x)!=="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(v)}function n(v,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");v.prototype=Object.create(m&&m.prototype,{constructor:{value:v,writable:!0,configurable:!0}}),Object.defineProperty(v,"prototype",{writable:!1}),m&&A(v,m)}function e(v){var m=q();return function(){var x=j(v),C;if(m){var a=j(this).constructor;C=Reflect.construct(x,arguments,a)}else C=x.apply(this,arguments);return r(this,C)}}function r(v,m){if(m&&(u(m)==="object"||typeof m=="function"))return m;if(m!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return d(v)}function d(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}function y(v){var m=typeof Map=="function"?new Map:void 0;return y=function(x){if(x===null||!O(x))return x;if(typeof x!="function")throw new TypeError("Super expression must either be null or a function");if(typeof m<"u"){if(m.has(x))return m.get(x);m.set(x,C)}function C(){return l(x,arguments,j(this).constructor)}return C.prototype=Object.create(x.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),A(C,x)},y(v)}function l(v,m,U){return q()?l=Reflect.construct.bind():l=function(C,a,i){var c=[null];c.push.apply(c,a);var R=Function.bind.apply(C,c),w=new R;return i&&A(w,i.prototype),w},l.apply(null,arguments)}function q(){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 O(v){return Function.toString.call(v).indexOf("[native code]")!==-1}function A(v,m){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,C){return x.__proto__=C,x},A(v,m)}function j(v){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(U){return U.__proto__||Object.getPrototypeOf(U)},j(v)}function u(v){"@babel/helpers - typeof";return u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},u(v)}var p=Se(),S=p.inspect,N=Ar(),B=N.codes.ERR_INVALID_ARG_TYPE;function K(v,m,U){return(U===void 0||U>v.length)&&(U=v.length),v.substring(U-m.length,U)===m}function H(v,m){if(m=Math.floor(m),v.length==0||m==0)return"";var U=v.length*m;for(m=Math.floor(Math.log(m)/Math.log(2));m;)v+=v,m--;return v+=v.substring(0,U-v.length),v}var V="",W="",te="",Z="",J={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:"},he=10;function de(v){var m=Object.keys(v),U=Object.create(Object.getPrototypeOf(v));return m.forEach(function(x){U[x]=v[x]}),Object.defineProperty(U,"message",{value:v.message}),U}function oe(v){return S(v,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function ye(v,m,U){var x="",C="",a=0,i="",c=!1,R=oe(v),w=R.split(`
1
+ import{B as qr}from"./vendor-utils-drLlzTVq.js";import{p as ae}from"./vendor-react-CTtPmzVP.js";import{bm as Se,cs as jr,j as xr,ct as Nr,cu as _r,cv as Kr,i as Sr,cw as Tr,cx as ke,cy as Ur,cz as Br,bj as Dr,cA as Mr,p as Lr,r as Cr}from"./vendor-ux-DfSgTRg5.js";import{co as Or,cf as Vr}from"./index-CDZlfV0h.js";var Pe={exports:{}},Re={},Je;function Ar(){if(Je)return Re;Je=1;function h(u){"@babel/helpers - typeof";return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},h(u)}function g(u,p,S){return Object.defineProperty(u,"prototype",{writable:!1}),u}function s(u,p){if(!(u instanceof p))throw new TypeError("Cannot call a class as a function")}function b(u,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function");u.prototype=Object.create(p&&p.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),Object.defineProperty(u,"prototype",{writable:!1}),p&&_(u,p)}function _(u,p){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(N,B){return N.__proto__=B,N},_(u,p)}function L(u){var p=n();return function(){var N=e(u),B;if(p){var K=e(this).constructor;B=Reflect.construct(N,arguments,K)}else B=N.apply(this,arguments);return E(this,B)}}function E(u,p){if(p&&(h(p)==="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return f(u)}function f(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function n(){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 e(u){return e=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(S){return S.__proto__||Object.getPrototypeOf(S)},e(u)}var r={},d,y;function l(u,p,S){S||(S=Error);function N(K,H,V){return typeof p=="string"?p:p(K,H,V)}var B=function(K){b(V,K);var H=L(V);function V(W,te,Z){var J;return s(this,V),J=H.call(this,N(W,te,Z)),J.code=u,J}return g(V)}(S);r[u]=B}function q(u,p){if(Array.isArray(u)){var S=u.length;return u=u.map(function(N){return String(N)}),S>2?"one of ".concat(p," ").concat(u.slice(0,S-1).join(", "),", or ")+u[S-1]:S===2?"one of ".concat(p," ").concat(u[0]," or ").concat(u[1]):"of ".concat(p," ").concat(u[0])}else return"of ".concat(p," ").concat(String(u))}function O(u,p,S){return u.substr(0,p.length)===p}function A(u,p,S){return(S===void 0||S>u.length)&&(S=u.length),u.substring(S-p.length,S)===p}function j(u,p,S){return typeof S!="number"&&(S=0),S+p.length>u.length?!1:u.indexOf(p,S)!==-1}return l("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),l("ERR_INVALID_ARG_TYPE",function(u,p,S){d===void 0&&(d=We()),d(typeof u=="string","'name' must be a string");var N;typeof p=="string"&&O(p,"not ")?(N="must not be",p=p.replace(/^not /,"")):N="must be";var B;if(A(u," argument"))B="The ".concat(u," ").concat(N," ").concat(q(p,"type"));else{var K=j(u,".")?"property":"argument";B='The "'.concat(u,'" ').concat(K," ").concat(N," ").concat(q(p,"type"))}return B+=". Received type ".concat(h(S)),B},TypeError),l("ERR_INVALID_ARG_VALUE",function(u,p){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";y===void 0&&(y=Se());var N=y.inspect(p);return N.length>128&&(N="".concat(N.slice(0,128),"...")),"The argument '".concat(u,"' ").concat(S,". Received ").concat(N)},TypeError),l("ERR_INVALID_RETURN_VALUE",function(u,p,S){var N;return S&&S.constructor&&S.constructor.name?N="instance of ".concat(S.constructor.name):N="type ".concat(h(S)),"Expected ".concat(u,' to be returned from the "').concat(p,'"')+" function but got ".concat(N,".")},TypeError),l("ERR_MISSING_ARGS",function(){for(var u=arguments.length,p=new Array(u),S=0;S<u;S++)p[S]=arguments[S];d===void 0&&(d=We()),d(p.length>0,"At least one arg needs to be specified");var N="The ",B=p.length;switch(p=p.map(function(K){return'"'.concat(K,'"')}),B){case 1:N+="".concat(p[0]," argument");break;case 2:N+="".concat(p[0]," and ").concat(p[1]," arguments");break;default:N+=p.slice(0,B-1).join(", "),N+=", and ".concat(p[B-1]," arguments");break}return"".concat(N," must be specified")},TypeError),Re.codes=r,Re}var Ie,Qe;function Fr(){if(Qe)return Ie;Qe=1;function h(v,m){var U=Object.keys(v);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(v);m&&(x=x.filter(function(C){return Object.getOwnPropertyDescriptor(v,C).enumerable})),U.push.apply(U,x)}return U}function g(v){for(var m=1;m<arguments.length;m++){var U=arguments[m]!=null?arguments[m]:{};m%2?h(Object(U),!0).forEach(function(x){s(v,x,U[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(U)):h(Object(U)).forEach(function(x){Object.defineProperty(v,x,Object.getOwnPropertyDescriptor(U,x))})}return v}function s(v,m,U){return m=E(m),m in v?Object.defineProperty(v,m,{value:U,enumerable:!0,configurable:!0,writable:!0}):v[m]=U,v}function b(v,m){if(!(v instanceof m))throw new TypeError("Cannot call a class as a function")}function _(v,m){for(var U=0;U<m.length;U++){var x=m[U];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(v,E(x.key),x)}}function L(v,m,U){return m&&_(v.prototype,m),Object.defineProperty(v,"prototype",{writable:!1}),v}function E(v){var m=f(v,"string");return u(m)==="symbol"?m:String(m)}function f(v,m){if(u(v)!=="object"||v===null)return v;var U=v[Symbol.toPrimitive];if(U!==void 0){var x=U.call(v,m);if(u(x)!=="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(v)}function n(v,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");v.prototype=Object.create(m&&m.prototype,{constructor:{value:v,writable:!0,configurable:!0}}),Object.defineProperty(v,"prototype",{writable:!1}),m&&A(v,m)}function e(v){var m=q();return function(){var x=j(v),C;if(m){var a=j(this).constructor;C=Reflect.construct(x,arguments,a)}else C=x.apply(this,arguments);return r(this,C)}}function r(v,m){if(m&&(u(m)==="object"||typeof m=="function"))return m;if(m!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return d(v)}function d(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}function y(v){var m=typeof Map=="function"?new Map:void 0;return y=function(x){if(x===null||!O(x))return x;if(typeof x!="function")throw new TypeError("Super expression must either be null or a function");if(typeof m<"u"){if(m.has(x))return m.get(x);m.set(x,C)}function C(){return l(x,arguments,j(this).constructor)}return C.prototype=Object.create(x.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),A(C,x)},y(v)}function l(v,m,U){return q()?l=Reflect.construct.bind():l=function(C,a,i){var c=[null];c.push.apply(c,a);var R=Function.bind.apply(C,c),w=new R;return i&&A(w,i.prototype),w},l.apply(null,arguments)}function q(){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 O(v){return Function.toString.call(v).indexOf("[native code]")!==-1}function A(v,m){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,C){return x.__proto__=C,x},A(v,m)}function j(v){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(U){return U.__proto__||Object.getPrototypeOf(U)},j(v)}function u(v){"@babel/helpers - typeof";return u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},u(v)}var p=Se(),S=p.inspect,N=Ar(),B=N.codes.ERR_INVALID_ARG_TYPE;function K(v,m,U){return(U===void 0||U>v.length)&&(U=v.length),v.substring(U-m.length,U)===m}function H(v,m){if(m=Math.floor(m),v.length==0||m==0)return"";var U=v.length*m;for(m=Math.floor(Math.log(m)/Math.log(2));m;)v+=v,m--;return v+=v.substring(0,U-v.length),v}var V="",W="",te="",Z="",J={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:"},he=10;function de(v){var m=Object.keys(v),U=Object.create(Object.getPrototypeOf(v));return m.forEach(function(x){U[x]=v[x]}),Object.defineProperty(U,"message",{value:v.message}),U}function oe(v){return S(v,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function ye(v,m,U){var x="",C="",a=0,i="",c=!1,R=oe(v),w=R.split(`
2
2
  `),I=oe(m).split(`
3
3
  `),D=0,z="";if(U==="strictEqual"&&u(v)==="object"&&u(m)==="object"&&v!==null&&m!==null&&(U="strictEqualObject"),w.length===1&&I.length===1&&w[0]!==I[0]){var k=w[0].length+I[0].length;if(k<=he){if((u(v)!=="object"||v===null)&&(u(m)!=="object"||m===null)&&(v!==0||m!==0))return"".concat(J[U],`
4
4