@abtnode/webapp 1.16.47 → 1.16.48
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.
- package/blocklet.js +1 -1
- package/blocklet.yml +1 -1
- package/dist/assets/{AdapterDayjs-DxldUmxe.js → AdapterDayjs-CMmkTpH7.js} +1 -1
- package/dist/assets/{Add-BN88qEGx.js → Add-S-3I84b8.js} +1 -1
- package/dist/assets/ArrowDropDown-IcntJnxN.js +1 -0
- package/dist/assets/{Autocomplete-3llPzwt1.js → Autocomplete-BaEPlYLx.js} +1 -1
- package/dist/assets/{Breadcrumbs-DvNnpRQ0.js → Breadcrumbs-BiRfhuZp.js} +1 -1
- package/dist/assets/{ButtonGroup-B-9GSfHZ.js → ButtonGroup-Bb6jDsD1.js} +1 -1
- package/dist/assets/{CSSTransition-6L6IgdSY.js → CSSTransition-wxeeFOKf.js} +1 -1
- package/dist/assets/{CallMerge-vNTkdXiw.js → CallMerge-D7rsNNxc.js} +1 -1
- package/dist/assets/{CardContent-BPg_sEF2.js → CardContent-F-Sbai2s.js} +1 -1
- package/dist/assets/{ChevronLeft-CtquRnl8.js → ChevronLeft-DADCIS34.js} +1 -1
- package/dist/assets/{ChevronRight-CAszk4lp.js → ChevronRight-B_f9hb86.js} +1 -1
- package/dist/assets/{Clear-BCMMWwCD.js → Clear-v5WhrN0k.js} +1 -1
- package/dist/assets/{DeleteOutline-BKc7Kldo.js → DeleteOutline-DkhKATuN.js} +1 -1
- package/dist/assets/{Done-YvMjYKuk.js → Done-BrXgYrm-.js} +1 -1
- package/dist/assets/{Edit-COEQaq3a.js → Edit-b0bQueoc.js} +1 -1
- package/dist/assets/{ErrorOutline-OXo_CAtp.js → ErrorOutline-cbP6hbrl.js} +1 -1
- package/dist/assets/{FilterList-ZxgoMe-m.js → FilterList-CETwaOot.js} +1 -1
- package/dist/assets/{Google-DPJzLE0p.js → Google-G2hBKskK.js} +1 -1
- package/dist/assets/{HelpOutline-CzlcjtgK.js → HelpOutline-DaPSpbPH.js} +1 -1
- package/dist/assets/{Launch-D5z_vGpP.js → Launch-CxDOgvl0.js} +1 -1
- package/dist/assets/{Link-Dr3mLcwZ.js → Link-CCQ4Xrxg.js} +1 -1
- package/dist/assets/{ListItemButton-rknI-Gaw.js → ListItemButton-f6NCT9iY.js} +1 -1
- package/dist/assets/{ListSubheader-BgKcqOo-.js → ListSubheader-YCstldBv.js} +1 -1
- package/dist/assets/{LoadingButton-Bh0ogaQd.js → LoadingButton-DY_lGC3z.js} +1 -1
- package/dist/assets/{MoreVert-Nin8ZqO7.js → MoreVert-C716pe1M.js} +1 -1
- package/dist/assets/{OpenInNew-BetMIusn.js → OpenInNew-8_57FieH.js} +1 -1
- package/dist/assets/{Refresh-CDUQoVtN.js → Refresh-lnreJErX.js} +1 -1
- package/dist/assets/{Search-D7jj6_W7.js → Search-hhDB6YL9.js} +1 -1
- package/dist/assets/{Slider-Czj7jdSV.js → Slider-DMeR2md5.js} +1 -1
- package/dist/assets/{Stepper-BAuop15X.js → Stepper-CKg6__EK.js} +1 -1
- package/dist/assets/{Switch-dRW18BhE.js → Switch-CEsPeHy7.js} +1 -1
- package/dist/assets/{TableSearch-94MsMfky.js → TableSearch-Lg4M-8KA.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-DpgDQW9s.js → ToggleButtonGroup-prN9b22p.js} +1 -1
- package/dist/assets/{Verified-Bdehddj8.js → Verified-YDT1ukv5.js} +1 -1
- package/dist/assets/{VerifiedUser-CU0d_ZSY.js → VerifiedUser-DjH4G4q1.js} +1 -1
- package/dist/assets/{ViewList-BumM5a7M.js → ViewList-Bwe4mYRB.js} +1 -1
- package/dist/assets/{_createAggregator-Bg_NDeg-.js → _createAggregator-ctoSszuV.js} +1 -1
- package/dist/assets/{actions-DjQup7cY.js → actions-BIszN-OK.js} +1 -1
- package/dist/assets/{actions-16uUMkwj.js → actions-D4Kz7IAL.js} +1 -1
- package/dist/assets/{agreement-Dzv6VnT4.js → agreement-B39z5WNn.js} +1 -1
- package/dist/assets/api-BPsZ_jNB.js +1 -0
- package/dist/assets/{appearance-yYeCxYXB.js → appearance-BRueUKRZ.js} +1 -1
- package/dist/assets/{audit-logs-DifMs8a1.js → audit-logs-ZvNCA3Zx.js} +1 -1
- package/dist/assets/{base-chart-BNJ6N5xc.js → base-chart-DZ65G0Up.js} +1 -1
- package/dist/assets/{blocklet-NsEfDg6l.js → blocklet-vLRH388n.js} +1 -1
- package/dist/assets/{chain-DkgxMmoB.js → chain-DS4Hjfmr.js} +1 -1
- package/dist/assets/{click-to-copy-lOPobaPV.js → click-to-copy-D5YohLRv.js} +1 -1
- package/dist/assets/client-bjR3BWE3.js +1 -0
- package/dist/assets/cloneDeep-CNxnXGqe.js +1 -0
- package/dist/assets/{collapse-ICZWDlS4.js → collapse-D_6eVE_q.js} +1 -1
- package/dist/assets/{config-navigation-BqxXssjI.js → config-navigation-DXRA92Ph.js} +3 -3
- package/dist/assets/{connect-to-xoL-ebGz.js → connect-to-lgGqqqWV.js} +1 -1
- package/dist/assets/{cssMode-CDMfiTxl.js → cssMode-IX2WeX_E.js} +1 -1
- package/dist/assets/{delete-confirm-Dli6LanI.js → delete-confirm-CKWr12s3.js} +1 -1
- package/dist/assets/{depsEqual-BqZSotpa.js → depsEqual-CfdoQRpO.js} +1 -1
- package/dist/assets/{detail-tdqW_KRG.js → detail-BnDNU4xS.js} +3 -3
- package/dist/assets/{domains-Bq2hWN95.js → domains-DbIh7fxa.js} +1 -1
- package/dist/assets/{download-wrCdMePG.js → download-CX5ROtbY.js} +1 -1
- package/dist/assets/{edit.svg-D3nj0Coq.js → edit.svg-1dKJigcF.js} +1 -1
- package/dist/assets/emotion-cache.browser.esm-BkCEErJn.js +1 -0
- package/dist/assets/engine-O4HpK5Dx.js +1 -0
- package/dist/assets/{freemarker2-CxEfgQOn.js → freemarker2-Ci6NhYtQ.js} +1 -1
- package/dist/assets/{get-safe-url-R3PVxGdM.js → get-safe-url-CVrrblG0.js} +1 -1
- package/dist/assets/getValidReactChildren-DJQKILMh.js +1 -0
- package/dist/assets/{graphqlMode-B3nojvdv.js → graphqlMode-CUUxEJv4.js} +2 -2
- package/dist/assets/{handlebars-02SbR3jU.js → handlebars-SXl07VWN.js} +1 -1
- package/dist/assets/{html-ImYFEZL0.js → html-f82gCVQF.js} +1 -1
- package/dist/assets/{html-title-22l2Q1um.js → html-title-s4xKUvYC.js} +1 -1
- package/dist/assets/{htmlMode-B11jxoOP.js → htmlMode-BQkLubkF.js} +1 -1
- package/dist/assets/{iframe-BUEP2Jl5.js → iframe-D0ox4iMz.js} +1 -1
- package/dist/assets/{index-CTR7ZstQ.js → index-0y0GUu_H.js} +1 -1
- package/dist/assets/{index-Cq2A6apl.js → index-1LmYeNoL.js} +1 -1
- package/dist/assets/{index-CK3GxImb.js → index-BHmKNTQs.js} +1 -1
- package/dist/assets/{index-ywCf0mQ1.js → index-BK-A1qdT.js} +1 -1
- package/dist/assets/{index-DjuYIY1a.js → index-BLKRAGfo.js} +1 -1
- package/dist/assets/{index-CiXQ3T-x.js → index-BRHUKEe0.js} +1 -1
- package/dist/assets/{index-BieMaKxr.js → index-B_AzVDZL.js} +3 -3
- package/dist/assets/{index-5AHYrJMU.js → index-BhRNr1Mm.js} +3 -3
- package/dist/assets/{index-DDpaEMT7.js → index-BiGMKi60.js} +1 -1
- package/dist/assets/{index-7vdcOAKK.js → index-BwEL7b_y.js} +1 -1
- package/dist/assets/{index-CqNSZb83.js → index-ByZBUOEV.js} +1 -1
- package/dist/assets/{index-D394bB3O.js → index-C5EipBB6.js} +1 -1
- package/dist/assets/{index-CO63Eak1.js → index-C7WxFtB9.js} +1 -1
- package/dist/assets/{index-v0MyWksG.js → index-CDjkuvXP.js} +1 -1
- package/dist/assets/{index-BbOqBxtx.js → index-CL-6WnAm.js} +1 -1
- package/dist/assets/{index-CaOGSW01.js → index-CLdrrNyQ.js} +1 -1
- package/dist/assets/{index-DNF01gaj.js → index-CN0dYmBa.js} +1 -1
- package/dist/assets/{index-BDYDarMr.js → index-CP6Hc8EC.js} +3 -3
- package/dist/assets/{index-C5wqzrOv.js → index-CPEKV9ZW.js} +2 -2
- package/dist/assets/{index-DlbZBx0g.js → index-CU3QIJsR.js} +1 -1
- package/dist/assets/{index-DldpjrXY.js → index-CqjImXJn.js} +1 -1
- package/dist/assets/{index-B_op8GoN.js → index-Cv8VUnaq.js} +1 -1
- package/dist/assets/{index-CEbEfc0D.js → index-D3La8IYq.js} +1 -1
- package/dist/assets/{index-CqJ1yiie.js → index-DOh613-F.js} +2 -2
- package/dist/assets/{index-CftvQ5qe.js → index-DQAon04N.js} +31 -31
- package/dist/assets/{index-C66QQpuI.js → index-DRNAAkse.js} +9 -9
- package/dist/assets/{index-sY8rviHb.js → index-DSTJqWf2.js} +1 -1
- package/dist/assets/{index-CxVls5Qj.js → index-DaeBi0tJ.js} +1 -1
- package/dist/assets/{index-B1oVxdWu.js → index-DdGrP93n.js} +1 -1
- package/dist/assets/{index-DksgtyQD.js → index-Dh2uOJnr.js} +1 -1
- package/dist/assets/{index-Cn0-GpFp.js → index-DjP4YyEm.js} +1 -1
- package/dist/assets/{index-Dyf8X9D7.js → index-Dm9VJXIH.js} +1 -1
- package/dist/assets/{index-CFQDJIpf.js → index-DmfWG7ck.js} +1 -1
- package/dist/assets/{index-WM3minJ4.js → index-DmyIzBGi.js} +1 -1
- package/dist/assets/{index-Crnw34ik.js → index-DuC1UwU8.js} +1 -1
- package/dist/assets/{index-97HmHQZf.js → index-DxaoKSdL.js} +1 -1
- package/dist/assets/{index-C2gdJ6_z.js → index-Dz-lyfj_.js} +1 -1
- package/dist/assets/index-Mwj3mzuq.js +1 -0
- package/dist/assets/{index-DZDcdM4E.js → index-RUTgtMpc.js} +1 -1
- package/dist/assets/{index-SnFCTQbW.js → index-danRXFlY.js} +3 -3
- package/dist/assets/{index-Ddtu3cFM.js → index-itvjoWYA.js} +1 -1
- package/dist/assets/{index-UrLlZ_8t.js → index-jNX_J6BB.js} +1 -1
- package/dist/assets/{index-Bj_daaTL.js → index-oIdyH1SE.js} +1 -1
- package/dist/assets/{index-Cf7wg1Hc.js → index-rTbI0lkb.js} +1 -1
- package/dist/assets/{index-DLOeWjal.js → index-vwlVGFIa.js} +1 -1
- package/dist/assets/{index.esm-D1wUGno-.js → index.esm-BIUDl4l6.js} +1 -1
- package/dist/assets/{install-from-url-Bw1FQ94E.js → install-from-url-DeNQZMpF.js} +1 -1
- package/dist/assets/{invitation-BtYanixJ.js → invitation-COCb5On_.js} +1 -1
- package/dist/assets/{is-path-prefix-equal-DRBWkMqg.js → is-path-prefix-equal-N7tEpQVO.js} +1 -1
- package/dist/assets/{item-C5ndY-m9.js → item-BeOwNcih.js} +1 -1
- package/dist/assets/{javascript-DdKw7NlO.js → javascript-Db-35yxg.js} +1 -1
- package/dist/assets/{jsonMode-BMWo1WHJ.js → jsonMode-CrQKwuqp.js} +1 -1
- package/dist/assets/{liquid-C5qQVVKb.js → liquid-DJMO6cZA.js} +1 -1
- package/dist/assets/{list-header-DIS2vxCA.js → list-header-CYEe-lQ7.js} +1 -1
- package/dist/assets/{log-Dc1ze15O.js → log-DWlTkDeY.js} +1 -1
- package/dist/assets/{lottie-react.esm-DFfP2oGm.js → lottie-react.esm-BcFfDY7I.js} +1 -1
- package/dist/assets/{mdx-BiZwv0lf.js → mdx-D6XejU-T.js} +1 -1
- package/dist/assets/{memory-Ce7WAecK.js → memory-Di9F3qs2.js} +1 -1
- package/dist/assets/{metric-D0GQSO1T.js → metric-Rsw_68TX.js} +1 -1
- package/dist/assets/omit-DAMRcdLY.js +1 -0
- package/dist/assets/{overview-BdK_T6TW.js → overview-D38nD9i7.js} +1 -1
- package/dist/assets/{permission-CqGSt2jN.js → permission-BIUOpX2u.js} +1 -1
- package/dist/assets/{preference-Bey_tcgS.js → preference-DSmHq1w5.js} +3 -3
- package/dist/assets/{python-CAlbtSUO.js → python-Dqyd2Hsi.js} +1 -1
- package/dist/assets/{raf-schd.esm-Bv1mIDyh.js → raf-schd.esm-BGXncqYB.js} +1 -1
- package/dist/assets/{razor-ChMHuUEo.js → razor-CdzgmOZv.js} +1 -1
- package/dist/assets/{rotate-session-key-CaqCmHAv.js → rotate-session-key-95XBCkHR.js} +1 -1
- package/dist/assets/{runtime-8QjCkWY0.js → runtime-D7lqaXvd.js} +1 -1
- package/dist/assets/schema-CJDApxAh.js +1 -0
- package/dist/assets/sdk-DXw8dY2Q.js +1 -0
- package/dist/assets/{service-DLZcJdl-.js → service-DBfnpgzT.js} +1 -1
- package/dist/assets/{shorten-label-CF9b7cqN.js → shorten-label-BwqBgwTL.js} +1 -1
- package/dist/assets/{simple-select-CYoiP9Va.js → simple-select-DQnMwaJg.js} +1 -1
- package/dist/assets/{spaces-C8C4UTPO.js → spaces-DpCJGUwf.js} +1 -1
- package/dist/assets/{status-DuIP2KON.js → status-C0x1F2hB.js} +1 -1
- package/dist/assets/{status-D6mbjR3i.js → status-DGosxj_C.js} +1 -1
- package/dist/assets/{switch-control-B4hBQkSS.js → switch-control-DJmzxMX-.js} +1 -1
- package/dist/assets/{table-icons-BHtPC0RS.js → table-icons-CjbBCbkG.js} +1 -1
- package/dist/assets/{team-FAUimnG6.js → team-CapU231S.js} +1 -1
- package/dist/assets/{toLower-DFanEMPM.js → toLower-YESHqG1W.js} +1 -1
- package/dist/assets/toUpper-DxP9R-Bl.js +1 -0
- package/dist/assets/{traffic-CCYP9hV1.js → traffic-DS6Iezpg.js} +1 -1
- package/dist/assets/{tsMode-7nZAkEW_.js → tsMode-QBKsv_MH.js} +1 -1
- package/dist/assets/{typescript-DI0DIeX5.js → typescript-2FQtO0Jn.js} +1 -1
- package/dist/assets/{url-evaluation-CcymgN4m.js → url-evaluation-LJajQhtP.js} +1 -1
- package/dist/assets/{url-join-D-fka5uL.js → url-join-D0FvPMVn.js} +1 -1
- package/dist/assets/{use-mobile-DtSZ7sd2.js → use-mobile-B5hY0d0u.js} +1 -1
- package/dist/assets/{use-mobile-yxlmXKxe.js → use-mobile-BuUEnGf6.js} +1 -1
- package/dist/assets/{useAsync-CE-i2VIw.js → useAsync-BRnzfjB4.js} +1 -1
- package/dist/assets/{useAsyncRetry-DygIhwJ4.js → useAsyncRetry-B5zkihuo.js} +1 -1
- package/dist/assets/{useLocalStorage-o6l4se6z.js → useLocalStorage-DAbLYpB1.js} +1 -1
- package/dist/assets/{useThemeProps-B3f-9EpI.js → useThemeProps-iUKmymVW.js} +1 -1
- package/dist/assets/{util-CfBbtTAg.js → util-BSKUyUc4.js} +1 -1
- package/dist/assets/{wait-container-BtYNFhdJ.js → wait-container-DAVQIB8x.js} +1 -1
- package/dist/assets/{without-wallet-BnYbQ8sR.js → without-wallet-BlI613tw.js} +1 -1
- package/dist/assets/{wrap-locale-C2di08EA.js → wrap-locale-DcxOTLb-.js} +1 -1
- package/dist/assets/{xml-BfnRnK1o.js → xml--DZQiP49.js} +1 -1
- package/dist/assets/{yaml-BEcVQ_Qt.js → yaml-DF8yZtH2.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +1 -1
- package/dist/assets/ArrowDropDown-CqnGNlRB.js +0 -1
- package/dist/assets/api-B2kaOziS.js +0 -1
- package/dist/assets/client-Blv2IYSC.js +0 -1
- package/dist/assets/cloneDeep-10gB2yZE.js +0 -1
- package/dist/assets/emotion-cache.browser.esm-BhQzPcJc.js +0 -1
- package/dist/assets/engine-CLnPcrkm.js +0 -1
- package/dist/assets/getValidReactChildren-ME0VtRVG.js +0 -1
- package/dist/assets/index-C6_ndFqK.js +0 -1
- package/dist/assets/omit-CAsslcsZ.js +0 -1
- package/dist/assets/schema-DNZr5lUg.js +0 -1
- package/dist/assets/sdk-XPuzwshs.js +0 -1
- package/dist/assets/toUpper-C1gPJNYq.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aG as Ge,j as e,bn as gt,r as g,by as X,bf as K,H as q,E as D,p as xt,o as d,h as te,au as bt,az as jt,N as y,T as $,m as Q,eN as Fe,Q as Pe,ic as Ye,bj as Te,aU as Ie,V as Ee,dH as we,b3 as Ue,b1 as Ae,C as Xe,f as Qe,e$ as Je,aP as De,W as yt,at as Ze,id as et,v as Oe,f1 as tt,fr as ye,fH as st,dB as St,s as ie,ag as pe,G as qe,av as vt,ie as Ct,ig as Nt,$ as nt,ih as wt,ii as Rt,ij as Tt,ik as It,P as Et,bt as it,M as At,R as Dt,S as Ot,U as $e,il as Lt,a4 as kt}from"./index-CftvQ5qe.js";import{d as Ft,H as at,g as Pt}from"./index-Cq2A6apl.js";import{R as _e,S as _t}from"./actions-16uUMkwj.js";import{B as Bt}from"./index-CTR7ZstQ.js";import{S as me}from"./shorten-label-CF9b7cqN.js";import{v as ot}from"./index-v0MyWksG.js";import{T as zt}from"./html-title-22l2Q1um.js";import{R as Wt}from"./Refresh-CDUQoVtN.js";import{D as Mt,g as Ht}from"./traffic-CCYP9hV1.js";import{u as Kt}from"./use-mobile-yxlmXKxe.js";import"./FilterList-ZxgoMe-m.js";import"./CSSTransition-6L6IgdSY.js";import"./emotion-cache.browser.esm-BhQzPcJc.js";import"./index-DNF01gaj.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-BqZSotpa.js";import"./index-CFQDJIpf.js";import"./TableSearch-94MsMfky.js";import"./Search-D7jj6_W7.js";import"./Clear-BCMMWwCD.js";import"./MoreVert-Nin8ZqO7.js";import"./useLocalStorage-o6l4se6z.js";import"./url-evaluation-CcymgN4m.js";import"./get-safe-url-R3PVxGdM.js";import"./ButtonGroup-B-9GSfHZ.js";import"./getValidReactChildren-ME0VtRVG.js";import"./permission-CqGSt2jN.js";import"./index.esm-D1wUGno-.js";import"./collapse-ICZWDlS4.js";import"./blocklet-NsEfDg6l.js";import"./Switch-dRW18BhE.js";import"./iframe-BUEP2Jl5.js";import"./ChevronLeft-CtquRnl8.js";import"./ChevronRight-CAszk4lp.js";import"./index-DBii9-f-.js";import"./base-chart-BNJ6N5xc.js";import"./index-CaOGSW01.js";import"./AdapterDayjs-DxldUmxe.js";import"./useThemeProps-B3f-9EpI.js";import"./visuallyHidden-Dan1xhjv.js";const Ut=Ge(e.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"})),qt=Ge(e.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"})),rt=g.createContext({}),{Provider:$t,Consumer:an}=rt;function Vt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:a}}=gt(),[l,x]=g.useState([]),[u,T]=g.useState({total:0,pageSize:20,pageCount:0,page:1}),f=X(()=>s.meta?.did,[s]),[v,C]=g.useState([]),[F,_]=g.useState({}),N=X(()=>l.length?new Set(l.map(h=>h.id)):new Set,[l]),V=async({page:h=1,pageSize:S=20,...I}={})=>{if(!f)return[];try{const w={paging:{page:h,pageSize:S},...I,teamDid:f,dateRange:I.dateRange?[K(I.dateRange[0]).toISOString(),K(I.dateRange[1]).toISOString()]:void 0},{dids:E,...k}=w;let B="";E&&E.includes("system")&&(B="system");const ae=E?E.filter(oe=>oe!=="system"):[],ne={...k,source:B,componentDids:ae},ee=await n.getNotificationSendLog({input:ne});return _(ne),x(ee.list),T(ee.paging),ee.list}catch(w){return q.error(w.message),[]}},P=async()=>{const h=await n.getNotificationComponents({input:{teamDid:f}});C(h.componentDids)},L=g.useCallback(h=>{const S=s.children.find(I=>I.meta?.did===h);if(S)return S.ancestors=[s],S},[s]),W=async({notificationId:h,receivers:S,channels:I,...w})=>{await n.resendNotification({input:{teamDid:f,notificationId:h,receivers:S,channels:I.map(E=>E==="wallet"?D.NOTIFICATION_SEND_CHANNEL.WALLET:E==="pushKit"?D.NOTIFICATION_SEND_CHANNEL.PUSH:E),...w}})},U=g.useCallback(async h=>(await n.getUser({input:{teamDid:f,user:{did:h}}})).user,[n,f]),Y=g.useCallback(async({page:h=1,pageSize:S=20,...I}={})=>{try{const w={paging:{page:h,pageSize:S},...I,userName:I.searchText||"",teamDid:f,dateRange:I.dateRange?[K(I.dateRange[0]).toISOString(),K(I.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:w})}catch(w){throw q.error(w.message),w}},[n,f]);g.useEffect(()=>{f&&P()},[f]),a(D.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,h=>{N.has(h.notificationId)&&V(F)},[N,F]),a(D.EVENTS.NOTIFICATION_BLOCKLET_CREATE,h=>{N.has(h.id)||V(F)},[N,F]);const Z={fetch:V,data:l,paging:u,blocklet:s,getComponent:L,resendNotification:W,getUser:U,componentDids:v,getReceivers:Y,inService:r,teamDid:f};return e.jsx($t,{value:{notificationRecords:Z},children:t})}function Be(){const{notificationRecords:t}=g.useContext(rt);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Gt={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(xt,{type:Gt[t],children:t})}const Yt=(t,s,n="")=>{if(!n||!s)return"";switch(n){case D.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function lt(t,s,n={}){const{status:r,updatedAt:a,reason:l="",channel:x="wallet"}=n,u=a?t("notification.sendStatus.sentTime",{date:bt(a,s)}):"",T=Yt(t,x,l);return r===D.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:u,reason:T}:r===D.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 Le={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},ke=["wallet","pushKit","email"],Ve=["info","success","error","warning"],ct=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},dt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},Xt=(t,s)=>{const n=te(s,"extra.notifications.email",!0);return{available:ct(t),enabled:n}},Qt=(t,s)=>{const n=te(s,"extra.notifications.push",!0);return{available:dt(t),enabled:n}},Jt=t=>({enabled:te(t,"extra.notifications.wallet",!0)}),Zt=t=>({enabled:te(t,"extra.webhooks",[]).length>0}),be=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),es=(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})}]:[],je=(t=[])=>{const s=K().startOf("day");return t.filter(n=>K(n.sendAt).isSame(s,"day")).length},ts=(t,s="")=>{if(s&&ke.includes(s)){const l=`${s}SendRecord`,x=te(t,l,[]);return je(x)}const n=te(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return je(l)}const a={};return ke.forEach(l=>{const x=`${l}SendRecord`,u=te(t,x,[]),T=je(u);a[l]=T}),r.length>0&&r.forEach(l=>{const x=n[l]??[],u=je(x);a[l]=u}),a},Se=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},ve=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ss=t=>{switch(t){case D.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case D.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case D.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case D.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ut=()=>({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 se({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:a,title:l="",sentTime:x="",reason:u=""}=t,T=[l,u].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx($,{color:"inherit",sx:{fontSize:12},children:T}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(y,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(y,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(y,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Le[a]}}),e.jsx(y,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[a]}})]}),e.jsx($,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}se.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};Ce.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function Ce({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:a}=Q();return e.jsxs(y,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs($,{children:[s,": "]}),t.map(l=>{const x=lt(r,a,{status:l});return e.jsx(Fe,{size:"small",label:e.jsx(y,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(se,{config:x,enableTooltip:!1,children:x.title})}),onDelete:u=>n(u,l)},l)})]})}ze.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 ze({filterList:t,onChange:s,index:n,column:r,filterValues:a,label:l,renderLabel:x}){return e.jsxs(Pe,{className:"filter-container",children:[e.jsx(Ye,{component:"legend",children:l}),e.jsx(Te,{row:!0,children:a.map(u=>e.jsx(Ie,{control:e.jsx(Ee,{checked:t[n].indexOf(u.value??u)>-1,onChange:T=>{const f=[...t];T.target.checked?f[n]=[...f[n],u.value??u]:f[n]=f[n].filter(v=>v!==(u.value??u)),s(f[n],n,r)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(u)})},u.value??u))})]})}function Re(t){return e.jsx(ze,{...t,renderLabel:s=>e.jsx(se,{enableTooltip:!1,config:{status:s.status},children:s.label})})}ce.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function ce({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:a}){const{t:l,locale:x}=Q(),u=lt(l,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(y,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(se,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(we,{className:"resend-btn",size:"small",startIcon:e.jsx(_e,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:a,children:l("notification.resend")})]})}We.propTypes={value:d.array.isRequired,onChange:d.func};function We({value:t,onChange:s}){const{locale:n}=Q(),r=K().toDate(),[a,l]=g.useState(null),x=g.useCallback(f=>{l(a?null:f.currentTarget)},[a]),u=!!a,T=g.useCallback(f=>{if(!f.startDate||!f.endDate){q.error("Please select a date range");return}if(K(f.startDate).isAfter(f.endDate)||!K(f.startDate).isValid()||!K(f.endDate).isValid()){q.error("Invalid date range");return}s([f.startDate,f.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx($,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(we,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[Ue(t[0],n)," - ",Ue(t[1],n)]})}),e.jsx(Ae,{open:u,anchorEl:a,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Mt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Ht(r),onChange:T})})]})}Me.propTypes={itemComponent:d.elementType.isRequired};function Me({itemComponent:t,...s}){const{t:n}=Q();return!s?.filterList?.filter(a=>a.length).length?null:e.jsxs(y,{sx:{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(Ft.TableFilterList,{...s,ItemComponent:t})})]})}function He({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const a=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(Fe,{label:t,variant:"outlined",...a&&l?{onDelete:a}:{}})}He.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const ns=[{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}];pt.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function pt({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=Q(),[a,l]=g.useState(ns),[x,u]=g.useState(!0),T=(v,C)=>{C.checked=v.target.checked;const F=a.map(_=>({..._,checked:_.value===C.value?C.checked:_.checked}));l(F)},f=v=>{v.stopPropagation(),n({channels:a.filter(C=>C.checked).map(C=>C.value),isResendFailedOnly:x})};return e.jsxs(y,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx($,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(y,{className:"choose-channel",children:e.jsxs(Pe,{component:"fieldset",variant:"standard",children:[e.jsx(Ye,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:a.map(v=>e.jsx(Ie,{control:e.jsx(Ee,{checked:v.checked,onChange:C=>T(C,v),name:v.value}),label:v.label},v.value))})]})}),e.jsx(y,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Ie,{control:e.jsx(Ee,{checked:x,onChange:v=>u(v.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(y,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(we,{onClick:v=>{v.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(we,{onClick:f,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Xe,{size:16}),r("common.confirm")]})]})]})}ft.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function ft({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:a}=Q(),l=Qe(),x=g.useMemo(()=>Je(l,ut()),[l]),{getReceivers:u,inService:T,teamDid:f,getUser:v,blocklet:C}=Be(),[F,_]=g.useState(!1),[N,V]=g.useState([]),P=De({anchorEl:null,position:null}),L=De({anchorEl:null,position:null}),[W,U]=g.useState(null),[Y,Z]=g.useState({total:0,pageSize:10,pageCount:0,page:1}),[h,S]=g.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[K().subtract(1,"month").startOf("day").toDate(),K().endOf("day").toDate()]}),[I,w]=g.useState([]),E=[{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"}],k=async()=>{if(!F&&t)try{_(!0);const i=await u({notificationId:t,...h}),o=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,f,T)}}));V(o),Z(i.paging),_(!1)}catch(i){q.error(i.message),_(!1)}};g.useEffect(()=>{k()},[h]);const B=i=>{i.stopPropagation();const o=i.currentTarget;L.anchorEl=o;const c=o.getBoundingClientRect();L.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ae=i=>i.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Oe,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(_e,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:B,children:r("notification.resend")})}):null,ne={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:Y.page-1,rowsPerPage:Y.pageSize,count:Y.total,searchText:h.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:I,onRowSelectionChange:(i,o)=>{w(o.map(c=>c.dataIndex))},customToolbarSelect:ae},ee=({page:i,rowsPerPage:o,searchText:c,filterList:j})=>{const[,z=[],G=[],H=[]]=j;h.pageSize!==o?S(M=>({...M,pageSize:o,page:1})):h.page!==i+1?S(M=>({...M,page:i+1})):h.searchText!==c?S(M=>({...M,searchText:c,page:1})):pe(z,h.walletSendStatus)?pe(G,h.pushKitSendStatus)?pe(H,h.emailSendStatus)||S(M=>({...M,emailSendStatus:H,page:1})):S(M=>({...M,pushKitSendStatus:G,page:1})):S(M=>({...M,walletSendStatus:z,page:1}))},oe=g.useCallback(async(i,o)=>{if(!o)return!1;const c=await v(o);return c?i==="wallet"?Jt(c):i==="email"?Xt(C,c):i==="pushKit"?Qt(C,c):i==="webhook"?Zt(c):!0:!1},[v,C]),ge=g.useCallback(i=>es(r,i),[r]),re=()=>{P.anchorEl=null,P.position=null,U(null)},le=()=>{L.anchorEl=null,L.position=null},m=async(i,o,c=!0,j="")=>{if(!(!o.length||!i.length))try{s(i,o,c,j),L.anchorEl||(await be(.5),re())}catch(z){console.error("handleResend error",{error:z})}},p=async({channels:i,isResendFailedOnly:o})=>{const c=I.map(j=>N[j].receiver);await m(i,c,o),await be(.5),le(),w([])},b=async(i,o=[],c=!0)=>{try{await m(["webhook"],[i.receiver],c,o)}catch(j){q.error(j.response?j.response.statusText:j.message)}},R=async(i,o,c,j=[],z=!0)=>{if(i.stopPropagation(),ts(o,c)>=4){q.warning(r("notification.resendLimit"));return}if(!ke.includes(c)){await b(o,j,z);return}if(i){const H=i.currentTarget,M=H.getBoundingClientRect();P.anchorEl=H,P.position={top:M.top+window.scrollY,left:M.left+window.scrollX}}U({channel:c});try{const H=await oe(c,o.receiver);await be(1),U({channel:c,result:H}),(typeof H=="boolean"&&H||St(H)&&Object.values(H).every(M=>!!M))&&(await s([c],[o.receiver],z),L.anchorEl||(await be(.5),re()))}catch(H){q.error(H.message)}},O=i=>{S(o=>({...o,dateRange:i,page:1}))},A=(i,o,c,j)=>{i.stopPropagation();const z=c.filter(G=>G!==o);S(G=>({...G,[j]:z,page:1}))},J=X(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:o,receiver:c}=N[i];return o?e.jsxs(y,{"data-cy":`member-name-${o.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Ze,{src:`${o.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:o.fullName})]},c):e.jsx(yt,{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:h.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Wallet",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[1].options.filterList,"walletSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Wallet",filterList:i,onChange:o,index:c,column:j,filterValues:E})},customBodyRenderLite:i=>{const{walletSendStatus:o,walletSendAt:c,walletSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"wallet",onResend:z=>R(z,N[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:o,pushKitSendAt:c,pushKitSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"pushkit",onResend:z=>R(z,N[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:h.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Push Kit",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[2].options.filterList,"pushKitSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Push Kit",filterList:i,onChange:o,index:c,column:j,filterValues:E})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:o,emailSendAt:c,emailSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"email",onResend:z=>R(z,N[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:h.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Email",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[3].options.filterList,"emailSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Email",filterList:i,onChange:o,index:c,column:j,filterValues:E})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:o}=N[i];if(!o)return null;const c=Object.entries(o)[0];if(!c)return null;const[j,z]=c,G=z[0];return e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(y,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:j},j),e.jsx(ce,{status:G.status,updatedAt:G.sendAt,reason:G.failedReason,channel:"webhook",onResend:H=>R(H,N[i],"webhook",[j],!1)})]},j)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:o}=N[i];return e.jsx(et,{value:o,locale:a,shouldUpdate:!0})}}}],[N,a,h,r]),xe=[e.jsx(We,{value:h.dateRange,onChange:O},"date-picker"),e.jsx(Oe,{variant:"contained",size:"small",color:"primary",loading:F,startIcon:e.jsx(Wt,{}),onClick:()=>k(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(y,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(as,{children:e.jsxs(tt,{theme:x,children:[e.jsx(at,{className:"receivers-table",locale:a,loading:F,columns:J,data:N,onChange:ee,options:ne,customButtons:xe,components:{TableFilterList:i=>e.jsx(Me,{...i,itemComponent:o=>e.jsx(He,{...o,canDelete:()=>!1})})}}),P.anchorEl&&e.jsx(Ae,{open:!!P.anchorEl,anchorReference:"anchorPosition",anchorPosition:P.position,onClose:re,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(os,{children:[e.jsxs($,{variant:"body1",component:"div",className:"check-title",children:[W?.channel," Checking"]}),e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:ge(W?.channel).map(i=>{const{type:o,pass:c,fail:j}=i;return!W?.result||W?.result?.[o]?e.jsxs($,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:W?.result?.[o]?ye.success.main:"inherit"},children:[W?.result?e.jsx(qt,{}):e.jsx(Xe,{size:12,sx:{color:ye.primary.main}}),e.jsx("span",{children:c})]},o):e.jsxs($,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:ye.error.main},children:[e.jsx(Ut,{}),e.jsx("span",{children:j})]},o)})})]})}),L.anchorEl&&e.jsx(Ae,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:le,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(pt,{loading:n,onCancel:le,onConfirm:p})})]})})})}const is=g.memo(ft),as=ie.div`
|
|
1
|
+
import{aG as Ge,j as e,bn as gt,r as g,by as X,bf as K,H as q,E as D,p as xt,o as d,h as te,au as bt,az as jt,N as y,T as $,m as Q,eN as Fe,Q as Pe,ic as Ye,bj as Te,aU as Ie,V as Ee,dH as we,b3 as Ue,b1 as Ae,C as Xe,f as Qe,e$ as Je,aP as De,W as yt,at as Ze,id as et,v as Oe,f1 as tt,fr as ye,fH as st,dB as St,s as ie,ag as pe,G as qe,av as vt,ie as Ct,ig as Nt,$ as nt,ih as wt,ii as Rt,ij as Tt,ik as It,P as Et,bt as it,M as At,R as Dt,S as Ot,U as $e,il as Lt,a4 as kt}from"./index-DQAon04N.js";import{d as Ft,H as at,g as Pt}from"./index-1LmYeNoL.js";import{R as _e,S as _t}from"./actions-D4Kz7IAL.js";import{B as Bt}from"./index-0y0GUu_H.js";import{S as me}from"./shorten-label-BwqBgwTL.js";import{v as ot}from"./index-CDjkuvXP.js";import{T as zt}from"./html-title-s4xKUvYC.js";import{R as Wt}from"./Refresh-lnreJErX.js";import{D as Mt,g as Ht}from"./traffic-DS6Iezpg.js";import{u as Kt}from"./use-mobile-BuUEnGf6.js";import"./FilterList-CETwaOot.js";import"./CSSTransition-wxeeFOKf.js";import"./emotion-cache.browser.esm-BkCEErJn.js";import"./index-CN0dYmBa.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-CfdoQRpO.js";import"./index-DmfWG7ck.js";import"./TableSearch-Lg4M-8KA.js";import"./Search-hhDB6YL9.js";import"./Clear-v5WhrN0k.js";import"./MoreVert-C716pe1M.js";import"./useLocalStorage-DAbLYpB1.js";import"./url-evaluation-LJajQhtP.js";import"./get-safe-url-CVrrblG0.js";import"./ButtonGroup-Bb6jDsD1.js";import"./getValidReactChildren-DJQKILMh.js";import"./permission-BIUOpX2u.js";import"./index.esm-BIUDl4l6.js";import"./collapse-D_6eVE_q.js";import"./blocklet-vLRH388n.js";import"./Switch-CEsPeHy7.js";import"./iframe-D0ox4iMz.js";import"./ChevronLeft-DADCIS34.js";import"./ChevronRight-B_f9hb86.js";import"./index-DBii9-f-.js";import"./base-chart-DZ65G0Up.js";import"./index-CLdrrNyQ.js";import"./AdapterDayjs-CMmkTpH7.js";import"./useThemeProps-iUKmymVW.js";import"./visuallyHidden-Dan1xhjv.js";const Ut=Ge(e.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"})),qt=Ge(e.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"})),rt=g.createContext({}),{Provider:$t,Consumer:an}=rt;function Vt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:a}}=gt(),[l,x]=g.useState([]),[u,T]=g.useState({total:0,pageSize:20,pageCount:0,page:1}),f=X(()=>s.meta?.did,[s]),[v,C]=g.useState([]),[F,_]=g.useState({}),N=X(()=>l.length?new Set(l.map(h=>h.id)):new Set,[l]),V=async({page:h=1,pageSize:S=20,...I}={})=>{if(!f)return[];try{const w={paging:{page:h,pageSize:S},...I,teamDid:f,dateRange:I.dateRange?[K(I.dateRange[0]).toISOString(),K(I.dateRange[1]).toISOString()]:void 0},{dids:E,...k}=w;let B="";E&&E.includes("system")&&(B="system");const ae=E?E.filter(oe=>oe!=="system"):[],ne={...k,source:B,componentDids:ae},ee=await n.getNotificationSendLog({input:ne});return _(ne),x(ee.list),T(ee.paging),ee.list}catch(w){return q.error(w.message),[]}},P=async()=>{const h=await n.getNotificationComponents({input:{teamDid:f}});C(h.componentDids)},L=g.useCallback(h=>{const S=s.children.find(I=>I.meta?.did===h);if(S)return S.ancestors=[s],S},[s]),W=async({notificationId:h,receivers:S,channels:I,...w})=>{await n.resendNotification({input:{teamDid:f,notificationId:h,receivers:S,channels:I.map(E=>E==="wallet"?D.NOTIFICATION_SEND_CHANNEL.WALLET:E==="pushKit"?D.NOTIFICATION_SEND_CHANNEL.PUSH:E),...w}})},U=g.useCallback(async h=>(await n.getUser({input:{teamDid:f,user:{did:h}}})).user,[n,f]),Y=g.useCallback(async({page:h=1,pageSize:S=20,...I}={})=>{try{const w={paging:{page:h,pageSize:S},...I,userName:I.searchText||"",teamDid:f,dateRange:I.dateRange?[K(I.dateRange[0]).toISOString(),K(I.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:w})}catch(w){throw q.error(w.message),w}},[n,f]);g.useEffect(()=>{f&&P()},[f]),a(D.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,h=>{N.has(h.notificationId)&&V(F)},[N,F]),a(D.EVENTS.NOTIFICATION_BLOCKLET_CREATE,h=>{N.has(h.id)||V(F)},[N,F]);const Z={fetch:V,data:l,paging:u,blocklet:s,getComponent:L,resendNotification:W,getUser:U,componentDids:v,getReceivers:Y,inService:r,teamDid:f};return e.jsx($t,{value:{notificationRecords:Z},children:t})}function Be(){const{notificationRecords:t}=g.useContext(rt);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Gt={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(xt,{type:Gt[t],children:t})}const Yt=(t,s,n="")=>{if(!n||!s)return"";switch(n){case D.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function lt(t,s,n={}){const{status:r,updatedAt:a,reason:l="",channel:x="wallet"}=n,u=a?t("notification.sendStatus.sentTime",{date:bt(a,s)}):"",T=Yt(t,x,l);return r===D.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:u,reason:T}:r===D.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 Le={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},ke=["wallet","pushKit","email"],Ve=["info","success","error","warning"],ct=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},dt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},Xt=(t,s)=>{const n=te(s,"extra.notifications.email",!0);return{available:ct(t),enabled:n}},Qt=(t,s)=>{const n=te(s,"extra.notifications.push",!0);return{available:dt(t),enabled:n}},Jt=t=>({enabled:te(t,"extra.notifications.wallet",!0)}),Zt=t=>({enabled:te(t,"extra.webhooks",[]).length>0}),be=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),es=(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})}]:[],je=(t=[])=>{const s=K().startOf("day");return t.filter(n=>K(n.sendAt).isSame(s,"day")).length},ts=(t,s="")=>{if(s&&ke.includes(s)){const l=`${s}SendRecord`,x=te(t,l,[]);return je(x)}const n=te(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return je(l)}const a={};return ke.forEach(l=>{const x=`${l}SendRecord`,u=te(t,x,[]),T=je(u);a[l]=T}),r.length>0&&r.forEach(l=>{const x=n[l]??[],u=je(x);a[l]=u}),a},Se=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},ve=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ss=t=>{switch(t){case D.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case D.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case D.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case D.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ut=()=>({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 se({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:a,title:l="",sentTime:x="",reason:u=""}=t,T=[l,u].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx($,{color:"inherit",sx:{fontSize:12},children:T}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(y,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(y,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(y,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Le[a]}}),e.jsx(y,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[a]}})]}),e.jsx($,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}se.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};Ce.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function Ce({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:a}=Q();return e.jsxs(y,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs($,{children:[s,": "]}),t.map(l=>{const x=lt(r,a,{status:l});return e.jsx(Fe,{size:"small",label:e.jsx(y,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(se,{config:x,enableTooltip:!1,children:x.title})}),onDelete:u=>n(u,l)},l)})]})}ze.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 ze({filterList:t,onChange:s,index:n,column:r,filterValues:a,label:l,renderLabel:x}){return e.jsxs(Pe,{className:"filter-container",children:[e.jsx(Ye,{component:"legend",children:l}),e.jsx(Te,{row:!0,children:a.map(u=>e.jsx(Ie,{control:e.jsx(Ee,{checked:t[n].indexOf(u.value??u)>-1,onChange:T=>{const f=[...t];T.target.checked?f[n]=[...f[n],u.value??u]:f[n]=f[n].filter(v=>v!==(u.value??u)),s(f[n],n,r)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(u)})},u.value??u))})]})}function Re(t){return e.jsx(ze,{...t,renderLabel:s=>e.jsx(se,{enableTooltip:!1,config:{status:s.status},children:s.label})})}ce.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function ce({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:a}){const{t:l,locale:x}=Q(),u=lt(l,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(y,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(se,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(we,{className:"resend-btn",size:"small",startIcon:e.jsx(_e,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:a,children:l("notification.resend")})]})}We.propTypes={value:d.array.isRequired,onChange:d.func};function We({value:t,onChange:s}){const{locale:n}=Q(),r=K().toDate(),[a,l]=g.useState(null),x=g.useCallback(f=>{l(a?null:f.currentTarget)},[a]),u=!!a,T=g.useCallback(f=>{if(!f.startDate||!f.endDate){q.error("Please select a date range");return}if(K(f.startDate).isAfter(f.endDate)||!K(f.startDate).isValid()||!K(f.endDate).isValid()){q.error("Invalid date range");return}s([f.startDate,f.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx($,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(we,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[Ue(t[0],n)," - ",Ue(t[1],n)]})}),e.jsx(Ae,{open:u,anchorEl:a,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Mt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Ht(r),onChange:T})})]})}Me.propTypes={itemComponent:d.elementType.isRequired};function Me({itemComponent:t,...s}){const{t:n}=Q();return!s?.filterList?.filter(a=>a.length).length?null:e.jsxs(y,{sx:{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(Ft.TableFilterList,{...s,ItemComponent:t})})]})}function He({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const a=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(Fe,{label:t,variant:"outlined",...a&&l?{onDelete:a}:{}})}He.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const ns=[{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}];pt.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function pt({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=Q(),[a,l]=g.useState(ns),[x,u]=g.useState(!0),T=(v,C)=>{C.checked=v.target.checked;const F=a.map(_=>({..._,checked:_.value===C.value?C.checked:_.checked}));l(F)},f=v=>{v.stopPropagation(),n({channels:a.filter(C=>C.checked).map(C=>C.value),isResendFailedOnly:x})};return e.jsxs(y,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx($,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(y,{className:"choose-channel",children:e.jsxs(Pe,{component:"fieldset",variant:"standard",children:[e.jsx(Ye,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:a.map(v=>e.jsx(Ie,{control:e.jsx(Ee,{checked:v.checked,onChange:C=>T(C,v),name:v.value}),label:v.label},v.value))})]})}),e.jsx(y,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Ie,{control:e.jsx(Ee,{checked:x,onChange:v=>u(v.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(y,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(we,{onClick:v=>{v.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(we,{onClick:f,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Xe,{size:16}),r("common.confirm")]})]})]})}ft.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function ft({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:a}=Q(),l=Qe(),x=g.useMemo(()=>Je(l,ut()),[l]),{getReceivers:u,inService:T,teamDid:f,getUser:v,blocklet:C}=Be(),[F,_]=g.useState(!1),[N,V]=g.useState([]),P=De({anchorEl:null,position:null}),L=De({anchorEl:null,position:null}),[W,U]=g.useState(null),[Y,Z]=g.useState({total:0,pageSize:10,pageCount:0,page:1}),[h,S]=g.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[K().subtract(1,"month").startOf("day").toDate(),K().endOf("day").toDate()]}),[I,w]=g.useState([]),E=[{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"}],k=async()=>{if(!F&&t)try{_(!0);const i=await u({notificationId:t,...h}),o=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,f,T)}}));V(o),Z(i.paging),_(!1)}catch(i){q.error(i.message),_(!1)}};g.useEffect(()=>{k()},[h]);const B=i=>{i.stopPropagation();const o=i.currentTarget;L.anchorEl=o;const c=o.getBoundingClientRect();L.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ae=i=>i.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Oe,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(_e,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:B,children:r("notification.resend")})}):null,ne={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:Y.page-1,rowsPerPage:Y.pageSize,count:Y.total,searchText:h.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:I,onRowSelectionChange:(i,o)=>{w(o.map(c=>c.dataIndex))},customToolbarSelect:ae},ee=({page:i,rowsPerPage:o,searchText:c,filterList:j})=>{const[,z=[],G=[],H=[]]=j;h.pageSize!==o?S(M=>({...M,pageSize:o,page:1})):h.page!==i+1?S(M=>({...M,page:i+1})):h.searchText!==c?S(M=>({...M,searchText:c,page:1})):pe(z,h.walletSendStatus)?pe(G,h.pushKitSendStatus)?pe(H,h.emailSendStatus)||S(M=>({...M,emailSendStatus:H,page:1})):S(M=>({...M,pushKitSendStatus:G,page:1})):S(M=>({...M,walletSendStatus:z,page:1}))},oe=g.useCallback(async(i,o)=>{if(!o)return!1;const c=await v(o);return c?i==="wallet"?Jt(c):i==="email"?Xt(C,c):i==="pushKit"?Qt(C,c):i==="webhook"?Zt(c):!0:!1},[v,C]),ge=g.useCallback(i=>es(r,i),[r]),re=()=>{P.anchorEl=null,P.position=null,U(null)},le=()=>{L.anchorEl=null,L.position=null},m=async(i,o,c=!0,j="")=>{if(!(!o.length||!i.length))try{s(i,o,c,j),L.anchorEl||(await be(.5),re())}catch(z){console.error("handleResend error",{error:z})}},p=async({channels:i,isResendFailedOnly:o})=>{const c=I.map(j=>N[j].receiver);await m(i,c,o),await be(.5),le(),w([])},b=async(i,o=[],c=!0)=>{try{await m(["webhook"],[i.receiver],c,o)}catch(j){q.error(j.response?j.response.statusText:j.message)}},R=async(i,o,c,j=[],z=!0)=>{if(i.stopPropagation(),ts(o,c)>=4){q.warning(r("notification.resendLimit"));return}if(!ke.includes(c)){await b(o,j,z);return}if(i){const H=i.currentTarget,M=H.getBoundingClientRect();P.anchorEl=H,P.position={top:M.top+window.scrollY,left:M.left+window.scrollX}}U({channel:c});try{const H=await oe(c,o.receiver);await be(1),U({channel:c,result:H}),(typeof H=="boolean"&&H||St(H)&&Object.values(H).every(M=>!!M))&&(await s([c],[o.receiver],z),L.anchorEl||(await be(.5),re()))}catch(H){q.error(H.message)}},O=i=>{S(o=>({...o,dateRange:i,page:1}))},A=(i,o,c,j)=>{i.stopPropagation();const z=c.filter(G=>G!==o);S(G=>({...G,[j]:z,page:1}))},J=X(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:o,receiver:c}=N[i];return o?e.jsxs(y,{"data-cy":`member-name-${o.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Ze,{src:`${o.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:o.fullName})]},c):e.jsx(yt,{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:h.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Wallet",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[1].options.filterList,"walletSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Wallet",filterList:i,onChange:o,index:c,column:j,filterValues:E})},customBodyRenderLite:i=>{const{walletSendStatus:o,walletSendAt:c,walletSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"wallet",onResend:z=>R(z,N[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:o,pushKitSendAt:c,pushKitSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"pushkit",onResend:z=>R(z,N[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:h.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Push Kit",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[2].options.filterList,"pushKitSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Push Kit",filterList:i,onChange:o,index:c,column:j,filterValues:E})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:o,emailSendAt:c,emailSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"email",onResend:z=>R(z,N[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:h.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Email",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[3].options.filterList,"emailSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Email",filterList:i,onChange:o,index:c,column:j,filterValues:E})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:o}=N[i];if(!o)return null;const c=Object.entries(o)[0];if(!c)return null;const[j,z]=c,G=z[0];return e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(y,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:j},j),e.jsx(ce,{status:G.status,updatedAt:G.sendAt,reason:G.failedReason,channel:"webhook",onResend:H=>R(H,N[i],"webhook",[j],!1)})]},j)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:o}=N[i];return e.jsx(et,{value:o,locale:a,shouldUpdate:!0})}}}],[N,a,h,r]),xe=[e.jsx(We,{value:h.dateRange,onChange:O},"date-picker"),e.jsx(Oe,{variant:"contained",size:"small",color:"primary",loading:F,startIcon:e.jsx(Wt,{}),onClick:()=>k(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(y,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(as,{children:e.jsxs(tt,{theme:x,children:[e.jsx(at,{className:"receivers-table",locale:a,loading:F,columns:J,data:N,onChange:ee,options:ne,customButtons:xe,components:{TableFilterList:i=>e.jsx(Me,{...i,itemComponent:o=>e.jsx(He,{...o,canDelete:()=>!1})})}}),P.anchorEl&&e.jsx(Ae,{open:!!P.anchorEl,anchorReference:"anchorPosition",anchorPosition:P.position,onClose:re,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(os,{children:[e.jsxs($,{variant:"body1",component:"div",className:"check-title",children:[W?.channel," Checking"]}),e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:ge(W?.channel).map(i=>{const{type:o,pass:c,fail:j}=i;return!W?.result||W?.result?.[o]?e.jsxs($,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:W?.result?.[o]?ye.success.main:"inherit"},children:[W?.result?e.jsx(qt,{}):e.jsx(Xe,{size:12,sx:{color:ye.primary.main}}),e.jsx("span",{children:c})]},o):e.jsxs($,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:ye.error.main},children:[e.jsx(Ut,{}),e.jsx("span",{children:j})]},o)})})]})}),L.anchorEl&&e.jsx(Ae,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:le,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(pt,{loading:n,onCancel:le,onConfirm:p})})]})})})}const is=g.memo(ft),as=ie.div`
|
|
2
2
|
td.MuiTableCell-footer {
|
|
3
3
|
border: none !important;
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as O,u as W,r as i,a as R,b as D,j as e,o as y,d as H,e as Q,g as Y,f as F,W as U,L as X,p as j,h as J,i as k,T as h,G as v,k as K,l as z,s as q,C as Z}from"./index-
|
|
1
|
+
import{c as O,u as W,r as i,a as R,b as D,j as e,o as y,d as H,e as Q,g as Y,f as F,W as U,L as X,p as j,h as J,i as k,T as h,G as v,k as K,l as z,s as q,C as Z}from"./index-DQAon04N.js";import{f as ee}from"./index-BojVbZw0.js";import{v as $}from"./index-CDjkuvXP.js";import{M as V}from"./metric-Rsw_68TX.js";import{C as M}from"./click-to-copy-D5YohLRv.js";var ne=O(function(a,d,r){return a+(r?" ":"")+d.toLowerCase()});const B=i.createContext({}),{Provider:se,Consumer:xe}=B;function ae({children:a}){const{api:d,info:r}=W(),[u,l]=i.useState(null),[c,t]=i.useState(!1),[s,p]=i.useState([]),_=4,f=async({silent:o=!0,retries:m=_}={})=>{o||t(!0);try{l(null);const{users:x}=await d.getUsers({input:{teamDid:r.did,paging:{pageSize:100}}});t(!1),p(x)}catch(x){m>0?setTimeout(()=>f({silent:o,retries:m-1}),1e3):(t(!1),l(x))}};i.useEffect(()=>{f({silent:!1})},[]),R(D.TeamEvents.userAdded,({teamDid:o})=>{o===r.did&&f()}),R(D.TeamEvents.userRemoved,({teamDid:o,user:{did:m}})=>{o===r.did&&p(x=>x.filter(N=>N.did!==m))}),R(D.TeamEvents.userUpdated,({teamDid:o})=>{o===r.did&&f()});const b={loading:c,error:u,users:s,refresh:f};return e.jsx(se,{value:{users:b},children:a})}function te(){const{users:a}=i.useContext(B);return a}const g={oneSecond:1,oneMin:1*60,oneHour:1*60*60,oneDay:24*60*60},re=(a,d)=>{const[r,u]=i.useState(0),l=s=>s>=g.oneDay?g.oneDay:s>=g.oneHour?g.oneHour:s>=g.oneMin?g.oneMin:g.oneSecond,[c,t]=i.useState(l(a/1e3));return i.useEffect(()=>{const s=setInterval(()=>{u(r+c);const p=l(a/1e3+r+c);c!==p&&t(p)},c*1e3);return()=>clearInterval(s)},[c,r]),i.useEffect(()=>{u(0),t(l(a/1e3))},[a]),d(a+r*1e3)};y.number.isRequired,y.func;const oe=async a=>{const d=await a.getNodeEnv();return Object.assign({},d.info||{})};y.number.isRequired;y.string.isRequired,y.string.isRequired,y.string.isRequired;function ie(){const{info:a,api:d,loading:r}=W(),{data:u,externalData:l}=H(),{users:c}=te(),t=Q(()=>oe(d)),{t:s,locale:p}=i.useContext(Y),_=F(),f=re(+new Date-a.startAt,o=>{const m={compact:!0,verbose:!0,locale:z(p)};return K(o,m)});let b=null;if(r)b=e.jsx(Z,{});else{const o=[{name:s("dashboard.nodeDid"),value:e.jsx(U,{did:a.did,showQrcode:!0})}];a.nodeOwner&&o.push({name:s("dashboard.ownerDid"),value:e.jsx(U,{did:a.nodeOwner.did,showQrcode:!0})});let m=[];a.launcher&&(m=[{name:s("common.did"),value:e.jsx(U,{did:a.launcher.did,showQrcode:!0})},{name:s("common.type"),value:a.launcher.type},{name:s("launcher.provider"),value:a.launcher.provider},{name:s("launcher.adminUrl"),value:e.jsx(X,{target:"_blank",href:a.launcher.url,underline:"hover",children:a.launcher.url})}]);const x=(n,w)=>!n&&!w?"-":n==="-"?n:!w||w==="-"?e.jsxs(h,{className:"ip-item",children:[e.jsx(j,{children:"IPV4"}),e.jsx(M,{children:n})]}):e.jsxs(h,{component:"ul",children:[e.jsxs("li",{className:"ip-item",children:[e.jsx(j,{children:"IPV4"}),e.jsx(M,{children:n})]}),e.jsxs("li",{className:"ip-item",children:[e.jsx(j,{children:"IPV6"}),e.jsx(M,{children:w})]})]}),N=()=>{const n=[{name:`${s("common.internalIp")}`,value:x(t.value.ip.internalV4,t.value.ip.internalV6)},{name:`${s("common.externalIp")}`,value:x(t.value.ip.externalV4,t.value.ip.externalV6)}];return t.value.docker?[]:n},T=t.value?[{name:`${s("common.version")}`,value:a.version},...N(),{name:`${s("common.os")}`,value:t.value.os},t.value.docker?{name:`${s("common.docker")}`,value:e.jsx(j,{type:"success",children:"Yes"})}:null,t.value.gitpod?{name:`${s("common.gitpod")}`,value:e.jsx(j,{type:"success",children:"Yes"})}:null].filter(Boolean):[];Array.isArray(J(t,"value.blockletEngines",null))&&t.value.blockletEngines.filter(n=>n.visible&&n.available).forEach(n=>{T.push({name:n.displayName,value:e.jsx(j,{type:"success",children:`${n.version}`||"N/A"})})});const L=c.length,A=c.filter(n=>n.approved).length;let P=L;A&&(P+=`<small><strong>${ne(s("common.approved"))} ${A}</strong></small>`);let S=0,C=0;u&&(S=u.length,C=u.filter(n=>n.status==="running").length),Array.isArray(l)&&(S+=l.length,C+=l.filter(n=>n.status==="running").length);let I=S;C&&(I+=`<small>${s("common.running")} ${C}</small>`);const G=[{name:s("common.blocklets"),value:I},{name:s("common.members"),value:P},{name:s("common.uptime"),value:f},{name:s("common.created"),value:ee(new Date(a.createdAt).getTime(),z(p))}];let E=[];t.value&&t.value.disk&&Object.values(t.value.disk).some(n=>n>0)&&(E=[{name:s("common.blockletsStorage"),value:k(t.value.disk.blocklets||0).toUpperCase()},{name:s("common.dataStorage"),value:k(t.value.disk.data||0).toUpperCase()},{name:s("common.logStorage"),value:k(t.value.disk.log||0).toUpperCase()},{name:s("common.cacheStorage"),value:k(t.value.disk.cache||0).toUpperCase()},{name:s("common.coreStorage"),value:k(t.value.disk.app||0).toUpperCase()}]),b=e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"section",children:[e.jsx(h,{className:"section__header",component:"h2",variant:"h4",color:"textPrimary",children:s("common.overview")}),e.jsx(v,{className:"page-metrics",container:!0,spacing:{xs:2,sm:3,md:4,lg:5},children:G.map(n=>e.jsx(v,{size:{xl:2,lg:3,md:4,sm:6,xs:6},children:e.jsx(V,{...n})},n.name))})]}),E.length>0&&e.jsxs("div",{className:"section",children:[e.jsx(h,{className:"section__header",component:"h2",variant:"h4",color:"textPrimary",children:s("common.storage")}),e.jsx(v,{className:"page-metrics",container:!0,spacing:{xs:2,sm:3,md:4,lg:5},children:E.map(n=>e.jsx(v,{size:{xl:2,lg:3,md:4,sm:6,xs:6},children:e.jsx(V,{...n})},n.name))})]}),e.jsxs("div",{className:"section",children:[e.jsx(h,{className:"section__header",component:"h2",variant:"h4",color:"textPrimary",children:s("common.meta")}),e.jsxs(v,{className:"page-metrics",container:!0,spacing:{xs:2,sm:3,md:4,lg:5},children:[e.jsxs(v,{size:{lg:6,md:12,sm:12,xs:12},children:[e.jsx(h,{className:"section__header",component:"h3",variant:"h5",color:"textPrimary",children:s("common.dAddress")}),o.map(n=>e.jsx($,{nameWidth:150,name:n.name,children:n.value},n.name)),m.length>0&&e.jsxs("div",{style:{marginTop:_.spacing(8)},children:[e.jsx(h,{className:"section__header",component:"h3",variant:"h5",color:"textPrimary",children:s("common.launcher")}),m.map(n=>e.jsx($,{nameWidth:150,name:n.name,children:n.value},n.name))]})]},"address"),e.jsxs(v,{size:{lg:6,md:12,sm:12,xs:12},children:[e.jsx(h,{className:"section__header",component:"h3",variant:"h5",color:"textPrimary",children:s("common.env")}),T.map(n=>e.jsx($,{valueComponent:"div",nameWidth:150,name:n.name,children:n.value},n.name))]},"environment")]})]})]})}return e.jsx(le,{children:b})}const le=q.main`
|
|
2
2
|
.page-header {
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: space-between;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cn as g,r as o,g as x,co as r,B as u,j as s,N as m,cp as d}from"./index-
|
|
1
|
+
import{cn as g,r as o,g as x,co as r,B as u,j as s,N as m,cp as d}from"./index-DQAon04N.js";function P(){const i=g(),{blocklets:c,refresh:l}=i,{t:p}=o.useContext(x),y=r.generateKey(),[a]=u();return o.useEffect(()=>{const n=r.getNotificationQueryParams(y)??{},t=a.get("entityId"),e=a.get("severity"),f={...n,...e?{severity:e==="all"?[]:e.split(","),paging:{...n.paging,page:1}}:{},...t?{entityId:t==="all"?[]:t.split(",")}:{},componentDid:[]};l(f)},[]),s.jsxs(m,{children:[s.jsx("h1",{children:p("notification.title")}),s.jsx(d,{tabType:"line",blocklets:c,context:i,filterType:"entity",type:"server"})]})}export{P as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as g,bm as v,u as y,j as r,Q as f,S as x,U as h}from"./index-
|
|
1
|
+
import{A as g,bm as v,u as y,j as r,Q as f,S as x,U as h}from"./index-DQAon04N.js";import{L as S,D as j}from"./download-CX5ROtbY.js";import{u as L}from"./useLocalStorage-DAbLYpB1.js";import"./ButtonGroup-Bb6jDsD1.js";import"./getValidReactChildren-DJQKILMh.js";function I(){const c=g(),[s,i]=L("server-logs-filter",{name:"abtnode",type:{abtnode:"error"}}),{name:t=s.name}=v(),{info:l}=y(),n=l.routing.provider,a=[{id:"abtnode",name:"Blocklet Server",types:["error","info","access","stdout","stderr","pm2"]},{id:"blocklet-services",name:"Blocklet Services",types:["error","info","access","stdout","stderr"]}];if(n){const e=`Service Gateway(${n})`;a.push({id:`service-gateway-${n}`,name:e,types:["error","access","security"]})}const d=e=>{i({...s,name:e.target.value}),c(`/logs/${e.target.value}`)},m=r.jsx(f,{sx:{minWidth:240},children:r.jsx(x,{value:t,onChange:d,size:"small",children:a.map(e=>r.jsx(h,{value:e.id,children:e.name},e.id))})}),o=a.find(e=>e.id===t)||a[0],p=o.types.indexOf(s.type[t]||"error"),u=e=>{i({name:t,type:{...s.type,[t]:e}})};return r.jsx(S,{name:o.name,logId:o.id,types:o.types,prepend:m,postpend:r.jsx(j,{id:l.did,name:"blocklet-server"}),defaultTypeIndex:p,onTypeChange:u},o.id)}export{I as default};
|