@abtnode/webapp 1.16.46-beta-20250708-074453-e1748586 → 1.16.46-beta-20250709-120742-e445a508
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blocklet.js +1 -1
- package/blocklet.yml +1 -1
- package/dist/assets/{AdapterDayjs-lZH9dene.js → AdapterDayjs-B4EEI1nK.js} +1 -1
- package/dist/assets/{Add-C-qoFDXR.js → Add-Clw8RkKN.js} +1 -1
- package/dist/assets/ArrowDropDown-B47EydNm.js +1 -0
- package/dist/assets/{Autocomplete-CkAm7uIi.js → Autocomplete-gxYza7s5.js} +1 -1
- package/dist/assets/{Breadcrumbs-Dc_me3zp.js → Breadcrumbs-C4BEBPis.js} +1 -1
- package/dist/assets/{ButtonGroup-C-ePb6nh.js → ButtonGroup-CPPdPq8H.js} +1 -1
- package/dist/assets/{CSSTransition-CJXB5Ckq.js → CSSTransition-CujxmWeH.js} +1 -1
- package/dist/assets/{CallMerge-BZEo0Wnz.js → CallMerge-CcRkZzxX.js} +1 -1
- package/dist/assets/{CardContent-Cz2BZ_i0.js → CardContent-DiPVtGg0.js} +1 -1
- package/dist/assets/{ChevronLeft-FPu3ob1r.js → ChevronLeft-BNoaRf3a.js} +1 -1
- package/dist/assets/{ChevronRight-s7Ge6wbK.js → ChevronRight-A_-fTRIz.js} +1 -1
- package/dist/assets/{Clear-m97-RV9G.js → Clear-ClQc69CC.js} +1 -1
- package/dist/assets/{DeleteOutline-BmVJ0SRH.js → DeleteOutline-BhORbRJB.js} +1 -1
- package/dist/assets/{Done-CkFmbhWG.js → Done-De6rOS7P.js} +1 -1
- package/dist/assets/{Edit-K2FEE6nK.js → Edit-CvUxpqSV.js} +1 -1
- package/dist/assets/{ErrorOutline-DKoJsbYj.js → ErrorOutline-QvbHz9Zz.js} +1 -1
- package/dist/assets/{FilterList-D2ht4WCu.js → FilterList-DrVbs05B.js} +1 -1
- package/dist/assets/{Google-B_iUD-qe.js → Google-BiT-YaK5.js} +1 -1
- package/dist/assets/{HelpOutline-C303jYUV.js → HelpOutline-D_WMmdX2.js} +1 -1
- package/dist/assets/{Launch-D6fDEUZE.js → Launch-p44wWut-.js} +1 -1
- package/dist/assets/{Link-z2jprwfY.js → Link-BLZtgQVF.js} +1 -1
- package/dist/assets/{ListItemButton-D3M-CdH1.js → ListItemButton-BCmmmtlq.js} +1 -1
- package/dist/assets/{ListSubheader-fOlFzbU6.js → ListSubheader-D4-WSAvX.js} +1 -1
- package/dist/assets/{LoadingButton-BmX7Jusm.js → LoadingButton-DYH4mgxh.js} +1 -1
- package/dist/assets/{MoreVert-CfjoPFTT.js → MoreVert-3Ril4BaF.js} +1 -1
- package/dist/assets/{OpenInNew-Be_LQSsx.js → OpenInNew-Dg_PVVYU.js} +1 -1
- package/dist/assets/{Refresh-PALCSyuU.js → Refresh-BuspPECP.js} +1 -1
- package/dist/assets/{Search-C1c8IWNt.js → Search-CveVLYRK.js} +1 -1
- package/dist/assets/{Slider-BO5ploI0.js → Slider-CESm5SzK.js} +1 -1
- package/dist/assets/{Stepper-BzTuZEkI.js → Stepper-CazqSP6B.js} +1 -1
- package/dist/assets/{Switch-DuGwzUc3.js → Switch-Ce-0Lc8M.js} +1 -1
- package/dist/assets/{TableSearch-igEmPOVc.js → TableSearch-BezFlhKc.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-B3aaJd0b.js → ToggleButtonGroup-CBj3NmRn.js} +1 -1
- package/dist/assets/{Verified-B5S0Jn97.js → Verified-aOhYddnX.js} +1 -1
- package/dist/assets/{VerifiedUser-BZcaTXsE.js → VerifiedUser-BWVM02FY.js} +1 -1
- package/dist/assets/{ViewList-bh6Ajs2i.js → ViewList-5nfbahYZ.js} +1 -1
- package/dist/assets/{_createAggregator-DMjY-MBa.js → _createAggregator-Bw2sNslm.js} +1 -1
- package/dist/assets/{actions-x67maLIz.js → actions-BFpxkOZ3.js} +1 -1
- package/dist/assets/{actions-B3_8uzvm.js → actions-DUHD3OYP.js} +1 -1
- package/dist/assets/{agreement-PUXVGdXT.js → agreement-B1qJWzXq.js} +1 -1
- package/dist/assets/api-BcYW4RGg.js +1 -0
- package/dist/assets/{appearance-Bgw8YFgu.js → appearance-BYuAhb11.js} +1 -1
- package/dist/assets/{audit-logs-kFOQ8piR.js → audit-logs-CrbGepG6.js} +1 -1
- package/dist/assets/{base-chart-B0Hyb60u.js → base-chart-C8SmgApV.js} +1 -1
- package/dist/assets/{blocklet-BALghaj0.js → blocklet-DXJr-xZq.js} +1 -1
- package/dist/assets/{chain-BhwRxbuE.js → chain-DZSCXq3Z.js} +1 -1
- package/dist/assets/{click-to-copy-CJEiBY5P.js → click-to-copy-CTJTNpA1.js} +1 -1
- package/dist/assets/client-Bq43pXAg.js +1 -0
- package/dist/assets/cloneDeep-Q4iUxm_j.js +1 -0
- package/dist/assets/{collapse-CfBqxRhe.js → collapse-CYNTI7Qd.js} +1 -1
- package/dist/assets/{config-navigation-nesFWbGx.js → config-navigation-B2RlmMVN.js} +3 -3
- package/dist/assets/{connect-to-CnP8SOkh.js → connect-to-CmnXJqsQ.js} +2 -2
- package/dist/assets/{cssMode-C1e0mA57.js → cssMode-DZxnsnyP.js} +1 -1
- package/dist/assets/{delete-confirm-DLDRKoJo.js → delete-confirm-itV6yjjb.js} +1 -1
- package/dist/assets/{depsEqual-0t8DQthz.js → depsEqual-B5cFAumu.js} +1 -1
- package/dist/assets/{detail-Cg4TjDi0.js → detail-nzbwZA_l.js} +3 -3
- package/dist/assets/{domains-DhqN937R.js → domains-DEBNKwmg.js} +1 -1
- package/dist/assets/{download-C9mWRkM0.js → download-hD5L8LfI.js} +1 -1
- package/dist/assets/emotion-cache.browser.esm-BUnXReBA.js +1 -0
- package/dist/assets/engine-BwbWZmR_.js +1 -0
- package/dist/assets/{freemarker2-B1qbq2qN.js → freemarker2-B8K0tUnT.js} +1 -1
- package/dist/assets/{get-safe-url-B_6dDPbh.js → get-safe-url-CkVD5JZ8.js} +1 -1
- package/dist/assets/getValidReactChildren-CutnuaBi.js +1 -0
- package/dist/assets/{graphqlMode-DnoC9WZb.js → graphqlMode-qoJCyPf8.js} +2 -2
- package/dist/assets/{handlebars-sYEGFidT.js → handlebars-DSYs6ELw.js} +1 -1
- package/dist/assets/{html-C9sx0W61.js → html-BQrix1LQ.js} +1 -1
- package/dist/assets/{htmlMode-W97PTBL6.js → htmlMode-CvDerMSw.js} +1 -1
- package/dist/assets/{iframe-CdJEjD_P.js → iframe-d_LXZhpi.js} +1 -1
- package/dist/assets/{index-DpWdOcvI.js → index--ktJL2Tx.js} +83 -83
- package/dist/assets/{index-fLIxpU-m.js → index-51UuxJbA.js} +1 -1
- package/dist/assets/{index-CYSduNA_.js → index-5o6sB1f4.js} +1 -1
- package/dist/assets/{index-CpQsldd8.js → index-B73hHdUc.js} +1 -1
- package/dist/assets/{index-CenzsuPy.js → index-B9t-nPIq.js} +9 -9
- package/dist/assets/{index-BupHbkeI.js → index-BJFK1iYB.js} +1 -1
- package/dist/assets/{index-BysxKOSu.js → index-BJrvhEw-.js} +1 -1
- package/dist/assets/{index-DvpXXioO.js → index-BKrngGDQ.js} +1 -1
- package/dist/assets/{index-DaLwUIz-.js → index-BMN0G3TX.js} +1 -1
- package/dist/assets/{index-1lRds6IP.js → index-BQ9Ts5av.js} +1 -1
- package/dist/assets/{index-B3DXtbtv.js → index-BQhkQ0WB.js} +1 -1
- package/dist/assets/{index-L0YnrGvB.js → index-BbU3n2Hk.js} +1 -1
- package/dist/assets/{index-a8uqiYfW.js → index-C4ni3qSD.js} +1 -1
- package/dist/assets/index-CCptkWcP.js +1 -0
- package/dist/assets/{index-D0VlfeTl.js → index-CEX6125H.js} +1 -1
- package/dist/assets/{index-DWI-Juvh.js → index-CGnZOo7d.js} +1 -1
- package/dist/assets/{index-s0Wlu-Gu.js → index-CPtXYlM0.js} +1 -1
- package/dist/assets/{index-Csvo7_k-.js → index-CXW6fl1B.js} +3 -3
- package/dist/assets/{index-Q1c8rnen.js → index-CZH7Mn5H.js} +1 -1
- package/dist/assets/{index-CsVvkoWj.js → index-CbZ9lYQN.js} +1 -1
- package/dist/assets/{index-7C5ffsZ4.js → index-CgR_UwLm.js} +1 -1
- package/dist/assets/{index-Qd4Npqh6.js → index-Ci5mHjJo.js} +1 -1
- package/dist/assets/{index-CgV386d2.js → index-CjyGkLY6.js} +1 -1
- package/dist/assets/{index-C1f5NJYc.js → index-CkVoL_FA.js} +1 -1
- package/dist/assets/{index-BbFJaRoB.js → index-Clb2HKeU.js} +1 -1
- package/dist/assets/{index-pSHx8NNU.js → index-Crckurao.js} +1 -1
- package/dist/assets/{index-Dm5ajuS5.js → index-D8SeMuuf.js} +1 -1
- package/dist/assets/{index-CsL1GaPn.js → index-DFZwyC09.js} +3 -3
- package/dist/assets/{index-uNZWrXL2.js → index-DRXdQRdu.js} +1 -1
- package/dist/assets/{index-B4DvnAQV.js → index-DTRD5V4Z.js} +1 -1
- package/dist/assets/{index-BXV5YZlG.js → index-DYPal8XU.js} +1 -1
- package/dist/assets/{index-B7ZNrnM-.js → index-DgeSWvC7.js} +1 -1
- package/dist/assets/{index-aHWRyS56.js → index-DodEGet5.js} +2 -2
- package/dist/assets/{index-BBHfndQF.js → index-Dp5rYjgm.js} +1 -1
- package/dist/assets/{index-BqOT1vg4.js → index-Dv5txe8G.js} +1 -1
- package/dist/assets/{index-DCdUt9hG.js → index-Dv9qlze4.js} +1 -1
- package/dist/assets/{index-D4bHWSDT.js → index-FTSHH2z1.js} +1 -1
- package/dist/assets/{index-CuettTd7.js → index-HQ4TKOad.js} +1 -1
- package/dist/assets/{index-B6L-XwR3.js → index-MAh0KZHB.js} +1 -1
- package/dist/assets/{index-Cp7n-akO.js → index-MeuqPgEE.js} +3 -3
- package/dist/assets/{index-D9gay98p.js → index-Ur2CzPm7.js} +1 -1
- package/dist/assets/{index--qiTIIgA.js → index-VibrsnfQ.js} +3 -3
- package/dist/assets/{index-DfB3-fEf.js → index-_ISHsU4A.js} +1 -1
- package/dist/assets/{index-DiT-8Xe3.js → index-a0VOLesk.js} +1 -1
- package/dist/assets/{index-3xw63xev.js → index-f15iWus7.js} +1 -1
- package/dist/assets/{index-S2ho0LL3.js → index-iLrPvwdH.js} +1 -1
- package/dist/assets/{index-BKr-jX9v.js → index-vh4u80PB.js} +1 -1
- package/dist/assets/{index.esm-XPslm4nt.js → index.esm-Dqj7a_ya.js} +1 -1
- package/dist/assets/{install-from-url-giLwGmDP.js → install-from-url-B4rawAqf.js} +1 -1
- package/dist/assets/{invitation-BFMjKnvT.js → invitation-DyVYJveL.js} +1 -1
- package/dist/assets/{is-path-prefix-equal-lT3S9weM.js → is-path-prefix-equal-RJLchj2H.js} +1 -1
- package/dist/assets/{item-1_haAiVQ.js → item-DqvYl0Bz.js} +1 -1
- package/dist/assets/{javascript-CpHN27bN.js → javascript-D_OdapPL.js} +1 -1
- package/dist/assets/{jsonMode-0rL7i1sU.js → jsonMode-iE2OrXad.js} +1 -1
- package/dist/assets/{liquid-BEDTv-ck.js → liquid-egzKcszN.js} +1 -1
- package/dist/assets/{list-header-xkvwak1A.js → list-header-s7KnhaJP.js} +1 -1
- package/dist/assets/{log-BWF7Aohw.js → log-BO9Yemek.js} +1 -1
- package/dist/assets/{lottie-react.esm-mngGgNUP.js → lottie-react.esm-D0Of1jq5.js} +1 -1
- package/dist/assets/{mdx-B8FMJSU2.js → mdx--E2h1g-2.js} +1 -1
- package/dist/assets/{memory-BvjAc2Nx.js → memory-FyikFhq4.js} +1 -1
- package/dist/assets/{metric-DOzyE6hY.js → metric-Bbm9krzb.js} +1 -1
- package/dist/assets/omit-BOKRrWcI.js +1 -0
- package/dist/assets/{overview-BXQRNXci.js → overview-ZNI6zxFE.js} +1 -1
- package/dist/assets/{permission-y2eN7M97.js → permission-Bd240jHS.js} +1 -1
- package/dist/assets/{preference-D3tM1bRV.js → preference-DHBc5A-p.js} +3 -3
- package/dist/assets/{python-jzggTEg_.js → python-giqpzHx_.js} +1 -1
- package/dist/assets/{raf-schd.esm-BOsLTGQl.js → raf-schd.esm-QI9cu6Me.js} +1 -1
- package/dist/assets/{razor-DO_NWOoB.js → razor-C_I2nnqk.js} +1 -1
- package/dist/assets/{rotate-session-key-DanP3i86.js → rotate-session-key-WcsLllKv.js} +1 -1
- package/dist/assets/{runtime-Di5YMKHb.js → runtime-beCFfh_D.js} +1 -1
- package/dist/assets/schema-DloAUG7Z.js +1 -0
- package/dist/assets/sdk-FGFC0J6F.js +1 -0
- package/dist/assets/{service-BBRG9CEW.js → service-Boq6QtTB.js} +1 -1
- package/dist/assets/{shorten-label-DnZXaTPM.js → shorten-label-BsB05cbU.js} +1 -1
- package/dist/assets/{simple-select-CGN0rgxD.js → simple-select-CwzHbqQD.js} +1 -1
- package/dist/assets/{spaces-CVUV04Qu.js → spaces-CO7vXdm4.js} +1 -1
- package/dist/assets/{status-DjJD8ZRK.js → status-CqnKmWlH.js} +1 -1
- package/dist/assets/{status-DhAxXp8T.js → status-g9gqtunL.js} +1 -1
- package/dist/assets/{switch-control-C0sPQYWg.js → switch-control-DwCkU90q.js} +1 -1
- package/dist/assets/{table-icons-qbS_0YPJ.js → table-icons-vuWhvyxJ.js} +1 -1
- package/dist/assets/{team-DYENwSX2.js → team-BroofdgP.js} +1 -1
- package/dist/assets/{toLower-D-d8Dv0x.js → toLower-Co1lWVoz.js} +1 -1
- package/dist/assets/toUpper-DEqJjuKZ.js +1 -0
- package/dist/assets/{traffic-C2RBXLkf.js → traffic-D-aoJfLs.js} +1 -1
- package/dist/assets/{tsMode-CXYuJRmW.js → tsMode-yvNR09fH.js} +1 -1
- package/dist/assets/{typescript-CRIPrNYf.js → typescript-CMLS3uhm.js} +1 -1
- package/dist/assets/{url-evaluation-BLZfb0Dg.js → url-evaluation-udVYSMO4.js} +1 -1
- package/dist/assets/{url-join-CXIuL0JQ.js → url-join-vuArvvL1.js} +1 -1
- package/dist/assets/{use-mobile-D_qdydKi.js → use-mobile-BM273ejS.js} +1 -1
- package/dist/assets/{use-mobile-BB8wRni0.js → use-mobile-DwZO5be8.js} +1 -1
- package/dist/assets/{useAsync-CE04Oyzr.js → useAsync-DLvWuoz4.js} +1 -1
- package/dist/assets/{useAsyncRetry-C9ik6Acy.js → useAsyncRetry-D5p_7oRt.js} +1 -1
- package/dist/assets/{useLocalStorage-W8XXMbhN.js → useLocalStorage-Bj7q_OT_.js} +1 -1
- package/dist/assets/{useThemeProps-B4Om35fj.js → useThemeProps-GIAqgoE8.js} +1 -1
- package/dist/assets/{util-D3jybip3.js → util-SXSVGHBg.js} +1 -1
- package/dist/assets/{wait-container-a86uX6DP.js → wait-container-CDKA5Gem.js} +1 -1
- package/dist/assets/{without-wallet-BU0U8gNN.js → without-wallet-D7xWotBX.js} +1 -1
- package/dist/assets/{wrap-locale-Cq-ah7SY.js → wrap-locale-DR1zYzoA.js} +1 -1
- package/dist/assets/{xml-CZMMkaPT.js → xml-B0YAwXot.js} +1 -1
- package/dist/assets/{yaml-B6e3w7iW.js → yaml-fECgnKXj.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +1 -1
- package/dist/assets/ArrowDropDown--DVNnyqn.js +0 -1
- package/dist/assets/api-DOfnx6Rg.js +0 -1
- package/dist/assets/client-CruQZ9FM.js +0 -1
- package/dist/assets/cloneDeep-BvpAoeCE.js +0 -1
- package/dist/assets/emotion-cache.browser.esm-VTZJ-Izu.js +0 -1
- package/dist/assets/engine-G4cXU1O1.js +0 -1
- package/dist/assets/getValidReactChildren-BldpnGjG.js +0 -1
- package/dist/assets/index-C04uw3ut.js +0 -1
- package/dist/assets/omit-YRKeCzRU.js +0 -1
- package/dist/assets/schema-Cwcp4lCp.js +0 -1
- package/dist/assets/sdk-BvWTXJtP.js +0 -1
- package/dist/assets/toUpper-LALjq_3Z.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aG as v,j as t,N as a,dc as w,m as z,f as p,dh as E}from"./index
|
|
1
|
+
import{aG as v,j as t,N as a,dc as w,m as z,f as p,dh as E}from"./index--ktJL2Tx.js";const I=v(t.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m4.3 14.3c-.39.39-1.02.39-1.41 0L12 13.41 9.11 16.3c-.39.39-1.02.39-1.41 0a.996.996 0 0 1 0-1.41L10.59 12 7.7 9.11a.996.996 0 0 1 0-1.41c.39-.39 1.02-.39 1.41 0L12 10.59l2.89-2.89c.39-.39 1.02-.39 1.41 0s.39 1.02 0 1.41L13.41 12l2.89 2.89c.38.38.38 1.02 0 1.41"}));function r({icon:e=null,title:n="",description:o="",extra:b=null,...y}){return t.jsxs(P,{...y,children:[e,typeof n=="string"?t.jsx(a,{sx:{mt:3,fontSize:22,fontWeight:400,color:"#47494E",textAlign:"center"},children:n}):n,typeof o=="string"?t.jsx(a,{sx:{mt:1,fontSize:14,color:"#7F828B",textAlign:"center"},children:o}):o,t.jsx(a,{sx:{mt:3},children:b})]})}const P=w("div")`
|
|
2
2
|
box-sizing: border-box;
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aG as ce,j as e,r as W,aV as A,N as j,T as ue,s as G,o as _,hs as de,bd as me,bn as te,m as re,fI as ie,f9 as ne,aP as se,cr as m,H as k,ht as B,t as x,hu as $,aU as J,Q as p,az as fe,v as L,z as he,y as xe,E as pe,g as je,by as ve}from"./index
|
|
1
|
+
import{aG as ce,j as e,r as W,aV as A,N as j,T as ue,s as G,o as _,hs as de,bd as me,bn as te,m as re,fI as ie,f9 as ne,aP as se,cr as m,H as k,ht as B,t as x,hu as $,aU as J,Q as p,az as fe,v as L,z as he,y as xe,E as pe,g as je,by as ve}from"./index--ktJL2Tx.js";import{T as ge}from"./index-BMN0G3TX.js";import{u as ae,C as f}from"./index.esm-Dqj7a_ya.js";import{A as be,a as ye,b as we,c as Re}from"./collapse-CYNTI7Qd.js";import{u as oe}from"./blocklet-DXJr-xZq.js";import{S as Q}from"./Switch-Ce-0Lc8M.js";const Te=ce(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 17h-2v-2h2zm2.07-7.75-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25"}));function h({title:c,desc:n="",link:t="",sectionLeftSx:u={width:"384px"},sectionRightSx:v={},children:d,...C}){const R=W.useMemo(()=>t?n?n.replace(/<b>(.*?)<\/b>/g,`<a href="${t}" target="_blank" rel="noopener noreferrer">$1</a>`):"":n,[n,t]);return e.jsx(Se,{...C,children:e.jsxs(A,{className:"section",direction:{sm:"column",md:"row"},sx:{gap:{xs:3,md:6}},children:[e.jsxs(j,{className:"section-left",sx:u,children:[e.jsx(ue,{className:"section-title",children:c}),e.jsx(j,{className:"section-desc",sx:{color:"text.secondary"},dangerouslySetInnerHTML:{__html:R}})]}),e.jsx(A,{className:"section-content",direction:"column",sx:{width:"100%",...v},children:d})]})})}h.propTypes={title:_.string.isRequired,children:_.node.isRequired,desc:_.string,sectionLeftSx:_.object,sectionRightSx:_.object,link:_.node};const Se=G(j)`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: flex-start;
|
|
4
4
|
width: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ak as ee,A as T,r as f,a as te,b as se,m as S,u as j,x as re,aw as A,J as F,j as t,w as $,ax as oe,T as R,y as k,$ as q,o as m,ay as ne,az as ae,v as _,C as N,aA as ie,H as O,Y as W,aB as le,aC as ce,N as B,aD as ue,E as de,L as pe,aE as he,aa as fe,s as M,a7 as me,a8 as ge,aF as xe,a9 as be}from"./index
|
|
1
|
+
import{ak as ee,A as T,r as f,a as te,b as se,m as S,u as j,x as re,aw as A,J as F,j as t,w as $,ax as oe,T as R,y as k,$ as q,o as m,ay as ne,az as ae,v as _,C as N,aA as ie,H as O,Y as W,aB as le,aC as ce,N as B,aD as ue,E as de,L as pe,aE as he,aa as fe,s as M,a7 as me,a8 as ge,aF as xe,a9 as be}from"./index--ktJL2Tx.js";import{u as L}from"./useLocalStorage-Bj7q_OT_.js";import{C as ke,c as ye,e as Se,_ as je,a as we,d as ve,s as Pe,S as z,b as Re,A as Ce}from"./item-DqvYl0Bz.js";import{e as D}from"./engine-BwbWZmR_.js";import{g as U}from"./get-safe-url-CkVD5JZ8.js";import{P as V}from"./permission-Bd240jHS.js";import{A as Le}from"./ArrowDropDown-B47EydNm.js";import{B as Ee}from"./Breadcrumbs-C4BEBPis.js";import"./ChevronLeft-BNoaRf3a.js";import"./ChevronRight-A_-fTRIz.js";import"./Search-CveVLYRK.js";import"./index-CPtXYlM0.js";import"./blocklet-DXJr-xZq.js";import"./Autocomplete-gxYza7s5.js";import"./ListSubheader-D4-WSAvX.js";import"./Verified-aOhYddnX.js";import"./VerifiedUser-BWVM02FY.js";import"./Add-Clw8RkKN.js";import"./Launch-p44wWut-.js";import"./Done-De6rOS7P.js";import"./DeleteOutline-BhORbRJB.js";import"./delete-confirm-itV6yjjb.js";import"./click-to-copy-CTJTNpA1.js";import"./MoreVert-3Ril4BaF.js";import"./ButtonGroup-CPPdPq8H.js";import"./getValidReactChildren-CutnuaBi.js";function De(e){const n=ee(),l=T(),[s,o]=L(`sid:blocklet:purchase:${e}`),[i,c]=f.useState(!1),[u,a]=f.useState(null),d=()=>{const{pathname:r,searchParams:g}=new URL(window.location.href),x=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";g.get("sid")&&(o(""),l(r.replace(x,"/"),{replace:!0}))},p=!!(n.get("assetDid")&&s&&n.get("sid")===s);return te(se.BlockletEvents.purchaseChange,r=>{r.did===e&&(a(r.session),["declined","confirmed","error"].includes(r.session.status)&&(c(!0),setTimeout(d,2e3)))}),f.useEffect(()=>{u&&u.id!==s&&o(u.id)},[u]),{hasCompleted:i,hasPurchased:p,session:u,setSession:a,doRedirect:d}}function Be(e){setTimeout(()=>{window.location.href=U(e,{allowDomains:null})},1e3)}function H({meta:e,onCancel:n,handlePaySuccess:l=Be,storeUrl:s}){const{t:o}=S(),{info:i}=j(),[c,u]=f.useState("both"),[a,d]=f.useState(1),p=re(i),r=A(e,i,s),g=P=>{P!==c&&u(P)},x=()=>{c&&(d(2),c==="verify"&&(window.location.href=U(r)))},w=(P,E)=>{E!=="backdropClick"&&n()},b=()=>{l(r)},h=F.getDisplayName({meta:e});if(c==="purchase"&&a===2)return t.jsx($,{open:!0,popup:!0,baseUrl:s,action:"acquire-asset",checkFn:oe.create({baseURL:k(s,"/store")}).get,onSuccess:b,onClose:n,checkTimeout:60*5e3,extraParams:{factory:e.nftFactory},webWalletUrl:p,disableClose:!0,saveConnect:!1,showDownload:!1,messages:{title:o("store.purchase.auth.title",{name:h}),scan:o("store.purchase.auth.scan"),confirm:o("store.purchase.auth.confirm"),success:t.jsxs(t.Fragment,{children:[t.jsx(R,{gutterBottom:!0,children:o("store.purchase.auth.success")}),t.jsxs(R,{variant:"subtitle2",children:[" ",o("store.purchase.autoLaunch",{name:h})]})]})}});const v=q;return t.jsx(v,{title:o("store.purchase.title",{name:h}),disableEscapeKeyDown:!0,open:!0,fullWidth:!0,onClose:w,children:t.jsx("div",{style:{marginBottom:16},children:t.jsx(ke,{action:c,onNext:x,onSelect:g})})})}H.propTypes={...ye,storeUrl:m.string.isRequired,handlePaySuccess:m.func};function K({meta:e,buttonText:n,storeUrl:l,isResource:s=!1}){const{t:o}=S(),i=T(),{info:c}=j(),{api:u}=ne(),a=F.isFreeBlocklet(e)===!1,[d,p]=f.useState(!1),{hasPurchased:r}=De(e.did),[g,x]=f.useState(!1),[w]=L("instant-blocklet-install",!1),[b,h]=f.useState(!1),v=f.useMemo(()=>d?o(a?"blocklet.status.purchasing":"blocklet.status.waiting"):"",[d,o,a]),P=f.useMemo(()=>s?o("blocklet.status.resource"):a?n.purchase:n.launch,[a,n,s]),E=y=>{y.preventDefault(),y.stopPropagation();try{if(p(!0),a){x(!0);return}if(w){h(!0);return}if(!a){const C=A(e,c,l);window.location.href=U(C)}}catch(C){O.error(W(C),{autoHideDuration:5e3}),console.error("Blocklet installed failed",C)}finally{p(!1)}},Q=()=>{p(!1),x(!1)},X=y=>{p(!1),h(!1),i(`/blocklets/${y.appDid}/components`)},Z=()=>{p(!1),h(!1)};return t.jsxs(t.Fragment,{children:[t.jsx(Se,{children:t.jsx(V,{permission:"mutate_blocklets",children:y=>t.jsx(ae,{title:s?o("launchBlocklet.error.resourceBlocklet"):"",children:t.jsx(_,{onClick:E,size:"small",sx:{cursor:s?"not-allowed":"pointer",overflow:"hidden"},disabled:!!(v||!y),variant:"outlined",color:"primary","data-cy":"install-blocklet",children:v?t.jsxs(t.Fragment,{children:[t.jsx(N,{size:16,style:{marginRight:3}}),v]}):P},e.did)})})}),(r||g)&&t.jsx(H,{method:"launch",meta:e,mode:"both",onCancel:Q,storeUrl:l}),b&&t.jsx($,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:u.get,checkTimeout:5*60*1e3,onSuccess:X,extraParams:{title:e.title,blockletMetaUrl:decodeURIComponent(ie(l,e.did).trim())},messages:{title:o("setup.keyPair.title"),scan:o("setup.keyPair.scan"),confirm:o("setup.keyPair.confirm"),success:o("setup.keyPair.success")},onClose:Z})]})}K.propTypes={isResource:m.bool,meta:m.object.isRequired,buttonText:m.shape({purchase:m.string.isRequired,launch:m.string.isRequired}).isRequired,storeUrl:m.string.isRequired};const Ue=(e,n,l)=>{const s=fe(n);return k(l,`/blocklets/${e.did}/?server-url=${s}`)},I=({meta:e,attribute:n,value:l})=>e._formatted?e._formatted[n]:l,Ie=(e,n)=>{if(!e||!n)return"";try{return k(n,e)}catch(l){return console.warn("Failed to construct avatar URL:",l),""}};function G({blocklet:e,endpoint:n="",serverVersion:l=""}){const{t:s}=S(),o=j();let i=k(o.imgPrefix,"blocklet.png");const c=n;if(c.startsWith("http")&&e.logo)i=k(c,ue(e.did,e.logo,e.version));else{let g=(window.env.apiPrefix||"/").replace(/^\/+/,"").replace(/\/+$/,"");g&&(g=`/${g}`),i=k(g,`/blocklet/logo/${e.did}`)}try{const r=new URL(i);r.searchParams.set("v",e.version||+new Date),i=r.href}catch{}const u=o?.info.mode!==de.NODE_MODES.SERVERLESS,a=r=>r.currentTarget.contains(r.target)?!0:(r.preventDefault(),!1),d={meta:e,buttonText:{purchase:s("common.purchase"),launch:s("common.launch")},storeUrl:c};let p=null;return u&&(p=t.jsx("div",{style:{display:"flex",alignItems:"center"},children:t.jsx(we,{serverVersion:l,requirementVersion:e.requirements?.server,size:"small",children:t.jsx(K,{isResource:!(D.hasStartEngine(e)||D.isGatewayBlocklet(e)||D.isPackBlocklet(e)),...d})})})),t.jsx(pe,{href:Ue(e,o.info,n),style:{color:"initial",textDecoration:"none"},onClick:a,target:"_blank",children:t.jsx(Te,{title:I({meta:e,attribute:"title",value:e.title||e.name}),did:e.did,description:I({meta:e,attribute:"description",value:e.description}),cover:e.logo?i:"",version:e.version,onButtonClick:null,icons:e.docker?.image?[{key:"docker",icon:t.jsx(B,{sx:{display:"flex",color:"primary.main"},children:t.jsx(he,{icon:ve})}),title:s("blocklet.dockerImage")}]:[],official:e.isOfficial?{tooltip:s("blocklet.component.isOfficial")}:void 0,author:e.owner.fullName,avatar:Ie(e.owner.avatar,n),download:e.stats.downloads,button:p})})}G.propTypes={blocklet:m.object.isRequired,serverVersion:m.string,endpoint:m.string};function Y({storeUrl:e,handleSearchSelect:n=null,extraFilter:l=void 0,...s}){const{locale:o}=S(),i=j(),[c,u]=f.useState({}),a=r=>{u(r)},d=e,p=i?.info?.version;return f.useEffect(()=>{u({})},[d]),t.jsx(le,{FallbackComponent:ce,resetKeys:[d],children:t.jsx(B,{...s,sx:{"& .title-bar":{pt:0},".blocklet-list":{mt:0},"& h2":{display:"none"}},children:t.jsx(je,{layout:{showExplore:!1,showTitle:!0},blockletRender:r=>t.jsx(G,{...r,endpoint:d}),baseSearch:!0,endpoint:d,locale:o,onFilterChange:a,onSearchSelect:n,filters:c,extraFilter:l,serverVersion:p})})})}Y.propTypes={storeUrl:m.string.isRequired,handleSearchSelect:m.func,extraFilter:m.func};const Te=M(Pe)`
|
|
2
2
|
.ms-highlight {
|
|
3
3
|
color: ${e=>e.theme.palette.primary.main};
|
|
4
4
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c0 as c,r as _,cr as f,gX as S,cR as r}from"./index--ktJL2Tx.js";var m=function(n){var a=c(_.useState(n),2),u=a[0],o=a[1],i=f(function(t){o(function(e){var s=S(t)?t(e):t;return s?r(r({},e),s):e})});return[u,i]};export{m as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{dD as b,r as o,U as d,j as e,dE as c,b5 as C,dF as E,bu as I,dG as z,dc as u,dH as A}from"./index
|
|
1
|
+
import{dD as b,r as o,U as d,j as e,dE as c,b5 as C,dF as E,bu as I,dG as z,dc as u,dH as A}from"./index--ktJL2Tx.js";import{B as L}from"./ButtonGroup-CPPdPq8H.js";function P({...r}){const{size:m="medium",color:i="primary",menu:a=[],children:s=null,variant:p="contained",onClick:x=b,menuButtonProps:f={},...h}=r,[j,l]=o.useState(!1),n=o.useRef(null),g=Array.isArray(a)?a.map((t,B)=>o.isValidElement(t)?t:o.createElement(d,{...t,key:B})):a,y=()=>{l(t=>!t)},M=t=>{n.current&&n.current.contains(t.target)||l(!1)},k=t=>{t.target.closest(".MuiMenuItem-root")&&l(!1)};return e.jsxs(e.Fragment,{children:[e.jsxs(v,{variant:p,size:m,color:i,ref:n,...h,children:[typeof s=="function"?s():e.jsx(c,{onClick:x,color:i,children:s}),e.jsx(c,{onClick:y,color:i,...f,"aria-label":"more functions",children:e.jsx(C,{})})]}),e.jsx(w,{open:j,anchorEl:n.current,placement:"bottom-end",disablePortal:!1,children:e.jsx(E,{children:e.jsx(I,{onClickAway:M,children:e.jsx(z,{onClick:k,children:g})})})})]})}P.Item=d;const v=u(L)`
|
|
2
2
|
> .MuiButtonBase-root:last-of-type {
|
|
3
3
|
min-width: 2em;
|
|
4
4
|
padding-left: 0;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,N as g,_ as he,s as C,a0 as K,m as D,r as f,a1 as ue,y as v,a2 as Me,a3 as Ge,o as R,a4 as se,a5 as ze,H as I,Y as Q,T as _,h as We,a6 as He,v as E,$ as qe,D as Ve,t as Ye,X as fe,C as xe,a7 as Ke,a8 as Qe,a9 as Xe,u as N,g as Je,aa as G,n as te,B as Ze,ab as oe,A as ge,q as re,ac as et,W as ae,L as X,w as ye,x as J,ad as tt,ae as ke,af as st,b as B,ag as le,ah as ot,K as rt,ai as at,aj as nt,O as lt,f as it,ak as ct,al as we,am as be,an as Se,ao as A,ap as ve,aq as je,ar as Ce,as as Pe,at as Re,au as dt,av as ie}from"./index
|
|
1
|
+
import{j as e,N as g,_ as he,s as C,a0 as K,m as D,r as f,a1 as ue,y as v,a2 as Me,a3 as Ge,o as R,a4 as se,a5 as ze,H as I,Y as Q,T as _,h as We,a6 as He,v as E,$ as qe,D as Ve,t as Ye,X as fe,C as xe,a7 as Ke,a8 as Qe,a9 as Xe,u as N,g as Je,aa as G,n as te,B as Ze,ab as oe,A as ge,q as re,ac as et,W as ae,L as X,w as ye,x as J,ad as tt,ae as ke,af as st,b as B,ag as le,ah as ot,K as rt,ai as at,aj as nt,O as lt,f as it,ak as ct,al as we,am as be,an as Se,ao as A,ap as ve,aq as je,ar as Ce,as as Pe,at as Re,au as dt,av as ie}from"./index--ktJL2Tx.js";import{t as pt}from"./toLower-Co1lWVoz.js";import{a as W,u as mt,W as ht,P as Te,L as Be}from"./index-Ci5mHjJo.js";import{A as ut,D as ne,u as ft,W as xt,P as gt,a as Ee,L as De}from"./wait-container-CDKA5Gem.js";import{g as Z}from"./get-safe-url-CkVD5JZ8.js";import{u as ce}from"./useLocalStorage-Bj7q_OT_.js";import{L as yt}from"./Launch-p44wWut-.js";import{D as kt}from"./DeleteOutline-BhORbRJB.js";import{g as wt,i as bt}from"./spaces-CO7vXdm4.js";import{I as St}from"./MoreVert-3Ril4BaF.js";import{y as vt}from"./index-CPtXYlM0.js";import"./url-join-vuArvvL1.js";import"./use-mobile-DwZO5be8.js";import"./api-BcYW4RGg.js";function Ue({children:s,selected:a=!1}){return e.jsxs(jt,{children:[s,e.jsx(g,{className:`selected-container ${a?"selected":""}`,children:e.jsx(he,{className:"selected-icon"})})]})}const jt=C(g)`
|
|
2
2
|
position: relative;
|
|
3
3
|
|
|
4
4
|
.selected-container {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as l,j as t,N as o,dc as c,o as n}from"./index
|
|
1
|
+
import{r as l,j as t,N as o,dc as c,o as n}from"./index--ktJL2Tx.js";const h=e=>l.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.36096 2.3999C7.04725 2.3999 6.76249 2.58326 6.63267 2.86886L0.872671 15.5409C0.825415 15.6448 0.800964 15.7577 0.800964 15.8719V15.9999V27.3919C0.800964 27.8337 1.15914 28.1919 1.60096 28.1919H30.401C30.8428 28.1919 31.201 27.8337 31.201 27.3919V15.8719C31.201 15.7577 31.1765 15.6448 31.1293 15.5409L25.3693 2.86886C25.2394 2.58326 24.9547 2.3999 24.641 2.3999H7.36096ZM2.40096 16.7999V26.5919H29.601V16.7932C29.5669 16.7976 29.5321 16.7999 29.4968 16.7999H22.3993L20.3328 19.8997C20.1845 20.1222 19.9347 20.2559 19.6672 20.2559H11.6032C11.3357 20.2559 11.0859 20.1222 10.9375 19.8997L8.87104 16.7999H2.40096ZM29.2167 15.1999H21.9712C21.7037 15.1999 21.4539 15.3336 21.3056 15.5561L19.239 18.6559H12.0313L9.96483 15.5561C9.81645 15.3336 9.56667 15.1999 9.29919 15.1999H2.78519L7.8761 3.9999H24.1258L29.2167 15.1999Z",fill:"currentColor"})),m=c(o)`
|
|
2
2
|
display: flex;
|
|
3
3
|
justify-content: center;
|
|
4
4
|
align-items: center;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index
|
|
2
|
-
import{aG as Ve,j as e,dn as vo,gp as Ro,io as So,m as A,bn as H,N as b,az as xe,H as N,o as r,f as lt,r as d,g as Ce,bA as Me,b as K,J as L,X as Tt,bz as Ge,Y as ae,ip as ko,t as Z,s as B,a4 as J,aV as bn,T as te,$ as ct,dD as Xt,y as Ye,b8 as wo,bE as Eo,E as U,b1 as To,gc as Io,gd as Po,C as me,f1 as Uo,hd as _o,x as Do,ax as Jt,w as No,iq as Lo,ir as Bo,v as pe,is as Oo,Z as Mo,a0 as Ao,it as jn,bo as vn,U as Re,f7 as qo,e_ as Fo,aB as $o,aC as zo,bk as Go,aD as Wo,aE as X,aO as Vo,cN as Yo,F as Rn,bm as Ko,_ as Ho,O as ot,aZ as Nt,iu as Zo,a_ as ye,hn as Qo,aA as en,cL as Xo,ad as Ae,aM as Sn,bS as Lt,cw as Jo,L as dt,iv as es,b9 as ts,A as kn,aU as It,h as ns,aS as ze,P as vt,W as os,bB as wn,fI as ss,cr as rs,aJ as is,bt as as,aR as ls,dE as cs,fd as tn,iw as nn,gH as on,V as sn,G as st,cK as ds,gF as us,bR as ps,ix as ms}from"./index-DpWdOcvI.js";import{y as fs}from"./index-s0Wlu-Gu.js";import{a as hs,c as gs,d as xs,u as Bt,R as ys}from"./actions-B3_8uzvm.js";import{S as Cs}from"./switch-control-C0sPQYWg.js";import{u as fe}from"./blocklet-BALghaj0.js";import{P as Pt,w as ut}from"./permission-y2eN7M97.js";import{E as En}from"./Edit-K2FEE6nK.js";import{T as bs,M as js,t as vs}from"./table-icons-qbS_0YPJ.js";import{s as Rs,F as Ss,R as it,L as ks,S as ws,B as Es}from"./preference-D3tM1bRV.js";import{C as rn}from"./click-to-copy-CJEiBY5P.js";import{v as Rt}from"./index-D0VlfeTl.js";import{A as Ts}from"./Add-C-qoFDXR.js";import{A as Ot}from"./Link-z2jprwfY.js";import{C as Is,c as Ps,b as Us,f as Tn,A as _s,_ as Ds,a as Ns,e as Ls,d as In,s as Bs,g as Os,S as Ms}from"./item-1_haAiVQ.js";import{T as As,L as qs,a as Pn,u as an,W as Fs,P as $s}from"./index-Qd4Npqh6.js";import{e as Un}from"./engine-G4cXU1O1.js";import{u as zs,C as Gs,D as Ws,a as Vs,b as Ys}from"./connect-to-CnP8SOkh.js";import{C as Ks,u as Hs,A as Zs}from"./agreement-PUXVGdXT.js";import{D as Qs}from"./Done-CkFmbhWG.js";import{A as Xs,a as Js,b as er,c as tr}from"./collapse-CfBqxRhe.js";import{C as nr,a as or}from"./Google-B_iUD-qe.js";import{I as _n,f as sr,a as rr,B as ir}from"./install-from-url-giLwGmDP.js";import{a as ln}from"./api-DOfnx6Rg.js";import{v as Dn,e as ar,a as at}from"./util-D3jybip3.js";import{u as Nn}from"./use-mobile-BB8wRni0.js";import{A as lr}from"./ArrowDropDown--DVNnyqn.js";import{u as cr}from"./useLocalStorage-W8XXMbhN.js";import{D as pt,W as We,R as dr,a as cn}from"./url-evaluation-BLZfb0Dg.js";import{L as Ln}from"./Launch-D6fDEUZE.js";import{D as ur}from"./delete-confirm-DLDRKoJo.js";import{B as Bn}from"./status-DhAxXp8T.js";import{A as On}from"./actions-x67maLIz.js";import{v as St}from"./index-BXV5YZlG.js";import{t as pr}from"./toUpper-LALjq_3Z.js";import{S as mr}from"./Switch-DuGwzUc3.js";import{a as fr}from"./team-DYENwSX2.js";import"./MoreVert-CfjoPFTT.js";import"./get-safe-url-B_6dDPbh.js";import"./ButtonGroup-C-ePb6nh.js";import"./getValidReactChildren-BldpnGjG.js";import"./FilterList-D2ht4WCu.js";import"./CSSTransition-CJXB5Ckq.js";import"./emotion-cache.browser.esm-VTZJ-Izu.js";import"./index-DBii9-f-.js";import"./typeof-QjJsDpFa.js";import"./raf-schd.esm-BOsLTGQl.js";import"./redux-DfszZyTl.js";import"./useThemeProps-B4Om35fj.js";import"./index-DaLwUIz-.js";import"./Clear-m97-RV9G.js";import"./ChevronRight-s7Ge6wbK.js";import"./ChevronLeft-FPu3ob1r.js";import"./Search-C1c8IWNt.js";import"./omit-YRKeCzRU.js";import"./index-BbFJaRoB.js";import"./index-BBHfndQF.js";import"./iframe-CdJEjD_P.js";import"./Autocomplete-CkAm7uIi.js";import"./ListSubheader-fOlFzbU6.js";import"./Verified-B5S0Jn97.js";import"./VerifiedUser-BZcaTXsE.js";import"./DeleteOutline-BmVJ0SRH.js";import"./url-join-CXIuL0JQ.js";import"./index-BojVbZw0.js";import"./spaces-CVUV04Qu.js";import"./OpenInNew-Be_LQSsx.js";import"./index-DRYJ0xIl.js";import"./HelpOutline-C303jYUV.js";import"./index-CuettTd7.js";import"./decode-DPztD6kB.js";import"./cloneDeep-BvpAoeCE.js";import"./without-wallet-BU0U8gNN.js";import"./ListItemButton-D3M-CdH1.js";import"./Stepper-BzTuZEkI.js";import"./is-path-prefix-equal-lT3S9weM.js";const hr=Ve(e.jsx("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"})),gr=Ve(e.jsx("path",{d:"M14.17 5 19 9.83V19H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V9.83c0-.53-.21-1.04-.59-1.41l-4.83-4.83c-.37-.38-.88-.59-1.41-.59M7 15h10v2H7zm0-4h10v2H7zm0-4h7v2H7z"})),Mn=Ve(e.jsx("path",{d:"M3 17v2h6v-2zM3 5v2h10V5zm10 16v-2h8v-2h-8v-2h-2v6zM7 9v2H3v2h4v2h2V9zm14 4v-2H11v2zm-6-4h2V7h4V5h-4V3h-2z"})),xr=Ve(e.jsx("path",{d:"M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1-2.73 2.71-2.73 7.08 0 9.79s7.15 2.71 9.88 0C18.32 15.65 19 14.08 19 12.1h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58s9.14-3.47 12.65 0L21 3zM12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8z"})),yr=Ve(e.jsx("path",{d:"M5 20h14v-2H5zm0-10h4v6h6v-6h4l-7-7z"}));function dn(t,o){var n={};return o=vo(o),Ro(t,function(a,s,i){So(n,s,o(a,s,i))}),n}function An({children:t=null,...o}){const{t:n}=A(),{api:a}=H(),{blocklet:s}=fe(),i=s?.settings?.autoCheckUpdate,f=async h=>{await a.updateAutoCheckUpdate({input:{did:s.meta.did,autoCheckUpdate:h}})},c=async()=>{try{const h=!i?.enabled;await f({enabled:h}),N.success(n(h?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(h){N.error(h.message)}},u=!!i?.enabled;return e.jsxs(b,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[t,e.jsx(xe,{title:n("storage.spaces.autoCheckUpdate.title"),arrow:!0,placement:"right",children:e.jsx("div",{children:e.jsx(Cs,{checked:u,onChange:c,name:"enableWelcomePage",style:{...o.style,zoom:.8}})})})]})}An.propTypes={children:r.any};function un(t){function o({sx:n,...a}){return e.jsx(t,{...a,sx:{color:"text.primary",...n}})}return o}const Cr={...dn(vs,un),...dn(hs,un)},br=(t,o)=>{let{description:n}=t;return(Object.values(K.CHAIN_PROP_MAP).includes(t.key)||L.isEnvShareable(t))&&(n?n=`${n} (${o("blocklet.config.sharedToAllComponents")})`:n=o("blocklet.config.sharedToAllComponents")),n&&e.jsx("div",{style:{marginLeft:12},children:n})},kt=(t,o,n=[])=>!n?.length&&!t.custom&&!["CHAIN_ID","CHAIN_HOST"].includes(t.key)&&!o.meta.environments.find(a=>a.name===t.key)&&o.children.every(a=>!a.meta.environments.find(s=>s.name===t.key))?!0:t.custom,pn=t=>[K.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(t)?!0:!(t.startsWith("BLOCKLET_")||t.startsWith("COMPONENT_")),wt=t=>[K.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(t)===!1;function qn({blocklet:t,ancestors:o=[]}){const n=H(),{palette:a}=lt(),{inService:s}=n,{t:i}=d.useContext(Ce),f=[...o.map(m=>m.meta.did),t.meta.did],c=()=>N.success(i("blocklet.config.changedTip")),u=m=>kt(m,t,o);if(Me(t.status)||t.status==="unknown"&&Me(t.status))return null;const h=m=>new Promise(async(g,v)=>{if(!m.key.trim()||!m.value.trim()){N.error(i("blocklet.config.environment.keyValueRequired")),v();return}if(pn(m.key)===!1){N.error(i("blocklet.config.environment.invalidKey")),v();return}m.custom=wt(m.key);try{const k=await n.api.configBlocklet({input:{did:f,configs:[m]}});c(k.blocklet),g()}catch(k){N.error(ae(k)),v()}}),y=(m,g)=>new Promise(async(v,k)=>{if(m.required&&(!m.key.trim()||!m.value.trim())){N.error(i("blocklet.config.environment.keyValueRequired")),k();return}if(pn(m.key)===!1){N.error(i("blocklet.config.environment.invalidKey")),k();return}if(m.key===K.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const O=ko(m);if(O){N.error(O),k();return}}const j=[{...m,value:m.secure&&m.value==="__encrypted__"?"":m.value}];if(m.key!==g.key){if(!kt(m,t,o)){N.error("Only key of custom env can be changed"),k();return}j.push({key:g.key,custom:wt(m.key)})}try{const O=await n.api.configBlocklet({input:{did:f,configs:j}});c(O.blocklet),v()}catch(O){N.error(ae(O)),k()}}),l=m=>new Promise(async(g,v)=>{if(m.required){N.error(i("blocklet.config.environment.deleteForbidden")),v();return}if(!kt(m,t,o)){N.error("Only key of custom env can be changed"),v();return}try{const k=await n.api.configBlocklet({input:{did:f,configs:[{key:m.key,custom:wt(m.key)}]}});c(k.blocklet),g()}catch(k){N.error(ae(k)),v()}}),R=(t.configs||[]).filter(m=>!K.BLOCKLET_CONFIGURABLE_KEY[m.key]||[K.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(m.key)),C=L.getSharedConfigObj(o[0],t),p=L.getComponentMissingConfigs(t,o[0]),E=R.map(m=>({...m,value:Object.values(K.CHAIN_PROP_MAP).includes(m.key)&&Object.keys(C).includes(m.key)?C[m.key]:C[m.key]||m.value})),S=E.some(m=>m.key&&m.key.startsWith("BWA_")),w={onRowAdd:h,onRowUpdate:y,onRowDelete:l,isDeletable:u},x=()=>[{title:i("common.key"),field:"key",initialEditValue:"",width:"30%",render:m=>e.jsx(rn,{value:m.value,style:{color:m.required&&!m.value?a.error.main:a.text.primary,fontWeight:m.required?"bold":"normal"},children:m.key}),editComponent:m=>{const{value:g,rowData:v,onChange:k}=m;return e.jsx(mn,{children:e.jsx(Z,{fullWidth:!0,size:"small",value:Rs.escapeTag(g),onChange:j=>k(j.target.value),variant:"outlined",label:"Key",placeholder:i("blocklet.config.environment.key"),margin:"dense",autoFocus:!0,slotProps:{input:{readOnly:u(v)===!1}}})})}},{title:i("common.value"),field:"value",initialEditValue:"",width:"calc((100% - (96px + 30%)) / 1)",render:m=>m.value?m.secure?"******":e.jsx(rn,{unstyled:!0,value:m.value,style:{wordBreak:"break-all"},children:m.value}):null,editComponent:m=>{const{value:g,rowData:v,onChange:k}=m;return e.jsxs(mn,{children:[e.jsx(Z,{fullWidth:!0,size:"small",value:g==="__encrypted__"?"":g,onChange:j=>k(j.target.value),variant:"outlined",label:i("common.value"),placeholder:i("blocklet.config.environment.value"),margin:"dense"}),br(v,i)]})}}];return e.jsxs(jr,{children:[!!p.length&&e.jsx(Tt,{severity:"error",style:{marginTop:24},children:i("blocklet.config.missingRequired")}),S&&e.jsx(Tt,{severity:"info",children:i("blocklet.config.environment.tip")}),e.jsx(Pt,{permission:s?"":"mutate_blocklets",role:s?Ge:[],children:m=>e.jsx(bs,{className:"config-table",children:e.jsx(js,{title:e.jsx(b,{sx:{fontWeight:"bold"},children:i("common.environments")}),columns:x(),icons:Cr,options:{emptyRowsWhenPaging:!1,actionsColumnIndex:-1,tableLayout:"auto",maxBodyHeight:"100%",paging:!1,search:!1,actionsCellStyle:{padding:"0",textAlign:"right",width:"80px"}},localization:{header:{actions:i("common.actions")},body:{emptyDataSourceMessage:i("common.noData")}},data:E,editable:m?w:{}})})})]})}qn.propTypes={blocklet:r.object.isRequired,ancestors:r.array};const jr=B.div`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-VibrsnfQ.js","./index--ktJL2Tx.js","./index-DGkT7afN.css","./url-join-vuArvvL1.js","./index-Clb2HKeU.js","./_createAggregator-Bw2sNslm.js","./depsEqual-B5cFAumu.js","./index-Dp5rYjgm.js","./index-DRYJ0xIl.js","./toUpper-DEqJjuKZ.js","./index-B5LvOF-F.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{aG as Ve,j as e,dn as vo,gp as Ro,io as So,m as A,bn as H,N as b,az as xe,H as N,o as r,f as lt,r as d,g as Ce,bA as Me,b as K,J as L,X as Tt,bz as Ge,Y as ae,ip as ko,t as Z,s as B,a4 as J,aV as bn,T as te,$ as ct,dD as Xt,y as Ye,b8 as wo,bE as Eo,E as U,b1 as To,gc as Io,gd as Po,C as me,f1 as Uo,hd as _o,x as Do,ax as Jt,w as No,iq as Lo,ir as Bo,v as pe,is as Oo,Z as Mo,a0 as Ao,it as jn,bo as vn,U as Re,f7 as qo,e_ as Fo,aB as $o,aC as zo,bk as Go,aD as Wo,aE as X,aO as Vo,cN as Yo,F as Rn,bm as Ko,_ as Ho,O as ot,aZ as Nt,iu as Zo,a_ as ye,hn as Qo,aA as en,cL as Xo,ad as Ae,aM as Sn,bS as Lt,cw as Jo,L as dt,iv as es,b9 as ts,A as kn,aU as It,h as ns,aS as ze,P as vt,W as os,bB as wn,fI as ss,cr as rs,aJ as is,bt as as,aR as ls,dE as cs,fd as tn,iw as nn,gH as on,V as sn,G as st,cK as ds,gF as us,bR as ps,ix as ms}from"./index--ktJL2Tx.js";import{y as fs}from"./index-CPtXYlM0.js";import{a as hs,c as gs,d as xs,u as Bt,R as ys}from"./actions-DUHD3OYP.js";import{S as Cs}from"./switch-control-DwCkU90q.js";import{u as fe}from"./blocklet-DXJr-xZq.js";import{P as Pt,w as ut}from"./permission-Bd240jHS.js";import{E as En}from"./Edit-CvUxpqSV.js";import{T as bs,M as js,t as vs}from"./table-icons-vuWhvyxJ.js";import{s as Rs,F as Ss,R as it,L as ks,S as ws,B as Es}from"./preference-DHBc5A-p.js";import{C as rn}from"./click-to-copy-CTJTNpA1.js";import{v as Rt}from"./index-CEX6125H.js";import{A as Ts}from"./Add-Clw8RkKN.js";import{A as Ot}from"./Link-BLZtgQVF.js";import{C as Is,c as Ps,b as Us,f as Tn,A as _s,_ as Ds,a as Ns,e as Ls,d as In,s as Bs,g as Os,S as Ms}from"./item-DqvYl0Bz.js";import{T as As,L as qs,a as Pn,u as an,W as Fs,P as $s}from"./index-Ci5mHjJo.js";import{e as Un}from"./engine-BwbWZmR_.js";import{u as zs,C as Gs,D as Ws,a as Vs,b as Ys}from"./connect-to-CmnXJqsQ.js";import{C as Ks,u as Hs,A as Zs}from"./agreement-B1qJWzXq.js";import{D as Qs}from"./Done-De6rOS7P.js";import{A as Xs,a as Js,b as er,c as tr}from"./collapse-CYNTI7Qd.js";import{C as nr,a as or}from"./Google-BiT-YaK5.js";import{I as _n,f as sr,a as rr,B as ir}from"./install-from-url-B4rawAqf.js";import{a as ln}from"./api-BcYW4RGg.js";import{v as Dn,e as ar,a as at}from"./util-SXSVGHBg.js";import{u as Nn}from"./use-mobile-DwZO5be8.js";import{A as lr}from"./ArrowDropDown-B47EydNm.js";import{u as cr}from"./useLocalStorage-Bj7q_OT_.js";import{D as pt,W as We,R as dr,a as cn}from"./url-evaluation-udVYSMO4.js";import{L as Ln}from"./Launch-p44wWut-.js";import{D as ur}from"./delete-confirm-itV6yjjb.js";import{B as Bn}from"./status-g9gqtunL.js";import{A as On}from"./actions-BFpxkOZ3.js";import{v as St}from"./index-DYPal8XU.js";import{t as pr}from"./toUpper-DEqJjuKZ.js";import{S as mr}from"./Switch-Ce-0Lc8M.js";import{a as fr}from"./team-BroofdgP.js";import"./MoreVert-3Ril4BaF.js";import"./get-safe-url-CkVD5JZ8.js";import"./ButtonGroup-CPPdPq8H.js";import"./getValidReactChildren-CutnuaBi.js";import"./FilterList-DrVbs05B.js";import"./CSSTransition-CujxmWeH.js";import"./emotion-cache.browser.esm-BUnXReBA.js";import"./index-DBii9-f-.js";import"./typeof-QjJsDpFa.js";import"./raf-schd.esm-QI9cu6Me.js";import"./redux-DfszZyTl.js";import"./useThemeProps-GIAqgoE8.js";import"./index-BMN0G3TX.js";import"./Clear-ClQc69CC.js";import"./ChevronRight-A_-fTRIz.js";import"./ChevronLeft-BNoaRf3a.js";import"./Search-CveVLYRK.js";import"./omit-BOKRrWcI.js";import"./index-Clb2HKeU.js";import"./index-Dp5rYjgm.js";import"./iframe-d_LXZhpi.js";import"./Autocomplete-gxYza7s5.js";import"./ListSubheader-D4-WSAvX.js";import"./Verified-aOhYddnX.js";import"./VerifiedUser-BWVM02FY.js";import"./DeleteOutline-BhORbRJB.js";import"./url-join-vuArvvL1.js";import"./index-BojVbZw0.js";import"./spaces-CO7vXdm4.js";import"./OpenInNew-Dg_PVVYU.js";import"./index-DRYJ0xIl.js";import"./HelpOutline-D_WMmdX2.js";import"./index-HQ4TKOad.js";import"./decode-DPztD6kB.js";import"./cloneDeep-Q4iUxm_j.js";import"./without-wallet-D7xWotBX.js";import"./ListItemButton-BCmmmtlq.js";import"./Stepper-CazqSP6B.js";import"./is-path-prefix-equal-RJLchj2H.js";const hr=Ve(e.jsx("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"})),gr=Ve(e.jsx("path",{d:"M14.17 5 19 9.83V19H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V9.83c0-.53-.21-1.04-.59-1.41l-4.83-4.83c-.37-.38-.88-.59-1.41-.59M7 15h10v2H7zm0-4h10v2H7zm0-4h7v2H7z"})),Mn=Ve(e.jsx("path",{d:"M3 17v2h6v-2zM3 5v2h10V5zm10 16v-2h8v-2h-8v-2h-2v6zM7 9v2H3v2h4v2h2V9zm14 4v-2H11v2zm-6-4h2V7h4V5h-4V3h-2z"})),xr=Ve(e.jsx("path",{d:"M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1-2.73 2.71-2.73 7.08 0 9.79s7.15 2.71 9.88 0C18.32 15.65 19 14.08 19 12.1h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58s9.14-3.47 12.65 0L21 3zM12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8z"})),yr=Ve(e.jsx("path",{d:"M5 20h14v-2H5zm0-10h4v6h6v-6h4l-7-7z"}));function dn(t,o){var n={};return o=vo(o),Ro(t,function(a,s,i){So(n,s,o(a,s,i))}),n}function An({children:t=null,...o}){const{t:n}=A(),{api:a}=H(),{blocklet:s}=fe(),i=s?.settings?.autoCheckUpdate,f=async h=>{await a.updateAutoCheckUpdate({input:{did:s.meta.did,autoCheckUpdate:h}})},c=async()=>{try{const h=!i?.enabled;await f({enabled:h}),N.success(n(h?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(h){N.error(h.message)}},u=!!i?.enabled;return e.jsxs(b,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[t,e.jsx(xe,{title:n("storage.spaces.autoCheckUpdate.title"),arrow:!0,placement:"right",children:e.jsx("div",{children:e.jsx(Cs,{checked:u,onChange:c,name:"enableWelcomePage",style:{...o.style,zoom:.8}})})})]})}An.propTypes={children:r.any};function un(t){function o({sx:n,...a}){return e.jsx(t,{...a,sx:{color:"text.primary",...n}})}return o}const Cr={...dn(vs,un),...dn(hs,un)},br=(t,o)=>{let{description:n}=t;return(Object.values(K.CHAIN_PROP_MAP).includes(t.key)||L.isEnvShareable(t))&&(n?n=`${n} (${o("blocklet.config.sharedToAllComponents")})`:n=o("blocklet.config.sharedToAllComponents")),n&&e.jsx("div",{style:{marginLeft:12},children:n})},kt=(t,o,n=[])=>!n?.length&&!t.custom&&!["CHAIN_ID","CHAIN_HOST"].includes(t.key)&&!o.meta.environments.find(a=>a.name===t.key)&&o.children.every(a=>!a.meta.environments.find(s=>s.name===t.key))?!0:t.custom,pn=t=>[K.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(t)?!0:!(t.startsWith("BLOCKLET_")||t.startsWith("COMPONENT_")),wt=t=>[K.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(t)===!1;function qn({blocklet:t,ancestors:o=[]}){const n=H(),{palette:a}=lt(),{inService:s}=n,{t:i}=d.useContext(Ce),f=[...o.map(m=>m.meta.did),t.meta.did],c=()=>N.success(i("blocklet.config.changedTip")),u=m=>kt(m,t,o);if(Me(t.status)||t.status==="unknown"&&Me(t.status))return null;const h=m=>new Promise(async(g,v)=>{if(!m.key.trim()||!m.value.trim()){N.error(i("blocklet.config.environment.keyValueRequired")),v();return}if(pn(m.key)===!1){N.error(i("blocklet.config.environment.invalidKey")),v();return}m.custom=wt(m.key);try{const k=await n.api.configBlocklet({input:{did:f,configs:[m]}});c(k.blocklet),g()}catch(k){N.error(ae(k)),v()}}),y=(m,g)=>new Promise(async(v,k)=>{if(m.required&&(!m.key.trim()||!m.value.trim())){N.error(i("blocklet.config.environment.keyValueRequired")),k();return}if(pn(m.key)===!1){N.error(i("blocklet.config.environment.invalidKey")),k();return}if(m.key===K.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const O=ko(m);if(O){N.error(O),k();return}}const j=[{...m,value:m.secure&&m.value==="__encrypted__"?"":m.value}];if(m.key!==g.key){if(!kt(m,t,o)){N.error("Only key of custom env can be changed"),k();return}j.push({key:g.key,custom:wt(m.key)})}try{const O=await n.api.configBlocklet({input:{did:f,configs:j}});c(O.blocklet),v()}catch(O){N.error(ae(O)),k()}}),l=m=>new Promise(async(g,v)=>{if(m.required){N.error(i("blocklet.config.environment.deleteForbidden")),v();return}if(!kt(m,t,o)){N.error("Only key of custom env can be changed"),v();return}try{const k=await n.api.configBlocklet({input:{did:f,configs:[{key:m.key,custom:wt(m.key)}]}});c(k.blocklet),g()}catch(k){N.error(ae(k)),v()}}),R=(t.configs||[]).filter(m=>!K.BLOCKLET_CONFIGURABLE_KEY[m.key]||[K.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(m.key)),C=L.getSharedConfigObj(o[0],t),p=L.getComponentMissingConfigs(t,o[0]),E=R.map(m=>({...m,value:Object.values(K.CHAIN_PROP_MAP).includes(m.key)&&Object.keys(C).includes(m.key)?C[m.key]:C[m.key]||m.value})),S=E.some(m=>m.key&&m.key.startsWith("BWA_")),w={onRowAdd:h,onRowUpdate:y,onRowDelete:l,isDeletable:u},x=()=>[{title:i("common.key"),field:"key",initialEditValue:"",width:"30%",render:m=>e.jsx(rn,{value:m.value,style:{color:m.required&&!m.value?a.error.main:a.text.primary,fontWeight:m.required?"bold":"normal"},children:m.key}),editComponent:m=>{const{value:g,rowData:v,onChange:k}=m;return e.jsx(mn,{children:e.jsx(Z,{fullWidth:!0,size:"small",value:Rs.escapeTag(g),onChange:j=>k(j.target.value),variant:"outlined",label:"Key",placeholder:i("blocklet.config.environment.key"),margin:"dense",autoFocus:!0,slotProps:{input:{readOnly:u(v)===!1}}})})}},{title:i("common.value"),field:"value",initialEditValue:"",width:"calc((100% - (96px + 30%)) / 1)",render:m=>m.value?m.secure?"******":e.jsx(rn,{unstyled:!0,value:m.value,style:{wordBreak:"break-all"},children:m.value}):null,editComponent:m=>{const{value:g,rowData:v,onChange:k}=m;return e.jsxs(mn,{children:[e.jsx(Z,{fullWidth:!0,size:"small",value:g==="__encrypted__"?"":g,onChange:j=>k(j.target.value),variant:"outlined",label:i("common.value"),placeholder:i("blocklet.config.environment.value"),margin:"dense"}),br(v,i)]})}}];return e.jsxs(jr,{children:[!!p.length&&e.jsx(Tt,{severity:"error",style:{marginTop:24},children:i("blocklet.config.missingRequired")}),S&&e.jsx(Tt,{severity:"info",children:i("blocklet.config.environment.tip")}),e.jsx(Pt,{permission:s?"":"mutate_blocklets",role:s?Ge:[],children:m=>e.jsx(bs,{className:"config-table",children:e.jsx(js,{title:e.jsx(b,{sx:{fontWeight:"bold"},children:i("common.environments")}),columns:x(),icons:Cr,options:{emptyRowsWhenPaging:!1,actionsColumnIndex:-1,tableLayout:"auto",maxBodyHeight:"100%",paging:!1,search:!1,actionsCellStyle:{padding:"0",textAlign:"right",width:"80px"}},localization:{header:{actions:i("common.actions")},body:{emptyDataSourceMessage:i("common.noData")}},data:E,editable:m?w:{}})})})]})}qn.propTypes={blocklet:r.object.isRequired,ancestors:r.array};const jr=B.div`
|
|
3
3
|
.config-table {
|
|
4
4
|
margin-bottom: 24px;
|
|
5
5
|
position: relative;
|
|
@@ -66,7 +66,7 @@ import{aG as Ve,j as e,dn as vo,gp as Ro,io as So,m as A,bn as H,N as b,az as xe
|
|
|
66
66
|
.ux-dialog_closeButton {
|
|
67
67
|
margin: 0;
|
|
68
68
|
}
|
|
69
|
-
`,Rr=d.lazy(()=>Eo(()=>import("./index
|
|
69
|
+
`,Rr=d.lazy(()=>Eo(()=>import("./index-VibrsnfQ.js").then(t=>t.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url).then(t=>({default:t.Uploader}))),Sr="/blocklet/component/upload",fn=[".html",".htm",".tgz",".zip"],kr=Number(window.env?.MAX_UPLOAD_FILE_SIZE)||U.MAX_UPLOAD_FILE_SIZE,wr=kr*1024*1024;function Fn({did:t,prefix:o,headers:n=()=>({}),onUploaded:a=Xt,open:s=!1,onClose:i=Xt}){const{t:f,locale:c}=A(),u=d.useRef(null),h=d.useCallback(y=>{const{status:l,data:R}=y;if(l===200){a(R);return}N.error(f("blocklet.component.addComponentTip.uploadFailed"))},[a,f]);return d.useEffect(()=>{s?u.current?.open():u.current?.close()},[s]),e.jsx(Er,{id:`component-uploader-${t}`,children:e.jsx(Rr,{ref:u,locale:c,popup:!0,onUploadFinish:h,plugins:[],onClose:i,installerProps:{disabled:!0},apiPathProps:{uploader:Ye(o,Sr,t),disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:fn,maxFileSize:wr,maxNumberOfFiles:1}},tusProps:{headers:n},dashboardProps:{note:f("blocklet.component.addComponentTip.allowedFileTypes",{types:fn.map(y=>y.replace(".","")).join(", ")})}})},`component-uploader-${t}`)}Fn.propTypes={did:r.string.isRequired,prefix:r.string.isRequired,open:r.bool,headers:r.func,onUploaded:r.func,onClose:r.func};const Er=wo(b)`
|
|
70
70
|
.uploader-wrapper {
|
|
71
71
|
display: inline-flex;
|
|
72
72
|
position: relative;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as n,v as e,N as o,gR as r,o as s}from"./index
|
|
1
|
+
import{j as n,v as e,N as o,gR as r,o as s}from"./index--ktJL2Tx.js";function a({children:i=null,...t}){return n.jsxs(e,{color:"did",variant:"contained",...t,children:[n.jsx(o,{sx:{fontWeight:400},children:i||"Continue With"}),n.jsx(r,{style:{width:"auto",height:"1.2em",margin:"0 4px 0 8px"}})]})}a.propTypes={children:s.any};export{a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,g as n,j as t,s as r}from"./index
|
|
1
|
+
import{r as o,g as n,j as t,s as r}from"./index--ktJL2Tx.js";import{p as a}from"./index-BQhkQ0WB.js";function c(){const{t:s}=o.useContext(n);return t.jsx(e,{style:{paddingTop:"25vh"},children:t.jsx(a,{status:"404",description:s("noMatch.desc"),style:{backgroundColor:"transparent"}})})}const e=r.main``;export{c as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{bX as We,bW as Ge,r as h,bY as Fe,j as e,b8 as ee,b_ as Ke,cb as J,b$ as $e,bU as Ye,cd as qe,aG as he,O as H,bn as N,cq as He,H as B,Y as V,bf as D,fy as Ce,aQ as we,b as M,iC as Ve,m as E,gt as Qe,o as m,x as Xe,ax as Be,y as fe,al as Ze,g as Je,C as A,T as j,k as et,s as tt,f as st,iD as X,hS as Z,iE as ot,N as S,aV as G,E as T,L as nt,h as q,dh as at,az as Se,U as K,aF as $,a9 as Y,a5 as rt,dE as it,gj as ct,a$ as lt,v as pe,w as dt,G as be,Z as De,by as xe,B as pt}from"./index-DpWdOcvI.js";import{T as ut}from"./index-DaLwUIz-.js";import{u as U}from"./blocklet-BALghaj0.js";import{u as mt}from"./use-mobile-BB8wRni0.js";import{c as Ee,d as ft,e as xt,f as gt,g as ue,h as ht,b as St,u as yt,C as bt,D as kt,a as jt}from"./connect-to-CnP8SOkh.js";import"./index-D0VlfeTl.js";import"./index-BojVbZw0.js";import"./api-DOfnx6Rg.js";import{d as Ct,a as wt,g as Bt,i as Dt,e as ge,f as Et,h as It,j as Tt}from"./spaces-CVUV04Qu.js";import{v as Rt}from"./index-BXV5YZlG.js";import{E as zt}from"./index-BqOT1vg4.js";import{H as vt}from"./HelpOutline-C303jYUV.js";import{H as Pt}from"./index-B4DvnAQV.js";import{x as At}from"./index-DRYJ0xIl.js";import{c as Ut}from"./actions-B3_8uzvm.js";import{D as Lt}from"./DeleteOutline-BmVJ0SRH.js";import{g as ke}from"./get-safe-url-B_6dDPbh.js";import{S as Ot}from"./switch-control-C0sPQYWg.js";import{L as je}from"./list-header-xkvwak1A.js";import"./OpenInNew-Be_LQSsx.js";import"./ButtonGroup-C-ePb6nh.js";import"./getValidReactChildren-BldpnGjG.js";import"./FilterList-D2ht4WCu.js";import"./CSSTransition-CJXB5Ckq.js";import"./emotion-cache.browser.esm-VTZJ-Izu.js";import"./index-D4bHWSDT.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-0t8DQthz.js";import"./index-s0Wlu-Gu.js";import"./TableSearch-igEmPOVc.js";import"./Search-C1c8IWNt.js";import"./Clear-m97-RV9G.js";import"./MoreVert-CfjoPFTT.js";import"./useLocalStorage-W8XXMbhN.js";import"./url-evaluation-BLZfb0Dg.js";import"./permission-y2eN7M97.js";import"./Switch-DuGwzUc3.js";function Mt(t){return We("MuiIcon",t)}Ge("MuiIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Nt=t=>{const{color:s,fontSize:n,classes:o}=t,r={root:["root",s!=="inherit"&&`color${J(s)}`,`fontSize${J(n)}`]};return $e(r,Mt,o)},_t=ee("span",{name:"MuiIcon",slot:"Root",overridesResolver:(t,s)=>{const{ownerState:n}=t;return[s.root,n.color!=="inherit"&&s[`color${J(n.color)}`],s[`fontSize${J(n.fontSize)}`]]}})(Ye(({theme:t})=>({userSelect:"none",width:"1em",height:"1em",overflow:"hidden",display:"inline-block",textAlign:"center",flexShrink:0,variants:[{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:t.typography.pxToRem(20)}},{props:{fontSize:"medium"},style:{fontSize:t.typography.pxToRem(24)}},{props:{fontSize:"large"},style:{fontSize:t.typography.pxToRem(36)}},{props:{color:"action"},style:{color:(t.vars||t).palette.action.active}},{props:{color:"disabled"},style:{color:(t.vars||t).palette.action.disabled}},{props:{color:"inherit"},style:{color:void 0}},...Object.entries(t.palette).filter(qe()).map(([s])=>({props:{color:s},style:{color:(t.vars||t).palette[s].main}}))]}))),ye=h.forwardRef(function(s,n){const o=Fe({props:s,name:"MuiIcon"}),{baseClassName:r="material-icons",className:a,color:i="inherit",component:c="span",fontSize:d="medium",...l}=o,p={...o,baseClassName:r,color:i,component:c,fontSize:d},f=Nt(p);return e.jsx(_t,{as:c,className:Ke(r,"notranslate",f.root,a),ownerState:p,"aria-hidden":!0,ref:n,...l})});ye.muiName="Icon";const Wt=he(e.jsx("path",{d:"M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z"})),Gt=he(e.jsx("path",{d:"M14.69 2.21 4.33 11.49c-.64.58-.28 1.65.58 1.73L13 14l-4.85 6.76c-.22.31-.19.74.08 1.01.3.3.77.31 1.08.02l10.36-9.28c.64-.58.28-1.65-.58-1.73L11 10l4.85-6.76c.22-.31.19-.74-.08-1.01-.3-.3-.77-.31-1.08-.02"})),Ft=he(e.jsx("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"}));async function Kt({blockletDid:t,nodeApi:s,spaceGateways:n}){let o=!1;const r=await Promise.all(n.map(async a=>{let{name:i}=a;const c=await Ct(a.endpoint);return!H(c)&&c!==i&&(i=c,o=!0),{...a,name:i}}));return o&&await Promise.all(r.filter(a=>a.did).map(a=>s.updateBlockletSpaceGateway({input:{did:t,where:{did:a.did},spaceGateway:{...a}}}))),r}function $t({refresh:t}={}){const{blocklet:s}=U(),n=s?.meta?.did,{api:o}=N();return He(async()=>{if(!n)return[];const{spaceGateways:r}=await o.getBlockletSpaceGateways({input:{did:n}});return await Kt({blockletDid:n,nodeApi:o,spaceGateways:r})??[]},{refreshDeps:[n,t],onError(r){r?.message?.includes("not logged")?console.warn(r):(console.error(r),B.error(V(r)))}})}function Ie({deps:t,setLoading:s,backupDate:n}={deps:[],setLoading:()=>{},backupDate:new Date}){const{blocklet:o}=U(),[r,a]=h.useState([]),{api:i}=N(),[c,d]=h.useMemo(()=>n?[D(n).startOf("day").toISOString(),D(n).endOf("day").toISOString()]:[D().startOf("year").toISOString(),D().endOf("day").toISOString()],[n]),l=Ce(async()=>{try{if(s(!0),!o){a([]);return}const{backups:p}=await i.getBlockletBackups({input:{did:o.meta.did,startTime:c,endTime:d}});a(p??[])}catch(p){console.error(p),B.error(V(p))}finally{s(!1)}},1e3);return we(async()=>{l()},[o?.meta?.did].concat(t)),{backups:r}}function Yt({appDid:t}){const{backups:s}=Ie(),[n,o]=h.useState({message:"",progress:0,completed:!1}),r=N(),{ws:{useSubscription:a}}=r;return a(M.BlockletEvents.backupProgress,i=>{t===i?.appDid&&o(()=>({...i}))},[t]),h.useEffect(()=>{if(s?.length&&Ve(s[0]?.status)){const[i]=s;o(()=>({message:i.message,progress:i.progress,completed:i.progress>=100}))}},[s]),n}function qt({deps:t=[],setLoading:s=()=>{}}={}){const{blocklet:n}=U(),[o,r]=h.useState([]),{api:a}=N(),i=h.useCallback(Ce(async()=>{if(!a||!n?.meta?.did){r([]);return}try{s(!0);const c=D(),d=c.subtract(1,"year"),{summary:l}=await a.getBlockletBackupSummary({input:{did:n.meta.did,startTime:d.toISOString(),endTime:c.toISOString()}});r(Array.isArray(l)?l:[])}catch(c){console.error("Failed to fetch backup summary:",c),B.error(V(c)),r([])}finally{s(!1)}},1e3),[]);return we(async()=>(await i(),()=>{i.cancel()}),[n?.meta?.did].concat(t)),{backupSummary:o}}const Te=h.createContext({}),{Provider:Ht,Consumer:$s}=Te;function Re({children:t}){const{t:s}=E(),{api:n}=N(),{blocklet:o}=U(),[r,a]=h.useState(null),[i,c]=h.useState(!1),{data:d,loading:l,mutate:p}=$t({refresh:i}),f=Qe(d),x=Yt({appDid:o?.appDid}),u=h.useMemo(()=>wt(o?.environments),[o?.environments]),[k,w]=h.useState(!1),[y,b]=h.useState(!1),{backups:te}=Ie({deps:[y,r],setLoading:w,backupDate:r}),[se,oe]=h.useState(!1),{backupSummary:ne}=qt({deps:[se]}),[_,O]=h.useState(d?.find(g=>g.endpoint===u)),I=o?.settings?.autoBackup,z=()=>{c(g=>!g)},ae=()=>{oe(g=>!g)},re=()=>{b(g=>!g)},F=async g=>{await n.updateAutoBackup({input:{did:o.meta.did,autoBackup:g}})},Q=async()=>{await n.abortBlockletBackup({input:{appPid:o.meta.did}})},ie=async(g,P)=>{try{p(R=>{const v=[...R];return v.push({...g,loading:!0}),v}),await n.addBlockletSpaceGateway({input:{did:o.meta.did,spaceGateway:g}}),u!==P&&await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:M.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:P}]}}),O(g),z(),B.success(s("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"}))}catch(R){throw console.error(R),p(v=>[...v].filter(W=>W.did!==g.did)),R}},ce=async g=>{g&&(g.endpoint===u&&(await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:M.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),I?.enabled&&await F({enabled:!1})),await n.deleteBlockletSpaceGateway({input:{did:o.meta.did,spaceGatewayDid:g?.did}}),p(P=>{const R=[...P];return R.splice(R.indexOf(g),1),R}),O(g),z())},le=async g=>{await Promise.all([n.updateBlockletSpaceGateway({input:{did:o.meta.did,where:{did:g.did},spaceGateway:g}}),u!==g.endpoint&&n.configBlocklet({input:{did:[o.meta.did],configs:[{key:M.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:g.endpoint}]}})]),B.success(s("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"})),z()},C=g=>g?.endpoint===u;return e.jsx(Ht,{value:{spaceGateways:d||[],selectedSpaceGateway:_,addSpaceGateway:ie,deleteSpaceGateway:ce,updateSpaceGateway:le,refreshSpaceGateways:z,spaceGatewaysLoading:l,spaceGatewaysFirstLoading:f,spaceGatewayIsSelected:C,updateAutoBackup:F,abortBlockletBackup:Q,backupEndpoint:u,backupProgress:x,backups:te,backupSummary:ne,refreshBackupSummary:ae,refreshBackups:re,setBackupDate:a,backupsLoading:k,autoBackup:I},children:t})}Re.propTypes={children:m.any.isRequired};function L(){return h.useContext(Te)}function ze({...t}){const{blocklet:s}=U(),{info:n}=N(),{t:o}=E(),r=Ee({blocklet:s}),a=Xe(n),{spaceGateways:i,addSpaceGateway:c}=L(),d={checkFn:Be.create({baseURL:fe(window.location.origin,Ze())}).get,webWalletUrl:a,extraParams:{appPid:s.appPid,appDid:r.appDid,appName:r.appName,appDescription:r.appDescription,appUrl:r.appUrl,referrer:r.referrer,scopes:r.scopes,nodeDid:n.did}},l=async({endpoint:f,name:x,did:u})=>{const k=await Bt(f);if(!await Dt(k)){B.error(o("storage.spaces.gateway.add.invalidUrl"));return}if(i.some(b=>b.endpoint===f)){B.error(o("storage.spaces.gateway.add.duplicate",{name:x}));return}await c({name:x,did:u,url:k,endpoint:f},f)},p=async({spaceGateway:f})=>{try{await l(f)}catch(x){console.error(x),B.error(V(x))}};return e.jsx(ft,{...t,connectScope:"app",options:d,onSuccess:p})}function ve({...t}){const{t:s}=h.useContext(Je),{blocklet:n,loadingDiskInfo:o,actions:r}=U();if(h.useEffect(()=>{r?.refreshBlocklet({showError:!1,attachDiskInfo:!0})},[]),n.diskInfo){const a=(d,l,p)=>e.jsxs(j,{children:[d," ",e.jsx("strong",{children:l?et(l):"empty"})]}),i=n.environments.reduce((d,l)=>(d[l.key]=l.value,d),{}),c=[{key:"appDir",name:s("blocklet.diskInfo.appDir"),value:a(i.BLOCKLET_APP_DIR,n.diskInfo.app)},{key:"dataDir",name:s("blocklet.diskInfo.dataDir"),value:a(i.BLOCKLET_DATA_DIR,n.diskInfo.data)},{key:"logDir",name:s("blocklet.diskInfo.logDir"),value:a(i.BLOCKLET_LOG_DIR,n.diskInfo.log)},{key:"cacheDir",name:s("blocklet.diskInfo.cacheDir"),value:a(i.BLOCKLET_CACHE_DIR,n.diskInfo.cache)}];return e.jsx(Vt,{component:"div",...t,children:c.map(d=>e.jsx(Rt,{valueComponent:"div",nameWidth:120,name:d.name,children:d.value},d.key))})}return o?e.jsx(A,{}):e.jsx(j,{children:s("blocklet.diskInfo.empty")})}const Vt=tt(j)``;function Pe(){const{t}=E(),{setBackupDate:s,backupSummary:n}=L(),o=xt({key:"lg"}),r=h.useRef(null),a=st(),i=h.useCallback(l=>{s(l)},[s]),c=h.useMemo(()=>{const l=D().add(1,"day"),p=D().subtract(11,"month").startOf("month"),f=new Map(n.map(u=>[u.date,{date:u.date,successCount:u.successCount,errorCount:u.errorCount}])),x=[];for(let u=p.clone();D(u).isBefore(l);u=u.add(1,"day")){const k=u.format("YYYY-MM-DD");x.push(f.get(k)||{date:k,successCount:0,errorCount:0})}return x},[n]),d=h.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:12},tooltip:{formatter:k=>{const{date:w,successCount:y,errorCount:b}=c[k.dataIndex]||{date:k.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${w}</div>`,`<div>${t("common.succeeded")}: ${y}</div>`,`<div>${t("common.failed")}: ${b}</div>`].join(`
|
|
1
|
+
import{bX as We,bW as Ge,r as h,bY as Fe,j as e,b8 as ee,b_ as Ke,cb as J,b$ as $e,bU as Ye,cd as qe,aG as he,O as H,bn as N,cq as He,H as B,Y as V,bf as D,fy as Ce,aQ as we,b as M,iC as Ve,m as E,gt as Qe,o as m,x as Xe,ax as Be,y as fe,al as Ze,g as Je,C as A,T as j,k as et,s as tt,f as st,iD as X,hS as Z,iE as ot,N as S,aV as G,E as T,L as nt,h as q,dh as at,az as Se,U as K,aF as $,a9 as Y,a5 as rt,dE as it,gj as ct,a$ as lt,v as pe,w as dt,G as be,Z as De,by as xe,B as pt}from"./index--ktJL2Tx.js";import{T as ut}from"./index-BMN0G3TX.js";import{u as U}from"./blocklet-DXJr-xZq.js";import{u as mt}from"./use-mobile-DwZO5be8.js";import{c as Ee,d as ft,e as xt,f as gt,g as ue,h as ht,b as St,u as yt,C as bt,D as kt,a as jt}from"./connect-to-CmnXJqsQ.js";import"./index-CEX6125H.js";import"./index-BojVbZw0.js";import"./api-BcYW4RGg.js";import{d as Ct,a as wt,g as Bt,i as Dt,e as ge,f as Et,h as It,j as Tt}from"./spaces-CO7vXdm4.js";import{v as Rt}from"./index-DYPal8XU.js";import{E as zt}from"./index-Dv5txe8G.js";import{H as vt}from"./HelpOutline-D_WMmdX2.js";import{H as Pt}from"./index-DTRD5V4Z.js";import{x as At}from"./index-DRYJ0xIl.js";import{c as Ut}from"./actions-DUHD3OYP.js";import{D as Lt}from"./DeleteOutline-BhORbRJB.js";import{g as ke}from"./get-safe-url-CkVD5JZ8.js";import{S as Ot}from"./switch-control-DwCkU90q.js";import{L as je}from"./list-header-s7KnhaJP.js";import"./OpenInNew-Dg_PVVYU.js";import"./ButtonGroup-CPPdPq8H.js";import"./getValidReactChildren-CutnuaBi.js";import"./FilterList-DrVbs05B.js";import"./CSSTransition-CujxmWeH.js";import"./emotion-cache.browser.esm-BUnXReBA.js";import"./index-FTSHH2z1.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-B5cFAumu.js";import"./index-CPtXYlM0.js";import"./TableSearch-BezFlhKc.js";import"./Search-CveVLYRK.js";import"./Clear-ClQc69CC.js";import"./MoreVert-3Ril4BaF.js";import"./useLocalStorage-Bj7q_OT_.js";import"./url-evaluation-udVYSMO4.js";import"./permission-Bd240jHS.js";import"./Switch-Ce-0Lc8M.js";function Mt(t){return We("MuiIcon",t)}Ge("MuiIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Nt=t=>{const{color:s,fontSize:n,classes:o}=t,r={root:["root",s!=="inherit"&&`color${J(s)}`,`fontSize${J(n)}`]};return $e(r,Mt,o)},_t=ee("span",{name:"MuiIcon",slot:"Root",overridesResolver:(t,s)=>{const{ownerState:n}=t;return[s.root,n.color!=="inherit"&&s[`color${J(n.color)}`],s[`fontSize${J(n.fontSize)}`]]}})(Ye(({theme:t})=>({userSelect:"none",width:"1em",height:"1em",overflow:"hidden",display:"inline-block",textAlign:"center",flexShrink:0,variants:[{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:t.typography.pxToRem(20)}},{props:{fontSize:"medium"},style:{fontSize:t.typography.pxToRem(24)}},{props:{fontSize:"large"},style:{fontSize:t.typography.pxToRem(36)}},{props:{color:"action"},style:{color:(t.vars||t).palette.action.active}},{props:{color:"disabled"},style:{color:(t.vars||t).palette.action.disabled}},{props:{color:"inherit"},style:{color:void 0}},...Object.entries(t.palette).filter(qe()).map(([s])=>({props:{color:s},style:{color:(t.vars||t).palette[s].main}}))]}))),ye=h.forwardRef(function(s,n){const o=Fe({props:s,name:"MuiIcon"}),{baseClassName:r="material-icons",className:a,color:i="inherit",component:c="span",fontSize:d="medium",...l}=o,p={...o,baseClassName:r,color:i,component:c,fontSize:d},f=Nt(p);return e.jsx(_t,{as:c,className:Ke(r,"notranslate",f.root,a),ownerState:p,"aria-hidden":!0,ref:n,...l})});ye.muiName="Icon";const Wt=he(e.jsx("path",{d:"M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z"})),Gt=he(e.jsx("path",{d:"M14.69 2.21 4.33 11.49c-.64.58-.28 1.65.58 1.73L13 14l-4.85 6.76c-.22.31-.19.74.08 1.01.3.3.77.31 1.08.02l10.36-9.28c.64-.58.28-1.65-.58-1.73L11 10l4.85-6.76c.22-.31.19-.74-.08-1.01-.3-.3-.77-.31-1.08-.02"})),Ft=he(e.jsx("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"}));async function Kt({blockletDid:t,nodeApi:s,spaceGateways:n}){let o=!1;const r=await Promise.all(n.map(async a=>{let{name:i}=a;const c=await Ct(a.endpoint);return!H(c)&&c!==i&&(i=c,o=!0),{...a,name:i}}));return o&&await Promise.all(r.filter(a=>a.did).map(a=>s.updateBlockletSpaceGateway({input:{did:t,where:{did:a.did},spaceGateway:{...a}}}))),r}function $t({refresh:t}={}){const{blocklet:s}=U(),n=s?.meta?.did,{api:o}=N();return He(async()=>{if(!n)return[];const{spaceGateways:r}=await o.getBlockletSpaceGateways({input:{did:n}});return await Kt({blockletDid:n,nodeApi:o,spaceGateways:r})??[]},{refreshDeps:[n,t],onError(r){r?.message?.includes("not logged")?console.warn(r):(console.error(r),B.error(V(r)))}})}function Ie({deps:t,setLoading:s,backupDate:n}={deps:[],setLoading:()=>{},backupDate:new Date}){const{blocklet:o}=U(),[r,a]=h.useState([]),{api:i}=N(),[c,d]=h.useMemo(()=>n?[D(n).startOf("day").toISOString(),D(n).endOf("day").toISOString()]:[D().startOf("year").toISOString(),D().endOf("day").toISOString()],[n]),l=Ce(async()=>{try{if(s(!0),!o){a([]);return}const{backups:p}=await i.getBlockletBackups({input:{did:o.meta.did,startTime:c,endTime:d}});a(p??[])}catch(p){console.error(p),B.error(V(p))}finally{s(!1)}},1e3);return we(async()=>{l()},[o?.meta?.did].concat(t)),{backups:r}}function Yt({appDid:t}){const{backups:s}=Ie(),[n,o]=h.useState({message:"",progress:0,completed:!1}),r=N(),{ws:{useSubscription:a}}=r;return a(M.BlockletEvents.backupProgress,i=>{t===i?.appDid&&o(()=>({...i}))},[t]),h.useEffect(()=>{if(s?.length&&Ve(s[0]?.status)){const[i]=s;o(()=>({message:i.message,progress:i.progress,completed:i.progress>=100}))}},[s]),n}function qt({deps:t=[],setLoading:s=()=>{}}={}){const{blocklet:n}=U(),[o,r]=h.useState([]),{api:a}=N(),i=h.useCallback(Ce(async()=>{if(!a||!n?.meta?.did){r([]);return}try{s(!0);const c=D(),d=c.subtract(1,"year"),{summary:l}=await a.getBlockletBackupSummary({input:{did:n.meta.did,startTime:d.toISOString(),endTime:c.toISOString()}});r(Array.isArray(l)?l:[])}catch(c){console.error("Failed to fetch backup summary:",c),B.error(V(c)),r([])}finally{s(!1)}},1e3),[]);return we(async()=>(await i(),()=>{i.cancel()}),[n?.meta?.did].concat(t)),{backupSummary:o}}const Te=h.createContext({}),{Provider:Ht,Consumer:$s}=Te;function Re({children:t}){const{t:s}=E(),{api:n}=N(),{blocklet:o}=U(),[r,a]=h.useState(null),[i,c]=h.useState(!1),{data:d,loading:l,mutate:p}=$t({refresh:i}),f=Qe(d),x=Yt({appDid:o?.appDid}),u=h.useMemo(()=>wt(o?.environments),[o?.environments]),[k,w]=h.useState(!1),[y,b]=h.useState(!1),{backups:te}=Ie({deps:[y,r],setLoading:w,backupDate:r}),[se,oe]=h.useState(!1),{backupSummary:ne}=qt({deps:[se]}),[_,O]=h.useState(d?.find(g=>g.endpoint===u)),I=o?.settings?.autoBackup,z=()=>{c(g=>!g)},ae=()=>{oe(g=>!g)},re=()=>{b(g=>!g)},F=async g=>{await n.updateAutoBackup({input:{did:o.meta.did,autoBackup:g}})},Q=async()=>{await n.abortBlockletBackup({input:{appPid:o.meta.did}})},ie=async(g,P)=>{try{p(R=>{const v=[...R];return v.push({...g,loading:!0}),v}),await n.addBlockletSpaceGateway({input:{did:o.meta.did,spaceGateway:g}}),u!==P&&await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:M.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:P}]}}),O(g),z(),B.success(s("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"}))}catch(R){throw console.error(R),p(v=>[...v].filter(W=>W.did!==g.did)),R}},ce=async g=>{g&&(g.endpoint===u&&(await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:M.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),I?.enabled&&await F({enabled:!1})),await n.deleteBlockletSpaceGateway({input:{did:o.meta.did,spaceGatewayDid:g?.did}}),p(P=>{const R=[...P];return R.splice(R.indexOf(g),1),R}),O(g),z())},le=async g=>{await Promise.all([n.updateBlockletSpaceGateway({input:{did:o.meta.did,where:{did:g.did},spaceGateway:g}}),u!==g.endpoint&&n.configBlocklet({input:{did:[o.meta.did],configs:[{key:M.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:g.endpoint}]}})]),B.success(s("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"})),z()},C=g=>g?.endpoint===u;return e.jsx(Ht,{value:{spaceGateways:d||[],selectedSpaceGateway:_,addSpaceGateway:ie,deleteSpaceGateway:ce,updateSpaceGateway:le,refreshSpaceGateways:z,spaceGatewaysLoading:l,spaceGatewaysFirstLoading:f,spaceGatewayIsSelected:C,updateAutoBackup:F,abortBlockletBackup:Q,backupEndpoint:u,backupProgress:x,backups:te,backupSummary:ne,refreshBackupSummary:ae,refreshBackups:re,setBackupDate:a,backupsLoading:k,autoBackup:I},children:t})}Re.propTypes={children:m.any.isRequired};function L(){return h.useContext(Te)}function ze({...t}){const{blocklet:s}=U(),{info:n}=N(),{t:o}=E(),r=Ee({blocklet:s}),a=Xe(n),{spaceGateways:i,addSpaceGateway:c}=L(),d={checkFn:Be.create({baseURL:fe(window.location.origin,Ze())}).get,webWalletUrl:a,extraParams:{appPid:s.appPid,appDid:r.appDid,appName:r.appName,appDescription:r.appDescription,appUrl:r.appUrl,referrer:r.referrer,scopes:r.scopes,nodeDid:n.did}},l=async({endpoint:f,name:x,did:u})=>{const k=await Bt(f);if(!await Dt(k)){B.error(o("storage.spaces.gateway.add.invalidUrl"));return}if(i.some(b=>b.endpoint===f)){B.error(o("storage.spaces.gateway.add.duplicate",{name:x}));return}await c({name:x,did:u,url:k,endpoint:f},f)},p=async({spaceGateway:f})=>{try{await l(f)}catch(x){console.error(x),B.error(V(x))}};return e.jsx(ft,{...t,connectScope:"app",options:d,onSuccess:p})}function ve({...t}){const{t:s}=h.useContext(Je),{blocklet:n,loadingDiskInfo:o,actions:r}=U();if(h.useEffect(()=>{r?.refreshBlocklet({showError:!1,attachDiskInfo:!0})},[]),n.diskInfo){const a=(d,l,p)=>e.jsxs(j,{children:[d," ",e.jsx("strong",{children:l?et(l):"empty"})]}),i=n.environments.reduce((d,l)=>(d[l.key]=l.value,d),{}),c=[{key:"appDir",name:s("blocklet.diskInfo.appDir"),value:a(i.BLOCKLET_APP_DIR,n.diskInfo.app)},{key:"dataDir",name:s("blocklet.diskInfo.dataDir"),value:a(i.BLOCKLET_DATA_DIR,n.diskInfo.data)},{key:"logDir",name:s("blocklet.diskInfo.logDir"),value:a(i.BLOCKLET_LOG_DIR,n.diskInfo.log)},{key:"cacheDir",name:s("blocklet.diskInfo.cacheDir"),value:a(i.BLOCKLET_CACHE_DIR,n.diskInfo.cache)}];return e.jsx(Vt,{component:"div",...t,children:c.map(d=>e.jsx(Rt,{valueComponent:"div",nameWidth:120,name:d.name,children:d.value},d.key))})}return o?e.jsx(A,{}):e.jsx(j,{children:s("blocklet.diskInfo.empty")})}const Vt=tt(j)``;function Pe(){const{t}=E(),{setBackupDate:s,backupSummary:n}=L(),o=xt({key:"lg"}),r=h.useRef(null),a=st(),i=h.useCallback(l=>{s(l)},[s]),c=h.useMemo(()=>{const l=D().add(1,"day"),p=D().subtract(11,"month").startOf("month"),f=new Map(n.map(u=>[u.date,{date:u.date,successCount:u.successCount,errorCount:u.errorCount}])),x=[];for(let u=p.clone();D(u).isBefore(l);u=u.add(1,"day")){const k=u.format("YYYY-MM-DD");x.push(f.get(k)||{date:k,successCount:0,errorCount:0})}return x},[n]),d=h.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:12},tooltip:{formatter:k=>{const{date:w,successCount:y,errorCount:b}=c[k.dataIndex]||{date:k.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${w}</div>`,`<div>${t("common.succeeded")}: ${y}</div>`,`<div>${t("common.failed")}: ${b}</div>`].join(`
|
|
2
2
|
`)},backgroundColor:a.palette.background.paper,borderColor:a.palette.divider,textStyle:{color:a.palette.text.primary,fontSize:14},extraCssText:`box-shadow: ${a.shadows[2]}; border-radius: 4px;`,padding:[8,10]},visualMap:{show:!1,min:-12,max:12,pieces:[{min:Number.MIN_SAFE_INTEGER,max:-9,color:X[600]},{min:-9,max:-6,color:X[500]},{min:-6,max:-3,color:X[400]},{min:-3,max:-1,color:X[300]},{min:0,max:0,color:a.palette.grey[200]},{min:1,max:3,color:Z[300]},{min:3,max:6,color:Z[400]},{min:6,max:9,color:Z[500]},{min:9,max:Number.MAX_SAFE_INTEGER,color:Z[600]}],orient:"horizontal",left:"center",bottom:12,itemWidth:12,itemHeight:12,textStyle:{color:a.palette.text.secondary,fontSize:12}},calendar:{top:30,left:50,right:10,bottom:4,cellSize:[8,8],splitLine:{show:!1},itemStyle:{borderWidth:2,borderColor:a.palette.background.default,color:a.palette.background.default},dayLabel:{show:!0,firstDay:0,nameMap:["","Mon","","Wed","","Fri",""],position:"start",margin:4,fontSize:10,color:a.palette.text.primary,fontWeight:"400",width:20},monthLabel:{show:!0,nameMap:"cn",align:"left",color:a.palette.text.primary,fontWeight:"400",fontSize:12,position:"start",margin:4,width:30,padding:[0,2]},yearLabel:{show:!1},range:[D().subtract(11,"month").startOf("month").format("YYYY-MM-DD"),D().endOf("month").format("YYYY-MM-DD")],orient:"horizontal"},series:{type:"heatmap",coordinateSystem:"calendar",data:c.map(k=>[k.date,k.errorCount?-k.errorCount:k.successCount]),label:{show:!1},itemStyle:{borderWidth:2,borderColor:a.palette.background.default,borderRadius:4},emphasis:{itemStyle:{borderWidth:2,borderColor:ot[200],color:"inherit"}}}}),[c,t,a]);return e.jsxs(e.Fragment,{children:[e.jsx(S,{ref:r,sx:{maxWidth:"1280px",border:"1px solid",borderColor:"divider",padding:"8px",overflowX:"auto"},children:e.jsx(S,{sx:{width:"1200px",height:"180px",position:"relative"},children:e.jsx(zt,{option:d,style:{height:"100%",width:"100%"},notMerge:!0,lazyUpdate:!1,opts:{renderer:"canvas"},onEvents:{click:l=>{l.componentType==="series"&&l.data&&i(l.data[0])}}})})}),e.jsx(S,{sx:{display:"flex",justifyContent:"flex-end",mt:1,mr:o?2:5,mb:2},children:e.jsxs(G,{direction:o?"column":"row",spacing:o?2:1,sx:{width:"100%",justifyContent:"flex-start",alignItems:o?"flex-start":"center"},children:[e.jsxs(G,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(S,{sx:{width:32,height:12,borderRadius:.5,background:"linear-gradient(90deg, #8B5000 0%, #A36200 33%, #C17700 66%, #E29000 100%)"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.failed")})]}),e.jsxs(G,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(S,{sx:{width:32,height:12,borderRadius:.5,bgcolor:"grey.200",border:"1px solid",borderColor:"grey.200"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.without")})]}),e.jsxs(G,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(S,{sx:{width:32,height:12,borderRadius:.5,background:"linear-gradient(90deg, #9be9a8 0%, #40c463 33%, #30a14e 66%, #216e39 100%)"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.succeeded")})]})]})})]})}const Qt=ee(({className:t,...s})=>e.jsx(Se,{...s,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function Ae({status:t,message:s="",createdAt:n}){const{t:o}=E(),r=t===T.BACKUPS.STATUS.PROGRESS&&D().diff(n,"hours")>=T.BACKUPS.TIMEOUT_HOURS,a=r&&o("common.timeoutError"),i=t===T.BACKUPS.STATUS.PROGRESS&&!r,c=t===T.BACKUPS.STATUS.SUCCEEDED&&!r;return i?e.jsxs(j,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},children:[e.jsx(A,{sx:{marginRight:"4px"},size:"12px"}),o("common.progress")]}):c?e.jsx(q,{type:"success",children:o("common.succeeded")}):e.jsxs(S,{sx:{display:"inline-flex",alignItems:"center"},children:[e.jsx(q,{type:"error",children:o("common.failed")}),e.jsx(Se,{style:{display:"flex",alignItems:"center",flexShrink:0},title:s||a,children:e.jsx(ye,{children:e.jsx(vt,{style:{width:"24px",height:"24px"},color:"error"})})})]})}Ae.propTypes={status:m.string.isRequired,message:m.string,createdAt:m.string.isRequired};function Ue({metadata:t={}}){const{t:s}=E();if(H(t))return e.jsx(q,{type:"success",children:s("common.succeeded")});const n=t.count||0,o=t.size||0,r=At(o,{iec:!0}),a=e.jsxs(S,{sx:{p:1,borderRadius:1,boxShadow:2,color:"black",backgroundColor:"white"},children:[e.jsxs(j,{variant:"body2",children:[s("common.fileCount"),": ",n]}),e.jsxs(j,{variant:"body2",children:[s("common.fileSize"),": ",r]})]});return e.jsxs(S,{sx:{display:"inline-flex",alignItems:"center"},children:[e.jsx(q,{type:"success",children:s("common.succeeded")}),e.jsx(Qt,{title:a,style:{display:"flex",alignItems:"center",flexShrink:0},placement:"left",children:e.jsx(ye,{children:e.jsx(at,{style:{width:"24px",height:"24px"},color:"primary"})})})]})}Ue.propTypes={metadata:m.object};function Le(){const{t,locale:s}=E(),{spaceGateways:n,backups:o,backupsLoading:r}=L(),a=h.useMemo(()=>[{label:"DID Space",name:"target",options:{customBodyRenderLite:c=>{const{targetUrl:d,targetName:l,status:p,createdAt:f}=o[c],x=p===T.BACKUPS.STATUS.PROGRESS&&D().diff(f,"hours")>=T.BACKUPS.TIMEOUT_HOURS,u=p===T.BACKUPS.STATUS.SUCCEEDED&&!x,k=l||n.find(w=>d?.includes(ge(w?.endpoint)))?.name||"Unknown DID Space";return u?e.jsx(nt,{href:d,target:"_blank",sx:{fontSize:"16px"},children:k}):e.jsx(j,{variant:"body1",sx:{fontSize:"16px"},children:k})}}},{label:t("common.strategy"),name:"strategy",options:{customBodyRender:c=>{const d=t(c===0?"common.auto":"common.manual");return e.jsx(q,{children:d})}}},{label:t("common.startTime"),name:"createdAt",options:{customBodyRender:c=>D(c).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.endTime"),name:"updatedAt",options:{customBodyRender:c=>H(c)?"":D(c).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.status"),name:"status",options:{customBodyRenderLite:c=>{const d=o?.[c]??{},{status:l,message:p,createdAt:f,metadata:x}=d,u=l===T.BACKUPS.STATUS.PROGRESS&&D().diff(f,"hours")>=T.BACKUPS.TIMEOUT_HOURS,k=l===T.BACKUPS.STATUS.PROGRESS&&!u,w=l===T.BACKUPS.STATUS.SUCCEEDED&&!u;return k?e.jsxs(j,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},children:[e.jsx(A,{sx:{marginRight:"4px"},size:"12px"}),t("common.progress")]}):w?e.jsx(Ue,{metadata:x}):e.jsx(Ae,{status:l,message:p,createdAt:f})}}}],[o,n,t]),i=h.useMemo(()=>!o?.length,[o]);return e.jsx(e.Fragment,{children:i?e.jsx(S,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px",color:"#9397A1",marginTop:"16px",marginBottom:"24px"},children:t("storage.spaces.record.emptyData")}):e.jsx(Pt,{title:"",loading:r,data:o,columns:a,emptyNode:t("storage.spaces.record.emptyData",s),options:{download:!1,filter:!1,print:!1,search:!1,viewColumns:!1}})})}function Xt(){const{t}=E();return e.jsxs(S,{children:[e.jsxs(S,{sx:{display:"flex",gap:3,flexDirection:{xs:"column",md:"row"}},children:[e.jsxs(S,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",minWidth:240},children:[e.jsx(gt,{style:{cursor:"pointer",width:"150px",height:"100%",maxHeight:160}}),e.jsx(j,{sx:{my:2,textAlign:"center",color:"text.secondary"},children:t("storage.spaces.connect.provider")}),e.jsx(ze,{})]}),e.jsxs(S,{sx:{flexGrow:1,minWidth:0},children:[e.jsx(S,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:t("storage.spaces.backup.records")})}),e.jsx(Pe,{})]})]}),e.jsx(Le,{sx:{marginTop:"24px"}}),e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",mb:2,mt:2},children:t("common.dataStorage")}),e.jsx(ve,{})]})}function Oe({spaceGateway:t,onConfirm:s=()=>{},onCancel:n=()=>{}}){const{t:o}=E(),[r,a]=h.useState(!1),[i,c]=h.useState(!1),d=(f,x)=>{f?.preventDefault(),f?.stopPropagation(),a(x)},l=async f=>{try{f?.stopPropagation(),c(!0),await s?.(t),a(!1)}catch(x){console.error(x),B.error(`${o("storage.space.gateway.delete.failed")}: ${V(x)}`)}finally{a(!1),c(!1)}},p=f=>{d(f,!1),n?.(f)};return e.jsxs(e.Fragment,{children:[e.jsxs(K,{color:"red",onClick:f=>d(f,!0),children:[e.jsx($,{style:{minWidth:24,color:"red"},children:e.jsx(Lt,{fontSize:"small"})}),e.jsx(Y,{style:{color:"red"},children:o("common.disconnect")})]}),e.jsx(rt,{title:o("storage.spaces.gateway.delete.title"),open:r,confirmButton:{text:o("common.confirm"),props:{size:"small",variant:"contained",color:"error",loading:i}},cancelButton:{text:o("common.cancel"),props:{size:"small",variant:"outlined",disabled:i}},onConfirm:l,onCancel:p,children:e.jsx(j,{sx:{wordWrap:"break-word"},children:o("storage.spaces.gateway.delete.descForBackup",{name:`${t?.name}`})})})]})}Oe.propTypes={spaceGateway:m.shape({name:m.string.isRequired,url:m.string.isRequired,protected:m.bool}).isRequired,onConfirm:m.func,onCancel:m.func};function Me({spaceGateway:t,selected:s,onDelete:n=()=>{},onConnect:o=()=>{},enableSwitchToSpace:r=!0,backupInProgress:a=!1,...i}){const{abortBlockletBackup:c}=L(),[d,l]=h.useState(null),{t:p}=E(),[f,x]=h.useState(!1),u=(y,b)=>{y.stopPropagation(),y.preventDefault(),l(b&&y.currentTarget)},k=async y=>{try{x(!0),u(y,!1),await o(t)}catch(b){console.error(b),B.error(b.message)}finally{x(!1)}},w=async y=>{try{x(!0),u(y,!1),await c()}catch(b){console.error(b),B.error(b.message)}finally{x(!1)}};return e.jsxs(e.Fragment,{children:[f||t?.loading?e.jsx(A,{sx:{ml:1},size:"24px"}):e.jsx(it,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions",variant:"outlined",size:"small",onClick:y=>u(y,!0),...i,children:e.jsx(ct,{})}),e.jsxs(lt,{id:"simple-menu",anchorEl:d,keepMounted:!0,open:!!d,onClose:y=>u(y,!1),children:[e.jsxs(K,{onClick:y=>{u(y,!1),window.open(ke(t.endpoint?Et(t.endpoint):t.url,{allowDomains:null}))},children:[e.jsx($,{style:{minWidth:24},children:e.jsx(Wt,{fontSize:"small"})}),e.jsx(Y,{children:p("common.open")})]}),e.jsxs(K,{onClick:y=>{u(y,!1),window.open(ke(It(t.endpoint),{allowDomains:null}))},children:[e.jsx($,{style:{minWidth:24},children:e.jsx(Ft,{fontSize:"small"})}),e.jsx(Y,{children:p("storage.spaces.strategy.viewBackupFiles")})]}),!s&&r&&e.jsxs(K,{onClick:k,children:[e.jsx($,{style:{minWidth:24},children:e.jsx(Gt,{fontSize:"small"})}),e.jsx(Y,{children:p("storage.spaces.connect.switchToSpace")})]}),a&&e.jsxs(K,{onClick:w,children:[e.jsx($,{style:{minWidth:24},children:e.jsx(Ut,{fontSize:"small"})}),e.jsx(Y,{children:p("storage.spaces.connect.abortBlockletBackup")})]}),!a&&e.jsx(Oe,{spaceGateway:t,onConfirm:async()=>{l(null),await n?.(t)},onCancel:()=>l(null)})]})]})}Me.propTypes={spaceGateway:m.shape({name:m.string.isRequired,url:m.string.isRequired,protected:m.bool,endpoint:m.string.isRequired,loading:m.bool}).isRequired,selected:m.bool.isRequired,enableSwitchToSpace:m.bool,onDelete:m.func,onConnect:m.func,backupInProgress:m.bool};const Zt=ee(({className:t,...s})=>e.jsx(Se,{...s,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function Ne({spaceGateway:t,spaceStatus:s,selected:n,onConnected:o=()=>{},onDeleted:r=()=>{},onBackedUp:a=()=>{}}){const{t:i,locale:c}=E(),{blocklet:d}=U(),{api:l,info:{did:p}}=N(),{appDid:f,appName:x,appDescription:u,scopes:k,appUrl:w,referrer:y}=Ee({blocklet:d}),{backupProgress:b,updateSpaceGateway:te,deleteSpaceGateway:se,refreshBackupSummary:oe,refreshBackups:ne}=L(),[_,O]=h.useState(!1),[I,z]=h.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:i("storage.spaces.authorize.title",{appName:x},c),scan:i("storage.spaces.authorize.scan",{appName:x},c),confirm:"",success:e.jsx(j,{gutterBottom:!0,children:i("storage.spaces.authorize.success")})},onClose:()=>{z(C=>({...C,open:!1}))}}),ae=n&&!_&&s===ue.DISCONNECTED,re=n&&!_&&!t.loading&&s===ue.CONNECTED,F=n&&_&&s===ue.CONNECTED&&b?.progress>=0,Q=async()=>{try{if(await Tt(t?.endpoint)){await l.configBlocklet({input:{did:[d.meta.did],configs:[{key:M.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:t.endpoint}]}}),B.success(i("storage.spaces.connect.switchToSpaceSucceeded",{name:t.name?`(${t.name})`:""})),o?.(null,t);return}}catch(C){console.error(C),o?.(C,t);return}z(C=>({...C,open:!0,prefix:fe(t.url,"space/api/did"),baseUrl:new URL(t.url).origin,checkFn:Be.create({baseURL:fe(t.url,"space")}).get,extraParams:{appDid:f,appName:x,appDescription:u,scopes:k,appUrl:w,referrer:y,nodeDid:p,spaceDid:t.did}}))},ie=async(C,g)=>{const P=g(C.endpoint),R=ge(P),v=C.space?g(C.space):{};if(t.did&&R!==t.did){z(_e=>({..._e,open:!1}));const W=i("storage.spaces.gateway.switch.failedForMismatchSpace",{name:v?.name?v.name:""});B.error(W),o?.(new Error(W),t);return}const de={...t,name:v.name??"DID Space",did:v.did??ge(P),endpoint:P};await te(de),z(W=>({...W,open:!1})),o?.(null,de)},ce=async()=>{try{if(_)return;O(!0),await l.backupBlocklet({input:{appDid:d.appDid,to:"spaces"}})}catch(C){console.error(C),B.error(C.message),a?.(C,t)}finally{O(!0)}},le=async()=>{try{await se(t),B.success(i("storage.spaces.gateway.delete.succeeded",{name:t.name?`(${t.name})`:""})),r?.(null,t)}catch(C){console.error(C),r?.(C,t)}};return h.useEffect(()=>{b?.completed?(n&&(b?.progress===100?(B.success(i("storage.spaces.backupSuccessfully")),a?.(null,t)):b.message&&a?.(new Error(b?.message),t),b.progress=0,b.message=""),O(!1),setTimeout(()=>{oe(),ne()},1e3)):b.progress&&O(!0)},[b]),e.jsxs(e.Fragment,{children:[e.jsxs(S,{sx:{display:"flex",alignItems:"center",".action-btn":{borderRadius:1,marginLeft:1}},children:[re&&e.jsx(pe,{className:"action-btn",variant:"outlined",size:"small",onClick:ce,children:i("storage.spaces.strategy.backupNow")}),ae&&e.jsx(pe,{className:"action-btn",variant:"outlined",size:"small",onClick:Q,children:i("storage.spaces.disconnected.reconnectNow")}),F&&e.jsx(Zt,{title:b?.message&&e.jsx(S,{sx:{p:1,borderRadius:1,boxShadow:2,color:"black",backgroundColor:"white"},children:e.jsx(j,{variant:"body2",children:b.message})}),children:e.jsxs(pe,{className:"action-btn",variant:"outlined",size:"small",sx:{minWidth:70},children:[e.jsx(A,{variant:"determinate",value:b?.progress,size:14,sx:{mr:1}}),b?.progress,"%"]})}),e.jsx(dt,{forceConnected:!1,saveConnect:!1,prefix:I.prefix,open:I.open,popup:!0,action:I.action,baseUrl:I.baseUrl,checkFn:I.checkFn,onSuccess:ie,onClose:I.onClose,checkTimeout:I.checkTimeout,extraParams:I.extraParams,messages:I.messages,locale:c},"get-endpoint")]}),e.jsx(Me,{sx:{minWidth:32,padding:"2px 4px",ml:1},spaceGateway:t,selected:n,onDelete:le,onConnect:Q,enableSwitchToSpace:b?.completed||H(b?.message),backupInProgress:F})]})}Ne.propTypes={spaceGateway:m.shape({did:m.string.isRequired,name:m.string.isRequired,url:m.string.isRequired,endpoint:m.string.isRequired,protected:m.bool,loading:m.bool}).isRequired,spaceStatus:m.string.isRequired,selected:m.bool.isRequired,onConnected:m.func,onDeleted:m.func,onBackedUp:m.func};function Jt({...t}){const{t:s}=E();return e.jsxs(S,{...t,children:[e.jsx(S,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:s("storage.spaces.backup.records")})}),e.jsx(Pe,{}),e.jsx(Le,{})]})}function es({...t}){const{t:s}=E(),{autoBackup:n,updateAutoBackup:o}=L(),r=async()=>{try{const a=!n?.enabled;await o({enabled:a}),B.success(s(a?"storage.spaces.autoBackup.enabled":"storage.spaces.autoBackup.disabled"))}catch(a){B.error(a.message)}};return e.jsx(Ot,{checked:!!n?.enabled,onChange:r,name:"enableWelcomePage",labelProps:{label:e.jsx(j,{sx:{marginRight:"8px"},children:e.jsx("span",{children:s("storage.spaces.autoBackup.title")})})},style:{...t.style}})}function ts(){const{t}=E(),{spaceGateways:s,spaceGatewaysLoading:n,spaceGatewayIsSelected:o}=L(),r=n&&!s?.length,a=({spaceGateway:i,spaceStatus:c,selected:d,refresh:l})=>e.jsx(Ne,{spaceGateway:i,spaceStatus:c,selected:d,onConnected:()=>l(),onBackedUp:p=>p&&l()});return e.jsxs(S,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(S,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},gap:{xs:1,md:2},justifyContent:{xs:"center",md:"flex-start"},alignItems:{xs:"flex-start",md:"center"}},children:[e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",flexGrow:1},children:t("storage.spaces.connected.title")}),e.jsx(es,{}),e.jsx(ze,{})]}),e.jsx(S,{sx:{mt:2},children:r?e.jsx(S,{sx:{display:"flex",justifyContent:"center"},children:e.jsx(A,{})}):e.jsx(be,{container:!0,spacing:2,children:e.jsx(e.Fragment,{children:s.map(i=>e.jsx(be,{size:{xs:12,md:6},children:e.jsx(ht,{endpoint:i.endpoint,selected:o(i),action:a},i.endpoint)},i.endpoint))})})}),e.jsx(Jt,{sx:{marginTop:"24px"}}),e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",mb:2},children:t("common.dataStorage")}),e.jsx(ve,{})]})}function ss(){const{spaceGatewaysFirstLoading:t,spaceGateways:s}=L();return t?e.jsx(De,{relative:"parent",children:e.jsx(A,{})}):H(s)?e.jsx(Xt,{}):e.jsx(ts,{})}function os(){return e.jsx(Re,{children:e.jsx(ss,{})})}function ns(){const{spaceGateway:t,settingStorageEndpoint:s,updateSpaceGateway:n,hasStorageEndpoint:o,loading:r,storageEndpoint:a}=yt(),i=xe(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"16px"}));return r?e.jsx(De,{relative:"parent",children:e.jsx(A,{})}):e.jsxs(S,{sx:{maxWidth:"md",position:"relative"},children:[o?e.jsx(bt,{spaceGateway:t,settingStorageEndpoint:s}):e.jsx(kt,{}),e.jsx(S,{sx:i,children:e.jsx(jt,{onConnect:n,storageEndpoint:a})})]})}function as(){const{t}=E();return e.jsxs(St,{children:[e.jsxs(G,{spacing:1,sx:{marginBottom:2},children:[e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:t("storage.appLevel.title")}),e.jsx(j,{sx:{color:"text.secondary"},children:t("storage.appLevel.description")})]}),e.jsx(ns,{})]})}function rs({navOrientation:t="vertical",...s}){const{t:n,locale:o}=E(),{blocklet:r}=U(),a=mt({key:"md"}),[i,c]=pt(),d=i.get("tab")||"backup",l=a?"horizontal":t,p=xe(()=>{const w=[{label:n("common.backup"),value:"backup"}],y=r?.capabilities?.didSpace;return(y===M.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||y===M.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP)&&w.push({label:n("common.storage"),value:"storage"}),w},[o,l]),x=xe(()=>({backup:e.jsx(os,{}),storage:e.jsx(as,{})}))[d],u=w=>{c(y=>(w==="backup"?y.delete("tab"):y.set("tab",w),y))};if(p.length<=1)return e.jsx(me,{children:x});const k=e.jsx(ut,{tabs:p,current:d,orientation:l,onChange:u,sx:[{borderRight:1,height:"100%",borderColor:"divider"},l==="horizontal"&&{borderRight:0}]});if(l==="vertical")return e.jsx(S,{...s,children:e.jsxs(G,{direction:{md:"column",lg:"row"},sx:{gap:2},children:[e.jsx(S,{sx:{flexShrink:0},children:e.jsx(je,{left:k})}),e.jsx(S,{sx:{flexGrow:1,minWidth:0},children:e.jsx(me,{sx:{mt:1},children:x})})]})});if(l==="horizontal")return e.jsxs(S,{...s,children:[e.jsx(je,{left:k}),e.jsx(me,{sx:{mt:2},children:x})]})}rs.propTypes={navOrientation:m.oneOf(["vertical","horizontal"])};const me=ee(S)`
|
|
3
3
|
position: relative;
|
|
4
4
|
min-height: 66vh;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aG as createSvgIcon,j as jsxRuntimeExports,r as reactExports$1,o,bd as getDefaultExportFromCjs,F as useMediaQuery,s as styled,dk as Skeleton,cP as F,_ as CheckIcon,az as Tooltip,dE as Button,T as Typography,N as Box,C as CircularProgress,f as useTheme,dy as isObject,eY as deepmerge,eZ as StyledEngineProvider,e_ as ThemeProvider,e$ as ThemeProvider$1,f0 as s,Z as o$1,b8 as styled$1,f1 as CloseIcon,cE as Buffer,be as U,bE as __vitePreload,dD as noop,dc as m$2}from"./index
|
|
1
|
+
import{aG as createSvgIcon,j as jsxRuntimeExports,r as reactExports$1,o,bd as getDefaultExportFromCjs,F as useMediaQuery,s as styled,dk as Skeleton,cP as F,_ as CheckIcon,az as Tooltip,dE as Button,T as Typography,N as Box,C as CircularProgress,f as useTheme,dy as isObject,eY as deepmerge,eZ as StyledEngineProvider,e_ as ThemeProvider,e$ as ThemeProvider$1,f0 as s,Z as o$1,b8 as styled$1,f1 as CloseIcon,cE as Buffer,be as U,bE as __vitePreload,dD as noop,dc as m$2}from"./index--ktJL2Tx.js";import{j as joinUrl}from"./url-join-vuArvvL1.js";const l$1=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M11.67 3.87 9.9 2.1 0 12l9.9 9.9 1.77-1.77L3.54 12z"})),d$2=createSvgIcon([jsxRuntimeExports.jsx("circle",{cx:"12",cy:"19",r:"2"},"0"),jsxRuntimeExports.jsx("path",{d:"M10 3h4v12h-4z"},"1")]),k$2=reactExports$1.createContext(),{Provider:w$3}=k$2,d$1=(C,V,D=window.location.pathname.replace(/\/$/,"/"))=>C?V?C===D:new RegExp(C).test(D):!1;function P({children:C,steps:V,mode:D="history"}){const[B,O]=reactExports$1.useState("");!B&&V.length&&O(V[0].key);const j=V.map(K=>K.children?[{key:K.key,hasChild:!0},K.children.map(ot=>({parentKey:K.key,key:ot.key}))]:{key:K.key}).flat(1/0),G=j.filter(K=>!K.hasChild),X=K=>{let ot;const it=j.findIndex(pt=>pt.key===B?(ot=pt.parentKey,!0):!1);if(ot===K)return"current";const et=j.findIndex(pt=>pt.key===K);if(et!==-1){if(et===it)return"current";if(et<it)return"before"}return"after"};function H(K){O(K)}function J(K){if(typeof K=="function"){const ot=K(G.findIndex(it=>it.key===B));O(G[ot].key)}else O(G[K].key)}const st=G.findIndex(K=>K.key===B);reactExports$1.useEffect(()=>{if(D==="history"){let K="";V.some(ot=>ot.children&&ot.children.length?ot.children.some(it=>d$1(it.path,it.exact)?(K=it.key,!0):!1):d$1(ot.path,ot.exact)?(K=ot.key,!0):!1),K&&O(K)}return()=>{}},[V,D]);const lt={steps:V,totalStepsCount:G.length,getStepStatus:X,setActiveStepByKey:H,setActiveStepByIndex:J,activeStep:st,canBackToStep:K=>D==="memory"&&st!==0&&K<st};return jsxRuntimeExports.jsx(w$3,{value:lt,children:C})}function T$1(){return reactExports$1.use(k$2)}P.propTypes={children:o.any.isRequired,steps:o.array.isRequired,mode:o.string};var lib,hasRequiredLib;function requireLib(){if(hasRequiredLib)return lib;hasRequiredLib=1;var C=Object.prototype.hasOwnProperty,V=Object.prototype.toString;function D(B){if(B==null)return!0;if(typeof B=="boolean")return!1;if(typeof B=="number")return B===0;if(typeof B=="string"||typeof B=="function"||Array.isArray(B))return B.length===0;if(B instanceof Error)return B.message==="";if(B.toString==V)switch(B.toString()){case"[object File]":case"[object Map]":case"[object Set]":return B.size===0;case"[object Object]":{for(var O in B)if(C.call(B,O))return!1;return!0}}return!1}return lib=D,lib}var libExports=requireLib();const k$1=getDefaultExportFromCjs(libExports),S=""+new URL("blocklet-default-logo-Bspnu_ws.png",import.meta.url).href,t$1={en:{optional:"Optional",defaultNavSubTitle:"Launching"},zh:{optional:"可选",defaultNavSubTitle:"启动"}},a$1=C=>t$1[C]?t$1[C]:t$1.en,i=C=>C==="zh"?"启动":"Launching",g$2=C=>C?.title||C?.name||"";function T({blockletMeta:C={},subTitle:V="",logoUrl:D="",locale:B="",navLogo:O="",loading:j=!1}){const G=useMediaQuery(lt=>lt.breakpoints.down("md")),X=G?18:48,H=reactExports$1.useRef(null),[J,st]=reactExports$1.useState("");return reactExports$1.useEffect(()=>{H.current&&H.current.offsetHeight>34&&(J===""?st("middle"):J==="middle"&&st("small"))},[J]),jsxRuntimeExports.jsxs(R,{className:J==="small"?"center-mode":"",children:[G?jsxRuntimeExports.jsx("div",{className:"app-icon",children:O}):jsxRuntimeExports.jsxs("div",{className:"app-icon",children:[j&&jsxRuntimeExports.jsx(I,{blockletSize:X,isMobile:G}),!j&&jsxRuntimeExports.jsx(u$1,{blockletSize:X,logoUrl:D})]}),jsxRuntimeExports.jsxs("div",{className:"header-title",children:[G&&V&&jsxRuntimeExports.jsx("div",{className:"header-title-sub",children:V}),jsxRuntimeExports.jsxs("div",{className:"app-name-content",children:[!G&&jsxRuntimeExports.jsx("div",{className:"launching-context",children:V||i(B)}),jsxRuntimeExports.jsx("div",{className:`header-title-name ${J==="middle"||J==="small"?"middle-size":""}`,ref:H,children:jsxRuntimeExports.jsx(w$2,{logoUrl:D,isMobile:G,blockletMeta:C,blockletSize:X,loading:j})})]})]})]})}T.propTypes={blockletMeta:o.object,subTitle:o.any,logoUrl:o.string,locale:o.string,navLogo:o.any,loading:o.bool};function I({blockletSize:C,isMobile:V}){return V?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:100,height:16,alt:"icon",style:{marginTop:4}}):jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:C,height:C})}function u$1({logoUrl:C,blockletSize:V}){return jsxRuntimeExports.jsx(F,{width:V,height:V,src:C,alt:"blocklet icon",fallback:S,style:{verticalAlign:"text-bottom"}},`layout-app-icon-${C}`)}function w$2({isMobile:C,logoUrl:V,blockletMeta:D={},blockletSize:B,loading:O}){const j=g$2(D);return O?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:100,height:16,alt:"icon",style:{marginTop:4}}):k$1(D)?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",animation:!1,width:100,height:16,alt:"icon",style:{marginTop:4}}):C?jsxRuntimeExports.jsxs(L$1,{children:[jsxRuntimeExports.jsx(u$1,{blockletSize:B,logoUrl:V}),jsxRuntimeExports.jsx("span",{className:"ellipsis-title",children:g$2(D)})]}):jsxRuntimeExports.jsx(E,{className:"app-link",target:"_blank",href:joinUrl(D?.registryUrl||"",`/blocklets/${D?.did}`),title:j,children:j})}const L$1=styled.div`
|
|
2
2
|
.ellipsis-title {
|
|
3
3
|
flex: 1;
|
|
4
4
|
position: absolute;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{E as N,bn as D,bo as ke,m as R,j as e,P as $,r as y,Q,R as J,S as Y,U as Z,N as u,o as g,v as F,C as Te,ad as re,aV as ee,t as H,g as we,y as L,$ as ce,aU as Ae,V as Ke,s as B,au as O,H as Se,l as Re,bp as q,W as De,bq as le,br as de,bs as pe,bt as Ie,J as $e,T as I,bu as Be,az as _,a4 as ie,aR as ae,bv as Pe,X as Le,Y as Ee,A as Ne,u as _e,bm as ze,d as We,bw as qe}from"./index
|
|
1
|
+
import{E as N,bn as D,bo as ke,m as R,j as e,P as $,r as y,Q,R as J,S as Y,U as Z,N as u,o as g,v as F,C as Te,ad as re,aV as ee,t as H,g as we,y as L,$ as ce,aU as Ae,V as Ke,s as B,au as O,H as Se,l as Re,bp as q,W as De,bq as le,br as de,bs as pe,bt as Ie,J as $e,T as I,bu as Be,az as _,a4 as ie,aR as ae,bv as Pe,X as Le,Y as Ee,A as Ne,u as _e,bm as ze,d as We,bw as qe}from"./index--ktJL2Tx.js";import{T as Me}from"./index-BMN0G3TX.js";import Ue from"./audit-logs-CrbGepG6.js";import{T as me,M as Fe}from"./index-D8SeMuuf.js";import{r as ue,P as He}from"./index-f15iWus7.js";import{u as E,T as Oe}from"./team-BroofdgP.js";import{g as Ve,H as Xe}from"./index-DTRD5V4Z.js";import{D as Ge}from"./url-evaluation-udVYSMO4.js";import{E as Qe}from"./Edit-CvUxpqSV.js";import{y as Je}from"./index-CPtXYlM0.js";import{A as Ye}from"./Add-Clw8RkKN.js";import{g as V}from"./index-5o6sB1f4.js";import{C as X}from"./click-to-copy-CTJTNpA1.js";import{f as Ze}from"./index-BojVbZw0.js";import{D as et}from"./delete-confirm-itV6yjjb.js";import{P as tt}from"./permission-Bd240jHS.js";import{u as st}from"./blocklet-DXJr-xZq.js";import{A as nt}from"./actions-BFpxkOZ3.js";import{u as xe}from"./use-mobile-DwZO5be8.js";import{u as ot}from"./useAsyncRetry-D5p_7oRt.js";import"./TableSearch-BezFlhKc.js";import"./Search-CveVLYRK.js";import"./Clear-ClQc69CC.js";import"./useLocalStorage-Bj7q_OT_.js";import"./index-HQ4TKOad.js";import"./decode-DPztD6kB.js";import"./shorten-label-BsB05cbU.js";import"./ViewList-5nfbahYZ.js";import"./use-mobile-BM273ejS.js";import"./client-Bq43pXAg.js";import"./AdapterDayjs-B4EEI1nK.js";import"./useThemeProps-GIAqgoE8.js";import"./CSSTransition-CujxmWeH.js";import"./visuallyHidden-Dan1xhjv.js";import"./index-DYPal8XU.js";import"./Verified-aOhYddnX.js";import"./DeleteOutline-BhORbRJB.js";import"./ErrorOutline-QvbHz9Zz.js";import"./index-BKrngGDQ.js";import"./emotion-cache.browser.esm-BUnXReBA.js";import"./sdk-FGFC0J6F.js";import"./index-CEX6125H.js";import"./ButtonGroup-CPPdPq8H.js";import"./getValidReactChildren-CutnuaBi.js";import"./Google-BiT-YaK5.js";import"./cloneDeep-Q4iUxm_j.js";import"./chain-DZSCXq3Z.js";import"./list-header-s7KnhaJP.js";import"./ToggleButtonGroup-CBj3NmRn.js";import"./FilterList-DrVbs05B.js";import"./index-FTSHH2z1.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-B5cFAumu.js";import"./MoreVert-3Ril4BaF.js";import"./useAsync-DLvWuoz4.js";function te({value:t}){const{t:s,locale:a}=R(),i=new Date;return new Date(t)<i?e.jsxs("span",{style:{color:"red"},children:[e.jsx($,{value:t,locale:a}),`${s("setting.accessKey.expired",{time:""})}`]}):e.jsx($,{value:t,locale:a,type:"all"})}te.propTypes={value:g.string.isRequired};function se({value:t,onChange:s,...a}){const{t:i}=R(),n=y.useMemo(()=>[{value:"signature",title:i("setting.accessKey.signature"),description:i("setting.accessKey.signatureDesc")},{value:"simple",title:i("setting.accessKey.simple"),description:i("setting.accessKey.simpleDesc")}],[i]);return e.jsxs(Q,{style:{width:"100%"},variant:"outlined",...a,children:[e.jsx(J,{children:i("setting.accessKey.authType")}),e.jsx(Y,{value:t,onChange:s,fullWidth:!0,label:i("setting.accessKey.authType"),children:n.map(l=>e.jsx(Z,{value:l.value,children:e.jsxs(u,{children:[e.jsx("span",{children:l.title}),e.jsx(u,{sx:{maxWidth:510,fontSize:12,color:"#999",whiteSpace:"normal"},children:l.description})]})},l.value))})]})}se.propTypes={value:g.string.isRequired,onChange:g.func.isRequired};const z=()=>{const t=N.RBAC_CONFIG.roles.filter(n=>n.passport),{inService:s}=D(),{roles:a}=E(),i=[...t,...s?a:[]];return ke(i,"name").filter(n=>n.name!==N.ROLES.OWNER)};function ge({onCreate:t=()=>{},remark:s=""}){const{api:a}=D(),{teamDid:i}=E(),{t:n}=R(),[l,h]=y.useState(!1),[m,C]=y.useState(null),c=z(),T=()=>{h(!1),C(null)},b=async p=>{const{remark:k,passport:x,authType:o}=p;h(!0);const v=await a.createAccessKey({input:{teamDid:i,remark:k.trim(),passport:x,expireAt:p.expireAt?new Date(p.expireAt).getTime():null,authType:o}}),{data:j}=v;t(j),C(null),h(!1)},d={title:`${n("common.create")} ${n("accessKey")}`,description:(p,k,x)=>e.jsxs(ee,{sx:{gap:3},children:[e.jsx(H,{label:n("setting.accessKey.tip"),autoComplete:"off",variant:"outlined",name:"remark",fullWidth:!0,autoFocus:!0,margin:"dense",value:p.remark,onChange:o=>{k({...p,remark:o.target.value,__disableConfirm:!p.passport||!o.target.value.trim()}),o.target.value.trim()?x(""):x(n("setting.accessKey.remarkInvalid"))},slotProps:{htmlInput:{"data-cy":"remark-input"}}}),e.jsxs(Q,{style:{width:"100%"},variant:"outlined",children:[e.jsx(J,{children:n("setting.accessKey.passport")}),e.jsx(Y,{"data-cy":"create-access-key-select-passport",value:p.passport,onChange:o=>{const v=o.target.value;x(null),k({...p,passport:v,__disableConfirm:!p.remark||!v})},fullWidth:!0,label:n("setting.accessKey.passport"),disabled:l,children:c.map(o=>e.jsx(Z,{value:o.name,"data-cy":`create-access-key-passport-option-${o.name}`,children:e.jsxs(u,{children:[e.jsx("span",{children:o.title||o.name}),e.jsx(u,{sx:{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify"},children:o.description})]})},o.name))})]}),e.jsx(se,{value:p.authType,onChange:o=>{k({...p,authType:o.target.value})}}),e.jsx(me,{placeholder:n("setting.accessKey.expireTime"),value:p.expireAt,onChange:o=>{k({...p,expireAt:o,__disableConfirm:!p.passport||!p.remark||!o})}})]}),confirm:n("common.confirm"),cancel:n("common.cancel"),color:"primary",params:{remark:s,authType:"signature",__disableConfirm:!s.trim()},onConfirm:b,onCancel:T};return e.jsxs(e.Fragment,{children:[e.jsxs(F,{sx:{color:"common.white"},edge:"end",variant:"contained",color:"primary","data-cy":"add-access-key-btn",onClick:()=>C(d),className:"rule-action",children:[l?e.jsx(Te,{size:16}):e.jsx(Ye,{style:{fontSize:16}}),n("common.create")]}),m&&e.jsx(re,{title:m.title,description:m.description,confirm:m.confirm,color:m.color,cancel:m.cancel,params:m.params,onConfirm:m.onConfirm,onCancel:m.onCancel})]})}ge.propTypes={remark:g.string,onCreate:g.func};function he({onConfirm:t=()=>{},accessKeyId:s,accessKeySecret:a,hideSecret:i=!0}){const{t:n}=y.useContext(we),[l,h]=y.useState(!1),[m,C]=y.useState(()=>i),c=D(),T=()=>{C(!m)},b=x=>{h(x.target.checked)},d=L(window.location.origin,c?.info?.routing?.adminPath),p=y.useMemo(()=>i?`const Client = require('@abtnode/client');
|
|
2
2
|
const ensureServerEndpoint = require('@abtnode/util/lib/ensure-server-endpoint');
|
|
3
3
|
const { joinURL } = require('ufo');
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cn as g,r as o,g as x,co as r,B as u,j as s,N as m,cp as d}from"./index
|
|
1
|
+
import{cn as g,r as o,g as x,co as r,B as u,j as s,N as m,cp as d}from"./index--ktJL2Tx.js";function P(){const i=g(),{blocklets:c,refresh:l}=i,{t:p}=o.useContext(x),y=r.generateKey(),[a]=u();return o.useEffect(()=>{const n=r.getNotificationQueryParams(y)??{},t=a.get("entityId"),e=a.get("severity"),f={...n,...e?{severity:e==="all"?[]:e.split(","),paging:{...n.paging,page:1}}:{},...t?{entityId:t==="all"?[]:t.split(",")}:{},componentDid:[]};l(f)},[]),s.jsxs(m,{children:[s.jsx("h1",{children:p("notification.title")}),s.jsx(d,{tabType:"line",blocklets:c,context:i,filterType:"entity",type:"server"})]})}export{P as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ev as k}from"./index
|
|
1
|
+
import{ev as k}from"./index--ktJL2Tx.js";var m,C;function S(){if(C)return m;C=1;function v(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function A(o,e){for(var r="",i=0,f=-1,t=0,n,l=0;l<=o.length;++l){if(l<o.length)n=o.charCodeAt(l);else{if(n===47)break;n=47}if(n===47){if(!(f===l-1||t===1))if(f!==l-1&&t===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var s=r.lastIndexOf("/");if(s!==r.length-1){s===-1?(r="",i=0):(r=r.slice(0,s),i=r.length-1-r.lastIndexOf("/")),f=l,t=0;continue}}else if(r.length===2||r.length===1){r="",i=0,f=l,t=0;continue}}e&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+o.slice(f+1,l):r=o.slice(f+1,l),i=l-f-1;f=l,t=0}else n===46&&t!==-1?++t:t=-1}return r}function b(o,e){var r=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+i:r+o+i:i}var g={resolve:function(){for(var e="",r=!1,i,f=arguments.length-1;f>=-1&&!r;f--){var t;f>=0?t=arguments[f]:(i===void 0&&(i=k.cwd()),t=i),v(t),t.length!==0&&(e=t+"/"+e,r=t.charCodeAt(0)===47)}return e=A(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(v(e),e.length===0)return".";var r=e.charCodeAt(0)===47,i=e.charCodeAt(e.length-1)===47;return e=A(e,!r),e.length===0&&!r&&(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return v(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var e,r=0;r<arguments.length;++r){var i=arguments[r];v(i),i.length>0&&(e===void 0?e=i:e+="/"+i)}return e===void 0?".":g.normalize(e)},relative:function(e,r){if(v(e),v(r),e===r||(e=g.resolve(e),r=g.resolve(r),e===r))return"";for(var i=1;i<e.length&&e.charCodeAt(i)===47;++i);for(var f=e.length,t=f-i,n=1;n<r.length&&r.charCodeAt(n)===47;++n);for(var l=r.length,s=l-n,c=t<s?t:s,u=-1,a=0;a<=c;++a){if(a===c){if(s>c){if(r.charCodeAt(n+a)===47)return r.slice(n+a+1);if(a===0)return r.slice(n+a)}else t>c&&(e.charCodeAt(i+a)===47?u=a:a===0&&(u=0));break}var h=e.charCodeAt(i+a),y=r.charCodeAt(n+a);if(h!==y)break;h===47&&(u=a)}var d="";for(a=i+u+1;a<=f;++a)(a===f||e.charCodeAt(a)===47)&&(d.length===0?d+="..":d+="/..");return d.length>0?d+r.slice(n+u):(n+=u,r.charCodeAt(n)===47&&++n,r.slice(n))},_makeLong:function(e){return e},dirname:function(e){if(v(e),e.length===0)return".";for(var r=e.charCodeAt(0),i=r===47,f=-1,t=!0,n=e.length-1;n>=1;--n)if(r=e.charCodeAt(n),r===47){if(!t){f=n;break}}else t=!1;return f===-1?i?"/":".":i&&f===1?"//":e.slice(0,f)},basename:function(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');v(e);var i=0,f=-1,t=!0,n;if(r!==void 0&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var l=r.length-1,s=-1;for(n=e.length-1;n>=0;--n){var c=e.charCodeAt(n);if(c===47){if(!t){i=n+1;break}}else s===-1&&(t=!1,s=n+1),l>=0&&(c===r.charCodeAt(l)?--l===-1&&(f=n):(l=-1,f=s))}return i===f?f=s:f===-1&&(f=e.length),e.slice(i,f)}else{for(n=e.length-1;n>=0;--n)if(e.charCodeAt(n)===47){if(!t){i=n+1;break}}else f===-1&&(t=!1,f=n+1);return f===-1?"":e.slice(i,f)}},extname:function(e){v(e);for(var r=-1,i=0,f=-1,t=!0,n=0,l=e.length-1;l>=0;--l){var s=e.charCodeAt(l);if(s===47){if(!t){i=l+1;break}continue}f===-1&&(t=!1,f=l+1),s===46?r===-1?r=l:n!==1&&(n=1):r!==-1&&(n=-1)}return r===-1||f===-1||n===0||n===1&&r===f-1&&r===i+1?"":e.slice(r,f)},format:function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return b("/",e)},parse:function(e){v(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var i=e.charCodeAt(0),f=i===47,t;f?(r.root="/",t=1):t=0;for(var n=-1,l=0,s=-1,c=!0,u=e.length-1,a=0;u>=t;--u){if(i=e.charCodeAt(u),i===47){if(!c){l=u+1;break}continue}s===-1&&(c=!1,s=u+1),i===46?n===-1?n=u:a!==1&&(a=1):n!==-1&&(a=-1)}return n===-1||s===-1||a===0||a===1&&n===s-1&&n===l+1?s!==-1&&(l===0&&f?r.base=r.name=e.slice(1,s):r.base=r.name=e.slice(l,s)):(l===0&&f?(r.name=e.slice(1,n),r.base=e.slice(1,s)):(r.name=e.slice(l,n),r.base=e.slice(l,s)),r.ext=e.slice(n,s)),l>0?r.dir=e.slice(0,l-1):f&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return g.posix=g,m=g,m}export{S as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as P,m as E,A as C,j as e,Z as W,C as j,cB as I,N as T,w as k,H as u,E as N,u as S,x as U,ar as v,af as R}from"./index
|
|
1
|
+
import{r as P,m as E,A as C,j as e,Z as W,C as j,cB as I,N as T,w as k,H as u,E as N,u as S,x as U,ar as v,af as R}from"./index--ktJL2Tx.js";import{w as b}from"./wrap-locale-DR1zYzoA.js";import{g as L}from"./get-safe-url-CkVD5JZ8.js";function B({SessionContext:n,webWalletUrl:a,onSuccess:r}){const{api:o,session:t}=P.useContext(n),{t:s,locale:g}=E(),h=C(),{searchParams:l}=new URL(window.location.href),p=l.get("redirect"),f=async(c,w)=>{r(c,w),await t.refresh(),u.success(s("exchangePassport.success")),setTimeout(()=>{if(p){const i=decodeURIComponent(p);i.startsWith(N.WELLKNOWN_SERVICE_PATH_PREFIX)?h(i,{replace:!0}):window.location.href=L(i)}else window.location.href=window.env.pathPrefix||window.env.apiPrefix||"/"},3e3)},m=c=>{u.error(c.message)},d={},x=l.get("componentId");return x&&(d.componentId=x),t.loading?e.jsx(W,{children:e.jsx(j,{})}):e.jsx(I,{did:window?.blocklet?.appPid||window?.env?.appPid,children:e.jsx(T,{sx:{maxWidth:"100%",height:"100%"},children:e.jsx(k,{popup:!0,open:!0,className:"connect",action:"exchange-passport",checkFn:o.get,checkTimeout:10*60*1e3,webWalletUrl:a,onSuccess:f,onError:m,locale:g,messages:{title:s("exchangePassport.dialog.title"),scan:s("exchangePassport.dialog.scan"),confirm:s("exchangePassport.dialog.confirm"),success:s("exchangePassport.dialog.success")},extraParams:d,extraContent:null,hideCloseButton:!0})})})}const _=b(B);function K(){const{info:n}=S(),a=U(n),r=(o,t)=>{o.sessionToken&&R(t(o.sessionToken))};return e.jsx(_,{SessionContext:v,webWalletUrl:a,onSuccess:r})}export{K as default};
|