@abtnode/blocklet-services 1.16.53-beta-20251013-075536-64fcb94b → 1.16.53
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
|
@@ -0,0 +1,103 @@
|
|
|
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-BFPsXaTR.js";import{a as D,b as O,h as Te}from"./vendor-hooks-DmThWyyG.js";import{V as Q,U as Ne,a2 as ne,s as re,Z as $e}from"./vendor-ux-CE4sOH7O.js";import{t as Se}from"./server-logo-notext.svg-CKQB0tIp.js";import{B as Le}from"./bundle-avatar-CRBdm-Kg.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 Ue}from"./team-DK_N0J3a.js";import{R as He,J as We,C as J,a as U}from"./vendor-utils-OrZFrHBP.js";import{c as Qe,Z as Je}from"./index-CmM1Fb8I.js";import{B as Ke,o as Xe,l as Ze}from"./index-DACE9NO5.js";import{p as Ge}from"./util-CxUMQb4N.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 Ye(e){return e.includes(" ")?new Date(e.replace(" ","T").replace(" ","")).getTime():new Date(e).getTime()}function K({value:e="",shouldUpdate:r=!1,...s}){const{locale:o}=Q(),[l,u]=i.useState(0);if(i.useEffect(()=>{let d;if(r){const h=new Date(e).getTime(),y=Date.now(),v=Math.abs(Math.floor((h-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=Ye(e);return t.jsx(Ne,{value:m,locale:o,...s})}K.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"/>'},Y={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=Y[e]||Y.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 H={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?Ge(e.avatar,s,o):null}),[e,s,o]),m=d=>{e&&(d.stopPropagation(),window.open(We(J(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(Ke,{user:u,showDid:!0,cardType:Ze.AvatarOnly,infoType:Xe.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(H).isRequired,size:n.number.isRequired,teamDid:n.string,inService:n.bool,showName:n.bool};X.propTypes={actors:n.oneOfType([n.shape(H),n.arrayOf(n.shape(H))]).isRequired,size:n.number,maxDisplay:n.number,teamDid:n.string,inService:n.bool,showName:n.bool,avatarFallback:n.node};function X({actors:e,size:r=32,maxDisplay:s=9,teamDid:o="",inService:l=!0,showName:u=!1,avatarFallback:m=null}){const d=D(()=>{const h=Array.isArray(e)?e:[e];return He(h,"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:h=>h<100?t.jsxs("span",{children:["+",h]}):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((h,y)=>h?.avatar?t.jsx(W,{actor:h,size:r,teamDid:o,inService:l},h?.did||y):m)})}const ee=3;he.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};pe.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 U(s)||!s.type||!s.actor||U(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 pe({items:e,activity:r,blocklet:s,mountPoint:o="",viewMoreLink:l="",avatarFallback:u=null}){const m=F(),{t:d}=Q(),h=D(()=>s?.did||s?.meta?.did||"",[s]),{locale:y}=i.useContext(re),v=D(()=>!U(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:J(o,x.metaLink):null}),C=O((a,x)=>{if(!x)return;const p=k(x);p&&(window.open(p,"_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(X,{actors:a.actorInfo,size:32,teamDid:h}):u,t.jsx(q,{variant:"subtitle1",sx:{color:"text.primary"},children:V(a)?a?.actorInfo?.fullName:"System"})," ","·",t.jsx(K,{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 he({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:J(o,m.targetLink):null},[e.activity,o]);return r?t.jsx(pe,{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=Je(),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(p=>p.breakpoints.down("md")),h=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(p=>V(p)?p.actorInfo:{did:p.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((p,S)=>{const A=Fe(p);if(A.length&&s(A.map(R=>R.id)),S&&!S.customPreventRedirect){const R=Oe(p,a);R&&typeof R=="string"&&window.open(R,"_blank","noopener,noreferrer")}});return t.jsxs(lt,{ref:h,className:"notification-row",id:e.id,isRead:y,inDialog:o,highlight:l,isMd:d,onClick:p=>x(e,p),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(X,{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(K,{value:e.createdAt,locale:u,shouldUpdate:!0,style:{color:m.palette.text.secondary,fontSize:"0.875rem",minWidth:"50px",whiteSpace:"nowrap"}})]}),v?t.jsx(he,{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(Ue,{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(),h=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),p=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))}),p.current)){const j=document.getElementById(f);j&&p.current.unobserve(j)}}}),c.length>0&&(s(c),setTimeout(()=>{v(!1)},300)),w.current.clear()}},[o,z,s]),Z=i.useCallback(()=>{A.current&&clearTimeout(A.current),A.current=setTimeout(()=>{B()},50)},[B]),E=i.useCallback(()=>{if(o||!h.current||!b)return;p.current&&p.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:G=[]}=M;G.length&&!G[0].read&&(N.isIntersecting?(w.current.add(j),Z()):w.current.delete(j))}})},c);p.current=f,Array.from(h.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,Z]);return i.useEffect(()=>{o||(S.current=!0,p.current&&b&&y&&setTimeout(()=>{E()},0))},[R,y,b,E,o]),i.useEffect(()=>{if(o||!h.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(),()=>{p.current&&p.current.disconnect()}),[E,o]),Te(()=>{setTimeout(()=>{const c=Be(h.current),f=Pe(z,c);s(f.map(I=>I.id))},100)}),L?.length?t.jsx(g,{ref:h,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{X as A,le as B,at as N,K as R,P as S,he as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.__toCdnUrl("assets/vendor-ux-DYcPPYq2.css"),window.__toCdnUrl("assets/index-DrVXX4fX.css"),window.__toCdnUrl("assets/index-B5LvOF-F.css")])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as b,a as be}from"./vendor-react-Dvs43sk9.js";import{T as D,H,_ as ye,$ as re,I as V,j as ve,k as Ce}from"./vendor-ux-B9VfuZTg.js";import{j as e,Y as M,bC as K,I as X,aj as G,$ as Q,b1 as q,T as S,ak as c,z as w,F as C,b7 as Te,b5 as le,b6 as ne,a5 as se,a3 as Y,aX as oe,R as ae,Q as z,a6 as J,W as n,am as we,cb as ce,cc as Ie,bb as Se}from"./vendor-mui-core-DRxbhqaK.js";import{B as Re,o as Ee,l as Ae}from"./index-BFBoLr1Z.js";import{u as ke}from"./useAsyncRetry-EEjDgDMR.js";import{r as We}from"./index-9WUHnAoz.js";import{X as $,c as k,a9 as Ne}from"./index-Dt8akALo.js";import{u as B}from"./team-s6q3vfNx.js";import{u as ue,C as I}from"./index.esm-JPZAjt0x.js";import{o as Pe,b as qe,C as te}from"./vendor-utils-CUDP56Ff.js";import{T as Oe}from"./index-OuTt2geA.js";import{E as Le}from"./empty-spinner-LXNYl6_1.js";import{C as v}from"./click-to-copy-CO6UIqva.js";import{D as _e}from"./delete-confirm-DDcjKsY2.js";import{r as ze}from"./passport-item-cu1WVC_B.js";import{A as Fe}from"./actions-B4VXcSRp.js";import{T as ie}from"./table-tips-rCE1XKlc.js";import{u as De}from"./use-mobile-BQQpAf3i.js";import"./vendor-hooks-BlA8TRnZ.js";import"./lottie-web-4koyQiv_.js";import"./useAsync-DVtDVEv6.js";import"./vendor-arcblock-DeeG8u0h.js";import"./session-Y3RU3I2O.js";import"./isURL-B2kErAOg.js";import"./use-app-logo-BjReZUm7.js";import"./arrow-down.svg-DgXRF8DP.js";import"./vendor-mui-x-Qp6zkx78.js";import"./AdapterDayjs-Bp0ir26R.js";import"./confirm-D1n-RK65.js";import"./index-DBs9Ljax.js";import"./did-address-DnFNwELW.js";import"./util-DDkRAi85.js";import"./base32-BK7MXAD4.js";var de=We();const $e={clientName:"",clientUri:"",redirectUris:"",scope:["profile:read"],contacts:"",tosUri:"",policyUri:""};function pe({onCreated:r,onClose:a}){const[i,h]=b.useState(!1),{t:l,locale:s}=D(),{api:f}=$(),{teamDid:d}=B(),{control:y,handleSubmit:g,formState:{errors:u},watch:W,setValue:m}=ue({defaultValues:$e,mode:"onChange"}),T=W("scope"),R=o=>{o!=="profile:read"&&m("scope",T.includes(o)?T.filter(x=>x!==o):[...T,o])},N=async o=>{h(!0);try{const x={...o,redirectUris:o.redirectUris,contacts:o.contacts?o.contacts.split(",").map(A=>A.trim()):[],scope:o.scope.join(" ")};await f.createOAuthClient({input:{teamDid:d,input:Pe(x,qe)}}),r(x)}catch(x){H.error(x.message||"Failed to create OAuth App")}finally{h(!1)}};return e.jsxs(M,{open:!0,onClose:a,maxWidth:"md",fullWidth:!0,children:[e.jsxs(K,{children:[l("oauth.client.register")," ",e.jsx(X,{onClick:a,sx:{position:"absolute",right:8,top:8},children:e.jsx(G,{})})]}),e.jsx(Q,{children:e.jsxs(q,{spacing:4,sx:{mt:2},children:[e.jsx(S,{variant:"h6",gutterBottom:!0,children:l("oauth.client.requiredInformation")}),e.jsx(c,{children:e.jsx(I,{name:"clientName",control:y,rules:{required:l("oauth.client.validate.clientName"),minLength:{value:3,message:l("oauth.client.validate.clientNameMinLength")}},render:({field:o})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...o,label:l("oauth.client.name"),required:!0,fullWidth:!0,placeholder:l("oauth.client.input.clientNamePlaceholder"),error:!!u.clientName,helperText:u.clientName?.message}),e.jsx(C,{children:l("oauth.client.helperText.clientName")})]})})}),e.jsx(c,{children:e.jsx(I,{name:"clientUri",control:y,rules:{required:l("oauth.client.validate.clientUri"),pattern:{value:/^https?:\/\/.+/,message:l("oauth.client.validate.clientUriInvalid")}},render:({field:o})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...o,label:l("oauth.client.input.clientUri"),required:!0,fullWidth:!0,placeholder:l("oauth.client.input.clientUriPlaceholder"),error:!!u.clientUri,helperText:u.clientUri?.message}),e.jsx(C,{children:l("oauth.client.helperText.clientUri")})]})})}),e.jsx(c,{children:e.jsx(I,{name:"redirectUris",control:y,rules:{required:l("oauth.client.validate.redirectUris"),pattern:{value:/^https?:\/\/.+/,message:l("oauth.client.validate.redirectUrisInvalid")}},render:({field:o})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...o,label:l("oauth.client.input.redirectUris"),required:!0,fullWidth:!0,placeholder:l("oauth.client.input.redirectUrisPlaceholder"),error:!!u.redirectUris,helperText:u.redirectUris?.message}),e.jsxs(c,{sx:{display:"flex",gap:"2px"},children:[e.jsx(C,{children:l("oauth.client.helperText.redirectUris")}),e.jsx(C,{children:l("oauth.client.helperText.read")}),e.jsx(C,{sx:{color:"info.main"},component:"a",href:`https://www.arcblock.io/docs/blocklet-developer/${s}/oauth-service`,target:"_blank",rel:"noopener noreferrer",children:l("oauth.client.helperText.document")}),e.jsx(C,{children:l("oauth.client.helperText.more")})]})]})})}),e.jsxs(Te,{variant:"outlined",sx:{p:2,display:"none"},children:[e.jsx(S,{variant:"subtitle2",gutterBottom:!0,children:l("oauth.client.input.permissions")}),e.jsx(c,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2},children:e.jsx(le,{children:Object.entries(k.OAUTH_SCOPES).map(([o,x])=>e.jsx(ne,{control:e.jsx(se,{checked:T.includes(o),onChange:()=>R(o),disabled:o==="profile:read",color:"primary"}),label:e.jsx(c,{children:e.jsx(S,{variant:"body2",sx:{fontWeight:500},children:x})})},o))})})]}),e.jsx(Y,{}),e.jsx(S,{variant:"h6",gutterBottom:!0,children:l("oauth.client.optionalInformation")}),e.jsx(q,{children:e.jsx(I,{name:"contacts",control:y,rules:{pattern:{value:/^$|^[^@\s]+@[^@\s]+\.[^@\s]+(\s*,\s*[^@\s]+@[^@\s]+\.[^@\s]+)*$/,message:l("oauth.client.validate.contacts")}},render:({field:o})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...o,label:l("oauth.client.input.contacts"),fullWidth:!0,placeholder:l("oauth.client.input.contactsPlaceholder"),error:!!u.contacts,helperText:u.contacts?.message}),e.jsx(C,{children:l("oauth.client.helperText.contacts")})]})})}),e.jsxs(q,{direction:{xs:"column",sm:"row"},spacing:2,children:[e.jsx(I,{name:"tosUri",control:y,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:l("oauth.client.validate.tosUriInvalid")}},render:({field:o})=>e.jsxs(c,{sx:{width:"50%"},children:[e.jsx(w,{size:"small",...o,label:l("oauth.client.input.tosUri"),fullWidth:!0,placeholder:l("oauth.client.input.tosUriPlaceholder"),error:!!u.tosUri,helperText:u.tosUri?.message}),e.jsx(C,{children:l("oauth.client.helperText.tosUri")})]})}),e.jsx(I,{name:"policyUri",control:y,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:l("oauth.client.validate.policyUriInvalid")}},render:({field:o})=>e.jsxs(c,{sx:{width:"50%"},children:[e.jsx(w,{size:"small",...o,label:l("oauth.client.input.policyUri"),fullWidth:!0,placeholder:l("oauth.client.input.policyUriPlaceholder"),error:!!u.policyUri,helperText:u.policyUri?.message}),e.jsx(C,{children:l("oauth.client.helperText.policyUri")})]})})]}),u.error&&e.jsx(oe,{severity:"error",children:u.error.message})]})}),e.jsxs(ae,{children:[e.jsx(z,{onClick:a,children:l("common.cancel")}),e.jsxs(z,{onClick:g(N),disabled:i,variant:"contained",color:"primary",children:[i?e.jsx(J,{size:20,sx:{mr:1}}):null,l("oauth.client.registerButton")]})]})]})}pe.propTypes={onCreated:n.func.isRequired,onClose:n.func.isRequired};function Z({scope:r="",...a}){if(!r)return null;const i=r.split(" ").filter(Boolean);return e.jsx(q,{direction:"row",...a,sx:[{flexWrap:"wrap",gap:1},...Array.isArray(a.sx)?a.sx:[a.sx]],children:i.map(h=>e.jsx(be.Fragment,{children:e.jsx(we,{title:k.OAUTH_SCOPES[h],children:e.jsx(v,{children:h})})},h))})}Z.propTypes={scope:n.string};const ee=r=>{const{prefix:a}=$(),{blocklet:i}=Ne(),h=te(a,"/api/media/upload",i.appPid),l=b.useCallback(f=>f?f.startsWith("http")?f:`${te(a,"/api/media/upload",i.appPid)}/${f}`:"",[a,i.appPid]);return{clientLogoUrl:b.useMemo(()=>l(r),[r,l]),apiPath:h,getClientLogoUrl:l}},Be=b.lazy(()=>ye(()=>import("./index-C5sng-9P.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(r=>({default:r.Uploader})));function he({client:r,onUpdate:a,onClose:i}){const[h,l]=b.useState(!1),{t:s,locale:f}=D(),d=b.useRef(null),{api:y}=$(),{teamDid:g}=B(),{control:u,handleSubmit:W,formState:{errors:m},watch:T,setValue:R,getValues:N}=ue({defaultValues:{clientName:r.clientName||"",clientUri:r.clientUri||"",redirectUris:Array.isArray(r.redirectUris)?r.redirectUris.join(","):"",scope:r.scope?r.scope.split(" "):["profile:read"],contacts:Array.isArray(r.contacts)?r.contacts.join(","):"",tosUri:r.tosUri||"",policyUri:r.policyUri||"",logoUri:r.logoUri||"",clientSecretExpiresAt:r.clientSecretExpiresAt||null},mode:"onChange"}),o=T("scope"),x=T("logoUri"),{clientLogoUrl:A,apiPath:P}=ee(x),E=t=>{t!=="profile:read"&&R("scope",o.includes(t)?o.filter(p=>p!==t):[...o,t])},O=async t=>{const p={clientId:r.clientId,clientName:t.clientName.trim(),clientUri:t.clientUri,redirectUris:t.redirectUris.split(",").map(j=>j.trim()).filter(Boolean),contacts:t.contacts?t.contacts.split(",").map(j=>j.trim()):[],scope:t.scope.join(" "),tosUri:t.tosUri,policyUri:t.policyUri,logoUri:t.logoUri,clientSecretExpiresAt:t.clientSecretExpiresAt?parseInt(t.clientSecretExpiresAt/1e3,10):null};await y.updateOAuthClient({input:{teamDid:g,input:p}})},_=async t=>{l(!0);try{await O(t),a(),i()}catch(p){H.error(p.message||s("oauth.client.updateFailed"))}finally{l(!1)}};return e.jsxs(M,{open:!0,onClose:i,maxWidth:"md",fullWidth:!0,children:[e.jsxs(K,{children:[s("oauth.client.update")," ",e.jsx(X,{onClick:i,sx:{position:"absolute",right:8,top:8},children:e.jsx(G,{})})]}),e.jsx(Q,{children:e.jsxs(q,{spacing:3,sx:{mt:2},children:[e.jsxs(c,{sx:{mb:3},children:[e.jsx(S,{variant:"subtitle1",sx:{fontWeight:500,mb:1},children:s("oauth.client.logo")}),e.jsxs(c,{children:[e.jsx(c,{sx:{width:120,height:120,position:"relative",borderRadius:"4px",overflow:"hidden"},children:A?e.jsx(c,{children:e.jsx("img",{src:A,alt:"client-logo",style:{width:"100%",height:"100%"}})}):e.jsx(c,{onClick:()=>{d.current?.open()},sx:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",bgcolor:"grey.200"},children:e.jsx(ce,{sx:{fontSize:40,color:"common.white"}})})}),e.jsx(z,{sx:{mt:2},variant:"outlined",size:"small",onClick:()=>{d.current?.open()},children:s(A?"common.change":"common.upload")})]}),e.jsx(c,{sx:{display:"flex",alignItems:"center"},children:e.jsx(b.Suspense,{fallback:e.jsx(Le,{}),children:e.jsx(Be,{ref:d,locale:f,popup:!0,onUploadFinish:t=>{R("logoUri",t.data.filename),O(N()).then(()=>{a()}).catch(p=>{H.error(p.message||s("oauth.client.updateFailed"))}).finally(()=>{d.current?.close()})},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:P,disableMediaKitPrefix:!0,disableAutoPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/png","image/jpeg","image/webp","image/svg+xml"],maxFileSize:1024*1024*.5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{minWidth:256,minHeight:256}}}},"uploader-logo")})})]}),e.jsx(S,{variant:"subtitle1",sx:{fontWeight:500},children:s("oauth.client.requiredInformation")}),e.jsx(w,{label:"Client Id",fullWidth:!0,value:r.clientId,disabled:!0}),e.jsx(c,{children:e.jsx(I,{name:"clientName",control:u,rules:{required:s("oauth.client.validate.clientName"),minLength:{value:3,message:s("oauth.client.validate.clientNameMinLength")}},render:({field:t})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{...t,label:s("oauth.client.name"),required:!0,fullWidth:!0,error:!!m.clientName,helperText:m.clientName?.message}),e.jsx(C,{children:s("oauth.client.helperText.clientName")})]})})}),e.jsx(c,{children:e.jsx(I,{name:"clientUri",control:u,rules:{required:s("oauth.client.validate.clientUri"),pattern:{value:/^https?:\/\/.+/,message:s("oauth.client.validate.clientUriInvalid")}},render:({field:t})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{...t,label:s("oauth.client.input.clientUri"),required:!0,fullWidth:!0,error:!!m.clientUri,helperText:m.clientUri?.message}),e.jsx(C,{children:s("oauth.client.helperText.clientUri")})]})})}),e.jsx(c,{children:e.jsx(I,{name:"redirectUris",control:u,rules:{required:s("oauth.client.validate.redirectUris"),pattern:{value:/^https?:\/\/.+/,message:s("oauth.client.validate.redirectUrisInvalid")}},render:({field:t})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{...t,label:s("oauth.client.input.redirectUris"),required:!0,fullWidth:!0,multiline:!0,rows:2,error:!!m.redirectUris,helperText:m.redirectUris?.message}),e.jsx(C,{children:s("oauth.client.helperText.redirectUris")})]})})}),e.jsx(I,{name:"clientSecretExpiresAt",control:u,render:({field:t})=>e.jsx(Oe,{placeholder:s("oauth.client.input.expireTime"),value:t.value*1e3,onChange:p=>{t.onChange(p)}})}),e.jsxs(c,{sx:{display:"none"},children:[e.jsx(S,{variant:"subtitle2",sx:{mb:1},children:s("oauth.client.input.permissions")}),e.jsx(c,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2},children:e.jsx(le,{children:Object.entries(k.OAUTH_SCOPES).map(([t,p])=>e.jsx(ne,{control:e.jsx(se,{checked:o.includes(t),onChange:()=>E(t),disabled:t==="profile:read",color:"primary"}),label:e.jsx(c,{children:e.jsx(S,{variant:"body2",sx:{fontWeight:500},children:p})})},t))})})]}),e.jsx(Y,{}),e.jsx(S,{variant:"subtitle1",sx:{fontWeight:500},children:s("oauth.client.optionalInformation")}),e.jsx(c,{children:e.jsx(I,{name:"contacts",control:u,rules:{pattern:{value:/^$|^[^@\s]+@[^@\s]+\.[^@\s]+(\s*,\s*[^@\s]+@[^@\s]+\.[^@\s]+)*$/,message:s("oauth.client.validate.contacts")}},render:({field:t})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{...t,label:s("oauth.client.input.contacts"),fullWidth:!0,error:!!m.contacts,helperText:m.contacts?.message}),e.jsx(C,{children:s("oauth.client.helperText.contacts")})]})})}),e.jsxs(q,{direction:{xs:"column",sm:"row"},spacing:2,children:[e.jsx(I,{name:"tosUri",control:u,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:s("oauth.client.validate.tosUriInvalid")}},render:({field:t})=>e.jsxs(c,{sx:{width:"50%"},children:[e.jsx(w,{...t,label:s("oauth.client.input.tosUri"),fullWidth:!0,error:!!m.tosUri,helperText:m.tosUri?.message}),e.jsx(C,{children:s("oauth.client.helperText.tosUri")})]})}),e.jsx(I,{name:"policyUri",control:u,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:s("oauth.client.validate.policyUriInvalid")}},render:({field:t})=>e.jsxs(c,{sx:{width:"50%"},children:[e.jsx(w,{...t,label:s("oauth.client.input.policyUri"),fullWidth:!0,error:!!m.policyUri,helperText:m.policyUri?.message}),e.jsx(C,{children:s("oauth.client.helperText.policyUri")})]})})]}),m.error&&e.jsx(oe,{severity:"error",children:m.error.message})]})}),e.jsxs(ae,{children:[e.jsx(z,{onClick:i,children:s("common.cancel")}),e.jsx(z,{onClick:W(_),disabled:h,variant:"contained",color:"primary",children:h?e.jsx(J,{size:16}):s("common.update")})]})]})}he.propTypes={client:n.shape({clientId:n.string.isRequired,clientName:n.string.isRequired,clientUri:n.string,redirectUris:n.arrayOf(n.string),scope:n.string,contacts:n.arrayOf(n.string),tosUri:n.string,policyUri:n.string,logoUri:n.string,clientSecretExpiresAt:n.number}).isRequired,onUpdate:n.func.isRequired,onClose:n.func.isRequired};function me({client:r,onUpdate:a,onClose:i}){return e.jsx(he,{client:r,onUpdate:h=>a(h),onClose:i})}me.propTypes={client:n.shape({clientId:n.string.isRequired,clientName:n.string.isRequired,clientUri:n.string,redirectUris:n.arrayOf(n.string),scope:n.string,contacts:n.arrayOf(n.string),tosUri:n.string,policyUri:n.string,logoUri:n.string,clientSecretExpiresAt:n.number}).isRequired,onUpdate:n.func.isRequired,onClose:n.func.isRequired};function xe({clientId:r,clientName:a,onDelete:i=()=>{},onClose:h=()=>{}}){const{t:l}=D(),{api:s}=$(),{teamDid:f}=B(),d=()=>{h()},y=async()=>{try{await s.deleteOAuthClient({input:{teamDid:f,clientId:r}}),i()}catch(u){H.error(u?.message)}finally{d()}},g={keyName:a,title:l("oauth.client.delete.title"),description:l("oauth.client.delete.description",{name:`<b>${a}</b>`}),confirmPlaceholder:l("oauth.client.delete.description",{name:a}),confirm:l("common.delConfirm"),cancel:l("common.cancel"),onConfirm:y,onCancel:d};return e.jsx(_e,{keyName:g.keyName,title:g.title,description:g.description,confirmPlaceholder:g.confirmPlaceholder,confirm:g.confirm,cancel:g.cancel,params:g.params,onConfirm:g.onConfirm,onCancel:g.onCancel})}xe.propTypes={clientId:n.string.isRequired,clientName:n.string.isRequired,onDelete:n.func,onClose:n.func};function je({title:r,items:a}){return e.jsxs(c,{sx:{mb:3},children:[e.jsx(S,{variant:"h6",sx:{mb:1.5},children:r}),e.jsx(q,{spacing:1.5,children:a.map(({label:i,value:h})=>e.jsxs(c,{sx:{display:"flex",alignItems:"center",gap:2},children:[e.jsx(S,{variant:"subtitle2",color:"textSecondary",sx:{minWidth:200},children:i}),e.jsx(S,{sx:{wordBreak:"break-all"},children:h||"-"})]},i))})]})}je.propTypes={title:n.string.isRequired,items:n.arrayOf(n.shape({label:n.string.isRequired,value:n.any})).isRequired};function ge({client:r,onClose:a}){const{t:i,locale:h}=D(),{teamDid:l}=B(),{clientName:s,clientId:f,clientSecret:d,redirectUris:y,scope:g,clientUri:u,logoUri:W,contacts:m,tosUri:T,policyUri:R,jwksUri:N,jwks:o,softwareId:x,softwareVersion:A,clientIdIssuedAt:P,clientSecretExpiresAt:E,updatedAt:O,createUser:_}=r,{clientLogoUrl:t}=ee(W),p=L=>{try{const F=new URL(window.blocklet.appUrl);return F.pathname=L,F.toString()}catch{return"-"}},j=de.fromAppDid(f,l),U=[{title:i("common.baseInfo"),items:[{label:i("oauth.client.name"),value:s},{label:i("oauth.client.logoUri"),value:e.jsx(re,{variant:"rounded",shape:"square",src:t,did:j.address,size:64})},{label:i("oauth.client.clientUri"),value:u?e.jsx(v,{children:u}):"-"},{label:i("oauth.client.clientId"),value:e.jsx(v,{children:f})},{label:i("oauth.client.clientSecret"),value:e.jsx(v,{children:d})},{label:i("oauth.client.redirectUris"),value:e.jsx(v,{children:(y||[]).join(", ")})},{label:i("oauth.client.scope"),value:e.jsx(Z,{scope:g})},{label:i("oauth.client.createUser"),value:_?ze(_,!0):i("oauth.client.openRegistration")}]},{title:i("oauth.client.oauthEndpoints"),items:[{label:i("oauth.client.openidConfiguration"),value:e.jsx(v,{children:p("/.well-known/openid-configuration")})},{label:i("oauth.client.authorizationEndpoint"),value:e.jsx(v,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/authorize`)})},{label:i("oauth.client.tokenEndpoint"),value:e.jsx(v,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/token`)})},{label:i("oauth.client.userinfoEndpoint"),value:e.jsx(v,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/userinfo`)})},{label:i("oauth.client.jwksUri"),value:e.jsx(v,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/jwks`)})},{label:i("oauth.client.registrationEndpoint"),value:e.jsx(v,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/register`)})},{label:i("oauth.client.endSessionEndpoint"),value:e.jsx(v,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/logout`)})}]},{title:i("oauth.client.metaContact"),items:[{label:i("oauth.client.contacts"),value:m.length?e.jsx(v,{children:(m||[]).join(", ")}):"-"},{label:i("oauth.client.tosUri"),value:T?e.jsx(v,{children:T}):"-"},{label:i("oauth.client.policyUri"),value:R?e.jsx(v,{children:R}):"-"},{label:i("oauth.client.jwksUri"),value:N},{label:i("oauth.client.jwks"),value:o},{label:i("oauth.client.softwareId"),value:x},{label:i("oauth.client.softwareVersion"),value:A}]},{title:i("common.timeInfo"),items:[{label:i("oauth.client.clientIdIssuedAt"),value:P?e.jsx(V,{value:P*1e3,type:"all",locale:h}):"-"},{label:i("oauth.client.clientSecretExpiresAt"),value:E?e.jsx(V,{value:E*1e3,type:"all",locale:h}):"-"},{label:i("common.updatedAt"),value:O?e.jsx(V,{value:O,type:"all",locale:h}):"-"}]}].filter(Boolean);return e.jsxs(M,{open:!0,onClose:a,maxWidth:"lg",fullWidth:!0,children:[e.jsxs(K,{children:[i("oauth.client.oauthAppDetails"),e.jsx(X,{onClick:a,sx:{position:"absolute",right:8,top:8},children:e.jsx(G,{})})]}),e.jsx(Q,{children:e.jsx(c,{sx:{mt:1},children:U.map((L,F)=>e.jsxs(c,{children:[e.jsx(je,{title:L.title,items:L.items}),F!==U.length-1&&e.jsx(Y,{sx:{my:2}})]},L.title))})})]})}ge.propTypes={client:n.object.isRequired,onClose:n.func.isRequired};function Ve(r){return e.jsx(V,{value:r*1e3})}function fe({selected:r=null,onClose:a}){return r?e.jsx(ge,{client:r,onClose:a}):null}fe.propTypes={selected:n.object,onClose:n.func.isRequired};function Ue({open:r,onCreated:a,onClose:i}){return r?e.jsx(pe,{onCreated:a,onClose:i}):null}Ue.propTypes={open:n.bool.isRequired,onCreated:n.func.isRequired,onClose:n.func.isRequired};function Tt(){const[r,a]=b.useState({searchText:"",pageSize:10,page:1}),[i,h]=b.useState(null),[l,s]=b.useState(!1),f=b.useRef(null),{t:d,locale:y}=D(),{api:g}=$(),{teamDid:u}=B(),[W,m]=b.useState(null),[T,R]=b.useState(null),N=De(),{getClientLogoUrl:o}=ee(),x=ke(async()=>await g.getOAuthClients({input:{teamDid:u,paging:{page:r.page,pageSize:r.pageSize}}}),[r.page,r.pageSize]),{loading:A}=x,P=b.useMemo(()=>x.value?.list||[],[x.value?.list]),E=b.useMemo(()=>r.searchText?P.filter(t=>t.clientName.toLowerCase().includes(r.searchText.toLowerCase())||t.clientId.toLowerCase().includes(r.searchText.toLowerCase())||t.scope.toLowerCase().includes(r.searchText.toLowerCase())):P,[r.searchText,P]),O=b.useMemo(()=>[{label:d("oauth.client.name"),name:"clientName",options:{customBodyRender:(t,{rowIndex:p})=>{const j=E[p],U=o(j.logoUri),L=de.fromAppDid(j.clientId,u);return e.jsx(c,{sx:{display:"flex",alignItems:"center",gap:2},children:e.jsxs(c,{sx:{display:"flex",alignItems:"center",gap:2,cursor:"pointer"},children:[e.jsx(re,{variant:"rounded",shape:"square",did:L.address,src:U,size:48}),e.jsxs(q,{sx:{gap:.5},children:[e.jsx(c,{sx:{color:"text.primary"},children:j.clientName}),e.jsx(c,{sx:{color:"text.secondary"},children:j.clientUri})]})]})})}}},{label:d("oauth.client.clientId"),name:"clientId"},{label:d("oauth.client.scope"),name:"scope",options:{customBodyRender:t=>e.jsx(Z,{scope:t})}},{label:d("common.createdAt"),name:"clientIdIssuedAt",options:{customBodyRender:Ve}},{label:d("common.createdBy"),name:"createdBy",width:100,options:{customBodyRender:t=>t?e.jsx(Re,{showDid:!0,did:t,cardType:Ae.Detailed,infoType:Ee.Minimal,sx:{border:0,padding:0}}):d("oauth.client.openRegistration")}},{label:d("common.actions"),name:"actions",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRender:(t,{rowIndex:p})=>{const j=E[p];return e.jsx(Fe,{actions:[{icon:e.jsx(Ie,{}),text:d("common.edit"),onClick:U=>{U.stopPropagation(),m(j)}},{icon:e.jsx(Se,{}),text:d("common.delete"),onClick:U=>{U.stopPropagation(),R(j)}}]})}}}],[E,d,o,u,m,R]),_=({page:t,rowsPerPage:p,searchText:j})=>{r.pageSize!==p?a(U=>({...U,searchText:"",pageSize:p,page:1})):r.page!==t+1?a(U=>({...U,searchText:"",page:t+1})):r.searchText!==j&&a(U=>({...U,searchText:j,page:1}))};return e.jsxs(c,{ref:f,sx:{".custom-toobar-btns":{gap:"8px"},".custom-toobar-title .custom-toobar-title-inner>span":{display:"flex",alignItems:"center","white-space":"inherit",height:"100%"}},children:[N?e.jsx(ie,{title:d("oauth.client.listTitle"),tooltipTitle:d("oauth.client.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${y}/oauth-service`}):null,e.jsx(ve,{data:E,columns:O,options:{sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,page:r.page-1,rowsPerPage:r.pageSize,count:E.length,searchDebounceTime:400,onRowClick(t,{dataIndex:p},j){if(f.current?.contains(j.target)){const U=E[p];h(U)}}},onChange:_,title:N?null:e.jsx(ie,{title:d("oauth.client.listTitle"),tooltipTitle:d("oauth.client.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${y}/oauth-service`}),customButtons:[e.jsxs(z,{variant:"contained",size:"small",onClick:()=>s(!0),children:[A?e.jsx(J,{size:16}):e.jsx(ce,{style:{fontSize:16}}),d("common.create")]},"add")],loading:!1,emptyNode:e.jsx(Ce,{children:d("oauth.client.empty")})}),e.jsx(fe,{selected:i,onClose:()=>h(null)}),e.jsx(Ue,{open:l,onCreated:()=>{s(!1),x.retry()},onClose:()=>s(!1)}),W&&e.jsx(me,{client:W,onUpdate:x.retry,onClose:()=>m(null)}),T&&e.jsx(xe,{...T,onDelete:x.retry,onClose:()=>R(null)})]})}export{Tt as default};
|
|
2
|
+
import{r as b,a as be}from"./vendor-react-Dvs43sk9.js";import{V as D,H,_ as ye,$ as re,U as V,x as ve,z as Ce}from"./vendor-ux-CE4sOH7O.js";import{j as e,Y as M,bC as K,I as X,aj as G,$ as Q,b1 as q,T as I,ak as c,z as w,F as C,b7 as Te,b5 as le,b6 as ne,a5 as se,a3 as Y,aX as oe,R as ae,Q as z,a6 as Z,W as n,am as we,cb as ce,cc as Se,bb as Ie}from"./vendor-mui-core-BFPsXaTR.js";import{B as Re,o as Ee,l as Ae}from"./index-DACE9NO5.js";import{u as ke}from"./useAsyncRetry-Dyo5t1bq.js";import{r as We}from"./index-CT7MCvWf.js";import{Z as $,c as k,ab as Ne}from"./index-CmM1Fb8I.js";import{u as B}from"./team-DK_N0J3a.js";import{u as ue,C as S}from"./index.esm-JPZAjt0x.js";import{o as Pe,b as qe,C as te}from"./vendor-utils-OrZFrHBP.js";import{T as Oe}from"./index-CeTnfded.js";import{E as Le}from"./empty-spinner-sNq-0DF5.js";import{C as v}from"./click-to-copy-CK42VmRr.js";import{D as _e}from"./delete-confirm-Ca3miSFM.js";import{r as ze}from"./passport-item-L7acCYqJ.js";import{A as Fe}from"./actions-C4-lIUPY.js";import{T as ie}from"./table-tips-BMq3WO_p.js";import{u as De}from"./use-mobile-DLnLSQQq.js";import"./vendor-hooks-DmThWyyG.js";import"./lottie-web-4koyQiv_.js";import"./useAsync-1_z8P8M4.js";import"./vendor-arcblock-DGOH9a3F.js";import"./session-BtQQCb_u.js";import"./isURL-DAY9MZJJ.js";import"./use-app-logo-BKyiSzxV.js";import"./arrow-down.svg-zOZF6XLO.js";import"./vendor-mui-x-C6iZOJbV.js";import"./AdapterDayjs-DyE9ImrK.js";import"./confirm-DAMhAYR3.js";import"./index-DBs9Ljax.js";import"./did-address-BQL5Zxlr.js";import"./util-CxUMQb4N.js";import"./base32-Cg02gOuu.js";var de=We();const $e={clientName:"",clientUri:"",redirectUris:"",scope:["profile:read"],contacts:"",tosUri:"",policyUri:""};function pe({onCreated:r,onClose:a}){const[i,h]=b.useState(!1),{t:l,locale:s}=D(),{api:f}=$(),{teamDid:d}=B(),{control:y,handleSubmit:g,formState:{errors:u},watch:W,setValue:m}=ue({defaultValues:$e,mode:"onChange"}),T=W("scope"),R=o=>{o!=="profile:read"&&m("scope",T.includes(o)?T.filter(x=>x!==o):[...T,o])},N=async o=>{h(!0);try{const x={...o,redirectUris:o.redirectUris,contacts:o.contacts?o.contacts.split(",").map(A=>A.trim()):[],scope:o.scope.join(" ")};await f.createOAuthClient({input:{teamDid:d,input:Pe(x,qe)}}),r(x)}catch(x){H.error(x.message||"Failed to create OAuth App")}finally{h(!1)}};return e.jsxs(M,{open:!0,onClose:a,maxWidth:"md",fullWidth:!0,children:[e.jsxs(K,{children:[l("oauth.client.register")," ",e.jsx(X,{onClick:a,sx:{position:"absolute",right:8,top:8},children:e.jsx(G,{})})]}),e.jsx(Q,{children:e.jsxs(q,{spacing:4,sx:{mt:2},children:[e.jsx(I,{variant:"h6",gutterBottom:!0,children:l("oauth.client.requiredInformation")}),e.jsx(c,{children:e.jsx(S,{name:"clientName",control:y,rules:{required:l("oauth.client.validate.clientName"),minLength:{value:3,message:l("oauth.client.validate.clientNameMinLength")}},render:({field:o})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...o,label:l("oauth.client.name"),required:!0,fullWidth:!0,placeholder:l("oauth.client.input.clientNamePlaceholder"),error:!!u.clientName,helperText:u.clientName?.message}),e.jsx(C,{children:l("oauth.client.helperText.clientName")})]})})}),e.jsx(c,{children:e.jsx(S,{name:"clientUri",control:y,rules:{required:l("oauth.client.validate.clientUri"),pattern:{value:/^https?:\/\/.+/,message:l("oauth.client.validate.clientUriInvalid")}},render:({field:o})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...o,label:l("oauth.client.input.clientUri"),required:!0,fullWidth:!0,placeholder:l("oauth.client.input.clientUriPlaceholder"),error:!!u.clientUri,helperText:u.clientUri?.message}),e.jsx(C,{children:l("oauth.client.helperText.clientUri")})]})})}),e.jsx(c,{children:e.jsx(S,{name:"redirectUris",control:y,rules:{required:l("oauth.client.validate.redirectUris"),pattern:{value:/^https?:\/\/.+/,message:l("oauth.client.validate.redirectUrisInvalid")}},render:({field:o})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...o,label:l("oauth.client.input.redirectUris"),required:!0,fullWidth:!0,placeholder:l("oauth.client.input.redirectUrisPlaceholder"),error:!!u.redirectUris,helperText:u.redirectUris?.message}),e.jsxs(c,{sx:{display:"flex",gap:"2px"},children:[e.jsx(C,{children:l("oauth.client.helperText.redirectUris")}),e.jsx(C,{children:l("oauth.client.helperText.read")}),e.jsx(C,{sx:{color:"info.main"},component:"a",href:`https://www.arcblock.io/docs/blocklet-developer/${s}/oauth-service`,target:"_blank",rel:"noopener noreferrer",children:l("oauth.client.helperText.document")}),e.jsx(C,{children:l("oauth.client.helperText.more")})]})]})})}),e.jsxs(Te,{variant:"outlined",sx:{p:2,display:"none"},children:[e.jsx(I,{variant:"subtitle2",gutterBottom:!0,children:l("oauth.client.input.permissions")}),e.jsx(c,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2},children:e.jsx(le,{children:Object.entries(k.OAUTH_SCOPES).map(([o,x])=>e.jsx(ne,{control:e.jsx(se,{checked:T.includes(o),onChange:()=>R(o),disabled:o==="profile:read",color:"primary"}),label:e.jsx(c,{children:e.jsx(I,{variant:"body2",sx:{fontWeight:500},children:x})})},o))})})]}),e.jsx(Y,{}),e.jsx(I,{variant:"h6",gutterBottom:!0,children:l("oauth.client.optionalInformation")}),e.jsx(q,{children:e.jsx(S,{name:"contacts",control:y,rules:{pattern:{value:/^$|^[^@\s]+@[^@\s]+\.[^@\s]+(\s*,\s*[^@\s]+@[^@\s]+\.[^@\s]+)*$/,message:l("oauth.client.validate.contacts")}},render:({field:o})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...o,label:l("oauth.client.input.contacts"),fullWidth:!0,placeholder:l("oauth.client.input.contactsPlaceholder"),error:!!u.contacts,helperText:u.contacts?.message}),e.jsx(C,{children:l("oauth.client.helperText.contacts")})]})})}),e.jsxs(q,{direction:{xs:"column",sm:"row"},spacing:2,children:[e.jsx(S,{name:"tosUri",control:y,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:l("oauth.client.validate.tosUriInvalid")}},render:({field:o})=>e.jsxs(c,{sx:{width:"50%"},children:[e.jsx(w,{size:"small",...o,label:l("oauth.client.input.tosUri"),fullWidth:!0,placeholder:l("oauth.client.input.tosUriPlaceholder"),error:!!u.tosUri,helperText:u.tosUri?.message}),e.jsx(C,{children:l("oauth.client.helperText.tosUri")})]})}),e.jsx(S,{name:"policyUri",control:y,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:l("oauth.client.validate.policyUriInvalid")}},render:({field:o})=>e.jsxs(c,{sx:{width:"50%"},children:[e.jsx(w,{size:"small",...o,label:l("oauth.client.input.policyUri"),fullWidth:!0,placeholder:l("oauth.client.input.policyUriPlaceholder"),error:!!u.policyUri,helperText:u.policyUri?.message}),e.jsx(C,{children:l("oauth.client.helperText.policyUri")})]})})]}),u.error&&e.jsx(oe,{severity:"error",children:u.error.message})]})}),e.jsxs(ae,{children:[e.jsx(z,{onClick:a,children:l("common.cancel")}),e.jsxs(z,{onClick:g(N),disabled:i,variant:"contained",color:"primary",children:[i?e.jsx(Z,{size:20,sx:{mr:1}}):null,l("oauth.client.registerButton")]})]})]})}pe.propTypes={onCreated:n.func.isRequired,onClose:n.func.isRequired};function J({scope:r="",...a}){if(!r)return null;const i=r.split(" ").filter(Boolean);return e.jsx(q,{direction:"row",...a,sx:[{flexWrap:"wrap",gap:1},...Array.isArray(a.sx)?a.sx:[a.sx]],children:i.map(h=>e.jsx(be.Fragment,{children:e.jsx(we,{title:k.OAUTH_SCOPES[h],children:e.jsx(v,{children:h})})},h))})}J.propTypes={scope:n.string};const ee=r=>{const{prefix:a}=$(),{blocklet:i}=Ne(),h=te(a,"/api/media/upload",i.appPid),l=b.useCallback(f=>f?f.startsWith("http")?f:`${te(a,"/api/media/upload",i.appPid)}/${f}`:"",[a,i.appPid]);return{clientLogoUrl:b.useMemo(()=>l(r),[r,l]),apiPath:h,getClientLogoUrl:l}},Be=b.lazy(()=>ye(()=>import("./index-M4Y_gFoP.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(r=>({default:r.Uploader})));function he({client:r,onUpdate:a,onClose:i}){const[h,l]=b.useState(!1),{t:s,locale:f}=D(),d=b.useRef(null),{api:y}=$(),{teamDid:g}=B(),{control:u,handleSubmit:W,formState:{errors:m},watch:T,setValue:R,getValues:N}=ue({defaultValues:{clientName:r.clientName||"",clientUri:r.clientUri||"",redirectUris:Array.isArray(r.redirectUris)?r.redirectUris.join(","):"",scope:r.scope?r.scope.split(" "):["profile:read"],contacts:Array.isArray(r.contacts)?r.contacts.join(","):"",tosUri:r.tosUri||"",policyUri:r.policyUri||"",logoUri:r.logoUri||"",clientSecretExpiresAt:r.clientSecretExpiresAt||null},mode:"onChange"}),o=T("scope"),x=T("logoUri"),{clientLogoUrl:A,apiPath:P}=ee(x),E=t=>{t!=="profile:read"&&R("scope",o.includes(t)?o.filter(p=>p!==t):[...o,t])},O=async t=>{const p={clientId:r.clientId,clientName:t.clientName.trim(),clientUri:t.clientUri,redirectUris:t.redirectUris.split(",").map(j=>j.trim()).filter(Boolean),contacts:t.contacts?t.contacts.split(",").map(j=>j.trim()):[],scope:t.scope.join(" "),tosUri:t.tosUri,policyUri:t.policyUri,logoUri:t.logoUri,clientSecretExpiresAt:t.clientSecretExpiresAt?parseInt(t.clientSecretExpiresAt/1e3,10):null};await y.updateOAuthClient({input:{teamDid:g,input:p}})},_=async t=>{l(!0);try{await O(t),a(),i()}catch(p){H.error(p.message||s("oauth.client.updateFailed"))}finally{l(!1)}};return e.jsxs(M,{open:!0,onClose:i,maxWidth:"md",fullWidth:!0,children:[e.jsxs(K,{children:[s("oauth.client.update")," ",e.jsx(X,{onClick:i,sx:{position:"absolute",right:8,top:8},children:e.jsx(G,{})})]}),e.jsx(Q,{children:e.jsxs(q,{spacing:3,sx:{mt:2},children:[e.jsxs(c,{sx:{mb:3},children:[e.jsx(I,{variant:"subtitle1",sx:{fontWeight:500,mb:1},children:s("oauth.client.logo")}),e.jsxs(c,{children:[e.jsx(c,{sx:{width:120,height:120,position:"relative",borderRadius:"4px",overflow:"hidden"},children:A?e.jsx(c,{children:e.jsx("img",{src:A,alt:"client-logo",style:{width:"100%",height:"100%"}})}):e.jsx(c,{onClick:()=>{d.current?.open()},sx:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",bgcolor:"grey.200"},children:e.jsx(ce,{sx:{fontSize:40,color:"common.white"}})})}),e.jsx(z,{sx:{mt:2},variant:"outlined",size:"small",onClick:()=>{d.current?.open()},children:s(A?"common.change":"common.upload")})]}),e.jsx(c,{sx:{display:"flex",alignItems:"center"},children:e.jsx(b.Suspense,{fallback:e.jsx(Le,{}),children:e.jsx(Be,{ref:d,locale:f,popup:!0,onUploadFinish:t=>{R("logoUri",t.data.filename),O(N()).then(()=>{a()}).catch(p=>{H.error(p.message||s("oauth.client.updateFailed"))}).finally(()=>{d.current?.close()})},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:P,disableMediaKitPrefix:!0,disableAutoPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/png","image/jpeg","image/webp","image/svg+xml"],maxFileSize:1024*1024*.5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{minWidth:256,minHeight:256}}}},"uploader-logo")})})]}),e.jsx(I,{variant:"subtitle1",sx:{fontWeight:500},children:s("oauth.client.requiredInformation")}),e.jsx(w,{label:"Client Id",fullWidth:!0,value:r.clientId,disabled:!0}),e.jsx(c,{children:e.jsx(S,{name:"clientName",control:u,rules:{required:s("oauth.client.validate.clientName"),minLength:{value:3,message:s("oauth.client.validate.clientNameMinLength")}},render:({field:t})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{...t,label:s("oauth.client.name"),required:!0,fullWidth:!0,error:!!m.clientName,helperText:m.clientName?.message}),e.jsx(C,{children:s("oauth.client.helperText.clientName")})]})})}),e.jsx(c,{children:e.jsx(S,{name:"clientUri",control:u,rules:{required:s("oauth.client.validate.clientUri"),pattern:{value:/^https?:\/\/.+/,message:s("oauth.client.validate.clientUriInvalid")}},render:({field:t})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{...t,label:s("oauth.client.input.clientUri"),required:!0,fullWidth:!0,error:!!m.clientUri,helperText:m.clientUri?.message}),e.jsx(C,{children:s("oauth.client.helperText.clientUri")})]})})}),e.jsx(c,{children:e.jsx(S,{name:"redirectUris",control:u,rules:{required:s("oauth.client.validate.redirectUris"),pattern:{value:/^https?:\/\/.+/,message:s("oauth.client.validate.redirectUrisInvalid")}},render:({field:t})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{...t,label:s("oauth.client.input.redirectUris"),required:!0,fullWidth:!0,multiline:!0,rows:2,error:!!m.redirectUris,helperText:m.redirectUris?.message}),e.jsx(C,{children:s("oauth.client.helperText.redirectUris")})]})})}),e.jsx(S,{name:"clientSecretExpiresAt",control:u,render:({field:t})=>e.jsx(Oe,{placeholder:s("oauth.client.input.expireTime"),value:t.value*1e3,onChange:p=>{t.onChange(p)}})}),e.jsxs(c,{sx:{display:"none"},children:[e.jsx(I,{variant:"subtitle2",sx:{mb:1},children:s("oauth.client.input.permissions")}),e.jsx(c,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2},children:e.jsx(le,{children:Object.entries(k.OAUTH_SCOPES).map(([t,p])=>e.jsx(ne,{control:e.jsx(se,{checked:o.includes(t),onChange:()=>E(t),disabled:t==="profile:read",color:"primary"}),label:e.jsx(c,{children:e.jsx(I,{variant:"body2",sx:{fontWeight:500},children:p})})},t))})})]}),e.jsx(Y,{}),e.jsx(I,{variant:"subtitle1",sx:{fontWeight:500},children:s("oauth.client.optionalInformation")}),e.jsx(c,{children:e.jsx(S,{name:"contacts",control:u,rules:{pattern:{value:/^$|^[^@\s]+@[^@\s]+\.[^@\s]+(\s*,\s*[^@\s]+@[^@\s]+\.[^@\s]+)*$/,message:s("oauth.client.validate.contacts")}},render:({field:t})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{...t,label:s("oauth.client.input.contacts"),fullWidth:!0,error:!!m.contacts,helperText:m.contacts?.message}),e.jsx(C,{children:s("oauth.client.helperText.contacts")})]})})}),e.jsxs(q,{direction:{xs:"column",sm:"row"},spacing:2,children:[e.jsx(S,{name:"tosUri",control:u,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:s("oauth.client.validate.tosUriInvalid")}},render:({field:t})=>e.jsxs(c,{sx:{width:"50%"},children:[e.jsx(w,{...t,label:s("oauth.client.input.tosUri"),fullWidth:!0,error:!!m.tosUri,helperText:m.tosUri?.message}),e.jsx(C,{children:s("oauth.client.helperText.tosUri")})]})}),e.jsx(S,{name:"policyUri",control:u,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:s("oauth.client.validate.policyUriInvalid")}},render:({field:t})=>e.jsxs(c,{sx:{width:"50%"},children:[e.jsx(w,{...t,label:s("oauth.client.input.policyUri"),fullWidth:!0,error:!!m.policyUri,helperText:m.policyUri?.message}),e.jsx(C,{children:s("oauth.client.helperText.policyUri")})]})})]}),m.error&&e.jsx(oe,{severity:"error",children:m.error.message})]})}),e.jsxs(ae,{children:[e.jsx(z,{onClick:i,children:s("common.cancel")}),e.jsx(z,{onClick:W(_),disabled:h,variant:"contained",color:"primary",children:h?e.jsx(Z,{size:16}):s("common.update")})]})]})}he.propTypes={client:n.shape({clientId:n.string.isRequired,clientName:n.string.isRequired,clientUri:n.string,redirectUris:n.arrayOf(n.string),scope:n.string,contacts:n.arrayOf(n.string),tosUri:n.string,policyUri:n.string,logoUri:n.string,clientSecretExpiresAt:n.number}).isRequired,onUpdate:n.func.isRequired,onClose:n.func.isRequired};function me({client:r,onUpdate:a,onClose:i}){return e.jsx(he,{client:r,onUpdate:h=>a(h),onClose:i})}me.propTypes={client:n.shape({clientId:n.string.isRequired,clientName:n.string.isRequired,clientUri:n.string,redirectUris:n.arrayOf(n.string),scope:n.string,contacts:n.arrayOf(n.string),tosUri:n.string,policyUri:n.string,logoUri:n.string,clientSecretExpiresAt:n.number}).isRequired,onUpdate:n.func.isRequired,onClose:n.func.isRequired};function xe({clientId:r,clientName:a,onDelete:i=()=>{},onClose:h=()=>{}}){const{t:l}=D(),{api:s}=$(),{teamDid:f}=B(),d=()=>{h()},y=async()=>{try{await s.deleteOAuthClient({input:{teamDid:f,clientId:r}}),i()}catch(u){H.error(u?.message)}finally{d()}},g={keyName:a,title:l("oauth.client.delete.title"),description:l("oauth.client.delete.description",{name:`<b>${a}</b>`}),confirmPlaceholder:l("oauth.client.delete.description",{name:a}),confirm:l("common.delConfirm"),cancel:l("common.cancel"),onConfirm:y,onCancel:d};return e.jsx(_e,{keyName:g.keyName,title:g.title,description:g.description,confirmPlaceholder:g.confirmPlaceholder,confirm:g.confirm,cancel:g.cancel,params:g.params,onConfirm:g.onConfirm,onCancel:g.onCancel})}xe.propTypes={clientId:n.string.isRequired,clientName:n.string.isRequired,onDelete:n.func,onClose:n.func};function je({title:r,items:a}){return e.jsxs(c,{sx:{mb:3},children:[e.jsx(I,{variant:"h6",sx:{mb:1.5},children:r}),e.jsx(q,{spacing:1.5,children:a.map(({label:i,value:h})=>e.jsxs(c,{sx:{display:"flex",alignItems:"center",gap:2},children:[e.jsx(I,{variant:"subtitle2",color:"textSecondary",sx:{minWidth:200},children:i}),e.jsx(I,{sx:{wordBreak:"break-all"},children:h||"-"})]},i))})]})}je.propTypes={title:n.string.isRequired,items:n.arrayOf(n.shape({label:n.string.isRequired,value:n.any})).isRequired};function ge({client:r,onClose:a}){const{t:i,locale:h}=D(),{teamDid:l}=B(),{clientName:s,clientId:f,clientSecret:d,redirectUris:y,scope:g,clientUri:u,logoUri:W,contacts:m,tosUri:T,policyUri:R,jwksUri:N,jwks:o,softwareId:x,softwareVersion:A,clientIdIssuedAt:P,clientSecretExpiresAt:E,updatedAt:O,createUser:_}=r,{clientLogoUrl:t}=ee(W),p=L=>{try{const F=new URL(window.blocklet.appUrl);return F.pathname=L,F.toString()}catch{return"-"}},j=de.fromAppDid(f,l),U=[{title:i("common.baseInfo"),items:[{label:i("oauth.client.name"),value:s},{label:i("oauth.client.logoUri"),value:e.jsx(re,{variant:"rounded",shape:"square",src:t,did:j.address,size:64})},{label:i("oauth.client.clientUri"),value:u?e.jsx(v,{children:u}):"-"},{label:i("oauth.client.clientId"),value:e.jsx(v,{children:f})},{label:i("oauth.client.clientSecret"),value:e.jsx(v,{children:d})},{label:i("oauth.client.redirectUris"),value:e.jsx(v,{children:(y||[]).join(", ")})},{label:i("oauth.client.scope"),value:e.jsx(J,{scope:g})},{label:i("oauth.client.createUser"),value:_?ze(_,!0):i("oauth.client.openRegistration")}]},{title:i("oauth.client.oauthEndpoints"),items:[{label:i("oauth.client.openidConfiguration"),value:e.jsx(v,{children:p("/.well-known/openid-configuration")})},{label:i("oauth.client.authorizationEndpoint"),value:e.jsx(v,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/authorize`)})},{label:i("oauth.client.tokenEndpoint"),value:e.jsx(v,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/token`)})},{label:i("oauth.client.userinfoEndpoint"),value:e.jsx(v,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/userinfo`)})},{label:i("oauth.client.jwksUri"),value:e.jsx(v,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/jwks`)})},{label:i("oauth.client.registrationEndpoint"),value:e.jsx(v,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/register`)})},{label:i("oauth.client.endSessionEndpoint"),value:e.jsx(v,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/logout`)})}]},{title:i("oauth.client.metaContact"),items:[{label:i("oauth.client.contacts"),value:m.length?e.jsx(v,{children:(m||[]).join(", ")}):"-"},{label:i("oauth.client.tosUri"),value:T?e.jsx(v,{children:T}):"-"},{label:i("oauth.client.policyUri"),value:R?e.jsx(v,{children:R}):"-"},{label:i("oauth.client.jwksUri"),value:N},{label:i("oauth.client.jwks"),value:o},{label:i("oauth.client.softwareId"),value:x},{label:i("oauth.client.softwareVersion"),value:A}]},{title:i("common.timeInfo"),items:[{label:i("oauth.client.clientIdIssuedAt"),value:P?e.jsx(V,{value:P*1e3,type:"all",locale:h}):"-"},{label:i("oauth.client.clientSecretExpiresAt"),value:E?e.jsx(V,{value:E*1e3,type:"all",locale:h}):"-"},{label:i("common.updatedAt"),value:O?e.jsx(V,{value:O,type:"all",locale:h}):"-"}]}].filter(Boolean);return e.jsxs(M,{open:!0,onClose:a,maxWidth:"lg",fullWidth:!0,children:[e.jsxs(K,{children:[i("oauth.client.oauthAppDetails"),e.jsx(X,{onClick:a,sx:{position:"absolute",right:8,top:8},children:e.jsx(G,{})})]}),e.jsx(Q,{children:e.jsx(c,{sx:{mt:1},children:U.map((L,F)=>e.jsxs(c,{children:[e.jsx(je,{title:L.title,items:L.items}),F!==U.length-1&&e.jsx(Y,{sx:{my:2}})]},L.title))})})]})}ge.propTypes={client:n.object.isRequired,onClose:n.func.isRequired};function Ve(r){return e.jsx(V,{value:r*1e3})}function fe({selected:r=null,onClose:a}){return r?e.jsx(ge,{client:r,onClose:a}):null}fe.propTypes={selected:n.object,onClose:n.func.isRequired};function Ue({open:r,onCreated:a,onClose:i}){return r?e.jsx(pe,{onCreated:a,onClose:i}):null}Ue.propTypes={open:n.bool.isRequired,onCreated:n.func.isRequired,onClose:n.func.isRequired};function Tt(){const[r,a]=b.useState({searchText:"",pageSize:10,page:1}),[i,h]=b.useState(null),[l,s]=b.useState(!1),f=b.useRef(null),{t:d,locale:y}=D(),{api:g}=$(),{teamDid:u}=B(),[W,m]=b.useState(null),[T,R]=b.useState(null),N=De(),{getClientLogoUrl:o}=ee(),x=ke(async()=>await g.getOAuthClients({input:{teamDid:u,paging:{page:r.page,pageSize:r.pageSize}}}),[r.page,r.pageSize]),{loading:A}=x,P=b.useMemo(()=>x.value?.list||[],[x.value?.list]),E=b.useMemo(()=>r.searchText?P.filter(t=>t.clientName.toLowerCase().includes(r.searchText.toLowerCase())||t.clientId.toLowerCase().includes(r.searchText.toLowerCase())||t.scope.toLowerCase().includes(r.searchText.toLowerCase())):P,[r.searchText,P]),O=b.useMemo(()=>[{label:d("oauth.client.name"),name:"clientName",options:{customBodyRender:(t,{rowIndex:p})=>{const j=E[p],U=o(j.logoUri),L=de.fromAppDid(j.clientId,u);return e.jsx(c,{sx:{display:"flex",alignItems:"center",gap:2},children:e.jsxs(c,{sx:{display:"flex",alignItems:"center",gap:2,cursor:"pointer"},children:[e.jsx(re,{variant:"rounded",shape:"square",did:L.address,src:U,size:48}),e.jsxs(q,{sx:{gap:.5},children:[e.jsx(c,{sx:{color:"text.primary"},children:j.clientName}),e.jsx(c,{sx:{color:"text.secondary"},children:j.clientUri})]})]})})}}},{label:d("oauth.client.clientId"),name:"clientId"},{label:d("oauth.client.scope"),name:"scope",options:{customBodyRender:t=>e.jsx(J,{scope:t})}},{label:d("common.createdAt"),name:"clientIdIssuedAt",options:{customBodyRender:Ve}},{label:d("common.createdBy"),name:"createdBy",width:100,options:{customBodyRender:t=>t?e.jsx(Re,{showDid:!0,did:t,cardType:Ae.Detailed,infoType:Ee.Minimal,sx:{border:0,padding:0}}):d("oauth.client.openRegistration")}},{label:d("common.actions"),name:"actions",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRender:(t,{rowIndex:p})=>{const j=E[p];return e.jsx(Fe,{actions:[{icon:e.jsx(Se,{}),text:d("common.edit"),onClick:U=>{U.stopPropagation(),m(j)}},{icon:e.jsx(Ie,{}),text:d("common.delete"),onClick:U=>{U.stopPropagation(),R(j)}}]})}}}],[E,d,o,u,m,R]),_=({page:t,rowsPerPage:p,searchText:j})=>{r.pageSize!==p?a(U=>({...U,searchText:"",pageSize:p,page:1})):r.page!==t+1?a(U=>({...U,searchText:"",page:t+1})):r.searchText!==j&&a(U=>({...U,searchText:j,page:1}))};return e.jsxs(c,{ref:f,sx:{".custom-toobar-btns":{gap:"8px"},".custom-toobar-title .custom-toobar-title-inner>span":{display:"flex",alignItems:"center","white-space":"inherit",height:"100%"}},children:[N?e.jsx(ie,{title:d("oauth.client.listTitle"),tooltipTitle:d("oauth.client.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${y}/oauth-service`}):null,e.jsx(ve,{data:E,columns:O,options:{sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,page:r.page-1,rowsPerPage:r.pageSize,count:E.length,searchDebounceTime:400,onRowClick(t,{dataIndex:p},j){if(f.current?.contains(j.target)){const U=E[p];h(U)}}},onChange:_,title:N?null:e.jsx(ie,{title:d("oauth.client.listTitle"),tooltipTitle:d("oauth.client.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${y}/oauth-service`}),customButtons:[e.jsxs(z,{variant:"contained",size:"small",onClick:()=>s(!0),children:[A?e.jsx(Z,{size:16}):e.jsx(ce,{style:{fontSize:16}}),d("common.create")]},"add")],loading:!1,emptyNode:e.jsx(Ce,{children:d("oauth.client.empty")})}),e.jsx(fe,{selected:i,onClose:()=>h(null)}),e.jsx(Ue,{open:l,onCreated:()=>{s(!1),x.retry()},onClose:()=>s(!1)}),W&&e.jsx(me,{client:W,onUpdate:x.retry,onClose:()=>m(null)}),T&&e.jsx(xe,{...T,onDelete:x.retry,onClose:()=>R(null)})]})}export{Tt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./vendor-react-Dvs43sk9.js";import{j as e,s as c,ak as a,b1 as i,W as l}from"./vendor-mui-core-
|
|
1
|
+
import"./vendor-react-Dvs43sk9.js";import{j as e,s as c,ak as a,b1 as i,W as l}from"./vendor-mui-core-BFPsXaTR.js";const t=c(a)(({theme:r})=>({backgroundColor:r.palette.background.default,"& .header-row":{display:"flex",justifyContent:"space-between",alignItems:"center",gap:r.spacing(1)},"& .right":{display:"flex",alignItems:"center",gap:r.spacing(1.5)},"& .tabs":{marginTop:r.spacing(2),"& .MuiButton-root":{border:"none",color:"#999","&.active":{color:"#222"}}},"@media (max-width: 900px)":{"& .header-row":{flexDirection:"column",alignItems:"flex-start"},"& .right":{flexDirection:"column",width:"100%",".search-always-open, .toolbar-btn-show, a, button, .MuiButtonGroup-root":{width:"100% !important"}}}}));function d({left:r=null,tabs:n=null,actions:s=null,...o}){return!r&&!n?e.jsx(t,{elevation:0,...o,children:e.jsxs(a,{className:"header-row",children:[e.jsx(a,{className:"left"}),e.jsx(i,{direction:"row",className:"right",children:s})]})}):r&&!n||!r&&n?e.jsx(t,{elevation:0,...o,children:e.jsxs(a,{className:"header-row",children:[e.jsx(a,{className:"left",children:r||n}),e.jsx(i,{direction:"row",className:"right",children:s})]})}):e.jsxs(t,{elevation:0,...o,children:[e.jsxs(a,{className:"header-row",children:[e.jsx(a,{className:"left",children:r}),e.jsx(i,{direction:"row",className:"right",children:s})]}),n&&e.jsx(a,{sx:{mt:2},children:n})]})}d.propTypes={left:l.node,tabs:l.node,actions:l.node};export{d as L};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as o}from"./vendor-mui-core-BFPsXaTR.js";import"./vendor-react-Dvs43sk9.js";import{S as t}from"./studio-Dqjq8IDN.js";import"./vendor-ux-CE4sOH7O.js";import"./vendor-utils-OrZFrHBP.js";import"./vendor-hooks-DmThWyyG.js";import"./lottie-web-4koyQiv_.js";import"./index-CtjgKQvS.js";import"./index-CmM1Fb8I.js";import"./vendor-arcblock-DGOH9a3F.js";function f(){return o.jsx(t,{children:"Coming soon..."})}export{f as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{at as fe,j as Y,W as te,J as Ye,bi as Xe,Q as Je,ak as _e,a6 as Le,cO as Ze,y as Fe,bc as We,M as Ue,cj as Qe,z as et}from"./vendor-mui-core-
|
|
1
|
+
import{at as fe,j as Y,W as te,J as Ye,bi as Xe,Q as Je,ak as _e,a6 as Le,cO as Ze,y as Fe,bc as We,M as Ue,cj as Qe,z as et}from"./vendor-mui-core-BFPsXaTR.js";import{u as tt}from"./useLocalStorage-Be_1V0gr.js";import{p as De,a as it,d as rt,g as Ne,r as oe}from"./vendor-react-Dvs43sk9.js";import{d as st,n as Re}from"./vendor-utils-OrZFrHBP.js";import{aB as nt,Z as $e,a0 as ot}from"./index-CmM1Fb8I.js";import{V as at,p as Ae,q as ht,H as lt}from"./vendor-ux-CE4sOH7O.js";import{B as ct}from"./bundle-avatar-CRBdm-Kg.js";import"./vendor-arcblock-DGOH9a3F.js";import"./vendor-hooks-DmThWyyG.js";import"./lottie-web-4koyQiv_.js";var ye={exports:{}},Be;function dt(){return Be||(Be=1,function(G,V){(function(j,K){G.exports=K()})(globalThis,()=>(()=>{var j={4567:function(R,s,o){var c=this&&this.__decorate||function(e,r,a,f){var p,g=arguments.length,l=g<3?r:f===null?f=Object.getOwnPropertyDescriptor(r,a):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,r,a,f);else for(var m=e.length-1;m>=0;m--)(p=e[m])&&(l=(g<3?p(l):g>3?p(r,a,l):p(r,a))||l);return g>3&&l&&Object.defineProperty(r,a,l),l},_=this&&this.__param||function(e,r){return function(a,f){r(a,f,e)}};Object.defineProperty(s,"__esModule",{value:!0}),s.AccessibilityManager=void 0;const n=o(9042),d=o(9924),u=o(844),v=o(4725),h=o(2585),t=o(3656);let i=s.AccessibilityManager=class extends u.Disposable{constructor(e,r,a,f){super(),this._terminal=e,this._coreBrowserService=a,this._renderService=f,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let p=0;p<this._terminal.rows;p++)this._rowElements[p]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[p]);if(this._topBoundaryFocusListener=p=>this._handleBoundaryFocus(p,0),this._bottomBoundaryFocusListener=p=>this._handleBoundaryFocus(p,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new d.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(p=>this._handleResize(p.rows))),this.register(this._terminal.onRender(p=>this._refreshRows(p.start,p.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(p=>this._handleChar(p))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
2
2
|
`))),this.register(this._terminal.onA11yTab(p=>this._handleTab(p))),this.register(this._terminal.onKey(p=>this._handleKey(p.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this.register((0,t.addDisposableDomListener)(document,"selectionchange",()=>this._handleSelectionChange())),this.register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,u.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let r=0;r<e;r++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
3
3
|
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=n.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,r){this._liveRegionDebouncer.refresh(e,r,this._terminal.rows)}_renderRows(e,r){const a=this._terminal.buffer,f=a.lines.length.toString();for(let p=e;p<=r;p++){const g=a.lines.get(a.ydisp+p),l=[],m=g?.translateToString(!0,void 0,void 0,l)||"",E=(a.ydisp+p+1).toString(),x=this._rowElements[p];x&&(m.length===0?(x.innerText=" ",this._rowColumns.set(x,[0,1])):(x.textContent=m,this._rowColumns.set(x,l)),x.setAttribute("aria-posinset",E),x.setAttribute("aria-setsize",f))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,r){const a=e.target,f=this._rowElements[r===0?1:this._rowElements.length-2];if(a.getAttribute("aria-posinset")===(r===0?"1":`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==f)return;let p,g;if(r===0?(p=a,g=this._rowElements.pop(),this._rowContainer.removeChild(g)):(p=this._rowElements.shift(),g=a,this._rowContainer.removeChild(p)),p.removeEventListener("focus",this._topBoundaryFocusListener),g.removeEventListener("focus",this._bottomBoundaryFocusListener),r===0){const l=this._createAccessibilityTreeNode();this._rowElements.unshift(l),this._rowContainer.insertAdjacentElement("afterbegin",l)}else{const l=this._createAccessibilityTreeNode();this._rowElements.push(l),this._rowContainer.appendChild(l)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(r===0?-1:1),this._rowElements[r===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const e=document.getSelection();if(!e)return;if(e.isCollapsed)return void(this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection());if(!e.anchorNode||!e.focusNode)return void console.error("anchorNode and/or focusNode are null");let r={node:e.anchorNode,offset:e.anchorOffset},a={node:e.focusNode,offset:e.focusOffset};if((r.node.compareDocumentPosition(a.node)&Node.DOCUMENT_POSITION_PRECEDING||r.node===a.node&&r.offset>a.offset)&&([r,a]=[a,r]),r.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(r={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(r.node))return;const f=this._rowElements.slice(-1)[0];if(a.node.compareDocumentPosition(f)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(a={node:f,offset:f.textContent?.length??0}),!this._rowContainer.contains(a.node))return;const p=({node:m,offset:E})=>{const x=m instanceof Text?m.parentNode:m;let L=parseInt(x?.getAttribute("aria-posinset"),10)-1;if(isNaN(L))return console.warn("row is invalid. Race condition?"),null;const b=this._rowColumns.get(x);if(!b)return console.warn("columns is null. Race condition?"),null;let A=E<b.length?b[E]:b.slice(-1)[0]+1;return A>=this._terminal.cols&&(++L,A=0),{row:L,column:A}},g=p(r),l=p(a);if(g&&l){if(g.row>l.row||g.row===l.row&&g.column>=l.column)throw new Error("invalid range");this._terminal.select(g.column,g.row,(l.row-g.row)*this._terminal.cols-g.column+l.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let r=this._rowContainer.children.length;r<this._terminal.rows;r++)this._rowElements[r]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[r]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}};s.AccessibilityManager=i=c([_(1,h.IInstantiationService),_(2,v.ICoreBrowserService),_(3,v.IRenderService)],i)},3614:(R,s)=>{function o(d){return d.replace(/\r?\n/g,"\r")}function c(d,u){return u?"\x1B[200~"+d+"\x1B[201~":d}function _(d,u,v,h){d=c(d=o(d),v.decPrivateModes.bracketedPasteMode&&h.rawOptions.ignoreBracketedPasteMode!==!0),v.triggerDataEvent(d,!0),u.value=""}function n(d,u,v){const h=v.getBoundingClientRect(),t=d.clientX-h.left-10,i=d.clientY-h.top-10;u.style.width="20px",u.style.height="20px",u.style.left=`${t}px`,u.style.top=`${i}px`,u.style.zIndex="1000",u.focus()}Object.defineProperty(s,"__esModule",{value:!0}),s.rightClickHandler=s.moveTextAreaUnderMouseCursor=s.paste=s.handlePasteEvent=s.copyHandler=s.bracketTextForPaste=s.prepareTextForTerminal=void 0,s.prepareTextForTerminal=o,s.bracketTextForPaste=c,s.copyHandler=function(d,u){d.clipboardData&&d.clipboardData.setData("text/plain",u.selectionText),d.preventDefault()},s.handlePasteEvent=function(d,u,v,h){d.stopPropagation(),d.clipboardData&&_(d.clipboardData.getData("text/plain"),u,v,h)},s.paste=_,s.moveTextAreaUnderMouseCursor=n,s.rightClickHandler=function(d,u,v,h,t){n(d,u,v),t&&h.rightClickSelect(d),u.value=h.selectionText,u.select()}},7239:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const c=o(1505);s.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(_,n,d){this._css.set(_,n,d)}getCss(_,n){return this._css.get(_,n)}setColor(_,n,d){this._color.set(_,n,d)}getColor(_,n){return this._color.get(_,n)}clear(){this._color.clear(),this._css.clear()}}},3656:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(o,c,_,n){o.addEventListener(c,_,n);let d=!1;return{dispose:()=>{d||(d=!0,o.removeEventListener(c,_,n))}}}},3551:function(R,s,o){var c=this&&this.__decorate||function(i,e,r,a){var f,p=arguments.length,g=p<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,r):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(i,e,r,a);else for(var l=i.length-1;l>=0;l--)(f=i[l])&&(g=(p<3?f(g):p>3?f(e,r,g):f(e,r))||g);return p>3&&g&&Object.defineProperty(e,r,g),g},_=this&&this.__param||function(i,e){return function(r,a){e(r,a,i)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Linkifier=void 0;const n=o(3656),d=o(8460),u=o(844),v=o(2585),h=o(4725);let t=s.Linkifier=class extends u.Disposable{get currentLink(){return this._currentLink}constructor(i,e,r,a,f){super(),this._element=i,this._mouseService=e,this._renderService=r,this._bufferService=a,this._linkProviderService=f,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new d.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new d.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,u.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,u.toDisposable)(()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this.register((0,n.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,n.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(i){this._lastMouseEvent=i;const e=this._positionFromMouseEvent(i,this._element,this._mouseService);if(!e)return;this._isMouseOut=!1;const r=i.composedPath();for(let a=0;a<r.length;a++){const f=r[a];if(f.classList.contains("xterm"))break;if(f.classList.contains("xterm-hover"))return}this._lastBufferCell&&e.x===this._lastBufferCell.x&&e.y===this._lastBufferCell.y||(this._handleHover(e),this._lastBufferCell=e)}_handleHover(i){if(this._activeLine!==i.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(i,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,i)||(this._clearCurrentLink(),this._askForLink(i,!0))}_askForLink(i,e){this._activeProviderReplies&&e||(this._activeProviderReplies?.forEach(a=>{a?.forEach(f=>{f.link.dispose&&f.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=i.y);let r=!1;for(const[a,f]of this._linkProviderService.linkProviders.entries())e?this._activeProviderReplies?.get(a)&&(r=this._checkLinkProviderResult(a,i,r)):f.provideLinks(i.y,p=>{if(this._isMouseOut)return;const g=p?.map(l=>({link:l}));this._activeProviderReplies?.set(a,g),r=this._checkLinkProviderResult(a,i,r),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(i.y,this._activeProviderReplies)})}_removeIntersectingLinks(i,e){const r=new Set;for(let a=0;a<e.size;a++){const f=e.get(a);if(f)for(let p=0;p<f.length;p++){const g=f[p],l=g.link.range.start.y<i?0:g.link.range.start.x,m=g.link.range.end.y>i?this._bufferService.cols:g.link.range.end.x;for(let E=l;E<=m;E++){if(r.has(E)){f.splice(p--,1);break}r.add(E)}}}}_checkLinkProviderResult(i,e,r){if(!this._activeProviderReplies)return r;const a=this._activeProviderReplies.get(i);let f=!1;for(let p=0;p<i;p++)this._activeProviderReplies.has(p)&&!this._activeProviderReplies.get(p)||(f=!0);if(!f&&a){const p=a.find(g=>this._linkAtPosition(g.link,e));p&&(r=!0,this._handleNewLink(p))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!r)for(let p=0;p<this._activeProviderReplies.size;p++){const g=this._activeProviderReplies.get(p)?.find(l=>this._linkAtPosition(l.link,e));if(g){r=!0,this._handleNewLink(g);break}}return r}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(i){if(!this._currentLink)return;const e=this._positionFromMouseEvent(i,this._element,this._mouseService);e&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,e)&&this._currentLink.link.activate(i,this._currentLink.link.text)}_clearCurrentLink(i,e){this._currentLink&&this._lastMouseEvent&&(!i||!e||this._currentLink.link.range.start.y>=i&&this._currentLink.link.range.end.y<=e)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,u.disposeArray)(this._linkCacheDisposables))}_handleNewLink(i){if(!this._lastMouseEvent)return;const e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._linkAtPosition(i.link,e)&&(this._currentLink=i,this._currentLink.state={decorations:{underline:i.link.decorations===void 0||i.link.decorations.underline,pointerCursor:i.link.decorations===void 0||i.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,i.link,this._lastMouseEvent),i.link.decorations={},Object.defineProperties(i.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:r=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==r&&(this._currentLink.state.decorations.pointerCursor=r,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",r))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:r=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==r&&(this._currentLink.state.decorations.underline=r,this._currentLink.state.isHovered&&this._fireUnderlineEvent(i.link,r))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(r=>{if(!this._currentLink)return;const a=r.start===0?0:r.start+1+this._bufferService.buffer.ydisp,f=this._bufferService.buffer.ydisp+1+r.end;if(this._currentLink.link.range.start.y>=a&&this._currentLink.link.range.end.y<=f&&(this._clearCurrentLink(a,f),this._lastMouseEvent)){const p=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);p&&this._askForLink(p,!1)}})))}_linkHover(i,e,r){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!0),this._currentLink.state.decorations.pointerCursor&&i.classList.add("xterm-cursor-pointer")),e.hover&&e.hover(r,e.text)}_fireUnderlineEvent(i,e){const r=i.range,a=this._bufferService.buffer.ydisp,f=this._createLinkUnderlineEvent(r.start.x-1,r.start.y-a-1,r.end.x,r.end.y-a-1,void 0);(e?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(f)}_linkLeave(i,e,r){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!1),this._currentLink.state.decorations.pointerCursor&&i.classList.remove("xterm-cursor-pointer")),e.leave&&e.leave(r,e.text)}_linkAtPosition(i,e){const r=i.range.start.y*this._bufferService.cols+i.range.start.x,a=i.range.end.y*this._bufferService.cols+i.range.end.x,f=e.y*this._bufferService.cols+e.x;return r<=f&&f<=a}_positionFromMouseEvent(i,e,r){const a=r.getCoords(i,e,this._bufferService.cols,this._bufferService.rows);if(a)return{x:a[0],y:a[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(i,e,r,a,f){return{x1:i,y1:e,x2:r,y2:a,cols:this._bufferService.cols,fg:f}}};s.Linkifier=t=c([_(1,h.IMouseService),_(2,h.IRenderService),_(3,v.IBufferService),_(4,h.ILinkProviderService)],t)},9042:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tooMuchOutput=s.promptLabel=void 0,s.promptLabel="Terminal input",s.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(R,s,o){var c=this&&this.__decorate||function(h,t,i,e){var r,a=arguments.length,f=a<3?t:e===null?e=Object.getOwnPropertyDescriptor(t,i):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(h,t,i,e);else for(var p=h.length-1;p>=0;p--)(r=h[p])&&(f=(a<3?r(f):a>3?r(t,i,f):r(t,i))||f);return a>3&&f&&Object.defineProperty(t,i,f),f},_=this&&this.__param||function(h,t){return function(i,e){t(i,e,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkProvider=void 0;const n=o(511),d=o(2585);let u=s.OscLinkProvider=class{constructor(h,t,i){this._bufferService=h,this._optionsService=t,this._oscLinkService=i}provideLinks(h,t){const i=this._bufferService.buffer.lines.get(h-1);if(!i)return void t(void 0);const e=[],r=this._optionsService.rawOptions.linkHandler,a=new n.CellData,f=i.getTrimmedLength();let p=-1,g=-1,l=!1;for(let m=0;m<f;m++)if(g!==-1||i.hasContent(m)){if(i.loadCell(m,a),a.hasExtendedAttrs()&&a.extended.urlId){if(g===-1){g=m,p=a.extended.urlId;continue}l=a.extended.urlId!==p}else g!==-1&&(l=!0);if(l||g!==-1&&m===f-1){const E=this._oscLinkService.getLinkData(p)?.uri;if(E){const x={start:{x:g+1,y:h},end:{x:m+(l||m!==f-1?0:1),y:h}};let L=!1;if(!r?.allowNonHttpProtocols)try{const b=new URL(E);["http:","https:"].includes(b.protocol)||(L=!0)}catch{L=!0}L||e.push({text:E,range:x,activate:(b,A)=>r?r.activate(b,A,x):v(0,A),hover:(b,A)=>r?.hover?.(b,A,x),leave:(b,A)=>r?.leave?.(b,A,x)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(g=m,p=a.extended.urlId):(g=-1,p=-1)}}t(e)}};function v(h,t){if(confirm(`Do you want to navigate to ${t}?
|
|
4
4
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{k as e,n as s}from"./vendor-ux-CE4sOH7O.js";const c=e("blocklet-services");s("blocklet-services");export{c as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,ak as p,T as I,W as c,am as Q,Q as O,bH as de,a6 as pe}from"./vendor-mui-core-BFPsXaTR.js";import{f as fe,a as ue,b as ge,h as me}from"./vendor-hooks-DmThWyyG.js";import{r as J,i as he}from"./vendor-react-Dvs43sk9.js";import{a as we,a7 as xe,Q as ye,c as L,aq as Pe,H as F,s as ke,b as ve,a1 as $,ar as je,as as be}from"./index-CmM1Fb8I.js";import{C as W,b as _,J as Ie,c as Te}from"./vendor-utils-OrZFrHBP.js";import{o as Ce}from"./vendor-arcblock-DGOH9a3F.js";import{$ as Le,v as _e,V as X,J as M,u as Re,K as We,O as Ae,H as V,y as Ee,P as z}from"./vendor-ux-CE4sOH7O.js";import{u as Ne}from"./use-passport-id-B-b-_oYF.js";import{g as B}from"./get-safe-url-94yHUMyk.js";import{d as R}from"./logger-DkBs7Soy.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(Q,{title:f("login.accessLimit.buyPassport"),arrow:!0,placement:"top",children:e.jsx(O,{color:"primary",variant:"contained",endIcon:e.jsx(de,{}),href:g,target:"_blank",children:l.title||l.name})},l.name):e.jsx(Q,{title:f("login.connectWithPassport"),arrow:!0,placement:"top",children:e.jsx(O,{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 Be(){const a=J.useRef(null),{session:s}=we(),{t:i,locale:y}=X(),{getPassportId:f}=Ne(),P=he(),k=M(),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),$(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(B(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:M(),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 $(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]),K=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=B(Ie(x,r),{allowDomains:null});window.location.href=le});me(()=>{if(o.get("sessionToken")){const n=o.get("visitorId");if(!n){V.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?K():!E&&!o.get("sessionToken")&&q()});const ce=n=>{V.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:K,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{Be as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,av as d,ak as r,T as m,aX as p,Q as u}from"./vendor-mui-core-
|
|
1
|
+
import{j as e,av as d,ak as r,T as m,aX as p,Q as u}from"./vendor-mui-core-BFPsXaTR.js";import{g as x,j as f,h}from"./vendor-hooks-DmThWyyG.js";import{u as c}from"./vendor-react-Dvs43sk9.js";import{g as j,c as y,k as w,u as C}from"./index-CmM1Fb8I.js";import{V as v}from"./vendor-ux-CE4sOH7O.js";import{C as k}from"./vendor-utils-OrZFrHBP.js";import"./vendor-arcblock-DGOH9a3F.js";import"./lottie-web-4koyQiv_.js";const M="authorization_response",A=j();function L(){const{t:s}=v(),[n]=c(),a=()=>{window.close()};return h(()=>{const i=n.get("state"),l=n.get("code"),t={type:M,response:{code:l}};if(window.opener)try{const o=new URL(i);window.opener.postMessage(t,o.origin),setTimeout(()=>{window.close()},2e3)}catch(o){console.error("Invalid login caller",o)}}),e.jsx(p,{severity:"success",children:e.jsxs(r,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignContent:"center",gap:1},children:[s("login.needManualClose"),e.jsx(r,{sx:{textAlign:"center"},children:e.jsx(u,{variant:"outlined",size:"small",onClick:a,children:s("login.closeWindow")})})]})})}function b(){const{blocklet:s}=window,[n]=c(),a=n.get("error"),i=n.get("error_description"),l=n.get("state"),t=x({errorMesage:"",loading:!0});f(async()=>{if(a)t.errorMesage=i,t.loading=!1;else try{const g=new URL(l);(await A.federated.getTrustedDomains()).includes(g.hostname)||(t.errorMesage="Invalid login caller")}catch{t.errorMesage="Invalid login caller"}finally{t.loading=!1}},[a,i,l]);const o=k(y.WELLKNOWN_SERVICE_PATH_PREFIX,`/blocklet/logo?&version=${s?.meta?.version||""}`);return e.jsx(d,{sx:{display:"flex",flexDirection:"column",minHeight:"100vh",justifyContent:"center",alignContent:"center"},children:e.jsxs(r,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,minHeight:"100vh",margin:"auto",paddingBottom:{sx:0,md:15}},children:[e.jsxs(r,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:.5},children:[e.jsx(r,{component:"img",src:o,alt:`${s?.appName||"site"} logo`,sx:{width:80}}),e.jsx(m,{variant:"h6",component:"p",children:s?.appName})]}),t.loading?t.errorMesage?e.jsx(w,{error:{message:t.errorMesage}}):e.jsx(L,{}):null,e.jsx(C,{sx:{mt:4}})]})})}export{b as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.__toCdnUrl("assets/vendor-ux-DYcPPYq2.css"),window.__toCdnUrl("assets/index-DrVXX4fX.css"),window.__toCdnUrl("assets/index-B5LvOF-F.css")])))=>i.map(i=>d[i]);
|
|
2
|
-
import{
|
|
2
|
+
import{V as O,C as _,_ as C}from"./vendor-ux-CE4sOH7O.js";import{r as m}from"./vendor-react-Dvs43sk9.js";import{j as o,ak as u,at as k,W as e}from"./vendor-mui-core-BFPsXaTR.js";import{n as d,C as q}from"./vendor-utils-OrZFrHBP.js";const z=m.lazy(()=>C(()=>import("./index-M4Y_gFoP.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(t=>({default:t.Uploader}))),F="/blocklet/logo/upload",c=[".png",".jpg",".jpeg",".webp",".bmp",".ico"];function U({url:t,height:f=80,width:g="auto",enabled:s=!0,allowSVG:h=!0,type:r,did:a,prefix:b,headers:x=d,aspectRatio:l=1,minWidth:P=256,minHeight:R=256,onUploaded:j=d,children:n=null}){const{t:v,locale:w}=O(),i=m.useRef(null),p=()=>{i.current?.open()},y=()=>{j(),i.current?.close()},E={cursor:s?"pointer":"default","&::after":{content:`"${v("common.switch")}"`}};return o.jsxs(S,{id:`uploader-${a}-${r}`,children:[o.jsx(z,{ref:i,locale:w,popup:!0,onUploadFinish:y,plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:q(b,F,r,a),disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileExts:h?[...c,".svg"]:c,maxFileSize:1024*1024*5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,autoCropArea:1,aspectRatio:l,initialAspectRatio:l,croppedCanvasOptions:{minWidth:P,minHeight:R}}},tusProps:{headers:x}}),n?o.jsx(u,{onClick:p,children:n}):o.jsx(u,{className:_("uploader-wrapper",s&&"enabled"),sx:E,onClick:p,children:o.jsx("img",{alt:r,src:t,style:{width:g,height:f}})})]},`uploader-${a}-${r}`)}U.propTypes={url:e.string.isRequired,type:e.oneOf(["square","rect","favicon","splash-portrait","splash-landscape","og-image"]).isRequired,did:e.string.isRequired,prefix:e.string.isRequired,headers:e.func,onUploaded:e.func,height:e.number,width:e.any,enabled:e.bool,allowSVG:e.bool,aspectRatio:e.number,minWidth:e.number,minHeight:e.number,children:e.node};const S=k.div`
|
|
3
3
|
.uploader-wrapper {
|
|
4
4
|
display: inline-flex;
|
|
5
5
|
position: relative;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,at as $,W as v,J as R,ak as r,b4 as F,b0 as U,T as N,bI as z,bJ as X,bK as H,a$ as B,av as J,bF as
|
|
1
|
+
import{j as e,at as $,W as v,J as R,ak as r,b4 as F,b0 as U,T as N,bI as z,bJ as X,bK as H,a$ as B,av as J,bF as V,bL as G,bM as K}from"./vendor-mui-core-BFPsXaTR.js";import{s as O,u as Q,p as I,_ as q,D as Y,V as Z}from"./vendor-ux-CE4sOH7O.js";import{r as d}from"./vendor-react-Dvs43sk9.js";import{g as ee,p as te}from"./vendor-hooks-DmThWyyG.js";import{v as D,I as L,H as se,S as oe,s as ae,b as ne}from"./index-CmM1Fb8I.js";import{T as re}from"./vendor-utils-OrZFrHBP.js";import{N as ie}from"./index-xrCVFXc_.js";import{W as ce}from"./did-address-BQL5Zxlr.js";import{w as le}from"./wrap-locale-D6EgWtG_.js";import{u as pe}from"./use-passport-id-B-b-_oYF.js";import{g as de}from"./get-safe-url-94yHUMyk.js";import{c as me}from"./passport-B2fL-0uN.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-DGOH9a3F.js";import"./index-Dvkly5_Y.js";import"./create-passport-svg-BsR3hKFq.js";function W({list:s=[],width:l=300,height:m=400,cardSpace:p=40,onSelect:i=()=>{},defaultIndex:k=0}){const[u,h]=d.useState(0),[o,x]=d.useState(0),b=d.useRef(null),f=n=>{if(n<0||n>s.length-1)return;h(n);const c=b.current.clientWidth;x(n*(l+p)-(c-l)/2+p*.5),i(n)};d.useEffect(()=>{f(k);const n=c=>c.preventDefault();b.current.addEventListener("touchmove",n,{passive:!1})},[]);let a;const j=n=>{a=n.touches[0].clientX},y=n=>{const c=n.changedTouches[0],w=a-c.clientX;Math.abs(w)>60&&(w>0?f(u+1):f(u-1))};return e.jsx(ue,{ref:b,onTouchStart:j,onTouchEnd:y,children:e.jsx("div",{className:"card-container",style:{transform:`translate(${-o}px, 0)`},children:s.map((n,c)=>e.jsx("div",{className:`card-item ${c===u?"selected":""}`,style:{width:l,height:m,margin:p/2},onClick:()=>f(c),children:n.display?e.jsx("div",{className:"card-content",children:e.jsx(ie,{data:n.display,style:{width:"100%",height:"100%"}})}):e.jsx("div",{className:"card-content",dangerouslySetInnerHTML:{__html:n.src}})},n.id))})})}const ue=$.div`
|
|
2
2
|
overflow: hidden;
|
|
3
3
|
mask-image: linear-gradient(to left, transparent, black 3%, black 97%, transparent);
|
|
4
4
|
overflow: hidden;
|
|
@@ -32,7 +32,7 @@ import{j as e,at as $,W as v,J as R,ak as r,b4 as F,b0 as U,T as N,bI as z,bJ as
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
`;W.propTypes={list:v.array,width:v.number,height:v.number,cardSpace:v.number,onSelect:v.func,defaultIndex:v.number};function he({icon:s,active:l,completed:m}){const p={1:e.jsx(K,{className:"step-icon"}),2:e.jsx(
|
|
35
|
+
`;W.propTypes={list:v.array,width:v.number,height:v.number,cardSpace:v.number,onSelect:v.func,defaultIndex:v.number};function he({icon:s,active:l,completed:m}){const p={1:e.jsx(K,{className:"step-icon"}),2:e.jsx(G,{className:"step-icon"}),3:e.jsx(V,{className:"step-icon"})},i=["step-icon-w"];return l&&i.push("step-icon-w--active"),m&&i.push("step-icon-w--completed"),e.jsx("div",{className:i.join(" "),children:p[String(s)]})}function xe({SessionContext:s,webWalletUrl:l,createPassportSvg:m,passportColor:p,onLogin:i,teamDid:k}){const{api:u}=d.useContext(s),h=R(t=>t.breakpoints.down("sm")),o=ee({user:null,passport:null,success:!1,activeStep:0}),x=d.useRef({sessionToken:"",refreshToken:""}),{setPassportId:b,clearPassportId:f}=pe(),{t:a,locale:j}=d.useContext(O),{wallet:y}=Q(),[n,c]=d.useState(0),{searchParams:w}=new URL(window.location.href),P=()=>{o.activeStep++},M=t=>{o.user=t.user},E=()=>{P()},_=(t,g)=>{t?.passportId&&b(t.passportId),t?.sessionToken&&(x.current.sessionToken=g(t.sessionToken)),t?.refreshToken&&(x.current.refreshToken=g(t.refreshToken)),o.success=!0,P()},S=async()=>{if(y&&L()){q(()=>import("./index-CgdhTqWX.js").then(g=>g.i),[],import.meta.url).then(g=>{g.call("arcClosePage")});return}re(i)&&i({sessionToken:x.current.sessionToken,refreshToken:x.current.refreshToken});const t=w.get("redirect");if(t){window.location.replace(de(t));return}f(),window.location.replace("/")},A=t=>{o.passport=t.target.value},[T]=te({leftTime:n,onEnd:()=>{S()}}),C=[{label:a("lostPassport.recoverPassport"),content:()=>{if(!o.user){const t=w.get("scope")||"passport";return e.jsx(D,{popup:!0,open:!0,hideCloseButton:!0,className:"connect",action:"lost-passport-list",forceConnected:!1,autoConnect:!1,checkFn:u.get,checkTimeout:10*60*1e3,webWalletUrl:l,onSuccess:M,locale:j,messages:{title:a("lostPassport.recoverDialog.title"),scan:a("lostPassport.recoverDialog.scan"),confirm:a("lostPassport.recoverDialog.confirm"),success:a("lostPassport.recoverDialog.success")},extraParams:{scope:t}})}return e.jsxs(r,{className:"select-passport",children:[e.jsxs(r,{className:"user-info",sx:{my:1,display:"flex",alignItems:"center"},children:[e.jsx(F,{src:o.user.avatar,style:{width:48,height:48,backgroundColor:"transparent",marginRight:16}}),e.jsxs(r,{children:[e.jsx(r,{className:"name",children:o.user.fullName}),e.jsx(r,{className:"did",sx:{mt:1},children:e.jsx(ce,{responsive:!h,compact:h,did:o.user.did})})]})]}),e.jsx(r,{children:e.jsx(W,{width:h?180:230,height:h?240:306,cardSpace:24,list:o.user.passportTypes.map(t=>({src:m({scope:t.scope,role:t.role,title:t.scope==="kyc"?t.name:t.title,issuer:t.issuer.name,issuerDid:t.issuer.id,ownerDid:o.user.did,ownerName:o.user.fullName,ownerAvatarUrl:o.user.avatar,preferredColor:p||"auto",extra:t.scope==="kyc"?{key:"Email",value:t.name}:void 0}),name:t.title,id:t.id,display:t.display})),onSelect:t=>A({target:{value:o.user.passportTypes[t].id}}),defaultIndex:0})}),e.jsx(r,{sx:{textAlign:"center"},children:e.jsx(I,{variant:"contained",color:"primary",onClick:()=>E(),disabled:!o.passport,children:a("common.next")})})]})}},{label:a("lostPassport.receivePassport"),content:()=>{const t={receiverDid:o.user.did,passportId:o.passport,teamDid:k||window?.blocklet?.did};return e.jsx(D,{popup:!0,open:!0,hideCloseButton:!0,className:"connect",action:"lost-passport-issue",checkFn:u.get,checkTimeout:10*60*1e3,webWalletUrl:l,onSuccess:_,forceConnected:!1,locale:j,messages:{title:`${a("lostPassport.receiveDialog.title")}`,scan:a("lostPassport.receiveDialog.scan"),confirm:a("lostPassport.receiveDialog.confirm"),success:a("lostPassport.receiveDialog.success")},extraParams:t})}},{label:a("common.complete"),content:()=>(n===0&&c(3e3),e.jsxs(r,{sx:{textAlign:"center"},children:[e.jsx(r,{sx:{mb:3,color:"success.main"},children:e.jsx(U,{style:{fontSize:60}})}),e.jsx(N,{component:"p",variant:"body1",className:"subheader",children:a("issuePassport.dialog.success")}),e.jsx(N,{component:"p",variant:"body2",color:"gray",children:y&&L()?a("issuePassport.dialog.autoClose",{seconds:Math.round(T/1e3)}):a("issuePassport.dialog.autoJump",{seconds:Math.round(T/1e3)})}),e.jsx(I,{style:{marginTop:40},variant:"contained",color:"primary",onClick:S,children:a("issuePassport.dialog.loginWithPassport")})]}))}];return e.jsx(fe,{children:e.jsxs(r,{className:"stepper",children:[e.jsx(z,{className:"stepper-progress",alternativeLabel:!0,activeStep:o.activeStep,children:C.map(({label:t})=>e.jsx(X,{children:e.jsx(H,{slots:{stepIcon:he},children:t})},t))}),e.jsx(r,{className:"stepper-content",children:C[o.activeStep].content()}),!o.success&&e.jsx(r,{sx:{textAlign:"center",fontSize:12},children:e.jsx(B,{href:"/",sx:{color:"#4598FA",textDecoration:"none"},children:a("lostPassport.return")})})]})})}const fe=$(J)`
|
|
36
36
|
padding-top: 46px;
|
|
37
37
|
padding-bottom: 46px;
|
|
38
38
|
height: 100%;
|
|
@@ -164,4 +164,4 @@ import{j as e,at as $,W as v,J as R,ak as r,b4 as F,b0 as U,T as N,bI as z,bJ as
|
|
|
164
164
|
.connect {
|
|
165
165
|
background: #fafafa;
|
|
166
166
|
}
|
|
167
|
-
`,ge=le(xe);function
|
|
167
|
+
`,ge=le(xe);function Me(){const s=Y(),{t:l}=Z(),m=({sessionToken:p,refreshToken:i}={})=>{p&&ae(p),i&&ne(i)};return e.jsxs(e.Fragment,{children:[e.jsx(se,{children:e.jsx("title",{children:l("pageTitle.lostPassport")})}),e.jsx(ge,{SessionContext:oe,webWalletUrl:s,createPassportSvg:me,passportColor:window?.env?.passportColor||"auto",onLogin:m})]})}export{Me as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as i}from"./vendor-mui-core-
|
|
1
|
+
import{j as i}from"./vendor-mui-core-BFPsXaTR.js";import"./vendor-react-Dvs43sk9.js";function e(){return i.jsx("div",{children:"AigneObservability"})}export{e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e}from"./vendor-react-Dvs43sk9.js";import{N as r}from"./vendor-utils-
|
|
1
|
+
import{e}from"./vendor-react-Dvs43sk9.js";import{N as r}from"./vendor-utils-OrZFrHBP.js";const t=e(r);export{t as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./vendor-mui-core-
|
|
1
|
+
import{j as s}from"./vendor-mui-core-BFPsXaTR.js";import{r as e}from"./vendor-react-Dvs43sk9.js";import{g as m}from"./get-safe-url-94yHUMyk.js";import"./index-CmM1Fb8I.js";import"./vendor-ux-CE4sOH7O.js";import"./vendor-utils-OrZFrHBP.js";import"./vendor-hooks-DmThWyyG.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-DGOH9a3F.js";function S(){const r=e.useRef(null),n=e.useRef(Date.now());return e.useEffect(()=>{const t=`open-window-url-${new URLSearchParams(window.location.search).get("key")}`;return r.current=setInterval(()=>{if(Date.now()-n.current>10*1e3){localStorage.removeItem(t),clearInterval(r.current);return}const o=localStorage.getItem(t);if(o)try{const{url:a,time:i}=JSON.parse(o);localStorage.removeItem(t),Date.now()-i<10*1e3&&(window.location.href=m(a,{allowDomains:null}))}catch{}},200),()=>clearInterval(r.current)},[]),s.jsx("div",{})}export{S as default};
|
package/dist/assets/{over-due-invoice-payment-BHBjNHAK.js → over-due-invoice-payment-Dairtuas.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as le,j as t,b1 as p,aX as G,Q as h,T as k,b0 as de}from"./vendor-mui-core-
|
|
1
|
+
import{D as le,j as t,b1 as p,aX as G,Q as h,T as k,b0 as de}from"./vendor-mui-core-BFPsXaTR.js";import{r as l}from"./vendor-react-Dvs43sk9.js";import{V as me,H as f,q as ye}from"./vendor-ux-CE4sOH7O.js";import{C as w,d as pe}from"./vendor-utils-OrZFrHBP.js";import{k as fe}from"./vendor-hooks-DmThWyyG.js";import{w as ve,x as R,y as he,z as xe,C as A,D as be,E as ge,L as Ce,F as je}from"./index-CmM1Fb8I.js";const ke=async n=>{if(!n.subscriptionId&&!n.customerId)throw new Error("Either subscriptionId or customerId must be provided");let m;return n.subscriptionId?m=`/api/subscriptions/${n.subscriptionId}/overdue/invoices`:m=`/api/customers/${n.customerId}/overdue/invoices`,(await be.get(n.authToken?w(m,`?authToken=${n.authToken}`):m)).data};function Ee({subscriptionId:n=void 0,customerId:m=void 0,mode:B="default",dialogProps:x={open:!0},children:S=void 0,onPaid:q=()=>{},detailLinkOptions:d={enabled:!0},successToast:z=!0,alertMessage:M="",authToken:J=void 0}){const{t:r,locale:Y}=me(),$=le(),{connect:P,session:Z}=ve(),[H,ee]=l.useState(""),[O,v]=l.useState(!1),[te,T]=l.useState(x.open||!1),[re,ne]=l.useState({}),[se,D]=l.useState({}),N=n?"subscription":"customer",i=m||Z?.user?.did,U=n||i,b=l.useRef(i),{data:s={summary:{},invoices:[]},error:V,loading:oe,runAsync:W}=fe(()=>ke({subscriptionId:n,customerId:i,authToken:J}),{ready:!!n||!!i,onSuccess:e=>{e.customer?.id&&e.customer?.id!==b.current&&(b.current=e.customer?.id)}}),g=l.useMemo(()=>n?w(R(),`/customer/subscription/${n}`):i?w(R(),"/customer/invoice/past-due"):"",[n,i]),o=l.useMemo(()=>s?.summary?Object.values(s.summary):[],[s?.summary]),ie=pe(async e=>{z&&(f.close(),f.success(r("payment.customer.invoice.paySuccess"))),v(!1),(await W()).invoices?.length===0&&(T(!1),q(U,e,N))},1e3,{leading:!1,trailing:!0,maxWait:5e3}),E=he(),I=xe("events"),ce=async()=>{let e=!1;return await je(async()=>(e=(await W()).invoices?.length===0,e),{interval:2e3,timeout:3*60*1e3}),e},ae=async()=>{if(E)try{const e=await ce();z&&(f.close(),f.success(r("payment.customer.invoice.paySuccess"))),e&&(T(!1),q(U,H,N))}catch(e){console.error("Check payment status failed:",e)}};l.useEffect(()=>{I&&!E&&I.on("invoice.paid",({response:e})=>{const a=`${n||e.customer_id}-${e.currency_id}`;(n&&e.subscription_id===n||i&&i===e.customer_id||b.current&&b.current===e.customer_id)&&(re[a]||(ne(u=>({...u,[a]:1})),ie(e.currency_id)))})},[I,n,i]);const _=e=>{const{currency:c,method:a}=e;if(a.type==="stripe"){f.error(r("payment.subscription.overdue.notSupport"));return}if(!O&&(ee(c.id),v(!0),D(u=>({...u,[c.id]:"idle"})),["arcblock","ethereum","base"].includes(a.type))){const u={currencyId:c.id};n?u.subscriptionId=n:i&&(u.customerId=i),P.open({locale:Y,containerEl:void 0,saveConnect:!1,action:"collect-batch",prefix:w(R(),"/api/did"),useSocket:!E,extraParams:u,messages:{scan:r("common.connect.defaultScan"),title:r("payment.customer.invoice.payBatch"),confirm:r("common.connect.confirm")},onSuccess:()=>{P.close(),ae(),v(!1),D(y=>({...y,[c.id]:"success"}))},onClose:()=>{P.close(),v(!1)},onError:y=>{f.error(ge(y)),D(j=>({...j,[c.id]:"error"})),v(!1)}})}},C=()=>{T(!1),x.onClose?.()},K=e=>{d.onClick?(e.preventDefault(),d.onClick(e)):d.enabled||(e.preventDefault(),C())};if(oe)return null;const L=()=>d.title?d.title:r(n?"payment.subscription.overdue.view":"payment.customer.pastDue.view"),Q=(e,c=!0,a={variant:"contained"})=>{const{currency:u}=e,y=O&&H===u.id,j=se[u.id]||"idle";return j==="success"?t.jsx(h,{variant:a?.variant||"contained",size:"small",...c?{}:{color:"success",startIcon:t.jsx(de,{})},children:r("payment.subscription.overdue.paid")}):j==="error"?t.jsx(h,{variant:"contained",size:"small",onClick:()=>_(e),...a,children:r("payment.subscription.overdue.retry")}):e.method.type==="stripe"?t.jsx(h,{variant:"contained",color:"primary",onClick:()=>window.open(g,"_blank"),...a,children:r("payment.subscription.overdue.viewNow")}):t.jsx(Ce,{variant:"contained",size:"small",disabled:y,loading:y,onClick:()=>_(e),...a,children:r("payment.subscription.overdue.payNow")})},F=e=>e.name&&e.type!=="arcblock"?` (${e.name})`:"",X=()=>{if(n&&s.subscription)return o.length===1?r("payment.subscription.overdue.title",{name:s.subscription?.description,count:s.invoices?.length,total:A(o[0]?.amount,o[0]?.currency?.decimal),symbol:o[0]?.currency?.symbol,method:F(o[0]?.method)}):r("payment.subscription.overdue.simpleTitle",{name:s.subscription?.description,count:s.invoices?.length});if(i){let e="";return o.length===1?e=r("payment.customer.overdue.title",{subscriptionCount:s.subscriptionCount||0,count:s.invoices?.length,total:A(o[0]?.amount,o[0]?.currency?.decimal),symbol:o[0]?.currency?.symbol,method:F(o[0]?.method)}):e=r("payment.customer.overdue.simpleTitle",{subscriptionCount:s.subscriptionCount||0,count:s.invoices?.length}),M?`${e}${M}`:`${e}${r("payment.customer.overdue.defaultAlert")}`}return""},ue=()=>n&&s.subscription?r("payment.subscription.overdue.empty",{name:s.subscription?.description}):r("payment.customer.overdue.empty");return B==="custom"&&S&&typeof S=="function"?t.jsx(p,{children:S(_,{subscription:s?.subscription,summary:s?.summary,invoices:s?.invoices,subscriptionCount:s?.subscriptionCount,detailUrl:g})}):t.jsx(ye,{PaperProps:{style:{minHeight:"auto"}},...x||{},open:te,title:x?.title||r("payment.subscription.overdue.pastDue"),sx:{"& .MuiDialogContent-root":{pt:0}},onClose:C,children:V?t.jsx(G,{severity:"error",children:V.message}):t.jsxs(p,{sx:{gap:1},children:[o.length===0&&t.jsxs(t.Fragment,{children:[t.jsx(G,{severity:"success",children:ue()}),t.jsx(p,{direction:"row",sx:{justifyContent:"flex-end",mt:2},children:t.jsx(h,{variant:"outlined",color:"primary",onClick:C,sx:{width:"fit-content"},children:r("common.know")})})]}),o.length===1&&t.jsxs(t.Fragment,{children:[t.jsxs(k,{variant:"body1",sx:{color:"text.secondary"},children:[X(),d.enabled&&t.jsxs(t.Fragment,{children:[t.jsx("br",{}),r("payment.subscription.overdue.description"),t.jsx("a",{href:g,target:"_blank",onClick:K,rel:"noreferrer",style:{color:$.palette.text.link},children:L()})]})]}),t.jsxs(p,{direction:"row",sx:{justifyContent:"flex-end",gap:2,mt:2},children:[t.jsx(h,{variant:"outlined",color:"primary",onClick:C,children:r("common.cancel")}),Q(o[0])]})]}),o.length>1&&t.jsxs(t.Fragment,{children:[t.jsxs(k,{variant:"body1",sx:{color:"text.secondary"},children:[X(),d.enabled&&t.jsxs(t.Fragment,{children:[t.jsx("br",{}),r("payment.subscription.overdue.description"),t.jsx("a",{href:g,target:"_blank",rel:"noreferrer",onClick:K,style:{color:$.palette.text.link},children:L()})]})]}),t.jsx(k,{variant:"body1",sx:{color:"text.secondary"},children:r("payment.subscription.overdue.list")}),t.jsx(p,{children:o.map(e=>t.jsxs(p,{direction:"row",sx:{justifyContent:"space-between",alignItems:"center",py:1,px:.5,borderBottom:"1px solid",borderColor:"divider","&:hover":{backgroundColor:()=>$.palette.grey[100]},mt:0},children:[t.jsx(k,{children:r("payment.subscription.overdue.total",{total:A(e?.amount,e?.currency?.decimal),currency:e?.currency?.symbol,method:F(e?.method)})}),Q(e,!1,{variant:"text",sx:{color:"text.link"}})]},e?.currency?.id))})]})]})})}export{Ee as O};
|