@abtnode/blocklet-services 1.16.42-beta-20250415-224346-080ee735 → 1.16.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/dist/assets/{AdapterDayjs-BLBXeg9J.js → AdapterDayjs-B7fWFwN5.js} +1 -1
  2. package/dist/assets/{ArrowDropDown--dAaadP8.js → ArrowDropDown-DO9H_COV.js} +1 -1
  3. package/dist/assets/{CheckCircle-Av1UotA-.js → CheckCircle-B_wWOO2P.js} +1 -1
  4. package/dist/assets/{ChevronLeft-De8Da-PB.js → ChevronLeft-BdrBCIFt.js} +1 -1
  5. package/dist/assets/{ChevronRight-CQOI2CyK.js → ChevronRight-CO9My6tF.js} +1 -1
  6. package/dist/assets/{DeleteOutline-Cgoi-K0i.js → DeleteOutline-7AloJjcV.js} +1 -1
  7. package/dist/assets/{Done-BYuUlh_s.js → Done-BXISjL2g.js} +1 -1
  8. package/dist/assets/{Download-DUKR_Wkm.js → Download-B0rKRcTB.js} +1 -1
  9. package/dist/assets/{Edit-D2RQMivt.js → Edit-C1mcIe4c.js} +1 -1
  10. package/dist/assets/{Error-By0ZMWzh.js → Error-BnWmSZ5k.js} +1 -1
  11. package/dist/assets/{ExpandLess-BNGLjxae.js → ExpandLess-DRlih5VO.js} +1 -1
  12. package/dist/assets/{Google-tZCjvU7D.js → Google-1eG1YH-u.js} +1 -1
  13. package/dist/assets/{InfoOutlined-DSoJjRQo.js → InfoOutlined-DO0_Vjz-.js} +1 -1
  14. package/dist/assets/{Launch-B161pSEw.js → Launch-CIC8rZgo.js} +1 -1
  15. package/dist/assets/{LaunchOutlined-wehxIahb.js → LaunchOutlined-CkYWJcA9.js} +1 -1
  16. package/dist/assets/{MoreHoriz-Bo_R2nuS.js → MoreHoriz-B8cBSV22.js} +1 -1
  17. package/dist/assets/{PlayArrow-D38lbyGo.js → PlayArrow-NjIpSDwJ.js} +1 -1
  18. package/dist/assets/{TuneOutlined-DMMtKa6E.js → TuneOutlined-Bry0vSC0.js} +1 -1
  19. package/dist/assets/{ViewList-CMIoKrN6.js → ViewList-BzGRahvc.js} +1 -1
  20. package/dist/assets/{access-control-DLD9n3S7.js → access-control-URJ2ACEE.js} +1 -1
  21. package/dist/assets/{actions-CMsM02NP.js → actions-BOikuUJD.js} +1 -1
  22. package/dist/assets/{add-component-core-FnU4dwXM.js → add-component-core-YuQ3TiFu.js} +1 -1
  23. package/dist/assets/{add-resource-CubCXHBS.js → add-resource-DJW7iUoP.js} +1 -1
  24. package/dist/assets/{addon-5JaI2ctX.js → addon-F4fsk4Yi.js} +1 -1
  25. package/dist/assets/{advanced-D4wfoh0v.js → advanced-6m9VnipD.js} +1 -1
  26. package/dist/assets/{appearance-BUsj4DWC.js → appearance-Ks2n1JJ9.js} +1 -1
  27. package/dist/assets/{audit-logs-rk_iUYcM.js → audit-logs-CyUffLP5.js} +1 -1
  28. package/dist/assets/{authorize-CDJXjmiI.js → authorize-DCUCKc1-.js} +1 -1
  29. package/dist/assets/{base32-BhlNgZPk.js → base32-CQfYcymN.js} +1 -1
  30. package/dist/assets/{branding-JQ1914RB.js → branding-Cag0aDCR.js} +2 -2
  31. package/dist/assets/{branding-BBbE2Klb.js → branding-Dv6KIot-.js} +1 -1
  32. package/dist/assets/{bundle-avatar-woUZoGoi.js → bundle-avatar-CSEBu3MU.js} +1 -1
  33. package/dist/assets/{button-Rx3uHycr.js → button-leITu2bm.js} +1 -1
  34. package/dist/assets/{click-to-copy-BxZJa7n5.js → click-to-copy-Cygm8U3_.js} +1 -1
  35. package/dist/assets/{complete-KnPBZq-P.js → complete-BorStSwi.js} +1 -1
  36. package/dist/assets/{component-fD-EGTLm.js → component-CGuQ2QSk.js} +1 -1
  37. package/dist/assets/{config-8xeoVfWN.js → config-Co9p5iPr.js} +1 -1
  38. package/dist/assets/{config-DbqQgRSU.js → config-Dko9yBri.js} +1 -1
  39. package/dist/assets/{config-navigation-DrgPbe5I.js → config-navigation-aTpclkWb.js} +3 -3
  40. package/dist/assets/{config-space-DZ9w_4_9.js → config-space-Bc3ndGw-.js} +1 -1
  41. package/dist/assets/{confirm-_RIb3OmR.js → confirm-Fhl5qi_m.js} +1 -1
  42. package/dist/assets/{connect-CPIImVme.js → connect-Dds1wvN9.js} +1 -1
  43. package/dist/assets/{connect-CJOq1BXE.js → connect-DigT1D00.js} +1 -1
  44. package/dist/assets/{connect-to-BdhN0BHi.js → connect-to-BMDSElVg.js} +1 -1
  45. package/dist/assets/{dashboard-vsk4QHJ1.js → dashboard-D3KvORmC.js} +3 -3
  46. package/dist/assets/{delete-confirm-DaoAi4Gz.js → delete-confirm-Dtzz6Jaz.js} +1 -1
  47. package/dist/assets/{did-address-CGHn52xI.js → did-address-GAxLGeWB.js} +1 -1
  48. package/dist/assets/{domain-BJUSWYGQ.js → domain-BSF-ZwXV.js} +1 -1
  49. package/dist/assets/{domain-action-card-9r42-rWK.js → domain-action-card-ZJ-cQ-aa.js} +1 -1
  50. package/dist/assets/domains-DjSbrUlR.js +1 -0
  51. package/dist/assets/{email-fp1LVcF6.js → email-zgArXfS8.js} +1 -1
  52. package/dist/assets/{exchange-passport-DIyhYtFS.js → exchange-passport-O7J_1njm.js} +1 -1
  53. package/dist/assets/{fuel-aGwI1uP2.js → fuel-BFFqH-nX.js} +1 -1
  54. package/dist/assets/{gen-access-key-DMS1kzry.js → gen-access-key-DhAGvo8z.js} +1 -1
  55. package/dist/assets/{get-safe-url-DMordnyN.js → get-safe-url-CRmmLBFf.js} +1 -1
  56. package/dist/assets/{get-safe-url-DW2Z07ex.js → get-safe-url-ZRaKUVld.js} +1 -1
  57. package/dist/assets/{home-B_gUzcjU.js → home-AJ00GuT0.js} +1 -1
  58. package/dist/assets/{iframe-BEanRyio.js → iframe-C4N_8Wwh.js} +1 -1
  59. package/dist/assets/{index-D22lazSG.js → index-BLv5CM0y.js} +3 -3
  60. package/dist/assets/{index-D22ZWGxu.js → index-BRz2myBK.js} +1 -1
  61. package/dist/assets/{index-DUQK_NaI.js → index-BVgoikAb.js} +1 -1
  62. package/dist/assets/{index-CcjD0qiY.js → index-Bv-pwUe7.js} +1 -1
  63. package/dist/assets/{index-xa5W6ExD.js → index-Bx2tzf6d.js} +1 -1
  64. package/dist/assets/{index-BjN8LAYh.js → index-C0Yvp1nU.js} +4 -4
  65. package/dist/assets/{index-C0hr4pkt.js → index-C4aiK5ag.js} +1 -1
  66. package/dist/assets/{index-CFJtmMCn.js → index-C6B-01xU.js} +1 -1
  67. package/dist/assets/{index-BPa_QtWl.js → index-CWohFZPl.js} +3 -3
  68. package/dist/assets/{index-BDNlzmD0.js → index-CuQlnfwu.js} +1 -1
  69. package/dist/assets/{index-4rY7Xp2W.js → index-D6v3bOtJ.js} +1 -1
  70. package/dist/assets/{index-CbW18ndN.js → index-DHEDtVhz.js} +1 -1
  71. package/dist/assets/{index-DbpVrp8z.js → index-DWue5FZ4.js} +1 -1
  72. package/dist/assets/{index-DBZZ-U66.js → index-Dc-Oeqo9.js} +1 -1
  73. package/dist/assets/{index-D2EAXstd.js → index-DkIEu7Lb.js} +1 -1
  74. package/dist/assets/{index-AhbLOD9c.js → index-DwLhvC8N.js} +1 -1
  75. package/dist/assets/{index-CFkRKsyT.js → index-GP_jFykV.js} +1 -1
  76. package/dist/assets/{index-D_gSWW1P.js → index-bQ-8RhFL.js} +1 -1
  77. package/dist/assets/{index-BmexzVQt.js → index-uHTdpm71.js} +1 -1
  78. package/dist/assets/{invitation-D-l4US6a.js → invitation-D6DHxZjO.js} +1 -1
  79. package/dist/assets/{invite-DPswrm4J.js → invite-DIncZ5ep.js} +1 -1
  80. package/dist/assets/{issue-passport-AJghkFHK.js → issue-passport-DBIo8EtU.js} +1 -1
  81. package/dist/assets/{item-zk7clNKz.js → item-D8zBx1dJ.js} +1 -1
  82. package/dist/assets/{landing-page-D13wALfk.js → landing-page-aHOyrHWC.js} +1 -1
  83. package/dist/assets/{layout-aS-gjZH3.js → layout-DbKPqvnm.js} +1 -1
  84. package/dist/assets/{list-CJt5nOcn.js → list-BTx_8ZHD.js} +1 -1
  85. package/dist/assets/localization-DS_PbFVL.js +1 -0
  86. package/dist/assets/{log-DFaz-U9x.js → log-BKrMj0yE.js} +1 -1
  87. package/dist/assets/{logger-DXlQ8ejK.js → logger-B9-TWjbH.js} +1 -1
  88. package/dist/assets/{login-DKSu0ge6.js → login-3U6j8E6s.js} +1 -1
  89. package/dist/assets/{login-oauth-callback-CP7cNspN.js → login-oauth-callback-DqejBHsA.js} +1 -1
  90. package/dist/assets/{logo-uploader-B7i5QemW.js → logo-uploader-CcwN1uWX.js} +3 -3
  91. package/dist/assets/{lost-passport-QRUn4RXe.js → lost-passport-BbPQj08X.js} +1 -1
  92. package/dist/assets/{open-window-B6LZyZAW.js → open-window-plauGxNl.js} +1 -1
  93. package/dist/assets/{overview-B3A_5sHO.js → overview-DFc4LXLh.js} +1 -1
  94. package/dist/assets/{page-header-DUh_2MUQ.js → page-header-Cu9lHawO.js} +1 -1
  95. package/dist/assets/{passport-item-BY6VS7Ot.js → passport-item-BEGCAq1O.js} +1 -1
  96. package/dist/assets/{permission-DKFJEWNH.js → permission-C5Df-sxb.js} +1 -1
  97. package/dist/assets/{preferences-CA76rfbp.js → preferences-BUVHMy7R.js} +1 -1
  98. package/dist/assets/{profile-embed-DHFHXO1W.js → profile-embed-BKX2YBaX.js} +1 -1
  99. package/dist/assets/{publish-resource-rxvf6s83.js → publish-resource-CrvVpn2O.js} +1 -1
  100. package/dist/assets/{react-beautiful-dnd.esm-D0nBCaor.js → react-beautiful-dnd.esm-BQ3hEDNY.js} +1 -1
  101. package/dist/assets/{relative-time-BK3hjJNN.js → relative-time-BBLaQUJf.js} +1 -1
  102. package/dist/assets/{runtime-D_bXZ0w0.js → runtime-A09BTZXh.js} +1 -1
  103. package/dist/assets/sdk-DRKovxXZ.js +1 -0
  104. package/dist/assets/{security-DEmFjZiu.js → security-DM8YTbEj.js} +1 -1
  105. package/dist/assets/{session-DB9Du-lc.js → session-DaQ4KCFD.js} +1 -1
  106. package/dist/assets/{setup-kkb6SvQ7.js → setup-Bb0ZZK40.js} +3 -3
  107. package/dist/assets/{spaces-25E9GQ6_.js → spaces-D1rqZVaX.js} +1 -1
  108. package/dist/assets/{start-DfEUlPuS.js → start-BrRd22Kx.js} +1 -1
  109. package/dist/assets/{status-CUyAteC9.js → status-Cyln1yDP.js} +1 -1
  110. package/dist/assets/{step-actions-CAgwlOEY.js → step-actions-BnMmi82x.js} +1 -1
  111. package/dist/assets/{studio-2U2-FOOC.js → studio-CJpRZ6Af.js} +1 -1
  112. package/dist/assets/{switch-control-DwTxPESj.js → switch-control-DPANzJ8H.js} +1 -1
  113. package/dist/assets/{traffic-B94bYvtf.js → traffic-CjCHxLye.js} +1 -1
  114. package/dist/assets/{transfer-DWjvJtPs.js → transfer-BYeu2CqJ.js} +1 -1
  115. package/dist/assets/{unsubscribe-CTZlUfqc.js → unsubscribe-D7OPmQBG.js} +1 -1
  116. package/dist/assets/{useLocalStorage-DKl7XFfI.js → useLocalStorage-BXnF_60k.js} +1 -1
  117. package/dist/assets/{user-center-Du6EtGgy.js → user-center-BdWhBs4v.js} +1 -1
  118. package/dist/assets/{util-DkIhTuT7.js → util-Csa0tyHO.js} +1 -1
  119. package/dist/assets/{util-BEvdQ5nP.js → util-rMFbd0lA.js} +1 -1
  120. package/dist/assets/{vendor-arcblock-ACo-BN0q.js → vendor-arcblock-BtlDhznp.js} +1 -1
  121. package/dist/assets/{vendor-ux-did-connect-DOjsg91L.js → vendor-ux-did-connect-CiLSrCOH.js} +1 -1
  122. package/dist/assets/{wrap-locale-DjpRZNtr.js → wrap-locale-DgmlMdxX.js} +1 -1
  123. package/dist/index.html +3 -3
  124. package/dist/service-worker.js +1 -1
  125. package/package.json +41 -41
  126. package/dist/assets/domains-BNDFk-7R.js +0 -1
  127. package/dist/assets/localization-Us9buoy1.js +0 -1
  128. package/dist/assets/sdk-Hg_BMu_u.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as b}from"./vendor-react-DoD83n6N.js";import{j as e,H as d,a8 as Pe,ab as jt,T as Q,aa as C,E as _e,bo as ke,ce as et,bN as Te,bs as Re,bO as Ie,y as Se,b3 as Ee,a9 as tt,ag as ce,a1 as st,bg as Xe,br as vt,bn as yt,q as Je,bV as St}from"./vendor-mui-core-DxD1UA4o.js";import{c as ie,av as ue,A as Ct}from"./vendor-utils-CTIzdAFg.js";import{Y as J,p as P,b3 as Nt,r as Fe,f as wt,u as te,c4 as Tt,X as nt,B as De,a5 as at,bi as je,ak as Rt,aq as It,bM as Et}from"./vendor-ux-did-connect-DOjsg91L.js";import{z as Dt,t as V,l as At,G as Qe}from"./index-BPa_QtWl.js";import{f as ee,a as Ae}from"./vendor-hooks-BwVH-TAd.js";import{S as he}from"./shorten-label-CwDvu4_S.js";import{I as it}from"./index-D22ZWGxu.js";import{A as Ot,S as Lt,a as Pt,b as _t}from"./list-CJt5nOcn.js";import{R as Be}from"./relative-time-BK3hjJNN.js";import{b as ze}from"./dashboard-vsk4QHJ1.js";import{W as kt}from"./did-address-CGHn52xI.js";import{p as ot}from"./util-DkIhTuT7.js";import{D as Ft,g as Bt}from"./traffic-B94bYvtf.js";import{i as zt,a as Wt,B as Mt}from"./index-xa5W6ExD.js";import{B as rt}from"./bundle-avatar-woUZoGoi.js";import"./lottie-web-B6s7dDoL.js";import"./vendor-arcblock-ACo-BN0q.js";import"./index-D1fVmwHN.js";import"./InfoOutlined-DSoJjRQo.js";import"./sdk-Hg_BMu_u.js";import"./CheckCircle-Av1UotA-.js";import"./index-4rY7Xp2W.js";import"./Location-B6FoL795.js";import"./Email-RGD-rKFl.js";import"./Timezone-bYzGwn3x.js";import"./useLocalStorage-DKl7XFfI.js";import"./confirm-_RIb3OmR.js";import"./format-error-LAoTjvJe.js";import"./PlayArrow-D38lbyGo.js";import"./get-safe-url-DW2Z07ex.js";import"./session-DB9Du-lc.js";import"./useAsyncRetry-BBomZj1z.js";import"./useAsync-DKE0K0bz.js";import"./useSetState-BL3ktMon.js";import"./use-mobile-CHMVa8_W.js";import"./base32-BhlNgZPk.js";import"./iframe-BEanRyio.js";import"./LaunchOutlined-wehxIahb.js";import"./ChevronLeft-De8Da-PB.js";import"./ChevronRight-CQOI2CyK.js";import"./index-DzDfEcNp.js";import"./vendor-mui-x-Bit8yv3W.js";import"./AdapterDayjs-BLBXeg9J.js";const lt=b.createContext({}),{Provider:qt,Consumer:pn}=lt;function Kt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:o}}=Dt(),[a,x]=b.useState([]),[u,T]=b.useState({total:0,pageSize:20,pageCount:0,page:1}),m=ee(()=>{var h;return(h=s.meta)==null?void 0:h.did},[s]),[y,S]=b.useState([]),[I,M]=b.useState({}),E=ee(()=>a.length?new Set(a.map(h=>h.id)):new Set,[a]),L=async({page:h=1,pageSize:O=20,...A}={})=>{if(!m)return[];try{const _={paging:{page:h,pageSize:O},...A,teamDid:m,dateRange:A.dateRange?[V(A.dateRange[0]).toISOString(),V(A.dateRange[1]).toISOString()]:void 0},{dids:B,...q}=_;let Z="";B&&B.includes("system")&&(Z="system");const z=B?B.filter(f=>f!=="system"):[],oe={...q,source:Z,componentDids:z},se=await n.getNotificationSendLog({input:oe});return M(oe),x(se.list),T(se.paging),se.list}catch(_){return J.error(_.message),[]}},D=async()=>{const h=await n.getNotificationComponents({input:{teamDid:m}});S(h.componentDids)},G=b.useCallback(h=>{const O=s.children.find(A=>{var _;return((_=A.meta)==null?void 0:_.did)===h});if(O)return O.ancestors=[s],O},[s]),H=async({notificationId:h,receivers:O,channels:A,..._})=>{await n.resendNotification({input:{teamDid:m,notificationId:h,receivers:O,channels:A.map(B=>B==="wallet"?P.NOTIFICATION_SEND_CHANNEL.WALLET:B==="pushKit"?P.NOTIFICATION_SEND_CHANNEL.PUSH:B),..._}})},U=b.useCallback(async h=>(await n.getUser({input:{teamDid:m,user:{did:h}}})).user,[n,m]),N=b.useCallback(async({page:h=1,pageSize:O=20,...A}={})=>{try{const _={paging:{page:h,pageSize:O},...A,userName:A.searchText||"",teamDid:m,dateRange:A.dateRange?[V(A.dateRange[0]).toISOString(),V(A.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:_})}catch(_){throw J.error(_.message),_}},[n,m]);b.useEffect(()=>{m&&D()},[m]),o(P.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,h=>{E.has(h.notificationId)&&L(I)},[E,I]),o(P.EVENTS.NOTIFICATION_BLOCKLET_CREATE,h=>{E.has(h.id)||L(I)},[E,I]);const F={fetch:L,data:a,paging:u,blocklet:s,getComponent:G,resendNotification:H,getUser:U,componentDids:y,getReceivers:N,inService:r,teamDid:m};return e.jsx(qt,{value:{notificationRecords:F},children:t})}function We(){const{notificationRecords:t}=b.useContext(lt);return t}ge.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Ht={info:"primary",success:"success",error:"error",warning:"warning"};function ge({severity:t="info"}){return e.jsx(Nt,{type:Ht[t],children:t})}var Me={},Ut=Pe;Object.defineProperty(Me,"__esModule",{value:!0});var ct=Me.default=void 0,$t=Ut(Fe()),Vt=e;ct=Me.default=(0,$t.default)((0,Vt.jsx)("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"CheckCircleOutline");var qe={},Gt=Pe;Object.defineProperty(qe,"__esModule",{value:!0});var dt=qe.default=void 0,Yt=Gt(Fe()),Xt=e;dt=qe.default=(0,Yt.default)((0,Xt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"}),"Block");var Ke={},Jt=Pe;Object.defineProperty(Ke,"__esModule",{value:!0});var ut=Ke.default=void 0,Qt=Jt(Fe()),Zt=e;ut=Ke.default=(0,Qt.default)((0,Zt.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh");const es=(t,s,n="")=>{if(!n||!s)return"";switch(n){case P.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case P.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case P.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case P.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function pt(t,s,n={}){const{status:r,updatedAt:o,reason:a="",channel:x="wallet"}=n,u=o?t("notification.sendStatus.sentTime",{date:At(o,s)}):"",T=es(t,x,a);return r===P.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:u,reason:T}:r===P.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:t("notification.sendStatus.pending"),reason:T,sentTime:u}}const Oe={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Le=["wallet","pushKit","email"],Ze=["info","success","error","warning"],ft=t=>{var n,r;const{settings:s}=t;return(r=(n=s==null?void 0:s.notification)==null?void 0:n.email)==null?void 0:r.enabled},mt=t=>{var n,r;const{settings:s}=t;return(r=(n=s==null?void 0:s.notification)==null?void 0:n.pushKit)==null?void 0:r.enabled},ts=(t,s)=>{const n=ie(s,"extra.notifications.email",!0);return{available:ft(t),enabled:n}},ss=(t,s)=>{const n=ie(s,"extra.notifications.push",!0);return{available:mt(t),enabled:n}},ns=t=>({enabled:ie(t,"extra.notifications.wallet",!0)}),as=t=>({enabled:ie(t,"extra.webhooks",[]).length>0}),xe=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),is=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],be=(t=[])=>{const s=V().startOf("day");return t.filter(n=>V(n.sendAt).isSame(s,"day")).length},os=(t,s="")=>{if(s&&Le.includes(s)){const a=`${s}SendRecord`,x=ie(t,a,[]);return be(x)}const n=ie(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const a=n[s]??[];return be(a)}const o={};return Le.forEach(a=>{const x=`${a}SendRecord`,u=ie(t,x,[]),T=be(u);o[a]=T}),r.length>0&&r.forEach(a=>{const x=n[a]??[],u=be(x);o[a]=u}),o},ve=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},ye=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},rs=t=>{switch(t){case P.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case P.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case P.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case P.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ht=()=>wt({typography:{fontSize:14,button:{textTransform:"none"}},components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function ne({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r}){const{status:o,title:a="",sentTime:x="",reason:u=""}=t,T=[a,u].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(Q,{color:"inherit",sx:{fontSize:12},children:T}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(C,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(C,{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center",children:[e.jsx(C,{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Oe[o],style:{opacity:.15}}),e.jsx(C,{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Oe[o]})]}),e.jsx(Q,{color:"inherit",sx:{fontSize:12},children:n?a:r})]})})}ne.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};ne.defaultProps={enableTooltip:!0,showTitle:!1,children:null};pe.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};pe.defaultProps={onDelete:()=>{}};function pe({list:t,label:s,onDelete:n}){const{t:r,locale:o}=te();return e.jsxs(C,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(Q,{children:[s,": "]}),t.map(a=>{const x=pt(r,o,{status:a});return e.jsx(_e,{size:"small",label:e.jsx(C,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(ne,{config:x,enableTooltip:!1,children:x.title})}),onDelete:u=>n(u,a)},a)})]})}He.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function He({filterList:t,onChange:s,index:n,column:r,filterValues:o,label:a,renderLabel:x}){return e.jsxs(ke,{className:"filter-container",children:[e.jsx(et,{component:"legend",children:a}),e.jsx(Te,{row:!0,children:o.map(u=>e.jsx(Re,{control:e.jsx(Ie,{checked:t[n].indexOf(u.value??u)>-1,onChange:T=>{const m=[...t];T.target.checked?m[n]=[...m[n],u.value??u]:m[n]=m[n].filter(y=>y!==(u.value??u)),s(m[n],n,r)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(u)})},u.value??u))})]})}function we(t){return e.jsx(He,{...t,renderLabel:s=>e.jsx(ne,{enableTooltip:!1,config:{status:s.status},children:s.label})})}de.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function de({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:o}){const{t:a,locale:x}=te(),u=pt(a,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(C,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(ne,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(Se,{className:"resend-btn",size:"small",startIcon:e.jsx(ze,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:o,children:a("notification.resend")})]})}Ue.propTypes={value:d.array.isRequired,onChange:d.func};function Ue({value:t,onChange:s}){const{locale:n}=te(),r=V().toDate(),[o,a]=b.useState(null),x=b.useCallback(m=>{a(o?null:m.currentTarget)},[o]),u=!!o,T=b.useCallback(m=>{if(!m.startDate||!m.endDate){J.error("Please select a date range");return}if(V(m.startDate).isAfter(m.endDate)||!V(m.startDate).isValid()||!V(m.endDate).isValid()){J.error("Invalid date range");return}s([m.startDate,m.endDate]),a(null)},[s]);return e.jsxs("div",{children:[e.jsx(Q,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:0,children:e.jsxs(Se,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[Qe(t[0],n)," - ",Qe(t[1],n)]})}),e.jsx(Ee,{open:u,anchorEl:o,onClose:()=>{a(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Ft,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Bt(r),onChange:T})})]})}$e.propTypes={itemComponent:d.elementType.isRequired};function $e({itemComponent:t,...s}){var o;const{t:n}=te();return!((o=s==null?void 0:s.filterList)!=null&&o.filter(a=>a.length).length)?null:e.jsxs(C,{display:"flex",gap:1,alignItems:"center",children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(Tt.TableFilterList,{...s,ItemComponent:t})})]})}function Ce({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const o=s&&typeof s=="function"?s:void 0;let a=!0;return n&&typeof n=="function"&&(a=n({label:t,...r})),e.jsx(_e,{label:t,variant:"outlined",...o&&a?{onDelete:o}:{}})}Ce.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};Ce.defaultProps={canDelete:()=>!0};const ls=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];Ve.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};Ve.defaultProps={loading:!1,onCancel:()=>{},onConfirm:()=>{}};function Ve({loading:t=!1,onCancel:s,onConfirm:n}){const{t:r}=te(),[o,a]=b.useState(ls),[x,u]=b.useState(!0),T=(y,S)=>{S.checked=y.target.checked;const I=o.map(M=>({...M,checked:M.value===S.value?S.checked:M.checked}));a(I)},m=y=>{y.stopPropagation(),n({channels:o.filter(S=>S.checked).map(S=>S.value),isResendFailedOnly:x})};return e.jsxs(C,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(Q,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(C,{className:"choose-channel",children:e.jsxs(ke,{component:"fieldset",variant:"standard",children:[e.jsx(et,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:o.map(y=>e.jsx(Re,{control:e.jsx(Ie,{checked:y.checked,onChange:S=>T(S,y),name:y.value}),label:y.label},y.value))})]})}),e.jsx(C,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Re,{control:e.jsx(Ie,{checked:x,onChange:y=>u(y.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(C,{display:"flex",justifyContent:"flex-end",gap:1,className:"resend-config-footer-tip",children:[e.jsx(Se,{onClick:y=>{y.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Se,{onClick:m,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(tt,{size:16}),r("common.confirm")]})]})]})}gt.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function gt({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:o}=te(),{getReceivers:a,inService:x,teamDid:u,getUser:T,blocklet:m}=We(),[y,S]=b.useState(!1),[I,M]=b.useState([]),E=Ae({anchorEl:null,position:null}),L=Ae({anchorEl:null,position:null}),[D,G]=b.useState(null),[H,U]=b.useState({total:0,pageSize:10,pageCount:0,page:1}),[N,F]=b.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[V().subtract(1,"month").startOf("day").toDate(),V().endOf("day").toDate()]}),[h,O]=b.useState([]),A=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],_=async()=>{if(!y&&t)try{S(!0);const i=await a({notificationId:t,...N}),l=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:ot(c.receiverUser.avatar,u,x)}}));M(l),U(i.paging),S(!1)}catch(i){J.error(i.message),S(!1)}};b.useEffect(()=>{_()},[N]);const B=i=>{i.stopPropagation();const l=i.currentTarget;L.anchorEl=l;const c=l.getBoundingClientRect();L.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},q=i=>i.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(De,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(ze,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:B,children:r("notification.resend")})}):null,Z={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:H.page-1,rowsPerPage:H.pageSize,count:H.total,searchText:N.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:h,onRowSelectionChange:(i,l)=>{O(l.map(c=>c.dataIndex))},customToolbarSelect:q},z=({page:i,rowsPerPage:l,searchText:c,filterList:v})=>{const[,k=[],$=[],K=[]]=v;N.pageSize!==l?F(W=>({...W,pageSize:l,page:1})):N.page!==i+1?F(W=>({...W,page:i+1})):N.searchText!==c?F(W=>({...W,searchText:c,page:1})):ue(k,N.walletSendStatus)?ue($,N.pushKitSendStatus)?ue(K,N.emailSendStatus)||F(W=>({...W,emailSendStatus:K,page:1})):F(W=>({...W,pushKitSendStatus:$,page:1})):F(W=>({...W,walletSendStatus:k,page:1}))},oe=b.useCallback(async(i,l)=>{if(!l)return!1;const c=await T(l);return c?i==="wallet"?ns(c):i==="email"?ts(m,c):i==="pushKit"?ss(m,c):i==="webhook"?as(c):!0:!1},[T,m]),se=b.useCallback(i=>is(r,i),[r]),f=()=>{E.anchorEl=null,E.position=null,G(null)},p=()=>{L.anchorEl=null,L.position=null},g=async(i,l,c=!0,v="")=>{if(!(!l.length||!i.length))try{s(i,l,c,v),L.anchorEl||(await xe(.5),f())}catch(k){console.error("handleResend error",{error:k})}},j=async({channels:i,isResendFailedOnly:l})=>{const c=h.map(v=>I[v].receiver);await g(i,c,l),await xe(.5),p(),O([])},R=async(i,l=[],c=!0)=>{try{await g(["webhook"],[i.receiver],c,l)}catch(v){J.error(v.response?v.response.statusText:v.message)}},w=async(i,l,c,v=[],k=!0)=>{if(i.stopPropagation(),os(l,c)>=4){J.warning(r("notification.resendLimit"));return}if(!Le.includes(c)){await R(l,v,k);return}if(i){const K=i.currentTarget,W=K.getBoundingClientRect();E.anchorEl=K,E.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}G({channel:c});try{const K=await oe(c,l.receiver);await xe(1),G({channel:c,result:K}),(typeof K=="boolean"&&K||Ct(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[l.receiver],k),L.anchorEl||(await xe(.5),f()))}catch(K){J.error(K.message)}},Y=i=>{F(l=>({...l,dateRange:i,page:1}))},X=(i,l,c,v)=>{i.stopPropagation();const k=c.filter($=>$!==l);F($=>({...$,[v]:k,page:1}))},ae=ee(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:l,receiver:c}=I[i];return l?e.jsxs(C,{"data-cy":`member-name-${l.fullName}`,display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start",children:[e.jsx(nt,{src:`${l.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(he,{children:l.fullName})]},c):e.jsx(kt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:N.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(pe,{list:i,label:"Wallet",onDelete:(l,c)=>{l.stopPropagation(),X(l,c,ae[1].options.filterList,"walletSendStatus")}}),update:ve},filterOptions:{names:A,fullWidth:!0,logic:ye,display:(i,l,c,v)=>e.jsx(we,{label:"Wallet",filterList:i,onChange:l,index:c,column:v,filterValues:A})},customBodyRenderLite:i=>{const{walletSendStatus:l,walletSendAt:c,walletSendFailedReason:v}=I[i];return e.jsx(de,{status:l,updatedAt:c,reason:v,channel:"wallet",onResend:k=>w(k,I[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:l,pushKitSendAt:c,pushKitSendFailedReason:v}=I[i];return e.jsx(de,{status:l,updatedAt:c,reason:v,channel:"pushkit",onResend:k=>w(k,I[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:N.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(pe,{list:i,label:"Push Kit",onDelete:(l,c)=>{l.stopPropagation(),X(l,c,ae[2].options.filterList,"pushKitSendStatus")}}),update:ve},filterOptions:{names:A,fullWidth:!0,logic:ye,display:(i,l,c,v)=>e.jsx(we,{label:"Push Kit",filterList:i,onChange:l,index:c,column:v,filterValues:A})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:l,emailSendAt:c,emailSendFailedReason:v}=I[i];return e.jsx(de,{status:l,updatedAt:c,reason:v,channel:"email",onResend:k=>w(k,I[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:N.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(pe,{list:i,label:"Email",onDelete:(l,c)=>{l.stopPropagation(),X(l,c,ae[3].options.filterList,"emailSendStatus")}}),update:ve},filterOptions:{names:A,fullWidth:!0,logic:ye,display:(i,l,c,v)=>e.jsx(we,{label:"Email",filterList:i,onChange:l,index:c,column:v,filterValues:A})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:l}=I[i];if(!l)return null;const c=Object.entries(l)[0];if(!c)return null;const[v,k]=c,$=k[0];return e.jsx(C,{display:"flex",flexDirection:"column",gap:1,children:e.jsxs(C,{className:"webhook-item",fontSize:12,children:[e.jsx(he,{maxLength:30,children:v},v),e.jsx(de,{status:$.status,updatedAt:$.sendAt,reason:$.failedReason,channel:"webhook",onResend:K=>w(K,I[i],"webhook",[v],!1)})]},v)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:l}=I[i];return e.jsx(Be,{value:l,locale:o,shouldUpdate:!0})}}}],[I,o,N,r]),Ye=[e.jsx(Ue,{value:N.dateRange,onChange:Y},"date-picker"),e.jsx(De,{variant:"contained",size:"small",color:"primary",loading:y,startIcon:e.jsx(ut,{}),onClick:()=>_(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(C,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(ds,{children:e.jsxs(st,{theme:ht(),children:[e.jsx(at,{className:"receivers-table",locale:o,loading:y,columns:ae,data:I,onChange:z,options:Z,customButtons:Ye,components:{TableFilterList:i=>e.jsx($e,{...i,itemComponent:l=>e.jsx(Ce,{...l,canDelete:()=>!1})})}}),E.anchorEl&&e.jsx(Ee,{open:!!E.anchorEl,anchorReference:"anchorPosition",anchorPosition:E.position,onClose:f,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(us,{children:[e.jsxs(Q,{variant:"body1",component:"div",className:"check-title",children:[D==null?void 0:D.channel," Checking"]}),e.jsx(C,{display:"flex",flexDirection:"column",sx:{gap:"4px"},children:se(D==null?void 0:D.channel).map(i=>{var k,$;const{type:l,pass:c,fail:v}=i;return!(D!=null&&D.result)||(k=D==null?void 0:D.result)!=null&&k[l]?e.jsxs(Q,{variant:"body1",component:"div",className:"check-item",display:"flex",alignItems:"center",sx:{gap:"4px",color:($=D==null?void 0:D.result)!=null&&$[l]?je.success.main:"inherit"},children:[D!=null&&D.result?e.jsx(ct,{}):e.jsx(tt,{size:12,sx:{color:je.primary.main}}),e.jsx("span",{children:c})]},l):e.jsxs(Q,{variant:"body1",component:"div",display:"flex",alignItems:"center",className:"check-item",sx:{gap:"4px",color:je.error.main},children:[e.jsx(dt,{}),e.jsx("span",{children:v})]},l)})})]})}),L.anchorEl&&e.jsx(Ee,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:p,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(Ve,{loading:n,onCancel:p,onConfirm:j})})]})})})}const cs=b.memo(gt),ds=ce.div`
1
+ import{r as b}from"./vendor-react-DoD83n6N.js";import{j as e,H as d,a8 as Pe,ab as jt,T as Q,aa as C,E as _e,bo as ke,ce as et,bN as Te,bs as Re,bO as Ie,y as Se,b3 as Ee,a9 as tt,ag as ce,a1 as st,bg as Xe,br as vt,bn as yt,q as Je,bV as St}from"./vendor-mui-core-DxD1UA4o.js";import{c as ie,av as ue,A as Ct}from"./vendor-utils-CTIzdAFg.js";import{Y as J,p as P,b3 as Nt,r as Fe,f as wt,u as te,c4 as Tt,X as nt,B as De,a5 as at,bi as je,ak as Rt,aq as It,bM as Et}from"./vendor-ux-did-connect-CiLSrCOH.js";import{z as Dt,t as V,l as At,G as Qe}from"./index-CWohFZPl.js";import{f as ee,a as Ae}from"./vendor-hooks-BwVH-TAd.js";import{S as he}from"./shorten-label-CwDvu4_S.js";import{I as it}from"./index-BRz2myBK.js";import{A as Ot,S as Lt,a as Pt,b as _t}from"./list-BTx_8ZHD.js";import{R as Be}from"./relative-time-BBLaQUJf.js";import{b as ze}from"./dashboard-D3KvORmC.js";import{W as kt}from"./did-address-GAxLGeWB.js";import{p as ot}from"./util-Csa0tyHO.js";import{D as Ft,g as Bt}from"./traffic-CjCHxLye.js";import{i as zt,a as Wt,B as Mt}from"./index-Bx2tzf6d.js";import{B as rt}from"./bundle-avatar-CSEBu3MU.js";import"./lottie-web-B6s7dDoL.js";import"./vendor-arcblock-BtlDhznp.js";import"./index-D1fVmwHN.js";import"./InfoOutlined-DO0_Vjz-.js";import"./sdk-DRKovxXZ.js";import"./CheckCircle-B_wWOO2P.js";import"./index-D6v3bOtJ.js";import"./Location-B6FoL795.js";import"./Email-RGD-rKFl.js";import"./Timezone-bYzGwn3x.js";import"./useLocalStorage-BXnF_60k.js";import"./confirm-Fhl5qi_m.js";import"./format-error-LAoTjvJe.js";import"./PlayArrow-NjIpSDwJ.js";import"./get-safe-url-ZRaKUVld.js";import"./session-DaQ4KCFD.js";import"./useAsyncRetry-BBomZj1z.js";import"./useAsync-DKE0K0bz.js";import"./useSetState-BL3ktMon.js";import"./use-mobile-CHMVa8_W.js";import"./base32-CQfYcymN.js";import"./iframe-C4N_8Wwh.js";import"./LaunchOutlined-CkYWJcA9.js";import"./ChevronLeft-BdrBCIFt.js";import"./ChevronRight-CO9My6tF.js";import"./index-DzDfEcNp.js";import"./vendor-mui-x-Bit8yv3W.js";import"./AdapterDayjs-B7fWFwN5.js";const lt=b.createContext({}),{Provider:qt,Consumer:pn}=lt;function Kt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:o}}=Dt(),[a,x]=b.useState([]),[u,T]=b.useState({total:0,pageSize:20,pageCount:0,page:1}),m=ee(()=>{var h;return(h=s.meta)==null?void 0:h.did},[s]),[y,S]=b.useState([]),[I,M]=b.useState({}),E=ee(()=>a.length?new Set(a.map(h=>h.id)):new Set,[a]),L=async({page:h=1,pageSize:O=20,...A}={})=>{if(!m)return[];try{const _={paging:{page:h,pageSize:O},...A,teamDid:m,dateRange:A.dateRange?[V(A.dateRange[0]).toISOString(),V(A.dateRange[1]).toISOString()]:void 0},{dids:B,...q}=_;let Z="";B&&B.includes("system")&&(Z="system");const z=B?B.filter(f=>f!=="system"):[],oe={...q,source:Z,componentDids:z},se=await n.getNotificationSendLog({input:oe});return M(oe),x(se.list),T(se.paging),se.list}catch(_){return J.error(_.message),[]}},D=async()=>{const h=await n.getNotificationComponents({input:{teamDid:m}});S(h.componentDids)},G=b.useCallback(h=>{const O=s.children.find(A=>{var _;return((_=A.meta)==null?void 0:_.did)===h});if(O)return O.ancestors=[s],O},[s]),H=async({notificationId:h,receivers:O,channels:A,..._})=>{await n.resendNotification({input:{teamDid:m,notificationId:h,receivers:O,channels:A.map(B=>B==="wallet"?P.NOTIFICATION_SEND_CHANNEL.WALLET:B==="pushKit"?P.NOTIFICATION_SEND_CHANNEL.PUSH:B),..._}})},U=b.useCallback(async h=>(await n.getUser({input:{teamDid:m,user:{did:h}}})).user,[n,m]),N=b.useCallback(async({page:h=1,pageSize:O=20,...A}={})=>{try{const _={paging:{page:h,pageSize:O},...A,userName:A.searchText||"",teamDid:m,dateRange:A.dateRange?[V(A.dateRange[0]).toISOString(),V(A.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:_})}catch(_){throw J.error(_.message),_}},[n,m]);b.useEffect(()=>{m&&D()},[m]),o(P.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,h=>{E.has(h.notificationId)&&L(I)},[E,I]),o(P.EVENTS.NOTIFICATION_BLOCKLET_CREATE,h=>{E.has(h.id)||L(I)},[E,I]);const F={fetch:L,data:a,paging:u,blocklet:s,getComponent:G,resendNotification:H,getUser:U,componentDids:y,getReceivers:N,inService:r,teamDid:m};return e.jsx(qt,{value:{notificationRecords:F},children:t})}function We(){const{notificationRecords:t}=b.useContext(lt);return t}ge.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Ht={info:"primary",success:"success",error:"error",warning:"warning"};function ge({severity:t="info"}){return e.jsx(Nt,{type:Ht[t],children:t})}var Me={},Ut=Pe;Object.defineProperty(Me,"__esModule",{value:!0});var ct=Me.default=void 0,$t=Ut(Fe()),Vt=e;ct=Me.default=(0,$t.default)((0,Vt.jsx)("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"CheckCircleOutline");var qe={},Gt=Pe;Object.defineProperty(qe,"__esModule",{value:!0});var dt=qe.default=void 0,Yt=Gt(Fe()),Xt=e;dt=qe.default=(0,Yt.default)((0,Xt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"}),"Block");var Ke={},Jt=Pe;Object.defineProperty(Ke,"__esModule",{value:!0});var ut=Ke.default=void 0,Qt=Jt(Fe()),Zt=e;ut=Ke.default=(0,Qt.default)((0,Zt.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh");const es=(t,s,n="")=>{if(!n||!s)return"";switch(n){case P.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case P.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case P.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case P.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function pt(t,s,n={}){const{status:r,updatedAt:o,reason:a="",channel:x="wallet"}=n,u=o?t("notification.sendStatus.sentTime",{date:At(o,s)}):"",T=es(t,x,a);return r===P.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:u,reason:T}:r===P.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:t("notification.sendStatus.pending"),reason:T,sentTime:u}}const Oe={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Le=["wallet","pushKit","email"],Ze=["info","success","error","warning"],ft=t=>{var n,r;const{settings:s}=t;return(r=(n=s==null?void 0:s.notification)==null?void 0:n.email)==null?void 0:r.enabled},mt=t=>{var n,r;const{settings:s}=t;return(r=(n=s==null?void 0:s.notification)==null?void 0:n.pushKit)==null?void 0:r.enabled},ts=(t,s)=>{const n=ie(s,"extra.notifications.email",!0);return{available:ft(t),enabled:n}},ss=(t,s)=>{const n=ie(s,"extra.notifications.push",!0);return{available:mt(t),enabled:n}},ns=t=>({enabled:ie(t,"extra.notifications.wallet",!0)}),as=t=>({enabled:ie(t,"extra.webhooks",[]).length>0}),xe=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),is=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],be=(t=[])=>{const s=V().startOf("day");return t.filter(n=>V(n.sendAt).isSame(s,"day")).length},os=(t,s="")=>{if(s&&Le.includes(s)){const a=`${s}SendRecord`,x=ie(t,a,[]);return be(x)}const n=ie(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const a=n[s]??[];return be(a)}const o={};return Le.forEach(a=>{const x=`${a}SendRecord`,u=ie(t,x,[]),T=be(u);o[a]=T}),r.length>0&&r.forEach(a=>{const x=n[a]??[],u=be(x);o[a]=u}),o},ve=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},ye=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},rs=t=>{switch(t){case P.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case P.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case P.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case P.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ht=()=>wt({typography:{fontSize:14,button:{textTransform:"none"}},components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function ne({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r}){const{status:o,title:a="",sentTime:x="",reason:u=""}=t,T=[a,u].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(Q,{color:"inherit",sx:{fontSize:12},children:T}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(C,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(C,{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center",children:[e.jsx(C,{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Oe[o],style:{opacity:.15}}),e.jsx(C,{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Oe[o]})]}),e.jsx(Q,{color:"inherit",sx:{fontSize:12},children:n?a:r})]})})}ne.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};ne.defaultProps={enableTooltip:!0,showTitle:!1,children:null};pe.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};pe.defaultProps={onDelete:()=>{}};function pe({list:t,label:s,onDelete:n}){const{t:r,locale:o}=te();return e.jsxs(C,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(Q,{children:[s,": "]}),t.map(a=>{const x=pt(r,o,{status:a});return e.jsx(_e,{size:"small",label:e.jsx(C,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(ne,{config:x,enableTooltip:!1,children:x.title})}),onDelete:u=>n(u,a)},a)})]})}He.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function He({filterList:t,onChange:s,index:n,column:r,filterValues:o,label:a,renderLabel:x}){return e.jsxs(ke,{className:"filter-container",children:[e.jsx(et,{component:"legend",children:a}),e.jsx(Te,{row:!0,children:o.map(u=>e.jsx(Re,{control:e.jsx(Ie,{checked:t[n].indexOf(u.value??u)>-1,onChange:T=>{const m=[...t];T.target.checked?m[n]=[...m[n],u.value??u]:m[n]=m[n].filter(y=>y!==(u.value??u)),s(m[n],n,r)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(u)})},u.value??u))})]})}function we(t){return e.jsx(He,{...t,renderLabel:s=>e.jsx(ne,{enableTooltip:!1,config:{status:s.status},children:s.label})})}de.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function de({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:o}){const{t:a,locale:x}=te(),u=pt(a,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(C,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(ne,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(Se,{className:"resend-btn",size:"small",startIcon:e.jsx(ze,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:o,children:a("notification.resend")})]})}Ue.propTypes={value:d.array.isRequired,onChange:d.func};function Ue({value:t,onChange:s}){const{locale:n}=te(),r=V().toDate(),[o,a]=b.useState(null),x=b.useCallback(m=>{a(o?null:m.currentTarget)},[o]),u=!!o,T=b.useCallback(m=>{if(!m.startDate||!m.endDate){J.error("Please select a date range");return}if(V(m.startDate).isAfter(m.endDate)||!V(m.startDate).isValid()||!V(m.endDate).isValid()){J.error("Invalid date range");return}s([m.startDate,m.endDate]),a(null)},[s]);return e.jsxs("div",{children:[e.jsx(Q,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:0,children:e.jsxs(Se,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[Qe(t[0],n)," - ",Qe(t[1],n)]})}),e.jsx(Ee,{open:u,anchorEl:o,onClose:()=>{a(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Ft,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Bt(r),onChange:T})})]})}$e.propTypes={itemComponent:d.elementType.isRequired};function $e({itemComponent:t,...s}){var o;const{t:n}=te();return!((o=s==null?void 0:s.filterList)!=null&&o.filter(a=>a.length).length)?null:e.jsxs(C,{display:"flex",gap:1,alignItems:"center",children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(Tt.TableFilterList,{...s,ItemComponent:t})})]})}function Ce({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const o=s&&typeof s=="function"?s:void 0;let a=!0;return n&&typeof n=="function"&&(a=n({label:t,...r})),e.jsx(_e,{label:t,variant:"outlined",...o&&a?{onDelete:o}:{}})}Ce.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};Ce.defaultProps={canDelete:()=>!0};const ls=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];Ve.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};Ve.defaultProps={loading:!1,onCancel:()=>{},onConfirm:()=>{}};function Ve({loading:t=!1,onCancel:s,onConfirm:n}){const{t:r}=te(),[o,a]=b.useState(ls),[x,u]=b.useState(!0),T=(y,S)=>{S.checked=y.target.checked;const I=o.map(M=>({...M,checked:M.value===S.value?S.checked:M.checked}));a(I)},m=y=>{y.stopPropagation(),n({channels:o.filter(S=>S.checked).map(S=>S.value),isResendFailedOnly:x})};return e.jsxs(C,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(Q,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(C,{className:"choose-channel",children:e.jsxs(ke,{component:"fieldset",variant:"standard",children:[e.jsx(et,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:o.map(y=>e.jsx(Re,{control:e.jsx(Ie,{checked:y.checked,onChange:S=>T(S,y),name:y.value}),label:y.label},y.value))})]})}),e.jsx(C,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Re,{control:e.jsx(Ie,{checked:x,onChange:y=>u(y.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(C,{display:"flex",justifyContent:"flex-end",gap:1,className:"resend-config-footer-tip",children:[e.jsx(Se,{onClick:y=>{y.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Se,{onClick:m,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(tt,{size:16}),r("common.confirm")]})]})]})}gt.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function gt({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:o}=te(),{getReceivers:a,inService:x,teamDid:u,getUser:T,blocklet:m}=We(),[y,S]=b.useState(!1),[I,M]=b.useState([]),E=Ae({anchorEl:null,position:null}),L=Ae({anchorEl:null,position:null}),[D,G]=b.useState(null),[H,U]=b.useState({total:0,pageSize:10,pageCount:0,page:1}),[N,F]=b.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[V().subtract(1,"month").startOf("day").toDate(),V().endOf("day").toDate()]}),[h,O]=b.useState([]),A=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],_=async()=>{if(!y&&t)try{S(!0);const i=await a({notificationId:t,...N}),l=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:ot(c.receiverUser.avatar,u,x)}}));M(l),U(i.paging),S(!1)}catch(i){J.error(i.message),S(!1)}};b.useEffect(()=>{_()},[N]);const B=i=>{i.stopPropagation();const l=i.currentTarget;L.anchorEl=l;const c=l.getBoundingClientRect();L.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},q=i=>i.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(De,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(ze,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:B,children:r("notification.resend")})}):null,Z={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:H.page-1,rowsPerPage:H.pageSize,count:H.total,searchText:N.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:h,onRowSelectionChange:(i,l)=>{O(l.map(c=>c.dataIndex))},customToolbarSelect:q},z=({page:i,rowsPerPage:l,searchText:c,filterList:v})=>{const[,k=[],$=[],K=[]]=v;N.pageSize!==l?F(W=>({...W,pageSize:l,page:1})):N.page!==i+1?F(W=>({...W,page:i+1})):N.searchText!==c?F(W=>({...W,searchText:c,page:1})):ue(k,N.walletSendStatus)?ue($,N.pushKitSendStatus)?ue(K,N.emailSendStatus)||F(W=>({...W,emailSendStatus:K,page:1})):F(W=>({...W,pushKitSendStatus:$,page:1})):F(W=>({...W,walletSendStatus:k,page:1}))},oe=b.useCallback(async(i,l)=>{if(!l)return!1;const c=await T(l);return c?i==="wallet"?ns(c):i==="email"?ts(m,c):i==="pushKit"?ss(m,c):i==="webhook"?as(c):!0:!1},[T,m]),se=b.useCallback(i=>is(r,i),[r]),f=()=>{E.anchorEl=null,E.position=null,G(null)},p=()=>{L.anchorEl=null,L.position=null},g=async(i,l,c=!0,v="")=>{if(!(!l.length||!i.length))try{s(i,l,c,v),L.anchorEl||(await xe(.5),f())}catch(k){console.error("handleResend error",{error:k})}},j=async({channels:i,isResendFailedOnly:l})=>{const c=h.map(v=>I[v].receiver);await g(i,c,l),await xe(.5),p(),O([])},R=async(i,l=[],c=!0)=>{try{await g(["webhook"],[i.receiver],c,l)}catch(v){J.error(v.response?v.response.statusText:v.message)}},w=async(i,l,c,v=[],k=!0)=>{if(i.stopPropagation(),os(l,c)>=4){J.warning(r("notification.resendLimit"));return}if(!Le.includes(c)){await R(l,v,k);return}if(i){const K=i.currentTarget,W=K.getBoundingClientRect();E.anchorEl=K,E.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}G({channel:c});try{const K=await oe(c,l.receiver);await xe(1),G({channel:c,result:K}),(typeof K=="boolean"&&K||Ct(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[l.receiver],k),L.anchorEl||(await xe(.5),f()))}catch(K){J.error(K.message)}},Y=i=>{F(l=>({...l,dateRange:i,page:1}))},X=(i,l,c,v)=>{i.stopPropagation();const k=c.filter($=>$!==l);F($=>({...$,[v]:k,page:1}))},ae=ee(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:l,receiver:c}=I[i];return l?e.jsxs(C,{"data-cy":`member-name-${l.fullName}`,display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start",children:[e.jsx(nt,{src:`${l.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(he,{children:l.fullName})]},c):e.jsx(kt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:N.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(pe,{list:i,label:"Wallet",onDelete:(l,c)=>{l.stopPropagation(),X(l,c,ae[1].options.filterList,"walletSendStatus")}}),update:ve},filterOptions:{names:A,fullWidth:!0,logic:ye,display:(i,l,c,v)=>e.jsx(we,{label:"Wallet",filterList:i,onChange:l,index:c,column:v,filterValues:A})},customBodyRenderLite:i=>{const{walletSendStatus:l,walletSendAt:c,walletSendFailedReason:v}=I[i];return e.jsx(de,{status:l,updatedAt:c,reason:v,channel:"wallet",onResend:k=>w(k,I[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:l,pushKitSendAt:c,pushKitSendFailedReason:v}=I[i];return e.jsx(de,{status:l,updatedAt:c,reason:v,channel:"pushkit",onResend:k=>w(k,I[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:N.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(pe,{list:i,label:"Push Kit",onDelete:(l,c)=>{l.stopPropagation(),X(l,c,ae[2].options.filterList,"pushKitSendStatus")}}),update:ve},filterOptions:{names:A,fullWidth:!0,logic:ye,display:(i,l,c,v)=>e.jsx(we,{label:"Push Kit",filterList:i,onChange:l,index:c,column:v,filterValues:A})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:l,emailSendAt:c,emailSendFailedReason:v}=I[i];return e.jsx(de,{status:l,updatedAt:c,reason:v,channel:"email",onResend:k=>w(k,I[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:N.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(pe,{list:i,label:"Email",onDelete:(l,c)=>{l.stopPropagation(),X(l,c,ae[3].options.filterList,"emailSendStatus")}}),update:ve},filterOptions:{names:A,fullWidth:!0,logic:ye,display:(i,l,c,v)=>e.jsx(we,{label:"Email",filterList:i,onChange:l,index:c,column:v,filterValues:A})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:l}=I[i];if(!l)return null;const c=Object.entries(l)[0];if(!c)return null;const[v,k]=c,$=k[0];return e.jsx(C,{display:"flex",flexDirection:"column",gap:1,children:e.jsxs(C,{className:"webhook-item",fontSize:12,children:[e.jsx(he,{maxLength:30,children:v},v),e.jsx(de,{status:$.status,updatedAt:$.sendAt,reason:$.failedReason,channel:"webhook",onResend:K=>w(K,I[i],"webhook",[v],!1)})]},v)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:l}=I[i];return e.jsx(Be,{value:l,locale:o,shouldUpdate:!0})}}}],[I,o,N,r]),Ye=[e.jsx(Ue,{value:N.dateRange,onChange:Y},"date-picker"),e.jsx(De,{variant:"contained",size:"small",color:"primary",loading:y,startIcon:e.jsx(ut,{}),onClick:()=>_(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(C,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(ds,{children:e.jsxs(st,{theme:ht(),children:[e.jsx(at,{className:"receivers-table",locale:o,loading:y,columns:ae,data:I,onChange:z,options:Z,customButtons:Ye,components:{TableFilterList:i=>e.jsx($e,{...i,itemComponent:l=>e.jsx(Ce,{...l,canDelete:()=>!1})})}}),E.anchorEl&&e.jsx(Ee,{open:!!E.anchorEl,anchorReference:"anchorPosition",anchorPosition:E.position,onClose:f,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(us,{children:[e.jsxs(Q,{variant:"body1",component:"div",className:"check-title",children:[D==null?void 0:D.channel," Checking"]}),e.jsx(C,{display:"flex",flexDirection:"column",sx:{gap:"4px"},children:se(D==null?void 0:D.channel).map(i=>{var k,$;const{type:l,pass:c,fail:v}=i;return!(D!=null&&D.result)||(k=D==null?void 0:D.result)!=null&&k[l]?e.jsxs(Q,{variant:"body1",component:"div",className:"check-item",display:"flex",alignItems:"center",sx:{gap:"4px",color:($=D==null?void 0:D.result)!=null&&$[l]?je.success.main:"inherit"},children:[D!=null&&D.result?e.jsx(ct,{}):e.jsx(tt,{size:12,sx:{color:je.primary.main}}),e.jsx("span",{children:c})]},l):e.jsxs(Q,{variant:"body1",component:"div",display:"flex",alignItems:"center",className:"check-item",sx:{gap:"4px",color:je.error.main},children:[e.jsx(dt,{}),e.jsx("span",{children:v})]},l)})})]})}),L.anchorEl&&e.jsx(Ee,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:p,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(Ve,{loading:n,onCancel:p,onConfirm:j})})]})})})}const cs=b.memo(gt),ds=ce.div`
2
2
  td.MuiTableCell-footer {
3
3
  border: none !important;
4
4
  }
@@ -1,4 +1,4 @@
1
- import{r as h}from"./vendor-react-DoD83n6N.js";import{u as R,p as _,B as N,a$ as me,ak as ee,b1 as de,bM as pe,cg as ue,a5 as fe}from"./vendor-ux-did-connect-DOjsg91L.js";import{B as xe,Q as P}from"./vendor-arcblock-ACo-BN0q.js";import{r as te}from"./passport-item-BY6VS7Ot.js";import{z,l as I,ay as ge,C as ye,f as he}from"./index-BPa_QtWl.js";import{u as L}from"./dashboard-vsk4QHJ1.js";import{j as e,ak as F,O as U,bo as se,br as ne,bn as oe,q as ae,aa as f,a9 as q,H as y,bs as Ce,bO as je,ag as B,ab as W,T as $,aj as be}from"./vendor-mui-core-DxD1UA4o.js";import{T as re}from"./index-BmexzVQt.js";import{C as ie}from"./confirm-_RIb3OmR.js";import{C as J}from"./click-to-copy-BxZJa7n5.js";import{D as ke}from"./delete-confirm-DaoAi4Gz.js";import{d as Ae}from"./Edit-D2RQMivt.js";import{P as Ke}from"./permission-DKFJEWNH.js";import{m as we,G as ve}from"./vendor-hooks-BwVH-TAd.js";import{C as Se,I as Te,U as De}from"./index-4rY7Xp2W.js";import{B as Ie}from"./bundle-avatar-woUZoGoi.js";import{p as Re}from"./util-DkIhTuT7.js";import{W as X}from"./did-address-CGHn52xI.js";import{f as Be}from"./format-error-LAoTjvJe.js";import"./vendor-utils-CTIzdAFg.js";import"./lottie-web-B6s7dDoL.js";import"./useLocalStorage-DKl7XFfI.js";import"./PlayArrow-D38lbyGo.js";import"./get-safe-url-DW2Z07ex.js";import"./index-xa5W6ExD.js";import"./session-DB9Du-lc.js";import"./useAsyncRetry-BBomZj1z.js";import"./useAsync-DKE0K0bz.js";import"./InfoOutlined-DSoJjRQo.js";import"./useSetState-BL3ktMon.js";import"./use-mobile-CHMVa8_W.js";import"./vendor-mui-x-Bit8yv3W.js";import"./AdapterDayjs-BLBXeg9J.js";import"./shorten-label-CwDvu4_S.js";import"./Location-B6FoL795.js";import"./Email-RGD-rKFl.js";import"./Timezone-bYzGwn3x.js";import"./base32-BhlNgZPk.js";function M(n){const{remark:s,onCreate:x}=n,{api:k}=z(),{teamDid:u}=L(),{t:c}=R(),[l,a]=h.useState(!1),[i,m]=h.useState(null),j=_.RBAC_CONFIG.roles.filter(o=>o.passport&&o.name!==_.ROLES.OWNER),C=()=>{a(!1),m(null)},p=async o=>{const{remark:v,passport:K}=o;a(!0);const t=await k.createAccessKey({input:{teamDid:u,remark:v.trim(),passport:K,expireAt:o.expireAt?new Date(o.expireAt).getTime():null}}),{data:w}=t;x(w),m(null),a(!1)},d={title:`${c("common.create")} ${c("accessKey")}`,description:(o,v,K)=>e.jsxs(F,{gap:3,children:[e.jsx(U,{label:c("setting.accessKey.tip"),autoComplete:"off",variant:"outlined",name:"remark",inputProps:{"data-cy":"remark-input"},fullWidth:!0,autoFocus:!0,margin:"dense",value:o.remark,onChange:t=>{v({...o,remark:t.target.value,__disableConfirm:!o.passport||!t.target.value.trim()}),t.target.value.trim()?K(""):K(c("setting.accessKey.remarkInvalid"))}}),e.jsxs(se,{style:{width:"100%"},variant:"outlined",children:[e.jsx(ne,{children:c("setting.accessKey.passport")}),e.jsx(oe,{"data-cy":"create-access-key-select-passport",value:o.passport,onChange:t=>{const w=t.target.value;K(null),v({...o,passport:w,__disableConfirm:!o.remark||!w})},fullWidth:!0,label:c("setting.accessKey.passport"),disabled:l,children:j.map(t=>e.jsx(ae,{value:t.name,"data-cy":`create-access-key-passport-option-${t.name}`,children:e.jsxs(f,{children:[e.jsx("span",{children:t.title||t.name}),e.jsx(f,{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify",children:t.description})]})},t.name))})]}),e.jsx(re,{placeholder:c("setting.accessKey.expireTime"),value:o.expireAt,onChange:t=>{v({...o,expireAt:t,__disableConfirm:!o.passport||!o.remark||!t})}})]}),confirm:c("common.confirm"),cancel:c("common.cancel"),color:"primary",params:{remark:s,__disableConfirm:!s.trim()},onConfirm:p,onCancel:C};return e.jsxs(e.Fragment,{children:[e.jsxs(N,{edge:"end",variant:"contained",color:"primary","data-cy":"add-access-key-btn",onClick:()=>m(d),className:"rule-action",children:[l?e.jsx(q,{size:16}):e.jsx(xe,{style:{fontSize:16}}),c("common.create")]}),i&&e.jsx(ie,{title:i.title,description:i.description,confirm:i.confirm,color:i.color,cancel:i.cancel,params:i.params,onConfirm:i.onConfirm,onCancel:i.onCancel})]})}M.propTypes={remark:y.string,onCreate:y.func};M.defaultProps={onCreate:()=>{},remark:""};function O(n){const{onConfirm:s,accessKeyId:x,accessKeySecret:k}=n,{t:u}=h.useContext(me),[c,l]=h.useState(!1),[a,i]=h.useState(!0),m=()=>{i(!a)},j=C=>{l(C.target.checked)};return e.jsxs(ee,{title:u("common.createSuccess"),fullWidth:!0,open:!0,disableEscapeKeyDown:!0,onClose:s,showCloseButton:!1,actions:e.jsx("div",{children:e.jsx(N,{disabled:!c,onClick:s,color:"primary",autoFocus:!0,variant:"contained","data-cy":"submit-confirm-dialog",children:u("common.confirm")})}),"aria-labelledby":"simple-dialog-title",children:[e.jsx("div",{children:e.jsx(_e,{children:u("setting.accessKey.saveSecretTip")})}),e.jsx("div",{style:{marginTop:"20px"}}),e.jsxs(Z,{children:[e.jsx(Y,{children:"Access Key"}),e.jsx(J,{children:x})]}),e.jsxs(Z,{children:[e.jsx(Y,{children:"Access Secret"}),a?e.jsx(N,{"data-cy":"show-secret-btn",color:"primary",onClick:m,children:u("setting.accessKey.showSecret")}):e.jsx(J,{children:k})]}),e.jsx("div",{children:e.jsx(Ce,{value:"end",disabled:a,control:e.jsx(je,{checked:c,onChange:j}),label:u("setting.accessKey.iKnow"),labelPlacement:"end"})})]})}O.propTypes={accessKeyId:y.string.isRequired,accessKeySecret:y.string.isRequired,onConfirm:y.func};O.defaultProps={onConfirm:()=>{}};const Y=B.div`
1
+ import{r as h}from"./vendor-react-DoD83n6N.js";import{u as R,p as _,B as N,a$ as me,ak as ee,b1 as de,bM as pe,cg as ue,a5 as fe}from"./vendor-ux-did-connect-CiLSrCOH.js";import{B as xe,Q as P}from"./vendor-arcblock-BtlDhznp.js";import{r as te}from"./passport-item-BEGCAq1O.js";import{z,l as I,ay as ge,C as ye,f as he}from"./index-CWohFZPl.js";import{u as L}from"./dashboard-D3KvORmC.js";import{j as e,ak as F,O as U,bo as se,br as ne,bn as oe,q as ae,aa as f,a9 as q,H as y,bs as Ce,bO as je,ag as B,ab as W,T as $,aj as be}from"./vendor-mui-core-DxD1UA4o.js";import{T as re}from"./index-uHTdpm71.js";import{C as ie}from"./confirm-Fhl5qi_m.js";import{C as J}from"./click-to-copy-Cygm8U3_.js";import{D as ke}from"./delete-confirm-Dtzz6Jaz.js";import{d as Ae}from"./Edit-C1mcIe4c.js";import{P as Ke}from"./permission-C5Df-sxb.js";import{m as we,G as ve}from"./vendor-hooks-BwVH-TAd.js";import{C as Se,I as Te,U as De}from"./index-D6v3bOtJ.js";import{B as Ie}from"./bundle-avatar-CSEBu3MU.js";import{p as Re}from"./util-Csa0tyHO.js";import{W as X}from"./did-address-GAxLGeWB.js";import{f as Be}from"./format-error-LAoTjvJe.js";import"./vendor-utils-CTIzdAFg.js";import"./lottie-web-B6s7dDoL.js";import"./useLocalStorage-BXnF_60k.js";import"./PlayArrow-NjIpSDwJ.js";import"./get-safe-url-ZRaKUVld.js";import"./index-Bx2tzf6d.js";import"./session-DaQ4KCFD.js";import"./useAsyncRetry-BBomZj1z.js";import"./useAsync-DKE0K0bz.js";import"./InfoOutlined-DO0_Vjz-.js";import"./useSetState-BL3ktMon.js";import"./use-mobile-CHMVa8_W.js";import"./vendor-mui-x-Bit8yv3W.js";import"./AdapterDayjs-B7fWFwN5.js";import"./shorten-label-CwDvu4_S.js";import"./Location-B6FoL795.js";import"./Email-RGD-rKFl.js";import"./Timezone-bYzGwn3x.js";import"./base32-CQfYcymN.js";function M(n){const{remark:s,onCreate:x}=n,{api:k}=z(),{teamDid:u}=L(),{t:c}=R(),[l,a]=h.useState(!1),[i,m]=h.useState(null),j=_.RBAC_CONFIG.roles.filter(o=>o.passport&&o.name!==_.ROLES.OWNER),C=()=>{a(!1),m(null)},p=async o=>{const{remark:v,passport:K}=o;a(!0);const t=await k.createAccessKey({input:{teamDid:u,remark:v.trim(),passport:K,expireAt:o.expireAt?new Date(o.expireAt).getTime():null}}),{data:w}=t;x(w),m(null),a(!1)},d={title:`${c("common.create")} ${c("accessKey")}`,description:(o,v,K)=>e.jsxs(F,{gap:3,children:[e.jsx(U,{label:c("setting.accessKey.tip"),autoComplete:"off",variant:"outlined",name:"remark",inputProps:{"data-cy":"remark-input"},fullWidth:!0,autoFocus:!0,margin:"dense",value:o.remark,onChange:t=>{v({...o,remark:t.target.value,__disableConfirm:!o.passport||!t.target.value.trim()}),t.target.value.trim()?K(""):K(c("setting.accessKey.remarkInvalid"))}}),e.jsxs(se,{style:{width:"100%"},variant:"outlined",children:[e.jsx(ne,{children:c("setting.accessKey.passport")}),e.jsx(oe,{"data-cy":"create-access-key-select-passport",value:o.passport,onChange:t=>{const w=t.target.value;K(null),v({...o,passport:w,__disableConfirm:!o.remark||!w})},fullWidth:!0,label:c("setting.accessKey.passport"),disabled:l,children:j.map(t=>e.jsx(ae,{value:t.name,"data-cy":`create-access-key-passport-option-${t.name}`,children:e.jsxs(f,{children:[e.jsx("span",{children:t.title||t.name}),e.jsx(f,{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify",children:t.description})]})},t.name))})]}),e.jsx(re,{placeholder:c("setting.accessKey.expireTime"),value:o.expireAt,onChange:t=>{v({...o,expireAt:t,__disableConfirm:!o.passport||!o.remark||!t})}})]}),confirm:c("common.confirm"),cancel:c("common.cancel"),color:"primary",params:{remark:s,__disableConfirm:!s.trim()},onConfirm:p,onCancel:C};return e.jsxs(e.Fragment,{children:[e.jsxs(N,{edge:"end",variant:"contained",color:"primary","data-cy":"add-access-key-btn",onClick:()=>m(d),className:"rule-action",children:[l?e.jsx(q,{size:16}):e.jsx(xe,{style:{fontSize:16}}),c("common.create")]}),i&&e.jsx(ie,{title:i.title,description:i.description,confirm:i.confirm,color:i.color,cancel:i.cancel,params:i.params,onConfirm:i.onConfirm,onCancel:i.onCancel})]})}M.propTypes={remark:y.string,onCreate:y.func};M.defaultProps={onCreate:()=>{},remark:""};function O(n){const{onConfirm:s,accessKeyId:x,accessKeySecret:k}=n,{t:u}=h.useContext(me),[c,l]=h.useState(!1),[a,i]=h.useState(!0),m=()=>{i(!a)},j=C=>{l(C.target.checked)};return e.jsxs(ee,{title:u("common.createSuccess"),fullWidth:!0,open:!0,disableEscapeKeyDown:!0,onClose:s,showCloseButton:!1,actions:e.jsx("div",{children:e.jsx(N,{disabled:!c,onClick:s,color:"primary",autoFocus:!0,variant:"contained","data-cy":"submit-confirm-dialog",children:u("common.confirm")})}),"aria-labelledby":"simple-dialog-title",children:[e.jsx("div",{children:e.jsx(_e,{children:u("setting.accessKey.saveSecretTip")})}),e.jsx("div",{style:{marginTop:"20px"}}),e.jsxs(Z,{children:[e.jsx(Y,{children:"Access Key"}),e.jsx(J,{children:x})]}),e.jsxs(Z,{children:[e.jsx(Y,{children:"Access Secret"}),a?e.jsx(N,{"data-cy":"show-secret-btn",color:"primary",onClick:m,children:u("setting.accessKey.showSecret")}):e.jsx(J,{children:k})]}),e.jsx("div",{children:e.jsx(Ce,{value:"end",disabled:a,control:e.jsx(je,{checked:c,onChange:j}),label:u("setting.accessKey.iKnow"),labelPlacement:"end"})})]})}O.propTypes={accessKeyId:y.string.isRequired,accessKeySecret:y.string.isRequired,onConfirm:y.func};O.defaultProps={onConfirm:()=>{}};const Y=B.div`
2
2
  display: flex;
3
3
  justify-content: space-between;
4
4
  align-items: center;
@@ -1 +1 @@
1
- import{H as g,j as o,bl as re,ao as G,s as B,w as ie,aa as D,T as U,y as oe}from"./vendor-mui-core-DxD1UA4o.js";import{y as L,z as $,x as ae}from"./vendor-utils-CTIzdAFg.js";import{c as C}from"./vendor-arcblock-ACo-BN0q.js";import{z as le,R as ce,O as de}from"./index-BPa_QtWl.js";import{r as q,b as pe,g as Y}from"./vendor-react-DoD83n6N.js";import{f as A,u as W}from"./vendor-hooks-BwVH-TAd.js";import{p as ue,o as E,h as me}from"./vendor-ux-did-connect-DOjsg91L.js";const _=(e,t)=>{var s;let r="?v=";return t?r+=ce(t):r+=`${(s=e==null?void 0:e.meta)==null?void 0:s.version}${de(e==null?void 0:e.status)?"~":""}`,r};function fe({blocklet:e}){var p,m,S,O,w,j,K;const{inService:t}=le(),r=(p=((e==null?void 0:e.environments)||[]).find(x=>x.key===C.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE))==null?void 0:p.value,s=(m=((e==null?void 0:e.environments)||[]).find(x=>x.key===C.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_RECT))==null?void 0:m.value,n=(S=((e==null?void 0:e.environments)||[]).find(x=>x.key===C.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_FAVICON))==null?void 0:S.value,i=(O=((e==null?void 0:e.environments)||[]).find(x=>x.key===C.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPLASH_PORTRAIT))==null?void 0:O.value,l=(w=((e==null?void 0:e.environments)||[]).find(x=>x.key===C.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPLASH_LANDSCAPE))==null?void 0:w.value,c=(j=((e==null?void 0:e.environments)||[]).find(x=>x.key===C.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_OG_IMAGE))==null?void 0:j.value,a=((K=window.env)==null?void 0:K.apiPrefix)||"/",u=`${L(a,`/blocklet/logo/${t?"":e.meta.did}`)}${_(e,r)}`,d=`${L(a,`/blocklet/logo-rect/${t?"":e.meta.did}`)}${_(e,s??r)}`,y=`${L(a,`/blocklet/logo-favicon/${t?"":e.meta.did}`)}${_(e,n??r)}`,h=`${L(a,`/blocklet/splash/portrait/${t?"":e.meta.did}`)}${_(e,i)}`,v=`${L(a,`/blocklet/splash/landscape/${t?"":e.meta.did}`)}${_(e,l)}`,f=`${L(a,`/blocklet/og-image/${t?"":e.meta.did}`)}${_(e,c)}`;return{logoUrl:u,rectLogoUrl:d,faviconUrl:y,splashPortraitUrl:h,splashLandscapeUrl:v,ogImageUrl:f}}function V({blocklet:e,style:t,size:r,...s}){const{logoUrl:n}=fe({blocklet:e}),{variant:i}=s;return o.jsx(re,{variant:i||"square",style:Object.assign({backgroundColor:"transparent",width:r,height:r,borderRadius:10},t),...s,children:o.jsx("img",{src:n,alt:"",style:{width:r}})})}V.propTypes={blocklet:g.object.isRequired,style:g.object,size:g.oneOfType([g.number,g.string])};V.defaultProps={style:{},size:40};const et=e=>{if(!e||!e.length)return[];const t=[];let r=null,s=[];if(e.forEach(n=>{var v,f,p,m;if(!n.activity||!n.activity.type||!r){r&&(s.length===1?t.push(s[0]):(r.items=s,t.push(r))),n.activity&&n.activity.type?(r=n,s=[n]):(t.push(n),r=null,s=[]);return}const i=s[0].activity,l=i.type,c=(v=i.target)==null?void 0:v.type,a=(f=i.target)==null?void 0:f.id,u=n.activity.type,d=(p=n.activity.target)==null?void 0:p.type,y=(m=n.activity.target)==null?void 0:m.id;if(l&&u&&l===u&&(!i.target&&!n.activity.target||i.target&&n.activity.target&&c===d&&a===y))s.push(n);else{if(s.length===1)t.push(s[0]);else{const S=Object.assign({},r,{items:s});t.push(S)}r=n,s=[n]}}),r)if(s.length===1)t.push(s[0]);else{const n=Object.assign({},r,{items:s});t.push(n)}return t},he=e=>!$(e.activity)&&!!e.activity.type&&!!e.activity.actor,tt=e=>he(e)&&!!e.actorInfo&&!!e.actorInfo.did,nt=e=>{const{severity:t}=e||{};return t&&["normal","success","info"].includes(t)},ge=e=>{if(!e)return null;const{meta:t,target:r}=e;return{metaLink:t==null?void 0:t.id,targetLink:r==null?void 0:r.id}},N={COMMENT:"comment",LIKE:"like",FOLLOW:"follow",TIPS:"tips",MENTION:"mention",ASSIGN:"assign"},ye={[N.COMMENT]:(e,t)=>t>1?o.jsxs(o.Fragment,{children:["left ",t," comments on your ",e]}):o.jsxs(o.Fragment,{children:["commented on your ",e]}),[N.LIKE]:e=>o.jsxs(o.Fragment,{children:["liked your ",e]}),[N.FOLLOW]:()=>o.jsx(o.Fragment,{children:"followed you"}),[N.TIPS]:e=>o.jsxs(o.Fragment,{children:["gave tips to your ",e]}),[N.MENTION]:e=>o.jsxs(o.Fragment,{children:["mentioned you in ",e]}),[N.ASSIGN]:()=>o.jsx(o.Fragment,{children:"assigned you a task"})},T=q.memo(function({user:t,color:r=E.textBase}){const s=ae(L(ue.WELLKNOWN_SERVICE_PATH_PREFIX,"user"),{did:t.did});return o.jsx(G,{href:s,color:r,fontWeight:600,target:"_blank",sx:{textDecoration:"none"},onClick:n=>{n.customPreventRedirect=!0},children:t.fullName||"System"})});T.propTypes={user:g.shape({did:g.string.isRequired,fullName:g.string.isRequired}).isRequired,color:g.string};T.displayName="UserLink";function st({activity:e,users:t,actors:r,extra:s={},mountPoint:n=""}){const{type:i,target:l}=e||{},{type:c}=l||{},{linkColor:a=E.textBase}=s||{},u=A(()=>{if(!Array.isArray(t))return new Map;const p=new Map;return t.forEach(m=>{m!=null&&m.did&&!p.has(m.did)&&p.set(m.did,m)}),p},[t]),d=A(()=>Array.isArray(r)?r.map(p=>p?u.get(p)||{did:p,fullName:"System"}:null):[],[r,u]),y=W(()=>{if(!Array.isArray(d)||d.length===0)return null;if(d.length===1)return o.jsx(T,{user:d[0],color:a});const p=d.slice(0,-1),m=d[d.length-1];if(d.length===2)return o.jsxs(o.Fragment,{children:[o.jsx(T,{user:p[0],color:a})," and ",o.jsx(T,{user:m,color:a})]});const S=d.length>3,O=S?d.slice(0,2):p;return o.jsxs(o.Fragment,{children:[O.map((w,j)=>o.jsxs(pe.Fragment,{children:[o.jsx(T,{user:w,color:a}),j<O.length-1?", ":""]},w.did)),S?`, and ${d.length-2} others`:o.jsxs(o.Fragment,{children:[", and ",o.jsx(T,{user:m,color:a})]})]})}),h=W(()=>{const p=ye[i];return p?p(c,t.length):null}),v=A(()=>{const p=y(),m=h();return!p||!m?null:o.jsxs(o.Fragment,{children:[p," ",m]})},[i,c,d,y,h]),f=A(()=>{if(!e)return null;const p=ge(e);return p!=null&&p.targetLink?L(n,p.targetLink):null},[e,n]);return!i||$(l)?null:o.jsxs(o.Fragment,{children:[v," ",o.jsx(G,{href:f,color:E.primaryBase,target:"_blank",sx:{textDecoration:"none"},onClick:p=>{p.customPreventRedirect=!0},children:l.name})]})}const ve={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 7L7 17M8 7h9v9"/>'};Q.propTypes={meta:g.object.isRequired};const xe=B(ie)(({theme:e})=>({maxWidth:320,display:"flex",flexDirection:"column",gap:e.spacing(1.5),padding:e.spacing(2),marginTop:e.spacing(1),borderRadius:e.spacing(1),border:`1px solid ${E.dividerColor}`,boxShadow:"none"})),Le=B(D)(({theme:e})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",gap:e.spacing(1),marginBottom:e.spacing(1)})),Ee=B(D)({display:"flex",justifyContent:"space-between",alignItems:"center"});function Q({meta:e}){const{amount:t,symbol:r,chainId:s}=e,n=()=>{window.open(`https://explorer.arcblock.io/chain/${s}`,"_blank")};return o.jsxs(xe,{children:[o.jsxs(Le,{children:[o.jsx("img",{alt:"ArcBlock Beta",src:"https://bbqat7g5cg33cyr4pdrd6foycgzfb5xxeh2se7gcqkq.did.abtnet.io/payment-kit/methods/arcblock.png",width:32,height:32,style:{borderRadius:16}}),o.jsx(U,{variant:"h5",color:E.textBase,children:"ArcBlock"})]}),o.jsxs(Ee,{children:[o.jsxs(D,{display:"flex",alignItems:"baseline",gap:1,children:[o.jsxs(U,{component:"span",variant:"h5",color:E.textBase,fontWeight:"bold",children:["+ ",t]}),o.jsx(U,{component:"span",variant:"subtitle2",color:E.textSubtitle,children:r})]}),o.jsx(oe,{variant:"outlined",size:"small",color:"secondary",endIcon:o.jsx(me,{icon:ve}),onClick:n,sx:{borderRadius:4},children:"View on Chain"})]})]})}X.propTypes={meta:g.object.isRequired,type:g.string.isRequired,hideTips:g.bool,sx:g.object};X.defaultProps={hideTips:!1,sx:{}};function X({meta:e,type:t,hideTips:r=!1,sx:s}){return $(e)?null:t==="tips"&&!r?o.jsx(Q,{meta:e}):o.jsx(U,{variant:"subtitle2",fontSize:16,component:"p",sx:s,color:E.textSubtitle,children:e.content})}var Se=q;function Te(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var b=Te(Se);function F(){return F=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},F.apply(this,arguments)}function Ce(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,R(e,t)}function R(e,t){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,n){return s.__proto__=n,s},R(e,t)}function _e(e,t){if(e==null)return{};var r={},s=Object.keys(e),n,i;for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&(r[n]=e[n]);return r}var z={position:"absolute",bottom:0,left:0,height:0,overflow:"hidden","padding-top":0,"padding-bottom":0,border:"none"},Ne=["box-sizing","width","font-size","font-weight","font-family","font-style","letter-spacing","text-indent","white-space","word-break","overflow-wrap","padding-left","padding-right"];function Oe(e,t){if(!e||typeof e!="object")return e;var r={};return Object.keys(e).forEach(function(s){t.indexOf(s)>-1||(r[s]=e[s])}),r}var we=["component","className","unsafeHTML"];function Z(e,t){if(t!=="letters"&&t!=="words")throw new Error("Unsupported options basedOn: "+t);if(e.nodeType===Node.TEXT_NODE){var r=document.createDocumentFragment(),s;switch(t){case"words":s=e.textContent.split(/\b|(?=\W)/);break;case"letters":s=Array.from(e.textContent);break}s.forEach(function(c){r.appendChild(Me(c))}),e.parentNode.replaceChild(r,e)}else if(e.nodeType===Node.ELEMENT_NODE)for(var n=[].slice.call(e.childNodes),i=n.length,l=0;l<i;l++)Z(n[l],t)}function Me(e){var t=document.createElement("span");return t.className="LinesEllipsis-unit",t.textContent=e,t}function k(e){e.parentNode.replaceChild(document.createTextNode(e.textContent),e)}function J(e,t){if(!(!t.contains(e)||e===t)){for(;e.nextElementSibling;)e.parentNode.removeChild(e.nextElementSibling);J(e.parentNode,t)}}function je(e){for(var t=e;t=t.parentNode;)if(/p|div|main|section|h\d|ul|ol|li/.test(t.tagName.toLowerCase()))return t}function I(e){return!!(e.offsetHeight&&(e.offsetWidth||/\S/.test(e.textContent)))}var ee={component:"div",unsafeHTML:"",maxLine:1,ellipsis:"…",ellipsisHTML:void 0,className:"",basedOn:void 0,onReflow:function(){},winWidth:void 0},Ae=Object.keys(ee),te=function(e){Ce(t,e);function t(s){var n;return n=e.call(this,s)||this,n.state={html:s.unsafeHTML,clamped:!1},n.canvas=null,n.maxLine=0,n.nlUnits=[],n}var r=t.prototype;return r.componentDidMount=function(){this.initCanvas(),this.reflow(this.props)},r.componentDidUpdate=function(n){n.winWidth!==this.props.winWidth&&this.copyStyleToCanvas(),this.props!==n&&this.reflow(this.props)},r.componentWillUnmount=function(){this.canvas.parentNode.removeChild(this.canvas),this.canvas=null},r.setState=function(n,i){return typeof n.clamped<"u"&&(this.clamped=n.clamped),e.prototype.setState.call(this,n,i)},r.initCanvas=function(){if(!this.canvas){var n=this.canvas=document.createElement("div");n.className="LinesEllipsis-canvas "+this.props.className,n.setAttribute("aria-hidden","true"),this.copyStyleToCanvas(),Object.keys(z).forEach(function(i){n.style[i]=z[i]}),document.body.appendChild(n)}},r.copyStyleToCanvas=function(){var n=this,i=window.getComputedStyle(this.target);Ne.forEach(function(l){n.canvas.style[l]=i[l]})},r.reflow=function(n){this.maxLine=+n.maxLine||1,this.canvas.innerHTML=n.unsafeHTML;var i=n.basedOn||(/^[\x00-\x7F]+$/.test(n.unsafeHTML)?"words":"letters");Z(this.canvas,i);var l=this.putEllipsis(this.calcIndexes()),c={clamped:l,html:this.canvas.innerHTML};this.setState(c,n.onReflow.bind(this,c))},r.calcIndexes=function(){var n=[0],i=this.nlUnits=Array.from(this.canvas.querySelectorAll(".LinesEllipsis-unit")),l=i.length;if(!i.length)return n;var c=i.find(I);if(!c)return n;for(var a=1,u=c.offsetTop,d=1;d<l&&!(I(i[d])&&i[d].offsetTop-u>1&&(a++,n.push(d),u=i[d].offsetTop,a>this.maxLine));d++);return n},r.putEllipsis=function(n){if(n.length<=this.maxLine)return!1;this.nlUnits=this.nlUnits.slice(0,n[this.maxLine]);var i=this.nlUnits.pop(),l=this.makeEllipsisSpan();do J(i,this.canvas),je(i).appendChild(l),i=this.nlUnits.pop();while(i&&(!I(i)||l.offsetHeight>i.offsetHeight||l.offsetTop>i.offsetTop));return i&&k(i),this.nlUnits.forEach(k),!0},r.makeEllipsisSpan=function(){var n=this.props,i=n.ellipsisHTML,l=n.ellipsis,c=document.createElement("span");c.appendChild(document.createElement("wbr"));var a=document.createElement("span");return a.className="LinesEllipsis-ellipsis",i?a.innerHTML=i:a.textContent=l,c.appendChild(a),c},r.isClamped=function(){return this.clamped},r.render=function(){var n=this,i=this.state,l=i.html,c=i.clamped,a=this.props,u=a.component,d=a.className,y=a.unsafeHTML,h=_e(a,we);return b.default.createElement(u,F({className:"LinesEllipsis "+(c?"LinesEllipsis--clamped":"")+" "+d,ref:function(f){return n.target=f}},Oe(h,Ae)),b.default.createElement("div",{dangerouslySetInnerHTML:{__html:c?l:y}}))},t}(b.default.Component);te.defaultProps=ee;var Ue=te;const rt=Y(Ue),be=e=>{const t="explorer.arcblockio.cn";return e&&{beta:"beta.abtnetwork.io",main:"main.abtnetwork.io"}[e]||t},Ie=e=>{try{return new URL(e).host}catch{return e}};var it={getChainHost:be,getUrlHost:Ie},ot={linkStyle:{color:"#2754C5",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",fontSize:"14px",textDecoration:"underline"},actionsStyle:{margin:"20px -8px 0px"},actionStyle:{color:"#4598fa",fontSize:14,border:"1px solid #4598fa",display:"inline-block",borderRadius:"4px",margin:"8px",marginTop:"8px",marginBottom:"8px",marginLeft:"8px",marginRight:"8px"},assetStyle:{backgroundColor:"#f6f6f6",borderRadius:"8px",padding:"8px"},remarkStyle:{color:"#9397a1",fontSize:"12px",margin:0,whiteSpace:"pre-line!important"},summaryStyle:{color:"#49c3ad",fontWeight:700},titleStyle:{marginBottom:"6px"},severityColorMap:{normal:"#C4C5CA",success:"#25C99B",error:"#F16E6E",warning:"#DE9E37"},attachmentsStyle:{borderLeft:"2px solid transparent",paddingLeft:"20px"},h1Style:{color:"#333",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",fontSize:"24px",fontWeight:"bold",margin:"40px 0",padding:"0"},footerStyle:{color:"#898989",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",fontSize:"12px",lineHeight:"22px",margin:0}},Fe={year:{long:"year",short:"y"},day:{long:"day",short:"d"},hour:{long:"hour",short:"h"},minute:{long:"minute",short:"m"},second:{long:"second",short:"s"},millisecond:{long:"millisecond",short:"ms"},microsecond:{long:"microsecond",short:"µs"},nanosecond:{long:"nanosecond",short:"ns"}},Re={year:{long:"年",short:"年"},day:{long:"天",short:"天"},hour:{long:"小时",short:"小时"},minute:{long:"分钟",short:"分"},second:{long:"秒钟",short:"秒"},millisecond:{long:"毫秒",short:"毫秒"},microsecond:{long:"微秒",short:"微秒"},nanosecond:{long:"纳秒",short:"纳秒"}};const P=new Map,Pe=(e,t)=>{P.set(e,t)},Be=(e="en_US")=>P.get(e)||P.get("en_US");var ne={registerLang:Pe,getLang:Be},De=e=>{if(typeof e!="number")throw new TypeError("Expected a number");const t=e>0?Math.floor:Math.ceil;return{days:t(e/864e5),hours:t(e/36e5)%24,minutes:t(e/6e4)%60,seconds:t(e/1e3)%60,milliseconds:t(e)%1e3,microseconds:t(e*1e3)%1e3,nanoseconds:t(e*1e6)%1e3}};const $e=De,{getLang:M}=ne,He=(e,t)=>t===1?e:`${e}s`,Ke=1e-7;var We=(e,t={})=>{if(!Number.isFinite(e))throw new TypeError("Expected a finite number");t.colonNotation&&(t.compact=!1,t.formatSubMilliseconds=!1,t.separateMilliseconds=!1,t.verbose=!1),t.compact&&(t.secondsDecimalDigits=0,t.millisecondsDecimalDigits=0);const r=M(t.locale),s=[],n=(c,a)=>{const u=Math.floor(c*10**a+Ke);return(Math.round(u)/10**a).toFixed(a)},i=(c,a,u)=>{if((s.length===0||!t.colonNotation)&&c===0&&!(t.colonNotation&&a==="minute"))return;const{long:d}=r[a]||M("en_US")[a],{short:y}=r[a]||M("en_US")[a];let h=(u||c||"0").toString(),v,f;if(t.colonNotation){v=s.length>0?":":"",f="";const p=h.includes(".")?h.split(".")[0].length:h.length,m=s.length>0?2:1;h="0".repeat(Math.max(0,m-p))+h}else v="",t.locale==="zh_CN"?Object.values(l).filter(p=>p>0).length>1?!l.days&&!l.hours&&l.minutes&&t.compact?f=d:f=y:l.minutes?f=d:f=y:f=t.verbose?` ${He(d,c)}`:y;s.push(v+h+f)},l=$e(e);if(i(Math.trunc(l.days/365),"year"),i(l.days%365,"day"),i(l.hours,"hour"),i(l.minutes,"minute"),t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3)if(i(l.seconds,"second"),t.formatSubMilliseconds)i(l.milliseconds,"millisecond"),i(l.microseconds,"microsecond"),i(l.nanoseconds,"nanosecond");else{const c=l.milliseconds+l.microseconds/1e3+l.nanoseconds/1e6,a=typeof t.millisecondsDecimalDigits=="number"?t.millisecondsDecimalDigits:0,u=c>=1?Math.round(c):Math.ceil(c),d=a?c.toFixed(a):u;i(Number.parseFloat(d,10),"millisecond",d)}else{const c=e/1e3%60,a=typeof t.secondsDecimalDigits=="number"?t.secondsDecimalDigits:1,u=n(c,a),d=t.keepDecimalsOnWholeSeconds?u:u.replace(/\.0+$/,"");i(Number.parseFloat(d,10),"second",d)}if(s.length===0){const c=(r.millisecond||M("en_US").millisecond).long,a=(r.millisecond||M("en_US").millisecond).short;return t.locale==="zh_CN"?`0${t.verbose?`${c}`:a}`:`0${t.verbose?` ${c}s`:a}`}if(t.compact)return s[0];if(typeof t.unitCount=="number"){const c=t.colonNotation?"":" ";return s.slice(0,Math.max(t.unitCount,1)).join(c)}return t.colonNotation?s.join(""):s.join(" ")};const ze=Fe,ke=Re,{registerLang:H}=ne,se=We;H("en_US",ze);H("zh_CN",ke);se.registerLang=H;var Ge=se;const at=Y(Ge);export{V as B,rt as H,X as M,tt as a,nt as b,it as c,ve as d,fe as e,ge as g,he as i,et as m,at as p,ot as s,st as u};
1
+ import{H as g,j as o,bl as re,ao as G,s as B,w as ie,aa as D,T as U,y as oe}from"./vendor-mui-core-DxD1UA4o.js";import{y as L,z as $,x as ae}from"./vendor-utils-CTIzdAFg.js";import{c as C}from"./vendor-arcblock-BtlDhznp.js";import{z as le,R as ce,O as de}from"./index-CWohFZPl.js";import{r as q,b as pe,g as Y}from"./vendor-react-DoD83n6N.js";import{f as A,u as W}from"./vendor-hooks-BwVH-TAd.js";import{p as ue,o as E,h as me}from"./vendor-ux-did-connect-CiLSrCOH.js";const _=(e,t)=>{var s;let r="?v=";return t?r+=ce(t):r+=`${(s=e==null?void 0:e.meta)==null?void 0:s.version}${de(e==null?void 0:e.status)?"~":""}`,r};function fe({blocklet:e}){var p,m,S,O,w,j,K;const{inService:t}=le(),r=(p=((e==null?void 0:e.environments)||[]).find(x=>x.key===C.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE))==null?void 0:p.value,s=(m=((e==null?void 0:e.environments)||[]).find(x=>x.key===C.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_RECT))==null?void 0:m.value,n=(S=((e==null?void 0:e.environments)||[]).find(x=>x.key===C.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_FAVICON))==null?void 0:S.value,i=(O=((e==null?void 0:e.environments)||[]).find(x=>x.key===C.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPLASH_PORTRAIT))==null?void 0:O.value,l=(w=((e==null?void 0:e.environments)||[]).find(x=>x.key===C.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPLASH_LANDSCAPE))==null?void 0:w.value,c=(j=((e==null?void 0:e.environments)||[]).find(x=>x.key===C.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_OG_IMAGE))==null?void 0:j.value,a=((K=window.env)==null?void 0:K.apiPrefix)||"/",u=`${L(a,`/blocklet/logo/${t?"":e.meta.did}`)}${_(e,r)}`,d=`${L(a,`/blocklet/logo-rect/${t?"":e.meta.did}`)}${_(e,s??r)}`,y=`${L(a,`/blocklet/logo-favicon/${t?"":e.meta.did}`)}${_(e,n??r)}`,h=`${L(a,`/blocklet/splash/portrait/${t?"":e.meta.did}`)}${_(e,i)}`,v=`${L(a,`/blocklet/splash/landscape/${t?"":e.meta.did}`)}${_(e,l)}`,f=`${L(a,`/blocklet/og-image/${t?"":e.meta.did}`)}${_(e,c)}`;return{logoUrl:u,rectLogoUrl:d,faviconUrl:y,splashPortraitUrl:h,splashLandscapeUrl:v,ogImageUrl:f}}function V({blocklet:e,style:t,size:r,...s}){const{logoUrl:n}=fe({blocklet:e}),{variant:i}=s;return o.jsx(re,{variant:i||"square",style:Object.assign({backgroundColor:"transparent",width:r,height:r,borderRadius:10},t),...s,children:o.jsx("img",{src:n,alt:"",style:{width:r}})})}V.propTypes={blocklet:g.object.isRequired,style:g.object,size:g.oneOfType([g.number,g.string])};V.defaultProps={style:{},size:40};const et=e=>{if(!e||!e.length)return[];const t=[];let r=null,s=[];if(e.forEach(n=>{var v,f,p,m;if(!n.activity||!n.activity.type||!r){r&&(s.length===1?t.push(s[0]):(r.items=s,t.push(r))),n.activity&&n.activity.type?(r=n,s=[n]):(t.push(n),r=null,s=[]);return}const i=s[0].activity,l=i.type,c=(v=i.target)==null?void 0:v.type,a=(f=i.target)==null?void 0:f.id,u=n.activity.type,d=(p=n.activity.target)==null?void 0:p.type,y=(m=n.activity.target)==null?void 0:m.id;if(l&&u&&l===u&&(!i.target&&!n.activity.target||i.target&&n.activity.target&&c===d&&a===y))s.push(n);else{if(s.length===1)t.push(s[0]);else{const S=Object.assign({},r,{items:s});t.push(S)}r=n,s=[n]}}),r)if(s.length===1)t.push(s[0]);else{const n=Object.assign({},r,{items:s});t.push(n)}return t},he=e=>!$(e.activity)&&!!e.activity.type&&!!e.activity.actor,tt=e=>he(e)&&!!e.actorInfo&&!!e.actorInfo.did,nt=e=>{const{severity:t}=e||{};return t&&["normal","success","info"].includes(t)},ge=e=>{if(!e)return null;const{meta:t,target:r}=e;return{metaLink:t==null?void 0:t.id,targetLink:r==null?void 0:r.id}},N={COMMENT:"comment",LIKE:"like",FOLLOW:"follow",TIPS:"tips",MENTION:"mention",ASSIGN:"assign"},ye={[N.COMMENT]:(e,t)=>t>1?o.jsxs(o.Fragment,{children:["left ",t," comments on your ",e]}):o.jsxs(o.Fragment,{children:["commented on your ",e]}),[N.LIKE]:e=>o.jsxs(o.Fragment,{children:["liked your ",e]}),[N.FOLLOW]:()=>o.jsx(o.Fragment,{children:"followed you"}),[N.TIPS]:e=>o.jsxs(o.Fragment,{children:["gave tips to your ",e]}),[N.MENTION]:e=>o.jsxs(o.Fragment,{children:["mentioned you in ",e]}),[N.ASSIGN]:()=>o.jsx(o.Fragment,{children:"assigned you a task"})},T=q.memo(function({user:t,color:r=E.textBase}){const s=ae(L(ue.WELLKNOWN_SERVICE_PATH_PREFIX,"user"),{did:t.did});return o.jsx(G,{href:s,color:r,fontWeight:600,target:"_blank",sx:{textDecoration:"none"},onClick:n=>{n.customPreventRedirect=!0},children:t.fullName||"System"})});T.propTypes={user:g.shape({did:g.string.isRequired,fullName:g.string.isRequired}).isRequired,color:g.string};T.displayName="UserLink";function st({activity:e,users:t,actors:r,extra:s={},mountPoint:n=""}){const{type:i,target:l}=e||{},{type:c}=l||{},{linkColor:a=E.textBase}=s||{},u=A(()=>{if(!Array.isArray(t))return new Map;const p=new Map;return t.forEach(m=>{m!=null&&m.did&&!p.has(m.did)&&p.set(m.did,m)}),p},[t]),d=A(()=>Array.isArray(r)?r.map(p=>p?u.get(p)||{did:p,fullName:"System"}:null):[],[r,u]),y=W(()=>{if(!Array.isArray(d)||d.length===0)return null;if(d.length===1)return o.jsx(T,{user:d[0],color:a});const p=d.slice(0,-1),m=d[d.length-1];if(d.length===2)return o.jsxs(o.Fragment,{children:[o.jsx(T,{user:p[0],color:a})," and ",o.jsx(T,{user:m,color:a})]});const S=d.length>3,O=S?d.slice(0,2):p;return o.jsxs(o.Fragment,{children:[O.map((w,j)=>o.jsxs(pe.Fragment,{children:[o.jsx(T,{user:w,color:a}),j<O.length-1?", ":""]},w.did)),S?`, and ${d.length-2} others`:o.jsxs(o.Fragment,{children:[", and ",o.jsx(T,{user:m,color:a})]})]})}),h=W(()=>{const p=ye[i];return p?p(c,t.length):null}),v=A(()=>{const p=y(),m=h();return!p||!m?null:o.jsxs(o.Fragment,{children:[p," ",m]})},[i,c,d,y,h]),f=A(()=>{if(!e)return null;const p=ge(e);return p!=null&&p.targetLink?L(n,p.targetLink):null},[e,n]);return!i||$(l)?null:o.jsxs(o.Fragment,{children:[v," ",o.jsx(G,{href:f,color:E.primaryBase,target:"_blank",sx:{textDecoration:"none"},onClick:p=>{p.customPreventRedirect=!0},children:l.name})]})}const ve={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 7L7 17M8 7h9v9"/>'};Q.propTypes={meta:g.object.isRequired};const xe=B(ie)(({theme:e})=>({maxWidth:320,display:"flex",flexDirection:"column",gap:e.spacing(1.5),padding:e.spacing(2),marginTop:e.spacing(1),borderRadius:e.spacing(1),border:`1px solid ${E.dividerColor}`,boxShadow:"none"})),Le=B(D)(({theme:e})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",gap:e.spacing(1),marginBottom:e.spacing(1)})),Ee=B(D)({display:"flex",justifyContent:"space-between",alignItems:"center"});function Q({meta:e}){const{amount:t,symbol:r,chainId:s}=e,n=()=>{window.open(`https://explorer.arcblock.io/chain/${s}`,"_blank")};return o.jsxs(xe,{children:[o.jsxs(Le,{children:[o.jsx("img",{alt:"ArcBlock Beta",src:"https://bbqat7g5cg33cyr4pdrd6foycgzfb5xxeh2se7gcqkq.did.abtnet.io/payment-kit/methods/arcblock.png",width:32,height:32,style:{borderRadius:16}}),o.jsx(U,{variant:"h5",color:E.textBase,children:"ArcBlock"})]}),o.jsxs(Ee,{children:[o.jsxs(D,{display:"flex",alignItems:"baseline",gap:1,children:[o.jsxs(U,{component:"span",variant:"h5",color:E.textBase,fontWeight:"bold",children:["+ ",t]}),o.jsx(U,{component:"span",variant:"subtitle2",color:E.textSubtitle,children:r})]}),o.jsx(oe,{variant:"outlined",size:"small",color:"secondary",endIcon:o.jsx(me,{icon:ve}),onClick:n,sx:{borderRadius:4},children:"View on Chain"})]})]})}X.propTypes={meta:g.object.isRequired,type:g.string.isRequired,hideTips:g.bool,sx:g.object};X.defaultProps={hideTips:!1,sx:{}};function X({meta:e,type:t,hideTips:r=!1,sx:s}){return $(e)?null:t==="tips"&&!r?o.jsx(Q,{meta:e}):o.jsx(U,{variant:"subtitle2",fontSize:16,component:"p",sx:s,color:E.textSubtitle,children:e.content})}var Se=q;function Te(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var b=Te(Se);function F(){return F=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},F.apply(this,arguments)}function Ce(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,R(e,t)}function R(e,t){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,n){return s.__proto__=n,s},R(e,t)}function _e(e,t){if(e==null)return{};var r={},s=Object.keys(e),n,i;for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&(r[n]=e[n]);return r}var z={position:"absolute",bottom:0,left:0,height:0,overflow:"hidden","padding-top":0,"padding-bottom":0,border:"none"},Ne=["box-sizing","width","font-size","font-weight","font-family","font-style","letter-spacing","text-indent","white-space","word-break","overflow-wrap","padding-left","padding-right"];function Oe(e,t){if(!e||typeof e!="object")return e;var r={};return Object.keys(e).forEach(function(s){t.indexOf(s)>-1||(r[s]=e[s])}),r}var we=["component","className","unsafeHTML"];function Z(e,t){if(t!=="letters"&&t!=="words")throw new Error("Unsupported options basedOn: "+t);if(e.nodeType===Node.TEXT_NODE){var r=document.createDocumentFragment(),s;switch(t){case"words":s=e.textContent.split(/\b|(?=\W)/);break;case"letters":s=Array.from(e.textContent);break}s.forEach(function(c){r.appendChild(Me(c))}),e.parentNode.replaceChild(r,e)}else if(e.nodeType===Node.ELEMENT_NODE)for(var n=[].slice.call(e.childNodes),i=n.length,l=0;l<i;l++)Z(n[l],t)}function Me(e){var t=document.createElement("span");return t.className="LinesEllipsis-unit",t.textContent=e,t}function k(e){e.parentNode.replaceChild(document.createTextNode(e.textContent),e)}function J(e,t){if(!(!t.contains(e)||e===t)){for(;e.nextElementSibling;)e.parentNode.removeChild(e.nextElementSibling);J(e.parentNode,t)}}function je(e){for(var t=e;t=t.parentNode;)if(/p|div|main|section|h\d|ul|ol|li/.test(t.tagName.toLowerCase()))return t}function I(e){return!!(e.offsetHeight&&(e.offsetWidth||/\S/.test(e.textContent)))}var ee={component:"div",unsafeHTML:"",maxLine:1,ellipsis:"…",ellipsisHTML:void 0,className:"",basedOn:void 0,onReflow:function(){},winWidth:void 0},Ae=Object.keys(ee),te=function(e){Ce(t,e);function t(s){var n;return n=e.call(this,s)||this,n.state={html:s.unsafeHTML,clamped:!1},n.canvas=null,n.maxLine=0,n.nlUnits=[],n}var r=t.prototype;return r.componentDidMount=function(){this.initCanvas(),this.reflow(this.props)},r.componentDidUpdate=function(n){n.winWidth!==this.props.winWidth&&this.copyStyleToCanvas(),this.props!==n&&this.reflow(this.props)},r.componentWillUnmount=function(){this.canvas.parentNode.removeChild(this.canvas),this.canvas=null},r.setState=function(n,i){return typeof n.clamped<"u"&&(this.clamped=n.clamped),e.prototype.setState.call(this,n,i)},r.initCanvas=function(){if(!this.canvas){var n=this.canvas=document.createElement("div");n.className="LinesEllipsis-canvas "+this.props.className,n.setAttribute("aria-hidden","true"),this.copyStyleToCanvas(),Object.keys(z).forEach(function(i){n.style[i]=z[i]}),document.body.appendChild(n)}},r.copyStyleToCanvas=function(){var n=this,i=window.getComputedStyle(this.target);Ne.forEach(function(l){n.canvas.style[l]=i[l]})},r.reflow=function(n){this.maxLine=+n.maxLine||1,this.canvas.innerHTML=n.unsafeHTML;var i=n.basedOn||(/^[\x00-\x7F]+$/.test(n.unsafeHTML)?"words":"letters");Z(this.canvas,i);var l=this.putEllipsis(this.calcIndexes()),c={clamped:l,html:this.canvas.innerHTML};this.setState(c,n.onReflow.bind(this,c))},r.calcIndexes=function(){var n=[0],i=this.nlUnits=Array.from(this.canvas.querySelectorAll(".LinesEllipsis-unit")),l=i.length;if(!i.length)return n;var c=i.find(I);if(!c)return n;for(var a=1,u=c.offsetTop,d=1;d<l&&!(I(i[d])&&i[d].offsetTop-u>1&&(a++,n.push(d),u=i[d].offsetTop,a>this.maxLine));d++);return n},r.putEllipsis=function(n){if(n.length<=this.maxLine)return!1;this.nlUnits=this.nlUnits.slice(0,n[this.maxLine]);var i=this.nlUnits.pop(),l=this.makeEllipsisSpan();do J(i,this.canvas),je(i).appendChild(l),i=this.nlUnits.pop();while(i&&(!I(i)||l.offsetHeight>i.offsetHeight||l.offsetTop>i.offsetTop));return i&&k(i),this.nlUnits.forEach(k),!0},r.makeEllipsisSpan=function(){var n=this.props,i=n.ellipsisHTML,l=n.ellipsis,c=document.createElement("span");c.appendChild(document.createElement("wbr"));var a=document.createElement("span");return a.className="LinesEllipsis-ellipsis",i?a.innerHTML=i:a.textContent=l,c.appendChild(a),c},r.isClamped=function(){return this.clamped},r.render=function(){var n=this,i=this.state,l=i.html,c=i.clamped,a=this.props,u=a.component,d=a.className,y=a.unsafeHTML,h=_e(a,we);return b.default.createElement(u,F({className:"LinesEllipsis "+(c?"LinesEllipsis--clamped":"")+" "+d,ref:function(f){return n.target=f}},Oe(h,Ae)),b.default.createElement("div",{dangerouslySetInnerHTML:{__html:c?l:y}}))},t}(b.default.Component);te.defaultProps=ee;var Ue=te;const rt=Y(Ue),be=e=>{const t="explorer.arcblockio.cn";return e&&{beta:"beta.abtnetwork.io",main:"main.abtnetwork.io"}[e]||t},Ie=e=>{try{return new URL(e).host}catch{return e}};var it={getChainHost:be,getUrlHost:Ie},ot={linkStyle:{color:"#2754C5",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",fontSize:"14px",textDecoration:"underline"},actionsStyle:{margin:"20px -8px 0px"},actionStyle:{color:"#4598fa",fontSize:14,border:"1px solid #4598fa",display:"inline-block",borderRadius:"4px",margin:"8px",marginTop:"8px",marginBottom:"8px",marginLeft:"8px",marginRight:"8px"},assetStyle:{backgroundColor:"#f6f6f6",borderRadius:"8px",padding:"8px"},remarkStyle:{color:"#9397a1",fontSize:"12px",margin:0,whiteSpace:"pre-line!important"},summaryStyle:{color:"#49c3ad",fontWeight:700},titleStyle:{marginBottom:"6px"},severityColorMap:{normal:"#C4C5CA",success:"#25C99B",error:"#F16E6E",warning:"#DE9E37"},attachmentsStyle:{borderLeft:"2px solid transparent",paddingLeft:"20px"},h1Style:{color:"#333",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",fontSize:"24px",fontWeight:"bold",margin:"40px 0",padding:"0"},footerStyle:{color:"#898989",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",fontSize:"12px",lineHeight:"22px",margin:0}},Fe={year:{long:"year",short:"y"},day:{long:"day",short:"d"},hour:{long:"hour",short:"h"},minute:{long:"minute",short:"m"},second:{long:"second",short:"s"},millisecond:{long:"millisecond",short:"ms"},microsecond:{long:"microsecond",short:"µs"},nanosecond:{long:"nanosecond",short:"ns"}},Re={year:{long:"年",short:"年"},day:{long:"天",short:"天"},hour:{long:"小时",short:"小时"},minute:{long:"分钟",short:"分"},second:{long:"秒钟",short:"秒"},millisecond:{long:"毫秒",short:"毫秒"},microsecond:{long:"微秒",short:"微秒"},nanosecond:{long:"纳秒",short:"纳秒"}};const P=new Map,Pe=(e,t)=>{P.set(e,t)},Be=(e="en_US")=>P.get(e)||P.get("en_US");var ne={registerLang:Pe,getLang:Be},De=e=>{if(typeof e!="number")throw new TypeError("Expected a number");const t=e>0?Math.floor:Math.ceil;return{days:t(e/864e5),hours:t(e/36e5)%24,minutes:t(e/6e4)%60,seconds:t(e/1e3)%60,milliseconds:t(e)%1e3,microseconds:t(e*1e3)%1e3,nanoseconds:t(e*1e6)%1e3}};const $e=De,{getLang:M}=ne,He=(e,t)=>t===1?e:`${e}s`,Ke=1e-7;var We=(e,t={})=>{if(!Number.isFinite(e))throw new TypeError("Expected a finite number");t.colonNotation&&(t.compact=!1,t.formatSubMilliseconds=!1,t.separateMilliseconds=!1,t.verbose=!1),t.compact&&(t.secondsDecimalDigits=0,t.millisecondsDecimalDigits=0);const r=M(t.locale),s=[],n=(c,a)=>{const u=Math.floor(c*10**a+Ke);return(Math.round(u)/10**a).toFixed(a)},i=(c,a,u)=>{if((s.length===0||!t.colonNotation)&&c===0&&!(t.colonNotation&&a==="minute"))return;const{long:d}=r[a]||M("en_US")[a],{short:y}=r[a]||M("en_US")[a];let h=(u||c||"0").toString(),v,f;if(t.colonNotation){v=s.length>0?":":"",f="";const p=h.includes(".")?h.split(".")[0].length:h.length,m=s.length>0?2:1;h="0".repeat(Math.max(0,m-p))+h}else v="",t.locale==="zh_CN"?Object.values(l).filter(p=>p>0).length>1?!l.days&&!l.hours&&l.minutes&&t.compact?f=d:f=y:l.minutes?f=d:f=y:f=t.verbose?` ${He(d,c)}`:y;s.push(v+h+f)},l=$e(e);if(i(Math.trunc(l.days/365),"year"),i(l.days%365,"day"),i(l.hours,"hour"),i(l.minutes,"minute"),t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3)if(i(l.seconds,"second"),t.formatSubMilliseconds)i(l.milliseconds,"millisecond"),i(l.microseconds,"microsecond"),i(l.nanoseconds,"nanosecond");else{const c=l.milliseconds+l.microseconds/1e3+l.nanoseconds/1e6,a=typeof t.millisecondsDecimalDigits=="number"?t.millisecondsDecimalDigits:0,u=c>=1?Math.round(c):Math.ceil(c),d=a?c.toFixed(a):u;i(Number.parseFloat(d,10),"millisecond",d)}else{const c=e/1e3%60,a=typeof t.secondsDecimalDigits=="number"?t.secondsDecimalDigits:1,u=n(c,a),d=t.keepDecimalsOnWholeSeconds?u:u.replace(/\.0+$/,"");i(Number.parseFloat(d,10),"second",d)}if(s.length===0){const c=(r.millisecond||M("en_US").millisecond).long,a=(r.millisecond||M("en_US").millisecond).short;return t.locale==="zh_CN"?`0${t.verbose?`${c}`:a}`:`0${t.verbose?` ${c}s`:a}`}if(t.compact)return s[0];if(typeof t.unitCount=="number"){const c=t.colonNotation?"":" ";return s.slice(0,Math.max(t.unitCount,1)).join(c)}return t.colonNotation?s.join(""):s.join(" ")};const ze=Fe,ke=Re,{registerLang:H}=ne,se=We;H("en_US",ze);H("zh_CN",ke);se.registerLang=H;var Ge=se;const at=Y(Ge);export{V as B,rt as H,X as M,tt as a,nt as b,it as c,ve as d,fe as e,ge as g,he as i,et as m,at as p,ot as s,st as u};