@abtnode/blocklet-services 1.16.52-beta-20251005-235515-42ad5caf → 1.16.52-beta-20251008-091027-c46c73e3

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 (173) hide show
  1. package/api/index.js +2 -0
  2. package/api/libs/connect/session.js +4 -0
  3. package/api/libs/jwt.js +16 -1
  4. package/api/middlewares/cdn.js +57 -0
  5. package/api/middlewares/launcher-login.js +3 -1
  6. package/api/routes/federated.js +2 -1
  7. package/api/routes/oauth/server.js +2 -1
  8. package/api/routes/user-session.js +4 -2
  9. package/api/routes/user.js +7 -4
  10. package/api/services/auth/connect/destroy-self.js +2 -1
  11. package/api/services/auth/connect/invite.js +2 -0
  12. package/api/services/auth/connect/issue-passport.js +2 -1
  13. package/api/services/auth/connect/receive-transfer-app-owner.js +2 -0
  14. package/api/services/auth/connect/verify-destroy.js +2 -1
  15. package/api/services/auth/connect/verify-elevated.js +2 -1
  16. package/api/services/auth/session.js +8 -2
  17. package/api/util/attach-shared-utils.js +27 -0
  18. package/api/util/user-util.js +4 -2
  19. package/dist/assets/{AdapterDayjs-wck-CfDF.js → AdapterDayjs-Bp0ir26R.js} +1 -1
  20. package/dist/assets/{Google-BFauCF2k.js → Google-E3u2a9g7.js} +1 -1
  21. package/dist/assets/{access-control-0wy7XAQb.js → access-control-Ba--N4dR.js} +1 -1
  22. package/dist/assets/{add-component-core-BM7p_09p.js → add-component-core-Bb9cf7tX.js} +1 -1
  23. package/dist/assets/{add-resource-DbQFT7Gg.js → add-resource-bRr_yw_3.js} +1 -1
  24. package/dist/assets/{addon-CUvC0k6Y.js → addon-yUrit7oi.js} +1 -1
  25. package/dist/assets/{advanced-BhCewgzQ.js → advanced-D9TZ4ybW.js} +1 -1
  26. package/dist/assets/{aigne-BQckonxP.js → aigne-Cu6_77H5.js} +1 -1
  27. package/dist/assets/{appearance-CjrhZWhd.js → appearance-BrKRJ2OH.js} +1 -1
  28. package/dist/assets/{arrow-down.svg-f3YCmAji.js → arrow-down.svg-DlrO603K.js} +1 -1
  29. package/dist/assets/{audit-logs-CASGp36e.js → audit-logs-Mq1PQXTB.js} +1 -1
  30. package/dist/assets/{authorize-CkVYs-vE.js → authorize-C--SRJv9.js} +1 -1
  31. package/dist/assets/{base32-Cyneng4p.js → base32-BK7MXAD4.js} +1 -1
  32. package/dist/assets/{bind-account-D6KenxOW.js → bind-account-pung7H5j.js} +1 -1
  33. package/dist/assets/{branding-DLDF3ZZP.js → branding-BLrOsw_-.js} +1 -1
  34. package/dist/assets/branding-C7mpxRh4.js +40 -0
  35. package/dist/assets/{branding-BVr5wVa5.js → branding-Dt37Dr7I.js} +1 -1
  36. package/dist/assets/{bundle-avatar-BpummNxa.js → bundle-avatar-DqG9a4da.js} +1 -1
  37. package/dist/assets/{button-DGHIlhos.js → button-BmGMF4AE.js} +1 -1
  38. package/dist/assets/{click-to-copy-B379bwP3.js → click-to-copy-CO6UIqva.js} +1 -1
  39. package/dist/assets/{complete-CQkeXJPL.js → complete-CoKZYR9F.js} +1 -1
  40. package/dist/assets/{component-DWN2cI-c.js → component-Bc7czE5l.js} +3 -3
  41. package/dist/assets/{config-BgdQYz7Z.js → config-CKLnLT0D.js} +1 -1
  42. package/dist/assets/{config-CPB45HHq.js → config-DVANrDYt.js} +1 -1
  43. package/dist/assets/{config-CRxOjKmb.js → config-DtmDVaR4.js} +1 -1
  44. package/dist/assets/{config-navigation-D1TBA90f.js → config-navigation-Cby9K4-E.js} +3 -3
  45. package/dist/assets/{config-space-DpOC6rFp.js → config-space-Dht59Ejw.js} +1 -1
  46. package/dist/assets/{confirm-BfJfcPyj.js → confirm--TizcqjW.js} +1 -1
  47. package/dist/assets/{connect-BbLXTlyu.js → connect-ClwbgmmS.js} +1 -1
  48. package/dist/assets/{connect-ZcwxKVuN.js → connect-Dtl48eI1.js} +1 -1
  49. package/dist/assets/{connect-to-Skv-ek56.js → connect-to-By6Le-Jn.js} +1 -1
  50. package/dist/assets/{create-passport-svg-DosyhcHP.js → create-passport-svg-n0J1kwzH.js} +1 -1
  51. package/dist/assets/{createClass-HFwzUuOB.js → createClass-D_F4rKN8.js} +1 -1
  52. package/dist/assets/{dashboard-DJ6Tc_2L.js → dashboard-W1yPGsmJ.js} +3 -3
  53. package/dist/assets/{delete-confirm-DNg1Z1xV.js → delete-confirm-D-yeVqhW.js} +1 -1
  54. package/dist/assets/{did-address-Dbg_LiWL.js → did-address-DnFNwELW.js} +1 -1
  55. package/dist/assets/{domain-3JvbKqlt.js → domain-D9aFylG7.js} +1 -1
  56. package/dist/assets/{domain-action-card-BixPviaZ.js → domain-action-card-CYQx-UV_.js} +1 -1
  57. package/dist/assets/{domains-D8QMeppe.js → domains-BpALgYqP.js} +1 -1
  58. package/dist/assets/email-BhtWr6R7.js +17 -0
  59. package/dist/assets/engine-DYqiOmI2.js +1 -0
  60. package/dist/assets/{exchange-passport-BraV0EOe.js → exchange-passport-BNEvLpB5.js} +1 -1
  61. package/dist/assets/{form-BIoto8u8.js → form-f821alW8.js} +1 -1
  62. package/dist/assets/{form-text-input-BgpOkOYh.js → form-text-input-CwOsIY5R.js} +1 -1
  63. package/dist/assets/{fuel-Dwo_gklT.js → fuel-DuwkxjDO.js} +1 -1
  64. package/dist/assets/{gen-access-key-DuRApUI5.js → gen-access-key-CN0zhLTt.js} +1 -1
  65. package/dist/assets/{gen-simple-access-key-xXyYChfi.js → gen-simple-access-key-DIgBggHb.js} +1 -1
  66. package/dist/assets/get-safe-url-vBpeXIdz.js +1 -0
  67. package/dist/assets/{home-D0rR9_38.js → home-mPwMffqg.js} +1 -1
  68. package/dist/assets/{iframe-COascK-f.js → iframe-KzW0dm8e.js} +1 -1
  69. package/dist/assets/{index-CARCeLG0.js → index-4jRQw4L_.js} +1 -1
  70. package/dist/assets/{index-B3o5bPY9.js → index-B6gW9Yjq.js} +1 -1
  71. package/dist/assets/{index-DKQpQSIL.js → index-BCCi6Lq2.js} +1 -1
  72. package/dist/assets/{index-BU5Qj_Uf.js → index-BEyElehf.js} +1 -1
  73. package/dist/assets/{index-DKp1VidC.js → index-BJmiMBT5.js} +1 -1
  74. package/dist/assets/{index-g1J2WU69.js → index-BOxaAkjO.js} +1 -1
  75. package/dist/assets/{index-DXDOA6wf.js → index-BQrqRaKe.js} +1 -1
  76. package/dist/assets/{index-BoF74OVD.js → index-BVKg9kyt.js} +4 -4
  77. package/dist/assets/{index-CjUelepA.js → index-BZdly4Mv.js} +1 -1
  78. package/dist/assets/{index-IYdn8PnM.js → index-Ba9-ArMT.js} +1 -1
  79. package/dist/assets/{index-BiMTr9N1.js → index-BwFIgPJi.js} +1 -1
  80. package/dist/assets/{index-DcGTEgwU.js → index-C2OUM1U1.js} +8 -9
  81. package/dist/assets/{index-d3X4O8S1.js → index-C7mL-9QT.js} +1 -1
  82. package/dist/assets/{index-DnsQF6x_.js → index-CESGl-7N.js} +1 -1
  83. package/dist/assets/{index-Cv0WQg6r.js → index-CNJImoEx.js} +3 -3
  84. package/dist/assets/{index-o5365tSi.js → index-CT821Gxy.js} +2 -2
  85. package/dist/assets/{index-cc7PDHui.js → index-Cdd4Tfik.js} +1 -1
  86. package/dist/assets/{index-pMD5HObM.js → index-CkGQymSq.js} +1 -1
  87. package/dist/assets/{index-DsZw1jDU.js → index-Cm-NT_bW.js} +8 -8
  88. package/dist/assets/index-D4mun0qD.js +1 -0
  89. package/dist/assets/{index-DOTZtBXk.js → index-DjYY4kdv.js} +1 -1
  90. package/dist/assets/{index-A5fXAFXl.js → index-DlrQ2HQP.js} +1 -1
  91. package/dist/assets/{index-Z8qCN0P1.js → index-Fh6kRzXi.js} +1 -1
  92. package/dist/assets/{index-un8ZaNww.js → index-L23hdRQP.js} +1 -1
  93. package/dist/assets/{index-CX8XMi66.js → index-PsRCU6L0.js} +1 -1
  94. package/dist/assets/{index-BrrIKxMS.js → index-Y8LQew4k.js} +1 -1
  95. package/dist/assets/{index-AMzbVwE1.js → index-Zg4das2-.js} +1 -1
  96. package/dist/assets/{index-BkMwz7Ha.js → index-ayyqwdz4.js} +1 -1
  97. package/dist/assets/{index-yINGgTD8.js → index-bHxYJHzd.js} +2 -2
  98. package/dist/assets/{index-Ds4S1_JK.js → index-baOgdvKt.js} +1 -1
  99. package/dist/assets/{invitation-HIuSHONR.js → invitation-D4kCwqOk.js} +1 -1
  100. package/dist/assets/{invitations-Bol3LHDV.js → invitations-DpOwRCbQ.js} +1 -1
  101. package/dist/assets/{invite--kfNCB-y.js → invite-wbFhcbNt.js} +1 -1
  102. package/dist/assets/{isURL-NLB1KXWU.js → isURL-G6x_O8uY.js} +1 -1
  103. package/dist/assets/{issue-passport-DEKfDU5Q.js → issue-passport-BajBQstU.js} +1 -1
  104. package/dist/assets/{item-8d2bomfb.js → item-CDlTR8j5.js} +1 -1
  105. package/dist/assets/{landing-page-BKWBeaB2.js → landing-page-DtGwsGjG.js} +1 -1
  106. package/dist/assets/{layout-BCGFP2fM.js → layout-BuaMn04z.js} +1 -1
  107. package/dist/assets/{list-CjwYZK4C.js → list-9ipLNgYh.js} +1 -1
  108. package/dist/assets/list-BJ8ZApBw.js +2 -0
  109. package/dist/assets/localization-C23KjUsD.js +1 -0
  110. package/dist/assets/{log-CwhRn7dG.js → log-CLdwEAyX.js} +1 -1
  111. package/dist/assets/logger-DVbuTPin.js +1 -0
  112. package/dist/assets/{login-D6vdg4tV.js → login-CyHjI083.js} +1 -1
  113. package/dist/assets/{login-oauth-callback-DNSbhkTX.js → login-oauth-callback-D8CJmm3G.js} +1 -1
  114. package/dist/assets/logo-uploader-KFwT9tkc.js +30 -0
  115. package/dist/assets/{lost-passport-JcRjjJMu.js → lost-passport-r1_GkMUE.js} +2 -3
  116. package/dist/assets/{open-window-5tX5UogI.js → open-window-DyYeAYHS.js} +1 -1
  117. package/dist/assets/{over-due-invoice-payment-BQTpVcW4.js → over-due-invoice-payment-B0CdR8TJ.js} +1 -1
  118. package/dist/assets/{overview-8cijjh6D.js → overview-sfT5Yibu.js} +1 -1
  119. package/dist/assets/{passport-dBKTMShn.js → passport-DQQ8X6jz.js} +1 -1
  120. package/dist/assets/{passport-item-DybXmjDL.js → passport-item-d0mYh9fE.js} +1 -1
  121. package/dist/assets/{permission-DPZmpN88.js → permission-CkYczF8Y.js} +1 -1
  122. package/dist/assets/{preferences-CSIWwAIC.js → preferences-VKwcqaIq.js} +1 -1
  123. package/dist/assets/profile-embed-DydXOOmr.js +1 -0
  124. package/dist/assets/{publish-resource-BEWgZsl5.js → publish-resource-C2l89_Ta.js} +1 -1
  125. package/dist/assets/{react-beautiful-dnd.esm-BbVphn6n.js → react-beautiful-dnd.esm-BeX82uI5.js} +1 -1
  126. package/dist/assets/{runtime-Dw23IX1l.js → runtime-gfyCn3ox.js} +1 -1
  127. package/dist/assets/sdk-D6yx55IK.js +1 -0
  128. package/dist/assets/{security-D_vkAC2F.js → security-DRzPHcOv.js} +1 -1
  129. package/dist/assets/{session-tOfkTx-G.js → session-DDq1z6GZ.js} +1 -1
  130. package/dist/assets/{setup-eJiK00ap.js → setup-k86HzPvL.js} +1 -1
  131. package/dist/assets/{spaces-f3sezu1Y.js → spaces-oEcRQ2FV.js} +1 -1
  132. package/dist/assets/{start-tshF2U2D.js → start-CCCc93bI.js} +1 -1
  133. package/dist/assets/{starting-progress-CNhbI5kz.js → starting-progress-CYME5Zxc.js} +1 -1
  134. package/dist/assets/{status-aauXt2lH.js → status-DOkMyJoB.js} +1 -1
  135. package/dist/assets/{step-actions-B_qluS-3.js → step-actions-twLrpzsB.js} +1 -1
  136. package/dist/assets/{studio-ahebVj52.js → studio-BFjODQ6U.js} +1 -1
  137. package/dist/assets/{switch-control-B8BKalcv.js → switch-control-DEpBEl7-.js} +1 -1
  138. package/dist/assets/{table-tips-CIe4hASP.js → table-tips-rCE1XKlc.js} +1 -1
  139. package/dist/assets/{team-DJZO6TyJ.js → team-BwPiOmaF.js} +1 -1
  140. package/dist/assets/{traffic-Dh4U8pnc.js → traffic-DpQHDLcs.js} +1 -1
  141. package/dist/assets/{transfer-CuvzwKCQ.js → transfer-Cf_iJEYW.js} +1 -1
  142. package/dist/assets/{unsubscribe-B1yTQQGf.js → unsubscribe-BSnjMXpn.js} +1 -1
  143. package/dist/assets/{use-app-logo-CqD9SoXr.js → use-app-logo-BOxU85aG.js} +1 -1
  144. package/dist/assets/use-window-close-CAdGHigF.js +1 -0
  145. package/dist/assets/{useLocalStorage-BPSCf_zz.js → useLocalStorage-BtAV-lV2.js} +1 -1
  146. package/dist/assets/{user-center-DDfna1uE.js → user-center-CMfgquz2.js} +4 -4
  147. package/dist/assets/{user-follower-Cc-51q-9.js → user-follower-Bpz7I8AJ.js} +1 -1
  148. package/dist/assets/{user-sessions-DkchVQBO.js → user-sessions-C9JRrUnO.js} +1 -1
  149. package/dist/assets/{util-B8Xud4vY.js → util-Df1wWBbn.js} +1 -1
  150. package/dist/assets/{util-D8KMfML_.js → util-DmoVzLCE.js} +1 -1
  151. package/dist/assets/{vendor-arcblock-CSGgL93G.js → vendor-arcblock-DeeG8u0h.js} +85 -85
  152. package/dist/assets/{vendor-ux-CDOuCaX1.js → vendor-ux-B9VfuZTg.js} +2 -2
  153. package/dist/assets/{wait-connect-CGOeOXHL.js → wait-connect-NY07DPE8.js} +1 -1
  154. package/dist/assets/{wizard-B7NraPoW.js → wizard-DyBuxY0o.js} +1 -1
  155. package/dist/assets/{wizard-components-Bl0PwqPC.js → wizard-components-AecBDiwz.js} +2 -2
  156. package/dist/assets/wrap-locale-DT0Mc5mX.js +1 -0
  157. package/dist/assets/{zh-DQ2rCoQ5.js → zh-Dcv0Swob.js} +1 -1
  158. package/dist/index.html +6 -8
  159. package/dist/service-worker.js +1 -1
  160. package/package.json +23 -23
  161. package/dist/assets/branding-CHhPscOd.js +0 -40
  162. package/dist/assets/email-C6m1mnbN.js +0 -18
  163. package/dist/assets/engine-DkWTqqhM.js +0 -1
  164. package/dist/assets/get-safe-url-HFT553nb.js +0 -1
  165. package/dist/assets/index-BAMrdOx5.js +0 -1
  166. package/dist/assets/list-CLnYaffq.js +0 -2
  167. package/dist/assets/localization-D4M90esB.js +0 -1
  168. package/dist/assets/logger-GZGSMwyW.js +0 -1
  169. package/dist/assets/logo-uploader-CehwiZZl.js +0 -30
  170. package/dist/assets/profile-embed-Dxmu0kHv.js +0 -1
  171. package/dist/assets/sdk-BIWRdmX9.js +0 -1
  172. package/dist/assets/use-window-close-CLNOz9Uq.js +0 -2
  173. package/dist/assets/wrap-locale-BQiQiZG-.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as e,y as Pt,bc as Pe,M as ie,ak as x,Q as H,W as u,J as pe,c1 as Rt,I as $,aN as It,T as I,aj as Tt,b5 as Le,P as Be,b6 as Q,a5 as We,z as Qe,A as Je,ci as At,bh as Mt,U as je,db as zt,dc as Et,at as X,dd as Lt,a6 as Z,n as ae,D as Bt,de as Wt,ar as Oe,b1 as Re,df as Ot,aX as Dt,am as Ce,bq as Nt,br as ye,a$ as $t,cW as Ut}from"./vendor-mui-core-DRxbhqaK.js";import{r as y,a as Ft,u as _t,j as qt}from"./vendor-react-Dvs43sk9.js";import{t as Xe,Z as Ht,a8 as Gt,R as De,D as Kt,C as le,n as V,A as Yt}from"./vendor-utils-CUDP56Ff.js";import{a as Vt,F as Zt,bw as Qt,c as Ie,W as Jt,bx as Xt,aW as Te,U as xe,bd as er,by as tr,a6 as rr,aY as nr,a7 as or,bz as sr}from"./index-DsZw1jDU.js";import{a as R,h as et,k as ee,g as G,b as E,j as ir}from"./vendor-hooks-BlA8TRnZ.js";import{l as tt}from"./arrow-down.svg-f3YCmAji.js";import{c as Ae,P as O,T as W,aw as ar,k as rt,ax as lr,H as q,ay as cr,az as dr,aA as Ne,f as ur,n as nt,e as Me,aB as pr,aC as M,C as xr,B as fr,$ as ot,aD as hr,aE as gr,A as mr,o as ce,I as $e,j as br,a1 as Ue}from"./vendor-ux-CDOuCaX1.js";import{N as yr}from"./list-CjwYZK4C.js";import{d as vr}from"./search-4YYphs0l.js";import{B as Fe}from"./bundle-avatar-BpummNxa.js";import{h as _e,T as wr}from"./team-DJZO6TyJ.js";import{b as jr,d as Cr,a as Sr,c as kr,e as Pr,f as Rr,h as Ir,_ as Tr}from"./user-center-DDfna1uE.js";import{T as qe,O as Ar}from"./index-BiMTr9N1.js";import{c as Mr}from"./passport-dBKTMShn.js";import{N as st,U as it}from"./index-un8ZaNww.js";import{u as te}from"./use-mobile-D6YQgajG.js";import zr from"./index-CjUelepA.js";import{f as J}from"./index-DBs9Ljax.js";import{u as Se}from"./index-A5fXAFXl.js";import{U as ve}from"./user-sessions-DkchVQBO.js";import Er from"./index-yINGgTD8.js";import{o as Lr}from"./vendor-arcblock-CSGgL93G.js";import{c as Br,b as de,a as Wr,S as Or}from"./index-Ds4S1_JK.js";import"./index-BrrIKxMS.js";import"./index-BojVbZw0.js";import{U as Dr}from"./user-follower-Cc-51q-9.js";import"./lottie-web-4koyQiv_.js";import"./server-logo-notext.svg-CKQB0tIp.js";import"./index-AMzbVwE1.js";import"./util-D8KMfML_.js";import"./base32-Cyneng4p.js";import"./session-tOfkTx-G.js";import"./isURL-NLB1KXWU.js";import"./use-app-logo-CqD9SoXr.js";import"./index-d3X4O8S1.js";import"./use-mobile-BQQpAf3i.js";import"./actions-B4VXcSRp.js";import"./index-IYdn8PnM.js";import"./form-text-input-BgpOkOYh.js";import"./required-BT8zXV8U.js";import"./form-wrapper-Dt1iJZge.js";import"./edit.svg-DycWG9v3.js";import"./lock.svg-COUP8tyO.js";import"./index-BU5Qj_Uf.js";import"./permission-DPZmpN88.js";import"./confirm-BfJfcPyj.js";import"./click-to-copy-B379bwP3.js";import"./invitations-Bol3LHDV.js";import"./create-passport-svg-DosyhcHP.js";import"./api-rC33aBSs.js";import"./table-tips-CIe4hASP.js";import"./passport-item-DybXmjDL.js";import"./did-address-Dbg_LiWL.js";import"./index-CX8XMi66.js";import"./vendor-mui-x-Qp6zkx78.js";import"./AdapterDayjs-wck-CfDF.js";import"./delete-confirm-DNg1Z1xV.js";import"./index-DRYJ0xIl.js";function Nr(){let t=new Map;function n({root:s,rootMargin:o,threshold:i}){let a=t.get(s);a||(a=new Map,t.set(s,a));let l=JSON.stringify({rootMargin:o,threshold:i}),p=a.get(l);if(!p){let r=new Map;p={observer:new IntersectionObserver(f=>{f.forEach(h=>{r.get(h.target)?.(h)})},{root:s,rootMargin:o,threshold:i}),entryCallbacks:r},a.set(l,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:n}}var $r="0px",Ur=[0],Fr=Nr();function _r(t){let n=t?.rootMargin??$r,s=t?.threshold??Ur,o=y.useRef(null),i=y.useRef(null),a=y.useRef(null),[l,p]=y.useState(),r=y.useCallback(()=>{let C=o.current;if(!C){p(void 0);return}let v=Fr.getObserver({root:i.current,rootMargin:n,threshold:s});v.observe(C,c=>{p(c)}),a.current=v},[n,s]),f=y.useCallback(()=>{let C=a.current,v=o.current;v&&C?.unobserve(v),a.current=null},[]),h=y.useCallback(C=>{f(),o.current=C,r()},[r,f]),m=y.useCallback(C=>{f(),i.current=C,r()},[r,f]);return[h,{entry:l,rootRef:m}]}var qr=_r;function Hr(t){let[n,s]=qr(t),o=!!s.entry?.isIntersecting,[i,a]=y.useState(o);return o&&!i&&a(!0),[n,{...s,isVisible:o,wasEverVisible:i}]}var Gr=Hr,Kr=100;function Yr({loading:t,hasNextPage:n,onLoadMore:s,rootMargin:o,disabled:i,delayInMs:a=Kr}){let l=y.useRef(s),[p,{rootRef:r,isVisible:f}]=Gr({rootMargin:o});y.useEffect(()=>{l.current=s},[s]);let h=!i&&!t&&f&&n;return y.useEffect(()=>{if(h){let m=setTimeout(()=>{l.current()},a);return()=>{clearTimeout(m)}}},[h,a]),[p,{rootRef:r}]}var Vr=Yr;const we={info:"#3B82F6",success:"#10B981",warning:"#F59E0B",error:"#EF4444"};ue.propTypes={severity:u.oneOf(["info","success","warning","error",""]).isRequired,size:u.number};function ue({severity:t,size:n=8}){return we[t]?e.jsx(x,{component:"span",sx:{display:"inline-block",width:n,height:n,borderRadius:"50%",backgroundColor:we[t]||we.info}}):null}at.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 at({theme:t="dark",type:n="button",onSelectType:s,extra:o=void 0,currentTab:i="",loading:a=!1,...l}){const{t:p}=y.useContext(Ae),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!==i||!a)&&s(g)},h=y.useMemo(()=>{const g={width:"100%",bgcolor:t==="dark"?"#F9FAFB":"",overflowY:"auto",paddingTop:n==="select"?"0":"5px",whiteSpace:"nowrap",borderRadius:0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"8px"};return n==="line"?Object.assign(g,{}):g},[n,t]),m=(g,S,T)=>e.jsx(H,{disabled:a,onClick:()=>f(g.value),className:`profile-button ${S?"active":""}`,...l,children:g.label},g.value||T),C=(g,S,T)=>e.jsx(H,{variant:"text",disabled:a,onClick:()=>f(g.value),className:`profile-line-button ${S?"active":""}`,...l,children:g.label},g.value||T),v=()=>r?.map((g,S)=>{const T=i===g?.value;return n==="line"?e.jsx(y.Fragment,{children:C(g,T,S)},g.value||S):e.jsx(y.Fragment,{children:m(g,T,S)},g.value||S)}),c=g=>{const{value:S}=g.target;f(S==="all"?"":S)};return n==="select"?e.jsx(Pt,{sx:{maxWidth:300},children:e.jsx(Pe,{value:i||"all",onChange:c,size:"small",label:"Severity",IconComponent:g=>e.jsx(tt,{...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(ie,{value:g.value||"all",children:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(ue,{severity:g.value}),g.label]})},g.value||S))})}):e.jsxs(x,{className:"severity-tabs",sx:h,children:[e.jsx(x,{sx:{...n==="line"?{flex:1,borderBottom:"1px solid",borderColor:"grey.200"}:{display:"flex",gap:"24px"}},children:v()}),o]})}lt.propTypes={paging:u.objectOf(u.any).isRequired,loading:u.bool.isRequired,onChange:u.func.isRequired};function lt({loading:t,paging:n,onChange:s}){const{t:o}=y.useContext(Ae),i=pe(r=>r.breakpoints.down("md"));if(n.pageCount<=0||i)return null;const a=(r,f)=>{s({page:f+1})},l=r=>{const f=Number(r.target.value);s({page:1,pageSize:f})},p=n.page-1<=0?0:n.page-1;return e.jsx(x,{className:"notification-pagination",sx:{mt:2,display:"flex",justifyContent:"flex-end"},children:e.jsx(Rt,{component:"div",disabled:t,count:n.total,page:p,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:o("pagination.rowsPerPage"),labelDisplayedRows:({from:r,to:f,count:h})=>`${r}–${f} / ${h!==-1?h:`${o()}more than ${f}`}`,rowsPerPage:n.pageSize,onPageChange:a,onRowsPerPageChange:l})})}const Zr=y.memo(lt),Qr={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"/>'},He=6,Ge={"& .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}},Jr={border:"1px solid",borderColor:"divider",borderRadius:1,overflow:"hidden",backgroundColor:"background.paper",backgroundImage:"none",transition:"all 0.2s ease-in-out"},Ke=()=>({...Jr,width:"calc(50% - 8px)"});ct.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 ct({onFilterChange:t=()=>{},loading:n=!1,type:s="service",blockletMap:o={},filterType:i="component",selectedId:a=[],severity:l=[],enableMarkAllAsRead:p=!0,unReadCount:r=0,onReadFilterChange:f=()=>{},currentReadFilter:h="all"}){const{t:m}=y.useContext(Ae),[C,v]=y.useState(null),c=!!C,[g,S]=y.useState(a),[T,P]=y.useState(l),[b,z]=y.useState(!1),[L,F]=y.useState(""),[N,j]=y.useState([]);y.useEffect(()=>{S(a),P(l)},[a,l]);const k=[{label:m("notification.filterType.all"),value:"all"},{label:m("notification.filterType.unread"),value:"unread"}],D=d=>{(d!==h||!n)&&f(d)},K=[{label:m("notification.severityType.info"),value:"info"},{label:m("notification.severityType.success"),value:"success"},{label:m("notification.severityType.warning"),value:"warning"},{label:m("notification.severityType.error"),value:"error"}],re=d=>{v(d.currentTarget),F(""),z(!1)},he=()=>{v(null)},ne=d=>{const w=g.includes(d)?g.filter(A=>A!==d):[...g,d];S(w),t({id:w,severity:T})},oe=d=>{const w=T.includes(d)?T.filter(A=>A!==d):[...T,d];P(w),t({severity:w,id:g})},ge=d=>{F(d.target.value)},me=()=>{z(!b)},Y=Ft.useMemo(()=>{if(!o.size)return[];const d=[];return i==="component"&&d.push({label:m("notification.system"),id:"system"}),Array.from(o).forEach(([,w])=>{const A=w.did||w.meta?.did,B=w.title||w.meta?.title||"",_=w.appPid||w.appDid;(i==="component"&&_!==A||i==="entity"&&_===A)&&d.push({label:B,id:A,blocklet:w,ancestors:w.ancestors})}),d},[o,i,m]);y.useEffect(()=>{if(L.trim()==="")j(Y);else{const d=L.toLowerCase(),w=Y.filter(A=>A.label.toLowerCase().includes(d));j(w)}},[L,Y]);const be=L.trim()!==""||b?N:N.slice(0,He);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:k.map(d=>e.jsxs(H,{disabled:n,onClick:()=>D(d.value),className:`profile-button ${h===d.value?"active":""}`,sx:{...s==="service"&&h===d.value?{color:"secondary.main"}:{},color:"red",fontWeight:h===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($,{size:"small",onClick:re,disabled:n,sx:{minWidth:"auto",borderRadius:1,border:"1px solid",borderColor:"divider","&:hover":{backgroundColor:"action.hover"}},children:e.jsx(O,{icon:Qr,hFlip:!0})}),e.jsx(It,{open:c,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:m("notification.severity")}),e.jsx(x,{sx:{minWidth:"60px",display:"flex",justifyContent:"flex-end"},children:(g.length>0||T.length>0)&&e.jsx(H,{size:"small",onClick:()=>{S([]),P([]),t({severity:[],id:[]})},startIcon:e.jsx(Tt,{fontSize:"small"}),sx:{color:"text.secondary",textTransform:"none",minWidth:"auto","&:hover":{backgroundColor:"transparent"},"& .MuiButton-startIcon":{marginRight:"2px"}},children:m("notification.clear")})})]}),e.jsx(x,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(Le,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2,flex:1},children:K.map(d=>e.jsx(Be,{elevation:0,sx:Ke(T.includes(d.value)),children:e.jsx(Q,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{display:"flex",alignItems:"center",gap:1,fontSize:"0.875rem"},...Ge},control:e.jsx(We,{checked:T.includes(d.value),onChange:()=>oe(d.value),disabled:n,size:"small"}),label:e.jsxs(x,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5},children:[e.jsx(ue,{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:m("notification.from")}),e.jsx(x,{sx:{display:"flex",alignItems:"center",width:"calc(100% - 36px)"},children:e.jsx(Qe,{size:"small",placeholder:"search",value:L,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(Je,{position:"start",sx:{marginRight:"2px"},children:e.jsx(O,{icon:vr})})}}})})]}),e.jsx(Le,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2},children:be.map(d=>e.jsx(Be,{elevation:0,sx:Ke(g.includes(d.id)),children:e.jsx(Q,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{fontSize:"0.875rem",width:"calc(100% - 36px)"},...Ge},control:e.jsx(We,{checked:g.includes(d.id),onChange:()=>ne(d.id),disabled:n,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(Fe,{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))}),N.length>He&&L.trim()===""&&e.jsx(H,{fullWidth:!0,size:"small",onClick:me,sx:{mt:1},endIcon:b?e.jsx(At,{}):e.jsx(Mt,{})})]})]})})]})]}),g.length>0||T.length>0?e.jsxs(x,{className:"notification-filter-content",sx:{display:"flex",flexWrap:"wrap",gap:1,mt:2},children:[T.map(d=>{const w=K.find(A=>A.value===d);return e.jsx(je,{label:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(ue,{severity:d}),w?w.label:d]}),onDelete:()=>oe(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 w=Y.find(A=>A.id===d);return e.jsx(je,{label:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:.5},children:[w?.blocklet&&e.jsx(Fe,{size:16,blocklet:w.blocklet,ancestors:w.ancestors,style:{borderRadius:4,flexShrink:0}}),w?w.label:d]}),variant:"outlined",onDelete:()=>ne(d),size:"small",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`component-${d}`)})]}):null]})}const Xr=X(Lt)`
1
+ import{j as e,y as Pt,bc as Pe,M as ie,ak as x,Q as H,W as u,J as pe,c1 as Rt,I as $,aN as It,T as I,aj as Tt,b5 as Le,P as Be,b6 as Q,a5 as We,z as Qe,A as Je,ci as At,bh as Mt,U as je,db as zt,dc as Et,at as X,dd as Lt,a6 as Z,n as ae,D as Bt,de as Wt,ar as Oe,b1 as Re,df as Ot,aX as Dt,am as Ce,bq as Nt,br as ye,a$ as $t,cW as Ut}from"./vendor-mui-core-DRxbhqaK.js";import{r as y,a as Ft,u as _t,j as qt}from"./vendor-react-Dvs43sk9.js";import{t as Xe,Z as Ht,a8 as Gt,R as De,D as Kt,C as le,n as V,A as Yt}from"./vendor-utils-CUDP56Ff.js";import{a as Vt,F as Zt,bw as Qt,c as Ie,W as Jt,bx as Xt,aW as Te,U as xe,bd as er,by as tr,a6 as rr,aY as nr,a7 as or,bz as sr}from"./index-Cm-NT_bW.js";import{a as R,h as et,k as ee,g as G,b as E,j as ir}from"./vendor-hooks-BlA8TRnZ.js";import{l as tt}from"./arrow-down.svg-DlrO603K.js";import{c as Ae,P as O,T as W,aw as ar,k as rt,ax as lr,H as q,ay as cr,az as dr,aA as Ne,f as ur,n as nt,e as Me,aB as pr,aC as M,C as xr,B as fr,$ as ot,aD as hr,aE as gr,A as mr,o as ce,I as $e,j as br,a1 as Ue}from"./vendor-ux-B9VfuZTg.js";import{N as yr}from"./list-9ipLNgYh.js";import{d as vr}from"./search-4YYphs0l.js";import{B as Fe}from"./bundle-avatar-DqG9a4da.js";import{h as _e,T as wr}from"./team-BwPiOmaF.js";import{b as jr,d as Cr,a as Sr,c as kr,e as Pr,f as Rr,h as Ir,_ as Tr}from"./user-center-CMfgquz2.js";import{T as qe,O as Ar}from"./index-BwFIgPJi.js";import{c as Mr}from"./passport-DQQ8X6jz.js";import{N as st,U as it}from"./index-L23hdRQP.js";import{u as te}from"./use-mobile-D6YQgajG.js";import zr from"./index-BZdly4Mv.js";import{f as J}from"./index-DBs9Ljax.js";import{u as Se}from"./index-DlrQ2HQP.js";import{U as ve}from"./user-sessions-C9JRrUnO.js";import Er from"./index-bHxYJHzd.js";import{o as Lr}from"./vendor-arcblock-DeeG8u0h.js";import{c as Br,b as de,a as Wr,S as Or}from"./index-baOgdvKt.js";import"./index-Y8LQew4k.js";import"./index-BojVbZw0.js";import{U as Dr}from"./user-follower-Bpz7I8AJ.js";import"./lottie-web-4koyQiv_.js";import"./server-logo-notext.svg-CKQB0tIp.js";import"./index-Zg4das2-.js";import"./util-DmoVzLCE.js";import"./base32-BK7MXAD4.js";import"./session-DDq1z6GZ.js";import"./isURL-G6x_O8uY.js";import"./use-app-logo-BOxU85aG.js";import"./index-C7mL-9QT.js";import"./use-mobile-BQQpAf3i.js";import"./actions-B4VXcSRp.js";import"./index-Ba9-ArMT.js";import"./form-text-input-CwOsIY5R.js";import"./required-BT8zXV8U.js";import"./form-wrapper-Dt1iJZge.js";import"./edit.svg-DycWG9v3.js";import"./lock.svg-COUP8tyO.js";import"./index-BEyElehf.js";import"./permission-CkYczF8Y.js";import"./confirm--TizcqjW.js";import"./click-to-copy-CO6UIqva.js";import"./invitations-DpOwRCbQ.js";import"./create-passport-svg-n0J1kwzH.js";import"./api-rC33aBSs.js";import"./table-tips-rCE1XKlc.js";import"./passport-item-d0mYh9fE.js";import"./did-address-DnFNwELW.js";import"./index-PsRCU6L0.js";import"./vendor-mui-x-Qp6zkx78.js";import"./AdapterDayjs-Bp0ir26R.js";import"./delete-confirm-D-yeVqhW.js";import"./index-DRYJ0xIl.js";function Nr(){let t=new Map;function n({root:s,rootMargin:o,threshold:i}){let a=t.get(s);a||(a=new Map,t.set(s,a));let l=JSON.stringify({rootMargin:o,threshold:i}),p=a.get(l);if(!p){let r=new Map;p={observer:new IntersectionObserver(f=>{f.forEach(h=>{r.get(h.target)?.(h)})},{root:s,rootMargin:o,threshold:i}),entryCallbacks:r},a.set(l,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:n}}var $r="0px",Ur=[0],Fr=Nr();function _r(t){let n=t?.rootMargin??$r,s=t?.threshold??Ur,o=y.useRef(null),i=y.useRef(null),a=y.useRef(null),[l,p]=y.useState(),r=y.useCallback(()=>{let C=o.current;if(!C){p(void 0);return}let v=Fr.getObserver({root:i.current,rootMargin:n,threshold:s});v.observe(C,c=>{p(c)}),a.current=v},[n,s]),f=y.useCallback(()=>{let C=a.current,v=o.current;v&&C?.unobserve(v),a.current=null},[]),h=y.useCallback(C=>{f(),o.current=C,r()},[r,f]),m=y.useCallback(C=>{f(),i.current=C,r()},[r,f]);return[h,{entry:l,rootRef:m}]}var qr=_r;function Hr(t){let[n,s]=qr(t),o=!!s.entry?.isIntersecting,[i,a]=y.useState(o);return o&&!i&&a(!0),[n,{...s,isVisible:o,wasEverVisible:i}]}var Gr=Hr,Kr=100;function Yr({loading:t,hasNextPage:n,onLoadMore:s,rootMargin:o,disabled:i,delayInMs:a=Kr}){let l=y.useRef(s),[p,{rootRef:r,isVisible:f}]=Gr({rootMargin:o});y.useEffect(()=>{l.current=s},[s]);let h=!i&&!t&&f&&n;return y.useEffect(()=>{if(h){let m=setTimeout(()=>{l.current()},a);return()=>{clearTimeout(m)}}},[h,a]),[p,{rootRef:r}]}var Vr=Yr;const we={info:"#3B82F6",success:"#10B981",warning:"#F59E0B",error:"#EF4444"};ue.propTypes={severity:u.oneOf(["info","success","warning","error",""]).isRequired,size:u.number};function ue({severity:t,size:n=8}){return we[t]?e.jsx(x,{component:"span",sx:{display:"inline-block",width:n,height:n,borderRadius:"50%",backgroundColor:we[t]||we.info}}):null}at.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 at({theme:t="dark",type:n="button",onSelectType:s,extra:o=void 0,currentTab:i="",loading:a=!1,...l}){const{t:p}=y.useContext(Ae),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!==i||!a)&&s(g)},h=y.useMemo(()=>{const g={width:"100%",bgcolor:t==="dark"?"#F9FAFB":"",overflowY:"auto",paddingTop:n==="select"?"0":"5px",whiteSpace:"nowrap",borderRadius:0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"8px"};return n==="line"?Object.assign(g,{}):g},[n,t]),m=(g,S,T)=>e.jsx(H,{disabled:a,onClick:()=>f(g.value),className:`profile-button ${S?"active":""}`,...l,children:g.label},g.value||T),C=(g,S,T)=>e.jsx(H,{variant:"text",disabled:a,onClick:()=>f(g.value),className:`profile-line-button ${S?"active":""}`,...l,children:g.label},g.value||T),v=()=>r?.map((g,S)=>{const T=i===g?.value;return n==="line"?e.jsx(y.Fragment,{children:C(g,T,S)},g.value||S):e.jsx(y.Fragment,{children:m(g,T,S)},g.value||S)}),c=g=>{const{value:S}=g.target;f(S==="all"?"":S)};return n==="select"?e.jsx(Pt,{sx:{maxWidth:300},children:e.jsx(Pe,{value:i||"all",onChange:c,size:"small",label:"Severity",IconComponent:g=>e.jsx(tt,{...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(ie,{value:g.value||"all",children:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(ue,{severity:g.value}),g.label]})},g.value||S))})}):e.jsxs(x,{className:"severity-tabs",sx:h,children:[e.jsx(x,{sx:{...n==="line"?{flex:1,borderBottom:"1px solid",borderColor:"grey.200"}:{display:"flex",gap:"24px"}},children:v()}),o]})}lt.propTypes={paging:u.objectOf(u.any).isRequired,loading:u.bool.isRequired,onChange:u.func.isRequired};function lt({loading:t,paging:n,onChange:s}){const{t:o}=y.useContext(Ae),i=pe(r=>r.breakpoints.down("md"));if(n.pageCount<=0||i)return null;const a=(r,f)=>{s({page:f+1})},l=r=>{const f=Number(r.target.value);s({page:1,pageSize:f})},p=n.page-1<=0?0:n.page-1;return e.jsx(x,{className:"notification-pagination",sx:{mt:2,display:"flex",justifyContent:"flex-end"},children:e.jsx(Rt,{component:"div",disabled:t,count:n.total,page:p,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:o("pagination.rowsPerPage"),labelDisplayedRows:({from:r,to:f,count:h})=>`${r}–${f} / ${h!==-1?h:`${o()}more than ${f}`}`,rowsPerPage:n.pageSize,onPageChange:a,onRowsPerPageChange:l})})}const Zr=y.memo(lt),Qr={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"/>'},He=6,Ge={"& .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}},Jr={border:"1px solid",borderColor:"divider",borderRadius:1,overflow:"hidden",backgroundColor:"background.paper",backgroundImage:"none",transition:"all 0.2s ease-in-out"},Ke=()=>({...Jr,width:"calc(50% - 8px)"});ct.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 ct({onFilterChange:t=()=>{},loading:n=!1,type:s="service",blockletMap:o={},filterType:i="component",selectedId:a=[],severity:l=[],enableMarkAllAsRead:p=!0,unReadCount:r=0,onReadFilterChange:f=()=>{},currentReadFilter:h="all"}){const{t:m}=y.useContext(Ae),[C,v]=y.useState(null),c=!!C,[g,S]=y.useState(a),[T,P]=y.useState(l),[b,z]=y.useState(!1),[L,F]=y.useState(""),[N,j]=y.useState([]);y.useEffect(()=>{S(a),P(l)},[a,l]);const k=[{label:m("notification.filterType.all"),value:"all"},{label:m("notification.filterType.unread"),value:"unread"}],D=d=>{(d!==h||!n)&&f(d)},K=[{label:m("notification.severityType.info"),value:"info"},{label:m("notification.severityType.success"),value:"success"},{label:m("notification.severityType.warning"),value:"warning"},{label:m("notification.severityType.error"),value:"error"}],re=d=>{v(d.currentTarget),F(""),z(!1)},he=()=>{v(null)},ne=d=>{const w=g.includes(d)?g.filter(A=>A!==d):[...g,d];S(w),t({id:w,severity:T})},oe=d=>{const w=T.includes(d)?T.filter(A=>A!==d):[...T,d];P(w),t({severity:w,id:g})},ge=d=>{F(d.target.value)},me=()=>{z(!b)},Y=Ft.useMemo(()=>{if(!o.size)return[];const d=[];return i==="component"&&d.push({label:m("notification.system"),id:"system"}),Array.from(o).forEach(([,w])=>{const A=w.did||w.meta?.did,B=w.title||w.meta?.title||"",_=w.appPid||w.appDid;(i==="component"&&_!==A||i==="entity"&&_===A)&&d.push({label:B,id:A,blocklet:w,ancestors:w.ancestors})}),d},[o,i,m]);y.useEffect(()=>{if(L.trim()==="")j(Y);else{const d=L.toLowerCase(),w=Y.filter(A=>A.label.toLowerCase().includes(d));j(w)}},[L,Y]);const be=L.trim()!==""||b?N:N.slice(0,He);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:k.map(d=>e.jsxs(H,{disabled:n,onClick:()=>D(d.value),className:`profile-button ${h===d.value?"active":""}`,sx:{...s==="service"&&h===d.value?{color:"secondary.main"}:{},color:"red",fontWeight:h===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($,{size:"small",onClick:re,disabled:n,sx:{minWidth:"auto",borderRadius:1,border:"1px solid",borderColor:"divider","&:hover":{backgroundColor:"action.hover"}},children:e.jsx(O,{icon:Qr,hFlip:!0})}),e.jsx(It,{open:c,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:m("notification.severity")}),e.jsx(x,{sx:{minWidth:"60px",display:"flex",justifyContent:"flex-end"},children:(g.length>0||T.length>0)&&e.jsx(H,{size:"small",onClick:()=>{S([]),P([]),t({severity:[],id:[]})},startIcon:e.jsx(Tt,{fontSize:"small"}),sx:{color:"text.secondary",textTransform:"none",minWidth:"auto","&:hover":{backgroundColor:"transparent"},"& .MuiButton-startIcon":{marginRight:"2px"}},children:m("notification.clear")})})]}),e.jsx(x,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(Le,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2,flex:1},children:K.map(d=>e.jsx(Be,{elevation:0,sx:Ke(T.includes(d.value)),children:e.jsx(Q,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{display:"flex",alignItems:"center",gap:1,fontSize:"0.875rem"},...Ge},control:e.jsx(We,{checked:T.includes(d.value),onChange:()=>oe(d.value),disabled:n,size:"small"}),label:e.jsxs(x,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5},children:[e.jsx(ue,{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:m("notification.from")}),e.jsx(x,{sx:{display:"flex",alignItems:"center",width:"calc(100% - 36px)"},children:e.jsx(Qe,{size:"small",placeholder:"search",value:L,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(Je,{position:"start",sx:{marginRight:"2px"},children:e.jsx(O,{icon:vr})})}}})})]}),e.jsx(Le,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2},children:be.map(d=>e.jsx(Be,{elevation:0,sx:Ke(g.includes(d.id)),children:e.jsx(Q,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{fontSize:"0.875rem",width:"calc(100% - 36px)"},...Ge},control:e.jsx(We,{checked:g.includes(d.id),onChange:()=>ne(d.id),disabled:n,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(Fe,{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))}),N.length>He&&L.trim()===""&&e.jsx(H,{fullWidth:!0,size:"small",onClick:me,sx:{mt:1},endIcon:b?e.jsx(At,{}):e.jsx(Mt,{})})]})]})})]})]}),g.length>0||T.length>0?e.jsxs(x,{className:"notification-filter-content",sx:{display:"flex",flexWrap:"wrap",gap:1,mt:2},children:[T.map(d=>{const w=K.find(A=>A.value===d);return e.jsx(je,{label:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(ue,{severity:d}),w?w.label:d]}),onDelete:()=>oe(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 w=Y.find(A=>A.id===d);return e.jsx(je,{label:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:.5},children:[w?.blocklet&&e.jsx(Fe,{size:16,blocklet:w.blocklet,ancestors:w.ancestors,style:{borderRadius:4,flexShrink:0}}),w?w.label:d]}),variant:"outlined",onDelete:()=>ne(d),size:"small",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`component-${d}`)})]}):null]})}const Xr=X(Lt)`
2
2
  position: fixed;
3
3
  bottom: 20px;
4
4
  right: 20px;
@@ -118,7 +118,7 @@ import{j as e,y as Pt,bc as Pe,M as ie,ak as x,Q as H,W as u,J as pe,c1 as Rt,I
118
118
  height: 75vmin;
119
119
  }
120
120
  }
121
- `,an=t=>({position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.6)",opacity:0,transition:"opacity 0.3s ease-in-out",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1,"& .mask-item":{backgroundColor:ae(t.palette.background.paper,.9),color:"text.primary","&:hover":{backgroundColor:ae(t.palette.background.paper,1)}}}),ln={position:"absolute",bottom:0,left:0,right:0,height:24,backgroundColor:"rgba(0, 0, 0, 0.6)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",gap:1,zIndex:1,"& .mask-item":{width:20,height:20,color:"white"}},Ye="https://main.abtnetwork.io/explorer";function pt({user:t}){const{t:n}=W(),s=te(),[o,i]=y.useState({visible:!1,nft:null}),[a,l]=y.useState({anchorEl:null,props:null}),p=P=>{const b=le(Ye,"assets",P);window.open(b,"_blank")},r=(P,b)=>{let z="";typeof b.data?.value=="string"?z=JSON.parse(b.data?.value)?.domain:z=b.data?.value?.domain,l({anchorEl:P,props:{title:z?`Hey, I just won an NFT at the ${z} event!`:"Hey, I just won an NFT!",url:le(Ye,"assets",b.address)}})},f=P=>{i({visible:!0,nft:P})},h=G({page:1,size:20}),m=ee(async(P=h)=>(await Kt.get(`${Ie.WELLKNOWN_SERVICE_PATH_PREFIX}/ocap/listAssets`,{params:{ownerAddress:t.did,...P}})).data,{ready:t?.did&&h,defaultParams:[h],refreshDeps:[t?.did,h]}),{loading:C,data:v}=m,c=v?.page??{cursor:0,next:!1,total:0},g=(P,b)=>{h.page=b,m.run(h)},S=E(P=>[e.jsx($,{size:"small",className:"mask-item",onClick:b=>{b.stopPropagation(),p(P.address)},children:e.jsx(O,{icon:"tabler:link",fontSize:18})},"link"),e.jsx($,{size:"small",onClick:b=>{b.stopPropagation(),r(b.currentTarget,P)},className:"mask-item",children:e.jsx(O,{icon:"tabler:share-2",fontSize:18})},"share"),e.jsx($,{size:"small",onClick:b=>{b.stopPropagation(),f(P)},className:"mask-item",children:e.jsx(O,{icon:"tabler:eye",fontSize:18})},"view")]),T=R(()=>{if(C){const P=["skeleton-1","skeleton-2","skeleton-3","skeleton-4","skeleton-5"].map(b=>e.jsx(Oe,{variant:"rectangular",width:"15%",height:166,sx:{borderRadius:1,flexShrink:0}},b));return e.jsxs(x,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsx(Oe,{width:"20%"}),e.jsx(x,{sx:{display:"flex",flexDirection:"row",gap:2,flexWrap:"nowrap"},children:P})]})}return e.jsxs(e.Fragment,{children:[e.jsx(I,{sx:{color:"grey.A700",fontWeight:600,mb:2.5},children:n("userCenter.common.nft")}),v?.assets?.length===0&&!C&&e.jsx(x,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},children:e.jsx(rt,{children:n("userCenter.common.noNFT")})}),e.jsx(x,{className:"nft-list-wrapper",sx:{display:"grid",justifyItems:"start",gridTemplateColumns:{xs:"repeat(2, 1fr)",sm:"repeat(3, 1fr)",md:"repeat(3, 1fr)",lg:"repeat(5, 1fr)"},gap:2.5},children:v?.assets?.map(P=>e.jsxs(x,{sx:{flexShrink:0,width:{xs:120,sm:120,md:120,lg:166},height:{xs:120,sm:120,md:120,lg:166},position:"relative",borderRadius:1,overflow:"hidden",cursor:"pointer",...s?{}:{"&:hover .mask":{opacity:1}}},children:[e.jsx(st,{data:it(P),address:P.address,inset:!0,imageFilter:{imageFilter:"resize",w:"500",f:"webp"}}),s?e.jsx(x,{className:"footer-mask",sx:ln,children:S(P)}):e.jsx(x,{className:"mask",sx:an,children:e.jsx(Re,{direction:"row",spacing:1,children:S(P)})})]},P.address))}),c.next||h.page>1?e.jsx(Ot,{sx:{display:"flex",justifyContent:"center",mt:2},page:h.page,onChange:g,count:Math.ceil(c.total/h.size),size:"small"}):null,e.jsx(nn,{visible:o.visible&&!!o.nft,nft:o.nft,onClose:()=>{i({visible:!1,nft:null})}}),e.jsx(lr,{anchorEl:a.anchorEl,onClose:()=>{l({anchorEl:null,props:null})},sharedProps:a.props||{title:"",url:""}})]})},[C,c,h.page,h.size,g,a,o]);return e.jsx(x,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2,mb:5},children:T})}pt.propTypes={user:u.object.isRequired};function cn(){const{t}=W(),{user:n,isMyself:s,viewUser:o}=fe();return e.jsxs(x,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[s?e.jsxs(x,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1.5,p:2},children:[e.jsx(I,{sx:{color:"text.primary",fontWeight:600,mb:2.5},children:t("userCenter.passport")}),e.jsx(ut,{user:n})]}):null,e.jsx(pt,{user:s?n:o})]})}const dn=[{name:"English",code:"en"},{name:"中文",code:"zh"}];function xt({user:t,onSave:n}){const{t:s,changeLocale:o}=W(),i=G({locale:t.locale,loading:!1}),a=E(async l=>{try{const{value:p}=l.target;i.loading=!0,await U.user.saveProfile({locale:p}),await n("profile"),o(p),i.locale=p}catch(p){q.error(J(p))}finally{i.loading=!1}});return e.jsxs(x,{sx:{gap:1,display:"grid",alignItems:"center",gridTemplateColumns:{xs:"1fr",sm:"max-content 1fr"}},children:[e.jsx(x,{children:s("userCenter.commonSetting.locale")}),e.jsx(x,{children:e.jsx(Pe,{value:i.locale,onChange:a,size:"small",IconComponent:l=>e.jsx(tt,{...l,width:20,height:20}),sx:{minWidth:200,"&:hover":{"fieldset.MuiOutlinedInput-notchedOutline":{borderColor:"divider"}},fieldset:{borderColor:"divider"}},children:(window.blocklet.languages||dn).map(l=>e.jsx(ie,{value:l.code,children:l.name},l.code))})})]})}xt.propTypes={user:u.shape({locale:u.string}).isRequired,onSave:u.func.isRequired};function ke({onTest:t=V,onDelete:n=V,onSave:s=V,onCancel:o=V,type:i="slack",url:a="",edit:l=!1}){const{t:p}=W(),r=G({type:i||"slack",url:a||"",edit:l??!1,error:"",loading:!1}),f=E(()=>r.url?Jt(r.url)?(r.error="",!0):(r.error=p("common.invalid"),!1):(r.error=p("common.required"),!1)),h=E(()=>{r.edit=!1,r.url=a||"",r.type=i||"slack",r.error="",r.loading=!1,o()}),m=E(async c=>{r.loading=!0,await t(c),r.loading=!1}),C=E(c=>()=>{f()&&c({type:r.type,url:r.url})}),v=R(()=>r.error?e.jsx(I,{component:"span",color:"error",children:r.error}):r.edit?r.loading?e.jsx(Z,{size:16}):e.jsx($,{size:"small",onClick:C(m),sx:{mr:-1},children:e.jsx(O,{icon:Cr})}):null,[r.error,r.edit,r.loading]);return e.jsxs(x,{sx:{display:"flex",gap:1.5,width:"100%",alignItems:{xs:"flex-start",md:"center"},flexDirection:{xs:"column",md:"row"}},children:[e.jsxs(Pe,{sx:{borderRadius:1,"&.Mui-disabled":{backgroundColor:"grey.50"}},disabled:!r.edit||r.loading,size:"small",value:r.type,onChange:c=>{r.type=c.target.value},children:[e.jsx(ie,{value:"api",children:p("userCenter.webhook.url")}),e.jsx(ie,{value:"slack",children:p("userCenter.webhook.slack")})]}),e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:.5,width:"100%"},children:[e.jsx(Qe,{sx:{flex:1,".MuiInputBase-root":{borderRadius:1,"&.Mui-disabled":{backgroundColor:"grey.50"}}},disabled:!r.edit||r.loading,fullWidth:!0,size:"small",required:!0,value:r.url,onChange:c=>{r.url=c.target.value,f()},error:!!r.error,slotProps:{input:{endAdornment:e.jsx(Je,{position:"end",children:v})}}}),e.jsx(x,{sx:{display:"flex",gap:.5},children:r.edit?e.jsxs(e.Fragment,{children:[e.jsx($,{color:"success",onClick:C((...c)=>{s(...c),r.edit=!1}),sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(O,{icon:cr})}),e.jsx($,{color:"error",onClick:h,sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(O,{icon:dr})})]}):e.jsxs(e.Fragment,{children:[e.jsx($,{onClick:()=>{r.edit=!0},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(O,{icon:Sr})}),e.jsx($,{color:"error",onClick:()=>{n({type:r.type,url:r.url})},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(O,{icon:kr})})]})})]})]})}ke.propTypes={onTest:u.func,onDelete:u.func,onSave:u.func,onCancel:u.func,type:u.oneOf(["api","slack"]),url:u.string,edit:u.bool};function se({title:t=void 0,description:n=void 0,value:s,onChange:o,isMobile:i}){const a=E(l=>{l.stopPropagation()});return e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(Se,{checked:s,size:"small",onChange:o}),e.jsxs(I,{component:"div",onClick:a,sx:{color:"text.primary",fontSize:14,display:"flex",flexWrap:i?"wrap":"nowrap",columnGap:1,flex:1,whiteSpace:i?"normal":"nowrap"},children:[t,n]})]})}se.propTypes={title:u.string,description:u.node,value:u.bool.isRequired,onChange:u.func.isRequired,isMobile:u.bool.isRequired};function ft({user:t,isMobile:n}){const{t:s}=W(),o=G({showAdd:!1}),i=ee(async()=>await U.user.getUserNotificationConfig(),{refreshDeps:[t],loadingDelay:300}),a=R(()=>({wallet:!0,email:!0,phone:!1,push:!0,...i?.data?.notifications||{}}),[i?.data?.notifications]),l=R(()=>i?.data?.webhooks||[],[i?.data?.webhooks]),p=E(async v=>{try{await U.user.saveUserNotificationConfig(v),q.success(s("userCenter.saveSuccess")),i.run()}catch(c){q.error(J(c))}}),r=E(async(v,c)=>{await p({notifications:{[v]:c}})}),f=async v=>{try{await U.user.testNotificationWebhook(v),q.success(s("userCenter.webhookTested"))}catch(c){q.error(J(c))}},h=E(async v=>{await p({webhooks:l.filter((c,g)=>g!==v)})}),m=E(async(v,c)=>{await p({webhooks:l.map((g,S)=>S===v?c:g)})}),C=E(async v=>{await p({webhooks:[...l,v]}),o.showAdd=!1});return i.error?e.jsx(Dt,{severity:"error",children:i.error.message}):i.loading||!i.data?e.jsx(x,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px"},children:e.jsx(Z,{})}):e.jsxs(x,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsxs(x,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"start",".MuiFormControlLabel-root":{gap:1,m:0,flexDirection:{xs:"row-reverse",md:"row"},width:{xs:"100%",md:"unset"}},".MuiSwitch-track":{borderRadius:"100vw"},".MuiSwitch-thumb":{borderRadius:"100%"},".MuiSwitch-root.MuiSwitch-sizeSmall":{height:"20px",width:"36px",".MuiSwitch-thumb":{width:"16px",height:"16px"}}},children:[e.jsx(se,{value:a.wallet,isMobile:n,title:s("userCenter.walletNotification"),onChange:v=>r("wallet",v.target.checked),description:Ne(t)&&e.jsx(ur,{did:Ne(t),showQrcode:!1,showAvatar:!n,copyable:!0,compact:!0,responsive:!0,startChars:n?2:6})}),e.jsx(se,{value:a.email,isMobile:n,onChange:v=>r("email",v.target.checked),title:s("userCenter.emailNotification"),description:t?.email&&e.jsx(I,{component:"span",sx:{color:"text.secondary",fontSize:13},children:t?.email})}),e.jsx(se,{isMobile:n,value:a.push,title:s("userCenter.pushNotification"),onChange:v=>r("push",v.target.checked)})]}),e.jsxs(Re,{spacing:1.5,useFlexGap:!0,direction:"column",sx:{alignItems:"start"},children:[l.map((v,c)=>e.jsx(ke,{onTest:f,onDelete:()=>h(c),onSave:(...g)=>m(c,...g),type:v.type,url:v.url,edit:!1},`${c}_${v.url}`)),o.showAdd&&e.jsx(ke,{onTest:f,onCancel:()=>{o.showAdd=!1},onSave:(...v)=>C(...v),edit:!0},"add"),e.jsx(nt,{variant:"outlined",size:"small",sx:{color:"text.primary",borderColor:"divider","&:hover":{borderColor:"divider"},py:.5,borderRadius:1},startIcon:e.jsx(O,{icon:Pr}),onClick:()=>{o.showAdd=!0},children:s("userCenter.addWebhook")})]})]})}ft.propTypes={user:u.object.isRequired,isMobile:u.bool.isRequired};function ht({item:t}){const n=Me(),{blocklet:s}=Xt(),{confirmApi:o,confirmHolder:i}=Te(),a=G({loading:!1}),{t:l}=W(),{session:p}=y.use(xe),{bindOAuth:r,unbindOAuth:f,setBaseUrl:h,baseUrl:m}=p.useOAuth(),{disconnectPasskey:C,setTargetAppPid:v}=p.usePasskey(),c=R(()=>pr[t?.provider]||"unknown",[t?.provider]),g=E(b=>b?._bind?b.provider===M.WALLET&&b.did?l("userCenter.thirdPartyLogin.walletAccountCantRemove"):b.provider===M.PASSKEY&&n.arcSphere?l("userCenter.thirdPartyLogin.dontSupportRemoveinArcSphere"):b._mainProvider&&n.arcSphere?l("userCenter.thirdPartyLogin.mainProviderCantRemove"):"":""),S=E(async()=>{if(t?.provider===M.PASSKEY){await new Promise((b,z)=>{o.open({title:l("userCenter.thirdPartyLogin.disconnectPasskey",{name:c}),content:l("userCenter.thirdPartyLogin.disconnectPasskeyDescription",{name:c}),confirmButtonText:l("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:l("common.cancel"),onConfirm(L){C({session:p,connectedAccount:t}).then(b).catch(z),L()},onCancel:b})});return}try{a.loading=!0,await new Promise((b,z)=>{if(t?._bind)o.open({title:l("userCenter.thirdPartyLogin.confirmUnbind",{name:c}),content:l("userCenter.thirdPartyLogin.confirmUnbindDescription",{name:c}),confirmButtonText:l("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:l("common.cancel"),onConfirm(L){f({session:p,connectedAccount:{...Yt(t,["did","pk"]),showProvider:t.provider,provider:t._rawProvider}}).then(b).catch(z),L()},onCancel:b});else if(t.provider===M.WALLET)p.bindWallet({onSuccess:b,onCancel:z});else{const L=m,F=window?.blocklet;let N="/";const j=xr(F),k=fr(F);j&&k?.appPid&&p?.user?.sourceAppPid&&(N=k.appUrl),h(N),v(s?.appPid),r({session:p,oauthItem:{...t,provider:t._rawProvider}}).then(b).catch(z).finally(()=>{h(L),v()})}})}catch(b){console.error(`Failed to ${t?._bind?"unbind":"bind"} oauth account`,b)}finally{a.loading=!1}}),T=E(b=>b.provider===M.WALLET&&b.did?l("userCenter.thirdPartyLogin.walletAccount"):b._mainProvider?l("userCenter.thirdPartyLogin.mainAccount"):b?._bind?l("userCenter.thirdPartyLogin.disconnect"):l("userCenter.thirdPartyLogin.connect")),P=E(b=>b.provider===M.WALLET&&b.did||b.provider===M.PASSKEY&&(n.arcSphere||n.wallet)?!0:!!t._mainProvider,[n.arcSphere]);return e.jsxs(e.Fragment,{children:[e.jsxs(x,{sx:{borderRadius:1,border:"1px solid",borderColor:"divider",backgroundColor:"grey.50",display:"flex",alignItems:"center",py:1,px:1.5,gap:.75,fontSize:"14px",lineHeight:1,overflow:"hidden"},children:[e.jsx(er,{provider:t?.provider,sx:{width:"1em",height:"1em",flexShrink:0,fontSize:16}}),e.jsx(x,{sx:{flex:1,display:{xs:t.userInfo?.email||t.did?"none":"block",sm:"block"}},children:c}),t.userInfo?.email||t.did?e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:.5,overflow:"hidden"},children:[e.jsx(x,{sx:{flex:1,textOverflow:"ellipsis",overflow:"hidden",lineHeight:"normal"},children:t.userInfo?.email||t.did}),t.userInfo?.name?e.jsx(qe,{title:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(ot,{size:36,variant:"circle",shape:"circle",src:t.userInfo?.picture,did:t.did}),e.jsxs(x,{children:[e.jsx(I,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:t.userInfo?.name}),e.jsx(I,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:t.userInfo?.email})]})]}),children:e.jsx(x,{component:O,icon:tr,sx:{color:"text.secondary",fontSize:16,cursor:"pointer",flexShrink:0}})}):null]}):null]}),e.jsx(qe,{title:g(t),placement:"auto",children:e.jsx(x,{children:e.jsx(nt,{variant:"outlined",size:"small",sx:b=>{const z=b.palette.error.main,L=b.palette.primary.main;return{color:t?._bind?z:L,borderColor:t?._bind?z:L,backgroundColor:"background.default","&:hover":{borderColor:t?._bind?z:L,backgroundColor:"action.hover"},py:.5,borderRadius:1,fontWeight:500,whiteSpace:"nowrap"}},fullWidth:!0,startIcon:a.loading?null:e.jsx(O,{icon:Rr}),onClick:S,disabled:P(t),loading:a.loading,children:T(t)})})}),i]})}ht.propTypes={item:u.shape({provider:u.string,did:u.string,pk:u.string,userInfo:u.object,id:u.string,_bind:u.bool,_rawProvider:u.string,_mainProvider:u.bool}).isRequired};function gt({user:t}){const{session:n}=y.use(xe),[s,o]=y.useState({}),{getOAuthConfigs:i}=n.useOAuth(),a=Me();ir(async()=>{const r=await i({sourceAppPid:t?.sourceAppPid});o(r)},[t?.sourceAppPid]);const l=R(()=>{const r=Object.keys(s).map(f=>({...s[f],provider:f})).filter(f=>f.enabled);return[{provider:M.WALLET,order:-1},...r,{provider:M.PASSKEY,order:1/0}]},[s]),p=R(()=>{const r=hr(t);let f=!1,h="",m=gr(t);const C=r.find(c=>c.provider===M.AUTH0);return C&&(C.id.startsWith("google-oauth2|")&&(r.some(c=>c.provider==="google")||(f=!0,h=M.GOOGLE,m===M.AUTH0&&(m=M.GOOGLE))),C.id.startsWith("appleid|")&&(r.some(c=>c.provider===M.APPLE)||(f=!0,h=M.APPLE,m===M.AUTH0&&(m=M.APPLE))),C.id.startsWith("github|")&&(r.some(c=>c.provider===M.GITHUB)||(f=!0,h=M.GITHUB,m===M.AUTH0&&(m=M.GITHUB)))),l.map(c=>{if(c.provider===M.AUTH0&&f)return null;const g=f&&c.provider===h?r.find(S=>S.provider===M.AUTH0):r.find(S=>S.provider===c.provider);return g?{...c,provider:c.provider,did:g.did,pk:g.pk,userInfo:g.userInfo,_bind:!0,_rawProvider:g.provider,_mainProvider:c.provider===m}:{...c,provider:c.provider,_rawProvider:c.provider,_mainProvider:c.provider===m}}).filter(c=>!(!c||c.provider===M.PASSKEY&&!c.did)).sort((c,g)=>c._mainProvider?-1:c?.order!==void 0&&g?.order!==void 0?c.order-g.order:c?.order!==void 0?-1:1)},[t?.connectedAccounts,l]);return e.jsxs(x,{sx:{gap:1,display:"grid",gridTemplateColumns:"1fr min-content"},children:[p.map(r=>e.jsx(ht,{item:r},r?.provider)),a.wallet||a.arcSphere?null:e.jsx(rr,{behavior:"only-new",action:"connect",createMode:"connect",createButtonText:"Add New Passkey",onSuccess:V,onError:V,dense:!0,sx:{px:1.5,py:1,gap:.75}})]})}gt.propTypes={user:u.object.isRequired};function mt({configList:t,onSave:n}){const[s,o]=y.useState(t),{t:i}=W(),a=E(async(l,p)=>{try{const r=await U.user.saveUserPrivacyConfig({[l]:typeof p=="string"?p:!p});o(s.map(f=>({...f,value:r?.[f.key]??f.value}))),q.success(i("userCenter.saveSuccess")),n("privacy")}catch(r){q.error(J(r))}});return y.useEffect(()=>{o(t)},[t]),e.jsx(x,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"start",".MuiFormControlLabel-root":{gap:1,m:0,flexDirection:{xs:"row-reverse",md:"row"},width:{xs:"100%",md:"unset"}},".MuiSwitch-track":{borderRadius:"100vw"},".MuiSwitch-thumb":{borderRadius:"100%"},".MuiSwitch-root.MuiSwitch-sizeSmall":{height:"20px",width:"36px",".MuiSwitch-thumb":{width:"16px",height:"16px"}}},children:s.map(l=>{if(l.isPrivate)return null;const p=!l.value||["all","follower-only"].includes(l.value);return e.jsxs(x,{children:[e.jsx(Se,{checked:p,labelProps:{label:e.jsx(I,{sx:{color:"text.primary",fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:i("userCenter.toPublic",{name:l.name})})},size:"small",onChange:r=>{const{checked:f}=r.target;l.followersOnly?a(l.key,f?"all":"private"):a(l.key,f)}},l.key),l.followersOnly&&p&&e.jsx(x,{sx:{pl:3,pt:1},children:e.jsx(Se,{checked:l.value==="follower-only",labelProps:{label:e.jsx(I,{sx:{color:"text.primary",fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:i("team.userFollowers.followersOnly")})},size:"small",onChange:r=>{const{checked:f}=r.target;a(l.key,f?"follower-only":"all")}})})]})})})}mt.propTypes={configList:u.arrayOf(u.shape({key:u.string.isRequired,name:u.string.isRequired,value:u.bool.isRequired,isPrivate:u.bool})).isRequired,onSave:u.func.isRequired};function bt({user:t,sessionUser:n}){const s=R(()=>(t?.passports||[])?.find(o=>o.name===n.role),[t?.passports,n?.role]);return e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(ot,{size:40,variant:"circle",shape:"circle",src:n.avatar,did:n.did,sx:{flexShrink:0}}),e.jsxs(x,{sx:{flex:1,overflow:"hidden"},children:[e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(Ce,{title:n.fullName,children:e.jsx(I,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flex:1},children:n.fullName})}),e.jsx(je,{label:s?.title||s?.name||"Guest",size:"small",variant:"outlined",sx:{flexShrink:0,fontWeight:"bold",fontSize:"12px",color:"text.primary",borderColor:"grey.300",backgroundColor:"transparent",textTransform:"capitalize",pr:.5,pl:0,height:"auto"}})]}),e.jsx(Ce,{title:n.email,children:e.jsx(I,{variant:"body2",color:"grey",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n.email})})]})]})}bt.propTypes={user:u.object.isRequired,sessionUser:u.shape({role:u.string,avatar:u.string,did:u.string,fullName:u.string,email:u.string}).isRequired};const un=()=>Promise.resolve(""),Ve=t=>new ve(t,{browser:[[/(ArcWallet)\/([\w\.]+)/i],[ve.BROWSER.NAME,ve.BROWSER.VERSION]]}).getResult(),Ze={display:"flex",justifyContent:"flex-end",textAlign:"right"},pn=new nr({concurrency:1}),ze=y.memo(({userSession:t,isMobile:n=!1})=>{const s=G({loading:!0,ipRegion:""}),{t:o}=W();y.useEffect(()=>{pn.add(async()=>{try{s.ipRegion=await un(t.lastLoginIp)}finally{s.loading=!1}})},[s,t.lastLoginIp]);const i=R(()=>n?{display:"flex",justifyContent:"flex-end"}:{},[n]);return e.jsx(x,{...n&&{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:1,flexWrap:"wrap"},children:s.ipRegion?e.jsxs(e.Fragment,{children:[e.jsx(I,{variant:"body2",children:s.ipRegion}),e.jsx(Ue,{size:16,className:"ip-address",style:i,children:t.lastLoginIp||o("userCenter.unknown")})]}):e.jsxs(e.Fragment,{children:[e.jsx(Ue,{size:16,className:"ip-address",style:i,children:t.lastLoginIp||o("userCenter.unknown")}),s.loading?e.jsx(I,{variant:"body2",color:"grey",sx:{textAlign:"center"},children:e.jsx(Z,{size:12,color:"inherit"})}):null]})})});ze.propTypes={userSession:u.object.isRequired,isMobile:u.bool};ze.defaultProps={isMobile:!1};function yt({user:t,showAction:n=!0,showUser:s=!0,getUserSessions:o,showOffline:i=!1}){const a=G({status:"online",page:1,pageSize:10}),l=G({online:0,expired:0,offline:0}),p=mr(),{t:r,locale:f}=W(),h=te({key:"md"}),m=pe(j=>j.breakpoints.down("lg")),{confirmApi:C,confirmHolder:v}=Te(),c=E(async()=>{const j=await o({page:a.page,pageSize:a.pageSize,status:a.status}),k=j?.paging?.total||0;return l[a.status]=k,{total:k,list:j?.list||[]}});et(async()=>{const j=await o({page:1,pageSize:1,status:"expired"});l.expired=j?.paging?.total||0;const k=await o({page:1,pageSize:1,status:"offline"});l.offline=k?.paging?.total||0});const g=ee(c,{refreshDeps:[a.status,a.page,a.pageSize]}),S=R(()=>g.data?.list||[],[g.data?.list]),T=R(()=>{const{status:j}=a;return j==="online"?l[j]<=1:l[j]===0},[S,p]),P=R(()=>ce({},h?Ze:{}),[h]),b=E(({visitorId:j})=>{C.open({title:r("userCenter.logoutThisSession"),content:r("userCenter.logoutThisSessionConfirm"),confirmButtonText:r("userCenter.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:r("userCenter.cancel"),onConfirm:async()=>{await U.user.logout({visitorId:j,includeFederated:!0});const{page:k=0}=a,{list:D=[]}=g.data||{},K=D.length||0;k>1&&K===1&&(a.page=Math.max(k-1,1)),g.refresh(),C.close()}})}),z=E(()=>{C.open({title:r("userCenter.logoutAllSession",{type:r(a.status)}),content:r("userCenter.logoutAllSessionConfirm",{type:r(a.status)}),confirmButtonText:r("userCenter.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:r("userCenter.cancel"),onConfirm:async()=>{await U.user.logout({status:a.status,visitorId:p,includeFederated:!0}),a.page=1,g.refresh(),C.close()}})}),L=[];n&&L.push(e.jsx(Ce,{title:r("userCenter.logoutAllTips",{type:r(a.status)}),children:e.jsx(H,{sx:{ml:.5},size:"small",variant:"contained",color:"error",onClick:z,disabled:T,children:r("userCenter.logoutAll",{type:r(a.status)})})},"logoutAll"));const F=R(()=>({search:!1,sort:!1,download:!1,filter:!1,print:!1,expandableRowsOnClick:!1,searchDebounceTime:600,page:a.page-1,rowsPerPage:a.pageSize,count:g.data?.total||0}),[g.data?.total,a.page,a.pageSize]),N=[{label:r("userCenter.platform"),name:"platform",options:{customBodyRenderLite:j=>{const k=S[j],D=Ve(k?.ua);return e.jsx(x,{sx:P,children:[D.os?.name,D.os?.version].filter(Boolean).join("/")||r("userCenter.unknown")})}}},{label:r("userCenter.deviceType"),name:"deviceType",options:{customBodyRenderLite:j=>{const k=S[j],D=Ve(k?.ua);return e.jsx(x,{sx:P,children:[D.browser?.name,D.browser?.version].filter(Boolean).join("/")||r("userCenter.unknown")})}}},{label:r("userCenter.walletOS"),name:"walletOS",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(x,{sx:P,children:k.extra?.walletOS?k.extra.walletOS.toUpperCase():r("userCenter.unknown")})}}},s&&{label:r("userCenter.user"),name:"user",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(x,{sx:ce({minWidth:150,maxWidth:250},h?Ze:{}),children:e.jsx(bt,{sessionUser:k.user,user:t})})}}},{label:r("userCenter.createdAt"),name:"createdAt",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(x,{sx:P,children:k.createdAt?e.jsx($e,{value:k.createdAt,relativeRange:3*86400*1e3}):r("userCenter.unknown")})}}},!i&&{label:r("userCenter.updatedAt"),name:"updatedAt",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(x,{sx:P,children:k.status==="expired"?r("userCenter.expired"):e.jsx($e,{value:k.updatedAt,relativeRange:3*86400*1e3})})}}},{label:r("userCenter.lastLoginIp"),name:"lastLoginIp",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(ze,{userSession:k,isMobile:h})}}},n&&{label:r("userCenter.actions"),name:"actions",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(x,{sx:P,children:e.jsx(H,{sx:{whiteSpace:"nowrap",fontSize:"12px !important",lineHeight:"1.25",px:1},disabled:p===k.visitorId,variant:"outlined",size:"small",color:"error",onClick:()=>b({visitorId:k.visitorId}),children:k.status==="expired"?r("userCenter.remove"):p===k.visitorId?r("userCenter.currentSession"):r("userCenter.logout")})})}}}].filter(Boolean);return e.jsxs(x,{className:"pc-user-sessions",sx:{maxWidth:h?"unset":m?"calc(100vw - 300px)":"100%",...h&&{".pc-user-sessions-table > div:nth-child(2)":{border:"1px solid",borderColor:"divider",borderRadius:1}},".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableRow-root":{border:"unset","&:nth-child(even)":{backgroundColor:"grey.50","&:hover":{backgroundColor:j=>`${j.palette.grey[50]} !important`}}},".MuiTableRow-hover":{"&:hover":{backgroundColor:"inherit !important"}},".MuiTableCell-root":{paddingRight:"8px",paddingLeft:"8px",color:"text.secondary",...h&&{padding:"8px !important","&:first-child":{paddingTop:"20px!important"},"&:last-child":{paddingBottom:"20px!important"}}}},children:[v,e.jsx(br,{count:g.data?.total||0,data:S,columns:N,customButtons:L,options:F,locale:f,loading:g.loading,className:"pc-user-sessions-table",title:e.jsxs(Nt,{row:!0,sx:{lineHeight:1,ml:1},onChange:j=>{a.status=j.target.value},children:[e.jsx(Q,{value:"online",control:e.jsx(ye,{size:"small",sx:{lineHeight:1,fontSize:0},checked:a.status==="online"}),label:e.jsxs(I,{sx:{display:"flex",alignItems:"center"},children:[r("userCenter.online"),e.jsxs(I,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",l.online,")"]})]})}),e.jsx(Q,{value:"expired",control:e.jsx(ye,{size:"small",sx:{lineHeight:1,fontSize:0},checked:a.status==="expired"}),label:e.jsxs(I,{sx:{display:"flex",alignItems:"center"},children:[r("userCenter.expired"),e.jsxs(I,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",l.expired,")"]})]})}),i?e.jsx(Q,{value:"offline",control:e.jsx(ye,{size:"small",sx:{lineHeight:1,fontSize:0},checked:a.status==="offline"}),label:e.jsxs(I,{sx:{display:"flex",alignItems:"center"},children:[r("userCenter.offline"),e.jsxs(I,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",l.offline,")"]})]})}):null]}),onChange:j=>{a.page=j.page+1,a.pageSize=j.rowsPerPage}})]})}yt.propTypes={user:u.object.isRequired,showAction:u.bool,showUser:u.bool,showOffline:u.bool,getUserSessions:u.func.isRequired};function vt({onDestroySelf:t=void 0}){const{confirmHolder:n}=Te(),{t:s}=W(),{session:o}=y.use(xe),i=E(async()=>{if(!t||typeof t!="function")return;const a=o.withSecondaryAuth(t,{extraParams:{removeUserDid:o?.user?.did,input:{user:{did:o?.user?.did},teamDid:window?.blocklet?.did}},operation:"destroySelf"});try{await a(),o.logout()}catch(l){q.error(l?.message||s("userCenter.destroyMyself.error"))}});return e.jsxs(e.Fragment,{children:[e.jsx(x,{children:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"space-between",flexWrap:"wrap"},children:[e.jsxs(x,{children:[e.jsx(I,{variant:"h6",sx:{fontSize:"0.875rem !important",fontWeight:"bold"},children:s("userCenter.dangerZone.deleteAccount")}),e.jsx(I,{variant:"caption",sx:{color:"text.secondary"},children:s("userCenter.dangerZone.deleteAccountDescription")})]}),e.jsx(H,{variant:"contained",color:"error",size:"small",onClick:i,children:s("userCenter.dangerZone.delete")})]})}),n]})}vt.propTypes={onDestroySelf:u.func};function xn(){const t=te({key:"md"}),n=pe(i=>i.breakpoints.down("lg")),s={display:"flex",justifyContent:"flex-end",flexWrap:"wrap",textAlign:"right","&.expired-at > div":{maxWidth:160,justifyContent:"flex-end",flexWrap:"wrap"}},o=R(()=>ce({},t?s:{}),[t]);return e.jsx(x,{id:"user-center-access-key-setting",sx:{maxWidth:t?"unset":n?"calc(100vw - 300px)":"100%",...t&&{".pc-access-key-table > div:nth-child(2)":{border:"1px solid",borderColor:"divider",borderRadius:1}},".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableRow-root":{border:"unset","&:nth-child(even)":{backgroundColor:"grey.50","&:hover":{backgroundColor:i=>`${i.palette.grey[50]} !important`}}},".MuiTableRow-hover":{"&:hover":{backgroundColor:"inherit !important"}},".MuiTableCell-root":{paddingRight:"8px",paddingLeft:"8px",color:"text.secondary",...t&&{padding:"8px !important","&:first-child":{paddingTop:"20px!important"},"&:last-child":{paddingBottom:"20px!important"}}}},children:e.jsx(Er,{isSelf:!0,columnSx:o})})}function wt({onDestroySelf:t=void 0,userCenterTabs:n=[]}){const{t:s}=W(),{user:o,session:i,isMyself:a,isOwner:l}=fe(),r=Me().arcSphere,f=te({key:"md"}),h=ee(async()=>o&&a?await U.user.getUserPrivacyConfig({did:o.did}):null,{refreshDeps:[o,a],loadingDelay:300}),m=R(()=>n.map(c=>({key:c.value,name:c.label,value:c.protected,isPrivate:c.isPrivate,followersOnly:c.followersOnly})),[n]),C=E(async c=>c==="privacy"?(await h.runAsync(),h.data):(c==="profile"&&await i.refresh(),null));y.useEffect(()=>{const c=window.location.hash.slice(1);c&&document.getElementById(c)?.scrollIntoView({behavior:"smooth"})},[]);const v=R(()=>[r?void 0:{label:s("userCenter.commonSetting.title"),value:"common",content:e.jsx(xt,{user:o,onSave:C})},{label:s("userCenter.notificationManagement"),value:"notification",content:e.jsx(ft,{user:o,isMobile:f})},{label:s("userCenter.thirdPartyLogin.title"),value:"thirdPartyLogin",content:e.jsx(gt,{user:o})},{label:s("common.accessKeys"),value:"accessKeys",content:e.jsx(xn,{isSelf:!0})},{label:s("common.mcpServers"),value:"mcpServers",content:e.jsx(zr,{})},{label:s("userCenter.privacyManagement"),value:"privacy",content:e.jsx(mt,{configList:m,onSave:C})},{label:s("userCenter.sessionManagement"),value:"session",content:e.jsx(yt,{user:o,showUser:!1,getUserSessions:c=>U.userSession.getMyLoginSessions({},c)})},!l&&t&&typeof t=="function"?{label:s("userCenter.dangerZone.title"),value:"dangerZone",content:e.jsx(vt,{onDestroySelf:t}),sx:{borderColor:"error.main"}}:null].filter(Boolean),[o,m,f,l,t]);return a?e.jsx(x,{className:"user-center-settings",sx:{display:"flex",flexDirection:"column",gap:2.5,minWidth:{md:500},"@media (min-width: 1200px) and (max-width: 1260px)":{maxWidth:750},"@media (min-width: 1100px) and (max-width: 1199px)":{maxWidth:650},"@media (min-width: 1000px) and (max-width: 1099px)":{maxWidth:600},"@media (max-width: 1049px)":{maxWidth:"100%"}},children:v.map(c=>c?e.jsxs(x,{id:c.value,sx:ce({border:"1px solid",borderColor:"divider",borderRadius:1,p:2,"&:last-child":{mb:5}},c.sx),children:[e.jsx(I,{sx:{color:"text.primary",fontWeight:600},children:c.label}),e.jsx(x,{sx:{mt:2.5},children:c.content})]},c.value):null)}):null}wt.propTypes={onDestroySelf:u.func,userCenterTabs:u.array};const jt=y.createContext({}),{Provider:fn,Consumer:Ro}=jt;function Ct({children:t}){const[n]=y.useState(!1),{session:s}=y.use(xe),{user:o}=s,[i,a]=y.useState(),l=y.useMemo(()=>o?.didSpace?.endpoint,[o?.didSpace]);y.useEffect(()=>{a(o?.didSpace)},[o?.didSpace]);const p=async()=>{a(void 0)},r=m=>{},f=async m=>{a(m),await r(m.endpoint)},h=!!(l&&i);return e.jsx(fn,{value:{loading:n,spaceGateway:i,session:s,deleteSpaceGateway:p,updateSpaceGateway:f,storageEndpoint:l,settingStorageEndpoint:r,hasStorageEndpoint:h},children:t})}function Ee(){return y.use(jt)}Ct.propTypes={children:u.node.isRequired};function hn(t){const n=t.replace(/\/api\/space\/.+/,""),o=t.replace(/\/$/,"").split("/").at(-4);return le(n,"space",o)}function St({session:t,spaceGateway:n,spaceStatus:s,refresh:o}){return e.jsxs(Re,{direction:"row",spacing:1,children:[s===Br.DISCONNECTED&&e.jsx(de,{reconnect:!0,variant:"outlined",session:t,spaceDid:t.user?.didSpace?.did,spaceGatewayUrl:t.user?.didSpace?.url,connectScope:"user",onSuccess:async()=>{await o()},onError:i=>{console.error(i),q.error(J(i))}}),e.jsx($,{size:"small",LinkComponent:$t,href:hn(n.endpoint),target:"_blank",children:e.jsx(Ut,{})})]})}St.propTypes={session:u.object.isRequired,spaceGateway:u.object.isRequired,spaceStatus:u.string.isRequired,refresh:u.func.isRequired};function kt({spaceGateway:t=void 0}){const{t:n}=W(),{updateSpaceGateway:s,session:o}=Ee(),i=te(),a=({spaceGateway:l})=>s(l);return e.jsxs(x,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(x,{sx:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:"12px"},children:[e.jsx(I,{sx:{fontSize:"16px",fontWeight:"bold"},children:n("userCenter.storage.spaces.connected.title")}),!i&&e.jsx(de,{connectScope:"user",connectText:n("userCenter.storage.spaces.connected.switch"),session:o,onSuccess:a})]}),e.jsx(x,{children:t&&e.jsx(Wr,{endpoint:t.endpoint,deps:[t],selected:!0,footer:!0,action:l=>e.jsx(St,{session:o,...l})},t.endpoint)}),i&&e.jsx(x,{sx:{display:"flex",alignItems:"center",justifyContent:"center",marginTop:2},children:e.jsx(de,{connectScope:"user",connectText:n("userCenter.storage.spaces.connected.switch"),session:o,onSuccess:a})})]})}kt.propTypes={spaceGateway:u.object};function gn(){const{t}=W(),{updateSpaceGateway:n,session:s}=Ee(),o=({spaceGateway:i})=>n(i);return e.jsxs(x,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(I,{sx:{fontSize:"16px",fontWeight:"bold"},children:t("userCenter.storage.spaces.connect.providerForStorage")}),e.jsx(Or,{viewBox:"0 0 228 258",style:{width:"156px",height:"156px",margin:"16px 0"}}),e.jsx(x,{children:e.jsx(de,{session:s,onSuccess:o})})]})}function mn(){const{spaceGateway:t,hasStorageEndpoint:n,loading:s}=Ee(),{isMyself:o}=fe();return o?s?e.jsx(Lr,{relative:"parent",children:e.jsx(Z,{})}):e.jsx(yn,{children:e.jsx(x,{sx:{maxWidth:"720px"},children:n?e.jsx(kt,{spaceGateway:t}):e.jsx(gn,{})})}):null}function bn(){return e.jsx(Ct,{children:e.jsx(mn,{})})}const yn=X(x)`
121
+ `,an=t=>({position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.6)",opacity:0,transition:"opacity 0.3s ease-in-out",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1,"& .mask-item":{backgroundColor:ae(t.palette.background.paper,.9),color:"text.primary","&:hover":{backgroundColor:ae(t.palette.background.paper,1)}}}),ln={position:"absolute",bottom:0,left:0,right:0,height:24,backgroundColor:"rgba(0, 0, 0, 0.6)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",gap:1,zIndex:1,"& .mask-item":{width:20,height:20,color:"white"}},Ye="https://main.abtnetwork.io/explorer";function pt({user:t}){const{t:n}=W(),s=te(),[o,i]=y.useState({visible:!1,nft:null}),[a,l]=y.useState({anchorEl:null,props:null}),p=P=>{const b=le(Ye,"assets",P);window.open(b,"_blank")},r=(P,b)=>{let z="";typeof b.data?.value=="string"?z=JSON.parse(b.data?.value)?.domain:z=b.data?.value?.domain,l({anchorEl:P,props:{title:z?`Hey, I just won an NFT at the ${z} event!`:"Hey, I just won an NFT!",url:le(Ye,"assets",b.address)}})},f=P=>{i({visible:!0,nft:P})},h=G({page:1,size:20}),m=ee(async(P=h)=>(await Kt.get(`${Ie.WELLKNOWN_SERVICE_PATH_PREFIX}/ocap/listAssets`,{params:{ownerAddress:t.did,...P}})).data,{ready:t?.did&&h,defaultParams:[h],refreshDeps:[t?.did,h]}),{loading:C,data:v}=m,c=v?.page??{cursor:0,next:!1,total:0},g=(P,b)=>{h.page=b,m.run(h)},S=E(P=>[e.jsx($,{size:"small",className:"mask-item",onClick:b=>{b.stopPropagation(),p(P.address)},children:e.jsx(O,{icon:"tabler:link",fontSize:18})},"link"),e.jsx($,{size:"small",onClick:b=>{b.stopPropagation(),r(b.currentTarget,P)},className:"mask-item",children:e.jsx(O,{icon:"tabler:share-2",fontSize:18})},"share"),e.jsx($,{size:"small",onClick:b=>{b.stopPropagation(),f(P)},className:"mask-item",children:e.jsx(O,{icon:"tabler:eye",fontSize:18})},"view")]),T=R(()=>{if(C){const P=["skeleton-1","skeleton-2","skeleton-3","skeleton-4","skeleton-5"].map(b=>e.jsx(Oe,{variant:"rectangular",width:"15%",height:166,sx:{borderRadius:1,flexShrink:0}},b));return e.jsxs(x,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsx(Oe,{width:"20%"}),e.jsx(x,{sx:{display:"flex",flexDirection:"row",gap:2,flexWrap:"nowrap"},children:P})]})}return e.jsxs(e.Fragment,{children:[e.jsx(I,{sx:{color:"grey.A700",fontWeight:600,mb:2.5},children:n("userCenter.common.nft")}),v?.assets?.length===0&&!C&&e.jsx(x,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},children:e.jsx(rt,{children:n("userCenter.common.noNFT")})}),e.jsx(x,{className:"nft-list-wrapper",sx:{display:"grid",justifyItems:"start",gridTemplateColumns:{xs:"repeat(2, 1fr)",sm:"repeat(3, 1fr)",md:"repeat(3, 1fr)",lg:"repeat(5, 1fr)"},gap:2.5},children:v?.assets?.map(P=>e.jsxs(x,{sx:{flexShrink:0,width:{xs:120,sm:120,md:120,lg:166},height:{xs:120,sm:120,md:120,lg:166},position:"relative",borderRadius:1,overflow:"hidden",cursor:"pointer",...s?{}:{"&:hover .mask":{opacity:1}}},children:[e.jsx(st,{data:it(P),address:P.address,inset:!0,imageFilter:{imageFilter:"resize",w:"500",f:"webp"}}),s?e.jsx(x,{className:"footer-mask",sx:ln,children:S(P)}):e.jsx(x,{className:"mask",sx:an,children:e.jsx(Re,{direction:"row",spacing:1,children:S(P)})})]},P.address))}),c.next||h.page>1?e.jsx(Ot,{sx:{display:"flex",justifyContent:"center",mt:2},page:h.page,onChange:g,count:Math.ceil(c.total/h.size),size:"small"}):null,e.jsx(nn,{visible:o.visible&&!!o.nft,nft:o.nft,onClose:()=>{i({visible:!1,nft:null})}}),e.jsx(lr,{anchorEl:a.anchorEl,onClose:()=>{l({anchorEl:null,props:null})},sharedProps:a.props||{title:"",url:""}})]})},[C,c,h.page,h.size,g,a,o]);return e.jsx(x,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2,mb:5},children:T})}pt.propTypes={user:u.object.isRequired};function cn(){const{t}=W(),{user:n,isMyself:s,viewUser:o}=fe();return e.jsxs(x,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[s?e.jsxs(x,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1.5,p:2},children:[e.jsx(I,{sx:{color:"text.primary",fontWeight:600,mb:2.5},children:t("userCenter.passport")}),e.jsx(ut,{user:n})]}):null,e.jsx(pt,{user:s?n:o})]})}const dn=[{name:"English",code:"en"},{name:"中文",code:"zh"}];function xt({user:t,onSave:n}){const{t:s,changeLocale:o}=W(),i=G({locale:t.locale,loading:!1}),a=E(async l=>{try{const{value:p}=l.target;i.loading=!0,await U.user.saveProfile({locale:p}),await n("profile"),o(p),i.locale=p}catch(p){q.error(J(p))}finally{i.loading=!1}});return e.jsxs(x,{sx:{gap:1,display:"grid",alignItems:"center",gridTemplateColumns:{xs:"1fr",sm:"max-content 1fr"}},children:[e.jsx(x,{children:s("userCenter.commonSetting.locale")}),e.jsx(x,{children:e.jsx(Pe,{value:i.locale,onChange:a,size:"small",IconComponent:l=>e.jsx(tt,{...l,width:20,height:20}),sx:{minWidth:200,"&:hover":{"fieldset.MuiOutlinedInput-notchedOutline":{borderColor:"divider"}},fieldset:{borderColor:"divider"}},children:(window.blocklet.languages||dn).map(l=>e.jsx(ie,{value:l.code,children:l.name},l.code))})})]})}xt.propTypes={user:u.shape({locale:u.string}).isRequired,onSave:u.func.isRequired};function ke({onTest:t=V,onDelete:n=V,onSave:s=V,onCancel:o=V,type:i="slack",url:a="",edit:l=!1}){const{t:p}=W(),r=G({type:i||"slack",url:a||"",edit:l??!1,error:"",loading:!1}),f=E(()=>r.url?Jt(r.url)?(r.error="",!0):(r.error=p("common.invalid"),!1):(r.error=p("common.required"),!1)),h=E(()=>{r.edit=!1,r.url=a||"",r.type=i||"slack",r.error="",r.loading=!1,o()}),m=E(async c=>{r.loading=!0,await t(c),r.loading=!1}),C=E(c=>()=>{f()&&c({type:r.type,url:r.url})}),v=R(()=>r.error?e.jsx(I,{component:"span",color:"error",children:r.error}):r.edit?r.loading?e.jsx(Z,{size:16}):e.jsx($,{size:"small",onClick:C(m),sx:{mr:-1},children:e.jsx(O,{icon:Cr})}):null,[r.error,r.edit,r.loading]);return e.jsxs(x,{sx:{display:"flex",gap:1.5,width:"100%",alignItems:{xs:"flex-start",md:"center"},flexDirection:{xs:"column",md:"row"}},children:[e.jsxs(Pe,{sx:{borderRadius:1,"&.Mui-disabled":{backgroundColor:"grey.50"}},disabled:!r.edit||r.loading,size:"small",value:r.type,onChange:c=>{r.type=c.target.value},children:[e.jsx(ie,{value:"api",children:p("userCenter.webhook.url")}),e.jsx(ie,{value:"slack",children:p("userCenter.webhook.slack")})]}),e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:.5,width:"100%"},children:[e.jsx(Qe,{sx:{flex:1,".MuiInputBase-root":{borderRadius:1,"&.Mui-disabled":{backgroundColor:"grey.50"}}},disabled:!r.edit||r.loading,fullWidth:!0,size:"small",required:!0,value:r.url,onChange:c=>{r.url=c.target.value,f()},error:!!r.error,slotProps:{input:{endAdornment:e.jsx(Je,{position:"end",children:v})}}}),e.jsx(x,{sx:{display:"flex",gap:.5},children:r.edit?e.jsxs(e.Fragment,{children:[e.jsx($,{color:"success",onClick:C((...c)=>{s(...c),r.edit=!1}),sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(O,{icon:cr})}),e.jsx($,{color:"error",onClick:h,sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(O,{icon:dr})})]}):e.jsxs(e.Fragment,{children:[e.jsx($,{onClick:()=>{r.edit=!0},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(O,{icon:Sr})}),e.jsx($,{color:"error",onClick:()=>{n({type:r.type,url:r.url})},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(O,{icon:kr})})]})})]})]})}ke.propTypes={onTest:u.func,onDelete:u.func,onSave:u.func,onCancel:u.func,type:u.oneOf(["api","slack"]),url:u.string,edit:u.bool};function se({title:t=void 0,description:n=void 0,value:s,onChange:o,isMobile:i}){const a=E(l=>{l.stopPropagation()});return e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(Se,{checked:s,size:"small",onChange:o}),e.jsxs(I,{component:"div",onClick:a,sx:{color:"text.primary",fontSize:14,display:"flex",flexWrap:i?"wrap":"nowrap",columnGap:1,flex:1,whiteSpace:i?"normal":"nowrap"},children:[t,n]})]})}se.propTypes={title:u.string,description:u.node,value:u.bool.isRequired,onChange:u.func.isRequired,isMobile:u.bool.isRequired};function ft({user:t,isMobile:n}){const{t:s}=W(),o=G({showAdd:!1}),i=ee(async()=>await U.user.getUserNotificationConfig(),{refreshDeps:[t],loadingDelay:300}),a=R(()=>({wallet:!0,email:!0,phone:!1,push:!0,...i?.data?.notifications||{}}),[i?.data?.notifications]),l=R(()=>i?.data?.webhooks||[],[i?.data?.webhooks]),p=E(async v=>{try{await U.user.saveUserNotificationConfig(v),q.success(s("userCenter.saveSuccess")),i.run()}catch(c){q.error(J(c))}}),r=E(async(v,c)=>{await p({notifications:{[v]:c}})}),f=async v=>{try{await U.user.testNotificationWebhook(v),q.success(s("userCenter.webhookTested"))}catch(c){q.error(J(c))}},h=E(async v=>{await p({webhooks:l.filter((c,g)=>g!==v)})}),m=E(async(v,c)=>{await p({webhooks:l.map((g,S)=>S===v?c:g)})}),C=E(async v=>{await p({webhooks:[...l,v]}),o.showAdd=!1});return i.error?e.jsx(Dt,{severity:"error",children:i.error.message}):i.loading||!i.data?e.jsx(x,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px"},children:e.jsx(Z,{})}):e.jsxs(x,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsxs(x,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"start",".MuiFormControlLabel-root":{gap:1,m:0,flexDirection:{xs:"row-reverse",md:"row"},width:{xs:"100%",md:"unset"}},".MuiSwitch-track":{borderRadius:"100vw"},".MuiSwitch-thumb":{borderRadius:"100%"},".MuiSwitch-root.MuiSwitch-sizeSmall":{height:"20px",width:"36px",".MuiSwitch-thumb":{width:"16px",height:"16px"}}},children:[e.jsx(se,{value:a.wallet,isMobile:n,title:s("userCenter.walletNotification"),onChange:v=>r("wallet",v.target.checked),description:Ne(t)&&e.jsx(ur,{did:Ne(t),showQrcode:!1,showAvatar:!n,copyable:!0,compact:!0,responsive:!0,startChars:n?2:6})}),e.jsx(se,{value:a.email,isMobile:n,onChange:v=>r("email",v.target.checked),title:s("userCenter.emailNotification"),description:t?.email&&e.jsx(I,{component:"span",sx:{color:"text.secondary",fontSize:13},children:t?.email})}),e.jsx(se,{isMobile:n,value:a.push,title:s("userCenter.pushNotification"),onChange:v=>r("push",v.target.checked)})]}),e.jsxs(Re,{spacing:1.5,useFlexGap:!0,direction:"column",sx:{alignItems:"start"},children:[l.map((v,c)=>e.jsx(ke,{onTest:f,onDelete:()=>h(c),onSave:(...g)=>m(c,...g),type:v.type,url:v.url,edit:!1},`${c}_${v.url}`)),o.showAdd&&e.jsx(ke,{onTest:f,onCancel:()=>{o.showAdd=!1},onSave:(...v)=>C(...v),edit:!0},"add"),e.jsx(nt,{variant:"outlined",size:"small",sx:{color:"text.primary",borderColor:"divider","&:hover":{borderColor:"divider"},py:.5,borderRadius:1},startIcon:e.jsx(O,{icon:Pr}),onClick:()=>{o.showAdd=!0},children:s("userCenter.addWebhook")})]})]})}ft.propTypes={user:u.object.isRequired,isMobile:u.bool.isRequired};function ht({item:t}){const n=Me(),{blocklet:s}=Xt(),{confirmApi:o,confirmHolder:i}=Te(),a=G({loading:!1}),{t:l}=W(),{session:p}=y.use(xe),{bindOAuth:r,unbindOAuth:f,setBaseUrl:h,baseUrl:m}=p.useOAuth(),{disconnectPasskey:C,setTargetAppPid:v}=p.usePasskey(),c=R(()=>pr[t?.provider]||"unknown",[t?.provider]),g=E(b=>b?._bind?b.provider===M.WALLET&&b.did?l("userCenter.thirdPartyLogin.walletAccountCantRemove"):b.provider===M.PASSKEY&&n.arcSphere?l("userCenter.thirdPartyLogin.dontSupportRemoveinArcSphere"):b._mainProvider&&n.arcSphere?l("userCenter.thirdPartyLogin.mainProviderCantRemove"):"":""),S=E(async()=>{if(t?.provider===M.PASSKEY){await new Promise((b,z)=>{o.open({title:l("userCenter.thirdPartyLogin.disconnectPasskey",{name:c}),content:l("userCenter.thirdPartyLogin.disconnectPasskeyDescription",{name:c}),confirmButtonText:l("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:l("common.cancel"),onConfirm(L){C({session:p,connectedAccount:t}).then(b).catch(z),L()},onCancel:b})});return}try{a.loading=!0,await new Promise((b,z)=>{if(t?._bind)o.open({title:l("userCenter.thirdPartyLogin.confirmUnbind",{name:c}),content:l("userCenter.thirdPartyLogin.confirmUnbindDescription",{name:c}),confirmButtonText:l("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:l("common.cancel"),onConfirm(L){f({session:p,connectedAccount:{...Yt(t,["did","pk"]),showProvider:t.provider,provider:t._rawProvider}}).then(b).catch(z),L()},onCancel:b});else if(t.provider===M.WALLET)p.bindWallet({onSuccess:b,onCancel:z});else{const L=m,F=window?.blocklet;let N="/";const j=xr(F),k=fr(F);j&&k?.appPid&&p?.user?.sourceAppPid&&(N=k.appUrl),h(N),v(s?.appPid),r({session:p,oauthItem:{...t,provider:t._rawProvider}}).then(b).catch(z).finally(()=>{h(L),v()})}})}catch(b){console.error(`Failed to ${t?._bind?"unbind":"bind"} oauth account`,b)}finally{a.loading=!1}}),T=E(b=>b.provider===M.WALLET&&b.did?l("userCenter.thirdPartyLogin.walletAccount"):b._mainProvider?l("userCenter.thirdPartyLogin.mainAccount"):b?._bind?l("userCenter.thirdPartyLogin.disconnect"):l("userCenter.thirdPartyLogin.connect")),P=E(b=>b.provider===M.WALLET&&b.did||b.provider===M.PASSKEY&&(n.arcSphere||n.wallet)?!0:!!t._mainProvider,[n.arcSphere]);return e.jsxs(e.Fragment,{children:[e.jsxs(x,{sx:{borderRadius:1,border:"1px solid",borderColor:"divider",backgroundColor:"grey.50",display:"flex",alignItems:"center",py:1,px:1.5,gap:.75,fontSize:"14px",lineHeight:1,overflow:"hidden"},children:[e.jsx(er,{provider:t?.provider,sx:{width:"1em",height:"1em",flexShrink:0,fontSize:16}}),e.jsx(x,{sx:{flex:1,display:{xs:t.userInfo?.email||t.did?"none":"block",sm:"block"}},children:c}),t.userInfo?.email||t.did?e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:.5,overflow:"hidden"},children:[e.jsx(x,{sx:{flex:1,textOverflow:"ellipsis",overflow:"hidden",lineHeight:"normal"},children:t.userInfo?.email||t.did}),t.userInfo?.name?e.jsx(qe,{title:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(ot,{size:36,variant:"circle",shape:"circle",src:t.userInfo?.picture,did:t.did}),e.jsxs(x,{children:[e.jsx(I,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:t.userInfo?.name}),e.jsx(I,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:t.userInfo?.email})]})]}),children:e.jsx(x,{component:O,icon:tr,sx:{color:"text.secondary",fontSize:16,cursor:"pointer",flexShrink:0}})}):null]}):null]}),e.jsx(qe,{title:g(t),placement:"auto",children:e.jsx(x,{children:e.jsx(nt,{variant:"outlined",size:"small",sx:b=>{const z=b.palette.error.main,L=b.palette.primary.main;return{color:t?._bind?z:L,borderColor:t?._bind?z:L,backgroundColor:"background.default","&:hover":{borderColor:t?._bind?z:L,backgroundColor:"action.hover"},py:.5,borderRadius:1,fontWeight:500,whiteSpace:"nowrap"}},fullWidth:!0,startIcon:a.loading?null:e.jsx(O,{icon:Rr}),onClick:S,disabled:P(t),loading:a.loading,children:T(t)})})}),i]})}ht.propTypes={item:u.shape({provider:u.string,did:u.string,pk:u.string,userInfo:u.object,id:u.string,_bind:u.bool,_rawProvider:u.string,_mainProvider:u.bool}).isRequired};function gt({user:t}){const{session:n}=y.use(xe),[s,o]=y.useState({}),{getOAuthConfigs:i}=n.useOAuth(),a=Me();ir(async()=>{const r=await i({sourceAppPid:t?.sourceAppPid});o(r)},[t?.sourceAppPid]);const l=R(()=>{const r=Object.keys(s).map(f=>({...s[f],provider:f})).filter(f=>f.enabled);return[{provider:M.WALLET,order:-1},...r,{provider:M.PASSKEY,order:1/0}]},[s]),p=R(()=>{const r=hr(t);let f=!1,h="",m=gr(t);const C=r.find(c=>c.provider===M.AUTH0);return C&&(C.id.startsWith("google-oauth2|")&&(r.some(c=>c.provider==="google")||(f=!0,h=M.GOOGLE,m===M.AUTH0&&(m=M.GOOGLE))),C.id.startsWith("appleid|")&&(r.some(c=>c.provider===M.APPLE)||(f=!0,h=M.APPLE,m===M.AUTH0&&(m=M.APPLE))),C.id.startsWith("github|")&&(r.some(c=>c.provider===M.GITHUB)||(f=!0,h=M.GITHUB,m===M.AUTH0&&(m=M.GITHUB)))),l.map(c=>{if(c.provider===M.AUTH0&&f)return null;const g=f&&c.provider===h?r.find(S=>S.provider===M.AUTH0):r.find(S=>S.provider===c.provider);return g?{...c,provider:c.provider,did:g.did,pk:g.pk,userInfo:g.userInfo,_bind:!0,_rawProvider:g.provider,_mainProvider:c.provider===m}:{...c,provider:c.provider,_rawProvider:c.provider,_mainProvider:c.provider===m}}).filter(c=>!(!c||c.provider===M.PASSKEY&&!c.did)).sort((c,g)=>c._mainProvider?-1:c?.order!==void 0&&g?.order!==void 0?c.order-g.order:c?.order!==void 0?-1:1)},[t?.connectedAccounts,l]);return e.jsxs(x,{sx:{gap:1,display:"grid",gridTemplateColumns:"1fr min-content"},children:[p.map(r=>e.jsx(ht,{item:r},r?.provider)),a.wallet||a.arcSphere?null:e.jsx(rr,{behavior:"only-new",action:"connect",createMode:"connect",createButtonText:"Add New Passkey",onSuccess:V,onError:V,dense:!0,sx:{px:1.5,py:1,gap:.75}})]})}gt.propTypes={user:u.object.isRequired};function mt({configList:t,onSave:n}){const[s,o]=y.useState(t),{t:i}=W(),a=E(async(l,p)=>{try{const r=await U.user.saveUserPrivacyConfig({[l]:typeof p=="string"?p:!p});o(s.map(f=>({...f,value:r?.[f.key]??f.value}))),q.success(i("userCenter.saveSuccess")),n("privacy")}catch(r){q.error(J(r))}});return y.useEffect(()=>{o(t)},[t]),e.jsx(x,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"start",".MuiFormControlLabel-root":{gap:1,m:0,flexDirection:{xs:"row-reverse",md:"row"},width:{xs:"100%",md:"unset"}},".MuiSwitch-track":{borderRadius:"100vw"},".MuiSwitch-thumb":{borderRadius:"100%"},".MuiSwitch-root.MuiSwitch-sizeSmall":{height:"20px",width:"36px",".MuiSwitch-thumb":{width:"16px",height:"16px"}}},children:s.map(l=>{if(l.isPrivate)return null;const p=!l.value||["all","follower-only"].includes(l.value);return e.jsxs(x,{children:[e.jsx(Se,{checked:p,labelProps:{label:e.jsx(I,{sx:{color:"text.primary",fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:i("userCenter.toPublic",{name:l.name})})},size:"small",onChange:r=>{const{checked:f}=r.target;l.followersOnly?a(l.key,f?"all":"private"):a(l.key,f)}},l.key),l.followersOnly&&p&&e.jsx(x,{sx:{pl:3,pt:1},children:e.jsx(Se,{checked:l.value==="follower-only",labelProps:{label:e.jsx(I,{sx:{color:"text.primary",fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:i("team.userFollowers.followersOnly")})},size:"small",onChange:r=>{const{checked:f}=r.target;a(l.key,f?"follower-only":"all")}})})]})})})}mt.propTypes={configList:u.arrayOf(u.shape({key:u.string.isRequired,name:u.string.isRequired,value:u.bool.isRequired,isPrivate:u.bool})).isRequired,onSave:u.func.isRequired};function bt({user:t,sessionUser:n}){const s=R(()=>(t?.passports||[])?.find(o=>o.name===n.role),[t?.passports,n?.role]);return e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(ot,{size:40,variant:"circle",shape:"circle",src:n.avatar,did:n.did,sx:{flexShrink:0}}),e.jsxs(x,{sx:{flex:1,overflow:"hidden"},children:[e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(Ce,{title:n.fullName,children:e.jsx(I,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flex:1},children:n.fullName})}),e.jsx(je,{label:s?.title||s?.name||"Guest",size:"small",variant:"outlined",sx:{flexShrink:0,fontWeight:"bold",fontSize:"12px",color:"text.primary",borderColor:"grey.300",backgroundColor:"transparent",textTransform:"capitalize",pr:.5,pl:0,height:"auto"}})]}),e.jsx(Ce,{title:n.email,children:e.jsx(I,{variant:"body2",color:"grey",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n.email})})]})]})}bt.propTypes={user:u.object.isRequired,sessionUser:u.shape({role:u.string,avatar:u.string,did:u.string,fullName:u.string,email:u.string}).isRequired};const un=()=>Promise.resolve(""),Ve=t=>new ve(t,{browser:[[/(ArcWallet)\/([\w\.]+)/i],[ve.BROWSER.NAME,ve.BROWSER.VERSION]]}).getResult(),Ze={display:"flex",justifyContent:"flex-end",textAlign:"right"},pn=new nr({concurrency:1}),ze=y.memo(({userSession:t,isMobile:n=!1})=>{const s=G({loading:!0,ipRegion:""}),{t:o,locale:i}=W();y.useEffect(()=>{pn.add(async()=>{try{s.ipRegion=await un(t.lastLoginIp)}finally{s.loading=!1}})},[s,t.lastLoginIp]);const a=R(()=>n?{display:"flex",justifyContent:"flex-end"}:{},[n]);return e.jsx(x,{...n&&{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:1,flexWrap:"wrap"},children:s.ipRegion?e.jsxs(e.Fragment,{children:[e.jsx(I,{variant:"body2",children:s.ipRegion}),e.jsx(Ue,{size:16,className:"ip-address",style:a,locale:i,children:t.lastLoginIp||o("userCenter.unknown")})]}):e.jsxs(e.Fragment,{children:[e.jsx(Ue,{size:16,className:"ip-address",style:a,locale:i,children:t.lastLoginIp||o("userCenter.unknown")}),s.loading?e.jsx(I,{variant:"body2",color:"grey",sx:{textAlign:"center"},children:e.jsx(Z,{size:12,color:"inherit"})}):null]})})});ze.propTypes={userSession:u.object.isRequired,isMobile:u.bool};ze.defaultProps={isMobile:!1};function yt({user:t,showAction:n=!0,showUser:s=!0,getUserSessions:o,showOffline:i=!1}){const a=G({status:"online",page:1,pageSize:10}),l=G({online:0,expired:0,offline:0}),p=mr(),{t:r,locale:f}=W(),h=te({key:"md"}),m=pe(j=>j.breakpoints.down("lg")),{confirmApi:C,confirmHolder:v}=Te(),c=E(async()=>{const j=await o({page:a.page,pageSize:a.pageSize,status:a.status}),k=j?.paging?.total||0;return l[a.status]=k,{total:k,list:j?.list||[]}});et(async()=>{const j=await o({page:1,pageSize:1,status:"expired"});l.expired=j?.paging?.total||0;const k=await o({page:1,pageSize:1,status:"offline"});l.offline=k?.paging?.total||0});const g=ee(c,{refreshDeps:[a.status,a.page,a.pageSize]}),S=R(()=>g.data?.list||[],[g.data?.list]),T=R(()=>{const{status:j}=a;return j==="online"?l[j]<=1:l[j]===0},[S,p]),P=R(()=>ce({},h?Ze:{}),[h]),b=E(({visitorId:j})=>{C.open({title:r("userCenter.logoutThisSession"),content:r("userCenter.logoutThisSessionConfirm"),confirmButtonText:r("userCenter.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:r("userCenter.cancel"),onConfirm:async()=>{await U.user.logout({visitorId:j,includeFederated:!0});const{page:k=0}=a,{list:D=[]}=g.data||{},K=D.length||0;k>1&&K===1&&(a.page=Math.max(k-1,1)),g.refresh(),C.close()}})}),z=E(()=>{C.open({title:r("userCenter.logoutAllSession",{type:r(a.status)}),content:r("userCenter.logoutAllSessionConfirm",{type:r(a.status)}),confirmButtonText:r("userCenter.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:r("userCenter.cancel"),onConfirm:async()=>{await U.user.logout({status:a.status,visitorId:p,includeFederated:!0}),a.page=1,g.refresh(),C.close()}})}),L=[];n&&L.push(e.jsx(Ce,{title:r("userCenter.logoutAllTips",{type:r(a.status)}),children:e.jsx(H,{sx:{ml:.5},size:"small",variant:"contained",color:"error",onClick:z,disabled:T,children:r("userCenter.logoutAll",{type:r(a.status)})})},"logoutAll"));const F=R(()=>({search:!1,sort:!1,download:!1,filter:!1,print:!1,expandableRowsOnClick:!1,searchDebounceTime:600,page:a.page-1,rowsPerPage:a.pageSize,count:g.data?.total||0}),[g.data?.total,a.page,a.pageSize]),N=[{label:r("userCenter.platform"),name:"platform",options:{customBodyRenderLite:j=>{const k=S[j],D=Ve(k?.ua);return e.jsx(x,{sx:P,children:[D.os?.name,D.os?.version].filter(Boolean).join("/")||r("userCenter.unknown")})}}},{label:r("userCenter.deviceType"),name:"deviceType",options:{customBodyRenderLite:j=>{const k=S[j],D=Ve(k?.ua);return e.jsx(x,{sx:P,children:[D.browser?.name,D.browser?.version].filter(Boolean).join("/")||r("userCenter.unknown")})}}},{label:r("userCenter.walletOS"),name:"walletOS",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(x,{sx:P,children:k.extra?.walletOS?k.extra.walletOS.toUpperCase():r("userCenter.unknown")})}}},s&&{label:r("userCenter.user"),name:"user",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(x,{sx:ce({minWidth:150,maxWidth:250},h?Ze:{}),children:e.jsx(bt,{sessionUser:k.user,user:t})})}}},{label:r("userCenter.createdAt"),name:"createdAt",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(x,{sx:P,children:k.createdAt?e.jsx($e,{value:k.createdAt,relativeRange:3*86400*1e3}):r("userCenter.unknown")})}}},!i&&{label:r("userCenter.updatedAt"),name:"updatedAt",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(x,{sx:P,children:k.status==="expired"?r("userCenter.expired"):e.jsx($e,{value:k.updatedAt,relativeRange:3*86400*1e3})})}}},{label:r("userCenter.lastLoginIp"),name:"lastLoginIp",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(ze,{userSession:k,isMobile:h})}}},n&&{label:r("userCenter.actions"),name:"actions",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(x,{sx:P,children:e.jsx(H,{sx:{whiteSpace:"nowrap",fontSize:"12px !important",lineHeight:"1.25",px:1},disabled:p===k.visitorId,variant:"outlined",size:"small",color:"error",onClick:()=>b({visitorId:k.visitorId}),children:k.status==="expired"?r("userCenter.remove"):p===k.visitorId?r("userCenter.currentSession"):r("userCenter.logout")})})}}}].filter(Boolean);return e.jsxs(x,{className:"pc-user-sessions",sx:{maxWidth:h?"unset":m?"calc(100vw - 300px)":"100%",...h&&{".pc-user-sessions-table > div:nth-child(2)":{border:"1px solid",borderColor:"divider",borderRadius:1}},".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableRow-root":{border:"unset","&:nth-child(even)":{backgroundColor:"grey.50","&:hover":{backgroundColor:j=>`${j.palette.grey[50]} !important`}}},".MuiTableRow-hover":{"&:hover":{backgroundColor:"inherit !important"}},".MuiTableCell-root":{paddingRight:"8px",paddingLeft:"8px",color:"text.secondary",...h&&{padding:"8px !important","&:first-child":{paddingTop:"20px!important"},"&:last-child":{paddingBottom:"20px!important"}}}},children:[v,e.jsx(br,{count:g.data?.total||0,data:S,columns:N,customButtons:L,options:F,locale:f,loading:g.loading,className:"pc-user-sessions-table",title:e.jsxs(Nt,{row:!0,sx:{lineHeight:1,ml:1},onChange:j=>{a.status=j.target.value},children:[e.jsx(Q,{value:"online",control:e.jsx(ye,{size:"small",sx:{lineHeight:1,fontSize:0},checked:a.status==="online"}),label:e.jsxs(I,{sx:{display:"flex",alignItems:"center"},children:[r("userCenter.online"),e.jsxs(I,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",l.online,")"]})]})}),e.jsx(Q,{value:"expired",control:e.jsx(ye,{size:"small",sx:{lineHeight:1,fontSize:0},checked:a.status==="expired"}),label:e.jsxs(I,{sx:{display:"flex",alignItems:"center"},children:[r("userCenter.expired"),e.jsxs(I,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",l.expired,")"]})]})}),i?e.jsx(Q,{value:"offline",control:e.jsx(ye,{size:"small",sx:{lineHeight:1,fontSize:0},checked:a.status==="offline"}),label:e.jsxs(I,{sx:{display:"flex",alignItems:"center"},children:[r("userCenter.offline"),e.jsxs(I,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",l.offline,")"]})]})}):null]}),onChange:j=>{a.page=j.page+1,a.pageSize=j.rowsPerPage}})]})}yt.propTypes={user:u.object.isRequired,showAction:u.bool,showUser:u.bool,showOffline:u.bool,getUserSessions:u.func.isRequired};function vt({onDestroySelf:t=void 0}){const{confirmHolder:n}=Te(),{t:s}=W(),{session:o}=y.use(xe),i=E(async()=>{if(!t||typeof t!="function")return;const a=o.withSecondaryAuth(t,{extraParams:{removeUserDid:o?.user?.did,input:{user:{did:o?.user?.did},teamDid:window?.blocklet?.did}},operation:"destroySelf"});try{await a(),o.logout()}catch(l){q.error(l?.message||s("userCenter.destroyMyself.error"))}});return e.jsxs(e.Fragment,{children:[e.jsx(x,{children:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"space-between",flexWrap:"wrap"},children:[e.jsxs(x,{children:[e.jsx(I,{variant:"h6",sx:{fontSize:"0.875rem !important",fontWeight:"bold"},children:s("userCenter.dangerZone.deleteAccount")}),e.jsx(I,{variant:"caption",sx:{color:"text.secondary"},children:s("userCenter.dangerZone.deleteAccountDescription")})]}),e.jsx(H,{variant:"contained",color:"error",size:"small",onClick:i,children:s("userCenter.dangerZone.delete")})]})}),n]})}vt.propTypes={onDestroySelf:u.func};function xn(){const t=te({key:"md"}),n=pe(i=>i.breakpoints.down("lg")),s={display:"flex",justifyContent:"flex-end",flexWrap:"wrap",textAlign:"right","&.expired-at > div":{maxWidth:160,justifyContent:"flex-end",flexWrap:"wrap"}},o=R(()=>ce({},t?s:{}),[t]);return e.jsx(x,{id:"user-center-access-key-setting",sx:{maxWidth:t?"unset":n?"calc(100vw - 300px)":"100%",...t&&{".pc-access-key-table > div:nth-child(2)":{border:"1px solid",borderColor:"divider",borderRadius:1}},".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableRow-root":{border:"unset","&:nth-child(even)":{backgroundColor:"grey.50","&:hover":{backgroundColor:i=>`${i.palette.grey[50]} !important`}}},".MuiTableRow-hover":{"&:hover":{backgroundColor:"inherit !important"}},".MuiTableCell-root":{paddingRight:"8px",paddingLeft:"8px",color:"text.secondary",...t&&{padding:"8px !important","&:first-child":{paddingTop:"20px!important"},"&:last-child":{paddingBottom:"20px!important"}}}},children:e.jsx(Er,{isSelf:!0,columnSx:o})})}function wt({onDestroySelf:t=void 0,userCenterTabs:n=[]}){const{t:s}=W(),{user:o,session:i,isMyself:a,isOwner:l}=fe(),r=Me().arcSphere,f=te({key:"md"}),h=ee(async()=>o&&a?await U.user.getUserPrivacyConfig({did:o.did}):null,{refreshDeps:[o,a],loadingDelay:300}),m=R(()=>n.map(c=>({key:c.value,name:c.label,value:c.protected,isPrivate:c.isPrivate,followersOnly:c.followersOnly})),[n]),C=E(async c=>c==="privacy"?(await h.runAsync(),h.data):(c==="profile"&&await i.refresh(),null));y.useEffect(()=>{const c=window.location.hash.slice(1);c&&document.getElementById(c)?.scrollIntoView({behavior:"smooth"})},[]);const v=R(()=>[r?void 0:{label:s("userCenter.commonSetting.title"),value:"common",content:e.jsx(xt,{user:o,onSave:C})},{label:s("userCenter.notificationManagement"),value:"notification",content:e.jsx(ft,{user:o,isMobile:f})},{label:s("userCenter.thirdPartyLogin.title"),value:"thirdPartyLogin",content:e.jsx(gt,{user:o})},{label:s("common.accessKeys"),value:"accessKeys",content:e.jsx(xn,{isSelf:!0})},{label:s("common.mcpServers"),value:"mcpServers",content:e.jsx(zr,{})},{label:s("userCenter.privacyManagement"),value:"privacy",content:e.jsx(mt,{configList:m,onSave:C})},{label:s("userCenter.sessionManagement"),value:"session",content:e.jsx(yt,{user:o,showUser:!1,getUserSessions:c=>U.userSession.getMyLoginSessions({},c)})},!l&&t&&typeof t=="function"?{label:s("userCenter.dangerZone.title"),value:"dangerZone",content:e.jsx(vt,{onDestroySelf:t}),sx:{borderColor:"error.main"}}:null].filter(Boolean),[o,m,f,l,t]);return a?e.jsx(x,{className:"user-center-settings",sx:{display:"flex",flexDirection:"column",gap:2.5,minWidth:{md:500},"@media (min-width: 1200px) and (max-width: 1260px)":{maxWidth:750},"@media (min-width: 1100px) and (max-width: 1199px)":{maxWidth:650},"@media (min-width: 1000px) and (max-width: 1099px)":{maxWidth:600},"@media (max-width: 1049px)":{maxWidth:"100%"}},children:v.map(c=>c?e.jsxs(x,{id:c.value,sx:ce({border:"1px solid",borderColor:"divider",borderRadius:1,p:2,"&:last-child":{mb:5}},c.sx),children:[e.jsx(I,{sx:{color:"text.primary",fontWeight:600},children:c.label}),e.jsx(x,{sx:{mt:2.5},children:c.content})]},c.value):null)}):null}wt.propTypes={onDestroySelf:u.func,userCenterTabs:u.array};const jt=y.createContext({}),{Provider:fn,Consumer:Ro}=jt;function Ct({children:t}){const[n]=y.useState(!1),{session:s}=y.use(xe),{user:o}=s,[i,a]=y.useState(),l=y.useMemo(()=>o?.didSpace?.endpoint,[o?.didSpace]);y.useEffect(()=>{a(o?.didSpace)},[o?.didSpace]);const p=async()=>{a(void 0)},r=m=>{},f=async m=>{a(m),await r(m.endpoint)},h=!!(l&&i);return e.jsx(fn,{value:{loading:n,spaceGateway:i,session:s,deleteSpaceGateway:p,updateSpaceGateway:f,storageEndpoint:l,settingStorageEndpoint:r,hasStorageEndpoint:h},children:t})}function Ee(){return y.use(jt)}Ct.propTypes={children:u.node.isRequired};function hn(t){const n=t.replace(/\/api\/space\/.+/,""),o=t.replace(/\/$/,"").split("/").at(-4);return le(n,"space",o)}function St({session:t,spaceGateway:n,spaceStatus:s,refresh:o}){return e.jsxs(Re,{direction:"row",spacing:1,children:[s===Br.DISCONNECTED&&e.jsx(de,{reconnect:!0,variant:"outlined",session:t,spaceDid:t.user?.didSpace?.did,spaceGatewayUrl:t.user?.didSpace?.url,connectScope:"user",onSuccess:async()=>{await o()},onError:i=>{console.error(i),q.error(J(i))}}),e.jsx($,{size:"small",LinkComponent:$t,href:hn(n.endpoint),target:"_blank",children:e.jsx(Ut,{})})]})}St.propTypes={session:u.object.isRequired,spaceGateway:u.object.isRequired,spaceStatus:u.string.isRequired,refresh:u.func.isRequired};function kt({spaceGateway:t=void 0}){const{t:n}=W(),{updateSpaceGateway:s,session:o}=Ee(),i=te(),a=({spaceGateway:l})=>s(l);return e.jsxs(x,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(x,{sx:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:"12px"},children:[e.jsx(I,{sx:{fontSize:"16px",fontWeight:"bold"},children:n("userCenter.storage.spaces.connected.title")}),!i&&e.jsx(de,{connectScope:"user",connectText:n("userCenter.storage.spaces.connected.switch"),session:o,onSuccess:a})]}),e.jsx(x,{children:t&&e.jsx(Wr,{endpoint:t.endpoint,deps:[t],selected:!0,footer:!0,action:l=>e.jsx(St,{session:o,...l})},t.endpoint)}),i&&e.jsx(x,{sx:{display:"flex",alignItems:"center",justifyContent:"center",marginTop:2},children:e.jsx(de,{connectScope:"user",connectText:n("userCenter.storage.spaces.connected.switch"),session:o,onSuccess:a})})]})}kt.propTypes={spaceGateway:u.object};function gn(){const{t}=W(),{updateSpaceGateway:n,session:s}=Ee(),o=({spaceGateway:i})=>n(i);return e.jsxs(x,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(I,{sx:{fontSize:"16px",fontWeight:"bold"},children:t("userCenter.storage.spaces.connect.providerForStorage")}),e.jsx(Or,{viewBox:"0 0 228 258",style:{width:"156px",height:"156px",margin:"16px 0"}}),e.jsx(x,{children:e.jsx(de,{session:s,onSuccess:o})})]})}function mn(){const{spaceGateway:t,hasStorageEndpoint:n,loading:s}=Ee(),{isMyself:o}=fe();return o?s?e.jsx(Lr,{relative:"parent",children:e.jsx(Z,{})}):e.jsx(yn,{children:e.jsx(x,{sx:{maxWidth:"720px"},children:n?e.jsx(kt,{spaceGateway:t}):e.jsx(gn,{})})}):null}function bn(){return e.jsx(Ct,{children:e.jsx(mn,{})})}const yn=X(x)`
122
122
  height: 100%;
123
123
  overflow-y: auto;
124
124
  `;function vn(){const{user:t,isMyself:n,viewUser:s}=fe(),{followed:o}=Ir();return e.jsx(x,{children:e.jsx(Dr,{teamDid:window?.blocklet?.did||"",user:n?t:s,showInvitees:n,followed:o})})}function wn({tab:t=""}){const{api:n}=or(),s=y.useRef(null),o=qt(),i=t||o.tab,l=new URLSearchParams(window.location.search).get("embed")||window.sessionStorage?.getItem("embed"),p=sr(),r=R(()=>({...window.blocklet,meta:{did:window.blocklet.did,name:window.blocklet.did},children:window?.blocklet?.componentMountPoints.map(h=>({...h,meta:{...h,did:h.did,name:h.name||h.title||"",logo:"logo.png"}}))})),f=async h=>{const{input:m,sessionId:C}=h;try{await n.destroySelf({input:{...m,sessionId:C}})}catch(v){console.error("destroy myself error",v)}};return e.jsx(wr,{mode:"user-center",children:e.jsxs(Tr,{ref:s,embed:l==="1",currentTab:i?le(Ie.WELLKNOWN_SERVICE_PATH_PREFIX,"user",i):"",disableAutoRedirect:i==="settings",children:[i==="notifications"?e.jsx(rn,{blocklets:[r],context:p}):null,i==="nfts"?e.jsx(cn,{}):null,i==="settings"?e.jsx(wt,{onDestroySelf:f}):null,i==="did-spaces"?e.jsx(bn,{}):null,i==="user-followers"?e.jsx(vn,{}):null,i==="orgs"?e.jsx(Ar,{id:o.id||""}):null]})})}wn.propTypes={tab:u.string};export{wn as default};
@@ -1,4 +1,4 @@
1
- import{B as qr}from"./vendor-utils-CUDP56Ff.js";import{p as ae}from"./vendor-react-Dvs43sk9.js";import{ag as Se,ah as jr,ai as xr,aj as Nr,ak as _r,al as Kr,am as Sr,an as Tr,ao as ke,ap as Ur,aq as Br,ar as Dr,as as Mr,a6 as Lr,r as Cr}from"./vendor-ux-CDOuCaX1.js";import{bf as Or,az as Vr}from"./index-DsZw1jDU.js";var Pe={exports:{}},Re={},Je;function Ar(){if(Je)return Re;Je=1;function h(u){"@babel/helpers - typeof";return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},h(u)}function g(u,p,S){return Object.defineProperty(u,"prototype",{writable:!1}),u}function s(u,p){if(!(u instanceof p))throw new TypeError("Cannot call a class as a function")}function b(u,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function");u.prototype=Object.create(p&&p.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),Object.defineProperty(u,"prototype",{writable:!1}),p&&_(u,p)}function _(u,p){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(N,B){return N.__proto__=B,N},_(u,p)}function L(u){var p=n();return function(){var N=e(u),B;if(p){var K=e(this).constructor;B=Reflect.construct(N,arguments,K)}else B=N.apply(this,arguments);return E(this,B)}}function E(u,p){if(p&&(h(p)==="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return f(u)}function f(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function n(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(u){return e=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(S){return S.__proto__||Object.getPrototypeOf(S)},e(u)}var r={},d,y;function l(u,p,S){S||(S=Error);function N(K,H,V){return typeof p=="string"?p:p(K,H,V)}var B=function(K){b(V,K);var H=L(V);function V(W,te,Z){var J;return s(this,V),J=H.call(this,N(W,te,Z)),J.code=u,J}return g(V)}(S);r[u]=B}function q(u,p){if(Array.isArray(u)){var S=u.length;return u=u.map(function(N){return String(N)}),S>2?"one of ".concat(p," ").concat(u.slice(0,S-1).join(", "),", or ")+u[S-1]:S===2?"one of ".concat(p," ").concat(u[0]," or ").concat(u[1]):"of ".concat(p," ").concat(u[0])}else return"of ".concat(p," ").concat(String(u))}function O(u,p,S){return u.substr(0,p.length)===p}function A(u,p,S){return(S===void 0||S>u.length)&&(S=u.length),u.substring(S-p.length,S)===p}function j(u,p,S){return typeof S!="number"&&(S=0),S+p.length>u.length?!1:u.indexOf(p,S)!==-1}return l("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),l("ERR_INVALID_ARG_TYPE",function(u,p,S){d===void 0&&(d=We()),d(typeof u=="string","'name' must be a string");var N;typeof p=="string"&&O(p,"not ")?(N="must not be",p=p.replace(/^not /,"")):N="must be";var B;if(A(u," argument"))B="The ".concat(u," ").concat(N," ").concat(q(p,"type"));else{var K=j(u,".")?"property":"argument";B='The "'.concat(u,'" ').concat(K," ").concat(N," ").concat(q(p,"type"))}return B+=". Received type ".concat(h(S)),B},TypeError),l("ERR_INVALID_ARG_VALUE",function(u,p){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";y===void 0&&(y=Se());var N=y.inspect(p);return N.length>128&&(N="".concat(N.slice(0,128),"...")),"The argument '".concat(u,"' ").concat(S,". Received ").concat(N)},TypeError),l("ERR_INVALID_RETURN_VALUE",function(u,p,S){var N;return S&&S.constructor&&S.constructor.name?N="instance of ".concat(S.constructor.name):N="type ".concat(h(S)),"Expected ".concat(u,' to be returned from the "').concat(p,'"')+" function but got ".concat(N,".")},TypeError),l("ERR_MISSING_ARGS",function(){for(var u=arguments.length,p=new Array(u),S=0;S<u;S++)p[S]=arguments[S];d===void 0&&(d=We()),d(p.length>0,"At least one arg needs to be specified");var N="The ",B=p.length;switch(p=p.map(function(K){return'"'.concat(K,'"')}),B){case 1:N+="".concat(p[0]," argument");break;case 2:N+="".concat(p[0]," and ").concat(p[1]," arguments");break;default:N+=p.slice(0,B-1).join(", "),N+=", and ".concat(p[B-1]," arguments");break}return"".concat(N," must be specified")},TypeError),Re.codes=r,Re}var Ie,Qe;function Fr(){if(Qe)return Ie;Qe=1;function h(v,m){var U=Object.keys(v);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(v);m&&(x=x.filter(function(C){return Object.getOwnPropertyDescriptor(v,C).enumerable})),U.push.apply(U,x)}return U}function g(v){for(var m=1;m<arguments.length;m++){var U=arguments[m]!=null?arguments[m]:{};m%2?h(Object(U),!0).forEach(function(x){s(v,x,U[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(U)):h(Object(U)).forEach(function(x){Object.defineProperty(v,x,Object.getOwnPropertyDescriptor(U,x))})}return v}function s(v,m,U){return m=E(m),m in v?Object.defineProperty(v,m,{value:U,enumerable:!0,configurable:!0,writable:!0}):v[m]=U,v}function b(v,m){if(!(v instanceof m))throw new TypeError("Cannot call a class as a function")}function _(v,m){for(var U=0;U<m.length;U++){var x=m[U];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(v,E(x.key),x)}}function L(v,m,U){return m&&_(v.prototype,m),Object.defineProperty(v,"prototype",{writable:!1}),v}function E(v){var m=f(v,"string");return u(m)==="symbol"?m:String(m)}function f(v,m){if(u(v)!=="object"||v===null)return v;var U=v[Symbol.toPrimitive];if(U!==void 0){var x=U.call(v,m);if(u(x)!=="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(v)}function n(v,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");v.prototype=Object.create(m&&m.prototype,{constructor:{value:v,writable:!0,configurable:!0}}),Object.defineProperty(v,"prototype",{writable:!1}),m&&A(v,m)}function e(v){var m=q();return function(){var x=j(v),C;if(m){var a=j(this).constructor;C=Reflect.construct(x,arguments,a)}else C=x.apply(this,arguments);return r(this,C)}}function r(v,m){if(m&&(u(m)==="object"||typeof m=="function"))return m;if(m!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return d(v)}function d(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}function y(v){var m=typeof Map=="function"?new Map:void 0;return y=function(x){if(x===null||!O(x))return x;if(typeof x!="function")throw new TypeError("Super expression must either be null or a function");if(typeof m<"u"){if(m.has(x))return m.get(x);m.set(x,C)}function C(){return l(x,arguments,j(this).constructor)}return C.prototype=Object.create(x.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),A(C,x)},y(v)}function l(v,m,U){return q()?l=Reflect.construct.bind():l=function(C,a,i){var c=[null];c.push.apply(c,a);var R=Function.bind.apply(C,c),w=new R;return i&&A(w,i.prototype),w},l.apply(null,arguments)}function q(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function O(v){return Function.toString.call(v).indexOf("[native code]")!==-1}function A(v,m){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,C){return x.__proto__=C,x},A(v,m)}function j(v){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(U){return U.__proto__||Object.getPrototypeOf(U)},j(v)}function u(v){"@babel/helpers - typeof";return u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},u(v)}var p=Se(),S=p.inspect,N=Ar(),B=N.codes.ERR_INVALID_ARG_TYPE;function K(v,m,U){return(U===void 0||U>v.length)&&(U=v.length),v.substring(U-m.length,U)===m}function H(v,m){if(m=Math.floor(m),v.length==0||m==0)return"";var U=v.length*m;for(m=Math.floor(Math.log(m)/Math.log(2));m;)v+=v,m--;return v+=v.substring(0,U-v.length),v}var V="",W="",te="",Z="",J={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},he=10;function de(v){var m=Object.keys(v),U=Object.create(Object.getPrototypeOf(v));return m.forEach(function(x){U[x]=v[x]}),Object.defineProperty(U,"message",{value:v.message}),U}function oe(v){return S(v,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function ye(v,m,U){var x="",C="",a=0,i="",c=!1,R=oe(v),w=R.split(`
1
+ import{B as qr}from"./vendor-utils-CUDP56Ff.js";import{p as ae}from"./vendor-react-Dvs43sk9.js";import{ag as Se,ah as jr,ai as xr,aj as Nr,ak as _r,al as Kr,am as Sr,an as Tr,ao as ke,ap as Ur,aq as Br,ar as Dr,as as Mr,a6 as Lr,r as Cr}from"./vendor-ux-B9VfuZTg.js";import{bf as Or,az as Vr}from"./index-Cm-NT_bW.js";var Pe={exports:{}},Re={},Je;function Ar(){if(Je)return Re;Je=1;function h(u){"@babel/helpers - typeof";return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},h(u)}function g(u,p,S){return Object.defineProperty(u,"prototype",{writable:!1}),u}function s(u,p){if(!(u instanceof p))throw new TypeError("Cannot call a class as a function")}function b(u,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function");u.prototype=Object.create(p&&p.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),Object.defineProperty(u,"prototype",{writable:!1}),p&&_(u,p)}function _(u,p){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(N,B){return N.__proto__=B,N},_(u,p)}function L(u){var p=n();return function(){var N=e(u),B;if(p){var K=e(this).constructor;B=Reflect.construct(N,arguments,K)}else B=N.apply(this,arguments);return E(this,B)}}function E(u,p){if(p&&(h(p)==="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return f(u)}function f(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function n(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(u){return e=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(S){return S.__proto__||Object.getPrototypeOf(S)},e(u)}var r={},d,y;function l(u,p,S){S||(S=Error);function N(K,H,V){return typeof p=="string"?p:p(K,H,V)}var B=function(K){b(V,K);var H=L(V);function V(W,te,Z){var J;return s(this,V),J=H.call(this,N(W,te,Z)),J.code=u,J}return g(V)}(S);r[u]=B}function q(u,p){if(Array.isArray(u)){var S=u.length;return u=u.map(function(N){return String(N)}),S>2?"one of ".concat(p," ").concat(u.slice(0,S-1).join(", "),", or ")+u[S-1]:S===2?"one of ".concat(p," ").concat(u[0]," or ").concat(u[1]):"of ".concat(p," ").concat(u[0])}else return"of ".concat(p," ").concat(String(u))}function O(u,p,S){return u.substr(0,p.length)===p}function A(u,p,S){return(S===void 0||S>u.length)&&(S=u.length),u.substring(S-p.length,S)===p}function j(u,p,S){return typeof S!="number"&&(S=0),S+p.length>u.length?!1:u.indexOf(p,S)!==-1}return l("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),l("ERR_INVALID_ARG_TYPE",function(u,p,S){d===void 0&&(d=We()),d(typeof u=="string","'name' must be a string");var N;typeof p=="string"&&O(p,"not ")?(N="must not be",p=p.replace(/^not /,"")):N="must be";var B;if(A(u," argument"))B="The ".concat(u," ").concat(N," ").concat(q(p,"type"));else{var K=j(u,".")?"property":"argument";B='The "'.concat(u,'" ').concat(K," ").concat(N," ").concat(q(p,"type"))}return B+=". Received type ".concat(h(S)),B},TypeError),l("ERR_INVALID_ARG_VALUE",function(u,p){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";y===void 0&&(y=Se());var N=y.inspect(p);return N.length>128&&(N="".concat(N.slice(0,128),"...")),"The argument '".concat(u,"' ").concat(S,". Received ").concat(N)},TypeError),l("ERR_INVALID_RETURN_VALUE",function(u,p,S){var N;return S&&S.constructor&&S.constructor.name?N="instance of ".concat(S.constructor.name):N="type ".concat(h(S)),"Expected ".concat(u,' to be returned from the "').concat(p,'"')+" function but got ".concat(N,".")},TypeError),l("ERR_MISSING_ARGS",function(){for(var u=arguments.length,p=new Array(u),S=0;S<u;S++)p[S]=arguments[S];d===void 0&&(d=We()),d(p.length>0,"At least one arg needs to be specified");var N="The ",B=p.length;switch(p=p.map(function(K){return'"'.concat(K,'"')}),B){case 1:N+="".concat(p[0]," argument");break;case 2:N+="".concat(p[0]," and ").concat(p[1]," arguments");break;default:N+=p.slice(0,B-1).join(", "),N+=", and ".concat(p[B-1]," arguments");break}return"".concat(N," must be specified")},TypeError),Re.codes=r,Re}var Ie,Qe;function Fr(){if(Qe)return Ie;Qe=1;function h(v,m){var U=Object.keys(v);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(v);m&&(x=x.filter(function(C){return Object.getOwnPropertyDescriptor(v,C).enumerable})),U.push.apply(U,x)}return U}function g(v){for(var m=1;m<arguments.length;m++){var U=arguments[m]!=null?arguments[m]:{};m%2?h(Object(U),!0).forEach(function(x){s(v,x,U[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(U)):h(Object(U)).forEach(function(x){Object.defineProperty(v,x,Object.getOwnPropertyDescriptor(U,x))})}return v}function s(v,m,U){return m=E(m),m in v?Object.defineProperty(v,m,{value:U,enumerable:!0,configurable:!0,writable:!0}):v[m]=U,v}function b(v,m){if(!(v instanceof m))throw new TypeError("Cannot call a class as a function")}function _(v,m){for(var U=0;U<m.length;U++){var x=m[U];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(v,E(x.key),x)}}function L(v,m,U){return m&&_(v.prototype,m),Object.defineProperty(v,"prototype",{writable:!1}),v}function E(v){var m=f(v,"string");return u(m)==="symbol"?m:String(m)}function f(v,m){if(u(v)!=="object"||v===null)return v;var U=v[Symbol.toPrimitive];if(U!==void 0){var x=U.call(v,m);if(u(x)!=="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(v)}function n(v,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");v.prototype=Object.create(m&&m.prototype,{constructor:{value:v,writable:!0,configurable:!0}}),Object.defineProperty(v,"prototype",{writable:!1}),m&&A(v,m)}function e(v){var m=q();return function(){var x=j(v),C;if(m){var a=j(this).constructor;C=Reflect.construct(x,arguments,a)}else C=x.apply(this,arguments);return r(this,C)}}function r(v,m){if(m&&(u(m)==="object"||typeof m=="function"))return m;if(m!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return d(v)}function d(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}function y(v){var m=typeof Map=="function"?new Map:void 0;return y=function(x){if(x===null||!O(x))return x;if(typeof x!="function")throw new TypeError("Super expression must either be null or a function");if(typeof m<"u"){if(m.has(x))return m.get(x);m.set(x,C)}function C(){return l(x,arguments,j(this).constructor)}return C.prototype=Object.create(x.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),A(C,x)},y(v)}function l(v,m,U){return q()?l=Reflect.construct.bind():l=function(C,a,i){var c=[null];c.push.apply(c,a);var R=Function.bind.apply(C,c),w=new R;return i&&A(w,i.prototype),w},l.apply(null,arguments)}function q(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function O(v){return Function.toString.call(v).indexOf("[native code]")!==-1}function A(v,m){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,C){return x.__proto__=C,x},A(v,m)}function j(v){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(U){return U.__proto__||Object.getPrototypeOf(U)},j(v)}function u(v){"@babel/helpers - typeof";return u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},u(v)}var p=Se(),S=p.inspect,N=Ar(),B=N.codes.ERR_INVALID_ARG_TYPE;function K(v,m,U){return(U===void 0||U>v.length)&&(U=v.length),v.substring(U-m.length,U)===m}function H(v,m){if(m=Math.floor(m),v.length==0||m==0)return"";var U=v.length*m;for(m=Math.floor(Math.log(m)/Math.log(2));m;)v+=v,m--;return v+=v.substring(0,U-v.length),v}var V="",W="",te="",Z="",J={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},he=10;function de(v){var m=Object.keys(v),U=Object.create(Object.getPrototypeOf(v));return m.forEach(function(x){U[x]=v[x]}),Object.defineProperty(U,"message",{value:v.message}),U}function oe(v){return S(v,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function ye(v,m,U){var x="",C="",a=0,i="",c=!1,R=oe(v),w=R.split(`
2
2
  `),I=oe(m).split(`
3
3
  `),D=0,z="";if(U==="strictEqual"&&u(v)==="object"&&u(m)==="object"&&v!==null&&m!==null&&(U="strictEqualObject"),w.length===1&&I.length===1&&w[0]!==I[0]){var k=w[0].length+I[0].length;if(k<=he){if((u(v)!=="object"||v===null)&&(u(m)!=="object"||m===null)&&(v!==0||m!==0))return"".concat(J[U],`
4
4
 
@@ -1,4 +1,4 @@
1
- import{j as a,D as M,T as _,ce as T,Q as W,cf as X,aV as Z,ak as h,cg as q,aU as Y,av as B,f as C,b$ as J,ch as K}from"./vendor-mui-core-DRxbhqaK.js";import{r as d,k as L,L as z,n as ee,o as ae}from"./vendor-react-Dvs43sk9.js";import{H as E,aU as te}from"./index-DsZw1jDU.js";import{e as ie}from"./vendor-hooks-BlA8TRnZ.js";import{M as re,l as m,X as A,Z as S}from"./vendor-ux-CDOuCaX1.js";import{z as oe}from"./vendor-arcblock-CSGgL93G.js";const H=d.createContext(null),se=e=>{const i=d.use(H);return d.useLayoutEffect(()=>{},[]),i};function le({children:e=void 0,...i}){const[t,r]=d.useState({inFullPage:!1,showToggleButton:!1,headerVisibleInFullPage:!0,footerVisibleInFullPage:!1,sidebarVisibleInFullPage:!1}),s=()=>{r(o=>({...o,inFullPage:!o.inFullPage}))},l=d.useMemo(()=>({...t,headerVisible:!t.inFullPage||t.headerVisibleInFullPage,footerVisible:!t.inFullPage||t.footerVisibleInFullPage,sidebarVisible:!t.inFullPage||t.sidebarVisibleInFullPage,toggleFullPage:s,configure:o=>r(n=>({...n,...o}))}),[t]);return a.jsx(H,{value:l,...i,children:e})}function ne({name:e,size:i=36,alt:t="",color:r="#000000",prefix:s="/images",showBadge:l=!1,style:o={},...n}){const c=`${s}/${e}-${r.replace(/^#/,"")}.png`;return a.jsxs(de,{style:{width:i,height:i},children:[a.jsx(re,{width:i,height:i,alt:t||e,src:c,style:Object.assign({width:i},o),...n}),l&&a.jsx("i",{className:"badge-point"})]})}const de=m("div")`
1
+ import{j as a,D as M,T as _,ce as T,Q as W,cf as X,aV as Z,ak as h,cg as q,aU as Y,av as B,f as C,b$ as J,ch as K}from"./vendor-mui-core-DRxbhqaK.js";import{r as d,k as L,L as z,n as ee,o as ae}from"./vendor-react-Dvs43sk9.js";import{H as E,aU as te}from"./index-Cm-NT_bW.js";import{e as ie}from"./vendor-hooks-BlA8TRnZ.js";import{M as re,l as m,X as A,Z as S}from"./vendor-ux-B9VfuZTg.js";import{z as oe}from"./vendor-arcblock-DeeG8u0h.js";const H=d.createContext(null),se=e=>{const i=d.use(H);return d.useLayoutEffect(()=>{},[]),i};function le({children:e=void 0,...i}){const[t,r]=d.useState({inFullPage:!1,showToggleButton:!1,headerVisibleInFullPage:!0,footerVisibleInFullPage:!1,sidebarVisibleInFullPage:!1}),s=()=>{r(o=>({...o,inFullPage:!o.inFullPage}))},l=d.useMemo(()=>({...t,headerVisible:!t.inFullPage||t.headerVisibleInFullPage,footerVisible:!t.inFullPage||t.footerVisibleInFullPage,sidebarVisible:!t.inFullPage||t.sidebarVisibleInFullPage,toggleFullPage:s,configure:o=>r(n=>({...n,...o}))}),[t]);return a.jsx(H,{value:l,...i,children:e})}function ne({name:e,size:i=36,alt:t="",color:r="#000000",prefix:s="/images",showBadge:l=!1,style:o={},...n}){const c=`${s}/${e}-${r.replace(/^#/,"")}.png`;return a.jsxs(de,{style:{width:i,height:i},children:[a.jsx(re,{width:i,height:i,alt:t||e,src:c,style:Object.assign({width:i},o),...n}),l&&a.jsx("i",{className:"badge-point"})]})}const de=m("div")`
2
2
  position: relative;
3
3
  .badge-point {
4
4
  position: absolute;