@abtnode/blocklet-services 1.16.31 → 1.16.32-beta-0b7f1250
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/dist/assets/{Add-RSfTN8EF.js → Add-DK2sSVal.js} +1 -1
- package/dist/assets/{AddBox-kYHD66ZJ.js → AddBox-k344mb3q.js} +1 -1
- package/dist/assets/{Alert-ClYwyZJt.js → Alert-BBnZ-bJY.js} +1 -1
- package/dist/assets/{ArrowDropDown-DsukJ5At.js → ArrowDropDown-Ds7eP3kq.js} +1 -1
- package/dist/assets/{Avatar-DfF1m2g5.js → Avatar-B_ozaB1d.js} +1 -1
- package/dist/assets/{ButtonGroup-DFgjZ6az.js → ButtonGroup-Brd5tASZ.js} +1 -1
- package/dist/assets/{CheckCircle-2MoihWY7.js → CheckCircle-D8MY3EHO.js} +1 -1
- package/dist/assets/{ChevronRight-JfisleDr.js → ChevronRight-Clkn1-CT.js} +1 -1
- package/dist/assets/{Close-r1Gq1Bnc.js → Close-B78FCRQD.js} +1 -1
- package/dist/assets/{CloseOutlined-DMNRl8D0.js → CloseOutlined-C_pRRRMb.js} +1 -1
- package/dist/assets/{Delete-uLZyjAyH.js → Delete-D4dMA0lG.js} +1 -1
- package/dist/assets/{DeleteOutline-Brfidl3M.js → DeleteOutline-xp-yy9Ns.js} +1 -1
- package/dist/assets/{Done-BPSCz_s4.js → Done-BLCIniIk.js} +1 -1
- package/dist/assets/{Download-BPUfwxxs.js → Download-YHpdHIjQ.js} +1 -1
- package/dist/assets/{Edit-CEc0n6pq.js → Edit-sp3_Gw67.js} +1 -1
- package/dist/assets/{EditIcon-Jc6oyqrl.js → EditIcon-D8pL4kWj.js} +1 -1
- package/dist/assets/{Error-D0CS80xU.js → Error-7Kc9kGgC.js} +1 -1
- package/dist/assets/{ExpandMore-Bpwbf5LO.js → ExpandMore-Bu3C6pU8.js} +1 -1
- package/dist/assets/{FilterList-8uDifo29.js → FilterList-qJZckPS6.js} +1 -1
- package/dist/assets/{FormControl-BS53BBfk.js → FormControl-DKCPWiUE.js} +1 -1
- package/dist/assets/{FormControlLabel-CpXvhTph.js → FormControlLabel-DJ7JqxQ9.js} +1 -1
- package/dist/assets/{FormGroup-CQJX8jMa.js → FormGroup-QuE1_Stk.js} +1 -1
- package/dist/assets/{Google-OIPrxvqR.js → Google-z-HMOZVU.js} +1 -1
- package/dist/assets/{Hidden-DQSEBXaz.js → Hidden-DhJpb55-.js} +1 -1
- package/dist/assets/{InfoOutlined-tAhgLsvq.js → InfoOutlined-muBBlc-m.js} +1 -1
- package/dist/assets/{InputAdornment-DE9lNaQi.js → InputAdornment-btyswwKp.js} +1 -1
- package/dist/assets/{InputLabel-vEy8Wv5K.js → InputLabel-C9tGpQ3p.js} +1 -1
- package/dist/assets/{LastPage-CG3UlSnN.js → LastPage-B0el3h-h.js} +1 -1
- package/dist/assets/{Launch-yFmc6Tfn.js → Launch-ByZVFHQK.js} +1 -1
- package/dist/assets/{LaunchOutlined-B6RRxgIf.js → LaunchOutlined-Dv-6yYm6.js} +1 -1
- package/dist/assets/{Link-AzDxZ12K.js → Link-6h9rQRZt.js} +1 -1
- package/dist/assets/{ListItemText-tl-KE_u8.js → ListItemText-CiKmy0GT.js} +1 -1
- package/dist/assets/{LoadingButton-BB1FukNp.js → LoadingButton-CPUfUJs9.js} +1 -1
- package/dist/assets/{LockIcon-BgqgFtnN.js → LockIcon-HkFVG9UK.js} +1 -1
- package/dist/assets/{Loop-xx5k3xbF.js → Loop-CnSbkmS4.js} +1 -1
- package/dist/assets/{MoreHoriz-_DaP4AK8.js → MoreHoriz-C9DIIKqb.js} +1 -1
- package/dist/assets/{MoreVert-CxoveKS9.js → MoreVert-BTFxIHaV.js} +1 -1
- package/dist/assets/{OpenInNew-DANSXvoN.js → OpenInNew-BWbkYWxs.js} +1 -1
- package/dist/assets/{Pagination-CW1tLZTw.js → Pagination-CvW6Pm78.js} +1 -1
- package/dist/assets/{PlayArrow-BqJmPwGX.js → PlayArrow-PtLuQObP.js} +1 -1
- package/dist/assets/{QuestionMarkCircle-DbMAv-OF.js → QuestionMarkCircle-Deiz5Rc3.js} +1 -1
- package/dist/assets/{RadioGroup-CDcTFsOU.js → RadioGroup-Go7EuXBQ.js} +1 -1
- package/dist/assets/{Search-Cb1nmmjY.js → Search-CbL27Q7U.js} +1 -1
- package/dist/assets/{Select-DTam9nL9.js → Select-DUGjpI0N.js} +1 -1
- package/dist/assets/{ServerLogo-VspnGmWN.js → ServerLogo-DWPLCv8y.js} +1 -1
- package/dist/assets/{Skeleton-DyvBCeAS.js → Skeleton-BY3oxWsr.js} +1 -1
- package/dist/assets/{Slider-DsbZ_-QY.js → Slider-Bi1zs913.js} +1 -1
- package/dist/assets/{Stepper-DMLaOhco.js → Stepper-uK2JpL--.js} +1 -1
- package/dist/assets/{TextField-CAingS4F.js → TextField-BiJ3RQiw.js} +1 -1
- package/dist/assets/{Toolbar-Ba71DWfj.js → Toolbar-DDNMlPZf.js} +1 -1
- package/dist/assets/{ViewList-Bh9I-lWt.js → ViewList-Dh4E6yfK.js} +1 -1
- package/dist/assets/{access-control-D3kjs-IE.js → access-control-CgbuXgI-.js} +1 -1
- package/dist/assets/{actions-BOLUq2A2.js → actions-BAcMW3DB.js} +1 -1
- package/dist/assets/{add-component-core-DGNddTen.js → add-component-core-B2J7jCBj.js} +1 -1
- package/dist/assets/{add-resource-BlH3Ovxj.js → add-resource-DzhP3aLp.js} +1 -1
- package/dist/assets/{addon-aGvhlN0P.js → addon-CddIIloI.js} +1 -1
- package/dist/assets/{analytics-CfjcdhJn.js → analytics-DpEdpBg-.js} +1 -1
- package/dist/assets/api-LCPZdy3r.js +1 -0
- package/dist/assets/{audit-logs-C2yJwJoT.js → audit-logs-CpDEAQjL.js} +1 -1
- package/dist/assets/{button-DO4YWFoY.js → button-CcPpUnKG.js} +1 -1
- package/dist/assets/{click-to-copy-DJDkDoFa.js → click-to-copy-DtOMfCfh.js} +1 -1
- package/dist/assets/{complete-Z1oVJqCJ.js → complete-B0JqZgYL.js} +1 -1
- package/dist/assets/{component-C5xivMnX.js → component-DgsF1k-M.js} +1 -1
- package/dist/assets/{config-D8NcxsCJ.js → config-C5tFszp6.js} +1 -1
- package/dist/assets/{config-DzEwmXeE.js → config-Dmf2xbNQ.js} +1 -1
- package/dist/assets/{config-navigation-DXtDkZPJ.js → config-navigation-D1ns7E7n.js} +1 -1
- package/dist/assets/{confirm-CCQa70Pg.js → confirm-B7pqTTSN.js} +1 -1
- package/dist/assets/{connect-HhhJ8sJU.js → connect-DbFTOOeI.js} +1 -1
- package/dist/assets/{connect-CFfUvh6W.js → connect-GHjJ7J_-.js} +1 -1
- package/dist/assets/{connect-to-CsOTOOql.js → connect-to-Cd3wBWCK.js} +1 -1
- package/dist/assets/{content-layout-KTIX9N0P.js → content-layout-D5ZvSsu-.js} +1 -1
- package/dist/assets/{dashboard-CjhX-KyD.js → dashboard-Cup1mVAX.js} +3 -3
- package/dist/assets/{did-address-1DufLas8.js → did-address-Ciyb1jN9.js} +1 -1
- package/dist/assets/{domain-BH5br6Gm.js → domain-DGXGl0S1.js} +1 -1
- package/dist/assets/{domain-list-DgurQoPj.js → domain-list-Q2-sRfSu.js} +1 -1
- package/dist/assets/{exchange-passport-CSmkZvXv.js → exchange-passport-B-jGlSuV.js} +1 -1
- package/dist/assets/{fallback-D28RgUKE.js → fallback-DA2HQbL8.js} +1 -1
- package/dist/assets/{format-error-B_wxv2zr.js → format-error-Db99DYGG.js} +1 -1
- package/dist/assets/{fuel-CNhdnIoV.js → fuel-KUOmAMY5.js} +1 -1
- package/dist/assets/{fullpage-BRECd_vA.js → fullpage-CpHiInve.js} +1 -1
- package/dist/assets/{home-BXIAeBXu.js → home-Dgp9XlAL.js} +1 -1
- package/dist/assets/{iframe-B-fn-3dw.js → iframe-D5srTSG3.js} +1 -1
- package/dist/assets/{index-D6tt3ThR.js → index-B-wURug7.js} +1 -1
- package/dist/assets/{index-_XoWFr4l.js → index-B5ijpvD9.js} +1 -1
- package/dist/assets/{index-BtOgY8Si.js → index-BATO4pBH.js} +1 -1
- package/dist/assets/{index-BoZ_m36k.js → index-BFruBwjT.js} +1 -1
- package/dist/assets/{index-DQ0JJK46.js → index-BKhaY6h3.js} +1 -1
- package/dist/assets/{index-CBLTqEyl.js → index-BQHcS9Mc.js} +1 -1
- package/dist/assets/{index-UJL5oKk6.js → index-Be5Rna_o.js} +1 -1
- package/dist/assets/{index-BvFufyUR.js → index-BeM0EvDH.js} +1 -1
- package/dist/assets/{index-1TKZmlYx.js → index-BjkxCT5R.js} +1 -1
- package/dist/assets/{index-5OJNH84k.js → index-BqThu2uY.js} +1 -1
- package/dist/assets/{index-B_Laf8x-.js → index-BqtJq3EF.js} +1 -1
- package/dist/assets/{index-BA1QGlP2.js → index-C4As0bgL.js} +1 -1
- package/dist/assets/{index-DsmWg2lB.js → index-C7GXSvdc.js} +1 -1
- package/dist/assets/{index-D8AdT2zW.js → index-CCPa-_3P.js} +1 -1
- package/dist/assets/{index-BF0CESCe.js → index-CCsWG3Cf.js} +1 -1
- package/dist/assets/{index-CQUsDYvK.js → index-CF_vZ6wr.js} +1 -1
- package/dist/assets/{index-Dukr6y8O.js → index-CMSC7IoC.js} +1 -1
- package/dist/assets/{index-Xy0LtaLl.js → index-CvQpkp6C.js} +8 -8
- package/dist/assets/{index-DMlhjmgb.js → index-D8wABV60.js} +1 -1
- package/dist/assets/{index-BkLBINVg.js → index-D90jUSrf.js} +1 -1
- package/dist/assets/{index-Bt1TfDKC.js → index-DFffafJk.js} +3 -3
- package/dist/assets/{index-cDbrdIwr.js → index-DTXVlwdz.js} +1 -1
- package/dist/assets/{index-C1wiOWNR.js → index-DX4QcWTB.js} +1 -1
- package/dist/assets/{index-p4L0PsMe.js → index-Db3ZRDws.js} +1 -1
- package/dist/assets/{index-2sS76gNV.js → index-DeMjTJxJ.js} +1 -1
- package/dist/assets/{index-CVQzF2HG.js → index-DsUxvQoO.js} +1 -1
- package/dist/assets/{index-CuyRGb9b.js → index-i5ly4LjU.js} +1 -1
- package/dist/assets/{index-oNPd0xkl.js → index-iByZOC72.js} +1 -1
- package/dist/assets/{index-Nl6bSX_8.js → index-m4ukMT05.js} +1 -1
- package/dist/assets/{index-B6cedsbc.js → index-q-zqQDlr.js} +1 -1
- package/dist/assets/{index-oShJbI4-.js → index-tfeZTZg0.js} +1 -1
- package/dist/assets/{index-CbOg486P.js → index-xJBv_VjQ.js} +4 -4
- package/dist/assets/{index.es-yj9zXjEg.js → index.es-B4WvF3X_.js} +1 -1
- package/dist/assets/{index.esm-r-7-JiBo.js → index.esm-Bv05oeeV.js} +1 -1
- package/dist/assets/{invitation-DRE8PTvm.js → invitation-D18tWyxu.js} +1 -1
- package/dist/assets/{invite-CaYV6_RL.js → invite-BMGqQLM9.js} +1 -1
- package/dist/assets/{issue-passport-C2VOdt0F.js → issue-passport-BEiivf0H.js} +1 -1
- package/dist/assets/{item-DSUSjxqu.js → item-BNkHJk4v.js} +1 -1
- package/dist/assets/{jss-plugin-props-sort.esm-Dy1hd-li.js → jss-plugin-props-sort.esm-TYQD_Idh.js} +1 -1
- package/dist/assets/{launch-result-message-DzKfmlIC.js → launch-result-message-wF7nzrW2.js} +1 -1
- package/dist/assets/{layout-DYha6CGi.js → layout-BOuDTjaq.js} +1 -1
- package/dist/assets/{list-header-senytC6o.js → list-header-xLJ1AFDh.js} +1 -1
- package/dist/assets/localization-CMb7_NwM.js +1 -0
- package/dist/assets/{log-BjP_dVJO.js → log-C_IQfpA6.js} +1 -1
- package/dist/assets/{login-bqoHKvms.js → login-CKynPt3S.js} +1 -1
- package/dist/assets/{login-oauth-callback-VOvATSQP.js → login-oauth-callback-DlPkWbQy.js} +1 -1
- package/dist/assets/{logo-uploader-DzWvnC_0.js → logo-uploader-fiB12uqZ.js} +3 -3
- package/dist/assets/{lost-passport-CU19a36i.js → lost-passport-CFO2cLSb.js} +3 -3
- package/dist/assets/{lottie-CBo6NH73.js → lottie-DJwtX3kw.js} +1 -1
- package/dist/assets/{notifications-Bg5czab0.js → notifications-CIe1Wbve.js} +1 -1
- package/dist/assets/{open-window-DO7_5i09.js → open-window-BmdrOwtb.js} +1 -1
- package/dist/assets/{overview-B2c4iIHr.js → overview-_WReVOO5.js} +1 -1
- package/dist/assets/{page-header-DWho4RBI.js → page-header-qGr3Urx0.js} +1 -1
- package/dist/assets/{permission-C5oFkeWC.js → permission-CTtuDV7x.js} +1 -1
- package/dist/assets/{preferences-tBLYqHP5.js → preferences-DTNd1Hzy.js} +1 -1
- package/dist/assets/publish-resource-tL30wKL2.js +1 -0
- package/dist/assets/{react-D1bqTbo3.js → react-D5g67fVw.js} +3 -3
- package/dist/assets/{redux-D4hIeGdy.js → redux-CFX_KgA-.js} +1 -1
- package/dist/assets/{resource-dialog-BTjR0zMl.js → resource-dialog-PcDAyoWb.js} +1 -1
- package/dist/assets/sdk-DH6Qg9cJ.js +1 -0
- package/dist/assets/{selector-BqPqCAYg.js → selector-lupSMMbD.js} +1 -1
- package/dist/assets/session-DUaMqnH_.js +1 -0
- package/dist/assets/{setup-BTfTULzr.js → setup-DsNNvMHM.js} +3 -3
- package/dist/assets/{shorten-label-CntVgEf1.js → shorten-label-nc4Gz0wo.js} +1 -1
- package/dist/assets/{slicedToArray-C_FN0n4-.js → slicedToArray-D8wLvMFk.js} +1 -1
- package/dist/assets/{spaces-CGSqFLCZ.js → spaces-6dcXbeW4.js} +1 -1
- package/dist/assets/{start-DZT6N3WF.js → start-BZKaBE0Q.js} +1 -1
- package/dist/assets/{step-actions-CRpayBME.js → step-actions-DrkmJABm.js} +1 -1
- package/dist/assets/{studio-LU_tLoHp.js → studio-BEeqozxg.js} +1 -1
- package/dist/assets/{switch-control-C_KVSzuu.js → switch-control-CjEJidzr.js} +1 -1
- package/dist/assets/{toUpper-hmLNaDVt.js → toUpper-Ccj-rFez.js} +1 -1
- package/dist/assets/{transfer-jecpNDUN.js → transfer-D9kO5yaP.js} +1 -1
- package/dist/assets/{uniqBy-u0Jb0nbX.js → uniqBy-BJ4Rz_fc.js} +1 -1
- package/dist/assets/{unsubscribe-DCA8xtgF.js → unsubscribe-C1coPrfE.js} +1 -1
- package/dist/assets/{url-join-D2KH-zKC.js → url-join-F3HDi_f9.js} +1 -1
- package/dist/assets/{use-blocklet-info-for-connect-did-spaces-SRd5l8_C.js → use-blocklet-info-for-connect-did-spaces-Enuu3Koa.js} +1 -1
- package/dist/assets/{use-mobile-DFiNHQ2u.js → use-mobile-E62R3PvF.js} +1 -1
- package/dist/assets/{useAsync-R-TUNvpI.js → useAsync-D88Uwkbh.js} +1 -1
- package/dist/assets/{useFormControl-BbOnEHs0.js → useFormControl-CVJHU3Z8.js} +1 -1
- package/dist/assets/{useLocalStorage-DaDlKYRB.js → useLocalStorage-ir8uP4g6.js} +1 -1
- package/dist/assets/{useSetState-B7OpsWvA.js → useSetState-Bsisx7wb.js} +1 -1
- package/dist/assets/{useSlot-CQyOPTl1.js → useSlot-Lnh_3w1R.js} +1 -1
- package/dist/assets/{useSlotProps-CNnGAX_a.js → useSlotProps-CvpMe4Jk.js} +1 -1
- package/dist/assets/{useThemeProps-CXkqPLv1.js → useThemeProps-CDhmnq0d.js} +1 -1
- package/dist/assets/{user-center-DSzC5Cpf.js → user-center-DN7iYr7s.js} +1 -1
- package/dist/assets/{user-sessions-D3vy4DLu.js → user-sessions-Byj0rQDW.js} +1 -1
- package/dist/assets/{util-BSRiBZPY.js → util-Bv3X6aF1.js} +1 -1
- package/dist/assets/{wrap-locale-_-JNBxLM.js → wrap-locale-DqkY5JLX.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +18 -18
- package/dist/assets/api-rSkpRnMk.js +0 -1
- package/dist/assets/localization-DnfHLBQ3.js +0 -1
- package/dist/assets/publish-resource-C-TPeUnS.js +0 -1
- package/dist/assets/sdk-CTZgkudu.js +0 -1
- package/dist/assets/session-qS7z5tiM.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{cs as J,aZ as N,r as x,aQ as P,bX as ve,t as v,ab as K,u as O,j as e,P as f,eY as Ke,c4 as le,c as V,fl as Ve,T as y,B as j,K as de,av as Ge,a3 as te,n as Z,a0 as ke,a2 as Xe,gG as We,Z as ne,$ as oe,aU as _,fk as Ye,aD as qe,aS as _e,a1 as $e,U as et,b_ as tt,cx as st,G as M,bh as q,a as nt,gH as ot,C as at,bH as it}from"./index-Xy0LtaLl.js";import{S as ye}from"./index-oNPd0xkl.js";import"./api-rSkpRnMk.js";import{u as Ie,P as rt}from"./use-blocklet-info-for-connect-did-spaces-SRd5l8_C.js";import{b as ct,h as lt,d as se,e as Se,f as dt,i as Ae,j as pt,k as ut,l as Ce,c as ht}from"./spaces-CGSqFLCZ.js";import{f as G,D as mt}from"./format-error-B_wxv2zr.js";import{T as ft}from"./TextField-CAingS4F.js";import{A as xt}from"./Alert-ClYwyZJt.js";import{I as gt}from"./index-5OJNH84k.js";import{W as jt}from"./did-address-1DufLas8.js";import{S as De}from"./switch-control-C_KVSzuu.js";import{d as yt}from"./MoreHoriz-_DaP4AK8.js";import{d as St}from"./DeleteOutline-Brfidl3M.js";import{L as $,a as ee}from"./ListItemText-tl-KE_u8.js";import{e as At}from"./mode-B2dWMeTO.js";import{T as ce}from"./index-CuyRGb9b.js";import{D as Ct}from"./index-DQ0JJK46.js";import{L as Bt}from"./Link-AzDxZ12K.js";import{G as Be}from"./redux-D4hIeGdy.js";import"./ExpandMore-Bpwbf5LO.js";import"./ButtonGroup-DFgjZ6az.js";import"./CloseOutlined-DMNRl8D0.js";import"./index-BtOgY8Si.js";import"./FormControl-BS53BBfk.js";import"./useFormControl-BbOnEHs0.js";import"./InputLabel-vEy8Wv5K.js";import"./Select-DTam9nL9.js";import"./useSlot-CQyOPTl1.js";import"./index-UJL5oKk6.js";import"./FormControlLabel-CpXvhTph.js";import"./FilterList-8uDifo29.js";import"./useThemeProps-CXkqPLv1.js";import"./toPropertyKey-PLuKRk1e.js";import"./FormGroup-CQJX8jMa.js";import"./index-B6cedsbc.js";import"./LastPage-CG3UlSnN.js";import"./Toolbar-Ba71DWfj.js";import"./index-cDbrdIwr.js";import"./Search-Cb1nmmjY.js";import"./Delete-uLZyjAyH.js";import"./index-BF0CESCe.js";import"./MoreVert-CxoveKS9.js";async function vt({blockletDid:t,nodeApi:s,spaceGateways:a}){let n=!1;const l=await Promise.all(a.map(async c=>{let{name:o}=c;const r=await ct(c.endpoint);return!J.isEmpty(r)&&r!==o&&(o=r,n=!0),{...c,name:o}}));return n&&await Promise.all(l.filter(c=>c.did).map(c=>s.updateBlockletSpaceGateway({input:{did:t,where:{did:c.did},spaceGateway:{...c}}}))),l}function kt({setLoading:t,refresh:s}={}){var r;const{blocklet:a}=N(),n=(r=a==null?void 0:a.meta)==null?void 0:r.did,[l,c]=x.useState([]),{api:o}=P();return ve(async()=>{try{if(!n){c([]);return}t==null||t(!0);const{spaceGateways:d}=await o.getBlockletSpaceGateways({input:{did:n}}),p=await vt({blockletDid:n,nodeApi:o,spaceGateways:d});c(p??[])}catch(d){console.error(d),v.error(G(d))}finally{t==null||t(!1)}},[n,s]),{spaceGateways:l}}function Ee({deps:t,setLoading:s}={deps:[],setLoading:()=>{}}){var r;const{blocklet:a}=N(),[n,l]=x.useState([]),{api:c}=P(),o=J.debounce(async()=>{try{if(s(!0),!a){l([]);return}const{backups:d}=await c.getBlockletBackups({input:{did:a.meta.did}});l(d??[])}catch(d){console.error(d),v.error(G(d))}finally{s(!1)}},2e3);return ve(async()=>{o()},[(r=a==null?void 0:a.meta)==null?void 0:r.did].concat(t)),{backups:n}}function It({appDid:t}){const{backups:s}=Ee(),[a,n]=x.useState({message:"",progress:0,completed:!1}),l=P(),{ws:{useSubscription:c}}=l;return c(K.BlockletEvents.backupProgress,o=>{t===(o==null?void 0:o.appDid)&&n(()=>({...o}))},[t]),x.useEffect(()=>{var o;if(s!=null&&s.length&&J.isNull((o=s[0])==null?void 0:o.status)){const[r]=s;n(()=>({message:r.message,progress:r.progress,completed:r.progress>=100}))}},[s]),a}const Ue=x.createContext({}),{Provider:Dt,Consumer:Rs}=Ue;function pe({children:t}){var C;const{t:s}=O(),{api:a}=P(),{blocklet:n}=N(),[l,c]=x.useState(!1),[o,r]=x.useState(!1),{spaceGateways:d}=kt({refresh:o,setLoading:c}),p=It({appDid:n==null?void 0:n.appDid}),[m,D]=x.useState(!1),S=x.useMemo(()=>lt(n==null?void 0:n.environments),[n,o,m]),[g,A]=x.useState(!1),{backups:k}=Ee({deps:[p],setLoading:A}),[H,I]=x.useState(d==null?void 0:d.find(i=>i.endpoint===S)),E=(C=n==null?void 0:n.settings)==null?void 0:C.autoBackup,u=()=>{r(i=>!i)},F=()=>{D(i=>!i)},U=async i=>{await a.updateAutoBackup({input:{did:n.meta.did,autoBackup:i}})},R=async(i,b)=>{d.push({...i,loading:!0}),await a.addBlockletSpaceGateway({input:{did:n.meta.did,spaceGateway:i}}),S!==b&&await a.configBlocklet({input:{did:[n.meta.did],configs:[{key:K.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:b}]}}),u(),I(i)},B=async i=>{i&&(i.endpoint===S&&(await a.configBlocklet({input:{did:[n.meta.did],configs:[{key:K.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),E!=null&&E.enabled&&await U({enabled:!1})),await a.deleteBlockletSpaceGateway({input:{did:n.meta.did,spaceGatewayDid:i==null?void 0:i.did}}),u(),I(i))},T=async i=>{await a.updateBlockletSpaceGateway({input:{did:n.meta.did,where:{did:i.did},spaceGateway:i}}),S!==i.endpoint&&await a.configBlocklet({input:{did:[n.meta.did],configs:[{key:K.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:i.endpoint}]}}),v.success(s("storage.spaces.connectedWithName",{name:(i==null?void 0:i.name)??"DID Spaces"})),u()},h=i=>(i==null?void 0:i.endpoint)===S;return e.jsx(Dt,{value:{spaceGateways:d,selectedSpaceGateway:H,addSpaceGateway:R,deleteSpaceGateway:B,updateSpaceGateway:T,refreshSpaceGateways:u,spaceGatewaysLoading:l,spaceGatewayIsSelected:h,updateAutoBackup:U,backupEndpoint:S,backupProgress:p,backups:k,backupsLoading:g,refreshBackupEndpoint:F,autoBackup:E},children:t})}pe.propTypes={children:f.any.isRequired};pe.defaultProps={};function Q(){return x.useContext(Ue)}function ae({...t}){const{blocklet:s}=N(),{info:a}=P(),{t:n,locale:l}=O(),[c,o]=x.useState(""),[r,d]=x.useState(!1),[p,m]=x.useState(!1),[D,S]=x.useState(""),g=Ie({blocklet:s}),A=Ke(a),{spaceGateways:k,addSpaceGateway:H}=Q(),[I,E]=x.useState({open:!1,action:"connect-to-did-spaces",checkTimeout:1e3*300,checkFn:le.create({baseURL:V(window.location.origin,Ve())}).get,messages:{title:n("storage.spaces.provideNFT.title",{appName:g.appName},l),scan:n("storage.spaces.provideNFT.scan",{appName:g.appName},l),confirm:"",success:e.jsx(y,{gutterBottom:!0,children:n("storage.spaces.provideNFT.success")})},onClose:()=>{E(h=>({...h,open:!1}))}}),[u,F]=x.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:n("storage.spaces.authorize.title",{appName:g.appName},l),scan:n("storage.spaces.authorize.scan",{appName:g.appName},l),confirm:"",success:e.jsx(y,{gutterBottom:!0,children:n("storage.spaces.authorize.success")})},onClose:()=>{F(h=>({...h,open:!1}))}}),U=async({endpoint:h,name:C,did:i})=>{const b=await Se(h);if(!await Ae(b)){v.error(n("storage.spaces.gateway.add.invalidUrl"));return}if(k.some(W=>W.endpoint===h)){v.error(n("storage.spaces.gateway.add.duplicate",{name:C}));return}const L={name:C,did:i,url:b,endpoint:h};await H(L,h),v.success(n("storage.spaces.connectedWithName",{name:(L==null?void 0:L.name)??"DID Spaces"}))},R=async(h,C)=>{try{if(!J.isEmpty(h.spaceGateway))await U(C(h.spaceGateway));else{const i=C(h.endpoint),b=h.space?C(h.space):{};await U({endpoint:i,did:se(i),name:"DID Space",...b})}F(i=>({...i,open:!1})),o(null),E(i=>({...i,open:!1}))}catch(i){console.error(i),v.error(G(i))}},B=()=>{E(h=>({...h,open:!0,extraParams:{appPid:s.appPid,appName:g.appName,appDescription:g.appDescription,scopes:g.scopes,appUrl:g.appUrl,referrer:g.referrer,nodeDid:a.did}}))},T=async()=>{try{d(!0);const h=await Se(c),C=dt(h),i=new URL(h).searchParams.get("spaceDid");if(!await Ae(C))throw new Error(n("storage.spaces.gateway.add.invalidUrl"));F(b=>({...b,open:!0,prefix:V(C,"space/api/did"),baseUrl:new URL(C).origin,checkFn:le.create({baseURL:V(C,"space")}).get,extraParams:{appDid:g.appDid,appName:g.appName,appDescription:g.appDescription,scopes:g.scopes,appUrl:g.appUrl,referrer:g.referrer,nodeDid:a.did,spaceDid:i}})),m(!1)}catch(h){const C=`${n("storage.spaces.gateway.add.failed",l)}: ${G(h)}`;S(C)}finally{d(!1)}};return e.jsxs(j,{children:[e.jsx(ye,{color:"primary",style:{textTransform:"none !important",fontSize:"1rem"},size:"small",onClick:B,menu:[e.jsx(ye.Item,{sx:{textTransform:"none"},onClick:()=>m(!0),size:"small",...t,children:n("storage.spaces.connect.useSpaceGateway")},"1")],children:e.jsx(y,{sx:{fontWeight:"bold",textTransform:"none"},children:n("storage.spaces.connect.useWallet")})}),e.jsx(de,{forceConnected:!1,saveConnect:!1,prefix:I.prefix,open:I.open,popup:!0,action:I.action,webWalletUrl:A,baseUrl:I.baseUrl,checkFn:I.checkFn,onSuccess:R,onClose:I.onClose,checkTimeout:I.checkTimeout,extraParams:I.extraParams,messages:I.messages,locale:l}),e.jsx(de,{forceConnected:!1,saveConnect:!1,prefix:u.prefix,open:u.open,popup:!0,action:u.action,baseUrl:u.baseUrl,checkFn:u.checkFn,onSuccess:R,onClose:u.onClose,checkTimeout:u.checkTimeout,extraParams:u.extraParams,messages:u.messages,locale:l}),e.jsxs(Ge,{title:n("storage.spaces.gateway.add.title"),fullWidth:!0,maxWidth:"md",open:p,onClose:()=>m(!1),PaperProps:{style:{minHeight:"auto"}},actions:e.jsxs(e.Fragment,{children:[e.jsx(te,{onClick:h=>{h.stopPropagation(),m(!1)},color:"inherit",children:n("common.cancel")}),e.jsxs(te,{onClick:T,color:"primary",disabled:r||!c,variant:"contained",autoFocus:!0,children:[r&&e.jsx(Z,{size:16}),n("common.confirm")]})]}),children:[e.jsx("div",{style:{paddingTop:12,overflowY:"hidden"},children:e.jsx(mt,{component:"div",children:e.jsx(y,{component:"div",children:e.jsx(ft,{label:n("storage.spaces.gateway.add.label"),autoComplete:"off",variant:"outlined",name:"url",fullWidth:!0,value:c,onChange:h=>{S(null),o(h.target.value)},disabled:r,onKeyPress:async h=>{h.key==="Enter"&&await T()},autoFocus:!0})})})}),!!D&&e.jsx(xt,{severity:"error",style:{width:"100%"},children:D})]})]})}ae.propTypes={};ae.defaultProps={};function be({...t}){const{t:s}=x.useContext(Xe),{blocklet:a,loadingDiskInfo:n,actions:l}=N();if(x.useEffect(()=>{l.refreshBlocklet({showError:!1,attachDiskInfo:!0})},[]),a.diskInfo){const c=(d,p,m)=>e.jsxs(y,{children:[d," ",e.jsx("strong",{children:p?We(p):"empty"})]}),o=a.environments.reduce((d,p)=>(d[p.key]=p.value,d),{}),r=[{key:"appDir",name:s("blocklet.diskInfo.appDir"),value:c(o.BLOCKLET_APP_DIR,a.diskInfo.app)},{key:"dataDir",name:s("blocklet.diskInfo.dataDir"),value:c(o.BLOCKLET_DATA_DIR,a.diskInfo.data)},{key:"logDir",name:s("blocklet.diskInfo.logDir"),value:c(o.BLOCKLET_LOG_DIR,a.diskInfo.log)},{key:"cacheDir",name:s("blocklet.diskInfo.cacheDir"),value:c(o.BLOCKLET_CACHE_DIR,a.diskInfo.cache)}];return e.jsx(Et,{component:"div",...t,children:r.map(d=>e.jsx(gt,{valueComponent:"div",nameWidth:120,name:d.name,children:d.value},d.key))})}return n?e.jsx(Z,{}):e.jsx(y,{children:s("blocklet.diskInfo.empty")})}const Et=ke(y)``;var we=function(s){return e.jsxs("svg",{...s,children:[e.jsxs("g",{filter:"url(#a)",children:[e.jsx("path",{d:"M56.97 2a12 12 0 0 0-8.485 3.515l-40.97 40.97A12 12 0 0 0 4 54.971V240c0 6.627 5.373 12 12 12h196c6.627 0 12-5.373 12-12V14c0-6.627-5.373-12-12-12H56.97Z",fill:"#DDD"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m49.192 6.222-40.97 40.97A11 11 0 0 0 5 54.971V240c0 6.075 4.925 11 11 11h196c6.075 0 11-4.925 11-11V14c0-6.075-4.925-11-11-11H56.97a11 11 0 0 0-7.778 3.222Zm-.707-.707A12 12 0 0 1 56.971 2H212c6.627 0 12 5.373 12 12v226c0 6.627-5.373 12-12 12H16c-6.627 0-12-5.373-12-12V54.97a12 12 0 0 1 3.515-8.485l40.97-40.97Z",fill:"#000",fillOpacity:".08"}),e.jsx("mask",{id:"b",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"4",y:"2",width:"220",height:"250",children:e.jsx("path",{d:"M56.97 2a12 12 0 0 0-8.485 3.515l-40.97 40.97A12 12 0 0 0 4 54.971V240c0 6.627 5.373 12 12 12h196c6.627 0 12-5.373 12-12V14c0-6.627-5.373-12-12-12H56.97Z",fill:"#D9D9D9"})}),e.jsxs("g",{mask:"url(#b)",children:[e.jsx("path",{opacity:".5",fill:"url(#c)",d:"M4 2h220v128H4z"}),e.jsx("path",{opacity:".1",fill:"url(#d)",d:"M4 130h220v122H4z"}),e.jsx("path",{d:"M33.045 169h-3.767v-11.636h3.887c1.14 0 2.12.233 2.937.698a4.61 4.61 0 0 1 1.881 1.995c.44.863.659 1.899.659 3.108 0 1.212-.222 2.254-.665 3.125a4.668 4.668 0 0 1-1.909 2.011c-.833.466-1.84.699-3.023.699Zm-2.01-1.534h1.914c.886 0 1.623-.167 2.21-.5a3.152 3.152 0 0 0 1.318-1.46c.292-.64.438-1.421.438-2.341 0-.913-.146-1.688-.438-2.324a3.095 3.095 0 0 0-1.29-1.449c-.572-.33-1.282-.494-2.13-.494h-2.023v8.568Zm11.546-10.102V169h-1.756v-11.636h1.756ZM48.905 169h-3.767v-11.636h3.886c1.14 0 2.12.233 2.938.698a4.609 4.609 0 0 1 1.88 1.995c.44.863.66 1.899.66 3.108 0 1.212-.222 2.254-.665 3.125a4.667 4.667 0 0 1-1.91 2.011c-.833.466-1.84.699-3.022.699Zm-2.011-1.534h1.914c.887 0 1.623-.167 2.21-.5a3.151 3.151 0 0 0 1.319-1.46c.291-.64.437-1.421.437-2.341 0-.913-.146-1.688-.437-2.324a3.095 3.095 0 0 0-1.29-1.449c-.572-.33-1.282-.494-2.13-.494h-2.023v8.568Zm20.372-7.046a1.662 1.662 0 0 0-.75-1.25c-.44-.299-.993-.448-1.66-.448-.477 0-.89.075-1.238.227a1.91 1.91 0 0 0-.813.613c-.189.258-.284.552-.284.881 0 .277.065.515.194.716.132.201.304.369.516.506.216.132.447.244.694.335.246.087.483.159.71.216l1.136.295c.371.091.752.214 1.142.37.39.155.752.36 1.086.613.333.254.602.568.806.944.209.374.313.823.313 1.346 0 .659-.17 1.244-.511 1.756-.338.511-.828.915-1.472 1.21-.64.295-1.415.443-2.324.443-.871 0-1.625-.138-2.261-.415-.637-.276-1.135-.668-1.495-1.176-.36-.511-.558-1.117-.596-1.818h1.761c.034.421.17.771.41 1.051.242.277.55.483.925.62.38.132.794.198 1.245.198.496 0 .937-.077 1.324-.233.39-.159.697-.378.92-.659a1.56 1.56 0 0 0 .335-.994c0-.345-.098-.627-.295-.847a2.191 2.191 0 0 0-.79-.545 7.725 7.725 0 0 0-1.12-.381l-1.374-.375c-.932-.253-1.67-.627-2.216-1.119-.542-.492-.813-1.144-.813-1.955 0-.67.182-1.255.546-1.755.363-.5.856-.888 1.477-1.165.621-.28 1.322-.42 2.102-.42.788 0 1.483.138 2.085.414.607.277 1.084.658 1.432 1.142.349.481.53 1.034.546 1.659h-1.693Zm3.813 11.853v-12h1.66v1.415h.142c.098-.182.24-.393.426-.631.185-.239.443-.447.772-.625.33-.182.766-.273 1.307-.273.705 0 1.334.178 1.887.534.553.356.987.869 1.3 1.54.319.67.478 1.477.478 2.42 0 .944-.157 1.752-.472 2.427-.314.67-.746 1.187-1.295 1.551-.55.36-1.176.539-1.88.539-.53 0-.965-.089-1.302-.267a2.457 2.457 0 0 1-.784-.625 4.667 4.667 0 0 1-.437-.636h-.103v4.631H71.08Zm1.665-7.637c0 .614.09 1.152.267 1.614.178.462.436.824.773 1.085.337.258.75.387 1.239.387.507 0 .931-.135 1.273-.404.34-.273.598-.642.772-1.108.178-.466.267-.99.267-1.574 0-.575-.087-1.092-.261-1.551-.17-.458-.428-.82-.773-1.085-.34-.265-.767-.398-1.278-.398-.493 0-.91.127-1.25.381-.337.254-.593.608-.767 1.062-.175.455-.262.985-.262 1.591Zm10.75 4.557a3.557 3.557 0 0 1-1.5-.307 2.523 2.523 0 0 1-1.062-.903c-.258-.394-.386-.877-.386-1.449 0-.492.094-.898.283-1.216.19-.318.446-.57.768-.756a4.036 4.036 0 0 1 1.08-.42c.397-.095.802-.167 1.215-.216l1.273-.148c.325-.041.562-.108.71-.198.148-.091.222-.239.222-.444v-.039c0-.497-.14-.881-.42-1.154-.277-.273-.69-.409-1.24-.409-.572 0-1.022.127-1.352.381-.325.25-.55.528-.676.835l-1.597-.364c.19-.53.466-.958.83-1.284.368-.329.79-.568 1.267-.716.477-.151.98-.227 1.506-.227.348 0 .718.042 1.108.125.394.08.761.227 1.102.443.345.216.627.525.847.926.22.398.33.915.33 1.552V169h-1.66v-1.193h-.068c-.11.22-.275.435-.495.648-.22.212-.501.388-.846.528s-.758.21-1.239.21Zm.37-1.363c.47 0 .87-.093 1.204-.279.337-.185.593-.428.767-.727.178-.303.267-.627.267-.972v-1.125c-.06.061-.178.118-.352.171-.17.049-.365.093-.585.13-.22.034-.434.067-.642.097l-.523.068c-.33.042-.63.112-.903.21a1.553 1.553 0 0 0-.648.427c-.16.181-.239.424-.239.727 0 .42.156.738.466.954.31.212.707.319 1.188.319Zm9.876 1.346c-.845 0-1.572-.191-2.182-.574a3.796 3.796 0 0 1-1.398-1.596c-.325-.678-.488-1.455-.488-2.33 0-.886.166-1.668.5-2.346a3.832 3.832 0 0 1 1.409-1.597c.606-.383 1.32-.574 2.142-.574.663 0 1.254.123 1.773.369.519.243.937.584 1.255 1.023.322.44.514.953.574 1.54h-1.653c-.091-.409-.3-.761-.625-1.057-.322-.295-.754-.443-1.296-.443a2.11 2.11 0 0 0-1.244.375c-.352.246-.627.598-.824 1.057-.197.454-.295.992-.295 1.613 0 .637.096 1.186.29 1.648.193.462.466.82.818 1.074.356.254.774.381 1.255.381.322 0 .614-.059.875-.177.266-.121.487-.293.665-.517.182-.223.309-.492.38-.806h1.654a3.211 3.211 0 0 1-.55 1.511 3.165 3.165 0 0 1-1.234 1.045c-.511.254-1.111.381-1.8.381Zm9.163 0c-.859 0-1.6-.184-2.221-.551a3.732 3.732 0 0 1-1.432-1.563c-.333-.674-.5-1.464-.5-2.369 0-.894.167-1.682.5-2.363a3.887 3.887 0 0 1 1.409-1.597c.606-.383 1.314-.574 2.125-.574.493 0 .97.082 1.432.244.462.163.877.419 1.244.767.368.349.657.802.87 1.358.212.553.318 1.226.318 2.017v.603H99.71v-1.273h5.273c0-.447-.091-.843-.273-1.187a2.052 2.052 0 0 0-.767-.824c-.326-.201-.708-.302-1.148-.302a2.22 2.22 0 0 0-1.25.353 2.364 2.364 0 0 0-.818.909 2.626 2.626 0 0 0-.284 1.21v.994c0 .584.102 1.08.307 1.489.208.409.498.722.869.938.372.212.805.318 1.301.318a2.7 2.7 0 0 0 .881-.137c.265-.094.494-.234.688-.42.193-.186.341-.415.443-.688l1.608.29c-.129.474-.36.888-.693 1.244-.33.353-.745.627-1.245.824-.496.194-1.062.29-1.699.29Z",fill:"#fff"}),e.jsx("path",{d:"M117.604 47.263 121.523 45h14.267v41.862h-14.267l-15.335-8.854V53.854l1.818-1.05 3.2 1.848-1.818 1.05V76.16l12.993 7.502h10.209V48.2h-10.209l-1.577.91-3.2-1.847Z",fill:"url(#e)"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M119.402 76.16V55.701L106.409 48.2H96.2v35.462h10.209l1.582-.913 3.2 1.847-3.924 2.266H93V45h14.267l15.335 8.854v24.154l-1.813 1.046-3.2-1.847 1.813-1.047Z",fill:"url(#f)"}),e.jsxs("g",{clipPath:"url(#g)",fillRule:"evenodd",clipRule:"evenodd",fill:"#fff",children:[e.jsx("path",{d:"m50.928 216.089 1.034 2.852h-2.503l1.028-2.842a4.95 4.95 0 0 0 .107-.338 7.17 7.17 0 0 0 .111-.409c.075.297.15.542.223.737Zm2.28 5.591h.796l-2.775-7.352h-1.043l-2.774 7.352h.795a.338.338 0 0 0 .223-.077.425.425 0 0 0 .127-.179l.615-1.705h3.07l.617 1.705a.399.399 0 0 0 .126.184.339.339 0 0 0 .223.072Zm4.823-.963a2.023 2.023 0 0 1-.67.098h-1.455v-2.453h1.456c.5 0 .871.106 1.11.318.24.208.36.495.36.86 0 .184-.028.355-.083.512a1.005 1.005 0 0 1-.262.399 1.2 1.2 0 0 1-.456.266Zm-2.125-3.128v-2.406h1.237c.498 0 .865.095 1.101.286.236.192.355.497.355.917 0 .369-.125.662-.374.881-.246.215-.623.322-1.13.322h-1.189Zm2.358-3.128a4.106 4.106 0 0 0-1.12-.133h-2.27v7.352h2.507c.391 0 .74-.051 1.048-.154.307-.102.566-.247.776-.435.21-.188.37-.409.48-.665.11-.26.165-.547.165-.861 0-.904-.506-1.462-1.518-1.674.22-.075.41-.169.572-.281a1.79 1.79 0 0 0 .403-.379c.106-.144.186-.297.237-.461.052-.164.078-.335.078-.512a2.1 2.1 0 0 0-.146-.804 1.49 1.49 0 0 0-.441-.609 2.073 2.073 0 0 0-.771-.384Zm7.535.778h-2.212v6.441h-1.028v-6.441h-2.222v-.911H65.8v.911Zm2.439.564h-1.13v1.193h1.13v-1.193Zm-1.13 2.983h1.13v1.193h-1.13v-1.193Z",fillOpacity:".8"}),e.jsx("path",{d:"M28.247 221.771V214h3.894c.99.072 1.765.944 1.765 1.998v3.77c0 1.106-.85 2.003-1.897 2.003h-3.762ZM36.355 214h-1.011v7.783h1.01V214Zm-7.097 6.704v-5.642h2.751c.49 0 .886.419.886.936v3.77c0 .517-.396.936-.886.936h-2.75ZM37.775 214v7.771h3.762c1.047 0 1.897-.897 1.897-2.003v-3.77c0-1.054-.774-1.926-1.765-1.998h-3.894Zm6.946 1.803h1.13v1.193h-1.13v-1.193Zm1.13 2.983h-1.13v1.193h1.13v-1.193Zm-7.065-3.724v5.642h2.75c.49 0 .887-.419.887-.936v-3.77c0-.517-.397-.936-.886-.936h-2.751Z"})]}),e.jsx("circle",{cx:"191.32",cy:"218",r:"10",fill:"url(#h)"}),e.jsx("path",{d:"m192.064 213.333.976-.564h3.554v10.427h-3.286a1 1 0 0 1-.5-.134l-3.588-2.071v-6.016l.453-.262.797.46-.453.262v5.096l3.237 1.868h2.543v-8.833h-2.543l-.393.227-.797-.46Z",fill:"#fff"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M192.512 220.531v-5.096l-3.237-1.869h-2.543v8.833h2.543l.394-.227.797.46-.977.564h-3.554v-10.427h3.554l3.82 2.206v6.016l-.452.261-.797-.461.452-.26Z",fill:"#fff"})]})]}),e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:"d",x1:"114",y1:"130",x2:"114",y2:"252",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#101010"}),e.jsx("stop",{offset:"1",stopColor:"#272727"})]}),e.jsxs("linearGradient",{id:"e",x1:"120.989",y1:"45",x2:"120.989",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#fff",stopOpacity:".4"}),e.jsx("stop",{offset:"1",stopColor:"#fff"})]}),e.jsxs("linearGradient",{id:"f",x1:"107.801",y1:"45",x2:"107.801",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#fff"}),e.jsx("stop",{offset:"1",stopColor:"#fff",stopOpacity:".4"})]}),e.jsxs("radialGradient",{id:"h",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(17 -8.76924 6.97565 13.52294 183.166 221)",children:[e.jsx("stop",{stopColor:"#016BED"}),e.jsx("stop",{offset:".699",stopColor:"#4498FB"}),e.jsx("stop",{offset:"1",stopColor:"#9DFFE8"})]}),e.jsx("clipPath",{id:"g",children:e.jsx("path",{fill:"#fff",transform:"translate(28 214)",d:"M0 0h40.32v8H0z"})}),e.jsx("pattern",{id:"c",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:e.jsx("use",{xlinkHref:"#i",transform:"scale(.00455 .00781)"})}),e.jsxs("filter",{id:"a",x:"0",y:"0",width:"228",height:"258",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[e.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),e.jsx("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),e.jsx("feOffset",{dy:"2"}),e.jsx("feGaussianBlur",{stdDeviation:"2"}),e.jsx("feComposite",{in2:"hardAlpha",operator:"out"}),e.jsx("feColorMatrix",{values:"0 0 0 0 0.0631944 0 0 0 0 0.242785 0 0 0 0 0.403472 0 0 0 0.2 0"}),e.jsx("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_1410_22507"}),e.jsx("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_1410_22507",result:"shape"})]}),e.jsx("image",{id:"i",width:"220",height:"128",xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANwAAACABAMAAACSOBo+AAAAG1BMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACUUeIgAAAACXRSTlMSFhkOHAsfCCOMH5MiAAAjjElEQVRo3hTQO3sjRRBG4a+qWzJhVfdIJqzuGX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5s3i7BqLbFkKcfxLQYhAXfjam0yFFd3PZE9wlXWfHYKlg2cFlTcnwRH6z8DpSfQHidMhElmCMb07li9ceHQHFknk/98f4KJRLpX6xQEXVAnJxlr8Aw6/qb0wu9SNolstScB0izxmMC5DiytBJd9Rcm3RGf42aiddmUTM4d4dgdjiT+vMPX0/RzfZdLoZ4aQqPzhx9plNI3QyvsMZHn2j2wOECoTtkfJt89O+eYUnXB/gFxHxPmOeL9ogAAAABJRU5ErkJggg=="})]})]})};we.defaultProps={width:"228",height:"258",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"};function Re(){const{t}=O();return e.jsxs(j,{children:[e.jsxs(j,{minHeight:"40vh",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",children:[e.jsx(we,{style:{width:250,height:250}}),e.jsx(y,{marginTop:"24px",marginBottom:"24px",children:t("storage.spaces.connect.provider")}),e.jsx(ae,{})]}),e.jsx(y,{fontSize:"1.2rem",fontWeight:"bold",mb:2,children:t("common.dataStorage")}),e.jsx(be,{})]})}Re.propTypes={};var ue={},Ut=oe;Object.defineProperty(ue,"__esModule",{value:!0});var Te=ue.default=void 0,bt=Ut(ne()),wt=e;Te=ue.default=(0,bt.default)((0,wt.jsx)("path",{d:"M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z"}),"ArrowOutward");var he={},Rt=oe;Object.defineProperty(he,"__esModule",{value:!0});var Oe=he.default=void 0,Tt=Rt(ne()),Ot=e;Oe=he.default=(0,Tt.default)((0,Ot.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"}),"ElectricBoltOutlined");var me={},Ft=oe;Object.defineProperty(me,"__esModule",{value:!0});var Fe=me.default=void 0,Lt=Ft(ne()),Mt=e;Fe=me.default=(0,Lt.default)((0,Mt.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"}),"FolderOutlined");function fe({spaceGateway:t,onDelete:s}){const{t:a}=O(),[n,l]=x.useState(!1),[c,o]=x.useState(!1),r=(p,m)=>{p==null||p.preventDefault(),p==null||p.stopPropagation(),l(m)},d=async p=>{try{p==null||p.stopPropagation(),o(!0),await s(t),l(!1)}catch(m){console.error(m),v.error(`${a("storage.space.gateway.delete.failed")}: ${G(m)}`)}finally{o(!1)}};return e.jsxs(e.Fragment,{children:[e.jsxs(_,{color:"red",onClick:p=>r(p,!0),children:[e.jsx($,{style:{minWidth:24,color:"red"},children:e.jsx(St,{fontSize:"small"})}),e.jsx(ee,{style:{color:"red"},children:a("common.delete")})]}),e.jsx(Ye,{title:e.jsx(y,{variant:"h6",children:a("common.delConfirmDescription",{data:`${t==null?void 0:t.name}`})}),open:n,confirmButton:{text:a("common.confirm"),props:{variant:"contained",color:"error",loading:c}},cancelButton:{text:a("common.cancel"),props:{variant:"contained",color:"primary"},loading:c},onConfirm:d,onCancel:p=>r(p,!1)})]})}fe.propTypes={onDelete:f.func,spaceGateway:f.shape({name:f.string.isRequired,url:f.string.isRequired,protected:f.bool}).isRequired};fe.defaultProps={onDelete:()=>{}};function xe({spaceGateway:t,connected:s,onDelete:a,onConnect:n,enableSwitchToSpace:l,backupInProgress:c,...o}){const[r,d]=x.useState(null),{t:p}=O(),[m,D]=x.useState(!1),S=(A,k)=>{A.stopPropagation(),A.preventDefault(),d(k&&A.currentTarget)},g=async A=>{try{D(!0),S(A,!1),await n(t)}catch(k){console.error(k),v.error(k.message)}finally{D(!1)}};return e.jsxs(e.Fragment,{children:[e.jsx(qe,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions",onClick:A=>S(A,!0),size:"small",...o,children:m||t!=null&&t.loading?e.jsx(Z,{size:"24px"}):e.jsx(yt,{})}),e.jsxs(_e,{id:"simple-menu",anchorEl:r,keepMounted:!0,open:!!r,onClose:A=>S(A,!1),children:[e.jsxs(_,{onClick:A=>{S(A,!1),window.open(t.endpoint?pt(t.endpoint):t.url)},children:[e.jsx($,{style:{minWidth:24},children:e.jsx(Te,{fontSize:"small"})}),e.jsx(ee,{children:p("common.open")})]}),e.jsxs(_,{onClick:A=>{S(A,!1),window.open(ut(t.endpoint))},children:[e.jsx($,{style:{minWidth:24},children:e.jsx(Fe,{fontSize:"small"})}),e.jsx(ee,{children:p("storage.spaces.strategy.viewBackupFiles")})]}),!s&&l&&e.jsxs(_,{onClick:g,children:[e.jsx($,{style:{minWidth:24},children:e.jsx(Oe,{fontSize:"small"})}),e.jsx(ee,{children:p("storage.spaces.connect.switchToSpace")})]}),!c&&e.jsx(fe,{spaceGateway:t,onDelete:a})]})]})}xe.propTypes={spaceGateway:f.shape({name:f.string.isRequired,url:f.string.isRequired,protected:f.bool,endpoint:f.string.isRequired,loading:f.bool}).isRequired,connected:f.bool.isRequired,enableSwitchToSpace:f.bool,onDelete:f.func,onConnect:f.func,backupInProgress:f.bool};xe.defaultProps={onDelete:()=>{},onConnect:()=>{},enableSwitchToSpace:!0,backupInProgress:!1};var Le=function(s){return e.jsx("svg",{...s,children:e.jsx("circle",{cx:"4",cy:"4",r:"4",fill:"#25C99B"})})};Le.defaultProps={width:"8",height:"8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};var Me=function(s){return e.jsx("svg",{...s,children:e.jsx("circle",{cx:"4",cy:"4",r:"4",fill:"#F16E6E"})})};Me.defaultProps={width:"8",height:"8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ge({spaceGateway:t,connected:s,onDelete:a,onBackupNow:n,...l}){const c=$e(w=>w.breakpoints.down("md")),{t:o,locale:r}=O(),{blocklet:d}=N(),{api:p,info:{did:m}}=P(),{appDid:D,appName:S,appDescription:g,scopes:A,appUrl:k,referrer:H}=Ie({blocklet:d}),{updateSpaceGateway:I,backupEndpoint:E,backupProgress:u,refreshBackupEndpoint:F}=Q(),[U,R]=x.useState(!1),[B,T]=x.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:o("storage.spaces.authorize.title",{appName:S},r),scan:o("storage.spaces.authorize.scan",{appName:S},r),confirm:"",success:e.jsx(y,{gutterBottom:!0,children:o("storage.spaces.authorize.success")})},onClose:()=>{T(w=>({...w,open:!1}))}}),{data:h,loading:C}=et(async()=>s?Ce(E):!0,{refreshDeps:[s,E,B==null?void 0:B.open,U]}),i=s&&h,b=s&&!U&&h&&!(t!=null&&t.loading),X=s&&U&&h,L=s&&!h&&!C&&!U,W=async()=>{if(await Ce(t==null?void 0:t.endpoint)){await p.configBlocklet({input:{did:[d.meta.did],configs:[{key:K.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:t.endpoint}]}}),F(),v.success(o("storage.spaces.connect.switchToSpaceSucceeded",{name:t.name?`(${t.name})`:""}));return}T(Y=>({...Y,open:!0,prefix:V(t.url,"space/api/did"),baseUrl:new URL(t.url).origin,checkFn:le.create({baseURL:V(t.url,"space")}).get,extraParams:{appDid:D,appName:S,appDescription:g,scopes:A,appUrl:k,referrer:H,nodeDid:m,spaceDid:t.did}}))},Je=async(w,Y)=>{const ie=Y(w.endpoint),Qe=se(ie),z=w.space?Y(w.space):{};if(t.did&&Qe!==t.did){T(re=>({...re,open:!1})),v.error(o("storage.spaces.gateway.switch.failedForMismatchSpace",{name:z!=null&&z.name?z.name:""}));return}const He={...t,name:z.name??"DID Space",did:z.did??se(ie),endpoint:ie};await I(He),T(re=>({...re,open:!1}))},Ze=async()=>{try{if(U)return;R(!0),await n()}catch(w){console.error(w),v.error(w.message)}finally{R(!0)}};return x.useEffect(()=>{u!=null&&u.completed?((u==null?void 0:u.progress)===100&&v.success(o("storage.spaces.backupSuccessfully")),R(!1),u.progress=0,u.message=""):u.progress&&R(!0)},[u]),e.jsxs(Nt,{sx:{backgroundColor:s?"#F0FDFF":"inherit","&:hover":{backgroundColor:s?"#F0FDFF":"#FBFBFB"},borderRadius:"8px"},display:"flex",flexDirection:"column",padding:"4px 20px 12px",...l,children:[e.jsxs(j,{display:"flex",alignItems:"center",children:[e.jsxs(j,{flex:1,children:[i&&e.jsxs(y,{color:"primary",fontSize:14,children:[e.jsx(Le,{style:{marginRight:"8px"}}),o("storage.spaces.connected.tag")]}),L&&e.jsxs(y,{color:"error",fontSize:14,children:[e.jsx(Me,{style:{marginRight:"8px"}}),o("storage.spaces.disconnected.tag")]})]}),e.jsx(xe,{sx:{padding:"4px"},spaceGateway:t,connected:s,onDelete:a,onConnect:W,enableSwitchToSpace:(u==null?void 0:u.completed)||J.isEmpty(u==null?void 0:u.message),backupInProgress:X})]}),e.jsxs(j,{display:"flex",children:[e.jsxs(j,{display:"flex",flexDirection:"column",flex:"1",minWidth:0,children:[e.jsx(y,{className:"spaces-name",fontSize:"1rem",fontWeight:"bold",children:t.name}),e.jsx(j,{className:"spaces-address",display:X?"none":"flex",color:"#9397A1",marginTop:"4px",children:e.jsx(y,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},color:"#9397A1",children:t.did&&e.jsx(jt,{copyable:!1,size:14,compact:!0,responsive:!1,did:t.did})})}),e.jsxs(j,{className:"spaces-backup",display:"flex",alignItems:"center",marginTop:"8px",flex:1,children:[b&&e.jsxs(j,{className:"backup-strategy",display:"flex",alignItems:"center",minWidth:"72px",children:[e.jsx(te,{variant:"contained",size:"small",onClick:Ze,children:o("storage.spaces.strategy.backupNow")}),At&&e.jsx(De,{name:"enable-auto-backup",title:"coming soon",disabled:!0,labelProps:{label:e.jsx(y,{sx:{marginRight:"8px",fontSize:"16px"},children:e.jsx("span",{children:o("storage.spaces.strategy.autoBackup")})})},style:{marginLeft:"64px"}})]}),X&&e.jsxs(j,{className:"backup-progress",display:"flex",flexDirection:"column",alignItems:"center",marginLeft:c&&"16px",width:"90%",marginRight:"auto",alignSelf:"flex-end",children:[e.jsx(y,{color:"primary",children:u==null?void 0:u.message}),e.jsxs(j,{sx:{display:"flex",alignItems:"center"},width:"100%",children:[e.jsx(j,{sx:{width:"100%",mr:1},children:e.jsx(tt,{color:"primary",variant:"determinate",value:u==null?void 0:u.progress})}),e.jsx(j,{sx:{maxWidth:"100%"},children:e.jsxs(y,{variant:"body2",color:"text.secondary",children:[u==null?void 0:u.progress,"%"]})})]})]}),L&&e.jsx(j,{className:"backup-strategy",display:"flex",alignItems:"center",minWidth:"72px",children:e.jsx(te,{color:"error",variant:"contained",size:"small",onClick:W,children:o("storage.spaces.disconnected.reconnectNow")})})]})]}),e.jsx(rt,{src:ht(t.endpoint),width:"72px",height:"72px"})]}),e.jsx(de,{forceConnected:!1,saveConnect:!1,prefix:B.prefix,open:B.open,popup:!0,action:B.action,baseUrl:B.baseUrl,checkFn:B.checkFn,onSuccess:Je,onClose:B.onClose,checkTimeout:B.checkTimeout,extraParams:B.extraParams,messages:B.messages,locale:r},"get-endpoint"),e.jsx(j,{className:`selected-container ${s?"selected":""}`,children:e.jsx(st,{className:"selected-icon"})})]})}ge.propTypes={spaceGateway:f.shape({did:f.string.isRequired,name:f.string.isRequired,url:f.string.isRequired,endpoint:f.string.isRequired,protected:f.bool,loading:f.bool}).isRequired,connected:f.bool.isRequired,progress:f.any.isRequired,onDelete:f.func,onBackupNow:f.func};ge.defaultProps={onDelete:()=>{},onBackupNow:()=>{}};const Nt=ke(j)`
|
|
1
|
+
import{cs as J,aZ as N,r as x,aQ as P,bX as ve,t as v,ab as K,u as O,j as e,P as f,eY as Ke,c4 as le,c as V,fl as Ve,T as y,B as j,K as de,av as Ge,a3 as te,n as Z,a0 as ke,a2 as Xe,gG as We,Z as ne,$ as oe,aU as _,fk as Ye,aD as qe,aS as _e,a1 as $e,U as et,b_ as tt,cx as st,G as M,bh as q,a as nt,gH as ot,C as at,bH as it}from"./index-CvQpkp6C.js";import{S as ye}from"./index-iByZOC72.js";import"./api-LCPZdy3r.js";import{u as Ie,P as rt}from"./use-blocklet-info-for-connect-did-spaces-Enuu3Koa.js";import{b as ct,h as lt,d as se,e as Se,f as dt,i as Ae,j as pt,k as ut,l as Ce,c as ht}from"./spaces-6dcXbeW4.js";import{f as G,D as mt}from"./format-error-Db99DYGG.js";import{T as ft}from"./TextField-BiJ3RQiw.js";import{A as xt}from"./Alert-BBnZ-bJY.js";import{I as gt}from"./index-BqThu2uY.js";import{W as jt}from"./did-address-Ciyb1jN9.js";import{S as De}from"./switch-control-CjEJidzr.js";import{d as yt}from"./MoreHoriz-C9DIIKqb.js";import{d as St}from"./DeleteOutline-xp-yy9Ns.js";import{L as $,a as ee}from"./ListItemText-CiKmy0GT.js";import{e as At}from"./mode-B2dWMeTO.js";import{T as ce}from"./index-i5ly4LjU.js";import{D as Ct}from"./index-BKhaY6h3.js";import{L as Bt}from"./Link-6h9rQRZt.js";import{G as Be}from"./redux-CFX_KgA-.js";import"./ExpandMore-Bu3C6pU8.js";import"./ButtonGroup-Brd5tASZ.js";import"./CloseOutlined-C_pRRRMb.js";import"./index-BATO4pBH.js";import"./FormControl-DKCPWiUE.js";import"./useFormControl-CVJHU3Z8.js";import"./InputLabel-C9tGpQ3p.js";import"./Select-DUGjpI0N.js";import"./useSlot-Lnh_3w1R.js";import"./index-Be5Rna_o.js";import"./FormControlLabel-DJ7JqxQ9.js";import"./FilterList-qJZckPS6.js";import"./useThemeProps-CDhmnq0d.js";import"./toPropertyKey-PLuKRk1e.js";import"./FormGroup-QuE1_Stk.js";import"./index-q-zqQDlr.js";import"./LastPage-B0el3h-h.js";import"./Toolbar-DDNMlPZf.js";import"./index-DTXVlwdz.js";import"./Search-CbL27Q7U.js";import"./Delete-D4dMA0lG.js";import"./index-CCsWG3Cf.js";import"./MoreVert-BTFxIHaV.js";async function vt({blockletDid:t,nodeApi:s,spaceGateways:a}){let n=!1;const l=await Promise.all(a.map(async c=>{let{name:o}=c;const r=await ct(c.endpoint);return!J.isEmpty(r)&&r!==o&&(o=r,n=!0),{...c,name:o}}));return n&&await Promise.all(l.filter(c=>c.did).map(c=>s.updateBlockletSpaceGateway({input:{did:t,where:{did:c.did},spaceGateway:{...c}}}))),l}function kt({setLoading:t,refresh:s}={}){var r;const{blocklet:a}=N(),n=(r=a==null?void 0:a.meta)==null?void 0:r.did,[l,c]=x.useState([]),{api:o}=P();return ve(async()=>{try{if(!n){c([]);return}t==null||t(!0);const{spaceGateways:d}=await o.getBlockletSpaceGateways({input:{did:n}}),p=await vt({blockletDid:n,nodeApi:o,spaceGateways:d});c(p??[])}catch(d){console.error(d),v.error(G(d))}finally{t==null||t(!1)}},[n,s]),{spaceGateways:l}}function Ee({deps:t,setLoading:s}={deps:[],setLoading:()=>{}}){var r;const{blocklet:a}=N(),[n,l]=x.useState([]),{api:c}=P(),o=J.debounce(async()=>{try{if(s(!0),!a){l([]);return}const{backups:d}=await c.getBlockletBackups({input:{did:a.meta.did}});l(d??[])}catch(d){console.error(d),v.error(G(d))}finally{s(!1)}},2e3);return ve(async()=>{o()},[(r=a==null?void 0:a.meta)==null?void 0:r.did].concat(t)),{backups:n}}function It({appDid:t}){const{backups:s}=Ee(),[a,n]=x.useState({message:"",progress:0,completed:!1}),l=P(),{ws:{useSubscription:c}}=l;return c(K.BlockletEvents.backupProgress,o=>{t===(o==null?void 0:o.appDid)&&n(()=>({...o}))},[t]),x.useEffect(()=>{var o;if(s!=null&&s.length&&J.isNull((o=s[0])==null?void 0:o.status)){const[r]=s;n(()=>({message:r.message,progress:r.progress,completed:r.progress>=100}))}},[s]),a}const Ue=x.createContext({}),{Provider:Dt,Consumer:Rs}=Ue;function pe({children:t}){var C;const{t:s}=O(),{api:a}=P(),{blocklet:n}=N(),[l,c]=x.useState(!1),[o,r]=x.useState(!1),{spaceGateways:d}=kt({refresh:o,setLoading:c}),p=It({appDid:n==null?void 0:n.appDid}),[m,D]=x.useState(!1),S=x.useMemo(()=>lt(n==null?void 0:n.environments),[n,o,m]),[g,A]=x.useState(!1),{backups:k}=Ee({deps:[p],setLoading:A}),[H,I]=x.useState(d==null?void 0:d.find(i=>i.endpoint===S)),E=(C=n==null?void 0:n.settings)==null?void 0:C.autoBackup,u=()=>{r(i=>!i)},F=()=>{D(i=>!i)},U=async i=>{await a.updateAutoBackup({input:{did:n.meta.did,autoBackup:i}})},R=async(i,b)=>{d.push({...i,loading:!0}),await a.addBlockletSpaceGateway({input:{did:n.meta.did,spaceGateway:i}}),S!==b&&await a.configBlocklet({input:{did:[n.meta.did],configs:[{key:K.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:b}]}}),u(),I(i)},B=async i=>{i&&(i.endpoint===S&&(await a.configBlocklet({input:{did:[n.meta.did],configs:[{key:K.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),E!=null&&E.enabled&&await U({enabled:!1})),await a.deleteBlockletSpaceGateway({input:{did:n.meta.did,spaceGatewayDid:i==null?void 0:i.did}}),u(),I(i))},T=async i=>{await a.updateBlockletSpaceGateway({input:{did:n.meta.did,where:{did:i.did},spaceGateway:i}}),S!==i.endpoint&&await a.configBlocklet({input:{did:[n.meta.did],configs:[{key:K.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:i.endpoint}]}}),v.success(s("storage.spaces.connectedWithName",{name:(i==null?void 0:i.name)??"DID Spaces"})),u()},h=i=>(i==null?void 0:i.endpoint)===S;return e.jsx(Dt,{value:{spaceGateways:d,selectedSpaceGateway:H,addSpaceGateway:R,deleteSpaceGateway:B,updateSpaceGateway:T,refreshSpaceGateways:u,spaceGatewaysLoading:l,spaceGatewayIsSelected:h,updateAutoBackup:U,backupEndpoint:S,backupProgress:p,backups:k,backupsLoading:g,refreshBackupEndpoint:F,autoBackup:E},children:t})}pe.propTypes={children:f.any.isRequired};pe.defaultProps={};function Q(){return x.useContext(Ue)}function ae({...t}){const{blocklet:s}=N(),{info:a}=P(),{t:n,locale:l}=O(),[c,o]=x.useState(""),[r,d]=x.useState(!1),[p,m]=x.useState(!1),[D,S]=x.useState(""),g=Ie({blocklet:s}),A=Ke(a),{spaceGateways:k,addSpaceGateway:H}=Q(),[I,E]=x.useState({open:!1,action:"connect-to-did-spaces",checkTimeout:1e3*300,checkFn:le.create({baseURL:V(window.location.origin,Ve())}).get,messages:{title:n("storage.spaces.provideNFT.title",{appName:g.appName},l),scan:n("storage.spaces.provideNFT.scan",{appName:g.appName},l),confirm:"",success:e.jsx(y,{gutterBottom:!0,children:n("storage.spaces.provideNFT.success")})},onClose:()=>{E(h=>({...h,open:!1}))}}),[u,F]=x.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:n("storage.spaces.authorize.title",{appName:g.appName},l),scan:n("storage.spaces.authorize.scan",{appName:g.appName},l),confirm:"",success:e.jsx(y,{gutterBottom:!0,children:n("storage.spaces.authorize.success")})},onClose:()=>{F(h=>({...h,open:!1}))}}),U=async({endpoint:h,name:C,did:i})=>{const b=await Se(h);if(!await Ae(b)){v.error(n("storage.spaces.gateway.add.invalidUrl"));return}if(k.some(W=>W.endpoint===h)){v.error(n("storage.spaces.gateway.add.duplicate",{name:C}));return}const L={name:C,did:i,url:b,endpoint:h};await H(L,h),v.success(n("storage.spaces.connectedWithName",{name:(L==null?void 0:L.name)??"DID Spaces"}))},R=async(h,C)=>{try{if(!J.isEmpty(h.spaceGateway))await U(C(h.spaceGateway));else{const i=C(h.endpoint),b=h.space?C(h.space):{};await U({endpoint:i,did:se(i),name:"DID Space",...b})}F(i=>({...i,open:!1})),o(null),E(i=>({...i,open:!1}))}catch(i){console.error(i),v.error(G(i))}},B=()=>{E(h=>({...h,open:!0,extraParams:{appPid:s.appPid,appName:g.appName,appDescription:g.appDescription,scopes:g.scopes,appUrl:g.appUrl,referrer:g.referrer,nodeDid:a.did}}))},T=async()=>{try{d(!0);const h=await Se(c),C=dt(h),i=new URL(h).searchParams.get("spaceDid");if(!await Ae(C))throw new Error(n("storage.spaces.gateway.add.invalidUrl"));F(b=>({...b,open:!0,prefix:V(C,"space/api/did"),baseUrl:new URL(C).origin,checkFn:le.create({baseURL:V(C,"space")}).get,extraParams:{appDid:g.appDid,appName:g.appName,appDescription:g.appDescription,scopes:g.scopes,appUrl:g.appUrl,referrer:g.referrer,nodeDid:a.did,spaceDid:i}})),m(!1)}catch(h){const C=`${n("storage.spaces.gateway.add.failed",l)}: ${G(h)}`;S(C)}finally{d(!1)}};return e.jsxs(j,{children:[e.jsx(ye,{color:"primary",style:{textTransform:"none !important",fontSize:"1rem"},size:"small",onClick:B,menu:[e.jsx(ye.Item,{sx:{textTransform:"none"},onClick:()=>m(!0),size:"small",...t,children:n("storage.spaces.connect.useSpaceGateway")},"1")],children:e.jsx(y,{sx:{fontWeight:"bold",textTransform:"none"},children:n("storage.spaces.connect.useWallet")})}),e.jsx(de,{forceConnected:!1,saveConnect:!1,prefix:I.prefix,open:I.open,popup:!0,action:I.action,webWalletUrl:A,baseUrl:I.baseUrl,checkFn:I.checkFn,onSuccess:R,onClose:I.onClose,checkTimeout:I.checkTimeout,extraParams:I.extraParams,messages:I.messages,locale:l}),e.jsx(de,{forceConnected:!1,saveConnect:!1,prefix:u.prefix,open:u.open,popup:!0,action:u.action,baseUrl:u.baseUrl,checkFn:u.checkFn,onSuccess:R,onClose:u.onClose,checkTimeout:u.checkTimeout,extraParams:u.extraParams,messages:u.messages,locale:l}),e.jsxs(Ge,{title:n("storage.spaces.gateway.add.title"),fullWidth:!0,maxWidth:"md",open:p,onClose:()=>m(!1),PaperProps:{style:{minHeight:"auto"}},actions:e.jsxs(e.Fragment,{children:[e.jsx(te,{onClick:h=>{h.stopPropagation(),m(!1)},color:"inherit",children:n("common.cancel")}),e.jsxs(te,{onClick:T,color:"primary",disabled:r||!c,variant:"contained",autoFocus:!0,children:[r&&e.jsx(Z,{size:16}),n("common.confirm")]})]}),children:[e.jsx("div",{style:{paddingTop:12,overflowY:"hidden"},children:e.jsx(mt,{component:"div",children:e.jsx(y,{component:"div",children:e.jsx(ft,{label:n("storage.spaces.gateway.add.label"),autoComplete:"off",variant:"outlined",name:"url",fullWidth:!0,value:c,onChange:h=>{S(null),o(h.target.value)},disabled:r,onKeyPress:async h=>{h.key==="Enter"&&await T()},autoFocus:!0})})})}),!!D&&e.jsx(xt,{severity:"error",style:{width:"100%"},children:D})]})]})}ae.propTypes={};ae.defaultProps={};function be({...t}){const{t:s}=x.useContext(Xe),{blocklet:a,loadingDiskInfo:n,actions:l}=N();if(x.useEffect(()=>{l.refreshBlocklet({showError:!1,attachDiskInfo:!0})},[]),a.diskInfo){const c=(d,p,m)=>e.jsxs(y,{children:[d," ",e.jsx("strong",{children:p?We(p):"empty"})]}),o=a.environments.reduce((d,p)=>(d[p.key]=p.value,d),{}),r=[{key:"appDir",name:s("blocklet.diskInfo.appDir"),value:c(o.BLOCKLET_APP_DIR,a.diskInfo.app)},{key:"dataDir",name:s("blocklet.diskInfo.dataDir"),value:c(o.BLOCKLET_DATA_DIR,a.diskInfo.data)},{key:"logDir",name:s("blocklet.diskInfo.logDir"),value:c(o.BLOCKLET_LOG_DIR,a.diskInfo.log)},{key:"cacheDir",name:s("blocklet.diskInfo.cacheDir"),value:c(o.BLOCKLET_CACHE_DIR,a.diskInfo.cache)}];return e.jsx(Et,{component:"div",...t,children:r.map(d=>e.jsx(gt,{valueComponent:"div",nameWidth:120,name:d.name,children:d.value},d.key))})}return n?e.jsx(Z,{}):e.jsx(y,{children:s("blocklet.diskInfo.empty")})}const Et=ke(y)``;var we=function(s){return e.jsxs("svg",{...s,children:[e.jsxs("g",{filter:"url(#a)",children:[e.jsx("path",{d:"M56.97 2a12 12 0 0 0-8.485 3.515l-40.97 40.97A12 12 0 0 0 4 54.971V240c0 6.627 5.373 12 12 12h196c6.627 0 12-5.373 12-12V14c0-6.627-5.373-12-12-12H56.97Z",fill:"#DDD"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m49.192 6.222-40.97 40.97A11 11 0 0 0 5 54.971V240c0 6.075 4.925 11 11 11h196c6.075 0 11-4.925 11-11V14c0-6.075-4.925-11-11-11H56.97a11 11 0 0 0-7.778 3.222Zm-.707-.707A12 12 0 0 1 56.971 2H212c6.627 0 12 5.373 12 12v226c0 6.627-5.373 12-12 12H16c-6.627 0-12-5.373-12-12V54.97a12 12 0 0 1 3.515-8.485l40.97-40.97Z",fill:"#000",fillOpacity:".08"}),e.jsx("mask",{id:"b",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"4",y:"2",width:"220",height:"250",children:e.jsx("path",{d:"M56.97 2a12 12 0 0 0-8.485 3.515l-40.97 40.97A12 12 0 0 0 4 54.971V240c0 6.627 5.373 12 12 12h196c6.627 0 12-5.373 12-12V14c0-6.627-5.373-12-12-12H56.97Z",fill:"#D9D9D9"})}),e.jsxs("g",{mask:"url(#b)",children:[e.jsx("path",{opacity:".5",fill:"url(#c)",d:"M4 2h220v128H4z"}),e.jsx("path",{opacity:".1",fill:"url(#d)",d:"M4 130h220v122H4z"}),e.jsx("path",{d:"M33.045 169h-3.767v-11.636h3.887c1.14 0 2.12.233 2.937.698a4.61 4.61 0 0 1 1.881 1.995c.44.863.659 1.899.659 3.108 0 1.212-.222 2.254-.665 3.125a4.668 4.668 0 0 1-1.909 2.011c-.833.466-1.84.699-3.023.699Zm-2.01-1.534h1.914c.886 0 1.623-.167 2.21-.5a3.152 3.152 0 0 0 1.318-1.46c.292-.64.438-1.421.438-2.341 0-.913-.146-1.688-.438-2.324a3.095 3.095 0 0 0-1.29-1.449c-.572-.33-1.282-.494-2.13-.494h-2.023v8.568Zm11.546-10.102V169h-1.756v-11.636h1.756ZM48.905 169h-3.767v-11.636h3.886c1.14 0 2.12.233 2.938.698a4.609 4.609 0 0 1 1.88 1.995c.44.863.66 1.899.66 3.108 0 1.212-.222 2.254-.665 3.125a4.667 4.667 0 0 1-1.91 2.011c-.833.466-1.84.699-3.022.699Zm-2.011-1.534h1.914c.887 0 1.623-.167 2.21-.5a3.151 3.151 0 0 0 1.319-1.46c.291-.64.437-1.421.437-2.341 0-.913-.146-1.688-.437-2.324a3.095 3.095 0 0 0-1.29-1.449c-.572-.33-1.282-.494-2.13-.494h-2.023v8.568Zm20.372-7.046a1.662 1.662 0 0 0-.75-1.25c-.44-.299-.993-.448-1.66-.448-.477 0-.89.075-1.238.227a1.91 1.91 0 0 0-.813.613c-.189.258-.284.552-.284.881 0 .277.065.515.194.716.132.201.304.369.516.506.216.132.447.244.694.335.246.087.483.159.71.216l1.136.295c.371.091.752.214 1.142.37.39.155.752.36 1.086.613.333.254.602.568.806.944.209.374.313.823.313 1.346 0 .659-.17 1.244-.511 1.756-.338.511-.828.915-1.472 1.21-.64.295-1.415.443-2.324.443-.871 0-1.625-.138-2.261-.415-.637-.276-1.135-.668-1.495-1.176-.36-.511-.558-1.117-.596-1.818h1.761c.034.421.17.771.41 1.051.242.277.55.483.925.62.38.132.794.198 1.245.198.496 0 .937-.077 1.324-.233.39-.159.697-.378.92-.659a1.56 1.56 0 0 0 .335-.994c0-.345-.098-.627-.295-.847a2.191 2.191 0 0 0-.79-.545 7.725 7.725 0 0 0-1.12-.381l-1.374-.375c-.932-.253-1.67-.627-2.216-1.119-.542-.492-.813-1.144-.813-1.955 0-.67.182-1.255.546-1.755.363-.5.856-.888 1.477-1.165.621-.28 1.322-.42 2.102-.42.788 0 1.483.138 2.085.414.607.277 1.084.658 1.432 1.142.349.481.53 1.034.546 1.659h-1.693Zm3.813 11.853v-12h1.66v1.415h.142c.098-.182.24-.393.426-.631.185-.239.443-.447.772-.625.33-.182.766-.273 1.307-.273.705 0 1.334.178 1.887.534.553.356.987.869 1.3 1.54.319.67.478 1.477.478 2.42 0 .944-.157 1.752-.472 2.427-.314.67-.746 1.187-1.295 1.551-.55.36-1.176.539-1.88.539-.53 0-.965-.089-1.302-.267a2.457 2.457 0 0 1-.784-.625 4.667 4.667 0 0 1-.437-.636h-.103v4.631H71.08Zm1.665-7.637c0 .614.09 1.152.267 1.614.178.462.436.824.773 1.085.337.258.75.387 1.239.387.507 0 .931-.135 1.273-.404.34-.273.598-.642.772-1.108.178-.466.267-.99.267-1.574 0-.575-.087-1.092-.261-1.551-.17-.458-.428-.82-.773-1.085-.34-.265-.767-.398-1.278-.398-.493 0-.91.127-1.25.381-.337.254-.593.608-.767 1.062-.175.455-.262.985-.262 1.591Zm10.75 4.557a3.557 3.557 0 0 1-1.5-.307 2.523 2.523 0 0 1-1.062-.903c-.258-.394-.386-.877-.386-1.449 0-.492.094-.898.283-1.216.19-.318.446-.57.768-.756a4.036 4.036 0 0 1 1.08-.42c.397-.095.802-.167 1.215-.216l1.273-.148c.325-.041.562-.108.71-.198.148-.091.222-.239.222-.444v-.039c0-.497-.14-.881-.42-1.154-.277-.273-.69-.409-1.24-.409-.572 0-1.022.127-1.352.381-.325.25-.55.528-.676.835l-1.597-.364c.19-.53.466-.958.83-1.284.368-.329.79-.568 1.267-.716.477-.151.98-.227 1.506-.227.348 0 .718.042 1.108.125.394.08.761.227 1.102.443.345.216.627.525.847.926.22.398.33.915.33 1.552V169h-1.66v-1.193h-.068c-.11.22-.275.435-.495.648-.22.212-.501.388-.846.528s-.758.21-1.239.21Zm.37-1.363c.47 0 .87-.093 1.204-.279.337-.185.593-.428.767-.727.178-.303.267-.627.267-.972v-1.125c-.06.061-.178.118-.352.171-.17.049-.365.093-.585.13-.22.034-.434.067-.642.097l-.523.068c-.33.042-.63.112-.903.21a1.553 1.553 0 0 0-.648.427c-.16.181-.239.424-.239.727 0 .42.156.738.466.954.31.212.707.319 1.188.319Zm9.876 1.346c-.845 0-1.572-.191-2.182-.574a3.796 3.796 0 0 1-1.398-1.596c-.325-.678-.488-1.455-.488-2.33 0-.886.166-1.668.5-2.346a3.832 3.832 0 0 1 1.409-1.597c.606-.383 1.32-.574 2.142-.574.663 0 1.254.123 1.773.369.519.243.937.584 1.255 1.023.322.44.514.953.574 1.54h-1.653c-.091-.409-.3-.761-.625-1.057-.322-.295-.754-.443-1.296-.443a2.11 2.11 0 0 0-1.244.375c-.352.246-.627.598-.824 1.057-.197.454-.295.992-.295 1.613 0 .637.096 1.186.29 1.648.193.462.466.82.818 1.074.356.254.774.381 1.255.381.322 0 .614-.059.875-.177.266-.121.487-.293.665-.517.182-.223.309-.492.38-.806h1.654a3.211 3.211 0 0 1-.55 1.511 3.165 3.165 0 0 1-1.234 1.045c-.511.254-1.111.381-1.8.381Zm9.163 0c-.859 0-1.6-.184-2.221-.551a3.732 3.732 0 0 1-1.432-1.563c-.333-.674-.5-1.464-.5-2.369 0-.894.167-1.682.5-2.363a3.887 3.887 0 0 1 1.409-1.597c.606-.383 1.314-.574 2.125-.574.493 0 .97.082 1.432.244.462.163.877.419 1.244.767.368.349.657.802.87 1.358.212.553.318 1.226.318 2.017v.603H99.71v-1.273h5.273c0-.447-.091-.843-.273-1.187a2.052 2.052 0 0 0-.767-.824c-.326-.201-.708-.302-1.148-.302a2.22 2.22 0 0 0-1.25.353 2.364 2.364 0 0 0-.818.909 2.626 2.626 0 0 0-.284 1.21v.994c0 .584.102 1.08.307 1.489.208.409.498.722.869.938.372.212.805.318 1.301.318a2.7 2.7 0 0 0 .881-.137c.265-.094.494-.234.688-.42.193-.186.341-.415.443-.688l1.608.29c-.129.474-.36.888-.693 1.244-.33.353-.745.627-1.245.824-.496.194-1.062.29-1.699.29Z",fill:"#fff"}),e.jsx("path",{d:"M117.604 47.263 121.523 45h14.267v41.862h-14.267l-15.335-8.854V53.854l1.818-1.05 3.2 1.848-1.818 1.05V76.16l12.993 7.502h10.209V48.2h-10.209l-1.577.91-3.2-1.847Z",fill:"url(#e)"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M119.402 76.16V55.701L106.409 48.2H96.2v35.462h10.209l1.582-.913 3.2 1.847-3.924 2.266H93V45h14.267l15.335 8.854v24.154l-1.813 1.046-3.2-1.847 1.813-1.047Z",fill:"url(#f)"}),e.jsxs("g",{clipPath:"url(#g)",fillRule:"evenodd",clipRule:"evenodd",fill:"#fff",children:[e.jsx("path",{d:"m50.928 216.089 1.034 2.852h-2.503l1.028-2.842a4.95 4.95 0 0 0 .107-.338 7.17 7.17 0 0 0 .111-.409c.075.297.15.542.223.737Zm2.28 5.591h.796l-2.775-7.352h-1.043l-2.774 7.352h.795a.338.338 0 0 0 .223-.077.425.425 0 0 0 .127-.179l.615-1.705h3.07l.617 1.705a.399.399 0 0 0 .126.184.339.339 0 0 0 .223.072Zm4.823-.963a2.023 2.023 0 0 1-.67.098h-1.455v-2.453h1.456c.5 0 .871.106 1.11.318.24.208.36.495.36.86 0 .184-.028.355-.083.512a1.005 1.005 0 0 1-.262.399 1.2 1.2 0 0 1-.456.266Zm-2.125-3.128v-2.406h1.237c.498 0 .865.095 1.101.286.236.192.355.497.355.917 0 .369-.125.662-.374.881-.246.215-.623.322-1.13.322h-1.189Zm2.358-3.128a4.106 4.106 0 0 0-1.12-.133h-2.27v7.352h2.507c.391 0 .74-.051 1.048-.154.307-.102.566-.247.776-.435.21-.188.37-.409.48-.665.11-.26.165-.547.165-.861 0-.904-.506-1.462-1.518-1.674.22-.075.41-.169.572-.281a1.79 1.79 0 0 0 .403-.379c.106-.144.186-.297.237-.461.052-.164.078-.335.078-.512a2.1 2.1 0 0 0-.146-.804 1.49 1.49 0 0 0-.441-.609 2.073 2.073 0 0 0-.771-.384Zm7.535.778h-2.212v6.441h-1.028v-6.441h-2.222v-.911H65.8v.911Zm2.439.564h-1.13v1.193h1.13v-1.193Zm-1.13 2.983h1.13v1.193h-1.13v-1.193Z",fillOpacity:".8"}),e.jsx("path",{d:"M28.247 221.771V214h3.894c.99.072 1.765.944 1.765 1.998v3.77c0 1.106-.85 2.003-1.897 2.003h-3.762ZM36.355 214h-1.011v7.783h1.01V214Zm-7.097 6.704v-5.642h2.751c.49 0 .886.419.886.936v3.77c0 .517-.396.936-.886.936h-2.75ZM37.775 214v7.771h3.762c1.047 0 1.897-.897 1.897-2.003v-3.77c0-1.054-.774-1.926-1.765-1.998h-3.894Zm6.946 1.803h1.13v1.193h-1.13v-1.193Zm1.13 2.983h-1.13v1.193h1.13v-1.193Zm-7.065-3.724v5.642h2.75c.49 0 .887-.419.887-.936v-3.77c0-.517-.397-.936-.886-.936h-2.751Z"})]}),e.jsx("circle",{cx:"191.32",cy:"218",r:"10",fill:"url(#h)"}),e.jsx("path",{d:"m192.064 213.333.976-.564h3.554v10.427h-3.286a1 1 0 0 1-.5-.134l-3.588-2.071v-6.016l.453-.262.797.46-.453.262v5.096l3.237 1.868h2.543v-8.833h-2.543l-.393.227-.797-.46Z",fill:"#fff"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M192.512 220.531v-5.096l-3.237-1.869h-2.543v8.833h2.543l.394-.227.797.46-.977.564h-3.554v-10.427h3.554l3.82 2.206v6.016l-.452.261-.797-.461.452-.26Z",fill:"#fff"})]})]}),e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:"d",x1:"114",y1:"130",x2:"114",y2:"252",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#101010"}),e.jsx("stop",{offset:"1",stopColor:"#272727"})]}),e.jsxs("linearGradient",{id:"e",x1:"120.989",y1:"45",x2:"120.989",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#fff",stopOpacity:".4"}),e.jsx("stop",{offset:"1",stopColor:"#fff"})]}),e.jsxs("linearGradient",{id:"f",x1:"107.801",y1:"45",x2:"107.801",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#fff"}),e.jsx("stop",{offset:"1",stopColor:"#fff",stopOpacity:".4"})]}),e.jsxs("radialGradient",{id:"h",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(17 -8.76924 6.97565 13.52294 183.166 221)",children:[e.jsx("stop",{stopColor:"#016BED"}),e.jsx("stop",{offset:".699",stopColor:"#4498FB"}),e.jsx("stop",{offset:"1",stopColor:"#9DFFE8"})]}),e.jsx("clipPath",{id:"g",children:e.jsx("path",{fill:"#fff",transform:"translate(28 214)",d:"M0 0h40.32v8H0z"})}),e.jsx("pattern",{id:"c",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:e.jsx("use",{xlinkHref:"#i",transform:"scale(.00455 .00781)"})}),e.jsxs("filter",{id:"a",x:"0",y:"0",width:"228",height:"258",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[e.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),e.jsx("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),e.jsx("feOffset",{dy:"2"}),e.jsx("feGaussianBlur",{stdDeviation:"2"}),e.jsx("feComposite",{in2:"hardAlpha",operator:"out"}),e.jsx("feColorMatrix",{values:"0 0 0 0 0.0631944 0 0 0 0 0.242785 0 0 0 0 0.403472 0 0 0 0.2 0"}),e.jsx("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_1410_22507"}),e.jsx("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_1410_22507",result:"shape"})]}),e.jsx("image",{id:"i",width:"220",height:"128",xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANwAAACABAMAAACSOBo+AAAAG1BMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACUUeIgAAAACXRSTlMSFhkOHAsfCCOMH5MiAAAjjElEQVRo3hTQO3sjRRBG4a+qWzJhVfdIJqzuGXsJe2bkJe0e2UA4shdIJS2X1LBcUpbL/wae5yQnfVHGjp2+V08yKR7OwBDYte8pi5Aq9DObSBouqN9cidZyusonzWtGJO13phLebEn6xKEnlYyXe5hnySc53Ym9Abn7crTse8r7BMeIB8yBOVZK0trMjxT5S/cgc9G63BQqZoF3xSYZYeRk2hoIvEBFA7XMtaaF8TdY1Gj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9plNI3QyvsMZHn2j2wOECoTtkfJt89O+eYUnXB/gFxHxPmOeL9ogAAAABJRU5ErkJggg=="})]})]})};we.defaultProps={width:"228",height:"258",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"};function Re(){const{t}=O();return e.jsxs(j,{children:[e.jsxs(j,{minHeight:"40vh",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",children:[e.jsx(we,{style:{width:250,height:250}}),e.jsx(y,{marginTop:"24px",marginBottom:"24px",children:t("storage.spaces.connect.provider")}),e.jsx(ae,{})]}),e.jsx(y,{fontSize:"1.2rem",fontWeight:"bold",mb:2,children:t("common.dataStorage")}),e.jsx(be,{})]})}Re.propTypes={};var ue={},Ut=oe;Object.defineProperty(ue,"__esModule",{value:!0});var Te=ue.default=void 0,bt=Ut(ne()),wt=e;Te=ue.default=(0,bt.default)((0,wt.jsx)("path",{d:"M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z"}),"ArrowOutward");var he={},Rt=oe;Object.defineProperty(he,"__esModule",{value:!0});var Oe=he.default=void 0,Tt=Rt(ne()),Ot=e;Oe=he.default=(0,Tt.default)((0,Ot.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"}),"ElectricBoltOutlined");var me={},Ft=oe;Object.defineProperty(me,"__esModule",{value:!0});var Fe=me.default=void 0,Lt=Ft(ne()),Mt=e;Fe=me.default=(0,Lt.default)((0,Mt.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"}),"FolderOutlined");function fe({spaceGateway:t,onDelete:s}){const{t:a}=O(),[n,l]=x.useState(!1),[c,o]=x.useState(!1),r=(p,m)=>{p==null||p.preventDefault(),p==null||p.stopPropagation(),l(m)},d=async p=>{try{p==null||p.stopPropagation(),o(!0),await s(t),l(!1)}catch(m){console.error(m),v.error(`${a("storage.space.gateway.delete.failed")}: ${G(m)}`)}finally{o(!1)}};return e.jsxs(e.Fragment,{children:[e.jsxs(_,{color:"red",onClick:p=>r(p,!0),children:[e.jsx($,{style:{minWidth:24,color:"red"},children:e.jsx(St,{fontSize:"small"})}),e.jsx(ee,{style:{color:"red"},children:a("common.delete")})]}),e.jsx(Ye,{title:e.jsx(y,{variant:"h6",children:a("common.delConfirmDescription",{data:`${t==null?void 0:t.name}`})}),open:n,confirmButton:{text:a("common.confirm"),props:{variant:"contained",color:"error",loading:c}},cancelButton:{text:a("common.cancel"),props:{variant:"contained",color:"primary"},loading:c},onConfirm:d,onCancel:p=>r(p,!1)})]})}fe.propTypes={onDelete:f.func,spaceGateway:f.shape({name:f.string.isRequired,url:f.string.isRequired,protected:f.bool}).isRequired};fe.defaultProps={onDelete:()=>{}};function xe({spaceGateway:t,connected:s,onDelete:a,onConnect:n,enableSwitchToSpace:l,backupInProgress:c,...o}){const[r,d]=x.useState(null),{t:p}=O(),[m,D]=x.useState(!1),S=(A,k)=>{A.stopPropagation(),A.preventDefault(),d(k&&A.currentTarget)},g=async A=>{try{D(!0),S(A,!1),await n(t)}catch(k){console.error(k),v.error(k.message)}finally{D(!1)}};return e.jsxs(e.Fragment,{children:[e.jsx(qe,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions",onClick:A=>S(A,!0),size:"small",...o,children:m||t!=null&&t.loading?e.jsx(Z,{size:"24px"}):e.jsx(yt,{})}),e.jsxs(_e,{id:"simple-menu",anchorEl:r,keepMounted:!0,open:!!r,onClose:A=>S(A,!1),children:[e.jsxs(_,{onClick:A=>{S(A,!1),window.open(t.endpoint?pt(t.endpoint):t.url)},children:[e.jsx($,{style:{minWidth:24},children:e.jsx(Te,{fontSize:"small"})}),e.jsx(ee,{children:p("common.open")})]}),e.jsxs(_,{onClick:A=>{S(A,!1),window.open(ut(t.endpoint))},children:[e.jsx($,{style:{minWidth:24},children:e.jsx(Fe,{fontSize:"small"})}),e.jsx(ee,{children:p("storage.spaces.strategy.viewBackupFiles")})]}),!s&&l&&e.jsxs(_,{onClick:g,children:[e.jsx($,{style:{minWidth:24},children:e.jsx(Oe,{fontSize:"small"})}),e.jsx(ee,{children:p("storage.spaces.connect.switchToSpace")})]}),!c&&e.jsx(fe,{spaceGateway:t,onDelete:a})]})]})}xe.propTypes={spaceGateway:f.shape({name:f.string.isRequired,url:f.string.isRequired,protected:f.bool,endpoint:f.string.isRequired,loading:f.bool}).isRequired,connected:f.bool.isRequired,enableSwitchToSpace:f.bool,onDelete:f.func,onConnect:f.func,backupInProgress:f.bool};xe.defaultProps={onDelete:()=>{},onConnect:()=>{},enableSwitchToSpace:!0,backupInProgress:!1};var Le=function(s){return e.jsx("svg",{...s,children:e.jsx("circle",{cx:"4",cy:"4",r:"4",fill:"#25C99B"})})};Le.defaultProps={width:"8",height:"8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};var Me=function(s){return e.jsx("svg",{...s,children:e.jsx("circle",{cx:"4",cy:"4",r:"4",fill:"#F16E6E"})})};Me.defaultProps={width:"8",height:"8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ge({spaceGateway:t,connected:s,onDelete:a,onBackupNow:n,...l}){const c=$e(w=>w.breakpoints.down("md")),{t:o,locale:r}=O(),{blocklet:d}=N(),{api:p,info:{did:m}}=P(),{appDid:D,appName:S,appDescription:g,scopes:A,appUrl:k,referrer:H}=Ie({blocklet:d}),{updateSpaceGateway:I,backupEndpoint:E,backupProgress:u,refreshBackupEndpoint:F}=Q(),[U,R]=x.useState(!1),[B,T]=x.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:o("storage.spaces.authorize.title",{appName:S},r),scan:o("storage.spaces.authorize.scan",{appName:S},r),confirm:"",success:e.jsx(y,{gutterBottom:!0,children:o("storage.spaces.authorize.success")})},onClose:()=>{T(w=>({...w,open:!1}))}}),{data:h,loading:C}=et(async()=>s?Ce(E):!0,{refreshDeps:[s,E,B==null?void 0:B.open,U]}),i=s&&h,b=s&&!U&&h&&!(t!=null&&t.loading),X=s&&U&&h,L=s&&!h&&!C&&!U,W=async()=>{if(await Ce(t==null?void 0:t.endpoint)){await p.configBlocklet({input:{did:[d.meta.did],configs:[{key:K.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:t.endpoint}]}}),F(),v.success(o("storage.spaces.connect.switchToSpaceSucceeded",{name:t.name?`(${t.name})`:""}));return}T(Y=>({...Y,open:!0,prefix:V(t.url,"space/api/did"),baseUrl:new URL(t.url).origin,checkFn:le.create({baseURL:V(t.url,"space")}).get,extraParams:{appDid:D,appName:S,appDescription:g,scopes:A,appUrl:k,referrer:H,nodeDid:m,spaceDid:t.did}}))},Je=async(w,Y)=>{const ie=Y(w.endpoint),Qe=se(ie),z=w.space?Y(w.space):{};if(t.did&&Qe!==t.did){T(re=>({...re,open:!1})),v.error(o("storage.spaces.gateway.switch.failedForMismatchSpace",{name:z!=null&&z.name?z.name:""}));return}const He={...t,name:z.name??"DID Space",did:z.did??se(ie),endpoint:ie};await I(He),T(re=>({...re,open:!1}))},Ze=async()=>{try{if(U)return;R(!0),await n()}catch(w){console.error(w),v.error(w.message)}finally{R(!0)}};return x.useEffect(()=>{u!=null&&u.completed?((u==null?void 0:u.progress)===100&&v.success(o("storage.spaces.backupSuccessfully")),R(!1),u.progress=0,u.message=""):u.progress&&R(!0)},[u]),e.jsxs(Nt,{sx:{backgroundColor:s?"#F0FDFF":"inherit","&:hover":{backgroundColor:s?"#F0FDFF":"#FBFBFB"},borderRadius:"8px"},display:"flex",flexDirection:"column",padding:"4px 20px 12px",...l,children:[e.jsxs(j,{display:"flex",alignItems:"center",children:[e.jsxs(j,{flex:1,children:[i&&e.jsxs(y,{color:"primary",fontSize:14,children:[e.jsx(Le,{style:{marginRight:"8px"}}),o("storage.spaces.connected.tag")]}),L&&e.jsxs(y,{color:"error",fontSize:14,children:[e.jsx(Me,{style:{marginRight:"8px"}}),o("storage.spaces.disconnected.tag")]})]}),e.jsx(xe,{sx:{padding:"4px"},spaceGateway:t,connected:s,onDelete:a,onConnect:W,enableSwitchToSpace:(u==null?void 0:u.completed)||J.isEmpty(u==null?void 0:u.message),backupInProgress:X})]}),e.jsxs(j,{display:"flex",children:[e.jsxs(j,{display:"flex",flexDirection:"column",flex:"1",minWidth:0,children:[e.jsx(y,{className:"spaces-name",fontSize:"1rem",fontWeight:"bold",children:t.name}),e.jsx(j,{className:"spaces-address",display:X?"none":"flex",color:"#9397A1",marginTop:"4px",children:e.jsx(y,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},color:"#9397A1",children:t.did&&e.jsx(jt,{copyable:!1,size:14,compact:!0,responsive:!1,did:t.did})})}),e.jsxs(j,{className:"spaces-backup",display:"flex",alignItems:"center",marginTop:"8px",flex:1,children:[b&&e.jsxs(j,{className:"backup-strategy",display:"flex",alignItems:"center",minWidth:"72px",children:[e.jsx(te,{variant:"contained",size:"small",onClick:Ze,children:o("storage.spaces.strategy.backupNow")}),At&&e.jsx(De,{name:"enable-auto-backup",title:"coming soon",disabled:!0,labelProps:{label:e.jsx(y,{sx:{marginRight:"8px",fontSize:"16px"},children:e.jsx("span",{children:o("storage.spaces.strategy.autoBackup")})})},style:{marginLeft:"64px"}})]}),X&&e.jsxs(j,{className:"backup-progress",display:"flex",flexDirection:"column",alignItems:"center",marginLeft:c&&"16px",width:"90%",marginRight:"auto",alignSelf:"flex-end",children:[e.jsx(y,{color:"primary",children:u==null?void 0:u.message}),e.jsxs(j,{sx:{display:"flex",alignItems:"center"},width:"100%",children:[e.jsx(j,{sx:{width:"100%",mr:1},children:e.jsx(tt,{color:"primary",variant:"determinate",value:u==null?void 0:u.progress})}),e.jsx(j,{sx:{maxWidth:"100%"},children:e.jsxs(y,{variant:"body2",color:"text.secondary",children:[u==null?void 0:u.progress,"%"]})})]})]}),L&&e.jsx(j,{className:"backup-strategy",display:"flex",alignItems:"center",minWidth:"72px",children:e.jsx(te,{color:"error",variant:"contained",size:"small",onClick:W,children:o("storage.spaces.disconnected.reconnectNow")})})]})]}),e.jsx(rt,{src:ht(t.endpoint),width:"72px",height:"72px"})]}),e.jsx(de,{forceConnected:!1,saveConnect:!1,prefix:B.prefix,open:B.open,popup:!0,action:B.action,baseUrl:B.baseUrl,checkFn:B.checkFn,onSuccess:Je,onClose:B.onClose,checkTimeout:B.checkTimeout,extraParams:B.extraParams,messages:B.messages,locale:r},"get-endpoint"),e.jsx(j,{className:`selected-container ${s?"selected":""}`,children:e.jsx(st,{className:"selected-icon"})})]})}ge.propTypes={spaceGateway:f.shape({did:f.string.isRequired,name:f.string.isRequired,url:f.string.isRequired,endpoint:f.string.isRequired,protected:f.bool,loading:f.bool}).isRequired,connected:f.bool.isRequired,progress:f.any.isRequired,onDelete:f.func,onBackupNow:f.func};ge.defaultProps={onDelete:()=>{},onBackupNow:()=>{}};const Nt=ke(j)`
|
|
2
2
|
box-sizing: border-box;
|
|
3
3
|
position: relative;
|
|
4
4
|
min-height: 136px;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/react-
|
|
2
|
-
import{au as a2,j as o,aH as se,cJ as v0,aL as A,fw as K1,aK as je,aF as $e,aG as Fe,T as G,r as R,aJ as m1,aM as c2,aN as Ue,aO as qe,cP as d2,fx as l1,Z as Te,$ as Ne,B as z,n as Oe,P as h,a1 as We,G as X,e as v1,u as te,aQ as we,aZ as Ve,by as n1,a3 as e1,L as ue,bL as g0,a as ve,aD as ge,K as u2,t as $,a0 as ae,dw as p2,ab as ye,c as pe,I as h2,bW as g1,ch as b0,cE as f2,cN as He,cO as j0,ak as x2,d2 as m2,cI as Je,bF as re,c4 as Qe,fi as v2,a9 as X1,b as ne,bn as w0,dy as R0,aj as b1,bo as C0,co as y0,aU as Ae,aT as g2,a4 as z0,fy as J1,f7 as Me,bl as b2,av as S0,cV as j2,l as w2,aC as R2,ar as C2,as as i1}from"./index-Xy0LtaLl.js";import{d as j1}from"./Add-RSfTN8EF.js";import{d as y2}from"./AddBox-kYHD66ZJ.js";import{d as k0}from"./Delete-uLZyjAyH.js";import{d as z2}from"./Error-D0CS80xU.js";import{D as w1}from"./index-DQ0JJK46.js";import{T as I0,b as S2}from"./index-CuyRGb9b.js";import{C as R1}from"./confirm-CCQa70Pg.js";import{u as s1}from"./session-qS7z5tiM.js";import{W as Q1}from"./did-address-1DufLas8.js";import{B as C1,d as k2}from"./ChevronRight-JfisleDr.js";import{S as be}from"./shorten-label-CntVgEf1.js";import{A as M0}from"./Avatar-DfF1m2g5.js";import{d as I2}from"./Download-BPUfwxxs.js";import{d as M2}from"./QuestionMarkCircle-DbMAv-OF.js";import{b as P2,c as Y1,T as L2}from"./index-B6cedsbc.js";import{_ as Ie}from"./useSetState-B7OpsWvA.js";import{c as y1}from"./index-BvFufyUR.js";import{C as u1,F as p1,S as T2}from"./FormControlLabel-CpXvhTph.js";import{A as P0}from"./Alert-ClYwyZJt.js";import{p as t1}from"./index-HqFqdQ4r.js";import"./api-rSkpRnMk.js";import{i as N2}from"./index-BtOgY8Si.js";import{d as V2}from"./ExpandMore-Bpwbf5LO.js";import{d as D2}from"./OpenInNew-DANSXvoN.js";import{u as L0}from"./useThemeProps-CXkqPLv1.js";import{u as _2}from"./useSlotProps-CNnGAX_a.js";import{d as E2}from"./DeleteOutline-Brfidl3M.js";import{c as B2,A as T0,u as A2,S as O2,U as H2}from"./item-DSUSjxqu.js";import{d as $2}from"./ArrowDropDown-DsukJ5At.js";import{f as Le}from"./format-error-B_wxv2zr.js";import{B as h1}from"./ButtonGroup-DFgjZ6az.js";import{T as Pe}from"./TextField-CAingS4F.js";import{I as z1}from"./InputAdornment-DE9lNaQi.js";import{C as F2}from"./click-to-copy-DJDkDoFa.js";import{d as U2}from"./Launch-yFmc6Tfn.js";import{L as q2}from"./MoreVert-CxoveKS9.js";import{a as W2}from"./ListItemText-tl-KE_u8.js";import{S as Z1}from"./index-UJL5oKk6.js";import{M as G2}from"./index-B_Laf8x-.js";import{r as K2}from"./index-DsmWg2lB.js";import{d as X2}from"./Done-BPSCz_s4.js";import{c as N0,d as V0,b as J2,S as Q2,a as Y2}from"./Stepper-DMLaOhco.js";import{R as Z2,a as e0}from"./RadioGroup-CDcTFsOU.js";import"./FilterList-8uDifo29.js";import"./toPropertyKey-PLuKRk1e.js";import"./FormControl-BS53BBfk.js";import"./useFormControl-BbOnEHs0.js";import"./FormGroup-CQJX8jMa.js";import"./InputLabel-vEy8Wv5K.js";import"./Select-DTam9nL9.js";import"./LastPage-CG3UlSnN.js";import"./Toolbar-Ba71DWfj.js";import"./index-cDbrdIwr.js";import"./redux-D4hIeGdy.js";import"./Search-Cb1nmmjY.js";import"./index-BF0CESCe.js";import"./Link-AzDxZ12K.js";import"./useSlot-CQyOPTl1.js";import"./jss-plugin-props-sort.esm-Dy1hd-li.js";const et=a2(o.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreHoriz"),tt=["slots","slotProps"],ot=se(v0)(({theme:e})=>A({display:"flex",marginLeft:`calc(${e.spacing(1)} * 0.5)`,marginRight:`calc(${e.spacing(1)} * 0.5)`},e.palette.mode==="light"?{backgroundColor:e.palette.grey[100],color:e.palette.grey[700]}:{backgroundColor:e.palette.grey[700],color:e.palette.grey[100]},{borderRadius:2,"&:hover, &:focus":A({},e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}),"&:active":A({boxShadow:e.shadows[0]},e.palette.mode==="light"?{backgroundColor:K1(e.palette.grey[200],.12)}:{backgroundColor:K1(e.palette.grey[600],.12)})})),lt=se(et)({width:24,height:16});function nt(e){const{slots:t={},slotProps:l={}}=e,s=je(e,tt),r=e;return o.jsx("li",{children:o.jsx(ot,A({focusRipple:!0},s,{ownerState:r,children:o.jsx(lt,A({as:t.CollapsedIcon,ownerState:r},l.collapsedIcon))}))})}function st(e){return Fe("MuiBreadcrumbs",e)}const rt=$e("MuiBreadcrumbs",["root","ol","li","separator"]),it=["children","className","component","slots","slotProps","expandText","itemsAfterCollapse","itemsBeforeCollapse","maxItems","separator"],at=e=>{const{classes:t}=e;return qe({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},st,t)},ct=se(G,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,t)=>[{[`& .${rt.li}`]:t.li},t.root]})({}),dt=se("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(e,t)=>t.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),ut=se("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(e,t)=>t.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function pt(e,t,l,s){return e.reduce((r,c,i)=>(i<e.length-1?r=r.concat(c,o.jsx(ut,{"aria-hidden":!0,className:t,ownerState:s,children:l},`separator-${i}`)):r.push(c),r),[])}const D0=R.forwardRef(function(t,l){const s=m1({props:t,name:"MuiBreadcrumbs"}),{children:r,className:c,component:i="nav",slots:a={},slotProps:u={},expandText:f="Show path",itemsAfterCollapse:x=1,itemsBeforeCollapse:g=1,maxItems:y=8,separator:p="/"}=s,d=je(s,it),[m,b]=R.useState(!1),v=A({},s,{component:i,expanded:m,expandText:f,itemsAfterCollapse:x,itemsBeforeCollapse:g,maxItems:y,separator:p}),C=at(v),S=c2({elementType:a.CollapsedIcon,externalSlotProps:u.collapsedIcon,ownerState:v}),N=R.useRef(null),T=I=>{const U=()=>{b(!0);const V=N.current.querySelector("a[href],button,[tabindex]");V&&V.focus()};return g+x>=I.length?I:[...I.slice(0,g),o.jsx(nt,{"aria-label":f,slots:{CollapsedIcon:a.CollapsedIcon},slotProps:{collapsedIcon:S},onClick:U},"ellipsis"),...I.slice(I.length-x,I.length)]},P=R.Children.toArray(r).filter(I=>R.isValidElement(I)).map((I,U)=>o.jsx("li",{className:C.li,children:I},`child-${U}`));return o.jsx(ct,A({ref:l,component:i,color:"text.secondary",className:Ue(C.root,c),ownerState:v},d,{children:o.jsx(dt,{className:C.ol,ref:N,ownerState:v,children:pt(m||y&&P.length<=y?P:T(P),C.separator,p,v)})}))});function ht(e){return Fe("MuiStepButton",e)}const t0=$e("MuiStepButton",["root","horizontal","vertical","touchRipple"]),ft=["children","className","icon","optional"],xt=e=>{const{classes:t,orientation:l}=e;return qe({root:["root",l],touchRipple:["touchRipple"]},ht,t)},mt=se(v0,{name:"MuiStepButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[{[`& .${t0.touchRipple}`]:t.touchRipple},t.root,t[l.orientation]]}})(({ownerState:e})=>A({width:"100%",padding:"24px 16px",margin:"-24px -16px",boxSizing:"content-box"},e.orientation==="vertical"&&{justifyContent:"flex-start",padding:"8px",margin:"-8px"},{[`& .${t0.touchRipple}`]:{color:"rgba(0, 0, 0, 0.3)"}})),vt=R.forwardRef(function(t,l){const s=m1({props:t,name:"MuiStepButton"}),{children:r,className:c,icon:i,optional:a}=s,u=je(s,ft),{disabled:f,active:x}=R.useContext(N0),{orientation:g}=R.useContext(V0),y=A({},s,{orientation:g}),p=xt(y),d={icon:i,optional:a},m=d2(r,["StepLabel"])?R.cloneElement(r,d):o.jsx(J2,A({},d,{children:r}));return o.jsx(mt,A({focusRipple:!0,disabled:f,TouchRippleProps:{className:p.touchRipple},className:Ue(p.root,c),ref:l,ownerState:y,"aria-current":x?"step":void 0},u,{children:m}))});function gt(e){return Fe("MuiStepContent",e)}$e("MuiStepContent",["root","last","transition"]);const bt=["children","className","TransitionComponent","transitionDuration","TransitionProps"],jt=e=>{const{classes:t,last:l}=e;return qe({root:["root",l&&"last"],transition:["transition"]},gt,t)},wt=se("div",{name:"MuiStepContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.root,l.last&&t.last]}})(({ownerState:e,theme:t})=>A({marginLeft:12,paddingLeft:20,paddingRight:8,borderLeft:t.vars?`1px solid ${t.vars.palette.StepContent.border}`:`1px solid ${t.palette.mode==="light"?t.palette.grey[400]:t.palette.grey[600]}`},e.last&&{borderLeft:"none"})),Rt=se(l1,{name:"MuiStepContent",slot:"Transition",overridesResolver:(e,t)=>t.transition})({}),Ct=R.forwardRef(function(t,l){const s=m1({props:t,name:"MuiStepContent"}),{children:r,className:c,TransitionComponent:i=l1,transitionDuration:a="auto",TransitionProps:u}=s,f=je(s,bt);R.useContext(V0);const{active:x,last:g,expanded:y}=R.useContext(N0),p=A({},s,{last:g}),d=jt(p);let m=a;return a==="auto"&&!i.muiSupportAuto&&(m=void 0),o.jsx(wt,A({className:Ue(d.root,c),ref:l,ownerState:p},f,{children:o.jsx(Rt,A({as:i,in:x||y,className:d.transition,ownerState:p,timeout:m,unmountOnExit:!0},u,{children:r}))}))});var S1={},yt=Ne;Object.defineProperty(S1,"__esModule",{value:!0});var _0=S1.default=void 0,zt=yt(Te()),St=o;_0=S1.default=(0,zt.default)((0,St.jsx)("path",{d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H15v-8h5V8zm-1 7V3.5L18.5 9zm4 12.66V16h5.66v2h-2.24l2.95 2.95-1.41 1.41L19 19.41v2.24h-2z"}),"FileOpen");var k1={},kt=Ne;Object.defineProperty(k1,"__esModule",{value:!0});var E0=k1.default=void 0,It=kt(Te()),Mt=o;E0=k1.default=(0,It.default)((0,Mt.jsx)("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutlineOutlined");function Se({size:e,...t}){return o.jsx(z,{display:"flex",mt:4,...t,children:o.jsx(Oe,{size:e})})}Se.propTypes={size:h.number};Se.defaultProps={size:24};function I1({did:e,projectId:t,title:l,logo:s,describe:r}){const i=`${`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e}/${t}/logo/upload`}/${s}`,[a,u]=R.useState(!1),f=We(x=>x.breakpoints.down("md"));return o.jsxs(z,{sx:{display:"flex",flexDirection:"row",color:a?"primary.main":"grey.900",gap:1},onPointerEnter:()=>u(!0),onPointerLeave:()=>u(!1),children:[o.jsx(M0,{sx:{borderRadius:1},src:i}),o.jsxs(z,{children:[o.jsx(be,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:f?"primary.main":""},children:l||"/"}),o.jsx(be,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:f||a?"primary.main":"grey.700"},children:r||"/"})]})]})}I1.propTypes={projectId:h.string.isRequired,did:h.string.isRequired,title:h.string.isRequired,logo:h.string.isRequired,describe:h.string.isRequired};function M1({initUrl:e}){const t=v1(),l=(e==null?void 0:e.searchParams.get("tenantScope"))||"",{t:s,locale:r}=te(),{api:c}=we(),{api:i}=s1(),[a,u]=R.useState(!0),{blocklet:f}=Ve(),[x,g]=R.useState(null),[y,p]=R.useState(!1),d=We(k=>k.breakpoints.down("xl")),{componentDid:m=""}=n1(),[b,v]=R.useState(null),C=()=>{c.getProjects({input:{did:f.meta.did,componentDid:m,tenantScope:l}}).then(k=>{const L=(k==null?void 0:k.projects)||[];u(!1),v(L)}).catch(k=>{u(!1),$.error(k.message)})},S=()=>{t(`${X.UNOWNED_DID}/create/none`,{replace:!0})},N=k=>{g(k)},T=()=>{u(!1),p(!0)},P=()=>{p(!1),g(null)},I=k=>{$.error(k.message),p(!1),g(null)},U=k=>{if(!(k!=null&&k.deleted)){$.error("Delete project failed");return}C(),p(!1),g(null)};if(R.useEffect(()=>{C()},[]),!b&&a)return o.jsx(z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:o.jsx(Se,{})});if(!b)return null;if(!b.length)return o.jsxs(z,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[o.jsx(z,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:s("blocklet.publish.blockletEmptyTip")}),o.jsx(z,{sx:{fontSize:14,color:"text.secondary",mb:3},children:s("blocklet.publish.createBlockletTip")}),o.jsx(e1,{onClick:S,variant:"contained",children:s("blocklet.publish.createBlocklet")})]});const V=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:k=>{const L=b[k];return o.jsx(ue,{to:`${L.id}`,children:o.jsx(I1,{did:f.meta.did,projectId:L.id,logo:L.blockletLogo,title:L.blockletTitle,describe:L.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{customBodyRender:k=>k?o.jsx(I0,{type:"success",children:k}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:k=>k?o.jsx(Q1,{size:14,compact:!0,responsive:!1,did:k}):null}},d||m?null:{label:s("common.createdBy"),name:"createdBy",options:{customBodyRender:k=>k?o.jsx(Q1,{onClick:()=>{t(`/.well-known/service/admin/members?did=${k}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:k}):null}},d||m?null:{label:s("common.scope"),name:"componentDid",options:{customBodyRender:k=>{const L=(f.children||[]).find(E=>E.meta.did===k);return L?o.jsxs(z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(C1,{size:14,blocklet:L,ancestors:[f]}),o.jsx(z,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:L.meta.title})]},k):""}}},d||l?null:{label:s("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:k=>o.jsx(z,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:o.jsx(be,{children:k})})}},{label:s("common.updatedAt"),name:"updatedAt",options:{customBodyRender:k=>o.jsx(g0,{value:Number(k),locale:r})}},{label:s("common.actions"),name:"actions",options:{customBodyRenderLite:k=>{const L=b[k];return o.jsxs(z,{display:"flex",children:[o.jsx(ue,{to:`${L.id}/new-release/${L.lastReleaseId}`,children:o.jsx(ve,{title:s("blocklet.publish.createRelease"),placement:"top",children:o.jsx(ge,{color:"primary","aria-label":"create",children:o.jsx(y2,{style:{fontSize:18}})})})}),!!L.lastReleaseId&&o.jsx(ve,{title:s("blocklet.publish.viewLastRelease",{name:L.blockletTitle}),placement:"top",children:o.jsx(ge,{color:"secondary","aria-label":"create",children:o.jsx(ue,{style:{display:"flex"},to:`${L.id}/view/${L.lastReleaseId}`,children:o.jsx(_0,{sx:{fontSize:18}})})})}),o.jsx(ve,{title:s("blocklet.publish.delete",{name:L.blockletTitle}),placement:"top",children:o.jsx(ge,{color:"primary","aria-label":"delete",onClick:()=>N(L),children:o.jsx(k0,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),M=y?o.jsx(u2,{open:!0,popup:!0,onClose:P,action:"check-has-project-id",locale:r,checkFn:i.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:U,onError:I,extraParams:{projectId:x.id,did:f.meta.did,name:x.blockletTitle},messages:{title:s("blocklet.publish.deleteProject.title",{name:x.blockletTitle}),scan:s("blocklet.publish.deleteProject.scan",{name:x.blockletTitle}),confirm:s("blocklet.publish.deleteProject.confirm"),success:s("blocklet.publish.deleteProject.success")}}):null;return o.jsxs(Pt,{children:[o.jsxs(z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[o.jsxs(z,{display:"flex",flexDirection:"row",alignItems:"center",children:[o.jsx(z,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:s("common.blockletStudio")}),o.jsx(ve,{title:s("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:o.jsx(E0,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),o.jsxs(e1,{onClick:S,variant:"contained",children:[o.jsx(j1,{style:{fontSize:"1.3em",marginRight:4}}),s("blocklet.publish.createBlocklet")]})]}),o.jsx(z,{mt:3}),o.jsx(w1,{className:"main-table",locale:r,data:b,columns:V,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1}}),x&&o.jsx(R1,{title:`${s("common.delete")} ${x.blockletTitle}`,description:s("blocklet.publish.deleteProject.description"),confirm:s("common.confirm"),onConfirm:T,onCancel:()=>g(null),children:o.jsx(z,{sx:{marginTop:2},children:[s("blocklet.publish.deleteProject.tip1"),s("blocklet.publish.deleteProject.tip2"),s("blocklet.publish.deleteProject.tip3")].map(k=>o.jsxs(z,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[o.jsx(z2,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),o.jsx(G,{component:"span",variant:"inherit",color:"text.secondary",children:k})]}))})}),M]})}M1.propTypes={initUrl:h.object};M1.defaultProps={initUrl:null};const Pt=ae(z)`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/react-D5g67fVw.js","assets/index-CvQpkp6C.js","assets/index-D8NuaJ66.css","assets/index-DeMjTJxJ.js","assets/preact.module-DJUF--8d.js","assets/index-m4ukMT05.js","assets/index-BeM0EvDH.js","assets/toUpper-Ccj-rFez.js","assets/index-BFruBwjT.js","assets/fallback-DA2HQbL8.js","assets/index-CF_vZ6wr.js","assets/Toolbar-DDNMlPZf.js","assets/Hidden-DhJpb55-.js","assets/index-BQHcS9Mc.js","assets/MoreVert-BTFxIHaV.js","assets/selector-lupSMMbD.js","assets/ExpandMore-Bu3C6pU8.js","assets/Avatar-B_ozaB1d.js","assets/useSlot-Lnh_3w1R.js","assets/resource-dialog-PcDAyoWb.js","assets/OpenInNew-BWbkYWxs.js","assets/CloseOutlined-C_pRRRMb.js","assets/use-mobile-E62R3PvF.js","assets/Link-6h9rQRZt.js","assets/index-q-zqQDlr.js","assets/index-CCsWG3Cf.js","assets/index-Be5Rna_o.js","assets/FormControlLabel-DJ7JqxQ9.js","assets/useFormControl-CVJHU3Z8.js","assets/index-BKhaY6h3.js","assets/FilterList-qJZckPS6.js","assets/useThemeProps-CDhmnq0d.js","assets/toPropertyKey-PLuKRk1e.js","assets/FormControl-DKCPWiUE.js","assets/FormGroup-QuE1_Stk.js","assets/InputLabel-C9tGpQ3p.js","assets/ListItemText-CiKmy0GT.js","assets/Select-DUGjpI0N.js","assets/TextField-BiJ3RQiw.js","assets/LastPage-B0el3h-h.js","assets/index-DTXVlwdz.js","assets/redux-CFX_KgA-.js","assets/Search-CbL27Q7U.js","assets/Delete-D4dMA0lG.js","assets/index-DX4QcWTB.js","assets/url-join-F3HDi_f9.js","assets/uniqBy-BJ4Rz_fc.js","assets/react-BW7E7-P9.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{au as a2,j as o,aH as se,cJ as v0,aL as A,fw as K1,aK as je,aF as $e,aG as Fe,T as G,r as R,aJ as m1,aM as c2,aN as Ue,aO as qe,cP as d2,fx as l1,Z as Te,$ as Ne,B as z,n as Oe,P as h,a1 as We,G as X,e as v1,u as te,aQ as we,aZ as Ve,by as n1,a3 as e1,L as ue,bL as g0,a as ve,aD as ge,K as u2,t as $,a0 as ae,dw as p2,ab as ye,c as pe,I as h2,bW as g1,ch as b0,cE as f2,cN as He,cO as j0,ak as x2,d2 as m2,cI as Je,bF as re,c4 as Qe,fi as v2,a9 as X1,b as ne,bn as w0,dy as R0,aj as b1,bo as C0,co as y0,aU as Ae,aT as g2,a4 as z0,fy as J1,f7 as Me,bl as b2,av as S0,cV as j2,l as w2,aC as R2,ar as C2,as as i1}from"./index-CvQpkp6C.js";import{d as j1}from"./Add-DK2sSVal.js";import{d as y2}from"./AddBox-k344mb3q.js";import{d as k0}from"./Delete-D4dMA0lG.js";import{d as z2}from"./Error-7Kc9kGgC.js";import{D as w1}from"./index-BKhaY6h3.js";import{T as I0,b as S2}from"./index-i5ly4LjU.js";import{C as R1}from"./confirm-B7pqTTSN.js";import{u as s1}from"./session-DUaMqnH_.js";import{W as Q1}from"./did-address-Ciyb1jN9.js";import{B as C1,d as k2}from"./ChevronRight-Clkn1-CT.js";import{S as be}from"./shorten-label-nc4Gz0wo.js";import{A as M0}from"./Avatar-B_ozaB1d.js";import{d as I2}from"./Download-YHpdHIjQ.js";import{d as M2}from"./QuestionMarkCircle-Deiz5Rc3.js";import{b as P2,c as Y1,T as L2}from"./index-q-zqQDlr.js";import{_ as Ie}from"./useSetState-Bsisx7wb.js";import{c as y1}from"./index-BeM0EvDH.js";import{C as u1,F as p1,S as T2}from"./FormControlLabel-DJ7JqxQ9.js";import{A as P0}from"./Alert-BBnZ-bJY.js";import{p as t1}from"./index-HqFqdQ4r.js";import"./api-LCPZdy3r.js";import{i as N2}from"./index-BATO4pBH.js";import{d as V2}from"./ExpandMore-Bu3C6pU8.js";import{d as D2}from"./OpenInNew-BWbkYWxs.js";import{u as L0}from"./useThemeProps-CDhmnq0d.js";import{u as _2}from"./useSlotProps-CvpMe4Jk.js";import{d as E2}from"./DeleteOutline-xp-yy9Ns.js";import{c as B2,A as T0,u as A2,S as O2,U as H2}from"./item-BNkHJk4v.js";import{d as $2}from"./ArrowDropDown-Ds7eP3kq.js";import{f as Le}from"./format-error-Db99DYGG.js";import{B as h1}from"./ButtonGroup-Brd5tASZ.js";import{T as Pe}from"./TextField-BiJ3RQiw.js";import{I as z1}from"./InputAdornment-btyswwKp.js";import{C as F2}from"./click-to-copy-DtOMfCfh.js";import{d as U2}from"./Launch-ByZVFHQK.js";import{L as q2}from"./MoreVert-BTFxIHaV.js";import{a as W2}from"./ListItemText-CiKmy0GT.js";import{S as Z1}from"./index-Be5Rna_o.js";import{M as G2}from"./index-BqtJq3EF.js";import{r as K2}from"./index-C7GXSvdc.js";import{d as X2}from"./Done-BLCIniIk.js";import{c as N0,d as V0,b as J2,S as Q2,a as Y2}from"./Stepper-uK2JpL--.js";import{R as Z2,a as e0}from"./RadioGroup-Go7EuXBQ.js";import"./FilterList-qJZckPS6.js";import"./toPropertyKey-PLuKRk1e.js";import"./FormControl-DKCPWiUE.js";import"./useFormControl-CVJHU3Z8.js";import"./FormGroup-QuE1_Stk.js";import"./InputLabel-C9tGpQ3p.js";import"./Select-DUGjpI0N.js";import"./LastPage-B0el3h-h.js";import"./Toolbar-DDNMlPZf.js";import"./index-DTXVlwdz.js";import"./redux-CFX_KgA-.js";import"./Search-CbL27Q7U.js";import"./index-CCsWG3Cf.js";import"./Link-6h9rQRZt.js";import"./useSlot-Lnh_3w1R.js";import"./jss-plugin-props-sort.esm-TYQD_Idh.js";const et=a2(o.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreHoriz"),tt=["slots","slotProps"],ot=se(v0)(({theme:e})=>A({display:"flex",marginLeft:`calc(${e.spacing(1)} * 0.5)`,marginRight:`calc(${e.spacing(1)} * 0.5)`},e.palette.mode==="light"?{backgroundColor:e.palette.grey[100],color:e.palette.grey[700]}:{backgroundColor:e.palette.grey[700],color:e.palette.grey[100]},{borderRadius:2,"&:hover, &:focus":A({},e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}),"&:active":A({boxShadow:e.shadows[0]},e.palette.mode==="light"?{backgroundColor:K1(e.palette.grey[200],.12)}:{backgroundColor:K1(e.palette.grey[600],.12)})})),lt=se(et)({width:24,height:16});function nt(e){const{slots:t={},slotProps:l={}}=e,s=je(e,tt),r=e;return o.jsx("li",{children:o.jsx(ot,A({focusRipple:!0},s,{ownerState:r,children:o.jsx(lt,A({as:t.CollapsedIcon,ownerState:r},l.collapsedIcon))}))})}function st(e){return Fe("MuiBreadcrumbs",e)}const rt=$e("MuiBreadcrumbs",["root","ol","li","separator"]),it=["children","className","component","slots","slotProps","expandText","itemsAfterCollapse","itemsBeforeCollapse","maxItems","separator"],at=e=>{const{classes:t}=e;return qe({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},st,t)},ct=se(G,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,t)=>[{[`& .${rt.li}`]:t.li},t.root]})({}),dt=se("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(e,t)=>t.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),ut=se("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(e,t)=>t.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function pt(e,t,l,s){return e.reduce((r,c,i)=>(i<e.length-1?r=r.concat(c,o.jsx(ut,{"aria-hidden":!0,className:t,ownerState:s,children:l},`separator-${i}`)):r.push(c),r),[])}const D0=R.forwardRef(function(t,l){const s=m1({props:t,name:"MuiBreadcrumbs"}),{children:r,className:c,component:i="nav",slots:a={},slotProps:u={},expandText:f="Show path",itemsAfterCollapse:x=1,itemsBeforeCollapse:g=1,maxItems:y=8,separator:p="/"}=s,d=je(s,it),[m,b]=R.useState(!1),v=A({},s,{component:i,expanded:m,expandText:f,itemsAfterCollapse:x,itemsBeforeCollapse:g,maxItems:y,separator:p}),C=at(v),S=c2({elementType:a.CollapsedIcon,externalSlotProps:u.collapsedIcon,ownerState:v}),N=R.useRef(null),T=I=>{const U=()=>{b(!0);const V=N.current.querySelector("a[href],button,[tabindex]");V&&V.focus()};return g+x>=I.length?I:[...I.slice(0,g),o.jsx(nt,{"aria-label":f,slots:{CollapsedIcon:a.CollapsedIcon},slotProps:{collapsedIcon:S},onClick:U},"ellipsis"),...I.slice(I.length-x,I.length)]},P=R.Children.toArray(r).filter(I=>R.isValidElement(I)).map((I,U)=>o.jsx("li",{className:C.li,children:I},`child-${U}`));return o.jsx(ct,A({ref:l,component:i,color:"text.secondary",className:Ue(C.root,c),ownerState:v},d,{children:o.jsx(dt,{className:C.ol,ref:N,ownerState:v,children:pt(m||y&&P.length<=y?P:T(P),C.separator,p,v)})}))});function ht(e){return Fe("MuiStepButton",e)}const t0=$e("MuiStepButton",["root","horizontal","vertical","touchRipple"]),ft=["children","className","icon","optional"],xt=e=>{const{classes:t,orientation:l}=e;return qe({root:["root",l],touchRipple:["touchRipple"]},ht,t)},mt=se(v0,{name:"MuiStepButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[{[`& .${t0.touchRipple}`]:t.touchRipple},t.root,t[l.orientation]]}})(({ownerState:e})=>A({width:"100%",padding:"24px 16px",margin:"-24px -16px",boxSizing:"content-box"},e.orientation==="vertical"&&{justifyContent:"flex-start",padding:"8px",margin:"-8px"},{[`& .${t0.touchRipple}`]:{color:"rgba(0, 0, 0, 0.3)"}})),vt=R.forwardRef(function(t,l){const s=m1({props:t,name:"MuiStepButton"}),{children:r,className:c,icon:i,optional:a}=s,u=je(s,ft),{disabled:f,active:x}=R.useContext(N0),{orientation:g}=R.useContext(V0),y=A({},s,{orientation:g}),p=xt(y),d={icon:i,optional:a},m=d2(r,["StepLabel"])?R.cloneElement(r,d):o.jsx(J2,A({},d,{children:r}));return o.jsx(mt,A({focusRipple:!0,disabled:f,TouchRippleProps:{className:p.touchRipple},className:Ue(p.root,c),ref:l,ownerState:y,"aria-current":x?"step":void 0},u,{children:m}))});function gt(e){return Fe("MuiStepContent",e)}$e("MuiStepContent",["root","last","transition"]);const bt=["children","className","TransitionComponent","transitionDuration","TransitionProps"],jt=e=>{const{classes:t,last:l}=e;return qe({root:["root",l&&"last"],transition:["transition"]},gt,t)},wt=se("div",{name:"MuiStepContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.root,l.last&&t.last]}})(({ownerState:e,theme:t})=>A({marginLeft:12,paddingLeft:20,paddingRight:8,borderLeft:t.vars?`1px solid ${t.vars.palette.StepContent.border}`:`1px solid ${t.palette.mode==="light"?t.palette.grey[400]:t.palette.grey[600]}`},e.last&&{borderLeft:"none"})),Rt=se(l1,{name:"MuiStepContent",slot:"Transition",overridesResolver:(e,t)=>t.transition})({}),Ct=R.forwardRef(function(t,l){const s=m1({props:t,name:"MuiStepContent"}),{children:r,className:c,TransitionComponent:i=l1,transitionDuration:a="auto",TransitionProps:u}=s,f=je(s,bt);R.useContext(V0);const{active:x,last:g,expanded:y}=R.useContext(N0),p=A({},s,{last:g}),d=jt(p);let m=a;return a==="auto"&&!i.muiSupportAuto&&(m=void 0),o.jsx(wt,A({className:Ue(d.root,c),ref:l,ownerState:p},f,{children:o.jsx(Rt,A({as:i,in:x||y,className:d.transition,ownerState:p,timeout:m,unmountOnExit:!0},u,{children:r}))}))});var S1={},yt=Ne;Object.defineProperty(S1,"__esModule",{value:!0});var _0=S1.default=void 0,zt=yt(Te()),St=o;_0=S1.default=(0,zt.default)((0,St.jsx)("path",{d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H15v-8h5V8zm-1 7V3.5L18.5 9zm4 12.66V16h5.66v2h-2.24l2.95 2.95-1.41 1.41L19 19.41v2.24h-2z"}),"FileOpen");var k1={},kt=Ne;Object.defineProperty(k1,"__esModule",{value:!0});var E0=k1.default=void 0,It=kt(Te()),Mt=o;E0=k1.default=(0,It.default)((0,Mt.jsx)("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutlineOutlined");function Se({size:e,...t}){return o.jsx(z,{display:"flex",mt:4,...t,children:o.jsx(Oe,{size:e})})}Se.propTypes={size:h.number};Se.defaultProps={size:24};function I1({did:e,projectId:t,title:l,logo:s,describe:r}){const i=`${`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e}/${t}/logo/upload`}/${s}`,[a,u]=R.useState(!1),f=We(x=>x.breakpoints.down("md"));return o.jsxs(z,{sx:{display:"flex",flexDirection:"row",color:a?"primary.main":"grey.900",gap:1},onPointerEnter:()=>u(!0),onPointerLeave:()=>u(!1),children:[o.jsx(M0,{sx:{borderRadius:1},src:i}),o.jsxs(z,{children:[o.jsx(be,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:f?"primary.main":""},children:l||"/"}),o.jsx(be,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:f||a?"primary.main":"grey.700"},children:r||"/"})]})]})}I1.propTypes={projectId:h.string.isRequired,did:h.string.isRequired,title:h.string.isRequired,logo:h.string.isRequired,describe:h.string.isRequired};function M1({initUrl:e}){const t=v1(),l=(e==null?void 0:e.searchParams.get("tenantScope"))||"",{t:s,locale:r}=te(),{api:c}=we(),{api:i}=s1(),[a,u]=R.useState(!0),{blocklet:f}=Ve(),[x,g]=R.useState(null),[y,p]=R.useState(!1),d=We(k=>k.breakpoints.down("xl")),{componentDid:m=""}=n1(),[b,v]=R.useState(null),C=()=>{c.getProjects({input:{did:f.meta.did,componentDid:m,tenantScope:l}}).then(k=>{const L=(k==null?void 0:k.projects)||[];u(!1),v(L)}).catch(k=>{u(!1),$.error(k.message)})},S=()=>{t(`${X.UNOWNED_DID}/create/none`,{replace:!0})},N=k=>{g(k)},T=()=>{u(!1),p(!0)},P=()=>{p(!1),g(null)},I=k=>{$.error(k.message),p(!1),g(null)},U=k=>{if(!(k!=null&&k.deleted)){$.error("Delete project failed");return}C(),p(!1),g(null)};if(R.useEffect(()=>{C()},[]),!b&&a)return o.jsx(z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:o.jsx(Se,{})});if(!b)return null;if(!b.length)return o.jsxs(z,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[o.jsx(z,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:s("blocklet.publish.blockletEmptyTip")}),o.jsx(z,{sx:{fontSize:14,color:"text.secondary",mb:3},children:s("blocklet.publish.createBlockletTip")}),o.jsx(e1,{onClick:S,variant:"contained",children:s("blocklet.publish.createBlocklet")})]});const V=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:k=>{const L=b[k];return o.jsx(ue,{to:`${L.id}`,children:o.jsx(I1,{did:f.meta.did,projectId:L.id,logo:L.blockletLogo,title:L.blockletTitle,describe:L.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{customBodyRender:k=>k?o.jsx(I0,{type:"success",children:k}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:k=>k?o.jsx(Q1,{size:14,compact:!0,responsive:!1,did:k}):null}},d||m?null:{label:s("common.createdBy"),name:"createdBy",options:{customBodyRender:k=>k?o.jsx(Q1,{onClick:()=>{t(`/.well-known/service/admin/members?did=${k}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:k}):null}},d||m?null:{label:s("common.scope"),name:"componentDid",options:{customBodyRender:k=>{const L=(f.children||[]).find(E=>E.meta.did===k);return L?o.jsxs(z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(C1,{size:14,blocklet:L,ancestors:[f]}),o.jsx(z,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:L.meta.title})]},k):""}}},d||l?null:{label:s("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:k=>o.jsx(z,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:o.jsx(be,{children:k})})}},{label:s("common.updatedAt"),name:"updatedAt",options:{customBodyRender:k=>o.jsx(g0,{value:Number(k),locale:r})}},{label:s("common.actions"),name:"actions",options:{customBodyRenderLite:k=>{const L=b[k];return o.jsxs(z,{display:"flex",children:[o.jsx(ue,{to:`${L.id}/new-release/${L.lastReleaseId}`,children:o.jsx(ve,{title:s("blocklet.publish.createRelease"),placement:"top",children:o.jsx(ge,{color:"primary","aria-label":"create",children:o.jsx(y2,{style:{fontSize:18}})})})}),!!L.lastReleaseId&&o.jsx(ve,{title:s("blocklet.publish.viewLastRelease",{name:L.blockletTitle}),placement:"top",children:o.jsx(ge,{color:"secondary","aria-label":"create",children:o.jsx(ue,{style:{display:"flex"},to:`${L.id}/view/${L.lastReleaseId}`,children:o.jsx(_0,{sx:{fontSize:18}})})})}),o.jsx(ve,{title:s("blocklet.publish.delete",{name:L.blockletTitle}),placement:"top",children:o.jsx(ge,{color:"primary","aria-label":"delete",onClick:()=>N(L),children:o.jsx(k0,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),M=y?o.jsx(u2,{open:!0,popup:!0,onClose:P,action:"check-has-project-id",locale:r,checkFn:i.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:U,onError:I,extraParams:{projectId:x.id,did:f.meta.did,name:x.blockletTitle},messages:{title:s("blocklet.publish.deleteProject.title",{name:x.blockletTitle}),scan:s("blocklet.publish.deleteProject.scan",{name:x.blockletTitle}),confirm:s("blocklet.publish.deleteProject.confirm"),success:s("blocklet.publish.deleteProject.success")}}):null;return o.jsxs(Pt,{children:[o.jsxs(z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[o.jsxs(z,{display:"flex",flexDirection:"row",alignItems:"center",children:[o.jsx(z,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:s("common.blockletStudio")}),o.jsx(ve,{title:s("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:o.jsx(E0,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),o.jsxs(e1,{onClick:S,variant:"contained",children:[o.jsx(j1,{style:{fontSize:"1.3em",marginRight:4}}),s("blocklet.publish.createBlocklet")]})]}),o.jsx(z,{mt:3}),o.jsx(w1,{className:"main-table",locale:r,data:b,columns:V,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1}}),x&&o.jsx(R1,{title:`${s("common.delete")} ${x.blockletTitle}`,description:s("blocklet.publish.deleteProject.description"),confirm:s("common.confirm"),onConfirm:T,onCancel:()=>g(null),children:o.jsx(z,{sx:{marginTop:2},children:[s("blocklet.publish.deleteProject.tip1"),s("blocklet.publish.deleteProject.tip2"),s("blocklet.publish.deleteProject.tip3")].map(k=>o.jsxs(z,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[o.jsx(z2,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),o.jsx(G,{component:"span",variant:"inherit",color:"text.secondary",children:k})]}))})}),M]})}M1.propTypes={initUrl:h.object};M1.defaultProps={initUrl:null};const Pt=ae(z)`
|
|
3
3
|
.main-table > div:first-child {
|
|
4
4
|
display: none;
|
|
5
5
|
}
|
|
@@ -133,7 +133,7 @@ import{au as a2,j as o,aH as se,cJ as v0,aL as A,fw as K1,aK as je,aF as $e,aG a
|
|
|
133
133
|
background: #fff;
|
|
134
134
|
z-index: 10;
|
|
135
135
|
}
|
|
136
|
-
`,a0="lastWantToConnectStoreId";function $l(e){var a,u;const[t,l]=R.useState(null),{session:s}=s1(),r=R.useCallback(f=>{l(f),localStorage.setItem(a0,f==null?void 0:f.id)},[l]),c=R.useMemo(()=>{var y,p,d,m;const f=localStorage.getItem(a0),x=f?(((y=e==null?void 0:e.settings)==null?void 0:y.storeList)||[]).find(b=>b.id===f):null;if(x)return x;let g=(((p=e==null?void 0:e.settings)==null?void 0:p.storeList)||[]).find(b=>{var v;return!(b.id!==X.BLOCKLET_STORE.id||b.scope&&b.scope!=="studio"&&b.scope!==((v=s==null?void 0:s.user)==null?void 0:v.did))});return g||(g=(m=(d=e==null?void 0:e.settings)==null?void 0:d.storeList)==null?void 0:m[0]),g},[(a=e==null?void 0:e.settings)==null?void 0:a.storeList,(u=s==null?void 0:s.user)==null?void 0:u.did]);return[t||c||{},r]}const d1={};async function W0(e,{interval:t=1e3,maxDuration:l=120*1e3,intervalFirst:s=4e3,timerKey:r=""}){d1[r]&&clearTimeout(d1[r]),await new Promise(a=>setTimeout(a,s));const c=Date.now(),i=async(a,u)=>{try{const f=await e();a(f)}catch(f){Date.now()-c>l?u(f):r?d1[r]=setTimeout(()=>i(a,u),t):setTimeout(()=>i(a,u),t)}};return new Promise(i)}function Fl(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function Ul(e,{did:t,projectId:l,messageId:s}){return W0(async()=>{var c;const r=await e.getProject({input:{did:t,projectId:l,messageId:s}});if(!((c=r==null?void 0:r.project)!=null&&c.blockletDid))throw new Error("Connected store not found");return r.project.blockletDid},{timerKey:"connect-studio"})}function ql(e,{did:t,projectId:l,storeId:s}){return W0(async()=>{var i,a;const r=await e.getProject({input:{did:t,projectId:l,messageId:""}});if(!((a=(i=r==null?void 0:r.project)==null?void 0:i.connectedStores)!=null&&a.length))throw new Error("Connected store not found");if(!r.project.connectedStores.find(u=>u.storeId===s))throw new Error("Connected store not found")},{timerKey:`connect-store-${s}`})}const G0=({fromBlocklet:e,nodeInfo:t,blocklet:l,userDid:s})=>{var i,a;const r=e?(i=l==null?void 0:l.meta)==null?void 0:i.did:t==null?void 0:t.did;let c=e?((a=l==null?void 0:l.settings)==null?void 0:a.storeList)||[]:(t==null?void 0:t.blockletRegistryList)||[];return Array.isArray(c)||(c=[]),c=c.filter(u=>u.protected||!u.scope||u.scope==="studio"||u.scope===s),{teamDid:r,storeList:c}};function O1({blocklet:e,store:t={},onChangeStore:l,onClick:s,disabled:r,loading:c,componentDid:i}){var L,E,B;const{t:a}=te(),{session:u}=s1(),{api:f,info:x,inService:g}=we(),y=Ve(),[p,d]=R.useState(!1),m=R.useRef(null),[b,v]=R.useState(!1),[C,S]=R.useState(null),N=O=>{l(O),d(!1)},T=()=>{d(!p)},P=O=>{m.current&&m.current.contains(O.target)||d(!1)},I=()=>{v(!0)},U=()=>{v(!1)},V=async()=>{var O;if(C)try{await f.deleteBlockletStore({input:{teamDid:e.meta.did,url:C.url,projectId:"",scope:C.scope||"studio"}}),await((O=y==null?void 0:y.actions)==null?void 0:O.refreshBlocklet())}catch(K){$.error(`Remove Blocklet Store Error: ${Le(K)}`)}finally{S(null)}},{storeList:M}=G0({fromBlocklet:g,blocklet:e,nodeInfo:x,componentDid:i,userDid:(L=u==null?void 0:u.user)==null?void 0:L.did}),k=(E=e==null?void 0:e.meta)==null?void 0:E.did;return o.jsxs(o.Fragment,{children:[o.jsxs(h1,{disabled:r,ref:m,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[o.jsxs(ne,{onClick:s,children:[c&&o.jsx(Oe,{size:14,sx:{mr:.5}}),`${a("common.connect")} ${t.name||""}`]}),o.jsx(ne,{size:"small","aria-controls":p?"split-button-menu":void 0,"aria-expanded":p?"true":void 0,"aria-label":"select merge strategy","aria-haspopup":"menu",onClick:T,children:o.jsx($2,{})})]}),o.jsx(w0,{sx:{zIndex:10},open:p,anchorEl:m.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:O})=>o.jsx(R0,{...O,style:{transformOrigin:"center top"},children:o.jsx(b1,{children:o.jsx(C0,{onClickAway:P,children:o.jsxs(y0,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[M==null?void 0:M.map(K=>{var J;return o.jsxs(Ae,{selected:K.id===(t==null?void 0:t.id),sx:{height:56},onClick:()=>N(K),children:[o.jsxs(z,{children:[o.jsx(be,{sx:{fontSize:"16px"},maxLength:24,children:K.name}),o.jsx(be,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:K.url})]}),B2({store:K,userDid:(J=u==null?void 0:u.user)==null?void 0:J.did})&&o.jsx(ge,{sx:{ml:1},onClick:W=>{W.preventDefault(),W.stopPropagation(),S(K)},children:o.jsx(re,{icon:"ic:outline-delete"})})]},K.url)}),o.jsx(g2,{}),o.jsxs(Ae,{onClick:I,children:[o.jsx(j1,{font:!0}),o.jsx(G,{variant:"inherit",children:a("store.blockletRegistry.addRegistry")})]})]})})})})}),b&&o.jsx(T0,{hiddenChildren:!0,open:!0,onClose:U,teamDid:k,storeList:M,scope:"studio",onAdd:(B=y==null?void 0:y.actions)==null?void 0:B.refreshBlocklet}),C&&o.jsx(R1,{displayError:!0,title:`${a("common.delete")} ${C.name}`,description:a("blocklet.publish.deleteStoreTip",{name:C.name}),confirm:a("common.confirm"),onConfirm:V,onCancel:()=>S(null)})]})}O1.propTypes={store:h.object,blocklet:h.object,onChangeStore:h.func.isRequired,onClick:h.func.isRequired,loading:h.bool.isRequired,disabled:h.bool.isRequired,componentDid:h.string.isRequired,projectType:h.string.isRequired,getData:h.func.isRequired};O1.defaultProps={store:null,blocklet:null};const c0=[".webp",".jpg",".jpeg",".png",".gif",".svg"],d0=1024*1024*10,u0=R.lazy(()=>z0(()=>import("./react-D1bqTbo3.js").then(e=>e.r),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47])).then(e=>({default:e.Uploader})));function K0({projectId:e,readOnly:t,loading:l,blocklet:s,params:r,setParams:c,paramsErrTip:i,setParamsErrTip:a,setLoading:u,initUrl:f,initLogoUrl:x,setInitLogoUrl:g,componentDid:y}){const{t:p}=te(),{api:d}=we(),m=v1(),b=R.useRef(null),v=R.useRef(null),[C,S]=$l(s),N=A2({messageType:"connect-store-message",onOpen:()=>u(!0),onClose:()=>u(!1)}),T=async L=>{const E=setTimeout(()=>{u(!1)},2e4),B=await Ul(d,L);u(!1),clearTimeout(E),window.parent.postMessage({event:"studioDialog.connected",componentDid:y},"*"),m(window.location.pathname.replace(`${X.UNOWNED_DID}/create`,`${B}/create`),{replace:!0})},P=()=>{if(!r.blockletTitle){$.error(p("blocklet.publish.errorTip.noTitle"));return}if(!(C!=null&&C.url)){$.error(p("blocklet.publish.noStoreSelected"));return}const L=Fl();N(async(E,B)=>{var O,K,J;try{const W=await d.connectByStudio({input:{did:(O=s==null?void 0:s.meta)==null?void 0:O.did,blockletTitle:r==null?void 0:r.blockletTitle,storeUrl:C.url,storeId:C.id,storeName:C.name,type:((K=r==null?void 0:r.blockletComponents)==null?void 0:K.length)>0?"pack":"resource",componentDid:y,messageId:L,tenantScope:(f==null?void 0:f.searchParams.get("tenantScope"))||""}});if(!(W!=null&&W.url)){$.error("failed to connect to store");return}B(W.url),T({did:(J=s==null?void 0:s.meta)==null?void 0:J.did,projectId:"",messageId:L})}catch(W){const Z=Le(W);$.error(Z),u(!1)}})},I=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${s.meta.did}/${e}/logo/upload`,U=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${s.meta.did}/${e}/screenshot/upload`,V=r!=null&&r.blockletLogo?`${I}/${r.blockletLogo}`:`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,M=((r==null?void 0:r.blockletScreenshots)||[]).filter(Boolean).map(L=>`${U}/${L}`),k=()=>t?!1:!e||e===X.UNOWNED_DID?($.error(p("blocklet.publish.errorTip.noFirstDid")),!1):!0;return o.jsxs(Wl,{children:[o.jsx(z,{display:"flex",className:"section",children:o.jsxs(z,{sx:{flex:1},children:[o.jsx(Pe,{disabled:l||t,label:`Blocklet ${p("common.title")}`,placeholder:`Blocklet ${p("common.title")}`,InputProps:{"data-cy":"blocklet-title",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:r.blockletTitle||"",onChange:L=>{a({blockletTitle:""}),c({blockletTitle:L.target.value})},error:!!i.blockletTitle,helperText:i.blockletTitle||""}),o.jsx(Pe,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"export-blocklet-did",endAdornment:e===X.UNOWNED_DID&&o.jsx(z1,{position:"end",children:o.jsx(O1,{blocklet:s,store:C,componentDid:y,onChangeStore:S,disabled:!r.blockletTitle||t||l,loading:l,onClick:P})})},error:!!i.projectId,helperText:i.projectId||"",value:e===X.UNOWNED_DID?"":`did:abt:${e}`,sx:{mt:3}}),o.jsx(Pe,{disabled:l||t,label:`Blocklet ${p("common.description")}`,placeholder:`Blocklet ${p("common.description")}`,InputProps:{"data-cy":"blocklet-description",readOnly:t},required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:r.blockletDescription||"",onChange:L=>{a({blockletDescription:""}),c({blockletDescription:L.target.value})},error:!!i.blockletDescription,helperText:i.blockletDescription||"",sx:{mt:3}})]})}),o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(z,{sx:{flex:1},children:[o.jsxs(z,{display:"flex",children:[o.jsx(G,{variant:"subtitle1",sx:{mr:2},children:p("common.logo")}),o.jsx(z,{sx:{flex:1,cursor:t?"default":"pointer"},children:o.jsx(M0,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:x||V,onClick:()=>{k()&&b.current.open()}})})]}),o.jsxs(z,{display:"flex",mt:3,children:[o.jsx(G,{variant:"subtitle1",sx:{mr:2},children:p("common.screenshot")}),o.jsxs(z,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap"},children:[M.map((L,E)=>o.jsxs(z,{className:"screenshot",children:[o.jsx("img",{alt:"screenshot",src:L}),!t&&o.jsx(ge,{className:"action",onClick:()=>{c(B=>{const O=[...B.blockletScreenshots];return O.splice(E,1),{...B,blockletScreenshots:O}})},children:o.jsx(E2,{})})]},L)),M.length<5&&o.jsx(z,{sx:{width:200,height:140,background:"#eee",cursor:t?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{k()&&v.current.open()},children:"+"})]})]})]})}),o.jsxs(R.Suspense,{fallback:o.jsx(Se,{}),children:[o.jsx(u0,{ref:b,popup:!0,onUploadFinish:L=>{c({blockletLogo:L.data.filename}),g(""),b.current.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:I,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:c0,maxFileSize:d0,maxNumberOfFiles:1}}},"uploader-logo"),o.jsx(u0,{ref:v,popup:!0,onUploadFinish:L=>{c(E=>{var O;const B=E.blockletScreenshots||[];return B.push((O=L.data)==null?void 0:O.filename),{...E,blockletScreenshots:B}}),v.current.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:U,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:c0,maxFileSize:d0,maxNumberOfFiles:5-M.length}}},"uploader-screenshot")]})]})}K0.propTypes={projectId:h.string.isRequired,readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,loading:h.bool.isRequired,blocklet:h.object.isRequired,setLoading:h.func.isRequired,initUrl:h.object.isRequired,componentDid:h.isRequired,initLogoUrl:h.string.isRequired,setInitLogoUrl:h.func.isRequired};const Wl=ae.div`
|
|
136
|
+
`,a0="lastWantToConnectStoreId";function $l(e){var a,u;const[t,l]=R.useState(null),{session:s}=s1(),r=R.useCallback(f=>{l(f),localStorage.setItem(a0,f==null?void 0:f.id)},[l]),c=R.useMemo(()=>{var y,p,d,m;const f=localStorage.getItem(a0),x=f?(((y=e==null?void 0:e.settings)==null?void 0:y.storeList)||[]).find(b=>b.id===f):null;if(x)return x;let g=(((p=e==null?void 0:e.settings)==null?void 0:p.storeList)||[]).find(b=>{var v;return!(b.id!==X.BLOCKLET_STORE.id||b.scope&&b.scope!=="studio"&&b.scope!==((v=s==null?void 0:s.user)==null?void 0:v.did))});return g||(g=(m=(d=e==null?void 0:e.settings)==null?void 0:d.storeList)==null?void 0:m[0]),g},[(a=e==null?void 0:e.settings)==null?void 0:a.storeList,(u=s==null?void 0:s.user)==null?void 0:u.did]);return[t||c||{},r]}const d1={};async function W0(e,{interval:t=1e3,maxDuration:l=120*1e3,intervalFirst:s=4e3,timerKey:r=""}){d1[r]&&clearTimeout(d1[r]),await new Promise(a=>setTimeout(a,s));const c=Date.now(),i=async(a,u)=>{try{const f=await e();a(f)}catch(f){Date.now()-c>l?u(f):r?d1[r]=setTimeout(()=>i(a,u),t):setTimeout(()=>i(a,u),t)}};return new Promise(i)}function Fl(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function Ul(e,{did:t,projectId:l,messageId:s}){return W0(async()=>{var c;const r=await e.getProject({input:{did:t,projectId:l,messageId:s}});if(!((c=r==null?void 0:r.project)!=null&&c.blockletDid))throw new Error("Connected store not found");return r.project.blockletDid},{timerKey:"connect-studio"})}function ql(e,{did:t,projectId:l,storeId:s}){return W0(async()=>{var i,a;const r=await e.getProject({input:{did:t,projectId:l,messageId:""}});if(!((a=(i=r==null?void 0:r.project)==null?void 0:i.connectedStores)!=null&&a.length))throw new Error("Connected store not found");if(!r.project.connectedStores.find(u=>u.storeId===s))throw new Error("Connected store not found")},{timerKey:`connect-store-${s}`})}const G0=({fromBlocklet:e,nodeInfo:t,blocklet:l,userDid:s})=>{var i,a;const r=e?(i=l==null?void 0:l.meta)==null?void 0:i.did:t==null?void 0:t.did;let c=e?((a=l==null?void 0:l.settings)==null?void 0:a.storeList)||[]:(t==null?void 0:t.blockletRegistryList)||[];return Array.isArray(c)||(c=[]),c=c.filter(u=>u.protected||!u.scope||u.scope==="studio"||u.scope===s),{teamDid:r,storeList:c}};function O1({blocklet:e,store:t={},onChangeStore:l,onClick:s,disabled:r,loading:c,componentDid:i}){var L,E,B;const{t:a}=te(),{session:u}=s1(),{api:f,info:x,inService:g}=we(),y=Ve(),[p,d]=R.useState(!1),m=R.useRef(null),[b,v]=R.useState(!1),[C,S]=R.useState(null),N=O=>{l(O),d(!1)},T=()=>{d(!p)},P=O=>{m.current&&m.current.contains(O.target)||d(!1)},I=()=>{v(!0)},U=()=>{v(!1)},V=async()=>{var O;if(C)try{await f.deleteBlockletStore({input:{teamDid:e.meta.did,url:C.url,projectId:"",scope:C.scope||"studio"}}),await((O=y==null?void 0:y.actions)==null?void 0:O.refreshBlocklet())}catch(K){$.error(`Remove Blocklet Store Error: ${Le(K)}`)}finally{S(null)}},{storeList:M}=G0({fromBlocklet:g,blocklet:e,nodeInfo:x,componentDid:i,userDid:(L=u==null?void 0:u.user)==null?void 0:L.did}),k=(E=e==null?void 0:e.meta)==null?void 0:E.did;return o.jsxs(o.Fragment,{children:[o.jsxs(h1,{disabled:r,ref:m,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[o.jsxs(ne,{onClick:s,children:[c&&o.jsx(Oe,{size:14,sx:{mr:.5}}),`${a("common.connect")} ${t.name||""}`]}),o.jsx(ne,{size:"small","aria-controls":p?"split-button-menu":void 0,"aria-expanded":p?"true":void 0,"aria-label":"select merge strategy","aria-haspopup":"menu",onClick:T,children:o.jsx($2,{})})]}),o.jsx(w0,{sx:{zIndex:10},open:p,anchorEl:m.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:O})=>o.jsx(R0,{...O,style:{transformOrigin:"center top"},children:o.jsx(b1,{children:o.jsx(C0,{onClickAway:P,children:o.jsxs(y0,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[M==null?void 0:M.map(K=>{var J;return o.jsxs(Ae,{selected:K.id===(t==null?void 0:t.id),sx:{height:56},onClick:()=>N(K),children:[o.jsxs(z,{children:[o.jsx(be,{sx:{fontSize:"16px"},maxLength:24,children:K.name}),o.jsx(be,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:K.url})]}),B2({store:K,userDid:(J=u==null?void 0:u.user)==null?void 0:J.did})&&o.jsx(ge,{sx:{ml:1},onClick:W=>{W.preventDefault(),W.stopPropagation(),S(K)},children:o.jsx(re,{icon:"ic:outline-delete"})})]},K.url)}),o.jsx(g2,{}),o.jsxs(Ae,{onClick:I,children:[o.jsx(j1,{font:!0}),o.jsx(G,{variant:"inherit",children:a("store.blockletRegistry.addRegistry")})]})]})})})})}),b&&o.jsx(T0,{hiddenChildren:!0,open:!0,onClose:U,teamDid:k,storeList:M,scope:"studio",onAdd:(B=y==null?void 0:y.actions)==null?void 0:B.refreshBlocklet}),C&&o.jsx(R1,{displayError:!0,title:`${a("common.delete")} ${C.name}`,description:a("blocklet.publish.deleteStoreTip",{name:C.name}),confirm:a("common.confirm"),onConfirm:V,onCancel:()=>S(null)})]})}O1.propTypes={store:h.object,blocklet:h.object,onChangeStore:h.func.isRequired,onClick:h.func.isRequired,loading:h.bool.isRequired,disabled:h.bool.isRequired,componentDid:h.string.isRequired,projectType:h.string.isRequired,getData:h.func.isRequired};O1.defaultProps={store:null,blocklet:null};const c0=[".webp",".jpg",".jpeg",".png",".gif",".svg"],d0=1024*1024*10,u0=R.lazy(()=>z0(()=>import("./react-D5g67fVw.js").then(e=>e.r),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47])).then(e=>({default:e.Uploader})));function K0({projectId:e,readOnly:t,loading:l,blocklet:s,params:r,setParams:c,paramsErrTip:i,setParamsErrTip:a,setLoading:u,initUrl:f,initLogoUrl:x,setInitLogoUrl:g,componentDid:y}){const{t:p}=te(),{api:d}=we(),m=v1(),b=R.useRef(null),v=R.useRef(null),[C,S]=$l(s),N=A2({messageType:"connect-store-message",onOpen:()=>u(!0),onClose:()=>u(!1)}),T=async L=>{const E=setTimeout(()=>{u(!1)},2e4),B=await Ul(d,L);u(!1),clearTimeout(E),window.parent.postMessage({event:"studioDialog.connected",componentDid:y},"*"),m(window.location.pathname.replace(`${X.UNOWNED_DID}/create`,`${B}/create`),{replace:!0})},P=()=>{if(!r.blockletTitle){$.error(p("blocklet.publish.errorTip.noTitle"));return}if(!(C!=null&&C.url)){$.error(p("blocklet.publish.noStoreSelected"));return}const L=Fl();N(async(E,B)=>{var O,K,J;try{const W=await d.connectByStudio({input:{did:(O=s==null?void 0:s.meta)==null?void 0:O.did,blockletTitle:r==null?void 0:r.blockletTitle,storeUrl:C.url,storeId:C.id,storeName:C.name,type:((K=r==null?void 0:r.blockletComponents)==null?void 0:K.length)>0?"pack":"resource",componentDid:y,messageId:L,tenantScope:(f==null?void 0:f.searchParams.get("tenantScope"))||""}});if(!(W!=null&&W.url)){$.error("failed to connect to store");return}B(W.url),T({did:(J=s==null?void 0:s.meta)==null?void 0:J.did,projectId:"",messageId:L})}catch(W){const Z=Le(W);$.error(Z),u(!1)}})},I=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${s.meta.did}/${e}/logo/upload`,U=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${s.meta.did}/${e}/screenshot/upload`,V=r!=null&&r.blockletLogo?`${I}/${r.blockletLogo}`:`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,M=((r==null?void 0:r.blockletScreenshots)||[]).filter(Boolean).map(L=>`${U}/${L}`),k=()=>t?!1:!e||e===X.UNOWNED_DID?($.error(p("blocklet.publish.errorTip.noFirstDid")),!1):!0;return o.jsxs(Wl,{children:[o.jsx(z,{display:"flex",className:"section",children:o.jsxs(z,{sx:{flex:1},children:[o.jsx(Pe,{disabled:l||t,label:`Blocklet ${p("common.title")}`,placeholder:`Blocklet ${p("common.title")}`,InputProps:{"data-cy":"blocklet-title",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:r.blockletTitle||"",onChange:L=>{a({blockletTitle:""}),c({blockletTitle:L.target.value})},error:!!i.blockletTitle,helperText:i.blockletTitle||""}),o.jsx(Pe,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"export-blocklet-did",endAdornment:e===X.UNOWNED_DID&&o.jsx(z1,{position:"end",children:o.jsx(O1,{blocklet:s,store:C,componentDid:y,onChangeStore:S,disabled:!r.blockletTitle||t||l,loading:l,onClick:P})})},error:!!i.projectId,helperText:i.projectId||"",value:e===X.UNOWNED_DID?"":`did:abt:${e}`,sx:{mt:3}}),o.jsx(Pe,{disabled:l||t,label:`Blocklet ${p("common.description")}`,placeholder:`Blocklet ${p("common.description")}`,InputProps:{"data-cy":"blocklet-description",readOnly:t},required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:r.blockletDescription||"",onChange:L=>{a({blockletDescription:""}),c({blockletDescription:L.target.value})},error:!!i.blockletDescription,helperText:i.blockletDescription||"",sx:{mt:3}})]})}),o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(z,{sx:{flex:1},children:[o.jsxs(z,{display:"flex",children:[o.jsx(G,{variant:"subtitle1",sx:{mr:2},children:p("common.logo")}),o.jsx(z,{sx:{flex:1,cursor:t?"default":"pointer"},children:o.jsx(M0,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:x||V,onClick:()=>{k()&&b.current.open()}})})]}),o.jsxs(z,{display:"flex",mt:3,children:[o.jsx(G,{variant:"subtitle1",sx:{mr:2},children:p("common.screenshot")}),o.jsxs(z,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap"},children:[M.map((L,E)=>o.jsxs(z,{className:"screenshot",children:[o.jsx("img",{alt:"screenshot",src:L}),!t&&o.jsx(ge,{className:"action",onClick:()=>{c(B=>{const O=[...B.blockletScreenshots];return O.splice(E,1),{...B,blockletScreenshots:O}})},children:o.jsx(E2,{})})]},L)),M.length<5&&o.jsx(z,{sx:{width:200,height:140,background:"#eee",cursor:t?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{k()&&v.current.open()},children:"+"})]})]})]})}),o.jsxs(R.Suspense,{fallback:o.jsx(Se,{}),children:[o.jsx(u0,{ref:b,popup:!0,onUploadFinish:L=>{c({blockletLogo:L.data.filename}),g(""),b.current.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:I,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:c0,maxFileSize:d0,maxNumberOfFiles:1}}},"uploader-logo"),o.jsx(u0,{ref:v,popup:!0,onUploadFinish:L=>{c(E=>{var O;const B=E.blockletScreenshots||[];return B.push((O=L.data)==null?void 0:O.filename),{...E,blockletScreenshots:B}}),v.current.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:U,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:c0,maxFileSize:d0,maxNumberOfFiles:5-M.length}}},"uploader-screenshot")]})]})}K0.propTypes={projectId:h.string.isRequired,readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,loading:h.bool.isRequired,blocklet:h.object.isRequired,setLoading:h.func.isRequired,initUrl:h.object.isRequired,componentDid:h.isRequired,initLogoUrl:h.string.isRequired,setInitLogoUrl:h.func.isRequired};const Wl=ae.div`
|
|
137
137
|
margin-top: 24px;
|
|
138
138
|
.screenshot {
|
|
139
139
|
margin-bottom: 16px;
|
|
@@ -178,7 +178,7 @@ import{au as a2,j as o,aH as se,cJ as v0,aL as A,fw as K1,aK as je,aF as $e,aG a
|
|
|
178
178
|
padding-bottom: 12px;
|
|
179
179
|
border-bottom: ${({theme:e})=>`1px solid ${e.palette.divider}`};
|
|
180
180
|
}
|
|
181
|
-
`;function e2({text:e}){return e?o.jsx(G2,{wrapperElement:{"data-color-mode":"light"},source:e,rehypePlugins:[[K2,{target:"_blank"}]]}):o.jsx(ze,{Icon:Ge})}e2.propTypes={text:h.string.isRequired};function t2({params:e,setParams:t,paramsErrTip:l,loading:s,setParamsErrTip:r,readOnly:c}){var x;const{t:i}=te(),[a,u]=R.useState(c?"preview":"write"),f=(g,y)=>{u(y)};return o.jsxs(z,{sx:{border:"1px solid #fff",width:"100%",borderRadius:2},children:[o.jsxs(z,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[o.jsx(G,{variant:"h6",fontWeight:"bold",sx:{},children:i("common.introduction")}),o.jsxs(P2,{value:a,onChange:f,"aria-label":"wrapped label tabs example",children:[o.jsx(Y1,{value:"write",label:"Write"}),o.jsx(Y1,{value:"preview",label:"Preview"})]})]}),o.jsx(z,{display:a==="write"?"block":"none",sx:{width:"100%",marginTop:3},children:o.jsx(Pe,{disabled:s||c,sx:{border:"none"},placeholder:`Blocklet ${i("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:c,endAdornment:o.jsxs(z1,{position:"end",children:[((x=e==null?void 0:e.blockletIntroduction)==null?void 0:x.length)||0," / ",ye.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:e.blockletIntroduction||"",onChange:g=>{r({blockletIntroduction:""}),t({blockletIntroduction:g.target.value.slice(0,ye.PROJECT.MAX_INTRO_LENGTH)})},error:!!l.blockletIntroduction,helperText:l.blockletIntroduction||""})}),o.jsx(z,{display:a==="preview"?"block":"none",mt:3,children:o.jsx(e2,{text:e.blockletIntroduction||""})})]})}t2.propTypes={params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,readOnly:h.bool.isRequired,loading:h.bool.isRequired};var F1={},o3=Ne;Object.defineProperty(F1,"__esModule",{value:!0});var o2=F1.default=void 0,l3=o3(Te()),h0=o;o2=F1.default=(0,l3.default)([(0,h0.jsx)("circle",{cx:"12",cy:"19",r:"2"},"0"),(0,h0.jsx)("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function U1({step:e,ok:t,active:l,error:s}){let r="grey.500",c=e+1;return t&&(c=o.jsx(X2,{sx:{fontSize:18,margin:0},color:"white"})),s||!t&&l>e?(r="error.main",c=o.jsx(o2,{sx:{fontSize:18,margin:0},color:"white"})):l>=e&&(r="primary.main"),o.jsx(z,{width:24,height:24,bgcolor:r,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center",children:c})}U1.propTypes={step:h.number,ok:h.bool,active:h.number,error:h.string};U1.defaultProps={step:0,ok:!1,active:0,error:""};function l2({steps:e,activeStep:t,setActiveStep:l,hasSelectedResources:s,params:r,loading:c,paramsErrTip:i,viewMode:a,projectId:u}){const{t:f}=te(),x=()=>{l(d=>d+1)},g=()=>{l(d=>d-1)},y=d=>d===0?(i==null?void 0:i.blockletTitle)||(i==null?void 0:i.projectId)||(i==null?void 0:i.blockletDescription):d===2?i==null?void 0:i.blockletResource:d>=4?(i==null?void 0:i.blockletVersion)||(i==null?void 0:i.note):"",p=a||J0({hasSelectedResources:s,params:r,projectId:u,t:f})===null;return o.jsxs(z,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid #ccc",borderRadius:2},children:[o.jsx(Q2,{activeStep:t,orientation:"vertical",children:e.map((d,m)=>{const b={},v=c||!e3({hasSelectedResources:s,params:r,projectId:u,step:m,t:f}),C=c?"":y(m);return C&&(b.optional=o.jsx(G,{variant:"caption",color:"error",children:C}),b.error=!0),o.jsxs(Y2,{children:[o.jsx(vt,{icon:o.jsx(U1,{error:C,active:p?99:t,step:m,ok:v}),sx:{cursor:"pointer",color:C?"error.main":"inherit"},disabled:!1,onClick:()=>l(m),...b,children:o.jsx(G,{fontSize:"14px",fontWeight:"500",color:C||!v&&t>m?"error.main":"inherit",children:d.label})}),o.jsxs(Ct,{children:[o.jsx(G,{fontSize:12,children:d.description}),!p&&o.jsx(z,{sx:{mb:2},children:o.jsxs("div",{children:[m<e.length-1&&o.jsx(ne,{variant:"contained",onClick:x,sx:{mt:1,mr:1},disabled:C||!v,children:f("common.continue")}),m>0&&o.jsx(ne,{disabled:m===0,onClick:g,sx:{mt:1,mr:1},children:f("common.back")})]})})]})]},d.label)})}),t>=e.length-1&&o.jsx(b1,{square:!0,elevation:0,sx:{p:3},children:o.jsx(G,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}l2.propTypes={steps:h.array.isRequired,activeStep:h.number.isRequired,setActiveStep:h.func.isRequired,params:h.object.isRequired,viewMode:h.string.isRequired,loading:h.bool.isRequired,projectId:h.string.isRequired,hasSelectedResources:h.bool.isRequired,paramsErrTip:h.shape({projectId:h.string,blockletVersion:h.string,blockletTitle:h.string,blockletDescription:h.string,note:h.string,blockletResource:h.string}).isRequired};const n3=[".zip",".gz"],s3=1024*1024*100,r3=R.lazy(()=>z0(()=>import("./react-D1bqTbo3.js").then(e=>e.r),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47])).then(e=>({default:e.Uploader})));function q1({app:e,projectId:t,readOnly:l,params:s,setParams:r,setParamsErrTip:c,error:i}){const{t:a}=te(),u=R.useRef(null),f=()=>l?!1:!t||t===X.UNOWNED_DID?($.error(a("blocklet.publish.errorTip.noFirstDid")),!1):!0,x=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e.meta.did}/${t}/resource/upload`;return o.jsxs(z,{sx:{mt:3},children:[o.jsx(G,{gutterBottom:!0,children:a("blocklet.publish.resourceUpload")}),o.jsxs(T2,{direction:"row",alignItems:"center",spacing:1,sx:{flex:1,cursor:l?"default":"pointer"},children:[!!s.uploadedResource&&o.jsx(G,{component:"a",href:`${x}/params.uploadedResource`,children:s.uploadedResource}),!l&&o.jsx(ne,{variant:"outlined",size:"small",onClick:()=>{var g;f()&&((g=u.current)==null||g.open())},children:s.uploadedResource?a("common.change"):a("common.upload")})]}),o.jsx(R.Suspense,{fallback:o.jsx(Se,{}),children:o.jsx(r3,{ref:u,popup:!0,onUploadFinish:g=>{var y;r({uploadedResource:g.data.filename}),c({blockletResource:""}),(y=u.current)==null||y.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:x,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:n3,maxFileSize:s3,maxNumberOfFiles:1}}},"uploader-resource")}),!!i&&o.jsx(z,{color:"error.main",mt:1,fontSize:14,children:i})]})}q1.propTypes={app:h.object.isRequired,projectId:h.string.isRequired,readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,error:h.string.isRequired,setParamsErrTip:h.func.isRequired};q1.defaultProps={};function o1({readOnly:e,params:t,setParams:l,paramsErrTip:s,setParamsErrTip:r,loading:c}){var a;const{t:i}=te();return o.jsx(z,{display:"flex",mt:3,className:"section",children:o.jsxs(z,{sx:{flex:1},children:[o.jsx(Pe,{required:!0,disabled:c||e,label:`Blocklet ${i("common.version")}`,placeholder:`Blocklet ${i("common.version")}`,InputProps:{"data-cy":"blocklet-version",readOnly:e},autoComplete:"off",variant:"outlined",fullWidth:!0,value:t.blockletVersion||"",onChange:u=>{r({blockletVersion:""}),l({blockletVersion:u.target.value})},error:!!s.blockletVersion,helperText:s.blockletVersion||""}),o.jsx(Pe,{label:i("blocklet.publish.releaseNote"),autoComplete:"off",disabled:c||e,variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:e,endAdornment:o.jsxs(z1,{position:"end",children:[((a=t==null?void 0:t.note)==null?void 0:a.length)||0," / ",ye.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:t.note||"",onChange:u=>{r({note:""}),l({note:u.target.value.slice(0,ye.PROJECT.MAX_NOTE_LENGTH)})},error:!!s.note,helperText:s.note||"",sx:{mt:3}})]})})}o1.propTypes={readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,loading:h.bool.isRequired};o1.defaultProps={};function n2(e){for(const t in e)typeof e[t]=="string"?e[t]=e[t].replace(/\\\\/g,"\\"):typeof e[t]=="object"&&e[t]!==null&&n2(e[t]);return e}const i3=({tabs:e,blocklet:t,ancestors:l=[]})=>{const s=t.meta.did;e.push({label:o.jsxs(z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(C1,{size:24,blocklet:t,ancestors:l}),o.jsx(z,{ml:"4px",className:"text",children:o.jsx(z,{children:t.meta.title})})]},s),value:s})},f0=(e,t)=>{const l=g1(e,["blockletVersion","blockletTitle","blockletDescription","blockletLogo","blockletIntroduction","blockletScreenshots","connectedStores","blockletComponents","lastReleaseId","uploadedResource","autoUpload","possibleSameStore","note"]);return l.blockletComponents?l.blockletComponents=l.blockletComponents.map(s=>({...s,included:!0})):l.blockletComponents=(t.children||[]).map(s=>({did:s.meta.did,included:!1,required:!1})),l.resourceFromSelect=!l.uploadedResource,l},a3={0:"branding",1:"introduction",2:"resources",3:"blocklets",4:"version"},x0={branding:0,introduction:1,resources:2,blocklets:3,version:4};function W1({initUrl:e,...t}){var G1;const{projectId:l,mode:s,releaseId:r,componentDid:c=""}=n1(),{t:i}=te(),{blocklet:a}=Ve(),[u,f]=Ie({blockletScreenshots:[],publishedStoreIds:[],connectedStores:[],uploadedResource:"",resourceFromSelect:!0}),[x,g]=Ie({}),[y,p]=R.useState(!1),[d,m]=Ie(null),{api:b}=we(),v=We(D=>D.breakpoints.down("md")),[C,S]=R.useState({}),[N,T]=R.useState(!1),P=R.useRef({}),[I,U]=Ie({}),[V,M]=R.useState(""),[k,L]=Ie({}),E=e==null?void 0:e.searchParams.get("dependentComponentsMode"),B=E==="readonly",O=R.useMemo(()=>{const D={};return Object.keys(k).forEach(_=>{const Ce=k[_];Ce&&Ce.forEach(i2=>{D[i2]=!0})}),D},[k]),K=R.useCallback(D=>{B&&f({blockletComponents:[]}),L(D)},[B,L,f]),J=R.useCallback((...D)=>{U(...D),g({blockletResource:""})},[]),W=r==="none"?(u==null?void 0:u.lastReleaseId)||"":r,[Z,ke]=R.useState(s==="new-release"?4:0);R.useEffect(()=>{l&&g({projectId:""})},[l,g]);const he=R.useMemo(()=>{var D;return(D=u==null?void 0:u.blockletComponents)!=null&&D.some(_=>_.included)||Object.keys(O).length||u!=null&&u.uploadedResource?"pack":"resource"},[u==null?void 0:u.blockletComponents,u==null?void 0:u.uploadedResource,O]),ce=[],oe=((a==null?void 0:a.children)||[]).filter(D=>{var _;return(_=D.meta.resource)==null?void 0:_.exportApi}).filter(D=>!c||D.meta.did===c);oe.forEach(D=>{i3({tabs:ce,blocklet:D,t:i,ancestors:[a]})});const[ee,ie]=R.useState((G1=ce[0])==null?void 0:G1.value),fe=!N&&(d==null?void 0:d.status)==="published",Q=fe,xe=w2(()=>{if(!e)return;M(e.searchParams.get("logo")),f(_=>{var Ce;return{..._,blockletTitle:(_==null?void 0:_.blockletTitle)||e.searchParams.get("title"),blockletDescription:(_==null?void 0:_.blockletDescription)||e.searchParams.get("description"),blockletIntroduction:(_==null?void 0:_.blockletIntroduction)||e.searchParams.get("introduction")||e.searchParams.get("description"),blockletComponents:(Ce=_==null?void 0:_.blockletComponents)!=null&&Ce.length?_==null?void 0:_.blockletComponents:JSON.parse(e.searchParams.get("components")||"[]"),note:(_==null?void 0:_.note)||e.searchParams.get("note")||"No note"}});const D=e.searchParams.get("resources");try{const _=JSON.parse(D);S(_)}catch{}}),q=async()=>{if(W)try{const D=await b.getRelease({input:{did:a.meta.did,projectId:l,releaseId:W}});if(p(!1),!D.release){$.error("Release not found");return}D.release=n2(D.release),s!=="view"&&(D.release.note=""),f(_=>f0({..._,...D.release,blockletVersion:s==="create"||s==="new-release"?Me.inc(D.release.blockletVersion,"patch"):D.release.blockletVersion},a)),m(D.release)}catch(D){p(!1),$.error(Le(D))}},le=async()=>{if(l===X.UNOWNED_DID){f({blockletVersion:"1.0.0",blockletTitle:""});return}if(!l){$.error(i("blocklet.publish.errorTip.noDid"));return}try{const _=(await b.getProject({input:{did:a.meta.did,projectId:l}})).project||{};_.blockletVersion?(s==="create"||s==="new-release")&&Me.valid(_.blockletVersion)&&(_.blockletVersion=Me.inc(_.blockletVersion,"patch")):_.blockletVersion="1.0.0";const Ce=f0(_,a);f(Ce),_.lastReleaseId||xe()}catch(D){$.error(Le(D))}},H=R.useCallback(async()=>{p(!0);try{if(s==="view"){if(!W){$.error("Empty release id");return}await le(),await q();return}await le(),W&&(T(!0),await q())}finally{p(!1)}},[s,W]),Ke=D=>{f({blockletComponents:D})};R.useEffect(()=>{H()},[H]),R.useEffect(()=>{l===X.UNOWNED_DID&&(s==="create"||s==="new-release")&&e&&xe()},[l,e,s,xe]);const _e=R.useMemo(()=>!!Object.keys(I).find(D=>!!I[D].length),[I]);if(!u&&y)return o.jsx(Se,{});if(!u)return null;const Ee=oe.find(D=>D.meta.did===ee);if(oe.every(D=>D.status!=="running")&&(oe!=null&&oe.length))return o.jsx(ze,{children:i("blocklet.publish.allComponentsNotRunning")});const Xe=D=>{ie(D)},F=e==null?void 0:e.searchParams.get("resourcesTitle"),Y=e==null?void 0:e.searchParams.get("componentsTitle"),de=[{label:i("blocklet.publish.branding"),description:i("blocklet.publish.steps.branding")},{label:i("common.introduction"),description:i("blocklet.publish.steps.introduction")},{label:F||i("blocklet.publish.resourceTitle"),description:i("blocklet.publish.steps.resources")},{label:Y||i("common.components"),description:i("blocklet.publish.steps.blocklets")},{label:i("blocklet.publish.versionTitle"),description:i("blocklet.publish.steps.version")}],r2=de[Z]||de[de.length-1],Re=a3[Z];return o.jsxs(c3,{...t,children:[o.jsx(Z0,{blocklet:a,release:d,getData:H,getRelease:q,mode:s,params:u,setParams:f,setParamsErrTip:g,readOnly:Q,isPublished:fe,loading:y,setLoading:p,initLogoUrl:V,releaseId:W,projectId:l,projectType:he,resourceComponents:oe,resourceComponentsMap:k,resourceRelateComponents:O,resourceItem:Ee,saveSelectedEventsRef:P,hasSelectedResources:_e,releaseUsedLast:N,setReleaseUsedLast:T,setRelease:m}),o.jsxs(z,{display:"flex",flexDirection:"column",sx:{width:"100%"},children:[o.jsx(z,{pt:3}),o.jsxs(z,{sx:{gap:3},display:"flex",flexDirection:v?"column":"row",children:[!v&&o.jsx(l2,{steps:de,loading:y,viewMode:s==="view",params:u,hasSelectedResources:_e||u.uploadedResource,paramsErrTip:x,activeStep:Z,setActiveStep:ke,projectId:l,resourcesUrlTitle:F,componentsUrlTitle:Y}),o.jsxs(z,{flex:"1",maxWidth:"720px",children:[!v&&Re!=="introduction"&&o.jsxs(G,{variant:"h6",fontWeight:"bold",display:"flex",flexDirection:"row",alignItems:"center",children:[r2.label,Re==="branding"&&o.jsx(ve,{title:i("blocklet.publish.brandingHelp"),placement:"right",children:o.jsx(z,{component:"a",target:"_blank",href:"https://www.arcblock.io/docs/blocklet-store/en/blocklet-detail-page",sx:{paddingTop:1,marginLeft:1},style:{color:"gray"},children:o.jsx(M2,{})})})]}),(v||Re==="branding")&&o.jsx(z,{flexDirection:"column",children:o.jsx(K0,{projectId:l,setParams:f,setParamsErrTip:g,params:u,componentDid:c,blocklet:a,initUrl:e,loading:y,setLoading:p,paramsErrTip:x,readOnly:Q,initLogoUrl:V,setInitLogoUrl:M})}),v&&o.jsx(z,{flexDirection:"column",children:o.jsx(o1,{loading:y,params:u,paramsErrTip:x,setParams:f,setParamsErrTip:g,readOnly:Q})}),(v||Re==="introduction")&&o.jsx(z,{display:"flex",flexDirection:"column",sx:{mt:v?5:0,width:"100%"},children:o.jsx(t2,{loading:y,readOnly:Q,params:u,setParams:f,paramsErrTip:x,setParamsErrTip:g})}),v&&o.jsx(G,{variant:"h6",fontWeight:"bold",mt:5,children:de[x0.resources].label}),o.jsx(z,{display:v||Re==="resources"?"flex":"none",sx:{maxWidth:720},flexDirection:"column",children:o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(z,{sx:{flex:1},children:[o.jsxs(Z2,{onChange:()=>f({resourceFromSelect:!u.resourceFromSelect}),children:[o.jsx(p1,{value:"select",disabled:Q,control:o.jsx(e0,{size:"small",checked:u.resourceFromSelect}),label:i("blocklet.publish.resourceSelect")}),o.jsx(p1,{value:"select",disabled:Q,control:o.jsx(e0,{size:"small",checked:!u.resourceFromSelect}),label:i("blocklet.publish.resourceUpload")})]}),u.resourceFromSelect&&o.jsxs(o.Fragment,{children:[!c&&o.jsx(L2,{tabs:ce,current:ee,onChange:Xe,sx:{ml:-2,mt:2,maxWidth:v?window.innerWidth-24:"100%"}}),o.jsx(A1,{loading:y,initialResources:C,saveSelectedEventsRef:P,selectedResourceIds:I,setSelectedResourceIds:J,setResourceComponentsMap:K,error:x.blockletResource,app:a,readOnly:Q,component:Ee,componentDid:c,initUrl:e,params:u,setParams:f,projectId:l===X.UNOWNED_DID?"":l,releaseUsedLast:N,release:{...d,id:W}})]}),!u.resourceFromSelect&&o.jsx(q1,{app:a,readOnly:Q,projectId:l===X.UNOWNED_DID?"":l,params:u,error:x.blockletResource,setParams:f,setParamsErrTip:g})]})})}),v&&o.jsx(G,{variant:"h6",fontWeight:"bold",mt:5,children:de[x0.blocklets].label}),(v||Re==="blocklets")&&o.jsx(z,{flexDirection:"column",children:o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsx(z,{sx:{flex:1},children:o.jsx(T1,{projectType:he,disabled:y||Q,app:a,value:(u==null?void 0:u.blockletComponents)||[],onChange:Ke,resourceRelateComponents:O,dependentComponentsMode:E})})})}),!v&&Re==="version"&&o.jsx(z,{flexDirection:"column",children:o.jsx(o1,{loading:y,params:u,paramsErrTip:x,setParams:f,setParamsErrTip:g,readOnly:Q})})]})]})]})]})}W1.propTypes={initUrl:h.object};W1.defaultProps={initUrl:null};const c3=ae.div`
|
|
181
|
+
`;function e2({text:e}){return e?o.jsx(G2,{wrapperElement:{"data-color-mode":"light"},source:e,rehypePlugins:[[K2,{target:"_blank"}]]}):o.jsx(ze,{Icon:Ge})}e2.propTypes={text:h.string.isRequired};function t2({params:e,setParams:t,paramsErrTip:l,loading:s,setParamsErrTip:r,readOnly:c}){var x;const{t:i}=te(),[a,u]=R.useState(c?"preview":"write"),f=(g,y)=>{u(y)};return o.jsxs(z,{sx:{border:"1px solid #fff",width:"100%",borderRadius:2},children:[o.jsxs(z,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[o.jsx(G,{variant:"h6",fontWeight:"bold",sx:{},children:i("common.introduction")}),o.jsxs(P2,{value:a,onChange:f,"aria-label":"wrapped label tabs example",children:[o.jsx(Y1,{value:"write",label:"Write"}),o.jsx(Y1,{value:"preview",label:"Preview"})]})]}),o.jsx(z,{display:a==="write"?"block":"none",sx:{width:"100%",marginTop:3},children:o.jsx(Pe,{disabled:s||c,sx:{border:"none"},placeholder:`Blocklet ${i("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:c,endAdornment:o.jsxs(z1,{position:"end",children:[((x=e==null?void 0:e.blockletIntroduction)==null?void 0:x.length)||0," / ",ye.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:e.blockletIntroduction||"",onChange:g=>{r({blockletIntroduction:""}),t({blockletIntroduction:g.target.value.slice(0,ye.PROJECT.MAX_INTRO_LENGTH)})},error:!!l.blockletIntroduction,helperText:l.blockletIntroduction||""})}),o.jsx(z,{display:a==="preview"?"block":"none",mt:3,children:o.jsx(e2,{text:e.blockletIntroduction||""})})]})}t2.propTypes={params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,readOnly:h.bool.isRequired,loading:h.bool.isRequired};var F1={},o3=Ne;Object.defineProperty(F1,"__esModule",{value:!0});var o2=F1.default=void 0,l3=o3(Te()),h0=o;o2=F1.default=(0,l3.default)([(0,h0.jsx)("circle",{cx:"12",cy:"19",r:"2"},"0"),(0,h0.jsx)("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function U1({step:e,ok:t,active:l,error:s}){let r="grey.500",c=e+1;return t&&(c=o.jsx(X2,{sx:{fontSize:18,margin:0},color:"white"})),s||!t&&l>e?(r="error.main",c=o.jsx(o2,{sx:{fontSize:18,margin:0},color:"white"})):l>=e&&(r="primary.main"),o.jsx(z,{width:24,height:24,bgcolor:r,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center",children:c})}U1.propTypes={step:h.number,ok:h.bool,active:h.number,error:h.string};U1.defaultProps={step:0,ok:!1,active:0,error:""};function l2({steps:e,activeStep:t,setActiveStep:l,hasSelectedResources:s,params:r,loading:c,paramsErrTip:i,viewMode:a,projectId:u}){const{t:f}=te(),x=()=>{l(d=>d+1)},g=()=>{l(d=>d-1)},y=d=>d===0?(i==null?void 0:i.blockletTitle)||(i==null?void 0:i.projectId)||(i==null?void 0:i.blockletDescription):d===2?i==null?void 0:i.blockletResource:d>=4?(i==null?void 0:i.blockletVersion)||(i==null?void 0:i.note):"",p=a||J0({hasSelectedResources:s,params:r,projectId:u,t:f})===null;return o.jsxs(z,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid #ccc",borderRadius:2},children:[o.jsx(Q2,{activeStep:t,orientation:"vertical",children:e.map((d,m)=>{const b={},v=c||!e3({hasSelectedResources:s,params:r,projectId:u,step:m,t:f}),C=c?"":y(m);return C&&(b.optional=o.jsx(G,{variant:"caption",color:"error",children:C}),b.error=!0),o.jsxs(Y2,{children:[o.jsx(vt,{icon:o.jsx(U1,{error:C,active:p?99:t,step:m,ok:v}),sx:{cursor:"pointer",color:C?"error.main":"inherit"},disabled:!1,onClick:()=>l(m),...b,children:o.jsx(G,{fontSize:"14px",fontWeight:"500",color:C||!v&&t>m?"error.main":"inherit",children:d.label})}),o.jsxs(Ct,{children:[o.jsx(G,{fontSize:12,children:d.description}),!p&&o.jsx(z,{sx:{mb:2},children:o.jsxs("div",{children:[m<e.length-1&&o.jsx(ne,{variant:"contained",onClick:x,sx:{mt:1,mr:1},disabled:C||!v,children:f("common.continue")}),m>0&&o.jsx(ne,{disabled:m===0,onClick:g,sx:{mt:1,mr:1},children:f("common.back")})]})})]})]},d.label)})}),t>=e.length-1&&o.jsx(b1,{square:!0,elevation:0,sx:{p:3},children:o.jsx(G,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}l2.propTypes={steps:h.array.isRequired,activeStep:h.number.isRequired,setActiveStep:h.func.isRequired,params:h.object.isRequired,viewMode:h.string.isRequired,loading:h.bool.isRequired,projectId:h.string.isRequired,hasSelectedResources:h.bool.isRequired,paramsErrTip:h.shape({projectId:h.string,blockletVersion:h.string,blockletTitle:h.string,blockletDescription:h.string,note:h.string,blockletResource:h.string}).isRequired};const n3=[".zip",".gz"],s3=1024*1024*100,r3=R.lazy(()=>z0(()=>import("./react-D5g67fVw.js").then(e=>e.r),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47])).then(e=>({default:e.Uploader})));function q1({app:e,projectId:t,readOnly:l,params:s,setParams:r,setParamsErrTip:c,error:i}){const{t:a}=te(),u=R.useRef(null),f=()=>l?!1:!t||t===X.UNOWNED_DID?($.error(a("blocklet.publish.errorTip.noFirstDid")),!1):!0,x=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e.meta.did}/${t}/resource/upload`;return o.jsxs(z,{sx:{mt:3},children:[o.jsx(G,{gutterBottom:!0,children:a("blocklet.publish.resourceUpload")}),o.jsxs(T2,{direction:"row",alignItems:"center",spacing:1,sx:{flex:1,cursor:l?"default":"pointer"},children:[!!s.uploadedResource&&o.jsx(G,{component:"a",href:`${x}/params.uploadedResource`,children:s.uploadedResource}),!l&&o.jsx(ne,{variant:"outlined",size:"small",onClick:()=>{var g;f()&&((g=u.current)==null||g.open())},children:s.uploadedResource?a("common.change"):a("common.upload")})]}),o.jsx(R.Suspense,{fallback:o.jsx(Se,{}),children:o.jsx(r3,{ref:u,popup:!0,onUploadFinish:g=>{var y;r({uploadedResource:g.data.filename}),c({blockletResource:""}),(y=u.current)==null||y.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:x,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:n3,maxFileSize:s3,maxNumberOfFiles:1}}},"uploader-resource")}),!!i&&o.jsx(z,{color:"error.main",mt:1,fontSize:14,children:i})]})}q1.propTypes={app:h.object.isRequired,projectId:h.string.isRequired,readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,error:h.string.isRequired,setParamsErrTip:h.func.isRequired};q1.defaultProps={};function o1({readOnly:e,params:t,setParams:l,paramsErrTip:s,setParamsErrTip:r,loading:c}){var a;const{t:i}=te();return o.jsx(z,{display:"flex",mt:3,className:"section",children:o.jsxs(z,{sx:{flex:1},children:[o.jsx(Pe,{required:!0,disabled:c||e,label:`Blocklet ${i("common.version")}`,placeholder:`Blocklet ${i("common.version")}`,InputProps:{"data-cy":"blocklet-version",readOnly:e},autoComplete:"off",variant:"outlined",fullWidth:!0,value:t.blockletVersion||"",onChange:u=>{r({blockletVersion:""}),l({blockletVersion:u.target.value})},error:!!s.blockletVersion,helperText:s.blockletVersion||""}),o.jsx(Pe,{label:i("blocklet.publish.releaseNote"),autoComplete:"off",disabled:c||e,variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:e,endAdornment:o.jsxs(z1,{position:"end",children:[((a=t==null?void 0:t.note)==null?void 0:a.length)||0," / ",ye.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:t.note||"",onChange:u=>{r({note:""}),l({note:u.target.value.slice(0,ye.PROJECT.MAX_NOTE_LENGTH)})},error:!!s.note,helperText:s.note||"",sx:{mt:3}})]})})}o1.propTypes={readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,loading:h.bool.isRequired};o1.defaultProps={};function n2(e){for(const t in e)typeof e[t]=="string"?e[t]=e[t].replace(/\\\\/g,"\\"):typeof e[t]=="object"&&e[t]!==null&&n2(e[t]);return e}const i3=({tabs:e,blocklet:t,ancestors:l=[]})=>{const s=t.meta.did;e.push({label:o.jsxs(z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(C1,{size:24,blocklet:t,ancestors:l}),o.jsx(z,{ml:"4px",className:"text",children:o.jsx(z,{children:t.meta.title})})]},s),value:s})},f0=(e,t)=>{const l=g1(e,["blockletVersion","blockletTitle","blockletDescription","blockletLogo","blockletIntroduction","blockletScreenshots","connectedStores","blockletComponents","lastReleaseId","uploadedResource","autoUpload","possibleSameStore","note"]);return l.blockletComponents?l.blockletComponents=l.blockletComponents.map(s=>({...s,included:!0})):l.blockletComponents=(t.children||[]).map(s=>({did:s.meta.did,included:!1,required:!1})),l.resourceFromSelect=!l.uploadedResource,l},a3={0:"branding",1:"introduction",2:"resources",3:"blocklets",4:"version"},x0={branding:0,introduction:1,resources:2,blocklets:3,version:4};function W1({initUrl:e,...t}){var G1;const{projectId:l,mode:s,releaseId:r,componentDid:c=""}=n1(),{t:i}=te(),{blocklet:a}=Ve(),[u,f]=Ie({blockletScreenshots:[],publishedStoreIds:[],connectedStores:[],uploadedResource:"",resourceFromSelect:!0}),[x,g]=Ie({}),[y,p]=R.useState(!1),[d,m]=Ie(null),{api:b}=we(),v=We(D=>D.breakpoints.down("md")),[C,S]=R.useState({}),[N,T]=R.useState(!1),P=R.useRef({}),[I,U]=Ie({}),[V,M]=R.useState(""),[k,L]=Ie({}),E=e==null?void 0:e.searchParams.get("dependentComponentsMode"),B=E==="readonly",O=R.useMemo(()=>{const D={};return Object.keys(k).forEach(_=>{const Ce=k[_];Ce&&Ce.forEach(i2=>{D[i2]=!0})}),D},[k]),K=R.useCallback(D=>{B&&f({blockletComponents:[]}),L(D)},[B,L,f]),J=R.useCallback((...D)=>{U(...D),g({blockletResource:""})},[]),W=r==="none"?(u==null?void 0:u.lastReleaseId)||"":r,[Z,ke]=R.useState(s==="new-release"?4:0);R.useEffect(()=>{l&&g({projectId:""})},[l,g]);const he=R.useMemo(()=>{var D;return(D=u==null?void 0:u.blockletComponents)!=null&&D.some(_=>_.included)||Object.keys(O).length||u!=null&&u.uploadedResource?"pack":"resource"},[u==null?void 0:u.blockletComponents,u==null?void 0:u.uploadedResource,O]),ce=[],oe=((a==null?void 0:a.children)||[]).filter(D=>{var _;return(_=D.meta.resource)==null?void 0:_.exportApi}).filter(D=>!c||D.meta.did===c);oe.forEach(D=>{i3({tabs:ce,blocklet:D,t:i,ancestors:[a]})});const[ee,ie]=R.useState((G1=ce[0])==null?void 0:G1.value),fe=!N&&(d==null?void 0:d.status)==="published",Q=fe,xe=w2(()=>{if(!e)return;M(e.searchParams.get("logo")),f(_=>{var Ce;return{..._,blockletTitle:(_==null?void 0:_.blockletTitle)||e.searchParams.get("title"),blockletDescription:(_==null?void 0:_.blockletDescription)||e.searchParams.get("description"),blockletIntroduction:(_==null?void 0:_.blockletIntroduction)||e.searchParams.get("introduction")||e.searchParams.get("description"),blockletComponents:(Ce=_==null?void 0:_.blockletComponents)!=null&&Ce.length?_==null?void 0:_.blockletComponents:JSON.parse(e.searchParams.get("components")||"[]"),note:(_==null?void 0:_.note)||e.searchParams.get("note")||"No note"}});const D=e.searchParams.get("resources");try{const _=JSON.parse(D);S(_)}catch{}}),q=async()=>{if(W)try{const D=await b.getRelease({input:{did:a.meta.did,projectId:l,releaseId:W}});if(p(!1),!D.release){$.error("Release not found");return}D.release=n2(D.release),s!=="view"&&(D.release.note=""),f(_=>f0({..._,...D.release,blockletVersion:s==="create"||s==="new-release"?Me.inc(D.release.blockletVersion,"patch"):D.release.blockletVersion},a)),m(D.release)}catch(D){p(!1),$.error(Le(D))}},le=async()=>{if(l===X.UNOWNED_DID){f({blockletVersion:"1.0.0",blockletTitle:""});return}if(!l){$.error(i("blocklet.publish.errorTip.noDid"));return}try{const _=(await b.getProject({input:{did:a.meta.did,projectId:l}})).project||{};_.blockletVersion?(s==="create"||s==="new-release")&&Me.valid(_.blockletVersion)&&(_.blockletVersion=Me.inc(_.blockletVersion,"patch")):_.blockletVersion="1.0.0";const Ce=f0(_,a);f(Ce),_.lastReleaseId||xe()}catch(D){$.error(Le(D))}},H=R.useCallback(async()=>{p(!0);try{if(s==="view"){if(!W){$.error("Empty release id");return}await le(),await q();return}await le(),W&&(T(!0),await q())}finally{p(!1)}},[s,W]),Ke=D=>{f({blockletComponents:D})};R.useEffect(()=>{H()},[H]),R.useEffect(()=>{l===X.UNOWNED_DID&&(s==="create"||s==="new-release")&&e&&xe()},[l,e,s,xe]);const _e=R.useMemo(()=>!!Object.keys(I).find(D=>!!I[D].length),[I]);if(!u&&y)return o.jsx(Se,{});if(!u)return null;const Ee=oe.find(D=>D.meta.did===ee);if(oe.every(D=>D.status!=="running")&&(oe!=null&&oe.length))return o.jsx(ze,{children:i("blocklet.publish.allComponentsNotRunning")});const Xe=D=>{ie(D)},F=e==null?void 0:e.searchParams.get("resourcesTitle"),Y=e==null?void 0:e.searchParams.get("componentsTitle"),de=[{label:i("blocklet.publish.branding"),description:i("blocklet.publish.steps.branding")},{label:i("common.introduction"),description:i("blocklet.publish.steps.introduction")},{label:F||i("blocklet.publish.resourceTitle"),description:i("blocklet.publish.steps.resources")},{label:Y||i("common.components"),description:i("blocklet.publish.steps.blocklets")},{label:i("blocklet.publish.versionTitle"),description:i("blocklet.publish.steps.version")}],r2=de[Z]||de[de.length-1],Re=a3[Z];return o.jsxs(c3,{...t,children:[o.jsx(Z0,{blocklet:a,release:d,getData:H,getRelease:q,mode:s,params:u,setParams:f,setParamsErrTip:g,readOnly:Q,isPublished:fe,loading:y,setLoading:p,initLogoUrl:V,releaseId:W,projectId:l,projectType:he,resourceComponents:oe,resourceComponentsMap:k,resourceRelateComponents:O,resourceItem:Ee,saveSelectedEventsRef:P,hasSelectedResources:_e,releaseUsedLast:N,setReleaseUsedLast:T,setRelease:m}),o.jsxs(z,{display:"flex",flexDirection:"column",sx:{width:"100%"},children:[o.jsx(z,{pt:3}),o.jsxs(z,{sx:{gap:3},display:"flex",flexDirection:v?"column":"row",children:[!v&&o.jsx(l2,{steps:de,loading:y,viewMode:s==="view",params:u,hasSelectedResources:_e||u.uploadedResource,paramsErrTip:x,activeStep:Z,setActiveStep:ke,projectId:l,resourcesUrlTitle:F,componentsUrlTitle:Y}),o.jsxs(z,{flex:"1",maxWidth:"720px",children:[!v&&Re!=="introduction"&&o.jsxs(G,{variant:"h6",fontWeight:"bold",display:"flex",flexDirection:"row",alignItems:"center",children:[r2.label,Re==="branding"&&o.jsx(ve,{title:i("blocklet.publish.brandingHelp"),placement:"right",children:o.jsx(z,{component:"a",target:"_blank",href:"https://www.arcblock.io/docs/blocklet-store/en/blocklet-detail-page",sx:{paddingTop:1,marginLeft:1},style:{color:"gray"},children:o.jsx(M2,{})})})]}),(v||Re==="branding")&&o.jsx(z,{flexDirection:"column",children:o.jsx(K0,{projectId:l,setParams:f,setParamsErrTip:g,params:u,componentDid:c,blocklet:a,initUrl:e,loading:y,setLoading:p,paramsErrTip:x,readOnly:Q,initLogoUrl:V,setInitLogoUrl:M})}),v&&o.jsx(z,{flexDirection:"column",children:o.jsx(o1,{loading:y,params:u,paramsErrTip:x,setParams:f,setParamsErrTip:g,readOnly:Q})}),(v||Re==="introduction")&&o.jsx(z,{display:"flex",flexDirection:"column",sx:{mt:v?5:0,width:"100%"},children:o.jsx(t2,{loading:y,readOnly:Q,params:u,setParams:f,paramsErrTip:x,setParamsErrTip:g})}),v&&o.jsx(G,{variant:"h6",fontWeight:"bold",mt:5,children:de[x0.resources].label}),o.jsx(z,{display:v||Re==="resources"?"flex":"none",sx:{maxWidth:720},flexDirection:"column",children:o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(z,{sx:{flex:1},children:[o.jsxs(Z2,{onChange:()=>f({resourceFromSelect:!u.resourceFromSelect}),children:[o.jsx(p1,{value:"select",disabled:Q,control:o.jsx(e0,{size:"small",checked:u.resourceFromSelect}),label:i("blocklet.publish.resourceSelect")}),o.jsx(p1,{value:"select",disabled:Q,control:o.jsx(e0,{size:"small",checked:!u.resourceFromSelect}),label:i("blocklet.publish.resourceUpload")})]}),u.resourceFromSelect&&o.jsxs(o.Fragment,{children:[!c&&o.jsx(L2,{tabs:ce,current:ee,onChange:Xe,sx:{ml:-2,mt:2,maxWidth:v?window.innerWidth-24:"100%"}}),o.jsx(A1,{loading:y,initialResources:C,saveSelectedEventsRef:P,selectedResourceIds:I,setSelectedResourceIds:J,setResourceComponentsMap:K,error:x.blockletResource,app:a,readOnly:Q,component:Ee,componentDid:c,initUrl:e,params:u,setParams:f,projectId:l===X.UNOWNED_DID?"":l,releaseUsedLast:N,release:{...d,id:W}})]}),!u.resourceFromSelect&&o.jsx(q1,{app:a,readOnly:Q,projectId:l===X.UNOWNED_DID?"":l,params:u,error:x.blockletResource,setParams:f,setParamsErrTip:g})]})})}),v&&o.jsx(G,{variant:"h6",fontWeight:"bold",mt:5,children:de[x0.blocklets].label}),(v||Re==="blocklets")&&o.jsx(z,{flexDirection:"column",children:o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsx(z,{sx:{flex:1},children:o.jsx(T1,{projectType:he,disabled:y||Q,app:a,value:(u==null?void 0:u.blockletComponents)||[],onChange:Ke,resourceRelateComponents:O,dependentComponentsMode:E})})})}),!v&&Re==="version"&&o.jsx(z,{flexDirection:"column",children:o.jsx(o1,{loading:y,params:u,paramsErrTip:x,setParams:f,setParamsErrTip:g,readOnly:Q})})]})]})]})]})}W1.propTypes={initUrl:h.object};W1.defaultProps={initUrl:null};const c3=ae.div`
|
|
182
182
|
.section {
|
|
183
183
|
&.full-width {
|
|
184
184
|
max-width: 100%;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{l as q}from"./lottie-
|
|
1
|
+
import{l as q}from"./lottie-DJwtX3kw.js";import{r as D,eF as z}from"./index-CvQpkp6C.js";function G(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,u,c,i,b=[],f=!0,A=!1;try{if(c=(r=r.call(t)).next,e!==0)for(;!(f=(n=c.call(r)).done)&&(b.push(n.value),b.length!==e);f=!0);}catch(g){A=!0,u=g}finally{try{if(!f&&r.return!=null&&(i=r.return(),Object(i)!==i))return}finally{if(A)throw u}}return b}}function E(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(u){return Object.getOwnPropertyDescriptor(t,u).enumerable})),r.push.apply(r,n)}return r}function I(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?E(Object(r),!0).forEach(function(n){J(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function J(t,e,r){return e=ae(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Q(t,e){if(t==null)return{};var r={},n=Object.keys(t),u,c;for(c=0;c<n.length;c++)u=n[c],!(e.indexOf(u)>=0)&&(r[u]=t[u]);return r}function x(t,e){if(t==null)return{};var r=Q(t,e),n,u;if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(t);for(u=0;u<c.length;u++)n=c[u],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Z(t,e){return ee(t)||G(t,e)||te(t,e)||ne()}function ee(t){if(Array.isArray(t))return t}function te(t,e){if(t){if(typeof t=="string")return j(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return j(t,e)}}function j(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ne(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function re(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ae(t){var e=re(t,"string");return typeof e=="symbol"?e:String(e)}var oe=["animationData","loop","autoplay","initialSegment","onComplete","onLoopComplete","onEnterFrame","onSegmentStart","onConfigReady","onDataReady","onDataFailed","onLoadedImages","onDOMLoaded","onDestroy","lottieRef","renderer","name","assetsPath","rendererSettings"],ie=function(e,r){var n=e.animationData,u=e.loop,c=e.autoplay,i=e.initialSegment,b=e.onComplete,f=e.onLoopComplete,A=e.onEnterFrame,g=e.onSegmentStart,O=e.onConfigReady,w=e.onDataReady,h=e.onDataFailed,l=e.onLoadedImages,L=e.onDOMLoaded,S=e.onDestroy;e.lottieRef,e.renderer,e.name,e.assetsPath,e.rendererSettings;var p=x(e,oe),P=D.useState(!1),s=Z(P,2),C=s[0],_=s[1],o=D.useRef(),v=D.useRef(null),F=function(){var a;(a=o.current)===null||a===void 0||a.play()},H=function(){var a;(a=o.current)===null||a===void 0||a.stop()},M=function(){var a;(a=o.current)===null||a===void 0||a.pause()},V=function(a){var d;(d=o.current)===null||d===void 0||d.setSpeed(a)},N=function(a,d){var m;(m=o.current)===null||m===void 0||m.goToAndPlay(a,d)},B=function(a,d){var m;(m=o.current)===null||m===void 0||m.goToAndStop(a,d)},$=function(a){var d;(d=o.current)===null||d===void 0||d.setDirection(a)},k=function(a,d){var m;(m=o.current)===null||m===void 0||m.playSegments(a,d)},W=function(a){var d;(d=o.current)===null||d===void 0||d.setSubframe(a)},K=function(a){var d;return(d=o.current)===null||d===void 0?void 0:d.getDuration(a)},U=function(){var a;(a=o.current)===null||a===void 0||a.destroy(),o.current=void 0},X=function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},d;if(v.current){(d=o.current)===null||d===void 0||d.destroy();var m=I(I(I({},e),a),{},{container:v.current});return o.current=q.loadAnimation(m),_(!!o.current),function(){var R;(R=o.current)===null||R===void 0||R.destroy(),o.current=void 0}}};D.useEffect(function(){var y=X();return function(){return y==null?void 0:y()}},[n,u]),D.useEffect(function(){o.current&&(o.current.autoplay=!!c)},[c]),D.useEffect(function(){if(o.current){if(!i){o.current.resetSegments(!0);return}!Array.isArray(i)||!i.length||((o.current.currentRawFrame<i[0]||o.current.currentRawFrame>i[1])&&(o.current.currentRawFrame=i[0]),o.current.setSegment(i[0],i[1]))}},[i]),D.useEffect(function(){var y=[{name:"complete",handler:b},{name:"loopComplete",handler:f},{name:"enterFrame",handler:A},{name:"segmentStart",handler:g},{name:"config_ready",handler:O},{name:"data_ready",handler:w},{name:"data_failed",handler:h},{name:"loaded_images",handler:l},{name:"DOMLoaded",handler:L},{name:"destroy",handler:S}],a=y.filter(function(m){return m.handler!=null});if(a.length){var d=a.map(function(m){var R;return(R=o.current)===null||R===void 0||R.addEventListener(m.name,m.handler),function(){var T;(T=o.current)===null||T===void 0||T.removeEventListener(m.name,m.handler)}});return function(){d.forEach(function(m){return m()})}}},[b,f,A,g,O,w,h,l,L,S]);var Y=z.createElement("div",I({style:r,ref:v},p));return{View:Y,play:F,stop:H,pause:M,setSpeed:V,goToAndStop:B,goToAndPlay:N,setDirection:$,playSegments:k,setSubframe:W,getDuration:K,destroy:U,animationContainerRef:v,animationLoaded:C,animationItem:o.current}};function ue(t){var e=t.getBoundingClientRect(),r=e.top,n=e.height,u=window.innerHeight-r,c=window.innerHeight+n;return u/c}function le(t,e,r){var n=t.getBoundingClientRect(),u=n.top,c=n.left,i=n.width,b=n.height,f=(e-c)/i,A=(r-u)/b;return{x:f,y:A}}var se=function(e){var r=e.wrapperRef,n=e.animationItem,u=e.mode,c=e.actions;D.useEffect(function(){var i=r.current;if(!(!i||!n||!c.length)){n.stop();var b=function(){var g=null,O=function(){var h=ue(i),l=c.find(function(S){var p=S.visibility;return p&&h>=p[0]&&h<=p[1]});if(l){if(l.type==="seek"&&l.visibility&&l.frames.length===2){var L=l.frames[0]+Math.ceil((h-l.visibility[0])/(l.visibility[1]-l.visibility[0])*l.frames[1]);//! goToAndStop must be relative to the start of the current segment
|
|
3
3
|
n.goToAndStop(L-n.firstFrame-1,!0)}l.type==="loop"&&(g===null||g!==l.frames||n.isPaused)&&(n.playSegments(l.frames,!0),g=l.frames),l.type==="play"&&n.isPaused&&(n.resetSegments(!0),n.play()),l.type==="stop"&&n.goToAndStop(l.frames[0]-n.firstFrame-1,!0)}};return document.addEventListener("scroll",O),function(){document.removeEventListener("scroll",O)}},f=function(){var g=function(l,L){var S=l,p=L;if(S!==-1&&p!==-1){var P=le(i,S,p);S=P.x,p=P.y}var s=c.find(function(o){var v=o.position;return v&&Array.isArray(v.x)&&Array.isArray(v.y)?S>=v.x[0]&&S<=v.x[1]&&p>=v.y[0]&&p<=v.y[1]:v&&!Number.isNaN(v.x)&&!Number.isNaN(v.y)?S===v.x&&p===v.y:!1});if(s){if(s.type==="seek"&&s.position&&Array.isArray(s.position.x)&&Array.isArray(s.position.y)&&s.frames.length===2){var C=(S-s.position.x[0])/(s.position.x[1]-s.position.x[0]),_=(p-s.position.y[0])/(s.position.y[1]-s.position.y[0]);n.playSegments(s.frames,!0),n.goToAndStop(Math.ceil((C+_)/2*(s.frames[1]-s.frames[0])),!0)}s.type==="loop"&&n.playSegments(s.frames,!0),s.type==="play"&&(n.isPaused&&n.resetSegments(!1),n.playSegments(s.frames)),s.type==="stop"&&n.goToAndStop(s.frames[0],!0)}},O=function(l){g(l.clientX,l.clientY)},w=function(){g(-1,-1)};return i.addEventListener("mousemove",O),i.addEventListener("mouseout",w),function(){i.removeEventListener("mousemove",O),i.removeEventListener("mouseout",w)}};switch(u){case"scroll":return b();case"cursor":return f()}}},[u,n])},de=function(e){var r=e.actions,n=e.mode,u=e.lottieObj,c=u.animationItem,i=u.View,b=u.animationContainerRef;return se({actions:r,animationItem:c,mode:n,wrapperRef:b}),i},fe=["style","interactivity"],ve=function(e){var r,n,u,c=e.style,i=e.interactivity,b=x(e,fe),f=ie(b,c),A=f.View,g=f.play,O=f.stop,w=f.pause,h=f.setSpeed,l=f.goToAndStop,L=f.goToAndPlay,S=f.setDirection,p=f.playSegments,P=f.setSubframe,s=f.getDuration,C=f.destroy,_=f.animationContainerRef,o=f.animationLoaded,v=f.animationItem;return D.useEffect(function(){e.lottieRef&&(e.lottieRef.current={play:g,stop:O,pause:w,setSpeed:h,goToAndPlay:L,goToAndStop:l,setDirection:S,playSegments:p,setSubframe:P,getDuration:s,destroy:C,animationContainerRef:_,animationLoaded:o,animationItem:v})},[(r=e.lottieRef)===null||r===void 0?void 0:r.current]),de({lottieObj:{View:A,play:g,stop:O,pause:w,setSpeed:h,goToAndStop:l,goToAndPlay:L,setDirection:S,playSegments:p,setSubframe:P,getDuration:s,destroy:C,animationContainerRef:_,animationLoaded:o,animationItem:v},actions:(n=i==null?void 0:i.actions)!==null&&n!==void 0?n:[],mode:(u=i==null?void 0:i.mode)!==null&&u!==void 0?u:"scroll"})};export{q as LottiePlayer,ve as default,ie as useLottie,de as useLottieInteractivity};
|