@abtnode/webapp 1.16.17-beta-09df289d → 1.16.17-beta-d282d63e

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.
@@ -1 +1 @@
1
- (self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[3389],{53389:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return Yn}});var r,a=t(71171),o=t(5057),s=t(53616),i=t.n(s),c=t(85493),l=t(6352),u=t.n(l),p=t(21371),d=t(72904),f=t(33518),h=t(68420),m=t(63902),x=t(51703),v=t(12073),k=t(10866),g=t(4456),b=t(99641),w=t(4651),Z=t(14491),y=t(25339),j=t(75793),S=t(2660),P=t(39948),R=t(33028),C=t(32723),E=t(34795),T=t(59740),B=t(19577),D=t(2478),U=t(44067),_=t(28726),O=t(42876),F=t(55898),G=t(96266);function N(e){var n=e.children,t=e.selected;return(0,G.jsxs)(A,{children:[n,(0,G.jsx)(P.Z,{className:"selected-container ".concat(t?"selected":""),children:(0,G.jsx)(O.default,{className:"selected-icon"})})]})}var A=(0,f.Z)(P.Z)(r||(r=(0,a.Z)(["\n position: relative;\n\n .selected-container {\n display: flex !important;\n position: absolute;\n right: 0px;\n bottom: 0px;\n -webkit-box-pack: end;\n justify-content: flex-end;\n align-items: flex-end;\n width: 32px;\n height: 32px;\n border-radius: 0px 0px 8px;\n color: rgb(255, 255, 255);\n overflow: hidden;\n transition: all 0.4s ease 0s;\n\n &::after {\n position: absolute;\n z-index: 0;\n left: 60px;\n top: 60px;\n display: block;\n width: 0px;\n height: 0px;\n border-width: 16px;\n border-style: solid;\n border-color: transparent #1dc1c7 #1dc1c7 transparent;\n transition: all 0.1s ease 0s;\n content: '';\n }\n\n .selected-icon {\n visibility: hidden;\n width: 60%;\n height: 60%;\n position: relative;\n z-index: 2;\n margin: 0px 1px 1px 0px;\n font-size: 16px;\n transition: all 0.2s ease 0s;\n }\n }\n\n .selected-container.selected {\n &::after {\n left: 0px;\n top: 0px;\n }\n\n .selected-icon {\n visibility: visible;\n }\n }\n"])));N.propTypes={children:F.node.isRequired,selected:F.bool},N.defaultProps={selected:!1};var z=t(68079),L=t(96234),M=t(67654),I=t(65873),W=t(94639),H=(0,o.createContext)({}),V=H.Provider;H.Consumer;function K(e){var n=e.children,t=(0,h.PE)().t,r=(0,M.Z)("spaceGatewaysForRestore",[{name:"Prod DID Spaces",url:"https://www.didspaces.com/app",protected:!0},{name:"Staging DID Spaces",url:"https://spaces.staging.arcblock.io/app",protected:!0}]),a=(0,L.Z)(r,2),s=a[0],i=a[1],c=(0,M.Z)("selectedSpaceGatewayForRestore",s.find((function(e){return"https://www.didspaces.com/app"===e.url}))),l=(0,L.Z)(c,2),p=l[0],d=l[1];return(0,o.useEffect)((function(){function e(){return e=(0,E.Z)((0,C.Z)().mark((function e(){var n;return(0,C.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(s.map(function(){var e=(0,E.Z)((0,C.Z)().mark((function e(n){var t,r,a,o;return(0,C.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W.Z.get(u()(n.url,"/__blocklet__.js?type=json"),{timeout:5e3}).catch((function(e){return console.error(e),{data:{}}}));case 2:return r=e.sent,a=r.data,o=null!==(t=a.appName)&&void 0!==t?t:n.name,e.abrupt("return",(0,I.merge)(n,{name:o}));case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()));case 2:n=e.sent,i(n);case 4:case"end":return e.stop()}}),e)}))),e.apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[]),(0,G.jsx)(V,{value:{spaceGateways:s,selectedSpaceGateway:p,addSpaceGateway:function(e){var n=s.find((function(n){return e.url===n.url}));if(n)throw new Error(t("storage.spaces.gateway.add.duplicate",{name:n.name}));i((function(){return[].concat((0,z.Z)(s),[(0,I.cloneDeep)(e)])})),d(e)},deleteSpaceGateway:function(e){if(e.url===p.url)throw new Error(t("storage.spaces.gateway.delete.failedForSelected"));i((function(){return s.filter((function(n){return n.url!==e.url}))}))},handleSelectSpaceGateway:function(e){d(e)}},children:n})}K.defaultProps={};var $=t(92877),J=t(11750),Y=t(83580),Q=t(94552),q=t(67680),X=t(19778),ee=t(47595),ne=t(60939),te=t(86229),re=t(72443),ae=t.n(re);function oe(e){var n=e.spaceGateway,t=e.onDeleteSpaceGateway,r=(0,h.PE)().t,a=(0,o.useState)(!1),s=(0,L.Z)(a,2),i=s[0],c=s[1],l=(0,o.useState)(!1),u=(0,L.Z)(l,2),p=u[0],d=u[1],f=function(e,n){null===e||void 0===e||e.stopPropagation(),c(n)},m=function(){var e=(0,E.Z)((0,C.Z)().mark((function e(a){return(0,C.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,null===a||void 0===a||a.stopPropagation(),d(!0),e.next=5,t(n);case 5:c(!1),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(0),console.error(e.t0),te.Z.error("".concat(r("storage.spaces.gateway.delete.failed"),": ").concat(ae()(e.t0)));case 12:return e.prev=12,d(!1),e.finish(12);case 15:case"end":return e.stop()}}),e,null,[[0,8,12,15]])})));return function(n){return e.apply(this,arguments)}}();return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(q.Z,{size:"small",onClick:function(e){return f(e,!0)},children:(0,G.jsx)(ee.default,{})}),(0,G.jsx)(ne.Z,{title:r("common.delConfirmDescription",{data:"".concat(null===n||void 0===n?void 0:n.name)}),open:i,confirmButton:{text:r("common.confirm"),props:{variant:"contained",color:"error",loading:p}},cancelButton:{text:r("common.cancel"),props:{variant:"contained",color:"primary"}},onConfirm:m,onCancel:function(e){return f(e,!1)}})]})}oe.defaultProps={onDeleteSpaceGateway:function(){}};var se=oe,ie=t(95335);var ce,le=function(){var e=(0,ie.Z)(),n=(0,d.Z)(e.breakpoints.down("md"));return{minWidth:n?300:e.breakpoints.values.sm,isMobile:n}},ue=t(74094),pe=["spaceGateway","selected","onDeleteSpaceGateway","onSelectGateway"],de=(0,$.Z)((function(){return{menuName:{display:"flex",flex:1,flexDirection:"column",paddingRight:"24px","& span":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}}}));function fe(e){var n=e.spaceGateway,t=e.selected,r=e.onDeleteSpaceGateway,a=e.onSelectGateway,o=(0,T.Z)(e,pe),s=de(),i=(0,h.PE)().t,c=le().isMobile,l=function(){var e=(0,E.Z)((0,C.Z)().mark((function e(){return(0,C.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r(n);case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,G.jsxs)(he,(0,R.Z)((0,R.Z)({},o),{},{children:[(0,G.jsx)(P.Z,{display:"inline-flex",marginRight:"8px",alignItems:"center",children:(0,G.jsx)("img",{alt:n.name,src:u()(n.url,"favicon.ico"),width:"48px",height:"48px"})}),(0,G.jsxs)(P.Z,{className:s.menuName,onClick:a,children:[(0,G.jsxs)(J.Z,{component:"span",variant:"subtitle1",style:{fontWeight:"400"},children:[null===n||void 0===n?void 0:n.name," ",t&&(0,G.jsx)(X.Z,{color:"primary",style:{marginLeft:"8px"},children:i("common.selected")})]}),(0,G.jsx)(J.Z,{className:"url",component:"span",variant:"inherit",children:"".concat(c?(0,ue.aS)(null===n||void 0===n?void 0:n.url,38):null===n||void 0===n?void 0:n.url)})]}),(0,G.jsxs)(Y.Z,{children:[(0,G.jsx)(q.Z,{onClick:function(e){e.stopPropagation(),window.open(n.url)},size:"small",children:(0,G.jsx)(Q.Z,{})}),!0!==(null===n||void 0===n?void 0:n.protected)&&(0,G.jsx)(se,{spaceGateway:n,onDeleteSpaceGateway:l})]})]}))}var he=(0,f.Z)(P.Z)(ce||(ce=(0,a.Z)(["\n display: flex;\n"])));fe.defaultProps={onDeleteSpaceGateway:function(){},selected:!1,onSelectGateway:function(){}};var me=t(13128),xe=t(44846),ve=t(47020),ke=t(55372),ge=t(88574),be=t(84584),we=["onAddGateway"];function Ze(e){var n=e.onAddGateway,t=(0,T.Z)(e,we),r=(0,h.PE)(),a=r.t,s=r.locale,i=(0,o.useState)(""),c=(0,L.Z)(i,2),l=c[0],p=c[1],d=(0,o.useState)(!1),f=(0,L.Z)(d,2),m=f[0],x=f[1],v=(0,o.useState)(!1),k=(0,L.Z)(v,2),g=k[0],b=k[1],w=(0,o.useState)(""),Z=(0,L.Z)(w,2),y=Z[0],j=Z[1],S=function(){var e=(0,E.Z)((0,C.Z)().mark((function e(){var t,r,o,i,c,p;return(0,C.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,x(!0),(o=null===l||void 0===l||null===(t=l.replace(/\/api\/.+/,""))||void 0===t||null===(r=t.trim())||void 0===r?void 0:r.replace(/\/$/,"")).startsWith("http")||(o="https://".concat(o)),e.next=6,(0,be.w2)(o);case 6:if(e.sent){e.next=8;break}throw new Error(a("storage.spaces.gateway.add.invalidUrl"));case 8:return e.next=10,W.Z.get(u()(o,"/__blocklet__.js?type=json"));case 10:return i=e.sent,c=i.data,p={name:c.appName,url:o,protected:!1},e.next=15,n(p);case 15:te.Z.success(a("storage.spaces.addedWithName",{name:p.name})),b(!1),e.next=22;break;case 19:e.prev=19,e.t0=e.catch(0),j("".concat(a("storage.spaces.gateway.add.failed",s),": ").concat(ae()(e.t0)));case 22:return e.prev=22,x(!1),e.finish(22);case 25:case"end":return e.stop()}}),e,null,[[0,19,22,25]])})));return function(){return e.apply(this,arguments)}}();return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(_.Z,(0,R.Z)((0,R.Z)({size:"middle",color:"primary",variant:"outlined",onClick:function(){return b(!0)}},t),{},{children:a("storage.spaces.gateway.add.title")})),(0,G.jsxs)(me.ZP,{title:a("storage.spaces.gateway.add.title"),fullWidth:!0,maxWidth:"md",open:g,onClose:function(){return b(!1)},PaperProps:{style:{minHeight:"auto"}},actions:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(_.Z,{onClick:function(e){e.stopPropagation(),b(!1)},color:"inherit",children:a("common.cancel")}),(0,G.jsxs)(_.Z,{onClick:function(e){e.stopPropagation(),S()},color:"primary","data-cy":"install-blocklet-next-step",disabled:m||!l,variant:"contained",autoFocus:!0,children:[m&&(0,G.jsx)(xe.Z,{size:16}),a("common.confirm")]})]}),children:[(0,G.jsx)("div",{style:{paddingTop:12,overflowY:"hidden"},children:(0,G.jsx)(ke.Z,{component:"div",children:(0,G.jsx)(J.Z,{component:"div",children:(0,G.jsx)(ve.Z,{label:a("storage.spaces.gateway.add.label"),autoComplete:"off",variant:"outlined",name:"url",fullWidth:!0,value:l,onChange:function(e){j(null),p(e.target.value)},disabled:m,onKeyPress:function(){var e=(0,E.Z)((0,C.Z)().mark((function e(n){return(0,C.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("Enter"!==n.key){e.next=4;break}return n.preventDefault(),e.next=4,S();case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),autoFocus:!0})})})}),!!y&&(0,G.jsx)(ge.Z,{type:"error",style:{width:"100%"},children:y})]})]})}Ze.defaultProps={onAddGateway:function(){}};var ye=Ze,je=["onConnect"];function Se(e){var n=e.onConnect,t=(0,T.Z)(e,je),r=(0,o.useContext)(H),a=r.spaceGateways,s=r.selectedSpaceGateway,i=r.handleSelectSpaceGateway,c=r.addSpaceGateway,l=r.deleteSpaceGateway,u=(0,h.PE)().t,p=function(){var e=(0,E.Z)((0,C.Z)().mark((function e(n){return(0,C.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,c(n);case 2:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),d=function(){var e=(0,E.Z)((0,C.Z)().mark((function e(n){return(0,C.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,l(n);case 2:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,G.jsxs)(P.Z,(0,R.Z)((0,R.Z)({},t),{},{children:[(0,G.jsx)(B.Z,{children:a.map((function(e){var n=(null===e||void 0===e?void 0:e.url)===s.url;return(0,G.jsx)(N,{selected:n,children:(0,G.jsx)(D.ZP,{button:!0,selected:n,"data-cy":"get-space-endpoint-for-restore",children:(0,G.jsx)(U.Z,{children:(0,G.jsx)(fe,{spaceGateway:e,onDeleteSpaceGateway:d,selected:n,onSelectGateway:function(){return function(e){i(e)}(e)}})})},e.url)})}))}),(0,G.jsxs)(P.Z,{display:"flex",marginTop:"16px",justifyContent:"center",alignItems:"center",children:[(0,G.jsx)(ye,{onAddGateway:p}),(0,G.jsx)(_.Z,{sx:{marginLeft:"16px"},size:"middle",variant:"contained",onClick:function(){n(s)},children:u("storage.spaces.connect.now")})]})]}))}Se.defaultProps={onConnect:function(){}};var Pe,Re=Se,Ce=(0,f.Z)("div")(Pe||(Pe=(0,a.Z)(["\n width: 100%;\n height: 100%;\n overflow-y: auto;\n"])));var Ee,Te=function(){var e=(0,j.h6)().info,n=(0,o.useContext)(h.RD),t=n.t,r=n.locale,a=(0,o.useMemo)((function(){return e?(0,w.RU)(e):""}),[e]);return(0,G.jsx)(K,{children:(0,G.jsxs)(Ce,{children:[(0,G.jsx)(S.Z,{title:t("blocklet.restoreFromSpaces.connect.title"),subTitle:t("blocklet.restoreFromSpaces.connect.subTitle"),onClickBack:function(){return window.history.back()}}),(0,G.jsx)(P.Z,{display:"flex",justifyContent:"center",children:(0,G.jsx)(Re,{sx:{marginTop:"64px",marginBottom:"32px",width:"720px"},onConnect:function(e){var n=new URL(u()(e.url,"restore")),t=u()(a,"blocklets/restore/verify-ownership");n.searchParams.set("redirectUrl",t),n.searchParams.set("locale",r),window.location.href=n.toString()}})})]})})},Be=t(15849),De=t(73545),Ue=t(55152),_e=t(17450),Oe=t(38898),Fe=t(39463),Ge=t(70461),Ne=t(31853),Ae=t(13455),ze=t(13932),Le=t(31910),Me=t(93040),Ie=(0,f.Z)("div")(Ee||(Ee=(0,a.Z)(["\n width: 100%;\n height: 100%;\n overflow-y: auto;\n"]))),We="verify-app-ownership-spaces";var He,Ve,Ke,$e,Je,Ye=function(){var e=(0,De.T)().session,n=(0,Be.useSearchParams)(),t=(0,L.Z)(n,1)[0],r=(0,h.PE)().t,a=(0,j.h6)(),s=a.api,i=a.info,l=(0,De.T)().api,p=(0,Le.J_)().meta,d=(0,c.useNavigate)(),f=(0,o.useMemo)((function(){return i?(0,w.RU)(i):""}),[i]),m=(0,Ne.Z)({isRestoring:!1,isComplete:!1,isOverwrite:!1,shouldReconnect:!1,exists:!1,accessUrl:"",isConnectOpen:!1,isConfirmOpen:!1,connectData:{action:"",checkFn:function(){},extraParams:{}},connectMessages:{}}),x=(0,L.Z)(m,2),v=x[0],k=x[1];(0,o.useEffect)((function(){O()}),[]);var g=t.get("launchType"),b=t.get("nftId"),Z=t.get("chainHost"),y=t.get("from"),R=t.get("blocklet_meta_url"),T=t.get("launcherSessionId")||"",B=t.get("launcherUrl")||"",D=function(e){var n=e.split("/").filter(Boolean);return n[n.length-2]}(p.spaceEndpoint),U=(0,Fe.getServerAuthMethod)(i,g,T,e.user),O=function(){var n=(0,E.Z)((0,C.Z)().mark((function n(){var t,a,o,i,c,d,h,m,x,w,y,j,S,P,R,E,_,O,G,N,A=arguments;return(0,C.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(i=A.length>0&&void 0!==A[0]&&A[0]){n.next=15;break}if(!v.shouldReconnect){n.next=5;break}return window.location.href=u()(f,"blocklets/restore/connect-space"),n.abrupt("return");case 5:if(!e.user){n.next=15;break}return n.next=8,s.getBlocklet({input:{did:D,attachRuntimeInfo:!0}});case 8:if(!(c=n.sent).blocklet){n.next=15;break}return n.next=12,(0,Me.DB)(c.blocklet);case 12:return(d=n.sent)&&(h=new URL(d),"running"!==c.blocklet.status&&h.searchParams.set("__start__","1"),k({shouldReconnect:!0,exists:!0,accessUrl:h.href})),n.abrupt("return");case 15:if("nft"!==U){n.next=36;break}return(y=new URL(window.location.href)).pathname=u()(null!==(m=null===(x=window)||void 0===x||null===(w=x.env)||void 0===w?void 0:w.apiPrefix)&&void 0!==m?m:"/","/api/did/".concat(We,"/token")),y.searchParams.set("appDid",D),y.searchParams.set("endpoint",p.spaceEndpoint),y.searchParams.set("referrer",window.location.href),y.searchParams.set("nftId",b),y.searchParams.set("appPid",p.did),j={autoConnect:!1,launchType:g,nftId:b},Z&&(y.searchParams.set("chainHost",Z),j.chainHost=Z),i&&y.searchParams.set("overwrite","1"),n.next=28,l.get(y.href);case 28:if(S=n.sent,!(P=S.data).error){n.next=33;break}return te.Z.error(P.error),n.abrupt("return");case 33:return j.nw=P.url,k({isConnectOpen:!0,connectData:{action:"verify-restore-by-nft",extraParams:j},connectMessages:{title:r("blocklet.restoreFromSpaces.nftAuthDialog.title"),scan:r("blocklet.restoreFromSpaces.nftAuthDialog.scan"),confirm:r("blocklet.restoreFromSpaces.nftAuthDialog.confirm"),success:r("blocklet.restoreFromSpaces.nftAuthDialog.success")}}),n.abrupt("return");case 36:if("launcher"!==U){n.next=44;break}return n.next=39,s.getLauncherSession({input:{launcherUrl:B,launcherSessionId:T}});case 39:return R=n.sent,E=R.launcherSession,_=R.error,E?k({isConnectOpen:!0,connectData:{action:We,extraParams:{appDid:D,appPid:p.did,endpoint:p.spaceEndpoint,referrer:window.location.href,restoreFrom:"spaces",overwrite:i?"1":void 0,launcherUrl:B,launcherSessionId:T,chainHost:Z}},connectMessages:{title:r("blocklet.restoreBlocklet.verify.title"),scan:r("blocklet.restoreBlocklet.verify.scan"),confirm:r("blocklet.restoreBlocklet.verify.confirm"),success:r("blocklet.restoreBlocklet.verify.success")}}):te.Z.error("Launch session invalid: ".concat(_)),n.abrupt("return");case 44:if("session"!==U){n.next=47;break}return k({isConnectOpen:!0,connectData:{action:We,extraParams:{appDid:D,appPid:p.did,endpoint:p.spaceEndpoint,referrer:window.location.href,overwrite:i?"1":void 0,restoreFrom:"spaces"}},connectMessages:{title:r("blocklet.restoreBlocklet.verify.title"),scan:r("blocklet.restoreBlocklet.verify.scan"),confirm:r("blocklet.restoreBlocklet.verify.confirm"),success:r("blocklet.restoreBlocklet.verify.success")}}),n.abrupt("return");case 47:return(O=new URL(window.location.href)).pathname=u()(null!==(t=null===(a=window)||void 0===a||null===(o=a.env)||void 0===o?void 0:o.apiPrefix)&&void 0!==t?t:"/","/api/did/".concat(We,"/token")),O.searchParams.set("appDid",D),O.searchParams.set("appPid",p.did),O.searchParams.set("endpoint",p.spaceEndpoint),O.searchParams.set("referrer",window.location.href),O.searchParams.set("restoreFrom","spaces"),n.next=56,l.get(O.href);case 56:G=n.sent,N=G.data,e.login({onSuccess:function(){return F()},extraParams:{nw:N.url}});case 59:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}(),F=function(){var n=(0,E.Z)((0,C.Z)().mark((function n(t,r){var a;return(0,C.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(null===(a=Array.isArray(t)?t.find((function(e){return!!e.sessionToken})):t)||void 0===a||!a.sessionToken){n.next=5;break}return(0,ue.ZB)(r(a.sessionToken)),n.next=5,e.refresh();case 5:k({isConnectOpen:!1}),setTimeout((function(){var e=new URLSearchParams({appDid:D});[{name:"launchType",value:g},{name:"nftId",value:b},{name:"from",value:y},{name:"blocklet_meta_url",value:R},{name:"chainHost",value:Z}].forEach((function(n){var t=n.name,r=n.value;r&&e.set(t,r)})),d("/blocklets/restore/restore-blocklet?".concat(e.toString()))}),0);case 7:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}();return(0,G.jsxs)(Ie,{children:[(0,G.jsx)(S.Z,{title:r("blocklet.restoreBlocklet.verify.title"),subTitle:r("blocklet.restoreBlocklet.verify.subTitle"),onClickBack:function(){return window.history.back()}}),(0,G.jsxs)(P.Z,{textAlign:"center",mt:6,children:[(0,G.jsx)(Ae.Z,{blocklet:{meta:p},blockletMetaUrl:R}),(0,G.jsxs)(P.Z,{mt:2,mb:2,children:[(0,G.jsx)(J.Z,{variant:"body2",children:p.title}),(0,G.jsx)(_e.Z,{did:D})]}),v.exists&&v.accessUrl&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(J.Z,{component:"p",variant:"body1",gutterBottom:!0,sx:{color:"orange"},children:r("blocklet.restoreBlocklet.verify.exists")}),(0,G.jsxs)(J.Z,{component:"div",sx:{marginTop:"32px"},children:[v.accessUrl&&(0,G.jsx)(_.Z,{variant:"contained",component:Oe.Z,href:v.accessUrl,sx:{width:"160px",height:"100%"},children:r("blocklet.restoreBlocklet.verify.open")}),(0,G.jsx)(_.Z,{variant:"contained",color:"error",onClick:function(){k({isConfirmOpen:!0})},sx:{width:"160px",height:"100%",marginLeft:"32px"},children:r("blocklet.restoreBlocklet.verify.overwrite")})]})]}),!v.exists&&(0,G.jsx)(_.Z,{variant:"contained",disabled:v.isConnectOpen,onClick:O,sx:{width:"180px",height:"100%"},children:r("blocklet.restoreBlocklet.verify.".concat(v.shouldReconnect?"reconnect":"verify"))})]}),v.connectData.isConnectOpen&&(0,G.jsx)(ze.Z,{appDid:D,visible:!1}),(0,G.jsx)(Ue.default,{popup:!0,open:v.isConnectOpen,forceConnected:!1,saveConnect:!1,action:v.connectData.action,checkFn:l.get,checkTimeout:3e5,webWalletUrl:(0,ue.yP)(i),onSuccess:F,extraParams:v.connectData.extraParams,messages:v.connectMessages,onClose:function(){k({isConnectOpen:!1})}}),v.isConfirmOpen&&(0,G.jsx)(Ge.Z,{color:"error",title:r("blocklet.restoreBlocklet.overwrite.title"),description:r("blocklet.restoreBlocklet.overwrite.description"),confirm:r("common.confirm"),onCancel:function(){k({isConfirmOpen:!1})},onConfirm:function(){k({isConfirmOpen:!1,isOverwrite:!0}),O(!0)}})]})},Qe=t(56666),qe=t(55309),Xe=(0,f.Z)(qe.Z)(He||(He=(0,a.Z)(["\n && .result-footer {\n height: 120px;\n > div {\n flex-wrap: wrap;\n }\n }\n"]))),en=t(35266),nn=t(76811),tn=t(77429),rn=t(75506),an=t.n(rn),on=t(50482),sn=t.n(on),cn=t(11397),ln=t.n(cn),un=t(11476),pn=t(34937),dn=t(66436),fn=ln()("@abtnode/webapp:restore-blocklet:step-install"),hn=(0,f.Z)("div")(Ve||(Ve=(0,a.Z)(["\n display: flex;\n align-items: center;\n justify-content: flex-start;\n flex-direction: column;\n width: 100%;\n height: 100%;\n overflow-y: auto;\n"]))),mn=f.Z.div(Ke||(Ke=(0,a.Z)(["\n line-height: 1.4em;\n .error-desc {\n margin-top: 8px;\n word-wrap: break-word;\n color: ",";\n }\n"])),(function(e){return e.theme.palette.grey[500]})),xn=($e={},(0,Qe.Z)($e,nn.RESTORE_PROGRESS_STATUS.waiting,0),(0,Qe.Z)($e,nn.RESTORE_PROGRESS_STATUS.start,1),(0,Qe.Z)($e,nn.RESTORE_PROGRESS_STATUS.importData,2),(0,Qe.Z)($e,nn.RESTORE_PROGRESS_STATUS.downloading,3),(0,Qe.Z)($e,nn.RESTORE_PROGRESS_STATUS.importDataSuccess,4),(0,Qe.Z)($e,nn.RESTORE_PROGRESS_STATUS.installing,5),(0,Qe.Z)($e,nn.RESTORE_PROGRESS_STATUS.completed,10),$e);var vn=(0,f.Z)(P.Z)(Je||(Je=(0,a.Z)(["\n padding-top: 24px;\n"]))),kn=function(){var e,n,t,r,a=new URL(window.location.href),s=a.searchParams.get("appDid"),i=a.searchParams.get("launchType"),c=a.searchParams.get("nftId"),l=a.searchParams.get("fromLauncher"),u=a.searchParams.get("from"),p=a.searchParams.get("chainHost"),d=function(e){var n=e.appDid,t=(0,o.useState)(nn.RESTORE_PROGRESS_STATUS.waiting),r=(0,L.Z)(t,2),a=r[0],s=r[1],i=(0,pn.ZP)();return i.connect(),(0,o.useEffect)((function(){return i.on(nn.BlockletEvents.restoreProgress,(function(e){n===(null===e||void 0===e?void 0:e.appDid)&&s(e)})),function(){i.off(nn.BlockletEvents.restoreProgress)}}),[n,i]),a}({appDid:s}),f=(0,o.useState)(0),m=(0,L.Z)(f,2),x=m[0],v=m[1],k=(0,o.useRef)(null),g=(0,Le.J_)().meta,b=(0,h.PE)().t,Z=(0,j.h6)(),y=Z.api,P=Z.info,T=(0,Ne.Z)({nextAccessUrl:"",installError:null}),B=(0,L.Z)(T,2),D=B[0],U=B[1],O=(0,un.Z)(s),F=O.status,N=O.eventName,A=function(){v(12),k.current&&(clearTimeout(k.current),k.current=null),k.current=setTimeout((function(){y.getBlocklet({input:{did:s,attachRuntimeInfo:!0}}).then((function(e){e.blocklet&&I(e.blocklet)}))}),500)},z=function(){var e,n;null!==O&&void 0!==O&&null!==(e=O.runtimeBlocklet)&&void 0!==e&&null!==(n=e.settings)&&void 0!==n&&n.initialized?v(11):A()},M=[b("blocklet.restoreFromSpaces.progress.waiting"),b("blocklet.restoreFromSpaces.progress.restoring"),b("blocklet.restoreFromSpaces.progress.importData"),b("blocklet.restoreFromSpaces.progress.downloading",{progress:"".concat(null!==(e=null===d||void 0===d||null===(n=d.data)||void 0===n?void 0:n.completed)&&void 0!==e?e:100,"/").concat(null!==(t=null===d||void 0===d||null===(r=d.data)||void 0===r?void 0:r.total)&&void 0!==t?t:100)}),b("blocklet.restoreFromSpaces.progress.importSuccess"),b("launchBlocklet.waiting.downloading"),b("launchBlocklet.waiting.verifying"),b("launchBlocklet.waiting.downloading"),b("launchBlocklet.waiting.extracting"),b("upgrading"===F?"common.upgrading":"launchBlocklet.waiting.installing"),b("launchBlocklet.waiting.installed"),b("launchBlocklet.waiting.starting"),b("launchBlocklet.waiting.done")];(0,o.useEffect)((function(){if(d.status===nn.RESTORE_PROGRESS_STATUS.error){var e={message:d.message,name:"restoreFailed",action:"retryRestore"};return sn()(e,D.installError)||te.Z.error(ae()(e)),void U({installError:e})}v(xn[d.status]||0)}),[d.status]),(0,o.useEffect)((function(){if("serverless"!==i||N!==nn.BlockletEvents.nftConsumed)switch(F){case"waiting":v(6);break;case"downloading":v(7);break;case"installing":case"upgrading":v(8);break;case"installed":if("serverless"===i&&!(0,Me.MZ)(O))break;z();break;case"starting":v(11);break;case"running":v(12),A();break;case"stopped":A();break;case"corrupted":case"error":var e;null===O||void 0===O||O.stopPolling();var n={message:null===O||void 0===O||null===(e=O.error)||void 0===e?void 0:e.message,name:null===O||void 0===O?void 0:O.eventName,action:"retryRestore"},t=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!sn()(n,D.installError)&&null!==O&&void 0!==O&&null!==(e=O.error)&&void 0!==e&&e.message&&te.Z.error(ae()(O.error)),U((0,R.Z)({installError:n},t))};y.getBlocklet({input:{did:s,attachRuntimeInfo:!0}}).then((function(e){var r,a=e.blocklet;null!==a&&void 0!==a&&null!==(r=a.settings)&&void 0!==r&&r.initialized&&(n.action="retryStart"),t()})).catch((function(){t()}))}else z()}),[F,N,O]);var I=function(){var e=(0,E.Z)((0,C.Z)().mark((function e(n){var t,r;return(0,C.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Me.DB)(n);case 2:if(t=e.sent,!an()(t)){e.next=5;break}return e.abrupt("return");case 5:(r=new URL(t)).searchParams.set("serverUrl",(0,w.RU)(P)),"running"!==n.status&&r.searchParams.set("__start__","1"),l&&r.searchParams.set("fromLauncher",l),u&&r.searchParams.set("from",u),i&&r.searchParams.set("launchType",i),c&&r.searchParams.set("nftId",c),p&&r.searchParams.set("chainHost",p),null===O||void 0===O||O.stopPolling(),U({nextAccessUrl:r.href,status:n.status,resultMessage:"running"===n.status?{variant:"success",title:b("blocklet.restoreFromSpaces.restore.completeTitle"),subTitle:"",footer:b("common.open")}:{variant:"info",title:b("blocklet.restoreFromSpaces.restore.installedTitle"),subTitle:b("blocklet.restoreFromSpaces.restore.installedSubTitle"),footer:b("common.configuration")}});case 15:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),W=function(){var e=(0,E.Z)((0,C.Z)().mark((function e(){return(0,C.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return U({installError:null,nextAccessUrl:""}),e.next=3,y.startBlocklet({input:{did:s}});case 3:null===O||void 0===O||O.startPolling();case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();if(D.installError){var H={retryRestore:(0,G.jsx)(_.Z,{variant:"contained",className:"bottom-button","data-cy":"retry-install",component:Be.Link,to:"/blocklets/restore/verify-ownership".concat(window.location.search),children:b("common.retry")}),retryStart:(0,G.jsx)(_.Z,{variant:"contained",className:"bottom-button","data-cy":"retry-start",onClick:function(){return W()},children:b("common.retry")})},V=D.installError.name?D.installError.name.replace("blocklet.",""):"installFailed";return(0,G.jsx)(Xe,{variant:"error",title:null===g||void 0===g?void 0:g.title,subTitle:(0,G.jsxs)(mn,{children:[(0,G.jsx)("div",{children:b("launchBlocklet.error.".concat(V))}),D.installError.message&&(0,G.jsx)("div",{className:"error-desc",children:b("common.errorMessage")+D.installError.message})]}),footer:(0,G.jsxs)(vn,{children:[H[D.installError.action],"serverless"===i&&(0,G.jsx)("div",{style:{marginTop:"24px"},dangerouslySetInnerHTML:{__html:b("blocklet.restoreFromSpaces.restore.support",{communityLink:"https://community.arcblock.io/",supportEmail:"launcher@arcblock.io"})}})]})})}var K=!!D.nextAccessUrl;return fn("render",{status:F,eventName:N,launchType:i,runtimeBlockletState:O,state:D}),(0,G.jsxs)(hn,{children:[!K&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(S.Z,{title:b("blocklet.restoreBlocklet.restore.title"),subTitle:b("blocklet.restoreFromSpaces.restore.subTitle")}),(0,G.jsxs)(dn.Z,{children:[(0,G.jsx)(en.Z,{increaseSpeed:.3,messageLoop:!1,message:(0,G.jsx)(tn.Z,{steps:M,stepIndex:x,autoGrowth:10===x?1e3:4e3})}),[5,7,8].includes(x)&&(0,G.jsx)(ze.Z,{appDid:s})]})]}),K&&(0,G.jsx)(Xe,{variant:D.resultMessage.variant,title:D.resultMessage.title,subTitle:D.resultMessage.subTitle,footer:(0,G.jsx)(vn,{children:(0,G.jsx)(_.Z,{variant:"contained",style:{width:"200px"},component:Oe.Z,href:D.nextAccessUrl,children:D.resultMessage.footer})})})]})};var gn,bn,wn,Zn=function(){return(0,G.jsx)(kn,{})},yn=t(23484);function jn(){var e=(0,d.Z)((function(e){return e.breakpoints.down("md")})),n=(0,h.PE)(),t=n.t,r=n.locale,a=(0,j.h6)().info,s=(0,yn.Z)(),l=(0,Le.J_)().meta,f=(0,o.useMemo)((function(){return a?(0,w.RU)(a):""}),[a]),S=(0,Z.yP)(a),P=u()((0,Z.Y5)(),"/blocklets/restore"),R=[{key:"verify-ownership",name:t("blocklet.restoreBlocklet.verify.title"),path:u()(P,"verify-ownership")},{key:"restore-blocklet",name:t("blocklet.restoreFromSpaces.restore.title"),path:u()(P,"restore-blocklet")}],C=[];C="launcher"===i()(s.get("from"))?[{key:"purchase-space",name:t("launchBlocklet.steps.purchaseSpace")},{key:"prepare-space",name:t("launchBlocklet.steps.prepareSpace")}].concat(R):[{key:"connect-space",name:t("blocklet.restoreFromSpaces.connect.title"),path:u()(P,"connect-space")},{key:"select-blocklet",name:t("blocklet.restoreFromSpaces.selectBlocklet.title")}].concat(R);var E=(0,G.jsx)(Tn,{className:"".concat(f?"logo-can-click":""),children:(0,G.jsx)(b.Z,{onClick:function(){f&&window.open(f)},logo:e?(0,G.jsx)(k.Z,{width:"32",height:"32"}):(0,G.jsx)(g.Z,{width:"128",height:"48"})})});return(0,G.jsx)(x.W,{steps:C,children:(0,G.jsx)(m.Z,{blockletMeta:l,locale:r,useOfSkeleton:!1,navLogo:E,navSubTitle:t("blocklet.restoreFromSpaces.navSubTitle"),loading:!1,headerEndAddons:(0,G.jsx)(v.Z,{webWalletUrl:S,SessionContext:y.B3}),pcWidth:"80%",style:{height:"100%"},logoUrl:null===l||void 0===l?void 0:l.logo,children:(0,G.jsxs)(En,{children:[(0,G.jsx)(p.Global,{styles:Cn}),(0,G.jsxs)(c.Routes,{children:[(0,G.jsx)(c.Route,{path:"connect-space",element:(0,G.jsx)(Te,{})}),(0,G.jsx)(c.Route,{path:"verify-ownership",element:(0,G.jsx)(Ye,{})}),(0,G.jsx)(c.Route,{path:"restore-blocklet",element:(0,G.jsx)(Zn,{})}),(0,G.jsx)(c.Route,{path:"*",element:(0,G.jsx)(c.Navigate,{to:"connect-space",replace:!0})})]})]})})})}var Sn,Pn,Rn,Cn=(0,p.css)(gn||(gn=(0,a.Z)(["\n html,\n body,\n #root,\n #root > .wrapper {\n height: 100%;\n }\n"]))),En=f.Z.div(bn||(bn=(0,a.Z)(["\n "," {\n padding-top: 34px;\n }\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n\n .bottom-button {\n min-width: 200px;\n }\n"])),(function(e){return e.theme.breakpoints.up("md")})),Tn=f.Z.div(wn||(wn=(0,a.Z)(["\n margin-top: -1px;\n &.logo-can-click {\n cursor: pointer;\n }\n"]))),Bn=t(83294),Dn=t(72333),Un=t(25710);function _n(e){var n=e.onSelect,t=(0,j.h6)().api,r=(0,h.PE)(),a=r.t,s=r.locale,i=(0,o.useState)(!1),l=(0,L.Z)(i,2),u=l[0],p=l[1],d=(0,o.useState)([]),f=(0,L.Z)(d,2),m=f[0],x=f[1],v=(0,o.useState)(""),k=(0,L.Z)(v,2),g=k[0],b=k[1],w=(0,o.useState)(null),y=(0,L.Z)(w,2),R=y[0],T=y[1],B=(0,c.useNavigate)(),D=function(){var e=(0,E.Z)((0,C.Z)().mark((function e(){var n,r,a;return(0,C.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,p(!0),T(!1),e.next=5,t.doBatchQuery({getBlocklets:{input:{}},getBlockletsFromBackup:{input:{}}});case 5:n=e.sent,r=n.getBlocklets.blocklets,a=n.getBlockletsFromBackup.backups,x((a||[]).filter((function(e){return!(r||[]).some((function(n){var t;return e.appPid===(null===(t=n.meta)||void 0===t?void 0:t.did)}))})).sort((function(e,n){return n.createdAt-e.createdAt})).slice(0,200)),p(!1),e.next=16;break;case 12:e.prev=12,e.t0=e.catch(0),p(!1),T(e.t0.message);case 16:case"end":return e.stop()}}),e,null,[[0,12]])})));return function(){return e.apply(this,arguments)}}();(0,o.useEffect)((function(){D()}),[]);var U=null;return U=R?(0,G.jsx)(ge.Z,{type:"error",style:{width:"100%",marginTop:8},children:R}):u?(0,G.jsx)(xe.Z,{size:16}):m.length?(0,G.jsx)(Gn,{children:m.map((function(e){return(0,G.jsxs)(Nn,{className:"middle-font-size space ".concat(g===e.appDid?"selected":""),onClick:function(){return function(e){b(e.appDid)}(e)},children:[(0,G.jsxs)("div",{className:"left",children:[(0,G.jsx)("div",{className:"header",children:(0,G.jsx)(P.Z,{sx:{width:40,height:40},children:(0,G.jsx)(Dn.Z,{did:e.appDid,size:40})})}),(0,G.jsxs)("div",{className:"body",children:[(0,G.jsx)(J.Z,{className:"text",children:e.name}),(0,G.jsx)(J.Z,{className:"text middle-font-size",children:(0,G.jsx)(_e.Z,{responsive:!1,compact:!0,inline:!0,copyable:!1,size:12,did:e.appDid})})]}),(0,G.jsxs)(P.Z,{color:"text.secondary",className:"footer small-font-size",children:[a("blocklet.restoreFromServer.backupIn")," ",(0,Z.B2)(e.createdAt,s)]})]}),(0,G.jsx)("div",{className:"right",children:(0,G.jsx)("div",{className:"more",children:(0,G.jsx)(q.Z,{onClick:function(){},className:"more-btn",size:"large","aria-label":"more functions",children:(0,G.jsx)(Bn.Z,{color:"disabled"})})})}),(0,G.jsx)("div",{className:"selected-container",children:(0,G.jsx)(O.default,{className:"selected-icon"})})]},e.appDid)}))}):(0,G.jsx)(Un.Z,{children:a("common.empty")}),(0,G.jsxs)(Fn,{style:{width:"100%"},children:[(0,G.jsx)(S.Z,{title:a("blocklet.restoreFromServer.selectTitle"),subTitle:a("blocklet.restoreFromServer.description")}),(0,G.jsx)(P.Z,{mt:4,mx:3,className:"main-body",children:U}),(0,G.jsx)(P.Z,{className:"main-footer",display:"flex",justifyContent:"center",children:(0,G.jsx)(_.Z,{sx:{width:"180px",height:"100%"},onClick:function(e){e.stopPropagation(),function(){var e=m.find((function(e){return e.appDid===g}));n({did:e.appDid,name:e.appDid,title:e.name});var t=new URL(window.location.href);t.searchParams.set("appDid",e.appDid),t.searchParams.set("appName",e.name),B("/blocklets/restore/verify-ownership".concat(t.search))}()},color:"primary","data-cy":"install-blocklet-next-step",variant:"contained",disabled:u||R||!g,children:a("common.restore")})})]})}_n.defaultProps={onSelect:function(){}};var On,Fn=(0,f.Z)(P.Z)(Sn||(Sn=(0,a.Z)(["\n .main-body {\n height: 50vh;\n "," {\n height: 80vh;\n }\n\n overflow: auto;\n }\n .main-footer {\n padding-top: 24px;\n padding-bottom: 24px;\n "," {\n position: fixed;\n bottom: 16px;\n width: 100%;\n padding-bottom: 0;\n }\n }\n"])),(function(e){return e.theme.breakpoints.down("md")}),(function(e){return e.theme.breakpoints.down("md")})),Gn=(0,f.Z)(P.Z)(Pn||(Pn=(0,a.Z)(["\n display: block;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n max-width: 1000px;\n margin: 0 auto;\n\n .space {\n display: flex;\n margin: 8px auto;\n\n .selected-container {\n position: absolute;\n right: 0px;\n bottom: 0px;\n display: flex;\n -webkit-box-pack: end;\n justify-content: flex-end;\n align-items: flex-end;\n width: 30px;\n height: 30px;\n border-radius: 0px 0px 7px;\n color: rgb(255, 255, 255);\n overflow: hidden;\n transition: all 0.3s ease 0s;\n\n &::after {\n position: absolute;\n z-index: 0;\n left: 30px;\n top: 30px;\n display: block;\n width: 0px;\n height: 0px;\n border-width: 15px;\n border-style: solid;\n /* border-color: transparent rgb(29, 193, 199) rgb(29, 193, 199) transparent; */\n border-color: transparent ","\n "," transparent;\n transition: all 0.1s ease 0s;\n content: '';\n }\n\n .selected-icon {\n visibility: hidden;\n width: 60%;\n height: 60%;\n position: relative;\n z-index: 2;\n margin: 0px 1px 1px 0px;\n font-size: 16px;\n transition: all 0.2s ease 0s;\n }\n }\n }\n\n .space.selected {\n background-color: rgb(236, 251, 253);\n border-color: rgb(236, 251, 253);\n\n .selected-container {\n &::after {\n left: 0px;\n top: 0px;\n }\n\n .selected-icon {\n visibility: visible;\n }\n }\n }\n"])),(function(e){return e.theme.palette.primary.main}),(function(e){return e.theme.palette.primary.main})),Nn=(0,f.Z)("div")(Rn||(Rn=(0,a.Z)(["\n display: flex;\n position: relative;\n width: 100%;\n padding: 10px;\n border: 1 solid #ccc;\n cursor: pointer;\n\n .left {\n display: flex;\n align-items: flex-start;\n width: 100%;\n margin: 0px 20px 0px 0px;\n\n .header {\n padding: 5px 16px 0 0;\n }\n\n .body {\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n\n .footer {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n height: 100%;\n }\n }\n\n .right {\n display: flex;\n }\n\n "," {\n .left {\n display: flex;\n flex-direction: column;\n margin-right: 20px;\n\n .header {\n display: none;\n }\n\n .footer {\n margin-top: 6px;\n margin-left: 0px;\n padding: 2px 0px;\n height: auto;\n }\n }\n\n .right {\n width: auto;\n }\n\n .text {\n display: -webkit-box;\n overflow: hidden;\n -webkit-box-orient: vertical;\n }\n }\n\n // \u516c\u5171\u5c5e\u6027\n .middle-font-size {\n font-size: 14px;\n }\n\n .small-font-size {\n font-size: 12px;\n }\n"])),(function(e){return e.theme.breakpoints.down("md")})),An=t(95712),zn=(0,f.Z)("div")(On||(On=(0,a.Z)(["\n width: 100%;\n height: 100%;\n overflow-y: auto;\n"]))),Ln="verify-app-ownership-disk";var Mn,In,Wn,Hn=function(){var e=new URL(window.location.href),n=e.searchParams.get("appDid"),t=e.searchParams.get("appName"),r=(0,h.PE)().t,a=(0,j.h6)(),s=a.api,i=a.info,c=(0,De.T)(),l=c.session,p=c.api,d=(0,o.useMemo)((function(){return i?(0,w.RU)(i):""}),[i]),f=(0,Ne.Z)({isRestoring:!1,isComplete:!1,connectData:{isConnectOpen:!1,action:"",checkFn:function(){},extraParams:{}}}),m=(0,L.Z)(f,2),x=m[0],v=m[1];(0,o.useEffect)((function(){g()}),[]);var k=function(){var e=(0,E.Z)((0,C.Z)().mark((function e(){return(0,C.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.getBlocklet({input:{did:n}});case 2:if(!e.sent.blocklet){e.next=7;break}return te.Z.error("Blocklet ".concat(t,"(").concat(n,") already exists")),v({shouldReconnect:!0}),e.abrupt("return");case 7:v({connectData:{isConnectOpen:!0,action:Ln,extraParams:{appDid:n,restoreFrom:"disk"}}});case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),g=function(){var e=(0,E.Z)((0,C.Z)().mark((function e(){var t,r,a,o,s,i;return(0,C.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l.user){e.next=11;break}return(o=new URL(window.location.href)).pathname=u()(null!==(t=null===(r=window)||void 0===r||null===(a=r.env)||void 0===a?void 0:a.apiPrefix)&&void 0!==t?t:"/","/api/did/".concat(Ln,"/token")),o.searchParams.set("appDid",n),o.searchParams.set("restoreFrom","disk"),e.next=7,p.get(o.href);case 7:return s=e.sent,i=s.data,l.login({onSuccess:function(){return b()},extraParams:{nw:i.url}}),e.abrupt("return");case 11:return e.next=13,k();case 13:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),b=function(){v({connectData:{isConnectOpen:!1}}),setTimeout((function(){var e=new URL(u()(d,"blocklets/restore/restore-blocklet".concat(window.location.search)));window.location.href=e.href}),0)};return(0,G.jsxs)(zn,{children:[(0,G.jsx)(S.Z,{title:r("blocklet.restoreBlocklet.verify.title"),subTitle:r("blocklet.restoreBlocklet.verify.subTitle")}),(0,G.jsxs)(P.Z,{textAlign:"center",mt:6,children:[(0,G.jsx)(An.Z,{did:n,size:128}),(0,G.jsxs)(P.Z,{mt:2,mb:2,children:[(0,G.jsx)(J.Z,{variant:"body2",children:t}),(0,G.jsx)(_e.Z,{did:n})]}),(0,G.jsx)(_.Z,{variant:"contained",disabled:x.connectData.isConnectOpen,onClick:g,sx:{width:"180px",height:"100%"},children:r("blocklet.restoreBlocklet.verify.".concat(x.shouldReconnect?"reconnect":"verify"))})]}),x.connectData.isConnectOpen&&(0,G.jsx)(ze.Z,{appDid:n,visible:!1}),(0,G.jsx)(Ue.default,{popup:!0,open:x.connectData.isConnectOpen,forceConnected:!1,saveConnect:!1,action:x.connectData.action,checkFn:p.get,checkTimeout:3e5,webWalletUrl:(0,ue.yP)(i),onSuccess:b,extraParams:x.connectData.extraParams,messages:{title:r("blocklet.restoreBlocklet.verify.title"),scan:r("blocklet.restoreBlocklet.verify.scan"),confirm:r("blocklet.restoreBlocklet.verify.confirm"),success:r("blocklet.restoreBlocklet.verify.success")},onClose:function(){v({connectData:{isConnectOpen:!1}})}})]})};function Vn(){var e=(0,d.Z)((function(e){return e.breakpoints.down("md")})),n=(0,h.PE)(),t=n.t,r=n.locale,a=(0,j.h6)().info,s=(0,o.useState)({}),i=s.meta,l=s.setMeta,f=(0,o.useMemo)((function(){return a?(0,w.RU)(a):""}),[a]),S=(0,Z.yP)(a),P=u()((0,Z.Y5)(),"/blocklets/restore"),C=[{key:"select",name:t("blocklet.restoreFromServer.selectTitle"),path:u()(P,"select")},{key:"verify-ownership",name:t("blocklet.restoreBlocklet.verify.title"),path:u()(P,"verify-ownership")},{key:"restore-blocklet",name:t("blocklet.restoreBlocklet.restore.title"),path:u()(P,"restore-blocklet")}],E=(0,G.jsx)(Jn,{className:"".concat(f?"logo-can-click":""),children:(0,G.jsx)(b.Z,{onClick:function(){f&&window.open(f)},logo:e?(0,G.jsx)(k.Z,{width:"32",height:"32"}):(0,G.jsx)(g.Z,{width:"128",height:"48"})})});return(0,G.jsx)(x.W,{steps:C,children:(0,G.jsx)(m.Z,{blockletMeta:(0,R.Z)((0,R.Z)({},i),{},{registryUrl:""}),locale:r,useOfSkeleton:!1,navLogo:E,headerEndAddons:(0,G.jsx)(v.Z,{webWalletUrl:S,SessionContext:y.B3}),pcWidth:"80%",style:{height:"100%"},logoUrl:null===i||void 0===i?void 0:i.logo,children:(0,G.jsxs)($n,{children:[(0,G.jsx)(p.Global,{styles:Kn}),(0,G.jsxs)(c.Routes,{children:[(0,G.jsx)(c.Route,{path:"select",element:(0,G.jsx)(_n,{onSelect:l})}),(0,G.jsx)(c.Route,{path:"verify-ownership",element:(0,G.jsx)(Hn,{})}),(0,G.jsx)(c.Route,{path:"restore-blocklet",element:(0,G.jsx)(Zn,{})}),(0,G.jsx)(c.Route,{path:"*",element:(0,G.jsx)(c.Navigate,{to:"select".concat(window.location.search),replace:!0})})]})]})})})}var Kn=(0,p.css)(Mn||(Mn=(0,a.Z)(["\n html,\n body,\n #root,\n #root > .wrapper {\n height: 100%;\n }\n"]))),$n=f.Z.div(In||(In=(0,a.Z)(["\n "," {\n padding-top: 34px;\n }\n width: 100%;\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n\n .bottom-button {\n min-width: 200px;\n }\n"])),(function(e){return e.theme.breakpoints.up("md")})),Jn=f.Z.div(Wn||(Wn=(0,a.Z)(["\n margin-top: -1px;\n &.logo-can-click {\n cursor: pointer;\n }\n"])));function Yn(){return window.location.search.includes("restoreFrom=server")?(0,G.jsx)(Vn,{}):(0,G.jsx)(jn,{})}},84584:function(e,n,t){"use strict";t.d(n,{Jf:function(){return w},LQ:function(){return f},Nb:function(){return h},Xv:function(){return p},mo:function(){return x},nD:function(){return d},nU:function(){return g},w2:function(){return v}});var r=t(32723),a=t(34795),o=t(82434),s=t.n(o),i=t(76811),c=t(65873),l=t(60344),u=t(6352);function p(e){var n=e.replace(/\/api\/space\/.+/,""),t=e.replace(/\/$/,"").split("/"),r=t.at(-4),a=t.at(-2);return u(n,"space",r,"apps",a,"explorer","?key=/apps/".concat(a,"/.did-objects/").concat(a,"/"))}function d(e){var n=e.replace(/\/api\/space\/.+/,""),t=e.replace(/\/$/,"").split("/").at(-4);return u(n,"space",t)}function f(e){return e.replace(/\/$/,"").split("/").at(-4)}function h(e){return m.apply(this,arguments)}function m(){return(m=(0,a.Z)((0,r.Z)().mark((function e(n){var t,a;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,s()(n)){e.next=3;break}return e.abrupt("return",!1);case 3:return e.next=5,l.hi.head(n,{timeout:5e3});case 5:return t=e.sent,a=t.headers,e.abrupt("return","true"===a["x-listable"]&&"true"===a["x-readable"]&&"true"===a["x-writeable"]);case 10:return e.prev=10,e.t0=e.catch(0),console.error(e.t0),e.abrupt("return",!1);case 14:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)}function x(e){var n;return(null===e||void 0===e||null===(n=e.find((function(e){return e.key===i.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT})))||void 0===n?void 0:n.value)||""}function v(e){return k.apply(this,arguments)}function k(){return(k=(0,a.Z)((0,r.Z)().mark((function e(n){var t,a,o,i;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,s()(n)){e.next=3;break}return e.abrupt("return",!1);case 3:return t=u(n,"space/api/did/one-click-authorization/token"),e.next=6,l.hi.get(t,{timeout:5e3});case 6:return a=e.sent,o=a.status,i=a.data,e.abrupt("return",200===o&&(0,c.isObject)(i));case 12:return e.prev=12,e.t0=e.catch(0),console.error(e.t0),e.abrupt("return",!1);case 16:case"end":return e.stop()}}),e,null,[[0,12]])})))).apply(this,arguments)}function g(e){return b.apply(this,arguments)}function b(){return(b=(0,a.Z)((0,r.Z)().mark((function e(n){var t,a,o;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,s()(n)){e.next=3;break}return e.abrupt("return","");case 3:return e.next=5,l.hi.head(n,{timeout:3e3});case 5:return t=e.sent,a=t.headers,o=a["x-space-name"],e.abrupt("return",o?decodeURIComponent(o):"");case 11:return e.prev=11,e.t0=e.catch(0),console.error(e.t0),e.abrupt("return","");case 15:case"end":return e.stop()}}),e,null,[[0,11]])})))).apply(this,arguments)}function w(e){var n=e.replace(/\/api\/space\/.+/,""),t=e.replace(/\/$/,"").split("/").at(-4);return u(n,"/api/space/nft/display?spaceDid=".concat(t))}},47595:function(e,n,t){"use strict";var r=t(71600);Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var a=r(t(56930)),o=t(96266),s=(0,a.default)((0,o.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM8 9h8v10H8V9zm7.5-5-1-1h-5l-1 1H5v2h14V4z"}),"DeleteOutline");n.default=s},94552:function(e,n,t){"use strict";var r=t(71600);n.Z=void 0;var a=r(t(56930)),o=t(96266),s=(0,a.default)((0,o.jsx)("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"}),"Launch");n.Z=s},83294:function(e,n,t){"use strict";var r=t(71600);n.Z=void 0;var a=r(t(56930)),o=t(96266),s=(0,a.default)((0,o.jsx)("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreVert");n.Z=s},53616:function(e,n,t){var r=t(26849);e.exports=function(e){return r(e).toLowerCase()}}}]);
1
+ (self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[3389],{53389:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return Yn}});var r,a=t(71171),o=t(5057),s=t(53616),i=t.n(s),c=t(85493),l=t(6352),u=t.n(l),p=t(21371),d=t(72904),f=t(33518),h=t(68420),m=t(63902),x=t(51703),v=t(12073),k=t(10866),g=t(4456),w=t(99641),b=t(4651),Z=t(14491),y=t(25339),j=t(75793),S=t(2660),P=t(39948),R=t(33028),C=t(32723),E=t(34795),T=t(59740),B=t(19577),D=t(2478),U=t(44067),_=t(28726),O=t(42876),F=t(55898),G=t(96266);function N(e){var n=e.children,t=e.selected;return(0,G.jsxs)(A,{children:[n,(0,G.jsx)(P.Z,{className:"selected-container ".concat(t?"selected":""),children:(0,G.jsx)(O.default,{className:"selected-icon"})})]})}var A=(0,f.Z)(P.Z)(r||(r=(0,a.Z)(["\n position: relative;\n\n .selected-container {\n display: flex !important;\n position: absolute;\n right: 0px;\n bottom: 0px;\n -webkit-box-pack: end;\n justify-content: flex-end;\n align-items: flex-end;\n width: 32px;\n height: 32px;\n border-radius: 0px 0px 8px;\n color: rgb(255, 255, 255);\n overflow: hidden;\n transition: all 0.4s ease 0s;\n\n &::after {\n position: absolute;\n z-index: 0;\n left: 60px;\n top: 60px;\n display: block;\n width: 0px;\n height: 0px;\n border-width: 16px;\n border-style: solid;\n border-color: transparent #1dc1c7 #1dc1c7 transparent;\n transition: all 0.1s ease 0s;\n content: '';\n }\n\n .selected-icon {\n visibility: hidden;\n width: 60%;\n height: 60%;\n position: relative;\n z-index: 2;\n margin: 0px 1px 1px 0px;\n font-size: 16px;\n transition: all 0.2s ease 0s;\n }\n }\n\n .selected-container.selected {\n &::after {\n left: 0px;\n top: 0px;\n }\n\n .selected-icon {\n visibility: visible;\n }\n }\n"])));N.propTypes={children:F.node.isRequired,selected:F.bool},N.defaultProps={selected:!1};var z=t(68079),L=t(96234),M=t(67654),I=t(65873),W=t(94639),H=(0,o.createContext)({}),V=H.Provider;H.Consumer;function K(e){var n=e.children,t=(0,h.PE)().t,r=(0,M.Z)("spaceGatewaysForRestore",[{name:"Prod DID Spaces",url:"https://www.didspaces.com/app",protected:!0},{name:"Staging DID Spaces",url:"https://spaces.staging.arcblock.io/app",protected:!0}]),a=(0,L.Z)(r,2),s=a[0],i=a[1],c=(0,M.Z)("selectedSpaceGatewayForRestore",s.find((function(e){return"https://www.didspaces.com/app"===e.url}))),l=(0,L.Z)(c,2),p=l[0],d=l[1];return(0,o.useEffect)((function(){function e(){return e=(0,E.Z)((0,C.Z)().mark((function e(){var n;return(0,C.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(s.map(function(){var e=(0,E.Z)((0,C.Z)().mark((function e(n){var t,r,a,o;return(0,C.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W.Z.get(u()(n.url,"/__blocklet__.js?type=json"),{timeout:5e3}).catch((function(e){return console.error(e),{data:{}}}));case 2:return r=e.sent,a=r.data,o=null!==(t=a.appName)&&void 0!==t?t:n.name,e.abrupt("return",(0,I.merge)(n,{name:o}));case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()));case 2:n=e.sent,i(n);case 4:case"end":return e.stop()}}),e)}))),e.apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[]),(0,G.jsx)(V,{value:{spaceGateways:s,selectedSpaceGateway:p,addSpaceGateway:function(e){var n=s.find((function(n){return e.url===n.url}));if(n)throw new Error(t("storage.spaces.gateway.add.duplicate",{name:n.name}));i((function(){return[].concat((0,z.Z)(s),[(0,I.cloneDeep)(e)])})),d(e)},deleteSpaceGateway:function(e){if(e.url===p.url)throw new Error(t("storage.spaces.gateway.delete.failedForSelected"));i((function(){return s.filter((function(n){return n.url!==e.url}))}))},handleSelectSpaceGateway:function(e){d(e)}},children:n})}K.defaultProps={};var $=t(92877),J=t(11750),Y=t(83580),Q=t(94552),q=t(67680),X=t(19778),ee=t(47595),ne=t(60939),te=t(86229),re=t(72443),ae=t.n(re);function oe(e){var n=e.spaceGateway,t=e.onDeleteSpaceGateway,r=(0,h.PE)().t,a=(0,o.useState)(!1),s=(0,L.Z)(a,2),i=s[0],c=s[1],l=(0,o.useState)(!1),u=(0,L.Z)(l,2),p=u[0],d=u[1],f=function(e,n){null===e||void 0===e||e.stopPropagation(),c(n)},m=function(){var e=(0,E.Z)((0,C.Z)().mark((function e(a){return(0,C.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,null===a||void 0===a||a.stopPropagation(),d(!0),e.next=5,t(n);case 5:c(!1),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(0),console.error(e.t0),te.Z.error("".concat(r("storage.spaces.gateway.delete.failed"),": ").concat(ae()(e.t0)));case 12:return e.prev=12,d(!1),e.finish(12);case 15:case"end":return e.stop()}}),e,null,[[0,8,12,15]])})));return function(n){return e.apply(this,arguments)}}();return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(q.Z,{size:"small",onClick:function(e){return f(e,!0)},children:(0,G.jsx)(ee.default,{})}),(0,G.jsx)(ne.Z,{title:r("common.delConfirmDescription",{data:"".concat(null===n||void 0===n?void 0:n.name)}),open:i,confirmButton:{text:r("common.confirm"),props:{variant:"contained",color:"error",loading:p}},cancelButton:{text:r("common.cancel"),props:{variant:"contained",color:"primary"}},onConfirm:m,onCancel:function(e){return f(e,!1)}})]})}oe.defaultProps={onDeleteSpaceGateway:function(){}};var se=oe,ie=t(95335);var ce,le=function(){var e=(0,ie.Z)(),n=(0,d.Z)(e.breakpoints.down("md"));return{minWidth:n?300:e.breakpoints.values.sm,isMobile:n}},ue=t(74094),pe=["spaceGateway","selected","onDeleteSpaceGateway","onSelectGateway"],de=(0,$.Z)((function(){return{menuName:{display:"flex",flex:1,flexDirection:"column",paddingRight:"24px","& span":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}}}));function fe(e){var n=e.spaceGateway,t=e.selected,r=e.onDeleteSpaceGateway,a=e.onSelectGateway,o=(0,T.Z)(e,pe),s=de(),i=(0,h.PE)().t,c=le().isMobile,l=function(){var e=(0,E.Z)((0,C.Z)().mark((function e(){return(0,C.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r(n);case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,G.jsxs)(he,(0,R.Z)((0,R.Z)({},o),{},{children:[(0,G.jsx)(P.Z,{display:"inline-flex",marginRight:"8px",alignItems:"center",children:(0,G.jsx)("img",{alt:n.name,src:u()(n.url,"favicon.ico"),width:"48px",height:"48px"})}),(0,G.jsxs)(P.Z,{className:s.menuName,onClick:a,children:[(0,G.jsxs)(J.Z,{component:"span",variant:"subtitle1",style:{fontWeight:"400"},children:[null===n||void 0===n?void 0:n.name," ",t&&(0,G.jsx)(X.Z,{color:"primary",style:{marginLeft:"8px"},children:i("common.selected")})]}),(0,G.jsx)(J.Z,{className:"url",component:"span",variant:"inherit",children:"".concat(c?(0,ue.aS)(null===n||void 0===n?void 0:n.url,38):null===n||void 0===n?void 0:n.url)})]}),(0,G.jsxs)(Y.Z,{children:[(0,G.jsx)(q.Z,{onClick:function(e){e.stopPropagation(),window.open(n.url)},size:"small",children:(0,G.jsx)(Q.Z,{})}),!0!==(null===n||void 0===n?void 0:n.protected)&&(0,G.jsx)(se,{spaceGateway:n,onDeleteSpaceGateway:l})]})]}))}var he=(0,f.Z)(P.Z)(ce||(ce=(0,a.Z)(["\n display: flex;\n"])));fe.defaultProps={onDeleteSpaceGateway:function(){},selected:!1,onSelectGateway:function(){}};var me=t(13128),xe=t(44846),ve=t(47020),ke=t(55372),ge=t(88574),we=t(84584),be=["onAddGateway"];function Ze(e){var n=e.onAddGateway,t=(0,T.Z)(e,be),r=(0,h.PE)(),a=r.t,s=r.locale,i=(0,o.useState)(""),c=(0,L.Z)(i,2),l=c[0],p=c[1],d=(0,o.useState)(!1),f=(0,L.Z)(d,2),m=f[0],x=f[1],v=(0,o.useState)(!1),k=(0,L.Z)(v,2),g=k[0],w=k[1],b=(0,o.useState)(""),Z=(0,L.Z)(b,2),y=Z[0],j=Z[1],S=function(){var e=(0,E.Z)((0,C.Z)().mark((function e(){var t,r,o,i,c,p;return(0,C.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,x(!0),(o=null===l||void 0===l||null===(t=l.replace(/\/api\/.+/,""))||void 0===t||null===(r=t.trim())||void 0===r?void 0:r.replace(/\/$/,"")).startsWith("http")||(o="https://".concat(o)),e.next=6,(0,we.w2)(o);case 6:if(e.sent){e.next=8;break}throw new Error(a("storage.spaces.gateway.add.invalidUrl"));case 8:return e.next=10,W.Z.get(u()(o,"/__blocklet__.js?type=json"));case 10:return i=e.sent,c=i.data,p={name:c.appName,url:o,protected:!1},e.next=15,n(p);case 15:te.Z.success(a("storage.spaces.addedWithName",{name:p.name})),w(!1),e.next=22;break;case 19:e.prev=19,e.t0=e.catch(0),j("".concat(a("storage.spaces.gateway.add.failed",s),": ").concat(ae()(e.t0)));case 22:return e.prev=22,x(!1),e.finish(22);case 25:case"end":return e.stop()}}),e,null,[[0,19,22,25]])})));return function(){return e.apply(this,arguments)}}();return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(_.Z,(0,R.Z)((0,R.Z)({size:"middle",color:"primary",variant:"outlined",onClick:function(){return w(!0)}},t),{},{children:a("storage.spaces.gateway.add.title")})),(0,G.jsxs)(me.ZP,{title:a("storage.spaces.gateway.add.title"),fullWidth:!0,maxWidth:"md",open:g,onClose:function(){return w(!1)},PaperProps:{style:{minHeight:"auto"}},actions:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(_.Z,{onClick:function(e){e.stopPropagation(),w(!1)},color:"inherit",children:a("common.cancel")}),(0,G.jsxs)(_.Z,{onClick:function(e){e.stopPropagation(),S()},color:"primary","data-cy":"install-blocklet-next-step",disabled:m||!l,variant:"contained",autoFocus:!0,children:[m&&(0,G.jsx)(xe.Z,{size:16}),a("common.confirm")]})]}),children:[(0,G.jsx)("div",{style:{paddingTop:12,overflowY:"hidden"},children:(0,G.jsx)(ke.Z,{component:"div",children:(0,G.jsx)(J.Z,{component:"div",children:(0,G.jsx)(ve.Z,{label:a("storage.spaces.gateway.add.label"),autoComplete:"off",variant:"outlined",name:"url",fullWidth:!0,value:l,onChange:function(e){j(null),p(e.target.value)},disabled:m,onKeyPress:function(){var e=(0,E.Z)((0,C.Z)().mark((function e(n){return(0,C.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("Enter"!==n.key){e.next=4;break}return n.preventDefault(),e.next=4,S();case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),autoFocus:!0})})})}),!!y&&(0,G.jsx)(ge.Z,{type:"error",style:{width:"100%"},children:y})]})]})}Ze.defaultProps={onAddGateway:function(){}};var ye=Ze,je=["onConnect"];function Se(e){var n=e.onConnect,t=(0,T.Z)(e,je),r=(0,o.useContext)(H),a=r.spaceGateways,s=r.selectedSpaceGateway,i=r.handleSelectSpaceGateway,c=r.addSpaceGateway,l=r.deleteSpaceGateway,u=(0,h.PE)().t,p=function(){var e=(0,E.Z)((0,C.Z)().mark((function e(n){return(0,C.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,c(n);case 2:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),d=function(){var e=(0,E.Z)((0,C.Z)().mark((function e(n){return(0,C.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,l(n);case 2:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,G.jsxs)(P.Z,(0,R.Z)((0,R.Z)({},t),{},{children:[(0,G.jsx)(B.Z,{children:a.map((function(e){var n=(null===e||void 0===e?void 0:e.url)===s.url;return(0,G.jsx)(N,{selected:n,children:(0,G.jsx)(D.ZP,{button:!0,selected:n,"data-cy":"get-space-endpoint-for-restore",children:(0,G.jsx)(U.Z,{children:(0,G.jsx)(fe,{spaceGateway:e,onDeleteSpaceGateway:d,selected:n,onSelectGateway:function(){return function(e){i(e)}(e)}})})},e.url)})}))}),(0,G.jsxs)(P.Z,{display:"flex",marginTop:"16px",justifyContent:"center",alignItems:"center",children:[(0,G.jsx)(ye,{onAddGateway:p}),(0,G.jsx)(_.Z,{sx:{marginLeft:"16px"},size:"middle",variant:"contained",onClick:function(){n(s)},children:u("storage.spaces.connect.now")})]})]}))}Se.defaultProps={onConnect:function(){}};var Pe,Re=Se,Ce=(0,f.Z)("div")(Pe||(Pe=(0,a.Z)(["\n width: 100%;\n height: 100%;\n overflow-y: auto;\n"])));var Ee,Te=function(){var e=(0,j.h6)().info,n=(0,o.useContext)(h.RD),t=n.t,r=n.locale,a=(0,o.useMemo)((function(){return e?(0,b.RU)(e):""}),[e]);return(0,G.jsx)(K,{children:(0,G.jsxs)(Ce,{children:[(0,G.jsx)(S.Z,{title:t("blocklet.restoreFromSpaces.connect.title"),subTitle:t("blocklet.restoreFromSpaces.connect.subTitle"),onClickBack:function(){return window.history.back()}}),(0,G.jsx)(P.Z,{display:"flex",justifyContent:"center",children:(0,G.jsx)(Re,{sx:{marginTop:"64px",marginBottom:"32px",width:"720px"},onConnect:function(e){var n=new URL(u()(e.url,"restore")),t=u()(a,"blocklets/restore/verify-ownership");n.searchParams.set("redirectUrl",t),n.searchParams.set("locale",r),window.location.href=n.toString()}})})]})})},Be=t(15849),De=t(73545),Ue=t(55152),_e=t(17450),Oe=t(38898),Fe=t(39463),Ge=t(70461),Ne=t(31853),Ae=t(13455),ze=t(13932),Le=t(31910),Me=t(93040),Ie=(0,f.Z)("div")(Ee||(Ee=(0,a.Z)(["\n width: 100%;\n height: 100%;\n overflow-y: auto;\n"]))),We="verify-app-ownership-spaces";var He,Ve,Ke,$e,Je,Ye=function(){var e=(0,De.T)().session,n=(0,Be.useSearchParams)(),t=(0,L.Z)(n,1)[0],r=(0,h.PE)().t,a=(0,j.h6)(),s=a.api,i=a.info,l=(0,De.T)().api,p=(0,Le.J_)().meta,d=(0,c.useNavigate)(),f=(0,o.useMemo)((function(){return i?(0,b.RU)(i):""}),[i]),m=(0,Ne.Z)({isRestoring:!1,isComplete:!1,isOverwrite:!1,shouldReconnect:!1,exists:!1,accessUrl:"",isConnectOpen:!1,isConfirmOpen:!1,connectData:{action:"",checkFn:function(){},extraParams:{}},connectMessages:{}}),x=(0,L.Z)(m,2),v=x[0],k=x[1];(0,o.useEffect)((function(){O()}),[]);var g=t.get("launchType"),w=t.get("nftId"),Z=t.get("chainHost"),y=t.get("from"),R=t.get("blocklet_meta_url"),T=t.get("launcherSessionId")||"",B=t.get("launcherUrl")||"",D=function(e){var n=e.split("/").filter(Boolean);return n[n.length-2]}(p.spaceEndpoint),U=(0,Fe.getServerAuthMethod)(i,g,T,e.user),O=function(){var n=(0,E.Z)((0,C.Z)().mark((function n(){var t,a,o,i,c,d,h,m,x,b,y,j,S,P,R,E,_,O,G,N,A=arguments;return(0,C.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(i=A.length>0&&void 0!==A[0]&&A[0]){n.next=15;break}if(!v.shouldReconnect){n.next=5;break}return window.location.href=u()(f,"blocklets/restore/connect-space"),n.abrupt("return");case 5:if(!e.user){n.next=15;break}return n.next=8,s.getBlocklet({input:{did:D,attachRuntimeInfo:!0}});case 8:if(!(c=n.sent).blocklet){n.next=15;break}return n.next=12,(0,Me.DB)(c.blocklet);case 12:return(d=n.sent)&&(h=new URL(d),"running"!==c.blocklet.status&&h.searchParams.set("__start__","1"),k({shouldReconnect:!0,exists:!0,accessUrl:h.href})),n.abrupt("return");case 15:if("nft"!==U){n.next=36;break}return(y=new URL(window.location.href)).pathname=u()(null!==(m=null===(x=window)||void 0===x||null===(b=x.env)||void 0===b?void 0:b.apiPrefix)&&void 0!==m?m:"/","/api/did/".concat(We,"/token")),y.searchParams.set("appDid",D),y.searchParams.set("endpoint",p.spaceEndpoint),y.searchParams.set("referrer",window.location.href),y.searchParams.set("nftId",w),y.searchParams.set("appPid",p.did),j={autoConnect:!1,launchType:g,nftId:w},Z&&(y.searchParams.set("chainHost",Z),j.chainHost=Z),i&&y.searchParams.set("overwrite","1"),n.next=28,l.get(y.href);case 28:if(S=n.sent,!(P=S.data).error){n.next=33;break}return te.Z.error(P.error),n.abrupt("return");case 33:return j.nw=P.url,k({isConnectOpen:!0,connectData:{action:"verify-restore-by-nft",extraParams:j},connectMessages:{title:r("blocklet.restoreFromSpaces.nftAuthDialog.title"),scan:r("blocklet.restoreFromSpaces.nftAuthDialog.scan"),confirm:r("blocklet.restoreFromSpaces.nftAuthDialog.confirm"),success:r("blocklet.restoreFromSpaces.nftAuthDialog.success")}}),n.abrupt("return");case 36:if("launcher"!==U){n.next=44;break}return n.next=39,s.getLauncherSession({input:{launcherUrl:B,launcherSessionId:T}});case 39:return R=n.sent,E=R.launcherSession,_=R.error,E?k({isConnectOpen:!0,connectData:{action:We,extraParams:{appDid:D,appPid:p.did,endpoint:p.spaceEndpoint,referrer:window.location.href,restoreFrom:"spaces",overwrite:i?"1":void 0,launcherUrl:B,launcherSessionId:T,chainHost:Z}},connectMessages:{title:r("blocklet.restoreBlocklet.verify.title"),scan:r("blocklet.restoreBlocklet.verify.scan"),confirm:r("blocklet.restoreBlocklet.verify.confirm"),success:r("blocklet.restoreBlocklet.verify.success")}}):te.Z.error("Launch session invalid: ".concat(_)),n.abrupt("return");case 44:if("session"!==U){n.next=47;break}return k({isConnectOpen:!0,connectData:{action:We,extraParams:{appDid:D,appPid:p.did,endpoint:p.spaceEndpoint,referrer:window.location.href,overwrite:i?"1":void 0,restoreFrom:"spaces"}},connectMessages:{title:r("blocklet.restoreBlocklet.verify.title"),scan:r("blocklet.restoreBlocklet.verify.scan"),confirm:r("blocklet.restoreBlocklet.verify.confirm"),success:r("blocklet.restoreBlocklet.verify.success")}}),n.abrupt("return");case 47:return(O=new URL(window.location.href)).pathname=u()(null!==(t=null===(a=window)||void 0===a||null===(o=a.env)||void 0===o?void 0:o.apiPrefix)&&void 0!==t?t:"/","/api/did/".concat(We,"/token")),O.searchParams.set("appDid",D),O.searchParams.set("appPid",p.did),O.searchParams.set("endpoint",p.spaceEndpoint),O.searchParams.set("referrer",window.location.href),O.searchParams.set("restoreFrom","spaces"),n.next=56,l.get(O.href);case 56:G=n.sent,N=G.data,e.login({onSuccess:function(){return F()},extraParams:{nw:N.url}});case 59:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}(),F=function(){var n=(0,E.Z)((0,C.Z)().mark((function n(t,r){var a;return(0,C.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(null===(a=Array.isArray(t)?t.find((function(e){return!!e.sessionToken})):t)||void 0===a||!a.sessionToken){n.next=5;break}return(0,ue.ZB)(r(a.sessionToken)),n.next=5,e.refresh();case 5:k({isConnectOpen:!1}),setTimeout((function(){var e=new URLSearchParams({appDid:D});[{name:"launchType",value:g},{name:"nftId",value:w},{name:"from",value:y},{name:"blocklet_meta_url",value:R},{name:"chainHost",value:Z}].forEach((function(n){var t=n.name,r=n.value;r&&e.set(t,r)})),d("/blocklets/restore/restore-blocklet?".concat(e.toString()))}),0);case 7:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}();return(0,G.jsxs)(Ie,{children:[(0,G.jsx)(S.Z,{title:r("blocklet.restoreBlocklet.verify.title"),subTitle:r("blocklet.restoreBlocklet.verify.subTitle"),onClickBack:function(){return window.history.back()}}),(0,G.jsxs)(P.Z,{textAlign:"center",mt:6,children:[(0,G.jsx)(Ae.Z,{blocklet:{meta:p},blockletMetaUrl:R}),(0,G.jsxs)(P.Z,{mt:2,mb:2,children:[(0,G.jsx)(J.Z,{variant:"body2",children:p.title}),(0,G.jsx)(_e.Z,{did:D})]}),v.exists&&v.accessUrl&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(J.Z,{component:"p",variant:"body1",gutterBottom:!0,sx:{color:"orange"},children:r("blocklet.restoreBlocklet.verify.exists")}),(0,G.jsxs)(J.Z,{component:"div",sx:{marginTop:"32px"},children:[v.accessUrl&&(0,G.jsx)(_.Z,{variant:"contained",component:Oe.Z,href:v.accessUrl,sx:{width:"160px",height:"100%"},children:r("blocklet.restoreBlocklet.verify.open")}),(0,G.jsx)(_.Z,{variant:"contained",color:"error",onClick:function(){k({isConfirmOpen:!0})},sx:{width:"160px",height:"100%",marginLeft:"32px"},children:r("blocklet.restoreBlocklet.verify.overwrite")})]})]}),!v.exists&&(0,G.jsx)(_.Z,{variant:"contained",disabled:v.isConnectOpen,onClick:O,sx:{width:"180px",height:"100%"},children:r("blocklet.restoreBlocklet.verify.".concat(v.shouldReconnect?"reconnect":"verify"))})]}),v.connectData.isConnectOpen&&(0,G.jsx)(ze.Z,{appDid:D,visible:!1}),(0,G.jsx)(Ue.default,{popup:!0,open:v.isConnectOpen,forceConnected:!1,saveConnect:!1,action:v.connectData.action,checkFn:l.get,checkTimeout:3e5,webWalletUrl:(0,ue.yP)(i),onSuccess:F,extraParams:v.connectData.extraParams,messages:v.connectMessages,onClose:function(){k({isConnectOpen:!1})}}),v.isConfirmOpen&&(0,G.jsx)(Ge.Z,{color:"error",title:r("blocklet.restoreBlocklet.overwrite.title"),description:r("blocklet.restoreBlocklet.overwrite.description"),confirm:r("common.confirm"),onCancel:function(){k({isConfirmOpen:!1})},onConfirm:function(){k({isConfirmOpen:!1,isOverwrite:!0}),O(!0)}})]})},Qe=t(56666),qe=t(55309),Xe=(0,f.Z)(qe.Z)(He||(He=(0,a.Z)(["\n && .result-footer {\n height: 120px;\n > div {\n flex-wrap: wrap;\n }\n }\n"]))),en=t(35266),nn=t(76811),tn=t(77429),rn=t(75506),an=t.n(rn),on=t(50482),sn=t.n(on),cn=t(11397),ln=t.n(cn),un=t(11476),pn=t(34937),dn=t(66436),fn=ln()("@abtnode/webapp:restore-blocklet:step-install"),hn=(0,f.Z)("div")(Ve||(Ve=(0,a.Z)(["\n display: flex;\n align-items: center;\n justify-content: flex-start;\n flex-direction: column;\n width: 100%;\n height: 100%;\n overflow-y: auto;\n"]))),mn=f.Z.div(Ke||(Ke=(0,a.Z)(["\n line-height: 1.4em;\n .error-desc {\n margin-top: 8px;\n word-wrap: break-word;\n color: ",";\n }\n"])),(function(e){return e.theme.palette.grey[500]})),xn=($e={},(0,Qe.Z)($e,nn.RESTORE_PROGRESS_STATUS.waiting,0),(0,Qe.Z)($e,nn.RESTORE_PROGRESS_STATUS.start,1),(0,Qe.Z)($e,nn.RESTORE_PROGRESS_STATUS.importData,2),(0,Qe.Z)($e,nn.RESTORE_PROGRESS_STATUS.downloading,3),(0,Qe.Z)($e,nn.RESTORE_PROGRESS_STATUS.importDataSuccess,4),(0,Qe.Z)($e,nn.RESTORE_PROGRESS_STATUS.installing,5),(0,Qe.Z)($e,nn.RESTORE_PROGRESS_STATUS.completed,10),$e);var vn=(0,f.Z)(P.Z)(Je||(Je=(0,a.Z)(["\n padding-top: 24px;\n"]))),kn=function(){var e,n,t,r,a=new URL(window.location.href),s=a.searchParams.get("appDid"),i=a.searchParams.get("launchType"),c=a.searchParams.get("nftId"),l=a.searchParams.get("fromLauncher"),u=a.searchParams.get("from"),p=a.searchParams.get("chainHost"),d=function(e){var n=e.appDid,t=(0,o.useState)(nn.RESTORE_PROGRESS_STATUS.waiting),r=(0,L.Z)(t,2),a=r[0],s=r[1],i=(0,pn.ZP)();return i.connect(),(0,o.useEffect)((function(){return i.on(nn.BlockletEvents.restoreProgress,(function(e){n===(null===e||void 0===e?void 0:e.appDid)&&s(e)})),function(){i.off(nn.BlockletEvents.restoreProgress)}}),[n,i]),a}({appDid:s}),f=(0,o.useState)(0),m=(0,L.Z)(f,2),x=m[0],v=m[1],k=(0,o.useRef)(null),g=(0,Le.J_)().meta,w=(0,h.PE)().t,Z=(0,j.h6)(),y=Z.api,P=Z.info,T=(0,Ne.Z)({nextAccessUrl:"",installError:null}),B=(0,L.Z)(T,2),D=B[0],U=B[1],O=(0,un.Z)(s),F=O.status,N=O.eventName,A=function(){v(12),k.current&&(clearTimeout(k.current),k.current=null),k.current=setTimeout((function(){y.getBlocklet({input:{did:s,attachRuntimeInfo:!0}}).then((function(e){e.blocklet&&I(e.blocklet)}))}),500)},z=function(){var e,n;null!==O&&void 0!==O&&null!==(e=O.runtimeBlocklet)&&void 0!==e&&null!==(n=e.settings)&&void 0!==n&&n.initialized?v(11):A()},M=[w("blocklet.restoreFromSpaces.progress.waiting"),w("blocklet.restoreFromSpaces.progress.restoring"),w("blocklet.restoreFromSpaces.progress.importData"),w("blocklet.restoreFromSpaces.progress.downloading",{progress:"".concat(null!==(e=null===d||void 0===d||null===(n=d.data)||void 0===n?void 0:n.completed)&&void 0!==e?e:100,"/").concat(null!==(t=null===d||void 0===d||null===(r=d.data)||void 0===r?void 0:r.total)&&void 0!==t?t:100)}),w("blocklet.restoreFromSpaces.progress.importSuccess"),w("launchBlocklet.waiting.downloading"),w("launchBlocklet.waiting.verifying"),w("launchBlocklet.waiting.downloading"),w("launchBlocklet.waiting.extracting"),w("upgrading"===F?"common.upgrading":"launchBlocklet.waiting.installing"),w("launchBlocklet.waiting.installed"),w("launchBlocklet.waiting.starting"),w("launchBlocklet.waiting.done")];(0,o.useEffect)((function(){if(d.status===nn.RESTORE_PROGRESS_STATUS.error){var e={message:d.message,name:"restoreFailed",action:"retryRestore"};return sn()(e,D.installError)||te.Z.error(ae()(e)),void U({installError:e})}v(xn[d.status]||0)}),[d.status]),(0,o.useEffect)((function(){if("serverless"!==i||N!==nn.BlockletEvents.nftConsumed)switch(F){case"waiting":v(6);break;case"downloading":v(7);break;case"installing":case"upgrading":v(8);break;case"installed":if("serverless"===i&&!(0,Me.MZ)(O))break;z();break;case"starting":v(11);break;case"running":v(12),A();break;case"stopped":A();break;case"corrupted":case"error":var e;null===O||void 0===O||O.stopPolling();var n={message:null===O||void 0===O||null===(e=O.error)||void 0===e?void 0:e.message,name:null===O||void 0===O?void 0:O.eventName,action:"retryRestore"},t=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!sn()(n,D.installError)&&null!==O&&void 0!==O&&null!==(e=O.error)&&void 0!==e&&e.message&&te.Z.error(ae()(O.error)),U((0,R.Z)({installError:n},t))};y.getBlocklet({input:{did:s,attachRuntimeInfo:!0}}).then((function(e){var r,a=e.blocklet;null!==a&&void 0!==a&&null!==(r=a.settings)&&void 0!==r&&r.initialized&&(n.action="retryStart"),t()})).catch((function(){t()}))}else z()}),[F,N,O]);var I=function(){var e=(0,E.Z)((0,C.Z)().mark((function e(n){var t,r;return(0,C.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Me.DB)(n);case 2:if(t=e.sent,!an()(t)){e.next=5;break}return e.abrupt("return");case 5:(r=new URL(t)).searchParams.set("serverUrl",(0,b.RU)(P)),"running"!==n.status&&r.searchParams.set("__start__","1"),l&&r.searchParams.set("fromLauncher",l),u&&r.searchParams.set("from",u),i&&r.searchParams.set("launchType",i),c&&r.searchParams.set("nftId",c),p&&r.searchParams.set("chainHost",p),null===O||void 0===O||O.stopPolling(),U({nextAccessUrl:r.href,status:n.status,resultMessage:"running"===n.status?{variant:"success",title:w("blocklet.restoreFromSpaces.restore.completeTitle"),subTitle:"",footer:w("common.open")}:{variant:"info",title:w("blocklet.restoreFromSpaces.restore.installedTitle"),subTitle:w("blocklet.restoreFromSpaces.restore.installedSubTitle"),footer:w("common.configuration")}});case 15:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),W=function(){var e=(0,E.Z)((0,C.Z)().mark((function e(){return(0,C.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return U({installError:null,nextAccessUrl:""}),e.next=3,y.startBlocklet({input:{did:s}});case 3:null===O||void 0===O||O.startPolling();case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();if(D.installError){var H={retryRestore:(0,G.jsx)(_.Z,{variant:"contained",className:"bottom-button","data-cy":"retry-install",component:Be.Link,to:"/blocklets/restore/verify-ownership".concat(window.location.search),children:w("common.retry")}),retryStart:(0,G.jsx)(_.Z,{variant:"contained",className:"bottom-button","data-cy":"retry-start",onClick:function(){return W()},children:w("common.retry")})},V=D.installError.name?D.installError.name.replace("blocklet.",""):"installFailed";return(0,G.jsx)(Xe,{variant:"error",title:null===g||void 0===g?void 0:g.title,subTitle:(0,G.jsxs)(mn,{children:[(0,G.jsx)("div",{children:w("launchBlocklet.error.".concat(V))}),D.installError.message&&(0,G.jsx)("div",{className:"error-desc",children:w("common.errorMessage")+D.installError.message})]}),footer:(0,G.jsxs)(vn,{children:[H[D.installError.action],"serverless"===i&&(0,G.jsx)("div",{style:{marginTop:"24px"},dangerouslySetInnerHTML:{__html:w("blocklet.restoreFromSpaces.restore.support",{communityLink:"https://community.arcblock.io/",supportEmail:"launcher@arcblock.io"})}})]})})}var K=!!D.nextAccessUrl;return fn("render",{status:F,eventName:N,launchType:i,runtimeBlockletState:O,state:D}),(0,G.jsxs)(hn,{children:[!K&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(S.Z,{title:w("blocklet.restoreBlocklet.restore.title"),subTitle:w("blocklet.restoreFromSpaces.restore.subTitle")}),(0,G.jsxs)(dn.Z,{children:[(0,G.jsx)(en.Z,{increaseSpeed:.3,messageLoop:!1,message:(0,G.jsx)(tn.Z,{steps:M,stepIndex:x,autoGrowth:10===x?1e3:4e3})}),[5,7,8].includes(x)&&(0,G.jsx)(ze.Z,{appDid:s})]})]}),K&&(0,G.jsx)(Xe,{variant:D.resultMessage.variant,title:D.resultMessage.title,subTitle:D.resultMessage.subTitle,footer:(0,G.jsx)(vn,{children:(0,G.jsx)(_.Z,{variant:"contained",style:{width:"200px"},component:Oe.Z,href:D.nextAccessUrl,children:D.resultMessage.footer})})})]})};var gn,wn,bn,Zn=function(){return(0,G.jsx)(kn,{})},yn=t(23484);function jn(){var e=(0,d.Z)((function(e){return e.breakpoints.down("md")})),n=(0,h.PE)(),t=n.t,r=n.locale,a=(0,j.h6)().info,s=(0,yn.Z)(),l=(0,Le.J_)().meta,f=(0,o.useMemo)((function(){return a?(0,b.RU)(a):""}),[a]),S=(0,Z.yP)(a),P=u()((0,Z.Y5)(),"/blocklets/restore"),R=[{key:"verify-ownership",name:t("blocklet.restoreBlocklet.verify.title"),path:u()(P,"verify-ownership")},{key:"restore-blocklet",name:t("blocklet.restoreFromSpaces.restore.title"),path:u()(P,"restore-blocklet")}],C=[];C="launcher"===i()(s.get("from"))?[{key:"purchase-space",name:t("launchBlocklet.steps.purchaseSpace")},{key:"prepare-space",name:t("launchBlocklet.steps.prepareSpace")}].concat(R):[{key:"connect-space",name:t("blocklet.restoreFromSpaces.connect.title"),path:u()(P,"connect-space")},{key:"select-blocklet",name:t("blocklet.restoreFromSpaces.selectBlocklet.title")}].concat(R);var E=(0,G.jsx)(Tn,{className:"".concat(f?"logo-can-click":""),children:(0,G.jsx)(w.Z,{onClick:function(){f&&window.open(f)},logo:e?(0,G.jsx)(k.Z,{width:"32",height:"32"}):(0,G.jsx)(g.Z,{width:"128",height:"48"})})});return(0,G.jsx)(x.W,{steps:C,children:(0,G.jsx)(m.Z,{blockletMeta:l,locale:r,useOfSkeleton:!1,navLogo:E,navSubTitle:t("blocklet.restoreFromSpaces.navSubTitle"),loading:!1,headerEndAddons:(0,G.jsx)(v.Z,{webWalletUrl:S,SessionContext:y.B3}),pcWidth:"80%",style:{height:"100%"},logoUrl:null===l||void 0===l?void 0:l.logo,children:(0,G.jsxs)(En,{children:[(0,G.jsx)(p.Global,{styles:Cn}),(0,G.jsxs)(c.Routes,{children:[(0,G.jsx)(c.Route,{path:"connect-space",element:(0,G.jsx)(Te,{})}),(0,G.jsx)(c.Route,{path:"verify-ownership",element:(0,G.jsx)(Ye,{})}),(0,G.jsx)(c.Route,{path:"restore-blocklet",element:(0,G.jsx)(Zn,{})}),(0,G.jsx)(c.Route,{path:"*",element:(0,G.jsx)(c.Navigate,{to:"connect-space",replace:!0})})]})]})})})}var Sn,Pn,Rn,Cn=(0,p.css)(gn||(gn=(0,a.Z)(["\n html,\n body,\n #root,\n #root > .wrapper {\n height: 100%;\n }\n"]))),En=f.Z.div(wn||(wn=(0,a.Z)(["\n "," {\n padding-top: 34px;\n }\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n\n .bottom-button {\n min-width: 200px;\n }\n"])),(function(e){return e.theme.breakpoints.up("md")})),Tn=f.Z.div(bn||(bn=(0,a.Z)(["\n margin-top: -1px;\n &.logo-can-click {\n cursor: pointer;\n }\n"]))),Bn=t(83294),Dn=t(72333),Un=t(25710);function _n(e){var n=e.onSelect,t=(0,j.h6)().api,r=(0,h.PE)(),a=r.t,s=r.locale,i=(0,o.useState)(!1),l=(0,L.Z)(i,2),u=l[0],p=l[1],d=(0,o.useState)([]),f=(0,L.Z)(d,2),m=f[0],x=f[1],v=(0,o.useState)(""),k=(0,L.Z)(v,2),g=k[0],w=k[1],b=(0,o.useState)(null),y=(0,L.Z)(b,2),R=y[0],T=y[1],B=(0,c.useNavigate)(),D=function(){var e=(0,E.Z)((0,C.Z)().mark((function e(){var n,r,a;return(0,C.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,p(!0),T(!1),e.next=5,t.doBatchQuery({getBlocklets:{input:{}},getBlockletsFromBackup:{input:{}}});case 5:n=e.sent,r=n.getBlocklets.blocklets,a=n.getBlockletsFromBackup.backups,x((a||[]).filter((function(e){return!(r||[]).some((function(n){var t;return e.appPid===(null===(t=n.meta)||void 0===t?void 0:t.did)}))})).sort((function(e,n){return n.createdAt-e.createdAt})).slice(0,200)),p(!1),e.next=16;break;case 12:e.prev=12,e.t0=e.catch(0),p(!1),T(e.t0.message);case 16:case"end":return e.stop()}}),e,null,[[0,12]])})));return function(){return e.apply(this,arguments)}}();(0,o.useEffect)((function(){D()}),[]);var U=null;return U=R?(0,G.jsx)(ge.Z,{type:"error",style:{width:"100%",marginTop:8},children:R}):u?(0,G.jsx)(xe.Z,{size:16}):m.length?(0,G.jsx)(Gn,{children:m.map((function(e){return(0,G.jsxs)(Nn,{className:"middle-font-size space ".concat(g===e.appDid?"selected":""),onClick:function(){return function(e){w(e.appDid)}(e)},children:[(0,G.jsxs)("div",{className:"left",children:[(0,G.jsx)("div",{className:"header",children:(0,G.jsx)(P.Z,{sx:{width:40,height:40},children:(0,G.jsx)(Dn.Z,{did:e.appDid,size:40})})}),(0,G.jsxs)("div",{className:"body",children:[(0,G.jsx)(J.Z,{className:"text",children:e.name}),(0,G.jsx)(J.Z,{className:"text middle-font-size",children:(0,G.jsx)(_e.Z,{responsive:!1,compact:!0,inline:!0,copyable:!1,size:12,did:e.appDid})})]}),(0,G.jsxs)(P.Z,{color:"text.secondary",className:"footer small-font-size",children:[a("blocklet.restoreFromServer.backupIn")," ",(0,Z.B2)(e.createdAt,s)]})]}),(0,G.jsx)("div",{className:"right",children:(0,G.jsx)("div",{className:"more",children:(0,G.jsx)(q.Z,{onClick:function(){},className:"more-btn",size:"large","aria-label":"more functions",children:(0,G.jsx)(Bn.Z,{color:"disabled"})})})}),(0,G.jsx)("div",{className:"selected-container",children:(0,G.jsx)(O.default,{className:"selected-icon"})})]},e.appDid)}))}):(0,G.jsx)(Un.Z,{children:a("common.empty")}),(0,G.jsxs)(Fn,{style:{width:"100%"},children:[(0,G.jsx)(S.Z,{title:a("blocklet.restoreFromServer.selectTitle"),subTitle:a("blocklet.restoreFromServer.description")}),(0,G.jsx)(P.Z,{mt:4,mx:3,className:"main-body",children:U}),(0,G.jsx)(P.Z,{className:"main-footer",display:"flex",justifyContent:"center",children:(0,G.jsx)(_.Z,{sx:{width:"180px",height:"100%"},onClick:function(e){e.stopPropagation(),function(){var e=m.find((function(e){return e.appDid===g}));n({did:e.appDid,name:e.appDid,title:e.name});var t=new URL(window.location.href);t.searchParams.set("appDid",e.appDid),t.searchParams.set("appName",e.name),B("/blocklets/restore/verify-ownership".concat(t.search))}()},color:"primary","data-cy":"install-blocklet-next-step",variant:"contained",disabled:u||R||!g,children:a("common.restore")})})]})}_n.defaultProps={onSelect:function(){}};var On,Fn=(0,f.Z)(P.Z)(Sn||(Sn=(0,a.Z)(["\n .main-body {\n height: 50vh;\n "," {\n height: 80vh;\n }\n\n overflow: auto;\n }\n .main-footer {\n padding-top: 24px;\n padding-bottom: 24px;\n "," {\n position: fixed;\n bottom: 16px;\n width: 100%;\n padding-bottom: 0;\n }\n }\n"])),(function(e){return e.theme.breakpoints.down("md")}),(function(e){return e.theme.breakpoints.down("md")})),Gn=(0,f.Z)(P.Z)(Pn||(Pn=(0,a.Z)(["\n display: block;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n max-width: 1000px;\n margin: 0 auto;\n\n .space {\n display: flex;\n margin: 8px auto;\n\n .selected-container {\n position: absolute;\n right: 0px;\n bottom: 0px;\n display: flex;\n -webkit-box-pack: end;\n justify-content: flex-end;\n align-items: flex-end;\n width: 30px;\n height: 30px;\n border-radius: 0px 0px 7px;\n color: rgb(255, 255, 255);\n overflow: hidden;\n transition: all 0.3s ease 0s;\n\n &::after {\n position: absolute;\n z-index: 0;\n left: 30px;\n top: 30px;\n display: block;\n width: 0px;\n height: 0px;\n border-width: 15px;\n border-style: solid;\n /* border-color: transparent rgb(29, 193, 199) rgb(29, 193, 199) transparent; */\n border-color: transparent ","\n "," transparent;\n transition: all 0.1s ease 0s;\n content: '';\n }\n\n .selected-icon {\n visibility: hidden;\n width: 60%;\n height: 60%;\n position: relative;\n z-index: 2;\n margin: 0px 1px 1px 0px;\n font-size: 16px;\n transition: all 0.2s ease 0s;\n }\n }\n }\n\n .space.selected {\n background-color: rgb(236, 251, 253);\n border-color: rgb(236, 251, 253);\n\n .selected-container {\n &::after {\n left: 0px;\n top: 0px;\n }\n\n .selected-icon {\n visibility: visible;\n }\n }\n }\n"])),(function(e){return e.theme.palette.primary.main}),(function(e){return e.theme.palette.primary.main})),Nn=(0,f.Z)("div")(Rn||(Rn=(0,a.Z)(["\n display: flex;\n position: relative;\n width: 100%;\n padding: 10px;\n border: 1 solid #ccc;\n cursor: pointer;\n\n .left {\n display: flex;\n align-items: flex-start;\n width: 100%;\n margin: 0px 20px 0px 0px;\n\n .header {\n padding: 5px 16px 0 0;\n }\n\n .body {\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n\n .footer {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n height: 100%;\n }\n }\n\n .right {\n display: flex;\n }\n\n "," {\n .left {\n display: flex;\n flex-direction: column;\n margin-right: 20px;\n\n .header {\n display: none;\n }\n\n .footer {\n margin-top: 6px;\n margin-left: 0px;\n padding: 2px 0px;\n height: auto;\n }\n }\n\n .right {\n width: auto;\n }\n\n .text {\n display: -webkit-box;\n overflow: hidden;\n -webkit-box-orient: vertical;\n }\n }\n\n // \u516c\u5171\u5c5e\u6027\n .middle-font-size {\n font-size: 14px;\n }\n\n .small-font-size {\n font-size: 12px;\n }\n"])),(function(e){return e.theme.breakpoints.down("md")})),An=t(95712),zn=(0,f.Z)("div")(On||(On=(0,a.Z)(["\n width: 100%;\n height: 100%;\n overflow-y: auto;\n"]))),Ln="verify-app-ownership-disk";var Mn,In,Wn,Hn=function(){var e=new URL(window.location.href),n=e.searchParams.get("appDid"),t=e.searchParams.get("appName"),r=(0,h.PE)().t,a=(0,j.h6)(),s=a.api,i=a.info,c=(0,De.T)(),l=c.session,p=c.api,d=(0,o.useMemo)((function(){return i?(0,b.RU)(i):""}),[i]),f=(0,Ne.Z)({isRestoring:!1,isComplete:!1,connectData:{isConnectOpen:!1,action:"",checkFn:function(){},extraParams:{}}}),m=(0,L.Z)(f,2),x=m[0],v=m[1];(0,o.useEffect)((function(){g()}),[]);var k=function(){var e=(0,E.Z)((0,C.Z)().mark((function e(){return(0,C.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.getBlocklet({input:{did:n}});case 2:if(!e.sent.blocklet){e.next=7;break}return te.Z.error("Blocklet ".concat(t,"(").concat(n,") already exists")),v({shouldReconnect:!0}),e.abrupt("return");case 7:v({connectData:{isConnectOpen:!0,action:Ln,extraParams:{appDid:n,restoreFrom:"disk"}}});case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),g=function(){var e=(0,E.Z)((0,C.Z)().mark((function e(){var t,r,a,o,s,i;return(0,C.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l.user){e.next=11;break}return(o=new URL(window.location.href)).pathname=u()(null!==(t=null===(r=window)||void 0===r||null===(a=r.env)||void 0===a?void 0:a.apiPrefix)&&void 0!==t?t:"/","/api/did/".concat(Ln,"/token")),o.searchParams.set("appDid",n),o.searchParams.set("restoreFrom","disk"),e.next=7,p.get(o.href);case 7:return s=e.sent,i=s.data,l.login({onSuccess:function(){return w()},extraParams:{nw:i.url}}),e.abrupt("return");case 11:return e.next=13,k();case 13:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),w=function(){v({connectData:{isConnectOpen:!1}}),setTimeout((function(){var e=new URL(u()(d,"blocklets/restore/restore-blocklet".concat(window.location.search)));window.location.href=e.href}),0)};return(0,G.jsxs)(zn,{children:[(0,G.jsx)(S.Z,{title:r("blocklet.restoreBlocklet.verify.title"),subTitle:r("blocklet.restoreBlocklet.verify.subTitle")}),(0,G.jsxs)(P.Z,{textAlign:"center",mt:6,children:[(0,G.jsx)(An.Z,{did:n,size:128}),(0,G.jsxs)(P.Z,{mt:2,mb:2,children:[(0,G.jsx)(J.Z,{variant:"body2",children:t}),(0,G.jsx)(_e.Z,{did:n})]}),(0,G.jsx)(_.Z,{variant:"contained",disabled:x.connectData.isConnectOpen,onClick:g,sx:{width:"180px",height:"100%"},children:r("blocklet.restoreBlocklet.verify.".concat(x.shouldReconnect?"reconnect":"verify"))})]}),x.connectData.isConnectOpen&&(0,G.jsx)(ze.Z,{appDid:n,visible:!1}),(0,G.jsx)(Ue.default,{popup:!0,open:x.connectData.isConnectOpen,forceConnected:!1,saveConnect:!1,action:x.connectData.action,checkFn:p.get,checkTimeout:3e5,webWalletUrl:(0,ue.yP)(i),onSuccess:w,extraParams:x.connectData.extraParams,messages:{title:r("blocklet.restoreBlocklet.verify.title"),scan:r("blocklet.restoreBlocklet.verify.scan"),confirm:r("blocklet.restoreBlocklet.verify.confirm"),success:r("blocklet.restoreBlocklet.verify.success")},onClose:function(){v({connectData:{isConnectOpen:!1}})}})]})};function Vn(){var e=(0,d.Z)((function(e){return e.breakpoints.down("md")})),n=(0,h.PE)(),t=n.t,r=n.locale,a=(0,j.h6)().info,s=(0,o.useState)({}),i=s.meta,l=s.setMeta,f=(0,o.useMemo)((function(){return a?(0,b.RU)(a):""}),[a]),S=(0,Z.yP)(a),P=u()((0,Z.Y5)(),"/blocklets/restore"),C=[{key:"select",name:t("blocklet.restoreFromServer.selectTitle"),path:u()(P,"select")},{key:"verify-ownership",name:t("blocklet.restoreBlocklet.verify.title"),path:u()(P,"verify-ownership")},{key:"restore-blocklet",name:t("blocklet.restoreBlocklet.restore.title"),path:u()(P,"restore-blocklet")}],E=(0,G.jsx)(Jn,{className:"".concat(f?"logo-can-click":""),children:(0,G.jsx)(w.Z,{onClick:function(){f&&window.open(f)},logo:e?(0,G.jsx)(k.Z,{width:"32",height:"32"}):(0,G.jsx)(g.Z,{width:"128",height:"48"})})});return(0,G.jsx)(x.W,{steps:C,children:(0,G.jsx)(m.Z,{blockletMeta:(0,R.Z)((0,R.Z)({},i),{},{registryUrl:""}),locale:r,useOfSkeleton:!1,navLogo:E,headerEndAddons:(0,G.jsx)(v.Z,{webWalletUrl:S,SessionContext:y.B3}),pcWidth:"80%",style:{height:"100%"},logoUrl:null===i||void 0===i?void 0:i.logo,children:(0,G.jsxs)($n,{children:[(0,G.jsx)(p.Global,{styles:Kn}),(0,G.jsxs)(c.Routes,{children:[(0,G.jsx)(c.Route,{path:"select",element:(0,G.jsx)(_n,{onSelect:l})}),(0,G.jsx)(c.Route,{path:"verify-ownership",element:(0,G.jsx)(Hn,{})}),(0,G.jsx)(c.Route,{path:"restore-blocklet",element:(0,G.jsx)(Zn,{})}),(0,G.jsx)(c.Route,{path:"*",element:(0,G.jsx)(c.Navigate,{to:"select".concat(window.location.search),replace:!0})})]})]})})})}var Kn=(0,p.css)(Mn||(Mn=(0,a.Z)(["\n html,\n body,\n #root,\n #root > .wrapper {\n height: 100%;\n }\n"]))),$n=f.Z.div(In||(In=(0,a.Z)(["\n "," {\n padding-top: 34px;\n }\n width: 100%;\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n\n .bottom-button {\n min-width: 200px;\n }\n"])),(function(e){return e.theme.breakpoints.up("md")})),Jn=f.Z.div(Wn||(Wn=(0,a.Z)(["\n margin-top: -1px;\n &.logo-can-click {\n cursor: pointer;\n }\n"])));function Yn(){return window.location.search.includes("restoreFrom=server")?(0,G.jsx)(Vn,{}):(0,G.jsx)(jn,{})}},84584:function(e,n,t){"use strict";t.d(n,{Jf:function(){return Z},LQ:function(){return f},Nb:function(){return h},Xv:function(){return p},ag:function(){return v},mo:function(){return x},nD:function(){return d},nU:function(){return w},w2:function(){return k}});var r=t(32723),a=t(34795),o=t(82434),s=t.n(o),i=t(76811),c=t(65873),l=t(2842),u=t(60344);function p(e){var n=e.replace(/\/api\/space\/.+/,""),t=e.replace(/\/$/,"").split("/"),r=t.at(-4),a=t.at(-2);return(0,l.xn)(n,"space",r,"apps",a,"explorer?key=/apps/".concat(a,"/.did-objects/").concat(a,"/"))}function d(e){var n=e.replace(/\/api\/space\/.+/,""),t=e.replace(/\/$/,"").split("/").at(-4);return(0,l.xn)(n,"space",t)}function f(e){return e.replace(/\/$/,"").split("/").at(-4)}function h(e){return m.apply(this,arguments)}function m(){return(m=(0,a.Z)((0,r.Z)().mark((function e(n){var t,a;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,s()(n)){e.next=3;break}return e.abrupt("return",!1);case 3:return e.next=5,u.hi.head(n,{timeout:5e3});case 5:return t=e.sent,a=t.headers,e.abrupt("return","true"===a["x-listable"]&&"true"===a["x-readable"]&&"true"===a["x-writeable"]);case 10:return e.prev=10,e.t0=e.catch(0),console.error(e.t0),e.abrupt("return",!1);case 14:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)}function x(e){var n;return(null===e||void 0===e||null===(n=e.find((function(e){return e.key===i.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT})))||void 0===n?void 0:n.value)||""}function v(e){var n=new URL(e);return(0,l.xn)(n.origin,n.pathname)}function k(e){return g.apply(this,arguments)}function g(){return(g=(0,a.Z)((0,r.Z)().mark((function e(n){var t,a,o,i,p;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,s()(n)){e.next=3;break}return e.abrupt("return",!1);case 3:return t=v(n),a=(0,l.xn)(t,"space/api/did/one-click-authorization/token"),e.next=7,u.hi.get(a,{timeout:5e3});case 7:return o=e.sent,i=o.status,p=o.data,e.abrupt("return",200===i&&(0,c.isObject)(p));case 13:return e.prev=13,e.t0=e.catch(0),console.error(e.t0),e.abrupt("return",!1);case 17:case"end":return e.stop()}}),e,null,[[0,13]])})))).apply(this,arguments)}function w(e){return b.apply(this,arguments)}function b(){return(b=(0,a.Z)((0,r.Z)().mark((function e(n){var t,a,o;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,s()(n)){e.next=3;break}return e.abrupt("return","");case 3:return e.next=5,u.hi.head(n,{timeout:3e3});case 5:return t=e.sent,a=t.headers,o=a["x-space-name"],e.abrupt("return",o?decodeURIComponent(o):"");case 11:return e.prev=11,e.t0=e.catch(0),console.error(e.t0),e.abrupt("return","");case 15:case"end":return e.stop()}}),e,null,[[0,11]])})))).apply(this,arguments)}function Z(e){var n=e.replace(/\/api\/space\/.+/,""),t=e.replace(/\/$/,"").split("/").at(-4);return(0,l.xn)(n,"/api/space/nft/display?spaceDid=".concat(t))}},47595:function(e,n,t){"use strict";var r=t(71600);Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var a=r(t(56930)),o=t(96266),s=(0,a.default)((0,o.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM8 9h8v10H8V9zm7.5-5-1-1h-5l-1 1H5v2h14V4z"}),"DeleteOutline");n.default=s},94552:function(e,n,t){"use strict";var r=t(71600);n.Z=void 0;var a=r(t(56930)),o=t(96266),s=(0,a.default)((0,o.jsx)("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"}),"Launch");n.Z=s},83294:function(e,n,t){"use strict";var r=t(71600);n.Z=void 0;var a=r(t(56930)),o=t(96266),s=(0,a.default)((0,o.jsx)("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreVert");n.Z=s},53616:function(e,n,t){var r=t(26849);e.exports=function(e){return r(e).toLowerCase()}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[373],{44784:function(e,n,t){var s,a=t(71171),i=t(33028),r=t(59740),o=t(33518),c=t(82790),l=t(96266),p=["labelProps","className","style"];function d(e){var n=e.labelProps,t=e.className,s=e.style,a=(0,r.Z)(e,p),o=(0,i.Z)((0,i.Z)({},n),{},{labelPlacement:(null===n||void 0===n?void 0:n.labelPlacement)||"start"});return(0,l.jsx)(h,{className:t,style:s,children:(0,l.jsx)(c.Z,(0,i.Z)({labelProps:o},a))})}d.propTypes=c.Z.propTypes,d.defaultProps=c.Z.defaultProps;var h=o.Z.div(s||(s=(0,a.Z)(["\n max-width: 300px;\n > label {\n display: flex;\n justify-content: space-between;\n width: 100%;\n margin-left: 0;\n margin-right: 0;\n }\n "," {\n max-width: 100%;\n }\n"])),(function(e){return e.theme.breakpoints.down("sm")}));n.Z=d},90373:function(e,n,t){t.r(n),t.d(n,{default:function(){return Ke}});var s=t(5057),a=t(33028),i=t(39948),r=t(11750),o=t(68420),c=t(29054),l=t(32723),p=t(34795),d=t(96234),h=t(33665),u=t(44846),f=t(55372),x=t(47020),m=t(28726),g=t(55152),v=t(6352),A=t.n(v),y=t(86229),j=t(17682),Z=t(13128),C=t(88574),k=t(35432),B=t(60344),I=t(14491),S=t(58238),b=t(38242);var w=function(e){var n,t,s,a=e.blocklet,i=a.appDid,r=(0,b.getAppName)(a),o=(0,b.getAppDescription)(a),c=null===a||void 0===a||null===(n=a.site)||void 0===n||null===(t=n.domainAliases)||void 0===t||null===(s=t.sort((function(e,n){return e.accessibility.accessible&&n.accessibility.accessible?+e.isProtected-+n.isProtected:+n.accessibility.accessible-+e.accessibility.accessible})))||void 0===s?void 0:s.map((function(e){var n,t=null!==e&&void 0!==e&&null!==(n=e.domainStatus)&&void 0!==n&&n.isHttps?"https://":"http://",s=null===e||void 0===e?void 0:e.value;return"".concat(t).concat(s)})).filter(Boolean),l=null===c||void 0===c?void 0:c[0];return{appDid:i,appName:r,appDescription:o,appUrl:l,scopes:"list:object read:object write:object",referrer:window.location.href,isReady:Boolean(l)}},U=t(84584),R=t(49946),E=t(96266);function D(e){var n=Object.assign({},((0,h.Z)(e),e)),t=(0,c.y0)().blocklet,v=(0,S.h6)().info,b=(0,o.PE)(),D=b.t,F=b.locale,O=(0,s.useState)(""),T=(0,d.Z)(O,2),M=T[0],z=T[1],J=(0,s.useState)(!1),L=(0,d.Z)(J,2),Q=L[0],N=L[1],G=(0,s.useState)(!1),P=(0,d.Z)(G,2),V=P[0],H=P[1],X=(0,s.useState)(""),K=(0,d.Z)(X,2),Y=K[0],W=K[1],q=w({blocklet:t}),_=(0,I.yP)(v),$=(0,R.XN)(),ee=$.spaceGateways,ne=$.addSpaceGateway,te=(0,s.useState)({open:!1,action:"one-click-authorization",checkTimeout:3e5,prefix:A()(k.PROD_DID_SPACES.CORE_URL,"space/api/did"),baseUrl:new URL(k.PROD_DID_SPACES.CORE_URL).origin,checkFn:B.od.create({baseURL:A()(k.PROD_DID_SPACES.CORE_URL,"space")}).get,messages:{title:D("storage.spaces.provideNFT.title",{appName:q.appName},F),scan:D("storage.spaces.provideNFT.scan",{appName:q.appName},F),confirm:"",success:(0,E.jsx)(r.Z,{gutterBottom:!0,children:D("storage.spaces.provideNFT.success")})},onClose:function(){ie((function(e){return(0,a.Z)((0,a.Z)({},e),{},{open:!1})}))}}),se=(0,d.Z)(te,2),ae=se[0],ie=se[1],re=(0,s.useState)({open:!1,action:"one-click-authorization",checkTimeout:3e5,messages:{title:D("storage.spaces.authorize.title",{appName:q.appName},F),scan:D("storage.spaces.authorize.scan",{appName:q.appName},F),confirm:"",success:(0,E.jsx)(r.Z,{gutterBottom:!0,children:D("storage.spaces.authorize.success")})},onClose:function(){le((function(e){return(0,a.Z)((0,a.Z)({},e),{},{open:!1})}))}}),oe=(0,d.Z)(re,2),ce=oe[0],le=oe[1],pe=function(){var e=(0,p.Z)((0,l.Z)().mark((function e(n,t){var s,i;return(0,l.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,s=t(n.endpoint),i=n.space?t(n.space):{},e.next=5,de((0,a.Z)((0,a.Z)({endpoint:s},{did:(0,U.LQ)(s),name:"DID Space"}),i));case 5:le((function(e){return(0,a.Z)((0,a.Z)({},e),{},{open:!1})})),z(null),ie((function(e){return(0,a.Z)((0,a.Z)({},e),{},{open:!1})})),e.next=14;break;case 10:e.prev=10,e.t0=e.catch(0),console.error(e.t0),y.Z.error((0,I.Z)(e.t0));case 14:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(n,t){return e.apply(this,arguments)}}(),de=function(){var e=(0,p.Z)((0,l.Z)().mark((function e(n){var t,s,a,i,r,o,c,p;return(0,l.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=n.endpoint,r=n.name,o=n.did,(c=null===i||void 0===i||null===(t=i.replace(/\/api\/.+/,""))||void 0===t||null===(s=t.trim())||void 0===s?void 0:s.replace(/\/$/,"")).startsWith("http")||(c="https://".concat(c)),e.next=5,(0,U.w2)(c);case 5:if(e.sent){e.next=8;break}return y.Z.error(D("storage.spaces.gateway.add.invalidUrl")),e.abrupt("return");case 8:if(!ee.some((function(e){return e.endpoint===i}))){e.next=12;break}return y.Z.error(D("storage.spaces.gateway.add.duplicate",{name:r})),e.abrupt("return");case 12:return p={name:r,did:o,url:c,endpoint:i},e.next=15,ne(p,i);case 15:y.Z.success(D("storage.spaces.connectedWithName",{name:null!==(a=null===p||void 0===p?void 0:p.name)&&void 0!==a?a:"DID Spaces"}));case 16:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),he=function(){var e=(0,p.Z)((0,l.Z)().mark((function e(){var n,t,s,i;return(0,l.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,N(!0),n=M.startsWith("http")?M:"https://".concat(M),t=(0,U.ag)(n),s=new URL(n).searchParams.get("spaceDid"),e.next=7,(0,U.w2)(t);case 7:if(e.sent){e.next=9;break}throw new Error(D("storage.spaces.gateway.add.invalidUrl"));case 9:le((function(e){return(0,a.Z)((0,a.Z)({},e),{},{open:!0,prefix:A()(t,"space/api/did"),baseUrl:new URL(t).origin,checkFn:B.od.create({baseURL:A()(t,"space")}).get,extraParams:{appDid:q.appDid,appName:q.appName,appDescription:q.appDescription,scopes:q.scopes,appUrl:q.appUrl,referrer:q.referrer,nodeDid:v.did,spaceDid:s}})})),H(!1),e.next=17;break;case 13:e.prev=13,e.t0=e.catch(0),i="".concat(D("storage.spaces.gateway.add.failed",F),": ").concat((0,I.Z)(e.t0)),W(i);case 17:return e.prev=17,N(!1),e.finish(17);case 20:case"end":return e.stop()}}),e,null,[[0,13,17,20]])})));return function(){return e.apply(this,arguments)}}();return(0,E.jsxs)(i.Z,{children:[(0,E.jsx)(j.Z,{color:"primary",style:{textTransform:"none !important",fontSize:"1rem"},size:"small",onClick:function(){ie((function(e){return(0,a.Z)((0,a.Z)({},e),{},{open:!0,extraParams:{appDid:q.appDid,appName:q.appName,appDescription:q.appDescription,scopes:q.scopes,appUrl:q.appUrl,referrer:q.referrer,nodeDid:v.did}})}))},menu:[(0,E.jsx)(j.Z.Item,(0,a.Z)((0,a.Z)({sx:{textTransform:"none"},onClick:function(){return H(!0)},size:"small"},n),{},{children:D("storage.spaces.connect.useSpaceGateway")}),"1")],children:(0,E.jsx)(r.Z,{sx:{fontWeight:"bold",textTransform:"none"},children:D("storage.spaces.connect.useWallet")})}),(0,E.jsx)(g.default,{forceConnected:!1,saveConnect:!1,prefix:ae.prefix,open:ae.open,popup:!0,action:ae.action,webWalletUrl:_,baseUrl:ae.baseUrl,checkFn:ae.checkFn,onSuccess:pe,onClose:ae.onClose,checkTimeout:ae.checkTimeout,extraParams:ae.extraParams,messages:ae.messages,locale:F}),(0,E.jsx)(g.default,{forceConnected:!1,saveConnect:!1,prefix:ce.prefix,open:ce.open,popup:!0,action:ce.action,baseUrl:ce.baseUrl,checkFn:ce.checkFn,onSuccess:pe,onClose:ce.onClose,checkTimeout:ce.checkTimeout,extraParams:ce.extraParams,messages:ce.messages,locale:F}),(0,E.jsxs)(Z.ZP,{title:D("storage.spaces.gateway.add.title"),fullWidth:!0,maxWidth:"md",open:V,onClose:function(){return H(!1)},PaperProps:{style:{minHeight:"auto"}},actions:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(m.Z,{onClick:function(e){e.stopPropagation(),H(!1)},color:"inherit",children:D("common.cancel")}),(0,E.jsxs)(m.Z,{onClick:he,color:"primary",disabled:Q||!M,variant:"contained",autoFocus:!0,children:[Q&&(0,E.jsx)(u.Z,{size:16}),D("common.confirm")]})]}),children:[(0,E.jsx)("div",{style:{paddingTop:12,overflowY:"hidden"},children:(0,E.jsx)(f.Z,{component:"div",children:(0,E.jsx)(r.Z,{component:"div",children:(0,E.jsx)(x.Z,{label:D("storage.spaces.gateway.add.label"),autoComplete:"off",variant:"outlined",name:"url",fullWidth:!0,value:M,onChange:function(e){W(null),z(e.target.value)},disabled:Q,onKeyPress:function(){var e=(0,p.Z)((0,l.Z)().mark((function e(n){return(0,l.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("Enter"!==n.key){e.next=3;break}return e.next=3,he();case 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),autoFocus:!0})})})}),Boolean(Y)&&(0,E.jsx)(C.Z,{type:"error",style:{width:"100%"},children:Y})]})]})}D.propTypes={},D.defaultProps={};var F,O=D,T=t(71171),M=t(59740),z=t(33518),J=t(55898),L=t.n(J),Q=t(90049),N=t.n(Q),G=t(38898),P=t(64886),V=["blocklet"];function H(e){var n=e.blocklet,t=(0,M.Z)(e,V),i=(0,s.useContext)(o.RD).t;if(!n.diskInfo)return(0,E.jsx)(r.Z,{children:i("blocklet.diskInfo.empty")});var c=function(e,n,t){return(0,E.jsxs)(r.Z,{children:[t?(0,E.jsx)(G.Z,{style:{cursor:"pointer"},onClick:t,underline:"hover",children:e}):e," ",(0,E.jsx)("strong",{children:n?N()(n):"empty"})]})},l=n.environments.reduce((function(e,n){return e[n.key]=n.value,e}),{}),p=[{key:"appDir",name:i("blocklet.diskInfo.appDir"),value:c(l.BLOCKLET_APP_DIR,n.diskInfo.app)},{key:"dataDir",name:i("blocklet.diskInfo.dataDir"),value:c(l.BLOCKLET_DATA_DIR,n.diskInfo.data)},{key:"logDir",name:i("blocklet.diskInfo.logDir"),value:c(l.BLOCKLET_LOG_DIR,n.diskInfo.log)},{key:"cacheDir",name:i("blocklet.diskInfo.cacheDir"),value:c(l.BLOCKLET_CACHE_DIR,n.diskInfo.cache)}];return(0,E.jsx)(X,(0,a.Z)((0,a.Z)({component:"div"},t),{},{children:p.map((function(e){return(0,E.jsx)(P.Z,{valueComponent:"div",nameWidth:120,name:e.name,children:e.value},e.key)}))}))}H.propTypes={blocklet:L().object.isRequired},H.defaultProps={};var X=(0,z.Z)(r.Z)(F||(F=(0,T.Z)([""]))),K=function(e){return(0,E.jsxs)("svg",(0,a.Z)((0,a.Z)({},e),{},{children:[(0,E.jsxs)("g",{filter:"url(#a)",children:[(0,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"}),(0,E.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M49.192 6.222l-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"}),(0,E.jsx)("mask",{id:"b",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"4",y:"2",width:"220",height:"250",children:(0,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"})}),(0,E.jsxs)("g",{mask:"url(#b)",children:[(0,E.jsx)("path",{opacity:".5",fill:"url(#c)",d:"M4 2h220v128H4z"}),(0,E.jsx)("path",{opacity:".1",fill:"url(#d)",d:"M4 130h220v122H4z"}),(0,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"}),(0,E.jsx)("path",{d:"M117.604 47.263L121.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)"}),(0,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)"}),(0,E.jsxs)("g",{clipPath:"url(#g)",fillRule:"evenodd",clipRule:"evenodd",fill:"#fff",children:[(0,E.jsx)("path",{d:"M50.928 216.089l1.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"}),(0,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"})]}),(0,E.jsx)("circle",{cx:"191.32",cy:"218",r:"10",fill:"url(#h)"}),(0,E.jsx)("path",{d:"M192.064 213.333l.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"}),(0,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"})]})]}),(0,E.jsxs)("defs",{children:[(0,E.jsxs)("filter",{id:"a",x:"0",y:"0",width:"228",height:"258",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[(0,E.jsx)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),(0,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"}),(0,E.jsx)("feOffset",{dy:"2"}),(0,E.jsx)("feGaussianBlur",{stdDeviation:"2"}),(0,E.jsx)("feComposite",{in2:"hardAlpha",operator:"out"}),(0,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"}),(0,E.jsx)("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_1410_22507"}),(0,E.jsx)("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_1410_22507",result:"shape"})]}),(0,E.jsx)("pattern",{id:"c",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:(0,E.jsx)("use",{xlinkHref:"#i",transform:"scale(.00455 .00781)"})}),(0,E.jsxs)("linearGradient",{id:"d",x1:"114",y1:"130",x2:"114",y2:"252",gradientUnits:"userSpaceOnUse",children:[(0,E.jsx)("stop",{stopColor:"#101010"}),(0,E.jsx)("stop",{offset:"1",stopColor:"#272727"})]}),(0,E.jsxs)("linearGradient",{id:"e",x1:"120.989",y1:"45",x2:"120.989",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[(0,E.jsx)("stop",{stopColor:"#fff",stopOpacity:".4"}),(0,E.jsx)("stop",{offset:"1",stopColor:"#fff"})]}),(0,E.jsxs)("linearGradient",{id:"f",x1:"107.801",y1:"45",x2:"107.801",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[(0,E.jsx)("stop",{stopColor:"#fff"}),(0,E.jsx)("stop",{offset:"1",stopColor:"#fff",stopOpacity:".4"})]}),(0,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:[(0,E.jsx)("stop",{stopColor:"#016BED"}),(0,E.jsx)("stop",{offset:".699",stopColor:"#4498FB"}),(0,E.jsx)("stop",{offset:"1",stopColor:"#9DFFE8"})]}),(0,E.jsx)("clipPath",{id:"g",children:(0,E.jsx)("path",{fill:"#fff",transform:"translate(28 214)",d:"M0 0h40.32v8H0z"})}),(0,E.jsx)("image",{id:"i",width:"220",height:"128",xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANwAAACABAMAAACSOBo+AAAAG1BMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACUUeIgAAAACXRSTlMSFhkOHAsfCCOMH5MiAAAjjElEQVRo3hTQO3sjRRBG4a+qWzJhVfdIJqzuGXsJe2bkJe0e2UA4shdIJS2X1LBcUpbL/wae5yQnfVHGjp2+V08yKR7OwBDYte8pi5Aq9DObSBouqN9cidZyusonzWtGJO13phLebEn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pX6xQEXVAnJxlr8Aw6/qb0wu9SNolstScB0izxmMC5DiytBJd9Rcm3RGf42aiddmUTM4d4dgdjiT+vMPX0/RzfZdLoZ4aQqPzhx9plNI3QyvsMZHn2j2wOECoTtkfJt89O+eYUnXB/gFxHxPmOeL9ogAAAABJRU5ErkJggg=="})]})]}))};function Y(){var e=(0,o.PE)().t,n=(0,c.y0)().blocklet;return(0,E.jsxs)(i.Z,{children:[(0,E.jsxs)(i.Z,{minHeight:"40vh",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",children:[(0,E.jsx)(K,{style:{width:200,height:250}}),(0,E.jsx)(r.Z,{marginTop:"24px",marginBottom:"24px",children:e("storage.spaces.connect.provider")}),(0,E.jsx)(O,{})]}),(0,E.jsx)(r.Z,{fontSize:"1.2rem",fontWeight:"bold",mb:2,children:e("common.dataStorage")}),(0,E.jsx)(H,{blocklet:n})]})}K.defaultProps={width:"228",height:"258",viewBox:"0 0 228 258",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},Y.propTypes={};var W=Y,q=t(72904),_=t(19654),$=t(99154),ee=t(76811),ne=t(79366),te=t(65873),se=t(42876),ae=t(17450),ie=t(44784),re=t(67680),oe=t(61533),ce=t(74490),le=t(46954),pe=t(44067),de=t(83294),he=t(45396),ue=t(14482),fe=t(85733),xe=t(47595),me=t(60939);function ge(e){var n=e.spaceGateway,t=e.onDelete,a=(0,o.PE)().t,i=(0,s.useState)(!1),r=(0,d.Z)(i,2),c=r[0],h=r[1],u=(0,s.useState)(!1),f=(0,d.Z)(u,2),x=f[0],m=f[1],g=function(e,n){null===e||void 0===e||e.preventDefault(),null===e||void 0===e||e.stopPropagation(),h(n)},v=function(){var e=(0,p.Z)((0,l.Z)().mark((function e(s){return(0,l.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,null===s||void 0===s||s.stopPropagation(),m(!0),e.next=5,t(n);case 5:h(!1),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(0),console.error(e.t0),y.Z.error("".concat(a("storage.space.gateway.delete.failed"),": ").concat((0,I.Z)(e.t0)));case 12:return e.prev=12,m(!1),e.finish(12);case 15:case"end":return e.stop()}}),e,null,[[0,8,12,15]])})));return function(n){return e.apply(this,arguments)}}();return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(ce.Z,{color:"red",onClick:function(e){return g(e,!0)},children:[(0,E.jsx)(le.Z,{style:{minWidth:24,color:"red"},children:(0,E.jsx)(xe.default,{fontSize:"small"})}),(0,E.jsx)(pe.Z,{style:{color:"red"},children:a("common.delete")})]}),(0,E.jsx)(me.Z,{title:a("common.delConfirmDescription",{data:"".concat(null===n||void 0===n?void 0:n.name)}),open:c,confirmButton:{text:a("common.confirm"),props:{variant:"contained",color:"error",loading:x}},cancelButton:{text:a("common.cancel"),props:{variant:"contained",color:"primary"},loading:x},onConfirm:v,onCancel:function(e){return g(e,!1)}})]})}ge.propTypes={onDelete:L().func,spaceGateway:L().shape({name:L().string.isRequired,url:L().string.isRequired,protected:L().bool}).isRequired},ge.defaultProps={onDelete:function(){}};var ve=ge,Ae=["spaceGateway","connected","onDelete","onConnect","enableSwitchToSpace"];function ye(e){var n=e.spaceGateway,t=e.connected,i=e.onDelete,r=e.onConnect,c=e.enableSwitchToSpace,h=(0,M.Z)(e,Ae),f=(0,s.useState)(null),x=(0,d.Z)(f,2),m=x[0],g=x[1],v=(0,o.PE)().t,A=(0,s.useState)(!1),j=(0,d.Z)(A,2),Z=j[0],C=j[1],k=function(e,n){e.stopPropagation(),e.preventDefault(),g(n&&e.currentTarget)},B=function(){var e=(0,p.Z)((0,l.Z)().mark((function e(t){return(0,l.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,C(!0),k(t,!1),e.next=5,r(n);case 5:e.next=11;break;case 7:e.prev=7,e.t0=e.catch(0),console.error(e.t0),y.Z.error(e.t0.message);case 11:return e.prev=11,C(!1),e.finish(11);case 14:case"end":return e.stop()}}),e,null,[[0,7,11,14]])})));return function(n){return e.apply(this,arguments)}}();return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(re.Z,(0,a.Z)((0,a.Z)({"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions",onClick:function(e){return k(e,!0)},size:"small"},h),{},{children:Z||null!==n&&void 0!==n&&n.loading?(0,E.jsx)(u.Z,{size:"24px"}):(0,E.jsx)(de.Z,{})})),(0,E.jsxs)(oe.Z,{id:"simple-menu",anchorEl:m,keepMounted:!0,open:Boolean(m),onClose:function(e){return k(e,!1)},children:[(0,E.jsxs)(ce.Z,{onClick:function(e){k(e,!1),window.open(n.endpoint?(0,U.nD)(n.endpoint):n.url)},children:[(0,E.jsx)(le.Z,{style:{minWidth:24},children:(0,E.jsx)(he.Z,{fontSize:"small"})}),(0,E.jsx)(pe.Z,{children:v("common.open")})]}),(0,E.jsxs)(ce.Z,{onClick:function(e){k(e,!1),window.open((0,U.Xv)(n.endpoint))},children:[(0,E.jsx)(le.Z,{style:{minWidth:24},children:(0,E.jsx)(fe.Z,{fontSize:"small"})}),(0,E.jsx)(pe.Z,{children:v("storage.spaces.strategy.viewBackupFiles")})]}),!t&&c&&(0,E.jsxs)(ce.Z,{onClick:B,children:[(0,E.jsx)(le.Z,{style:{minWidth:24},children:(0,E.jsx)(ue.Z,{fontSize:"small"})}),(0,E.jsx)(pe.Z,{children:v("storage.spaces.connect.switchToSpace")})]}),!t&&(0,E.jsx)(ve,{spaceGateway:n,onDelete:i})]})]})}ye.propTypes={spaceGateway:L().shape({name:L().string.isRequired,url:L().string.isRequired,protected:L().bool,endpoint:L().string.isRequired,loading:L().bool}).isRequired,connected:L().bool.isRequired,enableSwitchToSpace:L().bool,onDelete:L().func,onConnect:L().func},ye.defaultProps={onDelete:function(){},onConnect:function(){},enableSwitchToSpace:!0};var je=ye,Ze=t(54063),Ce=t(22256),ke=t(37541),Be=t(7278),Ie=t(29042),Se=function(e){return(0,E.jsxs)("svg",(0,a.Z)((0,a.Z)({},e),{},{children:[(0,E.jsxs)("g",{filter:"url(#a)",children:[(0,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"}),(0,E.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M49.192 6.222l-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"}),(0,E.jsx)("mask",{id:"b",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"4",y:"2",width:"220",height:"250",children:(0,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"})}),(0,E.jsxs)("g",{mask:"url(#b)",children:[(0,E.jsx)("path",{opacity:".5",fill:"url(#c)",d:"M4 2h220v128H4z"}),(0,E.jsx)("path",{opacity:".1",fill:"url(#d)",d:"M4 130h220v122H4z"}),(0,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"}),(0,E.jsx)("path",{d:"M117.604 47.263L121.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)"}),(0,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)"}),(0,E.jsxs)("g",{clipPath:"url(#g)",fillRule:"evenodd",clipRule:"evenodd",fill:"#fff",children:[(0,E.jsx)("path",{d:"M50.928 216.089l1.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"}),(0,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"})]}),(0,E.jsx)("circle",{cx:"191.32",cy:"218",r:"10",fill:"url(#h)"}),(0,E.jsx)("path",{d:"M192.064 213.333l.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"}),(0,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"})]})]}),(0,E.jsxs)("defs",{children:[(0,E.jsxs)("filter",{id:"a",x:"0",y:"0",width:"228",height:"258",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[(0,E.jsx)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),(0,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"}),(0,E.jsx)("feOffset",{dy:"2"}),(0,E.jsx)("feGaussianBlur",{stdDeviation:"2"}),(0,E.jsx)("feComposite",{in2:"hardAlpha",operator:"out"}),(0,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"}),(0,E.jsx)("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_1410_22507"}),(0,E.jsx)("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_1410_22507",result:"shape"})]}),(0,E.jsx)("pattern",{id:"c",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:(0,E.jsx)("use",{xlinkHref:"#i",transform:"scale(.00455 .00781)"})}),(0,E.jsxs)("linearGradient",{id:"d",x1:"114",y1:"130",x2:"114",y2:"252",gradientUnits:"userSpaceOnUse",children:[(0,E.jsx)("stop",{stopColor:"#101010"}),(0,E.jsx)("stop",{offset:"1",stopColor:"#272727"})]}),(0,E.jsxs)("linearGradient",{id:"e",x1:"120.989",y1:"45",x2:"120.989",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[(0,E.jsx)("stop",{stopColor:"#fff",stopOpacity:".4"}),(0,E.jsx)("stop",{offset:"1",stopColor:"#fff"})]}),(0,E.jsxs)("linearGradient",{id:"f",x1:"107.801",y1:"45",x2:"107.801",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[(0,E.jsx)("stop",{stopColor:"#fff"}),(0,E.jsx)("stop",{offset:"1",stopColor:"#fff",stopOpacity:".4"})]}),(0,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:[(0,E.jsx)("stop",{stopColor:"#016BED"}),(0,E.jsx)("stop",{offset:".699",stopColor:"#4498FB"}),(0,E.jsx)("stop",{offset:"1",stopColor:"#9DFFE8"})]}),(0,E.jsx)("clipPath",{id:"g",children:(0,E.jsx)("path",{fill:"#fff",transform:"translate(28 214)",d:"M0 0h40.32v8H0z"})}),(0,E.jsx)("image",{id:"i",width:"220",height:"128",xlinkH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ATkHsNwloUilnNMFce7twgDgrgWhsE8jWW+EBLlTDMn9pmtJOefTJc6Cxld039TN4XiwL4pMtU+8tXJ4g/LghG5APdF7/e3FSi4v8vnEBiIEm+5LlZtsk2LbbbY5hN9JkkJkd5BjQFPoUcwjJdTm0mx0024NmOvVgxASvU9TonFxUqG8cUTy3m5s3i7BqLbFkKcfxLQYhAXfjam0yFFd3PZE9wlXWfHYKlg2cFlTcnwRH6z8DpSfQHidMhElmCMb07li9ceHQHFknk/98f4KJRLpX6xQEXVAnJxlr8Aw6/qb0wu9SNolstScB0izxmMC5DiytBJd9Rcm3RGf42aiddmUTM4d4dgdjiT+vMPX0/RzfZdLoZ4aQqPzhx9plNI3QyvsMZHn2j2wOECoTtkfJt89O+eYUnXB/gFxHxPmOeL9ogAAAABJRU5ErkJggg=="})]})]}))};function be(e){var n=e.src,t=e.alt,a=(0,s.useState)(!1),i=(0,d.Z)(a,2),r=i[0],o=i[1],c=(0,s.useState)(!1),l=(0,d.Z)(c,2),p=l[0],h=l[1],u=function(){return h(!0)},f=function(){return h(!1)};return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(Ce.Z,{ready:r,customPlaceholder:(0,E.jsx)("img",{style:{cursor:"pointer"},alt:t,src:n,width:"58px",height:"58px",onError:function(){return o(!0)},onClick:u}),children:(0,E.jsx)(Se,{style:{cursor:"pointer",width:"58px",height:"58px"},onClick:u})}),(0,E.jsx)(ke.Z,{open:p,onClose:f,"aria-labelledby":"preview-space-nft-display","aria-describedby":"preview space nft display",fullWidth:!0,maxWidth:"md",children:(0,E.jsxs)(Be.Z,{style:{padding:"8px 8px",backgroundColor:"rgba(0,0,0,0.8)"},children:[(0,E.jsx)(re.Z,{color:"inherit",onClick:f,"aria-label":"close",style:{position:"absolute",top:8,right:8,color:"white"},children:(0,E.jsx)(Ie.Z,{})}),r?(0,E.jsx)(Se,{style:{width:"100%",height:"75vh"}}):(0,E.jsx)("img",{src:n,alt:"",style:{width:"100%",height:"75vh",objectFit:"contain"}})]})})]})}Se.defaultProps={width:"228",height:"258",viewBox:"0 0 228 258",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},be.propTypes={src:J.string.isRequired,alt:J.string.isRequired};var we,Ue=be,Re=["spaceGateway","connected","onDelete","onBackupNow"],Ee=function(e){return(0,E.jsx)("svg",(0,a.Z)((0,a.Z)({},e),{},{children:(0,E.jsx)("circle",{cx:"4",cy:"4",r:"4",fill:"#25C99B"})}))};Ee.defaultProps={width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};var De=function(e){return(0,E.jsx)("svg",(0,a.Z)((0,a.Z)({},e),{},{children:(0,E.jsx)("circle",{cx:"4",cy:"4",r:"4",fill:"#F16E6E"})}))};function Fe(e){var n=e.spaceGateway,t=e.connected,h=e.onDelete,u=e.onBackupNow,f=(0,M.Z)(e,Re),x=(0,q.Z)((function(e){return e.breakpoints.down("md")})),v=(0,o.PE)(),j=v.t,Z=v.locale,C=(0,c.y0)().blocklet,k=(0,S.h6)(),I=k.api,b=k.info.did,D=w({blocklet:C}),F=D.appDid,O=D.appName,T=D.appDescription,z=D.scopes,J=D.appUrl,L=D.referrer,Q=(0,R.XN)(),N=Q.updateSpaceGateway,G=Q.backupEndpoint,P=Q.backupProgress,V=Q.refreshBackupEndpoint,H=(0,s.useState)(!1),X=(0,d.Z)(H,2),K=X[0],Y=X[1],W=(0,s.useState)({open:!1,action:"one-click-authorization",checkTimeout:3e5,messages:{title:j("storage.spaces.authorize.title",{appName:O},Z),scan:j("storage.spaces.authorize.scan",{appName:O},Z),confirm:"",success:(0,E.jsx)(r.Z,{gutterBottom:!0,children:j("storage.spaces.authorize.success")})},onClose:function(){ce((function(e){return(0,a.Z)((0,a.Z)({},e),{},{open:!1})}))}}),re=(0,d.Z)(W,2),oe=re[0],ce=re[1],le=(0,ne.Z)((0,p.Z)((0,l.Z)().mark((function e(){return(0,l.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return",!0);case 2:return e.abrupt("return",(0,U.Nb)(G));case 3:case"end":return e.stop()}}),e)}))),{refreshDeps:[t,G,null===oe||void 0===oe?void 0:oe.open,K]}),pe=le.data,de=le.loading,he=t&&pe,ue=t&&!K&&pe&&!(null!==n&&void 0!==n&&n.loading),fe=t&&K&&pe,xe=t&&!pe&&!de&&!K,me=function(){var e=(0,p.Z)((0,l.Z)().mark((function e(){return(0,l.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,U.Nb)(null===n||void 0===n?void 0:n.endpoint);case 2:if(!e.sent){e.next=9;break}return e.next=6,I.configBlocklet({input:{did:[C.meta.did],configs:[{key:ee.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:n.endpoint}]}});case 6:return V(),y.Z.success(j("storage.spaces.connect.switchToSpaceSucceeded",{name:n.name?"(".concat(n.name,")"):""})),e.abrupt("return");case 9:ce((function(e){return(0,a.Z)((0,a.Z)({},e),{},{open:!0,prefix:A()(n.url,"space/api/did"),baseUrl:new URL(n.url).origin,checkFn:B.od.create({baseURL:A()(n.url,"space")}).get,extraParams:{appDid:F,appName:O,appDescription:T,scopes:z,appUrl:J,referrer:L,nodeDid:b,spaceDid:n.did}})}));case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ge=function(){var e=(0,p.Z)((0,l.Z)().mark((function e(t,s){var i,r,o,c,p,d;return(0,l.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=s(t.endpoint),c=(0,U.LQ)(o),p=t.space?s(t.space):{},!n.did||c===n.did){e.next=7;break}return ce((function(e){return(0,a.Z)((0,a.Z)({},e),{},{open:!1})})),y.Z.error(j("storage.spaces.gateway.switch.failedForMismatchSpace",{name:null!==p&&void 0!==p&&p.name?p.name:""})),e.abrupt("return");case 7:return d=(0,a.Z)((0,a.Z)({},n),{},{name:null!==(i=p.name)&&void 0!==i?i:"DID Space",did:null!==(r=p.did)&&void 0!==r?r:(0,U.LQ)(o),endpoint:o}),e.next=10,N(d);case 10:ce((function(e){return(0,a.Z)((0,a.Z)({},e),{},{open:!1})}));case 11:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),ve=function(){var e=(0,p.Z)((0,l.Z)().mark((function e(){return(0,l.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!K){e.next=3;break}return e.abrupt("return");case 3:return Y(!0),e.next=6,u();case 6:e.next=12;break;case 8:e.prev=8,e.t0=e.catch(0),console.error(e.t0),y.Z.error(e.t0.message);case 12:return e.prev=12,Y(!0),e.finish(12);case 15:case"end":return e.stop()}}),e,null,[[0,8,12,15]])})));return function(){return e.apply(this,arguments)}}();return(0,s.useEffect)((function(){null!==P&&void 0!==P&&P.completed?(100===(null===P||void 0===P?void 0:P.progress)?y.Z.success(j("storage.spaces.backupSuccessfully")):-1===(null===P||void 0===P?void 0:P.progress)&&y.Z.error(null===P||void 0===P?void 0:P.message),Y(!1),P.progress=0,P.message=""):P.progress&&Y(!0)}),[P]),(0,E.jsxs)(Oe,{style:{position:"relative"},children:[(0,E.jsxs)(i.Z,(0,a.Z)((0,a.Z)({sx:{backgroundColor:t?"#F0FDFF":"inherit","&:hover":{backgroundColor:t?"#F0FDFF":"#FBFBFB"},borderRadius:"8px"},display:"flex",padding:"12px 20px"},f),{},{children:[(0,E.jsx)(i.Z,{display:"flex",children:(0,E.jsx)(Ue,{alt:n.did,src:(0,U.Jf)(n.endpoint)})}),(0,E.jsxs)(i.Z,{className:"spaces-info",display:"flex",flexGrow:(!x||!fe)&&1,minWidth:"180px",flexDirection:fe?"row":"column",sx:{marginLeft:"20px",padding:"0px 0px"},children:[(0,E.jsxs)(i.Z,{className:"spaces-info",display:"flex",maxWidth:"360px",alignItems:"center",children:[(0,E.jsx)(r.Z,{color:t?"primary":"inherit",fontSize:"1rem",fontWeight:"bold",children:n.name}),he&&(0,E.jsx)(_.Z,{label:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(Ee,{style:{marginRight:"4px"}}),j("storage.spaces.connected.tag")]}),variant:"outlined",size:"small",style:{marginLeft:"20px",fontWeight:"bold"}}),xe&&(0,E.jsx)(_.Z,{label:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(De,{style:{marginRight:"4px"}}),j("storage.spaces.disconnected.tag")]}),variant:"outlined",size:"small",style:{marginLeft:"20px",fontWeight:"bold"}})]}),(0,E.jsx)(i.Z,{className:"spaces-address",display:fe?"none":"flex",color:"#9397A1",marginTop:"8px",children:(0,E.jsx)(r.Z,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},color:"#9397A1",children:n.did&&(0,E.jsx)(ae.Z,{copyable:!1,size:14,compact:!0,responsive:!1,did:n.did})})})]}),(0,E.jsxs)(i.Z,{className:"spaces-backup",display:"flex",alignItems:"center",flex:x&&fe&&1,children:[ue&&(0,E.jsxs)(i.Z,{className:"backup-strategy",display:"flex",alignItems:"center",width:"100%",children:[(0,E.jsx)(m.Z,{variant:"contained",size:"small",onClick:ve,children:j("storage.spaces.strategy.backupNow")}),Ze.C&&(0,E.jsx)(ie.Z,{name:"enable-auto-backup",title:"coming soon",disabled:!0,labelProps:{label:(0,E.jsx)(r.Z,{sx:{marginRight:"8px",fontSize:"16px"},children:(0,E.jsx)("span",{children:j("storage.spaces.strategy.autoBackup")})})},style:{marginLeft:"64px"}})]}),fe&&(0,E.jsxs)(i.Z,{className:"backup-progress",display:"flex",flexDirection:"column",alignItems:"center",minWidth:!x&&"640px",marginLeft:x&&"16px",width:x&&"360px",marginRight:"auto",alignSelf:"flex-end",children:[(0,E.jsx)(r.Z,{color:"primary",children:null===P||void 0===P?void 0:P.message}),(0,E.jsxs)(i.Z,{sx:{display:"flex",alignItems:"center"},width:"100%",children:[(0,E.jsx)(i.Z,{sx:{width:"100%",mr:1},children:(0,E.jsx)($.Z,{color:"primary",variant:"determinate",value:null===P||void 0===P?void 0:P.progress})}),(0,E.jsx)(i.Z,{sx:{maxWidth:"100%"},children:(0,E.jsxs)(r.Z,{variant:"body2",color:"text.secondary",children:[null===P||void 0===P?void 0:P.progress,"%"]})})]})]}),xe&&(0,E.jsx)(i.Z,{className:"backup-strategy",display:"flex",alignItems:"center",width:"100%",children:(0,E.jsx)(m.Z,{color:"error",variant:"contained",size:"small",onClick:me,children:j("storage.spaces.disconnected.reconnectNow")})}),(0,E.jsx)(je,{sx:{marginLeft:"16px",marginRight:"16px",alignItems:"flex-end",justifyItems:"flex-end"},spaceGateway:n,connected:t,onDelete:h,onConnect:me,enableSwitchToSpace:(null===P||void 0===P?void 0:P.completed)||(0,te.isEmpty)(null===P||void 0===P?void 0:P.message)})]})]})),(0,E.jsx)(g.default,{forceConnected:!1,saveConnect:!1,prefix:oe.prefix,open:oe.open,popup:!0,action:oe.action,baseUrl:oe.baseUrl,checkFn:oe.checkFn,onSuccess:ge,onClose:oe.onClose,checkTimeout:oe.checkTimeout,extraParams:oe.extraParams,messages:oe.messages,locale:Z},"get-endpoint"),(0,E.jsx)(i.Z,{className:"selected-container ".concat(t?"selected":""),children:(0,E.jsx)(se.default,{className:"selected-icon"})})]})}De.defaultProps={width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Fe.propTypes={spaceGateway:L().shape({did:L().string.isRequired,name:L().string.isRequired,url:L().string.isRequired,endpoint:L().string.isRequired,protected:L().bool,loading:L().bool}).isRequired,connected:L().bool.isRequired,progress:L().any.isRequired,onDelete:L().func,onBackupNow:L().func},Fe.defaultProps={onDelete:function(){},onBackupNow:function(){}};var Oe=(0,z.Z)(i.Z)(we||(we=(0,T.Z)(["\n .selected-container {\n position: absolute;\n right: 0px;\n bottom: 0px;\n display: flex;\n -webkit-box-pack: end;\n justify-content: flex-end;\n align-items: flex-end;\n width: 32px;\n height: 32px;\n border-radius: 0px 0px 8px;\n color: rgb(255, 255, 255);\n overflow: hidden;\n transition: all 0.4s ease 0s;\n\n &::after {\n position: absolute;\n z-index: 0;\n left: 60px;\n top: 60px;\n display: block;\n width: 0px;\n height: 0px;\n border-width: 16px;\n border-style: solid;\n border-color: transparent #1dc1c7 #1dc1c7 transparent;\n transition: all 0.1s ease 0s;\n content: '';\n }\n\n .selected-icon {\n visibility: hidden;\n width: 60%;\n height: 60%;\n position: relative;\n z-index: 2;\n margin: 0px 1px 1px 0px;\n font-size: 16px;\n transition: all 0.2s ease 0s;\n }\n }\n\n .selected-container.selected {\n &::after {\n left: 0px;\n top: 0px;\n }\n\n .selected-icon {\n visibility: visible;\n }\n }\n"]))),Te=Fe,Me=t(19778),ze=t(75760),Je=t(75239),Le=t(21722),Qe=t(1577),Ne=t.n(Qe),Ge=t(73119);function Pe(e){var n=Object.assign({},((0,h.Z)(e),e)),t=(0,o.PE)(),s=t.t,c=t.locale,l=(0,R.XN)(),p=l.spaceGateways,d=l.backups,f=[{label:"DID Spaces",name:"target",options:{customBodyRenderLite:function(e){var n,t=d[e],s=t.targetUrl,a=t.targetName,i=t.status,o=t.createdAt,c=i===k.BACKUPS.STATUS.PROGRESS&&Ne()().diff(o,"hours")>=k.BACKUPS.TIMEOUT_HOURS,l=i===k.BACKUPS.STATUS.SUCCEEDED&&!c,h=a||(null===(n=p.find((function(e){return null===s||void 0===s?void 0:s.includes((0,U.LQ)(null===e||void 0===e?void 0:e.endpoint))})))||void 0===n?void 0:n.name)||"Unknown DID Space";return l?(0,E.jsx)(G.Z,{fontSize:"16px",href:s,target:"_blank",children:h}):(0,E.jsx)(r.Z,{variant:"body1",fontSize:"16px",children:h})}}},{label:s("common.strategy"),name:"strategy",options:{customBodyRender:function(e){var n=s(0===e?"common.auto":"common.manual");return(0,E.jsx)(Me.Z,{children:n})}}},{label:s("common.startTime"),name:"createdAt",options:{customBodyRender:function(e){return Ne()(e).format("YYYY-MM-DD HH:mm:ss")}}},{label:s("common.endTime"),name:"updatedAt",options:{customBodyRender:function(e){return(0,te.isEmpty)(e)?"":Ne()(e).format("YYYY-MM-DD HH:mm:ss")}}},{label:s("common.status"),name:"status",options:{customBodyRenderLite:function(e){var n,t=null!==(n=null===d||void 0===d?void 0:d[e])&&void 0!==n?n:{},a=t.status,o=t.message,c=t.createdAt,l=a===k.BACKUPS.STATUS.PROGRESS&&Ne()().diff(c,"hours")>=k.BACKUPS.TIMEOUT_HOURS,p=l&&s("common.timeoutError"),h=a===k.BACKUPS.STATUS.PROGRESS&&!l,f=a===k.BACKUPS.STATUS.SUCCEEDED&&!l;return h?(0,E.jsxs)(r.Z,{display:"inline-flex",alignItems:"center",fontSize:"14px",children:[(0,E.jsx)(u.Z,{sx:{marginRight:"4px"},size:"12px"}),s("common.progress")]}):f?(0,E.jsx)(Me.Z,{type:"success",children:s("common.succeeded")}):(0,E.jsxs)(i.Z,{display:"inline-flex",alignItems:"center",children:[(0,E.jsx)(Me.Z,{type:"error",children:s("common.failed")})," \xa0",(0,E.jsx)(Je.Z,{style:{display:"flex",alignItems:"center",flexShrink:0},title:o||p,children:(0,E.jsx)(Le.Z,{children:(0,E.jsx)(Ge.Z,{style:{width:"24px",height:"24px"},color:"error"})})})]})}}}];return(0,E.jsx)(i.Z,(0,a.Z)((0,a.Z)({},n),{},{children:null!==d&&void 0!==d&&d.length?(0,E.jsx)(ze.Z,{title:(0,E.jsx)(r.Z,{fontSize:"1.2rem",fontWeight:"bold",children:s("storage.spaces.backup.records")}),data:d,columns:f,emptyNode:s("storage.spaces.record.emptyData",c),options:{download:!1,filter:!1,print:!1}}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(i.Z,{display:"flex",height:"56px",lineHeight:"56px",alignItems:"center",children:(0,E.jsx)(r.Z,{fontSize:"1.2rem",fontWeight:"bold",children:s("storage.spaces.backup.records")})}),(0,E.jsx)(i.Z,{color:"#9397A1",marginTop:"16px",marginBottom:"24px",children:s("storage.spaces.record.emptyData")})]})}))}Pe.propTypes={};var Ve=Pe;var He=function(){var e=(0,o.PE)().t,n=(0,c.y0)().blocklet,t=(0,S.h6)().api,s=(0,R.XN)(),a=s.spaceGateways,d=s.spaceGatewaysLoading,h=s.deleteSpaceGateway,f=s.spaceGatewayIsSelected,x=d&&!(null!==a&&void 0!==a&&a.length),m=function(){var n=(0,p.Z)((0,l.Z)().mark((function n(t){return(0,l.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,h(t);case 2:y.Z.success(e("storage.spaces.gateway.delete.succeeded",{name:"(".concat(t.name,")")}));case 3:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}(),g=function(){var e=(0,p.Z)((0,l.Z)().mark((function e(){return(0,l.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.backupBlocklet({input:{appDid:n.appDid,to:"spaces"}});case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,E.jsxs)(i.Z,{display:"flex",flexDirection:"column",children:[(0,E.jsxs)(i.Z,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:"12px",children:[(0,E.jsx)(r.Z,{fontSize:"1.2rem",fontWeight:"bold",children:e("storage.spaces.connected.title")}),(0,E.jsx)(O,{})]}),(0,E.jsx)(i.Z,{children:x?(0,E.jsx)(i.Z,{display:"flex",justifyContent:"center",children:(0,E.jsx)(u.Z,{})}):a.map((function(e){return(0,E.jsx)(Te,{style:{marginTop:"12px"},spaceGateway:e,connected:f(e),onDelete:m,onBackupNow:g},e.endpoint)}))}),(0,E.jsx)(Ve,{sx:{marginTop:"24px"}}),(0,E.jsx)(r.Z,{fontSize:"1.2rem",fontWeight:"bold",mb:2,children:e("common.dataStorage")}),(0,E.jsx)(H,{blocklet:n})]})};function Xe(){return(0,R.XN)().backupEndpoint?(0,E.jsx)(He,{}):(0,E.jsx)(W,{})}Xe.propTypes={};var Ke=Xe},54063:function(e,n,t){t.d(n,{C:function(){return s}});var s="true"===localStorage.getItem("enableDebug")}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[6511],{86511:function(e,n,t){t.r(n),t.d(n,{default:function(){return re}});var r=t(71171),a=t(5057),i=t(33518),o=t(85493),c=t(15849),s=t(68420),u=t(11750),l=t(39434),p=t(39948),d=t(83407),f=t(94464),m=t(88574),v=t(28726),h=t(38242),b=t(81010),x=t(87363),g=(t(68534),t(86229)),k=t(1722),y=t(96234),Z=t(35432),w=t(55152),j=t(58238),P=t(29054),S=t(73545),B=t(14491),D=t(4651),L=t(96266),E=function(e){var n={},t=null;return(0,h.forEachBlockletSync)(e,(function(e){n[e.meta.bundleDid]?t=(0,h.getDisplayName)(e,!0):e.meta.bundleDid&&(n[e.meta.bundleDid]=!0)})),t},_=function(e,n,t){var r=e.hostname,a=e.href;if(!n)return a;if(t){var i,o=/\d+[-.]\d+[-.]\d+[-.]\d+/.exec(r);if(!o)return a;var c=o[0],s=(((null===(i=n.site)||void 0===i?void 0:i.domainAliases)||[]).map((function(e){return e.value})).filter(Boolean).find((function(e){return e.endsWith(Z.DEFAULT_DID_DOMAIN)}))||"").replace(".".concat(Z.DEFAULT_DID_DOMAIN),"");return s?a.replace(r,"".concat(s,"-").concat(c,".").concat(Z.DEFAULT_IP_DOMAIN_SUFFIX)):a}return a.replace(n.meta.bundleDid,n.appPid)};function C(){var e=(0,s.PE)().t,n=(0,S.T)().api,t=(0,P.y0)().blocklet,r=(0,j.h6)().inService,i=(0,a.useState)(!1),o=(0,y.Z)(i,2),c=o[0],u=o[1],l=(0,a.useState)(5),d=(0,y.Z)(l,2),f=d[0],b=d[1],x=t&&t.structVersion!==Z.APP_STRUCT_VERSION;return[x&&(0,L.jsxs)(m.Z,{type:"warning",style:{margin:"12px 0"},children:[(0,L.jsxs)(p.Z,{display:"flex",alignItems:"center",children:[(0,L.jsx)(v.Z,{variant:"contained",size:"small",color:"primary",onClick:function(){return function(){try{if("running"===t.status)return void g.Z.error(e("blocklet.migrate.tip.running"));var n=E(t);if(n)return void g.Z.error(e("blocklet.migrate.tip.duplicate",{name:n}));u(!0)}catch(r){g.Z.error((0,B.Z)(r))}}()},style:{marginRight:8},children:e("blocklet.migrate.intro.l1")}),(0,L.jsx)("span",{children:e("blocklet.migrate.intro.l2")})]}),["l3","l4","l5","l6"].map((function(n){return(0,L.jsx)(p.Z,{display:"flex",alignItems:"center",children:e("blocklet.migrate.intro.".concat(n))},n)}))]},"alert"),t&&(0,L.jsx)(w.default,{popup:!0,open:c,saveConnect:!1,forceConnected:!1,action:"migrate-app-to-struct-v2",checkFn:n.get,checkTimeout:3e5,onSuccess:function(){var e=_(window.location,t,r);setTimeout((function(){window.location.href=e}),5e3),b(5),setInterval((function(){b((function(e){return e-1}))}),1e3)},extraParams:{appDid:t.appDid,did:t.meta.did,wt:(0,D.iK)(t,!0),title:(0,h.getDisplayName)(t)},messages:{title:e("blocklet.migrate.title"),scan:e("blocklet.migrate.scan"),confirm:e("blocklet.migrate.confirm"),success:f>=0?e("blocklet.migrate.success",{sec:f}):"Redirecting..."},onClose:function(){return u(!1)}},"connect")]}C.propTypes={};var N,G=t(35966),A=t(49946),I=t(44846),T=t(78123),O=t(75793),U=t(17022),z=t(13671),K=t(74094),R=t(7199),F=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(6457),t.e(6591)]).then(t.bind(t,86591))})),M=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(8537),t.e(105),t.e(2294),t.e(3716),t.e(6547),t.e(5760),t.e(2452),t.e(1368),t.e(5808),t.e(8973)]).then(t.bind(t,5119))})),V=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(105),t.e(6547),t.e(2452),t.e(5953),t.e(2042),t.e(4775)]).then(t.bind(t,14775))})),$=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(442),t.e(9662),t.e(7676),t.e(8986)]).then(t.bind(t,13239))})),X=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(1237),t.e(2305),t.e(5979),t.e(2537)]).then(t.bind(t,75979))})),Y=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(8537),t.e(105),t.e(2294),t.e(3716),t.e(6547),t.e(5760),t.e(2657),t.e(6412),t.e(3216)]).then(t.bind(t,46412))})),W=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(8537),t.e(105),t.e(2294),t.e(3716),t.e(4901),t.e(1685),t.e(5555)]).then(t.bind(t,85555))})),q=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(8537),t.e(105),t.e(2294),t.e(3716),t.e(4901),t.e(442),t.e(9366),t.e(5526),t.e(1237),t.e(7638),t.e(1685),t.e(4407),t.e(5953),t.e(3135),t.e(875),t.e(2264),t.e(7126)]).then(t.bind(t,77126))})),J=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(9327),t.e(8219)]).then(t.bind(t,92379))})),Q=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(8537),t.e(105),t.e(2294),t.e(3716),t.e(6547),t.e(5760),t.e(7534)]).then(t.bind(t,87534))})),H=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(4901),t.e(1234),t.e(2611)]).then(t.bind(t,42611))})),ee=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(8537),t.e(105),t.e(2294),t.e(3716),t.e(6547),t.e(5760),t.e(9366),t.e(9354),t.e(373)]).then(t.bind(t,90373))})),ne=function(e){return e.children};function te(){var e,n=(0,o.useNavigate)(),t=(0,o.useParams)().tab,r=void 0===t?"overview":t,i=(0,z.y0)(),y=i.did,w=i.blocklet,j=i.error,P=i.client,S=i.actions,B=S.setBlocklet,D=S.refreshBlocklet,E=(0,O.h6)().refresh,_=(0,s.PE)().t,N=(0,a.useCallback)((function(){return(0,L.jsx)($,{scope:y})}),[y]),A=(null===w||void 0===w||null===(e=w.environments.find((function(e){return"BLOCKLET_APP_URL"===e.key})))||void 0===e?void 0:e.value)||window.location.origin,te=function(e){return(0,K.bV)(e,A)},re=function(e){n("/blocklets/".concat(y,"/").concat(e))},ie=!w||(0,K.wS)(w.status)?[]:(0,h.getAppMissingConfigs)(w),oe=null,ce=[{label:_("common.overview"),value:"overview"},{breadcrumbsLabel:_("common.components"),label:(0,L.jsx)(d.Z,{color:"error",variant:"dot",invisible:!ie.length,children:_("common.components")}),value:"components"}];if(j)oe=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(m.Z,{type:"error",variant:"icon",children:(0,K.Z)(j)}),(0,L.jsx)(v.Z,{onClick:function(){return D()},children:(0,L.jsx)("span",{style:{textDecoration:"underline"},children:_("common.retry")})})]});else if(w){var se,ue={overview:(0,L.jsx)(F,{}),configuration:M,navigation:V,services:W,members:(0,L.jsx)(Y,{type:"blocklet",createPassportSvg:te}),passports:X,components:q,"audit-logs":N,logs:J,runtime:(0,L.jsx)(Q,{}),traffic:(0,L.jsx)(H,{client:P,did:y}),storage:(0,L.jsx)(ee,{})};"configuration"===r&&(0,K.wS)(w.status)&&re("overview"),(0,K.wS)(w.status)||(ce.push({label:_("common.members"),value:"members"}),ce.push({label:_("common.passport"),value:"passports"}),ce.push({label:_("common.configuration"),value:"configuration"})),ce.push({label:_("common.auditLogs"),value:"audit-logs"}),w&&null!==(se=w.children)&&void 0!==se&&se.length&&w.structVersion===Z.APP_STRUCT_VERSION&&ce.push({label:_("common.logs"),value:"logs"}),ce.push({label:_("common.configNavigation"),value:"navigation"}),ce.push({label:_("common.runtime"),value:"runtime"}),ce.push({label:_("common.traffic"),value:"traffic"}),ce.push({label:_("common.storage"),value:"storage"}),(0,h.getBlockletServices)(w).length&&ce.splice(2,0,{label:_("blocklet.services"),value:"services"});var le=ue[r]||ue.overview;oe=(0,L.jsxs)(x.g,{type:"components",children:[!(0,h.isExternalBlocklet)(w)&&(0,L.jsx)(f.Z,{tabs:ce,current:r,onChange:re,scrollButtons:"auto"}),(0,L.jsx)("div",{className:"page-content",children:(0,L.jsx)(a.Suspense,{fallback:(0,L.jsx)(G.Z,{children:(0,L.jsx)(I.Z,{})}),children:(0,a.isValidElement)(le)?le:(0,L.jsx)(le,{blocklet:w,onUpdate:function(e){e&&B(e),D()},createPassportSvg:te})})})]})}else oe=(0,L.jsx)(G.Z,{children:(0,L.jsx)(I.Z,{})});var pe=ce.find((function(e){return e.value===r})),de=w?U.G6:ne;return(0,L.jsx)(de,{teamDid:y,children:(0,L.jsxs)(ae,{children:[(0,L.jsxs)(l.Z,{separator:"\u203a","aria-label":"breadcrumb",className:"page-breadcrumb",children:[(0,L.jsx)(c.Link,{color:"textSecondary",to:"/blocklets",children:_("common.blocklets")}),(0,L.jsx)(c.NavLink,{to:"/blocklets/".concat(y,"/overview"),style:function(e){return e?{color:"inherit"}:{}},children:_("common.detail")}),(0,L.jsx)(u.Z,{color:"textSecondary",children:pe?pe.breadcrumbsLabel||pe.label:""})]}),(0,L.jsxs)(u.Z,{component:"div",className:"page-header",children:[(0,L.jsxs)(u.Z,{component:"h2",variant:"h4",className:"page-title",color:"textPrimary",children:[w?(0,L.jsx)(k.Z,{blocklet:w,style:{marginRight:16}}):null,w?(0,L.jsxs)(p.Z,{display:"flex",alignItems:"center",children:[(0,L.jsx)(p.Z,{children:(0,h.getDisplayName)(w)}),"unknown"!==(null===w||void 0===w?void 0:w.status)&&(0,L.jsx)(b.Z,{size:"12px",style:{marginLeft:8},status:w.status,source:w.source})]}):"".concat(_("common.blocklet")," ").concat(_("common.detail"))]}),(0,L.jsx)(R.Z,{permission:"mutate_blocklets",children:!!w&&!(0,h.isExternalBlocklet)(w)&&(0,L.jsx)(T.Z,{className:"page-actions",blocklet:w,onStart:function(){},onComplete:function(e){var t=e.action,r=e.error;r?g.Z.error(r.message):"remove"===t?(E(),n("/blocklets")):D()},variant:"group"})})]}),(0,L.jsx)(C,{}),oe]})})}function re(){var e=(0,o.useParams)().did;return e?(0,L.jsx)(z.$8,{did:e,children:(0,L.jsx)(A.wV,{children:(0,L.jsx)(te,{})})}):null}var ae=i.Z.main(N||(N=(0,r.Z)(["\n .page-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n }\n\n .page-title {\n display: flex;\n align-items: center;\n\n .page-link {\n font-size: 15px;\n margin-top: 8px;\n margin-left: 8px;\n }\n }\n\n .page-content {\n margin-top: 16px;\n }\n\n @media (max-width: ","px) {\n .page-header {\n flex-direction: column;\n align-items: flex-start;\n .page-actions,\n .MuiButtonGroup-root {\n width: 100%;\n }\n .MuiButtonGroup-root {\n .MuiButtonBase-root {\n flex: 1;\n }\n .blocklet-action-text {\n display: none;\n }\n }\n }\n\n .page-title {\n margin-bottom: 15px;\n }\n }\n"])),(function(e){return e.theme.breakpoints.values.md}))},49946:function(e,n,t){t.d(n,{wV:function(){return B},XN:function(){return D}});var r=t(32723),a=t(33028),i=t(34795),o=t(96234),c=t(5057),s=t(55898),u=t.n(s),l=t(86229),p=t(68420),d=t(76811),f=t(29054),m=t(84584),v=t(41899),h=t(58238),b=t(65873);function x(e){return g.apply(this,arguments)}function g(){return g=(0,i.Z)((0,r.Z)().mark((function e(n){var t,o,c,s,u;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.blockletDid,o=n.nodeApi,c=n.spaceGateways,s=!1,e.next=4,Promise.all(c.map(function(){var e=(0,i.Z)((0,r.Z)().mark((function e(n){var t,i;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.name,e.next=3,(0,m.nU)(n.endpoint);case 3:return i=e.sent,(0,b.isEmpty)(i)||i===t||(t=i,s=!0),e.abrupt("return",(0,a.Z)((0,a.Z)({},n),{},{name:t}));case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()));case 4:if(u=e.sent,!s){e.next=8;break}return e.next=8,Promise.all(u.filter((function(e){return e.did})).map((function(e){return o.updateBlockletSpaceGateway({input:{did:t,where:{did:e.did},spaceGateway:(0,a.Z)({},e)}})})));case 8:return e.abrupt("return",u);case 9:case"end":return e.stop()}}),e)}))),g.apply(this,arguments)}var k=t(99875);var y=t(14491);function Z(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{deps:[],setLoading:function(){}},t=n.deps,a=n.setLoading,s=(0,f.y0)().blocklet,u=(0,c.useState)([]),p=(0,o.Z)(u,2),d=p[0],m=p[1],x=(0,h.h6)().api,g=(0,b.debounce)((0,i.Z)((0,r.Z)().mark((function e(){var n,t;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,a(!0),s){e.next=5;break}return m([]),e.abrupt("return");case 5:return e.next=7,x.getBlockletBackups({input:{did:s.meta.did}});case 7:n=e.sent,t=n.backups,m(null!==t&&void 0!==t?t:[]),e.next=16;break;case 12:e.prev=12,e.t0=e.catch(0),console.error(e.t0),l.Z.error((0,y.Z)(e.t0));case 16:return e.prev=16,a(!1),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[0,12,16,19]])}))),2e3);return(0,v.Z)((0,i.Z)((0,r.Z)().mark((function e(){return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:g();case 1:case"end":return e.stop()}}),e)}))),[null===s||void 0===s||null===(e=s.meta)||void 0===e?void 0:e.did].concat(t)),{backups:d}}var w=function(e){var n=e.appDid,t=Z().backups,r=(0,c.useState)({message:"",progress:0,completed:!1}),i=(0,o.Z)(r,2),s=i[0],u=i[1];return(0,(0,h.h6)().ws.useSubscription)(d.BlockletEvents.backupProgress,(function(e){n===(null===e||void 0===e?void 0:e.appDid)&&u((function(){return(0,a.Z)({},e)}))}),[n]),(0,c.useEffect)((function(){var e;if(null!==t&&void 0!==t&&t.length&&(0,b.isNull)(null===(e=t[0])||void 0===e?void 0:e.status)){var n=(0,o.Z)(t,1)[0];u((function(){return{message:n.message,progress:n.progress,completed:Boolean(n.progress>=100)}}))}}),[t]),s},j=t(96266),P=(0,c.createContext)({}),S=P.Provider;P.Consumer;function B(e){var n=e.children,t=(0,p.PE)().t,s=(0,h.h6)().api,u=(0,f.y0)().blocklet,b=(0,c.useState)(!1),g=(0,o.Z)(b,2),y=g[0],P=g[1],B=(0,c.useState)(!1),D=(0,o.Z)(B,2),L=D[0],E=D[1],_=function(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=n.setLoading,a=n.refresh,s=(0,f.y0)(),u=s.blocklet,p=s.actions.refreshBlocklet,d=null===u||void 0===u||null===(e=u.meta)||void 0===e?void 0:e.did,m=(0,c.useState)([]),b=(0,o.Z)(m,2),g=b[0],y=b[1],Z=(0,h.h6)().api;return(0,v.Z)((0,i.Z)((0,r.Z)().mark((function e(){var n,a,i;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,d){e.next=4;break}return y([]),e.abrupt("return");case 4:return null===t||void 0===t||t(!0),e.next=7,Z.getBlockletSpaceGateways({input:{did:d}});case 7:return n=e.sent,a=n.spaceGateways,e.next=11,x({blockletDid:d,nodeApi:Z,spaceGateways:a});case 11:i=e.sent,y(null!==i&&void 0!==i?i:[]),e.next=19;break;case 15:e.prev=15,e.t0=e.catch(0),console.error(e.t0),l.Z.error((0,k.Z)(e.t0));case 19:return e.prev=19,null===t||void 0===t||t(!1),e.finish(19);case 22:case"end":return e.stop()}}),e,null,[[0,15,19,22]])}))),[d,p,a]),{spaceGateways:g}}({refresh:L,setLoading:P}),C=_.spaceGateways,N=w({appDid:null===u||void 0===u?void 0:u.appDid}),G=(0,c.useState)(!1),A=(0,o.Z)(G,2),I=A[0],T=A[1],O=(0,c.useMemo)((function(){return(0,m.mo)(null===u||void 0===u?void 0:u.environments)}),[u,L,I]),U=(0,c.useState)(!1),z=(0,o.Z)(U,2),K=z[0],R=Z({deps:[N],setLoading:z[1]}).backups,F=(0,c.useState)(null===C||void 0===C?void 0:C.find((function(e){return e.endpoint===O}))),M=(0,o.Z)(F,2),V=M[0],$=M[1],X=function(){var e=(0,i.Z)((0,r.Z)().mark((function e(n,t){return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return C.push((0,a.Z)((0,a.Z)({},n),{},{loading:!0})),e.next=3,s.addBlockletSpaceGateway({input:{did:u.meta.did,spaceGateway:n}});case 3:if(O===t){e.next=6;break}return e.next=6,s.configBlocklet({input:{did:[u.meta.did],configs:[{key:d.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:t}]}});case 6:q(),$(n);case 8:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),Y=function(){var e=(0,i.Z)((0,r.Z)().mark((function e(n){return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n){e.next=2;break}return e.abrupt("return");case 2:if(n.endpoint!==O){e.next=5;break}return l.Z.warning(t("storage.spaces.gateway.delete.failedForConnected")),e.abrupt("return");case 5:return e.next=7,s.deleteBlockletSpaceGateway({input:{did:u.meta.did,spaceGatewayDid:null===n||void 0===n?void 0:n.did}});case 7:q(),$(n);case 9:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),W=function(){var e=(0,i.Z)((0,r.Z)().mark((function e(n){var a;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.updateBlockletSpaceGateway({input:{did:u.meta.did,where:{did:n.did},spaceGateway:n}});case 2:if(O===n.endpoint){e.next=5;break}return e.next=5,s.configBlocklet({input:{did:[u.meta.did],configs:[{key:d.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:n.endpoint}]}});case 5:l.Z.success(t("storage.spaces.connectedWithName",{name:null!==(a=null===n||void 0===n?void 0:n.name)&&void 0!==a?a:"DID Spaces"})),q();case 7:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),q=function(){E((function(e){return!e}))};return(0,j.jsx)(S,{value:{spaceGateways:C,selectedSpaceGateway:V,addSpaceGateway:X,deleteSpaceGateway:Y,updateSpaceGateway:W,refreshSpaceGateways:q,spaceGatewaysLoading:y,spaceGatewayIsSelected:function(e){return(null===e||void 0===e?void 0:e.endpoint)===O},backupEndpoint:O,backupProgress:N,backups:R,backupsLoading:K,refreshBackupEndpoint:function(){T((function(e){return!e}))}},children:n})}function D(){return(0,c.useContext)(P)}B.propTypes={children:u().any.isRequired},B.defaultProps={}},60344:function(e,n,t){t.d(n,{hi:function(){return i},od:function(){return a.a}});var r=t(10458),a=t.n(r);a().defaults.timeout=1e4;var i=a().create()},84584:function(e,n,t){t.d(n,{Jf:function(){return y},LQ:function(){return f},Nb:function(){return m},Xv:function(){return p},mo:function(){return h},nD:function(){return d},nU:function(){return g},w2:function(){return b}});var r=t(32723),a=t(34795),i=t(82434),o=t.n(i),c=t(76811),s=t(65873),u=t(60344),l=t(6352);function p(e){var n=e.replace(/\/api\/space\/.+/,""),t=e.replace(/\/$/,"").split("/"),r=t.at(-4),a=t.at(-2);return l(n,"space",r,"apps",a,"explorer","?key=/apps/".concat(a,"/.did-objects/").concat(a,"/"))}function d(e){var n=e.replace(/\/api\/space\/.+/,""),t=e.replace(/\/$/,"").split("/").at(-4);return l(n,"space",t)}function f(e){return e.replace(/\/$/,"").split("/").at(-4)}function m(e){return v.apply(this,arguments)}function v(){return(v=(0,a.Z)((0,r.Z)().mark((function e(n){var t,a;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,o()(n)){e.next=3;break}return e.abrupt("return",!1);case 3:return e.next=5,u.hi.head(n,{timeout:5e3});case 5:return t=e.sent,a=t.headers,e.abrupt("return","true"===a["x-listable"]&&"true"===a["x-readable"]&&"true"===a["x-writeable"]);case 10:return e.prev=10,e.t0=e.catch(0),console.error(e.t0),e.abrupt("return",!1);case 14:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)}function h(e){var n;return(null===e||void 0===e||null===(n=e.find((function(e){return e.key===c.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT})))||void 0===n?void 0:n.value)||""}function b(e){return x.apply(this,arguments)}function x(){return(x=(0,a.Z)((0,r.Z)().mark((function e(n){var t,a,i,c;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,o()(n)){e.next=3;break}return e.abrupt("return",!1);case 3:return t=l(n,"space/api/did/one-click-authorization/token"),e.next=6,u.hi.get(t,{timeout:5e3});case 6:return a=e.sent,i=a.status,c=a.data,e.abrupt("return",200===i&&(0,s.isObject)(c));case 12:return e.prev=12,e.t0=e.catch(0),console.error(e.t0),e.abrupt("return",!1);case 16:case"end":return e.stop()}}),e,null,[[0,12]])})))).apply(this,arguments)}function g(e){return k.apply(this,arguments)}function k(){return(k=(0,a.Z)((0,r.Z)().mark((function e(n){var t,a,i;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,o()(n)){e.next=3;break}return e.abrupt("return","");case 3:return e.next=5,u.hi.head(n,{timeout:3e3});case 5:return t=e.sent,a=t.headers,i=a["x-space-name"],e.abrupt("return",i?decodeURIComponent(i):"");case 11:return e.prev=11,e.t0=e.catch(0),console.error(e.t0),e.abrupt("return","");case 15:case"end":return e.stop()}}),e,null,[[0,11]])})))).apply(this,arguments)}function y(e){var n=e.replace(/\/api\/space\/.+/,""),t=e.replace(/\/$/,"").split("/").at(-4);return l(n,"/api/space/nft/display?spaceDid=".concat(t))}}}]);
1
+ "use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[6511],{86511:function(e,n,t){t.r(n),t.d(n,{default:function(){return re}});var r=t(71171),a=t(5057),i=t(33518),o=t(85493),c=t(15849),s=t(68420),u=t(11750),l=t(39434),p=t(39948),d=t(83407),f=t(94464),m=t(88574),v=t(28726),h=t(38242),b=t(81010),x=t(87363),g=(t(68534),t(86229)),k=t(1722),y=t(96234),Z=t(35432),w=t(55152),j=t(58238),P=t(29054),S=t(73545),B=t(14491),L=t(4651),D=t(96266),E=function(e){var n={},t=null;return(0,h.forEachBlockletSync)(e,(function(e){n[e.meta.bundleDid]?t=(0,h.getDisplayName)(e,!0):e.meta.bundleDid&&(n[e.meta.bundleDid]=!0)})),t},_=function(e,n,t){var r=e.hostname,a=e.href;if(!n)return a;if(t){var i,o=/\d+[-.]\d+[-.]\d+[-.]\d+/.exec(r);if(!o)return a;var c=o[0],s=(((null===(i=n.site)||void 0===i?void 0:i.domainAliases)||[]).map((function(e){return e.value})).filter(Boolean).find((function(e){return e.endsWith(Z.DEFAULT_DID_DOMAIN)}))||"").replace(".".concat(Z.DEFAULT_DID_DOMAIN),"");return s?a.replace(r,"".concat(s,"-").concat(c,".").concat(Z.DEFAULT_IP_DOMAIN_SUFFIX)):a}return a.replace(n.meta.bundleDid,n.appPid)};function C(){var e=(0,s.PE)().t,n=(0,S.T)().api,t=(0,P.y0)().blocklet,r=(0,j.h6)().inService,i=(0,a.useState)(!1),o=(0,y.Z)(i,2),c=o[0],u=o[1],l=(0,a.useState)(5),d=(0,y.Z)(l,2),f=d[0],b=d[1],x=t&&t.structVersion!==Z.APP_STRUCT_VERSION;return[x&&(0,D.jsxs)(m.Z,{type:"warning",style:{margin:"12px 0"},children:[(0,D.jsxs)(p.Z,{display:"flex",alignItems:"center",children:[(0,D.jsx)(v.Z,{variant:"contained",size:"small",color:"primary",onClick:function(){return function(){try{if("running"===t.status)return void g.Z.error(e("blocklet.migrate.tip.running"));var n=E(t);if(n)return void g.Z.error(e("blocklet.migrate.tip.duplicate",{name:n}));u(!0)}catch(r){g.Z.error((0,B.Z)(r))}}()},style:{marginRight:8},children:e("blocklet.migrate.intro.l1")}),(0,D.jsx)("span",{children:e("blocklet.migrate.intro.l2")})]}),["l3","l4","l5","l6"].map((function(n){return(0,D.jsx)(p.Z,{display:"flex",alignItems:"center",children:e("blocklet.migrate.intro.".concat(n))},n)}))]},"alert"),t&&(0,D.jsx)(w.default,{popup:!0,open:c,saveConnect:!1,forceConnected:!1,action:"migrate-app-to-struct-v2",checkFn:n.get,checkTimeout:3e5,onSuccess:function(){var e=_(window.location,t,r);setTimeout((function(){window.location.href=e}),5e3),b(5),setInterval((function(){b((function(e){return e-1}))}),1e3)},extraParams:{appDid:t.appDid,did:t.meta.did,wt:(0,L.iK)(t,!0),title:(0,h.getDisplayName)(t)},messages:{title:e("blocklet.migrate.title"),scan:e("blocklet.migrate.scan"),confirm:e("blocklet.migrate.confirm"),success:f>=0?e("blocklet.migrate.success",{sec:f}):"Redirecting..."},onClose:function(){return u(!1)}},"connect")]}C.propTypes={};var N,G=t(35966),A=t(49946),I=t(44846),T=t(78123),O=t(75793),U=t(17022),z=t(13671),K=t(74094),R=t(7199),F=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(6457),t.e(6591)]).then(t.bind(t,86591))})),M=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(8537),t.e(105),t.e(2294),t.e(3716),t.e(6547),t.e(5760),t.e(2452),t.e(1368),t.e(5808),t.e(8973)]).then(t.bind(t,5119))})),V=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(105),t.e(6547),t.e(2452),t.e(5953),t.e(8501),t.e(4775)]).then(t.bind(t,14775))})),$=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(442),t.e(9662),t.e(7676),t.e(8986)]).then(t.bind(t,13239))})),X=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(1237),t.e(2305),t.e(5979),t.e(2537)]).then(t.bind(t,75979))})),Y=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(8537),t.e(105),t.e(2294),t.e(3716),t.e(6547),t.e(5760),t.e(2657),t.e(6412),t.e(3216)]).then(t.bind(t,46412))})),W=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(8537),t.e(105),t.e(2294),t.e(3716),t.e(4901),t.e(1685),t.e(5555)]).then(t.bind(t,85555))})),q=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(8537),t.e(105),t.e(2294),t.e(3716),t.e(4901),t.e(442),t.e(9366),t.e(5526),t.e(1237),t.e(7638),t.e(1685),t.e(4407),t.e(5953),t.e(3135),t.e(875),t.e(2264),t.e(7126)]).then(t.bind(t,77126))})),J=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(9327),t.e(8219)]).then(t.bind(t,92379))})),Q=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(8537),t.e(105),t.e(2294),t.e(3716),t.e(6547),t.e(5760),t.e(7534)]).then(t.bind(t,87534))})),H=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(4901),t.e(1234),t.e(2611)]).then(t.bind(t,42611))})),ee=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(8537),t.e(105),t.e(2294),t.e(3716),t.e(6547),t.e(5760),t.e(9366),t.e(9354),t.e(373)]).then(t.bind(t,90373))})),ne=function(e){return e.children};function te(){var e,n=(0,o.useNavigate)(),t=(0,o.useParams)().tab,r=void 0===t?"overview":t,i=(0,z.y0)(),y=i.did,w=i.blocklet,j=i.error,P=i.client,S=i.actions,B=S.setBlocklet,L=S.refreshBlocklet,E=(0,O.h6)().refresh,_=(0,s.PE)().t,N=(0,a.useCallback)((function(){return(0,D.jsx)($,{scope:y})}),[y]),A=(null===w||void 0===w||null===(e=w.environments.find((function(e){return"BLOCKLET_APP_URL"===e.key})))||void 0===e?void 0:e.value)||window.location.origin,te=function(e){return(0,K.bV)(e,A)},re=function(e){n("/blocklets/".concat(y,"/").concat(e))},ie=!w||(0,K.wS)(w.status)?[]:(0,h.getAppMissingConfigs)(w),oe=null,ce=[{label:_("common.overview"),value:"overview"},{breadcrumbsLabel:_("common.components"),label:(0,D.jsx)(d.Z,{color:"error",variant:"dot",invisible:!ie.length,children:_("common.components")}),value:"components"}];if(j)oe=(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(m.Z,{type:"error",variant:"icon",children:(0,K.Z)(j)}),(0,D.jsx)(v.Z,{onClick:function(){return L()},children:(0,D.jsx)("span",{style:{textDecoration:"underline"},children:_("common.retry")})})]});else if(w){var se,ue={overview:(0,D.jsx)(F,{}),configuration:M,navigation:V,services:W,members:(0,D.jsx)(Y,{type:"blocklet",createPassportSvg:te}),passports:X,components:q,"audit-logs":N,logs:J,runtime:(0,D.jsx)(Q,{}),traffic:(0,D.jsx)(H,{client:P,did:y}),storage:(0,D.jsx)(ee,{})};"configuration"===r&&(0,K.wS)(w.status)&&re("overview"),(0,K.wS)(w.status)||(ce.push({label:_("common.members"),value:"members"}),ce.push({label:_("common.passport"),value:"passports"}),ce.push({label:_("common.configuration"),value:"configuration"})),ce.push({label:_("common.auditLogs"),value:"audit-logs"}),w&&null!==(se=w.children)&&void 0!==se&&se.length&&w.structVersion===Z.APP_STRUCT_VERSION&&ce.push({label:_("common.logs"),value:"logs"}),ce.push({label:_("common.configNavigation"),value:"navigation"}),ce.push({label:_("common.runtime"),value:"runtime"}),ce.push({label:_("common.traffic"),value:"traffic"}),ce.push({label:_("common.storage"),value:"storage"}),(0,h.getBlockletServices)(w).length&&ce.splice(2,0,{label:_("blocklet.services"),value:"services"});var le=ue[r]||ue.overview;oe=(0,D.jsxs)(x.g,{type:"components",children:[!(0,h.isExternalBlocklet)(w)&&(0,D.jsx)(f.Z,{tabs:ce,current:r,onChange:re,scrollButtons:"auto"}),(0,D.jsx)("div",{className:"page-content",children:(0,D.jsx)(a.Suspense,{fallback:(0,D.jsx)(G.Z,{children:(0,D.jsx)(I.Z,{})}),children:(0,a.isValidElement)(le)?le:(0,D.jsx)(le,{blocklet:w,onUpdate:function(e){e&&B(e),L()},createPassportSvg:te})})})]})}else oe=(0,D.jsx)(G.Z,{children:(0,D.jsx)(I.Z,{})});var pe=ce.find((function(e){return e.value===r})),de=w?U.G6:ne;return(0,D.jsx)(de,{teamDid:y,children:(0,D.jsxs)(ae,{children:[(0,D.jsxs)(l.Z,{separator:"\u203a","aria-label":"breadcrumb",className:"page-breadcrumb",children:[(0,D.jsx)(c.Link,{color:"textSecondary",to:"/blocklets",children:_("common.blocklets")}),(0,D.jsx)(c.NavLink,{to:"/blocklets/".concat(y,"/overview"),style:function(e){return e?{color:"inherit"}:{}},children:_("common.detail")}),(0,D.jsx)(u.Z,{color:"textSecondary",children:pe?pe.breadcrumbsLabel||pe.label:""})]}),(0,D.jsxs)(u.Z,{component:"div",className:"page-header",children:[(0,D.jsxs)(u.Z,{component:"h2",variant:"h4",className:"page-title",color:"textPrimary",children:[w?(0,D.jsx)(k.Z,{blocklet:w,style:{marginRight:16}}):null,w?(0,D.jsxs)(p.Z,{display:"flex",alignItems:"center",children:[(0,D.jsx)(p.Z,{children:(0,h.getDisplayName)(w)}),"unknown"!==(null===w||void 0===w?void 0:w.status)&&(0,D.jsx)(b.Z,{size:"12px",style:{marginLeft:8},status:w.status,source:w.source})]}):"".concat(_("common.blocklet")," ").concat(_("common.detail"))]}),(0,D.jsx)(R.Z,{permission:"mutate_blocklets",children:!!w&&!(0,h.isExternalBlocklet)(w)&&(0,D.jsx)(T.Z,{className:"page-actions",blocklet:w,onStart:function(){},onComplete:function(e){var t=e.action,r=e.error;r?g.Z.error(r.message):"remove"===t?(E(),n("/blocklets")):L()},variant:"group"})})]}),(0,D.jsx)(C,{}),oe]})})}function re(){var e=(0,o.useParams)().did;return e?(0,D.jsx)(z.$8,{did:e,children:(0,D.jsx)(A.wV,{children:(0,D.jsx)(te,{})})}):null}var ae=i.Z.main(N||(N=(0,r.Z)(["\n .page-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n }\n\n .page-title {\n display: flex;\n align-items: center;\n\n .page-link {\n font-size: 15px;\n margin-top: 8px;\n margin-left: 8px;\n }\n }\n\n .page-content {\n margin-top: 16px;\n }\n\n @media (max-width: ","px) {\n .page-header {\n flex-direction: column;\n align-items: flex-start;\n .page-actions,\n .MuiButtonGroup-root {\n width: 100%;\n }\n .MuiButtonGroup-root {\n .MuiButtonBase-root {\n flex: 1;\n }\n .blocklet-action-text {\n display: none;\n }\n }\n }\n\n .page-title {\n margin-bottom: 15px;\n }\n }\n"])),(function(e){return e.theme.breakpoints.values.md}))},49946:function(e,n,t){t.d(n,{wV:function(){return B},XN:function(){return L}});var r=t(32723),a=t(33028),i=t(34795),o=t(96234),c=t(5057),s=t(55898),u=t.n(s),l=t(86229),p=t(68420),d=t(76811),f=t(29054),m=t(84584),v=t(41899),h=t(58238),b=t(65873);function x(e){return g.apply(this,arguments)}function g(){return g=(0,i.Z)((0,r.Z)().mark((function e(n){var t,o,c,s,u;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.blockletDid,o=n.nodeApi,c=n.spaceGateways,s=!1,e.next=4,Promise.all(c.map(function(){var e=(0,i.Z)((0,r.Z)().mark((function e(n){var t,i;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.name,e.next=3,(0,m.nU)(n.endpoint);case 3:return i=e.sent,(0,b.isEmpty)(i)||i===t||(t=i,s=!0),e.abrupt("return",(0,a.Z)((0,a.Z)({},n),{},{name:t}));case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()));case 4:if(u=e.sent,!s){e.next=8;break}return e.next=8,Promise.all(u.filter((function(e){return e.did})).map((function(e){return o.updateBlockletSpaceGateway({input:{did:t,where:{did:e.did},spaceGateway:(0,a.Z)({},e)}})})));case 8:return e.abrupt("return",u);case 9:case"end":return e.stop()}}),e)}))),g.apply(this,arguments)}var k=t(99875);var y=t(14491);function Z(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{deps:[],setLoading:function(){}},t=n.deps,a=n.setLoading,s=(0,f.y0)().blocklet,u=(0,c.useState)([]),p=(0,o.Z)(u,2),d=p[0],m=p[1],x=(0,h.h6)().api,g=(0,b.debounce)((0,i.Z)((0,r.Z)().mark((function e(){var n,t;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,a(!0),s){e.next=5;break}return m([]),e.abrupt("return");case 5:return e.next=7,x.getBlockletBackups({input:{did:s.meta.did}});case 7:n=e.sent,t=n.backups,m(null!==t&&void 0!==t?t:[]),e.next=16;break;case 12:e.prev=12,e.t0=e.catch(0),console.error(e.t0),l.Z.error((0,y.Z)(e.t0));case 16:return e.prev=16,a(!1),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[0,12,16,19]])}))),2e3);return(0,v.Z)((0,i.Z)((0,r.Z)().mark((function e(){return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:g();case 1:case"end":return e.stop()}}),e)}))),[null===s||void 0===s||null===(e=s.meta)||void 0===e?void 0:e.did].concat(t)),{backups:d}}var w=function(e){var n=e.appDid,t=Z().backups,r=(0,c.useState)({message:"",progress:0,completed:!1}),i=(0,o.Z)(r,2),s=i[0],u=i[1];return(0,(0,h.h6)().ws.useSubscription)(d.BlockletEvents.backupProgress,(function(e){n===(null===e||void 0===e?void 0:e.appDid)&&u((function(){return(0,a.Z)({},e)}))}),[n]),(0,c.useEffect)((function(){var e;if(null!==t&&void 0!==t&&t.length&&(0,b.isNull)(null===(e=t[0])||void 0===e?void 0:e.status)){var n=(0,o.Z)(t,1)[0];u((function(){return{message:n.message,progress:n.progress,completed:Boolean(n.progress>=100)}}))}}),[t]),s},j=t(96266),P=(0,c.createContext)({}),S=P.Provider;P.Consumer;function B(e){var n=e.children,t=(0,p.PE)().t,s=(0,h.h6)().api,u=(0,f.y0)().blocklet,b=(0,c.useState)(!1),g=(0,o.Z)(b,2),y=g[0],P=g[1],B=(0,c.useState)(!1),L=(0,o.Z)(B,2),D=L[0],E=L[1],_=function(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=n.setLoading,a=n.refresh,s=(0,f.y0)(),u=s.blocklet,p=s.actions.refreshBlocklet,d=null===u||void 0===u||null===(e=u.meta)||void 0===e?void 0:e.did,m=(0,c.useState)([]),b=(0,o.Z)(m,2),g=b[0],y=b[1],Z=(0,h.h6)().api;return(0,v.Z)((0,i.Z)((0,r.Z)().mark((function e(){var n,a,i;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,d){e.next=4;break}return y([]),e.abrupt("return");case 4:return null===t||void 0===t||t(!0),e.next=7,Z.getBlockletSpaceGateways({input:{did:d}});case 7:return n=e.sent,a=n.spaceGateways,e.next=11,x({blockletDid:d,nodeApi:Z,spaceGateways:a});case 11:i=e.sent,y(null!==i&&void 0!==i?i:[]),e.next=19;break;case 15:e.prev=15,e.t0=e.catch(0),console.error(e.t0),l.Z.error((0,k.Z)(e.t0));case 19:return e.prev=19,null===t||void 0===t||t(!1),e.finish(19);case 22:case"end":return e.stop()}}),e,null,[[0,15,19,22]])}))),[d,p,a]),{spaceGateways:g}}({refresh:D,setLoading:P}),C=_.spaceGateways,N=w({appDid:null===u||void 0===u?void 0:u.appDid}),G=(0,c.useState)(!1),A=(0,o.Z)(G,2),I=A[0],T=A[1],O=(0,c.useMemo)((function(){return(0,m.mo)(null===u||void 0===u?void 0:u.environments)}),[u,D,I]),U=(0,c.useState)(!1),z=(0,o.Z)(U,2),K=z[0],R=Z({deps:[N],setLoading:z[1]}).backups,F=(0,c.useState)(null===C||void 0===C?void 0:C.find((function(e){return e.endpoint===O}))),M=(0,o.Z)(F,2),V=M[0],$=M[1],X=function(){var e=(0,i.Z)((0,r.Z)().mark((function e(n,t){return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return C.push((0,a.Z)((0,a.Z)({},n),{},{loading:!0})),e.next=3,s.addBlockletSpaceGateway({input:{did:u.meta.did,spaceGateway:n}});case 3:if(O===t){e.next=6;break}return e.next=6,s.configBlocklet({input:{did:[u.meta.did],configs:[{key:d.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:t}]}});case 6:q(),$(n);case 8:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),Y=function(){var e=(0,i.Z)((0,r.Z)().mark((function e(n){return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n){e.next=2;break}return e.abrupt("return");case 2:if(n.endpoint!==O){e.next=5;break}return l.Z.warning(t("storage.spaces.gateway.delete.failedForConnected")),e.abrupt("return");case 5:return e.next=7,s.deleteBlockletSpaceGateway({input:{did:u.meta.did,spaceGatewayDid:null===n||void 0===n?void 0:n.did}});case 7:q(),$(n);case 9:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),W=function(){var e=(0,i.Z)((0,r.Z)().mark((function e(n){var a;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.updateBlockletSpaceGateway({input:{did:u.meta.did,where:{did:n.did},spaceGateway:n}});case 2:if(O===n.endpoint){e.next=5;break}return e.next=5,s.configBlocklet({input:{did:[u.meta.did],configs:[{key:d.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:n.endpoint}]}});case 5:l.Z.success(t("storage.spaces.connectedWithName",{name:null!==(a=null===n||void 0===n?void 0:n.name)&&void 0!==a?a:"DID Spaces"})),q();case 7:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),q=function(){E((function(e){return!e}))};return(0,j.jsx)(S,{value:{spaceGateways:C,selectedSpaceGateway:V,addSpaceGateway:X,deleteSpaceGateway:Y,updateSpaceGateway:W,refreshSpaceGateways:q,spaceGatewaysLoading:y,spaceGatewayIsSelected:function(e){return(null===e||void 0===e?void 0:e.endpoint)===O},backupEndpoint:O,backupProgress:N,backups:R,backupsLoading:K,refreshBackupEndpoint:function(){T((function(e){return!e}))}},children:n})}function L(){return(0,c.useContext)(P)}B.propTypes={children:u().any.isRequired},B.defaultProps={}},60344:function(e,n,t){t.d(n,{hi:function(){return i},od:function(){return a.a}});var r=t(10458),a=t.n(r);a().defaults.timeout=1e4;var i=a().create()},84584:function(e,n,t){t.d(n,{Jf:function(){return Z},LQ:function(){return f},Nb:function(){return m},Xv:function(){return p},ag:function(){return b},mo:function(){return h},nD:function(){return d},nU:function(){return k},w2:function(){return x}});var r=t(32723),a=t(34795),i=t(82434),o=t.n(i),c=t(76811),s=t(65873),u=t(2842),l=t(60344);function p(e){var n=e.replace(/\/api\/space\/.+/,""),t=e.replace(/\/$/,"").split("/"),r=t.at(-4),a=t.at(-2);return(0,u.xn)(n,"space",r,"apps",a,"explorer?key=/apps/".concat(a,"/.did-objects/").concat(a,"/"))}function d(e){var n=e.replace(/\/api\/space\/.+/,""),t=e.replace(/\/$/,"").split("/").at(-4);return(0,u.xn)(n,"space",t)}function f(e){return e.replace(/\/$/,"").split("/").at(-4)}function m(e){return v.apply(this,arguments)}function v(){return(v=(0,a.Z)((0,r.Z)().mark((function e(n){var t,a;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,o()(n)){e.next=3;break}return e.abrupt("return",!1);case 3:return e.next=5,l.hi.head(n,{timeout:5e3});case 5:return t=e.sent,a=t.headers,e.abrupt("return","true"===a["x-listable"]&&"true"===a["x-readable"]&&"true"===a["x-writeable"]);case 10:return e.prev=10,e.t0=e.catch(0),console.error(e.t0),e.abrupt("return",!1);case 14:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)}function h(e){var n;return(null===e||void 0===e||null===(n=e.find((function(e){return e.key===c.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT})))||void 0===n?void 0:n.value)||""}function b(e){var n=new URL(e);return(0,u.xn)(n.origin,n.pathname)}function x(e){return g.apply(this,arguments)}function g(){return(g=(0,a.Z)((0,r.Z)().mark((function e(n){var t,a,i,c,p;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,o()(n)){e.next=3;break}return e.abrupt("return",!1);case 3:return t=b(n),a=(0,u.xn)(t,"space/api/did/one-click-authorization/token"),e.next=7,l.hi.get(a,{timeout:5e3});case 7:return i=e.sent,c=i.status,p=i.data,e.abrupt("return",200===c&&(0,s.isObject)(p));case 13:return e.prev=13,e.t0=e.catch(0),console.error(e.t0),e.abrupt("return",!1);case 17:case"end":return e.stop()}}),e,null,[[0,13]])})))).apply(this,arguments)}function k(e){return y.apply(this,arguments)}function y(){return(y=(0,a.Z)((0,r.Z)().mark((function e(n){var t,a,i;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,o()(n)){e.next=3;break}return e.abrupt("return","");case 3:return e.next=5,l.hi.head(n,{timeout:3e3});case 5:return t=e.sent,a=t.headers,i=a["x-space-name"],e.abrupt("return",i?decodeURIComponent(i):"");case 11:return e.prev=11,e.t0=e.catch(0),console.error(e.t0),e.abrupt("return","");case 15:case"end":return e.stop()}}),e,null,[[0,11]])})))).apply(this,arguments)}function Z(e){var n=e.replace(/\/api\/space\/.+/,""),t=e.replace(/\/$/,"").split("/").at(-4);return(0,u.xn)(n,"/api/space/nft/display?spaceDid=".concat(t))}}}]);