@abtnode/blocklet-services 1.16.44-beta-20250529-223630-10e16ac8 → 1.16.44-beta-20250601-083116-288e5ea5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/routes/blocklet.js +3 -1
- package/api/services/static.js +37 -6
- package/dist/assets/{AdapterDayjs-CDDcwz3P.js → AdapterDayjs-Dy2dI4ee.js} +1 -1
- package/dist/assets/{ArrowDropDown-DPqiF9Rw.js → ArrowDropDown-D8DSLfND.js} +1 -1
- package/dist/assets/{CheckCircle-Caqp5gKY.js → CheckCircle-Dv9ESLSx.js} +1 -1
- package/dist/assets/{ChevronLeft-DONyUbIg.js → ChevronLeft-7uRDOkJ0.js} +1 -1
- package/dist/assets/{ChevronRight-DgAwWLdY.js → ChevronRight-DF2CPRSp.js} +1 -1
- package/dist/assets/{DeleteOutline-DpNyWtNL.js → DeleteOutline-MvcW8wMe.js} +1 -1
- package/dist/assets/{Done-BTd13H2U.js → Done-NWTNth4h.js} +1 -1
- package/dist/assets/{Download-Bm8sKXA2.js → Download-4GZsn6dX.js} +1 -1
- package/dist/assets/{Edit-CUl1Rt8i.js → Edit-rnQ_3wHK.js} +1 -1
- package/dist/assets/{Error-DEKvwVoF.js → Error-RKBXSgDA.js} +1 -1
- package/dist/assets/{ExpandLess-t1cH-Bc4.js → ExpandLess-DeQLEewB.js} +1 -1
- package/dist/assets/{Google-Bn3zPWiu.js → Google-BFBQ7QOU.js} +1 -1
- package/dist/assets/{Home-C3ax1tQ7.js → Home-nxfCo0la.js} +1 -1
- package/dist/assets/{InfoOutlined-D3XnF0Vg.js → InfoOutlined-DwH0ULaz.js} +1 -1
- package/dist/assets/{Launch-Dz9mQnYC.js → Launch-CKjiZEMR.js} +1 -1
- package/dist/assets/{LaunchOutlined-E7HcQu_6.js → LaunchOutlined-Mxl2EzJD.js} +1 -1
- package/dist/assets/{MoreHoriz-DpKn_fkc.js → MoreHoriz-Bb60Z0iy.js} +1 -1
- package/dist/assets/{PlayArrow-CDOOUxMp.js → PlayArrow-DSHRafhE.js} +1 -1
- package/dist/assets/{TuneOutlined-D0gGDoIJ.js → TuneOutlined-C_bRiMjO.js} +1 -1
- package/dist/assets/{ViewList-C8G9e3ft.js → ViewList-B9N1x-5o.js} +1 -1
- package/dist/assets/{access-control-BhxOcGdx.js → access-control-B5entF50.js} +1 -1
- package/dist/assets/{actions-DP7pj6xB.js → actions-t0ZB56yH.js} +1 -1
- package/dist/assets/{add-component-core-XUReAzat.js → add-component-core-BS3YTsy5.js} +1 -1
- package/dist/assets/{add-resource-C3kDcfBw.js → add-resource-DrFqIfnP.js} +1 -1
- package/dist/assets/{addon-CRj4Enw7.js → addon-DQC7Plj9.js} +1 -1
- package/dist/assets/{advanced-hz-KSWn2.js → advanced-DO1hLdXY.js} +1 -1
- package/dist/assets/{appearance-ChvtVBNv.js → appearance-Bf8ha2QN.js} +1 -1
- package/dist/assets/{audit-logs-DXoc97BV.js → audit-logs-BmFsZWcQ.js} +1 -1
- package/dist/assets/{authorize-_fbQ19S4.js → authorize-C1krxa_8.js} +1 -1
- package/dist/assets/{base32-WurN0cIW.js → base32-CCf_iIfG.js} +1 -1
- package/dist/assets/{branding-DuPWVNlC.js → branding-BsDB7rHi.js} +6 -6
- package/dist/assets/{branding-DpkSF6dd.js → branding-DunUmlvH.js} +2 -2
- package/dist/assets/{bundle-avatar-D4fwror8.js → bundle-avatar-BTHmZ3_i.js} +1 -1
- package/dist/assets/{button-_1HExv7r.js → button-mmNFGQSs.js} +1 -1
- package/dist/assets/{click-to-copy-R7MF4AwY.js → click-to-copy-Fl7LHxeC.js} +1 -1
- package/dist/assets/{collapse-l9wHY9gJ.js → collapse-dxBbW7k2.js} +1 -1
- package/dist/assets/complete-CxDgHoQk.js +39 -0
- package/dist/assets/{component-CURpjZJ2.js → component-BnKz-jfM.js} +61 -61
- package/dist/assets/{config-e36Xplpo.js → config-DuKJ9oR4.js} +1 -1
- package/dist/assets/{config-Cd14MJHa.js → config-WLdkaHr-.js} +1 -1
- package/dist/assets/{config-navigation-BvjYZI_j.js → config-navigation-CvCO7Fuh.js} +3 -3
- package/dist/assets/{config-space-EoSm62Er.js → config-space-C_xex8-t.js} +1 -1
- package/dist/assets/{confirm-Vzr2I9eM.js → confirm-t4d18Hpz.js} +1 -1
- package/dist/assets/connect-Cv9tvvms.js +5 -0
- package/dist/assets/{connect-DXOsnqkO.js → connect-GdnRXixM.js} +1 -1
- package/dist/assets/{connect-to-Bz9wYM04.js → connect-to-r0pjWPe7.js} +1 -1
- package/dist/assets/{dashboard-xUr1SbPS.js → dashboard-CEB4GFys.js} +3 -3
- package/dist/assets/{delete-confirm-DNn4Os6R.js → delete-confirm-DCJdTGPZ.js} +1 -1
- package/dist/assets/{did-address-Dq-4__HB.js → did-address-BJCF3XU3.js} +1 -1
- package/dist/assets/domain-Dkw0nuHL.js +9 -0
- package/dist/assets/{domain-action-card-Cf1AoKOi.js → domain-action-card-DnB964Ah.js} +1 -1
- package/dist/assets/domains-D6W7Zk5a.js +1 -0
- package/dist/assets/dot-DX56IFTM.js +7 -0
- package/dist/assets/{email-BIVfXnpk.js → email-DY9qiGnc.js} +1 -1
- package/dist/assets/{exchange-passport-C9Pvr9Da.js → exchange-passport-BOpw7kFp.js} +1 -1
- package/dist/assets/{fuel-Cs--pEYt.js → fuel-CMua6nrK.js} +1 -1
- package/dist/assets/{gen-access-key-CIzULsBE.js → gen-access-key-FrO6nmvQ.js} +1 -1
- package/dist/assets/{get-safe-url-Q70tRxL7.js → get-safe-url-BRxk530J.js} +1 -1
- package/dist/assets/{get-safe-url-c4iAcpvA.js → get-safe-url-DHdoXqD0.js} +1 -1
- package/dist/assets/{home-BZ8WpcWZ.js → home-C2Db_IXV.js} +1 -1
- package/dist/assets/{iframe-Dl8NEFc5.js → iframe-Bpfqnuq5.js} +1 -1
- package/dist/assets/{index-BoTgqYtV.js → index-0epbdrMx.js} +1 -1
- package/dist/assets/{index-DDoVX3je.js → index-3aRBjK5P.js} +30 -30
- package/dist/assets/{index-B7IOoVDF.js → index-ALHbqsn2.js} +1 -1
- package/dist/assets/{index-BCJADuMw.js → index-B7PoXGHo.js} +8 -8
- package/dist/assets/{index-Dsd9SXVN.js → index-B9IGWqlM.js} +1 -1
- package/dist/assets/{index-CsXmgylH.js → index-BchkF3oT.js} +3 -3
- package/dist/assets/{index-BKKwhjBs.js → index-BkScmF5I.js} +1 -1
- package/dist/assets/{index-BU2FTGFr.js → index-BrhW0YAX.js} +1 -1
- package/dist/assets/{index-W_fQ-nuf.js → index-ChEmNV9t.js} +1 -1
- package/dist/assets/{index-DBqLPDUh.js → index-DESkMgoq.js} +1 -1
- package/dist/assets/{index-wLX5GW2c.js → index-DH-xhSUy.js} +1 -1
- package/dist/assets/{index-BUHyq-oP.js → index-DHmaMW97.js} +1 -1
- package/dist/assets/{index-DvBh35bh.js → index-DIzYQ8YY.js} +1 -1
- package/dist/assets/{index-D1kTR2xk.js → index-DTLUTgmo.js} +1 -1
- package/dist/assets/{index-I6_gMaPh.js → index-DjmlNqL1.js} +1 -1
- package/dist/assets/{index-D-Lxloq5.js → index-DkNMM_jp.js} +1 -1
- package/dist/assets/{index-C64IgZKt.js → index-Dq0Wocff.js} +1 -1
- package/dist/assets/{index-U3mAyHwS.js → index-HT1eRd1i.js} +1 -1
- package/dist/assets/{index-Drd9jydY.js → index-bu2nusyV.js} +1 -1
- package/dist/assets/{index-DDXNOodN.js → index-xbFMe1Dq.js} +1 -1
- package/dist/assets/{invitation-Dsnc8lab.js → invitation-DqS1y9EI.js} +1 -1
- package/dist/assets/{invite-CvAru4rZ.js → invite-Do31CPZ_.js} +1 -1
- package/dist/assets/{issue-passport-CDE6vHUE.js → issue-passport-BawbYt3J.js} +1 -1
- package/dist/assets/{item-rXnALS3b.js → item-CPlmWuOr.js} +1 -1
- package/dist/assets/{landing-page-DrVLCVAm.js → landing-page-k0HqFOEl.js} +1 -1
- package/dist/assets/{layout-DYG0Wl7R.js → layout-CneuYz3Y.js} +1 -1
- package/dist/assets/{list-b96sX5Y6.js → list-C3bba0fZ.js} +2 -2
- package/dist/assets/{list-DLMy1vVs.js → list-DqFW_ONs.js} +1 -1
- package/dist/assets/localization-B18AVgXP.js +1 -0
- package/dist/assets/{log-Bwqh69bM.js → log-B7EGR5B1.js} +1 -1
- package/dist/assets/{logger-BAVOmOw2.js → logger-C5_0IJ1n.js} +1 -1
- package/dist/assets/{login-Ygmj8_J7.js → login-CmoMzUKP.js} +1 -1
- package/dist/assets/{login-oauth-callback-BrnNJIOK.js → login-oauth-callback-6CWB9fPF.js} +1 -1
- package/dist/assets/{logo-uploader-CLwbDhA_.js → logo-uploader-BGnE-EpW.js} +3 -3
- package/dist/assets/{lost-passport-CqzPSoLw.js → lost-passport-BIGYYNZH.js} +1 -1
- package/dist/assets/{open-window-Bl24RBAD.js → open-window-DAuoY35p.js} +1 -1
- package/dist/assets/{overview-DqabCKYi.js → overview-DO_rMORL.js} +1 -1
- package/dist/assets/{page-header-BWqvvXOk.js → page-header-CzGtYXZB.js} +1 -1
- package/dist/assets/{passport-item-C5-ZuTPM.js → passport-item-B0b6IIEi.js} +1 -1
- package/dist/assets/{permission-DSHe73ba.js → permission-CG_0ilL-.js} +1 -1
- package/dist/assets/{preferences-BzGNV3pM.js → preferences-nmcizF2n.js} +1 -1
- package/dist/assets/{profile-embed-iA-d50c3.js → profile-embed-D9vov7el.js} +1 -1
- package/dist/assets/{publish-resource-ebKgw7OW.js → publish-resource-BAxsxiDk.js} +1 -1
- package/dist/assets/{react-beautiful-dnd.esm-Ck4xzwyU.js → react-beautiful-dnd.esm-vqdGm7Q2.js} +1 -1
- package/dist/assets/{runtime-B454s6Gb.js → runtime-4wAQAE28.js} +1 -1
- package/dist/assets/sanitize-CC0-oYfL.js +2 -0
- package/dist/assets/sdk-DnmwcxEc.js +1 -0
- package/dist/assets/{security-DCArL_za.js → security-BO4vz2A4.js} +1 -1
- package/dist/assets/{session-C_8V_o-O.js → session-yHau46Qm.js} +1 -1
- package/dist/assets/setup-C9eWBBt5.js +30 -0
- package/dist/assets/{spaces-DApg1wzn.js → spaces-WDzH-r9r.js} +1 -1
- package/dist/assets/{start-Dhbx5j_D.js → start-CvbMSa4N.js} +1 -1
- package/dist/assets/{starting-progress-BHUTOY2b.js → starting-progress-BWNdTquJ.js} +1 -1
- package/dist/assets/{status-D4K-kiXO.js → status-B87zOhDx.js} +1 -1
- package/dist/assets/{step-actions-CISMVGx2.js → step-actions-qe5T0fbR.js} +1 -1
- package/dist/assets/{studio-1mTu0Fgs.js → studio-COaDgEOK.js} +1 -1
- package/dist/assets/{switch-control-CpCSorUo.js → switch-control-DvnJyz2a.js} +1 -1
- package/dist/assets/{table-tips-BfSSGl9N.js → table-tips-3qAdlLSz.js} +1 -1
- package/dist/assets/{traffic-BqHyn9L9.js → traffic-CSdm4uyu.js} +1 -1
- package/dist/assets/{transfer-Bqv1gMqL.js → transfer-DsmSmlf-.js} +1 -1
- package/dist/assets/{unsubscribe-B3OLQIVA.js → unsubscribe-BBPlZQOy.js} +1 -1
- package/dist/assets/{use-blocklet-logo-Bhkp-Zm7.js → use-blocklet-logo-vRumIAeK.js} +1 -1
- package/dist/assets/useAsync-Dv214fz8.js +1 -0
- package/dist/assets/useAsync-KYUBhVsb.js +1 -0
- package/dist/assets/{useLocalStorage-D6gvgmEW.js → useLocalStorage-DiA2Rpy-.js} +1 -1
- package/dist/assets/{user-center-vIx28YXm.js → user-center-p3JKDvby.js} +3 -3
- package/dist/assets/{util-DMfPwzVN.js → util-CKnnktVh.js} +1 -1
- package/dist/assets/{util-Dnkhck-D.js → util-SIt5hlfb.js} +1 -1
- package/dist/assets/{vendor-arcblock-BlrkGjK9.js → vendor-arcblock-BPZ1V4pg.js} +1 -1
- package/dist/assets/{vendor-ux-did-connect-2jRoUb28.js → vendor-ux-did-connect-CJ8Q_v7u.js} +2 -2
- package/dist/assets/{wrap-locale-C_UOH97U.js → wrap-locale-Dz5tBqNC.js} +1 -1
- package/dist/index.html +3 -3
- package/dist/service-worker.js +1 -1
- package/package.json +30 -30
- package/dist/assets/complete-C5D4D-fJ.js +0 -39
- package/dist/assets/connect-B5Xr7MId.js +0 -5
- package/dist/assets/domain-XXgOrJDa.js +0 -9
- package/dist/assets/domains-DeFj6Ipl.js +0 -1
- package/dist/assets/dot-itVN8XTt.js +0 -7
- package/dist/assets/localization-Bb0kc8SQ.js +0 -1
- package/dist/assets/sdk-DeS3iq37.js +0 -1
- package/dist/assets/setup-CX2pUl2y.js +0 -30
- package/dist/assets/useAsync-510ntT1B.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as a}from"./vendor-react-DEoibe3W.js";import{bI as L,v as x,e as _,j as n,aj as F,t as H,bx as I,ak as N,z as O,ab as Q,H as o,ah as G,D as J}from"./vendor-mui-core-BV2FUxWJ.js";import{a as K,B as y}from"./vendor-ux-did-connect-
|
|
1
|
+
import{r as a}from"./vendor-react-DEoibe3W.js";import{bI as L,v as x,e as _,j as n,aj as F,t as H,bx as I,ak as N,z as O,ab as Q,H as o,ah as G,D as J}from"./vendor-mui-core-BV2FUxWJ.js";import{a as K,B as y}from"./vendor-ux-did-connect-CJ8Q_v7u.js";import"./index-3aRBjK5P.js";import{f as U}from"./index-8eXqqyHQ.js";function V(){const e=L();return{minWidth:x(e.breakpoints.down("md"))?300:e.breakpoints.values.sm}}function C({title:e,description:t,showCancel:l,showConfirm:b,cancel:j,confirm:k,color:w,params:D,onCancel:S,onConfirm:P,loading:c,displayError:T,children:E,...v}){const[r,B]=a.useState(D),[$,d]=a.useState(!0),[m,p]=a.useState(!1),[u,f]=a.useState(""),{t:R}=K(),W=_(),h=async s=>{if(typeof s=="function"){p(!0);try{if(await s(r)===!1)return;d(!1)}catch(i){f(U(i)),console.error(i)}finally{p(!1)}}else d(!1)},q=typeof e=="function"?e():e,M=typeof t=="function"?t(r,B,f):t,z=x(W.breakpoints.down("md")),A=s=>{s.stopPropagation()},{minWidth:g}=V();return n.jsxs(X,{onClick:A,fullScreen:z,open:$,style:{minWidth:g},...v,children:[n.jsx(F,{children:q}),n.jsxs(H,{style:{minWidth:g},children:[n.jsx(I,{component:"div",children:M}),!!u&&T&&n.jsx(N,{severity:"error",style:{width:"100%",marginTop:8},children:u}),E]}),n.jsxs(O,{className:"delete-actions",style:{padding:"8px 24px 24px"},children:[l&&n.jsx(y,{onClick:s=>{s.stopPropagation(),h(S)},color:"inherit","data-cy":"cancel-confirm-dialog",children:j||R("common.cancel")}),b&&n.jsxs(y,{onClick:s=>{s.stopPropagation(),h(P)},color:w,disabled:r.__disableConfirm||m||c,variant:"contained","data-cy":"submit-confirm-dialog",autoFocus:!0,children:[(m||c)&&n.jsx(Q,{size:16,sx:{mr:1}}),k]})]})]})}C.propTypes={title:o.any.isRequired,description:o.any.isRequired,showCancel:o.bool,showConfirm:o.bool,cancel:o.string,color:o.string,confirm:o.string,params:o.object,onCancel:o.func,onConfirm:o.func.isRequired,loading:o.bool,displayError:o.bool,children:o.any};C.defaultProps={children:void 0,onCancel:()=>{},showCancel:!0,showConfirm:!0,cancel:"",confirm:"Confirm",color:"error",params:{},loading:!1,displayError:!0};const X=G(J)`
|
|
2
2
|
.delete-actions .Mui-disabled {
|
|
3
3
|
color: ${({theme:e})=>`${e.palette.text.primary} !important`};
|
|
4
4
|
box-shadow: none;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{j as r,ab as f,T as y,H as h,ah as x}from"./vendor-mui-core-BV2FUxWJ.js";import"./vendor-react-DEoibe3W.js";import{A as g}from"./vendor-utils-rHXShPKm.js";import{u as w}from"./useAsync-KYUBhVsb.js";import{a as C,aS as T,C as i,b3 as j,a0 as k,aq as S}from"./vendor-ux-did-connect-CJ8Q_v7u.js";import{u as v,s as P}from"./index-3aRBjK5P.js";import"./useAsync-Dv214fz8.js";import"./vendor-hooks-BgUTpb6X.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-BPZ1V4pg.js";function U({children:p}){const{t:n,locale:u}=C(),{api:c,session:o}=v(),{encryptKey:l,decrypt:m}=T(),t=w(async()=>{var s;const e=new URL(window.location.href);e.pathname=g(((s=window==null?void 0:window.env)==null?void 0:s.apiPrefix)??"/","/api/did/setup/token"),e.searchParams.set("_ek_",l);const{data:a}=await c.get(e.href);return a}),d=async e=>{const a=Array.isArray(e)?e.find(s=>s.sessionToken):e;P(m(a.sessionToken));try{await o.refresh()}catch(s){k.error(s.message)}};return!t.value||t.loading||o.loading?r.jsx(i,{relative:"parent",children:r.jsx(f,{})}):o.user?p:t.error?r.jsx(i,{relative:"parent",children:r.jsx(y,{children:t.error.message})}):r.jsx(b,{popup:!0,open:!0,hideCloseButton:!0,action:"pre-setup",checkFn:c.get,checkTimeout:10*60*1e3,webWalletUrl:j(),onSuccess:d,locale:u,messages:{title:n("setup.connect.title"),scan:n("setup.connect.scan"),confirm:n("setup.connect.confirm"),success:n("setup.connect.success")},extraParams:{setup:!0,nw:t.value.url}})}U.propTypes={children:h.any.isRequired};const b=x(S)`
|
|
2
|
+
.action-info-desc {
|
|
3
|
+
padding: 0 72px;
|
|
4
|
+
}
|
|
5
|
+
`;export{U as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as Z,j as t,aa as u,v as q,ab as Y,a3 as ee,y as ne}from"./vendor-mui-core-BV2FUxWJ.js";import{f as se,h as oe,r as S,L as te}from"./vendor-react-DEoibe3W.js";import{a as re,aS as ae,o as ce,a_ as ie,a$ as le,C as de,aZ as pe,j as me,b0 as ue,a0 as k,a5 as fe}from"./vendor-ux-did-connect-
|
|
1
|
+
import{e as Z,j as t,aa as u,v as q,ab as Y,a3 as ee,y as ne}from"./vendor-mui-core-BV2FUxWJ.js";import{f as se,h as oe,r as S,L as te}from"./vendor-react-DEoibe3W.js";import{a as re,aS as ae,o as ce,a_ as ie,a$ as le,C as de,aZ as pe,j as me,b0 as ue,a0 as k,a5 as fe}from"./vendor-ux-did-connect-CJ8Q_v7u.js";import{f as ge,u as x,m as he,s as we}from"./vendor-hooks-BgUTpb6X.js";import{u as ke}from"./use-passport-id-B-b-_oYF.js";import{H as U}from"./vendor-arcblock-BPZ1V4pg.js";import{c as xe,I as ve,z as Ce,A as _e,J as Te,ad as Ie,ae as be}from"./vendor-utils-rHXShPKm.js";import{g as j}from"./get-safe-url-BRxk530J.js";import{L as ye}from"./landing-page-k0HqFOEl.js";import{u as Le,p as E}from"./index-3aRBjK5P.js";import{d as p}from"./logger-C5_0IJ1n.js";import"./lottie-web-jYmAQWuC.js";const P="authorization_response",De=pe(),Se="blocklet:onLogin",f=new BroadcastChannel(Se);function Fe(){const{getPassportId:R}=ke(),{session:M,connectApi:N}=Le(),{t:a,locale:O}=re(),A=se(),[l]=oe(),{encrypt:B}=ae(),H=Z(),v=ce();let c={};try{c=JSON.parse(decodeURIComponent(ie(l.get("params"))))}catch(s){console.error("parse connect params failed",s)}xe(l.get("popup"));const{action:m="login",passkeyBehavior:W="both",extraParams:d={},messages:z,...g}=c;S.useEffect(()=>{d.inviter&&window.localStorage.setItem("inviter",d.inviter)},[d.inviter]);const i=l.get("redirect"),C=l.get("opener"),h=l.get("_ek_");d.passportId=R(),m==="login"&&ve(g.forceConnected)&&(g.forceConnected=!1);const w=s=>h?B(JSON.stringify(s),h):s,_=S.useMemo(()=>i||!window.opener?"redirect":"popup",[i]),T=async s=>{const e=await De.federated.getTrustedDomains();if(!C){e.forEach(n=>{window.opener.postMessage(s,Ie(n)),window.opener.postMessage(s,be(n))});return}const o=new URL(C);if(!e.includes(o.hostname))throw k.error(a("login.invalidOpenerUrl")),new Error("Invalid login caller");window.opener.postMessage(s,o.origin)},I=({encrypted:s=!0,...e},o,n)=>{p("connect page onSuccess",{encrypted:s,result:e,options:n}),s&&(e.sessionToken&&(e.sessionToken=o(e.sessionToken)),e.refreshToken&&(e.refreshToken=o(e.refreshToken)),e.visitorId&&(e.visitorId=o(e.visitorId)),p("connect page onSuccess decrypt",{result:e})),e.visitorId&&localStorage.setItem("__visitor_id",e.visitorId);const L={type:P,response:e,options:n};({redirect:()=>{p("connect page onSuccess redirect",e),setTimeout(()=>{if(i){const D=decodeURIComponent(i),r=E(D);h&&r.searchParams.set("encrypted",!0),e.sessionToken&&r.searchParams.set("sessionToken",w(e.sessionToken)),e.refreshToken&&r.searchParams.set("refreshToken",w(e.refreshToken)),e.visitorId&&r.searchParams.set("visitorId",w(e.visitorId)),n!=null&&n.connected_did&&r.searchParams.set("connected_did",n.connected_did),n!=null&&n.connected_pk&&r.searchParams.set("connected_pk",n.connected_pk),n!=null&&n.connected_app&&r.searchParams.set("connected_app",n.connected_app),n!=null&&n.connected_wallet_os&&r.searchParams.set("connected_wallet_os",n.connected_wallet_os),n!=null&&n.saveConnect&&r.searchParams.set("saveConnect",n.saveConnect),f.postMessage({...Te(e,["sessionToken","refreshToken","visitorId"])}),fe(D)?window.location.replace(j(r.href,{allowDomains:null})):A(`${r.pathname}${r.search}`,{replace:!0})}else window.location.replace(window.env.pathPrefix||"/")},50)},popup:async()=>{p("connect page onSuccess popup",L),await T(L),setTimeout(()=>{window.open("about:blank","_self"),window.close()},2e3)}})[_]()},F=s=>{const e={type:P,error:s.message,errorDescription:s.message};p("connect page onError",{res:e}),{redirect:()=>{k.error(s.message)},popup:()=>{T(e)}}[_]()},$=ge(()=>{var e;if(m!=="login")return null;const s=((e=window.blocklet)==null?void 0:e.trustedFactories)||[];return(s==null?void 0:s.length)>0?t.jsxs(u,{children:[a("exchangePassport.tooltip1"),t.jsx(u,{component:te,reloadDocument:!0,to:Ce(_e(me.WELLKNOWN_SERVICE_PATH_PREFIX,"/exchange-passport"),{redirect:i||"/"}),sx:{color:le.primary.light,"&:hover":{textDecoration:"underline dashed"}},children:a("exchangePassport.tooltip2")},"exchange-passport"),t.jsx(u,{component:"ul",sx:{pl:1.5},children:s.map(o=>t.jsx(u,{component:"li",children:o},o))})]}):null},[m]),K=x(async()=>{if(!i)return!0;let s;try{s=new URL(i)}catch{return!1}let e;try{e=new URL(c==null?void 0:c.baseUrl)}catch{try{e=new URL(c==null?void 0:c.prefix)}catch(o){console.error("baseUrl and prefix are both invalid",o)}}if(e){let o=[];if(e.origin===window.location.origin)o=window.blocklet.domainAliases||[];else{const n=await ue(e.origin);o=(n==null?void 0:n.domainAliases)||[]}if(!o.includes(s.hostname))return k.error(a("login.invalidRedirectUrl")),!1}return!0}),b=x(()=>{const s=decodeURIComponent(i),e=E(s);window.location.replace(j(e.href,{allowDomains:null}))}),J=!0,Q=!0,G=q(s=>s.breakpoints.down("lg")),y=x(async()=>{await K()&&J&&(window.temporaryDIDConnectOnSuccess=(e,o)=>{I(e,o,{saveConnect:!0})},setTimeout(()=>{var e;N.open({locale:O,action:m,passkeyBehavior:W,extraParams:d,...g,className:"connect",popup:!0,messages:z||{title:a("login.connect.title"),scan:a("login.connect.scan"),confirm:a("login.connect.confirm"),success:a("login.connect.success")},extraContent:$,useSocket:!0,allowWallet:["1","true",void 0,null].includes((e=globalThis.blocklet)==null?void 0:e.DID_CONNECT_ALLOW_WALLET),onSuccess:I,onError:F,hideCloseButton:Q})}))});if(he(()=>{y(),f.addEventListener("message",b)}),we(()=>{delete window.temporaryDIDConnectOnSuccess,f.removeEventListener("message",b),f.close()}),M.loading)return t.jsxs(t.Fragment,{children:[t.jsx(U,{children:t.jsx("title",{children:"DID Connect"})}),t.jsx(de,{children:t.jsx(Y,{})})]});const V=globalThis.blocklet.appName,X=globalThis.blocklet.appDescription;return t.jsxs(t.Fragment,{children:[t.jsx(U,{children:t.jsxs("title",{children:[globalThis.blocklet.appName," | DID Connect"]})}),G&&!v.arcSphere?t.jsx(ee,{styles:{"& .did-connect__container-dialog > .MuiBackdrop-root":{backgroundColor:`${H.palette.background.default} !important`}}}):t.jsx(ye,{did:globalThis.blocklet.appPid,title:V,description:X,actions:v.arcSphere?null:t.jsx(ne,{variant:"contained",disableElevation:!0,color:"primary",size:"large",onClick:y,children:a("login.login")})})]})}export{Fe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as P}from"./vendor-react-DEoibe3W.js";import{a as D,bx as R,a0 as g}from"./vendor-ux-did-connect-
|
|
1
|
+
import{r as P}from"./vendor-react-DEoibe3W.js";import{a as D,bx as R,a0 as g}from"./vendor-ux-did-connect-CJ8Q_v7u.js";import{G as E,I as b,c as q,J as B}from"./vendor-arcblock-BPZ1V4pg.js";import{j as t,aa as x,T as h,H as c,I as U,b2 as F}from"./vendor-mui-core-BV2FUxWJ.js";import{u as N}from"./config-space-C_xex8-t.js";import{f as y}from"./index-8eXqqyHQ.js";import{d as O}from"./DeleteOutline-MvcW8wMe.js";import{b as W,E as $,A as v}from"./vendor-utils-rHXShPKm.js";import{f as T,G as L,D as z,a3 as H,af as _}from"./index-3aRBjK5P.js";import"./api-BjteVZFg.js";function J(){const{t:e}=D();return t.jsx(x,{children:t.jsxs(x,{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",children:[t.jsx(E,{style:{width:250,height:250}}),t.jsx(h,{marginTop:"24px",children:e("storage.spaces.connect.providerForStorage")})]})})}J.propTypes={};function j({spaceGateway:e,onDeleteSpace:l}){const{t:s}=D(),[a,o]=P.useState(!1),[r,d]=P.useState(!1),u=(n,i)=>{n==null||n.stopPropagation(),o(i)},f=async n=>{try{n==null||n.stopPropagation(),d(!0),await l(e),o(!1)}catch(i){console.error(i),g.error(`${s("storage.spaces.gateway.delete.failed")}: ${y(i)}`)}finally{d(!1)}};return t.jsxs(t.Fragment,{children:[t.jsx(U,{size:"small",onClick:n=>u(n,!0),children:t.jsx(O,{})}),t.jsx(R,{title:s("storage.spaces.gateway.delete.title"),open:a,confirmButton:{text:s("common.confirm"),props:{size:"small",variant:"contained",color:"error",loading:r}},cancelButton:{text:s("common.cancel"),props:{size:"small",variant:"outlined"}},onConfirm:f,onCancel:n=>u(n,!1),children:t.jsx(h,{sx:{wordWrap:"break-word"},children:s("storage.spaces.gateway.delete.descForStorage",{name:`${e==null?void 0:e.name}`})})})]})}j.propTypes={onDeleteSpace:c.func,spaceGateway:c.shape({name:c.string.isRequired,url:c.string.isRequired,protected:c.bool}).isRequired};j.defaultProps={onDeleteSpace:()=>{}};function C({spaceGateway:e,onDisconnect:l}){const{t:s}=D(),a=async()=>{try{await l(),g.success(s("storage.spaces.gateway.delete.succeeded",{name:e.name?`(${e.name})`:""}))}catch(o){console.error(o),g.error(y(o))}};return t.jsx(j,{spaceGateway:e,onDeleteSpace:a})}C.propTypes={spaceGateway:c.shape({did:c.string.isRequired,name:c.string.isRequired,url:c.string.isRequired,endpoint:c.string.isRequired}).isRequired,onDisconnect:c.func};C.defaultProps={onDisconnect:()=>{}};function te(){const{t:e}=D(),{spaceGateway:l,settingStorageEndpoint:s}=N();return t.jsxs(x,{display:"flex",flexDirection:"column",children:[t.jsx(x,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",children:t.jsx(h,{fontSize:"1rem",fontWeight:"bold",children:e("storage.spaces.connected.title")})}),t.jsx(x,{children:t.jsx(b,{sx:{marginTop:2},endpoint:l.endpoint,selected:!0,action:a=>t.jsx(C,{...a,onDisconnect:()=>s(null)})})})]})}function Z({blocklet:e}){var f,n,i;if(W(e))return{};const{appDid:l}=e,s=T.getAppName(e),a=T.getAppDescription(e),o=(i=(n=(f=e==null?void 0:e.site)==null?void 0:f.domainAliases)==null?void 0:n.sort((p,m)=>p.accessibility.accessible&&m.accessibility.accessible?+p.isProtected-+m.isProtected:+m.accessibility.accessible-+p.accessibility.accessible))==null?void 0:i.map(p=>{var S;const m=(S=p==null?void 0:p.domainStatus)!=null&&S.isHttps?"https://":"http://",I=p==null?void 0:p.value;return`${m}${I}`}).filter(Boolean),r=o==null?void 0:o[0],d=q.DID_SPACES.AUTHORIZE.DEFAULT_SCOPE,u=window.location.href;return{appDid:l,appName:s,appDescription:a,appUrl:r,scopes:d,referrer:u,isReady:!!r}}function w({onConnect:e,...l}){const{blocklet:s}=L(),{info:a}=z(),{t:o}=D(),r=Z({blocklet:s}),d=H(a),u={checkFn:$.create({baseURL:v(window.location.origin,_())}).get,webWalletUrl:d,extraParams:{appPid:s.appPid,appDid:r.appDid,appName:r.appName,appDescription:r.appDescription,appUrl:r.appUrl,referrer:r.referrer,scopes:r.scopes,nodeDid:a.did}},f=async({spaceGateway:n})=>{try{await e(n),g.success(o("storage.spaces.connectedWithName",{name:n.name}))}catch(i){console.error(i),g.error(y(i))}};return t.jsx(B,{...l,options:u,onSuccess:f})}w.propTypes={onConnect:F.func};w.defaultProps={onConnect:()=>{}};export{te as C,J as D,w as a,Z as u};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/log-
|
|
2
|
-
import{r as F,b6 as fs,b4 as Lt,b7 as ps,B as Dt,j as O,a5 as xn,a0 as Z,a as Y,aq as ms,m as zn,k as hs,d as gs,h as xs,aL as vs,z as Le,Z as Pt,b8 as ys,b9 as bs,I as ws,C as Je,ba as js,bb as Ss,_ as D,au as _s,a2 as Cs}from"./vendor-ux-did-connect-2jRoUb28.js";import{H as v,j as o,a9 as V,ah as K,I as Rt,ap as Is,ak as Bn,X as At,q as ks,b4 as Ts,ab as re,b5 as Es,bw as Ls,T as B,bu as Ds,bs as vn,bv as yn,aa as _,bI as Ps,v as X,a7 as it,bJ as Rs,e as ee,ae as As,bf as Ms,be as Se,bK as Hn,ad as ke,bL as $s,aq as Os,ai as Ns,bM as Fn,bN as Vn,bO as qn,E as ae,b3 as Wn,y as Us,bh as zs}from"./vendor-mui-core-BV2FUxWJ.js";import{r as x,L as Gn,f as Kn,g as Bs,u as Hs,l as Fs}from"./vendor-react-DEoibe3W.js";import{D as at,f as N,E as ft,F as Vs,b as qs,G as Ws,H as Gs,I as Qn,y as me,J as Zn,K as Ks,k as ve,L as Qs,M as Zs,u as Xs,l as bn,Q as wn,g as Js,j as Ys,q as eo,n as be,m as to,o as no,P as ro,O as so,R as We,e as Be,T as oo,U as io,V as ao,N as co,W as lo,c as jn}from"./index-DDoVX3je.js";import{af as uo,A as he,ag as fo,z as Xn,b as Ge,ah as po}from"./vendor-utils-rHXShPKm.js";import{_ as Sn}from"./useLocalStorage-D6gvgmEW.js";import{f as Mt}from"./index-8eXqqyHQ.js";import{c as ce,u as Ye,p as mo,h as et,f as Jn,g as ho,E as go,i as xo,H as vo,R as yo}from"./vendor-arcblock-BlrkGjK9.js";import{C as _n}from"./confirm-Vzr2I9eM.js";import{d as bo}from"./PlayArrow-CDOOUxMp.js";import{g as Cn}from"./get-safe-url-c4iAcpvA.js";import{u as Yn}from"./session-C_8V_o-O.js";import{f as ge,x as wo}from"./vendor-hooks-BgUTpb6X.js";import{i as jo,u as So,M as _o,c as Te,s as tt,H as Co,a as Io}from"./use-blocklet-logo-Bhkp-Zm7.js";import{d as ko}from"./InfoOutlined-D3XnF0Vg.js";import{_ as er,D as To}from"./dot-itVN8XTt.js";import{_ as tr}from"./useSetState-CWq0AVWn.js";import{u as Eo}from"./use-mobile-C21X4TYN.js";const nr=x.createContext({});function $t({children:e,type:t}){const[n,r]=x.useState([]),s=x.useRef([]),a=l=>{if(!s.current.includes(l)){const u=[...s.current,l];r(u),s.current=u}},i=l=>{if(s.current.includes(l)){const u=s.current.filter(d=>d!==l);r(u),s.current=u}},c=l=>{const u=n.filter(p=>l.find(f=>f===p));uo(u,n).forEach(p=>i(p))};return o.jsx(nr.Provider,{value:{type:t,deletingBlocklets:n,addDeletingDid:a,removeDeletingDid:i,matchDeletingDid:c},children:e})}$t.propTypes={type:v.string,children:v.node.isRequired};$t.defaultProps={type:"blocklets"};function Dl(){return x.useContext(nr)}var Ot={},Lo=V;Object.defineProperty(Ot,"__esModule",{value:!0});var rr=Ot.default=void 0,Do=Lo(F()),Po=o;rr=Ot.default=(0,Do.default)((0,Po.jsx)("path",{d:"M6 6h12v12H6z"}),"Stop");var Nt={},Ro=V;Object.defineProperty(Nt,"__esModule",{value:!0});var sr=Nt.default=void 0,Ao=Ro(F()),Mo=o;sr=Nt.default=(0,Ao.default)((0,Mo.jsx)("path",{d:"M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8"}),"Replay");var Ut={},$o=V;Object.defineProperty(Ut,"__esModule",{value:!0});var or=Ut.default=void 0,Oo=$o(F()),No=o;or=Ut.default=(0,Oo.default)((0,No.jsx)("path",{d:"M12 6v3l4-4-4-4v3c-4.42 0-8 3.58-8 8 0 1.57.46 3.03 1.24 4.26L6.7 14.8c-.45-.83-.7-1.79-.7-2.8 0-3.31 2.69-6 6-6m6.76 1.74L17.3 9.2c.44.84.7 1.79.7 2.8 0 3.31-2.69 6-6 6v-3l-4 4 4 4v-3c4.42 0 8-3.58 8-8 0-1.57-.46-3.03-1.24-4.26"}),"Autorenew");var zt={},Uo=V;Object.defineProperty(zt,"__esModule",{value:!0});var ir=zt.default=void 0,zo=Uo(F()),Bo=o;ir=zt.default=(0,zo.default)((0,Bo.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings");var Bt={},Ho=V;Object.defineProperty(Bt,"__esModule",{value:!0});var ar=Bt.default=void 0,Fo=Ho(F()),Vo=o;ar=Bt.default=(0,Fo.default)((0,Vo.jsx)("path",{d:"M18 17H6v-2h12zm0-4H6v-2h12zm0-4H6V7h12zM3 22l1.5-1.5L6 22l1.5-1.5L9 22l1.5-1.5L12 22l1.5-1.5L15 22l1.5-1.5L18 22l1.5-1.5L21 22V2l-1.5 1.5L18 2l-1.5 1.5L15 2l-1.5 1.5L12 2l-1.5 1.5L9 2 7.5 3.5 6 2 4.5 3.5 3 2z"}),"Receipt");var Ht={},qo=V;Object.defineProperty(Ht,"__esModule",{value:!0});var cr=Ht.default=void 0,Wo=qo(F()),Go=o;cr=Ht.default=(0,Wo.default)((0,Go.jsx)("path",{d:"M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3m-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3m0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5m8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5"}),"Group");var Ft={},Ko=V;Object.defineProperty(Ft,"__esModule",{value:!0});var lr=Ft.default=void 0,Qo=Ko(F()),Zo=o;lr=Ft.default=(0,Qo.default)((0,Zo.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20m6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9"}),"NotInterested");var Vt=function(e){return o.jsx("svg",{...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.32989 8.20744C11.2787 6.82349 13.6098 6.08 16 6.08C18.3902 6.08 20.7213 6.82349 22.6701 8.20744C24.6189 9.59139 26.089 11.5473 26.8766 13.804C27.6642 16.0607 27.7304 18.5066 27.0659 20.8026C26.4419 22.9587 25.2026 24.8823 23.5044 26.3404H8.49555C6.79735 24.8823 5.55809 22.9587 4.9341 20.8026C4.26961 18.5066 4.33575 16.0607 5.12337 13.804C5.91098 11.5473 7.38107 9.59139 9.32989 8.20744ZM16 3.52C13.0786 3.52 10.2295 4.42871 7.84764 6.1202C5.46575 7.81169 3.66898 10.2022 2.70634 12.9604C1.7437 15.7187 1.66286 18.708 2.47501 21.5143C3.28717 24.3205 4.95211 26.8046 7.23909 28.6224C7.46554 28.8024 7.74628 28.9004 8.03554 28.9004H23.9644C24.2537 28.9004 24.5344 28.8024 24.7609 28.6224C27.0479 26.8046 28.7128 24.3205 29.5249 21.5143C30.3371 18.708 30.2563 15.7187 29.2936 12.9604C28.331 10.2022 26.5342 7.81169 24.1523 6.1202C21.7704 4.42871 18.9214 3.52 16 3.52ZM21.8829 13.5921C22.3827 13.0923 22.3827 12.2818 21.8829 11.7819C21.383 11.2821 20.5725 11.2821 20.0727 11.7819L17.868 13.9866C17.3072 13.7012 16.6724 13.5404 16 13.5404C13.7221 13.5404 11.8755 15.3869 11.8755 17.6648C11.8755 19.9427 13.7221 21.7892 16 21.7892C18.2779 21.7892 20.1244 19.9427 20.1244 17.6648C20.1244 16.9924 19.9635 16.3576 19.6782 15.7968L21.8829 13.5921ZM14.4355 17.6648C14.4355 16.8008 15.136 16.1004 16 16.1004C16.864 16.1004 17.5644 16.8008 17.5644 17.6648C17.5644 18.5288 16.864 19.2292 16 19.2292C15.136 19.2292 14.4355 18.5288 14.4355 17.6648Z",fill:"currentColor"})})};Vt.defaultProps={width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"};Vt.displayName="dashboard";var qt={},Xo=V;Object.defineProperty(qt,"__esModule",{value:!0});var ur=qt.default=void 0,Jo=Xo(F()),Yo=o;ur=qt.default=(0,Jo.default)((0,Yo.jsx)("path",{d:"m18.25 7.6-5.5-3.18c-.46-.27-1.04-.27-1.5 0L5.75 7.6c-.46.27-.75.76-.75 1.3v6.35c0 .54.29 1.03.75 1.3l5.5 3.18c.46.27 1.04.27 1.5 0l5.5-3.18c.46-.27.75-.76.75-1.3V8.9c0-.54-.29-1.03-.75-1.3M7 14.96v-4.62l4 2.32v4.61zm5-4.03L8 8.61l4-2.31 4 2.31zm1 6.34v-4.61l4-2.32v4.62zM7 2H3.5C2.67 2 2 2.67 2 3.5V7h2V4h3zm10 0h3.5c.83 0 1.5.67 1.5 1.5V7h-2V4h-3zM7 22H3.5c-.83 0-1.5-.67-1.5-1.5V17h2v3h3zm10 0h3.5c.83 0 1.5-.67 1.5-1.5V17h-2v3h-3z"}),"ViewInAr");const pe={Start:bo,Stop:rr,Restart:sr,Reload:or,Remove:fs,Config:ir,Log:ar,Group:cr,Cancel:lr,Dashboard:Vt,Overview:ur},ei=(e,t)=>{if(!e)return"";const n=new URL(e),r=new URLSearchParams(n.searchParams),s=new URL(he(n.origin,t));return s.search=r.toString(),s.toString()},ti="internal",ni="external";function Wt({blocklet:e,onStart:t,onComplete:n,variant:r,hasPermission:s,getComponentUrl:a,useBlockletUrlEvaluation:i,...c}){const l=at(),[u,d]=x.useState(null),[p,f]=x.useState(null),[y,g]=x.useState(!1),[h,S]=x.useState(null),{t:m}=x.useContext(Lt),[C]=Sn("skip-blocklet-setup",!1),{loading:w,recommendedUrl:L}=i(e),[R]=Sn("blocklet-type-filter",ti),j=N.isInProgress(e.status),[T,k]=x.useState(!1);x.useEffect(()=>{var A,H;if(!(e!=null&&e.controller))return;k(((H=(A=e==null?void 0:e.controller)==null?void 0:A.status)==null?void 0:H.value)===ce.BLOCKLET_CONTROLLER_STATUS.suspended),(async()=>{var q,te,oe;try{const W=await l.api.getLauncherSession({input:{launcherSessionId:(q=e==null?void 0:e.controller)==null?void 0:q.launcherSessionId,launcherUrl:(te=e==null?void 0:e.controller)==null?void 0:te.launcherUrl}});if(W!=null&&W.error){console.error("get launcher session failed",W.error);return}k([O.LAUNCH_SESSION_STATUS.overdue,O.LAUNCH_SESSION_STATUS.canceled,O.LAUNCH_SESSION_STATUS.terminated].includes((oe=W==null?void 0:W.launcherSession)==null?void 0:oe.status))}catch(W){console.error("call getLauncherSession error",W)}})()},[]);const{inService:E}=l,I=(b,A,H=!1)=>async()=>{const q=async Ne=>{var ze;t({action:b,blocklet:e}),g(!0),f(b);let Ue=!1;try{if(b==="remove")await A(Ne);else if(b==="start"){if(!N.hasRunnableComponent(e)){Z.error(m("blocklet.noComponent"));return}if(!E&&!C&&!((ze=e.settings)!=null&&ze.initialized)&&e.mode!==ce.BLOCKLET_MODES.DEVELOPMENT){if(!L||!xn(L)){Z.error(m("blocklet.gotoVisitError"));return}const Q=Vs(l.info),gn=new URL(L);gn.searchParams.set("serverUrl",Q),window.open(Cn(gn.href,{allowDomains:null})),n({action:b,blocklet:e});return}const ie=e.children.filter(Q=>!N.isInProgress(Q.status)&&Q.status!=="running").map(Q=>Q.meta.did),fe={did:e.meta.did,componentDids:ie};await A({input:fe})}else if(["stop","restart","reload"].includes(b)){const ie=e.children.filter(Q=>Q.status==="running").map(Q=>Q.meta.did),fe={did:e.meta.did,componentDids:ie};await A({input:fe})}else{const ie={did:e.meta.did};await A({input:ie})}b==="remove"?Ue=!0:await qs(1e3),b==="reload"&&Z.success(m("blocklet.reloadSuccess")),S(null),n({action:b,blocklet:e})}catch(ie){const fe=`Blocklet ${b} failed: ${Mt(ie)}`;throw n({action:b,blocklet:e,error:new Error(fe)}),new Error(fe)}finally{Ue||g(!1)}},te=()=>{g(!1),S(null)},oe=N.getDisplayName(e,!0),W=e.mode===ce.BLOCKLET_MODES.DEVELOPMENT?{description:()=>o.jsx(B,{component:"div",children:o.jsx(B,{gutterBottom:!0,children:m("blocklet.action.removeApplicationDescription")})}),params:{removeType:"complete"}}:{description:(Ne,Ue)=>o.jsxs(B,{component:"div",children:[o.jsx(B,{gutterBottom:!0,children:m("blocklet.action.removeApplicationDescription")}),o.jsxs(Ds,{name:"removeType",value:Ne.removeType,onChange:ze=>Ue({...Ne,removeType:ze.target.value}),children:[o.jsx(vn,{value:"backup",control:o.jsx(yn,{}),label:m("blocklet.action.removeApplicationAfterBackup")}),o.jsx(vn,{value:"complete",control:o.jsx(yn,{}),label:m("blocklet.action.removeApplicationComplete")})]})]}),params:{removeType:"backup"}},ds={stop:{title:`${m("common.stop")} ${oe}`,description:m("blocklet.action.stopDescription"),confirm:m("blocklet.action.confirmStop"),cancel:m("common.cancel"),onConfirm:q,onCancel:te},restart:{title:`${m("common.restart")} ${oe}`,description:m("blocklet.action.restartDescription"),confirm:m("blocklet.action.confirmRestart"),cancel:m("common.cancel"),onConfirm:q,onCancel:te},remove:{title:`${m("common.remove")} ${oe}`,confirm:m("blocklet.action.confirmRemove"),cancel:m("common.cancel"),onConfirm:q,onCancel:te,...W},cancelDownload:{title:`${m("common.cancel")}`,description:m("blocklet.action.cancelDownloadDescription",{name:oe}),confirm:m("common.confirm"),cancel:m("common.cancel"),onConfirm:q,onCancel:te}};H?S(ds[b]):await q()},U=!!u,M=b=>{try{b.stopPropagation(),b.preventDefault()}catch{}d(b.currentTarget)},z=b=>{try{b.stopPropagation(),b.preventDefault()}catch{}d(null)},$e=async(b,A)=>{try{A.stopPropagation(),A.preventDefault()}catch{}if(typeof b.handler=="function")try{g(!0),f(b.action),await b.handler()}catch(H){console.error(`Blocklet ${b.name} failed: `,H)}finally{g(!1),d(null)}else d(null)},as=!E&&N.isDeletableBlocklet(e)?{action:"remove",icon:pe.Remove,name:m("common.remove"),handler:I("remove",async({removeType:b})=>{b==="backup"&&await l.api.backupBlocklet({input:{appDid:e.appDid,to:"disk"}}),await l.api.deleteBlocklet({input:{did:e.meta.did,keepData:!1}})},!0),disabled:j}:null,cs={action:"remove",icon:({sx:b,...A})=>o.jsx(pe.Cancel,{sx:{...b,paddingRight:"2px",zoom:.95},...A}),name:m("common.cancel"),handler:I("cancelDownload",l.api.cancelDownloadBlocklet,!0)},ls=N.getAppMissingConfigs(e),us=()=>{var q;const b=`/${e.mountPoint||"/"}`.replace(/\/+/g,"/"),A=a==null?void 0:a({mountPoint:b,blocklet:e});if(!A||!xn(A)){Z.error(m("blocklet.gotoVisitError"));return}const H=(q=e==null?void 0:e.site)==null?void 0:q.domainAliases;window.open(Cn(ei(A,".well-known/service/admin"),{allowDomains:H==null?void 0:H.map(te=>te.value)}))};let Oe=[{action:"start",icon:pe.Start,inExternal:!0,name:m("common.start"),handler:I("start",l.api.startBlocklet),disabled:T||e.children.every(b=>b.status==="running")||ft(e.status)||w||j},{action:"stop",icon:pe.Stop,inExternal:!0,name:m("common.stop"),handler:I("stop",l.api.stopBlocklet,!0),disabled:!["running","starting"].includes(e.status)},{action:"restart",inExternal:!0,icon:pe.Restart,name:m("common.restart"),handler:I("restart",l.api.restartBlocklet,!0),disabled:T||e.status!=="running"},ft(e.status)?cs:as,{separator:!0},E?null:{action:"dashboard",icon:({style:b,...A})=>o.jsx(pe.Dashboard,{...A,style:{...b,width:"26px",height:"26px",paddingRight:"3px"}}),name:m("sidebar.dashboard"),handler:us}].filter(Boolean);return R===ni&&(Oe=Oe.filter(b=>b.inExternal)),r==="menu"?o.jsxs(In,{"data-cy":"blocklet-actions",children:[o.jsx(Rt,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions","actions-blocklet-did":e.meta.did,onClick:M,size:"small",disabled:!s||!ft(e.status)&&y,children:o.jsx(ps,{})}),o.jsxs(Is,{id:"actions-menu",anchorEl:u,keepMounted:!0,open:U,onClose:z,PaperProps:{},children:[ls.length>0&&o.jsxs(Bn,{style:{maxWidth:"400px"},severity:"error",children:[m("blocklet.config.missingRequired"),o.jsx("br",{}),o.jsx(Gn,{to:`/blocklets/${e.meta.did}/components`,children:m("blocklet.config.gotoFix")})]}),Oe.map((b,A)=>b.separator?o.jsx(At,{},`separator-${A}`):o.jsxs(ks,{dense:!0,onClick:H=>$e(b,H),disabled:y||b.disabled,"data-cy":`${b.action}-blocklet`,children:[o.jsx(Ts,{style:{minWidth:24},children:p===b.action&&y?o.jsx(re,{size:16,sx:{marginRight:1}}):o.jsx(b.icon,{fontSize:"small"})}),o.jsx(Es,{primary:b.name})]},b.name))]}),h&&o.jsx(_n,{title:h.title,description:h.description,confirm:h.confirm,cancel:h.cancel,params:h.params,onConfirm:h.onConfirm,onCancel:h.onCancel})]}):o.jsxs(In,{"data-cy":"blocklet-actions",...c,children:[o.jsx(Ls,{children:Oe.filter(b=>!b.separator&&!b.onlyInMenu).map(b=>o.jsxs(Dt,{title:b.name,"data-cy":`${b.action}-blocklet`,onClick:()=>$e(b),disabled:!!b.disabled||y,children:[p===b.action&&y?o.jsx(re,{size:16,sx:{marginRight:1}}):o.jsx(b.icon,{}),o.jsx("span",{className:"blocklet-action-text",children:b.name})]},b.name))}),h&&o.jsx(_n,{title:h.title,description:h.description,confirm:h.confirm,cancel:h.cancel,params:h.params,onConfirm:h.onConfirm,onCancel:h.onCancel})]})}Wt.propTypes={getComponentUrl:v.func,blocklet:v.object.isRequired,onStart:v.func.isRequired,onComplete:v.func.isRequired,variant:v.oneOf(["menu","group"]),hasPermission:v.bool,useBlockletUrlEvaluation:v.func};Wt.defaultProps={getComponentUrl:null,variant:"menu",hasPermission:!1,useBlockletUrlEvaluation:()=>{var e;return{loading:!1,recommendedUrl:(e=window==null?void 0:window.location)==null?void 0:e.href}}};const In=K.div`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/log-B7EGR5B1.js","assets/vendor-mui-core-BV2FUxWJ.js","assets/vendor-react-DEoibe3W.js","assets/useLocalStorage-DiA2Rpy-.js","assets/vendor-ux-did-connect-CJ8Q_v7u.js","assets/vendor-utils-rHXShPKm.js","assets/vendor-hooks-BgUTpb6X.js","assets/lottie-web-jYmAQWuC.js","assets/vendor-ux-did-connect-DpSGLE7B.css","assets/index-3aRBjK5P.js","assets/vendor-arcblock-BPZ1V4pg.js","assets/index-DOq-_YXu.css","assets/Download-4GZsn6dX.js","assets/bundle-avatar-BTHmZ3_i.js","assets/log-D33dFtt_.css","assets/index-DkNMM_jp.js","assets/ViewList-B9N1x-5o.js","assets/index-DTLUTgmo.js","assets/Phone-BkOMNOMO.js","assets/Location-DxPzfR_p.js","assets/Email-BirbvqZ3.js","assets/Timezone-D91Of94T.js","assets/index-BkScmF5I.js","assets/did-address-BJCF3XU3.js","assets/permission-CG_0ilL-.js","assets/session-yHau46Qm.js","assets/click-to-copy-Fl7LHxeC.js","assets/index-BrhW0YAX.js","assets/vendor-mui-x-Bo-XOtzq.js","assets/AdapterDayjs-Dy2dI4ee.js","assets/index-8eXqqyHQ.js","assets/useAsync-KYUBhVsb.js","assets/useAsync-Dv214fz8.js","assets/index-DHmaMW97.js","assets/DeleteOutline-MvcW8wMe.js","assets/confirm-t4d18Hpz.js","assets/util-CKnnktVh.js","assets/base32-CCf_iIfG.js","assets/sdk-DnmwcxEc.js","assets/actions-t0ZB56yH.js","assets/MoreHoriz-Bb60Z0iy.js","assets/shorten-label-DPIZ5X7v.js","assets/PlayArrow-DSHRafhE.js","assets/get-safe-url-DHdoXqD0.js","assets/use-blocklet-logo-vRumIAeK.js","assets/InfoOutlined-DwH0ULaz.js","assets/dot-DX56IFTM.js","assets/useSetState-CWq0AVWn.js","assets/use-mobile-C21X4TYN.js","assets/index-DIzYQ8YY.js","assets/use-mobile-BAa0wi8o.js","assets/ExpandLess-DeQLEewB.js","assets/table-tips-3qAdlLSz.js","assets/index-B7PoXGHo.js","assets/Error-RKBXSgDA.js","assets/empty-spinner-BdaCO6xq.js","assets/list-header-xt282ZMS.js","assets/QuestionMarkCircle-DTGyWFVS.js","assets/index-DVQCgvFb.js","assets/Launch-CKjiZEMR.js","assets/index-D2uDBC1o.js","assets/api-BjteVZFg.js","assets/ChevronRight-DF2CPRSp.js","assets/react-beautiful-dnd.esm-vqdGm7Q2.js","assets/raf-schd.esm-B3j6BePR.js","assets/item-CPlmWuOr.js","assets/Done-NWTNth4h.js","assets/delete-confirm-DCJdTGPZ.js","assets/ArrowDropDown-D8DSLfND.js","assets/index-RsjqbOR7.js","assets/index-C0Iiqot3.css","assets/index-BmXcRfZR.js","assets/overview-DO_rMORL.js","assets/keyboard-arrow-down-rounded-DadBVmpO.js","assets/status-B87zOhDx.js","assets/omit-D2k92RIF.js","assets/spaces-WDzH-r9r.js","assets/domains-D6W7Zk5a.js","assets/domain-action-card-DnB964Ah.js","assets/util-SIt5hlfb.js","assets/CheckCircle-Dv9ESLSx.js","assets/index-bu2nusyV.js","assets/passport-item-B0b6IIEi.js","assets/Google-BFBQ7QOU.js","assets/cloneDeep-UpFQ2VNg.js","assets/EditIcon-8BXW1OHp.js","assets/LockIcon-DFb6sSpT.js","assets/appearance-Bf8ha2QN.js","assets/audit-logs-BmFsZWcQ.js","assets/index-DESkMgoq.js","assets/collapse-dxBbW7k2.js","assets/section-Ccxg0x_Y.js","assets/list-DqFW_ONs.js","assets/traffic-CSdm4uyu.js","assets/iframe-Bpfqnuq5.js","assets/LaunchOutlined-Mxl2EzJD.js","assets/ChevronLeft-7uRDOkJ0.js","assets/index-iB7JyXwh.js","assets/base-chart-D6qRW4Yg.js","assets/index-J3Tqz9ZT.js","assets/config-navigation-CvCO7Fuh.js","assets/index-Bs1kxR8_.js","assets/slicedToArray-DmqXMnHT.js","assets/simple-select-CN3fsa56.js","assets/index-ChEmNV9t.js","assets/connect-to-r0pjWPe7.js","assets/config-space-C_xex8-t.js","assets/switch-control-DvnJyz2a.js","assets/index-0epbdrMx.js","assets/security-BO4vz2A4.js","assets/config-WLdkaHr-.js","assets/branding-BsDB7rHi.js","assets/sanitize-CC0-oYfL.js","assets/logo-uploader-BGnE-EpW.js","assets/advanced-DO1hLdXY.js","assets/runtime-4wAQAE28.js","assets/index-xbFMe1Dq.js","assets/Edit-rnQ_3wHK.js","assets/list-C3bba0fZ.js","assets/index-Dq0Wocff.js","assets/component-BnKz-jfM.js","assets/TuneOutlined-C_bRiMjO.js","assets/add-component-core-BS3YTsy5.js","assets/launch-result-message-FuvJDCvp.js","assets/page-header-CzGtYXZB.js","assets/index-DH-xhSUy.js","assets/content-layout-fV4nyVb5.js","assets/add-component-core-D-IRi6XF.css","assets/index-B9IGWqlM.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as F,b6 as fs,b4 as Lt,b7 as ps,B as Dt,j as O,a5 as xn,a0 as Z,a as Y,aq as ms,m as zn,k as hs,d as gs,h as xs,aL as vs,z as Le,Z as Pt,b8 as ys,b9 as bs,I as ws,C as Je,ba as js,bb as Ss,_ as D,au as _s,a2 as Cs}from"./vendor-ux-did-connect-CJ8Q_v7u.js";import{H as v,j as o,a9 as V,ah as K,I as Rt,ap as Is,ak as Bn,X as At,q as ks,b4 as Ts,ab as re,b5 as Es,bw as Ls,T as B,bu as Ds,bs as vn,bv as yn,aa as _,bI as Ps,v as X,a7 as it,bJ as Rs,e as ee,ae as As,bf as Ms,be as Se,bK as Hn,ad as ke,bL as $s,aq as Os,ai as Ns,bM as Fn,bN as Vn,bO as qn,E as ae,b3 as Wn,y as Us,bh as zs}from"./vendor-mui-core-BV2FUxWJ.js";import{r as x,L as Gn,f as Kn,g as Bs,u as Hs,l as Fs}from"./vendor-react-DEoibe3W.js";import{D as at,f as N,E as ft,F as Vs,b as qs,G as Ws,H as Gs,I as Qn,y as me,J as Zn,K as Ks,k as ve,L as Qs,M as Zs,u as Xs,l as bn,Q as wn,g as Js,j as Ys,q as eo,n as be,m as to,o as no,P as ro,O as so,R as We,e as Be,T as oo,U as io,V as ao,N as co,W as lo,c as jn}from"./index-3aRBjK5P.js";import{af as uo,A as he,ag as fo,z as Xn,b as Ge,ah as po}from"./vendor-utils-rHXShPKm.js";import{_ as Sn}from"./useLocalStorage-DiA2Rpy-.js";import{f as Mt}from"./index-8eXqqyHQ.js";import{c as ce,u as Ye,p as mo,h as et,f as Jn,g as ho,E as go,i as xo,H as vo,R as yo}from"./vendor-arcblock-BPZ1V4pg.js";import{C as _n}from"./confirm-t4d18Hpz.js";import{d as bo}from"./PlayArrow-DSHRafhE.js";import{g as Cn}from"./get-safe-url-DHdoXqD0.js";import{u as Yn}from"./session-yHau46Qm.js";import{f as ge,x as wo}from"./vendor-hooks-BgUTpb6X.js";import{i as jo,u as So,M as _o,c as Te,s as tt,H as Co,a as Io}from"./use-blocklet-logo-vRumIAeK.js";import{d as ko}from"./InfoOutlined-DwH0ULaz.js";import{_ as er,D as To}from"./dot-DX56IFTM.js";import{_ as tr}from"./useSetState-CWq0AVWn.js";import{u as Eo}from"./use-mobile-C21X4TYN.js";const nr=x.createContext({});function $t({children:e,type:t}){const[n,r]=x.useState([]),s=x.useRef([]),a=l=>{if(!s.current.includes(l)){const u=[...s.current,l];r(u),s.current=u}},i=l=>{if(s.current.includes(l)){const u=s.current.filter(d=>d!==l);r(u),s.current=u}},c=l=>{const u=n.filter(p=>l.find(f=>f===p));uo(u,n).forEach(p=>i(p))};return o.jsx(nr.Provider,{value:{type:t,deletingBlocklets:n,addDeletingDid:a,removeDeletingDid:i,matchDeletingDid:c},children:e})}$t.propTypes={type:v.string,children:v.node.isRequired};$t.defaultProps={type:"blocklets"};function Dl(){return x.useContext(nr)}var Ot={},Lo=V;Object.defineProperty(Ot,"__esModule",{value:!0});var rr=Ot.default=void 0,Do=Lo(F()),Po=o;rr=Ot.default=(0,Do.default)((0,Po.jsx)("path",{d:"M6 6h12v12H6z"}),"Stop");var Nt={},Ro=V;Object.defineProperty(Nt,"__esModule",{value:!0});var sr=Nt.default=void 0,Ao=Ro(F()),Mo=o;sr=Nt.default=(0,Ao.default)((0,Mo.jsx)("path",{d:"M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8"}),"Replay");var Ut={},$o=V;Object.defineProperty(Ut,"__esModule",{value:!0});var or=Ut.default=void 0,Oo=$o(F()),No=o;or=Ut.default=(0,Oo.default)((0,No.jsx)("path",{d:"M12 6v3l4-4-4-4v3c-4.42 0-8 3.58-8 8 0 1.57.46 3.03 1.24 4.26L6.7 14.8c-.45-.83-.7-1.79-.7-2.8 0-3.31 2.69-6 6-6m6.76 1.74L17.3 9.2c.44.84.7 1.79.7 2.8 0 3.31-2.69 6-6 6v-3l-4 4 4 4v-3c4.42 0 8-3.58 8-8 0-1.57-.46-3.03-1.24-4.26"}),"Autorenew");var zt={},Uo=V;Object.defineProperty(zt,"__esModule",{value:!0});var ir=zt.default=void 0,zo=Uo(F()),Bo=o;ir=zt.default=(0,zo.default)((0,Bo.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings");var Bt={},Ho=V;Object.defineProperty(Bt,"__esModule",{value:!0});var ar=Bt.default=void 0,Fo=Ho(F()),Vo=o;ar=Bt.default=(0,Fo.default)((0,Vo.jsx)("path",{d:"M18 17H6v-2h12zm0-4H6v-2h12zm0-4H6V7h12zM3 22l1.5-1.5L6 22l1.5-1.5L9 22l1.5-1.5L12 22l1.5-1.5L15 22l1.5-1.5L18 22l1.5-1.5L21 22V2l-1.5 1.5L18 2l-1.5 1.5L15 2l-1.5 1.5L12 2l-1.5 1.5L9 2 7.5 3.5 6 2 4.5 3.5 3 2z"}),"Receipt");var Ht={},qo=V;Object.defineProperty(Ht,"__esModule",{value:!0});var cr=Ht.default=void 0,Wo=qo(F()),Go=o;cr=Ht.default=(0,Wo.default)((0,Go.jsx)("path",{d:"M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3m-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3m0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5m8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5"}),"Group");var Ft={},Ko=V;Object.defineProperty(Ft,"__esModule",{value:!0});var lr=Ft.default=void 0,Qo=Ko(F()),Zo=o;lr=Ft.default=(0,Qo.default)((0,Zo.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20m6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9"}),"NotInterested");var Vt=function(e){return o.jsx("svg",{...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.32989 8.20744C11.2787 6.82349 13.6098 6.08 16 6.08C18.3902 6.08 20.7213 6.82349 22.6701 8.20744C24.6189 9.59139 26.089 11.5473 26.8766 13.804C27.6642 16.0607 27.7304 18.5066 27.0659 20.8026C26.4419 22.9587 25.2026 24.8823 23.5044 26.3404H8.49555C6.79735 24.8823 5.55809 22.9587 4.9341 20.8026C4.26961 18.5066 4.33575 16.0607 5.12337 13.804C5.91098 11.5473 7.38107 9.59139 9.32989 8.20744ZM16 3.52C13.0786 3.52 10.2295 4.42871 7.84764 6.1202C5.46575 7.81169 3.66898 10.2022 2.70634 12.9604C1.7437 15.7187 1.66286 18.708 2.47501 21.5143C3.28717 24.3205 4.95211 26.8046 7.23909 28.6224C7.46554 28.8024 7.74628 28.9004 8.03554 28.9004H23.9644C24.2537 28.9004 24.5344 28.8024 24.7609 28.6224C27.0479 26.8046 28.7128 24.3205 29.5249 21.5143C30.3371 18.708 30.2563 15.7187 29.2936 12.9604C28.331 10.2022 26.5342 7.81169 24.1523 6.1202C21.7704 4.42871 18.9214 3.52 16 3.52ZM21.8829 13.5921C22.3827 13.0923 22.3827 12.2818 21.8829 11.7819C21.383 11.2821 20.5725 11.2821 20.0727 11.7819L17.868 13.9866C17.3072 13.7012 16.6724 13.5404 16 13.5404C13.7221 13.5404 11.8755 15.3869 11.8755 17.6648C11.8755 19.9427 13.7221 21.7892 16 21.7892C18.2779 21.7892 20.1244 19.9427 20.1244 17.6648C20.1244 16.9924 19.9635 16.3576 19.6782 15.7968L21.8829 13.5921ZM14.4355 17.6648C14.4355 16.8008 15.136 16.1004 16 16.1004C16.864 16.1004 17.5644 16.8008 17.5644 17.6648C17.5644 18.5288 16.864 19.2292 16 19.2292C15.136 19.2292 14.4355 18.5288 14.4355 17.6648Z",fill:"currentColor"})})};Vt.defaultProps={width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"};Vt.displayName="dashboard";var qt={},Xo=V;Object.defineProperty(qt,"__esModule",{value:!0});var ur=qt.default=void 0,Jo=Xo(F()),Yo=o;ur=qt.default=(0,Jo.default)((0,Yo.jsx)("path",{d:"m18.25 7.6-5.5-3.18c-.46-.27-1.04-.27-1.5 0L5.75 7.6c-.46.27-.75.76-.75 1.3v6.35c0 .54.29 1.03.75 1.3l5.5 3.18c.46.27 1.04.27 1.5 0l5.5-3.18c.46-.27.75-.76.75-1.3V8.9c0-.54-.29-1.03-.75-1.3M7 14.96v-4.62l4 2.32v4.61zm5-4.03L8 8.61l4-2.31 4 2.31zm1 6.34v-4.61l4-2.32v4.62zM7 2H3.5C2.67 2 2 2.67 2 3.5V7h2V4h3zm10 0h3.5c.83 0 1.5.67 1.5 1.5V7h-2V4h-3zM7 22H3.5c-.83 0-1.5-.67-1.5-1.5V17h2v3h3zm10 0h3.5c.83 0 1.5-.67 1.5-1.5V17h-2v3h-3z"}),"ViewInAr");const pe={Start:bo,Stop:rr,Restart:sr,Reload:or,Remove:fs,Config:ir,Log:ar,Group:cr,Cancel:lr,Dashboard:Vt,Overview:ur},ei=(e,t)=>{if(!e)return"";const n=new URL(e),r=new URLSearchParams(n.searchParams),s=new URL(he(n.origin,t));return s.search=r.toString(),s.toString()},ti="internal",ni="external";function Wt({blocklet:e,onStart:t,onComplete:n,variant:r,hasPermission:s,getComponentUrl:a,useBlockletUrlEvaluation:i,...c}){const l=at(),[u,d]=x.useState(null),[p,f]=x.useState(null),[y,g]=x.useState(!1),[h,S]=x.useState(null),{t:m}=x.useContext(Lt),[C]=Sn("skip-blocklet-setup",!1),{loading:w,recommendedUrl:L}=i(e),[R]=Sn("blocklet-type-filter",ti),j=N.isInProgress(e.status),[T,k]=x.useState(!1);x.useEffect(()=>{var A,H;if(!(e!=null&&e.controller))return;k(((H=(A=e==null?void 0:e.controller)==null?void 0:A.status)==null?void 0:H.value)===ce.BLOCKLET_CONTROLLER_STATUS.suspended),(async()=>{var q,te,oe;try{const W=await l.api.getLauncherSession({input:{launcherSessionId:(q=e==null?void 0:e.controller)==null?void 0:q.launcherSessionId,launcherUrl:(te=e==null?void 0:e.controller)==null?void 0:te.launcherUrl}});if(W!=null&&W.error){console.error("get launcher session failed",W.error);return}k([O.LAUNCH_SESSION_STATUS.overdue,O.LAUNCH_SESSION_STATUS.canceled,O.LAUNCH_SESSION_STATUS.terminated].includes((oe=W==null?void 0:W.launcherSession)==null?void 0:oe.status))}catch(W){console.error("call getLauncherSession error",W)}})()},[]);const{inService:E}=l,I=(b,A,H=!1)=>async()=>{const q=async Ne=>{var ze;t({action:b,blocklet:e}),g(!0),f(b);let Ue=!1;try{if(b==="remove")await A(Ne);else if(b==="start"){if(!N.hasRunnableComponent(e)){Z.error(m("blocklet.noComponent"));return}if(!E&&!C&&!((ze=e.settings)!=null&&ze.initialized)&&e.mode!==ce.BLOCKLET_MODES.DEVELOPMENT){if(!L||!xn(L)){Z.error(m("blocklet.gotoVisitError"));return}const Q=Vs(l.info),gn=new URL(L);gn.searchParams.set("serverUrl",Q),window.open(Cn(gn.href,{allowDomains:null})),n({action:b,blocklet:e});return}const ie=e.children.filter(Q=>!N.isInProgress(Q.status)&&Q.status!=="running").map(Q=>Q.meta.did),fe={did:e.meta.did,componentDids:ie};await A({input:fe})}else if(["stop","restart","reload"].includes(b)){const ie=e.children.filter(Q=>Q.status==="running").map(Q=>Q.meta.did),fe={did:e.meta.did,componentDids:ie};await A({input:fe})}else{const ie={did:e.meta.did};await A({input:ie})}b==="remove"?Ue=!0:await qs(1e3),b==="reload"&&Z.success(m("blocklet.reloadSuccess")),S(null),n({action:b,blocklet:e})}catch(ie){const fe=`Blocklet ${b} failed: ${Mt(ie)}`;throw n({action:b,blocklet:e,error:new Error(fe)}),new Error(fe)}finally{Ue||g(!1)}},te=()=>{g(!1),S(null)},oe=N.getDisplayName(e,!0),W=e.mode===ce.BLOCKLET_MODES.DEVELOPMENT?{description:()=>o.jsx(B,{component:"div",children:o.jsx(B,{gutterBottom:!0,children:m("blocklet.action.removeApplicationDescription")})}),params:{removeType:"complete"}}:{description:(Ne,Ue)=>o.jsxs(B,{component:"div",children:[o.jsx(B,{gutterBottom:!0,children:m("blocklet.action.removeApplicationDescription")}),o.jsxs(Ds,{name:"removeType",value:Ne.removeType,onChange:ze=>Ue({...Ne,removeType:ze.target.value}),children:[o.jsx(vn,{value:"backup",control:o.jsx(yn,{}),label:m("blocklet.action.removeApplicationAfterBackup")}),o.jsx(vn,{value:"complete",control:o.jsx(yn,{}),label:m("blocklet.action.removeApplicationComplete")})]})]}),params:{removeType:"backup"}},ds={stop:{title:`${m("common.stop")} ${oe}`,description:m("blocklet.action.stopDescription"),confirm:m("blocklet.action.confirmStop"),cancel:m("common.cancel"),onConfirm:q,onCancel:te},restart:{title:`${m("common.restart")} ${oe}`,description:m("blocklet.action.restartDescription"),confirm:m("blocklet.action.confirmRestart"),cancel:m("common.cancel"),onConfirm:q,onCancel:te},remove:{title:`${m("common.remove")} ${oe}`,confirm:m("blocklet.action.confirmRemove"),cancel:m("common.cancel"),onConfirm:q,onCancel:te,...W},cancelDownload:{title:`${m("common.cancel")}`,description:m("blocklet.action.cancelDownloadDescription",{name:oe}),confirm:m("common.confirm"),cancel:m("common.cancel"),onConfirm:q,onCancel:te}};H?S(ds[b]):await q()},U=!!u,M=b=>{try{b.stopPropagation(),b.preventDefault()}catch{}d(b.currentTarget)},z=b=>{try{b.stopPropagation(),b.preventDefault()}catch{}d(null)},$e=async(b,A)=>{try{A.stopPropagation(),A.preventDefault()}catch{}if(typeof b.handler=="function")try{g(!0),f(b.action),await b.handler()}catch(H){console.error(`Blocklet ${b.name} failed: `,H)}finally{g(!1),d(null)}else d(null)},as=!E&&N.isDeletableBlocklet(e)?{action:"remove",icon:pe.Remove,name:m("common.remove"),handler:I("remove",async({removeType:b})=>{b==="backup"&&await l.api.backupBlocklet({input:{appDid:e.appDid,to:"disk"}}),await l.api.deleteBlocklet({input:{did:e.meta.did,keepData:!1}})},!0),disabled:j}:null,cs={action:"remove",icon:({sx:b,...A})=>o.jsx(pe.Cancel,{sx:{...b,paddingRight:"2px",zoom:.95},...A}),name:m("common.cancel"),handler:I("cancelDownload",l.api.cancelDownloadBlocklet,!0)},ls=N.getAppMissingConfigs(e),us=()=>{var q;const b=`/${e.mountPoint||"/"}`.replace(/\/+/g,"/"),A=a==null?void 0:a({mountPoint:b,blocklet:e});if(!A||!xn(A)){Z.error(m("blocklet.gotoVisitError"));return}const H=(q=e==null?void 0:e.site)==null?void 0:q.domainAliases;window.open(Cn(ei(A,".well-known/service/admin"),{allowDomains:H==null?void 0:H.map(te=>te.value)}))};let Oe=[{action:"start",icon:pe.Start,inExternal:!0,name:m("common.start"),handler:I("start",l.api.startBlocklet),disabled:T||e.children.every(b=>b.status==="running")||ft(e.status)||w||j},{action:"stop",icon:pe.Stop,inExternal:!0,name:m("common.stop"),handler:I("stop",l.api.stopBlocklet,!0),disabled:!["running","starting"].includes(e.status)},{action:"restart",inExternal:!0,icon:pe.Restart,name:m("common.restart"),handler:I("restart",l.api.restartBlocklet,!0),disabled:T||e.status!=="running"},ft(e.status)?cs:as,{separator:!0},E?null:{action:"dashboard",icon:({style:b,...A})=>o.jsx(pe.Dashboard,{...A,style:{...b,width:"26px",height:"26px",paddingRight:"3px"}}),name:m("sidebar.dashboard"),handler:us}].filter(Boolean);return R===ni&&(Oe=Oe.filter(b=>b.inExternal)),r==="menu"?o.jsxs(In,{"data-cy":"blocklet-actions",children:[o.jsx(Rt,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions","actions-blocklet-did":e.meta.did,onClick:M,size:"small",disabled:!s||!ft(e.status)&&y,children:o.jsx(ps,{})}),o.jsxs(Is,{id:"actions-menu",anchorEl:u,keepMounted:!0,open:U,onClose:z,PaperProps:{},children:[ls.length>0&&o.jsxs(Bn,{style:{maxWidth:"400px"},severity:"error",children:[m("blocklet.config.missingRequired"),o.jsx("br",{}),o.jsx(Gn,{to:`/blocklets/${e.meta.did}/components`,children:m("blocklet.config.gotoFix")})]}),Oe.map((b,A)=>b.separator?o.jsx(At,{},`separator-${A}`):o.jsxs(ks,{dense:!0,onClick:H=>$e(b,H),disabled:y||b.disabled,"data-cy":`${b.action}-blocklet`,children:[o.jsx(Ts,{style:{minWidth:24},children:p===b.action&&y?o.jsx(re,{size:16,sx:{marginRight:1}}):o.jsx(b.icon,{fontSize:"small"})}),o.jsx(Es,{primary:b.name})]},b.name))]}),h&&o.jsx(_n,{title:h.title,description:h.description,confirm:h.confirm,cancel:h.cancel,params:h.params,onConfirm:h.onConfirm,onCancel:h.onCancel})]}):o.jsxs(In,{"data-cy":"blocklet-actions",...c,children:[o.jsx(Ls,{children:Oe.filter(b=>!b.separator&&!b.onlyInMenu).map(b=>o.jsxs(Dt,{title:b.name,"data-cy":`${b.action}-blocklet`,onClick:()=>$e(b),disabled:!!b.disabled||y,children:[p===b.action&&y?o.jsx(re,{size:16,sx:{marginRight:1}}):o.jsx(b.icon,{}),o.jsx("span",{className:"blocklet-action-text",children:b.name})]},b.name))}),h&&o.jsx(_n,{title:h.title,description:h.description,confirm:h.confirm,cancel:h.cancel,params:h.params,onConfirm:h.onConfirm,onCancel:h.onCancel})]})}Wt.propTypes={getComponentUrl:v.func,blocklet:v.object.isRequired,onStart:v.func.isRequired,onComplete:v.func.isRequired,variant:v.oneOf(["menu","group"]),hasPermission:v.bool,useBlockletUrlEvaluation:v.func};Wt.defaultProps={getComponentUrl:null,variant:"menu",hasPermission:!1,useBlockletUrlEvaluation:()=>{var e;return{loading:!1,recommendedUrl:(e=window==null?void 0:window.location)==null?void 0:e.href}}};const In=K.div`
|
|
3
3
|
display: flex;
|
|
4
4
|
align-items: center;
|
|
5
5
|
|
|
@@ -194,7 +194,7 @@ ${r}
|
|
|
194
194
|
.header-brand-addon {
|
|
195
195
|
display: block;
|
|
196
196
|
}
|
|
197
|
-
`;function Ac(){var m,C,w;const{t:e,locale:t}=Y(),{blocklet:n,launcherSession:r,refreshSubscription:s}=ve(),{connectApi:a,session:i,api:c}=Xs(),[l,u]=x.useState(!1),[d,p]=x.useState(""),[f,y]=wo({subscriptionURL:"#"});if(x.useEffect(()=>{var L,R;(bn(n,r)||wn(r))&&Js({launcherSessionId:(L=n==null?void 0:n.controller)==null?void 0:L.launcherSessionId,launcherUrl:(R=n==null?void 0:n.controller)==null?void 0:R.launcherUrl,locale:t}).then(j=>{y({subscriptionURL:j})}).catch(j=>{console.error("get subscription url error:",j)})},[n,r]),x.useEffect(()=>{var L;if((L=n.controller)!=null&&L.launcherUrl){const R=he(n.controller.launcherUrl,"__blocklet__.js?type=json");fetch(R).then(j=>j.json()).then(j=>{var E,I;const T=(I=(E=j.componentMountPoints)==null?void 0:E.find(U=>U.did==="z2qaCNvKMv5GjouKdcDWexv6WqtHbpNPQDnAk"))==null?void 0:I.mountPoint,k=he(n.controller.launcherUrl,T);p(k)})}},[(m=n.controller)==null?void 0:m.launcherUrl]),!n||!r)return"";let g=null,h="",S="error";return Ys(r)?(g=eo(r)?o.jsx(Se,{href:f.subscriptionURL,children:e("blocklet.manageSubscription")}):o.jsx(Us,{variant:"text",color:"error",onClick:()=>u(!0),sx:{lineHeight:"inherit",fontSize:"inherit"},children:e("blocklet.payNow")}),h=e("blocklet.suspendedCausedByPastDue",{deadline:be(r==null?void 0:r.reservedUntil,t)})):wn(r)?(g=o.jsx(Se,{href:f.subscriptionURL,children:e("blocklet.manageSubscription")}),h=e("blocklet.willBeSuspendedSoon",{deadline:be((((C=r==null?void 0:r.subscription)==null?void 0:C.cancel_at)||0)*1e3,t)}),S="warning"):bn(n,r)?(g=o.jsx(Se,{href:f.subscriptionURL,children:e("blocklet.manageSubscription")}),h=e("blocklet.suspendedCausedByExpired",{deadline:be(r==null?void 0:r.reservedUntil,t),canceledAt:be((((w=r==null?void 0:r.subscription)==null?void 0:w.canceled_at)||0)*1e3,t)})):to(n,r)&&(g=o.jsx(Gn,{to:he(O.WELLKNOWN_BLOCKLET_ADMIN_PATH,"/did-spaces"),children:e("common.backup")}),h=e("blocklet.suspendedCausedByTerminated",{canceledAt:be(r==null?void 0:r.terminatedAt,t),deadline:no(r==null?void 0:r.terminatedAt,t)})),h?o.jsxs(_,{component:Ss,type:S,sx:{"&> .alert-content":{display:"block"}},children:[l&&d&&r&&o.jsx(ro,{session:i,connect:a,baseUrl:d,authToken:r.subscription.authToken,children:o.jsx(so,{dialogProps:{open:l,onClose:()=>u(!1)},subscriptionId:r.subscription.id,successToast:!0,onPaid:()=>{c.post("/blocklet/start?fromSetup=1"),s(),u(!1)}})}),h,o.jsx(B,{component:"span",sx:{marginLeft:"4px"},children:g})]}):null}const os=x.createContext({});function Pl(){return x.useContext(os)}const{Provider:Mc,Consumer:Rl}=os,{did:G,appId:$c}=window.env;function Oc({children:e}){var j,T;const{t,locale:n}=Y(),{blocklet:r}=ve(),[s,a]=x.useState([]),[i,c]=x.useState([]),[l,u]=x.useState([]),d=N.getDisplayName(r),p=((j=((r==null?void 0:r.environments)||[]).find(k=>k.key===ce.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_PASSPORT_COLOR))==null?void 0:j.value)||"auto",f=(r==null?void 0:r.trustedPassports)||[],y=(r==null?void 0:r.trustedFactories)||[],g=(r==null?void 0:r.enablePassportIssuance)!==!1,h=async()=>{try{const k=await Be.doBatchQuery({getRoles:{input:{teamDid:G}},getPermissions:{input:{teamDid:G}},getInvitations:{input:{teamDid:G}}}),E=(k.getRoles.roles||[]).filter(I=>!O.RBAC_CONFIG.roles.some(U=>U.name===I.name&&(!U.passport||U.ci))).map(I=>(I.hasDescription=!!I.description,I.hasDescription||(I.description=t("team.passport.description",{teamName:d,title:I.title})),I));c(po(E,[I=>oo(I.name)],["desc"])),u(k.getPermissions.permissions||[]),a(k.getInvitations.invitations||[])}catch(k){Z.error(k.message)}},S=({did:k}={})=>{const E={teamDid:G,user:{did:k}};return Be.getUser({input:E})},m=({query:k,paging:E}={})=>{const I={teamDid:G};return E&&(I.paging=E),k&&(I.query=k),I.sort={lastLoginAt:-1},Be.getUsers({input:I})},C=()=>Be.getUsersCountPerRole({input:{teamDid:G}}),w=()=>h();x.useEffect(()=>{var k;(k=r==null?void 0:r.meta)!=null&&k.did&&h()},[(T=r==null?void 0:r.meta)==null?void 0:T.did]),x.useEffect(()=>{c(k=>k.map(E=>(E.hasDescription||(E.description=t("team.passport.description",{teamName:d,title:E.title})),{...E})))},[t,n]);const L=k=>{k.teamDid===G&&h()};We(ce.TeamEvents.userAdded,L,[G]),We(ce.TeamEvents.userRemoved,L,[G]),We(ce.TeamEvents.userUpdated,L,[G]);const R={teamDid:G,teamIssuerDid:$c,teamName:d,invitations:s,roles:i,permissions:l,trustedPassports:f,trustedFactories:y,isNodeTeam:!1,enablePassportIssuance:g,refresh:w,passportColor:p,endpoint:window.location.origin,blocklet:r,api:{getUser:S,getUsers:m,getUsersCountPerRole:C}};return o.jsx(Mc,{value:R,children:e})}const Nc=x.lazy(()=>D(()=>import("./log-Bwqh69bM.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]))),Uc=x.lazy(()=>D(()=>import("./index-D-Lxloq5.js"),__vite__mapDeps([15,2,1,5,4,6,7,8,10,16,9,11,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,3,41,42,43,44,45,46,47]))),zc=x.lazy(()=>D(()=>import("./index-DvBh35bh.js"),__vite__mapDeps([48,4,2,5,1,6,7,8,44,10,17,18,19,20,21,9,11,49,50,34,30,38,39,51,3,41,42,25,43,45,31,46,47]))),Bc=x.lazy(()=>D(()=>import("./index-BCJADuMw.js"),__vite__mapDeps([52,2,1,9,4,5,6,7,8,10,11,53,34,30,25,23,54,13,40,55,12,26,56,46,57,58,59,60,61,28,33,62,63,64,65,66,42,67,68,69,70]))),Hc=x.lazy(()=>D(()=>import("./overview-DqabCKYi.js"),__vite__mapDeps([71,1,2,4,5,6,7,8,10,44,72,9,11,32,45,31,23,73,74,75,60,3,30,34,41,42,25,43,46,47]))),Fc=x.lazy(()=>D(()=>import("./domains-DeFj6Ipl.js"),__vite__mapDeps([76,2,4,5,1,6,7,8,9,10,11,77,50,24,25,45,31,34,30,38,39,66,26,78,46,44,32,79]))),Vc=x.lazy(()=>D(()=>import("./index-Drd9jydY.js"),__vite__mapDeps([80,2,6,5,1,4,7,8,9,10,11,23,81,17,18,19,20,21,35,36,49,24,25,82,83,84,34,30,55,46,85,3,41,42,43,44,45,31,47]))),qc=x.lazy(()=>D(()=>import("./appearance-ChvtVBNv.js"),__vite__mapDeps([86,5,2,4,1,6,7,8,9,10,11,49]))),Wc=x.lazy(()=>D(()=>import("./audit-logs-DXoc97BV.js"),__vite__mapDeps([87,4,2,5,1,6,7,8,35,36,3,9,10,11,68,69,44,40,70,30,34,41,42,25,43,45,31,46,47]))),Gc=x.lazy(()=>D(()=>import("./index-DBqLPDUh.js"),__vite__mapDeps([88,2,1,5,4,6,7,8,9,10,11,43,25,89,90,40,32,91,59,13,44,79,17,18,19,20,21,35,36,23,92,45,31,93,94,95,61,96,30,97,98,28,29,49,3,34,41,42,46,47]))),Kc=x.lazy(()=>D(()=>import("./config-navigation-BvjYZI_j.js"),__vite__mapDeps([99,2,4,5,1,6,7,8,74,83,10,100,9,11,101,102,67,60,43,25,62,63,93,30,3,34,41,42,44,45,31,46,47]))),Qc=x.lazy(()=>D(()=>import("./index-W_fQ-nuf.js"),__vite__mapDeps([103,1,2,6,5,10,4,7,8,9,11,49,60,104,105,75,30,33,32,98,39,42,106,55,3,34,41,25,43,44,45,31,46,47]))),Zc=x.lazy(()=>D(()=>import("./index-BoTgqYtV.js"),__vite__mapDeps([107,4,2,5,1,6,7,8,10,9,11,106,90,72,32,36,49]))),Xc=x.lazy(()=>D(()=>import("./security-DCArL_za.js"),__vite__mapDeps([108,4,2,5,1,6,7,8,9,10,11,102,109,49,3,30,34,41,42,25,43,44,45,31,46,47]))),Jc=x.lazy(()=>D(()=>import("./branding-DuPWVNlC.js"),__vite__mapDeps([110,2,1,4,5,6,7,8,10,65,111,57,84,67,9,11,24,25,43,90]))),Yc=x.lazy(()=>D(()=>import("./advanced-hz-KSWn2.js"),__vite__mapDeps([112,2,1,9,4,5,6,7,8,10,11,24,25,44,34,30,46,90,26,32,23,73,74,3,41,42,43,45,31,47]))),el=x.lazy(()=>D(()=>import("./traffic-BqHyn9L9.js").then(e=>e.t),__vite__mapDeps([92,2,9,1,4,5,6,7,8,10,11,45,31,93,94,95,61,96,30,97,98,28,29]))),tl=x.lazy(()=>D(()=>import("./runtime-B454s6Gb.js"),__vite__mapDeps([113,2,1,4,5,6,7,8,9,10,11,97,98,13,3,30,34,41,42,25,43,44,45,31,46,47]))),nl=x.lazy(()=>D(()=>import("./index-DDXNOodN.js"),__vite__mapDeps([114,2,4,5,1,6,7,8,115,30,17,10,18,19,20,21,81,23,35,36,9,11,27,28,29,34,26,66,24,25,13,38,39,49,51,44,3,41,42,43,45,31,46,47]))),rl=x.lazy(()=>D(()=>import("./list-b96sX5Y6.js"),__vite__mapDeps([116,2,4,5,1,6,7,8,10,115,17,18,19,20,21,45,31,22,9,11,27,28,29,54,26,66,34,30,81,23,35,36,38,39,51,44,49,3,41,42,25,43,46,47]))),sl=x.lazy(()=>D(()=>import("./index-C64IgZKt.js"),__vite__mapDeps([117,2,4,5,1,6,7,8,58,60,51,44,49,9,10,11,3,30,34,41,42,25,43,45,31,46,47]))),ol=x.lazy(()=>D(()=>import("./component-CURpjZJ2.js"),__vite__mapDeps([118,1,2,5,4,6,7,8,10,9,11,30,119,106,24,25,115,101,96,63,26,61,95,67,120,64,58,65,33,66,34,42,23,121,122,105,75,60,111,57,123,89,82,83,68,69,100,32,3,78,49,124,104,125,85,44,93,13,41,38,39,43,45,31,46,47]))),il=x.lazy(()=>D(()=>import("./index-Dsd9SXVN.js"),__vite__mapDeps([126,1,2,4,5,6,7,8,9,10,11]))),al=he(O.WELLKNOWN_SERVICE_PATH_PREFIX,"user","notifications"),cl=e=>{const{enqueueSnackbar:t}=zn(),n=x.useCallback(r=>Xn(al,{id:r.id,severity:r.severity||"all",componentDid:r.source==="system"?"system":r.componentDid||"all"}),[]);We(`${e}/${O.EVENTS.NOTIFICATION_BLOCKLET_CREATE}`,r=>{const s=n(r),{severity:a,description:i}=r||{},c=["error","warning"].includes(a)||r.sticky;r.source==="system"&&t(i,{variant:a,autoHideDuration:c?null:5e3,content:l=>o.jsx(fi,{viewAllUrl:s,keyId:l,notification:r,content:o.jsx(Ei,{notification:r,minimal:!0,rows:0})})})},[],"user")};function is({blocklet:e,isAdmin:t}){return t?o.jsx(Gc,{blocklet:e}):o.jsx(yo,{status:403})}is.propTypes={blocklet:v.object.isRequired,isAdmin:v.bool.isRequired};const ll=e=>{var d,p;const{t}=Y(),{blocklet:n,actions:{refreshBlocklet:r},client:s,did:a}=ve(),i=(d=n==null?void 0:n.meta)==null?void 0:d.did,c=!n||lo(n.status)?[]:N.getAppMissingConfigs(n),l={overview:[{label:t("common.overview"),value:"overview"},{label:o.jsx(zs,{"data-cy":"blocklet-list",color:"error",variant:"dot",invisible:!c.length,children:t("common.components")}),value:"components"}],"did-connect":[{label:t("common.members"),value:"members"},{label:t("team.member.passports"),value:"passports"},{label:t("common.setting"),value:"settings"},{label:t("common.security"),value:"security"},{label:t("oauth.client.tab"),value:"oauth"}],website:[{label:t("common.domains"),value:"domains"},{label:t("common.branding"),value:"branding"},{label:t("common.theming"),value:"theming"},{label:t("common.navigation"),value:"navigation"}],operations:[{label:t("common.notificationRecords"),value:"notifications",show:e},{label:t("common.analytics"),value:"analytics"},{label:t("common.auditLogs"),value:"audit-logs"},{label:t("common.advancedConfig"),value:"advanced"}],integrations:[{label:"Webhooks",value:"webhooks",show:e},{label:t("common.accessKeys"),value:"access-keys"},{label:t("common.mcpServers"),value:"mcp-servers"}],developers:[{label:t("common.logs"),value:"logs",show:((p=n==null?void 0:n.children)==null?void 0:p.length)&&n.structVersion===O.APP_STRUCT_VERSION},{label:t("common.performance"),value:"performance"},{label:t("common.docs"),value:"docs"}]},u={overview:Hc,components:ol,members:o.jsx(Uc,{type:"blocklet",createPassportSvg:jn}),passports:o.jsx(Vc,{createPassportSvg:jn}),settings:o.jsx(Zc,{orientation:"vertical"}),security:o.jsx(Xc,{}),"did-spaces":o.jsx(Qc,{navOrientation:"horizontal"}),domains:Fc,branding:o.jsx(Jc,{blocklet:n,onUpdate:r}),theming:o.jsx(qc,{}),navigation:Kc,sitemap:o.jsx(Cs,{children:t("common.comingSoon")}),notifications:o.jsx(is,{blocklet:n,isAdmin:e}),"audit-logs":o.jsx(Wc,{scope:i,categories:["blocklet","team","security","certificates","gateway"]}),analytics:o.jsx(el,{client:s,did:a}),advanced:o.jsx(Yc,{blocklet:n,onUpdate:r}),webhooks:o.jsx(zc,{}),"access-keys":o.jsx(nl,{}),"mcp-servers":o.jsx(sl,{}),logs:Nc,performance:o.jsx(tl,{client:s,did:a}),docs:il,publish:o.jsx(Bc,{}),oauth:o.jsx(rl,{})};return{tabGroups:l,renders:u}};function ul(){var m,C;const e=Kn(),{tab:t="overview",subtab:n}=Fs(),{blocklet:r,refreshFlag:s}=ve(),{session:a}=Yn(),i=ge(()=>{var w;return(w=a==null?void 0:a.user)==null?void 0:w.did},[a]),c=Eo(),l=ge(()=>{var w;return((w=a.user)==null?void 0:w.role)&&ao.includes(a.user.role)},[a]);cl(i);const{tabGroups:u,renders:d}=ll(l),p=w=>{e(`${O.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/${t}/${w}`)},f=(u[t]||[]).filter(w=>w.show===void 0||w.show),y=((m=(f||[]).find(w=>w.value===n))==null?void 0:m.value)||((C=f==null?void 0:f[0])==null?void 0:C.value)||t,g=d[y]||d.overview,h=["overview"].includes(t),S=r?o.jsxs($t,{type:"components",children:[f.length>0&&o.jsxs(_,{mb:2,display:"flex",alignItems:"center",gap:2,children:[o.jsx(_s,{tabs:f,current:y,onChange:p,scrollButtons:"auto"}),h&&!c&&o.jsx(_,{flex:1,display:"flex",justifyContent:"flex-end",children:o.jsx(_,{component:"div",className:"page-header",children:r?o.jsx(kn,{className:"page-actions",hasPermission:!0,blocklet:r,onStart:()=>{},onComplete:({error:w}={})=>{w&&Z.error(w.message)},variant:"group"}):null})})]}),o.jsx(_,{className:"page-content",children:o.jsx(x.Suspense,{fallback:o.jsx(Je,{relative:"parent",children:o.jsx(re,{})}),children:x.isValidElement(g)?g:o.jsx(g,{blocklet:r})})})]}):o.jsx(Je,{relative:"parent",children:o.jsx(re,{})});return o.jsx(co,{children:o.jsx(Oc,{children:o.jsx(hn,{children:o.jsxs(fl,{children:[c&&h&&o.jsx(_,{component:"div",className:"page-header",mb:2,children:r?o.jsx(kn,{className:"page-actions",hasPermission:!0,blocklet:r,onStart:()=>{},onComplete:({error:w}={})=>{w&&Z.error(w.message)},variant:"group"}):null}),o.jsx(dr,{}),o.jsx(Ac,{}),S]})},`${s}`)})})}function dl(){var r;const{blocklet:e}=ve(),{t}=Y(),n=(r=e==null?void 0:e.meta)==null?void 0:r.did;return x.useEffect(()=>{const s=io();return n&&s.connect(),()=>{n&&s.isConnected()&&s.disconnect()}},[n]),o.jsxs(o.Fragment,{children:[o.jsx(vo,{children:o.jsx("title",{children:t("pageTitle.dashboard")})}),o.jsx(ul,{})]})}const fl=K.main`
|
|
197
|
+
`;function Ac(){var m,C,w;const{t:e,locale:t}=Y(),{blocklet:n,launcherSession:r,refreshSubscription:s}=ve(),{connectApi:a,session:i,api:c}=Xs(),[l,u]=x.useState(!1),[d,p]=x.useState(""),[f,y]=wo({subscriptionURL:"#"});if(x.useEffect(()=>{var L,R;(bn(n,r)||wn(r))&&Js({launcherSessionId:(L=n==null?void 0:n.controller)==null?void 0:L.launcherSessionId,launcherUrl:(R=n==null?void 0:n.controller)==null?void 0:R.launcherUrl,locale:t}).then(j=>{y({subscriptionURL:j})}).catch(j=>{console.error("get subscription url error:",j)})},[n,r]),x.useEffect(()=>{var L;if((L=n.controller)!=null&&L.launcherUrl){const R=he(n.controller.launcherUrl,"__blocklet__.js?type=json");fetch(R).then(j=>j.json()).then(j=>{var E,I;const T=(I=(E=j.componentMountPoints)==null?void 0:E.find(U=>U.did==="z2qaCNvKMv5GjouKdcDWexv6WqtHbpNPQDnAk"))==null?void 0:I.mountPoint,k=he(n.controller.launcherUrl,T);p(k)})}},[(m=n.controller)==null?void 0:m.launcherUrl]),!n||!r)return"";let g=null,h="",S="error";return Ys(r)?(g=eo(r)?o.jsx(Se,{href:f.subscriptionURL,children:e("blocklet.manageSubscription")}):o.jsx(Us,{variant:"text",color:"error",onClick:()=>u(!0),sx:{lineHeight:"inherit",fontSize:"inherit"},children:e("blocklet.payNow")}),h=e("blocklet.suspendedCausedByPastDue",{deadline:be(r==null?void 0:r.reservedUntil,t)})):wn(r)?(g=o.jsx(Se,{href:f.subscriptionURL,children:e("blocklet.manageSubscription")}),h=e("blocklet.willBeSuspendedSoon",{deadline:be((((C=r==null?void 0:r.subscription)==null?void 0:C.cancel_at)||0)*1e3,t)}),S="warning"):bn(n,r)?(g=o.jsx(Se,{href:f.subscriptionURL,children:e("blocklet.manageSubscription")}),h=e("blocklet.suspendedCausedByExpired",{deadline:be(r==null?void 0:r.reservedUntil,t),canceledAt:be((((w=r==null?void 0:r.subscription)==null?void 0:w.canceled_at)||0)*1e3,t)})):to(n,r)&&(g=o.jsx(Gn,{to:he(O.WELLKNOWN_BLOCKLET_ADMIN_PATH,"/did-spaces"),children:e("common.backup")}),h=e("blocklet.suspendedCausedByTerminated",{canceledAt:be(r==null?void 0:r.terminatedAt,t),deadline:no(r==null?void 0:r.terminatedAt,t)})),h?o.jsxs(_,{component:Ss,type:S,sx:{"&> .alert-content":{display:"block"}},children:[l&&d&&r&&o.jsx(ro,{session:i,connect:a,baseUrl:d,authToken:r.subscription.authToken,children:o.jsx(so,{dialogProps:{open:l,onClose:()=>u(!1)},subscriptionId:r.subscription.id,successToast:!0,onPaid:()=>{c.post("/blocklet/start?fromSetup=1"),s(),u(!1)}})}),h,o.jsx(B,{component:"span",sx:{marginLeft:"4px"},children:g})]}):null}const os=x.createContext({});function Pl(){return x.useContext(os)}const{Provider:Mc,Consumer:Rl}=os,{did:G,appId:$c}=window.env;function Oc({children:e}){var j,T;const{t,locale:n}=Y(),{blocklet:r}=ve(),[s,a]=x.useState([]),[i,c]=x.useState([]),[l,u]=x.useState([]),d=N.getDisplayName(r),p=((j=((r==null?void 0:r.environments)||[]).find(k=>k.key===ce.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_PASSPORT_COLOR))==null?void 0:j.value)||"auto",f=(r==null?void 0:r.trustedPassports)||[],y=(r==null?void 0:r.trustedFactories)||[],g=(r==null?void 0:r.enablePassportIssuance)!==!1,h=async()=>{try{const k=await Be.doBatchQuery({getRoles:{input:{teamDid:G}},getPermissions:{input:{teamDid:G}},getInvitations:{input:{teamDid:G}}}),E=(k.getRoles.roles||[]).filter(I=>!O.RBAC_CONFIG.roles.some(U=>U.name===I.name&&(!U.passport||U.ci))).map(I=>(I.hasDescription=!!I.description,I.hasDescription||(I.description=t("team.passport.description",{teamName:d,title:I.title})),I));c(po(E,[I=>oo(I.name)],["desc"])),u(k.getPermissions.permissions||[]),a(k.getInvitations.invitations||[])}catch(k){Z.error(k.message)}},S=({did:k}={})=>{const E={teamDid:G,user:{did:k}};return Be.getUser({input:E})},m=({query:k,paging:E}={})=>{const I={teamDid:G};return E&&(I.paging=E),k&&(I.query=k),I.sort={lastLoginAt:-1},Be.getUsers({input:I})},C=()=>Be.getUsersCountPerRole({input:{teamDid:G}}),w=()=>h();x.useEffect(()=>{var k;(k=r==null?void 0:r.meta)!=null&&k.did&&h()},[(T=r==null?void 0:r.meta)==null?void 0:T.did]),x.useEffect(()=>{c(k=>k.map(E=>(E.hasDescription||(E.description=t("team.passport.description",{teamName:d,title:E.title})),{...E})))},[t,n]);const L=k=>{k.teamDid===G&&h()};We(ce.TeamEvents.userAdded,L,[G]),We(ce.TeamEvents.userRemoved,L,[G]),We(ce.TeamEvents.userUpdated,L,[G]);const R={teamDid:G,teamIssuerDid:$c,teamName:d,invitations:s,roles:i,permissions:l,trustedPassports:f,trustedFactories:y,isNodeTeam:!1,enablePassportIssuance:g,refresh:w,passportColor:p,endpoint:window.location.origin,blocklet:r,api:{getUser:S,getUsers:m,getUsersCountPerRole:C}};return o.jsx(Mc,{value:R,children:e})}const Nc=x.lazy(()=>D(()=>import("./log-B7EGR5B1.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]))),Uc=x.lazy(()=>D(()=>import("./index-DkNMM_jp.js"),__vite__mapDeps([15,2,1,5,4,6,7,8,10,16,9,11,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,3,42,43,44,45,46,47,48]))),zc=x.lazy(()=>D(()=>import("./index-DIzYQ8YY.js"),__vite__mapDeps([49,4,2,5,1,6,7,8,45,10,17,18,19,20,21,9,11,50,51,35,30,39,40,52,3,42,43,25,44,46,32,47,48]))),Bc=x.lazy(()=>D(()=>import("./index-B7PoXGHo.js"),__vite__mapDeps([53,2,1,9,4,5,6,7,8,10,11,54,35,30,25,23,55,13,41,56,12,26,57,47,58,59,60,61,62,28,34,63,64,65,66,67,43,68,69,70,71]))),Hc=x.lazy(()=>D(()=>import("./overview-DO_rMORL.js"),__vite__mapDeps([72,1,2,4,5,6,7,8,10,45,73,9,11,33,46,32,23,74,75,76,61,3,30,35,42,43,25,44,47,48]))),Fc=x.lazy(()=>D(()=>import("./domains-D6W7Zk5a.js"),__vite__mapDeps([77,2,4,5,1,6,7,8,9,10,11,78,51,24,25,46,32,35,30,39,40,67,26,79,47,45,31,33,80]))),Vc=x.lazy(()=>D(()=>import("./index-bu2nusyV.js"),__vite__mapDeps([81,2,6,5,1,4,7,8,9,10,11,23,82,17,18,19,20,21,36,37,50,24,25,83,84,85,35,30,56,47,86,3,42,43,44,45,46,32,48]))),qc=x.lazy(()=>D(()=>import("./appearance-Bf8ha2QN.js"),__vite__mapDeps([87,5,2,4,1,6,7,8,9,10,11,50]))),Wc=x.lazy(()=>D(()=>import("./audit-logs-BmFsZWcQ.js"),__vite__mapDeps([88,4,2,5,1,6,7,8,36,37,3,9,10,11,69,70,45,41,71,30,35,42,43,25,44,46,32,47,48]))),Gc=x.lazy(()=>D(()=>import("./index-DESkMgoq.js"),__vite__mapDeps([89,2,1,5,4,6,7,8,9,10,11,44,25,90,91,41,33,92,60,13,45,80,17,18,19,20,21,36,37,23,93,46,32,94,95,96,62,97,30,98,99,28,29,50,3,35,42,43,47,48]))),Kc=x.lazy(()=>D(()=>import("./config-navigation-CvCO7Fuh.js"),__vite__mapDeps([100,2,4,5,1,6,7,8,75,84,10,101,9,11,102,103,68,61,44,25,63,64,94,30,3,35,42,43,45,46,32,47,48]))),Qc=x.lazy(()=>D(()=>import("./index-ChEmNV9t.js"),__vite__mapDeps([104,1,2,6,5,10,4,7,8,9,11,50,61,105,106,76,30,34,33,99,40,43,107,56,3,35,42,25,44,45,46,32,47,48]))),Zc=x.lazy(()=>D(()=>import("./index-0epbdrMx.js"),__vite__mapDeps([108,4,2,5,1,6,7,8,10,9,11,107,91,73,33,37,50]))),Xc=x.lazy(()=>D(()=>import("./security-BO4vz2A4.js"),__vite__mapDeps([109,4,2,5,1,6,7,8,9,10,11,103,110,50,3,30,35,42,43,25,44,45,46,32,47,48]))),Jc=x.lazy(()=>D(()=>import("./branding-BsDB7rHi.js"),__vite__mapDeps([111,2,1,4,5,6,7,8,10,112,75,101,66,113,58,85,68,9,11,24,25,44,91]))),Yc=x.lazy(()=>D(()=>import("./advanced-DO1hLdXY.js"),__vite__mapDeps([114,2,1,9,4,5,6,7,8,10,11,24,25,45,35,30,47,91,26,33,23,74,75,3,42,43,44,46,32,48]))),el=x.lazy(()=>D(()=>import("./traffic-CSdm4uyu.js").then(e=>e.t),__vite__mapDeps([93,2,9,1,4,5,6,7,8,10,11,46,32,94,95,96,62,97,30,98,99,28,29]))),tl=x.lazy(()=>D(()=>import("./runtime-4wAQAE28.js"),__vite__mapDeps([115,2,1,4,5,6,7,8,9,10,11,98,99,13,3,30,35,42,43,25,44,45,46,32,47,48]))),nl=x.lazy(()=>D(()=>import("./index-xbFMe1Dq.js"),__vite__mapDeps([116,2,4,5,1,6,7,8,117,30,17,10,18,19,20,21,82,23,36,37,9,11,27,28,29,35,26,67,24,25,13,39,40,50,52,45,3,42,43,44,46,32,47,48]))),rl=x.lazy(()=>D(()=>import("./list-C3bba0fZ.js"),__vite__mapDeps([118,2,4,5,1,6,7,8,10,117,17,18,19,20,21,46,32,22,9,11,27,28,29,55,26,67,35,30,82,23,36,37,39,40,52,45,50,3,42,43,25,44,47,48]))),sl=x.lazy(()=>D(()=>import("./index-Dq0Wocff.js"),__vite__mapDeps([119,2,4,5,1,6,7,8,59,61,52,45,50,9,10,11,3,30,35,42,43,25,44,46,32,47,48]))),ol=x.lazy(()=>D(()=>import("./component-BnKz-jfM.js"),__vite__mapDeps([120,1,2,5,4,6,7,8,10,9,11,30,121,107,24,25,117,102,97,64,112,75,101,26,62,96,68,122,65,59,66,34,67,35,43,23,123,124,106,76,61,113,58,125,90,83,84,69,70,33,3,79,50,126,105,127,86,45,94,13,42,39,40,44,46,32,47,48]))),il=x.lazy(()=>D(()=>import("./index-B9IGWqlM.js"),__vite__mapDeps([128,1,2,4,5,6,7,8,9,10,11]))),al=he(O.WELLKNOWN_SERVICE_PATH_PREFIX,"user","notifications"),cl=e=>{const{enqueueSnackbar:t}=zn(),n=x.useCallback(r=>Xn(al,{id:r.id,severity:r.severity||"all",componentDid:r.source==="system"?"system":r.componentDid||"all"}),[]);We(`${e}/${O.EVENTS.NOTIFICATION_BLOCKLET_CREATE}`,r=>{const s=n(r),{severity:a,description:i}=r||{},c=["error","warning"].includes(a)||r.sticky;r.source==="system"&&t(i,{variant:a,autoHideDuration:c?null:5e3,content:l=>o.jsx(fi,{viewAllUrl:s,keyId:l,notification:r,content:o.jsx(Ei,{notification:r,minimal:!0,rows:0})})})},[],"user")};function is({blocklet:e,isAdmin:t}){return t?o.jsx(Gc,{blocklet:e}):o.jsx(yo,{status:403})}is.propTypes={blocklet:v.object.isRequired,isAdmin:v.bool.isRequired};const ll=e=>{var d,p;const{t}=Y(),{blocklet:n,actions:{refreshBlocklet:r},client:s,did:a}=ve(),i=(d=n==null?void 0:n.meta)==null?void 0:d.did,c=!n||lo(n.status)?[]:N.getAppMissingConfigs(n),l={overview:[{label:t("common.overview"),value:"overview"},{label:o.jsx(zs,{"data-cy":"blocklet-list",color:"error",variant:"dot",invisible:!c.length,children:t("common.components")}),value:"components"}],"did-connect":[{label:t("common.members"),value:"members"},{label:t("team.member.passports"),value:"passports"},{label:t("common.setting"),value:"settings"},{label:t("common.security"),value:"security"},{label:t("oauth.client.tab"),value:"oauth"}],website:[{label:t("common.domains"),value:"domains"},{label:t("common.branding"),value:"branding"},{label:t("common.theming"),value:"theming"},{label:t("common.navigation"),value:"navigation"}],operations:[{label:t("common.notificationRecords"),value:"notifications",show:e},{label:t("common.analytics"),value:"analytics"},{label:t("common.auditLogs"),value:"audit-logs"},{label:t("common.advancedConfig"),value:"advanced"}],integrations:[{label:"Webhooks",value:"webhooks",show:e},{label:t("common.accessKeys"),value:"access-keys"},{label:t("common.mcpServers"),value:"mcp-servers"}],developers:[{label:t("common.logs"),value:"logs",show:((p=n==null?void 0:n.children)==null?void 0:p.length)&&n.structVersion===O.APP_STRUCT_VERSION},{label:t("common.performance"),value:"performance"},{label:t("common.docs"),value:"docs"}]},u={overview:Hc,components:ol,members:o.jsx(Uc,{type:"blocklet",createPassportSvg:jn}),passports:o.jsx(Vc,{createPassportSvg:jn}),settings:o.jsx(Zc,{orientation:"vertical"}),security:o.jsx(Xc,{}),"did-spaces":o.jsx(Qc,{navOrientation:"horizontal"}),domains:Fc,branding:o.jsx(Jc,{blocklet:n,onUpdate:r}),theming:o.jsx(qc,{}),navigation:Kc,sitemap:o.jsx(Cs,{children:t("common.comingSoon")}),notifications:o.jsx(is,{blocklet:n,isAdmin:e}),"audit-logs":o.jsx(Wc,{scope:i,categories:["blocklet","team","security","certificates","gateway"]}),analytics:o.jsx(el,{client:s,did:a}),advanced:o.jsx(Yc,{blocklet:n,onUpdate:r}),webhooks:o.jsx(zc,{}),"access-keys":o.jsx(nl,{}),"mcp-servers":o.jsx(sl,{}),logs:Nc,performance:o.jsx(tl,{client:s,did:a}),docs:il,publish:o.jsx(Bc,{}),oauth:o.jsx(rl,{})};return{tabGroups:l,renders:u}};function ul(){var m,C;const e=Kn(),{tab:t="overview",subtab:n}=Fs(),{blocklet:r,refreshFlag:s}=ve(),{session:a}=Yn(),i=ge(()=>{var w;return(w=a==null?void 0:a.user)==null?void 0:w.did},[a]),c=Eo(),l=ge(()=>{var w;return((w=a.user)==null?void 0:w.role)&&ao.includes(a.user.role)},[a]);cl(i);const{tabGroups:u,renders:d}=ll(l),p=w=>{e(`${O.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/${t}/${w}`)},f=(u[t]||[]).filter(w=>w.show===void 0||w.show),y=((m=(f||[]).find(w=>w.value===n))==null?void 0:m.value)||((C=f==null?void 0:f[0])==null?void 0:C.value)||t,g=d[y]||d.overview,h=["overview"].includes(t),S=r?o.jsxs($t,{type:"components",children:[f.length>0&&o.jsxs(_,{mb:2,display:"flex",alignItems:"center",gap:2,children:[o.jsx(_s,{tabs:f,current:y,onChange:p,scrollButtons:"auto"}),h&&!c&&o.jsx(_,{flex:1,display:"flex",justifyContent:"flex-end",children:o.jsx(_,{component:"div",className:"page-header",children:r?o.jsx(kn,{className:"page-actions",hasPermission:!0,blocklet:r,onStart:()=>{},onComplete:({error:w}={})=>{w&&Z.error(w.message)},variant:"group"}):null})})]}),o.jsx(_,{className:"page-content",children:o.jsx(x.Suspense,{fallback:o.jsx(Je,{relative:"parent",children:o.jsx(re,{})}),children:x.isValidElement(g)?g:o.jsx(g,{blocklet:r})})})]}):o.jsx(Je,{relative:"parent",children:o.jsx(re,{})});return o.jsx(co,{children:o.jsx(Oc,{children:o.jsx(hn,{children:o.jsxs(fl,{children:[c&&h&&o.jsx(_,{component:"div",className:"page-header",mb:2,children:r?o.jsx(kn,{className:"page-actions",hasPermission:!0,blocklet:r,onStart:()=>{},onComplete:({error:w}={})=>{w&&Z.error(w.message)},variant:"group"}):null}),o.jsx(dr,{}),o.jsx(Ac,{}),S]})},`${s}`)})})}function dl(){var r;const{blocklet:e}=ve(),{t}=Y(),n=(r=e==null?void 0:e.meta)==null?void 0:r.did;return x.useEffect(()=>{const s=io();return n&&s.connect(),()=>{n&&s.isConnected()&&s.disconnect()}},[n]),o.jsxs(o.Fragment,{children:[o.jsx(vo,{children:o.jsx("title",{children:t("pageTitle.dashboard")})}),o.jsx(ul,{})]})}const fl=K.main`
|
|
198
198
|
.page-header {
|
|
199
199
|
display: flex;
|
|
200
200
|
justify-content: space-between;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,aa as r,ak as j,T as g,O as _,H as n}from"./vendor-mui-core-BV2FUxWJ.js";import{a as b}from"./vendor-ux-did-connect-
|
|
1
|
+
import{j as e,aa as r,ak as j,T as g,O as _,H as n}from"./vendor-mui-core-BV2FUxWJ.js";import{a as b}from"./vendor-ux-did-connect-CJ8Q_v7u.js";import{C as T}from"./click-to-copy-Fl7LHxeC.js";import{C as k}from"./confirm-t4d18Hpz.js";function c({title:l,description:m,confirmPlaceholder:d,cancel:p,confirm:u,params:f,onCancel:C,onConfirm:y,keyName:a}){const{t}=b(),i={title:()=>e.jsx(r,{children:l}),description:(s,x)=>{const h=o=>{x({...o,__disableConfirm:o.__disableConfirm})};return e.jsxs(r,{children:[e.jsx(j,{severity:"warning",style:{width:"100%"},children:t("common.notice")}),e.jsx(r,{sx:{my:3,b:{wordBreak:"break-word"}},dangerouslySetInnerHTML:{__html:m}}),e.jsxs(r,{style:{marginBottom:24},children:[t("common.click"),":",e.jsx(T,{"data-cy":"click-copy",children:a})]}),e.jsx(g,{component:"div",children:e.jsx(_,{label:d,autoComplete:"off","data-cy":"delete-confirm-input",variant:"outlined",fullWidth:!0,autoFocus:!0,value:s.inputVal,onChange:o=>{h({...s,inputVal:o.target.value,__disableConfirm:a!==o.target.value})}})})]})},confirm:u,cancel:p,onConfirm:y,onCancel:C,params:{inputVal:"",__disableConfirm:!0,...f}};return e.jsx(k,{title:i.title,description:i.description,confirm:i.confirm,cancel:i.cancel,params:i.params,onConfirm:i.onConfirm,onCancel:i.onCancel})}c.propTypes={title:n.any.isRequired,keyName:n.any.isRequired,description:n.any.isRequired,confirmPlaceholder:n.any.isRequired,cancel:n.string,confirm:n.string,params:n.object,onCancel:n.func,onConfirm:n.func.isRequired};c.defaultProps={onCancel:()=>{},cancel:"",confirm:"Confirm",params:{}};export{c as D};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s,be as p,H as r}from"./vendor-mui-core-BV2FUxWJ.js";import{L as d}from"./vendor-react-DEoibe3W.js";import{Z as f}from"./vendor-ux-did-connect-
|
|
1
|
+
import{j as s,be as p,H as r}from"./vendor-mui-core-BV2FUxWJ.js";import{L as d}from"./vendor-react-DEoibe3W.js";import{Z as f}from"./vendor-ux-did-connect-CJ8Q_v7u.js";function o({did:a,href:t,external:n,avatarProps:l,...i}){const e=s.jsx(f,{did:a,...i});return t?n?s.jsx(p,{target:"_blank",href:t,underline:"hover",children:e}):s.jsx(d,{to:t,children:e}):e}o.propTypes={did:r.string.isRequired,to:r.string,href:r.string,avatarProps:r.object,external:r.bool};o.defaultProps={to:"",href:"",avatarProps:{},external:!1};export{o as W};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as o,aa as i,H as x,ah as k}from"./vendor-mui-core-BV2FUxWJ.js";import{k as b,f as B,am as w,d as I}from"./index-3aRBjK5P.js";import{D as E,a as T,b as A}from"./domain-action-card-DnB964Ah.js";import{b4 as L}from"./vendor-ux-did-connect-CJ8Q_v7u.js";import{P as W}from"./page-header-CzGtYXZB.js";import{r,h as H}from"./vendor-react-DEoibe3W.js";import{_}from"./useSetState-CWq0AVWn.js";import{S as D}from"./button-mmNFGQSs.js";import{S as N}from"./layout-CneuYz3Y.js";import{S as $}from"./step-actions-qe5T0fbR.js";import"./vendor-utils-rHXShPKm.js";import"./vendor-arcblock-BPZ1V4pg.js";import"./vendor-hooks-BgUTpb6X.js";import"./lottie-web-jYmAQWuC.js";import"./ExpandLess-DeQLEewB.js";import"./permission-CG_0ilL-.js";import"./session-yHau46Qm.js";import"./dot-DX56IFTM.js";import"./useAsync-Dv214fz8.js";import"./confirm-t4d18Hpz.js";import"./index-8eXqqyHQ.js";import"./actions-t0ZB56yH.js";import"./MoreHoriz-Bb60Z0iy.js";import"./delete-confirm-DCJdTGPZ.js";import"./click-to-copy-Fl7LHxeC.js";import"./util-SIt5hlfb.js";import"./InfoOutlined-DwH0ULaz.js";import"./useAsync-KYUBhVsb.js";import"./index-DHmaMW97.js";import"./CheckCircle-Dv9ESLSx.js";import"./content-layout-fV4nyVb5.js";import"./use-mobile-C21X4TYN.js";function d({onNext:s,onPrevious:S}){var h,f;const{t:n}=r.useContext(L),[j,p]=r.useState(!1),{blocklet:e}=b(),[c,y]=r.useState(""),P=(((e==null?void 0:e.site)||{}).domainAliases||[]).map(t=>B.replaceSlotToIp(t.value,c)),[a,m]=_({domain:"",invalidDNSDomain:null,type:"",addDomainState:{text:""}}),l=(f=(h=e.environments)==null?void 0:h.find(t=>t.key==="BLOCKLET_APP_PK"))==null?void 0:f.value,g=P.find(t=>w.isDidDomain(t)),[u,v]=H();return r.useEffect(()=>{I.get(`/dns-resolve?hostname=${window.location.hostname}`).then(({data:t})=>{y(t.address||"")}).catch(t=>{console.error(t.message)})},[]),o.jsxs(z,{children:[o.jsx(i,{className:"header",children:o.jsx(W,{title:n("setup.domain.title"),subTitle:n("setup.domain.subTitle"),onClickBack:S})}),o.jsxs(i,{className:"form",sx:{display:"flex",flexDirection:"column",gap:3,overflowY:"auto"},children:[o.jsxs(i,{children:[o.jsx(i,{color:"text.primary",fontWeight:"fontWeightBold",fontSize:"1.125rem",children:o.jsx(i,{display:"inline",children:`${n("setup.domain.buyOrConnect")} (${n("common.optional")})`})}),o.jsx(i,{mt:1,children:o.jsx(T,{blocklet:e,bugDidDomainProps:{appPk:l,appId:e.appPid,siteId:e.site.id,teamDid:e.meta.did,inBlockletSetup:!0},connectDomainProps:{autoFocus:!1,appPk:l,appId:e.appPid,siteId:e.site.id,teamDid:e.meta.did,cnameDomain:g,currentIp:c,inBlockletSetup:!0,shouldCheckDomain:!0,onInputDomain:t=>{m({domain:t.domain,type:t.type}),p(t.error)},onStateChange:t=>m({addDomainState:t}),onSuccess:t=>{const C={domain:t.domain,type:t.type,nftDid:t.nftDid,chainHost:t.chainHost};u.set("redirect",t.domain),v(u,{replace:!0}),m(C),s()},onError:p}})})]}),o.jsx(i,{children:o.jsx(A,{inSetup:!0,showAllDomains:!0,systemTips:o.jsx(i,{color:"text.primary",fontWeight:"fontWeightBold",fontSize:"1.125rem",mb:1,children:o.jsx(i,{display:"inline",children:n("setup.domain.skipDescription")})})})})]}),o.jsx($,{mt:8,disabled:!!a.addDomainState.text,blocklet:e,onStartNow:()=>s("complete"),children:a.domain?o.jsx(D,{variant:"contained",loading:!!a.addDomainState.text,disabled:j||!!a.addDomainState.text||!a.domain,onClick:()=>s(),children:a.addDomainState.text||n("setup.continue")}):o.jsx(D,{variant:"contained",disabled:!!a.addDomainState.text,onClick:()=>s(),children:n("setup.continue")})})]})}function yt(s){return o.jsx(E,{children:o.jsx(d,{...s})})}d.propTypes={onNext:x.func,onPrevious:x.func};d.defaultProps={onNext:()=>{},onPrevious:()=>{}};const z=k(N)`
|
|
2
|
+
height: 100%;
|
|
3
|
+
overflow-y: hidden;
|
|
4
|
+
|
|
5
|
+
.form {
|
|
6
|
+
width: 100%;
|
|
7
|
+
height: 100%;
|
|
8
|
+
}
|
|
9
|
+
`;export{yt as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{al as Xe,aD as _t,aA as Je,as as $t,a as I,ao as Mt,a0 as L,B as ie,b6 as et,r as De,a2 as Bt,bo as tt,bD as Ft,ar as zt,C as Ue}from"./vendor-ux-did-connect-2jRoUb28.js";import{j as e,c9 as nt,aa as h,ab as N,T as P,ak as ye,e as Y,v as se,ad as _,b3 as it,H as i,q as st,b4 as Nt,b5 as Ut,a9 as je,bK as Ot,bW as Wt,ah as Ht,al as K,w as ot,be as Vt,ca as Gt,cb as Kt,cc as Qt,cd as Oe,ce as W,cf as Yt,O as Zt,m as Xt}from"./vendor-mui-core-BV2FUxWJ.js";import{A as te,z as Jt,b as en,e as tn,K as be,au as nn,av as sn,n as We}from"./vendor-utils-rHXShPKm.js";import{r as C,a as rt,g as on}from"./vendor-react-DEoibe3W.js";import{d as rn}from"./ExpandLess-t1cH-Bc4.js";import{c as He,j as an,r as ln,K as cn,O as dn,B as un}from"./vendor-arcblock-BlrkGjK9.js";import{an as mn,ao as at,D as $,G as oe,b as pn,K as Ve,ap as fn,V as xn,M as hn,aq as lt,am as xe,ar as ct,as as gn,f as dt,at as Dn}from"./index-DDoVX3je.js";import{w as ut}from"./permission-DSHe73ba.js";import{_ as yn,D as Ge}from"./dot-itVN8XTt.js";import{C as re}from"./confirm-Vzr2I9eM.js";import{A as jn}from"./actions-DP7pj6xB.js";import{D as bn}from"./delete-confirm-DNn4Os6R.js";import{d as vn,a as Cn,g as wn,p as Ke}from"./util-Dnkhck-D.js";import{_ as ae}from"./useSetState-CWq0AVWn.js";import{d as Rn}from"./InfoOutlined-D3XnF0Vg.js";import{_ as Sn}from"./useAsync-510ntT1B.js";import{f as U}from"./index-8eXqqyHQ.js";import{I as An}from"./index-BUHyq-oP.js";import{C as Pn}from"./click-to-copy-R7MF4AwY.js";import{x as In,l as kn,u as J,s as Tn,A as En}from"./vendor-hooks-BgUTpb6X.js";import{d as qn}from"./CheckCircle-Caqp5gKY.js";const Ln=Xe({});Ln.interceptors.request.use(n=>{const t=window.blocklet?window.blocklet.prefix:"/";return n.baseURL=t||"",n.url=te("/api",String(n.url)),n.timeout=2e5,n.params=n.params||{},new URLSearchParams(n.url.split("?")[1]).has("locale")||(n.params.locale=_t()),n},n=>Promise.reject(n));const mt=(...n)=>Xe(...n),_n=(n,t)=>t?n?[n,...Array.isArray(t)?t:[t]]:t:n,$n=(n,{width:t=600,height:s=700,name:r="did-domain:popup"}={})=>{const o=window.screenX+(window.innerWidth-t)/2,a=window.screenY+(window.innerHeight-s)/2,d=[`left=${o}`,`top=${a}`,`width=${t}`,`height=${s}`,"resizable=no","scrollbars=yes","status=yes","popup=yes"],c=window.open("",r,d.join(","));if(c===null)throw new Error("Failed to open popup");return c.location.href=Jt(n,{opener:window.location.origin}),c},Mn="z2qaGosS3rZ7m5ttP3Nd4V4qczR9TryTcRV4p",pt=async n=>{var p;if(!n||!(n!=null&&n.trim()))return null;const t=mt(),s=new URL(n);s.pathname="__blocklet__.js",s.searchParams.set("type","json");const{data:r}=await t.get(s.toString()),o=(p=r==null?void 0:r.componentMountPoints)==null?void 0:p.find(x=>x.did===Mn),a=new URL(n);a.pathname=o==null?void 0:o.mountPoint;const d=a.toString(),c=te(d,"/api");return{base:d,api:c}},Bn=Je({embed:{iconTip:"Click to view subscription details"},buy:{button:{title:"Buy DID Domain"},status:{inProgress:"Please wait while we are processing your request, the domain will be automatically resolved to the current app after the purchase...",success:"Purchase completed!"},error:{failedToCreateSession:"Failed to create session"}}}),Fn=Je({embed:{iconTip:"点击查看订阅详情"},buy:{button:{title:"购买 DID 域名"},status:{inProgress:"请稍等,我们正在处理您的请求,购买域名后会自动解析到当前的应用...",success:"购买完成!"},error:{failedToCreateSession:"创建会话失败"}}}),zn={zh:Fn,en:Bn},Nn=async({didDomainURL:n,delegatee:t,delegateePk:s})=>{const r=await pt(n);if(!r)return null;const o=mt({baseURL:r.api}),{data:a}=await o.post("/payment/session",{delegatee:t,delegateePk:s});return{sessionId:a.sessionId,baseURL:r.base}};function ft({delegatee:n,delegateePk:t,didDomainURL:s,locale:r,title:o,onSuccess:a,...d}){const{t:c}=I(),[p,x]=In({currentState:1}),u=C.useRef(null),y=kn(async()=>{const l=await Nn({didDomainURL:s,delegatee:n,delegateePk:t});return l},{debounceWait:500,debounceLeading:!0,debounceTrailing:!1,debounceMaxWait:3e3,refreshDeps:[],onError(l){console.error(l)}}),j=J(l=>{var D,b,w,q;l.data.type==="didDomain.success"&&(a==null||a({nftDid:(D=l.data)==null?void 0:D.nftDid,domain:(b=l.data)==null?void 0:b.domain,chainHost:(w=l.data)==null?void 0:w.chainHost}),(q=u.current)==null||q.close(),u.current=null,x({currentState:4}),setTimeout(()=>{x({currentState:8})},2e3))});Tn(()=>{var l;try{window.removeEventListener("message",j),(l=u.current)==null||l.close(),u.current=null}catch(D){console.warn("Failed to close popup",D)}});const g=J(()=>{x({currentState:1})}),f=J(()=>{if(x({currentState:2}),!y.data){console.error("Failed to create session");return}m({sessionId:y.data.sessionId,baseURL:y.data.baseURL})}),m=J(({sessionId:l,baseURL:D})=>{window.addEventListener("message",j);const b=new URL(D);b.searchParams.set("sessionId",l),b.searchParams.set("locale",r),b.searchParams.set("embed","1"),u.current=$n(b.toString());const w=setInterval(()=>{var q;(q=u.current)!=null&&q.closed&&(clearInterval(w),g())},1e3);return()=>clearInterval(w)});return e.jsxs(e.Fragment,{children:[e.jsx(nt,{loading:y.loading,onClick:f,variant:"contained",startIcon:e.jsx(vn,{}),...d,children:o||c("buy.button.title")}),e.jsxs(Mt,{fullWidth:!0,maxWidth:"xs",open:p.currentState>1&&p.currentState<8,onClose:g,children:[!y.error&&e.jsxs(h,{sx:{display:"flex",alignItems:"center",flexDirection:"column",gap:2},children:[p.currentState===2&&e.jsx(N,{size:50}),p.currentState===4&&e.jsx(qn,{sx:{color:"primary.main",fontSize:"5rem"}}),p.currentState===2&&e.jsx(P,{children:c("buy.status.inProgress")}),p.currentState===4&&e.jsx(P,{children:c("buy.status.success")})]}),y.error&&e.jsx(ye,{severity:"error",children:c("buy.error.failedToCreateSession")})]})]})}const xt={onSuccess:()=>{},title:""};ft.defaultProps=xt;function ht(n){return e.jsx($t,{locale:n.locale,translations:zn,children:e.jsx(ft,{...n})})}ht.defaultProps=xt;function gt({nftDid:n,didDomainURL:t,locale:s,sx:r}){const{t:o}=I(),[a,d]=ae({safeIframeRef:null,popoverAnchorEl:null}),c=C.useRef(null),p=Y(),x=se(p.breakpoints.down("md")),u=f=>{d({popoverAnchorEl:f.currentTarget})},y=()=>{d({popoverAnchorEl:null})},j=En(async()=>{const f=await pt(t);return f?f.base:null});if(!j.value)return null;if(j.loading)return e.jsx(N,{});const g=te(j.value,`/embed/domain?nft-did=${n}&locale=${s}`);return e.jsxs(e.Fragment,{children:[e.jsx(_,{title:o("embed.iconTip"),children:e.jsx(h,{component:"img",src:te(t,"/.well-known/service/blocklet/logo"),alt:"logo",width:16,height:16,onClick:u,sx:_n({cursor:"pointer"},r)})}),e.jsx(it,{id:"popover-info",open:!!a.popoverAnchorEl,anchorEl:a.popoverAnchorEl,onClose:y,anchorOrigin:{vertical:"bottom",horizontal:"right"},children:e.jsx("iframe",{ref:c,title:o("common.subscription"),width:x?"320px":"400px",height:"350px",style:{border:0,display:"block"},src:g})})]})}gt.defaultProps={sx:{}};const Un=n=>["waiting","creating","renewaling"].includes(n);function ve(n){var A,k;const{t}=I(),[s,r]=C.useState(!1),{inService:o}=$(),[a,d]=C.useState(null),{siteId:c,domain:p,onAdd:x,children:u,did:y,issuing:j,setIssuing:g}=n,{api:f,ws:{useSubscription:m}}=$(),{mode:l,actions:{refreshDomainStatus:D}}=oe(),b=yn(async()=>{const{cert:S}=await f.findCertificateByDomain({input:{domain:p,did:y}});return S}),w=(S,H)=>{S.domain===p&&(g(!1),r(!1),o&&l!=="setup"&&(H==="success"?L.success(t("setup.domain.genCertSuccess",{domain:S.domain})):H==="error"&&L.error(t("setup.domain.genCertFailed",{domain:S.domain,message:S.message}))))};if(C.useEffect(()=>{var S;b.loading||g(Un((S=b.value)==null?void 0:S.status))},[b.loading,(A=b.value)==null?void 0:A.status,g]),m(He.BlockletEvents.certError,S=>w(S,"error")),m(He.BlockletEvents.certIssued,S=>{b.retry(),D(S.domain),w(S,"success")}),b.loading||((k=b.value)==null?void 0:k.status)==="normal")return"";const q=()=>{r(!1),d(null)},M=async()=>{r(!0);try{await f.issueLetsEncryptCert({input:{siteId:c,domain:p,did:y,inBlockletSetup:l==="setup"}}),x(),g(!0)}catch(S){console.error(S),g(!1)}finally{r(!1),d(null)}},B={title:t("router.cert.genLetsEncryptCert.title"),description:e.jsxs("div",{children:[e.jsx(ye,{severity:"success",children:t("router.cert.genLetsEncryptCert.dnsTip")}),t("router.cert.genLetsEncryptCert.description")]}),confirm:t("common.confirm"),onConfirm:M,onCancel:q},ue=S=>{S.stopPropagation(),d(B)};return e.jsxs(e.Fragment,{children:[j?e.jsx(_,{title:t("router.cert.issuing"),children:e.jsx(N,{size:13,style:{fontSize:"13px"}})}):u({loading:s,open:ue}),a&&e.jsx(re,{color:"primary",title:a.title,description:a.description,confirm:a.confirm,params:a.params,onConfirm:a.onConfirm,onCancel:a.onCancel})]})}ve.propTypes={domain:i.string.isRequired,did:i.string.isRequired,siteId:i.string.isRequired,onAdd:i.func,children:i.any,issuing:i.bool,setIssuing:i.func};ve.defaultProps={onAdd:()=>{},children:null,issuing:!1,setIssuing:()=>{}};function Ce(n){const{domain:t,domainStatus:s,...r}=n;return mn(t)||!at(t)||en(s)||s!=null&&s.isHttps?"":e.jsx(ve,{domain:t,...r})}Ce.propTypes={domain:i.string.isRequired,domainStatus:i.shape({isHttps:i.bool}).isRequired,did:i.string.isRequired,onAdd:i.func,children:i.any,issuing:i.bool,setIssuing:i.func};Ce.defaultProps={onAdd:()=>{},children:null,issuing:!1,setIssuing:()=>{}};function we(n){const{t}=I(),[s,r]=C.useState(!1),[o,a]=C.useState(null),{id:d,domain:c,children:p,teamDid:x,onDelete:u}=n,{api:y}=$(),j=()=>{r(!1),a(null)},g=async()=>{r(!0);try{await y.deleteDomainAlias({input:{id:d,domainAlias:c,teamDid:x}}),u==null||u(),await pn(2e3)}catch(l){L.error(l.message)}finally{a(null),r(!1)}},f={keyName:c,title:t("router.domainAlias.delete.title"),description:t("router.domainAlias.delete.description",{domain:c}),confirmPlaceholder:t("router.domainAlias.delete.confirmPlaceholder",{domain:c}),confirm:t("common.delete"),onConfirm:g,onCancel:j},m=l=>{l.stopPropagation(),a(f)};return e.jsxs(e.Fragment,{children:[typeof p=="function"?p({loading:s,open:m}):e.jsxs(ie,{edge:"end",onClick:m,size:"small",className:"rule-action",color:"error","data-cy":"action-delete-domain-alias",children:[s?e.jsx(N,{size:16}):e.jsx(et,{style:{fontSize:16}}),t("common.delete")]}),o&&e.jsx(bn,{keyName:o.keyName,title:o.title,description:o.description,confirmPlaceholder:o.confirmPlaceholder,confirm:o.confirm,params:o.params,onConfirm:o.onConfirm,onCancel:o.onCancel})]})}we.propTypes={id:i.string.isRequired,domain:i.string.isRequired,children:i.any,teamDid:i.string,onDelete:i.func};we.defaultProps={children:null,teamDid:"",onDelete:null};function Re({site:n,domain:t,blocklet:s,onDelete:r}){const{t:o}=I(),a=t.value===window.location.hostname;return e.jsx(jn,{"data-cy":"domain-actions",size:"large",actions:[({close:d})=>{var c;return e.jsx(we,{id:n.id,domain:t.value,teamDid:(c=s==null?void 0:s.meta)==null?void 0:c.did,onDelete:r,children:({open:p})=>e.jsx(_,{title:a?o("blocklet.router.currentDomainTip"):"",children:e.jsx("span",{children:e.jsxs(st,{disabled:t.isProtected||a,dense:!0,onClick:x=>{d(),p(x)},"data-cy":"action-toggle-block",children:[e.jsx(Nt,{style:{minWidth:24,marginRight:8},children:e.jsx(et,{})}),e.jsx(Ut,{primary:o("common.delete")})]},"remove")})})})}]})}Re.propTypes={site:i.object.isRequired,domain:i.object.isRequired,blocklet:i.object.isRequired,onDelete:i.func};Re.defaultProps={onDelete:()=>{}};var Se={},On=je;Object.defineProperty(Se,"__esModule",{value:!0});var Dt=Se.default=void 0,Wn=On(De()),Hn=e;Dt=Se.default=(0,Wn.default)((0,Hn.jsx)("path",{d:"M12 1 3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5zm-1 6h2v2h-2zm0 4h2v6h-2z"}),"PrivacyTip");var Ae={},Vn=je;Object.defineProperty(Ae,"__esModule",{value:!0});var yt=Ae.default=void 0,Gn=Vn(De()),Kn=e;yt=Ae.default=(0,Gn.default)((0,Kn.jsx)("path",{d:"M19 15v4H5v-4zm1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1v-6c0-.55-.45-1-1-1M7 18.5c-.82 0-1.5-.67-1.5-1.5s.68-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5M19 5v4H5V5zm1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1M7 8.5c-.82 0-1.5-.67-1.5-1.5S6.18 5.5 7 5.5s1.5.68 1.5 1.5S7.83 8.5 7 8.5"}),"DnsOutlined");const le=i.shape({href:i.string,accessibility:i.shape({loading:i.bool,accessible:i.bool}),domainStatus:i.shape({isHttps:i.bool,matchedCert:i.object}),dns:i.shape({resolved:i.bool,ip:i.string})});function Pe({certificate:n}){const[t,s]=C.useState(null),r=$(),{t:o,locale:a}=I(),d=x=>{s(x.currentTarget)},c=()=>{s(null)},p=!!t;return e.jsxs(e.Fragment,{children:[e.jsx(Cn,{"aria-owns":p?"mouse-over-popover":void 0,onMouseEnter:d,onMouseLeave:c,style:{color:"#44cdc6",fontSize:"1em",cursor:"pointer"}}),e.jsx(it,{id:"mouse-over-popover",style:{pointerEvents:"none"},open:p,anchorEl:t,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:c,disableRestoreFocus:!0,children:e.jsx(Ot,{children:e.jsxs(Wt,{style:{display:"flex"},children:[e.jsx("div",{children:e.jsx("img",{src:`${r.imgPrefix}/https-certificate-icon.png`,alt:"certificate icon",style:{maxHeight:"100%",maxWidth:"100%"}})}),e.jsxs(P,{component:"div",style:{marginLeft:"16px"},children:[e.jsx(P,{component:"div",style:{fontWeight:"bold"},children:n.domain}),e.jsx(P,{component:"div",children:`${o("common.issuer")}: ${tn(n,"issuer.commonName","")}`}),e.jsx(P,{component:"div",children:`${o("router.cert.issuedOn")}: ${Ve(n.validFrom,a)}`}),e.jsx(P,{component:"div",children:`${o("router.cert.expiryOn")}: ${Ve(n.validTo,a)}`})]})]})})})]})}Pe.propTypes={certificate:i.object};Pe.defaultProps={certificate:{}};function Q({domain:n,filters:t}){const{t:s}=I(),{value:r,domainStatus:o}=n;if(!at(r))return null;let a=null,d=null;const{isHttps:c,matchedCert:p}=o,{dns:{ip:x,isDnsResolved:u,isCnameMatch:y}={}}=o,j=u&&y;fn(r)||(j||x==="127.0.0.1"?a=e.jsx(_,{title:s("router.domain.verify.ok"),children:e.jsx(Ge,{color:"success"})}):a=e.jsx(_,{title:s("router.domain.verify.notResolved"),children:e.jsx(Ge,{color:"error"})})),j?c?d=e.jsx(Pe,{certificate:p}):d=e.jsx(_,{title:s("router.domain.https.bad"),children:e.jsx(Dt,{style:{color:"#D0021B",fontSize:"1em",cursor:"pointer"}})}):d=e.jsx(_,{title:s("router.domain.verify.notResolved"),children:e.jsx(yt,{style:{color:"#D0021B",fontSize:"1em",cursor:"pointer"}})});const g=t.map(f=>f==="domain"?a:f==="http"?d:null);return C.createElement(C.Fragment,null,...g)}Q.propTypes={domain:le.isRequired,filters:i.array};Q.defaultProps={filters:["domain","http"]};const Qn=ut(ce,"mutate_blocklets"),Yn=ut(ce,"",xn);function zi(n){const{inService:t}=$(),{blocklet:s,loadingRuntimeInfo:r}=oe();let o=Qn;return t&&(o=Yn),e.jsx(o,{...n,blocklet:s,inService:t,loadingRuntimeInfo:r})}const Qe="nft-domain";function ce({hasPermission:n,blocklet:t,loadingRuntimeInfo:s,inService:r,showAllDomains:o,updateBlockletDomainAliases:a,systemTips:d}){var l;const{t:c}=I(),p=se(D=>D.breakpoints.down("md")),x=C.useMemo(()=>{let D=n;return hn(t)&&(D=D&&r),D},[n,r,t]),{site:u}=t,y=C.useMemo(()=>{var D;return lt((D=t.site)==null?void 0:D.domainAliases)},[(l=t.site)==null?void 0:l.domainAliases]),j=C.useMemo(()=>y.filter(D=>!xe.isCustomDomain(D.value)),[y]),g=C.useMemo(()=>y.filter(D=>xe.isCustomDomain(D.value)),[y]),f=C.useMemo(()=>g.filter(D=>D.type!==Qe),[g]),m=C.useMemo(()=>g.filter(D=>D.type===Qe),[g]);return e.jsxs(e.Fragment,{children:[e.jsxs(K,{gap:3,children:[!!m.length&&e.jsx(G,{title:c("common.didDomains"),description:c("common.didDomainsDescription"),domains:m,hasMutatePermission:x,blocklet:t,site:u,mobile:p,showAllDomains:o,updateBlockletDomainAliases:a}),!!f.length&&e.jsx(G,{title:c("common.manualDomains"),description:c("common.manualDomainsDescription"),domains:f,hasMutatePermission:x,blocklet:t,site:u,mobile:p,showAllDomains:o,updateBlockletDomainAliases:a}),!!j.length&&e.jsxs(h,{children:[d,e.jsx(G,{title:c("common.systemDomains"),description:c("common.systemDomainsDescription"),domains:j,hasMutatePermission:x,blocklet:t,site:u,mobile:p,updateBlockletDomainAliases:a})]})]}),!y.length&&(s?e.jsx(N,{size:16}):e.jsx(Bt,{children:c("common.empty")}))]})}ce.propTypes={hasPermission:i.bool,blocklet:i.object.isRequired,loadingRuntimeInfo:i.bool,inService:i.bool.isRequired,showAllDomains:i.bool,updateBlockletDomainAliases:i.func,systemTips:i.node};ce.defaultProps={hasPermission:!1,loadingRuntimeInfo:!1,showAllDomains:!1,updateBlockletDomainAliases:()=>{},systemTips:null};function V({children:n}){return e.jsx(h,{component:"span",sx:{verticalAlign:"bottom"},children:n})}V.propTypes={children:i.node};V.defaultProps={children:null};function ne({domain:n,children:t,suffix:s,...r}){const{t:o,locale:a}=I(),d=Y(),{href:c,accessibility:p,value:x}=n,u=C.useCallback(()=>e.jsx(tt,{content:be(x),locale:a,style:{marginLeft:"4px",color:d.palette.text.secondary,fontSize:"0.8em"}}),[x,a,d]);return!p||p.loading?e.jsxs(fe,{component:"span",...r,children:[e.jsx(_,{title:void 0,placement:"top-end",children:e.jsx(h,{component:"span",children:t})}),u(),e.jsx(V,{children:s}),e.jsx(_,{title:o("blocklet.router.checkUrlAccessible"),placement:"top-end",children:e.jsx(h,{component:"span",className:"status",children:e.jsx(N,{size:13,style:{fontSize:"13px"}})})})]}):p.accessible?e.jsxs(fe,{component:"span",...r,children:[e.jsx(h,{component:"a",href:c,target:"_blank",rel:"noopener noreferrer",sx:{color:n.loading?"text.disabled":void 0},children:e.jsx(_,{title:void 0,placement:"top-end",children:e.jsx(h,{component:"span",children:t})})}),u(),e.jsx(V,{children:s})]}):e.jsxs(fe,{component:"span",...r,children:[e.jsx(_,{title:o("blocklet.router.urlInaccessible"),placement:"top-end",children:e.jsx(h,{component:"span",children:t})}),!n.loading&&u(),e.jsx(V,{children:s})]})}ne.propTypes={domain:le.isRequired,children:i.any.isRequired,suffix:i.node};ne.defaultProps={suffix:null};const fe=Ht(h)`
|
|
1
|
+
import{al as Xe,aD as _t,aA as Je,as as $t,a as I,ao as Mt,a0 as L,B as ie,b6 as et,r as De,a2 as Bt,bo as tt,bD as Ft,ar as zt,C as Ue}from"./vendor-ux-did-connect-CJ8Q_v7u.js";import{j as e,c9 as nt,aa as h,ab as N,T as P,ak as ye,e as Y,v as se,ad as _,b3 as it,H as i,q as st,b4 as Nt,b5 as Ut,a9 as je,bK as Ot,bW as Wt,ah as Ht,al as K,w as ot,be as Vt,ca as Gt,cb as Kt,cc as Qt,cd as Oe,ce as W,cf as Yt,O as Zt,m as Xt}from"./vendor-mui-core-BV2FUxWJ.js";import{A as te,z as Jt,b as en,e as tn,K as be,au as nn,av as sn,n as We}from"./vendor-utils-rHXShPKm.js";import{r as C,a as rt,g as on}from"./vendor-react-DEoibe3W.js";import{d as rn}from"./ExpandLess-DeQLEewB.js";import{c as He,j as an,r as ln,K as cn,O as dn,B as un}from"./vendor-arcblock-BPZ1V4pg.js";import{an as mn,ao as at,D as $,G as oe,b as pn,K as Ve,ap as fn,V as xn,M as hn,aq as lt,am as xe,ar as ct,as as gn,f as dt,at as Dn}from"./index-3aRBjK5P.js";import{w as ut}from"./permission-CG_0ilL-.js";import{_ as yn,D as Ge}from"./dot-DX56IFTM.js";import{C as re}from"./confirm-t4d18Hpz.js";import{A as jn}from"./actions-t0ZB56yH.js";import{D as bn}from"./delete-confirm-DCJdTGPZ.js";import{d as vn,a as Cn,g as wn,p as Ke}from"./util-SIt5hlfb.js";import{_ as ae}from"./useSetState-CWq0AVWn.js";import{d as Rn}from"./InfoOutlined-DwH0ULaz.js";import{u as Sn}from"./useAsync-KYUBhVsb.js";import{f as U}from"./index-8eXqqyHQ.js";import{I as An}from"./index-DHmaMW97.js";import{C as Pn}from"./click-to-copy-Fl7LHxeC.js";import{x as In,l as kn,u as J,s as Tn,A as En}from"./vendor-hooks-BgUTpb6X.js";import{d as qn}from"./CheckCircle-Dv9ESLSx.js";const Ln=Xe({});Ln.interceptors.request.use(n=>{const t=window.blocklet?window.blocklet.prefix:"/";return n.baseURL=t||"",n.url=te("/api",String(n.url)),n.timeout=2e5,n.params=n.params||{},new URLSearchParams(n.url.split("?")[1]).has("locale")||(n.params.locale=_t()),n},n=>Promise.reject(n));const mt=(...n)=>Xe(...n),_n=(n,t)=>t?n?[n,...Array.isArray(t)?t:[t]]:t:n,$n=(n,{width:t=600,height:s=700,name:r="did-domain:popup"}={})=>{const o=window.screenX+(window.innerWidth-t)/2,a=window.screenY+(window.innerHeight-s)/2,d=[`left=${o}`,`top=${a}`,`width=${t}`,`height=${s}`,"resizable=no","scrollbars=yes","status=yes","popup=yes"],c=window.open("",r,d.join(","));if(c===null)throw new Error("Failed to open popup");return c.location.href=Jt(n,{opener:window.location.origin}),c},Mn="z2qaGosS3rZ7m5ttP3Nd4V4qczR9TryTcRV4p",pt=async n=>{var p;if(!n||!(n!=null&&n.trim()))return null;const t=mt(),s=new URL(n);s.pathname="__blocklet__.js",s.searchParams.set("type","json");const{data:r}=await t.get(s.toString()),o=(p=r==null?void 0:r.componentMountPoints)==null?void 0:p.find(x=>x.did===Mn),a=new URL(n);a.pathname=o==null?void 0:o.mountPoint;const d=a.toString(),c=te(d,"/api");return{base:d,api:c}},Bn=Je({embed:{iconTip:"Click to view subscription details"},buy:{button:{title:"Buy DID Domain"},status:{inProgress:"Please wait while we are processing your request, the domain will be automatically resolved to the current app after the purchase...",success:"Purchase completed!"},error:{failedToCreateSession:"Failed to create session"}}}),Fn=Je({embed:{iconTip:"点击查看订阅详情"},buy:{button:{title:"购买 DID 域名"},status:{inProgress:"请稍等,我们正在处理您的请求,购买域名后会自动解析到当前的应用...",success:"购买完成!"},error:{failedToCreateSession:"创建会话失败"}}}),zn={zh:Fn,en:Bn},Nn=async({didDomainURL:n,delegatee:t,delegateePk:s})=>{const r=await pt(n);if(!r)return null;const o=mt({baseURL:r.api}),{data:a}=await o.post("/payment/session",{delegatee:t,delegateePk:s});return{sessionId:a.sessionId,baseURL:r.base}};function ft({delegatee:n,delegateePk:t,didDomainURL:s,locale:r,title:o,onSuccess:a,...d}){const{t:c}=I(),[p,x]=In({currentState:1}),u=C.useRef(null),y=kn(async()=>{const l=await Nn({didDomainURL:s,delegatee:n,delegateePk:t});return l},{debounceWait:500,debounceLeading:!0,debounceTrailing:!1,debounceMaxWait:3e3,refreshDeps:[],onError(l){console.error(l)}}),j=J(l=>{var D,b,w,q;l.data.type==="didDomain.success"&&(a==null||a({nftDid:(D=l.data)==null?void 0:D.nftDid,domain:(b=l.data)==null?void 0:b.domain,chainHost:(w=l.data)==null?void 0:w.chainHost}),(q=u.current)==null||q.close(),u.current=null,x({currentState:4}),setTimeout(()=>{x({currentState:8})},2e3))});Tn(()=>{var l;try{window.removeEventListener("message",j),(l=u.current)==null||l.close(),u.current=null}catch(D){console.warn("Failed to close popup",D)}});const g=J(()=>{x({currentState:1})}),f=J(()=>{if(x({currentState:2}),!y.data){console.error("Failed to create session");return}m({sessionId:y.data.sessionId,baseURL:y.data.baseURL})}),m=J(({sessionId:l,baseURL:D})=>{window.addEventListener("message",j);const b=new URL(D);b.searchParams.set("sessionId",l),b.searchParams.set("locale",r),b.searchParams.set("embed","1"),u.current=$n(b.toString());const w=setInterval(()=>{var q;(q=u.current)!=null&&q.closed&&(clearInterval(w),g())},1e3);return()=>clearInterval(w)});return e.jsxs(e.Fragment,{children:[e.jsx(nt,{loading:y.loading,onClick:f,variant:"contained",startIcon:e.jsx(vn,{}),...d,children:o||c("buy.button.title")}),e.jsxs(Mt,{fullWidth:!0,maxWidth:"xs",open:p.currentState>1&&p.currentState<8,onClose:g,children:[!y.error&&e.jsxs(h,{sx:{display:"flex",alignItems:"center",flexDirection:"column",gap:2},children:[p.currentState===2&&e.jsx(N,{size:50}),p.currentState===4&&e.jsx(qn,{sx:{color:"primary.main",fontSize:"5rem"}}),p.currentState===2&&e.jsx(P,{children:c("buy.status.inProgress")}),p.currentState===4&&e.jsx(P,{children:c("buy.status.success")})]}),y.error&&e.jsx(ye,{severity:"error",children:c("buy.error.failedToCreateSession")})]})]})}const xt={onSuccess:()=>{},title:""};ft.defaultProps=xt;function ht(n){return e.jsx($t,{locale:n.locale,translations:zn,children:e.jsx(ft,{...n})})}ht.defaultProps=xt;function gt({nftDid:n,didDomainURL:t,locale:s,sx:r}){const{t:o}=I(),[a,d]=ae({safeIframeRef:null,popoverAnchorEl:null}),c=C.useRef(null),p=Y(),x=se(p.breakpoints.down("md")),u=f=>{d({popoverAnchorEl:f.currentTarget})},y=()=>{d({popoverAnchorEl:null})},j=En(async()=>{const f=await pt(t);return f?f.base:null});if(!j.value)return null;if(j.loading)return e.jsx(N,{});const g=te(j.value,`/embed/domain?nft-did=${n}&locale=${s}`);return e.jsxs(e.Fragment,{children:[e.jsx(_,{title:o("embed.iconTip"),children:e.jsx(h,{component:"img",src:te(t,"/.well-known/service/blocklet/logo"),alt:"logo",width:16,height:16,onClick:u,sx:_n({cursor:"pointer"},r)})}),e.jsx(it,{id:"popover-info",open:!!a.popoverAnchorEl,anchorEl:a.popoverAnchorEl,onClose:y,anchorOrigin:{vertical:"bottom",horizontal:"right"},children:e.jsx("iframe",{ref:c,title:o("common.subscription"),width:x?"320px":"400px",height:"350px",style:{border:0,display:"block"},src:g})})]})}gt.defaultProps={sx:{}};const Un=n=>["waiting","creating","renewaling"].includes(n);function ve(n){var A,k;const{t}=I(),[s,r]=C.useState(!1),{inService:o}=$(),[a,d]=C.useState(null),{siteId:c,domain:p,onAdd:x,children:u,did:y,issuing:j,setIssuing:g}=n,{api:f,ws:{useSubscription:m}}=$(),{mode:l,actions:{refreshDomainStatus:D}}=oe(),b=yn(async()=>{const{cert:S}=await f.findCertificateByDomain({input:{domain:p,did:y}});return S}),w=(S,H)=>{S.domain===p&&(g(!1),r(!1),o&&l!=="setup"&&(H==="success"?L.success(t("setup.domain.genCertSuccess",{domain:S.domain})):H==="error"&&L.error(t("setup.domain.genCertFailed",{domain:S.domain,message:S.message}))))};if(C.useEffect(()=>{var S;b.loading||g(Un((S=b.value)==null?void 0:S.status))},[b.loading,(A=b.value)==null?void 0:A.status,g]),m(He.BlockletEvents.certError,S=>w(S,"error")),m(He.BlockletEvents.certIssued,S=>{b.retry(),D(S.domain),w(S,"success")}),b.loading||((k=b.value)==null?void 0:k.status)==="normal")return"";const q=()=>{r(!1),d(null)},M=async()=>{r(!0);try{await f.issueLetsEncryptCert({input:{siteId:c,domain:p,did:y,inBlockletSetup:l==="setup"}}),x(),g(!0)}catch(S){console.error(S),g(!1)}finally{r(!1),d(null)}},B={title:t("router.cert.genLetsEncryptCert.title"),description:e.jsxs("div",{children:[e.jsx(ye,{severity:"success",children:t("router.cert.genLetsEncryptCert.dnsTip")}),t("router.cert.genLetsEncryptCert.description")]}),confirm:t("common.confirm"),onConfirm:M,onCancel:q},ue=S=>{S.stopPropagation(),d(B)};return e.jsxs(e.Fragment,{children:[j?e.jsx(_,{title:t("router.cert.issuing"),children:e.jsx(N,{size:13,style:{fontSize:"13px"}})}):u({loading:s,open:ue}),a&&e.jsx(re,{color:"primary",title:a.title,description:a.description,confirm:a.confirm,params:a.params,onConfirm:a.onConfirm,onCancel:a.onCancel})]})}ve.propTypes={domain:i.string.isRequired,did:i.string.isRequired,siteId:i.string.isRequired,onAdd:i.func,children:i.any,issuing:i.bool,setIssuing:i.func};ve.defaultProps={onAdd:()=>{},children:null,issuing:!1,setIssuing:()=>{}};function Ce(n){const{domain:t,domainStatus:s,...r}=n;return mn(t)||!at(t)||en(s)||s!=null&&s.isHttps?"":e.jsx(ve,{domain:t,...r})}Ce.propTypes={domain:i.string.isRequired,domainStatus:i.shape({isHttps:i.bool}).isRequired,did:i.string.isRequired,onAdd:i.func,children:i.any,issuing:i.bool,setIssuing:i.func};Ce.defaultProps={onAdd:()=>{},children:null,issuing:!1,setIssuing:()=>{}};function we(n){const{t}=I(),[s,r]=C.useState(!1),[o,a]=C.useState(null),{id:d,domain:c,children:p,teamDid:x,onDelete:u}=n,{api:y}=$(),j=()=>{r(!1),a(null)},g=async()=>{r(!0);try{await y.deleteDomainAlias({input:{id:d,domainAlias:c,teamDid:x}}),u==null||u(),await pn(2e3)}catch(l){L.error(l.message)}finally{a(null),r(!1)}},f={keyName:c,title:t("router.domainAlias.delete.title"),description:t("router.domainAlias.delete.description",{domain:c}),confirmPlaceholder:t("router.domainAlias.delete.confirmPlaceholder",{domain:c}),confirm:t("common.delete"),onConfirm:g,onCancel:j},m=l=>{l.stopPropagation(),a(f)};return e.jsxs(e.Fragment,{children:[typeof p=="function"?p({loading:s,open:m}):e.jsxs(ie,{edge:"end",onClick:m,size:"small",className:"rule-action",color:"error","data-cy":"action-delete-domain-alias",children:[s?e.jsx(N,{size:16}):e.jsx(et,{style:{fontSize:16}}),t("common.delete")]}),o&&e.jsx(bn,{keyName:o.keyName,title:o.title,description:o.description,confirmPlaceholder:o.confirmPlaceholder,confirm:o.confirm,params:o.params,onConfirm:o.onConfirm,onCancel:o.onCancel})]})}we.propTypes={id:i.string.isRequired,domain:i.string.isRequired,children:i.any,teamDid:i.string,onDelete:i.func};we.defaultProps={children:null,teamDid:"",onDelete:null};function Re({site:n,domain:t,blocklet:s,onDelete:r}){const{t:o}=I(),a=t.value===window.location.hostname;return e.jsx(jn,{"data-cy":"domain-actions",size:"large",actions:[({close:d})=>{var c;return e.jsx(we,{id:n.id,domain:t.value,teamDid:(c=s==null?void 0:s.meta)==null?void 0:c.did,onDelete:r,children:({open:p})=>e.jsx(_,{title:a?o("blocklet.router.currentDomainTip"):"",children:e.jsx("span",{children:e.jsxs(st,{disabled:t.isProtected||a,dense:!0,onClick:x=>{d(),p(x)},"data-cy":"action-toggle-block",children:[e.jsx(Nt,{style:{minWidth:24,marginRight:8},children:e.jsx(et,{})}),e.jsx(Ut,{primary:o("common.delete")})]},"remove")})})})}]})}Re.propTypes={site:i.object.isRequired,domain:i.object.isRequired,blocklet:i.object.isRequired,onDelete:i.func};Re.defaultProps={onDelete:()=>{}};var Se={},On=je;Object.defineProperty(Se,"__esModule",{value:!0});var Dt=Se.default=void 0,Wn=On(De()),Hn=e;Dt=Se.default=(0,Wn.default)((0,Hn.jsx)("path",{d:"M12 1 3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5zm-1 6h2v2h-2zm0 4h2v6h-2z"}),"PrivacyTip");var Ae={},Vn=je;Object.defineProperty(Ae,"__esModule",{value:!0});var yt=Ae.default=void 0,Gn=Vn(De()),Kn=e;yt=Ae.default=(0,Gn.default)((0,Kn.jsx)("path",{d:"M19 15v4H5v-4zm1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1v-6c0-.55-.45-1-1-1M7 18.5c-.82 0-1.5-.67-1.5-1.5s.68-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5M19 5v4H5V5zm1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1M7 8.5c-.82 0-1.5-.67-1.5-1.5S6.18 5.5 7 5.5s1.5.68 1.5 1.5S7.83 8.5 7 8.5"}),"DnsOutlined");const le=i.shape({href:i.string,accessibility:i.shape({loading:i.bool,accessible:i.bool}),domainStatus:i.shape({isHttps:i.bool,matchedCert:i.object}),dns:i.shape({resolved:i.bool,ip:i.string})});function Pe({certificate:n}){const[t,s]=C.useState(null),r=$(),{t:o,locale:a}=I(),d=x=>{s(x.currentTarget)},c=()=>{s(null)},p=!!t;return e.jsxs(e.Fragment,{children:[e.jsx(Cn,{"aria-owns":p?"mouse-over-popover":void 0,onMouseEnter:d,onMouseLeave:c,style:{color:"#44cdc6",fontSize:"1em",cursor:"pointer"}}),e.jsx(it,{id:"mouse-over-popover",style:{pointerEvents:"none"},open:p,anchorEl:t,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:c,disableRestoreFocus:!0,children:e.jsx(Ot,{children:e.jsxs(Wt,{style:{display:"flex"},children:[e.jsx("div",{children:e.jsx("img",{src:`${r.imgPrefix}/https-certificate-icon.png`,alt:"certificate icon",style:{maxHeight:"100%",maxWidth:"100%"}})}),e.jsxs(P,{component:"div",style:{marginLeft:"16px"},children:[e.jsx(P,{component:"div",style:{fontWeight:"bold"},children:n.domain}),e.jsx(P,{component:"div",children:`${o("common.issuer")}: ${tn(n,"issuer.commonName","")}`}),e.jsx(P,{component:"div",children:`${o("router.cert.issuedOn")}: ${Ve(n.validFrom,a)}`}),e.jsx(P,{component:"div",children:`${o("router.cert.expiryOn")}: ${Ve(n.validTo,a)}`})]})]})})})]})}Pe.propTypes={certificate:i.object};Pe.defaultProps={certificate:{}};function Q({domain:n,filters:t}){const{t:s}=I(),{value:r,domainStatus:o}=n;if(!at(r))return null;let a=null,d=null;const{isHttps:c,matchedCert:p}=o,{dns:{ip:x,isDnsResolved:u,isCnameMatch:y}={}}=o,j=u&&y;fn(r)||(j||x==="127.0.0.1"?a=e.jsx(_,{title:s("router.domain.verify.ok"),children:e.jsx(Ge,{color:"success"})}):a=e.jsx(_,{title:s("router.domain.verify.notResolved"),children:e.jsx(Ge,{color:"error"})})),j?c?d=e.jsx(Pe,{certificate:p}):d=e.jsx(_,{title:s("router.domain.https.bad"),children:e.jsx(Dt,{style:{color:"#D0021B",fontSize:"1em",cursor:"pointer"}})}):d=e.jsx(_,{title:s("router.domain.verify.notResolved"),children:e.jsx(yt,{style:{color:"#D0021B",fontSize:"1em",cursor:"pointer"}})});const g=t.map(f=>f==="domain"?a:f==="http"?d:null);return C.createElement(C.Fragment,null,...g)}Q.propTypes={domain:le.isRequired,filters:i.array};Q.defaultProps={filters:["domain","http"]};const Qn=ut(ce,"mutate_blocklets"),Yn=ut(ce,"",xn);function zi(n){const{inService:t}=$(),{blocklet:s,loadingRuntimeInfo:r}=oe();let o=Qn;return t&&(o=Yn),e.jsx(o,{...n,blocklet:s,inService:t,loadingRuntimeInfo:r})}const Qe="nft-domain";function ce({hasPermission:n,blocklet:t,loadingRuntimeInfo:s,inService:r,showAllDomains:o,updateBlockletDomainAliases:a,systemTips:d}){var l;const{t:c}=I(),p=se(D=>D.breakpoints.down("md")),x=C.useMemo(()=>{let D=n;return hn(t)&&(D=D&&r),D},[n,r,t]),{site:u}=t,y=C.useMemo(()=>{var D;return lt((D=t.site)==null?void 0:D.domainAliases)},[(l=t.site)==null?void 0:l.domainAliases]),j=C.useMemo(()=>y.filter(D=>!xe.isCustomDomain(D.value)),[y]),g=C.useMemo(()=>y.filter(D=>xe.isCustomDomain(D.value)),[y]),f=C.useMemo(()=>g.filter(D=>D.type!==Qe),[g]),m=C.useMemo(()=>g.filter(D=>D.type===Qe),[g]);return e.jsxs(e.Fragment,{children:[e.jsxs(K,{gap:3,children:[!!m.length&&e.jsx(G,{title:c("common.didDomains"),description:c("common.didDomainsDescription"),domains:m,hasMutatePermission:x,blocklet:t,site:u,mobile:p,showAllDomains:o,updateBlockletDomainAliases:a}),!!f.length&&e.jsx(G,{title:c("common.manualDomains"),description:c("common.manualDomainsDescription"),domains:f,hasMutatePermission:x,blocklet:t,site:u,mobile:p,showAllDomains:o,updateBlockletDomainAliases:a}),!!j.length&&e.jsxs(h,{children:[d,e.jsx(G,{title:c("common.systemDomains"),description:c("common.systemDomainsDescription"),domains:j,hasMutatePermission:x,blocklet:t,site:u,mobile:p,updateBlockletDomainAliases:a})]})]}),!y.length&&(s?e.jsx(N,{size:16}):e.jsx(Bt,{children:c("common.empty")}))]})}ce.propTypes={hasPermission:i.bool,blocklet:i.object.isRequired,loadingRuntimeInfo:i.bool,inService:i.bool.isRequired,showAllDomains:i.bool,updateBlockletDomainAliases:i.func,systemTips:i.node};ce.defaultProps={hasPermission:!1,loadingRuntimeInfo:!1,showAllDomains:!1,updateBlockletDomainAliases:()=>{},systemTips:null};function V({children:n}){return e.jsx(h,{component:"span",sx:{verticalAlign:"bottom"},children:n})}V.propTypes={children:i.node};V.defaultProps={children:null};function ne({domain:n,children:t,suffix:s,...r}){const{t:o,locale:a}=I(),d=Y(),{href:c,accessibility:p,value:x}=n,u=C.useCallback(()=>e.jsx(tt,{content:be(x),locale:a,style:{marginLeft:"4px",color:d.palette.text.secondary,fontSize:"0.8em"}}),[x,a,d]);return!p||p.loading?e.jsxs(fe,{component:"span",...r,children:[e.jsx(_,{title:void 0,placement:"top-end",children:e.jsx(h,{component:"span",children:t})}),u(),e.jsx(V,{children:s}),e.jsx(_,{title:o("blocklet.router.checkUrlAccessible"),placement:"top-end",children:e.jsx(h,{component:"span",className:"status",children:e.jsx(N,{size:13,style:{fontSize:"13px"}})})})]}):p.accessible?e.jsxs(fe,{component:"span",...r,children:[e.jsx(h,{component:"a",href:c,target:"_blank",rel:"noopener noreferrer",sx:{color:n.loading?"text.disabled":void 0},children:e.jsx(_,{title:void 0,placement:"top-end",children:e.jsx(h,{component:"span",children:t})})}),u(),e.jsx(V,{children:s})]}):e.jsxs(fe,{component:"span",...r,children:[e.jsx(_,{title:o("blocklet.router.urlInaccessible"),placement:"top-end",children:e.jsx(h,{component:"span",children:t})}),!n.loading&&u(),e.jsx(V,{children:s})]})}ne.propTypes={domain:le.isRequired,children:i.any.isRequired,suffix:i.node};ne.defaultProps={suffix:null};const fe=Ht(h)`
|
|
2
2
|
display: inline-block;
|
|
3
3
|
vertical-align: middle;
|
|
4
4
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as m}from"./vendor-react-DEoibe3W.js";import{a as n}from"./vendor-ux-did-connect-CJ8Q_v7u.js";import{G as p,D as l,M as c,f as u}from"./index-3aRBjK5P.js";import{a as x,b as d}from"./domain-action-card-DnB964Ah.js";import{j as t,aa as k,al as f,ak as D}from"./vendor-mui-core-BV2FUxWJ.js";import"./vendor-utils-rHXShPKm.js";import"./vendor-hooks-BgUTpb6X.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-BPZ1V4pg.js";import"./ExpandLess-DeQLEewB.js";import"./permission-CG_0ilL-.js";import"./session-yHau46Qm.js";import"./dot-DX56IFTM.js";import"./useAsync-Dv214fz8.js";import"./confirm-t4d18Hpz.js";import"./index-8eXqqyHQ.js";import"./actions-t0ZB56yH.js";import"./MoreHoriz-Bb60Z0iy.js";import"./delete-confirm-DCJdTGPZ.js";import"./click-to-copy-Fl7LHxeC.js";import"./util-SIt5hlfb.js";import"./useSetState-CWq0AVWn.js";import"./InfoOutlined-DwH0ULaz.js";import"./useAsync-KYUBhVsb.js";import"./index-DHmaMW97.js";import"./CheckCircle-Dv9ESLSx.js";function h(){const{blocklet:o,actions:{updateBlockletDomainAliases:s}}=p(),{inService:r}=l(),{t:e}=n(),a=m.useMemo(()=>{let i=!0;return c(o)&&(i=i&&r),i},[r,o]);return t.jsxs(k,{component:f,sx:{maxWidth:820},gap:3,children:[t.jsxs(t.Fragment,{children:[u.isAccessible(o.status)===!1&&t.jsx(D,{severity:"warning",children:e("blocklet.router.noRunning")}),a&&t.jsx(x,{blocklet:o,updateBlockletDomainAliases:s,connectDomainProps:{shouldCheckDomain:!0}})]}),t.jsx(d,{showAllDomains:!0,updateBlockletDomainAliases:s})]})}h.propTypes={};export{h as default};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{z as m}from"./vendor-hooks-BgUTpb6X.js";import{r as v}from"./vendor-react-DEoibe3W.js";import{r as y}from"./useAsync-Dv214fz8.js";import{ah as p}from"./vendor-mui-core-BV2FUxWJ.js";var c={};Object.defineProperty(c,"__esModule",{value:!0});var e=m,i=v,b=e.__importDefault(y()),A=function(r,t){t===void 0&&(t=[]);var a=i.useState(0),l=a[0],_=a[1],s=b.default(r,e.__spreadArrays(t,[l])),o=s.loading,d=i.useCallback(function(){o||_(function(f){return f+1})},e.__spreadArrays(t,[o]));return e.__assign(e.__assign({},s),{retry:d})},D=c.default=A;const n={success:"#3ab39d",error:"#D0021B"},u="10px",k=p.div`
|
|
2
|
+
display: inline-block;
|
|
3
|
+
min-width: ${r=>r.size||u};
|
|
4
|
+
min-height: ${r=>r.size||u};
|
|
5
|
+
background-color: ${r=>n[r.color]||r.color||n.success};
|
|
6
|
+
border-radius: 100%;
|
|
7
|
+
`;export{k as D,D as _};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CPE8Apzb.js","assets/vendor-react-DEoibe3W.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{j as p,r as ee,a as te,o as se,_ as b,a0 as j,Z as ne,n as ie,aC as oe,W as re}from"./vendor-ux-did-connect-
|
|
2
|
+
import{j as p,r as ee,a as te,o as se,_ as b,a0 as j,Z as ne,n as ie,aC as oe,W as re}from"./vendor-ux-did-connect-CJ8Q_v7u.js";import{a9 as ae,j as e,al as g,T as w,y as T,be as ce,aa as z,O as H,ab as le,ah as ue}from"./vendor-mui-core-BV2FUxWJ.js";import{r as o,h as de}from"./vendor-react-DEoibe3W.js";import{K as h}from"./vendor-utils-rHXShPKm.js";import{L as fe}from"./landing-page-k0HqFOEl.js";import{u as me,d as M}from"./index-3aRBjK5P.js";import{H as pe}from"./vendor-arcblock-BPZ1V4pg.js";import{f as S}from"./index-8eXqqyHQ.js";import{d as ge}from"./CheckCircle-Dv9ESLSx.js";import{g as D}from"./get-safe-url-BRxk530J.js";import"./vendor-hooks-BgUTpb6X.js";import"./lottie-web-jYmAQWuC.js";var N;(N=window.env)!=null&&N.groupPathPrefix;p.ROLES.ADMIN,p.ROLES.OWNER;const y=()=>{const{searchParams:u}=new URL(window.location.href);return u.get("fromWallet")==="1"};var P={},he=ae;Object.defineProperty(P,"__esModule",{value:!0});var F=P.default=void 0,ye=he(ee()),xe=e;F=P.default=(0,ye.default)((0,xe.jsx)("path",{d:"M12 19c0-3.87 3.13-7 7-7 1.08 0 2.09.25 3 .68V6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h8.08c-.05-.33-.08-.66-.08-1M4 6l8 5 8-5v2l-8 5-8-5zm13.34 16-3.54-3.54 1.41-1.41 2.12 2.12 4.24-4.24L23 16.34z"}),"MarkEmailRead");const Ee=ue.form`
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
5
5
|
align-items: center;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,ab as E,aa as T}from"./vendor-mui-core-BV2FUxWJ.js";import{r as j,f as W}from"./vendor-react-DEoibe3W.js";import{a as k,C as L,aq as S,a0 as h,j as b,b3 as I}from"./vendor-ux-did-connect-
|
|
1
|
+
import{j as e,ab as E,aa as T}from"./vendor-mui-core-BV2FUxWJ.js";import{r as j,f as W}from"./vendor-react-DEoibe3W.js";import{a as k,C as L,aq as S,a0 as h,j as b,b3 as I}from"./vendor-ux-did-connect-CJ8Q_v7u.js";import{L as R}from"./landing-page-k0HqFOEl.js";import{w as U}from"./wrap-locale-Dz5tBqNC.js";import{g as v}from"./get-safe-url-DHdoXqD0.js";import{S as N,s as _,a as B}from"./index-3aRBjK5P.js";import"./vendor-utils-rHXShPKm.js";import"./vendor-hooks-BgUTpb6X.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-BPZ1V4pg.js";function F({SessionContext:a,webWalletUrl:n,onSuccess:s}){var d,g;const{api:t,session:i}=j.useContext(a),{t:o,locale:f}=k(),u=W(),{searchParams:p}=new URL(window.location.href),l=p.get("redirect"),w=async(r,C)=>{s(r,C),await i.refresh(),h.success(o("exchangePassport.success")),setTimeout(()=>{if(l){const c=decodeURIComponent(l);c.startsWith(b.WELLKNOWN_SERVICE_PATH_PREFIX)?u(c,{replace:!0}):window.location.href=v(c)}else window.location.href=window.env.pathPrefix||window.env.apiPrefix||"/"},3e3)},P=r=>{h.error(r.message)},m={},x=p.get("componentId");return x&&(m.componentId=x),i.loading?e.jsx(L,{children:e.jsx(E,{})}):e.jsx(R,{did:((d=window==null?void 0:window.blocklet)==null?void 0:d.appPid)||((g=window==null?void 0:window.env)==null?void 0:g.appPid),children:e.jsx(T,{sx:{maxWidth:"100%",height:"100%"},children:e.jsx(S,{popup:!0,open:!0,className:"connect",action:"exchange-passport",checkFn:t.get,checkTimeout:10*60*1e3,webWalletUrl:n,onSuccess:w,onError:P,locale:f,messages:{title:o("exchangePassport.dialog.title"),scan:o("exchangePassport.dialog.scan"),confirm:o("exchangePassport.dialog.confirm"),success:o("exchangePassport.dialog.success")},extraParams:m,extraContent:null,hideCloseButton:!0})})})}const q=U(F);function J(){const a=I(),n=(s,t)=>{s.sessionToken&&(_(t(s.sessionToken)),B(t(s.refreshToken)))};return e.jsx(q,{SessionContext:N,webWalletUrl:a,onSuccess:n})}export{J as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,aa as t,ab as P,be as W,H as d,ah as B}from"./vendor-mui-core-BV2FUxWJ.js";import{r as l}from"./vendor-react-DEoibe3W.js";import{A as v}from"./vendor-utils-rHXShPKm.js";import{d as I}from"./Launch-
|
|
1
|
+
import{j as e,aa as t,ab as P,be as W,H as d,ah as B}from"./vendor-mui-core-BV2FUxWJ.js";import{r as l}from"./vendor-react-DEoibe3W.js";import{A as v}from"./vendor-utils-rHXShPKm.js";import{d as I}from"./Launch-CKjiZEMR.js";import{b4 as L,aq as $}from"./vendor-ux-did-connect-CJ8Q_v7u.js";import{W as A}from"./did-address-BJCF3XU3.js";import{P as E}from"./page-header-CzGtYXZB.js";import{k as T,u as q}from"./index-3aRBjK5P.js";import{S as z}from"./layout-CneuYz3Y.js";import{S as D}from"./step-actions-qe5T0fbR.js";import{S as m}from"./button-mmNFGQSs.js";import"./vendor-hooks-BgUTpb6X.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-BPZ1V4pg.js";import"./content-layout-fV4nyVb5.js";import"./use-mobile-C21X4TYN.js";function u({onNext:n,onPrevious:f}){const{locale:x,t:s}=l.useContext(L),{blocklet:a,gas:c,tokenInfo:h,actions:j}=T(),{api:y}=q(),[g,o]=l.useState(!1),{need:p="",current:b="",owe:r=99999,deficiency:k,symbol:C="",endpoint:i}=c||{},{origin:S="/"}=i?new URL(i):{};l.useEffect(()=>{const N=setInterval(()=>{j.refreshFuel()},2e3);return()=>{clearInterval(N)}},[]);const w=()=>{o(!1)};return c?e.jsxs(F,{children:[e.jsx("div",{className:"header",children:e.jsx(E,{title:s("setup.fuel.title"),onClickBack:f})}),e.jsxs(t,{className:"qr-body",children:[e.jsxs(t,{mb:6,className:"tip",children:[s("setup.fuel.tipStart").replace("slot",""),e.jsx("span",{className:"amount",children:`${p} ${C}`}),s("setup.fuel.tipEnd")]}),e.jsx(t,{fontSize:16,fontWeight:"fontWeightBold",mb:.5,children:s("setup.fuel.addressTitle")}),e.jsxs(t,{display:"flex",alignItems:"center",children:[e.jsx(A,{className:"address",did:a.appDid}),e.jsx(W,{style:{lineHeight:1},target:"_blank",href:v(S,"/explorer/accounts/",a.appDid),underline:"hover",children:e.jsx(I,{className:"icon-launch"})})]}),e.jsx(t,{my:2,children:e.jsx(m,{color:"primary",onClick:()=>o(!0),disabled:!r,children:s("setup.fuel.fuelApp")})}),e.jsx($,{popup:!0,open:g,action:"fuel",checkFn:y.get,checkTimeout:10*60*1e3,onSuccess:w,onClose:()=>o(!1),locale:x,messages:{title:s("setup.connect.title"),scan:s("setup.connect.scan"),confirm:s("setup.connect.confirm"),success:s("setup.connect.success")},extraParams:{amount:k,...h,endpoint:i}}),e.jsxs(t,{display:"flex",color:"text.secondary",children:[e.jsxs(t,{display:"flex",children:[e.jsxs(t,{children:[s("setup.fuel.need"),":"]}),e.jsx(t,{ml:.5,color:"primary.main",fontWeight:"fontWeightBold",children:p})]}),e.jsxs(t,{display:"flex",ml:3,children:[e.jsxs(t,{children:[s("setup.fuel.current"),":"]}),e.jsx(t,{ml:.5,color:r>0?"error.main":"primary.main",fontWeight:"fontWeightBold",children:b})]})]})]}),e.jsx(D,{mt:8,children:e.jsx(m,{disabled:r>0,onClick:()=>n(),children:s("setup.next")})})]}):e.jsx(t,{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",children:e.jsx(P,{})})}u.propTypes={onNext:d.func,onPrevious:d.func};u.defaultProps={onNext:()=>{},onPrevious:()=>{}};const F=B(z)`
|
|
2
2
|
.qr-body {
|
|
3
3
|
width: 580px;
|
|
4
4
|
${n=>n.theme.breakpoints.down("md")} {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CPE8Apzb.js","assets/vendor-react-DEoibe3W.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{e as L,j as e,y as I,aa as l,T as d,ab as T}from"./vendor-mui-core-BV2FUxWJ.js";import{o as A,_ as D,b4 as U,C as W,a_ as F,bk as N,j as v}from"./vendor-ux-did-connect-
|
|
2
|
+
import{e as L,j as e,y as I,aa as l,T as d,ab as T}from"./vendor-mui-core-BV2FUxWJ.js";import{o as A,_ as D,b4 as U,C as W,a_ as F,bk as N,j as v}from"./vendor-ux-did-connect-CJ8Q_v7u.js";import{R as m}from"./vendor-arcblock-BPZ1V4pg.js";import{d as z}from"./CheckCircle-Dv9ESLSx.js";import{d as B}from"./Home-nxfCo0la.js";import{a as M,u as E}from"./vendor-hooks-BgUTpb6X.js";import{r as i,f as O,h as K}from"./vendor-react-DEoibe3W.js";import{L as u}from"./landing-page-k0HqFOEl.js";import{A as V}from"./vendor-utils-rHXShPKm.js";import{u as X}from"./index-3aRBjK5P.js";import"./lottie-web-jYmAQWuC.js";function G(){const o=A();return i.useCallback(()=>{if(o!=null&&o.wallet){D(()=>import("./index-CPE8Apzb.js").then(r=>r.i),__vite__mapDeps([0,1])).then(r=>{setTimeout(()=>{r.call("arcClosePage")},2e3)});return}setTimeout(()=>{window.close()},500)},[o==null?void 0:o.wallet])}function re(){var y,j,_,k;const o=O(),r=i.useRef(null),{t:s,locale:p}=i.useContext(U),{api:f,connectApi:x}=X(),[h]=K(),P=L(),S=G(),n=M({ready:!1,success:!1,error:null,invalidSession:!1}),b=()=>{try{const t=new URL(window.location.href);if(t.hash.includes("invalid")){n.invalidSession=!0;return}const c=t.searchParams.get("__connect_url__"),R=F(c);if(!N(R))throw new Error("No token");n.ready=!0}catch{n.invalidSession=!0,o("#invalid",{replace:!0})}};i.useLayoutEffect(()=>b(),[]);const C=E(t=>{var c;n.error=t.message,(c=window.opener)==null||c.postMessage({type:"connect-endpoint-message",error:n.error},"*"),o("#invalid",{replace:!0})}),g=E(()=>{var t;(t=window.opener)==null||t.postMessage({type:"connect-endpoint-message",success:!0},"*"),n.success=!0}),a=h.get("source")||"Generate Access Key";i.useEffect(()=>{r.current&&n.ready&&x.open({locale:p,containerEl:r.current,action:"gen-access-key",extraParams:{remark:a},checkFn:f.get,saveConnect:!1,forceConnected:!1,className:"connect",popup:!1,baseUrl:window.location.origin,prefix:V(window.location.origin,v.WELLKNOWN_SERVICE_PATH_PREFIX,v.API_DID_PREFIX),messages:{title:s("connectCli.title"),scan:s("connectCli.scan"),confirm:s("auth.confirm"),success:s("connectCli.success")},onSuccess:g,onError:C},{locale:p})},[x,n.ready,f,C,g,p,s,a]);const w=e.jsx(I,{variant:"outlined",color:"primary",size:"small",startIcon:e.jsx(B,{}),href:"/",style:{borderRadius:4},children:s("connectCli.home")});if(n.invalidSession)return e.jsx(u,{did:(y=window.blocklet)==null?void 0:y.appPid,standalone:!0,children:e.jsx(m,{style:{backgroundColor:"transparent"},status:"error",title:s("connectCli.invalidSession"),description:s("connectCli.invalidSessionDesc"),extra:w})},"invalid");if(n.error){const t=n.error,c=w;return e.jsx(u,{did:(j=window.blocklet)==null?void 0:j.appPid,standalone:!0,children:e.jsx(m,{style:{backgroundColor:"transparent"},status:"error",title:s("connectCli.connectionError"),description:t,extra:c})},"error")}return n.success?(h.has("closeOnSuccess")&&S(),e.jsx(u,{did:(_=window.blocklet)==null?void 0:_.appPid,standalone:!0,children:e.jsx(m,{style:{backgroundColor:"transparent"},status:"info",icon:e.jsx(z,{style:{color:P.palette.success.main,fontSize:72}}),title:s("connectCli.success",{source:a}),description:s("connectCli.successDesc",{source:a})})},"success")):n.ready?e.jsx(u,{did:(k=window.blocklet)==null?void 0:k.appPid,standalone:!0,children:e.jsxs(l,{sx:{maxWidth:"100%",height:"100%"},children:[e.jsxs(l,{sx:{mb:5},children:[e.jsx(d,{variant:"h4",component:"h1",sx:{mb:1,fontWeight:"bold",textAlign:"center"},children:s("connectCli.tips.title")}),e.jsxs(l,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"center"},children:[e.jsx(d,{sx:{color:"text.secondary"},children:s("connectCli.tips.item1")}),e.jsx(d,{sx:{color:"text.secondary"},children:s("connectCli.tips.item2")}),e.jsx(d,{sx:{color:"text.secondary"},children:s("connectCli.tips.item3")})]})]}),e.jsx(l,{sx:{display:"inline-block"},ref:r})]})},"ready"):e.jsx(W,{children:e.jsx(T,{})})}export{re as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bi as t,a0 as o}from"./vendor-ux-did-connect-
|
|
1
|
+
import{bi as t,a0 as o}from"./vendor-ux-did-connect-CJ8Q_v7u.js";function i(...e){try{return t(...e)}catch(r){throw o.error("Invalid redirect url"),console.error("Invalid redirect url",r),r}}export{i as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bi as t,a0 as o}from"./vendor-ux-did-connect-
|
|
1
|
+
import{bi as t,a0 as o}from"./vendor-ux-did-connect-CJ8Q_v7u.js";function i(...e){try{return t(...e)}catch(r){throw o.error("Invalid redirect url"),console.error("Invalid redirect url",r),r}}export{i as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as o,al as n}from"./vendor-mui-core-BV2FUxWJ.js";import{L as r}from"./vendor-react-DEoibe3W.js";import{B as i,j as t}from"./vendor-ux-did-connect-
|
|
1
|
+
import{j as o,al as n}from"./vendor-mui-core-BV2FUxWJ.js";import{L as r}from"./vendor-react-DEoibe3W.js";import{B as i,j as t}from"./vendor-ux-did-connect-CJ8Q_v7u.js";import{S as e}from"./studio-COaDgEOK.js";import"./vendor-utils-rHXShPKm.js";import"./vendor-hooks-BgUTpb6X.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-BPZ1V4pg.js";import"./TuneOutlined-C_bRiMjO.js";function L(){return o.jsx(e,{children:o.jsxs(n,{direction:"row",m:4,spacing:2,children:[o.jsx(i,{component:r,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/preferences`,size:"large",color:"primary",variant:"outlined",children:"Preference Builder"}),o.jsx(i,{component:r,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/branding`,size:"large",color:"primary",variant:"outlined",children:"Branding Images"}),o.jsx(i,{component:r,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/localization`,size:"large",color:"primary",variant:"outlined",children:"Localization"})]})})}export{L as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as x}from"./vendor-react-DEoibe3W.js";import{t as E}from"./vendor-arcblock-
|
|
1
|
+
import{b as x}from"./vendor-react-DEoibe3W.js";import{t as E}from"./vendor-arcblock-BPZ1V4pg.js";const L=({url:r,allowFullScreen:o,position:a,display:i,height:u,width:c,overflow:f,styles:y,onLoad:p,onMouseOver:m,onMouseOut:b,scrolling:w,id:d,frameBorder:n,ariaHidden:O,sandbox:s,allow:j,className:g,title:h,ariaLabel:k,ariaLabelledby:I,name:P,target:v,loading:A,importance:F,referrerpolicy:M,allowpaymentrequest:S,src:$,key:q})=>{const t=E({src:$||r,target:v||null,style:{position:a||null,display:i||"initial",overflow:f||null},scrolling:w||null,allowpaymentrequest:S||null,importance:F||null,sandbox:s&&[...s].join(" ")||null,loading:A||null,styles:y||null,name:P||null,className:g||null,allowFullScreen:"allowFullScreen",referrerpolicy:M||null,title:h||null,allow:j||null,id:d||null,"aria-labelledby":I||null,"aria-hidden":O||null,"aria-label":k||null,width:c||null,height:u||null,onLoad:p||null,onMouseOver:m||null,onMouseOut:b||null,key:q||"iframe"});let l=Object.create(null);for(let e of Object.keys(t))t[e]!=null&&(l[e]=t[e]);for(let e of Object.keys(l.style))l.style[e]==null&&delete l.style[e];if(l.styles)for(let e of Object.keys(l.styles))l.styles.hasOwnProperty(e)&&(l.style[e]=l.styles[e]),Object.keys(l.styles).pop()==e&&delete l.styles;if(o)if("allow"in l){const e=l.allow.replace("fullscreen","");l.allow=`fullscreen ${e.trim()}`.trim()}else l.allow="fullscreen";return n>=0&&(l.style.hasOwnProperty("border")||(l.style.border=n)),x.createElement("iframe",Object.assign({},l))},z=L;export{z as I};
|