@abtnode/blocklet-services 1.17.5-beta-20251208-123021-e8c53f96 → 1.17.5-beta-20251209-090953-3a59e7ac
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/index.js +4 -3
- package/dist/assets/{access-control-uMgSmVtl.js → access-control-BQ-IG3_x.js} +1 -1
- package/dist/assets/{add-component-core-Dc36lTWq.js → add-component-core-Cb9Jf9pu.js} +1 -1
- package/dist/assets/{add-resource-CNyb02oE.js → add-resource-BmEJTiqi.js} +1 -1
- package/dist/assets/{addon-BrD52yP8.js → addon-CzieGOEG.js} +1 -1
- package/dist/assets/{advanced-BTz3ZBM_.js → advanced-B94516o4.js} +1 -1
- package/dist/assets/{aigne-CKJhF6YF.js → aigne-CYChXVP3.js} +1 -1
- package/dist/assets/{appearance-BJ1pZ5mv.js → appearance-C1uh29fy.js} +1 -1
- package/dist/assets/{arrow-down.svg-C_9IZZzE.js → arrow-down.svg-DCPm0wfX.js} +1 -1
- package/dist/assets/{audit-logs-Cv97rr17.js → audit-logs-Dcdyar51.js} +1 -1
- package/dist/assets/{authorize-B7P46IV2.js → authorize-QHj4ueFL.js} +1 -1
- package/dist/assets/{bind-account-jReeH6gL.js → bind-account-BX-KG0Qr.js} +1 -1
- package/dist/assets/{branding-DTiVyAwp.js → branding-Ce0jZMDd.js} +1 -1
- package/dist/assets/{branding-Dw7bAXb5.js → branding-CqhvExJP.js} +4 -4
- package/dist/assets/{branding-DDbf7iKd.js → branding-Dnj3tYIM.js} +1 -1
- package/dist/assets/{bundle-avatar-CKp8Upr1.js → bundle-avatar--xYBq9Gb.js} +1 -1
- package/dist/assets/{complete-I86fdk2J.js → complete-CF2ewVuD.js} +1 -1
- package/dist/assets/{component-BxDPcxLA.js → component-u6OazrP-.js} +3 -3
- package/dist/assets/{config-3y5DLQbx.js → config-BdGGivQg.js} +1 -1
- package/dist/assets/{config-CmTXD9uy.js → config-Cj_KRqwi.js} +1 -1
- package/dist/assets/{config-uqOLSuI1.js → config-DwBbQRLw.js} +1 -1
- package/dist/assets/{config-navigation-IlBVGJJp.js → config-navigation-2cI6Tcgp.js} +2 -2
- package/dist/assets/{config-space-CMOK4l4q.js → config-space-DI_Aw2fC.js} +1 -1
- package/dist/assets/{confirm-DQ4M1D6U.js → confirm-F2_i30bc.js} +1 -1
- package/dist/assets/{connect-N6Jlg0kg.js → connect-4HW3qKz4.js} +1 -1
- package/dist/assets/{connect-Bt_sH-vn.js → connect-BeA4k1eX.js} +1 -1
- package/dist/assets/{connect-to-CTgmFTT0.js → connect-to-BBcrmPHg.js} +1 -1
- package/dist/assets/dashboard-BDag6cuN.js +106 -0
- package/dist/assets/{delete-confirm-CkOWa6dE.js → delete-confirm-DBhiUq1r.js} +1 -1
- package/dist/assets/{domain-CNgcPSuz.js → domain-CM8EYUUH.js} +1 -1
- package/dist/assets/{domain-action-card-DglaZM09.js → domain-action-card-BdWmmq7M.js} +1 -1
- package/dist/assets/{domains-xkwgfn_I.js → domains-C_hsR6kY.js} +1 -1
- package/dist/assets/{email-B0VF90tU.js → email-CbHnzIjr.js} +1 -1
- package/dist/assets/engine-C3zb9k-C.js +1 -0
- package/dist/assets/{exchange-passport-CrW7dVAg.js → exchange-passport-3WK7243a.js} +1 -1
- package/dist/assets/{form-BqVjSzP6.js → form-CCmYt5yy.js} +1 -1
- package/dist/assets/{fuel-Cgu54jtO.js → fuel-BG9pjC0w.js} +1 -1
- package/dist/assets/{gen-access-key-D4Zopy1D.js → gen-access-key-BPsrFRZB.js} +1 -1
- package/dist/assets/{gen-simple-access-key-BOkAbBHA.js → gen-simple-access-key-CZGyIc9a.js} +1 -1
- package/dist/assets/{get-safe-url-DKPL0sDC.js → get-safe-url-BrPSNpgv.js} +1 -1
- package/dist/assets/{home-CAGJ1uyT.js → home-CQklhtpC.js} +1 -1
- package/dist/assets/{iframe-DvPZuyhb.js → iframe-CKjr768a.js} +1 -1
- package/dist/assets/{index-DKeCxW4D.js → index-0tKuoOtp.js} +1 -1
- package/dist/assets/{index-Bka-tTFw.js → index-21gjg2tv.js} +1 -1
- package/dist/assets/{index-DhsOorTb.js → index-2T0bIXYn.js} +1 -1
- package/dist/assets/{index-CLtIjagu.js → index-B-xwjRHD.js} +1 -1
- package/dist/assets/{index-BTBqUQm1.js → index-BjYRoSYo.js} +1 -1
- package/dist/assets/{index-C3fi8Y-l.js → index-BmnHj012.js} +1 -1
- package/dist/assets/{index-C9dtkWmq.js → index-BnLnviXD.js} +1 -1
- package/dist/assets/{index-Dj0nGRrj.js → index-C6JbpwU_.js} +1 -1
- package/dist/assets/{index-BSf_vZgi.js → index-CQbGIqeS.js} +1 -1
- package/dist/assets/{index-Dq0Srq3h.js → index-CVED_BmV.js} +1 -1
- package/dist/assets/{index-B6tDB9NM.js → index-CVVhDiqm.js} +1 -1
- package/dist/assets/{index-nDxxcSRU.js → index-CX38UUlR.js} +1 -1
- package/dist/assets/{index-eMvzC3RF.js → index-C_xi8Qiz.js} +1 -1
- package/dist/assets/{index-DTXEQVwg.js → index-CdOL_gmG.js} +1 -1
- package/dist/assets/{index-8pWloMM4.js → index-CnWOeW7L.js} +2 -2
- package/dist/assets/{index-BU1h5ax2.js → index-CpF08yLs.js} +1 -1
- package/dist/assets/{index-DXScybaX.js → index-DQt_6j3C.js} +53 -53
- package/dist/assets/{index-PD6zy1bY.js → index-D_0Kti8n.js} +1 -1
- package/dist/assets/{index-B-FsPHvJ.js → index-Dke96m3s.js} +1 -1
- package/dist/assets/{index-vB1fWp5c.js → index-DlXYHnCm.js} +1 -1
- package/dist/assets/{index-CbziauTS.js → index-DqGlhvi9.js} +1 -1
- package/dist/assets/{index-x4RKBi5w.js → index-Dw7qYst2.js} +1 -1
- package/dist/assets/{index-BvTGUpv5.js → index-NecLGEW0.js} +1 -1
- package/dist/assets/{index-C6xsUkOM.js → index-SZPelu8V.js} +3 -3
- package/dist/assets/{index-B6WvmZFK.js → index-cDc_AEjv.js} +1 -1
- package/dist/assets/{index-BmQjG3jd.js → index-rDCB37wy.js} +1 -1
- package/dist/assets/{invitation-D95v3XVN.js → invitation-DquuV8dW.js} +1 -1
- package/dist/assets/{invitations-DMcpv_mD.js → invitations-CTnzBAUW.js} +1 -1
- package/dist/assets/{invite-DnfMFz38.js → invite-Cqtkz9TE.js} +1 -1
- package/dist/assets/{isURL-CFycC-gz.js → isURL-BHeH7II4.js} +1 -1
- package/dist/assets/{issue-passport-BaMEOyaL.js → issue-passport-O1f1uJyL.js} +1 -1
- package/dist/assets/{item-BmeJ8uZM.js → item-Gzu2HZ93.js} +1 -1
- package/dist/assets/{landing-page-BQv8Dm_n.js → landing-page-BJPl6ZR-.js} +1 -1
- package/dist/assets/{layout-TOJ7kEb4.js → layout-CbkYBUG0.js} +1 -1
- package/dist/assets/{list-Dxgf_FJ5.js → list-BC0XcUGx.js} +1 -1
- package/dist/assets/{list-Citro58J.js → list-CA3FRf5d.js} +1 -1
- package/dist/assets/{localization-CfvvNuIZ.js → localization-CHT9qqQu.js} +1 -1
- package/dist/assets/{log-BL7saUR-.js → log-ljlYVvKz.js} +1 -1
- package/dist/assets/{login-CfPEbOMU.js → login-e_NJksFx.js} +1 -1
- package/dist/assets/{login-oauth-callback-CbHNtlhV.js → login-oauth-callback-6FC8idn6.js} +1 -1
- package/dist/assets/{logo-uploader-CXV5koKw.js → logo-uploader-BghZxaXm.js} +1 -1
- package/dist/assets/{lost-passport-DJ2zK8hy.js → lost-passport-sW8DA7d5.js} +1 -1
- package/dist/assets/{open-window-qEAgomZG.js → open-window-CXEIuhm-.js} +1 -1
- package/dist/assets/{over-due-invoice-payment-D5hqgkBT.js → over-due-invoice-payment-CcPBU5m-.js} +1 -1
- package/dist/assets/{overview-C_lm4_df.js → overview-D4mRghWV.js} +1 -1
- package/dist/assets/{passport-DM5SPbHM.js → passport-InAw8ts3.js} +1 -1
- package/dist/assets/{passport-item-3DI7pGBf.js → passport-item-7G49I01A.js} +1 -1
- package/dist/assets/{permission-s1vfZfOB.js → permission-DVlrf60Y.js} +1 -1
- package/dist/assets/{preferences-_yaCJj1p.js → preferences-DDCeejgD.js} +1 -1
- package/dist/assets/{profile-embed-C9mA_S9A.js → profile-embed-BLiDn2ls.js} +1 -1
- package/dist/assets/{publish-resource-Q3Sg4NhQ.js → publish-resource-ztAbEOYJ.js} +1 -1
- package/dist/assets/{runtime-DJ07buOB.js → runtime-DI-5yi3_.js} +1 -1
- package/dist/assets/sdk-BbyMeQrc.js +1 -0
- package/dist/assets/{security-BB8LkO1d.js → security-BFYfTqZs.js} +1 -1
- package/dist/assets/{session-BYUJUwt5.js → session-SqadLMEY.js} +1 -1
- package/dist/assets/{setup-D_uNhYL1.js → setup-DSHYh-k3.js} +1 -1
- package/dist/assets/{simple-select-Bh-KqIzp.js → simple-select-Bif1RlSz.js} +1 -1
- package/dist/assets/{spaces-CAh777pB.js → spaces-CLjWPJSv.js} +1 -1
- package/dist/assets/{start-BXVj6K34.js → start-RseKdDAg.js} +1 -1
- package/dist/assets/{starting-progress-Cr7Dhtc0.js → starting-progress-BdHDbZA8.js} +1 -1
- package/dist/assets/{status-C1igPCAc.js → status-B02rE3OJ.js} +1 -1
- package/dist/assets/{step-actions-CzQHsGG8.js → step-actions-gJEftNli.js} +1 -1
- package/dist/assets/{studio-NLZNkTb4.js → studio-VRwDw2v1.js} +1 -1
- package/dist/assets/{team-_EogfHX7.js → team-D29LjHNf.js} +1 -1
- package/dist/assets/{traffic-BbiwlHWj.js → traffic-DGDO-5_X.js} +1 -1
- package/dist/assets/{transfer-gc1GZBIx.js → transfer-CzsMxoja.js} +1 -1
- package/dist/assets/{unsubscribe-DuwSXkBI.js → unsubscribe-BPqvl0Qq.js} +1 -1
- package/dist/assets/{use-app-logo-iwMRCv-t.js → use-app-logo-D768RYSo.js} +1 -1
- package/dist/assets/{user-center-DfwrnXim.js → user-center-B6mso4VA.js} +2 -2
- package/dist/assets/{user-follower-BLRS0VYS.js → user-follower-Bx_h5g8K.js} +1 -1
- package/dist/assets/{util-DPYbSMU0.js → util-BQmjsgsT.js} +1 -1
- package/dist/assets/{util-IJIaP2Ju.js → util-CW4LiHT7.js} +1 -1
- package/dist/assets/{wait-connect-iNFEi-e2.js → wait-connect-DOCM-L84.js} +1 -1
- package/dist/assets/{wizard-DGVZKhvx.js → wizard-BsZNkmTe.js} +1 -1
- package/dist/assets/{wizard-components-DAyQuqLW.js → wizard-components-Bhn-EsyA.js} +1 -1
- package/dist/assets/{wrap-locale-BHrzeI1j.js → wrap-locale-BovKZCTj.js} +1 -1
- package/dist/assets/{zh-CVVdRn45.js → zh-DhM7svnr.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +2 -2
- package/package.json +30 -29
- package/dist/assets/dashboard-DRyb1sbI.js +0 -106
- package/dist/assets/engine-DHTRYPdG.js +0 -1
- package/dist/assets/sdk-Bomrk-jh.js +0 -1
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.__toCdnUrl("assets/vendor-ux-DYcPPYq2.css"),window.__toCdnUrl("assets/index-DrVXX4fX.css"),window.__toCdnUrl("assets/index-gnjjKJuC.css"),window.__toCdnUrl("assets/add-component-core-G0iZE90Q.css")])))=>i.map(i=>d[i]);
|
|
2
|
-
import{U as vt,p as ln,n as wt,H as G,V as B,aI as un,aJ as Eo,Q as _o,M as dn,E as Pt,w as Lo,j as To,_ as L}from"./vendor-ux-r9bApERu.js";import{j as i,W as y,aZ as Do,cN as Ao,d9 as Po,bb as Ro,dg as Mo,dh as Oo,cP as No,di as Uo,dc as Bo,dj as zo,I as Ue,aQ as $o,aR as Fo,aX as Be,a3 as Vo,M as Ho,aO as Wo,a6 as H,aP as qo,bi as Ko,at as ze,T as Q,bq as Go,b6 as Rt,br as Mt,ak as _,D as he,J as oe,ah as $e,ao as Qo,dk as Zo,aj as Xo,dl as fn,dm as pn,dn as mn,am as pe,a$ as Le,dp as Ot,U as ee,aN as hn,Y as gn,b_ as Jo,dq as Yo,dr as er,Q as at,ds as tr}from"./vendor-mui-core-BPQ6AEW_.js";import{r as h,L as xn,i as bn,g as nr,k as or,j as rr}from"./vendor-react-CUXIiAnY.js";import{_ as Fe,e as R,Y as Ke,an as Ge,c as A,Z as Nt,bC as sr,a2 as ir,ac as ar,v as cr,bD as lr,bE as yn,a1 as se,bF as vn,aS as ur,bG as dr,X as fr,b1 as pr,b2 as mr,bH as hr,b3 as gr,bI as xr,bJ as br,am as yr,bK as Qe,bL as vr,bM as wr,b0 as Sr,a as wn,B as Sn,l as ge,aa as jr,k as Cr,ae as kr,m as Ut,bN as Bt,h as Ir,j as Er,q as _r,o as ce,n as Lr,p as Tr,P as Dr,I as Ar,N as Pr,by as Rr,a0 as Mr,t as Or}from"./index-DXScybaX.js";import{ac as Nr,C as X,J as jn,Q as Ur,e as Br,i as zr}from"./vendor-utils-BgSaqjGx.js";import{o as Pe}from"./vendor-arcblock-D8WYBDYe.js";import{u as zt}from"./useLocalStorage-6wbaKET6.js";import{f as St}from"./index-DBs9Ljax.js";import{C as $t}from"./confirm-DQ4M1D6U.js";import{g as Ze}from"./get-safe-url-DKPL0sDC.js";import{u as Cn}from"./session-BYUJUwt5.js";import{a as $,l as $r}from"./vendor-hooks-PN9SWiQm.js";import{j as Fr,b as Vr,M as Hr,a as Wr,T as qr,N as Kr}from"./team-_EogfHX7.js";import{c as Ft}from"./passport-DM5SPbHM.js";import{D as Gr,u as kn}from"./useAsyncRetry-LJm0Fhbe.js";import{u as In}from"./useSetState-cWrp7qoX.js";import{x as Qr,d as Zr}from"./index-Bka-tTFw.js";import{O as Xr}from"./over-due-invoice-payment-D5hqgkBT.js";const En=h.createContext({});function _n({children:e,type:t="blocklets"}){const[n,r]=h.useState([]),o=h.useRef([]),s=l=>{if(!o.current.includes(l)){const u=[...o.current,l];r(u),o.current=u}},a=l=>{if(o.current.includes(l)){const u=o.current.filter(d=>d!==l);r(u),o.current=u}},c=l=>{const u=n.filter(p=>l.find(f=>f===p));Nr(u,n).forEach(p=>a(p))};return i.jsx(En.Provider,{value:{type:t,deletingBlocklets:n,addDeletingDid:s,removeDeletingDid:a,matchDeletingDid:c},children:e})}_n.propTypes={type:y.string,children:y.node.isRequired};function nc(){return h.useContext(En)}const Jr=e=>h.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("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"})),Ln={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m8 9l3 3l-3 3m5 0h3"/><path d="M3 6a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/></g>'},Yr={display:"inline-flex",width:"26px",height:"26px",paddingRight:"3px"};function es(e){return i.jsx("span",{style:Yr,children:i.jsx(vt,{icon:Ln,width:"100%",height:"100%",...e})})}const Y={Start:Do,Stop:Ao,Restart:Po,Reload:zo,Remove:Ro,Config:Bo,Log:Uo,Group:No,Cancel:Mo,Dashboard:Jr,Overview:Oo,LogIcon:es,TerminalIcon:Ln},Vt=(e,t)=>{if(!e)return"";if(!t)return e;const n=new URL(e),r=new URLSearchParams(n.searchParams),o=new URL(X(n.origin,t));return o.search=r.toString(),o.toString()},ts="internal",ns="external";function Tn({blocklet:e,onStart:t,onComplete:n,variant:r="menu",hasPermission:o=!1,getComponentUrl:s=null,useBlockletUrlEvaluation:a=()=>({loading:!1,recommendedUrl:window?.location?.href}),...c}){const l=Fe(),[u,d]=h.useState(null),[p,f]=h.useState(null),[g,b]=h.useState(!1),[x,j]=h.useState(null),{t:v}=h.useContext(ln),[k]=zt("skip-blocklet-setup",!1),{loading:w,recommendedUrl:I}=a(e),[C]=zt("blocklet-type-filter",ts),m=R.isInProgress(e.status),[E,O]=h.useState(!1);h.useEffect(()=>{if(!e?.controller)return;O(e?.controller?.status?.value===Ke.BLOCKLET_CONTROLLER_STATUS.suspended),(async()=>{try{const D=await l.api.getLauncherSession({input:{launcherSessionId:e?.controller?.launcherSessionId,launcherUrl:e?.controller?.launcherUrl}});if(D?.error){console.error("get launcher session failed",D.error);return}O([A.LAUNCH_SESSION_STATUS.overdue,A.LAUNCH_SESSION_STATUS.canceled,A.LAUNCH_SESSION_STATUS.terminated].includes(D?.launcherSession?.status))}catch(D){console.error("call getLauncherSession error",D)}})()},[]);const{inService:N}=l,M=(S,D,z=!1)=>async()=>{const q=async je=>{t({action:S,blocklet:e}),b(!0),f(S);let Ce=!1;try{if(S==="remove")await D(je);else if(S==="start"){if(!R.hasRunnableComponent(e)){G.error(v("blocklet.noComponent"));return}if(!N&&!k&&!e.settings?.initialized&&e.mode!==Ke.BLOCKLET_MODES.DEVELOPMENT){if(!I||!Nt(I)){G.error(v("blocklet.gotoVisitError"));return}const U=sr(l.info),At=new URL(I);At.searchParams.set("serverUrl",U),window.open(Ze(At.href,{allowDomains:null})),n({action:S,blocklet:e});return}const V=e.children.filter(U=>!R.isInProgress(U.status)&&U.status!=="running"&&!R.isInProgress(U.greenStatus)&&U.greenStatus!=="running").map(U=>U.meta.did),re={did:e.meta.did,componentDids:V};await D({input:re})}else if(["stop","restart","reload"].includes(S)){const V=e.children.filter(U=>R.isBlockletRunning(U)).map(U=>U.meta.did),re={did:e.meta.did,componentDids:V};await D({input:re})}else{const V={did:e.meta.did};await D({input:V})}S==="remove"?Ce=!0:await ir(1e3),S==="reload"&&G.success(v("blocklet.reloadSuccess")),j(null),n({action:S,blocklet:e})}catch(V){const re=`Blocklet ${S} failed: ${St(V)}`;throw n({action:S,blocklet:e,error:new Error(re)}),new Error(re)}finally{Ce||b(!1)}},K=()=>{b(!1),j(null)},Se=R.getDisplayName(e,!0),ko=e.mode===Ke.BLOCKLET_MODES.DEVELOPMENT?{description:()=>i.jsx(Q,{component:"div",children:i.jsx(Q,{gutterBottom:!0,children:v("blocklet.action.removeApplicationDescription")})}),params:{removeType:"complete"}}:{description:(je,Ce)=>i.jsxs(Q,{component:"div",children:[i.jsx(Q,{gutterBottom:!0,children:v("blocklet.action.removeApplicationDescription")}),i.jsxs(Go,{name:"removeType",value:je.removeType,onChange:V=>Ce({...je,removeType:V.target.value}),children:[i.jsx(Rt,{value:"backup",control:i.jsx(Mt,{}),label:v("blocklet.action.removeApplicationAfterBackup")}),i.jsx(Rt,{value:"complete",control:i.jsx(Mt,{}),label:v("blocklet.action.removeApplicationComplete")})]})]}),params:{removeType:"backup"}},Io={stop:{title:`${v("common.stop")} ${Se}`,description:v("blocklet.action.stopDescription"),confirm:v("blocklet.action.confirmStop"),cancel:v("common.cancel"),onConfirm:q,onCancel:K},restart:{title:`${v("common.restart")} ${Se}`,description:v("blocklet.action.restartDescription"),confirm:v("blocklet.action.confirmRestart"),cancel:v("common.cancel"),onConfirm:q,onCancel:K},remove:{title:`${v("common.remove")} ${Se}`,confirm:v("blocklet.action.confirmRemove"),cancel:v("common.cancel"),onConfirm:q,onCancel:K,...ko},cancelDownload:{title:`${v("common.cancel")}`,description:v("blocklet.action.cancelDownloadDescription",{name:Se}),confirm:v("common.confirm"),cancel:v("common.cancel"),onConfirm:q,onCancel:K}};z?j(Io[S]):await q()},W=!!u,Lt=S=>{try{S.stopPropagation(),S.preventDefault()}catch{}d(S.currentTarget)},wo=S=>{try{S.stopPropagation(),S.preventDefault()}catch{}d(null)},Tt=async(S,D)=>{try{D.stopPropagation(),D.preventDefault()}catch{}if(typeof S.handler=="function")try{b(!0),f(S.action),await S.handler()}catch(z){console.error(`Blocklet ${S.name} failed: `,z)}finally{b(!1),d(null)}else d(null)},So=!N&&R.isDeletableBlocklet(e)?{action:"remove",icon:Y.Remove,name:v("common.remove"),handler:M("remove",async({removeType:S})=>{S==="backup"&&await l.api.backupBlocklet({input:{appDid:e.appDid,to:"disk"}}),await l.api.deleteBlocklet({input:{did:e.meta.did,keepData:!1}})},!0),disabled:m}:null,jo={action:"remove",icon:({sx:S,...D})=>i.jsx(Y.Cancel,{sx:{...S,paddingRight:"2px",zoom:.95},...D}),name:v("common.cancel"),handler:M("cancelDownload",l.api.cancelDownloadBlocklet,!0)},Co=R.getAppMissingConfigs(e),Dt=(S="dashboard")=>{const D=`/${e.mountPoint||"/"}`.replace(/\/+/g,"/"),z=s?.({mountPoint:D,blocklet:e});if(!z||!Nt(z)){G.error(v("blocklet.gotoVisitError"));return}const q=e?.site?.domainAliases;S==="logs"?window.open(Ze(Vt(z,`${A.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/developers/logs`),{allowDomains:q?.map(K=>K.value)})):window.open(Ze(Vt(z,`${A.WELLKNOWN_SERVICE_PATH_PREFIX}/admin`),{allowDomains:q?.map(K=>K.value)}))};let we=[{action:"start",icon:Y.Start,inExternal:!0,name:v("common.start"),handler:M("start",l.api.startBlocklet),disabled:E||e.children.every(S=>R.isBlockletRunning(S))||Ge(e.status)||w||m},{action:"stop",icon:Y.Stop,inExternal:!0,name:v("common.stop"),handler:M("stop",l.api.stopBlocklet,!0),disabled:!["running","starting"].includes(e.status)},{action:"restart",inExternal:!0,icon:Y.Restart,name:v("common.restart"),handler:M("restart",l.api.restartBlocklet,!0),disabled:E||e.status!=="running"},Ge(e.status)?jo:So,{separator:!0},N?null:{action:"dashboard",icon:({style:S,...D})=>i.jsx(Y.Dashboard,{...D,style:{...S,width:"26px",height:"26px",paddingRight:"3px"}}),name:v("sidebar.dashboard"),handler:Dt},N?null:{action:"logs",icon:Y.LogIcon,name:v("common.logs"),handler:()=>Dt("logs")}].filter(Boolean);return C===ns&&(we=we.filter(S=>S.inExternal)),r==="menu"?i.jsxs(Ht,{"data-cy":"blocklet-actions",children:[i.jsx(Ue,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions","actions-blocklet-did":e.meta.did,onClick:Lt,size:"small",disabled:!o||!Ge(e.status)&&g,children:i.jsx($o,{})}),i.jsxs(Fo,{id:"actions-menu",anchorEl:u,keepMounted:!0,open:W,onClose:wo,PaperProps:{},children:[Co.length>0&&i.jsxs(Be,{style:{maxWidth:"400px"},severity:"error",children:[v("blocklet.config.missingRequired"),i.jsx("br",{}),i.jsx(xn,{to:`/blocklets/${e.meta.did}/components`,children:v("blocklet.config.gotoFix")})]}),we.map((S,D)=>S.separator?i.jsx(Vo,{},`separator-${D}`):i.jsxs(Ho,{dense:!0,onClick:z=>Tt(S,z),disabled:g||S.disabled,"data-cy":`${S.action}-blocklet`,children:[i.jsx(Wo,{style:{minWidth:24},children:p===S.action&&g?i.jsx(H,{size:16,sx:{marginRight:1}}):i.jsx(S.icon,{fontSize:"small"})}),i.jsx(qo,{primary:S.name})]},S.name))]}),x&&i.jsx($t,{title:x.title,description:x.description,confirm:x.confirm,cancel:x.cancel,params:x.params,onConfirm:x.onConfirm,onCancel:x.onCancel})]}):i.jsxs(Ht,{"data-cy":"blocklet-actions",...c,children:[i.jsx(Ko,{children:we.filter(S=>!S.separator&&!S.onlyInMenu).map(S=>i.jsxs(wt,{title:S.name,"data-cy":`${S.action}-blocklet`,onClick:()=>Tt(S),disabled:!!S.disabled||g,children:[p===S.action&&g?i.jsx(H,{size:16,sx:{marginRight:1}}):i.jsx(S.icon,{}),i.jsx("span",{className:"blocklet-action-text",children:S.name})]},S.name))}),x&&i.jsx($t,{title:x.title,description:x.description,confirm:x.confirm,cancel:x.cancel,params:x.params,onConfirm:x.onConfirm,onCancel:x.onCancel})]})}Tn.propTypes={getComponentUrl:y.func,blocklet:y.object.isRequired,onStart:y.func.isRequired,onComplete:y.func.isRequired,variant:y.oneOf(["menu","group"]),hasPermission:y.bool,useBlockletUrlEvaluation:y.func};const Ht=ze.div`
|
|
3
|
-
display: flex;
|
|
4
|
-
align-items: center;
|
|
5
|
-
|
|
6
|
-
@media (max-width: ${e=>e.theme.breakpoints.values.sm}px) {
|
|
7
|
-
.MuiButton-root {
|
|
8
|
-
padding: 4px;
|
|
9
|
-
font-size: 10px;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
`,os=h.memo(Tn),rs=e=>{const t={};let n=null;return R.forEachBlockletSync(e,r=>{t[r.meta.bundleDid]?n=R.getDisplayName(r,!0):r.meta.bundleDid&&(t[r.meta.bundleDid]=!0)}),n},ss=(e,t,n)=>{const{hostname:r,href:o}=e;if(!t)return o;if(n){const a=/\d+[-.]\d+[-.]\d+[-.]\d+/.exec(r);if(!a)return o;const c=a[0],u=((t.site?.domainAliases||[]).map(d=>d.value).filter(Boolean).find(d=>d.endsWith(A.DEFAULT_DID_DOMAIN))||"").replace(`.${A.DEFAULT_DID_DOMAIN}`,"");return u?o.replace(r,`${u}-${c}.${A.DEFAULT_IP_DOMAIN_SUFFIX}`):o}return o.replace(t.meta.bundleDid,t.appPid)};function is(){const{t:e}=B(),{api:t}=Cn(),{blocklet:n}=ar(),{inService:r}=Fe(),[o,s]=h.useState(!1),[a,c]=h.useState(5),l=n&&n.structVersion!==A.APP_STRUCT_VERSION,u=()=>{try{if(R.isBlockletRunning(n)){G.error(e("blocklet.migrate.tip.running"));return}const f=rs(n);if(f){G.error(e("blocklet.migrate.tip.duplicate",{name:f}));return}s(!0)}catch(f){G.error(St(f))}},d=()=>{const f=ss(window.location,n,r);setTimeout(()=>{window.location.href=f},5e3),c(5),setInterval(()=>{c(g=>g-1)},1e3)},p=()=>s(!1);return[l&&i.jsxs(Be,{severity:"warning",style:{margin:"12px 0"},children:[i.jsxs(_,{sx:{display:"flex",alignItems:"center"},children:[i.jsx(wt,{variant:"contained",size:"small",color:"primary",onClick:()=>u(),style:{marginRight:8},children:e("blocklet.migrate.intro.l1")}),i.jsx("span",{children:e("blocklet.migrate.intro.l2")})]}),["l3","l4","l5","l6"].map(f=>i.jsx(_,{sx:{display:"flex",alignItems:"center"},children:e(`blocklet.migrate.intro.${f}`)},f))]},"alert"),n&&i.jsx(cr,{popup:!0,open:o,saveConnect:!1,forceConnected:!1,action:"migrate-app-to-struct-v2",checkFn:t.get,checkTimeout:5*60*1e3,onSuccess:d,extraParams:{appDid:n.appDid,did:n.meta.did,wt:lr(n,!0),title:R.getDisplayName(n)},messages:{title:e("blocklet.migrate.title"),scan:e("blocklet.migrate.scan"),confirm:e("blocklet.migrate.confirm"),success:a>=0?e("blocklet.migrate.success",{sec:a}):"Redirecting..."},onClose:p},"connect")]}function as(){const e=he();return[...e.breakpoints.keys].reverse().reduce((n,r)=>{const o=oe(e.breakpoints.up(r));return!n&&o?r:n},null)||"xs"}function cs(e){return i.jsx($e,{...e,children:i.jsx("path",{d:"M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41 10.59L10 14.17L17.59 6.58L19 8L10 17Z"})})}function ls(e){return i.jsx($e,{...e,children:i.jsx("path",{d:"M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"})})}function us(e){return i.jsx($e,{...e,children:i.jsx("path",{d:"M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2, 6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12, 13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z"})})}function ds(e){return i.jsx($e,{...e,children:i.jsx("path",{d:"M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12A10,10 0 0,0 12,2Z"})})}const ke={fontSize:20,marginInlineEnd:8},fs={success:i.jsx(cs,{style:ke}),warning:i.jsx(ls,{style:ke}),error:i.jsx(us,{style:ke}),info:i.jsx(ds,{style:ke})},ps={xl:"400px",lg:"400px",md:"400px",sm:"300px"};function Dn({keyId:e,notification:t={},viewAllUrl:n,content:r=null},o){const s=he(),a=fs[t.severity],{closeSnackbar:c}=un(),l=()=>c(e),u=bn(),d=()=>{c(e),u(n)},p=$(()=>Fr(t),[t]),f=$(()=>t?.activity,[t]),g=Vr({activity:f,users:[t?.actorInfo],actors:[t?.activity?.actor],extra:{linkColor:s.palette.primary.main,userDid:t?.receivers?.[0]?.did}}),b=as();return i.jsxs(_,{component:Eo,ref:o,sx:[{...s.typography.body2,display:"flex",backgroundColor:s.palette.background.default,color:"#fff",alignItems:"center",pl:2.5,pr:2,py:.75,borderRadius:"4px",boxShadow:"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)",width:ps[b]},t.severity==="success"?{backgroundColor:`${Qo[600]} !important`}:{},t.severity==="error"?{backgroundColor:`${s.palette.error.dark} !important`}:{},t.severity==="info"?{backgroundColor:`${s.palette.primary.main} !important`}:{},t.severity==="warning"?{backgroundColor:`${Zo[700]} !important`}:{}],children:[i.jsxs(_,{sx:{display:"flex",alignItems:"center",py:1,flex:1},children:[a,i.jsx(hs,{onClick:d,sx:{flex:1},children:i.jsx(_,{children:p?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"title",children:g}),f.meta?i.jsx(Hr,{meta:f.meta,type:f.type,sx:{display:"-webkit-box",overflow:"hidden",textOverflow:"ellipsis",WebkitLineClamp:3,WebkitBoxOrient:"vertical",color:"#fff"}}):null]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"title",children:t.title}),r||i.jsx("span",{className:"desc",children:t.description})]})})})]}),i.jsx(_,{sx:{display:"flex",alignItems:"center",ml:"auto",mr:-1,width:44},children:i.jsx(Ue,{"aria-label":"close",color:"inherit",onClick:l,size:"large",children:i.jsx(_,{component:Xo,sx:{fontSize:20}})},"close")})]})}const ms=h.forwardRef(Dn);Dn.propTypes={viewAllUrl:y.string.isRequired,keyId:y.number.isRequired,notification:y.object.isRequired,content:y.node};const hs=ze.div`
|
|
13
|
-
cursor: pointer;
|
|
14
|
-
display: flex;
|
|
15
|
-
flex-direction: column;
|
|
16
|
-
.title {
|
|
17
|
-
overflow: hidden;
|
|
18
|
-
text-overflow: ellipsis;
|
|
19
|
-
display: -webkit-box;
|
|
20
|
-
-webkit-line-clamp: 1;
|
|
21
|
-
-webkit-box-orient: vertical;
|
|
22
|
-
font-weight: bold;
|
|
23
|
-
}
|
|
24
|
-
.desc {
|
|
25
|
-
overflow: hidden;
|
|
26
|
-
text-overflow: ellipsis;
|
|
27
|
-
display: -webkit-box;
|
|
28
|
-
-webkit-line-clamp: 3;
|
|
29
|
-
-webkit-box-orient: vertical;
|
|
30
|
-
word-break: break-word;
|
|
31
|
-
}
|
|
32
|
-
`;var T=function(t,n,r){return fn.call(n,"css")?i.jsx(pn,mn(t,n),r):i.jsx(t,n,r)},Ie=function(t,n,r){return fn.call(n,"css")?i.jsxs(pn,mn(t,n),r):i.jsxs(t,n,r)};/**
|
|
33
|
-
* (c) Iconify
|
|
34
|
-
*
|
|
35
|
-
* For the full copyright and license information, please view the license.txt or license.gpl.txt
|
|
36
|
-
* files at https://github.com/iconify/iconify
|
|
37
|
-
*
|
|
38
|
-
* Licensed under MIT.
|
|
39
|
-
*
|
|
40
|
-
* @license MIT
|
|
41
|
-
* @version 3.1.1
|
|
42
|
-
*/const An=Object.freeze({left:0,top:0,width:16,height:16}),Re=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),xe=Object.freeze({...An,...Re}),ct=Object.freeze({...xe,body:"",hidden:!1});function gs(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function Wt(e,t){const n=gs(e,t);for(const r in ct)r in Re?r in e&&!(r in n)&&(n[r]=Re[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function xs(e,t){const n=e.icons,r=e.aliases||Object.create(null),o=Object.create(null);function s(a){if(n[a])return o[a]=[];if(!(a in o)){o[a]=null;const c=r[a]&&r[a].parent,l=c&&s(c);l&&(o[a]=[c].concat(l))}return o[a]}return Object.keys(n).concat(Object.keys(r)).forEach(s),o}function bs(e,t,n){const r=e.icons,o=e.aliases||Object.create(null);let s={};function a(c){s=Wt(r[c]||o[c],s)}return a(t),n.forEach(a),Wt(e,s)}function ys(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(o=>{t(o,null),n.push(o)});const r=xs(e);for(const o in r){const s=r[o];s&&(t(o,bs(e,o,s)),n.push(o))}return n}const ue=/^[a-z0-9]+(-[a-z0-9]+)*$/,ae=(e,t,n,r="")=>{const o=e.split(":");if(e.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;r=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const c=o.pop(),l=o.pop(),u={provider:o.length>0?o[0]:r,prefix:l,name:c};return t&&!Te(u)?null:u}const s=o[0],a=s.split("-");if(a.length>1){const c={provider:r,prefix:a.shift(),name:a.join("-")};return t&&!Te(c)?null:c}if(n&&r===""){const c={provider:r,prefix:"",name:s};return t&&!Te(c,n)?null:c}return null},Te=(e,t)=>e?!!((e.provider===""||e.provider.match(ue))&&(t&&e.prefix===""||e.prefix.match(ue))&&e.name.match(ue)):!1,vs={provider:"",aliases:{},not_found:{},...An};function Xe(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function ws(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!Xe(e,vs))return null;const n=t.icons;for(const o in n){const s=n[o];if(!o.match(ue)||typeof s.body!="string"||!Xe(s,ct))return null}const r=t.aliases||Object.create(null);for(const o in r){const s=r[o],a=s.parent;if(!o.match(ue)||typeof a!="string"||!n[a]&&!r[a]||!Xe(s,ct))return null}return t}const Me=Object.create(null);function Ss(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function F(e,t){const n=Me[e]||(Me[e]=Object.create(null));return n[t]||(n[t]=Ss(e,t))}function jt(e,t){return ws(t)?ys(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function js(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}function Cs(e,t){let n=[];return(typeof e=="string"?[e]:Object.keys(Me)).forEach(o=>{(typeof o=="string"&&typeof t=="string"?[t]:Object.keys(Me[o]||{})).forEach(a=>{const c=F(o,a);n=n.concat(Object.keys(c.icons).map(l=>(o!==""?"@"+o+":":"")+a+":"+l))})}),n}let Ct=!1;function ks(e){return Ct}function be(e){const t=typeof e=="string"?ae(e,!0,Ct):e;if(t){const n=F(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function Is(e,t){const n=ae(e,!0,Ct);if(!n)return!1;const r=F(n.provider,n.prefix);return js(r,n.name,t)}function Pn(e,t){if(typeof e!="object")return!1;typeof t!="string"&&(t=e.provider||"");const n=e.prefix;if(!Te({provider:t,prefix:n,name:"a"}))return!1;const r=F(t,n);return!!jt(r,e)}function Es(e){return!!be(e)}function _s(e){const t=be(e);return t?{...xe,...t}:null}const Rn=Object.freeze({width:null,height:null}),Mn=Object.freeze({...Rn,...Re}),Ls=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Ts=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function lt(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(Ls);if(r===null||!r.length)return e;const o=[];let s=r.shift(),a=Ts.test(s);for(;;){if(a){const c=parseFloat(s);isNaN(c)?o.push(s):o.push(Math.ceil(c*t*n)/n)}else o.push(s);if(s=r.shift(),s===void 0)return o.join("");a=!a}}const Ds=e=>e==="unset"||e==="undefined"||e==="none";function Ve(e,t){const n={...xe,...e},r={...Mn,...t},o={left:n.left,top:n.top,width:n.width,height:n.height};let s=n.body;[n,r].forEach(b=>{const x=[],j=b.hFlip,v=b.vFlip;let k=b.rotate;j?v?k+=2:(x.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),x.push("scale(-1 1)"),o.top=o.left=0):v&&(x.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),x.push("scale(1 -1)"),o.top=o.left=0);let w;switch(k<0&&(k-=Math.floor(k/4)*4),k=k%4,k){case 1:w=o.height/2+o.top,x.unshift("rotate(90 "+w.toString()+" "+w.toString()+")");break;case 2:x.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:w=o.width/2+o.left,x.unshift("rotate(-90 "+w.toString()+" "+w.toString()+")");break}k%2===1&&(o.left!==o.top&&(w=o.left,o.left=o.top,o.top=w),o.width!==o.height&&(w=o.width,o.width=o.height,o.height=w)),x.length&&(s='<g transform="'+x.join(" ")+'">'+s+"</g>")});const a=r.width,c=r.height,l=o.width,u=o.height;let d,p;a===null?(p=c===null?"1em":c==="auto"?u:c,d=lt(p,l/u)):(d=a==="auto"?l:a,p=c===null?lt(d,u/l):c==="auto"?u:c);const f={},g=(b,x)=>{Ds(x)||(f[b]=x.toString())};return g("width",d),g("height",p),f.viewBox=o.left.toString()+" "+o.top.toString()+" "+l.toString()+" "+u.toString(),{attributes:f,body:s}}const As=/\sid="(\S+)"/g,Ps="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let Rs=0;function On(e,t=Ps){const n=[];let r;for(;r=As.exec(e);)n.push(r[1]);if(!n.length)return e;const o="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(s=>{const a=typeof t=="function"?t(s):t+(Rs++).toString(),c=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+c+')([")]|\\.[a-z])',"g"),"$1"+a+o+"$3")}),e=e.replace(new RegExp(o,"g"),""),e}const te={local:!0,session:!0},Nn={local:new Set,session:new Set};let kt=!1;function Ms(e){kt=e}const qt="iconify2",me="iconify",Un=me+"-count",Kt=me+"-version",Bn=36e5,Os=168;function ut(e,t){try{return e.getItem(t)}catch{}}function It(e,t,n){try{return e.setItem(t,n),!0}catch{}}function Gt(e,t){try{e.removeItem(t)}catch{}}function dt(e,t){return It(e,Un,t.toString())}function ft(e){return parseInt(ut(e,Un))||0}let Ee=typeof window>"u"?{}:window;function zn(e){const t=e+"Storage";try{if(Ee&&Ee[t]&&typeof Ee[t].length=="number")return Ee[t]}catch{}te[e]=!1}function $n(e,t){const n=zn(e);if(!n)return;const r=ut(n,Kt);if(r!==qt){if(r){const c=ft(n);for(let l=0;l<c;l++)Gt(n,me+l.toString())}It(n,Kt,qt),dt(n,0);return}const o=Math.floor(Date.now()/Bn)-Os,s=c=>{const l=me+c.toString(),u=ut(n,l);if(typeof u=="string"){try{const d=JSON.parse(u);if(typeof d=="object"&&typeof d.cached=="number"&&d.cached>o&&typeof d.provider=="string"&&typeof d.data=="object"&&typeof d.data.prefix=="string"&&t(d,c))return!0}catch{}Gt(n,l)}};let a=ft(n);for(let c=a-1;c>=0;c--)s(c)||(c===a-1?(a--,dt(n,a)):Nn[e].add(c))}function Fn(){if(!kt){Ms(!0);for(const e in te)$n(e,t=>{const n=t.data,r=t.provider,o=n.prefix,s=F(r,o);if(!jt(s,n).length)return!1;const a=n.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,a):a,!0})}}function Vn(e,t){switch(e){case"local":case"session":te[e]=t;break;case"all":for(const n in te)te[n]=t;break}}const pt=Object.create(null);function Hn(e,t){pt[e]=t}function mt(e){return pt[e]||pt[""]}function Et(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const He=Object.create(null),le=["https://api.simplesvg.com","https://api.unisvg.com"],De=[];for(;le.length>0;)le.length===1||Math.random()>.5?De.push(le.shift()):De.push(le.pop());He[""]=Et({resources:["https://api.iconify.design"].concat(De)});function Wn(e,t){const n=Et(t);return n===null?!1:(He[e]=n,!0)}function We(e){return He[e]}function Ns(){return Object.keys(He)}const Us=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let Oe=Us();function Bs(e){Oe=e}function zs(){return Oe}function $s(e,t){const n=We(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let o=0;n.resources.forEach(a=>{o=Math.max(o,a.length)});const s=t+".json?icons=";r=n.maxURL-o-n.path.length-s.length}return r}function Fs(e){return e===404}const Vs=(e,t,n)=>{const r=[],o=$s(e,t),s="icons";let a={type:s,provider:e,prefix:t,icons:[]},c=0;return n.forEach((l,u)=>{c+=l.length+1,c>=o&&u>0&&(r.push(a),a={type:s,provider:e,prefix:t,icons:[]},c=l.length),a.icons.push(l)}),r.push(a),r};function Hs(e){if(typeof e=="string"){const t=We(e);if(t)return t.path}return"/"}const Ws=(e,t,n)=>{if(!Oe){n("abort",424);return}let r=Hs(t.provider);switch(t.type){case"icons":{const s=t.prefix,c=t.icons.join(","),l=new URLSearchParams({icons:c});r+=s+".json?"+l.toString();break}case"custom":{const s=t.uri;r+=s.slice(0,1)==="/"?s.slice(1):s;break}default:n("abort",400);return}let o=503;Oe(e+r).then(s=>{const a=s.status;if(a!==200){setTimeout(()=>{n(Fs(a)?"abort":"next",a)});return}return o=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?n("abort",s):n("next",o)});return}setTimeout(()=>{n("success",s)})}).catch(()=>{n("next",o)})},qs={prepare:Vs,send:Ws};function Ks(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((o,s)=>o.provider!==s.provider?o.provider.localeCompare(s.provider):o.prefix!==s.prefix?o.prefix.localeCompare(s.prefix):o.name.localeCompare(s.name));let r={provider:"",prefix:"",name:""};return e.forEach(o=>{if(r.name===o.name&&r.prefix===o.prefix&&r.provider===o.provider)return;r=o;const s=o.provider,a=o.prefix,c=o.name,l=n[s]||(n[s]=Object.create(null)),u=l[a]||(l[a]=F(s,a));let d;c in u.icons?d=t.loaded:a===""||u.missing.has(c)?d=t.missing:d=t.pending;const p={provider:s,prefix:a,name:c};d.push(p)}),t}function qn(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(o=>o.id!==t))})}function Gs(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const r=e.provider,o=e.prefix;t.forEach(s=>{const a=s.icons,c=a.pending.length;a.pending=a.pending.filter(l=>{if(l.prefix!==o)return!0;const u=l.name;if(e.icons[u])a.loaded.push({provider:r,prefix:o,name:u});else if(e.missing.has(u))a.missing.push({provider:r,prefix:o,name:u});else return n=!0,!0;return!1}),a.pending.length!==c&&(n||qn([e],s.id),s.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),s.abort))})}))}let Qs=0;function Zs(e,t,n){const r=Qs++,o=qn.bind(null,n,r);if(!t.pending.length)return o;const s={id:r,icons:t,callback:e,abort:o};return n.forEach(a=>{(a.loaderCallbacks||(a.loaderCallbacks=[])).push(s)}),o}function Xs(e,t=!0,n=!1){const r=[];return e.forEach(o=>{const s=typeof o=="string"?ae(o,t,n):o;s&&r.push(s)}),r}var Js={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Ys(e,t,n,r){const o=e.resources.length,s=e.random?Math.floor(Math.random()*o):e.index;let a;if(e.random){let m=e.resources.slice(0);for(a=[];m.length>1;){const E=Math.floor(Math.random()*m.length);a.push(m[E]),m=m.slice(0,E).concat(m.slice(E+1))}a=a.concat(m)}else a=e.resources.slice(s).concat(e.resources.slice(0,s));const c=Date.now();let l="pending",u=0,d,p=null,f=[],g=[];typeof r=="function"&&g.push(r);function b(){p&&(clearTimeout(p),p=null)}function x(){l==="pending"&&(l="aborted"),b(),f.forEach(m=>{m.status==="pending"&&(m.status="aborted")}),f=[]}function j(m,E){E&&(g=[]),typeof m=="function"&&g.push(m)}function v(){return{startTime:c,payload:t,status:l,queriesSent:u,queriesPending:f.length,subscribe:j,abort:x}}function k(){l="failed",g.forEach(m=>{m(void 0,d)})}function w(){f.forEach(m=>{m.status==="pending"&&(m.status="aborted")}),f=[]}function I(m,E,O){const N=E!=="success";switch(f=f.filter(M=>M!==m),l){case"pending":break;case"failed":if(N||!e.dataAfterTimeout)return;break;default:return}if(E==="abort"){d=O,k();return}if(N){d=O,f.length||(a.length?C():k());return}if(b(),w(),!e.random){const M=e.resources.indexOf(m.resource);M!==-1&&M!==e.index&&(e.index=M)}l="completed",g.forEach(M=>{M(O)})}function C(){if(l!=="pending")return;b();const m=a.shift();if(m===void 0){if(f.length){p=setTimeout(()=>{b(),l==="pending"&&(w(),k())},e.timeout);return}k();return}const E={status:"pending",resource:m,callback:(O,N)=>{I(E,O,N)}};f.push(E),u++,p=setTimeout(C,e.rotate),n(m,t,E.callback)}return setTimeout(C),v}function Kn(e){const t={...Js,...e};let n=[];function r(){n=n.filter(c=>c().status==="pending")}function o(c,l,u){const d=Ys(t,c,l,(p,f)=>{r(),u&&u(p,f)});return n.push(d),d}function s(c){return n.find(l=>c(l))||null}return{query:o,find:s,setIndex:c=>{t.index=c},getIndex:()=>t.index,cleanup:r}}function Qt(){}const Je=Object.create(null);function ei(e){if(!Je[e]){const t=We(e);if(!t)return;const n=Kn(t),r={config:t,redundancy:n};Je[e]=r}return Je[e]}function Gn(e,t,n){let r,o;if(typeof e=="string"){const s=mt(e);if(!s)return n(void 0,424),Qt;o=s.send;const a=ei(e);a&&(r=a.redundancy)}else{const s=Et(e);if(s){r=Kn(s);const a=e.resources?e.resources[0]:"",c=mt(a);c&&(o=c.send)}}return!r||!o?(n(void 0,424),Qt):r.query(t,o,n)().abort}function ti(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const r in te)$n(r,o=>{const s=o.data;return o.provider!==e.provider||s.prefix!==e.prefix||s.lastModified===t});return!0}function ni(e,t){kt||Fn();function n(r){let o;if(!te[r]||!(o=zn(r)))return;const s=Nn[r];let a;if(s.size)s.delete(a=Array.from(s).shift());else if(a=ft(o),!dt(o,a+1))return;const c={cached:Math.floor(Date.now()/Bn),provider:e.provider,data:t};return It(o,me+a.toString(),JSON.stringify(c))}t.lastModified&&!ti(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function Zt(){}function oi(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Gs(e)}))}function ri(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:r}=e,o=e.iconsToLoad;delete e.iconsToLoad;let s;if(!o||!(s=mt(n)))return;s.prepare(n,r,o).forEach(c=>{Gn(n,c,l=>{if(typeof l!="object")c.icons.forEach(u=>{e.missing.add(u)});else try{const u=jt(e,l);if(!u.length)return;const d=e.pendingIcons;d&&u.forEach(p=>{d.delete(p)}),ni(e,l)}catch(u){console.error(u)}oi(e)})})}))}const si=e=>{const n=F(e.provider,e.prefix).pendingIcons;return!!(n&&n.has(e.name))},_t=(e,t)=>{const n=Xs(e,!0,ks()),r=Ks(n);if(!r.pending.length){let l=!0;return t&&setTimeout(()=>{l&&t(r.loaded,r.missing,r.pending,Zt)}),()=>{l=!1}}const o=Object.create(null),s=[];let a,c;return r.pending.forEach(l=>{const{provider:u,prefix:d}=l;if(d===c&&u===a)return;a=u,c=d,s.push(F(u,d));const p=o[u]||(o[u]=Object.create(null));p[d]||(p[d]=[])}),r.pending.forEach(l=>{const{provider:u,prefix:d,name:p}=l,f=F(u,d),g=f.pendingIcons||(f.pendingIcons=new Set);g.has(p)||(g.add(p),o[u][d].push(p))}),s.forEach(l=>{const{provider:u,prefix:d}=l;o[u][d].length&&ri(l,o[u][d])}),t?Zs(t,r,s):Zt},ii=e=>new Promise((t,n)=>{const r=typeof e=="string"?ae(e,!0):e;if(!r){n(e);return}_t([r||e],o=>{if(o.length&&r){const s=be(r);if(s){t({...xe,...s});return}}n(e)})});function Qn(e,t){const n={...e};for(const r in t){const o=t[r],s=typeof o;r in Rn?(o===null||o&&(s==="string"||s==="number"))&&(n[r]=o):s===typeof n[r]&&(n[r]=r==="rotate"?o%4:o)}return n}const qe={...Mn,inline:!1},Ye="iconify",ht="iconify-inline",J="iconifyData"+Date.now();let ne=[];function ye(e){for(let t=0;t<ne.length;t++){const n=ne[t];if((typeof n.node=="function"?n.node():n.node)===e)return n}}function Zn(e,t=!1){let n=ye(e);return n?(n.temporary&&(n.temporary=t),n):(n={node:e,temporary:t},ne.push(n),n)}function ai(){if(document.documentElement)return Zn(document.documentElement);ne.push({node:()=>document.documentElement})}function ci(e){ne=ne.filter(t=>e!==t&&e!==(typeof t.node=="function"?t.node():t.node))}function ve(){return ne}function li(e){const t=document;t.readyState&&t.readyState!=="loading"?e():t.addEventListener("DOMContentLoaded",e)}let de=null;const ui={childList:!0,subtree:!0,attributes:!0};function Xn(e){if(!e.observer)return;const t=e.observer;t.pendingScan||(t.pendingScan=setTimeout(()=>{delete t.pendingScan,de&&de(e)}))}function di(e,t){if(!e.observer)return;const n=e.observer;if(!n.pendingScan)for(let r=0;r<t.length;r++){const o=t[r];if(o.addedNodes&&o.addedNodes.length>0||o.type==="attributes"&&o.target[J]!==void 0){n.paused||Xn(e);return}}}function Jn(e,t){e.observer.instance.observe(t,ui)}function Ne(e){let t=e.observer;if(t&&t.instance)return;const n=typeof e.node=="function"?e.node():e.node;!n||!window||(t||(t={paused:0},e.observer=t),t.instance=new window.MutationObserver(di.bind(null,e)),Jn(e,n),t.paused||Xn(e))}function Xt(){ve().forEach(Ne)}function Yn(e){if(!e.observer)return;const t=e.observer;t.pendingScan&&(clearTimeout(t.pendingScan),delete t.pendingScan),t.instance&&(t.instance.disconnect(),delete t.instance)}function fi(e){const t=de!==null;if(de!==e&&(de=e,t&&ve().forEach(Yn)),t){Xt();return}li(Xt)}function gt(e){(e?[e]:ve()).forEach(t=>{if(!t.observer){t.observer={paused:1};return}const n=t.observer;if(n.paused++,n.paused>1||!n.instance)return;n.instance.disconnect()})}function pi(e){if(e){const t=ye(e);t&>(t)}else gt()}function xt(e){(e?[e]:ve()).forEach(t=>{if(!t.observer){Ne(t);return}const n=t.observer;if(n.paused&&(n.paused--,!n.paused)){const r=typeof t.node=="function"?t.node():t.node;if(r)n.instance?Jn(t,r):Ne(t);else return}})}function mi(e){if(e){const t=ye(e);t&&xt(t)}else xt()}function eo(e,t=!1){const n=Zn(e,t);return Ne(n),n}function to(e){const t=ye(e);t&&(Yn(t),ci(e))}function hi(e,t){if(e.name!==t.name||e.mode!==t.mode)return!0;const n=e.customisations,r=t.customisations;for(const o in qe)if(n[o]!==r[o])return!0;return!1}function gi(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(o){for(;o<0;)o+=4;return o%4}if(n===""){const o=parseInt(e);return isNaN(o)?0:r(o)}else if(n!==e){let o=0;switch(n){case"%":o=25;break;case"deg":o=90}if(o){let s=parseFloat(e.slice(0,e.length-n.length));return isNaN(s)?0:(s=s/o,s%1===0?r(s):0)}}return t}const xi=/[\s,]+/;function bi(e,t){t.split(xi).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}const yi=["width","height"],vi=["inline","hFlip","vFlip"];function wi(e,t){return e===t||e==="true"?!0:e===""||e==="false"?!1:null}function Si(e){const t=e.getAttribute("data-icon"),n=typeof t=="string"&&ae(t,!0);if(!n)return null;const r={...qe,inline:e.classList&&e.classList.contains(ht)};yi.forEach(c=>{const l=e.getAttribute("data-"+c);l&&(r[c]=l)});const o=e.getAttribute("data-rotate");typeof o=="string"&&(r.rotate=gi(o));const s=e.getAttribute("data-flip");typeof s=="string"&&bi(r,s),vi.forEach(c=>{const l="data-"+c,u=wi(e.getAttribute(l),l);typeof u=="boolean"&&(r[c]=u)});const a=e.getAttribute("data-mode");return{name:t,icon:n,customisations:r,mode:a}}const ji="svg."+Ye+", i."+Ye+", span."+Ye+", i."+ht+", span."+ht;function Ci(e){const t=[];return e.querySelectorAll(ji).forEach(n=>{const r=n[J]||n.tagName.toLowerCase()!=="svg"?Si(n):null;r&&t.push({node:n,props:r})}),t}function no(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}let fe;function ki(){try{fe=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{fe=null}}function Ii(e){return fe===void 0&&ki(),fe?fe.createHTML(e):e}function oo(e){const t=new Set(["iconify"]);return["provider","prefix"].forEach(n=>{e[n]&&t.add("iconify--"+e[n])}),t}function ro(e,t,n,r){const o=e.classList;if(r){const a=r.classList;Array.from(a).forEach(c=>{o.add(c)})}const s=[];return t.forEach(a=>{o.contains(a)?n.has(a)&&s.push(a):(o.add(a),s.push(a))}),n.forEach(a=>{t.has(a)||o.remove(a)}),s}function so(e,t,n){const r=e.style;(n||[]).forEach(s=>{r.removeProperty(s)});const o=[];for(const s in t)r.getPropertyValue(s)||(o.push(s),r.setProperty(s,t[s]));return o}function io(e,t,n){let r;try{r=document.createElement("span")}catch{return e}const o=t.customisations,s=Ve(n,o),a=e[J],c=no(On(s.body),{"aria-hidden":"true",role:"img",...s.attributes});r.innerHTML=Ii(c);const l=r.childNodes[0],u=e.attributes;for(let b=0;b<u.length;b++){const x=u.item(b),j=x.name;j!=="class"&&!l.hasAttribute(j)&&l.setAttribute(j,x.value)}const d=oo(t.icon),p=ro(l,d,new Set(a&&a.addedClasses),e),f=so(l,o.inline?{"vertical-align":"-0.125em"}:{},a&&a.addedStyles),g={...t,status:"loaded",addedClasses:p,addedStyles:f};return l[J]=g,e.parentNode&&e.parentNode.replaceChild(l,e),l}function Ei(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function _i(e){return"data:image/svg+xml,"+Ei(e)}function Li(e){return'url("'+_i(e)+'")'}const Ti={display:"inline-block"},bt={"background-color":"currentColor"},ao={"background-color":"transparent"},Jt={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},Yt={"-webkit-mask":bt,mask:bt,background:ao};for(const e in Yt){const t=Yt[e];for(const n in Jt)t[e+"-"+n]=Jt[n]}function en(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}function Di(e,t,n,r){const o=t.customisations,s=Ve(n,o),a=s.attributes,c=e[J],l=no(s.body,{...a,width:n.width+"",height:n.height+""}),u=oo(t.icon),d=ro(e,u,new Set(c&&c.addedClasses)),f={"--svg":Li(l),width:en(a.width),height:en(a.height),...Ti,...r?bt:ao};o.inline&&(f["vertical-align"]="-0.125em");const g=so(e,f,c&&c.addedStyles),b={...t,status:"loaded",addedClasses:d,addedStyles:g};return e[J]=b,e}let _e=!1;function Ai(){_e||(_e=!0,setTimeout(()=>{_e&&(_e=!1,ie())}))}function ie(e,t=!1){const n=Object.create(null);function r(o,s){const{provider:a,prefix:c,name:l}=o,u=F(a,c),d=u.icons[l];if(d)return{status:"loaded",icon:d};if(u.missing.has(l))return{status:"missing"};if(s&&!si(o)){const p=n[a]||(n[a]=Object.create(null));(p[c]||(p[c]=new Set)).add(l)}return{status:"loading"}}(e?[e]:ve()).forEach(o=>{const s=typeof o.node=="function"?o.node():o.node;if(!s||!s.querySelectorAll)return;let a=!1,c=!1;function l(u,d,p){if(c||(c=!0,gt(o)),u.tagName.toUpperCase()!=="SVG"){const f=d.mode,g=f==="mask"||(f==="bg"?!1:f==="style"?p.body.indexOf("currentColor")!==-1:null);if(typeof g=="boolean"){Di(u,d,{...xe,...p},g);return}}io(u,d,p)}Ci(s).forEach(({node:u,props:d})=>{const p=u[J];if(!p){const{status:g,icon:b}=r(d.icon,!0);if(b){l(u,d,b);return}a=a||g==="loading",u[J]={...d,status:g};return}let f;if(hi(p,d)){if(f=r(d.icon,p.name!==d.name),!f.icon){a=a||f.status==="loading",Object.assign(p,{...d,status:f.status});return}}else{if(p.status!=="loading")return;if(f=r(d.icon,!1),!f.icon){p.status=f.status;return}}l(u,d,f.icon)}),o.temporary&&!a?to(s):t&&a?eo(s,!0):c&&o.observer&&xt(o)});for(const o in n){const s=n[o];for(const a in s){const c=s[a];_t(Array.from(c).map(l=>({provider:o,prefix:a,name:l})),Ai)}}}function Pi(e){const t=ye(e);t?ie(t):ie({node:e,temporary:!0},!0)}function co(e,t,n=!1){const r=be(e);if(!r)return null;const o=ae(e),s=Qn(qe,t||{}),a=io(document.createElement("span"),{name:e,icon:o,customisations:s},r);return n?a.outerHTML:a}function Ri(){return"3.1.1"}function Mi(e,t){return co(e,t,!1)}function Oi(e,t){return co(e,t,!0)}function Ni(e,t){const n=be(e);if(!n)return null;const r=Qn(qe,t||{});return Ve(n,r)}function Ui(e){e?Pi(e):ie()}if(typeof document<"u"&&typeof window<"u"){ai();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!Pn(r))&&console.error(n)}catch{console.error(n)}})}setTimeout(()=>{fi(ie),ie()})}function Bi(e,t){Vn(e,t!==!1)}function zi(e){Vn(e,!0)}Hn("",qs);if(typeof document<"u"&&typeof window<"u"){Fn();const e=window;if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(const n in t){const r="IconifyProviders["+n+"] is invalid.";try{const o=t[n];if(typeof o!="object"||!o||o.resources===void 0)continue;Wn(n,o)||console.error(r)}catch{console.error(r)}}}}const $i={getAPIConfig:We,setAPIModule:Hn,sendAPIQuery:Gn,setFetch:Bs,getFetch:zs,listAPIProviders:Ns},Fi={_api:$i,addAPIProvider:Wn,loadIcons:_t,loadIcon:ii,iconExists:Es,getIcon:_s,listIcons:Cs,addIcon:Is,addCollection:Pn,replaceIDs:On,calculateSize:lt,buildIcon:Ve,getVersion:Ri,renderSVG:Mi,renderHTML:Oi,renderIcon:Ni,scan:Ui,observe:eo,stopObserving:to,pauseObserver:pi,resumeObserver:mi,enableCache:Bi,disableCache:zi};try{self.Iconify===void 0&&(self.Iconify=Fi)}catch{}function lo({children:e,style:t={},...n}){return i.jsx(_o,{style:t,...n,children:e})}lo.propTypes={children:y.any.isRequired,style:y.object};const P={yellow:"#FFCF71",grey:"#aaaaaa",reverse:"#444",running:"#34BE74",error:"#D0021B",primary:"#1DC1C7"},Ae={added:P.grey,waiting:P.yellow,downloading:P.yellow,extracting:P.yellow,downloaded:P.grey,installing:P.yellow,installed:P.grey,starting:P.yellow,running:P.running,stopping:P.yellow,stopped:P.reverse,error:P.error,upgrading:P.yellow,restarting:P.yellow,corrupted:P.error,deleting:P.yellow,resource:P.primary},tn={added:"primary",waiting:"info",downloading:"info",extracting:"info",downloaded:"primary",installing:"info",installed:"primary",starting:"info",running:"success",stopping:"warning",stopped:"reverse",error:"error",upgrading:"info",restarting:"info",corrupted:"error",deleting:"warning",resource:"primary"};function Vi({isResource:e=!1,status:t,variant:n="tag",progress:r=0,tip:o="",...s}){const{t:a}=h.useContext(ln),c=R.isInProgress(t);let l=e&&t==="stopped"?"resource":t;tn[l]||(l="installed");const u=a(`blocklet.status.${l}`);return n==="pin"?i.jsx(pe,{title:a("blocklet.statusTip",{status:u}),children:i.jsxs(_,{...s,sx:[{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},...Array.isArray(s.sx)?s.sx:[s.sx]],children:[i.jsx(_,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Ae[l]}}),i.jsx(_,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Ae[l]}})]})}):n==="dot"?i.jsx(pe,{title:a("blocklet.statusTip",{status:u}),children:i.jsx(Gr,{color:Ae[l],...s})}):i.jsxs(lo,{type:tn[l],...s,children:[c&&i.jsx(H,{size:12,color:"inherit",style:{marginRight:5}}),u,o&&i.jsx("span",{style:{marginLeft:5},children:o}),l==="downloading"&&r?i.jsx("div",{style:{marginLeft:5},children:`${r} %`}):null]})}Vi.propTypes={status:y.string.isRequired,variant:y.oneOf(["dot","tag","pin"]),source:y.string,progress:y.number,isResource:y.bool,tip:y.string};function uo({infos:e=[]}){const{t}=B(),n=new URL("https://community.arcblock.io/discussions/add");e.forEach(o=>{n.searchParams.set(o.label,o.value)});const r=e.map(o=>`* ${o.label}: ${o.value}`).join(`
|
|
43
|
-
`);return n.searchParams.set("report","server"),n.searchParams.set("context",`[Enter feedback here]
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
<!--
|
|
48
|
-
[Server Info]
|
|
49
|
-
${r}
|
|
50
|
-
* Page: ${window.location.href}
|
|
51
|
-
-->
|
|
52
|
-
`),T(_,{sx:{mx:{xs:0,md:2}},children:T(Le,{sx:{color:"text.primary"},target:"_blank",href:n.href,rel:"noreferrer",style:{textDecoration:"underline"},children:t("common.reportIssue")})})}uo.propTypes={infos:y.arrayOf(y.shape({label:y.string,value:y.string}))};var et,nn;function Hi(){return nn||(nn=1,et={year:{long:"year",short:"y"},day:{long:"day",short:"d"},hour:{long:"hour",short:"h"},minute:{long:"minute",short:"m"},second:{long:"second",short:"s"},millisecond:{long:"millisecond",short:"ms"},microsecond:{long:"microsecond",short:"µs"},nanosecond:{long:"nanosecond",short:"ns"}}),et}var tt,on;function Wi(){return on||(on=1,tt={year:{long:"年",short:"年"},day:{long:"天",short:"天"},hour:{long:"小时",short:"小时"},minute:{long:"分钟",short:"分"},second:{long:"秒钟",short:"秒"},millisecond:{long:"毫秒",short:"毫秒"},microsecond:{long:"微秒",short:"微秒"},nanosecond:{long:"纳秒",short:"纳秒"}}),tt}var nt,rn;function fo(){if(rn)return nt;rn=1;const e=new Map;return nt={registerLang:(r,o)=>{e.set(r,o)},getLang:(r="en_US")=>e.get(r)||e.get("en_US")},nt}var ot,sn;function qi(){return sn||(sn=1,ot=e=>{if(typeof e!="number")throw new TypeError("Expected a number");const t=e>0?Math.floor:Math.ceil;return{days:t(e/864e5),hours:t(e/36e5)%24,minutes:t(e/6e4)%60,seconds:t(e/1e3)%60,milliseconds:t(e)%1e3,microseconds:t(e*1e3)%1e3,nanoseconds:t(e*1e6)%1e3}}),ot}var rt,an;function Ki(){if(an)return rt;an=1;const e=qi(),{getLang:t}=fo(),n=(o,s)=>s===1?o:`${o}s`,r=1e-7;return rt=(o,s={})=>{if(!Number.isFinite(o))throw new TypeError("Expected a finite number");s.colonNotation&&(s.compact=!1,s.formatSubMilliseconds=!1,s.separateMilliseconds=!1,s.verbose=!1),s.compact&&(s.secondsDecimalDigits=0,s.millisecondsDecimalDigits=0);const a=t(s.locale),c=[],l=(p,f)=>{const g=Math.floor(p*10**f+r);return(Math.round(g)/10**f).toFixed(f)},u=(p,f,g)=>{if((c.length===0||!s.colonNotation)&&p===0&&!(s.colonNotation&&f==="minute"))return;const{long:b}=a[f]||t("en_US")[f],{short:x}=a[f]||t("en_US")[f];let j=(g||p||"0").toString(),v,k;if(s.colonNotation){v=c.length>0?":":"",k="";const w=j.includes(".")?j.split(".")[0].length:j.length,I=c.length>0?2:1;j="0".repeat(Math.max(0,I-w))+j}else v="",s.locale==="zh_CN"?Object.values(d).filter(w=>w>0).length>1?!d.days&&!d.hours&&d.minutes&&s.compact?k=b:k=x:d.minutes?k=b:k=x:k=s.verbose?` ${n(b,p)}`:x;c.push(v+j+k)},d=e(o);if(u(Math.trunc(d.days/365),"year"),u(d.days%365,"day"),u(d.hours,"hour"),u(d.minutes,"minute"),s.separateMilliseconds||s.formatSubMilliseconds||!s.colonNotation&&o<1e3)if(u(d.seconds,"second"),s.formatSubMilliseconds)u(d.milliseconds,"millisecond"),u(d.microseconds,"microsecond"),u(d.nanoseconds,"nanosecond");else{const p=d.milliseconds+d.microseconds/1e3+d.nanoseconds/1e6,f=typeof s.millisecondsDecimalDigits=="number"?s.millisecondsDecimalDigits:0,g=p>=1?Math.round(p):Math.ceil(p),b=f?p.toFixed(f):g;u(Number.parseFloat(b,10),"millisecond",b)}else{const p=o/1e3%60,f=typeof s.secondsDecimalDigits=="number"?s.secondsDecimalDigits:1,g=l(p,f),b=s.keepDecimalsOnWholeSeconds?g:g.replace(/\.0+$/,"");u(Number.parseFloat(b,10),"second",b)}if(c.length===0){const p=(a.millisecond||t("en_US").millisecond).long,f=(a.millisecond||t("en_US").millisecond).short;return s.locale==="zh_CN"?`0${s.verbose?`${p}`:f}`:`0${s.verbose?` ${p}s`:f}`}if(s.compact)return c[0];if(typeof s.unitCount=="number"){const p=s.colonNotation?"":" ";return c.slice(0,Math.max(s.unitCount,1)).join(p)}return s.colonNotation?c.join(""):c.join(" ")},rt}var st,cn;function Gi(){if(cn)return st;cn=1;const e=Hi(),t=Wi(),{registerLang:n}=fo(),r=Ki();return n("en_US",e),n("zh_CN",t),r.registerLang=n,st=r,st}var Qi=Gi();const po=nr(Qi);function Z({children:e}){return oe(n=>n.breakpoints.down("md"))?i.jsx(pe,{enterDelay:500,leaveDelay:2e3,title:typeof e=="string"?e:"",children:i.jsx(_,{sx:{display:"flex",alignItems:"center",gap:1},children:i.jsx(Ot,{fontSize:"small"})})}):i.jsxs(_,{sx:{display:"flex",alignItems:"center",gap:1},children:[i.jsx(Ot,{fontSize:"small"}),e]})}Z.propTypes={children:y.node.isRequired};const Zi="https://launcher.arcblock.io/",Xi=30*24*60*60*1e3;function mo({launcherUrl:e,chainHost:t,nftId:n="",launcherSessionId:r="",retention:o=0,sx:s={},...a}){const{t:c,locale:l}=B(),u=Fe(),[d,p]=In({safeIframeRef:null,popoverAnchorEl:null}),f=h.useRef(null),g=he(),b=oe(m=>m.breakpoints.down("md")),x=b?"mobile":"desktop",j=kn(async()=>{const[m,E]=await Promise.all([u.api.getLauncherSession({input:{launcherSessionId:r,launcherUrl:e}}),yn({launcherUrl:e||Zi,nftDid:n,launcherSessionId:r,locale:l,theme:g.palette.mode})]);if(m?.error)throw new Error(m.error);return{launcherSession:m.launcherSession,subscriptionURL:E}},[l]);if(j.loading)return i.jsx(ee,{label:i.jsxs(Z,{children:[!b&&c("expiration.desktop.loading"),i.jsx(H,{size:16})]}),variant:"success",sx:{cursor:"pointer",...s},...a,retention:o});if(j.error)return console.error(j.error),i.jsx(ee,{label:i.jsx(Z,{children:c(`expiration.${x}.loadFailed`)}),color:"error",variant:"success",sx:{cursor:"pointer",...s},...a,retention:o,onClick:()=>j.retry()});const v=m=>{p({popoverAnchorEl:m.currentTarget})},k=()=>{p({popoverAnchorEl:null})},w=j.value?.launcherSession;let I="success";[A.LAUNCH_SESSION_STATUS.overdue,A.LAUNCH_SESSION_STATUS.canceled,A.LAUNCH_SESSION_STATUS.terminated].includes(j.value?.launcherSession?.status)&&(I="error");let C=null;if(w.expirationDate&&!w.subscription){const m=se(w.expirationDate).diff(se(),"ms");C=c(`expiration.${x}.tips.${I}`,{validity:po(m,{locale:vn(l),compact:!0,verbose:!0})}),m>0&&m<=Xi&&(I="warning")}return i.jsxs(i.Fragment,{children:[i.jsx(ee,{label:i.jsx(Z,{children:C||w?.subscription?.product?.name||c("common.subscription")}),color:I,variant:I!=="success"?"contained":"outlined",sx:{cursor:"pointer",...s},...a,retention:o,onClick:v}),i.jsx(hn,{id:"popover-info",open:!!d.popoverAnchorEl,anchorEl:d.popoverAnchorEl,onClose:k,anchorOrigin:{vertical:"bottom",horizontal:"right"},sx:{"& .MuiPopover-paper":{minHeight:0}},transformOrigin:{vertical:"top",horizontal:"right"},children:i.jsx(_,{sx:{width:{xs:"360px",md:"450px"},display:"flex",flexDirection:"column"},children:i.jsx("iframe",{ref:f,title:c("common.subscription"),width:"100%",height:"600px",style:{border:0,maxHeight:"800px"},src:j.value?.subscriptionURL})})})]})}mo.propTypes={chainHost:y.string.isRequired,nftId:y.string,launcherSessionId:y.string,sx:y.object,retention:y.number,launcherUrl:y.string.isRequired};const Ji=30*24*60*60*1e3,Yi="https://launcher.arcblock.io/";function ho({launcherUrl:e,chainHost:t,nftId:n="",launcherSessionId:r="",sx:o={},retention:s=0,...a}){const{t:c,locale:l}=B(),[u,d]=In({safeIframeRef:null,popoverAnchorEl:null}),p=h.useRef(null),f=oe(m=>m.breakpoints.down("md")),g=Fe(),b=f?"mobile":"desktop",x=kn(async()=>{const[m,E]=await Promise.all([g.api.getLauncherSession({input:{launcherSessionId:r||n,launcherUrl:e}}),yn({launcherUrl:e||Yi,nftDid:n,launcherSessionId:r,locale:l})]);if(m?.error)throw new Error(m.error);return{launcherSession:m.launcherSession,subscriptionURL:E}},[l]);if(x.loading)return i.jsx(ee,{label:i.jsxs(Z,{children:[!f&&c("expiration.desktop.loading"),i.jsx(H,{size:16})]}),variant:"success",sx:{cursor:"pointer",...o},...a,retention:s});if(x.error)return console.error(x.error),i.jsx(ee,{label:i.jsx(Z,{children:c(`expiration.${b}.loadFailed`)}),color:"error",variant:"success",sx:{cursor:"pointer",...o},...a,retention:s,onClick:()=>x.retry()});const j=x.value?.launcherSession?.expirationDate,v=se(j).isBefore(se()),k=se(j).diff(se(),"ms");let w="success";k<=Ji&&(w="warning"),v&&(w="error");const I=m=>{d({popoverAnchorEl:m.currentTarget})},C=()=>{d({popoverAnchorEl:null})};return i.jsxs(i.Fragment,{children:[x.value?.launcherSession?.subscription&&i.jsx(ee,{label:i.jsx(Z,{children:c("expiration.desktop.nextInvoice",{date:ur(j,l)})}),color:"success",variant:"outlined",sx:{cursor:"pointer",...o},...a,retention:s,onClick:I}),!x.value?.launcherSession?.subscription&&i.jsx(ee,{label:i.jsx(Z,{children:c(`expiration.${b}.tips.${w}`,{validity:po(k,{locale:vn(l),compact:!0,verbose:!0})})}),color:w,variant:w!=="success"?"contained":"outlined",sx:{cursor:"pointer",...o},...a,retention:s,onClick:I}),i.jsx(hn,{id:"popover-info",open:!!u.popoverAnchorEl,anchorEl:u.popoverAnchorEl,onClose:C,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:i.jsx(_,{sx:{width:{xs:"360px",md:"450px"}},children:i.jsx("iframe",{ref:p,title:c("common.subscription"),width:"100%",height:"600px",style:{border:0},src:x.value?.subscriptionURL})})})]})}ho.propTypes={chainHost:y.string.isRequired,nftId:y.string,launcherSessionId:y.string,sx:y.object,retention:y.number,launcherUrl:y.string.isRequired};function go({meta:e={},fallbackUrl:t=Qe,invalidPathFallback:n=null,headerAddons:r=void 0,sessionManagerProps:o={showRole:!0,onLogout:()=>{window.location.href=Qe}},links:s=[],showDomainWarningDialog:a=!0,...c}){dr();const l=h.use(fr)?.session?.user,u=l?.role,{locale:d,defaultLocale:p}=B()||{},f=h.useMemo(()=>{const w=Object.assign({},window.blocklet,e);try{return pr(w)}catch(I){return console.error("Failed to format blocklet info",I,w),w}},[e]),{localizedNav:g,flattened:b,matchedIndex:x}=h.useMemo(()=>{let w=mr({navigation:f?.navigation?.dashboard,locale:d,defaultLocale:p})||[];w=hr(w,u),w=gr(w,m=>{let E=null;return m.icon&&(m.icon.startsWith("http")||m.icon.startsWith("data:")?E=i.jsx(dn,{src:m.icon}):E=i.jsx("iconify-icon",{height:"100%",width:"100%",icon:m.icon})),{id:m.id,title:m.title,url:m.link,icon:E,external:!0,children:m.items}},"items");const I=xr(w).filter(m=>!!m.url),C=br(I.map(m=>m.url));return C!==-1&&(I[C].active=!0),{localizedNav:w,flattened:I,matchedIndex:C}},[f,d,p,u]),j=typeof s=="function"?s(g):[...g,...s],v=yr({meta:e});if(h.useLayoutEffect(()=>{l&&!b?.length&&t&&(window.location.href=t)},[t]),h.useLayoutEffect(()=>{l&&b?.length&&x===-1&&n&&n()},[n,b,x]),!f.appName)return null;const{appName:k}=f;return i.jsx(Qr,{title:k,fullWidth:!0,sidebarWidth:128,legacy:!1,links:j,...c,headerProps:{homeLink:Qe,logo:i.jsx("img",{src:v,alt:"logo"}),addons:i.jsx(vr,{formattedBlocklet:f,addons:r,sessionManagerProps:o,showDomainWarningDialog:a}),...c.headerProps}})}go.propTypes={meta:Sr,fallbackUrl:y.string,invalidPathFallback:y.func,headerAddons:y.oneOfType([y.func,y.node]),sessionManagerProps:wr,links:y.oneOfType([y.array,y.func]),showDomainWarningDialog:y.bool};const ea={width:24,height:24,body:'<path fill="currentColor" d="M6.4 18L5 16.6L14.6 7H6V5h12v12h-2V8.4L6.4 18Z"/>'},ta="/.well-known/service/onboard/bind-account";function xo({onFinished:e=()=>{},show:t=!1,onChangeVisible:n=()=>{},loadingText:r="",defaultPath:o=ta,...s}){const[a,c]=h.useState(t),[l,u]=h.useState(!1),[d,p]=h.useState(()=>{const w=localStorage.getItem("wizard-current-url");return w?.includes("/.well-known/service/onboard")?w:o}),f=h.useRef(e),g=h.useRef(),b=h.useRef(null),{locale:x}=B(),j=he(),v=oe(j.breakpoints.down("sm"));if(f.current=e,g.current=()=>{if(b.current?.contentWindow)try{const w=new URL(b.current.contentWindow.location.href).pathname;localStorage.setItem("wizard-current-url",w),p(w)}catch(w){p(o),console.warn("Failed to save wizard URL:",w)}localStorage.setItem("wizard-completed","true"),c(!1),n(!1)},h.useEffect(()=>{t!==a&&c(t)},[t]),h.useEffect(()=>{!a&&l&&u(!1)},[a]),h.useEffect(()=>{const w=I=>{if(I.origin!==window.location.origin)return;const{type:C,data:m}=I.data||{};switch(C){case"wizard.loaded":u(!0);break;case"wizard.finished":{c(!1),p(o),localStorage.removeItem("wizard-current-url"),localStorage.setItem("wizard-completed","true"),f.current?.(m);break}case"wizard.close":{g.current();break}}};return window.addEventListener("message",w),()=>{window.removeEventListener("message",w)}},[]),h.useEffect(()=>{localStorage.getItem("wizard-completed")||c(!0)},[]),!a)return null;const k=jn(X(window.location.origin,d),{locale:x});return i.jsxs(gn,{id:"wizard-dialog",open:a,onClose:()=>g.current(),fullWidth:!0,maxWidth:v?!1:"md",fullScreen:v,...s,slotProps:Ur({},{paper:{sx:{margin:0,borderRadius:0,position:"relative",overflow:"hidden",...v?{borderRadius:0}:{borderRadius:1,height:"720px"}}}},s.slotProps),sx:{"& .MuiBackdrop-root":{backgroundColor:"rgba(0, 0, 0, 0.5)"},...s.sx},children:[i.jsx("iframe",{ref:b,id:"wizard-iframe",src:k,title:"Setup Wizard",style:{width:"100%",height:"100%",border:0,padding:0,margin:0,opacity:l?1:0,transition:"opacity 0.3s ease-in-out"},onLoad:()=>u(!0)}),l?null:i.jsx(_,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",justifyContent:"center",alignItems:"center",bgcolor:"background.paper"},children:i.jsxs(_,{sx:{display:"flex",alignItems:"center",flexDirection:"column",gap:1},children:[i.jsx(H,{}),typeof r=="string"?i.jsx(Q,{variant:"body1",children:r}):r]})})]})}xo.propTypes={onFinished:y.func,show:y.bool,onChangeVisible:y.func,loadingText:y.node,defaultPath:y.string,...gn.propTypes};const na={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 21L21 6l-3-3L3 18l3 3m9-15l3 3M9 3a2 2 0 0 0 2 2a2 2 0 0 0-2 2a2 2 0 0 0-2-2a2 2 0 0 0 2-2m10 10a2 2 0 0 0 2 2a2 2 0 0 0-2 2a2 2 0 0 0-2-2a2 2 0 0 0 2-2"/>'};function oa(){const{session:e}=wn(),[t,n]=h.useState(!1),[r,o]=h.useState(!1),{t:s}=B(),a=h.useMemo(()=>!!localStorage.getItem("wizard-finished"),[]);return h.useMemo(()=>e.user?.role&&Sn.includes(e.user.role),[e])?i.jsxs(i.Fragment,{children:[i.jsx(pe,{title:s("setup.wizardTooltip"),open:t,placement:"bottom",arrow:!0,children:i.jsx(Ue,{size:"small",onClick:()=>{o(!0),n(!1)},sx:{display:{xs:"none",md:"flex"},color:"text.secondary",...t&&{backgroundColor:"action.hover","@keyframes pulse":{"0%":{opacity:.8},"50%":{opacity:.5},"100%":{opacity:.8}},animation:"pulse 2s infinite"}},children:i.jsx(vt,{icon:na,height:20})})},`wizard-toggle-${t}`),i.jsx(xo,{show:r,loadingText:i.jsxs(_,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:1,mt:2,maxWidth:"80vw"},children:[i.jsx(Pt,{variant:"h4",sx:{fontWeight:"bold"},children:s("setup.wizardLoading")}),!a&&i.jsx(Pt,{variant:"body2",sx:{textAlign:"center"},children:s("setup.wizardSubTitle")})]}),slotProps:{paper:{sx:{height:{xs:"100vh",md:"750px"}}}},onChangeVisible:l=>{o(l),!l&&r&&n(!0)},onClose:void 0,onFinished:()=>{o(!1),n(!1)}},"wizard-modal")]}):null}function ra(){const{inFullPage:e,toggleFullPage:t}=Zr();return T(Ue,{onClick:t,children:e?T(Yo,{sx:{transform:"scale(1.3)"}}):T(er,{sx:{transform:"scale(1.3)"}})})}function bo({children:e=null,title:t=""}){const{t:n}=B(),{loading:r,error:o,actions:{refreshBlocklet:s},env:a,blocklet:c}=ge(),{info:l,imgPrefix:u}=jr(),d=or(),p=oe(I=>I.breakpoints.down("md")),f=he(),{appId:g,version:b}=a,x=[{label:"App ID",value:g},{label:"App Version",value:b},{label:"App Bundle Name",value:c?.meta?.bundleName},{label:"Server Id",value:l.did},{label:"Server Version",value:l.version}],j=I=>{const C=Array.isArray(I)?I:[I];if(C.unshift(T(oa,{})),p||C.unshift(T(ra,{})),c){const m={cursor:"pointer",marginRight:{xs:"8px",md:"48px"}};kr(c)?C.unshift(T(mo,{chainHost:c?.controller?.chainHost,nftId:c?.controller?.nftId,launcherSessionId:c?.controller?.launcherSessionId,launcherUrl:c?.controller?.launcherUrl,sx:m})):l.ownerNft&&l.launcher&&C.unshift(T(ho,{chainHost:l.launcher.chainHost,launcherUrl:l.launcher.url,nftId:l.ownerNft.did,launcherSessionId:l.ownerNft.launcherSessionId,sx:m}))}return C},v=Wr({blocklet:c}),k={logo:v?T("img",{src:v,alt:"logo"}):null,brandAddon:T(_,{children:c&&Ie(_,{component:"a",target:"_blank",href:window.blocklet.appUrl,rel:"noopener noreferrer",title:window.blocklet.appName,sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,py:.5,px:2,border:"1px solid",borderColor:"text.disabled",borderRadius:"30px",cursor:"pointer"},children:[T(pe,{title:R.isRunning(c?.status)?void 0:n(`blocklet.status.${c?.status}`),children:T(_,{sx:{bgcolor:Ae[c?.status],width:8,height:8,borderRadius:"50%"}})}),T(_,{sx:{color:"text.secondary",maxWidth:p?66:240,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:R.getDisplayName(c)}),T(_,{component:vt,icon:ea,sx:{color:"text.secondary"}})]})})};return Ie(sa,{legacy:!1,fullWidth:!0,headerAddons:j,headerProps:k,links:I=>I?.map(m=>(m.children=m.children?.map(E=>{if(E.id==="/team/aigne"){const O=u?X(u,"/aigne-hub.png"):"/aigne-hub.pg";return{...E,icon:T(dn,{src:O,alt:"AIGNE Hub",style:f.palette.mode==="dark"?{filter:"invert(1)"}:{},fallback:E.icon})}}return E}),m)),title:t,footerProps:{addon:T(uo,{infos:x})},children:[!c&&r&&T(Pe,{relative:"parent",children:T(H,{})}),!c&&o&&Ie(Pe,{relative:"parent",children:[Ie(_,{sx:{display:"flex",alignItems:"center"},children:[T(Jo,{color:"error",sx:{marginRight:1}}),St(o)]}),T(wt,{onClick:()=>s(),children:T("span",{style:{textDecoration:"underline"},children:n("common.retry")})})]}),!!c&&T(_,{sx:{flex:1,padding:p?2:3,display:"flex",flexDirection:"column"},children:T(Lo,{FallbackComponent:Cr,resetKeys:[d.pathname],children:e})})]})}bo.propTypes={children:y.any,title:y.string};const sa=ze(go)`
|
|
53
|
-
div.dashboard-content {
|
|
54
|
-
padding: 0;
|
|
55
|
-
}
|
|
56
|
-
.header-addons .locales {
|
|
57
|
-
max-height: 400px;
|
|
58
|
-
overflow-y: auto;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.header-brand-addon {
|
|
62
|
-
display: block;
|
|
63
|
-
}
|
|
64
|
-
`;function ia(){const{t:e,locale:t}=B(),{blocklet:n,launcherSession:r,refreshSubscription:o}=ge(),{connectApi:s,session:a,api:c}=wn(),[l,u]=h.useState(!1),[d,p]=h.useState(""),[f,g]=$r({subscriptionURL:"#"});if(h.useEffect(()=>{(Ut(n,r)||Bt(r))&&Ir({launcherSessionId:n?.controller?.launcherSessionId,launcherUrl:n?.controller?.launcherUrl,locale:t}).then(v=>{g({subscriptionURL:v})}).catch(v=>{console.error("get subscription url error:",v)})},[n,r]),h.useEffect(()=>{if(n.controller?.launcherUrl){const v=X(n.controller.launcherUrl,"__blocklet__.js?type=json");fetch(v).then(k=>k.json()).then(k=>{const w=k.componentMountPoints?.find(C=>C.did==="z2qaCNvKMv5GjouKdcDWexv6WqtHbpNPQDnAk")?.mountPoint,I=X(n.controller.launcherUrl,w);p(I)})}},[n.controller?.launcherUrl]),!n||!r)return"";let b=null,x="",j="error";return Er(r)?(b=_r(r)?i.jsx(Le,{href:f.subscriptionURL,children:e("blocklet.manageSubscription")}):i.jsx(at,{variant:"text",color:"error",onClick:()=>u(!0),sx:{lineHeight:"inherit",fontSize:"inherit"},children:e("blocklet.payNow")}),x=e("blocklet.suspendedCausedByPastDue",{deadline:ce(r?.reservedUntil,t)})):Bt(r)?(b=i.jsx(Le,{href:f.subscriptionURL,children:e("blocklet.manageSubscription")}),x=e("blocklet.willBeSuspendedSoon",{deadline:ce((r?.subscription?.cancel_at||0)*1e3,t)}),j="warning"):Ut(n,r)?(b=i.jsx(Le,{href:f.subscriptionURL,children:e("blocklet.manageSubscription")}),x=e("blocklet.suspendedCausedByExpired",{deadline:ce(r?.reservedUntil,t),canceledAt:ce((r?.subscription?.canceled_at||0)*1e3,t)})):Lr(n,r)&&(b=i.jsx(xn,{to:X(A.WELLKNOWN_BLOCKLET_ADMIN_PATH,"/did-spaces"),children:e("common.backup")}),x=e("blocklet.suspendedCausedByTerminated",{canceledAt:ce(r?.terminatedAt,t),deadline:Tr(r?.terminatedAt,t)})),x?i.jsxs(i.Fragment,{children:[i.jsxs(Be,{severity:j,sx:{mb:1},children:[x,i.jsx(Q,{sx:{display:"inline-block",fontSize:"inherit",lineHeight:"inherit",ml:1,a:{textDecoration:"auto"},"& .MuiButtonBase-root":{p:0,minWidth:"auto"}},children:b})]}),l&&d&&r&&i.jsx(Dr,{session:a,connect:s,baseUrl:d,authToken:r.subscription.authToken,children:i.jsx(Xr,{dialogProps:{open:l,onClose:()=>u(!1)},subscriptionId:r.subscription.id,successToast:!0,onPaid:()=>{c.post("/blocklet/start?fromSetup=1"),o(),u(!1)}})})]}):null}function yt({sx:e={}}){const t=oe(n=>n.breakpoints.down("md"));return i.jsx(_,{sx:{mx:t?-2:-3,borderBottom:"1px solid",borderColor:"divider",mt:1.5,mb:1,...e}})}yt.propTypes={sx:y.object};function yo({name:e="",description:t=void 0,actions:n=void 0,tabs:r=[],currentTab:o="",onTabChange:s=()=>{}}){return i.jsxs(_,{sx:{mb:3},children:[i.jsxs(_,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:1},children:[i.jsx(Q,{variant:"h2",children:e}),n&&i.jsx(_,{children:n})]}),t&&i.jsx(Q,{variant:"body2",color:"text.secondary",sx:{lineHeight:1.6,"& a":{color:"primary.main"},maxWidth:980},children:t}),r.length<=1&&i.jsx(yt,{}),r.length>1&&i.jsxs(i.Fragment,{children:[i.jsx(To,{tabs:r,current:o,onChange:s,scrollButtons:"auto",sx:{mt:.5}}),i.jsx(yt,{sx:{mt:0}})]})]})}yo.propTypes={name:y.string.isRequired,description:y.node,actions:y.node,tabs:y.array,currentTab:y.string,onTabChange:y.func};const aa=h.lazy(()=>L(()=>import("./log-BL7saUR-.js"),__vite__mapDeps([0,1]),import.meta.url)),ca=h.lazy(()=>L(()=>import("./index-B6tDB9NM.js"),__vite__mapDeps([0,1]),import.meta.url)),la=h.lazy(()=>L(()=>import("./index-C9dtkWmq.js"),__vite__mapDeps([0,1]),import.meta.url)),ua=h.lazy(()=>L(()=>import("./index-C6xsUkOM.js"),__vite__mapDeps([0,1,2]),import.meta.url)),da=h.lazy(()=>L(()=>import("./overview-C_lm4_df.js"),__vite__mapDeps([0,1]),import.meta.url)),fa=h.lazy(()=>L(()=>import("./domains-xkwgfn_I.js"),__vite__mapDeps([0,1]),import.meta.url)),pa=h.lazy(()=>L(()=>import("./index-Dq0Srq3h.js"),__vite__mapDeps([0,1]),import.meta.url)),ma=h.lazy(()=>L(()=>import("./appearance-BJ1pZ5mv.js"),__vite__mapDeps([0,1]),import.meta.url)),ha=h.lazy(()=>L(()=>import("./audit-logs-Cv97rr17.js"),__vite__mapDeps([0,1,2]),import.meta.url)),ga=h.lazy(()=>L(()=>import("./index-DhsOorTb.js"),__vite__mapDeps([0,1]),import.meta.url)),xa=h.lazy(()=>L(()=>import("./config-navigation-IlBVGJJp.js"),__vite__mapDeps([0,1]),import.meta.url)),ba=h.lazy(()=>L(()=>import("./index-eMvzC3RF.js"),__vite__mapDeps([0,1]),import.meta.url)),ya=h.lazy(()=>L(()=>import("./index-BvTGUpv5.js"),__vite__mapDeps([0,1]),import.meta.url)),va=h.lazy(()=>L(()=>import("./security-BB8LkO1d.js"),__vite__mapDeps([0,1]),import.meta.url)),wa=h.lazy(()=>L(()=>import("./branding-Dw7bAXb5.js"),__vite__mapDeps([0,1]),import.meta.url)),Sa=h.lazy(()=>L(()=>import("./advanced-BTz3ZBM_.js"),__vite__mapDeps([0,1]),import.meta.url)),ja=h.lazy(()=>L(()=>import("./traffic-BbiwlHWj.js").then(e=>e.t),__vite__mapDeps([0,1]),import.meta.url)),Ca=h.lazy(()=>L(()=>import("./runtime-DJ07buOB.js"),__vite__mapDeps([0,1]),import.meta.url)),ka=h.lazy(()=>L(()=>import("./index-vB1fWp5c.js"),__vite__mapDeps([0,1]),import.meta.url)),Ia=h.lazy(()=>L(()=>import("./list-Dxgf_FJ5.js"),__vite__mapDeps([0,1]),import.meta.url)),Ea=h.lazy(()=>L(()=>import("./index-CbziauTS.js"),__vite__mapDeps([0,1]),import.meta.url)),_a=h.lazy(()=>L(()=>import("./config-CmTXD9uy.js").then(e=>e.c),__vite__mapDeps([0,1]),import.meta.url)),La=h.lazy(()=>L(()=>import("./index-B-FsPHvJ.js").then(e=>e.i),__vite__mapDeps([0,1]),import.meta.url)),Ta=h.lazy(()=>L(()=>import("./component-BxDPcxLA.js"),__vite__mapDeps([0,1,2,3]),import.meta.url)),Da=h.lazy(()=>L(()=>import("./index-PD6zy1bY.js"),__vite__mapDeps([0,1]),import.meta.url)),Aa=X(A.WELLKNOWN_SERVICE_PATH_PREFIX,"user","notifications"),it=(e,t,n="en")=>{const r=e?.[t];return zr(r)?r[n]||r.en:r},Pa=e=>{const{enqueueSnackbar:t}=un(),n=h.useCallback(r=>jn(Aa,{id:r.id,severity:r.severity||"all",componentDid:r.source==="system"?"system":r.componentDid||"all"}),[]);Rr(`${e}/${A.EVENTS.NOTIFICATION_BLOCKLET_CREATE}`,r=>{const o=n(r),{severity:s,description:a}=r||{},c=["error","warning"].includes(s)||r.sticky;r.source==="system"&&t(a,{variant:s,autoHideDuration:c?null:5e3,anchorOrigin:{vertical:"top",horizontal:"center"},content:l=>i.jsx(ms,{viewAllUrl:o,keyId:l,notification:r,content:i.jsx(Kr,{notification:r,minimal:!0,rows:0})})})},[],"user")};function vo({blocklet:e,isAdmin:t}){return t?i.jsx(ga,{blocklet:e}):i.jsx(Or,{status:403})}vo.propTypes={blocklet:y.object.isRequired,isAdmin:y.bool.isRequired};const Ra=e=>{const{t}=B(),{blocklet:n,actions:{refreshBlocklet:r},client:o,did:s}=ge(),a=$(()=>Br(n,"settings.org.enabled",!1),[n]),c=n?.meta?.did,l=!n||Mr(n.status)?[]:R.getAppMissingConfigs(n);return{appConfigs:$(()=>({overview:{description:t("navigation.serviceApp.overview.description"),actions:n?i.jsx(os,{className:"page-actions",hasPermission:!0,blocklet:n,onStart:()=>{},onComplete:({error:d}={})=>{d&&G.error(d.message)},variant:"group"}):null,tabs:[{label:t("common.overview"),value:"overview",render:da},{label:i.jsx(tr,{"data-cy":"blocklet-list",color:"error",variant:"dot",invisible:!l.length,children:t("common.components")}),labelText:t("common.components"),value:"components",render:Ta}]},"did-connect":{description:t("navigation.serviceApp.didConnect.description"),tabs:[{label:t("common.members"),value:"members",render:i.jsx(ca,{type:"blocklet",createPassportSvg:Ft})},a&&{label:t("common.orgs"),value:"orgs",render:i.jsx(La,{editable:!1,mode:"dashboard",layout:"table"})},{label:t("team.member.passports"),value:"passports",render:i.jsx(pa,{createPassportSvg:Ft})},{label:t("common.setting"),value:"settings",render:i.jsx(ya,{orientation:"vertical"})},{label:t("common.security"),value:"security",render:i.jsx(va,{})},{label:t("oauth.client.tab"),value:"oauth",render:i.jsx(Ia,{})}].filter(Boolean)},aigne:{description:i.jsx(_,{dangerouslySetInnerHTML:{__html:t("navigation.serviceApp.aigne.description",{url:"https://store.blocklet.dev/blocklets/z8ia3xzq2tMq8CRHfaXj1BTYJyYnEcHbqP8cJ"})}}),tabs:[{label:t("setup.aigne.config"),value:"aigne-config",render:i.jsx(_,{sx:{maxWidth:1536},children:i.jsx(_a,{})})}]},website:{description:t("navigation.serviceApp.website.description"),tabs:[{label:t("common.domains"),value:"domains",render:fa},{label:t("common.branding"),value:"branding",render:i.jsx(wa,{blocklet:n,onUpdate:r})},{label:t("common.theming"),value:"theming",render:i.jsx(ma,{})},{label:t("common.navigation"),value:"navigation",render:xa}]},operations:{description:t("navigation.serviceApp.operations.description"),tabs:[e&&{label:t("common.notificationRecords"),value:"notifications",render:i.jsx(vo,{blocklet:n,isAdmin:e})},{label:t("common.analytics"),value:"analytics",render:i.jsx(ja,{client:o,did:s})},{label:t("common.auditLogs"),value:"audit-logs",render:i.jsx(ha,{scope:c,categories:["blocklet","team","security","certificates","gateway"]})},{label:t("common.advancedConfig"),value:"advanced",render:i.jsx(Sa,{blocklet:n,onUpdate:r})}].filter(Boolean)},integrations:{description:t("navigation.serviceApp.integrations.description"),tabs:[e&&{label:"Webhooks",value:"webhooks",render:i.jsx(la,{})},{label:t("common.accessKeys"),value:"access-keys",render:i.jsx(ka,{})},{label:t("common.mcpServers"),value:"mcp-servers",render:i.jsx(Ea,{})}].filter(Boolean)},developers:{description:t("navigation.serviceApp.developers.description"),tabs:[n?.children?.length&&n.structVersion===A.APP_STRUCT_VERSION&&{label:t("common.logs"),value:"logs",render:aa},{label:t("common.performance"),value:"performance",render:i.jsx(Ca,{client:o,did:s})},{label:t("common.docs"),value:"docs",render:Da}].filter(Boolean)},"did-spaces":{description:t("navigation.serviceApp.didSpaces.description"),tabs:[{label:t("common.backup"),value:"did-spaces",render:i.jsx(ba,{navOrientation:"horizontal"})}]},publish:{description:t("navigation.serviceApp.publish.description"),tabs:[{label:t("common.blocklets"),value:"publish",render:i.jsx(ua,{})}]}}),[e,n,t,o,s,r])}};function Ma(){const{t:e}=B(),t=bn(),{app:n="overview",tab:r}=rr(),{locale:o}=B(),{blocklet:s,refreshFlag:a}=ge(),{session:c}=Cn(),l=$(()=>c?.user?.did,[c]),u=$(()=>c.user?.role&&Sn.includes(c.user.role),[c]);Pa(l);const{appConfigs:d}=Ra(u),p=C=>{t(`${A.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/${n}/${C}`)},f=$(()=>{const C=window.blocklet?.navigation?.find(W=>W.id==="/team"&&(Array.isArray(W.section)?W.section.includes("dashboard"):W.section==="dashboard")),m=X(A.WELLKNOWN_BLOCKLET_ADMIN_PATH,n==="overview"?"":n),E=C?.items?.find(W=>(it(W,"link",o)||"").startsWith(m)),O=it(E,"title",o)||"",N=it(E,"description",o)||"",M=d[n];return{name:O,description:N,...M}},[n,s,o,d]),{tabs:g=[]}=f,b=(g||[]).find(C=>C.value===r)?.value||g?.[0]?.value||n,j=g.find(C=>C.value===b)?.render||null,v=s?i.jsxs(_n,{type:"components",children:[f.name&&i.jsx(yo,{name:f.name,description:f.description,actions:f.actions,tabs:g,currentTab:b,onTabChange:p}),i.jsx(_,{className:"page-content",children:i.jsx(h.Suspense,{fallback:i.jsx(Pe,{relative:"parent",children:i.jsx(H,{})}),children:h.isValidElement(j)?j:i.jsx(j,{blocklet:s})})})]}):i.jsx(Pe,{relative:"parent",children:i.jsx(H,{})}),k=$(()=>{const C=g.find(N=>N.value===r),m=C?.labelText||C?.label||g?.[0]?.labelText||g?.[0]?.label||"",E=f.name||"";return[m,E].filter(Boolean).join(" - ")||""},[r,g,f]),w=$(()=>(s?.site?.domainAliases||[]).map(C=>C.value),[s]),I=$(()=>{if(!s)return!0;try{const C=s.configs?.find(E=>E.key==="BLOCKLET_APP_URL")?.value;if(!C||!w.length)return!0;const{host:m}=new URL(C);return w.some(E=>E===m)}catch{return!1}},[s,w]);return i.jsx(Pr,{children:i.jsx(qr,{children:i.jsx(bo,{title:k,children:i.jsxs(Na,{children:[!I&&i.jsx(Be,{severity:"warning",sx:{mb:2,py:2},action:i.jsxs(_,{sx:{display:"flex",gap:1,alignItems:"center"},children:[i.jsx(at,{size:"small",onClick:()=>{t(`${A.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/website/branding`)},children:e("invalidAppUrl.viewConfig")}),i.jsx(at,{variant:"contained",size:"small",onClick:()=>{t(`${A.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/website/domains`)},children:e("invalidAppUrl.viewDomains")})]}),children:e("invalidAppUrl.desc")}),i.jsx(is,{}),i.jsx(ia,{}),v]})},`${a}`)})})}function Oa(){const{blocklet:e}=ge(),t=e?.meta?.did;return h.useEffect(()=>{const n=Ar();return t&&n.connect(),()=>{t&&n.isConnected()&&n.disconnect()}},[t]),i.jsx(Ma,{})}const Na=ze.main`
|
|
65
|
-
.page-header {
|
|
66
|
-
display: flex;
|
|
67
|
-
justify-content: space-between;
|
|
68
|
-
align-items: center;
|
|
69
|
-
flex-wrap: wrap;
|
|
70
|
-
gap: 16px;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.page-title {
|
|
74
|
-
display: flex;
|
|
75
|
-
align-items: center;
|
|
76
|
-
|
|
77
|
-
.page-link {
|
|
78
|
-
font-size: 15px;
|
|
79
|
-
margin-top: 8px;
|
|
80
|
-
margin-left: 8px;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
@media (max-width: ${e=>e.theme.breakpoints.values.md}px) {
|
|
85
|
-
.page-header {
|
|
86
|
-
flex-direction: column;
|
|
87
|
-
align-items: flex-start;
|
|
88
|
-
.page-actions,
|
|
89
|
-
.MuiButtonGroup-root {
|
|
90
|
-
width: 100%;
|
|
91
|
-
}
|
|
92
|
-
.MuiButtonGroup-root {
|
|
93
|
-
.MuiButtonBase-root {
|
|
94
|
-
flex: 1;
|
|
95
|
-
}
|
|
96
|
-
.blocklet-action-text {
|
|
97
|
-
display: none;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.page-title {
|
|
103
|
-
margin-bottom: 15px;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
`,oc=Object.freeze(Object.defineProperty({__proto__:null,default:Oa},Symbol.toStringTag,{value:"Module"}));export{Vi as B,go as G,lo as W,Y as b,oc as d,tn as m,po as p,nc as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a5 as e}from"./index-DXScybaX.js";var a=e();export{a as e};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as o}from"./index-DXScybaX.js";const e=o();export{e as b};
|