@abtnode/blocklet-services 1.16.22-beta-079a9053 → 1.16.22-beta-5bf86cd3
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 +8 -1
- package/api/libs/open-graph/index.js +5 -1
- package/api/routes/blocklet.js +6 -0
- package/dist/assets/Add-HY80r9Xl.js +1 -0
- package/dist/assets/{Alert-q0LztC5S.js → Alert-cCkZfPX9.js} +1 -1
- package/dist/assets/ArrowDropDown-Oh-T-P-J.js +1 -0
- package/dist/assets/{Autocomplete-KMUZJ2iZ.js → Autocomplete-kezcFnoc.js} +1 -1
- package/dist/assets/{Avatar-7AoIiLl0.js → Avatar-jwVmwAdK.js} +1 -1
- package/dist/assets/{ButtonGroup-3ZXLSrUY.js → ButtonGroup-VMcij_v9.js} +1 -1
- package/dist/assets/{CardContent-Ne-zC7Jh.js → CardContent-56wHk5L-.js} +1 -1
- package/dist/assets/CheckCircle-_9dSYOvH.js +1 -0
- package/dist/assets/{Checkbox-pfFoKuJv.js → Checkbox-1a8RFsS4.js} +1 -1
- package/dist/assets/{ChevronRight-RwAcj313.js → ChevronRight-DuewvW-I.js} +1 -1
- package/dist/assets/DeleteOutline-8lAl_yeQ.js +1 -0
- package/dist/assets/{DialogContentText-sTkogqzq.js → DialogContentText-4V6Sm4oF.js} +1 -1
- package/dist/assets/Done-FhqUT9hq.js +1 -0
- package/dist/assets/Download-tyWSwX6I.js +1 -0
- package/dist/assets/Edit-5S1lkpDv.js +1 -0
- package/dist/assets/{EditIcon-xHBtFRw5.js → EditIcon-np_ORzEB.js} +1 -1
- package/dist/assets/ExpandMore-dUKN4QRy.js +1 -0
- package/dist/assets/{FilterList-41yZeIDY.js → FilterList--9H9DyuC.js} +3 -3
- package/dist/assets/{FormControl-v0eTeB2e.js → FormControl-21-o3Ons.js} +1 -1
- package/dist/assets/{FormControlLabel-GwWyZxgC.js → FormControlLabel-1hNnMean.js} +1 -1
- package/dist/assets/{FormGroup-SgkfjzE8.js → FormGroup-7d3FZFIj.js} +1 -1
- package/dist/assets/{Google-HPUKLxqx.js → Google-VkSesQr-.js} +1 -1
- package/dist/assets/{Grid-YkM__IXg.js → Grid-EWzEHkzI.js} +1 -1
- package/dist/assets/{Hidden-gw53iTuK.js → Hidden-V9GBUhSY.js} +1 -1
- package/dist/assets/{Icon-qZwOVGf4.js → Icon-4r9LeAsN.js} +1 -1
- package/dist/assets/InfoOutlined-pdQhXF08.js +1 -0
- package/dist/assets/{InputAdornment-fcMSBEY_.js → InputAdornment--qKRyOTU.js} +1 -1
- package/dist/assets/{InputLabel-wButS0La.js → InputLabel-5mwp9YPR.js} +1 -1
- package/dist/assets/{LastPage-3BnXJmTJ.js → LastPage-pSqTT0C0.js} +1 -1
- package/dist/assets/Launch-NG3M5y72.js +1 -0
- package/dist/assets/LaunchOutlined-XOhr4FLd.js +1 -0
- package/dist/assets/{ListItem-bKX4gR_9.js → ListItem-wpvL3uzC.js} +1 -1
- package/dist/assets/{LockIcon-JbTTMIYd.js → LockIcon-agQ4kFqe.js} +1 -1
- package/dist/assets/Loop-IzHJ-Vey.js +1 -0
- package/dist/assets/MoreHoriz-KVrwkgt7.js +1 -0
- package/dist/assets/{MoreVert-EZ2iGgaH.js → MoreVert-glDwWv1Q.js} +2 -2
- package/dist/assets/OpenInNew-gFVniujG.js +1 -0
- package/dist/assets/{Pagination-rRHeKBOF.js → Pagination-R_vvTBsr.js} +1 -1
- package/dist/assets/PlayArrow-ZBpW76Bk.js +1 -0
- package/dist/assets/{RadioGroup-_OsSax7E.js → RadioGroup-auvSkCcq.js} +1 -1
- package/dist/assets/Search-b15PzLFw.js +1 -0
- package/dist/assets/{Select-Ij2Jun8i.js → Select-wrtQaiA7.js} +1 -1
- package/dist/assets/{ServerLogo-gWq5OUO_.js → ServerLogo-vGEnqfsW.js} +1 -1
- package/dist/assets/{Skeleton-UiZMiSHu.js → Skeleton-JafD3Ykz.js} +1 -1
- package/dist/assets/{Slider-VWwvJ3Q0.js → Slider-7ZGPyLpu.js} +1 -1
- package/dist/assets/{Stepper-eS4dzjYb.js → Stepper-5Hb9COkE.js} +1 -1
- package/dist/assets/{TableRow-fzOFh_oI.js → TableRow-iLylb6bH.js} +1 -1
- package/dist/assets/{TextField-eXgwmwxj.js → TextField-F6GRkv0f.js} +1 -1
- package/dist/assets/{Toolbar-x7RFKGc3.js → Toolbar-PzPFhxha.js} +1 -1
- package/dist/assets/{access-control-hMevH1aL.js → access-control-ivdVi3Zl.js} +1 -1
- package/dist/assets/{actions-TU96BKon.js → actions-RmsyI4AF.js} +1 -1
- package/dist/assets/{add-component-core-ylX_8APK.js → add-component-core-pThuc3SC.js} +47 -47
- package/dist/assets/add-resource-6vlgGZkJ.js +1 -0
- package/dist/assets/{addon-L1nYGsLr.js → addon-1k5Qtdur.js} +1 -1
- package/dist/assets/{analytics-t4svdtmF.js → analytics-uuu9J4YR.js} +8 -8
- package/dist/assets/api-JcbF2ZX8.js +1 -0
- package/dist/assets/{audit-logs-Gg162kq3.js → audit-logs-lr4aoBwP.js} +1 -1
- package/dist/assets/{button-9m3oRVHq.js → button-49q1l_Jk.js} +1 -1
- package/dist/assets/{click-to-copy-6Ejqlbl5.js → click-to-copy-7zmc8KM7.js} +1 -1
- package/dist/assets/{complete-AaYT5QAB.js → complete-ksaTDs1d.js} +1 -1
- package/dist/assets/{component-jEes4wn7.js → component-cmCcdsTc.js} +29 -29
- package/dist/assets/{config-Kkt3UOJI.js → config-LAgF_LFO.js} +1 -1
- package/dist/assets/{config-navigation-TV0yaruy.js → config-navigation-kgGhXvRG.js} +1 -1
- package/dist/assets/config-zfsyTfJt.js +1 -0
- package/dist/assets/{confirm-FKxAX-vD.js → confirm-IbJOM7N5.js} +1 -1
- package/dist/assets/{confirm-NVMDg5RI.js → confirm-K5PhyaSE.js} +1 -1
- package/dist/assets/{connect-haACPhoK.js → connect-BZeJn_ku.js} +1 -1
- package/dist/assets/{connect-67idO3Ph.js → connect-iXFYp-0V.js} +1 -1
- package/dist/assets/{content-layout-luB2OoJR.js → content-layout-tLfWld_B.js} +1 -1
- package/dist/assets/dashboard-5KQ5Ur-Q.js +136 -0
- package/dist/assets/{did-address-mUc4Y20-.js → did-address-5kO4ybvH.js} +1 -1
- package/dist/assets/{did-utils-QS98CTPO.js → did-utils-N2ScOA2Z.js} +1 -1
- package/dist/assets/{domain-29BRKI9h.js → domain-1ugSZkUL.js} +1 -1
- package/dist/assets/domain-list-UlkqWCsm.js +12 -0
- package/dist/assets/{exchange-passport-f1SZNd4x.js → exchange-passport-1R-azVMk.js} +1 -1
- package/dist/assets/{fallback-PaGR08XT.js → fallback-ZY6DEOHk.js} +1 -1
- package/dist/assets/{format-error-4NwK9J29.js → format-error-fstt_Fgi.js} +1 -1
- package/dist/assets/{fuel-b0KAENfJ.js → fuel-tuPlyXKK.js} +1 -1
- package/dist/assets/{fullpage-_WJYf83J.js → fullpage-NJyn5uuM.js} +1 -1
- package/dist/assets/{home-Ivx_WPc0.js → home-0It-dY_Q.js} +1 -1
- package/dist/assets/{iframe-I_DQavu3.js → iframe-s-BtzLfM.js} +1 -1
- package/dist/assets/{index-PwuPRwMn.js → index-0Rghu4i-.js} +3 -3
- package/dist/assets/{index-5BDrgay-.js → index-5ZG2oxzS.js} +13 -13
- package/dist/assets/{index-Thfx8kQD.js → index-6Ubs0JHb.js} +1 -1
- package/dist/assets/{index-OyU9kT0G.js → index-7WXVYQMt.js} +1 -1
- package/dist/assets/{index-TFqh61lk.js → index-BptLF0Yu.js} +1 -1
- package/dist/assets/{index-iWsloYR-.js → index-CVik65v1.js} +1 -1
- package/dist/assets/{index-4G03rV80.js → index-DUU1rMX-.js} +1 -1
- package/dist/assets/{index-vQP4YCHN.js → index-FKI4Ry1a.js} +1 -1
- package/dist/assets/{index-fvWW0IUt.js → index-FjIp0UlP.js} +1 -1
- package/dist/assets/{index-p8rdvwoO.js → index-MReLu9-n.js} +1 -1
- package/dist/assets/{index-C8EjEFJN.js → index-Q3a71wh1.js} +23 -23
- package/dist/assets/{index-EdxXcbvd.js → index-QDdzoXvu.js} +1 -1
- package/dist/assets/{index-gIcq7LYr.js → index-Y2RH7k2W.js} +2 -2
- package/dist/assets/{index-Q2KraLoY.js → index-YQvahN6T.js} +1 -1
- package/dist/assets/{index-B2Jib_qi.js → index-YqUiAZGc.js} +1 -1
- package/dist/assets/{index-yofATYEc.js → index-akHKEyYq.js} +1 -1
- package/dist/assets/{index-Vwo7aMdQ.js → index-bZ3vw6Xd.js} +1 -1
- package/dist/assets/{index-17kMPOCc.js → index-d8x_hsVZ.js} +1 -1
- package/dist/assets/index-feKj5cCa.js +1442 -0
- package/dist/assets/{index-i7Ow7N5Z.js → index-gKtAtARS.js} +14 -14
- package/dist/assets/{index-cA3X58uQ.js → index-ibSCib5c.js} +3 -3
- package/dist/assets/index-jlbXeg5y.js +1 -0
- package/dist/assets/{index-BSh8wzUh.js → index-lDqI9_-C.js} +1 -1
- package/dist/assets/{index-DdkstYFC.js → index-oY9Vc1OW.js} +1 -1
- package/dist/assets/{index-87AfN2F8.js → index-qpETE7Qh.js} +1 -1
- package/dist/assets/{index-JqwgTYS6.js → index-vU8oFfNB.js} +1 -1
- package/dist/assets/index-w1QUchsj.js +126 -0
- package/dist/assets/{index.es-LLMjvPIy.js → index.es-KNfd6PLa.js} +1 -1
- package/dist/assets/{index.esm-eI_inmiY.js → index.esm-MvqHB13x.js} +1 -1
- package/dist/assets/{invite-BW0mYX8I.js → invite-U7HV2bOf.js} +1 -1
- package/dist/assets/{issue-passport-3pCwsS3r.js → issue-passport--ANeRPcP.js} +1 -1
- package/dist/assets/{jss-plugin-props-sort.esm-MNya_k5W.js → jss-plugin-props-sort.esm-HmYxbLE7.js} +1 -1
- package/dist/assets/{launch-result-message-Hk1fQy57.js → launch-result-message-TcQH4jpT.js} +1 -1
- package/dist/assets/{layout-elAFJ4FF.js → layout-zmTL5DYX.js} +1 -1
- package/dist/assets/{list-header-Us8_bjV8.js → list-header--Vhbpfw2.js} +1 -1
- package/dist/assets/localization-vCyo8i6n.js +1 -0
- package/dist/assets/{log-szZDv5cA.js → log-kNDVvJse.js} +1 -1
- package/dist/assets/{login-j6Vv1NHJ.js → login-05AF3rUX.js} +1 -1
- package/dist/assets/{logo-uploader-SgB8kCkW.js → logo-uploader-e3Of5exH.js} +3 -3
- package/dist/assets/{lost-passport-jXsQBHJw.js → lost-passport-0uO9Guj6.js} +4 -4
- package/dist/assets/{lottie-FjNcYuDz.js → lottie-GIsmz4wu.js} +1 -1
- package/dist/assets/{memoize-one.esm-GXj7vDIE.js → memoize-one.esm-pefuu-zN.js} +1 -1
- package/dist/assets/{nav-menu-faDWYwo_.js → nav-menu-_j09OYoV.js} +7 -7
- package/dist/assets/notifications-Ldr7opjk.js +62 -0
- package/dist/assets/{overview-ilZiw5C7.js → overview-1XL_Qiy2.js} +1 -1
- package/dist/assets/page-header-LWFGDoxM.js +31 -0
- package/dist/assets/{permission-sB8VSoo2.js → permission-sTjN-J07.js} +1 -1
- package/dist/assets/preferences-VK9P9jKD.js +1 -0
- package/dist/assets/publish-resource-sQE_SSQq.js +1 -0
- package/dist/assets/{react-oxDWAOtJ.js → react-Z9fqICoT.js} +4 -4
- package/dist/assets/{selector-h5yloHKI.js → selector-r-EEnzvL.js} +1 -1
- package/dist/assets/session-otHGC7d2.js +1 -0
- package/dist/assets/{setup-1vHHMq6H.js → setup-yyKjCHgl.js} +3 -3
- package/dist/assets/{slicedToArray-7xRqglx6.js → slicedToArray-VCxJChO9.js} +2 -2
- package/dist/assets/{spaces-UOGj7Ssb.js → spaces-3IB4aUW-.js} +1 -1
- package/dist/assets/start-_dD57MgC.js +186 -0
- package/dist/assets/{step-actions-u4sEwj8l.js → step-actions-u5wVgCmC.js} +1 -1
- package/dist/assets/studio-HE-dnqpB.js +6 -0
- package/dist/assets/{switch-control-Wc5MlIpH.js → switch-control-QtA6jhKG.js} +1 -1
- package/dist/assets/{transfer-VUO9ygX_.js → transfer-jfS_LJKL.js} +1 -1
- package/dist/assets/{uniqBy-iEgks-vJ.js → uniqBy-VUHiGwLF.js} +1 -1
- package/dist/assets/{unsubscribe--bugVAVK.js → unsubscribe-dTRW-kgU.js} +1 -1
- package/dist/assets/use-blocklet-info-for-connect-did-spaces-0kF4SQU7.js +1 -0
- package/dist/assets/{useAsync-jPfHNdGA.js → useAsync-Dmz5YLn0.js} +1 -1
- package/dist/assets/{useFormControl-KNSyfEVt.js → useFormControl-mI0MPYsh.js} +1 -1
- package/dist/assets/{useLocalStorage--76v1ZXm.js → useLocalStorage-aRRflkTR.js} +1 -1
- package/dist/assets/useSetState-a6nBCmZL.js +1 -0
- package/dist/assets/user-7RZ8cZci.js +22 -0
- package/dist/assets/{util-d7UDajXU.js → util-rU2tRtqs.js} +1 -1
- package/dist/assets/{wallet-hidden-topbar-A40myZlO.js → wallet-hidden-topbar-fLm2f0hp.js} +3 -3
- package/dist/assets/{wrap-locale-2MDYkyf1.js → wrap-locale-A7IdT91x.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +22 -22
- package/dist/assets/Add-7NNakwc_.js +0 -1
- package/dist/assets/ArrowDropDown-rOXH0UGm.js +0 -1
- package/dist/assets/CheckCircle-MudY10Kb.js +0 -1
- package/dist/assets/DeleteOutline-6up2qq9R.js +0 -1
- package/dist/assets/Done-MCWAlwFR.js +0 -1
- package/dist/assets/Download-m1-pOr7w.js +0 -1
- package/dist/assets/Edit-HypIX1_Y.js +0 -1
- package/dist/assets/ExpandMore-NVX5jNVq.js +0 -1
- package/dist/assets/InfoOutlined-XrC7_SL1.js +0 -1
- package/dist/assets/Launch-Hu_2a2vM.js +0 -1
- package/dist/assets/LaunchOutlined-koluPofV.js +0 -1
- package/dist/assets/Loop-1L7Vjeun.js +0 -1
- package/dist/assets/MoreHoriz-OdM1acmI.js +0 -1
- package/dist/assets/OpenInNew-b3rnf1l3.js +0 -1
- package/dist/assets/PlayArrow-jAJdJxEN.js +0 -1
- package/dist/assets/Search-Qa9ylVm2.js +0 -1
- package/dist/assets/add-resource-gBFROo59.js +0 -1
- package/dist/assets/api-gliNzA2D.js +0 -1
- package/dist/assets/config-zsZ_wFCW.js +0 -1
- package/dist/assets/dashboard-v_1ImHC1.js +0 -136
- package/dist/assets/domain-list-zhzJcV_A.js +0 -12
- package/dist/assets/index-CHDTx3qG.js +0 -126
- package/dist/assets/index-fmx4paNk.js +0 -1442
- package/dist/assets/index-qFOKnKtb.js +0 -1
- package/dist/assets/localization-wFo0GiUc.js +0 -1
- package/dist/assets/notifications-N19XW-R1.js +0 -62
- package/dist/assets/page-header-ddmwDxwc.js +0 -31
- package/dist/assets/preferences-oBVU4PhG.js +0 -1
- package/dist/assets/publish-resource-Q4defibE.js +0 -1
- package/dist/assets/session-jiGGNvRF.js +0 -1
- package/dist/assets/start-UtnkpzYf.js +0 -186
- package/dist/assets/studio-UEIzHvvr.js +0 -6
- package/dist/assets/use-blocklet-info-for-connect-did-spaces-w6ZQzAFj.js +0 -1
- package/dist/assets/useSetState-Hs0SeJpE.js +0 -1
- package/dist/assets/user-B_olEtqq.js +0 -22
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import{r as g,ay as Qn,az as Yn,aA as Vt,aB as F,aC as Xn,aD as Zn,aE as ye,aF as Rn,aG as St,j as l,aH as Jn,aI as ur,aJ as dr,aK as fr,aL as pr,aM as hr,aN as mr,aO as gr,aP as vr,aQ as yr,aR as br,aS as eo,aT as xr,aU as wr,aV as _r,P as y,E as qt,aW as Ot,a as Et,S as se,K as H,M as K,G as rt,e as st,a9 as W,aX as ce,$ as N,aY as jr,aZ as to,a_ as me,aw as Ht,a$ as Cr,L as no,b0 as Pt,b1 as Sr,F as be,Y as Ne,T as Z,b2 as Or,n as T,b3 as Er,b4 as Pr,c as pt,b5 as Rr,b6 as Rt,A as Ar,u as G,w as B,B as L,x as Ir,b7 as Dr,b8 as Lr,ac as Kt,aa as it,a8 as at,b9 as Qe,X as Ke,ba as oo,bb as ro,bc as so,H as Tr,bd as $r,U as io,W as Br,be as kr,bf as ht,bg as Nr,bh as We,bi as ao,bj as Mr,bk as An,bl as Ur,bm as Fr,bn as zr,bo as Vr,a7 as qr,bp as Hr,bq as Kr,br as Wr,av as Gr,C as Je,bs as Qr,bt as Yr,bu as Xr,Q as M,bv as Zr,ah as Jr,R as In}from"./index-fmx4paNk.js";import{T as es}from"./index-Vwo7aMdQ.js";import{D as ts,_ as ns,P as os}from"./permission-sB8VSoo2.js";import{T as co,d as rs}from"./MoreVert-EZ2iGgaH.js";import{_ as ss}from"./useLocalStorage--76v1ZXm.js";import{L as is,a as lo,C as Dn}from"./confirm-FKxAX-vD.js";import{d as as,_ as cs}from"./useSetState-Hs0SeJpE.js";import{d as ls}from"./PlayArrow-jAJdJxEN.js";import{A as us}from"./Alert-q0LztC5S.js";import{B as ds}from"./ButtonGroup-3ZXLSrUY.js";import{R as fs,a as Ln}from"./RadioGroup-_OsSax7E.js";import{F as At}from"./FormControlLabel-GwWyZxgC.js";import{f as Me}from"./format-error-4NwK9J29.js";import{A as uo}from"./Avatar-7AoIiLl0.js";import{A as ps}from"./index-BSh8wzUh.js";import{u as hs}from"./session-jiGGNvRF.js";import{b as ms,c as gs}from"./spaces-UOGj7Ssb.js";import{E as vs}from"./fallback-PaGR08XT.js";import{b as ys,s as bs,u as xs,f as ws,g as _s,a as js,m as Cs,c as Ss,d as Os,p as et,H as Es,L as Ps}from"./wallet-hidden-topbar-A40myZlO.js";import{D as Rs,u as As}from"./index-5BDrgay-.js";import{C as Is}from"./Checkbox-pfFoKuJv.js";const fo=e=>{const t=g.useRef({});return g.useEffect(()=>{t.current=e}),t.current};function Ds(e){const{badgeContent:t,invisible:n=!1,max:o=99,showZero:r=!1}=e,s=fo({badgeContent:t,max:o});let i=n;n===!1&&t===0&&!r&&(i=!0);const{badgeContent:a,max:c=o}=i?s:e,u=a&&Number(a)>c?`${c}+`:a;return{badgeContent:a,invisible:i,max:c,displayValue:u}}function Ls(e){return Yn("MuiBadge",e)}const Ts=Qn("MuiBadge",["root","badge","dot","standard","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft","invisible","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","overlapRectangular","overlapCircular","anchorOriginTopLeftCircular","anchorOriginTopLeftRectangular","anchorOriginTopRightCircular","anchorOriginTopRightRectangular","anchorOriginBottomLeftCircular","anchorOriginBottomLeftRectangular","anchorOriginBottomRightCircular","anchorOriginBottomRightRectangular"]),ne=Ts,$s=["anchorOrigin","className","classes","component","components","componentsProps","children","overlap","color","invisible","max","badgeContent","slots","slotProps","showZero","variant"],mt=10,gt=4,Bs=e=>{const{color:t,anchorOrigin:n,invisible:o,overlap:r,variant:s,classes:i={}}=e,a={root:["root"],badge:["badge",s,o&&"invisible",`anchorOrigin${F(n.vertical)}${F(n.horizontal)}`,`anchorOrigin${F(n.vertical)}${F(n.horizontal)}${F(r)}`,`overlap${F(r)}`,t!=="default"&&`color${F(t)}`]};return Jn(a,Ls,i)},ks=Vt("span",{name:"MuiBadge",slot:"Root",overridesResolver:(e,t)=>t.root})({position:"relative",display:"inline-flex",verticalAlign:"middle",flexShrink:0}),Ns=Vt("span",{name:"MuiBadge",slot:"Badge",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.badge,t[n.variant],t[`anchorOrigin${F(n.anchorOrigin.vertical)}${F(n.anchorOrigin.horizontal)}${F(n.overlap)}`],n.color!=="default"&&t[`color${F(n.color)}`],n.invisible&&t.invisible]}})(({theme:e})=>{var t;return{display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"center",alignContent:"center",alignItems:"center",position:"absolute",boxSizing:"border-box",fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(12),minWidth:mt*2,lineHeight:1,padding:"0 6px",height:mt*2,borderRadius:mt,zIndex:1,transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.enteringScreen}),variants:[...Object.keys(((t=e.vars)!=null?t:e).palette).filter(n=>{var o,r;return((o=e.vars)!=null?o:e).palette[n].main&&((r=e.vars)!=null?r:e).palette[n].contrastText}).map(n=>({props:{color:n},style:{backgroundColor:(e.vars||e).palette[n].main,color:(e.vars||e).palette[n].contrastText}})),{props:{variant:"dot"},style:{borderRadius:gt,height:gt*2,minWidth:gt*2,padding:0}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="top"&&n.anchorOrigin.horizontal==="right"&&n.overlap==="rectangular",style:{top:0,right:0,transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${ne.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="bottom"&&n.anchorOrigin.horizontal==="right"&&n.overlap==="rectangular",style:{bottom:0,right:0,transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${ne.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="top"&&n.anchorOrigin.horizontal==="left"&&n.overlap==="rectangular",style:{top:0,left:0,transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${ne.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="bottom"&&n.anchorOrigin.horizontal==="left"&&n.overlap==="rectangular",style:{bottom:0,left:0,transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${ne.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="top"&&n.anchorOrigin.horizontal==="right"&&n.overlap==="circular",style:{top:"14%",right:"14%",transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${ne.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="bottom"&&n.anchorOrigin.horizontal==="right"&&n.overlap==="circular",style:{bottom:"14%",right:"14%",transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${ne.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="top"&&n.anchorOrigin.horizontal==="left"&&n.overlap==="circular",style:{top:"14%",left:"14%",transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${ne.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="bottom"&&n.anchorOrigin.horizontal==="left"&&n.overlap==="circular",style:{bottom:"14%",left:"14%",transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${ne.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}}},{props:{invisible:!0},style:{transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.leavingScreen})}}]}}),Ms=g.forwardRef(function(t,n){var o,r,s,i,a,c;const u=Xn({props:t,name:"MuiBadge"}),{anchorOrigin:d={vertical:"top",horizontal:"right"},className:f,component:p,components:h={},componentsProps:x={},children:v,overlap:P="rectangular",color:m="default",invisible:R=!1,max:A=99,badgeContent:w,slots:b,slotProps:j,showZero:E=!1,variant:S="standard"}=u,C=Zn(u,$s),{badgeContent:I,invisible:Ce,max:Se,displayValue:le}=Ds({max:A,invisible:R,badgeContent:w,showZero:E}),Oe=fo({anchorOrigin:d,color:m,overlap:P,variant:S,badgeContent:w}),ue=Ce||I==null&&S!=="dot",{color:Ee=m,overlap:de=P,anchorOrigin:O=d,variant:J=S}=ue?Oe:u,Pe=J!=="dot"?le:void 0,fe=ye({},u,{badgeContent:I,invisible:ue,max:Se,displayValue:Pe,showZero:E,anchorOrigin:O,color:Ee,overlap:de,variant:J}),_=Bs(fe),k=(o=(r=b==null?void 0:b.root)!=null?r:h.Root)!=null?o:ks,ee=(s=(i=b==null?void 0:b.badge)!=null?i:h.Badge)!=null?s:Ns,Y=(a=j==null?void 0:j.root)!=null?a:x.root,te=(c=j==null?void 0:j.badge)!=null?c:x.badge,pe=Rn({elementType:k,externalSlotProps:Y,externalForwardedProps:C,additionalProps:{ref:n,as:p},ownerState:fe,className:St(Y==null?void 0:Y.className,_.root,f)}),ft=Rn({elementType:ee,externalSlotProps:te,ownerState:fe,className:St(_.badge,te==null?void 0:te.className)});return l.jsxs(k,ye({},pe,{children:[v,l.jsx(ee,ye({},ft,{children:Pe}))]}))}),po=Ms;function Us(e){return Yn("MuiListItemAvatar",e)}Qn("MuiListItemAvatar",["root","alignItemsFlexStart"]);const Fs=["className"],zs=e=>{const{alignItems:t,classes:n}=e;return Jn({root:["root",t==="flex-start"&&"alignItemsFlexStart"]},Us,n)},Vs=Vt("div",{name:"MuiListItemAvatar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.alignItems==="flex-start"&&t.alignItemsFlexStart]}})(({ownerState:e})=>ye({minWidth:56,flexShrink:0},e.alignItems==="flex-start"&&{marginTop:8})),qs=g.forwardRef(function(t,n){const o=Xn({props:t,name:"MuiListItemAvatar"}),{className:r}=o,s=Zn(o,Fs),i=g.useContext(ur),a=ye({},o,{alignItems:i.alignItems}),c=zs(a);return l.jsx(Vs,ye({className:St(c.root,r),ownerState:a,ref:n},s))}),Hs=qs;var Ks=dr,Ws=hr,Gs=mr,Qs=fr,Ys=pr,Xs=gr,Zs=200;function Js(e,t,n,o){var r=-1,s=Ws,i=!0,a=e.length,c=[],u=t.length;if(!a)return c;n&&(t=Qs(t,Ys(n))),o?(s=Gs,i=!1):t.length>=Zs&&(s=Xs,i=!1,t=new Ks(t));e:for(;++r<a;){var d=e[r],f=n==null?d:n(d);if(d=o||d!==0?d:0,i&&f===f){for(var p=u;p--;)if(t[p]===f)continue e;c.push(d)}else s(t,f,o)||c.push(d)}return c}var ei=Js,ti=ei,ni=vr,Tn=yr;function oi(e,t,n){var o=e.length;if(o<2)return o?Tn(e[0]):[];for(var r=-1,s=Array(o);++r<o;)for(var i=e[r],a=-1;++a<o;)a!=r&&(s[r]=ti(s[r]||i,e[a],t,n));return Tn(ni(s,1),t,n)}var ri=oi,si=xr,ii=br,ai=ri,ci=_r,li=wr,ui=ii(function(e){var t=li(e);return t=typeof t=="function"?t:void 0,ai(si(e,ci),void 0,t)}),di=ui;const fi=eo(di),ho=g.createContext({});function Wt({children:e,type:t}){const[n,o]=g.useState([]),r=g.useRef([]),s=c=>{if(!r.current.includes(c)){const u=[...r.current,c];o(u),r.current=u}},i=c=>{if(r.current.includes(c)){const u=r.current.filter(d=>d!==c);o(u),r.current=u}},a=c=>{const u=n.filter(f=>c.find(p=>p===f));fi(u,n).forEach(f=>i(f))};return l.jsx(ho.Provider,{value:{type:t,deletingBlocklets:n,addDeletingDid:s,removeDeletingDid:i,matchDeletingDid:a},children:e})}Wt.propTypes={type:y.string,children:y.node.isRequired};Wt.defaultProps={type:"blocklets"};function $l(){return g.useContext(ho)}function Gt({children:e,style:t,...n}){return l.jsx(co,{style:t,...n,children:e})}Gt.propTypes={children:y.any.isRequired,style:y.object};Gt.defaultProps={style:{}};const $={yellow:"#FFCF71",grey:"#888888"};function Qt({status:e,variant:t,source:n,progress:o,...r}){const{t:s}=g.useContext(qt),i={added:"primary",waiting:"warning",downloading:"warning",extracting:"warning",downloaded:"primary",installing:"warning",installed:"primary",starting:"warning",running:"success",stopping:"warning",stopped:"reverse",error:"error",upgrading:"warning",restarting:"warning",corrupted:"error",deleting:"warning"},a={added:$.grey,waiting:$.yellow,downloading:$.yellow,extracting:$.yellow,downloaded:$.grey,installing:$.yellow,installed:$.grey,starting:$.yellow,running:"success",stopping:$.yellow,stopped:$.grey,error:"error",upgrading:$.yellow,restarting:$.yellow,corrupted:"error",deleting:$.yellow},c=Ot(e),u=s(`blocklet.status.${e}`);return t==="dot"?l.jsx(Et,{title:s("blocklet.statusTip",{status:u}),children:l.jsx(ts,{color:a[e],...r})}):l.jsxs(Gt,{type:i[e],...r,children:[c&&l.jsx(se,{size:12,color:"inherit",style:{marginRight:5}}),u,e==="downloading"&&o?l.jsx("div",{style:{marginLeft:5},children:`${o} %`}):null]})}Qt.propTypes={status:y.string.isRequired,variant:y.oneOf(["dot","tag"]),source:y.string,progress:y.number};Qt.defaultProps={variant:"tag",source:"",progress:0};var Yt={},pi=K;Object.defineProperty(Yt,"__esModule",{value:!0});var mo=Yt.default=void 0,hi=pi(H()),mi=l,gi=(0,hi.default)((0,mi.jsx)("path",{d:"M6 6h12v12H6z"}),"Stop");mo=Yt.default=gi;var Xt={},vi=K;Object.defineProperty(Xt,"__esModule",{value:!0});var go=Xt.default=void 0,yi=vi(H()),bi=l,xi=(0,yi.default)((0,bi.jsx)("path",{d:"M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z"}),"Replay");go=Xt.default=xi;var Zt={},wi=K;Object.defineProperty(Zt,"__esModule",{value:!0});var vo=Zt.default=void 0,_i=wi(H()),ji=l,Ci=(0,_i.default)((0,ji.jsx)("path",{d:"M12 6v3l4-4-4-4v3c-4.42 0-8 3.58-8 8 0 1.57.46 3.03 1.24 4.26L6.7 14.8c-.45-.83-.7-1.79-.7-2.8 0-3.31 2.69-6 6-6zm6.76 1.74L17.3 9.2c.44.84.7 1.79.7 2.8 0 3.31-2.69 6-6 6v-3l-4 4 4 4v-3c4.42 0 8-3.58 8-8 0-1.57-.46-3.03-1.24-4.26z"}),"Autorenew");vo=Zt.default=Ci;var Jt={},Si=K;Object.defineProperty(Jt,"__esModule",{value:!0});var yo=Jt.default=void 0,Oi=Si(H()),Ei=l,Pi=(0,Oi.default)((0,Ei.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}),"Settings");yo=Jt.default=Pi;var en={},Ri=K;Object.defineProperty(en,"__esModule",{value:!0});var bo=en.default=void 0,Ai=Ri(H()),Ii=l,Di=(0,Ai.default)((0,Ii.jsx)("path",{d:"M18 17H6v-2h12v2zm0-4H6v-2h12v2zm0-4H6V7h12v2zM3 22l1.5-1.5L6 22l1.5-1.5L9 22l1.5-1.5L12 22l1.5-1.5L15 22l1.5-1.5L18 22l1.5-1.5L21 22V2l-1.5 1.5L18 2l-1.5 1.5L15 2l-1.5 1.5L12 2l-1.5 1.5L9 2 7.5 3.5 6 2 4.5 3.5 3 2v20z"}),"Receipt");bo=en.default=Di;var tn={},Li=K;Object.defineProperty(tn,"__esModule",{value:!0});var xo=tn.default=void 0,Ti=Li(H()),$i=l,Bi=(0,Ti.default)((0,$i.jsx)("path",{d:"M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"}),"Group");xo=tn.default=Bi;const X={Start:ls,Stop:mo,Restart:go,Reload:vo,Remove:as,Config:yo,Log:bo,Group:xo};function nn({blocklet:e,onStart:t,onComplete:n,variant:o,hasPermission:r,useBlockletUrlEvaluation:s,...i}){var O,J,Pe,fe;const a=st(),c=W(),[u,d]=g.useState(null),[f,p]=g.useState(null),[h,x]=g.useState(!1),[v,P]=g.useState(null),{t:m}=g.useContext(qt),[R]=ss("skip-blocklet-setup",!1),{loading:A,recommendedUrl:w}=s(e),{nftState:b}=ce(),j=Ot(e.status);let E=((J=(O=e==null?void 0:e.controller)==null?void 0:O.status)==null?void 0:J.value)===N.BLOCKLET_CONTROLLER_STATUS.suspended;!(b!=null&&b.expired)&&((fe=(Pe=e==null?void 0:e.controller)==null?void 0:Pe.status)==null?void 0:fe.reason)===N.SUSPENDED_REASON.expired&&(E=!1);const{inService:S}=c,C=(_,k,ee=!1)=>async()=>{const Y=async Ve=>{var He;t({action:_,blocklet:e}),x(!0),p(_);let qe=!1;try{if(_==="remove")await k(Ve);else if(_==="start"){if(!Or(e)){T.error(m("blocklet.noComponent"));return}if(!S&&!R&&!((He=e.settings)!=null&&He.initialized)&&e.mode!==N.BLOCKLET_MODES.DEVELOPMENT){const z=Er(c.info),Pn=new URL(w);Pn.searchParams.set("serverUrl",z),window.open(Pn.href),n({action:_,blocklet:e});return}const ie=e.children.filter(z=>!Ot(z.status)&&z.status!=="running").map(z=>z.meta.did),he={did:e.meta.did,componentDids:ie};await k({input:he})}else if(["stop","restart","reload"].includes(_)){const ie=e.children.filter(z=>z.status==="running").map(z=>z.meta.did),he={did:e.meta.did,componentDids:ie};await k({input:he})}else{const ie={did:e.meta.did};await k({input:ie})}_==="remove"?qe=!0:await Pr(1e3),_==="reload"&&T.success(m("blocklet.reloadSuccess")),P(null),n({action:_,blocklet:e})}catch(ie){const he=`Blocklet ${_} failed: ${Me(ie)}`;throw n({action:_,blocklet:e,error:new Error(he)}),new Error(he)}finally{qe||x(!1)}},te=()=>{x(!1),P(null)},pe=Ne(e,!0),ft=e.mode===N.BLOCKLET_MODES.DEVELOPMENT?{description:()=>l.jsx(Z,{component:"div",children:l.jsx(Z,{gutterBottom:!0,children:m("blocklet.action.removeApplicationDescription")})}),params:{removeType:"complete"}}:{description:(Ve,qe)=>l.jsxs(Z,{component:"div",children:[l.jsx(Z,{gutterBottom:!0,children:m("blocklet.action.removeApplicationDescription")}),l.jsxs(fs,{name:"removeType",value:Ve.removeType,onChange:He=>qe({...Ve,removeType:He.target.value}),children:[l.jsx(At,{value:"backup",control:l.jsx(Ln,{}),label:m("blocklet.action.removeApplicationAfterBackup")}),l.jsx(At,{value:"complete",control:l.jsx(Ln,{}),label:m("blocklet.action.removeApplicationComplete")})]})]}),params:{removeType:"backup"}},lr={stop:{title:`${m("common.stop")} ${pe}`,description:m("blocklet.action.stopDescription"),confirm:m("blocklet.action.confirmStop"),cancel:m("common.cancel"),onConfirm:Y,onCancel:te},restart:{title:`${m("common.restart")} ${pe}`,description:m("blocklet.action.restartDescription"),confirm:m("blocklet.action.confirmRestart"),cancel:m("common.cancel"),onConfirm:Y,onCancel:te},remove:{title:`${m("common.remove")} ${pe}`,confirm:m("blocklet.action.confirmRemove"),cancel:m("common.cancel"),onConfirm:Y,onCancel:te,...ft},cancelDownload:{title:`${m("common.cancel")}`,description:m("blocklet.action.cancelDownloadDescription",{name:pe}),confirm:m("common.confirm"),cancel:m("common.cancel"),onConfirm:Y,onCancel:te}};ee?P(lr[_]):await Y()},I=!!u,Ce=_=>{try{_.stopPropagation(),_.preventDefault()}catch{}d(_.currentTarget)},Se=_=>{try{_.stopPropagation(),_.preventDefault()}catch{}d(null)},le=async(_,k)=>{try{k.stopPropagation(),k.preventDefault()}catch{}if(typeof _.handler=="function")try{x(!0),p(_.action),await _.handler()}catch(ee){console.error(`Blocklet ${_.name} failed: `,ee)}finally{x(!1),d(null)}else d(null)},Oe=!S&&jr(e)?{action:"remove",icon:X.Remove,name:m("common.remove"),handler:C("remove",async({removeType:_})=>{_==="backup"&&await c.api.backupBlocklet({input:{appDid:e.appDid,to:"disk"}}),await c.api.deleteBlocklet({input:{did:e.meta.did,keepData:!1}})},!0),disabled:j}:null,ue={action:"remove",icon:X.Remove,name:m("common.cancel"),handler:C("cancelDownload",c.api.cancelDownloadBlocklet,!0)},Ee=to(e),de=[{action:"start",icon:X.Start,name:m("common.start"),handler:C("start",c.api.startBlocklet),disabled:E||e.children.every(_=>_.status==="running")||me(e.status)||A||j},{action:"stop",icon:X.Stop,name:m("common.stop"),handler:C("stop",c.api.stopBlocklet,!0),disabled:!["running","starting"].includes(e.status)},{action:"restart",icon:X.Restart,name:m("common.restart"),handler:C("restart",c.api.restartBlocklet,!0),disabled:E||e.status!=="running"},{action:"reload",icon:X.Reload,name:m("common.reload"),handler:C("reload",c.api.reloadBlocklet),disabled:E||e.status!=="running"},me(e.status)?ue:Oe,{separator:!0},{onlyInMenu:!0,action:"config",icon:X.Config,name:m("common.config"),handler:()=>{a(`/blocklets/${e.meta.did}/configuration`)},disabled:me(e.status)},{onlyInMenu:!0,action:"team",icon:X.Group,name:m("common.manageTeam"),handler:()=>{a(`/blocklets/${e.meta.did}/members`)},disabled:me(e.status)},{onlyInMenu:!0,action:"log",icon:X.Log,name:m("common.log"),handler:()=>{a(`/logs/blocklet-${e.meta.did}`)},disabled:me(e.status)}].filter(Boolean);return o==="menu"?l.jsxs($n,{"data-cy":"blocklet-actions",children:[l.jsx(Ht,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions","actions-blocklet-did":e.meta.did,onClick:Ce,size:"small",disabled:!r||!me(e.status)&&h,children:l.jsx(rs,{})}),l.jsxs(Cr,{id:"actions-menu",anchorEl:u,keepMounted:!0,open:I,onClose:Se,PaperProps:{},children:[Ee.length>0&&l.jsxs(us,{style:{maxWidth:"400px"},severity:"error",children:[m("blocklet.config.missingRequired"),l.jsx("br",{}),l.jsx(no,{to:`/blocklets/${e.meta.did}/components`,children:m("blocklet.config.gotoFix")})]}),de.map((_,k)=>_.separator?l.jsx(Pt,{},`separator-${k}`):l.jsxs(Sr,{dense:!0,onClick:ee=>le(_,ee),disabled:h||_.disabled,"data-cy":`${_.action}-blocklet`,children:[l.jsx(is,{style:{minWidth:24},children:f===_.action&&h?l.jsx(se,{size:16,sx:{marginRight:1}}):l.jsx(_.icon,{fontSize:"small"})}),l.jsx(lo,{primary:_.name})]},_.name))]}),v&&l.jsx(Dn,{title:v.title,description:v.description,confirm:v.confirm,cancel:v.cancel,params:v.params,onConfirm:v.onConfirm,onCancel:v.onCancel})]}):l.jsxs($n,{"data-cy":"blocklet-actions",...i,children:[l.jsx(ds,{children:de.filter(_=>!_.separator&&!_.onlyInMenu).map(_=>l.jsxs(be,{title:_.name,"data-cy":`${_.action}-blocklet`,onClick:()=>le(_),disabled:!!_.disabled||h,children:[f===_.action&&h?l.jsx(se,{size:16,sx:{marginRight:1}}):l.jsx(_.icon,{}),l.jsx("span",{className:"blocklet-action-text",children:_.name})]},_.name))}),v&&l.jsx(Dn,{title:v.title,description:v.description,confirm:v.confirm,cancel:v.cancel,params:v.params,onConfirm:v.onConfirm,onCancel:v.onCancel})]})}nn.propTypes={blocklet:y.object.isRequired,onStart:y.func.isRequired,onComplete:y.func.isRequired,variant:y.oneOf(["menu","group"]),hasPermission:y.bool,useBlockletUrlEvaluation:y.func};nn.defaultProps={variant:"menu",hasPermission:!1,useBlockletUrlEvaluation:()=>{var e;return{loading:!1,recommendedUrl:(e=window==null?void 0:window.location)==null?void 0:e.href}}};const $n=rt.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
align-items: center;
|
|
4
|
-
|
|
5
|
-
@media (max-width: ${e=>e.theme.breakpoints.values.sm}px) {
|
|
6
|
-
.MuiButton-root {
|
|
7
|
-
padding: 4px;
|
|
8
|
-
font-size: 10px;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
`,vt=(e,t)=>{var o;let n="?v=";return t?n+=Rr(t):n+=`${(o=e==null?void 0:e.meta)==null?void 0:o.version}${Rt(e==null?void 0:e.status)?"~":""}`,n};function ki({blocklet:e}){var u,d,f,p;const{inService:t}=W(),n=(u=((e==null?void 0:e.environments)||[]).find(h=>h.key===N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE))==null?void 0:u.value,o=(d=((e==null?void 0:e.environments)||[]).find(h=>h.key===N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_RECT))==null?void 0:d.value,r=(f=((e==null?void 0:e.environments)||[]).find(h=>h.key===N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_FAVICON))==null?void 0:f.value,s=((p=window.env)==null?void 0:p.apiPrefix)||"/",i=pt(s,`/blocklet/logo/${t?"":e.meta.did}`,vt(e,n)),a=pt(s,`/blocklet/logo-rect/${t?"":e.meta.did}`,vt(e,o)),c=pt(s,`/blocklet/logo-favicon/${t?"":e.meta.did}`,vt(e,r));return{logoUrl:i,rectLogoUrl:a,faviconUrl:c}}function on({blocklet:e,style:t,size:n,...o}){var a;const{logoUrl:r}=ki({blocklet:e}),{variant:s}=o;let i=l.jsx("img",{src:r,alt:"",style:{width:n}});return e.meta.logo||(a=(e.configs||[]).find(u=>u.key===N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE))!=null&&a.value||(i=l.jsx(Ar,{did:e.meta.did||"",responsive:!0})),l.jsx(uo,{variant:s||"square",style:Object.assign({backgroundColor:"transparent",width:n,height:n,borderRadius:10},t),...o,children:i})}on.propTypes={blocklet:y.object.isRequired,style:y.object,size:y.oneOfType([y.number,y.string])};on.defaultProps={style:{},size:40};const Ni=e=>{const t={};let n=null;return Lr(e,o=>{t[o.meta.bundleDid]?n=Ne(o,!0):o.meta.bundleDid&&(t[o.meta.bundleDid]=!0)}),n},Mi=(e,t,n)=>{var s;const{hostname:o,href:r}=e;if(!t)return r;if(n){const a=/\d+[-.]\d+[-.]\d+[-.]\d+/.exec(o);if(!a)return r;const c=a[0],d=((((s=t.site)==null?void 0:s.domainAliases)||[]).map(f=>f.value).filter(Boolean).find(f=>f.endsWith(B.DEFAULT_DID_DOMAIN))||"").replace(`.${B.DEFAULT_DID_DOMAIN}`,"");return d?r.replace(o,`${d}-${c}.${B.DEFAULT_IP_DOMAIN_SUFFIX}`):r}return r.replace(t.meta.bundleDid,t.appPid)};function wo(){const{t:e}=G(),{api:t}=hs(),{blocklet:n}=ce(),{inService:o}=W(),[r,s]=g.useState(!1),[i,a]=g.useState(5),c=n&&n.structVersion!==B.APP_STRUCT_VERSION,u=()=>{try{if(n.status==="running"){T.error(e("blocklet.migrate.tip.running"));return}const p=Ni(n);if(p){T.error(e("blocklet.migrate.tip.duplicate",{name:p}));return}s(!0)}catch(p){T.error(Me(p))}},d=()=>{const p=Mi(window.location,n,o);setTimeout(()=>{window.location.href=p},5e3),a(5),setInterval(()=>{a(h=>h-1)},1e3)},f=()=>s(!1);return[c&&l.jsxs(ps,{type:"warning",style:{margin:"12px 0"},children:[l.jsxs(L,{display:"flex",alignItems:"center",children:[l.jsx(be,{variant:"contained",size:"small",color:"primary",onClick:()=>u(),style:{marginRight:8},children:e("blocklet.migrate.intro.l1")}),l.jsx("span",{children:e("blocklet.migrate.intro.l2")})]}),["l3","l4","l5","l6"].map(p=>l.jsx(L,{display:"flex",alignItems:"center",children:e(`blocklet.migrate.intro.${p}`)},p))]},"alert"),n&&l.jsx(Ir,{popup:!0,open:r,saveConnect:!1,forceConnected:!1,action:"migrate-app-to-struct-v2",checkFn:t.get,checkTimeout:5*60*1e3,onSuccess:d,extraParams:{appDid:n.appDid,did:n.meta.did,wt:Dr(n,!0),title:Ne(n)},messages:{title:e("blocklet.migrate.title"),scan:e("blocklet.migrate.scan"),confirm:e("blocklet.migrate.confirm"),success:i>=0?e("blocklet.migrate.success",{sec:i}):"Redirecting..."},onClose:f},"connect")]}wo.propTypes={};async function Ui({blockletDid:e,nodeApi:t,spaceGateways:n}){let o=!1;const r=await Promise.all(n.map(async s=>{let{name:i}=s;const a=await ms(s.endpoint);return!Kt.isEmpty(a)&&a!==i&&(i=a,o=!0),{...s,name:i}}));return o&&await Promise.all(r.filter(s=>s.did).map(s=>t.updateBlockletSpaceGateway({input:{did:e,where:{did:s.did},spaceGateway:{...s}}}))),r}function Fi({setLoading:e,refresh:t}={}){var c;const{blocklet:n,actions:{refreshBlocklet:o}}=ce(),r=(c=n==null?void 0:n.meta)==null?void 0:c.did,[s,i]=g.useState([]),{api:a}=W();return it(async()=>{try{if(!r){i([]);return}e==null||e(!0);const{spaceGateways:u}=await a.getBlockletSpaceGateways({input:{did:r}}),d=await Ui({blockletDid:r,nodeApi:a,spaceGateways:u});i(d??[])}catch(u){console.error(u),T.error(Me(u))}finally{e==null||e(!1)}},[r,o,t]),{spaceGateways:s}}function _o({deps:e,setLoading:t}={deps:[],setLoading:()=>{}}){var a;const{blocklet:n}=ce(),[o,r]=g.useState([]),{api:s}=W(),i=Kt.debounce(async()=>{try{if(t(!0),!n){r([]);return}const{backups:c}=await s.getBlockletBackups({input:{did:n.meta.did}});r(c??[])}catch(c){console.error(c),T.error(Me(c))}finally{t(!1)}},2e3);return it(async()=>{i()},[(a=n==null?void 0:n.meta)==null?void 0:a.did].concat(e)),{backups:o}}function zi({appDid:e}){const{backups:t}=_o(),[n,o]=g.useState({message:"",progress:0,completed:!1}),r=W(),{ws:{useSubscription:s}}=r;return s(N.BlockletEvents.backupProgress,i=>{e===(i==null?void 0:i.appDid)&&o(()=>({...i}))},[e]),g.useEffect(()=>{var i;if(t!=null&&t.length&&Kt.isNull((i=t[0])==null?void 0:i.status)){const[a]=t;o(()=>({message:a.message,progress:a.progress,completed:a.progress>=100}))}},[t]),n}function Vi({deps:e}={deps:[]}){var s;const{blocklet:t}=ce(),{api:n}=W(),[o,r]=g.useState(null);return it(async()=>{var i;if((i=t==null?void 0:t.meta)!=null&&i.did){const{autoBackup:a}=await n.getAutoBackup({input:{did:t.meta.did}});r(a)}},[(s=t==null?void 0:t.meta)==null?void 0:s.did].concat(e)),o}function qi({deps:e}={deps:[]}){var s;const{blocklet:t}=ce(),{api:n}=W(),[o,r]=g.useState(null);return it(async()=>{var i;if((i=t==null?void 0:t.meta)!=null&&i.did){const{autoCheckUpdate:a}=await n.getAutoCheckUpdate({input:{did:t.meta.did}});r(a)}},[(s=t==null?void 0:t.meta)==null?void 0:s.did].concat(e)),o}const jo=g.createContext({}),{Provider:Hi,Consumer:Bl}=jo;function rn({children:e}){const{t}=G(),{api:n}=W(),{blocklet:o}=ce(),[r,s]=g.useState(!1),[i,a]=g.useState(!1),{spaceGateways:c}=Fi({refresh:i,setLoading:s}),u=zi({appDid:o==null?void 0:o.appDid}),[d,f]=g.useState(!1),p=g.useMemo(()=>gs(o==null?void 0:o.environments),[o,i,d]),[h,x]=g.useState(!1),{backups:v}=_o({deps:[u],setLoading:x}),[P,m]=g.useState(c==null?void 0:c.find(O=>O.endpoint===p)),[R,A]=g.useState(!1),w=Vi({deps:[R]}),[b,j]=g.useState(!1),E=qi({deps:[b]}),S=()=>{a(O=>!O)},C=()=>{f(O=>!O)},I=()=>{A(O=>!O)},Ce=()=>{j(O=>!O)},Se=async(O,J)=>{c.push({...O,loading:!0}),await n.addBlockletSpaceGateway({input:{did:o.meta.did,spaceGateway:O}}),p!==J&&await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:J}]}}),S(),m(O)},le=async O=>{if(O){if(O.endpoint===p){T.warning(t("storage.spaces.gateway.delete.failedForConnected"));return}await n.deleteBlockletSpaceGateway({input:{did:o.meta.did,spaceGatewayDid:O==null?void 0:O.did}}),S(),m(O)}},Oe=async O=>{await n.updateBlockletSpaceGateway({input:{did:o.meta.did,where:{did:O.did},spaceGateway:O}}),p!==O.endpoint&&await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:O.endpoint}]}}),T.success(t("storage.spaces.connectedWithName",{name:(O==null?void 0:O.name)??"DID Spaces"})),S()},ue=O=>(O==null?void 0:O.endpoint)===p,Ee=async O=>{await n.updateAutoBackup({input:{did:o.meta.did,autoBackup:O}}),I()},de=async O=>{await n.updateAutoCheckUpdate({input:{did:o.meta.did,autoCheckUpdate:O}}),Ce()};return l.jsx(Hi,{value:{spaceGateways:c,selectedSpaceGateway:P,addSpaceGateway:Se,deleteSpaceGateway:le,updateSpaceGateway:Oe,refreshSpaceGateways:S,spaceGatewaysLoading:r,spaceGatewayIsSelected:ue,updateAutoBackup:Ee,updateAutoCheckUpdate:de,autoCheckUpdate:E,backupEndpoint:p,backupProgress:u,backups:v,backupsLoading:h,refreshBackupEndpoint:C,autoBackup:w},children:e})}rn.propTypes={children:y.any.isRequired};rn.defaultProps={};function kl(){return g.useContext(jo)}const Co=g.createContext({});function Nl(){return g.useContext(Co)}const{Provider:Ki,Consumer:Ml}=Co,{did:U,appId:Wi}=window.env;function Gi({children:e}){var j,E;const{t,locale:n}=G(),{blocklet:o}=at(),[r,s]=g.useState([]),[i,a]=g.useState([]),[c,u]=g.useState([]),d=Ne(o),f=((j=((o==null?void 0:o.environments)||[]).find(S=>S.key===N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_PASSPORT_COLOR))==null?void 0:j.value)||"auto",p=(o==null?void 0:o.trustedPassports)||[],h=(o==null?void 0:o.trustedFactories)||[],x=(o==null?void 0:o.enablePassportIssuance)!==!1,v=async()=>{try{const S=await Ke.doBatchQuery({getRoles:{input:{teamDid:U}},getPermissions:{input:{teamDid:U}},getInvitations:{input:{teamDid:U}}});a((S.getRoles.roles||[]).filter(C=>!B.RBAC_CONFIG.roles.some(I=>I.name===C.name&&(!I.passport||I.ci))).map(C=>(C.hasDescription=!!C.description,C.hasDescription||(C.description=t("team.passport.description",{teamName:d,title:C.title})),C))),u(S.getPermissions.permissions||[]),s(S.getInvitations.invitations||[])}catch(S){T.error(S.message)}},P=({did:S}={})=>{const C={teamDid:U,user:{did:S}};return Ke.getUser({input:C})},m=({query:S,paging:C}={})=>{const I={teamDid:U};return C&&(I.paging=C),S&&(I.query=S),I.sort={lastLoginAt:-1},Ke.getUsers({input:I})},R=()=>Ke.getUsersCountPerRole({input:{teamDid:U}}),A=()=>v();g.useEffect(()=>{var S;(S=o==null?void 0:o.meta)!=null&&S.did&&v()},[(E=o==null?void 0:o.meta)==null?void 0:E.did]),g.useEffect(()=>{a(S=>S.map(C=>(C.hasDescription||(C.description=t("team.passport.description",{teamName:d,title:C.title})),{...C})))},[t,n]);const w=S=>{S.teamDid===U&&v()};Qe(B.EVENTS.USER_ADDED,w,[U]),Qe(B.EVENTS.USER_REMOVED,w,[U]),Qe(B.EVENTS.USER_UPDATED,w,[U]);const b={teamDid:U,teamIssuerDid:Wi,teamName:d,invitations:r,roles:i,permissions:c,trustedPassports:p,trustedFactories:h,isNodeTeam:!1,enablePassportIssuance:x,refresh:A,passportColor:f,endpoint:window.location.origin,blocklet:o,api:{getUser:P,getUsers:m,getUsersCountPerRole:R}};return l.jsx(Ki,{value:b,children:e})}function D(e,t,n){return oo.call(t,"css")?l.jsx(ro,so(e,t),n):l.jsx(e,t,n)}function yt(e,t,n){return oo.call(t,"css")?l.jsxs(ro,so(e,t),n):l.jsxs(e,t,n)}/**
|
|
12
|
-
* (c) Iconify
|
|
13
|
-
*
|
|
14
|
-
* For the full copyright and license information, please view the license.txt or license.gpl.txt
|
|
15
|
-
* files at https://github.com/iconify/iconify
|
|
16
|
-
*
|
|
17
|
-
* Licensed under Apache 2.0 or GPL 2.0 at your option.
|
|
18
|
-
* If derivative product is not compatible with one of licenses, you can pick one of licenses.
|
|
19
|
-
*
|
|
20
|
-
* @license Apache 2.0
|
|
21
|
-
* @license GPL 2.0
|
|
22
|
-
* @version 2.2.1
|
|
23
|
-
*/const Le=/^[a-z0-9]+(-[a-z0-9]+)*$/,V=Object.freeze({left:0,top:0,width:16,height:16,rotate:0,vFlip:!1,hFlip:!1});function sn(e){return{...V,...e}}function Qi(e,t){const n={...e};for(const o in V){const r=o;if(t[r]!==void 0){const s=t[r];if(n[r]===void 0){n[r]=s;continue}switch(r){case"rotate":n[r]=(n[r]+s)%4;break;case"hFlip":case"vFlip":n[r]=s!==n[r];break;default:n[r]=s}}}return n}function Bn(e,t,n=!1){function o(s,i){if(e.icons[s]!==void 0)return Object.assign({},e.icons[s]);if(i>5)return null;const a=e.aliases;if(a&&a[s]!==void 0){const u=a[s],d=o(u.parent,i+1);return d&&Qi(d,u)}const c=e.chars;return!i&&c&&c[s]!==void 0?o(c[s],i+1):null}const r=o(t,0);if(r)for(const s in V)r[s]===void 0&&e[s]!==void 0&&(r[s]=e[s]);return r&&n?sn(r):r}function Yi(e){for(const t in V)if(e[t]!==void 0)return!0;return!1}function So(e,t,n){n=n||{};const o=[];if(typeof e!="object"||typeof e.icons!="object")return o;e.not_found instanceof Array&&e.not_found.forEach(i=>{t(i,null),o.push(i)});const r=e.icons;Object.keys(r).forEach(i=>{const a=Bn(e,i,!0);a&&(t(i,a),o.push(i))});const s=n.aliases||"all";if(s!=="none"&&typeof e.aliases=="object"){const i=e.aliases;Object.keys(i).forEach(a=>{if(s==="variations"&&Yi(i[a]))return;const c=Bn(e,a,!0);c&&(t(a,c),o.push(a))})}return o}const It={provider:"string",aliases:"object",not_found:"object"};for(const e in V)It[e]=typeof V[e];function Oo(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object")return null;for(const r in It)if(e[r]!==void 0&&typeof e[r]!==It[r])return null;const n=t.icons;for(const r in n){const s=n[r];if(!r.match(Le)||typeof s.body!="string")return null;for(const i in V)if(s[i]!==void 0&&typeof s[i]!=typeof V[i])return null}const o=t.aliases;if(o)for(const r in o){const s=o[r],i=s.parent;if(!r.match(Le)||typeof i!="string"||!n[i]&&!o[i])return null;for(const a in V)if(s[a]!==void 0&&typeof s[a]!=typeof V[a])return null}return t}const je=(e,t,n,o="")=>{const r=e.split(":");if(e.slice(0,1)==="@"){if(r.length<2||r.length>3)return null;o=r.shift().slice(1)}if(r.length>3||!r.length)return null;if(r.length>1){const a=r.pop(),c=r.pop(),u={provider:r.length>0?r[0]:o,prefix:c,name:a};return t&&!xe(u)?null:u}const s=r[0],i=s.split("-");if(i.length>1){const a={provider:o,prefix:i.shift(),name:i.join("-")};return t&&!xe(a)?null:a}if(n&&o===""){const a={provider:o,prefix:"",name:s};return t&&!xe(a,n)?null:a}return null},xe=(e,t)=>e?!!((e.provider===""||e.provider.match(Le))&&(t&&e.prefix===""||e.prefix.match(Le))&&e.name.match(Le)):!1,Eo=1;let oe=Object.create(null);try{const e=window||self;e&&e._iconifyStorage.version===Eo&&(oe=e._iconifyStorage.storage)}catch{}function Xi(){try{const e=window||self;e&&!e._iconifyStorage&&(e._iconifyStorage={version:Eo,storage:oe})}catch{}}function Zi(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:Object.create(null)}}function Q(e,t){oe[e]===void 0&&(oe[e]=Object.create(null));const n=oe[e];return n[t]===void 0&&(n[t]=Zi(e,t)),n[t]}function an(e,t){if(!Oo(t))return[];const n=Date.now();return So(t,(o,r)=>{r?e.icons[o]=r:e.missing[o]=n})}function Ji(e,t,n){try{if(typeof n.body=="string")return e.icons[t]=Object.freeze(sn(n)),!0}catch{}return!1}function cn(e,t){const n=e.icons[t];return n===void 0?null:n}function ea(e,t){let n=[],o;return typeof e=="string"?o=[e]:o=Object.keys(oe),o.forEach(r=>{let s;typeof r=="string"&&typeof t=="string"?s=[t]:s=oe[r]===void 0?[]:Object.keys(oe[r]),s.forEach(i=>{const a=Q(r,i),c=Object.keys(a.icons).map(u=>(r!==""?"@"+r+":":"")+i+":"+u);n=n.concat(c)})}),n}let Be=!1;function ta(e){return typeof e=="boolean"&&(Be=e),Be}function ct(e){const t=typeof e=="string"?je(e,!0,Be):e;return t?cn(Q(t.provider,t.prefix),t.name):null}function Po(e,t){const n=je(e,!0,Be);if(!n)return!1;const o=Q(n.provider,n.prefix);return Ji(o,n.name,t)}function Ro(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=typeof e.provider=="string"?e.provider:""),Be&&t===""&&(typeof e.prefix!="string"||e.prefix==="")){let o=!1;return Oo(e)&&(e.prefix="",So(e,(r,s)=>{s&&Po(r,s)&&(o=!0)})),o}if(typeof e.prefix!="string"||!xe({provider:t,prefix:e.prefix,name:"a"}))return!1;const n=Q(t,e.prefix);return!!an(n,e)}function na(e){return ct(e)!==null}function oa(e){const t=ct(e);return t?{...t}:null}const ke=Object.freeze({inline:!1,width:null,height:null,hAlign:"center",vAlign:"middle",slice:!1,hFlip:!1,vFlip:!1,rotate:0});function lt(e,t){const n={};for(const o in e){const r=o;if(n[r]=e[r],t[r]===void 0)continue;const s=t[r];switch(r){case"inline":case"slice":typeof s=="boolean"&&(n[r]=s);break;case"hFlip":case"vFlip":s===!0&&(n[r]=!n[r]);break;case"hAlign":case"vAlign":typeof s=="string"&&s!==""&&(n[r]=s);break;case"width":case"height":(typeof s=="string"&&s!==""||typeof s=="number"&&s||s===null)&&(n[r]=s);break;case"rotate":typeof s=="number"&&(n[r]+=s);break}}return n}const ra=/(-?[0-9.]*[0-9]+[0-9.]*)/g,sa=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Ye(e,t,n){if(t===1)return e;if(n=n===void 0?100:n,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const o=e.split(ra);if(o===null||!o.length)return e;const r=[];let s=o.shift(),i=sa.test(s);for(;;){if(i){const a=parseFloat(s);isNaN(a)?r.push(s):r.push(Math.ceil(a*t*n)/n)}else r.push(s);if(s=o.shift(),s===void 0)return r.join("");i=!i}}function ia(e){let t="";switch(e.hAlign){case"left":t+="xMin";break;case"right":t+="xMax";break;default:t+="xMid"}switch(e.vAlign){case"top":t+="YMin";break;case"bottom":t+="YMax";break;default:t+="YMid"}return t+=e.slice?" slice":" meet",t}function ln(e,t){const n={left:e.left,top:e.top,width:e.width,height:e.height};let o=e.body;[e,t].forEach(a=>{const c=[],u=a.hFlip,d=a.vFlip;let f=a.rotate;u?d?f+=2:(c.push("translate("+(n.width+n.left).toString()+" "+(0-n.top).toString()+")"),c.push("scale(-1 1)"),n.top=n.left=0):d&&(c.push("translate("+(0-n.left).toString()+" "+(n.height+n.top).toString()+")"),c.push("scale(1 -1)"),n.top=n.left=0);let p;switch(f<0&&(f-=Math.floor(f/4)*4),f=f%4,f){case 1:p=n.height/2+n.top,c.unshift("rotate(90 "+p.toString()+" "+p.toString()+")");break;case 2:c.unshift("rotate(180 "+(n.width/2+n.left).toString()+" "+(n.height/2+n.top).toString()+")");break;case 3:p=n.width/2+n.left,c.unshift("rotate(-90 "+p.toString()+" "+p.toString()+")");break}f%2===1&&((n.left!==0||n.top!==0)&&(p=n.left,n.left=n.top,n.top=p),n.width!==n.height&&(p=n.width,n.width=n.height,n.height=p)),c.length&&(o='<g transform="'+c.join(" ")+'">'+o+"</g>")});let r,s;t.width===null&&t.height===null?(s="1em",r=Ye(s,n.width/n.height)):t.width!==null&&t.height!==null?(r=t.width,s=t.height):t.height!==null?(s=t.height,r=Ye(s,n.width/n.height)):(r=t.width,s=Ye(r,n.height/n.width)),r==="auto"&&(r=n.width),s==="auto"&&(s=n.height),r=typeof r=="string"?r:r.toString()+"",s=typeof s=="string"?s:s.toString()+"";const i={attributes:{width:r,height:s,preserveAspectRatio:ia(t),viewBox:n.left.toString()+" "+n.top.toString()+" "+n.width.toString()+" "+n.height.toString()},body:o};return t.inline&&(i.inline=!0),i}function aa(e,t){return ln(sn(e),t?lt(ke,t):ke)}const ca=/\sid="(\S+)"/g,la="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let ua=0;function Ao(e,t=la){const n=[];let o;for(;o=ca.exec(e);)n.push(o[1]);return n.length&&n.forEach(r=>{const s=typeof t=="function"?t(r):t+(ua++).toString(),i=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+i+')([")]|\\.[a-z])',"g"),"$1"+s+"$3")}),e}const Io="iconify2",Ue="iconify",Do=Ue+"-count",Lo=Ue+"-version",To=36e5,da=168,we={local:!0,session:!0};let Dt=!1;const $o={local:0,session:0},Bo={local:[],session:[]};let Ge=typeof window>"u"?{}:window;function ko(e){const t=e+"Storage";try{if(Ge&&Ge[t]&&typeof Ge[t].length=="number")return Ge[t]}catch{}return we[e]=!1,null}function un(e,t,n){try{return e.setItem(Do,n.toString()),$o[t]=n,!0}catch{return!1}}function No(e){const t=e.getItem(Do);if(t){const n=parseInt(t);return n||0}return 0}function fa(e,t){try{e.setItem(Lo,Io)}catch{}un(e,t,0)}function pa(e){try{const t=No(e);for(let n=0;n<t;n++)e.removeItem(Ue+n.toString())}catch{}}const Mo=()=>{if(Dt)return;Dt=!0;const e=Math.floor(Date.now()/To)-da;function t(n){const o=ko(n);if(!o)return;const r=s=>{const i=Ue+s.toString(),a=o.getItem(i);if(typeof a!="string")return!1;let c=!0;try{const u=JSON.parse(a);if(typeof u!="object"||typeof u.cached!="number"||u.cached<e||typeof u.provider!="string"||typeof u.data!="object"||typeof u.data.prefix!="string")c=!1;else{const d=u.provider,f=u.data.prefix,p=Q(d,f);c=an(p,u.data).length>0}}catch{c=!1}return c||o.removeItem(i),c};try{const s=o.getItem(Lo);if(s!==Io){s&&pa(o),fa(o,n);return}let i=No(o);for(let a=i-1;a>=0;a--)r(a)||(a===i-1?i--:Bo[n].push(a));un(o,n,i)}catch{}}for(const n in we)t(n)},ha=(e,t)=>{Dt||Mo();function n(o){if(!we[o])return!1;const r=ko(o);if(!r)return!1;let s=Bo[o].shift();if(s===void 0&&(s=$o[o],!un(r,o,s+1)))return!1;try{const i={cached:Math.floor(Date.now()/To),provider:e,data:t};r.setItem(Ue+s.toString(),JSON.stringify(i))}catch{return!1}return!0}Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))},Lt={};function Uo(e,t){switch(e){case"local":case"session":we[e]=t;break;case"all":for(const n in we)we[n]=t;break}}const Tt=Object.create(null);function Fo(e,t){Tt[e]=t}function $t(e){return Tt[e]||Tt[""]}function dn(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===void 0?"/":e.path,maxURL:e.maxURL?e.maxURL:500,rotate:e.rotate?e.rotate:750,timeout:e.timeout?e.timeout:5e3,random:e.random===!0,index:e.index?e.index:0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const ut=Object.create(null),Re=["https://api.simplesvg.com","https://api.unisvg.com"],Xe=[];for(;Re.length>0;)Re.length===1||Math.random()>.5?Xe.push(Re.shift()):Xe.push(Re.pop());ut[""]=dn({resources:["https://api.iconify.design"].concat(Xe)});function zo(e,t){const n=dn(t);return n===null?!1:(ut[e]=n,!0)}function dt(e){return ut[e]}function ma(){return Object.keys(ut)}const fn=(e,t)=>{let n=e,o=n.indexOf("?")!==-1;function r(s){switch(typeof s){case"boolean":return s?"true":"false";case"number":return encodeURIComponent(s);case"string":return encodeURIComponent(s);default:throw new Error("Invalid parameter")}}return Object.keys(t).forEach(s=>{let i;try{i=r(t[s])}catch{return}n+=(o?"&":"?")+encodeURIComponent(s)+"="+i,o=!0}),n},Vo={},Ze={},ga=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}return null};let tt=ga();function va(e){tt=e}function ya(){return tt}function ba(e,t){const n=dt(e);if(!n)return 0;let o;if(!n.maxURL)o=0;else{let s=0;n.resources.forEach(a=>{s=Math.max(s,a.length)});const i=fn(t+".json",{icons:""});o=n.maxURL-s-n.path.length-i.length}const r=e+":"+t;return Ze[e]=n.path,Vo[r]=o,o}function xa(e){return e===404}const wa=(e,t,n)=>{const o=[];let r=Vo[t];r===void 0&&(r=ba(e,t));const s="icons";let i={type:s,provider:e,prefix:t,icons:[]},a=0;return n.forEach((c,u)=>{a+=c.length+1,a>=r&&u>0&&(o.push(i),i={type:s,provider:e,prefix:t,icons:[]},a=c.length),i.icons.push(c)}),o.push(i),o};function _a(e){if(typeof e=="string"){if(Ze[e]===void 0){const t=dt(e);if(!t)return"/";Ze[e]=t.path}return Ze[e]}return"/"}const ja=(e,t,n)=>{if(!tt){n("abort",424);return}let o=_a(t.provider);switch(t.type){case"icons":{const s=t.prefix,a=t.icons.join(",");o+=fn(s+".json",{icons:a});break}case"custom":{const s=t.uri;o+=s.slice(0,1)==="/"?s.slice(1):s;break}default:n("abort",400);return}let r=503;tt(e+o).then(s=>{const i=s.status;if(i!==200){setTimeout(()=>{n(xa(i)?"abort":"next",i)});return}return r=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{n("next",r)});return}setTimeout(()=>{n("success",s)})}).catch(()=>{n("next",r)})},Ca={prepare:wa,send:ja};function Sa(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((r,s)=>r.provider!==s.provider?r.provider.localeCompare(s.provider):r.prefix!==s.prefix?r.prefix.localeCompare(s.prefix):r.name.localeCompare(s.name));let o={provider:"",prefix:"",name:""};return e.forEach(r=>{if(o.name===r.name&&o.prefix===r.prefix&&o.provider===r.provider)return;o=r;const s=r.provider,i=r.prefix,a=r.name;n[s]===void 0&&(n[s]=Object.create(null));const c=n[s];c[i]===void 0&&(c[i]=Q(s,i));const u=c[i];let d;u.icons[a]!==void 0?d=t.loaded:i===""||u.missing[a]!==void 0?d=t.missing:d=t.pending;const f={provider:s,prefix:i,name:a};d.push(f)}),t}const re=Object.create(null),bt=Object.create(null);function qo(e,t){e.forEach(n=>{const o=n.provider;if(re[o]===void 0)return;const r=re[o],s=n.prefix,i=r[s];i&&(r[s]=i.filter(a=>a.id!==t))})}function Oa(e,t){bt[e]===void 0&&(bt[e]=Object.create(null));const n=bt[e];n[t]||(n[t]=!0,setTimeout(()=>{if(n[t]=!1,re[e]===void 0||re[e][t]===void 0)return;const o=re[e][t].slice(0);if(!o.length)return;const r=Q(e,t);let s=!1;o.forEach(i=>{const a=i.icons,c=a.pending.length;a.pending=a.pending.filter(u=>{if(u.prefix!==t)return!0;const d=u.name;if(r.icons[d]!==void 0)a.loaded.push({provider:e,prefix:t,name:d});else if(r.missing[d]!==void 0)a.missing.push({provider:e,prefix:t,name:d});else return s=!0,!0;return!1}),a.pending.length!==c&&(s||qo([{provider:e,prefix:t}],i.id),i.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),i.abort))})}))}let Ea=0;function Pa(e,t,n){const o=Ea++,r=qo.bind(null,n,o);if(!t.pending.length)return r;const s={id:o,icons:t,callback:e,abort:r};return n.forEach(i=>{const a=i.provider,c=i.prefix;re[a]===void 0&&(re[a]=Object.create(null));const u=re[a];u[c]===void 0&&(u[c]=[]),u[c].push(s)}),r}function Ra(e,t=!0,n=!1){const o=[];return e.forEach(r=>{const s=typeof r=="string"?je(r,!1,n):r;(!t||xe(s,n))&&o.push({provider:s.provider,prefix:s.prefix,name:s.name})}),o}var kn={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Aa(e,t,n,o){const r=e.resources.length,s=e.random?Math.floor(Math.random()*r):e.index;let i;if(e.random){let j=e.resources.slice(0);for(i=[];j.length>1;){const E=Math.floor(Math.random()*j.length);i.push(j[E]),j=j.slice(0,E).concat(j.slice(E+1))}i=i.concat(j)}else i=e.resources.slice(s).concat(e.resources.slice(0,s));const a=Date.now();let c="pending",u=0,d,f=null,p=[],h=[];typeof o=="function"&&h.push(o);function x(){f&&(clearTimeout(f),f=null)}function v(){c==="pending"&&(c="aborted"),x(),p.forEach(j=>{j.status==="pending"&&(j.status="aborted")}),p=[]}function P(j,E){E&&(h=[]),typeof j=="function"&&h.push(j)}function m(){return{startTime:a,payload:t,status:c,queriesSent:u,queriesPending:p.length,subscribe:P,abort:v}}function R(){c="failed",h.forEach(j=>{j(void 0,d)})}function A(){p.forEach(j=>{j.status==="pending"&&(j.status="aborted")}),p=[]}function w(j,E,S){const C=E!=="success";switch(p=p.filter(I=>I!==j),c){case"pending":break;case"failed":if(C||!e.dataAfterTimeout)return;break;default:return}if(E==="abort"){d=S,R();return}if(C){d=S,p.length||(i.length?b():R());return}if(x(),A(),!e.random){const I=e.resources.indexOf(j.resource);I!==-1&&I!==e.index&&(e.index=I)}c="completed",h.forEach(I=>{I(S)})}function b(){if(c!=="pending")return;x();const j=i.shift();if(j===void 0){if(p.length){f=setTimeout(()=>{x(),c==="pending"&&(A(),R())},e.timeout);return}R();return}const E={status:"pending",resource:j,callback:(S,C)=>{w(E,S,C)}};p.push(E),u++,f=setTimeout(b,e.rotate),n(j,t,E.callback)}return setTimeout(b),m}function Ia(e){if(typeof e!="object"||typeof e.resources!="object"||!(e.resources instanceof Array)||!e.resources.length)throw new Error("Invalid Reduncancy configuration");const t=Object.create(null);let n;for(n in kn)e[n]!==void 0?t[n]=e[n]:t[n]=kn[n];return t}function Ho(e){const t=Ia(e);let n=[];function o(){n=n.filter(a=>a().status==="pending")}function r(a,c,u){const d=Aa(t,a,c,(f,p)=>{o(),u&&u(f,p)});return n.push(d),d}function s(a){const c=n.find(u=>a(u));return c!==void 0?c:null}return{query:r,find:s,setIndex:a=>{t.index=a},getIndex:()=>t.index,cleanup:o}}function Nn(){}const xt=Object.create(null);function Da(e){if(xt[e]===void 0){const t=dt(e);if(!t)return;const n=Ho(t),o={config:t,redundancy:n};xt[e]=o}return xt[e]}function Ko(e,t,n){let o,r;if(typeof e=="string"){const s=$t(e);if(!s)return n(void 0,424),Nn;r=s.send;const i=Da(e);i&&(o=i.redundancy)}else{const s=dn(e);if(s){o=Ho(s);const i=e.resources?e.resources[0]:"",a=$t(i);a&&(r=a.send)}}return!o||!r?(n(void 0,424),Nn):o.query(t,r,n)().abort}function Mn(){}const q=Object.create(null),wt=Object.create(null),_t=Object.create(null),jt=Object.create(null);function La(e,t){_t[e]===void 0&&(_t[e]=Object.create(null));const n=_t[e];n[t]||(n[t]=!0,setTimeout(()=>{n[t]=!1,Oa(e,t)}))}const Un=Object.create(null);function Ta(e,t,n){function o(){const a=(e===""?"":"@"+e+":")+t,c=Math.floor(Date.now()/6e4);Un[a]<c&&(Un[a]=c,console.error('Unable to retrieve icons for "'+a+'" because API is not configured properly.'))}wt[e]===void 0&&(wt[e]=Object.create(null));const r=wt[e];jt[e]===void 0&&(jt[e]=Object.create(null));const s=jt[e];q[e]===void 0&&(q[e]=Object.create(null));const i=q[e];r[t]===void 0?r[t]=n:r[t]=r[t].concat(n).sort(),s[t]||(s[t]=!0,setTimeout(()=>{s[t]=!1;const a=r[t];delete r[t];const c=$t(e);if(!c){o();return}c.prepare(e,t,a).forEach(d=>{Ko(e,d,(f,p)=>{const h=Q(e,t);if(typeof f!="object"){if(p!==404)return;const x=Date.now();d.icons.forEach(v=>{h.missing[v]=x})}else try{const x=an(h,f);if(!x.length)return;const v=i[t];x.forEach(P=>{delete v[P]}),Lt.store&&Lt.store(e,f)}catch(x){console.error(x)}La(e,t)})})}))}const Fn=e=>{const t=e.provider,n=e.prefix;return q[t]&&q[t][n]&&q[t][n][e.name]!==void 0},pn=(e,t)=>{const n=Ra(e,!0,ta()),o=Sa(n);if(!o.pending.length){let u=!0;return t&&setTimeout(()=>{u&&t(o.loaded,o.missing,o.pending,Mn)}),()=>{u=!1}}const r=Object.create(null),s=[];let i,a;o.pending.forEach(u=>{const d=u.provider,f=u.prefix;if(f===a&&d===i)return;i=d,a=f,s.push({provider:d,prefix:f}),q[d]===void 0&&(q[d]=Object.create(null));const p=q[d];p[f]===void 0&&(p[f]=Object.create(null)),r[d]===void 0&&(r[d]=Object.create(null));const h=r[d];h[f]===void 0&&(h[f]=[])});const c=Date.now();return o.pending.forEach(u=>{const d=u.provider,f=u.prefix,p=u.name,h=q[d][f];h[p]===void 0&&(h[p]=c,r[d][f].push(p))}),s.forEach(u=>{const d=u.provider,f=u.prefix;r[d][f].length&&Ta(d,f,r[d][f])}),t?Pa(t,o,s):Mn},$a=e=>new Promise((t,n)=>{const o=typeof e=="string"?je(e):e;pn([o||e],r=>{if(r.length&&o){const s=Q(o.provider,o.prefix),i=cn(s,o.name);if(i){t(i);return}}n(e)})}),ve="iconifyFinder"+Date.now(),Te="iconifyData"+Date.now();function Wo(e,t,n,o){let r;try{r=document.createElement("span")}catch{return o?"":null}const s=ln(n,lt(ke,t)),i=e.element,a=e.finder,c=e.name,u=i?i.getAttribute("class"):"",d=a?a.classFilter(u?u.split(/\s+/):[]):[],p='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="'+("iconify iconify--"+c.prefix+(c.provider===""?"":" iconify--"+c.provider)+(d.length?" "+d.join(" "):""))+'">'+Ao(s.body)+"</svg>";r.innerHTML=p;const h=r.childNodes[0],x=h.style,v=s.attributes;if(Object.keys(v).forEach(m=>{h.setAttribute(m,v[m])}),s.inline&&(x.verticalAlign="-0.125em"),i){const m=i.attributes;for(let A=0;A<m.length;A++){const w=m.item(A);if(w){const b=w.name;if(b!=="class"&&b!=="style"&&v[b]===void 0)try{h.setAttribute(b,w.value)}catch{}}}const R=i.style;for(let A=0;A<R.length;A++){const w=R[A];x[w]=R[w]}}if(a){const m={name:c,status:"loaded",customisations:t};h[Te]=m,h[ve]=a}const P=o?r.innerHTML:h;return i&&i.parentNode?i.parentNode.replaceChild(h,i):r.removeChild(h),P}let ae=[];function Fe(e){for(let t=0;t<ae.length;t++){const n=ae[t];if((typeof n.node=="function"?n.node():n.node)===e)return n}}function Go(e,t=!1){let n=Fe(e);return n?(n.temporary&&(n.temporary=t),n):(n={node:e,temporary:t},ae.push(n),n)}function Ba(){if(document.documentElement)return Go(document.documentElement);ae.push({node:()=>document.documentElement})}function ka(e){ae=ae.filter(t=>{const n=typeof t.node=="function"?t.node():t.node;return e!==n})}function ze(){return ae}function Na(e){const t=document;t.readyState==="complete"||t.readyState!=="loading"&&!t.documentElement.doScroll?e():(t.addEventListener("DOMContentLoaded",e),window.addEventListener("load",e))}let $e=null;const Ma={childList:!0,subtree:!0,attributes:!0};function Qo(e){if(!e.observer)return;const t=e.observer;t.pendingScan||(t.pendingScan=setTimeout(()=>{delete t.pendingScan,$e&&$e(e)}))}function Ua(e,t){if(!e.observer)return;const n=e.observer;if(!n.pendingScan)for(let o=0;o<t.length;o++){const r=t[o];if(r.addedNodes&&r.addedNodes.length>0||r.type==="attributes"&&r.target[ve]!==void 0){n.paused||Qo(e);return}}}function Yo(e,t){e.observer.instance.observe(t,Ma)}function nt(e){let t=e.observer;if(t&&t.instance)return;const n=typeof e.node=="function"?e.node():e.node;n&&(t||(t={paused:0},e.observer=t),t.instance=new MutationObserver(Ua.bind(null,e)),Yo(e,n),t.paused||Qo(e))}function zn(){ze().forEach(nt)}function Xo(e){if(!e.observer)return;const t=e.observer;t.pendingScan&&(clearTimeout(t.pendingScan),delete t.pendingScan),t.instance&&(t.instance.disconnect(),delete t.instance)}function Fa(e){const t=$e!==null;if($e!==e&&($e=e,t&&ze().forEach(Xo)),t){zn();return}Na(zn)}function Bt(e){(e?[e]:ze()).forEach(t=>{if(!t.observer){t.observer={paused:1};return}const n=t.observer;if(n.paused++,n.paused>1||!n.instance)return;n.instance.disconnect()})}function za(e){if(e){const t=Fe(e);t&&Bt(t)}else Bt()}function kt(e){(e?[e]:ze()).forEach(t=>{if(!t.observer){nt(t);return}const n=t.observer;if(n.paused&&(n.paused--,!n.paused)){const o=typeof t.node=="function"?t.node():t.node;if(o)n.instance?Yo(t,o):nt(t);else return}})}function Va(e){if(e){const t=Fe(e);t&&kt(t)}else kt()}function Zo(e,t=!1){const n=Go(e,t);return nt(n),n}function Jo(e){const t=Fe(e);t&&(Xo(t),ka(e))}const Nt=[];function qa(e){Nt.indexOf(e)===-1&&Nt.push(e)}function Vn(e){return typeof e=="string"&&(e=je(e)),e===null||!xe(e)?null:e}function Ha(e,t){const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(let r=0;r<n.length;r++){const s=n[r];if(t[s]!==e[s])return!1}return!0}function Ka(e){const t=[];Nt.forEach(o=>{const r=o.find(e);Array.prototype.forEach.call(r,s=>{const i=s;if(i[ve]!==void 0&&i[ve]!==o)return;const a=Vn(o.name(i));if(a===null)return;i[ve]=o;const c={element:i,finder:o,name:a};t.push(c)})});const n=e.querySelectorAll("svg.iconify");return Array.prototype.forEach.call(n,o=>{const r=o,s=r[ve],i=r[Te];if(!s||!i)return;const a=Vn(s.name(r));if(a===null)return;let c=!1,u;if(a.prefix!==i.name.prefix||a.name!==i.name.name?c=!0:(u=s.customisations(r),Ha(i.customisations,u)||(c=!0)),c){const d={element:r,finder:s,name:a,customisations:u};t.push(d)}}),t}let De=!1;function Wa(){De||(De=!0,setTimeout(()=>{De&&(De=!1,_e())}))}const Ga=(e,t)=>e!==null&&t!==null&&e.name===t.name&&e.prefix===t.prefix;function Qa(e){const t=Fe(e);t?_e(t):_e({node:e,temporary:!0},!0)}function _e(e,t=!1){De=!1;const n=Object.create(null);(e?[e]:ze()).forEach(o=>{const r=typeof o.node=="function"?o.node():o.node;if(!r||!r.querySelectorAll)return;let s=!1,i=!1;Ka(r).forEach(a=>{const c=a.element,u=a.name,d=u.provider,f=u.prefix,p=u.name;let h=c[Te];if(h!==void 0&&Ga(h.name,u))switch(h.status){case"missing":return;case"loading":if(Fn({provider:d,prefix:f,name:p})){s=!0;return}}const x=Q(d,f);if(x.icons[p]!==void 0){!i&&o.observer&&(Bt(o),i=!0);const v=a.customisations!==void 0?a.customisations:a.finder.customisations(c);Wo(a,v,cn(x,p));return}if(x.missing[p]){h={name:u,status:"missing",customisations:{}},c[Te]=h;return}if(!Fn({provider:d,prefix:f,name:p})){n[d]===void 0&&(n[d]=Object.create(null));const v=n[d];v[f]===void 0&&(v[f]=Object.create(null)),v[f][p]=!0}h={name:u,status:"loading",customisations:{}},c[Te]=h,s=!0}),o.temporary&&!s?Jo(r):t&&s?Zo(r,!0):i&&o.observer&&kt(o)}),Object.keys(n).forEach(o=>{const r=n[o];Object.keys(r).forEach(s=>{pn(Object.keys(r[s]).map(i=>({provider:o,prefix:s,name:i})),Wa)})})}function Ya(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function o(r){for(;r<0;)r+=4;return r%4}if(n===""){const r=parseInt(e);return isNaN(r)?0:o(r)}else if(n!==e){let r=0;switch(n){case"%":r=25;break;case"deg":r=90}if(r){let s=parseFloat(e.slice(0,e.length-n.length));return isNaN(s)?0:(s=s/r,s%1===0?o(s):0)}}return t}const er=/[\s,]+/;function Xa(e,t){t.split(er).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function Za(e,t){t.split(er).forEach(n=>{const o=n.trim();switch(o){case"left":case"center":case"right":e.hAlign=o;break;case"top":case"middle":case"bottom":e.vAlign=o;break;case"slice":case"crop":e.slice=!0;break;case"meet":e.slice=!1}})}function ge(e,t){return e.hasAttribute(t)}function Ae(e,t){return e.getAttribute(t)}function Ja(e,t){const n=e.getAttribute(t);return n===t||n==="true"?!0:n===""||n==="false"?!1:null}const ec=["inline","hFlip","vFlip"],tc=["width","height"],qn="iconify",Mt="iconify-inline",nc="i."+qn+", span."+qn+", i."+Mt+", span."+Mt,oc={find:e=>e.querySelectorAll(nc),name:e=>ge(e,"data-icon")?Ae(e,"data-icon"):null,customisations:(e,t={inline:!1})=>{const n=t,o=e.getAttribute("class");if((o?o.split(/\s+/):[]).indexOf(Mt)!==-1&&(n.inline=!0),ge(e,"data-rotate")){const s=Ya(Ae(e,"data-rotate"));s&&(n.rotate=s)}return ge(e,"data-flip")&&Xa(n,Ae(e,"data-flip")),ge(e,"data-align")&&Za(n,Ae(e,"data-align")),ec.forEach(s=>{if(ge(e,"data-"+s)){const i=Ja(e,"data-"+s);typeof i=="boolean"&&(n[s]=i)}}),tc.forEach(s=>{if(ge(e,"data-"+s)){const i=Ae(e,"data-"+s);i!==""&&(n[s]=i)}}),n},classFilter:e=>{const t=[];return e.forEach(n=>{n!=="iconify"&&n!==""&&n.slice(0,9)!=="iconify--"&&t.push(n)}),t}};function tr(e,t,n){const o=ct(e);if(!o)return null;const r=je(e),s=lt(ke,typeof t=="object"?t:{});return Wo({name:r},s,o,n)}function rc(){return"2.2.1"}function sc(e,t){return tr(e,t,!1)}function ic(e,t){return tr(e,t,!0)}function ac(e,t){const n=ct(e);if(!n)return null;const o=lt(ke,typeof t=="object"?t:{});return ln(n,o)}function cc(e){e?Qa(e):_e()}if(typeof document<"u"&&typeof window<"u"){Ba(),qa(oc);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(o=>{try{(typeof o!="object"||o===null||o instanceof Array||typeof o.icons!="object"||typeof o.prefix!="string"||!Ro(o))&&console.error(n)}catch{console.error(n)}})}setTimeout(()=>{Fa(_e),_e()})}function lc(e,t){Uo(e,t!==!1)}function uc(e){Uo(e,!0)}Fo("",Ca);if(typeof document<"u"&&typeof window<"u"){Lt.store=ha,Mo();const e=window;if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(const n in t){const o="IconifyProviders["+n+"] is invalid.";try{const r=t[n];if(typeof r!="object"||!r||r.resources===void 0)continue;zo(n,r)||console.error(o)}catch{console.error(o)}}}}const dc={getAPIConfig:dt,setAPIModule:Fo,sendAPIQuery:Ko,setFetch:va,getFetch:ya,listAPIProviders:ma,mergeParams:fn},fc={_api:dc,addAPIProvider:zo,loadIcons:pn,loadIcon:$a,iconExists:na,getIcon:oa,listIcons:ea,addIcon:Po,addCollection:Ro,shareStorage:Xi,replaceIDs:Ao,calculateSize:Ye,buildIcon:aa,getVersion:rc,renderSVG:sc,renderHTML:ic,renderIcon:ac,scan:cc,observe:Zo,stopObserving:Jo,pauseObserver:za,resumeObserver:Va,enableCache:lc,disableCache:uc};try{self.Iconify===void 0&&(self.Iconify=fc)}catch{}var hn={},pc=K;Object.defineProperty(hn,"__esModule",{value:!0});var nr=hn.default=void 0,hc=pc(H()),mc=l,gc=(0,hc.default)((0,mc.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline");nr=hn.default=gc;var mn={},vc=K;Object.defineProperty(mn,"__esModule",{value:!0});var or=mn.default=void 0,yc=vc(H()),bc=l,xc=(0,yc.default)((0,bc.jsx)("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"}),"Fullscreen");or=mn.default=xc;var gn={},wc=K;Object.defineProperty(gn,"__esModule",{value:!0});var rr=gn.default=void 0,_c=wc(H()),jc=l,Cc=(0,_c.default)((0,jc.jsx)("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"}),"FullscreenExit");rr=gn.default=Cc;function vn({infos:e}){const{t}=G(),n=e.map(r=>`* ${r.label}: ${r.value}`).join(`
|
|
24
|
-
`),o=new URL("https://github.com/blocklet/blocklet-site/issues/new");return o.searchParams.set("title","[Feedback]"),o.searchParams.set("body",`<!-- [Enter feedback here] -->
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
<!--
|
|
29
|
-
Document Details
|
|
30
|
-
${n}
|
|
31
|
-
* Page: ${window.location.href}
|
|
32
|
-
-->
|
|
33
|
-
`),D(L,{sx:{mx:{xs:0,md:2}},children:D(Tr,{sx:{color:"text.primary"},target:"_blank",href:o.href,rel:"noreferrer",style:{textDecoration:"underline"},children:t("common.reportIssue")})})}vn.propTypes={infos:y.arrayOf(y.shape({label:y.string,value:y.string}))};vn.defaultProps={infos:[]};function yn({meta:e,fallbackUrl:t,invalidPathFallback:n,headerAddons:o,sessionManagerProps:r,links:s,...i}){var w;xs();const a=g.useContext($r),c=(w=a==null?void 0:a.session)==null?void 0:w.user,u=c==null?void 0:c.role,{locale:d}=G()||{},f=g.useMemo(()=>{const b=Object.assign({},window.blocklet,e);try{return ws(b)}catch(j){return console.error("Failed to format blocklet info",j,b),b}},[e]),{localizedNav:p,flattened:h,matchedIndex:x}=g.useMemo(()=>{var S;let b=_s((S=f==null?void 0:f.navigation)==null?void 0:S.dashboard,d)||[];b=js(b,u),b=Cs(b,C=>({title:C.title,url:C.link,icon:C.icon?l.jsx("iconify-icon",{icon:C.icon}):null,external:!0,children:C.items}),"items");const j=Ss(b).filter(C=>!!C.url),E=Os(j.map(C=>C.url));return E!==-1&&(j[E].active=!0),{localizedNav:b,flattened:j,matchedIndex:E}},[f,d,u]),v=typeof s=="function"?s(p):[...p,...s];if(g.useLayoutEffect(()=>{c&&!(h!=null&&h.length)&&t&&(window.location.href=t)},[t]),g.useLayoutEffect(()=>{var b;c&&(h!=null&&h.length)&&x===-1&&(n?n():window.location.href=((b=h[0])==null?void 0:b.url)||et)},[n,h,x]),!f.appName)return null;const{appLogo:P,appLogoRect:m,appName:R}=f,A=l.jsx(Es,{formattedBlocklet:f,addons:o,sessionManagerProps:r});return l.jsx(Rs,{title:R,fullWidth:!0,sidebarWidth:128,legacy:!1,links:v,...i,headerProps:{homeLink:et,logo:l.jsx("img",{src:m||P,alt:"logo"}),addons:A,...i.headerProps}})}yn.propTypes={meta:ys,fallbackUrl:y.string,invalidPathFallback:y.func,headerAddons:y.oneOfType([y.func,y.node]),sessionManagerProps:bs,links:y.oneOfType([y.array,y.func])};yn.defaultProps={meta:{},fallbackUrl:et,invalidPathFallback:null,headerAddons:void 0,sessionManagerProps:{showRole:!0,onLogout:()=>{window.location.href=et}},links:[]};var bn={},Sc=K;Object.defineProperty(bn,"__esModule",{value:!0});var sr=bn.default=void 0,Oc=Sc(H()),Hn=l,Ec=(0,Oc.default)([(0,Hn.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"},"0"),(0,Hn.jsx)("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")],"AccessTime");sr=bn.default=Ec;var Pc={year:{long:"year",short:"y"},day:{long:"day",short:"d"},hour:{long:"hour",short:"h"},minute:{long:"minute",short:"m"},second:{long:"second",short:"s"},millisecond:{long:"millisecond",short:"ms"},microsecond:{long:"microsecond",short:"µs"},nanosecond:{long:"nanosecond",short:"ns"}},Rc={year:{long:"年",short:"年"},day:{long:"天",short:"天"},hour:{long:"小时",short:"小时"},minute:{long:"分钟",short:"分"},second:{long:"秒钟",short:"秒"},millisecond:{long:"毫秒",short:"毫秒"},microsecond:{long:"微秒",short:"微秒"},nanosecond:{long:"纳秒",short:"纳秒"}};const Ut=new Map,Ac=(e,t)=>{Ut.set(e,t)},Ic=(e="en_US")=>Ut.get(e)||Ut.get("en_US");var ir={registerLang:Ac,getLang:Ic},Dc=e=>{if(typeof e!="number")throw new TypeError("Expected a number");const t=e>0?Math.floor:Math.ceil;return{days:t(e/864e5),hours:t(e/36e5)%24,minutes:t(e/6e4)%60,seconds:t(e/1e3)%60,milliseconds:t(e)%1e3,microseconds:t(e*1e3)%1e3,nanoseconds:t(e*1e6)%1e3}};const Lc=Dc,{getLang:Ie}=ir,Tc=(e,t)=>t===1?e:`${e}s`,$c=1e-7;var Bc=(e,t={})=>{if(!Number.isFinite(e))throw new TypeError("Expected a finite number");t.colonNotation&&(t.compact=!1,t.formatSubMilliseconds=!1,t.separateMilliseconds=!1,t.verbose=!1),t.compact&&(t.secondsDecimalDigits=0,t.millisecondsDecimalDigits=0);const n=Ie(t.locale),o=[],r=(a,c)=>{const u=Math.floor(a*10**c+$c);return(Math.round(u)/10**c).toFixed(c)},s=(a,c,u)=>{if((o.length===0||!t.colonNotation)&&a===0&&!(t.colonNotation&&c==="minute"))return;const{long:d}=n[c]||Ie("en_US")[c],{short:f}=n[c]||Ie("en_US")[c];let p=(u||a||"0").toString(),h,x;if(t.colonNotation){h=o.length>0?":":"",x="";const v=p.includes(".")?p.split(".")[0].length:p.length,P=o.length>0?2:1;p="0".repeat(Math.max(0,P-v))+p}else h="",t.locale==="zh_CN"?Object.values(i).filter(v=>v>0).length>1?!i.days&&!i.hours&&i.minutes&&t.compact?x=d:x=f:i.minutes?x=d:x=f:x=t.verbose?` ${Tc(d,a)}`:f;o.push(h+p+x)},i=Lc(e);if(s(Math.trunc(i.days/365),"year"),s(i.days%365,"day"),s(i.hours,"hour"),s(i.minutes,"minute"),t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3)if(s(i.seconds,"second"),t.formatSubMilliseconds)s(i.milliseconds,"millisecond"),s(i.microseconds,"microsecond"),s(i.nanoseconds,"nanosecond");else{const a=i.milliseconds+i.microseconds/1e3+i.nanoseconds/1e6,c=typeof t.millisecondsDecimalDigits=="number"?t.millisecondsDecimalDigits:0,u=a>=1?Math.round(a):Math.ceil(a),d=c?a.toFixed(c):u;s(Number.parseFloat(d,10),"millisecond",d)}else{const a=e/1e3%60,c=typeof t.secondsDecimalDigits=="number"?t.secondsDecimalDigits:1,u=r(a,c),d=t.keepDecimalsOnWholeSeconds?u:u.replace(/\.0+$/,"");s(Number.parseFloat(d,10),"second",d)}if(o.length===0){const a=(n.millisecond||Ie("en_US").millisecond).long,c=(n.millisecond||Ie("en_US").millisecond).short;return t.locale==="zh_CN"?`0${t.verbose?`${a}`:c}`:`0${t.verbose?` ${a}s`:c}`}if(t.compact)return o[0];if(typeof t.unitCount=="number"){const a=t.colonNotation?"":" ";return o.slice(0,Math.max(t.unitCount,1)).join(a)}return t.colonNotation?o.join(""):o.join(" ")};const kc=Pc,Nc=Rc,{registerLang:xn}=ir,ar=Bc;xn("en_US",kc);xn("zh_CN",Nc);ar.registerLang=xn;var Mc=ar;const Ft=eo(Mc),Uc=30*24*60*60*1e3,Fc="https://launcher.arcblock.io/";function Ct({children:e}){return l.jsxs(L,{sx:{display:"flex",alignItems:"center",gap:1},children:[l.jsx(sr,{fontSize:"small"}),e]})}function ot({launcherUrl:e,chainHost:t,nftId:n,retention:o,...r}){var b,j;const{t:s,locale:i}=G(),[a,c]=cs({safeIframeRef:null,popoverAnchorEl:null}),u=g.useRef(null),d=io(E=>E.breakpoints.down("md")),{sx:f={},...p}=r,h=d?"mobile":"desktop",x=ns(async()=>{const[E,S]=await Promise.all([Br(t,n),kr({launcherUrl:e||Fc,nftId:n,locale:i})]);return{asset:E,subscriptionURL:S}},[i]);if(x.loading)return l.jsx(ht,{label:l.jsxs(Ct,{children:[!d&&s("expiration.desktop.loading"),l.jsx(se,{size:16})]}),variant:"success",sx:{cursor:"pointer",...f},...p});if(x.error)return console.error(x.error),l.jsx(ht,{label:l.jsx(Ct,{children:s(`expiration.${h}.loadFailed`)}),color:"error",variant:"success",sx:{cursor:"pointer",...f},...p,onClick:()=>x.retry()});const v=Nr((b=x.value)==null?void 0:b.asset),P=We(v).isBefore(We()),m=We(v).diff(We(),"ms");let R="success";m<=Uc&&(R="warning"),P&&(R="error");const A=E=>{c({popoverAnchorEl:E.currentTarget})},w=()=>{c({popoverAnchorEl:null})};return l.jsxs(l.Fragment,{children:[l.jsx(ht,{label:l.jsx(Ct,{children:s(`expiration.${h}.tips.${R}`,{validity:Ft(m,{locale:ao(i),compact:!0,verbose:!0})})}),color:R,variant:R!=="success"?"contained":"outlined",sx:{cursor:"pointer",...f},...p,onClick:A}),l.jsx(Mr,{id:"popover-info",open:!!a.popoverAnchorEl,anchorEl:a.popoverAnchorEl,onClose:w,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:l.jsx("iframe",{ref:u,title:s("common.subscription"),width:"360px",height:"600px",style:{border:0},src:(j=x.value)==null?void 0:j.subscriptionURL})})]})}ot.propTypes={chainHost:y.string.isRequired,nftId:y.string.isRequired,sx:y.object,retention:y.number,launcherUrl:y.string.isRequired};ot.defaultProps={sx:{},retention:0};var wn={};Object.defineProperty(wn,"__esModule",{value:!0});var zt=wn.default=void 0;zc(g);var Kn=l;function zc(e){return e&&e.__esModule?e:{default:e}}function Wn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,o)}return n}function Gn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Wn(Object(n),!0).forEach(function(o){Vc(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wn(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Vc(e,t,n){return t=qc(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qc(e){var t=Hc(e,"string");return typeof t=="symbol"?t:String(t)}function Hc(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var _n=function(t){return(0,Kn.jsx)("svg",Gn(Gn({},t),{},{children:(0,Kn.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.251 2.5c-2.576-.006-4.747 2.1-4.766 4.506v5.784c0 .793-.084 1.778-.58 2.71h12.19c-.496-.932-.58-1.917-.58-2.711V7.01c-.035-2.403-2.21-4.502-4.797-4.508L9.25 2.5zM17.015 7v5.789c0 .79.1 1.562.53 2.219l.287.438c.436.664-.033 1.554-.817 1.554H2.985c-.785 0-1.255-.89-.818-1.554l.287-.438c.43-.657.53-1.428.53-2.218V7c.024-3.291 2.927-6.008 6.27-6l1.467.003c3.344.008 6.254 2.706 6.294 5.998zM11.06 18.06A1.5 1.5 0 0 0 11.5 17H13a3 3 0 0 1-6 0h1.5a1.5 1.5 0 0 0 2.56 1.06z",fill:"currentColor"})}))};_n.defaultProps={width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"};_n.displayName="notification";var Kc=_n;zt=wn.default=Kc;function cr({status:e,...t}){const n={warning:"warning",error:"error",info:"primary"};return!e||e==="info"||e==="success"?null:l.jsx(co,{type:n[e],style:{borderRadius:5,border:"1px solid #ccc"},...t,children:e})}cr.propTypes={status:y.string.isRequired};function jn({value:e,...t}){const{t:n,locale:o}=G();if(!e)return"-";const r={locale:ao(o),compact:!0},s=new Date(e).getTime(),i=Date.now();if(s>i){const c=Ft(s-i,r);return l.jsx(Et,{title:An(e,o),placement:"top-end",enterTouchDelay:0,children:l.jsx("span",{...t,children:n("common.afterTime",{time:c})})})}const a=Ft(i-s,r);return l.jsx(Et,{title:An(e,o),placement:"top-end",enterTouchDelay:0,children:l.jsx("span",{...t,children:n("common.timeAgo",{time:a})})})}jn.propTypes={value:y.any};jn.defaultProps={value:""};function Wc(e,t){const n=g.useRef(t);g.useEffect(()=>{const o=r=>n.current(r.detail);return window.addEventListener(e,o),()=>window.removeEventListener(e,o)},[e])}function Gc(){window.dispatchEvent(new CustomEvent("checkUpdate"))}function Ul(e){const t=st(),{t:n}=G(),o=()=>{const r=new URLSearchParams(window.location.search);r.get("checkUpdate")&&(r.delete("checkUpdate"),t(r.toString()),e(),T.success(n("notification.checkingForUpdates")))};g.useEffect(o,[]),Wc("checkUpdate",o)}function Cn({onHide:e,api:t,notifications:n,updateNotifications:o,viewAllUrl:r,teamDid:s}){const{inService:i}=W(),{t:a,locale:c}=g.useContext(qt),[u,d]=g.useState(!0),[f,p]=g.useState(!1),h=st(),x=Ur();let v=u?n:n.filter(w=>w.read===!1);v=v.slice(0,5);const P=n.filter(w=>w.read===!1).length>0,m=async()=>{p(!0);const w=n.filter(b=>b.read===!1).map(b=>b.id).join(",");i?await t.readBlockletNotifications({input:{id:w,teamDid:s}}):await t.readNotifications({input:{id:w}}),o(),p(!1)},R=(w,b)=>{b.read||(i?t.readBlockletNotifications({input:{id:b.id,teamDid:s}}).then(()=>o()):t.readNotifications({input:{id:b.id}}).then(()=>o())),e(w),h(r)},A=(w,b)=>{w.preventDefault(),w.stopPropagation(),h(b),Gc()};return l.jsxs(Qc,{children:[l.jsxs(Z,{component:"h3",variant:"h6",className:"notification-header",children:[a("notification.title"),l.jsx(be,{component:no,to:r,"data-cy":"view-all-notifications-btn",onClick:e,children:a("notification.viewAll")})]}),l.jsx(Pt,{}),l.jsxs(Fr,{className:"notification-list",style:{maxHeight:"calc(100vh - 200px)",overflow:"auto"},children:[v.length===0&&l.jsx(Z,{component:"p",variant:"body1",className:"notification-tip",children:a("notification.empty")}),v.length>0&&v.map(w=>l.jsxs(Ps,{alignItems:"flex-start",disabled:w.read,onClick:b=>R(b,w),children:[l.jsx(Hs,{className:"list-item-avatar",children:l.jsxs(l.Fragment,{children:[l.jsx(uo,{children:w.entityType.substr(0,1).toUpperCase()}),l.jsx(cr,{className:"notification-tag",status:w.severity})]})}),l.jsx(lo,{primary:w.title,secondary:l.jsxs(L,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[l.jsx(Z,{component:"span",sx:{overflow:"hidden","-webkit-line-clamp":"3","-webkit-box-orient":"vertical",display:"-webkit-box","text-overflow":"ellipsis"},children:w.description}),l.jsxs(L,{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[l.jsx(jn,{value:w.createdAt,locale:c,style:{color:x.palette.text.secondary,fontSize:"0.875rem",marginTop:"4px"}}),w.action&&!w.read?l.jsx(be,{color:"primary",variant:"outlined",onPointerDown:b=>{b.stopPropagation(),b.preventDefault()},onClick:b=>A(b,w.action),"data-cy":"check-for-updates",children:a("notification.proceed")}):null]})]})})]},w.id))]}),l.jsx(Pt,{}),l.jsxs(Z,{component:"div",className:"notification-footer",children:[l.jsx(At,{control:l.jsx(Is,{checked:u,onChange:()=>d(!u),name:"showRead",color:"primary"}),label:a("notification.showRead")}),l.jsx(os,{permission:i?"":"mutate_notification",role:i?zr:[],children:P&&l.jsxs(be,{disabled:f,onClick:m,className:"",children:[f&&l.jsx(se,{size:16,style:{marginRight:"1em"}}),a("notification.markAllAsRead")]})})]})]})}const Qc=rt.div`
|
|
34
|
-
width: 420px;
|
|
35
|
-
|
|
36
|
-
@media (max-width: ${e=>e.theme.breakpoints.values.sm}px) {
|
|
37
|
-
width: calc(100vw - 10px);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.notification-header {
|
|
41
|
-
padding: 8px 16px;
|
|
42
|
-
display: flex;
|
|
43
|
-
justify-content: space-between;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.notification-tip {
|
|
47
|
-
padding: 8px 16px;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.notification-footer {
|
|
51
|
-
padding: 8px 16px;
|
|
52
|
-
display: flex;
|
|
53
|
-
justify-content: space-between;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.MuiButtonBase-root {
|
|
57
|
-
white-space: pre-wrap;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.list-item-avatar {
|
|
61
|
-
display: flex;
|
|
62
|
-
flex-direction: column;
|
|
63
|
-
align-items: center;
|
|
64
|
-
min-width: 80px;
|
|
65
|
-
|
|
66
|
-
.notification-tag {
|
|
67
|
-
margin-top: 4px;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.MuiButtonBase-root:not(.Mui-disabled) {
|
|
72
|
-
.MuiAvatar-root {
|
|
73
|
-
background: ${e=>e.theme.palette.primary.light};
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
`;Cn.propTypes={onHide:y.func,api:y.shape({readNotifications:y.func.isRequired,readBlockletNotifications:y.func.isRequired}).isRequired,notifications:y.arrayOf(y.shape({id:y.string,read:y.bool,entityType:y.string,title:y.string,createdAt:y.string,description:y.string}).isRequired).isRequired,updateNotifications:y.func.isRequired,viewAllUrl:y.string.isRequired,teamDid:y.string};Cn.defaultProps={onHide:()=>{},teamDid:""};function Sn({api:e,notifications:t,updateNotifications:n,viewAllUrl:o,teamDid:r}){const[s,i]=g.useState(!1),a=g.useRef(null),c=()=>{i(f=>!f)},u=f=>{a.current&&a.current.contains(f.target)||i(!1)},d=t.filter(f=>f.read===!1).length;return l.jsxs("div",{className:"notification-addon",children:[l.jsx(Ht,{ref:a,"aria-controls":"notify-list-grow","aria-haspopup":"true","data-cy":"toggle-notification-btn",onClick:c,children:d>0?l.jsx(po,{badgeContent:d,max:99,color:"primary",children:l.jsx(zt,{style:{width:"auto",height:24}})}):l.jsx(zt,{style:{width:"auto",height:24}})}),s&&l.jsx(Vr,{open:!0,anchorEl:a.current,disablePortal:!0,placement:"bottom-end",children:l.jsx(qr,{id:"notify-list-grow",children:l.jsx(Hr,{onClickAway:u,children:l.jsx("div",{children:l.jsx(Cn,{notifications:t,updateNotifications:n,api:e,viewAllUrl:o,onHide:u,teamDid:r})})})})})]})}Sn.propTypes={notifications:y.arrayOf(y.object),viewAllUrl:y.string.isRequired,api:y.object.isRequired,updateNotifications:y.func.isRequired,teamDid:y.string};Sn.defaultProps={notifications:[],teamDid:""};const Yc=`${B.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/notifications`;function On(){const{did:e}=window.env,{api:t,data:n,refresh:o}=Kr();return l.jsx(Sn,{api:t,viewAllUrl:Yc,notifications:n||[],updateNotifications:o,teamDid:e})}On.propTypes={};On.defaultProps={};function Xc(){const{inFullPage:e,toggleFullPage:t}=As();return D(Ht,{onClick:t,children:e?D(rr,{sx:{transform:"scale(1.3)"}}):D(or,{sx:{transform:"scale(1.3)"}})})}function En({children:e}){var v;const{t}=G(),{loading:n,error:o,actions:{refreshBlocklet:r},env:s,blocklet:i}=at(),{info:a}=Wr(),c=Gr(),u=io(P=>P.breakpoints.down("md")),{appId:d,version:f}=s,p=[{label:"App ID",value:d},{label:"App Version",value:f},{label:"App Bundle Name",value:(v=i==null?void 0:i.meta)==null?void 0:v.bundleName},{label:"Server Id",value:a.did},{label:"Server Version",value:a.version}],h=P=>{var R,A,w;const m=Array.isArray(P)?P:[P];if(m.unshift(D(On,{})),m.unshift(D(Xc,{})),i){const b={cursor:"pointer",marginRight:{xs:"8px",md:"48px"}};Yr(i)?m.unshift(D(ot,{chainHost:(R=i==null?void 0:i.controller)==null?void 0:R.chainHost,nftId:(A=i==null?void 0:i.controller)==null?void 0:A.nftId,launcherUrl:(w=i==null?void 0:i.controller)==null?void 0:w.launcherUrl,retention:B.EXPIRED_BLOCKLET_DATA_RETENTION_DAYS,sx:b})):a.ownerNft&&a.launcher&&m.unshift(D(ot,{chainHost:a.launcher.chainHost,nftId:a.ownerNft.did,launcherUrl:a.launcher.url,sx:b}))}return m},x={};return u&&(x.logo=null),yt(Zc,{legacy:!1,fullWidth:!0,headerAddons:h,headerProps:x,isMobile:u,footerProps:{addon:D(vn,{infos:p})},children:[!i&&n&&D(Je,{relative:"parent",children:D(se,{})}),!i&&o&&yt(Je,{relative:"parent",children:[yt(L,{display:"flex",alignItems:"center",children:[D(nr,{color:"error",sx:{marginRight:1}}),Me(o)]}),D(be,{onClick:()=>r(),children:D("span",{style:{textDecoration:"underline"},children:t("common.retry")})})]}),!!i&&D(L,{flex:1,padding:u?2:3,display:"flex",flexDirection:"column",children:D(Qr,{FallbackComponent:vs,resetKeys:[c.pathname],children:e})})]})}En.propTypes={children:y.any};En.defaultProps={children:null};const Zc=rt(yn)`
|
|
77
|
-
div.dashboard-content {
|
|
78
|
-
padding: 0;
|
|
79
|
-
}
|
|
80
|
-
.header-addons .locales {
|
|
81
|
-
max-height: 400px;
|
|
82
|
-
overflow-y: auto;
|
|
83
|
-
}
|
|
84
|
-
`,Jc=g.lazy(()=>M(()=>import("./overview-ilZiw5C7.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49]))),el=g.lazy(()=>M(()=>import("./index-B2Jib_qi.js"),__vite__mapDeps([50,1,2,51,4,52,53,54,22,23,24,25,26,55,56,57,49,36,37,12,13,14,15,31,58,47,59,60,61,62,16,30,7,8,9,10,11,63,20,64,38,27,28,32,33,34,35,39,40,19,41,42,43,44,45,46,5,48]))),tl=g.lazy(()=>M(()=>import("./index-CHDTx3qG.js"),__vite__mapDeps([65,1,2,4,66,5,34,67,6,53,54,22,23,24,25,26,8,9,10,12,13,14,15,11,36,49,68,7,30,16,69,31,32,33,35,37,38,39,40,19,41,42,43,44,45,46,28,47,48]))),nl=g.lazy(()=>M(()=>import("./index-C8EjEFJN.js"),__vite__mapDeps([70,1,2,71,45,46,28,5,47,48,72,73,74,51,67,75,34,22,23,24,25,26,76,38,31,52,77,14,78,8,9,10,12,13,15,16,11,63,36,49,79,80,81,82,83,84,55,56,57,37,58,59,60,61,62,54,30,20,85,40,32,33,35,39,19,41,42,43,44,86]))),ol=g.lazy(()=>M(()=>import("./audit-logs-Gg162kq3.js"),__vite__mapDeps([87,1,2,88,30,32,23,24,25,26,89,58,31,8,9,10,12,13,14,15,16,33,34,35,36,37,38,11,39,40,19,41,42,43,44,45,46,28,5,47,48,49,90]))),rl=g.lazy(()=>M(()=>import("./log-szZDv5cA.js"),__vite__mapDeps([91,1,2,32,34,92,23,24,26,93]))),sl=g.lazy(()=>M(()=>import("./index-cA3X58uQ.js"),__vite__mapDeps([94,1,2,16,55,56,57,49,36,24,23,37,25,12,13,14,15,26,22,31,58,47,59,60,61,62,54,30,7,76,38,32,10,69,92,95,51,40,5,18,19]))),il=g.lazy(()=>M(()=>import("./config-navigation-TV0yaruy.js"),__vite__mapDeps([96,1,2,59,60,61,97,98,80,99,39,40,19,23,24,25,26,12,13,14,15,22,31,69,77,100,41,46,28,5,42,43,44,38,62,101,34,47,8,9,10,30,32,16,33,35,36,37,11,45,48,49]))),al=g.lazy(()=>M(()=>import("./index-gIcq7LYr.js"),__vite__mapDeps([102,1,2,66,5,34,11,19,103,39,40,13,22,23,24,25,26,15,20,7,79,36,30,95,12,14,78,55,56,57,49,37,31,58,47,59,60,61,62,54,16,104,8,9,10,32,33,35,38,41,42,43,44,45,46,28,48]))),cl=g.lazy(()=>M(()=>import("./component-jEes4wn7.js"),__vite__mapDeps([105,1,2,4,72,73,74,51,67,75,34,22,23,24,25,26,17,82,16,20,7,106,30,12,13,14,15,8,9,10,79,36,76,38,31,56,57,49,37,58,47,60,61,54,104,107,95,97,98,101,62,69,63,35,33,108,109,110,111,48,11,112,113,114,68,19,43,21,88,115,32,41,116,117,103,39,40,66,5,118,6,27,28,42,44,45,46]))),ll=g.lazy(()=>M(()=>import("./analytics-t4svdtmF.js"),__vite__mapDeps([119,1,2,31,8,9,10,71,45,46,28,5,47,48,120,107,61,76,38,62,43,12,13,14,15,23,24,26,29,22,25,69,55,56,57,49,36,37,58,59,60,54,16,30,32,33,34,35,11,39,40,19,41,42,44]))),ul=g.lazy(()=>M(()=>import("./notifications-N19XW-R1.js"),__vite__mapDeps([121,1,2,8,9,10,36,24,49,43,38,12,13,14,15,89,58,31,30,32,16,33,34,35,37,11,39,40,19,41,42,44,45,46,28,5,47,48])));function dl(){var v,P;const e=st(),{tab:t="overview"}=Zr(),{blocklet:n,actions:{refreshBlocklet:o}}=at(),{t:r}=G(),s=(v=n==null?void 0:n.meta)==null?void 0:v.did,i=m=>{e(`${B.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/${m}`)},a=()=>{o()},c=!n||Rt(n.status)?[]:to(n),u=[{label:r("common.overview"),value:"overview"},{label:l.jsx(po,{color:"error",variant:"dot",invisible:!c.length,children:r("common.components")}),value:"components"}];Rt(n==null?void 0:n.status)||u.push({label:r("common.configuration"),value:"configuration"}),u.push({label:r("common.auditLogs"),value:"audit-logs"}),n&&((P=n.children)!=null&&P.length)&&n.structVersion===B.APP_STRUCT_VERSION&&u.push({label:r("common.logs"),value:"logs"}),u.push({label:r("common.configNavigation"),value:"navigation"}),u.push({label:r("common.storage"),value:"storage"}),u.push({label:r("common.publish"),value:"publish"});const d=l.jsx(ol,{scope:s,categories:["blocklet","team","security","certificates","gateway"]});Qe(B.EVENTS.NOTIFICATION_BLOCKLET_CREATE,m=>{const{severity:R,title:A,description:w}=m||{};R==="error"?T.error(w||A):T.success(w||A)});const f={overview:l.jsx(Jc,{}),members:l.jsx(L,{mt:-5,children:l.jsx(el,{type:"blocklet",createPassportSvg:In})}),passports:l.jsx(L,{mt:-4.5,children:l.jsx(tl,{createPassportSvg:In})}),components:cl,configuration:l.jsx(nl,{blocklet:n,onUpdate:a}),"audit-logs":d,logs:rl,navigation:il,storage:l.jsx(al,{}),analytics:l.jsx(L,{mt:-5,children:l.jsx(ll,{})}),publish:l.jsx(sl,{}),notifications:l.jsx(ul,{})},p=f[t]||f.overview,h=!["members","passports","analytics","notifications"].includes(t),x=n?l.jsxs(Wt,{type:"components",children:[h&&l.jsx(L,{pt:3,children:l.jsx(es,{tabs:u,current:t,onChange:i,scrollButtons:"auto"})}),l.jsx("div",{className:"page-content",children:l.jsx(g.Suspense,{fallback:l.jsx(Je,{relative:"parent",children:l.jsx(se,{})}),children:g.isValidElement(p)?p:l.jsx(p,{blocklet:n})})})]}):l.jsx(Je,{relative:"parent",children:l.jsx(se,{})});return l.jsx(Jr,{children:l.jsx(Gi,{children:l.jsx(En,{children:l.jsx(rn,{children:l.jsxs(pl,{children:[h&&l.jsxs(L,{component:"div",className:"page-header",children:[l.jsxs(Z,{component:"h2",variant:"h4",className:"page-title",color:"textPrimary",children:[n?l.jsx(on,{blocklet:n,style:{marginRight:16}}):null,n?l.jsxs(L,{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,children:[l.jsx(L,{children:Ne(n)}),(n==null?void 0:n.status)!=="unknown"&&l.jsx(Qt,{size:"12px",status:n.status,source:n.source,progress:n.progress})]}):`${r("common.blocklet")} ${r("common.detail")}`]}),n?l.jsx(nn,{className:"page-actions",hasPermission:!0,blocklet:n,onStart:()=>{},onComplete:({error:m}={})=>{m&&T.error(m.message)},variant:"group"}):null]}),l.jsx(wo,{}),x]})})})})})}function fl(){var n;const{blocklet:e}=at(),t=(n=e==null?void 0:e.meta)==null?void 0:n.did;return g.useEffect(()=>{const o=Xr();return t&&o.connect(),()=>{t&&o.isConnected()&&o.disconnect()}},[t]),l.jsx(dl,{})}const pl=rt.main`
|
|
85
|
-
.page-header {
|
|
86
|
-
display: flex;
|
|
87
|
-
justify-content: space-between;
|
|
88
|
-
align-items: center;
|
|
89
|
-
flex-wrap: wrap;
|
|
90
|
-
gap: 16px;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.page-title {
|
|
94
|
-
display: flex;
|
|
95
|
-
align-items: center;
|
|
96
|
-
|
|
97
|
-
.page-link {
|
|
98
|
-
font-size: 15px;
|
|
99
|
-
margin-top: 8px;
|
|
100
|
-
margin-left: 8px;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.page-content {
|
|
105
|
-
margin-top: 18px;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
@media (max-width: ${e=>e.theme.breakpoints.values.md}px) {
|
|
109
|
-
.page-header {
|
|
110
|
-
flex-direction: column;
|
|
111
|
-
align-items: flex-start;
|
|
112
|
-
.page-actions,
|
|
113
|
-
.MuiButtonGroup-root {
|
|
114
|
-
width: 100%;
|
|
115
|
-
}
|
|
116
|
-
.MuiButtonGroup-root {
|
|
117
|
-
.MuiButtonBase-root {
|
|
118
|
-
flex: 1;
|
|
119
|
-
}
|
|
120
|
-
.blocklet-action-text {
|
|
121
|
-
display: none;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
.page-title {
|
|
127
|
-
margin-bottom: 15px;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
`,Fl=Object.freeze(Object.defineProperty({__proto__:null,default:fl},Symbol.toStringTag,{value:"Module"}));export{Qt as B,yn as D,Hs as L,cr as N,jn as R,Gt as W,ei as _,ki as a,xo as b,on as c,nr as d,fo as e,kl as f,Xt as g,X as h,mo as i,$l as j,Ul as k,go as l,vo as m,po as n,Fl as o,Ft as p,Nl as u};
|
|
131
|
-
function __vite__mapDeps(indexes) {
|
|
132
|
-
if (!__vite__mapDeps.viteFileDeps) {
|
|
133
|
-
__vite__mapDeps.viteFileDeps = ["assets/overview-ilZiw5C7.js","assets/index-fmx4paNk.js","assets/index-Fay2ci-b.css","assets/domain-list-zhzJcV_A.js","assets/Add-7NNakwc_.js","assets/ExpandMore-NVX5jNVq.js","assets/LockIcon-JbTTMIYd.js","assets/did-address-mUc4Y20-.js","assets/permission-sB8VSoo2.js","assets/useAsync-jPfHNdGA.js","assets/session-jiGGNvRF.js","assets/index-BSh8wzUh.js","assets/confirm-FKxAX-vD.js","assets/DialogContentText-sTkogqzq.js","assets/Alert-q0LztC5S.js","assets/format-error-4NwK9J29.js","assets/useSetState-Hs0SeJpE.js","assets/InfoOutlined-XrC7_SL1.js","assets/OpenInNew-b3rnf1l3.js","assets/api-gliNzA2D.js","assets/index-TFqh61lk.js","assets/util-d7UDajXU.js","assets/TextField-eXgwmwxj.js","assets/FormControl-v0eTeB2e.js","assets/useFormControl-KNSyfEVt.js","assets/InputLabel-wButS0La.js","assets/Select-Ij2Jun8i.js","assets/actions-TU96BKon.js","assets/MoreHoriz-OdM1acmI.js","assets/CardContent-Ne-zC7Jh.js","assets/MoreVert-EZ2iGgaH.js","assets/index-Vwo7aMdQ.js","assets/useLocalStorage--76v1ZXm.js","assets/PlayArrow-jAJdJxEN.js","assets/ButtonGroup-3ZXLSrUY.js","assets/RadioGroup-_OsSax7E.js","assets/FormControlLabel-GwWyZxgC.js","assets/FormGroup-SgkfjzE8.js","assets/Avatar-7AoIiLl0.js","assets/spaces-UOGj7Ssb.js","assets/index-vQP4YCHN.js","assets/fallback-PaGR08XT.js","assets/wallet-hidden-topbar-A40myZlO.js","assets/ListItem-bKX4gR_9.js","assets/selector-h5yloHKI.js","assets/index-5BDrgay-.js","assets/nav-menu-faDWYwo_.js","assets/Toolbar-x7RFKGc3.js","assets/Hidden-gw53iTuK.js","assets/Checkbox-pfFoKuJv.js","assets/index-B2Jib_qi.js","assets/index-87AfN2F8.js","assets/Loop-1L7Vjeun.js","assets/list-header-Us8_bjV8.js","assets/Search-Qa9ylVm2.js","assets/index-i7Ow7N5Z.js","assets/FilterList-41yZeIDY.js","assets/TableRow-fzOFh_oI.js","assets/LastPage-3BnXJmTJ.js","assets/index-DdkstYFC.js","assets/redux-XOuz_cVf.js","assets/toPropertyKey-NzAT2yhV.js","assets/Grid-YkM__IXg.js","assets/click-to-copy-6Ejqlbl5.js","assets/did-utils-QS98CTPO.js","assets/index-CHDTx3qG.js","assets/index-EdxXcbvd.js","assets/EditIcon-xHBtFRw5.js","assets/Google-HPUKLxqx.js","assets/InputAdornment-fcMSBEY_.js","assets/index-C8EjEFJN.js","assets/iframe-I_DQavu3.js","assets/Edit-HypIX1_Y.js","assets/Done-MCWAlwFR.js","assets/logo-uploader-SgB8kCkW.js","assets/ArrowDropDown-rOXH0UGm.js","assets/ChevronRight-RwAcj313.js","assets/Autocomplete-KMUZJ2iZ.js","assets/mode-Ip8p6ZjP.js","assets/switch-control-Wc5MlIpH.js","assets/index.esm-eI_inmiY.js","assets/confirm-NVMDg5RI.js","assets/Launch-Hu_2a2vM.js","assets/config-zsZ_wFCW.js","assets/Slider-VWwvJ3Q0.js","assets/index-Thfx8kQD.js","assets/index-1NyTkR9G.css","assets/audit-logs-Gg162kq3.js","assets/index-iWsloYR-.js","assets/Pagination-rRHeKBOF.js","assets/audit-logs-QseNTS8s.css","assets/log-szZDv5cA.js","assets/Download-m1-pOr7w.js","assets/log-993Rbbf_.css","assets/index-cA3X58uQ.js","assets/DeleteOutline-6up2qq9R.js","assets/config-navigation-TV0yaruy.js","assets/slicedToArray-7xRqglx6.js","assets/jss-plugin-props-sort.esm-MNya_k5W.js","assets/index-4G03rV80.js","assets/index-fvWW0IUt.js","assets/Skeleton-UiZMiSHu.js","assets/index-gIcq7LYr.js","assets/use-blocklet-info-for-connect-did-spaces-w6ZQzAFj.js","assets/Icon-qZwOVGf4.js","assets/component-jEes4wn7.js","assets/memoize-one.esm-GXj7vDIE.js","assets/index-qFOKnKtb.js","assets/add-component-core-ylX_8APK.js","assets/uniqBy-iEgks-vJ.js","assets/page-header-ddmwDxwc.js","assets/index-JqwgTYS6.js","assets/lottie-FjNcYuDz.js","assets/launch-result-message-Hk1fQy57.js","assets/index-p8rdvwoO.js","assets/Stepper-eS4dzjYb.js","assets/preact.module-yJdvQMHZ.js","assets/content-layout-luB2OoJR.js","assets/add-component-core-wegghUnI.css","assets/analytics-t4svdtmF.js","assets/LaunchOutlined-koluPofV.js","assets/notifications-N19XW-R1.js"]
|
|
134
|
-
}
|
|
135
|
-
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
|
|
136
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import{K as B,M as W,j as e,ce as Me,eW as Ne,P as o,eX as be,u as w,r as v,a9 as F,aX as ve,$ as he,a as z,S as N,n as O,eY as Oe,aS as Be,eZ as We,e_ as Ue,e$ as He,f0 as Ve,f1 as Ke,f2 as Je,f3 as De,B as x,U as Ce,bl as U,T,f4 as Ge,c as Qe,H as Xe,F as L,x as Ye,c0 as Ze,b4 as Z,bC as xe,eV as Se,b1 as Ae,bj as Te,bA as et,f5 as ge,f6 as tt,G as nt,bn as it,bt as st,f7 as ot,f8 as rt,aW as at,f9 as lt,bB as dt,aw as ct}from"./index-fmx4paNk.js";import{d as mt}from"./Add-7NNakwc_.js";import{d as ut}from"./ExpandMore-NVX5jNVq.js";import{d as pt}from"./LockIcon-JbTTMIYd.js";import{W as ft}from"./did-address-mUc4Y20-.js";import{_ as ht,D as je,w as we}from"./permission-sB8VSoo2.js";import{A as xt}from"./index-BSh8wzUh.js";import{C as ee,L as gt,a as jt}from"./confirm-FKxAX-vD.js";import{_ as te,d as Ie}from"./useSetState-Hs0SeJpE.js";import{d as yt}from"./InfoOutlined-XrC7_SL1.js";import{d as bt}from"./OpenInNew-b3rnf1l3.js";import"./api-gliNzA2D.js";import{I as vt}from"./index-TFqh61lk.js";import{p as Re}from"./util-d7UDajXU.js";import{T as Dt}from"./TextField-eXgwmwxj.js";import{A as Ct}from"./actions-TU96BKon.js";import{C as Pe,a as _e}from"./CardContent-Ne-zC7Jh.js";import{A as St}from"./Alert-q0LztC5S.js";var ne={},At=W;Object.defineProperty(ne,"__esModule",{value:!0});var J=ne.default=void 0,Tt=At(B()),wt=e,It=(0,Tt.default)((0,wt.jsx)("path",{d:"M12.16 3h-.32L9.21 8.25h5.58zm4.3 5.25h5.16L19 3h-5.16zm4.92 1.5h-8.63V20.1zM11.25 20.1V9.75H2.62zM7.54 8.25 10.16 3H5L2.38 8.25z"}),"Diamond");J=ne.default=It;var ie={},Rt=W;Object.defineProperty(ie,"__esModule",{value:!0});var ke=ie.default=void 0,Pt=Rt(B()),_t=e,kt=(0,Pt.default)((0,_t.jsx)("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess");ke=ie.default=kt;class Et{constructor(t,n,s){this.name=t,this.prefix=n,this.baseEncode=s}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}}class $t{constructor(t,n,s){if(this.name=t,this.prefix=n,n.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=n.codePointAt(0),this.baseDecode=s}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return Ee(this,t)}}class qt{constructor(t){this.decoders=t}or(t){return Ee(this,t)}decode(t){const n=t[0],s=this.decoders[n];if(s)return s.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Ee=(i,t)=>new qt({...i.decoders||{[i.prefix]:i},...t.decoders||{[t.prefix]:t}});class zt{constructor(t,n,s,a){this.name=t,this.prefix=n,this.baseEncode=s,this.baseDecode=a,this.encoder=new Et(t,n,s),this.decoder=new $t(t,n,a)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const Ft=({name:i,prefix:t,encode:n,decode:s})=>new zt(i,t,n,s),Lt=(i,t,n,s)=>{const a={};for(let p=0;p<t.length;++p)a[t[p]]=p;let r=i.length;for(;i[r-1]==="=";)--r;const l=new Uint8Array(r*n/8|0);let d=0,c=0,u=0;for(let p=0;p<r;++p){const j=a[i[p]];if(j===void 0)throw new SyntaxError(`Non-${s} character`);c=c<<n|j,d+=n,d>=8&&(d-=8,l[u++]=255&c>>d)}if(d>=n||255&c<<8-d)throw new SyntaxError("Unexpected end of data");return l},Mt=(i,t,n)=>{const s=t[t.length-1]==="=",a=(1<<n)-1;let r="",l=0,d=0;for(let c=0;c<i.length;++c)for(d=d<<8|i[c],l+=8;l>n;)l-=n,r+=t[a&d>>l];if(l&&(r+=t[a&d<<n-l]),s)for(;r.length*n&7;)r+="=";return r},q=({name:i,prefix:t,bitsPerChar:n,alphabet:s})=>Ft({prefix:t,name:i,encode(a){return Mt(a,s,n)},decode(a){return Lt(a,s,n,i)}}),Nt=q({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Ot=q({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Bt=q({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Wt=q({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Ut=q({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Ht=q({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Vt=q({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Kt=q({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Jt=q({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),Gt=Object.freeze(Object.defineProperty({__proto__:null,base32:Nt,base32hex:Ut,base32hexpad:Vt,base32hexpadupper:Kt,base32hexupper:Ht,base32pad:Bt,base32padupper:Wt,base32upper:Ot,base32z:Jt},Symbol.toStringTag,{value:"Module"})),Qt=Me(Gt),{toBuffer:Xt,toAddress:Yt}=Ne,{base32:Zt}=Qt,en=i=>{if(!i)return i;const t=Xt(Yt(i));return Zt.encode(t)};var tn={encode:en};const nn=i=>["waiting","creating","renewaling"].includes(i);function se(i){var $,R;const{t}=w(),[n,s]=v.useState(!1),{inService:a}=F(),[r,l]=v.useState(null),{siteId:d,domain:c,onAdd:u,children:p,did:j}=i,[g,S]=v.useState(!1),{api:P,ws:{useSubscription:y}}=F(),{mode:C,actions:{refreshDomainStatus:D}}=ve(),h=ht(async()=>{const{cert:f}=await P.findCertificateByDomain({input:{domain:c,did:j}});return f}),b=(f,_)=>{f.domain===c&&(S(!1),s(!1),a&&C!=="setup"&&(_==="success"?O.success(t("setup.domain.genCertSuccess",{domain:f.domain})):_==="error"&&O.error(t("setup.domain.genCertFailed",{domain:f.domain,message:f.message}))))};if(v.useEffect(()=>{var f;h.loading||S(nn((f=h.value)==null?void 0:f.status))},[h.loading,($=h.value)==null?void 0:$.status]),y(he.BlockletEvents.certError,f=>b(f,"error")),y(he.BlockletEvents.certIssued,f=>{h.retry(),D(f.domain),b(f,"success")}),h.loading||((R=h.value)==null?void 0:R.status)==="normal")return"";const k=()=>{s(!1),l(null)},m=async()=>{s(!0);try{await P.issueLetsEncryptCert({input:{siteId:d,domain:c,did:j,inBlockletSetup:C==="setup"}}),u(),S(!0)}catch(f){console.error(f),S(!1)}finally{s(!1),l(null)}},A={title:t("router.cert.genLetsEncryptCert.title"),description:e.jsxs("div",{children:[e.jsx(xt,{type:"success",children:t("router.cert.genLetsEncryptCert.dnsTip")}),t("router.cert.genLetsEncryptCert.description")]}),confirm:t("common.confirm"),onConfirm:m,onCancel:k},I=f=>{f.stopPropagation(),l(A)};return e.jsxs(e.Fragment,{children:[g?e.jsx(z,{title:t("router.cert.issuing"),children:e.jsx(N,{size:12})}):p({loading:n,open:I}),r&&e.jsx(ee,{color:"primary",title:r.title,description:r.description,confirm:r.confirm,params:r.params,onConfirm:r.onConfirm,onCancel:r.onCancel})]})}se.propTypes={domain:o.string.isRequired,did:o.string.isRequired,siteId:o.string.isRequired,onAdd:o.func,children:o.any};se.defaultProps={onAdd:()=>{},children:null};function oe(i){const{domain:t,domainStatus:n,...s}=i;return!be(t)||n!=null&&n.isHttps?"":e.jsx(se,{domain:t,...s})}oe.propTypes={domain:o.string.isRequired,domainStatus:o.shape({isHttps:o.bool}).isRequired,did:o.string.isRequired,onAdd:o.func,children:o.any};oe.defaultProps={onAdd:()=>{},children:null};var re={},sn=W;Object.defineProperty(re,"__esModule",{value:!0});var $e=re.default=void 0,on=sn(B()),rn=e,an=(0,on.default)((0,rn.jsx)("path",{d:"M17 20.41 18.41 19 15 15.59 13.59 17 17 20.41zM7.5 8H11v5.59L5.59 19 7 20.41l6-6V8h3.5L12 3.5 7.5 8z"}),"CallMerge");$e=re.default=an;var ln=Oe;function dn(i,t){for(var n=-1,s=i.length;++n<s&&ln(t,i[n],0)>-1;);return n}var cn=dn,mn=We,un=Ue,pn=He,fn=Ve,hn=cn,ye=Ke,xn=Je;function gn(i,t,n){if(i=xn(i),i&&(n||t===void 0))return un(i);if(!i||!(t=mn(t)))return i;var s=ye(i),a=ye(t),r=hn(s,a),l=fn(s,a)+1;return pn(s,r,l).join("")}var jn=gn;const qe=Be(jn),ze=v.createContext({}),{Provider:yn,Consumer:Vn}=ze;function bn({children:i}){const[t,n]=te({domain:"",error:null}),{locale:s,t:a}=w(),{api:r}=F(),l={error:t.error,domain:t.domain,setError:d=>{n({error:d})},setDomain:d=>{const c=qe(d),u=De(c,s);n({domain:c,error:u})},validateDomain:async(d,c)=>!t.error&&c&&c!=="nftDomain"&&(await r.isDidDomain({input:{domain:d}})).value===!0?(n({error:a("router.domainAlias.add.isDidDomainError")}),!1):!0};return e.jsx(yn,{value:{value:l},children:i})}function Fe(){const{value:i}=v.useContext(ze);return i}function ae({domain:i,resolvedTarget:t,...n}){const{t:s,locale:a}=w();return e.jsxs(x,{sx:{backgroundColor:"rgb(236, 251, 253)",borderColor:"rgb(236, 251, 253)",borderRadius:"8px",padding:"12px"},...n,children:[e.jsxs(x,{display:"flex",children:[s("router.domain.setup.tipStart"),i&&e.jsx(x,{mx:.5,color:"primary.main",fontWeight:"fontWeightBold",children:i}),s("router.domain.setup.tipEnd"),":"]}),e.jsxs(x,{sx:{"&>div":{mb:0},marginTop:"8px"},children:[e.jsx(G,{label:s("router.domain.setup.recordType"),value:"CNAME",locale:a}),e.jsx(G,{label:s("router.domain.setup.recordValue"),value:t,locale:a})]})]})}ae.propTypes={domain:o.string,resolvedTarget:o.string.isRequired};ae.defaultProps={domain:""};function G({locale:i,label:t,value:n}){const s=Ce(r=>r.breakpoints.down("md")),a=U();return e.jsx(vt,{name:t,nameWidth:120,children:e.jsxs(x,{sx:{display:"flex",alignItems:"center",lineHeight:1},children:[e.jsx(T,{component:"span",color:"primary.main",overflow:"auto",sx:s?{maxWidth:"95%",wordWrap:"break-word"}:{wordWrap:"break-word"},children:n}),e.jsx(Ge,{content:n,locale:i,style:{marginLeft:"4px",color:a.palette.text.secondary}})]})})}G.propTypes={locale:o.string.isRequired,label:o.string.isRequired,value:o.string.isRequired};function le({siteId:i,teamDid:t,cnameDomain:n,defaultCustomDomain:s,onInputDomain:a,appId:r,appPk:l,onSuccess:d,disabled:c,autoFocus:u,inBlockletSetup:p,...j}){const{t:g,locale:S}=w(),{api:P,info:y}=F(),C=Fe(),D=U(),[h,b]=te({domain:s,error:null,type:y!=null&&y.nftDomainUrl?"nftDomain":"inputDomain",showNFTDomainAuth:!1,showDnsTip:!1});let k="";y.nftDomainUrl&&(k=Qe(y.nftDomainUrl,"/api"));const m=async({domain:R,nftDid:f,chainHost:_})=>{try{const E=Re(R);await P.addDomainAlias({input:{id:i,type:"nft-domain",domainAlias:E,nftDid:f,chainHost:_,teamDid:t,inBlockletSetup:p}}),await Z(2e3),b({confirmSetting:null,showNFTDomainAuth:!1,type:"nftDomain"}),d({domain:E,type:h.type,nftDid:f,chainHost:_})}catch(E){O.error(E.message)}finally{b({showNFTDomainAuth:!1})}},A=C.error||h.error,I={inputDomain:{name:g("router.domainAlias.inputDomain"),component:e.jsxs(e.Fragment,{children:[e.jsx(Dt,{label:g("router.domainAlias.add.domainDescription"),helperText:h.type==="inputDomain"&&A||g("router.domainAlias.add.helperText"),inputProps:{"data-cy":"domain-name-input"},fullWidth:!0,disabled:c,value:h.domain,size:"small",variant:"outlined",error:!!A&&h.type==="inputDomain",onChange:R=>{var E;const f=qe((E=R.target)==null?void 0:E.value);C.setDomain(f);const _=De(f,S);b({domain:f,error:_,type:"inputDomain"}),a({domain:f,error:_,type:"inputDomain"})},autoFocus:u,onBlur:()=>{C.domain||(b({error:null}),C.setError(null))}}),e.jsxs(x,{sx:{cursor:"pointer",fontSize:"14px",display:"flex",alignItems:"center",gap:"4px",marginTop:"8px",lineHeight:1,color:D.palette.primary.main},onClick:()=>b({showDnsTip:!h.showDnsTip}),children:[e.jsx(yt,{fontSize:"1em"}),g("router.domainAlias.showTipHint")]}),h.showDnsTip&&e.jsx(ae,{domain:h.domain,resolvedTarget:n,style:{marginTop:"4px"}})]})}};y!=null&&y.nftDomainUrl&&(I.nftDomain={name:g("router.domainAlias.nftDomain"),component:e.jsxs(e.Fragment,{children:[e.jsxs(x,{sx:{maxWidth:"640px",color:"text.secondary",fontSize:"14px"},children:[e.jsx("div",{children:g("router.domainAlias.addDomainNFT.tips")}),e.jsxs("div",{children:[g("router.domainAlias.addDomainNFT.buyTip"),e.jsxs(Xe,{href:y.nftDomainUrl,sx:{fontSize:"14px",display:"inline-flex",alignItems:"center"},target:"_blank",children:[e.jsx("i",{children:g("router.domainAlias.addDomainNFT.buy")}),e.jsx(bt,{fontSize:"small"})]})]})]}),e.jsx(L,{sx:{marginTop:"8px"},disabled:c,onClick:()=>b({showNFTDomainAuth:!0}),variant:"contained",children:g("router.domainAlias.addDomainNFT.showNFT")}),e.jsx(Ye,{open:h.showNFTDomainAuth,popup:!0,useSocket:!1,action:"authorize",baseUrl:k,checkFn:Ze.create({baseURL:k}).get,extraParams:{delegatee:r,delegateePk:l},onSuccess:m,onClose:()=>b({showNFTDomainAuth:!1}),checkTimeout:60*5e3,showDownload:!1,messages:{title:g("router.domainAlias.addDomainNFT.connect.title"),scan:g("router.domainAlias.addDomainNFT.connect.scan"),confirm:g("router.domainAlias.addDomainNFT.connect.confirm"),success:g("router.domainAlias.addDomainNFT.connect.success")}})]})});const $=Object.keys(I);return $.sort(R=>R==="inputDomain"?1:-1),e.jsx(x,{...j,children:e.jsx(x,{sx:{display:"flex",flexDirection:"column",justifyContent:"flex-start",gap:"1em"},children:$.map((R,f)=>{var _,E;return e.jsxs(x,{children:[$.length>1&&e.jsx(x,{sx:{fontWeight:700,color:D.palette.text.primary},children:`${g(`optionsOrder.${f+1}`)}: ${(_=I[R])==null?void 0:_.name}`}),e.jsx(x,{sx:{marginTop:"8px"},children:(E=I[R])==null?void 0:E.component})]},R)})})})}le.propTypes={siteId:o.string.isRequired,teamDid:o.string.isRequired,cnameDomain:o.string.isRequired,defaultCustomDomain:o.string,onInputDomain:o.func,onSuccess:o.func,appId:o.string,appPk:o.string,disabled:o.bool,autoFocus:o.bool,inBlockletSetup:o.bool};le.defaultProps={defaultCustomDomain:"",onInputDomain:xe,onSuccess:xe,appId:"",appPk:"",disabled:!1,autoFocus:!0,inBlockletSetup:!1};function de({id:i,children:t,title:n,teamDid:s,systemDomains:a,appId:r,appPk:l}){const{t:d}=w(),{api:c}=F(),[u,p]=te({loading:!1,confirmSetting:null}),j=a.find(D=>Se.isDidDomain(D)),g=Fe(),S=()=>{p({loading:!1,confirmSetting:null})},P=async D=>{if(!u.loading){p({loading:!0});try{const h=Re(D.domain);if(!await g.validateDomain(h,D.type))return!1;await c.addDomainAlias({input:{id:i,domainAlias:h,teamDid:s}}),await Z(2e3),p({confirmSetting:null})}catch(h){return g.setError(h.message),!1}finally{p({loading:!1})}}},y={title:n||d("router.domainAlias.add.title"),description:function(h,b,k){return e.jsx(le,{siteId:i,teamDid:s,cnameDomain:j,onSuccess:()=>p({confirmSetting:null}),onInputDomain:({domain:m,type:A,error:I})=>{b({...h,domain:m,type:A,__disableConfirm:!!I}),k(I)},appId:r,appPk:l})},confirm:d("common.confirm"),cancel:d("common.cancel"),params:{domain:"",__disableConfirm:!0},onConfirm:P,onCancel:S},C=D=>{D.stopPropagation(),p({confirmSetting:y})};return e.jsxs(e.Fragment,{children:[typeof t=="function"?t({loading:u.loading,open:C}):e.jsxs(Ae,{onClick:C,className:"rule-action","data-cy":"action-add-domain-alias",children:[u.loading?e.jsx(N,{size:16}):e.jsx($e,{style:{fontSize:18,marginRight:5}}),d("router.domainAlias.add.title")]}),u.confirmSetting&&e.jsx(ee,{title:u.confirmSetting.title,description:u.confirmSetting.description,confirm:u.confirmSetting.confirm,cancel:u.confirmSetting.cancel,params:u.confirmSetting.params,onConfirm:u.confirmSetting.onConfirm,onCancel:u.confirmSetting.onCancel,displayError:!1,color:"primary",loading:u.loading,maxWidth:"lg"})]})}de.propTypes={id:o.string.isRequired,children:o.any,title:o.string,teamDid:o.string,systemDomains:o.arrayOf(o.string).isRequired,appId:o.string,appPk:o.string.isRequired};de.defaultProps={children:null,title:"",teamDid:"",appId:null};function vn(i){return e.jsx(bn,{children:e.jsx(de,{...i})})}function ce(i){const{t}=w(),[n,s]=v.useState(!1),[a,r]=v.useState(null),{id:l,domain:d,children:c,teamDid:u}=i,{api:p}=F(),j=()=>{s(!1),r(null)},g=async()=>{s(!0);try{await p.deleteDomainAlias({input:{id:l,domainAlias:d,teamDid:u}}),await Z(2e3)}catch(y){O.error(y.message)}finally{r(null),s(!1)}},S={title:t("router.domainAlias.delete.title"),description:t("router.domainAlias.delete.description"),confirm:t("common.confirm"),onConfirm:g,onCancel:j},P=y=>{y.stopPropagation(),r(S)};return e.jsxs(e.Fragment,{children:[typeof c=="function"?c({loading:n,open:P}):e.jsxs(L,{edge:"end",onClick:P,size:"small",className:"rule-action",color:"error","data-cy":"action-delete-domain-alias",children:[n?e.jsx(N,{size:16}):e.jsx(Ie,{style:{fontSize:16}}),t("router.domainAlias.delete.title")]}),a&&e.jsx(ee,{title:a.title,description:a.description,confirm:a.confirm,params:a.params,onConfirm:a.onConfirm,onCancel:a.onCancel})]})}ce.propTypes={id:o.string.isRequired,domain:o.string.isRequired,children:o.any,teamDid:o.string};ce.defaultProps={children:null,teamDid:""};function me({site:i,domain:t,blocklet:n}){const{t:s}=w(),a=t.value===window.location.hostname;return e.jsx(Ct,{"data-cy":"domain-actions",size:"large",actions:[({close:r})=>{var l;return e.jsx(ce,{id:i.id,domain:t.value,teamDid:(l=n==null?void 0:n.meta)==null?void 0:l.did,children:({open:d})=>e.jsx(z,{title:a?s("blocklet.router.currentDomainTip"):"",children:e.jsx("span",{children:e.jsxs(Ae,{disabled:t.isProtected||a,dense:!0,onClick:c=>{r(),d(c)},"data-cy":"action-toggle-block",children:[e.jsx(gt,{style:{minWidth:24,marginRight:8},children:e.jsx(Ie,{})}),e.jsx(jt,{primary:s("common.delete")})]},"remove")})})})}]})}me.propTypes={site:o.object.isRequired,domain:o.object.isRequired,blocklet:o.object.isRequired};me.defaultProps={};var ue={},Dn=W;Object.defineProperty(ue,"__esModule",{value:!0});var pe=ue.default=void 0,Cn=Dn(B()),Sn=e,An=(0,Cn.default)((0,Sn.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"}),"Https");pe=ue.default=An;const H=o.shape({href:o.string,accessibility:o.shape({loading:o.bool,accessible:o.bool}),domainStatus:o.shape({isHttps:o.bool,matchedCert:o.object}),dns:o.shape({resolved:o.bool,ip:o.string})});function fe({certificate:i}){const[t,n]=v.useState(null),s=F(),{t:a,locale:r}=w(),l=u=>{n(u.currentTarget)},d=()=>{n(null)},c=!!t;return e.jsxs(e.Fragment,{children:[e.jsx(pe,{"aria-owns":c?"mouse-over-popover":void 0,onMouseEnter:l,onMouseLeave:d,style:{color:"#44cdc6",fontSize:20,cursor:"pointer"}}),e.jsx(Te,{id:"mouse-over-popover",style:{pointerEvents:"none"},open:c,anchorEl:t,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:d,disableRestoreFocus:!0,children:e.jsx(Pe,{children:e.jsxs(_e,{style:{display:"flex"},children:[e.jsx("div",{children:e.jsx("img",{src:`${s.imgPrefix}/https-certificate-icon.png`,alt:"certificate icon",style:{maxHeight:"100%",maxWidth:"100%"}})}),e.jsxs(T,{component:"div",style:{marginLeft:"16px"},children:[e.jsx(T,{component:"div",style:{fontWeight:"bold"},children:i.domain}),e.jsx(T,{component:"div",children:`${a("common.issuer")}: ${et(i,"issuer.commonName","")}`}),e.jsx(T,{component:"div",children:`${a("router.cert.issuedOn")}: ${ge(i.validFrom,r)}`}),e.jsx(T,{component:"div",children:`${a("router.cert.expiryOn")}: ${ge(i.validTo,r)}`})]})]})})})]})}fe.propTypes={certificate:o.object};fe.defaultProps={certificate:{}};function M({domain:i,filters:t}){const{t:n}=w(),{value:s,domainStatus:a}=i;if(!be(s))return null;let r=null,l=null;const{isHttps:d,matchedCert:c}=a;if(!tt(s)){const{dns:{resolved:p,ip:j}={}}=a;p||j==="127.0.0.1"?r=e.jsx(z,{title:n("router.domain.verify.ok"),children:e.jsx(je,{color:"success"})}):r=e.jsx(z,{title:n("router.domain.verify.notResolved"),children:e.jsx(je,{color:"error"})})}d?l=e.jsx(fe,{certificate:c}):l=e.jsx(z,{title:n("router.domain.https.bad"),children:e.jsx(pe,{style:{color:"#D0021B",fontSize:20,cursor:"pointer"}})});const u=t.map(p=>p==="domain"?r:p==="http"?l:null);return v.createElement(v.Fragment,null,...u)}M.propTypes={domain:H.isRequired,filters:o.array};M.defaultProps={filters:["domain","http"]};const Tn=we(V,"mutate_blocklets"),wn=we(V,"",it);function Le(i){const{inService:t}=F(),{blocklet:n,loadingRuntimeInfo:s}=ve();let a=Tn;return t&&(a=wn),e.jsx(a,{...i,blocklet:n,inService:t,loadingRuntimeInfo:s})}Le.propTypes={listOnly:o.bool};Le.defaultProps={listOnly:!1};function V({hasPermission:i,blocklet:t,loadingRuntimeInfo:n,inService:s,listOnly:a}){var D,h,b,k;const{t:r}=w(),[l,d]=v.useState(!1),c=Ce(m=>m.breakpoints.down("md")),u=v.useMemo(()=>{let m=i;return st(t)&&(m=m&&s),m},[i,s,t]),{site:p}=t,j=v.useMemo(()=>{var m;return ot((m=t.site)==null?void 0:m.domainAliases)},[(D=t.site)==null?void 0:D.domainAliases]),g=[],S=[],P=tn.encode(t.appPid),y=(b=(h=t.environments)==null?void 0:h.find(m=>m.key==="BLOCKLET_APP_PK"))==null?void 0:b.value,C=rt(j);return j.forEach(m=>{const A=m.value||"";Se.isDidDomain(A)&&!A.startsWith(P)?S.push(m):g.push(m)}),e.jsxs(e.Fragment,{children:[!a&&e.jsxs(e.Fragment,{children:[e.jsxs(x,{className:"title first",display:"flex",justifyContent:"space-between",alignItems:"center",children:[e.jsx(x,{children:r("common.domain")}),u&&e.jsx(vn,{id:p.id,title:r("router.domain.add.title"),teamDid:(k=t.meta)==null?void 0:k.did,appId:t.appPid,appPk:y,systemDomains:C==null?void 0:C.map(m=>m.value),children:({open:m})=>e.jsxs(L,{style:{marginLeft:16},variant:"contained",color:"primary","data-cy":"add-domain-alias",onClick:m,disabled:at(t.status),children:[e.jsx(mt,{style:{fontSize:"1.3em",marginRight:4}}),r("common.add")]})})]}),lt(t.status)===!1&&e.jsx(x,{mt:1.5,mb:1.5,children:e.jsx(St,{severity:"warning",children:r("blocklet.router.noRunning")})})]}),e.jsx(x,{sx:{display:"flex",flexDirection:"column",gap:1},children:(l?j:g).map(m=>{var I,$;const A=m.value;return e.jsxs(v.Fragment,{children:[c&&e.jsxs(x,{display:"flex",flexDirection:"column",children:[e.jsx(x,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:e.jsx(Q,{domain:m,target:"_blank",children:m.value})}),e.jsxs(x,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[e.jsxs(x,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:1},children:[e.jsx(M,{domain:m,filters:["domain"]},`${m.value}-domain`),e.jsx(Y,{siteId:(I=t.site)==null?void 0:I.id,domain:m,blocklet:t,hasMutatePermission:u})]}),e.jsx(x,{sx:{button:{padding:0}},children:e.jsx(X,{hasMutatePermission:u,site:p,domain:m,blocklet:t})})]})]},A),!c&&e.jsxs(x,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[e.jsxs(x,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[e.jsx(M,{domain:m,filters:["domain"]},`${m.value}-domain`),e.jsx(x,{sx:{ml:2,mr:.5},children:e.jsx(Q,{domain:m,target:"_blank",children:m.value})}),e.jsx(Y,{siteId:($=t.site)==null?void 0:$.id,domain:m,blocklet:t,hasMutatePermission:u})]}),e.jsx(x,{sx:{button:{padding:0}},children:e.jsx(X,{hasMutatePermission:u,site:p,domain:m,blocklet:t})})]},A)]},A)})}),S.length>0&&e.jsx("div",{style:{marginLeft:"20px",marginTop:"12px"},children:e.jsx(L,{endIcon:l?e.jsx(ke,{}):e.jsx(ut,{}),onClick:()=>d(!l),children:r(l?"common.collapseAll":"blocklet.router.showAllDomains")})}),!j.length&&(n?e.jsx(N,{size:16}):e.jsx(dt,{children:r("common.empty")}))]})}V.propTypes={hasPermission:o.bool,blocklet:o.object.isRequired,loadingRuntimeInfo:o.bool,inService:o.bool.isRequired,listOnly:o.bool};V.defaultProps={hasPermission:!1,loadingRuntimeInfo:!1,listOnly:!1};function Q({domain:i,children:t,...n}){const{t:s}=w(),{href:a,accessibility:r}=i;return!r||r.loading?e.jsxs(K,{...n,children:[t,e.jsx(z,{title:s("blocklet.router.checkUrlAccessible"),placement:"top-end",children:e.jsx("span",{className:"status",children:e.jsx(N,{size:12})})})]}):r.accessible?e.jsx(K,{...n,children:e.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",children:t})}):e.jsx(K,{...n,children:e.jsx(z,{title:s("blocklet.router.urlInaccessible"),placement:"top-end",children:e.jsx("span",{children:t})})})}Q.propTypes={domain:H.isRequired,children:o.any.isRequired};const K=nt.span`
|
|
2
|
-
&,
|
|
3
|
-
& > * {
|
|
4
|
-
color: #222;
|
|
5
|
-
font-size: 18px;
|
|
6
|
-
word-break: break-all;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.status {
|
|
10
|
-
margin-left: 8px;
|
|
11
|
-
}
|
|
12
|
-
`;function X({hasMutatePermission:i,site:t,domain:n,blocklet:s}){const a=U(),{t:r}=w();return i&&!n.isProtected?e.jsx(me,{site:t,domain:n,blocklet:s}):e.jsx(z,{title:r("blocklet.router.domainLockTooltip"),placement:"top",children:e.jsx(ct,{disabled:!0,size:"large",style:{pointerEvents:"auto",paddingTop:0,paddingBottom:0},children:e.jsx(pt,{style:{fill:a.palette.text.disabled}})})})}X.propTypes={hasMutatePermission:o.bool.isRequired,site:o.object.isRequired,domain:H.isRequired,blocklet:o.object.isRequired};function Y({siteId:i,domain:t,blocklet:n,hasMutatePermission:s}){const a=U(),{t:r}=w(),[l,d]=v.useState(null),c=p=>{d(p.currentTarget)},u=()=>{d(null)};return e.jsxs(x,{sx:{display:"flex",justifyContent:"flex-start",alignItems:"center",gap:1},children:[t.type==="nft-domain"&&e.jsxs(e.Fragment,{children:[e.jsx(J,{onMouseEnter:c,onMouseLeave:u,style:{cursor:"pointer",fill:a.palette.primary.main}}),e.jsx(Te,{id:"mouse-over-popover",style:{pointerEvents:"none"},open:!!l,anchorEl:l,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:u,disableRestoreFocus:!0,children:e.jsx(Pe,{children:e.jsxs(_e,{style:{display:"flex",flexDirection:"column"},children:[e.jsxs(T,{component:"div",style:{display:"flex",alignItems:"center"},children:[e.jsx(J,{style:{fill:a.palette.primary.main}}),e.jsx(T,{component:"span",style:{marginLeft:"8px",fontSize:"18px",fontWeight:"bolder"},children:r("router.domainAlias.nftDomain")})]}),e.jsxs(T,{component:"div",style:{display:"flex",marginTop:"12px"},children:[e.jsx(T,{component:"span",style:{width:"80px",marginRight:"8px"},children:r("common.domain")}),e.jsx(T,{component:"span",children:t.value})]}),e.jsxs(T,{component:"div",style:{display:"flex"},children:[e.jsx(T,{component:"span",style:{width:"80px",marginRight:"8px"},children:"NFT"}),e.jsx(ft,{did:t.nftDid})]})]})})})]}),e.jsx(M,{domain:t,filters:["http"]},`${t.value}-http`),s&&e.jsx(oe,{siteId:i,domain:t.value,domainStatus:t.domainStatus,did:n.meta.did,children:({open:p})=>e.jsx(L,{sx:{padding:0},size:"small",onClick:j=>p(j),children:r("router.cert.genLetsEncryptCert.title")})})]})}Y.propTypes={siteId:o.string.isRequired,domain:H.isRequired,blocklet:o.object.isRequired,hasMutatePermission:o.bool.isRequired};export{le as A,bn as D,Le as a,ke as d,Fe as u};
|