@abtnode/blocklet-services 1.16.17-beta-ce49fe0e → 1.16.17-beta-2ac96448

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.
@@ -0,0 +1,2 @@
1
+ "use strict";(self.webpackChunk_abtnode_blocklet_services=self.webpackChunk_abtnode_blocklet_services||[]).push([[1760],{75023:function(e,n,t){t.d(n,{NU:function(){return x},mc:function(){return v}});var r=t(32723),a=t(34795),o=t(96234),c=t(30969),s=t(17708),i=t(50576),u=t(30134),l=t(41395),p=t(59505),d=t(64864),f=t(37574),h=(0,c.createContext)({}),m=h.Provider;h.Consumer;function v(e){var n=e.children,t=(0,s.Z)("spaceGatewayForInstall",null),h=(0,o.Z)(t,2),v=h[0],x=h[1],y=(0,d.y0)(),k=y.blocklet,w=y.actions.refreshBlocklet,b=(0,c.useMemo)((function(){return(0,u.EJ)(k)}),[k]),g=(0,l.h6)().api,Z=function(){var e=(0,a.Z)((0,r.Z)().mark((function e(n){return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return x(n),e.next=3,E(n.endpoint);case 3:w();case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),E=function(){var e=(0,a.Z)((0,r.Z)().mark((function e(n){return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,g.configBlocklet({input:{did:[k.meta.did],configs:[{key:p.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT,value:n}]}});case 2:w();case 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,c.useEffect)((function(){function e(){return(e=(0,a.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(v){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,(0,u.nU)(v.endpoint,v.name);case 4:n=e.sent,t=(0,i.merge)(v,{name:n}),x(t);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[]),(0,f.jsx)(m,{value:{spaceGateway:v,deleteSpaceGateway:function(){x(null),w()},updateSpaceGateway:Z,storageEndpoint:b,settingStorageEndpoint:E},children:n})}function x(){return(0,c.useContext)(h)}v.defaultProps={}},5954:function(e,n,t){t.d(n,{cK:function(){return d},h6:function(){return f}});var r=t(30969),a=t(41395),o=t(20244),c=t(48952),s=t(90781),i=t(99042),u=t(37574),l=a.sy.Provider,p=(a.sy.Consumer,"".concat(o.WELLKNOWN_SERVICE_PATH_PREFIX,"/static/images"));function d(e){var n=e.children,t=window.env,r=t.serverDid,a=t.serverVersion,d=t.mode,f={api:c.Z,restApi:i.Z,prefix:o.WELLKNOWN_SERVICE_PATH_PREFIX,imgPrefix:p,getSessionInHeader:function(){return{}},ws:{getWsClient:s.ZP,create:s.Ue,useSubscription:s.mU},type:"service",info:{did:r,version:a,mode:d}};return(0,u.jsx)(l,{value:{node:f},children:n})}function f(){return(0,r.useContext)(a.sy).node}},51760:function(e,n,t){t.r(n),t.d(n,{default:function(){return D}});var r,a,o,c=t(71171),s=t(33028),i=t(32723),u=t(34795),l=t(30969),p=t(30734),d=t(16380),f=t(19611),h=t.n(f),m=t(54470),v=t(38361),x=t(66629),y=t(43001),k=t(75255),w=t(26022),b=t(94308),g=t(99574),Z=t(19006),E=t(47650),P=t(20244),j=t(7017),C=t(59505),_=t(38507),L=t(64864),N=t(4485),S=d.Z.span(r||(r=(0,c.Z)(["\n color: ",";\n &::before {\n content: '*';\n }\n"])),(function(e){return e.theme.palette.error.main})),I=t(5954),R=t(75023),B=t(37574),O=(0,l.lazy)((function(){return Promise.all([t.e(2836),t.e(9409)]).then(t.bind(t,89409))})),A=(0,l.lazy)((function(){return Promise.all([t.e(5683),t.e(7006),t.e(4319),t.e(4420)]).then(t.bind(t,91654))})),T=(0,l.lazy)((function(){return Promise.all([t.e(5683),t.e(7006),t.e(2836),t.e(3490),t.e(5673),t.e(9657),t.e(5628)]).then(t.bind(t,45628))})),K=(0,l.lazy)((function(){return Promise.all([t.e(5683),t.e(7006),t.e(941)]).then(t.bind(t,11980))})),U=(0,l.lazy)((function(){return Promise.all([t.e(2686),t.e(6576)]).then(t.bind(t,26576))})),F=(0,l.lazy)((function(){return Promise.all([t.e(2836),t.e(5176)]).then(t.bind(t,5176))})),W=(0,l.lazy)((function(){return t.e(9102).then(t.bind(t,29102))}));function D(){var e,n,t,r=(0,k.Z)((function(e){return e.breakpoints.down("md")})),a=(0,w.PE)(),o=a.t,c=a.locale,d=(0,p.useNavigate)(),f=(0,L.y0)(),y=f.meta,D=f.blocklet,G=f.actions,H=f.loading,X=localStorage.getItem("blocklet-server-url"),V=(0,_.tX)("fromLauncher");(0,l.useEffect)((function(){G.refreshMeta(),G.refreshBlocklet({showError:!1}),(0,_.NU)()}),[]),(0,l.useEffect)((function(){G.refreshFuel({showError:!1})}),[null===D||void 0===D||null===(e=D.meta)||void 0===e?void 0:e.did]);var $="".concat(P.WELLKNOWN_SERVICE_PATH_PREFIX,"/setup"),q=[{key:"connect",name:o("setup.steps.connect"),path:h()($,"connect")},{key:"access",name:o("setup.steps.access"),path:h()($,"access")},{key:"domain",name:o("setup.steps.domain"),path:h()($,"domain")},function(e){var n,t=null===e||void 0===e||null===(n=e.capabilities)||void 0===n?void 0:n.didSpace;if(!t)return null;if(t===C.BLOCKLET_APP_SPACE_ENDPOINTS.REQUIRED)return{key:"did-space",name:(0,B.jsxs)(B.Fragment,{children:[o("setup.steps.didSpace")," ",(0,B.jsx)(S,{})]}),path:h()($,"did-space")};if(t===C.BLOCKLET_APP_SPACE_ENDPOINTS.OPTIONAL)return{key:"did-space",name:(0,B.jsx)(B.Fragment,{children:o("setup.steps.didSpace")}),path:h()($,"did-space")};throw new Error("capabilities.didSpace cannot take the value ".concat(t))}(D),{key:"config",name:(0,B.jsxs)(B.Fragment,{children:[o("setup.steps.config")," ",(0,_.o2)(y)&&(0,B.jsx)(S,{})]}),path:h()($,"config")},null!==y&&void 0!==y&&null!==(n=y.requirements)&&void 0!==n&&null!==(t=n.fuels)&&void 0!==t&&t.length?{key:"fuel",name:(0,B.jsxs)(B.Fragment,{children:[o("setup.steps.fuel")," ",(0,B.jsx)(S,{})]}),path:h()($,"fuel")}:null].filter(Boolean),J=q.findIndex((function(e){return"".concat(_.Bq.replace(/\/$/,"")).concat($,"/").concat(e.key)===window.location.pathname})),Y=h()(_.Bq,P.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo"),Q=function(){var e=(0,u.Z)((0,i.Z)().mark((function e(n){var t,r,a;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new URL(window.location.href),r=t.search,n?(a=q.findIndex((function(e){return e.key===n})),d(a>-1?"".concat(h()($,q[a].key)).concat(r):"".concat(h()($,"complete")).concat(r))):q[J+1]?d("".concat(h()($,q[J+1].key)).concat(r)):d("".concat(h()($,"complete")).concat(r)),e.next=4,G.refreshBlocklet();case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),ee=function(){d(-1)};function ne(e,n){return D?(0,B.jsx)(e,(0,s.Z)((0,s.Z)({blocklet:D},n),{},{onNext:Q,onPrevious:ee})):(0,B.jsx)(v.Z,{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",children:(0,B.jsx)(b.Z,{})})}var te=function(){window.open(X)},re=r?(0,B.jsx)(Z.Z,{onClick:te,width:"32",height:"32",style:{cursor:"pointer"}}):(0,B.jsx)(E.Z,{onClick:te,width:"128",height:"48",style:{marginTop:-1,cursor:"pointer"}}),ae=[{key:"install",name:o("launchBlocklet.steps.installApp"),path:h()($,"install")},{key:"setup",name:o("setup.steps.launchApp"),children:q}],oe=[{key:"agreement",name:o("launchBlocklet.introduction"),path:h()($,"agreement")}].concat(ae);return V&&(oe=[{key:"purchase-space",name:o("launchBlocklet.steps.purchaseSpace")},{key:"prepare-space",name:o("launchBlocklet.steps.prepareSpace")}].concat(ae)),(0,B.jsx)(z,{steps:oe,children:(0,B.jsx)(I.cK,{children:(0,B.jsxs)(R.mc,{children:[(0,B.jsx)(m.Global,{styles:M}),(0,B.jsx)(x.Z,{locale:c,loading:H,blockletMeta:(0,s.Z)((0,s.Z)({},y),{},{title:(0,j.getDisplayName)((0,s.Z)((0,s.Z)({},D),{},{meta:y}))}),navLogo:re,pcWidth:"80%",style:{height:"100%"},logoUrl:Y,useOfSkeleton:!1,headerEndAddons:(0,B.jsx)(g.Z,{SessionContext:N.B3,sessionManagerProps:{disableLogout:!0}}),launchingText:o("setup.title"),children:(0,B.jsxs)(p.Routes,{children:[(0,B.jsx)(p.Route,{path:"connect",element:(0,B.jsx)(O,{onNext:Q})}),(0,B.jsx)(p.Route,{path:"domain",element:ne(K)}),(0,B.jsx)(p.Route,{path:"did-space",element:ne(T)}),(0,B.jsx)(p.Route,{path:"config",element:ne(A)}),(0,B.jsx)(p.Route,{path:"access",element:ne(U)}),(0,B.jsx)(p.Route,{path:"fuel",element:ne(F)}),(0,B.jsx)(p.Route,{path:"complete",element:ne(W)}),(0,B.jsx)(p.Route,{path:"*",element:(0,B.jsx)(p.Navigate,{to:"connect".concat(window.location.search),replace:!0})})]})})]})})})}var M=(0,m.css)(a||(a=(0,c.Z)(["\n html,\n body,\n #root,\n #root > .wrapper {\n height: 100%;\n }\n"]))),z=(0,d.Z)(y.W)(o||(o=(0,c.Z)([""])))},41395:function(e,n,t){t.d(n,{h6:function(){return c},sy:function(){return o}});var r=t(33028),a=t(30969),o=(0,a.createContext)({});o.Provider,o.Consumer;function c(){var e=(0,a.useContext)(o).node;return(0,r.Z)((0,r.Z)({},e),{},{inService:"service"===e.type,inDaemon:"daemon"===e.type})}},99574:function(e,n,t){t.d(n,{Z:function(){return y}});var r,a=t(71171),o=t(33028),c=t(30969),s=t(16380),i=t(24974),u=t.n(i),l=t(94551),p=t(30734),d=t(19230),f=t(26681),h=t(26022),m=t(46513),v=t(91077),x=t(37574);function y(e){var n=e.SessionContext,t=e.extraItems,r=e.showLocale,a=e.showHelper,s=e.showSessionManager,i=e.sessionManagerProps,u=(0,c.useContext)(n).session,y=(0,c.useContext)(h.RD).locale,w=(0,p.useLocation)(),b={"/store":{endpoint:"https://store.blocklet.io"},"/dashboard":{path:"/conceptual/overview"},"/settings/router":{path:"/conceptual/server-architecture"}};return(0,x.jsxs)(k,{children:[t.map((function(e,n){return(0,c.cloneElement)(e,{key:n})})),r&&(0,x.jsx)(f.Z,{"data-cy":"locale-addon",icon:m.Z,size:23,showText:!1,className:"locale-addon"}),a&&(0,x.jsx)(l.Z,{onClick:function(){var e=w.pathname,n={};e.indexOf("/store")>-1?n=b["/store"]:b[e]&&(n=b[e]),window.open("".concat(n.endpoint||"https://developer.blocklet.io/docs","/").concat(y).concat(n.path||""),"_blank")},children:(0,x.jsx)(v.Z,{})}),s&&(0,x.jsx)(d.Z,(0,o.Z)((0,o.Z)({locale:y,session:u,size:24,showRole:!0},i),{},{showManageBlocklet:!1}))]})}y.propTypes={SessionContext:u().object.isRequired,webWalletUrl:u().string,extraItems:u().array,showLocale:u().bool,showSessionManager:u().bool,showHelper:u().bool,sessionManagerProps:u().object},y.defaultProps={webWalletUrl:"",extraItems:[],showLocale:!0,showSessionManager:!0,showHelper:!0,sessionManagerProps:{}};var k=s.Z.div(r||(r=(0,a.Z)(["\n display: flex;\n justify-content: center;\n align-items: center;\n\n .MuiIconButton-root svg {\n width: 26px;\n height: 26px;\n }\n\n .user-addon {\n .user-avatar {\n width: 28px;\n border-radius: 14px;\n height: auto;\n }\n }\n\n "," {\n > button,\n > a {\n padding-left: 8px;\n padding-right: 8px;\n }\n }\n"])),(function(e){return e.theme.breakpoints.down("md")}))},54559:function(e,n,t){t.d(n,{hi:function(){return o},od:function(){return a.a}});var r=t(95803),a=t.n(r);a().defaults.timeout=1e4;var o=a().create()},30134:function(e,n,t){t.d(n,{EJ:function(){return Z},Jf:function(){return g},LQ:function(){return f},Nb:function(){return h},Xv:function(){return p},ag:function(){return x},mo:function(){return v},nD:function(){return d},nU:function(){return w},w2:function(){return y}});var r=t(32723),a=t(34795),o=t(92522),c=t.n(o),s=t(59505),i=t(50576),u=t(43430),l=t(54559);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 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,c()(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 v(e){var n;return(null===e||void 0===e||null===(n=e.find((function(e){return e.key===s.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT})))||void 0===n?void 0:n.value)||""}function x(e){var n=new URL(e);return(0,u.xn)(n.origin,n.pathname)}function y(e){return k.apply(this,arguments)}function k(){return(k=(0,a.Z)((0,r.Z)().mark((function e(n){var t,a,o,s,p;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,c()(n)){e.next=3;break}return e.abrupt("return",!1);case 3:return t=x(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 o=e.sent,s=o.status,p=o.data,e.abrupt("return",200===s&&(0,i.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,c()(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 g(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))}var Z=function(e){var n,t;return(null===e||void 0===e||null===(n=e.configs)||void 0===n||null===(t=n.find((function(e){return e.key===s.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT})))||void 0===t?void 0:t.value)||null}}}]);
2
+ //# sourceMappingURL=1760.ed4e8587.chunk.js.map