@abtnode/webapp 1.17.8-beta-20260108-021819-e099f0ca → 1.17.8-beta-20260108-224855-28496abb
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/blocklet.js +1 -1
- package/blocklet.yml +1 -1
- package/dist/assets/{AdapterDayjs-Chnfr9fe.js → AdapterDayjs-CtD5my-S.js} +1 -1
- package/dist/assets/{Add-b-MNk7UB.js → Add-CVe35B9U.js} +1 -1
- package/dist/assets/ArrowDropDown-59b471Ns.js +1 -0
- package/dist/assets/{Autocomplete-79tADtg2.js → Autocomplete-CZdtlRmS.js} +1 -1
- package/dist/assets/{Breadcrumbs-Cqjt-kp8.js → Breadcrumbs-DOWk4s-Q.js} +1 -1
- package/dist/assets/{ButtonGroup-C_JbniJW.js → ButtonGroup-83J5hh2q.js} +1 -1
- package/dist/assets/{CSSTransition-DinXVMZy.js → CSSTransition-Dmpq-B51.js} +1 -1
- package/dist/assets/{CallMerge-CF5jo3Pw.js → CallMerge-CZNqia3S.js} +1 -1
- package/dist/assets/{CardContent-CYNmFsYJ.js → CardContent-DXDn75TD.js} +1 -1
- package/dist/assets/{ChevronLeft-Byy2_Dj8.js → ChevronLeft-B8v-crqw.js} +1 -1
- package/dist/assets/{ChevronRight-BKFXnJ7g.js → ChevronRight-DIxNh4jH.js} +1 -1
- package/dist/assets/{Clear-Chg9fOPG.js → Clear-kzRbvP4u.js} +1 -1
- package/dist/assets/{Delete-B306vkSB.js → Delete-Cw_Z_UMc.js} +1 -1
- package/dist/assets/{DeleteOutline-BjSm7PCr.js → DeleteOutline-D2i9YJBS.js} +1 -1
- package/dist/assets/{Done-Bh0vP7e6.js → Done-CmV6TZSG.js} +1 -1
- package/dist/assets/{Edit-DFmlgA7E.js → Edit-DDUKSYdb.js} +1 -1
- package/dist/assets/{EditOutlined-Qskj3-tY.js → EditOutlined-MUSbzQj_.js} +1 -1
- package/dist/assets/{ErrorOutline-CjKNiJFO.js → ErrorOutline-jxA-S5AH.js} +1 -1
- package/dist/assets/{FilterList-Dphn1UXx.js → FilterList-B8T7rkYs.js} +1 -1
- package/dist/assets/{Google-C0G3l0jL.js → Google-Bg8SlDZS.js} +1 -1
- package/dist/assets/{HelpOutline--A0maMxb.js → HelpOutline-BOrIHXkQ.js} +1 -1
- package/dist/assets/{KeyboardArrowDown-CD6n37Y9.js → KeyboardArrowDown-CE7zJDcv.js} +1 -1
- package/dist/assets/{Launch-Cor8d4pT.js → Launch-BHeCrhBj.js} +1 -1
- package/dist/assets/{Link-Mg5UlAaZ.js → Link-C39j8j-1.js} +1 -1
- package/dist/assets/{ListItemButton-C8XIzvy_.js → ListItemButton-DLzzgnWj.js} +1 -1
- package/dist/assets/{ListSubheader-CHT01bOG.js → ListSubheader-BgTycqrg.js} +1 -1
- package/dist/assets/{LoadingButton-DtnAWL1w.js → LoadingButton-OiBPqmL8.js} +1 -1
- package/dist/assets/{MoreVert-KNjOpSoE.js → MoreVert-DJQ3tC1s.js} +1 -1
- package/dist/assets/{OpenInNew-DGDd5qxt.js → OpenInNew-awII5Ys1.js} +1 -1
- package/dist/assets/{Refresh-B0_3c6OW.js → Refresh-BpllOjUS.js} +1 -1
- package/dist/assets/{Replay-BzP784vV.js → Replay-CMmg_T4k.js} +1 -1
- package/dist/assets/{Search-CUoYhy1v.js → Search-DobdZczv.js} +1 -1
- package/dist/assets/{Stepper-DfUO9buC.js → Stepper-DJ4LlLol.js} +1 -1
- package/dist/assets/{TableSearch-DxZYknBa.js → TableSearch-NL7mGzF6.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-BwLu2zCu.js → ToggleButtonGroup-1ZqP29sD.js} +1 -1
- package/dist/assets/{UnfoldMore-DvSw9pGy.js → UnfoldMore-BNE7Q7I9.js} +1 -1
- package/dist/assets/{Verified-CfonAx-G.js → Verified-pVnWh8ct.js} +1 -1
- package/dist/assets/{VerifiedUser-wCwGdsz1.js → VerifiedUser-Bq5EjyL0.js} +1 -1
- package/dist/assets/{ViewList-DhdvL6AT.js → ViewList-DikGBOob.js} +1 -1
- package/dist/assets/{_createAggregator-BLxu5C4t.js → _createAggregator-xAuoCETp.js} +1 -1
- package/dist/assets/{actions-Wo9kGXdj.js → actions-BHqqnvHK.js} +1 -1
- package/dist/assets/{actions-D1YtdqKL.js → actions-QNxlOGpH.js} +1 -1
- package/dist/assets/{agreement-07HiBYSX.js → agreement-D-rCiZRR.js} +1 -1
- package/dist/assets/api-ZR56mSDv.js +1 -0
- package/dist/assets/{appearance-CKF7Bo6h.js → appearance-CL4dIHJL.js} +1 -1
- package/dist/assets/{audit-logs-CLt2l7-q.js → audit-logs-BHIFDkts.js} +1 -1
- package/dist/assets/{base-chart-_0APPWGp.js → base-chart-CbniXo_r.js} +1 -1
- package/dist/assets/{blocklet-ClPWX-SV.js → blocklet-e4asDkfP.js} +1 -1
- package/dist/assets/{chain-Bg9mny_E.js → chain-CADjEEjt.js} +1 -1
- package/dist/assets/{click-to-copy-BbJJzGI1.js → click-to-copy-D5SbepAS.js} +1 -1
- package/dist/assets/cloneDeep-ChH4oif_.js +1 -0
- package/dist/assets/{config-navigation-B-CtKO70.js → config-navigation-ySXIDWww.js} +3 -3
- package/dist/assets/{connect-2JDWTFDP.js → connect-CdvuGCCf.js} +1 -1
- package/dist/assets/{connect-to-CBEHT895.js → connect-to-98MGJ7Yl.js} +1 -1
- package/dist/assets/{cssMode-U7KzpQEJ.js → cssMode-C_dsdlzf.js} +1 -1
- package/dist/assets/{delete-confirm-Cx4JPY2I.js → delete-confirm-Dk2gUSc_.js} +1 -1
- package/dist/assets/depsEqual-D1oKMHHx.js +1 -0
- package/dist/assets/{detail-Cgws9Fjd.js → detail-BSLJegmW.js} +3 -3
- package/dist/assets/{domains-BJzrDugH.js → domains-DgPIevHh.js} +1 -1
- package/dist/assets/{download-Df1TrhTI.js → download-DjUrRSaE.js} +1 -1
- package/dist/assets/{edit.svg-833vjqGH.js → edit.svg-BGFHNdYl.js} +1 -1
- package/dist/assets/emotion-cache.browser.esm-CO4m2LjK.js +1 -0
- package/dist/assets/engine-AOyfq5pg.js +1 -0
- package/dist/assets/{freemarker2-J5nZkQuM.js → freemarker2-Ynl3hbRt.js} +1 -1
- package/dist/assets/{get-safe-url-QppwE77w.js → get-safe-url-D0pcxgUJ.js} +1 -1
- package/dist/assets/getValidReactChildren-BrnINUbd.js +1 -0
- package/dist/assets/{graphqlMode-5yY_akok.js → graphqlMode-D3ZzOvwh.js} +2 -2
- package/dist/assets/{handlebars-DfBT6Rl2.js → handlebars-BXtXOFnU.js} +1 -1
- package/dist/assets/{html-BBpT31Z8.js → html-68WkZj1H.js} +1 -1
- package/dist/assets/{html-title-BpNgi7iw.js → html-title-CT8s_pnR.js} +1 -1
- package/dist/assets/{htmlMode-CDF4YwlA.js → htmlMode-D6dQwFeL.js} +1 -1
- package/dist/assets/{iframe-CH8rbppJ.js → iframe-BzTEh7qO.js} +1 -1
- package/dist/assets/{index-jHF3D4cy.js → index-AoP-pJu3.js} +1 -1
- package/dist/assets/{index-B8qqbKQt.js → index-B-25u8Uu.js} +1 -1
- package/dist/assets/index-B1_4iuGC.js +782 -0
- package/dist/assets/{index-tNmk7CjJ.js → index-BAYzgNzt.js} +1 -1
- package/dist/assets/{index-BdVOugOI.js → index-BFzkIx2h.js} +1 -1
- package/dist/assets/index-BQ9Dluv4.js +1 -0
- package/dist/assets/{index-B3tcK3_z.js → index-BTw_aopw.js} +14 -14
- package/dist/assets/{index-Dr7VuVvC.js → index-BV0mjh6r.js} +1 -1
- package/dist/assets/{index-DSjaZAu3.js → index-BaJk36L1.js} +1 -1
- package/dist/assets/{index-BJVvRV0h.js → index-BazbEWXv.js} +1 -1
- package/dist/assets/{index-CsTd8Q4H.js → index-Bd2vWvMu.js} +1 -1
- package/dist/assets/{index-CbnvHmOA.js → index-Bmj3JRL8.js} +1 -1
- package/dist/assets/{index-DCHzmqFc.js → index-BspQeR3D.js} +1 -1
- package/dist/assets/{index-CKWS_NIP.js → index-Bwnzqjf1.js} +1 -1
- package/dist/assets/{index-B4fcaU-r.js → index-CB1i_uf2.js} +1 -1
- package/dist/assets/{index-DqkfLKvE.js → index-CIjzdo65.js} +1 -1
- package/dist/assets/{index-CDd3s2GI.js → index-CVfXb0nN.js} +1 -1
- package/dist/assets/{index-CaxsY_au.js → index-CmbSgUyL.js} +3 -3
- package/dist/assets/{index-BikUP_wv.js → index-Cmvy-qPR.js} +1 -1
- package/dist/assets/{index-BVJB29cJ.js → index-Cp8XtCdH.js} +1 -1
- package/dist/assets/{index-BSBkhGl0.js → index-Cq78KErH.js} +1 -1
- package/dist/assets/{index-WHQs_PkC.js → index-Cy488fNr.js} +1 -1
- package/dist/assets/{index-B6x6Mq9n.js → index-D2bmvDtL.js} +1 -1
- package/dist/assets/{index-Crqqt-AN.js → index-D33KlJUT.js} +1 -1
- package/dist/assets/{index-3MwDYHdN.js → index-DA7EVQ4v.js} +9 -9
- package/dist/assets/{index-DXfP6ckA.js → index-DDI8UY6T.js} +2 -2
- package/dist/assets/{index-BBe9oV9e.js → index-DLJTQrAL.js} +1 -1
- package/dist/assets/{index-Bek3Nxot.js → index-DQhyMeoV.js} +3 -3
- package/dist/assets/{index-D_L4A5jU.js → index-DVXDeiLF.js} +1 -1
- package/dist/assets/{index-m8sITmne.js → index-DXHVn7yq.js} +1 -1
- package/dist/assets/{index-BbND9whL.js → index-Da8PZ-lu.js} +1 -1
- package/dist/assets/{index-iqFfmV_z.js → index-DfDHgwS-.js} +1 -1
- package/dist/assets/{index-BqrWLXQw.js → index-Dpw7fQUd.js} +3 -3
- package/dist/assets/{index-DrsAyGr6.js → index-DuNah4NO.js} +1 -1
- package/dist/assets/{index-BHQcEGDq.js → index-DvMdH51T.js} +1 -1
- package/dist/assets/{index-CBHMH4Z7.js → index-DxFY8dMO.js} +1 -1
- package/dist/assets/{index-cZdqepfp.js → index-Dz1ZwZ8x.js} +1 -1
- package/dist/assets/{index-0NOALS_P.js → index-Fir5RRo8.js} +1 -1
- package/dist/assets/{index-FdUIQyuT.js → index-Fr0im6-l.js} +1 -1
- package/dist/assets/{index-DJfXtT-f.js → index-Jt9YjCeK.js} +1 -1
- package/dist/assets/{index-CHgpIuFF.js → index-Ltxc7YUP.js} +1 -1
- package/dist/assets/{index-BfTQCMKf.js → index-LvA6paIR.js} +1 -1
- package/dist/assets/{index-CbK68mel.js → index-ZuJcpT1T.js} +1 -1
- package/dist/assets/{index-BfnrUUfH.js → index-bAcW8HYF.js} +1 -1
- package/dist/assets/{index-BRSm_uSW.js → index-teas2Eib.js} +3 -3
- package/dist/assets/{index-CZX-K9Eg.js → index-yR3ovHMI.js} +1 -1
- package/dist/assets/{index.esm-WZ7Avw4n.js → index.esm-CL88L2RD.js} +1 -1
- package/dist/assets/{install-from-url-PuHPLadE.js → install-from-url-C9wGB_q1.js} +1 -1
- package/dist/assets/{invitation-Bi2QgUpB.js → invitation-DBHFAKTZ.js} +1 -1
- package/dist/assets/{is-path-prefix-equal-BAfeJQQq.js → is-path-prefix-equal-Df12gAPj.js} +1 -1
- package/dist/assets/{item-hbtsGcq0.js → item-D4OgvExU.js} +1 -1
- package/dist/assets/{javascript-CH6uPFyX.js → javascript-CY8tPfqG.js} +1 -1
- package/dist/assets/{jsonMode-B3mvgwT0.js → jsonMode-B1lllzUE.js} +1 -1
- package/dist/assets/{liquid-BoDus-ho.js → liquid-gpD4GU-k.js} +1 -1
- package/dist/assets/{list-header-C3SJDsfy.js → list-header-CjwjgfKp.js} +1 -1
- package/dist/assets/{lock.svg-CGmlgpmU.js → lock.svg-BmAm_LJl.js} +1 -1
- package/dist/assets/{log-D4BWVj7G.js → log-9z7r8Lwt.js} +1 -1
- package/dist/assets/{lottie-react.esm-ayFZjR4e.js → lottie-react.esm-C8kqAAU9.js} +1 -1
- package/dist/assets/{mdx-C33wkq6H.js → mdx-BwNO0Air.js} +1 -1
- package/dist/assets/{memory-lh5QZ4zg.js → memory-DO3ZqhrY.js} +1 -1
- package/dist/assets/{metric-chc-qmc8.js → metric-BcTiOrOk.js} +1 -1
- package/dist/assets/omit-jBEByUQC.js +1 -0
- package/dist/assets/{overview-DL-GP40o.js → overview-CikmJX9H.js} +1 -1
- package/dist/assets/{permission-D09K4EY6.js → permission-D1opDJhT.js} +1 -1
- package/dist/assets/{preference-iiwdIYk6.js → preference-Cs7lm-MF.js} +3 -3
- package/dist/assets/{provider-icon-Dm9XYo2I.js → provider-icon-CFKcu3V6.js} +1 -1
- package/dist/assets/{python-D_lYYAX1.js → python-CNXRlmYQ.js} +1 -1
- package/dist/assets/{raf-schd.esm-Bo9SYHL8.js → raf-schd.esm-D0EagQlv.js} +1 -1
- package/dist/assets/{razor-dpsmZHh4.js → razor-eMpDpC4X.js} +1 -1
- package/dist/assets/{rotate-session-key-Bfdv46s3.js → rotate-session-key-BiL0Bo_O.js} +1 -1
- package/dist/assets/{runtime-BUcScDcM.js → runtime-DUYT_SiT.js} +1 -1
- package/dist/assets/schema-iTOku2t8.js +1 -0
- package/dist/assets/sdk-B0lvz_Iz.js +1 -0
- package/dist/assets/{service-DCzLPjA3.js → service-BTdtH483.js} +1 -1
- package/dist/assets/{shorten-label-CN9pEyom.js → shorten-label-BNzeaF4J.js} +1 -1
- package/dist/assets/{simple-select-DxwJpURO.js → simple-select-BhAfKrhv.js} +1 -1
- package/dist/assets/{spaces-BrB8zqzV.js → spaces-OwZlXUZ4.js} +1 -1
- package/dist/assets/{status-BZx_J-ps.js → status-D6WlCP08.js} +1 -1
- package/dist/assets/{status-B-GGRrEB.js → status-cEVhL_8t.js} +1 -1
- package/dist/assets/{switch-control-X9WA2UjB.js → switch-control-DfH5Tjol.js} +1 -1
- package/dist/assets/{table-icons-Xs4hP9Pw.js → table-icons-CDTf0wL3.js} +1 -1
- package/dist/assets/{team-B9jB42uy.js → team-BGXKsY22.js} +1 -1
- package/dist/assets/{toLower-DwWNsNMJ.js → toLower-CSOmIMZJ.js} +1 -1
- package/dist/assets/toUpper-DnO1VFxi.js +1 -0
- package/dist/assets/{traffic-C_4zWOQM.js → traffic-DvCEQ5xd.js} +1 -1
- package/dist/assets/{tsMode-57DuREfP.js → tsMode-Let-Q8zu.js} +1 -1
- package/dist/assets/{typescript-BJp2b_J1.js → typescript-DyjM7FW9.js} +1 -1
- package/dist/assets/{url-evaluation-DetQFE_e.js → url-evaluation-Bukt7_Lj.js} +1 -1
- package/dist/assets/{url-join-rRKl4Ear.js → url-join-xsOaQKQ2.js} +1 -1
- package/dist/assets/{use-mobile-DOhPXmq7.js → use-mobile-BIQUR7Fz.js} +1 -1
- package/dist/assets/{use-mobile-BDRFDg8j.js → use-mobile-CFNU7YUg.js} +1 -1
- package/dist/assets/{useAsync-B59MJoKM.js → useAsync-tWL_hrVo.js} +1 -1
- package/dist/assets/{useAsyncRetry-CGp0YSlH.js → useAsyncRetry-CUFV5zTA.js} +1 -1
- package/dist/assets/{useLocalStorage-Dpl2DibN.js → useLocalStorage-MLO2O-Eu.js} +1 -1
- package/dist/assets/{useThemeProps-BS48y1B2.js → useThemeProps-C4X8Xuf-.js} +1 -1
- package/dist/assets/{util-DgOs7OwT.js → util-Byl4XHzq.js} +1 -1
- package/dist/assets/{wait-container-CxHAyAQN.js → wait-container-80uXorh3.js} +1 -1
- package/dist/assets/{without-wallet-qfmn1VhQ.js → without-wallet-U6nu7HMX.js} +1 -1
- package/dist/assets/wrap-locale-pkCcV7CX.js +1 -0
- package/dist/assets/{xml-BZRt8HAs.js → xml-CtKLgaY7.js} +1 -1
- package/dist/assets/{yaml-0X7rH3i7.js → yaml-CMyMNgnc.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/ArrowDropDown-lsZjWbH5.js +0 -1
- package/dist/assets/api-eF9wxSJp.js +0 -1
- package/dist/assets/cloneDeep-DNOsGRuG.js +0 -1
- package/dist/assets/depsEqual-Cvglsxh5.js +0 -1
- package/dist/assets/emotion-cache.browser.esm-Epiq9rij.js +0 -1
- package/dist/assets/engine-a9f8P0CB.js +0 -1
- package/dist/assets/getValidReactChildren-Cjo-LFyx.js +0 -1
- package/dist/assets/index-B31H3tAk.js +0 -1
- package/dist/assets/index-HqyXcG7M.js +0 -602
- package/dist/assets/omit-C11lcOpj.js +0 -1
- package/dist/assets/schema-DidDB4o0.js +0 -1
- package/dist/assets/sdk-l1r4MOQ_.js +0 -1
- package/dist/assets/toUpper-DXK6zXOf.js +0 -1
- package/dist/assets/wrap-locale-D8IL6u8L.js +0 -1
|
@@ -1,602 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-CaxsY_au.js","./index-Bek3Nxot.js","./index-DUrTVFR9.css","./url-join-rRKl4Ear.js","./index-BdVOugOI.js","./_createAggregator-BLxu5C4t.js","./depsEqual-Cvglsxh5.js","./index-cZdqepfp.js","./index-DRYJ0xIl.js","./toUpper-DXK6zXOf.js","./index-B5LvOF-F.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{aF as Le,j as t,eu as Es,hq as ks,js as Rs,V as de,bn as ye,J as B,P as be,H as Y,o as g,f as ht,r as E,p as Se,bF as rt,b as je,i as X,Y as Un,bE as pt,Z as xe,jt as Ps,t as Ce,s as oe,a4 as he,aV as uo,T as ue,$ as Zt,dv as ft,y as _e,b8 as Ts,bJ as Is,aH as H,b1 as Ds,he as Bs,hf as Os,C as we,g4 as po,ix as Wn,x as Us,ax as Kt,w as Ns,ju as Ls,jv as As,v as De,jw as Ms,I as zs,a0 as Fs,jx as fo,bo as mo,U as Ue,g6 as qs,g1 as $s,aA as Ws,aB as Hs,bk as Ks,aC as Gs,aD as fe,aO as Vs,cS as Ys,S as Zs,fN as cr,bi as Xs,h as Qs,jy as Js,jz as ho,ey as It,jA as ei,gW as go,jB as ti,fz as me,jC as xo,eH as ni,hv as ri,i2 as oi,gK as si,jD as ii,cI as dr,d$ as Hn,av as ai,bA as Xt,ek as Me,bu as li,bv as ur,z as Gt,cv as ci,G as ze,aP as pr,hb as yo,F as We,h_ as di,bD as Et,co as fr,ir as ui,gk as mr,bg as pi,L as gt,E as vo,bm as fi,_ as mi,N as kt,aZ as Kn,jE as hi,a_ as Ne,az as hr,cQ as gi,ad as ot,aM as Co,bX as Gn,cA as xi,jF as yi,b9 as vi,A as Vn,aU as Nn,g as Ci,aS as dt,O as fn,W as bi,bG as bo,aI as ji,bx as jo,aR as wi,gb as gr,h0 as xr,h1 as yr,X as vr,cP as _i,h2 as Si,bW as Ei,jG as ki}from"./index-Bek3Nxot.js";import{y as Ri}from"./index-CDd3s2GI.js";import{a as Pi,S as Ti,u as Yn}from"./actions-Wo9kGXdj.js";import{S as Ii,a as Di}from"./switch-control-X9WA2UjB.js";import{u as Ie}from"./blocklet-ClPWX-SV.js";import{P as Ln,w as Qt}from"./permission-D09K4EY6.js";import{E as wo}from"./Edit-DFmlgA7E.js";import{T as Bi,M as Oi,t as Ui}from"./table-icons-Xs4hP9Pw.js";import{s as Ni,F as _o,A as Li,b as Ai,c as Mi,d as zi,R as nt,L as Fi,I as qi,S as lt,a as Rt,B as $i}from"./preference-iiwdIYk6.js";import{C as Cr}from"./click-to-copy-BbJJzGI1.js";import{O as mn}from"./index-B4fcaU-r.js";import{A as Wi}from"./Add-b-MNk7UB.js";import{A as Jt}from"./Link-Mg5UlAaZ.js";import{C as Hi,c as Ki,b as Gi,f as So,A as Vi,_ as Yi,a as Zi,e as Xi,d as Eo,s as Qi,L as Ji,u as ea,g as ta,S as na}from"./item-hbtsGcq0.js";import{T as ra,L as oa,a as An,u as br,W as sa,P as ia}from"./index-BSBkhGl0.js";import{e as ko}from"./engine-a9f8P0CB.js";import{u as aa,C as la,D as ca,a as da,b as ua,S as Ro}from"./connect-to-CBEHT895.js";import{C as pa,u as fa,A as ma}from"./agreement-07HiBYSX.js";import{D as Po}from"./Done-Bh0vP7e6.js";import{C as ha}from"./Google-C0G3l0jL.js";import{I as To,f as ga,a as xa,B as ya}from"./install-from-url-PuHPLadE.js";import{a as jr}from"./api-eF9wxSJp.js";import{v as Io,e as va,a as Vt}from"./util-DgOs7OwT.js";import{u as Do}from"./use-mobile-DOhPXmq7.js";import{A as Ca}from"./ArrowDropDown-lsZjWbH5.js";import{u as ba}from"./useLocalStorage-Dpl2DibN.js";import{r as en}from"./index-BdVOugOI.js";import{b as tn}from"./without-wallet-qfmn1VhQ.js";import{E as Zn}from"./ErrorOutline-CjKNiJFO.js";import{H as ja}from"./HelpOutline--A0maMxb.js";import{c as wa}from"./lock.svg-CGmlgpmU.js";import{D as nn}from"./Delete-B306vkSB.js";import{L as Bo}from"./Launch-Cor8d4pT.js";import{D as _a}from"./delete-confirm-Cx4JPY2I.js";import{W as mt,B as Mn,m as Sa}from"./status-B-GGRrEB.js";import{R as Ea}from"./Replay-BzP784vV.js";import{R as ka,a as wr}from"./url-evaluation-DetQFE_e.js";import{A as Oo}from"./actions-D1YtdqKL.js";import{v as hn}from"./index-B8qqbKQt.js";import{t as Ra}from"./toUpper-DXK6zXOf.js";import{a as Pa}from"./team-B9jB42uy.js";import"./MoreVert-KNjOpSoE.js";import"./DeleteOutline-BjSm7PCr.js";import"./get-safe-url-QppwE77w.js";import"./ButtonGroup-C_JbniJW.js";import"./getValidReactChildren-Cjo-LFyx.js";import"./FilterList-Dphn1UXx.js";import"./CSSTransition-DinXVMZy.js";import"./emotion-cache.browser.esm-Epiq9rij.js";import"./index-DBii9-f-.js";import"./typeof-QjJsDpFa.js";import"./raf-schd.esm-Bo9SYHL8.js";import"./redux-DfszZyTl.js";import"./useThemeProps-BS48y1B2.js";import"./html-title-BpNgi7iw.js";import"./Clear-Chg9fOPG.js";import"./ChevronRight-BKFXnJ7g.js";import"./ChevronLeft-Byy2_Dj8.js";import"./Search-CUoYhy1v.js";import"./omit-C11lcOpj.js";import"./edit.svg-833vjqGH.js";import"./index-cZdqepfp.js";import"./iframe-CH8rbppJ.js";import"./index-CbnvHmOA.js";import"./KeyboardArrowDown-CD6n37Y9.js";import"./Autocomplete-79tADtg2.js";import"./ListSubheader-CHT01bOG.js";import"./Verified-CfonAx-G.js";import"./VerifiedUser-wCwGdsz1.js";import"./url-join-rRKl4Ear.js";import"./index-BojVbZw0.js";import"./spaces-BrB8zqzV.js";import"./OpenInNew-DGDd5qxt.js";import"./index-DRYJ0xIl.js";import"./index-WHQs_PkC.js";import"./decode-DPztD6kB.js";import"./cloneDeep-DNOsGRuG.js";import"./ListItemButton-C8XIzvy_.js";import"./Stepper-DfUO9buC.js";import"./is-path-prefix-equal-BAfeJQQq.js";const Ta=Le(t.jsx("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"})),Ia=Le(t.jsx("path",{d:"m19 8-4 4h3c0 3.31-2.69 6-6 6-1.01 0-1.97-.25-2.8-.7l-1.46 1.46C8.97 19.54 10.43 20 12 20c4.42 0 8-3.58 8-8h3zM6 12c0-3.31 2.69-6 6-6 1.01 0 1.97.25 2.8.7l1.46-1.46C15.03 4.46 13.57 4 12 4c-4.42 0-8 3.58-8 8H1l4 4 4-4z"})),Da=Le(t.jsx("path",{d:"M8 5v14l11-7z"})),Uo=Le(t.jsx("path",{d:"M22 5.18 10.59 16.6l-4.24-4.24 1.41-1.41 2.83 2.83 10-10zm-2.21 5.04c.13.57.21 1.17.21 1.78 0 4.42-3.58 8-8 8s-8-3.58-8-8 3.58-8 8-8c1.58 0 3.04.46 4.28 1.25l1.44-1.44C16.1 2.67 14.13 2 12 2 6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10c0-1.19-.22-2.33-.6-3.39z"})),Ba=Le(t.jsx("path",{d:"M14.17 5 19 9.83V19H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V9.83c0-.53-.21-1.04-.59-1.41l-4.83-4.83c-.37-.38-.88-.59-1.41-.59M7 15h10v2H7zm0-4h10v2H7zm0-4h7v2H7z"})),No=Le(t.jsx("path",{d:"M3 17v2h6v-2zM3 5v2h10V5zm10 16v-2h8v-2h-8v-2h-2v6zM7 9v2H3v2h4v2h2V9zm14 4v-2H11v2zm-6-4h2V7h4V5h-4V3h-2z"})),Oa=Le(t.jsx("path",{d:"M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1-2.73 2.71-2.73 7.08 0 9.79s7.15 2.71 9.88 0C18.32 15.65 19 14.08 19 12.1h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58s9.14-3.47 12.65 0L21 3zM12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8z"})),Ua=Le(t.jsx("path",{d:"M5 20h14v-2H5zm0-10h4v6h6v-6h4l-7-7z"})),Na=Le(t.jsx("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"})),La=Le(t.jsx("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}));function _r(e,r){var n={};return r=Es(r),ks(e,function(a,i,o){Rs(n,i,r(a,i,o))}),n}function Lo({children:e=null,...r}){const{t:n}=de(),{api:a}=ye(),{blocklet:i}=Ie(),o=i?.settings?.autoCheckUpdate,f=async l=>{await a.updateAutoCheckUpdate({input:{did:i.meta.did,autoCheckUpdate:l}})},c=async()=>{try{const l=!o?.enabled;await f({enabled:l}),Y.success(n(l?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(l){Y.error(l.message)}},d=!!o?.enabled;return t.jsxs(B,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[e,t.jsx(be,{title:n("storage.spaces.autoCheckUpdate.title"),arrow:!0,placement:"right",children:t.jsx("div",{children:t.jsx(Ii,{checked:d,onChange:c,name:"enableWelcomePage",style:{...r.style,zoom:.8}})})})]})}Lo.propTypes={children:g.any};function Sr(e){function r({sx:n,...a}){return t.jsx(e,{...a,sx:{color:"text.primary",...n}})}return r}const Aa={..._r(Ui,Sr),..._r(Pi,Sr)},Ma=(e,r)=>{let{description:n}=e;return(Object.values(je.CHAIN_PROP_MAP).includes(e.key)||X.isEnvShareable(e))&&(n?n=`${n} (${r("blocklet.config.sharedToAllComponents")})`:n=r("blocklet.config.sharedToAllComponents")),n&&t.jsx("div",{style:{marginLeft:12},children:n})},gn=(e,r,n=[])=>!n?.length&&!e.custom&&!["CHAIN_ID","CHAIN_HOST"].includes(e.key)&&!r.meta.environments.find(a=>a.name===e.key)&&r.children.every(a=>!a.meta.environments.find(i=>i.name===e.key))?!0:e.custom,Er=e=>[je.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(e)?!0:!(e.startsWith("BLOCKLET_")||e.startsWith("COMPONENT_")),xn=e=>[je.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(e)===!1;function Ao({blocklet:e,ancestors:r=[]}){const n=ye(),{palette:a}=ht(),{inService:i}=n,{t:o}=E.useContext(Se),f=[...r.map(s=>s.meta.did),e.meta.did],c=()=>Y.success(o("blocklet.config.changedTip")),d=s=>gn(s,e,r);if(rt(e.status)||e.status==="unknown"&&rt(e.status))return null;const l=s=>new Promise(async(m,b)=>{if(!s.key.trim()||!s.value.trim()){Y.error(o("blocklet.config.environment.keyValueRequired")),b();return}if(Er(s.key)===!1){Y.error(o("blocklet.config.environment.invalidKey")),b();return}s.custom=xn(s.key);try{const R=await n.api.configBlocklet({input:{did:f,configs:[s]}});c(R.blocklet),m()}catch(R){Y.error(xe(R)),b()}}),y=(s,m)=>new Promise(async(b,R)=>{if(s.required&&(!s.key.trim()||!s.value.trim())){Y.error(o("blocklet.config.environment.keyValueRequired")),R();return}if(Er(s.key)===!1){Y.error(o("blocklet.config.environment.invalidKey")),R();return}if(s.key===je.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const M=Ps(s);if(M){Y.error(M),R();return}}const S=[{...s,value:s.secure&&s.value==="__encrypted__"?"":s.value}];if(s.key!==m.key){if(!gn(s,e,r)){Y.error("Only key of custom env can be changed"),R();return}S.push({key:m.key,custom:xn(s.key)})}try{const M=await n.api.configBlocklet({input:{did:f,configs:S}});c(M.blocklet),b()}catch(M){Y.error(xe(M)),R()}}),p=s=>new Promise(async(m,b)=>{if(s.required){Y.error(o("blocklet.config.environment.deleteForbidden")),b();return}if(!gn(s,e,r)){Y.error(o("environmentTips.deleteForbidden")),b();return}try{const R=await n.api.configBlocklet({input:{did:f,configs:[{key:s.key,custom:xn(s.key)}]}});c(R.blocklet),m()}catch(R){Y.error(xe(R)),b()}}),v=(e.configs||[]).filter(s=>!je.BLOCKLET_CONFIGURABLE_KEY[s.key]||[je.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(s.key)),x=X.getSharedConfigObj(r[0],e),C=X.getComponentMissingConfigs(e,r[0]),w=v.map(s=>({...s,value:Object.values(je.CHAIN_PROP_MAP).includes(s.key)&&Object.keys(x).includes(s.key)?x[s.key]:x[s.key]||s.value})),_=w.some(s=>s.key&&s.key.startsWith("BWA_")),k={onRowAdd:l,onRowUpdate:y,onRowDelete:p,isDeletable:d},u=()=>[{title:o("common.key"),field:"key",initialEditValue:"",width:"30%",render:s=>t.jsx(Cr,{value:s.value,style:{color:s.required&&!s.value?a.error.main:a.text.primary,fontWeight:s.required?"bold":"normal"},children:s.key}),editComponent:s=>{const{value:m,rowData:b,onChange:R}=s;return t.jsx(kr,{children:t.jsx(Ce,{fullWidth:!0,size:"small",value:Ni.escapeTag(m),onChange:S=>R(S.target.value),variant:"outlined",label:"Key",placeholder:o("blocklet.config.environment.key"),margin:"dense",autoFocus:!0,slotProps:{input:{readOnly:d(b)===!1}}})})}},{title:o("common.value"),field:"value",initialEditValue:"",width:"calc((100% - (96px + 30%)) / 1)",render:s=>s.value?s.secure?"******":t.jsx(Cr,{unstyled:!0,value:s.value,style:{wordBreak:"break-all"},children:s.value}):null,editComponent:s=>{const{value:m,rowData:b,onChange:R}=s;return t.jsxs(kr,{children:[t.jsx(Ce,{fullWidth:!0,size:"small",value:m==="__encrypted__"?"":m,onChange:S=>R(S.target.value),variant:"outlined",label:o("common.value"),placeholder:o("blocklet.config.environment.value"),margin:"dense"}),Ma(b,o)]})}}];return t.jsxs(za,{children:[!!C.length&&t.jsx(Un,{severity:"error",style:{marginTop:24},children:o("blocklet.config.missingRequired")}),_&&t.jsx(Un,{severity:"info",children:o("blocklet.config.environment.tip")}),t.jsx(Ln,{permission:i?"":"mutate_blocklets",role:i?pt:[],children:s=>t.jsx(Bi,{className:"config-table",children:t.jsx(Oi,{title:t.jsx(B,{sx:{fontWeight:"bold"},children:o("common.environments")}),columns:u(),icons:Aa,options:{emptyRowsWhenPaging:!1,actionsColumnIndex:-1,tableLayout:"auto",maxBodyHeight:"100%",paging:!1,search:!1,actionsCellStyle:{padding:"0",textAlign:"right",width:"80px"}},localization:{header:{actions:o("common.actions")},body:{emptyDataSourceMessage:o("common.noData"),editRow:{deleteText:o("environmentTips.delete")}}},data:w,editable:s?k:{}})})})]})}Ao.propTypes={blocklet:g.object.isRequired,ancestors:g.array};const za=oe.div`
|
|
3
|
-
.config-table {
|
|
4
|
-
margin-bottom: 24px;
|
|
5
|
-
position: relative;
|
|
6
|
-
.hide-control {
|
|
7
|
-
position: absolute;
|
|
8
|
-
top: 10px;
|
|
9
|
-
left: 200px;
|
|
10
|
-
@media (max-width: ${e=>e.theme.breakpoints.values.sm}px) {
|
|
11
|
-
left: 160px;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.MuiToolbar-root {
|
|
16
|
-
display: flex;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.MuiTableRow-head {
|
|
20
|
-
display: none;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
&.hide-header {
|
|
24
|
-
.MuiToolbar-root {
|
|
25
|
-
display: none;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.accordion {
|
|
31
|
-
margin-bottom: 16px;
|
|
32
|
-
&:last-of-type {
|
|
33
|
-
margin-bottom: 0;
|
|
34
|
-
}
|
|
35
|
-
padding: 8px 0 8px 0px;
|
|
36
|
-
&.MuiAccordion-root {
|
|
37
|
-
background: transparent;
|
|
38
|
-
box-shadow: none;
|
|
39
|
-
border: 1px solid #ddd;
|
|
40
|
-
border-radius: 4px;
|
|
41
|
-
&::before,
|
|
42
|
-
&::after {
|
|
43
|
-
height: 0;
|
|
44
|
-
}
|
|
45
|
-
.MuiAccordionSummary-root {
|
|
46
|
-
padding-left: 0;
|
|
47
|
-
}
|
|
48
|
-
.accordion-title {
|
|
49
|
-
font-weight: bold;
|
|
50
|
-
padding-left: 16px;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
`,kr=oe.div`
|
|
55
|
-
height: 60px;
|
|
56
|
-
`;function Xn({open:e=!1,onClose:r=null,hiddenChildren:n=!1,blocklet:a,ancestors:i=[],children:o=null}){const[f,c]=E.useState(!1),{t:d}=de(),l=d("environmentFor",{name:X.getDisplayName(a,!0)});if(rt(a.status)||a.status==="unknown"&&rt(a.status))return null;const y=()=>{r?.(),c(!1)},p=x=>{x.stopPropagation(),c(!0)};let v=null;return n||(v=typeof o=="function"?o({open:p}):t.jsx(he,{onClick:p,"data-cy":"action-config-component",children:t.jsx(wo,{})})),t.jsxs(t.Fragment,{children:[v,(e||f)&&t.jsx(Fa,{open:!0,fullWidth:!0,maxWidth:"md",title:l,onClose:y,PaperProps:{style:{minHeight:"auto",backgroundImage:"none"}},children:t.jsxs(uo,{sx:{gap:0},children:[t.jsx(ue,{sx:{fontSize:12,color:"text.secondary",mb:.5},children:d("description.environment",{name:X.getDisplayName(a,!0)})}),t.jsx(Ao,{blocklet:a,ancestors:i})]})})]})}Xn.propTypes={blocklet:g.object.isRequired,ancestors:g.array,children:g.any,open:g.bool,onClose:g.func,hiddenChildren:g.bool};const Fa=oe(Zt)`
|
|
57
|
-
.MuiDialogContent-root {
|
|
58
|
-
padding-top: 0;
|
|
59
|
-
padding-bottom: 24px;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.MuiToolbar-root {
|
|
63
|
-
padding-right: 0;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.ux-dialog_closeButton {
|
|
67
|
-
margin: 0;
|
|
68
|
-
}
|
|
69
|
-
`,qa=E.lazy(()=>Is(()=>import("./index-CaxsY_au.js").then(e=>e.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url).then(e=>({default:e.Uploader}))),$a="/blocklet/component/upload",Rr=[".html",".htm",".tgz",".zip"],Wa=Number(window.env?.maxUploadFileSize)||H.MAX_UPLOAD_FILE_SIZE,Ha=Wa*1024*1024;function Mo({did:e,prefix:r,headers:n=()=>({}),onUploaded:a=ft,open:i=!1,onClose:o=ft}){const{t:f,locale:c}=de(),d=E.useRef(null),l=E.useCallback(y=>{const{status:p,data:v}=y;if(p===200){a(v);return}Y.error(f("blocklet.component.addComponentTip.uploadFailed"))},[a,f]);return E.useEffect(()=>{i?d.current?.open():d.current?.close()},[i]),t.jsx(Ka,{id:`component-uploader-${e}`,children:t.jsx(qa,{ref:d,locale:c,popup:!0,disableXssAttack:!0,onUploadFinish:l,plugins:[],onClose:o,installerProps:{disabled:!0},apiPathProps:{uploader:_e(r,$a,e),disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:Rr,maxFileSize:Ha,maxNumberOfFiles:1}},tusProps:{headers:n},dashboardProps:{note:f("blocklet.component.addComponentTip.allowedFileTypes",{types:Rr.map(y=>y.replace(".","")).join(", ")})}})},`component-uploader-${e}`)}Mo.propTypes={did:g.string.isRequired,prefix:g.string.isRequired,open:g.bool,headers:g.func,onUploaded:g.func,onClose:g.func};const Ka=Ts(B)`
|
|
70
|
-
.uploader-wrapper {
|
|
71
|
-
display: inline-flex;
|
|
72
|
-
position: relative;
|
|
73
|
-
font-size: 0px;
|
|
74
|
-
overflow: hidden;
|
|
75
|
-
&.enabled {
|
|
76
|
-
cursor: pointer;
|
|
77
|
-
}
|
|
78
|
-
&::after {
|
|
79
|
-
display: none;
|
|
80
|
-
}
|
|
81
|
-
&.enabled::after {
|
|
82
|
-
display: block;
|
|
83
|
-
opacity: 1;
|
|
84
|
-
position: absolute;
|
|
85
|
-
bottom: 0;
|
|
86
|
-
background: rgba(0, 0, 0, 0.3);
|
|
87
|
-
left: 0;
|
|
88
|
-
right: 0;
|
|
89
|
-
height: 2.2em;
|
|
90
|
-
color: white;
|
|
91
|
-
text-align: center;
|
|
92
|
-
font-size: 12px;
|
|
93
|
-
line-height: 2em;
|
|
94
|
-
transition: opacity 0.3s ease;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
`,Qn={description:g.string,editing:g.bool,onChange:g.func,required:g.bool,value:g.any,componentProps:g.object,render:g.func,renderFormItem:g.func};function Jn({editing:e,value:r,onChange:n}){const[a,i]=E.useState(!1),o=E.useRef(),f=E.useRef(r);E.useEffect(()=>{let p=null;return e&&(p=setTimeout(()=>{i(!0)},50)),()=>{clearTimeout(p)}},[e]);const c=p=>{f.current=p,n(p)},d=()=>{i(!1),n(f.current)},l=t.jsx(B,{className:"form-item-input slot",sx:{px:1},children:t.jsxs(B,{sx:{display:"flex",alignItems:"center"},children:[r,r!=="auto"&&t.jsx("div",{style:{marginLeft:4,backgroundColor:r,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),y=t.jsxs(B,{onKeyDown:d,sx:{display:"flex",flexGrow:1,alignItems:"center",height:"40px"},children:[t.jsx(B,{onClick:()=>i(!0),sx:{display:"flex",alignItems:"center"},children:t.jsx("div",{ref:o,style:{flexShrink:0,marginLeft:"8px",backgroundColor:r,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:r==="auto"?"default":"pointer"}})}),t.jsx(Ds,{open:a,anchorEl:o.current,onClose:()=>i(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:t.jsx(ha,{color:r,onChange:p=>c(p.hex)})})]});return e?y:l}Jn.propTypes=Qn;function zo({editing:e,description:r,value:n,onChange:a,componentProps:i={},...o}){const{placeholder:f}=i,c=E.useRef(n),{t:d}=E.useContext(Se),l=p=>{p.key==="Enter"&&a(c.current,"confirm")},y=p=>{c.current=p,a(p)};return e?t.jsx(Ce,{style:{flex:1},fullWidth:!0,value:n,onChange:p=>{p.persist(),y(p.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:r||f,onKeyDown:l,...o}):t.jsx(B,{className:"form-item-input slot",sx:{px:1},children:n||t.jsx("span",{className:"placeholder",children:d("common.requiredInputPlaceholder",{name:r||f})})})}zo.propTypes=Qn;function Fo({editing:e,value:r,onChange:n,componentProps:a,...i}){const{blocklet:o}=a,f=r==="auto"?Bs(o.appDid):r;return t.jsxs(B,{sx:{display:"flex",alignItems:"center"},children:[t.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:Os({title:"Owner",issuer:X.getDisplayName(o),issuerDid:o.appDid,ownerName:"Your Name",ownerDid:o.appDid,preferredColor:r||"auto"})}}),t.jsx(Jn,{...i,editing:e,value:e?f:r,onChange:n,componentProps:a})]})}Fo.propTypes={...Qn,componentProps:g.shape({blocklet:g.object.isRequired}).isRequired};const Ga=Wn`
|
|
98
|
-
0%, 100% {
|
|
99
|
-
transform: scale(1) translateX(0);
|
|
100
|
-
}
|
|
101
|
-
50% {
|
|
102
|
-
transform: scale(1.05) translateX(-3px);
|
|
103
|
-
}
|
|
104
|
-
25%, 75% {
|
|
105
|
-
transform: scale(1.1) translateX(3px);
|
|
106
|
-
}
|
|
107
|
-
`,Va={input:zo,color:Jn,passport:Fo,uploader:e=>t.jsx(Fi,{...e.componentProps})};function Ya(e,{editing:r=!1}){const{componentType:n="input",render:a,renderFormItem:i}=e;return r&&i?i:!r&&a?a:Va[n?.toLowerCase()]}er.propTypes={item:g.object.isRequired,findEditingItem:g.func.isRequired,getItemValue:g.func.isRequired,onFormItemChange:g.func.isRequired,onFocusOut:g.func.isRequired,disabled:g.bool,loading:g.bool,onCancel:g.func,formValues:g.object.isRequired};function er({item:e,findEditingItem:r,getItemValue:n,onFormItemChange:a,onFocusOut:i,disabled:o=!1,loading:f=!1,onCancel:c=()=>{},formValues:d}){const{key:l,description:y,required:p,solo:v=!1,hidden:x=!1,componentProps:C={},skipButtonDisabled:w=!1}=e;if(x)return null;const _=r(l),{editing:k,shaking:u}=_??{},s=n(e,{editing:k}),m=Ya(e,{editing:k}),b={inputProps:{"data-cy":"schema-form-item-component"},key:l,description:y,editing:k,value:s,onChange:(R,S="change")=>a(e,R,S),componentProps:C,skipButtonDisabled:w,onBlur:()=>i(e)};return e.componentType==="collapse"&&e.children?.length>0?t.jsxs(Li,{children:[t.jsx(Ai,{expandIcon:t.jsx(Mi,{fontSize:"small"}),"aria-controls":"panel1-content",id:"panel1-header",children:e.description}),t.jsx(zi,{children:e.children.map(R=>t.jsx(er,{item:R,findEditingItem:r,getItemValue:n,onFormItemChange:a,onFocusOut:i,formValues:d,disabled:o,loading:f,onCancel:c},R.key))})]}):t.jsxs(B,{className:"form-item",children:[!v&&t.jsxs(B,{className:"form-item-label",sx:{color:p&&!s?"error.main":"text.secondary"},children:[y,p&&t.jsx(nt,{})]}),t.jsxs(B,{className:"form-item-body",children:[t.jsx(B,{className:"form-item-input","data-cy":"schema-form-item-edit",sx:{textAlign:v?"center":"left"},style:{cursor:"text"},onClick:()=>{o||_?.edited||w||a(e,d[l],"edit")},children:t.jsx(m,{...b})}),!v&&t.jsx(B,{className:"form-item-action",style:{marginLeft:0},children:k?t.jsxs(t.Fragment,{children:[_.edited?t.jsx(he,{"data-cy":"schema-form-item-confirm",onClick:()=>{a(e,s,"confirm")},disabled:o||f,sx:{animation:u?`${Ga} 0.5s linear`:"none"},style:{paddingRight:4},size:"large",children:f?t.jsx(we,{size:24}):t.jsx(Po,{})}):null,t.jsx(he,{"data-cy":"schema-form-item-cancel",onClick:()=>c(e),style:{paddingLeft:_.edited?4:8},disabled:o||f,size:"large",children:t.jsx(po,{})})]}):null})]})]},l)}function qo({schema:e,loading:r=!1,value:n=void 0,defaultValue:a={},onChange:i,style:o={},disabled:f=!1}){const c=Object.prototype.toString.call(n)==="[object Object]",[d,l]=E.useState([]),[y,p]=E.useState(c?n:a),v=E.useMemo(()=>e.length===1,[e]),x=E.useCallback(m=>d.find(b=>b.key===m),[d]);E.useEffect(()=>{v&&e[0]?.required&&l([{key:e[0].key,editing:!0,initialValue:a[e[0].key]}])},[e,v,a]);const C=E.useCallback(m=>{l(b=>b.find(S=>S.key===m.key)?b.map(S=>S.key===m.key?m:{...S}):[m].concat(b))},[]),w=E.useCallback((m,b,R)=>{const{key:S,secure:M}=m,F=x(S)??{...m};F.editing=!0;const D=y[S]!==b;F.edited=b&&F.initialValue!==b,F.initialValue=a[S];const I={...y,[S]:b};D&&p(I),i({[S]:b},{allValues:I,action:R,currentItem:m}),R==="confirm"&&M&&p({...y,[S]:"__encrypted__"}),R==="confirm"&&(F.initialValue=y[S]),["confirm","cancel"].includes(R)&&(F.editing=!1,F.edited=!1),C(F)},[a,y,i,C,x]),_=E.useCallback((m,{editing:b=!1})=>{const{key:R}=m,S=c?n[R]:y[R];return S==="__encrypted__"?b?"":"******":S},[c,n,y]),k=E.useCallback(m=>{const b=x(m.key);b&&w(m,b.initialValue,"cancel")},[x,w]),u=E.useCallback(m=>{const b=x(m.key);!b||!b.edited||(b.shaking=!0,C(b),setTimeout(()=>{b.shaking=!1,C(b)},500))},[x,C]),s=E.useCallback(m=>{const b=x(m.key);!b||!b.edited?k(m):u(m)},[x,u,k]);return t.jsx(Za,{className:"form",style:o,children:e?.map(m=>{const{hidden:b=!1}=m;return b?null:t.jsx(er,{item:m,findEditingItem:x,getItemValue:_,onFormItemChange:w,onFocusOut:s,formValues:y,disabled:f,loading:r,onCancel:k})})})}qo.propTypes={schema:g.array.isRequired,loading:g.bool,onChange:g.func.isRequired,value:g.object,defaultValue:g.object,style:g.object,disabled:g.bool};const Za=oe(_o)``;function $o({meta:e,onCancel:r,mode:n,handlePaySuccess:a=()=>{}}){const{t:i,locale:o}=de(),{info:f}=ye(),c=Us(f),[d,l]=E.useState(null),y=new URL(e?.registryUrl).origin,p=X.getDisplayName({meta:e}),v=async(C,w)=>{const _=({downloadTokenList:s})=>{a({downloadTokenList:s})},k=s=>{Y.error(s),r(s)};function u(s){return As(()=>jr.get(s).then(async({data:m})=>{const b=m?.downloadTokenList;if(m.status==="succeed"){if(b&&b.length)await _({downloadTokenList:b});else return await k(i("blocklet.component.missDownloadTokenTip")),!0;return!0}return m.status==="error"?(console.error("vc error: ",m),await k(m?.error),!0):!1}),{interval:1e3})}if(n==="purchase"&&d){const{statusUrl:s}=Ls(d);await u(s)}else await _({downloadTokenList:C.downloadTokenList&&w(C.downloadTokenList)})};if(E.useEffect(()=>{if(n==="purchase"){const C=new URL(y);C.pathname="/api/did/verify-purchase-blocklet/token",C.searchParams.set("serverDid",f.did),C.searchParams.set("blockletDid",e?.did);try{jr.get(C.href).then(({data:w})=>{const _=`${w.url}`;l(_)})}catch(w){console.error("get next workflow url error: ",w)}}return()=>{l(null)}},[n]),n==="purchase"&&!d)return"";const x={verify:{action:"verify-purchase-blocklet",checkFn:Kt.create({baseURL:y}).get,extraParams:{serverDid:f.did,blockletDid:e?.did},messages:{title:i("store.purchase.verify.auth.title",{name:p}),scan:i("store.purchase.verify.auth.scan"),confirm:i("store.purchase.verify.auth.confirm"),success:i("store.purchase.verify.auth.success")}},purchase:{action:"acquire-asset",checkFn:Kt.create({baseURL:_e(y,"/store")}).get,extraParams:{factory:e.nftFactory,nw:d},messages:{title:i("store.purchase.auth.title",{name:p}),scan:i("store.purchase.auth.scan"),confirm:i("store.purchase.auth.confirm"),success:t.jsxs(t.Fragment,{children:[t.jsx("p",{children:i("store.purchase.auth.success")}),t.jsx("p",{children:i("blocklet.component.purchaseComponentSecondCheckTip")})]})}}};return t.jsx(Ns,{open:!0,locale:o,popup:!1,saveConnect:!1,className:"connect",baseUrl:y,onSuccess:v,cancelWhenScanned:r,onClose:r,checkTimeout:60*5e3,webWalletUrl:c,disableClose:!0,showDownload:!1,...x[n]})}$o.propTypes={...Ki,handlePaySuccess:g.func,mode:g.oneOf(["verify","purchase"]).isRequired};function Wo({ref:e=null,mode:r,...n}){const[a,i]=E.useState(r!=="both"?r:"verify"),[o,f]=E.useState(r!=="both"?2:1),c=l=>{l!==a&&i(l)},d=()=>{a&&o!==2&&f(2)};return E.useImperativeHandle(e,()=>({onNext:d,getCurrentStep:()=>o})),o===1?t.jsx("div",{style:{maxWidth:520},children:t.jsx(Hi,{action:a,onNext:null,onSelect:c})}):t.jsx($o,{...n,mode:a})}Wo.propTypes={mode:g.oneOf(["both","verify","purchase"]).isRequired,ref:g.any};function Xa({...e}){return t.jsx(De,{className:"bottom-button",variant:"contained",color:"primary",...e})}function Ho({blocklet:e=null,onStartNow:r=()=>{},children:n=null,disabled:a=!1}){const{t:i}=de(),o=Do();return!e||Ms(e.meta)?t.jsx(Qa,{children:n}):t.jsxs(Ja,{isMobile:o,children:[t.jsx(Xa,{className:"start-now",variant:"contained",color:"primary",disabled:a,onClick:()=>r(),children:i("setup.startNow")}),t.jsx(B,{sx:{display:"flex",alignItems:"center"},children:n})]})}Ho.propTypes={blocklet:g.object,onStartNow:g.func,children:g.any,disabled:g.bool};const Qa=oe(B)`
|
|
108
|
-
width: 100%;
|
|
109
|
-
margin-top: auto;
|
|
110
|
-
padding-top: 24px;
|
|
111
|
-
display: flex;
|
|
112
|
-
align-items: center;
|
|
113
|
-
justify-content: center;
|
|
114
|
-
.bottom-button {
|
|
115
|
-
min-width: 200px;
|
|
116
|
-
}
|
|
117
|
-
${e=>e.theme.breakpoints.down("md")} {
|
|
118
|
-
.bottom-button {
|
|
119
|
-
width: 100%;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
`,Ja=oe(B)`
|
|
123
|
-
padding-top: 24px;
|
|
124
|
-
margin-top: auto;
|
|
125
|
-
width: 100%;
|
|
126
|
-
display: flex;
|
|
127
|
-
align-items: center;
|
|
128
|
-
justify-content: space-between;
|
|
129
|
-
.start-now {
|
|
130
|
-
min-width: 140px;
|
|
131
|
-
}
|
|
132
|
-
.bottom-button {
|
|
133
|
-
min-width: 120px;
|
|
134
|
-
}
|
|
135
|
-
${e=>e.theme.breakpoints.down("lg")} {
|
|
136
|
-
width: 100%;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
${e=>e.theme.breakpoints.down("md")} {
|
|
140
|
-
.start-now {
|
|
141
|
-
min-width: inherit;
|
|
142
|
-
}
|
|
143
|
-
.bottom-button {
|
|
144
|
-
min-width: 100px;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
${e=>e.isMobile} {
|
|
149
|
-
justify-content: space-between;
|
|
150
|
-
gap: '32px',
|
|
151
|
-
}}
|
|
152
|
-
`;function Ko({blockletMeta:e,onEndpointUpdate:r=()=>{}}){const n=Do(),{blocklet:a}=Ie(),{updateSpaceGateway:i,loading:o,hasStorageEndpoint:f}=aa();return E.useEffect(()=>{r?.()},[a]),o?t.jsx(zs,{relative:"parent",children:t.jsx(we,{})}):t.jsxs(el,{children:[t.jsx(B,{sx:{width:n?"360px":"720px"},children:f?t.jsx(la,{}):t.jsx(ca,{})}),e?.capabilities?.didSpace==="required"&&t.jsx(Ho,{mt:8,children:t.jsx(da,{onConnect:i})})]})}Ko.propTypes={blockletMeta:g.any.isRequired,onEndpointUpdate:Fs.func};const el=oe(pa)`
|
|
153
|
-
height: 100%;
|
|
154
|
-
overflow-y: auto;
|
|
155
|
-
padding-bottom: 32px;
|
|
156
|
-
overflow-x: hidden;
|
|
157
|
-
`;function Go({onChange:e=()=>{},loading:r=!1,children:n,extra:a="",stores:i=[],storageKey:o=""}){const{t:f}=de(),{info:c,inService:d}=ye(),{blocklet:l}=Ie(),[y,p]=E.useState(!1),v=E.useRef(null),[x,C]=E.useState(),[w,_]=ba(o||"tmp"),[k,u]=o?[w,_]:[x,C],{storeList:s,teamDid:m}=fo({fromBlocklet:d,blocklet:l,nodeInfo:c}),b=mo([...i.map(S=>({...S,protected:!0})),...s],"url"),R=k&&b.find(S=>k===S.url)||b[0];return t.jsxs(t.Fragment,{children:[t.jsxs(tl,{children:[t.jsx(De,{ref:v,color:"primary","data-cy":"add-component-select-store",endIcon:t.jsx(Ca,{color:"primary"}),onClick:()=>{p(!0)},style:{padding:"0 2px"},children:t.jsx(ue,{color:"primary",children:R.name})}),t.jsx(ue,{color:"primary",children:a})]}),t.jsxs(Ce,{id:"mui-registry-select",select:!0,autoComplete:"off",variant:"outlined",name:"did",helperText:f("blocklet.component.selectRegistryTip"),"data-cy":"component-registry-select",fullWidth:!0,value:R,autoFocus:!0,onChange:S=>{const M=S.target.value;u(M.url),e(M)},style:{display:"none"},margin:"normal",slotProps:{select:{open:y,MenuProps:{anchorEl:v.current},renderValue:S=>S?.name,onClose:()=>{p(!1)}}},children:[b?.map(S=>t.jsx(Ue,{sx:{width:"400px",maxWidth:"90vw"},value:S,"data-cy":S.url,children:t.jsx(Gi,{teamDid:m,store:S,onDelete:()=>{k===S.url&&u(b[0]?.url)}})},S.url)),!So.isInServerlessMode(c)&&t.jsx(Vi,{disabled:r,storeList:b,teamDid:m,onAdd:S=>{u(S)}})]}),n({currentRegistry:R})]})}Go.propTypes={onChange:g.func,loading:g.bool,children:g.any.isRequired,extra:g.node,storageKey:g.string,stores:g.arrayOf(g.shape({name:g.string.isRequired,url:g.string.isRequired}))};const tl=oe.div`
|
|
158
|
-
display: flex;
|
|
159
|
-
justify-content: space-between;
|
|
160
|
-
align-items: center;
|
|
161
|
-
margin-bottom: 16px;
|
|
162
|
-
|
|
163
|
-
span {
|
|
164
|
-
font-size: 16px;
|
|
165
|
-
color: ${e=>e.theme.palette.text.primary};
|
|
166
|
-
// font-weight: bold;
|
|
167
|
-
}
|
|
168
|
-
`,nl={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm0 10a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm10 0a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1zm0-8h6m-3-3v6"/>'},rl={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m17 10l-2-6m-8 6l2-6m4 16H7.244a3 3 0 0 1-2.965-2.544l-1.255-7.152A2 2 0 0 1 5.001 8H19a2 2 0 0 1 1.977 2.304"/><path d="M10 14a2 2 0 1 0 4 0a2 2 0 0 0-4 0m11 1h-2.5a1.5 1.5 0 0 0 0 3h1a1.5 1.5 0 0 1 0 3H17m2 0v1m0-8v1"/></g>'},ol={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m7 11l5-5l5 5M7 17l5-5l5 5"/>'},sl=(e,r)=>_e(r,`/blocklets/${e.did}`),Pr=({blocklet:e,attribute:r,value:n})=>e._formatted?e._formatted[r]:n,il=e=>e.inStore&&X.isFreeBlocklet(e)===!1;function Vo({blocklet:e,blocklets:r=[],handleButtonClick:n=null,endpoint:a="",serverVersion:i=""}){const{t:o}=de();let f=_e(a,Gs(e.did,e.logo||""));try{const _=new URL(f);_.searchParams.set("v",e.version||+new Date),f=_.href}catch{}const[c,d]=E.useState(!1),l=async()=>{try{d(!0),await n({meta:e,registryUrl:a,blocklets:r})}catch(_){Y.error(_.message)}finally{d(!1)}},{blocklet:y}=Ie(),p=()=>(y?.children||[]).find(u=>u.meta.bundleDid===e.did).meta.version,x=(()=>{const _=(y?.children||[]).find(k=>k.meta.bundleDid===e.did);if(_){try{const k=_.meta.version,u=e.version;if(Vs.gt(u,k))return"upgrade"}catch{return"install"}return"disable"}return"install"})(),C=e.requirements?.server,w=[];return x==="upgrade"?w.push({key:"upgrade",icon:t.jsx(fe,{icon:ol,color:"success.light",width:20,height:20},"version"),title:`${p()} -> ${e.version}`,align:"right",color:"success.light",maxWidth:300,text:t.jsx(B,{sx:{fontWeight:"bold"},children:o("blocklet.component.upgradeAvailable")})}):x==="disable"?w.push({key:"disable",icon:t.jsx(fe,{icon:nl,color:"text.disabled",width:20,height:20},"disable"),align:"right",maxWidth:300,color:"text.disabled",text:o("blocklet.component.installed")}):il(e)&&w.push({key:"purchase",icon:t.jsx(fe,{icon:rl,color:"primary.main",width:20,height:20},"purchase"),align:"right",maxWidth:300,color:"primary.main",text:o("blocklet.component.needBuy")}),t.jsx(al,{title:Pr({blocklet:e,attribute:"title",value:e.title||e.name}),did:e.did,description:Pr({blocklet:e,attribute:"description",value:e.description}),cover:e.logo?f:"",version:e.version,onButtonClick:null,"data-cy":"install-blocklet",sx:x!=="disable"?{"&:hover, && *":{cursor:"pointer"}}:{"&:after, &:before":{content:'""',opacity:"0 !important"}},onMainClick:x==="disable"?void 0:l,icons:e.docker?.image?[{key:"docker",icon:t.jsx(B,{sx:{display:"flex",color:"primary.main"},children:t.jsx(fe,{icon:Eo})}),title:o("blocklet.dockerImage")}]:[],official:e.isOfficial?{tooltip:o("blocklet.component.isOfficial")}:void 0,download:e.stats.downloads,status:w,button:t.jsx(Zi,{serverVersion:i,requirementVersion:C,size:"small",children:t.jsx("div",{style:{display:"flex",alignItems:"center"},children:t.jsx(Xi,{children:t.jsx(De,{size:"small",disabled:c,variant:"outlined",color:"primary",onClick:_=>{_.preventDefault(),_.stopPropagation();const k=sl(e,a);k&&window.open(k,"_blank","noopener,noreferrer")},children:o("common.detail")},e.did)})})})})}Vo.propTypes={blocklet:g.object.isRequired,blocklets:g.array,handleButtonClick:g.func,endpoint:g.string,serverVersion:g.string};function Yo({handleButtonClick:e=null,handleSearchSelect:r=null,storeUrl:n,handleBlockletRender:a=null,extraFilter:i=void 0,serverVersion:o="",resourceType:f="",resourceDid:c="",showResourcesSwitch:d=!0,showCategory:l=!0,compact:y=!1,...p}){const v=ht(),{locale:x}=de(),[C,w]=E.useState(!1),[_,k]=E.useState({}),u=b=>{k(b)},s=n,m=E.useMemo(()=>qs(v,{palette:{background:{default:v.palette.background.paper}}}),[v]);return E.useEffect(()=>{k({showResources:!0,resourceType:f,resourceDid:c})},[s,f,c]),E.useEffect(()=>{w(!0),k({showResources:!0,resourceType:f,resourceDid:c})},[]),t.jsx($s,{theme:m,children:t.jsx(Ws,{FallbackComponent:Hs,resetKeys:[s],children:t.jsxs(B,{...p,sx:Ks({overflow:"auto",".title-bar + div":{height:"unset"}},p.sx),children:[C&&t.jsx(Yi,{showCategory:l,showResourcesSwitch:d,blockletRender:b=>{const R={...b,handleButtonClick:e,endpoint:s};return a({...b,defaultRender:t.jsx(Vo,{...R})})},compact:y,minItemWidth:300,baseSearch:!0,endpoint:s,locale:x,onFilterChange:u,onSearchSelect:r,filters:_,extraFilter:i,serverVersion:o,fetchCategoryDelay:500}),t.jsx(B,{sx:{mt:2},children:" "})]})})})}Yo.propTypes={storeUrl:g.string.isRequired,handleButtonClick:g.func,handleSearchSelect:g.func,handleBlockletRender:g.func,extraFilter:g.func,serverVersion:g.string,resourceType:g.string,resourceDid:g.string,showResourcesSwitch:g.bool,showCategory:g.bool,compact:g.bool};const al=oe(Qi)`
|
|
169
|
-
.ms-highlight {
|
|
170
|
-
color: ${e=>e.theme.palette.primary.main};
|
|
171
|
-
}
|
|
172
|
-
`;function Zo({ref:e=null,meta:r=null,isMobile:n,onStepChange:a}){const i=ht(),{steps:o,activeStep:f,setActiveStepByKey:c,setActiveStepByIndex:d}=ra(),{t:l,locale:y}=de(),p=o[f];return E.useEffect(()=>{a(f)},[a,f]),E.useImperativeHandle(e,()=>({setActiveStepByKey:c,setActiveStepByIndex:d})),t.jsx(cl,{component:"div",className:n?"mobileStyle":"",sx:{height:"calc(100% - 56px)","&>div>div>div:first-of-type":{flex:{md:1}}},children:t.jsx(oa,{locale:y,blockletMeta:{title:" ",...r},pcWidth:"100%",pcHeight:"100%",logoUrl:r&&r.logo&&r.registryUrl?Ys({did:r.did,version:r.version,baseUrl:r.registryUrl,logoPath:r.logo}):null,theme:i,stepTip:l("blocklet.component.add"),children:t.jsx(ll,{children:typeof p?.body=="function"?p.body():p?.body})})})}Zo.propTypes={ref:g.any,meta:g.any,onStepChange:g.func.isRequired,isMobile:g.bool.isRequired};const Tr=e=>e.isMobile?`
|
|
173
|
-
height: calc(100vh - 56px - 64px - 48px);
|
|
174
|
-
`:"",ll=oe.div`
|
|
175
|
-
width: 100%;
|
|
176
|
-
height: 100%;
|
|
177
|
-
display: flex;
|
|
178
|
-
flex-direction: column;
|
|
179
|
-
justify-content: flex-start;
|
|
180
|
-
align-items: flex-start;
|
|
181
|
-
|
|
182
|
-
.bottom-button {
|
|
183
|
-
min-width: 200px;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
// blocklet-select-side
|
|
187
|
-
aside {
|
|
188
|
-
width: 140px;
|
|
189
|
-
}
|
|
190
|
-
`,cl=oe(B)`
|
|
191
|
-
${({className:e})=>e==="mobileStyle"?`
|
|
192
|
-
& > div{
|
|
193
|
-
height: 100%;
|
|
194
|
-
}
|
|
195
|
-
.root-header {
|
|
196
|
-
.app-name-content {
|
|
197
|
-
display: none;
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
// content-panel
|
|
202
|
-
.root-header + div{
|
|
203
|
-
padding-top: 0;
|
|
204
|
-
position: relative;
|
|
205
|
-
& > div {
|
|
206
|
-
padding-top: 0;
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
header + div {
|
|
211
|
-
padding-top: 0;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
header {
|
|
215
|
-
.header-title {
|
|
216
|
-
margin-left: 0;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
.header-title-name {
|
|
220
|
-
max-width: 100% !important;
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
.app-content {
|
|
224
|
-
padding: 0!important;
|
|
225
|
-
}
|
|
226
|
-
`:`
|
|
227
|
-
position: relative;
|
|
228
|
-
.ll-container { // 通过 Launcher Layout 组件约定的 .ll-container class 自定义 Layout 样式
|
|
229
|
-
width: 100%;
|
|
230
|
-
height: 100%;
|
|
231
|
-
border-radius: 0;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
.root-header {
|
|
235
|
-
z-index: auto !important;
|
|
236
|
-
position: fixed !important;
|
|
237
|
-
}
|
|
238
|
-
& > div {
|
|
239
|
-
height: 100%;
|
|
240
|
-
width: 100%;
|
|
241
|
-
max-width: 100%;
|
|
242
|
-
& > div {
|
|
243
|
-
max-height: unset !important;
|
|
244
|
-
max-width: 100%;
|
|
245
|
-
& > div {
|
|
246
|
-
// left-panel
|
|
247
|
-
&:first-of-type {
|
|
248
|
-
padding: 0;
|
|
249
|
-
width: 20%;
|
|
250
|
-
min-width: 180px;
|
|
251
|
-
|
|
252
|
-
& > div:first-of-type {
|
|
253
|
-
display: none;
|
|
254
|
-
}
|
|
255
|
-
// step
|
|
256
|
-
& > div:last-child {
|
|
257
|
-
// margin-top: 32px;
|
|
258
|
-
margin-top: 0;
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
// right-panel
|
|
262
|
-
&:last-child {
|
|
263
|
-
padding-top: 0;
|
|
264
|
-
padding-right: 0px;
|
|
265
|
-
overflow-y: hidden;
|
|
266
|
-
.app-content {
|
|
267
|
-
padding: 0 0 24px 0;
|
|
268
|
-
}
|
|
269
|
-
.button-container {
|
|
270
|
-
padding-right: 0;
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
`}
|
|
278
|
-
|
|
279
|
-
& .ll-container {
|
|
280
|
-
background: ${({theme:e})=>e.palette.background.paper};
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
& .app-overview {
|
|
284
|
-
margin-left: 0 !important;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
& .flex-justify-center {
|
|
288
|
-
display: flex;
|
|
289
|
-
justify-content: center;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
& .flex-align-center {
|
|
293
|
-
display: flex;
|
|
294
|
-
height: 100%;
|
|
295
|
-
align-items: center;
|
|
296
|
-
${e=>Tr(e)}
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
& .agreement-wrapper {
|
|
300
|
-
${e=>Tr(e)}
|
|
301
|
-
max-height: 60vh;
|
|
302
|
-
.eula-trigger {
|
|
303
|
-
padding-right: 0;
|
|
304
|
-
}
|
|
305
|
-
.next-button {
|
|
306
|
-
display: none;
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
& .connect {
|
|
311
|
-
background: white;
|
|
312
|
-
}
|
|
313
|
-
`,dl=Wn`
|
|
314
|
-
0%, 100% {
|
|
315
|
-
transform: scale(1) translateX(0);
|
|
316
|
-
}
|
|
317
|
-
50% {
|
|
318
|
-
transform: scale(1.05) translateX(-3px);
|
|
319
|
-
}
|
|
320
|
-
25%, 75% {
|
|
321
|
-
transform: scale(1.1) translateX(3px);
|
|
322
|
-
}
|
|
323
|
-
`;function Dt({src:e,alt:r,size:n=20}){return t.jsx("img",{src:e,alt:r,style:{width:n,height:n,display:"block",objectFit:"contain",borderRadius:"2px",flexShrink:0},onError:a=>{a.target.style.display="none"}})}Dt.propTypes={src:g.string.isRequired,alt:g.string.isRequired,size:g.number};const ul=48,pl=8,Ir={PaperProps:{style:{maxHeight:ul*4.5+pl,width:250}}},fl=(e,r,n)=>({fontWeight:r.indexOf(e)===-1?n.typography.fontWeightRegular:n.typography.fontWeightMedium});function Xo({label:e="",disabled:r=!1,required:n=!1,initialValue:a="",onChange:i=()=>{},sx:o={},onSubmit:f=()=>{},triggers:c=[],options:d=[],formatterBeforeSubmit:l=w=>w.join(","),helperText:y="",config:p={},directEditing:v=!1,searchable:x=!0,...C}){const w=ht(),[_,k]=E.useState(v),[u,s]=E.useState(!1),[m,b]=E.useState(""),{multiple:R=!1,labelField:S="name",valueField:M="code"}=p,[F,P]=E.useState(a),[D,I]=E.useState(F),[L,z]=E.useState(!1),[q,K]=E.useState(!1),te=E.useCallback(()=>{K(!0),setTimeout(()=>{K(!1)},500)},[]),re=async()=>{s(!0);try{await f(typeof l=="function"&&R?l(D):D)===!1?I(F):(I(D),P(D),z(!1))}catch{I(F)}finally{s(!1),k(!1)}},N=E.useCallback(()=>{v&&!r&&!u&&re(),L&&te(),!L&&!r&&!u&&(k(!1),z(!1))},[v,r,u,L,te]);E.useEffect(()=>{const h=a;h!==F&&(P(h),I(h),z(!1))},[a,F]);const ie=d.filter(h=>{if(!m)return!0;const j=m.toLowerCase();return h[S]?.toLowerCase().includes(j)||h[M]?.toLowerCase().includes(j)}),U=h=>{let{value:j}=h.target;R&&(j=typeof j=="string"?j.split(","):j),z(j!==D),I(j),i(j)},O=_||v?t.jsxs(Zs,{value:D,onChange:U,fullWidth:!0,multiple:R,variant:"outlined",margin:"dense",onBlur:N,disabled:r,renderValue:h=>{if(R)return t.jsx(B,{sx:{display:"flex",flexWrap:"wrap"},children:h.filter(T=>d.some($=>$[M]===T)).map(T=>t.jsx(cr,{label:d.find($=>$[M]===T)[S],style:{marginRight:8},size:"small"},T))});if(!h)return null;const j=d.find(T=>T[M]===h);return t.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:1},children:[j?.logo&&t.jsx(Dt,{src:j.logo,alt:j[S],size:20}),t.jsx("span",{children:j?j[S]:""})]})},MenuProps:{...Ir,PaperProps:{...Ir.PaperProps}},error:!!y,...C,children:[x?t.jsx(B,{sx:{p:1,borderBottom:1,borderColor:"divider"},children:t.jsx(Ce,{size:"small",placeholder:"Search...",value:m,onChange:h=>b(h.target.value),onClick:h=>h.stopPropagation(),onKeyDown:h=>h.stopPropagation(),fullWidth:!0,variant:"outlined"})}):null,ie.map(h=>t.jsx(Ue,{value:h[M],style:fl(h[M],D,w),children:t.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:1},children:[h.logo&&t.jsx(Dt,{src:h.logo,alt:h[S],size:20}),t.jsx("span",{children:h[S]})]})},h[M]))]}):t.jsx(B,{"data-cy":"schema-form-item-edit",className:"form-item-input slot",style:{whiteSpace:"pre-wrap"},sx:{px:1},onClick:()=>{r||k(!0)},children:R?D.filter(h=>d.some(j=>j[M]===h)).map(h=>t.jsx(cr,{label:d.find(j=>j[M]===h)[S],style:{marginRight:8},size:"small"},h)):D&&d.some(h=>h[M]===D)&&t.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:1},children:[(()=>{const h=d.find(j=>j[M]===D);return h?.logo?t.jsx(Dt,{src:h.logo,alt:h[S],size:20}):null})(),t.jsx("span",{children:d.find(h=>h[M]===D)[S]})]})});return t.jsx(_o,{className:"form",sx:o,children:t.jsxs(B,{className:"form-item",children:[t.jsxs(B,{className:"form-item-label",children:[e,n&&t.jsx(nt,{})]}),t.jsxs(B,{className:"form-item-body",children:[t.jsx(B,{className:"form-item-input",children:O}),t.jsx(B,{className:"form-item-action",style:!_||v?{marginLeft:0}:{},children:_&&!v?t.jsxs(t.Fragment,{children:[L?t.jsx(he,{"data-cy":"schema-form-item-confirm",onClick:re,disabled:r||u,sx:{animation:q?`${dl} 0.5s linear`:"none"},size:"large",children:u?t.jsx(we,{size:24}):t.jsx(Po,{})}):null,t.jsx(he,{"data-cy":"schema-form-item-cancel",onClick:()=>{I(F),k(!1)},disabled:r||u,size:"large",children:t.jsx(po,{})})]}):t.jsx(B,{children:c.length?t.jsx(qi,{triggers:c,disabled:r}):null})})]}),_&&y&&t.jsx(Xs,{error:!0,children:y})]})})}Xo.propTypes={sx:g.object,onSubmit:g.func,onChange:g.func,label:g.string,initialValue:g.string,required:g.bool,disabled:g.bool,triggers:g.array,options:g.array,helperText:g.string,formatterBeforeSubmit:g.func,config:g.object,directEditing:g.bool,searchable:g.bool};const He={};function ml(e){He[e]&&(clearTimeout(He[e]),delete He[e])}async function hl(e,{interval:r=1e3,maxDuration:n=120*1e3,intervalFirst:a=4e3,timerKey:i=""}){He[i]&&clearTimeout(He[i]),await new Promise(c=>setTimeout(c,a));const o=Date.now(),f=async(c,d)=>{try{const l=await e();c(l)}catch(l){Date.now()-o>n?d(l):i?He[i]=setTimeout(()=>f(c,d),r):setTimeout(()=>f(c,d),r)}};return new Promise(f)}function gl(e,{did:r,refresh:n,t:a,providerName:i,values:o,timerKey:f}){return hl(async()=>{const{blocklet:c}=await e.getBlocklet({input:{did:r}}),d=Qs(c,"settings.aigne",{}),{url:l,key:y,provider:p}=d||{},{key:v}=o;if(p==="aigneHub"){if(!l||!y)throw new Error(a("setting.aigne.connectTimeOut",{provider:i}));if(v&&v===y)throw new Error(a("setting.aigne.connectTimeOut",{provider:i}));await n(),clearTimeout(He[`connect-aigne-${r}`])}else{if(!v||v!==y)throw new Error(a("setting.aigne.connectTimeOut",{provider:i}));await n(),clearTimeout(He[`connect-aigne-${r}`])}},{timerKey:f,maxDuration:3*60*1e3})}var ct={},Pt={},Dr;function xl(){if(Dr)return Pt;Dr=1,Object.defineProperty(Pt,"__esModule",{value:!0});const e=ho();let r=Js();r=e.__toESM(r);var n=r.default.create("encrypt","decrypt");return Pt.default=n,Pt}var Bt={exports:{}},Ot={exports:{}},yl=Ot.exports,Br;function Be(){return Br||(Br=1,function(e,r){(function(n,a){e.exports=a()})(yl,function(){var n=n||function(a,i){var o;if(typeof window<"u"&&window.crypto&&(o=window.crypto),typeof self<"u"&&self.crypto&&(o=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(o=globalThis.crypto),!o&&typeof window<"u"&&window.msCrypto&&(o=window.msCrypto),!o&&typeof It<"u"&&It.crypto&&(o=It.crypto),!o&&typeof ei=="function")try{o=go()}catch{}var f=function(){if(o){if(typeof o.getRandomValues=="function")try{return o.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof o.randomBytes=="function")try{return o.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},c=Object.create||function(){function u(){}return function(s){var m;return u.prototype=s,m=new u,u.prototype=null,m}}(),d={},l=d.lib={},y=l.Base=function(){return{extend:function(u){var s=c(this);return u&&s.mixIn(u),(!s.hasOwnProperty("init")||this.init===s.init)&&(s.init=function(){s.$super.init.apply(this,arguments)}),s.init.prototype=s,s.$super=this,s},create:function(){var u=this.extend();return u.init.apply(u,arguments),u},init:function(){},mixIn:function(u){for(var s in u)u.hasOwnProperty(s)&&(this[s]=u[s]);u.hasOwnProperty("toString")&&(this.toString=u.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),p=l.WordArray=y.extend({init:function(u,s){u=this.words=u||[],s!=i?this.sigBytes=s:this.sigBytes=u.length*4},toString:function(u){return(u||x).stringify(this)},concat:function(u){var s=this.words,m=u.words,b=this.sigBytes,R=u.sigBytes;if(this.clamp(),b%4)for(var S=0;S<R;S++){var M=m[S>>>2]>>>24-S%4*8&255;s[b+S>>>2]|=M<<24-(b+S)%4*8}else for(var F=0;F<R;F+=4)s[b+F>>>2]=m[F>>>2];return this.sigBytes+=R,this},clamp:function(){var u=this.words,s=this.sigBytes;u[s>>>2]&=4294967295<<32-s%4*8,u.length=a.ceil(s/4)},clone:function(){var u=y.clone.call(this);return u.words=this.words.slice(0),u},random:function(u){for(var s=[],m=0;m<u;m+=4)s.push(f());return new p.init(s,u)}}),v=d.enc={},x=v.Hex={stringify:function(u){for(var s=u.words,m=u.sigBytes,b=[],R=0;R<m;R++){var S=s[R>>>2]>>>24-R%4*8&255;b.push((S>>>4).toString(16)),b.push((S&15).toString(16))}return b.join("")},parse:function(u){for(var s=u.length,m=[],b=0;b<s;b+=2)m[b>>>3]|=parseInt(u.substr(b,2),16)<<24-b%8*4;return new p.init(m,s/2)}},C=v.Latin1={stringify:function(u){for(var s=u.words,m=u.sigBytes,b=[],R=0;R<m;R++){var S=s[R>>>2]>>>24-R%4*8&255;b.push(String.fromCharCode(S))}return b.join("")},parse:function(u){for(var s=u.length,m=[],b=0;b<s;b++)m[b>>>2]|=(u.charCodeAt(b)&255)<<24-b%4*8;return new p.init(m,s)}},w=v.Utf8={stringify:function(u){try{return decodeURIComponent(escape(C.stringify(u)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(u){return C.parse(unescape(encodeURIComponent(u)))}},_=l.BufferedBlockAlgorithm=y.extend({reset:function(){this._data=new p.init,this._nDataBytes=0},_append:function(u){typeof u=="string"&&(u=w.parse(u)),this._data.concat(u),this._nDataBytes+=u.sigBytes},_process:function(u){var s,m=this._data,b=m.words,R=m.sigBytes,S=this.blockSize,M=S*4,F=R/M;u?F=a.ceil(F):F=a.max((F|0)-this._minBufferSize,0);var P=F*S,D=a.min(P*4,R);if(P){for(var I=0;I<P;I+=S)this._doProcessBlock(b,I);s=b.splice(0,P),m.sigBytes-=D}return new p.init(s,D)},clone:function(){var u=y.clone.call(this);return u._data=this._data.clone(),u},_minBufferSize:0});l.Hasher=_.extend({cfg:y.extend(),init:function(u){this.cfg=this.cfg.extend(u),this.reset()},reset:function(){_.reset.call(this),this._doReset()},update:function(u){return this._append(u),this._process(),this},finalize:function(u){u&&this._append(u);var s=this._doFinalize();return s},blockSize:16,_createHelper:function(u){return function(s,m){return new u.init(m).finalize(s)}},_createHmacHelper:function(u){return function(s,m){return new k.HMAC.init(u,m).finalize(s)}}});var k=d.algo={};return d}(Math);return n})}(Ot)),Ot.exports}var Ut={exports:{}},vl=Ut.exports,Or;function Qo(){return Or||(Or=1,function(e,r){(function(n,a){e.exports=a(Be())})(vl,function(n){return function(){var a=n,i=a.lib,o=i.WordArray,f=a.enc;f.Base64={stringify:function(d){var l=d.words,y=d.sigBytes,p=this._map;d.clamp();for(var v=[],x=0;x<y;x+=3)for(var C=l[x>>>2]>>>24-x%4*8&255,w=l[x+1>>>2]>>>24-(x+1)%4*8&255,_=l[x+2>>>2]>>>24-(x+2)%4*8&255,k=C<<16|w<<8|_,u=0;u<4&&x+u*.75<y;u++)v.push(p.charAt(k>>>6*(3-u)&63));var s=p.charAt(64);if(s)for(;v.length%4;)v.push(s);return v.join("")},parse:function(d){var l=d.length,y=this._map,p=this._reverseMap;if(!p){p=this._reverseMap=[];for(var v=0;v<y.length;v++)p[y.charCodeAt(v)]=v}var x=y.charAt(64);if(x){var C=d.indexOf(x);C!==-1&&(l=C)}return c(d,l,p)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function c(d,l,y){for(var p=[],v=0,x=0;x<l;x++)if(x%4){var C=y[d.charCodeAt(x-1)]<<x%4*2,w=y[d.charCodeAt(x)]>>>6-x%4*2,_=C|w;p[v>>>2]|=_<<24-v%4*8,v++}return o.create(p,v)}}(),n.enc.Base64})}(Ut)),Ut.exports}var Nt={exports:{}},Cl=Nt.exports,Ur;function bl(){return Ur||(Ur=1,function(e,r){(function(n,a){e.exports=a(Be())})(Cl,function(n){return function(a){var i=n,o=i.lib,f=o.WordArray,c=o.Hasher,d=i.algo,l=[];(function(){for(var w=0;w<64;w++)l[w]=a.abs(a.sin(w+1))*4294967296|0})();var y=d.MD5=c.extend({_doReset:function(){this._hash=new f.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(w,_){for(var k=0;k<16;k++){var u=_+k,s=w[u];w[u]=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360}var m=this._hash.words,b=w[_+0],R=w[_+1],S=w[_+2],M=w[_+3],F=w[_+4],P=w[_+5],D=w[_+6],I=w[_+7],L=w[_+8],z=w[_+9],q=w[_+10],K=w[_+11],te=w[_+12],re=w[_+13],N=w[_+14],ie=w[_+15],U=m[0],O=m[1],h=m[2],j=m[3];U=p(U,O,h,j,b,7,l[0]),j=p(j,U,O,h,R,12,l[1]),h=p(h,j,U,O,S,17,l[2]),O=p(O,h,j,U,M,22,l[3]),U=p(U,O,h,j,F,7,l[4]),j=p(j,U,O,h,P,12,l[5]),h=p(h,j,U,O,D,17,l[6]),O=p(O,h,j,U,I,22,l[7]),U=p(U,O,h,j,L,7,l[8]),j=p(j,U,O,h,z,12,l[9]),h=p(h,j,U,O,q,17,l[10]),O=p(O,h,j,U,K,22,l[11]),U=p(U,O,h,j,te,7,l[12]),j=p(j,U,O,h,re,12,l[13]),h=p(h,j,U,O,N,17,l[14]),O=p(O,h,j,U,ie,22,l[15]),U=v(U,O,h,j,R,5,l[16]),j=v(j,U,O,h,D,9,l[17]),h=v(h,j,U,O,K,14,l[18]),O=v(O,h,j,U,b,20,l[19]),U=v(U,O,h,j,P,5,l[20]),j=v(j,U,O,h,q,9,l[21]),h=v(h,j,U,O,ie,14,l[22]),O=v(O,h,j,U,F,20,l[23]),U=v(U,O,h,j,z,5,l[24]),j=v(j,U,O,h,N,9,l[25]),h=v(h,j,U,O,M,14,l[26]),O=v(O,h,j,U,L,20,l[27]),U=v(U,O,h,j,re,5,l[28]),j=v(j,U,O,h,S,9,l[29]),h=v(h,j,U,O,I,14,l[30]),O=v(O,h,j,U,te,20,l[31]),U=x(U,O,h,j,P,4,l[32]),j=x(j,U,O,h,L,11,l[33]),h=x(h,j,U,O,K,16,l[34]),O=x(O,h,j,U,N,23,l[35]),U=x(U,O,h,j,R,4,l[36]),j=x(j,U,O,h,F,11,l[37]),h=x(h,j,U,O,I,16,l[38]),O=x(O,h,j,U,q,23,l[39]),U=x(U,O,h,j,re,4,l[40]),j=x(j,U,O,h,b,11,l[41]),h=x(h,j,U,O,M,16,l[42]),O=x(O,h,j,U,D,23,l[43]),U=x(U,O,h,j,z,4,l[44]),j=x(j,U,O,h,te,11,l[45]),h=x(h,j,U,O,ie,16,l[46]),O=x(O,h,j,U,S,23,l[47]),U=C(U,O,h,j,b,6,l[48]),j=C(j,U,O,h,I,10,l[49]),h=C(h,j,U,O,N,15,l[50]),O=C(O,h,j,U,P,21,l[51]),U=C(U,O,h,j,te,6,l[52]),j=C(j,U,O,h,M,10,l[53]),h=C(h,j,U,O,q,15,l[54]),O=C(O,h,j,U,R,21,l[55]),U=C(U,O,h,j,L,6,l[56]),j=C(j,U,O,h,ie,10,l[57]),h=C(h,j,U,O,D,15,l[58]),O=C(O,h,j,U,re,21,l[59]),U=C(U,O,h,j,F,6,l[60]),j=C(j,U,O,h,K,10,l[61]),h=C(h,j,U,O,S,15,l[62]),O=C(O,h,j,U,z,21,l[63]),m[0]=m[0]+U|0,m[1]=m[1]+O|0,m[2]=m[2]+h|0,m[3]=m[3]+j|0},_doFinalize:function(){var w=this._data,_=w.words,k=this._nDataBytes*8,u=w.sigBytes*8;_[u>>>5]|=128<<24-u%32;var s=a.floor(k/4294967296),m=k;_[(u+64>>>9<<4)+15]=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360,_[(u+64>>>9<<4)+14]=(m<<8|m>>>24)&16711935|(m<<24|m>>>8)&4278255360,w.sigBytes=(_.length+1)*4,this._process();for(var b=this._hash,R=b.words,S=0;S<4;S++){var M=R[S];R[S]=(M<<8|M>>>24)&16711935|(M<<24|M>>>8)&4278255360}return b},clone:function(){var w=c.clone.call(this);return w._hash=this._hash.clone(),w}});function p(w,_,k,u,s,m,b){var R=w+(_&k|~_&u)+s+b;return(R<<m|R>>>32-m)+_}function v(w,_,k,u,s,m,b){var R=w+(_&u|k&~u)+s+b;return(R<<m|R>>>32-m)+_}function x(w,_,k,u,s,m,b){var R=w+(_^k^u)+s+b;return(R<<m|R>>>32-m)+_}function C(w,_,k,u,s,m,b){var R=w+(k^(_|~u))+s+b;return(R<<m|R>>>32-m)+_}i.MD5=c._createHelper(y),i.HmacMD5=c._createHmacHelper(y)}(Math),n.MD5})}(Nt)),Nt.exports}var Lt={exports:{}},At={exports:{}},jl=At.exports,Nr;function wl(){return Nr||(Nr=1,function(e,r){(function(n,a){e.exports=a(Be())})(jl,function(n){return function(){var a=n,i=a.lib,o=i.WordArray,f=i.Hasher,c=a.algo,d=[],l=c.SHA1=f.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(y,p){for(var v=this._hash.words,x=v[0],C=v[1],w=v[2],_=v[3],k=v[4],u=0;u<80;u++){if(u<16)d[u]=y[p+u]|0;else{var s=d[u-3]^d[u-8]^d[u-14]^d[u-16];d[u]=s<<1|s>>>31}var m=(x<<5|x>>>27)+k+d[u];u<20?m+=(C&w|~C&_)+1518500249:u<40?m+=(C^w^_)+1859775393:u<60?m+=(C&w|C&_|w&_)-1894007588:m+=(C^w^_)-899497514,k=_,_=w,w=C<<30|C>>>2,C=x,x=m}v[0]=v[0]+x|0,v[1]=v[1]+C|0,v[2]=v[2]+w|0,v[3]=v[3]+_|0,v[4]=v[4]+k|0},_doFinalize:function(){var y=this._data,p=y.words,v=this._nDataBytes*8,x=y.sigBytes*8;return p[x>>>5]|=128<<24-x%32,p[(x+64>>>9<<4)+14]=Math.floor(v/4294967296),p[(x+64>>>9<<4)+15]=v,y.sigBytes=p.length*4,this._process(),this._hash},clone:function(){var y=f.clone.call(this);return y._hash=this._hash.clone(),y}});a.SHA1=f._createHelper(l),a.HmacSHA1=f._createHmacHelper(l)}(),n.SHA1})}(At)),At.exports}var Mt={exports:{}},_l=Mt.exports,Lr;function Sl(){return Lr||(Lr=1,function(e,r){(function(n,a){e.exports=a(Be())})(_l,function(n){(function(){var a=n,i=a.lib,o=i.Base,f=a.enc,c=f.Utf8,d=a.algo;d.HMAC=o.extend({init:function(l,y){l=this._hasher=new l.init,typeof y=="string"&&(y=c.parse(y));var p=l.blockSize,v=p*4;y.sigBytes>v&&(y=l.finalize(y)),y.clamp();for(var x=this._oKey=y.clone(),C=this._iKey=y.clone(),w=x.words,_=C.words,k=0;k<p;k++)w[k]^=1549556828,_[k]^=909522486;x.sigBytes=C.sigBytes=v,this.reset()},reset:function(){var l=this._hasher;l.reset(),l.update(this._iKey)},update:function(l){return this._hasher.update(l),this},finalize:function(l){var y=this._hasher,p=y.finalize(l);y.reset();var v=y.finalize(this._oKey.clone().concat(p));return v}})})()})}(Mt)),Mt.exports}var El=Lt.exports,Ar;function Jo(){return Ar||(Ar=1,function(e,r){(function(n,a,i){e.exports=a(Be(),wl(),Sl())})(El,function(n){return function(){var a=n,i=a.lib,o=i.Base,f=i.WordArray,c=a.algo,d=c.MD5,l=c.EvpKDF=o.extend({cfg:o.extend({keySize:128/32,hasher:d,iterations:1}),init:function(y){this.cfg=this.cfg.extend(y)},compute:function(y,p){for(var v,x=this.cfg,C=x.hasher.create(),w=f.create(),_=w.words,k=x.keySize,u=x.iterations;_.length<k;){v&&C.update(v),v=C.update(y).finalize(p),C.reset();for(var s=1;s<u;s++)v=C.finalize(v),C.reset();w.concat(v)}return w.sigBytes=k*4,w}});a.EvpKDF=function(y,p,v){return l.create(v).compute(y,p)}}(),n.EvpKDF})}(Lt)),Lt.exports}var zt={exports:{}},kl=zt.exports,Mr;function Rl(){return Mr||(Mr=1,function(e,r){(function(n,a,i){e.exports=a(Be(),Jo())})(kl,function(n){n.lib.Cipher||function(a){var i=n,o=i.lib,f=o.Base,c=o.WordArray,d=o.BufferedBlockAlgorithm,l=i.enc;l.Utf8;var y=l.Base64,p=i.algo,v=p.EvpKDF,x=o.Cipher=d.extend({cfg:f.extend(),createEncryptor:function(P,D){return this.create(this._ENC_XFORM_MODE,P,D)},createDecryptor:function(P,D){return this.create(this._DEC_XFORM_MODE,P,D)},init:function(P,D,I){this.cfg=this.cfg.extend(I),this._xformMode=P,this._key=D,this.reset()},reset:function(){d.reset.call(this),this._doReset()},process:function(P){return this._append(P),this._process()},finalize:function(P){P&&this._append(P);var D=this._doFinalize();return D},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function P(D){return typeof D=="string"?F:R}return function(D){return{encrypt:function(I,L,z){return P(L).encrypt(D,I,L,z)},decrypt:function(I,L,z){return P(L).decrypt(D,I,L,z)}}}}()});o.StreamCipher=x.extend({_doFinalize:function(){var P=this._process(!0);return P},blockSize:1});var C=i.mode={},w=o.BlockCipherMode=f.extend({createEncryptor:function(P,D){return this.Encryptor.create(P,D)},createDecryptor:function(P,D){return this.Decryptor.create(P,D)},init:function(P,D){this._cipher=P,this._iv=D}}),_=C.CBC=function(){var P=w.extend();P.Encryptor=P.extend({processBlock:function(I,L){var z=this._cipher,q=z.blockSize;D.call(this,I,L,q),z.encryptBlock(I,L),this._prevBlock=I.slice(L,L+q)}}),P.Decryptor=P.extend({processBlock:function(I,L){var z=this._cipher,q=z.blockSize,K=I.slice(L,L+q);z.decryptBlock(I,L),D.call(this,I,L,q),this._prevBlock=K}});function D(I,L,z){var q,K=this._iv;K?(q=K,this._iv=a):q=this._prevBlock;for(var te=0;te<z;te++)I[L+te]^=q[te]}return P}(),k=i.pad={},u=k.Pkcs7={pad:function(P,D){for(var I=D*4,L=I-P.sigBytes%I,z=L<<24|L<<16|L<<8|L,q=[],K=0;K<L;K+=4)q.push(z);var te=c.create(q,L);P.concat(te)},unpad:function(P){var D=P.words[P.sigBytes-1>>>2]&255;P.sigBytes-=D}};o.BlockCipher=x.extend({cfg:x.cfg.extend({mode:_,padding:u}),reset:function(){var P;x.reset.call(this);var D=this.cfg,I=D.iv,L=D.mode;this._xformMode==this._ENC_XFORM_MODE?P=L.createEncryptor:(P=L.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==P?this._mode.init(this,I&&I.words):(this._mode=P.call(L,this,I&&I.words),this._mode.__creator=P)},_doProcessBlock:function(P,D){this._mode.processBlock(P,D)},_doFinalize:function(){var P,D=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(D.pad(this._data,this.blockSize),P=this._process(!0)):(P=this._process(!0),D.unpad(P)),P},blockSize:128/32});var s=o.CipherParams=f.extend({init:function(P){this.mixIn(P)},toString:function(P){return(P||this.formatter).stringify(this)}}),m=i.format={},b=m.OpenSSL={stringify:function(P){var D,I=P.ciphertext,L=P.salt;return L?D=c.create([1398893684,1701076831]).concat(L).concat(I):D=I,D.toString(y)},parse:function(P){var D,I=y.parse(P),L=I.words;return L[0]==1398893684&&L[1]==1701076831&&(D=c.create(L.slice(2,4)),L.splice(0,4),I.sigBytes-=16),s.create({ciphertext:I,salt:D})}},R=o.SerializableCipher=f.extend({cfg:f.extend({format:b}),encrypt:function(P,D,I,L){L=this.cfg.extend(L);var z=P.createEncryptor(I,L),q=z.finalize(D),K=z.cfg;return s.create({ciphertext:q,key:I,iv:K.iv,algorithm:P,mode:K.mode,padding:K.padding,blockSize:P.blockSize,formatter:L.format})},decrypt:function(P,D,I,L){L=this.cfg.extend(L),D=this._parse(D,L.format);var z=P.createDecryptor(I,L).finalize(D.ciphertext);return z},_parse:function(P,D){return typeof P=="string"?D.parse(P,this):P}}),S=i.kdf={},M=S.OpenSSL={execute:function(P,D,I,L,z){if(L||(L=c.random(64/8)),z)var q=v.create({keySize:D+I,hasher:z}).compute(P,L);else var q=v.create({keySize:D+I}).compute(P,L);var K=c.create(q.words.slice(D),I*4);return q.sigBytes=D*4,s.create({key:q,iv:K,salt:L})}},F=o.PasswordBasedCipher=R.extend({cfg:R.cfg.extend({kdf:M}),encrypt:function(P,D,I,L){L=this.cfg.extend(L);var z=L.kdf.execute(I,P.keySize,P.ivSize,L.salt,L.hasher);L.iv=z.iv;var q=R.encrypt.call(this,P,D,z.key,L);return q.mixIn(z),q},decrypt:function(P,D,I,L){L=this.cfg.extend(L),D=this._parse(D,L.format);var z=L.kdf.execute(I,P.keySize,P.ivSize,D.salt,L.hasher);L.iv=z.iv;var q=R.decrypt.call(this,P,D,z.key,L);return q}})}()})}(zt)),zt.exports}var Pl=Bt.exports,zr;function Tl(){return zr||(zr=1,function(e,r){(function(n,a,i){e.exports=a(Be(),Qo(),bl(),Jo(),Rl())})(Pl,function(n){return function(){var a=n,i=a.lib,o=i.BlockCipher,f=a.algo,c=[],d=[],l=[],y=[],p=[],v=[],x=[],C=[],w=[],_=[];(function(){for(var s=[],m=0;m<256;m++)m<128?s[m]=m<<1:s[m]=m<<1^283;for(var b=0,R=0,m=0;m<256;m++){var S=R^R<<1^R<<2^R<<3^R<<4;S=S>>>8^S&255^99,c[b]=S,d[S]=b;var M=s[b],F=s[M],P=s[F],D=s[S]*257^S*16843008;l[b]=D<<24|D>>>8,y[b]=D<<16|D>>>16,p[b]=D<<8|D>>>24,v[b]=D;var D=P*16843009^F*65537^M*257^b*16843008;x[S]=D<<24|D>>>8,C[S]=D<<16|D>>>16,w[S]=D<<8|D>>>24,_[S]=D,b?(b=M^s[s[s[P^M]]],R^=s[s[R]]):b=R=1}})();var k=[0,1,2,4,8,16,32,64,128,27,54],u=f.AES=o.extend({_doReset:function(){var s;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var m=this._keyPriorReset=this._key,b=m.words,R=m.sigBytes/4,S=this._nRounds=R+6,M=(S+1)*4,F=this._keySchedule=[],P=0;P<M;P++)P<R?F[P]=b[P]:(s=F[P-1],P%R?R>6&&P%R==4&&(s=c[s>>>24]<<24|c[s>>>16&255]<<16|c[s>>>8&255]<<8|c[s&255]):(s=s<<8|s>>>24,s=c[s>>>24]<<24|c[s>>>16&255]<<16|c[s>>>8&255]<<8|c[s&255],s^=k[P/R|0]<<24),F[P]=F[P-R]^s);for(var D=this._invKeySchedule=[],I=0;I<M;I++){var P=M-I;if(I%4)var s=F[P];else var s=F[P-4];I<4||P<=4?D[I]=s:D[I]=x[c[s>>>24]]^C[c[s>>>16&255]]^w[c[s>>>8&255]]^_[c[s&255]]}}},encryptBlock:function(s,m){this._doCryptBlock(s,m,this._keySchedule,l,y,p,v,c)},decryptBlock:function(s,m){var b=s[m+1];s[m+1]=s[m+3],s[m+3]=b,this._doCryptBlock(s,m,this._invKeySchedule,x,C,w,_,d);var b=s[m+1];s[m+1]=s[m+3],s[m+3]=b},_doCryptBlock:function(s,m,b,R,S,M,F,P){for(var D=this._nRounds,I=s[m]^b[0],L=s[m+1]^b[1],z=s[m+2]^b[2],q=s[m+3]^b[3],K=4,te=1;te<D;te++){var re=R[I>>>24]^S[L>>>16&255]^M[z>>>8&255]^F[q&255]^b[K++],N=R[L>>>24]^S[z>>>16&255]^M[q>>>8&255]^F[I&255]^b[K++],ie=R[z>>>24]^S[q>>>16&255]^M[I>>>8&255]^F[L&255]^b[K++],U=R[q>>>24]^S[I>>>16&255]^M[L>>>8&255]^F[z&255]^b[K++];I=re,L=N,z=ie,q=U}var re=(P[I>>>24]<<24|P[L>>>16&255]<<16|P[z>>>8&255]<<8|P[q&255])^b[K++],N=(P[L>>>24]<<24|P[z>>>16&255]<<16|P[q>>>8&255]<<8|P[I&255])^b[K++],ie=(P[z>>>24]<<24|P[q>>>16&255]<<16|P[I>>>8&255]<<8|P[L&255])^b[K++],U=(P[q>>>24]<<24|P[I>>>16&255]<<16|P[L>>>8&255]<<8|P[z&255])^b[K++];s[m]=re,s[m+1]=N,s[m+2]=ie,s[m+3]=U},keySize:256/32});a.AES=o._createHelper(u)}(),n.AES})}(Bt)),Bt.exports}var Ft={exports:{}},Il=Ft.exports,Fr;function Dl(){return Fr||(Fr=1,function(e,r){(function(n,a){e.exports=a(Be())})(Il,function(n){return n.enc.Latin1})}(Ft)),Ft.exports}var qt={exports:{}},Bl=qt.exports,qr;function Ol(){return qr||(qr=1,function(e,r){(function(n,a){e.exports=a(Be())})(Bl,function(n){return n.enc.Utf8})}(qt)),qt.exports}var $t={exports:{}},Ul=$t.exports,$r;function Nl(){return $r||($r=1,function(e,r){(function(n,a){e.exports=a(Be())})(Ul,function(n){return function(){var a=n,i=a.lib,o=i.WordArray,f=a.enc;f.Utf16=f.Utf16BE={stringify:function(d){for(var l=d.words,y=d.sigBytes,p=[],v=0;v<y;v+=2){var x=l[v>>>2]>>>16-v%4*8&65535;p.push(String.fromCharCode(x))}return p.join("")},parse:function(d){for(var l=d.length,y=[],p=0;p<l;p++)y[p>>>1]|=d.charCodeAt(p)<<16-p%2*16;return o.create(y,l*2)}},f.Utf16LE={stringify:function(d){for(var l=d.words,y=d.sigBytes,p=[],v=0;v<y;v+=2){var x=c(l[v>>>2]>>>16-v%4*8&65535);p.push(String.fromCharCode(x))}return p.join("")},parse:function(d){for(var l=d.length,y=[],p=0;p<l;p++)y[p>>>1]|=c(d.charCodeAt(p)<<16-p%2*16);return o.create(y,l*2)}};function c(d){return d<<8&4278255360|d>>>8&16711935}}(),n.enc.Utf16})}($t)),$t.exports}var Wt={exports:{}},Ll=Wt.exports,Wr;function Al(){return Wr||(Wr=1,function(e,r){(function(n,a){e.exports=a(Be())})(Ll,function(n){return n.enc.Hex})}(Wt)),Wt.exports}var Hr;function Ml(){if(Hr)return ct;Hr=1,Object.defineProperty(ct,"__esModule",{value:!0});const e=ho(),r=xl();let n=Tl();n=e.__toESM(n);let a=Dl();a=e.__toESM(a);let i=Ol();i=e.__toESM(i);let o=Nl();o=e.__toESM(o);let f=Qo();f=e.__toESM(f);let c=Al();c=e.__toESM(c);const d={latin1:a.default,utf8:i.default,hex:c.default,utf16:o.default,base64:f.default};var l=class extends r.default{encrypt(p,v){const x=typeof p=="string"?p:JSON.stringify(p);return n.encrypt(x,v).toString()}decrypt(p,v,x="utf8"){return n.decrypt(p,v).toString(d[x])}},y=new l;return ct.AesCrypter=l,ct.default=y,ct}const zl=!0,Fl=">= 8",ql=">= 0.5 && < 0.9.7",$l=!0,Wl=!0,Hl=">= 0.5",Kl=!0,Gl=!0,Vl=!0,Yl=">= 1 && < 8",Zl="< 8",Xl=!0,Ql=[">= 14.17 && < 15",">= 15.1"],Jl=!0,ec=">= 0.7.12",tc=!0,nc="< 6",rc=!0,oc=">= 0.11.1",sc=">= 0.11.1",ic=">= 0.11.1",ac=">= 0.11.1",lc=">= 0.11.1",cc=">= 0.11.1",dc=!0,uc=">= 8.8",pc=!0,fc=">= 8",mc="< 8",hc=!0,gc=!0,xc=!0,yc=!0,vc=">= 8.5",Cc=">= 1",bc=">= 0.5",jc=!0,wc=!0,_c=!0,Sc=">= 0.11.5 && < 3",Ec=">= 0.9.4",kc=">= 0.9.4",Rc=">= 1.4.1",Pc=">= 0.9.4",Tc=">= 0.9.4",Ic=">= 0.9.4",Dc=!0,Bc=!0,Oc=[">= 0.4 && < 0.7",">= 0.8"],Uc=!0,Nc=">= 0.11.13",Lc=">= 0.11.3 && < 10",Ac=">= 0.11.3",Mc=!0,zc=">= 10",Fc=!0,qc=!0,$c=!0,Wc=">= 1",Hc=!0,Kc=[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],Gc=">= 11.7",Vc=">= 0.5",Yc={assert:zl,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16",async_hooks:Fl,"node:async_hooks":[">= 14.18 && < 15",">= 16"],buffer_ieee754:ql,buffer:$l,"node:buffer":[">= 14.18 && < 15",">= 16"],child_process:Wl,"node:child_process":[">= 14.18 && < 15",">= 16"],cluster:Hl,"node:cluster":[">= 14.18 && < 15",">= 16"],console:Kl,"node:console":[">= 14.18 && < 15",">= 16"],constants:Gl,"node:constants":[">= 14.18 && < 15",">= 16"],crypto:Vl,"node:crypto":[">= 14.18 && < 15",">= 16"],_debug_agent:Yl,_debugger:Zl,dgram:Xl,"node:dgram":[">= 14.18 && < 15",">= 16"],diagnostics_channel:Ql,"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],dns:Jl,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16",domain:ec,"node:domain":[">= 14.18 && < 15",">= 16"],events:tc,"node:events":[">= 14.18 && < 15",">= 16"],freelist:nc,fs:rc,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],_http_agent:oc,"node:_http_agent":[">= 14.18 && < 15",">= 16"],_http_client:sc,"node:_http_client":[">= 14.18 && < 15",">= 16"],_http_common:ic,"node:_http_common":[">= 14.18 && < 15",">= 16"],_http_incoming:ac,"node:_http_incoming":[">= 14.18 && < 15",">= 16"],_http_outgoing:lc,"node:_http_outgoing":[">= 14.18 && < 15",">= 16"],_http_server:cc,"node:_http_server":[">= 14.18 && < 15",">= 16"],http:dc,"node:http":[">= 14.18 && < 15",">= 16"],http2:uc,"node:http2":[">= 14.18 && < 15",">= 16"],https:pc,"node:https":[">= 14.18 && < 15",">= 16"],inspector:fc,"node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],_linklist:mc,module:hc,"node:module":[">= 14.18 && < 15",">= 16"],net:gc,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12",os:xc,"node:os":[">= 14.18 && < 15",">= 16"],path:yc,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16",perf_hooks:vc,"node:perf_hooks":[">= 14.18 && < 15",">= 16"],process:Cc,"node:process":[">= 14.18 && < 15",">= 16"],punycode:bc,"node:punycode":[">= 14.18 && < 15",">= 16"],querystring:jc,"node:querystring":[">= 14.18 && < 15",">= 16"],readline:wc,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17",repl:_c,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],smalloc:Sc,_stream_duplex:Ec,"node:_stream_duplex":[">= 14.18 && < 15",">= 16"],_stream_transform:kc,"node:_stream_transform":[">= 14.18 && < 15",">= 16"],_stream_wrap:Rc,"node:_stream_wrap":[">= 14.18 && < 15",">= 16"],_stream_passthrough:Pc,"node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],_stream_readable:Tc,"node:_stream_readable":[">= 14.18 && < 15",">= 16"],_stream_writable:Ic,"node:_stream_writable":[">= 14.18 && < 15",">= 16"],stream:Dc,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5",string_decoder:Bc,"node:string_decoder":[">= 14.18 && < 15",">= 16"],sys:Oc,"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],timers:Uc,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16",_tls_common:Nc,"node:_tls_common":[">= 14.18 && < 15",">= 16"],_tls_legacy:Lc,_tls_wrap:Ac,"node:_tls_wrap":[">= 14.18 && < 15",">= 16"],tls:Mc,"node:tls":[">= 14.18 && < 15",">= 16"],trace_events:zc,"node:trace_events":[">= 14.18 && < 15",">= 16"],tty:Fc,"node:tty":[">= 14.18 && < 15",">= 16"],url:qc,"node:url":[">= 14.18 && < 15",">= 16"],util:$c,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],v8:Wc,"node:v8":[">= 14.18 && < 15",">= 16"],vm:Hc,"node:vm":[">= 14.18 && < 15",">= 16"],wasi:Kc,"node:wasi":[">= 18.17 && < 19",">= 20"],worker_threads:Gc,"node:worker_threads":[">= 14.18 && < 15",">= 16"],zlib:Vc,"node:zlib":[">= 14.18 && < 15",">= 16"]};var yn,Kr;function Zc(){if(Kr)return yn;Kr=1;var e=ti();function r(o,f){for(var c=o.split("."),d=f.split(" "),l=d.length>1?d[0]:"=",y=(d.length>1?d[1]:d[0]).split("."),p=0;p<3;++p){var v=parseInt(c[p]||0,10),x=parseInt(y[p]||0,10);if(v!==x)return l==="<"?v<x:l===">="?v>=x:!1}return l===">="}function n(o,f){var c=f.split(/ ?&& ?/);if(c.length===0)return!1;for(var d=0;d<c.length;++d)if(!r(o,c[d]))return!1;return!0}function a(o,f){if(typeof f=="boolean")return f;var c=typeof o>"u"?me.versions&&me.versions.node:o;if(typeof c!="string")throw new TypeError(typeof o>"u"?"Unable to determine current node version":"If provided, a valid node version is required");if(f&&typeof f=="object"){for(var d=0;d<f.length;++d)if(n(c,f[d]))return!0;return!1}return n(c,f)}var i=Yc;return yn=function(f,c){return e(i,f)&&a(c,i[f])},yn}var vn,Gr;function Xc(){if(Gr)return vn;Gr=1;var e={},r=xo();return vn=r.homedir||function(){var a=e.HOME,i=e.LOGNAME||e.USER||e.LNAME||e.USERNAME;return me.platform==="win32"?e.USERPROFILE||e.HOMEDRIVE+e.HOMEPATH||a||null:me.platform==="darwin"?a||(i?"/Users/"+i:null):me.platform==="linux"?a||(me.getuid()===0?"/root":i?"/home/"+i:null):a||null},vn}var Cn,Vr;function Qc(){return Vr||(Vr=1,Cn=function(){var e=Error.prepareStackTrace;Error.prepareStackTrace=function(n,a){return a};var r=new Error().stack;return Error.prepareStackTrace=e,r[2].getFileName()}),Cn}var et={exports:{}},Yr;function Jc(){if(Yr)return et.exports;Yr=1;var e=me.platform==="win32",r=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,n={};function a(c){return r.exec(c).slice(1)}n.parse=function(c){if(typeof c!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof c);var d=a(c);if(!d||d.length!==5)throw new TypeError("Invalid path '"+c+"'");return{root:d[1],dir:d[0]===d[1]?d[0]:d[0].slice(0,-1),base:d[2],ext:d[4],name:d[3]}};var i=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,o={};function f(c){return i.exec(c).slice(1)}return o.parse=function(c){if(typeof c!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof c);var d=f(c);if(!d||d.length!==5)throw new TypeError("Invalid path '"+c+"'");return{root:d[1],dir:d[0].slice(0,-1),base:d[2],ext:d[4],name:d[3]}},e?et.exports=n.parse:et.exports=o.parse,et.exports.posix=o.parse,et.exports.win32=n.parse,et.exports}var bn,Zr;function ed(){if(Zr)return bn;Zr=1;var e=en(),r=e.parse||Jc(),n=function(i,o){var f="/";/^([A-Za-z]:)/.test(i)?f="":/^\\\\/.test(i)&&(f="\\\\");for(var c=[i],d=r(i);d.dir!==c[c.length-1];)c.push(d.dir),d=r(d.dir);return c.reduce(function(l,y){return l.concat(o.map(function(p){return e.resolve(f,y,p)}))},[])};return bn=function(i,o,f){var c=o&&o.moduleDirectory?[].concat(o.moduleDirectory):["node_modules"];if(o&&typeof o.paths=="function")return o.paths(f,i,function(){return n(i,c)},o);var d=n(i,c);return o&&o.paths?d.concat(o.paths):d},bn}var jn,Xr;function td(){return Xr||(Xr=1,jn=function(e,r){return r||{}}),jn}var wn,Qr;function nd(){if(Qr)return wn;Qr=1;var e=Zc(),r=tn,n=en(),a=Xc(),i=Qc(),o=ed(),f=td(),c=me.platform!=="win32"&&r.realpathSync&&typeof r.realpathSync.native=="function"?r.realpathSync.native:r.realpathSync,d=a(),l=function(){return[n.join(d,".node_modules"),n.join(d,".node_libraries")]},y=function(k){try{var u=r.statSync(k,{throwIfNoEntry:!1})}catch(s){if(s&&(s.code==="ENOENT"||s.code==="ENOTDIR"))return!1;throw s}return!!u&&(u.isFile()||u.isFIFO())},p=function(k){try{var u=r.statSync(k,{throwIfNoEntry:!1})}catch(s){if(s&&(s.code==="ENOENT"||s.code==="ENOTDIR"))return!1;throw s}return!!u&&u.isDirectory()},v=function(k){try{return c(k)}catch(u){if(u.code!=="ENOENT")throw u}return k},x=function(k,u,s){return s&&s.preserveSymlinks===!1?k(u):u},C=function(k,u){var s=k(u);try{var m=JSON.parse(s);return m}catch{}},w=function(k,u,s){for(var m=o(u,s,k),b=0;b<m.length;b++)m[b]=n.join(m[b],k);return m};return wn=function(k,u){if(typeof k!="string")throw new TypeError("Path must be a string.");var s=f(k,u),m=s.isFile||y,b=s.readFileSync||r.readFileSync,R=s.isDirectory||p,S=s.realpathSync||v,M=s.readPackageSync||C;if(s.readFileSync&&s.readPackageSync)throw new TypeError("`readFileSync` and `readPackageSync` are mutually exclusive.");var F=s.packageIterator,P=s.extensions||[".js"],D=s.includeCoreModules!==!1,I=s.basedir||n.dirname(i()),L=s.filename||I;s.paths=s.paths||l();var z=x(S,n.resolve(I),s);if(/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(k)){var q=n.resolve(z,k);(k==="."||k===".."||k.slice(-1)==="/")&&(q+="/");var K=N(q)||U(q);if(K)return x(S,K,s)}else{if(D&&e(k))return k;var te=O(k,z);if(te)return x(S,te,s)}var re=new Error("Cannot find module '"+k+"' from '"+L+"'");throw re.code="MODULE_NOT_FOUND",re;function N(h){var j=ie(n.dirname(h));if(j&&j.dir&&j.pkg&&s.pathFilter){var T=n.relative(j.dir,h),$=s.pathFilter(j.pkg,h,T);$&&(h=n.resolve(j.dir,$))}if(m(h))return h;for(var V=0;V<P.length;V++){var G=h+P[V];if(m(G))return G}}function ie(h){if(!(h===""||h==="/")&&!(me.platform==="win32"&&/^\w:[/\\]*$/.test(h))&&!/[/\\]node_modules[/\\]*$/.test(h)){var j=n.join(x(S,h,s),"package.json");if(!m(j))return ie(n.dirname(h));var T=M(b,j);return T&&s.packageFilter&&(T=s.packageFilter(T,h)),{pkg:T,dir:h}}}function U(h){var j=n.join(x(S,h,s),"/package.json");if(m(j)){try{var T=M(b,j)}catch{}if(T&&s.packageFilter&&(T=s.packageFilter(T,h)),T&&T.main){if(typeof T.main!="string"){var $=new TypeError("package “"+T.name+"” `main` must be a string");throw $.code="INVALID_PACKAGE_MAIN",$}(T.main==="."||T.main==="./")&&(T.main="index");try{var V=N(n.resolve(h,T.main));if(V)return V;var G=U(n.resolve(h,T.main));if(G)return G}catch{}}}return N(n.join(h,"/index"))}function O(h,j){for(var T=function(){return w(h,j,s)},$=F?F(h,j,T,s):T(),V=0;V<$.length;V++){var G=$[V];if(R(n.dirname(G))){var se=N(G);if(se)return se;var Q=U(G);if(Q)return Q}}}},wn}var _n,Jr;function rd(){return Jr||(Jr=1,_n=nd()),_n}var Sn,eo;function od(){if(eo)return Sn;eo=1;var e={};Sn=i,i.sync=o;var r=tn;function n(f,c){var d=c.pathExt!==void 0?c.pathExt:e.PATHEXT;if(!d||(d=d.split(";"),d.indexOf("")!==-1))return!0;for(var l=0;l<d.length;l++){var y=d[l].toLowerCase();if(y&&f.substr(-y.length).toLowerCase()===y)return!0}return!1}function a(f,c,d){return!f.isSymbolicLink()&&!f.isFile()?!1:n(c,d)}function i(f,c,d){r.stat(f,function(l,y){d(l,l?!1:a(y,f,c))})}function o(f,c){return a(r.statSync(f),f,c)}return Sn}var En,to;function sd(){if(to)return En;to=1,En=r,r.sync=n;var e=tn;function r(o,f,c){e.stat(o,function(d,l){c(d,d?!1:a(l,f))})}function n(o,f){return a(e.statSync(o),f)}function a(o,f){return o.isFile()&&i(o,f)}function i(o,f){var c=o.mode,d=o.uid,l=o.gid,y=f.uid!==void 0?f.uid:me.getuid&&me.getuid(),p=f.gid!==void 0?f.gid:me.getgid&&me.getgid(),v=parseInt("100",8),x=parseInt("010",8),C=parseInt("001",8),w=v|x,_=c&C||c&x&&l===p||c&v&&d===y||c&w&&y===0;return _}return En}var kn,no;function id(){if(no)return kn;no=1;var e;me.platform==="win32"||It.TESTING_WINDOWS?e=od():e=sd(),kn=r,r.sync=n;function r(a,i,o){if(typeof i=="function"&&(o=i,i={}),!o){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(f,c){r(a,i||{},function(d,l){d?c(d):f(l)})})}e(a,i||{},function(f,c){f&&(f.code==="EACCES"||i&&i.ignoreErrors)&&(f=null,c=!1),o(f,c)})}function n(a,i){try{return e.sync(a,i||{})}catch(o){if(i&&i.ignoreErrors||o.code==="EACCES")return!1;throw o}}return kn}var Rn,ro;function ad(){if(ro)return Rn;ro=1;var e={};const r=me.platform==="win32"||e.OSTYPE==="cygwin"||e.OSTYPE==="msys",n=en(),a=r?";":":",i=id(),o=l=>Object.assign(new Error(`not found: ${l}`),{code:"ENOENT"}),f=(l,y)=>{const p=y.colon||a,v=l.match(/\//)||r&&l.match(/\\/)?[""]:[...r?[me.cwd()]:[],...(y.path||e.PATH||"").split(p)],x=r?y.pathExt||e.PATHEXT||".EXE;.CMD;.BAT;.COM":"",C=r?x.split(p):[""];return r&&l.indexOf(".")!==-1&&C[0]!==""&&C.unshift(""),{pathEnv:v,pathExt:C,pathExtExe:x}},c=(l,y,p)=>{typeof y=="function"&&(p=y,y={}),y||(y={});const{pathEnv:v,pathExt:x,pathExtExe:C}=f(l,y),w=[],_=u=>new Promise((s,m)=>{if(u===v.length)return y.all&&w.length?s(w):m(o(l));const b=v[u],R=/^".*"$/.test(b)?b.slice(1,-1):b,S=n.join(R,l),M=!R&&/^\.[\\\/]/.test(l)?l.slice(0,2)+S:S;s(k(M,u,0))}),k=(u,s,m)=>new Promise((b,R)=>{if(m===x.length)return b(_(s+1));const S=x[m];i(u+S,{pathExt:C},(M,F)=>{if(!M&&F)if(y.all)w.push(u+S);else return b(u+S);return b(k(u,s,m+1))})});return p?_(0).then(u=>p(null,u),p):_(0)},d=(l,y)=>{y=y||{};const{pathEnv:p,pathExt:v,pathExtExe:x}=f(l,y),C=[];for(let w=0;w<p.length;w++){const _=p[w],k=/^".*"$/.test(_)?_.slice(1,-1):_,u=n.join(k,l),s=!k&&/^\.[\\\/]/.test(l)?l.slice(0,2)+u:u;for(let m=0;m<v.length;m++){const b=s+v[m];try{if(i.sync(b,{pathExt:x}))if(y.all)C.push(b);else return b}catch{}}}if(y.all&&C.length)return C;if(y.nothrow)return null;throw o(l)};return Rn=c,c.sync=d,Rn}var Pn,oo;function ld(){if(oo)return Pn;oo=1;function e(r){if(!(typeof r>"u"))try{return structuredClone(r)}catch{return JSON.parse(JSON.stringify(r))}}return Pn=e,Pn}var Tn,so;function cd(){if(so)return Tn;so=1;var e={};const{BLOCKLET_MODES:r}=ni(),n=go(),a=Ml().default,i=ri(),o=ii,{dirname:f,join:c,sep:d}=en(),l=rd(),{tmpdir:y,homedir:p}=xo(),v=ad(),{withHttps:x}=oi(),{exec:C}=tn,{promisify:w}=si(),_=ld(),k="z8iZiDFg3vkkrPwsiba1TLXy3H9XHzFERsP8o",u="z8iZjMn7Hcyh93rKf8PqcSM94XnS8nRqSrPoP",s=(h,j,T)=>a.encrypt(h,n.pbkdf2Sync(T,j,256,32,"sha512").toString("hex")),m=(h,j,T)=>a.decrypt(h,n.pbkdf2Sync(T,j,256,32,"sha512").toString("hex")),b=(h,j=!0)=>{let T=h;return Array.isArray(T)&&T.every($=>$.originFileObj&&$.url)&&(T=T.map($=>$.url),T.length===1&&([T]=T)),j&&T&&typeof T=="object"&&(T=JSON.stringify(T)),T&&typeof T=="string"&&(T=T.replace(/(\r\n|\n|\r)/gm," ")),T},R=h=>h.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,""),S=h=>R(dr.from(h).toString("base64")),M=h=>(h+"===".slice((h.length+3)%4)).replace(/-/g,"+").replace(/_/g,"/"),F=h=>new Uint8Array(dr.from(M(h),"base64")),P="v21.6.0",D=()=>i.gte(me.version,P),I=()=>{try{return l("@arcblock/pm2",{basedir:__dirname})}catch{return null}};function L(h){try{return v.sync(h)}catch{return null}}const z=new Map;async function q({optionsKey:h,optionsValues:j}){const T=w(C),$=me.version,V=`${$}.${h}`;if(z.has(V))return z.get(V);try{const{stdout:G}=await T("node -h"),se=j.find(Q=>G.includes(Q));if(!se)throw new Error(`Can not get permission option: ${h} for this Node.js version: ${$}`);return z.set(V,se),se}catch(G){throw console.error(G),G}}const K=async(h,j=!0)=>{const T=e.NODE_OPTIONS??"";if(T.includes("--experimental-permission")||T.includes("--permission")||T.includes("--allow-fs-read")||T.includes("--allow-fs-write")||T.includes("--allow-addons")||T.includes("--allow-child-process")||T.includes("--allow-worker"))throw console.error("getSecurityNodeOptions",{nodeOptions:T}),new Error("process.env.NODE_OPTIONS should not include --experimental-permission or --permission or --allow-fs-read or --allow-fs-write or --allow-addons or --allow-child-process or --allow-worker");if(!h)throw new Error("blocklet is not defined");if(T.includes("ms-vscode.js-debug/src/bootloader.js")&&(h.mode===r.DEVELOPMENT||h.environmentObj.BLOCKLET_MODE===r.DEVELOPMENT))return T;const $=[T].filter(ae=>!!ae&&ae!=="undefined");if(!D()||!j)return $.join(" ").trim();const V=I(),G=L("meilisearch"),se="/data/bin/meilisearch",Q=L("blocklet"),le=[e.XDG_DATA_HOME?c(e.XDG_DATA_HOME,"pnpm/global/"):"",e.PNPM_HOME?c(e.PNPM_HOME,"global/"):""],ve=await q({optionsKey:"--permission",optionsValues:["--permission","--experimental-permission"]});if($.push(ve,...[h.environmentObj.BLOCKLET_DATA_DIR,h.environmentObj.BLOCKLET_APP_DIR,h.environmentObj.BLOCKLET_LOG_DIR,h.environmentObj.BLOCKLET_CACHE_DIR,h.environmentObj.BLOCKLET_APP_DATA_DIR?c(h.environmentObj.BLOCKLET_APP_DATA_DIR,".projects"):"",y()].filter(Boolean).map(ae=>`--allow-fs-write=${c(ae,"/*")}`),"--allow-addons","--allow-child-process"),h.mode===r.DEVELOPMENT||h.environmentObj.BLOCKLET_MODE===r.DEVELOPMENT)$.push("--allow-worker","--allow-fs-read=*"),$.push(`--allow-fs-write=${c(p(),".npm","_logs","/*")}`);else if($.push(...[h.environmentObj.BLOCKLET_LOG_DIR,h.environmentObj.BLOCKLET_CACHE_DIR,h.environmentObj.BLOCKLET_APP_DATA_DIR,f(f(h.environmentObj.BLOCKLET_APP_DIR)),V&&f(f(f(f(V)))),Q,G,se,f(f(me.execPath)),me.cwd(),y(),c(p(),".cursor-server"),"/Applications/Cursor.app",...le].filter(Boolean).filter(ae=>ae!==d).map(ae=>`--allow-fs-read=${c(ae,"/*")}`)),[k,u].includes(h?.environmentObj?.BLOCKLET_COMPONENT_DID)){const ae=await q({optionsKey:"--allow-worker",optionsValues:["--allow-worker","--experimental-worker"]});$.push(ae)}return o($).join(" ").trim()},te={crossOriginEmbedderPolicy:!1,crossOriginOpenerPolicy:!1,crossOriginResourcePolicy:!1,originAgentCluster:!1,strictTransportSecurity:!0,xContentTypeOptions:!0,xDnsPrefetchControl:!1,xDownloadOptions:!1,xPermittedCrossDomainPolicies:!1,contentSecurityPolicy:!1,referrerPolicy:!1,xFrameOptions:!1,xPoweredBy:!0,xXssProtection:!1};function re(h,j,T){const $=_(h[j]||[]);return $.push(...T),[...new Set($)]}async function N(h,{node:j,blocklet:T,trustedDomains:$=[],info:V}){if(!h?.contentSecurityPolicy?.directives)return h;const G=_(h);G.contentSecurityPolicy.directives["default-src"]=re(G.contentSecurityPolicy.directives,"default-src",["'self'"]);const se=V||await j.getNodeInfo({useCache:!0});let Q=await j.getBlockletDomainAliases({blocklet:T,nodeInfo:se});return Q=(Q||[]).map(le=>le.value),G.contentSecurityPolicy.directives["connect-src"]=re(G.contentSecurityPolicy.directives,"connect-src",["'self'",...Q.filter(le=>le).map(le=>`https://${le}/.well-known/ping`),"https://api.simplesvg.com","https://api.iconify.design","https://api.unisvg.com"]),G.contentSecurityPolicy.directives["script-src"]=re(G.contentSecurityPolicy.directives,"script-src",["'self'","https://js.stripe.com"]),G.contentSecurityPolicy.directives["frame-src"]=re(G.contentSecurityPolicy.directives,"frame-src",["'self'","https://js.stripe.com",...$.filter(Boolean).map(le=>`https://${le}`)]),G.contentSecurityPolicy.directives["frame-ancestors"]=re(G.contentSecurityPolicy.directives,"frame-ancestors",["'self'",...(T.settings.userSpaceHosts||[]).map(le=>`https://${le}`),...$.filter(Boolean).map(le=>`https://${le}`)]),G}async function ie(h,{node:j,blocklet:T,info:$}){const V=_(h);if(V?.origin?.smart){const G=[];G.push(...V.origin?.value||[]);const se=$||await j.getNodeInfo({useCache:!0});let Q=await j.getBlockletDomainAliases({blocklet:T,nodeInfo:se});Q=(Q||[]).map(ne=>ne.value),G.push(...Q.map(ne=>x(ne)));const ve=((T.settings.federated||{})?.sites||[]).filter(ne=>ne?.isMaster!==!1||ne.status==="approved"),ae=[];for(const ne of ve)ae.push(new URL(ne.appUrl).hostname),ae.push(...ne.aliasDomain||[]);G.push(...ae.map(ne=>x(ne))),V.origin.value=[...new Set(G)]}return V}function U(h){const j=_(h);for(const T of Object.keys(j))j[T]=j[T]?.value??j[T];return j}function O(h){const j=_(h);for(const T of Object.keys(j))j[T]=j[T]?.override??!1;return j}return Tn={encrypt:s,decrypt:m,formatEnv:b,encodeEncryptionKey:S,decodeEncryptionKey:F,canUseFileSystemIsolateApi:D,getSecurityNodeOptions:K,patchResponseHeader:N,patchCors:ie,cleanConfigOverride:U,keepConfigOverride:O,DEFAULT_HELMET_CONFIG:te,SAFE_NODE_VERSION:P},Tn}var es=cd();const In=(e,r)=>e&&es.encrypt(e,r||H.AIGNE_CONFIG_ENCRYPT_SALT,""),Dn=(e,r)=>e&&es.decrypt(e,r||H.AIGNE_CONFIG_ENCRYPT_SALT,""),ut=e=>e==="aigneHub",Ht=e=>e==="bedrock",dd=e=>{const r=["provider","model"];if(Hn(e))return[...r,"key"];const{provider:n}=e;let a=r;return ut(n)?a=[...r,"key","url"]:Ht(n)?a=[...r,"accessKeyId","secretAccessKey"]:a=[...r,"key"],a.filter(i=>!e[i])},io=e=>{if(Hn(e)||e==="")return"0";const r=typeof e=="string"?parseFloat(e):e;if(Number.isNaN(r))return"0";if(typeof Intl<"u"&&Intl.NumberFormat)return new Intl.NumberFormat("en-US",{minimumFractionDigits:0,maximumFractionDigits:2}).format(r);const n=r.toFixed(2).split("."),a=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),i=parseFloat(n[1])>0?`.${n[1]}`:"";return`${a}${i}`},ud=e=>[{provider:"aigneHub",name:"AIGNE Hub",baseURL:"https://hub.aigne.io",logo:e?.imgPrefix?_e(e.imgPrefix,"/aigne-hub.jpg"):"/aigne-hub.jpg",documentation:"https://hub.aigne.io/docs",models:[]}],Yt="z8ia3xzq2tMq8CRHfaXj1BTYJyYnEcHbqP8cJ",pd=async e=>{const r=new URL(e);if(typeof window<"u"&&r.origin===window.location.origin)return ts();const n=_e(r.origin,"__blocklet__.js?type=json"),a=await Kt.get(n).then(f=>f.data);if((a?.componentId||"").split("/").pop()===Yt)return _e(r.origin,a.prefix||"/");const o=(a?.componentMountPoints||[]).find(f=>f?.did===Yt);return o?_e(r.origin,o.mountPoint):e},ts=()=>{var e,r,n,a;if(typeof window>"u")return"";const i=((e=window.blocklet)===null||e===void 0?void 0:e.prefix)||"/",o=(r=window.location)===null||r===void 0?void 0:r.origin;if((((n=window.blocklet)===null||n===void 0?void 0:n.componentId)||"").split("/").pop()===Yt)return _e(o,i);const c=(((a=window.blocklet)===null||a===void 0?void 0:a.componentMountPoints)||[]).find(d=>d?.did===Yt);return c?_e(o,c.mountPoint):_e(o,i)};async function fd({baseUrl:e="",accessKey:r=""}){let n=ts();const a=typeof window<"u";try{if(e){const i=new URL(e);(!a||a&&i.origin!==window.location.origin)&&(n=await pd(e))}}catch(i){throw console.warn("Failed to parse baseUrl:",i),new Error(`Failed to parse baseUrl: ${xe(i)}`)}if(!n||!r)throw new Error("baseUrl or accessKey is not set");return Kt.get(_e(n,"/api/user/info"),{headers:{Authorization:`Bearer ${r}`}}).then(i=>i.data)}const rn=oe.div`
|
|
324
|
-
min-height: ${({minHeight:e})=>e==="none"?"auto":`${e||160}px`};
|
|
325
|
-
height: ${({height:e,minHeight:r})=>e==="none"?"auto":`${e||r||160}px`};
|
|
326
|
-
padding: ${({theme:e})=>e.spacing(2)};
|
|
327
|
-
border-radius: ${({theme:e})=>e.shape.borderRadius}px;
|
|
328
|
-
border: 1px solid;
|
|
329
|
-
border-color: ${({theme:e})=>e.palette.divider};
|
|
330
|
-
background-color: ${({theme:e})=>e.palette.background.paper};
|
|
331
|
-
box-shadow: ${({theme:e})=>e.shadows[1]};
|
|
332
|
-
`,md={loading:g.bool,authLoading:g.bool,disconnectLoading:g.bool,connecting:g.bool},zn=oe(Xt)`
|
|
333
|
-
color: ${({theme:e})=>e.palette.text.primary};
|
|
334
|
-
font-weight: 500;
|
|
335
|
-
border-color: ${({theme:e})=>e.palette.grey[300]};
|
|
336
|
-
line-height: 1.5;
|
|
337
|
-
&:hover {
|
|
338
|
-
background-color: ${({theme:e})=>ai(e.palette.primary.main,.1)};
|
|
339
|
-
}
|
|
340
|
-
`;function ns({loading:e=!1,user:r=null,switchUser:n=ft,connecting:a=!1,url:i=""}){const{t:o}=E.useContext(Se);return!r&&!e?null:t.jsx(rn,{children:e?t.jsxs(B,{sx:{display:"flex",justifyContent:"center",alignItems:"flex-start",gap:2,height:"100%"},children:[t.jsx(Me,{variant:"circular",width:48,height:48}),t.jsxs(B,{sx:{display:"flex",flexDirection:"column",gap:1,width:"100%"},children:[t.jsx(Me,{variant:"rounded",sx:{width:"80%",height:20}}),t.jsx(Me,{variant:"rounded",sx:{width:"40%",height:20}}),t.jsx(Me,{variant:"rounded",sx:{width:"30%",height:20}}),t.jsx(Me,{variant:"rounded",sx:{width:"60%",height:20}})]})]}):t.jsxs(B,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"flex-start",height:"100%"},children:[t.jsx(li,{size:"large",showDid:!0,showHoverCard:!0,user:r,avatarProps:{size:48},infoType:ur.Minimal,popupInfoType:ur.Basic,sx:{border:"none",p:0},onAvatarClick:()=>{i&&window.open(Gt(_e(i,H.WELLKNOWN_BLOCKLET_USER_PATH),{did:r.did}),"_blank")}}),t.jsx(B,{children:t.jsx(zn,{variant:"outlined",disabled:a,startIcon:a?t.jsx(we,{size:16,sx:{mr:1}}):t.jsx(fe,{style:{fontSize:16},icon:"tabler:switch-horizontal"}),onClick:n,children:o("setting.aigne.switchUser")})})]})})}ns.propTypes={loading:g.bool,user:g.object,switchUser:g.func,url:g.string,...md};function rs({loading:e=!1,credit:r=null,connecting:n=!1,onRefresh:a=()=>{},refreshing:i=!1}){const{t:o}=E.useContext(Se),f=Wn`
|
|
341
|
-
from {
|
|
342
|
-
transform: rotate(0deg);
|
|
343
|
-
}
|
|
344
|
-
to {
|
|
345
|
-
transform: rotate(360deg);
|
|
346
|
-
}
|
|
347
|
-
`,c=E.useMemo(()=>!r?.enableCredit,[r]),d=E.useMemo(()=>Number(r?.creditBalance?.balance)<=0&&Number(r?.creditBalance?.pendingCredit)>0,[r]);if(!r&&!e)return null;const{creditBalance:l,profileLink:y="",paymentLink:p=""}=r||{};return t.jsx(rn,{children:e?t.jsxs(B,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"flex-start",gap:2,height:"100%"},children:[t.jsxs(B,{sx:{width:"100%",display:"flex",flexDirection:"column",gap:1},children:[t.jsx(Me,{variant:"rounded",sx:{width:"80%",height:20}}),t.jsx(Me,{variant:"rounded",sx:{width:"50%",height:20}})]}),t.jsxs(B,{sx:{width:"100%",display:"flex",justifyContent:"space-between",gap:1},children:[t.jsx(Me,{variant:"rounded",sx:{width:"100%",height:20}}),t.jsx(Me,{variant:"rounded",sx:{width:"100%",height:20}})]})]}):t.jsxs(B,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"flex-start",height:"100%",width:"100%"},children:[t.jsxs(B,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[t.jsx(ue,{variant:"body1",children:"AIGNE Hub Credits"}),t.jsxs(ue,{variant:"h2",sx:{color:!c&&d?"error.main":"text.primary"},children:[t.jsx("span",{children:c?o("setting.aigne.infinite"):d?`- ${io(l?.pendingCredit)}`:io(l.balance)}),c?null:t.jsx(be,{title:o("common.refresh"),children:t.jsx(Ia,{sx:{fontSize:14,ml:1,cursor:"pointer",animation:i?`${f} 1s linear infinite`:"none"},onClick:a})})]})]}),c?null:t.jsxs(B,{sx:{width:"100%",display:"flex",gap:1},children:[t.jsx(zn,{fullWidth:!0,variant:"outlined",disabled:n,onClick:()=>{p&&window.open(p,"_blank")},startIcon:t.jsx(fe,{style:{fontSize:16},icon:"tabler:credit-card"}),children:o("setting.aigne.addCredits")}),t.jsx(zn,{fullWidth:!0,disabled:n,onClick:()=>{y&&window.open(Gt(y,{appDid:window.blocklet.appPid}),"_blank")},variant:"outlined",startIcon:t.jsx(fe,{style:{fontSize:16},icon:"hugeicons:transaction"}),children:o("setting.aigne.transaction")})]})]})})}rs.propTypes={loading:g.bool,credit:g.object,connecting:g.bool,onRefresh:g.func,refreshing:g.bool};function os({url:e,apiKey:r,switchUser:n=ft,connecting:a=!1}){const{t:i}=E.useContext(Se),[o,f]=E.useState(!1),{data:c,loading:d,error:l,refresh:y}=ci(()=>fd({baseUrl:e,accessKey:r}),{ready:!!(e&&r),refreshDeps:[e,r],onSuccess:()=>{f(!1)},onError:()=>{f(!1)}}),p=E.useCallback(()=>{d||o||(f(!0),y())},[y,d,o]);return l?null:t.jsxs(B,{children:[t.jsx(ue,{variant:"h5",sx:{fontSize:18,mb:2},children:i("setting.aigne.account")}),t.jsxs(ze,{container:!0,className:"config-container",spacing:2,sx:{width:"100%"},children:[t.jsx(ze,{size:{xs:12,md:6},children:t.jsx(ns,{loading:d&&!o,user:c?.user,switchUser:n,connecting:a,url:e})}),t.jsx(ze,{size:{xs:12,md:6},children:t.jsx(rs,{refreshing:o,loading:d&&!o,credit:c,connecting:a,onRefresh:p})})]})]})}os.propTypes={url:g.string.isRequired,apiKey:g.string.isRequired,connecting:g.bool,switchUser:g.func};function ss({url:e,providerName:r,disconnect:n=ft,disabled:a=!1,loading:i=!1,validationResult:o=""}){const{t:f}=E.useContext(Se),c=E.useMemo(()=>o&&o!=="success",[o]);return t.jsx(rn,{minHeight:80,height:"none",children:t.jsxs(B,{sx:{width:"100%",height:"100%",display:"flex",justifyContent:"flex-start",alignItems:"center",gap:2},children:[c?t.jsx(be,{title:o,children:t.jsx(Zn,{sx:{fontSize:24,color:"error.main",cursor:"pointer",flexShrink:0}})}):t.jsx(Uo,{sx:{fontSize:24,color:"success.main",cursor:"pointer",flexShrink:0}}),t.jsxs(B,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,flex:1,flexWrap:"wrap"},children:[t.jsxs(B,{children:[t.jsx(ue,{variant:"h5",sx:{fontSize:18},children:c?f("setting.aigne.testFailed"):f("setting.aigne.connected",{provider:r})}),t.jsxs(ue,{variant:"body1",sx:{color:"text.secondary",fontSize:14},children:[f("setting.aigne.baseUrl",{provider:r}),": ",e]})]}),t.jsx(Xt,{variant:"outlined",color:"error",startIcon:i?t.jsx(we,{size:16,sx:{mr:1}}):t.jsx(Ji,{}),onClick:n,disabled:a||i,sx:{lineHeight:1.5},children:f("setting.aigne.disconnect")})]})]})})}ss.propTypes={url:g.string.isRequired,providerName:g.string.isRequired,disabled:g.bool,disconnect:g.func,loading:g.bool,validationResult:g.string};function tt({desc:e,docLink:r=null,provider:n="",orientation:a="vertical"}){const{t:i}=E.useContext(Se);return t.jsxs(ue,{variant:"body2",sx:{lineHeight:1.6,color:"text.secondary",fontSize:12,...a==="vertical"&&{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},title:e,children:[e,r&&t.jsx(be,{title:t.jsxs(t.Fragment,{children:[i("setting.aigne.desc.docLink"),r&&t.jsxs(t.Fragment,{children:[":"," ",t.jsx(gt,{href:r,target:"_blank",rel:"noopener noreferrer",sx:{ml:.5},children:n||"documentation"})]})]}),arrow:!0,children:t.jsx(ja,{fontSize:"small",sx:{ml:.25,fontSize:14,cursor:"pointer",verticalAlign:"middle"}})})]})}const Bn={provider:"",model:"",url:"",key:"",accessKeyId:"",testConnection:""};tt.propTypes={desc:g.string.isRequired,docLink:g.string,provider:g.string,orientation:g.oneOf(["vertical","horizontal"])};function is({orientation:e="vertical",hideDivider:r=!1,source:n="dashboard",forceValidate:a=!1},i){const[o,f]=E.useState(!1),[c,d]=E.useState(!1),[l,y]=E.useState(!1),[p,v]=E.useState(!1),{t:x}=E.useContext(Se),C=ye(),{api:w}=C,{did:_,blocklet:k,actions:u}=Ie(),[s,m]=E.useState(!1),b=pr({...Bn}),R=pr({loading:!1,success:!1}),{confirmApi:S,confirmHolder:M}=yo(),F=E.useMemo(()=>`connect-aigne-${_}`,[_]),P=ud(C),D=ea({messageType:"connect-aigne-message",onOpen:()=>f(!0),onClose:()=>f(!1)}),I=E.useMemo(()=>o||c||l||R.loading,[o,c,l,R.loading]),L=We(A=>P.find(J=>J.provider===A)),z=We(A=>L(A)?.models||[]);di(()=>{F&&ml(F)});const q=We(A=>{if(A)return A;const J=P[0]?.provider;return z(J)[0]?.name||"auto"}),K=We(()=>{Object.keys(Bn).forEach(A=>{b[A]=Bn[A]})}),te=Et(()=>{const{aigne:A={}}=k?.settings||{};return A},[k]),re=Et(()=>{const A={...te},J=A?.provider||P[0]?.provider,ee=L(J),ge=ut(J),yt=Ht(J);return{...A,url:fr.getOriginUrl(A?.url||ge&&ee?.baseURL||""),provider:J,model:q(A?.model),key:Dn(A?.key,_),accessKeyId:yt?Dn(A?.accessKeyId,_):A?.accessKeyId,secretAccessKey:yt?Dn(A?.secretAccessKey,_):A?.secretAccessKey}},[k,L,q]),[N,ie]=E.useState(re);E.useEffect(()=>{ie(re)},[re]);const U=E.useMemo(()=>N?.url&&N?.key&&N?.provider==="aigneHub",[N]),O=Et(()=>L(N.provider)?.name||N.provider,[N,L]),h=E.useMemo(()=>dd(N),[N]),j=Et(()=>L(N.provider)?.documentation||"",[N,L]),T=async()=>{try{f(!0);const A=new Set(["running","error"]),J=k.children.filter(ee=>A.has(ee.status)||A.has(ee.greenStatus)).map(ee=>ee.meta.did);await w.restartBlocklet({input:{did:_,componentDids:J}}),u.refreshBlocklet()}catch(A){console.error("error",A),Y.error(xe(A))}finally{f(!1)}},$=(A=!0)=>{if(n!=="setup")return new Promise(J=>{S.open({title:x("setting.aigne.restart.title"),content:A?x("setting.aigne.restart.connectedContent",{provider:O}):x("setting.aigne.restart.notConnectedContent",{provider:O}),confirmButtonText:x("setting.aigne.restart.confirm"),cancelButtonText:x("setting.aigne.restart.cancel"),onConfirm(ee){ee(),T(),J(!0)},onCancel(){J(!1)}})})},V=We(()=>new Promise(A=>{S.open({title:x("setting.aigne.revokeUrlAuthTitle",{url:x("setting.aigne.baseUrl",{provider:O})}),content:x("setting.aigne.revokeUrlAuth",{url:x("setting.aigne.baseUrl",{provider:O})}),confirmButtonText:x("common.confirm"),cancelButtonText:x("common.cancel"),onConfirm(J){J(),A(!0)},onCancel(){A(!1)}})})),G=async(A,J)=>{const ee={};if(ie({...N,[A]:J}),A==="provider"){const ge=z(J);ge.length>0&&(ee.model=ge[0].name),ee.key=""}return U&&A==="url"&&J!==N.url&&(await V()?(ee.key="",ee.validationResult=""):ee.url=N.url),setTimeout(()=>{ie({...N,[A]:J,...ee})},100),m(!0),!0},se=E.useMemo(()=>N.provider,[N.provider]),Q=We(A=>ui(A)?"":x("setting.aigne.invalidUrl",{provider:O})),le=(A=[])=>{const J=h.filter(ge=>!A.includes(ge));if(J.length)return J.forEach(ge=>{b[ge]="required"}),!J.includes("url")&&ut(N.provider)&&(b.url=Q(N.url)),!1;const ee=ut(N.provider)&&Q(N.url);return ee?(b.url=ee,!1):!0},ve=async()=>{try{y(!0),await w.disconnectToAigne({input:{did:_,url:N.url,key:N.key}}),m(!1),Y.success(x("setting.aigne.disconnectSuccess")),setTimeout(()=>{$(!1)},300)}catch(A){console.error("disconnect error:",A),Y.error(xe(A)||x("setting.aigne.disconnectFailed"))}finally{y(!1)}},ae=()=>{S.open({title:x("setting.aigne.disconnect"),content:x("setting.aigne.disconnectConfirm"),confirmButtonText:x("setting.aigne.disconnect"),cancelButtonText:x("common.cancel"),onConfirm(A){A(),ve()}})},ne=async()=>{if(!le())return;K();const A={...N,model:"auto",key:In(N.key,_)};Ht(A.provider)?(A.key="",N.accessKeyId&&(A.accessKeyId=In(N.accessKeyId,_)),N.secretAccessKey&&(A.secretAccessKey=In(N.secretAccessKey,_))):(A.accessKeyId="",A.secretAccessKey="");const J=await w.updateBlockletSettings({input:{did:_,aigne:A}});return u.refreshBlocklet(),J},Ge=async()=>{try{if(!s&&!a)return;f(!0);const A=await ne();return A?(m(!1),Y.success(x("common.saveSuccess")),A):void 0}catch(A){throw console.error("error",A),Y.error(xe(A)||x("setting.aigne.failed")),A}finally{f(!1)}},Ve=async(A=!1)=>{b.testConnection="";try{if(R.loading=!0,!A&&(await ne())?.code!=="ok")return;await w.verifyAigneConnection({input:{did:_}}),Y.success(x("setting.aigne.testSuccess",{provider:O})),R.success=!0}catch(J){throw console.error("error",J),b.testConnection=J.message,Y.error(x("setting.aigne.testFailed")),J}finally{R.loading=!1,u.refreshBlocklet()}},st=async()=>{try{await gl(w,{did:_,refresh:u.refreshBlocklet,t:x,providerName:O,timerKey:F,values:{...te}}).catch(A=>{throw console.error("waitGetConnectedAigne error",A),Y.error(xe(A)),A}).then(()=>Ve(!0).catch(A=>{throw console.error("onVerifyConnection error",A),A})),$(!0)}catch(A){console.error("error",A)}finally{m(!1)}},Ye=()=>{le(["key"])&&(K(),D(async(A,J)=>{try{d(!0);const ee=await w.connectToAigne({input:{did:_,baseUrl:fr.getOriginUrl(N.url||new URL(window.location.origin).origin),provider:N.provider,model:"auto"}});if(!ee?.url){Y.error("failed to connect to endpoint"),d(!1),f(!1);return}J(ee.url),await st(),d(!1)}catch(ee){const ge=xe(ee);Y.error(ge),d(!1)}}))};E.useImperativeHandle(i,()=>({onSubmit:Ge,loading:o||c||l})),z(se);const Ze=se==="aigneHub",sn=()=>{v(!p)},Ee=A=>{A.preventDefault()},xt=E.useMemo(()=>b.url==="required"?x("common.requiredErrorText",{name:x("setting.aigne.baseUrl",{provider:O})}):b.url?b.url:b.key==="required"?x("setting.aigne.apiKeyNotAuthorized",{provider:O}):"",[b.url,b.key,x,O]);return t.jsxs(hd,{source:n,children:[t.jsx(ue,{variant:"h5",sx:{fontSize:18},children:x("setting.aigne.authorizeAigneHub",{name:O})}),U&&N.validationResult?t.jsx(ss,{url:N.url,providerName:O,disconnect:ae,validationResult:N.validationResult,disabled:I,loading:l}):t.jsx(rn,{height:"none",minHeight:"none",children:t.jsxs(B,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:2},children:[t.jsx(lt,{orientation:e,title:x("setting.aigne.baseUrl",{provider:O}),required:ut(N.provider),desc:t.jsx(tt,{desc:x("setting.aigne.desc.baseUrl",{example:"https://hub.aigne.io"})}),children:t.jsx(Rt,{disabled:I,initialValue:N.url||"",directEditing:!0,onSubmit:A=>{G("url",A)},autoFocus:!1,errorTips:xt,InputProps:U?{endAdornment:t.jsx(mr,{position:"end",children:R.loading||c?t.jsx(we,{size:16}):t.jsxs(t.Fragment,{children:[N.validationResult==="success"?t.jsx(be,{title:x("setting.aigne.testSuccess",{provider:O}),children:t.jsx(Uo,{sx:{fontSize:16,color:"success.main",cursor:"pointer"}})}):null,N.validationResult&&N.validationResult!=="success"?t.jsx(be,{title:N.validationResult,children:t.jsx(Zn,{sx:{fontSize:16,color:"error.main",cursor:"pointer"}})}):null,N.validationResult?null:t.jsx(he,{"aria-label":"test connection",onClick:Ve,edge:"end",children:R.loading?t.jsx(we,{size:16}):t.jsx(be,{title:x("setting.aigne.testConnection",{provider:O}),children:t.jsx(fe,{style:{fontSize:16},icon:"tabler:location-check"})})})]})})}:{}})}),t.jsx(Xt,{variant:"contained",onClick:Ye,startIcon:c?t.jsx(we,{size:16,sx:{mr:1}}):t.jsx(Jt,{}),disabled:I||!N.url,sx:{flexShrink:0},children:x("setting.aigne.authorizeAigneHub",{name:"AIGNE Hub"})})]})}),t.jsxs(ze,{container:!0,className:"config-container",spacing:2,sx:{display:"none"},children:[t.jsx(ze,{size:{xs:12,md:4},children:t.jsx(lt,{orientation:e,title:x("setting.aigne.modelAdapter"),required:!0,desc:t.jsx(tt,{desc:x("setting.aigne.desc.modelAdapter")}),children:t.jsx(Xo,{disabled:I,options:P,config:{multiple:!1,labelField:"name",valueField:"provider"},initialValue:N.provider,directEditing:!0,searchable:!1,helperText:b.provider==="required"?x("common.requiredErrorText",{name:x("setting.aigne.modelAdapter")}):b.provider,onChange:A=>G("provider",A)})})}),null,Ze?null:t.jsx(t.Fragment,{children:Ht(N.provider)?t.jsxs(t.Fragment,{children:[t.jsx(lt,{orientation:e,title:"Access Key ID",required:!0,desc:t.jsx(tt,{desc:x("setting.aigne.desc.accessKeyId"),docLink:j,provider:O}),children:t.jsx(Rt,{disabled:I,initialValue:N.accessKeyId||"",type:p?"text":"password",onChange:A=>G("accessKeyId",A),directEditing:!0,autoFocus:!1})}),!r&&t.jsx(B,{className:"config-form",component:pi,sx:{my:3}}),t.jsx(lt,{orientation:e,title:"Secret Access Key",required:!0,desc:t.jsx(tt,{desc:x("setting.aigne.desc.secretAccessKey"),docLink:j,provider:O}),children:t.jsx(Rt,{disabled:I,initialValue:N.secretAccessKey||"",type:p?"text":"password",onChange:A=>G("secretAccessKey",A),directEditing:!0,autoFocus:!1})})]}):t.jsx(lt,{orientation:e,title:"API Key",required:!0,desc:t.jsx(tt,{desc:x("setting.aigne.desc.key",{provider:O}),docLink:j,provider:O}),children:t.jsx(Rt,{disabled:I,initialValue:N.key||"",type:p?"text":"password",onChange:A=>G("key",A),directEditing:!0,autoFocus:!1,InputProps:{endAdornment:t.jsx(mr,{position:"end",children:t.jsx(he,{"aria-label":"toggle password visibility",onClick:sn,onMouseDown:Ee,edge:"end",children:p?t.jsx(Na,{}):t.jsx(La,{})})})}})})})]}),U&&N.validationResult==="success"?t.jsx(os,{switchUser:Ye,url:N.url||"",apiKey:N.key||"",connecting:c||l}):null,n!=="setup"&&t.jsxs(ue,{sx:{fontSize:12,color:"text.secondary",mt:3,fontStyle:"italic"},children:["* ",x("setting.aigne.description",{name:X.getDisplayName(k,!0)})]}),M]})}is.propTypes={orientation:g.oneOf(["vertical","horizontal"]),hideDivider:g.bool,source:g.oneOf(["dashboard","setup"]),forceValidate:g.bool};const hd=oe.div`
|
|
348
|
-
max-width: 920px;
|
|
349
|
-
display: flex;
|
|
350
|
-
flex-direction: column;
|
|
351
|
-
gap: 16px;
|
|
352
|
-
.section-title {
|
|
353
|
-
line-height: 1.2 !important;
|
|
354
|
-
font-weight: ${({source:e})=>e==="setup"?"400":"500"};
|
|
355
|
-
color: ${({theme:e,source:r})=>r==="setup"?e.palette.text.secondary:e.palette.text.primary};
|
|
356
|
-
font-size: ${({source:e})=>e==="setup"?"14px":"16px"};
|
|
357
|
-
}
|
|
358
|
-
.section-left {
|
|
359
|
-
width: 100%;
|
|
360
|
-
}
|
|
361
|
-
.form-item {
|
|
362
|
-
margin-bottom: 0 !important;
|
|
363
|
-
margin-top: 0 !important;
|
|
364
|
-
}
|
|
365
|
-
`,gd=E.forwardRef(is),xd=(e,r)=>(e?.children||[]).find(n=>n.mountPoint===r)?.meta,yd=e=>e.inStore&&X.isFreeBlocklet(e)===!1,vd=e=>[je.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,je.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes(e?.capabilities?.didSpace),On=e=>e?.configs?.find(r=>r.key===je.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT)?.value||null,Cd=e=>(e.environments||[]).some(r=>r.required),ao=(e,r)=>e?.some(n=>n.required&&!r[n.key]),bd=({params:e,blocklet:r,t:n})=>{const a=e.title||e.name;return a?(r?.children||[]).find(o=>o.meta.bundleDid===e.bundleDid)?n("blocklet.component.upgradeNext",{name:a}):n("blocklet.component.addNext",{name:a}):n("common.next")},lo=({componentDid:e,timeout:r=1e3,manual:n=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:e,manual:n},"*")},r)},jd=e=>e?.store?e.store:e?.url||"";function as({onClose:e=()=>{},mode:r="normal",stores:n=[],resourceType:a="",resourceDid:i="",storageKey:o="",inDialog:f=!0,selectedMeta:c=null,storeUrl:d="",showResourcesSwitch:l=!0,showFromUrl:y=!0,enableRunBackground:p=!0,showCategory:v=!0,installFromUrlParams:x=null}){const{t:C,locale:w}=de(),[_,k]=E.useState(!1),[u,s]=E.useState(null),[m,b]=E.useState(""),[R,S]=E.useState(""),{api:M,ws:{useSubscription:F},inService:P,info:D}=ye(),{blocklet:I,actions:{refreshBlocklet:L}}=Ie(),[z,q]=E.useState(null),[K,te]=E.useState(!1),re={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceIsRequiredSetup:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1,isUpload:!1,upgradeDid:""},[N,ie]=E.useState(re),[U,O]=E.useState(0),h=E.useRef({}),j=E.useRef({}),T=E.useRef({}),$=vo(W=>W.breakpoints.down("md")),V=fi(),[G,se]=E.useState(!0),{meta:Q}=h.current,le=fa(Q),ve=E.useRef(!1),ae=E.useRef(null),ne=W=>ie(Z=>({...Z,...W}));E.useEffect(()=>{if(N.pathPrefix){const{errMsg:W}=J({...N,pathPrefix:N.pathPrefix,locale:w});b(W)}},[N.pathPrefix]),E.useEffect(()=>{U===0&&ie(re)},[U]);const Ge=()=>{const W=On(I)??"";ne({didSpaceEndpoint:W})},Ve=()=>h?.current?.meta?X.getDisplayName(h.current):"",st=()=>{k(!1),ie({}),ve.current=!1,h.current={},e()},Ye=W=>{const Z=ce=>{ne({installResultProps:{variant:"error",title:Ve(),subTitle:W,footer:t.jsx(De,{className:"bottom-button",disabled:ce,"data-cy":"retry-install-component",onClick:async()=>{Z(!0),await A(h.current.installInput)},children:t.jsxs(B,{sx:{display:"flex",alignItems:"center"},children:[ce&&t.jsx(we,{size:16,style:{marginRight:8}}),C("common.retry")]})})}})};Z()},Ze=W=>Z=>{(Z?.meta?.did||Z?.meta)===I?.meta?.did&&W(Z)},sn=()=>{lo({timeout:0,componentDid:V.componentDid,manual:!0}),st(),setTimeout(()=>{const W=document.getElementsByClassName("dashboard-main")[0];W&&(W.scrollTop=W.scrollHeight)},200)};F(je.BlockletEvents.componentInstalled,Ze(()=>{ne({installResultProps:{variant:"success",title:Ve(),subTitle:C("blocklet.component.installSuccessTip")}}),lo({componentDid:V.componentDid})}),[I?.meta?.did]),F(je.BlockletEvents.statusChange,Ze(()=>{const W=On(I);ne(Z=>({...Z,didSpaceEndpoint:W}))}),[I?.meta?.did]),F(je.BlockletEvents.downloadFailed,Ze(()=>{ve.current=!1,Ye(C("blocklet.component.installComponentError"))}),[I?.meta?.did]),F(je.BlockletEvents.installFailed,Ze(()=>{ve.current=!1,Ye(C("blocklet.component.installComponentError"))}),[I?.meta?.did]);const Ee=[],xt=W=>(I?.children||[]).find(Z=>Z.meta.did===W),A=async W=>{ve.current=!0;const{pathPrefix:Z,bundleDid:ce,title:pe,componentName:Pe="",componentDid:Fe=""}=N,Ke=h.current?.meta||{},{configs:Xe=[],registryUrl:Oe,inStore:Qe,inputUrl:it,dist:ln}=Ke,vt=h.current?.downloadTokenList,Ct=it||(Qe?hr(Oe,ce,ln):"");k(!0);const ke={rootDid:I.meta.did,url:Ct,mountPoint:Z?Ne.urlPathFriendly(Z):`/${Ne.urlPathFriendly(Ke.title||Ke.name)}`,title:pe,name:Pe,did:N.isUpload&&N.upgradeDid?N.upgradeDid:Fe,dist:{tarball:"",integrity:""},onlyRequired:!G,...N.hasEnvironmentsStep&&Xe.length>0?{configs:Xe.map(Ae=>({...Ae,value:N.configsValue[Ae.key]||""}))}:{},...vt?{downloadTokenList:vt}:{},...W};try{if(await M.installComponent({input:ke}),Oe){const{teamDid:Ae,storeList:qe}=fo({fromBlocklet:P,nodeInfo:D,blocklet:I}),{isNew:at,decoded:bt}=gi(Oe,qe);at&&M.addBlockletStore({input:{teamDid:Ae,url:bt}}).catch(cn=>{console.error("addBlockletStore error: ",cn)})}ne({installResultProps:{}}),L({showError:!1,attachRuntimeInfo:!1})}catch(Ae){const qe=xe(Ae);Y.error(qe),console.error("installComponent error: ",Ae),Ye(qe)}finally{k(!1),h.current.installInput=ke}},J=W=>{const Z=Io({params:{...W,did:W.bundleDid},blocklets:[I],blocklet:I,locale:w,isUpload:N.isUpload});let ce=Z;const pe=xd(I,N.pathPrefix);if(Z==="overwrite"&&pe&&pe.did!==W.bundleDid?(ne({upgradeDid:pe.did}),ce=""):(ne({upgradeDid:""}),ce=Z),ce){const Pe=xt(W.bundleDid),Fe=va({params:{...W,did:W.bundleDid},blocklet:I});if(Pe&&Pe.mountPoint===Fe)return{errMsg:""}}return{errMsg:ce}},ee=async W=>{const{errMsg:Z}=J({...N,locale:w});b(Z),U===Ee.length-2&&!ve.current&&await A(W),j.current?.setActiveStepByIndex?.(ce=>ce+1)},ge=()=>{j.current?.setActiveStepByIndex?.(W=>W-1)},yt=()=>{const{pathPrefix:W,bundleDid:Z,title:ce,componentName:pe="",componentDid:Pe=""}=N,{meta:Fe={}}=h.current||{},{registryUrl:Ke,inStore:Xe,inputUrl:Oe,dist:Qe}=Fe,it=Xe?hr(Ke,Z,Qe):Oe;q({meta:Fe,installOpts:{type:"component",rootDid:I.meta.did,mountPoint:W,url:it,title:ce,name:pe,did:Pe}})},ar=W=>{te(!1),ne({purchaseResultProps:{variant:"error",title:Ve(),subTitle:W,style:{paddingTop:120},footer:t.jsx(De,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{ne({purchaseResultProps:{}})},children:C("common.retry")})}})},bs=({downloadTokenList:W})=>{h.current.downloadTokenList=W,te(!1),ee()},an=({chooseParams:W=h.current,componentDid:Z,isInit:ce=!1,isUpload:pe=!1})=>{const{meta:Pe,registryUrl:Fe,inStore:Ke,inputUrl:Xe}=W,{did:Oe,title:Qe,name:it}=Pe,ln=(I.settings?.children||[]).filter(Te=>Te.status==="deleted"&&Te.meta.bundleDid===Oe),vt=Z||"",Ct=Pe.environments?.map(Te=>{const{name:dn,validation:jt,...wt}=Te,un={validation:Hn(jt)?"":jt};return{...wt,key:dn,...un}});h.current={...W,meta:{...Pe,configs:Ct,registryUrl:Fe,inStore:Ke,inputUrl:Xe}};let ke={};if(ce){const Te=[I],dn=Ct||[],jt=[],wt=mo(hi([...dn,...jt]),"key").filter(Je=>!!Je.key).sort((Je,_t)=>Je.required&&!_t.required?-1:_t.required&&!Je.required?1:0),un=X.getSharedConfigObj(Te[0],{configs:wt}),pn={},lr=wt.map(Je=>{const{default:_t,key:St,...Ss}=Je;return pn[St]=un[St]||_t,{...Ss,key:St,hidden:!!je.BLOCKLET_CONFIGURABLE_KEY[St]}});ke={...ke,configsList:lr,configsValue:pn,hasMissRequiredConfigs:ao(lr,pn)}}const Ae=I.children.some(Te=>Te.mountPoint==="/"),qe=ln.find(Te=>Te.meta.bundleDid===Oe),at=I.children.find(Te=>Te.meta.bundleDid===Oe);ke.title=Qe||"",qe?ke={...ke,pathPrefix:qe.mountPoint||"",componentName:qe.meta.name,hasEnvironmentsStep:!1}:at?ke={...ke,pathPrefix:at.mountPoint||"",componentName:at.meta.name,hasEnvironmentsStep:!1}:ke={...ke,pathPrefix:Ae?`/${Ne.urlPathFriendly(Qe)||Ne.urlPathFriendly(it)}`.toLowerCase():"/",componentName:"",hasEnvironmentsStep:h.current.meta?.environments?.length>0};const bt=yd(h.current.meta),cn=vd(h.current.meta),_s=On(I);ne({bundleDid:Oe,componentDid:vt,...ke,hasRequiredEnvironments:Cd(h.current.meta),requirePurchase:bt,didSpaceIsRequiredSetup:cn,didSpaceEndpoint:_s,isUpload:pe}),ce&&bt&&yt()},js=async()=>{if(!ae.current.loading)try{k(!0),await ae.current.onSubmit()&&ee()}catch(W){console.error("error",W)}finally{k(!1)}};E.useEffect(()=>{if(!c&&!x?.meta||U!==0||!I)return;const{meta:W,inputUrl:Z="",inStore:ce=!0,registryUrl:pe="",isUpload:Pe=!1}=x||{};an({chooseParams:{blocklets:[c||W],meta:c||W,registryUrl:pe||d||jd(c?.bundleSource),inStore:ce,inputUrl:Z},isInit:!0,isUpload:Pe}),ne({showFromUrlDialog:!1}),ee()},[c,U,I,x]),Ee.push({key:"selectComponent",name:C("blocklet.component.selectComponent"),body:t.jsxs($e,{sx:{width:400,display:"flex",flexDirection:"column"},component:"div",children:[y&&N.showFromUrlDialog&&t.jsx(To,{mode:"component",onCancel:()=>{ne({showFromUrlDialog:!1})},onSuccess:({meta:W,inputUrl:Z,inStore:ce,registryUrl:pe})=>{an({chooseParams:{meta:W,inputUrl:Z,inStore:ce,registryUrl:pe},isInit:!0}),ne({showFromUrlDialog:!1}),ee()},handleText:{title:C("blocklet.component.addComponentTip.fromUrl"),confirm:C("blocklet.component.choose")}}),t.jsx(Go,{stores:n,extra:So.isInServerlessMode(D)?null:y?t.jsxs(De,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{ne({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[t.jsx(Jt,{style:{fontSize:20,marginRight:4}}),C("blocklet.component.addComponentTip.fromUrl")]}):null,loading:_,onChange:()=>{ie({}),h.current={}},storageKey:o,children:({currentRegistry:W})=>t.jsx(Yo,{showResourcesSwitch:l,showCategory:v,serverVersion:D?.version,compact:!0,style:{flex:1,overflow:"hidden",height:"100%"},storeUrl:W.url,resourceType:a,resourceDid:i,handleButtonClick:Z=>{an({chooseParams:{...Z,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:Z,defaultRender:ce})=>{const pe=N?.bundleDid&&N?.bundleDid===Z?.did;return t.jsxs(_d,{children:[t.jsx(B,{className:pe?"choose-blocklet":"",sx:{"& > div":{position:"relative","&:before, &:after":{content:'""',position:"absolute",width:"0",height:"0",opacity:0,transition:"width 0.3s, height 0.3s, opacity 0.3s",borderRadius:"8px",pointerEvents:"none",...pe?{width:"100%",height:"100%",opacity:1}:{}},"&:before":{top:0,left:0,borderTop:"1px solid",borderLeft:"1px solid",borderColor:"primary.main"},"&:after":{bottom:0,right:0,borderBottom:"1px solid",borderRight:"1px solid",borderColor:"primary.main"},"&:hover":{"&:before, &:after":{width:"100%",height:"100%",opacity:1}}}},style:{marginLeft:16},children:ce}),pe&&t.jsx(B,{className:"check-container",children:t.jsx(mi,{className:"check-icon"})})]})}})})]}),cancel:r==="embed"?void 0:C("common.cancel"),confirm:bd({params:N,blocklet:I,t:C}),onCancel:st,onConfirm:()=>{ee()}}),Ee.push({key:"agreement",name:C("launchBlocklet.introduction"),body:t.jsxs($e,{component:"div",className:"agreement-wrapper",children:[t.jsx(An,{title:C("launchBlocklet.introduction"),subTitle:C("blocklet.component.addComponentTip.introduction")}),Q?t.jsx(ma,{meta:Q,onClickNext:ee,installRelated:G,onChangeInstallRelated:se,handleDescEle:t.jsx("p",{children:C("blocklet.component.addComponentTip.belowInformation")})}):null]}),cancel:c?void 0:C("common.pre"),disabled:!le,confirm:C(le?"launchBlocklet.next":"launchBlocklet.canNotInstall"),onCancel:c?st:ge,onConfirm:()=>{te(!1),ee()}}),Q&&N.requirePurchase&&Ee.push({key:"purchase",name:t.jsxs(t.Fragment,{children:[C("common.verifyNFT"),t.jsx(nt,{})]}),body:t.jsxs($e,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(T.current?.getCurrentStep?.()===2||K)&&t.jsx(Tt,{title:C("common.verifyNFT"),subTitle:C("blocklet.component.addComponentTip.verifyNFT")}),kt(N.purchaseResultProps)?z&&t.jsx(Wo,{ref:T,meta:z.meta,mode:N.componentDid?"verify":"both",onCancel:ar,installOpts:z.installOpts,handlePaySuccess:bs}):t.jsx("div",{className:"flex-align-center flex-justify-center",children:t.jsx(br,{...N.purchaseResultProps})})]}),disabled:T.current?.getCurrentStep?.()===2||K,cancel:C("common.pre"),confirm:C("common.next"),onConfirm:()=>{typeof T.current.onNext=="function"&&(T.current.onNext(),te(!0))},onCancel:()=>{ge()}}),X.hasStartEngine(Q)&&ko.hasMountPoint(Q)?Ee.push({key:"config",name:C("common.config"),error:m,body:t.jsxs($e,{component:"div",children:[t.jsx(Tt,{title:C("common.config"),subTitle:C("blocklet.component.addComponentTip.config")}),t.jsx(Ce,{label:C("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",fullWidth:!0,helperText:R||C("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:N.pathPrefix,onChange:W=>{const Z=W.target.value;ne({pathPrefix:Z}),S(C("common.slugifyHint",{value:Kn(Z)}))},slotProps:{htmlInput:{"data-cy":"mount-point-input"}}}),!!m&&t.jsx(Un,{severity:"error",style:{width:"100%",marginTop:8},children:m})]}),cancel:C("common.pre"),confirm:C("common.next"),onCancel:ge,onConfirm:()=>{ee()}}):Q&&(N.pathPrefix=Q.interfaces?.[0]?.path||`/${Q.did}`),Q&&Q?.requirements?.aigne&&Ee.push({key:"aigne",name:t.jsxs(ue,{component:"div",title:C("setting.aigne.config"),sx:{whiteSpace:"break-spaces"},children:[C("setting.aigne.config")," ",t.jsx(nt,{})]}),body:()=>t.jsxs($e,{component:"div",className:"aigne-config-wrapper",children:[t.jsx(An,{title:C("setting.aigne.config")}),t.jsx(B,{className:"form-container",sx:{"> div":{maxWidth:"unset",width:"100%"}},children:t.jsx(gd,{orientation:"vertical",hideSubmitButton:!0,hideDivider:!0,source:"setup",forceValidate:!0,ref:ae})})]}),cancel:C("common.pre"),confirm:C("common.next"),onCancel:()=>{ae.current.loading||ge()},onConfirm:js,loading:_||ae.current?.loading,disabled:_||ae.current?.loading}),Q&&N?.hasEnvironmentsStep&&Ee.push({key:"environment",name:t.jsxs(t.Fragment,{children:[C("common.environment")," ",N.hasRequiredEnvironments&&t.jsx(nt,{})]}),disabled:!!u||N?.hasMissRequiredConfigs,body:()=>t.jsxs($e,{component:"div",style:{overflowY:"auto"},children:[t.jsx(Tt,{title:C("common.environment"),subTitle:C("blocklet.component.addComponentTip.environment")}),t.jsx(qo,{style:{marginTop:-12,width:"100%"},schema:N.configsList,defaultValue:N.configsValue,onChange:(W,{action:Z,currentItem:ce,allValues:pe})=>{Z==="confirm"&&ne({hasMissRequiredConfigs:ao(N.configsList,pe),configsValue:pe}),Z==="edit"?s(ce):["cancel","confirm"].includes(Z)&&s(null)}})]}),cancel:C("common.pre"),confirm:C("common.next"),onCancel:ge,onConfirm:ee}),Q&&N?.didSpaceIsRequiredSetup&&Ee.push({key:"didSpace",name:t.jsxs(t.Fragment,{children:[C("blocklet.component.didSpaceConfig")," ",N.didSpaceIsRequiredSetup==="required"&&t.jsx(nt,{})]}),disabled:N?.didSpaceIsRequiredSetup&&!N.didSpaceEndpoint,body:()=>t.jsx(ua,{children:t.jsxs($e,{component:"div",children:[t.jsx(Tt,{title:C("blocklet.component.didSpaceConfig"),subTitle:C("blocklet.component.didSpaceConfigTip")}),t.jsx(B,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:t.jsx(Ko,{blockletMeta:h.current.meta,onNext:()=>{ee()},onEndpointUpdate:Ge})})]})}),cancel:C("common.pre"),confirm:C("common.next"),onCancel:ge,onConfirm:ee}),Ee.push({key:"install",name:xt(Q?.did)?C("common.upgrade"):C("common.install"),disabled:p?!1:kt(N.installResultProps),loading:p?!1:kt(N.installResultProps),body:t.jsx($e,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:kt(N.installResultProps)?t.jsx(sa,{message:t.jsx(Sd,{children:C(p?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):t.jsx("div",{style:{marginTop:120},children:t.jsx(br,{...N.installResultProps})})}),confirm:C("common.complete"),onConfirm:sn});const Re=Ee[U]||{},ws=()=>_||Re.error||!N.bundleDid?!0:U>1?!N.pathPrefix:!1;return I?t.jsxs(wd,{sx:f?{height:{xs:"calc(100vh - 72px - 32px)",md:"72vh"},"&& .ll-header":{p:3},"&& .MuiDialogContent-root":{p:0},"&& .layout-content":{p:0,pl:{xs:0,md:2},pb:0,"& .filter-bar":{pt:0,pl:2}}}:{width:"100%",height:"100vh"},children:[t.jsx(ia,{steps:Ee,mode:"memory",children:t.jsx(Zo,{ref:j,meta:Q,isMobile:$,onStepChange:W=>{O(W)}})}),t.jsxs(B,{className:"action-bar",children:[Re.cancel&&t.jsx(De,{onClick:W=>{W.stopPropagation(),Re.onCancel()},disabled:U===Ee.length-2&&_,color:"inherit",children:Re.cancel||C("common.cancel")}),Re.confirm&&t.jsx(De,{onClick:W=>{W.stopPropagation(),Re.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:_||(typeof Re.disabled=="boolean"?Re.disabled:ws()),variant:"contained",autoFocus:!0,title:Re.confirm,style:{marginLeft:8,overflow:"hidden",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:t.jsxs(B,{sx:{display:"flex",alignItems:"center",overflow:"hidden"},children:[(typeof Re.loading=="boolean"?Re.loading:_)&&t.jsx(we,{style:{marginRight:8},size:16}),t.jsx(B,{component:"span",sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Re.confirm})]})})]})]}):null}as.propTypes={onClose:g.func,mode:g.oneOf(["normal","embed"]),inDialog:g.bool,stores:g.arrayOf(g.string),storeUrl:g.string,resourceType:g.string,resourceDid:g.string,storageKey:g.string,selectedMeta:g.object,showResourcesSwitch:g.bool,showFromUrl:g.bool,enableRunBackground:g.bool,showCategory:g.bool,installFromUrlParams:g.object};const wd=oe(B)`
|
|
366
|
-
.action-bar {
|
|
367
|
-
display: flex;
|
|
368
|
-
justify-content: flex-end;
|
|
369
|
-
position: sticky;
|
|
370
|
-
bottom: 0;
|
|
371
|
-
padding-top: 16px;
|
|
372
|
-
z-index: 100;
|
|
373
|
-
width: 100%;
|
|
374
|
-
background: ${({theme:e})=>e.palette.background.paper};
|
|
375
|
-
border-top: '1px solid';
|
|
376
|
-
border-color: ${({theme:e})=>e.palette.divider};
|
|
377
|
-
}
|
|
378
|
-
`,$e=oe(ue)`
|
|
379
|
-
width: 100%;
|
|
380
|
-
height: 100%;
|
|
381
|
-
`,Tt=oe(An)`
|
|
382
|
-
margin-bottom: 24px;
|
|
383
|
-
`,_d=oe.div`
|
|
384
|
-
position: relative;
|
|
385
|
-
|
|
386
|
-
.choose-blocklet {
|
|
387
|
-
background-color: rgb(236, 251, 253);
|
|
388
|
-
border-color: rgb(236, 251, 253);
|
|
389
|
-
border-radius: 8px;
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
.check-container {
|
|
393
|
-
position: absolute;
|
|
394
|
-
right: 0;
|
|
395
|
-
bottom: 0;
|
|
396
|
-
display: flex;
|
|
397
|
-
justify-content: flex-end;
|
|
398
|
-
align-items: flex-end;
|
|
399
|
-
width: 30px;
|
|
400
|
-
height: 30px;
|
|
401
|
-
border-radius: 0 0 8px 0;
|
|
402
|
-
color: ${e=>e.theme.palette.common.white};
|
|
403
|
-
overflow: hidden;
|
|
404
|
-
transition: all ease 0.3s;
|
|
405
|
-
&:after {
|
|
406
|
-
position: absolute;
|
|
407
|
-
z-index: 0;
|
|
408
|
-
display: block;
|
|
409
|
-
width: 0;
|
|
410
|
-
height: 0;
|
|
411
|
-
border-top: transparent solid 15px;
|
|
412
|
-
border-left: transparent solid 15px;
|
|
413
|
-
border-bottom: ${e=>e.theme.palette.primary.main} solid 15px;
|
|
414
|
-
border-right: ${e=>e.theme.palette.primary.main} solid 15px;
|
|
415
|
-
transition: all ease 0.1s;
|
|
416
|
-
content: '';
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
.check-icon {
|
|
420
|
-
position: relative;
|
|
421
|
-
z-index: 2;
|
|
422
|
-
margin: 0 1px 1px 0;
|
|
423
|
-
font-size: 16px;
|
|
424
|
-
transition: all ease 0.2s;
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
`,Sd=oe.div`
|
|
428
|
-
color: ${e=>e.theme.palette.primary.main};
|
|
429
|
-
.msg-before {
|
|
430
|
-
display: inline-block;
|
|
431
|
-
color: #aaa;
|
|
432
|
-
font-size: 14px;
|
|
433
|
-
margin-right: 6px;
|
|
434
|
-
}
|
|
435
|
-
`;function tr({blocklet:e,showDialog:r,setShowDialog:n,selectedMeta:a=null,showFromUrl:i=!0,installFromUrlParams:o=null}){const{t:f}=de(),c=vo(y=>y.breakpoints.down("md")),{inService:d}=ye(),l=()=>{n(!1)};return r?t.jsx(Ed,{title:f("blocklet.component.addWithName",{name:X.getDisplayName(e)}),maxWidth:!1,fullWidth:!1,PaperProps:{style:c?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:(y,p)=>{p!=="backdropClick"&&l()},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:t.jsx(as,{selectedMeta:a,onClose:l,storageKey:d?ta:na,showFromUrl:i,installFromUrlParams:o})}):null}tr.propTypes={selectedMeta:g.object,showDialog:g.bool.isRequired,setShowDialog:g.func.isRequired,blocklet:g.object.isRequired,showFromUrl:g.bool,installFromUrlParams:g.object};const Ed=oe(Zt)`
|
|
436
|
-
.ux-dialog_header {
|
|
437
|
-
background-color: ${({theme:e})=>e.palette.background.paper};
|
|
438
|
-
}
|
|
439
|
-
.MuiDialogContent-root {
|
|
440
|
-
background-color: ${({theme:e})=>e.palette.background.paper};
|
|
441
|
-
}
|
|
442
|
-
`;function ls({blocklet:e,children:r=null,disabled:n=!1}){const{t:a}=de(),[i,o]=E.useState(!1),[f,c]=E.useState({show:!1,params:null}),[d,l]=E.useState({show:!1,params:null}),{getSessionInHeader:y,prefix:p}=ye(),v=m=>{m.stopPropagation(),o(!0)},x=E.useCallback(()=>{c(m=>({...m,show:!0}))},[]),C=E.useCallback((m=!1)=>{c(m?{params:null,show:!1}:b=>({...b,show:!1}))},[]),w=E.useCallback(()=>{l({params:null,show:!0})},[]),_=E.useCallback(m=>{l({params:{...m,inStore:!1,isUpload:!0},show:!1}),m.meta&&o(!0)},[]),k=E.useCallback((m=!1)=>{l(m?{params:null,show:!1}:b=>({...b,show:!1}))},[]),u=E.useCallback(m=>{o(m),m||(C(!0),k(!0))},[C,k]),s=E.useMemo(()=>[t.jsxs(mn.Item,{"data-cy":"add-component-from-url",onClick:x,style:{fontSize:14,color:"primary.main"},children:[t.jsx(Jt,{style:{fontSize:16,marginRight:4}}),a("blocklet.component.addComponentTip.fromUrl")]},"add-component-from-url"),t.jsxs(mn.Item,{"data-cy":"add-component-from-upload",onClick:w,style:{fontSize:14,color:"primary.main"},children:[t.jsx(Ua,{style:{fontSize:16,marginRight:4}}),a("blocklet.component.addComponentTip.fromUpload")]},"add-component-from-upload")],[w,x,a]);return t.jsxs(t.Fragment,{children:[typeof r=="function"?r({open:v}):t.jsxs(mn,{onClick:v,disabled:n,size:"small",menuButtonProps:{"data-cy":"add-component-more"},menu:s,children:[t.jsx(Wi,{style:{fontSize:"1.3em",marginRight:4}}),a("blocklet.component.add")]}),t.jsx(tr,{showDialog:i,setShowDialog:u,blocklet:e,selectedMeta:f.params?.meta||d.params?.meta||null,installFromUrlParams:f.params||d.params,showFromUrl:!1}),f.show?t.jsx(To,{mode:"component",onCancel:C,onSuccess:({meta:m,inputUrl:b,inStore:R,registryUrl:S})=>{c({show:!1,params:{meta:m,inputUrl:b,inStore:R,registryUrl:S}}),o(!0)},handleText:{title:a("blocklet.component.addComponentTip.fromUrl"),confirm:a("blocklet.component.choose")}}):null,t.jsx(Mo,{open:d.show,did:e.meta.did,prefix:p,headers:y,onUploaded:_,onClose:k})]})}ls.propTypes={children:g.any,blocklet:g.object.isRequired,disabled:g.bool};const kd=e=>e.children.filter(r=>r.meta.interfaces.find(n=>n.type===je.BLOCKLET_INTERFACE_TYPE_WEB));function nr({params:e={},setParams:r=()=>{},setError:n=()=>{},serviceTypes:a=[{name:"Redirect",value:H.ROUTING_RULE_TYPES.REDIRECT},{name:"Default - User will see the 404 page",value:H.ROUTING_RULE_TYPES.NONE},{name:"Rewrite - Route traffic without redirect",value:H.ROUTING_RULE_TYPES.GENERAL_REWRITE},{name:"Response - Response with provided content",value:H.ROUTING_RULE_TYPES.DIRECT_RESPONSE},{name:"Component - Pass traffic to blocklet component",value:H.ROUTING_RULE_TYPES.COMPONENT}]}){const{t:i}=de(),{blocklet:o}=Ie(),f=o.meta.did,c=kd(o),[d,l]=E.useState([]),y={301:i("common.redirectPermanently"),302:i("common.redirectTemporary"),307:i("common.redirectTemporary"),308:i("common.redirectPermanently")};return E.useEffect(()=>{if(e.type===H.ROUTING_RULE_TYPES.COMPONENT&&e.componentId){const p=c.find(C=>C.meta.did===e.componentId),v=X.findWebInterface(p.meta),x=(Array.isArray(v?.pageGroups)?v.pageGroups:[]).map(C=>({value:C,label:`${C} pages`}));x.length&&x.unshift({value:"",label:"All pages"}),l(x),e.pageGroup&&x.find(C=>C.value===e.pageGroup)===!1&&r({...e,pageGroups:""})}},[e.componentId,e.type]),t.jsxs(t.Fragment,{children:[t.jsx(Ce,{select:!0,label:i("router.domain.add.type"),autoComplete:"off",variant:"outlined",name:"type","data-cy":"domain-add-type",fullWidth:!0,value:e.type,onChange:p=>{n(""),r({...e,type:p.target.value,did:p.target.value===H.ROUTING_RULE_TYPES.BLOCKLET?f:"",__disableConfirm:!1})},style:{marginBottom:32},slotProps:{select:{}},children:a.map(({name:p,value:v})=>t.jsx(Ue,{value:v,children:p},v))}),e.type===H.ROUTING_RULE_TYPES.REDIRECT&&[t.jsx(Ce,{select:!0,label:i("router.domain.add.redirect"),autoComplete:"off",variant:"outlined",name:"type",fullWidth:!0,value:e.redirectCode,onChange:p=>r({...e,redirectCode:p.target.value}),style:{marginBottom:32},slotProps:{select:{}},children:Object.keys(y).map(p=>t.jsx(Ue,{value:p,children:`${y[p]} - ${p}`},p))},"redirectCode"),t.jsx(Ce,{label:i("common.redirectUrl"),autoComplete:"off",variant:"outlined",name:"url",fullWidth:!0,value:e.url,helperText:i("router.urlHelperText"),style:{marginBottom:32},onChange:p=>{r({...e,url:p.target.value,__disableConfirm:!p.target.value.trim()}),p.target.value.trim()?n(""):n(i("router.validation.redirectUrlRequired"))},slotProps:{htmlInput:{"data-cy":"redirect-url-input"}}},"redirectUrl")],e.type===H.ROUTING_RULE_TYPES.COMPONENT&&[t.jsx(Ce,{select:!0,label:i("router.domain.add.component"),autoComplete:"off",variant:"outlined","data-cy":"select-component-input",name:"componentId",fullWidth:!0,value:e.componentId,onChange:p=>{r({...e,componentId:p.target.value})},style:{marginBottom:32},slotProps:{select:{}},children:c.map(p=>t.jsx(Ue,{value:p.meta.did,selected:p.meta.did===e.componentId,children:X.getDisplayName(p,!0)},p.meta.did))},"componentId"),d.length?t.jsx(Ce,{select:!0,label:i("router.domain.add.pageGroup"),autoComplete:"off",variant:"outlined",name:"pageGroup","data-cy":"route-group-input",fullWidth:!0,value:e.pageGroup,helperText:i("router.domain.add.pageGroupTip"),style:{marginBottom:32},onChange:p=>{r({...e,pageGroup:p.target.value})},slotProps:{select:{}},children:d.map(p=>t.jsx(Ue,{value:p.value,selected:p.value===e.pageGroup,children:p.label},p.label))},"pageGroup"):null].filter(Boolean),e.type===H.ROUTING_RULE_TYPES.GENERAL_REWRITE&&t.jsx(Ce,{label:i("common.rewriteUrl"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"rewrite-url-input",fullWidth:!0,value:e.url,helperText:i("router.urlHelperText"),style:{marginBottom:32},onChange:p=>{const v=p.target.value.trim();r({...e,url:p.target.value,__disableConfirm:!v}),n(v?"":i("router.validation.rewriteUrlRequired"))}},"url"),e.type===H.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&[t.jsx(Ce,{select:!0,label:i("router.rule.add.responseType"),autoComplete:"off",variant:"outlined",name:"responseType",fullWidth:!0,value:e.responseType,onChange:p=>r({...e,responseType:p.target.value}),style:{marginBottom:32},slotProps:{select:{}},children:H.ROUTING_RESPONSE_TYPES.map(p=>t.jsx(Ue,{value:p.value,children:p.text},p.value))},"responseType"),t.jsx(Ce,{label:i("router.rule.add.responseBody"),autoComplete:"off",variant:"outlined",name:"responseBody","data-cy":"response-body-input",fullWidth:!0,multiline:!0,minRows:3,value:e.responseBody,helperText:i("router.rule.add.responseBodyTip"),style:{marginBottom:32},onChange:p=>{const v=p.target.value.trim();r({...e,responseBody:p.target.value,__disableConfirm:!v}),n(v?"":i("router.rule.add.responseBodyRequired"))}},"response-body")]]})}nr.propTypes={params:g.object,serviceTypes:g.array,setParams:g.func,setError:g.func};function cs({children:e=null,hiddenChildren:r=!1,open:n=!1,onClose:a=null}){const{t:i}=de(),{api:o}=ye(),{blocklet:f}=Ie(),[c,d]=E.useState(!1),[l,y]=E.useState(!1),p=f.meta.did,v=f.site.id,x=()=>{a?.(),d(!1),y(!1)},C=async u=>{try{const s=await Vt(u,i);if(s)throw s;d(!0);const m={from:{pathPrefix:Ne.urlPathFriendly(u.pathPrefix)},to:{type:u.type}};u.type===H.ROUTING_RULE_TYPES.REDIRECT&&(m.to.url=u.url.trim(),m.to.redirectCode=u.redirectCode),u.type===H.ROUTING_RULE_TYPES.COMPONENT&&(m.to.did=p,m.to.componentId=u.componentId,m.to.pageGroup=u.pageGroup),u.type===H.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(m.to.url=Ne.urlPathFriendly(u.url)),u.type===H.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(m.to.response={status:200,contentType:u.responseType,body:u.responseBody}),await o.addRoutingRule({input:{id:v,rule:m,teamDid:p}}),a?.()}catch(s){Y.error(s.message)}finally{d(!1),y(!1)}},w={title:i("router.rule.add.title"),description:(u,s,m)=>{const b=R=>{if(m(null),Vt(R,i)){s({...R,__disableConfirm:!0});return}s({...R})};return t.jsxs(ue,{component:"div",children:[t.jsx(Ce,{label:i("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix",fullWidth:!0,autoFocus:!0,helperText:u.pathPrefixHint||i("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:u.pathPrefix,onChange:R=>{let S=!1;const M=Io({params:{...u,pathPrefix:R.target.value},blocklets:[f]});m(M),u.type===H.ROUTING_RULE_TYPES.BLOCKLET&&M&&(S=!0),u.type===H.ROUTING_RULE_TYPES.REDIRECT&&!u.url&&(S=!0),u.type===H.ROUTING_RULE_TYPES.GENERAL_REWRITE&&!u.url&&(S=!0),u.type===H.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(!u.responseType||!u.responseBody)&&(S=!0),R.target.value.trim()||(S=!0,m(i("router.validation.pathPrefixRequired"))),S||m("");const F=i("common.slugifyHint",{value:Kn(R.target.value)});s({...u,pathPrefix:R.target.value,pathPrefixHint:F,__disableConfirm:S})},slotProps:{htmlInput:{"data-cy":"path-prefix-input"}}}),t.jsx(nr,{params:u,setParams:b,setError:m})]})},confirm:i("router.rule.add.confirm"),cancel:i("common.cancel"),params:{did:"",pathPrefix:"",type:H.ROUTING_RULE_TYPES.REDIRECT,componentId:"",pageGroup:"",redirectCode:302,responseType:"text/plain",responseBody:"",__disableConfirm:!0},onConfirm:C,onCancel:x},_=u=>{u.stopPropagation(),y(!0)};let k=null;return r||(k=typeof e=="function"?e({open:_}):t.jsxs(Ue,{onClick:_,className:"rule-action","data-cy":"action-add-rule",children:[c?t.jsx(we,{size:16}):t.jsx(Jt,{style:{fontSize:18,marginRight:5}}),i("router.rule.add.title")]})),t.jsxs(t.Fragment,{children:[k,(n||l)&&t.jsx(ot,{title:w.title,description:w.description,confirm:w.confirm,cancel:w.cancel,params:w.params,onConfirm:w.onConfirm,onCancel:w.onCancel,color:"primary"})]})}cs.propTypes={children:g.any,onClose:g.func,hiddenChildren:g.bool,open:g.bool};function on({depth:e=1,className:r=""}){return t.jsx(B,{className:r,sx:{ml:Math.max((e-1)*2,0),borderBottom:1,borderColor:"rgba(0,0,0,0.12)"}},"group-collapse-box")}on.propTypes={depth:g.number,className:g.string};function ds({id:e,from:r,children:n=null}){const{t:a}=de(),{api:i}=ye(),{blocklet:o}=Ie(),[f,c]=E.useState(!1),[d,l]=E.useState(null),y=o.meta.did,p=o.site.id,v=r.pathPrefix,x=()=>{c(!1),l(null)},C=async()=>{c(!0);try{await i.deleteRoutingRule({input:{id:p,ruleId:e,teamDid:y}})}catch(k){Y.error(k.message)}finally{l(null),c(!1)}},w={keyName:v,title:a("router.rule.delete.title"),description:a("router.rule.delete.description",{name:`<b>${v}</b>`}),confirmPlaceholder:a("router.rule.delete.confirm_desc",{name:v}),confirm:a("common.delConfirm"),cancel:a("router.rule.delete.cancel"),onConfirm:C,onCancel:x},_=k=>{k.stopPropagation(),l(w)};return t.jsxs(t.Fragment,{children:[typeof n=="function"?n({loading:f,open:_}):t.jsxs(Ue,{onClick:_,className:"rule-action","data-cy":"action-delete-rule",children:[f?t.jsx(we,{size:16}):t.jsx(nn,{style:{fontSize:18,marginRight:5}}),a("router.rule.delete.title")]}),d&&t.jsx(_a,{keyName:d.keyName,title:d.title,description:d.description,confirmPlaceholder:d.confirmPlaceholder,confirm:d.confirm,cancel:d.cancel,params:d.params,onConfirm:d.onConfirm,onCancel:d.onCancel})]})}ds.propTypes={id:g.string.isRequired,from:g.object.isRequired,children:g.any};function us({id:e,from:r,to:n,children:a=null}){const{t:i}=de(),{api:o}=ye(),{blocklet:f}=Ie(),[c,d]=E.useState(!1),[l,y]=E.useState(null),p=f.meta.did,v=f.site.id,x=r.pathPrefix,C=()=>{d(!1),y(null)},w=async u=>{try{const s=await Vt(u,i);if(s)throw s;d(!0);const m={id:e,from:{pathPrefix:Ne.urlPathFriendly(u.pathPrefix)},to:{type:u.type}};u.type===H.ROUTING_RULE_TYPES.REDIRECT&&(m.to.url=u.url,m.to.redirectCode=u.redirectCode),u.type===H.ROUTING_RULE_TYPES.COMPONENT&&(m.to.did=p,m.to.componentId=u.componentId,m.to.pageGroup=u.pageGroup),u.type===H.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(m.to.url=Ne.urlPathFriendly(u.url)),u.type===H.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(m.to.response={status:200,contentType:u.responseType,body:u.responseBody}),await o.updateRoutingRule({input:{id:v,rule:m,teamDid:p}})}catch(s){Y.error(s.message)}finally{d(!1),y(null)}},_={title:i("router.rule.update.title"),description:(u,s,m)=>{const b=R=>{if(Vt(R,i)){s({...R,__disableConfirm:!0});return}s({...R})};return t.jsxs(ue,{component:"div",children:[t.jsx(Ce,{label:i("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix",fullWidth:!0,autoFocus:!0,helperText:u.helperText||i("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:u.pathPrefix,onChange:R=>{let S=!1;u.type===H.ROUTING_RULE_TYPES.REDIRECT&&!u.url&&(S=!0),u.type===H.ROUTING_RULE_TYPES.GENERAL_REWRITE&&!u.url&&(S=!0),u.type===H.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(!u.responseType||!u.responseBody)&&(S=!0),R.target.value.trim()||(S=!0,m(i("router.validation.pathPrefixRequired"))),S||m("");const M=i("common.slugifyHint",{value:Kn(R.target.value)});s({...u,pathPrefix:R.target.value,helperText:M,__disableConfirm:S})},slotProps:{htmlInput:{"data-cy":"path-prefix-input"}}}),t.jsx(nr,{params:u,setParams:b,setError:m})]})},confirm:i("router.rule.update.confirm"),cancel:i("router.rule.update.cancel"),color:"primary",params:{did:n.did||"",pathPrefix:x==="/"?x:x.replace(/^\/+/,"").replace(/\/+$/,""),type:n.type||H.ROUTING_RULE_TYPES.BLOCKLET,redirectCode:n.redirectCode||302,componentId:n.componentId||"",pageGroup:n.pageGroup||"",url:n.url||"",responseType:n.response?.contentType||"",responseBody:(n.response?.body||"").replace(/\\"/g,'"'),__disableConfirm:!1},onConfirm:w,onCancel:C},k=u=>{u.stopPropagation(),y(_)};return t.jsxs(t.Fragment,{children:[typeof a=="function"?a({loading:c,open:k}):t.jsxs(Ue,{onClick:k,className:"rule-action","data-cy":"action-update-rule",children:[c?t.jsx(we,{size:16}):t.jsx(wo,{style:{fontSize:18,marginRight:5}}),i("router.rule.update.title")]}),l&&t.jsx(ot,{title:l.title,description:l.description,confirm:l.confirm,color:l.color,cancel:l.cancel,params:l.params,onConfirm:l.onConfirm,onCancel:l.onCancel})]})}us.propTypes={id:g.string.isRequired,from:g.object.isRequired,to:g.object.isRequired,children:g.any};function ps({from:e,isProtected:r=!1,...n}){const{locale:a}=de(),{blocklet:i,recommendedDomain:o}=Ie(),f=Co(o,e.pathPrefix,Gn(i,a));return t.jsxs(B,{sx:{display:"flex",alignItems:"center"},children:[t.jsx(B,{component:"a",sx:{display:{xs:"flex",md:"none"}},target:"_blank",href:f,rel:"noopener noreferrer",title:f,children:t.jsx(he,{size:"small",children:t.jsx(Bo,{})})}),t.jsx(us,{...n,isProtected:r,from:e,children:({open:c})=>t.jsx(he,{size:"small",onClick:c,disabled:r,"data-cy":"action-update-rule",children:t.jsx(Ti,{})})}),t.jsx(ds,{...n,isProtected:r,from:e,children:({open:c})=>t.jsx(he,{size:"small",onClick:c,disabled:r,"data-cy":"action-delete-rule",children:t.jsx(nn,{})})})]})}ps.propTypes={isProtected:g.bool};function fs({group:e,...r}){return e?t.jsx(mt,{type:"reverse",...r,children:e}):null}fs.propTypes={group:g.string.isRequired};function Fn({domain:e,isHttps:r=!1,toUrl:n}){const a=r?"https":"http";let i=n;return vi(i)||(i=`${a}://${e}${n}`),t.jsx(gt,{href:i,target:"_blank",style:{fontSize:14},underline:"hover",children:n},i)}Fn.propTypes={domain:g.string.isRequired,toUrl:g.string.isRequired,isHttps:g.bool};function rr({hasPermission:e=!1}){const{t:r,locale:n}=de(),a=ht(),{blocklet:i,recommendedDomain:o}=Ie();return i.site.rules.filter(c=>c.to.type!==H.ROUTING_RULE_TYPES.BLOCKLET).map(c=>{let d=null,l=null;c.to.type===H.ROUTING_RULE_TYPES.NONE?d="404":c.to.type===H.ROUTING_RULE_TYPES.REDIRECT?d=c.to.redirectCode:c.to.type===H.ROUTING_RULE_TYPES.GENERAL_REWRITE?d="R":c.to.type===H.ROUTING_RULE_TYPES.DIRECT_RESPONSE?d=t.jsx(Ba,{sx:{color:"text.secondary",fontSize:"45px"}}):c.to.type===H.ROUTING_RULE_TYPES.COMPONENT&&(l=i.children.find(p=>p.meta.did===c.to.componentId),d="C");const y=c.isProtected?t.jsx(be,{title:r("blocklet.router.urlLockTooltip"),placement:"top",children:t.jsx("span",{children:t.jsx(he,{disabled:!0,size:"small",style:{pointerEvents:"auto",paddingTop:0,paddingBottom:0,margin:"12px 0"},children:t.jsx(wa,{style:{fill:a.palette.text.disabled}})})})}):t.jsx(ps,{...c});return[t.jsxs(B,{className:"component-item",sx:{display:"flex",py:2,justifyContent:"space-between",alignItems:"center"},children:[t.jsxs(B,{sx:{width:{xs:300,md:400},display:"flex",alignItems:"center"},children:[t.jsx(B,{className:"component-item__indent",sx:{width:28}}),typeof d=="object"?d:t.jsx(xi,{children:d}),t.jsxs(B,{sx:{ml:2,flex:1,wordBreak:"break-word"},children:[t.jsxs(B,{style:{color:"text.primary",fontSize:16},children:[c.to.type===H.ROUTING_RULE_TYPES.NONE&&r("common.page404"),c.to.type===H.ROUTING_RULE_TYPES.REDIRECT&&r("common.redirect"),c.to.type===H.ROUTING_RULE_TYPES.GENERAL_REWRITE&&r("common.rewrite"),c.to.type===H.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&H.ROUTING_RESPONSE_TYPES.find(p=>p.value===c.to.response.contentType)?.text,c.to.type===H.ROUTING_RULE_TYPES.COMPONENT&&X.getDisplayName(l,!0)]}),t.jsxs(B,{sx:{display:"flex",alignItems:"center"},children:[c.to.type===H.ROUTING_RULE_TYPES.REDIRECT&&t.jsx(Fn,{domain:o,toUrl:c.to.url}),c.to.type===H.ROUTING_RULE_TYPES.GENERAL_REWRITE&&t.jsx(Fn,{domain:o,toUrl:c.to.url}),c.to.type===H.ROUTING_RULE_TYPES.COMPONENT&&t.jsx(fs,{group:c.to.pageGroup})]})]})]}),t.jsx(B,{sx:{px:2,alignItems:"center",flexGrow:"1",display:{xs:"none",md:"flex"}},children:t.jsx(gt,{href:Co(o,c.from.pathPrefix,Gn(i,n)),target:"_blank",style:{fontSize:16,color:"inherit"},underline:"hover",children:yi(c.from.pathPrefix,"/")||"/"})},c.from.pathPrefix),t.jsx(B,{children:e&&t.jsx("div",{style:{textAlign:"right"},children:y})},"actions")]},"rule"),t.jsx(on,{},"divider")]})}rr.propTypes={hasPermission:g.bool};const Rd=Qt(rr,"mutate_blocklets"),Pd=Qt(rr,"",pt);function Td(e){const{inService:r}=ye();return r?t.jsx(Pd,{...e}):t.jsx(Rd,{...e})}function Id(e,r){const n=E.useRef(r);E.useEffect(()=>{const a=i=>n.current(i.detail);return window.addEventListener(e,a),()=>window.removeEventListener(e,a)},[e])}function Dd(e){const r=Vn(),{t:n}=de(),a=()=>{const i=new URLSearchParams(window.location.search);i.get("checkUpdate")&&(i.delete("checkUpdate"),r(i.toString()),e(),Y.success(n("notification.checkingForUpdates")))};E.useEffect(a,[]),Id("checkUpdate",a)}function Bd({blocklet:e,scrollToComponent:r}={blocklet:null,scrollToComponent:!1}){const n=Vn(),{t:a}=de(),i=E.useRef(null),o=E.useMemo(()=>{if(!e||!e.optionalComponents)return null;const f=new URLSearchParams(window.location.search),c=f.get("install-component");if(c){i.current=c,f.delete("install-component"),n(f.toString());const d=e.optionalComponents.find(y=>y.meta.did===c);if(!d)return Y.success(a("notification.installComponentError",{did:c})),null;const{meta:l}=d;if(r){const y=document.getElementById(`optional-component-${c}`),p=document.querySelector(".dashboard-main");if(y){const v=y.getBoundingClientRect(),x=p.getBoundingClientRect();p.scrollTo({top:v.top-x.top+p.scrollTop,behavior:"smooth"})}}return l}return null},[e,n,a,r]);return E.useEffect(()=>{i.current&&window.opener&&window.opener.postMessage({blocklet:e,kind:"component-installer"},window.blocklet?.appUrl)},[e]),o}function or({open:e=!1,onClose:r=null,blocklet:n,ancestors:a=[]}){const{t:i}=de(),o=[...(a||[]).map(l=>l?.meta?.did||""),n?.meta?.did||""].filter(Boolean).join("/"),f=i("preferencesFor",{name:X.getDisplayName(n,!0)}),c=E.useMemo(()=>({position:"relative",minHeight:"50vh",height:"100%",overflow:"hidden",border:0}),[]);if(rt(n.status)||n.status==="unknown"&&rt(n.status))return null;const d=()=>{r?.()};return t.jsx(Od,{open:e,fullWidth:!0,maxWidth:"md",title:f,onClose:d,PaperProps:{style:{minHeight:"500px"}},children:t.jsxs(uo,{sx:{gap:1},children:[t.jsx(ue,{sx:{fontSize:12,color:"text.secondary",mb:.5},children:i("description.preferences",{name:X.getDisplayName(n,!0)})}),t.jsx($i,{id:o,styles:c})]})})}or.propTypes={blocklet:g.object.isRequired,ancestors:g.array,open:g.bool,onClose:g.func};const Od=oe(Zt)`
|
|
443
|
-
.MuiDialogContent-root {
|
|
444
|
-
padding-top: 0;
|
|
445
|
-
padding-bottom: 24px;
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
.MuiToolbar-root {
|
|
449
|
-
padding-right: 0;
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
.ux-dialog_closeButton {
|
|
453
|
-
margin: 0;
|
|
454
|
-
}
|
|
455
|
-
`;function ms({component:e,remove:r=async()=>{},disabled:n=!1,tip:a="",showConfirm:i=!1,hideBtn:o=!1,onCancel:f=()=>{}}){const{t:c}=E.useContext(Se),[d,l]=E.useState(!1),[y,p]=E.useState(null),v=async k=>{l(!0),await r(k.component,k.removeType),l(!1),p(null)},x=n||d,C=()=>{p({title:`${c("common.delete")} ${e.meta.title||e.meta.name}`,description:(k,u)=>t.jsxs(ue,{component:"div",children:[t.jsx(ue,{gutterBottom:!0,children:c("blocklet.action.removeComponentDescription")}),t.jsxs(ka,{name:"removeType",value:k.removeType,onChange:s=>u({...k,removeType:s.target.value}),children:[t.jsx(Nn,{value:"keepData",control:t.jsx(wr,{}),label:c("blocklet.action.removeComponentKeepData")}),t.jsx(Nn,{value:"complete",control:t.jsx(wr,{}),label:c("blocklet.action.removeComponentComplete")})]})]}),confirm:c("common.confirm"),cancel:c("common.cancel"),params:{component:e,removeType:"keepData"},onConfirm:v,onCancel:()=>{p(null),f()}})};E.useEffect(()=>{i?C():(l(!1),p(null))},[i]);const w=t.jsx(Ud,{size:"small",disabled:x,onClick:()=>C,"data-cy":"delete-component-btn",children:t.jsx(nn,{disabled:x})}),_=t.jsx(be,{title:a||c("common.delete"),children:t.jsx("span",{children:w})});return t.jsxs(t.Fragment,{children:[!o&&_,y&&t.jsx(ot,{title:y.title,description:y.description,confirm:y.confirm,cancel:y.cancel,params:y.params,onConfirm:y.onConfirm,onCancel:y.onCancel})]})}ms.propTypes={component:g.object.isRequired,remove:g.func,onCancel:g.func,disabled:g.bool,showConfirm:g.bool,hideBtn:g.bool,tip:g.string};const Ud=oe(he)`
|
|
456
|
-
&.Mui-disabled {
|
|
457
|
-
opacity: 0.5;
|
|
458
|
-
}
|
|
459
|
-
`;function hs({component:e,onStart:r=async()=>{},onStop:n=async()=>{},disabled:a=!1,tip:i=""}){const{t:o}=E.useContext(Se),[f,c]=E.useState(!1),[d,l]=E.useState(),y=async()=>{c(!0);try{await r(e)}catch(k){Y.error(k.message)}c(!1)},p=async()=>{c(!0);try{await n(e)}catch(k){Y.error(k.message)}c(!1)},v=a||f,x=["starting","running","stopping"],C=x.includes(e.status)||x.includes(e.greenStatus),w=C?Ro:Da,_=t.jsx(Nd,{disabled:v,size:"small",onClick:()=>{C?l({title:`${o("common.stop")} ${e?.meta?.title}`,description:o("blocklet.action.stopComponentDescription"),confirm:o("blocklet.action.confirmStop"),cancel:o("common.cancel"),onConfirm:()=>(l(null),p()),onCancel:()=>l(null)}):y()},"data-cy":`${C?"stop":"start"}-component-btn`,children:t.jsx(w,{disabled:v,fontSize:"small"})});return[t.jsx(be,{title:i||o(`common.${C?"stop":"start"}`),children:t.jsx("span",{children:_})},"btn"),d&&t.jsx(ot,{title:d.title,description:d.description,confirm:d.confirm,cancel:d.cancel,params:d.params,onConfirm:d.onConfirm,onCancel:d.onCancel},"connect")]}hs.propTypes={component:g.object.isRequired,onStart:g.func,onStop:g.func,disabled:g.bool,tip:g.string};const Nd=oe(he)`
|
|
460
|
-
&.Mui-disabled {
|
|
461
|
-
opacity: 0.5;
|
|
462
|
-
}
|
|
463
|
-
`;function gs({sourceInfo:e={},blocklet:r={}}){const{t:n}=E.useContext(Se);let{source:a}=e;return a==="registry"&&(a="Blocklet Store"),t.jsxs(B,{sx:{display:"flex",alignItems:"center"},children:[t.jsx(Ci,{type:"success",children:Ra(a)},"source"),e.source==="registry"&&t.jsx(gt,{href:_e(e.deployedFrom,"blocklets",r?.meta?.bundleDid||""),target:"_blank",className:"page-link",underline:"hover",style:{display:"flex",alignItems:"center",marginLeft:8},children:n("blocklet.overview.viewInStore")})]})}gs.propTypes={sourceInfo:g.shape({source:g.string,deployedFrom:g.string}),blocklet:g.object};function sr({blocklet:e,checkUpgrade:r=!1,hasPermission:n=!1,...a}){const{api:i}=ye(),{t:o}=E.useContext(Se),[f,c]=E.useState(!1),[d,l]=E.useState(""),[y,p]=E.useState(null),[v,x]=E.useState(null);E.useEffect(()=>{p(null),r&&(e.mode,je.BLOCKLET_MODES.DEVELOPMENT)},[e,r]);const C=()=>{c(!1),x(null)},w=async()=>{c(!0);try{const k={did:e.meta.did,version:y.version,storeUrl:y.registryUrl||""};await dt(2e3),await i.upgradeBlocklet({input:k})}catch(k){Y.error(`Blocklet upgrade failed: ${xe(k)}`)}finally{c(!1),x(null)}},_={title:`${o("common.upgrade")} ${o("common.blocklet")} ${X.getDisplayName(e)}`,description:o("blocklet.action.upgradeDescription"),confirm:o("blocklet.action.confirmUpgrade"),cancel:o("common.cancel"),onConfirm:w,onCancel:C};return n&&y&&!X.isInProgress(e.status)?t.jsxs(t.Fragment,{children:[t.jsx(mt,{...a,children:e.meta.version}),t.jsx(be,{title:o("common.updateAvailable",{version:y.version}),children:t.jsx(he,{size:"small",style:{marginLeft:8},disabled:f,onClick:()=>x(_),children:f?t.jsx(we,{size:16}):t.jsx(Ta,{style:{fontSize:16,color:"red"}})})}),!!d&&t.jsx(Y,{variant:"error",message:d,onClose:()=>l("")}),v&&t.jsx(ot,{title:v.title,description:v.description,confirm:v.confirm,cancel:v.cancel,params:v.params,onConfirm:v.onConfirm,onCancel:v.onCancel})]}):t.jsx(mt,{...a,children:e.meta.version})}sr.propTypes={blocklet:g.object.isRequired,checkUpgrade:g.bool,hasPermission:g.bool};const Ld=Qt(sr,"mutate_blocklets"),Ad=Qt(sr,"",pt);function Md(e){const{inService:r}=ye();return r?t.jsx(Ad,{...e}):t.jsx(Ld,{...e})}const zd=e=>!e?.meta?.group,Fd=(e,r)=>e?[{name:r("common.name"),value:e.displayName},{name:r("common.description"),value:e.description},{name:r("common.version"),value:t.jsx(mt,{children:e.version})}]:[],qd=e=>{const{source:r,deployedFrom:n,bundleSource:a}=e;if(r)return{source:r,deployedFrom:n};if(!a)return{source:"upload",deployedFrom:n};if(a.url){const i=n||Array.isArray(a.url)?a.url[0]:a.url;return{source:"url",deployedFrom:i,link:i}}if(a.store){const i=n||Array.isArray(a.store)?a.store[0]:a.store;return{source:"registry",deployedFrom:i,link:i}}return{}},$d=(e,r)=>{const n=e.split("/").slice(1);let a=r,i=0;const o=[];for(;a&&i<n.length;){const f=a.children.find(c=>c.meta.did===n[i]);a=f,i++,f&&o.push(f.meta.title)}return o.join(" / ")};function xs({blocklet:e,depth:r=0,componentInfo:n=null,app:a=null,onClose:i}){const{t:o,locale:f}=E.useContext(Se),{deletingBlocklets:c}=Yn();let{status:d,greenStatus:l}=e;(d==="running"||l==="running")&&(d="running"),r===1&&c.includes(e.meta.did)&&(d="deleting");const y=`/${e.mountPoint||"/"}`.replace(/\/+/g,"/"),p=C=>C.map(w=>w.name===o("common.did")||w.name===o("blocklet.appId")?t.jsx(hn,{valueComponent:"div",nameWidth:120,name:w.name,nameFormatter:()=>w.name,children:w.value},w.name):t.jsx(hn,{valueComponent:"div",nameWidth:120,name:w.name,children:w.link?t.jsx(gt,{href:w.link,target:"_blank",className:"page-link",underline:"hover",children:w.value}):w.value},w.name)),v=n?qd(n):{},x=n?[{name:o("common.name"),value:X.getDisplayName(n,!0)},{name:o("common.version"),value:t.jsx(Md,{blocklet:n,checkUpgrade:!1})},{name:o("common.status"),value:t.jsx(Mn,{isResource:zd(e),status:d,source:n.source,progress:e.progress})},X.isBlockletRunning(e)?{name:o("blocklet.startedAt"),value:e.startedAt?t.jsx(fn,{value:e.startedAt,type:"all",locale:f}):"-"}:null,X.isBlockletRunning(e)?null:{name:o("blocklet.stoppedAt"),value:e.stoppedAt?t.jsx(fn,{value:e.stoppedAt,type:"all",locale:f}):"-"},e.installedAt?{name:o("blocklet.installedAt"),value:e.installedAt?t.jsx(fn,{value:e.installedAt,type:"all",locale:f}):"-"}:null,X.hasStartEngine(e.meta)?{name:o("common.mountPoint"),value:y}:null,n.meta.group?{name:o("common.group"),value:t.jsx(mt,{type:"success",children:n.meta.group})}:null,{name:o("blocklet.overview.source"),value:t.jsx(gs,{sourceInfo:v,blocklet:e})},{name:o("blocklet.overview.deployedFrom"),value:v.deployedFrom||"-",link:v.link??""},{name:o("common.did"),value:t.jsx(bi,{did:n.meta.did,showQrcode:!0})},{name:o("common.author"),value:n.meta.owner?t.jsx(xa,{owner:n.meta.owner,locale:f}):ga.formatPerson(n.meta.author)},{name:o("common.engine"),value:Fd(n.engine,o).map(({name:C,value:w})=>t.jsx(hn,{style:{marginBottom:4},nameWidth:120,name:C,children:w},C))},e.dependents?.length?{name:o("common.dependents"),value:t.jsx(B,{children:e.dependents.map(C=>t.jsx(B,{children:`${$d(C.id,a)} ${C.required?`(${o("common.required")})`:""}`},C.id))})}:null,e.meta.resources?.length?{name:o("common.resource"),value:e.meta.resources.join(", ")}:null].filter(Boolean):[];return n?t.jsx(Zt,{open:!0,title:o("common.componentBasicInfo"),showCloseButton:!0,fullWidth:!0,maxWidth:"md",onClose:()=>{i(null)},children:t.jsx(B,{sx:{paddingBottom:1.5},children:p(x)},"dialog-wrapper")},"base-info-dialog"):null}xs.propTypes={blocklet:g.object.isRequired,depth:g.number,app:g.object,componentInfo:g.object,onClose:g.func.isRequired};oe(bo)`
|
|
464
|
-
.BaseBadge-badge {
|
|
465
|
-
top: ${e=>e.top*8||6}px;
|
|
466
|
-
right: ${e=>e.right*8||6}px;
|
|
467
|
-
}
|
|
468
|
-
`;oe(B)`
|
|
469
|
-
.component-header {
|
|
470
|
-
display: flex;
|
|
471
|
-
align-items: center;
|
|
472
|
-
align-items: flex-end;
|
|
473
|
-
cursor: pointer;
|
|
474
|
-
}
|
|
475
|
-
.component-name {
|
|
476
|
-
color: ${({theme:e})=>e.palette.text.primary};
|
|
477
|
-
font-size: 16px;
|
|
478
|
-
}
|
|
479
|
-
.component-version {
|
|
480
|
-
color: ${({theme:e})=>e.palette.grey[400]};
|
|
481
|
-
font-size: 12px;
|
|
482
|
-
margin-left: 4px;
|
|
483
|
-
transform: translateY(-1px);
|
|
484
|
-
}
|
|
485
|
-
`;function ys({blocklet:e,ancestors:r,mountPoint:n,href:a}){const[i,o]=E.useState(!1),[f,c]=E.useState(!1),[d,l]=E.useState(!1),[y,p]=E.useState(n),{api:v}=ye(),x=!r.length,C=x?e.meta.did:r.map(S=>S.meta.did)[0],{t:w}=de(),{confirmApi:_,confirmHolder:k}=yo();E.useEffect(()=>{c(!1),o(!1),l(!1)},[n]);const u=()=>{o(!1),c(!1),p(n)},s=async()=>{l(!0),o(!1);try{const S={rootDid:C,mountPoint:Ne.urlPathFriendly(y)};x||(S.did=e.meta.did),await v.updateComponentMountPoint({input:S})}catch(S){throw S.message=xe(S),Y.error(S.message),S}finally{u()}},m=We(()=>{_.open({title:w("common.noticeTitle"),content:t.jsxs(B,{sx:{color:"#9397A1","& > li":{listStyle:"disc",ml:1.5}},children:[t.jsx(ue,{sx:{mb:1.5},children:w("blocklet.mountPoint.description1")}),t.jsx(ue,{component:"li",children:w("blocklet.mountPoint.case1")}),t.jsx(ue,{component:"li",children:w("blocklet.mountPoint.case2")}),t.jsx(ue,{sx:{mt:1.5},children:w("blocklet.mountPoint.description2")})]}),confirmButtonText:w("common.confirm"),cancelButtonText:w("common.cancel"),async onConfirm(S){await s(),S()},confirmButtonProps:{"data-cy":"edit-mount-point-confirm"}})}),b=S=>{S?.preventDefault(),Ne.urlPathFriendly(y)!==n?m():c(!1)},R=f?t.jsxs(B,{sx:{ml:1},children:[t.jsx(he,{size:"medium",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),"data-cy":"edit-mount-point-submit",onClick:b,children:t.jsx(B,{component:fe,icon:"material-symbols:done",sx:{color:"primary.main",transition:"0.3s opacity"}})}),t.jsx(he,{size:"medium",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),onClick:u,children:t.jsx(B,{component:fe,icon:"iconoir:cancel",sx:{color:"primary.main",transition:"0.3s opacity"}})})]}):t.jsx(he,{size:"medium",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),onClick:()=>c(!0),children:t.jsx(B,{component:fe,"data-cy":"edit-mount-point",icon:"lets-icons:edit-light",sx:{opacity:i?1:0,color:"primary.main",transition:"0.3s opacity"}})});return t.jsxs(B,{sx:{alignItems:"center",flexGrow:"1",display:{xs:"none",md:"flex"}},children:[k,f?t.jsx("form",{onSubmit:b,children:t.jsx(Ce,{style:{flex:1},fullWidth:!0,"data-cy":"edit-mount-point-input",value:y,onChange:S=>p(S.target.value),autoFocus:!0,size:"small",variant:"outlined",placeholder:n})}):t.jsx(B,{component:"a",target:"_blank",href:a,rel:"noopener noreferrer",title:a,onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:t.jsx(B,{sx:{maxWidth:400,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",color:"primary.main",fontSize:16,px:2},children:ji(n)})}),d?t.jsx(we,{size:20,sx:{ml:1}}):R]},n)}ys.propTypes={mountPoint:g.string.isRequired,href:g.string.isRequired,blocklet:g.object.isRequired,ancestors:g.array.isRequired};const Wd=e=>!e?.meta?.group,co=(e,r)=>{const n=e.split("/").slice(1);let a=r,i=0;const o=[];for(;a&&i<n.length;){const f=a.children.find(c=>c.meta.did===n[i]);a=f,i++,f&&o.push(f.meta.title)}return o.join(" / ")},Hd=(e,r)=>{window.IS_DEBUG&&console.log("blocklet status","blueStatus:",e,"greenStatus:",r);const n=e==="running"||r==="running",a=e==="stopping"||r==="stopping",i=e==="downloading"&&r==="downloading";let o="",f="";return a?(o="stopping",f=""):n?o="running":o=e||r||"",n&&e!==r&&(f=e==="running"?r:e),i&&(o="running",f="downloading"),o==="running"&&f==="stopped"&&(f=""),e===r&&(o=e,f=""),{primaryStatus:o,secondaryStatus:f}};function qn({blocklet:e,ancestors:r=[],depth:n=0,onRemove:a=()=>{},onStart:i=()=>{},onStop:o=()=>{},onRestart:f=()=>{},getComponentUrl:c=()=>window.location.origin,app:d=null}){const{t:l,locale:y}=E.useContext(Se),p=Vn(),[v,x]=E.useState(),[C,w]=E.useState(!1),[_,k]=E.useState(!1),[u,s]=E.useState(null),{info:m,inService:b}=ye(),[R,S]=E.useState(!1),[M,F]=E.useState(!1),{deletingBlocklets:P}=Yn();let{status:D}=e;n===1&&P.includes(e.meta.did)&&(D="deleting");const I=`/${e.mountPoint||"/"}`.replace(/\/+/g,"/"),L=c(I),z=X.isInProgress(d.status),q=X.isInProgress(e.status);let K="";if(z||q||n===1&&P.includes(e.meta.did))K=l("blocklet.component.tip.stopBlocklet");else if(e.dependents?.length){const h=e.dependents.filter(j=>j.required);if(h.length){const j=h.map(T=>co(T.id,d));K=l("blocklet.component.tip.requiredBy",{name:j.join(", ")})}}const te=We(()=>{const h=e.meta.did;if(b){const j=Gt(_e(H.WELLKNOWN_BLOCKLET_ADMIN_PATH,"/developers/logs"),{locale:y,component:h});window.location.href=j}else{const j=Gt(_e("/blocklets",d.appPid,"/logs"),{locale:y,component:h});p(j)}}),re=async(...h)=>{k(!0);try{await a(...h)}catch{}k(!1),w(!1)},{usingDocker:N,usingIsolation:ie}=E.useMemo(()=>{if(!e.meta.group||e.meta.group==="static")return{usingDocker:!1,usingIsolation:!1};const h=!!m?.enableDocker||window.blocklet?.enableDocker,j=[...d.configs,...e.configs].find(V=>V.key==="SKIP_DOCKER"&&V.value),T=[...d.configs,...e.configs].find(V=>V.key==="USE_DOCKER"&&V.value),$=[...d.configs,...e.configs].find(V=>V.key==="SKIP_DOCKER_NETWORK"&&V.value);return{usingDocker:h?!j:!!T,usingIsolation:h&&!$&&(m?.enableDockerNetwork||window.blocklet?.enableDockerNetwork)}},[e.configs,m?.enableDocker,m?.enableDockerNetwork,d.configs,e.meta.group]),{primaryStatus:U,secondaryStatus:O}=Hd(D,e.greenStatus);return t.jsxs(t.Fragment,{children:[t.jsxs(ir,{display:"flex",py:2,className:"component-item",justifyContent:"flex-start",alignItems:"center",children:[t.jsxs(B,{sx:{pl:2,width:{xs:250,sm:400},display:"flex",alignItems:"center"},children:[t.jsx(jo,{blocklet:e,ancestors:r}),t.jsxs(B,{sx:{ml:"16px",minWidth:0},children:[t.jsxs(B,{className:"component-header",onClick:()=>x(e),children:[t.jsx(B,{className:"component-name",children:X.getDisplayName(e,!0)}),t.jsx(B,{className:"component-version",children:e?.meta?.version})]}),t.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:.5},children:[U&&t.jsx(Mn,{style:{whiteSpace:"nowrap"},status:U,source:e.source,progress:e.progress}),O&&(U==="running"&&Sa[O]==="error"?t.jsx(be,{title:l("blocklet.status.failWithOldVersion"),children:t.jsx(B,{sx:{display:"flex",color:"warning.main",ml:1},children:t.jsx(Zn,{})})}):t.jsx(Mn,{style:{whiteSpace:"nowrap"},status:O,source:e.source,progress:e.progress})),t.jsx(ya,{style:{whiteSpace:"nowrap"},mode:e.mode||""}),e.mode!=="development"&&N&&t.jsx(be,{title:l("blocklet.usingDocker"),children:t.jsx(B,{sx:{display:"flex",color:"primary.main",ml:1},children:t.jsx(fe,{icon:Eo})})}),e.mode!=="development"&&ie&&t.jsx(be,{title:l("blocklet.usingIsolation"),children:t.jsx(B,{sx:{display:"flex",color:"primary.main",ml:1},children:t.jsx(fe,{icon:"streamline:network"})})}),!!e.dependents?.length&&t.jsx(be,{title:[`${l("common.dependents")}: `,e.dependents.map(h=>t.jsx(B,{sx:{pl:1},children:`${co(h.id,d)} ${h.required?`(${l("common.required")})`:""}`},h.id))],children:t.jsx(B,{sx:{display:"flex",color:"primary.main",ml:1},children:t.jsx(fe,{icon:"octicon:package-dependents-16"})})})]})]})]},e),ko.hasMountPoint(e.meta)&&t.jsx(ys,{blocklet:e,ancestors:r,mountPoint:I,href:L},I),t.jsx("div",{style:{flex:1}}),t.jsxs(B,{sx:{display:"flex",alignItems:"center"},children:[X.hasStartEngine(e.meta)&&t.jsx(be,{title:l("common.visit"),children:t.jsx(B,{component:"a",sx:{display:{xs:"flex",md:"none"}},target:"_blank",href:L,rel:"noopener noreferrer",children:t.jsx(he,{size:"small",children:t.jsx(Bo,{fontSize:"small"})})})}),t.jsx(hs,{blocklet:d,component:e,onStart:i,onStop:o,disabled:!["starting","stopping"].includes(d.status)&&X.isInProgress(d.status)}),t.jsx(he,{size:"small",onClick:()=>F(!0),disabled:z||q,children:t.jsx(No,{fontSize:"small"})}),t.jsx($n,{color:"error",badgeContent:"",variant:"dot",invisible:!X.getComponentMissingConfigs(e,r[0]).length,children:t.jsx(Oo,{"data-cy":"component-actions",actions:[X.hasStartEngine(e.meta)||Wd(e)?{icon:t.jsx(wi,{}),text:l("common.detail"),onClick:()=>{x(e)}}:null,{icon:t.jsx(Ea,{}),text:l("common.restart"),onClick:()=>{s({title:`${l("common.restart")} ${e.meta.title}`,description:l("blocklet.action.restartDescription"),confirm:l("blocklet.action.confirmRestart"),cancel:l("common.cancel"),onConfirm:async()=>{k(!0),await f(e),k(!1),s(null)},onCancel:()=>s(null)})},disabled:_||z||q||!X.isBlockletRunning(e)},U==="error"?{icon:t.jsx(Ro,{}),text:l("common.stop"),onClick:()=>{s({title:`${l("common.stop")} ${e.meta.title}`,description:l("blocklet.action.stopDescription"),confirm:l("blocklet.action.confirmStop"),cancel:l("common.cancel"),onConfirm:async()=>{k(!0),await o(e),k(!1),s(null)},onCancel:()=>s(null)})},disabled:_||z||q}:null,{icon:t.jsx(nn,{}),text:l("common.delete"),onClick:()=>{w(!0)},disabled:z||q||!!K,tip:K},{separator:!0},{icon:t.jsx(fe,{icon:"mdi:variable"}),onClick:()=>{S(!0)},text:t.jsx($n,{color:"error",badgeContent:"",variant:"dot",invisible:!X.getComponentMissingConfigs(e,r[0]).length,children:t.jsx(B,{sx:{width:"100%"},children:l("common.environments")})}),disabled:z||q},{icon:t.jsx(fe,{icon:"heroicons:command-line"}),text:l("common.logs"),onClick:te,disabled:z||q||!!K,tip:K}].filter(Boolean)})})]},"actions")]},"group-not-gateway-box"),t.jsx(on,{},"line"),t.jsx(xs,{componentInfo:v,onClose:x,blocklet:e,app:d,depth:n}),t.jsx(ms,{blocklet:d,component:e,remove:re,onCancel:()=>w(!1),hideBtn:!0,showConfirm:C},"delete-component"),u&&t.jsx(ot,{title:u.title,description:u.description,confirm:u.confirm,cancel:u.cancel,params:u.params,onConfirm:u.onConfirm,onCancel:u.onCancel},"confirm-setting"),R&&t.jsx(Xn,{open:!0,hiddenChildren:!0,onClose:()=>S(!1),blocklet:e,ancestors:r}),M&&t.jsx(or,{open:!0,onClose:()=>F(!1),blocklet:e,ancestors:r})]})}qn.propTypes={blocklet:g.object.isRequired,ancestors:g.array,depth:g.number,onRemove:g.func,onStart:g.func,onStop:g.func,onRestart:g.func,getComponentUrl:g.func,app:g.object};const $n=oe(bo)`
|
|
486
|
-
.BaseBadge-badge {
|
|
487
|
-
top: ${e=>e.top*8||6}px;
|
|
488
|
-
right: ${e=>e.right*8||6}px;
|
|
489
|
-
}
|
|
490
|
-
`,ir=oe(B)`
|
|
491
|
-
&:hover {
|
|
492
|
-
background-color: rgba(0, 0, 0, 0.05);
|
|
493
|
-
}
|
|
494
|
-
.component-header {
|
|
495
|
-
display: flex;
|
|
496
|
-
align-items: center;
|
|
497
|
-
align-items: flex-end;
|
|
498
|
-
cursor: pointer;
|
|
499
|
-
}
|
|
500
|
-
.component-name {
|
|
501
|
-
min-width: 0;
|
|
502
|
-
overflow: hidden;
|
|
503
|
-
text-overflow: ellipsis;
|
|
504
|
-
white-space: nowrap;
|
|
505
|
-
color: ${({theme:e})=>e.palette.text.primary};
|
|
506
|
-
font-size: 16px;
|
|
507
|
-
}
|
|
508
|
-
.component-version {
|
|
509
|
-
color: ${({theme:e})=>e.palette.text.secondary};
|
|
510
|
-
font-size: 12px;
|
|
511
|
-
margin-left: 4px;
|
|
512
|
-
transform: translateY(-1px);
|
|
513
|
-
}
|
|
514
|
-
`;function vs({blocklet:e,ancestors:r=[],meta:n,dependencies:a=[],setInstallComponentMeta:i,logoUrl:o=""}){const f=ye(),{t:c}=de(),d=()=>{n.bundleSource=e.bundleSource||{},i(n)},l=40;return t.jsxs(Kd,{id:`optional-component-${n.did}`,children:[t.jsxs("div",{className:"cell",children:[t.jsxs("div",{className:"component-left",children:[t.jsx("div",{className:"component-logo",children:o?t.jsx("img",{src:o,onError:()=>`${f.imgPrefix}/blocklet.png`,alt:n.title,style:{width:l,height:l}}):t.jsx(jo,{blocklet:e,ancestors:r})}),t.jsxs("div",{className:"component-header",children:[t.jsx("div",{className:"component-name",children:n.title}),t.jsx("div",{className:"component-version",children:n.version})]}),t.jsx(be,{title:[`${c("common.dependents")}: `,a.map(y=>t.jsx(B,{sx:{pl:1},children:`${y.parentTitle} ${y.required?`(${c("common.required")})`:""}`},y.parentName+y.mount_point))],children:t.jsx(B,{sx:{display:"flex",color:"primary.main",ml:1},children:t.jsx(fe,{icon:"octicon:package-dependents-16"})})})]}),t.jsx("div",{style:{flex:1}}),t.jsx(B,{sx:{minWidth:100,display:"flex",justifyContent:"flex-end"},children:t.jsx(Xt,{onClick:d,startIcon:t.jsx(fe,{icon:"ph:download-simple-bold"}),children:c("common.install")})})]}),t.jsx(on,{class:"line"},"line")]})}vs.propTypes={meta:g.object.isRequired,blocklet:g.object.isRequired,ancestors:g.array,setInstallComponentMeta:g.func.isRequired,logoUrl:g.string,dependencies:g.arrayOf(g.shape({parentDid:g.string,parentName:g.string,parentPoint:g.string,required:g.bool}))};const Kd=oe(ir)`
|
|
515
|
-
.line {
|
|
516
|
-
opacity: 0.5;
|
|
517
|
-
}
|
|
518
|
-
.cell {
|
|
519
|
-
display: flex;
|
|
520
|
-
width: 100%;
|
|
521
|
-
flex-direction: row;
|
|
522
|
-
align-items: center;
|
|
523
|
-
justify-content: flex-start;
|
|
524
|
-
padding-top: 16px;
|
|
525
|
-
padding-bottom: 16px;
|
|
526
|
-
}
|
|
527
|
-
.component-left {
|
|
528
|
-
display: flex;
|
|
529
|
-
flex-direction: row;
|
|
530
|
-
justify-content: flex-start;
|
|
531
|
-
align-items: center;
|
|
532
|
-
min-width: 0;
|
|
533
|
-
}
|
|
534
|
-
.component-logo {
|
|
535
|
-
width: 40px;
|
|
536
|
-
margin-left: 16px;
|
|
537
|
-
opacity: 0.5;
|
|
538
|
-
border-radius: 10px;
|
|
539
|
-
overflow: hidden;
|
|
540
|
-
}
|
|
541
|
-
.component-header {
|
|
542
|
-
flex: 1;
|
|
543
|
-
min-width: 0;
|
|
544
|
-
opacity: 0.5;
|
|
545
|
-
margin-left: 12px;
|
|
546
|
-
display: flex;
|
|
547
|
-
align-items: center;
|
|
548
|
-
align-items: flex-end;
|
|
549
|
-
cursor: pointer;
|
|
550
|
-
}
|
|
551
|
-
.component-name {
|
|
552
|
-
flex: 1;
|
|
553
|
-
opacity: 0.5;
|
|
554
|
-
color: ${({theme:e})=>e.palette.text.primary};
|
|
555
|
-
font-size: 16px;
|
|
556
|
-
}
|
|
557
|
-
.component-version {
|
|
558
|
-
opacity: 0.8;
|
|
559
|
-
color: ${({theme:e})=>e.palette.grey[400]};
|
|
560
|
-
font-size: 12px;
|
|
561
|
-
margin-left: 4px;
|
|
562
|
-
transform: translateY(-1px);
|
|
563
|
-
}
|
|
564
|
-
`;function Cs({blocklet:e,onUpdate:r=()=>{},getComponentUrl:n=()=>window.location.origin,...a}){const{t:i}=E.useContext(Se),{api:o,inService:f,info:c}=ye(),{addDeletingDid:d,removeDeletingDid:l,matchDeletingDid:y}=Yn(),[p,v]=E.useState(!1),[x,C]=E.useState(null),[w,_]=E.useState(null),[k,u]=E.useState(!1),[s,m]=E.useState(!1),[b,R]=E.useState(!1),[S,M]=E.useState(!1),[F,P]=E.useState(null),D=e&&e.structVersion!==H.APP_STRUCT_VERSION,[I,L]=E.useState(!1),z=[...e.children];e.meta.group!=="gateway"&&z.unshift(e),y(z.map(T=>T.meta.did));const q=async()=>{if(!p){v(!0);try{const{updateId:T,updateList:$}=(await o.checkComponentsForUpdates({input:{did:e.meta.did}})).preUpdateInfo||{};if(v(!1),!T){Y.info(i("blocklet.component.noUpdate"));return}const V=[];X.forEachChildSync(e,(se,{id:Q,ancestors:le})=>{const ve=$.find(ae=>ae.id===Q);if(ve){const ae=le.slice(1).concat(se).map(Ge=>Ge.meta.title||Ge.meta.name).join(" / "),ne=(le[1]||se).meta.did;V.push({groupId:ne,name:ae,version:se.meta.version,newVersion:ve.meta.version})}});const G={};V.forEach(se=>{G[se.groupId]?se.disabled=!0:G[se.groupId]=!0}),C({params:{updateId:T},list:V,checks:G,hasChecks:!0})}catch(T){v(!1),Y.error(xe(T))}}},K=async()=>{if(!p)try{v(!0);const T=Object.keys(x.checks).filter(V=>x.checks[V]),$={updateId:x.params.updateId,rootDid:e.meta.did,selectedComponents:T};await o.upgradeComponents({input:$}),v(!1),C(null),L(null)}catch(T){v(!1),Y.error(xe(T))}},te=async(T,$)=>{d(T.meta.did);try{await o.deleteComponent({input:{did:T.meta.did,keepData:$==="keepData",rootDid:e.meta.did}}),await dt(800)}catch(V){Y.error(xe(V)),l(T.meta.did)}},re=async T=>{try{await o.startBlocklet({input:{did:e.meta.did,componentDids:[T.meta.did]}}),await dt(800)}catch($){Y.error(xe($))}},N=async T=>{try{await o.stopBlocklet({input:{did:e.meta.did,componentDids:[T.meta.did]}}),await dt(800)}catch($){Y.error(xe($))}},ie=async T=>{try{await o.restartBlocklet({input:{did:e.meta.did,componentDids:[T.meta.did]}}),await dt(800)}catch($){Y.error(xe($))}},U=(T,$)=>{const{checked:V}=T.target;C(G=>{const se=Object.entries(G.checks).reduce((le,[ve,ae])=>(le[ve]=$===ve||$==="all"?V:ae,le),{}),Q=Object.values(se).includes(!0);return{...G,checks:se,hasChecks:Q}})},O=E.useMemo(()=>x?.list.filter(T=>!T.disabled).every(T=>x.checks[T.groupId]),[x]);Dd(q);const h=Bd({blocklet:e,scrollToComponent:!0}),j=F||h;return t.jsxs(Gd,{component:"div",...a,onUpdate:r,children:[t.jsxs(Vd,{display:"flex",children:[t.jsxs(Yd,{flexDirection:"row",className:"title",display:"flex",alignItems:"center",children:[z?.length?`${i("common.components")} (${z.length})`:`${i("common.components")}`,!D&&t.jsx(Ln,{permission:f?"":"mutate_blocklets",role:f?pt:[],children:t.jsx(Lo,{children:t.jsx($n,{top:1.2,right:.4,color:"error",badgeContent:"",variant:"dot",invisible:!I,children:t.jsxs(De,{disabled:p||X.isInProgress(e.status),onClick:()=>{q()},"data-cy":"check-for-updates",children:[t.jsx(B,{sx:{ml:.5,mr:.5,display:"flex"},children:p?t.jsx(we,{size:16}):t.jsx(Oa,{style:{fontSize:"1em"}})}),i("blocklet.component.checkUpdateTitle")]})})})})]}),t.jsx(Ln,{permission:f?"":"mutate_blocklets",role:f?pt:[],children:t.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:.5},children:[!D&&t.jsx(ls,{blocklet:e,serverVersion:c.version,disabled:p||X.isInProgress(e.status)}),t.jsx(Oo,{"data-cy":"component-actions",actions:[{icon:t.jsx(fe,{icon:"fluent:link-20-filled"}),onClick:()=>m(!0),text:i("router.rule.add.title"),disabled:p||X.isInProgress(e.status)},...D?[]:[{icon:t.jsx(fe,{icon:"mdi:variable"}),onClick:()=>{R(!0)},text:i("common.environments")},{icon:t.jsx(No,{}),onClick:()=>{M(!0)},text:i("common.preferences")}]].filter(Boolean)})]})})]}),z?.length?t.jsxs(t.Fragment,{children:[t.jsxs(B,{sx:{mt:2},children:[e.meta.group!=="gateway"&&t.jsx(qn,{blocklet:e,app:e,onRemove:te,onStart:re,onStop:N,onRestart:ie,getComponentUrl:n},`0-${e.meta.did}`),e.children.map(T=>t.jsx(qn,{depth:1,blocklet:T,ancestors:[e],app:e,onRemove:te,onStart:re,onStop:N,onRestart:ie,getComponentUrl:n},`1-${T.meta.did}`))]},`top-blocklet-${e.meta.did}`),e.optionalComponents?.map(T=>t.jsx(ir,{children:t.jsx(vs,{blocklet:T,ancestors:[e],setInstallComponentMeta:P,...T})},T.meta.did))]}):t.jsx(B,{sx:{mt:8},children:t.jsx(Ri,{children:i("blocklet.component.noComponent")})}),!!e.site.rules.length&&t.jsx(B,{sx:{mt:0,".component-item__indent":{pl:2,width:0}},children:t.jsx(Td,{})}),!!x&&t.jsx(gr,{open:!0,fullWidth:!0,children:t.jsxs(B,{sx:{paddingY:1.5},children:[t.jsx(xr,{children:i("blocklet.component.updateTitle")}),t.jsxs(B,{component:yr,sx:{py:4},children:[x.list.filter(T=>!T.disabled).length>1&&t.jsxs(B,{sx:{display:"flex",alignItems:"center"},children:[t.jsx(vr,{checked:O,onChange:T=>U(T,"all")}),t.jsx(B,{children:i(O?"common.unselectAll":"common.selectAll")})]}),x.list.map(T=>t.jsxs(B,{sx:{display:"flex",alignItems:"center",mb:1},children:[t.jsx(vr,{checked:x.checks[T.groupId],onChange:$=>U($,T.groupId),style:{marginLeft:T.disabled?16:0,alignSelf:"flex-start"},defaultChecked:!0,disabled:T.disabled}),t.jsxs(B,{sx:{flexGrow:1},children:[t.jsx(B,{xs:8,sx:{pt:1},children:T.name}),T.version&&t.jsxs(ze,{container:!0,spacing:2,sx:{fontSize:"h6.fontSize",alignItems:"center"},children:[t.jsx(ze,{size:3,children:T.version}),t.jsx(ze,{size:1,children:t.jsx(_i,{style:{fontSize:"0.9em"}})}),t.jsx(ze,{size:3,children:t.jsx(B,{sx:{color:"secondary.main"},children:T.newVersion})})]})]},`${T.name}-${T.newVersion}`)]},T.name))]}),t.jsxs(Si,{style:{padding:"8px 24px 24px"},children:[t.jsx(De,{onClick:()=>{C(null)},children:i("common.cancel")}),t.jsxs(De,{onClick:T=>{T.stopPropagation(),K()},color:"primary",disabled:p||!x.hasChecks,variant:"contained",autoFocus:!0,children:[p&&t.jsx(we,{size:16}),i("common.update")]})]})]})}),!!w&&t.jsx(gr,{open:!0,fullWidth:!0,onClose:()=>_(!1),children:t.jsxs(B,{sx:{paddingY:1.5},children:[t.jsx(xr,{children:i("common.configuration")}),t.jsx(yr,{children:t.jsx(B,{sx:{py:2},children:t.jsx(Nn,{control:t.jsx(Di,{checked:k,onChange:T=>u(!!T.target.checked)}),label:i("blocklet.component.showContainer")})})})]})}),t.jsx(tr,{selectedMeta:j,blocklet:e,showDialog:!!j,setShowDialog:()=>P(null)}),s&&t.jsx(cs,{hiddenChildren:!0,open:!0,onClose:()=>m(!1)}),b&&t.jsx(Xn,{open:!0,onClose:()=>R(!1),hiddenChildren:!0,blocklet:e,ancestors:[]}),S&&t.jsx(or,{open:!0,onClose:()=>M(!1),blocklet:e,ancestors:[]})]})}Cs.propTypes={blocklet:g.object.isRequired,onUpdate:g.func,getComponentUrl:g.func};const Gd=oe.div`
|
|
565
|
-
.title {
|
|
566
|
-
font-size: 1.2rem;
|
|
567
|
-
font-weight: bold;
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
@keyframes showDelay {
|
|
571
|
-
0% {
|
|
572
|
-
opacity: 0;
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
100% {
|
|
576
|
-
opacity: 1;
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
.component-item {
|
|
581
|
-
animation: showDelay 0.75s ease 1;
|
|
582
|
-
}
|
|
583
|
-
`,Vd=oe(B)`
|
|
584
|
-
${e=>e.theme.breakpoints.up("sm")} {
|
|
585
|
-
flex-direction: row;
|
|
586
|
-
justify-content: space-between;
|
|
587
|
-
align-items: center;
|
|
588
|
-
}
|
|
589
|
-
${e=>e.theme.breakpoints.down("sm")} {
|
|
590
|
-
flex-direction: column;
|
|
591
|
-
justify-content: flex-end;
|
|
592
|
-
align-items: flex-end;
|
|
593
|
-
.sm-hide-icon > svg {
|
|
594
|
-
display: none;
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
`,Yd=oe(B)`
|
|
598
|
-
${e=>e.theme.breakpoints.down("sm")} {
|
|
599
|
-
width: 100%;
|
|
600
|
-
justify-content: space-between;
|
|
601
|
-
}
|
|
602
|
-
`;function jp(e){const{locale:r}=E.useContext(Se),{blocklet:n,recommendedDomain:a}=Pa(),i=o=>Ei({blocklet:n,domain:{value:a||`${ki.encode(n.appPid)}.${H.DEFAULT_DID_DOMAIN}`},mountPoint:o,params:Gn(n,r)});return t.jsx(Cs,{blocklet:n,getComponentUrl:i,...e})}export{jp as default};
|