@abtnode/blocklet-services 1.16.49-beta-20250822-070545-6d3344cc → 1.16.49-beta-20250823-082650-626c1473
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/routes/user.js +85 -1
- package/dist/assets/{AdapterDayjs-VDBijwaM.js → AdapterDayjs-DAMiGWmL.js} +1 -1
- package/dist/assets/{Google-Sm1AunGv.js → Google-BsTnh-4u.js} +1 -1
- package/dist/assets/{access-control-VF0jIUag.js → access-control-MCkff9z9.js} +1 -1
- package/dist/assets/{actions-Bf4UKTeu.js → actions-ERKO514H.js} +1 -1
- package/dist/assets/{add-component-core-DPxKUwJB.js → add-component-core-BLCqSOyB.js} +1 -1
- package/dist/assets/{add-resource-DuOqQFR-.js → add-resource-DluIr9bN.js} +1 -1
- package/dist/assets/{addon-CosTdlat.js → addon-Dp8IiMq7.js} +1 -1
- package/dist/assets/{advanced-B9TR0x_M.js → advanced-CkDiscyq.js} +1 -1
- package/dist/assets/{aigne-C7JPp9u1.js → aigne-CAjgssPb.js} +1 -1
- package/dist/assets/{appearance-Byekpih2.js → appearance-DO7q0jzL.js} +1 -1
- package/dist/assets/{ar-fE5SSTrt.js → ar-CPI6kJBB.js} +1 -1
- package/dist/assets/{arrow-down.svg-lBR1lfm2.js → arrow-down.svg-ty_EHh4o.js} +1 -1
- package/dist/assets/{audit-logs-BTyQcfWp.js → audit-logs-Cabd8g0I.js} +2 -2
- package/dist/assets/{authorize-BbCQomqp.js → authorize-DP5z5x5-.js} +1 -1
- package/dist/assets/{base-chart-DZz4r8-E.js → base-chart-DshYrsm-.js} +1 -1
- package/dist/assets/{base32-D7JDMggs.js → base32-Bcoibt7i.js} +1 -1
- package/dist/assets/{bind-account-B-fdpRuH.js → bind-account-CPZ2DYh7.js} +1 -1
- package/dist/assets/branding-D18F5hVD.js +1 -0
- package/dist/assets/{branding-Bp4tsvug.js → branding-DrwDL7HI.js} +1 -1
- package/dist/assets/{branding-DKOBu_eV.js → branding-TrLVeHFz.js} +2 -2
- package/dist/assets/{bundle-avatar-FLzOZWlh.js → bundle-avatar-C0U-LJJt.js} +1 -1
- package/dist/assets/button-yt7KOkBe.js +1 -0
- package/dist/assets/{click-to-copy-CVpUD4ji.js → click-to-copy-xhWFT-k-.js} +1 -1
- package/dist/assets/{collapse-C-BNkgS6.js → collapse-6qdm8LaH.js} +1 -1
- package/dist/assets/{complete-CnjLDP7N.js → complete-BFb1Nf8b.js} +1 -1
- package/dist/assets/{component-Dogt0tzj.js → component-CJ0I05Ck.js} +3 -3
- package/dist/assets/{config-gL555Qh4.js → config-B3E1_QhN.js} +1 -1
- package/dist/assets/{config-BxiVjVAu.js → config-BNHvhSkn.js} +1 -1
- package/dist/assets/{config-B5Y8LOpp.js → config-DsnD8hnR.js} +4 -4
- package/dist/assets/{config-navigation-CveewaP3.js → config-navigation-B9KNqxY5.js} +3 -3
- package/dist/assets/{config-space-h6V3UKMc.js → config-space-C7cbpc0-.js} +1 -1
- package/dist/assets/{confirm-C9tgdTJT.js → confirm-DwI3KTfd.js} +1 -1
- package/dist/assets/{connect-CYT-S8fi.js → connect-CVJtYnov.js} +1 -1
- package/dist/assets/{connect-Cx2VNYgu.js → connect-DUYp4RZx.js} +1 -1
- package/dist/assets/{connect-to-DiEQlFbF.js → connect-to-BUDcQstK.js} +1 -1
- package/dist/assets/{content-layout-DoBqUAz1.js → content-layout-C04Obhnh.js} +1 -1
- package/dist/assets/{createClass-D9kGlylC.js → createClass-C2F6VGHd.js} +1 -1
- package/dist/assets/{dashboard-D1d9MQbs.js → dashboard-D_zeTevq.js} +3 -3
- package/dist/assets/{de-Byq6SyWJ.js → de-DXdF82Jr.js} +1 -1
- package/dist/assets/{delete-confirm-XVeEePxy.js → delete-confirm-DAz69JEv.js} +1 -1
- package/dist/assets/{did-address-CcsL3-Qm.js → did-address-BWvYsV02.js} +1 -1
- package/dist/assets/{domain-CV6OAKYE.js → domain-Dm9hZLip.js} +1 -1
- package/dist/assets/{domain-action-card-BXYZu_pS.js → domain-action-card-BXg05mXV.js} +2 -2
- package/dist/assets/domains-Bh3PFNkb.js +1 -0
- package/dist/assets/{email-CniDyVLQ.js → email-hFy_1yaj.js} +1 -1
- package/dist/assets/{empty-spinner-BMVhld2Z.js → empty-spinner-BkNT2e_n.js} +1 -1
- package/dist/assets/engine-CKFV6nuL.js +1 -0
- package/dist/assets/{es-Q8J1CCMS.js → es-Cdb297yS.js} +1 -1
- package/dist/assets/{exchange-passport-BnNDAYeY.js → exchange-passport-Lns0dppF.js} +1 -1
- package/dist/assets/{form-BndJ7ZnS.js → form-LRB3s6JO.js} +1 -1
- package/dist/assets/{form-text-input-DJPCEDjA.js → form-text-input-DUMoSxHd.js} +1 -1
- package/dist/assets/{form-wrapper-CHYdE4By.js → form-wrapper-Buohf72H.js} +1 -1
- package/dist/assets/{fr-8njRrvuV.js → fr-CQValz_y.js} +1 -1
- package/dist/assets/{fuel-BTh7B67H.js → fuel-C4NCJr3p.js} +1 -1
- package/dist/assets/{gen-access-key-CbaepD9-.js → gen-access-key-BFkbsi1R.js} +1 -1
- package/dist/assets/{gen-simple-access-key-mJK0zx1B.js → gen-simple-access-key-ThKCouQQ.js} +1 -1
- package/dist/assets/get-safe-url-BNi1gOxJ.js +1 -0
- package/dist/assets/{hdkey-BpKJbkt5.js → hdkey-BKcMCheT.js} +1 -1
- package/dist/assets/{hi-JUTdfcRr.js → hi-CAensap9.js} +1 -1
- package/dist/assets/{home-BwLLSjzW.js → home-C8qFl8xH.js} +1 -1
- package/dist/assets/{id-CrtgRPeX.js → id-6AFgcYKj.js} +1 -1
- package/dist/assets/{iframe-CbjzikLk.js → iframe-DCdNwEli.js} +1 -1
- package/dist/assets/index-6kJ2PRkA.js +271 -0
- package/dist/assets/{index-Ca4b_pCt.js → index-7YC3lzep.js} +1 -1
- package/dist/assets/{index-pAv7g5o_.js → index-9Mnen_4v.js} +1 -1
- package/dist/assets/{index-DQmcrxe_.js → index-B74V2YA6.js} +1 -1
- package/dist/assets/{index-BtkFo6d6.js → index-BC4kejU3.js} +1 -1
- package/dist/assets/{index-ew1if2W6.js → index-BCy-REsR.js} +1 -1
- package/dist/assets/index-BH0R4PNv.js +55 -0
- package/dist/assets/{index-BY2dcTa4.js → index-BMDglGmr.js} +1 -1
- package/dist/assets/{index-yi4PlkyH.js → index-BTyERShR.js} +1 -1
- package/dist/assets/{index-B9sHaKla.js → index-Bs7zu0cF.js} +1 -1
- package/dist/assets/{index-B5t6TkeL.js → index-C-4cSxB6.js} +12 -12
- package/dist/assets/{index-BIfpX-Mq.js → index-CMEi9dbm.js} +1 -1
- package/dist/assets/{index-hXRVhE3g.js → index-CVAjtAPl.js} +1 -1
- package/dist/assets/{index-BKiTWpo1.js → index-Cw8y2EV5.js} +1 -1
- package/dist/assets/index-DGcl2dDi.js +124 -0
- package/dist/assets/{index-Bzij4iIk.js → index-DI1BHDx_.js} +1 -1
- package/dist/assets/{index-DEu06Btv.js → index-DN9hC_1j.js} +1 -1
- package/dist/assets/{index-DzSOofQf.js → index-DPs9M0Dr.js} +1 -1
- package/dist/assets/index-DY-uF8zp.js +1 -0
- package/dist/assets/{index-Bk02VaQE.js → index-DmApgo3Y.js} +1 -1
- package/dist/assets/{index-BxU3q403.js → index-DpJzkUBC.js} +3 -3
- package/dist/assets/{index-DT3k66ox.js → index-EyZ2cODm.js} +1 -1
- package/dist/assets/{index-Cd2DJL-w.js → index-GhmSAD-v.js} +1 -1
- package/dist/assets/{index-C-DpXzH8.js → index-N7n9Y6Ev.js} +1 -1
- package/dist/assets/{index-SbRD4xbu.js → index-TXBm72Q0.js} +4 -4
- package/dist/assets/{index-BFQdM_lT.js → index-WeFxHe8W.js} +1 -1
- package/dist/assets/{index-CuQBOJqN.js → index-XKEQyevi.js} +27 -27
- package/dist/assets/{index-BtHQU9Nx.js → index-l0gwfVL8.js} +1 -1
- package/dist/assets/{index-DzqNo2lD.js → index-nkP9ICJC.js} +1 -1
- package/dist/assets/index-p2KxG5r8.js +7 -0
- package/dist/assets/{invitation-CsvJMPo7.js → invitation-AaqjLooz.js} +1 -1
- package/dist/assets/{invite-DEEX5t_7.js → invite-mEoBipQt.js} +1 -1
- package/dist/assets/{isURL-Cuto2_sB.js → isURL-adaT_xdo.js} +1 -1
- package/dist/assets/{issue-passport-BuT9-mlQ.js → issue-passport-C1I-F47F.js} +1 -1
- package/dist/assets/{item-CEYjCEHD.js → item-IHpEcc3t.js} +1 -1
- package/dist/assets/{ja-BDFhRccP.js → ja-D59y1sZ9.js} +1 -1
- package/dist/assets/{ko-Dde62QRb.js → ko-DlSyClni.js} +1 -1
- package/dist/assets/{landing-page-CbZO5p-X.js → landing-page-CVQ4Mbei.js} +1 -1
- package/dist/assets/{launch-result-message-BhJWVXUs.js → launch-result-message-nmd233tx.js} +1 -1
- package/dist/assets/{layout-BOMMbsdq.js → layout-BSXDlbPe.js} +1 -1
- package/dist/assets/{list-CcfeNfGu.js → list-CtrmRv2P.js} +1 -1
- package/dist/assets/{list-CIIZmkmF.js → list-DHzyPX5i.js} +3 -3
- package/dist/assets/{list-header-BQx81X9X.js → list-header-DT-KLaK2.js} +1 -1
- package/dist/assets/localization-ELaNyMdd.js +1 -0
- package/dist/assets/{log-CHaoSWXc.js → log-Q9k37nff.js} +365 -16
- package/dist/assets/logger-BPHaK-bk.js +1 -0
- package/dist/assets/{login-oauth-callback-DJxlMwXZ.js → login-oauth-callback-rCOYCrYR.js} +1 -1
- package/dist/assets/login-tf8RwS9S.js +1 -0
- package/dist/assets/{logo-uploader-C0ihL7E6.js → logo-uploader-CAc0atu8.js} +2 -2
- package/dist/assets/{lost-passport-BoAvHfI_.js → lost-passport-C1aqxLYB.js} +2 -2
- package/dist/assets/{observability-F2NkCkza.js → observability-BLOR-pai.js} +1 -1
- package/dist/assets/{open-window-BNY_OfK6.js → open-window-cXseGrvu.js} +1 -1
- package/dist/assets/{over-due-invoice-payment-DXbfRbJ6.js → over-due-invoice-payment-CaT3Xg3A.js} +1 -1
- package/dist/assets/{overview-DpF1loGs.js → overview-CcwITmuR.js} +1 -1
- package/dist/assets/{page-header-CSMnIoYZ.js → page-header-D3lUeEWm.js} +1 -1
- package/dist/assets/{passport-item-VXkf3FVk.js → passport-item-dcHHtdzW.js} +1 -1
- package/dist/assets/{permission-DeQz9qFD.js → permission-BEsAOVLp.js} +1 -1
- package/dist/assets/{playground-CTvnZW2L.js → playground-DGDm_k8W.js} +1 -1
- package/dist/assets/preferences-DlxWKz6A.js +1 -0
- package/dist/assets/profile-embed-C8Sbqz0E.js +1 -0
- package/dist/assets/{pt-C4nfuExm.js → pt-C_3CX1PR.js} +1 -1
- package/dist/assets/publish-resource-CDCpaMvx.js +1 -0
- package/dist/assets/{react-beautiful-dnd.esm-CYy644iX.js → react-beautiful-dnd.esm-Lp0g0Q08.js} +1 -1
- package/dist/assets/{react-stripe.esm-CLg1-THR.js → react-stripe.esm-CBymx38E.js} +1 -1
- package/dist/assets/{required-CobBjKC9.js → required-TNLp5hTp.js} +1 -1
- package/dist/assets/{ru-B4GtNlEa.js → ru-FBGLUlo5.js} +1 -1
- package/dist/assets/runtime-B7yZ__G4.js +1 -0
- package/dist/assets/sdk-EqTkRNaq.js +1 -0
- package/dist/assets/{section-Dq8SB7lh.js → section-BpYiAw-V.js} +1 -1
- package/dist/assets/{security-sVehajDA.js → security-XnSHOAxr.js} +1 -1
- package/dist/assets/{session-Bk6ebojT.js → session-BNPj6t1A.js} +1 -1
- package/dist/assets/{setup-B9yaqoQM.js → setup-BRjieO8Z.js} +1 -1
- package/dist/assets/{shorten-label-BHlFrl9P.js → shorten-label-C8uk1g60.js} +1 -1
- package/dist/assets/{simple-select-rm53gQ69.js → simple-select-fgsPxdEE.js} +1 -1
- package/dist/assets/{spaces-HwfT17d7.js → spaces-BEnms6Ca.js} +1 -1
- package/dist/assets/{start-4J_Dh_zH.js → start-DgpBny_s.js} +1 -1
- package/dist/assets/{starting-progress-mgdXXqlr.js → starting-progress-B7SsMBie.js} +1 -1
- package/dist/assets/{status-B1AV3yPH.js → status-D6oTondg.js} +1 -1
- package/dist/assets/{step-actions-YjxSTbIE.js → step-actions-CBMmWa9v.js} +1 -1
- package/dist/assets/{studio-Cx6j_6QU.js → studio-By4hzRlp.js} +1 -1
- package/dist/assets/{switch-control-BR8H_fdm.js → switch-control-BXSVR4of.js} +1 -1
- package/dist/assets/{table-tips-BP283GGZ.js → table-tips-BbhDCXCb.js} +1 -1
- package/dist/assets/{team-Dl23XmaY.js → team-CLYejz5t.js} +1 -1
- package/dist/assets/{th-BkShd6jD.js → th-DmSMYMH5.js} +1 -1
- package/dist/assets/{traffic-O-wVx65-.js → traffic-KEiTcUEV.js} +1 -1
- package/dist/assets/{transfer-gEq9B27K.js → transfer-CJD-MSsY.js} +1 -1
- package/dist/assets/{unsubscribe-vpGsla5T.js → unsubscribe-Io3Xh6VF.js} +1 -1
- package/dist/assets/{use-app-logo-7cjs_pn8.js → use-app-logo-CJIiOEL8.js} +1 -1
- package/dist/assets/{use-mobile-C_DcJ5SZ.js → use-mobile-C7GZXQ3Y.js} +1 -1
- package/dist/assets/{use-mobile-DM4d_PLd.js → use-mobile-CtV6Z2rA.js} +1 -1
- package/dist/assets/{use-server-logo-Cxah39TH.js → use-server-logo-beKp3Dx7.js} +1 -1
- package/dist/assets/{use-window-close-DpgRKaaP.js → use-window-close-Dz6xsCmU.js} +1 -1
- package/dist/assets/{useAsync-BrMo9m7W.js → useAsync-B3JLhOUX.js} +1 -1
- package/dist/assets/{useAsync-CsYRBczg.js → useAsync-BzDh8_wv.js} +1 -1
- package/dist/assets/{useAsyncRetry-D4-sRZN-.js → useAsyncRetry-CxZ45F4C.js} +1 -1
- package/dist/assets/{useLocalStorage-DqhgzGNT.js → useLocalStorage-rkkjWL9w.js} +1 -1
- package/dist/assets/user-center-Dv6zmxco.js +126 -0
- package/dist/assets/user-follower-BprUsmYk.js +32 -0
- package/dist/assets/user-sessions-CgBPMwgs.js +1 -0
- package/dist/assets/{util-Ca2jlZN4.js → util-BsixuJcw.js} +1 -1
- package/dist/assets/{util-o8U4JIlX.js → util-Vg3D9MhE.js} +1 -1
- package/dist/assets/{vendor-arcblock-B7AoUs4o.js → vendor-arcblock-BWU60ucH.js} +1 -1
- package/dist/assets/vendor-hooks-CLY4g97Q.js +7 -0
- package/dist/assets/{vendor-mui-core-B7zoO8f5.js → vendor-mui-core-C2nSSl8u.js} +10 -10
- package/dist/assets/{vendor-mui-x-Qph0dQcg.js → vendor-mui-x-KqeuegFB.js} +1 -1
- package/dist/assets/{vendor-ux-B7q8W4Pg.js → vendor-ux-BEdmA2UN.js} +2 -2
- package/dist/assets/{vi-C1PSP5SP.js → vi-CjDg6MoB.js} +1 -1
- package/dist/assets/{wait-connect-DPAxcgcf.js → wait-connect-Cdis6XzI.js} +1 -1
- package/dist/assets/{wizard-components-Dx5C9E35.js → wizard-components-YOuBY7bh.js} +2 -2
- package/dist/assets/{wizard-072KuoFQ.js → wizard-xr8XkLTm.js} +1 -1
- package/dist/assets/wrap-locale-BXHNkymj.js +1 -0
- package/dist/assets/{zh-C_fDhC3R.js → zh-DJvHpniA.js} +1 -1
- package/dist/assets/{zh-gAK37O_Y.js → zh-DaR6QxjC.js} +1 -1
- package/dist/assets/{zh-tw-BGfyObps.js → zh-tw-DaxtX1HY.js} +1 -1
- package/dist/assets/{zh-tw-DeWXdL1Q.js → zh-tw-yfBxbyqP.js} +1 -1
- package/dist/assets/{zh-B7NO6y1P.js → zh-wVmF24jB.js} +1 -1
- package/dist/index.html +5 -5
- package/dist/service-worker.js +1 -1
- package/package.json +31 -31
- package/dist/assets/branding-CXO5C9Lb.js +0 -1
- package/dist/assets/button-DEDR-8Tu.js +0 -1
- package/dist/assets/domains-DrF1lJas.js +0 -1
- package/dist/assets/engine-hsJUTQxh.js +0 -1
- package/dist/assets/get-safe-url-Bpq2IOGY.js +0 -1
- package/dist/assets/index-0VNYJQln.js +0 -271
- package/dist/assets/index-BH6jQqKY.js +0 -55
- package/dist/assets/index-C4e0bu4c.js +0 -124
- package/dist/assets/index-CjfYhb8W.js +0 -1
- package/dist/assets/index-JixySlIT.js +0 -7
- package/dist/assets/localization-DNJagVoT.js +0 -1
- package/dist/assets/logger-yrkSQn8c.js +0 -1
- package/dist/assets/login-C0FSm4ep.js +0 -1
- package/dist/assets/preferences-C7TivEto.js +0 -1
- package/dist/assets/profile-embed-Dzt59MHT.js +0 -1
- package/dist/assets/publish-resource-BSY6p0as.js +0 -1
- package/dist/assets/runtime-B01d8fEk.js +0 -1
- package/dist/assets/sdk-ZTxfQBV1.js +0 -1
- package/dist/assets/user-center-DtJ32yjF.js +0 -126
- package/dist/assets/user-sessions-CFxn5EHL.js +0 -1
- package/dist/assets/vendor-hooks-BRXKH6Nb.js +0 -7
- package/dist/assets/wrap-locale-BQM6_LkP.js +0 -1
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import{j as e,y as St,bb as Se,M as ae,ak as f,Q as _,W as u,J as xe,c0 as kt,I as O,aN as Pt,T as I,aj as Rt,b5 as Ee,P as Le,b6 as Q,a5 as Be,z as Ve,A as Ye,cm as It,bf as Tt,U as je,d8 as At,d9 as Mt,at as ee,da as zt,a6 as Y,n as le,D as Et,db as Lt,ar as We,b1 as ke,dc as Bt,aX as Wt,am as J,bp as Nt,bq as ye,a$ as Dt,cV as Ot}from"./vendor-mui-core-B7zoO8f5.js";import{r as y,a as $t,u as Ut,j as Ft}from"./vendor-react-Dvs43sk9.js";import{t as Ze,Z as qt,a7 as _t,R as Ne,D as Ht,C as ce,n as V,A as Gt}from"./vendor-utils-DtY42AM-.js";import{a as Kt,G as Vt,bw as Yt,c as Pe,d as Zt,Y as Qt,bx as Jt,aU as Re,W as fe,bh as Xt,by as er,a5 as tr,aW as rr,a6 as nr,bz as or}from"./index-CuQBOJqN.js";import{a as T,h as Qe,k as te,g as H,b as E,j as sr}from"./vendor-hooks-BRXKH6Nb.js";import{l as Je}from"./arrow-down.svg-lBR1lfm2.js";import{G as Ie,aa as D,T as N,aL as ir,a9 as Xe,aM as ar,H as q,aN as lr,aO as cr,aP as De,J as dr,D as et,I as Te,aQ as ur,aR as M,a1 as pr,a0 as xr,$ as tt,aS as fr,aT as hr,Z as gr,C as de,a5 as Oe,ab as mr}from"./vendor-ux-B7q8W4Pg.js";import{N as br}from"./list-CcfeNfGu.js";import{d as yr}from"./search-4YYphs0l.js";import{B as $e}from"./bundle-avatar-FLzOZWlh.js";import{h as Ue,T as vr}from"./team-Dl23XmaY.js";import{b as wr,d as jr,a as Cr,c as Sr,e as kr,f as Pr,B as Rr}from"./user-center-DtJ32yjF.js";import{N as rt,U as nt}from"./index-pAv7g5o_.js";import{u as re}from"./use-mobile-DM4d_PLd.js";import Ir from"./index-DEu06Btv.js";import{f as X}from"./index-DBs9Ljax.js";import{u as ot}from"./index-BtkFo6d6.js";import{U as ve}from"./user-sessions-CFxn5EHL.js";import Tr from"./index-ew1if2W6.js";import{o as Ar}from"./vendor-arcblock-B7AoUs4o.js";import{c as Mr,b as ue,a as zr,S as Er}from"./index-BtHQU9Nx.js";import"./index-C-DpXzH8.js";import"./index-BojVbZw0.js";import"./lottie-web-4koyQiv_.js";import"./server-logo-notext.svg-CKQB0tIp.js";import"./index-DzqNo2lD.js";import"./util-Ca2jlZN4.js";import"./base32-D7JDMggs.js";import"./session-Bk6ebojT.js";import"./isURL-Cuto2_sB.js";import"./use-app-logo-7cjs_pn8.js";import"./index-Ca4b_pCt.js";import"./api-IUmhrtIY.js";import"./table-tips-BP283GGZ.js";import"./use-mobile-C_DcJ5SZ.js";import"./passport-item-VXkf3FVk.js";import"./did-address-CcsL3-Qm.js";import"./index-Cd2DJL-w.js";import"./vendor-mui-x-Qph0dQcg.js";import"./AdapterDayjs-VDBijwaM.js";import"./confirm-C9tgdTJT.js";import"./click-to-copy-CVpUD4ji.js";import"./delete-confirm-XVeEePxy.js";import"./permission-DeQz9qFD.js";import"./actions-Bf4UKTeu.js";import"./index-DRYJ0xIl.js";function Lr(){let t=new Map;function s({root:o,rootMargin:n,threshold:l}){let i=t.get(o);i||(i=new Map,t.set(o,i));let c=JSON.stringify({rootMargin:n,threshold:l}),p=i.get(c);if(!p){let r=new Map;p={observer:new IntersectionObserver(x=>{x.forEach(m=>{r.get(m.target)?.(m)})},{root:o,rootMargin:n,threshold:l}),entryCallbacks:r},i.set(c,p)}return{observe:(r,x)=>{p.entryCallbacks.set(r,x),p.observer.observe(r)},unobserve:r=>{p.entryCallbacks.delete(r),p.observer.unobserve(r)}}}return{getObserver:s}}var Br="0px",Wr=[0],Nr=Lr();function Dr(t){let s=t?.rootMargin??Br,o=t?.threshold??Wr,n=y.useRef(null),l=y.useRef(null),i=y.useRef(null),[c,p]=y.useState(),r=y.useCallback(()=>{let C=n.current;if(!C){p(void 0);return}let v=Nr.getObserver({root:l.current,rootMargin:s,threshold:o});v.observe(C,a=>{p(a)}),i.current=v},[s,o]),x=y.useCallback(()=>{let C=i.current,v=n.current;v&&C?.unobserve(v),i.current=null},[]),m=y.useCallback(C=>{x(),n.current=C,r()},[r,x]),h=y.useCallback(C=>{x(),l.current=C,r()},[r,x]);return[m,{entry:c,rootRef:h}]}var Or=Dr;function $r(t){let[s,o]=Or(t),n=!!o.entry?.isIntersecting,[l,i]=y.useState(n);return n&&!l&&i(!0),[s,{...o,isVisible:n,wasEverVisible:l}]}var Ur=$r,Fr=100;function qr({loading:t,hasNextPage:s,onLoadMore:o,rootMargin:n,disabled:l,delayInMs:i=Fr}){let c=y.useRef(o),[p,{rootRef:r,isVisible:x}]=Ur({rootMargin:n});y.useEffect(()=>{c.current=o},[o]);let m=!l&&!t&&x&&s;return y.useEffect(()=>{if(m){let h=setTimeout(()=>{c.current()},i);return()=>{clearTimeout(h)}}},[m,i]),[p,{rootRef:r}]}var _r=qr;const we={info:"#3B82F6",success:"#10B981",warning:"#F59E0B",error:"#EF4444"};pe.propTypes={severity:u.oneOf(["info","success","warning","error",""]).isRequired,size:u.number};function pe({severity:t,size:s=8}){return we[t]?e.jsx(f,{component:"span",sx:{display:"inline-block",width:s,height:s,borderRadius:"50%",backgroundColor:we[t]||we.info}}):null}st.propTypes={theme:u.string,type:u.oneOf(["button","line","select"]),onSelectType:u.func,extra:u.node,loading:u.bool,currentTab:u.oneOf(["info","success","warning","error",""])};function st({theme:t="dark",type:s="button",onSelectType:o,extra:n=void 0,currentTab:l="",loading:i=!1,...c}){const{t:p}=y.useContext(Ie),r=[{label:p("notification.allSeverity"),value:""},{label:p("notification.severityType.info"),value:"info"},{label:p("notification.severityType.success"),value:"success"},{label:p("notification.severityType.warning"),value:"warning"},{label:p("notification.severityType.error"),value:"error"}],x=g=>{(g!==l||!i)&&o(g)},m=y.useMemo(()=>{const g={width:"100%",bgcolor:t==="dark"?"#F9FAFB":"",overflowY:"auto",paddingTop:s==="select"?"0":"5px",whiteSpace:"nowrap",borderRadius:0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"8px"};return s==="line"?Object.assign(g,{}):g},[s,t]),h=(g,k,R)=>e.jsx(_,{disabled:i,onClick:()=>x(g.value),className:`profile-button ${k?"active":""}`,...c,children:g.label},g.value||R),C=(g,k,R)=>e.jsx(_,{variant:"text",disabled:i,onClick:()=>x(g.value),className:`profile-line-button ${k?"active":""}`,...c,children:g.label},g.value||R),v=()=>r?.map((g,k)=>{const R=l===g?.value;return s==="line"?e.jsx(y.Fragment,{children:C(g,R,k)},g.value||k):e.jsx(y.Fragment,{children:h(g,R,k)},g.value||k)}),a=g=>{const{value:k}=g.target;x(k==="all"?"":k)};return s==="select"?e.jsx(St,{sx:{maxWidth:300},children:e.jsx(Se,{value:l||"all",onChange:a,size:"small",label:"Severity",IconComponent:g=>e.jsx(Je,{...g,width:20,height:20}),MenuProps:{autoFocus:!1,PaperProps:{style:{maxHeight:400,overflowY:"auto",borderRadius:"8px",boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},variant:"outlined",sx:{fieldset:{border:"none"}},children:r.map((g,k)=>e.jsx(ae,{value:g.value||"all",children:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(pe,{severity:g.value}),g.label]})},g.value||k))})}):e.jsxs(f,{className:"severity-tabs",sx:m,children:[e.jsx(f,{sx:{...s==="line"?{flex:1,borderBottom:"1px solid",borderColor:"grey.200"}:{display:"flex",gap:"24px"}},children:v()}),n]})}it.propTypes={paging:u.objectOf(u.any).isRequired,loading:u.bool.isRequired,onChange:u.func.isRequired};function it({loading:t,paging:s,onChange:o}){const{t:n}=y.useContext(Ie),l=xe(r=>r.breakpoints.down("md"));if(s.pageCount<=0||l)return null;const i=(r,x)=>{o({page:x+1})},c=r=>{const x=Number(r.target.value);o({page:1,pageSize:x})},p=s.page-1<=0?0:s.page-1;return e.jsx(f,{className:"notification-pagination",sx:{mt:2,display:"flex",justifyContent:"flex-end"},children:e.jsx(kt,{component:"div",disabled:t,count:s.total,page:p,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:n("pagination.rowsPerPage"),labelDisplayedRows:({from:r,to:x,count:m})=>`${r}–${x} / ${m!==-1?m:`${n()}more than ${x}`}`,rowsPerPage:s.pageSize,onPageChange:i,onRowsPerPageChange:c})})}const Hr=y.memo(it),Gr={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4h16v2.172a2 2 0 0 1-.586 1.414L15 12v7l-6 2v-8.5L4.52 7.572A2 2 0 0 1 4 6.227V4z"/>'},Fe=6,qe={"& .MuiCheckbox-root":{padding:"4px"},"& .MuiCheckbox-root .MuiSvgIcon-root":{fontSize:"1.35rem"},"& .MuiCheckbox-root:not(.Mui-checked)":{color:"divider"},"& .MuiCheckbox-root.Mui-checked":{color:"primary.main"},"& .MuiCheckbox-root .css-i4bv87-MuiSvgIcon-root":{width:"1.1em",height:"1.1em"},"& .MuiCheckbox-root svg":{stroke:"divider",strokeWidth:.7}},Kr={border:"1px solid",borderColor:"divider",borderRadius:1,overflow:"hidden",backgroundColor:"background.paper",backgroundImage:"none",transition:"all 0.2s ease-in-out"},_e=()=>({...Kr,width:"calc(50% - 8px)"});at.propTypes={loading:u.bool,type:u.oneOf(["server","service"]),onFilterChange:u.func,blockletMap:u.object,filterType:u.oneOf(["component","entity"]),selectedId:u.array,severity:u.array,enableMarkAllAsRead:u.bool,unReadCount:u.number,onReadFilterChange:u.func,currentReadFilter:u.string};function at({onFilterChange:t=()=>{},loading:s=!1,type:o="service",blockletMap:n={},filterType:l="component",selectedId:i=[],severity:c=[],enableMarkAllAsRead:p=!0,unReadCount:r=0,onReadFilterChange:x=()=>{},currentReadFilter:m="all"}){const{t:h}=y.useContext(Ie),[C,v]=y.useState(null),a=!!C,[g,k]=y.useState(i),[R,P]=y.useState(c),[b,z]=y.useState(!1),[L,U]=y.useState(""),[j,S]=y.useState([]);y.useEffect(()=>{k(i),P(c)},[i,c]);const B=[{label:h("notification.filterType.all"),value:"all"},{label:h("notification.filterType.unread"),value:"unread"}],G=d=>{(d!==m||!s)&&x(d)},Z=[{label:h("notification.severityType.info"),value:"info"},{label:h("notification.severityType.success"),value:"success"},{label:h("notification.severityType.warning"),value:"warning"},{label:h("notification.severityType.error"),value:"error"}],ne=d=>{v(d.currentTarget),U(""),z(!1)},he=()=>{v(null)},oe=d=>{const w=g.includes(d)?g.filter(A=>A!==d):[...g,d];k(w),t({id:w,severity:R})},se=d=>{const w=R.includes(d)?R.filter(A=>A!==d):[...R,d];P(w),t({severity:w,id:g})},ge=d=>{U(d.target.value)},me=()=>{z(!b)},K=$t.useMemo(()=>{if(!n.size)return[];const d=[];return l==="component"&&d.push({label:h("notification.system"),id:"system"}),Array.from(n).forEach(([,w])=>{const A=w.did||w.meta?.did,W=w.title||w.meta?.title||"",F=w.appPid||w.appDid;(l==="component"&&F!==A||l==="entity"&&F===A)&&d.push({label:W,id:A,blocklet:w,ancestors:w.ancestors})}),d},[n,l,h]);y.useEffect(()=>{if(L.trim()==="")S(K);else{const d=L.toLowerCase(),w=K.filter(A=>A.label.toLowerCase().includes(d));S(w)}},[L,K]);const be=L.trim()!==""||b?j:j.slice(0,Fe);return e.jsxs(f,{children:[e.jsxs(f,{sx:{display:"flex",justifyContent:p?"space-between":"flex-end",alignItems:"flex-start",flexWrap:"wrap",gap:1},children:[p&&e.jsx(f,{sx:{display:"flex",gap:1.5},children:B.map(d=>e.jsxs(_,{disabled:s,onClick:()=>G(d.value),className:`profile-button ${m===d.value?"active":""}`,sx:{...o==="service"&&m===d.value?{color:"secondary.main"}:{},color:"red",fontWeight:m===d.value?"bold":"normal"},children:[d.label,d.value==="unread"&&r>0&&` (${r})`]},d.value))}),e.jsxs(f,{sx:{display:"flex",justifyContent:"flex-end",gap:2},children:[e.jsx(O,{size:"small",onClick:ne,disabled:s,sx:{minWidth:"auto",borderRadius:1,border:"1px solid",borderColor:"divider","&:hover":{backgroundColor:"action.hover"}},children:e.jsx(D,{icon:Gr,hFlip:!0})}),e.jsx(Pt,{open:a,anchorEl:C,onClose:he,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{p:3,width:450,maxHeight:500,overflowY:"auto",backgroundColor:"background.paper",backgroundImage:"none",borderRadius:1,boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},children:e.jsxs(f,{children:[e.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,height:"28px"},children:[e.jsx(I,{variant:"subtitle1",sx:{fontWeight:"bold"},children:h("notification.severity")}),e.jsx(f,{sx:{minWidth:"60px",display:"flex",justifyContent:"flex-end"},children:(g.length>0||R.length>0)&&e.jsx(_,{size:"small",onClick:()=>{k([]),P([]),t({severity:[],id:[]})},startIcon:e.jsx(Rt,{fontSize:"small"}),sx:{color:"text.secondary",textTransform:"none",minWidth:"auto","&:hover":{backgroundColor:"transparent"},"& .MuiButton-startIcon":{marginRight:"2px"}},children:h("notification.clear")})})]}),e.jsx(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(Ee,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2,flex:1},children:Z.map(d=>e.jsx(Le,{elevation:0,sx:_e(R.includes(d.value)),children:e.jsx(Q,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{display:"flex",alignItems:"center",gap:1,fontSize:"0.875rem"},...qe},control:e.jsx(Be,{checked:R.includes(d.value),onChange:()=>se(d.value),disabled:s,size:"small"}),label:e.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5},children:[e.jsx(pe,{severity:d.value}),d.label]})})},d.value))})}),e.jsxs(f,{sx:{mb:2},children:[e.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,mb:1.5},children:[e.jsx(I,{variant:"subtitle1",sx:{fontWeight:"bold",width:"calc(100% - 36px)"},children:h("notification.from")}),e.jsx(f,{sx:{display:"flex",alignItems:"center",width:"calc(100% - 36px)"},children:e.jsx(Ve,{size:"small",placeholder:"search",value:L,onChange:ge,sx:{width:"100%","& .MuiOutlinedInput-input":{padding:"6px 4px 6px 0"},".MuiOutlinedInput-root":{"&:hover":{fieldset:{borderColor:"divider"}},"&.Mui-focused":{fieldset:{borderColor:"divider"}}},fieldset:{borderColor:"divider"}},slotProps:{input:{size:"small",startAdornment:e.jsx(Ye,{position:"start",sx:{marginRight:"2px"},children:e.jsx(D,{icon:yr})})}}})})]}),e.jsx(Ee,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2},children:be.map(d=>e.jsx(Le,{elevation:0,sx:_e(g.includes(d.id)),children:e.jsx(Q,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{fontSize:"0.875rem",width:"calc(100% - 36px)"},...qe},control:e.jsx(Be,{checked:g.includes(d.id),onChange:()=>oe(d.id),disabled:s,size:"small"}),label:e.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,minWidth:0,width:"100%"},children:[d.blocklet&&e.jsx($e,{size:20,blocklet:d.blocklet,ancestors:d.ancestors,style:{borderRadius:4,flexShrink:0}}),e.jsx(I,{noWrap:!0,variant:"body2",component:"span",title:d.label,sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},children:d.label})]})})},d.id))}),j.length>Fe&&L.trim()===""&&e.jsx(_,{fullWidth:!0,size:"small",onClick:me,sx:{mt:1},endIcon:b?e.jsx(It,{}):e.jsx(Tt,{})})]})]})})]})]}),g.length>0||R.length>0?e.jsxs(f,{className:"notification-filter-content",sx:{display:"flex",flexWrap:"wrap",gap:1,mt:2},children:[R.map(d=>{const w=Z.find(A=>A.value===d);return e.jsx(je,{label:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(pe,{severity:d}),w?w.label:d]}),onDelete:()=>se(d),size:"small",variant:"outlined",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`severity-${d}`)}),g.map(d=>{const w=K.find(A=>A.id===d);return e.jsx(je,{label:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:.5},children:[w?.blocklet&&e.jsx($e,{size:16,blocklet:w.blocklet,ancestors:w.ancestors,style:{borderRadius:4,flexShrink:0}}),w?w.label:d]}),variant:"outlined",onDelete:()=>oe(d),size:"small",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`component-${d}`)})]}):null]})}const Vr=ee(zt)`
|
|
2
|
-
position: fixed;
|
|
3
|
-
bottom: 20px;
|
|
4
|
-
right: 20px;
|
|
5
|
-
z-index: 1000;
|
|
6
|
-
@media (max-width: 600px) {
|
|
7
|
-
bottom: 16px;
|
|
8
|
-
right: 16px;
|
|
9
|
-
transform: scale(0.9);
|
|
10
|
-
}
|
|
11
|
-
`;function Yr(){const[t,s]=y.useState(!1);y.useEffect(()=>{const n=Ze(()=>{s(window.pageYOffset>300)},200);return window.addEventListener("scroll",n),n(),()=>window.removeEventListener("scroll",n)},[]);const o=()=>{try{"scrollTo"in window?window.scrollTo({top:0,behavior:"smooth"}):window.scrollTo(0,0)}catch{window.scrollTo(0,0)}};return e.jsx(At,{in:t,children:e.jsx(Vr,{color:"primary",size:"small","aria-label":"scroll back to top",onClick:o,children:e.jsx(Mt,{})})})}const Zr=ee.div`
|
|
12
|
-
display: flex;
|
|
13
|
-
flex-direction: column;
|
|
14
|
-
gap: ${t=>t.inDialog?0:"24px"};
|
|
15
|
-
.MuiContainer-root {
|
|
16
|
-
padding-right: 0;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.profile-button.MuiButtonBase-root {
|
|
20
|
-
border-radius: 9999px;
|
|
21
|
-
margin-right: 2px;
|
|
22
|
-
padding: 5px 12px;
|
|
23
|
-
line-height: 22px;
|
|
24
|
-
font-size: 13px;
|
|
25
|
-
border: 1px solid transparent;
|
|
26
|
-
background-color: ${({theme:t})=>t.palette.background.default};
|
|
27
|
-
color: ${({theme:t})=>t.palette.text.primary};
|
|
28
|
-
font-weight: 400;
|
|
29
|
-
border: 1px solid ${({theme:t})=>t.palette.divider} !important;
|
|
30
|
-
}
|
|
31
|
-
.profile-button.active.MuiButtonBase-root,
|
|
32
|
-
.profile-button.active.MuiButtonBase-root:hover {
|
|
33
|
-
color: ${({theme:t})=>t.palette.primary.main};
|
|
34
|
-
font-weight: 600;
|
|
35
|
-
background-color: ${({theme:t})=>le(t.palette.primary.main,.1)};
|
|
36
|
-
border: 1px solid ${({theme:t})=>le(t.palette.primary.main,.24)} !important;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.profile-button.MuiButtonBase-root:hover {
|
|
40
|
-
background-color: rgba(0, 0, 0, 0.04);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.profile-line-button.MuiButtonBase-root {
|
|
44
|
-
margin-right: 2px;
|
|
45
|
-
color: ${({theme:t})=>t.palette.text.secondary};
|
|
46
|
-
padding: 5px 12px;
|
|
47
|
-
line-height: 22px;
|
|
48
|
-
font-size: 13px;
|
|
49
|
-
border: none !important;
|
|
50
|
-
border-radius: 0;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.profile-line-button.active.MuiButtonBase-root {
|
|
54
|
-
color: ${({theme:t})=>t.palette.text.primary};
|
|
55
|
-
border-bottom: 1px solid ${({theme:t})=>t.palette.text.primary} !important;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.profile-button.MuiButtonBase-root:last-of-type,
|
|
59
|
-
.profile-line-button.MuiButtonBase-root {
|
|
60
|
-
margin-right: 0;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.profile-line-button.MuiButtonBase-root:hover {
|
|
64
|
-
color: ${({theme:t})=>t.palette.text.primary};
|
|
65
|
-
background-color: unset;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
* {
|
|
69
|
-
scrollbar-width: none; /* Firefox */
|
|
70
|
-
-ms-overflow-style: none; /* IE and Edge */
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
*::-webkit-scrollbar {
|
|
74
|
-
display: none; /* Chrome, Safari and Opera */
|
|
75
|
-
}
|
|
76
|
-
`;lt.propTypes={blocklets:u.array,context:u.object,pagination:u.bool,inDialog:u.bool,filterType:u.oneOf(["component","entity"]),toViewAll:u.func,type:u.oneOf(["server","service"])};function lt({blocklets:t=[],context:s,pagination:o=!0,inDialog:n=!1,filterType:l="component",toViewAll:i=()=>{},type:c="service"}){const{data:p,paging:r,refresh:x,loading:m,params:h,onReadNotification:C,componentDids:v,filterUnReadCount:a,initial:g}=s,k=d=>{x({...h,severity:d&&typeof d=="string"?[d]:d||[],paging:{...h.paging,page:1}})},[R]=Ut(),P=T(()=>R.get("id"),[R]),b=xe(d=>d.breakpoints.down("md")),[z,L]=y.useState(0),[U,j]=y.useState(!1),S=y.useMemo(()=>h.read===!1?"unread":"all",[h.read]),B=T(()=>Ze(d=>{if(m)return;const w=p.length,A=p.filter(F=>!Ue(F)).length;let W={...h,append:!0,paging:{...h.paging,...d,currentPage:(r.currentPage||0)+1}};S==="unread"&&A<w&&d.page>h.paging.page&&(W={...h,append:!0,paging:{...h.paging,...d,page:h.paging.page||1,currentPage:(r.currentPage||0)+1}}),x(W)},500),[p,h,S,r,m,x]);Qe(()=>{g&&typeof g=="function"&&g()}),y.useEffect(()=>{(!r.currentPage||r.currentPage===1)&&L(r.total)},[r.total,r.currentPage]),y.useEffect(()=>{setTimeout(()=>{const d=document.getElementById(P);d&&d.scrollIntoView({behavior:"smooth",block:"center"}),j(!0)},100),setTimeout(()=>{j(!1)},3e3)},[P]);const G=T(()=>p?.length>0&&p.length<z,[p,z]),Z=y.useCallback(d=>{const{blocklet:w={}}=window,A=[w?.did,...(w?.ancestors||[]).map(W=>W)];return v?.includes(d)||A.findIndex(W=>W===d)>-1},[v]),ne=y.useMemo(()=>{const d=new Map;return t.length&&t.forEach(w=>{const A=w?.did||w.meta?.did;A&&!d.has(A)&&(w.ancestors=[],d.set(A,w),w?.alsoKnownAs?.length>0&&w.alsoKnownAs.forEach(W=>{d.has(W)||d.set(W,w)})),w?.children?.length>0&&w.children.forEach(W=>{const F=W?.did||W.meta?.did;F&&!d.has(F)&&Z(F)&&(W.ancestors=[w],d.set(F,W))})}),d},[t,Z]),he=y.useCallback(()=>{m||B({page:r.page+1})},[r.page,m,B]),[oe]=_r({loading:m,hasNextPage:G,onLoadMore:he}),se=d=>{!d||Ue(d)||C(d.id).then(()=>{n&&i()})},ge=({severity:d,id:w})=>{if(m)return;let A={};l==="component"?A={entityId:[],componentDid:w}:l==="entity"&&(A={componentDid:[],entityId:w}),x({...h,severity:d,...A,paging:{...h.paging,page:1}})},me=d=>{if(m)return;let w={...h,paging:{...h.paging,page:1}};d==="unread"?(w.read=!1,w.paging.currentPage=1):w=qt(w,"read"),x(w)},K=T(()=>l==="component"?Array.isArray(h.componentDid)?h.componentDid:[]:l==="entity"?Array.isArray(h.entityId)?h.entityId:[]:[],[h,l]),be=T(()=>(Array.isArray(h.severity)?h.severity:[])[0]||"",[h.severity]);return e.jsxs(Zr,{inDialog:!!n,children:[n?e.jsx(st,{currentTab:be,type:"line",theme:"light",onSelectType:k}):e.jsx(at,{loading:m,blockletMap:ne,unReadCount:a,filterType:l,type:c,selectedId:K,onFilterChange:ge,severity:h.severity,onReadFilterChange:me,currentReadFilter:S}),!b&&m?e.jsx(f,{sx:{display:"flex",width:"100%",minHeight:400,justifyContent:"center",alignItems:"center"},children:e.jsx(Y,{})}):e.jsx(br,{data:p,blockletMap:ne,onReadNotification:se,onReadBatch:C,inDialog:n,highlightId:P,highlight:!n&&U,type:c}),o&&!b?e.jsx(Hr,{loading:m,paging:r,onChange:B}):null,o&&b&&(m||G)?e.jsx(f,{ref:oe,sx:{display:"flex",width:"100%",minHeight:100,justifyContent:"center",alignItems:"center"},children:e.jsx(Y,{})}):null,!n&&b?e.jsx(Yr,{}):null]})}const Qr=y.memo(lt),$=new Yt;function Ae(t){const{userDid:s=""}={},{session:o}=Kt(),n=T(()=>{if(s)return s;const r=window.location.href,x=_t(r);return x?.did?Array.isArray(x.did)?x.did[0]:x.did:o?.user?.did},[o?.user?.did,s]),l=T(()=>o.user,[o]),i=T(()=>l?n===l?.did:!1,[n,l?.did]),c=te(async()=>{if(await Vt(()=>o?.initialized),i)return o.user;if(n)return $.user.getUserPublicInfo({did:n})},{refreshDeps:[n,i,o?.initialized,l]}),p=T(()=>l.passports?.some(r=>r.role===Pe.ROLES.OWNER),[l]);return{currentDid:n,session:o,isMyself:i,user:l,viewUser:c.data,isOwner:p}}function ct({user:t,...s}){const{t:o}=N(),n=Et(),l=T(()=>{const p=(t?.passports||[]).map(r=>({...r,revoked:r.status===ir.REVOKED}));return p.sort((r,x)=>r.revoked===x.revoked?0:r.revoked?1:-1),Ne(p.filter(r=>!r.display),"role").concat(Ne(p.filter(r=>r.display),"display.content"))},[t?.passports]),i=T(()=>l?.find(p=>p.name===t.role),[l,t?.role]),c=n.palette.primary.main;return l.length===0?e.jsx(f,{children:e.jsx(Xe,{children:o("userCenter.noPassport")})}):e.jsx(f,{...s,sx:{display:"grid",justifyItems:"start",gridTemplateColumns:{xs:"repeat(2, 1fr)",sm:"repeat(2, 1fr)",md:"repeat(3, 1fr)",lg:"repeat(5, 1fr)"},gap:2.5,...s.sx},children:l.map(p=>e.jsx(wr,{passport:p,user:t,color:window.blocklet.passportColor,createPassportSvg:Zt,title:i&&i.role===p.role?o("userCenter.currentPassport"):"",sx:{flexDirection:"column",alignItems:"center",gap:1,".passport-item__display":{width:166,height:166,borderRadius:1,px:2,display:"flex",justifyContent:"center",backgroundColor:"grey.50",boxShadow:i&&i.role===p.role?`0px 2px 4px 0px ${c}, 0px 1px 2px -1px ${c}, 0px 0px 0px 1px ${c} !important`:"unset"},".passport-item__body":{marginLeft:"0 !important"}}},p.id))})}ct.propTypes={user:u.object.isRequired};function Jr({visible:t,onClose:s,nft:o}){return!t||!o?null:e.jsx(Xr,{children:e.jsx(Lt,{open:t,onClose:s,children:e.jsx(en,{onClick:s,children:e.jsx(rt,{data:nt(o),address:o.address,inset:!0})})})})}const Xr=ee.div`
|
|
77
|
-
position: relative;
|
|
78
|
-
width: 100%;
|
|
79
|
-
height: 100%;
|
|
80
|
-
cursor: pointer;
|
|
81
|
-
|
|
82
|
-
&:hover {
|
|
83
|
-
.mask {
|
|
84
|
-
opacity: 1;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.mask {
|
|
89
|
-
position: absolute;
|
|
90
|
-
top: 0;
|
|
91
|
-
left: 0;
|
|
92
|
-
display: flex;
|
|
93
|
-
align-items: center;
|
|
94
|
-
justify-content: center;
|
|
95
|
-
width: 100%;
|
|
96
|
-
height: 100%;
|
|
97
|
-
background: rgba(0, 0, 0, 0.6);
|
|
98
|
-
opacity: 0;
|
|
99
|
-
transition: opacity 0.2s;
|
|
100
|
-
}
|
|
101
|
-
`,en=ee.div`
|
|
102
|
-
display: flex;
|
|
103
|
-
justify-content: center;
|
|
104
|
-
align-items: center;
|
|
105
|
-
height: 100vh;
|
|
106
|
-
width: 100vw;
|
|
107
|
-
|
|
108
|
-
img,
|
|
109
|
-
object {
|
|
110
|
-
max-width: 90vw;
|
|
111
|
-
max-height: 75vh;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.nft-display--inset {
|
|
115
|
-
> .MuiBox-root,
|
|
116
|
-
.nft-display__loading {
|
|
117
|
-
width: 75vmin;
|
|
118
|
-
height: 75vmin;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
`,tn=t=>({position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.6)",opacity:0,transition:"opacity 0.3s ease-in-out",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1,"& .mask-item":{backgroundColor:le(t.palette.background.paper,.9),color:"text.primary","&:hover":{backgroundColor:le(t.palette.background.paper,1)}}}),rn={position:"absolute",bottom:0,left:0,right:0,height:24,backgroundColor:"rgba(0, 0, 0, 0.6)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",gap:1,zIndex:1,"& .mask-item":{width:20,height:20,color:"white"}},He="https://main.abtnetwork.io/explorer";function dt({user:t}){const{t:s}=N(),o=re(),[n,l]=y.useState({visible:!1,nft:null}),[i,c]=y.useState({anchorEl:null,props:null}),p=P=>{const b=ce(He,"assets",P);window.open(b,"_blank")},r=(P,b)=>{let z="";typeof b.data?.value=="string"?z=JSON.parse(b.data?.value)?.domain:z=b.data?.value?.domain,c({anchorEl:P,props:{title:z?`Hey, I just won an NFT at the ${z} event!`:"Hey, I just won an NFT!",url:ce(He,"assets",b.address)}})},x=P=>{l({visible:!0,nft:P})},m=H({page:1,size:20}),h=te(async(P=m)=>(await Ht.get(`${Pe.WELLKNOWN_SERVICE_PATH_PREFIX}/ocap/listAssets`,{params:{ownerAddress:t.did,...P}})).data,{ready:t?.did&&m,defaultParams:[m],refreshDeps:[t?.did,m]}),{loading:C,data:v}=h,a=v?.page??{cursor:0,next:!1,total:0},g=(P,b)=>{m.page=b,h.run(m)},k=E(P=>[e.jsx(O,{size:"small",className:"mask-item",onClick:b=>{b.stopPropagation(),p(P.address)},children:e.jsx(D,{icon:"tabler:link",fontSize:18})},"link"),e.jsx(O,{size:"small",onClick:b=>{b.stopPropagation(),r(b.currentTarget,P)},className:"mask-item",children:e.jsx(D,{icon:"tabler:share-2",fontSize:18})},"share"),e.jsx(O,{size:"small",onClick:b=>{b.stopPropagation(),x(P)},className:"mask-item",children:e.jsx(D,{icon:"tabler:eye",fontSize:18})},"view")]),R=T(()=>{if(C){const P=["skeleton-1","skeleton-2","skeleton-3","skeleton-4","skeleton-5"].map(b=>e.jsx(We,{variant:"rectangular",width:"15%",height:166,sx:{borderRadius:1,flexShrink:0}},b));return e.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsx(We,{width:"20%"}),e.jsx(f,{sx:{display:"flex",flexDirection:"row",gap:2,flexWrap:"nowrap"},children:P})]})}return e.jsxs(e.Fragment,{children:[e.jsx(I,{sx:{color:"grey.A700",fontWeight:600,mb:2.5},children:s("userCenter.common.nft")}),v?.assets?.length===0&&!C&&e.jsx(f,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},children:e.jsx(Xe,{children:s("userCenter.common.noNFT")})}),e.jsx(f,{className:"nft-list-wrapper",sx:{display:"grid",justifyItems:"start",gridTemplateColumns:{xs:"repeat(2, 1fr)",sm:"repeat(3, 1fr)",md:"repeat(3, 1fr)",lg:"repeat(5, 1fr)"},gap:2.5},children:v?.assets?.map(P=>e.jsxs(f,{sx:{flexShrink:0,width:{xs:120,sm:120,md:120,lg:166},height:{xs:120,sm:120,md:120,lg:166},position:"relative",borderRadius:1,overflow:"hidden",cursor:"pointer",...o?{}:{"&:hover .mask":{opacity:1}}},children:[e.jsx(rt,{data:nt(P),address:P.address,inset:!0,imageFilter:{imageFilter:"resize",w:"500",f:"webp"}}),o?e.jsx(f,{className:"footer-mask",sx:rn,children:k(P)}):e.jsx(f,{className:"mask",sx:tn,children:e.jsx(ke,{direction:"row",spacing:1,children:k(P)})})]},P.address))}),a.next||m.page>1?e.jsx(Bt,{sx:{display:"flex",justifyContent:"center",mt:2},page:m.page,onChange:g,count:Math.ceil(a.total/m.size),size:"small"}):null,e.jsx(Jr,{visible:n.visible&&!!n.nft,nft:n.nft,onClose:()=>{l({visible:!1,nft:null})}}),e.jsx(ar,{anchorEl:i.anchorEl,onClose:()=>{c({anchorEl:null,props:null})},sharedProps:i.props||{title:"",url:""}})]})},[C,a,m.page,m.size,g,i,n]);return e.jsx(f,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2,mb:5},children:R})}dt.propTypes={user:u.object.isRequired};function nn(){const{t}=N(),{user:s,isMyself:o,viewUser:n}=Ae();return e.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[o?e.jsxs(f,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1.5,p:2},children:[e.jsx(I,{sx:{color:"text.primary",fontWeight:600,mb:2.5},children:t("userCenter.passport")}),e.jsx(ct,{user:s})]}):null,e.jsx(dt,{user:o?s:n})]})}const on=[{name:"English",code:"en"},{name:"中文",code:"zh"}];function ut({user:t,onSave:s}){const{t:o,changeLocale:n}=N(),l=H({locale:t.locale,loading:!1}),i=E(async c=>{try{const{value:p}=c.target;l.loading=!0,await $.user.saveProfile({locale:p}),await s("profile"),n(p),l.locale=p}catch(p){q.error(X(p))}finally{l.loading=!1}});return e.jsxs(f,{sx:{gap:1,display:"grid",alignItems:"center",gridTemplateColumns:{xs:"1fr",sm:"max-content 1fr"}},children:[e.jsx(f,{children:o("userCenter.commonSetting.locale")}),e.jsx(f,{children:e.jsx(Se,{value:l.locale,onChange:i,size:"small",IconComponent:c=>e.jsx(Je,{...c,width:20,height:20}),sx:{minWidth:200,"&:hover":{"fieldset.MuiOutlinedInput-notchedOutline":{borderColor:"divider"}},fieldset:{borderColor:"divider"}},children:(window.blocklet.languages||on).map(c=>e.jsx(ae,{value:c.code,children:c.name},c.code))})})]})}ut.propTypes={user:u.shape({locale:u.string}).isRequired,onSave:u.func.isRequired};function Ce({onTest:t=V,onDelete:s=V,onSave:o=V,onCancel:n=V,type:l="slack",url:i="",edit:c=!1}){const{t:p}=N(),r=H({type:l||"slack",url:i||"",edit:c??!1,error:"",loading:!1}),x=E(()=>r.url?Qt(r.url)?(r.error="",!0):(r.error=p("common.invalid"),!1):(r.error=p("common.required"),!1)),m=E(()=>{r.edit=!1,r.url=i||"",r.type=l||"slack",r.error="",r.loading=!1,n()}),h=E(async a=>{r.loading=!0,await t(a),r.loading=!1}),C=E(a=>()=>{x()&&a({type:r.type,url:r.url})}),v=T(()=>r.error?e.jsx(I,{component:"span",color:"error",children:r.error}):r.edit?r.loading?e.jsx(Y,{size:16}):e.jsx(O,{size:"small",onClick:C(h),sx:{mr:-1},children:e.jsx(D,{icon:jr})}):null,[r.error,r.edit,r.loading]);return e.jsxs(f,{sx:{display:"flex",gap:1.5,width:"100%",alignItems:{xs:"flex-start",md:"center"},flexDirection:{xs:"column",md:"row"}},children:[e.jsxs(Se,{sx:{borderRadius:1,"&.Mui-disabled":{backgroundColor:"grey.50"}},disabled:!r.edit||r.loading,size:"small",value:r.type,onChange:a=>{r.type=a.target.value},children:[e.jsx(ae,{value:"api",children:p("userCenter.webhook.url")}),e.jsx(ae,{value:"slack",children:p("userCenter.webhook.slack")})]}),e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:.5,width:"100%"},children:[e.jsx(Ve,{sx:{flex:1,".MuiInputBase-root":{borderRadius:1,"&.Mui-disabled":{backgroundColor:"grey.50"}}},disabled:!r.edit||r.loading,fullWidth:!0,size:"small",required:!0,value:r.url,onChange:a=>{r.url=a.target.value,x()},error:!!r.error,slotProps:{input:{endAdornment:e.jsx(Ye,{position:"end",children:v})}}}),e.jsx(f,{sx:{display:"flex",gap:.5},children:r.edit?e.jsxs(e.Fragment,{children:[e.jsx(O,{color:"success",onClick:C((...a)=>{o(...a),r.edit=!1}),sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(D,{icon:lr})}),e.jsx(O,{color:"error",onClick:m,sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(D,{icon:cr})})]}):e.jsxs(e.Fragment,{children:[e.jsx(O,{onClick:()=>{r.edit=!0},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(D,{icon:Cr})}),e.jsx(O,{color:"error",onClick:()=>{s({type:r.type,url:r.url})},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(D,{icon:Sr})})]})})]})]})}Ce.propTypes={onTest:u.func,onDelete:u.func,onSave:u.func,onCancel:u.func,type:u.oneOf(["api","slack"]),url:u.string,edit:u.bool};function ie({title:t=void 0,description:s=void 0,value:o,onChange:n,isMobile:l}){const i=E(c=>{c.stopPropagation()});return e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(ot,{checked:o,size:"small",onChange:n}),e.jsxs(I,{component:"div",onClick:i,sx:{color:"text.primary",fontSize:14,display:"flex",flexWrap:l?"wrap":"nowrap",columnGap:1,flex:1,whiteSpace:l?"normal":"nowrap"},children:[t,s]})]})}ie.propTypes={title:u.string,description:u.node,value:u.bool.isRequired,onChange:u.func.isRequired,isMobile:u.bool.isRequired};function pt({user:t,isMobile:s}){const{t:o}=N(),n=H({showAdd:!1}),l=te(async()=>await $.user.getUserNotificationConfig(),{refreshDeps:[t],loadingDelay:300}),i=T(()=>({wallet:!0,email:!0,phone:!1,push:!0,...l?.data?.notifications||{}}),[l?.data?.notifications]),c=T(()=>l?.data?.webhooks||[],[l?.data?.webhooks]),p=E(async v=>{try{await $.user.saveUserNotificationConfig(v),q.success(o("userCenter.saveSuccess")),l.run()}catch(a){q.error(X(a))}}),r=E(async(v,a)=>{await p({notifications:{[v]:a}})}),x=async v=>{try{await $.user.testNotificationWebhook(v),q.success(o("userCenter.webhookTested"))}catch(a){q.error(X(a))}},m=E(async v=>{await p({webhooks:c.filter((a,g)=>g!==v)})}),h=E(async(v,a)=>{await p({webhooks:c.map((g,k)=>k===v?a:g)})}),C=E(async v=>{await p({webhooks:[...c,v]}),n.showAdd=!1});return l.error?e.jsx(Wt,{severity:"error",children:l.error.message}):l.loading||!l.data?e.jsx(f,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px"},children:e.jsx(Y,{})}):e.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"start",".MuiFormControlLabel-root":{gap:1,m:0,flexDirection:{xs:"row-reverse",md:"row"},width:{xs:"100%",md:"unset"}},".MuiSwitch-track":{borderRadius:"100vw"},".MuiSwitch-thumb":{borderRadius:"100%"},".MuiSwitch-root.MuiSwitch-sizeSmall":{height:"20px",width:"36px",".MuiSwitch-thumb":{width:"16px",height:"16px"}}},children:[e.jsx(ie,{value:i.wallet,isMobile:s,title:o("userCenter.walletNotification"),onChange:v=>r("wallet",v.target.checked),description:De(t)&&e.jsx(dr,{did:De(t),showQrcode:!1,showAvatar:!s,copyable:!0,compact:!0,responsive:!0,startChars:s?2:6})}),e.jsx(ie,{value:i.email,isMobile:s,onChange:v=>r("email",v.target.checked),title:o("userCenter.emailNotification"),description:t?.email&&e.jsx(I,{component:"span",sx:{color:"text.secondary",fontSize:13},children:t?.email})}),e.jsx(ie,{isMobile:s,value:i.push,title:o("userCenter.pushNotification"),onChange:v=>r("push",v.target.checked)})]}),e.jsxs(ke,{spacing:1.5,useFlexGap:!0,direction:"column",sx:{alignItems:"start"},children:[c.map((v,a)=>e.jsx(Ce,{onTest:x,onDelete:()=>m(a),onSave:(...g)=>h(a,...g),type:v.type,url:v.url,edit:!1},`${a}_${v.url}`)),n.showAdd&&e.jsx(Ce,{onTest:x,onCancel:()=>{n.showAdd=!1},onSave:(...v)=>C(...v),edit:!0},"add"),e.jsx(et,{variant:"outlined",size:"small",sx:{color:"text.primary",borderColor:"divider","&:hover":{borderColor:"divider"},py:.5,borderRadius:1},startIcon:e.jsx(D,{icon:kr}),onClick:()=>{n.showAdd=!0},children:o("userCenter.addWebhook")})]})]})}pt.propTypes={user:u.object.isRequired,isMobile:u.bool.isRequired};function xt({item:t}){const s=Te(),{blocklet:o}=Jt(),{confirmApi:n,confirmHolder:l}=Re(),i=H({loading:!1}),{t:c}=N(),{session:p}=y.use(fe),{bindOAuth:r,unbindOAuth:x,setBaseUrl:m,baseUrl:h}=p.useOAuth(),{disconnectPasskey:C,setTargetAppPid:v}=p.usePasskey(),a=T(()=>ur[t?.provider]||"unknown",[t?.provider]),g=E(async()=>{if(t?.provider===M.PASSKEY){await new Promise((b,z)=>{n.open({title:c("userCenter.thirdPartyLogin.disconnectPasskey",{name:a}),content:c("userCenter.thirdPartyLogin.disconnectPasskeyDescription",{name:a}),confirmButtonText:c("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:c("common.cancel"),onConfirm(L){C({session:p,connectedAccount:t}).then(b).catch(z),L()},onCancel:b})});return}try{i.loading=!0,await new Promise((b,z)=>{if(t?._bind)n.open({title:c("userCenter.thirdPartyLogin.confirmUnbind",{name:a}),content:c("userCenter.thirdPartyLogin.confirmUnbindDescription",{name:a}),confirmButtonText:c("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:c("common.cancel"),onConfirm(L){x({session:p,connectedAccount:{...Gt(t,["did","pk"]),showProvider:t.provider,provider:t._rawProvider}}).then(b).catch(z),L()},onCancel:b});else if(t.provider===M.WALLET)p.bindWallet({onSuccess:b,onCancel:z});else{const L=h,U=window?.blocklet;let j="/";const S=pr(U),B=xr(U);S&&B?.appPid&&p?.user?.sourceAppPid&&(j=B.appUrl),m(j),v(o?.appPid),r({session:p,oauthItem:{...t,provider:t._rawProvider}}).then(b).catch(z).finally(()=>{m(L),v()})}})}catch(b){console.error(`Failed to ${t?._bind?"unbind":"bind"} oauth account`,b)}finally{i.loading=!1}}),k=E(b=>b.provider===M.WALLET&&b.did?c("userCenter.thirdPartyLogin.walletAccount"):b._mainProvider?c("userCenter.thirdPartyLogin.mainAccount"):b?._bind?c("userCenter.thirdPartyLogin.disconnect"):c("userCenter.thirdPartyLogin.connect")),R=E(b=>b.provider===M.WALLET&&b.did?c("userCenter.thirdPartyLogin.walletAccountCantRemove"):b.provider===M.PASSKEY?c("userCenter.thirdPartyLogin.dontSupportRemoveinArcSphere"):b._mainProvider?c("userCenter.thirdPartyLogin.mainProviderCantRemove"):""),P=E(b=>b.provider===M.WALLET&&b.did||b.provider===M.PASSKEY&&(s.arcSphere||s.wallet)?!0:!!t._mainProvider,[s.arcSphere]);return e.jsxs(e.Fragment,{children:[e.jsxs(f,{sx:{borderRadius:1,border:"1px solid",borderColor:"divider",backgroundColor:"grey.50",display:"flex",alignItems:"center",py:1,px:1.5,gap:.75,fontSize:"14px",lineHeight:1,overflow:"hidden"},children:[e.jsx(Xt,{provider:t?.provider,sx:{width:"1em",height:"1em",flexShrink:0,fontSize:16,filter:({palette:b})=>t?.provider===M.GITHUB&&b.mode==="dark"?"invert(1)":"none"}}),e.jsx(f,{sx:{flex:1,display:{xs:t.userInfo?.email||t.did?"none":"block",sm:"block"}},children:a}),t.userInfo?.email||t.did?e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:.5,overflow:"hidden"},children:[e.jsx(f,{sx:{flex:1,textOverflow:"ellipsis",overflow:"hidden",lineHeight:"normal"},children:t.userInfo?.email||t.did}),t.userInfo?.name?e.jsx(J,{title:e.jsx(e.Fragment,{children:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(tt,{size:36,variant:"circle",shape:"circle",src:t.userInfo?.picture,did:t.did}),e.jsxs(f,{children:[e.jsx(I,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:t.userInfo?.name}),e.jsx(I,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:t.userInfo?.email})]})]})}),children:e.jsx(f,{component:D,icon:er,sx:{color:"text.secondary",fontSize:16,cursor:"pointer",flexShrink:0}})}):null]}):null]}),e.jsx(J,{title:R(t),placement:"auto",children:e.jsx(f,{children:e.jsx(et,{variant:"outlined",size:"small",sx:b=>{const z=b.palette.error.main,L=b.palette.primary.main;return{color:t?._bind?z:L,borderColor:t?._bind?z:L,backgroundColor:"background.default","&:hover":{borderColor:t?._bind?z:L,backgroundColor:"action.hover"},py:.5,borderRadius:1,fontWeight:500,whiteSpace:"nowrap"}},fullWidth:!0,startIcon:i.loading?null:e.jsx(D,{icon:Pr}),onClick:g,disabled:P(t),loading:i.loading,children:k(t)})})}),l]})}xt.propTypes={item:u.shape({provider:u.string,did:u.string,pk:u.string,userInfo:u.object,id:u.string,_bind:u.bool,_rawProvider:u.string,_mainProvider:u.bool}).isRequired};function ft({user:t}){const{session:s}=y.use(fe),[o,n]=y.useState({}),{getOAuthConfigs:l}=s.useOAuth(),i=Te();sr(async()=>{const r=await l({sourceAppPid:t?.sourceAppPid});n(r)},[t?.sourceAppPid]);const c=T(()=>{const r=Object.keys(o).map(x=>({...o[x],provider:x})).filter(x=>x.enabled);return[{provider:M.WALLET,order:-1},...r,{provider:M.PASSKEY,order:1/0}]},[o]),p=T(()=>{const r=fr(t);let x=!1,m="",h=hr(t);const C=r.find(a=>a.provider===M.AUTH0);return C&&(C.id.startsWith("google-oauth2|")&&(r.some(a=>a.provider==="google")||(x=!0,m=M.GOOGLE,h===M.AUTH0&&(h=M.GOOGLE))),C.id.startsWith("appleid|")&&(r.some(a=>a.provider===M.APPLE)||(x=!0,m=M.APPLE,h===M.AUTH0&&(h=M.APPLE))),C.id.startsWith("github|")&&(r.some(a=>a.provider===M.GITHUB)||(x=!0,m=M.GITHUB,h===M.AUTH0&&(h=M.GITHUB)))),c.map(a=>{if(a.provider===M.AUTH0&&x)return null;const g=x&&a.provider===m?r.find(k=>k.provider===M.AUTH0):r.find(k=>k.provider===a.provider);return g?{...a,provider:a.provider,did:g.did,pk:g.pk,userInfo:g.userInfo,_bind:!0,_rawProvider:g.provider,_mainProvider:a.provider===h}:{...a,provider:a.provider,_rawProvider:a.provider,_mainProvider:a.provider===h}}).filter(a=>!(!a||a.provider===M.PASSKEY&&!a.did)).sort((a,g)=>a._mainProvider?-1:a?.order!==void 0&&g?.order!==void 0?a.order-g.order:a?.order!==void 0?-1:1)},[t?.connectedAccounts,c]);return e.jsxs(f,{sx:{gap:1,display:"grid",gridTemplateColumns:"1fr min-content"},children:[p.map(r=>e.jsx(xt,{item:r},r?.provider)),i.wallet||i.arcSphere?null:e.jsx(tr,{behavior:"only-new",action:"connect",createMode:"connect",createButtonText:"Add New Passkey",onSuccess:V,onError:V,dense:!0,sx:{px:1.5,py:1,gap:.75}})]})}ft.propTypes={user:u.object.isRequired};function ht({configList:t,onSave:s}){const[o,n]=y.useState(t),{t:l}=N(),i=E(async(c,p)=>{try{const r=await $.user.saveUserPrivacyConfig({[c]:!p});n(o.map(x=>({...x,value:r?.[x.key]??x.value}))),q.success(l("userCenter.saveSuccess")),s("privacy")}catch(r){q.error(X(r))}});return y.useEffect(()=>{n(t)},[t]),e.jsx(f,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"start",".MuiFormControlLabel-root":{gap:1,m:0,flexDirection:{xs:"row-reverse",md:"row"},width:{xs:"100%",md:"unset"}},".MuiSwitch-track":{borderRadius:"100vw"},".MuiSwitch-thumb":{borderRadius:"100%"},".MuiSwitch-root.MuiSwitch-sizeSmall":{height:"20px",width:"36px",".MuiSwitch-thumb":{width:"16px",height:"16px"}}},children:o.map(c=>c.isPrivate?null:e.jsx(ot,{checked:!c.value,labelProps:{label:e.jsx(I,{sx:{color:"text.primary",fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:l("userCenter.toPublic",{name:c.name})})},size:"small",onChange:p=>i(c.key,p.target.checked)},c.key))})}ht.propTypes={configList:u.arrayOf(u.shape({key:u.string.isRequired,name:u.string.isRequired,value:u.bool.isRequired,isPrivate:u.bool})).isRequired,onSave:u.func.isRequired};function gt({user:t,sessionUser:s}){const o=T(()=>(t?.passports||[])?.find(n=>n.name===s.role),[t?.passports,s?.role]);return e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(tt,{size:40,variant:"circle",shape:"circle",src:s.avatar,did:s.did,sx:{flexShrink:0}}),e.jsxs(f,{sx:{flex:1,overflow:"hidden"},children:[e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(J,{title:s.fullName,children:e.jsx(I,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flex:1},children:s.fullName})}),e.jsx(je,{label:o?.title||o?.name||"Guest",size:"small",variant:"outlined",sx:{flexShrink:0,fontWeight:"bold",fontSize:"12px",color:"text.primary",borderColor:"grey.300",backgroundColor:"transparent",textTransform:"capitalize",pr:.5,pl:0,height:"auto"}})]}),e.jsx(J,{title:s.email,children:e.jsx(I,{variant:"body2",color:"grey",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:s.email})})]})]})}gt.propTypes={user:u.object.isRequired,sessionUser:u.shape({role:u.string,avatar:u.string,did:u.string,fullName:u.string,email:u.string}).isRequired};const sn=()=>Promise.resolve(""),Ge=t=>new ve(t,{browser:[[/(ArcWallet)\/([\w\.]+)/i],[ve.BROWSER.NAME,ve.BROWSER.VERSION]]}).getResult(),Ke={display:"flex",justifyContent:"flex-end",textAlign:"right"},an=new rr({concurrency:1}),Me=y.memo(({userSession:t,isMobile:s=!1})=>{const o=H({loading:!0,ipRegion:""}),{t:n}=N();return y.useEffect(()=>{an.add(async()=>{try{o.ipRegion=await sn(t.lastLoginIp)}finally{o.loading=!1}})},[o,t.lastLoginIp]),e.jsx(f,{...s&&{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:1,flexWrap:"wrap"},children:o.ipRegion?e.jsxs(e.Fragment,{children:[e.jsx(I,{variant:"body2",children:o.ipRegion}),e.jsx(I,{variant:"body2",color:"grey",children:t.lastLoginIp||n("userCenter.unknown")})]}):e.jsxs(e.Fragment,{children:[e.jsx(I,{children:t.lastLoginIp||n("userCenter.unknown")}),o.loading?e.jsx(I,{variant:"body2",color:"grey",sx:{textAlign:"center"},children:e.jsx(Y,{size:12,color:"inherit"})}):null]})})});Me.propTypes={userSession:u.object.isRequired,isMobile:u.bool};Me.defaultProps={isMobile:!1};function mt({user:t,showAction:s=!0,showUser:o=!0,getUserSessions:n,showOffline:l=!1}){const i=H({status:"online",page:1,pageSize:10}),c=H({online:0,expired:0,offline:0}),p=gr(),{t:r}=N(),x=re({key:"md"}),m=xe(j=>j.breakpoints.down("lg")),{confirmApi:h,confirmHolder:C}=Re(),v=E(async()=>{const j=await n({page:i.page,pageSize:i.pageSize,status:i.status}),S=j?.paging?.total||0;return c[i.status]=S,{total:S,list:j?.list||[]}});Qe(async()=>{const j=await n({page:1,pageSize:1,status:"expired"});c.expired=j?.paging?.total||0;const S=await n({page:1,pageSize:1,status:"offline"});c.offline=S?.paging?.total||0});const a=te(v,{refreshDeps:[i.status,i.page,i.pageSize]}),g=T(()=>a.data?.list||[],[a.data?.list]),k=T(()=>{const{status:j}=i;return j==="online"?c[j]<=1:c[j]===0},[g,p]),R=T(()=>de({},x?Ke:{}),[x]),P=E(({visitorId:j})=>{h.open({title:r("userCenter.logoutThisSession"),content:r("userCenter.logoutThisSessionConfirm"),confirmButtonText:r("userCenter.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:r("userCenter.cancel"),onConfirm:async()=>{await $.user.logout({visitorId:j,includeFederated:!0});const{page:S=0}=i,{list:B=[]}=a.data||{},G=B.length||0;S>1&&G===1&&(i.page=Math.max(S-1,1)),a.refresh(),h.close()}})}),b=E(()=>{h.open({title:r("userCenter.logoutAllSession",{type:r(i.status)}),content:r("userCenter.logoutAllSessionConfirm",{type:r(i.status)}),confirmButtonText:r("userCenter.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:r("userCenter.cancel"),onConfirm:async()=>{await $.user.logout({status:i.status,visitorId:p,includeFederated:!0}),i.page=1,a.refresh(),h.close()}})}),z=[];s&&z.push(e.jsx(J,{title:r("userCenter.logoutAllTips",{type:r(i.status)}),children:e.jsx(_,{sx:{ml:.5},size:"small",variant:"contained",color:"error",onClick:b,disabled:k,children:r("userCenter.logoutAll",{type:r(i.status)})})},"logoutAll"));const L=T(()=>({search:!1,sort:!1,download:!1,filter:!1,print:!1,expandableRowsOnClick:!1,searchDebounceTime:600,page:i.page-1,rowsPerPage:i.pageSize,count:a.data?.total||0}),[a.data?.total,i.page,i.pageSize]),U=[{label:r("userCenter.platform"),name:"platform",options:{customBodyRenderLite:j=>{const S=g[j],B=Ge(S?.ua);return e.jsx(f,{sx:R,children:[B.os?.name,B.os?.version].filter(Boolean).join("/")||r("userCenter.unknown")})}}},{label:r("userCenter.deviceType"),name:"deviceType",options:{customBodyRenderLite:j=>{const S=g[j],B=Ge(S?.ua);return e.jsx(f,{sx:R,children:[B.browser?.name,B.browser?.version].filter(Boolean).join("/")||r("userCenter.unknown")})}}},{label:r("userCenter.walletOS"),name:"walletOS",options:{customBodyRenderLite:j=>{const S=g[j];return e.jsx(f,{sx:R,children:S.extra?.walletOS||r("userCenter.unknown")})}}},o&&{label:r("userCenter.user"),name:"user",options:{customBodyRenderLite:j=>{const S=g[j];return e.jsx(f,{sx:de({minWidth:150,maxWidth:250},x?Ke:{}),children:e.jsx(gt,{sessionUser:S.user,user:t})})}}},{label:r("userCenter.createdAt"),name:"createdAt",options:{customBodyRenderLite:j=>{const S=g[j];return e.jsx(f,{sx:R,children:S.createdAt?e.jsx(Oe,{value:S.createdAt,relativeRange:3*86400*1e3}):r("userCenter.unknown")})}}},!l&&{label:r("userCenter.updatedAt"),name:"updatedAt",options:{customBodyRenderLite:j=>{const S=g[j];return e.jsx(f,{sx:R,children:S.status==="expired"?r("userCenter.expired"):e.jsx(Oe,{value:S.updatedAt,relativeRange:3*86400*1e3})})}}},{label:r("userCenter.lastLoginIp"),name:"lastLoginIp",options:{customBodyRenderLite:j=>{const S=g[j];return e.jsx(Me,{userSession:S,isMobile:x})}}},s&&{label:r("userCenter.actions"),name:"actions",options:{customBodyRenderLite:j=>{const S=g[j];return e.jsx(f,{sx:R,children:e.jsx(_,{sx:{whiteSpace:"nowrap",fontSize:"12px !important",lineHeight:"1.25",px:1},disabled:p===S.visitorId,variant:"outlined",size:"small",color:"error",onClick:()=>P({visitorId:S.visitorId}),children:S.status==="expired"?r("userCenter.remove"):p===S.visitorId?r("userCenter.currentSession"):r("userCenter.logout")})})}}}].filter(Boolean);return e.jsxs(f,{className:"pc-user-sessions",sx:{maxWidth:x?"unset":m?"calc(100vw - 300px)":"100%",...x&&{".pc-user-sessions-table > div:nth-child(2)":{border:"1px solid",borderColor:"divider",borderRadius:1}},".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableRow-root":{border:"unset","&:nth-child(even)":{backgroundColor:"grey.50","&:hover":{backgroundColor:j=>`${j.palette.grey[50]} !important`}}},".MuiTableRow-hover":{"&:hover":{backgroundColor:"inherit !important"}},".MuiTableCell-root":{paddingRight:"8px",paddingLeft:"8px",color:"text.secondary",...x&&{padding:"8px !important","&:first-child":{paddingTop:"20px!important"},"&:last-child":{paddingBottom:"20px!important"}}}},children:[C,e.jsx(mr,{count:a.data?.total||0,data:g,columns:U,customButtons:z,options:L,loading:a.loading,className:"pc-user-sessions-table",title:e.jsxs(Nt,{row:!0,sx:{lineHeight:1,ml:1},onChange:j=>{i.status=j.target.value},children:[e.jsx(Q,{value:"online",control:e.jsx(ye,{size:"small",sx:{lineHeight:1,fontSize:0},checked:i.status==="online"}),label:e.jsxs(I,{sx:{display:"flex",alignItems:"center"},children:[r("userCenter.online"),e.jsxs(I,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",c.online,")"]})]})}),e.jsx(Q,{value:"expired",control:e.jsx(ye,{size:"small",sx:{lineHeight:1,fontSize:0},checked:i.status==="expired"}),label:e.jsxs(I,{sx:{display:"flex",alignItems:"center"},children:[r("userCenter.expired"),e.jsxs(I,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",c.expired,")"]})]})}),l?e.jsx(Q,{value:"offline",control:e.jsx(ye,{size:"small",sx:{lineHeight:1,fontSize:0},checked:i.status==="offline"}),label:e.jsxs(I,{sx:{display:"flex",alignItems:"center"},children:[r("userCenter.offline"),e.jsxs(I,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",c.offline,")"]})]})}):null]}),onChange:j=>{i.page=j.page+1,i.pageSize=j.rowsPerPage}})]})}mt.propTypes={user:u.object.isRequired,showAction:u.bool,showUser:u.bool,showOffline:u.bool,getUserSessions:u.func.isRequired};function bt({onDestroySelf:t=void 0}){const{confirmHolder:s}=Re(),{t:o}=N(),{session:n}=y.use(fe),l=E(async()=>{if(!t||typeof t!="function")return;const i=n.withSecondaryAuth(t,{extraParams:{removeUserDid:n?.user?.did,input:{user:{did:n?.user?.did},teamDid:window?.blocklet?.did}},operation:"destroySelf"});try{await i(),n.logout()}catch(c){q.error(c?.message||o("userCenter.destroyMyself.error"))}});return e.jsxs(e.Fragment,{children:[e.jsx(f,{children:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"space-between",flexWrap:"wrap"},children:[e.jsxs(f,{children:[e.jsx(I,{variant:"h6",sx:{fontSize:"0.875rem !important",fontWeight:"bold"},children:o("userCenter.dangerZone.deleteAccount")}),e.jsx(I,{variant:"caption",sx:{color:"text.secondary"},children:o("userCenter.dangerZone.deleteAccountDescription")})]}),e.jsx(_,{variant:"contained",color:"error",size:"small",onClick:l,children:o("userCenter.dangerZone.delete")})]})}),s]})}bt.propTypes={onDestroySelf:u.func};function ln(){const t=re({key:"md"}),s=xe(l=>l.breakpoints.down("lg")),o={display:"flex",justifyContent:"flex-end",flexWrap:"wrap",textAlign:"right","&.expired-at > div":{maxWidth:160,justifyContent:"flex-end",flexWrap:"wrap"}},n=T(()=>de({},t?o:{}),[t]);return e.jsx(f,{id:"user-center-access-key-setting",sx:{maxWidth:t?"unset":s?"calc(100vw - 300px)":"100%",...t&&{".pc-access-key-table > div:nth-child(2)":{border:"1px solid",borderColor:"divider",borderRadius:1}},".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableRow-root":{border:"unset","&:nth-child(even)":{backgroundColor:"grey.50","&:hover":{backgroundColor:l=>`${l.palette.grey[50]} !important`}}},".MuiTableRow-hover":{"&:hover":{backgroundColor:"inherit !important"}},".MuiTableCell-root":{paddingRight:"8px",paddingLeft:"8px",color:"text.secondary",...t&&{padding:"8px !important","&:first-child":{paddingTop:"20px!important"},"&:last-child":{paddingBottom:"20px!important"}}}},children:e.jsx(Tr,{isSelf:!0,columnSx:n})})}function yt({onDestroySelf:t=void 0,userCenterTabs:s=[]}){const{t:o}=N(),{user:n,session:l,isMyself:i,isOwner:c}=Ae(),r=Te().arcSphere,x=re({key:"md"}),m=te(async()=>n&&i?await $.user.getUserPrivacyConfig({did:n.did}):null,{refreshDeps:[n,i],loadingDelay:300}),h=T(()=>s.map(a=>({key:a.value,name:a.label,value:a.protected,isPrivate:a.isPrivate})),[s]),C=E(async a=>a==="privacy"?(await m.runAsync(),m.data):(a==="profile"&&await l.refresh(),null));y.useEffect(()=>{const a=window.location.hash.slice(1);a&&document.getElementById(a)?.scrollIntoView({behavior:"smooth"})},[]);const v=T(()=>[r?void 0:{label:o("userCenter.commonSetting.title"),value:"common",content:e.jsx(ut,{user:n,onSave:C})},{label:o("userCenter.notificationManagement"),value:"notification",content:e.jsx(pt,{user:n,isMobile:x})},{label:o("userCenter.thirdPartyLogin.title"),value:"thirdPartyLogin",content:e.jsx(ft,{user:n})},{label:o("common.accessKeys"),value:"accessKeys",content:e.jsx(ln,{isSelf:!0})},{label:o("common.mcpServers"),value:"mcpServers",content:e.jsx(Ir,{})},{label:o("userCenter.privacyManagement"),value:"privacy",content:e.jsx(ht,{configList:h,onSave:C})},{label:o("userCenter.sessionManagement"),value:"session",content:e.jsx(mt,{user:n,showUser:!1,getUserSessions:a=>$.userSession.getMyLoginSessions({},a)})},!c&&t&&typeof t=="function"?{label:o("userCenter.dangerZone.title"),value:"dangerZone",content:e.jsx(bt,{onDestroySelf:t}),sx:{borderColor:"error.main"}}:null].filter(Boolean),[n,h,x,c,t]);return i?e.jsx(f,{className:"user-center-settings",sx:{display:"flex",flexDirection:"column",gap:2.5,minWidth:{md:500},"@media (min-width: 1200px) and (max-width: 1260px)":{maxWidth:750},"@media (min-width: 1100px) and (max-width: 1199px)":{maxWidth:650},"@media (min-width: 1000px) and (max-width: 1099px)":{maxWidth:600},"@media (max-width: 1049px)":{maxWidth:"100%"}},children:v.map(a=>a?e.jsxs(f,{id:a.value,sx:de({border:"1px solid",borderColor:"divider",borderRadius:1,p:2,"&:last-child":{mb:5}},a.sx),children:[e.jsx(I,{sx:{color:"text.primary",fontWeight:600},children:a.label}),e.jsx(f,{sx:{mt:2.5},children:a.content})]},a.value):null)}):null}yt.propTypes={onDestroySelf:u.func,userCenterTabs:u.array};const vt=y.createContext({}),{Provider:cn,Consumer:ao}=vt;function wt({children:t}){const[s]=y.useState(!1),{session:o}=y.use(fe),{user:n}=o,[l,i]=y.useState(),c=y.useMemo(()=>n?.didSpace?.endpoint,[n?.didSpace]);y.useEffect(()=>{i(n?.didSpace)},[n?.didSpace]);const p=async()=>{i(void 0)},r=h=>{},x=async h=>{i(h),await r(h.endpoint)},m=!!(c&&l);return e.jsx(cn,{value:{loading:s,spaceGateway:l,session:o,deleteSpaceGateway:p,updateSpaceGateway:x,storageEndpoint:c,settingStorageEndpoint:r,hasStorageEndpoint:m},children:t})}function ze(){return y.use(vt)}wt.propTypes={children:u.node.isRequired};function dn(t){const s=t.replace(/\/api\/space\/.+/,""),n=t.replace(/\/$/,"").split("/").at(-4);return ce(s,"space",n)}function jt({session:t,spaceGateway:s,spaceStatus:o,refresh:n}){return e.jsxs(ke,{direction:"row",spacing:1,children:[o===Mr.DISCONNECTED&&e.jsx(ue,{reconnect:!0,variant:"outlined",session:t,spaceDid:t.user?.didSpace?.did,spaceGatewayUrl:t.user?.didSpace?.url,connectScope:"user",onSuccess:async()=>{await n()},onError:l=>{console.error(l),q.error(X(l))}}),e.jsx(O,{size:"small",LinkComponent:Dt,href:dn(s.endpoint),target:"_blank",children:e.jsx(Ot,{})})]})}jt.propTypes={session:u.object.isRequired,spaceGateway:u.object.isRequired,spaceStatus:u.string.isRequired,refresh:u.func.isRequired};function Ct({spaceGateway:t=void 0}){const{t:s}=N(),{updateSpaceGateway:o,session:n}=ze(),l=re(),i=({spaceGateway:c})=>o(c);return e.jsxs(f,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(f,{sx:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:"12px"},children:[e.jsx(I,{sx:{fontSize:"16px",fontWeight:"bold"},children:s("userCenter.storage.spaces.connected.title")}),!l&&e.jsx(ue,{connectScope:"user",connectText:s("userCenter.storage.spaces.connected.switch"),session:n,onSuccess:i})]}),e.jsx(f,{children:t&&e.jsx(zr,{endpoint:t.endpoint,deps:[t],selected:!0,footer:!0,action:c=>e.jsx(jt,{session:n,...c})},t.endpoint)}),l&&e.jsx(f,{sx:{display:"flex",alignItems:"center",justifyContent:"center",marginTop:2},children:e.jsx(ue,{connectScope:"user",connectText:s("userCenter.storage.spaces.connected.switch"),session:n,onSuccess:i})})]})}Ct.propTypes={spaceGateway:u.object};function un(){const{t}=N(),{updateSpaceGateway:s,session:o}=ze(),n=({spaceGateway:l})=>s(l);return e.jsxs(f,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(I,{sx:{fontSize:"16px",fontWeight:"bold"},children:t("userCenter.storage.spaces.connect.providerForStorage")}),e.jsx(Er,{viewBox:"0 0 228 258",style:{width:"156px",height:"156px",margin:"16px 0"}}),e.jsx(f,{children:e.jsx(ue,{session:o,onSuccess:n})})]})}function pn(){const{spaceGateway:t,hasStorageEndpoint:s,loading:o}=ze(),{isMyself:n}=Ae();return n?o?e.jsx(Ar,{relative:"parent",children:e.jsx(Y,{})}):e.jsx(fn,{children:e.jsx(f,{sx:{maxWidth:"720px"},children:s?e.jsx(Ct,{spaceGateway:t}):e.jsx(un,{})})}):null}function xn(){return e.jsx(wt,{children:e.jsx(pn,{})})}const fn=ee(f)`
|
|
122
|
-
height: 100%;
|
|
123
|
-
overflow-y: auto;
|
|
124
|
-
`;function lo(){const{api:t}=nr(),s=y.useRef(null),n=Ft().tab,i=new URLSearchParams(window.location.search).get("embed")||window.sessionStorage?.getItem("embed"),c=or(),p=T(()=>({...window.blocklet,meta:{did:window.blocklet.did,name:window.blocklet.did},children:window?.blocklet?.componentMountPoints.map(x=>({...x,meta:{...x,did:x.did,name:x.name||x.title||"",logo:"logo.png"}}))})),r=async x=>{const{input:m,sessionId:h}=x;try{await t.destroySelf({input:{...m,sessionId:h}})}catch(C){console.error("destroy myself error",C)}};return e.jsx(vr,{children:e.jsxs(Rr,{ref:s,embed:i==="1",currentTab:n?ce(Pe.WELLKNOWN_SERVICE_PATH_PREFIX,"user",n):"",disableAutoRedirect:n==="settings",children:[n==="notifications"?e.jsx(Qr,{blocklets:[p],context:c}):null,n==="nfts"?e.jsx(nn,{}):null,n==="settings"?e.jsx(yt,{onDestroySelf:r}):null,n==="did-spaces"?e.jsx(xn,{}):null]})})}export{lo as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t,at as r}from"./vendor-mui-core-B7zoO8f5.js";import{r as s}from"./vendor-react-Dvs43sk9.js";import{G as a}from"./vendor-ux-B7q8W4Pg.js";import{t as n}from"./index-CuQBOJqN.js";import"./vendor-utils-DtY42AM-.js";import"./vendor-hooks-BRXKH6Nb.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-B7AoUs4o.js";function l(){const{t:o}=s.useContext(a);return t.jsx(i,{style:{paddingTop:"25vh"},children:t.jsx(n,{status:"404",description:o("noMatch.desc"),style:{backgroundColor:"transparent"}})})}const i=r.main``;export{l as default};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{T as M,H as q,aa as N,N as Y,a9 as ve,ab as Ce,ah as Se}from"./vendor-ux-B7q8W4Pg.js";import{s as Te,k as le,t as Ie}from"./vendor-hooks-BRXKH6Nb.js";import{r as E,a as ae}from"./vendor-react-Dvs43sk9.js";import{j as e,Y as Re,bB as We,$ as ze,ak as p,z as se,T as C,a6 as F,aX as te,R as De,Q as H,b6 as ne,am as P,bd as _,a5 as J,V as Z,S as G,b4 as Oe,U as L,I as B,cm as Ae,bf as Pe,a7 as $e,F as qe,W as t,b1 as R,a3 as ce,c1 as ee,cn as Le,aO as Me,aP as Be,co as Fe,cp as He,cq as Ne,s as oe,aU as Ue,aj as _e,J as Ke,cr as Ve,aZ as Ye,cl as Je,c9 as Qe,ck as Xe}from"./vendor-mui-core-B7zoO8f5.js";import{B as de,a as pe,l as ue}from"./index-DzqNo2lD.js";import{Z as K,c as xe,ao as Ze,a8 as Ge,b8 as Q}from"./index-CuQBOJqN.js";import{u as V}from"./team-Dl23XmaY.js";import{u as et}from"./use-mobile-C_DcJ5SZ.js";import{u as tt,C as X}from"./index.esm-JPZAjt0x.js";import{C as he,a as me,J as ot}from"./vendor-utils-DtY42AM-.js";import{C as st}from"./confirm-C9tgdTJT.js";import{A as nt}from"./actions-Bf4UKTeu.js";import{T as ie}from"./table-tips-BP283GGZ.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-B7AoUs4o.js";import"./session-Bk6ebojT.js";import"./isURL-Cuto2_sB.js";import"./use-app-logo-7cjs_pn8.js";import"./index-DBs9Ljax.js";const it=i=>{const[u,c]=E.useState(null),[b,r]=E.useState(!0),[w,x]=E.useState(null),j=window.blocklet?.appUrl,l=E.useMemo(()=>{const g={};return u&&(u.sources.forEach(y=>{g[y.did]={source:y,events:[],count:0}}),u.events.forEach(y=>{g[y.source]&&(g[y.source].events.push(y),g[y.source].count+=1)})),g},[u]),f=async()=>{try{if(r(!0),!j)return;const y=await(await fetch(he(j,xe.WELLKNOWN_SERVICE_PATH_PREFIX,"/openevent.json"))).json();c(y),x(null)}catch(g){x(g instanceof Error?g:new Error(String(g)))}finally{r(!1)}};return E.useEffect(()=>{f()},[j]),{openEvent:u,setOpenEvent:c,eventsBySource:l,loading:b,error:w,loadData:f}};function ge({eventsBySource:i,selectedEvents:u,setSelectedEvents:c,error:b=null}){const{t:r}=M(),[w,x]=E.useState({}),j=E.useMemo(()=>{const n={};return Object.entries(i).forEach(([a,{events:m}])=>{const v=m.filter(S=>u[`${S.type}-${S.source}`]).length;n[a]=v}),n},[i,u]),l=E.useMemo(()=>Object.values(j).reduce((n,a)=>n+a,0),[j]),f=E.useMemo(()=>Object.values(i).reduce((n,{events:a})=>n+a.length,0),[i]),g=(n,a)=>{a.stopPropagation(),x({...w,[n]:!w[n]})},y=n=>{const a=`${n.type}-${n.source}`;c(m=>({...m,[a]:!m[a]}))},z=(n,a)=>{const m={};n.forEach(v=>{const S=`${v.type}-${v.source}`;m[S]=!a}),c(v=>({...v,...m}))},T=n=>{const a={};Object.values(i).forEach(({events:m})=>{m.forEach(v=>{const S=`${v.type}-${v.source}`;a[S]=n.target.checked})}),c(a)};return e.jsxs(p,{sx:{width:"100%"},children:[e.jsxs(p,{sx:{display:"flex",alignItems:"center",mb:1,mt:1},children:[e.jsx(ne,{control:e.jsx(J,{onChange:T,checked:l>0&&l===f}),label:e.jsxs(p,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:[r("webhookEndpoint.selectAllEvents"),e.jsx(p,{sx:{display:"flex",alignItems:"center"},children:e.jsx(P,{title:r("webhookEndpoint.selectAllEventsTooltip"),placement:"right",children:e.jsx(_,{fontSize:"small",sx:{ml:.5,cursor:"help"}})})})]}),sx:{m:0}}),l>0&&e.jsx(C,{variant:"body2",color:"primary",sx:{ml:"auto"},children:r("webhookEndpoint.selectedEventsCount",{count:l})})]}),e.jsx(p,{sx:{maxHeight:"50vh",overflow:"auto"},children:e.jsx(Z,{disablePadding:!0,sx:{border:"1px solid",borderColor:"divider",borderRadius:"4px"},children:Object.entries(i).map(([n,{source:a,events:m,count:v}],S)=>{const D=j[n]>0,I=j[n]===m.length&&m.length>0,O=w[n];return e.jsxs(ae.Fragment,{children:[e.jsx(G,{sx:{borderBottom:({palette:o})=>S<Object.keys(i).length-1?`1px solid ${o.divider}`:"none",px:2,py:1.5,"&:hover":{bgcolor:"rgba(0, 0, 0, 0.02)"}},children:e.jsxs(p,{sx:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},onClick:o=>{o.target.closest(".MuiFormControlLabel-root")||g(n,o)},children:[e.jsx(p,{sx:{display:"flex",alignItems:"center"},children:m.length>0&&e.jsx(ne,{control:e.jsx(J,{checked:I,indeterminate:D&&!I,onChange:o=>{o.stopPropagation(),z(m,I)}}),label:e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[a.logo&&e.jsx(Oe,{src:a.logo,sx:{width:24,height:24}}),e.jsx(p,{children:a.title||n}),D&&e.jsx(L,{label:r("webhookEndpoint.selectedCount",{count:j[n]}),size:"small",sx:{mt:"2px",height:"20px",fontSize:"12px",bgcolor:o=>`${o.palette.primary.main}20`,color:"primary.main",fontWeight:500}})]}),sx:{m:0,"& .MuiFormControlLabel-label":{flex:1}}})}),e.jsxs(p,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(C,{variant:"body2",sx:{color:"text.secondary",mr:1},children:r("webhookEndpoint.eventsCount",{count:v})}),m.length>0&&e.jsx(B,{size:"small",edge:"end",children:O?e.jsx(Ae,{}):e.jsx(Pe,{})})]})]})}),m.length>0&&e.jsx($e,{in:O,timeout:"auto",unmountOnExit:!0,children:e.jsx(Z,{disablePadding:!0,sx:{pl:2,pr:2,py:1,bgcolor:"rgba(0, 0, 0, 0.01)"},children:m.map(o=>{const d=`${o.type}-${o.source}`,s=!!u[d];return e.jsx(G,{dense:!0,sx:{py:.75},onClick:()=>y(o),children:e.jsxs(p,{sx:{display:"flex",alignItems:"flex-start",width:"100%"},children:[e.jsx(J,{checked:s,sx:{mr:1}}),e.jsxs(p,{children:[e.jsx(C,{variant:"body1",sx:{cursor:"pointer",color:"text.primary"},children:o.type}),e.jsx(C,{variant:"caption",sx:{color:"text.secondary",display:"block",cursor:"pointer"},children:o.description})]})]})},d)})})})]},n)})})}),b&&e.jsx(qe,{error:!0,sx:{mt:1},children:b})]})}ge.propTypes={eventsBySource:t.objectOf(t.shape({source:t.shape({did:t.string.isRequired,title:t.string,description:t.string,version:t.string,logo:t.string}).isRequired,events:t.arrayOf(t.shape({type:t.string.isRequired,description:t.string.isRequired,source:t.string.isRequired})).isRequired,count:t.number.isRequired})).isRequired,selectedEvents:t.objectOf(t.bool).isRequired,setSelectedEvents:t.func.isRequired,error:t.string};function fe({id:i=null,url:u="",description:c="",enabledEvents:b=[],onSubmit:r,onClose:w=()=>{}}){const{t:x}=M(),[j,l]=E.useState({}),{teamDid:f}=V(),{api:g}=K(),{loading:y,error:z,eventsBySource:T}=it(),{control:n,handleSubmit:a,formState:{errors:m},reset:v,setValue:S,trigger:D}=tt({defaultValues:{url:"",description:""}});E.useEffect(()=>{const o=Object.values(j).some(d=>d);S("selectedEvents",o?"valid":""),D("selectedEvents")},[j,S,D]);const I=()=>{l({}),v(),w()},O=async o=>{const d=Object.keys(j).filter(h=>j[h]),s={url:o.url,description:o.description,enabledEvents:d.map(h=>{const[k,W]=h.split("-");return!k||!W?null:{type:k,source:W}}).filter(Boolean)};try{if(i){const h=await g.updateWebhookEndpoint({input:{teamDid:f,id:i,data:s}});q.success(`${x("webhookEndpoint.updateWebhook")} ${x("webhookEndpoint.success")}`),r(h)}else{const h=await g.createWebhookEndpoint({input:{teamDid:f,input:s}});q.success(`${x("webhookEndpoint.createWebhook")} ${x("webhookEndpoint.success")}`),r(h)}}catch(h){q.error(h?.message)}I()};return E.useEffect(()=>{v({url:u,description:c}),l(b.reduce((o,d)=>(o[`${d.type}-${d.source}`]=!0,o),{}))},[v,l,u,c,b]),e.jsx(Re,{open:!0,onClose:I,maxWidth:"lg",fullWidth:!0,sx:{"& .MuiDialog-paper":{minHeight:600}},children:e.jsxs("form",{onSubmit:a(O),children:[e.jsx(We,{children:x(i?"webhookEndpoint.editWebhookTitle":"webhookEndpoint.createWebhookTitle")}),e.jsx(ze,{children:e.jsxs(p,{sx:{display:"flex",flexDirection:"column",gap:2,mt:2},children:[e.jsx(X,{name:"url",control:n,rules:{required:x("webhookEndpoint.validation.urlRequired"),pattern:{value:/^(http|https):\/\/[^ "]+$/,message:x("webhookEndpoint.validation.urlInvalid")}},render:({field:o})=>e.jsx(se,{...o,label:x("webhookEndpoint.url.label"),fullWidth:!0,error:!!m.url,helperText:m.url?.message})}),e.jsx(X,{name:"description",control:n,rules:{required:x("webhookEndpoint.validation.descriptionRequired")},render:({field:o})=>e.jsx(se,{...o,label:x("webhookEndpoint.description.label"),fullWidth:!0,multiline:!0,minRows:2,maxRows:4,error:!!m.description,helperText:m.description?.message})}),e.jsx(X,{name:"selectedEvents",control:n,rules:{required:x("webhookEndpoint.validation.eventRequired")},render:({field:o})=>e.jsx("input",{type:"hidden",...o})}),!y&&T&&Object.keys(T).length>0&&e.jsx(ge,{eventsBySource:T,selectedEvents:j,setSelectedEvents:l,error:m.selectedEvents?.message}),!y&&(!T||Object.keys(T).length===0)&&e.jsx(C,{sx:{color:"text.secondary"},children:x("webhookEndpoint.noAvailableEvents")}),y&&e.jsx(p,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px",width:"100%"},children:e.jsx(F,{size:20})}),z&&e.jsx(te,{severity:"error",children:x("webhookEndpoint.loadingError",{message:z?.message})})]})}),e.jsxs(De,{sx:{p:"8px 24px 24px"},children:[e.jsx(H,{onClick:I,children:x("common.cancel")}),e.jsx(H,{type:"submit",variant:"contained",color:"primary",children:x(i?"webhookEndpoint.updateWebhook":"webhookEndpoint.saveWebhook")})]})]})})}fe.propTypes={onSubmit:t.func.isRequired,id:t.string,url:t.string,description:t.string,enabledEvents:t.arrayOf(t.shape({type:t.string.isRequired,source:t.string.isRequired})),onClose:t.func};function be(i){switch(i){case"enabled":return"success";case"disabled":default:return"default"}}const rt=(i="en")=>i==="tw"?"zh":i;function U(i,u="YYYY-MM-DD HH:mm:ss",c="en"){return i?Ze(i).locale(rt(c)).format(u):"-"}function lt(i){return typeof i=="number"?!1:me(i)}function at(i){return i>=200&&i<300}function A({value:i,label:u,tip:c="",divider:b=!1}){const r=lt(i);return e.jsxs(e.Fragment,{children:[e.jsxs(R,{direction:"column",alignItems:"flex-start",children:[e.jsxs(C,{component:"div",variant:"body1",mb:1,color:"text.primary",sx:{fontWeight:500},children:[u,!!c&&e.jsx(P,{title:c,children:e.jsx(_,{fontSize:"small"})})]}),e.jsx(C,{component:"div",variant:"body1",color:r?"text.disabled":"text.secondary",sx:{width:"100%",minHeight:"24px"},children:r?"-":i})]}),b&&e.jsx(ce,{orientation:"vertical",flexItem:!0})]})}A.propTypes={label:t.oneOfType([t.string,t.node]).isRequired,value:t.oneOfType([t.string,t.node]).isRequired,tip:t.oneOfType([t.string,t.node]),divider:t.bool};function je({title:i,children:u=null,mb:c=1.5,mt:b=1.5}){return e.jsxs(R,{className:"section-header",direction:"row",sx:{justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:1,mb:c,mt:b,pb:1},children:[e.jsx(C,{variant:"h3",sx:{fontSize:{xs:"18px",md:"1.09375rem"}},component:"div",children:i}),u]})}je.propTypes={title:t.oneOfType([t.string,t.node]).isRequired,children:t.node,mb:t.number,mt:t.number};const ct={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 11A8.1 8.1 0 0 0 4.5 9M4 5v4h4m-4 4a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"/>'},dt=i=>{const u={};return i.forEach(c=>{const b=new Date(c.createdAt).toLocaleDateString();u[b]||(u[b]=[]),u[b]?.push(c)}),u};function ye({eventId:i="",webhookEndpointId:u="",event:c=null}){const{api:b,ws:{useSubscription:r}}=K(),{t:w}=M(),{teamDid:x}=V(),{blocklet:j}=Ge(),{data:l,loadMore:f,loadingMore:g,loading:y,mutate:z}=Te(s=>{const k=s?Math.ceil(s.list.length/15)+1:1;return b.getWebhookAttempts({input:{teamDid:x,input:{eventId:i,webhookId:u},paging:{page:k,pageSize:15}}})},{reloadDeps:[i,u]}),T=l?.list||[],[n,a]=E.useState(null),[m,v]=E.useState(!1),S=dt(T);if(E.useEffect(()=>{!n&&l?.list.length&&a(l.list[0])},[l?.list.length,n]),r(xe.EVENTS.WEBHOOK_ATTEMPT,s=>{z(h=>{if(h.list.find(W=>W.id===s.id)){const W=h.list.map($=>$.id===s.id?{...$,...s}:$);return{...h,list:W}}return s.endpoint=h.list[0]?.endpoint,s.event=h.list[0]?.event,{...h,list:[s,...h.list]}})},[]),y)return e.jsx(F,{});const D=l&&l.list.length<l.paging.total,I=async()=>{n&&(v(!0),await b.retryWebhookAttempt({input:{teamDid:x,eventId:n.event.id,webhookId:u,attemptId:n.id}}).finally(()=>{setTimeout(()=>{v(!1)},1e3)}))},O=s=>{if(s.responseBody&&s.responseBody?.sessionId&&s.responseBody?.projectId&&s.responseBody?.agentId){const h=j?.site?.domainAliases[0]?.value,k=(j.children||[]).find($=>$?.meta?.name==="ai-studio"),W=ot(he(`https://${h}`,k?.mountPoint||"","projects",s.responseBody.projectId,"logs/main"),{sessionId:s.responseBody.sessionId,agentId:s.responseBody.agentId});return e.jsx(B,{sx:{fontSize:20},onClick:()=>window.open(W,"_blank"),children:e.jsx(p,{component:N,icon:Q})})}return null},o=s=>s.status==="pending"?e.jsx(Fe,{color:"warning"}):at(s.responseStatus)?e.jsx(He,{color:"success"}):e.jsx(Ne,{color:"error"}),d=n?.triggeredFrom&&(l?.list||[]).find(s=>s.id===n.triggeredFrom);return e.jsxs(pt,{container:!0,spacing:{xs:0,md:1},sx:{height:1},children:[e.jsx(ee,{size:{xs:12,md:4},sx:{height:1},children:me(Object.keys(S))?e.jsx(C,{sx:{color:"text.secondary"},children:w("webhookEndpoint.waitingForEvents")}):e.jsxs(e.Fragment,{children:[e.jsx(Z,{sx:{maxHeight:"calc(100% - 40px)",py:0,overflowY:"auto"},children:Object.entries(S).map(([s,h])=>e.jsxs(ae.Fragment,{children:[e.jsx(Le,{sx:{p:0},children:s}),h.map(k=>e.jsxs(G,{sx:{cursor:"pointer",px:1},onClick:()=>a(k),selected:n&&n?.id===k?.id,secondaryAction:e.jsx(C,{sx:{color:"text.secondary"},children:U(k.createdAt,"HH:mm:ss")}),children:[e.jsx(Me,{sx:{minWidth:0,mr:1.5},children:o(k)}),e.jsx(Be,{primary:e.jsx(C,{sx:{color:"text.primary"},children:k.event.type})})]},k.id))]},s))}),D&&e.jsx(p,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:1},children:e.jsx(H,{variant:"text",type:"button",color:"inherit",onClick:f,disabled:g,sx:{color:s=>s.palette.text.disabled},children:w(g?"webhookEndpoint.loadingMore":"webhookEndpoint.loadMore")})})]})}),e.jsxs(ee,{size:{xs:12,md:8},sx:{height:1},children:[n&&e.jsxs(R,{direction:"column",spacing:2,sx:{height:1,overflow:"auto",pl:{xs:0,md:1},mt:{xs:2,md:0},borderLeft:{xs:"none"}},children:[e.jsxs(p,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(C,{variant:"h4",children:w(`common.${n.status}`)}),e.jsx(p,{children:O(n)})]}),e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[d&&e.jsx(P,{placement:"left",title:e.jsxs(R,{onClick:()=>a(d),sx:{gap:1,cursor:"pointer",".did-address-text":{color:"common.white"}},children:[e.jsx(de,{showDid:!0,did:n.triggeredBy,cardType:ue.Detailed,infoType:pe.Minimal,sx:{border:0,padding:0,minWidth:0,".MuiTypography-root":{color:"common.white",fontWeight:400}}}),e.jsx(ce,{}),e.jsxs(p,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(C,{variant:"body2",sx:{color:"primary.main"},children:w("webhookEndpoint.triggeredFrom")}),e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(C,{variant:"body2",children:n.id}),e.jsx(B,{onClick:()=>a(d),children:e.jsx(p,{component:N,icon:Q,sx:{fontSize:16,color:"common.white"}})})]})]})]}),slotProps:{tooltip:{sx:{maxWidth:400}}},children:e.jsx(B,{onClick:()=>a(d),children:e.jsx(p,{component:N,icon:Q,sx:{fontSize:16}})})}),e.jsxs(H,{variant:"outlined",color:"primary",size:"small",onClick:I,disabled:m,children:[e.jsx(p,{component:N,icon:ct,sx:{fontSize:16,animation:m?"spin 1s linear infinite":"none",mr:.5}}),w("notification.resend")]})]})]}),e.jsxs(p,{children:[e.jsxs(C,{variant:"h6",children:[w("webhookEndpoint.response")," (",n.responseStatus,")"]}),e.jsx(Y,{language:"json",children:JSON.stringify(n.responseBody,null,2)})]}),e.jsxs(p,{children:[e.jsx(R,{direction:"row",spacing:1,sx:{alignItems:"center"},children:e.jsx(C,{variant:"h6",children:w("webhookEndpoint.request")})}),e.jsx(Y,{language:"json",sx:{margin:0},children:JSON.stringify(n.event,null,2)})]})]}),l?.list.length===0&&c&&e.jsxs(p,{children:[e.jsx(R,{direction:"row",spacing:1,sx:{alignItems:"center"},children:e.jsx(C,{variant:"h6",children:w("webhookEndpoint.eventData")})}),e.jsx(Y,{language:"json",sx:{margin:0},children:JSON.stringify(c.data,null,2)})]})]})]})}ye.propTypes={eventId:t.string,webhookEndpointId:t.string,event:t.shape({type:t.string,data:t.object,request:t.object,requestInfo:t.object})};const pt=oe(ee)`
|
|
2
|
-
@keyframes spin {
|
|
3
|
-
to {
|
|
4
|
-
transform: rotate(360deg);
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
`;function we({id:i,onClose:u}){const{t:c}=M(),{api:b}=K(),{teamDid:r}=V(),{loading:w,error:x,data:j}=le(()=>b.getWebhookEndpoint({input:{teamDid:r,id:i}})),l=j?.data;return x?e.jsx(te,{severity:"error",children:x.message}):w||!l?e.jsx(p,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:1,width:1},children:e.jsx(F,{})}):e.jsxs(ut,{direction:"column",sx:{height:{xs:"auto",md:1}},children:[e.jsxs(p,{children:[e.jsxs(R,{direction:"row",sx:{justifyContent:"space-between",alignItems:"center"},children:[e.jsx(R,{sx:{flex:1,width:0},children:e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(C,{variant:"h5",sx:{fontWeight:600,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:l.description}),e.jsx(P,{title:l.url,children:e.jsx(_,{sx:{fontSize:"16px",marginTop:"2px"}})})]})}),e.jsx(R,{direction:"row",sx:{alignItems:"center"},children:e.jsx(B,{edge:"end",color:"inherit",onClick:u,children:e.jsx(_e,{})})})]}),e.jsx(p,{sx:{mt:2},children:e.jsxs(R,{className:"section-body",direction:{xs:"column",md:"row"},spacing:{xs:1,md:3},sx:{justifyContent:"flex-start",flexWrap:"wrap",pt:2,mt:2,borderTop:"1px solid #eee"},children:[e.jsx(A,{label:c("common.status"),value:e.jsx(L,{size:"small",variant:"filled",label:l.status,color:be(l.status),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}}),divider:!0}),e.jsx(A,{label:c("webhookEndpoint.listen"),value:e.jsx(P,{arrow:!0,title:e.jsx("ul",{style:{padding:0,margin:0},children:l.enabledEvents.map(f=>e.jsx("li",{style:{fontSize:"0.7875rem"},children:f?.type},f))}),children:e.jsx(L,{size:"small",variant:"filled",label:c("webhookEndpoint.eventsCount",{count:l.enabledEvents.length}),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx(A,{label:c("webhookEndpoint.version"),value:l.apiVersion,divider:!0}),e.jsx(A,{label:c("common.createdAt"),value:U(l.createdAt),divider:!0}),e.jsx(A,{label:c("common.updatedAt"),value:U(l.updatedAt),divider:!0}),e.jsx(A,{label:c("common.createdBy"),value:e.jsx(P,{arrow:!0,title:l.createUser?.did,children:e.jsx(L,{size:"small",variant:"filled",label:l.createUser?.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx(A,{label:c("common.updatedBy"),value:e.jsx(P,{arrow:!0,title:l.updateUser?.did,children:e.jsx(L,{size:"small",variant:"filled",label:l.updateUser?.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})})})]})})]}),e.jsxs(R,{className:"section",sx:{flex:1,height:0,overflow:"hidden"},children:[e.jsx(je,{title:c("webhookEndpoint.attempts"),mb:0,mt:4}),e.jsx(R,{sx:{height:0,flex:1,overflow:"hidden"},children:e.jsx(ye,{webhookEndpointId:l.id})})]})]})}we.propTypes={id:t.string.isRequired,onClose:t.func.isRequired};const ut=oe(R)``;function ke({open:i,onClose:u,id:c}){return e.jsx(Ue,{anchor:"right",open:i,onClose:u,slotProps:{paper:{sx:{width:"90vw",maxWidth:"1200px"}}},children:e.jsx(p,{sx:{height:"100vh",p:3},children:e.jsx(we,{id:c,onClose:u})})})}ke.propTypes={open:t.bool.isRequired,onClose:t.func.isRequired,id:t.string.isRequired};function re(){return null}function Ee({options:i={},columns:u=[],toolbar:c=!0,footer:b=!0,hasRowLink:r=!1,emptyNodeText:w="",durable:x="",durableKeys:j=[],data:l=[],loading:f=!1,...g}){const{locale:y}=M(),z=Ke(a=>a.breakpoints.down("md")),T={print:!1,download:!1,filter:!1,selectableRows:"none",rowsPerPage:z?5:10,rowsPerPageOptions:[5,10,20,50,100],searchDebounceTime:300,tableBodyHeight:"100%",loading:!0},n={};return c||(n.TableToolbar=re),b||(n.TableFooter=re),e.jsx(xt,{locale:y,options:{...T,...i},columns:(u||[]).map(a=>(a.options=a.options||{},a.options.filter=a.options.filter||!1,a.options.sort=a.options.sort||!1,a)),emptyNode:e.jsx(ve,{children:w}),...g,durable:x,durableKeys:j,data:l,loading:f,components:n,hasRowLink:r,isMobile:z})}Ee.propTypes={options:t.object,columns:t.array,toolbar:t.bool,footer:t.bool,hasRowLink:t.bool,emptyNodeText:t.node,durable:t.string,durableKeys:t.array,data:t.array,loading:t.bool,onChange:t.func,title:t.node,components:t.object};const xt=oe(Ce)``,ht=E.memo(Ee);function At(){const{teamDid:i}=V(),u=et(),c=`webhook-endpoints-${i}`,b=Se(c),{t:r,locale:w}=M(),{api:x}=K(),[j,l]=E.useState(""),[f,g]=E.useState({webhookDetail:{open:!1,id:null},createEdit:{open:!1,id:null,url:"",description:"",enabledEvents:[]},deleteConfirm:null}),[y,z]=Ie(c,{defaultValue:{pageSize:b.rowsPerPage||20,page:b.page?b.page+1:1}}),{loading:T,error:n,data:a,refresh:m}=le(()=>x.getWebhookEndpoints({input:{teamDid:i,paging:{page:y.page,pageSize:y.pageSize}}}));E.useEffect(()=>{m()},[y,m]);const v=E.useCallback(async(o,d)=>{try{await x.updateWebhookEndpoint({input:{teamDid:i,id:o.id,data:{status:d?"disabled":"enabled"}}}),m(),q.success(`${r(d?"webhookEndpoint.disable":"webhookEndpoint.enable")}${r("webhookEndpoint.success")}`)}catch(s){q.error(s?.message)}},[x,i,m,r]),S=E.useCallback(async o=>{try{await x.deleteWebhookEndpoint({input:{teamDid:i,id:o}}),m(),g(d=>({...d,deleteConfirm:null})),q.success(`${r("common.delete")}${r("webhookEndpoint.success")}`)}catch(d){q.error(d?.message)}},[x,i,m,r]),D=(o,d)=>{let s=o.page+1;const h=o.searchText||"";if(h!==j){l(h);return}if(d==="changePage"||d==="changeRowsPerPage"){d!=="changePage"&&(s=1);const k={page:s,pageSize:o.rowsPerPage};l(""),z(k)}};if(n)return e.jsx(te,{severity:"error",children:n.message});if(T||!a)return e.jsx(p,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:1,height:500},children:e.jsx(F,{})});const I=(a?.list||[]).filter(o=>{if(!j)return!0;const d=j.toLowerCase();return o.description.toLowerCase().includes(d)||o.url.toLowerCase().includes(d)}),O=[{label:"URL",name:"url",options:{customBodyRenderLite:(o,d)=>{const s=I[d];return e.jsxs(p,{sx:{display:"flex",alignItems:"center",cursor:"pointer",gap:.5},children:[e.jsx(C,{variant:"body2",children:s.description}),e.jsx(p,{sx:{display:"flex"},onClick:h=>{h.stopPropagation()},children:e.jsx(P,{title:s.url,children:e.jsx(_,{sx:{fontSize:"15px",marginTop:"1px"}})})})]})}}},{label:"Events",name:"events",options:{customBodyRenderLite:(o,d)=>{const s=I[d];return e.jsx(p,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:s.enabledEvents.map(h=>e.jsx(L,{size:"small",variant:"filled",label:h.type,sx:{borderRadius:"4px",textTransform:"capitalize"}},`${s.source}-${h.type}`))})}}},{label:r("common.status"),name:"status",options:{customBodyRenderLite:(o,d)=>{const s=I[d];return e.jsx(L,{size:"small",variant:"filled",label:r(`webhookEndpoint.${s?.status}`),color:be(s?.status),sx:{borderRadius:"4px",textTransform:"capitalize"}},`status-${s.status}`)}}},{label:r("common.createdAt"),name:"createdAt",minWidth:200,options:{customBodyRender:o=>U(o)}},{label:r("common.createdBy"),name:"createUser",width:100,options:{customBodyRender:o=>o?e.jsx(de,{showDid:!0,did:o?.did,cardType:ue.Detailed,infoType:pe.Minimal,sx:{border:0,padding:0}}):"-"}},{label:r("common.actions"),name:"actions",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRenderLite:(o,d)=>{const s=I[d],h=s?.status==="enabled";return e.jsx(nt,{actions:[{icon:h?e.jsx(Ve,{}):e.jsx(Ye,{}),text:r(h?"webhookEndpoint.disable":"webhookEndpoint.enable"),onClick:k=>{k.stopPropagation(),v(s,h)}},{icon:e.jsx(Je,{}),text:r("common.edit"),onClick:k=>{k.stopPropagation(),g(W=>({...W,createEdit:{open:!0,id:s.id,url:s.url,description:s.description,enabledEvents:s.enabledEvents}}))}},{icon:e.jsx(Qe,{}),text:r("common.delete"),onClick:k=>{k.stopPropagation(),g(W=>({...W,deleteConfirm:{title:r("webhookEndpoint.deleteWebhook.title"),description:r("webhookEndpoint.deleteWebhook.description"),confirm:r("common.confirm"),cancel:r("common.cancel"),onConfirm:()=>S(s.id),onCancel:()=>g($=>({...$,deleteConfirm:null}))}}))}}]})}}}];return e.jsxs(p,{sx:{".custom-toobar-btns":{gap:"8px"},".custom-toobar-title .custom-toobar-title-inner>span":{display:"flex",alignItems:"center","white-space":"inherit",height:"100%"}},children:[u?e.jsx(ie,{title:r("webhookEndpoint.listTitle"),tooltipTitle:r("webhookEndpoint.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${w}/webhook`}):null,e.jsx(ht,{durable:c,durableKeys:["page","rowsPerPage"],data:I,columns:O,options:{count:a.count,page:y.page-1,rowsPerPage:y.pageSize,viewColumns:!1,onRowClick:(o,{dataIndex:d})=>{const s=a.list[d];g(h=>({...h,webhookDetail:{open:!0,id:s.id}}))}},loading:T,onChange:D,emptyNodeText:e.jsx(R,{sx:{gap:1},children:r("webhookEndpoint.noWebhooksAdded")}),title:u?null:e.jsx(ie,{title:r("webhookEndpoint.listTitle"),tooltipTitle:r("webhookEndpoint.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${w}/webhook`}),customButtons:[e.jsxs(H,{sx:{color:"common.white"},edge:"end",variant:"contained",color:"primary",onClick:()=>g(o=>({...o,createEdit:{...o.createEdit,open:!0}})),className:"rule-action",children:[T?e.jsx(F,{size:16}):e.jsx(Xe,{style:{fontSize:16}}),r("common.create")]},"add")]}),f.webhookDetail.open&&e.jsx(ke,{open:!0,onClose:()=>g(o=>({...o,webhookDetail:{open:!1,id:null}})),id:f.webhookDetail.id}),f.createEdit.open&&e.jsx(fe,{onSubmit:m,...f.createEdit,onClose:()=>g(o=>({...o,createEdit:{id:null,url:"",description:"",enabledEvents:[],open:!1}}))}),f.deleteConfirm&&e.jsx(st,{title:f.deleteConfirm.title,description:f.deleteConfirm.description,confirm:f.deleteConfirm.confirm,cancel:f.deleteConfirm.cancel,params:f.deleteConfirm.params,onConfirm:f.deleteConfirm.onConfirm,onCancel:f.deleteConfirm.onCancel})]})}export{At as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./vendor-mui-core-B7zoO8f5.js";import"./vendor-react-Dvs43sk9.js";import{S as t}from"./studio-Cx6j_6QU.js";import"./vendor-ux-B7q8W4Pg.js";import"./vendor-utils-DtY42AM-.js";import"./vendor-hooks-BRXKH6Nb.js";import"./lottie-web-4koyQiv_.js";import"./index-DzSOofQf.js";import"./index-CuQBOJqN.js";import"./vendor-arcblock-B7AoUs4o.js";function f(){return o.jsx(t,{children:"Coming soon..."})}export{f as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{z as e,A as s}from"./vendor-ux-B7q8W4Pg.js";const c=e("blocklet-services");s("blocklet-services");export{c as d};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,ak as p,T as I,W as c,am as Q,Q as F,bG as de,a6 as pe}from"./vendor-mui-core-B7zoO8f5.js";import{f as fe,a as ue,b as ge,h as me}from"./vendor-hooks-BRXKH6Nb.js";import{r as J,i as he}from"./vendor-react-Dvs43sk9.js";import{a as we,a4 as xe,T as ye,c as L,ap as Pe,H as O,s as ke,b as ve,aq as $,ar as je,as as be}from"./index-CuQBOJqN.js";import{C as W,b as _,J as Ie,c as Te}from"./vendor-utils-DtY42AM-.js";import{o as Ce}from"./vendor-arcblock-B7AoUs4o.js";import{$ as Le,J as _e,T as X,Z as B,I as Re,a0 as We,a1 as Ae,H as M,B as Ee,a2 as z}from"./vendor-ux-B7q8W4Pg.js";import{u as Ne}from"./use-passport-id-B-b-_oYF.js";import{g as V}from"./get-safe-url-Bpq2IOGY.js";import{d as R}from"./logger-yrkSQn8c.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 Z({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]})}Z.propTypes={children:c.node,cta:c.node};function Y({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(Z,{...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(F,{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(F,{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")})]})]})})]})}Y.propTypes={passports:c.arrayOf(c.shape({name:c.string.isRequired,title:c.string,payable:c.string})),onConnect:c.func,onClose:c.func,redirect:c.string.isRequired};function Ve(){const a=J.useRef(null),{session:s}=we(),{t:i,locale:y}=X(),{getPassportId:f}=Ne(),P=he(),k=B(),l=Re(),{encryptKey:g,decrypt:ee}=xe(),v=fe(s),{searchParams:o}=new URL(window.location.href),m={passportId:f()},A=o.get("componentId"),E=o.get("authenticated"),ne=o.get("sessionToken"),te=o.get("refreshToken"),oe=o.get("requiredRoles"),u=o.get("redirect"),d=o.get("forceConnected"),j=o.get("sourceAppPid"),T=o.get("origin"),N=o.get("autoConnectWebview"),S=o.get("popup"),U=o.get("showQuickConnect");let h=o.get("inviter");if(!h&&u)try{h=(u.startsWith("http")?new URL(u):new URL(u,window.location.origin)).searchParams.get("inviter")}catch{}h=h||localStorage.getItem("inviter"),A&&(m.componentId=A),k&&(m.visitorId=k),h&&(m.inviter=h),Te(j)||(j==="null"?m.sourceAppPid=null:j!==null&&(m.sourceAppPid=j));let D=[];try{D=JSON.parse(oe)}catch{}const ie=async n=>{const t=o.get("fromWallet");R("login page notifyWallet",{data:n,fromWallet:t,"browser.wallet":l.wallet}),n&&String(t)==="1"&&l.wallet&&await Promise.any([z.asyncCall("arcSetToken",n),$(3e3)])},C=n=>o.get("encrypted")?ee(n):n,q=async n=>{n&&await ie(n),setTimeout(()=>{if(u){const t=decodeURIComponent(u);t.startsWith(L.WELLKNOWN_SERVICE_PATH_PREFIX)?P(t,{replace:!0}):window.location.replace(V(t))}else window.location.replace(window.env.pathPrefix||"/")},50)},se=n=>{const t={did:n.user.did,host:window.location.host,appPid:window.blocklet.appPid,visitorId:B(),sourceAppPid:n.user.sourceAppPid,fullName:n.user.fullName};R("bridge callArc: onLogin",t),z.callArc("onLogin",t)},H=async(n,t)=>{const w=t(n.sessionToken),b=t(n.refreshToken),x=t(n.visitorId);R("login page onLogin",{result:n,decodeSessionToken:w,decodeRefreshToken:b,decodeVisitorId:x}),ke(w),ve(b),n.visitorId&&Ee(x),await s.refresh(),await $(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=V(Ie(x,r),{allowDomains:null});window.location.href=le});me(()=>{if(o.get("sessionToken")){const n=o.get("visitorId");if(!n){M.error("Unexpected login response from server: visitorId is required");return}H({sessionToken:C(ne),refreshToken:C(te),visitorId:C(n)},t=>t)}else!s.user||d&&s.user.did!==d?K():!E&&!o.get("sessionToken")&&q()});const ce=n=>{M.error(n.message)},ae=o.has("popup");if(s.loading||s.user){if(!E||o.get("sessionToken"))return e.jsxs(e.Fragment,{children:[e.jsx(O,{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(Y,{onConnect:K,passports:D,redirect:n})}return e.jsxs(e.Fragment,{children:[e.jsx(O,{children:e.jsx("title",{children:i("pageTitle.login")})}),e.jsx(p,{sx:{"box-sizing":"border-box",width:"100%",height:"100vh",position:"relative",display:"flex","flex-direction":"column",".connect":{background:"#fafafa"}},ref:a})]})}export{Ve as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./vendor-mui-core-B7zoO8f5.js";import{C as t}from"./vendor-utils-DtY42AM-.js";import{I as s}from"./iframe-CbjzikLk.js";import{c as e}from"./index-CuQBOJqN.js";import{S as m}from"./studio-Cx6j_6QU.js";import"./vendor-react-Dvs43sk9.js";import"./vendor-ux-B7q8W4Pg.js";import"./vendor-hooks-BRXKH6Nb.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-B7AoUs4o.js";import"./index-DzSOofQf.js";function L(){const r=new URLSearchParams;r.set("title","Preference Builder"),r.set("schemaKey",t(window.location.origin,e.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/studio/preferences"));const i=`${t(window.location.origin,e.WELLKNOWN_SERVICE_PATH_PREFIX,"/hosted/form-builder/")}?${r.toString()}`;return o.jsx(m,{children:o.jsx(s,{url:i,width:"100%",height:"100%",frameBorder:0,styles:{border:0}})})}export{L as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./vendor-mui-core-B7zoO8f5.js";import{B as o}from"./user-center-DtJ32yjF.js";import{H as i}from"./index-CuQBOJqN.js";import{T as e}from"./vendor-ux-B7q8W4Pg.js";import"./vendor-react-Dvs43sk9.js";import"./vendor-hooks-BRXKH6Nb.js";import"./vendor-utils-DtY42AM-.js";import"./index-Ca4b_pCt.js";import"./arrow-down.svg-lBR1lfm2.js";import"./user-sessions-CFxn5EHL.js";import"./index-pAv7g5o_.js";import"./index-BtkFo6d6.js";import"./vendor-arcblock-B7AoUs4o.js";import"./index-BtHQU9Nx.js";import"./index-DRYJ0xIl.js";import"./index-BojVbZw0.js";import"./index-C-DpXzH8.js";import"./lottie-web-4koyQiv_.js";function E(){const{t}=e();return r.jsxs(r.Fragment,{children:[r.jsx(i,{children:r.jsx("title",{children:t("pageTitle.userCenter")})}),r.jsx(o,{onlyProfile:!0,currentTab:"",disableAutoRedirect:!0})]})}export{E as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{J as n,j as i,ak as l}from"./vendor-mui-core-B7zoO8f5.js";import{j as d,r as c}from"./vendor-react-Dvs43sk9.js";import{T as u,F as h}from"./vendor-ux-B7q8W4Pg.js";import g from"./index-B5t6TkeL.js";import"./vendor-utils-DtY42AM-.js";import"./vendor-hooks-BRXKH6Nb.js";import"./lottie-web-4koyQiv_.js";import"./index-CuQBOJqN.js";import"./vendor-arcblock-B7AoUs4o.js";import"./confirm-C9tgdTJT.js";import"./index-DBs9Ljax.js";import"./session-Bk6ebojT.js";import"./did-address-CcsL3-Qm.js";import"./empty-spinner-BMVhld2Z.js";import"./bundle-avatar-FLzOZWlh.js";import"./shorten-label-BHlFrl9P.js";import"./list-header-BQx81X9X.js";import"./click-to-copy-CVpUD4ji.js";import"./question-mark-circle.svg-B4stD6SS.js";import"./useSetState-DFuQZPPV.js";import"./engine-hsJUTQxh.js";import"./api-IUmhrtIY.js";import"./vendor-mui-x-Qph0dQcg.js";import"./react-beautiful-dnd.esm-CYy644iX.js";import"./raf-schd.esm-CHNehTG3.js";import"./wait-connect-DPAxcgcf.js";import"./get-safe-url-Bpq2IOGY.js";import"./item-CEYjCEHD.js";import"./delete-confirm-XVeEePxy.js";import"./index-BtkFo6d6.js";import"./index-BFQdM_lT.js";import"./index-BIfpX-Mq.js";const r=new URL(window.location.href),s=r.searchParams.get("mode")==="dialog",w=s?"":r.searchParams.get("padding")||"";function V(){const{t:p}=u(),{componentDid:o}=d(),m=n(t=>t.breakpoints.down("md")),a=t=>{t.stopPropagation(),window.parent.postMessage({event:"resourceDialog.close",componentDid:o},"*")};c.useEffect(()=>{window.parent.postMessage({event:"resourceDialog.loaded",componentDid:o},"*")},[o]);const e=i.jsx(g,{padding:w,initUrl:r});return s?i.jsx(h,{className:"studio-dialog",title:p("blocklet.publish.blockletStudio"),maxWidth:!1,fullWidth:!1,PaperProps:{style:m?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:a,showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:i.jsx(l,{sx:{height:"72vh",overflow:"auto",position:"relative"},children:e})}):e}export{V as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as v}from"./vendor-react-Dvs43sk9.js";import{D as M,n as k,j as n,W as r,ak as y,T as g,c1 as I,at as T,am as R,c2 as O,c3 as q}from"./vendor-mui-core-B7zoO8f5.js";import{B as V,p as Z}from"./dashboard-D1d9MQbs.js";import{T as $,a9 as _,aa as J,ab as K}from"./vendor-ux-B7q8W4Pg.js";import{aC as w,aD as C,Z as Q,a8 as N,f as L,aE as X}from"./index-CuQBOJqN.js";import{V as Y}from"./vendor-utils-DtY42AM-.js";import{x as P}from"./index-DRYJ0xIl.js";import{B as S}from"./base-chart-DZz4r8-E.js";import{B as ee}from"./bundle-avatar-FLzOZWlh.js";import"./vendor-arcblock-B7AoUs4o.js";import"./vendor-hooks-BRXKH6Nb.js";import"./useLocalStorage-DqhgzGNT.js";import"./index-DBs9Ljax.js";import"./confirm-C9tgdTJT.js";import"./get-safe-url-Bpq2IOGY.js";import"./session-Bk6ebojT.js";import"./team-Dl23XmaY.js";import"./isURL-Cuto2_sB.js";import"./use-app-logo-7cjs_pn8.js";import"./useAsyncRetry-D4-sRZN-.js";import"./useAsync-BrMo9m7W.js";import"./useSetState-DFuQZPPV.js";import"./index-DzSOofQf.js";import"./over-due-invoice-payment-DXbfRbJ6.js";import"./use-mobile-DM4d_PLd.js";import"./lottie-web-4koyQiv_.js";import"./index-DT3k66ox.js";function z({title:s="",cpus:f=[],currentLoad:i=0,history:u=[],empty:l=null,onHover:p=()=>{},hoverIndex:a=null}){const{t:d,locale:x}=$(),t=M(),o=`${s||d("common.cpu")} (${Math.floor(i||0)}%)`,e=100,m=80,c=H=>`${H}%`,D=[{max:m,color:k(t.palette.primary.main,t.palette.mode==="dark"?.15:.08)},{min:m,max:100,color:k(t.palette.warning.main,t.palette.mode==="dark"?.18:.12)},{min:100,color:k(t.palette.error.main,t.palette.mode==="dark"?.25:.18)}],b={silent:!0,symbol:["none","none"],data:[{yAxis:100,lineStyle:{color:t.palette.error.main,type:"dashed",width:1.5},label:{formatter:`${c(100)}`,position:"insideEndTop",color:t.palette.text.secondary,padding:[2,4],borderRadius:2}},{yAxis:m,lineStyle:{color:t.palette.warning.light,type:"dashed",width:1.5},label:{formatter:`${c(m)}`,position:"insideEndTop",color:t.palette.text.secondary,padding:[2,4],borderRadius:2}}]},j=n.jsx("span",{children:`${d("system.cores")}: ${f?.length||0}`}),B=H=>w(Number(H),"HH:mm",x);return n.jsx(S,{title:o,total:e,history:u,valueFn:c,xAxisFormat:B,visualMapPieces:D,markLineData:b,extraInfo:j,empty:l,onHover:p,hoverIndex:a})}z.propTypes={title:r.string,cpus:r.array,currentLoad:r.number,history:r.array,empty:r.node,onHover:r.func,hoverIndex:r.number};function E({instanceCount:s=null,title:f="",total:i=null,used:u=null,history:l=[],empty:p=null,onHover:a=()=>{},hoverIndex:d=null}){const{t:x,locale:t}=$(),o=M(),e=!!i,m=i-u,c=e?`(${C(u)}, ${Math.floor(u/i*100)}%)`:"",D=`${f||x("common.memory")} ${c}`,b=Math.ceil(i*.8),j=h=>P(h,{short:!0,iec:!0}),B=[];s&&B.push({title:x("system.instances"),metric:s}),e&&B.push({title:x("system.free"),metric:j(m)});const H=[{max:b,color:k(o.palette.primary.main,o.palette.mode==="dark"?.15:.08)},{min:b,max:i,color:k(o.palette.warning.main,o.palette.mode==="dark"?.18:.12)},{min:i,color:k(o.palette.error.main,o.palette.mode==="dark"?.25:.18)}],F={silent:!0,symbol:["none","none"],data:[{yAxis:i,lineStyle:{color:o.palette.error.main,type:"dashed",width:1.5},label:{formatter:`${j(i)}`,position:"insideEndTop",color:o.palette.text.secondary,padding:[2,4],borderRadius:2}},{yAxis:b,lineStyle:{color:o.palette.warning.light,type:"dashed",width:1.5},label:{formatter:`${j(b)}`,position:"insideEndTop",color:o.palette.text.secondary,padding:[2,4],borderRadius:2}}]},A=n.jsx(n.Fragment,{children:B.map((h,G)=>n.jsxs(y,{sx:{marginLeft:G===0?0:1,display:"inline-flex"},children:[h.title,": ",h.metric]},h.title))}),W=h=>w(Number(h),"HH:mm",t);return n.jsx(S,{title:D,total:i,history:l,valueFn:j,xAxisFormat:W,visualMapPieces:H,markLineData:F,extraInfo:A,empty:p,onHover:a,hoverIndex:d})}E.propTypes={title:r.string,instanceCount:r.number,total:r.number,used:r.number,history:r.array,empty:r.node,onHover:r.func,hoverIndex:r.number};function U({blocklet:s,cpuHistory:f=[],memoryHistory:i=[],...u}){const{t:l}=$(),{info:p}=Q(),{runtimeHistory:a}=N(),[d,x]=v.useState(null),t=v.useCallback(e=>s.status!=="running"?n.jsx(g,{children:l("blocklet.runtimeInfo.noRunning")}):e.length?null:n.jsx(_,{children:l("common.empty")}),[s.status,l]),o=v.useCallback(e=>{x(e)},[]);return a.length===0?n.jsx(g,{children:l("blocklet.runtimeInfo.noRunning")}):n.jsxs(te,{component:"div",...u,memoryHistory:i,cpuHistory:f,children:[n.jsxs(I,{className:"page-metrics",container:!0,spacing:5,children:[n.jsx(I,{sx:{pt:"16px !important"},size:12,children:n.jsx(g,{sx:{fontSize:"16px",fontWeight:"bold"},children:"CPU"})}),a?.map(e=>n.jsx(I,{sx:{pt:"16px !important"},size:{lg:4,md:6,sm:6,xs:12},children:n.jsx(z,{title:`${e.name} CPU`,empty:t(e.cpu),currentLoad:e.appRuntimeInfo?.cpuUsage||0,cpus:e.appRuntimeInfo?.cpus||[],history:e.cpu,onHover:o,hoverIndex:d,style:{height:150}})},`${e.key}-cpu`))]}),n.jsxs(I,{className:"page-metrics",container:!0,spacing:5,sx:{mt:1},children:[n.jsx(I,{sx:{pt:"16px !important"},size:12,children:n.jsx(g,{sx:{fontSize:"16px",fontWeight:"bold"},children:"Memory"})}),a?.map(e=>n.jsx(I,{sx:{pt:"16px !important"},size:{lg:4,md:6,sm:6,xs:12},children:n.jsx(E,{title:`${e.name} Memory`,empty:t(e.memory),total:p.runtimeConfig?.blockletMaxMemoryLimit?P.parseSize(`${p.runtimeConfig.blockletMaxMemoryLimit*(e.key===s?.meta?.did?a.length-1:1)}MiB`):0,used:e.appRuntimeInfo?.memoryUsage||0,history:e.memory,onHover:o,hoverIndex:d,style:{height:150}})},`${e.key}-memory`))]})]})}U.propTypes={blocklet:r.object.isRequired,cpuHistory:r.arrayOf(r.shape({date:r.number,value:r.number})),memoryHistory:r.arrayOf(r.shape({date:r.number,value:r.number}))};const te=T(g)``;function Me(){const{t:s,locale:f}=$(),[i,u]=v.useState(6),{blocklet:l,actions:{refreshBlocklet:p}}=N(),a=v.useMemo(()=>{const t=[];return L.forEachBlockletSync(l,(o,{ancestors:e,id:m,level:c})=>{o?.meta?.did&&o.meta.did!==l.meta.did&&t.push({type:"blocklet",groupId:l.meta.did,groupName:L.getDisplayName(l),id:m,name:L.getDisplayName(o,!0),blocklet:l,component:o,level:c-1>=0?c-1:0,runtimeInfo:o.runtimeInfo,ancestors:e})}),t},[l]);v.useEffect(()=>{p({hours:i});const t=setInterval(()=>{p({hours:i})},1e3*10);return()=>{clearInterval(t)}},[i]);const d=t=>Z(Number(t||0),{locale:X(f)}),x=[{label:s("common.name"),name:"name",options:{customBodyRenderLite(t){const{name:o,component:e,level:m,ancestors:c}=a[t];return n.jsxs(y,{sx:{display:"flex",alignItems:"center",pl:m*2},children:[n.jsx(ee,{size:20,blocklet:e,ancestors:c}),n.jsx(y,{sx:{ml:1},children:o}),n.jsx(V,{variant:"pin",style:{marginLeft:8},status:e.status,source:e.source,progress:e.progress})]})}}},{label:s("common.uptime"),name:"runtimeInfo.uptime",options:{customBodyRenderLite(t){const{runtimeInfo:o,component:e}=a[t];return!e?.status||e.status!=="running"?n.jsx(R,{title:s("common.noData"),children:"--"}):d(o?.uptime)}}},{label:s("blocklet.runtimeInfo.memoryUsage"),name:"runtimeInfo.memoryUsage",options:{customBodyRenderLite(t){const{runtimeInfo:o,component:e}=a[t];return!e?.status||e.status!=="running"?n.jsx(R,{title:s("common.noData"),children:"--"}):C(o?.memoryUsage||0)}}},{label:s("blocklet.runtimeInfo.cpuUsage"),name:"runtimeInfo.cpuUsage",options:{customBodyRenderLite(t){const{runtimeInfo:o,component:e}=a[t];return!e?.status||e.status!=="running"?n.jsx(R,{title:s("common.noData"),children:"--"}):`${(o?.cpuUsage||0).toFixed(1)}%`}}},{label:s("analytics.runtime"),name:"runtimeInfo.runtime",options:{customBodyRenderLite(t){const{runtimeInfo:o}=a[t];return o?.uptime?n.jsxs(y,{sx:{display:"flex",alignItems:"center"},children:[n.jsx(J,{icon:o?.runningDocker?"catppuccin:docker-ignore":"logos:nodejs-icon"}),n.jsx(y,{sx:{ml:1},children:o?.runningDocker?"Docker":"Nodejs"})]}):null}}},{label:s("blocklet.runtimeInfo.processId"),name:"runtimeInfo.pid",options:{customBodyRenderLite(t){const{runtimeInfo:o,component:e}=a[t];return!e?.status||e.status!=="running"?n.jsx(R,{title:s("common.noData"),children:"--"}):o?.pid}}},{label:s("blocklet.runtimeInfo.port"),name:"runtimeInfo.port",options:{customBodyRenderLite(t){const{runtimeInfo:o,component:e}=a[t];return!e?.status||e.status!=="running"?n.jsx(R,{title:s("common.noData"),children:"--"}):o?.port}}}];return n.jsxs(ne,{component:"div",children:[n.jsxs(y,{sx:{display:"flex",justifyContent:"space-between",flexDirection:"row",mb:2},children:[n.jsx(g,{component:"h3",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:2},children:s("analytics.trend")}),n.jsx(O,{size:"small",exclusive:!0,value:i,onChange:(t,o)=>{Y(o)&&u(o)},children:[1,3,6,12,24].map(t=>n.jsxs(q,{value:t,children:[t,"H"]},t))})]}),n.jsx(y,{children:n.jsx(U,{blocklet:l})}),n.jsx(y,{sx:{mt:3},children:n.jsx(K,{title:s("analytics.detail"),className:"monitor-table",locale:f,data:a,columns:x,options:{search:!1,download:!1,filter:!1,print:!1,viewColumns:!1,pagination:!1,rowsPerPage:100}})})]})}const ne=T(g)``;export{Me as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as o}from"./index-CuQBOJqN.js";const e=o();export{e as b};
|