@abtnode/blocklet-services 1.17.6-beta-20251216-081847-bf91c4db → 1.17.6-beta-20251216-223535-283b9ffe
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/emails/_components/compose.js +1 -1
- package/api/libs/connect/session.js +1 -1
- package/api/routes/blocklet.js +2 -0
- package/api/services/auth/session.js +9 -6
- package/dist/assets/{AdapterDayjs-Bfr4sW4C.js → AdapterDayjs-DqOr9LFk.js} +1 -1
- package/dist/assets/{Google-DA3WTnLE.js → Google-CQ1n6aSx.js} +1 -1
- package/dist/assets/{access-control-BZvc7AZG.js → access-control-LXesuJ2_.js} +1 -1
- package/dist/assets/{add-component-core-CNH5E2RR.js → add-component-core-L7bwC_64.js} +1 -1
- package/dist/assets/{add-resource-BWEvlWkH.js → add-resource-DeMXdPX_.js} +1 -1
- package/dist/assets/{addon-uM70Qwac.js → addon-kaBWGHOu.js} +1 -1
- package/dist/assets/{advanced-Caeqx4XB.js → advanced-DOrtiTqV.js} +1 -1
- package/dist/assets/{aigne-B9drp8Pq.js → aigne-BuWtyQrV.js} +1 -1
- package/dist/assets/api-2a4FTO9k.js +1 -0
- package/dist/assets/{appearance-DM7p-6Wl.js → appearance-DUs_om38.js} +1 -1
- package/dist/assets/{audit-logs-L-gO50KL.js → audit-logs-DUV4-vTj.js} +3 -3
- package/dist/assets/{authorize-D2d4GCpP.js → authorize-DC7FpxvU.js} +1 -1
- package/dist/assets/{base-chart-DSDnGziZ.js → base-chart-CRe-9w5H.js} +1 -1
- package/dist/assets/{base32-B-7CnEFd.js → base32-BqL5pnrU.js} +1 -1
- package/dist/assets/bind-account-DpXvkxLj.js +1 -0
- package/dist/assets/{branding-Dx40btDl.js → branding-BWncfl5y.js} +1 -1
- package/dist/assets/{branding-aCdIMhb0.js → branding-Btcz8N1M.js} +3 -3
- package/dist/assets/branding-DMOcia4y.js +1 -0
- package/dist/assets/{bundle-avatar-B1jZNqcH.js → bundle-avatar-BSv_e0lp.js} +1 -1
- package/dist/assets/button-C2uxCAba.js +1 -0
- package/dist/assets/click-to-copy-03_3P1nz.js +1 -0
- package/dist/assets/{cloneDeep-B_fYlLpl.js → cloneDeep-DqDclz1x.js} +1 -1
- package/dist/assets/{complete-Rr-_Zaon.js → complete-AlcncYrN.js} +2 -2
- package/dist/assets/{component-DZretbSC.js → component-Bsd478Wd.js} +2 -2
- package/dist/assets/{config-BkqISfFO.js → config-B8HbrPnF.js} +4 -4
- package/dist/assets/{config-Dw0qq-09.js → config-BBXBmv_e.js} +2 -2
- package/dist/assets/{config-Bjbv_xI5.js → config-CvvSF8W2.js} +1 -1
- package/dist/assets/{config-navigation-Dj8qf6cK.js → config-navigation-BAqSkXxH.js} +8 -8
- package/dist/assets/config-space-DnDf6PO2.js +1 -0
- package/dist/assets/{confirm-Bpit6U3-.js → confirm-Dul9DyCY.js} +1 -1
- package/dist/assets/connect-BRfx3zbS.js +1 -0
- package/dist/assets/{connect-B1ZA3nS8.js → connect-C1kqlbsb.js} +1 -1
- package/dist/assets/{connect-to-BsxW3JJi.js → connect-to-DNZM_E4B.js} +1 -1
- package/dist/assets/{create-passport-svg-DGPNsGUE.js → create-passport-svg-Cs4mVLsE.js} +1 -1
- package/dist/assets/{createClass-B5uCYz0o.js → createClass-BRKh_6kd.js} +1 -1
- package/dist/assets/{dashboard-DBwE7l6f.js → dashboard-DHNx2Vjq.js} +7 -7
- package/dist/assets/{delete-confirm-L0HXJtqt.js → delete-confirm-BT4RGlre.js} +1 -1
- package/dist/assets/did-address-DpdRECuJ.js +1 -0
- package/dist/assets/{domain-BoEowNlU.js → domain-Bc5sJ6GV.js} +1 -1
- package/dist/assets/{domain-action-card-BB0jQwcH.js → domain-action-card-DaWxksqg.js} +2 -2
- package/dist/assets/domains-CGPUezw9.js +1 -0
- package/dist/assets/{email-BAr61Jer.js → email-DsXuaICi.js} +2 -2
- package/dist/assets/engine-BaNtB6sW.js +1 -0
- package/dist/assets/{exchange-passport-BuJUAVgN.js → exchange-passport-DDScDnbP.js} +1 -1
- package/dist/assets/{form-kdwSU-mv.js → form-CmTyQIow.js} +2 -2
- package/dist/assets/{form-text-input-B_h8beXh.js → form-text-input-CsXLsIFW.js} +2 -2
- package/dist/assets/{fuel-C9kfBZ4R.js → fuel-BJDVWtLE.js} +2 -2
- package/dist/assets/{gen-access-key-Bh-o1OFU.js → gen-access-key-Ftv91l1v.js} +1 -1
- package/dist/assets/gen-simple-access-key-CWrV9bpF.js +1 -0
- package/dist/assets/get-safe-url-CqIO9371.js +1 -0
- package/dist/assets/{home-Cb5I193s.js → home-CxNed9GY.js} +1 -1
- package/dist/assets/{iframe-C233G1py.js → iframe-dmFx9kP7.js} +1 -1
- package/dist/assets/{index-MQEkIEm-.js → index-A-uhNQXl.js} +1 -1
- package/dist/assets/{index-BScxMPlP.js → index-B4sVJOOj.js} +1 -1
- package/dist/assets/{index-C-vVEZcs.js → index-B6IM_Z38.js} +3 -3
- package/dist/assets/{index-D-a8pZtp.js → index-BKE6R9dc.js} +1 -1
- package/dist/assets/{index-DuDIkjct.js → index-BNiqMLPn.js} +1 -1
- package/dist/assets/{index-DjpxFmgG.js → index-BWxvQ-Ka.js} +7 -7
- package/dist/assets/index-Bh8glecC.js +29 -0
- package/dist/assets/index-C0FXkPiP.js +62 -0
- package/dist/assets/{index-Bf3Peb0q.js → index-C6LgIqoY.js} +3 -3
- package/dist/assets/{index-CtORPeiq.js → index-CIJYNIAS.js} +2 -2
- package/dist/assets/{index-CGP3CGlC.js → index-CbTMv_sq.js} +6 -6
- package/dist/assets/{index-D29her4n.js → index-CeGNmiXz.js} +1 -1
- package/dist/assets/{index-CaTDaKrX.js → index-CiQKtWIW.js} +1 -1
- package/dist/assets/{index-WT6M-zj8.js → index-CiYSV3ew.js} +2 -2
- package/dist/assets/{index-D24LKXzO.js → index-Ck7gs4Oo.js} +1 -1
- package/dist/assets/{index-BT70k77_.js → index-CmDzr29Q.js} +2 -2
- package/dist/assets/index-CqsKmRBp.js +1 -0
- package/dist/assets/{index-lK6Pf_qM.js → index-CueIV4dA.js} +2 -2
- package/dist/assets/{index-DwJ_NASi.js → index-D4Ik9OgC.js} +2 -2
- package/dist/assets/index-DGg3AL9l.js +1039 -0
- package/dist/assets/{index-CUlOq3Sr.js → index-DQFDP0zB.js} +3 -3
- package/dist/assets/{index-CK3KHeKw.js → index-DTKew0E_.js} +1 -1
- package/dist/assets/{index-xE7OidBo.js → index-DVoa7OYS.js} +1 -1
- package/dist/assets/{index-CZBIYuko.js → index-DZnXlBSX.js} +1 -1
- package/dist/assets/{index-oS8X43Pb.js → index-DjCd3BVH.js} +6 -6
- package/dist/assets/{index-D_u0j8BO.js → index-DriYV-w5.js} +1 -1
- package/dist/assets/{index-CI3rRJqa.js → index-DzDWMabe.js} +12 -12
- package/dist/assets/{index-KIswy2vM.js → index-NpB7Thbw.js} +5 -5
- package/dist/assets/{index-CqD-x8pw.js → index-W43xyvqt.js} +2 -2
- package/dist/assets/{index-DACtt7qd.js → index-XVoTh0rZ.js} +1 -1
- package/dist/assets/{index-LaMi0T4w.js → index-cWpptG8N.js} +1 -1
- package/dist/assets/{invitation-C2S2tPzG.js → invitation-DaAeUQvL.js} +5 -5
- package/dist/assets/{invitations-Dil5QWBY.js → invitations-DY6AII7i.js} +2 -2
- package/dist/assets/{invite-GVnju9RQ.js → invite-BfQp8T_i.js} +1 -1
- package/dist/assets/{isURL-ZFgr0DWl.js → isURL-HdHdFI5D.js} +1 -1
- package/dist/assets/{issue-passport-BmU6NmKw.js → issue-passport-BKAe--H8.js} +1 -1
- package/dist/assets/{item-DfQKizv4.js → item-D8-oGTEp.js} +1 -1
- package/dist/assets/{landing-page-C3zTr0-n.js → landing-page-DQd97swG.js} +1 -1
- package/dist/assets/{layout-tkk_Lr2y.js → layout-PDwTMZS3.js} +1 -1
- package/dist/assets/list-B9c3yQuf.js +2 -0
- package/dist/assets/{list-YOpLH3o0.js → list-DYFxkX2y.js} +1 -1
- package/dist/assets/localization-XbNv70VN.js +1 -0
- package/dist/assets/{log-C0zcaEbO.js → log-ClrACcuw.js} +1 -1
- package/dist/assets/logger-D3ELa8t7.js +1 -0
- package/dist/assets/login-C3CgZVaH.js +1 -0
- package/dist/assets/{login-oauth-callback-DCJMx5J1.js → login-oauth-callback-DVq62YiP.js} +1 -1
- package/dist/assets/{logo-uploader-TLOlwvRt.js → logo-uploader-CPZeytzo.js} +1 -1
- package/dist/assets/{lost-passport-DE5KGhjz.js → lost-passport-rqbtayK0.js} +2 -2
- package/dist/assets/{omit-D_PYZZLm.js → omit-5AwbF-Ja.js} +1 -1
- package/dist/assets/{open-window-CPNpPXku.js → open-window-B20A6mUS.js} +1 -1
- package/dist/assets/{over-due-invoice-payment-1EZsSUm4.js → over-due-invoice-payment-Dpy6U-OB.js} +1 -1
- package/dist/assets/{overview-CMduEuAK.js → overview-DSMOnuTp.js} +2 -2
- package/dist/assets/passport-BeTGnBZp.js +1 -0
- package/dist/assets/{passport-item-QbgyHapR.js → passport-item-6fDG-tjs.js} +1 -1
- package/dist/assets/{permission-C0bmOzVj.js → permission-CjBTXkmT.js} +1 -1
- package/dist/assets/{preferences-0l0Zmaom.js → preferences-YojWKSr3.js} +1 -1
- package/dist/assets/profile-embed-CRKFFFmF.js +1 -0
- package/dist/assets/{publish-resource-ggObFvMi.js → publish-resource-CXd42xoH.js} +1 -1
- package/dist/assets/{react-beautiful-dnd.esm-zYw9dagY.js → react-beautiful-dnd.esm-By1RE6ef.js} +1 -1
- package/dist/assets/{runtime-BNKE0VfZ.js → runtime-Ydt2KUZV.js} +1 -1
- package/dist/assets/{sanitize-CtCDGQB6.js → sanitize-BOo6OPJZ.js} +1 -1
- package/dist/assets/sdk-BZuN1V4h.js +1 -0
- package/dist/assets/{security-CWEVWbF4.js → security-C6x1zjWI.js} +3 -3
- package/dist/assets/{session-Des-0R_y.js → session-Bavobyzn.js} +1 -1
- package/dist/assets/{setup-Cps_vpFS.js → setup-x3XlLP1U.js} +1 -1
- package/dist/assets/{spaces-2YPkTkBR.js → spaces-DKfk45f5.js} +1 -1
- package/dist/assets/start-WYmvvJ-x.js +187 -0
- package/dist/assets/{starting-progress-xuCef6_T.js → starting-progress-DbdtjHCx.js} +1 -1
- package/dist/assets/status-B7-tZFw7.js +1 -0
- package/dist/assets/{step-actions-AHe2MQxo.js → step-actions-BGJwIEbT.js} +1 -1
- package/dist/assets/{studio-HfI11Uc3.js → studio-D7UNnkpz.js} +1 -1
- package/dist/assets/{switch-control-CzYig10w.js → switch-control-BDwQ53GS.js} +1 -1
- package/dist/assets/{switch-rIcJ7tho.js → switch-wqsJ2qIA.js} +1 -1
- package/dist/assets/{table-tips-Ba9Kf02z.js → table-tips-BEPJMiqj.js} +1 -1
- package/dist/assets/{team-BWkxYdcc.js → team-D2fBm-il.js} +4 -4
- package/dist/assets/{traffic-jB6onGHq.js → traffic-BxfS8jav.js} +1 -1
- package/dist/assets/{transfer-DspVAdFc.js → transfer-C8A72tJr.js} +1 -1
- package/dist/assets/{unsubscribe-CKdMi1Kx.js → unsubscribe-DOgxD7dQ.js} +1 -1
- package/dist/assets/{use-app-logo-BAGvxEU-.js → use-app-logo-BwsHVK-l.js} +1 -1
- package/dist/assets/{use-window-close-D7QBHj75.js → use-window-close-edYntLdV.js} +1 -1
- package/dist/assets/{useAsync-CxjyODHb.js → useAsync-BSd-eaZO.js} +1 -1
- package/dist/assets/{useAsync-CgTefzpB.js → useAsync-DOpjtrvS.js} +1 -1
- package/dist/assets/{useAsyncRetry-BnuUJFwY.js → useAsyncRetry-v1aVMcV-.js} +1 -1
- package/dist/assets/useLocalStorage-8LihN_xG.js +1 -0
- package/dist/assets/user-center-9ue_tdF_.js +125 -0
- package/dist/assets/user-follower-DXIC4btc.js +32 -0
- package/dist/assets/{util-DXf_zMuU.js → util-CqIowTns.js} +1 -1
- package/dist/assets/{util-C9cWBCZz.js → util-pUhbKKIP.js} +1 -1
- package/dist/assets/{vendor-arcblock-DkdOhPyM.js → vendor-arcblock-DRfhQ9Yl.js} +1 -1
- package/dist/assets/{vendor-hooks-BZ19vVZ7.js → vendor-hooks-DpqqC65c.js} +1 -1
- package/dist/assets/vendor-utils-BqKQizRf.js +213 -0
- package/dist/assets/{vendor-ux-DMZIE6wA.js → vendor-ux-KtPBvlG0.js} +7 -7
- package/dist/assets/{wait-connect-D2wPrbE3.js → wait-connect-BwtwczC4.js} +1 -1
- package/dist/assets/{wizard-EYZCXWG5.js → wizard-LT-uDnMP.js} +1 -1
- package/dist/assets/wizard-components-BmdyIe7R.js +52 -0
- package/dist/assets/wrap-locale-C-cgVToU.js +1 -0
- package/dist/assets/{zh-CXK3bXGt.js → zh-DZyuEbhr.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +24 -24
- package/dist/assets/api-C75sLx9p.js +0 -1
- package/dist/assets/bind-account-DuzArGdZ.js +0 -1
- package/dist/assets/branding-bYH66Nug.js +0 -1
- package/dist/assets/button-BnSiFtNt.js +0 -1
- package/dist/assets/click-to-copy-CwdgHxjB.js +0 -1
- package/dist/assets/config-space-Dw6ITGIj.js +0 -1
- package/dist/assets/connect-Bl7-1lbc.js +0 -1
- package/dist/assets/did-address-uvYuZ4wv.js +0 -1
- package/dist/assets/domains-kgzxNW_C.js +0 -1
- package/dist/assets/engine-DWk3y4cO.js +0 -1
- package/dist/assets/gen-simple-access-key-DHmIlRFl.js +0 -1
- package/dist/assets/get-safe-url-gaxZoVzJ.js +0 -1
- package/dist/assets/index-B7DVpLRM.js +0 -63
- package/dist/assets/index-BaaFi7Vh.js +0 -1
- package/dist/assets/index-DwyzCfdd.js +0 -1041
- package/dist/assets/index-OMkyTUNX.js +0 -29
- package/dist/assets/list-BvgV1Jbh.js +0 -2
- package/dist/assets/localization-DcnSNZHz.js +0 -1
- package/dist/assets/logger-BbBkOuwH.js +0 -1
- package/dist/assets/login-BR26IXZx.js +0 -1
- package/dist/assets/passport-Dg1YWagy.js +0 -1
- package/dist/assets/profile-embed-BQzLZZkK.js +0 -1
- package/dist/assets/sdk-YVE2MSze.js +0 -1
- package/dist/assets/start-CuCNmoqX.js +0 -187
- package/dist/assets/status-DleDsf-t.js +0 -1
- package/dist/assets/useLocalStorage-Bj52e1ZW.js +0 -1
- package/dist/assets/user-center-CL_lKzgJ.js +0 -125
- package/dist/assets/user-follower-CfiG4RXf.js +0 -32
- package/dist/assets/vendor-utils-D5UG1a5Y.js +0 -213
- package/dist/assets/wizard-components-PMRUmw6U.js +0 -52
- package/dist/assets/wrap-locale-B4E8Yvgz.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,T as v,bb as b,D as I,J as T,ak as t}from"./vendor-mui-core-DnR6WYuU.js";import{
|
|
1
|
+
import{j as e,T as v,bb as b,D as I,J as T,ak as t}from"./vendor-mui-core-DnR6WYuU.js";import{q as B,g as E,ac as P,$ as j,ab as A}from"./vendor-ux-KtPBvlG0.js";import{a as C}from"./vendor-hooks-DpqqC65c.js";import{aa as M}from"./index-DGg3AL9l.js";function N({linkProps:s=void 0,showExtra:o=!1,...n}){return e.jsxs(v,{...n,children:["Powered by"," ",e.jsx(b,{href:"https://www.arcblock.io",target:"_blank",...s,children:"ArcBlock"}),"'s"," ",e.jsx(b,{href:"https://www.blocklet.io",target:"_blank",...s,children:"Blocklet Technology"}),o?", the decentralized web engine.":null]})}function W({did:s,children:o,title:n=void 0,description:a=void 0,actions:m=void 0,logo:i=void 0,logoSize:d=50,poweredBy:x=void 0,termsOfUse:g=void 0,standalone:y=!1}){const r=globalThis?.blocklet||globalThis?.env||{},{palette:f}=I(),c=T(l=>l.breakpoints.down("lg")),w=M({meta:r}),k=C(()=>{const l=r.appPid,u=B.isEthereumDid(l),z=u?void 0:E(l);return u?P(l):z.color},[r?.appPid]);if(!s)return o;n===void 0&&(n=r.appName),a===void 0&&(a=r.appDescription),i===void 0&&(i=w||""),typeof i=="string"&&(i?i=e.jsx(t,{sx:{height:d,maxHeight:d,objectFit:"contain"},component:"img",src:i,alt:`${r.appName}'s logo`}):i=e.jsx(j,{size:d,did:s,src:i,variant:"rounded"})),x===void 0&&(x=e.jsx(N,{linkProps:{color:f.text.secondary,sx:{"&:hover":{textDecoration:"underline"}}},showExtra:!c,sx:{textAlign:"center",fontSize:"12px",color:"text.secondary"}}));let p=o;!o&&!c&&(p=e.jsx(t,{sx:{filter:"blur(180px)",display:"flex"},children:e.jsx(j,{size:210,did:s,variant:"rounded"})}));const D=!!o;let h=!y;return c&&(h=!D),e.jsxs(t,{sx:{width:"100%",minHeight:"100vh",display:"flex",justifyContent:"center",alignItems:"center",px:{xs:2,sm:4,md:8},pt:{xs:2,sm:4,md:6},pb:{xs:5,md:8},background:`radial-gradient(circle at bottom right, ${A(k,.3)} 10%, ${f.background.default} 50%)`,position:"relative"},children:[e.jsxs(t,{sx:{maxWidth:1200,display:"flex",alignItems:"center",justifyContent:[h,p].filter(Boolean).length>1?"space-between":"center",width:"100%",margin:"auto"},children:[h?e.jsxs(t,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[e.jsx(t,{sx:{display:"flex",alignItems:"center"},children:i}),e.jsx(v,{variant:"h2",sx:{fontWeight:"bold",fontSize:{sm:"2.25rem",md:"2.75rem",xl:"3.5rem"}},children:n}),a?e.jsx(t,{sx:{mb:2,color:"text.secondary"},children:a}):null,m?e.jsx(t,{sx:{mt:8},children:m}):null,g?e.jsx(t,{sx:{mt:-1,color:"grey"},children:g}):null]}):null,p]}),e.jsx(t,{sx:{position:"absolute",zIndex:10,bottom:10,left:10,right:10,textAlign:"center"},children:x})]})}export{W as K};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a,at as m}from"./vendor-mui-core-DnR6WYuU.js";import{C as p}from"./content-layout-DmSBGGVm.js";import{V as c,
|
|
1
|
+
import{j as a,at as m}from"./vendor-mui-core-DnR6WYuU.js";import{C as p}from"./content-layout-DmSBGGVm.js";import{V as c,H as s}from"./vendor-ux-KtPBvlG0.js";import{af as d,J as i}from"./index-DGg3AL9l.js";const u=m(p)`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
width: 100%;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.__toCdnUrl("assets/vendor-ux-DYcPPYq2.css"),window.__toCdnUrl("assets/index-DrVXX4fX.css"),window.__toCdnUrl("assets/index-B5LvOF-F.css")])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as U,a as Ue}from"./vendor-react-CTtPmzVP.js";import{V as D,H,_ as ye,$ as re,b0 as V,aO as ve,aN as Ce}from"./vendor-ux-KtPBvlG0.js";import{j as e,Y as M,b5 as K,I as X,aj as G,$ as Y,b6 as q,T as I,ak as c,z as w,F as C,c5 as Te,b$ as le,bX as ne,a5 as se,a3 as Z,aZ as oe,R as ae,Q as z,a6 as Q,W as n,am as we,bi as ce,cv as Se,cu as Ie}from"./vendor-mui-core-DnR6WYuU.js";import{Z as $,c as k,Y as Re,ba as Ee,bb as Ae,bc as ke}from"./index-DGg3AL9l.js";import{u as Ne}from"./useAsyncRetry-v1aVMcV-.js";import{r as We}from"./index-C0FXkPiP.js";import{b as B}from"./team-D2fBm-il.js";import{u as ue,C as S}from"./index.esm-Co8ZxFyk.js";import{o as Pe,b as qe,C as te}from"./vendor-utils-BqKQizRf.js";import{T as Oe}from"./index-cWpptG8N.js";import{E as Le}from"./empty-spinner-BYDonf35.js";import{C as v}from"./click-to-copy-03_3P1nz.js";import{D as _e}from"./delete-confirm-BT4RGlre.js";import{a as ze}from"./passport-item-6fDG-tjs.js";import{A as Fe}from"./actions-Dfiiwkit.js";import{T as ie}from"./table-tips-BEPJMiqj.js";import{u as De}from"./use-mobile-BINJTzMb.js";import"./vendor-hooks-DpqqC65c.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-DRfhQ9Yl.js";import"./useAsync-BSd-eaZO.js";import"./session-Bavobyzn.js";import"./isURL-HdHdFI5D.js";import"./use-app-logo-BwsHVK-l.js";import"./arrow-down.svg-C4FUKwt4.js";import"./vendor-mui-x-CQc01l4r.js";import"./AdapterDayjs-DqOr9LFk.js";import"./confirm-Dul9DyCY.js";import"./index-DBs9Ljax.js";import"./ua-parser-DP5omx3I.js";import"./did-address-DpdRECuJ.js";import"./util-pUhbKKIP.js";import"./base32-BqL5pnrU.js";var de=We();const $e={clientName:"",clientUri:"",redirectUris:"",scope:["profile:read"],contacts:"",tosUri:"",policyUri:""};function pe({onCreated:r,onClose:a}){const[i,h]=U.useState(!1),{t:l,locale:s}=D(),{api:f}=$(),{teamDid:d}=B(),{control:y,handleSubmit:g,formState:{errors:u},watch:N,setValue:m}=ue({defaultValues:$e,mode:"onChange"}),T=N("scope"),R=o=>{o!=="profile:read"&&m("scope",T.includes(o)?T.filter(x=>x!==o):[...T,o])},W=async o=>{h(!0);try{const x={...o,redirectUris:o.redirectUris,contacts:o.contacts?o.contacts.split(",").map(A=>A.trim()):[],scope:o.scope.join(" ")};await f.createOAuthClient({input:{teamDid:d,input:Pe(x,qe)}}),r(x)}catch(x){H.error(x.message||"Failed to create OAuth App")}finally{h(!1)}};return e.jsxs(M,{open:!0,onClose:a,maxWidth:"md",fullWidth:!0,children:[e.jsxs(K,{children:[l("oauth.client.register")," ",e.jsx(X,{onClick:a,sx:{position:"absolute",right:8,top:8},children:e.jsx(G,{})})]}),e.jsx(Y,{children:e.jsxs(q,{spacing:4,sx:{mt:2},children:[e.jsx(I,{variant:"h6",gutterBottom:!0,children:l("oauth.client.requiredInformation")}),e.jsx(c,{children:e.jsx(S,{name:"clientName",control:y,rules:{required:l("oauth.client.validate.clientName"),minLength:{value:3,message:l("oauth.client.validate.clientNameMinLength")}},render:({field:o})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...o,label:l("oauth.client.name"),required:!0,fullWidth:!0,placeholder:l("oauth.client.input.clientNamePlaceholder"),error:!!u.clientName,helperText:u.clientName?.message}),e.jsx(C,{children:l("oauth.client.helperText.clientName")})]})})}),e.jsx(c,{children:e.jsx(S,{name:"clientUri",control:y,rules:{required:l("oauth.client.validate.clientUri"),pattern:{value:/^https?:\/\/.+/,message:l("oauth.client.validate.clientUriInvalid")}},render:({field:o})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...o,label:l("oauth.client.input.clientUri"),required:!0,fullWidth:!0,placeholder:l("oauth.client.input.clientUriPlaceholder"),error:!!u.clientUri,helperText:u.clientUri?.message}),e.jsx(C,{children:l("oauth.client.helperText.clientUri")})]})})}),e.jsx(c,{children:e.jsx(S,{name:"redirectUris",control:y,rules:{required:l("oauth.client.validate.redirectUris"),pattern:{value:/^https?:\/\/.+/,message:l("oauth.client.validate.redirectUrisInvalid")}},render:({field:o})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...o,label:l("oauth.client.input.redirectUris"),required:!0,fullWidth:!0,placeholder:l("oauth.client.input.redirectUrisPlaceholder"),error:!!u.redirectUris,helperText:u.redirectUris?.message}),e.jsxs(c,{sx:{display:"flex",gap:"2px"},children:[e.jsx(C,{children:l("oauth.client.helperText.redirectUris")}),e.jsx(C,{children:l("oauth.client.helperText.read")}),e.jsx(C,{sx:{color:"info.main"},component:"a",href:`https://www.arcblock.io/docs/blocklet-developer/${s}/oauth-service`,target:"_blank",rel:"noopener noreferrer",children:l("oauth.client.helperText.document")}),e.jsx(C,{children:l("oauth.client.helperText.more")})]})]})})}),e.jsxs(Te,{variant:"outlined",sx:{p:2,display:"none"},children:[e.jsx(I,{variant:"subtitle2",gutterBottom:!0,children:l("oauth.client.input.permissions")}),e.jsx(c,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2},children:e.jsx(le,{children:Object.entries(k.OAUTH_SCOPES).map(([o,x])=>e.jsx(ne,{control:e.jsx(se,{checked:T.includes(o),onChange:()=>R(o),disabled:o==="profile:read",color:"primary"}),label:e.jsx(c,{children:e.jsx(I,{variant:"body2",sx:{fontWeight:500},children:x})})},o))})})]}),e.jsx(Z,{}),e.jsx(I,{variant:"h6",gutterBottom:!0,children:l("oauth.client.optionalInformation")}),e.jsx(q,{children:e.jsx(S,{name:"contacts",control:y,rules:{pattern:{value:/^$|^[^@\s]+@[^@\s]+\.[^@\s]+(\s*,\s*[^@\s]+@[^@\s]+\.[^@\s]+)*$/,message:l("oauth.client.validate.contacts")}},render:({field:o})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...o,label:l("oauth.client.input.contacts"),fullWidth:!0,placeholder:l("oauth.client.input.contactsPlaceholder"),error:!!u.contacts,helperText:u.contacts?.message}),e.jsx(C,{children:l("oauth.client.helperText.contacts")})]})})}),e.jsxs(q,{direction:{xs:"column",sm:"row"},spacing:2,children:[e.jsx(S,{name:"tosUri",control:y,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:l("oauth.client.validate.tosUriInvalid")}},render:({field:o})=>e.jsxs(c,{sx:{width:"50%"},children:[e.jsx(w,{size:"small",...o,label:l("oauth.client.input.tosUri"),fullWidth:!0,placeholder:l("oauth.client.input.tosUriPlaceholder"),error:!!u.tosUri,helperText:u.tosUri?.message}),e.jsx(C,{children:l("oauth.client.helperText.tosUri")})]})}),e.jsx(S,{name:"policyUri",control:y,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:l("oauth.client.validate.policyUriInvalid")}},render:({field:o})=>e.jsxs(c,{sx:{width:"50%"},children:[e.jsx(w,{size:"small",...o,label:l("oauth.client.input.policyUri"),fullWidth:!0,placeholder:l("oauth.client.input.policyUriPlaceholder"),error:!!u.policyUri,helperText:u.policyUri?.message}),e.jsx(C,{children:l("oauth.client.helperText.policyUri")})]})})]}),u.error&&e.jsx(oe,{severity:"error",children:u.error.message})]})}),e.jsxs(ae,{children:[e.jsx(z,{onClick:a,children:l("common.cancel")}),e.jsxs(z,{onClick:g(W),disabled:i,variant:"contained",color:"primary",children:[i?e.jsx(Q,{size:20,sx:{mr:1}}):null,l("oauth.client.registerButton")]})]})]})}pe.propTypes={onCreated:n.func.isRequired,onClose:n.func.isRequired};function J({scope:r="",...a}){if(!r)return null;const i=r.split(" ").filter(Boolean);return e.jsx(q,{direction:"row",...a,sx:[{flexWrap:"wrap",gap:1},...Array.isArray(a.sx)?a.sx:[a.sx]],children:i.map(h=>e.jsx(Ue.Fragment,{children:e.jsx(we,{title:k.OAUTH_SCOPES[h],children:e.jsx(v,{children:h})})},h))})}J.propTypes={scope:n.string};const ee=r=>{const{prefix:a}=$(),{blocklet:i}=Re(),h=te(a,"/api/media/upload",i.appPid),l=U.useCallback(f=>f?f.startsWith("http")?f:`${te(a,"/api/media/upload",i.appPid)}/${f}`:"",[a,i.appPid]);return{clientLogoUrl:U.useMemo(()=>l(r),[r,l]),apiPath:h,getClientLogoUrl:l}},Be=U.lazy(()=>ye(()=>import("./index-CmDzr29Q.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(r=>({default:r.Uploader})));function he({client:r,onUpdate:a,onClose:i}){const[h,l]=U.useState(!1),{t:s,locale:f}=D(),d=U.useRef(null),{api:y}=$(),{teamDid:g}=B(),{control:u,handleSubmit:N,formState:{errors:m},watch:T,setValue:R,getValues:W}=ue({defaultValues:{clientName:r.clientName||"",clientUri:r.clientUri||"",redirectUris:Array.isArray(r.redirectUris)?r.redirectUris.join(","):"",scope:r.scope?r.scope.split(" "):["profile:read"],contacts:Array.isArray(r.contacts)?r.contacts.join(","):"",tosUri:r.tosUri||"",policyUri:r.policyUri||"",logoUri:r.logoUri||"",clientSecretExpiresAt:r.clientSecretExpiresAt||null},mode:"onChange"}),o=T("scope"),x=T("logoUri"),{clientLogoUrl:A,apiPath:P}=ee(x),E=t=>{t!=="profile:read"&&R("scope",o.includes(t)?o.filter(p=>p!==t):[...o,t])},O=async t=>{const p={clientId:r.clientId,clientName:t.clientName.trim(),clientUri:t.clientUri,redirectUris:t.redirectUris.split(",").map(j=>j.trim()).filter(Boolean),contacts:t.contacts?t.contacts.split(",").map(j=>j.trim()):[],scope:t.scope.join(" "),tosUri:t.tosUri,policyUri:t.policyUri,logoUri:t.logoUri,clientSecretExpiresAt:t.clientSecretExpiresAt?parseInt(t.clientSecretExpiresAt/1e3,10):null};await y.updateOAuthClient({input:{teamDid:g,input:p}})},_=async t=>{l(!0);try{await O(t),a(),i()}catch(p){H.error(p.message||s("oauth.client.updateFailed"))}finally{l(!1)}};return e.jsxs(M,{open:!0,onClose:i,maxWidth:"md",fullWidth:!0,children:[e.jsxs(K,{children:[s("oauth.client.update")," ",e.jsx(X,{onClick:i,sx:{position:"absolute",right:8,top:8},children:e.jsx(G,{})})]}),e.jsx(Y,{children:e.jsxs(q,{spacing:3,sx:{mt:2},children:[e.jsxs(c,{sx:{mb:3},children:[e.jsx(I,{variant:"subtitle1",sx:{fontWeight:500,mb:1},children:s("oauth.client.logo")}),e.jsxs(c,{children:[e.jsx(c,{sx:{width:120,height:120,position:"relative",borderRadius:"4px",overflow:"hidden"},children:A?e.jsx(c,{children:e.jsx("img",{src:A,alt:"client-logo",style:{width:"100%",height:"100%"}})}):e.jsx(c,{onClick:()=>{d.current?.open()},sx:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",bgcolor:"grey.200"},children:e.jsx(ce,{sx:{fontSize:40,color:"common.white"}})})}),e.jsx(z,{sx:{mt:2},variant:"outlined",size:"small",onClick:()=>{d.current?.open()},children:s(A?"common.change":"common.upload")})]}),e.jsx(c,{sx:{display:"flex",alignItems:"center"},children:e.jsx(U.Suspense,{fallback:e.jsx(Le,{}),children:e.jsx(Be,{ref:d,locale:f,popup:!0,onUploadFinish:t=>{R("logoUri",t.data.filename),O(W()).then(()=>{a()}).catch(p=>{H.error(p.message||s("oauth.client.updateFailed"))}).finally(()=>{d.current?.close()})},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:P,disableMediaKitPrefix:!0,disableAutoPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/png","image/jpeg","image/webp","image/svg+xml"],maxFileSize:1024*1024*.5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{minWidth:256,minHeight:256}}}},"uploader-logo")})})]}),e.jsx(I,{variant:"subtitle1",sx:{fontWeight:500},children:s("oauth.client.requiredInformation")}),e.jsx(w,{label:"Client Id",fullWidth:!0,value:r.clientId,disabled:!0}),e.jsx(c,{children:e.jsx(S,{name:"clientName",control:u,rules:{required:s("oauth.client.validate.clientName"),minLength:{value:3,message:s("oauth.client.validate.clientNameMinLength")}},render:({field:t})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{...t,label:s("oauth.client.name"),required:!0,fullWidth:!0,error:!!m.clientName,helperText:m.clientName?.message}),e.jsx(C,{children:s("oauth.client.helperText.clientName")})]})})}),e.jsx(c,{children:e.jsx(S,{name:"clientUri",control:u,rules:{required:s("oauth.client.validate.clientUri"),pattern:{value:/^https?:\/\/.+/,message:s("oauth.client.validate.clientUriInvalid")}},render:({field:t})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{...t,label:s("oauth.client.input.clientUri"),required:!0,fullWidth:!0,error:!!m.clientUri,helperText:m.clientUri?.message}),e.jsx(C,{children:s("oauth.client.helperText.clientUri")})]})})}),e.jsx(c,{children:e.jsx(S,{name:"redirectUris",control:u,rules:{required:s("oauth.client.validate.redirectUris"),pattern:{value:/^https?:\/\/.+/,message:s("oauth.client.validate.redirectUrisInvalid")}},render:({field:t})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{...t,label:s("oauth.client.input.redirectUris"),required:!0,fullWidth:!0,multiline:!0,rows:2,error:!!m.redirectUris,helperText:m.redirectUris?.message}),e.jsx(C,{children:s("oauth.client.helperText.redirectUris")})]})})}),e.jsx(S,{name:"clientSecretExpiresAt",control:u,render:({field:t})=>e.jsx(Oe,{placeholder:s("oauth.client.input.expireTime"),value:t.value*1e3,onChange:p=>{t.onChange(p)}})}),e.jsxs(c,{sx:{display:"none"},children:[e.jsx(I,{variant:"subtitle2",sx:{mb:1},children:s("oauth.client.input.permissions")}),e.jsx(c,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2},children:e.jsx(le,{children:Object.entries(k.OAUTH_SCOPES).map(([t,p])=>e.jsx(ne,{control:e.jsx(se,{checked:o.includes(t),onChange:()=>E(t),disabled:t==="profile:read",color:"primary"}),label:e.jsx(c,{children:e.jsx(I,{variant:"body2",sx:{fontWeight:500},children:p})})},t))})})]}),e.jsx(Z,{}),e.jsx(I,{variant:"subtitle1",sx:{fontWeight:500},children:s("oauth.client.optionalInformation")}),e.jsx(c,{children:e.jsx(S,{name:"contacts",control:u,rules:{pattern:{value:/^$|^[^@\s]+@[^@\s]+\.[^@\s]+(\s*,\s*[^@\s]+@[^@\s]+\.[^@\s]+)*$/,message:s("oauth.client.validate.contacts")}},render:({field:t})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{...t,label:s("oauth.client.input.contacts"),fullWidth:!0,error:!!m.contacts,helperText:m.contacts?.message}),e.jsx(C,{children:s("oauth.client.helperText.contacts")})]})})}),e.jsxs(q,{direction:{xs:"column",sm:"row"},spacing:2,children:[e.jsx(S,{name:"tosUri",control:u,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:s("oauth.client.validate.tosUriInvalid")}},render:({field:t})=>e.jsxs(c,{sx:{width:"50%"},children:[e.jsx(w,{...t,label:s("oauth.client.input.tosUri"),fullWidth:!0,error:!!m.tosUri,helperText:m.tosUri?.message}),e.jsx(C,{children:s("oauth.client.helperText.tosUri")})]})}),e.jsx(S,{name:"policyUri",control:u,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:s("oauth.client.validate.policyUriInvalid")}},render:({field:t})=>e.jsxs(c,{sx:{width:"50%"},children:[e.jsx(w,{...t,label:s("oauth.client.input.policyUri"),fullWidth:!0,error:!!m.policyUri,helperText:m.policyUri?.message}),e.jsx(C,{children:s("oauth.client.helperText.policyUri")})]})})]}),m.error&&e.jsx(oe,{severity:"error",children:m.error.message})]})}),e.jsxs(ae,{children:[e.jsx(z,{onClick:i,children:s("common.cancel")}),e.jsx(z,{onClick:N(_),disabled:h,variant:"contained",color:"primary",children:h?e.jsx(Q,{size:16}):s("common.update")})]})]})}he.propTypes={client:n.shape({clientId:n.string.isRequired,clientName:n.string.isRequired,clientUri:n.string,redirectUris:n.arrayOf(n.string),scope:n.string,contacts:n.arrayOf(n.string),tosUri:n.string,policyUri:n.string,logoUri:n.string,clientSecretExpiresAt:n.number}).isRequired,onUpdate:n.func.isRequired,onClose:n.func.isRequired};function me({client:r,onUpdate:a,onClose:i}){return e.jsx(he,{client:r,onUpdate:h=>a(h),onClose:i})}me.propTypes={client:n.shape({clientId:n.string.isRequired,clientName:n.string.isRequired,clientUri:n.string,redirectUris:n.arrayOf(n.string),scope:n.string,contacts:n.arrayOf(n.string),tosUri:n.string,policyUri:n.string,logoUri:n.string,clientSecretExpiresAt:n.number}).isRequired,onUpdate:n.func.isRequired,onClose:n.func.isRequired};function xe({clientId:r,clientName:a,onDelete:i=()=>{},onClose:h=()=>{}}){const{t:l}=D(),{api:s}=$(),{teamDid:f}=B(),d=()=>{h()},y=async()=>{try{await s.deleteOAuthClient({input:{teamDid:f,clientId:r}}),i()}catch(u){H.error(u?.message)}finally{d()}},g={keyName:a,title:l("oauth.client.delete.title"),description:l("oauth.client.delete.description",{name:`<b>${a}</b>`}),confirmPlaceholder:l("oauth.client.delete.description",{name:a}),confirm:l("common.delConfirm"),cancel:l("common.cancel"),onConfirm:y,onCancel:d};return e.jsx(_e,{keyName:g.keyName,title:g.title,description:g.description,confirmPlaceholder:g.confirmPlaceholder,confirm:g.confirm,cancel:g.cancel,params:g.params,onConfirm:g.onConfirm,onCancel:g.onCancel})}xe.propTypes={clientId:n.string.isRequired,clientName:n.string.isRequired,onDelete:n.func,onClose:n.func};function je({title:r,items:a}){return e.jsxs(c,{sx:{mb:3},children:[e.jsx(I,{variant:"h6",sx:{mb:1.5},children:r}),e.jsx(q,{spacing:1.5,children:a.map(({label:i,value:h})=>e.jsxs(c,{sx:{display:"flex",alignItems:"center",gap:2},children:[e.jsx(I,{variant:"subtitle2",color:"textSecondary",sx:{minWidth:200},children:i}),e.jsx(I,{sx:{wordBreak:"break-all"},children:h||"-"})]},i))})]})}je.propTypes={title:n.string.isRequired,items:n.arrayOf(n.shape({label:n.string.isRequired,value:n.any})).isRequired};function ge({client:r,onClose:a}){const{t:i,locale:h}=D(),{teamDid:l}=B(),{clientName:s,clientId:f,clientSecret:d,redirectUris:y,scope:g,clientUri:u,logoUri:N,contacts:m,tosUri:T,policyUri:R,jwksUri:W,jwks:o,softwareId:x,softwareVersion:A,clientIdIssuedAt:P,clientSecretExpiresAt:E,updatedAt:O,createUser:_}=r,{clientLogoUrl:t}=ee(N),p=L=>{try{const F=new URL(window.blocklet.appUrl);return F.pathname=L,F.toString()}catch{return"-"}},j=de.fromAppDid(f,l),b=[{title:i("common.baseInfo"),items:[{label:i("oauth.client.name"),value:s},{label:i("oauth.client.logoUri"),value:e.jsx(re,{variant:"rounded",shape:"square",src:t,did:j.address,size:64})},{label:i("oauth.client.clientUri"),value:u?e.jsx(v,{children:u}):"-"},{label:i("oauth.client.clientId"),value:e.jsx(v,{children:f})},{label:i("oauth.client.clientSecret"),value:e.jsx(v,{children:d})},{label:i("oauth.client.redirectUris"),value:e.jsx(v,{children:(y||[]).join(", ")})},{label:i("oauth.client.scope"),value:e.jsx(J,{scope:g})},{label:i("oauth.client.createUser"),value:_?ze(_,!0):i("oauth.client.openRegistration")}]},{title:i("oauth.client.oauthEndpoints"),items:[{label:i("oauth.client.openidConfiguration"),value:e.jsx(v,{children:p("/.well-known/openid-configuration")})},{label:i("oauth.client.authorizationEndpoint"),value:e.jsx(v,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/authorize`)})},{label:i("oauth.client.tokenEndpoint"),value:e.jsx(v,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/token`)})},{label:i("oauth.client.userinfoEndpoint"),value:e.jsx(v,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/userinfo`)})},{label:i("oauth.client.jwksUri"),value:e.jsx(v,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/jwks`)})},{label:i("oauth.client.registrationEndpoint"),value:e.jsx(v,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/register`)})},{label:i("oauth.client.endSessionEndpoint"),value:e.jsx(v,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/logout`)})}]},{title:i("oauth.client.metaContact"),items:[{label:i("oauth.client.contacts"),value:m.length?e.jsx(v,{children:(m||[]).join(", ")}):"-"},{label:i("oauth.client.tosUri"),value:T?e.jsx(v,{children:T}):"-"},{label:i("oauth.client.policyUri"),value:R?e.jsx(v,{children:R}):"-"},{label:i("oauth.client.jwksUri"),value:W},{label:i("oauth.client.jwks"),value:o},{label:i("oauth.client.softwareId"),value:x},{label:i("oauth.client.softwareVersion"),value:A}]},{title:i("common.timeInfo"),items:[{label:i("oauth.client.clientIdIssuedAt"),value:P?e.jsx(V,{value:P*1e3,type:"all",locale:h}):"-"},{label:i("oauth.client.clientSecretExpiresAt"),value:E?e.jsx(V,{value:E*1e3,type:"all",locale:h}):"-"},{label:i("common.updatedAt"),value:O?e.jsx(V,{value:O,type:"all",locale:h}):"-"}]}].filter(Boolean);return e.jsxs(M,{open:!0,onClose:a,maxWidth:"lg",fullWidth:!0,children:[e.jsxs(K,{children:[i("oauth.client.oauthAppDetails"),e.jsx(X,{onClick:a,sx:{position:"absolute",right:8,top:8},children:e.jsx(G,{})})]}),e.jsx(Y,{children:e.jsx(c,{sx:{mt:1},children:b.map((L,F)=>e.jsxs(c,{children:[e.jsx(je,{title:L.title,items:L.items}),F!==b.length-1&&e.jsx(Z,{sx:{my:2}})]},L.title))})})]})}ge.propTypes={client:n.object.isRequired,onClose:n.func.isRequired};function Ve(r){return e.jsx(V,{value:r*1e3})}function fe({selected:r=null,onClose:a}){return r?e.jsx(ge,{client:r,onClose:a}):null}fe.propTypes={selected:n.object,onClose:n.func.isRequired};function be({open:r,onCreated:a,onClose:i}){return r?e.jsx(pe,{onCreated:a,onClose:i}):null}be.propTypes={open:n.bool.isRequired,onCreated:n.func.isRequired,onClose:n.func.isRequired};function Tt(){const[r,a]=U.useState({searchText:"",pageSize:10,page:1}),[i,h]=U.useState(null),[l,s]=U.useState(!1),f=U.useRef(null),{t:d,locale:y}=D(),{api:g}=$(),{teamDid:u}=B(),[N,m]=U.useState(null),[T,R]=U.useState(null),W=De(),{getClientLogoUrl:o}=ee(),x=Ne(async()=>await g.getOAuthClients({input:{teamDid:u,paging:{page:r.page,pageSize:r.pageSize}}}),[r.page,r.pageSize]),{loading:A}=x,P=U.useMemo(()=>x.value?.list||[],[x.value?.list]),E=U.useMemo(()=>r.searchText?P.filter(t=>t.clientName.toLowerCase().includes(r.searchText.toLowerCase())||t.clientId.toLowerCase().includes(r.searchText.toLowerCase())||t.scope.toLowerCase().includes(r.searchText.toLowerCase())):P,[r.searchText,P]),O=U.useMemo(()=>[{label:d("oauth.client.name"),name:"clientName",options:{customBodyRender:(t,{rowIndex:p})=>{const j=E[p],b=o(j.logoUri),L=de.fromAppDid(j.clientId,u);return e.jsx(c,{sx:{display:"flex",alignItems:"center",gap:2},children:e.jsxs(c,{sx:{display:"flex",alignItems:"center",gap:2,cursor:"pointer"},children:[e.jsx(re,{variant:"rounded",shape:"square",did:L.address,src:b,size:48}),e.jsxs(q,{sx:{gap:.5},children:[e.jsx(c,{sx:{color:"text.primary"},children:j.clientName}),e.jsx(c,{sx:{color:"text.secondary"},children:j.clientUri})]})]})})}}},{label:d("oauth.client.clientId"),name:"clientId"},{label:d("oauth.client.scope"),name:"scope",options:{customBodyRender:t=>e.jsx(J,{scope:t})}},{label:d("common.createdAt"),name:"clientIdIssuedAt",options:{customBodyRender:Ve}},{label:d("common.createdBy"),name:"createdBy",width:100,options:{customBodyRender:t=>t?e.jsx(Ee,{showDid:!0,did:t,cardType:ke.Detailed,infoType:Ae.Minimal,sx:{border:0,padding:0}}):d("oauth.client.openRegistration")}},{label:d("common.actions"),name:"actions",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRender:(t,{rowIndex:p})=>{const j=E[p];return e.jsx(Fe,{actions:[{icon:e.jsx(Se,{}),text:d("common.edit"),onClick:b=>{b.stopPropagation(),m(j)}},{icon:e.jsx(Ie,{}),text:d("common.delete"),onClick:b=>{b.stopPropagation(),R(j)}}]})}}}],[E,d,o,u,m,R]),_=({page:t,rowsPerPage:p,searchText:j})=>{r.pageSize!==p?a(b=>({...b,searchText:"",pageSize:p,page:1})):r.page!==t+1?a(b=>({...b,searchText:"",page:t+1})):r.searchText!==j&&a(b=>({...b,searchText:j,page:1}))};return e.jsxs(c,{ref:f,sx:{".custom-toobar-btns":{gap:"8px"},".custom-toobar-title .custom-toobar-title-inner>span":{display:"flex",alignItems:"center","white-space":"inherit",height:"100%"}},children:[W?e.jsx(ie,{title:d("oauth.client.listTitle"),tooltipTitle:d("oauth.client.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${y}/oauth-service`}):null,e.jsx(ve,{data:E,columns:O,options:{sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,page:r.page-1,rowsPerPage:r.pageSize,count:E.length,searchDebounceTime:400,onRowClick(t,{dataIndex:p},j){if(f.current?.contains(j.target)){const b=E[p];h(b)}}},onChange:_,title:W?null:e.jsx(ie,{title:d("oauth.client.listTitle"),tooltipTitle:d("oauth.client.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${y}/oauth-service`}),customButtons:[e.jsxs(z,{variant:"contained",size:"small",onClick:()=>s(!0),children:[A?e.jsx(Q,{size:16}):e.jsx(ce,{style:{fontSize:16}}),d("common.create")]},"add")],loading:!1,emptyNode:e.jsx(Ce,{children:d("oauth.client.empty")})}),e.jsx(fe,{selected:i,onClose:()=>h(null)}),e.jsx(be,{open:l,onCreated:()=>{s(!1),x.retry()},onClose:()=>s(!1)}),N&&e.jsx(me,{client:N,onUpdate:x.retry,onClose:()=>m(null)}),T&&e.jsx(xe,{...T,onDelete:x.retry,onClose:()=>R(null)})]})}export{Tt as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as o}from"./vendor-react-CTtPmzVP.js";import{j as t,b2 as _,W as n,D as F,n as xe,bu as ye,br as be,cz as ve,cA as je,cB as we,ak as g,T as q,Q as ke,bb as te,a3 as Ie,s as Me,J as Ce,I as Re,at as Ae}from"./vendor-mui-core-DnR6WYuU.js";import{a as D,b as O,h as Te}from"./vendor-hooks-BZ19vVZ7.js";import{V as Q,bb as Ne,N as ne,b2 as re,bj as Se}from"./vendor-ux-DMZIE6wA.js";import{t as $e}from"./server-logo-notext.svg-xZ-i1SpD.js";import{B as ze}from"./bundle-avatar-B1jZNqcH.js";import{a as Le,g as se,d as ie,u as oe,e as V,M as ae,f as Ee,m as De,h as Be,j as Pe,c as qe,i as Ve,k as _e,l as Fe,n as Oe,N as He}from"./team-BWkxYdcc.js";import{a4 as Ue,J as We,C as J,a as H}from"./vendor-utils-D5UG1a5Y.js";import{ba as Qe,bb as Je,bc as Ke,c as Xe,Z as Ge}from"./index-DwyzCfdd.js";import{p as Ye}from"./util-C9cWBCZz.js";function le({blocklet:e,style:r={},size:s=40,...i}){const l=Le({blocklet:e,square:!0}),{variant:u}=i;return t.jsx(_,{variant:u||"square",style:Object.assign({backgroundColor:"transparent",width:s,height:s,borderRadius:10},r),...i,children:t.jsx("img",{src:l,alt:"",style:{width:s}})})}le.propTypes={blocklet:n.object.isRequired,style:n.object,size:n.oneOfType([n.number,n.string])};function Ze(e){return e.includes(" ")?new Date(e.replace(" ","T").replace(" ","")).getTime():new Date(e).getTime()}function K({value:e="",shouldUpdate:r=!1,...s}){const{locale:i}=Q(),[l,u]=o.useState(0);if(o.useEffect(()=>{let d;if(r){const p=new Date(e).getTime(),y=Date.now(),v=Math.abs(Math.floor((p-y)/1e3)),b=()=>{u(k=>{const R=Math.random()*1e3;return parseFloat((k+R).toFixed(4))})};v<60?d=setInterval(b,1e3):v<60*60?d=setInterval(b,6e4):d=setInterval(b,36e5)}return()=>{clearInterval(d)}},[e,l,r]),!e)return"-";const m=Ze(e);return t.jsx(Ne,{value:m,locale:i,...s})}K.propTypes={value:n.any,shouldUpdate:n.bool};const et={error:je,warning:ve,info:be,success:ye};ce.propTypes={severity:n.oneOf(["error","warning","info","success"]).isRequired,size:n.number};function ce({severity:e="info",size:r=32}){const s=F(),l=D(()=>({error:s.palette.error.main,warning:s.palette.warning.main,info:s.palette.info.main,success:s.palette.success.main}))[e],u=et[e],m=xe(l,.1);return t.jsx(_,{sx:{width:r,height:r,bgcolor:m,color:l},children:t.jsx(u,{fontSize:"small"})})}const tt={width:24,height:24,body:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M0 0h24v24H0z"/><path fill="currentColor" d="M5.821 4.91c3.898-2.765 9.469-2.539 13.073.536c3.667 3.127 4.168 8.238 1.152 11.897c-2.842 3.447-7.965 4.583-12.231 2.805l-.232-.101l-4.375.931l-.075.013l-.11.009l-.113-.004l-.044-.005l-.11-.02l-.105-.034l-.1-.044l-.076-.042l-.108-.077l-.081-.074l-.073-.083l-.053-.075l-.065-.115l-.042-.106l-.031-.113l-.013-.075l-.009-.11l.004-.113l.005-.044l.02-.11l.022-.072l1.15-3.451l-.022-.036C.969 12.45 1.97 7.805 5.59 5.079l.23-.168z"/></g>'},nt={width:24,height:24,body:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M0 0h24v24H0z"/><path fill="currentColor" d="M12 2a5 5 0 1 1-5 5l.005-.217A5 5 0 0 1 12 2zm2 12a5 5 0 0 1 5 5v1a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-1a5 5 0 0 1 5-5h4z"/></g>'},rt={width:24,height:24,body:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M0 0h24v24H0z"/><path fill="currentColor" d="M17 3.34A10 10 0 1 1 2 12l.005-.324A10 10 0 0 1 17 3.34zM12 6a1 1 0 0 0-1 1a3 3 0 1 0 0 6v2a1.024 1.024 0 0 1-.866-.398l-.068-.101a1 1 0 0 0-1.732.998a3 3 0 0 0 2.505 1.5H11a1 1 0 0 0 .883.994L12 18a1 1 0 0 0 1-1l.176-.005A3 3 0 0 0 13 11V9c.358-.012.671.14.866.398l.068.101a1 1 0 0 0 1.732-.998A3 3 0 0 0 13.161 7H13a1 1 0 0 0-1-1zm1 7a1 1 0 0 1 0 2v-2zm-2-4v2a1 1 0 0 1 0-2z"/></g>'},st={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M8 12a4 4 0 1 0 8 0a4 4 0 1 0-8 0"/><path d="M16 12v1.5a2.5 2.5 0 0 0 5 0V12a9 9 0 1 0-5.5 8.28"/></g>'},it={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m15 10l-4 4l6 6l4-16l-18 7l4 2l2 6l3-4"/>'},Z={comment:{icon:tt,bgColor:"rgba(239, 246, 255, 1)",color:"rgba(43, 127, 255, 1)"},like:{icon:"👍",bgColor:"rgba(244, 244, 245, 1)",color:"yellow",renderType:"emoji"},follow:{icon:nt,bgColor:"rgba(238, 242, 255, 1)",color:"rgba(97, 95, 255, 1)"},tips:{icon:rt,bgColor:"rgba(254, 252, 232, 1)",color:"rgba(240, 177, 0, 1)"},mention:{icon:st,bgColor:"rgba(244, 244, 245, 1)",color:"rgba(43, 127, 255, 1)"},assign:{icon:it,bgColor:"rgba(244, 244, 245, 1)",color:"rgba(43, 127, 255, 1)"}};de.propTypes={activity:n.oneOf(["comment","like","follow","tips","mention","assign"]).isRequired,size:n.number};function de({activity:e,size:r=32}){const s=Z[e]||Z.comment,i=s.icon;return t.jsx(_,{sx:{bgcolor:s.bgColor,color:s.color,width:r,height:r},children:s.renderType==="emoji"?t.jsx("span",{style:{fontSize:"14px"},children:i}):t.jsx(ne,{icon:i})})}const U={avatar:n.string,fullName:n.string,did:n.string};function W({actor:e,size:r,teamDid:s="",inService:i=!1,showName:l=!1}){const u=D(()=>({...e,avatar:e?.avatar?Ye(e.avatar,s,i):null}),[e,s,i]),m=d=>{e&&(d.stopPropagation(),window.open(We(J(Xe.WELLKNOWN_SERVICE_PATH_PREFIX,"user"),{did:e.did}),"_blank"),d.customPreventRedirect=!0)};return t.jsxs(g,{onClick:m,role:"button",style:{cursor:"pointer"},title:e?.fullName||"",sx:{display:"flex",alignItems:"center",gap:1},children:[u.avatar?t.jsx(Qe,{user:u,showDid:!0,cardType:Ke.AvatarOnly,infoType:Je.Minimal,avatarSize:r,shape:"circle",sx:{width:r,height:r,borderRadius:"100%",overflow:"hidden",transition:"transform 0.2s ease-in-out","&:hover":{transform:"scale(1.1)"}}}):t.jsx(_,{sx:{width:r,height:r}}),l&&t.jsx("span",{children:e?.fullName})]})}W.propTypes={actor:n.shape(U).isRequired,size:n.number.isRequired,teamDid:n.string,inService:n.bool,showName:n.bool};X.propTypes={actors:n.oneOfType([n.shape(U),n.arrayOf(n.shape(U))]).isRequired,size:n.number,maxDisplay:n.number,teamDid:n.string,inService:n.bool,showName:n.bool,avatarFallback:n.node};function X({actors:e,size:r=32,maxDisplay:s=9,teamDid:i="",inService:l=!0,showName:u=!1,avatarFallback:m=null}){const d=D(()=>{const p=Array.isArray(e)?e:[e];return Ue(p,"did").filter(Boolean)},[e]);return d.length===1||!d.length?t.jsx(W,{actor:d[0],size:r,teamDid:i,inService:l,showName:u}):t.jsx(we,{total:d.length,renderSurplus:p=>p<100?t.jsxs("span",{children:["+",p]}):t.jsx("span",{children:"99+"}),max:s,sx:{justifyContent:"flex-end",height:`${r}px`,".MuiAvatar-root":{width:`${r}px`,height:`${r}px`,fontSize:`${r/2.5}px`,border:0,zIndex:2}},children:d.map((p,y)=>p?.avatar?t.jsx(W,{actor:p,size:r,teamDid:i,inService:l},p?.did||y):m)})}const ee=3;pe.propTypes={notification:n.object.isRequired,isMultiple:n.bool,blocklet:n.object,mountPoint:n.string,avatarFallback:n.node};ue.propTypes={notification:n.object.isRequired,mountPoint:n.string};he.propTypes={items:n.array.isRequired,activity:n.object.isRequired,blocklet:n.object,mountPoint:n.string,viewMoreLink:n.string,avatarFallback:n.node};function ue({notification:e,mountPoint:r=""}){const{activity:s}=e,{type:i,meta:l={}}=s||{},u=oe({activity:s,users:[e?.actorInfo],actors:[e?.activity?.actor],mountPoint:r});return H(s)||!s.type||!s.actor||H(s.target)?null:t.jsxs(g,{children:[t.jsx(q,{variant:"body1",sx:{color:"text.secondary",mb:.5,wordBreak:"break-all"},children:u}),l?t.jsx(ae,{meta:l,type:i}):null]})}function he({items:e,activity:r,blocklet:s,mountPoint:i="",viewMoreLink:l="",avatarFallback:u=null}){const m=F(),{t:d}=Q(),p=D(()=>s?.did||s?.meta?.did||"",[s]),{locale:y}=o.useContext(re),v=D(()=>!H(r.meta)&&Object.values(r.meta).some(a=>a!=null),[r]),b=oe({activity:r,users:e.map(a=>a?.actorInfo),actors:e.map(a=>a?.activity?.actor),mountPoint:i}),k=O(a=>{if(!a.activity)return null;const x=se(a.activity);return x?.metaLink?ie(x?.metaLink)?x?.metaLink:J(i,x.metaLink):null}),R=O((a,x)=>{if(!x)return;const h=k(x);h&&(window.open(h,"_blank"),a.customPreventRedirect=!0)}),S=e.length>ee,w=e.slice(0,ee);return t.jsxs(g,{sx:{width:"100%"},children:[t.jsx(q,{variant:"body1",sx:{color:"text.secondary",mb:3},children:b}),v?t.jsxs(g,{className:"sub-content",sx:{display:"flex",flexDirection:"column",gap:3},children:[w.map(a=>t.jsxs(g,{onClick:x=>R(x,a),sx:{display:"flex",flexDirection:"column",gap:1},children:[t.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[V(a)?t.jsx(X,{actors:a.actorInfo,size:32,teamDid:p}):u,t.jsx(q,{variant:"subtitle1",sx:{color:"text.primary"},children:V(a)?a?.actorInfo?.fullName:"System"})," ","·",t.jsx(K,{value:a.createdAt,locale:y,shouldUpdate:!0,style:{color:m.palette.text.secondary,fontSize:"0.875rem",minWidth:"50px",whiteSpace:"nowrap"}})]}),a.activity.meta?t.jsx(g,{sx:{pl:5},children:t.jsx(ae,{meta:a.activity.meta,type:a.activity.type})}):null]},a.id)),S&&l?t.jsx(g,{sx:{mt:1,display:"flex",justifyContent:"center"},children:t.jsxs(ke,{size:"large",variant:"text",component:te,href:l,target:"_blank",rel:"noopener noreferrer",onClick:a=>{a.customPreventRedirect=!0},children:[d("notification.viewMore")," ",t.jsx(ne,{icon:Ee,style:{marginLeft:4}})]})}):null]}):null]})}function pe({notification:e,isMultiple:r=!1,blocklet:s,mountPoint:i="",avatarFallback:l}){const u=D(()=>{if(!e.activity)return null;const m=se(e.activity);return m?.targetLink?ie(m?.targetLink)?m?.targetLink:J(i,m.targetLink):null},[e.activity,i]);return r?t.jsx(he,{items:e.items,activity:e.activity,blocklet:s,mountPoint:i,viewMoreLink:u,avatarFallback:l}):t.jsx(ue,{notification:e,mountPoint:i})}function me({notification:e}){const r=o.useMemo(()=>{const{actions:s,action:i}=e;let l=s??[];return!l.length&&i&&(l=[{name:"Visit",link:i}]),l},[e]);return r.length?t.jsx(g,{sx:{display:"flex",justifyContent:"start",flexWrap:"wrap",alignItems:"center",gap:1},children:r.map((s,i)=>t.jsxs(o.Fragment,{children:[t.jsx(te,{href:s.link,target:"_blank",className:"link",rel:"noopener noreferrer",sx:{fontSize:"15px"},onClick:l=>{l.customPreventRedirect=!0},children:s.name},s.link),i<r.length-1?t.jsx(Ie,{orientation:"vertical",sx:{height:12,borderWidth:"1px"}}):null]},s.link))}):null}me.propTypes={notification:n.object.isRequired};const ot=Me(g)`
|
|
1
|
+
import{r as o}from"./vendor-react-CTtPmzVP.js";import{j as t,b2 as _,W as n,D as F,n as xe,bu as ye,br as be,cz as ve,cA as je,cB as we,ak as g,T as q,Q as ke,bb as te,a3 as Ie,s as Me,J as Ce,I as Re,at as Ae}from"./vendor-mui-core-DnR6WYuU.js";import{a as D,b as O,h as Te}from"./vendor-hooks-DpqqC65c.js";import{V as Q,b0 as Ne,z as ne,aT as re,b8 as Se}from"./vendor-ux-KtPBvlG0.js";import{t as $e}from"./server-logo-notext.svg-xZ-i1SpD.js";import{B as ze}from"./bundle-avatar-BSv_e0lp.js";import{a as Le,g as se,d as ie,u as oe,e as V,M as ae,f as Ee,m as De,h as Be,j as Pe,c as qe,i as Ve,k as _e,l as Fe,n as Oe,N as He}from"./team-D2fBm-il.js";import{a4 as Ue,J as We,C as J,a as H}from"./vendor-utils-BqKQizRf.js";import{ba as Qe,bb as Je,bc as Ke,c as Xe,Z as Ge}from"./index-DGg3AL9l.js";import{p as Ye}from"./util-pUhbKKIP.js";function le({blocklet:e,style:r={},size:s=40,...i}){const l=Le({blocklet:e,square:!0}),{variant:u}=i;return t.jsx(_,{variant:u||"square",style:Object.assign({backgroundColor:"transparent",width:s,height:s,borderRadius:10},r),...i,children:t.jsx("img",{src:l,alt:"",style:{width:s}})})}le.propTypes={blocklet:n.object.isRequired,style:n.object,size:n.oneOfType([n.number,n.string])};function Ze(e){return e.includes(" ")?new Date(e.replace(" ","T").replace(" ","")).getTime():new Date(e).getTime()}function K({value:e="",shouldUpdate:r=!1,...s}){const{locale:i}=Q(),[l,u]=o.useState(0);if(o.useEffect(()=>{let d;if(r){const p=new Date(e).getTime(),y=Date.now(),v=Math.abs(Math.floor((p-y)/1e3)),b=()=>{u(k=>{const R=Math.random()*1e3;return parseFloat((k+R).toFixed(4))})};v<60?d=setInterval(b,1e3):v<60*60?d=setInterval(b,6e4):d=setInterval(b,36e5)}return()=>{clearInterval(d)}},[e,l,r]),!e)return"-";const m=Ze(e);return t.jsx(Ne,{value:m,locale:i,...s})}K.propTypes={value:n.any,shouldUpdate:n.bool};const et={error:je,warning:ve,info:be,success:ye};ce.propTypes={severity:n.oneOf(["error","warning","info","success"]).isRequired,size:n.number};function ce({severity:e="info",size:r=32}){const s=F(),l=D(()=>({error:s.palette.error.main,warning:s.palette.warning.main,info:s.palette.info.main,success:s.palette.success.main}))[e],u=et[e],m=xe(l,.1);return t.jsx(_,{sx:{width:r,height:r,bgcolor:m,color:l},children:t.jsx(u,{fontSize:"small"})})}const tt={width:24,height:24,body:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M0 0h24v24H0z"/><path fill="currentColor" d="M5.821 4.91c3.898-2.765 9.469-2.539 13.073.536c3.667 3.127 4.168 8.238 1.152 11.897c-2.842 3.447-7.965 4.583-12.231 2.805l-.232-.101l-4.375.931l-.075.013l-.11.009l-.113-.004l-.044-.005l-.11-.02l-.105-.034l-.1-.044l-.076-.042l-.108-.077l-.081-.074l-.073-.083l-.053-.075l-.065-.115l-.042-.106l-.031-.113l-.013-.075l-.009-.11l.004-.113l.005-.044l.02-.11l.022-.072l1.15-3.451l-.022-.036C.969 12.45 1.97 7.805 5.59 5.079l.23-.168z"/></g>'},nt={width:24,height:24,body:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M0 0h24v24H0z"/><path fill="currentColor" d="M12 2a5 5 0 1 1-5 5l.005-.217A5 5 0 0 1 12 2zm2 12a5 5 0 0 1 5 5v1a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-1a5 5 0 0 1 5-5h4z"/></g>'},rt={width:24,height:24,body:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M0 0h24v24H0z"/><path fill="currentColor" d="M17 3.34A10 10 0 1 1 2 12l.005-.324A10 10 0 0 1 17 3.34zM12 6a1 1 0 0 0-1 1a3 3 0 1 0 0 6v2a1.024 1.024 0 0 1-.866-.398l-.068-.101a1 1 0 0 0-1.732.998a3 3 0 0 0 2.505 1.5H11a1 1 0 0 0 .883.994L12 18a1 1 0 0 0 1-1l.176-.005A3 3 0 0 0 13 11V9c.358-.012.671.14.866.398l.068.101a1 1 0 0 0 1.732-.998A3 3 0 0 0 13.161 7H13a1 1 0 0 0-1-1zm1 7a1 1 0 0 1 0 2v-2zm-2-4v2a1 1 0 0 1 0-2z"/></g>'},st={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M8 12a4 4 0 1 0 8 0a4 4 0 1 0-8 0"/><path d="M16 12v1.5a2.5 2.5 0 0 0 5 0V12a9 9 0 1 0-5.5 8.28"/></g>'},it={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m15 10l-4 4l6 6l4-16l-18 7l4 2l2 6l3-4"/>'},Z={comment:{icon:tt,bgColor:"rgba(239, 246, 255, 1)",color:"rgba(43, 127, 255, 1)"},like:{icon:"👍",bgColor:"rgba(244, 244, 245, 1)",color:"yellow",renderType:"emoji"},follow:{icon:nt,bgColor:"rgba(238, 242, 255, 1)",color:"rgba(97, 95, 255, 1)"},tips:{icon:rt,bgColor:"rgba(254, 252, 232, 1)",color:"rgba(240, 177, 0, 1)"},mention:{icon:st,bgColor:"rgba(244, 244, 245, 1)",color:"rgba(43, 127, 255, 1)"},assign:{icon:it,bgColor:"rgba(244, 244, 245, 1)",color:"rgba(43, 127, 255, 1)"}};de.propTypes={activity:n.oneOf(["comment","like","follow","tips","mention","assign"]).isRequired,size:n.number};function de({activity:e,size:r=32}){const s=Z[e]||Z.comment,i=s.icon;return t.jsx(_,{sx:{bgcolor:s.bgColor,color:s.color,width:r,height:r},children:s.renderType==="emoji"?t.jsx("span",{style:{fontSize:"14px"},children:i}):t.jsx(ne,{icon:i})})}const U={avatar:n.string,fullName:n.string,did:n.string};function W({actor:e,size:r,teamDid:s="",inService:i=!1,showName:l=!1}){const u=D(()=>({...e,avatar:e?.avatar?Ye(e.avatar,s,i):null}),[e,s,i]),m=d=>{e&&(d.stopPropagation(),window.open(We(J(Xe.WELLKNOWN_SERVICE_PATH_PREFIX,"user"),{did:e.did}),"_blank"),d.customPreventRedirect=!0)};return t.jsxs(g,{onClick:m,role:"button",style:{cursor:"pointer"},title:e?.fullName||"",sx:{display:"flex",alignItems:"center",gap:1},children:[u.avatar?t.jsx(Qe,{user:u,showDid:!0,cardType:Ke.AvatarOnly,infoType:Je.Minimal,avatarSize:r,shape:"circle",sx:{width:r,height:r,borderRadius:"100%",overflow:"hidden",transition:"transform 0.2s ease-in-out","&:hover":{transform:"scale(1.1)"}}}):t.jsx(_,{sx:{width:r,height:r}}),l&&t.jsx("span",{children:e?.fullName})]})}W.propTypes={actor:n.shape(U).isRequired,size:n.number.isRequired,teamDid:n.string,inService:n.bool,showName:n.bool};X.propTypes={actors:n.oneOfType([n.shape(U),n.arrayOf(n.shape(U))]).isRequired,size:n.number,maxDisplay:n.number,teamDid:n.string,inService:n.bool,showName:n.bool,avatarFallback:n.node};function X({actors:e,size:r=32,maxDisplay:s=9,teamDid:i="",inService:l=!0,showName:u=!1,avatarFallback:m=null}){const d=D(()=>{const p=Array.isArray(e)?e:[e];return Ue(p,"did").filter(Boolean)},[e]);return d.length===1||!d.length?t.jsx(W,{actor:d[0],size:r,teamDid:i,inService:l,showName:u}):t.jsx(we,{total:d.length,renderSurplus:p=>p<100?t.jsxs("span",{children:["+",p]}):t.jsx("span",{children:"99+"}),max:s,sx:{justifyContent:"flex-end",height:`${r}px`,".MuiAvatar-root":{width:`${r}px`,height:`${r}px`,fontSize:`${r/2.5}px`,border:0,zIndex:2}},children:d.map((p,y)=>p?.avatar?t.jsx(W,{actor:p,size:r,teamDid:i,inService:l},p?.did||y):m)})}const ee=3;pe.propTypes={notification:n.object.isRequired,isMultiple:n.bool,blocklet:n.object,mountPoint:n.string,avatarFallback:n.node};ue.propTypes={notification:n.object.isRequired,mountPoint:n.string};he.propTypes={items:n.array.isRequired,activity:n.object.isRequired,blocklet:n.object,mountPoint:n.string,viewMoreLink:n.string,avatarFallback:n.node};function ue({notification:e,mountPoint:r=""}){const{activity:s}=e,{type:i,meta:l={}}=s||{},u=oe({activity:s,users:[e?.actorInfo],actors:[e?.activity?.actor],mountPoint:r});return H(s)||!s.type||!s.actor||H(s.target)?null:t.jsxs(g,{children:[t.jsx(q,{variant:"body1",sx:{color:"text.secondary",mb:.5,wordBreak:"break-all"},children:u}),l?t.jsx(ae,{meta:l,type:i}):null]})}function he({items:e,activity:r,blocklet:s,mountPoint:i="",viewMoreLink:l="",avatarFallback:u=null}){const m=F(),{t:d}=Q(),p=D(()=>s?.did||s?.meta?.did||"",[s]),{locale:y}=o.useContext(re),v=D(()=>!H(r.meta)&&Object.values(r.meta).some(a=>a!=null),[r]),b=oe({activity:r,users:e.map(a=>a?.actorInfo),actors:e.map(a=>a?.activity?.actor),mountPoint:i}),k=O(a=>{if(!a.activity)return null;const x=se(a.activity);return x?.metaLink?ie(x?.metaLink)?x?.metaLink:J(i,x.metaLink):null}),R=O((a,x)=>{if(!x)return;const h=k(x);h&&(window.open(h,"_blank"),a.customPreventRedirect=!0)}),S=e.length>ee,w=e.slice(0,ee);return t.jsxs(g,{sx:{width:"100%"},children:[t.jsx(q,{variant:"body1",sx:{color:"text.secondary",mb:3},children:b}),v?t.jsxs(g,{className:"sub-content",sx:{display:"flex",flexDirection:"column",gap:3},children:[w.map(a=>t.jsxs(g,{onClick:x=>R(x,a),sx:{display:"flex",flexDirection:"column",gap:1},children:[t.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[V(a)?t.jsx(X,{actors:a.actorInfo,size:32,teamDid:p}):u,t.jsx(q,{variant:"subtitle1",sx:{color:"text.primary"},children:V(a)?a?.actorInfo?.fullName:"System"})," ","·",t.jsx(K,{value:a.createdAt,locale:y,shouldUpdate:!0,style:{color:m.palette.text.secondary,fontSize:"0.875rem",minWidth:"50px",whiteSpace:"nowrap"}})]}),a.activity.meta?t.jsx(g,{sx:{pl:5},children:t.jsx(ae,{meta:a.activity.meta,type:a.activity.type})}):null]},a.id)),S&&l?t.jsx(g,{sx:{mt:1,display:"flex",justifyContent:"center"},children:t.jsxs(ke,{size:"large",variant:"text",component:te,href:l,target:"_blank",rel:"noopener noreferrer",onClick:a=>{a.customPreventRedirect=!0},children:[d("notification.viewMore")," ",t.jsx(ne,{icon:Ee,style:{marginLeft:4}})]})}):null]}):null]})}function pe({notification:e,isMultiple:r=!1,blocklet:s,mountPoint:i="",avatarFallback:l}){const u=D(()=>{if(!e.activity)return null;const m=se(e.activity);return m?.targetLink?ie(m?.targetLink)?m?.targetLink:J(i,m.targetLink):null},[e.activity,i]);return r?t.jsx(he,{items:e.items,activity:e.activity,blocklet:s,mountPoint:i,viewMoreLink:u,avatarFallback:l}):t.jsx(ue,{notification:e,mountPoint:i})}function me({notification:e}){const r=o.useMemo(()=>{const{actions:s,action:i}=e;let l=s??[];return!l.length&&i&&(l=[{name:"Visit",link:i}]),l},[e]);return r.length?t.jsx(g,{sx:{display:"flex",justifyContent:"start",flexWrap:"wrap",alignItems:"center",gap:1},children:r.map((s,i)=>t.jsxs(o.Fragment,{children:[t.jsx(te,{href:s.link,target:"_blank",className:"link",rel:"noopener noreferrer",sx:{fontSize:"15px"},onClick:l=>{l.customPreventRedirect=!0},children:s.name},s.link),i<r.length-1?t.jsx(Ie,{orientation:"vertical",sx:{height:12,borderWidth:"1px"}}):null]},s.link))}):null}me.propTypes={notification:n.object.isRequired};const ot=Me(g)`
|
|
2
2
|
display: flex;
|
|
3
3
|
justify-content: center;
|
|
4
4
|
align-items: center;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as o}from"./vendor-mui-core-DnR6WYuU.js";import"./vendor-react-CTtPmzVP.js";import{S as t}from"./studio-D7UNnkpz.js";import"./vendor-ux-KtPBvlG0.js";import"./vendor-utils-BqKQizRf.js";import"./vendor-hooks-DpqqC65c.js";import"./lottie-web-4koyQiv_.js";import"./index-DriYV-w5.js";import"./index-DGg3AL9l.js";import"./vendor-arcblock-DRfhQ9Yl.js";function f(){return o.jsx(t,{children:"Coming soon..."})}export{f as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{at as fe,j as Y,W as te,J as Ye,bV as Xe,Q as Je,ak as _e,a6 as Le,d9 as Ze,y as Fe,bZ as We,M as Ue,c9 as Qe,z as et}from"./vendor-mui-core-DnR6WYuU.js";import{u as tt}from"./useLocalStorage-
|
|
1
|
+
import{at as fe,j as Y,W as te,J as Ye,bV as Xe,Q as Je,ak as _e,a6 as Le,d9 as Ze,y as Fe,bZ as We,M as Ue,c9 as Qe,z as et}from"./vendor-mui-core-DnR6WYuU.js";import{u as tt}from"./useLocalStorage-8LihN_xG.js";import{p as De,a as it,d as rt,g as Ne,r as oe,j as st}from"./vendor-react-CTtPmzVP.js";import{d as nt,n as Re}from"./vendor-utils-BqKQizRf.js";import{cm as ot,Z as $e,Q as at}from"./index-DGg3AL9l.js";import{V as ht,w as Ae,aJ as lt,H as ct}from"./vendor-ux-KtPBvlG0.js";import{B as dt}from"./bundle-avatar-BSv_e0lp.js";import"./vendor-arcblock-DRfhQ9Yl.js";import"./vendor-hooks-DpqqC65c.js";import"./lottie-web-4koyQiv_.js";var ye={exports:{}},Be;function ut(){return Be||(Be=1,function(G,V){(function(j,K){G.exports=K()})(globalThis,()=>(()=>{var j={4567:function(R,s,o){var d=this&&this.__decorate||function(e,i,a,f){var p,g=arguments.length,l=g<3?i:f===null?f=Object.getOwnPropertyDescriptor(i,a):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,i,a,f);else for(var m=e.length-1;m>=0;m--)(p=e[m])&&(l=(g<3?p(l):g>3?p(i,a,l):p(i,a))||l);return g>3&&l&&Object.defineProperty(i,a,l),l},_=this&&this.__param||function(e,i){return function(a,f){i(a,f,e)}};Object.defineProperty(s,"__esModule",{value:!0}),s.AccessibilityManager=void 0;const n=o(9042),c=o(9924),u=o(844),v=o(4725),h=o(2585),t=o(3656);let r=s.AccessibilityManager=class extends u.Disposable{constructor(e,i,a,f){super(),this._terminal=e,this._coreBrowserService=a,this._renderService=f,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let p=0;p<this._terminal.rows;p++)this._rowElements[p]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[p]);if(this._topBoundaryFocusListener=p=>this._handleBoundaryFocus(p,0),this._bottomBoundaryFocusListener=p=>this._handleBoundaryFocus(p,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new c.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(p=>this._handleResize(p.rows))),this.register(this._terminal.onRender(p=>this._refreshRows(p.start,p.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(p=>this._handleChar(p))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
2
2
|
`))),this.register(this._terminal.onA11yTab(p=>this._handleTab(p))),this.register(this._terminal.onKey(p=>this._handleKey(p.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this.register((0,t.addDisposableDomListener)(document,"selectionchange",()=>this._handleSelectionChange())),this.register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,u.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let i=0;i<e;i++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
3
3
|
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=n.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,i){this._liveRegionDebouncer.refresh(e,i,this._terminal.rows)}_renderRows(e,i){const a=this._terminal.buffer,f=a.lines.length.toString();for(let p=e;p<=i;p++){const g=a.lines.get(a.ydisp+p),l=[],m=g?.translateToString(!0,void 0,void 0,l)||"",E=(a.ydisp+p+1).toString(),x=this._rowElements[p];x&&(m.length===0?(x.innerText=" ",this._rowColumns.set(x,[0,1])):(x.textContent=m,this._rowColumns.set(x,l)),x.setAttribute("aria-posinset",E),x.setAttribute("aria-setsize",f))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,i){const a=e.target,f=this._rowElements[i===0?1:this._rowElements.length-2];if(a.getAttribute("aria-posinset")===(i===0?"1":`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==f)return;let p,g;if(i===0?(p=a,g=this._rowElements.pop(),this._rowContainer.removeChild(g)):(p=this._rowElements.shift(),g=a,this._rowContainer.removeChild(p)),p.removeEventListener("focus",this._topBoundaryFocusListener),g.removeEventListener("focus",this._bottomBoundaryFocusListener),i===0){const l=this._createAccessibilityTreeNode();this._rowElements.unshift(l),this._rowContainer.insertAdjacentElement("afterbegin",l)}else{const l=this._createAccessibilityTreeNode();this._rowElements.push(l),this._rowContainer.appendChild(l)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(i===0?-1:1),this._rowElements[i===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const e=document.getSelection();if(!e)return;if(e.isCollapsed)return void(this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection());if(!e.anchorNode||!e.focusNode)return void console.error("anchorNode and/or focusNode are null");let i={node:e.anchorNode,offset:e.anchorOffset},a={node:e.focusNode,offset:e.focusOffset};if((i.node.compareDocumentPosition(a.node)&Node.DOCUMENT_POSITION_PRECEDING||i.node===a.node&&i.offset>a.offset)&&([i,a]=[a,i]),i.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(i={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(i.node))return;const f=this._rowElements.slice(-1)[0];if(a.node.compareDocumentPosition(f)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(a={node:f,offset:f.textContent?.length??0}),!this._rowContainer.contains(a.node))return;const p=({node:m,offset:E})=>{const x=m instanceof Text?m.parentNode:m;let L=parseInt(x?.getAttribute("aria-posinset"),10)-1;if(isNaN(L))return console.warn("row is invalid. Race condition?"),null;const b=this._rowColumns.get(x);if(!b)return console.warn("columns is null. Race condition?"),null;let A=E<b.length?b[E]:b.slice(-1)[0]+1;return A>=this._terminal.cols&&(++L,A=0),{row:L,column:A}},g=p(i),l=p(a);if(g&&l){if(g.row>l.row||g.row===l.row&&g.column>=l.column)throw new Error("invalid range");this._terminal.select(g.column,g.row,(l.row-g.row)*this._terminal.cols-g.column+l.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let i=this._rowContainer.children.length;i<this._terminal.rows;i++)this._rowElements[i]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[i]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}};s.AccessibilityManager=r=d([_(1,h.IInstantiationService),_(2,v.ICoreBrowserService),_(3,v.IRenderService)],r)},3614:(R,s)=>{function o(c){return c.replace(/\r?\n/g,"\r")}function d(c,u){return u?"\x1B[200~"+c+"\x1B[201~":c}function _(c,u,v,h){c=d(c=o(c),v.decPrivateModes.bracketedPasteMode&&h.rawOptions.ignoreBracketedPasteMode!==!0),v.triggerDataEvent(c,!0),u.value=""}function n(c,u,v){const h=v.getBoundingClientRect(),t=c.clientX-h.left-10,r=c.clientY-h.top-10;u.style.width="20px",u.style.height="20px",u.style.left=`${t}px`,u.style.top=`${r}px`,u.style.zIndex="1000",u.focus()}Object.defineProperty(s,"__esModule",{value:!0}),s.rightClickHandler=s.moveTextAreaUnderMouseCursor=s.paste=s.handlePasteEvent=s.copyHandler=s.bracketTextForPaste=s.prepareTextForTerminal=void 0,s.prepareTextForTerminal=o,s.bracketTextForPaste=d,s.copyHandler=function(c,u){c.clipboardData&&c.clipboardData.setData("text/plain",u.selectionText),c.preventDefault()},s.handlePasteEvent=function(c,u,v,h){c.stopPropagation(),c.clipboardData&&_(c.clipboardData.getData("text/plain"),u,v,h)},s.paste=_,s.moveTextAreaUnderMouseCursor=n,s.rightClickHandler=function(c,u,v,h,t){n(c,u,v),t&&h.rightClickSelect(c),u.value=h.selectionText,u.select()}},7239:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const d=o(1505);s.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(_,n,c){this._css.set(_,n,c)}getCss(_,n){return this._css.get(_,n)}setColor(_,n,c){this._color.set(_,n,c)}getColor(_,n){return this._color.get(_,n)}clear(){this._color.clear(),this._css.clear()}}},3656:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(o,d,_,n){o.addEventListener(d,_,n);let c=!1;return{dispose:()=>{c||(c=!0,o.removeEventListener(d,_,n))}}}},3551:function(R,s,o){var d=this&&this.__decorate||function(r,e,i,a){var f,p=arguments.length,g=p<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,i):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(r,e,i,a);else for(var l=r.length-1;l>=0;l--)(f=r[l])&&(g=(p<3?f(g):p>3?f(e,i,g):f(e,i))||g);return p>3&&g&&Object.defineProperty(e,i,g),g},_=this&&this.__param||function(r,e){return function(i,a){e(i,a,r)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Linkifier=void 0;const n=o(3656),c=o(8460),u=o(844),v=o(2585),h=o(4725);let t=s.Linkifier=class extends u.Disposable{get currentLink(){return this._currentLink}constructor(r,e,i,a,f){super(),this._element=r,this._mouseService=e,this._renderService=i,this._bufferService=a,this._linkProviderService=f,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new c.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new c.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,u.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,u.toDisposable)(()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this.register((0,n.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,n.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(r){this._lastMouseEvent=r;const e=this._positionFromMouseEvent(r,this._element,this._mouseService);if(!e)return;this._isMouseOut=!1;const i=r.composedPath();for(let a=0;a<i.length;a++){const f=i[a];if(f.classList.contains("xterm"))break;if(f.classList.contains("xterm-hover"))return}this._lastBufferCell&&e.x===this._lastBufferCell.x&&e.y===this._lastBufferCell.y||(this._handleHover(e),this._lastBufferCell=e)}_handleHover(r){if(this._activeLine!==r.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(r,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,r)||(this._clearCurrentLink(),this._askForLink(r,!0))}_askForLink(r,e){this._activeProviderReplies&&e||(this._activeProviderReplies?.forEach(a=>{a?.forEach(f=>{f.link.dispose&&f.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=r.y);let i=!1;for(const[a,f]of this._linkProviderService.linkProviders.entries())e?this._activeProviderReplies?.get(a)&&(i=this._checkLinkProviderResult(a,r,i)):f.provideLinks(r.y,p=>{if(this._isMouseOut)return;const g=p?.map(l=>({link:l}));this._activeProviderReplies?.set(a,g),i=this._checkLinkProviderResult(a,r,i),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(r.y,this._activeProviderReplies)})}_removeIntersectingLinks(r,e){const i=new Set;for(let a=0;a<e.size;a++){const f=e.get(a);if(f)for(let p=0;p<f.length;p++){const g=f[p],l=g.link.range.start.y<r?0:g.link.range.start.x,m=g.link.range.end.y>r?this._bufferService.cols:g.link.range.end.x;for(let E=l;E<=m;E++){if(i.has(E)){f.splice(p--,1);break}i.add(E)}}}}_checkLinkProviderResult(r,e,i){if(!this._activeProviderReplies)return i;const a=this._activeProviderReplies.get(r);let f=!1;for(let p=0;p<r;p++)this._activeProviderReplies.has(p)&&!this._activeProviderReplies.get(p)||(f=!0);if(!f&&a){const p=a.find(g=>this._linkAtPosition(g.link,e));p&&(i=!0,this._handleNewLink(p))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!i)for(let p=0;p<this._activeProviderReplies.size;p++){const g=this._activeProviderReplies.get(p)?.find(l=>this._linkAtPosition(l.link,e));if(g){i=!0,this._handleNewLink(g);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(r){if(!this._currentLink)return;const e=this._positionFromMouseEvent(r,this._element,this._mouseService);e&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,e)&&this._currentLink.link.activate(r,this._currentLink.link.text)}_clearCurrentLink(r,e){this._currentLink&&this._lastMouseEvent&&(!r||!e||this._currentLink.link.range.start.y>=r&&this._currentLink.link.range.end.y<=e)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,u.disposeArray)(this._linkCacheDisposables))}_handleNewLink(r){if(!this._lastMouseEvent)return;const e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._linkAtPosition(r.link,e)&&(this._currentLink=r,this._currentLink.state={decorations:{underline:r.link.decorations===void 0||r.link.decorations.underline,pointerCursor:r.link.decorations===void 0||r.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,r.link,this._lastMouseEvent),r.link.decorations={},Object.defineProperties(r.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:i=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==i&&(this._currentLink.state.decorations.pointerCursor=i,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",i))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:i=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==i&&(this._currentLink.state.decorations.underline=i,this._currentLink.state.isHovered&&this._fireUnderlineEvent(r.link,i))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(i=>{if(!this._currentLink)return;const a=i.start===0?0:i.start+1+this._bufferService.buffer.ydisp,f=this._bufferService.buffer.ydisp+1+i.end;if(this._currentLink.link.range.start.y>=a&&this._currentLink.link.range.end.y<=f&&(this._clearCurrentLink(a,f),this._lastMouseEvent)){const p=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);p&&this._askForLink(p,!1)}})))}_linkHover(r,e,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!0),this._currentLink.state.decorations.pointerCursor&&r.classList.add("xterm-cursor-pointer")),e.hover&&e.hover(i,e.text)}_fireUnderlineEvent(r,e){const i=r.range,a=this._bufferService.buffer.ydisp,f=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-a-1,i.end.x,i.end.y-a-1,void 0);(e?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(f)}_linkLeave(r,e,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!1),this._currentLink.state.decorations.pointerCursor&&r.classList.remove("xterm-cursor-pointer")),e.leave&&e.leave(i,e.text)}_linkAtPosition(r,e){const i=r.range.start.y*this._bufferService.cols+r.range.start.x,a=r.range.end.y*this._bufferService.cols+r.range.end.x,f=e.y*this._bufferService.cols+e.x;return i<=f&&f<=a}_positionFromMouseEvent(r,e,i){const a=i.getCoords(r,e,this._bufferService.cols,this._bufferService.rows);if(a)return{x:a[0],y:a[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(r,e,i,a,f){return{x1:r,y1:e,x2:i,y2:a,cols:this._bufferService.cols,fg:f}}};s.Linkifier=t=d([_(1,h.IMouseService),_(2,h.IRenderService),_(3,v.IBufferService),_(4,h.ILinkProviderService)],t)},9042:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tooMuchOutput=s.promptLabel=void 0,s.promptLabel="Terminal input",s.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(R,s,o){var d=this&&this.__decorate||function(h,t,r,e){var i,a=arguments.length,f=a<3?t:e===null?e=Object.getOwnPropertyDescriptor(t,r):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(h,t,r,e);else for(var p=h.length-1;p>=0;p--)(i=h[p])&&(f=(a<3?i(f):a>3?i(t,r,f):i(t,r))||f);return a>3&&f&&Object.defineProperty(t,r,f),f},_=this&&this.__param||function(h,t){return function(r,e){t(r,e,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkProvider=void 0;const n=o(511),c=o(2585);let u=s.OscLinkProvider=class{constructor(h,t,r){this._bufferService=h,this._optionsService=t,this._oscLinkService=r}provideLinks(h,t){const r=this._bufferService.buffer.lines.get(h-1);if(!r)return void t(void 0);const e=[],i=this._optionsService.rawOptions.linkHandler,a=new n.CellData,f=r.getTrimmedLength();let p=-1,g=-1,l=!1;for(let m=0;m<f;m++)if(g!==-1||r.hasContent(m)){if(r.loadCell(m,a),a.hasExtendedAttrs()&&a.extended.urlId){if(g===-1){g=m,p=a.extended.urlId;continue}l=a.extended.urlId!==p}else g!==-1&&(l=!0);if(l||g!==-1&&m===f-1){const E=this._oscLinkService.getLinkData(p)?.uri;if(E){const x={start:{x:g+1,y:h},end:{x:m+(l||m!==f-1?0:1),y:h}};let L=!1;if(!i?.allowNonHttpProtocols)try{const b=new URL(E);["http:","https:"].includes(b.protocol)||(L=!0)}catch{L=!0}L||e.push({text:E,range:x,activate:(b,A)=>i?i.activate(b,A,x):v(0,A),hover:(b,A)=>i?.hover?.(b,A,x),leave:(b,A)=>i?.leave?.(b,A,x)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(g=m,p=a.extended.urlId):(g=-1,p=-1)}}t(e)}};function v(h,t){if(confirm(`Do you want to navigate to ${t}?
|
|
4
4
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as e,D as s}from"./vendor-ux-KtPBvlG0.js";const o=e("blocklet-services");s("blocklet-services");export{o as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,ak as p,T as I,W as r,am as F,Q as O,bt as pe,a6 as fe}from"./vendor-mui-core-DnR6WYuU.js";import{f as ue,a as ge,b as me,h as he}from"./vendor-hooks-DpqqC65c.js";import{r as X,u as we}from"./vendor-react-CTtPmzVP.js";import{u as xe,z as ye,s as ke,c as _,n as Pe,H as $,a as je,b as be,d as ve,e as M,W as Te,i as Ie}from"./index-DGg3AL9l.js";import{C as A,b as R,J as Ce,c as Le}from"./vendor-utils-BqKQizRf.js";import{o as _e}from"./vendor-arcblock-DRfhQ9Yl.js";import{$ as Re,J as We,V as G,Y as V,aa as Ae,Q as Ee,P as Ne,H as z,a5 as Se,al as B}from"./vendor-ux-KtPBvlG0.js";import{u as Ue}from"./use-passport-id-B-b-_oYF.js";import{g as J}from"./get-safe-url-CqIO9371.js";import{d as W}from"./logger-D3ELa8t7.js";import"./lottie-web-4koyQiv_.js";function Y({blocklet:c=window.blocklet}){return e.jsxs(p,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(Re,{variant:"rounded",shape:"square",did:c.appPid,src:c.appLogo,size:80}),e.jsx(I,{component:"h2",variant:"h6",children:c.appName}),e.jsx(We,{did:c.appPid})]})}const De=X.memo(Y);Y.propTypes={blocklet:r.shape({appName:r.string,appLogo:r.string,appPid:r.string})};const qe=()=>window.blocklet?.componentMountPoints?.find(s=>s.did==="z2qaCNvKMv5GjouKdcDWexv6WqtHbpNPQDnAk")?.mountPoint;function Z({children:c=null,cta:s=null,...i}){return e.jsxs(p,{...i,children:[c?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:c}):null,s?e.jsx(p,{sx:{display:"flex",flexDirection:"column",alignItems:"center",py:4,borderRadius:2},children:s}):null]})}Z.propTypes={children:r.node,cta:r.node};function ee({passports:c=[],onConnect:s=()=>{},redirect:i,...y}){const{t:f}=G(),k=qe(),P=a=>{const m=a?.payable;return k&&m?A(k,`/api/redirect/checkout/${m}?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(De,{}),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:c?.map(a=>{const m=P(a);return m?e.jsx(F,{title:f("login.accessLimit.buyPassport"),arrow:!0,placement:"top",children:e.jsx(O,{color:"primary",variant:"contained",endIcon:e.jsx(pe,{}),href:m,target:"_blank",children:a.title||a.name})},a.name):e.jsx(F,{title:f("login.connectWithPassport"),arrow:!0,placement:"top",children:e.jsx(O,{color:"inherit",variant:"contained",onClick:s,children:a.title||a.name})},a.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")})]})]})})]})}ee.propTypes={passports:r.arrayOf(r.shape({name:r.string.isRequired,title:r.string,payable:r.string})),onConnect:r.func,onClose:r.func,redirect:r.string.isRequired};function Xe(){const c=X.useRef(null),{session:s}=xe(),{t:i,locale:y}=G(),{getPassportId:f}=Ue(),k=we(),P=V(),a=Ae(),{encryptKey:m,decrypt:ne}=ye(),j=ue(s),{searchParams:o}=new URL(window.location.href),h={passportId:f()},E=o.get("componentId"),N=o.get("authenticated"),te=o.get("sessionToken"),oe=o.get("csrfToken"),ie=o.get("refreshToken"),se=o.get("requiredRoles"),u=o.get("redirect"),d=o.get("forceConnected"),b=o.get("sourceAppPid"),C=o.get("origin"),S=o.get("autoConnectWebview"),U=o.get("popup"),D=o.get("showQuickConnect");let w=o.get("inviter");if(!w&&u)try{w=(u.startsWith("http")?new URL(u):new URL(u,window.location.origin)).searchParams.get("inviter")}catch{}w=w||localStorage.getItem("inviter"),E&&(h.componentId=E),P&&(h.visitorId=P),w&&(h.inviter=w),Le(b)||(b==="null"?h.sourceAppPid=null:b!==null&&(h.sourceAppPid=b));let q=[];try{q=JSON.parse(se)}catch{}const re=async n=>{const t=o.get("fromWallet");W("login page notifyWallet",{data:n,fromWallet:t,"browser.wallet":a.wallet}),n&&String(t)==="1"&&a.wallet&&await Promise.any([B.asyncCall("arcSetToken",n),M(3e3)])},v=n=>n&&(o.get("encrypted")?ne(n):n),H=async n=>{n&&await re(n),setTimeout(()=>{if(u){const t=decodeURIComponent(u);t.startsWith(_.WELLKNOWN_SERVICE_PATH_PREFIX)?k(t,{replace:!0}):window.location.replace(J(t))}else window.location.replace(window.env.pathPrefix||"/")},50)},ce=n=>{const t={did:n.user.did,host:window.location.host,appPid:window.blocklet.appPid,visitorId:V(),sourceAppPid:n.user.sourceAppPid,fullName:n.user.fullName};W("bridge callArc: onLogin",t),B.callArc("onLogin",t)},Q=async(n,t)=>{const L=t(n.csrfToken),T=t(n.sessionToken),x=t(n.refreshToken),g=t(n.visitorId);W("login page onLogin",{result:n,decodeSessionToken:T,decodeRefreshToken:x,decodeVisitorId:g}),je(T),be(L),ve(x),n.visitorId&&Se(g),await s.refresh(),await M(100),ce(j.current);const l={};o.get("saveConnect")?(l.connected_did=j.current.user.did,l.connected_pk=j.current.user.pk,l.connected_wallet_os=j.current.walletOS,l.connected_app=Te()):(l.connected_did=o.get("connected_did"),l.connected_pk=o.get("connected_pk"),l.connected_app=o.get("connected_app"),l.connected_wallet_os=o.get("connected_wallet_os")),Ie(l,!0),H({sessionToken:T,refreshToken:x,visitorId:g})},ae=ge(()=>C==="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,C,i]),K=me(()=>{const n=window?.blocklet,t={className:"connect",popup:!1,action:"login",passkeyBehavior:"both",onSuccess:Q,onError:le,locale:y,messages:ae,extraParams:h,baseUrl:window.location.origin,prefix:A(window.location.origin,_.WELLKNOWN_SERVICE_PATH_PREFIX,ke)};d&&(t.forceConnected=d,t.extraParams.enableSwitchApp=!1,t.extraParams.forceConnected=d),t.options||(t.options={}),C==="switch-did"?t.options.showQuickConnect=!0:R(D)||([!1,"false"].includes(D)?t.options.showQuickConnect=!1:t.options.showQuickConnect=!0);const L=Ee();Ne()&&(t.extraParams.sourceAppPid=L.appPid);const x=A(window.location.origin,_.WELLKNOWN_SERVICE_PATH_PREFIX,"connect"),g={params:Pe(encodeURIComponent(JSON.stringify(t))),appPid:n?.appPid,appName:n?.appName,locale:y,redirect:window.location.href,_ek_:m};R(S)||(g.autoConnectWebview=S),R(U)||(g.popup=U),g.disableClose=!0;const l=J(Ce(x,g),{allowDomains:null});window.location.href=l});he(()=>{if(o.get("sessionToken")){const n=o.get("visitorId");if(!n){z.error("Unexpected login response from server: visitorId is required");return}Q({sessionToken:v(te),csrfToken:v(oe),refreshToken:v(ie),visitorId:v(n)},t=>t)}else!s.user||d&&s.user.did!==d?K():!N&&!o.get("sessionToken")&&H()});const le=n=>{z.error(n.message)},de=o.has("popup");if(s.loading||s.user){if(!N||o.get("sessionToken"))return e.jsxs(e.Fragment,{children:[e.jsx($,{children:e.jsx("title",{children:i("pageTitle.login")})}),e.jsx(_e,{children:de?null:e.jsx(fe,{})})]});const n=u?new URL(u,window.location.origin).href:window.location.href;return e.jsx(ee,{onConnect:K,passports:q,redirect:n})}return e.jsxs(e.Fragment,{children:[e.jsx($,{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:c})]})}export{Xe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,av as d,ak as r,T as m,aZ as p,Q as u}from"./vendor-mui-core-DnR6WYuU.js";import{g as x,l as f,h}from"./vendor-hooks-
|
|
1
|
+
import{j as e,av as d,ak as r,T as m,aZ as p,Q as u}from"./vendor-mui-core-DnR6WYuU.js";import{g as x,l as f,h}from"./vendor-hooks-DpqqC65c.js";import{j as c}from"./vendor-react-CTtPmzVP.js";import{g as j,c as y,k as w,f as C}from"./index-DGg3AL9l.js";import{V as v}from"./vendor-ux-KtPBvlG0.js";import{C as k}from"./vendor-utils-BqKQizRf.js";import"./vendor-arcblock-DRfhQ9Yl.js";import"./lottie-web-4koyQiv_.js";const M="authorization_response",A=j();function L(){const{t}=v(),[n]=c(),a=()=>{window.close()};return h(()=>{const i=n.get("state"),l=n.get("code"),s={type:M,response:{code:l}};if(window.opener)try{const o=new URL(i);window.opener.postMessage(s,o.origin),setTimeout(()=>{window.close()},2e3)}catch(o){console.error("Invalid login caller",o)}}),e.jsx(p,{severity:"success",children:e.jsxs(r,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignContent:"center",gap:1},children:[t("login.needManualClose"),e.jsx(r,{sx:{textAlign:"center"},children:e.jsx(u,{variant:"outlined",size:"small",onClick:a,children:t("login.closeWindow")})})]})})}function b(){const{blocklet:t}=window,[n]=c(),a=n.get("error"),i=n.get("error_description"),l=n.get("state"),s=x({errorMesage:"",loading:!0});f(async()=>{if(a)s.errorMesage=i,s.loading=!1;else try{const g=new URL(l);(await A.federated.getTrustedDomains()).includes(g.hostname)||(s.errorMesage="Invalid login caller")}catch{s.errorMesage="Invalid login caller"}finally{s.loading=!1}},[a,i,l]);const o=k(y.WELLKNOWN_SERVICE_PATH_PREFIX,`/blocklet/logo?&version=${t?.meta?.version||""}`);return e.jsx(d,{sx:{display:"flex",flexDirection:"column",minHeight:"100vh",justifyContent:"center",alignContent:"center"},children:e.jsxs(r,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,minHeight:"100vh",margin:"auto",paddingBottom:{sx:0,md:15}},children:[e.jsxs(r,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:.5},children:[e.jsx(r,{component:"img",src:o,alt:`${t?.appName||"site"} logo`,sx:{width:80}}),e.jsx(m,{variant:"h6",component:"p",children:t?.appName})]}),s.loading?s.errorMesage?e.jsx(w,{error:{message:s.errorMesage}}):e.jsx(L,{}):null,e.jsx(C,{sx:{mt:4}})]})})}export{b as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.__toCdnUrl("assets/vendor-ux-DYcPPYq2.css"),window.__toCdnUrl("assets/index-DrVXX4fX.css"),window.__toCdnUrl("assets/index-B5LvOF-F.css")])))=>i.map(i=>d[i]);
|
|
2
|
-
import{V as O,
|
|
2
|
+
import{V as O,bn as _,_ as k}from"./vendor-ux-KtPBvlG0.js";import{r as m}from"./vendor-react-CTtPmzVP.js";import{j as o,ak as u,at as q,W as e}from"./vendor-mui-core-DnR6WYuU.js";import{n as d,C as z}from"./vendor-utils-BqKQizRf.js";const C=m.lazy(()=>k(()=>import("./index-CmDzr29Q.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(t=>({default:t.Uploader}))),F="/blocklet/logo/upload",c=[".png",".jpg",".jpeg",".webp",".bmp",".ico"];function U({url:t,height:f=80,width:g="auto",enabled:s=!0,allowSVG:h=!0,type:r,did:a,prefix:b,headers:x=d,aspectRatio:n=1,minWidth:P=256,minHeight:R=256,onUploaded:j=d,children:l=null}){const{t:v,locale:w}=O(),i=m.useRef(null),p=()=>{i.current?.open()},y=()=>{j(),i.current?.close()},E={cursor:s?"pointer":"default","&::after":{content:`"${v("common.switch")}"`}};return o.jsxs(S,{id:`uploader-${a}-${r}`,children:[o.jsx(C,{ref:i,locale:w,popup:!0,onUploadFinish:y,plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:z(b,F,r,a),disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileExts:h?[...c,".svg"]:c,maxFileSize:1024*1024*5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,autoCropArea:1,aspectRatio:n,initialAspectRatio:n,croppedCanvasOptions:{minWidth:P,minHeight:R}}},tusProps:{headers:x}}),l?o.jsx(u,{onClick:p,children:l}):o.jsx(u,{className:_("uploader-wrapper",s&&"enabled"),sx:E,onClick:p,children:o.jsx("img",{alt:r,src:t,style:{width:g,height:f}})})]},`uploader-${a}-${r}`)}U.propTypes={url:e.string.isRequired,type:e.oneOf(["square","rect","favicon","splash-portrait","splash-landscape","og-image"]).isRequired,did:e.string.isRequired,prefix:e.string.isRequired,headers:e.func,onUploaded:e.func,height:e.number,width:e.any,enabled:e.bool,allowSVG:e.bool,aspectRatio:e.number,minWidth:e.number,minHeight:e.number,children:e.node};const S=q.div`
|
|
3
3
|
.uploader-wrapper {
|
|
4
4
|
display: inline-flex;
|
|
5
5
|
position: relative;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,at as $,W as v,J as R,ak as r,b2 as z,bu as U,T as N,bv as F,bw as X,bx as
|
|
1
|
+
import{j as e,at as $,W as v,J as R,ak as r,b2 as z,bu as U,T as N,bv as F,bw as X,bx as H,bb as V,av as B,by as G,bz as J,bA as O}from"./vendor-mui-core-DnR6WYuU.js";import{aT as Q,aa as q,w as I,_ as K,ar as Y,V as Z}from"./vendor-ux-KtPBvlG0.js";import{r as m}from"./vendor-react-CTtPmzVP.js";import{g as ee,z as te}from"./vendor-hooks-DpqqC65c.js";import{l as D,m as L,H as se,j as oe,a as ae,d as ne,b as re}from"./index-DGg3AL9l.js";import{V as ie}from"./vendor-utils-BqKQizRf.js";import{N as ce}from"./index-XVoTh0rZ.js";import{W as le}from"./did-address-DpdRECuJ.js";import{w as pe}from"./wrap-locale-C-cgVToU.js";import{u as de}from"./use-passport-id-B-b-_oYF.js";import{g as me}from"./get-safe-url-CqIO9371.js";import{c as ue}from"./passport-BeTGnBZp.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-DRfhQ9Yl.js";import"./index-A-uhNQXl.js";import"./create-passport-svg-Cs4mVLsE.js";function W({list:s=[],width:l=300,height:u=400,cardSpace:p=40,onSelect:i=()=>{},defaultIndex:f=0}){const[x,g]=m.useState(0),[o,d]=m.useState(0),w=m.useRef(null),b=n=>{if(n<0||n>s.length-1)return;g(n);const c=w.current.clientWidth;d(n*(l+p)-(c-l)/2+p*.5),i(n)};m.useEffect(()=>{b(f);const n=c=>c.preventDefault();w.current.addEventListener("touchmove",n,{passive:!1})},[]);let a;const k=n=>{a=n.touches[0].clientX},y=n=>{const c=n.changedTouches[0],j=a-c.clientX;Math.abs(j)>60&&(j>0?b(x+1):b(x-1))};return e.jsx(he,{ref:w,onTouchStart:k,onTouchEnd:y,children:e.jsx("div",{className:"card-container",style:{transform:`translate(${-o}px, 0)`},children:s.map((n,c)=>e.jsx("div",{className:`card-item ${c===x?"selected":""}`,style:{width:l,height:u,margin:p/2},onClick:()=>b(c),children:n.display?e.jsx("div",{className:"card-content",children:e.jsx(ce,{data:n.display,style:{width:"100%",height:"100%"}})}):e.jsx("div",{className:"card-content",dangerouslySetInnerHTML:{__html:n.src}})},n.id))})})}const he=$.div`
|
|
2
2
|
overflow: hidden;
|
|
3
3
|
mask-image: linear-gradient(to left, transparent, black 3%, black 97%, transparent);
|
|
4
4
|
overflow: hidden;
|
|
@@ -32,7 +32,7 @@ import{j as e,at as $,W as v,J as R,ak as r,b2 as z,bu as U,T as N,bv as F,bw as
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
`;W.propTypes={list:v.array,width:v.number,height:v.number,cardSpace:v.number,onSelect:v.func,defaultIndex:v.number};function fe({icon:s,active:l,completed:u}){const p={1:e.jsx(O,{className:"step-icon"}),2:e.jsx(
|
|
35
|
+
`;W.propTypes={list:v.array,width:v.number,height:v.number,cardSpace:v.number,onSelect:v.func,defaultIndex:v.number};function fe({icon:s,active:l,completed:u}){const p={1:e.jsx(O,{className:"step-icon"}),2:e.jsx(J,{className:"step-icon"}),3:e.jsx(G,{className:"step-icon"})},i=["step-icon-w"];return l&&i.push("step-icon-w--active"),u&&i.push("step-icon-w--completed"),e.jsx("div",{className:i.join(" "),children:p[String(s)]})}function xe({SessionContext:s,webWalletUrl:l,createPassportSvg:u,passportColor:p,onLogin:i,teamDid:f}){const{api:x}=m.useContext(s),g=R(t=>t.breakpoints.down("sm")),o=ee({user:null,passport:null,success:!1,activeStep:0}),d=m.useRef({sessionToken:"",refreshToken:"",csrfToken:""}),{setPassportId:w,clearPassportId:b}=de(),{t:a,locale:k}=m.useContext(Q),{wallet:y}=q(),[n,c]=m.useState(0),{searchParams:j}=new URL(window.location.href),P=()=>{o.activeStep++},A=t=>{o.user=t.user},E=()=>{P()},M=(t,h)=>{t?.passportId&&w(t.passportId),t?.sessionToken&&(d.current.sessionToken=h(t.sessionToken)),t?.refreshToken&&(d.current.refreshToken=h(t.refreshToken)),t?.csrfToken&&(d.current.csrfToken=h(t.csrfToken)),o.success=!0,P()},T=async()=>{if(y&&L()){K(()=>import("./index-m1ZQT0sU.js").then(h=>h.i),[],import.meta.url).then(h=>{h.call("arcClosePage")});return}ie(i)&&i({sessionToken:d.current.sessionToken,refreshToken:d.current.refreshToken,csrfToken:d.current.csrfToken});const t=j.get("redirect");if(t){window.location.replace(me(t));return}b(),window.location.replace("/")},_=t=>{o.passport=t.target.value},[S]=te({leftTime:n,onEnd:()=>{T()}}),C=[{label:a("lostPassport.recoverPassport"),content:()=>{if(!o.user){const t=j.get("scope")||"passport";return e.jsx(D,{popup:!0,open:!0,hideCloseButton:!0,className:"connect",action:"lost-passport-list",forceConnected:!1,autoConnect:!1,checkFn:x.get,checkTimeout:10*60*1e3,webWalletUrl:l,onSuccess:A,locale:k,messages:{title:a("lostPassport.recoverDialog.title"),scan:a("lostPassport.recoverDialog.scan"),confirm:a("lostPassport.recoverDialog.confirm"),success:a("lostPassport.recoverDialog.success")},extraParams:{scope:t}})}return e.jsxs(r,{className:"select-passport",children:[e.jsxs(r,{className:"user-info",sx:{my:1,display:"flex",alignItems:"center"},children:[e.jsx(z,{src:o.user.avatar,style:{width:48,height:48,backgroundColor:"transparent",marginRight:16}}),e.jsxs(r,{children:[e.jsx(r,{className:"name",children:o.user.fullName}),e.jsx(r,{className:"did",sx:{mt:1},children:e.jsx(le,{responsive:!g,compact:g,did:o.user.did})})]})]}),e.jsx(r,{children:e.jsx(W,{width:g?180:230,height:g?240:306,cardSpace:24,list:o.user.passportTypes.map(t=>({src:u({scope:t.scope,role:t.role,title:t.scope==="kyc"?t.name:t.title,issuer:t.issuer.name,issuerDid:t.issuer.id,ownerDid:o.user.did,ownerName:o.user.fullName,ownerAvatarUrl:o.user.avatar,preferredColor:p||"auto",extra:t.scope==="kyc"?{key:"Email",value:t.name}:void 0}),name:t.title,id:t.id,display:t.display})),onSelect:t=>_({target:{value:o.user.passportTypes[t].id}}),defaultIndex:0})}),e.jsx(r,{sx:{textAlign:"center"},children:e.jsx(I,{variant:"contained",color:"primary",onClick:()=>E(),disabled:!o.passport,children:a("common.next")})})]})}},{label:a("lostPassport.receivePassport"),content:()=>{const t={receiverDid:o.user.did,passportId:o.passport,teamDid:f||window?.blocklet?.did};return e.jsx(D,{popup:!0,open:!0,hideCloseButton:!0,className:"connect",action:"lost-passport-issue",checkFn:x.get,checkTimeout:10*60*1e3,webWalletUrl:l,onSuccess:M,forceConnected:!1,locale:k,messages:{title:`${a("lostPassport.receiveDialog.title")}`,scan:a("lostPassport.receiveDialog.scan"),confirm:a("lostPassport.receiveDialog.confirm"),success:a("lostPassport.receiveDialog.success")},extraParams:t})}},{label:a("common.complete"),content:()=>(n===0&&c(3e3),e.jsxs(r,{sx:{textAlign:"center"},children:[e.jsx(r,{sx:{mb:3,color:"success.main"},children:e.jsx(U,{style:{fontSize:60}})}),e.jsx(N,{component:"p",variant:"body1",className:"subheader",children:a("issuePassport.dialog.success")}),e.jsx(N,{component:"p",variant:"body2",color:"gray",children:y&&L()?a("issuePassport.dialog.autoClose",{seconds:Math.round(S/1e3)}):a("issuePassport.dialog.autoJump",{seconds:Math.round(S/1e3)})}),e.jsx(I,{style:{marginTop:40},variant:"contained",color:"primary",onClick:T,children:a("issuePassport.dialog.loginWithPassport")})]}))}];return e.jsx(ge,{children:e.jsxs(r,{className:"stepper",children:[e.jsx(F,{className:"stepper-progress",alternativeLabel:!0,activeStep:o.activeStep,children:C.map(({label:t})=>e.jsx(X,{children:e.jsx(H,{slots:{stepIcon:fe},children:t})},t))}),e.jsx(r,{className:"stepper-content",children:C[o.activeStep].content()}),!o.success&&e.jsx(r,{sx:{textAlign:"center",fontSize:12},children:e.jsx(V,{href:"/",sx:{color:"#4598FA",textDecoration:"none"},children:a("lostPassport.return")})})]})})}const ge=$(B)`
|
|
36
36
|
padding-top: 46px;
|
|
37
37
|
padding-bottom: 46px;
|
|
38
38
|
height: 100%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e}from"./vendor-react-CTtPmzVP.js";import{ar as r}from"./vendor-utils-
|
|
1
|
+
import{e}from"./vendor-react-CTtPmzVP.js";import{ar as r}from"./vendor-utils-BqKQizRf.js";const t=e(r);export{t as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./vendor-mui-core-DnR6WYuU.js";import{r as e}from"./vendor-react-CTtPmzVP.js";import{g as m}from"./get-safe-url-
|
|
1
|
+
import{j as s}from"./vendor-mui-core-DnR6WYuU.js";import{r as e}from"./vendor-react-CTtPmzVP.js";import{g as m}from"./get-safe-url-CqIO9371.js";import"./index-DGg3AL9l.js";import"./vendor-ux-KtPBvlG0.js";import"./vendor-utils-BqKQizRf.js";import"./vendor-hooks-DpqqC65c.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-DRfhQ9Yl.js";function S(){const r=e.useRef(null),n=e.useRef(Date.now());return e.useEffect(()=>{const t=`open-window-url-${new URLSearchParams(window.location.search).get("key")}`;return r.current=setInterval(()=>{if(Date.now()-n.current>10*1e3){localStorage.removeItem(t),clearInterval(r.current);return}const o=localStorage.getItem(t);if(o)try{const{url:a,time:i}=JSON.parse(o);localStorage.removeItem(t),Date.now()-i<10*1e3&&(window.location.href=m(a,{allowDomains:null}))}catch{}},200),()=>clearInterval(r.current)},[]),s.jsx("div",{})}export{S as default};
|
package/dist/assets/{over-due-invoice-payment-1EZsSUm4.js → over-due-invoice-payment-Dpy6U-OB.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as ge,j as t,b6 as h,aZ as ie,Q as q,T as
|
|
1
|
+
import{D as ge,j as t,b6 as h,aZ as ie,Q as q,T as k,bu as Ce}from"./vendor-mui-core-DnR6WYuU.js";import{r as d}from"./vendor-react-CTtPmzVP.js";import{V as je,aa as Se,aJ as ke,H as x}from"./vendor-ux-KtPBvlG0.js";import{C as w,d as we}from"./vendor-utils-BqKQizRf.js";import{q as Pe}from"./vendor-hooks-DpqqC65c.js";import{ap as De,aq as M,ar as Re,as as Ee,at as H,au as $e,av as Te,aw as _e,ax as ce,ay as Ie}from"./index-DGg3AL9l.js";const z=async r=>{if(!r.subscriptionId&&!r.customerId)throw new Error("Either subscriptionId or customerId must be provided");let f;return r.subscriptionId?f=`/api/subscriptions/${r.subscriptionId}/overdue/invoices`:f=`/api/customers/${r.customerId}/overdue/invoices`,(await $e.get(r.authToken?w(f,`?authToken=${r.authToken}`):f)).data};function Oe({subscriptionId:r=void 0,customerId:f=void 0,mode:O="default",dialogProps:g={open:!0},children:P=void 0,onPaid:N=()=>{},detailLinkOptions:y={enabled:!0},successToast:U=!0,alertMessage:V="",authToken:D=void 0}){const{t:n,locale:ae}=je(),W=Se()?.arcSphere,R=ge(),{connect:E,session:ue}=De(),[le,de]=d.useState(""),[J,v]=d.useState(!1),[me,$]=d.useState(g.open||!1),[pe,ye]=d.useState({}),[fe,p]=d.useState({}),[T,_]=d.useState({}),K=d.useRef(T),Q=r?"subscription":"customer",u=f||ue?.user?.did,Z=r||u,C=d.useRef(u);d.useEffect(()=>{K.current=T},[T]);const{data:c={summary:{},invoices:[]},error:G,loading:ve,runAsync:L}=Pe(()=>z({subscriptionId:r,customerId:u,authToken:D}),{ready:!!r||!!u,onSuccess:e=>{e.customer?.id&&e.customer?.id!==C.current&&(C.current=e.customer?.id)}}),I=d.useMemo(()=>r?w(M(),`/customer/subscription/${r}`):u?w(M(),"/customer/invoice/past-due"):"",[r,u]),l=d.useMemo(()=>c?.summary?Object.values(c.summary):[],[c?.summary]),X=async e=>{if(K.current[e])try{if((await z({subscriptionId:r,customerId:u,authToken:D})).invoices?.some(a=>a.currency_id===e))return;_(a=>{const m={...a};return delete m[e],m}),p(a=>({...a,[e]:"success"}))}catch(i){console.error("Error checking Stripe payment completion:",i);return}U&&(x.close(),x.success(n("payment.customer.invoice.paySuccess"))),v(!1),(await L()).invoices?.length===0&&($(!1),N(Z,e,Q))},he=we(e=>X(e),1e3,{leading:!1,trailing:!0,maxWait:5e3}),A=Re(),j=Ee("events"),xe=async e=>{let s=!1;return await Ie(async()=>(s=!(await z({subscriptionId:r,customerId:u,authToken:D})).invoices?.some(a=>a.currency_id===e),s),{interval:2e3,timeout:3*60*1e3}),s},Y=async(e,s=!1)=>{if(A||W)try{if(await xe(e)){p(a=>({...a,[e]:"success"}));const o=await L();U&&(x.close(),x.success(n("payment.customer.invoice.paySuccess"))),o.invoices?.length===0&&($(!1),N(Z,e,Q))}}catch(i){console.error("Check payment status failed:",i),p(o=>({...o,[e]:"error"}))}finally{v(!1)}else s&&(_(i=>({...i,[e]:!0})),p(i=>({...i,[e]:"processing"})))};d.useEffect(()=>{if(!j||A||W)return;const e=({response:s})=>{const o=`${r||s.customer_id}-${s.currency_id}`;(r&&s.subscription_id===r||u&&u===s.customer_id||C.current&&C.current===s.customer_id)&&(pe[o]||(ye(a=>({...a,[o]:1})),he(s.currency_id)))};return j.on("invoice.paid",e),()=>{j.off("invoice.paid",e)}},[j,r,u]);const ee=e=>{const{currency:s,method:i}=e;if(i.type==="stripe"){x.error(n("payment.subscription.overdue.notSupport"));return}if(!J&&(de(s.id),v(!0),p(o=>({...o,[s.id]:"idle"})),["arcblock","ethereum","base"].includes(i.type))){const o={currencyId:s.id};r?o.subscriptionId=r:u&&(o.customerId=u),E.open({locale:ae,containerEl:void 0,saveConnect:!1,action:"collect-batch",prefix:w(M(),"/api/did"),useSocket:!A,extraParams:o,messages:{scan:n("common.connect.defaultScan"),title:n("payment.customer.invoice.payBatch"),confirm:n("common.connect.confirm")},onSuccess:()=>{E.close(),Y(s.id),v(!1),p(a=>({...a,[s.id]:"success"}))},onClose:()=>{E.close(),v(!1)},onError:a=>{x.error(Te(a)),p(m=>({...m,[s.id]:"error"})),v(!1)}})}},S=()=>{$(!1),g.onClose?.()},te=e=>{y.onClick?(e.preventDefault(),y.onClick(e)):y.enabled||(e.preventDefault(),S())};if(ve)return null;const re=()=>y.title?y.title:n(r?"payment.subscription.overdue.view":"payment.customer.pastDue.view"),ne=(e,s=!0,i={variant:"contained"})=>{const{currency:o}=e,a=J&&le===o.id,m=fe[o.id]||"idle";if(m==="success")return t.jsx(q,{variant:i?.variant||"contained",size:"small",onClick:()=>X(o.id),...s?{}:{color:"success",startIcon:t.jsx(Ce,{})},children:n("payment.subscription.overdue.paid")});if(e.method.type==="stripe"){let B=n("payment.subscription.overdue.payNow");return m==="error"?B=n("payment.subscription.overdue.retry"):m==="processing"&&(B=n("payment.subscription.overdue.processing")),t.jsx(_e,{subscriptionId:r,customerId:r?void 0:u,currencyId:o.id,paymentMethod:e.method,onSuccess:()=>{Y(o.id,!0)},onError:()=>{p(b=>({...b,[o.id]:"error"})),_(b=>({...b,[o.id]:!1}))},children:(b,oe)=>t.jsx(ce,{variant:i?.variant||"contained",size:"small",disabled:oe||m==="processing",loading:oe||m==="processing",onClick:b,sx:i?.sx,children:B})})}return t.jsx(ce,{variant:i?.variant||"contained",size:"small",disabled:a,loading:a,onClick:()=>ee(e),sx:i?.sx,children:n(m==="error"?"payment.subscription.overdue.retry":"payment.subscription.overdue.payNow")})},F=e=>e.name&&e.type!=="arcblock"?` (${e.name})`:"",se=()=>{if(r&&c.subscription)return l.length===1?n("payment.subscription.overdue.title",{name:c.subscription?.description,count:c.invoices?.length,total:H(l[0]?.amount,l[0]?.currency?.decimal),symbol:l[0]?.currency?.symbol,method:F(l[0]?.method)}):n("payment.subscription.overdue.simpleTitle",{name:c.subscription?.description,count:c.invoices?.length});if(u){let e="";return l.length===1?e=n("payment.customer.overdue.title",{subscriptionCount:c.subscriptionCount||0,count:c.invoices?.length,total:H(l[0]?.amount,l[0]?.currency?.decimal),symbol:l[0]?.currency?.symbol,method:F(l[0]?.method)}):e=n("payment.customer.overdue.simpleTitle",{subscriptionCount:c.subscriptionCount||0,count:c.invoices?.length}),V?`${e}${V}`:`${e}${n("payment.customer.overdue.defaultAlert")}`}return""},be=()=>r&&c.subscription?n("payment.subscription.overdue.empty",{name:c.subscription?.description}):n("payment.customer.overdue.empty");return O==="custom"&&P&&typeof P=="function"?t.jsx(h,{children:P(ee,{subscription:c?.subscription,summary:c?.summary,invoices:c?.invoices,subscriptionCount:c?.subscriptionCount,detailUrl:I})}):t.jsx(ke,{PaperProps:{style:{minHeight:"auto"}},...g||{},open:me,title:g?.title||n("payment.subscription.overdue.pastDue"),sx:{"& .MuiDialogContent-root":{pt:0}},onClose:S,children:G?t.jsx(ie,{severity:"error",children:G.message}):t.jsxs(h,{sx:{gap:1},children:[l.length===0&&t.jsxs(t.Fragment,{children:[t.jsx(ie,{severity:"success",children:be()}),t.jsx(h,{direction:"row",sx:{justifyContent:"flex-end",mt:2},children:t.jsx(q,{variant:"outlined",color:"primary",onClick:S,sx:{width:"fit-content"},children:n("common.know")})})]}),l.length===1&&t.jsxs(t.Fragment,{children:[t.jsxs(k,{variant:"body1",sx:{color:"text.secondary"},children:[se(),y.enabled&&t.jsxs(t.Fragment,{children:[t.jsx("br",{}),n("payment.subscription.overdue.description"),t.jsx("a",{href:I,target:"_blank",onClick:te,rel:"noreferrer",style:{color:R.palette.text.link},children:re()})]})]}),t.jsxs(h,{direction:"row",sx:{justifyContent:"flex-end",gap:2,mt:2},children:[t.jsx(q,{variant:"outlined",color:"primary",onClick:S,children:n("common.cancel")}),ne(l[0])]})]}),l.length>1&&t.jsxs(t.Fragment,{children:[t.jsxs(k,{variant:"body1",sx:{color:"text.secondary"},children:[se(),y.enabled&&t.jsxs(t.Fragment,{children:[t.jsx("br",{}),n("payment.subscription.overdue.description"),t.jsx("a",{href:I,target:"_blank",rel:"noreferrer",onClick:te,style:{color:R.palette.text.link},children:re()})]})]}),t.jsx(k,{variant:"body1",sx:{color:"text.secondary"},children:n("payment.subscription.overdue.list")}),t.jsx(h,{children:l.map(e=>t.jsxs(h,{direction:"row",sx:{justifyContent:"space-between",alignItems:"center",py:1,px:.5,borderBottom:"1px solid",borderColor:"divider","&:hover":{backgroundColor:()=>R.palette.grey[100]},mt:0},children:[t.jsx(k,{children:n("payment.subscription.overdue.total",{total:H(e?.amount,e?.currency?.decimal),currency:e?.currency?.symbol,method:F(e?.method)})}),ne(e,!1,{variant:"text",sx:{color:"text.link"}})]},e?.currency?.id))})]})]})})}export{Oe as O};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t,co as O,ak as n,ar as N,bb as ne,at as W,c5 as oe,W as c,am as j,cF as se,T,b4 as L,bl as C}from"./vendor-mui-core-DnR6WYuU.js";import{r as u,a as ae}from"./vendor-react-CTtPmzVP.js";import{
|
|
1
|
+
import{j as t,co as O,ak as n,ar as N,bb as ne,at as W,c5 as oe,W as c,am as j,cF as se,T,b4 as L,bl as C}from"./vendor-mui-core-DnR6WYuU.js";import{r as u,a as ae}from"./vendor-react-CTtPmzVP.js";import{z as h,V as A,w as ie,b0 as re,aV as le}from"./vendor-ux-KtPBvlG0.js";import{d as ce}from"./keyboard-arrow-down-rounded-8U0_i9QO.js";import{f as E}from"./index-BojVbZw0.js";import{p as me}from"./dashboard-DHNx2Vjq.js";import{Z as de,Y as pe,ag as ue,T as he,aA as xe,c as _,q as ge,Q as D}from"./index-DGg3AL9l.js";import{v as fe}from"./index-CiQKtWIW.js";import{u as ve}from"./useAsyncRetry-v1aVMcV-.js";import{C as be}from"./vendor-utils-BqKQizRf.js";import{b as ke}from"./team-D2fBm-il.js";import{W as v}from"./did-address-DpdRECuJ.js";import{V as je}from"./status-B7-tZFw7.js";import{g as ye}from"./spaces-DKfk45f5.js";import"./vendor-hooks-DpqqC65c.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-DRfhQ9Yl.js";import"./session-Bavobyzn.js";import"./index-DBs9Ljax.js";import"./useSetState-L-f8mSga.js";import"./index-DriYV-w5.js";import"./over-due-invoice-payment-Dpy6U-OB.js";import"./useLocalStorage-8LihN_xG.js";import"./confirm-Dul9DyCY.js";import"./get-safe-url-CqIO9371.js";import"./passport-BeTGnBZp.js";import"./create-passport-svg-Cs4mVLsE.js";import"./useAsync-BSd-eaZO.js";import"./isURL-HdHdFI5D.js";import"./use-app-logo-BwsHVK-l.js";import"./omit-5AwbF-Ja.js";import"./api-2a4FTO9k.js";const we={width:24,height:24,body:'<path fill="currentColor" d="m12 10.8l-3.9 3.9q-.275.275-.7.275t-.7-.275q-.275-.275-.275-.7t.275-.7l4.6-4.6q.3-.3.7-.3t.7.3l4.6 4.6q.275.275.275.7t-.275.7q-.275.275-.7.275t-.7-.275L12 10.8Z"/>'},Se={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 17a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2zm12 0a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2zM9 5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2zM6 15v-1a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v1m-6-6v3"/>'},_e={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 7a4 4 0 1 0 8 0a4 4 0 1 0-8 0M3 21v-2a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v2m1-17.87a4 4 0 0 1 0 7.75M21 21v-2a4 4 0 0 0-3-3.85"/>'},Te={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M7 12h3v4H7z"/><path d="M10 6H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h16a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1h-6"/><path d="M10 4a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1zm4 12h2m-2-4h4"/></g>'},Ae={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M19.5 7A9 9 0 0 0 12 3a8.991 8.991 0 0 0-7.484 4"/><path d="M11.5 3a16.989 16.989 0 0 0-1.826 4M12.5 3a16.989 16.989 0 0 1 1.828 4M19.5 17a9 9 0 0 1-7.5 4a8.991 8.991 0 0 1-7.484-4"/><path d="M11.5 21a16.989 16.989 0 0 1-1.826-4m2.826 4a16.989 16.989 0 0 0 1.828-4M2 10l1 4l1.5-4L6 14l1-4m10 0l1 4l1.5-4l1.5 4l1-4M9.5 10l1 4l1.5-4l1.5 4l1-4"/></g>'},V={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M3 12a9 9 0 1 0 18 0a9 9 0 0 0-18 0"/><path d="M12 7v5l3 3"/></g>'},Ie={width:24,height:24,body:'<path fill="currentColor" d="M12 14q-.825 0-1.413-.588T10 12q0-.825.588-1.413T12 10q.825 0 1.413.588T14 12q0 .825-.588 1.413T12 14Zm0 7q-3.475 0-6.025-2.288T3.05 13H5.1q.35 2.6 2.313 4.3T12 19q2.925 0 4.963-2.038T19 12q0-2.925-2.038-4.963T12 5q-1.725 0-3.225.8T6.25 8H9v2H3V4h2v2.35q1.275-1.6 3.113-2.475T12 3q1.875 0 3.513.713t2.85 1.924q1.212 1.213 1.925 2.85T21 12q0 1.875-.713 3.513t-1.924 2.85q-1.213 1.212-2.85 1.925T12 21Z"/>'};function F({icon:e=void 0,value:s,name:o,url:i="",animated:l=!1,LinkComponent:p=ne,loading:x=!1}){const g=()=>ae.isValidElement(e)?e:t.jsx(n,{component:h,icon:e,alt:typeof o=="string"?o:"",sx:{fontSize:30}}),f=t.jsxs(O,{className:"metric__content",children:[e&&t.jsx(n,{className:"metric__icon",children:g()}),t.jsx(n,{className:"metric__title",children:o}),t.jsx(n,{className:"metric__value",children:u.isValidElement(s)?t.jsx(n,{className:`metric__number ${l?"metric__number--animated":""}`,children:s}):t.jsx(n,{className:`metric__number ${l?"metric__number--animated":""}`,dangerouslySetInnerHTML:{__html:s}})})]});return x?t.jsx(Q,{variant:"outlined",children:t.jsxs(O,{className:"metric__content",children:[e&&t.jsx(n,{className:"metric__icon",children:t.jsx(N,{variant:"circular",width:40,height:40})}),t.jsx(N,{className:"metric__title",variant:"rounded",width:120,height:20,sx:{mb:1}}),t.jsx(N,{className:`metric__number ${l?"metric__number--animated":""}`,variant:"rounded",width:100,height:"32px"})]})}):t.jsx(Q,{variant:"outlined",children:i?t.jsx(p,{href:i,sx:{textDecoration:"none",color:"inherit"},children:f}):f})}F.propTypes={icon:c.oneOfType([c.string,c.element]),value:c.oneOfType([c.string,c.element]).isRequired,name:c.oneOfType([c.string,c.element]).isRequired,url:c.string,animated:c.bool,LinkComponent:c.elementType,loading:c.bool};const Q=W(oe)`
|
|
2
2
|
height: 100%;
|
|
3
3
|
transition:
|
|
4
4
|
box-shadow 0.2s ease-in-out,
|
|
@@ -101,7 +101,7 @@ import{j as t,co as O,ak as n,ar as N,bb as ne,at as W,c5 as oe,W as c,am as j,c
|
|
|
101
101
|
opacity: 1;
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
`,b={oneSecond:1,oneMin:1*60,oneHour:1*60*60,oneDay:24*60*60},$e=(e,s)=>{const[o,i]=u.useState(0),l=g=>g>=b.oneDay?b.oneDay:g>=b.oneHour?b.oneHour:g>=b.oneMin?b.oneMin:b.oneSecond,[p,x]=u.useState(l(e/1e3));return u.useEffect(()=>{const g=setInterval(()=>{i(o+p);const f=l(e/1e3+o+p);p!==f&&x(f)},p*1e3);return()=>clearInterval(g)},[p,o]),u.useEffect(()=>{i(0),x(l(e/1e3))},[e]),s(e+o*1e3)};c.number.isRequired,c.func;const Ce={arcblock:"ArcBlock",ethereum:"Ethereum"};function K({source:e,migrated:s}){const{t:o}=A();return e?e.startsWith("managed")?t.jsxs(n,{sx:{display:"flex",alignItems:"center",gap:.5},children:[t.jsx(T,{children:e}),t.jsx(j,{title:o(s?"blocklet.skSourceMigratedTip":"blocklet.skSourceManagedTip"),children:t.jsx(C,{sx:{fontSize:16,color:s?"text.secondary":"warning.main"}})})]}):t.jsx(T,{children:e}):null}K.propTypes={source:c.string.isRequired,migrated:c.bool.isRequired};const Me=e=>{const{t:s}=A();let o=0,i=0;e&&(o=e.length,i=e.filter(p=>ge.isBlockletRunning(p)).length);let l=o;return i&&(l+=`<small>${s("common.running")} ${i}</small>`),l},ze=(e,s)=>{const{t:o}=A();return s.length?t.jsxs(n,{component:"small",children:[o("router.domainAlias.custom")," ",s.length]}):t.jsxs(n,{component:"small",sx:{display:"flex",alignItems:"center",gap:.5,color:s.length?"text.primary":"warning.main"},children:[o("router.domainAlias.noCustom"),t.jsx(j,{title:o("router.domainAlias.noCustomTip"),children:t.jsx(C,{sx:{fontSize:16}})})]})},Ne=(e,s)=>{const o=e===_.BACKUPS.STATUS.PROGRESS&&D().diff(s,"hours")>=_.BACKUPS.TIMEOUT_HOURS,i=e===_.BACKUPS.STATUS.PROGRESS&&!o;return e===_.BACKUPS.STATUS.SUCCEEDED&&!o?t.jsx(n,{sx:{width:8,height:8,borderRadius:"100%",bgcolor:"success.main"}}):i?t.jsx(n,{sx:{width:8,height:8,borderRadius:"100%",bgcolor:"error.main"}}):t.jsx(n,{sx:{width:8,height:8,borderRadius:"100%",bgcolor:"warning.main"}})},Ee=(e,s)=>{const{t:o,locale:i}=A(),l=s?.createdAt;return e&&l?t.jsxs(n,{sx:{display:"flex",alignItems:"baseline",gap:.5,color:D(l).add(1,"day").isAfter(D())?"text.primary":"warning.main"},children:[E(l,i==="tw"?"zh":i),t.jsx(j,{title:o("storage.spaces.backup.lastBackupTip",{time:E(l,i==="tw"?"zh":i)}),children:t.jsx(C,{sx:{fontSize:16}})})]}):t.jsxs(n,{sx:{display:"flex",alignItems:"baseline",gap:.5,color:"warning.main",fontSize:30},children:[o("storage.spaces.backup.noBackup"),t.jsx(j,{title:o("storage.spaces.backup.noBackupTip"),children:t.jsx(C,{sx:{fontSize:16}})})]})},k={fontSize:30,color:"text.primary"};function ht(){const{t:e,locale:s}=A(),{info:o,inService:i,api:l}=de(),{teamDid:p}=ke(),[x,g]=u.useState(!1),{did:f,blocklet:a}=pe(),m=ve(()=>l.getBlockletBaseInfo({input:{teamDid:p}})),{appDid:M,appPid:z,migratedFrom:y=[]}=a,B=a.environments.find(r=>r.key==="BLOCKLET_APP_CHAIN_TYPE")?.value,I=r=>typeof r!="number"||Number.isNaN(r)?"0":r>=1e4?new Intl.NumberFormat(s,{notation:"compact",compactDisplay:"short"}).format(r):new Intl.NumberFormat(s).format(r),q=[M?{name:e("blocklet.appId"),value:t.jsx(v,{did:M,showQrcode:!0})}:null,z&&M!==z?{name:t.jsxs(n,{children:[e("blocklet.appPid"),t.jsx(j,{title:e("blocklet.whyNeedAppPid"),style:{cursor:"help",fontSize:16},children:t.jsx(se,{sx:{verticalAlign:"middle",mt:"-2px",ml:"2px"}})})]}),value:t.jsx(v,{did:z,showQrcode:!0})}:null,y?.length>1?{name:e("blocklet.alsoKnownAs"),value:t.jsxs("div",{children:[(x?y.slice(1):y.slice(1,2)).map(r=>t.jsx(v,{did:r.appDid,showQrcode:!0})),y.length>2&&t.jsx(ie,{sx:{pl:0,"&:hover":{backgroundColor:"transparent"}},endIcon:x?t.jsx(h,{icon:we}):t.jsx(h,{icon:ce}),onClick:()=>g(!x),children:e(x?"common.collapseAll":"blocklet.router.showAllDIDs")})]})}:null,ue(a)?{name:"NFT",value:t.jsx(v,{external:!0,href:he(a?.controller?.chainHost,a?.controller?.nftId,"asset"),did:a?.controller?.nftId,showQrcode:!0})}:null,{name:e("common.owner"),value:a.settings?.owner?t.jsx(v,{did:a.settings.owner.did,showQrcode:!0}):"-"},a.vaults?.length?{name:e("blocklet.config.vault.name"),value:t.jsxs(n,{sx:{display:"flex",alignItems:"center",gap:.5,"& > span":{width:"auto"}},children:[t.jsx(v,{did:a.vaults[a.vaults.length-1].did,showQrcode:!0}),t.jsx(je,{vaults:a.vaults,appPid:a.appPid})]})}:null,{name:e("blocklet.installedAt"),value:a.installedAt?t.jsx(re,{value:a.installedAt,type:"all",locale:s}):"-"},{name:e("blocklet.config.walletType.name"),value:Ce[B||"arcblock"]||B},a.externalSkSource?{name:e("blocklet.skSource"),value:t.jsx(K,{source:a.externalSkSource,migrated:y.length>0})}:null].filter(Boolean);i&&q.push({name:e("common.serverDid"),value:t.jsx(v,{did:o.did,showQrcode:!0})},{name:e("common.serverVersion"),value:t.jsx(le,{children:o.version})});const Z=r=>r.map(d=>t.jsx(fe,{style:{display:"flex",alignItems:"flex-start"},valueComponent:"div",nameWidth:150,name:d.name,nameFormatter:()=>d.name,children:d.value},d.name)),G=Me(a.children),R=Number(m?.value?.appRuntimeInfo?.uptime||0),Y=$e(R,r=>me(r,{compact:!0,verbose:!0,locale:s==="tw"?"zh":s})),$=u.useMemo(()=>a?.site?.domainAliases||[],[a?.site?.domainAliases]),
|
|
104
|
+
`,b={oneSecond:1,oneMin:1*60,oneHour:1*60*60,oneDay:24*60*60},$e=(e,s)=>{const[o,i]=u.useState(0),l=g=>g>=b.oneDay?b.oneDay:g>=b.oneHour?b.oneHour:g>=b.oneMin?b.oneMin:b.oneSecond,[p,x]=u.useState(l(e/1e3));return u.useEffect(()=>{const g=setInterval(()=>{i(o+p);const f=l(e/1e3+o+p);p!==f&&x(f)},p*1e3);return()=>clearInterval(g)},[p,o]),u.useEffect(()=>{i(0),x(l(e/1e3))},[e]),s(e+o*1e3)};c.number.isRequired,c.func;const Ce={arcblock:"ArcBlock",ethereum:"Ethereum"};function K({source:e,migrated:s}){const{t:o}=A();return e?e.startsWith("managed")?t.jsxs(n,{sx:{display:"flex",alignItems:"center",gap:.5},children:[t.jsx(T,{children:e}),t.jsx(j,{title:o(s?"blocklet.skSourceMigratedTip":"blocklet.skSourceManagedTip"),children:t.jsx(C,{sx:{fontSize:16,color:s?"text.secondary":"warning.main"}})})]}):t.jsx(T,{children:e}):null}K.propTypes={source:c.string.isRequired,migrated:c.bool.isRequired};const Me=e=>{const{t:s}=A();let o=0,i=0;e&&(o=e.length,i=e.filter(p=>ge.isBlockletRunning(p)).length);let l=o;return i&&(l+=`<small>${s("common.running")} ${i}</small>`),l},ze=(e,s)=>{const{t:o}=A();return s.length?t.jsxs(n,{component:"small",children:[o("router.domainAlias.custom")," ",s.length]}):t.jsxs(n,{component:"small",sx:{display:"flex",alignItems:"center",gap:.5,color:s.length?"text.primary":"warning.main"},children:[o("router.domainAlias.noCustom"),t.jsx(j,{title:o("router.domainAlias.noCustomTip"),children:t.jsx(C,{sx:{fontSize:16}})})]})},Ne=(e,s)=>{const o=e===_.BACKUPS.STATUS.PROGRESS&&D().diff(s,"hours")>=_.BACKUPS.TIMEOUT_HOURS,i=e===_.BACKUPS.STATUS.PROGRESS&&!o;return e===_.BACKUPS.STATUS.SUCCEEDED&&!o?t.jsx(n,{sx:{width:8,height:8,borderRadius:"100%",bgcolor:"success.main"}}):i?t.jsx(n,{sx:{width:8,height:8,borderRadius:"100%",bgcolor:"error.main"}}):t.jsx(n,{sx:{width:8,height:8,borderRadius:"100%",bgcolor:"warning.main"}})},Ee=(e,s)=>{const{t:o,locale:i}=A(),l=s?.createdAt;return e&&l?t.jsxs(n,{sx:{display:"flex",alignItems:"baseline",gap:.5,color:D(l).add(1,"day").isAfter(D())?"text.primary":"warning.main"},children:[E(l,i==="tw"?"zh":i),t.jsx(j,{title:o("storage.spaces.backup.lastBackupTip",{time:E(l,i==="tw"?"zh":i)}),children:t.jsx(C,{sx:{fontSize:16}})})]}):t.jsxs(n,{sx:{display:"flex",alignItems:"baseline",gap:.5,color:"warning.main",fontSize:30},children:[o("storage.spaces.backup.noBackup"),t.jsx(j,{title:o("storage.spaces.backup.noBackupTip"),children:t.jsx(C,{sx:{fontSize:16}})})]})},k={fontSize:30,color:"text.primary"};function ht(){const{t:e,locale:s}=A(),{info:o,inService:i,api:l}=de(),{teamDid:p}=ke(),[x,g]=u.useState(!1),{did:f,blocklet:a}=pe(),m=ve(()=>l.getBlockletBaseInfo({input:{teamDid:p}})),{appDid:M,appPid:z,migratedFrom:y=[]}=a,B=a.environments.find(r=>r.key==="BLOCKLET_APP_CHAIN_TYPE")?.value,I=r=>typeof r!="number"||Number.isNaN(r)?"0":r>=1e4?new Intl.NumberFormat(s,{notation:"compact",compactDisplay:"short"}).format(r):new Intl.NumberFormat(s).format(r),q=[M?{name:e("blocklet.appId"),value:t.jsx(v,{did:M,showQrcode:!0})}:null,z&&M!==z?{name:t.jsxs(n,{children:[e("blocklet.appPid"),t.jsx(j,{title:e("blocklet.whyNeedAppPid"),style:{cursor:"help",fontSize:16},children:t.jsx(se,{sx:{verticalAlign:"middle",mt:"-2px",ml:"2px"}})})]}),value:t.jsx(v,{did:z,showQrcode:!0})}:null,y?.length>1?{name:e("blocklet.alsoKnownAs"),value:t.jsxs("div",{children:[(x?y.slice(1):y.slice(1,2)).map(r=>t.jsx(v,{did:r.appDid,showQrcode:!0})),y.length>2&&t.jsx(ie,{sx:{pl:0,"&:hover":{backgroundColor:"transparent"}},endIcon:x?t.jsx(h,{icon:we}):t.jsx(h,{icon:ce}),onClick:()=>g(!x),children:e(x?"common.collapseAll":"blocklet.router.showAllDIDs")})]})}:null,ue(a)?{name:"NFT",value:t.jsx(v,{external:!0,href:he(a?.controller?.chainHost,a?.controller?.nftId,"asset"),did:a?.controller?.nftId,showQrcode:!0})}:null,{name:e("common.owner"),value:a.settings?.owner?t.jsx(v,{did:a.settings.owner.did,showQrcode:!0}):"-"},a.vaults?.length?{name:e("blocklet.config.vault.name"),value:t.jsxs(n,{sx:{display:"flex",alignItems:"center",gap:.5,"& > span":{width:"auto"}},children:[t.jsx(v,{did:a.vaults[a.vaults.length-1].did,showQrcode:!0}),t.jsx(je,{vaults:a.vaults,appPid:a.appPid})]})}:null,{name:e("blocklet.installedAt"),value:a.installedAt?t.jsx(re,{value:a.installedAt,type:"all",locale:s}):"-"},{name:e("blocklet.config.walletType.name"),value:Ce[B||"arcblock"]||B},a.externalSkSource?{name:e("blocklet.skSource"),value:t.jsx(K,{source:a.externalSkSource,migrated:y.length>0})}:null].filter(Boolean);i&&q.push({name:e("common.serverDid"),value:t.jsx(v,{did:o.did,showQrcode:!0})},{name:e("common.serverVersion"),value:t.jsx(le,{children:o.version})});const Z=r=>r.map(d=>t.jsx(fe,{style:{display:"flex",alignItems:"flex-start"},valueComponent:"div",nameWidth:150,name:d.name,nameFormatter:()=>d.name,children:d.value},d.name)),G=Me(a.children),R=Number(m?.value?.appRuntimeInfo?.uptime||0),Y=$e(R,r=>me(r,{compact:!0,verbose:!0,locale:s==="tw"?"zh":s})),$=u.useMemo(()=>a?.site?.domainAliases||[],[a?.site?.domainAliases]),X=u.useMemo(()=>$.filter(r=>xe.isCustomDomain(r.value)),[$]),J=ze($,X),P=u.useMemo(()=>m?.value?.passport||{},[m?.value?.passport]),U=u.useMemo(()=>m?.value?.user||{},[m?.value?.user]),H=u.useMemo(()=>ye(a?.environments),[a?.environments]),ee=Ee(H,m?.value?.backup),w=(r,d)=>`${_.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/${r}/${d}`,S=r=>{const d=o?.routing?.adminPath;return be(d,`/blocklets/${f}/${r}`)},te=[{name:e("common.blocklets"),value:G,icon:t.jsx(n,{component:h,icon:Se,sx:k}),url:i?w("overview","components"):S("components")},{loading:m?.loading,name:e("common.members"),value:`${I(U?.users||0)}<small>${e("common.active")} ${I(U?.approvedUsers)}</small>`,icon:t.jsx(n,{component:h,icon:_e,sx:k}),url:i?w("did-connect","members"):S("members")},{loading:m?.loading,name:e("team.member.passports"),value:`${I(P?.passports||0)}<small>${e("common.active")} ${I(P?.activePassports)}</small>`,icon:t.jsx(n,{component:h,icon:Te,sx:k}),url:i?w("did-connect","passports"):S("passports")},{loading:m?.loading,name:e("common.domains"),value:t.jsxs(n,{sx:{display:"flex",alignItems:"baseline"},children:[$.length,J]}),icon:t.jsx(n,{component:h,icon:Ae,sx:k}),url:i?w("website","domains"):S("domains")},{loading:m?.loading,name:e("common.uptime"),value:R?Y:t.jsx(n,{sx:{fontSize:28,color:"text.secondary"},children:`${e("common.waiting")}...`}),icon:t.jsx(n,{component:h,icon:V,sx:k})},a.createdAt&&+new Date(a.createdAt)!=+new Date(0)?{name:e("common.created"),value:E(new Date(a.createdAt).getTime(),s==="tw"?"zh":s),icon:t.jsx(n,{component:h,icon:V,sx:k})}:null,{loading:m?.loading,name:t.jsxs(n,{sx:{display:"flex",alignItems:"baseline",gap:.5},children:[e("storage.spaces.backup.lastBackup"),m?.value?.backup&&H&&t.jsx(j,{children:Ne(m?.value?.backup?.status,m?.value?.backup?.createdAt)})]}),value:ee,icon:t.jsx(n,{component:h,icon:Ie,sx:k}),url:i?w("did-spaces","backups"):S("didSpaces")}].filter(Boolean);return t.jsxs(De,{component:"div",children:[t.jsxs(n,{className:"section",children:[t.jsx(T,{className:"section__header",color:"textPrimary",children:e("common.overview")}),t.jsx(L,{className:"page-metrics",container:!0,spacing:{xs:1,md:2},children:te.map(({icon:r,...d})=>t.jsx(L,{sx:{small:{ml:.5}},size:{xl:1.5,lg:3,md:4,sm:12,xs:12},children:t.jsx(F,{...d})},d.name))})]}),t.jsxs(n,{className:"section",children:[t.jsx(T,{className:"section__header",color:"textPrimary",children:e("common.basicInfo")}),t.jsx(n,{className:"basicInfo",children:Z(q)})]})]})}const De=W(T)`
|
|
105
105
|
.section {
|
|
106
106
|
display: flex;
|
|
107
107
|
flex-direction: column;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as r}from"./create-passport-svg-Cs4mVLsE.js";import{C as t}from"./vendor-utils-BqKQizRf.js";import{c as s}from"./index-DGg3AL9l.js";const e=o=>r({...o,issuerAvatarUrl:t(window.location.origin,s.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo")});export{e as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,b6 as b,b2 as k,T as m,am as q,W as s,s as T,U as $,ak as g,cI as f,cJ as x,cK as A,cL as N,cM as L,cN as R,cO as B}from"./vendor-mui-core-DnR6WYuU.js";import{V as h,
|
|
1
|
+
import{j as t,b6 as b,b2 as k,T as m,am as q,W as s,s as T,U as $,ak as g,cI as f,cJ as x,cK as A,cL as N,cM as L,cN as R,cO as B}from"./vendor-mui-core-DnR6WYuU.js";import{V as h,b0 as F,ay as S}from"./vendor-ux-KtPBvlG0.js";import{ba as E,bb as P,bc as V}from"./index-DGg3AL9l.js";import{U as G}from"./ua-parser-DP5omx3I.js";import{a as w}from"./vendor-react-CTtPmzVP.js";import{a as H}from"./vendor-hooks-DpqqC65c.js";import{W as j}from"./did-address-DpdRECuJ.js";import{p as J}from"./util-pUhbKKIP.js";import{b as K}from"./team-D2fBm-il.js";function Y(e){return!e||typeof e!="string"?"break-all":e.includes(" ")?"break-word":"break-all"}function C({logo:e="",name:r="",description:n="",size:l=40,variant:a="rounded",sx:d={},className:p="",logoName:u="",tooltip:o=null}){const i={width:l,height:l,...d},y=typeof r=="string"?r:e,v=t.jsxs(b,{direction:"row",spacing:1,className:`info-card-wrapper ${p}`,sx:{alignItems:"center",cursor:o?"pointer":"default"},children:[e?t.jsx(k,{src:e,alt:u??y,variant:a,sx:i}):t.jsx(k,{variant:a,sx:i,children:y?.slice(0,1)}),t.jsxs(b,{direction:"column",sx:{alignItems:"flex-start",justifyContent:"space-around",wordBreak:Y(r),minWidth:{xs:100,sm:140}},children:[t.jsx(m,{variant:"body1",component:"div",sx:{color:"text.primary"},children:r}),n&&t.jsx(m,{variant:"subtitle1",sx:{color:"text.secondary"},children:n})]})]});return o?t.jsx(q,{title:o,placement:"top-start",slotProps:{tooltip:{sx:{bgcolor:c=>c.palette.mode==="dark"?"#2a2e37":"#ffffff",color:c=>c.palette.mode==="dark"?"#ffffff":c.palette.text.primary,boxShadow:"0 2px 10px rgba(0, 0, 0, 0.15)",borderRadius:2,padding:"10px 16px",fontSize:14,maxWidth:400,minWidth:240,wordBreak:"break-word",border:c=>c.palette.mode==="dark"?"1px solid #3a3f48":"1px solid #e0e0e0","& .MuiTooltip-arrow":{color:c=>c.palette.mode==="dark"?"#2a2e37":"#ffffff","&::before":{border:c=>c.palette.mode==="dark"?"1px solid #3a3f48":"1px solid #e0e0e0",backgroundColor:c=>c.palette.mode==="dark"?"#2a2e37":"#ffffff"}}}}},children:v}):v}C.propTypes={logo:s.string,name:s.oneOfType([s.string,s.node]).isRequired,description:s.oneOfType([s.string,s.node]),size:s.oneOfType([s.number,s.string]),variant:s.oneOf(["square","rounded","circular"]),sx:s.object,className:s.string,logoName:s.string,tooltip:s.oneOfType([s.string,s.node])};function _(e){try{if(!e.trim())return{device:{icon:t.jsx(x,{fontSize:"small"}),text:"Unknown Device"},os:{icon:null,text:"Unknown OS"},browser:{icon:t.jsx(f,{fontSize:"small"}),text:"Unknown Browser"}};const n=new G(e).getResult();let l="";const a=e.split(/\s+/).find(o=>o.startsWith("arcwallet"));if(a){const o=a.split("/");o.length>1&&S.coerce(o[1])&&(l=S.coerce(o[1]).version)}const d=(()=>{const{type:o="",model:i=""}=n.device;return o==="mobile"?{icon:t.jsx(A,{fontSize:"small"}),text:i||"Mobile Device"}:o==="tablet"?{icon:t.jsx(N,{fontSize:"small"}),text:i||"Tablet"}:{icon:t.jsx(L,{fontSize:"small"}),text:i||"Desktop"}})(),p=(()=>{const{name:o="",version:i=""}=n.os;return o.toLowerCase().includes("mac")?{icon:t.jsx(R,{fontSize:"small"}),text:`${o} ${i}`}:o.toLowerCase().includes("ios")?{icon:t.jsx(R,{fontSize:"small"}),text:`${o} ${i}`}:o.toLowerCase().includes("android")?{icon:t.jsx(B,{fontSize:"small"}),text:`${o} ${i}`}:o.toLowerCase().includes("windows")?{icon:t.jsx(x,{fontSize:"small"}),text:`${o} ${i}`}:{icon:null,text:o?`${o} ${i}`:"Unknown OS"}})(),u=(()=>{const{name:o="",version:i=""}=n.browser;return{icon:t.jsx(f,{fontSize:"small"}),text:o?`${o} ${i}`:"Unknown Browser"}})();return{device:d,os:p,browser:u,...l?{walletVersion:{icon:null,text:l}}:{}}}catch(r){return console.error("Error parsing user agent:",r),{device:{icon:t.jsx(x,{fontSize:"small"}),text:"Unknown Device"},os:{icon:null,text:"Unknown OS"},browser:{icon:t.jsx(f,{fontSize:"small"}),text:"Unknown Browser"}}}}function z({ua:e}){const r=_(e);return t.jsx(b,{spacing:1,children:Object.entries(r).map(([n,{icon:l,text:a}])=>t.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[t.jsx(g,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:l}),t.jsx(m,{variant:"body2",sx:{display:"flex"},children:a})]},n))})}z.propTypes={ua:s.string.isRequired};const Q=()=>{const{t:e}=h(),r={$all:e("common.all"),owner:"Owner",admin:"Admin",member:"Member",guest:"Guest"};return{SYSTEM_ROLES:r,formatRoleName:l=>{const a=(l||"").toLowerCase();return a.startsWith("$")?r[a]||a.slice(1):r[a]||a}}},X=(e,r=!1)=>{const n=r?1:.6;switch(e){case"owner":return`rgba(232, 222, 255, ${n})`;case"admin":return`rgba(227, 242, 253, ${n})`;case"member":return`rgba(232, 245, 233, ${n})`;case"guest":return`rgba(245, 245, 245, ${n})`;default:return`rgba(245, 245, 245, ${n})`}},Z=T($)(({role:e})=>({backgroundColor:X(e.toLowerCase()),color:"#000000"})),ee=e=>{switch(e){case"valid":return r=>r.palette.success.light;case"expired":return r=>r.palette.text.disabled;case"revoked":return r=>r.palette.error.light;default:return r=>r.palette.warning.light}},re=T($)(({theme:e,status:r})=>({backgroundColor:ee(r)(e),color:"#FFFFFF"}));function U({did:e}){return t.jsx(j,{size:14,responsive:!1,compact:!0,copyable:!1,did:e})}U.propTypes={did:s.string.isRequired};function I({timestamp:e,locale:r}){return t.jsx(g,{sx:{minWidth:"100px"},children:t.jsx(F,{value:e,locale:r})})}I.propTypes={timestamp:s.number.isRequired,locale:s.string.isRequired};function O({name:e="",role:r}){const{formatRoleName:n}=Q();return t.jsx(Z,{label:n(e||r),size:"small",role:e||r,sx:{borderRadius:1}})}O.propTypes={role:s.string.isRequired,name:s.string};function W({status:e}){const{t:r}=h();return t.jsx(re,{label:r(`team.passport.statusMap.${e}`),size:"small",status:e,sx:{borderRadius:1}})}W.propTypes={status:s.string.isRequired};function D({source:e}){const{t:r}=h();return e?r(`team.passport.sourceMaps.${e}`):"-"}D.propTypes={source:s.string.isRequired};function M({user:e,size:r="default",tooltip:n=!1,inService:l=!1}){const{teamDid:a}=K(),d=w.useMemo(()=>J(e.avatar,a,l),[e.avatar,a,l]),p=w.useMemo(()=>t.jsx(j,{did:e?.did,compact:!0,responsive:!1,sx:{whiteSpace:"nowrap"},size:12}),[e?.did]),u=H(()=>({...e,avatar:d}),[e,d]);return r==="small"?t.jsx(C,{variant:"circular",logo:d,name:t.jsx(m,{sx:{maxWidth:320,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},className:"customer-link-name",children:e.fullName||e.email}),...r==="small"?{tooltip:n?t.jsx(j,{did:e?.did}):!1,size:24}:{description:p,size:36}}):t.jsx(E,{user:u,avatarSize:r==="small"?24:36,cardType:V.Detailed,infoType:P.Minimal,sx:{padding:0,border:"none"},showDid:!0,didProps:{compact:!0,responsive:!1},showHoverCard:!1})}M.propTypes={user:s.object.isRequired,size:s.string,tooltip:s.bool,inService:s.bool};const te=w.memo(M),ue=e=>t.jsx(U,{did:e}),me=(e,r)=>t.jsx(O,{name:e,role:r}),fe=e=>t.jsx(W,{status:e}),xe=(e,r)=>t.jsx(I,{timestamp:e,locale:r}),be=e=>t.jsx(D,{source:e}),ge=(e,r=!1)=>t.jsx(te,{user:e,inService:r}),we=e=>t.jsx(z,{ua:e});export{ge as a,fe as b,xe as c,be as d,we as e,ue as f,me as r,Q as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as l,W as n}from"./vendor-mui-core-DnR6WYuU.js";import{u as m}from"./session-
|
|
1
|
+
import{j as l,W as n}from"./vendor-mui-core-DnR6WYuU.js";import{u as m}from"./session-Bavobyzn.js";function c({permission:i="",role:t="",component:e=null,children:o=null}){const{session:r}=m();let s=!0;const u=[].concat(i).filter(Boolean),f=[].concat(t).filter(Boolean);if(u.length){const p=r.user&&r.user.permissions||[];s=u.some(a=>p.includes(a))}return s&&f.length&&(s=f.includes(r.user.role)),typeof e=="function"?e(s):typeof o=="function"?o(s):s&&(e||o)||null}function x(i,t,e){return function(r){return l.jsx(c,{permission:t,role:e,children:s=>l.jsx(i,{...r,hasPermission:s})})}}c.propTypes={permission:n.oneOfType([n.string,n.arrayOf(n.string)]),role:n.oneOfType([n.string,n.arrayOf(n.string)]),component:n.oneOfType([n.func,n.node]),children:n.oneOfType([n.func,n.node])};export{c as P,x as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as o}from"./vendor-mui-core-DnR6WYuU.js";import{C as t}from"./vendor-utils-
|
|
1
|
+
import{j as o}from"./vendor-mui-core-DnR6WYuU.js";import{C as t}from"./vendor-utils-BqKQizRf.js";import{I as s}from"./iframe-dmFx9kP7.js";import{c as e}from"./index-DGg3AL9l.js";import{S as m}from"./studio-D7UNnkpz.js";import"./vendor-react-CTtPmzVP.js";import"./vendor-ux-KtPBvlG0.js";import"./vendor-hooks-DpqqC65c.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-DRfhQ9Yl.js";import"./index-DriYV-w5.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as r}from"./vendor-mui-core-DnR6WYuU.js";import{$ as o}from"./user-center-9ue_tdF_.js";import{H as i}from"./index-DGg3AL9l.js";import{V as e}from"./vendor-ux-KtPBvlG0.js";import"./vendor-react-CTtPmzVP.js";import"./vendor-hooks-DpqqC65c.js";import"./vendor-utils-BqKQizRf.js";import"./index-B6IM_Z38.js";import"./arrow-down.svg-C4FUKwt4.js";import"./revoke.svg-CNl4LAbv.js";import"./index-XVoTh0rZ.js";import"./index-Ck7gs4Oo.js";import"./vendor-arcblock-DRfhQ9Yl.js";import"./index-Bh8glecC.js";import"./index-DRYJ0xIl.js";import"./index-BojVbZw0.js";import"./index-CeGNmiXz.js";import"./lottie-web-4koyQiv_.js";function R(){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{R as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{J as n,j as i,ak as l}from"./vendor-mui-core-DnR6WYuU.js";import{m as d,r as c}from"./vendor-react-CTtPmzVP.js";import{V as u,
|
|
1
|
+
import{J as n,j as i,ak as l}from"./vendor-mui-core-DnR6WYuU.js";import{m as d,r as c}from"./vendor-react-CTtPmzVP.js";import{V as u,aJ as h}from"./vendor-ux-KtPBvlG0.js";import g from"./index-DzDWMabe.js";import"./vendor-utils-BqKQizRf.js";import"./vendor-hooks-DpqqC65c.js";import"./lottie-web-4koyQiv_.js";import"./index-DGg3AL9l.js";import"./vendor-arcblock-DRfhQ9Yl.js";import"./confirm-Dul9DyCY.js";import"./index-DBs9Ljax.js";import"./session-Bavobyzn.js";import"./did-address-DpdRECuJ.js";import"./empty-spinner-BYDonf35.js";import"./bundle-avatar-BSv_e0lp.js";import"./shorten-label-C4py9TLA.js";import"./list-header-Cl3jykCe.js";import"./click-to-copy-03_3P1nz.js";import"./question-mark-circle.svg-CByEVDhb.js";import"./useSetState-L-f8mSga.js";import"./engine-BaNtB6sW.js";import"./api-2a4FTO9k.js";import"./vendor-mui-x-CQc01l4r.js";import"./react-beautiful-dnd.esm-By1RE6ef.js";import"./raf-schd.esm-XXBRsnmf.js";import"./wait-connect-BwtwczC4.js";import"./get-safe-url-CqIO9371.js";import"./item-D8-oGTEp.js";import"./delete-confirm-BT4RGlre.js";import"./index-Ck7gs4Oo.js";import"./index-B0Q9wWG1.js";import"./index-CRAuhYSg.js";const r=new URL(window.location.href),s=r.searchParams.get("mode")==="dialog",w=s?"":r.searchParams.get("padding")||"";function T(){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{T as default};
|