@abtnode/blocklet-services 1.16.47-beta-20250805-095401-14eb156b → 1.16.47-beta-20250805-140707-3a4df7fd

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 (112) hide show
  1. package/dist/assets/{access-control-jFR93SsS.js → access-control-BSEf18wl.js} +1 -1
  2. package/dist/assets/{add-component-core-DfrJCl4a.js → add-component-core-Bi6BoTuW.js} +1 -1
  3. package/dist/assets/{add-resource-Ch4SZAWK.js → add-resource-DJwbu06V.js} +1 -1
  4. package/dist/assets/{addon-B-vtdIPn.js → addon-Bdomwmjo.js} +1 -1
  5. package/dist/assets/{advanced-B92lyz70.js → advanced-CVn4Hcf5.js} +1 -1
  6. package/dist/assets/{aigne-BDdYezR9.js → aigne-DkujEYax.js} +1 -1
  7. package/dist/assets/{appearance-C1k2L_bA.js → appearance-BeyMAsY0.js} +1 -1
  8. package/dist/assets/{arrow-down.svg-BnKvb8st.js → arrow-down.svg-DJGgsS-M.js} +1 -1
  9. package/dist/assets/{audit-logs-OO0l4GnY.js → audit-logs-BITrjM7H.js} +1 -1
  10. package/dist/assets/{authorize-BU6KP5W6.js → authorize-DTBqTI9x.js} +1 -1
  11. package/dist/assets/{branding-D1JmhF3p.js → branding-BGgw8cEJ.js} +2 -2
  12. package/dist/assets/{branding-CEu-c8uQ.js → branding-CUo9AQgP.js} +1 -1
  13. package/dist/assets/{bundle-avatar-BZQ_lZxy.js → bundle-avatar-nqQPph1V.js} +1 -1
  14. package/dist/assets/{complete-DwaBuF4K.js → complete-B0oh9oaL.js} +1 -1
  15. package/dist/assets/{component-D31UJpJQ.js → component-tmpSeXZN.js} +3 -3
  16. package/dist/assets/{config-AgncsJiw.js → config-DtGAnIEK.js} +1 -1
  17. package/dist/assets/{config-Df0dxvZZ.js → config-DzbUoUBj.js} +1 -1
  18. package/dist/assets/{config-navigation-JJehoQAV.js → config-navigation-XlR3iC8u.js} +3 -3
  19. package/dist/assets/{config-space-CrH2JnlQ.js → config-space-Dc8fZcHS.js} +1 -1
  20. package/dist/assets/{config-C6pSSzan.js → config-yZbzEM9S.js} +1 -1
  21. package/dist/assets/{confirm-Cx2owMMo.js → confirm-BE3P2t7f.js} +1 -1
  22. package/dist/assets/{connect-C7C7ILA6.js → connect-CN37jxgn.js} +1 -1
  23. package/dist/assets/{connect-BD9OoHaD.js → connect-DZZ-4AIX.js} +1 -1
  24. package/dist/assets/{connect-to-nCPxtJH1.js → connect-to-Bkmg684d.js} +1 -1
  25. package/dist/assets/{dashboard-CDjptZox.js → dashboard-DxuecHqY.js} +3 -3
  26. package/dist/assets/{delete-confirm-Wa3xVOUM.js → delete-confirm-BxYuZyLa.js} +1 -1
  27. package/dist/assets/{domain-DV7cdOEy.js → domain-Bfay_KsZ.js} +1 -1
  28. package/dist/assets/{domain-action-card-CnvZTstr.js → domain-action-card-cQQZnRXd.js} +1 -1
  29. package/dist/assets/{domains-BpVmxPqY.js → domains-CmO_JEoH.js} +1 -1
  30. package/dist/assets/{email-DQnz-4Bc.js → email-BQwo1xmz.js} +1 -1
  31. package/dist/assets/engine-te2i4Xkp.js +1 -0
  32. package/dist/assets/{exchange-passport-D9HZFZwF.js → exchange-passport-LngoI7mR.js} +1 -1
  33. package/dist/assets/{form-D52FUB8q.js → form-BBQ9hkWe.js} +1 -1
  34. package/dist/assets/{fuel-DEa3ECY8.js → fuel-DTDoJVJw.js} +1 -1
  35. package/dist/assets/{gen-access-key-DrTcGDFb.js → gen-access-key-96g8FE-z.js} +1 -1
  36. package/dist/assets/{gen-simple-access-key-DiDRmpFf.js → gen-simple-access-key-eAA9bcyC.js} +1 -1
  37. package/dist/assets/{get-safe-url-DOmcOTEp.js → get-safe-url-CoK26-Ak.js} +1 -1
  38. package/dist/assets/{home-B7OWEVsn.js → home-D9FcK20t.js} +1 -1
  39. package/dist/assets/{iframe-CqwYISrF.js → iframe-DhAlOm-t.js} +1 -1
  40. package/dist/assets/{index-AbdeuSeu.js → index-7viVkiSg.js} +1 -1
  41. package/dist/assets/{index-BFOTYlfC.js → index-7zXCE3Ua.js} +1 -1
  42. package/dist/assets/{index-CKesQXQW.js → index-B5vvgnse.js} +1 -1
  43. package/dist/assets/{index-BDu1k7Fv.js → index-BETqi_AV.js} +1 -1
  44. package/dist/assets/{index-Cbf4geph.js → index-BGbMta1w.js} +4 -4
  45. package/dist/assets/{index-Dj0TETp9.js → index-BSWcZ39K.js} +1 -1
  46. package/dist/assets/{index-78a5Cdpe.js → index-BXQsZlT0.js} +1 -1
  47. package/dist/assets/{index-LdkiJabL.js → index-Bh3Eqgyw.js} +1 -1
  48. package/dist/assets/{index-DlaHLSvf.js → index-BsDq3W_j.js} +3 -3
  49. package/dist/assets/{index-uY6moYTs.js → index-C0rREY1Q.js} +1 -1
  50. package/dist/assets/{index-CiW-jlCS.js → index-CK7BAVRn.js} +1 -1
  51. package/dist/assets/{index-B0GLaTiX.js → index-CTur5nk-.js} +1 -1
  52. package/dist/assets/{index-Nd6gD7eY.js → index-CkAhcTYd.js} +1 -1
  53. package/dist/assets/{index-BetmKk0p.js → index-ClmgRx8j.js} +1 -1
  54. package/dist/assets/{index-diQW5vdJ.js → index-CtthKnbV.js} +1 -1
  55. package/dist/assets/{index-CiL_9BYm.js → index-D9V5Umc7.js} +1 -1
  56. package/dist/assets/{index-DtuUsb1T.js → index-DQFj-nYH.js} +1 -1
  57. package/dist/assets/{index-Cylfu8Kg.js → index-DSXRZM65.js} +14 -14
  58. package/dist/assets/{index-B4OZ6pVW.js → index-DXEP0e1N.js} +1 -1
  59. package/dist/assets/{index-B-WiXXyt.js → index-IvJAtHzW.js} +1 -1
  60. package/dist/assets/{index-C0mn0MnL.js → index-LNOwklRT.js} +1 -1
  61. package/dist/assets/{index-C4hly8RC.js → index-gkPitOyo.js} +1 -1
  62. package/dist/assets/{index-ChbREcnK.js → index-iEC5ZdMS.js} +1 -1
  63. package/dist/assets/{index-AK4Fi3I2.js → index-sgUJ1UrA.js} +1 -1
  64. package/dist/assets/{invitation-D8IFGbTf.js → invitation-US90mCZ0.js} +1 -1
  65. package/dist/assets/{invite-bBNbkUJu.js → invite-DyIqbjve.js} +1 -1
  66. package/dist/assets/{isURL-By2TdRfN.js → isURL-Bawv3imX.js} +1 -1
  67. package/dist/assets/{issue-passport-DaQDVQ7Y.js → issue-passport-C5vD2vwu.js} +1 -1
  68. package/dist/assets/{item-BhrhnieT.js → item-CicRcRrO.js} +1 -1
  69. package/dist/assets/{landing-page-k9p91AEv.js → landing-page-CxWEfJb1.js} +1 -1
  70. package/dist/assets/{layout-zg5WZEdp.js → layout-DE-cz95w.js} +1 -1
  71. package/dist/assets/{list-C6CNPBAR.js → list-CwpC3pkX.js} +1 -1
  72. package/dist/assets/{list-CYJEZSon.js → list-DBxh165t.js} +2 -2
  73. package/dist/assets/{localization-DFWXvHpl.js → localization-DDJ05J06.js} +1 -1
  74. package/dist/assets/{log-ssfC90VX.js → log-DmRKBFGC.js} +1 -1
  75. package/dist/assets/{login-aFsf6-QM.js → login-DJCu1xgf.js} +1 -1
  76. package/dist/assets/{login-oauth-callback-dKBg8IoH.js → login-oauth-callback-DUU4jnz6.js} +1 -1
  77. package/dist/assets/{logo-uploader-D0Gz6YoY.js → logo-uploader-Dkqno_Ja.js} +2 -2
  78. package/dist/assets/{lost-passport-Bo6am6th.js → lost-passport-ImDGPXaC.js} +1 -1
  79. package/dist/assets/{open-window-DBhAlL9B.js → open-window-q1wrayPW.js} +1 -1
  80. package/dist/assets/{over-due-invoice-payment-D89GCKNm.js → over-due-invoice-payment-JvwfN8wc.js} +1 -1
  81. package/dist/assets/{overview-Xs3x6yXg.js → overview-BmpIT6Q_.js} +1 -1
  82. package/dist/assets/{passport-item-D-B7gJms.js → passport-item-C25fvRz1.js} +1 -1
  83. package/dist/assets/{permission-DqaOkW_Z.js → permission-jA6KoYLs.js} +1 -1
  84. package/dist/assets/{preferences-5iBfUn8N.js → preferences-DRk6dZEm.js} +1 -1
  85. package/dist/assets/{profile-embed-MOxF7ggV.js → profile-embed-CWn_g09P.js} +1 -1
  86. package/dist/assets/{publish-resource-BBnSOgDd.js → publish-resource-vKH4JQbV.js} +1 -1
  87. package/dist/assets/{runtime-DjILMoeT.js → runtime-CVbnWFXH.js} +1 -1
  88. package/dist/assets/sdk-BPlpWr_6.js +1 -0
  89. package/dist/assets/{security-BXhgiheS.js → security-DZamcnzN.js} +1 -1
  90. package/dist/assets/{session-89Q1nGxB.js → session-DwRV85k4.js} +1 -1
  91. package/dist/assets/{setup-Da3ReRWd.js → setup-kwTvymfp.js} +3 -3
  92. package/dist/assets/{spaces-BJeg7L1z.js → spaces-BVGaa6Hu.js} +1 -1
  93. package/dist/assets/{start-CLueiUKJ.js → start-aPtgs0SV.js} +1 -1
  94. package/dist/assets/{status-DheLJdlM.js → status-C3kkPu09.js} +1 -1
  95. package/dist/assets/{step-actions-DmraEWCH.js → step-actions-CAm14q1m.js} +1 -1
  96. package/dist/assets/{studio-C4flChud.js → studio-BfthGuiI.js} +1 -1
  97. package/dist/assets/{team-ZJuYy81P.js → team-D7qYznX0.js} +1 -1
  98. package/dist/assets/{traffic-CMI1Sbrr.js → traffic-DTdSCUkM.js} +1 -1
  99. package/dist/assets/{transfer-CW4yMg3K.js → transfer-C5DkV4KG.js} +1 -1
  100. package/dist/assets/{unsubscribe-D3ZXIJIb.js → unsubscribe-CLba7U2w.js} +1 -1
  101. package/dist/assets/{use-promise-window-open-u0untujg.js → use-promise-window-open-ZxLzFYBo.js} +1 -1
  102. package/dist/assets/{user-center-D6gs6-WZ.js → user-center-Jy5Iq5_O.js} +3 -3
  103. package/dist/assets/{user-sessions-B56a-4tA.js → user-sessions-BGnHveoB.js} +1 -1
  104. package/dist/assets/{util-Dcj6HCP7.js → util-C5cbPYrK.js} +1 -1
  105. package/dist/assets/{util-DQF9oPrf.js → util-D2_crIYF.js} +1 -1
  106. package/dist/assets/{wrap-locale-DAzAra4f.js → wrap-locale-COCKCQEf.js} +1 -1
  107. package/dist/assets/{zh-DxCg9Pae.js → zh-BowysNWx.js} +1 -1
  108. package/dist/index.html +1 -1
  109. package/dist/service-worker.js +1 -1
  110. package/package.json +23 -23
  111. package/dist/assets/engine-BD3-KjxK.js +0 -1
  112. package/dist/assets/sdk-B-MwbsI_.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/log-ssfC90VX.js","assets/vendor-mui-core-BOHKtf8y.js","assets/vendor-react-Dvs43sk9.js","assets/useLocalStorage-B_thopuV.js","assets/vendor-ux-Cra9XTth.js","assets/vendor-utils-BOkrEpKO.js","assets/vendor-hooks-DTeIFVkk.js","assets/lottie-web-4koyQiv_.js","assets/vendor-ux-DYcPPYq2.css","assets/index-Cbf4geph.js","assets/vendor-arcblock--zSibe1w.js","assets/index-DrVXX4fX.css","assets/bundle-avatar-BZQ_lZxy.js","assets/log-1sZ_L4eJ.css","assets/index-CiL_9BYm.js","assets/index-B-WiXXyt.js","assets/user-sessions-B56a-4tA.js","assets/index-C4hly8RC.js","assets/did-address-C7IHZs6x.js","assets/team-ZJuYy81P.js","assets/session-89Q1nGxB.js","assets/isURL-By2TdRfN.js","assets/permission-DqaOkW_Z.js","assets/click-to-copy-EOhAhdSS.js","assets/index-BDu1k7Fv.js","assets/arrow-down.svg-BnKvb8st.js","assets/vendor-mui-x-16EG-AFj.js","assets/AdapterDayjs-D8zlc0TS.js","assets/index-DBs9Ljax.js","assets/useAsync-DgPr_To1.js","assets/useAsync-BdgUavMa.js","assets/index-B-k9otcQ.js","assets/confirm-Cx2owMMo.js","assets/index-Nd6gD7eY.js","assets/util-Dcj6HCP7.js","assets/base32-BeRPpTcK.js","assets/sdk-B-MwbsI_.js","assets/actions-B0rWiAuM.js","assets/shorten-label-CdBn9U0H.js","assets/get-safe-url-DOmcOTEp.js","assets/dot-CE8yAFCN.js","assets/useSetState-DFuQZPPV.js","assets/index-Dj0TETp9.js","assets/over-due-invoice-payment-D89GCKNm.js","assets/use-mobile-BDciCFXT.js","assets/index-AK4Fi3I2.js","assets/use-mobile-BlpLWscF.js","assets/index.esm-JPZAjt0x.js","assets/table-tips-73VcKMz1.js","assets/index-Cylfu8Kg.js","assets/empty-spinner-DCdg-gxP.js","assets/list-header-B8ZTLjYf.js","assets/question-mark-circle.svg-B4stD6SS.js","assets/engine-BD3-KjxK.js","assets/api-Rnh95Dt4.js","assets/react-beautiful-dnd.esm-DkLcR42r.js","assets/raf-schd.esm-CHNehTG3.js","assets/use-promise-window-open-u0untujg.js","assets/wait-connect-CqwL_aoj.js","assets/item-BhrhnieT.js","assets/delete-confirm-Wa3xVOUM.js","assets/index-BEmLxB7B.js","assets/index-BBIMESWU.js","assets/index-gnjjKJuC.css","assets/index-296hnpGF.js","assets/overview-Xs3x6yXg.js","assets/keyboard-arrow-down-rounded-8U0_i9QO.js","assets/index-BojVbZw0.js","assets/status-DheLJdlM.js","assets/omit-8QDODHip.js","assets/spaces-BJeg7L1z.js","assets/domains-BpVmxPqY.js","assets/domain-action-card-CnvZTstr.js","assets/util-DQF9oPrf.js","assets/index-C0mn0MnL.js","assets/passport-item-D-B7gJms.js","assets/index-DSNvDaKK.js","assets/Google-DxcTyhFe.js","assets/cloneDeep-DwV-xVQF.js","assets/edit.svg-DycWG9v3.js","assets/lock.svg-COUP8tyO.js","assets/appearance-C1k2L_bA.js","assets/audit-logs-OO0l4GnY.js","assets/index-LdkiJabL.js","assets/section-X04H4Q-a.js","assets/required-Df9AZf0R.js","assets/collapse-wumRocfe.js","assets/list-C6CNPBAR.js","assets/server-logo-notext.svg-CKQB0tIp.js","assets/traffic-CMI1Sbrr.js","assets/iframe-CqwYISrF.js","assets/index-Bbcgo0GF.js","assets/base-chart-B1XQ7Ytj.js","assets/index-DLDRrQJH.js","assets/config-navigation-JJehoQAV.js","assets/index-BPy8_fa2.js","assets/createClass-BTaIsrxM.js","assets/simple-select-BkbgqOQi.js","assets/index-DtuUsb1T.js","assets/index-uY6moYTs.js","assets/index-BFOTYlfC.js","assets/index-DRYJ0xIl.js","assets/connect-to-nCPxtJH1.js","assets/config-space-CrH2JnlQ.js","assets/switch-control-BbRt1rRM.js","assets/index-CiW-jlCS.js","assets/index-Yow2d7gN.js","assets/security-BXhgiheS.js","assets/config-Df0dxvZZ.js","assets/branding-CEu-c8uQ.js","assets/sanitize-BSjwjSMl.js","assets/form-text-input-DanXI___.js","assets/form-wrapper-DgFURo9t.js","assets/logo-uploader-D0Gz6YoY.js","assets/advanced-B92lyz70.js","assets/runtime-DjILMoeT.js","assets/index-78a5Cdpe.js","assets/list-CYJEZSon.js","assets/index-BetmKk0p.js","assets/config-C6pSSzan.js","assets/empty-DhZfJeme.js","assets/observability-Cfy3MVZa.js","assets/playground-CC7NZ-_A.js","assets/component-D31UJpJQ.js","assets/add-component-core-DfrJCl4a.js","assets/launch-result-message-BTMFIbUm.js","assets/page-header-18voA300.js","assets/index-diQW5vdJ.js","assets/content-layout-BZKNdb6s.js","assets/search-4YYphs0l.js","assets/add-component-core-G0iZE90Q.css","assets/index-B4OZ6pVW.js"])))=>i.map(i=>d[i]);
2
- import{b as en,n as mt,H as F,T as z,ar as tn,as as mo,M as nn,a0 as ho,I as go,E as bo,h as xo,G as yo,_}from"./vendor-ux-Cra9XTth.js";import{j as a,W as w,aZ as vo,cM as So,cQ as wo,ca as jo,cR as Co,cS as Eo,cO as ko,cT as Io,cU as _o,cV as To,I as ht,aQ as Do,aR as Lo,aX as gt,a3 as Ao,M as Po,aO as Ro,a6 as H,aP as Mo,bg as Oo,at as Oe,T as se,bp as No,b6 as kt,bq as It,ak as I,D as Ne,J as de,ah as Ue,ao as Uo,cW as $o,aj as Bo,cX as on,cY as rn,cZ as sn,a$ as ke,am as De,c_ as _t,U as G,aN as an,bZ as Fo,c$ as zo,d0 as Vo,Q as Ho,d1 as Wo}from"./vendor-mui-core-BOHKtf8y.js";import{r as x,L as cn,i as ln,g as qo,k as Ko,j as Go}from"./vendor-react-Dvs43sk9.js";import{U as $e,f as N,R as We,a9 as qe,c as P,T as Tt,bc as Qo,af as Zo,a1 as Xo,v as Jo,bd as Yo,be as un,ad as ee,bf as dn,aK as er,bg as tr,Q as nr,a_ as or,a$ as rr,bh as sr,b0 as ir,bi as ar,bj as cr,a8 as lr,bk as Ke,bl as ur,bm as dr,aZ as fr,m as fe,$ as pr,k as mr,a3 as hr,a as gr,n as Dt,bn as Lt,i as br,l as xr,r as yr,p as oe,o as vr,q as Sr,P as wr,E as jr,ap as Cr,at as Er,bo as kr,aq as Ir,d as At,t as _r}from"./index-Cbf4geph.js";import{a5 as Tr,C as Q,J as Dr}from"./vendor-utils-BOkrEpKO.js";import{o as Le}from"./vendor-arcblock--zSibe1w.js";import{u as Pt}from"./useLocalStorage-B_thopuV.js";import{f as bt}from"./index-DBs9Ljax.js";import{C as Rt}from"./confirm-Cx2owMMo.js";import{g as Mt}from"./get-safe-url-DOmcOTEp.js";import{u as fn}from"./session-89Q1nGxB.js";import{a as ie,l as Lr}from"./vendor-hooks-DTeIFVkk.js";import{k as Ar,c as Pr,M as Rr,b as Mr,T as Or,N as Nr}from"./team-ZJuYy81P.js";import{u as pn,D as Ur}from"./dot-CE8yAFCN.js";import{u as mn}from"./useSetState-DFuQZPPV.js";import{u as $r,d as Br}from"./index-Dj0TETp9.js";import{O as Fr}from"./over-due-invoice-payment-D89GCKNm.js";import{u as zr}from"./use-mobile-BDciCFXT.js";const hn=x.createContext({});function gn({children:e,type:t="blocklets"}){const[n,r]=x.useState([]),o=x.useRef([]),s=l=>{if(!o.current.includes(l)){const u=[...o.current,l];r(u),o.current=u}},i=l=>{if(o.current.includes(l)){const u=o.current.filter(d=>d!==l);r(u),o.current=u}},c=l=>{const u=n.filter(p=>l.find(f=>f===p));Tr(u,n).forEach(p=>i(p))};return a.jsx(hn.Provider,{value:{type:t,deletingBlocklets:n,addDeletingDid:s,removeDeletingDid:i,matchDeletingDid:c},children:e})}gn.propTypes={type:w.string,children:w.node.isRequired};function Ha(){return x.useContext(hn)}const Vr=e=>x.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.32989 8.20744C11.2787 6.82349 13.6098 6.08 16 6.08C18.3902 6.08 20.7213 6.82349 22.6701 8.20744C24.6189 9.59139 26.089 11.5473 26.8766 13.804C27.6642 16.0607 27.7304 18.5066 27.0659 20.8026C26.4419 22.9587 25.2026 24.8823 23.5044 26.3404H8.49555C6.79735 24.8823 5.55809 22.9587 4.9341 20.8026C4.26961 18.5066 4.33575 16.0607 5.12337 13.804C5.91098 11.5473 7.38107 9.59139 9.32989 8.20744ZM16 3.52C13.0786 3.52 10.2295 4.42871 7.84764 6.1202C5.46575 7.81169 3.66898 10.2022 2.70634 12.9604C1.7437 15.7187 1.66286 18.708 2.47501 21.5143C3.28717 24.3205 4.95211 26.8046 7.23909 28.6224C7.46554 28.8024 7.74628 28.9004 8.03554 28.9004H23.9644C24.2537 28.9004 24.5344 28.8024 24.7609 28.6224C27.0479 26.8046 28.7128 24.3205 29.5249 21.5143C30.3371 18.708 30.2563 15.7187 29.2936 12.9604C28.331 10.2022 26.5342 7.81169 24.1523 6.1202C21.7704 4.42871 18.9214 3.52 16 3.52ZM21.8829 13.5921C22.3827 13.0923 22.3827 12.2818 21.8829 11.7819C21.383 11.2821 20.5725 11.2821 20.0727 11.7819L17.868 13.9866C17.3072 13.7012 16.6724 13.5404 16 13.5404C13.7221 13.5404 11.8755 15.3869 11.8755 17.6648C11.8755 19.9427 13.7221 21.7892 16 21.7892C18.2779 21.7892 20.1244 19.9427 20.1244 17.6648C20.1244 16.9924 19.9635 16.3576 19.6782 15.7968L21.8829 13.5921ZM14.4355 17.6648C14.4355 16.8008 15.136 16.1004 16 16.1004C16.864 16.1004 17.5644 16.8008 17.5644 17.6648C17.5644 18.5288 16.864 19.2292 16 19.2292C15.136 19.2292 14.4355 18.5288 14.4355 17.6648Z",fill:"currentColor"})),Y={Start:vo,Stop:So,Restart:wo,Reload:To,Remove:jo,Config:_o,Log:Io,Group:ko,Cancel:Co,Dashboard:Vr,Overview:Eo},Hr=(e,t)=>{if(!e)return"";if(!t)return e;const n=new URL(e),r=new URLSearchParams(n.searchParams),o=new URL(Q(n.origin,t));return o.search=r.toString(),o.toString()},Wr="internal",qr="external";function bn({blocklet:e,onStart:t,onComplete:n,variant:r="menu",hasPermission:o=!1,getComponentUrl:s=null,useBlockletUrlEvaluation:i=()=>({loading:!1,recommendedUrl:window?.location?.href}),...c}){const l=$e(),[u,d]=x.useState(null),[p,f]=x.useState(null),[g,b]=x.useState(!1),[m,C]=x.useState(null),{t:v}=x.useContext(en),[j]=Pt("skip-blocklet-setup",!1),{loading:S,recommendedUrl:k}=i(e),[E]=Pt("blocklet-type-filter",Wr),h=N.isInProgress(e.status),[T,M]=x.useState(!1);x.useEffect(()=>{if(!e?.controller)return;M(e?.controller?.status?.value===We.BLOCKLET_CONTROLLER_STATUS.suspended),(async()=>{try{const D=await l.api.getLauncherSession({input:{launcherSessionId:e?.controller?.launcherSessionId,launcherUrl:e?.controller?.launcherUrl}});if(D?.error){console.error("get launcher session failed",D.error);return}M([P.LAUNCH_SESSION_STATUS.overdue,P.LAUNCH_SESSION_STATUS.canceled,P.LAUNCH_SESSION_STATUS.terminated].includes(D?.launcherSession?.status))}catch(D){console.error("call getLauncherSession error",D)}})()},[]);const{inService:R}=l,O=(y,D,q=!1)=>async()=>{const K=async ve=>{t({action:y,blocklet:e}),b(!0),f(y);let Se=!1;try{if(y==="remove")await D(ve);else if(y==="start"){if(!N.hasRunnableComponent(e)){F.error(v("blocklet.noComponent"));return}if(!R&&!j&&!e.settings?.initialized&&e.mode!==We.BLOCKLET_MODES.DEVELOPMENT){if(!k||!Tt(k)){F.error(v("blocklet.gotoVisitError"));return}const U=Qo(l.info),Et=new URL(k);Et.searchParams.set("serverUrl",U),window.open(Mt(Et.href,{allowDomains:null})),n({action:y,blocklet:e});return}const B=e.children.filter(U=>!N.isInProgress(U.status)&&U.status!=="running").map(U=>U.meta.did),J={did:e.meta.did,componentDids:B};await D({input:J})}else if(["stop","restart","reload"].includes(y)){const B=e.children.filter(U=>U.status==="running").map(U=>U.meta.did),J={did:e.meta.did,componentDids:B};await D({input:J})}else{const B={did:e.meta.did};await D({input:B})}y==="remove"?Se=!0:await Zo(1e3),y==="reload"&&F.success(v("blocklet.reloadSuccess")),C(null),n({action:y,blocklet:e})}catch(B){const J=`Blocklet ${y} failed: ${bt(B)}`;throw n({action:y,blocklet:e,error:new Error(J)}),new Error(J)}finally{Se||b(!1)}},xe=()=>{b(!1),C(null)},ye=N.getDisplayName(e,!0),fo=e.mode===We.BLOCKLET_MODES.DEVELOPMENT?{description:()=>a.jsx(se,{component:"div",children:a.jsx(se,{gutterBottom:!0,children:v("blocklet.action.removeApplicationDescription")})}),params:{removeType:"complete"}}:{description:(ve,Se)=>a.jsxs(se,{component:"div",children:[a.jsx(se,{gutterBottom:!0,children:v("blocklet.action.removeApplicationDescription")}),a.jsxs(No,{name:"removeType",value:ve.removeType,onChange:B=>Se({...ve,removeType:B.target.value}),children:[a.jsx(kt,{value:"backup",control:a.jsx(It,{}),label:v("blocklet.action.removeApplicationAfterBackup")}),a.jsx(kt,{value:"complete",control:a.jsx(It,{}),label:v("blocklet.action.removeApplicationComplete")})]})]}),params:{removeType:"backup"}},po={stop:{title:`${v("common.stop")} ${ye}`,description:v("blocklet.action.stopDescription"),confirm:v("blocklet.action.confirmStop"),cancel:v("common.cancel"),onConfirm:K,onCancel:xe},restart:{title:`${v("common.restart")} ${ye}`,description:v("blocklet.action.restartDescription"),confirm:v("blocklet.action.confirmRestart"),cancel:v("common.cancel"),onConfirm:K,onCancel:xe},remove:{title:`${v("common.remove")} ${ye}`,confirm:v("blocklet.action.confirmRemove"),cancel:v("common.cancel"),onConfirm:K,onCancel:xe,...fo},cancelDownload:{title:`${v("common.cancel")}`,description:v("blocklet.action.cancelDownloadDescription",{name:ye}),confirm:v("common.confirm"),cancel:v("common.cancel"),onConfirm:K,onCancel:xe}};q?C(po[y]):await K()},He=!!u,so=y=>{try{y.stopPropagation(),y.preventDefault()}catch{}d(y.currentTarget)},io=y=>{try{y.stopPropagation(),y.preventDefault()}catch{}d(null)},Ct=async(y,D)=>{try{D.stopPropagation(),D.preventDefault()}catch{}if(typeof y.handler=="function")try{b(!0),f(y.action),await y.handler()}catch(q){console.error(`Blocklet ${y.name} failed: `,q)}finally{b(!1),d(null)}else d(null)},ao=!R&&N.isDeletableBlocklet(e)?{action:"remove",icon:Y.Remove,name:v("common.remove"),handler:O("remove",async({removeType:y})=>{y==="backup"&&await l.api.backupBlocklet({input:{appDid:e.appDid,to:"disk"}}),await l.api.deleteBlocklet({input:{did:e.meta.did,keepData:!1}})},!0),disabled:h}:null,co={action:"remove",icon:({sx:y,...D})=>a.jsx(Y.Cancel,{sx:{...y,paddingRight:"2px",zoom:.95},...D}),name:v("common.cancel"),handler:O("cancelDownload",l.api.cancelDownloadBlocklet,!0)},lo=N.getAppMissingConfigs(e),uo=()=>{const y=`/${e.mountPoint||"/"}`.replace(/\/+/g,"/"),D=s?.({mountPoint:y,blocklet:e});if(!D||!Tt(D)){F.error(v("blocklet.gotoVisitError"));return}const q=e?.site?.domainAliases;window.open(Mt(Hr(D,`${P.WELLKNOWN_SERVICE_PATH_PREFIX}/admin`),{allowDomains:q?.map(K=>K.value)}))};let be=[{action:"start",icon:Y.Start,inExternal:!0,name:v("common.start"),handler:O("start",l.api.startBlocklet),disabled:T||e.children.every(y=>y.status==="running")||qe(e.status)||S||h},{action:"stop",icon:Y.Stop,inExternal:!0,name:v("common.stop"),handler:O("stop",l.api.stopBlocklet,!0),disabled:!["running","starting"].includes(e.status)},{action:"restart",inExternal:!0,icon:Y.Restart,name:v("common.restart"),handler:O("restart",l.api.restartBlocklet,!0),disabled:T||e.status!=="running"},qe(e.status)?co:ao,{separator:!0},R?null:{action:"dashboard",icon:({style:y,...D})=>a.jsx(Y.Dashboard,{...D,style:{...y,width:"26px",height:"26px",paddingRight:"3px"}}),name:v("sidebar.dashboard"),handler:uo}].filter(Boolean);return E===qr&&(be=be.filter(y=>y.inExternal)),r==="menu"?a.jsxs(Ot,{"data-cy":"blocklet-actions",children:[a.jsx(ht,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions","actions-blocklet-did":e.meta.did,onClick:so,size:"small",disabled:!o||!qe(e.status)&&g,children:a.jsx(Do,{})}),a.jsxs(Lo,{id:"actions-menu",anchorEl:u,keepMounted:!0,open:He,onClose:io,PaperProps:{},children:[lo.length>0&&a.jsxs(gt,{style:{maxWidth:"400px"},severity:"error",children:[v("blocklet.config.missingRequired"),a.jsx("br",{}),a.jsx(cn,{to:`/blocklets/${e.meta.did}/components`,children:v("blocklet.config.gotoFix")})]}),be.map((y,D)=>y.separator?a.jsx(Ao,{},`separator-${D}`):a.jsxs(Po,{dense:!0,onClick:q=>Ct(y,q),disabled:g||y.disabled,"data-cy":`${y.action}-blocklet`,children:[a.jsx(Ro,{style:{minWidth:24},children:p===y.action&&g?a.jsx(H,{size:16,sx:{marginRight:1}}):a.jsx(y.icon,{fontSize:"small"})}),a.jsx(Mo,{primary:y.name})]},y.name))]}),m&&a.jsx(Rt,{title:m.title,description:m.description,confirm:m.confirm,cancel:m.cancel,params:m.params,onConfirm:m.onConfirm,onCancel:m.onCancel})]}):a.jsxs(Ot,{"data-cy":"blocklet-actions",...c,children:[a.jsx(Oo,{children:be.filter(y=>!y.separator&&!y.onlyInMenu).map(y=>a.jsxs(mt,{title:y.name,"data-cy":`${y.action}-blocklet`,onClick:()=>Ct(y),disabled:!!y.disabled||g,children:[p===y.action&&g?a.jsx(H,{size:16,sx:{marginRight:1}}):a.jsx(y.icon,{}),a.jsx("span",{className:"blocklet-action-text",children:y.name})]},y.name))}),m&&a.jsx(Rt,{title:m.title,description:m.description,confirm:m.confirm,cancel:m.cancel,params:m.params,onConfirm:m.onConfirm,onCancel:m.onCancel})]})}bn.propTypes={getComponentUrl:w.func,blocklet:w.object.isRequired,onStart:w.func.isRequired,onComplete:w.func.isRequired,variant:w.oneOf(["menu","group"]),hasPermission:w.bool,useBlockletUrlEvaluation:w.func};const Ot=Oe.div`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/log-DmRKBFGC.js","assets/vendor-mui-core-BOHKtf8y.js","assets/vendor-react-Dvs43sk9.js","assets/useLocalStorage-B_thopuV.js","assets/vendor-ux-Cra9XTth.js","assets/vendor-utils-BOkrEpKO.js","assets/vendor-hooks-DTeIFVkk.js","assets/lottie-web-4koyQiv_.js","assets/vendor-ux-DYcPPYq2.css","assets/index-BGbMta1w.js","assets/vendor-arcblock--zSibe1w.js","assets/index-DrVXX4fX.css","assets/bundle-avatar-nqQPph1V.js","assets/log-1sZ_L4eJ.css","assets/index-D9V5Umc7.js","assets/index-IvJAtHzW.js","assets/user-sessions-BGnHveoB.js","assets/index-gkPitOyo.js","assets/did-address-C7IHZs6x.js","assets/team-D7qYznX0.js","assets/session-DwRV85k4.js","assets/isURL-Bawv3imX.js","assets/permission-jA6KoYLs.js","assets/click-to-copy-EOhAhdSS.js","assets/index-BETqi_AV.js","assets/arrow-down.svg-DJGgsS-M.js","assets/vendor-mui-x-16EG-AFj.js","assets/AdapterDayjs-D8zlc0TS.js","assets/index-DBs9Ljax.js","assets/useAsync-DgPr_To1.js","assets/useAsync-BdgUavMa.js","assets/index-B-k9otcQ.js","assets/confirm-BE3P2t7f.js","assets/index-CkAhcTYd.js","assets/util-C5cbPYrK.js","assets/base32-BeRPpTcK.js","assets/sdk-BPlpWr_6.js","assets/actions-B0rWiAuM.js","assets/shorten-label-CdBn9U0H.js","assets/get-safe-url-CoK26-Ak.js","assets/dot-CE8yAFCN.js","assets/useSetState-DFuQZPPV.js","assets/index-BSWcZ39K.js","assets/over-due-invoice-payment-JvwfN8wc.js","assets/use-mobile-BDciCFXT.js","assets/index-sgUJ1UrA.js","assets/use-mobile-BlpLWscF.js","assets/index.esm-JPZAjt0x.js","assets/table-tips-73VcKMz1.js","assets/index-DSXRZM65.js","assets/empty-spinner-DCdg-gxP.js","assets/list-header-B8ZTLjYf.js","assets/question-mark-circle.svg-B4stD6SS.js","assets/engine-te2i4Xkp.js","assets/api-Rnh95Dt4.js","assets/react-beautiful-dnd.esm-DkLcR42r.js","assets/raf-schd.esm-CHNehTG3.js","assets/use-promise-window-open-ZxLzFYBo.js","assets/wait-connect-CqwL_aoj.js","assets/item-CicRcRrO.js","assets/delete-confirm-BxYuZyLa.js","assets/index-BEmLxB7B.js","assets/index-BBIMESWU.js","assets/index-gnjjKJuC.css","assets/index-296hnpGF.js","assets/overview-BmpIT6Q_.js","assets/keyboard-arrow-down-rounded-8U0_i9QO.js","assets/index-BojVbZw0.js","assets/status-C3kkPu09.js","assets/omit-8QDODHip.js","assets/spaces-BVGaa6Hu.js","assets/domains-CmO_JEoH.js","assets/domain-action-card-cQQZnRXd.js","assets/util-D2_crIYF.js","assets/index-LNOwklRT.js","assets/passport-item-C25fvRz1.js","assets/index-DSNvDaKK.js","assets/Google-DxcTyhFe.js","assets/cloneDeep-DwV-xVQF.js","assets/edit.svg-DycWG9v3.js","assets/lock.svg-COUP8tyO.js","assets/appearance-BeyMAsY0.js","assets/audit-logs-BITrjM7H.js","assets/index-Bh3Eqgyw.js","assets/section-X04H4Q-a.js","assets/required-Df9AZf0R.js","assets/collapse-wumRocfe.js","assets/list-CwpC3pkX.js","assets/server-logo-notext.svg-CKQB0tIp.js","assets/traffic-DTdSCUkM.js","assets/iframe-DhAlOm-t.js","assets/index-Bbcgo0GF.js","assets/base-chart-B1XQ7Ytj.js","assets/index-DLDRrQJH.js","assets/config-navigation-XlR3iC8u.js","assets/index-BPy8_fa2.js","assets/createClass-BTaIsrxM.js","assets/simple-select-BkbgqOQi.js","assets/index-DQFj-nYH.js","assets/index-C0rREY1Q.js","assets/index-7zXCE3Ua.js","assets/index-DRYJ0xIl.js","assets/connect-to-Bkmg684d.js","assets/config-space-Dc8fZcHS.js","assets/switch-control-BbRt1rRM.js","assets/index-CK7BAVRn.js","assets/index-Yow2d7gN.js","assets/security-DZamcnzN.js","assets/config-DzbUoUBj.js","assets/branding-CUo9AQgP.js","assets/sanitize-BSjwjSMl.js","assets/form-text-input-DanXI___.js","assets/form-wrapper-DgFURo9t.js","assets/logo-uploader-Dkqno_Ja.js","assets/advanced-CVn4Hcf5.js","assets/runtime-CVbnWFXH.js","assets/index-BXQsZlT0.js","assets/list-DBxh165t.js","assets/index-ClmgRx8j.js","assets/config-yZbzEM9S.js","assets/empty-DhZfJeme.js","assets/observability-Cfy3MVZa.js","assets/playground-CC7NZ-_A.js","assets/component-tmpSeXZN.js","assets/add-component-core-Bi6BoTuW.js","assets/launch-result-message-BTMFIbUm.js","assets/page-header-18voA300.js","assets/index-CtthKnbV.js","assets/content-layout-BZKNdb6s.js","assets/search-4YYphs0l.js","assets/add-component-core-G0iZE90Q.css","assets/index-DXEP0e1N.js"])))=>i.map(i=>d[i]);
2
+ import{b as en,n as mt,H as F,T as z,ar as tn,as as mo,M as nn,a0 as ho,I as go,E as bo,h as xo,G as yo,_}from"./vendor-ux-Cra9XTth.js";import{j as a,W as w,aZ as vo,cM as So,cQ as wo,ca as jo,cR as Co,cS as Eo,cO as ko,cT as Io,cU as _o,cV as To,I as ht,aQ as Do,aR as Lo,aX as gt,a3 as Ao,M as Po,aO as Ro,a6 as H,aP as Mo,bg as Oo,at as Oe,T as se,bp as No,b6 as kt,bq as It,ak as I,D as Ne,J as de,ah as Ue,ao as Uo,cW as $o,aj as Bo,cX as on,cY as rn,cZ as sn,a$ as ke,am as De,c_ as _t,U as G,aN as an,bZ as Fo,c$ as zo,d0 as Vo,Q as Ho,d1 as Wo}from"./vendor-mui-core-BOHKtf8y.js";import{r as x,L as cn,i as ln,g as qo,k as Ko,j as Go}from"./vendor-react-Dvs43sk9.js";import{U as $e,f as N,R as We,a9 as qe,c as P,T as Tt,bc as Qo,af as Zo,a1 as Xo,v as Jo,bd as Yo,be as un,ad as ee,bf as dn,aK as er,bg as tr,Q as nr,a_ as or,a$ as rr,bh as sr,b0 as ir,bi as ar,bj as cr,a8 as lr,bk as Ke,bl as ur,bm as dr,aZ as fr,m as fe,$ as pr,k as mr,a3 as hr,a as gr,n as Dt,bn as Lt,i as br,l as xr,r as yr,p as oe,o as vr,q as Sr,P as wr,E as jr,ap as Cr,at as Er,bo as kr,aq as Ir,d as At,t as _r}from"./index-BGbMta1w.js";import{a5 as Tr,C as Q,J as Dr}from"./vendor-utils-BOkrEpKO.js";import{o as Le}from"./vendor-arcblock--zSibe1w.js";import{u as Pt}from"./useLocalStorage-B_thopuV.js";import{f as bt}from"./index-DBs9Ljax.js";import{C as Rt}from"./confirm-BE3P2t7f.js";import{g as Mt}from"./get-safe-url-CoK26-Ak.js";import{u as fn}from"./session-DwRV85k4.js";import{a as ie,l as Lr}from"./vendor-hooks-DTeIFVkk.js";import{k as Ar,c as Pr,M as Rr,b as Mr,T as Or,N as Nr}from"./team-D7qYznX0.js";import{u as pn,D as Ur}from"./dot-CE8yAFCN.js";import{u as mn}from"./useSetState-DFuQZPPV.js";import{u as $r,d as Br}from"./index-BSWcZ39K.js";import{O as Fr}from"./over-due-invoice-payment-JvwfN8wc.js";import{u as zr}from"./use-mobile-BDciCFXT.js";const hn=x.createContext({});function gn({children:e,type:t="blocklets"}){const[n,r]=x.useState([]),o=x.useRef([]),s=l=>{if(!o.current.includes(l)){const u=[...o.current,l];r(u),o.current=u}},i=l=>{if(o.current.includes(l)){const u=o.current.filter(d=>d!==l);r(u),o.current=u}},c=l=>{const u=n.filter(p=>l.find(f=>f===p));Tr(u,n).forEach(p=>i(p))};return a.jsx(hn.Provider,{value:{type:t,deletingBlocklets:n,addDeletingDid:s,removeDeletingDid:i,matchDeletingDid:c},children:e})}gn.propTypes={type:w.string,children:w.node.isRequired};function Ha(){return x.useContext(hn)}const Vr=e=>x.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.32989 8.20744C11.2787 6.82349 13.6098 6.08 16 6.08C18.3902 6.08 20.7213 6.82349 22.6701 8.20744C24.6189 9.59139 26.089 11.5473 26.8766 13.804C27.6642 16.0607 27.7304 18.5066 27.0659 20.8026C26.4419 22.9587 25.2026 24.8823 23.5044 26.3404H8.49555C6.79735 24.8823 5.55809 22.9587 4.9341 20.8026C4.26961 18.5066 4.33575 16.0607 5.12337 13.804C5.91098 11.5473 7.38107 9.59139 9.32989 8.20744ZM16 3.52C13.0786 3.52 10.2295 4.42871 7.84764 6.1202C5.46575 7.81169 3.66898 10.2022 2.70634 12.9604C1.7437 15.7187 1.66286 18.708 2.47501 21.5143C3.28717 24.3205 4.95211 26.8046 7.23909 28.6224C7.46554 28.8024 7.74628 28.9004 8.03554 28.9004H23.9644C24.2537 28.9004 24.5344 28.8024 24.7609 28.6224C27.0479 26.8046 28.7128 24.3205 29.5249 21.5143C30.3371 18.708 30.2563 15.7187 29.2936 12.9604C28.331 10.2022 26.5342 7.81169 24.1523 6.1202C21.7704 4.42871 18.9214 3.52 16 3.52ZM21.8829 13.5921C22.3827 13.0923 22.3827 12.2818 21.8829 11.7819C21.383 11.2821 20.5725 11.2821 20.0727 11.7819L17.868 13.9866C17.3072 13.7012 16.6724 13.5404 16 13.5404C13.7221 13.5404 11.8755 15.3869 11.8755 17.6648C11.8755 19.9427 13.7221 21.7892 16 21.7892C18.2779 21.7892 20.1244 19.9427 20.1244 17.6648C20.1244 16.9924 19.9635 16.3576 19.6782 15.7968L21.8829 13.5921ZM14.4355 17.6648C14.4355 16.8008 15.136 16.1004 16 16.1004C16.864 16.1004 17.5644 16.8008 17.5644 17.6648C17.5644 18.5288 16.864 19.2292 16 19.2292C15.136 19.2292 14.4355 18.5288 14.4355 17.6648Z",fill:"currentColor"})),Y={Start:vo,Stop:So,Restart:wo,Reload:To,Remove:jo,Config:_o,Log:Io,Group:ko,Cancel:Co,Dashboard:Vr,Overview:Eo},Hr=(e,t)=>{if(!e)return"";if(!t)return e;const n=new URL(e),r=new URLSearchParams(n.searchParams),o=new URL(Q(n.origin,t));return o.search=r.toString(),o.toString()},Wr="internal",qr="external";function bn({blocklet:e,onStart:t,onComplete:n,variant:r="menu",hasPermission:o=!1,getComponentUrl:s=null,useBlockletUrlEvaluation:i=()=>({loading:!1,recommendedUrl:window?.location?.href}),...c}){const l=$e(),[u,d]=x.useState(null),[p,f]=x.useState(null),[g,b]=x.useState(!1),[m,C]=x.useState(null),{t:v}=x.useContext(en),[j]=Pt("skip-blocklet-setup",!1),{loading:S,recommendedUrl:k}=i(e),[E]=Pt("blocklet-type-filter",Wr),h=N.isInProgress(e.status),[T,M]=x.useState(!1);x.useEffect(()=>{if(!e?.controller)return;M(e?.controller?.status?.value===We.BLOCKLET_CONTROLLER_STATUS.suspended),(async()=>{try{const D=await l.api.getLauncherSession({input:{launcherSessionId:e?.controller?.launcherSessionId,launcherUrl:e?.controller?.launcherUrl}});if(D?.error){console.error("get launcher session failed",D.error);return}M([P.LAUNCH_SESSION_STATUS.overdue,P.LAUNCH_SESSION_STATUS.canceled,P.LAUNCH_SESSION_STATUS.terminated].includes(D?.launcherSession?.status))}catch(D){console.error("call getLauncherSession error",D)}})()},[]);const{inService:R}=l,O=(y,D,q=!1)=>async()=>{const K=async ve=>{t({action:y,blocklet:e}),b(!0),f(y);let Se=!1;try{if(y==="remove")await D(ve);else if(y==="start"){if(!N.hasRunnableComponent(e)){F.error(v("blocklet.noComponent"));return}if(!R&&!j&&!e.settings?.initialized&&e.mode!==We.BLOCKLET_MODES.DEVELOPMENT){if(!k||!Tt(k)){F.error(v("blocklet.gotoVisitError"));return}const U=Qo(l.info),Et=new URL(k);Et.searchParams.set("serverUrl",U),window.open(Mt(Et.href,{allowDomains:null})),n({action:y,blocklet:e});return}const B=e.children.filter(U=>!N.isInProgress(U.status)&&U.status!=="running").map(U=>U.meta.did),J={did:e.meta.did,componentDids:B};await D({input:J})}else if(["stop","restart","reload"].includes(y)){const B=e.children.filter(U=>U.status==="running").map(U=>U.meta.did),J={did:e.meta.did,componentDids:B};await D({input:J})}else{const B={did:e.meta.did};await D({input:B})}y==="remove"?Se=!0:await Zo(1e3),y==="reload"&&F.success(v("blocklet.reloadSuccess")),C(null),n({action:y,blocklet:e})}catch(B){const J=`Blocklet ${y} failed: ${bt(B)}`;throw n({action:y,blocklet:e,error:new Error(J)}),new Error(J)}finally{Se||b(!1)}},xe=()=>{b(!1),C(null)},ye=N.getDisplayName(e,!0),fo=e.mode===We.BLOCKLET_MODES.DEVELOPMENT?{description:()=>a.jsx(se,{component:"div",children:a.jsx(se,{gutterBottom:!0,children:v("blocklet.action.removeApplicationDescription")})}),params:{removeType:"complete"}}:{description:(ve,Se)=>a.jsxs(se,{component:"div",children:[a.jsx(se,{gutterBottom:!0,children:v("blocklet.action.removeApplicationDescription")}),a.jsxs(No,{name:"removeType",value:ve.removeType,onChange:B=>Se({...ve,removeType:B.target.value}),children:[a.jsx(kt,{value:"backup",control:a.jsx(It,{}),label:v("blocklet.action.removeApplicationAfterBackup")}),a.jsx(kt,{value:"complete",control:a.jsx(It,{}),label:v("blocklet.action.removeApplicationComplete")})]})]}),params:{removeType:"backup"}},po={stop:{title:`${v("common.stop")} ${ye}`,description:v("blocklet.action.stopDescription"),confirm:v("blocklet.action.confirmStop"),cancel:v("common.cancel"),onConfirm:K,onCancel:xe},restart:{title:`${v("common.restart")} ${ye}`,description:v("blocklet.action.restartDescription"),confirm:v("blocklet.action.confirmRestart"),cancel:v("common.cancel"),onConfirm:K,onCancel:xe},remove:{title:`${v("common.remove")} ${ye}`,confirm:v("blocklet.action.confirmRemove"),cancel:v("common.cancel"),onConfirm:K,onCancel:xe,...fo},cancelDownload:{title:`${v("common.cancel")}`,description:v("blocklet.action.cancelDownloadDescription",{name:ye}),confirm:v("common.confirm"),cancel:v("common.cancel"),onConfirm:K,onCancel:xe}};q?C(po[y]):await K()},He=!!u,so=y=>{try{y.stopPropagation(),y.preventDefault()}catch{}d(y.currentTarget)},io=y=>{try{y.stopPropagation(),y.preventDefault()}catch{}d(null)},Ct=async(y,D)=>{try{D.stopPropagation(),D.preventDefault()}catch{}if(typeof y.handler=="function")try{b(!0),f(y.action),await y.handler()}catch(q){console.error(`Blocklet ${y.name} failed: `,q)}finally{b(!1),d(null)}else d(null)},ao=!R&&N.isDeletableBlocklet(e)?{action:"remove",icon:Y.Remove,name:v("common.remove"),handler:O("remove",async({removeType:y})=>{y==="backup"&&await l.api.backupBlocklet({input:{appDid:e.appDid,to:"disk"}}),await l.api.deleteBlocklet({input:{did:e.meta.did,keepData:!1}})},!0),disabled:h}:null,co={action:"remove",icon:({sx:y,...D})=>a.jsx(Y.Cancel,{sx:{...y,paddingRight:"2px",zoom:.95},...D}),name:v("common.cancel"),handler:O("cancelDownload",l.api.cancelDownloadBlocklet,!0)},lo=N.getAppMissingConfigs(e),uo=()=>{const y=`/${e.mountPoint||"/"}`.replace(/\/+/g,"/"),D=s?.({mountPoint:y,blocklet:e});if(!D||!Tt(D)){F.error(v("blocklet.gotoVisitError"));return}const q=e?.site?.domainAliases;window.open(Mt(Hr(D,`${P.WELLKNOWN_SERVICE_PATH_PREFIX}/admin`),{allowDomains:q?.map(K=>K.value)}))};let be=[{action:"start",icon:Y.Start,inExternal:!0,name:v("common.start"),handler:O("start",l.api.startBlocklet),disabled:T||e.children.every(y=>y.status==="running")||qe(e.status)||S||h},{action:"stop",icon:Y.Stop,inExternal:!0,name:v("common.stop"),handler:O("stop",l.api.stopBlocklet,!0),disabled:!["running","starting"].includes(e.status)},{action:"restart",inExternal:!0,icon:Y.Restart,name:v("common.restart"),handler:O("restart",l.api.restartBlocklet,!0),disabled:T||e.status!=="running"},qe(e.status)?co:ao,{separator:!0},R?null:{action:"dashboard",icon:({style:y,...D})=>a.jsx(Y.Dashboard,{...D,style:{...y,width:"26px",height:"26px",paddingRight:"3px"}}),name:v("sidebar.dashboard"),handler:uo}].filter(Boolean);return E===qr&&(be=be.filter(y=>y.inExternal)),r==="menu"?a.jsxs(Ot,{"data-cy":"blocklet-actions",children:[a.jsx(ht,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions","actions-blocklet-did":e.meta.did,onClick:so,size:"small",disabled:!o||!qe(e.status)&&g,children:a.jsx(Do,{})}),a.jsxs(Lo,{id:"actions-menu",anchorEl:u,keepMounted:!0,open:He,onClose:io,PaperProps:{},children:[lo.length>0&&a.jsxs(gt,{style:{maxWidth:"400px"},severity:"error",children:[v("blocklet.config.missingRequired"),a.jsx("br",{}),a.jsx(cn,{to:`/blocklets/${e.meta.did}/components`,children:v("blocklet.config.gotoFix")})]}),be.map((y,D)=>y.separator?a.jsx(Ao,{},`separator-${D}`):a.jsxs(Po,{dense:!0,onClick:q=>Ct(y,q),disabled:g||y.disabled,"data-cy":`${y.action}-blocklet`,children:[a.jsx(Ro,{style:{minWidth:24},children:p===y.action&&g?a.jsx(H,{size:16,sx:{marginRight:1}}):a.jsx(y.icon,{fontSize:"small"})}),a.jsx(Mo,{primary:y.name})]},y.name))]}),m&&a.jsx(Rt,{title:m.title,description:m.description,confirm:m.confirm,cancel:m.cancel,params:m.params,onConfirm:m.onConfirm,onCancel:m.onCancel})]}):a.jsxs(Ot,{"data-cy":"blocklet-actions",...c,children:[a.jsx(Oo,{children:be.filter(y=>!y.separator&&!y.onlyInMenu).map(y=>a.jsxs(mt,{title:y.name,"data-cy":`${y.action}-blocklet`,onClick:()=>Ct(y),disabled:!!y.disabled||g,children:[p===y.action&&g?a.jsx(H,{size:16,sx:{marginRight:1}}):a.jsx(y.icon,{}),a.jsx("span",{className:"blocklet-action-text",children:y.name})]},y.name))}),m&&a.jsx(Rt,{title:m.title,description:m.description,confirm:m.confirm,cancel:m.cancel,params:m.params,onConfirm:m.onConfirm,onCancel:m.onCancel})]})}bn.propTypes={getComponentUrl:w.func,blocklet:w.object.isRequired,onStart:w.func.isRequired,onComplete:w.func.isRequired,variant:w.oneOf(["menu","group"]),hasPermission:w.bool,useBlockletUrlEvaluation:w.func};const Ot=Oe.div`
3
3
  display: flex;
4
4
  align-items: center;
5
5
 
@@ -61,7 +61,7 @@ ${r}
61
61
  .header-brand-addon {
62
62
  display: block;
63
63
  }
64
- `;function Ki(){const{t:e,locale:t}=z(),{blocklet:n,launcherSession:r,refreshSubscription:o}=fe(),{connectApi:s,session:i,api:c}=gr(),[l,u]=x.useState(!1),[d,p]=x.useState(""),[f,g]=Lr({subscriptionURL:"#"});if(x.useEffect(()=>{(Dt(n,r)||Lt(r))&&br({launcherSessionId:n?.controller?.launcherSessionId,launcherUrl:n?.controller?.launcherUrl,locale:t}).then(v=>{g({subscriptionURL:v})}).catch(v=>{console.error("get subscription url error:",v)})},[n,r]),x.useEffect(()=>{if(n.controller?.launcherUrl){const v=Q(n.controller.launcherUrl,"__blocklet__.js?type=json");fetch(v).then(j=>j.json()).then(j=>{const S=j.componentMountPoints?.find(E=>E.did==="z2qaCNvKMv5GjouKdcDWexv6WqtHbpNPQDnAk")?.mountPoint,k=Q(n.controller.launcherUrl,S);p(k)})}},[n.controller?.launcherUrl]),!n||!r)return"";let b=null,m="",C="error";return xr(r)?(b=yr(r)?a.jsx(ke,{href:f.subscriptionURL,children:e("blocklet.manageSubscription")}):a.jsx(Ho,{variant:"text",color:"error",onClick:()=>u(!0),sx:{lineHeight:"inherit",fontSize:"inherit"},children:e("blocklet.payNow")}),m=e("blocklet.suspendedCausedByPastDue",{deadline:oe(r?.reservedUntil,t)})):Lt(r)?(b=a.jsx(ke,{href:f.subscriptionURL,children:e("blocklet.manageSubscription")}),m=e("blocklet.willBeSuspendedSoon",{deadline:oe((r?.subscription?.cancel_at||0)*1e3,t)}),C="warning"):Dt(n,r)?(b=a.jsx(ke,{href:f.subscriptionURL,children:e("blocklet.manageSubscription")}),m=e("blocklet.suspendedCausedByExpired",{deadline:oe(r?.reservedUntil,t),canceledAt:oe((r?.subscription?.canceled_at||0)*1e3,t)})):vr(n,r)&&(b=a.jsx(cn,{to:Q(P.WELLKNOWN_BLOCKLET_ADMIN_PATH,"/did-spaces"),children:e("common.backup")}),m=e("blocklet.suspendedCausedByTerminated",{canceledAt:oe(r?.terminatedAt,t),deadline:Sr(r?.terminatedAt,t)})),m?a.jsxs(a.Fragment,{children:[a.jsxs(gt,{severity:C,sx:{mb:1},children:[m,a.jsx(se,{sx:{display:"inline-block",fontSize:"inherit",lineHeight:"inherit",ml:1,a:{textDecoration:"auto"},"& .MuiButtonBase-root":{p:0,minWidth:"auto"}},children:b})]}),l&&d&&r&&a.jsx(wr,{session:i,connect:s,baseUrl:d,authToken:r.subscription.authToken,children:a.jsx(Fr,{dialogProps:{open:l,onClose:()=>u(!1)},subscriptionId:r.subscription.id,successToast:!0,onPaid:()=>{c.post("/blocklet/start?fromSetup=1"),o(),u(!1)}})})]}):null}const Gi=x.lazy(()=>_(()=>import("./log-ssfC90VX.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]))),Qi=x.lazy(()=>_(()=>import("./index-CiL_9BYm.js"),__vite__mapDeps([14,2,1,5,4,6,7,8,9,10,11,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,3,39,40,41,42,43,44]))),Zi=x.lazy(()=>_(()=>import("./index-AK4Fi3I2.js"),__vite__mapDeps([45,4,2,1,5,6,7,8,15,9,10,11,19,20,21,46,47,32,28,37,48]))),Xi=x.lazy(()=>_(()=>import("./index-Cylfu8Kg.js"),__vite__mapDeps([49,2,1,9,4,5,6,7,8,10,11,32,28,20,18,50,12,38,51,23,52,41,53,54,26,55,56,57,39,58,59,60,61,62,63,64]))),Ji=x.lazy(()=>_(()=>import("./overview-Xs3x6yXg.js"),__vite__mapDeps([65,1,2,4,5,6,7,8,66,67,9,10,11,31,40,30,19,20,21,18,68,69,70,54,3,28,32,39,41,42,43,44]))),Yi=x.lazy(()=>_(()=>import("./domains-BpVmxPqY.js"),__vite__mapDeps([71,2,4,1,5,6,7,8,9,10,11,72,41,22,20,40,30,32,28,37,60,23,29,31,73,53]))),ea=x.lazy(()=>_(()=>import("./index-C0mn0MnL.js"),__vite__mapDeps([74,2,6,5,1,4,7,8,9,10,11,18,19,20,21,75,15,34,35,46,76,22,77,78,79,32,28,51,41,80]))),ta=x.lazy(()=>_(()=>import("./appearance-C1k2L_bA.js"),__vite__mapDeps([81,5,2,9,1,4,6,7,8,10,11,46]))),na=x.lazy(()=>_(()=>import("./audit-logs-OO0l4GnY.js"),__vite__mapDeps([82,4,2,1,5,6,7,8,9,10,11,34,35,3,62,63,38,64,19,20,21]))),oa=x.lazy(()=>_(()=>import("./index-LdkiJabL.js"),__vite__mapDeps([83,2,1,5,4,6,7,8,9,10,11,47,21,84,85,86,38,31,87,88,12,19,20,15,34,35,18,89,40,30,90,91,28,92,93,26,27,46]))),ra=x.lazy(()=>_(()=>import("./config-navigation-JJehoQAV.js"),__vite__mapDeps([94,2,1,4,5,6,7,8,9,10,11,69,78,95,96,47,97,19,20,21,54,98,55,56,90,28,3,32,39,40,30,41,42,43,44]))),sa=x.lazy(()=>_(()=>import("./index-uY6moYTs.js"),__vite__mapDeps([99,1,2,6,5,9,4,7,8,10,11,46,100,101,67,76,54,102,103,70,28,31,93,39,104,61,51]))),ia=x.lazy(()=>_(()=>import("./index-CiW-jlCS.js"),__vite__mapDeps([105,4,2,1,5,6,7,8,9,10,11,47,104,61,84,85,66,31,35,106,46]))),aa=x.lazy(()=>_(()=>import("./security-BXhgiheS.js"),__vite__mapDeps([107,4,2,1,5,6,7,8,9,10,11,47,97,19,20,21,108,46]))),ca=x.lazy(()=>_(()=>import("./branding-CEu-c8uQ.js"),__vite__mapDeps([109,2,1,4,5,6,7,8,9,10,11,110,69,95,111,85,112,79,22,20,19,21,113,84]))),la=x.lazy(()=>_(()=>import("./advanced-B92lyz70.js"),__vite__mapDeps([114,2,1,9,4,5,6,7,8,10,11,22,20,32,28,41,84,85,23,19,21,31,18,68,69]))),ua=x.lazy(()=>_(()=>import("./traffic-CMI1Sbrr.js").then(e=>e.t),__vite__mapDeps([89,2,9,1,4,5,6,7,8,10,11,40,30,90,91,28,92,93,26,27]))),da=x.lazy(()=>_(()=>import("./runtime-DjILMoeT.js"),__vite__mapDeps([115,2,1,4,5,6,7,8,9,10,11,101,92,93,12,3,28,32,39,20,19,21,40,30,41,42,43,44]))),fa=x.lazy(()=>_(()=>import("./index-78a5Cdpe.js"),__vite__mapDeps([116,2,1,4,5,6,7,8,28,15,9,10,11,75,18,34,35,19,20,21,24,25,26,27,32,23,67,60,22,12,37,46,48]))),pa=x.lazy(()=>_(()=>import("./list-CYJEZSon.js"),__vite__mapDeps([117,2,4,1,5,6,7,8,15,9,10,11,40,30,17,19,20,21,47,24,25,26,27,50,23,60,32,28,75,18,34,35,37,48,46]))),ma=x.lazy(()=>_(()=>import("./index-BetmKk0p.js"),__vite__mapDeps([118,2,4,1,5,6,7,8,9,10,11,54,48,46,19,20,21]))),ha=x.lazy(()=>_(()=>import("./config-C6pSSzan.js"),__vite__mapDeps([119,2,1,6,5,21,9,4,7,8,10,11,84,85,112,111,79,57,39,58,95,120,28,15]))),ga=x.lazy(()=>_(()=>import("./observability-Cfy3MVZa.js"),__vite__mapDeps([121,1,2]))),ba=x.lazy(()=>_(()=>import("./playground-CC7NZ-_A.js"),__vite__mapDeps([122,1,2]))),xa=x.lazy(()=>_(()=>import("./component-D31UJpJQ.js"),__vite__mapDeps([123,1,2,5,4,6,7,8,9,10,11,28,104,61,22,20,26,91,96,56,110,69,95,23,76,124,59,60,32,39,18,57,125,126,53,103,70,54,85,127,77,78,112,113,86,62,63,120,3,31,73,46,128,102,100,101,67,129,130,80,90,12,37,19,21,40,30,41,42,43,44]))),ya=x.lazy(()=>_(()=>import("./index-B4OZ6pVW.js"),__vite__mapDeps([131,1,2,4,5,6,7,8,9,10,11]))),va=Q(P.WELLKNOWN_SERVICE_PATH_PREFIX,"user","notifications"),Sa=e=>{const{enqueueSnackbar:t}=tn(),n=x.useCallback(r=>Dr(va,{id:r.id,severity:r.severity||"all",componentDid:r.source==="system"?"system":r.componentDid||"all"}),[]);kr(`${e}/${P.EVENTS.NOTIFICATION_BLOCKLET_CREATE}`,r=>{const o=n(r),{severity:s,description:i}=r||{},c=["error","warning"].includes(s)||r.sticky;r.source==="system"&&t(i,{variant:s,autoHideDuration:c?null:5e3,content:l=>a.jsx(os,{viewAllUrl:o,keyId:l,notification:r,content:a.jsx(Nr,{notification:r,minimal:!0,rows:0})})})},[],"user")};function ro({blocklet:e,isAdmin:t}){return t?a.jsx(oa,{blocklet:e}):a.jsx(_r,{status:403})}ro.propTypes={blocklet:w.object.isRequired,isAdmin:w.bool.isRequired};const wa=e=>{const{t}=z(),{blocklet:n,actions:{refreshBlocklet:r},client:o,did:s}=fe(),i=n?.meta?.did,c=!n||Ir(n.status)?[]:N.getAppMissingConfigs(n),l={overview:[{label:t("common.overview"),value:"overview"},{label:a.jsx(Wo,{"data-cy":"blocklet-list",color:"error",variant:"dot",invisible:!c.length,children:t("common.components")}),labelText:t("common.components"),value:"components"}],"did-connect":[{label:t("common.members"),value:"members"},{label:t("team.member.passports"),value:"passports"},{label:t("common.setting"),value:"settings"},{label:t("common.security"),value:"security"},{label:t("oauth.client.tab"),value:"oauth"}],aigne:[{label:t("setup.aigne.config"),value:"aigne-config"}],website:[{label:t("common.domains"),value:"domains"},{label:t("common.branding"),value:"branding"},{label:t("common.theming"),value:"theming"},{label:t("common.navigation"),value:"navigation"}],operations:[{label:t("common.notificationRecords"),value:"notifications",show:e},{label:t("common.analytics"),value:"analytics"},{label:t("common.auditLogs"),value:"audit-logs"},{label:t("common.advancedConfig"),value:"advanced"}],integrations:[{label:"Webhooks",value:"webhooks",show:e},{label:t("common.accessKeys"),value:"access-keys"},{label:t("common.mcpServers"),value:"mcp-servers"}],developers:[{label:t("common.logs"),value:"logs",show:n?.children?.length&&n.structVersion===P.APP_STRUCT_VERSION},{label:t("common.performance"),value:"performance"},{label:t("common.docs"),value:"docs"}]},u={overview:Ji,components:xa,members:a.jsx(Qi,{type:"blocklet",createPassportSvg:At}),passports:a.jsx(ea,{createPassportSvg:At}),settings:a.jsx(ia,{orientation:"vertical"}),security:a.jsx(aa,{}),"did-spaces":a.jsx(sa,{navOrientation:"horizontal"}),domains:Yi,branding:a.jsx(ca,{blocklet:n,onUpdate:r}),theming:a.jsx(ta,{}),navigation:ra,sitemap:a.jsx(yo,{children:t("common.comingSoon")}),notifications:a.jsx(ro,{blocklet:n,isAdmin:e}),"audit-logs":a.jsx(na,{scope:i,categories:["blocklet","team","security","certificates","gateway"]}),analytics:a.jsx(ua,{client:o,did:s}),advanced:a.jsx(la,{blocklet:n,onUpdate:r}),webhooks:a.jsx(Zi,{}),"access-keys":a.jsx(fa,{}),"mcp-servers":a.jsx(ma,{}),logs:Gi,performance:a.jsx(da,{client:o,did:s}),docs:ya,publish:a.jsx(Xi,{}),oauth:a.jsx(pa,{}),"aigne-config":a.jsx(I,{sx:{maxWidth:1536},children:a.jsx(ha,{})}),"aigne-observability":a.jsx(ga,{}),"aigne-playground":a.jsx(ba,{})};return{tabGroups:l,renders:u}};function ja(){const e=ln(),{tab:t="overview",subtab:n}=Go(),{locale:r}=z(),{blocklet:o,refreshFlag:s}=fe(),{session:i}=fn(),c=ie(()=>i?.user?.did,[i]),l=zr(),u=ie(()=>i.user?.role&&Cr.includes(i.user.role),[i]);Sa(c);const{tabGroups:d,renders:p}=wa(u),f=S=>{e(`${P.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/${t}/${S}`)},g=(d[t]||[]).filter(S=>S.show===void 0||S.show),b=(g||[]).find(S=>S.value===n)?.value||g?.[0]?.value||t,m=p[b]||p.overview,C=["overview"].includes(t),v=o?a.jsxs(gn,{type:"components",children:[g.length>0&&a.jsxs(I,{sx:{mb:2,display:"flex",alignItems:"center",gap:2},children:[a.jsx(xo,{tabs:g,current:b,onChange:f,scrollButtons:"auto"}),C&&!l&&a.jsx(I,{sx:{flex:1,display:"flex",justifyContent:"flex-end"},children:a.jsx(I,{component:"div",className:"page-header",children:o?a.jsx(Nt,{className:"page-actions",hasPermission:!0,blocklet:o,onStart:()=>{},onComplete:({error:S}={})=>{S&&F.error(S.message)},variant:"group"}):null})})]}),a.jsx(I,{className:"page-content",children:a.jsx(x.Suspense,{fallback:a.jsx(Le,{relative:"parent",children:a.jsx(H,{})}),children:x.isValidElement(m)?m:a.jsx(m,{blocklet:o})})})]}):a.jsx(Le,{relative:"parent",children:a.jsx(H,{})}),j=ie(()=>{const S=window.blocklet?.navigation?.find(R=>R.id==="/team"&&R.section==="dashboard"),k=o?.meta?.title||"";let E="";if(S){const R=Q(P.WELLKNOWN_BLOCKLET_ADMIN_PATH,t,t==="publish"?n:"");E=S.items.find(He=>He.link===R)?.title?.[r]||""}const h=g.find(R=>R.value===n),M=[h?.labelText||h?.label||g?.[0]?.labelText||g?.[0]?.label||"",E].filter(Boolean).join(" - ");return k?M?`${M} | ${k}`:k:M||""},[t,n,o,r]);return a.jsx(Er,{children:a.jsx(Or,{children:a.jsx(oo,{title:j,children:a.jsxs(Ea,{children:[l&&C&&a.jsx(I,{component:"div",className:"page-header",sx:{mb:2},children:o?a.jsx(Nt,{className:"page-actions",hasPermission:!0,blocklet:o,onStart:()=>{},onComplete:({error:S}={})=>{S&&F.error(S.message)},variant:"group"}):null}),a.jsx(Qr,{}),a.jsx(Ki,{}),v]})},`${s}`)})})}function Ca(){const{blocklet:e}=fe(),t=e?.meta?.did;return x.useEffect(()=>{const n=jr();return t&&n.connect(),()=>{t&&n.isConnected()&&n.disconnect()}},[t]),a.jsx(ja,{})}const Ea=Oe.main`
64
+ `;function Ki(){const{t:e,locale:t}=z(),{blocklet:n,launcherSession:r,refreshSubscription:o}=fe(),{connectApi:s,session:i,api:c}=gr(),[l,u]=x.useState(!1),[d,p]=x.useState(""),[f,g]=Lr({subscriptionURL:"#"});if(x.useEffect(()=>{(Dt(n,r)||Lt(r))&&br({launcherSessionId:n?.controller?.launcherSessionId,launcherUrl:n?.controller?.launcherUrl,locale:t}).then(v=>{g({subscriptionURL:v})}).catch(v=>{console.error("get subscription url error:",v)})},[n,r]),x.useEffect(()=>{if(n.controller?.launcherUrl){const v=Q(n.controller.launcherUrl,"__blocklet__.js?type=json");fetch(v).then(j=>j.json()).then(j=>{const S=j.componentMountPoints?.find(E=>E.did==="z2qaCNvKMv5GjouKdcDWexv6WqtHbpNPQDnAk")?.mountPoint,k=Q(n.controller.launcherUrl,S);p(k)})}},[n.controller?.launcherUrl]),!n||!r)return"";let b=null,m="",C="error";return xr(r)?(b=yr(r)?a.jsx(ke,{href:f.subscriptionURL,children:e("blocklet.manageSubscription")}):a.jsx(Ho,{variant:"text",color:"error",onClick:()=>u(!0),sx:{lineHeight:"inherit",fontSize:"inherit"},children:e("blocklet.payNow")}),m=e("blocklet.suspendedCausedByPastDue",{deadline:oe(r?.reservedUntil,t)})):Lt(r)?(b=a.jsx(ke,{href:f.subscriptionURL,children:e("blocklet.manageSubscription")}),m=e("blocklet.willBeSuspendedSoon",{deadline:oe((r?.subscription?.cancel_at||0)*1e3,t)}),C="warning"):Dt(n,r)?(b=a.jsx(ke,{href:f.subscriptionURL,children:e("blocklet.manageSubscription")}),m=e("blocklet.suspendedCausedByExpired",{deadline:oe(r?.reservedUntil,t),canceledAt:oe((r?.subscription?.canceled_at||0)*1e3,t)})):vr(n,r)&&(b=a.jsx(cn,{to:Q(P.WELLKNOWN_BLOCKLET_ADMIN_PATH,"/did-spaces"),children:e("common.backup")}),m=e("blocklet.suspendedCausedByTerminated",{canceledAt:oe(r?.terminatedAt,t),deadline:Sr(r?.terminatedAt,t)})),m?a.jsxs(a.Fragment,{children:[a.jsxs(gt,{severity:C,sx:{mb:1},children:[m,a.jsx(se,{sx:{display:"inline-block",fontSize:"inherit",lineHeight:"inherit",ml:1,a:{textDecoration:"auto"},"& .MuiButtonBase-root":{p:0,minWidth:"auto"}},children:b})]}),l&&d&&r&&a.jsx(wr,{session:i,connect:s,baseUrl:d,authToken:r.subscription.authToken,children:a.jsx(Fr,{dialogProps:{open:l,onClose:()=>u(!1)},subscriptionId:r.subscription.id,successToast:!0,onPaid:()=>{c.post("/blocklet/start?fromSetup=1"),o(),u(!1)}})})]}):null}const Gi=x.lazy(()=>_(()=>import("./log-DmRKBFGC.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]))),Qi=x.lazy(()=>_(()=>import("./index-D9V5Umc7.js"),__vite__mapDeps([14,2,1,5,4,6,7,8,9,10,11,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,3,39,40,41,42,43,44]))),Zi=x.lazy(()=>_(()=>import("./index-sgUJ1UrA.js"),__vite__mapDeps([45,4,2,1,5,6,7,8,15,9,10,11,19,20,21,46,47,32,28,37,48]))),Xi=x.lazy(()=>_(()=>import("./index-DSXRZM65.js"),__vite__mapDeps([49,2,1,9,4,5,6,7,8,10,11,32,28,20,18,50,12,38,51,23,52,41,53,54,26,55,56,57,39,58,59,60,61,62,63,64]))),Ji=x.lazy(()=>_(()=>import("./overview-BmpIT6Q_.js"),__vite__mapDeps([65,1,2,4,5,6,7,8,66,67,9,10,11,31,40,30,19,20,21,18,68,69,70,54,3,28,32,39,41,42,43,44]))),Yi=x.lazy(()=>_(()=>import("./domains-CmO_JEoH.js"),__vite__mapDeps([71,2,4,1,5,6,7,8,9,10,11,72,41,22,20,40,30,32,28,37,60,23,29,31,73,53]))),ea=x.lazy(()=>_(()=>import("./index-LNOwklRT.js"),__vite__mapDeps([74,2,6,5,1,4,7,8,9,10,11,18,19,20,21,75,15,34,35,46,76,22,77,78,79,32,28,51,41,80]))),ta=x.lazy(()=>_(()=>import("./appearance-BeyMAsY0.js"),__vite__mapDeps([81,5,2,9,1,4,6,7,8,10,11,46]))),na=x.lazy(()=>_(()=>import("./audit-logs-BITrjM7H.js"),__vite__mapDeps([82,4,2,1,5,6,7,8,9,10,11,34,35,3,62,63,38,64,19,20,21]))),oa=x.lazy(()=>_(()=>import("./index-Bh3Eqgyw.js"),__vite__mapDeps([83,2,1,5,4,6,7,8,9,10,11,47,21,84,85,86,38,31,87,88,12,19,20,15,34,35,18,89,40,30,90,91,28,92,93,26,27,46]))),ra=x.lazy(()=>_(()=>import("./config-navigation-XlR3iC8u.js"),__vite__mapDeps([94,2,1,4,5,6,7,8,9,10,11,69,78,95,96,47,97,19,20,21,54,98,55,56,90,28,3,32,39,40,30,41,42,43,44]))),sa=x.lazy(()=>_(()=>import("./index-C0rREY1Q.js"),__vite__mapDeps([99,1,2,6,5,9,4,7,8,10,11,46,100,101,67,76,54,102,103,70,28,31,93,39,104,61,51]))),ia=x.lazy(()=>_(()=>import("./index-CK7BAVRn.js"),__vite__mapDeps([105,4,2,1,5,6,7,8,9,10,11,47,104,61,84,85,66,31,35,106,46]))),aa=x.lazy(()=>_(()=>import("./security-DZamcnzN.js"),__vite__mapDeps([107,4,2,1,5,6,7,8,9,10,11,47,97,19,20,21,108,46]))),ca=x.lazy(()=>_(()=>import("./branding-CUo9AQgP.js"),__vite__mapDeps([109,2,1,4,5,6,7,8,9,10,11,110,69,95,111,85,112,79,22,20,19,21,113,84]))),la=x.lazy(()=>_(()=>import("./advanced-CVn4Hcf5.js"),__vite__mapDeps([114,2,1,9,4,5,6,7,8,10,11,22,20,32,28,41,84,85,23,19,21,31,18,68,69]))),ua=x.lazy(()=>_(()=>import("./traffic-DTdSCUkM.js").then(e=>e.t),__vite__mapDeps([89,2,9,1,4,5,6,7,8,10,11,40,30,90,91,28,92,93,26,27]))),da=x.lazy(()=>_(()=>import("./runtime-CVbnWFXH.js"),__vite__mapDeps([115,2,1,4,5,6,7,8,9,10,11,101,92,93,12,3,28,32,39,20,19,21,40,30,41,42,43,44]))),fa=x.lazy(()=>_(()=>import("./index-BXQsZlT0.js"),__vite__mapDeps([116,2,1,4,5,6,7,8,28,15,9,10,11,75,18,34,35,19,20,21,24,25,26,27,32,23,67,60,22,12,37,46,48]))),pa=x.lazy(()=>_(()=>import("./list-DBxh165t.js"),__vite__mapDeps([117,2,4,1,5,6,7,8,15,9,10,11,40,30,17,19,20,21,47,24,25,26,27,50,23,60,32,28,75,18,34,35,37,48,46]))),ma=x.lazy(()=>_(()=>import("./index-ClmgRx8j.js"),__vite__mapDeps([118,2,4,1,5,6,7,8,9,10,11,54,48,46,19,20,21]))),ha=x.lazy(()=>_(()=>import("./config-yZbzEM9S.js"),__vite__mapDeps([119,2,1,6,5,21,9,4,7,8,10,11,84,85,112,111,79,57,39,58,95,120,28,15]))),ga=x.lazy(()=>_(()=>import("./observability-Cfy3MVZa.js"),__vite__mapDeps([121,1,2]))),ba=x.lazy(()=>_(()=>import("./playground-CC7NZ-_A.js"),__vite__mapDeps([122,1,2]))),xa=x.lazy(()=>_(()=>import("./component-tmpSeXZN.js"),__vite__mapDeps([123,1,2,5,4,6,7,8,9,10,11,28,104,61,22,20,26,91,96,56,110,69,95,23,76,124,59,60,32,39,18,57,125,126,53,103,70,54,85,127,77,78,112,113,86,62,63,120,3,31,73,46,128,102,100,101,67,129,130,80,90,12,37,19,21,40,30,41,42,43,44]))),ya=x.lazy(()=>_(()=>import("./index-DXEP0e1N.js"),__vite__mapDeps([131,1,2,4,5,6,7,8,9,10,11]))),va=Q(P.WELLKNOWN_SERVICE_PATH_PREFIX,"user","notifications"),Sa=e=>{const{enqueueSnackbar:t}=tn(),n=x.useCallback(r=>Dr(va,{id:r.id,severity:r.severity||"all",componentDid:r.source==="system"?"system":r.componentDid||"all"}),[]);kr(`${e}/${P.EVENTS.NOTIFICATION_BLOCKLET_CREATE}`,r=>{const o=n(r),{severity:s,description:i}=r||{},c=["error","warning"].includes(s)||r.sticky;r.source==="system"&&t(i,{variant:s,autoHideDuration:c?null:5e3,content:l=>a.jsx(os,{viewAllUrl:o,keyId:l,notification:r,content:a.jsx(Nr,{notification:r,minimal:!0,rows:0})})})},[],"user")};function ro({blocklet:e,isAdmin:t}){return t?a.jsx(oa,{blocklet:e}):a.jsx(_r,{status:403})}ro.propTypes={blocklet:w.object.isRequired,isAdmin:w.bool.isRequired};const wa=e=>{const{t}=z(),{blocklet:n,actions:{refreshBlocklet:r},client:o,did:s}=fe(),i=n?.meta?.did,c=!n||Ir(n.status)?[]:N.getAppMissingConfigs(n),l={overview:[{label:t("common.overview"),value:"overview"},{label:a.jsx(Wo,{"data-cy":"blocklet-list",color:"error",variant:"dot",invisible:!c.length,children:t("common.components")}),labelText:t("common.components"),value:"components"}],"did-connect":[{label:t("common.members"),value:"members"},{label:t("team.member.passports"),value:"passports"},{label:t("common.setting"),value:"settings"},{label:t("common.security"),value:"security"},{label:t("oauth.client.tab"),value:"oauth"}],aigne:[{label:t("setup.aigne.config"),value:"aigne-config"}],website:[{label:t("common.domains"),value:"domains"},{label:t("common.branding"),value:"branding"},{label:t("common.theming"),value:"theming"},{label:t("common.navigation"),value:"navigation"}],operations:[{label:t("common.notificationRecords"),value:"notifications",show:e},{label:t("common.analytics"),value:"analytics"},{label:t("common.auditLogs"),value:"audit-logs"},{label:t("common.advancedConfig"),value:"advanced"}],integrations:[{label:"Webhooks",value:"webhooks",show:e},{label:t("common.accessKeys"),value:"access-keys"},{label:t("common.mcpServers"),value:"mcp-servers"}],developers:[{label:t("common.logs"),value:"logs",show:n?.children?.length&&n.structVersion===P.APP_STRUCT_VERSION},{label:t("common.performance"),value:"performance"},{label:t("common.docs"),value:"docs"}]},u={overview:Ji,components:xa,members:a.jsx(Qi,{type:"blocklet",createPassportSvg:At}),passports:a.jsx(ea,{createPassportSvg:At}),settings:a.jsx(ia,{orientation:"vertical"}),security:a.jsx(aa,{}),"did-spaces":a.jsx(sa,{navOrientation:"horizontal"}),domains:Yi,branding:a.jsx(ca,{blocklet:n,onUpdate:r}),theming:a.jsx(ta,{}),navigation:ra,sitemap:a.jsx(yo,{children:t("common.comingSoon")}),notifications:a.jsx(ro,{blocklet:n,isAdmin:e}),"audit-logs":a.jsx(na,{scope:i,categories:["blocklet","team","security","certificates","gateway"]}),analytics:a.jsx(ua,{client:o,did:s}),advanced:a.jsx(la,{blocklet:n,onUpdate:r}),webhooks:a.jsx(Zi,{}),"access-keys":a.jsx(fa,{}),"mcp-servers":a.jsx(ma,{}),logs:Gi,performance:a.jsx(da,{client:o,did:s}),docs:ya,publish:a.jsx(Xi,{}),oauth:a.jsx(pa,{}),"aigne-config":a.jsx(I,{sx:{maxWidth:1536},children:a.jsx(ha,{})}),"aigne-observability":a.jsx(ga,{}),"aigne-playground":a.jsx(ba,{})};return{tabGroups:l,renders:u}};function ja(){const e=ln(),{tab:t="overview",subtab:n}=Go(),{locale:r}=z(),{blocklet:o,refreshFlag:s}=fe(),{session:i}=fn(),c=ie(()=>i?.user?.did,[i]),l=zr(),u=ie(()=>i.user?.role&&Cr.includes(i.user.role),[i]);Sa(c);const{tabGroups:d,renders:p}=wa(u),f=S=>{e(`${P.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/${t}/${S}`)},g=(d[t]||[]).filter(S=>S.show===void 0||S.show),b=(g||[]).find(S=>S.value===n)?.value||g?.[0]?.value||t,m=p[b]||p.overview,C=["overview"].includes(t),v=o?a.jsxs(gn,{type:"components",children:[g.length>0&&a.jsxs(I,{sx:{mb:2,display:"flex",alignItems:"center",gap:2},children:[a.jsx(xo,{tabs:g,current:b,onChange:f,scrollButtons:"auto"}),C&&!l&&a.jsx(I,{sx:{flex:1,display:"flex",justifyContent:"flex-end"},children:a.jsx(I,{component:"div",className:"page-header",children:o?a.jsx(Nt,{className:"page-actions",hasPermission:!0,blocklet:o,onStart:()=>{},onComplete:({error:S}={})=>{S&&F.error(S.message)},variant:"group"}):null})})]}),a.jsx(I,{className:"page-content",children:a.jsx(x.Suspense,{fallback:a.jsx(Le,{relative:"parent",children:a.jsx(H,{})}),children:x.isValidElement(m)?m:a.jsx(m,{blocklet:o})})})]}):a.jsx(Le,{relative:"parent",children:a.jsx(H,{})}),j=ie(()=>{const S=window.blocklet?.navigation?.find(R=>R.id==="/team"&&R.section==="dashboard"),k=o?.meta?.title||"";let E="";if(S){const R=Q(P.WELLKNOWN_BLOCKLET_ADMIN_PATH,t,t==="publish"?n:"");E=S.items.find(He=>He.link===R)?.title?.[r]||""}const h=g.find(R=>R.value===n),M=[h?.labelText||h?.label||g?.[0]?.labelText||g?.[0]?.label||"",E].filter(Boolean).join(" - ");return k?M?`${M} | ${k}`:k:M||""},[t,n,o,r]);return a.jsx(Er,{children:a.jsx(Or,{children:a.jsx(oo,{title:j,children:a.jsxs(Ea,{children:[l&&C&&a.jsx(I,{component:"div",className:"page-header",sx:{mb:2},children:o?a.jsx(Nt,{className:"page-actions",hasPermission:!0,blocklet:o,onStart:()=>{},onComplete:({error:S}={})=>{S&&F.error(S.message)},variant:"group"}):null}),a.jsx(Qr,{}),a.jsx(Ki,{}),v]})},`${s}`)})})}function Ca(){const{blocklet:e}=fe(),t=e?.meta?.did;return x.useEffect(()=>{const n=jr();return t&&n.connect(),()=>{t&&n.isConnected()&&n.disconnect()}},[t]),a.jsx(ja,{})}const Ea=Oe.main`
65
65
  .page-header {
66
66
  display: flex;
67
67
  justify-content: space-between;
@@ -1 +1 @@
1
- import{j as e,ak as o,aX as h,T as j,z as g,W as i}from"./vendor-mui-core-BOHKtf8y.js";import{T as _}from"./vendor-ux-Cra9XTth.js";import{C as b}from"./click-to-copy-EOhAhdSS.js";import{C as T}from"./confirm-Cx2owMMo.js";function k({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(T,{title:n.title,description:n.description,confirm:n.confirm,cancel:n.cancel,params:n.params,onConfirm:n.onConfirm,onCancel:n.onCancel})}k.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{k as D};
1
+ import{j as e,ak as o,aX as h,T as j,z as g,W as i}from"./vendor-mui-core-BOHKtf8y.js";import{T as _}from"./vendor-ux-Cra9XTth.js";import{C as b}from"./click-to-copy-EOhAhdSS.js";import{C as T}from"./confirm-BE3P2t7f.js";function k({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(T,{title:n.title,description:n.description,confirm:n.confirm,cancel:n.cancel,params:n.params,onConfirm:n.onConfirm,onCancel:n.onCancel})}k.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{k as D};
@@ -1,4 +1,4 @@
1
- import{j as o,ak as i,at as k,W as u}from"./vendor-mui-core-BOHKtf8y.js";import{m as v,f as C,a2 as b,e as B}from"./index-Cbf4geph.js";import{D as E,a as I,b as w}from"./domain-action-card-CnvZTstr.js";import{b as T}from"./vendor-ux-Cra9XTth.js";import{a as W}from"./page-header-18voA300.js";import{r,u as A}from"./vendor-react-Dvs43sk9.js";import{u as L}from"./useSetState-DFuQZPPV.js";import{S as x}from"./button-VEuIVOxr.js";import{S as $}from"./layout-zg5WZEdp.js";import{S as z}from"./step-actions-DmraEWCH.js";import"./vendor-arcblock--zSibe1w.js";import"./vendor-utils-BOkrEpKO.js";import"./vendor-hooks-DTeIFVkk.js";import"./permission-DqaOkW_Z.js";import"./session-89Q1nGxB.js";import"./dot-CE8yAFCN.js";import"./useAsync-BdgUavMa.js";import"./confirm-Cx2owMMo.js";import"./index-DBs9Ljax.js";import"./actions-B0rWiAuM.js";import"./delete-confirm-Wa3xVOUM.js";import"./click-to-copy-EOhAhdSS.js";import"./useAsync-DgPr_To1.js";import"./index-B-k9otcQ.js";import"./util-DQF9oPrf.js";import"./engine-BD3-KjxK.js";import"./lottie-web-4koyQiv_.js";import"./content-layout-BZKNdb6s.js";import"./use-mobile-BDciCFXT.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]=A();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(W,{title:s("setup.domain.title"),subTitle:s("setup.domain.subTitle"),onClickBack:f})}),o.jsxs(i,{className:"form",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 g={domain:t.domain,type:t.type,nftDid:t.nftDid,chainHost:t.chainHost};l.set("redirect",t.domain),P(l,{replace:!0}),m(g),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=k($)`
1
+ import{j as o,ak as i,at as k,W as u}from"./vendor-mui-core-BOHKtf8y.js";import{m as v,f as C,a2 as b,e as B}from"./index-BGbMta1w.js";import{D as E,a as I,b as w}from"./domain-action-card-cQQZnRXd.js";import{b as T}from"./vendor-ux-Cra9XTth.js";import{a as W}from"./page-header-18voA300.js";import{r,u as A}from"./vendor-react-Dvs43sk9.js";import{u as L}from"./useSetState-DFuQZPPV.js";import{S as x}from"./button-VEuIVOxr.js";import{S as $}from"./layout-DE-cz95w.js";import{S as z}from"./step-actions-CAm14q1m.js";import"./vendor-arcblock--zSibe1w.js";import"./vendor-utils-BOkrEpKO.js";import"./vendor-hooks-DTeIFVkk.js";import"./permission-jA6KoYLs.js";import"./session-DwRV85k4.js";import"./dot-CE8yAFCN.js";import"./useAsync-BdgUavMa.js";import"./confirm-BE3P2t7f.js";import"./index-DBs9Ljax.js";import"./actions-B0rWiAuM.js";import"./delete-confirm-BxYuZyLa.js";import"./click-to-copy-EOhAhdSS.js";import"./useAsync-DgPr_To1.js";import"./index-B-k9otcQ.js";import"./util-D2_crIYF.js";import"./engine-te2i4Xkp.js";import"./lottie-web-4koyQiv_.js";import"./content-layout-BZKNdb6s.js";import"./use-mobile-BDciCFXT.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]=A();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(W,{title:s("setup.domain.title"),subTitle:s("setup.domain.subTitle"),onClickBack:f})}),o.jsxs(i,{className:"form",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 g={domain:t.domain,type:t.type,nftDid:t.nftDid,chainHost:t.chainHost};l.set("redirect",t.domain),P(l,{replace:!0}),m(g),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=k($)`
2
2
  height: 100%;
3
3
  overflow-y: hidden;
4
4
 
@@ -1,4 +1,4 @@
1
- import{at as bn,Q as vn,T as A,a as Cn,H as E,n as te,G as wn,S as ze}from"./vendor-ux-Cra9XTth.js";import{j as e,d2 as Ne,d3 as Rn,ak as h,a6 as z,b0 as Sn,T as S,aX as ye,D as H,J as ie,am as L,aN as $e,W as t,ca as _e,M as Oe,aO as An,aP as kn,d4 as Tn,b7 as In,b9 as Pn,d5 as qn,d6 as En,b1 as W,P as We,cm as Ln,bf as Fn,at as Mn,a$ as Bn,d7 as Un,d8 as zn,d9 as Nn,da as $n,db as Te,dc as _,dd as _n,z as On,n as Wn,bd as Hn,de as Vn,cg as Gn}from"./vendor-mui-core-BOHKtf8y.js";import{C as ee,J as Kn,a as Qn,e as Jn,H as je,a6 as Xn,a7 as Zn,n as Q}from"./vendor-utils-BOkrEpKO.js";import{r as j,e as He,g as Yn}from"./vendor-react-Dvs43sk9.js";import{u as se}from"./useSetState-DFuQZPPV.js";import{l as et,k as nt,b as J,m as tt,v as it}from"./vendor-hooks-DTeIFVkk.js";import{bp as Ve,a5 as Ge,bq as st,br as Ke,U as F,a1 as oe,R as Ie,af as ot,aK as Pe,bs as rt,ap as at,a3 as lt,bt as Qe,a2 as fe,bu as Je,bv as ct,bw as dt,bx as mt,aM as ut,f as xe,by as pt,bz as ft}from"./index-Cbf4geph.js";import{w as Xe}from"./permission-DqaOkW_Z.js";import{u as xt,D as qe}from"./dot-CE8yAFCN.js";import{C as re}from"./confirm-Cx2owMMo.js";import{A as ht}from"./actions-B0rWiAuM.js";import{D as gt}from"./delete-confirm-Wa3xVOUM.js";import{o as Ee}from"./vendor-arcblock--zSibe1w.js";import{u as Dt}from"./useAsync-DgPr_To1.js";import{f as N}from"./index-DBs9Ljax.js";import{v as yt}from"./index-B-k9otcQ.js";import{g as jt,p as Le}from"./util-DQF9oPrf.js";import{C as bt}from"./click-to-copy-EOhAhdSS.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 Ze=(...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=Kn(n,{opener:window.location.origin}),l},Rt="z2qaGosS3rZ7m5ttP3Nd4V4qczR9TryTcRV4p",Ye=async n=>{if(!n||!n?.trim())return null;const i=Ze(),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===Rt),r=new URL(n);r.pathname=s?.mountPoint;const u=r.toString(),l=ee(u,"/api");return{base:u,api:l}},St=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:St},Tt=async({didDomainURL:n,delegatee:i,delegateePk:o})=>{const a=await Ye(n);if(!a)return null;const s=Ze({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=J(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=J(()=>{p({currentState:1})}),x=J(()=>{if(p({currentState:2}),!c.data){console.error("Failed to create session");return}b({sessionId:c.data.sessionId,baseURL:c.data.baseURL})}),b=J(({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(Rn,{}),...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(z,{size:50}),m.currentState===4&&e.jsx(Sn,{sx:{color:"primary.main",fontSize:"5rem"}}),m.currentState===2&&e.jsx(S,{children:l("buy.status.inProgress")}),m.currentState===4&&e.jsx(S,{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 Ye(i);return x?x.base:null});if(!g.value)return null;if(g.loading)return e.jsx(z,{});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,R)=>{T.domain===i&&(u(!1),p(!1),f&&b!=="setup"&&(R==="success"?E.success(l("setup.domain.genCertSuccess",{domain:T.domain})):R==="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},U=T=>{T.stopPropagation(),g(M)};return e.jsxs(e.Fragment,{children:[r?e.jsx(L,{title:l("router.cert.issuing"),children:e.jsx(z,{size:13,style:{fontSize:"13px"}})}):a({loading:m,open:U}),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)||!Ke(n)||Qn(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(z,{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(S,{component:"div",style:{marginLeft:"16px"},children:[e.jsx(S,{component:"div",style:{fontWeight:"bold"},children:n.domain}),e.jsx(S,{component:"div",children:`${s("common.issuer")}: ${Jn(n,"issuer.commonName","")}`}),e.jsx(S,{component:"div",children:`${s("router.cert.issuedOn")}: ${Pe(n.validFrom,r)}`}),e.jsx(S,{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(!Ke(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=Xe(be,"mutate_blocklets"),Ft=Xe(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(()=>Qe(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(Y,{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(Y,{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(Y,{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(z,{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 X({children:n=null}){return e.jsx(h,{component:"span",sx:{verticalAlign:"bottom"},children:n})}X.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(ze,{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(X,{children:o}),e.jsx(L,{title:s("blocklet.router.checkUrlAccessible"),placement:"top-end",children:e.jsx(h,{component:"span",className:"status",children:e.jsx(z,{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(X,{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(X,{children:o})]})}he.propTypes={domain:ae.isRequired,children:t.any.isRequired,suffix:t.node};const me=Mn(h)`
1
+ import{at as bn,Q as vn,T as A,a as Cn,H as E,n as te,G as wn,S as ze}from"./vendor-ux-Cra9XTth.js";import{j as e,d2 as Ne,d3 as Rn,ak as h,a6 as z,b0 as Sn,T as S,aX as ye,D as H,J as ie,am as L,aN as $e,W as t,ca as _e,M as Oe,aO as An,aP as kn,d4 as Tn,b7 as In,b9 as Pn,d5 as qn,d6 as En,b1 as W,P as We,cm as Ln,bf as Fn,at as Mn,a$ as Bn,d7 as Un,d8 as zn,d9 as Nn,da as $n,db as Te,dc as _,dd as _n,z as On,n as Wn,bd as Hn,de as Vn,cg as Gn}from"./vendor-mui-core-BOHKtf8y.js";import{C as ee,J as Kn,a as Qn,e as Jn,H as je,a6 as Xn,a7 as Zn,n as Q}from"./vendor-utils-BOkrEpKO.js";import{r as j,e as He,g as Yn}from"./vendor-react-Dvs43sk9.js";import{u as se}from"./useSetState-DFuQZPPV.js";import{l as et,k as nt,b as J,m as tt,v as it}from"./vendor-hooks-DTeIFVkk.js";import{bp as Ve,a5 as Ge,bq as st,br as Ke,U as F,a1 as oe,R as Ie,af as ot,aK as Pe,bs as rt,ap as at,a3 as lt,bt as Qe,a2 as fe,bu as Je,bv as ct,bw as dt,bx as mt,aM as ut,f as xe,by as pt,bz as ft}from"./index-BGbMta1w.js";import{w as Xe}from"./permission-jA6KoYLs.js";import{u as xt,D as qe}from"./dot-CE8yAFCN.js";import{C as re}from"./confirm-BE3P2t7f.js";import{A as ht}from"./actions-B0rWiAuM.js";import{D as gt}from"./delete-confirm-BxYuZyLa.js";import{o as Ee}from"./vendor-arcblock--zSibe1w.js";import{u as Dt}from"./useAsync-DgPr_To1.js";import{f as N}from"./index-DBs9Ljax.js";import{v as yt}from"./index-B-k9otcQ.js";import{g as jt,p as Le}from"./util-D2_crIYF.js";import{C as bt}from"./click-to-copy-EOhAhdSS.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 Ze=(...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=Kn(n,{opener:window.location.origin}),l},Rt="z2qaGosS3rZ7m5ttP3Nd4V4qczR9TryTcRV4p",Ye=async n=>{if(!n||!n?.trim())return null;const i=Ze(),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===Rt),r=new URL(n);r.pathname=s?.mountPoint;const u=r.toString(),l=ee(u,"/api");return{base:u,api:l}},St=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:St},Tt=async({didDomainURL:n,delegatee:i,delegateePk:o})=>{const a=await Ye(n);if(!a)return null;const s=Ze({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=J(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=J(()=>{p({currentState:1})}),x=J(()=>{if(p({currentState:2}),!c.data){console.error("Failed to create session");return}b({sessionId:c.data.sessionId,baseURL:c.data.baseURL})}),b=J(({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(Rn,{}),...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(z,{size:50}),m.currentState===4&&e.jsx(Sn,{sx:{color:"primary.main",fontSize:"5rem"}}),m.currentState===2&&e.jsx(S,{children:l("buy.status.inProgress")}),m.currentState===4&&e.jsx(S,{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 Ye(i);return x?x.base:null});if(!g.value)return null;if(g.loading)return e.jsx(z,{});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,R)=>{T.domain===i&&(u(!1),p(!1),f&&b!=="setup"&&(R==="success"?E.success(l("setup.domain.genCertSuccess",{domain:T.domain})):R==="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},U=T=>{T.stopPropagation(),g(M)};return e.jsxs(e.Fragment,{children:[r?e.jsx(L,{title:l("router.cert.issuing"),children:e.jsx(z,{size:13,style:{fontSize:"13px"}})}):a({loading:m,open:U}),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)||!Ke(n)||Qn(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(z,{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(S,{component:"div",style:{marginLeft:"16px"},children:[e.jsx(S,{component:"div",style:{fontWeight:"bold"},children:n.domain}),e.jsx(S,{component:"div",children:`${s("common.issuer")}: ${Jn(n,"issuer.commonName","")}`}),e.jsx(S,{component:"div",children:`${s("router.cert.issuedOn")}: ${Pe(n.validFrom,r)}`}),e.jsx(S,{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(!Ke(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=Xe(be,"mutate_blocklets"),Ft=Xe(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(()=>Qe(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(Y,{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(Y,{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(Y,{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(z,{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 X({children:n=null}){return e.jsx(h,{component:"span",sx:{verticalAlign:"bottom"},children:n})}X.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(ze,{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(X,{children:o}),e.jsx(L,{title:s("blocklet.router.checkUrlAccessible"),placement:"top-end",children:e.jsx(h,{component:"span",className:"status",children:e.jsx(z,{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(X,{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(X,{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-Dvs43sk9.js";import{T as n}from"./vendor-ux-Cra9XTth.js";import{a1 as p,U as l,a3 as c,f as u}from"./index-Cbf4geph.js";import{a as x,b as d}from"./domain-action-card-CnvZTstr.js";import{j as t,ak as k,b1 as f,aX as h}from"./vendor-mui-core-BOHKtf8y.js";import"./vendor-utils-BOkrEpKO.js";import"./vendor-hooks-DTeIFVkk.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock--zSibe1w.js";import"./useSetState-DFuQZPPV.js";import"./permission-DqaOkW_Z.js";import"./session-89Q1nGxB.js";import"./dot-CE8yAFCN.js";import"./useAsync-BdgUavMa.js";import"./confirm-Cx2owMMo.js";import"./index-DBs9Ljax.js";import"./actions-B0rWiAuM.js";import"./delete-confirm-Wa3xVOUM.js";import"./click-to-copy-EOhAhdSS.js";import"./useAsync-DgPr_To1.js";import"./index-B-k9otcQ.js";import"./util-DQF9oPrf.js";import"./engine-BD3-KjxK.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-Dvs43sk9.js";import{T as n}from"./vendor-ux-Cra9XTth.js";import{a1 as p,U as l,a3 as c,f as u}from"./index-BGbMta1w.js";import{a as x,b as d}from"./domain-action-card-cQQZnRXd.js";import{j as t,ak as k,b1 as f,aX as h}from"./vendor-mui-core-BOHKtf8y.js";import"./vendor-utils-BOkrEpKO.js";import"./vendor-hooks-DTeIFVkk.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock--zSibe1w.js";import"./useSetState-DFuQZPPV.js";import"./permission-jA6KoYLs.js";import"./session-DwRV85k4.js";import"./dot-CE8yAFCN.js";import"./useAsync-BdgUavMa.js";import"./confirm-BE3P2t7f.js";import"./index-DBs9Ljax.js";import"./actions-B0rWiAuM.js";import"./delete-confirm-BxYuZyLa.js";import"./click-to-copy-EOhAhdSS.js";import"./useAsync-DgPr_To1.js";import"./index-B-k9otcQ.js";import"./util-D2_crIYF.js";import"./engine-te2i4Xkp.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,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CgdhTqWX.js","assets/vendor-react-Dvs43sk9.js"])))=>i.map(i=>d[i]);
2
- import{T as M,c as q,_ as w,H as C,e as Q,f as J}from"./vendor-ux-Cra9XTth.js";import{j as t,b1 as f,b0 as X,b2 as Z,T as b,Q as T,a$ as ee,ak as B,z as $,a6 as te,at as se}from"./vendor-mui-core-BOHKtf8y.js";import{r as i,u as ne}from"./vendor-react-Dvs43sk9.js";import{H as g}from"./vendor-utils-BOkrEpKO.js";import{a as ie,F as h,e as O,c as j,H as oe,G as re}from"./index-Cbf4geph.js";import{l as ae}from"./vendor-arcblock--zSibe1w.js";import{K as ce}from"./landing-page-k9p91AEv.js";import{f as _}from"./index-DBs9Ljax.js";import{g as D}from"./get-safe-url-DOmcOTEp.js";import"./vendor-hooks-DTeIFVkk.js";import"./lottie-web-4koyQiv_.js";const le=se.form`
2
+ import{T as M,c as q,_ as w,H as C,e as Q,f as J}from"./vendor-ux-Cra9XTth.js";import{j as t,b1 as f,b0 as X,b2 as Z,T as b,Q as T,a$ as ee,ak as B,z as $,a6 as te,at as se}from"./vendor-mui-core-BOHKtf8y.js";import{r as i,u as ne}from"./vendor-react-Dvs43sk9.js";import{H as g}from"./vendor-utils-BOkrEpKO.js";import{a as ie,F as h,e as O,c as j,H as oe,G as re}from"./index-BGbMta1w.js";import{l as ae}from"./vendor-arcblock--zSibe1w.js";import{K as ce}from"./landing-page-CxWEfJb1.js";import{f as _}from"./index-DBs9Ljax.js";import{g as D}from"./get-safe-url-CoK26-Ak.js";import"./vendor-hooks-DTeIFVkk.js";import"./lottie-web-4koyQiv_.js";const le=se.form`
3
3
  display: flex;
4
4
  flex-direction: column;
5
5
  align-items: center;
@@ -0,0 +1 @@
1
+ import{W as e}from"./index-BGbMta1w.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-BOHKtf8y.js";import{r as T,i as k}from"./vendor-react-Dvs43sk9.js";import{o as j}from"./vendor-arcblock--zSibe1w.js";import{T as C,H as d,p as S}from"./vendor-ux-Cra9XTth.js";import{v as W,c as v,S as I,s as R,b as U}from"./index-Cbf4geph.js";import{K as b}from"./landing-page-k9p91AEv.js";import{w as L}from"./wrap-locale-DAzAra4f.js";import{g as N}from"./get-safe-url-DOmcOTEp.js";import"./vendor-utils-BOkrEpKO.js";import"./vendor-hooks-DTeIFVkk.js";import"./lottie-web-4koyQiv_.js";function _({SessionContext:n,webWalletUrl:a,onSuccess:o}){const{api:t,session:i}=T.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(v.WELLKNOWN_SERVICE_PATH_PREFIX)?f(c,{replace:!0}):window.location.href=N(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(j,{children:e.jsx(P,{})}):e.jsx(b,{did:window?.blocklet?.appPid||window?.env?.appPid,children:e.jsx(E,{sx:{maxWidth:"100%",height:"100%"},children:e.jsx(W,{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=L(_);function z(){const n=S(),a=(o,t)=>{o.sessionToken&&(R(t(o.sessionToken)),U(t(o.refreshToken)))};return e.jsx(B,{SessionContext:I,webWalletUrl:n,onSuccess:a})}export{z as default};
1
+ import{j as e,a6 as P,ak as E}from"./vendor-mui-core-BOHKtf8y.js";import{r as T,i as k}from"./vendor-react-Dvs43sk9.js";import{o as j}from"./vendor-arcblock--zSibe1w.js";import{T as C,H as d,p as S}from"./vendor-ux-Cra9XTth.js";import{v as W,c as v,S as I,s as R,b as U}from"./index-BGbMta1w.js";import{K as b}from"./landing-page-CxWEfJb1.js";import{w as L}from"./wrap-locale-COCKCQEf.js";import{g as N}from"./get-safe-url-CoK26-Ak.js";import"./vendor-utils-BOkrEpKO.js";import"./vendor-hooks-DTeIFVkk.js";import"./lottie-web-4koyQiv_.js";function _({SessionContext:n,webWalletUrl:a,onSuccess:o}){const{api:t,session:i}=T.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(v.WELLKNOWN_SERVICE_PATH_PREFIX)?f(c,{replace:!0}):window.location.href=N(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(j,{children:e.jsx(P,{})}):e.jsx(b,{did:window?.blocklet?.appPid||window?.env?.appPid,children:e.jsx(E,{sx:{maxWidth:"100%",height:"100%"},children:e.jsx(W,{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=L(_);function z(){const n=S(),a=(o,t)=>{o.sessionToken&&(R(t(o.sessionToken)),U(t(o.refreshToken)))};return e.jsx(B,{SessionContext:I,webWalletUrl:n,onSuccess:a})}export{z as default};
@@ -1,4 +1,4 @@
1
- import{D as w,j as o,a6 as v,T as B,bo as S}from"./vendor-mui-core-BOHKtf8y.js";import{o as T}from"./vendor-arcblock--zSibe1w.js";import{T as k,a as M}from"./vendor-ux-Cra9XTth.js";import{r as _}from"./vendor-react-Dvs43sk9.js";import{l as P}from"./vendor-hooks-DTeIFVkk.js";import{Y as F,L as D}from"./index-Cbf4geph.js";import"./vendor-utils-BOkrEpKO.js";import"./lottie-web-4koyQiv_.js";const{Elements:I,PaymentElement:R,useElements:z,useStripe:N,loadStripe:L,LinkAuthenticationElement:O}=globalThis.__STRIPE_COMPONENTS__,W=S("div")`
1
+ import{D as w,j as o,a6 as v,T as B,bo as S}from"./vendor-mui-core-BOHKtf8y.js";import{o as T}from"./vendor-arcblock--zSibe1w.js";import{T as k,a as M}from"./vendor-ux-Cra9XTth.js";import{r as _}from"./vendor-react-Dvs43sk9.js";import{l as P}from"./vendor-hooks-DTeIFVkk.js";import{Y as F,L as D}from"./index-BGbMta1w.js";import"./vendor-utils-BOkrEpKO.js";import"./lottie-web-4koyQiv_.js";const{Elements:I,PaymentElement:R,useElements:z,useStripe:N,loadStripe:L,LinkAuthenticationElement:O}=globalThis.__STRIPE_COMPONENTS__,W=S("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,a$ as B,bc as N,at as v,W as d}from"./vendor-mui-core-BOHKtf8y.js";import{r as l}from"./vendor-react-Dvs43sk9.js";import{C as I}from"./vendor-utils-BOkrEpKO.js";import{b as $}from"./vendor-ux-Cra9XTth.js";import{m as L,a as E,v as z}from"./index-Cbf4geph.js";import{W as A}from"./did-address-C7IHZs6x.js";import{a as D}from"./page-header-18voA300.js";import{S as F}from"./layout-zg5WZEdp.js";import{S as P}from"./step-actions-DmraEWCH.js";import{S as m}from"./button-VEuIVOxr.js";import"./vendor-hooks-DTeIFVkk.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock--zSibe1w.js";import"./content-layout-BZKNdb6s.js";import"./use-mobile-BDciCFXT.js";function R({onNext:n=()=>{},onPrevious:x=()=>{}}){const{locale:u,t}=l.useContext($),{blocklet:a,gas:c,tokenInfo:f,actions:h}=L(),{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(T,{children:[e.jsx("div",{className:"header",children:e.jsx(D,{title:t("setup.fuel.title"),onClickBack:x})}),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(A,{className:"address",did:a.appDid}),e.jsx(B,{style:{lineHeight:1},target:"_blank",href:I(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(z,{popup:!0,open:y,action:"fuel",checkFn:j.get,checkTimeout:10*60*1e3,onSuccess:S,onClose:()=>o(!1),locale:u,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(P,{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,{})})}R.propTypes={onNext:d.func,onPrevious:d.func};const T=v(F)`
1
+ import{j as e,ak as s,a6 as w,a$ as B,bc as N,at as v,W as d}from"./vendor-mui-core-BOHKtf8y.js";import{r as l}from"./vendor-react-Dvs43sk9.js";import{C as I}from"./vendor-utils-BOkrEpKO.js";import{b as $}from"./vendor-ux-Cra9XTth.js";import{m as L,a as E,v as z}from"./index-BGbMta1w.js";import{W as A}from"./did-address-C7IHZs6x.js";import{a as D}from"./page-header-18voA300.js";import{S as F}from"./layout-DE-cz95w.js";import{S as P}from"./step-actions-CAm14q1m.js";import{S as m}from"./button-VEuIVOxr.js";import"./vendor-hooks-DTeIFVkk.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock--zSibe1w.js";import"./content-layout-BZKNdb6s.js";import"./use-mobile-BDciCFXT.js";function R({onNext:n=()=>{},onPrevious:x=()=>{}}){const{locale:u,t}=l.useContext($),{blocklet:a,gas:c,tokenInfo:f,actions:h}=L(),{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(T,{children:[e.jsx("div",{className:"header",children:e.jsx(D,{title:t("setup.fuel.title"),onClickBack:x})}),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(A,{className:"address",did:a.appDid}),e.jsx(B,{style:{lineHeight:1},target:"_blank",href:I(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(z,{popup:!0,open:y,action:"fuel",checkFn:j.get,checkTimeout:10*60*1e3,onSuccess:S,onClose:()=>o(!1),locale:u,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(P,{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,{})})}R.propTypes={onNext:d.func,onPrevious:d.func};const T=v(F)`
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,b3 as P,b0 as R,ak as r,T as c,a6 as _}from"./vendor-mui-core-BOHKtf8y.js";import{a as N,M as I,c as L,t as p,N as W,O as A}from"./index-Cbf4geph.js";import{o as D}from"./vendor-arcblock--zSibe1w.js";import{b as M}from"./vendor-ux-Cra9XTth.js";import{g as T,b as w}from"./vendor-hooks-DTeIFVkk.js";import{i as U,r as i,u as z}from"./vendor-react-Dvs43sk9.js";import{K as a}from"./landing-page-k9p91AEv.js";import{C as F}from"./vendor-utils-BOkrEpKO.js";import{u as K}from"./use-window-close-wo9PxrTe.js";import"./lottie-web-4koyQiv_.js";function $(){const m=U(),l=i.useRef(null),{t:s,locale:d}=i.useContext(M),{api:x,connectApi:f}=N(),[h]=z(),j=E(),b=K(),n=T({ready:!1,success:!1,error:null,invalidSession:!1}),k=()=>{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=W(u);if(!A(v))throw new Error("No token");n.ready=!0}catch{n.invalidSession=!0,m("#invalid",{replace:!0})}};i.useLayoutEffect(()=>k(),[]);const C=w(t=>{n.error=t.message,window.opener?.postMessage({type:"connect-endpoint-message",error:n.error},"*"),m("#invalid",{replace:!0})}),g=w(()=>{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:F(window.location.origin,L.WELLKNOWN_SERVICE_PATH_PREFIX,I),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")&&b(),e.jsx(a,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(p,{style:{backgroundColor:"transparent"},status:"info",icon:e.jsx(R,{style:{color:j.palette.success.main,fontSize:72}}),title:s("connectCli.success",{source:o}),description:s("connectCli.successDesc",{source:o})})},"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(D,{children:e.jsx(_,{})})}export{$ as default};
1
+ import{D as E,j as e,Q as S,b3 as P,b0 as R,ak as r,T as c,a6 as _}from"./vendor-mui-core-BOHKtf8y.js";import{a as N,M as I,c as L,t as p,N as W,O as A}from"./index-BGbMta1w.js";import{o as D}from"./vendor-arcblock--zSibe1w.js";import{b as M}from"./vendor-ux-Cra9XTth.js";import{g as T,b as w}from"./vendor-hooks-DTeIFVkk.js";import{i as U,r as i,u as z}from"./vendor-react-Dvs43sk9.js";import{K as a}from"./landing-page-CxWEfJb1.js";import{C as F}from"./vendor-utils-BOkrEpKO.js";import{u as K}from"./use-window-close-wo9PxrTe.js";import"./lottie-web-4koyQiv_.js";function $(){const m=U(),l=i.useRef(null),{t:s,locale:d}=i.useContext(M),{api:x,connectApi:f}=N(),[h]=z(),j=E(),b=K(),n=T({ready:!1,success:!1,error:null,invalidSession:!1}),k=()=>{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=W(u);if(!A(v))throw new Error("No token");n.ready=!0}catch{n.invalidSession=!0,m("#invalid",{replace:!0})}};i.useLayoutEffect(()=>k(),[]);const C=w(t=>{n.error=t.message,window.opener?.postMessage({type:"connect-endpoint-message",error:n.error},"*"),m("#invalid",{replace:!0})}),g=w(()=>{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:F(window.location.origin,L.WELLKNOWN_SERVICE_PATH_PREFIX,I),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")&&b(),e.jsx(a,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(p,{style:{backgroundColor:"transparent"},status:"info",icon:e.jsx(R,{style:{color:j.palette.success.main,fontSize:72}}),title:s("connectCli.success",{source:o}),description:s("connectCli.successDesc",{source:o})})},"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(D,{children:e.jsx(_,{})})}export{$ as default};
@@ -1 +1 @@
1
- import{j as e,ak as s,T as y,a6 as L,b1 as $,Q as U,a$ as G,aX as E,bM as R}from"./vendor-mui-core-BOHKtf8y.js";import{r as u,i as J,u as Q}from"./vendor-react-Dvs43sk9.js";import{I as V,a as X,e as Y,N as M,c as Z,ai as ee}from"./index-Cbf4geph.js";import{n as A,C as P}from"./vendor-utils-BOkrEpKO.js";import{g as D,b as d,o as ne}from"./vendor-hooks-DTeIFVkk.js";import{M as W,T as K,A as oe,o as B}from"./vendor-ux-Cra9XTth.js";import{o as se}from"./vendor-arcblock--zSibe1w.js";import{K as te}from"./landing-page-k9p91AEv.js";import{B as re,a as ie,l as ae}from"./index-B-WiXXyt.js";import{u as ce}from"./use-window-close-wo9PxrTe.js";import"./lottie-web-4koyQiv_.js";function le({requestAppInfo:r,currentAppInfo:o}){return e.jsxs(s,{sx:{textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",gap:2},children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(W,{src:o.appLogo,alt:"Server",width:48,height:48,useProxyFallback:!0}),e.jsxs(s,{sx:{mx:2,display:"flex",alignItems:"center","& .dot":{width:8,height:8,borderRadius:"50%",bgcolor:"divider",mx:.5}},children:[e.jsx(s,{className:"dot"}),e.jsx(s,{className:"dot"}),e.jsx(s,{className:"dot"})]}),e.jsx(W,{src:r.appLogo,alt:r.appName,width:48,height:48,useProxyFallback:!0})]}),e.jsxs(y,{sx:{mb:1,fontSize:"1.2rem"},children:["Authorize"," ",e.jsx(s,{component:"span",sx:{color:"primary.main"},children:r.appName})]})]})}const de={en:{notThis:"Not you?",useAnother:"Use another account",authorize:"Authorize",connect:"Connect",cancel:"Cancel"},zh:{notThis:"不是这个?",useAnother:"使用其他账户",authorize:"授权",connect:"Connect",cancel:"取消"}};function pe({session:r,requestAppInfo:o,currentAppInfo:t,children:C=null,userInfo:v=void 0,hideSwitchConnect:_=!1,hideAuthorize:a=!1,hideCancel:c=!1,notThisText:N=void 0,authorizeText:f=void 0,connectText:g=void 0,cancelText:k=void 0,useAnotherText:z=void 0,slotProps:p=void 0,onConnect:h=A,onAuthorize:T=A,onSwitchConnect:S=A,onCancel:m=A,ref:b}){const n=D({loading:!1}),{locale:l="en"}=K()||{},i=d((O,H={})=>oe(de,O,l,"en",H)),j=d(()=>{n.loading=!1}),I=d(()=>{n.loading=!0,h?.(j)}),x=d(()=>{n.loading=!0,S?.(j)}),q=d(()=>{n.loading=!0,T?.(j)}),F=d(()=>{m?.()});if(u.useImperativeHandle(b,()=>({closeLoading:j})),r.loading||!r.initialized)return e.jsx(se,{children:e.jsx(L,{})});const w=v??r?.user;return e.jsx(te,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(s,{...p?.root,sx:B({width:420,maxWidth:"100%"},p?.root?.sx),children:e.jsx(V,{hideCloseButton:!0,...p?.didConnectContainer,children:e.jsxs(s,{...p?.contentContainer,sx:B({display:"flex",flexDirection:"column",gap:1.5,p:{xs:2,lg:3,xl:4},pt:{xs:3,xl:4},bgcolor:"background.paper"},p?.contentContainer?.sx),children:[e.jsx(le,{requestAppInfo:o,currentAppInfo:t}),w?e.jsxs(e.Fragment,{children:[e.jsx(re,{user:w,showDid:!0,cardType:ae.Detailed,infoType:ie.Minimal}),e.jsx(s,{})]}):null,C,e.jsx(s,{sx:{border:"1px solid",borderColor:"divider",borderRadius:2,overflow:"hidden",my:1}}),e.jsxs($,{direction:"row",spacing:2,children:[c?null:e.jsx(U,{color:"inherit",variant:"outlined",size:"large",fullWidth:!0,onClick:F,sx:{color:"grey.500"},children:k||i("cancel")}),w&&!a?e.jsxs(U,{variant:"contained",size:"large",fullWidth:!0,onClick:q,disabled:n.loading,children:[n.loading?e.jsx(L,{size:20,sx:{mr:1}}):null,f||i("authorize")]}):e.jsxs(U,{variant:"contained",size:"large",fullWidth:!0,disabled:n.loading,onClick:I,children:[n.loading?e.jsx(L,{size:20,sx:{mr:1}}):null,g||i("connect")]})]}),_||!w?null:e.jsx(s,{sx:{textAlign:"center"},children:e.jsxs(y,{variant:"body2",sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:1},children:[N||i("notThis")," ",e.jsx(G,{underline:"hover",onClick:x,sx:{cursor:"pointer"},children:z||i("useAnother")})]})})]})})})})}const ue=P(window.location.origin,Z.WELLKNOWN_BLOCKLET_USER_PATH,"settings#user-center-access-key-setting");function _e(){const r=u.useRef(null),{session:o}=X(),t=D({ready:!1,success:!1,error:null,invalidSession:!1,token:null}),[C,v]=ne("currentUserInfo",{defaultValue:null}),_=J(),{t:a}=K(),[c]=Q(),N=ce(),[,f]=u.useState(!0),[g,k]=u.useState({appName:c.get("cli")?c.get("appName")??a("aigne.cli"):"",appLogo:c.get("cli")?c.get("appLogo"):""}),z=async()=>{f(!0);try{const n=c.get("__url__"),l=n?M(n):null;if(!l){f(!1);return}const i="__blocklet__.js?type=json",I=new URL(l).origin,{data:x}=await ee.get(P(I,i));k({appName:x?.appName,appUrl:x?.appUrl,appLogo:P(x?.appUrl,x?.appLogo)})}catch(n){console.error(n)}finally{f(!1)}},p=()=>{z(),o.user&&v(o.user);try{const n=new URL(window.location.href);if(n.hash.includes("invalid")){t.invalidSession=!0;return}const l=n.searchParams.get("__token__"),i=l?M(l):null;if(!i)throw new Error("No token");t.token=i,t.ready=!0}catch(n){t.invalidSession=!0,t.error=n.message,window.opener?.postMessage({type:"connect-aigne-message",error:n.message},"*"),_("#invalid",{replace:!0})}};u.useLayoutEffect(()=>p(),[]);const h=window.blocklet,T=c.get("source")||"Generate Access Key",S=d(async n=>{try{await Y.post("/access-key/authorize",{source:T,sid:t.token}),window.opener?.postMessage({type:"connect-aigne-message",success:!0},"*"),c.has("closeOnSuccess")&&N()}catch(l){console.error(l)}finally{n()}}),m=d(()=>{o.login()}),b=d(()=>{window.close()});return u.useEffect(()=>{o.initialized&&(o.user||m())},[o?.user,o?.initialized,m]),u.useEffect(()=>{o.open||r.current?.closeLoading?.()},[o.open]),e.jsx(pe,{ref:r,session:o,requestAppInfo:g,currentAppInfo:h,userInfo:C,onAuthorize:S,onConnect:m,onSwitchConnect:o.switchDid,onCancel:b,hideAuthorize:!!t.error,authorizeText:a("common.approve"),slotProps:{root:{sx:{width:500}}},children:t.error?e.jsxs(E,{severity:"error",children:[e.jsx(R,{children:a("aigne.notAuthorized")}),t.error]}):e.jsxs(E,{severity:"info",children:[e.jsx(R,{children:a("aigne.connectTo",{appName:h.appName})}),e.jsx(y,{component:"li",variant:"body2",children:a("aigne.accessTips.tips1",{appName:g.appName,accessAppName:h.appName})}),e.jsx(y,{component:"li",variant:"body2",children:a("aigne.accessTips.tips2",{appName:g.appName})}),e.jsx(y,{component:"li",variant:"body2",sx:{"& a":{color:"inherit",textDecoration:"underline"}},dangerouslySetInnerHTML:{__html:a("aigne.accessTips.tips3",{url:ue,accessAppName:h.appName})}})]})})}export{_e as default};
1
+ import{j as e,ak as s,T as y,a6 as L,b1 as $,Q as U,a$ as G,aX as E,bM as R}from"./vendor-mui-core-BOHKtf8y.js";import{r as u,i as J,u as Q}from"./vendor-react-Dvs43sk9.js";import{I as V,a as X,e as Y,N as M,c as Z,ai as ee}from"./index-BGbMta1w.js";import{n as A,C as P}from"./vendor-utils-BOkrEpKO.js";import{g as D,b as d,o as ne}from"./vendor-hooks-DTeIFVkk.js";import{M as W,T as K,A as oe,o as B}from"./vendor-ux-Cra9XTth.js";import{o as se}from"./vendor-arcblock--zSibe1w.js";import{K as te}from"./landing-page-CxWEfJb1.js";import{B as re,a as ie,l as ae}from"./index-IvJAtHzW.js";import{u as ce}from"./use-window-close-wo9PxrTe.js";import"./lottie-web-4koyQiv_.js";function le({requestAppInfo:r,currentAppInfo:o}){return e.jsxs(s,{sx:{textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",gap:2},children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(W,{src:o.appLogo,alt:"Server",width:48,height:48,useProxyFallback:!0}),e.jsxs(s,{sx:{mx:2,display:"flex",alignItems:"center","& .dot":{width:8,height:8,borderRadius:"50%",bgcolor:"divider",mx:.5}},children:[e.jsx(s,{className:"dot"}),e.jsx(s,{className:"dot"}),e.jsx(s,{className:"dot"})]}),e.jsx(W,{src:r.appLogo,alt:r.appName,width:48,height:48,useProxyFallback:!0})]}),e.jsxs(y,{sx:{mb:1,fontSize:"1.2rem"},children:["Authorize"," ",e.jsx(s,{component:"span",sx:{color:"primary.main"},children:r.appName})]})]})}const de={en:{notThis:"Not you?",useAnother:"Use another account",authorize:"Authorize",connect:"Connect",cancel:"Cancel"},zh:{notThis:"不是这个?",useAnother:"使用其他账户",authorize:"授权",connect:"Connect",cancel:"取消"}};function pe({session:r,requestAppInfo:o,currentAppInfo:t,children:C=null,userInfo:v=void 0,hideSwitchConnect:_=!1,hideAuthorize:a=!1,hideCancel:c=!1,notThisText:N=void 0,authorizeText:f=void 0,connectText:g=void 0,cancelText:k=void 0,useAnotherText:z=void 0,slotProps:p=void 0,onConnect:h=A,onAuthorize:T=A,onSwitchConnect:S=A,onCancel:m=A,ref:b}){const n=D({loading:!1}),{locale:l="en"}=K()||{},i=d((O,H={})=>oe(de,O,l,"en",H)),j=d(()=>{n.loading=!1}),I=d(()=>{n.loading=!0,h?.(j)}),x=d(()=>{n.loading=!0,S?.(j)}),q=d(()=>{n.loading=!0,T?.(j)}),F=d(()=>{m?.()});if(u.useImperativeHandle(b,()=>({closeLoading:j})),r.loading||!r.initialized)return e.jsx(se,{children:e.jsx(L,{})});const w=v??r?.user;return e.jsx(te,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(s,{...p?.root,sx:B({width:420,maxWidth:"100%"},p?.root?.sx),children:e.jsx(V,{hideCloseButton:!0,...p?.didConnectContainer,children:e.jsxs(s,{...p?.contentContainer,sx:B({display:"flex",flexDirection:"column",gap:1.5,p:{xs:2,lg:3,xl:4},pt:{xs:3,xl:4},bgcolor:"background.paper"},p?.contentContainer?.sx),children:[e.jsx(le,{requestAppInfo:o,currentAppInfo:t}),w?e.jsxs(e.Fragment,{children:[e.jsx(re,{user:w,showDid:!0,cardType:ae.Detailed,infoType:ie.Minimal}),e.jsx(s,{})]}):null,C,e.jsx(s,{sx:{border:"1px solid",borderColor:"divider",borderRadius:2,overflow:"hidden",my:1}}),e.jsxs($,{direction:"row",spacing:2,children:[c?null:e.jsx(U,{color:"inherit",variant:"outlined",size:"large",fullWidth:!0,onClick:F,sx:{color:"grey.500"},children:k||i("cancel")}),w&&!a?e.jsxs(U,{variant:"contained",size:"large",fullWidth:!0,onClick:q,disabled:n.loading,children:[n.loading?e.jsx(L,{size:20,sx:{mr:1}}):null,f||i("authorize")]}):e.jsxs(U,{variant:"contained",size:"large",fullWidth:!0,disabled:n.loading,onClick:I,children:[n.loading?e.jsx(L,{size:20,sx:{mr:1}}):null,g||i("connect")]})]}),_||!w?null:e.jsx(s,{sx:{textAlign:"center"},children:e.jsxs(y,{variant:"body2",sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:1},children:[N||i("notThis")," ",e.jsx(G,{underline:"hover",onClick:x,sx:{cursor:"pointer"},children:z||i("useAnother")})]})})]})})})})}const ue=P(window.location.origin,Z.WELLKNOWN_BLOCKLET_USER_PATH,"settings#user-center-access-key-setting");function _e(){const r=u.useRef(null),{session:o}=X(),t=D({ready:!1,success:!1,error:null,invalidSession:!1,token:null}),[C,v]=ne("currentUserInfo",{defaultValue:null}),_=J(),{t:a}=K(),[c]=Q(),N=ce(),[,f]=u.useState(!0),[g,k]=u.useState({appName:c.get("cli")?c.get("appName")??a("aigne.cli"):"",appLogo:c.get("cli")?c.get("appLogo"):""}),z=async()=>{f(!0);try{const n=c.get("__url__"),l=n?M(n):null;if(!l){f(!1);return}const i="__blocklet__.js?type=json",I=new URL(l).origin,{data:x}=await ee.get(P(I,i));k({appName:x?.appName,appUrl:x?.appUrl,appLogo:P(x?.appUrl,x?.appLogo)})}catch(n){console.error(n)}finally{f(!1)}},p=()=>{z(),o.user&&v(o.user);try{const n=new URL(window.location.href);if(n.hash.includes("invalid")){t.invalidSession=!0;return}const l=n.searchParams.get("__token__"),i=l?M(l):null;if(!i)throw new Error("No token");t.token=i,t.ready=!0}catch(n){t.invalidSession=!0,t.error=n.message,window.opener?.postMessage({type:"connect-aigne-message",error:n.message},"*"),_("#invalid",{replace:!0})}};u.useLayoutEffect(()=>p(),[]);const h=window.blocklet,T=c.get("source")||"Generate Access Key",S=d(async n=>{try{await Y.post("/access-key/authorize",{source:T,sid:t.token}),window.opener?.postMessage({type:"connect-aigne-message",success:!0},"*"),c.has("closeOnSuccess")&&N()}catch(l){console.error(l)}finally{n()}}),m=d(()=>{o.login()}),b=d(()=>{window.close()});return u.useEffect(()=>{o.initialized&&(o.user||m())},[o?.user,o?.initialized,m]),u.useEffect(()=>{o.open||r.current?.closeLoading?.()},[o.open]),e.jsx(pe,{ref:r,session:o,requestAppInfo:g,currentAppInfo:h,userInfo:C,onAuthorize:S,onConnect:m,onSwitchConnect:o.switchDid,onCancel:b,hideAuthorize:!!t.error,authorizeText:a("common.approve"),slotProps:{root:{sx:{width:500}}},children:t.error?e.jsxs(E,{severity:"error",children:[e.jsx(R,{children:a("aigne.notAuthorized")}),t.error]}):e.jsxs(E,{severity:"info",children:[e.jsx(R,{children:a("aigne.connectTo",{appName:h.appName})}),e.jsx(y,{component:"li",variant:"body2",children:a("aigne.accessTips.tips1",{appName:g.appName,accessAppName:h.appName})}),e.jsx(y,{component:"li",variant:"body2",children:a("aigne.accessTips.tips2",{appName:g.appName})}),e.jsx(y,{component:"li",variant:"body2",sx:{"& a":{color:"inherit",textDecoration:"underline"}},dangerouslySetInnerHTML:{__html:a("aigne.accessTips.tips3",{url:ue,accessAppName:h.appName})}})]})})}export{_e as default};
@@ -1 +1 @@
1
- import{K as t}from"./index-Cbf4geph.js";import{H as e}from"./vendor-ux-Cra9XTth.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{K as t}from"./index-BGbMta1w.js";import{H as e}from"./vendor-ux-Cra9XTth.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,b1 as n}from"./vendor-mui-core-BOHKtf8y.js";import{L as r}from"./vendor-react-Dvs43sk9.js";import{n as i}from"./vendor-ux-Cra9XTth.js";import{c as t}from"./index-Cbf4geph.js";import{S as e}from"./studio-C4flChud.js";import"./vendor-utils-BOkrEpKO.js";import"./vendor-hooks-DTeIFVkk.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock--zSibe1w.js";import"./index-Dj0TETp9.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,b1 as n}from"./vendor-mui-core-BOHKtf8y.js";import{L as r}from"./vendor-react-Dvs43sk9.js";import{n as i}from"./vendor-ux-Cra9XTth.js";import{c as t}from"./index-BGbMta1w.js";import{S as e}from"./studio-BfthGuiI.js";import"./vendor-utils-BOkrEpKO.js";import"./vendor-hooks-DTeIFVkk.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock--zSibe1w.js";import"./index-BSWcZ39K.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-Dvs43sk9.js";import{V as L}from"./index-Cbf4geph.js";const V=({url:r,allowFullScreen:o,position:a,display:i,height:u,width:y,overflow:c,styles:f,onLoad:p,onMouseOver:m,onMouseOut:w,scrolling:b,id:d,frameBorder:n,ariaHidden:O,sandbox:s,allow:j,className:g,title:h,ariaLabel:k,ariaLabelledby:P,name:v,target:A,loading:F,importance:I,referrerpolicy:M,allowpaymentrequest:S,src:q,key:x})=>{const t=L({src:q||r,target:A||null,style:{position:a||null,display:i||"initial",overflow:c||null},scrolling:b||null,allowpaymentrequest:S||null,importance:I||null,sandbox:s&&[...s].join(" ")||null,loading:F||null,styles:f||null,name:v||null,className:g||null,allowFullScreen:"allowFullScreen",referrerpolicy:M||null,title:h||null,allow:j||null,id:d||null,"aria-labelledby":P||null,"aria-hidden":O||null,"aria-label":k||null,width:y||null,height:u||null,onLoad:p||null,onMouseOver:m||null,onMouseOut:w||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{V as I};
1
+ import{a as E}from"./vendor-react-Dvs43sk9.js";import{V as L}from"./index-BGbMta1w.js";const V=({url:r,allowFullScreen:o,position:a,display:i,height:u,width:y,overflow:c,styles:f,onLoad:p,onMouseOver:m,onMouseOut:w,scrolling:b,id:d,frameBorder:n,ariaHidden:O,sandbox:s,allow:j,className:g,title:h,ariaLabel:k,ariaLabelledby:P,name:v,target:A,loading:F,importance:I,referrerpolicy:M,allowpaymentrequest:S,src:q,key:x})=>{const t=L({src:q||r,target:A||null,style:{position:a||null,display:i||"initial",overflow:c||null},scrolling:b||null,allowpaymentrequest:S||null,importance:I||null,sandbox:s&&[...s].join(" ")||null,loading:F||null,styles:f||null,name:v||null,className:g||null,allowFullScreen:"allowFullScreen",referrerpolicy:M||null,title:h||null,allow:j||null,id:d||null,"aria-labelledby":P||null,"aria-hidden":O||null,"aria-label":k||null,width:y||null,height:u||null,onLoad:p||null,onMouseOver:m||null,onMouseOut:w||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{V as I};
@@ -1,4 +1,4 @@
1
- import{j as e,y as kt,bb as ke,M as ae,ak as x,Q as q,W as u,J as xe,c0 as St,I as O,aN as Pt,T as I,aj as Rt,b5 as Ee,P as Be,b6 as Z,a5 as Le,z as Qe,A as Ve,cm as It,bf as Tt,U as we,dk as At,dl as Mt,at as ee,dm as zt,a6 as V,n as le,D as Et,dn as Bt,ar as We,b1 as Se,dp as Lt,as as Wt,aX as Dt,am as J,bp as Nt,bq as ye,a$ as Ot,d7 as $t}from"./vendor-mui-core-BOHKtf8y.js";import{r as y,a as Ft,u as Ut,j as _t}from"./vendor-react-Dvs43sk9.js";import{t as Ye,Z as qt,a8 as Ht,R as De,D as Gt,C as ce,n as Q,A as Kt}from"./vendor-utils-BOkrEpKO.js";import{a as Qt,D as Vt,bA as Yt,c as Pe,d as Zt,T as Jt,bB as Xt,aN as Re,Q as fe,b8 as er,bC as tr,_ as rr,aP as nr,$ as or,bD as sr}from"./index-Cbf4geph.js";import{a as T,h as Ze,k as te,g as H,b as E,j as ir}from"./vendor-hooks-DTeIFVkk.js";import{l as Je}from"./arrow-down.svg-BnKvb8st.js";import{b as Ie,I as N,T as D,aw as ar,G as Xe,ax as lr,H as _,ay as cr,az as dr,aA as Ne,e as ur,n as et,c as Te,aB as pr,aC as M,x as xr,v as fr,$ as tt,aD as hr,aE as gr,u as mr,o as de,B as Oe,J as br}from"./vendor-ux-Cra9XTth.js";import{N as yr}from"./list-C6CNPBAR.js";import{d as vr}from"./search-4YYphs0l.js";import{B as $e}from"./bundle-avatar-BZQ_lZxy.js";import{j as Fe,T as jr}from"./team-ZJuYy81P.js";import{b as wr,d as Cr,a as kr,c as Sr,e as Pr,f as Rr,B as Ir}from"./user-center-D6gs6-WZ.js";import{N as rt,U as nt}from"./index-Nd6gD7eY.js";import{u as re}from"./use-mobile-BDciCFXT.js";import Tr from"./index-BetmKk0p.js";import{f as X}from"./index-DBs9Ljax.js";import{u as ot}from"./index-BEmLxB7B.js";import{U as ve}from"./user-sessions-B56a-4tA.js";import Ar from"./index-78a5Cdpe.js";import{o as Mr}from"./vendor-arcblock--zSibe1w.js";import{c as zr,b as ue,a as Er,S as Br}from"./index-BFOTYlfC.js";import"./index-DSNvDaKK.js";import"./index-BojVbZw0.js";import"./lottie-web-4koyQiv_.js";import"./server-logo-notext.svg-CKQB0tIp.js";import"./index-B-WiXXyt.js";import"./util-Dcj6HCP7.js";import"./base32-BeRPpTcK.js";import"./session-89Q1nGxB.js";import"./isURL-By2TdRfN.js";import"./index-DtuUsb1T.js";import"./api-Rnh95Dt4.js";import"./table-tips-73VcKMz1.js";import"./use-mobile-BlpLWscF.js";import"./passport-item-D-B7gJms.js";import"./did-address-C7IHZs6x.js";import"./index-BDu1k7Fv.js";import"./vendor-mui-x-16EG-AFj.js";import"./AdapterDayjs-D8zlc0TS.js";import"./confirm-Cx2owMMo.js";import"./click-to-copy-EOhAhdSS.js";import"./delete-confirm-Wa3xVOUM.js";import"./permission-DqaOkW_Z.js";import"./actions-B0rWiAuM.js";import"./index-DRYJ0xIl.js";function Lr(){let t=new Map;function s({root:o,rootMargin:n,threshold:l}){let i=t.get(o);i||(i=new Map,t.set(o,i));let c=JSON.stringify({rootMargin:n,threshold:l}),p=i.get(c);if(!p){let r=new Map;p={observer:new IntersectionObserver(f=>{f.forEach(m=>{r.get(m.target)?.(m)})},{root:o,rootMargin:n,threshold:l}),entryCallbacks:r},i.set(c,p)}return{observe:(r,f)=>{p.entryCallbacks.set(r,f),p.observer.observe(r)},unobserve:r=>{p.entryCallbacks.delete(r),p.observer.unobserve(r)}}}return{getObserver:s}}var Wr="0px",Dr=[0],Nr=Lr();function Or(t){let s=t?.rootMargin??Wr,o=t?.threshold??Dr,n=y.useRef(null),l=y.useRef(null),i=y.useRef(null),[c,p]=y.useState(),r=y.useCallback(()=>{let C=n.current;if(!C){p(void 0);return}let v=Nr.getObserver({root:l.current,rootMargin:s,threshold:o});v.observe(C,a=>{p(a)}),i.current=v},[s,o]),f=y.useCallback(()=>{let C=i.current,v=n.current;v&&C?.unobserve(v),i.current=null},[]),m=y.useCallback(C=>{f(),n.current=C,r()},[r,f]),h=y.useCallback(C=>{f(),l.current=C,r()},[r,f]);return[m,{entry:c,rootRef:h}]}var $r=Or;function Fr(t){let[s,o]=$r(t),n=!!o.entry?.isIntersecting,[l,i]=y.useState(n);return n&&!l&&i(!0),[s,{...o,isVisible:n,wasEverVisible:l}]}var Ur=Fr,_r=100;function qr({loading:t,hasNextPage:s,onLoadMore:o,rootMargin:n,disabled:l,delayInMs:i=_r}){let c=y.useRef(o),[p,{rootRef:r,isVisible:f}]=Ur({rootMargin:n});y.useEffect(()=>{c.current=o},[o]);let m=!l&&!t&&f&&s;return y.useEffect(()=>{if(m){let h=setTimeout(()=>{c.current()},i);return()=>{clearTimeout(h)}}},[m,i]),[p,{rootRef:r}]}var Hr=qr;const je={info:"#3B82F6",success:"#10B981",warning:"#F59E0B",error:"#EF4444"};pe.propTypes={severity:u.oneOf(["info","success","warning","error",""]).isRequired,size:u.number};function pe({severity:t,size:s=8}){return je[t]?e.jsx(x,{component:"span",sx:{display:"inline-block",width:s,height:s,borderRadius:"50%",backgroundColor:je[t]||je.info}}):null}st.propTypes={theme:u.string,type:u.oneOf(["button","line","select"]),onSelectType:u.func,extra:u.node,loading:u.bool,currentTab:u.oneOf(["info","success","warning","error",""])};function st({theme:t="dark",type:s="button",onSelectType:o,extra:n=void 0,currentTab:l="",loading:i=!1,...c}){const{t:p}=y.useContext(Ie),r=[{label:p("notification.allSeverity"),value:""},{label:p("notification.severityType.info"),value:"info"},{label:p("notification.severityType.success"),value:"success"},{label:p("notification.severityType.warning"),value:"warning"},{label:p("notification.severityType.error"),value:"error"}],f=g=>{(g!==l||!i)&&o(g)},m=y.useMemo(()=>{const g={width:"100%",bgcolor:t==="dark"?"#F9FAFB":"",overflowY:"auto",paddingTop:s==="select"?"0":"5px",whiteSpace:"nowrap",borderRadius:0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"8px"};return s==="line"?Object.assign(g,{}):g},[s,t]),h=(g,S,R)=>e.jsx(q,{disabled:i,onClick:()=>f(g.value),className:`profile-button ${S?"active":""}`,...c,children:g.label},g.value||R),C=(g,S,R)=>e.jsx(q,{variant:"text",disabled:i,onClick:()=>f(g.value),className:`profile-line-button ${S?"active":""}`,...c,children:g.label},g.value||R),v=()=>r?.map((g,S)=>{const R=l===g?.value;return s==="line"?e.jsx(y.Fragment,{children:C(g,R,S)},g.value||S):e.jsx(y.Fragment,{children:h(g,R,S)},g.value||S)}),a=g=>{const{value:S}=g.target;f(S==="all"?"":S)};return s==="select"?e.jsx(kt,{sx:{maxWidth:300},children:e.jsx(ke,{value:l||"all",onChange:a,size:"small",label:"Severity",IconComponent:g=>e.jsx(Je,{...g,width:20,height:20}),MenuProps:{autoFocus:!1,PaperProps:{style:{maxHeight:400,overflowY:"auto",borderRadius:"8px",boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},variant:"outlined",sx:{fieldset:{border:"none"}},children:r.map((g,S)=>e.jsx(ae,{value:g.value||"all",children:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(pe,{severity:g.value}),g.label]})},g.value||S))})}):e.jsxs(x,{className:"severity-tabs",sx:m,children:[e.jsx(x,{sx:{...s==="line"?{flex:1,borderBottom:"1px solid",borderColor:"grey.200"}:{display:"flex",gap:"24px"}},children:v()}),n]})}it.propTypes={paging:u.objectOf(u.any).isRequired,loading:u.bool.isRequired,onChange:u.func.isRequired};function it({loading:t,paging:s,onChange:o}){const{t:n}=y.useContext(Ie),l=xe(r=>r.breakpoints.down("md"));if(s.pageCount<=0||l)return null;const i=(r,f)=>{o({page:f+1})},c=r=>{const f=Number(r.target.value);o({page:1,pageSize:f})},p=s.page-1<=0?0:s.page-1;return e.jsx(x,{className:"notification-pagination",sx:{mt:2,display:"flex",justifyContent:"flex-end"},children:e.jsx(St,{component:"div",disabled:t,count:s.total,page:p,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:n("pagination.rowsPerPage"),labelDisplayedRows:({from:r,to:f,count:m})=>`${r}–${f} / ${m!==-1?m:`${n()}more than ${f}`}`,rowsPerPage:s.pageSize,onPageChange:i,onRowsPerPageChange:c})})}const Gr=y.memo(it),Kr={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4h16v2.172a2 2 0 0 1-.586 1.414L15 12v7l-6 2v-8.5L4.52 7.572A2 2 0 0 1 4 6.227V4z"/>'},Ue=6,_e={"& .MuiCheckbox-root":{padding:"4px"},"& .MuiCheckbox-root .MuiSvgIcon-root":{fontSize:"1.35rem"},"& .MuiCheckbox-root:not(.Mui-checked)":{color:"divider"},"& .MuiCheckbox-root.Mui-checked":{color:"primary.main"},"& .MuiCheckbox-root .css-i4bv87-MuiSvgIcon-root":{width:"1.1em",height:"1.1em"},"& .MuiCheckbox-root svg":{stroke:"divider",strokeWidth:.7}},Qr={border:"1px solid",borderColor:"divider",borderRadius:1,overflow:"hidden",backgroundColor:"background.paper",backgroundImage:"none",transition:"all 0.2s ease-in-out"},qe=()=>({...Qr,width:"calc(50% - 8px)"});at.propTypes={loading:u.bool,type:u.oneOf(["server","service"]),onFilterChange:u.func,blockletMap:u.object,filterType:u.oneOf(["component","entity"]),selectedId:u.array,severity:u.array,enableMarkAllAsRead:u.bool,unReadCount:u.number,onReadFilterChange:u.func,currentReadFilter:u.string};function at({onFilterChange:t=()=>{},loading:s=!1,type:o="service",blockletMap:n={},filterType:l="component",selectedId:i=[],severity:c=[],enableMarkAllAsRead:p=!0,unReadCount:r=0,onReadFilterChange:f=()=>{},currentReadFilter:m="all"}){const{t:h}=y.useContext(Ie),[C,v]=y.useState(null),a=!!C,[g,S]=y.useState(i),[R,P]=y.useState(c),[b,z]=y.useState(!1),[B,F]=y.useState(""),[w,k]=y.useState([]);y.useEffect(()=>{S(i),P(c)},[i,c]);const L=[{label:h("notification.filterType.all"),value:"all"},{label:h("notification.filterType.unread"),value:"unread"}],G=d=>{(d!==m||!s)&&f(d)},Y=[{label:h("notification.severityType.info"),value:"info"},{label:h("notification.severityType.success"),value:"success"},{label:h("notification.severityType.warning"),value:"warning"},{label:h("notification.severityType.error"),value:"error"}],ne=d=>{v(d.currentTarget),F(""),z(!1)},he=()=>{v(null)},oe=d=>{const j=g.includes(d)?g.filter(A=>A!==d):[...g,d];S(j),t({id:j,severity:R})},se=d=>{const j=R.includes(d)?R.filter(A=>A!==d):[...R,d];P(j),t({severity:j,id:g})},ge=d=>{F(d.target.value)},me=()=>{z(!b)},K=Ft.useMemo(()=>{if(!n.size)return[];const d=[];return l==="component"&&d.push({label:h("notification.system"),id:"system"}),Array.from(n).forEach(([,j])=>{const A=j.did||j.meta?.did,W=j.title||j.meta?.title||"",U=j.appPid||j.appDid;(l==="component"&&U!==A||l==="entity"&&U===A)&&d.push({label:W,id:A,blocklet:j,ancestors:j.ancestors})}),d},[n,l,h]);y.useEffect(()=>{if(B.trim()==="")k(K);else{const d=B.toLowerCase(),j=K.filter(A=>A.label.toLowerCase().includes(d));k(j)}},[B,K]);const be=B.trim()!==""||b?w:w.slice(0,Ue);return e.jsxs(x,{children:[e.jsxs(x,{sx:{display:"flex",justifyContent:p?"space-between":"flex-end",alignItems:"flex-start",flexWrap:"wrap",gap:1},children:[p&&e.jsx(x,{sx:{display:"flex",gap:1.5},children:L.map(d=>e.jsxs(q,{disabled:s,onClick:()=>G(d.value),className:`profile-button ${m===d.value?"active":""}`,sx:{...o==="service"&&m===d.value?{color:"secondary.main"}:{},color:"red",fontWeight:m===d.value?"bold":"normal"},children:[d.label,d.value==="unread"&&r>0&&` (${r})`]},d.value))}),e.jsxs(x,{sx:{display:"flex",justifyContent:"flex-end",gap:2},children:[e.jsx(O,{size:"small",onClick:ne,disabled:s,sx:{minWidth:"auto",borderRadius:1,border:"1px solid",borderColor:"divider","&:hover":{backgroundColor:"action.hover"}},children:e.jsx(N,{icon:Kr,hFlip:!0})}),e.jsx(Pt,{open:a,anchorEl:C,onClose:he,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{p:3,width:450,maxHeight:500,overflowY:"auto",backgroundColor:"background.paper",backgroundImage:"none",borderRadius:1,boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},children:e.jsxs(x,{children:[e.jsxs(x,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,height:"28px"},children:[e.jsx(I,{variant:"subtitle1",sx:{fontWeight:"bold"},children:h("notification.severity")}),e.jsx(x,{sx:{minWidth:"60px",display:"flex",justifyContent:"flex-end"},children:(g.length>0||R.length>0)&&e.jsx(q,{size:"small",onClick:()=>{S([]),P([]),t({severity:[],id:[]})},startIcon:e.jsx(Rt,{fontSize:"small"}),sx:{color:"text.secondary",textTransform:"none",minWidth:"auto","&:hover":{backgroundColor:"transparent"},"& .MuiButton-startIcon":{marginRight:"2px"}},children:h("notification.clear")})})]}),e.jsx(x,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(Ee,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2,flex:1},children:Y.map(d=>e.jsx(Be,{elevation:0,sx:qe(R.includes(d.value)),children:e.jsx(Z,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{display:"flex",alignItems:"center",gap:1,fontSize:"0.875rem"},..._e},control:e.jsx(Le,{checked:R.includes(d.value),onChange:()=>se(d.value),disabled:s,size:"small"}),label:e.jsxs(x,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5},children:[e.jsx(pe,{severity:d.value}),d.label]})})},d.value))})}),e.jsxs(x,{sx:{mb:2},children:[e.jsxs(x,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,mb:1.5},children:[e.jsx(I,{variant:"subtitle1",sx:{fontWeight:"bold",width:"calc(100% - 36px)"},children:h("notification.from")}),e.jsx(x,{sx:{display:"flex",alignItems:"center",width:"calc(100% - 36px)"},children:e.jsx(Qe,{size:"small",placeholder:"search",value:B,onChange:ge,sx:{width:"100%","& .MuiOutlinedInput-input":{padding:"6px 4px 6px 0"},".MuiOutlinedInput-root":{"&:hover":{fieldset:{borderColor:"divider"}},"&.Mui-focused":{fieldset:{borderColor:"divider"}}},fieldset:{borderColor:"divider"}},slotProps:{input:{size:"small",startAdornment:e.jsx(Ve,{position:"start",sx:{marginRight:"2px"},children:e.jsx(N,{icon:vr})})}}})})]}),e.jsx(Ee,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2},children:be.map(d=>e.jsx(Be,{elevation:0,sx:qe(g.includes(d.id)),children:e.jsx(Z,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{fontSize:"0.875rem",width:"calc(100% - 36px)"},..._e},control:e.jsx(Le,{checked:g.includes(d.id),onChange:()=>oe(d.id),disabled:s,size:"small"}),label:e.jsxs(x,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,minWidth:0,width:"100%"},children:[d.blocklet&&e.jsx($e,{size:20,blocklet:d.blocklet,ancestors:d.ancestors,style:{borderRadius:4,flexShrink:0}}),e.jsx(I,{noWrap:!0,variant:"body2",component:"span",title:d.label,sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},children:d.label})]})})},d.id))}),w.length>Ue&&B.trim()===""&&e.jsx(q,{fullWidth:!0,size:"small",onClick:me,sx:{mt:1},endIcon:b?e.jsx(It,{}):e.jsx(Tt,{})})]})]})})]})]}),g.length>0||R.length>0?e.jsxs(x,{className:"notification-filter-content",sx:{display:"flex",flexWrap:"wrap",gap:1,mt:2},children:[R.map(d=>{const j=Y.find(A=>A.value===d);return e.jsx(we,{label:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(pe,{severity:d}),j?j.label:d]}),onDelete:()=>se(d),size:"small",variant:"outlined",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`severity-${d}`)}),g.map(d=>{const j=K.find(A=>A.id===d);return e.jsx(we,{label:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:.5},children:[j?.blocklet&&e.jsx($e,{size:16,blocklet:j.blocklet,ancestors:j.ancestors,style:{borderRadius:4,flexShrink:0}}),j?j.label:d]}),variant:"outlined",onDelete:()=>oe(d),size:"small",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`component-${d}`)})]}):null]})}const Vr=ee(zt)`
1
+ import{j as e,y as kt,bb as ke,M as ae,ak as x,Q as q,W as u,J as xe,c0 as St,I as O,aN as Pt,T as I,aj as Rt,b5 as Ee,P as Be,b6 as Z,a5 as Le,z as Qe,A as Ve,cm as It,bf as Tt,U as we,dk as At,dl as Mt,at as ee,dm as zt,a6 as V,n as le,D as Et,dn as Bt,ar as We,b1 as Se,dp as Lt,as as Wt,aX as Dt,am as J,bp as Nt,bq as ye,a$ as Ot,d7 as $t}from"./vendor-mui-core-BOHKtf8y.js";import{r as y,a as Ft,u as Ut,j as _t}from"./vendor-react-Dvs43sk9.js";import{t as Ye,Z as qt,a8 as Ht,R as De,D as Gt,C as ce,n as Q,A as Kt}from"./vendor-utils-BOkrEpKO.js";import{a as Qt,D as Vt,bA as Yt,c as Pe,d as Zt,T as Jt,bB as Xt,aN as Re,Q as fe,b8 as er,bC as tr,_ as rr,aP as nr,$ as or,bD as sr}from"./index-BGbMta1w.js";import{a as T,h as Ze,k as te,g as H,b as E,j as ir}from"./vendor-hooks-DTeIFVkk.js";import{l as Je}from"./arrow-down.svg-DJGgsS-M.js";import{b as Ie,I as N,T as D,aw as ar,G as Xe,ax as lr,H as _,ay as cr,az as dr,aA as Ne,e as ur,n as et,c as Te,aB as pr,aC as M,x as xr,v as fr,$ as tt,aD as hr,aE as gr,u as mr,o as de,B as Oe,J as br}from"./vendor-ux-Cra9XTth.js";import{N as yr}from"./list-CwpC3pkX.js";import{d as vr}from"./search-4YYphs0l.js";import{B as $e}from"./bundle-avatar-nqQPph1V.js";import{j as Fe,T as jr}from"./team-D7qYznX0.js";import{b as wr,d as Cr,a as kr,c as Sr,e as Pr,f as Rr,B as Ir}from"./user-center-Jy5Iq5_O.js";import{N as rt,U as nt}from"./index-CkAhcTYd.js";import{u as re}from"./use-mobile-BDciCFXT.js";import Tr from"./index-ClmgRx8j.js";import{f as X}from"./index-DBs9Ljax.js";import{u as ot}from"./index-BEmLxB7B.js";import{U as ve}from"./user-sessions-BGnHveoB.js";import Ar from"./index-BXQsZlT0.js";import{o as Mr}from"./vendor-arcblock--zSibe1w.js";import{c as zr,b as ue,a as Er,S as Br}from"./index-7zXCE3Ua.js";import"./index-DSNvDaKK.js";import"./index-BojVbZw0.js";import"./lottie-web-4koyQiv_.js";import"./server-logo-notext.svg-CKQB0tIp.js";import"./index-IvJAtHzW.js";import"./util-C5cbPYrK.js";import"./base32-BeRPpTcK.js";import"./session-DwRV85k4.js";import"./isURL-Bawv3imX.js";import"./index-DQFj-nYH.js";import"./api-Rnh95Dt4.js";import"./table-tips-73VcKMz1.js";import"./use-mobile-BlpLWscF.js";import"./passport-item-C25fvRz1.js";import"./did-address-C7IHZs6x.js";import"./index-BETqi_AV.js";import"./vendor-mui-x-16EG-AFj.js";import"./AdapterDayjs-D8zlc0TS.js";import"./confirm-BE3P2t7f.js";import"./click-to-copy-EOhAhdSS.js";import"./delete-confirm-BxYuZyLa.js";import"./permission-jA6KoYLs.js";import"./actions-B0rWiAuM.js";import"./index-DRYJ0xIl.js";function Lr(){let t=new Map;function s({root:o,rootMargin:n,threshold:l}){let i=t.get(o);i||(i=new Map,t.set(o,i));let c=JSON.stringify({rootMargin:n,threshold:l}),p=i.get(c);if(!p){let r=new Map;p={observer:new IntersectionObserver(f=>{f.forEach(m=>{r.get(m.target)?.(m)})},{root:o,rootMargin:n,threshold:l}),entryCallbacks:r},i.set(c,p)}return{observe:(r,f)=>{p.entryCallbacks.set(r,f),p.observer.observe(r)},unobserve:r=>{p.entryCallbacks.delete(r),p.observer.unobserve(r)}}}return{getObserver:s}}var Wr="0px",Dr=[0],Nr=Lr();function Or(t){let s=t?.rootMargin??Wr,o=t?.threshold??Dr,n=y.useRef(null),l=y.useRef(null),i=y.useRef(null),[c,p]=y.useState(),r=y.useCallback(()=>{let C=n.current;if(!C){p(void 0);return}let v=Nr.getObserver({root:l.current,rootMargin:s,threshold:o});v.observe(C,a=>{p(a)}),i.current=v},[s,o]),f=y.useCallback(()=>{let C=i.current,v=n.current;v&&C?.unobserve(v),i.current=null},[]),m=y.useCallback(C=>{f(),n.current=C,r()},[r,f]),h=y.useCallback(C=>{f(),l.current=C,r()},[r,f]);return[m,{entry:c,rootRef:h}]}var $r=Or;function Fr(t){let[s,o]=$r(t),n=!!o.entry?.isIntersecting,[l,i]=y.useState(n);return n&&!l&&i(!0),[s,{...o,isVisible:n,wasEverVisible:l}]}var Ur=Fr,_r=100;function qr({loading:t,hasNextPage:s,onLoadMore:o,rootMargin:n,disabled:l,delayInMs:i=_r}){let c=y.useRef(o),[p,{rootRef:r,isVisible:f}]=Ur({rootMargin:n});y.useEffect(()=>{c.current=o},[o]);let m=!l&&!t&&f&&s;return y.useEffect(()=>{if(m){let h=setTimeout(()=>{c.current()},i);return()=>{clearTimeout(h)}}},[m,i]),[p,{rootRef:r}]}var Hr=qr;const je={info:"#3B82F6",success:"#10B981",warning:"#F59E0B",error:"#EF4444"};pe.propTypes={severity:u.oneOf(["info","success","warning","error",""]).isRequired,size:u.number};function pe({severity:t,size:s=8}){return je[t]?e.jsx(x,{component:"span",sx:{display:"inline-block",width:s,height:s,borderRadius:"50%",backgroundColor:je[t]||je.info}}):null}st.propTypes={theme:u.string,type:u.oneOf(["button","line","select"]),onSelectType:u.func,extra:u.node,loading:u.bool,currentTab:u.oneOf(["info","success","warning","error",""])};function st({theme:t="dark",type:s="button",onSelectType:o,extra:n=void 0,currentTab:l="",loading:i=!1,...c}){const{t:p}=y.useContext(Ie),r=[{label:p("notification.allSeverity"),value:""},{label:p("notification.severityType.info"),value:"info"},{label:p("notification.severityType.success"),value:"success"},{label:p("notification.severityType.warning"),value:"warning"},{label:p("notification.severityType.error"),value:"error"}],f=g=>{(g!==l||!i)&&o(g)},m=y.useMemo(()=>{const g={width:"100%",bgcolor:t==="dark"?"#F9FAFB":"",overflowY:"auto",paddingTop:s==="select"?"0":"5px",whiteSpace:"nowrap",borderRadius:0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"8px"};return s==="line"?Object.assign(g,{}):g},[s,t]),h=(g,S,R)=>e.jsx(q,{disabled:i,onClick:()=>f(g.value),className:`profile-button ${S?"active":""}`,...c,children:g.label},g.value||R),C=(g,S,R)=>e.jsx(q,{variant:"text",disabled:i,onClick:()=>f(g.value),className:`profile-line-button ${S?"active":""}`,...c,children:g.label},g.value||R),v=()=>r?.map((g,S)=>{const R=l===g?.value;return s==="line"?e.jsx(y.Fragment,{children:C(g,R,S)},g.value||S):e.jsx(y.Fragment,{children:h(g,R,S)},g.value||S)}),a=g=>{const{value:S}=g.target;f(S==="all"?"":S)};return s==="select"?e.jsx(kt,{sx:{maxWidth:300},children:e.jsx(ke,{value:l||"all",onChange:a,size:"small",label:"Severity",IconComponent:g=>e.jsx(Je,{...g,width:20,height:20}),MenuProps:{autoFocus:!1,PaperProps:{style:{maxHeight:400,overflowY:"auto",borderRadius:"8px",boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},variant:"outlined",sx:{fieldset:{border:"none"}},children:r.map((g,S)=>e.jsx(ae,{value:g.value||"all",children:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(pe,{severity:g.value}),g.label]})},g.value||S))})}):e.jsxs(x,{className:"severity-tabs",sx:m,children:[e.jsx(x,{sx:{...s==="line"?{flex:1,borderBottom:"1px solid",borderColor:"grey.200"}:{display:"flex",gap:"24px"}},children:v()}),n]})}it.propTypes={paging:u.objectOf(u.any).isRequired,loading:u.bool.isRequired,onChange:u.func.isRequired};function it({loading:t,paging:s,onChange:o}){const{t:n}=y.useContext(Ie),l=xe(r=>r.breakpoints.down("md"));if(s.pageCount<=0||l)return null;const i=(r,f)=>{o({page:f+1})},c=r=>{const f=Number(r.target.value);o({page:1,pageSize:f})},p=s.page-1<=0?0:s.page-1;return e.jsx(x,{className:"notification-pagination",sx:{mt:2,display:"flex",justifyContent:"flex-end"},children:e.jsx(St,{component:"div",disabled:t,count:s.total,page:p,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:n("pagination.rowsPerPage"),labelDisplayedRows:({from:r,to:f,count:m})=>`${r}–${f} / ${m!==-1?m:`${n()}more than ${f}`}`,rowsPerPage:s.pageSize,onPageChange:i,onRowsPerPageChange:c})})}const Gr=y.memo(it),Kr={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4h16v2.172a2 2 0 0 1-.586 1.414L15 12v7l-6 2v-8.5L4.52 7.572A2 2 0 0 1 4 6.227V4z"/>'},Ue=6,_e={"& .MuiCheckbox-root":{padding:"4px"},"& .MuiCheckbox-root .MuiSvgIcon-root":{fontSize:"1.35rem"},"& .MuiCheckbox-root:not(.Mui-checked)":{color:"divider"},"& .MuiCheckbox-root.Mui-checked":{color:"primary.main"},"& .MuiCheckbox-root .css-i4bv87-MuiSvgIcon-root":{width:"1.1em",height:"1.1em"},"& .MuiCheckbox-root svg":{stroke:"divider",strokeWidth:.7}},Qr={border:"1px solid",borderColor:"divider",borderRadius:1,overflow:"hidden",backgroundColor:"background.paper",backgroundImage:"none",transition:"all 0.2s ease-in-out"},qe=()=>({...Qr,width:"calc(50% - 8px)"});at.propTypes={loading:u.bool,type:u.oneOf(["server","service"]),onFilterChange:u.func,blockletMap:u.object,filterType:u.oneOf(["component","entity"]),selectedId:u.array,severity:u.array,enableMarkAllAsRead:u.bool,unReadCount:u.number,onReadFilterChange:u.func,currentReadFilter:u.string};function at({onFilterChange:t=()=>{},loading:s=!1,type:o="service",blockletMap:n={},filterType:l="component",selectedId:i=[],severity:c=[],enableMarkAllAsRead:p=!0,unReadCount:r=0,onReadFilterChange:f=()=>{},currentReadFilter:m="all"}){const{t:h}=y.useContext(Ie),[C,v]=y.useState(null),a=!!C,[g,S]=y.useState(i),[R,P]=y.useState(c),[b,z]=y.useState(!1),[B,F]=y.useState(""),[w,k]=y.useState([]);y.useEffect(()=>{S(i),P(c)},[i,c]);const L=[{label:h("notification.filterType.all"),value:"all"},{label:h("notification.filterType.unread"),value:"unread"}],G=d=>{(d!==m||!s)&&f(d)},Y=[{label:h("notification.severityType.info"),value:"info"},{label:h("notification.severityType.success"),value:"success"},{label:h("notification.severityType.warning"),value:"warning"},{label:h("notification.severityType.error"),value:"error"}],ne=d=>{v(d.currentTarget),F(""),z(!1)},he=()=>{v(null)},oe=d=>{const j=g.includes(d)?g.filter(A=>A!==d):[...g,d];S(j),t({id:j,severity:R})},se=d=>{const j=R.includes(d)?R.filter(A=>A!==d):[...R,d];P(j),t({severity:j,id:g})},ge=d=>{F(d.target.value)},me=()=>{z(!b)},K=Ft.useMemo(()=>{if(!n.size)return[];const d=[];return l==="component"&&d.push({label:h("notification.system"),id:"system"}),Array.from(n).forEach(([,j])=>{const A=j.did||j.meta?.did,W=j.title||j.meta?.title||"",U=j.appPid||j.appDid;(l==="component"&&U!==A||l==="entity"&&U===A)&&d.push({label:W,id:A,blocklet:j,ancestors:j.ancestors})}),d},[n,l,h]);y.useEffect(()=>{if(B.trim()==="")k(K);else{const d=B.toLowerCase(),j=K.filter(A=>A.label.toLowerCase().includes(d));k(j)}},[B,K]);const be=B.trim()!==""||b?w:w.slice(0,Ue);return e.jsxs(x,{children:[e.jsxs(x,{sx:{display:"flex",justifyContent:p?"space-between":"flex-end",alignItems:"flex-start",flexWrap:"wrap",gap:1},children:[p&&e.jsx(x,{sx:{display:"flex",gap:1.5},children:L.map(d=>e.jsxs(q,{disabled:s,onClick:()=>G(d.value),className:`profile-button ${m===d.value?"active":""}`,sx:{...o==="service"&&m===d.value?{color:"secondary.main"}:{},color:"red",fontWeight:m===d.value?"bold":"normal"},children:[d.label,d.value==="unread"&&r>0&&` (${r})`]},d.value))}),e.jsxs(x,{sx:{display:"flex",justifyContent:"flex-end",gap:2},children:[e.jsx(O,{size:"small",onClick:ne,disabled:s,sx:{minWidth:"auto",borderRadius:1,border:"1px solid",borderColor:"divider","&:hover":{backgroundColor:"action.hover"}},children:e.jsx(N,{icon:Kr,hFlip:!0})}),e.jsx(Pt,{open:a,anchorEl:C,onClose:he,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{p:3,width:450,maxHeight:500,overflowY:"auto",backgroundColor:"background.paper",backgroundImage:"none",borderRadius:1,boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},children:e.jsxs(x,{children:[e.jsxs(x,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,height:"28px"},children:[e.jsx(I,{variant:"subtitle1",sx:{fontWeight:"bold"},children:h("notification.severity")}),e.jsx(x,{sx:{minWidth:"60px",display:"flex",justifyContent:"flex-end"},children:(g.length>0||R.length>0)&&e.jsx(q,{size:"small",onClick:()=>{S([]),P([]),t({severity:[],id:[]})},startIcon:e.jsx(Rt,{fontSize:"small"}),sx:{color:"text.secondary",textTransform:"none",minWidth:"auto","&:hover":{backgroundColor:"transparent"},"& .MuiButton-startIcon":{marginRight:"2px"}},children:h("notification.clear")})})]}),e.jsx(x,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(Ee,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2,flex:1},children:Y.map(d=>e.jsx(Be,{elevation:0,sx:qe(R.includes(d.value)),children:e.jsx(Z,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{display:"flex",alignItems:"center",gap:1,fontSize:"0.875rem"},..._e},control:e.jsx(Le,{checked:R.includes(d.value),onChange:()=>se(d.value),disabled:s,size:"small"}),label:e.jsxs(x,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5},children:[e.jsx(pe,{severity:d.value}),d.label]})})},d.value))})}),e.jsxs(x,{sx:{mb:2},children:[e.jsxs(x,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,mb:1.5},children:[e.jsx(I,{variant:"subtitle1",sx:{fontWeight:"bold",width:"calc(100% - 36px)"},children:h("notification.from")}),e.jsx(x,{sx:{display:"flex",alignItems:"center",width:"calc(100% - 36px)"},children:e.jsx(Qe,{size:"small",placeholder:"search",value:B,onChange:ge,sx:{width:"100%","& .MuiOutlinedInput-input":{padding:"6px 4px 6px 0"},".MuiOutlinedInput-root":{"&:hover":{fieldset:{borderColor:"divider"}},"&.Mui-focused":{fieldset:{borderColor:"divider"}}},fieldset:{borderColor:"divider"}},slotProps:{input:{size:"small",startAdornment:e.jsx(Ve,{position:"start",sx:{marginRight:"2px"},children:e.jsx(N,{icon:vr})})}}})})]}),e.jsx(Ee,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2},children:be.map(d=>e.jsx(Be,{elevation:0,sx:qe(g.includes(d.id)),children:e.jsx(Z,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{fontSize:"0.875rem",width:"calc(100% - 36px)"},..._e},control:e.jsx(Le,{checked:g.includes(d.id),onChange:()=>oe(d.id),disabled:s,size:"small"}),label:e.jsxs(x,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,minWidth:0,width:"100%"},children:[d.blocklet&&e.jsx($e,{size:20,blocklet:d.blocklet,ancestors:d.ancestors,style:{borderRadius:4,flexShrink:0}}),e.jsx(I,{noWrap:!0,variant:"body2",component:"span",title:d.label,sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},children:d.label})]})})},d.id))}),w.length>Ue&&B.trim()===""&&e.jsx(q,{fullWidth:!0,size:"small",onClick:me,sx:{mt:1},endIcon:b?e.jsx(It,{}):e.jsx(Tt,{})})]})]})})]})]}),g.length>0||R.length>0?e.jsxs(x,{className:"notification-filter-content",sx:{display:"flex",flexWrap:"wrap",gap:1,mt:2},children:[R.map(d=>{const j=Y.find(A=>A.value===d);return e.jsx(we,{label:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(pe,{severity:d}),j?j.label:d]}),onDelete:()=>se(d),size:"small",variant:"outlined",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`severity-${d}`)}),g.map(d=>{const j=K.find(A=>A.id===d);return e.jsx(we,{label:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:.5},children:[j?.blocklet&&e.jsx($e,{size:16,blocklet:j.blocklet,ancestors:j.ancestors,style:{borderRadius:4,flexShrink:0}}),j?j.label:d]}),variant:"outlined",onDelete:()=>oe(d),size:"small",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`component-${d}`)})]}):null]})}const Vr=ee(zt)`
2
2
  position: fixed;
3
3
  bottom: 20px;
4
4
  right: 20px;
@@ -1,4 +1,4 @@
1
- import{D as w1,J as z1,j as r,Y as Y1,$ as W1,I as q1,ds as _1,ar as y1,ak as U,a$ as R,d7 as I1,b1 as $1,am as B1,T,bC as e6,z as t6,cs as n6,a6,Q as r6}from"./vendor-mui-core-BOHKtf8y.js";import{C as x,a as i6,ab as S1,J as M,c as s6,I as o6,F as c6}from"./vendor-utils-BOkrEpKO.js";import{T as l6,A as F1,e as u6,m as C6,s as p6,a as d6,n as t1,aF as n1}from"./vendor-ux-Cra9XTth.js";import{r as t}from"./vendor-react-Dvs43sk9.js";import{k as L1,b as v1,a as Z}from"./vendor-hooks-DTeIFVkk.js";import{bp as Y,T as W,bJ as U1,bK as h6,aj as H,v as m6,by as E6,bA as g6}from"./index-Cbf4geph.js";import{x as f6}from"./index-DRYJ0xIl.js";import{f as A6}from"./index-BojVbZw0.js";import{v as a1}from"./index-DSNvDaKK.js";const j=Y({});function D6({key:e}={key:"md"}){const n=w1();return z1(n.breakpoints.down(e))}var A=(e=>(e[e.NETWORK_ERROR=1001]="NETWORK_ERROR",e[e.UNAUTHORIZED=1002]="UNAUTHORIZED",e[e.EXPIRED=1003]="EXPIRED",e[e.PAST_DUE=1004]="PAST_DUE",e[e.INVALID=1005]="INVALID",e[e.UNIT_LIMIT=1006]="UNIT_LIMIT",e[e.CORS_BLOCKED=1007]="CORS_BLOCKED",e[e.INCOMPATIBLE=1008]="INCOMPATIBLE",e))(A||{}),O1=(e=>(e.DEFAULT="default",e.SUCCEEDED="succeeded",e.FAILED="failed",e.PENDING="pending",e))(O1||{}),F=(e=>(e.APP_DISCONNECTED="app-disconnected",e.APP_RESTORE="app-restore",e.APP_BACKUP="app-backup",e.APP_CONNECTED="app-connected",e.APP_OBJECTS_SYNC="app-objects-sync",e))(F||{});function x6({endpoint:e,deps:n=[]}){return L1(async()=>{if(!W(e))return;const{headers:a}=await j.head(e,{timeout:1e3*30,params:{withExtras:!0}}),[i,s,c,u,l,C,d,p,m,g]=[a["x-space-name"],a["x-subscription-id"],a["x-listable"]==="true",a["x-readable"]==="true",a["x-writeable"]==="true",a["x-space-version"],a["x-space-owner-did"],a["x-space-is-available"],a["x-error-code"],a["x-is-site-admin"]],h=i?decodeURIComponent(i):"";if(p===void 0||m===void 0){const f=c&&u&&l;return{version:C,name:h,subscriptionId:s,ownerDid:d||"",isAvailable:f,errorCode:f?0:A.UNAUTHORIZED,isSiteAdmin:g==="true"}}return{version:C,name:h,subscriptionId:s,ownerDid:d,isAvailable:p==="true",errorCode:parseInt(m,10),isSiteAdmin:g==="true"}},{refreshDeps:[e].concat(n),onError(a){console.error(a)}})}const w6=U1.flatten({common:{cancel:"Cancel",confirm:"Confirm",delete:"Delete",error:"Error",open:"Open",unknown:"Unknown",invalidUrl:"Invalid url: {url}",upgrade:"Upgrade",viewMore:"View More"},storage:{spaces:{authorize:{title:"Connect {appName} to DID Spaces",scan:"Use your DID Wallet to scan the QR code below to allow the app {appName} to connect to DID Spaces",success:"Connected successfully"},connect:{reconnect:"Reconnect Now",useSpaceGateway:"Connect using the DID Spaces gateway",useWallet:"Connect to DID Spaces",howToGetGatewayUrl:"How to get the url of did spaces",providerForStorage:"Please connect your DID Spaces"},connected:{title:"Connected DID Spaces",tag:"Connected"},disconnected:{tag:"Disconnected"},error:{tag:"Need Attention",blockedByCors:"Access blocked by CORS",unreachable:"DID Space is unreachable",expired:"DID Spaces has expired, click this link to re-subscribe",pastDue:"DID Spaces has unpaid bills, click this link to complete payment",invalid:"DID Spaces subscription anomaly, click this link to check",unitLimit:"DID Spaces free quota has been used up, click this link to pay for the upgrade",cors:`The connection request may fail due to CORS restrictions:
1
+ import{D as w1,J as z1,j as r,Y as Y1,$ as W1,I as q1,ds as _1,ar as y1,ak as U,a$ as R,d7 as I1,b1 as $1,am as B1,T,bC as e6,z as t6,cs as n6,a6,Q as r6}from"./vendor-mui-core-BOHKtf8y.js";import{C as x,a as i6,ab as S1,J as M,c as s6,I as o6,F as c6}from"./vendor-utils-BOkrEpKO.js";import{T as l6,A as F1,e as u6,m as C6,s as p6,a as d6,n as t1,aF as n1}from"./vendor-ux-Cra9XTth.js";import{r as t}from"./vendor-react-Dvs43sk9.js";import{k as L1,b as v1,a as Z}from"./vendor-hooks-DTeIFVkk.js";import{bp as Y,T as W,bJ as U1,bK as h6,aj as H,v as m6,by as E6,bA as g6}from"./index-BGbMta1w.js";import{x as f6}from"./index-DRYJ0xIl.js";import{f as A6}from"./index-BojVbZw0.js";import{v as a1}from"./index-DSNvDaKK.js";const j=Y({});function D6({key:e}={key:"md"}){const n=w1();return z1(n.breakpoints.down(e))}var A=(e=>(e[e.NETWORK_ERROR=1001]="NETWORK_ERROR",e[e.UNAUTHORIZED=1002]="UNAUTHORIZED",e[e.EXPIRED=1003]="EXPIRED",e[e.PAST_DUE=1004]="PAST_DUE",e[e.INVALID=1005]="INVALID",e[e.UNIT_LIMIT=1006]="UNIT_LIMIT",e[e.CORS_BLOCKED=1007]="CORS_BLOCKED",e[e.INCOMPATIBLE=1008]="INCOMPATIBLE",e))(A||{}),O1=(e=>(e.DEFAULT="default",e.SUCCEEDED="succeeded",e.FAILED="failed",e.PENDING="pending",e))(O1||{}),F=(e=>(e.APP_DISCONNECTED="app-disconnected",e.APP_RESTORE="app-restore",e.APP_BACKUP="app-backup",e.APP_CONNECTED="app-connected",e.APP_OBJECTS_SYNC="app-objects-sync",e))(F||{});function x6({endpoint:e,deps:n=[]}){return L1(async()=>{if(!W(e))return;const{headers:a}=await j.head(e,{timeout:1e3*30,params:{withExtras:!0}}),[i,s,c,u,l,C,d,p,m,g]=[a["x-space-name"],a["x-subscription-id"],a["x-listable"]==="true",a["x-readable"]==="true",a["x-writeable"]==="true",a["x-space-version"],a["x-space-owner-did"],a["x-space-is-available"],a["x-error-code"],a["x-is-site-admin"]],h=i?decodeURIComponent(i):"";if(p===void 0||m===void 0){const f=c&&u&&l;return{version:C,name:h,subscriptionId:s,ownerDid:d||"",isAvailable:f,errorCode:f?0:A.UNAUTHORIZED,isSiteAdmin:g==="true"}}return{version:C,name:h,subscriptionId:s,ownerDid:d,isAvailable:p==="true",errorCode:parseInt(m,10),isSiteAdmin:g==="true"}},{refreshDeps:[e].concat(n),onError(a){console.error(a)}})}const w6=U1.flatten({common:{cancel:"Cancel",confirm:"Confirm",delete:"Delete",error:"Error",open:"Open",unknown:"Unknown",invalidUrl:"Invalid url: {url}",upgrade:"Upgrade",viewMore:"View More"},storage:{spaces:{authorize:{title:"Connect {appName} to DID Spaces",scan:"Use your DID Wallet to scan the QR code below to allow the app {appName} to connect to DID Spaces",success:"Connected successfully"},connect:{reconnect:"Reconnect Now",useSpaceGateway:"Connect using the DID Spaces gateway",useWallet:"Connect to DID Spaces",howToGetGatewayUrl:"How to get the url of did spaces",providerForStorage:"Please connect your DID Spaces"},connected:{title:"Connected DID Spaces",tag:"Connected"},disconnected:{tag:"Disconnected"},error:{tag:"Need Attention",blockedByCors:"Access blocked by CORS",unreachable:"DID Space is unreachable",expired:"DID Spaces has expired, click this link to re-subscribe",pastDue:"DID Spaces has unpaid bills, click this link to complete payment",invalid:"DID Spaces subscription anomaly, click this link to check",unitLimit:"DID Spaces free quota has been used up, click this link to pay for the upgrade",cors:`The connection request may fail due to CORS restrictions:
2
2
  1. Please contact the DID Space administrator to verify the relevant configuration.
3
3
  2. If you are the administrator, click the link below to view the detailed setup guide and resolve the issue.`,networkError:"DID Space is currently unreachable due to potential server issues, network problems, or maintenance. Please click the link to visit the homepage and check its status.",incompatible:`The current connection of DID Spaces version ({spaceVersion}) is not compatible with the component version ({expectVersion}). Please contact the administrator for adjustments.
4
4
  If you are the administrator, you can click the link below to take action.`},gateway:{add:{invalidUrl:"Invalid DID Spaces gateway url",label:"Enter the url of the DID Spaces",title:"Add DID Spaces"}},provideNFT:{title:"Please show the DID Spaces NFT for {appName}",scan:"Use your DID Wallet to scan the QR code below to allow the app {appName} show DID Spaces NFT",success:"Connected successfully"},helperText:{fixCorsError:"Fixing CORS Errors When Connecting to DID Spaces"}}},auditLog:{backup:{description:"A backup operation was completed {relativeTime}"},restore:{description:"A restore operation was completed {relativeTime}"},connected:{description:"A connection was established {relativeTime}"},disconnected:{description:"The connection was disconnected {relativeTime}"},objectsSync:{description:"{totalCount} objects ({size}) were synchronized {relativeTime}"}}}),y6=U1.flatten({common:{cancel:"取消",confirm:"确认",delete:"删除",error:"错误",open:"打开",unknown:"未知",invalidUrl:"无效的 url: {url}",upgrade:"升级",viewMore:"查看更多"},storage:{spaces:{authorize:{title:"连接 {appName} 至 DID Spaces",scan:"使用你的 DID Wallet 扫描下面的二维码以允许应用 {appName} 连接至 DID Spaces",success:"连接成功"},connect:{reconnect:"立即重连",useSpaceGateway:"使用 DID Spaces 网关连接",useWallet:"连接至 DID Spaces",howToGetGatewayUrl:"如何获取 DID Spaces 的网关地址",providerForStorage:"请连接您的 DID Spaces"},connected:{title:"已连接的 DID Spaces",tag:"已连接"},disconnected:{tag:"连接已断开"},error:{tag:"需要关注",blockedByCors:"因 CORS 限制,访问被阻止",unreachable:"DID Space 无法访问",expired:"DID Spaces 已过期,点击此链接重新订阅",pastDue:"DID Spaces 有未支付账单,点击此链接完成支付",invalid:"DID Spaces 订阅异常,点击此链接检查",unitLimit:"DID Spaces 免费额度已用完,点击此链接付费升级",cors:`连接请求可能因 CORS 限制而失败: