@abtnode/blocklet-services 1.16.45-beta-20250614-101901-d1700f8d → 1.16.45-beta-20250620-082630-c0c76051
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/index.js +11 -5
- package/api/routes/csp-proxy.js +13 -14
- package/dist/assets/{AdapterDayjs-Cnt9tqu2.js → AdapterDayjs-T0keO70D.js} +1 -1
- package/dist/assets/{ArrowDropDown-BMwBndHf.js → ArrowDropDown-DKq28w-B.js} +1 -1
- package/dist/assets/{CheckCircle-41Yqmlux.js → CheckCircle-DYKWpCjc.js} +1 -1
- package/dist/assets/{ChevronLeft-CLsrCaxE.js → ChevronLeft-C5ZElVOZ.js} +1 -1
- package/dist/assets/{ChevronRight-BVlAyY8t.js → ChevronRight-BDtG7F9C.js} +1 -1
- package/dist/assets/{DeleteOutline-5003D11l.js → DeleteOutline-CYuYysba.js} +1 -1
- package/dist/assets/{Done-LE-14AsK.js → Done-C4iTqhTW.js} +1 -1
- package/dist/assets/{Download-BGEarAho.js → Download-CkjiFBw2.js} +1 -1
- package/dist/assets/{Edit-CrL54Zhc.js → Edit-D-oqMZ6h.js} +1 -1
- package/dist/assets/{Error-quFZHb54.js → Error-Dt1QvSlR.js} +1 -1
- package/dist/assets/{ExpandLess-DJGiqXwX.js → ExpandLess-CRv5O8qM.js} +1 -1
- package/dist/assets/{Google-woDe3URG.js → Google-DboCD85r.js} +1 -1
- package/dist/assets/{Home-C0Jy-iyL.js → Home-CROW9qUz.js} +1 -1
- package/dist/assets/{InfoOutlined-3bCMdMdL.js → InfoOutlined-B5f3YRb4.js} +1 -1
- package/dist/assets/{Launch-DrVQ-_LF.js → Launch-Cy-UlooC.js} +1 -1
- package/dist/assets/{LaunchOutlined-DCRD1Xd5.js → LaunchOutlined-Bcn_86ca.js} +1 -1
- package/dist/assets/{MoreHoriz-CCqkD-2X.js → MoreHoriz-H_VQNQ9b.js} +1 -1
- package/dist/assets/{PlayArrow-b0SwYNYM.js → PlayArrow-DZsdEeq_.js} +1 -1
- package/dist/assets/{TuneOutlined-CfZi6Ajz.js → TuneOutlined-GyTVf3HU.js} +1 -1
- package/dist/assets/{ViewList-DHazaGfw.js → ViewList-D0tVfaVX.js} +1 -1
- package/dist/assets/{access-control-CrHHfd-3.js → access-control-C9hWo6TU.js} +1 -1
- package/dist/assets/{actions-DP5QUAr6.js → actions-BgkGoToI.js} +1 -1
- package/dist/assets/add-component-core-CpBArNQj.js +768 -0
- package/dist/assets/{add-resource-BTg7Qs0I.js → add-resource-YRx2pKzx.js} +1 -1
- package/dist/assets/{addon-BKkiKK74.js → addon-DZBLWIf7.js} +1 -1
- package/dist/assets/{advanced-BaQVvy3K.js → advanced-C9eBqn30.js} +1 -1
- package/dist/assets/api-C1S8LUld.js +1 -0
- package/dist/assets/{appearance-CuPgS_bN.js → appearance-DzftIlmu.js} +1 -1
- package/dist/assets/{ar-C_PbiO-w.js → ar-DLXKKOGO.js} +1 -1
- package/dist/assets/{audit-logs-CUC_aqut.js → audit-logs-Cljb9yLV.js} +1 -1
- package/dist/assets/{authorize-DCQNYqJl.js → authorize-BS4vDs5i.js} +1 -1
- package/dist/assets/{base-chart-C2FJuVG1.js → base-chart-CoApVzod.js} +1 -1
- package/dist/assets/{base32-CRxHrKOV.js → base32-Cbt7-U8e.js} +1 -1
- package/dist/assets/{branding-DrCX9AmH.js → branding-BuuaXyqZ.js} +1 -1
- package/dist/assets/{branding-Di3by3dx.js → branding-uCV5ZREf.js} +2 -2
- package/dist/assets/{bundle-avatar-hjU0GiOA.js → bundle-avatar-CH2OoDP-.js} +1 -1
- package/dist/assets/{button-BWISngjs.js → button-ogiWKbo_.js} +1 -1
- package/dist/assets/{click-to-copy-DoEzJWuJ.js → click-to-copy-D0HginOX.js} +1 -1
- package/dist/assets/{cloneDeep-Jl_OPbSo.js → cloneDeep-CDl5kZTY.js} +1 -1
- package/dist/assets/{collapse-QPZHNi8E.js → collapse-D4xd-ptF.js} +1 -1
- package/dist/assets/{complete-EC4tK63r.js → complete-D2In_TeH.js} +1 -1
- package/dist/assets/{component-D9Dwvz3W.js → component-DN1QsNYm.js} +72 -72
- package/dist/assets/{config-BMkCrsxC.js → config-DEbtcbH9.js} +1 -1
- package/dist/assets/{config-OasAWfj3.js → config-DS_kGhWk.js} +1 -1
- package/dist/assets/{config-navigation-BRSxDGox.js → config-navigation-BB2LlxWl.js} +3 -3
- package/dist/assets/{config-space-DlI-IdsO.js → config-space-DlQnLPiY.js} +1 -1
- package/dist/assets/{confirm-C3U-iZgd.js → confirm-Bbp7EOHO.js} +1 -1
- package/dist/assets/{connect-CJtKCJvL.js → connect-CtbQgg8c.js} +1 -1
- package/dist/assets/{connect-2DXv3-VS.js → connect-hUOpYByL.js} +1 -1
- package/dist/assets/{connect-to-DJWMCDWB.js → connect-to-EzXJLWP1.js} +1 -1
- package/dist/assets/{dashboard-Dswj6QO1.js → dashboard-CpxtvWAW.js} +3 -3
- package/dist/assets/{de-m_nuB8Qa.js → de-CnbmrteH.js} +1 -1
- package/dist/assets/{delete-confirm-BPN0b1Ew.js → delete-confirm-BdthpUzC.js} +1 -1
- package/dist/assets/{did-address-BW7HQteV.js → did-address-DFiM35OM.js} +1 -1
- package/dist/assets/{domain-i1NE8m1K.js → domain-C7iO-bfS.js} +1 -1
- package/dist/assets/{domain-action-card-DK0_bx6-.js → domain-action-card-CqcqlPAn.js} +1 -1
- package/dist/assets/domains-z_Wu9ucc.js +1 -0
- package/dist/assets/{dot-iw3hN9HL.js → dot-4jhL56kz.js} +1 -1
- package/dist/assets/{email-DLukryRf.js → email-CH6lvIGE.js} +1 -1
- package/dist/assets/{es-BrT673RG.js → es-C7oXJBWv.js} +1 -1
- package/dist/assets/{exchange-passport-CtBW8-z_.js → exchange-passport-F8-Xn3rX.js} +1 -1
- package/dist/assets/{fr-BmbyLkZB.js → fr-DzleTcLj.js} +1 -1
- package/dist/assets/{fuel-TZdSL_3D.js → fuel-BRI4NZNF.js} +1 -1
- package/dist/assets/{gen-access-key-CqRouazq.js → gen-access-key-CjcE_UoL.js} +1 -1
- package/dist/assets/{get-safe-url-CROWoUui.js → get-safe-url-BS4IIyYC.js} +1 -1
- package/dist/assets/{get-safe-url-DPUvqYEg.js → get-safe-url-CuT70yLx.js} +1 -1
- package/dist/assets/{hi-CL8_a9An.js → hi-B24wH0bs.js} +1 -1
- package/dist/assets/{home-hnxCx6H0.js → home-B7IeN8M_.js} +1 -1
- package/dist/assets/{id-DkcL27A7.js → id-BIjW1vW9.js} +1 -1
- package/dist/assets/{iframe-BB2MTAjn.js → iframe-DYXqfKJj.js} +1 -1
- package/dist/assets/{index-CnSfgOR1.js → index-0KJGv8YB.js} +1 -1
- package/dist/assets/{index-B6fg0S6c.js → index-BAtw7eB6.js} +1 -1
- package/dist/assets/{index-vo14BOSK.js → index-BEyvIdTp.js} +1 -1
- package/dist/assets/{index-gRIImn2q.js → index-BMCGWiyM.js} +43 -43
- package/dist/assets/{index-C5pIrCeP.js → index-BW2DapLf.js} +3 -3
- package/dist/assets/{index-BCtTVvHw.js → index-BxJZWVOT.js} +1 -1
- package/dist/assets/{index-CcRZdZB8.js → index-ClFIRXfV.js} +1 -1
- package/dist/assets/{index-CIN38Uuw.js → index-CqrC0g0e.js} +1 -1
- package/dist/assets/{index-ClKx_csi.js → index-D6ye_M7F.js} +1 -1
- package/dist/assets/{index-BVBJxqPd.js → index-D7U3pqVe.js} +3 -3
- package/dist/assets/{index-zlAFuATT.js → index-DDI23z2P.js} +1 -1
- package/dist/assets/{index-OIQ3e2Ld.js → index-DECQi8Vb.js} +1 -1
- package/dist/assets/{index-CsA1GkvG.js → index-DeekZg9t.js} +1 -1
- package/dist/assets/{index-C_MX-sJs.js → index-DhXQuL-K.js} +1 -1
- package/dist/assets/{index-BXRM3Fxt.js → index-Dj3HMPh8.js} +1 -1
- package/dist/assets/{index-BdgSI0pZ.js → index-Dl0q_c7r.js} +1 -1
- package/dist/assets/{index-S_bysQ3H.js → index-DyCrJT9-.js} +1 -1
- package/dist/assets/{index-C-reBQ41.js → index-WjR0qttM.js} +1 -1
- package/dist/assets/index-ZdwmM3LS.js +284 -0
- package/dist/assets/{index-BAbxWghb.js → index-mitJwLHE.js} +4 -4
- package/dist/assets/{index-CKY4HT0P.js → index-w4f-mlFt.js} +1 -1
- package/dist/assets/{invitation-BvT07MYl.js → invitation-D7jOoJzU.js} +1 -1
- package/dist/assets/{invite-rbOwUpQz.js → invite-BiE9G1lr.js} +1 -1
- package/dist/assets/{issue-passport-DqDO2lOV.js → issue-passport-BxmBoE32.js} +1 -1
- package/dist/assets/{item-Kx7a4SrL.js → item-BuWWRgL8.js} +1 -1
- package/dist/assets/{ja-BVJLb0qY.js → ja-mu0bc5Fx.js} +1 -1
- package/dist/assets/{ko-Dd2Xcc8p.js → ko-CSWdQF8q.js} +1 -1
- package/dist/assets/{layout-veO5MoKq.js → layout-Balq-c2F.js} +1 -1
- package/dist/assets/{list-CzMORzTV.js → list-C4l_W2F_.js} +8 -8
- package/dist/assets/{list-fB7PuMGP.js → list-DBhbLnjZ.js} +2 -2
- package/dist/assets/localization-crkTHEvo.js +1 -0
- package/dist/assets/{log-DFvq1Ya8.js → log-CcBqhBEJ.js} +1 -1
- package/dist/assets/{logger-Ch0sfkGE.js → logger-tBhN561y.js} +1 -1
- package/dist/assets/{login-Cc4U4UbE.js → login-BF1AdZ-L.js} +1 -1
- package/dist/assets/{login-oauth-callback-BH3tsO_b.js → login-oauth-callback-Cv5MlgIc.js} +1 -1
- package/dist/assets/{logo-uploader-BfnTtNB4.js → logo-uploader-C1N-bsM2.js} +3 -3
- package/dist/assets/{lost-passport-CEk2gBj4.js → lost-passport-C2Km75Ka.js} +1 -1
- package/dist/assets/{omit-BlzmxIB5.js → omit-Cao4GLS7.js} +1 -1
- package/dist/assets/{open-window-DNB3B3k8.js → open-window-uY95lBbB.js} +1 -1
- package/dist/assets/{overview-DqaHfHTX.js → overview-BgK_P3ko.js} +1 -1
- package/dist/assets/{page-header-DmVEhivC.js → page-header-CiTTXRdM.js} +1 -1
- package/dist/assets/{passport-item-Dw5vAzG8.js → passport-item-fJ88Wv4t.js} +1 -1
- package/dist/assets/{permission-CmSuLv3N.js → permission-CQWJVo4a.js} +1 -1
- package/dist/assets/{preferences-DoIPeyXx.js → preferences-Uz2t9auQ.js} +1 -1
- package/dist/assets/{profile-embed-BzGFlRQR.js → profile-embed-C7ypVv2q.js} +1 -1
- package/dist/assets/{pt-BfbUt_Nx.js → pt-Odg8daEV.js} +1 -1
- package/dist/assets/publish-resource-DLqFuWGv.js +1 -0
- package/dist/assets/{react-beautiful-dnd.esm-B9_jlyiB.js → react-beautiful-dnd.esm-DMJVQVbv.js} +1 -1
- package/dist/assets/{ru-uXrAFAz0.js → ru-OkiNIvy3.js} +1 -1
- package/dist/assets/{runtime-D90jDC3r.js → runtime-XL6C0WHV.js} +1 -1
- package/dist/assets/{sanitize-B18rcrOf.js → sanitize-e0A8A-yt.js} +1 -1
- package/dist/assets/sdk-D3QR4FNa.js +1 -0
- package/dist/assets/{security-D8kq04bN.js → security-C5-rO801.js} +1 -1
- package/dist/assets/{session-igceijP1.js → session-BDyIB4uh.js} +1 -1
- package/dist/assets/{setup-n8Ikg3vS.js → setup-Dpq6lpy4.js} +4 -4
- package/dist/assets/{spaces-DVZd70Fi.js → spaces-BR4I2U0t.js} +1 -1
- package/dist/assets/{start-YvnbU7Eo.js → start-BTmB0MgK.js} +1 -1
- package/dist/assets/{starting-progress-BOsNmsFB.js → starting-progress-BsYL_5xB.js} +1 -1
- package/dist/assets/{status-BGmXEfM-.js → status-D8GKQyA3.js} +1 -1
- package/dist/assets/{step-actions-_L8XSfG4.js → step-actions-njetG0Iy.js} +1 -1
- package/dist/assets/{studio-BImlv1KI.js → studio-DSEHQtAw.js} +1 -1
- package/dist/assets/{switch-control-CGm8CkkK.js → switch-control-BCB3_Ctk.js} +1 -1
- package/dist/assets/{table-tips-C8uXQ5tF.js → table-tips-Cjv8HIcF.js} +1 -1
- package/dist/assets/{th-BnT_StPj.js → th-esLoaeiE.js} +1 -1
- package/dist/assets/{traffic-NFBtntJ-.js → traffic-DAzuj4ZR.js} +1 -1
- package/dist/assets/{transfer-CJjNcsEy.js → transfer-NRpeYO3B.js} +1 -1
- package/dist/assets/{unsubscribe-Co6pOu2N.js → unsubscribe-CBvTeTZf.js} +1 -1
- package/dist/assets/{use-blocklet-logo-BUV6ER3X.js → use-blocklet-logo-DwwmdicD.js} +1 -1
- package/dist/assets/{useAsync-DVHp96Uu.js → useAsync-C62uE2pS.js} +1 -1
- package/dist/assets/{useLocalStorage-Cw7tZL-P.js → useLocalStorage-iQ2AmaOA.js} +1 -1
- package/dist/assets/{user-center-CHyAfsyF.js → user-center-CCOO4S3Y.js} +3 -3
- package/dist/assets/{util-BfQiNudG.js → util-BK7oThoq.js} +1 -1
- package/dist/assets/{util-BKry4J3y.js → util-paKPrRHx.js} +1 -1
- package/dist/assets/{vendor-arcblock-Cspz6Fmz.js → vendor-arcblock-f1tICt1E.js} +59 -59
- package/dist/assets/{vendor-hooks-BFlOfe0M.js → vendor-hooks-DqdmWCmo.js} +1 -1
- package/dist/assets/{vendor-utils-BotmZdBm.js → vendor-utils-BfZ4tlod.js} +1 -1
- package/dist/assets/{vendor-ux-did-connect-ETVwYaIV.js → vendor-ux-did-connect-BbCim3WZ.js} +3 -3
- package/dist/assets/{vi-DmitUjjk.js → vi-BF6u6-98.js} +1 -1
- package/dist/assets/wrap-locale-BLcZ6jMd.js +1 -0
- package/dist/assets/{zh-syG1cNt6.js → zh-DJTjvgj8.js} +1 -1
- package/dist/assets/{zh-tw-DnHJQaoN.js → zh-tw-B7cFexwg.js} +1 -1
- package/dist/index.html +5 -5
- package/dist/service-worker.js +1 -1
- package/package.json +31 -31
- package/dist/assets/add-component-core-8M0C-Kp3.js +0 -768
- package/dist/assets/api-87p2GGd0.js +0 -1
- package/dist/assets/domains-CDhyGAuz.js +0 -1
- package/dist/assets/index-D3Sj3zCK.js +0 -284
- package/dist/assets/localization-CWcvfX_h.js +0 -1
- package/dist/assets/publish-resource-Dbw9ICt4.js +0 -1
- package/dist/assets/sdk-DDQwgEwY.js +0 -1
- package/dist/assets/wrap-locale-ugI1o5oc.js +0 -1
|
@@ -1,768 +0,0 @@
|
|
|
1
|
-
import{a9 as Cl,j as o,H as N,ab as St,ah as Xe,aa as X,T as ve,v as Xt,bs as Ti,bR as ji,I as js,bJ as ks,bY as Os,A as Is,be as Pl,b8 as Rs,bq as Ll,O as Er,bE as _l,bF as Nl,bG as Al,bx as Dl,ak as Cs,L as Ml,b7 as Fl,b5 as Bl,q as ki,ad as Ps,af as $l,al as it,e as Qt,bK as Ul,y as ir,Z as Ls,a1 as _s,M as Ns,bT as As,an as Wl,ai as Vt,as as To,D as zl,E as jo,a7 as ql,P as Kl,G as Gl,w as Hl,a8 as Vl,N as ko}from"./vendor-mui-core-Bq8gXTan.js";import{r as A,g as Oi,h as Xl,f as Yl,a as Ii,e as Se,b as zt,l as Ql}from"./vendor-react-DEoibe3W.js";import{j as Ds,d as Jl,S as Zl,s as Ms,A as ec}from"./item-Kx7a4SrL.js";import{r as tc,B as ht,ar as Ri,a1 as Fs,k as Bs,a as mt,I as ft,aR as nc,aI as rc,i as Sr,bd as ic,bz as oc,bA as sc,aY as ac,at as $s,a3 as Tr,bB as Oo,aw as lc,F as cc,s as Jt,a2 as yr,aD as Io,ao as Us,bC as uc,d as Ws,bh as zs,p as dc,E as qs,a5 as hc,bD as fc,b as si,bE as pc}from"./vendor-ux-did-connect-ETVwYaIV.js";import{m as Ro,c as wt,n as mc,E as jr,q as gc,s as vc,t as yc,L as bc,S as xc}from"./vendor-arcblock-Cspz6Fmz.js";import{L as Co}from"./launch-result-message-AharZGq2.js";import{P as Ks}from"./page-header-DmVEhivC.js";import{e as dt,v as wc,B as Ec,A as gn,z as kr,E as Po,a1 as Gs,a9 as Sc,ai as Tc,J as jc,o as Mr,$ as kc,aj as Oc,ak as Ic,al as Rc,b as Xn,am as Cc,c as Pc}from"./vendor-utils-BotmZdBm.js";import{f as ai}from"./index-8eXqqyHQ.js";import{D as Nn,f as Wt,a0 as Lc,a1 as _c,a2 as Nc,H as Ac,a3 as Dc,a4 as Mc,a5 as Fc,G as Or,a6 as Hs,_ as Bc,a7 as $c,a8 as Uc,a9 as Wc,aa as lr,ab as Lo,ac as zc}from"./index-gRIImn2q.js";import{u as qc,C as Kc}from"./config-space-DlI-IdsO.js";import{R as Fr}from"./logo-uploader-BfnTtNB4.js";import{S as Gc}from"./index-S_bysQ3H.js";import{s as Vs,h as Hc,w as Vc,f as Xc,a as Yc,b as Qc,c as Jc,M as Zc}from"./index-CTlzm-Mc.js";import{l as or,b as eu,u as tu,f as Xs,a as nu,t as ru}from"./vendor-hooks-BFlOfe0M.js";import{g as iu}from"./get-safe-url-DPUvqYEg.js";import{p as ou}from"./index-BCtTVvHw.js";import{r as su}from"./cloneDeep-Jl_OPbSo.js";import{I as _o}from"./index-zlAFuATT.js";import{u as au}from"./session-igceijP1.js";import{W as lu}from"./did-address-BW7HQteV.js";import{_ as Ys}from"./useLocalStorage-Cw7tZL-P.js";import{a as No}from"./api-87p2GGd0.js";import{d as cu,a as uu,v as du,e as hu}from"./util-BfQiNudG.js";import{u as Qs}from"./use-mobile-DwzRjjku.js";import{C as fu}from"./content-layout-BC2QkTYi.js";import{C as pu,D as mu,a as gu}from"./connect-to-DJWMCDWB.js";import{d as vu}from"./ArrowDropDown-BMwBndHf.js";import{d as yu}from"./ChevronLeft-CLsrCaxE.js";import{d as bu}from"./ChevronRight-BVlAyY8t.js";import{d as Br}from"./search-4YYphs0l.js";const gg="blocklet-add-component-registry",vg="server-add-registry",yg=e=>`resource-${e}-add-registry`;var Ci={},xu=Cl;Object.defineProperty(Ci,"__esModule",{value:!0});var Js=Ci.default=void 0,wu=xu(tc()),Eu=o;Js=Ci.default=(0,wu.default)((0,Eu.jsx)("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5"}),"Link");function Zs(e){const{info:t}=Nn();return A.useMemo(()=>{var n,r,i;return!e||!((n=e.docker)!=null&&n.image)||(r=e.docker)!=null&&r.image&&((i=e.docker)!=null&&i.runBaseScript)?!0:window.blocklet?window.blocklet.enableDocker&&window.blocklet.enableDockerNetwork:t.enableDocker&&t.enableDockerNetwork},[e,t])}function Pi({disabled:e,children:t,onConfirm:n}){return A.useEffect(()=>{if(e)return()=>{};const r=i=>{i.code==="Enter"&&(i.metaKey===!0||i.ctrlKey===!0)&&(i.preventDefault(),i.stopPropagation(),n())};return document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r)}},[e,n]),t}Pi.propTypes={disabled:N.bool,children:N.any.isRequired,onConfirm:N.func.isRequired};Pi.defaultProps={disabled:!1};function Li({onContinue:e,nextDisabled:t,launching:n,texts:r,description:i}){const[s,a]=A.useState(!1),c=()=>a(f=>!f);return o.jsxs(o.Fragment,{children:[o.jsx(Su,{children:o.jsxs(Pi,{disabled:t,onConfirm:e,children:[o.jsx("div",{className:"eula-trigger",onClick:c,children:r.listenName}),o.jsx(ht,{disabled:t,color:"primary",variant:"contained",className:"next-button",onClick:e,children:n?o.jsxs(o.Fragment,{children:[o.jsx(St,{size:14}),r.launchingText]}):r.buttonNext})]})}),o.jsx(Ri,{open:s,title:r.listenName,onClose:()=>a(!1),children:i})]})}Li.propTypes={onContinue:N.func.isRequired,nextDisabled:N.bool,launching:N.bool,description:N.any,texts:N.object};Li.defaultProps={nextDisabled:!1,launching:!1,description:"",texts:{listenName:"",launchingText:"",buttonNext:""}};const Su=Xe.div`
|
|
2
|
-
margin: 0 auto;
|
|
3
|
-
display: flex;
|
|
4
|
-
justify-content: space-between;
|
|
5
|
-
align-items: center;
|
|
6
|
-
|
|
7
|
-
@media (max-width: ${e=>e.theme.breakpoints.values.sm}px) {
|
|
8
|
-
flex-direction: column;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.eula-trigger {
|
|
12
|
-
cursor: pointer;
|
|
13
|
-
text-decoration: underline;
|
|
14
|
-
${e=>e.theme.breakpoints.up("md")} {
|
|
15
|
-
padding-right: 24px;
|
|
16
|
-
}
|
|
17
|
-
${e=>e.theme.breakpoints.down("md")} {
|
|
18
|
-
padding: 16px;
|
|
19
|
-
}
|
|
20
|
-
font-size: 14px;
|
|
21
|
-
white-space: nowrap;
|
|
22
|
-
&:hover {
|
|
23
|
-
color: ${e=>e.theme.palette.primary.main};
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.next-button {
|
|
28
|
-
min-width: 200px;
|
|
29
|
-
}
|
|
30
|
-
`;var _i={exports:{}},Ao=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Tu=/\n/g,ju=/^\s*/,ku=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Ou=/^:\s*/,Iu=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Ru=/^[;\s]*/,Cu=/^\s+|\s+$/g,Pu=`
|
|
31
|
-
`,Do="/",Mo="*",fn="",Lu="comment",_u="declaration",Nu=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(S){var j=S.match(Tu);j&&(n+=j.length);var D=S.lastIndexOf(Pu);r=~D?S.length-D:r+S.length}function s(){var S={line:n,column:r};return function(j){return j.position=new a(S),y(),j}}function a(S){this.start=S,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function c(S){var j=new Error(t.source+":"+n+":"+r+": "+S);if(j.reason=S,j.filename=t.source,j.line=n,j.column=r,j.source=e,!t.silent)throw j}function f(S){var j=S.exec(e);if(j){var D=j[0];return i(D),e=e.slice(D.length),j}}function y(){f(ju)}function l(S){var j;for(S=S||[];j=u();)j!==!1&&S.push(j);return S}function u(){var S=s();if(!(Do!=e.charAt(0)||Mo!=e.charAt(1))){for(var j=2;fn!=e.charAt(j)&&(Mo!=e.charAt(j)||Do!=e.charAt(j+1));)++j;if(j+=2,fn===e.charAt(j-1))return c("End of comment missing");var D=e.slice(2,j-2);return r+=2,i(D),e=e.slice(j),r+=2,S({type:Lu,comment:D})}}function k(){var S=s(),j=f(ku);if(j){if(u(),!f(Ou))return c("property missing ':'");var D=f(Iu),L=S({type:_u,property:Fo(j[0].replace(Ao,fn)),value:D?Fo(D[0].replace(Ao,fn)):fn});return f(Ru),L}}function m(){var S=[];l(S);for(var j;j=k();)j!==!1&&(S.push(j),l(S));return S}return y(),m()};function Fo(e){return e?e.replace(Cu,fn):fn}var Au=Nu;function ea(e,t){var n=null;if(!e||typeof e!="string")return n;for(var r,i=Au(e),s=typeof t=="function",a,c,f=0,y=i.length;f<y;f++)r=i[f],a=r.property,c=r.value,s?t(a,c,r):c&&(n||(n={}),n[a]=c);return n}_i.exports=ea;_i.exports.default=ea;var Du=_i.exports;const Mu=Oi(Du),Fu={}.hasOwnProperty;function Bu(e,t,n){if(typeof e!="function")throw new TypeError("h is not a function");const r=Uu(e),i=qu(e),s=zu(e);let a,c;if(typeof n=="string"||typeof n=="boolean"?(a=n,n={}):(n||(n={}),a=n.prefix),t&&t.type==="root"){const f=t.children[0];c=t.children.length===1&&f.type==="element"?f:{type:"element",tagName:"div",properties:{},children:t.children}}else if(t&&t.type==="element")c=t;else throw new Error("Expected root or element, not `"+(t&&t.type||t)+"`");return ta(e,c,{schema:n.space==="svg"?Vs:Hc,prefix:a==null?r||i||s?"h-":void 0:typeof a=="string"?a:a?"h-":void 0,key:0,react:r,vue:i,vdom:s,hyperscript:Wu(e)})}function ta(e,t,n){const r=n.schema;let i=r,s=t.tagName;const a={},c=[];let f=-1,y;r.space==="html"&&s.toLowerCase()==="svg"&&(i=Vs,n.schema=i);for(y in t.properties)t.properties&&Fu.call(t.properties,y)&&$u(a,y,t.properties[y],n,s);if(n.vdom&&(i.space==="html"?s=s.toUpperCase():i.space&&(a.namespace=Vc[i.space])),n.prefix&&(n.key++,a.key=n.prefix+n.key),t.children)for(;++f<t.children.length;){const l=t.children[f];l.type==="element"?c.push(ta(e,l,n)):l.type==="text"&&c.push(l.value)}return n.schema=r,c.length>0?e.call(t,s,a,c):e.call(t,s,a)}function $u(e,t,n,r,i){const s=Xc(r.schema,t);let a;n==null||typeof n=="number"&&Number.isNaN(n)||n===!1&&(r.vue||r.vdom||r.hyperscript)||!n&&s.boolean&&(r.vue||r.vdom||r.hyperscript)||(Array.isArray(n)&&(n=s.commaSeparated?Yc(n):Qc(n)),s.boolean&&r.hyperscript&&(n=""),s.property==="style"&&typeof n=="string"&&(r.react||r.vue||r.vdom)&&(n=Ku(n,i)),r.vue?s.property!=="style"&&(a="attrs"):s.mustUseProperty||(r.vdom?s.property!=="style"&&(a="attributes"):r.hyperscript&&(a="attrs")),a?e[a]=Object.assign(e[a]||{},{[s.attribute]:n}):s.space&&r.react?e[Jc[s.property]||s.property]=n:e[s.attribute]=n)}function Uu(e){const t=e("div",{});return!!(t&&("_owner"in t||"_store"in t)&&(t.key===void 0||t.key===null))}function Wu(e){return"context"in e&&"cleanup"in e}function zu(e){return e("div",{}).type==="VirtualNode"}function qu(e){const t=e("div",{});return!!(t&&t.context&&t.context._isVue)}function Ku(e,t){const n={};try{Mu(e,(r,i)=>{r.slice(0,4)==="-ms-"&&(r="ms-"+r.slice(4)),n[r.replace(/-([a-z])/g,(s,a)=>a.toUpperCase())]=i})}catch(r){const i=r;throw i.message=t+"[style]"+i.message.slice(9),i}return n}var Gu=na;function na(e){if(typeof e=="string")return Yu(e);if(e==null)return Qu;if(typeof e=="object")return("length"in e?Xu:Vu)(e);if(typeof e=="function")return e;throw new Error("Expected function, string, or object as test")}function Hu(e){for(var t=[],n=e.length,r=-1;++r<n;)t[r]=na(e[r]);return t}function Vu(e){return t;function t(n){var r;for(r in e)if(n[r]!==e[r])return!1;return!0}}function Xu(e){var t=Hu(e),n=t.length;return r;function r(){for(var i=-1;++i<n;)if(t[i].apply(this,arguments))return!0;return!1}}function Yu(e){return t;function t(n){return!!(n&&n.type===e)}}function Qu(){return!0}var Ju=Ir,Zu=Gu,ra=!0,ia="skip",mr=!1;Ir.CONTINUE=ra;Ir.SKIP=ia;Ir.EXIT=mr;function Ir(e,t,n,r){var i;typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null),i=Zu(t),s(e,null,[]);function s(c,f,y){var l=[],u;return(!t||i(c,f,y[y.length-1]||null))&&(l=Bo(n(c,y)),l[0]===mr)?l:c.children&&l[0]!==ia?(u=Bo(a(c.children,y.concat(c))),u[0]===mr?u:l):l}function a(c,f){for(var y=-1,l=r?-1:1,u=(r?c.length:y)+l,k;u>y&&u<c.length;){if(k=s(c[u],u,f),k[0]===mr)return k;u=typeof k[1]=="number"?k[1]:u+l}}}function Bo(e){return e!==null&&typeof e=="object"&&"length"in e?e:typeof e=="number"?[ra,e]:[e]}var ed=Cr,Rr=Ju,td=Rr.CONTINUE,nd=Rr.SKIP,rd=Rr.EXIT;Cr.CONTINUE=td;Cr.SKIP=nd;Cr.EXIT=rd;function Cr(e,t,n,r){typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null),Rr(e,t,i,r);function i(s,a){var c=a[a.length-1],f=c?c.children.indexOf(s):null;return n(s,f,c)}}var id=ed,od=Object.prototype.hasOwnProperty,$r={align:"text-align",valign:"vertical-align",height:"height",width:"width"},sd=function(t){return id(t,"element",ad),t};function ad(e){if(!(e.tagName!=="tr"&&e.tagName!=="td"&&e.tagName!=="th")){var t,n;for(t in $r)!od.call($r,t)||e.properties[t]===void 0||(n=$r[t],ld(e,n,e.properties[t]),delete e.properties[t])}}function ld(e,t,n){var r=(e.properties.style||"").trim();r&&!/;\s*/.test(r)&&(r+=";"),r&&(r+=" ");var i=r+t+": "+n+";";e.properties.style=i}const cd=Oi(sd);function ud(e){const t=e&&typeof e=="object"&&e.type==="text"?e.value||"":e;return typeof t=="string"&&t.replace(/[ \t\n\f\r]/g,"")===""}const dd={}.hasOwnProperty,hd=new Set(["table","thead","tbody","tfoot","tr"]);function fd(e){if(!e||typeof e.createElement!="function")throw new TypeError("createElement is not a function");const t=e.createElement,n=e.fixTableCellAlign!==!1;Object.assign(this,{Compiler:r});function r(s){let a=Bu(i,n?cd(s):s,e.prefix);return s.type==="root"?(a=a&&typeof a=="object"&&"type"in a&&"props"in a&&a.type==="div"&&(s.children.length!==1||s.children[0].type!=="element")?a.props.children:[a],t(e.Fragment||"div",{},a)):a}function i(s,a,c){if(c&&hd.has(s)&&(c=c.filter(f=>!ud(f))),e.components&&dd.call(e.components,s)){const f=e.components[s];return e.passNode&&typeof f=="function"&&(a=Object.assign({node:this},a)),t(f,a,c)}return t(s,a,c)}}function Ni({children:e}){return o.jsx(pd,{children:e})}const $o="source-code-pro, Menlo, Monaco, Consolas, Courier New, monospace !important",pd=Xe(X)`
|
|
32
|
-
.highlight pre,
|
|
33
|
-
pre {
|
|
34
|
-
border-radius: 5px;
|
|
35
|
-
}
|
|
36
|
-
code {
|
|
37
|
-
font-family: ${$o};
|
|
38
|
-
}
|
|
39
|
-
pre code {
|
|
40
|
-
font-size: 14px;
|
|
41
|
-
font-family: ${$o};
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
h1,
|
|
45
|
-
h2,
|
|
46
|
-
h3,
|
|
47
|
-
h4,
|
|
48
|
-
h5,
|
|
49
|
-
h6 {
|
|
50
|
-
font-weight: 700 !important;
|
|
51
|
-
font-size: 1.2rem !important;
|
|
52
|
-
line-height: 1.5 !important;
|
|
53
|
-
margin-bottom: 16px;
|
|
54
|
-
margin-top: 24px;
|
|
55
|
-
border-bottom: initial !important;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.CodeMirror pre {
|
|
59
|
-
background-color: ${e=>e.theme.palette.grey[50]} !important;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.anchor {
|
|
63
|
-
display: none;
|
|
64
|
-
}
|
|
65
|
-
`;Ni.propTypes={children:N.any.isRequired};Ni.defaultProps={};function oa({infoList:e=[]}){return o.jsx(X,{className:"info-table",sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"max-content 1fr"},columnGap:4,rowGap:1.5},children:e.map(t=>o.jsxs(o.Fragment,{children:[o.jsx(X,{component:"span",sx:{fontWeight:"bold",whiteSpace:"nowrap"},children:t.key}),o.jsx(X,{component:"span",sx:{marginTop:{xs:-1,md:0}},children:t.value})]}))})}oa.propTypes={infoList:N.arrayOf(N.shape({key:N.string,value:N.string}))};const md=e=>e.payment?(e.payment.price||[]).map(n=>n.value||0).every(n=>n===0):!0,gd=new fd({createElement:A.createElement}).Compiler,It={zh:{appinfo:{name:"应用名",version:"版本号",author:"开发者",description:"描述",community:"社区地址",documentation:"文档手册",support:"服务支持",overview:"概述",requirements:"节点版本要求"}},en:{appinfo:{name:"Name",version:"Version",author:"Author",description:"Description",community:"Community",documentation:"Documentation",support:"Support",overview:"Overview",requirements:"Server requirements"}}};function Ai({blockletMeta:e,locale:t,handleDescEle:n}){const{data:r}=e,{registryUrl:i,did:s}=r,a=Wt.getDisplayName({meta:r}),c=or(()=>i&&s?fetch(Ro(i,"/api/blocklets",s,"readme")).then(S=>S.json()):null,{refreshDeps:[i,s]}),f=eu(()=>c.data?c.data[t]||c.data.en||c.data[Object.keys(c.data)[0]]:"",[c]),y=r&&r.htmlAst?gd(r.htmlAst):"",l=md(r);let u=dt(r,"owner.fullName");if(u){const S=dt(r,"owner.did");S&&(u=o.jsxs(X,{sx:{display:"flex",alignItems:"center",gap:1},children:[u,o.jsx(Fs,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:S,compact:!0,size:14,locale:t})]}))}else u=dt(r,"author.name");const k=[{key:dt(It[t],"appinfo.name"),value:Wt.getDisplayName({meta:r})},{key:dt(It[t],"appinfo.version"),value:r.version},{key:dt(It[t],"appinfo.author"),value:u},{type:"description",key:dt(It[t],"appinfo.description"),value:r.description}];r.requirements&&k.push({key:dt(It[t],"appinfo.requirements"),value:r.requirements.server}),r.community&&k.push({key:dt(It[t],"appinfo.community"),value:o.jsx("a",{href:r.community,target:"_blank",rel:"noreferrer",children:r.community})}),r.documentation&&k.push({key:dt(It[t],"appinfo.documentation"),value:o.jsx("a",{href:r.documentation,target:"_blank",rel:"noreferrer",children:r.documentation})}),r.support&&k.push({key:dt(It[t],"appinfo.support"),value:o.jsx("a",{href:`mailto:${r.support}`,target:"_blank",rel:"noreferrer",children:r.support})}),y&&k.push({key:dt(It[t],"appinfo.overview"),value:""});let m;return t==="zh"?m=o.jsxs(o.Fragment,{children:[l?o.jsxs("p",{children:["您可以免费使用 ",o.jsx("b",{children:a}),";"]}):o.jsxs("p",{children:["您需要购买才能使用 ",o.jsx("b",{children:a}),";"]}),o.jsx("p",{children:"在应用启动前,需要选择您的节点;"}),o.jsx("p",{children:"如果您没有节点,我们会引导您创建新的节点;"}),o.jsx("p",{children:"下面为该应用的信息:"})]}):m=o.jsxs(o.Fragment,{children:[l?o.jsxs("p",{children:["You can use ",o.jsx("b",{children:a})," for free;"]}):o.jsxs("p",{children:["You need to purchase before launch ",o.jsx("b",{children:a}),";"]}),o.jsx("p",{children:"Before the blocklet starts, you need to select your Blocklet Server; "}),o.jsx("p",{children:"If you do not have any Blocklet Server, we will guide you to create a new one; "}),o.jsx("p",{children:"Below is the information for the blocklet: "})]}),o.jsxs(yd,{children:[n||m,o.jsx(oa,{infoList:k}),f?o.jsxs("div",{className:"app-overview",children:[o.jsx(ve,{variant:"h5",gutterBottom:!0,children:dt(It[t],"appinfo.overview")}),o.jsx(Ni,{children:o.jsx(vd,{component:"div",className:"content-wrapper post-content",children:o.jsx(Zc,{source:f,wrapperElement:{"data-color-mode":"light"},urlTransform:(S,j,D)=>S.startsWith("/")?Ro(i,S):S})})})]}):y?o.jsx("div",{className:"app-overview",children:y}):null]})}const vd=Xe(ve)`
|
|
66
|
-
width: 100%;
|
|
67
|
-
word-wrap: break-word;
|
|
68
|
-
word-break: break-word;
|
|
69
|
-
line-height: 1.5em;
|
|
70
|
-
min-height: 10vh;
|
|
71
|
-
margin-bottom: 40px !important;
|
|
72
|
-
|
|
73
|
-
.alert-content {
|
|
74
|
-
max-width: 100%;
|
|
75
|
-
p:last-of-type {
|
|
76
|
-
margin-bottom: 0;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
iframe {
|
|
81
|
-
width: 100% !important;
|
|
82
|
-
}
|
|
83
|
-
`,yd=Xe.div`
|
|
84
|
-
.info-table {
|
|
85
|
-
a {
|
|
86
|
-
word-break: break-all;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
.app-overview {
|
|
90
|
-
font-size: 16px;
|
|
91
|
-
margin: 16px 0 0 16px;
|
|
92
|
-
h1 {
|
|
93
|
-
margin: 8px 0;
|
|
94
|
-
font-size: 20px;
|
|
95
|
-
}
|
|
96
|
-
h2 {
|
|
97
|
-
margin: 8px 0;
|
|
98
|
-
font-size: 18px;
|
|
99
|
-
}
|
|
100
|
-
ul {
|
|
101
|
-
display: block;
|
|
102
|
-
list-style-type: disc;
|
|
103
|
-
padding-left: 2em;
|
|
104
|
-
li {
|
|
105
|
-
display: list-item;
|
|
106
|
-
list-style: disc;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
blockquote {
|
|
110
|
-
margin-left: 2em;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
`;Ai.propTypes={blockletMeta:N.object.isRequired,locale:N.string.isRequired,handleDescEle:N.node};Ai.defaultProps={handleDescEle:""};function bd({...e}){return o.jsxs("div",{...e,style:{width:"100%"},children:[o.jsx("h3",{children:"End User License Agreement for Application"}),o.jsxs("p",{children:["Blocklet Server License Agreement ",Bs.COPYRIGHT_OWNER," version 2020-08-28"]}),o.jsx("p",{children:"BLOCKLET SERVER LICENSE AGREEMENT"}),o.jsx("p",{children:"暂无"})]})}function xd(e){var t,n,r,i;return`${((t=e.bundleSource)==null?void 0:t.store)||e.meta.homepage}/assets/${(n=e.meta)==null?void 0:n.did}/${((r=e.meta)==null?void 0:r.logo)||"logo.png"}?v=${(i=e.meta)==null?void 0:i.version}`}function Di({installRelated:e,meta:t,show:n,onClose:r,components:i,loading:s}){const{t:a}=mt(),c=Xt(u=>u.breakpoints.down("md"));if(!n)return null;const f=!s&&i.length===0,y=!s&&i.length!==0,l=40;return o.jsxs(Ri,{title:a("blocklet.component.relatedComponents",{name:t.title}),maxWidth:!1,fullWidth:!1,onClose:(u,k)=>{k!=="backdropClick"&&r(!1)},PaperProps:{style:c?{width:"100%",height:window.innerHeight}:{maxWidth:500,minWidth:300,width:"80%"}},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:[s&&o.jsx(X,{sx:{marginTop:4,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center"},children:o.jsx(X,{sx:{fontSize:32},color:"primary.main",component:ft,icon:"line-md:loading-loop"})}),f&&o.jsx(X,{sx:{textAlign:"center"},children:a("blocklet.component.noDependencies",{name:t.title})}),y&&o.jsx(X,{sx:{marginBottom:2},children:i.map(u=>{if(!u.meta)return null;const{required:k}=u;let m;return e||k?m=1:m=.5,o.jsxs(X,{sx:{opacity:m,padding:"10px 0px",paddingBottom:.5,marginTop:0,display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"flex-start"},children:[o.jsx("img",{style:{width:l,height:l,minWidth:l,minHeight:l},src:xd(u),alt:u.meta.title}),o.jsxs(X,{sx:{display:"flex",flexDirection:"column",justifyContent:"start",alignItems:"start",flex:1,marginLeft:2},children:[o.jsxs(X,{sx:{display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"center",fontSize:"16px",fontWeight:"bold",cursor:"pointer",".link-icon":{opacity:0},":hover .link-icon":{opacity:1}},onClick:()=>{var S;window.open(iu(`${((S=u.bundleSource)==null?void 0:S.store)||u.meta.homepage}/blocklets/${u.meta.did}`,{allowDomains:null}),"_blank")},children:[u.meta.title,o.jsx(X,{sx:{display:k?"inline-block":"none",fontSize:"12px",fontWeight:"bold",marginLeft:1},children:a("blocklet.component.required")}),o.jsxs(X,{sx:{paddingLeft:1,fontSize:"13px",fontWeight:"400"},component:"span",children:[u.meta.version,o.jsx(X,{className:"link-icon",icon:"fluent:open-20-filled",component:ft,sx:{color:"primary.main",fontSize:16,transform:"translate(6px, 3px)",transition:"all 0.1s"}})]})]}),o.jsx(X,{sx:{marginTop:0,opacity:.7},children:u.meta.description})]})]},u.meta.did)})})]})}Di.propTypes={meta:N.object,show:N.bool,onClose:N.func.isRequired,installRelated:N.func,components:N.array.isRequired,loading:N.bool.isRequired};Di.defaultProps={meta:null,show:!1,installRelated:!1};function wd(e){return e&&(e.registryUrl||e.homepage)&&e.did?`${e.registryUrl||e.homepage}/api/blocklets/${e==null?void 0:e.did}/blocklet.json`:""}function Ed(e){const{api:t}=Nn(),[n]=Xl(),r=n.get("blocklet_meta_url")||wd(e),[i,s]=A.useState([]),[a,c]=A.useState(!1);return A.useEffect(()=>{!r||e!=null&&e.inputUrl||(c(!0),t.getDynamicComponents({input:{url:r}}).then(f=>{s(f.components)}).finally(()=>{c(!1)}))},[r]),{components:i,loading:a}}function Mi({installRelated:e,onChangeInstallRelated:t,meta:n,onClickNext:r,handleDescEle:i}){const s=Yl(),{t:a,locale:c}=mt(),[f,y]=A.useState(!1),{components:l,loading:u}=Ed(n),k=Zs(n),m=r||(()=>{s(`/launch-blocklet/install${window.location.search}`)}),S=()=>{y(!0)},j=()=>{y(!1)};return o.jsxs(Sd,{children:[o.jsx("div",{className:"app-content",children:o.jsx("div",{className:"agreement",children:o.jsx("div",{className:"agreement-content",children:k?o.jsx(Ai,{blockletMeta:{data:n},locale:c,handleDescEle:i}):o.jsx(X,{sx:{p:3},children:o.jsx(ve,{children:a("launchBlocklet.dockerBlockletCantInstall")})})})})}),o.jsxs(X,{className:"agreement-bottom",sx:{"> .agreement-loading":{color:"primary.main"}},children:[u?o.jsx(ft,{className:"agreement-loading",icon:"line-md:loading-loop",style:{fontSize:42,transform:"scale(0.6)"}}):null,k&&t&&(l!=null&&l.length)?o.jsxs(X,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"},children:[o.jsx(Ti,{sx:{mr:.5},checked:e,onChange:D=>t(D.currentTarget.checked),control:o.jsx(ji,{}),label:o.jsx("span",{children:a("launchBlocklet.installRelatedComponents")})}),o.jsx(X,{sx:{"> button svg":{color:"primary.main"}},children:o.jsx(js,{size:"small",onClick:S,children:o.jsx(ft,{icon:"octicon:package-dependencies-16"})})})]}):null,o.jsx("div",{className:"button-container","data-cy":"agree-all",children:k?o.jsx(Li,{onContinue:m,description:o.jsx(bd,{}),texts:{listenName:a("launchBlocklet.license"),buttonNext:a("launchBlocklet.next")}}):null})]}),o.jsx(Di,{installRelated:e,meta:n,show:f,onClose:j,components:l,loading:u})]})}Mi.propTypes={meta:N.object.isRequired,onClickNext:N.func,handleDescEle:N.node,installRelated:N.bool,onChangeInstallRelated:N.func};Mi.defaultProps={onClickNext:null,handleDescEle:"",installRelated:!0,onChangeInstallRelated:null};const Sd=Xe.div`
|
|
114
|
-
display: flex;
|
|
115
|
-
flex-direction: column;
|
|
116
|
-
align-items: center;
|
|
117
|
-
width: 100%;
|
|
118
|
-
height: 100%;
|
|
119
|
-
flex: 1;
|
|
120
|
-
.app-content {
|
|
121
|
-
padding: 2px 24px 24px;
|
|
122
|
-
${e=>e.theme.breakpoints.down("md")} {
|
|
123
|
-
padding-top: 10px;
|
|
124
|
-
}
|
|
125
|
-
width: 100%;
|
|
126
|
-
flex: 1;
|
|
127
|
-
letter-spacing: normal;
|
|
128
|
-
}
|
|
129
|
-
.agreement {
|
|
130
|
-
position: relative;
|
|
131
|
-
display: flex;
|
|
132
|
-
flex-direction: column;
|
|
133
|
-
width: 100%;
|
|
134
|
-
height: 100%;
|
|
135
|
-
border: 1px solid ${e=>e.theme.palette.grey[100]};
|
|
136
|
-
border-radius: 12px;
|
|
137
|
-
${e=>e.theme.breakpoints.up("md")} {
|
|
138
|
-
margin-top: 24px;
|
|
139
|
-
}
|
|
140
|
-
${e=>e.theme.breakpoints.down("md")} {
|
|
141
|
-
margin-top: 16px;
|
|
142
|
-
}
|
|
143
|
-
.agreement-content {
|
|
144
|
-
position: absolute;
|
|
145
|
-
left: 0;
|
|
146
|
-
top: 0;
|
|
147
|
-
width: 100%;
|
|
148
|
-
height: 100%;
|
|
149
|
-
font-size: 14px;
|
|
150
|
-
overflow-y: auto;
|
|
151
|
-
${e=>e.theme.breakpoints.up("md")} {
|
|
152
|
-
padding: 0 24px;
|
|
153
|
-
}
|
|
154
|
-
${e=>e.theme.breakpoints.down("md")} {
|
|
155
|
-
padding: 0 16px;
|
|
156
|
-
}
|
|
157
|
-
&:after {
|
|
158
|
-
display: block;
|
|
159
|
-
content: '';
|
|
160
|
-
height: 24px;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
.agreement-bottom {
|
|
165
|
-
display: flex;
|
|
166
|
-
width: 100%;
|
|
167
|
-
padding: 24px;
|
|
168
|
-
${e=>e.theme.breakpoints.up("md")} {
|
|
169
|
-
flex-direction: row;
|
|
170
|
-
align-items: center;
|
|
171
|
-
margin-left: auto;
|
|
172
|
-
}
|
|
173
|
-
${e=>e.theme.breakpoints.down("md")} {
|
|
174
|
-
flex-direction: column;
|
|
175
|
-
align-items: center;
|
|
176
|
-
padding-top: 0;
|
|
177
|
-
padding-bottom: 16px;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
.button-container {
|
|
181
|
-
${e=>e.theme.breakpoints.up("md")} {
|
|
182
|
-
margin-left: auto;
|
|
183
|
-
}
|
|
184
|
-
${e=>e.theme.breakpoints.down("md")} {
|
|
185
|
-
padding-top: 0;
|
|
186
|
-
padding-bottom: 16px;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
`;var sa={},Fi={exports:{}},aa={exports:{}},Kn=aa.exports={github:{protocols:["git","http","git+ssh","git+https","ssh","https"],domain:"github.com",treepath:"tree",filetemplate:"https://{auth@}raw.githubusercontent.com/{user}/{project}/{committish}/{path}",bugstemplate:"https://{domain}/{user}/{project}/issues",gittemplate:"git://{auth@}{domain}/{user}/{project}.git{#committish}",tarballtemplate:"https://codeload.{domain}/{user}/{project}/tar.gz/{committish}"},bitbucket:{protocols:["git+ssh","git+https","ssh","https"],domain:"bitbucket.org",treepath:"src",tarballtemplate:"https://{domain}/{user}/{project}/get/{committish}.tar.gz"},gitlab:{protocols:["git+ssh","git+https","ssh","https"],domain:"gitlab.com",treepath:"tree",bugstemplate:"https://{domain}/{user}/{project}/issues",httpstemplate:"git+https://{auth@}{domain}/{user}/{projectPath}.git{#committish}",tarballtemplate:"https://{domain}/{user}/{project}/repository/archive.tar.gz?ref={committish}",pathmatch:/^\/([^/]+)\/((?!.*(\/-\/|\/repository(\/[^/]+)?\/archive\.tar\.gz)).*?)(?:\.git|\/)?$/},gist:{protocols:["git","git+ssh","git+https","ssh","https"],domain:"gist.github.com",pathmatch:/^[/](?:([^/]+)[/])?([a-z0-9]{7,})(?:[.]git)?$/,filetemplate:"https://gist.githubusercontent.com/{user}/{project}/raw{/committish}/{path}",bugstemplate:"https://{domain}/{project}",gittemplate:"git://{domain}/{project}.git{#committish}",sshtemplate:"git@{domain}:/{project}.git{#committish}",sshurltemplate:"git+ssh://git@{domain}/{project}.git{#committish}",browsetemplate:"https://{domain}/{project}{/committish}",browsefiletemplate:"https://{domain}/{project}{/committish}{#path}",docstemplate:"https://{domain}/{project}{/committish}",httpstemplate:"git+https://{domain}/{project}.git{#committish}",shortcuttemplate:"{type}:{project}{#committish}",pathtemplate:"{project}{#committish}",tarballtemplate:"https://codeload.github.com/gist/{project}/tar.gz/{committish}",hashformat:function(e){return"file-"+la(e)}}},Uo={sshtemplate:"git@{domain}:{user}/{project}.git{#committish}",sshurltemplate:"git+ssh://git@{domain}/{user}/{project}.git{#committish}",browsetemplate:"https://{domain}/{user}/{project}{/tree/committish}",browsefiletemplate:"https://{domain}/{user}/{project}/{treepath}/{committish}/{path}{#fragment}",docstemplate:"https://{domain}/{user}/{project}{/tree/committish}#readme",httpstemplate:"git+https://{auth@}{domain}/{user}/{project}.git{#committish}",filetemplate:"https://{domain}/{user}/{project}/raw/{committish}/{path}",shortcuttemplate:"{type}:{user}/{project}{#committish}",pathtemplate:"{user}/{project}{#committish}",pathmatch:/^[/]([^/]+)[/]([^/]+?)(?:[.]git|[/])?$/,hashformat:la};Object.keys(Kn).forEach(function(e){Object.keys(Uo).forEach(function(t){Kn[e][t]||(Kn[e][t]=Uo[t])}),Kn[e].protocols_re=RegExp("^("+Kn[e].protocols.map(function(t){return t.replace(/([\\+*{}()[\]$^|])/g,"\\$1")}).join("|")+"):$")});function la(e){return e.toLowerCase().replace(/^\W+|\/|\W+$/g,"").replace(/\W+/g,"-")}var ca=aa.exports,Wo=ca,Pn=Object.assign||function(t,n){if(n===null||typeof n!="object")return t;const r=Object.keys(n);let i=r.length;for(;i--;)t[r[i]]=n[r[i]];return t},Td=Qe;function Qe(e,t,n,r,i,s,a){var c=this;c.type=e,Object.keys(Wo[e]).forEach(function(f){c[f]=Wo[e][f]}),c.user=t,c.auth=n,c.project=r,c.committish=i,c.default=s,c.opts=a||{}}Qe.prototype.hash=function(){return this.committish?"#"+this.committish:""};Qe.prototype._fill=function(e,t){if(e){var n=Pn({},t);n.path=n.path?n.path.replace(/^[/]+/g,""):"",t=Pn(Pn({},this.opts),t);var r=this;Object.keys(this).forEach(function(l){r[l]!=null&&n[l]==null&&(n[l]=r[l])});var i=n.auth,s=n.committish,a=n.fragment,c=n.path,f=n.project;Object.keys(n).forEach(function(l){var u=n[l];(l==="path"||l==="project")&&typeof u=="string"?n[l]=u.split("/").map(function(k){return encodeURIComponent(k)}).join("/"):l!=="domain"&&(n[l]=encodeURIComponent(u))}),n["auth@"]=i?i+"@":"",n["#fragment"]=a?"#"+this.hashformat(a):"",n.fragment=n.fragment?n.fragment:"",n["#path"]=c?"#"+this.hashformat(c):"",n["/path"]=n.path?"/"+n.path:"",n.projectPath=f.split("/").map(encodeURIComponent).join("/"),t.noCommittish?(n["#committish"]="",n["/tree/committish"]="",n["/committish"]="",n.committish=""):(n["#committish"]=s?"#"+s:"",n["/tree/committish"]=n.committish?"/"+n.treepath+"/"+n.committish:"",n["/committish"]=n.committish?"/"+n.committish:"",n.committish=n.committish||"master");var y=e;return Object.keys(n).forEach(function(l){y=y.replace(new RegExp("[{]"+l+"[}]","g"),n[l])}),t.noGitPlus?y.replace(/^git[+]/,""):y}};Qe.prototype.ssh=function(e){return this._fill(this.sshtemplate,e)};Qe.prototype.sshurl=function(e){return this._fill(this.sshurltemplate,e)};Qe.prototype.browse=function(e,t,n){return typeof e=="string"?(typeof t!="string"&&(n=t,t=null),this._fill(this.browsefiletemplate,Pn({fragment:t,path:e},n))):this._fill(this.browsetemplate,e)};Qe.prototype.docs=function(e){return this._fill(this.docstemplate,e)};Qe.prototype.bugs=function(e){return this._fill(this.bugstemplate,e)};Qe.prototype.https=function(e){return this._fill(this.httpstemplate,e)};Qe.prototype.git=function(e){return this._fill(this.gittemplate,e)};Qe.prototype.shortcut=function(e){return this._fill(this.shortcuttemplate,e)};Qe.prototype.path=function(e){return this._fill(this.pathtemplate,e)};Qe.prototype.tarball=function(e){var t=Pn({},e,{noCommittish:!1});return this._fill(this.tarballtemplate,t)};Qe.prototype.file=function(e,t){return this._fill(this.filetemplate,Pn({path:e},t))};Qe.prototype.getDefaultRepresentation=function(){return this.default};Qe.prototype.toString=function(e){return this.default&&typeof this[this.default]=="function"?this[this.default](e):this.sshurl(e)};var Ur,zo;function jd(){return zo||(zo=1,Ur=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),Ur}var kd=ye;ye.Node=vn;ye.create=ye;function ye(e){var t=this;if(t instanceof ye||(t=new ye),t.tail=null,t.head=null,t.length=0,e&&typeof e.forEach=="function")e.forEach(function(i){t.push(i)});else if(arguments.length>0)for(var n=0,r=arguments.length;n<r;n++)t.push(arguments[n]);return t}ye.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t};ye.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}};ye.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}};ye.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)Id(this,arguments[e]);return this.length};ye.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)Rd(this,arguments[e]);return this.length};ye.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}};ye.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}};ye.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,r=0;n!==null;r++)e.call(t,n.value,r,this),n=n.next};ye.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,r=this.length-1;n!==null;r--)e.call(t,n.value,r,this),n=n.prev};ye.prototype.get=function(e){for(var t=0,n=this.head;n!==null&&t<e;t++)n=n.next;if(t===e&&n!==null)return n.value};ye.prototype.getReverse=function(e){for(var t=0,n=this.tail;n!==null&&t<e;t++)n=n.prev;if(t===e&&n!==null)return n.value};ye.prototype.map=function(e,t){t=t||this;for(var n=new ye,r=this.head;r!==null;)n.push(e.call(t,r.value,this)),r=r.next;return n};ye.prototype.mapReverse=function(e,t){t=t||this;for(var n=new ye,r=this.tail;r!==null;)n.push(e.call(t,r.value,this)),r=r.prev;return n};ye.prototype.reduce=function(e,t){var n,r=this.head;if(arguments.length>1)n=t;else if(this.head)r=this.head.next,n=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;r!==null;i++)n=e(n,r.value,i),r=r.next;return n};ye.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else if(this.tail)r=this.tail.prev,n=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;r!==null;i--)n=e(n,r.value,i),r=r.prev;return n};ye.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;n!==null;t++)e[t]=n.value,n=n.next;return e};ye.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;n!==null;t++)e[t]=n.value,n=n.prev;return e};ye.prototype.slice=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var n=new ye;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var r=0,i=this.head;i!==null&&r<e;r++)i=i.next;for(;i!==null&&r<t;r++,i=i.next)n.push(i.value);return n};ye.prototype.sliceReverse=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var n=new ye;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var r=this.length,i=this.tail;i!==null&&r>t;r--)i=i.prev;for(;i!==null&&r>e;r--,i=i.prev)n.push(i.value);return n};ye.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var r=0,i=this.head;i!==null&&r<e;r++)i=i.next;for(var s=[],r=0;i&&r<t;r++)s.push(i.value),i=this.removeNode(i);i===null&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(var r=0;r<n.length;r++)i=Od(this,i,n[r]);return s};ye.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;n!==null;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=t,this.tail=e,this};function Od(e,t,n){var r=t===e.head?new vn(n,null,t,e):new vn(n,t,t.next,e);return r.next===null&&(e.tail=r),r.prev===null&&(e.head=r),e.length++,r}function Id(e,t){e.tail=new vn(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function Rd(e,t){e.head=new vn(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function vn(e,t,n,r){if(!(this instanceof vn))return new vn(e,t,n,r);this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}try{jd()(ye)}catch{}const Cd=kd,pn=Symbol("max"),$t=Symbol("length"),Cn=Symbol("lengthCalculator"),Yn=Symbol("allowStale"),mn=Symbol("maxAge"),Bt=Symbol("dispose"),qo=Symbol("noDisposeOnSet"),qe=Symbol("lruList"),xt=Symbol("cache"),ua=Symbol("updateAgeOnGet"),Wr=()=>1;class Pd{constructor(t){if(typeof t=="number"&&(t={max:t}),t||(t={}),t.max&&(typeof t.max!="number"||t.max<0))throw new TypeError("max must be a non-negative number");this[pn]=t.max||1/0;const n=t.length||Wr;if(this[Cn]=typeof n!="function"?Wr:n,this[Yn]=t.stale||!1,t.maxAge&&typeof t.maxAge!="number")throw new TypeError("maxAge must be a number");this[mn]=t.maxAge||0,this[Bt]=t.dispose,this[qo]=t.noDisposeOnSet||!1,this[ua]=t.updateAgeOnGet||!1,this.reset()}set max(t){if(typeof t!="number"||t<0)throw new TypeError("max must be a non-negative number");this[pn]=t||1/0,Gn(this)}get max(){return this[pn]}set allowStale(t){this[Yn]=!!t}get allowStale(){return this[Yn]}set maxAge(t){if(typeof t!="number")throw new TypeError("maxAge must be a non-negative number");this[mn]=t,Gn(this)}get maxAge(){return this[mn]}set lengthCalculator(t){typeof t!="function"&&(t=Wr),t!==this[Cn]&&(this[Cn]=t,this[$t]=0,this[qe].forEach(n=>{n.length=this[Cn](n.value,n.key),this[$t]+=n.length})),Gn(this)}get lengthCalculator(){return this[Cn]}get length(){return this[$t]}get itemCount(){return this[qe].length}rforEach(t,n){n=n||this;for(let r=this[qe].tail;r!==null;){const i=r.prev;Ko(this,t,r,n),r=i}}forEach(t,n){n=n||this;for(let r=this[qe].head;r!==null;){const i=r.next;Ko(this,t,r,n),r=i}}keys(){return this[qe].toArray().map(t=>t.key)}values(){return this[qe].toArray().map(t=>t.value)}reset(){this[Bt]&&this[qe]&&this[qe].length&&this[qe].forEach(t=>this[Bt](t.key,t.value)),this[xt]=new Map,this[qe]=new Cd,this[$t]=0}dump(){return this[qe].map(t=>br(this,t)?!1:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[qe]}set(t,n,r){if(r=r||this[mn],r&&typeof r!="number")throw new TypeError("maxAge must be a number");const i=r?Date.now():0,s=this[Cn](n,t);if(this[xt].has(t)){if(s>this[pn])return Ln(this,this[xt].get(t)),!1;const f=this[xt].get(t).value;return this[Bt]&&(this[qo]||this[Bt](t,f.value)),f.now=i,f.maxAge=r,f.value=n,this[$t]+=s-f.length,f.length=s,this.get(t),Gn(this),!0}const a=new Ld(t,n,s,i,r);return a.length>this[pn]?(this[Bt]&&this[Bt](t,n),!1):(this[$t]+=a.length,this[qe].unshift(a),this[xt].set(t,this[qe].head),Gn(this),!0)}has(t){if(!this[xt].has(t))return!1;const n=this[xt].get(t).value;return!br(this,n)}get(t){return zr(this,t,!0)}peek(t){return zr(this,t,!1)}pop(){const t=this[qe].tail;return t?(Ln(this,t),t.value):null}del(t){Ln(this,this[xt].get(t))}load(t){this.reset();const n=Date.now();for(let r=t.length-1;r>=0;r--){const i=t[r],s=i.e||0;if(s===0)this.set(i.k,i.v);else{const a=s-n;a>0&&this.set(i.k,i.v,a)}}}prune(){this[xt].forEach((t,n)=>zr(this,n,!1))}}const zr=(e,t,n)=>{const r=e[xt].get(t);if(r){const i=r.value;if(br(e,i)){if(Ln(e,r),!e[Yn])return}else n&&(e[ua]&&(r.value.now=Date.now()),e[qe].unshiftNode(r));return i.value}},br=(e,t)=>{if(!t||!t.maxAge&&!e[mn])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[mn]&&n>e[mn]},Gn=e=>{if(e[$t]>e[pn])for(let t=e[qe].tail;e[$t]>e[pn]&&t!==null;){const n=t.prev;Ln(e,t),t=n}},Ln=(e,t)=>{if(t){const n=t.value;e[Bt]&&e[Bt](n.key,n.value),e[$t]-=n.length,e[xt].delete(n.key),e[qe].removeNode(t)}};class Ld{constructor(t,n,r,i,s){this.key=t,this.value=n,this.length=r,this.now=i,this.maxAge=s||0}}const Ko=(e,t,n,r)=>{let i=n.value;br(e,i)&&(Ln(e,n),e[Yn]||(i=void 0)),i&&t.call(r,i.value,i.key,e)};var _d=Pd,li=Lc,Go=ca,Nd=Fi.exports=Td,Ad=_d,qr=new Ad({max:1e3}),Dd={"git+ssh:":"sshurl","git+https:":"https","ssh:":"sshurl","git:":"git"};function Md(e){return Dd[e]||e.slice(0,-1)}var Fd={"git:":!0,"https:":!0,"git+https:":!0,"http:":!0,"git+http:":!0};Fi.exports.fromUrl=function(e,t){if(typeof e=="string"){var n=e+JSON.stringify(t||{});return qr.has(n)||qr.set(n,Bd(e,t)),qr.get(n)}};function Bd(e,t){if(!(e==null||e==="")){var n=Ud($d(e)?"github:"+e:e),r=Wd(n),i=n.match(/^([^:]+):(?:[^@]+@)?(?:([^/]*)\/)?([^#]+)/),s=Object.keys(Go).map(function(a){try{var c=Go[a],f=null;r.auth&&Fd[r.protocol]&&(f=r.auth);var y=r.hash?decodeURIComponent(r.hash.substr(1)):null,l=null,u=null,k=null;if(i&&i[1]===a)l=i[2]&&decodeURIComponent(i[2]),u=decodeURIComponent(i[3].replace(/\.git$/,"")),k="shortcut";else{if(r.host&&r.host!==c.domain&&r.host.replace(/^www[.]/,"")!==c.domain||!c.protocols_re.test(r.protocol)||!r.path)return;var m=c.pathmatch,S=r.path.match(m);if(!S)return;S[1]!==null&&S[1]!==void 0&&(l=decodeURIComponent(S[1].replace(/^:/,""))),u=decodeURIComponent(S[2]),k=Md(r.protocol)}return new Nd(a,l,f,u,y,k,t)}catch(j){if(!(j instanceof URIError))throw j}}).filter(function(a){return a});if(s.length===1)return s[0]}}function $d(e){return/^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(e)}function Ud(e){var t=li.parse(e);return t.protocol==="gist:"&&t.host&&!t.path?t.protocol+"/"+t.host:e}function Wd(e){var t=e.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/);if(!t){var n=li.parse(e);if(n.auth){const i=e.match(/[^@]+@[^:/]+/);if(i){var r=new li.URL(i[0]);n.auth=r.username||"",r.password&&(n.auth+=":"+r.password)}}return n}return{protocol:"git+ssh:",slashes:!0,auth:t[1],host:t[2],port:null,hostname:t[2],hash:t[4],search:null,query:null,pathname:"/"+t[3],path:"/"+t[3],href:"git+ssh://"+t[1]+"@"+t[2]+"/"+t[3]+(t[4]||"")}}var zd=Fi.exports,yn={},te={},qd=null;const Kd=Object.freeze(Object.defineProperty({__proto__:null,default:qd},Symbol.toStringTag,{value:"Module"})),da=Ii(Kd),Gd=["ᄀ-ᇹ"," -〿","ぁ-ゔ","゙-ゞ","ァ-ヾ","ㄱ-ㆎ","㆐-㆟","㈀-㈜","㈠-㉃","㉠-㊰","㋀-㍶","㍻-㏝","㏠-㏾","一-龥","가-힣","-","豈-鶴"],Hd=["︰-﹄","﹉-﹒","﹔-﹫","!-~","¢-₩"];var Vd={charsWide:Gd,charsFullWidth:Hd};const{charsWide:Xd,charsFullWidth:Yd}=Vd,ha=new RegExp(`[${Xd.join("")}${Yd.join("")}]`,"g"),Qd=e=>e.replace(ha,"xx").length;var Jd={default:Qd,charsRegex:ha};/*!
|
|
190
|
-
* is-extglob <https://github.com/jonschlinkert/is-extglob>
|
|
191
|
-
*
|
|
192
|
-
* Copyright (c) 2014-2016, Jon Schlinkert.
|
|
193
|
-
* Licensed under the MIT License.
|
|
194
|
-
*/var Zd=function(t){if(typeof t!="string"||t==="")return!1;for(var n;n=/(\\).|([@?!+*]\(.*\))/g.exec(t);){if(n[2])return!0;t=t.slice(n.index+n[0].length)}return!1};/*!
|
|
195
|
-
* is-glob <https://github.com/jonschlinkert/is-glob>
|
|
196
|
-
*
|
|
197
|
-
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
198
|
-
* Released under the MIT License.
|
|
199
|
-
*/var eh=Zd,fa={"{":"}","(":")","[":"]"},th=function(e){if(e[0]==="!")return!0;for(var t=0,n=-2,r=-2,i=-2,s=-2,a=-2;t<e.length;){if(e[t]==="*"||e[t+1]==="?"&&/[\].+)]/.test(e[t])||r!==-1&&e[t]==="["&&e[t+1]!=="]"&&(r<t&&(r=e.indexOf("]",t)),r>t&&(a===-1||a>r||(a=e.indexOf("\\",t),a===-1||a>r)))||i!==-1&&e[t]==="{"&&e[t+1]!=="}"&&(i=e.indexOf("}",t),i>t&&(a=e.indexOf("\\",t),a===-1||a>i))||s!==-1&&e[t]==="("&&e[t+1]==="?"&&/[:!=]/.test(e[t+2])&&e[t+3]!==")"&&(s=e.indexOf(")",t),s>t&&(a=e.indexOf("\\",t),a===-1||a>s))||n!==-1&&e[t]==="("&&e[t+1]!=="|"&&(n<t&&(n=e.indexOf("|",t)),n!==-1&&e[n+1]!==")"&&(s=e.indexOf(")",n),s>n&&(a=e.indexOf("\\",n),a===-1||a>s))))return!0;if(e[t]==="\\"){var c=e[t+1];t+=2;var f=fa[c];if(f){var y=e.indexOf(f,t);y!==-1&&(t=y+1)}if(e[t]==="!")return!0}else t++}return!1},nh=function(e){if(e[0]==="!")return!0;for(var t=0;t<e.length;){if(/[*?{}()[\]]/.test(e[t]))return!0;if(e[t]==="\\"){var n=e[t+1];t+=2;var r=fa[n];if(r){var i=e.indexOf(r,t);i!==-1&&(t=i+1)}if(e[t]==="!")return!0}else t++}return!1},rh=function(t,n){if(typeof t!="string"||t==="")return!1;if(eh(t))return!0;var r=th;return n&&n.strict===!1&&(r=nh),r(t)},ci={exports:{}};(function(e,t){var n={};t=e.exports=B;var r;typeof wc=="object"&&n&&n.NODE_DEBUG&&/\bsemver\b/i.test(n.NODE_DEBUG)?r=function(){var d=Array.prototype.slice.call(arguments,0);d.unshift("SEMVER"),console.log.apply(console,d)}:r=function(){},t.SEMVER_SPEC_VERSION="2.0.0";var i=256,s=Number.MAX_SAFE_INTEGER||9007199254740991,a=16,c=i-6,f=t.re=[],y=t.safeRe=[],l=t.src=[],u=t.tokens={},k=0;function m(d){u[d]=k++}var S="[a-zA-Z0-9-]",j=[["\\s",1],["\\d",i],[S,c]];function D(d){for(var x=0;x<j.length;x++){var w=j[x][0],P=j[x][1];d=d.split(w+"*").join(w+"{0,"+P+"}").split(w+"+").join(w+"{1,"+P+"}")}return d}m("NUMERICIDENTIFIER"),l[u.NUMERICIDENTIFIER]="0|[1-9]\\d*",m("NUMERICIDENTIFIERLOOSE"),l[u.NUMERICIDENTIFIERLOOSE]="\\d+",m("NONNUMERICIDENTIFIER"),l[u.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-]"+S+"*",m("MAINVERSION"),l[u.MAINVERSION]="("+l[u.NUMERICIDENTIFIER]+")\\.("+l[u.NUMERICIDENTIFIER]+")\\.("+l[u.NUMERICIDENTIFIER]+")",m("MAINVERSIONLOOSE"),l[u.MAINVERSIONLOOSE]="("+l[u.NUMERICIDENTIFIERLOOSE]+")\\.("+l[u.NUMERICIDENTIFIERLOOSE]+")\\.("+l[u.NUMERICIDENTIFIERLOOSE]+")",m("PRERELEASEIDENTIFIER"),l[u.PRERELEASEIDENTIFIER]="(?:"+l[u.NUMERICIDENTIFIER]+"|"+l[u.NONNUMERICIDENTIFIER]+")",m("PRERELEASEIDENTIFIERLOOSE"),l[u.PRERELEASEIDENTIFIERLOOSE]="(?:"+l[u.NUMERICIDENTIFIERLOOSE]+"|"+l[u.NONNUMERICIDENTIFIER]+")",m("PRERELEASE"),l[u.PRERELEASE]="(?:-("+l[u.PRERELEASEIDENTIFIER]+"(?:\\."+l[u.PRERELEASEIDENTIFIER]+")*))",m("PRERELEASELOOSE"),l[u.PRERELEASELOOSE]="(?:-?("+l[u.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+l[u.PRERELEASEIDENTIFIERLOOSE]+")*))",m("BUILDIDENTIFIER"),l[u.BUILDIDENTIFIER]=S+"+",m("BUILD"),l[u.BUILD]="(?:\\+("+l[u.BUILDIDENTIFIER]+"(?:\\."+l[u.BUILDIDENTIFIER]+")*))",m("FULL"),m("FULLPLAIN"),l[u.FULLPLAIN]="v?"+l[u.MAINVERSION]+l[u.PRERELEASE]+"?"+l[u.BUILD]+"?",l[u.FULL]="^"+l[u.FULLPLAIN]+"$",m("LOOSEPLAIN"),l[u.LOOSEPLAIN]="[v=\\s]*"+l[u.MAINVERSIONLOOSE]+l[u.PRERELEASELOOSE]+"?"+l[u.BUILD]+"?",m("LOOSE"),l[u.LOOSE]="^"+l[u.LOOSEPLAIN]+"$",m("GTLT"),l[u.GTLT]="((?:<|>)?=?)",m("XRANGEIDENTIFIERLOOSE"),l[u.XRANGEIDENTIFIERLOOSE]=l[u.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",m("XRANGEIDENTIFIER"),l[u.XRANGEIDENTIFIER]=l[u.NUMERICIDENTIFIER]+"|x|X|\\*",m("XRANGEPLAIN"),l[u.XRANGEPLAIN]="[v=\\s]*("+l[u.XRANGEIDENTIFIER]+")(?:\\.("+l[u.XRANGEIDENTIFIER]+")(?:\\.("+l[u.XRANGEIDENTIFIER]+")(?:"+l[u.PRERELEASE]+")?"+l[u.BUILD]+"?)?)?",m("XRANGEPLAINLOOSE"),l[u.XRANGEPLAINLOOSE]="[v=\\s]*("+l[u.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+l[u.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+l[u.XRANGEIDENTIFIERLOOSE]+")(?:"+l[u.PRERELEASELOOSE]+")?"+l[u.BUILD]+"?)?)?",m("XRANGE"),l[u.XRANGE]="^"+l[u.GTLT]+"\\s*"+l[u.XRANGEPLAIN]+"$",m("XRANGELOOSE"),l[u.XRANGELOOSE]="^"+l[u.GTLT]+"\\s*"+l[u.XRANGEPLAINLOOSE]+"$",m("COERCE"),l[u.COERCE]="(^|[^\\d])(\\d{1,"+a+"})(?:\\.(\\d{1,"+a+"}))?(?:\\.(\\d{1,"+a+"}))?(?:$|[^\\d])",m("COERCERTL"),f[u.COERCERTL]=new RegExp(l[u.COERCE],"g"),y[u.COERCERTL]=new RegExp(D(l[u.COERCE]),"g"),m("LONETILDE"),l[u.LONETILDE]="(?:~>?)",m("TILDETRIM"),l[u.TILDETRIM]="(\\s*)"+l[u.LONETILDE]+"\\s+",f[u.TILDETRIM]=new RegExp(l[u.TILDETRIM],"g"),y[u.TILDETRIM]=new RegExp(D(l[u.TILDETRIM]),"g");var L="$1~";m("TILDE"),l[u.TILDE]="^"+l[u.LONETILDE]+l[u.XRANGEPLAIN]+"$",m("TILDELOOSE"),l[u.TILDELOOSE]="^"+l[u.LONETILDE]+l[u.XRANGEPLAINLOOSE]+"$",m("LONECARET"),l[u.LONECARET]="(?:\\^)",m("CARETTRIM"),l[u.CARETTRIM]="(\\s*)"+l[u.LONECARET]+"\\s+",f[u.CARETTRIM]=new RegExp(l[u.CARETTRIM],"g"),y[u.CARETTRIM]=new RegExp(D(l[u.CARETTRIM]),"g");var M="$1^";m("CARET"),l[u.CARET]="^"+l[u.LONECARET]+l[u.XRANGEPLAIN]+"$",m("CARETLOOSE"),l[u.CARETLOOSE]="^"+l[u.LONECARET]+l[u.XRANGEPLAINLOOSE]+"$",m("COMPARATORLOOSE"),l[u.COMPARATORLOOSE]="^"+l[u.GTLT]+"\\s*("+l[u.LOOSEPLAIN]+")$|^$",m("COMPARATOR"),l[u.COMPARATOR]="^"+l[u.GTLT]+"\\s*("+l[u.FULLPLAIN]+")$|^$",m("COMPARATORTRIM"),l[u.COMPARATORTRIM]="(\\s*)"+l[u.GTLT]+"\\s*("+l[u.LOOSEPLAIN]+"|"+l[u.XRANGEPLAIN]+")",f[u.COMPARATORTRIM]=new RegExp(l[u.COMPARATORTRIM],"g"),y[u.COMPARATORTRIM]=new RegExp(D(l[u.COMPARATORTRIM]),"g");var K="$1$2$3";m("HYPHENRANGE"),l[u.HYPHENRANGE]="^\\s*("+l[u.XRANGEPLAIN]+")\\s+-\\s+("+l[u.XRANGEPLAIN]+")\\s*$",m("HYPHENRANGELOOSE"),l[u.HYPHENRANGELOOSE]="^\\s*("+l[u.XRANGEPLAINLOOSE]+")\\s+-\\s+("+l[u.XRANGEPLAINLOOSE]+")\\s*$",m("STAR"),l[u.STAR]="(<|>)?=?\\s*\\*";for(var G=0;G<k;G++)r(G,l[G]),f[G]||(f[G]=new RegExp(l[G]),y[G]=new RegExp(D(l[G])));t.parse=T;function T(d,x){if((!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1}),d instanceof B)return d;if(typeof d!="string"||d.length>i)return null;var w=x.loose?y[u.LOOSE]:y[u.FULL];if(!w.test(d))return null;try{return new B(d,x)}catch{return null}}t.valid=F;function F(d,x){var w=T(d,x);return w?w.version:null}t.clean=H;function H(d,x){var w=T(d.trim().replace(/^[=v]+/,""),x);return w?w.version:null}t.SemVer=B;function B(d,x){if((!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1}),d instanceof B){if(d.loose===x.loose)return d;d=d.version}else if(typeof d!="string")throw new TypeError("Invalid Version: "+d);if(d.length>i)throw new TypeError("version is longer than "+i+" characters");if(!(this instanceof B))return new B(d,x);r("SemVer",d,x),this.options=x,this.loose=!!x.loose;var w=d.trim().match(x.loose?y[u.LOOSE]:y[u.FULL]);if(!w)throw new TypeError("Invalid Version: "+d);if(this.raw=d,this.major=+w[1],this.minor=+w[2],this.patch=+w[3],this.major>s||this.major<0)throw new TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>s||this.patch<0)throw new TypeError("Invalid patch version");w[4]?this.prerelease=w[4].split(".").map(function(P){if(/^[0-9]+$/.test(P)){var I=+P;if(I>=0&&I<s)return I}return P}):this.prerelease=[],this.build=w[5]?w[5].split("."):[],this.format()}B.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},B.prototype.toString=function(){return this.version},B.prototype.compare=function(d){return r("SemVer.compare",this.version,this.options,d),d instanceof B||(d=new B(d,this.options)),this.compareMain(d)||this.comparePre(d)},B.prototype.compareMain=function(d){return d instanceof B||(d=new B(d,this.options)),Pe(this.major,d.major)||Pe(this.minor,d.minor)||Pe(this.patch,d.patch)},B.prototype.comparePre=function(d){if(d instanceof B||(d=new B(d,this.options)),this.prerelease.length&&!d.prerelease.length)return-1;if(!this.prerelease.length&&d.prerelease.length)return 1;if(!this.prerelease.length&&!d.prerelease.length)return 0;var x=0;do{var w=this.prerelease[x],P=d.prerelease[x];if(r("prerelease compare",x,w,P),w===void 0&&P===void 0)return 0;if(P===void 0)return 1;if(w===void 0)return-1;if(w===P)continue;return Pe(w,P)}while(++x)},B.prototype.compareBuild=function(d){d instanceof B||(d=new B(d,this.options));var x=0;do{var w=this.build[x],P=d.build[x];if(r("prerelease compare",x,w,P),w===void 0&&P===void 0)return 0;if(P===void 0)return 1;if(w===void 0)return-1;if(w===P)continue;return Pe(w,P)}while(++x)},B.prototype.inc=function(d,x){switch(d){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",x);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",x);break;case"prepatch":this.prerelease.length=0,this.inc("patch",x),this.inc("pre",x);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",x),this.inc("pre",x);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{for(var w=this.prerelease.length;--w>=0;)typeof this.prerelease[w]=="number"&&(this.prerelease[w]++,w=-2);w===-1&&this.prerelease.push(0)}x&&(this.prerelease[0]===x?isNaN(this.prerelease[1])&&(this.prerelease=[x,0]):this.prerelease=[x,0]);break;default:throw new Error("invalid increment argument: "+d)}return this.format(),this.raw=this.version,this},t.inc=ce;function ce(d,x,w,P){typeof w=="string"&&(P=w,w=void 0);try{return new B(d,w).inc(x,P).version}catch{return null}}t.diff=V;function V(d,x){if(Ct(d,x))return null;var w=T(d),P=T(x),I="";if(w.prerelease.length||P.prerelease.length){I="pre";var _="prerelease"}for(var U in w)if((U==="major"||U==="minor"||U==="patch")&&w[U]!==P[U])return I+U;return _}t.compareIdentifiers=Pe;var se=/^[0-9]+$/;function Pe(d,x){var w=se.test(d),P=se.test(x);return w&&P&&(d=+d,x=+x),d===x?0:w&&!P?-1:P&&!w?1:d<x?-1:1}t.rcompareIdentifiers=Be;function Be(d,x){return Pe(x,d)}t.major=Ae;function Ae(d,x){return new B(d,x).major}t.minor=Je;function Je(d,x){return new B(d,x).minor}t.patch=J;function J(d,x){return new B(d,x).patch}t.compare=me;function me(d,x,w){return new B(d,w).compare(new B(x,w))}t.compareLoose=ne;function ne(d,x){return me(d,x,!0)}t.compareBuild=je;function je(d,x,w){var P=new B(d,w),I=new B(x,w);return P.compare(I)||P.compareBuild(I)}t.rcompare=Le;function Le(d,x,w){return me(x,d,w)}t.sort=Me;function Me(d,x){return d.sort(function(w,P){return t.compareBuild(w,P,x)})}t.rsort=we;function we(d,x){return d.sort(function(w,P){return t.compareBuild(P,w,x)})}t.gt=Ze;function Ze(d,x,w){return me(d,x,w)>0}t.lt=Ke;function Ke(d,x,w){return me(d,x,w)<0}t.eq=Ct;function Ct(d,x,w){return me(d,x,w)===0}t.neq=Pt;function Pt(d,x,w){return me(d,x,w)!==0}t.gte=yt;function yt(d,x,w){return me(d,x,w)>=0}t.lte=et;function et(d,x,w){return me(d,x,w)<=0}t.cmp=Z;function Z(d,x,w,P){switch(x){case"===":return typeof d=="object"&&(d=d.version),typeof w=="object"&&(w=w.version),d===w;case"!==":return typeof d=="object"&&(d=d.version),typeof w=="object"&&(w=w.version),d!==w;case"":case"=":case"==":return Ct(d,w,P);case"!=":return Pt(d,w,P);case">":return Ze(d,w,P);case">=":return yt(d,w,P);case"<":return Ke(d,w,P);case"<=":return et(d,w,P);default:throw new TypeError("Invalid operator: "+x)}}t.Comparator=he;function he(d,x){if((!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1}),d instanceof he){if(d.loose===!!x.loose)return d;d=d.value}if(!(this instanceof he))return new he(d,x);d=d.trim().split(/\s+/).join(" "),r("comparator",d,x),this.options=x,this.loose=!!x.loose,this.parse(d),this.semver===ke?this.value="":this.value=this.operator+this.semver.version,r("comp",this)}var ke={};he.prototype.parse=function(d){var x=this.options.loose?y[u.COMPARATORLOOSE]:y[u.COMPARATOR],w=d.match(x);if(!w)throw new TypeError("Invalid comparator: "+d);this.operator=w[1]!==void 0?w[1]:"",this.operator==="="&&(this.operator=""),w[2]?this.semver=new B(w[2],this.options.loose):this.semver=ke},he.prototype.toString=function(){return this.value},he.prototype.test=function(d){if(r("Comparator.test",d,this.options.loose),this.semver===ke||d===ke)return!0;if(typeof d=="string")try{d=new B(d,this.options)}catch{return!1}return Z(d,this.operator,this.semver,this.options)},he.prototype.intersects=function(d,x){if(!(d instanceof he))throw new TypeError("a Comparator is required");(!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1});var w;if(this.operator==="")return this.value===""?!0:(w=new ae(d.value,x),st(this.value,w,x));if(d.operator==="")return d.value===""?!0:(w=new ae(this.value,x),st(d.semver,w,x));var P=(this.operator===">="||this.operator===">")&&(d.operator===">="||d.operator===">"),I=(this.operator==="<="||this.operator==="<")&&(d.operator==="<="||d.operator==="<"),_=this.semver.version===d.semver.version,U=(this.operator===">="||this.operator==="<=")&&(d.operator===">="||d.operator==="<="),re=Z(this.semver,"<",d.semver,x)&&(this.operator===">="||this.operator===">")&&(d.operator==="<="||d.operator==="<"),le=Z(this.semver,">",d.semver,x)&&(this.operator==="<="||this.operator==="<")&&(d.operator===">="||d.operator===">");return P||I||_&&U||re||le},t.Range=ae;function ae(d,x){if((!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1}),d instanceof ae)return d.loose===!!x.loose&&d.includePrerelease===!!x.includePrerelease?d:new ae(d.raw,x);if(d instanceof he)return new ae(d.value,x);if(!(this instanceof ae))return new ae(d,x);if(this.options=x,this.loose=!!x.loose,this.includePrerelease=!!x.includePrerelease,this.raw=d.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(function(w){return this.parseRange(w.trim())},this).filter(function(w){return w.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}ae.prototype.format=function(){return this.range=this.set.map(function(d){return d.join(" ").trim()}).join("||").trim(),this.range},ae.prototype.toString=function(){return this.range},ae.prototype.parseRange=function(d){var x=this.options.loose,w=x?y[u.HYPHENRANGELOOSE]:y[u.HYPHENRANGE];d=d.replace(w,nt),r("hyphen replace",d),d=d.replace(y[u.COMPARATORTRIM],K),r("comparator trim",d,y[u.COMPARATORTRIM]),d=d.replace(y[u.TILDETRIM],L),d=d.replace(y[u.CARETTRIM],M),d=d.split(/\s+/).join(" ");var P=x?y[u.COMPARATORLOOSE]:y[u.COMPARATOR],I=d.split(" ").map(function(_){return en(_,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(I=I.filter(function(_){return!!_.match(P)})),I=I.map(function(_){return new he(_,this.options)},this),I},ae.prototype.intersects=function(d,x){if(!(d instanceof ae))throw new TypeError("a Range is required");return this.set.some(function(w){return Lt(w,x)&&d.set.some(function(P){return Lt(P,x)&&w.every(function(I){return P.every(function(_){return I.intersects(_,x)})})})})};function Lt(d,x){for(var w=!0,P=d.slice(),I=P.pop();w&&P.length;)w=P.every(function(_){return I.intersects(_,x)}),I=P.pop();return w}t.toComparators=Zt;function Zt(d,x){return new ae(d,x).set.map(function(w){return w.map(function(P){return P.value}).join(" ").trim().split(" ")})}function en(d,x){return r("comp",d,x),d=tt(d,x),r("caret",d),d=qt(d,x),r("tildes",d),d=nn(d,x),r("xrange",d),d=$e(d,x),r("stars",d),d}function Oe(d){return!d||d.toLowerCase()==="x"||d==="*"}function qt(d,x){return d.trim().split(/\s+/).map(function(w){return Dn(w,x)}).join(" ")}function Dn(d,x){var w=x.loose?y[u.TILDELOOSE]:y[u.TILDE];return d.replace(w,function(P,I,_,U,re){r("tilde",d,P,I,_,U,re);var le;return Oe(I)?le="":Oe(_)?le=">="+I+".0.0 <"+(+I+1)+".0.0":Oe(U)?le=">="+I+"."+_+".0 <"+I+"."+(+_+1)+".0":re?(r("replaceTilde pr",re),le=">="+I+"."+_+"."+U+"-"+re+" <"+I+"."+(+_+1)+".0"):le=">="+I+"."+_+"."+U+" <"+I+"."+(+_+1)+".0",r("tilde return",le),le})}function tt(d,x){return d.trim().split(/\s+/).map(function(w){return tn(w,x)}).join(" ")}function tn(d,x){r("caret",d,x);var w=x.loose?y[u.CARETLOOSE]:y[u.CARET];return d.replace(w,function(P,I,_,U,re){r("caret",d,P,I,_,U,re);var le;return Oe(I)?le="":Oe(_)?le=">="+I+".0.0 <"+(+I+1)+".0.0":Oe(U)?I==="0"?le=">="+I+"."+_+".0 <"+I+"."+(+_+1)+".0":le=">="+I+"."+_+".0 <"+(+I+1)+".0.0":re?(r("replaceCaret pr",re),I==="0"?_==="0"?le=">="+I+"."+_+"."+U+"-"+re+" <"+I+"."+_+"."+(+U+1):le=">="+I+"."+_+"."+U+"-"+re+" <"+I+"."+(+_+1)+".0":le=">="+I+"."+_+"."+U+"-"+re+" <"+(+I+1)+".0.0"):(r("no pr"),I==="0"?_==="0"?le=">="+I+"."+_+"."+U+" <"+I+"."+_+"."+(+U+1):le=">="+I+"."+_+"."+U+" <"+I+"."+(+_+1)+".0":le=">="+I+"."+_+"."+U+" <"+(+I+1)+".0.0"),r("caret return",le),le})}function nn(d,x){return r("replaceXRanges",d,x),d.split(/\s+/).map(function(w){return rn(w,x)}).join(" ")}function rn(d,x){d=d.trim();var w=x.loose?y[u.XRANGELOOSE]:y[u.XRANGE];return d.replace(w,function(P,I,_,U,re,le){r("xRange",d,P,I,_,U,re,le);var Ue=Oe(_),De=Ue||Oe(U),Ee=De||Oe(re),Te=Ee;return I==="="&&Te&&(I=""),le=x.includePrerelease?"-0":"",Ue?I===">"||I==="<"?P="<0.0.0-0":P="*":I&&Te?(De&&(U=0),re=0,I===">"?(I=">=",De?(_=+_+1,U=0,re=0):(U=+U+1,re=0)):I==="<="&&(I="<",De?_=+_+1:U=+U+1),P=I+_+"."+U+"."+re+le):De?P=">="+_+".0.0"+le+" <"+(+_+1)+".0.0"+le:Ee&&(P=">="+_+"."+U+".0"+le+" <"+_+"."+(+U+1)+".0"+le),r("xRange return",P),P})}function $e(d,x){return r("replaceStars",d,x),d.trim().replace(y[u.STAR],"")}function nt(d,x,w,P,I,_,U,re,le,Ue,De,Ee,Te){return Oe(w)?x="":Oe(P)?x=">="+w+".0.0":Oe(I)?x=">="+w+"."+P+".0":x=">="+x,Oe(le)?re="":Oe(Ue)?re="<"+(+le+1)+".0.0":Oe(De)?re="<"+le+"."+(+Ue+1)+".0":Ee?re="<="+le+"."+Ue+"."+De+"-"+Ee:re="<="+re,(x+" "+re).trim()}ae.prototype.test=function(d){if(!d)return!1;if(typeof d=="string")try{d=new B(d,this.options)}catch{return!1}for(var x=0;x<this.set.length;x++)if(Tt(this.set[x],d,this.options))return!0;return!1};function Tt(d,x,w){for(var P=0;P<d.length;P++)if(!d[P].test(x))return!1;if(x.prerelease.length&&!w.includePrerelease){for(P=0;P<d.length;P++)if(r(d[P].semver),d[P].semver!==ke&&d[P].semver.prerelease.length>0){var I=d[P].semver;if(I.major===x.major&&I.minor===x.minor&&I.patch===x.patch)return!0}return!1}return!0}t.satisfies=st;function st(d,x,w){try{x=new ae(x,w)}catch{return!1}return x.test(d)}t.maxSatisfying=jt;function jt(d,x,w){var P=null,I=null;try{var _=new ae(x,w)}catch{return null}return d.forEach(function(U){_.test(U)&&(!P||I.compare(U)===-1)&&(P=U,I=new B(P,w))}),P}t.minSatisfying=_t;function _t(d,x,w){var P=null,I=null;try{var _=new ae(x,w)}catch{return null}return d.forEach(function(U){_.test(U)&&(!P||I.compare(U)===1)&&(P=U,I=new B(P,w))}),P}t.minVersion=Ge;function Ge(d,x){d=new ae(d,x);var w=new B("0.0.0");if(d.test(w)||(w=new B("0.0.0-0"),d.test(w)))return w;w=null;for(var P=0;P<d.set.length;++P){var I=d.set[P];I.forEach(function(_){var U=new B(_.semver.version);switch(_.operator){case">":U.prerelease.length===0?U.patch++:U.prerelease.push(0),U.raw=U.format();case"":case">=":(!w||Ze(w,U))&&(w=U);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+_.operator)}})}return w&&d.test(w)?w:null}t.validRange=En;function En(d,x){try{return new ae(d,x).range||"*"}catch{return null}}t.ltr=on;function on(d,x,w){return C(d,x,"<",w)}t.gtr=Sn;function Sn(d,x,w){return C(d,x,">",w)}t.outside=C;function C(d,x,w,P){d=new B(d,P),x=new ae(x,P);var I,_,U,re,le;switch(w){case">":I=Ze,_=et,U=Ke,re=">",le=">=";break;case"<":I=Ke,_=yt,U=Ze,re="<",le="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(st(d,x,P))return!1;for(var Ue=0;Ue<x.set.length;++Ue){var De=x.set[Ue],Ee=null,Te=null;if(De.forEach(function(Ye){Ye.semver===ke&&(Ye=new he(">=0.0.0")),Ee=Ee||Ye,Te=Te||Ye,I(Ye.semver,Ee.semver,P)?Ee=Ye:U(Ye.semver,Te.semver,P)&&(Te=Ye)}),Ee.operator===re||Ee.operator===le||(!Te.operator||Te.operator===re)&&_(d,Te.semver))return!1;if(Te.operator===le&&U(d,Te.semver))return!1}return!0}t.prerelease=kt;function kt(d,x){var w=T(d,x);return w&&w.prerelease.length?w.prerelease:null}t.intersects=Nt;function Nt(d,x,w){return d=new ae(d,w),x=new ae(x,w),d.intersects(x)}t.coerce=sn;function sn(d,x){if(d instanceof B)return d;if(typeof d=="number"&&(d=String(d)),typeof d!="string")return null;x=x||{};var w=null;if(!x.rtl)w=d.match(y[u.COERCE]);else{for(var P;(P=y[u.COERCERTL].exec(d))&&(!w||w.index+w[0].length!==d.length);)(!w||P.index+P[0].length!==w.index+w[0].length)&&(w=P),y[u.COERCERTL].lastIndex=P.index+P[1].length+P[2].length;y[u.COERCERTL].lastIndex=-1}return w===null?null:T(w[2]+"."+(w[3]||"0")+"."+(w[4]||"0"),x)}})(ci,ci.exports);var ih=ci.exports;const pa=Ds,Rt=ih,ze="semver",oh={base:pa.string(),type:"semverRange",validate:function(e,{error:t}){return Rt.validRange(e)?{value:e}:{errors:t(`${ze}.valid`)}},messages:{[`${ze}.valid`]:"{{#label}} needs to be a valid semver range"}},wn={};wn.compare={method:!1,validate:function(e,t,{exp:n},{name:r}){return Rt[r](e,n)?e:t.error(`${ze}.${r}`,{exp:n})},args:[{name:"exp",assert:Rt.valid,message:"needs to be a valid semver expression"}]};["gt","gte","lt","lte","eq","neq"].forEach(function(e){wn[e]={method:function(t){return this.$_addRule({name:e,method:"compare",args:{exp:t}})}}});wn.cmp={method:function(e,t){return this.$_addRule({name:"cmp",args:{cmp:e,exp:t}})},validate:function(e,t,{cmp:n,exp:r}){return Rt.cmp(e,n,r)?e:t.error(`${ze}.cmp`,{cmp:n,exp:r})},args:[{name:"cmp",assert:e=>["===","!==","","=","==","!=",">",">=","<","<="].includes(e),message:"needs to be a valid comparator"},{name:"exp",assert:Rt.valid,message:"needs to be a valid semver expression"}]};wn.compareRange={method:!1,validate:function(e,t,{rng:n},{name:r}){return Rt[r](e,n)?e:t.error(`${ze}.${r}`,{rng:n})},args:[{name:"rng",assert:Rt.validRange,message:"needs to be a valid semver range"}]};["satisfies","gtr","ltr"].forEach(function(e){wn[e]={method:function(t){return this.$_addRule({name:e,method:"compareRange",args:{rng:t}})}}});wn.outside={method:function(e,t){return this.$_addRule({name:"outside",args:{hilo:e,rng:t}})},validate:function(e,t,{hilo:n,rng:r}){return Rt.outside(e,r,n)?e:t.error(`${ze}.outside`,{hilo:n,rng:r})},args:[{name:"hilo",assert:e=>[">","<"].includes(e),message:"needs to be a valid comparator"},{name:"rng",assert:Rt.validRange,message:"needs to be a valid semver range"}]};const sh={base:pa.string(),type:"semver",validate:function(e,{error:t}){return Rt.valid(e)?{value:e}:{errors:t(`${ze}.valid`)}},messages:{[`${ze}.valid`]:"{{#label}} needs to be a valid semver expression",[`${ze}.gt`]:"{{#label}} needs to be greater than {{#exp}}",[`${ze}.gte`]:"{{#label}} needs to be greater than or equal to {{#exp}}",[`${ze}.lt`]:"{{#label}} needs to be less than {{#exp}}",[`${ze}.lte`]:"{{#label}} needs to be less than or equal to {{#exp}}",[`${ze}.eq`]:"{{#label}} needs to be logically equivalent to {{#exp}}",[`${ze}.neq`]:"{{#label}} needs to be logically different than {{#exp}}",[`${ze}.cmp`]:"{{#label}} needs to satisfy {{#cmp}} on {{#exp}}",[`${ze}.satisfies`]:"{{#label}} needs to satisfy {{#rng}}",[`${ze}.gtr`]:"{{#label}} needs to be greater than range {{#rng}}",[`${ze}.ltr`]:"{{#label}} needs to be less than range {{#rng}}",[`${ze}.outside`]:"{{#label}} needs to be {{#hilo}} than range {{#rng}}"},rules:wn};var ah={semver:sh,semverRange:oh};/*!
|
|
200
|
-
* is-var-name | ISC (c) Shinnosuke Watanabe
|
|
201
|
-
* https://github.com/shinnn/is-var-name
|
|
202
|
-
*/function lh(e){if(typeof e!="string"||e.trim()!==e)return!1;try{new Function(e,"var "+e)}catch{return!1}return!0}const ch=Object.freeze(Object.defineProperty({__proto__:null,default:lh},Symbol.toStringTag,{value:"Module"})),uh=Ii(ch),dh=Ii(Jl),hh=nc,fh=rc,Ho=Sr,ph=e=>{if((0,Ho.isValid)(e))return e;const t=(0,fh.toHex)(Ec.from(typeof e=="string"?e.trim():e));return(0,Ho.fromPublicKey)(t,{role:hh.types.RoleType.ROLE_ANY})};var mh=ph,bn={},ma=Se&&Se.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(bn,"__esModule",{value:!0});bn.didExtension=bn.fileExtension=void 0;const Vo=ma(da),gh=ma(ou),vh=Sr,ga=e=>({type:"file",base:e.string(),validate(t,{error:n}){return t&&typeof t=="string"?{value:t}:{errors:n("file.empty",{file:t})}},messages:{"file.empty":'file "{{#file}}" must be non-empty string',"file.enoent":'file "{{#file}}" does not exist',"file.error.generic":'file could not be read. message: "{{#message}}"'},rules:{exists:{multi:!1,method({baseDir:t=null,canSkip:n=()=>!1}={}){return this.$_addRule({name:"exists",args:{baseDir:t,canSkip:n}})},args:[{name:"baseDir",assert:t=>Vo.default.existsSync(t),message:"baseDir must exist"},{name:"canSkip",assert:t=>typeof t=="function",message:"canSkip must be a function"}],validate(t,{error:n},{baseDir:r,canSkip:i}={}){if(typeof i=="function"&&i(r,t))return t;try{return Vo.default.statSync(gh.default.join(r,t)),t}catch(s){switch(s.code){case"ENOENT":return n("file.enoent",{file:t})}return n("file.error.generic",{message:s.message})}}}}});bn.fileExtension=ga;const va=e=>({type:"DID",base:e.string(),validate(t,{error:n}){return!t||typeof t!="string"?{errors:n("did.empty",{did:t})}:(0,vh.isValid)(t)===!1?{errors:n("did.invalid",{did:t})}:{value:t}},messages:{"did.empty":'did "{{#did}}" must be non-empty string',"did.invalid":'did "{{#did}}" is not valid'}});bn.didExtension=va;bn.default={fileExtension:ga,didExtension:va};var Bi={},ya={exports:{}};const yh=["assert","buffer","child_process","cluster","console","constants","crypto","dgram","dns","domain","events","fs","http","https","module","net","os","path","process","punycode","querystring","readline","repl","stream","string_decoder","timers","tls","tty","url","util","v8","vm","zlib"];var ba=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),bh=yh,xh=["node_modules","favicon.ico"],wh=ya.exports=function(e){var t=[],n=[];if(e===null)return n.push("name cannot be null"),Hn(t,n);if(e===void 0)return n.push("name cannot be undefined"),Hn(t,n);if(typeof e!="string")return n.push("name must be a string"),Hn(t,n);if(e.length||n.push("name length must be greater than zero"),e.match(/^\./)&&n.push("name cannot start with a period"),e.match(/^_/)&&n.push("name cannot start with an underscore"),e.trim()!==e&&n.push("name cannot contain leading or trailing spaces"),xh.forEach(function(a){e.toLowerCase()===a&&n.push(a+" is a blacklisted name")}),bh.forEach(function(a){e.toLowerCase()===a&&t.push(a+" is a core module name")}),e.length>214&&t.push("name can no longer contain more than 214 characters"),e.toLowerCase()!==e&&t.push("name can no longer contain capital letters"),/[~'!()*]/.test(e.split("/").slice(-1)[0])&&t.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(e)!==e){var r=e.match(ba);if(r){var i=r[1],s=r[2];if(encodeURIComponent(i)===i&&encodeURIComponent(s)===s)return Hn(t,n)}n.push("name can only contain URL-friendly characters")}return Hn(t,n)};wh.scopedPackagePattern=ba;var Hn=function(e,t){var n={validForNewPackages:t.length===0&&e.length===0,validForOldPackages:t.length===0,warnings:e,errors:t};return n.warnings.length||delete n.warnings,n.errors.length||delete n.errors,n},Eh=ya.exports;(function(e){var t=Se&&Se.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(e,"__esModule",{value:!0}),e.validateName=e.validateNewDid=void 0;const n=Sr,r=t(Eh),i=32,s=c=>{if((0,n.toTypeInfo)(c).role!==n.types.RoleType.ROLE_BLOCKLET)throw new Error("Blocklet DID's type must be ROLE_BLOCKLET")};e.validateNewDid=s;const a=(c,{checkDid:f=!0}={})=>{if((0,n.isValid)(c))f&&(0,e.validateNewDid)(c);else{const{validForNewPackages:y,errors:l=[],warnings:u=[]}=(0,r.default)(c);if(!y)throw new Error(l[0]||u[0]);if(c.length>i)throw new Error("Blocklet name is too long")}};e.validateName=a,e.default={validateName:e.validateName,validateNewDid:e.validateNewDid}})(Bi);var Sh=Se&&Se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),Th=Se&&Se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),jh=Se&&Se.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var r=e(t),i=0;i<r.length;i++)r[i]!=="default"&&Sh(n,t,r[i]);return Th(n,t),n}}(),An=Se&&Se.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(te,"__esModule",{value:!0});te.Joi=te.eventsSchema=te.installBlockletDescriptionSchema=te.installBlockletTitleSchema=te.resourceBundleSchema=te.authConfigSchema=te.cacheableSchema=te.statsSchema=te.titleSchema=te.themeSchema=te.signatureSchema=te.serviceSchema=te.scriptsSchema=te.personSchema=te.navigationSchema=te.navigationItemSchema=te.updateMountPointSchema=te.mountPointSchema=te.logoSchema=te.interfaceSchema=te.environmentNameSchema=te.environmentSchema=te.engineSchema=te.endpointSchema=te.distSchema=te.descriptionSchema=te.createBlockletSchema=te.componentSchema=te.blockletNameSchema=te.blockletMetaSchema=void 0;const kh=An(da),Oh=An(Ds),Ih=An(Jd),Rh=An(rh),Xo=ah,Ch=An(uh),Yo=Bs,Ph=Sr,Lh=dh,Ce=wt,_h=An(mh),Qo=bn,ui=Bi,$i=jh(_c),Nh=Ih.default.default,Jo="/.well-known",h=Oh.default.extend(Xo.semver).extend(Xo.semverRange).extend(Qo.fileExtension).extend(Qo.didExtension);te.Joi=h;const Zo=(e,t)=>(0,$i.checkLink)(e)?e:t.message(`Invalid navigation link: ${e}
|
|
203
|
-
|
|
204
|
-
A valid navigation link should be a relative url which start with '/' or a absolute url, such as:
|
|
205
|
-
- /en/home
|
|
206
|
-
- /zh/home
|
|
207
|
-
- https://www.arcblock.io
|
|
208
|
-
`),Ah=(e,t)=>!e||(0,Ch.default)(e)?e:t.message(`Invalid navigation id: ${e}
|
|
209
|
-
|
|
210
|
-
A valid navigation id is should follow the rules of javascript variables, such as:
|
|
211
|
-
- foo
|
|
212
|
-
- fooBar
|
|
213
|
-
- foo123
|
|
214
|
-
|
|
215
|
-
see detail in https://www.npmjs.com/package/is-var-name
|
|
216
|
-
`),Pr=h.string().trim().min(1).custom(e=>{if(Nh(e)>Ce.MAX_TITLE_LENGTH)throw new Error(`title length should not exceed ${Ce.MAX_TITLE_LENGTH} (see: https://www.npmjs.com/package/cjk-length)`);return e}).meta({className:"TTitle"});te.titleSchema=Pr;const Lr=h.string().trim().min(3).max(160).meta({className:"TDescription"});te.descriptionSchema=Lr;const xa=h.string().trim().min(3).max(20).messages({"*":"Title length must be between 3 and 20 characters"}).meta({className:"TInstallBlockletTitle"});te.installBlockletTitleSchema=xa;const wa=h.string().trim().min(3).max(80).messages({"*":"Description length must be between 3 and 80 characters"}).meta({className:"TInstallBlockletDescription"});te.installBlockletDescriptionSchema=wa;const Ea=h.string().uri({scheme:["http","https"],allowRelative:!0}).allow("").custom((e,t)=>e.includes(Yo.WELLKNOWN_BLOCKLET_LOGO_PATH)?t.message(`logo url should not include ${Yo.WELLKNOWN_BLOCKLET_LOGO_PATH}`):e).meta({className:"TLogo"});te.logoSchema=Ea;const Sa=h.string().trim().min(1),Ui=Sa.meta({className:"TMountPoint"}).custom((e,t)=>(0,$i.isValidUrlPath)(e)?e:t.message(`mountPoint cannot contain such characters space $*+~()'"!:@\\`));te.mountPointSchema=Ui;const Ta=Sa.meta({className:"TUpdateMountPoint"}).custom(e=>(0,$i.default)(e));te.updateMountPointSchema=Ta;const _n=h.string().custom(e=>((0,ui.validateName)(e),e)).meta({className:"TBlockletName"});te.blockletNameSchema=_n;const Dh=[],Wi=h.string().trim().min(1).max(50).required().custom((e,t)=>e.startsWith("BLOCKLET")&&!Dh.includes(e)?t.message("Env name can not start with BLOCKLET_"):e.startsWith("COMPONENT")?t.message("Env name can not start with COMPONENT_"):e.startsWith("ABTNODE")?t.message("Env name can not start with ABTNODE_"):/[^\w]/.test(e)?t.message('Env name can include only numbers or letters or "_"'):e).meta({className:"TEnvironmentName",unknownType:"any"});te.environmentNameSchema=Wi;const zi=h.object({name:Wi.required(),description:h.string().trim().required(),default:h.string().optional().allow("").default(""),required:h.boolean().default(!1),secure:h.boolean().default(!1),validation:h.string().optional(),shared:h.boolean().default(e=>e.secure?!1:void 0)}).custom((e,t)=>e.secure&&e.default?t.message(`Cannot declare default value for secure env ${e.name}`):e).meta({className:"TEnvironment",unknownType:"any"});te.environmentSchema=zi;const qi=h.object({dev:h.string().trim().min(1),e2eDev:h.string().trim().min(1),preFlight:h.string().trim().min(1),preInstall:h.string().trim().min(1),postInstall:h.string().trim().min(1),preStart:h.string().trim().min(1),postStart:h.string().trim().min(1),preStop:h.string().trim().min(1),preUninstall:h.string().trim().min(1),preConfig:h.string().trim().min(1)}).rename("pre-flight","preFlight").rename("pre-install","preInstall").rename("post-install","postInstall").rename("pre-start","preStart").rename("post-start","postStart").rename("pre-stop","preStop").rename("pre-uninstall","preUninstall").rename("pre-config","preConfig").optional().meta({className:"TScripts",unknownType:"any"});te.scriptsSchema=qi;const Ki=h.object({name:h.string().required().trim(),config:h.object().optional().default({})}).unknown(!0).meta({className:"TService",unknownType:"any"});te.serviceSchema=Ki;const Gi=h.object({type:h.string().trim(!0).min(1).required(),path:h.string().required(),meta:h.object({vcType:h.string(),payable:h.boolean(),params:h.array().items({name:h.string().required().trim(),description:h.string().required().trim()})})}).meta({className:"TEndpoint",unknownType:"any"});te.endpointSchema=Gi;const ja=h.string().trim().custom((e,t)=>{const n=e.split("/").filter(Boolean);return n.length===0?t.message("cacheable path must be a valid pathname that is not /"):`/${n.join("/")}`}).meta({className:"TPathPrefix",unknownType:"any"});te.cacheableSchema=ja;const Hi=h.object({type:h.string().lowercase().valid(...Ce.BLOCKLET_INTERFACE_TYPES).required(),name:h.string().trim().required(),path:h.string().trim().default("/"),prefix:h.string().trim().min(1).default(Ce.BLOCKLET_DYNAMIC_PATH_PREFIX),containerPort:h.number().port().optional(),hostIP:h.string().trim().ip({version:["ipv4","ipv6"]}).optional(),protocol:h.string().lowercase().valid(...Ce.BLOCKLET_INTERFACE_PROTOCOLS).default("http"),port:h.alternatives().try(h.string().uppercase().default(Ce.BLOCKLET_DEFAULT_PORT_NAME),h.object({internal:h.string().uppercase().required(),external:h.number().port().required()})).default(Ce.BLOCKLET_DEFAULT_PORT_NAME),cacheable:h.array().items(ja).unique(),services:h.array().items(Ki).unique("name"),endpoints:h.array().items(Gi).unique("type"),pageGroups:h.array().items(h.string().min(1).max(255).trim()).unique(),proxyBehavior:h.string().valid("service","direct").default("service").optional()}).meta({className:"TInterface",unknownType:"any"});te.interfaceSchema=Hi;const Mh=h.alternatives().try(h.string().required(),h.object({url:h.string().uri({scheme:["http","https","file"]}).required(),name:_n.required(),version:h.alternatives().try(h.string().valid("latest"),h.semverRange().valid())}),h.object({store:h.string().uri({scheme:["http","https"]}).required(),name:_n.required(),version:h.alternatives().try(h.string().valid("latest"),h.semverRange().valid()).default("latest")})),di=h.object({platform:h.string().valid(...Ce.BLOCKLET_PLATFORMS).optional(),interpreter:h.string().valid("binary","node","blocklet").default("node"),source:Mh,args:h.array().items(h.string()).optional().default([])}).meta({className:"TEngine",unknownType:"any"});te.engineSchema=di;const Qn=h.object({name:h.string().min(1).required(),email:h.string().email({tlds:!1}).optional(),url:h.string().uri().optional()}).meta({className:"TPerson",unknownType:"any"});te.personSchema=Qn;const er=h.object({tarball:h.alternatives().try(h.string().uri(),h.string()).required(),integrity:h.string().required(),size:h.number().optional()}).meta({className:"TDist",unknownType:"any"});te.distSchema=er;const ka=h.object({downloads:h.number().integer().greater(-1),star:h.number().default(0),purchases:h.number().default(0)}).meta({className:"TStats",unknownType:"any"});te.statsSchema=ka;const Fh=h.alternatives().try(h.object({url:h.alternatives().try(h.string().uri(),h.array().items(h.string().uri()).min(1)).required(),version:h.alternatives().try(h.string().valid("latest"),h.semverRange().valid())}),h.object({store:h.string().uri({scheme:["http","https"]}),name:_n.required(),version:h.alternatives().try(h.string().valid("latest"),h.semverRange().valid()).default("latest")})),Oa={source:Fh.required(),required:h.boolean(),title:Pr,description:Lr,mountPoint:Ui,name:_n},Ia=(e,t)=>h.object(e).custom((n,r)=>!t&&n.source&&n.source.name&&!n.source.store?r.message(`missing 'store' in source of component ${n.name}`):n),Vi=Ia(Oa).meta({className:"TComponent",unknownType:"any"});te.componentSchema=Vi;const Bh=Ia(Oa,!0),Ra=({checkStore:e}={})=>{const t=[Vi,Bh];return h.array().items(e?t[0]:t[1]).optional().default([])},Ca=h.object({type:h.string().required(),name:h.string().required(),signer:h.string().required(),pk:h.string().required(),created:h.string().isoDate().required(),sig:h.string().required(),excludes:h.array().items(h.string()).optional(),appended:h.array().items(h.string()).optional(),delegatee:h.string(),delegateePk:h.string(),delegation:h.string()}).meta({className:"TSignature",unknownType:"any"});te.signatureSchema=Ca;const Kr=["en","zh","fr","ru","ar","es","de","pt","ja","hi"],es={id:h.string().custom(Ah),title:h.alternatives().try(h.string().min(1).max(Ce.MAX_TITLE_LENGTH),h.object().min(1).pattern(h.string().valid(...Kr),h.string().min(1).max(Ce.MAX_TITLE_LENGTH))).required(),description:h.alternatives().try(h.string().min(1).max(Ce.MAX_DESCRIPTION_LENGTH),h.object().min(1).pattern(h.string().valid(...Kr),h.string().min(1).max(Ce.MAX_DESCRIPTION_LENGTH))),link:h.alternatives().try(h.string().custom(Zo),h.object().min(1).pattern(h.string().valid(...Kr),h.string().custom(Zo))),component:h.string().min(1),section:h.array().items(h.string().min(1)).single(),role:h.array().items(h.string().min(1)).single(),icon:h.string().min(1),visible:h.boolean()},Pa=h.object({...es,items:h.array().items(h.object({...es}).rename("child","component"))}).rename("child","component").meta({className:"TNavigationItem",unknownType:"any"});te.navigationItemSchema=Pa;const Xi=h.array().items(Pa).unique((e,t)=>e.id&&t.id?e.id===t.id:!1).meta({className:"TNavigation",unknownType:"any"});te.navigationSchema=Xi;const Yi=h.object({background:h.alternatives().try(h.string().min(1),h.object({header:h.string().min(1),footer:h.string().min(1),default:h.string().min(1)}).min(1))}).meta({className:"TTheme",unknownType:"any"});te.themeSchema=Yi;const La=h.object({whoCanAccess:h.string().valid("owner","invited","all"),profileFields:h.array().items(h.string().valid("fullName","email","avatar","phone")).unique(),ignoreUrls:h.array().items(h.string().min(1)),allowSwitchProfile:h.boolean(),blockUnauthenticated:h.boolean(),blockUnauthorized:h.boolean()}).options({stripUnknown:!0}).meta({className:"TAuthConfig",unknownType:"any"});te.authConfigSchema=La;const $h=h.object({type:h.string().trim().min(1).required(),description:h.string().trim().min(1)}),Qi=h.object({did:h.DID().trim().required(),type:h.string().trim().min(1).required(),public:h.boolean()}).meta({className:"TResourceBundle",unknownType:"any"});te.resourceBundleSchema=Qi;const Ji=h.array().items(h.object({type:h.string().trim().min(1).max(128).pattern(/^(?!blocklet\.)[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/).message('Event type must be in format of "[noun.]verb" like "post.published" or "post.comment.published", and prefix "blocklet." is reserved').required(),description:h.string().trim().min(1).max(256).required()})).unique("type").meta({className:"TEvent",unknownType:"any"});te.eventsSchema=Ji;const _a={did:h.DID().trim().required(),version:h.semver().valid().required(),name:h.string().optional(),description:Lr.required(),group:h.string().valid(...Ce.BLOCKLET_GROUPS),main:h.string().trim(),title:Pr.optional().allow(""),logo:h.string().trim().optional(),specVersion:h.semver().valid().gte("1.0.0").optional(),author:Qn.optional(),contributors:h.array().items(Qn).optional(),maintainers:h.array().items(Qn).optional(),community:h.string().uri().optional().allow("").default(""),documentation:h.string().uri().optional().allow("").default(""),homepage:h.string().uri().optional().allow("").default(""),license:h.string().optional().allow("").default(""),support:h.alternatives().try(h.string().uri(),h.string().email({tlds:!1})).optional(),nftFactory:h.DID().optional().allow("").default(""),payment:h.object({price:h.array().max(1).items(h.object({value:h.number().greater(0).required(),address:h.DID().required()})).default([]),share:h.array().max(4).items(h.object({name:h.string().required(),address:h.DID().required(),value:h.number().greater(0).max(1).required()})).default([]).custom(e=>{if(e.length===0)return e;const t=e.reduce((n,r)=>n+r.value,0);if(t!==1)throw new Error(`Invalid blocklet payment share config: total share must be 1, got ${t}`);return e},"invalid blocklet share"),componentPrice:h.array().items(h.object({parentPriceRange:h.array().items(h.number()).custom((e,t)=>e.length!==2?t.message("length of range should be 2"):e[0]<0?t.message("the first value should not less than 0 in range"):e[1]<=e[0]?t.message("the second value should greater than the first value in range"):e),type:h.string().valid("fixed","percentage").required(),value:h.number().greater(0).required()})).single()}).default({price:[],share:[]}),keywords:h.alternatives().try(h.string().trim().min(1),h.array().items(h.string().min(1))).optional(),tags:h.alternatives().try(h.string().trim().min(1),h.array().items(h.string().min(1))).optional(),gitHash:h.string().optional().allow(""),repository:h.alternatives().try(h.string().min(1),h.object({type:h.string().valid("git","https","svn").required(),url:h.string().uri().required(),directory:h.string()})).optional(),timeout:h.object({start:h.number().min(10).max(600),script:h.number().min(1).max(1800)}).default({start:60}),requirements:h.object({abtnode:h.semverRange().valid(),server:h.semverRange().valid(),os:h.alternatives().try(h.string().valid("*",...Ce.BLOCKLET_PLATFORMS),h.array().items(h.string().valid(...Ce.BLOCKLET_PLATFORMS)).min(1)),cpu:h.alternatives().try(h.string().valid("*",...Ce.BLOCKLET_ARCHITECTURES),h.array().items(h.string().valid(...Ce.BLOCKLET_ARCHITECTURES)).min(1)),fuels:h.array().items(h.object({endpoint:h.string().trim().required(),address:h.string().trim(),value:h.string().trim().required(),reason:h.string().trim().required()})),nodejs:h.semverRange().valid()}).default({server:Ce.BLOCKLET_LATEST_REQUIREMENT_SERVER,os:"*",cpu:"*",nodejs:"*"}),interfaces:h.array().items(Hi).unique("name").custom((e,t)=>{if(e.filter(i=>i.type===Ce.BLOCKLET_INTERFACE_TYPE_WEB).length>1)return t.message(`Only one ${Ce.BLOCKLET_INTERFACE_TYPE_WEB} interface can be declared`);const r=e.filter(i=>i.type===Ce.BLOCKLET_INTERFACE_TYPE_WELLKNOWN);for(const i of r)if(!i.prefix.startsWith(Jo))return t.message(`Wellknown path prefix must start with: ${Jo}`);return e}).default([]),environments:h.array().items(zi).default([]).optional().custom((e,t)=>{if(e&&e.length){const n=e.filter((r,i)=>e.findIndex(s=>s.name===r.name)!==i);if(n.length)return t.message(`find duplicate environment names ${n.map(r=>r.name).join(", ")}`)}return e}),scripts:qi,capabilities:h.object({clusterMode:h.boolean(),didSpace:h.string().valid(...Object.values(Ce.BLOCKLET_APP_SPACE_REQUIREMENT)).optional(),navigation:h.boolean().default(!0),serverless:h.boolean().optional(),component:h.boolean(),sitemap:h.boolean().optional(),mcp:h.boolean().optional()}).default({}),files:h.array().items(h.string().trim()).optional(),resource:h.object({exportApi:h.string().trim(),bundles:h.array().items(Qi),types:h.array().items($h).max(10)}),engine:h.alternatives().try(di,h.array().items(di)).optional(),screenshots:h.array().items(h.string().min(1)).optional().default([]),videos:h.array().items(h.string().pattern(/^https:\/\/(www\.)?(youtube\.com|youtu\.be|vimeo\.com)\/[\w\-/?&=]+/).message("Each video URL must be a valid YouTube or Vimeo link")).max(3).optional(),logoUrl:h.string().optional().allow(""),dist:er.optional(),stats:ka.optional(),htmlAst:h.any().optional(),path:h.string().optional(),signatures:h.array().items(Ca).optional(),lastPublishedAt:h.string().isoDate().optional().allow(null),components:Ra(),navigation:Xi,theme:Yi,copyright:h.object({owner:h.string().min(1),year:h.alternatives().try(h.string(),h.number())}),bundleName:h.string(),bundleDid:h.DID().trim(),storeId:h.string(),events:Ji.optional()},Uh=h.object(_a).options({stripUnknown:!0,noDefaults:!1}).meta({className:"TBlockletMeta",unknownType:"any"});te.blockletMetaSchema=Uh;const Na=(e,{ensureFiles:t=!1,ensureDist:n=!1,ensureComponentStore:r=!0,ensureName:i=!1,skipValidateDidName:s=!1,...a}={})=>((!e||!kh.default.existsSync(e))&&(t=!1),h.object({..._a,owner:h.object({avatar:h.string().optional(),did:h.DID().trim().required(),fullName:h.string().trim().required(),email:h.string().optional().allow(null).empty("").default("")}).optional(),logo:t?h.file().trim().exists({baseDir:e}).optional():h.string().trim().optional(),files:h.array().items(t?h.file().exists({baseDir:e,canSkip:(c,f)=>[Ce.BLOCKLET_ENTRY_FILE,Ce.BLOCKLET_BUNDLE_FILE].includes(f)||(0,Rh.default)(f)}):h.string().trim()).optional(),dist:n?er.required():er.optional(),components:Ra({checkStore:r}),name:i?h.string().optional():h.string().required(),egress:h.boolean().optional().default(!0),docker:Lh.dockerSchema}).options({stripUnknown:!0,noDefaults:!1,...a}).rename("children","components").custom((c,f)=>{const{did:y,name:l,docker:u}=c;if(u){const{image:m,dockerfile:S,network:j}=u;if(!m&&!S)return f.message("Image or dockerfile must be set");if(m&&S)return f.message("Image and dockerfile cannot be set at the same time");if(j)return f.message("ExportPorts and network cannot be set at the same time");S&&(c.files||(c.files=[]),c.files.push(S))}let k;if((0,Ph.isValid)(y))try{return(0,ui.validateNewDid)(y),c}catch(m){k=m}if(l){(0,ui.validateName)(l,{checkDid:!s});const m=(0,_h.default)(l);return m!==y?f.message(`The did of name "${l}" should be "${m}"`):c}return k?f.message(k.message):c}));te.createBlockletSchema=Na;te.default={blockletNameSchema:_n,componentSchema:Vi,endpointSchema:Gi,serviceSchema:Ki,createBlockletSchema:Na,interfaceSchema:Hi,environmentSchema:zi,environmentNameSchema:Wi,scriptsSchema:qi,personSchema:Qn,distSchema:er,titleSchema:Pr,descriptionSchema:Lr,logoSchema:Ea,navigationSchema:Xi,themeSchema:Yi,mountPointSchema:Ui,updateMountPointSchema:Ta,authConfigSchema:La,resourceBundleSchema:Qi,installBlockletTitleSchema:xa,installBlockletDescriptionSchema:wa,eventsSchema:Ji,Joi:h};var Et={},Wh=Se&&Se.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Et,"__esModule",{value:!0});Et.setService=Et.findService=Et.getDefaultServiceConfig=Et.getServiceConfig=void 0;const zh=Wh(su),qh=te,Aa={},Zi=e=>{Aa[e.name]={validate:e.schema.validate.bind(e.schema),defaultConfig:e.default}};Et.setService=Zi;Zi({name:"auth",schema:qh.authConfigSchema,default:{}});const Da=e=>{if(!e)throw new Error("service name should not be empty");const t=Aa[e];if(!t)throw new Error(`service ${e} does not exist`);return t},Ma=(e,t,{validate:n}={})=>{const r=Da(e),i=(0,zh.default)(t||{}),{value:s,error:a}=r.validate(i);if(n&&a)throw new Error(`Invalid blocklet service config: ${a.details.map(c=>c.message).join(", ")}`);return s};Et.getServiceConfig=Ma;const Fa=e=>{const{defaultConfig:t}=Da(e);return t};Et.getDefaultServiceConfig=Fa;const Ba=(e,t)=>{const n=[t];return(e||[]).find(r=>n.includes(r.name))};Et.findService=Ba;Et.default={getServiceConfig:Ma,getDefaultServiceConfig:Fa,findService:Ba,setService:Zi};Object.defineProperty(yn,"__esModule",{value:!0});yn.fixAndValidateService=yn.validateMeta=void 0;const Kh=te,Gh=Et,Hh=e=>(!e.interfaces||!e.interfaces.length||e.interfaces.forEach(t=>{t.services&&t.services.length&&t.services.forEach(n=>{n.config=(0,Gh.getServiceConfig)(n.name,n.config,{validate:!0})})}),e);yn.fixAndValidateService=Hh;const $a=(e,{ensureFiles:t=!1,ensureDist:n=!1,ensureComponentStore:r=!0,ensureName:i=!1,skipValidateDidName:s=!1,schemaOptions:a={}}={})=>{const c=(0,Kh.createBlockletSchema)(null,{ensureFiles:t,ensureDist:n,ensureComponentStore:r,ensureName:i,skipValidateDidName:s,...a}),{value:f,error:y}=c.validate(e);if(y)throw new Error(`Invalid blocklet meta: ${y.details.map(l=>l.message).join(", ")}`);return f};yn.validateMeta=$a;yn.default=$a;(function(e){var t=Se&&Se.__createBinding||(Object.create?function(T,F,H,B){B===void 0&&(B=H);var ce=Object.getOwnPropertyDescriptor(F,H);(!ce||("get"in ce?!F.__esModule:ce.writable||ce.configurable))&&(ce={enumerable:!0,get:function(){return F[H]}}),Object.defineProperty(T,B,ce)}:function(T,F,H,B){B===void 0&&(B=H),T[B]=F[H]}),n=Se&&Se.__setModuleDefault||(Object.create?function(T,F){Object.defineProperty(T,"default",{enumerable:!0,value:F})}:function(T,F){T.default=F}),r=Se&&Se.__importStar||function(){var T=function(F){return T=Object.getOwnPropertyNames||function(H){var B=[];for(var ce in H)Object.prototype.hasOwnProperty.call(H,ce)&&(B[B.length]=ce);return B},T(F)};return function(F){if(F&&F.__esModule)return F;var H={};if(F!=null)for(var B=T(F),ce=0;ce<B.length;ce++)B[ce]!=="default"&&t(H,F,B[ce]);return n(H,F),H}}(),i=Se&&Se.__importDefault||function(T){return T&&T.__esModule?T:{default:T}};Object.defineProperty(e,"__esModule",{value:!0}),e.fixService=e.fixInterfaces=e.parsePerson=e.formatPerson=e.fixName=e.fixTags=e.fixPerson=e.fixKeywords=e.fixFiles=e.fixRepository=e.fixRequired=void 0;const s=i(Nc),a=r(zd),c=wt,f=yn;Object.defineProperty(e,"fixService",{enumerable:!0,get:function(){return f.fixAndValidateService}});const y=Bi,l=(T,F)=>{T.description||(T.description=`Blocklet from ${F}`),T.version||(T.version=c.BLOCKLET_DEFAULT_VERSION)};e.fixRequired=l;const u=T=>{if(T.repository&&(typeof T.repository=="string"&&(T.repository={type:"git",url:T.repository}),T.repository.url)){const F=a.fromUrl(T.repository.url);F&&(T.repository.url=F.getDefaultRepresentation()==="shortcut"?F.https():F.toString())}};e.fixRepository=u;const k=T=>{Array.isArray(T.files)?T.files&&(T.files=T.files.filter(F=>!(!F||typeof F!="string"))):delete T.files};e.fixFiles=k;const m=T=>{typeof T.keywords=="string"&&(T.keywords=T.keywords.split(/,\s+/)),T.keywords&&!Array.isArray(T.keywords)?delete T.keywords:T.keywords&&(T.keywords=T.keywords.filter(F=>!(typeof F!="string"||!F)))};e.fixKeywords=m;const S=T=>{typeof T.tags=="string"&&(T.tags=T.tags.split(/,\s+/)),T.tags&&!Array.isArray(T.tags)?delete T.tags:T.tags&&(T.tags=T.tags.filter(F=>!(typeof F!="string"||!F)))};e.fixTags=S;const j=(T,F)=>(T.author&&(T.author=F(T.author)),["maintainers","contributors"].forEach(H=>{Array.isArray(T[H])&&(T[H]=T[H].map(F))}),T),D=T=>{if(!T)return"";if(typeof T=="string")return T;const F=T.name||"",H=T.url||T.web,B=H?` (${H})`:"",ce=T.email||T.mail,V=ce?` <${ce}>`:"";return F+V+B};e.formatPerson=D;const L=T=>{if(typeof T!="string")return T;const F=T.match(/^([^(<]+)/),H=T.match(/\(([^)]+)\)/),B=T.match(/<([^>]+)>/),ce={};return F&&F[0].trim()&&(ce.name=F[0].trim()),B&&([,ce.email]=B),H&&([,ce.url]=H),ce};e.parsePerson=L;const M=T=>(j(T,D),j(T,L),T);e.fixPerson=M;const K=(T,F=!0)=>{if(Array.isArray(T.interfaces)||(T.interfaces=[]),T.interfaces.length)return T.interfaces.forEach(V=>{V.type===c.BLOCKLET_INTERFACE_TYPE_WEB&&(V.protocol="http")}),T;const B=(0,s.default)(T,"capabilities.dynamicPathPrefix",!0)?c.BLOCKLET_DYNAMIC_PATH_PREFIX:"/",ce=({type:V="web",name:se,path:Pe="/",protocol:Be="http",port:Ae=c.BLOCKLET_DEFAULT_PORT_NAME})=>{T.interfaces.push({type:V,name:se,path:Pe,prefix:B,port:Ae,protocol:Be})};return[c.BLOCKLET_INTERFACE_PUBLIC].forEach(V=>{T[V]&&ce({name:V,path:T[V]})}),Array.isArray(T.exposeServices)&&T.exposeServices.forEach(V=>{ce({type:"service",name:V.protocol,protocol:V.protocol,port:{internal:`BLOCKLET_${V.protocol}_PORT`.toUpperCase(),external:V.port}})}),F&&(delete T.publicUrl,delete T.adminUrl,delete T.configUrl,delete T.docUrl,delete T.exposeServices,T.capabilities&&delete T.capabilities.dynamicPathPrefix),T};e.fixInterfaces=K;const G=T=>{const{did:F}=T;try{(0,y.validateNewDid)(F),T.name=F}catch{}return T};e.fixName=G,e.default={fixRequired:l,fixRepository:u,fixFiles:k,fixKeywords:m,fixPerson:M,fixTags:S,fixName:G,formatPerson:D,parsePerson:L,fixInterfaces:K,fixService:f.fixAndValidateService}})(sa);function Ua({owner:e,locale:t}){return o.jsxs(X,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.fullName,e.did?o.jsx(Fs,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:e.did,compact:!0,size:14,locale:t}):null]})}Ua.propTypes={owner:N.object.isRequired,locale:N.string.isRequired};const Vh="install-blocklet-from-URL",Wa=()=>{const[e,t]=Ys(Vh,"[]",{raw:!0}),n=i=>{const s=i.trim(),a=JSON.parse(e),c=a.findIndex(f=>f===s);c!==0&&(c>0&&a.splice(c,1),a.length>=10&&a.splice(9),a.unshift(s),t(JSON.stringify(a)))},r=i=>{if(!i)return;const s=JSON.parse(e),a=i.trim(),c=s.findIndex(f=>f===a);c>-1&&(s.splice(c,1),t(JSON.stringify(s)))};return{urls:e?JSON.parse(e):[],addUrlRecord:n,removeUrlRecord:r}},Xh=ks(()=>({listItemText:{"& span":{display:"block",width:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}}));function eo(e){const{value:t,onValueChange:n,children:r,helperText:i}=e,{urls:s,removeUrlRecord:a}=Wa(),c=(y,l)=>{y.preventDefault(),y.stopPropagation(),a(l)},f=Xh();return o.jsxs(X,{children:[o.jsx(Os,{freeSolo:!0,options:s,inputValue:t,onInputChange:(y,l)=>{n(l)},disableClearable:!0,popupIcon:null,renderInput:y=>zt.cloneElement(r,{...y}),renderOption:(y,l)=>A.createElement(Is,{...y,key:l,secondaryAction:o.jsx(js,{edge:"end","aria-label":"delete",onClick:u=>c(u,l),children:o.jsx(ic,{})})},o.jsx(Pl,{role:void 0,dense:!0,sx:{paddingLeft:0,paddingRight:30,"&:hover":{backgroundColor:"transparent"}},children:o.jsx(Rs,{primary:l,className:f.listItemText})})),ListboxProps:{sx:{maxHeight:300,overflow:"auto"}}}),o.jsx(Ll,{style:{margin:0},children:i})]})}eo.propTypes={onValueChange:N.func,children:N.node,value:N.string,helperText:N.string};eo.defaultProps={onValueChange:()=>{},children:null,value:"",helperText:""};function za({onClick:e}){const{t}=mt();return o.jsx(oc,{title:t("launchBlocklet.withoutWallet"),icon:o.jsx(ft,{icon:sc,fontSize:"1em"}),onClick:e})}za.propTypes={onClick:N.func.isRequired};function to({defaultUrl:e,onCancel:t,onSuccess:n,onError:r,mode:i,handleText:s}){const{api:a}=Nn(),{api:c,session:f}=au(),[y,l]=A.useState(!1),[u,k]=A.useState(""),{t:m,locale:S}=mt(),j={dist:{}},{encryptKey:D}=ac(),[L,M]=A.useState(e),[K,G]=A.useState(e?1:0),[T,F]=A.useState(j),[H,B]=A.useState(!1),[ce,V]=A.useState(""),[se,Pe]=A.useState({}),Be=i==="component",Ae=Be?!0:!e,{addUrlRecord:Je}=Wa(),J=A.useMemo(()=>{var ke;return(((ke=f.user)==null?void 0:ke.connectedAccounts)||[]).some(ae=>ae.provider===wt.LOGIN_PROVIDER.WALLET)},[f.user]),me=async()=>{F(j),k(null),l(!0);let Z=L.trim();!Z.startsWith("https://")&&!Z.startsWith("http://")&&!Z.startsWith("file://")&&(Z=`file://${Z}`);try{const he=decodeURIComponent(Z);try{new URL(he)}catch{throw new Error("Invalid URL")}const{meta:ke,inStore:ae,registryUrl:Lt}=await a.getBlockletMetaFromUrl({input:{url:he}});F(ke),Pe({inStore:ae,registryUrl:Lt,inputUrl:Z}),Je(Z)}catch(he){console.error(he);const ke=`Blocklet Install failed: ${ai(he)}`;k(ke),r(he)}finally{l(!1)}},ne=()=>{var he;if(Be){n({meta:T,...se}),t();return}const Z=gn(((he=window==null?void 0:window.env)==null?void 0:he.apiPrefix)??"/","/launch-blocklet/install");window.location.href=kr(Z,{blocklet_meta_url:decodeURIComponent(L.trim()),from:"url"})},je=()=>{l(!1),B(!1),n({meta:T,...se}),t()},Le=()=>{l(!1),B(!1)};A.useEffect(()=>{e&&me()},[e]);const Me=A.useMemo(()=>({title:T.title,wt:Ac(T),blockletMetaUrl:decodeURIComponent(L.trim())}),[T,L]),we=A.useCallback(async()=>{var ke;if(J)return"";const Z=new URL(window.location.href);Z.pathname=gn(((ke=window==null?void 0:window.env)==null?void 0:ke.apiPrefix)??"/","/api/did/launch-free-blocklet-by-session/token"),Z.searchParams.set("_ek_",D),Object.keys(Me).forEach(ae=>{Z.searchParams.set(ae,Me[ae])});const{data:he}=await c.get(Z.href);he.url?V(he.url):V("")},[J,Me,c,D]);A.useEffect(()=>{we()},[we]);const Ze=A.useMemo(()=>J?{...Me,nw:ce,skipMigrateAccount:!0}:Me,[Me,ce,J]),Ke=[{name:m("common.name"),value:Wt.getDisplayName({meta:T},!0)},{name:m("common.version"),value:T.version},{name:m("common.did"),value:T.did?o.jsx(lu,{did:T.did}):null},{name:m("common.author"),value:T.owner?o.jsx(Ua,{owner:T.owner,locale:S}):sa.formatPerson(T.author)},{name:m("blocklet.dist.downloadLink"),value:T.dist.tarball}],Ct=()=>y?o.jsx("div",{style:{height:200,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:o.jsx(St,{})}):T.did?o.jsx("div",{style:{paddingLeft:"10%"},children:Ke.map(Z=>Z.name===m("common.did")?o.jsx(_o,{valueComponent:"div",nameWidth:120,name:Z.name,nameFormatter:()=>m("common.did"),children:Z.value},Z.name):o.jsx(_o,{valueComponent:"div",nameWidth:120,name:Z.name,children:Z.value},Z.name))}):null,Pt=tu(async()=>{let Z=T.title;f.user&&(Z=`${f.user.fullName}'s ${T.title}`);try{je(),await a.launchBlockletWithoutWallet({input:{title:Z,blockletMetaUrl:decodeURIComponent(L.trim()),type:"store",storeUrl:se.registryUrl,onlyRequired:!0}})}catch(he){console.error("launchBlockletWithoutWallet error:",he),Tr.error(ai(he),{autoHideDuration:3e3})}}),yt=[{label:m("blocklet.fromUrl.step0"),body:o.jsx(ve,{component:"div",children:o.jsx(eo,{style:{marginBottom:32},value:L,helperText:m("blocklet.fromUrl.description"),onValueChange:Z=>{k(null),M(Z)},children:o.jsx(Er,{label:m("blocklet.fromUrl.label"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"blocklet-url-input",fullWidth:!0,autoFocus:!0,margin:"dense",value:L,onChange:Z=>{k(null),M(Z.target.value)},disabled:y,onKeyPress:Z=>{Z.key==="Enter"&&(Z.preventDefault(),me(),G(1))}})})}),cancel:m("common.cancel"),confirm:m("common.next"),onCancel:t,onConfirm:()=>{me(),G(1)}},{label:m("blocklet.fromUrl.step1"),body:Ct(),cancel:m(Ae?"common.pre":"common.cancel"),confirm:(s==null?void 0:s.confirm)||m("blocklet.fromUrl.confirm"),onCancel:()=>{Ae?G(Z=>Z-1):t()},onConfirm:()=>{ne()}}],et=yt[K];return o.jsxs(o.Fragment,{children:[o.jsxs(Ri,{title:(s==null?void 0:s.title)||m("blocklet.fromUrl.title"),fullWidth:!0,maxWidth:"md",onClose:()=>et.onCancel(),showCloseButton:K===0,disableEscapeKeyDown:!0,open:!0,actions:o.jsxs(o.Fragment,{children:[et.cancel&&o.jsx(ht,{onClick:Z=>{Z.stopPropagation(),k(null),et.onCancel()},color:"inherit",children:et.cancel||m("common.cancel")}),o.jsxs(ht,{onClick:Z=>{Z.stopPropagation(),et.onConfirm()},color:"primary","data-cy":"install-blocklet-next-step",disabled:y||!L||u,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[y&&K===0&&o.jsx(St,{size:16}),et.confirm]})]}),children:[Ae&&o.jsx(_l,{alternativeLabel:!0,activeStep:K,children:yt.map(({label:Z})=>o.jsx(Nl,{children:o.jsx(Al,{children:Z})},Z))}),o.jsx(Dl,{component:"div",style:{marginTop:24},children:et.body}),!!u&&o.jsx(Cs,{severity:"error",style:{width:"100%",marginTop:8},children:u})]}),T&&H&&o.jsx($s,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:J?"launch-free-blocklet-by-session":"bind-wallet",checkFn:c.get,checkTimeout:5*60*1e3,onSuccess:je,extraParams:Ze,messages:{title:m("setup.keyPair.title"),scan:m("setup.keyPair.scan"),confirm:m("setup.keyPair.confirm"),success:m("setup.keyPair.success")},onClose:Le,customItems:[o.jsx(za,{onClick:Pt})]})]})}to.propTypes={defaultUrl:N.string,onCancel:N.func.isRequired,onSuccess:N.func.isRequired,onError:N.func,mode:N.oneOf(["install","component"]),handleText:N.object};to.defaultProps={onError:()=>{},defaultUrl:"",mode:"install",handleText:{}};const Yh={meta:N.object.isRequired,onCancel:N.func.isRequired},Qh=ks(()=>({dialogAuth:{padding:"0 0 24px !important","& .auth-title":{textAlign:"center !important",marginBottom:"4px !important"},"& .auth-tip--scan":{textAlign:"center !important"}},iconRoot:{minWidth:48}}));function qa({action:e,onSelect:t,onNext:n}){const r=Qh(),{t:i}=mt(),s=[{action:"purchase",title:i("store.purchase.purchase.title"),description:i("store.purchase.purchase.description")},{action:"verify",title:i("store.purchase.verify.title"),description:i("store.purchase.verify.description")}];return o.jsxs(o.Fragment,{children:[o.jsx(Ml,{className:r.tabPanel,children:s.map(a=>o.jsxs(Is,{button:!0,selected:e===a.action,onClick:()=>t(a.action),children:[o.jsx(Fl,{className:r.iconRoot,children:a.action==="purchase"?o.jsx(cu,{style:{color:e==="purchase"?Oo.primary.main:"#AAA",fontSize:32}}):o.jsx(uu,{style:{color:e==="verify"?Oo.primary.main:"#AAA",fontSize:32}})}),o.jsx(Rs,{primary:a.title,secondary:a.description})]},a.action))}),n&&o.jsx(ht,{fullWidth:!0,disabled:!e,variant:"contained",color:"primary",style:{marginTop:16},onClick:n,children:i("common.next")})]})}qa.propTypes={action:N.oneOf(["both","purchase","verify"]).isRequired,onSelect:N.func.isRequired,onNext:N.func.isRequired};function no({meta:e,onCancel:t,mode:n,handlePaySuccess:r}){const{t:i,locale:s}=mt(),{info:a}=Nn(),c=Dc(a),[f,y]=A.useState(null),l=new URL(e==null?void 0:e.registryUrl).origin,u=Wt.getDisplayName({meta:e}),k=async(S,j)=>{const D=({downloadTokenList:K})=>{r({downloadTokenList:K})},L=K=>{Tr.error(K),t(K)};function M(K){return lc(()=>No.get(K).then(async({data:G})=>{const T=G==null?void 0:G.downloadTokenList;if(G.status==="succeed"){if(T&&T.length)await D({downloadTokenList:T});else return await L(i("blocklet.component.missDownloadTokenTip")),!0;return!0}return G.status==="error"?(console.error("vc error: ",G),await L(G==null?void 0:G.error),!0):!1}),{interval:1e3})}if(n==="purchase"&&f){const{statusUrl:K}=Mc(f);await M(K)}else await D({downloadTokenList:S.downloadTokenList&&j(S.downloadTokenList)})};if(A.useEffect(()=>{if(n==="purchase"){const S=new URL(l);S.pathname="/api/did/verify-purchase-blocklet/token",S.searchParams.set("serverDid",a.did),S.searchParams.set("blockletDid",e==null?void 0:e.did);try{No.get(S.href).then(({data:j})=>{const D=`${j.url}`;y(D)})}catch(j){console.error("get next workflow url error: ",j)}}return()=>{y(null)}},[n]),n==="purchase"&&!f)return"";const m={verify:{action:"verify-purchase-blocklet",checkFn:Po.create({baseURL:l}).get,extraParams:{serverDid:a.did,blockletDid:e==null?void 0:e.did},messages:{title:i("store.purchase.verify.auth.title",{name:u}),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:Po.create({baseURL:gn(l,"/store")}).get,extraParams:{factory:e.nftFactory,nw:f},messages:{title:i("store.purchase.auth.title",{name:u}),scan:i("store.purchase.auth.scan"),confirm:i("store.purchase.auth.confirm"),success:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:i("store.purchase.auth.success")}),o.jsx("p",{children:i("blocklet.component.purchaseComponentSecondCheckTip")})]})}}};return o.jsx($s,{open:!0,locale:s,popup:!1,saveConnect:!1,className:"connect",baseUrl:l,onSuccess:k,cancelWhenScanned:t,onClose:t,checkTimeout:60*5e3,webWalletUrl:c,disableClose:!0,showDownload:!1,...m[n]})}no.propTypes={...Yh,handlePaySuccess:N.func,mode:N.oneOf(["verify","purchase"]).isRequired};no.defaultProps={handlePaySuccess:()=>{}};const ro=A.forwardRef(({mode:e,...t},n)=>{const[r,i]=A.useState(e!=="both"?e:"verify"),[s,a]=A.useState(e!=="both"?2:1),c=y=>{y!==r&&i(y)},f=()=>{r&&s!==2&&a(2)};return A.useImperativeHandle(n,()=>({onNext:f,getCurrentStep:()=>s})),s===1?o.jsx("div",{style:{maxWidth:520},children:o.jsx(qa,{action:r,onNext:null,onSelect:c})}):o.jsx(no,{...t,mode:r})});ro.propTypes={mode:N.oneOf(["both","verify","purchase"]).isRequired,ref:N.any};ro.defaultProps={ref:{}};const Jh=ro;function Zh({...e}){return o.jsx(ht,{className:"bottom-button",variant:"contained",color:"primary",...e})}function io({blocklet:e,onStartNow:t,children:n,disabled:r}){const{t:i}=mt(),s=Qs();return!e||Fc(e.meta)?o.jsx(ef,{children:n}):o.jsxs(tf,{isMobile:s,children:[o.jsx(Zh,{className:"start-now",variant:"contained",color:"primary",disabled:r,onClick:()=>t(),children:i("setup.startNow")}),o.jsx(X,{display:"flex",alignItems:"center",children:n})]})}io.propTypes={blocklet:N.object,onStartNow:N.func,children:N.any,disabled:N.bool};io.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1};const ef=Xe(X)`
|
|
217
|
-
width: 100%;
|
|
218
|
-
margin-top: auto;
|
|
219
|
-
padding-top: 24px;
|
|
220
|
-
display: flex;
|
|
221
|
-
align-items: center;
|
|
222
|
-
justify-content: center;
|
|
223
|
-
.bottom-button {
|
|
224
|
-
min-width: 200px;
|
|
225
|
-
}
|
|
226
|
-
${e=>e.theme.breakpoints.down("md")} {
|
|
227
|
-
.bottom-button {
|
|
228
|
-
width: 100%;
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
`,tf=Xe(X)`
|
|
232
|
-
padding-top: 24px;
|
|
233
|
-
margin-top: auto;
|
|
234
|
-
width: 100%;
|
|
235
|
-
display: flex;
|
|
236
|
-
align-items: center;
|
|
237
|
-
justify-content: space-between;
|
|
238
|
-
.start-now {
|
|
239
|
-
min-width: 140px;
|
|
240
|
-
}
|
|
241
|
-
.bottom-button {
|
|
242
|
-
min-width: 120px;
|
|
243
|
-
}
|
|
244
|
-
${e=>e.theme.breakpoints.down("lg")} {
|
|
245
|
-
width: 100%;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
${e=>e.theme.breakpoints.down("md")} {
|
|
249
|
-
.start-now {
|
|
250
|
-
min-width: inherit;
|
|
251
|
-
}
|
|
252
|
-
.bottom-button {
|
|
253
|
-
min-width: 100px;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
${e=>e.isMobile} {
|
|
258
|
-
justify-content: space-between;
|
|
259
|
-
gap: '32px',
|
|
260
|
-
}}
|
|
261
|
-
`;function oo({blockletMeta:e,onEndpointUpdate:t}){var c;const n=Qs(),{blocklet:r}=Or(),{updateSpaceGateway:i,loading:s,hasStorageEndpoint:a}=qc();return A.useEffect(()=>{t==null||t()},[r]),s?o.jsx(cc,{relative:"parent",children:o.jsx(St,{})}):o.jsxs(nf,{children:[o.jsx(X,{width:n?"360px":"720px",children:a?o.jsx(pu,{}):o.jsx(mu,{})}),((c=e==null?void 0:e.capabilities)==null?void 0:c.didSpace)==="required"&&o.jsx(io,{mt:8,children:o.jsx(gu,{onConnect:i})})]})}oo.propTypes={blockletMeta:N.any.isRequired,onEndpointUpdate:Bl.func};oo.defaultProps={onEndpointUpdate:()=>{}};const nf=Xe(fu)`
|
|
262
|
-
height: 100%;
|
|
263
|
-
overflow-y: auto;
|
|
264
|
-
padding-bottom: 32px;
|
|
265
|
-
overflow-x: hidden;
|
|
266
|
-
`;function so({onChange:e,loading:t,children:n,extra:r,stores:i,storageKey:s}){const{t:a}=mt(),{info:c,inService:f}=Nn(),{blocklet:y}=Or(),[l,u]=A.useState(!1),k=A.useRef(null),[m,S]=A.useState(),[j,D]=Ys(s||"tmp"),[L,M]=s?[j,D]:[m,S],{storeList:K,teamDid:G}=Hs({fromBlocklet:f,blocklet:y,nodeInfo:c}),T=Gs([...i.map(H=>({...H,protected:!0})),...K],"url"),F=L&&T.find(H=>L===H.url)||T[0];return o.jsxs(o.Fragment,{children:[o.jsxs(rf,{children:[o.jsx(ht,{ref:k,color:"primary","data-cy":"add-component-select-store",endIcon:o.jsx(vu,{color:"primary"}),onClick:()=>{u(!0)},style:{padding:"0 2px"},children:o.jsx(ve,{color:"primary",children:F.name})}),o.jsx(ve,{color:"primary",children:r})]}),o.jsxs(Er,{id:"mui-registry-select",select:!0,autoComplete:"off",variant:"outlined",name:"did",helperText:a("blocklet.component.selectRegistryTip"),"data-cy":"component-registry-select",fullWidth:!0,value:F,autoFocus:!0,onChange:H=>{const B=H.target.value;M(B.url),e(B)},SelectProps:{open:l,MenuProps:{anchorEl:k.current},renderValue:H=>H==null?void 0:H.name,onClose:()=>{u(!1)}},style:{display:"none"},margin:"normal",children:[T==null?void 0:T.map(H=>o.jsx(ki,{sx:{width:"400px",maxWidth:"90vw"},value:H,"data-cy":H.url,children:o.jsx(Zl,{teamDid:G,store:H,onDelete:()=>{var B;L===H.url&&M((B=T[0])==null?void 0:B.url)}})},H.url)),!Ms.isInServerlessMode(c)&&o.jsx(ec,{disabled:t,storeList:T,teamDid:G,onAdd:H=>{M(H)}})]}),n({currentRegistry:F})]})}so.propTypes={onChange:N.func,loading:N.bool,children:N.any.isRequired,extra:N.node,storageKey:N.string,stores:N.arrayOf(N.shape({name:N.string.isRequired,url:N.string.isRequired}))};so.defaultProps={onChange:()=>{},loading:!1,extra:"",stores:[],storageKey:""};const rf=Xe.div`
|
|
267
|
-
display: flex;
|
|
268
|
-
justify-content: space-between;
|
|
269
|
-
align-items: center;
|
|
270
|
-
margin-bottom: 16px;
|
|
271
|
-
|
|
272
|
-
span {
|
|
273
|
-
font-size: 16px;
|
|
274
|
-
color: ${e=>e.theme.palette.text.primary};
|
|
275
|
-
// font-weight: bold;
|
|
276
|
-
}
|
|
277
|
-
`,of=Jt("div")`
|
|
278
|
-
background-color: transparent !important;
|
|
279
|
-
& > :not(.Mui-disabled) {
|
|
280
|
-
position: relative;
|
|
281
|
-
z-index: 1;
|
|
282
|
-
&::before {
|
|
283
|
-
content: '';
|
|
284
|
-
position: absolute;
|
|
285
|
-
height: 100%;
|
|
286
|
-
width: 100%;
|
|
287
|
-
left: 0;
|
|
288
|
-
top: 0;
|
|
289
|
-
transition: opacity 0.3s;
|
|
290
|
-
}
|
|
291
|
-
&:hover::before {
|
|
292
|
-
opacity: 0;
|
|
293
|
-
}
|
|
294
|
-
&::after {
|
|
295
|
-
content: '';
|
|
296
|
-
position: absolute;
|
|
297
|
-
height: 100%;
|
|
298
|
-
width: 100%;
|
|
299
|
-
top: 0;
|
|
300
|
-
left: 0;
|
|
301
|
-
border-radius: 2px;
|
|
302
|
-
background-color: ${e=>e.theme.palette.primary.main};
|
|
303
|
-
transform: scale(0.1);
|
|
304
|
-
opacity: 0;
|
|
305
|
-
z-index: -1;
|
|
306
|
-
transition:
|
|
307
|
-
transform 0.3s,
|
|
308
|
-
opacity 0.3s,
|
|
309
|
-
background-color 0.3s;
|
|
310
|
-
}
|
|
311
|
-
&:hover::after {
|
|
312
|
-
opacity: 1;
|
|
313
|
-
transform-origin: center;
|
|
314
|
-
transform: scale(1);
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
& > :not(.Mui-disabled) {
|
|
318
|
-
background-color: transparent !important;
|
|
319
|
-
color: ${e=>e.theme.palette.primary.main}!important;
|
|
320
|
-
}
|
|
321
|
-
& > :not(.Mui-disabled) {
|
|
322
|
-
&:hover {
|
|
323
|
-
color: ${e=>e.theme.palette.common.white}!important;
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
`;Jt("div")`
|
|
327
|
-
&.arcblock-blocklet {
|
|
328
|
-
padding: ${e=>e.theme.spacing(2)} ${e=>e.theme.spacing(2)} 0
|
|
329
|
-
${e=>e.theme.spacing(2)};
|
|
330
|
-
}
|
|
331
|
-
.arcblock-blocklet__content {
|
|
332
|
-
cursor: pointer;
|
|
333
|
-
display: flex;
|
|
334
|
-
${e=>e.theme.breakpoints.up("sm")} {
|
|
335
|
-
align-items: center;
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
.arcblock-blocklet__cover {
|
|
339
|
-
width: 64px;
|
|
340
|
-
height: 64px;
|
|
341
|
-
margin-right: ${e=>e.theme.spacing(2)};
|
|
342
|
-
overflow: hidden;
|
|
343
|
-
border-radius: 12px;
|
|
344
|
-
/* see: https://stackoverflow.com/questions/49066011/overflow-hidden-with-border-radius-not-working-on-safari */
|
|
345
|
-
transform: translateZ(0);
|
|
346
|
-
${e=>e.theme.breakpoints.up("sm")} {
|
|
347
|
-
width: 80px;
|
|
348
|
-
height: 80px;
|
|
349
|
-
margin-bottom: 12px;
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
.arcblock-blocklet__button--hover {
|
|
353
|
-
&:not(.Mui-disabled) {
|
|
354
|
-
position: relative;
|
|
355
|
-
z-index: 1;
|
|
356
|
-
&::before {
|
|
357
|
-
content: '';
|
|
358
|
-
position: absolute;
|
|
359
|
-
height: 100%;
|
|
360
|
-
width: 100%;
|
|
361
|
-
left: 0;
|
|
362
|
-
top: 0;
|
|
363
|
-
transition: opacity 0.3s;
|
|
364
|
-
}
|
|
365
|
-
&:hover::before {
|
|
366
|
-
opacity: 0;
|
|
367
|
-
}
|
|
368
|
-
&::after {
|
|
369
|
-
content: '';
|
|
370
|
-
position: absolute;
|
|
371
|
-
height: 100%;
|
|
372
|
-
width: 100%;
|
|
373
|
-
background-color: ${e=>e.theme.palette.primary.main};
|
|
374
|
-
transform: scale(0.1);
|
|
375
|
-
opacity: 0;
|
|
376
|
-
z-index: -1;
|
|
377
|
-
transition:
|
|
378
|
-
transform 0.3s,
|
|
379
|
-
opacity 0.3s,
|
|
380
|
-
background-color 0.3s;
|
|
381
|
-
}
|
|
382
|
-
&:hover::after {
|
|
383
|
-
opacity: 1;
|
|
384
|
-
transform-origin: center;
|
|
385
|
-
transform: scale(1);
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
&:not(.Mui-disabled) {
|
|
390
|
-
background-color: transparent !important;
|
|
391
|
-
color: ${e=>e.theme.palette.primary.main};
|
|
392
|
-
}
|
|
393
|
-
&:not(.Mui-disabled) {
|
|
394
|
-
&:hover {
|
|
395
|
-
color: ${e=>e.theme.palette.common.white};
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
.arcblock-blocklet__info {
|
|
400
|
-
flex: 1;
|
|
401
|
-
overflow: hidden;
|
|
402
|
-
border-bottom: 1px solid ${e=>e.theme.palette.divider};
|
|
403
|
-
padding-bottom: ${e=>e.theme.spacing(2)};
|
|
404
|
-
}
|
|
405
|
-
.arcblock-blocklet__text {
|
|
406
|
-
height: 65px;
|
|
407
|
-
overflow: hidden;
|
|
408
|
-
}
|
|
409
|
-
/* 设置多行文本溢出显示省略号 兼容fireFox、safari */
|
|
410
|
-
.arcblock-blocklet__title {
|
|
411
|
-
margin: 0;
|
|
412
|
-
font-size: 16px;
|
|
413
|
-
font-weight: 500;
|
|
414
|
-
overflow: hidden;
|
|
415
|
-
text-overflow: ellipsis;
|
|
416
|
-
white-space: nowrap;
|
|
417
|
-
}
|
|
418
|
-
.arcblock-blocklet__describe {
|
|
419
|
-
margin-top: ${e=>e.theme.spacing(.5)};
|
|
420
|
-
color: ${e=>e.theme.palette.grey[600]};
|
|
421
|
-
font-size: 14px;
|
|
422
|
-
font-weight: 500;
|
|
423
|
-
line-height: 17px;
|
|
424
|
-
max-height: 34px;
|
|
425
|
-
overflow: hidden;
|
|
426
|
-
text-overflow: ellipsis;
|
|
427
|
-
display: -webkit-box;
|
|
428
|
-
-webkit-line-clamp: 2;
|
|
429
|
-
-webkit-box-orient: vertical;
|
|
430
|
-
word-break: break-word;
|
|
431
|
-
}
|
|
432
|
-
.arcblock-blocklet__version {
|
|
433
|
-
color: ${e=>e.theme.palette.grey[600]};
|
|
434
|
-
font-size: 12px;
|
|
435
|
-
}
|
|
436
|
-
`;N.string||N.node,N.string,N.string||N.node,N.string,N.string,N.bool,N.bool,N.element,N.string,N.func,N.func,N.string;Jt("div")`
|
|
437
|
-
background-color: transparent !important;
|
|
438
|
-
& > :not(.Mui-disabled) {
|
|
439
|
-
position: relative;
|
|
440
|
-
z-index: 1;
|
|
441
|
-
&::before {
|
|
442
|
-
content: '';
|
|
443
|
-
position: absolute;
|
|
444
|
-
height: 100%;
|
|
445
|
-
width: 100%;
|
|
446
|
-
left: 0;
|
|
447
|
-
top: 0;
|
|
448
|
-
transition: opacity 0.3s;
|
|
449
|
-
}
|
|
450
|
-
&:hover::before {
|
|
451
|
-
opacity: 0;
|
|
452
|
-
}
|
|
453
|
-
&::after {
|
|
454
|
-
content: '';
|
|
455
|
-
position: absolute;
|
|
456
|
-
height: 100%;
|
|
457
|
-
width: 100%;
|
|
458
|
-
top: 0;
|
|
459
|
-
left: 0;
|
|
460
|
-
border-radius: 2px;
|
|
461
|
-
background-color: ${e=>e.theme.palette.primary.main};
|
|
462
|
-
transform: scale(0.1);
|
|
463
|
-
opacity: 0;
|
|
464
|
-
z-index: -1;
|
|
465
|
-
transition:
|
|
466
|
-
transform 0.3s,
|
|
467
|
-
opacity 0.3s,
|
|
468
|
-
background-color 0.3s;
|
|
469
|
-
}
|
|
470
|
-
&:hover::after {
|
|
471
|
-
opacity: 1;
|
|
472
|
-
transform-origin: center;
|
|
473
|
-
transform: scale(1);
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
& > :not(.Mui-disabled) {
|
|
477
|
-
background-color: transparent !important;
|
|
478
|
-
color: ${e=>e.theme.palette.primary.main}!important;
|
|
479
|
-
}
|
|
480
|
-
& > :not(.Mui-disabled) {
|
|
481
|
-
&:hover {
|
|
482
|
-
color: ${e=>e.theme.palette.common.white}!important;
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
`;const ts=(e="")=>e.replace(/(<([^>]+)>)/gi,"").trim(),sf=(e="")=>{const t=parseInt(e,10);return Number.isNaN(t)?e:t<1e3?t:t<1e6?`${(t/1e3).toFixed(1)}k`:t<1e9?`${(t/1e6).toFixed(1)}m`:`${(t/1e9).toFixed(1)}b`},Ka={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 18a3.5 3.5 0 0 0 0-7h-1A5 4.5 0 0 0 7 9a4.6 4.4 0 0 0-2.1 8.4M12 13v9m-3-3l3 3l3-3"/>'};function hi({title:e,sx:t,children:n,slotProps:r,fontSize:i=12,fontWeight:s=500,color:a="text.contrast",...c}){var f,y;return e?o.jsx(Ps,{title:e,placement:"top",...c,slotProps:{popper:{...r==null?void 0:r.popper,sx:[{[`& .${$l.tooltip}`]:{fontSize:i,fontWeight:s,boxShadow:2,marginBottom:"6px !important",borderRadius:"8px",cursor:"default",color:a,display:"flex",alignItems:"center"}},...Array.isArray((f=r==null?void 0:r.popper)==null?void 0:f.sx)?r.popper.sx:[(y=r==null?void 0:r.popper)==null?void 0:y.sx]]}},children:n}):n}function cr({icon:e,children:t,maxWidth:n=100,title:r,sx:i}){return(t===0||t)&&o.jsxs(it,{direction:"row",alignItems:"center",gap:.5,sx:[{maxWidth:n,overflow:"hidden"},...Array.isArray(i)?i:[i]],children:[e,o.jsx(hi,{title:r||(typeof t=="string"?t:""),children:o.jsx(ve,{flex:1,variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"default"},children:t})})]})}function af(e){const{title:t,description:n="",cover:r="",avatar:i,author:s,download:a,did:c,official:f,buttonText:y="Install",buttonDisabled:l,buttonLoading:u,button:k,onButtonClick:m=()=>{},onMainClick:S,className:j,ref:D,icons:L,status:M,...K}=e,G=Qt(),T=(V,se=()=>!1)=>(Pe,...Be)=>{const Ae=V instanceof Function;(se()||Ae)&&(Pe.preventDefault(),Pe.stopPropagation(),Ae&&V(...Be))},F=S&&T(S),H=T(m,()=>!!(k||l||u)),B=A.isValidElement(t)?{children:t}:{title:ts(t),dangerouslySetInnerHTML:{__html:t}},ce=A.isValidElement(n)?{children:n}:{title:ts(n),dangerouslySetInnerHTML:{__html:n}};return o.jsxs(Ul,{variant:"outlined",onClick:F,...K,sx:{p:{xs:2,md:3},borderRadius:1,...K.sx},children:[o.jsxs(it,{flex:1,direction:"row",gap:1,alignItems:"center",overflow:"hidden",sx:{"& > *":{flexShrink:0}},children:[o.jsx(yr,{src:r,did:c,size:48,variant:"rounded",style:{borderRadius:"8px",overflow:"hidden"}}),o.jsx(ve,{className:"blocklet-title",fontWeight:"fontWeightMedium",sx:{fontSize:16,textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",cursor:"default",pl:.5,"&&":{flexShrink:1}},...B}),o.jsxs(X,{flex:1,display:"flex",alignItems:"center",justifyContent:"flex-start",gap:1,children:[f&&o.jsx(hi,{title:f.tooltip,children:o.jsx(mc,{sx:{color:f.color||"#D97706",fontSize:f.size||18}})}),L==null?void 0:L.map(V=>o.jsx(hi,{title:V.title,children:typeof V.icon=="string"?o.jsx(ft,{icon:V.icon,style:{color:V.color}}):V.icon},V.key))]}),m&&o.jsxs(ht,{variant:"outlined",size:"small",disabled:l||u,style:{color:G.palette.text.primary,borderColor:G.palette.grey[300],borderRadius:8,fontSize:13,fontWeight:G.typography.fontWeightMedium},onClick:H,children:[u&&o.jsx(St,{size:15,style:{marginRight:3,color:"inherit"}}),y]}),k]}),o.jsx(it,{py:2,children:o.jsx(ve,{className:"blocklet-description",variant:"body2",color:"text.secondary",sx:{display:"-webkit-box",lineClamp:2,WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",cursor:"default",height:40},...ce})}),o.jsxs(it,{direction:"row",alignItems:"center",gap:2,color:"text.secondary",children:[o.jsx(cr,{icon:o.jsx(yr,{src:i,did:c,size:20,variant:"circle"}),maxWidth:200,children:s}),o.jsx(cr,{icon:o.jsx(ft,{icon:Ka}),title:a,children:sf(a)}),M==null?void 0:M.filter(V=>V.align!=="right").map(V=>o.jsx(cr,{icon:typeof V.icon=="string"?o.jsx(ft,{icon:V.icon}):V.icon,title:V.title,maxWidth:V.maxWidth,children:V.text},V.key)),o.jsx(X,{sx:{flex:1}}),M==null?void 0:M.filter(V=>V.align==="right").map(V=>o.jsx(cr,{icon:typeof V.icon=="string"?o.jsx(ft,{icon:V.icon}):V.icon,title:V.title,maxWidth:V.maxWidth,sx:{color:V.color},children:V.text},V.key))]})]})}const lf={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m8 16l2-6l6-2l-2 6l-6 2"/><path d="M3 12a9 9 0 1 0 18 0a9 9 0 1 0-18 0m9-9v2m0 14v2m-9-9h2m14 0h2"/></g>'},Jn=/^[a-z0-9]+(-[a-z0-9]+)*$/,_r=(e,t,n,r="")=>{const i=e.split(":");if(e.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const c=i.pop(),f=i.pop(),y={provider:i.length>0?i[0]:r,prefix:f,name:c};return t&&!gr(y)?null:y}const s=i[0],a=s.split("-");if(a.length>1){const c={provider:r,prefix:a.shift(),name:a.join("-")};return t&&!gr(c)?null:c}if(n&&r===""){const c={provider:r,prefix:"",name:s};return t&&!gr(c,n)?null:c}return null},gr=(e,t)=>e?!!((e.provider===""||e.provider.match(Jn))&&(t&&e.prefix===""||e.prefix.match(Jn))&&e.name.match(Jn)):!1,Ga=Object.freeze({left:0,top:0,width:16,height:16}),xr=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),ao=Object.freeze({...Ga,...xr}),fi=Object.freeze({...ao,body:"",hidden:!1});function cf(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function ns(e,t){const n=cf(e,t);for(const r in fi)r in xr?r in e&&!(r in n)&&(n[r]=xr[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function uf(e,t){const n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function s(a){if(n[a])return i[a]=[];if(!(a in i)){i[a]=null;const c=r[a]&&r[a].parent,f=c&&s(c);f&&(i[a]=[c].concat(f))}return i[a]}return Object.keys(n).concat(Object.keys(r)).forEach(s),i}function df(e,t,n){const r=e.icons,i=e.aliases||Object.create(null);let s={};function a(c){s=ns(r[c]||i[c],s)}return a(t),n.forEach(a),ns(e,s)}function Ha(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(i=>{t(i,null),n.push(i)});const r=uf(e);for(const i in r){const s=r[i];s&&(t(i,df(e,i,s)),n.push(i))}return n}const hf={provider:"",aliases:{},not_found:{},...Ga};function Gr(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function Va(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!Gr(e,hf))return null;const n=t.icons;for(const i in n){const s=n[i];if(!i.match(Jn)||typeof s.body!="string"||!Gr(s,fi))return null}const r=t.aliases||Object.create(null);for(const i in r){const s=r[i],a=s.parent;if(!i.match(Jn)||typeof a!="string"||!n[a]&&!r[a]||!Gr(s,fi))return null}return t}const rs=Object.create(null);function ff(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function xn(e,t){const n=rs[e]||(rs[e]=Object.create(null));return n[t]||(n[t]=ff(e,t))}function lo(e,t){return Va(t)?Ha(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function pf(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}let tr=!1;function Xa(e){return typeof e=="boolean"&&(tr=e),tr}function mf(e){const t=typeof e=="string"?_r(e,!0,tr):e;if(t){const n=xn(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function gf(e,t){const n=_r(e,!0,tr);if(!n)return!1;const r=xn(n.provider,n.prefix);return pf(r,n.name,t)}function vf(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),tr&&!t&&!e.prefix){let i=!1;return Va(e)&&(e.prefix="",Ha(e,(s,a)=>{a&&gf(s,a)&&(i=!0)})),i}const n=e.prefix;if(!gr({provider:t,prefix:n,name:"a"}))return!1;const r=xn(t,n);return!!lo(r,e)}const Ya=Object.freeze({width:null,height:null}),Qa=Object.freeze({...Ya,...xr}),yf=/(-?[0-9.]*[0-9]+[0-9.]*)/g,bf=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function is(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(yf);if(r===null||!r.length)return e;const i=[];let s=r.shift(),a=bf.test(s);for(;;){if(a){const c=parseFloat(s);isNaN(c)?i.push(s):i.push(Math.ceil(c*t*n)/n)}else i.push(s);if(s=r.shift(),s===void 0)return i.join("");a=!a}}const xf=e=>e==="unset"||e==="undefined"||e==="none";function wf(e,t){const n={...ao,...e},r={...Qa,...t},i={left:n.left,top:n.top,width:n.width,height:n.height};let s=n.body;[n,r].forEach(S=>{const j=[],D=S.hFlip,L=S.vFlip;let M=S.rotate;D?L?M+=2:(j.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),j.push("scale(-1 1)"),i.top=i.left=0):L&&(j.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),j.push("scale(1 -1)"),i.top=i.left=0);let K;switch(M<0&&(M-=Math.floor(M/4)*4),M=M%4,M){case 1:K=i.height/2+i.top,j.unshift("rotate(90 "+K.toString()+" "+K.toString()+")");break;case 2:j.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:K=i.width/2+i.left,j.unshift("rotate(-90 "+K.toString()+" "+K.toString()+")");break}M%2===1&&(i.left!==i.top&&(K=i.left,i.left=i.top,i.top=K),i.width!==i.height&&(K=i.width,i.width=i.height,i.height=K)),j.length&&(s='<g transform="'+j.join(" ")+'">'+s+"</g>")});const a=r.width,c=r.height,f=i.width,y=i.height;let l,u;a===null?(u=c===null?"1em":c==="auto"?y:c,l=is(u,f/y)):(l=a==="auto"?f:a,u=c===null?is(l,y/f):c==="auto"?y:c);const k={},m=(S,j)=>{xf(j)||(k[S]=j.toString())};return m("width",l),m("height",u),k.viewBox=i.left.toString()+" "+i.top.toString()+" "+f.toString()+" "+y.toString(),{attributes:k,body:s}}const Ef=/\sid="(\S+)"/g,Sf="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let Tf=0;function jf(e,t=Sf){const n=[];let r;for(;r=Ef.exec(e);)n.push(r[1]);if(!n.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(s=>{const a=typeof t=="function"?t(s):t+(Tf++).toString(),c=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+c+')([")]|\\.[a-z])',"g"),"$1"+a+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}const pi=Object.create(null);function kf(e,t){pi[e]=t}function mi(e){return pi[e]||pi[""]}function co(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const uo=Object.create(null),Vn=["https://api.simplesvg.com","https://api.unisvg.com"],vr=[];for(;Vn.length>0;)Vn.length===1||Math.random()>.5?vr.push(Vn.shift()):vr.push(Vn.pop());uo[""]=co({resources:["https://api.iconify.design"].concat(vr)});function Of(e,t){const n=co(t);return n===null?!1:(uo[e]=n,!0)}function ho(e){return uo[e]}const If=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let os=If();function Rf(e,t){const n=ho(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let i=0;n.resources.forEach(a=>{i=Math.max(i,a.length)});const s=t+".json?icons=";r=n.maxURL-i-n.path.length-s.length}return r}function Cf(e){return e===404}const Pf=(e,t,n)=>{const r=[],i=Rf(e,t),s="icons";let a={type:s,provider:e,prefix:t,icons:[]},c=0;return n.forEach((f,y)=>{c+=f.length+1,c>=i&&y>0&&(r.push(a),a={type:s,provider:e,prefix:t,icons:[]},c=f.length),a.icons.push(f)}),r.push(a),r};function Lf(e){if(typeof e=="string"){const t=ho(e);if(t)return t.path}return"/"}const _f=(e,t,n)=>{if(!os){n("abort",424);return}let r=Lf(t.provider);switch(t.type){case"icons":{const s=t.prefix,c=t.icons.join(","),f=new URLSearchParams({icons:c});r+=s+".json?"+f.toString();break}case"custom":{const s=t.uri;r+=s.slice(0,1)==="/"?s.slice(1):s;break}default:n("abort",400);return}let i=503;os(e+r).then(s=>{const a=s.status;if(a!==200){setTimeout(()=>{n(Cf(a)?"abort":"next",a)});return}return i=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?n("abort",s):n("next",i)});return}setTimeout(()=>{n("success",s)})}).catch(()=>{n("next",i)})},Nf={prepare:Pf,send:_f};function Af(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((i,s)=>i.provider!==s.provider?i.provider.localeCompare(s.provider):i.prefix!==s.prefix?i.prefix.localeCompare(s.prefix):i.name.localeCompare(s.name));let r={provider:"",prefix:"",name:""};return e.forEach(i=>{if(r.name===i.name&&r.prefix===i.prefix&&r.provider===i.provider)return;r=i;const s=i.provider,a=i.prefix,c=i.name,f=n[s]||(n[s]=Object.create(null)),y=f[a]||(f[a]=xn(s,a));let l;c in y.icons?l=t.loaded:a===""||y.missing.has(c)?l=t.missing:l=t.pending;const u={provider:s,prefix:a,name:c};l.push(u)}),t}function Ja(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(i=>i.id!==t))})}function Df(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const r=e.provider,i=e.prefix;t.forEach(s=>{const a=s.icons,c=a.pending.length;a.pending=a.pending.filter(f=>{if(f.prefix!==i)return!0;const y=f.name;if(e.icons[y])a.loaded.push({provider:r,prefix:i,name:y});else if(e.missing.has(y))a.missing.push({provider:r,prefix:i,name:y});else return n=!0,!0;return!1}),a.pending.length!==c&&(n||Ja([e],s.id),s.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),s.abort))})}))}let Mf=0;function Ff(e,t,n){const r=Mf++,i=Ja.bind(null,n,r);if(!t.pending.length)return i;const s={id:r,icons:t,callback:e,abort:i};return n.forEach(a=>{(a.loaderCallbacks||(a.loaderCallbacks=[])).push(s)}),i}function Bf(e,t=!0,n=!1){const r=[];return e.forEach(i=>{const s=typeof i=="string"?_r(i,t,n):i;s&&r.push(s)}),r}var $f={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Uf(e,t,n,r){const i=e.resources.length,s=e.random?Math.floor(Math.random()*i):e.index;let a;if(e.random){let F=e.resources.slice(0);for(a=[];F.length>1;){const H=Math.floor(Math.random()*F.length);a.push(F[H]),F=F.slice(0,H).concat(F.slice(H+1))}a=a.concat(F)}else a=e.resources.slice(s).concat(e.resources.slice(0,s));const c=Date.now();let f="pending",y=0,l,u=null,k=[],m=[];typeof r=="function"&&m.push(r);function S(){u&&(clearTimeout(u),u=null)}function j(){f==="pending"&&(f="aborted"),S(),k.forEach(F=>{F.status==="pending"&&(F.status="aborted")}),k=[]}function D(F,H){H&&(m=[]),typeof F=="function"&&m.push(F)}function L(){return{startTime:c,payload:t,status:f,queriesSent:y,queriesPending:k.length,subscribe:D,abort:j}}function M(){f="failed",m.forEach(F=>{F(void 0,l)})}function K(){k.forEach(F=>{F.status==="pending"&&(F.status="aborted")}),k=[]}function G(F,H,B){const ce=H!=="success";switch(k=k.filter(V=>V!==F),f){case"pending":break;case"failed":if(ce||!e.dataAfterTimeout)return;break;default:return}if(H==="abort"){l=B,M();return}if(ce){l=B,k.length||(a.length?T():M());return}if(S(),K(),!e.random){const V=e.resources.indexOf(F.resource);V!==-1&&V!==e.index&&(e.index=V)}f="completed",m.forEach(V=>{V(B)})}function T(){if(f!=="pending")return;S();const F=a.shift();if(F===void 0){if(k.length){u=setTimeout(()=>{S(),f==="pending"&&(K(),M())},e.timeout);return}M();return}const H={status:"pending",resource:F,callback:(B,ce)=>{G(H,B,ce)}};k.push(H),y++,u=setTimeout(T,e.rotate),n(F,t,H.callback)}return setTimeout(T),L}function Za(e){const t={...$f,...e};let n=[];function r(){n=n.filter(c=>c().status==="pending")}function i(c,f,y){const l=Uf(t,c,f,(u,k)=>{r(),y&&y(u,k)});return n.push(l),l}function s(c){return n.find(f=>c(f))||null}return{query:i,find:s,setIndex:c=>{t.index=c},getIndex:()=>t.index,cleanup:r}}function ss(){}const Hr=Object.create(null);function Wf(e){if(!Hr[e]){const t=ho(e);if(!t)return;const n=Za(t),r={config:t,redundancy:n};Hr[e]=r}return Hr[e]}function zf(e,t,n){let r,i;if(typeof e=="string"){const s=mi(e);if(!s)return n(void 0,424),ss;i=s.send;const a=Wf(e);a&&(r=a.redundancy)}else{const s=co(e);if(s){r=Za(s);const a=e.resources?e.resources[0]:"",c=mi(a);c&&(i=c.send)}}return!r||!i?(n(void 0,424),ss):r.query(t,i,n)().abort}const as="iconify2",nr="iconify",el=nr+"-count",ls=nr+"-version",tl=36e5,qf=168;function gi(e,t){try{return e.getItem(t)}catch{}}function fo(e,t,n){try{return e.setItem(t,n),!0}catch{}}function cs(e,t){try{e.removeItem(t)}catch{}}function vi(e,t){return fo(e,el,t.toString())}function yi(e){return parseInt(gi(e,el))||0}const Nr={local:!0,session:!0},nl={local:new Set,session:new Set};let po=!1;function Kf(e){po=e}let ur=typeof window>"u"?{}:window;function rl(e){const t=e+"Storage";try{if(ur&&ur[t]&&typeof ur[t].length=="number")return ur[t]}catch{}Nr[e]=!1}function il(e,t){const n=rl(e);if(!n)return;const r=gi(n,ls);if(r!==as){if(r){const c=yi(n);for(let f=0;f<c;f++)cs(n,nr+f.toString())}fo(n,ls,as),vi(n,0);return}const i=Math.floor(Date.now()/tl)-qf,s=c=>{const f=nr+c.toString(),y=gi(n,f);if(typeof y=="string"){try{const l=JSON.parse(y);if(typeof l=="object"&&typeof l.cached=="number"&&l.cached>i&&typeof l.provider=="string"&&typeof l.data=="object"&&typeof l.data.prefix=="string"&&t(l,c))return!0}catch{}cs(n,f)}};let a=yi(n);for(let c=a-1;c>=0;c--)s(c)||(c===a-1?(a--,vi(n,a)):nl[e].add(c))}function ol(){if(!po){Kf(!0);for(const e in Nr)il(e,t=>{const n=t.data,r=t.provider,i=n.prefix,s=xn(r,i);if(!lo(s,n).length)return!1;const a=n.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,a):a,!0})}}function Gf(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const r in Nr)il(r,i=>{const s=i.data;return i.provider!==e.provider||s.prefix!==e.prefix||s.lastModified===t});return!0}function Hf(e,t){po||ol();function n(r){let i;if(!Nr[r]||!(i=rl(r)))return;const s=nl[r];let a;if(s.size)s.delete(a=Array.from(s).shift());else if(a=yi(i),!vi(i,a+1))return;const c={cached:Math.floor(Date.now()/tl),provider:e.provider,data:t};return fo(i,nr+a.toString(),JSON.stringify(c))}t.lastModified&&!Gf(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function us(){}function Vf(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Df(e)}))}function Xf(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:r}=e,i=e.iconsToLoad;delete e.iconsToLoad;let s;if(!i||!(s=mi(n)))return;s.prepare(n,r,i).forEach(c=>{zf(n,c,f=>{if(typeof f!="object")c.icons.forEach(y=>{e.missing.add(y)});else try{const y=lo(e,f);if(!y.length)return;const l=e.pendingIcons;l&&y.forEach(u=>{l.delete(u)}),Hf(e,f)}catch(y){console.error(y)}Vf(e)})})}))}const Yf=(e,t)=>{const n=Bf(e,!0,Xa()),r=Af(n);if(!r.pending.length){let f=!0;return t&&setTimeout(()=>{f&&t(r.loaded,r.missing,r.pending,us)}),()=>{f=!1}}const i=Object.create(null),s=[];let a,c;return r.pending.forEach(f=>{const{provider:y,prefix:l}=f;if(l===c&&y===a)return;a=y,c=l,s.push(xn(y,l));const u=i[y]||(i[y]=Object.create(null));u[l]||(u[l]=[])}),r.pending.forEach(f=>{const{provider:y,prefix:l,name:u}=f,k=xn(y,l),m=k.pendingIcons||(k.pendingIcons=new Set);m.has(u)||(m.add(u),i[y][l].push(u))}),s.forEach(f=>{const{provider:y,prefix:l}=f;i[y][l].length&&Xf(f,i[y][l])}),t?Ff(t,r,s):us};function Qf(e,t){const n={...e};for(const r in t){const i=t[r],s=typeof i;r in Ya?(i===null||i&&(s==="string"||s==="number"))&&(n[r]=i):s===typeof n[r]&&(n[r]=r==="rotate"?i%4:i)}return n}const Jf=/[\s,]+/;function Zf(e,t){t.split(Jf).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function ep(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(i){for(;i<0;)i+=4;return i%4}if(n===""){const i=parseInt(e);return isNaN(i)?0:r(i)}else if(n!==e){let i=0;switch(n){case"%":i=25;break;case"deg":i=90}if(i){let s=parseFloat(e.slice(0,e.length-n.length));return isNaN(s)?0:(s=s/i,s%1===0?r(s):0)}}return t}function tp(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}function np(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function rp(e){return"data:image/svg+xml,"+np(e)}function ip(e){return'url("'+rp(e)+'")'}let Zn;function op(){try{Zn=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{Zn=null}}function sp(e){return Zn===void 0&&op(),Zn?Zn.createHTML(e):e}const sl={...Qa,inline:!1},ap={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},lp={display:"inline-block"},bi={backgroundColor:"currentColor"},al={backgroundColor:"transparent"},ds={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},hs={WebkitMask:bi,mask:bi,background:al};for(const e in hs){const t=hs[e];for(const n in ds)t[e+n]=ds[n]}const cp={...sl,inline:!0};function fs(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const up=(e,t,n,r)=>{const i=n?cp:sl,s=Qf(i,t),a=t.mode||"svg",c={},f=t.style||{},y={...a==="svg"?ap:{},ref:r};for(let L in t){const M=t[L];if(M!==void 0)switch(L){case"icon":case"style":case"children":case"onLoad":case"mode":case"_ref":case"_inline":break;case"inline":case"hFlip":case"vFlip":s[L]=M===!0||M==="true"||M===1;break;case"flip":typeof M=="string"&&Zf(s,M);break;case"color":c.color=M;break;case"rotate":typeof M=="string"?s[L]=ep(M):typeof M=="number"&&(s[L]=M);break;case"ariaHidden":case"aria-hidden":M!==!0&&M!=="true"&&delete y["aria-hidden"];break;default:i[L]===void 0&&(y[L]=M)}}const l=wf(e,s),u=l.attributes;if(s.inline&&(c.verticalAlign="-0.125em"),a==="svg"){y.style={...c,...f},Object.assign(y,u);let L=0,M=t.id;return typeof M=="string"&&(M=M.replace(/-/g,"_")),y.dangerouslySetInnerHTML={__html:sp(jf(l.body,M?()=>M+"ID"+L++:"iconifyReact"))},zt.createElement("svg",y)}const{body:k,width:m,height:S}=e,j=a==="mask"||(a==="bg"?!1:k.indexOf("currentColor")!==-1),D=tp(k,{...u,width:m+"",height:S+""});return y.style={...c,"--svg":ip(D),width:fs(u.width),height:fs(u.height),...lp,...j?bi:al,...f},zt.createElement("span",y)};Xa(!0);kf("",Nf);if(typeof document<"u"&&typeof window<"u"){ol();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!vf(r))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let n in t){const r="IconifyProviders["+n+"] is invalid.";try{const i=t[n];if(typeof i!="object"||!i||i.resources===void 0)continue;Of(n,i)||console.error(r)}catch{console.error(r)}}}}class ll extends zt.Component{constructor(t){super(t),this.state={icon:null}}_abortLoading(){this._loading&&(this._loading.abort(),this._loading=null)}_setData(t){this.state.icon!==t&&this.setState({icon:t})}_checkIcon(t){const n=this.state,r=this.props.icon;if(typeof r=="object"&&r!==null&&typeof r.body=="string"){this._icon="",this._abortLoading(),(t||n.icon===null)&&this._setData({data:r});return}let i;if(typeof r!="string"||(i=_r(r,!1,!0))===null){this._abortLoading(),this._setData(null);return}const s=mf(i);if(!s){(!this._loading||this._loading.name!==r)&&(this._abortLoading(),this._icon="",this._setData(null),s!==null&&(this._loading={name:r,abort:Yf([i],this._checkIcon.bind(this,!1))}));return}if(this._icon!==r||n.icon===null){this._abortLoading(),this._icon=r;const a=["iconify"];i.prefix!==""&&a.push("iconify--"+i.prefix),i.provider!==""&&a.push("iconify--"+i.provider),this._setData({data:s,classes:a}),this.props.onLoad&&this.props.onLoad(r)}}componentDidMount(){this._checkIcon(!1)}componentDidUpdate(t){t.icon!==this.props.icon&&this._checkIcon(!0)}componentWillUnmount(){this._abortLoading()}render(){const t=this.props,n=this.state.icon;if(n===null)return t.children?t.children:zt.createElement("span",{});let r=t;return n.classes&&(r={...t,className:(typeof t.className=="string"?t.className+" ":"")+n.classes.join(" ")}),up({...ao,...n.data},r,t._inline,t._ref)}}const Ut=zt.forwardRef(function(t,n){const r={...t,_ref:n,_inline:!1};return zt.createElement(ll,r)});zt.forwardRef(function(t,n){const r={...t,_ref:n,_inline:!0};return zt.createElement(ll,r)});var cl={exports:{}};(function(e,t){(function(n,r){e.exports=r(A)})(Se,n=>(()=>{var r={703:(c,f,y)=>{var l=y(414);function u(){}function k(){}k.resetWarningCache=u,c.exports=function(){function m(D,L,M,K,G,T){if(T!==l){var F=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw F.name="Invariant Violation",F}}function S(){return m}m.isRequired=m;var j={array:m,bool:m,func:m,number:m,object:m,string:m,symbol:m,any:m,arrayOf:S,element:m,elementType:m,instanceOf:S,node:m,objectOf:S,oneOf:S,oneOfType:S,shape:S,exact:S,checkPropTypes:k,resetWarningCache:u};return j.PropTypes=j,j}},697:(c,f,y)=>{c.exports=y(703)()},414:c=>{c.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},590:c=>{var f=typeof Element<"u",y=typeof Map=="function",l=typeof Set=="function",u=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function k(m,S){if(m===S)return!0;if(m&&S&&typeof m=="object"&&typeof S=="object"){if(m.constructor!==S.constructor)return!1;var j,D,L,M;if(Array.isArray(m)){if((j=m.length)!=S.length)return!1;for(D=j;D--!=0;)if(!k(m[D],S[D]))return!1;return!0}if(y&&m instanceof Map&&S instanceof Map){if(m.size!==S.size)return!1;for(M=m.entries();!(D=M.next()).done;)if(!S.has(D.value[0]))return!1;for(M=m.entries();!(D=M.next()).done;)if(!k(D.value[1],S.get(D.value[0])))return!1;return!0}if(l&&m instanceof Set&&S instanceof Set){if(m.size!==S.size)return!1;for(M=m.entries();!(D=M.next()).done;)if(!S.has(D.value[0]))return!1;return!0}if(u&&ArrayBuffer.isView(m)&&ArrayBuffer.isView(S)){if((j=m.length)!=S.length)return!1;for(D=j;D--!=0;)if(m[D]!==S[D])return!1;return!0}if(m.constructor===RegExp)return m.source===S.source&&m.flags===S.flags;if(m.valueOf!==Object.prototype.valueOf)return m.valueOf()===S.valueOf();if(m.toString!==Object.prototype.toString)return m.toString()===S.toString();if((j=(L=Object.keys(m)).length)!==Object.keys(S).length)return!1;for(D=j;D--!=0;)if(!Object.prototype.hasOwnProperty.call(S,L[D]))return!1;if(f&&m instanceof Element)return!1;for(D=j;D--!=0;)if((L[D]!=="_owner"&&L[D]!=="__v"&&L[D]!=="__o"||!m.$$typeof)&&!k(m[L[D]],S[L[D]]))return!1;return!0}return m!=m&&S!=S}c.exports=function(m,S){try{return k(m,S)}catch(j){if((j.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw j}}},359:c=>{c.exports=n}},i={};function s(c){var f=i[c];if(f!==void 0)return f.exports;var y=i[c]={exports:{}};return r[c](y,y.exports,s),y.exports}s.n=c=>{var f=c&&c.__esModule?()=>c.default:()=>c;return s.d(f,{a:f}),f},s.d=(c,f)=>{for(var y in f)s.o(f,y)&&!s.o(c,y)&&Object.defineProperty(c,y,{enumerable:!0,get:f[y]})},s.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),s.o=(c,f)=>Object.prototype.hasOwnProperty.call(c,f),s.r=c=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(c,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(c,"__esModule",{value:!0})};var a={};return(()=>{function c(b){var p,E,O="";if(typeof b=="string"||typeof b=="number")O+=b;else if(typeof b=="object")if(Array.isArray(b))for(p=0;p<b.length;p++)b[p]&&(E=c(b[p]))&&(O&&(O+=" "),O+=E);else for(p in b)b[p]&&(O&&(O+=" "),O+=p);return O}function f(){for(var b,p,E=0,O="";E<arguments.length;)(b=arguments[E++])&&(p=c(b))&&(O&&(O+=" "),O+=p);return O}s.r(a),s.d(a,{default:()=>Il});var y=s(359),l=s.n(y);const u=function(b){var p=typeof b;return b!=null&&(p=="object"||p=="function")},k=typeof Se=="object"&&Se&&Se.Object===Object&&Se;var m=typeof self=="object"&&self&&self.Object===Object&&self;const S=k||m||Function("return this")(),j=function(){return S.Date.now()};var D=/\s/,L=/^\s+/;const M=function(b){return b&&b.slice(0,function(p){for(var E=p.length;E--&&D.test(p.charAt(E)););return E}(b)+1).replace(L,"")},K=S.Symbol;var G=Object.prototype,T=G.hasOwnProperty,F=G.toString,H=K?K.toStringTag:void 0,B=Object.prototype.toString,ce=K?K.toStringTag:void 0;const V=function(b){return b==null?b===void 0?"[object Undefined]":"[object Null]":ce&&ce in Object(b)?function(p){var E=T.call(p,H),O=p[H];try{p[H]=void 0;var z=!0}catch{}var ie=F.call(p);return z&&(E?p[H]=O:delete p[H]),ie}(b):function(p){return B.call(p)}(b)};var se=/^[-+]0x[0-9a-f]+$/i,Pe=/^0b[01]+$/i,Be=/^0o[0-7]+$/i,Ae=parseInt;const Je=function(b){if(typeof b=="number")return b;if(function(O){return typeof O=="symbol"||function(z){return z!=null&&typeof z=="object"}(O)&&V(O)=="[object Symbol]"}(b))return NaN;if(u(b)){var p=typeof b.valueOf=="function"?b.valueOf():b;b=u(p)?p+"":p}if(typeof b!="string")return b===0?b:+b;b=M(b);var E=Pe.test(b);return E||Be.test(b)?Ae(b.slice(2),E?2:8):se.test(b)?NaN:+b};var J=Math.max,me=Math.min;const ne=function(b,p,E){var O,z,ie,ge,v,g,R=0,$=!1,q=!1,W=!0;if(typeof b!="function")throw new TypeError("Expected a function");function de(oe){var pe=O,be=z;return O=z=void 0,R=oe,ge=b.apply(be,pe)}function ue(oe){return R=oe,v=setTimeout(Y,p),$?de(oe):ge}function fe(oe){var pe=oe-g;return g===void 0||pe>=p||pe<0||q&&oe-R>=ie}function Y(){var oe=j();if(fe(oe))return Q(oe);v=setTimeout(Y,function(pe){var be=p-(pe-g);return q?me(be,ie-(pe-R)):be}(oe))}function Q(oe){return v=void 0,W&&O?de(oe):(O=z=void 0,ge)}function ee(){var oe=j(),pe=fe(oe);if(O=arguments,z=this,g=oe,pe){if(v===void 0)return ue(g);if(q)return clearTimeout(v),v=setTimeout(Y,p),de(g)}return v===void 0&&(v=setTimeout(Y,p)),ge}return p=Je(p)||0,u(E)&&($=!!E.leading,ie=(q="maxWait"in E)?J(Je(E.maxWait)||0,p):ie,W="trailing"in E?!!E.trailing:W),ee.cancel=function(){v!==void 0&&clearTimeout(v),R=0,O=g=z=v=void 0},ee.flush=function(){return v===void 0?ge:Q(j())},ee},je=function(b,p,E){var O=!0,z=!0;if(typeof b!="function")throw new TypeError("Expected a function");return u(E)&&(O="leading"in E?!!E.leading:O,z="trailing"in E?!!E.trailing:z),ne(b,p,{leading:O,maxWait:p,trailing:z})};var Le=s(590),Me=s.n(Le),we=function(){if(typeof Map<"u")return Map;function b(p,E){var O=-1;return p.some(function(z,ie){return z[0]===E&&(O=ie,!0)}),O}return function(){function p(){this.__entries__=[]}return Object.defineProperty(p.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),p.prototype.get=function(E){var O=b(this.__entries__,E),z=this.__entries__[O];return z&&z[1]},p.prototype.set=function(E,O){var z=b(this.__entries__,E);~z?this.__entries__[z][1]=O:this.__entries__.push([E,O])},p.prototype.delete=function(E){var O=this.__entries__,z=b(O,E);~z&&O.splice(z,1)},p.prototype.has=function(E){return!!~b(this.__entries__,E)},p.prototype.clear=function(){this.__entries__.splice(0)},p.prototype.forEach=function(E,O){O===void 0&&(O=null);for(var z=0,ie=this.__entries__;z<ie.length;z++){var ge=ie[z];E.call(O,ge[1],ge[0])}},p}()}(),Ze=typeof window<"u"&&typeof document<"u"&&window.document===document,Ke=s.g!==void 0&&s.g.Math===Math?s.g:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")(),Ct=typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Ke):function(b){return setTimeout(function(){return b(Date.now())},1e3/60)},Pt=["top","right","bottom","left","width","height","size","weight"],yt=typeof MutationObserver<"u",et=function(){function b(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(p,E){var O=!1,z=!1,ie=0;function ge(){O&&(O=!1,p()),z&&g()}function v(){Ct(ge)}function g(){var R=Date.now();if(O){if(R-ie<2)return;z=!0}else O=!0,z=!1,setTimeout(v,20);ie=R}return g}(this.refresh.bind(this))}return b.prototype.addObserver=function(p){~this.observers_.indexOf(p)||this.observers_.push(p),this.connected_||this.connect_()},b.prototype.removeObserver=function(p){var E=this.observers_,O=E.indexOf(p);~O&&E.splice(O,1),!E.length&&this.connected_&&this.disconnect_()},b.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},b.prototype.updateObservers_=function(){var p=this.observers_.filter(function(E){return E.gatherActive(),E.hasActive()});return p.forEach(function(E){return E.broadcastActive()}),p.length>0},b.prototype.connect_=function(){Ze&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),yt?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},b.prototype.disconnect_=function(){Ze&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},b.prototype.onTransitionEnd_=function(p){var E=p.propertyName,O=E===void 0?"":E;Pt.some(function(z){return!!~O.indexOf(z)})&&this.refresh()},b.getInstance=function(){return this.instance_||(this.instance_=new b),this.instance_},b.instance_=null,b}(),Z=function(b,p){for(var E=0,O=Object.keys(p);E<O.length;E++){var z=O[E];Object.defineProperty(b,z,{value:p[z],enumerable:!1,writable:!1,configurable:!0})}return b},he=function(b){return b&&b.ownerDocument&&b.ownerDocument.defaultView||Ke},ke=Oe(0,0,0,0);function ae(b){return parseFloat(b)||0}function Lt(b){for(var p=[],E=1;E<arguments.length;E++)p[E-1]=arguments[E];return p.reduce(function(O,z){return O+ae(b["border-"+z+"-width"])},0)}var Zt=typeof SVGGraphicsElement<"u"?function(b){return b instanceof he(b).SVGGraphicsElement}:function(b){return b instanceof he(b).SVGElement&&typeof b.getBBox=="function"};function en(b){return Ze?Zt(b)?function(p){var E=p.getBBox();return Oe(0,0,E.width,E.height)}(b):function(p){var E=p.clientWidth,O=p.clientHeight;if(!E&&!O)return ke;var z=he(p).getComputedStyle(p),ie=function(W){for(var de={},ue=0,fe=["top","right","bottom","left"];ue<fe.length;ue++){var Y=fe[ue],Q=W["padding-"+Y];de[Y]=ae(Q)}return de}(z),ge=ie.left+ie.right,v=ie.top+ie.bottom,g=ae(z.width),R=ae(z.height);if(z.boxSizing==="border-box"&&(Math.round(g+ge)!==E&&(g-=Lt(z,"left","right")+ge),Math.round(R+v)!==O&&(R-=Lt(z,"top","bottom")+v)),!function(W){return W===he(W).document.documentElement}(p)){var $=Math.round(g+ge)-E,q=Math.round(R+v)-O;Math.abs($)!==1&&(g-=$),Math.abs(q)!==1&&(R-=q)}return Oe(ie.left,ie.top,g,R)}(b):ke}function Oe(b,p,E,O){return{x:b,y:p,width:E,height:O}}var qt=function(){function b(p){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Oe(0,0,0,0),this.target=p}return b.prototype.isActive=function(){var p=en(this.target);return this.contentRect_=p,p.width!==this.broadcastWidth||p.height!==this.broadcastHeight},b.prototype.broadcastRect=function(){var p=this.contentRect_;return this.broadcastWidth=p.width,this.broadcastHeight=p.height,p},b}(),Dn=function(b,p){var E,O,z,ie,ge,v,g,R=(O=(E=p).x,z=E.y,ie=E.width,ge=E.height,v=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,g=Object.create(v.prototype),Z(g,{x:O,y:z,width:ie,height:ge,top:z,right:O+ie,bottom:ge+z,left:O}),g);Z(this,{target:b,contentRect:R})},tt=function(){function b(p,E,O){if(this.activeObservations_=[],this.observations_=new we,typeof p!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=p,this.controller_=E,this.callbackCtx_=O}return b.prototype.observe=function(p){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element<"u"&&Element instanceof Object){if(!(p instanceof he(p).Element))throw new TypeError('parameter 1 is not of type "Element".');var E=this.observations_;E.has(p)||(E.set(p,new qt(p)),this.controller_.addObserver(this),this.controller_.refresh())}},b.prototype.unobserve=function(p){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element<"u"&&Element instanceof Object){if(!(p instanceof he(p).Element))throw new TypeError('parameter 1 is not of type "Element".');var E=this.observations_;E.has(p)&&(E.delete(p),E.size||this.controller_.removeObserver(this))}},b.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},b.prototype.gatherActive=function(){var p=this;this.clearActive(),this.observations_.forEach(function(E){E.isActive()&&p.activeObservations_.push(E)})},b.prototype.broadcastActive=function(){if(this.hasActive()){var p=this.callbackCtx_,E=this.activeObservations_.map(function(O){return new Dn(O.target,O.broadcastRect())});this.callback_.call(p,E,p),this.clearActive()}},b.prototype.clearActive=function(){this.activeObservations_.splice(0)},b.prototype.hasActive=function(){return this.activeObservations_.length>0},b}(),tn=typeof WeakMap<"u"?new WeakMap:new we,nn=function b(p){if(!(this instanceof b))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var E=et.getInstance(),O=new tt(p,E,this);tn.set(this,O)};["observe","unobserve","disconnect"].forEach(function(b){nn.prototype[b]=function(){var p;return(p=tn.get(this))[b].apply(p,arguments)}});const rn=Ke.ResizeObserver!==void 0?Ke.ResizeObserver:nn,$e="Left",nt="Right",Tt="Up",st="Down",jt={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},_t={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},Ge="mousemove",En="mouseup";function on(b,p){if(p===0)return b;const E=Math.PI/180*p;return[b[0]*Math.cos(E)+b[1]*Math.sin(E),b[1]*Math.cos(E)-b[0]*Math.sin(E)]}function Sn(b){const{trackMouse:p}=b,E=y.useRef(Object.assign({},_t)),O=y.useRef(Object.assign({},jt)),z=y.useRef(Object.assign({},O.current));let ie;for(ie in z.current=Object.assign({},O.current),O.current=Object.assign(Object.assign({},jt),b),jt)O.current[ie]===void 0&&(O.current[ie]=jt[ie]);const[ge,v]=y.useMemo(()=>function(g,R){const $=Y=>{const Q="touches"in Y;Q&&Y.touches.length>1||g((ee,oe)=>{oe.trackMouse&&!Q&&(document.addEventListener(Ge,q),document.addEventListener(En,de));const{clientX:pe,clientY:be}=Q?Y.touches[0]:Y,Ne=on([pe,be],oe.rotationAngle);return oe.onTouchStartOrOnMouseDown&&oe.onTouchStartOrOnMouseDown({event:Y}),Object.assign(Object.assign(Object.assign({},ee),_t),{initial:Ne.slice(),xy:Ne,start:Y.timeStamp||0})})},q=Y=>{g((Q,ee)=>{const oe="touches"in Y;if(oe&&Y.touches.length>1)return Q;if(Y.timeStamp-Q.start>ee.swipeDuration)return Q.swiping?Object.assign(Object.assign({},Q),{swiping:!1}):Q;const{clientX:pe,clientY:be}=oe?Y.touches[0]:Y,[Ne,ct]=on([pe,be],ee.rotationAngle),rt=Ne-Q.xy[0],He=ct-Q.xy[1],_e=Math.abs(rt),xe=Math.abs(He),Ht=(Y.timeStamp||0)-Q.start,Un=Math.sqrt(_e*_e+xe*xe)/(Ht||1),Wn=[rt/(Ht||1),He/(Ht||1)],Ft=function(zn,Rn,qn,ut){return zn>Rn?qn>0?nt:$e:ut>0?st:Tt}(_e,xe,rt,He),dn=typeof ee.delta=="number"?ee.delta:ee.delta[Ft.toLowerCase()]||jt.delta;if(_e<dn&&xe<dn&&!Q.swiping)return Q;const Ot={absX:_e,absY:xe,deltaX:rt,deltaY:He,dir:Ft,event:Y,first:Q.first,initial:Q.initial,velocity:Un,vxvy:Wn};Ot.first&&ee.onSwipeStart&&ee.onSwipeStart(Ot),ee.onSwiping&&ee.onSwiping(Ot);let In=!1;return(ee.onSwiping||ee.onSwiped||ee[`onSwiped${Ft}`])&&(In=!0),In&&ee.preventScrollOnSwipe&&ee.trackTouch&&Y.cancelable&&Y.preventDefault(),Object.assign(Object.assign({},Q),{first:!1,eventData:Ot,swiping:!0})})},W=Y=>{g((Q,ee)=>{let oe;if(Q.swiping&&Q.eventData){if(Y.timeStamp-Q.start<ee.swipeDuration){oe=Object.assign(Object.assign({},Q.eventData),{event:Y}),ee.onSwiped&&ee.onSwiped(oe);const pe=ee[`onSwiped${oe.dir}`];pe&&pe(oe)}}else ee.onTap&&ee.onTap({event:Y});return ee.onTouchEndOrOnMouseUp&&ee.onTouchEndOrOnMouseUp({event:Y}),Object.assign(Object.assign(Object.assign({},Q),_t),{eventData:oe})})},de=Y=>{document.removeEventListener(Ge,q),document.removeEventListener(En,de),W(Y)},ue=(Y,Q)=>{let ee=()=>{};if(Y&&Y.addEventListener){const oe=Object.assign(Object.assign({},jt.touchEventOptions),Q.touchEventOptions),pe=[["touchstart",$,oe],["touchmove",q,Object.assign(Object.assign({},oe),Q.preventScrollOnSwipe?{passive:!1}:{})],["touchend",W,oe]];pe.forEach(([be,Ne,ct])=>Y.addEventListener(be,Ne,ct)),ee=()=>pe.forEach(([be,Ne])=>Y.removeEventListener(be,Ne))}return ee},fe={ref:Y=>{Y!==null&&g((Q,ee)=>{if(Q.el===Y)return Q;const oe={};return Q.el&&Q.el!==Y&&Q.cleanUpTouch&&(Q.cleanUpTouch(),oe.cleanUpTouch=void 0),ee.trackTouch&&Y&&(oe.cleanUpTouch=ue(Y,ee)),Object.assign(Object.assign(Object.assign({},Q),{el:Y}),oe)})}};return R.trackMouse&&(fe.onMouseDown=$),[fe,ue]}(g=>E.current=g(E.current,O.current),{trackMouse:p}),[p]);return E.current=function(g,R,$,q){return R.trackTouch&&g.el?g.cleanUpTouch?R.preventScrollOnSwipe!==$.preventScrollOnSwipe||R.touchEventOptions.passive!==$.touchEventOptions.passive?(g.cleanUpTouch(),Object.assign(Object.assign({},g),{cleanUpTouch:q(g.el,R)})):g:Object.assign(Object.assign({},g),{cleanUpTouch:q(g.el,R)}):(g.cleanUpTouch&&g.cleanUpTouch(),Object.assign(Object.assign({},g),{cleanUpTouch:void 0}))}(E.current,O.current,z.current,v),ge}var C=s(697);function kt(b){return kt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},kt(b)}function Nt(b,p){var E=Object.keys(b);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(b);p&&(O=O.filter(function(z){return Object.getOwnPropertyDescriptor(b,z).enumerable})),E.push.apply(E,O)}return E}function sn(b){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?Nt(Object(E),!0).forEach(function(O){d(b,O,E[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(E)):Nt(Object(E)).forEach(function(O){Object.defineProperty(b,O,Object.getOwnPropertyDescriptor(E,O))})}return b}function d(b,p,E){return(p=function(O){var z=function(ie,ge){if(kt(ie)!=="object"||ie===null)return ie;var v=ie[Symbol.toPrimitive];if(v!==void 0){var g=v.call(ie,ge);if(kt(g)!=="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(ie)}(O,"string");return kt(z)==="symbol"?z:String(z)}(p))in b?Object.defineProperty(b,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):b[p]=E,b}var x={description:"",fullscreen:"",isFullscreen:!1,originalAlt:"",originalHeight:"",originalWidth:"",originalTitle:"",sizes:"",srcSet:"",loading:"eager"},w=l().memo(function(b){var p=sn(sn({},x),b),E=p.description,O=p.fullscreen,z=p.handleImageLoaded,ie=p.isFullscreen,ge=p.onImageError,v=p.original,g=p.originalAlt,R=p.originalHeight,$=p.originalWidth,q=p.originalTitle,W=p.sizes,de=p.srcSet,ue=p.loading,fe=ie&&O||v;return l().createElement(l().Fragment,null,l().createElement("img",{className:"image-gallery-image",src:fe,alt:g,srcSet:de,height:R,width:$,sizes:W,title:q,onLoad:function(Y){return z(Y,v)},onError:ge,loading:ue}),E&&l().createElement("span",{className:"image-gallery-description"},E))});w.displayName="Item",w.propTypes={description:C.string,fullscreen:C.string,handleImageLoaded:C.func.isRequired,isFullscreen:C.bool,onImageError:C.func.isRequired,original:C.string.isRequired,originalAlt:C.string,originalHeight:C.string,originalWidth:C.string,originalTitle:C.string,sizes:C.string,srcSet:C.string,loading:C.string};const P=w;function I(b){return I=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},I(b)}function _(b,p){var E=Object.keys(b);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(b);p&&(O=O.filter(function(z){return Object.getOwnPropertyDescriptor(b,z).enumerable})),E.push.apply(E,O)}return E}function U(b){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?_(Object(E),!0).forEach(function(O){re(b,O,E[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(E)):_(Object(E)).forEach(function(O){Object.defineProperty(b,O,Object.getOwnPropertyDescriptor(E,O))})}return b}function re(b,p,E){return(p=function(O){var z=function(ie,ge){if(I(ie)!=="object"||ie===null)return ie;var v=ie[Symbol.toPrimitive];if(v!==void 0){var g=v.call(ie,ge);if(I(g)!=="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(ie)}(O,"string");return I(z)==="symbol"?z:String(z)}(p))in b?Object.defineProperty(b,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):b[p]=E,b}var le={left:l().createElement("polyline",{points:"15 18 9 12 15 6"}),right:l().createElement("polyline",{points:"9 18 15 12 9 6"}),maximize:l().createElement("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"}),minimize:l().createElement("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"}),play:l().createElement("polygon",{points:"5 3 19 12 5 21 5 3"}),pause:l().createElement(l().Fragment,null,l().createElement("rect",{x:"6",y:"4",width:"4",height:"16"}),l().createElement("rect",{x:"14",y:"4",width:"4",height:"16"}))},Ue={strokeWidth:1,viewBox:"0 0 24 24"},De=function(b){var p=U(U({},Ue),b),E=p.strokeWidth,O=p.viewBox,z=p.icon;return l().createElement("svg",{className:"image-gallery-svg",xmlns:"http://www.w3.org/2000/svg",viewBox:O,fill:"none",stroke:"currentColor",strokeWidth:E,strokeLinecap:"round",strokeLinejoin:"round"},le[z])};De.propTypes={strokeWidth:C.number,viewBox:C.string,icon:(0,C.oneOf)(["left","right","maximize","minimize","play","pause"]).isRequired};const Ee=De;var Te=l().memo(function(b){var p=b.isFullscreen,E=b.onClick;return l().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-fullscreen-button",onClick:E,"aria-label":"Open Fullscreen"},l().createElement(Ee,{strokeWidth:2,icon:p?"minimize":"maximize"}))});Te.displayName="Fullscreen",Te.propTypes={isFullscreen:C.bool.isRequired,onClick:C.func.isRequired};const Ye=Te;var At=l().memo(function(b){var p=b.disabled,E=b.onClick;return l().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-left-nav",disabled:p,onClick:E,"aria-label":"Previous Slide"},l().createElement(Ee,{icon:"left",viewBox:"6 0 12 24"}))});At.displayName="LeftNav",At.propTypes={disabled:C.bool.isRequired,onClick:C.func.isRequired};const Mn=At;var Dt=l().memo(function(b){var p=b.disabled,E=b.onClick;return l().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-right-nav",disabled:p,onClick:E,"aria-label":"Next Slide"},l().createElement(Ee,{icon:"right",viewBox:"6 0 12 24"}))});Dt.displayName="RightNav",Dt.propTypes={disabled:C.bool.isRequired,onClick:C.func.isRequired};const at=Dt;var Kt=l().memo(function(b){var p=b.isPlaying,E=b.onClick;return l().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-play-button",onClick:E,"aria-label":"Play or Pause Slideshow"},l().createElement(Ee,{strokeWidth:2,icon:p?"pause":"play"}))});Kt.displayName="PlayPause",Kt.propTypes={isPlaying:C.bool.isRequired,onClick:C.func.isRequired};const Gt=Kt;function gt(b){return gt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},gt(b)}function lt(){return lt=Object.assign?Object.assign.bind():function(b){for(var p=1;p<arguments.length;p++){var E=arguments[p];for(var O in E)Object.prototype.hasOwnProperty.call(E,O)&&(b[O]=E[O])}return b},lt.apply(this,arguments)}function Mt(b,p){var E=Object.keys(b);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(b);p&&(O=O.filter(function(z){return Object.getOwnPropertyDescriptor(b,z).enumerable})),E.push.apply(E,O)}return E}function Tn(b){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?Mt(Object(E),!0).forEach(function(O){jn(b,O,E[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(E)):Mt(Object(E)).forEach(function(O){Object.defineProperty(b,O,Object.getOwnPropertyDescriptor(E,O))})}return b}function jn(b,p,E){return(p=function(O){var z=function(ie,ge){if(gt(ie)!=="object"||ie===null)return ie;var v=ie[Symbol.toPrimitive];if(v!==void 0){var g=v.call(ie,ge);if(gt(g)!=="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(ie)}(O,"string");return gt(z)==="symbol"?z:String(z)}(p))in b?Object.defineProperty(b,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):b[p]=E,b}var sr={className:"",delta:0,onSwiping:function(){},onSwiped:function(){}},Fn=function(b){var p=Tn(Tn({},sr),b),E=p.children,O=p.className,z=Sn({delta:p.delta,onSwiping:p.onSwiping,onSwiped:p.onSwiped});return l().createElement("div",lt({},z,{className:O}),E)};Fn.propTypes={children:C.node.isRequired,className:C.string,delta:C.number,onSwiped:C.func,onSwiping:C.func};const Bn=Fn;function We(b){return We=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},We(b)}function kn(b,p){var E=Object.keys(b);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(b);p&&(O=O.filter(function(z){return Object.getOwnPropertyDescriptor(b,z).enumerable})),E.push.apply(E,O)}return E}function an(b){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?kn(Object(E),!0).forEach(function(O){cn(b,O,E[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(E)):kn(Object(E)).forEach(function(O){Object.defineProperty(b,O,Object.getOwnPropertyDescriptor(E,O))})}return b}function On(b,p){for(var E=0;E<p.length;E++){var O=p[E];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(b,un(O.key),O)}}function ln(b,p){return ln=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(E,O){return E.__proto__=O,E},ln(b,p)}function $n(b,p){if(p&&(We(p)==="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ie(b)}function Ie(b){if(b===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b}function bt(b){return bt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(p){return p.__proto__||Object.getPrototypeOf(p)},bt(b)}function cn(b,p,E){return(p=un(p))in b?Object.defineProperty(b,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):b[p]=E,b}function un(b){var p=function(E,O){if(We(E)!=="object"||E===null)return E;var z=E[Symbol.toPrimitive];if(z!==void 0){var ie=z.call(E,O);if(We(ie)!=="object")return ie;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(E)}(b,"string");return We(p)==="symbol"?p:String(p)}var ar=["fullscreenchange","MSFullscreenChange","mozfullscreenchange","webkitfullscreenchange"],Ol=(0,C.arrayOf)((0,C.shape)({srcSet:C.string,media:C.string}));function So(b){var p=parseInt(b.keyCode||b.which||0,10);return p===66||p===62}var Dr=function(b){(function(v,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function");v.prototype=Object.create(g&&g.prototype,{constructor:{value:v,writable:!0,configurable:!0}}),Object.defineProperty(v,"prototype",{writable:!1}),g&&ln(v,g)})(ge,b);var p,E,O,z,ie=(O=ge,z=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var v,g=bt(O);if(z){var R=bt(this).constructor;v=Reflect.construct(g,arguments,R)}else v=g.apply(this,arguments);return $n(this,v)});function ge(v){var g;return function(R,$){if(!(R instanceof $))throw new TypeError("Cannot call a class as a function")}(this,ge),cn(Ie(g=ie.call(this,v)),"onBulletClick",function(R,$){var q=g.props,W=q.onBulletClick,de=q.items,ue=g.state.currentIndex;R.target.blur(),ue!==$&&(de.length===2?g.slideToIndexWithStyleReset($,R):g.slideToIndex($,R)),W&&W(R,$)}),g.state={currentIndex:v.startIndex,thumbsTranslate:0,thumbsSwipedTranslate:0,currentSlideOffset:0,galleryWidth:0,thumbnailsWrapperWidth:0,thumbnailsWrapperHeight:0,thumbsStyle:{transition:"all ".concat(v.slideDuration,"ms ease-out")},isFullscreen:!1,isSwipingThumbnail:!1,isPlaying:!1},g.loadedImages={},g.imageGallery=l().createRef(),g.thumbnailsWrapper=l().createRef(),g.thumbnails=l().createRef(),g.imageGallerySlideWrapper=l().createRef(),g.handleImageLoaded=g.handleImageLoaded.bind(Ie(g)),g.handleKeyDown=g.handleKeyDown.bind(Ie(g)),g.handleMouseDown=g.handleMouseDown.bind(Ie(g)),g.handleResize=g.handleResize.bind(Ie(g)),g.handleTouchMove=g.handleTouchMove.bind(Ie(g)),g.handleOnSwiped=g.handleOnSwiped.bind(Ie(g)),g.handleScreenChange=g.handleScreenChange.bind(Ie(g)),g.handleSwiping=g.handleSwiping.bind(Ie(g)),g.handleThumbnailSwiping=g.handleThumbnailSwiping.bind(Ie(g)),g.handleOnThumbnailSwiped=g.handleOnThumbnailSwiped.bind(Ie(g)),g.onThumbnailMouseLeave=g.onThumbnailMouseLeave.bind(Ie(g)),g.handleImageError=g.handleImageError.bind(Ie(g)),g.pauseOrPlay=g.pauseOrPlay.bind(Ie(g)),g.renderThumbInner=g.renderThumbInner.bind(Ie(g)),g.renderItem=g.renderItem.bind(Ie(g)),g.slideLeft=g.slideLeft.bind(Ie(g)),g.slideRight=g.slideRight.bind(Ie(g)),g.toggleFullScreen=g.toggleFullScreen.bind(Ie(g)),g.togglePlay=g.togglePlay.bind(Ie(g)),g.unthrottledSlideToIndex=g.slideToIndex,g.slideToIndex=je(g.unthrottledSlideToIndex,v.slideDuration,{trailing:!1}),v.lazyLoad&&(g.lazyLoaded=[]),g}return p=ge,E=[{key:"componentDidMount",value:function(){var v=this.props,g=v.autoPlay,R=v.useWindowKeyDown;g&&this.play(),R?window.addEventListener("keydown",this.handleKeyDown):this.imageGallery.current.addEventListener("keydown",this.handleKeyDown),window.addEventListener("mousedown",this.handleMouseDown),window.addEventListener("touchmove",this.handleTouchMove,{passive:!1}),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),this.addScreenChangeEvent()}},{key:"componentDidUpdate",value:function(v,g){var R=this.props,$=R.items,q=R.lazyLoad,W=R.slideDuration,de=R.slideInterval,ue=R.startIndex,fe=R.thumbnailPosition,Y=R.showThumbnails,Q=R.useWindowKeyDown,ee=this.state,oe=ee.currentIndex,pe=ee.isPlaying,be=v.items.length!==$.length,Ne=!Me()(v.items,$),ct=v.startIndex!==ue,rt=v.thumbnailPosition!==fe,He=v.showThumbnails!==Y;de===v.slideInterval&&W===v.slideDuration||pe&&(this.pause(),this.play()),rt&&(this.removeResizeObserver(),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper)),He&&Y&&this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),He&&!Y&&this.removeThumbnailsResizeObserver(),(be||He)&&this.handleResize(),g.currentIndex!==oe&&this.slideThumbnailBar(),v.slideDuration!==W&&(this.slideToIndex=je(this.unthrottledSlideToIndex,W,{trailing:!1})),!q||v.lazyLoad&&!Ne||(this.lazyLoaded=[]),Q!==v.useWindowKeyDown&&(Q?(this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown),window.addEventListener("keydown",this.handleKeyDown)):(window.removeEventListener("keydown",this.handleKeyDown),this.imageGallery.current.addEventListener("keydown",this.handleKeyDown))),(ct||Ne)&&this.setState({currentIndex:ue,slideStyle:{transition:"none"}})}},{key:"componentWillUnmount",value:function(){var v=this.props.useWindowKeyDown;window.removeEventListener("mousedown",this.handleMouseDown),window.removeEventListener("touchmove",this.handleTouchMove),this.removeScreenChangeEvent(),this.removeResizeObserver(),this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null),this.transitionTimer&&window.clearTimeout(this.transitionTimer),v?window.removeEventListener("keydown",this.handleKeyDown):this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown)}},{key:"onSliding",value:function(){var v=this,g=this.state,R=g.currentIndex,$=g.isTransitioning,q=this.props,W=q.onSlide,de=q.slideDuration;this.transitionTimer=window.setTimeout(function(){$&&(v.setState({isTransitioning:!$,isSwipingThumbnail:!1}),W&&W(R))},de+50)}},{key:"onThumbnailClick",value:function(v,g){var R=this.props,$=R.onThumbnailClick,q=R.items,W=this.state.currentIndex;v.target.parentNode.parentNode.blur(),W!==g&&(q.length===2?this.slideToIndexWithStyleReset(g,v):this.slideToIndex(g,v)),$&&$(v,g)}},{key:"onThumbnailMouseOver",value:function(v,g){var R=this;this.thumbnailMouseOverTimer&&(window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null),this.thumbnailMouseOverTimer=window.setTimeout(function(){R.slideToIndex(g),R.pause()},300)}},{key:"onThumbnailMouseLeave",value:function(){if(this.thumbnailMouseOverTimer){var v=this.props.autoPlay;window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null,v&&this.play()}}},{key:"setThumbsTranslate",value:function(v){this.setState({thumbsTranslate:v})}},{key:"setModalFullscreen",value:function(v){var g=this.props.onScreenChange;this.setState({modalFullscreen:v}),g&&g(v)}},{key:"getThumbsTranslate",value:function(v){var g,R=this.props,$=R.disableThumbnailScroll,q=R.items,W=this.state,de=W.thumbnailsWrapperWidth,ue=W.thumbnailsWrapperHeight,fe=this.thumbnails&&this.thumbnails.current;if($)return 0;if(fe){if(this.isThumbnailVertical()){if(fe.scrollHeight<=ue)return 0;g=fe.scrollHeight-ue}else{if(fe.scrollWidth<=de||de<=0)return 0;g=fe.scrollWidth-de}return v*(g/(q.length-1))}return 0}},{key:"getThumbnailPositionClassName",value:function(v){switch(v){case"left":v=" ".concat("image-gallery-thumbnails-left");break;case"right":v=" ".concat("image-gallery-thumbnails-right");break;case"bottom":v=" ".concat("image-gallery-thumbnails-bottom");break;case"top":v=" ".concat("image-gallery-thumbnails-top")}return v}},{key:"getAlignmentClassName",value:function(v){var g=this.state.currentIndex,R=this.props,$=R.infinite,q=R.items,W="",de="image-gallery-left",ue="image-gallery-right";switch(v){case g-1:W=" ".concat(de);break;case g:W=" ".concat("image-gallery-center");break;case g+1:W=" ".concat(ue)}return q.length>=3&&$&&(v===0&&g===q.length-1?W=" ".concat(ue):v===q.length-1&&g===0&&(W=" ".concat(de))),W}},{key:"getTranslateXForTwoSlide",value:function(v){var g=this.state,R=g.currentIndex,$=g.currentSlideOffset,q=g.previousIndex,W=R!==q,de=v===0&&q===0,ue=v===1&&q===1,fe=v===0&&R===1,Y=v===1&&R===0,Q=$===0,ee=-100*R+100*v+$;return $>0?this.direction="left":$<0&&(this.direction="right"),Y&&$>0&&(ee=-100+$),fe&&$<0&&(ee=100+$),W?de&&Q&&this.direction==="left"?ee=100:ue&&Q&&this.direction==="right"&&(ee=-100):(Y&&Q&&this.direction==="left"&&(ee=-100),fe&&Q&&this.direction==="right"&&(ee=100)),ee}},{key:"getThumbnailBarHeight",value:function(){return this.isThumbnailVertical()?{height:this.state.gallerySlideWrapperHeight}:{}}},{key:"getSlideStyle",value:function(v){var g=this.state,R=g.currentIndex,$=g.currentSlideOffset,q=g.slideStyle,W=this.props,de=W.infinite,ue=W.items,fe=W.useTranslate3D,Y=W.isRTL,Q=-100*R,ee=ue.length-1,oe=(Q+100*v)*(Y?-1:1)+$;de&&ue.length>2&&(R===0&&v===ee?oe=-100*(Y?-1:1)+$:R===ee&&v===0&&(oe=100*(Y?-1:1)+$)),de&&ue.length===2&&(oe=this.getTranslateXForTwoSlide(v));var pe="translate(".concat(oe,"%, 0)");return fe&&(pe="translate3d(".concat(oe,"%, 0, 0)")),an({display:this.isSlideVisible(v)?"inherit":"none",WebkitTransform:pe,MozTransform:pe,msTransform:pe,OTransform:pe,transform:pe},q)}},{key:"getCurrentIndex",value:function(){return this.state.currentIndex}},{key:"getThumbnailStyle",value:function(){var v,g=this.props,R=g.useTranslate3D,$=g.isRTL,q=this.state,W=q.thumbsTranslate,de=q.thumbsStyle,ue=$?-1*W:W;return this.isThumbnailVertical()?(v="translate(0, ".concat(W,"px)"),R&&(v="translate3d(0, ".concat(W,"px, 0)"))):(v="translate(".concat(ue,"px, 0)"),R&&(v="translate3d(".concat(ue,"px, 0, 0)"))),an({WebkitTransform:v,MozTransform:v,msTransform:v,OTransform:v,transform:v},de)}},{key:"getSlideItems",value:function(){var v=this,g=this.state.currentIndex,R=this.props,$=R.items,q=R.slideOnThumbnailOver,W=R.onClick,de=R.lazyLoad,ue=R.onTouchMove,fe=R.onTouchEnd,Y=R.onTouchStart,Q=R.onMouseOver,ee=R.onMouseLeave,oe=R.renderItem,pe=R.renderThumbInner,be=R.showThumbnails,Ne=R.showBullets,ct=[],rt=[],He=[];return $.forEach(function(_e,xe){var Ht=v.getAlignmentClassName(xe),Un=_e.originalClass?" ".concat(_e.originalClass):"",Wn=_e.thumbnailClass?" ".concat(_e.thumbnailClass):"",Ft=_e.renderItem||oe||v.renderItem,dn=_e.renderThumbInner||pe||v.renderThumbInner,Ot=!de||Ht||v.lazyLoaded[xe];Ot&&de&&!v.lazyLoaded[xe]&&(v.lazyLoaded[xe]=!0);var In=v.getSlideStyle(xe),zn=l().createElement("div",{"aria-label":"Go to Slide ".concat(xe+1),key:"slide-".concat(xe),tabIndex:"-1",className:"image-gallery-slide ".concat(Ht," ").concat(Un),style:In,onClick:W,onKeyUp:v.handleSlideKeyUp,onTouchMove:ue,onTouchEnd:fe,onTouchStart:Y,onMouseOver:Q,onFocus:Q,onMouseLeave:ee,role:"button"},Ot?Ft(_e):l().createElement("div",{style:{height:"100%"}}));if(ct.push(zn),be&&_e.thumbnail){var Rn=f("image-gallery-thumbnail",Wn,{active:g===xe});rt.push(l().createElement("button",{key:"thumbnail-".concat(xe),type:"button",tabIndex:"0","aria-pressed":g===xe?"true":"false","aria-label":"Go to Slide ".concat(xe+1),className:Rn,onMouseLeave:q?v.onThumbnailMouseLeave:null,onMouseOver:function(ut){return v.handleThumbnailMouseOver(ut,xe)},onFocus:function(ut){return v.handleThumbnailMouseOver(ut,xe)},onKeyUp:function(ut){return v.handleThumbnailKeyUp(ut,xe)},onClick:function(ut){return v.onThumbnailClick(ut,xe)}},dn(_e)))}if(Ne){var qn=f("image-gallery-bullet",_e.bulletClass,{active:g===xe});He.push(l().createElement("button",{type:"button",key:"bullet-".concat(xe),className:qn,onClick:function(ut){return v.onBulletClick(ut,xe)},"aria-pressed":g===xe?"true":"false","aria-label":"Go to Slide ".concat(xe+1)}))}}),{slides:ct,thumbnails:rt,bullets:He}}},{key:"ignoreIsTransitioning",value:function(){var v=this.props.items,g=this.state,R=g.previousIndex,$=g.currentIndex,q=v.length-1;return Math.abs(R-$)>1&&!(R===0&&$===q)&&!(R===q&&$===0)}},{key:"isFirstOrLastSlide",value:function(v){return v===this.props.items.length-1||v===0}},{key:"slideIsTransitioning",value:function(v){var g=this.state,R=g.isTransitioning,$=g.previousIndex,q=g.currentIndex;return R&&!(v===$||v===q)}},{key:"isSlideVisible",value:function(v){return!this.slideIsTransitioning(v)||this.ignoreIsTransitioning()&&!this.isFirstOrLastSlide(v)}},{key:"slideThumbnailBar",value:function(){var v=this.state,g=v.currentIndex,R=v.isSwipingThumbnail,$=-this.getThumbsTranslate(g);R||(g===0?this.setState({thumbsTranslate:0,thumbsSwipedTranslate:0}):this.setState({thumbsTranslate:$,thumbsSwipedTranslate:$}))}},{key:"canSlide",value:function(){return this.props.items.length>=2}},{key:"canSlideLeft",value:function(){return this.props.infinite||this.canSlidePrevious()}},{key:"canSlideRight",value:function(){return this.props.infinite||this.canSlideNext()}},{key:"canSlidePrevious",value:function(){return this.state.currentIndex>0}},{key:"canSlideNext",value:function(){return this.state.currentIndex<this.props.items.length-1}},{key:"handleSwiping",value:function(v){var g=v.event,R=v.absX,$=v.dir,q=this.props,W=q.disableSwipe,de=q.stopPropagation,ue=this.state,fe=ue.galleryWidth,Y=ue.isTransitioning,Q=ue.swipingUpDown,ee=ue.swipingLeftRight;if($!==Tt&&$!==st&&!Q||ee){if($!==$e&&$!==nt||ee||this.setState({swipingLeftRight:!0}),!W){var oe=this.props.swipingTransitionDuration;if(de&&g.preventDefault(),Y)this.setState({currentSlideOffset:0});else{var pe=$===nt?1:-1,be=R/fe*100;Math.abs(be)>=100&&(be=100);var Ne={transition:"transform ".concat(oe,"ms ease-out")};this.setState({currentSlideOffset:pe*be,slideStyle:Ne})}}}else Q||this.setState({swipingUpDown:!0})}},{key:"handleThumbnailSwiping",value:function(v){var g=v.event,R=v.absX,$=v.absY,q=v.dir,W=this.props,de=W.stopPropagation,ue=W.swipingThumbnailTransitionDuration,fe=this.state,Y=fe.thumbsSwipedTranslate,Q=fe.thumbnailsWrapperHeight,ee=fe.thumbnailsWrapperWidth,oe=fe.swipingUpDown,pe=fe.swipingLeftRight;if(this.isThumbnailVertical()){if((q===$e||q===nt||pe)&&!oe)return void(pe||this.setState({swipingLeftRight:!0}));q!==Tt&&q!==st||oe||this.setState({swipingUpDown:!0})}else{if((q===Tt||q===st||oe)&&!pe)return void(oe||this.setState({swipingUpDown:!0}));q!==$e&&q!==nt||pe||this.setState({swipingLeftRight:!0})}var be,Ne,ct,rt,He,_e=this.thumbnails&&this.thumbnails.current;if(this.isThumbnailVertical()?(be=Y+(q===st?$:-$),Ne=_e.scrollHeight-Q+20,ct=Math.abs(be)>Ne,rt=be>20,He=_e.scrollHeight<=Q):(be=Y+(q===nt?R:-R),Ne=_e.scrollWidth-ee+20,ct=Math.abs(be)>Ne,rt=be>20,He=_e.scrollWidth<=ee),!He&&(q!==$e&&q!==Tt||!ct)&&(q!==nt&&q!==st||!rt)){de&&g.stopPropagation();var xe={transition:"transform ".concat(ue,"ms ease-out")};this.setState({thumbsTranslate:be,thumbsStyle:xe})}}},{key:"handleOnThumbnailSwiped",value:function(){var v=this.state.thumbsTranslate,g=this.props.slideDuration;this.resetSwipingDirection(),this.setState({isSwipingThumbnail:!0,thumbsSwipedTranslate:v,thumbsStyle:{transition:"all ".concat(g,"ms ease-out")}})}},{key:"sufficientSwipe",value:function(){var v=this.state.currentSlideOffset,g=this.props.swipeThreshold;return Math.abs(v)>g}},{key:"resetSwipingDirection",value:function(){var v=this.state,g=v.swipingUpDown,R=v.swipingLeftRight;g&&this.setState({swipingUpDown:!1}),R&&this.setState({swipingLeftRight:!1})}},{key:"handleOnSwiped",value:function(v){var g=v.event,R=v.dir,$=v.velocity,q=this.props,W=q.disableSwipe,de=q.stopPropagation,ue=q.flickThreshold;if(!W){var fe=this.props.isRTL;de&&g.stopPropagation(),this.resetSwipingDirection();var Y=(R===$e?1:-1)*(fe?-1:1),Q=$>ue&&!(R===Tt||R===st);this.handleOnSwipedTo(Y,Q)}}},{key:"handleOnSwipedTo",value:function(v,g){var R=this.state,$=R.currentIndex,q=R.isTransitioning,W=$;!this.sufficientSwipe()&&!g||q||(W+=v),(v===-1&&!this.canSlideLeft()||v===1&&!this.canSlideRight())&&(W=$),this.unthrottledSlideToIndex(W)}},{key:"handleTouchMove",value:function(v){this.state.swipingLeftRight&&v.preventDefault()}},{key:"handleMouseDown",value:function(){this.imageGallery.current.classList.add("image-gallery-using-mouse")}},{key:"handleKeyDown",value:function(v){var g=this.props,R=g.disableKeyDown,$=g.useBrowserFullscreen,q=this.state.isFullscreen;if(this.imageGallery.current.classList.remove("image-gallery-using-mouse"),!R)switch(parseInt(v.keyCode||v.which||0,10)){case 37:this.canSlideLeft()&&!this.playPauseIntervalId&&this.slideLeft(v);break;case 39:this.canSlideRight()&&!this.playPauseIntervalId&&this.slideRight(v);break;case 27:q&&!$&&this.exitFullScreen()}}},{key:"handleImageError",value:function(v){var g=this.props.onErrorImageURL;g&&v.target.src.indexOf(g)===-1&&(v.target.src=g)}},{key:"removeThumbnailsResizeObserver",value:function(){this.resizeThumbnailWrapperObserver&&this.thumbnailsWrapper&&this.thumbnailsWrapper.current&&(this.resizeThumbnailWrapperObserver.unobserve(this.thumbnailsWrapper.current),this.resizeThumbnailWrapperObserver=null)}},{key:"removeResizeObserver",value:function(){this.resizeSlideWrapperObserver&&this.imageGallerySlideWrapper&&this.imageGallerySlideWrapper.current&&(this.resizeSlideWrapperObserver.unobserve(this.imageGallerySlideWrapper.current),this.resizeSlideWrapperObserver=null),this.removeThumbnailsResizeObserver()}},{key:"handleResize",value:function(){var v=this.state.currentIndex;this.imageGallery&&(this.imageGallery&&this.imageGallery.current&&this.setState({galleryWidth:this.imageGallery.current.offsetWidth}),this.imageGallerySlideWrapper&&this.imageGallerySlideWrapper.current&&this.setState({gallerySlideWrapperHeight:this.imageGallerySlideWrapper.current.offsetHeight}),this.setThumbsTranslate(-this.getThumbsTranslate(v)))}},{key:"initSlideWrapperResizeObserver",value:function(v){var g=this;v&&!v.current||(this.resizeSlideWrapperObserver=new rn(ne(function(R){R&&R.forEach(function($){g.setState({thumbnailsWrapperWidth:$.contentRect.width},g.handleResize)})},50)),this.resizeSlideWrapperObserver.observe(v.current))}},{key:"initThumbnailWrapperResizeObserver",value:function(v){var g=this;v&&!v.current||(this.resizeThumbnailWrapperObserver=new rn(ne(function(R){R&&R.forEach(function($){g.setState({thumbnailsWrapperHeight:$.contentRect.height},g.handleResize)})},50)),this.resizeThumbnailWrapperObserver.observe(v.current))}},{key:"toggleFullScreen",value:function(){this.state.isFullscreen?this.exitFullScreen():this.fullScreen()}},{key:"togglePlay",value:function(){this.playPauseIntervalId?this.pause():this.play()}},{key:"handleScreenChange",value:function(){var v=this.props,g=v.onScreenChange,R=v.useBrowserFullscreen,$=document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement,q=this.imageGallery.current===$;g&&g(q),R&&this.setState({isFullscreen:q})}},{key:"slideToIndex",value:function(v,g){var R=this.state,$=R.currentIndex,q=R.isTransitioning,W=this.props,de=W.items,ue=W.slideDuration,fe=W.onBeforeSlide;if(!q){g&&this.playPauseIntervalId&&(this.pause(!1),this.play(!1));var Y=de.length-1,Q=v;v<0?Q=Y:v>Y&&(Q=0),fe&&Q!==$&&fe(Q),this.setState({previousIndex:$,currentIndex:Q,isTransitioning:Q!==$,currentSlideOffset:0,slideStyle:{transition:"all ".concat(ue,"ms ease-out")}},this.onSliding)}}},{key:"slideLeft",value:function(v){var g=this.props.isRTL;this.slideTo(v,g?"right":"left")}},{key:"slideRight",value:function(v){var g=this.props.isRTL;this.slideTo(v,g?"left":"right")}},{key:"slideTo",value:function(v,g){var R=this.state,$=R.currentIndex,q=R.isTransitioning,W=this.props.items,de=$+(g==="left"?-1:1);q||(W.length===2?this.slideToIndexWithStyleReset(de,v):this.slideToIndex(de,v))}},{key:"slideToIndexWithStyleReset",value:function(v,g){var R=this,$=this.state,q=$.currentIndex,W=$.currentSlideOffset;this.setState({currentSlideOffset:W+(q>v?.001:-.001),slideStyle:{transition:"none"}},function(){window.setTimeout(function(){return R.slideToIndex(v,g)},25)})}},{key:"handleThumbnailMouseOver",value:function(v,g){this.props.slideOnThumbnailOver&&this.onThumbnailMouseOver(v,g)}},{key:"handleThumbnailKeyUp",value:function(v,g){So(v)&&this.onThumbnailClick(v,g)}},{key:"handleSlideKeyUp",value:function(v){So(v)&&(0,this.props.onClick)(v)}},{key:"isThumbnailVertical",value:function(){var v=this.props.thumbnailPosition;return v==="left"||v==="right"}},{key:"addScreenChangeEvent",value:function(){var v=this;ar.forEach(function(g){document.addEventListener(g,v.handleScreenChange)})}},{key:"removeScreenChangeEvent",value:function(){var v=this;ar.forEach(function(g){document.removeEventListener(g,v.handleScreenChange)})}},{key:"fullScreen",value:function(){var v=this.props.useBrowserFullscreen,g=this.imageGallery.current;v?g.requestFullscreen?g.requestFullscreen():g.msRequestFullscreen?g.msRequestFullscreen():g.mozRequestFullScreen?g.mozRequestFullScreen():g.webkitRequestFullscreen?g.webkitRequestFullscreen():this.setModalFullscreen(!0):this.setModalFullscreen(!0),this.setState({isFullscreen:!0})}},{key:"exitFullScreen",value:function(){var v=this.state.isFullscreen,g=this.props.useBrowserFullscreen;v&&(g?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen?document.msExitFullscreen():this.setModalFullscreen(!1):this.setModalFullscreen(!1),this.setState({isFullscreen:!1}))}},{key:"pauseOrPlay",value:function(){var v=this.props.infinite,g=this.state.currentIndex;v||this.canSlideRight()?this.slideToIndex(g+1):this.pause()}},{key:"play",value:function(){var v=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],g=this.props,R=g.onPlay,$=g.slideInterval,q=g.slideDuration,W=this.state.currentIndex;this.playPauseIntervalId||(this.setState({isPlaying:!0}),this.playPauseIntervalId=window.setInterval(this.pauseOrPlay,Math.max($,q)),R&&v&&R(W))}},{key:"pause",value:function(){var v=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],g=this.props.onPause,R=this.state.currentIndex;this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null,this.setState({isPlaying:!1}),g&&v&&g(R))}},{key:"isImageLoaded",value:function(v){return!!this.loadedImages[v.original]||(this.loadedImages[v.original]=!0,!1)}},{key:"handleImageLoaded",value:function(v,g){var R=this.props.onImageLoad;!this.loadedImages[g]&&R&&(this.loadedImages[g]=!0,R(v))}},{key:"renderItem",value:function(v){var g=this.state.isFullscreen,R=this.props.onImageError||this.handleImageError;return l().createElement(P,{description:v.description,fullscreen:v.fullscreen,handleImageLoaded:this.handleImageLoaded,isFullscreen:g,onImageError:R,original:v.original,originalAlt:v.originalAlt,originalHeight:v.originalHeight,originalWidth:v.originalWidth,originalTitle:v.originalTitle,sizes:v.sizes,loading:v.loading,srcSet:v.srcSet})}},{key:"renderThumbInner",value:function(v){var g=this.props.onThumbnailError||this.handleImageError;return l().createElement("span",{className:"image-gallery-thumbnail-inner"},l().createElement("img",{className:"image-gallery-thumbnail-image",src:v.thumbnail,height:v.thumbnailHeight,width:v.thumbnailWidth,alt:v.thumbnailAlt,title:v.thumbnailTitle,loading:v.thumbnailLoading,onError:g}),v.thumbnailLabel&&l().createElement("div",{className:"image-gallery-thumbnail-label"},v.thumbnailLabel))}},{key:"render",value:function(){var v=this.state,g=v.currentIndex,R=v.isFullscreen,$=v.modalFullscreen,q=v.isPlaying,W=this.props,de=W.additionalClass,ue=W.disableThumbnailSwipe,fe=W.indexSeparator,Y=W.isRTL,Q=W.items,ee=W.thumbnailPosition,oe=W.renderFullscreenButton,pe=W.renderCustomControls,be=W.renderLeftNav,Ne=W.renderRightNav,ct=W.showBullets,rt=W.showFullscreenButton,He=W.showIndex,_e=W.showThumbnails,xe=W.showNav,Ht=W.showPlayButton,Un=W.renderPlayPauseButton,Wn=this.getThumbnailStyle(),Ft=this.getSlideItems(),dn=Ft.slides,Ot=Ft.thumbnails,In=Ft.bullets,zn=f("image-gallery-slide-wrapper",this.getThumbnailPositionClassName(ee),{"image-gallery-rtl":Y}),Rn=l().createElement("div",{ref:this.imageGallerySlideWrapper,className:zn},pe&&pe(),this.canSlide()?l().createElement(l().Fragment,null,xe&&l().createElement(l().Fragment,null,be(this.slideLeft,!this.canSlideLeft()),Ne(this.slideRight,!this.canSlideRight())),l().createElement(Bn,{className:"image-gallery-swipe",delta:0,onSwiping:this.handleSwiping,onSwiped:this.handleOnSwiped},l().createElement("div",{className:"image-gallery-slides"},dn))):l().createElement("div",{className:"image-gallery-slides"},dn),Ht&&Un(this.togglePlay,q),ct&&l().createElement("div",{className:"image-gallery-bullets"},l().createElement("div",{className:"image-gallery-bullets-container",role:"navigation","aria-label":"Bullet Navigation"},In)),rt&&oe(this.toggleFullScreen,R),He&&l().createElement("div",{className:"image-gallery-index"},l().createElement("span",{className:"image-gallery-index-current"},g+1),l().createElement("span",{className:"image-gallery-index-separator"},fe),l().createElement("span",{className:"image-gallery-index-total"},Q.length))),qn=f("image-gallery",de,{"fullscreen-modal":$}),ut=f("image-gallery-content",this.getThumbnailPositionClassName(ee),{fullscreen:R}),Rl=f("image-gallery-thumbnails-wrapper",this.getThumbnailPositionClassName(ee),{"thumbnails-wrapper-rtl":!this.isThumbnailVertical()&&Y},{"thumbnails-swipe-horizontal":!this.isThumbnailVertical()&&!ue},{"thumbnails-swipe-vertical":this.isThumbnailVertical()&&!ue});return l().createElement("div",{ref:this.imageGallery,className:qn,"aria-live":"polite"},l().createElement("div",{className:ut},(ee==="bottom"||ee==="right")&&Rn,_e&&Ot.length>0?l().createElement(Bn,{className:Rl,delta:0,onSwiping:!ue&&this.handleThumbnailSwiping,onSwiped:!ue&&this.handleOnThumbnailSwiped},l().createElement("div",{className:"image-gallery-thumbnails",ref:this.thumbnailsWrapper,style:this.getThumbnailBarHeight()},l().createElement("nav",{ref:this.thumbnails,className:"image-gallery-thumbnails-container",style:Wn,"aria-label":"Thumbnail Navigation"},Ot))):null,(ee==="top"||ee==="left")&&Rn))}}],E&&On(p.prototype,E),Object.defineProperty(p,"prototype",{writable:!1}),ge}(l().Component);Dr.propTypes={flickThreshold:C.number,items:(0,C.arrayOf)((0,C.shape)({bulletClass:C.string,bulletOnClick:C.func,description:C.string,original:C.string,originalHeight:C.number,originalWidth:C.number,loading:C.string,thumbnailHeight:C.number,thumbnailWidth:C.number,thumbnailLoading:C.string,fullscreen:C.string,originalAlt:C.string,originalTitle:C.string,thumbnail:C.string,thumbnailAlt:C.string,thumbnailLabel:C.string,thumbnailTitle:C.string,originalClass:C.string,thumbnailClass:C.string,renderItem:C.func,renderThumbInner:C.func,imageSet:Ol,srcSet:C.string,sizes:C.string})).isRequired,showNav:C.bool,autoPlay:C.bool,lazyLoad:C.bool,infinite:C.bool,showIndex:C.bool,showBullets:C.bool,showThumbnails:C.bool,showPlayButton:C.bool,showFullscreenButton:C.bool,disableThumbnailScroll:C.bool,disableKeyDown:C.bool,disableSwipe:C.bool,disableThumbnailSwipe:C.bool,useBrowserFullscreen:C.bool,onErrorImageURL:C.string,indexSeparator:C.string,thumbnailPosition:(0,C.oneOf)(["top","bottom","left","right"]),startIndex:C.number,slideDuration:C.number,slideInterval:C.number,slideOnThumbnailOver:C.bool,swipeThreshold:C.number,swipingTransitionDuration:C.number,swipingThumbnailTransitionDuration:C.number,onSlide:C.func,onBeforeSlide:C.func,onScreenChange:C.func,onPause:C.func,onPlay:C.func,onClick:C.func,onImageLoad:C.func,onImageError:C.func,onTouchMove:C.func,onTouchEnd:C.func,onTouchStart:C.func,onMouseOver:C.func,onMouseLeave:C.func,onBulletClick:C.func,onThumbnailError:C.func,onThumbnailClick:C.func,renderCustomControls:C.func,renderLeftNav:C.func,renderRightNav:C.func,renderPlayPauseButton:C.func,renderFullscreenButton:C.func,renderItem:C.func,renderThumbInner:C.func,stopPropagation:C.bool,additionalClass:C.string,useTranslate3D:C.bool,isRTL:C.bool,useWindowKeyDown:C.bool},Dr.defaultProps={onErrorImageURL:"",additionalClass:"",showNav:!0,autoPlay:!1,lazyLoad:!1,infinite:!0,showIndex:!1,showBullets:!1,showThumbnails:!0,showPlayButton:!0,showFullscreenButton:!0,disableThumbnailScroll:!1,disableKeyDown:!1,disableSwipe:!1,disableThumbnailSwipe:!1,useTranslate3D:!0,isRTL:!1,useBrowserFullscreen:!0,flickThreshold:.4,stopPropagation:!1,indexSeparator:" / ",thumbnailPosition:"bottom",startIndex:0,slideDuration:450,swipingTransitionDuration:0,swipingThumbnailTransitionDuration:0,onSlide:null,onBeforeSlide:null,onScreenChange:null,onPause:null,onPlay:null,onClick:null,onImageLoad:null,onImageError:null,onTouchMove:null,onTouchEnd:null,onTouchStart:null,onMouseOver:null,onMouseLeave:null,onBulletClick:null,onThumbnailError:null,onThumbnailClick:null,renderCustomControls:null,renderThumbInner:null,renderItem:null,slideInterval:3e3,slideOnThumbnailOver:!1,swipeThreshold:30,renderLeftNav:function(b,p){return l().createElement(Mn,{onClick:b,disabled:p})},renderRightNav:function(b,p){return l().createElement(at,{onClick:b,disabled:p})},renderPlayPauseButton:function(b,p){return l().createElement(Gt,{onClick:b,isPlaying:p})},renderFullscreenButton:function(b,p){return l().createElement(Ye,{onClick:b,isFullscreen:p})},useWindowKeyDown:!0};const Il=Dr})(),a})())})(cl);var dp=cl.exports;const hp=Oi(dp);function fp(){var e=new Map;function t(n){var r=n.root,i=n.rootMargin,s=n.threshold,a=e.get(r);a||(a=new Map,e.set(r,a));var c=JSON.stringify({rootMargin:i,threshold:s}),f=a.get(c);if(!f){var y=new Map,l=new IntersectionObserver(function(u){u.forEach(function(k){var m=y.get(k.target);m==null||m(k)})},{root:r,rootMargin:i,threshold:s});f={observer:l,entryCallbacks:y},a.set(c,f)}return{observe:function(k,m){var S,j;(S=f)==null||S.entryCallbacks.set(k,m),(j=f)==null||j.observer.observe(k)},unobserve:function(k){var m,S;(m=f)==null||m.entryCallbacks.delete(k),(S=f)==null||S.observer.unobserve(k)}}}return{getObserver:t}}var pp="0px",mp=[0],gp=fp();function vp(e){var t,n,r=(t=e==null?void 0:e.rootMargin)!=null?t:pp,i=(n=e==null?void 0:e.threshold)!=null?n:mp,s=A.useRef(null),a=A.useRef(null),c=A.useRef(null),f=A.useState(),y=f[0],l=f[1],u=A.useCallback(function(){var j=s.current;if(!j){l(void 0);return}var D=gp.getObserver({root:a.current,rootMargin:r,threshold:i});D.observe(j,function(L){l(L)}),c.current=D},[r,i]),k=A.useCallback(function(){var j=c.current,D=s.current;D&&(j==null||j.unobserve(D)),c.current=null},[]),m=A.useCallback(function(j){k(),s.current=j,u()},[u,k]),S=A.useCallback(function(j){k(),a.current=j,u()},[u,k]);return[m,{entry:y,rootRef:S}]}function xi(){return xi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xi.apply(this,arguments)}function yp(e){var t,n=vp(e),r=n[0],i=n[1],s=!!((t=i.entry)!=null&&t.isIntersecting),a=A.useState(s),c=a[0],f=a[1];return s&&!c&&f(!0),[r,xi({},i,{isVisible:s,wasEverVisible:c})]}var bp=100;function xp(e){var t=e.loading,n=e.hasNextPage,r=e.onLoadMore,i=e.rootMargin,s=e.disabled,a=e.delayInMs,c=a===void 0?bp:a,f=yp({rootMargin:i}),y=f[0],l=f[1],u=l.rootRef,k=l.isVisible,m=!s&&!t&&k&&n;return A.useEffect(function(){if(m){var S=setTimeout(function(){r()},c);return function(){clearTimeout(S)}}},[r,m,c]),[y,{rootRef:u}]}const wp={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/>'},Ep={width:24,height:24,body:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M0 0h24v24H0z"/><path fill="currentColor" d="M18.333 2c1.96 0 3.56 1.537 3.662 3.472l.005.195v12.666c0 1.96-1.537 3.56-3.472 3.662l-.195.005H5.667a3.667 3.667 0 0 1-3.662-3.472L2 18.333V5.667c0-1.96 1.537-3.56 3.472-3.662L5.667 2h12.666zm-2.626 7.293a1 1 0 0 0-1.414 0L11 12.585l-1.293-1.292l-.094-.083a1 1 0 0 0-1.32 1.497l2 2l.094.083a1 1 0 0 0 1.32-.083l4-4l.083-.094a1 1 0 0 0-.083-1.32z"/></g>'},Sp={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18 6L6 18M6 6l12 12"/>'};var Vr=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function Xr(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r):e.attachEvent&&e.attachEvent("on".concat(t),function(){n(window.event)})}function ul(e,t){for(var n=t.slice(0,t.length-1),r=0;r<n.length;r++)n[r]=e[n[r].toLowerCase()];return n}function dl(e){typeof e!="string"&&(e=""),e=e.replace(/\s/g,"");for(var t=e.split(","),n=t.lastIndexOf("");n>=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}function Tp(e,t){for(var n=e.length>=t.length?e:t,r=e.length>=t.length?t:e,i=!0,s=0;s<n.length;s++)r.indexOf(n[s])===-1&&(i=!1);return i}var mo={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":Vr?173:189,"=":Vr?61:187,";":Vr?59:186,"'":222,"[":219,"]":221,"\\":220},Yt={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},wi={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},Ve={16:!1,18:!1,17:!1,91:!1},Fe={};for(var dr=1;dr<20;dr++)mo["f".concat(dr)]=111+dr;var Re=[],ps=!1,hl="all",fl=[],Ar=function(t){return mo[t.toLowerCase()]||Yt[t.toLowerCase()]||t.toUpperCase().charCodeAt(0)};function pl(e){hl=e||"all"}function rr(){return hl||"all"}function jp(){return Re.slice(0)}function kp(e){var t=e.target||e.srcElement,n=t.tagName,r=!0;return(t.isContentEditable||(n==="INPUT"||n==="TEXTAREA"||n==="SELECT")&&!t.readOnly)&&(r=!1),r}function Op(e){return typeof e=="string"&&(e=Ar(e)),Re.indexOf(e)!==-1}function Ip(e,t){var n,r;e||(e=rr());for(var i in Fe)if(Object.prototype.hasOwnProperty.call(Fe,i))for(n=Fe[i],r=0;r<n.length;)n[r].scope===e?n.splice(r,1):r++;rr()===e&&pl(t||"all")}function Rp(e){var t=e.keyCode||e.which||e.charCode,n=Re.indexOf(t);if(n>=0&&Re.splice(n,1),e.key&&e.key.toLowerCase()==="meta"&&Re.splice(0,Re.length),(t===93||t===224)&&(t=91),t in Ve){Ve[t]=!1;for(var r in Yt)Yt[r]===t&&(pt[r]=!1)}}function Cp(e){if(typeof e>"u")Object.keys(Fe).forEach(function(a){return delete Fe[a]});else if(Array.isArray(e))e.forEach(function(a){a.key&&Yr(a)});else if(typeof e=="object")e.key&&Yr(e);else if(typeof e=="string"){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=n[0],s=n[1];typeof i=="function"&&(s=i,i=""),Yr({key:e,scope:i,method:s,splitKey:"+"})}}var Yr=function(t){var n=t.key,r=t.scope,i=t.method,s=t.splitKey,a=s===void 0?"+":s,c=dl(n);c.forEach(function(f){var y=f.split(a),l=y.length,u=y[l-1],k=u==="*"?"*":Ar(u);if(Fe[k]){r||(r=rr());var m=l>1?ul(Yt,y):[];Fe[k]=Fe[k].filter(function(S){var j=i?S.method===i:!0;return!(j&&S.scope===r&&Tp(S.mods,m))})}})};function ms(e,t,n,r){if(t.element===r){var i;if(t.scope===n||t.scope==="all"){i=t.mods.length>0;for(var s in Ve)Object.prototype.hasOwnProperty.call(Ve,s)&&(!Ve[s]&&t.mods.indexOf(+s)>-1||Ve[s]&&t.mods.indexOf(+s)===-1)&&(i=!1);(t.mods.length===0&&!Ve[16]&&!Ve[18]&&!Ve[17]&&!Ve[91]||i||t.shortcut==="*")&&t.method(e,t)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}}function gs(e,t){var n=Fe["*"],r=e.keyCode||e.which||e.charCode;if(pt.filter.call(this,e)){if((r===93||r===224)&&(r=91),Re.indexOf(r)===-1&&r!==229&&Re.push(r),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(S){var j=wi[S];e[S]&&Re.indexOf(j)===-1?Re.push(j):!e[S]&&Re.indexOf(j)>-1?Re.splice(Re.indexOf(j),1):S==="metaKey"&&e[S]&&Re.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(Re=Re.slice(Re.indexOf(j))))}),r in Ve){Ve[r]=!0;for(var i in Yt)Yt[i]===r&&(pt[i]=!0);if(!n)return}for(var s in Ve)Object.prototype.hasOwnProperty.call(Ve,s)&&(Ve[s]=e[wi[s]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(Re.indexOf(17)===-1&&Re.push(17),Re.indexOf(18)===-1&&Re.push(18),Ve[17]=!0,Ve[18]=!0);var a=rr();if(n)for(var c=0;c<n.length;c++)n[c].scope===a&&(e.type==="keydown"&&n[c].keydown||e.type==="keyup"&&n[c].keyup)&&ms(e,n[c],a,t);if(r in Fe){for(var f=0;f<Fe[r].length;f++)if((e.type==="keydown"&&Fe[r][f].keydown||e.type==="keyup"&&Fe[r][f].keyup)&&Fe[r][f].key){for(var y=Fe[r][f],l=y.splitKey,u=y.key.split(l),k=[],m=0;m<u.length;m++)k.push(Ar(u[m]));k.sort().join("")===Re.sort().join("")&&ms(e,y,a,t)}}}}function Pp(e){return fl.indexOf(e)>-1}function pt(e,t,n){Re=[];var r=dl(e),i=[],s="all",a=document,c=0,f=!1,y=!0,l="+",u=!1;for(n===void 0&&typeof t=="function"&&(n=t),Object.prototype.toString.call(t)==="[object Object]"&&(t.scope&&(s=t.scope),t.element&&(a=t.element),t.keyup&&(f=t.keyup),t.keydown!==void 0&&(y=t.keydown),t.capture!==void 0&&(u=t.capture),typeof t.splitKey=="string"&&(l=t.splitKey)),typeof t=="string"&&(s=t);c<r.length;c++)e=r[c].split(l),i=[],e.length>1&&(i=ul(Yt,e)),e=e[e.length-1],e=e==="*"?"*":Ar(e),e in Fe||(Fe[e]=[]),Fe[e].push({keyup:f,keydown:y,scope:s,mods:i,shortcut:r[c],method:n,key:r[c],splitKey:l,element:a});typeof a<"u"&&!Pp(a)&&window&&(fl.push(a),Xr(a,"keydown",function(k){gs(k,a)},u),ps||(ps=!0,Xr(window,"focus",function(){Re=[]},u)),Xr(a,"keyup",function(k){gs(k,a),Rp(k)},u))}function Lp(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(Fe).forEach(function(n){var r=Fe[n].find(function(i){return i.scope===t&&i.shortcut===e});r&&r.method&&r.method()})}var Qr={setScope:pl,getScope:rr,deleteScope:Ip,getPressedKeyCodes:jp,isPressed:Op,filter:kp,trigger:Lp,unbind:Cp,keyMap:mo,modifier:Yt,modifierMap:wi};for(var Jr in Qr)Object.prototype.hasOwnProperty.call(Qr,Jr)&&(pt[Jr]=Qr[Jr]);if(typeof window<"u"){var _p=window.hotkeys;pt.noConflict=function(e){return e&&window.hotkeys===pt&&(window.hotkeys=_p),pt},window.hotkeys=pt}pt.filter=function(){return!0};var ml=function(t,n){var r=t.target,i=r&&r.tagName;return!!(i&&n&&n.includes(i))},Np=function(t){return ml(t,["INPUT","TEXTAREA","SELECT"])};function Ap(e,t,n,r){n instanceof Array&&(r=n,n=void 0);var i=n||{},s=i.enableOnTags,a=i.filter,c=i.keyup,f=i.keydown,y=i.filterPreventDefault,l=y===void 0?!0:y,u=i.enabled,k=u===void 0?!0:u,m=i.enableOnContentEditable,S=m===void 0?!1:m,j=A.useRef(null),D=A.useCallback(function(L,M){var K,G;return a&&!a(L)?!l:Np(L)&&!ml(L,s)||(K=L.target)!=null&&K.isContentEditable&&!S?!0:j.current===null||document.activeElement===j.current||(G=j.current)!=null&&G.contains(document.activeElement)?(t(L,M),!0):!1},r?[j,s,a].concat(r):[j,s,a]);return A.useEffect(function(){if(!k){pt.unbind(e,D);return}return c&&f!==!0&&(n.keydown=!1),pt(e,n||{},D),function(){return pt.unbind(e,D)}},[D,e,k]),j}pt.isPressed;const gl=A.createContext({open:!1,toggleOpen:e=>{}});function Dp({children:e}){const[t,n]=A.useState(!1),r=s=>{n(s??!s)},i=A.useMemo(()=>({open:t,toggleOpen:r}),[t]);return o.jsx(gl.Provider,{value:i,children:e})}function go(){return A.useContext(gl)}const vt={nameAsc:"title",nameDesc:"title",popularity:"stats.downloads",publishAt:"lastPublishedAt",mobilePageSize:10,pageSize:18,currentPage:1,defaultCurrentPage:1,blockletsPath:"/api/v2/blocklets.json",categoriesPath:"/api/blocklets/categories",explorePath:"/api/blocklets/explore",exploreDidsPath:"/api/blocklets/dids",cacheSize:100},Mp=e=>or(async()=>{const{data:t}=await e.get(vt.categoriesPath);return Array.isArray(t)?t:[]},{manual:!0});function Fp(e,t){const n=e.menu?{sortBy:"popularity",sortDirection:"desc",showResources:"true",...jc(e,["sortBy","sortDirection","showResources"])}:{sortBy:"popularity",sortDirection:"desc",showResources:"true",...e,menu:void 0},{onFilterChange:r,onSearchSelect:i=c=>{t.onFilterChange({...n,keyword:c.title})},emptyCategory:s}=t;!n.category&&!s&&(n.category="All");const a=c=>{const f={...n,...c};r(Mr(f,y=>y===""||y===void 0))};return{filters:e,cleanFilter:c=>{const f=c?Mr(n,(y,l)=>c.includes(l)):{};r(Mr(f,y=>y===""||y===void 0))},handleActiveMenu:c=>{c!==e.menu&&r({menu:c})},handleSort:(c,f)=>{a({sortBy:c,sortDirection:f||c==="nameAsc"?"asc":"desc"})},handleKeyword:c=>{a({category:void 0,keyword:c||void 0})},handlePrice:c=>{a({price:c===e.price?void 0:c})},handleCategory:c=>{a({category:c===e.category?"":c})},handleDeveloper:c=>{a({owner:c||void 0})},handlePage:c=>{a({currentPage:c})},handleSwitchShowResources:c=>{a({showResources:c})},handleSearchSelect:c=>{i(c)}}}const Bp=(e,t,n)=>e&&t||!n,vl=e=>[{name:e("sort.popularity"),value:"popularity"},{name:e("sort.lastPublished"),value:"publishAt"}],yl=(e,t,n)=>{var r,i;const s=kc(e),a=Oc(s.search);if((r=Ic(e,{strict:!0}))!=null&&r.endsWith(".gif"))return a.imageFilter?Rc({...s,search:""}):e;if(a.imageFilter)return e;const c=n||((i=window.blocklet)==null?void 0:i.version),{w:f,h:y}=typeof t=="object"?{w:t.w,h:t.h}:{w:t,h:t};return kr(e,{...f||y?{imageFilter:"resize",w:f,h:y}:{},v:c})},$p=e=>[{name:e("blocklet.free"),value:"free"},{name:e("blocklet.payment"),value:"payment"}],Up=(e=[],t="en")=>e.map(n=>({name:n.locales[t]||n.locales.en,value:n._id})),Wp=e=>{var t,n;return Array.isArray(e)?e.map(r=>r.message).join(`
|
|
486
|
-
`):(n=(t=e.response)==null?void 0:t.data)!=null&&n.error?e.response.data.error.message||e.response.data.error:e.message||e},zp=(e,t)=>e==null?void 0:e.replace(/{(\w*)}/g,(n,r)=>t.hasOwnProperty(r)?t[r]:""),qp=()=>window.innerWidth<=600,Kp={common:{title:"Blocklet Store",searchStore:"Search Blocklet",showResources:"Show extensions",price:"Price",category:"Category",categories:"Categories",resourceType:"Resource Type",clear:"Clear",cancel:"Cancel",search:"Search",fetchError:"Failed to fetch data, please try again later",searchPlaceholder:"Search blocklet"},explore:{title:"Explore",trending:"Trending",topRated:"Top Rated",recentlyUpdated:"Recently Updated",viewDetail:"View Details"},sort:{sort:"Sort",rating:"Rating",popularity:"Most Popular",lastPublished:"Latest Published"},category:{all:"All",placeholder:"Category name",helperText:"Please select a category"},blocklet:{noResults:"No blocklet found.",free:"Free",search:'Results for "{keyword}"',authorTag:"Blocklet by {name}",resourceTag:"Extensions for {name}",resultCount:"{count} Blocklets",emptyTip:"Tips:",filterTip:"Appropriately reduce the filter conditions",keywordTip:"Try other keywords",owner:"Blocklets from {name}",noBlockletPart1:'No Blocklets associated with"',noBlockletPart2:'"were found',noCategoryResults1:'No "',noCategoryResults2:'" Blocklets'},autocomplete:{expandResult:'View all search results for "{name}"'}},Gp={common:{title:"Blocklet 商店",searchStore:"搜索 Blocklet",showResources:"显示扩展",price:"价格",category:"类别",categories:"类别",resourceType:"资源类型",clear:"清除",cancel:"取消",search:"搜索",fetchError:"获取数据失败, 请稍后再试",searchPlaceholder:"搜索 Blocklet"},explore:{title:"探索",trending:"趋势",topRated:"评分最高",recentlyUpdated:"最近更新",viewDetail:"查看详情"},sort:{sort:"排序",rating:"评分",popularity:"最热门",lastPublished:"最新发布"},category:{all:"全部",placeholder:"分类名称",helperText:"请选择分类"},blocklet:{noResults:"未搜索到 Blocklet",free:"免费",search:'搜索 "{keyword}" 的结果',authorTag:"{name} 的 Blocklet",resourceTag:"{name} 的拓展",resultCount:"{count} 个 Blocklet",emptyTip:"建议:",filterTip:"适当减少筛选条件",keywordTip:"尝试其他关键字",owner:"来自 {name} 的 Blocklets",noBlockletPart1:'没有找到与"',noBlockletPart2:'"相关的 Blocklets',noCategoryResults1:'无 "',noCategoryResults2:'" 类别的 Blocklets'},autocomplete:{expandResult:"查看 “{name}” 的所有搜索结果"}},Zr={en:Io(Kp),zh:Io(Gp)},bl=(e,t)=>{const n={};return e&&(n["x-blocklet-server-version"]=e),t&&(n["x-blocklet-store-version"]=t),n},Hp=e=>(t,n)=>{const r=Zr[e]?Zr[e][t]:Zr.en[t];return zp(r,n)||t},xl={errors:{fetchCategoriesError:null},loadings:{fetchCategoriesLoading:!1},compact:!1,endpoint:"",wrapChildren:()=>null,t:e=>e,storeVersion:"",minItemWidth:350,serverVersion:"",layout:{},selectedCategory:void 0,categoryList:[],blockletRender:()=>null,locale:"en",categoryOptions:[],priceOptions:[],storeApi:null,baseSearch:!1,showResourcesSwitch:!1,showCategory:!1,tagFilters:[],developerName:"",onFilterChange:()=>{},updateDeveloperName:()=>{},getCategoryLocale:()=>null,search:{filters:{},cleanFilter:()=>{},handleActiveMenu:()=>{},handleSort:()=>{},handleKeyword:()=>{},handlePrice:()=>{},handleCategory:()=>{},handleDeveloper:()=>{},handleSwitchShowResources:()=>{},handleSearchSelect:()=>{},handlePage:()=>{}}},wl=A.createContext(xl),{Provider:Vp,Consumer:bg}=wl;function Xp(e){const{locale:t="zh",filters:n={},serverVersion:r="",onFilterChange:i=()=>{},minItemWidth:s=350,queryFilter:a=!0,layout:c={},wrapChildren:f=je=>je,extraFilter:y=je=>je,baseSearch:l=!1,fetchCategoryDelay:u=0,showResourcesSwitch:k=!1,showCategory:m=!0,tagFilters:S=[],children:j,storeVersion:D,onSearchSelect:L=()=>{},endpoint:M,blockletRender:K,compact:G=!1}=e,T=bl(r,D),F=A.useMemo(()=>Us({baseURL:M,headers:T}),[M]),H=Fp(n,{onFilterChange:i,emptyCategory:!c.showExplore,onSearchSelect:L}),[B,ce]=A.useState(""),{data:V=[],error:se,loading:Pe,run:Be}=Mp(F),Ae=A.useMemo(()=>{const je=Tc(V,[Me=>Me.name],["asc"]),Le=je.findIndex(Me=>Me.name==="All"||Me.locales.en==="All");return Le>-1?[{...je[Le],_id:"All"},...je.slice(0,Le),...je.slice(Le+1)]:je},[V]),Je=A.useCallback(Hp(t),[t]),J=A.useMemo(()=>Up(Ae,t),[Ae,t]),me=$p(Je),ne={search:H,compact:G,errors:{fetchCategoriesError:se},loadings:{fetchCategoriesLoading:Pe},extraFilter:y,endpoint:M,queryFilter:a,layout:{showExplore:c.showExplore??!1,showCategory:c.showCategory??!0,showTitle:c.showTitle??!0,showSearch:c.showSearch??!0},minItemWidth:s,wrapChildren:f,t:Je,storeVersion:D,serverVersion:r,selectedCategory:H.filters.category||(c.showExplore?"":"All"),categoryList:Ae,blockletRender:K,locale:t,categoryOptions:J,priceOptions:me,storeApi:F,baseSearch:l,showResourcesSwitch:k,showCategory:m,tagFilters:S,onFilterChange:i,getCategoryLocale:je=>{if(!je)return null;const Le=V.find(Me=>Me._id===je||Me.locales.en==="All");return Le?Le.locales[t]||Le.locales.en:null},get developerName(){return B},updateDeveloperName:ce};return A.useEffect(()=>{setTimeout(Be,u||0)},[M,Be,u]),o.jsx(Vp,{value:ne,children:j})}function ot(){return A.useContext(wl)||xl}function El({children:e,onClick:t,size:n=32,...r}){return o.jsx(ir,{...r,onClick:t,variant:"outlined",sx:[{minWidth:n,height:n,p:0,borderColor:"divider","&:hover":{borderColor:"divider"},borderRadius:2,color:"text.secondary"},...Array.isArray(r.sx)?r.sx:[r.sx]],children:e})}function hr(e,t){return e===void 0?t:e}function vo({xs:e,sm:t,md:n,lg:r,xl:i,exact:s}){const a=Qt(),c=Xt(a.breakpoints.down("sm")),f=Xt(a.breakpoints.between("sm","md")),y=Xt(a.breakpoints.between("md","lg")),l=Xt(a.breakpoints.between("lg","xl"));if(s)return c?e||null:f?t||null:y?n||null:l?r||null:i||null;let u=e;return c||(u=hr(t,u),f)||(u=hr(n,u),y)||(u=hr(r,u),l)?u:hr(i,u)}function Yp({children:e}){const{open:t,toggleOpen:n}=go();return o.jsx(vo,{xs:o.jsx(Wl,{open:t,onClose:()=>n(!1),children:e}),md:o.jsx(X,{children:e})})}const Qp=A.forwardRef(({loading:e,disabled:t,...n},r)=>o.jsx(ir,{ref:r,disableElevation:!0,disabled:t||e,...n,sx:[{borderRadius:"4px"},...Array.isArray(n.sx)?n.sx:[n.sx]],startIcon:e&&o.jsx(St,{size:"1em"})}));function Ei({value:e,options:t,onChange:n,placeholder:r,...i}){var s;const a=A.useRef(null),c=Qt(),[f,y]=A.useState(!1),[l,u]=A.useState(e!==null?e:""),k=Xt(c.breakpoints.down("sm"));A.useEffect(()=>{u(e!==null?e:"")},[e]);const m=A.useCallback(()=>{y(!1)},[]),S=A.useCallback(()=>{y(!0)},[]);function j(L){u(L.value),n(L.value),k&&m()}function D(L){return L===l}return o.jsxs(o.Fragment,{children:[o.jsxs(Jp,{ref:a,onClick:S,variant:"outlined",size:"medium",className:["my-select__selector",Xn(l)?"":"my-select__selector--active"].join(" "),sx:{minWidth:{xs:"100px",md:"auto"},color:"text.primary",borderRadius:"8px"},...i,children:[((s=t.find(L=>L.value===l))==null?void 0:s.name)||r,o.jsx(ql,{className:"my-select__arrowdown",component:vc,sx:{width:18,height:18}})]}),o.jsx(Kl,{open:f,anchorEl:a.current,transition:!0,sx:{zIndex:"9999"},children:({TransitionProps:L,placement:M})=>o.jsx(Gl,{...L,style:{transformOrigin:M==="bottom"?"center top":"center bottom"},children:o.jsx(Hl,{children:o.jsx(Vl,{onClickAway:m,children:o.jsx(Zp,{autoFocusItem:f,onMouseEnter:S,onMouseLeave:m,children:t.map(K=>o.jsxs(ki,{onClick:()=>j(K),sx:{fontSize:14},children:[o.jsx(qs,{sx:{mr:1,fontSize:16,visibility:D(K.value)?"visible":"hidden"}}),K.name]},K.value))})})})})})]})}const Jp=Jt(Qp)`
|
|
487
|
-
border: 1px solid ${e=>e.theme.palette.divider};
|
|
488
|
-
padding: 6px 8px 6px 12px;
|
|
489
|
-
font-weight: ${e=>e.theme.typography.fontWeightRegular};
|
|
490
|
-
font-size: 14px;
|
|
491
|
-
color: ${e=>e.theme.palette.text.secondary};
|
|
492
|
-
line-height: 1;
|
|
493
|
-
text-transform: none;
|
|
494
|
-
& + & {
|
|
495
|
-
margin-left: 10px;
|
|
496
|
-
}
|
|
497
|
-
&.my-select__selector--active {
|
|
498
|
-
&,
|
|
499
|
-
.my-select__arrowdown,
|
|
500
|
-
}
|
|
501
|
-
.my-select__arrowdown {
|
|
502
|
-
color: ${e=>e.theme.palette.grey[400]};
|
|
503
|
-
font-size: 14px;
|
|
504
|
-
margin-left: 6px;
|
|
505
|
-
}
|
|
506
|
-
.my-select__icon {
|
|
507
|
-
font-size: 0;
|
|
508
|
-
svg {
|
|
509
|
-
color: ${e=>e.theme.palette.grey[400]};
|
|
510
|
-
font-size: 18px;
|
|
511
|
-
margin-right: 3px;
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
`,Zp=Jt(Ns)`
|
|
515
|
-
.my-select__option__icon {
|
|
516
|
-
color: transparent;
|
|
517
|
-
font-size: 14px;
|
|
518
|
-
margin: 0 3px 0 -5px;
|
|
519
|
-
}
|
|
520
|
-
.my-select__option {
|
|
521
|
-
font-size: 14px;
|
|
522
|
-
color: #999;
|
|
523
|
-
}
|
|
524
|
-
.my-select__option--active {
|
|
525
|
-
&,
|
|
526
|
-
.my-select__option__icon {
|
|
527
|
-
color: ${e=>e.theme.palette.primary.main};
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
`;function Sl(){const{search:e,t}=ot(),{filters:n,handleSort:r,handlePrice:i}=e,s=vl(t);return o.jsxs(it,{direction:{xs:"row",md:"column"},alignItems:{xs:"center",md:"flex-start"},gap:{xs:1,md:2},width:{xs:"100%",md:"auto"},justifyContent:"space-between",children:[o.jsx(Ti,{control:o.jsx(ji,{checked:n.price==="free",size:"small",sx:{"& .MuiSvgIcon-fontSizeSmall":{fontSize:16,color:"text.hint"}},onChange:a=>i(a.target.checked?"free":"")}),label:t("blocklet.free")}),o.jsx(Ei,{value:n.sortBy||s[0].value,options:s,onChange:a=>r(a),placeholder:t("sort.sort")})]})}function em({menus:e}){const{selectedCategory:t,search:n,t:r,categoryOptions:i,loadings:s,layout:a,baseSearch:c,compact:f}=ot(),{filters:y,handleActiveMenu:l,handleCategory:u,cleanFilter:k}=n,{toggleOpen:m}=go();A.useEffect(()=>{m(!1)},[Object.values(y).join("")]);const S=Bp(c,a.showSearch,y.keyword);return a.showCategory&&!f?o.jsxs(Yp,{children:[o.jsx(vo,{xs:o.jsxs(it,{direction:"row",justifyContent:"space-between",alignItems:"center",p:2,mb:.5,gap:2,borderBottom:1,borderColor:"divider",children:[o.jsx(El,{onClick:()=>m(!1),children:o.jsx(Ws,{})}),o.jsx(ve,{flex:1,variant:"body1",fontWeight:"fontWeightMedium",children:r("common.category")})]}),md:null}),o.jsx(it,{visibility:s.fetchCategoriesLoading?"hidden":"visible",width:{xs:268,md:200},boxSizing:"content-box",p:{xs:2,md:0},pr:{md:6},children:S?o.jsxs(o.Fragment,{children:[a.showExplore&&o.jsxs(X,{mb:3,pb:3,borderBottom:1,borderColor:"divider",children:[o.jsxs(X,{display:"flex",alignItems:"center",gap:1,children:[o.jsx(Ut,{icon:lf,width:20,height:20}),o.jsx(ve,{variant:"body1",color:!t&&!y.menu?"text.primary":"grey.400",fontWeight:!t&&!y.menu?"fontWeightMedium":void 0,sx:{cursor:"pointer"},onClick:()=>{m(!1),k()},children:r("explore.title")})]}),e==null?void 0:e.map(j=>o.jsxs(X,{display:"flex",alignItems:"center",mt:2,gap:1,children:[typeof j.icon=="string"?o.jsx(Ut,{icon:j.icon,width:20,height:20}):j.icon,o.jsx(ve,{variant:"body1",color:y.menu===j.key?"text.primary":"grey.400",fontWeight:y.menu===j.key?"fontWeightMedium":void 0,sx:{cursor:"pointer"},onClick:()=>{var D;m(!1),l(j.key),(D=j.onClick)==null||D.call(j)},children:j.title})]},j.key))]}),!!i.length&&o.jsx(it,{gap:2,children:i.map(j=>o.jsx(ve,{variant:"body1",title:j.name,sx:{cursor:"pointer"},"data-cy":"filter",color:t===j.value?"text.primary":"grey.400",textTransform:"capitalize",onClick:()=>{t===j.value?k():u(j.value),m(!1)},children:j.name},j.value))})]}):o.jsx(Sl,{})})]}):null}function yo(){const{endpoint:e,serverVersion:t,storeVersion:n}=ot(),r=bl(t,n),i=A.useMemo(()=>Us({baseURL:e,headers:r}),[e]);return{get:async s=>{const{data:a}=await i.get(s);return a},post:async(s,a)=>{const{data:c}=await i.post(s,a);return c}}}const Tl=A.memo(function(e){return o.jsx(X,{height:60,display:"flex",alignItems:"center",justifyContent:"center",...e,children:o.jsx(St,{})})});function vs({icon:e,children:t,maxWidth:n=100,title:r}){return(t===0||t)&&o.jsxs(it,{direction:"row",alignItems:"center",gap:1,sx:{maxWidth:n,overflow:"hidden"},children:[e,o.jsx(ve,{flex:1,variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:r||(typeof t=="string"?t:void 0),children:t})]})}const tm=16/9,ei=292,Si=189,wr=336;function nm(){var e,t;const{t:n,search:r}=ot(),{get:i}=yo(),s=Qt(),a=Xt(s.breakpoints.down("md")),c=((t=(e=window.blocklet)==null?void 0:e.preferences)==null?void 0:t.homeBanner)||[],{data:f=[],error:y,loading:l}=or(async()=>{const L=await i(kr(vt.blockletsPath,{didList:c.map(M=>M.did).join(",")}));return L!=null&&L.dataList?c.map(M=>L.dataList.find(K=>K.did===M.did)):[]});y&&console.error("Get Banner Blocklets error:",y);const u={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:100,cursor:"pointer",color:"text.hint"};return!y&&c.length>0?o.jsxs(o.Fragment,{children:[o.jsx(ve,{component:"h2",variant:"h2",mt:{xs:2,md:0},mb:3,children:n("explore.title")}),o.jsx(X,{height:{xs:"auto",md:ei},minHeight:ei,position:"relative",border:1,borderColor:"divider",borderRadius:3,overflow:"hidden",children:l?o.jsxs(X,{p:5,display:{md:"flex"},gap:5,alignItems:"center",justifyContent:"center",children:[o.jsx(Vt,{variant:"rounded",height:Si,width:wr}),o.jsxs(X,{flex:1,height:"100%",children:[o.jsx(Vt,{variant:"text",height:50,width:100}),o.jsx(Vt,{variant:"text",height:40,width:"100%"}),o.jsx(Vt,{variant:"text",height:40,width:300}),o.jsxs(X,{display:"flex",gap:1,my:2,children:[o.jsx(Vt,{variant:"circular",height:20,width:20}),o.jsx(Vt,{variant:"text",height:20,width:50})]}),o.jsx(Vt,{variant:"rounded",height:30,width:100})]})]}):o.jsx(hp,{showNav:!0,autoPlay:!0,slideDuration:a?500:1e3,slideInterval:5e3,showPlayButton:!1,showIndex:!1,showBullets:!1,showThumbnails:!1,showFullscreenButton:!1,renderLeftNav:L=>o.jsx(X,{onClick:L,sx:{display:{xs:"none",md:"block"}},children:o.jsx(yu,{sx:{...u,left:5}})}),renderRightNav:L=>o.jsx(X,{onClick:L,sx:{display:{xs:"none",md:"block"}},children:o.jsx(bu,{sx:{...u,right:5}})}),items:c.map((L,M)=>({original:L.did,renderItem:()=>{var K;const G=f[M]||{},T=L.cover||im(L.did,(K=G.screenshots)==null?void 0:K[0]),F=yl(T,s.breakpoints.values.md*2);return o.jsxs(it,{height:{xs:"auto",md:ei},sx:{cursor:"pointer","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundImage:`url("${F}")`,backgroundSize:"cover",filter:"blur(50px)",opacity:.15,zIndex:0}},display:"flex",direction:{xs:"column",md:"row"},justifyContent:"center",alignItems:{xs:"flex-start",md:"center"},p:{xs:2,md:5},onClick:()=>r.handleSearchSelect(G),gap:{xs:2,md:5},children:[k(F),o.jsxs(it,{flex:1,height:"100%",gap:3,children:[o.jsxs(X,{flex:1,children:[m(L.name||G.title||L.name),S(L.desc||G.description)]}),G.did&&j(G,L.baseNum),D(G)]})]})}}))})})]}):null;function k(L){return o.jsx(X,{borderRadius:2,overflow:"hidden",position:"relative",width:{xs:"100%",md:wr},children:o.jsx(om,{url:L})})}function m(L){return o.jsx(ve,{variant:"h2",width:"100%",children:L})}function S(L){return o.jsx(ve,{variant:"body2",color:"text.secondary",textAlign:"left",width:"100%",minHeight:70,maxHeight:70,pt:1,sx:{display:"-webkit-box",lineClamp:3,WebkitLineClamp:3,maxHeight:71,textWrap:"wrap",overflow:"hidden",WebkitBoxOrient:"vertical"},children:L})}function j(L,M=0){const{did:K,owner:G,stats:T}=L;return o.jsxs(X,{display:"flex",alignItems:"center",gap:2,color:"text.secondary",children:[o.jsx(vs,{icon:o.jsx(yr,{src:G.avatar,did:K,size:20,variant:"circle"}),children:G.fullName}),o.jsx(vs,{icon:o.jsx(Ut,{icon:Ka}),title:`${T.downloads+M}`,children:rm(T.downloads+M)})]})}function D(L){return o.jsx(ir,{variant:"outlined",size:"small",onClick:()=>r.handleSearchSelect(L),sx:{width:"fit-content",textTransform:"none",borderRadius:1,borderColor:"grey.300","&:hover":{borderColor:"divider"}},children:n("explore.viewDetail")})}}const rm=e=>Number.isNaN(e)?0:e<1e3?e:e<1e6?`${(e/1e3).toFixed(1)}k`:e<1e9?`${(e/1e6).toFixed(1)}m`:`${(e/1e9).toFixed(1)}b`,im=(e,t)=>e&&t?`/assets/${e}/screenshots/${t}`:"";function om({url:e}){const[t,n]=A.useState(!0);return o.jsxs(o.Fragment,{children:[t&&o.jsx(Vt,{variant:"rectangular",sx:{width:{xs:"100%",md:wr},height:{xs:"auto",md:Si}}}),o.jsx(X,{display:t?"none":"block",component:"img",src:e,alt:"",width:{xs:"100%",md:wr},height:{xs:"auto",md:Si},borderRadius:2,border:1,borderColor:"divider",sx:{objectFit:"container",cursor:"pointer",aspectRatio:tm},onLoad:()=>n(!1),onError:()=>n(!1)})]})}function sm({title:e,blocklets:t}){const{blockletRender:n,serverVersion:r}=ot();return o.jsxs(X,{mt:3,children:[o.jsx(ve,{component:"h3",variant:"h3",sx:{mb:2},children:e}),o.jsx(To,{container:!0,spacing:2,boxSizing:"border-box",maxWidth:"calc(100vw - 16px)",children:t.map(i=>o.jsx(To,{item:!0,xs:12,md:6,p:"2px","data-blocklet-did":i.did,children:o.jsx(X,{padding:"1px",children:n({blocklet:i,blocklets:t,serverVersion:r})})},i.did))})]})}function am(){const{get:e}=yo(),{t}=ot(),{data:n=[],error:r,loading:i}=or(async()=>{const s=await e(vt.explorePath);return Array.isArray(s)?s:[]});return r?o.jsx(jr,{error:new Error(`Failed to fetch blocklets from ${vt.explorePath}`)}):i?o.jsx(Tl,{mt:15}):o.jsxs(o.Fragment,{children:[o.jsx(nm,{}),n.map(s=>{var a;return((a=s.blocklets)==null?void 0:a.length)>0?o.jsx(sm,{title:t(`explore.${s.type}`),blocklets:s.blocklets},s.type):null})]})}const ti="__FREE_TEXT__",ys="__NO_RESULT__",ni=40;function jl({endpoint:e,t,locale:n,filters:r,handleKeyword:i,handleSearchSelect:s,...a}){const c=A.useRef(null),f=A.useRef(!1),[y,l]=A.useState(!1),[u,k]=A.useState(""),[m,S]=A.useState(!1),j=yo(),[D,L]=A.useState(!1),M=(a==null?void 0:a.placeholder)||t("common.searchStore"),K=async J=>{L(!0);const me=await j.get(gn(e,kr(vt.blockletsPath,J)));return L(!1),me.dataList||[]},{data:G,run:T}=or(J=>J?K({sortBy:vt.nameDesc,page:1,pageSize:10,keyword:J,showResources:"true"}):Promise.resolve([]),{manual:!0});A.useEffect(()=>{L(!0),T(r.keyword),k(r.keyword||"")},[r.keyword,T]),Ap("ctrl + k, command + k",J=>{var me,ne;return J.stopPropagation(),J.preventDefault(),(ne=(me=c.current)==null?void 0:me.querySelector("input"))==null||ne.focus(),!1},{enableOnTags:["INPUT"]});const F=Xs(J=>T(J),{wait:300}),H={name:ti,title:u,did:""};let B=[];return u&&(D?B=[H]:G!=null&&G.length?B=[H,...G]:B=[{name:ys,title:t("blocklet.noResults"),did:""}]),o.jsxs(o.Fragment,{children:[o.jsxs(zl,{fullScreen:!0,open:m,sx:{display:{md:"none"}},children:[o.jsxs(X,{p:2,pb:0,display:"flex",alignItems:"center",gap:2,children:[o.jsx(As,{fullWidth:!0,sx:{bgcolor:"grey.50",px:1,py:.5,".MuiInputBase-input":{p:1},".MuiOutlinedInput-notchedOutline":{borderRadius:"8px",borderColor:"transparent"},"&&:hover .MuiOutlinedInput-notchedOutline, &&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"divider",borderWidth:"1px"}},autoFocus:!0,placeholder:M,className:"bl-autocomplete-input",value:u,onChange:J=>ce(J.target.value),startAdornment:Ae(m),endAdornment:Je()}),o.jsx(ir,{variant:"outlined",onClick:()=>{S(!1),k(r.keyword||"")},children:t("common.cancel")})]}),o.jsx(Ns,{sx:{p:.5},children:B.map(J=>Pe(J))})]}),o.jsx(X,{sx:{display:{sx:"block",md:"none"},paddingTop:1,opacity:.5},children:o.jsx(Ut,{icon:Br,style:{fontSize:22,color:"inherit"},onClick:()=>S(!0)})}),o.jsx(Os,{ref:c,open:!!u&&y,size:"small",onOpen:()=>l(!0),onClose:(J,me)=>{l(!1),me==="selectOption"&&!f.current&&i(u)},onKeyDown:J=>{J.key==="Enter"&&!u&&V()},disableClearable:!0,inputValue:u,onInputChange:(J,me)=>ce(me),isOptionEqualToValue:(J,me)=>J.name===me.name,getOptionLabel:J=>J.title,getOptionKey:J=>J.name,noOptionsText:t("blocklet.noResults"),autoHighlight:!0,forcePopupIcon:!1,slotProps:{paper:{sx:{mt:.5,minWidth:"100%",width:"fit-content","& > ul":{p:.5}}}},renderInput:J=>o.jsx(Er,{...J,InputProps:{...J.InputProps,autoFocus:!0,placeholder:M,className:"bl-autocomplete-input",value:u,startAdornment:Ae(y),endAdornment:Je()}}),filterOptions:J=>J,...a,options:B,renderOption:(J,me)=>Pe(me),value:H,sx:[{bgcolor:"grey.50",borderRadius:"8px",overflow:"hidden",".MuiOutlinedInput-notchedOutline":{borderRadius:"8px",borderColor:"transparent"},"&&:hover .MuiOutlinedInput-notchedOutline, &&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"divider",borderWidth:"1px"}},...Array.isArray(a.sx)?a.sx:[a.sx]]})]});function ce(J){L(!0),k(J),f.current=!1,F.run(J)}function V(){S(!1),k(""),ce(""),i("")}function se(J){J!=null&&J.did?(S(!1),f.current=!0,k(""),s(J)):J.name===ti&&(S(!1),i(u))}function Pe(J){var me,ne;return o.jsxs(ki,{sx:{display:"flex",alignItems:"center",gap:1,p:1.5,borderRadius:"8px"},onClick:()=>se(J),children:[Be(J),o.jsxs(ve,{variant:"body1",children:[o.jsx(ve,{fontWeight:"fontWeightMedium",display:"flex",alignItems:"center",gap:1,children:J.title}),o.jsx(ve,{sx:{color:"text.hint"},fontSize:"13px",children:((ne=(me=J.category)==null?void 0:me.locales)==null?void 0:ne[n||"en"])||""})]})]},J.did)}function Be(J){if([ti,ys].includes(J.name))return o.jsx(X,{width:ni,p:"6px",display:"flex",justifyContent:"center",alignItems:"center",color:"text.hint",bgcolor:"grey.100",borderRadius:"8px",children:o.jsx(Ut,{icon:Br,style:{fontSize:28}})});let me="";return J.logo&&(me=gn(e,"assets",J.did,yl(J.logo,ni,J.version))),o.jsx(yr,{src:me,size:ni,style:{borderRadius:"8px",overflow:"hidden"}})}function Ae(J=!0){return o.jsx(X,{sx:{display:"flex",pl:.5,alignItems:"center",color:"text.hint"},children:J&&u&&D?o.jsx(St,{color:"inherit",size:16}):o.jsx(Ut,{icon:Br,style:{fontSize:16,cursor:"default"}})})}function Je(){return u?o.jsx(X,{sx:{display:"flex",alignItems:"center",color:"text.hint"},children:o.jsx(Ut,{icon:Sp,style:{fontSize:20,cursor:"pointer",color:"inherit"},onClick:()=>V()})}):null}}function lm({placeholder:e,...t}){const{search:n,t:r}=ot(),{filters:i,handleKeyword:s}=n,[a,c]=A.useState(i.keyword||""),f=Xs(s,{wait:300}),y=k=>{const{value:m}=k.target;c(m),f.run(m)},l=()=>{c(""),s("")};A.useEffect(()=>{c(i.keyword||"")},[i.keyword]);const u=e||r("common.searchPlaceholder");return o.jsx(cm,{inputProps:{"data-cy":"search-blocklet"},startAdornment:o.jsx(ko,{position:"start",children:o.jsx(um,{sx:{fontSize:18,ml:-.5}})}),onChange:y,placeholder:u,value:a,title:u,"data-cy":"search",endAdornment:a&&o.jsx(ko,{position:"end",children:o.jsx(dm,{"data-cy":"search-delete",onClick:l})}),...t})}const cm=Jt(As)`
|
|
531
|
-
background-color: ${e=>e.theme.palette.grey[50]};
|
|
532
|
-
font-size: 14px;
|
|
533
|
-
border-radius: 6px;
|
|
534
|
-
width: 100%;
|
|
535
|
-
.MuiInputBase-input {
|
|
536
|
-
padding: 8px 0 8px 0px;
|
|
537
|
-
}
|
|
538
|
-
.MuiOutlinedInput-notchedOutline {
|
|
539
|
-
border: none;
|
|
540
|
-
}
|
|
541
|
-
.Mui-focused {
|
|
542
|
-
background-color: #f6f6f6;
|
|
543
|
-
.MuiInputBase-input::placeholder {
|
|
544
|
-
color: transparent;
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
`,um=Jt(uc)`
|
|
548
|
-
color: ${e=>e.theme.palette.grey[500]};
|
|
549
|
-
`,dm=Jt(Ws)`
|
|
550
|
-
color: ${e=>e.theme.palette.grey[500]};
|
|
551
|
-
font-size: 16px;
|
|
552
|
-
cursor: pointer;
|
|
553
|
-
`;function hm(){var e;const{search:t,t:n,endpoint:r,locale:i,getCategoryLocale:s,developerName:a,showResourcesSwitch:c,layout:f,baseSearch:y,categoryOptions:l,compact:u}=ot(),{filters:k,handleSort:m,handlePrice:S,handleDeveloper:j,handleSwitchShowResources:D,cleanFilter:L,handleCategory:M}=t,K=vl(n);return o.jsxs(it,{position:"sticky",top:0,zIndex:1e3,className:"filter-bar",direction:{xs:"column",md:"row"},alignItems:{xs:"flex-start",md:"center"},justifyContent:"space-between",gap:2,spacing:{xs:1,md:0},pt:{xs:2,md:0},px:0,pb:u?2:3,sx:{backgroundColor:"background.default"},children:[!u&&o.jsx(ve,{variant:"h2",textTransform:"capitalize",children:s(k.category)}),o.jsxs(it,{flex:1,direction:"row",alignItems:"center",flexWrap:{xs:"wrap",md:"nowrap"},width:"100%",justifyContent:{xs:"flex-start",md:"flex-end"},gap:2,children:[f.showSearch?o.jsx(X,{flex:1,flexBasis:{xs:"100%",md:"auto"},children:y?o.jsx(lm,{}):o.jsx(jl,{locale:i,endpoint:r,sx:{display:{md:"block",xs:"none"},flex:1,mr:1,width:"350px"},t:n,filters:t.filters,handleKeyword:t.handleKeyword,handleSearchSelect:t.handleSearchSelect})}):null,k.owner&&a&&o.jsx(jo,{label:n("blocklet.authorTag",{name:a}),size:"small",onDelete:()=>j("")}),k.resourceDid&&k.resourceBlocklet&&o.jsx(jo,{label:n("blocklet.resourceTag",{name:k.resourceBlocklet}),size:"small",onDelete:()=>L(["resourceDid","resourceBlocklet","showResources"])}),c?o.jsx(bs,{checked:k.showResources!=="false",onChange:G=>D(G?"true":"false"),label:n("common.showResources")}):null,o.jsx(bs,{checked:k.price==="free",onChange:G=>S(G?"free":""),label:n("blocklet.free")}),u&&o.jsx(X,{children:o.jsx(Ei,{value:k.category||((e=l[0])==null?void 0:e.value),options:l,placeholder:n("common.category"),onChange:G=>M(G)})}),o.jsx(Ei,{value:k.sortBy||K[0].value,options:K,placeholder:n("sort.sort"),onChange:G=>m(G)})]})]})}function bs({checked:e,onChange:t,label:n}){const r=Qt();return o.jsx(Ti,{sx:{m:0,p:0},className:"check-button",control:o.jsx(ji,{checked:e,icon:o.jsx(Ut,{style:{padding:0,color:r.palette.text.secondary},icon:wp}),checkedIcon:o.jsx(Ut,{style:{padding:0,color:r.palette.primary.main},icon:Ep}),size:"large",sx:{p:0,mr:1},onChange:i=>t(i.target.checked)}),label:n})}function fr({children:e}){return o.jsxs(X,{display:"flex",mt:2,flexDirection:"column",alignItems:"center",justifyContent:"center",color:"text.hint",children:[o.jsx(hc,{}),e]})}function xs(){const{t:e}=ot();return o.jsx(ve,{style:{textAlign:"center"},variant:"subtitle2",children:e("blocklet.noResults")})}function ri({filterTip:e,keywordTip:t}){const{t:n,locale:r}=ot(),i=()=>r==="zh"?"、":" , ";return o.jsxs(X,{mt:1,display:"flex",children:[o.jsx(ve,{style:{marginRight:"16px"},children:n("blocklet.emptyTip")}),e&&o.jsx(ve,{children:n("blocklet.filterTip")}),e&&t&&i(),t&&o.jsx(ve,{children:n("blocklet.keywordTip")})]})}function ii({primaryStart:e,primaryEnd:t,filter:n}){return o.jsxs(ve,{variant:"subtitle2",display:"flex",gap:.5,mx:.5,children:[o.jsx(ve,{children:e}),o.jsx(ve,{title:n,color:"primary",sx:{maxWidth:"30vw",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n}),o.jsxs(ve,{children:[t," "]})]})}function fm(){const{t:e,search:t,getCategoryLocale:n,selectedCategory:r}=ot(),{filters:i}=t,s=!!r||!!i.price;if(i.keyword&&s)return o.jsxs(fr,{children:[o.jsx(ii,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:i.keyword}),o.jsx(ri,{keywordTip:!0,filterTip:!0})]});if(i.keyword)return o.jsxs(fr,{children:[o.jsx(ii,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:i.keyword}),o.jsx(ri,{keywordTip:!0})]});if(s){const a=n(r);return o.jsxs(fr,{children:[a?o.jsx(ii,{primaryStart:e("blocklet.noCategoryResults1"),primaryEnd:e("blocklet.noCategoryResults2"),filter:a}):o.jsx(xs,{}),o.jsx(ri,{filterTip:!0})]})}return o.jsx(fr,{children:o.jsx(xs,{})})}const pm=(e,t,n,r)=>ru(async i=>{i||(n.currentPage=n.defaultCurrentPage);const{currentPage:s,pageSize:a}=n,c={...t,category:t.category==="All"?"":t.category,sortBy:vt[t.sortBy],page:s,pageSize:a};r(null);const{data:f={}}=await e.get(vt.blockletsPath,{params:c});return n.currentPage++,{page:s,pageSize:a,list:(f==null?void 0:f.dataList)||[],total:(f==null?void 0:f.total)||0}},{isNoMore:i=>i?i.page*i.pageSize>=i.total:!1,reloadDeps:[e,fc(t)],onError:r});function mm(){var e;const{storeApi:t,search:n,extraFilter:r,errors:i,updateDeveloperName:s}=ot(),{filters:a}=n,c=nu({currentPage:vt.currentPage,pageSize:qp()?vt.mobilePageSize:vt.pageSize,defaultCurrentPage:vt.defaultCurrentPage}),[f,y]=A.useState(null),l=pm(t,a,c,y),u=A.useMemo(()=>{var k,m;return r?r(((k=l.data)==null?void 0:k.list)||[]):((m=l.data)==null?void 0:m.list)||[]},[l.data,r]);return A.useEffect(()=>{const k=u.find(m=>m.owner.did===a.owner);s((k==null?void 0:k.owner.fullName)||(k==null?void 0:k.author.name)||"")},[a.owner,u,s]),{blocklets:u,fetchBlockletsError:f,loadMore:l.loadMore,hasNextPage:!l.noMore,total:((e=l.data)==null?void 0:e.total)||0,loadings:{fetchBlockletsLoading:l.loading,loadingMore:l.loadingMore},errors:{...i,fetchBlockletsError:f}}}function gm(){const{t:e,search:t,endpoint:n,blockletRender:r,serverVersion:i,minItemWidth:s,layout:a,baseSearch:c,compact:f}=ot(),{filters:y}=t,{blocklets:l,errors:u,loadMore:k,loadings:m,hasNextPage:S,total:j}=mm(),[D]=xp({loading:m.fetchBlockletsLoading||m.loadingMore,hasNextPage:S,onLoadMore:k});if(u.fetchBlockletsError){const G=new Error(`Failed to fetch blocklets from ${n}: ${Wp(u.fetchBlockletsError)}`);return o.jsx(jr,{error:G})}const L=c&&a.showSearch||!y.keyword;return o.jsxs(o.Fragment,{children:[L?o.jsx(hm,{}):o.jsxs(o.Fragment,{children:[o.jsx(vo,{xs:o.jsx(Sl,{}),md:null}),K()]}),M(),!m.fetchBlockletsLoading&&S&&o.jsx(X,{height:70,minHeight:70,display:"flex",justifyContent:"center",py:2,overflow:"hidden",ref:D,children:m.loadingMore?o.jsx(St,{}):null})]});function M(){return m.fetchBlockletsLoading?o.jsx(Tl,{mt:15}):l.length?o.jsx(X,{className:"blocklet-list",display:"grid",gridTemplateColumns:{xs:"1fr",sm:`repeat(auto-fill, minmax(${s}px, 1fr))`},p:"2px",rowGap:2,columnGap:f?0:2,children:l.map(G=>o.jsx(X,{"data-blocklet-did":G.did,minWidth:{xs:"100%",sm:s},maxWidth:"calc(100vw - 32px)",children:r({blocklet:G,blocklets:l,serverVersion:i})},G.did))}):o.jsx(fm,{})}function K(){return o.jsxs(it,{direction:"row",className:"search-result-title",alignItems:"center",justifyContent:"space-between",mb:2,mt:{xs:2,md:0},children:[o.jsx(ve,{variant:"h3",title:y.keyword,maxWidth:"50vw",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e("blocklet.search",{keyword:y.keyword})}),o.jsx(ve,{variant:"body1",color:"text.hint",fontSize:13,children:e("blocklet.resultCount",{count:j})})]})}}function vm(){var e,t,n;const{t:r,selectedCategory:i,getCategoryLocale:s,locale:a,search:c}=ot(),{toggleOpen:f}=go(),y=dc().arcSphere,l=!!((t=(e=window.blocklet)==null?void 0:e.navigation)!=null&&t.some(u=>u.section==="bottomNavigation"));return o.jsxs(X,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[o.jsxs(ve,{variant:"body1",display:{xs:"flex",md:"none"},alignItems:"center",gap:1,py:2,fontWeight:"fontWeightMedium",children:[o.jsx(El,{onClick:()=>f(!0),children:o.jsx(gc,{})}),s(i)||r("common.category")]}),y&&l&&o.jsx(jl,{locale:a,endpoint:((n=window.blocklet)==null?void 0:n.prefix)||"/",sx:{display:{md:"block",xs:"none"},mr:1,width:"350px"},t:r,filters:c.filters,handleKeyword:c.handleKeyword,handleSearchSelect:c.handleSearchSelect})]})}function ym({menus:e,children:t}){var n;const{search:r,layout:i,compact:s}=ot(),{filters:a}=r,c=A.useRef(null),f=a.category||a.keyword||a.price,y=(n=e==null?void 0:e.find(l=>l.key===a.menu))==null?void 0:n.key;return o.jsx(Dp,{children:o.jsxs(zs,{FallbackComponent:jr,children:[!s&&o.jsx(vm,{}),o.jsxs(X,{ref:c,display:"flex",height:"100%",className:"list-container",pt:{xs:0,md:s?0:5},children:[o.jsx(em,{menus:e}),o.jsxs(it,{height:"100%",position:"relative",flex:1,sx:s?{overflowY:"auto",ml:-2,pr:1,pb:2}:{overflow:"visible"},children:[y&&(t==null?void 0:t(y)),!y&&(i.showExplore&&!f?o.jsx(am,{}):o.jsx(gm,{}))]})]})]})})}function bm(e){const{menus:t,children:n,...r}=e,i=Qt(),s=Ls(Sc({},i,{typography:{h1:{fontSize:32,fontWeight:700,lineHeight:1.375,textAlign:"left"},h2:{fontSize:24,fontWeight:700,lineHeight:1.3333333,textAlign:"left"},h3:{fontSize:18,fontWeight:600,lineHeight:1.5,textAlign:"left"},fontWeightLight:300,fontWeightRegular:400,fontWeightMedium:500,fontWeightBold:700}}));return o.jsx(_s,{theme:s,children:o.jsx(Xp,{...r,children:o.jsx(ym,{menus:t,children:n})})})}const xm={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"/>'},wm={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>'},Em={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M22 12.54c-1.804-.345-2.701-1.08-3.523-2.94c-.487.696-1.102 1.568-.92 2.4c.028.238-.32 1-.557 1H3c0 5.208 3.164 7 6.196 7c4.124.022 7.828-1.376 9.854-5c1.146-.101 2.296-1.505 2.95-2.46z"/><path d="M5 10h3v3H5zm3 0h3v3H8zm3 0h3v3h-3zM8 7h3v3H8zm3 0h3v3h-3zm0-3h3v3h-3zM4.571 18c1.5 0 2.047-.074 2.958-.78M10 16v.01"/></g>'},Sm=Em,Tm={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"/>'},jm=(e,t)=>!t||!e?!0:si.satisfies(si.coerce(e),t);function bo({children:e,serverVersion:t="",requirementVersion:n="",...r}){const{t:i}=mt();return jm(t,n)?e:o.jsx(Ps,{title:i("store.tooltip.upgradeServer",{serverVersion:t,version:n}),arrow:!0,children:o.jsx(ve,{children:o.jsx(ir,{disabled:!0,variant:"outlined",...r,children:i("common.upgradeServer")})})})}bo.propTypes={children:N.node.isRequired,serverVersion:N.string,requirementVersion:N.string};bo.defaultProps={serverVersion:"",requirementVersion:""};const km=(e,t)=>gn(t,`/blocklets/${e.did}`),ws=({blocklet:e,attribute:t,value:n})=>e._formatted?e._formatted[t]:n,Om=e=>e.inStore&&Wt.isFreeBlocklet(e)===!1;function xo({blocklet:e,blocklets:t,handleButtonClick:n,endpoint:r,serverVersion:i}){var D,L;const{t:s}=mt();let a=gn(r,Bc(e.did,e.logo||""));try{const M=new URL(a);M.searchParams.set("v",e.version||+new Date),a=M.href}catch{}const[c,f]=A.useState(!1),y=async()=>{try{f(!0),await n({meta:e,registryUrl:r,blocklets:t})}catch(M){Tr.error(M.message)}finally{f(!1)}},{blocklet:l}=Or(),u=()=>((l==null?void 0:l.children)||[]).find(G=>G.meta.bundleDid===e.did).meta.version,m=(()=>{const M=((l==null?void 0:l.children)||[]).find(K=>K.meta.bundleDid===e.did);if(M){try{const K=M.meta.version,G=e.version;if(si.gt(G,K))return"upgrade"}catch{return"install"}return"disable"}return"install"})(),S=(D=e.requirements)==null?void 0:D.server,j=[];return m==="upgrade"?j.push({key:"upgrade",icon:o.jsx(ft,{icon:Tm,color:"success.light",width:20,height:20},"version"),title:`${u()} -> ${e.version}`,align:"right",color:"success.light",maxWidth:300,text:o.jsx(X,{sx:{fontWeight:"bold"},children:s("blocklet.component.upgradeAvailable")})}):m==="disable"?j.push({key:"disable",icon:o.jsx(ft,{icon:xm,color:"text.disabled",width:20,height:20},"disable"),align:"right",maxWidth:300,color:"text.disabled",text:s("blocklet.component.installed")}):Om(e)&&j.push({key:"purchase",icon:o.jsx(ft,{icon:wm,color:"primary.main",width:20,height:20},"purchase"),align:"right",maxWidth:300,color:"primary.main",text:s("blocklet.component.needBuy")}),o.jsx(Im,{title:ws({blocklet:e,attribute:"title",value:e.title||e.name}),did:e.did,description:ws({blocklet:e,attribute:"description",value:e.description}),cover:e.logo?a:"",version:e.version,onButtonClick:null,"data-cy":"install-blocklet",sx:m!=="disable"?{"&:hover, && *":{cursor:"pointer"}}:{"&:after, &:before":{content:'""',opacity:"0 !important"}},onMainClick:m==="disable"?void 0:y,icons:(L=e.docker)!=null&&L.image?[{key:"docker",icon:o.jsx(X,{display:"flex",color:"primary.main",children:o.jsx(ft,{icon:Sm})}),title:s("blocklet.dockerImage")}]:[],official:e.isOfficial?{tooltip:s("blocklet.component.isOfficial")}:void 0,download:e.stats.downloads,status:j,button:o.jsx(bo,{serverVersion:i,requirementVersion:S,size:"small",children:o.jsx("div",{style:{display:"flex",alignItems:"center"},children:o.jsx(of,{children:o.jsx(ht,{size:"small",disabled:c,variant:"outlined",color:"primary",onClick:M=>{M.preventDefault(),M.stopPropagation();const K=km(e,r);K&&window.open(K,"_blank","noopener,noreferrer")},children:s("common.detail")},e.did)})})})})}xo.propTypes={blocklet:N.object.isRequired,blocklets:N.array,handleButtonClick:N.func,endpoint:N.string,serverVersion:N.string};xo.defaultProps={handleButtonClick:null,endpoint:"",blocklets:[],serverVersion:""};function wo({handleButtonClick:e,handleSearchSelect:t,storeUrl:n,handleBlockletRender:r,extraFilter:i,serverVersion:s,resourceType:a,resourceDid:c,showResourcesSwitch:f,showCategory:y,compact:l,...u}){const k=Qt(),{locale:m}=mt(),[S,j]=A.useState(!1),[D,L]=A.useState({}),M=T=>{L(T)},K=n,G=A.useMemo(()=>Ls(k,{palette:{background:{default:k.palette.background.paper}}}),[k]);return A.useEffect(()=>{L({showResources:!0,resourceType:a,resourceDid:c})},[K,a,c]),A.useEffect(()=>{j(!0),L({showResources:!0,resourceType:a,resourceDid:c})},[]),o.jsx(_s,{theme:G,children:o.jsx(zs,{FallbackComponent:jr,resetKeys:[K],children:o.jsxs(X,{...u,sx:[{overflow:"auto",".title-bar + div":{height:"unset"}},Array.isArray(u.sx)?u.sx:[u.sx]],children:[S&&o.jsx(bm,{showCategory:y,showResourcesSwitch:f,blockletRender:T=>{const F={...T,handleButtonClick:e,endpoint:K};return r({...T,defaultRender:o.jsx(xo,{...F})})},compact:l,minItemWidth:300,baseSearch:!0,endpoint:K,locale:m,onFilterChange:M,onSearchSelect:t,filters:D,extraFilter:i,serverVersion:s,fetchCategoryDelay:500}),o.jsx(X,{sx:{mt:2},children:" "})]})})})}wo.propTypes={storeUrl:N.string.isRequired,handleButtonClick:N.func,handleSearchSelect:N.func,handleBlockletRender:N.func,extraFilter:N.func,serverVersion:N.string,resourceType:N.string,resourceDid:N.string,showResourcesSwitch:N.bool,showCategory:N.bool,compact:N.bool};wo.defaultProps={handleButtonClick:null,handleSearchSelect:null,handleBlockletRender:null,extraFilter:void 0,serverVersion:"",resourceType:"",resourceDid:"",showResourcesSwitch:!0,showCategory:!0,compact:!1};const Im=Xe(af)`
|
|
554
|
-
.ms-highlight {
|
|
555
|
-
color: ${e=>e.theme.palette.primary.main};
|
|
556
|
-
}
|
|
557
|
-
`,Eo=A.forwardRef(({meta:e,isMobile:t,onStepChange:n},r)=>{const i=Qt(),{steps:s,activeStep:a,setActiveStepByKey:c,setActiveStepByIndex:f}=yc(),{t:y,locale:l}=mt(),u=s[a];return A.useEffect(()=>{n(a)},[n,a]),A.useImperativeHandle(r,()=>({setActiveStepByKey:c,setActiveStepByIndex:f})),o.jsx(Cm,{component:"div",className:t?"mobileStyle":"",sx:{height:"calc(100% - 56px)","&>div>div>div:first-child":{flex:{md:1}}},children:o.jsx(bc,{locale:l,blockletMeta:{title:" ",...e},pcWidth:"100%",pcHeight:"100%",logoUrl:e&&e.logo&&e.registryUrl?$c({did:e.did,version:e.version,baseUrl:e.registryUrl,logoPath:e.logo}):null,theme:i,stepTip:y("blocklet.component.add"),children:o.jsx(Rm,{children:typeof(u==null?void 0:u.body)=="function"?u.body():u==null?void 0:u.body})})})});Eo.propTypes={meta:N.any,onStepChange:N.func.isRequired,isMobile:N.bool.isRequired};Eo.defaultProps={meta:null};const Es=e=>e.isMobile?`
|
|
558
|
-
height: calc(100vh - 56px - 64px - 48px);
|
|
559
|
-
`:"",Rm=Xe.div`
|
|
560
|
-
width: 100%;
|
|
561
|
-
height: 100%;
|
|
562
|
-
display: flex;
|
|
563
|
-
flex-direction: column;
|
|
564
|
-
justify-content: flex-start;
|
|
565
|
-
align-items: flex-start;
|
|
566
|
-
|
|
567
|
-
.bottom-button {
|
|
568
|
-
min-width: 200px;
|
|
569
|
-
}
|
|
570
|
-
|
|
571
|
-
// blocklet-select-side
|
|
572
|
-
aside {
|
|
573
|
-
width: 140px;
|
|
574
|
-
}
|
|
575
|
-
`,Cm=Xe(X)`
|
|
576
|
-
${({className:e})=>e==="mobileStyle"?`
|
|
577
|
-
& > div{
|
|
578
|
-
height: 100%;
|
|
579
|
-
}
|
|
580
|
-
.root-header {
|
|
581
|
-
.app-name-content {
|
|
582
|
-
display: none;
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
// content-panel
|
|
587
|
-
.root-header + div{
|
|
588
|
-
padding-top: 0;
|
|
589
|
-
position: relative;
|
|
590
|
-
& > div {
|
|
591
|
-
padding-top: 0;
|
|
592
|
-
}
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
header + div {
|
|
596
|
-
padding-top: 0;
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
header {
|
|
600
|
-
.header-title {
|
|
601
|
-
margin-left: 0;
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
.header-title-name {
|
|
605
|
-
max-width: 100% !important;
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
.app-content {
|
|
609
|
-
padding: 0!important;
|
|
610
|
-
}
|
|
611
|
-
`:`
|
|
612
|
-
position: relative;
|
|
613
|
-
.ll-container { // 通过 Launcher Layout 组件约定的 .ll-container class 自定义 Layout 样式
|
|
614
|
-
width: 100%;
|
|
615
|
-
height: 100%;
|
|
616
|
-
border-radius: 0;
|
|
617
|
-
}
|
|
618
|
-
|
|
619
|
-
.root-header {
|
|
620
|
-
z-index: auto !important;
|
|
621
|
-
position: fixed !important;
|
|
622
|
-
}
|
|
623
|
-
& > div {
|
|
624
|
-
height: 100%;
|
|
625
|
-
width: 100%;
|
|
626
|
-
max-width: 100%;
|
|
627
|
-
& > div {
|
|
628
|
-
max-height: unset !important;
|
|
629
|
-
max-width: 100%;
|
|
630
|
-
& > div {
|
|
631
|
-
// left-panel
|
|
632
|
-
&:first-child {
|
|
633
|
-
padding: 0;
|
|
634
|
-
width: 20%;
|
|
635
|
-
min-width: 180px;
|
|
636
|
-
|
|
637
|
-
& > div:first-child {
|
|
638
|
-
display: none;
|
|
639
|
-
}
|
|
640
|
-
// step
|
|
641
|
-
& > div:last-child {
|
|
642
|
-
// margin-top: 32px;
|
|
643
|
-
margin-top: 0;
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
// right-panel
|
|
647
|
-
&:last-child {
|
|
648
|
-
padding-top: 0;
|
|
649
|
-
padding-right: 0px;
|
|
650
|
-
overflow-y: hidden;
|
|
651
|
-
.app-content {
|
|
652
|
-
padding: 0 0 24px 0;
|
|
653
|
-
}
|
|
654
|
-
.button-container {
|
|
655
|
-
padding-right: 0;
|
|
656
|
-
}
|
|
657
|
-
}
|
|
658
|
-
}
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
`}
|
|
663
|
-
|
|
664
|
-
& .ll-container {
|
|
665
|
-
background: ${({theme:e})=>e.palette.background.paper};
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
& .app-overview {
|
|
669
|
-
margin-left: 0 !important;
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
& .flex-justify-center {
|
|
673
|
-
display: flex;
|
|
674
|
-
justify-content: center;
|
|
675
|
-
}
|
|
676
|
-
|
|
677
|
-
& .flex-align-center {
|
|
678
|
-
display: flex;
|
|
679
|
-
height: 100%;
|
|
680
|
-
align-items: center;
|
|
681
|
-
${e=>Es(e)}
|
|
682
|
-
}
|
|
683
|
-
|
|
684
|
-
& .agreement-wrapper {
|
|
685
|
-
${e=>Es(e)}
|
|
686
|
-
max-height: 60vh;
|
|
687
|
-
.eula-trigger {
|
|
688
|
-
padding-right: 0;
|
|
689
|
-
}
|
|
690
|
-
.next-button {
|
|
691
|
-
display: none;
|
|
692
|
-
}
|
|
693
|
-
}
|
|
694
|
-
|
|
695
|
-
& .connect {
|
|
696
|
-
background: white;
|
|
697
|
-
}
|
|
698
|
-
`,Pm=Eo,Lm=e=>e.inStore&&Wt.isFreeBlocklet(e)===!1,_m=e=>{var t;return[wt.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,wt.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes((t=e==null?void 0:e.capabilities)==null?void 0:t.didSpace)},oi=e=>{var t,n;return((n=(t=e==null?void 0:e.configs)==null?void 0:t.find(r=>r.key===wt.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT))==null?void 0:n.value)||null},Nm=e=>(e.environments||[]).some(t=>t.required),Ss=(e,t)=>e==null?void 0:e.some(n=>n.required&&!t[n.key]),Am=({params:e,blocklet:t,t:n})=>{const r=e.title||e.name;return r?((t==null?void 0:t.children)||[]).find(s=>s.meta.bundleDid===e.bundleDid)?n("blocklet.component.upgradeNext",{name:r}):n("blocklet.component.addNext",{name:r}):n("common.next")},Ts=({componentDid:e,timeout:t=1e3,manual:n=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:e,manual:n},"*")},t)};function kl({onClose:e,mode:t,stores:n,resourceType:r,resourceDid:i,storageKey:s,inDialog:a,selectedMeta:c,storeUrl:f,showResourcesSwitch:y,showFromUrl:l,enableRunBackground:u,showCategory:k}){var on,Sn,C,kt,Nt,sn,d,x,w,P;const{t:m,locale:S}=mt(),[j,D]=A.useState(!1),[L,M]=A.useState(null),[K,G]=A.useState(""),[T,F]=A.useState(""),{api:H,ws:{useSubscription:B},inService:ce,info:V}=Nn(),{blocklet:se,actions:{refreshBlocklet:Pe}}=Or(),[Be,Ae]=A.useState(null),[Je,J]=A.useState(!1),me={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceIsRequiredSetup:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1},[ne,je]=A.useState(me),[Le,Me]=A.useState(0),we=A.useRef({}),Ze=A.useRef({}),Ke=A.useRef({}),Ct=Xt(I=>I.breakpoints.down("md")),Pt=Ql(),[yt,et]=A.useState(!0),{meta:Z}=we.current,he=Zs(Z),ke=A.useRef(!1),ae=I=>je(_=>({..._,...I}));A.useEffect(()=>{if(ne.pathPrefix){const{errMsg:I}=rn({...ne,pathPrefix:ne.pathPrefix,locale:S});G(I)}},[ne.pathPrefix]),A.useEffect(()=>{Le===0&&je(me)},[Le]);const Lt=()=>{const I=oi(se)??"";ae({didSpaceEndpoint:I})},Zt=()=>{var I;return(I=we==null?void 0:we.current)!=null&&I.meta?Wt.getDisplayName(we.current):""},en=()=>{D(!1),je({}),ke.current=!1,we.current={},e()},Oe=I=>{const _=U=>{ae({installResultProps:{variant:"error",title:Zt(),subTitle:I,footer:o.jsx(ht,{className:"bottom-button",disabled:U,"data-cy":"retry-install-component",onClick:async()=>{_(!0),await nn(we.current.installInput)},children:o.jsxs(X,{display:"flex",alignItems:"center",children:[U&&o.jsx(St,{size:16,style:{marginRight:8}}),m("common.retry")]})})}})};_()},qt=I=>_=>{var U,re;(((U=_==null?void 0:_.meta)==null?void 0:U.did)||(_==null?void 0:_.meta))===((re=se==null?void 0:se.meta)==null?void 0:re.did)&&I(_)},Dn=()=>{Ts({timeout:0,componentDid:Pt.componentDid,manual:!0}),en(),setTimeout(()=>{const I=document.getElementsByClassName("dashboard-main")[0];I&&(I.scrollTop=I.scrollHeight)},200)};B(wt.BlockletEvents.componentInstalled,qt(()=>{ae({installResultProps:{variant:"success",title:Zt(),subTitle:m("blocklet.component.installSuccessTip")}}),Ts({componentDid:Pt.componentDid})}),[(on=se==null?void 0:se.meta)==null?void 0:on.did]),B(wt.BlockletEvents.statusChange,qt(()=>{const I=oi(se);ae(_=>({..._,didSpaceEndpoint:I}))}),[(Sn=se==null?void 0:se.meta)==null?void 0:Sn.did]),B(wt.BlockletEvents.downloadFailed,qt(()=>{ke.current=!1,Oe(m("blocklet.component.installComponentError"))}),[(C=se==null?void 0:se.meta)==null?void 0:C.did]),B(wt.BlockletEvents.installFailed,qt(()=>{ke.current=!1,Oe(m("blocklet.component.installComponentError"))}),[(kt=se==null?void 0:se.meta)==null?void 0:kt.did]);const tt=[],tn=I=>((se==null?void 0:se.children)||[]).find(_=>_.meta.did===I),nn=async I=>{var Gt,gt;ke.current=!0;const{pathPrefix:_,bundleDid:U,title:re,componentName:le="",componentDid:Ue=""}=ne,De=((Gt=we.current)==null?void 0:Gt.meta)||{},{configs:Ee=[],registryUrl:Te,inStore:Ye,inputUrl:At,dist:Mn}=De,Dt=(gt=we.current)==null?void 0:gt.downloadTokenList,at=At||(Ye?Lo(Te,U,Mn):"");D(!0);const Kt={rootDid:se.meta.did,url:at,mountPoint:_?lr(_):`/${lr(De.title||De.name)}`,title:re,name:le,did:Ue,dist:{tarball:"",integrity:""},onlyRequired:!yt,...ne.hasEnvironmentsStep&&Ee.length>0?{configs:Ee.map(lt=>({...lt,value:ne.configsValue[lt.key]||""}))}:{},...Dt?{downloadTokenList:Dt}:{},...I};try{if(await H.installComponent({input:Kt}),Te){const{teamDid:lt,storeList:Mt}=Hs({fromBlocklet:ce,nodeInfo:V,blocklet:se}),{isNew:Tn,decoded:jn}=zc(Te,Mt);Tn&&await H.addBlockletStore({input:{teamDid:lt,url:jn}})}ae({installResultProps:{}}),Pe({showError:!1,attachRuntimeInfo:!1})}catch(lt){const Mt=ai(lt);Tr.error(Mt),console.error("installComponent error: ",lt),Oe(Mt)}finally{D(!1),we.current.installInput=Kt}},rn=I=>{const _=du({params:{...I,did:I.bundleDid},blocklets:[se],blocklet:se,locale:S});if(_){const U=tn(I.bundleDid),re=hu({params:{...I,did:I.bundleDid},blocklet:se});if(U&&U.mountPoint===re)return{errMsg:""}}return{errMsg:_}},$e=async I=>{var U,re;const{errMsg:_}=rn({...ne,locale:S});G(_),Le===tt.length-2&&!ke.current&&await nn(I),(re=(U=Ze.current)==null?void 0:U.setActiveStepByIndex)==null||re.call(U,le=>le+1)},nt=()=>{var I,_;(_=(I=Ze.current)==null?void 0:I.setActiveStepByIndex)==null||_.call(I,U=>U-1)},Tt=()=>{const{pathPrefix:I,bundleDid:_,title:U,componentName:re="",componentDid:le=""}=ne,{meta:Ue={}}=we.current||{},{registryUrl:De,inStore:Ee,inputUrl:Te,dist:Ye}=Ue,At=Ee?Lo(De,_,Ye):Te;Ae({meta:Ue,installOpts:{type:"component",rootDid:se.meta.did,mountPoint:I,url:At,title:U,name:re,did:le}})},st=I=>{J(!1),ae({purchaseResultProps:{variant:"error",title:Zt(),subTitle:I,style:{paddingTop:120},footer:o.jsx(ht,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{ae({purchaseResultProps:{}})},children:m("common.retry")})}})},jt=({downloadTokenList:I})=>{we.current.downloadTokenList=I,J(!1),$e()},_t=({chooseParams:I=we.current,componentDid:_,isInit:U=!1})=>{var jn,sr,Fn,Bn;const{meta:re,registryUrl:le,inStore:Ue,inputUrl:De}=I,{did:Ee,title:Te,name:Ye}=re,At=(((jn=se.settings)==null?void 0:jn.children)||[]).filter(We=>We.status==="deleted"&&We.meta.bundleDid===Ee),Mn=_||"",Dt=(sr=re.environments)==null?void 0:sr.map(We=>{const{name:kn,validation:an,...On}=We,ln={validation:Pc(an)?"":an};return{...On,key:kn,...ln}});we.current={...I,meta:{...re,configs:Dt,registryUrl:le,inStore:Ue,inputUrl:De}};let at={};if(U){const We=[se],kn=Dt||[],an=[],On=Gs(Cc([...kn,...an]),"key").filter(bt=>!!bt.key).sort((bt,cn)=>bt.required&&!cn.required?-1:cn.required&&!bt.required?1:0),ln=Wt.getSharedConfigObj(We[0],{configs:On}),$n={},Ie=On.map(bt=>{const{default:cn,key:un,...ar}=bt;return $n[un]=ln[un]||cn,{...ar,key:un,hidden:!!wt.BLOCKLET_CONFIGURABLE_KEY[un]}});at={...at,configsList:Ie,configsValue:$n,hasMissRequiredConfigs:Ss(Ie,$n)}}const Kt=se.children.some(We=>We.mountPoint==="/"),Gt=At.find(We=>We.meta.bundleDid===Ee),gt=se.children.find(We=>We.meta.bundleDid===Ee);at.title=Te||"",Gt?at={...at,pathPrefix:Gt.mountPoint||"",componentName:Gt.meta.name,hasEnvironmentsStep:!1}:gt?at={...at,pathPrefix:gt.mountPoint||"",componentName:gt.meta.name,hasEnvironmentsStep:!1}:at={...at,pathPrefix:Kt?`/${lr(Te)||lr(Ye)}`.toLowerCase():"/",componentName:"",hasEnvironmentsStep:((Bn=(Fn=we.current.meta)==null?void 0:Fn.environments)==null?void 0:Bn.length)>0};const lt=Lm(we.current.meta),Mt=_m(we.current.meta),Tn=oi(se);ae({bundleDid:Ee,componentDid:Mn,...at,hasRequiredEnvironments:Nm(we.current.meta),requirePurchase:lt,didSpaceIsRequiredSetup:Mt,didSpaceEndpoint:Tn}),U&<&&Tt()};A.useEffect(()=>{!c||Le!==0||!se||(_t({chooseParams:{blocklets:[c],meta:c,registryUrl:f||c.homepage,inStore:!0},isInit:!0}),ae({showFromUrlDialog:!1}),$e())},[c,Le,se]),tt.push({key:"selectComponent",name:m("blocklet.component.selectComponent"),body:o.jsxs(hn,{sx:{width:400,display:"flex",flexDirection:"column"},component:"div",children:[l&&ne.showFromUrlDialog&&o.jsx(to,{mode:"component",onCancel:()=>{ae({showFromUrlDialog:!1})},onSuccess:({meta:I,inputUrl:_,inStore:U,registryUrl:re})=>{_t({chooseParams:{meta:I,inputUrl:_,inStore:U,registryUrl:re},isInit:!0}),ae({showFromUrlDialog:!1}),$e()},handleText:{title:m("blocklet.component.addComponentTip.fromUrl"),confirm:m("blocklet.component.choose")}}),o.jsx(so,{stores:n,extra:Ms.isInServerlessMode(V)?null:l?o.jsxs(ht,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{ae({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[o.jsx(Js,{style:{fontSize:20,marginRight:4}}),m("blocklet.component.addComponentTip.fromUrl")]}):null,loading:j,onChange:()=>{je({}),we.current={}},storageKey:s,children:({currentRegistry:I})=>o.jsx(wo,{showResourcesSwitch:y,showCategory:k,serverVersion:V==null?void 0:V.version,compact:!0,style:{flex:1,overflow:"hidden",height:"100%"},storeUrl:I.url,resourceType:r,resourceDid:i,handleButtonClick:_=>{_t({chooseParams:{..._,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:_,defaultRender:U})=>{const re=(ne==null?void 0:ne.bundleDid)&&(ne==null?void 0:ne.bundleDid)===(_==null?void 0:_.did);return o.jsxs(Mm,{children:[o.jsx(X,{className:re?"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",...re?{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:U}),re&&o.jsx(X,{className:"check-container",children:o.jsx(qs,{className:"check-icon"})})]})}})})]}),cancel:t==="embed"?void 0:m("common.cancel"),confirm:Am({params:ne,blocklet:se,t:m}),onCancel:en,onConfirm:()=>{$e()}}),tt.push({key:"agreement",name:m("launchBlocklet.introduction"),body:o.jsxs(hn,{component:"div",className:"agreement-wrapper",children:[o.jsx(Ks,{title:m("launchBlocklet.introduction"),subTitle:m("blocklet.component.addComponentTip.introduction")}),o.jsx(Mi,{meta:Z,onClickNext:$e,installRelated:yt,onChangeInstallRelated:et,handleDescEle:o.jsx("p",{children:m("blocklet.component.addComponentTip.belowInformation")})})]}),cancel:c?void 0:m("common.pre"),disabled:!he,confirm:m(he?"launchBlocklet.next":"launchBlocklet.canNotInstall"),onCancel:c?en:nt,onConfirm:()=>{J(!1),$e()}}),Z&&ne.requirePurchase&&tt.push({key:"purchase",name:o.jsxs(o.Fragment,{children:[m("common.verifyNFT"),o.jsx(Fr,{})]}),body:o.jsxs(hn,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(((sn=(Nt=Ke.current)==null?void 0:Nt.getCurrentStep)==null?void 0:sn.call(Nt))===2||Je)&&o.jsx(pr,{title:m("common.verifyNFT"),subTitle:m("blocklet.component.addComponentTip.verifyNFT")}),Xn(ne.purchaseResultProps)?Be&&o.jsx(Jh,{ref:Ke,meta:Be.meta,mode:ne.componentDid?"verify":"both",onCancel:st,installOpts:Be.installOpts,handlePaySuccess:jt}):o.jsx("div",{className:"flex-align-center flex-justify-center",children:o.jsx(Co,{...ne.purchaseResultProps})})]}),disabled:((x=(d=Ke.current)==null?void 0:d.getCurrentStep)==null?void 0:x.call(d))===2||Je,cancel:m("common.pre"),confirm:m("common.next"),onConfirm:()=>{typeof Ke.current.onNext=="function"&&(Ke.current.onNext(),J(!0))},onCancel:()=>{nt()}}),Wt.hasStartEngine(Z)&&Uc.hasMountPoint(Z)?tt.push({key:"config",name:m("common.config"),error:K,body:o.jsxs(hn,{component:"div",children:[o.jsx(pr,{title:m("common.config"),subTitle:m("blocklet.component.addComponentTip.config")}),o.jsx(Er,{label:m("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"mount-point-input"},fullWidth:!0,helperText:T||m("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:ne.pathPrefix,onChange:I=>{const _=I.target.value;ae({pathPrefix:_}),F(m("common.slugifyHint",{value:Wc(_)}))}}),!!K&&o.jsx(Cs,{severity:"error",style:{width:"100%",marginTop:8},children:K})]}),cancel:m("common.pre"),confirm:m("common.next"),onCancel:nt,onConfirm:()=>{$e()}}):Z&&(ne.pathPrefix=((P=(w=Z.interfaces)==null?void 0:w[0])==null?void 0:P.path)||`/${Z.did}`),Z&&(ne!=null&&ne.hasEnvironmentsStep)&&tt.push({key:"environment",name:o.jsxs(o.Fragment,{children:[m("common.environment")," ",ne.hasRequiredEnvironments&&o.jsx(Fr,{})]}),disabled:!!L||(ne==null?void 0:ne.hasMissRequiredConfigs),body:()=>o.jsxs(hn,{component:"div",style:{overflowY:"auto"},children:[o.jsx(pr,{title:m("common.environment"),subTitle:m("blocklet.component.addComponentTip.environment")}),o.jsx(Gc,{style:{marginTop:-12,width:"100%"},schema:ne.configsList,defaultValue:ne.configsValue,onChange:(I,{action:_,currentItem:U,allValues:re})=>{_==="confirm"&&ae({hasMissRequiredConfigs:Ss(ne.configsList,re),configsValue:re}),_==="edit"?M(U):["cancel","confirm"].includes(_)&&M(null)}})]}),cancel:m("common.pre"),confirm:m("common.next"),onCancel:nt,onConfirm:$e}),Z&&(ne!=null&&ne.didSpaceIsRequiredSetup)&&tt.push({key:"didSpace",name:o.jsxs(o.Fragment,{children:[m("blocklet.component.didSpaceConfig")," ",ne.didSpaceIsRequiredSetup==="required"&&o.jsx(Fr,{})]}),disabled:(ne==null?void 0:ne.didSpaceIsRequiredSetup)&&!ne.didSpaceEndpoint,body:()=>o.jsx(Kc,{children:o.jsxs(hn,{component:"div",children:[o.jsx(pr,{title:m("blocklet.component.didSpaceConfig"),subTitle:m("blocklet.component.didSpaceConfigTip")}),o.jsx(X,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:o.jsx(oo,{blockletMeta:we.current.meta,onNext:()=>{$e()},onEndpointUpdate:Lt})})]})}),cancel:m("common.pre"),confirm:m("common.next"),onCancel:nt,onConfirm:$e}),tt.push({key:"install",name:tn(Z==null?void 0:Z.did)?m("common.upgrade"):m("common.install"),disabled:u?!1:Xn(ne.installResultProps),loading:u?!1:Xn(ne.installResultProps),body:o.jsx(hn,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:Xn(ne.installResultProps)?o.jsx(pc,{message:o.jsx(Fm,{children:m(u?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):o.jsx("div",{style:{marginTop:120},children:o.jsx(Co,{...ne.installResultProps})})}),confirm:m("common.complete"),onConfirm:Dn});const Ge=tt[Le]||{},En=()=>j||Ge.error||!ne.bundleDid?!0:Le>1?!ne.pathPrefix:!1;return se?o.jsxs(Dm,{sx:a?{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:[o.jsx(xc,{steps:tt,mode:"memory",children:o.jsx(Pm,{ref:Ze,meta:Z,isMobile:Ct,onStepChange:I=>{Me(I)}})}),o.jsxs(X,{className:"action-bar",children:[Ge.cancel&&o.jsx(ht,{onClick:I=>{I.stopPropagation(),Ge.onCancel()},disabled:Le===tt.length-2&&j,color:"inherit",children:Ge.cancel||m("common.cancel")}),Ge.confirm&&o.jsx(ht,{onClick:I=>{I.stopPropagation(),Ge.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:j||(typeof Ge.disabled=="boolean"?Ge.disabled:En()),variant:"contained",autoFocus:!0,title:Ge.confirm,style:{marginLeft:8,overflow:"hidden",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:o.jsxs(X,{display:"flex",alignItems:"center",overflow:"hidden",children:[(typeof Ge.loading=="boolean"?Ge.loading:j)&&o.jsx(St,{style:{marginRight:8},size:16}),o.jsx(X,{component:"span",flex:1,sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Ge.confirm})]})})]})]}):null}kl.propTypes={onClose:N.func,mode:N.oneOf(["normal","embed"]),inDialog:N.bool,stores:N.arrayOf(N.string),storeUrl:N.string,resourceType:N.string,resourceDid:N.string,storageKey:N.string,selectedMeta:N.object,showResourcesSwitch:N.bool,showFromUrl:N.bool,enableRunBackground:N.bool,showCategory:N.bool};kl.defaultProps={onClose:()=>{},mode:"normal",stores:[],storeUrl:"",resourceType:"",resourceDid:"",storageKey:"",inDialog:!0,selectedMeta:null,showResourcesSwitch:!0,showFromUrl:!0,enableRunBackground:!0,showCategory:!0};const Dm=Xe(X)`
|
|
699
|
-
.action-bar {
|
|
700
|
-
display: flex;
|
|
701
|
-
justify-content: flex-end;
|
|
702
|
-
position: sticky;
|
|
703
|
-
bottom: 0;
|
|
704
|
-
padding-top: 16px;
|
|
705
|
-
z-index: 100;
|
|
706
|
-
width: 100%;
|
|
707
|
-
background: ${({theme:e})=>e.palette.background.paper};
|
|
708
|
-
border-top: '1px solid';
|
|
709
|
-
border-color: ${({theme:e})=>e.palette.divider};
|
|
710
|
-
}
|
|
711
|
-
`,hn=Xe(ve)`
|
|
712
|
-
width: 100%;
|
|
713
|
-
height: 100%;
|
|
714
|
-
`,pr=Xe(Ks)`
|
|
715
|
-
margin-bottom: 24px;
|
|
716
|
-
`,Mm=Xe.div`
|
|
717
|
-
position: relative;
|
|
718
|
-
|
|
719
|
-
.choose-blocklet {
|
|
720
|
-
background-color: rgb(236, 251, 253);
|
|
721
|
-
border-color: rgb(236, 251, 253);
|
|
722
|
-
border-radius: 8px;
|
|
723
|
-
}
|
|
724
|
-
|
|
725
|
-
.check-container {
|
|
726
|
-
position: absolute;
|
|
727
|
-
right: 0;
|
|
728
|
-
bottom: 0;
|
|
729
|
-
display: flex;
|
|
730
|
-
justify-content: flex-end;
|
|
731
|
-
align-items: flex-end;
|
|
732
|
-
width: 30px;
|
|
733
|
-
height: 30px;
|
|
734
|
-
border-radius: 0 0 8px 0;
|
|
735
|
-
color: ${e=>e.theme.palette.common.white};
|
|
736
|
-
overflow: hidden;
|
|
737
|
-
transition: all ease 0.3s;
|
|
738
|
-
&:after {
|
|
739
|
-
position: absolute;
|
|
740
|
-
z-index: 0;
|
|
741
|
-
display: block;
|
|
742
|
-
width: 0;
|
|
743
|
-
height: 0;
|
|
744
|
-
border-top: transparent solid 15px;
|
|
745
|
-
border-left: transparent solid 15px;
|
|
746
|
-
border-bottom: ${e=>e.theme.palette.primary.main} solid 15px;
|
|
747
|
-
border-right: ${e=>e.theme.palette.primary.main} solid 15px;
|
|
748
|
-
transition: all ease 0.1s;
|
|
749
|
-
content: '';
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
.check-icon {
|
|
753
|
-
position: relative;
|
|
754
|
-
z-index: 2;
|
|
755
|
-
margin: 0 1px 1px 0;
|
|
756
|
-
font-size: 16px;
|
|
757
|
-
transition: all ease 0.2s;
|
|
758
|
-
}
|
|
759
|
-
}
|
|
760
|
-
`,Fm=Xe.div`
|
|
761
|
-
color: ${e=>e.theme.palette.primary.main};
|
|
762
|
-
.msg-before {
|
|
763
|
-
display: inline-block;
|
|
764
|
-
color: #aaa;
|
|
765
|
-
font-size: 14px;
|
|
766
|
-
margin-right: 6px;
|
|
767
|
-
}
|
|
768
|
-
`;export{kl as A,Ua as B,yg as S,gg as a,vg as b,Sm as c,Js as d,sa as f};
|