@abtnode/blocklet-services 1.16.40 → 1.16.41-beta-20250316-103544-0b61aa75

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 (161) hide show
  1. package/api/routes/user-session.js +53 -68
  2. package/dist/assets/{ArrowDropDown-DTIUpsvU.js → ArrowDropDown-D5FaOpLc.js} +1 -1
  3. package/dist/assets/{CheckCircle-CzzpsT-_.js → CheckCircle-BXzkxp2w.js} +1 -1
  4. package/dist/assets/{ChevronLeft-CTD-h_rc.js → ChevronLeft-Df5JfrLj.js} +1 -1
  5. package/dist/assets/{ChevronRight-DPlXp_5c.js → ChevronRight-CK3mt0BF.js} +1 -1
  6. package/dist/assets/{Community-B9oZizyM.js → Community-BJ5wbECZ.js} +1 -1
  7. package/dist/assets/{DeleteOutline-w4Yzs8Ot.js → DeleteOutline-C3bSgd5L.js} +1 -1
  8. package/dist/assets/{Done-Dx6K5vD2.js → Done-CiWu790H.js} +1 -1
  9. package/dist/assets/{Download-DEOALcDO.js → Download-Au6yJEFS.js} +1 -1
  10. package/dist/assets/{EditIcon-BlhLB0P5.js → EditIcon-SYuT6kHe.js} +1 -1
  11. package/dist/assets/{Email-BrpJu5nR.js → Email-BWlcFaBq.js} +1 -1
  12. package/dist/assets/{Error-D9_qyCdz.js → Error-k0M0W4Ym.js} +1 -1
  13. package/dist/assets/{ExpandLess-DS6QkgFP.js → ExpandLess-BxLkJA7i.js} +1 -1
  14. package/dist/assets/{ExternalIssuerIcon-wn5DLNeH.js → ExternalIssuerIcon-ln92O441.js} +1 -1
  15. package/dist/assets/{Google-CbbG9VdQ.js → Google-49EJIWMZ.js} +1 -1
  16. package/dist/assets/{Holiday-BtQfqbty.js → Holiday-BzLLup0b.js} +1 -1
  17. package/dist/assets/{InfoOutlined-Ct8i_w2j.js → InfoOutlined-BTxXD__0.js} +1 -1
  18. package/dist/assets/{Launch-C4r-vLEn.js → Launch-BNQGrtXN.js} +1 -1
  19. package/dist/assets/{LaunchOutlined-DTz6v31f.js → LaunchOutlined-jIfvTGQO.js} +1 -1
  20. package/dist/assets/{Location-DqS91lua.js → Location-BeKcnHxQ.js} +1 -1
  21. package/dist/assets/{LockIcon-D8nzMuv_.js → LockIcon-CPeBOE7f.js} +1 -1
  22. package/dist/assets/{Meeting-DVyA5ok9.js → Meeting-BJefXT64.js} +1 -1
  23. package/dist/assets/{MoreHoriz-DCVFk6U6.js → MoreHoriz-Cacb1zlO.js} +1 -1
  24. package/dist/assets/{OffSick-nbRxI1dJ.js → OffSick-CM_MXKaO.js} +1 -1
  25. package/dist/assets/{Phone-DmWJcq2C.js → Phone-R5GzuDhR.js} +1 -1
  26. package/dist/assets/{PlayArrow-D4W1VLQV.js → PlayArrow-ClplJQ8E.js} +1 -1
  27. package/dist/assets/{QuestionMarkCircle-Kaook7kF.js → QuestionMarkCircle-D4HZAY1P.js} +1 -1
  28. package/dist/assets/{ServerLogo-BLbbCTE0.js → ServerLogo-Ck0Cn0r-.js} +1 -1
  29. package/dist/assets/{Timezone-8J_tjPJF.js → Timezone-B4-rlCyr.js} +1 -1
  30. package/dist/assets/{ViewList-DW0ttt9E.js → ViewList-BUOZkTSJ.js} +1 -1
  31. package/dist/assets/{WorkingRemotely-CTbDOgle.js → WorkingRemotely-CR0GUC58.js} +1 -1
  32. package/dist/assets/{access-control-CQlsK--o.js → access-control-Bq2AWzT6.js} +1 -1
  33. package/dist/assets/actions-BRo5Iw6Y.js +1 -0
  34. package/dist/assets/{add-component-core-CmPrgMzo.js → add-component-core-Cj__HHUQ.js} +1 -1
  35. package/dist/assets/{add-resource-BJ2I5Nim.js → add-resource-CsXX8BpD.js} +1 -1
  36. package/dist/assets/{addon-Dc7piAwK.js → addon-BLi_O8y9.js} +1 -1
  37. package/dist/assets/{analytics-zk_2wYWU.js → analytics-CD0Y7__p.js} +1 -1
  38. package/dist/assets/api-D2GjOmnt.js +1 -0
  39. package/dist/assets/{audit-logs-BoHM_HyF.js → audit-logs-Dm36CffO.js} +2 -2
  40. package/dist/assets/{base32-CQFKTaAf.js → base32-Dyn18Qi9.js} +1 -1
  41. package/dist/assets/{branding-DpndqP6k.js → branding-BGxzaNhc.js} +2 -2
  42. package/dist/assets/{bundle-avatar-Bq_sB0nW.js → bundle-avatar-Bf7QKB75.js} +1 -1
  43. package/dist/assets/button-88Vne1V4.js +1 -0
  44. package/dist/assets/{click-to-copy-CI7R5iIQ.js → click-to-copy-D-QOPyUT.js} +1 -1
  45. package/dist/assets/cloneDeep-SKWOTeUJ.js +1 -0
  46. package/dist/assets/{complete-CNKV5S-_.js → complete-CRerCqGj.js} +1 -1
  47. package/dist/assets/{component-r_SlRgPz.js → component-6TZyjXnR.js} +1 -1
  48. package/dist/assets/{config-pGZbA-tz.js → config-3swKhn5Y.js} +1 -1
  49. package/dist/assets/{config-navigation-CyOmuZXZ.js → config-navigation-D0oAXfaj.js} +3 -3
  50. package/dist/assets/config-space-DuWwy_s9.js +1 -0
  51. package/dist/assets/{config-B81Nv9TH.js → config-z4nddTQO.js} +2 -2
  52. package/dist/assets/{confirm-BYuwITgE.js → confirm-CNExzJXC.js} +1 -1
  53. package/dist/assets/{connect-DtTAFdpT.js → connect-CiX0lOGT.js} +1 -1
  54. package/dist/assets/connect-DezEI8OV.js +1 -0
  55. package/dist/assets/{connect-to-B_HL38FH.js → connect-to-D5VBJoRY.js} +1 -1
  56. package/dist/assets/{content-layout-CxUpdTfy.js → content-layout--DV54O6i.js} +1 -1
  57. package/dist/assets/{dashboard-Hq3Av45u.js → dashboard-Nmo-Poy5.js} +3 -3
  58. package/dist/assets/{delete-confirm-uplmvk2M.js → delete-confirm-CtvKNTlt.js} +1 -1
  59. package/dist/assets/{did-address-PelewYI_.js → did-address-D9OlxQFt.js} +1 -1
  60. package/dist/assets/{domain-D4nfVnWJ.js → domain-D0EUQM3-.js} +1 -1
  61. package/dist/assets/domain-action-card-BiFHAjUT.js +29 -0
  62. package/dist/assets/domains-DOvMr47K.js +1 -0
  63. package/dist/assets/{email-B_1hqyK3.js → email-BFt86EzY.js} +1 -1
  64. package/dist/assets/{exchange-passport-6z8a0fQI.js → exchange-passport-D3RaFTbv.js} +1 -1
  65. package/dist/assets/{form-text-input-DAPTY5q6.js → form-text-input-BAvz8hUC.js} +2 -2
  66. package/dist/assets/{fuel-D_IQFNTE.js → fuel-DtpgADtd.js} +1 -1
  67. package/dist/assets/{fullpage-jSvRC_iC.js → fullpage-CzJPjmf8.js} +1 -1
  68. package/dist/assets/{get-safe-url-CGHe00Fj.js → get-safe-url-6wMoMTVj.js} +1 -1
  69. package/dist/assets/{get-safe-url-kcr2xpfY.js → get-safe-url-DfpnSzAS.js} +1 -1
  70. package/dist/assets/{home-CSVlqCBH.js → home-Bsi4OapD.js} +1 -1
  71. package/dist/assets/{iframe-C568-Rhw.js → iframe-Ny6LguId.js} +1 -1
  72. package/dist/assets/{index-C98i4Z5e.js → index-4_QUE37Q.js} +1 -1
  73. package/dist/assets/{index-CLXY6lCM.js → index-Aq7Gmh7c.js} +1 -1
  74. package/dist/assets/{index-GIzJD7EB.js → index-BO_Er8Z6.js} +1 -1
  75. package/dist/assets/{index-DEjeqL4F.js → index-Bf9Ic477.js} +1 -1
  76. package/dist/assets/{index-nrlaL_bT.js → index-BhbKurce.js} +3 -3
  77. package/dist/assets/{index-BSuB7fUn.js → index-BvvXX5ql.js} +6 -6
  78. package/dist/assets/{index-BFtb9HJu.js → index-ByTTuctd.js} +1 -1
  79. package/dist/assets/{index-DD3tf-eB.js → index-C1P5iGmO.js} +1 -1
  80. package/dist/assets/{index-DOLmfQMn.js → index-C46rA4HG.js} +1 -1
  81. package/dist/assets/{index-Rre6YdMu.js → index-C5gJZkAF.js} +1 -1
  82. package/dist/assets/index-C9_92bnT.js +5 -0
  83. package/dist/assets/{index-C88mB4xd.js → index-CPKiRTUu.js} +3 -3
  84. package/dist/assets/{index-CbAUBNWA.js → index-DDWrb-QE.js} +1 -1
  85. package/dist/assets/{index-BGDT_LlJ.js → index-DWJc5Rxl.js} +1 -1
  86. package/dist/assets/{index-CIs9e9-H.js → index-D_zMGAKU.js} +1 -1
  87. package/dist/assets/{index-2Xuj6a8j.js → index-Dwa05Kce.js} +9 -9
  88. package/dist/assets/{index-LXcg_Jx9.js → index-ImiTUfJS.js} +1 -1
  89. package/dist/assets/{index-CX8EKUzH.js → index-QhZ0Uep0.js} +34 -34
  90. package/dist/assets/{index-DrgDxjh0.js → index-U6IM3brm.js} +1 -1
  91. package/dist/assets/{index-rNb18jwy.js → index-iqebl7dr.js} +8 -8
  92. package/dist/assets/{index-Dej84UHY.js → index-oXEi5lCg.js} +1 -1
  93. package/dist/assets/{invitation-B3Pr_QnN.js → invitation-ZpOI_glU.js} +1 -1
  94. package/dist/assets/{invite-D_-waytz.js → invite-2LLH_rpm.js} +1 -1
  95. package/dist/assets/{issue-passport-DTBh3Nlx.js → issue-passport-ZxClDvPd.js} +1 -1
  96. package/dist/assets/{item-CJxQj1-I.js → item-55Qilr_X.js} +1 -1
  97. package/dist/assets/{launch-result-message-BSiL1JRt.js → launch-result-message-WNYdod-D.js} +1 -1
  98. package/dist/assets/{layout-bBj53r-g.js → layout-BWfW6GdJ.js} +1 -1
  99. package/dist/assets/{list-qVCZQcmD.js → list-Bdyc9H54.js} +1 -1
  100. package/dist/assets/{list-header-CGfTDCl3.js → list-header-Bzt7zKtS.js} +1 -1
  101. package/dist/assets/localization-BSCHp3Sl.js +1 -0
  102. package/dist/assets/{log-DDDTEmf3.js → log-CJPP7fhA.js} +1 -1
  103. package/dist/assets/{login-DuEufrex.js → login-DtPLVvN_.js} +1 -1
  104. package/dist/assets/{login-oauth-callback-BPoIie4s.js → login-oauth-callback-C8HrINF1.js} +1 -1
  105. package/dist/assets/{logo-uploader-C9lDQRIH.js → logo-uploader-BteC4lk2.js} +3 -3
  106. package/dist/assets/{lost-passport-CybTz-Q-.js → lost-passport-CbQxq4WE.js} +2 -2
  107. package/dist/assets/omit-BySqlv7K.js +1 -0
  108. package/dist/assets/{open-window-CIvo_xpS.js → open-window-n5K3qZmY.js} +1 -1
  109. package/dist/assets/{overview-OevWzZFS.js → overview-B_ufYX27.js} +1 -1
  110. package/dist/assets/{page-header-BUZCR196.js → page-header-BUUiSJrD.js} +1 -1
  111. package/dist/assets/{permission-BrYe4IKY.js → permission-D8jeJ-32.js} +1 -1
  112. package/dist/assets/{preferences-BbUP7tXT.js → preferences-BJ7kkCAj.js} +1 -1
  113. package/dist/assets/profile-embed-DGjQ85-W.js +1 -0
  114. package/dist/assets/publish-resource-C1-CGcZa.js +1 -0
  115. package/dist/assets/{react-beautiful-dnd.esm-BTh1sICy.js → react-beautiful-dnd.esm-UGZEGveY.js} +4 -4
  116. package/dist/assets/{relative-time-CjoOTJYM.js → relative-time-CIac4Vr9.js} +1 -1
  117. package/dist/assets/sdk-Cv1Lybx-.js +1 -0
  118. package/dist/assets/{session-YROkTMbv.js → session-DQa5ee1Q.js} +1 -1
  119. package/dist/assets/{setup-kW9Hw0QJ.js → setup-Bv1Vtnr2.js} +3 -3
  120. package/dist/assets/{shorten-label-cM9qLz7K.js → shorten-label-DXrhdUJE.js} +1 -1
  121. package/dist/assets/{simple-select-BnUwPVXE.js → simple-select-ZyzPurqn.js} +1 -1
  122. package/dist/assets/{slicedToArray-DuJ9Gpms.js → slicedToArray-BNN_9uYO.js} +1 -1
  123. package/dist/assets/{start-CNSyIzxB.js → start-Cjk3iqsp.js} +1 -1
  124. package/dist/assets/{status-DN8B-8eV.js → status-ChJL7P5a.js} +1 -1
  125. package/dist/assets/{step-actions-BWqVLkj0.js → step-actions-D43YRVGz.js} +1 -1
  126. package/dist/assets/{studio-H9D8V363.js → studio-VEFEI6X6.js} +1 -1
  127. package/dist/assets/{switch-control-DVDBhXMn.js → switch-control-Bye5Gp3m.js} +1 -1
  128. package/dist/assets/{traffic-C-Yt2Hoa.js → traffic-CXaJh0Jn.js} +3 -3
  129. package/dist/assets/{transfer-D5q3Q0Sk.js → transfer-BhRscgc5.js} +1 -1
  130. package/dist/assets/{unsubscribe-B37KVJnN.js → unsubscribe-CoOxT3S-.js} +1 -1
  131. package/dist/assets/{use-mobile-B771M1Zd.js → use-mobile-Cb_97PZu.js} +1 -1
  132. package/dist/assets/{useAsync-Wq2TmdyR.js → useAsync-CDzQ0uN6.js} +1 -1
  133. package/dist/assets/{useAsyncRetry-BCS65x2-.js → useAsyncRetry-CcF3e_P6.js} +1 -1
  134. package/dist/assets/{useLocalStorage-BJwBnnTy.js → useLocalStorage-DCL1pEQ3.js} +1 -1
  135. package/dist/assets/{user-center-F_9A9Saz.js → user-center-BAj7GK0b.js} +1 -1
  136. package/dist/assets/{util-CNtY10Ve.js → util-_pgMZdS5.js} +1 -1
  137. package/dist/assets/{util-HbwiSh9X.js → util-kxgHhXGN.js} +1 -1
  138. package/dist/assets/{vendor-arcblock-BsgV25xS.js → vendor-arcblock-BWr5BBTC.js} +5 -5
  139. package/dist/assets/{vendor-hooks-DOWFmXOH.js → vendor-hooks-DbRTDIFw.js} +1 -1
  140. package/dist/assets/{vendor-mui-core-hTL6kZTm.js → vendor-mui-core-O22FPGM4.js} +1 -1
  141. package/dist/assets/{vendor-mui-x-Ct7YZzdC.js → vendor-mui-x-K-9WHqhO.js} +1 -1
  142. package/dist/assets/{vendor-utils-B3B5Y2Te.js → vendor-utils-DJ1bmiuG.js} +1 -1
  143. package/dist/assets/{vendor-ux-did-connect-D0ByM4P8.js → vendor-ux-did-connect-B5nw4TRQ.js} +56 -56
  144. package/dist/assets/{wrap-locale-DbYaRzkV.js → wrap-locale-IBL-jpZm.js} +1 -1
  145. package/dist/index.html +6 -6
  146. package/dist/service-worker.js +1 -1
  147. package/package.json +30 -30
  148. package/dist/assets/actions-Y1_Pfh6f.js +0 -1
  149. package/dist/assets/api-BWVJC8TG.js +0 -1
  150. package/dist/assets/button-BSWqXQRz.js +0 -1
  151. package/dist/assets/cloneDeep-CGCT_jdp.js +0 -1
  152. package/dist/assets/config-space-Pk5ZSFe0.js +0 -1
  153. package/dist/assets/connect-BveuJyGM.js +0 -1
  154. package/dist/assets/domain-action-card-Co6TulUF.js +0 -29
  155. package/dist/assets/domains-Li-_IwLS.js +0 -1
  156. package/dist/assets/index-BUeCKhlO.js +0 -5
  157. package/dist/assets/localization-D_Z7EzWp.js +0 -1
  158. package/dist/assets/omit-ffJEQRcV.js +0 -1
  159. package/dist/assets/profile-embed-D9SuPB-8.js +0 -1
  160. package/dist/assets/publish-resource-B4-LVQhe.js +0 -1
  161. package/dist/assets/sdk-CbFje8cD.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as e,a3 as t,a2 as P,bp as W,E as d,a9 as B}from"./vendor-mui-core-hTL6kZTm.js";import{r as l}from"./vendor-react-DoD83n6N.js";import{x as v}from"./vendor-utils-B3B5Y2Te.js";import{d as E}from"./Launch-C4r-vLEn.js";import{aX as I,am as L}from"./vendor-ux-did-connect-D0ByM4P8.js";import{W as $}from"./did-address-PelewYI_.js";import{P as D}from"./page-header-BUZCR196.js";import{o as T,u as z}from"./index-nrlaL_bT.js";import{S as A}from"./layout-bBj53r-g.js";import{S as F}from"./step-actions-BWqVLkj0.js";import{S as m}from"./button-BSWqXQRz.js";import"./vendor-hooks-DOWFmXOH.js";import"./lottie-web-B6s7dDoL.js";import"./vendor-arcblock-BsgV25xS.js";import"./content-layout-CxUpdTfy.js";function u({onNext:n,onPrevious:f}){const{locale:x,t:s}=l.useContext(I),{blocklet:a,gas:c,tokenInfo:h,actions:j}=T(),{api:y}=z(),[g,o]=l.useState(!1),{need:p="",current:b="",owe:r=99999,deficiency:k,symbol:C="",endpoint:i}=c||{},{origin:S="/"}=i?new URL(i):{};l.useEffect(()=>{const N=setInterval(()=>{j.refreshFuel()},2e3);return()=>{clearInterval(N)}},[]);const w=()=>{o(!1)};return c?e.jsxs(R,{children:[e.jsx("div",{className:"header",children:e.jsx(D,{title:s("setup.fuel.title"),onClickBack:f})}),e.jsxs(t,{className:"qr-body",children:[e.jsxs(t,{mb:6,className:"tip",children:[s("setup.fuel.tipStart").replace("slot",""),e.jsx("span",{className:"amount",children:`${p} ${C}`}),s("setup.fuel.tipEnd")]}),e.jsx(t,{fontSize:16,fontWeight:"fontWeightBold",mb:.5,children:s("setup.fuel.addressTitle")}),e.jsxs(t,{display:"flex",alignItems:"center",children:[e.jsx($,{className:"address",did:a.appDid}),e.jsx(W,{style:{lineHeight:1},target:"_blank",href:v(S,"/explorer/accounts/",a.appDid),underline:"hover",children:e.jsx(E,{className:"icon-launch"})})]}),e.jsx(t,{my:2,children:e.jsx(m,{color:"primary",onClick:()=>o(!0),disabled:!r,children:s("setup.fuel.fuelApp")})}),e.jsx(L,{popup:!0,open:g,action:"fuel",checkFn:y.get,checkTimeout:10*60*1e3,onSuccess:w,onClose:()=>o(!1),locale:x,messages:{title:s("setup.connect.title"),scan:s("setup.connect.scan"),confirm:s("setup.connect.confirm"),success:s("setup.connect.success")},extraParams:{amount:k,...h,endpoint:i}}),e.jsxs(t,{display:"flex",color:"text.secondary",children:[e.jsxs(t,{display:"flex",children:[e.jsxs(t,{children:[s("setup.fuel.need"),":"]}),e.jsx(t,{ml:.5,color:"primary.main",fontWeight:"fontWeightBold",children:p})]}),e.jsxs(t,{display:"flex",ml:3,children:[e.jsxs(t,{children:[s("setup.fuel.current"),":"]}),e.jsx(t,{ml:.5,color:r>0?"error.main":"primary.main",fontWeight:"fontWeightBold",children:b})]})]})]}),e.jsx(F,{mt:8,children:e.jsx(m,{disabled:r>0,onClick:()=>n(),children:s("setup.next")})})]}):e.jsx(t,{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",children:e.jsx(P,{})})}u.propTypes={onNext:d.func,onPrevious:d.func};u.defaultProps={onNext:()=>{},onPrevious:()=>{}};const R=B(A)`
1
+ import{j as e,a3 as t,a2 as P,bp as W,E as d,a9 as B}from"./vendor-mui-core-O22FPGM4.js";import{r as l}from"./vendor-react-DoD83n6N.js";import{x as v}from"./vendor-utils-DJ1bmiuG.js";import{d as E}from"./Launch-BNQGrtXN.js";import{aX as I,am as L}from"./vendor-ux-did-connect-B5nw4TRQ.js";import{W as $}from"./did-address-D9OlxQFt.js";import{P as D}from"./page-header-BUUiSJrD.js";import{o as T,u as z}from"./index-BhbKurce.js";import{S as A}from"./layout-BWfW6GdJ.js";import{S as F}from"./step-actions-D43YRVGz.js";import{S as m}from"./button-88Vne1V4.js";import"./vendor-hooks-DbRTDIFw.js";import"./lottie-web-B6s7dDoL.js";import"./vendor-arcblock-BWr5BBTC.js";import"./content-layout--DV54O6i.js";function u({onNext:n,onPrevious:f}){const{locale:x,t:s}=l.useContext(I),{blocklet:a,gas:c,tokenInfo:h,actions:j}=T(),{api:y}=z(),[g,o]=l.useState(!1),{need:p="",current:b="",owe:r=99999,deficiency:k,symbol:C="",endpoint:i}=c||{},{origin:S="/"}=i?new URL(i):{};l.useEffect(()=>{const N=setInterval(()=>{j.refreshFuel()},2e3);return()=>{clearInterval(N)}},[]);const w=()=>{o(!1)};return c?e.jsxs(R,{children:[e.jsx("div",{className:"header",children:e.jsx(D,{title:s("setup.fuel.title"),onClickBack:f})}),e.jsxs(t,{className:"qr-body",children:[e.jsxs(t,{mb:6,className:"tip",children:[s("setup.fuel.tipStart").replace("slot",""),e.jsx("span",{className:"amount",children:`${p} ${C}`}),s("setup.fuel.tipEnd")]}),e.jsx(t,{fontSize:16,fontWeight:"fontWeightBold",mb:.5,children:s("setup.fuel.addressTitle")}),e.jsxs(t,{display:"flex",alignItems:"center",children:[e.jsx($,{className:"address",did:a.appDid}),e.jsx(W,{style:{lineHeight:1},target:"_blank",href:v(S,"/explorer/accounts/",a.appDid),underline:"hover",children:e.jsx(E,{className:"icon-launch"})})]}),e.jsx(t,{my:2,children:e.jsx(m,{color:"primary",onClick:()=>o(!0),disabled:!r,children:s("setup.fuel.fuelApp")})}),e.jsx(L,{popup:!0,open:g,action:"fuel",checkFn:y.get,checkTimeout:10*60*1e3,onSuccess:w,onClose:()=>o(!1),locale:x,messages:{title:s("setup.connect.title"),scan:s("setup.connect.scan"),confirm:s("setup.connect.confirm"),success:s("setup.connect.success")},extraParams:{amount:k,...h,endpoint:i}}),e.jsxs(t,{display:"flex",color:"text.secondary",children:[e.jsxs(t,{display:"flex",children:[e.jsxs(t,{children:[s("setup.fuel.need"),":"]}),e.jsx(t,{ml:.5,color:"primary.main",fontWeight:"fontWeightBold",children:p})]}),e.jsxs(t,{display:"flex",ml:3,children:[e.jsxs(t,{children:[s("setup.fuel.current"),":"]}),e.jsx(t,{ml:.5,color:r>0?"error.main":"primary.main",fontWeight:"fontWeightBold",children:b})]})]})]}),e.jsx(F,{mt:8,children:e.jsx(m,{disabled:r>0,onClick:()=>n(),children:s("setup.next")})})]}):e.jsx(t,{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",children:e.jsx(P,{})})}u.propTypes={onNext:d.func,onPrevious:d.func};u.defaultProps={onNext:()=>{},onPrevious:()=>{}};const R=B(A)`
2
2
  .qr-body {
3
3
  width: 580px;
4
4
  ${n=>n.theme.breakpoints.down("md")} {
@@ -1 +1 @@
1
- import{j as e,T as x,bp as h,a3 as o,E as r}from"./vendor-mui-core-hTL6kZTm.js";import{b7 as j,U as v,j as a}from"./vendor-ux-did-connect-D0ByM4P8.js";function w({linkProps:t,...d}){return e.jsxs(x,{...d,children:["Powered by"," ",e.jsx(h,{href:"https://www.arcblock.io",target:"_blank",underline:"hover",...t,children:"ArcBlock"}),"'s"," ",e.jsx(h,{href:"https://www.blocklet.io",target:"_blank",underline:"hover",...t,children:"Blocklet Technology"}),", the decentralized web engine."]})}const y="/.well-known/service/static/assets/login-bg-Cbfh9Uc2.png";function k({did:t,children:d,title:l,description:c,logo:n,logoSize:g,appUrl:i}){var b,f,p,m;if(!t)return d;let s;try{s=j(t)}catch{console.warn("Invalid did:",t)}const u=(globalThis==null?void 0:globalThis.blocklet)||(globalThis==null?void 0:globalThis.env)||{};return l===void 0&&(l=u.appName),c===void 0&&(c=u.appDescription),n===void 0&&(n=((b=globalThis==null?void 0:globalThis.blocklet)==null?void 0:b.appLogoRect)||((f=globalThis==null?void 0:globalThis.blocklet)==null?void 0:f.appLogo)||""),typeof n=="string"&&(n?n=e.jsx(o,{sx:{height:g,maxHeight:g,maxWidth:"50%",objectFit:"contain"},component:"img",src:n,alt:`${l}'s logo`}):n=e.jsx(v,{size:g,did:t,src:n,variant:"rounded"})),typeof i=="string"&&(i=((p=globalThis==null?void 0:globalThis.blocklet)==null?void 0:p.appUrl)||"",!i&&(globalThis!=null&&globalThis.env)&&(i=(m=globalThis==null?void 0:globalThis.env)==null?void 0:m.baseUrl)),e.jsxs(o,{sx:{width:"100vw",height:"100vh",overflowX:"auto",display:"flex",backgroundColor:a.backgroundsBgSubtile},children:[e.jsxs(o,{sx:{position:"relative",fontSize:0,flex:30,display:{xs:"none",lg:"flex"},minWidth:"400px",backgroundColor:a.surfaceBgSubtitle},children:[e.jsx(o,{sx:{position:"absolute",top:0,bottom:0,left:0,right:0,background:s?`linear-gradient(0deg, ${s} 0%, ${s} 100%), url(${y}), lightgray 50% / cover no-repeat`:`url(${y}), lightgray 50% / cover no-repeat`,backgroundPosition:"center",backgroundSize:"cover",backgroundBlendMode:s?"soft-light, normal":"unset",mask:"linear-gradient(172deg, rgba(0, 0, 0, 0.0) 24.62%, rgba(0, 0, 0, 0.80) 44.47%, #000 100%)"}}),e.jsxs(o,{sx:{display:"flex",flexDirection:"column",position:"absolute",top:0,left:0,width:"100%",p:3},children:[i?e.jsx(o,{children:e.jsx(h,{href:i,underline:"none",color:"inherit",children:n})}):n,l&&e.jsx(x,{variant:"h5",sx:{mt:3,mb:1,p:0,mx:0,fontWeight:"bold"},children:i?e.jsx(h,{href:i,underline:"none",color:"inherit",children:l}):l}),c&&e.jsx(x,{variant:"body2",sx:{m:0,p:0,color:a.foregroundsFgSubtile,fontSize:"12px",lineHeight:"20px"},children:c})]}),e.jsx(w,{linkProps:{underline:"always",color:a.textSubtitle},sx:{zIndex:10,position:"absolute",bottom:40,left:20,right:20,textAlign:"center",fontSize:"12px",color:a.textSubtitle}})]}),e.jsx(o,{sx:{display:"flex",justifyContent:"center",alignItems:"center",flex:70,maxWidth:{xs:"100%",md:"90%"},margin:"auto",height:"auto"},children:d})]})}k.propTypes={did:r.string.isRequired,children:r.any.isRequired,title:r.any,description:r.any,logo:r.any,logoSize:r.number,appUrl:r.string};k.defaultProps={title:void 0,description:void 0,logo:void 0,logoSize:40,appUrl:""};export{k as F};
1
+ import{j as e,T as x,bp as h,a3 as o,E as r}from"./vendor-mui-core-O22FPGM4.js";import{b7 as j,U as v,j as a}from"./vendor-ux-did-connect-B5nw4TRQ.js";function w({linkProps:t,...d}){return e.jsxs(x,{...d,children:["Powered by"," ",e.jsx(h,{href:"https://www.arcblock.io",target:"_blank",underline:"hover",...t,children:"ArcBlock"}),"'s"," ",e.jsx(h,{href:"https://www.blocklet.io",target:"_blank",underline:"hover",...t,children:"Blocklet Technology"}),", the decentralized web engine."]})}const y="/.well-known/service/static/assets/login-bg-Cbfh9Uc2.png";function k({did:t,children:d,title:l,description:c,logo:n,logoSize:g,appUrl:i}){var b,f,p,m;if(!t)return d;let s;try{s=j(t)}catch{console.warn("Invalid did:",t)}const u=(globalThis==null?void 0:globalThis.blocklet)||(globalThis==null?void 0:globalThis.env)||{};return l===void 0&&(l=u.appName),c===void 0&&(c=u.appDescription),n===void 0&&(n=((b=globalThis==null?void 0:globalThis.blocklet)==null?void 0:b.appLogoRect)||((f=globalThis==null?void 0:globalThis.blocklet)==null?void 0:f.appLogo)||""),typeof n=="string"&&(n?n=e.jsx(o,{sx:{height:g,maxHeight:g,maxWidth:"50%",objectFit:"contain"},component:"img",src:n,alt:`${l}'s logo`}):n=e.jsx(v,{size:g,did:t,src:n,variant:"rounded"})),typeof i=="string"&&(i=((p=globalThis==null?void 0:globalThis.blocklet)==null?void 0:p.appUrl)||"",!i&&(globalThis!=null&&globalThis.env)&&(i=(m=globalThis==null?void 0:globalThis.env)==null?void 0:m.baseUrl)),e.jsxs(o,{sx:{width:"100vw",height:"100vh",overflowX:"auto",display:"flex",backgroundColor:a.backgroundsBgSubtile},children:[e.jsxs(o,{sx:{position:"relative",fontSize:0,flex:30,display:{xs:"none",lg:"flex"},minWidth:"400px",backgroundColor:a.surfaceBgSubtitle},children:[e.jsx(o,{sx:{position:"absolute",top:0,bottom:0,left:0,right:0,background:s?`linear-gradient(0deg, ${s} 0%, ${s} 100%), url(${y}), lightgray 50% / cover no-repeat`:`url(${y}), lightgray 50% / cover no-repeat`,backgroundPosition:"center",backgroundSize:"cover",backgroundBlendMode:s?"soft-light, normal":"unset",mask:"linear-gradient(172deg, rgba(0, 0, 0, 0.0) 24.62%, rgba(0, 0, 0, 0.80) 44.47%, #000 100%)"}}),e.jsxs(o,{sx:{display:"flex",flexDirection:"column",position:"absolute",top:0,left:0,width:"100%",p:3},children:[i?e.jsx(o,{children:e.jsx(h,{href:i,underline:"none",color:"inherit",children:n})}):n,l&&e.jsx(x,{variant:"h5",sx:{mt:3,mb:1,p:0,mx:0,fontWeight:"bold"},children:i?e.jsx(h,{href:i,underline:"none",color:"inherit",children:l}):l}),c&&e.jsx(x,{variant:"body2",sx:{m:0,p:0,color:a.foregroundsFgSubtile,fontSize:"12px",lineHeight:"20px"},children:c})]}),e.jsx(w,{linkProps:{underline:"always",color:a.textSubtitle},sx:{zIndex:10,position:"absolute",bottom:40,left:20,right:20,textAlign:"center",fontSize:"12px",color:a.textSubtitle}})]}),e.jsx(o,{sx:{display:"flex",justifyContent:"center",alignItems:"center",flex:70,maxWidth:{xs:"100%",md:"90%"},margin:"auto",height:"auto"},children:d})]})}k.propTypes={did:r.string.isRequired,children:r.any.isRequired,title:r.any,description:r.any,logo:r.any,logoSize:r.number,appUrl:r.string};k.defaultProps={title:void 0,description:void 0,logo:void 0,logoSize:40,appUrl:""};export{k as F};
@@ -1 +1 @@
1
- import{b6 as t,V as o}from"./vendor-ux-did-connect-D0ByM4P8.js";function i(...e){try{return t(...e)}catch(r){throw o.error("Invalid redirect url"),console.error("Invalid redirect url",r),r}}export{i as g};
1
+ import{b6 as t,V as o}from"./vendor-ux-did-connect-B5nw4TRQ.js";function i(...e){try{return t(...e)}catch(r){throw o.error("Invalid redirect url"),console.error("Invalid redirect url",r),r}}export{i as g};
@@ -1 +1 @@
1
- import{b6 as t,V as o}from"./vendor-ux-did-connect-D0ByM4P8.js";function i(...e){try{return t(...e)}catch(r){throw o.error("Invalid redirect url"),console.error("Invalid redirect url",r),r}}export{i as g};
1
+ import{b6 as t,V as o}from"./vendor-ux-did-connect-B5nw4TRQ.js";function i(...e){try{return t(...e)}catch(r){throw o.error("Invalid redirect url"),console.error("Invalid redirect url",r),r}}export{i as g};
@@ -1 +1 @@
1
- import{j as o,ad as n}from"./vendor-mui-core-hTL6kZTm.js";import{L as r}from"./vendor-react-DoD83n6N.js";import{B as i,p as t}from"./vendor-ux-did-connect-D0ByM4P8.js";import{S as e}from"./studio-H9D8V363.js";import"./vendor-utils-B3B5Y2Te.js";import"./vendor-hooks-DOWFmXOH.js";import"./lottie-web-B6s7dDoL.js";import"./vendor-arcblock-BsgV25xS.js";function E(){return o.jsx(e,{children:o.jsxs(n,{direction:"row",m:4,spacing:2,children:[o.jsx(i,{component:r,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/preferences`,size:"large",color:"primary",variant:"outlined",children:"Preference Builder"}),o.jsx(i,{component:r,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/branding`,size:"large",color:"primary",variant:"outlined",children:"Branding Images"}),o.jsx(i,{component:r,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/localization`,size:"large",color:"primary",variant:"outlined",children:"Localization"})]})})}export{E as default};
1
+ import{j as o,ad as n}from"./vendor-mui-core-O22FPGM4.js";import{L as r}from"./vendor-react-DoD83n6N.js";import{B as i,p as t}from"./vendor-ux-did-connect-B5nw4TRQ.js";import{S as e}from"./studio-VEFEI6X6.js";import"./vendor-utils-DJ1bmiuG.js";import"./vendor-hooks-DbRTDIFw.js";import"./lottie-web-B6s7dDoL.js";import"./vendor-arcblock-BWr5BBTC.js";function E(){return o.jsx(e,{children:o.jsxs(n,{direction:"row",m:4,spacing:2,children:[o.jsx(i,{component:r,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/preferences`,size:"large",color:"primary",variant:"outlined",children:"Preference Builder"}),o.jsx(i,{component:r,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/branding`,size:"large",color:"primary",variant:"outlined",children:"Branding Images"}),o.jsx(i,{component:r,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/localization`,size:"large",color:"primary",variant:"outlined",children:"Localization"})]})})}export{E as default};
@@ -1 +1 @@
1
- import{b as x}from"./vendor-react-DoD83n6N.js";import{o as E}from"./vendor-arcblock-BsgV25xS.js";const L=({url:o,allowFullScreen:r,position:a,display:i,height:u,width:c,overflow:f,styles:y,onLoad:p,onMouseOver:m,onMouseOut:b,scrolling:w,id:d,frameBorder:n,ariaHidden:O,sandbox:s,allow:j,className:g,title:h,ariaLabel:k,ariaLabelledby:I,name:P,target:v,loading:A,importance:F,referrerpolicy:M,allowpaymentrequest:S,src:$,key:q})=>{const t=E({src:$||o,target:v||null,style:{position:a||null,display:i||"initial",overflow:f||null},scrolling:w||null,allowpaymentrequest:S||null,importance:F||null,sandbox:s&&[...s].join(" ")||null,loading:A||null,styles:y||null,name:P||null,className:g||null,allowFullScreen:"allowFullScreen",referrerpolicy:M||null,title:h||null,allow:j||null,id:d||null,"aria-labelledby":I||null,"aria-hidden":O||null,"aria-label":k||null,width:c||null,height:u||null,onLoad:p||null,onMouseOver:m||null,onMouseOut:b||null,key:q||"iframe"});let l=Object.create(null);for(let e of Object.keys(t))t[e]!=null&&(l[e]=t[e]);for(let e of Object.keys(l.style))l.style[e]==null&&delete l.style[e];if(l.styles)for(let e of Object.keys(l.styles))l.styles.hasOwnProperty(e)&&(l.style[e]=l.styles[e]),Object.keys(l.styles).pop()==e&&delete l.styles;if(r)if("allow"in l){const e=l.allow.replace("fullscreen","");l.allow=`fullscreen ${e.trim()}`.trim()}else l.allow="fullscreen";return n>=0&&(l.style.hasOwnProperty("border")||(l.style.border=n)),x.createElement("iframe",Object.assign({},l))},z=L;export{z as I};
1
+ import{b as x}from"./vendor-react-DoD83n6N.js";import{o as E}from"./vendor-arcblock-BWr5BBTC.js";const L=({url:o,allowFullScreen:r,position:a,display:i,height:u,width:c,overflow:f,styles:y,onLoad:p,onMouseOver:m,onMouseOut:b,scrolling:w,id:d,frameBorder:n,ariaHidden:O,sandbox:s,allow:j,className:g,title:h,ariaLabel:k,ariaLabelledby:I,name:P,target:v,loading:A,importance:F,referrerpolicy:M,allowpaymentrequest:S,src:$,key:q})=>{const t=E({src:$||o,target:v||null,style:{position:a||null,display:i||"initial",overflow:f||null},scrolling:w||null,allowpaymentrequest:S||null,importance:F||null,sandbox:s&&[...s].join(" ")||null,loading:A||null,styles:y||null,name:P||null,className:g||null,allowFullScreen:"allowFullScreen",referrerpolicy:M||null,title:h||null,allow:j||null,id:d||null,"aria-labelledby":I||null,"aria-hidden":O||null,"aria-label":k||null,width:c||null,height:u||null,onLoad:p||null,onMouseOver:m||null,onMouseOut:b||null,key:q||"iframe"});let l=Object.create(null);for(let e of Object.keys(t))t[e]!=null&&(l[e]=t[e]);for(let e of Object.keys(l.style))l.style[e]==null&&delete l.style[e];if(l.styles)for(let e of Object.keys(l.styles))l.styles.hasOwnProperty(e)&&(l.style[e]=l.styles[e]),Object.keys(l.styles).pop()==e&&delete l.styles;if(r)if("allow"in l){const e=l.allow.replace("fullscreen","");l.allow=`fullscreen ${e.trim()}`.trim()}else l.allow="fullscreen";return n>=0&&(l.style.hasOwnProperty("border")||(l.style.border=n)),x.createElement("iframe",Object.assign({},l))},z=L;export{z as I};
@@ -1,4 +1,4 @@
1
- import{j as r,T as i}from"./vendor-mui-core-hTL6kZTm.js";import{W as p,af as x}from"./vendor-utils-B3B5Y2Te.js";import{s as c}from"./vendor-ux-did-connect-D0ByM4P8.js";function h({name:t,nameFormatter:a=o=>typeof o=="string"?o.split(" ").map(m=>p(x(m))).join(" "):o,layout:n="horizontal",children:e,valueComponent:l="div",nameWidth:s=90,...f}){return r.jsxs(u,{layout:n,width:s,...f,children:[r.jsx(i,{color:"textSecondary",className:"info-row__name",children:a(t)}),e&&r.jsx(i,{color:"textPrimary",component:l,className:"info-row__value",children:e})]})}const u=c("div")`
1
+ import{j as r,T as i}from"./vendor-mui-core-O22FPGM4.js";import{X as p,ag as x}from"./vendor-utils-DJ1bmiuG.js";import{s as c}from"./vendor-ux-did-connect-B5nw4TRQ.js";function h({name:t,nameFormatter:a=o=>typeof o=="string"?o.split(" ").map(f=>p(x(f))).join(" "):o,layout:n="horizontal",children:e,valueComponent:l="div",nameWidth:s=90,...m}){return r.jsxs(u,{layout:n,width:s,...m,children:[r.jsx(i,{color:"textSecondary",className:"info-row__name",children:a(t)}),e&&r.jsx(i,{color:"textPrimary",component:l,className:"info-row__value",children:e})]})}const u=c("div")`
2
2
  display: flex;
3
3
  flex-direction: ${t=>t.layout==="vertical"?"column":"row"};
4
4
  justify-content: flex-start;
@@ -1 +1 @@
1
- import{d as A,v as R,p as w,e as p}from"./index-Dej84UHY.js";const O=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,x=/^[a-zA-Z]:\\/;function N(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return x.test(e)?!1:O.test(e)}const _=["http","https"],z=["nofollow"],L={};function T(e){const r=e||L,g=r.protocols||_,u=A(r.test);return function(h){R(h,"element",function(t,y,E){if(t.tagName==="a"&&typeof t.properties.href=="string"&&u(t,y,E)){const o=t.properties.href;if(N(o)?g.includes(o.slice(0,o.indexOf(":"))):o.startsWith("//")){const n=s(r.content,t),c=n&&!Array.isArray(n)?[n]:n,i=s(r.rel,t)||z,a=typeof i=="string"?w(i):i,f=s(r.target,t),l=s(r.properties,t);if(l&&Object.assign(t.properties,p(l)),a.length>0&&(t.properties.rel=[...a]),f&&(t.properties.target=f),c){const m=s(r.contentProperties,t)||{};t.children.push({type:"element",tagName:"span",properties:p(m),children:p(c)})}}}})}}function s(e,r){return typeof e=="function"?e(r):e}export{T as r};
1
+ import{d as A,v as R,p as w,e as p}from"./index-oXEi5lCg.js";const O=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,x=/^[a-zA-Z]:\\/;function N(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return x.test(e)?!1:O.test(e)}const _=["http","https"],z=["nofollow"],L={};function T(e){const r=e||L,g=r.protocols||_,u=A(r.test);return function(h){R(h,"element",function(t,y,E){if(t.tagName==="a"&&typeof t.properties.href=="string"&&u(t,y,E)){const o=t.properties.href;if(N(o)?g.includes(o.slice(0,o.indexOf(":"))):o.startsWith("//")){const n=s(r.content,t),c=n&&!Array.isArray(n)?[n]:n,i=s(r.rel,t)||z,a=typeof i=="string"?w(i):i,f=s(r.target,t),l=s(r.properties,t);if(l&&Object.assign(t.properties,p(l)),a.length>0&&(t.properties.rel=[...a]),f&&(t.properties.target=f),c){const m=s(r.contentProperties,t)||{};t.children.push({type:"element",tagName:"span",properties:p(m),children:p(c)})}}}})}}function s(e,r){return typeof e=="function"?e(r):e}export{T as r};
@@ -1,4 +1,4 @@
1
- import{r as b}from"./vendor-react-DoD83n6N.js";import{j as e,E as d,a1 as Pe,R as bt,a4 as jt,T as G,a3 as R,A as Fe,bj as _e,co as et,cn as Te,bn as Ie,bO as De,x as ye,a$ as Ee,a2 as tt,a9 as ae,V as nt,bd as Xe,bm as vt,bi as yt,ak as Je,cp as St}from"./vendor-mui-core-hTL6kZTm.js";import{b as Z,au as re,z as Ct}from"./vendor-utils-B3B5Y2Te.js";import{V,p as L,a$ as Nt,r as Be,u as X,bM as wt,U as st,B as Ae,a2 as at,bd as be,ak as Rt,aq as Tt,bC as It}from"./vendor-ux-did-connect-D0ByM4P8.js";import{z as Dt,G as H,m as Et,I as Qe}from"./index-nrlaL_bT.js";import{f as pe,a as Oe}from"./vendor-hooks-DOWFmXOH.js";import{S as ue}from"./shorten-label-cM9qLz7K.js";import{I as it}from"./index-C98i4Z5e.js";import{S as At,a as Ot}from"./list-qVCZQcmD.js";import{R as ze}from"./relative-time-CjoOTJYM.js";import{b as We}from"./dashboard-Hq3Av45u.js";import{W as Lt}from"./did-address-PelewYI_.js";import{p as ot}from"./util-CNtY10Ve.js";import{D as kt,g as Pt}from"./traffic-C-Yt2Hoa.js";import{B as rt}from"./bundle-avatar-Bq_sB0nW.js";import{B as Ft}from"./index-Rre6YdMu.js";import"./lottie-web-B6s7dDoL.js";import"./vendor-arcblock-BsgV25xS.js";import"./index-DOLmfQMn.js";import"./InfoOutlined-Ct8i_w2j.js";import"./useLocalStorage-BJwBnnTy.js";import"./confirm-BYuwITgE.js";import"./format-error-LAoTjvJe.js";import"./PlayArrow-D4W1VLQV.js";import"./get-safe-url-CGHe00Fj.js";import"./session-YROkTMbv.js";import"./useAsyncRetry-BCS65x2-.js";import"./useAsync-Wq2TmdyR.js";import"./useSetState-BL3ktMon.js";import"./base32-CQFKTaAf.js";import"./iframe-C568-Rhw.js";import"./LaunchOutlined-DTz6v31f.js";import"./ChevronLeft-CTD-h_rc.js";import"./ChevronRight-DPlXp_5c.js";import"./index-BGDT_LlJ.js";import"./vendor-mui-x-Ct7YZzdC.js";const lt=b.createContext({}),{Provider:_t,Consumer:es}=lt;function Bt({children:t,blocklet:n=""}){const{api:s,inService:i}=Dt(),[a,l]=b.useState([]),[p,f]=b.useState({total:0,pageSize:20,pageCount:0,page:1}),y=pe(()=>{var j;return(j=n.meta)==null?void 0:j.did},[n]),[S,T]=b.useState([]),N=async({page:j=1,pageSize:v=20,...x}={})=>{if(!y)return[];try{const w={paging:{page:j,pageSize:v},...x,teamDid:y,dateRange:x.dateRange?[H(x.dateRange[0]).toISOString(),H(x.dateRange[1]).toISOString()]:void 0},{dids:M,...B}=w;let K="";M.includes("system")&&(K="system");const _=M.filter(ee=>ee!=="system"),Q=await s.getNotificationSendLog({input:{...B,source:K,componentDids:_}});return l(Q.list),f(Q.paging),Q.list}catch(w){return V.error(w.message),[]}},A=async()=>{const j=await s.getNotificationComponents({input:{teamDid:y}});T(j.componentDids)},P=b.useCallback(j=>{const v=n.children.find(x=>{var w;return((w=x.meta)==null?void 0:w.did)===j});if(v)return v.ancestors=[n],v},[n]),O=async({notificationId:j,receivers:v,channels:x,...w})=>{await s.resendNotification({input:{teamDid:y,notificationId:j,receivers:v,channels:x.map(M=>M==="wallet"?L.NOTIFICATION_SEND_CHANNEL.WALLET:M==="pushKit"?L.NOTIFICATION_SEND_CHANNEL.PUSH:M),...w}})},F=b.useCallback(async j=>(await s.getUser({input:{teamDid:y,user:{did:j}}})).user,[s,y]),I=b.useCallback(async({page:j=1,pageSize:v=20,...x}={})=>{try{const w={paging:{page:j,pageSize:v},...x,userName:x.searchText||"",teamDid:y,dateRange:x.dateRange?[H(x.dateRange[0]).toISOString(),H(x.dateRange[1]).toISOString()]:void 0};return await s.getReceivers({input:w})}catch(w){throw V.error(w.message),w}},[s,y]);b.useEffect(()=>{y&&A()},[y]);const U={fetch:N,data:a,paging:p,blocklet:n,getComponent:P,resendNotification:O,getUser:F,componentDids:S,getReceivers:I,inService:i,teamDid:y};return e.jsx(_t,{value:{notificationRecords:U},children:t})}function Me(){const{notificationRecords:t}=b.useContext(lt);return t}fe.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const zt={info:"primary",success:"success",error:"error",warning:"warning"};function fe({severity:t="info"}){return e.jsx(Nt,{type:zt[t],children:t})}var qe={},Wt=Pe;Object.defineProperty(qe,"__esModule",{value:!0});var ct=qe.default=void 0,Mt=Wt(Be()),qt=e;ct=qe.default=(0,Mt.default)((0,qt.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 Ke={},Kt=Pe;Object.defineProperty(Ke,"__esModule",{value:!0});var dt=Ke.default=void 0,$t=Kt(Be()),Ht=e;dt=Ke.default=(0,$t.default)((0,Ht.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 $e={},Ut=Pe;Object.defineProperty($e,"__esModule",{value:!0});var ut=$e.default=void 0,Vt=Ut(Be()),Gt=e;ut=$e.default=(0,Vt.default)((0,Gt.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 Yt=(t,n,s="")=>{if(!s||!n)return"";switch(s){case L.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:n});case L.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:n});case L.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:n});case L.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return s}};function pt(t,n,s={}){const{status:i,updatedAt:a,reason:l="",channel:p="wallet"}=s,f=a?t("notification.sendStatus.sentTime",{date:Et(a,n)}):"",y=Yt(t,p,l);return i===L.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:f,reason:y}:i===L.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:f}:{status:"pending",title:t("notification.sendStatus.pending"),reason:y,sentTime:f}}const Le={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},ke=["wallet","pushKit","email"],Ze=["info","success","error","warning"],ft=t=>{var s,i;const{settings:n}=t;return(i=(s=n==null?void 0:n.notification)==null?void 0:s.email)==null?void 0:i.enabled},mt=t=>{var s,i;const{settings:n}=t;return(i=(s=n==null?void 0:n.notification)==null?void 0:s.pushKit)==null?void 0:i.enabled},Xt=(t,n)=>{const s=Z(n,"extra.notifications.email",!0);return{available:ft(t),enabled:s}},Jt=(t,n)=>{const s=Z(n,"extra.notifications.push",!0);return{available:mt(t),enabled:s}},Qt=t=>({enabled:Z(t,"extra.notifications.wallet",!0)}),Zt=t=>({enabled:Z(t,"extra.webhooks",[]).length>0}),ge=(t=3)=>new Promise(n=>{setTimeout(()=>{n()},t*1e3)}),en=(t,n)=>n==="wallet"||n==="webhook"?[{channel:n,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:n}),fail:t("notification.sendStatus.reason.disabled",{channel:n})}]:n==="pushKit"||n==="email"?[{channel:n,type:"available",pass:t("notification.sendStatus.reason.available",{channel:n}),fail:t("notification.sendStatus.reason.unavailable",{channel:n})},{channel:n,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:n}),fail:t("notification.sendStatus.reason.disabled",{channel:n})}]:[],xe=(t=[])=>{const n=H().startOf("day");return t.filter(s=>H(s.sendAt).isSame(n,"day")).length},tn=(t,n="")=>{if(n&&ke.includes(n)){const l=`${n}SendRecord`,p=Z(t,l,[]);return xe(p)}const s=Z(t,"webhook",{}),i=Object.keys(s??{})??[];if(n&&i.includes(n)){const l=s[n]??[];return xe(l)}const a={};return ke.forEach(l=>{const p=`${l}SendRecord`,f=Z(t,p,[]),y=xe(f);a[l]=y}),i.length>0&&i.forEach(l=>{const p=s[l]??[],f=xe(p);a[l]=f}),a},je=(t,n,s)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[s].splice(n,1),t},ve=(t,n)=>{if(!Array.isArray(n))throw new Error("filters must be an array");return n.length?!n.includes(t):!1},nn=t=>{switch(t){case L.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case L.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case L.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case L.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ht=()=>bt({typography:{fontSize:14,button:{textTransform:"none"}},palette:{primary:{main:"#1DC1C7",contrastText:"#fff"},secondary:{main:"#030712",contrastText:"#fff"},storeSecondary:{main:"#EBFEFF",contrastText:"#fff"}},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 J({config:t,enableTooltip:n=!0,showTitle:s=!1,children:i}){const{status:a,title:l="",sentTime:p="",reason:f=""}=t,y=[l,f].filter(Boolean).join(", ");return e.jsx(jt,{title:n?e.jsxs(e.Fragment,{children:[e.jsx(G,{color:"inherit",sx:{fontSize:12},children:y}),e.jsx("span",{children:p})]}):null,arrow:!0,placement:"top",children:e.jsxs(R,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(R,{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center",children:[e.jsx(R,{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Le[a],style:{opacity:.15}}),e.jsx(R,{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[a]})]}),e.jsx(G,{color:"inherit",sx:{fontSize:12},children:s?l:i})]})})}J.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};J.defaultProps={enableTooltip:!0,showTitle:!1,children:null};le.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};le.defaultProps={onDelete:()=>{}};function le({list:t,label:n,onDelete:s}){const{t:i,locale:a}=X();return e.jsxs(R,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(G,{children:[n,": "]}),t.map(l=>{const p=pt(i,a,{status:l});return e.jsx(Fe,{size:"small",label:e.jsx(R,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(J,{config:p,enableTooltip:!1,children:p.title})}),onDelete:f=>s(f,l)},l)})]})}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:n,index:s,column:i,filterValues:a,label:l,renderLabel:p}){return e.jsxs(_e,{className:"filter-container",children:[e.jsx(et,{component:"legend",children:l}),e.jsx(Te,{row:!0,children:a.map(f=>e.jsx(Ie,{control:e.jsx(De,{checked:t[s].indexOf(f.value??f)>-1,onChange:y=>{const S=[...t];y.target.checked?S[s]=[...S[s],f.value??f]:S[s]=S[s].filter(T=>T!==(f.value??f)),n(S[s],s,i)},name:f.value??f}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:p(f)})},f.value??f))})]})}function Re(t){return e.jsx(He,{...t,renderLabel:n=>e.jsx(J,{enableTooltip:!1,config:{status:n.status},children:n.label})})}oe.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function oe({status:t,updatedAt:n,reason:s="",channel:i="wallet",onResend:a}){const{t:l,locale:p}=X(),f=pt(l,p,{status:t,updatedAt:n,reason:s,channel:i});return e.jsxs(R,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(J,{config:f,showTitle:!0}),f.status!=="success"&&e.jsx(ye,{className:"resend-btn",size:"small",startIcon:e.jsx(We,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:a,children:l("notification.resend")})]})}Ue.propTypes={value:d.array.isRequired,onChange:d.func};function Ue({value:t,onChange:n}){const{locale:s}=X(),i=H().toDate(),[a,l]=b.useState(null),p=b.useCallback(S=>{l(a?null:S.currentTarget)},[a]),f=!!a,y=b.useCallback(S=>{if(!S.startDate||!S.endDate){V.error("Please select a date range");return}if(H(S.startDate).isAfter(S.endDate)||!H(S.startDate).isValid()||!H(S.endDate).isValid()){V.error("Invalid date range");return}n([S.startDate,S.endDate]),l(null)},[n]);return e.jsxs("div",{children:[e.jsx(G,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:0,children:e.jsxs(ye,{onClick:p,variant:"outlined",size:"small",color:"inherit",children:[Qe(t[0],s)," - ",Qe(t[1],s)]})}),e.jsx(Ee,{open:f,anchorEl:a,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(kt,{open:!0,maxDate:i,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:p,definedRanges:Pt(i),onChange:y})})]})}Ve.propTypes={itemComponent:d.elementType.isRequired};function Ve({itemComponent:t,...n}){var a;const{t:s}=X();return!((a=n==null?void 0:n.filterList)!=null&&a.filter(l=>l.length).length)?null:e.jsxs(R,{display:"flex",gap:1,alignItems:"center",children:[e.jsx("div",{className:"toolbar-filter-title",children:s("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(wt.TableFilterList,{...n,ItemComponent:t})})]})}function Se({label:t,onDelete:n,canDelete:s=()=>!0,...i}){const a=n&&typeof n=="function"?n:void 0;let l=!0;return s&&typeof s=="function"&&(l=s({label:t,...i})),e.jsx(Fe,{label:t,variant:"outlined",...a&&l?{onDelete:a}:{}})}Se.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};Se.defaultProps={canDelete:()=>!0};const sn=[{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}];Ge.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};Ge.defaultProps={loading:!1,onCancel:()=>{},onConfirm:()=>{}};function Ge({loading:t=!1,onCancel:n,onConfirm:s}){const{t:i}=X(),[a,l]=b.useState(sn),[p,f]=b.useState(!0),y=(T,N)=>{N.checked=T.target.checked;const A=a.map(P=>({...P,checked:P.value===N.value?N.checked:P.checked}));l(A)},S=T=>{T.stopPropagation(),s({channels:a.filter(N=>N.checked).map(N=>N.value),isResendFailedOnly:p})};return e.jsxs(R,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(G,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:i("notification.config")}),e.jsx(R,{className:"choose-channel",children:e.jsxs(_e,{component:"fieldset",variant:"standard",children:[e.jsx(et,{component:"legend",children:i("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:a.map(T=>e.jsx(Ie,{control:e.jsx(De,{checked:T.checked,onChange:N=>y(N,T),name:T.value}),label:T.label},T.value))})]})}),e.jsx(R,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Ie,{control:e.jsx(De,{checked:p,onChange:T=>f(T.target.checked)}),label:i("notification.resendFailedOnly")})})}),e.jsxs(R,{display:"flex",justifyContent:"flex-end",gap:1,className:"resend-config-footer-tip",children:[e.jsx(ye,{onClick:T=>{T.stopPropagation(),n()},color:"inherit",children:i("common.cancel")}),e.jsxs(ye,{onClick:S,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(tt,{size:16}),i("common.confirm")]})]})]})}gt.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function gt({notificationId:t,handleResend:n,resending:s=!1}){const{t:i,locale:a}=X(),{getReceivers:l,inService:p,teamDid:f,getUser:y,blocklet:S}=Me(),[T,N]=b.useState(!1),[A,P]=b.useState([]),O=Oe({anchorEl:null,position:null}),F=Oe({anchorEl:null,position:null}),[I,U]=b.useState(null),[j,v]=b.useState({total:0,pageSize:10,pageCount:0,page:1}),[x,w]=b.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),[M,B]=b.useState([]),K=[{label:i("notification.sendStatus.pending"),value:0,status:"pending"},{label:i("notification.sendStatus.success"),value:1,status:"success"},{label:i("notification.sendStatus.failed"),value:2,status:"failed"}],_=async()=>{if(!T&&t)try{N(!0);const o=await l({notificationId:t,...x}),r=o.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:ot(c.receiverUser.avatar,f,p)}}));P(r),v(o.paging),N(!1)}catch(o){V.error(o.message),N(!1)}};b.useEffect(()=>{_()},[x]);const Q=o=>{o.stopPropagation();const r=o.currentTarget;F.anchorEl=r;const c=r.getBoundingClientRect();F.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ee=o=>o.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Ae,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(We,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:Q,children:i("notification.resend")})}):null,Ne={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:i("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:j.page-1,rowsPerPage:j.pageSize,count:j.total,searchText:x.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:M,onRowSelectionChange:(o,r)=>{B(r.map(c=>c.dataIndex))},customToolbarSelect:ee},we=({page:o,rowsPerPage:r,searchText:c,filterList:C})=>{const[,k=[],$=[],q=[]]=C;x.pageSize!==r?w(W=>({...W,pageSize:r,page:1})):x.page!==o+1?w(W=>({...W,page:o+1})):x.searchText!==c?w(W=>({...W,searchText:c,page:1})):re(k,x.walletSendStatus)?re($,x.pushKitSendStatus)?re(q,x.emailSendStatus)||w(W=>({...W,emailSendStatus:q,page:1})):w(W=>({...W,pushKitSendStatus:$,page:1})):w(W=>({...W,walletSendStatus:k,page:1}))},me=b.useCallback(async(o,r)=>{if(!r)return!1;const c=await y(r);return c?o==="wallet"?Qt(c):o==="email"?Xt(S,c):o==="pushKit"?Jt(S,c):o==="webhook"?Zt(c):!0:!1},[y,S]),h=b.useCallback(o=>en(i,o),[i]),u=()=>{O.anchorEl=null,O.position=null,U(null)},m=()=>{F.anchorEl=null,F.position=null},g=async(o,r,c=!0,C="")=>{if(!(!r.length||!o.length))try{n(o,r,c,C),F.anchorEl||(await ge(.5),u())}catch(k){console.error("handleResend error",{error:k})}},D=async({channels:o,isResendFailedOnly:r})=>{const c=M.map(C=>A[C].receiver);await g(o,c,r),await ge(.5),m(),B([])},E=async(o,r=[],c=!0)=>{try{await g(["webhook"],[o.receiver],c,r)}catch(C){V.error(C.response?C.response.statusText:C.message)}},z=async(o,r,c,C=[],k=!0)=>{if(o.stopPropagation(),tn(r,c)>=4){V.warning(i("notification.resendLimit"));return}if(!ke.includes(c)){await E(r,C,k);return}if(o){const q=o.currentTarget,W=q.getBoundingClientRect();O.anchorEl=q,O.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}U({channel:c});try{const q=await me(c,r.receiver);await ge(1),U({channel:c,result:q}),(typeof q=="boolean"&&q||Ct(q)&&Object.values(q).every(W=>!!W))&&(await n([c],[r.receiver],k),F.anchorEl||(await ge(.5),u()))}catch(q){V.error(q.message)}},Y=o=>{w(r=>({...r,dateRange:o,page:1}))},te=(o,r,c,C)=>{o.stopPropagation();const k=c.filter($=>$!==r);w($=>({...$,[C]:k,page:1}))},ie=pe(()=>[{label:i("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:o=>{const{receiverUser:r,receiver:c}=A[o];return r?e.jsxs(R,{"data-cy":`member-name-${r.fullName}`,display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start",children:[e.jsx(st,{src:`${r.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(ue,{children:r.fullName})]},c):e.jsx(Lt,{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:x.walletSendStatus??[],customFilterListOptions:{render:o=>e.jsx(le,{list:o,label:"Wallet",onDelete:(r,c)=>{r.stopPropagation(),te(r,c,ie[1].options.filterList,"walletSendStatus")}}),update:je},filterOptions:{names:K,fullWidth:!0,logic:ve,display:(o,r,c,C)=>e.jsx(Re,{label:"Wallet",filterList:o,onChange:r,index:c,column:C,filterValues:K})},customBodyRenderLite:o=>{const{walletSendStatus:r,walletSendAt:c,walletSendFailedReason:C}=A[o];return e.jsx(oe,{status:r,updatedAt:c,reason:C,channel:"wallet",onResend:k=>z(k,A[o],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:o=>{const{pushKitSendStatus:r,pushKitSendAt:c,pushKitSendFailedReason:C}=A[o];return e.jsx(oe,{status:r,updatedAt:c,reason:C,channel:"pushkit",onResend:k=>z(k,A[o],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:x.pushKitSendStatus??[],customFilterListOptions:{render:o=>e.jsx(le,{list:o,label:"Push Kit",onDelete:(r,c)=>{r.stopPropagation(),te(r,c,ie[2].options.filterList,"pushKitSendStatus")}}),update:je},filterOptions:{names:K,fullWidth:!0,logic:ve,display:(o,r,c,C)=>e.jsx(Re,{label:"Push Kit",filterList:o,onChange:r,index:c,column:C,filterValues:K})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:o=>{const{emailSendStatus:r,emailSendAt:c,emailSendFailedReason:C}=A[o];return e.jsx(oe,{status:r,updatedAt:c,reason:C,channel:"email",onResend:k=>z(k,A[o],"email",[],!1)})},filter:!0,filterType:"custom",filterList:x.emailSendStatus??[],customFilterListOptions:{render:o=>e.jsx(le,{list:o,label:"Email",onDelete:(r,c)=>{r.stopPropagation(),te(r,c,ie[3].options.filterList,"emailSendStatus")}}),update:je},filterOptions:{names:K,fullWidth:!0,logic:ve,display:(o,r,c,C)=>e.jsx(Re,{label:"Email",filterList:o,onChange:r,index:c,column:C,filterValues:K})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:o=>{const{webhook:r}=A[o];if(!r)return null;const c=Object.entries(r)[0];if(!c)return null;const[C,k]=c,$=k[0];return e.jsx(R,{display:"flex",flexDirection:"column",gap:1,children:e.jsxs(R,{className:"webhook-item",fontSize:12,children:[e.jsx(ue,{maxLength:30,children:C},C),e.jsx(oe,{status:$.status,updatedAt:$.sendAt,reason:$.failedReason,channel:"webhook",onResend:q=>z(q,A[o],"webhook",[C],!1)})]},C)})}}},{label:i("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:o=>{const{createdAt:r}=A[o];return e.jsx(ze,{value:r,locale:a,shouldUpdate:!0})}}}],[A,a,x,i]),he=[e.jsx(Ue,{value:x.dateRange,onChange:Y},"date-picker"),e.jsx(Ae,{variant:"contained",size:"small",color:"primary",loading:T,startIcon:e.jsx(ut,{}),onClick:()=>_(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:i("common.refresh")},"refresh")];return e.jsx(R,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(on,{children:e.jsxs(nt,{theme:ht(),children:[e.jsx(at,{className:"receivers-table",locale:a,loading:T,columns:ie,data:A,onChange:we,options:Ne,customButtons:he,components:{TableFilterList:o=>e.jsx(Ve,{...o,itemComponent:r=>e.jsx(Se,{...r,canDelete:()=>!1})})}}),O.anchorEl&&e.jsx(Ee,{open:!!O.anchorEl,anchorReference:"anchorPosition",anchorPosition:O.position,onClose:u,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(rn,{children:[e.jsxs(G,{variant:"body1",component:"div",className:"check-title",children:[I==null?void 0:I.channel," Checking"]}),e.jsx(R,{display:"flex",flexDirection:"column",sx:{gap:"4px"},children:h(I==null?void 0:I.channel).map(o=>{var k,$;const{type:r,pass:c,fail:C}=o;return!(I!=null&&I.result)||(k=I==null?void 0:I.result)!=null&&k[r]?e.jsxs(G,{variant:"body1",component:"div",className:"check-item",display:"flex",alignItems:"center",sx:{gap:"4px",color:($=I==null?void 0:I.result)!=null&&$[r]?be.success.main:"inherit"},children:[I!=null&&I.result?e.jsx(ct,{}):e.jsx(tt,{size:12,sx:{color:be.primary.main}}),e.jsx("span",{children:c})]},r):e.jsxs(G,{variant:"body1",component:"div",display:"flex",alignItems:"center",className:"check-item",sx:{gap:"4px",color:be.error.main},children:[e.jsx(dt,{}),e.jsx("span",{children:C})]},r)})})]})}),F.anchorEl&&e.jsx(Ee,{open:!!F.anchorEl,anchorReference:"anchorPosition",anchorPosition:F.position,onClose:m,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(Ge,{loading:s,onCancel:m,onConfirm:D})})]})})})}const an=b.memo(gt),on=ae.div`
1
+ import{r as b}from"./vendor-react-DoD83n6N.js";import{j as e,E as d,a1 as Pe,R as bt,a4 as jt,T as G,a3 as R,A as Fe,bj as _e,co as et,cn as Te,bn as Ie,bO as De,x as ye,aj as Ee,a2 as tt,a9 as ae,V as nt,bd as Xe,bm as vt,bi as yt,ai as Je,cp as St}from"./vendor-mui-core-O22FPGM4.js";import{b as Z,av as re,z as Ct}from"./vendor-utils-DJ1bmiuG.js";import{V,p as L,a$ as Nt,r as Be,u as X,bM as wt,U as st,B as Ae,a2 as at,bd as be,ak as Rt,aq as Tt,bC as It}from"./vendor-ux-did-connect-B5nw4TRQ.js";import{z as Dt,G as H,m as Et,I as Qe}from"./index-BhbKurce.js";import{f as pe,a as Oe}from"./vendor-hooks-DbRTDIFw.js";import{S as ue}from"./shorten-label-DXrhdUJE.js";import{I as it}from"./index-4_QUE37Q.js";import{S as At,a as Ot}from"./list-Bdyc9H54.js";import{R as ze}from"./relative-time-CIac4Vr9.js";import{b as We}from"./dashboard-Nmo-Poy5.js";import{W as Lt}from"./did-address-D9OlxQFt.js";import{p as ot}from"./util-_pgMZdS5.js";import{D as kt,g as Pt}from"./traffic-CXaJh0Jn.js";import{B as rt}from"./bundle-avatar-Bf7QKB75.js";import{B as Ft}from"./index-C5gJZkAF.js";import"./lottie-web-B6s7dDoL.js";import"./vendor-arcblock-BWr5BBTC.js";import"./index-C46rA4HG.js";import"./InfoOutlined-BTxXD__0.js";import"./useLocalStorage-DCL1pEQ3.js";import"./confirm-CNExzJXC.js";import"./format-error-LAoTjvJe.js";import"./PlayArrow-ClplJQ8E.js";import"./get-safe-url-6wMoMTVj.js";import"./session-DQa5ee1Q.js";import"./useAsyncRetry-CcF3e_P6.js";import"./useAsync-CDzQ0uN6.js";import"./useSetState-BL3ktMon.js";import"./base32-Dyn18Qi9.js";import"./iframe-Ny6LguId.js";import"./LaunchOutlined-jIfvTGQO.js";import"./ChevronLeft-Df5JfrLj.js";import"./ChevronRight-CK3mt0BF.js";import"./index-DWJc5Rxl.js";import"./vendor-mui-x-K-9WHqhO.js";const lt=b.createContext({}),{Provider:_t,Consumer:es}=lt;function Bt({children:t,blocklet:n=""}){const{api:s,inService:i}=Dt(),[a,l]=b.useState([]),[p,f]=b.useState({total:0,pageSize:20,pageCount:0,page:1}),y=pe(()=>{var j;return(j=n.meta)==null?void 0:j.did},[n]),[S,T]=b.useState([]),N=async({page:j=1,pageSize:v=20,...x}={})=>{if(!y)return[];try{const w={paging:{page:j,pageSize:v},...x,teamDid:y,dateRange:x.dateRange?[H(x.dateRange[0]).toISOString(),H(x.dateRange[1]).toISOString()]:void 0},{dids:M,...B}=w;let K="";M.includes("system")&&(K="system");const _=M.filter(ee=>ee!=="system"),Q=await s.getNotificationSendLog({input:{...B,source:K,componentDids:_}});return l(Q.list),f(Q.paging),Q.list}catch(w){return V.error(w.message),[]}},A=async()=>{const j=await s.getNotificationComponents({input:{teamDid:y}});T(j.componentDids)},P=b.useCallback(j=>{const v=n.children.find(x=>{var w;return((w=x.meta)==null?void 0:w.did)===j});if(v)return v.ancestors=[n],v},[n]),O=async({notificationId:j,receivers:v,channels:x,...w})=>{await s.resendNotification({input:{teamDid:y,notificationId:j,receivers:v,channels:x.map(M=>M==="wallet"?L.NOTIFICATION_SEND_CHANNEL.WALLET:M==="pushKit"?L.NOTIFICATION_SEND_CHANNEL.PUSH:M),...w}})},F=b.useCallback(async j=>(await s.getUser({input:{teamDid:y,user:{did:j}}})).user,[s,y]),I=b.useCallback(async({page:j=1,pageSize:v=20,...x}={})=>{try{const w={paging:{page:j,pageSize:v},...x,userName:x.searchText||"",teamDid:y,dateRange:x.dateRange?[H(x.dateRange[0]).toISOString(),H(x.dateRange[1]).toISOString()]:void 0};return await s.getReceivers({input:w})}catch(w){throw V.error(w.message),w}},[s,y]);b.useEffect(()=>{y&&A()},[y]);const U={fetch:N,data:a,paging:p,blocklet:n,getComponent:P,resendNotification:O,getUser:F,componentDids:S,getReceivers:I,inService:i,teamDid:y};return e.jsx(_t,{value:{notificationRecords:U},children:t})}function Me(){const{notificationRecords:t}=b.useContext(lt);return t}fe.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const zt={info:"primary",success:"success",error:"error",warning:"warning"};function fe({severity:t="info"}){return e.jsx(Nt,{type:zt[t],children:t})}var qe={},Wt=Pe;Object.defineProperty(qe,"__esModule",{value:!0});var ct=qe.default=void 0,Mt=Wt(Be()),qt=e;ct=qe.default=(0,Mt.default)((0,qt.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 Ke={},Kt=Pe;Object.defineProperty(Ke,"__esModule",{value:!0});var dt=Ke.default=void 0,$t=Kt(Be()),Ht=e;dt=Ke.default=(0,$t.default)((0,Ht.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 $e={},Ut=Pe;Object.defineProperty($e,"__esModule",{value:!0});var ut=$e.default=void 0,Vt=Ut(Be()),Gt=e;ut=$e.default=(0,Vt.default)((0,Gt.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 Yt=(t,n,s="")=>{if(!s||!n)return"";switch(s){case L.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:n});case L.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:n});case L.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:n});case L.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return s}};function pt(t,n,s={}){const{status:i,updatedAt:a,reason:l="",channel:p="wallet"}=s,f=a?t("notification.sendStatus.sentTime",{date:Et(a,n)}):"",y=Yt(t,p,l);return i===L.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:f,reason:y}:i===L.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:f}:{status:"pending",title:t("notification.sendStatus.pending"),reason:y,sentTime:f}}const Le={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},ke=["wallet","pushKit","email"],Ze=["info","success","error","warning"],ft=t=>{var s,i;const{settings:n}=t;return(i=(s=n==null?void 0:n.notification)==null?void 0:s.email)==null?void 0:i.enabled},mt=t=>{var s,i;const{settings:n}=t;return(i=(s=n==null?void 0:n.notification)==null?void 0:s.pushKit)==null?void 0:i.enabled},Xt=(t,n)=>{const s=Z(n,"extra.notifications.email",!0);return{available:ft(t),enabled:s}},Jt=(t,n)=>{const s=Z(n,"extra.notifications.push",!0);return{available:mt(t),enabled:s}},Qt=t=>({enabled:Z(t,"extra.notifications.wallet",!0)}),Zt=t=>({enabled:Z(t,"extra.webhooks",[]).length>0}),ge=(t=3)=>new Promise(n=>{setTimeout(()=>{n()},t*1e3)}),en=(t,n)=>n==="wallet"||n==="webhook"?[{channel:n,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:n}),fail:t("notification.sendStatus.reason.disabled",{channel:n})}]:n==="pushKit"||n==="email"?[{channel:n,type:"available",pass:t("notification.sendStatus.reason.available",{channel:n}),fail:t("notification.sendStatus.reason.unavailable",{channel:n})},{channel:n,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:n}),fail:t("notification.sendStatus.reason.disabled",{channel:n})}]:[],xe=(t=[])=>{const n=H().startOf("day");return t.filter(s=>H(s.sendAt).isSame(n,"day")).length},tn=(t,n="")=>{if(n&&ke.includes(n)){const l=`${n}SendRecord`,p=Z(t,l,[]);return xe(p)}const s=Z(t,"webhook",{}),i=Object.keys(s??{})??[];if(n&&i.includes(n)){const l=s[n]??[];return xe(l)}const a={};return ke.forEach(l=>{const p=`${l}SendRecord`,f=Z(t,p,[]),y=xe(f);a[l]=y}),i.length>0&&i.forEach(l=>{const p=s[l]??[],f=xe(p);a[l]=f}),a},je=(t,n,s)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[s].splice(n,1),t},ve=(t,n)=>{if(!Array.isArray(n))throw new Error("filters must be an array");return n.length?!n.includes(t):!1},nn=t=>{switch(t){case L.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case L.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case L.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case L.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ht=()=>bt({typography:{fontSize:14,button:{textTransform:"none"}},palette:{primary:{main:"#1DC1C7",contrastText:"#fff"},secondary:{main:"#030712",contrastText:"#fff"},storeSecondary:{main:"#EBFEFF",contrastText:"#fff"}},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 J({config:t,enableTooltip:n=!0,showTitle:s=!1,children:i}){const{status:a,title:l="",sentTime:p="",reason:f=""}=t,y=[l,f].filter(Boolean).join(", ");return e.jsx(jt,{title:n?e.jsxs(e.Fragment,{children:[e.jsx(G,{color:"inherit",sx:{fontSize:12},children:y}),e.jsx("span",{children:p})]}):null,arrow:!0,placement:"top",children:e.jsxs(R,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(R,{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center",children:[e.jsx(R,{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Le[a],style:{opacity:.15}}),e.jsx(R,{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[a]})]}),e.jsx(G,{color:"inherit",sx:{fontSize:12},children:s?l:i})]})})}J.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};J.defaultProps={enableTooltip:!0,showTitle:!1,children:null};le.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};le.defaultProps={onDelete:()=>{}};function le({list:t,label:n,onDelete:s}){const{t:i,locale:a}=X();return e.jsxs(R,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(G,{children:[n,": "]}),t.map(l=>{const p=pt(i,a,{status:l});return e.jsx(Fe,{size:"small",label:e.jsx(R,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(J,{config:p,enableTooltip:!1,children:p.title})}),onDelete:f=>s(f,l)},l)})]})}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:n,index:s,column:i,filterValues:a,label:l,renderLabel:p}){return e.jsxs(_e,{className:"filter-container",children:[e.jsx(et,{component:"legend",children:l}),e.jsx(Te,{row:!0,children:a.map(f=>e.jsx(Ie,{control:e.jsx(De,{checked:t[s].indexOf(f.value??f)>-1,onChange:y=>{const S=[...t];y.target.checked?S[s]=[...S[s],f.value??f]:S[s]=S[s].filter(T=>T!==(f.value??f)),n(S[s],s,i)},name:f.value??f}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:p(f)})},f.value??f))})]})}function Re(t){return e.jsx(He,{...t,renderLabel:n=>e.jsx(J,{enableTooltip:!1,config:{status:n.status},children:n.label})})}oe.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function oe({status:t,updatedAt:n,reason:s="",channel:i="wallet",onResend:a}){const{t:l,locale:p}=X(),f=pt(l,p,{status:t,updatedAt:n,reason:s,channel:i});return e.jsxs(R,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(J,{config:f,showTitle:!0}),f.status!=="success"&&e.jsx(ye,{className:"resend-btn",size:"small",startIcon:e.jsx(We,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:a,children:l("notification.resend")})]})}Ue.propTypes={value:d.array.isRequired,onChange:d.func};function Ue({value:t,onChange:n}){const{locale:s}=X(),i=H().toDate(),[a,l]=b.useState(null),p=b.useCallback(S=>{l(a?null:S.currentTarget)},[a]),f=!!a,y=b.useCallback(S=>{if(!S.startDate||!S.endDate){V.error("Please select a date range");return}if(H(S.startDate).isAfter(S.endDate)||!H(S.startDate).isValid()||!H(S.endDate).isValid()){V.error("Invalid date range");return}n([S.startDate,S.endDate]),l(null)},[n]);return e.jsxs("div",{children:[e.jsx(G,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:0,children:e.jsxs(ye,{onClick:p,variant:"outlined",size:"small",color:"inherit",children:[Qe(t[0],s)," - ",Qe(t[1],s)]})}),e.jsx(Ee,{open:f,anchorEl:a,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(kt,{open:!0,maxDate:i,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:p,definedRanges:Pt(i),onChange:y})})]})}Ve.propTypes={itemComponent:d.elementType.isRequired};function Ve({itemComponent:t,...n}){var a;const{t:s}=X();return!((a=n==null?void 0:n.filterList)!=null&&a.filter(l=>l.length).length)?null:e.jsxs(R,{display:"flex",gap:1,alignItems:"center",children:[e.jsx("div",{className:"toolbar-filter-title",children:s("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(wt.TableFilterList,{...n,ItemComponent:t})})]})}function Se({label:t,onDelete:n,canDelete:s=()=>!0,...i}){const a=n&&typeof n=="function"?n:void 0;let l=!0;return s&&typeof s=="function"&&(l=s({label:t,...i})),e.jsx(Fe,{label:t,variant:"outlined",...a&&l?{onDelete:a}:{}})}Se.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};Se.defaultProps={canDelete:()=>!0};const sn=[{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}];Ge.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};Ge.defaultProps={loading:!1,onCancel:()=>{},onConfirm:()=>{}};function Ge({loading:t=!1,onCancel:n,onConfirm:s}){const{t:i}=X(),[a,l]=b.useState(sn),[p,f]=b.useState(!0),y=(T,N)=>{N.checked=T.target.checked;const A=a.map(P=>({...P,checked:P.value===N.value?N.checked:P.checked}));l(A)},S=T=>{T.stopPropagation(),s({channels:a.filter(N=>N.checked).map(N=>N.value),isResendFailedOnly:p})};return e.jsxs(R,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(G,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:i("notification.config")}),e.jsx(R,{className:"choose-channel",children:e.jsxs(_e,{component:"fieldset",variant:"standard",children:[e.jsx(et,{component:"legend",children:i("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:a.map(T=>e.jsx(Ie,{control:e.jsx(De,{checked:T.checked,onChange:N=>y(N,T),name:T.value}),label:T.label},T.value))})]})}),e.jsx(R,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Ie,{control:e.jsx(De,{checked:p,onChange:T=>f(T.target.checked)}),label:i("notification.resendFailedOnly")})})}),e.jsxs(R,{display:"flex",justifyContent:"flex-end",gap:1,className:"resend-config-footer-tip",children:[e.jsx(ye,{onClick:T=>{T.stopPropagation(),n()},color:"inherit",children:i("common.cancel")}),e.jsxs(ye,{onClick:S,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(tt,{size:16}),i("common.confirm")]})]})]})}gt.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function gt({notificationId:t,handleResend:n,resending:s=!1}){const{t:i,locale:a}=X(),{getReceivers:l,inService:p,teamDid:f,getUser:y,blocklet:S}=Me(),[T,N]=b.useState(!1),[A,P]=b.useState([]),O=Oe({anchorEl:null,position:null}),F=Oe({anchorEl:null,position:null}),[I,U]=b.useState(null),[j,v]=b.useState({total:0,pageSize:10,pageCount:0,page:1}),[x,w]=b.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),[M,B]=b.useState([]),K=[{label:i("notification.sendStatus.pending"),value:0,status:"pending"},{label:i("notification.sendStatus.success"),value:1,status:"success"},{label:i("notification.sendStatus.failed"),value:2,status:"failed"}],_=async()=>{if(!T&&t)try{N(!0);const o=await l({notificationId:t,...x}),r=o.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:ot(c.receiverUser.avatar,f,p)}}));P(r),v(o.paging),N(!1)}catch(o){V.error(o.message),N(!1)}};b.useEffect(()=>{_()},[x]);const Q=o=>{o.stopPropagation();const r=o.currentTarget;F.anchorEl=r;const c=r.getBoundingClientRect();F.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ee=o=>o.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Ae,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(We,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:Q,children:i("notification.resend")})}):null,Ne={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:i("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:j.page-1,rowsPerPage:j.pageSize,count:j.total,searchText:x.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:M,onRowSelectionChange:(o,r)=>{B(r.map(c=>c.dataIndex))},customToolbarSelect:ee},we=({page:o,rowsPerPage:r,searchText:c,filterList:C})=>{const[,k=[],$=[],q=[]]=C;x.pageSize!==r?w(W=>({...W,pageSize:r,page:1})):x.page!==o+1?w(W=>({...W,page:o+1})):x.searchText!==c?w(W=>({...W,searchText:c,page:1})):re(k,x.walletSendStatus)?re($,x.pushKitSendStatus)?re(q,x.emailSendStatus)||w(W=>({...W,emailSendStatus:q,page:1})):w(W=>({...W,pushKitSendStatus:$,page:1})):w(W=>({...W,walletSendStatus:k,page:1}))},me=b.useCallback(async(o,r)=>{if(!r)return!1;const c=await y(r);return c?o==="wallet"?Qt(c):o==="email"?Xt(S,c):o==="pushKit"?Jt(S,c):o==="webhook"?Zt(c):!0:!1},[y,S]),h=b.useCallback(o=>en(i,o),[i]),u=()=>{O.anchorEl=null,O.position=null,U(null)},m=()=>{F.anchorEl=null,F.position=null},g=async(o,r,c=!0,C="")=>{if(!(!r.length||!o.length))try{n(o,r,c,C),F.anchorEl||(await ge(.5),u())}catch(k){console.error("handleResend error",{error:k})}},D=async({channels:o,isResendFailedOnly:r})=>{const c=M.map(C=>A[C].receiver);await g(o,c,r),await ge(.5),m(),B([])},E=async(o,r=[],c=!0)=>{try{await g(["webhook"],[o.receiver],c,r)}catch(C){V.error(C.response?C.response.statusText:C.message)}},z=async(o,r,c,C=[],k=!0)=>{if(o.stopPropagation(),tn(r,c)>=4){V.warning(i("notification.resendLimit"));return}if(!ke.includes(c)){await E(r,C,k);return}if(o){const q=o.currentTarget,W=q.getBoundingClientRect();O.anchorEl=q,O.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}U({channel:c});try{const q=await me(c,r.receiver);await ge(1),U({channel:c,result:q}),(typeof q=="boolean"&&q||Ct(q)&&Object.values(q).every(W=>!!W))&&(await n([c],[r.receiver],k),F.anchorEl||(await ge(.5),u()))}catch(q){V.error(q.message)}},Y=o=>{w(r=>({...r,dateRange:o,page:1}))},te=(o,r,c,C)=>{o.stopPropagation();const k=c.filter($=>$!==r);w($=>({...$,[C]:k,page:1}))},ie=pe(()=>[{label:i("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:o=>{const{receiverUser:r,receiver:c}=A[o];return r?e.jsxs(R,{"data-cy":`member-name-${r.fullName}`,display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start",children:[e.jsx(st,{src:`${r.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(ue,{children:r.fullName})]},c):e.jsx(Lt,{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:x.walletSendStatus??[],customFilterListOptions:{render:o=>e.jsx(le,{list:o,label:"Wallet",onDelete:(r,c)=>{r.stopPropagation(),te(r,c,ie[1].options.filterList,"walletSendStatus")}}),update:je},filterOptions:{names:K,fullWidth:!0,logic:ve,display:(o,r,c,C)=>e.jsx(Re,{label:"Wallet",filterList:o,onChange:r,index:c,column:C,filterValues:K})},customBodyRenderLite:o=>{const{walletSendStatus:r,walletSendAt:c,walletSendFailedReason:C}=A[o];return e.jsx(oe,{status:r,updatedAt:c,reason:C,channel:"wallet",onResend:k=>z(k,A[o],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:o=>{const{pushKitSendStatus:r,pushKitSendAt:c,pushKitSendFailedReason:C}=A[o];return e.jsx(oe,{status:r,updatedAt:c,reason:C,channel:"pushkit",onResend:k=>z(k,A[o],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:x.pushKitSendStatus??[],customFilterListOptions:{render:o=>e.jsx(le,{list:o,label:"Push Kit",onDelete:(r,c)=>{r.stopPropagation(),te(r,c,ie[2].options.filterList,"pushKitSendStatus")}}),update:je},filterOptions:{names:K,fullWidth:!0,logic:ve,display:(o,r,c,C)=>e.jsx(Re,{label:"Push Kit",filterList:o,onChange:r,index:c,column:C,filterValues:K})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:o=>{const{emailSendStatus:r,emailSendAt:c,emailSendFailedReason:C}=A[o];return e.jsx(oe,{status:r,updatedAt:c,reason:C,channel:"email",onResend:k=>z(k,A[o],"email",[],!1)})},filter:!0,filterType:"custom",filterList:x.emailSendStatus??[],customFilterListOptions:{render:o=>e.jsx(le,{list:o,label:"Email",onDelete:(r,c)=>{r.stopPropagation(),te(r,c,ie[3].options.filterList,"emailSendStatus")}}),update:je},filterOptions:{names:K,fullWidth:!0,logic:ve,display:(o,r,c,C)=>e.jsx(Re,{label:"Email",filterList:o,onChange:r,index:c,column:C,filterValues:K})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:o=>{const{webhook:r}=A[o];if(!r)return null;const c=Object.entries(r)[0];if(!c)return null;const[C,k]=c,$=k[0];return e.jsx(R,{display:"flex",flexDirection:"column",gap:1,children:e.jsxs(R,{className:"webhook-item",fontSize:12,children:[e.jsx(ue,{maxLength:30,children:C},C),e.jsx(oe,{status:$.status,updatedAt:$.sendAt,reason:$.failedReason,channel:"webhook",onResend:q=>z(q,A[o],"webhook",[C],!1)})]},C)})}}},{label:i("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:o=>{const{createdAt:r}=A[o];return e.jsx(ze,{value:r,locale:a,shouldUpdate:!0})}}}],[A,a,x,i]),he=[e.jsx(Ue,{value:x.dateRange,onChange:Y},"date-picker"),e.jsx(Ae,{variant:"contained",size:"small",color:"primary",loading:T,startIcon:e.jsx(ut,{}),onClick:()=>_(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:i("common.refresh")},"refresh")];return e.jsx(R,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(on,{children:e.jsxs(nt,{theme:ht(),children:[e.jsx(at,{className:"receivers-table",locale:a,loading:T,columns:ie,data:A,onChange:we,options:Ne,customButtons:he,components:{TableFilterList:o=>e.jsx(Ve,{...o,itemComponent:r=>e.jsx(Se,{...r,canDelete:()=>!1})})}}),O.anchorEl&&e.jsx(Ee,{open:!!O.anchorEl,anchorReference:"anchorPosition",anchorPosition:O.position,onClose:u,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(rn,{children:[e.jsxs(G,{variant:"body1",component:"div",className:"check-title",children:[I==null?void 0:I.channel," Checking"]}),e.jsx(R,{display:"flex",flexDirection:"column",sx:{gap:"4px"},children:h(I==null?void 0:I.channel).map(o=>{var k,$;const{type:r,pass:c,fail:C}=o;return!(I!=null&&I.result)||(k=I==null?void 0:I.result)!=null&&k[r]?e.jsxs(G,{variant:"body1",component:"div",className:"check-item",display:"flex",alignItems:"center",sx:{gap:"4px",color:($=I==null?void 0:I.result)!=null&&$[r]?be.success.main:"inherit"},children:[I!=null&&I.result?e.jsx(ct,{}):e.jsx(tt,{size:12,sx:{color:be.primary.main}}),e.jsx("span",{children:c})]},r):e.jsxs(G,{variant:"body1",component:"div",display:"flex",alignItems:"center",className:"check-item",sx:{gap:"4px",color:be.error.main},children:[e.jsx(dt,{}),e.jsx("span",{children:C})]},r)})})]})}),F.anchorEl&&e.jsx(Ee,{open:!!F.anchorEl,anchorReference:"anchorPosition",anchorPosition:F.position,onClose:m,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(Ge,{loading:s,onCancel:m,onConfirm:D})})]})})})}const an=b.memo(gt),on=ae.div`
2
2
  td.MuiTableCell-footer {
3
3
  border: none !important;
4
4
  }
@@ -1,4 +1,4 @@
1
- import{r as d}from"./vendor-react-DoD83n6N.js";import{E as l,j as r,a3 as g,a$ as G,M as H,I as O,a2 as U,bT as Y,a9 as J}from"./vendor-mui-core-hTL6kZTm.js";import{aX as Q,f as Z}from"./vendor-ux-did-connect-D0ByM4P8.js";import{d as v}from"./Done-Dx6K5vD2.js";import{C as ee}from"./Google-CbbG9VdQ.js";import{aa as te,f as re}from"./index-nrlaL_bT.js";import{l as ne}from"./vendor-arcblock-BsgV25xS.js";import{R as oe,F as se,L as ie}from"./logo-uploader-C9lDQRIH.js";const S={description:l.string,editing:l.bool,onChange:l.func,required:l.bool,value:l.any,componentProps:l.object,render:l.func,renderFormItem:l.func};function T({editing:n,value:o,onChange:a}){const[c,u]=d.useState(!1),m=d.useRef(),p=d.useRef(o);d.useEffect(()=>{let s=null;return n&&(s=setTimeout(()=>{u(!0)},50)),()=>{clearTimeout(s)}},[n]);const k=s=>{p.current=s,a(s)},C=()=>{u(!1),a(p.current)},b=r.jsx(g,{className:"form-item-input slot",px:1,children:r.jsxs(g,{display:"flex",alignItems:"center",children:[o,o!=="auto"&&r.jsx("div",{style:{marginLeft:4,backgroundColor:o,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),f=r.jsxs(g,{display:"flex",flexGrow:1,alignItems:"center",height:"40px",onKeyDown:C,children:[r.jsx(g,{display:"flex",alignItems:"center",onClick:()=>u(!0),children:r.jsx("div",{ref:m,style:{flexShrink:0,marginLeft:"8px",backgroundColor:o,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:o==="auto"?"default":"pointer"}})}),r.jsx(G,{open:c,anchorEl:m.current,onClose:()=>u(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:r.jsx(ee,{color:o,onChange:s=>k(s.hex)})})]});return n?f:b}T.propTypes=S;function _({editing:n,description:o,value:a,onChange:c,componentProps:u,...m}){const{placeholder:p}=u,k=d.useRef(a),{t:C}=d.useContext(Q),b=s=>{s.key==="Enter"&&c(k.current,"confirm")},f=s=>{k.current=s,c(s)};return n?r.jsx(H,{style:{flex:1},fullWidth:!0,value:a,onChange:s=>{s.persist(),f(s.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:o||p,onKeyDown:b,...m}):r.jsx(g,{px:1,className:"form-item-input slot",children:a||r.jsx("span",{className:"placeholder",children:C("common.requiredInputPlaceholder",{name:o||p})})})}_.propTypes=S;_.defaultProps={componentProps:{}};function D({editing:n,value:o,onChange:a,componentProps:c,...u}){const{blocklet:m}=c,p=o==="auto"?ne.getPassportColorFromDid(m.appDid):o;return r.jsxs(g,{display:"flex",alignItems:"center",children:[r.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:te({title:"Owner",issuer:re.getDisplayName(m),issuerDid:m.appDid,ownerName:"Your Name",ownerDid:m.appDid,preferredColor:o||"auto"})}}),r.jsx(T,{...u,editing:n,value:n?p:o,onChange:a,componentProps:c})]})}D.propTypes={...S,componentProps:l.shape({blocklet:l.object.isRequired}).isRequired};D.defaultProps={};const ae=Y`
1
+ import{r as d}from"./vendor-react-DoD83n6N.js";import{E as l,j as r,a3 as g,aj as G,M as H,I as O,a2 as U,bT as Y,a9 as J}from"./vendor-mui-core-O22FPGM4.js";import{aX as Q,f as Z}from"./vendor-ux-did-connect-B5nw4TRQ.js";import{d as v}from"./Done-CiWu790H.js";import{C as ee}from"./Google-49EJIWMZ.js";import{aa as te,f as re}from"./index-BhbKurce.js";import{l as ne}from"./vendor-arcblock-BWr5BBTC.js";import{R as oe,F as se,L as ie}from"./logo-uploader-BteC4lk2.js";const S={description:l.string,editing:l.bool,onChange:l.func,required:l.bool,value:l.any,componentProps:l.object,render:l.func,renderFormItem:l.func};function T({editing:n,value:o,onChange:a}){const[c,u]=d.useState(!1),m=d.useRef(),p=d.useRef(o);d.useEffect(()=>{let s=null;return n&&(s=setTimeout(()=>{u(!0)},50)),()=>{clearTimeout(s)}},[n]);const k=s=>{p.current=s,a(s)},C=()=>{u(!1),a(p.current)},b=r.jsx(g,{className:"form-item-input slot",px:1,children:r.jsxs(g,{display:"flex",alignItems:"center",children:[o,o!=="auto"&&r.jsx("div",{style:{marginLeft:4,backgroundColor:o,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),f=r.jsxs(g,{display:"flex",flexGrow:1,alignItems:"center",height:"40px",onKeyDown:C,children:[r.jsx(g,{display:"flex",alignItems:"center",onClick:()=>u(!0),children:r.jsx("div",{ref:m,style:{flexShrink:0,marginLeft:"8px",backgroundColor:o,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:o==="auto"?"default":"pointer"}})}),r.jsx(G,{open:c,anchorEl:m.current,onClose:()=>u(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:r.jsx(ee,{color:o,onChange:s=>k(s.hex)})})]});return n?f:b}T.propTypes=S;function _({editing:n,description:o,value:a,onChange:c,componentProps:u,...m}){const{placeholder:p}=u,k=d.useRef(a),{t:C}=d.useContext(Q),b=s=>{s.key==="Enter"&&c(k.current,"confirm")},f=s=>{k.current=s,c(s)};return n?r.jsx(H,{style:{flex:1},fullWidth:!0,value:a,onChange:s=>{s.persist(),f(s.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:o||p,onKeyDown:b,...m}):r.jsx(g,{px:1,className:"form-item-input slot",children:a||r.jsx("span",{className:"placeholder",children:C("common.requiredInputPlaceholder",{name:o||p})})})}_.propTypes=S;_.defaultProps={componentProps:{}};function D({editing:n,value:o,onChange:a,componentProps:c,...u}){const{blocklet:m}=c,p=o==="auto"?ne.getPassportColorFromDid(m.appDid):o;return r.jsxs(g,{display:"flex",alignItems:"center",children:[r.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:te({title:"Owner",issuer:re.getDisplayName(m),issuerDid:m.appDid,ownerName:"Your Name",ownerDid:m.appDid,preferredColor:o||"auto"})}}),r.jsx(T,{...u,editing:n,value:n?p:o,onChange:a,componentProps:c})]})}D.propTypes={...S,componentProps:l.shape({blocklet:l.object.isRequired}).isRequired};D.defaultProps={};const ae=Y`
2
2
  0%, 100% {
3
3
  transform: scale(1) translateX(0);
4
4
  }