@abtnode/blocklet-services 1.16.38-beta-20250127-092551-3bb6da3b → 1.16.38-beta-20250206-084543-4d7b4331
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/api/socket/channel/did.js +2 -1
- package/dist/assets/{Add-0_yO_NcD.js → Add-DTHqaebJ.js} +1 -1
- package/dist/assets/{ArrowDropDown-CSe7vdhu.js → ArrowDropDown-DbyzWNvL.js} +1 -1
- package/dist/assets/{CheckCircle-C20J4AX-.js → CheckCircle-CFxGo9yf.js} +1 -1
- package/dist/assets/{ChevronLeft-CYpg5M_K.js → ChevronLeft-BfXQoYEz.js} +1 -1
- package/dist/assets/{ChevronRight-DORpkdoL.js → ChevronRight-CfoEIq_n.js} +1 -1
- package/dist/assets/{DeleteOutline-BaOxCgo3.js → DeleteOutline-BmH9ek4A.js} +1 -1
- package/dist/assets/{Done-Bsd0QwkQ.js → Done-EMi5bDwr.js} +1 -1
- package/dist/assets/{Download-BF8ec3kS.js → Download-Dhtefh1X.js} +1 -1
- package/dist/assets/{EditIcon-D6Lk4OxD.js → EditIcon-BGaX97FF.js} +1 -1
- package/dist/assets/{Error-CmnuwZkD.js → Error-Djqvk_X8.js} +1 -1
- package/dist/assets/{Google-F1HiAjHW.js → Google-MetxIaR3.js} +1 -1
- package/dist/assets/{InfoOutlined-DZAeG3v-.js → InfoOutlined-Bd6IN61C.js} +1 -1
- package/dist/assets/{Launch-DNY7Ut_B.js → Launch-DC2ZwJy0.js} +1 -1
- package/dist/assets/{LaunchOutlined-BUOyH9Rv.js → LaunchOutlined-CYryXNUL.js} +1 -1
- package/dist/assets/{LockIcon-BITD3hjp.js → LockIcon-BHLM_myO.js} +1 -1
- package/dist/assets/{Loop-gZ2g1v3i.js → Loop-Dwj655TP.js} +1 -1
- package/dist/assets/{MoreHoriz-CwoKs0Gg.js → MoreHoriz-B8ywH5RE.js} +1 -1
- package/dist/assets/{PlayArrow-C6dXJHO6.js → PlayArrow-vglCW7W4.js} +1 -1
- package/dist/assets/{QuestionMarkCircle-SCPzvU7T.js → QuestionMarkCircle-BDO28oyM.js} +1 -1
- package/dist/assets/{ServerLogo-DRTZsm8x.js → ServerLogo-D3ppBqIq.js} +1 -1
- package/dist/assets/{ViewList-DfGpYdZ-.js → ViewList-BEBx2X_O.js} +1 -1
- package/dist/assets/{access-control-DWS7Lowo.js → access-control-C15ttx-y.js} +1 -1
- package/dist/assets/{actions-BvtS-2sJ.js → actions-D-mxVcNU.js} +1 -1
- package/dist/assets/{add-component-core-DZPE4BRe.js → add-component-core-DNqTsrPg.js} +1 -1
- package/dist/assets/add-resource-C6AMLerq.js +1 -0
- package/dist/assets/{addon-CDVN9YCj.js → addon-_m1gJFAF.js} +1 -1
- package/dist/assets/analytics-DvHwLQn7.js +11 -0
- package/dist/assets/{ar-DV4YJwQy.js → ar-C89hW7LF.js} +1 -1
- package/dist/assets/{audit-logs-CJvI5okV.js → audit-logs-BCbtyCHg.js} +1 -1
- package/dist/assets/{base32-Bl4ek2bl.js → base32-BFfp490K.js} +1 -1
- package/dist/assets/{branding-CfeUWBA7.js → branding-D8S6jsa0.js} +2 -2
- package/dist/assets/{bundle-avatar-TEUPlhi2.js → bundle-avatar-C9ats955.js} +1 -1
- package/dist/assets/button-BmPwSTan.js +1 -0
- package/dist/assets/{click-to-copy-Ck4RKrL7.js → click-to-copy-_Hi7Yhx3.js} +1 -1
- package/dist/assets/{complete-CPnz5QUF.js → complete-DUg7uJ4N.js} +1 -1
- package/dist/assets/{component-Srk2_SVH.js → component-D1agqLE_.js} +1 -1
- package/dist/assets/{config-Cp3L8D_L.js → config-S6WZ6U3Y.js} +2 -2
- package/dist/assets/{config-navigation-a3GJWM1m.js → config-navigation-CMi0YByE.js} +6 -6
- package/dist/assets/{config-space-piVzY5c1.js → config-space-BtoXeFsn.js} +1 -1
- package/dist/assets/{config-kJZsVZD6.js → config-xTynYj5F.js} +1 -1
- package/dist/assets/{confirm-D7n9Rzfx.js → confirm-yYw8jeh5.js} +1 -1
- package/dist/assets/{connect-BZUv1d-6.js → connect-CT8urDCb.js} +1 -1
- package/dist/assets/{connect-rdXbvbmJ.js → connect-DMnZDuPy.js} +1 -1
- package/dist/assets/{connect-to-BzfmK9yx.js → connect-to-BtXA2Q7q.js} +1 -1
- package/dist/assets/{content-layout-CzrxMNjA.js → content-layout-DRV8Bqu8.js} +1 -1
- package/dist/assets/dashboard-D7xokuFw.js +217 -0
- package/dist/assets/{de-C2Y_05d1.js → de-BScxb0zD.js} +1 -1
- package/dist/assets/{did-address-CLeqbWiu.js → did-address-DL8dQh4X.js} +1 -1
- package/dist/assets/{domain-DgPzyf2N.js → domain-WlHroGqS.js} +1 -1
- package/dist/assets/{domain-list-BiYGOOY3.js → domain-list-CID5R830.js} +2 -2
- package/dist/assets/{email-5azpRba_.js → email-XNK7Gwt2.js} +1 -1
- package/dist/assets/{es-DPVOSPPn.js → es-B9f-yiTL.js} +1 -1
- package/dist/assets/{exchange-passport-Cus1rYsJ.js → exchange-passport-BkvQV3O8.js} +1 -1
- package/dist/assets/{form-text-input-Cf1j6PeI.js → form-text-input-B1uYH91s.js} +2 -2
- package/dist/assets/{fr-C8dIIOc9.js → fr-BguXQaFu.js} +1 -1
- package/dist/assets/{fuel-BaqDy7AE.js → fuel-uFxFD3IR.js} +1 -1
- package/dist/assets/{fullpage-Dx8PYbvz.js → fullpage-Dc1dR2nf.js} +1 -1
- package/dist/assets/{get-safe-url-BF9qL1PD.js → get-safe-url-B9qOA7gB.js} +1 -1
- package/dist/assets/{get-safe-url-BsKINLVF.js → get-safe-url-BTwyxtCV.js} +1 -1
- package/dist/assets/{hi-C5r4WQDs.js → hi-7nPwxLb7.js} +1 -1
- package/dist/assets/{home-D42zu2I_.js → home-BfUTLxOL.js} +1 -1
- package/dist/assets/{id-BQK45J6o.js → id-gU7ysJNs.js} +1 -1
- package/dist/assets/{iframe-Cn--d9nR.js → iframe-CDk6_C57.js} +1 -1
- package/dist/assets/{index-6oQLUjq6.js → index-1NdG9dcQ.js} +7 -7
- package/dist/assets/index-BBlaG9rd.js +77 -0
- package/dist/assets/{index-DpNGP1ih.js → index-BNjqST1U.js} +12 -12
- package/dist/assets/{index-CXVY5UoP.js → index-BQ9qcXAM.js} +7 -7
- package/dist/assets/{index-C0uUrAqS.js → index-BzpSavwm.js} +1 -1
- package/dist/assets/{index-DpOEjWGx.js → index-C8bsu4NM.js} +1 -1
- package/dist/assets/index-CEYigfYv.js +228 -0
- package/dist/assets/{index-BgGF6utP.js → index-CIjk07iX.js} +2 -2
- package/dist/assets/{index-CEbjBHHi.js → index-CKIpILov.js} +1 -1
- package/dist/assets/{index-BvLMNAG0.js → index-CeDgfE-R.js} +1 -1
- package/dist/assets/{index-BDfZ8xEV.js → index-D0faGVLi.js} +3 -3
- package/dist/assets/{index-D5mFr1eo.js → index-D4b-IulH.js} +1 -1
- package/dist/assets/index-DBoRYbIw.js +1 -0
- package/dist/assets/{index-DE_r-gh_.js → index-DGE6IUiK.js} +1 -1
- package/dist/assets/{index-CFT-L0SZ.js → index-DUqnq1p0.js} +1 -1
- package/dist/assets/{index-kk2gduJr.js → index-DX_lvtWO.js} +1 -1
- package/dist/assets/{index-CKsz_iVM.js → index-Hq7kqq19.js} +1 -1
- package/dist/assets/{index-uosYiNLl.js → index-QX3ZQRUn.js} +16 -16
- package/dist/assets/{index-DTzPwoh8.js → index-cBCi42Bf.js} +1 -1
- package/dist/assets/{invitation-DpOgzXor.js → invitation-BkpzegkF.js} +1 -1
- package/dist/assets/{invite-DmpCzOPN.js → invite-DSfHEBpk.js} +1 -1
- package/dist/assets/{issue-passport--83QQUn2.js → issue-passport-DRO3fhhX.js} +1 -1
- package/dist/assets/{item-7Z8_UB5K.js → item-D9PJoNKZ.js} +1 -1
- package/dist/assets/{ja-DsJERrpD.js → ja-C4BURK37.js} +1 -1
- package/dist/assets/{ko-t760ZSCl.js → ko-CeKzLbt8.js} +1 -1
- package/dist/assets/{launch-result-message-C_UhVRcl.js → launch-result-message-0WH2fKJs.js} +1 -1
- package/dist/assets/{layout-Dv_7-Fpq.js → layout-KUVrIKnH.js} +1 -1
- package/dist/assets/list-BmQp9JBM.js +160 -0
- package/dist/assets/{list-header-CfBPZZEw.js → list-header-Cm2JzuBu.js} +1 -1
- package/dist/assets/localization-BUyqSLbi.js +1 -0
- package/dist/assets/{log-CNjGA-yl.js → log-VT6HCVkp.js} +2 -2
- package/dist/assets/{login-DWrSz67b.js → login-BXw8BSYh.js} +1 -1
- package/dist/assets/{login-oauth-callback-VNeZxFH0.js → login-oauth-callback-D_ULXKRT.js} +1 -1
- package/dist/assets/{logo-uploader-DZm2nb0s.js → logo-uploader-B0QGvHYx.js} +5 -5
- package/dist/assets/{lost-passport-DFh2B6Gl.js → lost-passport-CMs5A43o.js} +1 -1
- package/dist/assets/{open-window-BvyLumiN.js → open-window-DFVq0Vka.js} +1 -1
- package/dist/assets/{overview-DNQZ-tgj.js → overview-JoUamf5H.js} +2 -2
- package/dist/assets/{page-header-CJHCTtBc.js → page-header-B2kRYRXR.js} +1 -1
- package/dist/assets/{permission-B0xKCybj.js → permission-CtM69wEM.js} +1 -1
- package/dist/assets/{preferences-BMgF6Djl.js → preferences-BI2Qy7wd.js} +1 -1
- package/dist/assets/{pt-BkjUa7uv.js → pt-o1EeyLhb.js} +1 -1
- package/dist/assets/publish-resource-D5Rx9baz.js +1 -0
- package/dist/assets/{react-beautiful-dnd.esm-DY38RjFx.js → react-beautiful-dnd.esm-C6Cs2eu-.js} +1 -1
- package/dist/assets/{relative-time-C36uWHLw.js → relative-time-D_pFZIBd.js} +1 -1
- package/dist/assets/{ru-1WsQFvuL.js → ru-BlfgKyTj.js} +1 -1
- package/dist/assets/sdk-DCjm9lEU.js +1 -0
- package/dist/assets/session-BTTAIWAT.js +1 -0
- package/dist/assets/{setup-lHrzljce.js → setup-C_n4S096.js} +3 -3
- package/dist/assets/{shorten-label-CYJeMT7h.js → shorten-label-BPVcqm_d.js} +1 -1
- package/dist/assets/{simple-select-CAyDBkK6.js → simple-select-Bly6GilY.js} +1 -1
- package/dist/assets/{slicedToArray-CV571vyX.js → slicedToArray--pkkXr1E.js} +2 -2
- package/dist/assets/{start-DNIWxyMi.js → start-B0Bo1ke7.js} +1 -1
- package/dist/assets/{step-actions-BYFwIhu4.js → step-actions-BdvB3K8O.js} +1 -1
- package/dist/assets/{studio-DBfgF1ck.js → studio-DADXtyow.js} +1 -1
- package/dist/assets/{switch-control-B8wYzo2_.js → switch-control-3273Ci8c.js} +1 -1
- package/dist/assets/{th-CecKmVWf.js → th-BHBtH1Zl.js} +1 -1
- package/dist/assets/{traffic-1TtyUzFO.js → traffic-CG1Pxqmj.js} +1 -1
- package/dist/assets/{transfer-Bh7VQuKL.js → transfer-O3YQ6b4a.js} +1 -1
- package/dist/assets/{unsubscribe-C_eX2N6S.js → unsubscribe-Dx2vvXHo.js} +1 -1
- package/dist/assets/{use-mobile-Bk8quGt9.js → use-mobile-CtFE3PKN.js} +1 -1
- package/dist/assets/{useAsyncRetry-EMRT9Ldq.js → useAsyncRetry-DO0NcRB-.js} +1 -1
- package/dist/assets/{useLocalStorage-tmIJr51I.js → useLocalStorage-BiHNUBhw.js} +1 -1
- package/dist/assets/user-center-LYxpEnYV.js +71 -0
- package/dist/assets/{util-BY6uUuCk.js → util-CB4v94Ia.js} +1 -1
- package/dist/assets/{util-CtKeCk_N.js → util-lgEyE78l.js} +1 -1
- package/dist/assets/{vendor-arcblock-Bf7AGBSd.js → vendor-arcblock-ZjreIevk.js} +3 -3
- package/dist/assets/{vendor-mui-core-CCMNKHtm.js → vendor-mui-core-DHnPlNQK.js} +8 -8
- package/dist/assets/{vendor-mui-x-DmPVvZFJ.js → vendor-mui-x-BcCkWIwf.js} +1 -1
- package/dist/assets/{vi-CDrTp7No.js → vi-CuGQRG8r.js} +1 -1
- package/dist/assets/wrap-locale-dvgNAAzE.js +1 -0
- package/dist/assets/zh-DfOtp2w7.js +4 -0
- package/dist/assets/{zh-tw-CUyoe2CD.js → zh-tw-DFpaHA6Z.js} +1 -1
- package/dist/index.html +3 -3
- package/dist/service-worker.js +1 -1
- package/package.json +21 -21
- package/dist/assets/add-resource-CYNZTaOG.js +0 -1
- package/dist/assets/analytics-0lVXNyXs.js +0 -11
- package/dist/assets/button-CzSgwkGN.js +0 -1
- package/dist/assets/dashboard-B_hsqmQK.js +0 -86
- package/dist/assets/index-BWKYj-2X.js +0 -228
- package/dist/assets/index-CSkA6M4K.js +0 -1
- package/dist/assets/index-fel1gHRy.js +0 -61
- package/dist/assets/list-yjVo8vxH.js +0 -160
- package/dist/assets/localization-CRwVeETn.js +0 -1
- package/dist/assets/publish-resource-B_OOg2Om.js +0 -1
- package/dist/assets/sdk-VtyRZZVE.js +0 -1
- package/dist/assets/session-DutPZhUI.js +0 -1
- package/dist/assets/user-center-pv7oyGUu.js +0 -71
- package/dist/assets/wrap-locale-BjJvyHQM.js +0 -1
- package/dist/assets/zh-Bqr2c2To.js +0 -4
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import{r as h}from"./vendor-react-D-afvo_7.js";import{j as e,a1 as Te,E as y,a4 as qe,T as M,a3 as w,aa as ue,a2 as pe,ah as Me,aj as Ne,x as Re,R as Ue,bH as De,bI as $e,aP as Ve,al as Se,V as He,co as Ge,cm as Je,aN as Qe,bL as Xe,A as Ie}from"./vendor-mui-core-DHnPlNQK.js";import{b as se,z as Ye,A as Ze,ap as re}from"./vendor-utils-5TjOM6td.js";import{b as U,j as Q,_ as Ae,aB as V,e as ne,a5 as et,al as tt,B as Ee,bi as st,aT as nt,bx as at}from"./vendor-arcblock-ZjreIevk.js";import{y as it,F as B,m as ot,H as ye}from"./index-QX3ZQRUn.js";import{d as J,a as rt}from"./vendor-hooks-BKxTDk_P.js";import{b as he}from"./dashboard-D7xokuFw.js";import{p as lt}from"./util-CB4v94Ia.js";import{W as ke}from"./did-address-DL8dQh4X.js";import{S as te}from"./shorten-label-BPVcqm_d.js";import{I as je}from"./index-cBCi42Bf.js";import{c as ve}from"./index-DoZ2YM4T.js";import{S as ct,a as dt}from"./list-BmQp9JBM.js";import{R as Le}from"./relative-time-D_pFZIBd.js";import{D as ut,g as pt}from"./traffic-CG1Pxqmj.js";import{B as Oe}from"./bundle-avatar-C9ats955.js";import{B as ft}from"./index-DBoRYbIw.js";import"./useLocalStorage-BiHNUBhw.js";import"./confirm-yYw8jeh5.js";import"./format-error-C0Ke3VXF.js";import"./PlayArrow-vglCW7W4.js";import"./get-safe-url-B9qOA7gB.js";import"./session-BTTAIWAT.js";import"./useAsyncRetry-DO0NcRB-.js";import"./useAsync-Ua5iss51.js";import"./InfoOutlined-Bd6IN61C.js";import"./useSetState-Crt4S51m.js";import"./index-DGE6IUiK.js";import"./iframe-CDk6_C57.js";import"./LaunchOutlined-CYryXNUL.js";import"./ChevronLeft-BfXQoYEz.js";import"./ChevronRight-CfoEIq_n.js";import"./index-D4b-IulH.js";import"./vendor-mui-x-BcCkWIwf.js";const Pe=h.createContext({}),{Provider:mt,Consumer:Ss}=Pe;function ht({children:t,blocklet:i=""}){const{api:a,inService:f,ws:{useSubscription:m}}=it(),[u,c]=h.useState([]),[j,A]=h.useState({total:0,pageSize:20,pageCount:0,page:1}),[N,_]=h.useState(!1),E=J(()=>{var R;return(R=i.meta)==null?void 0:R.did},[i]),[K,Y]=h.useState({}),[O,H]=h.useState([]),F=async({page:R=1,pageSize:L=20,...C}={})=>{if(!(N||!E))try{_(!0);const I={paging:{page:R,pageSize:L},...C,userName:C.searchText||"",teamDid:E,dateRange:C.dateRange?[B(C.dateRange[0]).toISOString(),B(C.dateRange[1]).toISOString()]:void 0},{dids:W,...Z}=I;let G="";W.includes("system")&&(G="system");const q=W.filter(z=>z!=="system"),ee=await a.getNotificationSendLog({input:{...Z,source:G,componentDids:q}});Y(I);const ae=ee.list.map(z=>({...z,receiverUser:{...z.receiverUser,avatar:lt(z.receiverUser.avatar,E,f)}}));c(ae),A(ee.paging),_(!1)}catch(I){Q.error(I.message),_(!1)}},g=async()=>{const R=await a.getNotificationComponents({input:{teamDid:E}});H(R.componentDids)},D=h.useCallback(R=>{const L=i.children.find(C=>{var I;return((I=C.meta)==null?void 0:I.did)===R});if(L)return L.ancestors=[i],L},[i]),k=async({notificationReceiverIds:R,channels:L,...C})=>{await a.resendNotification({input:{teamDid:E,notificationReceiverIds:R,channels:L.map(I=>I==="wallet"?U.NOTIFICATION_SEND_CHANNEL.WALLET:I==="pushKit"?U.NOTIFICATION_SEND_CHANNEL.PUSH:I),...C}})},$=h.useCallback(async R=>(await a.getUser({input:{teamDid:E,user:{did:R}}})).user,[a,E]);m(`${U.EVENTS.NOTIFICATION_BLOCKLET_CREATE}`,R=>{R&&(F(K),g())},[K]),h.useEffect(()=>{E&&g()},[E]);const S={loading:N,fetch:F,data:u,paging:j,blocklet:i,getComponent:D,resendNotification:k,getUser:$,componentDids:O};return e.jsx(mt,{value:{notificationRecords:S},children:t})}function Fe(){const{notificationRecords:t}=h.useContext(Pe);return t}var xe={},gt=Te;Object.defineProperty(xe,"__esModule",{value:!0});var ze=xe.default=void 0,xt=gt(Ae()),bt=e;ze=xe.default=(0,xt.default)((0,bt.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 be={},St=Te;Object.defineProperty(be,"__esModule",{value:!0});var Be=be.default=void 0,yt=St(Ae()),jt=e;Be=be.default=(0,yt.default)((0,jt.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");const vt=(t,i,a="")=>{if(!a||!i)return"";switch(a){case U.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:i});case U.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:i});case U.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:i});case U.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return a}};function de(t,i,a={}){const{status:f,updatedAt:m,reason:u="",channel:c="wallet"}=a,j=m?t("notification.sendStatus.sentTime",{date:ot(m,i)}):"",A=vt(t,c,u);return f===U.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:j,reason:A}:f===U.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:j}:{status:"pending",title:t("notification.sendStatus.pending"),reason:A,sentTime:j}}const we={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},ge=["wallet","pushKit","email"],wt=(t,i)=>{var m,u;const{settings:a}=t,f=se(i,"extra.notifications.email",!0);return{available:(u=(m=a==null?void 0:a.notification)==null?void 0:m.email)==null?void 0:u.enabled,enabled:f}},Ct=(t,i)=>{var m,u;const{settings:a}=t,f=se(i,"extra.notifications.push",!0);return{available:(u=(m=a==null?void 0:a.notification)==null?void 0:m.pushKit)==null?void 0:u.enabled,enabled:f}},Tt=t=>({enabled:se(t,"extra.notifications.wallet",!0)}),Nt=t=>({enabled:se(t,"extra.webhooks",[]).length>0}),Ce=(t=3e3)=>new Promise(i=>{setTimeout(()=>{i()},t)}),Rt=(t,i)=>i==="wallet"||i==="webhook"?[{channel:i,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:i}),fail:t("notification.sendStatus.reason.disabled",{channel:i})}]:i==="pushKit"||i==="email"?[{channel:i,type:"available",pass:t("notification.sendStatus.reason.available",{channel:i}),fail:t("notification.sendStatus.reason.unavailable",{channel:i})},{channel:i,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:i}),fail:t("notification.sendStatus.reason.disabled",{channel:i})}]:[],Dt=t=>{const i={},a=B().startOf("day");ge.forEach(u=>{const c=`${u}SendRecord`,A=se(t,c,[]).filter(N=>B(N.sendAt).isSame(a,"day")).length;i[u]=A});const f=se(t,"webhook",{}),m=Object.keys(f??{})??[];return m.length>0&&m.forEach(u=>{const j=(f[u]??[]).filter(A=>B(A.sendAt).isSame(a,"day")).length;i[u]=j}),i};function X({config:t,enableTooltip:i=!0,showTitle:a=!1}){const{status:f,title:m="",sentTime:u="",reason:c=""}=t,j=[m,c].filter(Boolean).join(", ");return e.jsx(qe,{title:i?e.jsxs(e.Fragment,{children:[e.jsx(M,{color:"inherit",sx:{fontSize:12},children:j}),e.jsx("span",{children:u})]}):null,arrow:!0,placement:"top",children:e.jsxs(w,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:1},children:[e.jsxs(w,{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center",children:[e.jsx(w,{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:we[f],style:{opacity:.15}}),e.jsx(w,{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:we[f]})]}),a?e.jsx(M,{color:"inherit",sx:{fontSize:12},children:m}):null]})})}X.propTypes={config:y.object.isRequired,enableTooltip:y.bool,showTitle:y.bool};X.defaultProps={enableTooltip:!0,showTitle:!1};_e.propTypes={notification:y.object.isRequired,onCancel:y.func,blocklet:y.object.isRequired,resendChannel:y.string,refresh:y.func,tab:y.string};function _e({notification:t,onCancel:i=()=>{},blocklet:a,resendChannel:f="",refresh:m=()=>{},tab:u="info"}){const{t:c,locale:j}=ne(),{getComponent:A,resendNotification:N,getUser:_}=Fe(),[E,K]=h.useState([]),[Y,O]=h.useState([]),[H,F]=h.useState(null),[g,D]=h.useState(null),k=h.useRef({}),$=J(()=>A(t.componentDid)||a,[a,t.componentDid]),S=J(()=>{var s;return(s=t==null?void 0:t.receivers)==null?void 0:s[0]},[t.receivers]),R=J(()=>S==null?void 0:S.receiver,[S]),L=J(()=>S==null?void 0:S.receiverUser,[S]),C=rt({tab:u||"info"}),I=J(()=>Dt(S),[S]),W=h.useCallback(async s=>{const{receiver:l}=S??{};if(!l)return!1;const p=await _(l);return p?s==="wallet"?Tt(p):s==="email"?wt(a,p):s==="pushKit"?Ct(a,p):s==="webhook"?Nt(p):!0:!1},[S,_,a]);h.useEffect(()=>{if(!S)K([]);else{const s=ge.map(p=>{const b=S[`${p}SendStatus`],v=S[`${p}SendAt`],P=S[`${p}SendFailedReason`],We=de(c,j,{status:b,updatedAt:v,reason:P,channel:p});return{type:p==="pushKit"?"Push Kit":p,extra:We}});K(s);const l=(S==null?void 0:S.webhook)||{};O(Object.entries(l))}},[S,j,c]);const Z=h.useCallback(async(s,l="")=>{const{id:p}=S??{};if(p)try{await N({notificationReceiverIds:[p],channels:[s],...s==="webhook"&&l?{webhookUrls:[l]}:{}}),Q.success("Message has been sent!"),s!=="webhook"&&(await Ce(1e3),F(null))}catch(b){console.error("handleResend error",{error:b}),Q.error(b.response?b.response.statusText:b.message)}},[N,S]),G=async(s,l)=>{if(l==null||l.stopPropagation(),I[s.type]>=4){Q.warning(c("notification.resendLimit"));return}if(l&&F(l==null?void 0:l.currentTarget),D({channel:s.type}),!(!s||s.checking)){K(b=>b.map(v=>s.type===v.type?{...v,checking:!0}:v));try{const b=await W(s.type);await Ce(),D({channel:s.type,result:b}),(typeof b=="boolean"&&b||Ye(b)&&Object.values(b).every(v=>!!v))&&(await Z(s.type),m()),K(v=>v.map(P=>s.type===P.type?{...P,checking:!1}:P))}catch(b){console.error("handleResend error",{error:b})}}},q=async(s,l=null)=>{if(l==null||l.stopPropagation(),I[s]>=4){Q.warning(c("notification.resendLimit"));return}O(b=>b.map(v=>s===v[0]?[...v.slice(0,2),!0]:v));try{await Z("webhook",s),O(b=>b.map(v=>s===v[0]?[...v.slice(0,2),!0]:v)),m()}catch(b){console.error("handleResend error",{error:b})}};h.useEffect(()=>{f&&(C.tab="status",setTimeout(()=>{const s=k.current[f];s&&(ge.includes(f)?(F(s),G({type:f})):q(f))},500))},[f]);const ee=()=>{F(null)},ae=h.useCallback(s=>Rt(c,s),[c]),z=!!H,o=z?"check-resend-popover":void 0;function n(){return[{name:c("notification.from"),value:e.jsx(ct,{size:32,blocklet:$,showName:!0,hideDot:!0})},{name:c("notification.to"),value:e.jsx(w,{children:L?e.jsxs(w,{"data-cy":`member-name-${L.fullName}`,display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start",children:[e.jsx(Ee,{src:`${L.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:R,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(te,{children:L.fullName})]},R):e.jsx(ke,{size:14,responsive:!1,compact:!0,copyable:!1,did:R})})},{name:c("notification.notificationTitle"),value:e.jsx(te,{maxLength:50,children:t.title})},{name:c("notification.body"),value:e.jsx(dt,{notification:t,rows:0})},{name:c("notification.createdAt"),value:e.jsx(Le,{value:t.createdAt,locale:j,shouldUpdate:!0})}].map(l=>e.jsx(je,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:l.name,children:l.value},l.name))}const r={info:{label:c("common.basicInfo"),value:"info",component:n},status:{label:c("notification.status"),value:"status"}},d=Object.values(r).map(({label:s,value:l})=>({label:s,value:l})),x=r[C.tab]||r.info,T=s=>{C.tab=s};return e.jsx(et,{title:c("notification.notificationDetails"),onClose:()=>{C.tab="info",F(null),i()},open:!0,PaperProps:{style:{maxWidth:832,maxHeight:"80vh"}},sx:{"& .MuiDialogContent-root":{paddingTop:0}},fullWidth:!0,actionsPosition:"left",children:e.jsxs(It,{children:[e.jsx(w,{mx:3,className:"tabs",children:e.jsx(tt,{tabs:d,current:C.tab,onChange:T,scrollButtons:"auto"})}),e.jsx("div",{className:"body",children:C.tab==="info"?e.jsx(x.component,{}):e.jsxs(w,{children:[E.map(s=>e.jsx(je,{valueComponent:"div",nameWidth:120,name:s.type,children:e.jsxs(w,{className:"channel-item",display:"flex",alignItems:"center",sx:{gap:"4px",fontSize:14},children:[e.jsx(w,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(X,{config:s.extra,showTitle:!0})}),s.extra.status!=="success"&&e.jsxs(M,{ref:l=>{k.current[s.type]=l},component:"span",display:"flex",alignItems:"center",sx:{color:V.primary.main,fontSize:14},className:ve("resend-btn",{disabled:s.checking||I[s.type]>=4}),onClick:l=>G(s,l),children:[s.checking?e.jsx(pe,{size:12,sx:{color:V.primary.main}}):e.jsx(he,{}),e.jsx("span",{style:{marginLeft:4},children:c("notification.resend")})]})]})},s.type)),e.jsx(Me,{textAlign:"left",sx:{mt:1,mb:1},children:"Webhook"}),e.jsx(w,{className:"notification-resend-section",display:"flex",flexDirection:"column",gap:1,style:{paddingLeft:0},children:Y.map(([s,l,p])=>{const b=l[0],v=de(c,j,{...b,updatedAt:b.sendAt,reason:b.failedReason,channel:"webhook"});return e.jsxs(w,{className:"channel-item",display:"flex",alignItems:"center",sx:{gap:"4px",fontSize:12},children:[e.jsx(te,{maxLength:30,children:s}),e.jsx(w,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(X,{config:v,showTitle:!0})}),v.status!=="success"&&e.jsxs(M,{ref:P=>{k.current[s]=P},component:"span",sx:{color:V.primary.main},className:ve("resend-btn",{disabled:p||I[s]>=4}),onClick:P=>q(s,P),children:[p?e.jsx(pe,{size:12,sx:{color:V.primary.main}}):e.jsx(he,{}),e.jsx("span",{style:{marginLeft:4},children:c("notification.resend")})]})]},s)})})]})}),e.jsx(Ne,{id:o,open:z,anchorEl:H,onClose:ee,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(At,{children:[e.jsxs(M,{variant:"body1",component:"div",className:"check-title",children:[g==null?void 0:g.channel," Checking"]}),e.jsx(w,{display:"flex",flexDirection:"column",sx:{gap:"4px"},children:ae(g==null?void 0:g.channel).map(s=>{var v,P;const{type:l,pass:p,fail:b}=s;return!(g!=null&&g.result)||(v=g==null?void 0:g.result)!=null&&v[l]?e.jsxs(M,{variant:"body1",component:"div",className:"check-item",display:"flex",alignItems:"center",sx:{gap:"4px",color:(P=g==null?void 0:g.result)!=null&&P[l]?V.success.main:"inherit"},children:[g!=null&&g.result?e.jsx(Be,{}):e.jsx(pe,{size:12,sx:{color:V.primary.main}}),e.jsx("span",{children:p})]},l):e.jsxs(M,{variant:"body1",component:"div",display:"flex",alignItems:"center",className:"check-item",sx:{gap:"4px",color:V.error.main},children:[e.jsx(ze,{}),e.jsx("span",{children:b})]},l)})})]})})]})})}const It=ue.div`
|
|
2
|
+
& > .notification-row {
|
|
3
|
+
padding: 0;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.tabs {
|
|
7
|
+
margin: 0;
|
|
8
|
+
}
|
|
9
|
+
.body {
|
|
10
|
+
margin-top: 24px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.channel-item {
|
|
14
|
+
display: flex;
|
|
15
|
+
padding: 4px;
|
|
16
|
+
justify-content: flex-start;
|
|
17
|
+
align-items: center;
|
|
18
|
+
gap: 8px;
|
|
19
|
+
> p {
|
|
20
|
+
font-size: 15px;
|
|
21
|
+
}
|
|
22
|
+
.resend-btn {
|
|
23
|
+
svg {
|
|
24
|
+
font-size: 16px;
|
|
25
|
+
}
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
font-size: 12px;
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
&.disabled {
|
|
31
|
+
cursor: not-allowed;
|
|
32
|
+
color: ${V.text.disabled};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
`,At=ue.div`
|
|
37
|
+
padding: 8px 16px;
|
|
38
|
+
.check-title {
|
|
39
|
+
font-weight: 500;
|
|
40
|
+
margin-bottom: 8px;
|
|
41
|
+
&::first-letter {
|
|
42
|
+
text-transform: uppercase;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
.check-item {
|
|
46
|
+
svg {
|
|
47
|
+
font-size: 16px;
|
|
48
|
+
}
|
|
49
|
+
font-size: 12px;
|
|
50
|
+
}
|
|
51
|
+
`;Ke.propTypes={value:y.array.isRequired,onChange:y.func};function Ke({value:t,onChange:i}){const{locale:a}=ne(),f=B().toDate(),[m,u]=h.useState(null),c=h.useCallback(N=>{u(m?null:N.currentTarget)},[m]),j=!!m,A=h.useCallback(N=>{if(!N.startDate||!N.endDate){Q.error("Please select a date range");return}if(B(N.startDate).isAfter(N.endDate)||!B(N.startDate).isValid()||!B(N.endDate).isValid()){Q.error("Invalid date range");return}i([N.startDate,N.endDate]),u(null)},[i]);return e.jsxs("div",{children:[e.jsx(M,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:0,children:e.jsxs(Re,{onClick:c,variant:"outlined",size:"small",color:"inherit",children:[ye(t[0],a)," - ",ye(t[1],a)]})}),e.jsx(Ne,{open:j,anchorEl:m,onClose:()=>{u(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(ut,{open:!0,maxDate:f,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:c,definedRanges:pt(f),onChange:A})})]})}oe.propTypes={blocklet:y.object,label:y.string};oe.defaultProps={blocklet:null,label:""};const Et=ue.div`
|
|
52
|
+
display: flex;
|
|
53
|
+
justify-items: flex-start;
|
|
54
|
+
align-items: center;
|
|
55
|
+
gap: 8px;
|
|
56
|
+
.name {
|
|
57
|
+
display: block;
|
|
58
|
+
max-width: 260px;
|
|
59
|
+
white-space: nowrap;
|
|
60
|
+
overflow: hidden;
|
|
61
|
+
text-overflow: ellipsis;
|
|
62
|
+
}
|
|
63
|
+
`;function oe({blocklet:t,label:i}){var a;return e.jsx(Et,{children:t?e.jsxs(e.Fragment,{children:[e.jsx(Oe,{size:24,blocklet:t,ancestors:t.ancestors}),e.jsx("span",{className:"name",children:t.title||((a=t.meta)==null?void 0:a.title)})]}):e.jsx("span",{className:"name",children:i})})}const kt=["receiver","data","createdAt","walletSendStatus","pushKitSendStatus","emailSendStatus"],Lt=()=>Ue({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"}}}}}}}),fe=(t,i,a)=>(t[a].splice(i,1),t),me=(t,i)=>i.length?!i.includes(t):!1;function Ot({label:t,onDelete:i,index:a}){return e.jsx(Ie,{label:t,variant:"outlined",...a===1?{onDelete:i}:{}})}function Pt(t){var f;const{t:i}=ne();return!((f=t==null?void 0:t.filterList)!=null&&f.filter(m=>m.length).length)?null:e.jsxs(w,{display:"flex",gap:1,alignItems:"center",children:[e.jsx("div",{className:"toolbar-filter-title",children:i("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(at.TableFilterList,{...t,ItemComponent:Ot})})]})}ie.propTypes={status:y.number.isRequired,updatedAt:y.string.isRequired,reason:y.string,channel:y.string,onResend:y.func};function ie({status:t,updatedAt:i,reason:a="",channel:f="wallet",onResend:m}){const{t:u,locale:c}=ne(),j=de(u,c,{status:t,updatedAt:i,reason:a,channel:f});return e.jsxs(w,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(X,{config:j,showTitle:!0}),j.status!=="success"&&e.jsx(Re,{className:"resend-btn",size:"small",startIcon:e.jsx(he,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2rpx"}},onClick:m,children:u("notification.resend")})]})}le.propTypes={filterList:y.array.isRequired,onChange:y.func.isRequired,index:y.number.isRequired,column:y.object.isRequired,statusFilterValues:y.array.isRequired,label:y.string.isRequired};function le({filterList:t,onChange:i,index:a,column:f,statusFilterValues:m,label:u}){return e.jsxs(De,{className:"filter-container",children:[e.jsx(Ge,{component:"legend",children:u}),e.jsx(Je,{row:!0,children:m.map(c=>{const j={status:c.status};return e.jsx(Qe,{control:e.jsx(Xe,{checked:t[a].indexOf(c.value)>-1,onChange:A=>{A.target.checked?t[a].push(c.value):t[a]=t[a].filter(N=>N!==c.value),i(t[a],a,f)},name:c.value}),label:e.jsxs("span",{style:{display:"flex",alignItems:"center"},children:[e.jsx(X,{enableTooltip:!1,config:j}),c.label]})},c.value)})})]})}ce.propTypes={list:y.array.isRequired,label:y.string.isRequired,onDelete:y.func.isRequired};function ce({list:t,label:i,onDelete:a}){const{t:f,locale:m}=ne();return e.jsxs(w,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(M,{children:[i,": "]}),t.map(u=>{const c=de(f,m,{status:u});return e.jsx(Ie,{size:"small",label:e.jsxs(w,{display:"flex",alignItems:"center",sx:{gap:"4rpx"},children:[e.jsx(X,{config:c,enableTooltip:!1}),e.jsx("span",{children:c.title})]}),onDelete:j=>a(j,u)},u)})]})}function Ft(){var z;const{t,locale:i}=ne(),{data:a,paging:f,loading:m,blocklet:u,fetch:c,getComponent:j,componentDids:A}=Fe(),N=h.useRef(null),[_,E]=h.useState(null),[K,Y]=h.useState(""),[O,H]=h.useState(kt),F=`notification-records-${(z=u.meta)==null?void 0:z.did}`,g=st(F),[D,k]=h.useState({searchText:g.searchText||"",pageSize:g.rowsPerPage||10,page:g.page?g.page+1:1,dids:g.dids||[],walletSendStatus:g.walletSendStatus||[],pushKitSendStatus:g.pushKitSendStatus||[],emailSendStatus:g.emailSendStatus||[],dateRange:g.dateRange||[B().subtract(1,"month").startOf("day").toDate(),B().endOf("day").toDate()]}),$=J(()=>{if(!u.children||!u.children.length)return[];const o=[];return u.children.forEach(n=>{var d;const r=n.did||((d=n.meta)==null?void 0:d.did);A.includes(r)&&(n.ancestors=[u],o.push(n))}),o},[A,u]),S=h.useCallback(o=>{const{notification:n}=o,r=Ze(o,"notification");return r.read=!0,n.receivers=[r],n},[]),R=h.useCallback(o=>{const n=S(o);E(n)},[S]);h.useEffect(()=>{c(D)},[D]),h.useEffect(()=>{E(o=>{if(!o)return null;const n=a.find(r=>r.notification.id===o.id);return n?R(n):o})},[a,R]);const L=({page:o,rowsPerPage:n,searchText:r,filterList:d})=>{const[,x=[],T=[],s=[],l=[]]=d;D.pageSize!==n?k(p=>({...p,pageSize:n,page:1})):D.page!==o+1?k(p=>({...p,page:o+1})):D.searchText!==r?k(p=>({...p,searchText:r,page:1})):re(D.walletSendStatus,T)?re(D.pushKitSendStatus,s)?re(D.emailSendStatus,l)?re(D.dids,x)||k(p=>({...p,dids:x,page:1})):k(p=>({...p,emailSendStatus:l,page:1})):k(p=>({...p,pushKitSendStatus:s,page:1})):k(p=>({...p,walletSendStatus:T,page:1}))},C=[{label:t("notification.sendStatus.pending"),value:0,status:"pending"},{label:t("notification.sendStatus.success"),value:1,status:"success"},{label:t("notification.sendStatus.failed"),value:2,status:"failed"}],I=(o,n,r,d)=>{o.stopPropagation();const x=r.filter(T=>T!==n);k(T=>({...T,[d]:x,page:1}))},W=(o,n,r)=>{o.stopPropagation();const d=S(n);E(d),Y(r)},Z=()=>{E(null),Y("")},G=h.useCallback(()=>{c(D)},[c,D]),q=[{label:t("notification.receiver"),name:"receiver",width:200,options:{filter:!1,display:O.includes("receiver"),customBodyRenderLite:o=>{const{receiverUser:n,receiver:r}=a[o];return n?e.jsxs(w,{"data-cy":`member-name-${n.fullName}`,display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start",children:[e.jsx(Ee,{src:`${n.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:r,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(te,{children:n.fullName})]},r):e.jsx(ke,{size:14,responsive:!1,compact:!0,copyable:!1,did:r})}}},{label:t("notification.notificationPreview"),name:"data",width:300,options:{filter:!0,filterType:"custom",customFilterListOptions:{render:o=>o.map((n,r)=>{var x;if(n==="system")return e.jsx("span",{children:t("notification.system")},`system-${r}`);const d=$.find(T=>{var l;return(T.did||((l=T.meta)==null?void 0:l.did))===n});return e.jsx(oe,{blocklet:d,label:(d==null?void 0:d.title)||((x=d==null?void 0:d.meta)==null?void 0:x.title)},n)}),update:(o,n,r)=>(o[r].splice(n,1),o)},filterOptions:{names:$,logic:(o,n)=>n.length?!n.includes(o):!1,display:(o,n,r,d)=>e.jsxs(De,{style:{width:"380px"},children:[e.jsx($e,{id:"demo-simple-select-label",style:{background:"#ffffff"},children:"Sender"}),e.jsxs(Ve,{multiple:!0,value:o[r],renderValue:x=>e.jsx(w,{display:"flex",gap:1,alignItems:"center",style:{overflow:"hidden",textOverflow:"ellipsis"},children:x.map(T=>{var l;if(T==="system")return e.jsx("span",{children:t("notification.system")},T);const s=$.find(p=>{var v;return(p.did||((v=p.meta)==null?void 0:v.did))===T});return e.jsx(oe,{blocklet:s,label:(s==null?void 0:s.title)||((l=s==null?void 0:s.meta)==null?void 0:l.title)},T)})}),onChange:x=>{o[r]=x.target.value,n(o[r],r,d)},children:[e.jsx(Se,{value:"system",children:t("notification.system")}),$.map(x=>{var s,l;const T=x.did||((s=x.meta)==null?void 0:s.did);return e.jsx(Se,{value:T,children:e.jsx(oe,{blocklet:x,label:x.title||((l=x.meta)==null?void 0:l.title)})},T)})]})]})},display:O.includes("data"),customBodyRenderLite:o=>{const n=a[o],{notification:r}=n,d=j(r.componentDid);return e.jsxs(w,{display:"flex",alignItems:"center",gap:1,onClick:x=>{x.stopPropagation(),R(n)},children:[d?e.jsx(Oe,{size:32,blocklet:d,ancestors:d.ancestors??[]}):e.jsx(ft,{blocklet:u,size:32}),e.jsx(te,{maxLength:50,children:r.title})]})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{display:O.includes("walletSendStatus"),setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:D.walletSendStatus??[],customFilterListOptions:{render:o=>e.jsx(ce,{list:o,label:"Wallet",onDelete:(n,r)=>{n.stopPropagation(),I(n,r,q[2].options.filterList,"walletSendStatus")}}),update:fe},filterOptions:{names:C,fullWidth:!0,logic:me,display:(o,n,r,d)=>e.jsx(le,{label:"Wallet",filterList:o,onChange:n,index:r,column:d,statusFilterValues:C})},customBodyRenderLite:o=>{const{walletSendStatus:n,walletSendAt:r,walletSendFailedReason:d}=a[o];return e.jsx(ie,{status:n,updatedAt:r,reason:d,channel:"wallet",onResend:x=>W(x,a[o],"wallet")})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{display:O.includes("pushKitSendStatus"),setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:o=>{const{pushKitSendStatus:n,pushKitSendAt:r,pushKitSendFailedReason:d}=a[o];return e.jsx(ie,{status:n,updatedAt:r,reason:d,channel:"pushkit",onResend:x=>W(x,a[o],"pushKit")})},filter:!0,filterType:"custom",filterList:D.pushKitSendStatus??[],customFilterListOptions:{render:o=>e.jsx(ce,{list:o,label:"Push Kit",onDelete:(n,r)=>{n.stopPropagation(),I(n,r,q[3].options.filterList,"pushKitSendStatus")}}),update:fe},filterOptions:{names:C,fullWidth:!0,logic:me,display:(o,n,r,d)=>e.jsx(le,{label:"Push Kit",filterList:o,onChange:n,index:r,column:d,statusFilterValues:C})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),display:O.includes("emailSendStatus"),customBodyRenderLite:o=>{const{emailSendStatus:n,emailSendAt:r,emailSendFailedReason:d}=a[o];return e.jsx(ie,{status:n,updatedAt:r,reason:d,channel:"email",onResend:x=>W(x,a[o],"email")})},filter:!0,filterType:"custom",filterList:D.emailSendStatus??[],customFilterListOptions:{render:o=>e.jsx(ce,{list:o,label:"Email",onDelete:(n,r)=>{n.stopPropagation(),I(n,r,q[4].options.filterList,"emailSendStatus")}}),update:fe},filterOptions:{names:C,fullWidth:!0,logic:me,display:(o,n,r,d)=>e.jsx(le,{label:"Email",filterList:o,onChange:n,index:r,column:d,statusFilterValues:C})}}},{label:"Webhook",name:"webhook",width:200,options:{display:O.includes("webhook"),filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:o=>{const{webhook:n}=a[o];if(!n)return null;const r=Object.entries(n)[0];if(!r)return null;const[d,x]=r,T=x[0];return e.jsx(w,{display:"flex",flexDirection:"column",gap:1,children:e.jsxs(w,{className:"webhook-item",fontSize:12,children:[e.jsx(te,{maxLength:30,children:d},d),e.jsx(ie,{status:T.status,updatedAt:T.sendAt,reason:T.failedReason,channel:"webhook",onResend:s=>W(s,a[o],d)})]},d)})}}},{label:t("common.createdAt"),name:"createdAt",width:200,options:{filter:!1,display:O.includes("createdAt"),customBodyRenderLite:o=>{const{createdAt:n}=a[o];return e.jsx(Le,{value:n,locale:i,shouldUpdate:!0})}}}],ee=o=>{k(n=>({...n,dateRange:o,page:1}))},ae=[e.jsx(Ke,{value:D.dateRange,onChange:ee})];return e.jsxs(w,{ref:N,sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:[e.jsx(zt,{children:e.jsx(He,{theme:Lt(),children:e.jsx(nt,{className:"main-data",verticalKeyWidth:100,loading:m,locale:i,columns:q,data:a,durable:F,onChange:L,options:{sort:!1,download:!1,print:!1,expandableRowsOnClick:!0,searchPlaceholder:t("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:f.page-1,rowsPerPage:f.pageSize,count:f.total,...g,searchText:D.searchText,onViewColumnsChange:(o,n)=>{H(n==="add"?r=>[...r,o]:r=>r.filter(d=>d!==o))}},customButtons:ae,components:{TableFilterList:Pt}})})}),_&&e.jsx(_e,{refresh:G,onCancel:Z,notification:_,blocklet:u,resendChannel:K})]})}const zt=ue.div`
|
|
64
|
+
td.MuiTableCell-footer {
|
|
65
|
+
border: none !important;
|
|
66
|
+
}
|
|
67
|
+
.sent-status-cell {
|
|
68
|
+
.resend-btn {
|
|
69
|
+
display: none;
|
|
70
|
+
}
|
|
71
|
+
&:hover {
|
|
72
|
+
.resend-btn {
|
|
73
|
+
display: flex;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
`;Bt.propTypes={blocklet:y.object.isRequired};function Bt({blocklet:t={}}){return e.jsx(ht,{blocklet:t,children:e.jsx(Ft,{})})}export{Bt as default,Lt as getMuiTheme};
|