@abtnode/blocklet-services 1.16.53-beta-20251013-075536-64fcb94b → 1.16.53-beta-20251014-110009-8220e324
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/middlewares/verify-did.js +27 -0
- package/api/routes/csp-proxy.js +4 -0
- package/api/routes/ocap.js +18 -3
- package/api/routes/openapi.js +3 -2
- package/api/routes/opencomponent.js +3 -2
- package/api/routes/openembed.js +3 -2
- package/api/routes/user.js +11 -9
- package/api/services/auth/session.js +6 -0
- package/dist/assets/{AdapterDayjs-Bp0ir26R.js → AdapterDayjs-DyE9ImrK.js} +1 -1
- package/dist/assets/{Google-E3u2a9g7.js → Google-ZJmTt04Y.js} +1 -1
- package/dist/assets/{access-control-CUUGBegg.js → access-control-tkXiKu_B.js} +1 -1
- package/dist/assets/{actions-B4VXcSRp.js → actions-C4-lIUPY.js} +1 -1
- package/dist/assets/{add-component-core-D8CsaWtE.js → add-component-core-DZewqmQf.js} +17 -17
- package/dist/assets/{add-resource-DRYWyzFg.js → add-resource-CFOC6fO8.js} +1 -1
- package/dist/assets/{addon-DhicELT4.js → addon-CAEOt-oM.js} +1 -1
- package/dist/assets/{advanced-D4kyySFu.js → advanced-BsPW8tKj.js} +2 -2
- package/dist/assets/aigne-C6-afA57.js +10 -0
- package/dist/assets/api-txzyyizM.js +1 -0
- package/dist/assets/{appearance-DiUMtWiZ.js → appearance-BZqg7Kkn.js} +1 -1
- package/dist/assets/{ar-7nBHeQPa.js → ar-DW15ct8A.js} +1 -1
- package/dist/assets/{ar-CHd3xUx5.js → ar-Ge3t6oI2.js} +2 -2
- package/dist/assets/{arrow-down.svg-DgXRF8DP.js → arrow-down.svg-zOZF6XLO.js} +1 -1
- package/dist/assets/audit-logs-aCVF7lhB.js +35 -0
- package/dist/assets/{authorize-Dr-5dOao.js → authorize-QCoPxe3U.js} +1 -1
- package/dist/assets/{base-chart-UFWO9a3P.js → base-chart-C_jLgGFD.js} +1 -1
- package/dist/assets/{base32-BK7MXAD4.js → base32-Cg02gOuu.js} +1 -1
- package/dist/assets/bind-account-C8pbYbtP.js +1 -0
- package/dist/assets/{branding-BqZaDEQy.js → branding-BxYz3fG3.js} +5 -5
- package/dist/assets/{branding-Bwa2_l30.js → branding-CKEfz45I.js} +1 -1
- package/dist/assets/branding-r2VAPR6q.js +1 -0
- package/dist/assets/{bundle-avatar-D5n6XSFF.js → bundle-avatar-CRBdm-Kg.js} +1 -1
- package/dist/assets/button-CaqBEwnu.js +1 -0
- package/dist/assets/click-to-copy-CK42VmRr.js +1 -0
- package/dist/assets/{cloneDeep-LRq4Ya2k.js → cloneDeep-gpb_g13N.js} +1 -1
- package/dist/assets/{collapse-DJGzUM1Q.js → collapse-D7GlSZQp.js} +1 -1
- package/dist/assets/{complete-CJN6MZr9.js → complete-B1ERhNgz.js} +3 -3
- package/dist/assets/{component-BkgYdhLW.js → component-D1imN4b5.js} +2 -2
- package/dist/assets/{config-BKWRBZkN.js → config-CRH_AVvL.js} +2 -2
- package/dist/assets/{config-NzhCDrRK.js → config-D9yLBkGc.js} +1 -1
- package/dist/assets/{config-C6P5yz_l.js → config-dGkFpD36.js} +4 -4
- package/dist/assets/config-navigation-CkwpaFE2.js +40 -0
- package/dist/assets/config-space-DEqVeU5w.js +1 -0
- package/dist/assets/confirm-DAMhAYR3.js +7 -0
- package/dist/assets/{connect-Cp5779ib.js → connect-BHzZ3O8m.js} +1 -1
- package/dist/assets/{connect-DCldlgle.js → connect-VhC_tOjl.js} +1 -1
- package/dist/assets/connect-to-CnrptX8a.js +1 -0
- package/dist/assets/{content-layout-B9tc9LCL.js → content-layout-W7JDm8iO.js} +1 -1
- package/dist/assets/{create-passport-svg-n0J1kwzH.js → create-passport-svg-BsR3hKFq.js} +1 -1
- package/dist/assets/createClass-B4I2IV47.js +1 -0
- package/dist/assets/{dashboard-COW8XxoK.js → dashboard-C6gjCAD6.js} +7 -7
- package/dist/assets/{de-CD44Obtw.js → de-CbARTvf4.js} +2 -2
- package/dist/assets/{de-Dn7PhTZq.js → de-DomrlJGv.js} +1 -1
- package/dist/assets/{delete-confirm-DDcjKsY2.js → delete-confirm-Ca3miSFM.js} +1 -1
- package/dist/assets/{did-address-DnFNwELW.js → did-address-BQL5Zxlr.js} +1 -1
- package/dist/assets/{domain-DR_J7IrS.js → domain-DZJxjNTq.js} +1 -1
- package/dist/assets/{domain-action-card-CuN-BTun.js → domain-action-card-CPmR-n-P.js} +2 -2
- package/dist/assets/domains-DH3UyJ8c.js +1 -0
- package/dist/assets/{email-Da8K28dJ.js → email-dNTq-UZN.js} +2 -2
- package/dist/assets/{empty-spinner-LXNYl6_1.js → empty-spinner-sNq-0DF5.js} +1 -1
- package/dist/assets/engine-lkWYvtZC.js +1 -0
- package/dist/assets/{es-B_X5HHiA.js → es-BWRncAvl.js} +1 -1
- package/dist/assets/{es-DNFAt0y7.js → es-CaCbzATO.js} +2 -2
- package/dist/assets/exchange-passport-C-tUCCyK.js +1 -0
- package/dist/assets/{form-BO9zQEEu.js → form-BIXDp48N.js} +3 -3
- package/dist/assets/{form-text-input-CwOsIY5R.js → form-text-input-AIMlcRaM.js} +1 -1
- package/dist/assets/{form-wrapper-Dt1iJZge.js → form-wrapper-DINLdpTN.js} +1 -1
- package/dist/assets/{fr-C9xE9tD4.js → fr-B3yjKUFH.js} +2 -2
- package/dist/assets/{fr-BIAMVkwl.js → fr-DkEISw5U.js} +1 -1
- package/dist/assets/{fuel-QHX754Te.js → fuel-_yedTm2I.js} +1 -1
- package/dist/assets/{gen-access-key-1fCgd-vd.js → gen-access-key-DXoAyhBv.js} +1 -1
- package/dist/assets/{gen-simple-access-key-DrYDMNDo.js → gen-simple-access-key-BPpzmXdv.js} +1 -1
- package/dist/assets/get-safe-url-94yHUMyk.js +1 -0
- package/dist/assets/{hi-4-0lpKbp.js → hi-CNLsAFCp.js} +1 -1
- package/dist/assets/{hi-D_0DFJcS.js → hi-q4mhHiIl.js} +1 -1
- package/dist/assets/{home-CR7v9FTO.js → home-CgfBIBYo.js} +1 -1
- package/dist/assets/{id-Dw1-p0GY.js → id-CiNosIvh.js} +1 -1
- package/dist/assets/{id-BgJjfH2L.js → id-DTf7aVH8.js} +2 -2
- package/dist/assets/{iframe-CKOcsJB-.js → iframe-D73zp9VN.js} +1 -1
- package/dist/assets/{index-ChdZfn2Z.js → index-3gh3KcSo.js} +9 -9
- package/dist/assets/{index-BSTi6sO4.js → index-9GU1U3uC.js} +2 -2
- package/dist/assets/index-B07KPoAU.js +7 -0
- package/dist/assets/index-BO_K5qp8.js +4 -0
- package/dist/assets/index-BV58Bk4h.js +6 -0
- package/dist/assets/index-BcGECSaf.js +1 -0
- package/dist/assets/{index-6KFpxb0K.js → index-BdlpB2eR.js} +7 -7
- package/dist/assets/{index-DYxM5dQ0.js → index-Bsziwsc_.js} +6 -6
- package/dist/assets/index-CSjGSZvb.js +55 -0
- package/dist/assets/{index-9WUHnAoz.js → index-CT7MCvWf.js} +2 -2
- package/dist/assets/index-CWoGXO4Z.js +30 -0
- package/dist/assets/{index-Y8LQew4k.js → index-Cd_Gml9C.js} +1 -1
- package/dist/assets/index-CeTnfded.js +1 -0
- package/dist/assets/index-CmM1Fb8I.js +1041 -0
- package/dist/assets/{index-BAigP45p.js → index-CoEkDRkg.js} +3 -3
- package/dist/assets/{index-DuO31sai.js → index-CtjgKQvS.js} +12 -12
- package/dist/assets/{index-DyNpNTLA.js → index-D2x0prGU.js} +5 -5
- package/dist/assets/{index-BFBoLr1Z.js → index-DACE9NO5.js} +1 -1
- package/dist/assets/{index-BH9BMLP2.js → index-DGuACYX4.js} +2 -2
- package/dist/assets/{index-Oj4fYD5K.js → index-DJwvNiRa.js} +13 -13
- package/dist/assets/{index-Bx-RW9vi.js → index-DX3L95vz.js} +1 -1
- package/dist/assets/{index-pDY1qDDT.js → index-DhLGB_2p.js} +1 -1
- package/dist/assets/{index-CGC3omja.js → index-Dl5NP6ym.js} +8 -8
- package/dist/assets/{index-DlrQ2HQP.js → index-DlRa8Zeh.js} +1 -1
- package/dist/assets/index-Dvkly5_Y.js +1 -0
- package/dist/assets/{index--2eh3YdI.js → index-DwuQFnlr.js} +1 -1
- package/dist/assets/{index-Ba9-ArMT.js → index-IGBGBXd_.js} +1 -1
- package/dist/assets/{index-Difo-vx2.js → index-J-Fwoozx.js} +1 -1
- package/dist/assets/{index-3ePiAFIp.js → index-KpZGUssm.js} +1 -1
- package/dist/assets/{index-C5sng-9P.js → index-M4Y_gFoP.js} +2 -2
- package/dist/assets/{index-BO080WnZ.js → index-VySXxf4w.js} +1 -1
- package/dist/assets/index-erYyAW7o.js +1 -0
- package/dist/assets/index-gu-JSZcO.js +113 -0
- package/dist/assets/{index-BZUEA_VO.js → index-xrCVFXc_.js} +5 -5
- package/dist/assets/{invitation-BKbYsXkF.js → invitation-LkRqaKIR.js} +5 -5
- package/dist/assets/invitations-D0twFHTb.js +3 -0
- package/dist/assets/invite-Bq02Wgwb.js +1 -0
- package/dist/assets/{isURL-B2kErAOg.js → isURL-DAY9MZJJ.js} +2 -2
- package/dist/assets/issue-passport-NpVrtTSF.js +1 -0
- package/dist/assets/{item-BFG9doj4.js → item-A9AxqmJb.js} +1 -1
- package/dist/assets/{ja-SFs9TI5a.js → ja-Csh_XwzF.js} +2 -2
- package/dist/assets/{ja-C6gbn0J8.js → ja-D5EfJGvg.js} +1 -1
- package/dist/assets/{ko-av2FKXII.js → ko-DIYdQvvz.js} +1 -1
- package/dist/assets/{ko-CHdBh-EI.js → ko-xiNTwgO9.js} +2 -2
- package/dist/assets/landing-page-BBhzhyhU.js +1 -0
- package/dist/assets/{launch-result-message-DW948RfZ.js → launch-result-message-Dt-T7zmz.js} +1 -1
- package/dist/assets/{layout-BByAfem8.js → layout-CT8j1IGl.js} +1 -1
- package/dist/assets/list-CpdSyVlo.js +103 -0
- package/dist/assets/{list-4bMHptVO.js → list-DcrvvV8X.js} +1 -1
- package/dist/assets/{list-header-DMpz8A8v.js → list-header-CjohGZ9B.js} +1 -1
- package/dist/assets/localization-BnjH2TLn.js +1 -0
- package/dist/assets/{log-BgOBDKaO.js → log-CcKk7QZL.js} +1 -1
- package/dist/assets/logger-DkBs7Soy.js +1 -0
- package/dist/assets/login-IMzJsMuG.js +1 -0
- package/dist/assets/{login-oauth-callback-D81WLOfu.js → login-oauth-callback-Df5gSERT.js} +1 -1
- package/dist/assets/{logo-uploader-BSLuQUWG.js → logo-uploader-DI_6oB30.js} +1 -1
- package/dist/assets/{lost-passport-CN1lCjAR.js → lost-passport-i0WRSJQt.js} +3 -3
- package/dist/assets/{observability-pdEZhjSl.js → observability-B458LeIE.js} +1 -1
- package/dist/assets/{omit-BQZKecPT.js → omit-DdfLLBNW.js} +1 -1
- package/dist/assets/{open-window-DFdTfBab.js → open-window-CrdkIvcc.js} +1 -1
- package/dist/assets/{over-due-invoice-payment-BHBjNHAK.js → over-due-invoice-payment-Dairtuas.js} +1 -1
- package/dist/assets/{overview-BNptGAD0.js → overview-D4hz1f04.js} +2 -2
- package/dist/assets/{page-header-DvSb4Cmz.js → page-header-gosgJ3fX.js} +1 -1
- package/dist/assets/passport-B2fL-0uN.js +1 -0
- package/dist/assets/{passport-item-cu1WVC_B.js → passport-item-L7acCYqJ.js} +1 -1
- package/dist/assets/{permission-ya4qYiIS.js → permission-B7_8SVB9.js} +1 -1
- package/dist/assets/{playground-C0bWoIDS.js → playground-_1Dj8J_h.js} +1 -1
- package/dist/assets/preferences-BNy97I1g.js +1 -0
- package/dist/assets/profile-embed-hHsyn2Ki.js +1 -0
- package/dist/assets/pt-BvcG4R7B.js +5 -0
- package/dist/assets/{pt-C5SxM_jO.js → pt-aIOBgpHE.js} +1 -1
- package/dist/assets/publish-resource-urgBZEXm.js +1 -0
- package/dist/assets/{react-beautiful-dnd.esm-BeX82uI5.js → react-beautiful-dnd.esm-CIwtis6a.js} +1 -1
- package/dist/assets/{react-stripe.esm-C51Uah32.js → react-stripe.esm-omsK4b05.js} +1 -1
- package/dist/assets/{required-BT8zXV8U.js → required-BPzIdi1N.js} +1 -1
- package/dist/assets/{ru-BWd-_jpY.js → ru-Bt8-v101.js} +1 -1
- package/dist/assets/ru-DzUPRLmr.js +5 -0
- package/dist/assets/runtime-wNrz-OwM.js +1 -0
- package/dist/assets/{sanitize-C5jEFDvG.js → sanitize-CEXE1rEu.js} +1 -1
- package/dist/assets/sdk-mf5ixH6N.js +1 -0
- package/dist/assets/{section-ZPKr6_ii.js → section-DOw43pby.js} +1 -1
- package/dist/assets/{security-BlvbBEUe.js → security-D5AcOcu2.js} +3 -3
- package/dist/assets/session-BtQQCb_u.js +1 -0
- package/dist/assets/{setup-BZH_pYLe.js → setup-PRcxWbhy.js} +1 -1
- package/dist/assets/{shorten-label-DVy6K5I7.js → shorten-label-C-X_7vr2.js} +1 -1
- package/dist/assets/{simple-select-BeAlThKq.js → simple-select-Bg4XC1E_.js} +1 -1
- package/dist/assets/{spaces-BwBxBfty.js → spaces-jHZOfRT3.js} +1 -1
- package/dist/assets/{start-DZ1T1oW8.js → start-DyT2xbZe.js} +1 -1
- package/dist/assets/{starting-progress-HuVVYFsR.js → starting-progress-Jn-4yF7_.js} +1 -1
- package/dist/assets/status-b40PyJnc.js +1 -0
- package/dist/assets/{step-actions-D4zI4sWZ.js → step-actions-BZmm0ei-.js} +1 -1
- package/dist/assets/{studio-UxYOr-dB.js → studio-Dqjq8IDN.js} +1 -1
- package/dist/assets/{switch-control-DEpBEl7-.js → switch-control-CRxlGq2g.js} +1 -1
- package/dist/assets/{table-tips-rCE1XKlc.js → table-tips-BMq3WO_p.js} +1 -1
- package/dist/assets/team-DK_N0J3a.js +146 -0
- package/dist/assets/th-BmW1qKpZ.js +5 -0
- package/dist/assets/{th-CRUlNqtq.js → th-QYkziTlm.js} +1 -1
- package/dist/assets/traffic-BVT9gNf1.js +1 -0
- package/dist/assets/{transfer-DBlISG7m.js → transfer-BGhQJnlc.js} +2 -2
- package/dist/assets/unsubscribe-DsNv3U7c.js +1 -0
- package/dist/assets/{use-app-logo-BjReZUm7.js → use-app-logo-BKyiSzxV.js} +1 -1
- package/dist/assets/{use-mobile-BQQpAf3i.js → use-mobile-DLnLSQQq.js} +1 -1
- package/dist/assets/{use-mobile-D6YQgajG.js → use-mobile-Db5FIl07.js} +1 -1
- package/dist/assets/{use-server-logo-ClR4qaF0.js → use-server-logo-CFlVReBS.js} +1 -1
- package/dist/assets/{use-window-close-CAdGHigF.js → use-window-close-CrHmRyVV.js} +1 -1
- package/dist/assets/{useAsync-DVtDVEv6.js → useAsync-1_z8P8M4.js} +1 -1
- package/dist/assets/{useAsync-fWwm3Jbj.js → useAsync-BKYfrNw7.js} +1 -1
- package/dist/assets/{useAsyncRetry-EEjDgDMR.js → useAsyncRetry-Dyo5t1bq.js} +1 -1
- package/dist/assets/{useLocalStorage-BtAV-lV2.js → useLocalStorage-Be_1V0gr.js} +1 -1
- package/dist/assets/user-center-BcjjuRmk.js +126 -0
- package/dist/assets/{user-follower-McTCB9YD.js → user-follower-DgAPhBY5.js} +1 -1
- package/dist/assets/{user-sessions-DYtBKHTy.js → user-sessions-Bv46aXrx.js} +1 -1
- package/dist/assets/{util-V3sRgqXp.js → util-BLs2BnSw.js} +1 -1
- package/dist/assets/{util-DDkRAi85.js → util-CxUMQb4N.js} +1 -1
- package/dist/assets/{vendor-arcblock-DeeG8u0h.js → vendor-arcblock-DGOH9a3F.js} +115 -114
- package/dist/assets/{vendor-hooks-BlA8TRnZ.js → vendor-hooks-DmThWyyG.js} +1 -1
- package/dist/assets/{vendor-mui-core-DRxbhqaK.js → vendor-mui-core-BFPsXaTR.js} +1 -1
- package/dist/assets/{vendor-mui-x-Qp6zkx78.js → vendor-mui-x-C6iZOJbV.js} +1 -1
- package/dist/assets/vendor-utils-OrZFrHBP.js +213 -0
- package/dist/assets/vendor-ux-CE4sOH7O.js +1569 -0
- package/dist/assets/{vi-5AzowaJ4.js → vi-BIkODa3n.js} +1 -1
- package/dist/assets/vi-BPU54RQW.js +5 -0
- package/dist/assets/{wait-connect-C4xkzmAl.js → wait-connect-D97I-PbQ.js} +1 -1
- package/dist/assets/{wizard-5C6_E9yj.js → wizard-Bs0eTfDi.js} +2 -2
- package/dist/assets/{wizard-components-Cu-kCEHh.js → wizard-components-BwF9dBN2.js} +2 -2
- package/dist/assets/wrap-locale-D6EgWtG_.js +1 -0
- package/dist/assets/{zh-Ckmy3lEn.js → zh-Dp_c1E39.js} +1 -1
- package/dist/assets/{zh-CZLHYA5h.js → zh-WrFfMVyM.js} +1 -1
- package/dist/assets/{zh-tw-DAvBOrfW.js → zh-tw-CYPf8U5U.js} +1 -1
- package/dist/assets/{zh-tw-B-qWW0q8.js → zh-tw-DjWFpq-W.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +37 -37
- package/dist/assets/aigne--ydEFgxM.js +0 -10
- package/dist/assets/api-rC33aBSs.js +0 -1
- package/dist/assets/audit-logs-zMqI7X3o.js +0 -35
- package/dist/assets/bind-account-DA7_VhlG.js +0 -1
- package/dist/assets/branding-CDF8I7CS.js +0 -1
- package/dist/assets/button-BmGMF4AE.js +0 -1
- package/dist/assets/click-to-copy-CO6UIqva.js +0 -1
- package/dist/assets/config-navigation-CpkTSVgC.js +0 -40
- package/dist/assets/config-space-D742OP6B.js +0 -1
- package/dist/assets/confirm-D1n-RK65.js +0 -7
- package/dist/assets/connect-to-CzzpDiUC.js +0 -1
- package/dist/assets/createClass-D_F4rKN8.js +0 -1
- package/dist/assets/domains-BwpVswVc.js +0 -1
- package/dist/assets/engine-CynZsYEr.js +0 -1
- package/dist/assets/exchange-passport-Bic3wuCk.js +0 -1
- package/dist/assets/get-safe-url-BrBIp6RF.js +0 -1
- package/dist/assets/index-B6gW9Yjq.js +0 -1
- package/dist/assets/index-BAm_yZT8.js +0 -6
- package/dist/assets/index-BOst2c_c.js +0 -29
- package/dist/assets/index-De6RU5uv.js +0 -55
- package/dist/assets/index-Dt8akALo.js +0 -1039
- package/dist/assets/index-F6BB6AaL.js +0 -4
- package/dist/assets/index-OuTt2geA.js +0 -1
- package/dist/assets/index-Y3X8f7Z4.js +0 -113
- package/dist/assets/index-dAVnNC1I.js +0 -7
- package/dist/assets/index-rX_gKff6.js +0 -1
- package/dist/assets/invitations-B-nYRbwb.js +0 -3
- package/dist/assets/invite-wTyupZG1.js +0 -1
- package/dist/assets/issue-passport-BrDZjXex.js +0 -1
- package/dist/assets/landing-page-CQU5LiHu.js +0 -1
- package/dist/assets/list-aRu0R0L1.js +0 -103
- package/dist/assets/localization-J2gA-h7I.js +0 -1
- package/dist/assets/logger-DVbuTPin.js +0 -1
- package/dist/assets/login-DFrvIKm0.js +0 -1
- package/dist/assets/passport-Di66zEMV.js +0 -1
- package/dist/assets/preferences-BPkyQMDe.js +0 -1
- package/dist/assets/profile-embed-DEkmxYPv.js +0 -1
- package/dist/assets/pt-BJowi6tZ.js +0 -5
- package/dist/assets/publish-resource-q3_KT0uW.js +0 -1
- package/dist/assets/ru-DTjDV3Pw.js +0 -5
- package/dist/assets/runtime-zSSdjk9Q.js +0 -1
- package/dist/assets/sdk-DlI_Utmi.js +0 -1
- package/dist/assets/session-Y3RU3I2O.js +0 -1
- package/dist/assets/status-BR0A9vPy.js +0 -1
- package/dist/assets/team-s6q3vfNx.js +0 -146
- package/dist/assets/th-A3GLGlJ1.js +0 -5
- package/dist/assets/traffic-CwvEJLQW.js +0 -1
- package/dist/assets/unsubscribe-BW7dIXXb.js +0 -1
- package/dist/assets/user-center-D18_bCCh.js +0 -126
- package/dist/assets/vendor-utils-CUDP56Ff.js +0 -213
- package/dist/assets/vendor-ux-B9VfuZTg.js +0 -1569
- package/dist/assets/vi-DGXwnYQW.js +0 -5
- package/dist/assets/wrap-locale-DcfUdcYR.js +0 -1
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{j as t,a6 as f,ak as r,at as j,W as n}from"./vendor-mui-core-DRxbhqaK.js";import{r as h}from"./vendor-react-Dvs43sk9.js";import{c as S,n as p}from"./vendor-ux-B9VfuZTg.js";import{a as C}from"./page-header-DvSb4Cmz.js";import{a9 as g}from"./index-Dt8akALo.js";import{o as b}from"./vendor-arcblock-DeeG8u0h.js";import{u as k}from"./config-space-D742OP6B.js";import{C as y,D as v,a as w}from"./connect-to-CzzpDiUC.js";import{S as c}from"./step-actions-D4zI4sWZ.js";import{S as E}from"./layout-BByAfem8.js";import"./vendor-utils-CUDP56Ff.js";import"./vendor-hooks-BlA8TRnZ.js";import"./lottie-web-4koyQiv_.js";import"./spaces-BwBxBfty.js";import"./api-rC33aBSs.js";import"./index-BOst2c_c.js";import"./index-DRYJ0xIl.js";import"./index-BojVbZw0.js";import"./index-Y8LQew4k.js";import"./index-DBs9Ljax.js";import"./use-mobile-D6YQgajG.js";import"./content-layout-B9tc9LCL.js";function T({onNext:a=()=>{},onPrevious:d=()=>{}}){const{t:e}=h.useContext(S),{blocklet:o}=g(),{spaceGateway:m,settingStorageEndpoint:l,updateSpaceGateway:u,hasStorageEndpoint:x,loading:i,storageEndpoint:s}=k();return i?t.jsx(b,{relative:"parent",children:t.jsx(f,{})}):t.jsxs(B,{children:[t.jsx("div",{className:"header",children:t.jsx(C,{title:e("setup.didSpace.title"),subTitle:e("setup.didSpace.subTitle"),onClickBack:d})}),t.jsxs(r,{className:"form-container",sx:{width:"100%",maxWidth:"720px"},children:[x?t.jsx(y,{spaceGateway:m,settingStorageEndpoint:l}):t.jsx(v,{}),o?.capabilities?.didSpace&&t.jsx(r,{sx:{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"24px"},children:t.jsx(w,{onConnect:u,storageEndpoint:s})})]}),o?.capabilities?.didSpace==="required"&&t.jsx(c,{mt:8,children:t.jsx(p,{loading:i,variant:"contained",disabled:i||!s,onClick:()=>a(),children:e("setup.continue")})}),o?.capabilities?.didSpace==="optional"&&t.jsx(c,{blocklet:o,onStartNow:()=>a("complete"),children:t.jsx(p,{className:"start-now",loading:i,variant:"contained",disabled:i,onClick:()=>a(),children:e(s?"setup.continue":"setup.skip")})})]})}T.propTypes={onNext:n.func,onPrevious:n.func};const B=j(E)`
|
|
2
|
-
height: 100%;
|
|
3
|
-
overflow-y: auto;
|
|
4
|
-
`;export{T as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as p}from"./vendor-react-Dvs43sk9.js";import{j as a,y as b,W as t,z as y,M as E,ak as I}from"./vendor-mui-core-DRxbhqaK.js";import{a as j}from"./vendor-hooks-BlA8TRnZ.js";import{_ as r}from"./index-Dt8akALo.js";import{T as A}from"./vendor-ux-B9VfuZTg.js";import{l as C}from"./arrow-down.svg-DgXRF8DP.js";import{L as O,D as H}from"./vendor-mui-x-Qp6zkx78.js";import{A as R}from"./AdapterDayjs-Bp0ir26R.js";function v({value:s=null,onChange:i,error:l=!1,helperText:c="",label:T="",timezone:e="",minDateTime:f=null}){const d=j(()=>{let n=r();return s&&(n=e?r(s).tz(e):r(s)),n},[s,e]),m=n=>{const h=e?r(n).tz(e):r(n);i(new Date(h.format("YYYY-MM-DD HH:mm:00")))};return a.jsx(O,{dateAdapter:R,children:a.jsx(b,{fullWidth:!0,error:l,children:a.jsx(H,{label:T,minDateTime:f,value:d,onChange:m,slotProps:{textField:{error:l,helperText:l?c:""}},format:"YYYY-MM-DD HH:mm"})})})}v.propTypes={value:t.oneOfType([t.string,t.instanceOf(Date)]),onChange:t.func.isRequired,error:t.bool,helperText:t.string,label:t.string,timezone:t.string,minDateTime:t.instanceOf(Date)};function U(s){return a.jsx(C,{...s,width:20,height:20})}const u={MINUTES_30:30*60*1e3,HOUR_1:60*60*1e3,HOURS_3:3*60*60*1e3,DAY_1:24*60*60*1e3,DAYS_7:7*24*60*60*1e3,DAYS_30:30*24*60*60*1e3};function $({placeholder:s="",value:i="",onChange:l,timezone:c="",showError:T=!0}){const{t:e}=A(),[f,d]=p.useState(i||""),[m,n]=p.useState(null),[h,Y]=p.useState(null),x=p.useMemo(()=>[{value:u.MINUTES_30,label:`30 ${e("common.minutes")}`},{value:u.HOUR_1,label:`1 ${e("common.hour")}`},{value:u.HOURS_3,label:`3 ${e("common.hours")}`},{value:u.DAY_1,label:`1 ${e("common.day")}`},{value:u.DAYS_7,label:`7 ${e("common.days")}`},{value:u.DAYS_30,label:`30 ${e("common.days")}`},{value:"custom",label:e("common.custom")}],[e]),_=o=>{if(d(o),o==="custom"){const D=c?r().tz(c):r(),S=D.add(1,"day").toDate();Y(D),n(S),l(S)}else l(new Date(Date.now()+o))},M=o=>{n(o),l(o)};p.useEffect(()=>{i&&(x.find(D=>r(D.value).isSame(i))||(d("custom"),n(i)))},[]);const g=j(()=>T?!!(!m||r(m).isBefore(r())):!1,[m,e]);return a.jsxs(a.Fragment,{children:[a.jsx(b,{fullWidth:!0,children:a.jsx(y,{select:!0,value:f,label:s||e("team.passport.passportExpireTime"),onChange:o=>_(o.target.value),variant:"outlined",slotProps:{select:{IconComponent:U}},sx:{"& .MuiInputLabel-root":{width:"calc(100% - 46px)"}},children:x.map(o=>a.jsx(E,{value:o.value,children:o.label},o.value))})}),f==="custom"&&a.jsx(I,{children:a.jsx(v,{value:m,onChange:M,label:e("team.passport.customExpireTime"),timezone:c,error:!!g,helperText:g?e("team.passport.customExpireTimeIsInvalid"):void 0,minDateTime:h})})]})}$.propTypes={value:t.oneOfType([t.string,t.instanceOf(Date)]),onChange:t.func.isRequired,timezone:t.string,placeholder:t.string,showError:t.bool};export{$ as T};
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import{g as Wt,r as v}from"./vendor-react-Dvs43sk9.js";import{j as e,ak as y,z as Q,b6 as me,bg as qe,y as V,am as ut,d2 as Bt,bn as qt,at as ae,b1 as mt,W as h,T as ee,U as Je,d3 as pt,b5 as Ke,a5 as Me,Q as Fe,d4 as Ge,aN as Ue,a6 as ft,D as ht,d5 as Kt,ad as xt,d6 as Mt,d7 as Ut,c2 as st,n as Ht,x as $t,bc as Vt,M as it,cw as Jt,I as Gt,d8 as Yt}from"./vendor-mui-core-DRxbhqaK.js";import{A as gt,J as Xt,C as Qt,e as le,F as Zt,a3 as je}from"./vendor-utils-CUDP56Ff.js";import{T as te,H as M,n as ce,c as en,p as bt,a3 as tn,au as nn,m as jt,$ as vt,j as yt,av as Ae,b as St,I as sn,a0 as an}from"./vendor-ux-B9VfuZTg.js";import{aD as rn,X as Ye,a9 as Ct,aW as wt,J as _e,c as _,_ as Z,o as on,aL as at}from"./index-Dt8akALo.js";import{g as ye,b as $,a as se}from"./vendor-hooks-BlA8TRnZ.js";import{u as Rt,C as Y}from"./index.esm-JPZAjt0x.js";import{i as He}from"./isURL-B2kErAOg.js";import{S as X}from"./section-ZPKr6_ii.js";import{A as ln,a as cn,b as dn}from"./collapse-DJGzUM1Q.js";import{S as Se}from"./shorten-label-DVy6K5I7.js";import{v as Tt}from"./index-Ba9-ArMT.js";import{R as Nt,A as un,S as mn,a as pn,B as fn}from"./list-aRu0R0L1.js";import{j as hn,c as xn,N as gn}from"./team-s6q3vfNx.js";import{W as bn}from"./did-address-DnFNwELW.js";import{p as It}from"./util-DDkRAi85.js";import{D as jn,g as vn}from"./traffic-CwvEJLQW.js";import{B as Et}from"./bundle-avatar-D5n6XSFF.js";import{u as yn}from"./use-mobile-BQQpAf3i.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-DeeG8u0h.js";import"./required-BT8zXV8U.js";import"./server-logo-notext.svg-CKQB0tIp.js";import"./index-BFBoLr1Z.js";import"./session-Y3RU3I2O.js";import"./use-app-logo-BjReZUm7.js";import"./base32-BK7MXAD4.js";import"./useAsyncRetry-EEjDgDMR.js";import"./useAsync-DVtDVEv6.js";import"./iframe-CKOcsJB-.js";import"./index-B6gW9Yjq.js";import"./index-DBs9Ljax.js";import"./base-chart-UFWO9a3P.js";import"./index-3ePiAFIp.js";import"./vendor-mui-x-Qp6zkx78.js";import"./AdapterDayjs-Bp0ir26R.js";var Te={exports:{}},Ne={exports:{}},Ie={exports:{}},rt;function Sn(){return rt||(rt=1,function(n,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=t;function t(r){return r==null}n.exports=s.default,n.exports.default=s.default}(Ie,Ie.exports)),Ie.exports}var ot;function Cn(){return ot||(ot=1,function(n,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=u;var t=o(rn()),r=o(Sn());function o(p){return p&&p.__esModule?p:{default:p}}var l=/^(?:[-+]?(?:0|[1-9][0-9]*))$/,b=/^[-+]?[0-9]+$/;function u(p,i){(0,t.default)(p),i=i||{};var N=i.allow_leading_zeroes===!1?l:b,I=!i.hasOwnProperty("min")||(0,r.default)(i.min)||p>=i.min,S=!i.hasOwnProperty("max")||(0,r.default)(i.max)||p<=i.max,j=!i.hasOwnProperty("lt")||(0,r.default)(i.lt)||p<i.lt,E=!i.hasOwnProperty("gt")||(0,r.default)(i.gt)||p>i.gt;return N.test(p)&&I&&S&&j&&E}n.exports=s.default,n.exports.default=s.default}(Ne,Ne.exports)),Ne.exports}var lt;function wn(){return lt||(lt=1,function(n,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=o;var t=r(Cn());function r(l){return l&&l.__esModule?l:{default:l}}function o(l){return(0,t.default)(l,{allow_leading_zeroes:!1,min:0,max:65535})}n.exports=s.default,n.exports.default=s.default}(Te,Te.exports)),Te.exports}var Rn=wn();const Tn=Wt(Rn),ze={enabled:!1,secure:!1,from:"",host:"",port:"",user:"",password:"",companyName:"",companyLink:"",companyAddress:"",supportEmail:""};function Nn(){const{api:n}=Ye(),{blocklet:s}=Ct(),{t}=te(),{confirmApi:r,confirmHolder:o}=wt(),l=s?.meta?.did,b=Object.assign({...ze},s?.settings?.notification?.email||{}),{handleSubmit:u,control:p,formState:i,watch:N,reset:I}=Rt({defaultValues:gt(b,Object.keys(ze))}),S=ye({testReceiver:"",testReceiverError:""}),j=N("enabled"),E=$(async(a,T,O=!0)=>{try{const{blocklet:D}=await n.configNotification({input:{did:l,notification:JSON.stringify({email:a})}}),re=Object.assign({...ze},D?.settings?.notification?.email||{});I(re),O&&M.success(t("oauth.saveSuccess"))}catch(D){if(O)M.error(D.message||t("oauth.saveFailed"));else throw D}}),J=$(async(a,T,O)=>{try{i.isDirty&&await E(a,T,!1),await n.sendEmail({input:{did:l,receiver:O,email:JSON.stringify({body:"Your SMTP configuration is correct!",title:"Test email",type:"notification",attachments:[{type:"link",data:{url:"https://community.arcblock.io",title:"Community",image:"https://community.arcblock.io/.well-known/service/blocklet/logo-rect-dark",utm:{campaign:"test-campaign"}}}],utm:{content:"test-email-button"}})}}),M.success(t("notification.email.testSuccess"))}catch(D){M.error(D.message||t("notification.email.testfailed"))}}),z=$((a,T)=>{S.testReceiver=localStorage.getItem("test-receiver")||"",S.testReceiverError="",r.open({title:t("notification.email.testSendEmail"),content:()=>e.jsx(y,{sx:{width:"300px"},children:e.jsx(Q,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:t("notification.email.inputTestReceiver"),value:S.testReceiver,onChange:O=>{S.testReceiver=O.target.value},error:!!S.testReceiverError,helperText:S.testReceiverError||" "})}),confirmButtonText:t("common.confirm"),cancelButtonText:t("common.cancel"),async onConfirm(O){const D=S.testReceiver?.trim();if(!D){S.testReceiverError=t("notification.email.receiverRequired");return}if(!_e(D)){S.testReceiverError=t("notification.email.receiverInvalid");return}S.testReceiverError="",await J(a,T,D),O()}})}),F=$(a=>{const T=a?.trim();return T?_e(T)?!0:t("notification.email.fromInvalid"):t("notification.email.fromRequired")}),B=$(a=>{const T=a?.trim();return T?He(T,{require_host:!1,protocols:[]})?!0:t("notification.email.hostInvalid"):t("notification.email.hostRequired")}),w=$(a=>a?Tn(a)?!0:t("notification.email.portInvalid"):t("notification.email.portRequired")),q=$(a=>a?.trim()?!0:t("notification.email.userRequired")),K=$(a=>a?.trim()?!0:t("notification.email.passwordRequired")),f=$(a=>a?.trim()&&!He(a,{protocols:["http","https"],require_protocol:!0})?t("notification.email.linkInvalid"):!0),R=$(a=>a?.trim()&&!_e(a)?t("notification.email.emailInvalid"):!0),C=$(()=>!0);return e.jsxs(y,{children:[e.jsxs(In,{component:"form",onSubmit:u(E),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(X,{title:t("notification.email.enable"),my:2.5,children:e.jsx(Y,{name:"enabled",control:p,render:({field:a})=>e.jsx(me,{control:e.jsx(qe,{checked:a.value,...a})})})}),e.jsx(X,{title:t("notification.email.from"),children:e.jsx(Y,{name:"from",control:p,rules:{validate:j?F:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Q,{...a,size:"small",required:!0,label:t("notification.email.from"),error:!!i.errors[a.name],helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.host"),children:e.jsx(Y,{name:"host",control:p,rules:{validate:j?B:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Q,{...a,size:"small",required:!0,error:!!i.errors[a.name],label:t("notification.email.host"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.port"),children:e.jsx(Y,{name:"port",control:p,rules:{validate:j?w:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Q,{...a,size:"small",required:!0,type:"number",error:!!i.errors[a.name],label:t("notification.email.port"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.user"),children:e.jsx(Y,{name:"user",control:p,rules:{validate:j?q:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Q,{...a,size:"small",required:!0,error:!!i.errors[a.name],label:t("notification.email.user"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.password"),children:e.jsx(Y,{name:"password",control:p,rules:{validate:j?K:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Q,{...a,size:"small",required:!0,type:"password",error:!!i.errors[a.name],label:t("notification.email.password"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.secure"),children:e.jsx(Y,{name:"secure",control:p,rules:{validate:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(me,{control:e.jsx(qe,{checked:a.value,...a,disabled:!j})})})})}),e.jsxs(ln,{children:[e.jsxs(cn,{expandIcon:e.jsx(qt,{fontSize:"small"}),"aria-controls":"panel1-content",id:"panel1-header",children:[t("notification.email.signature"),e.jsx(ut,{title:t("notification.email.signatureTooltip"),children:e.jsx(Bt,{fontSize:"small",sx:{ml:1,cursor:"help"}})})]}),e.jsxs(dn,{children:[e.jsx(X,{title:t("notification.email.companyName"),children:e.jsx(Y,{name:"companyName",control:p,rules:{validate:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Q,{...a,size:"small",error:!!i.errors[a.name],label:t("notification.email.companyName"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.companyLink"),children:e.jsx(Y,{name:"companyLink",control:p,rules:{validate:j?f:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Q,{...a,size:"small",error:!!i.errors[a.name],label:t("notification.email.companyLink"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.companyAddress"),children:e.jsx(Y,{name:"companyAddress",control:p,rules:{validate:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Q,{...a,size:"small",error:!!i.errors[a.name],label:t("notification.email.companyAddress"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.supportEmail"),children:e.jsx(Y,{name:"supportEmail",control:p,rules:{validate:j?R:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Q,{...a,size:"small",type:"email",error:!!i.errors[a.name],label:t("notification.email.supportEmail"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})})]})]}),e.jsxs(y,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(ce,{variant:"outlined",color:"warning",onClick:u(z),disabled:!j,children:t("oauth.runTest")}),e.jsx(ce,{type:"submit",variant:"contained",disabled:!i.isDirty,children:t("oauth.save")})]})]}),o]})}const In=ae(mt)``,We={enabled:!1,endpoint:"",did:void 0,pushPath:void 0};function En(){const{api:n}=Ye(),{blocklet:s}=Ct(),{t}=te(),{confirmApi:r,confirmHolder:o}=wt(),l=s?.meta?.did,b=Object.assign({...We},s?.settings?.notification?.pushKit||{}),{handleSubmit:u,control:p,formState:i,watch:N,reset:I}=Rt({defaultValues:gt(b,Object.keys(We))}),S=ye({testReceiver:"",testReceiverError:""}),j=N("enabled"),E=$(async(w,q,K=!0)=>{try{const{blocklet:f}=await n.configNotification({input:{did:l,notification:JSON.stringify({pushKit:w})}}),R=Object.assign({...We},f?.settings?.notification?.pushKit||{});I(R),K&&M.success(t("oauth.saveSuccess"))}catch(f){if(K)M.error(f.message||t("oauth.saveFailed"));else throw f}}),J=$(async(w,q)=>{try{i.isDirty&&await E(w,q,!1);const K=(s?.configs||[]).find(C=>C.key==="BLOCKLET_APP_URL")?.value,f=Xt(Qt(K,_.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo"),{v:s?.meta?.version,t:new Date(s?.updatedAt||0).getTime()}),R={type:"passthrough",passthroughType:"messageStatus",data:{message:{title:"Test push-kit notification",body:"This is message from push-kit config test",sender:{did:s?.appDid,fullName:s?.meta?.title,avatar:f}}}};await n.sendPush({input:{did:l,receiver:S.testReceiver,notification:JSON.stringify(R)}}),M.success(t("notification.pushKit.testSuccess"))}catch(K){M.error(K.message||t("notification.pushKit.testfailed"))}}),z=$((w,q)=>{S.testReceiverError="",r.open({title:t("notification.pushKit.testSend"),content:()=>e.jsx(y,{sx:{width:"450px",maxWidth:"100%"},children:e.jsx(Q,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:t("notification.pushKit.inputTestReceiver"),value:S.testReceiver,onChange:K=>{S.testReceiver=K.target.value},error:!!S.testReceiverError,helperText:S.testReceiverError||" "})}),confirmButtonText:t("common.confirm"),cancelButtonText:t("common.cancel"),async onConfirm(K){if(!S.testReceiver?.trim()){S.testReceiverError=t("notification.pushKit.receiverRequired");return}S.testReceiverError="",await J(w,q),K()}})}),F=$(w=>{const q=w?.trim();return q?He(q)?!0:t("notification.pushKit.endpointInvalid"):t("notification.pushKit.endpointRequired")}),B=$(()=>!0);return e.jsxs(y,{children:[e.jsxs(kn,{component:"form",onSubmit:u(E),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(X,{title:t("notification.pushKit.enable"),my:2.5,children:e.jsx(Y,{name:"enabled",control:p,render:({field:w})=>e.jsx(me,{control:e.jsx(qe,{checked:w.value,...w})})})}),e.jsx(X,{title:t("notification.pushKit.endpoint"),children:e.jsx(Y,{name:"endpoint",control:p,rules:{validate:j?F:B},render:({field:w})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Q,{...w,size:"small",required:!0,label:t("notification.pushKit.endpoint"),error:!!i.errors[w.name],helperText:i.errors[w.name]?.message||" ",disabled:!j})})})}),e.jsxs(X,{title:t("notification.pushKit.customOptions"),children:[e.jsx(Y,{name:"did",control:p,render:({field:w})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Q,{...w,size:"small",label:t("notification.pushKit.did"),error:!!i.errors[w.name],helperText:i.errors[w.name]?.message||" ",disabled:!j})})}),e.jsx(Y,{name:"pushPath",control:p,render:({field:w})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Q,{...w,size:"small",label:t("notification.pushKit.pushPath"),error:!!i.errors[w.name],helperText:i.errors[w.name]?.message||" ",disabled:!j})})})]}),e.jsxs(y,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(ce,{variant:"outlined",color:"warning",onClick:u(z),disabled:!j,children:t("oauth.runTest")}),e.jsx(ce,{type:"submit",variant:"contained",disabled:!i.isDirty,children:t("oauth.save")})]})]}),o]})}const kn=ae(mt)``,ct=[{label:e.jsx(y,{sx:{textAlign:"center",width:"100%"},children:"Email"}),value:"email"},{label:e.jsx(y,{sx:{textAlign:"center",width:"100%"},children:"Push Kit"}),value:"pushKit"}];function An(){const[n,s]=v.useState(ct[0].value),{locale:t}=v.useContext(en),r=se(()=>({email:e.jsx(Nn,{}),pushKit:e.jsx(En,{})}),[t]),o=v.useMemo(()=>({padding:"10px 0"}),[]);return e.jsxs(y,{children:[e.jsx(bt,{tabs:ct,current:n,onChange:s}),e.jsx(y,{style:o,children:r[n]})]})}const kt=v.createContext({}),{Provider:On,Consumer:Ws}=kt;function Dn({children:n,blocklet:s=""}){const{api:t,inService:r,ws:{useSubscription:o}}=Ye(),[l,b]=v.useState([]),[u,p]=v.useState({total:0,pageSize:20,pageCount:0,page:1}),i=se(()=>s.meta?.did,[s]),[N,I]=v.useState([]),[S,j]=v.useState({}),E=se(()=>l.length?new Set(l.map(f=>f.id)):new Set,[l]),J=async({page:f=1,pageSize:R=20,...C}={})=>{if(!i)return[];try{const a={paging:{page:f,pageSize:R},...C,teamDid:i,dateRange:C.dateRange?[Z(C.dateRange[0]).toISOString(),Z(C.dateRange[1]).toISOString()]:void 0},{dids:T,...O}=a;let D="";T&&T.includes("system")&&(D="system");const re=T?T.filter(pe=>pe!=="system"):[],ue={...O,source:D,componentDids:re},oe=await t.getNotificationSendLog({input:ue});return j(ue),b(oe.list),p(oe.paging),oe.list}catch(a){return M.error(a.message),[]}},z=async()=>{const f=await t.getNotificationComponents({input:{teamDid:i}});I(f.componentDids)},F=v.useCallback(f=>{const R=s.children.find(C=>C.meta?.did===f);if(R)return R.ancestors=[s],R},[s]),B=async({notificationId:f,receivers:R,channels:C,...a})=>{await t.resendNotification({input:{teamDid:i,notificationId:f,receivers:R,channels:C.map(T=>T==="wallet"?_.NOTIFICATION_SEND_CHANNEL.WALLET:T==="pushKit"?_.NOTIFICATION_SEND_CHANNEL.PUSH:T),...a}})},w=v.useCallback(async f=>(await t.getUser({input:{teamDid:i,user:{did:f},options:{enableConnectedAccount:!0}}})).user,[t,i]),q=v.useCallback(async({page:f=1,pageSize:R=20,...C}={})=>{try{const a={paging:{page:f,pageSize:R},...C,userName:C.searchText||"",teamDid:i,dateRange:C.dateRange?[Z(C.dateRange[0]).toISOString(),Z(C.dateRange[1]).toISOString()]:void 0};return await t.getReceivers({input:a})}catch(a){throw M.error(a.message),a}},[t,i]);v.useEffect(()=>{i&&z()},[i]),o(_.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,f=>{E.has(f.notificationId)&&J(S)},[E,S]),o(_.EVENTS.NOTIFICATION_BLOCKLET_CREATE,f=>{E.has(f.id)||J(S)},[E,S]);const K={fetch:J,data:l,paging:u,blocklet:s,getComponent:F,resendNotification:B,getUser:w,componentDids:N,getReceivers:q,inService:r,teamDid:i};return e.jsx(On,{value:{notificationRecords:K},children:n})}function Xe(){const{notificationRecords:n}=v.useContext(kt);return n}Ce.propTypes={severity:h.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Ln={info:"primary",success:"success",error:"error",warning:"warning"};function Ce({severity:n="info"}){return e.jsx(tn,{type:Ln[n],children:n})}const Pn=(n,s,t="")=>{if(!t||!s)return"";switch(t){case _.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return n("notification.sendStatus.reason.disabled",{channel:s});case _.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return n("notification.sendStatus.reason.unavailable",{channel:s});case _.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return n("notification.sendStatus.reason.notSent",{channel:s});case _.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return n("notification.sendStatus.reason.offline");default:return t}};function At(n,s,t={}){const{status:r,updatedAt:o,reason:l="",channel:b="wallet"}=t,u=o?n("notification.sendStatus.sentTime",{date:on(o,s)}):"",p=Pn(n,b,l);return r===_.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:n("notification.sendStatus.failed"),sentTime:u,reason:p}:r===_.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:n("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:n("notification.sendStatus.pending"),reason:p,sentTime:u}}const $e={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Ve=["wallet","pushKit","email"],dt=["info","success","error","warning"],Ot=n=>{const{settings:s}=n;return s?.notification?.email?.enabled},Dt=n=>{const{settings:s}=n;return s?.notification?.pushKit?.enabled},Fn=(n,s)=>{const t=le(s,"extra.notifications.email",!0);return{available:Ot(n),enabled:t}},_n=(n,s)=>{const t=le(s,"extra.notifications.push",!0);return{available:Dt(n),enabled:t}},zn=n=>({enabled:le(n,"extra.notifications.wallet",!0)}),Wn=n=>({enabled:le(n,"extra.webhooks",[]).length>0}),Ee=(n=3)=>new Promise(s=>{setTimeout(()=>{s()},n*1e3)}),Bn=(n,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:n("notification.sendStatus.reason.enabled",{channel:s}),fail:n("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:n("notification.sendStatus.reason.available",{channel:s}),fail:n("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:n("notification.sendStatus.reason.enabled",{channel:s}),fail:n("notification.sendStatus.reason.disabled",{channel:s})}]:[],ke=(n=[])=>{const s=Z().startOf("day");return n.filter(t=>Z(t.sendAt).isSame(s,"day")).length},qn=(n,s="")=>{if(s&&Ve.includes(s)){const l=`${s}SendRecord`,b=le(n,l,[]);return ke(b)}const t=le(n,"webhook",{}),r=Object.keys(t??{})??[];if(s&&r.includes(s)){const l=t[s]??[];return ke(l)}const o={};return Ve.forEach(l=>{const b=`${l}SendRecord`,u=le(n,b,[]),p=ke(u);o[l]=p}),r.length>0&&r.forEach(l=>{const b=t[l]??[],u=ke(b);o[l]=u}),o},Oe=(n,s,t)=>{if(!Array.isArray(n))throw new Error("Invalid filterList or index");return n[t].splice(s,1),n},De=(n,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(n):!1},Kn=n=>{switch(n){case _.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case _.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case _.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case _.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},Lt=()=>({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 de({config:n,enableTooltip:s=!0,showTitle:t=!1,children:r=null}){const{status:o,title:l="",sentTime:b="",reason:u=""}=n,p=[l,u].filter(Boolean).join(", ");return e.jsx(ut,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(ee,{color:"inherit",sx:{fontSize:12},children:p}),e.jsx("span",{children:b})]}):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:$e[o]}}),e.jsx(y,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:$e[o]}})]}),e.jsx(ee,{color:"inherit",sx:{fontSize:12},children:t?l:r})]})})}de.propTypes={config:h.object.isRequired,enableTooltip:h.bool,showTitle:h.bool,children:h.node};Le.propTypes={list:h.array.isRequired,label:h.string.isRequired,onDelete:h.func};function Le({list:n,label:s,onDelete:t=()=>{}}){const{t:r,locale:o}=te();return e.jsxs(y,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(ee,{children:[s,": "]}),n.map(l=>{const b=At(r,o,{status:l});return e.jsx(Je,{size:"small",label:e.jsx(y,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(de,{config:b,enableTooltip:!1,children:b.title})}),onDelete:u=>t(u,l)},l)})]})}Qe.propTypes={filterList:h.array.isRequired,onChange:h.func.isRequired,index:h.number.isRequired,column:h.object.isRequired,filterValues:h.array.isRequired,label:h.string.isRequired,renderLabel:h.func.isRequired};function Qe({filterList:n,onChange:s,index:t,column:r,filterValues:o,label:l,renderLabel:b}){return e.jsxs(V,{className:"filter-container",children:[e.jsx(pt,{component:"legend",children:l}),e.jsx(Ke,{row:!0,children:o.map(u=>e.jsx(me,{control:e.jsx(Me,{checked:n[t].indexOf(u.value??u)>-1,onChange:p=>{const i=[...n];p.target.checked?i[t]=[...i[t],u.value??u]:i[t]=i[t].filter(N=>N!==(u.value??u)),s(i[t],t,r)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:b(u)})},u.value??u))})]})}function Be(n){return e.jsx(Qe,{...n,renderLabel:s=>e.jsx(de,{enableTooltip:!1,config:{status:s.status},children:s.label})})}xe.propTypes={status:h.number.isRequired,updatedAt:h.string.isRequired,reason:h.string,channel:h.string,onResend:h.func};function xe({status:n,updatedAt:s,reason:t="",channel:r="wallet",onResend:o}){const{t:l,locale:b}=te(),u=At(l,b,{status:n,updatedAt:s,reason:t,channel:r});return e.jsxs(y,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(de,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(Fe,{className:"resend-btn",size:"small",startIcon:e.jsx(Ge,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:o,children:l("notification.resend")})]})}Ze.propTypes={value:h.array.isRequired,onChange:h.func};function Ze({value:n,onChange:s}){const{locale:t}=te(),r=Z().toDate(),[o,l]=v.useState(null),b=v.useCallback(i=>{l(o?null:i.currentTarget)},[o]),u=!!o,p=v.useCallback(i=>{if(!i.startDate||!i.endDate){M.error("Please select a date range");return}if(Z(i.startDate).isAfter(i.endDate)||!Z(i.startDate).isValid()||!Z(i.endDate).isValid()){M.error("Invalid date range");return}s([i.startDate,i.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx(ee,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(Fe,{onClick:b,variant:"outlined",size:"small",color:"inherit",children:[at(n[0],t)," - ",at(n[1],t)]})}),e.jsx(Ue,{open:u,anchorEl:o,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(jn,{open:!0,maxDate:r,initialDateRange:{startDate:n[0],endDate:n[1]},toggle:b,definedRanges:vn(r),onChange:p})})]})}et.propTypes={itemComponent:h.elementType.isRequired};function et({itemComponent:n,...s}){const{t}=te();return!s?.filterList?.filter(o=>o.length).length?null:e.jsxs(y,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsx("div",{className:"toolbar-filter-title",children:t("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(nn.TableFilterList,{...s,ItemComponent:n})})]})}function tt({label:n,onDelete:s,canDelete:t=()=>!0,...r}){const o=s&&typeof s=="function"?s:void 0;let l=!0;return t&&typeof t=="function"&&(l=t({label:n,...r})),e.jsx(Je,{label:n,variant:"outlined",...o&&l?{onDelete:o}:{}})}tt.propTypes={label:h.string.isRequired,onDelete:h.func,canDelete:h.func};const Mn=[{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:h.bool,onCancel:h.func,onConfirm:h.func};function Pt({loading:n=!1,onCancel:s=()=>{},onConfirm:t=()=>{}}){const{t:r}=te(),[o,l]=v.useState(Mn),[b,u]=v.useState(!0),p=(N,I)=>{I.checked=N.target.checked;const S=o.map(j=>({...j,checked:j.value===I.value?I.checked:j.checked}));l(S)},i=N=>{N.stopPropagation(),t({channels:o.filter(I=>I.checked).map(I=>I.value),isResendFailedOnly:b})};return e.jsxs(y,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(ee,{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(V,{component:"fieldset",variant:"standard",children:[e.jsx(pt,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Ke,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:o.map(N=>e.jsx(me,{control:e.jsx(Me,{checked:N.checked,onChange:I=>p(I,N),name:N.value}),label:N.label},N.value))})]})}),e.jsx(y,{className:"resend-config-footer",children:e.jsx(Ke,{children:e.jsx(me,{control:e.jsx(Me,{checked:b,onChange:N=>u(N.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(Fe,{onClick:N=>{N.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Fe,{onClick:i,color:"primary",disabled:n,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[n&&e.jsx(ft,{size:16}),r("common.confirm")]})]})]})}Ft.propTypes={notificationId:h.string.isRequired,handleResend:h.func,resending:h.bool};function Ft({notificationId:n,handleResend:s,resending:t=!1}){const{t:r,locale:o}=te(),l=ht(),b=v.useMemo(()=>jt(l,Lt()),[l]),{getReceivers:u,inService:p,teamDid:i,getUser:N,blocklet:I}=Xe(),[S,j]=v.useState(!1),[E,J]=v.useState([]),z=ye({anchorEl:null,position:null}),F=ye({anchorEl:null,position:null}),[B,w]=v.useState(null),[q,K]=v.useState({total:0,pageSize:10,pageCount:0,page:1}),[f,R]=v.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[Z().subtract(1,"month").startOf("day").toDate(),Z().endOf("day").toDate()]}),[C,a]=v.useState([]),T=[{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"}],O=async()=>{if(!S&&n)try{j(!0);const c=await u({notificationId:n,...f}),d=c.list.map(m=>({...m,receiverUser:{...m.receiverUser,avatar:It(m.receiverUser.avatar,i,p)}}));J(d),K(c.paging),j(!1)}catch(c){M.error(c.message),j(!1)}};v.useEffect(()=>{O()},[f]);const D=c=>{c.stopPropagation();const d=c.currentTarget;F.anchorEl=d;const m=d.getBoundingClientRect();F.position={top:m.top+window.scrollY,left:m.left+window.scrollX}},re=c=>c.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(ce,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(Ge,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:D,children:r("notification.resend")})}):null,ue={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:q.page-1,rowsPerPage:q.pageSize,count:q.total,searchText:f.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:C,onRowSelectionChange:(c,d)=>{a(d.map(m=>m.dataIndex))},customToolbarSelect:re},oe=({page:c,rowsPerPage:d,searchText:m,filterList:A})=>{const[,U=[],ne=[],G=[]]=A;f.pageSize!==d?R(H=>({...H,pageSize:d,page:1})):f.page!==c+1?R(H=>({...H,page:c+1})):f.searchText!==m?R(H=>({...H,searchText:m,page:1})):je(U,f.walletSendStatus)?je(ne,f.pushKitSendStatus)?je(G,f.emailSendStatus)||R(H=>({...H,emailSendStatus:G,page:1})):R(H=>({...H,pushKitSendStatus:ne,page:1})):R(H=>({...H,walletSendStatus:U,page:1}))},pe=v.useCallback(async(c,d)=>{if(!d)return!1;const m=await N(d);return m?c==="wallet"?zn(m):c==="email"?Fn(I,m):c==="pushKit"?_n(I,m):c==="webhook"?Wn(m):!0:!1},[N,I]),we=v.useCallback(c=>Bn(r,c),[r]),fe=()=>{z.anchorEl=null,z.position=null,w(null)},he=()=>{F.anchorEl=null,F.position=null},g=async(c,d,m=!0,A="")=>{if(!(!d.length||!c.length))try{s(c,d,m,A),F.anchorEl||(await Ee(.5),fe())}catch(U){console.error("handleResend error",{error:U})}},x=async({channels:c,isResendFailedOnly:d})=>{const m=C.map(A=>E[A].receiver);await g(c,m,d),await Ee(.5),he(),a([])},k=async(c,d=[],m=!0)=>{try{await g(["webhook"],[c.receiver],m,d)}catch(A){M.error(A.response?A.response.statusText:A.message)}},L=async(c,d,m,A=[],U=!0)=>{if(c.stopPropagation(),qn(d,m)>=4){M.warning(r("notification.resendLimit"));return}if(!Ve.includes(m)){await k(d,A,U);return}if(c){const G=c.currentTarget,H=G.getBoundingClientRect();z.anchorEl=G,z.position={top:H.top+window.scrollY,left:H.left+window.scrollX}}w({channel:m});try{const G=await pe(m,d.receiver);await Ee(1),w({channel:m,result:G}),(typeof G=="boolean"&&G||Zt(G)&&Object.values(G).every(H=>!!H))&&(await s([m],[d.receiver],U),F.anchorEl||(await Ee(.5),fe()))}catch(G){M.error(G.message)}},W=c=>{R(d=>({...d,dateRange:c,page:1}))},P=(c,d,m,A)=>{c.stopPropagation();const U=m.filter(ne=>ne!==d);R(ne=>({...ne,[A]:U,page:1}))},ie=se(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:c=>{const{receiverUser:d,receiver:m}=E[c];return d?e.jsxs(y,{"data-cy":`member-name-${d.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(vt,{src:`${d.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:m,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(Se,{children:d.fullName})]},m):e.jsx(bn,{size:14,responsive:!1,compact:!0,copyable:!1,did:m})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:f.walletSendStatus??[],customFilterListOptions:{render:c=>e.jsx(Le,{list:c,label:"Wallet",onDelete:(d,m)=>{d.stopPropagation(),P(d,m,ie[1].options.filterList,"walletSendStatus")}}),update:Oe},filterOptions:{names:T,fullWidth:!0,logic:De,display:(c,d,m,A)=>e.jsx(Be,{label:"Wallet",filterList:c,onChange:d,index:m,column:A,filterValues:T})},customBodyRenderLite:c=>{const{walletSendStatus:d,walletSendAt:m,walletSendFailedReason:A}=E[c];return e.jsx(xe,{status:d,updatedAt:m,reason:A,channel:"wallet",onResend:U=>L(U,E[c],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:c=>{const{pushKitSendStatus:d,pushKitSendAt:m,pushKitSendFailedReason:A}=E[c];return e.jsx(xe,{status:d,updatedAt:m,reason:A,channel:"pushkit",onResend:U=>L(U,E[c],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:f.pushKitSendStatus??[],customFilterListOptions:{render:c=>e.jsx(Le,{list:c,label:"Push Kit",onDelete:(d,m)=>{d.stopPropagation(),P(d,m,ie[2].options.filterList,"pushKitSendStatus")}}),update:Oe},filterOptions:{names:T,fullWidth:!0,logic:De,display:(c,d,m,A)=>e.jsx(Be,{label:"Push Kit",filterList:c,onChange:d,index:m,column:A,filterValues:T})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:c=>{const{emailSendStatus:d,emailSendAt:m,emailSendFailedReason:A}=E[c];return e.jsx(xe,{status:d,updatedAt:m,reason:A,channel:"email",onResend:U=>L(U,E[c],"email",[],!1)})},filter:!0,filterType:"custom",filterList:f.emailSendStatus??[],customFilterListOptions:{render:c=>e.jsx(Le,{list:c,label:"Email",onDelete:(d,m)=>{d.stopPropagation(),P(d,m,ie[3].options.filterList,"emailSendStatus")}}),update:Oe},filterOptions:{names:T,fullWidth:!0,logic:De,display:(c,d,m,A)=>e.jsx(Be,{label:"Email",filterList:c,onChange:d,index:m,column:A,filterValues:T})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:c=>{const{webhook:d}=E[c];if(!d)return null;const m=Object.entries(d)[0];if(!m)return null;const[A,U]=m,ne=U[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(Se,{maxLength:30,children:A},A),e.jsx(xe,{status:ne.status,updatedAt:ne.sendAt,reason:ne.failedReason,channel:"webhook",onResend:G=>L(G,E[c],"webhook",[A],!1)})]},A)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:c=>{const{createdAt:d}=E[c];return e.jsx(Nt,{value:d,locale:o,shouldUpdate:!0})}}}],[E,o,f,r]),Re=[e.jsx(Ze,{value:f.dateRange,onChange:W},"date-picker"),e.jsx(ce,{variant:"contained",size:"small",color:"primary",loading:S,startIcon:e.jsx(Kt,{}),onClick:()=>O(),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(Hn,{children:e.jsxs(xt,{theme:b,children:[e.jsx(yt,{className:"receivers-table",locale:o,loading:S,columns:ie,data:E,onChange:oe,options:ue,customButtons:Re,components:{TableFilterList:c=>e.jsx(et,{...c,itemComponent:d=>e.jsx(tt,{...d,canDelete:()=>!1})})}}),z.anchorEl&&e.jsx(Ue,{open:!!z.anchorEl,anchorReference:"anchorPosition",anchorPosition:z.position,onClose:fe,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs($n,{children:[e.jsxs(ee,{variant:"body1",component:"div",className:"check-title",children:[B?.channel," Checking"]}),e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:we(B?.channel).map(c=>{const{type:d,pass:m,fail:A}=c;return!B?.result||B?.result?.[d]?e.jsxs(ee,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:B?.result?.[d]?Ae.success.main:"inherit"},children:[B?.result?e.jsx(Mt,{}):e.jsx(ft,{size:12,sx:{color:Ae.primary.main}}),e.jsx("span",{children:m})]},d):e.jsxs(ee,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:Ae.error.main},children:[e.jsx(Ut,{}),e.jsx("span",{children:A})]},d)})})]})}),F.anchorEl&&e.jsx(Ue,{open:!!F.anchorEl,anchorReference:"anchorPosition",anchorPosition:F.position,onClose:he,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(Pt,{loading:t,onCancel:he,onConfirm:x})})]})})})}const Un=v.memo(Ft),Hn=ae.div`
|
|
2
|
-
td.MuiTableCell-footer {
|
|
3
|
-
border: none !important;
|
|
4
|
-
}
|
|
5
|
-
.sent-status-cell {
|
|
6
|
-
.resend-btn {
|
|
7
|
-
display: none;
|
|
8
|
-
}
|
|
9
|
-
&:hover {
|
|
10
|
-
.resend-btn {
|
|
11
|
-
display: flex;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
`,$n=ae.div`
|
|
16
|
-
padding: 8px 16px;
|
|
17
|
-
.check-title {
|
|
18
|
-
font-weight: 500;
|
|
19
|
-
margin-bottom: 8px;
|
|
20
|
-
&::first-letter {
|
|
21
|
-
text-transform: uppercase;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
.check-item {
|
|
25
|
-
svg {
|
|
26
|
-
font-size: 16px;
|
|
27
|
-
}
|
|
28
|
-
font-size: 12px;
|
|
29
|
-
}
|
|
30
|
-
`,ve=n=>n>=1e6?`${(n/1e6).toFixed(1)}M`:n>=1e3?`${(n/1e3).toFixed(1)}K`:n;function Vn(n){const{wallet:s,push:t,email:r,webhook:o}=n;return[{name:"Wallet",value:e.jsx(ge,{item:s})},{name:"Push",value:e.jsx(ge,{item:t})},{name:"Email",value:e.jsx(ge,{item:r})},...o.total>0?[{name:"Webhook",value:e.jsx(ge,{item:o,isWebhook:!0})}]:[]]}function Jn(n,s,t){const{wallet:r,push:o,email:l,webhook:b}=n;return[{name:"Wallet",value:e.jsx(be,{loading:t,channel:_.NOTIFICATION_SEND_CHANNEL.WALLET,item:r,onResend:s})},{name:"Push",value:e.jsx(be,{loading:t,channel:_.NOTIFICATION_SEND_CHANNEL.PUSH,item:o,onResend:s})},{name:"Email",value:e.jsx(be,{loading:t,channel:_.NOTIFICATION_SEND_CHANNEL.EMAIL,item:l,onResend:s})},...b.total>0?[{name:"Webhook",value:e.jsx(be,{loading:t,channel:_.NOTIFICATION_SEND_CHANNEL.WEBHOOK,item:b,isWebhook:!0,onResend:s})}]:[]]}nt.propTypes={statistics:h.object.isRequired,onResend:h.func,mode:h.oneOf(["simple","detail"]),resending:h.bool};ge.propTypes={item:h.object.isRequired,isWebhook:h.bool};function ge({item:n,isWebhook:s=!1}){const{t}=te(),r=s?n.success.length:n.success,o=n.total,l=r===o?"success":"failed";return e.jsx(y,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:2},children:e.jsx(y,{sx:{display:"flex",alignItems:"center",gap:1},children:e.jsxs(de,{config:{status:l},enableTooltip:!1,children:[ve(r)," / ",ve(o)," ",t("notification.sendStatus.success")]})})})}be.propTypes={item:h.object.isRequired,isWebhook:h.bool,channel:h.string,onResend:h.func,loading:h.bool};function be({channel:n=_.NOTIFICATION_SEND_CHANNEL.WALLET,item:s,isWebhook:t=!1,onResend:r=()=>{},loading:o=!1}){const{t:l}=te(),{success:b,failed:u,pending:p}=s,i=Kn(n),N=t?b.length:b,I=t?u.length:u,S=t?p.length:p,j=async F=>{F.stopPropagation();const B=t?[...new Set([...b,...u].map(w=>w))]:[];await r([n],[],!0,B)},E=N+I,J=E>0?N/E*100:0,z=E>0?I/E*100:0;return e.jsxs(Gn,{successRatio:J,failedRatio:z,children:[e.jsxs(ee,{variant:"h6",children:[i," (",s.total,")"]}),e.jsxs(ee,{variant:"body1",sx:{mb:2},children:[e.jsx("span",{style:{color:$e.success,fontWeight:600,fontSize:24},children:ve(N)}),e.jsx("small",{style:{paddingLeft:4},children:l("notification.sendStatus.success")})]}),e.jsxs(y,{className:"unsent-area",children:[e.jsxs(y,{children:[e.jsxs(de,{config:{status:"failed"},enableTooltip:!1,children:[ve(I)," ",l("notification.sendStatus.failed")]}),e.jsxs(de,{config:{status:"pending"},enableTooltip:!1,children:[ve(S)," ",l("notification.sendStatus.pending")]})]}),I>0&&e.jsx(y,{className:"resend-btn",children:e.jsx(ce,{size:"small",color:"primary",loading:o,variant:"contained",startIcon:e.jsx(Ge,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:j,children:l("notification.resend")})})]})]})}function nt({statistics:n,mode:s="simple",onResend:t=()=>{},resending:r=!1}){const o=se(()=>s==="simple"?Vn(n):Jn(n,t,r),[n,s]);return s==="simple"?e.jsx("div",{children:o.map(l=>e.jsx(Tt,{style:{alignItems:"flex-start",marginBottom:s==="simple"?0:16},valueComponent:"div",nameWidth:100,name:l.name,children:l.value},l.name))}):e.jsx(st,{container:!0,spacing:2,children:o.map(l=>e.jsx(st,{size:{md:4,sm:6,xs:12},children:l.value},l.name))})}const Gn=ae(y)`
|
|
31
|
-
display: flex;
|
|
32
|
-
flex-direction: column;
|
|
33
|
-
align-items: flex-start;
|
|
34
|
-
padding: 16px;
|
|
35
|
-
border-radius: 8px;
|
|
36
|
-
background: ${({successRatio:n,failedRatio:s,theme:t})=>n===0&&s===0?t.palette.grey[300]:`linear-gradient(to right, ${Ht(t.palette.success.light,.4)} ${n}%, ${t.palette.grey[100]} ${n}%)`};
|
|
37
|
-
transition: 'background 0.5s ease';
|
|
38
|
-
cursor: pointer;
|
|
39
|
-
.unsent-area {
|
|
40
|
-
width: 100%;
|
|
41
|
-
position: relative;
|
|
42
|
-
.resend-btn {
|
|
43
|
-
position: absolute;
|
|
44
|
-
right: 0;
|
|
45
|
-
bottom: 0;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
`;_t.propTypes={notification:h.object.isRequired,onCancel:h.func,blocklet:h.object.isRequired,tab:h.string};function _t({notification:n,onCancel:s=()=>{},blocklet:t,tab:r="info"}){const{t:o,locale:l}=te(),{getComponent:b,resendNotification:u}=Xe(),[p,i]=v.useState(!1),N=se(()=>b(n.componentDid)||t,[t,n.componentDid]),I=ye({tab:r||"info"}),S=v.useCallback(async(f,R,C=!0,a=[])=>{if(!f.length||!n.id)return;const T=R.length>0?R:n?.receivers?.map(D=>D.receiver);if(!T.length)return;let O=[...f];if(O.includes(_.NOTIFICATION_SEND_CHANNEL.PUSH)&&!Dt(t)&&(M.warning(o("notification.sendStatus.reason.unavailable",{channel:"Push Kit"})),O=O.filter(D=>D!==_.NOTIFICATION_SEND_CHANNEL.PUSH)),O.includes(_.NOTIFICATION_SEND_CHANNEL.EMAIL)&&!Ot(t)&&(M.warning(o("notification.sendStatus.reason.unavailable",{channel:"Email"})),O=O.filter(D=>D!==_.NOTIFICATION_SEND_CHANNEL.EMAIL)),!!O.length)try{i(!0),await u({notificationId:n.id,receivers:T,channels:O,resendFailedOnly:C,...O.includes("webhook")&&a.length?{webhookUrls:a}:{}}),M.success("Message has been sent!")}catch(D){console.error("handleResend error",{error:D}),M.error(D.response?D.response.statusText:D.message)}finally{i(!1)}},[t,n.id,n?.receivers,u,o]),j=se(()=>hn(n),[n]),E=se(()=>xn(n),[n]),J=se(()=>j?n?.actorInfo:[],[n]),z=se(()=>t?.did||t?.meta?.did||"",[t]);function F(){return[{name:o("notification.from"),value:j&&E?e.jsx(un,{actors:J,teamDid:z,size:32,showName:!0}):e.jsx(mn,{size:32,blocklet:N,showName:!0,hideDot:!0})},{name:o("notification.notificationTitle"),value:e.jsx(Se,{maxLength:50,children:n.title})},{name:o("notification.body"),value:j?e.jsx(pn,{notification:n,blocklet:t}):e.jsx(gn,{notification:n,rows:0})},{name:o("notification.severity"),value:e.jsx(Ce,{severity:n.severity})},{name:o("notification.createdAt"),value:e.jsx(sn,{value:n.createdAt,locale:l,shouldUpdate:!0,type:"all"})}].map(R=>e.jsx(Tt,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:R.name,children:R.value},R.name))}const B={info:{label:o("common.basicInfo"),value:"info",component:F},receivers:{label:o("notification.receiver"),value:"receivers"},statistics:{label:o("notification.statistics"),value:"statistics"}},w=Object.values(B).map(({label:f,value:R})=>({label:f,value:R})),q=B[I.tab]||B.info,K=f=>{I.tab=f};return e.jsx(St,{title:o("notification.notificationDetails"),fullWidth:!0,maxWidth:"lg",onClose:()=>{I.tab="info",s()},open:!0,actionsPosition:"left",sx:{".ux-dialog_header":{paddingBottom:0},".MuiDialogContent-root":{paddingTop:0}},children:e.jsxs(Xn,{children:[e.jsx(y,{className:"tabs",sx:{mx:3},children:e.jsx(bt,{tabs:w,current:I.tab,onChange:K,scrollButtons:"auto"})}),e.jsxs("div",{className:"body",children:[I.tab==="receivers"&&e.jsx(Un,{notificationId:n.id,resending:p,handleResend:S}),I.tab==="statistics"&&e.jsx(nt,{statistics:n.statistics,mode:"detail",resending:p,onResend:S}),I.tab==="info"&&e.jsx(q.component,{})]})]})})}const Yn=v.memo(_t),Xn=ae.div`
|
|
49
|
-
& > .notification-row {
|
|
50
|
-
padding: 0;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.tabs {
|
|
54
|
-
margin: 0;
|
|
55
|
-
}
|
|
56
|
-
.body {
|
|
57
|
-
margin-top: 16px;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.channel-item {
|
|
61
|
-
display: flex;
|
|
62
|
-
padding: 4px;
|
|
63
|
-
justify-content: flex-start;
|
|
64
|
-
align-items: center;
|
|
65
|
-
gap: 8px;
|
|
66
|
-
> p {
|
|
67
|
-
font-size: 15px;
|
|
68
|
-
}
|
|
69
|
-
.resend-btn {
|
|
70
|
-
svg {
|
|
71
|
-
font-size: 16px;
|
|
72
|
-
}
|
|
73
|
-
display: flex;
|
|
74
|
-
align-items: center;
|
|
75
|
-
font-size: 12px;
|
|
76
|
-
cursor: pointer;
|
|
77
|
-
&.disabled {
|
|
78
|
-
cursor: not-allowed;
|
|
79
|
-
color: ${Ae.text.disabled};
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
`;Pe.propTypes={blocklet:h.object,label:h.string};const Qn=ae.div`
|
|
84
|
-
display: flex;
|
|
85
|
-
justify-items: flex-start;
|
|
86
|
-
align-items: center;
|
|
87
|
-
gap: 8px;
|
|
88
|
-
.name {
|
|
89
|
-
display: block;
|
|
90
|
-
max-width: 260px;
|
|
91
|
-
white-space: nowrap;
|
|
92
|
-
overflow: hidden;
|
|
93
|
-
text-overflow: ellipsis;
|
|
94
|
-
}
|
|
95
|
-
`;function Pe({blocklet:n=null,label:s=""}){return e.jsx(Qn,{children:n?e.jsxs(e.Fragment,{children:[e.jsx(Et,{size:24,blocklet:n,ancestors:n.ancestors}),e.jsx("span",{className:"name",children:n.title||n.meta?.title})]}):e.jsx("span",{className:"name",children:s})})}zt.propTypes={list:h.array.isRequired,label:h.string.isRequired,onDelete:h.func};function zt({list:n,label:s,onDelete:t=()=>{}}){return e.jsxs(y,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(ee,{children:[s,": "]}),n.map(r=>e.jsx(Je,{size:"small",label:e.jsx(y,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(Ce,{severity:r})}),onDelete:o=>t(o,r)},r))]})}function Zn(n){return e.jsx(Qe,{...n,renderLabel:s=>e.jsx(Ce,{severity:s})})}function es({customTableButtons:n}){const{t:s,locale:t}=te(),r=ht(),o=v.useMemo(()=>jt(r,Lt()),[r]),[l,b]=v.useState(!1),{data:u,paging:p,blocklet:i,fetch:N,getComponent:I,componentDids:S,inService:j,teamDid:E}=Xe(),J=v.useRef(null),[z,F]=v.useState(null),[B,w]=v.useState("info"),q=yn(),[K,f]=v.useState(!1),R=`notification-records-${i.meta?.did}`,C=an(R),[a,T]=v.useState({pageSize:C.rowsPerPage||10,page:C.page?C.page+1:1,dids:C.dids||[],dateRange:C.dateRange||[Z().subtract(1,"month").startOf("day").toDate(),Z().endOf("day").toDate()]}),O=se(()=>{if(!i.children||!i.children.length)return[];const g=[];return i.children.forEach(x=>{const k=x.did||x.meta?.did;S.includes(k)&&(x.ancestors=[i],g.push(x))}),g},[S,i]),D=async g=>{try{b(!0),await N(g),b(!1)}finally{b(!1)}};v.useEffect(()=>{D(a)},[a]),v.useEffect(()=>{const g=u.find(x=>x.id===z?.id);z&&g&&F({...g})},[u]);const re=(g,x,k,L)=>{g.stopPropagation();const W=k.filter(P=>P!==x);T(P=>({...P,[L]:W,page:1}))},ue=({page:g,rowsPerPage:x,filterList:k})=>{const[L=[],,,,W=[]]=k;a.pageSize!==x?T(P=>({...P,pageSize:x,page:1})):a.page!==g+1?T(P=>({...P,page:g+1})):je(a.dids,L)?je(a.severities,W)||T(P=>({...P,severities:W,page:1})):T(P=>({...P,dids:L,page:1}))},oe=v.useCallback(()=>{F(null),w("info")},[]),pe=v.useCallback(()=>{N(a)},[N,a]),we=[{label:s("notification.from"),name:"sender",width:400,options:{filter:!0,filterType:"custom",customFilterListOptions:{render:g=>g.map((x,k)=>{if(x==="system")return e.jsx("span",{children:s("notification.system")},`system-${k}`);const L=O.find(W=>(W.did||W.meta?.did)===x);return e.jsx(Pe,{blocklet:L,label:L?.title||L?.meta?.title},x)}),update:(g,x,k)=>(g[k].splice(x,1),g)},filterOptions:{names:O,logic:(g,x)=>x.length?!x.includes(g):!1,display:(g,x,k,L)=>e.jsxs(V,{style:{width:"380px"},children:[e.jsx($t,{id:"demo-simple-select-label",style:{background:"#ffffff"},children:"Sender"}),e.jsxs(Vt,{multiple:!0,value:g[k],renderValue:W=>e.jsx(y,{style:{overflow:"hidden",textOverflow:"ellipsis"},sx:{display:"flex",gap:1,alignItems:"center"},children:W.map(P=>{if(P==="system")return e.jsx("span",{children:s("notification.system")},P);const ie=O.find(Re=>(Re.did||Re.meta?.did)===P);return e.jsx(Pe,{blocklet:ie,label:ie?.title||ie?.meta?.title},P)})}),onChange:W=>{g[k]=W.target.value,x(g[k],k,L)},children:[e.jsx(it,{value:"system",children:s("notification.system")}),O.map(W=>{const P=W.did||W.meta?.did;return e.jsx(it,{value:P,children:e.jsx(Pe,{blocklet:W,label:W.title||W.meta?.title})},P)})]})]})},customBodyRenderLite:g=>{const x=u[g],k=I(x.componentDid);return e.jsxs(y,{sx:{display:"flex",alignItems:"center",gap:1},children:[k?e.jsx(Et,{size:32,blocklet:k,ancestors:k.ancestors??[]}):e.jsx(fn,{blocklet:i,size:32}),e.jsx(Se,{maxLength:50,children:k?.meta?.title||i?.meta?.title})]})}}},{label:s("notification.receiver"),name:"receivers",width:300,options:{filter:!1,customBodyRenderLite:g=>{const x=u[g],{receivers:k}=x;return e.jsx(Jt,{total:k.length,renderSurplus:L=>L<100?e.jsxs("span",{children:["+",L]}):e.jsx("span",{children:"99+"}),max:3,sx:{justifyContent:"flex-end",height:"32px",".MuiAvatar-root":{width:"32px",height:"32px",fontSize:"12px",border:0,zIndex:2}},onClick:L=>{L.stopPropagation(),F(x),w("receivers")},children:k.map(L=>{const{receiverUser:W}=L,P=It(W.avatar,E,j);return e.jsx(vt,{alt:W.fullName,src:`${P}?imageFilter=resize&w=48&h=48`,size:32,did:L.receiver,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}},L.receiver)})})}}},{label:s("notification.statistics"),name:"statistics",width:400,options:{filter:!1,customBodyRenderLite:g=>{const x=u[g];return e.jsx(y,{onClick:k=>{k.stopPropagation(),F(x),w("statistics")},children:e.jsx(nt,{statistics:x.statistics})})}}},{label:s("notification.notificationPreview"),name:"data",options:{filter:!1,customBodyRenderLite:g=>{const x=u[g];return e.jsx(Se,{maxLength:50,children:x.title})}}},{label:s("notification.severity"),name:"severity",width:200,options:{setCellProps:()=>({className:"severity-cell"}),customBodyRenderLite:g=>{const x=u[g];return e.jsx(Ce,{severity:x.severity})},filter:!0,filterType:"custom",filterList:a.severities??[],customFilterListOptions:{render:g=>e.jsx(zt,{list:g,label:s("notification.severity"),onDelete:(x,k)=>{x.stopPropagation(),re(x,k,we[4].options.filterList,"severities")}}),update:Oe},filterOptions:{names:dt,fullWidth:!0,logic:De,display:(g,x,k,L)=>e.jsx(Zn,{label:s("notification.severity"),filterList:g,onChange:x,index:k,column:L,filterValues:dt})}}},{label:s("common.createdAt"),name:"createdAt",width:300,options:{filter:!1,customBodyRenderLite:g=>{const{createdAt:x}=u[g];return e.jsx(Nt,{value:x,locale:t,shouldUpdate:!0})}}}],fe=g=>{T(x=>({...x,dateRange:g,page:1}))},he=[e.jsxs(y,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[e.jsx(Gt,{onClick:()=>f(!0),sx:{p:q?0:void 0},children:e.jsx(Yt,{})},"settings"),q?e.jsx(ee,{children:s("common.setting")}):null]}),...n||[]];return e.jsxs(y,{ref:J,sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:[e.jsx(ts,{children:e.jsx(xt,{theme:o,children:e.jsx(yt,{className:"main-table",verticalKeyWidth:100,loading:l,locale:t,columns:we,data:u,durable:R,onChange:ue,options:{sort:!1,download:!1,print:!1,search:!1,expandableRowsOnClick:!0,page:p.page-1,rowsPerPage:p.pageSize,count:p.total,...C,onRowClick:(g,{dataIndex:x})=>{F(u[x])}},customPreButtons:[e.jsx(Ze,{value:a.dateRange,onChange:fe})],customButtons:he,components:{TableFilterList:g=>e.jsx(et,{...g,itemComponent:x=>e.jsx(tt,{...x,canDelete:k=>k?.columnNames?.[k?.index||0]?.name==="sender"})})}})})}),z&&e.jsx(Yn,{refresh:pe,onCancel:oe,notification:z,blocklet:i,tab:B}),e.jsx(St,{title:`${s("common.notification")} ${s("common.setting")}`,fullWidth:!0,maxWidth:"md",open:K,onClose:()=>f(!1),PaperProps:{style:{minHeight:"500px"}},children:e.jsx(y,{sx:{mt:"-16px",overflowY:"hidden"},children:e.jsx(An,{})})})]})}const ts=ae.div`
|
|
96
|
-
td.MuiTableCell-footer {
|
|
97
|
-
border: none !important;
|
|
98
|
-
}
|
|
99
|
-
.sent-status-cell {
|
|
100
|
-
.resend-btn {
|
|
101
|
-
display: none;
|
|
102
|
-
}
|
|
103
|
-
&:hover {
|
|
104
|
-
.resend-btn {
|
|
105
|
-
display: flex;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.custom-toobar-btns {
|
|
111
|
-
gap: 4px;
|
|
112
|
-
}
|
|
113
|
-
`;ns.propTypes={blocklet:h.object.isRequired,customTableButtons:h.array};function ns({blocklet:n={},customTableButtons:s=[]}){return e.jsx(Dn,{blocklet:n,children:e.jsx(es,{customTableButtons:s})})}export{ns as default};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{T as M,H as q,P as N,q as Y,k as ve,j as Ce,a0 as Se}from"./vendor-ux-B9VfuZTg.js";import{o as Te,k as le,t as Ie}from"./vendor-hooks-BlA8TRnZ.js";import{r as E,a as ae}from"./vendor-react-Dvs43sk9.js";import{j as e,Y as Re,bC as We,$ as ze,ak as p,z as se,T as C,a6 as F,aX as te,R as De,Q as H,b6 as ne,am as $,bf as _,a5 as J,V as G,S as Z,b4 as Oe,U as L,I as B,ci as Pe,bh as $e,a7 as Ae,F as qe,W as t,b1 as R,a3 as ce,c2 as ee,cj as Le,aO as Me,aP as Be,ck as Fe,cl as He,cm as Ne,s as oe,aU as Ue,aj as _e,J as Ke,cn as Ve,aZ as Ye,cc as Je,bb as Qe,cb as Xe}from"./vendor-mui-core-DRxbhqaK.js";import{B as de,o as pe,l as ue}from"./index-BFBoLr1Z.js";import{X as K,c as xe,_ as Ge,a9 as Ze,b5 as Q}from"./index-Dt8akALo.js";import{u as V}from"./team-s6q3vfNx.js";import{u as et}from"./use-mobile-BQQpAf3i.js";import{u as tt,C as X}from"./index.esm-JPZAjt0x.js";import{C as he,a as me,J as ot}from"./vendor-utils-CUDP56Ff.js";import{C as st}from"./confirm-D1n-RK65.js";import{A as nt}from"./actions-B4VXcSRp.js";import{T as ie}from"./table-tips-rCE1XKlc.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-DeeG8u0h.js";import"./session-Y3RU3I2O.js";import"./isURL-B2kErAOg.js";import"./use-app-logo-BjReZUm7.js";import"./index-DBs9Ljax.js";const it=i=>{const[u,c]=E.useState(null),[f,r]=E.useState(!0),[w,x]=E.useState(null),j=window.blocklet?.appUrl,l=E.useMemo(()=>{const g={};return u&&(u.sources.forEach(y=>{g[y.did]={source:y,events:[],count:0}}),u.events.forEach(y=>{g[y.source]&&(g[y.source].events.push(y),g[y.source].count+=1)})),g},[u]),b=async()=>{try{if(r(!0),!j)return;const y=await(await fetch(he(j,xe.WELLKNOWN_SERVICE_PATH_PREFIX,"/openevent.json"))).json();c(y),x(null)}catch(g){x(g instanceof Error?g:new Error(String(g)))}finally{r(!1)}};return E.useEffect(()=>{b()},[j]),{openEvent:u,setOpenEvent:c,eventsBySource:l,loading:f,error:w,loadData:b}};function ge({eventsBySource:i,selectedEvents:u,setSelectedEvents:c,error:f=null}){const{t:r}=M(),[w,x]=E.useState({}),j=E.useMemo(()=>{const n={};return Object.entries(i).forEach(([a,{events:m}])=>{const v=m.filter(S=>u[`${S.type}-${S.source}`]).length;n[a]=v}),n},[i,u]),l=E.useMemo(()=>Object.values(j).reduce((n,a)=>n+a,0),[j]),b=E.useMemo(()=>Object.values(i).reduce((n,{events:a})=>n+a.length,0),[i]),g=(n,a)=>{a.stopPropagation(),x({...w,[n]:!w[n]})},y=n=>{const a=`${n.type}-${n.source}`;c(m=>({...m,[a]:!m[a]}))},z=(n,a)=>{const m={};n.forEach(v=>{const S=`${v.type}-${v.source}`;m[S]=!a}),c(v=>({...v,...m}))},T=n=>{const a={};Object.values(i).forEach(({events:m})=>{m.forEach(v=>{const S=`${v.type}-${v.source}`;a[S]=n.target.checked})}),c(a)};return e.jsxs(p,{sx:{width:"100%"},children:[e.jsxs(p,{sx:{display:"flex",alignItems:"center",mb:1,mt:1},children:[e.jsx(ne,{control:e.jsx(J,{onChange:T,checked:l>0&&l===b}),label:e.jsxs(p,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:[r("webhookEndpoint.selectAllEvents"),e.jsx(p,{sx:{display:"flex",alignItems:"center"},children:e.jsx($,{title:r("webhookEndpoint.selectAllEventsTooltip"),placement:"right",children:e.jsx(_,{fontSize:"small",sx:{ml:.5,cursor:"help"}})})})]}),sx:{m:0}}),l>0&&e.jsx(C,{variant:"body2",color:"primary",sx:{ml:"auto"},children:r("webhookEndpoint.selectedEventsCount",{count:l})})]}),e.jsx(p,{sx:{maxHeight:"50vh",overflow:"auto"},children:e.jsx(G,{disablePadding:!0,sx:{border:"1px solid",borderColor:"divider",borderRadius:"4px"},children:Object.entries(i).map(([n,{source:a,events:m,count:v}],S)=>{const D=j[n]>0,I=j[n]===m.length&&m.length>0,O=w[n];return e.jsxs(ae.Fragment,{children:[e.jsx(Z,{sx:{borderBottom:({palette:o})=>S<Object.keys(i).length-1?`1px solid ${o.divider}`:"none",px:2,py:1.5,"&:hover":{bgcolor:"rgba(0, 0, 0, 0.02)"}},children:e.jsxs(p,{sx:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},onClick:o=>{o.target.closest(".MuiFormControlLabel-root")||g(n,o)},children:[e.jsx(p,{sx:{display:"flex",alignItems:"center"},children:m.length>0&&e.jsx(ne,{control:e.jsx(J,{checked:I,indeterminate:D&&!I,onChange:o=>{o.stopPropagation(),z(m,I)}}),label:e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[a.logo&&e.jsx(Oe,{src:a.logo,sx:{width:24,height:24}}),e.jsx(p,{children:a.title||n}),D&&e.jsx(L,{label:r("webhookEndpoint.selectedCount",{count:j[n]}),size:"small",sx:{mt:"2px",height:"20px",fontSize:"12px",bgcolor:o=>`${o.palette.primary.main}20`,color:"primary.main",fontWeight:500}})]}),sx:{m:0,"& .MuiFormControlLabel-label":{flex:1}}})}),e.jsxs(p,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(C,{variant:"body2",sx:{color:"text.secondary",mr:1},children:r("webhookEndpoint.eventsCount",{count:v})}),m.length>0&&e.jsx(B,{size:"small",edge:"end",children:O?e.jsx(Pe,{}):e.jsx($e,{})})]})]})}),m.length>0&&e.jsx(Ae,{in:O,timeout:"auto",unmountOnExit:!0,children:e.jsx(G,{disablePadding:!0,sx:{pl:2,pr:2,py:1,bgcolor:"rgba(0, 0, 0, 0.01)"},children:m.map(o=>{const d=`${o.type}-${o.source}`,s=!!u[d];return e.jsx(Z,{dense:!0,sx:{py:.75},onClick:()=>y(o),children:e.jsxs(p,{sx:{display:"flex",alignItems:"flex-start",width:"100%"},children:[e.jsx(J,{checked:s,sx:{mr:1}}),e.jsxs(p,{children:[e.jsx(C,{variant:"body1",sx:{cursor:"pointer",color:"text.primary"},children:o.type}),e.jsx(C,{variant:"caption",sx:{color:"text.secondary",display:"block",cursor:"pointer"},children:o.description})]})]})},d)})})})]},n)})})}),f&&e.jsx(qe,{error:!0,sx:{mt:1},children:f})]})}ge.propTypes={eventsBySource:t.objectOf(t.shape({source:t.shape({did:t.string.isRequired,title:t.string,description:t.string,version:t.string,logo:t.string}).isRequired,events:t.arrayOf(t.shape({type:t.string.isRequired,description:t.string.isRequired,source:t.string.isRequired})).isRequired,count:t.number.isRequired})).isRequired,selectedEvents:t.objectOf(t.bool).isRequired,setSelectedEvents:t.func.isRequired,error:t.string};function be({id:i=null,url:u="",description:c="",enabledEvents:f=[],onSubmit:r,onClose:w=()=>{}}){const{t:x}=M(),[j,l]=E.useState({}),{teamDid:b}=V(),{api:g}=K(),{loading:y,error:z,eventsBySource:T}=it(),{control:n,handleSubmit:a,formState:{errors:m},reset:v,setValue:S,trigger:D}=tt({defaultValues:{url:"",description:""}});E.useEffect(()=>{const o=Object.values(j).some(d=>d);S("selectedEvents",o?"valid":""),D("selectedEvents")},[j,S,D]);const I=()=>{l({}),v(),w()},O=async o=>{const d=Object.keys(j).filter(h=>j[h]),s={url:o.url,description:o.description,enabledEvents:d.map(h=>{const[k,W]=h.split("-");return!k||!W?null:{type:k,source:W}}).filter(Boolean)};try{if(i){const h=await g.updateWebhookEndpoint({input:{teamDid:b,id:i,data:s}});q.success(`${x("webhookEndpoint.updateWebhook")} ${x("webhookEndpoint.success")}`),r(h)}else{const h=await g.createWebhookEndpoint({input:{teamDid:b,input:s}});q.success(`${x("webhookEndpoint.createWebhook")} ${x("webhookEndpoint.success")}`),r(h)}}catch(h){q.error(h?.message)}I()};return E.useEffect(()=>{v({url:u,description:c}),l(f.reduce((o,d)=>(o[`${d.type}-${d.source}`]=!0,o),{}))},[v,l,u,c,f]),e.jsx(Re,{open:!0,onClose:I,maxWidth:"lg",fullWidth:!0,sx:{"& .MuiDialog-paper":{minHeight:600}},children:e.jsxs("form",{onSubmit:a(O),children:[e.jsx(We,{children:x(i?"webhookEndpoint.editWebhookTitle":"webhookEndpoint.createWebhookTitle")}),e.jsx(ze,{children:e.jsxs(p,{sx:{display:"flex",flexDirection:"column",gap:2,mt:2},children:[e.jsx(X,{name:"url",control:n,rules:{required:x("webhookEndpoint.validation.urlRequired"),pattern:{value:/^(http|https):\/\/[^ "]+$/,message:x("webhookEndpoint.validation.urlInvalid")}},render:({field:o})=>e.jsx(se,{...o,label:x("webhookEndpoint.url.label"),fullWidth:!0,error:!!m.url,helperText:m.url?.message})}),e.jsx(X,{name:"description",control:n,rules:{required:x("webhookEndpoint.validation.descriptionRequired")},render:({field:o})=>e.jsx(se,{...o,label:x("webhookEndpoint.description.label"),fullWidth:!0,multiline:!0,minRows:2,maxRows:4,error:!!m.description,helperText:m.description?.message})}),e.jsx(X,{name:"selectedEvents",control:n,rules:{required:x("webhookEndpoint.validation.eventRequired")},render:({field:o})=>e.jsx("input",{type:"hidden",...o})}),!y&&T&&Object.keys(T).length>0&&e.jsx(ge,{eventsBySource:T,selectedEvents:j,setSelectedEvents:l,error:m.selectedEvents?.message}),!y&&(!T||Object.keys(T).length===0)&&e.jsx(C,{sx:{color:"text.secondary"},children:x("webhookEndpoint.noAvailableEvents")}),y&&e.jsx(p,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px",width:"100%"},children:e.jsx(F,{size:20})}),z&&e.jsx(te,{severity:"error",children:x("webhookEndpoint.loadingError",{message:z?.message})})]})}),e.jsxs(De,{sx:{p:"8px 24px 24px"},children:[e.jsx(H,{onClick:I,children:x("common.cancel")}),e.jsx(H,{type:"submit",variant:"contained",color:"primary",children:x(i?"webhookEndpoint.updateWebhook":"webhookEndpoint.saveWebhook")})]})]})})}be.propTypes={onSubmit:t.func.isRequired,id:t.string,url:t.string,description:t.string,enabledEvents:t.arrayOf(t.shape({type:t.string.isRequired,source:t.string.isRequired})),onClose:t.func};function fe(i){switch(i){case"enabled":return"success";case"disabled":default:return"default"}}const rt=(i="en")=>i==="tw"?"zh":i;function U(i,u="YYYY-MM-DD HH:mm:ss",c="en"){return i?Ge(i).locale(rt(c)).format(u):"-"}function lt(i){return typeof i=="number"?!1:me(i)}function at(i){return i>=200&&i<300}function P({value:i,label:u,tip:c="",divider:f=!1}){const r=lt(i);return e.jsxs(e.Fragment,{children:[e.jsxs(R,{direction:"column",alignItems:"flex-start",children:[e.jsxs(C,{component:"div",variant:"body1",mb:1,color:"text.primary",sx:{fontWeight:500},children:[u,!!c&&e.jsx($,{title:c,children:e.jsx(_,{fontSize:"small"})})]}),e.jsx(C,{component:"div",variant:"body1",color:r?"text.disabled":"text.secondary",sx:{width:"100%",minHeight:"24px"},children:r?"-":i})]}),f&&e.jsx(ce,{orientation:"vertical",flexItem:!0})]})}P.propTypes={label:t.oneOfType([t.string,t.node]).isRequired,value:t.oneOfType([t.string,t.node]).isRequired,tip:t.oneOfType([t.string,t.node]),divider:t.bool};function je({title:i,children:u=null,mb:c=1.5,mt:f=1.5}){return e.jsxs(R,{className:"section-header",direction:"row",sx:{justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:1,mb:c,mt:f,pb:1},children:[e.jsx(C,{variant:"h3",sx:{fontSize:{xs:"18px",md:"1.09375rem"}},component:"div",children:i}),u]})}je.propTypes={title:t.oneOfType([t.string,t.node]).isRequired,children:t.node,mb:t.number,mt:t.number};const ct={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 11A8.1 8.1 0 0 0 4.5 9M4 5v4h4m-4 4a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"/>'},dt=i=>{const u={};return i.forEach(c=>{const f=new Date(c.createdAt).toLocaleDateString();u[f]||(u[f]=[]),u[f]?.push(c)}),u};function ye({eventId:i="",webhookEndpointId:u="",event:c=null}){const{api:f,ws:{useSubscription:r}}=K(),{t:w}=M(),{teamDid:x}=V(),{blocklet:j}=Ze(),{data:l,loadMore:b,loadingMore:g,loading:y,mutate:z}=Te(s=>{const k=s?Math.ceil(s.list.length/15)+1:1;return f.getWebhookAttempts({input:{teamDid:x,input:{eventId:i,webhookId:u},paging:{page:k,pageSize:15}}})},{reloadDeps:[i,u]}),T=l?.list||[],[n,a]=E.useState(null),[m,v]=E.useState(!1),S=dt(T);if(E.useEffect(()=>{!n&&l?.list.length&&a(l.list[0])},[l?.list.length,n]),r(xe.EVENTS.WEBHOOK_ATTEMPT,s=>{z(h=>{if(h.list.find(W=>W.id===s.id)){const W=h.list.map(A=>A.id===s.id?{...A,...s}:A);return{...h,list:W}}return s.endpoint=h.list[0]?.endpoint,s.event=h.list[0]?.event,{...h,list:[s,...h.list]}})},[]),y)return e.jsx(F,{});const D=l&&l.list.length<l.paging.total,I=async()=>{n&&(v(!0),await f.retryWebhookAttempt({input:{teamDid:x,eventId:n.event.id,webhookId:u,attemptId:n.id}}).finally(()=>{setTimeout(()=>{v(!1)},1e3)}))},O=s=>{if(s.responseBody&&s.responseBody?.sessionId&&s.responseBody?.projectId&&s.responseBody?.agentId){const h=j?.site?.domainAliases[0]?.value,k=(j.children||[]).find(A=>A?.meta?.name==="ai-studio"),W=ot(he(`https://${h}`,k?.mountPoint||"","projects",s.responseBody.projectId,"logs/main"),{sessionId:s.responseBody.sessionId,agentId:s.responseBody.agentId});return e.jsx(B,{sx:{fontSize:20},onClick:()=>window.open(W,"_blank"),children:e.jsx(p,{component:N,icon:Q})})}return null},o=s=>s.status==="pending"?e.jsx(Fe,{color:"warning"}):at(s.responseStatus)?e.jsx(He,{color:"success"}):e.jsx(Ne,{color:"error"}),d=n?.triggeredFrom&&(l?.list||[]).find(s=>s.id===n.triggeredFrom);return e.jsxs(pt,{container:!0,spacing:{xs:0,md:1},sx:{height:1},children:[e.jsx(ee,{size:{xs:12,md:4},sx:{height:1},children:me(Object.keys(S))?e.jsx(C,{sx:{color:"text.secondary"},children:w("webhookEndpoint.waitingForEvents")}):e.jsxs(e.Fragment,{children:[e.jsx(G,{sx:{maxHeight:"calc(100% - 40px)",py:0,overflowY:"auto"},children:Object.entries(S).map(([s,h])=>e.jsxs(ae.Fragment,{children:[e.jsx(Le,{sx:{p:0},children:s}),h.map(k=>e.jsxs(Z,{sx:{cursor:"pointer",px:1},onClick:()=>a(k),selected:n&&n?.id===k?.id,secondaryAction:e.jsx(C,{sx:{color:"text.secondary"},children:U(k.createdAt,"HH:mm:ss")}),children:[e.jsx(Me,{sx:{minWidth:0,mr:1.5},children:o(k)}),e.jsx(Be,{primary:e.jsx(C,{sx:{color:"text.primary"},children:k.event.type})})]},k.id))]},s))}),D&&e.jsx(p,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:1},children:e.jsx(H,{variant:"text",type:"button",color:"inherit",onClick:b,disabled:g,sx:{color:s=>s.palette.text.disabled},children:w(g?"webhookEndpoint.loadingMore":"webhookEndpoint.loadMore")})})]})}),e.jsxs(ee,{size:{xs:12,md:8},sx:{height:1},children:[n&&e.jsxs(R,{direction:"column",spacing:2,sx:{height:1,overflow:"auto",pl:{xs:0,md:1},mt:{xs:2,md:0},borderLeft:{xs:"none"}},children:[e.jsxs(p,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(C,{variant:"h4",children:w(`common.${n.status}`)}),e.jsx(p,{children:O(n)})]}),e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[d&&e.jsx($,{placement:"left",title:e.jsxs(R,{onClick:()=>a(d),sx:{gap:1,cursor:"pointer",".did-address-text":{color:"common.white"}},children:[e.jsx(de,{showDid:!0,did:n.triggeredBy,cardType:ue.Detailed,infoType:pe.Minimal,sx:{border:0,padding:0,minWidth:0,".MuiTypography-root":{color:"common.white",fontWeight:400}}}),e.jsx(ce,{}),e.jsxs(p,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(C,{variant:"body2",sx:{color:"primary.main"},children:w("webhookEndpoint.triggeredFrom")}),e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(C,{variant:"body2",children:n.id}),e.jsx(B,{onClick:()=>a(d),children:e.jsx(p,{component:N,icon:Q,sx:{fontSize:16,color:"common.white"}})})]})]})]}),slotProps:{tooltip:{sx:{maxWidth:400}}},children:e.jsx(B,{onClick:()=>a(d),children:e.jsx(p,{component:N,icon:Q,sx:{fontSize:16}})})}),e.jsxs(H,{variant:"outlined",color:"primary",size:"small",onClick:I,disabled:m,children:[e.jsx(p,{component:N,icon:ct,sx:{fontSize:16,animation:m?"spin 1s linear infinite":"none",mr:.5}}),w("notification.resend")]})]})]}),e.jsxs(p,{children:[e.jsxs(C,{variant:"h6",children:[w("webhookEndpoint.response")," (",n.responseStatus,")"]}),e.jsx(Y,{language:"json",children:JSON.stringify(n.responseBody,null,2)})]}),e.jsxs(p,{children:[e.jsx(R,{direction:"row",spacing:1,sx:{alignItems:"center"},children:e.jsx(C,{variant:"h6",children:w("webhookEndpoint.request")})}),e.jsx(Y,{language:"json",sx:{margin:0},children:JSON.stringify(n.event,null,2)})]})]}),l?.list.length===0&&c&&e.jsxs(p,{children:[e.jsx(R,{direction:"row",spacing:1,sx:{alignItems:"center"},children:e.jsx(C,{variant:"h6",children:w("webhookEndpoint.eventData")})}),e.jsx(Y,{language:"json",sx:{margin:0},children:JSON.stringify(c.data,null,2)})]})]})]})}ye.propTypes={eventId:t.string,webhookEndpointId:t.string,event:t.shape({type:t.string,data:t.object,request:t.object,requestInfo:t.object})};const pt=oe(ee)`
|
|
2
|
-
@keyframes spin {
|
|
3
|
-
to {
|
|
4
|
-
transform: rotate(360deg);
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
`;function we({id:i,onClose:u}){const{t:c}=M(),{api:f}=K(),{teamDid:r}=V(),{loading:w,error:x,data:j}=le(()=>f.getWebhookEndpoint({input:{teamDid:r,id:i}})),l=j?.data;return x?e.jsx(te,{severity:"error",children:x.message}):w||!l?e.jsx(p,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:1,width:1},children:e.jsx(F,{})}):e.jsxs(ut,{direction:"column",sx:{height:{xs:"auto",md:1}},children:[e.jsxs(p,{children:[e.jsxs(R,{direction:"row",sx:{justifyContent:"space-between",alignItems:"center"},children:[e.jsx(R,{sx:{flex:1,width:0},children:e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(C,{variant:"h5",sx:{fontWeight:600,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:l.description}),e.jsx($,{title:l.url,children:e.jsx(_,{sx:{fontSize:"16px",marginTop:"2px"}})})]})}),e.jsx(R,{direction:"row",sx:{alignItems:"center"},children:e.jsx(B,{edge:"end",color:"inherit",onClick:u,children:e.jsx(_e,{})})})]}),e.jsx(p,{sx:{mt:2},children:e.jsxs(R,{className:"section-body",direction:{xs:"column",md:"row"},spacing:{xs:1,md:3},sx:{justifyContent:"flex-start",flexWrap:"wrap",pt:2,mt:2,borderTop:"1px solid #eee"},children:[e.jsx(P,{label:c("common.status"),value:e.jsx(L,{size:"small",variant:"filled",label:l.status,color:fe(l.status),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}}),divider:!0}),e.jsx(P,{label:c("webhookEndpoint.listen"),value:e.jsx($,{arrow:!0,title:e.jsx("ul",{style:{padding:0,margin:0},children:l.enabledEvents.map(b=>e.jsx("li",{style:{fontSize:"0.7875rem"},children:b?.type},b))}),children:e.jsx(L,{size:"small",variant:"filled",label:c("webhookEndpoint.eventsCount",{count:l.enabledEvents.length}),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx(P,{label:c("webhookEndpoint.version"),value:l.apiVersion,divider:!0}),e.jsx(P,{label:c("common.createdAt"),value:U(l.createdAt),divider:!0}),e.jsx(P,{label:c("common.updatedAt"),value:U(l.updatedAt),divider:!0}),e.jsx(P,{label:c("common.createdBy"),value:e.jsx($,{arrow:!0,title:l.createUser?.did,children:e.jsx(L,{size:"small",variant:"filled",label:l.createUser?.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx(P,{label:c("common.updatedBy"),value:e.jsx($,{arrow:!0,title:l.updateUser?.did,children:e.jsx(L,{size:"small",variant:"filled",label:l.updateUser?.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})})})]})})]}),e.jsxs(R,{className:"section",sx:{flex:1,height:0,overflow:"hidden"},children:[e.jsx(je,{title:c("webhookEndpoint.attempts"),mb:0,mt:4}),e.jsx(R,{sx:{height:0,flex:1,overflow:"hidden"},children:e.jsx(ye,{webhookEndpointId:l.id})})]})]})}we.propTypes={id:t.string.isRequired,onClose:t.func.isRequired};const ut=oe(R)``;function ke({open:i,onClose:u,id:c}){return e.jsx(Ue,{anchor:"right",open:i,onClose:u,slotProps:{paper:{sx:{width:"90vw",maxWidth:"1200px"}}},children:e.jsx(p,{sx:{height:"100vh",p:3},children:e.jsx(we,{id:c,onClose:u})})})}ke.propTypes={open:t.bool.isRequired,onClose:t.func.isRequired,id:t.string.isRequired};function re(){return null}function Ee({options:i={},columns:u=[],toolbar:c=!0,footer:f=!0,hasRowLink:r=!1,emptyNodeText:w="",durable:x="",durableKeys:j=[],data:l=[],loading:b=!1,...g}){const{locale:y}=M(),z=Ke(a=>a.breakpoints.down("md")),T={print:!1,download:!1,filter:!1,selectableRows:"none",rowsPerPage:z?5:10,rowsPerPageOptions:[5,10,20,50,100],searchDebounceTime:300,tableBodyHeight:"100%",loading:!0},n={};return c||(n.TableToolbar=re),f||(n.TableFooter=re),e.jsx(xt,{locale:y,options:{...T,...i},columns:(u||[]).map(a=>(a.options=a.options||{},a.options.filter=a.options.filter||!1,a.options.sort=a.options.sort||!1,a)),emptyNode:e.jsx(ve,{children:w}),...g,durable:x,durableKeys:j,data:l,loading:b,components:n,hasRowLink:r,isMobile:z})}Ee.propTypes={options:t.object,columns:t.array,toolbar:t.bool,footer:t.bool,hasRowLink:t.bool,emptyNodeText:t.node,durable:t.string,durableKeys:t.array,data:t.array,loading:t.bool,onChange:t.func,title:t.node,components:t.object};const xt=oe(Ce)``,ht=E.memo(Ee);function Pt(){const{teamDid:i}=V(),u=et(),c=`webhook-endpoints-${i}`,f=Se(c),{t:r,locale:w}=M(),{api:x}=K(),[j,l]=E.useState(""),[b,g]=E.useState({webhookDetail:{open:!1,id:null},createEdit:{open:!1,id:null,url:"",description:"",enabledEvents:[]},deleteConfirm:null}),[y,z]=Ie(c,{defaultValue:{pageSize:f.rowsPerPage||20,page:f.page?f.page+1:1}}),{loading:T,error:n,data:a,refresh:m}=le(()=>x.getWebhookEndpoints({input:{teamDid:i,paging:{page:y.page,pageSize:y.pageSize}}}));E.useEffect(()=>{m()},[y,m]);const v=E.useCallback(async(o,d)=>{try{await x.updateWebhookEndpoint({input:{teamDid:i,id:o.id,data:{status:d?"disabled":"enabled"}}}),m(),q.success(`${r(d?"webhookEndpoint.disable":"webhookEndpoint.enable")}${r("webhookEndpoint.success")}`)}catch(s){q.error(s?.message)}},[x,i,m,r]),S=E.useCallback(async o=>{try{await x.deleteWebhookEndpoint({input:{teamDid:i,id:o}}),m(),g(d=>({...d,deleteConfirm:null})),q.success(`${r("common.delete")}${r("webhookEndpoint.success")}`)}catch(d){q.error(d?.message)}},[x,i,m,r]),D=(o,d)=>{let s=o.page+1;const h=o.searchText||"";if(h!==j){l(h);return}if(d==="changePage"||d==="changeRowsPerPage"){d!=="changePage"&&(s=1);const k={page:s,pageSize:o.rowsPerPage};l(""),z(k)}};if(n)return e.jsx(te,{severity:"error",children:n.message});if(T||!a)return e.jsx(p,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:1,height:500},children:e.jsx(F,{})});const I=(a?.list||[]).filter(o=>{if(!j)return!0;const d=j.toLowerCase();return o.description.toLowerCase().includes(d)||o.url.toLowerCase().includes(d)}),O=[{label:"URL",name:"url",options:{customBodyRenderLite:(o,d)=>{const s=I[d];return e.jsxs(p,{sx:{display:"flex",alignItems:"center",cursor:"pointer",gap:.5},children:[e.jsx(C,{variant:"body2",children:s.description}),e.jsx(p,{sx:{display:"flex"},onClick:h=>{h.stopPropagation()},children:e.jsx($,{title:s.url,children:e.jsx(_,{sx:{fontSize:"15px",marginTop:"1px"}})})})]})}}},{label:"Events",name:"events",options:{customBodyRenderLite:(o,d)=>{const s=I[d];return e.jsx(p,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:s.enabledEvents.map(h=>e.jsx(L,{size:"small",variant:"filled",label:h.type,sx:{borderRadius:"4px",textTransform:"capitalize"}},`${s.source}-${h.type}`))})}}},{label:r("common.status"),name:"status",options:{customBodyRenderLite:(o,d)=>{const s=I[d];return e.jsx(L,{size:"small",variant:"filled",label:r(`webhookEndpoint.${s?.status}`),color:fe(s?.status),sx:{borderRadius:"4px",textTransform:"capitalize"}},`status-${s.status}`)}}},{label:r("common.createdAt"),name:"createdAt",minWidth:200,options:{customBodyRender:o=>U(o)}},{label:r("common.createdBy"),name:"createUser",width:100,options:{customBodyRender:o=>o?e.jsx(de,{showDid:!0,did:o?.did,cardType:ue.Detailed,infoType:pe.Minimal,sx:{border:0,padding:0}}):"-"}},{label:r("common.actions"),name:"actions",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRenderLite:(o,d)=>{const s=I[d],h=s?.status==="enabled";return e.jsx(nt,{actions:[{icon:h?e.jsx(Ve,{}):e.jsx(Ye,{}),text:r(h?"webhookEndpoint.disable":"webhookEndpoint.enable"),onClick:k=>{k.stopPropagation(),v(s,h)}},{icon:e.jsx(Je,{}),text:r("common.edit"),onClick:k=>{k.stopPropagation(),g(W=>({...W,createEdit:{open:!0,id:s.id,url:s.url,description:s.description,enabledEvents:s.enabledEvents}}))}},{icon:e.jsx(Qe,{}),text:r("common.delete"),onClick:k=>{k.stopPropagation(),g(W=>({...W,deleteConfirm:{title:r("webhookEndpoint.deleteWebhook.title"),description:r("webhookEndpoint.deleteWebhook.description"),confirm:r("common.confirm"),cancel:r("common.cancel"),onConfirm:()=>S(s.id),onCancel:()=>g(A=>({...A,deleteConfirm:null}))}}))}}]})}}}];return e.jsxs(p,{sx:{".custom-toobar-btns":{gap:"8px"},".custom-toobar-title .custom-toobar-title-inner>span":{display:"flex",alignItems:"center","white-space":"inherit",height:"100%"}},children:[u?e.jsx(ie,{title:r("webhookEndpoint.listTitle"),tooltipTitle:r("webhookEndpoint.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${w}/webhook`}):null,e.jsx(ht,{durable:c,durableKeys:["page","rowsPerPage"],data:I,columns:O,options:{count:a.count,page:y.page-1,rowsPerPage:y.pageSize,viewColumns:!1,onRowClick:(o,{dataIndex:d})=>{const s=a.list[d];g(h=>({...h,webhookDetail:{open:!0,id:s.id}}))}},loading:T,onChange:D,emptyNodeText:e.jsx(R,{sx:{gap:1},children:r("webhookEndpoint.noWebhooksAdded")}),title:u?null:e.jsx(ie,{title:r("webhookEndpoint.listTitle"),tooltipTitle:r("webhookEndpoint.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${w}/webhook`}),customButtons:[e.jsxs(H,{sx:{color:"common.white"},edge:"end",variant:"contained",color:"primary",onClick:()=>g(o=>({...o,createEdit:{...o.createEdit,open:!0}})),className:"rule-action",children:[T?e.jsx(F,{size:16}):e.jsx(Xe,{style:{fontSize:16}}),r("common.create")]},"add")]}),b.webhookDetail.open&&e.jsx(ke,{open:!0,onClose:()=>g(o=>({...o,webhookDetail:{open:!1,id:null}})),id:b.webhookDetail.id}),b.createEdit.open&&e.jsx(be,{onSubmit:m,...b.createEdit,onClose:()=>g(o=>({...o,createEdit:{id:null,url:"",description:"",enabledEvents:[],open:!1}}))}),b.deleteConfirm&&e.jsx(st,{title:b.deleteConfirm.title,description:b.deleteConfirm.description,confirm:b.deleteConfirm.confirm,cancel:b.deleteConfirm.cancel,params:b.deleteConfirm.params,onConfirm:b.deleteConfirm.onConfirm,onCancel:b.deleteConfirm.onCancel})]})}export{Pt as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t,at as r}from"./vendor-mui-core-DRxbhqaK.js";import{r as s}from"./vendor-react-Dvs43sk9.js";import{c as a}from"./vendor-ux-B9VfuZTg.js";import{r as n}from"./index-Dt8akALo.js";import"./vendor-utils-CUDP56Ff.js";import"./vendor-hooks-BlA8TRnZ.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-DeeG8u0h.js";function l(){const{t:o}=s.useContext(a);return t.jsx(i,{style:{paddingTop:"25vh"},children:t.jsx(n,{status:"404",description:o("noMatch.desc"),style:{backgroundColor:"transparent"}})})}const i=r.main``;export{l as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{r}from"./vendor-react-Dvs43sk9.js";import{j as o,a6 as b,am as D,ak as w,bb as L,at as H,W as x}from"./vendor-mui-core-DRxbhqaK.js";import{c as S,n as T,j as Y,k as z}from"./vendor-ux-B9VfuZTg.js";import{X as M,_ as N,B as P,$ as E,a0 as W}from"./index-Dt8akALo.js";import{n as _}from"./vendor-utils-CUDP56Ff.js";import{u as A}from"./team-s6q3vfNx.js";import{C as K}from"./confirm-D1n-RK65.js";import{P as X}from"./permission-ya4qYiIS.js";import{C as $}from"./click-to-copy-CO6UIqva.js";function q({invitations:a=[],onRefresh:v=_}){const{api:C,inService:d}=M(),{t,locale:y}=r.useContext(S),{teamDid:g,invitations:f,refresh:h,endpoint:l,roles:j}=A(),[i,m]=r.useState(null),[k,c]=r.useState(!1),s=r.useMemo(()=>a.length>0?a:f,[a,f]),I=async({inviteId:e})=>{if(!k){c(!0);try{await C.deleteInvitation({input:{teamDid:g,inviteId:e}}),h(),v?.(),await E(800)}catch(n){console.error(n)}finally{c(!1),m(null)}}},R=()=>{c(!1),m(null)},p=e=>l?W({inviteId:e.inviteId,endpoint:l}):"",B=[{label:t("team.inviting.link"),name:"inviteId",options:{sort:!1,customBodyRenderLite:e=>{const n=s[e];return l?o.jsx($,{children:p(n)}):o.jsx(b,{size:16})}}},{label:t("common.role"),name:"role",widtn:70,options:{sort:!1,customBodyRender:e=>{const n=j.find(u=>u.name===e);return n?.title?o.jsx(D,{title:e,children:n.title}):e||"--"}}},{label:t("common.remark"),name:"remark",options:{sort:!1,customBodyRender:e=>e||"--"}},{label:t("team.inviting.inviter"),name:"inviter.fullName",options:{sort:!1,customBodyRender:(e,{rowIndex:n})=>s[n]?.inviter?.fullName}},{label:t("common.expires"),name:"expireDate",options:{sort:!1,customBodyRender:e=>o.jsx(w,{children:N(e).format("YYYY-MM-DD HH:mm")})}},{label:t("common.actions"),name:"",width:100,align:"center",options:{sort:!1,customBodyRenderLite:e=>{const n=s[e];return o.jsx(X,{permission:d?"":"mutate_team",role:d?P:[],children:o.jsxs(T,{onClick:()=>m({title:t("team.inviting.delete.title"),description:t("team.inviting.delete.description",{link:p(n)}),confirm:t("common.delConfirm"),cancel:t("common.cancel"),onConfirm:()=>I(n),onCancel:R}),size:"small",color:"error",variant:"text",children:[o.jsx(L,{style:{fontSize:"1.2em"}}),t("common.delete")]})})}}}];return o.jsxs(F,{children:[s.length?o.jsx(Y,{locale:y,data:[...s],columns:B,verticalKeyWidth:100,options:{download:!1,filter:!1,print:!1,search:!1,viewColumns:!1}}):o.jsx(z,{sx:{minHeight:200},children:t("common.empty")}),i&&o.jsx(K,{title:i.title,description:i.description,confirm:i.confirm,cancel:i.cancel,params:i.params,onConfirm:i.onConfirm,onCancel:i.onCancel})]})}q.propTypes={invitations:x.array,onRefresh:x.func};const F=H.div`
|
|
2
|
-
margin-top: -20px;
|
|
3
|
-
`;export{q as I};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as i,ak as l}from"./vendor-mui-core-DRxbhqaK.js";import{i as x,r as w}from"./vendor-react-Dvs43sk9.js";import{b as g}from"./vendor-hooks-BlA8TRnZ.js";import{I as v}from"./invitation-BKbYsXkF.js";import{K as u}from"./landing-page-CQU5LiHu.js";import{T as I,y as k}from"./vendor-ux-B9VfuZTg.js";import{a as S,d as T,s as E,b as j,c as P,H as R}from"./index-Dt8akALo.js";import{g as W}from"./get-safe-url-BrBIp6RF.js";import{c as b}from"./passport-Di66zEMV.js";import"./vendor-utils-CUDP56Ff.js";import"./index-BZUEA_VO.js";import"./use-passport-id-B-b-_oYF.js";import"./session-Y3RU3I2O.js";import"./sdk-DlI_Utmi.js";import"./wrap-locale-DcfUdcYR.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-DeeG8u0h.js";import"./create-passport-svg-n0J1kwzH.js";function G(n){const c=x(),{searchParams:s}=new URL(window.location.href),{api:m,session:p}=S(),{t:d}=I(),r=s.get("inviteId"),a=s.get("redirect"),f=w.useCallback(async()=>{const{data:t}=await T.get("invitation",{params:{inviteId:r}});return t},[r]),h=g(async(t,o=e=>e)=>{t&&(E(o(t.sessionToken)),j(o(t.refreshToken)),t.visitorId&&k(o(t.visitorId))),await p.refresh(),setTimeout(()=>{if(a){const e=decodeURIComponent(a);e.startsWith(P.WELLKNOWN_SERVICE_PATH_PREFIX)?c(e,{replace:!0}):window.location.href=W(e)}else window.location.href=window.env.pathPrefix||"/"},50)});return i.jsxs(u,{did:window.blocklet?.appPid,children:[i.jsx(R,{children:i.jsxs("title",{children:[d("pageTitle.invite")," | ",window.blocklet?.appName]})}),i.jsx(l,{sx:{width:"560px",maxWidth:"100%",height:"100%"},className:"page-invite",children:i.jsx(v,{...n,getDataFn:f,checkFn:m.get,createPassportSvg:t=>b({...t}),onLoginSuccess:h,inService:!0})})]})}export{G as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as s,a6 as w,ak as x}from"./vendor-mui-core-DRxbhqaK.js";import{g as v,k,b as p}from"./vendor-hooks-BlA8TRnZ.js";import{I as T}from"./invitation-BKbYsXkF.js";import{K as I}from"./landing-page-CQU5LiHu.js";import{T as P,y as j}from"./vendor-ux-B9VfuZTg.js";import{a as R,s as S,b as E,c as N,H as W}from"./index-Dt8akALo.js";import{g as b}from"./get-safe-url-BrBIp6RF.js";import{c as C}from"./passport-Di66zEMV.js";import{i as F}from"./vendor-react-Dvs43sk9.js";import"./vendor-utils-CUDP56Ff.js";import"./index-BZUEA_VO.js";import"./use-passport-id-B-b-_oYF.js";import"./session-Y3RU3I2O.js";import"./sdk-DlI_Utmi.js";import"./wrap-locale-DcfUdcYR.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-DeeG8u0h.js";import"./create-passport-svg-n0J1kwzH.js";function Y(m){const{searchParams:r}=new URL(window.location.href),{api:a,session:f}=R(),d=F(),{t:h}=P(),n=r.get("id"),c=r.get("redirect"),u=v({state:""}),o=k(async()=>{if(!n)return null;const{data:t}=await a.get("/api/invitation",{params:{inviteId:n,mode:"issue-passport"}});return t}),l=p(()=>{if(o.error)throw o.error;return o?.data}),g=p(async(t,i=e=>e)=>{t&&(t.sessionToken&&S(i(t.sessionToken)),t.refreshToken&&E(i(t.refreshToken)),t.visitorId&&j(i(t.visitorId)),await f.refresh()),setTimeout(()=>{if(c){const e=decodeURIComponent(c);e.startsWith(N.WELLKNOWN_SERVICE_PATH_PREFIX)?d(e,{replace:!0}):window.location.href=b(e)}else window.location.href=window.env.pathPrefix||"/"},50)});return o.loading?s.jsx(w,{}):s.jsxs(I,{did:window.blocklet?.appPid,children:[s.jsx(W,{children:s.jsxs("title",{children:[h("pageTitle.issuePassport")," | ",window.blocklet?.appName]})}),s.jsx(x,{className:"page-invite",sx:{width:"560px",maxWidth:"100%",height:"100%"},children:s.jsx(T,{...m,action:"issue-passport",getDataFn:l,checkFn:a.get,createPassportSvg:C,onLoginSuccess:g,inService:!0,status:u.state})})]})}export{Y as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,T as v,a$ as b,D as I,J as T,ak as t}from"./vendor-mui-core-DRxbhqaK.js";import{x as B,g as E,L as P,$ as j,z as $}from"./vendor-ux-B9VfuZTg.js";import{a as A}from"./vendor-hooks-BlA8TRnZ.js";import{al as C}from"./index-Dt8akALo.js";function L({linkProps:s=void 0,showExtra:o=!1,...n}){return e.jsxs(v,{...n,children:["Powered by"," ",e.jsx(b,{href:"https://www.arcblock.io",target:"_blank",...s,children:"ArcBlock"}),"'s"," ",e.jsx(b,{href:"https://www.blocklet.io",target:"_blank",...s,children:"Blocklet Technology"}),o?", the decentralized web engine.":null]})}function W({did:s,children:o,title:n=void 0,description:a=void 0,actions:m=void 0,logo:i=void 0,logoSize:d=50,poweredBy:x=void 0,termsOfUse:g=void 0,standalone:y=!1}){const r=globalThis?.blocklet||globalThis?.env||{},{palette:f}=I(),c=T(l=>l.breakpoints.down("lg")),w=C({meta:r}),k=A(()=>{const l=r.appPid,u=B.isEthereumDid(l),D=u?void 0:E(l);return u?P(l):D.color},[r?.appPid]);if(!s)return o;n===void 0&&(n=r.appName),a===void 0&&(a=r.appDescription),i===void 0&&(i=w||""),typeof i=="string"&&(i?i=e.jsx(t,{sx:{height:d,maxHeight:d,objectFit:"contain"},component:"img",src:i,alt:`${r.appName}'s logo`}):i=e.jsx(j,{size:d,did:s,src:i,variant:"rounded"})),x===void 0&&(x=e.jsx(L,{linkProps:{color:f.text.secondary,sx:{"&:hover":{textDecoration:"underline"}}},showExtra:!c,sx:{textAlign:"center",fontSize:"12px",color:"text.secondary"}}));let p=o;!o&&!c&&(p=e.jsx(t,{sx:{filter:"blur(180px)",display:"flex"},children:e.jsx(j,{size:210,did:s,variant:"rounded"})}));const z=!!o;let h=!y;return c&&(h=!z),e.jsxs(t,{sx:{width:"100%",minHeight:"100vh",display:"flex",justifyContent:"center",alignItems:"center",px:{xs:2,sm:4,md:8},pt:{xs:2,sm:4,md:6},pb:{xs:5,md:8},background:`radial-gradient(circle at bottom right, ${$(k,.3)} 10%, ${f.background.default} 50%)`,position:"relative"},children:[e.jsxs(t,{sx:{maxWidth:1200,display:"flex",alignItems:"center",justifyContent:[h,p].filter(Boolean).length>1?"space-between":"center",width:"100%",margin:"auto"},children:[h?e.jsxs(t,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[e.jsx(t,{sx:{display:"flex",alignItems:"center"},children:i}),e.jsx(v,{variant:"h2",sx:{fontWeight:"bold",fontSize:{sm:"2.25rem",md:"2.75rem",xl:"3.5rem"}},children:n}),a?e.jsx(t,{sx:{mb:2,color:"text.secondary"},children:a}):null,m?e.jsx(t,{sx:{mt:8},children:m}):null,g?e.jsx(t,{sx:{mt:-1,color:"grey"},children:g}):null]}):null,p]}),e.jsx(t,{sx:{position:"absolute",zIndex:10,bottom:10,left:10,right:10,textAlign:"center"},children:x})]})}export{W as K};
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import{r as i}from"./vendor-react-Dvs43sk9.js";import{j as t,b4 as _,W as n,D as F,n as xe,b0 as ye,co as be,cu as ve,cv as je,cw as we,ak as g,T as q,Q as ke,a$ as te,a3 as Ie,s as Me,J as Re,I as Ce,at as Ae}from"./vendor-mui-core-DRxbhqaK.js";import{a as D,b as O,h as Te}from"./vendor-hooks-BlA8TRnZ.js";import{T as Q,I as Ne,P as ne,c as re,S as $e}from"./vendor-ux-B9VfuZTg.js";import{t as Se}from"./server-logo-notext.svg-CKQB0tIp.js";import{B as Le}from"./bundle-avatar-D5n6XSFF.js";import{a as ze,g as se,i as oe,b as ie,c as V,M as ae,d as Ee,m as De,e as Be,f as Pe,h as qe,j as Ve,k as _e,l as Fe,n as Oe,N as He}from"./team-s6q3vfNx.js";import{R as Ue,J as We,C as X,a as H}from"./vendor-utils-CUDP56Ff.js";import{c as Qe,X as Xe}from"./index-Dt8akALo.js";import{B as Je,o as Ke,l as Ge}from"./index-BFBoLr1Z.js";import{p as Ye}from"./util-DDkRAi85.js";function le({blocklet:e,style:r={},size:s=40,...o}){const l=ze({blocklet:e,square:!0}),{variant:u}=o;return t.jsx(_,{variant:u||"square",style:Object.assign({backgroundColor:"transparent",width:s,height:s,borderRadius:10},r),...o,children:t.jsx("img",{src:l,alt:"",style:{width:s}})})}le.propTypes={blocklet:n.object.isRequired,style:n.object,size:n.oneOfType([n.number,n.string])};function Ze(e){return e.includes(" ")?new Date(e.replace(" ","T").replace(" ","")).getTime():new Date(e).getTime()}function J({value:e="",shouldUpdate:r=!1,...s}){const{locale:o}=Q(),[l,u]=i.useState(0);if(i.useEffect(()=>{let d;if(r){const p=new Date(e).getTime(),y=Date.now(),v=Math.abs(Math.floor((p-y)/1e3)),b=()=>{u(k=>{const C=Math.random()*1e3;return parseFloat((k+C).toFixed(4))})};v<60?d=setInterval(b,1e3):v<60*60?d=setInterval(b,6e4):d=setInterval(b,36e5)}return()=>{clearInterval(d)}},[e,l,r]),!e)return"-";const m=Ze(e);return t.jsx(Ne,{value:m,locale:o,...s})}J.propTypes={value:n.any,shouldUpdate:n.bool};const et={error:je,warning:ve,info:be,success:ye};ce.propTypes={severity:n.oneOf(["error","warning","info","success"]).isRequired,size:n.number};function ce({severity:e="info",size:r=32}){const s=F(),l=D(()=>({error:s.palette.error.main,warning:s.palette.warning.main,info:s.palette.info.main,success:s.palette.success.main}))[e],u=et[e],m=xe(l,.1);return t.jsx(_,{sx:{width:r,height:r,bgcolor:m,color:l},children:t.jsx(u,{fontSize:"small"})})}const tt={width:24,height:24,body:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M0 0h24v24H0z"/><path fill="currentColor" d="M5.821 4.91c3.898-2.765 9.469-2.539 13.073.536c3.667 3.127 4.168 8.238 1.152 11.897c-2.842 3.447-7.965 4.583-12.231 2.805l-.232-.101l-4.375.931l-.075.013l-.11.009l-.113-.004l-.044-.005l-.11-.02l-.105-.034l-.1-.044l-.076-.042l-.108-.077l-.081-.074l-.073-.083l-.053-.075l-.065-.115l-.042-.106l-.031-.113l-.013-.075l-.009-.11l.004-.113l.005-.044l.02-.11l.022-.072l1.15-3.451l-.022-.036C.969 12.45 1.97 7.805 5.59 5.079l.23-.168z"/></g>'},nt={width:24,height:24,body:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M0 0h24v24H0z"/><path fill="currentColor" d="M12 2a5 5 0 1 1-5 5l.005-.217A5 5 0 0 1 12 2zm2 12a5 5 0 0 1 5 5v1a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-1a5 5 0 0 1 5-5h4z"/></g>'},rt={width:24,height:24,body:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M0 0h24v24H0z"/><path fill="currentColor" d="M17 3.34A10 10 0 1 1 2 12l.005-.324A10 10 0 0 1 17 3.34zM12 6a1 1 0 0 0-1 1a3 3 0 1 0 0 6v2a1.024 1.024 0 0 1-.866-.398l-.068-.101a1 1 0 0 0-1.732.998a3 3 0 0 0 2.505 1.5H11a1 1 0 0 0 .883.994L12 18a1 1 0 0 0 1-1l.176-.005A3 3 0 0 0 13 11V9c.358-.012.671.14.866.398l.068.101a1 1 0 0 0 1.732-.998A3 3 0 0 0 13.161 7H13a1 1 0 0 0-1-1zm1 7a1 1 0 0 1 0 2v-2zm-2-4v2a1 1 0 0 1 0-2z"/></g>'},st={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M8 12a4 4 0 1 0 8 0a4 4 0 1 0-8 0"/><path d="M16 12v1.5a2.5 2.5 0 0 0 5 0V12a9 9 0 1 0-5.5 8.28"/></g>'},ot={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m15 10l-4 4l6 6l4-16l-18 7l4 2l2 6l3-4"/>'},Z={comment:{icon:tt,bgColor:"rgba(239, 246, 255, 1)",color:"rgba(43, 127, 255, 1)"},like:{icon:"👍",bgColor:"rgba(244, 244, 245, 1)",color:"yellow",renderType:"emoji"},follow:{icon:nt,bgColor:"rgba(238, 242, 255, 1)",color:"rgba(97, 95, 255, 1)"},tips:{icon:rt,bgColor:"rgba(254, 252, 232, 1)",color:"rgba(240, 177, 0, 1)"},mention:{icon:st,bgColor:"rgba(244, 244, 245, 1)",color:"rgba(43, 127, 255, 1)"},assign:{icon:ot,bgColor:"rgba(244, 244, 245, 1)",color:"rgba(43, 127, 255, 1)"}};de.propTypes={activity:n.oneOf(["comment","like","follow","tips","mention","assign"]).isRequired,size:n.number};function de({activity:e,size:r=32}){const s=Z[e]||Z.comment,o=s.icon;return t.jsx(_,{sx:{bgcolor:s.bgColor,color:s.color,width:r,height:r},children:s.renderType==="emoji"?t.jsx("span",{style:{fontSize:"14px"},children:o}):t.jsx(ne,{icon:o})})}const U={avatar:n.string,fullName:n.string,did:n.string};function W({actor:e,size:r,teamDid:s="",inService:o=!1,showName:l=!1}){const u=D(()=>({...e,avatar:e?.avatar?Ye(e.avatar,s,o):null}),[e,s,o]),m=d=>{e&&(d.stopPropagation(),window.open(We(X(Qe.WELLKNOWN_SERVICE_PATH_PREFIX,"user"),{did:e.did}),"_blank"),d.customPreventRedirect=!0)};return t.jsxs(g,{onClick:m,role:"button",style:{cursor:"pointer"},title:e?.fullName||"",sx:{display:"flex",alignItems:"center",gap:1},children:[u.avatar?t.jsx(Je,{user:u,showDid:!0,cardType:Ge.AvatarOnly,infoType:Ke.Minimal,avatarSize:r,shape:"circle",sx:{width:r,height:r,borderRadius:"100%",overflow:"hidden",transition:"transform 0.2s ease-in-out","&:hover":{transform:"scale(1.1)"}}}):t.jsx(_,{sx:{width:r,height:r}}),l&&t.jsx("span",{children:e?.fullName})]})}W.propTypes={actor:n.shape(U).isRequired,size:n.number.isRequired,teamDid:n.string,inService:n.bool,showName:n.bool};K.propTypes={actors:n.oneOfType([n.shape(U),n.arrayOf(n.shape(U))]).isRequired,size:n.number,maxDisplay:n.number,teamDid:n.string,inService:n.bool,showName:n.bool,avatarFallback:n.node};function K({actors:e,size:r=32,maxDisplay:s=9,teamDid:o="",inService:l=!0,showName:u=!1,avatarFallback:m=null}){const d=D(()=>{const p=Array.isArray(e)?e:[e];return Ue(p,"did").filter(Boolean)},[e]);return d.length===1||!d.length?t.jsx(W,{actor:d[0],size:r,teamDid:o,inService:l,showName:u}):t.jsx(we,{total:d.length,renderSurplus:p=>p<100?t.jsxs("span",{children:["+",p]}):t.jsx("span",{children:"99+"}),max:s,sx:{justifyContent:"flex-end",height:`${r}px`,".MuiAvatar-root":{width:`${r}px`,height:`${r}px`,fontSize:`${r/2.5}px`,border:0,zIndex:2}},children:d.map((p,y)=>p?.avatar?t.jsx(W,{actor:p,size:r,teamDid:o,inService:l},p?.did||y):m)})}const ee=3;pe.propTypes={notification:n.object.isRequired,isMultiple:n.bool,blocklet:n.object,mountPoint:n.string,avatarFallback:n.node};ue.propTypes={notification:n.object.isRequired,mountPoint:n.string};he.propTypes={items:n.array.isRequired,activity:n.object.isRequired,blocklet:n.object,mountPoint:n.string,viewMoreLink:n.string,avatarFallback:n.node};function ue({notification:e,mountPoint:r=""}){const{activity:s}=e,{type:o,meta:l={}}=s||{},u=ie({activity:s,users:[e?.actorInfo],actors:[e?.activity?.actor],mountPoint:r});return H(s)||!s.type||!s.actor||H(s.target)?null:t.jsxs(g,{children:[t.jsx(q,{variant:"body1",sx:{color:"text.secondary",mb:.5,wordBreak:"break-all"},children:u}),l?t.jsx(ae,{meta:l,type:o}):null]})}function he({items:e,activity:r,blocklet:s,mountPoint:o="",viewMoreLink:l="",avatarFallback:u=null}){const m=F(),{t:d}=Q(),p=D(()=>s?.did||s?.meta?.did||"",[s]),{locale:y}=i.useContext(re),v=D(()=>!H(r.meta)&&Object.values(r.meta).some(a=>a!=null),[r]),b=ie({activity:r,users:e.map(a=>a?.actorInfo),actors:e.map(a=>a?.activity?.actor),mountPoint:o}),k=O(a=>{if(!a.activity)return null;const x=se(a.activity);return x?.metaLink?oe(x?.metaLink)?x?.metaLink:X(o,x.metaLink):null}),C=O((a,x)=>{if(!x)return;const h=k(x);h&&(window.open(h,"_blank"),a.customPreventRedirect=!0)}),$=e.length>ee,w=e.slice(0,ee);return t.jsxs(g,{sx:{width:"100%"},children:[t.jsx(q,{variant:"body1",sx:{color:"text.secondary",mb:3},children:b}),v?t.jsxs(g,{className:"sub-content",sx:{display:"flex",flexDirection:"column",gap:3},children:[w.map(a=>t.jsxs(g,{onClick:x=>C(x,a),sx:{display:"flex",flexDirection:"column",gap:1},children:[t.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[V(a)?t.jsx(K,{actors:a.actorInfo,size:32,teamDid:p}):u,t.jsx(q,{variant:"subtitle1",sx:{color:"text.primary"},children:V(a)?a?.actorInfo?.fullName:"System"})," ","·",t.jsx(J,{value:a.createdAt,locale:y,shouldUpdate:!0,style:{color:m.palette.text.secondary,fontSize:"0.875rem",minWidth:"50px",whiteSpace:"nowrap"}})]}),a.activity.meta?t.jsx(g,{sx:{pl:5},children:t.jsx(ae,{meta:a.activity.meta,type:a.activity.type})}):null]},a.id)),$&&l?t.jsx(g,{sx:{mt:1,display:"flex",justifyContent:"center"},children:t.jsxs(ke,{size:"large",variant:"text",component:te,href:l,target:"_blank",rel:"noopener noreferrer",onClick:a=>{a.customPreventRedirect=!0},children:[d("notification.viewMore")," ",t.jsx(ne,{icon:Ee,style:{marginLeft:4}})]})}):null]}):null]})}function pe({notification:e,isMultiple:r=!1,blocklet:s,mountPoint:o="",avatarFallback:l}){const u=D(()=>{if(!e.activity)return null;const m=se(e.activity);return m?.targetLink?oe(m?.targetLink)?m?.targetLink:X(o,m.targetLink):null},[e.activity,o]);return r?t.jsx(he,{items:e.items,activity:e.activity,blocklet:s,mountPoint:o,viewMoreLink:u,avatarFallback:l}):t.jsx(ue,{notification:e,mountPoint:o})}function me({notification:e}){const r=i.useMemo(()=>{const{actions:s,action:o}=e;let l=s??[];return!l.length&&o&&(l=[{name:"Visit",link:o}]),l},[e]);return r.length?t.jsx(g,{sx:{display:"flex",justifyContent:"start",flexWrap:"wrap",alignItems:"center",gap:1},children:r.map((s,o)=>t.jsxs(i.Fragment,{children:[t.jsx(te,{href:s.link,target:"_blank",className:"link",rel:"noopener noreferrer",sx:{fontSize:"15px"},onClick:l=>{l.customPreventRedirect=!0},children:s.name},s.link),o<r.length-1?t.jsx(Ie,{orientation:"vertical",sx:{height:12,borderWidth:"1px"}}):null]},s.link))}):null}me.propTypes={notification:n.object.isRequired};const it=Me(g)`
|
|
2
|
-
display: flex;
|
|
3
|
-
justify-content: center;
|
|
4
|
-
align-items: center;
|
|
5
|
-
flex-direction: column;
|
|
6
|
-
height: 100%;
|
|
7
|
-
min-height: 500px;
|
|
8
|
-
color: #999;
|
|
9
|
-
.empty-icon {
|
|
10
|
-
margin: 10px 0;
|
|
11
|
-
}
|
|
12
|
-
`;function fe({children:e=null,...r}){const s=Xe(),l=F().palette.mode==="dark";return t.jsxs(it,{...r,children:[t.jsx("img",{src:`${s.imgPrefix}/${l?"all-done-dark":"all-done-light"}.svg`,alt:"All Done",width:120,height:120,style:{maxHeight:"100%",maxWidth:"100%"},onError:u=>{u.target.style.display="none"}}),t.jsx(g,{className:"empty-content",children:e})]})}fe.propTypes={color:n.string,children:n.any};at.propTypes={data:n.array,blockletMap:n.object,onReadBatch:n.func,inDialog:n.bool,highlightId:n.string,highlight:n.bool,type:n.oneOf(["server","service"])};ge.propTypes={notification:n.object,blocklet:n.object,onReadBatch:n.func,inDialog:n.bool,highlight:n.bool};P.propTypes={blocklet:n.object,size:n.number,showName:n.bool,hideDot:n.bool};function P({blocklet:e,size:r=40,showName:s=!1,hideDot:o=!1}){const l=e?.did||e?.meta?.did||"",u=(e?.alsoKnownAs||[]).concat(e?.appId||e?.appDid||e?.appPid||"");return t.jsxs(g,{className:"component-avatar",sx:{display:"flex",alignItems:"center",gap:o?"8px":"4px"},children:[!o&&t.jsx("span",{className:"dot"}),e?t.jsx(g,{children:u.includes(l)?t.jsx(le,{blocklet:e,size:r,style:{borderRadius:8}}):t.jsx(Le,{blocklet:e,ancestors:e.ancestors??[],size:r,style:{borderRadius:8}})}):t.jsx(Se,{width:r,height:r}),s&&t.jsx("span",{className:"component-name",children:e?.meta?.title})]})}function ge({notification:e,blocklet:r,onReadBatch:s=()=>{},inDialog:o=!1,highlight:l}){const{locale:u}=i.useContext(re),m=F(),d=Re(h=>h.breakpoints.down("md")),p=i.useRef(null),y=i.useMemo(()=>qe(e),[e]),v=i.useMemo(()=>Ve(e),[e]),b=i.useMemo(()=>V(e),[e]),k=i.useMemo(()=>e.items||[],[e]),C=i.useMemo(()=>k.length>0,[k]),$=i.useMemo(()=>v?C?k.map(h=>V(h)?h.actorInfo:{did:h.activity?.actor}).filter(Boolean):e.actorInfo??[]:[],[k,e.actorInfo,C,v]),w=i.useMemo(()=>r?.did||r?.meta?.did||"",[r]),a=i.useMemo(()=>_e(w,window.blocklet),[w]),x=O((h,S)=>{const A=Fe(h);if(A.length&&s(A.map(R=>R.id)),S&&!S.customPreventRedirect){const R=Oe(h,a);R&&typeof R=="string"&&window.open(R,"_blank","noopener,noreferrer")}});return t.jsxs(lt,{ref:p,className:"notification-row",id:e.id,isRead:y,inDialog:o,highlight:l,isMd:d,onClick:h=>x(e,h),children:[v?t.jsx(de,{activity:e.activity.type,size:d?24:32}):t.jsx(ce,{severity:e.severity,size:d?24:32}),t.jsxs(g,{className:"notification",sx:{display:"flex",flexDirection:"column",alignItems:"start"},children:[t.jsxs(g,{className:"header",sx:{width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center",gap:1,mb:1.5},children:[v&&b?t.jsx(K,{actors:$,teamDid:w,size:d?24:32,avatarFallback:t.jsx(P,{blocklet:r,hideDot:!0,size:d?24:32})}):t.jsx(P,{blocklet:r,hideDot:!0,size:d?24:32}),t.jsx(J,{value:e.createdAt,locale:u,shouldUpdate:!0,style:{color:m.palette.text.secondary,fontSize:"0.875rem",minWidth:"50px",whiteSpace:"nowrap"}})]}),v?t.jsx(pe,{notification:e,isMultiple:C,blocklet:r,mountPoint:a,avatarFallback:t.jsx(P,{blocklet:r,hideDot:!0,size:d?24:32})}):t.jsxs(t.Fragment,{children:[t.jsx(q,{variant:"body1",className:"title",sx:{color:"rgba(24, 24, 27, 1)",mt:0,mb:.5},children:e.title}),t.jsx(He,{notification:e,rows:o?0:2})]}),t.jsx(me,{notification:e})]}),e?.description&&e.severity==="error"&&t.jsx(g,{className:"copy-button",children:t.jsx(Ce,{size:"small",children:t.jsx($e,{sx:{fontSize:22},content:e?.description||""})})})]})}function at({data:e,blockletMap:r,onReadBatch:s=()=>{},inDialog:o=!1,highlightId:l,highlight:u=!1,type:m="service"}){const{t:d}=Q(),p=i.useRef(null),[y,v]=i.useState(!1),[b,k]=i.useState(!0),[C,$]=i.useState(!1),w=i.useRef(new Set),a=i.useRef(new Set),x=i.useRef(null),h=i.useRef(null),S=i.useRef(!1),A=i.useRef(null),R=i.useMemo(()=>o?e?.slice(0,5):e,[o,e]),L=i.useMemo(()=>De(R),[R]),z=i.useMemo(()=>{const c=new Map;return L&&L.length&&L.forEach(f=>{c.set(f.id,f)}),c},[L]);i.useEffect(()=>{const c=()=>{k(document.visibilityState==="visible")};return document.addEventListener("visibilitychange",c),()=>{document.removeEventListener("visibilitychange",c)}},[]);const B=i.useCallback(()=>{if(!o&&w.current.size>0){const c=[];w.current.forEach(f=>{if(a.current.has(f))return;const I=z.get(f);if(I){const{receivers:T=[],items:N=[]}=I;if(T.length&&!T[0].read&&(c.push(f),a.current.add(f),N.length>0&&N.forEach(j=>{const M=j.id;M&&!a.current.has(M)&&(c.push(M),a.current.add(M))}),h.current)){const j=document.getElementById(f);j&&h.current.unobserve(j)}}}),c.length>0&&(s(c),setTimeout(()=>{v(!1)},300)),w.current.clear()}},[o,z,s]),G=i.useCallback(()=>{A.current&&clearTimeout(A.current),A.current=setTimeout(()=>{B()},50)},[B]),E=i.useCallback(()=>{if(o||!p.current||!b)return;h.current&&h.current.disconnect();const c={root:null,rootMargin:"0px",threshold:.5},f=new IntersectionObserver(T=>{y&&T.forEach(N=>{const j=N.target.id;if(a.current.has(j))return;const M=z.get(j);if(M){const{receivers:Y=[]}=M;Y.length&&!Y[0].read&&(N.isIntersecting?(w.current.add(j),G()):w.current.delete(j))}})},c);h.current=f,Array.from(p.current.querySelectorAll(".notification-row")).filter(T=>{const N=T.id;if(a.current.has(N))return!1;const j=z.get(N);if(j){const{receivers:M=[]}=j;return M.length&&!M[0].read}return!1}).forEach(T=>{f.observe(T)}),S.current=!1},[y,o,b,z,G]);return i.useEffect(()=>{o||(S.current=!0,h.current&&b&&y&&setTimeout(()=>{E()},0))},[R,y,b,E,o]),i.useEffect(()=>{if(o||!p.current||!b)return;let c=window;if(m==="server"&&(c=document.getElementById("arc__dashboard-main")),!c){const I=document.getElementsByClassName("dashboard-main")[0];I&&(c=I)}if(!c)return;const f=I=>{I.isTrusted&&(y||v(!0),$(!0),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{$(!1),B(),S.current&&E()},300))};return c.addEventListener("scroll",f,{passive:!0}),()=>{c.removeEventListener("scroll",f),x.current&&clearTimeout(x.current),A.current&&clearTimeout(A.current)}},[o,y,b,B,E,m]),i.useEffect(()=>(o||E(),()=>{h.current&&h.current.disconnect()}),[E,o]),Te(()=>{setTimeout(()=>{const c=Be(p.current),f=Pe(z,c);s(f.map(I=>I.id))},100)}),L?.length?t.jsx(g,{ref:p,sx:{display:"flex",flexDirection:"column",...o?{maxHeight:"calc(-200px + 100vh)",overflow:"auto"}:{}},children:L?.map(c=>{const f=c.source==="system"?r.get(c.entityId||c.sender):r.get(c.componentDid||c.sender);return c?.type?.toLowerCase()==="passthrough"?null:t.jsx(ge,{highlight:u&&l===c.id,inDialog:o,notification:c,blocklet:f,onReadBatch:s},c.id)})}):t.jsx(fe,{children:d("notification.allDone")})}const lt=Ae(g)`
|
|
13
|
-
@keyframes flash-bg {
|
|
14
|
-
0% {
|
|
15
|
-
background-color: ${e=>e.theme.palette.warning.light};
|
|
16
|
-
}
|
|
17
|
-
100% {
|
|
18
|
-
background-color: unset;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
position: relative;
|
|
22
|
-
display: flex;
|
|
23
|
-
align-items: flex-start;
|
|
24
|
-
gap: ${e=>e.isMd?e.theme.spacing(1):e.theme.spacing(1.5)};
|
|
25
|
-
padding: ${e=>e.isMd?`${e.theme.spacing(2)} 0`:e.theme.spacing(3)};
|
|
26
|
-
cursor: pointer;
|
|
27
|
-
animation: ${e=>e.highlight?"flash-bg 3s ease-out 0s 1 normal none running":"none"};
|
|
28
|
-
background-color: ${e=>e.isRead?"transparent":e.theme.palette.grey[100]};
|
|
29
|
-
border-bottom: 1px solid;
|
|
30
|
-
border-color: ${({theme:e})=>e.palette.grey[200]};
|
|
31
|
-
&:last-child {
|
|
32
|
-
border-bottom: none;
|
|
33
|
-
}
|
|
34
|
-
&:hover {
|
|
35
|
-
background-color: ${e=>e.theme.palette.action.hover};
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.copy-button {
|
|
39
|
-
position: absolute;
|
|
40
|
-
right: ${e=>e.inDialog?e.theme.spacing(2):"0"};
|
|
41
|
-
top: ${e=>e.inDialog?e.theme.spacing(5):e.theme.spacing(4)};
|
|
42
|
-
display: none;
|
|
43
|
-
background: ${e=>e.theme.palette.action.disabledBackground};
|
|
44
|
-
border-radius: 50%;
|
|
45
|
-
svg {
|
|
46
|
-
width: ${e=>e.theme.spacing(2.25)};
|
|
47
|
-
height: ${e=>e.theme.spacing(2.25)};
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
&:hover {
|
|
51
|
-
.copy-button {
|
|
52
|
-
display: block;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.component-avatar {
|
|
57
|
-
.dot {
|
|
58
|
-
width: ${e=>e.theme.spacing(1)};
|
|
59
|
-
height: ${e=>e.theme.spacing(1)};
|
|
60
|
-
border-radius: 50%;
|
|
61
|
-
background-color: ${e=>e.theme.palette.primary.main};
|
|
62
|
-
visibility: ${e=>e.isRead?"hidden":"visible"};
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.notification {
|
|
67
|
-
width: calc(100% - ${e=>e.theme.spacing(6.25)});
|
|
68
|
-
|
|
69
|
-
> .header {
|
|
70
|
-
width: 100%;
|
|
71
|
-
@media (min-width: 900px) {
|
|
72
|
-
.title {
|
|
73
|
-
max-width: calc(100vw - ${e=>e.theme.spacing(50)});
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
@media (min-width: 1200px) {
|
|
77
|
-
.title {
|
|
78
|
-
max-width: ${e=>e.theme.spacing(102.5)};
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
@media (max-width: 900px) {
|
|
82
|
-
.title {
|
|
83
|
-
max-width: calc(100vw - ${e=>e.theme.spacing(25)});
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.title {
|
|
89
|
-
min-width: 0;
|
|
90
|
-
max-width: 100%;
|
|
91
|
-
overflow: hidden;
|
|
92
|
-
text-overflow: ellipsis;
|
|
93
|
-
white-space: nowrap;
|
|
94
|
-
color: ${e=>e.theme.palette.text.primary};
|
|
95
|
-
font-size: ${e=>e.theme.typography.fontSize*1.15}px;
|
|
96
|
-
}
|
|
97
|
-
.link {
|
|
98
|
-
color: ${e=>e.theme.palette.primary.main};
|
|
99
|
-
font-size: ${e=>e.theme.typography.fontSize}px;
|
|
100
|
-
text-decoration: none;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
`;export{K as A,le as B,at as N,J as R,P as S,pe as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./vendor-mui-core-DRxbhqaK.js";import"./vendor-react-Dvs43sk9.js";import{S as t}from"./studio-UxYOr-dB.js";import"./vendor-ux-B9VfuZTg.js";import"./vendor-utils-CUDP56Ff.js";import"./vendor-hooks-BlA8TRnZ.js";import"./lottie-web-4koyQiv_.js";import"./index-DuO31sai.js";import"./index-Dt8akALo.js";import"./vendor-arcblock-DeeG8u0h.js";function f(){return o.jsx(t,{children:"Coming soon..."})}export{f as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,d as o}from"./vendor-ux-B9VfuZTg.js";const c=e("blocklet-services");o("blocklet-services");export{c as d};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,ak as p,T as I,W as c,am as K,Q as $,bH as de,a6 as pe}from"./vendor-mui-core-DRxbhqaK.js";import{f as fe,a as ue,b as ge,h as me}from"./vendor-hooks-BlA8TRnZ.js";import{r as J,i as he}from"./vendor-react-Dvs43sk9.js";import{a as we,a5 as xe,Q as ye,c as L,aq as Pe,H as F,s as ke,b as ve,$ as O,ar as je,as as be}from"./index-Dt8akALo.js";import{C as W,b as _,J as Ie,c as Te}from"./vendor-utils-CUDP56Ff.js";import{o as Ce}from"./vendor-arcblock-DeeG8u0h.js";import{$ as Le,f as _e,T as X,A as B,e as Re,B as We,C as Ae,H as M,y as Ee,D as z}from"./vendor-ux-B9VfuZTg.js";import{u as Ne}from"./use-passport-id-B-b-_oYF.js";import{g as V}from"./get-safe-url-BrBIp6RF.js";import{d as R}from"./logger-DVbuTPin.js";import"./lottie-web-4koyQiv_.js";function G({blocklet:a=window.blocklet}){return e.jsxs(p,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(Le,{variant:"rounded",shape:"square",did:a.appPid,src:a.appLogo,size:80}),e.jsx(I,{component:"h2",variant:"h6",children:a.appName}),e.jsx(_e,{did:a.appPid})]})}const Se=J.memo(G);G.propTypes={blocklet:c.shape({appName:c.string,appLogo:c.string,appPid:c.string})};const Ue=()=>window.blocklet?.componentMountPoints?.find(s=>s.did==="z2qaCNvKMv5GjouKdcDWexv6WqtHbpNPQDnAk")?.mountPoint;function Y({children:a=null,cta:s=null,...i}){return e.jsxs(p,{...i,children:[a?e.jsx(p,{sx:{maxHeight:"50vh",overflow:"hidden",position:"relative",":after":{content:'""',position:"absolute",left:0,right:0,bottom:0,height:"80%",background:"linear-gradient(transparent, #fff 85%)"}},children:a}):null,s?e.jsx(p,{sx:{display:"flex",flexDirection:"column",alignItems:"center",py:4,borderRadius:2},children:s}):null]})}Y.propTypes={children:c.node,cta:c.node};function Z({passports:a=[],onConnect:s=()=>{},redirect:i,...y}){const{t:f}=X(),P=Ue(),k=l=>{const g=l?.payable;return P&&g?W(P,`/api/redirect/checkout/${g}?redirect=${i}`):null};return e.jsxs(p,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,minHeight:"100vh",maxWidth:"400px",margin:"auto",paddingBottom:{sx:0,md:15}},children:[e.jsx(Se,{}),e.jsx(Y,{...y,cta:e.jsxs(e.Fragment,{children:[e.jsx(I,{variant:"h4",sx:{mx:2,textAlign:"center",fontWeight:"bold",color:"warning.main"},children:f("login.accessLimit.title")}),e.jsx(I,{variant:"body1",sx:{maxWidth:620,mt:2,mx:2,textAlign:"center",color:"gray"},children:f("login.accessLimit.description")}),e.jsx(p,{sx:{display:"flex",flexWrap:"wrap",justifyContent:"center",gap:1,mt:5},children:a?.map(l=>{const g=k(l);return g?e.jsx(K,{title:f("login.accessLimit.buyPassport"),arrow:!0,placement:"top",children:e.jsx($,{color:"primary",variant:"contained",endIcon:e.jsx(de,{}),href:g,target:"_blank",children:l.title||l.name})},l.name):e.jsx(K,{title:f("login.connectWithPassport"),arrow:!0,placement:"top",children:e.jsx($,{color:"inherit",variant:"contained",onClick:s,children:l.title||l.name})},l.name)})}),e.jsxs(I,{variant:"body1",sx:{mt:2,color:"grey.400"},children:[e.jsx(p,{component:"span",sx:{display:"inline-block",mr:1},children:f("login.accessLimit.alreadyHavePassport")}),e.jsx(p,{component:"span",sx:{textDecoration:"underline",cursor:"pointer",color:"primary.main"},onClick:s,children:f("common.connect")})]})]})})]})}Z.propTypes={passports:c.arrayOf(c.shape({name:c.string.isRequired,title:c.string,payable:c.string})),onConnect:c.func,onClose:c.func,redirect:c.string.isRequired};function Ve(){const a=J.useRef(null),{session:s}=we(),{t:i,locale:y}=X(),{getPassportId:f}=Ne(),P=he(),k=B(),l=Re(),{encryptKey:g,decrypt:ee}=xe(),v=fe(s),{searchParams:o}=new URL(window.location.href),m={passportId:f()},A=o.get("componentId"),E=o.get("authenticated"),ne=o.get("sessionToken"),te=o.get("refreshToken"),oe=o.get("requiredRoles"),u=o.get("redirect"),d=o.get("forceConnected"),j=o.get("sourceAppPid"),T=o.get("origin"),N=o.get("autoConnectWebview"),S=o.get("popup"),U=o.get("showQuickConnect");let h=o.get("inviter");if(!h&&u)try{h=(u.startsWith("http")?new URL(u):new URL(u,window.location.origin)).searchParams.get("inviter")}catch{}h=h||localStorage.getItem("inviter"),A&&(m.componentId=A),k&&(m.visitorId=k),h&&(m.inviter=h),Te(j)||(j==="null"?m.sourceAppPid=null:j!==null&&(m.sourceAppPid=j));let D=[];try{D=JSON.parse(oe)}catch{}const ie=async n=>{const t=o.get("fromWallet");R("login page notifyWallet",{data:n,fromWallet:t,"browser.wallet":l.wallet}),n&&String(t)==="1"&&l.wallet&&await Promise.any([z.asyncCall("arcSetToken",n),O(3e3)])},C=n=>o.get("encrypted")?ee(n):n,q=async n=>{n&&await ie(n),setTimeout(()=>{if(u){const t=decodeURIComponent(u);t.startsWith(L.WELLKNOWN_SERVICE_PATH_PREFIX)?P(t,{replace:!0}):window.location.replace(V(t))}else window.location.replace(window.env.pathPrefix||"/")},50)},se=n=>{const t={did:n.user.did,host:window.location.host,appPid:window.blocklet.appPid,visitorId:B(),sourceAppPid:n.user.sourceAppPid,fullName:n.user.fullName};R("bridge callArc: onLogin",t),z.callArc("onLogin",t)},H=async(n,t)=>{const w=t(n.sessionToken),b=t(n.refreshToken),x=t(n.visitorId);R("login page onLogin",{result:n,decodeSessionToken:w,decodeRefreshToken:b,decodeVisitorId:x}),ke(w),ve(b),n.visitorId&&Ee(x),await s.refresh(),await O(100),se(v.current);const r={};o.get("saveConnect")?(r.connected_did=v.current.user.did,r.connected_pk=v.current.user.pk,r.connected_wallet_os=v.current.walletOS,r.connected_app=je()):(r.connected_did=o.get("connected_did"),r.connected_pk=o.get("connected_pk"),r.connected_app=o.get("connected_app"),r.connected_wallet_os=o.get("connected_wallet_os")),be(r,!0),q({sessionToken:w,refreshToken:b,visitorId:x})},re=ue(()=>T==="switch-did"?d&&typeof d=="string"?{title:i("login.switchSpecifiedDid.title"),scan:i("login.switchSpecifiedDid.scan",{did:d}),confirm:i("login.switchSpecifiedDid.confirm"),success:i("login.switchSpecifiedDid.success")}:{title:i("login.switchDid.title"),scan:i("login.switchDid.scan"),confirm:i("login.switchDid.confirm"),success:i("login.switchDid.success")}:{title:i("login.connect.title"),scan:i("login.connect.scan"),confirm:i("login.connect.confirm"),success:i("login.connect.success")},[d,T,i]),Q=ge(()=>{const n=window?.blocklet,t={className:"connect",popup:!1,action:"login",passkeyBehavior:"both",onSuccess:H,onError:ce,locale:y,messages:re,extraParams:m,baseUrl:window.location.origin,prefix:W(window.location.origin,L.WELLKNOWN_SERVICE_PATH_PREFIX,ye)};d&&(t.forceConnected=d,t.extraParams.enableSwitchApp=!1,t.extraParams.forceConnected=d),t.options||(t.options={}),T==="switch-did"?t.options.showQuickConnect=!0:_(U)||([!1,"false"].includes(U)?t.options.showQuickConnect=!1:t.options.showQuickConnect=!0);const w=We();Ae()&&(t.extraParams.sourceAppPid=w.appPid);const x=W(window.location.origin,L.WELLKNOWN_SERVICE_PATH_PREFIX,"connect"),r={params:Pe(encodeURIComponent(JSON.stringify(t))),appPid:n?.appPid,appName:n?.appName,locale:y,redirect:window.location.href,_ek_:g};_(N)||(r.autoConnectWebview=N),_(S)||(r.popup=S),r.disableClose=!0;const le=V(Ie(x,r),{allowDomains:null});window.location.href=le});me(()=>{if(o.get("sessionToken")){const n=o.get("visitorId");if(!n){M.error("Unexpected login response from server: visitorId is required");return}H({sessionToken:C(ne),refreshToken:C(te),visitorId:C(n)},t=>t)}else!s.user||d&&s.user.did!==d?Q():!E&&!o.get("sessionToken")&&q()});const ce=n=>{M.error(n.message)},ae=o.has("popup");if(s.loading||s.user){if(!E||o.get("sessionToken"))return e.jsxs(e.Fragment,{children:[e.jsx(F,{children:e.jsx("title",{children:i("pageTitle.login")})}),e.jsx(Ce,{children:ae?null:e.jsx(pe,{})})]});const n=u?new URL(u,window.location.origin).href:window.location.href;return e.jsx(Z,{onConnect:Q,passports:D,redirect:n})}return e.jsxs(e.Fragment,{children:[e.jsx(F,{children:e.jsx("title",{children:i("pageTitle.login")})}),e.jsx(p,{sx:{"box-sizing":"border-box",width:"100%",height:"100vh",position:"relative",display:"flex","flex-direction":"column",".connect":{background:"#fafafa"}},ref:a})]})}export{Ve as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as r}from"./create-passport-svg-n0J1kwzH.js";import{C as t}from"./vendor-utils-CUDP56Ff.js";import{c as s}from"./index-Dt8akALo.js";const e=o=>r({...o,issuerAvatarUrl:t(window.location.origin,s.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo")});export{e as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./vendor-mui-core-DRxbhqaK.js";import{C as t}from"./vendor-utils-CUDP56Ff.js";import{I as s}from"./iframe-CKOcsJB-.js";import{c as e}from"./index-Dt8akALo.js";import{S as m}from"./studio-UxYOr-dB.js";import"./vendor-react-Dvs43sk9.js";import"./vendor-ux-B9VfuZTg.js";import"./vendor-hooks-BlA8TRnZ.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-DeeG8u0h.js";import"./index-DuO31sai.js";function L(){const r=new URLSearchParams;r.set("title","Preference Builder"),r.set("schemaKey",t(window.location.origin,e.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/studio/preferences"));const i=`${t(window.location.origin,e.WELLKNOWN_SERVICE_PATH_PREFIX,"/hosted/form-builder/")}?${r.toString()}`;return o.jsx(m,{children:o.jsx(s,{url:i,width:"100%",height:"100%",frameBorder:0,styles:{border:0}})})}export{L as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./vendor-mui-core-DRxbhqaK.js";import{_ as o}from"./user-center-D18_bCCh.js";import{H as i}from"./index-Dt8akALo.js";import{T as e}from"./vendor-ux-B9VfuZTg.js";import"./vendor-react-Dvs43sk9.js";import"./vendor-hooks-BlA8TRnZ.js";import"./vendor-utils-CUDP56Ff.js";import"./index-ChdZfn2Z.js";import"./arrow-down.svg-DgXRF8DP.js";import"./user-sessions-DYtBKHTy.js";import"./index-BZUEA_VO.js";import"./index-DlrQ2HQP.js";import"./vendor-arcblock-DeeG8u0h.js";import"./index-BOst2c_c.js";import"./index-DRYJ0xIl.js";import"./index-BojVbZw0.js";import"./index-Y8LQew4k.js";import"./lottie-web-4koyQiv_.js";function H(){const{t}=e();return r.jsxs(r.Fragment,{children:[r.jsx(i,{children:r.jsx("title",{children:t("pageTitle.userCenter")})}),r.jsx(o,{onlyProfile:!0,currentTab:"",disableAutoRedirect:!0})]})}export{H as default};
|