@abtnode/webapp 1.16.16-beta-ca17cc31 → 1.16.16

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.
Files changed (65) hide show
  1. package/blocklet.js +1 -1
  2. package/blocklet.yml +1 -1
  3. package/build/asset-manifest.json +44 -44
  4. package/build/index.html +1 -1
  5. package/build/service-worker.js +1 -1
  6. package/build/static/js/1234.f36f4363.chunk.js +1 -0
  7. package/build/static/js/{8059.d969b349.chunk.js → 1368.371269bf.chunk.js} +1 -1
  8. package/build/static/js/{1371.96d56167.chunk.js → 1371.8b63f85c.chunk.js} +1 -1
  9. package/build/static/js/{1685.ad51d1ae.chunk.js → 1685.e6dee535.chunk.js} +2 -2
  10. package/build/static/js/2042.a05e2050.chunk.js +2 -0
  11. package/build/static/js/{2291.f7b42545.chunk.js → 2291.4e8c2ea2.chunk.js} +1 -1
  12. package/build/static/js/{2294.d78e6ed6.chunk.js → 2294.2173fa5e.chunk.js} +1 -1
  13. package/build/static/js/{2305.1de337f9.chunk.js → 2305.8aad13ef.chunk.js} +2 -2
  14. package/build/static/js/2611.453c9be7.chunk.js +1 -0
  15. package/build/static/js/{2746.de7a9508.chunk.js → 2746.dedc02f5.chunk.js} +1 -1
  16. package/build/static/js/{3135.92de458b.chunk.js → 3135.ab6ac0d1.chunk.js} +1 -1
  17. package/build/static/js/{3704.e2d6cd48.chunk.js → 3704.6cc3ed6b.chunk.js} +2 -2
  18. package/build/static/js/{3716.edb3d2ce.chunk.js → 3716.f3fb0076.chunk.js} +1 -1
  19. package/build/static/js/{436.90c2d75f.chunk.js → 436.729b5a5a.chunk.js} +1 -1
  20. package/build/static/js/{4362.ca3fb274.chunk.js → 4362.f0059b8d.chunk.js} +1 -1
  21. package/build/static/js/{4407.723415c4.chunk.js → 4407.b024db46.chunk.js} +2 -2
  22. package/build/static/js/{4718.5dedb2bb.chunk.js → 4718.d80adf8d.chunk.js} +2 -2
  23. package/build/static/js/{4775.20e952b9.chunk.js → 4775.b79ed382.chunk.js} +1 -1
  24. package/build/static/js/{4901.00cc1363.chunk.js → 4901.6b52436e.chunk.js} +1 -1
  25. package/build/static/js/{5509.245431ce.chunk.js → 5509.6c906749.chunk.js} +1 -1
  26. package/build/static/js/5760.9034ed47.chunk.js +1 -0
  27. package/build/static/js/5953.80783c99.chunk.js +1 -0
  28. package/build/static/js/{6457.e28eaaed.chunk.js → 6457.280fd1c8.chunk.js} +1 -1
  29. package/build/static/js/{6511.89243c88.chunk.js → 6511.cf601bbb.chunk.js} +1 -1
  30. package/build/static/js/{6580.a36ef27c.chunk.js → 6580.aeb4153f.chunk.js} +1 -1
  31. package/build/static/js/6960.ccb14d14.chunk.js +1 -0
  32. package/build/static/js/{7020.5aaf930e.chunk.js → 7020.325760ed.chunk.js} +1 -1
  33. package/build/static/js/7126.f753e698.chunk.js +1 -0
  34. package/build/static/js/{7534.ab4d9f6e.chunk.js → 7534.15f431d9.chunk.js} +1 -1
  35. package/build/static/js/{7638.ae3e296a.chunk.js → 7638.f7d773c5.chunk.js} +1 -1
  36. package/build/static/js/{7718.68cb259e.chunk.js → 7718.34a51e00.chunk.js} +1 -1
  37. package/build/static/js/{8219.7e3bd847.chunk.js → 8219.59649a93.chunk.js} +1 -1
  38. package/build/static/js/{8382.94b3ec45.chunk.js → 8382.a163f589.chunk.js} +1 -1
  39. package/build/static/js/{875.f12224ef.chunk.js → 875.af5cb0ea.chunk.js} +1 -1
  40. package/build/static/js/{8973.a66e8187.chunk.js → 8973.eaff00d1.chunk.js} +1 -1
  41. package/build/static/js/{8986.9a970a9b.chunk.js → 8986.b2c42433.chunk.js} +1 -1
  42. package/build/static/js/9038.d4d5c249.chunk.js +1 -0
  43. package/build/static/js/{9041.84c1ff27.chunk.js → 9041.0f1c9ac4.chunk.js} +1 -1
  44. package/build/static/js/{9327.b7f3ca87.chunk.js → 9327.77d4d1d8.chunk.js} +1 -1
  45. package/build/static/js/{9354.c3636ea4.chunk.js → 9354.20dcf57f.chunk.js} +1 -1
  46. package/build/static/js/{9662.ce2f3bff.chunk.js → 9662.31e1a4b5.chunk.js} +1 -1
  47. package/build/static/js/{984.1b63b00b.chunk.js → 984.147787d4.chunk.js} +1 -1
  48. package/build/static/js/main.f4613b44.js +2 -0
  49. package/package.json +1 -1
  50. package/build/static/js/2611.453b18de.chunk.js +0 -1
  51. package/build/static/js/5760.420f21b0.chunk.js +0 -1
  52. package/build/static/js/5953.5bc549e1.chunk.js +0 -1
  53. package/build/static/js/6651.bd381be6.chunk.js +0 -2
  54. package/build/static/js/6960.4bad7ec1.chunk.js +0 -1
  55. package/build/static/js/7126.3c844fd9.chunk.js +0 -1
  56. package/build/static/js/9038.717c88a8.chunk.js +0 -1
  57. package/build/static/js/9963.2f462f42.chunk.js +0 -1
  58. package/build/static/js/main.7115a1cb.js +0 -2
  59. /package/build/static/js/{1685.ad51d1ae.chunk.js.LICENSE.txt → 1685.e6dee535.chunk.js.LICENSE.txt} +0 -0
  60. /package/build/static/js/{6651.bd381be6.chunk.js.LICENSE.txt → 2042.a05e2050.chunk.js.LICENSE.txt} +0 -0
  61. /package/build/static/js/{2305.1de337f9.chunk.js.LICENSE.txt → 2305.8aad13ef.chunk.js.LICENSE.txt} +0 -0
  62. /package/build/static/js/{3704.e2d6cd48.chunk.js.LICENSE.txt → 3704.6cc3ed6b.chunk.js.LICENSE.txt} +0 -0
  63. /package/build/static/js/{4407.723415c4.chunk.js.LICENSE.txt → 4407.b024db46.chunk.js.LICENSE.txt} +0 -0
  64. /package/build/static/js/{4718.5dedb2bb.chunk.js.LICENSE.txt → 4718.d80adf8d.chunk.js.LICENSE.txt} +0 -0
  65. /package/build/static/js/{main.7115a1cb.js.LICENSE.txt → main.f4613b44.js.LICENSE.txt} +0 -0
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[6960],{16960:function(e,n,t){t.r(n),t.d(n,{default:function(){return Ke}});var r,a=t(71171),i=t(33028),l=t(85493),o=t(6352),s=t.n(o),c=t(21371),d=t(72904),u=t(33518),p=t(68420),h=t(63902),m=t(51703),f=t(12073),x=t(15959),v=t(10866),g=t(4456),b=t(28864),k=t(99641),j=t(44846),w=t(88574),y=t(35966),Z=t(75793),P=t(38242),C=t(55309),N=t(59740),B=t(55898),E=t.n(B),O=t(96266),D=["children"];function L(e){var n=e.children,t=(0,N.Z)(e,D);return(0,O.jsx)(R,(0,i.Z)((0,i.Z)({},t),{},{children:n}))}L.propTypes={children:E().any.isRequired};var U,z,R=u.Z.div(r||(r=(0,a.Z)(["\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n height: 100%;\n\n .header {\n text-align: center;\n }\n\n .body {\n display: flex;\n flex-direction: column;\n align-items: center;\n margin-top: 30px;\n width: 100%;\n min-height: 200px;\n flex: 1;\n\n "," {\n padding: 24px;\n }\n\n "," {\n padding: 0 16px 16px;\n }\n }\n\n .footer {\n display: flex;\n justify-content: center;\n\n "," {\n padding-bottom: 34px;\n }\n\n "," {\n margin-top: auto;\n padding-bottom: 10px;\n }\n }\n"])),(function(e){return e.theme.breakpoints.up("md")}),(function(e){return e.theme.breakpoints.down("md")}),(function(e){return e.theme.breakpoints.up("sm")}),(function(e){return e.theme.breakpoints.down("md")})),_=t(77609),I=t(23484);var S=u.Z.a(U||(U=(0,a.Z)(["\n display: block;\n height: 36px;\n color: ",";\n"])),(function(e){return e.theme.palette.primary.main})),T=(0,u.Z)(L)(z||(z=(0,a.Z)(["\n .app-info_desc {\n font-weight: 400;\n margin-top: 40px;\n font-size: 18px;\n line-height: 21px;\n color: #222222;\n }\n\n .body {\n text-align: center;\n }\n\n "," {\n .app-info_desc {\n font-size: 16px;\n }\n }\n\n .circle_icon {\n font-size: 58px;\n color: ",";\n }\n"])),(function(e){return e.theme.breakpoints.down("md")}),(function(e){return"error"===e.variant?e.theme.palette.error.main:e.theme.palette.success.main})),M=function(){var e=(0,p.PE)().t,n=(0,Z.h6)().info,t=(0,I.Z)(),r=decodeURIComponent(t.get("accessUrl")||""),a=(0,_.H0)().meta;return(0,O.jsx)(T,{children:(0,O.jsx)("div",{className:"body",children:(0,O.jsx)(C.Z,{variant:"success",title:(0,P.getDisplayName)({meta:a},!0),subTitle:e("launchBlocklet.installSuccess",{serverName:n.name}),footer:(0,O.jsx)(S,{href:r,rel:"noreferrer","data-cy":"open-blocklet",children:e("common.open")})})})})},V=t(32723),A=t(34795),F=t(96234),H=t(39463),G=t(4651),W=t(86229),K=t(14491),q=t(60344),Q=t(17450),X=t(55152),Y=t(35266),J=t(76811),$=t(2660),ee=t(77429),ne=t(48086),te=t(38898),re=t(75506),ae=t.n(re),ie=t(50482),le=t.n(ie),oe=t(5057),se=t(15849),ce=t(67654),de=t(31853),ue=t(11397),pe=t.n(ue),he=t(52581),me=t(11476),fe=t(25339),xe=t(74094),ve=t(13455),ge=t(28726),be=["children"];function ke(e){var n=e.children,t=(0,N.Z)(e,be);return(0,O.jsx)(ge.Z,(0,i.Z)((0,i.Z)({variant:"contained",color:"primary"},t),{},{children:n}))}var je,we,ye,Ze,Pe=(0,oe.forwardRef)((function(e,n){return(0,O.jsx)(ke,(0,i.Z)((0,i.Z)({},e),{},{forwardedRef:n}))})),Ce=t(13932),Ne=t(93040),Be=t(66436),Ee=pe()("@abtnode/webapp:launch-blocklet:step-install"),Oe=function(e,n){return!n.statusChanged&&("installed"===e||"running"===e)&&!n.launching},De=function(e,n,t){return t("nft"===n?e?"launchBlocklet.dialog.nftFreeDescription":"launchBlocklet.dialog.nftPaidDescription":e?"launchBlocklet.dialog.freeDescription":"launchBlocklet.dialog.paidDescription")};function Le(){var e=(0,I.Z)(),n=(0,p.PE)(),t=n.t,r=n.locale,a=(0,Z.h6)(),i=a.api,o=a.info,c=(0,fe.Tt)(),d=c.session,u=c.api,h=(0,l.useNavigate)(),m=(0,_.H0)(),f=m.meta,x=m.isFree,v=m.appDid,g=m.sessionId,b=m.storeUrl,k=m.blockletMetaUrl,w=m.isExternal,C=m.setAppDid,N=m.launcherUrl,B=m.launcherSessionId,E=m.isInstalled,D=f?(0,P.getDisplayName)({meta:f},!0):null,L=e.get("launchType"),U=e.get("chainHost"),z=e.get("nftId"),R=(0,oe.useRef)(null),S=(0,X.useSecurity)(),T=S.decrypt,M=S.encryptKey,re=(0,ce.Z)("skip-blocklet-setup",!1),ie=(0,F.Z)(re,1)[0],ue=(0,de.Z)({launching:!1,visiting:!1,statusChanged:!1,isConnectOpen:!1,nextAccessUrl:"",loaded:!1,installError:null,progressIndex:0,connectData:{action:"",baseUrl:"",checkFn:function(){},extraParams:{}}}),pe=(0,F.Z)(ue,2),ge=pe[0],be=pe[1],ke=(0,Ne.Iq)({user:d.user,launchType:L,nftId:z}),je=(0,H.getServerAuthMethod)(o,L,B,ke),we=(0,me.Z)(ke?v:""),ye=we.status,Ze=we.eventName,Le=e.get("from");(0,oe.useEffect)((function(){E||ze(),be({loaded:!0})}),[]);var Ue=function(){var e=(0,A.Z)((0,V.Z)().mark((function e(){var n,t,r;return(0,V.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(0,xe.bQ)(b,o.blockletRegistryList),t=n.isNew,r=n.decoded,!t){e.next=4;break}return e.next=4,i.addBlockletStore({input:{teamDid:o.did,url:r}});case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ze=function(){var e=(0,A.Z)((0,V.Z)().mark((function e(){var n,t,r,a,i,l,c,u,p,h,m;return(0,V.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(be({installError:null}),null===d||void 0===d||!d.user||w||"serverless"===L){e.next=10;break}return e.prev=2,e.next=5,Ue();case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(2),console.error("addNewRegistryToRegistryList error:",e.t0);case 10:if(!x){e.next=15;break}a="launch-free-blocklet-by-".concat(je),be({isConnectOpen:!0,connectData:{action:a,baseUrl:"",checkFn:q.od.create({baseURL:null!==(n=null===(t=window)||void 0===t||null===(r=t.env)||void 0===r?void 0:r.apiPrefix)&&void 0!==n?n:"/"}).get,extraParams:{wt:(0,G.iK)(f),title:f.title,blockletMetaUrl:k,launchType:L,nftId:z,chainHost:decodeURIComponent(U),launcherUrl:N,launcherSessionId:B}}}),e.next=32;break;case 15:return u="launch-paid-blocklet-by-".concat(je),(p=new URL(window.location.href)).pathname=s()(null!==(i=null===(l=window)||void 0===l||null===(c=l.env)||void 0===c?void 0:c.apiPrefix)&&void 0!==i?i:"/","/api/did/".concat(u,"/token")),p.searchParams.set("wt",(0,G.iK)(f)),p.searchParams.set("_ek_",M),p.searchParams.set("title",f.title),p.searchParams.set("autoConnect",!1),p.searchParams.set("blockletMetaUrl",k),L&&p.searchParams.set("launchType",L),z&&p.searchParams.set("nftId",z),N&&p.searchParams.set("launcherUrl",N),B&&p.searchParams.set("launcherSessionId",B),e.next=29,q.hi.get(p.href);case 29:h=e.sent,m=h.data,be({isConnectOpen:!0,connectData:{action:"verify-purchase-blocklet",baseUrl:new URL(k).origin,checkFn:q.od.create({baseURL:new URL(k).origin}).get,extraParams:{serverDid:o.did,blockletDid:null===f||void 0===f?void 0:f.did,nw:m.url}}});case 32:case"end":return e.stop()}}),e,null,[[2,7]])})));return function(){return e.apply(this,arguments)}}(),Te=function(){var e=(0,A.Z)((0,V.Z)().mark((function e(n){var r,a;return(0,V.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(W.Z.success(t("launchBlocklet.dialog.success")),!(r=Array.isArray(n)?n[n.length-1]:n).sessionToken){e.next=6;break}return(0,xe.ZB)(T(r.sessionToken)),e.next=6,d.refresh();case 6:be({launching:!r.isInstalled,isConnectOpen:!1}),r.appDid&&(C(r.appDid,r.sessionId),(a=new URL(window.location.href)).searchParams.set("appDid",r.appDid),a.searchParams.set("sessionId",r.sessionId),window.history.replaceState(null,"",a.toString()));case 8:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),Me=function(n){var t="/".concat(o.routing.adminPath,"/blocklets/").concat(n.meta.did,"/configuration").replace(/\/+/g,"/"),r="/launch-blocklet/complete?status=installed&name=".concat(encodeURIComponent(D),"&accessUrl=").concat(encodeURIComponent(t),"&blocklet_meta_url=").concat(k),a=e.get("fromLauncher");a&&(r+="&fromLauncher=".concat(a)),L&&(r+="&launchType=".concat(L)),U&&(r+="&chainHost=".concat(U)),h(r)},Ve=function(){var n=(0,A.Z)((0,V.Z)().mark((function n(r){var a,i,l,s,c,d,p;return(0,V.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(Ee("visitBlocklet",{status:ye,state:ge,appDid:v}),!ge.visiting){n.next=3;break}return n.abrupt("return");case 3:return be({visiting:!0}),a=(0,K.A6)({blocklet:r}),n.next=7,(0,xe.D)(a);case 7:if(i=n.sent,!(ae()(i)&&"serverless"!==L||ie)){n.next=12;break}return be({visiting:!1}),setTimeout((function(){Me(r)}),1e3),n.abrupt("return");case 12:if(!ae()(i)){n.next=16;break}return be({visiting:!1}),W.Z.error(t("blocklet.urlEmptyTip")),n.abrupt("return");case 16:if(!1!==Oe(ye,ge)){n.next=28;break}return n.prev=17,n.next=20,u.post("/api/launch/".concat(g));case 20:s=n.sent,c=s.data,l=c.setupToken,n.next=28;break;case 25:n.prev=25,n.t0=n.catch(17),W.Z.error((0,xe.Z)(n.t0));case 28:(d=new URL(i)).searchParams.set("serverUrl",(0,G.RU)(o)),"running"!==r.status&&d.searchParams.set("__start__","1"),(p=e.get("fromLauncher"))&&d.searchParams.set("fromLauncher",p),L&&d.searchParams.set("launchType",L),z&&d.searchParams.set("nftId",z),U&&d.searchParams.set("chainHost",U),l&&d.searchParams.set("setupToken",l),be({nextAccessUrl:d.href,visiting:!1}),setTimeout((function(){window.location.href=d.href}),1e3);case 39:case"end":return n.stop()}}),n,null,[[17,25]])})));return function(e){return n.apply(this,arguments)}}(),Ae=[t("launchBlocklet.waiting.verifying"),t("launchBlocklet.waiting.downloading"),t("launchBlocklet.waiting.extracting"),t("upgrading"===ye?"common.upgrading":"launchBlocklet.waiting.installing"),t("launchBlocklet.waiting.done")],Fe=function(){Ee("handleInstalledProgress",{status:ye,state:ge}),ye&&(be({progressIndex:4}),R.current&&(clearTimeout(R.current),R.current=null),R.current=setTimeout((function(){i.getBlocklet({input:{did:v,attachRuntimeInfo:!0}}).then((function(e){e.blocklet&&Ve(e.blocklet)}))}),500))};if((0,oe.useEffect)((function(){if("serverless"!==L||Ze!==J.BlockletEvents.nftConsumed)switch(ye){case"waiting":be({progressIndex:1,statusChanged:!0});break;case"downloading":be({progressIndex:2,statusChanged:!0});break;case"installing":case"upgrading":be({progressIndex:3,statusChanged:!0});break;case"installed":if("serverless"===L&&!(0,Ne.MZ)(we))break;Fe();break;case"starting":case"running":case"stopped":Fe();break;case"corrupted":case"error":var e,n={message:we.error.message,name:we.eventName};if([J.BlockletEvents.downloadFailed,J.BlockletEvents.installFailed].includes(we.eventName)?n.action="retry":"error"!==ye&&"corrupted"!==ye||(n.action="view"),!le()(n,ge.installError))null!==we&&void 0!==we&&null!==(e=we.error)&&void 0!==e&&e.message&&W.Z.error((0,xe.Z)(we.error))}else Fe()}),[ye,Ze,we]),Ee("render",{status:ye,eventName:Ze,launchType:L,runtimeBlockletState:we,state:ge}),d.user&&null===ye||ae()(f))return(0,O.jsx)(y.Z,{relative:"parent",children:(0,O.jsx)(j.Z,{})});if(ge.installError){var He={view:!w&&(0,O.jsx)(Pe,{className:"bottom-button",component:se.Link,to:"/blocklets/".concat(v,"/overview"),"data-cy":"view-blocklet",color:"primary",variant:"contained",children:t("launchBlocklet.viewApplication")}),retry:(0,O.jsxs)(Ie,{children:[Le&&(0,O.jsx)(Pe,{variant:"text",className:"bottom-button","data-cy":"go-back",disabled:ge.isConnectOpen,onClick:function(){window.location.href=Le},children:t("common.back")}),(0,O.jsxs)(Pe,{className:"bottom-button","data-cy":"retry-install",disabled:ge.isConnectOpen,onClick:ze,children:[ge.isConnectOpen&&(0,O.jsx)(j.Z,{size:16}),t("common.retry")]})]})},Ge=ge.installError.name?ge.installError.name.replace("blocklet.",""):"installFailed";return(0,O.jsx)(Se,{variant:"error",title:D,subTitle:(0,O.jsxs)(_e,{children:[(0,O.jsx)("div",{children:t("launchBlocklet.error.".concat(Ge))}),ge.installError.message&&(0,O.jsx)("div",{className:"error-desc",children:t("common.errorMessage")+ge.installError.message})]}),footer:He[ge.installError.action]})}if(Oe(ye,ge))return Ee("alreadyExists",{status:ye,state:ge,runtimeBlockletState:we}),(0,O.jsx)(Se,{variant:"info",title:t("common.reminder"),subTitle:t("launchBlocklet.alreadyExists",{name:(0,P.getDisplayName)({meta:f},!0)}),footer:(0,O.jsxs)("div",{children:[!ge.nextAccessUrl&&(0,O.jsx)(j.Z,{size:16}),ge.nextAccessUrl&&(0,O.jsx)(te.Z,{href:ge.nextAccessUrl,"data-cy":"open-blocklet",children:t("launchBlocklet.redirect")})]})});var We=!ge.launching&&!ye;return(0,O.jsxs)(Re,{children:[(0,O.jsx)("div",{className:"header",children:(0,O.jsx)($.Z,{title:t(We?"common.install":"common.installing"),subTitle:We?t("launchBlocklet.subTitle",{appName:D,serverName:o.name}):""})}),(0,O.jsxs)("div",{className:"body",children:[We&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)("div",{className:"illustrations",children:[(0,O.jsx)("div",{className:"ills-block ills-block-left",children:(0,O.jsxs)("div",{className:"ills-block-inner",children:[(0,O.jsx)(ve.Z,{className:"i-icon",blocklet:{meta:f},blockletMetaUrl:k}),(0,O.jsx)("div",{className:"i-name",children:D})]})}),(0,O.jsx)(ne.Z,{className:"arrow-icon"}),(0,O.jsx)("div",{className:"ills-block ills-block-right",children:(0,O.jsxs)("div",{className:"ills-block-inner",children:[(0,O.jsx)("img",{width:"64",height:"64",src:he.Z,alt:""}),(0,O.jsx)("div",{className:"i-name",children:o.name}),(0,O.jsx)(Q.Z,{size:12,responsive:!1,compact:!0,did:o.did})]})})]}),ge.loaded&&!E&&!ge.launching&&(0,O.jsxs)(Pe,{className:"bottom-button","data-cy":"start-launch",disabled:ge.isConnectOpen,onClick:ze,children:[ge.isConnectOpen&&(0,O.jsx)(j.Z,{size:16}),t("launchBlocklet.confirmInstall")]})]}),ge.launching&&(0,O.jsxs)(Be.Z,{children:[(0,O.jsx)(Y.Z,{increaseSpeed:.3,messageLoop:!1,message:(0,O.jsx)(ee.Z,{steps:Ae,stepIndex:ge.progressIndex,autoGrowth:4===ge.progressIndex?1e3:4e3})}),[1,2].includes(ge.progressIndex)&&(0,O.jsx)(Ce.Z,{appDid:v})]})]}),ge.isConnectOpen&&(0,O.jsx)(Ce.Z,{appDid:v,visible:!1}),(0,O.jsx)(X.default,{open:ge.isConnectOpen,popup:!0,saveConnect:!1,className:"connect",baseUrl:ge.connectData.baseUrl,action:ge.connectData.action,checkFn:ge.connectData.checkFn,extraParams:ge.connectData.extraParams,checkTimeout:6e5,webWalletUrl:(0,xe.yP)(o),onSuccess:Te,onClose:function(){return be({isConnectOpen:!1})},locale:r,messages:{title:"".concat(t("launchBlocklet.dialog.title")),scan:De(x,je,t),confirm:t("launchBlocklet.dialog.confirm"),success:t("launchBlocklet.dialog.success")}})]})}var Ue,ze,Re=(0,u.Z)(L)(je||(je=(0,a.Z)(["\n .body {\n align-items: center;\n animation: fadein ease 0.3s;\n }\n\n .illustrations {\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: start;\n text-align: center;\n margin-top: 16px;\n margin-bottom: 40px;\n width: 100%;\n }\n\n .ills-block,\n .ills-block-inner {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n flex-shrink: 0;\n flex: 1;\n }\n .ills-block {\n max-width: 220px;\n .i-icon {\n width: 64px;\n height: 64px;\n }\n\n .i-name {\n margin-top: 16px;\n font-weight: 400;\n font-size: 16px;\n color: #222222;\n }\n\n .i-sub-name {\n color: #999999;\n }\n }\n\n .arrow-icon {\n align-self: start;\n color: #c4c5ca;\n font-size: 30px;\n margin: 16px 0 0;\n "," {\n margin: 25px 24px 0;\n }\n }\n\n @keyframes fadein {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n"])),(function(e){return e.theme.breakpoints.down("md")})),_e=u.Z.div(we||(we=(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]})),Ie=u.Z.div(ye||(ye=(0,a.Z)(["\n display: flex;\n justify-content: space-around;\n flex-wrap: wrap;\n button {\n margin: 0 10px 18px;\n }\n"]))),Se=(0,u.Z)(C.Z)(Ze||(Ze=(0,a.Z)(["\n .result-footer {\n height: auto;\n }\n"]))),Te=t(31440),Me=t(35432);function Ve(e){var n=e.onClickNext,t=e.handleDescEle,r=e.showPageHeader,a=(0,l.useNavigate)(),i=(0,oe.useState)(null),o=(0,F.Z)(i,2),s=o[0],c=o[1],d=(0,oe.useState)(!1),u=(0,F.Z)(d,2),h=u[0],m=u[1],f=(0,p.PE)().t,x=(0,Z.h6)(),v=x.info,g=x.api,b=(0,_.H0)(),k=b.meta,w=b.isRunning,N=b.isInstalled,B=b.appDid,E=b.isExternal,D=(0,oe.useMemo)((function(){if(!E)return"/blocklets/".concat(B,"/overview");if(!s)return"";var e=new URL(s);return"".concat(e.origin).concat(Me.WELLKNOWN_SERVICE_PATH_PREFIX,"/admin")}),[s,E,B]),L=n||function(){a("/launch-blocklet/install".concat(window.location.search))},U=function(){var e=(0,A.Z)((0,V.Z)().mark((function e(){var n,t,r,a;return(0,V.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,m(!0),e.next=4,g.getBlocklet({input:{did:k.did,attachRuntimeInfo:!0}});case 4:return n=e.sent,t=n.blocklet,r=(0,K.A6)({blocklet:t}),e.next=9,(0,xe.D)(r);case 9:if((a=e.sent)||!ae()(a)){e.next=13;break}return c(null),e.abrupt("return");case 13:c(new URL(a).href),e.next=19;break;case 16:e.prev=16,e.t0=e.catch(0),W.Z.error(e.t0.message);case 19:return e.prev=19,m(!1),e.finish(19);case 22:case"end":return e.stop()}}),e,null,[[0,16,19,22]])})));return function(){return e.apply(this,arguments)}}();if((0,oe.useEffect)((function(){(w||N&&E)&&U()}),[w,E,N]),N){var z=w?"alreadyRunning":"alreadyInstalled";return(0,O.jsx)(C.Z,{variant:"info",title:f("common.reminder"),subTitle:f("launchBlocklet.".concat(z),{name:(0,P.getDisplayName)({meta:k},!0)}),footer:(0,O.jsxs)(We,{children:[(0,O.jsx)(Pe,{loading:!D,"data-cy":"view-blocklet",component:E?void 0:se.Link,to:D,href:D,variant:w?"outlined":"contained",color:"primary",children:f("launchBlocklet.viewApplication")}),w&&(0,O.jsx)(Pe,{loading:h,className:"last-button",disabled:!s,href:s,"data-cy":"open-blocklet",children:f("common.open")})]})})}return v?(0,O.jsxs)(Ge,{children:[r&&(0,O.jsx)($.Z,{title:f("launchBlocklet.introduction"),subTitle:f("launchBlocklet.welcome")}),(0,O.jsx)(Te.Z,{meta:k,onClickNext:L,handleDescEle:t})]}):(0,O.jsx)(y.Z,{relative:"parent",children:(0,O.jsx)(j.Z,{})})}Ve.defaultProps={onClickNext:null,handleDescEle:"",showPageHeader:!0};var Ae,Fe,He,Ge=u.Z.div(Ue||(Ue=(0,a.Z)(["\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n height: 100%;\n"]))),We=u.Z.div(ze||(ze=(0,a.Z)(["\n .MuiButton-root {\n "," {\n min-width: 200px;\n }\n }\n .last-button {\n margin-left: ",";\n }\n"])),(function(e){return e.theme.breakpoints.up("md")}),(function(e){return e.theme.spacing(2)}));function Ke(){var e=(0,d.Z)((function(e){return e.breakpoints.down("md")})),n=(0,p.PE)(),t=n.t,r=n.locale,a=(0,Z.h6)().info,o=(0,xe.yP)(a),u=(0,_.H0)(),P=u.serverUrl,C=u.fromLauncher,N=u.meta,B=u.isFree,E=u.loading,D=u.error,L=u.storeUrl,U=s()((0,xe.Y5)(),"/launch-blocklet"),z=[{key:"install",name:t("launchBlocklet.steps.installApp"),path:s()(U,"install")},{key:"setup",name:t("setup.steps.launchApp")}],R=[{key:"agreement",name:t("launchBlocklet.introduction"),path:s()(U,"agreement")}].concat(z),I=function(){P&&window.open(P)},S=(0,O.jsx)(Xe,{className:"".concat(P?"logo-can-click":""),children:(0,O.jsx)(k.Z,{onClick:I,logo:e?(0,O.jsx)(v.Z,{width:"32",height:"32"}):(0,O.jsx)(g.Z,{width:"128",height:"48"})})});C&&(R=[{key:"purchase-space",name:t("launchBlocklet.steps.purchaseSpace")},{key:"prepare-space",name:t("launchBlocklet.steps.prepareSpace")}].concat(z),S=(0,O.jsx)(Xe,{className:"".concat(P?"logo-can-click":""),children:(0,O.jsx)(k.Z,{logo:e?(0,O.jsx)(v.Z,{onClick:I,width:"32",height:"32"}):(0,O.jsx)(g.Z,{onClick:I,width:"128",height:"48"}),previousData:{logo:e?(0,O.jsx)(x.Z,{width:"32",height:"32"}):(0,O.jsx)(b.Z,{width:"145",height:"48"})}})}));var T={meta:N,isFree:B};return(0,O.jsx)(m.W,{steps:R,children:(0,O.jsx)(h.Z,{locale:r,loading:E,blockletMeta:(0,i.Z)((0,i.Z)({},N),{},{isFree:B}),useOfSkeleton:!1,navLogo:S,headerEndAddons:(0,O.jsx)(f.Z,{webWalletUrl:o,SessionContext:fe.B3}),pcWidth:"80%",style:{height:"100%"},logoUrl:N&&N.logo?(0,xe.aZ)({did:N.did,baseUrl:L,logoPath:N.logo}):null,children:(0,O.jsxs)(Qe,{children:[(0,O.jsx)(c.Global,{styles:qe}),E&&(0,O.jsx)(y.Z,{relative:"parent",children:(0,O.jsx)(j.Z,{})}),!E&&D&&(0,O.jsx)(y.Z,{relative:"parent",children:(0,O.jsx)(w.Z,{style:{wordBreak:"break-all"},variant:"icon",type:"error",children:D})}),!E&&!D&&(0,O.jsxs)(l.Routes,{children:[(0,O.jsx)(l.Route,{path:"agreement",element:(0,O.jsx)(Ve,{})}),(0,O.jsx)(l.Route,{path:"install",element:(0,O.jsx)(Le,{})}),(0,O.jsx)(l.Route,{path:"complete",element:(0,O.jsx)(M,{blocklet:T})}),(0,O.jsx)(l.Route,{path:"*",element:(0,O.jsx)(l.Navigate,{to:"agreement".concat(window.location.search),replace:!0})})]})]})})})}var qe=(0,c.css)(Ae||(Ae=(0,a.Z)(["\n html,\n body,\n #root,\n #root > .wrapper {\n height: 100%;\n }\n"]))),Qe=u.Z.div(Fe||(Fe=(0,a.Z)(["\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"]))),Xe=u.Z.div(He||(He=(0,a.Z)(["\n margin-top: -1px;\n &.logo-can-click {\n cursor: pointer;\n }\n"])))},31440:function(e,n,t){t.d(n,{Z:function(){return x}});var r,a=t(71171),i=t(55898),l=t.n(i),o=t(85493),s=t(33518),c=t(68420),d=t(40265),u=t(44566),p=t(33028),h=t(33665),m=t(96266);function f(e){var n=Object.assign({},((0,h.Z)(e),e));return(0,m.jsxs)("div",(0,p.Z)((0,p.Z)({},n),{},{style:{width:"100%"},children:[(0,m.jsx)("h3",{children:"End User License Agreement for Application"}),(0,m.jsx)("p",{children:"Blocklet Server License Agreement ArcBlock, Inc. version 2020-08-28"}),(0,m.jsx)("p",{children:"BLOCKLET SERVER LICENSE AGREEMENT"}),(0,m.jsx)("p",{children:"\u6682\u65e0"})]}))}function x(e){var n=e.meta,t=e.onClickNext,r=e.handleDescEle,a=(0,o.useNavigate)(),i=(0,c.PE)(),l=i.t,s=i.locale,p=t||function(){a("/launch-blocklet/install".concat(window.location.search))};return(0,m.jsxs)(v,{children:[(0,m.jsx)("div",{className:"app-content",children:(0,m.jsx)("div",{className:"agreement",children:(0,m.jsx)("div",{className:"agreement-content",children:(0,m.jsx)(u.Z,{blockletMeta:{data:n},locale:s,handleDescEle:r})})})}),(0,m.jsx)("div",{className:"button-container","data-cy":"agree-all",children:(0,m.jsx)(d.Z,{onContinue:p,description:(0,m.jsx)(f,{}),texts:{listenName:l("launchBlocklet.license"),buttonNext:l("launchBlocklet.next")}})})]})}x.propTypes={meta:l().object.isRequired,onClickNext:l().func,handleDescEle:l().node},x.defaultProps={onClickNext:null,handleDescEle:""};var v=s.Z.div(r||(r=(0,a.Z)(["\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n height: 100%;\n flex: 1;\n .app-content {\n padding: 2px 24px 24px;\n "," {\n padding-top: 10px;\n }\n width: 100%;\n flex: 1;\n letter-spacing: normal;\n }\n .agreement {\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n border: 1px solid ",";\n border-radius: 12px;\n "," {\n margin-top: 24px;\n }\n "," {\n margin-top: 16px;\n }\n .agreement-content {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n font-size: 14px;\n overflow-y: auto;\n "," {\n padding: 0 24px;\n }\n "," {\n padding: 0 16px;\n }\n &:after {\n display: block;\n content: '';\n height: 24px;\n }\n }\n }\n .button-container {\n padding-top: 24px;\n padding-bottom: 34px;\n "," {\n padding-right: 24px;\n margin-left: auto;\n }\n "," {\n padding-top: 0;\n padding-bottom: 16px;\n }\n }\n"])),(function(e){return e.theme.breakpoints.down("md")}),(function(e){return e.theme.palette.grey[100]}),(function(e){return e.theme.breakpoints.up("md")}),(function(e){return e.theme.breakpoints.down("md")}),(function(e){return e.theme.breakpoints.up("md")}),(function(e){return e.theme.breakpoints.down("md")}),(function(e){return e.theme.breakpoints.up("md")}),(function(e){return e.theme.breakpoints.down("md")}))},28864:function(e,n,t){n.Z=void 0;(r=t(5057))&&r.__esModule;var r,a=t(96266);function i(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function l(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?i(Object(t),!0).forEach((function(n){o(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):i(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function o(e,n,t){return(n=function(e){var n=function(e,n){if("object"!==typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!==typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"===typeof n?n:String(n)}(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var s=function(e){return(0,a.jsxs)("svg",l(l({},e),{},{children:[(0,a.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M80.005 25.994V10h7.737a3.79 3.79 0 0 1 3.79 3.79v1.149a3.777 3.777 0 0 1-1.035 2.602 3.788 3.788 0 0 1 1.901 3.286v1.377a3.79 3.79 0 0 1-3.79 3.79h-8.603zm1.684-8.957h6.226a2.105 2.105 0 0 0 1.932-2.098v-1.15a2.105 2.105 0 0 0-2.105-2.105h-6.053v5.353zm0 7.273v-5.582l6.92-.007c1.163 0 2.105.943 2.105 2.106v1.377a2.105 2.105 0 0 1-2.105 2.106h-6.92zM97.255 10v15.994h-1.762V10h1.762zm8.733 4.319h-1.827a3.81 3.81 0 0 0-3.811 3.81v4.054a3.81 3.81 0 0 0 3.811 3.81h1.827a3.811 3.811 0 0 0 3.811-3.81V18.13a3.811 3.811 0 0 0-3.811-3.81zm-1.827 1.762a2.05 2.05 0 0 0-2.049 2.048v4.054a2.05 2.05 0 0 0 2.049 2.049h1.827a2.048 2.048 0 0 0 2.048-2.049V18.13a2.048 2.048 0 0 0-2.048-2.048h-1.827zM125.204 26v-5.754h2.148L130.674 26h2.035l-3.821-6.618 2.993-5.184h-2.035l-2.474 4.286h-2.168V10h-1.762v16h1.762zm-5.556-7.56v-.31a2.048 2.048 0 0 0-2.048-2.05h-1.827a2.048 2.048 0 0 0-2.049 2.05v4.053c0 1.132.917 2.049 2.049 2.049h1.827a2.048 2.048 0 0 0 2.048-2.049v-.311h1.762v.311a3.81 3.81 0 0 1-3.81 3.81h-1.827a3.81 3.81 0 0 1-3.811-3.81V18.13a3.81 3.81 0 0 1 3.811-3.81h1.827a3.81 3.81 0 0 1 3.81 3.81v.312h-1.762zm17.918 7.554V10h-1.762v15.994h1.762zm4.989-5.357v1.546c0 1.132.917 2.049 2.049 2.049h1.827a2.048 2.048 0 0 0 2.048-2.049v-.311h1.762v.311a3.81 3.81 0 0 1-3.81 3.81h-1.827a3.81 3.81 0 0 1-3.811-3.81V18.13a3.81 3.81 0 0 1 3.811-3.81h1.827a3.81 3.81 0 0 1 3.81 3.81v.746h.001v1.762h-7.687zm5.924-1.762h-5.924v-.746c0-1.131.917-2.048 2.049-2.048h1.827c1.131 0 2.048.917 2.048 2.048v.746zm5.489-1.912H152.4v-1.762h1.568v-2.848h1.684v2.848h4.077v1.762h-4.077v5.677a1.669 1.669 0 1 0 3.339 0v-.35h1.684v.35a3.353 3.353 0 1 1-6.707 0v-5.677z",fill:"#121319"}),(0,a.jsx)("path",{d:"M92.112 50.259v3.108H80.254V33.123h3.766v17.136h8.092zM101.843 47.235c-.999.047-1.839.135-2.52.266-.681.121-1.227.28-1.638.476-.41.196-.705.425-.882.686a1.49 1.49 0 0 0-.266.854c0 .606.177 1.04.532 1.302.364.261.835.392 1.414.392.71 0 1.32-.126 1.834-.378.523-.261 1.031-.654 1.526-1.176v-2.422zm-7.924-6.23c1.652-1.512 3.64-2.268 5.964-2.268.84 0 1.591.14 2.254.42.663.27 1.223.653 1.68 1.148a4.765 4.765 0 0 1 1.036 1.75c.243.681.364 1.428.364 2.24v9.072h-1.568c-.327 0-.579-.047-.756-.14-.177-.103-.317-.303-.42-.602l-.308-1.036c-.364.327-.719.616-1.064.868a6.54 6.54 0 0 1-1.078.616 5.498 5.498 0 0 1-1.204.378c-.42.093-.887.14-1.4.14-.607 0-1.167-.08-1.68-.238a3.775 3.775 0 0 1-1.33-.742 3.297 3.297 0 0 1-.868-1.218c-.206-.486-.308-1.05-.308-1.694a3.308 3.308 0 0 1 .77-2.114 5.12 5.12 0 0 1 1.078-.924c.438-.29.975-.541 1.61-.756a13.74 13.74 0 0 1 2.24-.518c.85-.14 1.82-.224 2.912-.252v-.84c0-.962-.205-1.67-.616-2.128-.411-.467-1.003-.7-1.778-.7-.56 0-1.027.065-1.4.196-.364.13-.686.28-.966.448-.28.159-.537.303-.77.434-.224.13-.476.196-.756.196-.243 0-.448-.06-.616-.182a1.67 1.67 0 0 1-.406-.448l-.616-1.106zM120.85 39.003v14.364h-2.114c-.458 0-.747-.21-.868-.63l-.238-1.148a7.862 7.862 0 0 1-1.946 1.456c-.71.364-1.545.546-2.506.546-.784 0-1.48-.13-2.086-.392a4.236 4.236 0 0 1-1.512-1.134 5.016 5.016 0 0 1-.938-1.722 7.52 7.52 0 0 1-.308-2.212v-9.128h3.458v9.128c0 .877.2 1.559.602 2.044.41.476 1.022.714 1.834.714.597 0 1.157-.13 1.68-.392a6.037 6.037 0 0 0 1.484-1.106V39.003h3.458zM127.512 40.767c.29-.29.593-.556.91-.798a5.623 5.623 0 0 1 2.184-1.036 5.542 5.542 0 0 1 1.344-.154c.784 0 1.48.135 2.086.406a3.957 3.957 0 0 1 1.512 1.12 4.69 4.69 0 0 1 .924 1.722c.215.663.322 1.395.322 2.198v9.142h-3.458v-9.142c0-.878-.2-1.554-.602-2.03-.401-.486-1.012-.728-1.834-.728-.597 0-1.157.135-1.68.406-.522.27-1.017.64-1.484 1.106v10.388h-3.458V39.003h2.114c.448 0 .742.21.882.63l.238 1.134zM150.373 42.04c-.103.132-.205.234-.308.309-.093.075-.233.112-.42.112a.982.982 0 0 1-.518-.154 9.315 9.315 0 0 0-.602-.364 3.902 3.902 0 0 0-.84-.364c-.317-.112-.714-.168-1.19-.168-.607 0-1.139.112-1.596.336-.457.215-.84.527-1.148.938-.299.41-.523.91-.672 1.498-.149.578-.224 1.236-.224 1.974 0 .765.079 1.447.238 2.044.168.597.406 1.101.714 1.512.308.401.681.71 1.12.924.439.205.933.308 1.484.308.551 0 .994-.066 1.33-.196.345-.14.635-.29.868-.448.233-.168.434-.318.602-.448a.925.925 0 0 1 .588-.21c.28 0 .49.107.63.322l.994 1.26a6.449 6.449 0 0 1-1.246 1.134 7.144 7.144 0 0 1-1.4.728 7.208 7.208 0 0 1-1.484.378 10.3 10.3 0 0 1-1.512.112 6.448 6.448 0 0 1-2.506-.49 6 6 0 0 1-2.058-1.456c-.588-.635-1.055-1.41-1.4-2.324-.336-.924-.504-1.974-.504-3.15 0-1.055.149-2.03.448-2.926.308-.906.756-1.685 1.344-2.338a6.09 6.09 0 0 1 2.184-1.554c.868-.373 1.867-.56 2.996-.56 1.073 0 2.011.172 2.814.518.812.345 1.54.84 2.184 1.484l-.91 1.26zM157.049 40.543a7.51 7.51 0 0 1 1.848-1.274c.672-.327 1.46-.49 2.366-.49.784 0 1.479.135 2.086.406.606.261 1.11.634 1.512 1.12.41.476.718 1.05.924 1.722.214.663.322 1.395.322 2.198v9.142h-3.458v-9.142c0-.878-.201-1.554-.602-2.03-.402-.486-1.013-.728-1.834-.728-.598 0-1.158.135-1.68.406-.523.27-1.018.64-1.484 1.106v10.388h-3.458V32.563h3.458v7.98zM178.649 44.533a3.95 3.95 0 0 0-.196-1.26 2.908 2.908 0 0 0-.559-1.05 2.562 2.562 0 0 0-.967-.7c-.382-.178-.83-.266-1.343-.266-.999 0-1.788.285-2.367.854-.569.57-.933 1.377-1.091 2.422h6.523zm-6.593 2.086c.056.737.186 1.377.392 1.918.205.532.475.975.811 1.33.336.345.733.607 1.191.784.466.168.98.252 1.54.252s1.04-.066 1.442-.196c.41-.13.765-.276 1.063-.434.308-.159.575-.304.799-.434.233-.13.457-.196.671-.196.29 0 .504.107.644.322l.995 1.26a5.93 5.93 0 0 1-1.289 1.134 7.641 7.641 0 0 1-1.498.728 8.291 8.291 0 0 1-1.581.378c-.532.074-1.05.112-1.554.112a7.766 7.766 0 0 1-2.786-.49 6.352 6.352 0 0 1-2.24-1.47c-.635-.653-1.134-1.456-1.498-2.408-.364-.962-.546-2.072-.546-3.332 0-.98.158-1.9.476-2.758.317-.868.77-1.62 1.358-2.254a6.462 6.462 0 0 1 2.17-1.526c.858-.373 1.824-.56 2.898-.56.905 0 1.74.144 2.506.434a5.41 5.41 0 0 1 1.973 1.274c.551.55.981 1.232 1.289 2.044.317.803.475 1.722.475 2.758 0 .523-.055.877-.167 1.064-.112.177-.327.266-.644.266h-8.89zM187.615 41.495c.448-.859.98-1.53 1.596-2.016.616-.495 1.344-.742 2.184-.742.662 0 1.194.145 1.596.434l-.224 2.59c-.047.168-.117.29-.21.364a.558.558 0 0 1-.35.098c-.14 0-.35-.023-.63-.07a4.704 4.704 0 0 0-.798-.07c-.383 0-.724.056-1.022.168-.299.112-.57.275-.812.49a3.359 3.359 0 0 0-.63.756c-.178.298-.346.64-.504 1.022v8.848h-3.458V39.003h2.03c.354 0 .602.065.742.196.14.121.233.345.28.672l.21 1.624z",fill:"#121319"}),(0,a.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M49.152 10.642L30.72 0 12.288 10.642v14.152L0 31.89v21.283l18.432 10.642 12.258-7.077.03.017.03-.017 12.258 7.077L61.44 53.172V31.89l-12.288-7.095V10.642zM59.52 32.997l-12.288-7.094V11.75L30.72 2.217 14.208 11.75v14.153L1.92 32.997v19.067l16.512 9.533L30.69 54.52l.03.017.03-.017 12.258 7.077 16.512-9.533V32.997z",fill:"url(#paint0_linear_615_416)"}),(0,a.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M49.152 24.83L30.72 14.19 12.288 24.831v21.283L30.72 56.756l18.432-10.642V24.831zm-34.944 1.11l16.512-9.534 16.512 9.533v19.067L30.72 54.539l-16.512-9.533V25.939zm14.52-3.756l.484.284 12.202 7.142 1.073.61V40.4l-.408.287-.461.32-12.89 7.545-7.743-4.503.02-17.35 7.722-4.516zm-5.822 20.762l.017-15.145 5.804-3.393 11.728 6.866.112.063v8.066L28.725 46.33l-5.819-3.384zm4.04-12.717l1.442-.827L37.2 34.53v1.66l-8.845 5.146-1.443-.833.034-10.273zm7.862 5.133l-5.971 3.474.023-6.935 5.948 3.46z",fill:"url(#paint1_linear_615_416)"}),(0,a.jsxs)("defs",{children:[(0,a.jsxs)("linearGradient",{id:"paint0_linear_615_416",x1:"30.72",y1:"95.721",x2:"94.488",y2:"34.325",gradientUnits:"userSpaceOnUse",children:[(0,a.jsx)("stop",{stopColor:"#0FA4B7"}),(0,a.jsx)("stop",{offset:".495",stopColor:"#1DC1C7"}),(0,a.jsx)("stop",{offset:"1",stopColor:"#2BE0D7"})]}),(0,a.jsxs)("linearGradient",{id:"paint1_linear_615_416",x1:"27.437",y1:"99.246",x2:"97.761",y2:"44.937",gradientUnits:"userSpaceOnUse",children:[(0,a.jsx)("stop",{stopColor:"#0FA4B7"}),(0,a.jsx)("stop",{offset:".495",stopColor:"#1DC1C7"}),(0,a.jsx)("stop",{offset:"1",stopColor:"#2BE0D7"})]})]})]}))};s.defaultProps={width:"193",height:"64",viewBox:"0 0 193 64",fill:"none",xmlns:"http://www.w3.org/2000/svg"},s.displayName="launcher-logo";var c=s;n.Z=c},15959:function(e,n,t){n.Z=void 0;(r=t(5057))&&r.__esModule;var r,a=t(96266);function i(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function l(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?i(Object(t),!0).forEach((function(n){o(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):i(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function o(e,n,t){return(n=function(e){var n=function(e,n){if("object"!==typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!==typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"===typeof n?n:String(n)}(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var s=function(e){return(0,a.jsxs)("svg",l(l({},e),{},{children:[(0,a.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.152 10.642L31.72 0 13.288 10.642v14.152L1 31.89v21.283l18.432 10.642 12.258-7.077.03.017.03-.017 12.258 7.077L62.44 53.172V31.89l-12.288-7.095V10.642zM60.52 32.997l-12.288-7.094V11.75L31.72 2.217 15.208 11.75v14.153L2.92 32.997v19.067l16.512 9.533L31.69 54.52l.03.017.03-.017 12.258 7.077 16.512-9.533V32.997z",fill:"url(#paint0_linear_615_428)"}),(0,a.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.152 24.83L31.72 14.19 13.288 24.831v21.283L31.72 56.756l18.432-10.642V24.831zm-34.944 1.11l16.512-9.534 16.512 9.533v19.067L31.72 54.539l-16.512-9.533V25.939zm14.52-3.756l.484.284 12.202 7.142 1.073.61V40.4l-.408.287-.461.32-12.89 7.545-7.743-4.503.02-17.35 7.722-4.516zm-5.822 20.762l.017-15.145 5.804-3.393 11.728 6.866.112.063v8.066L29.725 46.33l-5.819-3.384zm4.04-12.717l1.442-.827L38.2 34.53v1.66l-8.845 5.146-1.443-.833.034-10.273zm7.862 5.133l-5.971 3.474.023-6.935 5.948 3.46z",fill:"url(#paint1_linear_615_428)"}),(0,a.jsxs)("defs",{children:[(0,a.jsxs)("linearGradient",{id:"paint0_linear_615_428",x1:"31.72",y1:"95.721",x2:"95.488",y2:"34.325",gradientUnits:"userSpaceOnUse",children:[(0,a.jsx)("stop",{stopColor:"#0FA4B7"}),(0,a.jsx)("stop",{offset:".495",stopColor:"#1DC1C7"}),(0,a.jsx)("stop",{offset:"1",stopColor:"#2BE0D7"})]}),(0,a.jsxs)("linearGradient",{id:"paint1_linear_615_428",x1:"28.437",y1:"99.246",x2:"98.761",y2:"44.937",gradientUnits:"userSpaceOnUse",children:[(0,a.jsx)("stop",{stopColor:"#0FA4B7"}),(0,a.jsx)("stop",{offset:".495",stopColor:"#1DC1C7"}),(0,a.jsx)("stop",{offset:"1",stopColor:"#2BE0D7"})]})]})]}))};s.defaultProps={width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg"},s.displayName="launcher-logo-notext";var c=s;n.Z=c}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[7126],{77126:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return Kr}});var r=t(33028),o=t(5057),i=t(68420),a=t(68079),l=t(59740),c=t(71171),s=t(32723),u=t(34795),d=t(96234),p=t(33518),m=t(55898),f=t.n(m),h=t(37541),x=t(39948),v=t(7278),g=t(6838),Z=t(87971),b=t(99194),y=t(67680),k=t(44919),j=t(10697),C=t(48037),P=t(34966),E=t(94552),w=t(55402),R=t(75239),T=t(48086),S=t(88092),_=t(32207),U=t(35258),I=t(27773),N=t(26174),L=t(36554),D=t(55498),O=t(35432),B=t(44846),F=t(64886),z=t(28726),q=t(25710),A=t(38242),G=t(57156),M=t.n(G),W=t(86229),K=t(87363),V=t(17450),Y=t(22228),H=t(6352),X=t.n(H),$=t(2078),J=t.n($),Q=t(19778),ee=t(38898),ne=t(96266);function te(e){var n,t=e.sourceInfo,r=e.blocklet,a=(0,o.useContext)(i.RD).t;return(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center",children:[(0,ne.jsx)(Q.Z,{type:"success",children:J()(t.source)},"source"),"registry"===t.source&&(0,ne.jsx)(ee.Z,{href:X()(t.deployedFrom,"blocklets",(null===r||void 0===r||null===(n=r.meta)||void 0===n?void 0:n.bundleDid)||""),target:"_blank",className:"page-link",underline:"hover",style:{display:"flex",alignItems:"center",marginLeft:8},children:a("blocklet.overview.viewInStore")})]})}te.propTypes={sourceInfo:f().shape({source:f().string,deployedFrom:f().string}),blocklet:f().object},te.defaultProps={sourceInfo:{},blocklet:{}};var re=t(81010),oe=t(40736),ie=t(76811),ae=t(70461),le=t(58238),ce=t(14491),se=t(63406),ue=["blocklet","checkUpgrade","hasPermission"];function de(e){var n=e.blocklet,t=e.checkUpgrade,a=e.hasPermission,c=(0,l.Z)(e,ue),p=(0,le.h6)().api,m=(0,o.useContext)(i.RD).t,f=(0,o.useState)(!1),h=(0,d.Z)(f,2),x=h[0],v=h[1],g=(0,o.useState)(""),Z=(0,d.Z)(g,2),b=Z[0],k=Z[1],j=(0,o.useState)(null),C=(0,d.Z)(j,2),P=C[0],E=C[1],w=(0,o.useState)(null),T=(0,d.Z)(w,2),S=T[0],_=T[1];(0,o.useEffect)((function(){E(null),t&&(n.mode,ie.BLOCKLET_MODES.DEVELOPMENT)}),[n,t]);var U=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(){var t;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v(!0),e.prev=1,t={did:n.meta.did,version:P.version,storeUrl:P.registryUrl||""},e.next=5,(0,ce._v)(2e3);case 5:return e.next=7,p.upgradeBlocklet({input:t});case 7:e.next=12;break;case 9:e.prev=9,e.t0=e.catch(1),W.Z.error("Blocklet upgrade failed: ".concat((0,ce.Z)(e.t0)));case 12:return e.prev=12,v(!1),_(null),e.finish(12);case 16:case"end":return e.stop()}}),e,null,[[1,9,12,16]])})));return function(){return e.apply(this,arguments)}}(),I={title:"".concat(m("common.upgrade")," ").concat(m("common.blocklet")," ").concat((0,A.getDisplayName)(n)),description:m("blocklet.action.upgradeDescription"),confirm:m("blocklet.action.confirmUpgrade"),cancel:m("common.cancel"),onConfirm:U,onCancel:function(){v(!1),_(null)}};return a&&P&&!(0,A.isInProgress)(n.status)?(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(Y.Z,(0,r.Z)((0,r.Z)({},c),{},{children:n.meta.version})),(0,ne.jsx)(R.Z,{title:m("common.updateAvailable",{version:P.version}),children:(0,ne.jsx)(y.Z,{size:"small",style:{marginLeft:8},disabled:x,onClick:function(){return _(I)},children:x?(0,ne.jsx)(B.Z,{size:16}):(0,ne.jsx)(oe.Z,{style:{fontSize:16,color:"red"}})})}),!!b&&(0,ne.jsx)(W.Z,{variant:"error",message:b,onClose:function(){return k("")}}),S&&(0,ne.jsx)(ae.Z,{title:S.title,description:S.description,confirm:S.confirm,cancel:S.cancel,params:S.params,onConfirm:S.onConfirm,onCancel:S.onCancel})]}):(0,ne.jsx)(Y.Z,(0,r.Z)((0,r.Z)({},c),{},{children:n.meta.version}))}de.propTypes={blocklet:f().object.isRequired,checkUpgrade:f().bool,hasPermission:f().bool},de.defaultProps={checkUpgrade:!1,hasPermission:!1};var pe=(0,se.V)(de,"mutate_blocklets"),me=(0,se.V)(de,"",ce.Wf);function fe(e){return(0,le.h6)().inService?(0,ne.jsx)(me,(0,r.Z)({},e)):(0,ne.jsx)(pe,(0,r.Z)({},e))}var he,xe,ve=t(80378),ge=t(32349),Ze=t(76667),be=t(13128),ye=t(94464),ke=t(28358),je=t(47020),Ce=t(93938),Pe=t(50185),Ee=t(35918),we=t(74782),Re=t(55419),Te=function(e,n){var t=e.description;return(Object.values(ie.CHAIN_PROP_MAP).includes(e.key)||(0,A.isEnvShareable)(e))&&(t=t?"".concat(t," (").concat(n("blocklet.config.sharedToAllComponents"),")"):n("blocklet.config.sharedToAllComponents")),t&&(0,ne.jsx)("div",{style:{marginLeft:12},children:t})},Se=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return!(null!==t&&void 0!==t&&t.length||e.custom||["CHAIN_ID","CHAIN_HOST"].includes(e.key)||n.meta.environments.find((function(n){return n.name===e.key}))||!n.children.every((function(n){return!n.meta.environments.find((function(n){return n.name===e.key}))})))||e.custom};function _e(e){var n=e.blocklet,t=e.ancestors,l=(0,le.h6)(),c=l.inService,d=(0,o.useContext)(i.RD).t,p=[].concat((0,a.Z)(t.map((function(e){return e.meta.did}))),[n.meta.did]),m=function(){return W.Z.success(d("blocklet.config.changedTip"))},f=function(e){return Se(e,n,t)};if((0,ce.wS)(n.status))return null;if("unknown"===n.status&&(0,ce.wS)(n.status))return null;var h=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(n){var t;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.key.trim()&&n.value.trim()){e.next=3;break}return W.Z.error(d("blocklet.config.environment.keyValueRequired")),e.abrupt("return");case 3:if(!n.key.startsWith("BLOCKLET_")&&!n.key.startsWith("COMPONENT_")){e.next=6;break}return W.Z.error(d("blocklet.config.environment.invalidKey")),e.abrupt("return");case 6:return n.custom=!0,e.next=9,l.api.configBlocklet({input:{did:p,configs:[n]}});case 9:"ok"===(t=e.sent).code&&m(t.blocklet);case 11:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),x=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(r,o){var i,a,c;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r.required||r.key.trim()&&r.value.trim()){e.next=3;break}return W.Z.error(d("blocklet.config.environment.keyValueRequired")),e.abrupt("return");case 3:if(!r.key.startsWith("BLOCKLET_")||ie.BLOCKLET_CONFIGURABLE_KEY[r.key]){e.next=6;break}return W.Z.error(d("blocklet.config.environment.invalidKey")),e.abrupt("return");case 6:if(r.key!==ie.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){e.next=11;break}if(!(i=(0,ce.I)(r))){e.next=11;break}return W.Z.error(i),e.abrupt("return");case 11:if(a=[r],r.key===o.key){e.next=17;break}if(Se(r,n,t)){e.next=16;break}return W.Z.error("Only key of custom env can be changed"),e.abrupt("return");case 16:a.push({key:o.key,custom:!0});case 17:return e.prev=17,e.next=20,l.api.configBlocklet({input:{did:p,configs:a}});case 20:"ok"===(c=e.sent).code&&m(c.blocklet),e.next=27;break;case 24:e.prev=24,e.t0=e.catch(17),W.Z.error((0,ce.Z)(e.t0));case 27:case"end":return e.stop()}}),e,null,[[17,24]])})));return function(n,t){return e.apply(this,arguments)}}(),v=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(r){var o;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r.required){e.next=3;break}return W.Z.error(d("blocklet.config.environment.deleteForbidden")),e.abrupt("return");case 3:if(Se(r,n,t)){e.next=6;break}return W.Z.error("Only key of custom env can be changed"),e.abrupt("return");case 6:return e.next=8,l.api.configBlocklet({input:{did:p,configs:[{key:r.key,custom:!0}]}});case 8:"ok"===(o=e.sent).code&&m(o.blocklet);case 10:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),g=(n.configs||[]).filter((function(e){return!ie.BLOCKLET_CONFIGURABLE_KEY[e.key]})),Z=(0,A.getSharedConfigObj)(t[0],n),b=(0,A.getComponentMissingConfigs)(n,t[0]),y=g.map((function(e){return(0,r.Z)((0,r.Z)({},e),{},{value:Object.values(ie.CHAIN_PROP_MAP).includes(e.key)&&Object.keys(Z).includes(e.key)?Z[e.key]:Z[e.key]||e.value})})),k=y.some((function(e){return e.key&&e.key.startsWith("BWA_")})),j={onRowAdd:h,onRowUpdate:x,onRowDelete:v,isDeletable:f};return(0,ne.jsxs)(Ie,{children:[!!b.length&&(0,ne.jsx)(Ce.Z,{severity:"error",style:{marginTop:24},children:d("blocklet.config.missingRequired")}),k&&(0,ne.jsx)(Ce.Z,{severity:"info",children:d("blocklet.config.environment.tip")}),(0,ne.jsx)(se.Z,{permission:c?"":"mutate_blocklets",role:c?ce.Wf:[],children:function(e){return(0,ne.jsx)(we.Z,{className:"config-table",children:(0,ne.jsx)(ke.ZP,{title:(0,ne.jsx)("h4",{children:d("common.environment")}),columns:[{title:d("common.key"),field:"key",initialEditValue:"Key",width:"30%",render:function(e){return(0,ne.jsx)(Pe.Z,{value:e.value,style:{color:e.required&&!e.value?"#ff4436":"#222222",fontWeight:e.required?"bold":"normal"},children:e.key})},editComponent:function(e){var n=e.value,t=e.rowData,r=e.onChange;return(0,ne.jsx)(Ne,{children:(0,ne.jsx)(je.Z,{fullWidth:!0,size:"small",disabled:!1===f(t),value:n,onChange:function(e){return r(e.target.value)},variant:"outlined",label:"Key",placeholder:d("blocklet.config.environment.key"),margin:"dense",autoFocus:!0})})}},{title:d("common.value"),field:"value",initialEditValue:"Value",width:"calc((100% - (96px + 30%)) / 1)",render:function(e){return e.value?e.secure?"******":(0,ne.jsx)(Pe.Z,{unstyled:!0,value:e.value,style:{wordBreak:"break-all"},children:e.value}):null},editComponent:function(e){var n=e.value,t=e.rowData,r=e.onChange;return(0,ne.jsxs)(Ne,{children:[(0,ne.jsx)(je.Z,{fullWidth:!0,size:"small",value:"__encrypted__"===n?"":n,onChange:function(e){return r(e.target.value)},variant:"outlined",label:d("common.value"),placeholder:d("blocklet.config.environment.value"),margin:"dense",autoFocus:!0}),Te(t,d)]})}}],icons:(0,r.Z)((0,r.Z)({},Re.Z),Ee.Z),options:{emptyRowsWhenPaging:!1,actionsColumnIndex:-1,tableLayout:"auto",maxBodyHeight:"100%",paging:!1,search:!1},localization:{header:{actions:d("common.actions")},body:{emptyDataSourceMessage:d("common.noData")}},data:y,editable:e?j:{}})})}})]})}_e.propTypes={blocklet:f().object.isRequired,ancestors:f().array},_e.defaultProps={ancestors:[]};var Ue,Ie=p.Z.div(he||(he=(0,c.Z)(["\n .config-table {\n margin-bottom: 24px;\n position: relative;\n .hide-control {\n position: absolute;\n top: 10px;\n left: 200px;\n @media (max-width: ","px) {\n left: 160px;\n }\n }\n\n .MuiToolbar-root {\n display: flex;\n }\n\n .MuiTableRow-head {\n display: none;\n }\n\n &.hide-header {\n .MuiToolbar-root {\n display: none;\n }\n }\n }\n\n .accordion {\n margin-bottom: 16px;\n &:last-of-type {\n margin-bottom: 0;\n }\n padding: 8px 0 8px 0px;\n &.MuiAccordion-root {\n background: transparent;\n box-shadow: none;\n border: 1px solid #ddd;\n border-radius: 4px;\n &::before,\n &::after {\n height: 0;\n }\n .MuiAccordionSummary-root {\n padding-left: 0;\n }\n .accordion-title {\n font-weight: bold;\n padding-left: 16px;\n }\n }\n }\n"])),(function(e){return e.theme.breakpoints.values.sm})),Ne=p.Z.div(xe||(xe=(0,c.Z)(["\n height: 60px;\n"]))),Le=t(45239),De=t(28641),Oe=["blocklet","ancestors","hasPermission"];function Be(e){var n=e.blocklet,t=e.ancestors,a=e.hasPermission,c=(0,l.Z)(e,Oe),p=(0,i.PE)().t,m=(0,le.h6)().api,f=!t.length,h=f?n.meta.did:t.map((function(e){return e.meta.did}))[0],v=(0,o.useState)(""),g=(0,d.Z)(v,2),Z=g[0],b=g[1],y=(0,o.useState)(""),k=(0,d.Z)(y,2),j=k[0],C=k[1],P=Z||!a;if(!h)return null;if("unknown"===n.status&&(0,ce.wS)(n.status))return null;var E=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(t){var r;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return b(!0),e.prev=1,r={rootDid:h,mountPoint:(0,Le.default)(t)},f||(r.did=n.meta.did),e.next=6,m.updateComponentMountPoint({input:r});case 6:return b(!1),e.abrupt("return",!0);case 10:throw e.prev=10,e.t0=e.catch(1),b(!1),e.t0.message=(0,ce.Z)(e.t0),W.Z.error(e.t0.message),e.t0;case 16:case"end":return e.stop()}}),e,null,[[1,10]])})));return function(n){return e.apply(this,arguments)}}();return(0,ne.jsx)(Ge,(0,r.Z)((0,r.Z)({component:"div"},c),{},{children:(0,ne.jsx)(x.Z,{mt:3,children:(0,ne.jsx)(De.Z,{label:p("blocklet.component.mountPoint"),style:{marginTop:-24},disabled:Z||P,loading:Z,required:!0,initialValue:n.mountPoint,onSubmit:E,onChange:function(e){C(p("common.slugifyHint",{value:(0,ce.LN)(e)}))},helperText:j,formatterBeforeSubmit:function(e){return(0,Le.default)(e)}})})}))}var Fe=(0,se.V)(Be,"mutate_blocklets"),ze=(0,se.V)(Be,"",ce.Wf);function qe(e){return(0,le.h6)().inService?(0,ne.jsx)(ze,(0,r.Z)({},e)):(0,ne.jsx)(Fe,(0,r.Z)({},e))}Be.propTypes={blocklet:f().object.isRequired,ancestors:f().array,hasPermission:f().bool},Be.defaultProps={ancestors:[],hasPermission:!1};var Ae,Ge=p.Z.div(Ue||(Ue=(0,c.Z)([""])));function Me(e){var n=e.blocklet,t=e.ancestors,r=e.children,a=(0,o.useState)(""),l=(0,d.Z)(a,2),c=l[0],s=l[1],u=(0,i.PE)().t,p=!!t.length,m=(0,o.useState)("settings"),f=(0,d.Z)(m,2),h=f[0],v=f[1],g=p?(0,A.getDisplayName)(n,!0):u("blocklet.component.container");if((0,ce.wS)(n.status))return null;if("unknown"===n.status&&(0,ce.wS)(n.status))return null;var Z=function(e){e.stopPropagation(),s(!0)},b={settings:{label:u("blocklet.component.setting"),value:"settings",component:(0,ne.jsx)(qe,{blocklet:n,ancestors:t})},environments:{label:u("common.environment"),value:"environments",component:(0,ne.jsx)(_e,{blocklet:n,ancestors:t})}},k=Object.values(b).map((function(e){return{label:e.label,value:e.value}})),j=b[h]||b.settings;return["function"===typeof r?r({open:Z}):(0,ne.jsx)(y.Z,{onClick:Z,"data-cy":"action-config-component",children:(0,ne.jsx)(Ze.default,{})}),c&&(0,ne.jsx)(Ke,{open:!0,fullWidth:!0,maxWidth:"md",title:g,onClose:function(){s(!1)},PaperProps:{style:{minHeight:"auto"}},children:p?(0,ne.jsxs)(x.Z,{mt:1,children:[(0,ne.jsx)(ye.Z,{tabs:k,current:h,onChange:function(e){v(e)},scrollButtons:"auto"}),j.component]}):(0,ne.jsx)(_e,{blocklet:n,ancestors:t})})]}Me.propTypes={blocklet:f().object.isRequired,ancestors:f().array,children:f().any},Me.defaultProps={ancestors:[],children:null};var We,Ke=(0,p.Z)(be.ZP)(Ae||(Ae=(0,c.Z)(["\n .MuiDialogContent-root {\n padding-top: 0;\n margin-top: -32px;\n }\n .MuiToolbar-root {\n padding-right: 12px;\n }\n .ux-dialog_right {\n padding-right: 20px;\n }\n"]))),Ve=t(11750),Ye=t(65140),He=t(87916);function Xe(e){var n=e.component,t=e.remove,a=e.disabled,l=e.tip,c=e.showConfirm,p=e.hideBtn,m=e.onCancel,f=(0,o.useContext)(i.RD).t,h=(0,o.useState)(!1),x=(0,d.Z)(h,2),v=x[0],g=x[1],Z=(0,o.useState)(null),b=(0,d.Z)(Z,2),y=b[0],k=b[1],j=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(n){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g(!0),e.next=3,t(n.component,n.removeType);case 3:g(!1),k(null);case 5:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),C=a||v,P=function(){k({title:"".concat(f("common.delete")," ").concat(n.meta.title||n.meta.name),description:function(e,n){return(0,ne.jsxs)(Ve.Z,{component:"div",children:[(0,ne.jsx)(Ve.Z,{gutterBottom:!0,children:f("blocklet.action.removeComponentDescription")}),(0,ne.jsxs)(He.Z,{name:"removeType",value:e.removeType,onChange:function(t){return n((0,r.Z)((0,r.Z)({},e),{},{removeType:t.target.value}))},children:[(0,ne.jsx)(N.Z,{value:"keepData",control:(0,ne.jsx)(Ye.Z,{}),label:f("blocklet.action.removeComponentKeepData")}),(0,ne.jsx)(N.Z,{value:"complete",control:(0,ne.jsx)(Ye.Z,{}),label:f("blocklet.action.removeComponentComplete")})]})]})},confirm:f("common.confirm"),cancel:f("common.cancel"),params:{component:n,removeType:"keepData"},onConfirm:j,onCancel:function(){k(null),m()}})};(0,o.useEffect)((function(){c?P():(g(!1),k(null))}),[c]);var E=(0,ne.jsx)(Je,{size:"small",disabled:C,onClick:function(){return P},"data-cy":"delete-component-btn",children:(0,ne.jsx)(I.default,{disabled:C})}),w=(0,ne.jsx)(R.Z,{title:l||f("common.delete"),children:(0,ne.jsx)("span",{children:E})});return(0,ne.jsxs)(ne.Fragment,{children:[!p&&w,y&&(0,ne.jsx)(ae.Z,{title:y.title,description:y.description,confirm:y.confirm,cancel:y.cancel,params:y.params,onConfirm:y.onConfirm,onCancel:y.onCancel})]})}Xe.propTypes={component:f().object.isRequired,remove:f().func,onCancel:f().func,disabled:f().bool,showConfirm:f().bool,hideBtn:f().bool,tip:f().string},Xe.defaultProps={remove:function(){var e=(0,u.Z)((0,s.Z)().mark((function e(){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),disabled:!1,showConfirm:!1,hideBtn:!1,onCancel:function(){},tip:""};var $e,Je=(0,p.Z)(y.Z)(We||(We=(0,c.Z)(["\n &.Mui-disabled {\n opacity: 0.5;\n }\n"]))),Qe=t(22754),en=t(98451);function nn(e){var n=e.component,t=e.onStart,r=e.onStop,a=e.disabled,l=e.tip,c=(0,o.useContext)(i.RD).t,p=(0,o.useState)(!1),m=(0,d.Z)(p,2),f=m[0],h=m[1],x=(0,o.useState)(),v=(0,d.Z)(x,2),g=v[0],Z=v[1],b=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return h(!0),e.prev=1,e.next=4,t(n);case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),W.Z.error(e.t0.message);case 9:h(!1);case 10:case"end":return e.stop()}}),e,null,[[1,6]])})));return function(){return e.apply(this,arguments)}}(),y=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return h(!0),e.prev=1,e.next=4,r(n);case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),W.Z.error(e.t0.message);case 9:h(!1);case 10:case"end":return e.stop()}}),e,null,[[1,6]])})));return function(){return e.apply(this,arguments)}}(),k=a||f,j=["starting","running","stopping"].includes(n.status),C=j?en.Z:Qe.Z,P=(0,ne.jsx)(tn,{disabled:k,onClick:function(){var e;j?Z({title:"".concat(c("common.stop")," ").concat(null===n||void 0===n||null===(e=n.meta)||void 0===e?void 0:e.title),description:c("blocklet.action.stopComponentDescription"),confirm:c("blocklet.action.confirmStop"),cancel:c("common.cancel"),onConfirm:function(){return Z(null),y()},onCancel:function(){return Z(null)}}):b()},"data-cy":"".concat(j?"stop":"start","-component-btn"),children:(0,ne.jsx)(C,{disabled:k})});return[(0,ne.jsx)(R.Z,{title:l||c("common.".concat(j?"stop":"start")),children:(0,ne.jsx)("span",{children:P})},"btn"),g&&(0,ne.jsx)(ae.Z,{title:g.title,description:g.description,confirm:g.confirm,cancel:g.cancel,params:g.params,onConfirm:g.onConfirm,onCancel:g.onCancel},"connect")]}nn.propTypes={component:f().object.isRequired,onStart:f().func,onStop:f().func,disabled:f().bool,tip:f().string},nn.defaultProps={onStart:function(){var e=(0,u.Z)((0,s.Z)().mark((function e(){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),onStop:function(){var e=(0,u.Z)((0,s.Z)().mark((function e(){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),disabled:!1,tip:""};var tn=(0,p.Z)(y.Z)($e||($e=(0,c.Z)(["\n &.Mui-disabled {\n opacity: 0.5;\n }\n"]))),rn=t(74286),on=t(30278),an=t.n(on),ln=t(79077),cn=t.n(ln),sn=t(75506),un=t.n(sn),dn=t(3785),pn=t.n(dn),mn=t(2660),fn=t(55372),hn=t(74490),xn=t(33271),vn=t(42876),gn=t(72904),Zn=t(63902),bn=t(51703),yn=t(88574),kn=t(35266),jn=t(55309),Cn=t(29054),Pn=t(56666),En=t(24558),wn=t(13727),Rn=t(56184),Tn=t(11819),Sn=t(67486),_n={description:f().string,editing:f().bool,onChange:f().func,required:f().bool,value:f().any,componentProps:f().object,render:f().func,renderFormItem:f().func};function Un(e){var n=e.editing,t=e.value,r=e.onChange,i=(0,o.useState)(!1),a=(0,d.Z)(i,2),l=a[0],c=a[1],s=(0,o.useRef)(),u=(0,o.useRef)(t);(0,o.useEffect)((function(){var e=null;return n&&(e=setTimeout((function(){c(!0)}),50)),function(){clearTimeout(e)}}),[n]);var p=function(e){u.current=e,r(e)},m=(0,ne.jsx)(x.Z,{className:"form-item-input slot",px:1,children:(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center",children:[t,"auto"!==t&&(0,ne.jsx)("div",{style:{marginLeft:4,backgroundColor:t,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),f=(0,ne.jsxs)(x.Z,{display:"flex",flexGrow:1,alignItems:"center",height:"40px",onKeyDown:function(){c(!1),r(u.current)},children:[(0,ne.jsx)(x.Z,{display:"flex",alignItems:"center",onClick:function(){return c(!0)},children:(0,ne.jsx)("div",{ref:s,style:{flexShrink:0,marginLeft:"8px",backgroundColor:t,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:"auto"===t?"default":"pointer"}})}),(0,ne.jsx)(Tn.ZP,{open:l,anchorEl:s.current,onClose:function(){return c(!1)},anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:(0,ne.jsx)(Sn.AI,{color:t,onChange:function(e){return p(e.hex)}})})]});return n?f:m}Un.propTypes=_n;var In=["editing","description","value","onChange","componentProps"];function Nn(e){var n=e.editing,t=e.description,i=e.value,a=e.onChange,c=e.componentProps,s=(0,l.Z)(e,In),u=c.placeholder,d=(0,o.useRef)(i),p=function(e){d.current=e,a(e)};return n?(0,ne.jsx)(je.Z,(0,r.Z)({style:{flex:1},fullWidth:!0,value:i,onChange:function(e){e.persist(),p(e.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:t||u,onKeyDown:function(e){"Enter"===e.key&&a(d.current,"confirm")}},s)):(0,ne.jsx)(x.Z,{px:1,className:"form-item-input slot",children:i})}Nn.propTypes=_n,Nn.defaultProps={componentProps:{}};var Ln=t(49777),Dn=t.n(Ln),On=t(76818),Bn=["editing","value","onChange","componentProps"];function Fn(e){var n=e.editing,t=e.value,o=e.onChange,i=e.componentProps,a=(0,l.Z)(e,Bn),c=i.blocklet,s="auto"===t?(0,On.getPassportColorFromDid)(c.appDid):t;return(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center",children:[(0,ne.jsx)("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:Dn()({title:"Owner",issuer:(0,A.getDisplayName)(c),issuerDid:c.appDid,ownerName:"Your Name",ownerDid:c.appDid,preferredColor:t||"auto"})}}),(0,ne.jsx)(Un,(0,r.Z)((0,r.Z)({},a),{},{editing:n,value:n?s:t,onChange:o,componentProps:i}))]})}Fn.propTypes=(0,r.Z)((0,r.Z)({},_n),{},{componentProps:f().shape({blocklet:f().object.isRequired}).isRequired}),Fn.defaultProps={};var zn,qn=t(35406),An=t(11875);function Gn(e){var n=e.schema,t=e.loading,i=e.value,a=e.defaultValue,l=e.onChange,c=e.style,s=e.disabled,u="[object Object]"===Object.prototype.toString.call(i),p=(0,o.useState)(null),m=(0,d.Z)(p,2),f=m[0],h=m[1],v=(0,o.useState)(u?i:a),g=(0,d.Z)(v,2),Z=g[0],b=g[1],k=(0,o.useRef)();function j(e,n,t){var o=e.key,i=e.secure,a=Z[o]!==n,c=(0,r.Z)((0,r.Z)({},Z),{},(0,Pn.Z)({},o,n));a&&b(c),l((0,Pn.Z)({},o,n),{allValues:c,action:t,currentItem:e}),"confirm"===t&&i&&b((0,r.Z)((0,r.Z)({},Z),{},(0,Pn.Z)({},o,"__encrypted__"))),["confirm","cancel"].includes(t)?C(null):C(e)}function C(e){if(e)return k.current=Z[e.key],void h(e);k.current=null,h(null)}return(0,ne.jsx)(Mn,{className:"form",style:c,children:null===n||void 0===n?void 0:n.map((function(e){var n=e.key,o=e.description,a=e.required,l=e.hidden,c=void 0!==l&&l,d=e.componentProps,p=void 0===d?{}:d;if(c)return null;var m=!(!f||n!==f.key),h=function(e,n){var t=n.editing,r=void 0!==t&&t,o=e.key,a=u?i[o]:Z[o];return"__encrypted__"===a?r?"":"******":a}(e,{editing:m}),v=function(e,n){var t=n.editing,r=void 0!==t&&t,o=e.componentType,i=void 0===o?"input":o,a=e.render,l=e.renderFormItem;return r&&l?l:!r&&a?a:{input:Nn,color:Un,passport:Fn}[null===i||void 0===i?void 0:i.toLowerCase()]}(e,{editing:m}),g={inputProps:{"data-cy":"schema-form-item-component"},key:n,description:o,editing:m,value:h,onChange:function(n){return j(e,n,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"change")},componentProps:p};return(0,ne.jsxs)(x.Z,{className:"form-item",children:[(0,ne.jsxs)(x.Z,{className:"form-item-label",style:{color:a&&!h?"#ff0000":"#333"},children:[o,a&&(0,ne.jsx)(qn.Z,{})]}),(0,ne.jsxs)(x.Z,{className:"form-item-body",children:[(0,ne.jsx)(x.Z,{className:"form-item-input",children:(0,ne.jsx)(v,(0,r.Z)({},g))}),(0,ne.jsx)(x.Z,{className:"form-item-action",children:m?(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(y.Z,{"data-cy":"schema-form-item-confirm",onClick:function(){j(e,h,"confirm")},disabled:s||t,size:"large",children:t?(0,ne.jsx)(B.Z,{size:24}):(0,ne.jsx)(Rn.Z,{})}),(0,ne.jsx)(y.Z,{"data-cy":"schema-form-item-cancel",onClick:function(){j(e,k.current,"cancel")},disabled:s||t,size:"large",children:(0,ne.jsx)(wn.default,{})})]}):(0,ne.jsx)(y.Z,{"data-cy":"schema-form-item-edit",onClick:function(){j(e,Z[n],"edit")},disabled:s||f,size:"large",children:(0,ne.jsx)(En.Z,{})})})]})]},n)}))})}Gn.propTypes={schema:f().array.isRequired,loading:f().bool,onChange:f().func.isRequired,value:f().object,defaultValue:f().object,style:f().object,disabled:f().bool},Gn.defaultProps={loading:!1,value:void 0,defaultValue:{},style:{},disabled:!1};var Mn=(0,p.Z)(An.Z)(zn||(zn=(0,c.Z)([""]))),Wn=t(55152),Kn=t(28018),Vn=t.n(Kn),Yn=t(60344),Hn=t(73170),Xn=["mode"];function $n(e){var n=e.meta,t=e.onCancel,a=e.mode,l=e.handlePaySuccess,c=(0,i.PE)(),p=c.t,m=c.locale,f=(0,le.h6)().info,h=(0,ce.yP)(f),x=(0,o.useState)(null),v=(0,d.Z)(x,2),g=v[0],Z=v[1],b=new URL(null===n||void 0===n?void 0:n.registryUrl).origin,y=(0,A.getDisplayName)({meta:n}),k=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(n,r){var o,i,c,d,m;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c=function(e){return Vn()((function(){return Yn.hi.get(e).then(function(){var e=(0,u.Z)((0,s.Z)().mark((function e(n){var t,r;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=n.data,r=null===t||void 0===t?void 0:t.downloadTokenList,"succeed"!==t.status){e.next=12;break}if(!r||!r.length){e.next=8;break}return e.next=6,o({downloadTokenList:r});case 6:e.next=11;break;case 8:return e.next=10,i(p("blocklet.component.missDownloadTokenTip"));case 10:case 11:case 16:return e.abrupt("return",!0);case 12:if("error"!==t.status){e.next=17;break}return console.error("vc error: ",t),e.next=16,i(null===t||void 0===t?void 0:t.error);case 17:return e.abrupt("return",!1);case 18:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}())}),{interval:1e3})},o=function(e){var n=e.downloadTokenList;l({downloadTokenList:n})},i=function(e){W.Z.error(e),t(e)},"purchase"!==a||!g){e.next=9;break}return d=(0,ce.Pi)(g),m=d.statusUrl,e.next=7,c(m);case 7:e.next=11;break;case 9:return e.next=11,o({downloadTokenList:n.downloadTokenList&&r(n.downloadTokenList)});case 11:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}();if((0,o.useEffect)((function(){if("purchase"===a){var e=new URL(b);e.pathname="/api/did/verify-purchase-blocklet/token",e.searchParams.set("serverDid",f.did),e.searchParams.set("blockletDid",null===n||void 0===n?void 0:n.did);try{Yn.hi.get(e.href).then((function(e){var n=e.data,t="".concat(n.url);Z(t)}))}catch(t){console.error("get next workflow url error: ",t)}}return function(){Z(null)}}),[a]),"purchase"===a&&!g)return"";var j={verify:{action:"verify-purchase-blocklet",checkFn:Yn.od.create({baseURL:b}).get,extraParams:{serverDid:f.did,blockletDid:null===n||void 0===n?void 0:n.did},messages:{title:p("store.purchase.verify.auth.title",{name:y}),scan:p("store.purchase.verify.auth.scan"),confirm:p("store.purchase.verify.auth.confirm"),success:p("store.purchase.verify.auth.success")}},purchase:{action:"acquire-asset",checkFn:Yn.od.create({baseURL:X()(b,"/store")}).get,extraParams:{factory:n.nftFactory,nw:g},messages:{title:p("store.purchase.auth.title",{name:y}),scan:p("store.purchase.auth.scan"),confirm:p("store.purchase.auth.confirm"),success:(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)("p",{children:p("store.purchase.auth.success")}),(0,ne.jsx)("p",{children:p("blocklet.component.purchaseComponentSecondCheckTip")})]})}}};return(0,ne.jsx)(Wn.default,(0,r.Z)({open:!0,locale:m,popup:!1,saveConnect:!1,className:"connect",baseUrl:b,onSuccess:k,cancelWhenScanned:t,onClose:t,checkTimeout:3e5,webWalletUrl:h,disableClose:!0,showDownload:!1},j[a]))}$n.propTypes=(0,r.Z)((0,r.Z)({},Hn.$7),{},{handlePaySuccess:f().func,mode:f().oneOf(["verify","purchase"]).isRequired}),$n.defaultProps={handlePaySuccess:function(){}};var Jn=(0,o.forwardRef)((function(e,n){var t=e.mode,i=(0,l.Z)(e,Xn),a=(0,o.useState)("both"!==t?t:"verify"),c=(0,d.Z)(a,2),s=c[0],u=c[1],p=(0,o.useState)("both"!==t?2:1),m=(0,d.Z)(p,2),f=m[0],h=m[1],x=function(){s&&2!==f&&h(2)};return(0,o.useImperativeHandle)(n,(function(){return{onNext:x,getCurrentStep:function(){return f}}})),1===f?(0,ne.jsx)("div",{style:{maxWidth:520},children:(0,ne.jsx)(Hn.AP,{action:s,onNext:null,onSelect:function(e){e!==s&&u(e)}})}):(0,ne.jsx)($n,(0,r.Z)((0,r.Z)({},i),{},{mode:s}))}));Jn.propTypes={mode:f().oneOf(["both","verify","purchase"]).isRequired,ref:f().any},Jn.defaultProps={ref:{}};var Qn,et=Jn,nt=t(51233),tt=t(31440),rt=t(61813),ot=t(49390),it=t(67654),at=t(5952),lt=t(22714),ct=t(45170);function st(e){var n=e.onChange,t=e.loading,r=e.children,a=e.extra,l=(0,i.PE)().t,c=(0,le.h6)(),s=c.info,u=c.inService,p=(0,Cn.y0)().blocklet,m=(0,o.useState)(!1),f=(0,d.Z)(m,2),h=f[0],x=f[1],v=(0,o.useRef)(null),g=u?at.K:at.W,Z=(0,it.Z)(g),b=(0,d.Z)(Z,2),y=b[0],k=b[1],j=(0,ce.dX)({fromBlocklet:u,blocklet:p,nodeInfo:s}),C=j.storeList,P=j.teamDid,E=y&&C.find((function(e){return y===e.url}))||C[0],w=s.mode===O.NODE_MODES.SERVERLESS;return(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsxs)(dt,{children:[(0,ne.jsx)(z.Z,{ref:v,color:"secondary","data-cy":"add-component-select-store",endIcon:(0,ne.jsx)(ot.Z,{color:"secondary"}),onClick:function(){x(!0)},style:{padding:"0 2px"},children:(0,ne.jsx)(Ve.Z,{color:"secondary",children:E.name})}),(0,ne.jsx)(Ve.Z,{color:"secondary",children:a})]}),(0,ne.jsxs)(je.Z,{id:"mui-registry-select",select:!0,autoComplete:"off",variant:"outlined",name:"did",helperText:l("blocklet.component.selectRegistryTip"),"data-cy":"component-registry-select",fullWidth:!0,value:E,autoFocus:!0,onChange:function(e){var t=e.target.value;k(t.url),n(t)},SelectProps:{open:h,MenuProps:{anchorEl:v.current},renderValue:function(e){return null===e||void 0===e?void 0:e.name},onClose:function(){x(!1)}},style:{display:"none"},margin:"normal",children:[null===C||void 0===C?void 0:C.map((function(e){return(0,ne.jsx)(hn.Z,{value:e,"data-cy":e.url,children:(0,ne.jsx)(ct.Z,{teamDid:P,store:e,onDelete:function(){var n;y===e.url&&k(null===(n=C[0])||void 0===n?void 0:n.url)}})},e.url)})),!w&&(0,ne.jsx)(lt.Z,{disabled:t,storeList:C,teamDid:P,onAdd:function(e){k(e)}})]}),r({currentRegistry:E})]})}st.propTypes={onChange:f().func,loading:f().bool,children:f().any.isRequired,extra:f().node},st.defaultProps={onChange:function(){},loading:!1,extra:""};var ut,dt=p.Z.div(Qn||(Qn=(0,c.Z)(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 16px;\n\n span {\n font-size: 16px;\n color: ",";\n // font-weight: bold;\n }\n"])),(function(e){return e.theme.palette.common.black})),pt=t(71569),mt=t(52439),ft=t(61951),ht=t(44727),xt=["handleButtonClick","handleSearchSelect","storeUrl","handleBlockletRender","extraFilter","serverVersion"],vt=function(e,n){return X()(n,"/blocklets/".concat(e.did))},gt=function(e){var n=e.blocklet,t=e.attribute,r=e.value;return n._formatted?n._formatted[t]:r},Zt=function(e){return e.inStore&&!1===(0,A.isFreeBlocklet)(e)};function bt(e){var n=e.blocklet,t=e.blocklets,r=e.handleButtonClick,a=e.endpoint,l=(0,i.PE)().t,c=X()(a,(0,ce.lk)(n.did,n.logo||"")),p=(0,o.useState)(!1),m=(0,d.Z)(p,2),f=m[0],h=m[1],x=Zt(n)?l("common.purchase"):l("blocklet.component.choose"),v=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(o){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o.preventDefault(),o.stopPropagation(),e.prev=2,h(!0),e.next=6,r({meta:n,registryUrl:a,blocklets:t});case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(2),W.Z.error(e.t0.message);case 11:return e.prev=11,h(!1),e.finish(11);case 14:case"end":return e.stop()}}),e,null,[[2,8,11,14]])})));return function(n){return e.apply(this,arguments)}}();return(0,ne.jsx)(ee.Z,{href:vt(n,a),style:{color:"initial",textDecoration:"none"},onClick:function(e){return!!e.currentTarget.contains(e.target)||(e.preventDefault(),!1)},target:"_blank",children:(0,ne.jsx)(jt,{title:gt({blocklet:n,attribute:"title",value:n.title||n.name}),did:n.did,description:gt({blocklet:n,attribute:"description",value:n.description}),cover:n.logo?c:"",version:n.version,button:(0,ne.jsx)("div",{style:{display:"flex",alignItems:"center"},children:(0,ne.jsx)(ht.Kk,{children:(0,ne.jsx)(z.Z,{onClick:v,size:"small",disabled:f,variant:"outlined",color:"primary","data-cy":"install-blocklet",children:f?(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(B.Z,{size:16,style:{marginRight:3}}),x]}):x},n.did)})})})})}function yt(e){var n=e.handleButtonClick,t=e.handleSearchSelect,a=e.storeUrl,c=e.handleBlockletRender,s=e.extraFilter,u=e.serverVersion,p=(0,l.Z)(e,xt),m=(0,i.PE)().locale,f=(0,o.useState)({}),h=(0,d.Z)(f,2),x=h[0],v=h[1],g=a;return(0,o.useEffect)((function(){v({})}),[g]),(0,ne.jsx)(mt.ErrorBoundary,{FallbackComponent:pt.H,resetKeys:[g],children:(0,ne.jsx)("div",(0,r.Z)((0,r.Z)({},p),{},{children:(0,ne.jsx)(ft.Z,{blockletRender:function(e){var t=(0,r.Z)((0,r.Z)({},e),{},{handleButtonClick:n,endpoint:g});return c((0,r.Z)((0,r.Z)({},e),{},{defaultRender:(0,ne.jsx)(bt,(0,r.Z)({},t))}))},baseSearch:!0,endpoint:g,locale:m,onFilterChange:function(e){v(e)},onSearchSelect:t,filters:x,extraFilter:s,serverVersion:u})}))})}bt.propTypes={blocklet:f().object.isRequired,blocklets:f().array,handleButtonClick:f().func,endpoint:f().string},bt.defaultProps={handleButtonClick:null,endpoint:"",blocklets:[]},yt.propTypes={storeUrl:f().string.isRequired,handleButtonClick:f().func,handleSearchSelect:f().func,handleBlockletRender:f().func,extraFilter:f().func,serverVersion:f().string},yt.defaultProps={handleButtonClick:null,handleSearchSelect:null,handleBlockletRender:null,extraFilter:void 0,serverVersion:""};var kt,jt=(0,p.Z)(ht.ZP)(ut||(ut=(0,c.Z)(["\n .ms-highlight {\n color: ",";\n }\n"])),(function(e){return e.theme.palette.primary.main})),Ct=t(10458),Pt=t.n(Ct),Et=t(65873),wt=t(82434),Rt=t.n(wt),Tt=t(2478),St=t(42761),_t=t(62681),Ut=t(44067),It=t(3182),Nt=t(75953),Lt=t(73545),Dt=["onSelect","endpoint","gatewayUrl","loading","size","helperText"],Ot=[{value:"https://www.didspaces.com/app",label:"Prod DID Spaces",avatar:"P"},{value:"https://storage.staging.abtnet.io/app",label:"Staging DID Spaces",avatar:"S"}],Bt=(0,It.D)();function Ft(e){var n=e.onSelect,t=e.endpoint,c=e.gatewayUrl,s=e.loading,u=e.size,p=e.helperText,m=(0,l.Z)(e,Dt),f=(0,it.Z)("did-space-gateway-list",Ot),h=(0,d.Z)(f,2),x=h[0],v=h[1],g=(0,o.useState)(c||Ot[0].value),Z=(0,d.Z)(g,2),b=Z[0],y=Z[1],k=(0,i.PE)().t,j=(0,Lt.T)().api;return(0,o.useEffect)((function(){b&&!x.find((function(e){return e.value===b}))&&j.get(X()(b,"/__blocklet__.js?type=json")).then((function(e){v([].concat((0,a.Z)(x),[{value:b,label:e.data.appName}]))})).catch((function(e){console.error(e),W.Z.error("Can not add this gateway, please check the url and try again")}))}),[b]),(0,ne.jsx)(zt,(0,r.Z)((0,r.Z)({},m),{},{freeSolo:!0,selectOnFocus:!0,clearOnBlur:!0,handleHomeEndKeys:!0,value:b,options:x,onChange:function(e,n){if(n)if("string"===typeof n){var t=x.find((function(e){return e.label===n}));t&&y(t.value)}else n.inputValue?y(n.inputValue):n.value&&y(n.value)},getOptionLabel:function(e){return"string"===typeof e?e:e.inputValue?e.inputValue:e.label},renderOption:function(e,n){return(0,ne.jsxs)(Tt.ZP,(0,r.Z)((0,r.Z)({},e),{},{children:[(0,ne.jsx)(St.Z,{children:(0,ne.jsx)(_t.Z,{children:n.avatar})}),(0,ne.jsx)(Ut.Z,{primary:n.label,secondary:n.value})]}),n.value)},filterOptions:function(e,n){var t=Bt(e,n);n.inputValue&&Rt()(n.inputValue)&&(e.some((function(e){return n.inputValue===e.value}))||t.push({value:n.inputValue,label:"Add new gateway"}));return t},renderInput:function(e){return(0,ne.jsx)(je.Z,(0,r.Z)((0,r.Z)({},e),{},{helperText:p,label:k("storage.spaces.label"),size:u,InputProps:(0,r.Z)((0,r.Z)({},e.InputProps),{},{type:"search",endAdornment:(0,ne.jsx)(z.Z,{variant:"contained",onClick:function(){return n(b)},size:"small",loading:s,disable:s,sx:{position:"absolute",right:0,display:"flex",justifyContent:"center",alignItems:"center",width:"100px",height:"100%"},children:k(t?"storage.spaces.reconnect":"storage.spaces.connect.now")})})}))}}))}var zt=(0,p.Z)(Nt.Z)(kt||(kt=(0,c.Z)(["\n height: 40px;\n width: 100%;\n max-width: 720px;\n "," {\n width: 75%;\n }\n input.MuiInputBase-input {\n max-width: calc(100% - 80px);\n }\n"])),(function(e){return e.theme.breakpoints.down("md")}));Ft.propTypes={onSelect:f().func.isRequired,endpoint:f().string,loading:f().bool,size:f().string,helperText:f().string,gatewayUrl:f().string},Ft.defaultProps={endpoint:void 0,loading:!1,size:"small",helperText:"",gatewayUrl:""};var qt=Ft,At=["onConnect"];var Gt=(0,o.forwardRef)((function(e,n){var t=e.onConnect,a=(0,l.Z)(e,At),c=(0,le.h6)(),p=c.api,m=c.info.did,f=(0,o.useContext)(i.RD),h=f.t,x=f.locale,v=(0,Cn.y0)(),g=v.blocklet,Z=v.actions.refreshBlocklet,b=(0,o.useState)(""),y=(0,d.Z)(b,2),k=y[0],j=y[1],C=(0,o.useMemo)((function(){var e,n,t,r;return{endpoint:(null===g||void 0===g||null===(e=g.environments)||void 0===e||null===(n=e.find((function(e){return e.key===ie.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT})))||void 0===n?void 0:n.value)||"",gatewayUrl:(null===g||void 0===g||null===(t=g.environments)||void 0===t||null===(r=t.find((function(e){return e.key===ie.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACES_URL})))||void 0===r?void 0:r.value)||""}}),[g]),P=(0,A.getAppName)(g),E=(0,A.getAppDescription)(g),w=function(e){var n,t,r,o=null===e||void 0===e||null===(n=e.site)||void 0===n||null===(t=n.domainAliases)||void 0===t||null===(r=t.sort((function(e,n){return e.accessibility.accessible&&n.accessibility.accessible?+e.isProtected-+n.isProtected:+n.accessibility.accessible-+e.accessibility.accessible})))||void 0===r?void 0:r.map((function(e){var n,t=null!==e&&void 0!==e&&null!==(n=e.domainStatus)&&void 0!==n&&n.isHttps?"https://":"http://",r=null===e||void 0===e?void 0:e.value;return"".concat(t).concat(r)})).filter(Boolean),i=null===o||void 0===o?void 0:o[0];return{appUrl:i,isReady:Boolean(i)}}(g),R=w.appUrl,T=w.isReady;function S(e,n){return _.apply(this,arguments)}function _(){return(_=(0,u.Z)((0,s.Z)().mark((function e(n,t){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p.configBlocklet({input:{did:[n],configs:[{key:ie.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACES_URL,value:k},{key:ie.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT,value:t}]}}).then((function(){W.Z.success(h("storage.spaces.connect.succeeded",x))})).catch((function(e){console.error(e),W.Z.error(e.message)}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var U=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(n,o){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,S(g.meta.did,o(n.endpoint));case 2:setTimeout((function(){D((function(e){return(0,r.Z)((0,r.Z)({},e),{},{open:!1})})),null===t||void 0===t||t(),Z()}),3e3);case 3:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),I=(0,o.useState)({open:!1}),N=(0,d.Z)(I,2),L=N[0],D=N[1];return(0,o.useEffect)((function(){D((function(e){return(0,r.Z)((0,r.Z)({},e),{},{messages:{title:h("storage.spaces.authorize.title",{appName:P}),scan:h("storage.spaces.authorize.scan",{appName:P}),confirm:"",success:(0,ne.jsx)(Ve.Z,{gutterBottom:!0,children:h("storage.spaces.authorize.success")})}})}))}),[P,x,h]),(0,o.useImperativeHandle)(n,(function(){return{getEndpoint:function(){return C.endpoint},getGatewayUrl:function(){return C.gatewayUrl}}})),(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(qt,(0,r.Z)((0,r.Z)((0,r.Z)({},a),C),{},{onSelect:function(e){(0,Et.isEmpty)(e)?W.Z.error(h("storage.spaces.addressCannotEmpty",x)):(j(e),D((function(n){return(0,r.Z)((0,r.Z)({},n),{},{action:"one-click-authorization",checkTimeout:3e5,prefix:X()(e,"space/api/did"),baseUrl:new URL(e).origin,checkFn:Pt().create({baseURL:X()(e,"space")}).get,extraParams:{appDid:g.appDid,appName:P,appDescription:E,scopes:"list:object read:object write:object",appUrl:R,referrer:window.location.href,nodeDid:m},onClose:function(){D((function(e){return(0,r.Z)((0,r.Z)({},e),{},{open:!1})}))},open:!0})})))},loading:!T})),(0,ne.jsx)(Wn.default,{forceConnected:!1,saveConnect:!1,prefix:L.prefix,open:L.open,popup:!0,action:L.action,baseUrl:L.baseUrl,checkFn:L.checkFn,onSuccess:U,onClose:L.onClose,checkTimeout:L.checkTimeout,extraParams:L.extraParams,messages:L.messages,locale:x})]})}));Gt.propTypes={onConnect:f().func},Gt.defaultProps={onConnect:function(){}};var Mt,Wt,Kt,Vt,Yt,Ht,Xt,$t=Gt,Jt=["name","validation"],Qt=["default","key"],er=function(e){return e.inStore&&!1===(0,A.isFreeBlocklet)(e)},nr=function(e){var n;return null===e||void 0===e||null===(n=e.capabilities)||void 0===n?void 0:n.didSpace},tr=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===ie.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT})))||void 0===t?void 0:t.value)||null},rr=function(e){return(e.environments||[]).some((function(e){return e.required}))},or=function(e,n){return null===e||void 0===e?void 0:e.some((function(e){return e.required&&!n[e.key]}))},ir=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.title||e.name},ar=(0,o.forwardRef)((function(e,n){var t=e.meta,a=e.isMobile,l=e.onStepChange,c=(0,bn.s)(),s=c.steps,u=c.activeStep,d=c.setActiveStepByKey,p=c.setActiveStepByIndex,m=(0,i.PE)(),f=m.t,h=m.locale,x=s[u];return(0,o.useEffect)((function(){l(u)}),[l,u]),(0,o.useImperativeHandle)(n,(function(){return{setActiveStepByKey:d,setActiveStepByIndex:p}})),(0,ne.jsx)(pr,{component:"div",className:a?"mobileStyle":"",children:(0,ne.jsx)(Zn.Z,{locale:h,blockletMeta:(0,r.Z)({title:" "},t),pcWidth:"100%",pcHeight:"100%",logoUrl:t&&t.logo&&t.registryUrl?(0,ce.aZ)({did:t.did,baseUrl:t.registryUrl,logoPath:t.logo}):null,stepTip:f("blocklet.component.add"),children:(0,ne.jsx)(ur,{children:null!==x&&void 0!==x&&x.body&&"function"===typeof x.body?x.body():x.body})})})}));function lr(e){var n,t,c,p,m,f,h,v=e.blocklet,g=e.children,Z=(0,i.PE)(),b=Z.t,y=Z.locale,k=(0,o.useState)(!1),j=(0,d.Z)(k,2),C=j[0],P=j[1],E=(0,o.useState)(null),w=(0,d.Z)(E,2),R=w[0],T=w[1],S=(0,o.useState)(""),_=(0,d.Z)(S,2),U=_[0],I=_[1],N=(0,o.useState)(""),L=(0,d.Z)(N,2),D=L[0],F=L[1],q=(0,o.useState)(""),G=(0,d.Z)(q,2),M=G[0],K=G[1],V=(0,le.h6)(),Y=V.api,H=V.ws.useSubscription,X=V.inService,$=V.info,J=(0,Cn.y0)().actions.refreshBlocklet,Q=(0,o.useState)(null),ee=(0,d.Z)(Q,2),te=ee[0],re=ee[1],oe=(0,o.useState)(!1),ae=(0,d.Z)(oe,2),se=ae[0],ue=ae[1],de={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceCapability:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1},pe=(0,o.useState)(de),me=(0,d.Z)(pe,2),fe=me[0],he=me[1],xe=(0,o.useState)(0),ve=(0,d.Z)(xe,2),ge=ve[0],Ze=ve[1],be=(0,o.useRef)({}),ye=(0,o.useRef)({}),ke=(0,o.useRef)({}),Ce=(0,gn.Z)((function(e){return e.breakpoints.down("md")})),Pe=be.current.meta,Ee=(ye.current||{}).setActiveStepByIndex,we=$.mode===O.NODE_MODES.SERVERLESS,Re=function(e){return he((function(n){return(0,r.Z)((0,r.Z)({},n),e)}))};(0,o.useEffect)((function(){if(fe.pathPrefix){var e=Ne((0,r.Z)((0,r.Z)({},fe),{},{pathPrefix:fe.pathPrefix,locale:y})).errMsg;I(e)}}),[fe.pathPrefix]),(0,o.useEffect)((function(){0===ge&&he(de)}),[ge]);var Te=function(){var e;return null!==be&&void 0!==be&&null!==(e=be.current)&&void 0!==e&&e.meta?(0,A.getDisplayName)(be.current):""},Se=function(e){!function n(t){Re({installResultProps:{variant:"error",title:Te(),subTitle:e,footer:(0,ne.jsx)(z.Z,{className:"bottom-button",disabled:t,"data-cy":"retry-install-component",onClick:function(){var e=(0,u.Z)((0,s.Z)().mark((function e(){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n(!0),e.next=3,Ie(be.current.installInput);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),children:(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center",children:[t&&(0,ne.jsx)(B.Z,{size:16,style:{marginRight:8}}),b("common.retry")]})})}})}()},_e=function(e){return function(n){var t,r;((null===n||void 0===n||null===(t=n.meta)||void 0===t?void 0:t.did)||(null===n||void 0===n?void 0:n.meta))===(null===v||void 0===v||null===(r=v.meta)||void 0===r?void 0:r.did)&&e(n)}};H(ie.BlockletEvents.statusChange,_e((function(e){if(e.status===ie.BlockletStatus.upgrading)Re({installResultProps:{variant:"success",title:Te(),subTitle:b("blocklet.component.installSuccessTip")}})})),[null===v||void 0===v||null===(n=v.meta)||void 0===n?void 0:n.did]),H(ie.BlockletEvents.downloadFailed,_e((function(){Se(b("blocklet.component.installComponentError"))})),[null===v||void 0===v||null===(t=v.meta)||void 0===t?void 0:t.did]),H(ie.BlockletEvents.installFailed,_e((function(){Se(b("blocklet.component.installComponentError"))})),[null===v||void 0===v||null===(c=v.meta)||void 0===c?void 0:c.did]);var Ue=function(){P(!1),F(!1),he({}),be.current={}},Ie=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(n){var t,o,i,a,l,c,u,d,p,m,f,h,x,g,Z,b,y,k,j,C,E,w,R,T,S;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=fe.pathPrefix,a=fe.bundleDid,l=fe.title,c=fe.componentName,u=void 0===c?"":c,d=fe.componentDid,p=void 0===d?"":d,m=(null===(t=be.current)||void 0===t?void 0:t.meta)||{},f=m.configs,h=void 0===f?[]:f,x=m.registryUrl,g=m.inStore,Z=m.inputUrl,b=null===(o=be.current)||void 0===o?void 0:o.downloadTokenList,y=g?(0,ce.Rn)(x,a):Z,P(!0),k=(0,r.Z)((0,r.Z)((0,r.Z)({rootDid:v.meta.did,url:y,mountPoint:(0,Le.default)(i),title:l,name:u,did:p},fe.hasEnvironmentsStep&&h.length>0?{configs:h.map((function(e){return(0,r.Z)((0,r.Z)({},e),{},{value:fe.configsValue[e.key]||""})}))}:{}),b?{downloadTokenList:b}:{}),n),e.prev=6,e.next=9,Y.installComponent({input:k});case 9:if(!x){e.next=15;break}if(j=(0,ce.dX)({fromBlocklet:X,nodeInfo:$,blocklet:v}),C=j.teamDid,E=j.storeList,w=(0,ce.bQ)(x,E),R=w.isNew,T=w.decoded,!R){e.next=15;break}return e.next=15,Y.addBlockletStore({input:{teamDid:C,url:T}});case 15:Re({installResultProps:{}}),J({showError:!1,attachRuntimeInfo:!1}),e.next=25;break;case 19:e.prev=19,e.t0=e.catch(6),S=(0,ce.Z)(e.t0),W.Z.error(S),console.error("installComponent error: ",e.t0),Se(S);case 25:return e.prev=25,P(!1),be.current.installInput=k,e.finish(25);case 29:case"end":return e.stop()}}),e,null,[[6,19,25,29]])})));return function(n){return e.apply(this,arguments)}}(),Ne=function(e){return{errMsg:(0,nt.Rw)({params:(0,r.Z)((0,r.Z)({},e),{},{did:e.bundleDid}),blocklets:[v],blocklet:v,locale:y})}},De=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(n){var t,o;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=Ne((0,r.Z)((0,r.Z)({},fe),{},{locale:y})),o=t.errMsg,I(o),ge!==Fe.length-2){e.next=5;break}return e.next=5,Ie(n);case 5:Ee((function(e){return e+1}));case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),Oe=function(){Ee((function(e){return e-1}))},Be=function(e){var n,t,o=e.chooseParams,i=void 0===o?be.current:o,c=e.componentDid,s=e.isInit,u=void 0!==s&&s,d=i.meta,p=i.registryUrl,m=i.inStore,f=i.inputUrl,h=d.did,x=d.title,g=d.name,Z=((null===(n=v.settings)||void 0===n?void 0:n.children)||[]).filter((function(e){return"deleted"===e.status&&e.meta.bundleDid===h})),b=c||"",y=null===(t=d.environments)||void 0===t?void 0:t.map((function(e){var n=e.name,t=e.validation,o=(0,l.Z)(e,Jt),i={validation:pn()(t)?"":t};return(0,r.Z)((0,r.Z)({},o),{},{key:n},i)}));be.current=(0,r.Z)((0,r.Z)({},i),{},{meta:(0,r.Z)((0,r.Z)({},d),{},{configs:y,registryUrl:p,inStore:m,inputUrl:f})});var k={};if(u){var j=[v],C=y||[],P=an()(cn()([].concat((0,a.Z)(C),[])),"key").filter((function(e){return!!e.key})).sort((function(e,n){return e.required&&!n.required?-1:n.required&&!e.required?1:0})),E=(0,A.getSharedConfigObj)(j[0],{configs:P}),w={},R=P.map((function(e){var n=e.default,t=e.key,o=(0,l.Z)(e,Qt);return w[t]=E[t]||n,(0,r.Z)((0,r.Z)({},o),{},{key:t,hidden:!!ie.BLOCKLET_CONFIGURABLE_KEY[t]})}));k=(0,r.Z)((0,r.Z)({},k),{},{configsList:R,configsValue:w,hasMissRequiredConfigs:or(R,w)})}var T,S,_=v.children.some((function(e){return"/"===e.mountPoint})),U=Z.find((function(e){return e.meta.bundleDid===h}));U?k=(0,r.Z)((0,r.Z)({},k),{},{pathPrefix:U.mountPoint,title:x||"",componentName:U.meta.name,hasEnvironmentsStep:!1}):k=(0,r.Z)((0,r.Z)({},k),{},{pathPrefix:_?"/".concat((0,Le.default)(g)):"/",title:x||"",componentName:"",hasEnvironmentsStep:(null===(T=be.current.meta)||void 0===T||null===(S=T.environments)||void 0===S?void 0:S.length)>0});var I=er(be.current.meta),N=nr(be.current.meta),L=tr(v);Re((0,r.Z)((0,r.Z)({bundleDid:h,componentDid:b},k),{},{hasRequiredEnvironments:rr(be.current.meta),requirePurchase:I,didSpaceCapability:N,didSpaceEndpoint:L})),u&&I&&function(){var e=fe.pathPrefix,n=fe.bundleDid,t=fe.title,r=fe.componentName,o=void 0===r?"":r,i=fe.componentDid,a=void 0===i?"":i,l=(be.current||{}).meta,c=void 0===l?{}:l,s=c.registryUrl,u=c.inStore,d=c.inputUrl,p=u?(0,ce.Rn)(s,n):d;re({meta:c,installOpts:{type:"component",rootDid:v.meta.did,mountPoint:e,url:p,title:t,name:o,did:a}})}()},Fe=[{key:"selectComponent",name:b("blocklet.component.selectComponent"),body:(0,ne.jsxs)(sr,{component:"div",children:[fe.showFromUrlDialog&&(0,ne.jsx)(rt.Z,{mode:"component",onCancel:function(){Re({showFromUrlDialog:!1})},onSuccess:function(e){var n=e.meta,t=e.inputUrl,r=e.inStore,o=e.registryUrl;Be({chooseParams:{meta:n,inputUrl:t,inStore:r,registryUrl:o},isInit:!0}),Re({showFromUrlDialog:!1}),De()},handleText:{title:b("blocklet.component.addComponentTip.fromUrl"),confirm:b("blocklet.component.choose")}}),(0,ne.jsx)(st,{extra:we?null:(0,ne.jsxs)(z.Z,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:function(){Re({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[(0,ne.jsx)(xn.Z,{style:{fontSize:20,marginRight:4}})," ",b("blocklet.component.addComponentTip.fromUrl")," "]}),loading:C,onChange:function(){he({}),be.current={}},children:function(e){var n=e.currentRegistry;return(0,ne.jsx)(yt,{serverVersion:null===$||void 0===$?void 0:$.version,style:Ce?{height:"calc(100vh - 56px - 80px - 32px - 40px )"}:{height:"calc(100% - 40px)"},storeUrl:n.url,handleButtonClick:function(e){Be({chooseParams:(0,r.Z)((0,r.Z)({},e),{},{inStore:!0}),isInit:!0})},handleBlockletRender:function(e){var n=e.blocklet,t=e.defaultRender,r=(null===fe||void 0===fe?void 0:fe.bundleDid)&&(null===fe||void 0===fe?void 0:fe.bundleDid)===(null===n||void 0===n?void 0:n.did);return(0,ne.jsxs)(fr,{children:[r&&(0,ne.jsx)("div",{className:"check-container",children:(0,ne.jsx)(vn.default,{className:"check-icon"})}),(0,ne.jsx)("div",{className:r?"choose-blocklet":"",style:{marginLeft:16},children:t})]})},extraFilter:function(e){return null===e||void 0===e?void 0:e.filter((function(e){return!!(0,A.isComponentBlocklet)(e)&&!(v.children||[]).some((function(n){return n.meta.did===e.did}))}))}})}})]}),cancel:b("common.cancel"),confirm:ir(fe)?b("blocklet.component.addNext",{name:ir(fe)}):b("common.next"),onCancel:Ue,onConfirm:function(){De()}},{key:"agreement",name:b("launchBlocklet.introduction"),body:(0,ne.jsxs)(sr,{component:"div",className:"agreement-wrapper",children:[(0,ne.jsx)(mn.Z,{title:b("launchBlocklet.introduction"),subTitle:b("blocklet.component.addComponentTip.introduction")}),(0,ne.jsx)(tt.Z,{meta:Pe,onClickNext:De,handleDescEle:(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)("p",{children:(0,ne.jsx)("div",{dangerouslySetInnerHTML:{__html:b("blocklet.component.addComponentTip.".concat(fe.requirePurchase?"isPurchase":"isFree"),{name:Te()})}})}),(0,ne.jsx)("p",{children:b("blocklet.component.addComponentTip.belowInformation")})]})})]}),cancel:b("common.pre"),confirm:b("launchBlocklet.next"),onCancel:Oe,onConfirm:function(){ue(!1),De()}},Pe&&fe.requirePurchase&&{key:"purchase",name:(0,ne.jsxs)(ne.Fragment,{children:[b("common.verifyNFT"),(0,ne.jsx)(qn.Z,{})]}),body:(0,ne.jsxs)(sr,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(2===(null===(p=ke.current)||void 0===p||null===(m=p.getCurrentStep)||void 0===m?void 0:m.call(p))||se)&&(0,ne.jsx)(mr,{title:b("common.verifyNFT"),subTitle:b("blocklet.component.addComponentTip.verifyNFT")}),un()(fe.purchaseResultProps)?te&&(0,ne.jsx)(et,{ref:ke,meta:te.meta,mode:fe.componentDid?"verify":"both",onCancel:function(e){ue(!1),Re({purchaseResultProps:{variant:"error",title:Te(),subTitle:e,style:{paddingTop:120},footer:(0,ne.jsx)(z.Z,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:function(){Re({purchaseResultProps:{}})},children:b("common.retry")})}})},installOpts:te.installOpts,handlePaySuccess:function(e){var n=e.downloadTokenList;be.current.downloadTokenList=n,ue(!1),De()}}):(0,ne.jsx)("div",{className:"flex-align-center flex-justify-center",children:(0,ne.jsx)(jn.Z,(0,r.Z)({},fe.purchaseResultProps))})]}),disabled:2===(null===(f=ke.current)||void 0===f||null===(h=f.getCurrentStep)||void 0===h?void 0:h.call(f))||se,cancel:b("common.pre"),confirm:b("common.next"),onConfirm:function(){"function"===typeof ke.current.onNext&&(ke.current.onNext(),ue(!0))},onCancel:function(){Oe()}},(0,A.hasStartEngine)(Pe)&&{key:"config",name:b("common.config"),error:U,body:(0,ne.jsxs)(sr,{component:"div",children:[(0,ne.jsx)(mr,{title:b("common.config"),subTitle:b("blocklet.component.addComponentTip.config")}),(0,ne.jsx)(je.Z,{label:b("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"mount-point-input"},fullWidth:!0,helperText:M||b("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:fe.pathPrefix,onChange:function(e){var n=e.target.value;Re({pathPrefix:n}),K(b("common.slugifyHint",{value:(0,ce.LN)(n)}))}}),!!U&&(0,ne.jsx)(yn.Z,{type:"error",style:{width:"100%",marginTop:8},children:U})]}),cancel:b("common.pre"),confirm:b("common.next"),onCancel:Oe,onConfirm:function(){De()}},Pe&&(null===fe||void 0===fe?void 0:fe.hasEnvironmentsStep)&&{key:"environment",name:(0,ne.jsxs)(ne.Fragment,{children:[b("common.environment")," ",fe.hasRequiredEnvironments&&(0,ne.jsx)(qn.Z,{})]}),disabled:!!R||(null===fe||void 0===fe?void 0:fe.hasMissRequiredConfigs),body:function(){return(0,ne.jsxs)(sr,{component:"div",children:[(0,ne.jsx)(mr,{title:b("common.environment"),subTitle:b("blocklet.component.addComponentTip.environment")}),(0,ne.jsx)(Gn,{style:{marginTop:-12,width:"100%"},schema:fe.configsList,defaultValue:fe.configsValue,onChange:function(e,n){var t=n.action,r=n.currentItem,o=n.allValues;"confirm"===t&&Re({hasMissRequiredConfigs:or(fe.configsList,o),configsValue:o}),"edit"===t?T(r):["cancel","confirm"].includes(t)&&T(null)}})]})},cancel:b("common.pre"),confirm:b("common.next"),onCancel:Oe,onConfirm:De},Pe&&(null===fe||void 0===fe?void 0:fe.didSpaceCapability)&&{key:"didSpace",name:(0,ne.jsxs)(ne.Fragment,{children:[b("blocklet.component.didSpaceConfig")," ","required"===fe.didSpaceCapability&&(0,ne.jsx)(qn.Z,{})]}),disabled:"required"===fe.didSpaceCapability&&!fe.didSpaceEndpoint,body:function(){return(0,ne.jsxs)(sr,{component:"div",children:[(0,ne.jsx)(mr,{title:b("blocklet.component.didSpaceConfig"),subTitle:b("blocklet.component.didSpaceConfigTip")}),(0,ne.jsx)(x.Z,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:(0,ne.jsx)($t,{sx:{"& .MuiFormHelperText-root":{wordBreak:"break-all"}},helperText:fe.didSpaceEndpoint&&b("blocklet.component.didSpaceConnected",{endpoint:fe.didSpaceEndpoint}),onConnect:function(){De()}})})]})},cancel:b("common.pre"),confirm:b("common.next"),onCancel:Oe,onConfirm:De},{key:"install",name:b("common.install"),disabled:!1,loading:!1,body:(0,ne.jsx)(sr,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:un()(fe.installResultProps)?(0,ne.jsx)(kn.Z,{message:(0,ne.jsx)(hr,{children:b("blocklet.component.installingCanCloseWindowTip")}),increaseSpeed:.3,messageLoop:!1}):(0,ne.jsx)("div",{style:{marginTop:120},children:(0,ne.jsx)(jn.Z,(0,r.Z)({},fe.installResultProps))})}),confirm:b("common.complete"),onConfirm:function(){Ue(),setTimeout((function(){var e=document.getElementsByClassName("dashboard-main")[0];e&&(e.scrollTop=e.scrollHeight)}),200)}}].filter((function(e){return e})),ze=Fe[ge]||{},qe=function(e){e.stopPropagation(),F(!0)},Ae=ge<Fe.length-1;return(0,ne.jsxs)(ne.Fragment,{children:["function"===typeof g?g({loading:C,open:qe}):(0,ne.jsxs)(hn.Z,{onClick:qe,className:"component-action","data-cy":"action-add-component",children:[C?(0,ne.jsx)(B.Z,{size:16}):(0,ne.jsx)(xn.Z,{style:{fontSize:18,marginRight:5}}),b("blocklet.component.add")]}),D&&(0,ne.jsx)(cr,{title:b("blocklet.component.addWithName",{name:(0,A.getDisplayName)(v)}),maxWidth:!1,fullWidth:!1,PaperProps:{style:Ce?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:function(e,n){var t,r;"backdropClick"!==n&&(null===(t=Fe[0])||void 0===t||null===(r=t.onCancel)||void 0===r||r.call(t))},showCloseButton:Ae,disableEscapeKeyDown:!0,open:!0,actions:(0,ne.jsxs)(ne.Fragment,{children:[ze.cancel&&(0,ne.jsx)(z.Z,{onClick:function(e){e.stopPropagation(),ze.onCancel()},disabled:ge===Fe.length-2&&C,color:"inherit",children:ze.cancel||b("common.cancel")}),ze.confirm&&(0,ne.jsx)(z.Z,{onClick:function(e){e.stopPropagation(),ze.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:C||("boolean"===typeof ze.disabled?ze.disabled:!(!C&&!ze.error&&fe.bundleDid)||ge>0&&!fe.pathPrefix),variant:"contained",autoFocus:!0,title:ze.confirm,style:{marginLeft:8,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"280px",display:"inline-block"},children:(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center",children:[("boolean"===typeof ze.loading?ze.loading:C)&&(0,ne.jsx)(B.Z,{size:16}),ze.confirm]})})]}),children:(0,ne.jsx)(bn.W,{steps:Fe,mode:"memory",children:(0,ne.jsx)(ar,{ref:ye,meta:Pe,isMobile:Ce,onStepChange:function(e){Ze(e)}})})})]})}ar.propTypes={meta:f().any,onStepChange:f().func.isRequired,isMobile:f().bool.isRequired},ar.defaultProps={meta:null},lr.propTypes={children:f().any,blocklet:f().object.isRequired},lr.defaultProps={children:null};var cr=(0,p.Z)(be.ZP)(Mt||(Mt=(0,c.Z)(["\n .MuiDialogContent-root {\n padding-left: 0;\n padding-right: 0;\n padding-bottom: 0;\n }\n\n .MuiDialogActions-root {\n padding: 16px 24px;\n }\n"]))),sr=(0,p.Z)(Ve.Z)(Wt||(Wt=(0,c.Z)(["\n width: 100%;\n height: 100%;\n"]))),ur=p.Z.div(Kt||(Kt=(0,c.Z)(["\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\n // blocklet-select-side\n aside {\n width: 140px;\n }\n"]))),dr=function(e){return e.isMobile?"\n height: calc(100vh - 56px - 64px - 48px);\n ":""},pr=(0,p.Z)(fn.Z)(Vt||(Vt=(0,c.Z)(["\n ","\n\n & .flex-justify-center {\n display: flex;\n justify-content: center;\n }\n\n & .flex-align-center {\n display: flex;\n height: 100%;\n align-items: center;\n ","\n }\n\n & .agreement-wrapper {\n ","\n max-height: 60vh;\n .eula-trigger {\n padding-right: 0;\n }\n .next-button {\n display: none;\n }\n }\n\n & .connect {\n background: white;\n }\n"])),(function(e){return"mobileStyle"===e.className?"\n height: 100%;\n\n & > div{\n height: 100%;\n }\n .root-header {\n .app-name-content {\n display: none;\n }\n }\n\n\n\n // content-panel\n .root-header + div{\n padding-top: 0;\n position: relative;\n & > div {\n padding-top: 0;\n }\n }\n\n header + div {\n padding-top: 0;\n }\n\n header {\n .header-title {\n margin-left: 0;\n }\n\n .header-title-name {\n max-width: 100% !important;\n }\n }\n ":"\n height: 72vh;\n position: relative;\n .root-header {\n z-index: auto !important;\n position: fixed !important;\n }\n & > div {\n height: 100%;\n width: 100%;\n max-width: 100%;\n & > div {\n max-height: unset !important;\n max-width: 100%;\n & > div {\n // left-panel\n &:first-child {\n padding-top: 0;\n // padding-left: 0;\n width: 25%;\n min-width: 240px;\n & > div:first-child {\n display: none;\n }\n // step\n & > div:last-child {\n // margin-top: 32px;\n margin-top: 0;\n }\n }\n // right-panel\n &:last-child {\n padding-top: 0;\n padding-right: 24px;\n overflow-y: auto;\n .app-content {\n padding: 0 0 24px 0;\n }\n .button-container {\n padding-right: 0;\n }\n }\n }\n }\n }\n\n "}),(function(e){return dr(e)}),(function(e){return dr(e)})),mr=(0,p.Z)(mn.Z)(Yt||(Yt=(0,c.Z)(["\n margin-bottom: 24px;\n"]))),fr=p.Z.div(Ht||(Ht=(0,c.Z)(["\n position: relative;\n\n .choose-blocklet {\n background-color: rgb(236, 251, 253);\n border-color: rgb(236, 251, 253);\n border-radius: 8px;\n }\n\n .check-container {\n position: absolute;\n right: 0;\n bottom: 0;\n display: flex;\n justify-content: flex-end;\n align-items: flex-end;\n width: 30px;\n height: 30px;\n border-radius: 0 0 8px 0;\n color: ",";\n overflow: hidden;\n transition: all ease 0.3s;\n &:after {\n position: absolute;\n z-index: 0;\n display: block;\n width: 0;\n height: 0;\n border-top: transparent solid 15px;\n border-left: transparent solid 15px;\n border-bottom: "," solid 15px;\n border-right: "," solid 15px;\n transition: all ease 0.1s;\n content: '';\n }\n\n .check-icon {\n position: relative;\n z-index: 2;\n margin: 0 1px 1px 0;\n font-size: 16px;\n transition: all ease 0.2s;\n }\n }\n"])),(function(e){return e.theme.palette.common.white}),(function(e){return e.theme.palette.primary.main}),(function(e){return e.theme.palette.primary.main})),hr=p.Z.div(Xt||(Xt=(0,c.Z)(["\n color: ",";\n .msg-before {\n display: inline-block;\n color: #aaa;\n font-size: 14px;\n margin-right: 6px;\n }\n"])),(function(e){return e.theme.palette.primary.main})),xr=function(e){return e.children.filter((function(e){return e.meta.interfaces.find((function(e){return e.type===ie.BLOCKLET_INTERFACE_TYPE_WEB}))}))};function vr(e){var n=e.params,t=e.setParams,a=e.setError,l=e.serviceTypes,c=(0,i.PE)().t,s=(0,Cn.y0)().blocklet,u=s.meta.did,p=xr(s),m=(0,o.useState)([]),f=(0,d.Z)(m,2),h=f[0],x=f[1],v={301:c("common.redirectPermanently"),302:c("common.redirectTemporary"),307:c("common.redirectTemporary"),308:c("common.redirectPermanently")};return(0,o.useEffect)((function(){if(n.type===O.ROUTING_RULE_TYPES.COMPONENT&&n.componentId){var e=p.find((function(e){return e.meta.did===n.componentId})),o=(0,A.findWebInterface)(e.meta),i=(Array.isArray(null===o||void 0===o?void 0:o.pageGroups)?o.pageGroups:[]).map((function(e){return{value:e,label:"".concat(e," pages")}}));i.length&&i.unshift({value:"",label:"All pages"}),x(i),n.pageGroup&&!1===i.find((function(e){return e.value===n.pageGroup}))&&t((0,r.Z)((0,r.Z)({},n),{},{pageGroups:""}))}}),[n.componentId,n.type]),(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(je.Z,{select:!0,label:c("router.domain.add.type"),autoComplete:"off",variant:"outlined",name:"type","data-cy":"domain-add-type",fullWidth:!0,value:n.type,onChange:function(e){a(""),t((0,r.Z)((0,r.Z)({},n),{},{type:e.target.value,did:e.target.value===O.ROUTING_RULE_TYPES.BLOCKLET?u:"",__disableConfirm:!1}))},style:{marginBottom:32},SelectProps:{},children:l.map((function(e){var n=e.name,t=e.value;return(0,ne.jsx)(hn.Z,{value:t,children:n},t)}))}),n.type===O.ROUTING_RULE_TYPES.REDIRECT&&[(0,ne.jsx)(je.Z,{select:!0,label:c("router.domain.add.redirect"),autoComplete:"off",variant:"outlined",name:"type",fullWidth:!0,value:n.redirectCode,onChange:function(e){return t((0,r.Z)((0,r.Z)({},n),{},{redirectCode:e.target.value}))},style:{marginBottom:32},SelectProps:{},children:Object.keys(v).map((function(e){return(0,ne.jsx)(hn.Z,{value:e,children:"".concat(v[e]," - ").concat(e)},e)}))},"redirectCode"),(0,ne.jsx)(je.Z,{label:c("common.redirectUrl"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"redirect-url-input",fullWidth:!0,value:n.url,helperText:c("router.urlHelperText"),style:{marginBottom:32},onChange:function(e){t((0,r.Z)((0,r.Z)({},n),{},{url:e.target.value,__disableConfirm:!e.target.value.trim()})),e.target.value.trim()?a(""):a(c("router.validation.redirectUrlRequired"))}},"redirectUrl")],n.type===O.ROUTING_RULE_TYPES.COMPONENT&&[(0,ne.jsx)(je.Z,{select:!0,label:c("router.domain.add.component"),autoComplete:"off",variant:"outlined","data-cy":"select-component-input",name:"componentId",fullWidth:!0,value:n.componentId,onChange:function(e){t((0,r.Z)((0,r.Z)({},n),{},{componentId:e.target.value}))},style:{marginBottom:32},SelectProps:{},children:p.map((function(e){return(0,ne.jsx)(hn.Z,{value:e.meta.did,selected:e.meta.did===n.componentId,children:(0,A.getDisplayName)(e,!0)},e.meta.did)}))},"componentId"),h.length?(0,ne.jsx)(je.Z,{select:!0,label:c("router.domain.add.pageGroup"),autoComplete:"off",variant:"outlined",name:"pageGroup","data-cy":"route-group-input",fullWidth:!0,value:n.pageGroup,helperText:c("router.domain.add.pageGroupTip"),style:{marginBottom:32},onChange:function(e){t((0,r.Z)((0,r.Z)({},n),{},{pageGroup:e.target.value}))},SelectProps:{},children:h.map((function(e){return(0,ne.jsx)(hn.Z,{value:e.value,selected:e.value===n.pageGroup,children:e.label},e.label)}))},"pageGroup"):null].filter(Boolean),n.type===O.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(0,ne.jsx)(je.Z,{label:c("common.rewriteUrl"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"rewrite-url-input",fullWidth:!0,value:n.url,helperText:c("router.urlHelperText"),style:{marginBottom:32},onChange:function(e){t((0,r.Z)((0,r.Z)({},n),{},{url:e.target.value,__disableConfirm:!e.target.value.trim()})),e.target.value.trim()?a(""):a(c("router.validation.rewriteUrlRequired"))}},"url")]})}function gr(e){var n=e.children,t=(0,i.PE)().t,a=(0,le.h6)().api,l=(0,Cn.y0)().blocklet,c=(0,o.useState)(!1),p=(0,d.Z)(c,2),m=p[0],f=p[1],h=(0,o.useState)(null),x=(0,d.Z)(h,2),v=x[0],g=x[1],Z=l.meta.did,b=l.site.id,y=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(n){var r,o;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,nt.fX)(n,t);case 3:if(!(r=e.sent)){e.next=6;break}throw r;case 6:return f(!0),o={from:{pathPrefix:(0,Le.default)(n.pathPrefix)},to:{type:n.type}},n.type===O.ROUTING_RULE_TYPES.REDIRECT&&(o.to.url=n.url.trim(),o.to.redirectCode=n.redirectCode),n.type===O.ROUTING_RULE_TYPES.COMPONENT&&(o.to.did=Z,o.to.componentId=n.componentId,o.to.pageGroup=n.pageGroup),n.type===O.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(o.to.url=(0,Le.default)(n.url)),e.next=13,a.addRoutingRule({input:{id:b,rule:o,teamDid:Z}});case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(0),W.Z.error(e.t0.message);case 18:return e.prev=18,f(!1),g(null),e.finish(18);case 22:case"end":return e.stop()}}),e,null,[[0,15,18,22]])})));return function(n){return e.apply(this,arguments)}}(),k={title:t("router.rule.add.title"),description:function(e,n,o){return(0,ne.jsxs)(Ve.Z,{component:"div",children:[(0,ne.jsx)(je.Z,{label:t("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix","data-cy":"path-prefix-input",fullWidth:!0,autoFocus:!0,helperText:e.pathPrefixHint||t("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:e.pathPrefix,onChange:function(i){var a=!1,c=(0,nt.Rw)({params:(0,r.Z)((0,r.Z)({},e),{},{pathPrefix:i.target.value}),blocklets:[l]});o(c),e.type===O.ROUTING_RULE_TYPES.BLOCKLET&&c&&(a=!0),e.type!==O.ROUTING_RULE_TYPES.REDIRECT||e.url||(a=!0),e.type!==O.ROUTING_RULE_TYPES.GENERAL_REWRITE||e.url||(a=!0),i.target.value.trim()||(a=!0,o(t("router.validation.pathPrefixRequired"))),a||o("");var s=t("common.slugifyHint",{value:(0,ce.LN)(i.target.value)});n((0,r.Z)((0,r.Z)({},e),{},{pathPrefix:i.target.value,pathPrefixHint:s,__disableConfirm:a}))}}),(0,ne.jsx)(vr,{params:e,setParams:function(e){o(null),(0,nt.fX)(e,t)?n((0,r.Z)((0,r.Z)({},e),{},{__disableConfirm:!0})):n((0,r.Z)({},e))},setError:o})]})},confirm:t("router.rule.add.confirm"),cancel:t("common.cancel"),params:{did:"",pathPrefix:"",type:O.ROUTING_RULE_TYPES.REDIRECT,componentId:"",pageGroup:"",redirectCode:302,__disableConfirm:!0},onConfirm:y,onCancel:function(){f(!1),g(null)}},j=function(e){e.stopPropagation(),g(k)};return(0,ne.jsxs)(ne.Fragment,{children:["function"===typeof n?n({loading:m,open:j}):(0,ne.jsxs)(hn.Z,{onClick:j,className:"rule-action","data-cy":"action-add-rule",children:[m?(0,ne.jsx)(B.Z,{size:16}):(0,ne.jsx)(xn.Z,{style:{fontSize:18,marginRight:5}}),t("router.rule.add.title")]}),v&&(0,ne.jsx)(ae.Z,{title:v.title,description:v.description,confirm:v.confirm,cancel:v.cancel,params:v.params,onConfirm:v.onConfirm,onCancel:v.onCancel,color:"primary"})]})}vr.propTypes={params:f().object,serviceTypes:f().array,setParams:f().func,setError:f().func},vr.defaultProps={params:{},serviceTypes:[{name:"Redirect",value:O.ROUTING_RULE_TYPES.REDIRECT},{name:"Default - User will see the 404 page",value:O.ROUTING_RULE_TYPES.NONE},{name:"Rewrite - Route traffic without redirect",value:O.ROUTING_RULE_TYPES.GENERAL_REWRITE},{name:"Component - Pass traffic to blocklet component",value:O.ROUTING_RULE_TYPES.COMPONENT}],setParams:function(){},setError:function(){}},gr.propTypes={children:f().any},gr.defaultProps={children:null};var Zr=t(96366),br=t(18067),yr=t(71363);function kr(e){var n=e.id,t=e.from,r=e.children,a=(0,i.PE)().t,l=(0,le.h6)().api,c=(0,Cn.y0)().blocklet,p=(0,o.useState)(!1),m=(0,d.Z)(p,2),f=m[0],h=m[1],x=(0,o.useState)(null),v=(0,d.Z)(x,2),g=v[0],Z=v[1],b=c.meta.did,y=c.site.id,k=t.pathPrefix,j=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return h(!0),e.prev=1,e.next=4,l.deleteRoutingRule({input:{id:y,ruleId:n,teamDid:b}});case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),W.Z.error(e.t0.message);case 9:return e.prev=9,Z(null),h(!1),e.finish(9);case 13:case"end":return e.stop()}}),e,null,[[1,6,9,13]])})));return function(){return e.apply(this,arguments)}}(),C={keyName:k,title:a("router.rule.delete.title"),description:a("router.rule.delete.description",{name:"<b>".concat(k,"</b>")}),confirmPlaceholder:a("router.rule.delete.confirm_desc",{name:k}),confirm:a("common.delConfirm"),cancel:a("router.rule.delete.cancel"),onConfirm:j,onCancel:function(){h(!1),Z(null)}},P=function(e){e.stopPropagation(),Z(C)};return(0,ne.jsxs)(ne.Fragment,{children:["function"===typeof r?r({loading:f,open:P}):(0,ne.jsxs)(hn.Z,{onClick:P,className:"rule-action","data-cy":"action-delete-rule",children:[f?(0,ne.jsx)(B.Z,{size:16}):(0,ne.jsx)(I.default,{style:{fontSize:18,marginRight:5}}),a("router.rule.delete.title")]}),g&&(0,ne.jsx)(yr.Z,{keyName:g.keyName,title:g.title,description:g.description,confirmPlaceholder:g.confirmPlaceholder,confirm:g.confirm,cancel:g.cancel,params:g.params,onConfirm:g.onConfirm,onCancel:g.onCancel})]})}function jr(e){var n=e.id,t=e.from,a=e.to,l=e.children,c=(0,i.PE)().t,p=(0,le.h6)().api,m=(0,Cn.y0)().blocklet,f=(0,o.useState)(!1),h=(0,d.Z)(f,2),x=h[0],v=h[1],g=(0,o.useState)(null),Z=(0,d.Z)(g,2),b=Z[0],y=Z[1],k=m.meta.did,j=m.site.id,C=t.pathPrefix,P=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(t){var r,o;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,nt.fX)(t,c);case 3:if(!(r=e.sent)){e.next=6;break}throw r;case 6:return v(!0),o={id:n,from:{pathPrefix:(0,Le.default)(t.pathPrefix)},to:{type:t.type}},t.type===O.ROUTING_RULE_TYPES.REDIRECT&&(o.to.url=t.url,o.to.redirectCode=t.redirectCode),t.type===O.ROUTING_RULE_TYPES.COMPONENT&&(o.to.did=k,o.to.componentId=t.componentId,o.to.pageGroup=t.pageGroup),t.type===O.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(o.to.url=(0,Le.default)(t.url)),e.next=13,p.updateRoutingRule({input:{id:j,rule:o,teamDid:k}});case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(0),W.Z.error(e.t0.message);case 18:return e.prev=18,v(!1),y(null),e.finish(18);case 22:case"end":return e.stop()}}),e,null,[[0,15,18,22]])})));return function(n){return e.apply(this,arguments)}}(),E={title:c("router.rule.update.title"),description:function(e,n,t){return(0,ne.jsxs)(Ve.Z,{component:"div",children:[(0,ne.jsx)(je.Z,{label:c("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix","data-cy":"path-prefix-input",fullWidth:!0,autoFocus:!0,helperText:e.helperText||c("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:e.pathPrefix,onChange:function(o){var i=!1;e.type!==O.ROUTING_RULE_TYPES.REDIRECT||e.url||(i=!0),e.type!==O.ROUTING_RULE_TYPES.GENERAL_REWRITE||e.url||(i=!0),o.target.value.trim()||(i=!0,t(c("router.validation.pathPrefixRequired"))),i||t("");var a=c("common.slugifyHint",{value:(0,ce.LN)(o.target.value)});n((0,r.Z)((0,r.Z)({},e),{},{pathPrefix:o.target.value,helperText:a,__disableConfirm:i}))}}),(0,ne.jsx)(vr,{params:e,setParams:function(e){(0,nt.fX)(e,c)?n((0,r.Z)((0,r.Z)({},e),{},{__disableConfirm:!0})):n((0,r.Z)({},e))},setError:t})]})},confirm:c("router.rule.update.confirm"),cancel:c("router.rule.update.cancel"),color:"primary",params:{did:a.did||"",pathPrefix:"/"===C?C:C.replace(/^\/+/,"").replace(/\/+$/,""),type:a.type||O.ROUTING_RULE_TYPES.BLOCKLET,redirectCode:a.redirectCode||302,componentId:a.componentId||"",pageGroup:a.pageGroup||"",url:a.url||"",__disableConfirm:!1},onConfirm:P,onCancel:function(){v(!1),y(null)}},w=function(e){e.stopPropagation(),y(E)};return(0,ne.jsxs)(ne.Fragment,{children:["function"===typeof l?l({loading:x,open:w}):(0,ne.jsxs)(hn.Z,{onClick:w,className:"rule-action","data-cy":"action-update-rule",children:[x?(0,ne.jsx)(B.Z,{size:16}):(0,ne.jsx)(Ze.default,{style:{fontSize:18,marginRight:5}}),c("router.rule.update.title")]}),b&&(0,ne.jsx)(ae.Z,{title:b.title,description:b.description,confirm:b.confirm,color:b.color,cancel:b.cancel,params:b.params,onConfirm:b.onConfirm,onCancel:b.onCancel})]})}function Cr(e){var n=(0,i.PE)().locale,t=(0,Cn.y0)(),o=t.blocklet,a=t.recommendedDomain,l=(0,ce.Sk)(a,e.from.pathPrefix,(0,ce.f0)(o,n));return(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center",children:[(0,ne.jsx)("a",{target:"_blank",href:l,rel:"noopener noreferrer",title:l,children:(0,ne.jsx)(y.Z,{size:"small",children:(0,ne.jsx)(E.Z,{})})}),(0,ne.jsx)(jr,(0,r.Z)((0,r.Z)({},e),{},{children:function(n){var t=n.open;return(0,ne.jsx)(y.Z,{size:"small",onClick:t,disabled:e.isProtected,"data-cy":"action-update-rule",children:(0,ne.jsx)(C.Z,{})})}})),(0,ne.jsx)(kr,(0,r.Z)((0,r.Z)({},e),{},{children:function(n){var t=n.open;return(0,ne.jsx)(y.Z,{size:"small",onClick:t,disabled:e.isProtected,"data-cy":"action-delete-rule",children:(0,ne.jsx)(I.default,{})})}}))]})}kr.propTypes={id:f().string.isRequired,from:f().object.isRequired,children:f().any},kr.defaultProps={children:null},jr.propTypes={id:f().string.isRequired,from:f().object.isRequired,to:f().object.isRequired,children:f().any},jr.defaultProps={children:null},Cr.propTypes={isProtected:f().bool},Cr.defaultProps={isProtected:!1};var Pr=["group"];function Er(e){var n=e.group,t=(0,l.Z)(e,Pr);return n?(0,ne.jsx)(Y.Z,(0,r.Z)((0,r.Z)({type:"reverse"},t),{},{children:n})):null}function wr(e){var n=e.domain,t=e.isHttps,r=e.toUrl,o=t?"https":"http",i=r;return Rt()(i)||(i="".concat(o,"://").concat(n).concat(r)),(0,ne.jsx)(ee.Z,{href:i,target:"_blank",style:{fontSize:14},underline:"hover",children:r},i)}function Rr(e){var n=e.hasPermission,t=(0,i.PE)(),o=t.t,a=t.locale,l=(0,Zr.Z)(),c=(0,Cn.y0)(),s=c.blocklet,u=c.recommendedDomain;return s.site.rules.filter((function(e){return e.to.type!==O.ROUTING_RULE_TYPES.BLOCKLET})).map((function(e){var t=null,i=null;e.to.type===O.ROUTING_RULE_TYPES.NONE?t="404":e.to.type===O.ROUTING_RULE_TYPES.REDIRECT?t=e.to.redirectCode:e.to.type===O.ROUTING_RULE_TYPES.GENERAL_REWRITE?t="R":e.to.type===O.ROUTING_RULE_TYPES.COMPONENT&&(i=s.children.find((function(n){return n.meta.did===e.to.componentId})),t="C");var c=e.isProtected?(0,ne.jsx)(R.Z,{title:o("blocklet.router.urlLockTooltip"),placement:"top",children:(0,ne.jsx)("span",{children:(0,ne.jsx)(y.Z,{disabled:!0,size:"small",style:{pointerEvents:"auto",paddingTop:0,paddingBottom:0,margin:"12px 0"},children:(0,ne.jsx)(br.Z,{style:{fill:l.palette.text.disabled}})})})}):(0,ne.jsx)(Cr,(0,r.Z)({},e));return[(0,ne.jsxs)(x.Z,{display:"flex",py:2,className:"component-item",justifyContent:"space-between",alignItems:"center",children:[(0,ne.jsxs)(x.Z,{width:{xs:300,md:400},display:"flex",alignItems:"center",children:[(0,ne.jsx)(x.Z,{width:28}),"object"===typeof t?t:(0,ne.jsx)(_t.Z,{children:t}),(0,ne.jsxs)(x.Z,{ml:2,children:[(0,ne.jsxs)(x.Z,{style:{color:"#222",fontSize:16},children:[e.to.type===O.ROUTING_RULE_TYPES.NONE&&o("common.page404"),e.to.type===O.ROUTING_RULE_TYPES.REDIRECT&&o("common.redirect"),e.to.type===O.ROUTING_RULE_TYPES.GENERAL_REWRITE&&o("common.rewrite"),e.to.type===O.ROUTING_RULE_TYPES.COMPONENT&&(0,A.getDisplayName)(i,!0)]}),(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center",children:[e.to.type===O.ROUTING_RULE_TYPES.REDIRECT&&(0,ne.jsx)(wr,{domain:u,toUrl:e.to.url}),e.to.type===O.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(0,ne.jsx)(wr,{domain:u,toUrl:e.to.url}),e.to.type===O.ROUTING_RULE_TYPES.COMPONENT&&(0,ne.jsx)(Er,{group:e.to.pageGroup})]})]})]}),(0,ne.jsx)(x.Z,{px:2,sx:{display:{xs:"none",md:"flex"}},alignItems:"center",flexGrow:"1",children:(0,ne.jsx)(ee.Z,{href:(0,ce.Sk)(u,e.from.pathPrefix,(0,ce.f0)(s,a)),target:"_blank",style:{fontSize:16},underline:"hover",children:e.from.pathPrefix})},e.from.pathPrefix),(0,ne.jsx)(x.Z,{children:n&&(0,ne.jsx)("div",{style:{textAlign:"right"},children:c})},"actions")]},"rule"),(0,ne.jsx)(rn.Z,{},"divider")]}))}Er.propTypes={group:f().string.isRequired},wr.propTypes={domain:f().string.isRequired,toUrl:f().string.isRequired,isHttps:f().bool},wr.defaultProps={isHttps:!1},Rr.propTypes={hasPermission:f().bool},Rr.defaultProps={hasPermission:!1};var Tr=(0,se.V)(Rr,"mutate_blocklets"),Sr=(0,se.V)(Rr,"",ce.Wf);function _r(e){return(0,le.h6)().inService?(0,ne.jsx)(Sr,(0,r.Z)({},e)):(0,ne.jsx)(Tr,(0,r.Z)({},e))}var Ur,Ir,Nr,Lr=t(92726),Dr=["blocklet","onUpdate","getComponentUrl"],Or=function(e,n){return e?[{name:n("common.name"),value:e.displayName},{name:n("common.description"),value:e.description},{name:n("common.version"),value:(0,ne.jsx)(Y.Z,{children:e.version})}]:[]},Br=function(e){var n=e.source,t=e.deployedFrom,r=e.bundleSource;return n?{source:n,deployedFrom:t}:r?r.url?{source:"url",deployedFrom:t||Array.isArray(r.url)?r.url[0]:r.url}:r.store?{source:"registry",deployedFrom:t||Array.isArray(r.store)?r.store[0]:r.store}:{}:{source:"upload",deployedFrom:t}},Fr=function(e,n){for(var t=e.split("/").slice(1),r=n,o=0,i=[];r&&o<t.length;){var a=r.children.find((function(e){return e.meta.did===t[o]}));r=a,o++,a&&i.push(a.meta.title)}return i.join(" / ")};function zr(e){var n,t,r,a,l=e.blocklet,c=e.ancestors,p=e.depth,m=e.onRemove,f=e.onStart,Z=e.onStop,b=e.onRestart,k=e.onReload,j=e.getComponentUrl,w=e.app,T=(0,o.useContext)(i.RD),S=T.t,N=T.locale,L=(0,o.useState)(),O=(0,d.Z)(L,2),B=O[0],z=O[1],q=(0,o.useState)(!1),G=(0,d.Z)(q,2),W=G[0],H=G[1],X=(0,o.useState)(!1),$=(0,d.Z)(X,2),J=$[0],Q=$[1],ee=(0,o.useState)(null),oe=(0,d.Z)(ee,2),ie=oe[0],le=oe[1],se=(0,K.K)().deletingBlocklets,ue=l.status;1===p&&se.includes(l.meta.did)&&(ue="deleting");var de,pe="/".concat(l.mountPoint||"/").replace(/\/+/g,"/"),me=j(pe),he=B?Br(B):{},xe=B?[{name:S("common.name"),value:(0,A.getDisplayName)(B,!0)},{name:S("common.version"),value:(0,ne.jsx)(fe,{blocklet:B,checkUpgrade:!1})},{name:S("common.status"),value:(0,ne.jsx)(re.Z,{status:ue,source:B.source})},"running"===l.status?{name:S("blocklet.startedAt"),value:(0,ce.B2)(l.startedAt,N)}:null,"running"!==l.status?{name:S("blocklet.stoppedAt"),value:(0,ce.B2)(l.stoppedAt,N)}:null,l.installedAt?{name:S("blocklet.installedAt"),value:(0,ce.B2)(l.installedAt,N)}:null,(0,A.hasStartEngine)(l.meta)?{name:S("common.mountPoint"),value:pe}:null,B.meta.group?{name:S("common.group"),value:(0,ne.jsx)(Y.Z,{type:"success",children:B.meta.group})}:null,{name:S("blocklet.overview.source"),value:(0,ne.jsx)(te,{sourceInfo:he,blocklet:l})},{name:S("blocklet.overview.deployedFrom"),value:he.deployedFrom||"-"},{name:S("common.did"),value:(0,ne.jsx)(V.Z,{did:B.meta.did})},{name:S("common.author"),value:(0,ce.rq)(B.meta.author)},{name:S("common.engine"),value:Or(B.engine,S).map((function(e){var n=e.name,t=e.value;return(0,ne.jsx)(F.Z,{style:{marginBottom:4},nameWidth:120,name:n,children:t},n)}))},null!==(n=l.dependents)&&void 0!==n&&n.length?{name:S("common.dependents"),value:(0,ne.jsx)(x.Z,{children:l.dependents.map((function(e){return(0,ne.jsx)(x.Z,{children:"".concat(Fr(e.id,w)," ").concat(e.required?"(".concat(S("common.required"),")"):"")})}))})}:null,null!==(t=l.meta.resources)&&void 0!==t&&t.length?{name:S("common.resource"),value:l.meta.resources.join(", ")}:null].filter(Boolean):[],Ze=(0,A.isInProgress)(w.status),be=(0,A.isInProgress)(l.status),ye="";if(Ze||be||1===p&&se.includes(l.meta.did))ye=S("blocklet.component.tip.stopBlocklet");else if(null!==(r=l.dependents)&&void 0!==r&&r.length){var ke=l.dependents.filter((function(e){return e.required}));if(ke.length){var je=ke.map((function(e){return Fr(e.id,w)}));ye=S("blocklet.component.tip.requiredBy",{name:je.join(", ")})}}return[(0,ne.jsxs)(Ar,{display:"flex",py:2,className:"component-item",justifyContent:"space-between",alignItems:"center",children:[(0,ne.jsxs)(x.Z,{pl:2,width:{xs:300,md:400},display:"flex",alignItems:"center",children:[(0,ne.jsx)(ve.Z,{blocklet:l,ancestors:c}),(0,ne.jsxs)(x.Z,{ml:"16px",children:[(0,ne.jsx)(x.Z,{className:"component-name",onClick:function(){return z(l)},children:(0,A.getDisplayName)(l,!0)}),(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center",children:[(0,ne.jsx)(fe,{blocklet:l,checkUpgrade:!1}),(0,ne.jsx)(ge.Z,{style:{marginLeft:4},mode:l.mode||""}),"unknown"!==ue&&(0,ne.jsx)(re.Z,{style:{marginLeft:4},status:ue,source:l.source}),!(null===(a=l.dependents)||void 0===a||!a.length)&&(0,ne.jsx)(R.Z,{title:["".concat(S("common.dependents"),": "),l.dependents.map((function(e){return(0,ne.jsx)(x.Z,{pl:1,children:"".concat(Fr(e.id,w)," ").concat(e.required?"(".concat(S("common.required"),")"):"")})}))],children:(0,ne.jsx)(x.Z,{display:"flex",color:"primary.main",ml:1,children:(0,ne.jsx)(D.JO,{icon:"octicon:package-dependents-16"})})})]})]})]},l),(0,A.hasStartEngine)(l.meta)&&(0,ne.jsx)(x.Z,{sx:{display:{xs:"none",md:"flex"}},alignItems:"center",flexGrow:"1",children:(0,ne.jsx)("a",{target:"_blank",href:me,rel:"noopener noreferrer",title:me,children:(0,ne.jsx)(x.Z,{maxWidth:400,sx:{color:"secondary.main",fontSize:18,px:2},overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",children:M()(pe)})})},pe),(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center",children:[(0,A.hasStartEngine)(l.meta)&&(0,ne.jsx)(R.Z,{title:S("common.visit"),children:(0,ne.jsx)("a",{target:"_blank",href:me,rel:"noopener noreferrer",children:(0,ne.jsx)(y.Z,{size:"small",children:(0,ne.jsx)(E.Z,{})})})}),(0,A.hasStartEngine)(l.meta)&&(0,ne.jsx)(Me,{blocklet:l,ancestors:c,children:function(e){var n=e.open;return(0,ne.jsx)(R.Z,{title:S("common.config"),children:(0,ne.jsx)(qr,{color:"error",badgeContent:"",variant:"dot",invisible:!(0,A.getComponentMissingConfigs)(l,c[0]).length,children:(0,ne.jsx)(y.Z,{onClick:n,size:"small",children:(0,ne.jsx)(C.Z,{})})})},"config")}}),(0,ne.jsx)(nn,{blocklet:w,component:l,onStart:f,onStop:Z,disabled:!["starting","stopping"].includes(w.status)&&(0,A.isInProgress)(w.status)}),(0,ne.jsx)(Lr.Z,{"data-cy":"component-actions",actions:[(0,A.hasStartEngine)(l.meta)?{icon:(0,ne.jsx)(P.Z,{}),text:S("common.detail"),onClick:function(){z(l)}}:null,{icon:(0,ne.jsx)(_.default,{}),text:S("common.restart"),onClick:function(){le({title:"".concat(S("common.restart")," ").concat(l.meta.title),description:S("blocklet.action.restartDescription"),confirm:S("blocklet.action.confirmRestart"),cancel:S("common.cancel"),onConfirm:function(){var e=(0,u.Z)((0,s.Z)().mark((function e(){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Q(!0),e.next=3,b(l);case 3:Q(!1);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),onCancel:function(){return le(null)}})},disabled:Ze||be||"running"!==l.status},{icon:(0,ne.jsx)(U.Z,{}),text:S("common.reload"),onClick:function(){var e=(0,u.Z)((0,s.Z)().mark((function e(){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Q(!0),e.next=3,k(l);case 3:Q(!1);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),disabled:J||Ze||be||"running"!==l.status},{icon:(0,ne.jsx)(I.default,{}),text:S("common.delete"),onClick:function(){H(!0)},disabled:Ze||be||!!ye,tip:ye}].filter(Boolean)})]},"actions")]},"group-not-gateway-box"),(0,ne.jsx)(rn.Z,{depth:2}),!!B&&(0,ne.jsx)(h.Z,{open:!0,fullWidth:!0,maxWidth:"md",onClose:function(){z(null)},children:(0,ne.jsxs)(x.Z,{paddingY:1.5,children:[(0,ne.jsx)(g.Z,{children:S("common.componentBasicInfo")}),(0,ne.jsx)(v.Z,{children:(de=xe,de.map((function(e){return e.name===S("common.did")||e.name===S("blocklet.appId")?(0,ne.jsx)(F.Z,{valueComponent:"div",nameWidth:120,name:e.name,nameFormatter:function(){return e.name},children:e.value},e.name):(0,ne.jsx)(F.Z,{valueComponent:"div",nameWidth:120,name:e.name,children:e.value},e.name)})))})]},"dialog-wrapper")},"base-info-dialog"),(0,ne.jsx)(Xe,{blocklet:w,component:l,remove:function(){var e=(0,u.Z)((0,s.Z)().mark((function e(){var n=arguments;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Q(!0),e.prev=1,e.next=4,m.apply(void 0,n);case 4:e.next=8;break;case 6:e.prev=6,e.t0=e.catch(1);case 8:Q(!1),H(!1);case 10:case"end":return e.stop()}}),e,null,[[1,6]])})));return function(){return e.apply(this,arguments)}}(),onCancel:function(){return H(!1)},hideBtn:!0,showConfirm:W}),ie&&(0,ne.jsx)(ae.Z,{title:ie.title,description:ie.description,confirm:ie.confirm,cancel:ie.cancel,params:ie.params,onConfirm:ie.onConfirm,onCancel:ie.onCancel})]}zr.propTypes={blocklet:f().object.isRequired,ancestors:f().array,depth:f().number,onRemove:f().func,onStart:f().func,onStop:f().func,onRestart:f().func,onReload:f().func,getComponentUrl:f().func,app:f().object},zr.defaultProps={ancestors:[],depth:0,onRemove:function(){},onStart:function(){},onStop:function(){},onRestart:function(){},onReload:function(){},getComponentUrl:function(){return window.location.origin},app:null};var qr=(0,p.Z)(j.Z)(Ur||(Ur=(0,c.Z)(["\n .BaseBadge-badge {\n top: ","px;\n right: ","px;\n }\n"])),(function(e){return 8*e.top||6}),(function(e){return 8*e.right||6})),Ar=(0,p.Z)(x.Z)(Ir||(Ir=(0,c.Z)(["\n .component-name {\n color: #222;\n font-size: 16px;\n cursor: pointer;\n }\n"])));function Gr(e){var n=e.blocklet,t=(e.onUpdate,e.getComponentUrl),c=(0,l.Z)(e,Dr),p=(0,o.useContext)(i.RD).t,m=(0,le.h6)(),f=m.api,j=m.inService,P=m.info,E=(0,K.K)(),_=E.addDeletingDid,U=E.removeDeletingDid,I=E.matchDeletingDid,D=(0,o.useState)(!1),F=(0,d.Z)(D,2),G=F[0],M=F[1],V=(0,o.useState)(null),Y=(0,d.Z)(V,2),H=Y[0],X=Y[1],$=(0,o.useState)(null),J=(0,d.Z)($,2),Q=J[0],ee=J[1],te=(0,o.useState)(!1),re=(0,d.Z)(te,2),oe=re[0],ie=re[1],ae=n&&n.structVersion!==O.APP_STRUCT_VERSION,ue=(0,o.useState)(!1),de=(0,d.Z)(ue,2),pe=de[0],me=de[1],fe=(0,a.Z)(n.children)||[];"gateway"!==n.meta.group&&fe.unshift(n),I(fe.map((function(e){return e.meta.did})));var he=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(){var t,r,o,i,a;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!G){e.next=2;break}return e.abrupt("return");case 2:return M(!0),e.prev=3,e.next=6,f.checkComponentsForUpdates({input:{did:n.meta.did}});case 6:if(e.t0=e.sent.preUpdateInfo,e.t0){e.next=9;break}e.t0={};case 9:if(t=e.t0,r=t.updateId,o=t.updateList,M(!1),r){e.next=16;break}return W.Z.info(p("blocklet.component.noUpdate")),e.abrupt("return");case 16:i=[],(0,A.forEachChildSync)(n,(function(e,n){var t=n.id,r=n.ancestors,a=o.find((function(e){return e.id===t}));if(a){var l=r.slice(1).concat(e).map((function(e){return e.meta.title||e.meta.name})).join(" / "),c=(r[1]||e).meta.did;i.push({groupId:c,name:l,version:e.meta.version,newVersion:a.meta.version})}})),a={},i.forEach((function(e){a[e.groupId]?e.disabled=!0:a[e.groupId]=!0})),X({params:{updateId:r},list:i,checks:a,hasChecks:!0}),e.next=27;break;case 23:e.prev=23,e.t1=e.catch(3),M(!1),W.Z.error((0,ce.Z)(e.t1));case 27:case"end":return e.stop()}}),e,null,[[3,23]])})));return function(){return e.apply(this,arguments)}}(),xe=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(){var t,r;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!G){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,M(!0),t=Object.keys(H.checks).filter((function(e){return H.checks[e]})),r={updateId:H.params.updateId,rootDid:n.meta.did,selectedComponents:t},e.next=8,f.upgradeComponents({input:r});case 8:M(!1),X(null),me(null),e.next=17;break;case 13:e.prev=13,e.t0=e.catch(2),M(!1),W.Z.error((0,ce.Z)(e.t0));case 17:case"end":return e.stop()}}),e,null,[[2,13]])})));return function(){return e.apply(this,arguments)}}(),ve=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(t,r){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return _(t.meta.did),e.prev=1,e.next=4,f.deleteComponent({input:{did:t.meta.did,keepData:"keepData"===r,rootDid:n.meta.did}});case 4:return e.next=6,(0,ce._v)(800);case 6:e.next=12;break;case 8:e.prev=8,e.t0=e.catch(1),W.Z.error((0,ce.Z)(e.t0)),U(t.meta.did);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(n,t){return e.apply(this,arguments)}}(),ge=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(t){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,f.startBlocklet({input:{did:n.meta.did,componentDids:[t.meta.did]}});case 3:return e.next=5,(0,ce._v)(800);case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),W.Z.error((0,ce.Z)(e.t0));case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(n){return e.apply(this,arguments)}}(),Ze=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(t){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,f.stopBlocklet({input:{did:n.meta.did,componentDids:[t.meta.did]}});case 3:return e.next=5,(0,ce._v)(800);case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),W.Z.error((0,ce.Z)(e.t0));case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(n){return e.apply(this,arguments)}}(),be=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(t){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,f.restartBlocklet({input:{did:n.meta.did,componentDids:[t.meta.did]}});case 3:return e.next=5,(0,ce._v)(800);case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),W.Z.error((0,ce.Z)(e.t0));case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(n){return e.apply(this,arguments)}}(),ye=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(t){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,f.reloadBlocklet({input:{did:n.meta.did,componentDids:[t.meta.did]}});case 3:return e.next=5,(0,ce._v)(800);case 5:W.Z.success(p("blocklet.reloadSuccess")),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),W.Z.error((0,ce.Z)(e.t0));case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(n){return e.apply(this,arguments)}}();return(0,ne.jsxs)(Mr,(0,r.Z)((0,r.Z)({component:"div"},c),{},{children:[(0,ne.jsxs)(x.Z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[(0,ne.jsxs)("div",{className:"title",children:[p("common.components"),!ae&&(0,ne.jsx)(se.Z,{permission:j?"":"mutate_blocklets",role:j?ce.Wf:[],children:(0,ne.jsx)(qr,{top:1.2,right:.4,color:"error",badgeContent:"",variant:"dot",invisible:!pe,children:(0,ne.jsxs)(z.Z,{disabled:G||(0,A.isInProgress)(n.status),color:"secondary",onClick:function(){he()},"data-cy":"check-for-updates",children:[(0,ne.jsx)(x.Z,{mr:.5,display:"flex",children:G?(0,ne.jsx)(B.Z,{size:16}):(0,ne.jsx)(b.Z,{style:{fontSize:"1em"}})}),p("blocklet.component.checkUpdateTitle")]})})})]}),(0,ne.jsx)(se.Z,{permission:j?"":"mutate_blocklets",role:j?ce.Wf:[],children:(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center",children:[(0,ne.jsx)(gr,{children:function(e){var t=e.open;return(0,ne.jsxs)(z.Z,{disabled:G||(0,A.isInProgress)(n.status),variant:"text",color:"primary","data-cy":"add-rule",onClick:t,children:[(0,ne.jsx)(k.Z,{style:{fontSize:"1.3em",marginRight:4}}),p("router.rule.add.title")]})}}),!ae&&(0,ne.jsx)(lr,{blocklet:n,serverVersion:P.version,children:function(e){var t=e.open;return(0,ne.jsxs)(z.Z,{disabled:G||(0,A.isInProgress)(n.status),variant:"text",color:"primary","data-cy":"add-component",onClick:t,children:[(0,ne.jsx)(k.Z,{style:{fontSize:"1.3em",marginRight:4}}),p("blocklet.component.add")]})}}),!ae&&(0,ne.jsx)(Me,{blocklet:n,ancestors:[],children:function(e){var n=e.open;return(0,ne.jsx)(R.Z,{title:"".concat(p("blocklet.component.container")).concat(p("common.config")),children:(0,ne.jsx)(y.Z,{onClick:n,size:"small",color:"primary",children:(0,ne.jsx)(C.Z,{style:{fontSize:18}})})},"config")}})]})})]}),fe&&fe.length?(0,ne.jsxs)(x.Z,{mt:2,ml:{xs:"-12px",md:"-24px"},children:["gateway"!==n.meta.group&&(0,ne.jsx)(zr,{blocklet:n,app:n,onRemove:ve,onStart:ge,onStop:Ze,onReload:ye,onRestart:be,getComponentUrl:t},"0-".concat(n.meta.did)),n.children.map((function(e){return(0,ne.jsx)(zr,{depth:1,blocklet:e,ancestors:[n],app:n,onRemove:ve,onStart:ge,onStop:Ze,onReload:ye,onRestart:be,getComponentUrl:t},"1-".concat(e.meta.did))}))]},"top-blocklet-".concat(n.meta.did)):(0,ne.jsx)(x.Z,{mt:8,children:(0,ne.jsx)(q.Z,{children:p("blocklet.component.noComponent")})}),!!n.site.rules.length&&(0,ne.jsx)(x.Z,{mt:0,ml:{xs:"-16px",md:"-28px"},children:(0,ne.jsx)(_r,{})}),!!H&&(0,ne.jsx)(h.Z,{open:!0,fullWidth:!0,children:(0,ne.jsxs)(x.Z,{paddingY:1.5,children:[(0,ne.jsx)(g.Z,{children:p("blocklet.component.updateTitle")}),(0,ne.jsx)(x.Z,{component:v.Z,py:4,children:H.list.map((function(e){return(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center",children:[(0,ne.jsx)(S.Z,{checked:H.checks[e.groupId],onChange:function(n){return function(e,n){var t=e.target.checked;X((function(e){var o=Object.entries(e.checks).reduce((function(e,r){var o=(0,d.Z)(r,2),i=o[0],a=o[1];return e[i]=n===i?t:a,e}),{}),i=Object.values(o).includes(!0);return(0,r.Z)((0,r.Z)({},e),{},{checks:o,hasChecks:i})}))}(n,e.groupId)},style:{marginLeft:e.disabled?16:0},defaultChecked:!0,disabled:e.disabled}),(0,ne.jsxs)(x.Z,{flexGrow:1,mt:3,children:[(0,ne.jsx)(x.Z,{item:!0,xs:8,children:e.name}),e.version&&(0,ne.jsxs)(w.ZP,{fontSize:"h6.fontSize",container:!0,spacing:2,alignItems:"center",children:[(0,ne.jsx)(w.ZP,{item:!0,xs:3,children:e.version}),(0,ne.jsx)(w.ZP,{item:!0,xs:1,children:(0,ne.jsx)(T.Z,{style:{fontSize:"0.9em"}})}),(0,ne.jsx)(w.ZP,{item:!0,xs:3,children:(0,ne.jsx)(x.Z,{color:"secondary.main",children:e.newVersion})})]})]},"".concat(e.name,"-").concat(e.newVersion))]})}))}),(0,ne.jsxs)(Z.Z,{style:{padding:"8px 24px 24px"},children:[(0,ne.jsx)(z.Z,{onClick:function(){X(null)},children:p("common.cancel")}),(0,ne.jsxs)(z.Z,{onClick:function(e){e.stopPropagation(),xe()},color:"primary",disabled:G||!H.hasChecks,variant:"contained",autoFocus:!0,children:[G&&(0,ne.jsx)(B.Z,{size:16}),p("common.update")]})]})]})}),!!Q&&(0,ne.jsx)(h.Z,{open:!0,fullWidth:!0,onClose:function(){return ee(!1)},children:(0,ne.jsxs)(x.Z,{paddingY:1.5,children:[(0,ne.jsx)(g.Z,{children:p("common.configuration")}),(0,ne.jsx)(v.Z,{children:(0,ne.jsx)(x.Z,{py:2,children:(0,ne.jsx)(N.Z,{control:(0,ne.jsx)(L.Z,{checked:oe,onChange:function(e){return ie(!!e.target.checked)}}),label:p("blocklet.component.showContainer")})})})]})})]}))}Gr.propTypes={blocklet:f().object.isRequired,onUpdate:f().func,getComponentUrl:f().func},Gr.defaultProps={onUpdate:function(){},getComponentUrl:function(){return window.location.origin}};var Mr=p.Z.div(Nr||(Nr=(0,c.Z)(["\n .title {\n font-size: 1.2rem;\n font-weight: bold;\n margin-bottom: ",";\n }\n\n @keyframes showDelay {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n }\n\n .component-item {\n animation: showDelay 0.75s ease 1;\n }\n"])),(function(e){return e.theme.spacing(1)})),Wr=t(13671);function Kr(e){var n=(0,o.useContext)(i.RD).locale,t=(0,Wr.y0)(),a=t.blocklet,l=t.recommendedDomain;return(0,ne.jsx)(Gr,(0,r.Z)({blocklet:a,getComponentUrl:function(e){return(0,ce.vH)({blocklet:a,domain:{value:l},mountPoint:e,params:(0,ce.f0)(a,n)})}},e))}Kr.defaultProps={}},44543:function(e,n,t){var r=t(57156);e.exports=function(e,n){return r(e)===r(n)}},92726:function(e,n,t){"use strict";t.d(n,{Z:function(){return j}});var r,o=t(71171),i=t(32723),a=t(34795),l=t(33028),c=t(96234),s=t(59740),u=t(5057),d=t(55898),p=t.n(d),m=t(33518),f=t(67680),h=t(61533),x=t(74490),v=t(45267),g=t(46954),Z=t(44067),b=t(96266),y=["actions","size"],k=["icon","text","onClick","disabled"];function j(e){var n=e.actions,t=e.size,r=(0,s.Z)(e,y),o=(0,u.useState)(null),d=(0,c.Z)(o,2),p=d[0],m=d[1],j=Boolean(p),P=function(e){try{e.stopPropagation(),e.preventDefault()}catch(n){}m(null)};return(0,b.jsxs)(C,(0,l.Z)((0,l.Z)({},r),{},{children:[(0,b.jsx)(f.Z,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"actions-menu-icon",onClick:function(e){try{e.stopPropagation(),e.preventDefault()}catch(n){}m(e.currentTarget)},size:t,children:(0,b.jsx)(v.Z,{})}),(0,b.jsx)(h.Z,{id:"actions-menu","data-cy":"actions-menu",anchorEl:p,keepMounted:!0,open:j,onClose:P,PaperProps:{},children:n.map((function(e,n){if("function"===typeof e)return e({close:P});var t=e.icon,r=e.text,o=e.onClick,c=e.disabled,d=void 0!==c&&c,p=(0,s.Z)(e,k);return(0,u.createElement)(x.Z,(0,l.Z)((0,l.Z)({},p),{},{disabled:d,dense:!0,onClick:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(n){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o(n);case 2:P();case 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),key:n,"data-cy":"actions-menu-".concat(n)}),(0,b.jsx)(g.Z,{style:{minWidth:24,marginRight:8},children:t}),(0,b.jsx)(Z.Z,{primary:r}))}))})]}))}j.propTypes={actions:p().array,size:p().oneOf(["small","medium","large"])},j.defaultProps={actions:[],size:"small"};var C=m.Z.div(r||(r=(0,o.Z)([""])))},31440:function(e,n,t){"use strict";t.d(n,{Z:function(){return x}});var r,o=t(71171),i=t(55898),a=t.n(i),l=t(85493),c=t(33518),s=t(68420),u=t(40265),d=t(44566),p=t(33028),m=t(33665),f=t(96266);function h(e){var n=Object.assign({},((0,m.Z)(e),e));return(0,f.jsxs)("div",(0,p.Z)((0,p.Z)({},n),{},{style:{width:"100%"},children:[(0,f.jsx)("h3",{children:"End User License Agreement for Application"}),(0,f.jsx)("p",{children:"Blocklet Server License Agreement ArcBlock, Inc. version 2020-08-28"}),(0,f.jsx)("p",{children:"BLOCKLET SERVER LICENSE AGREEMENT"}),(0,f.jsx)("p",{children:"\u6682\u65e0"})]}))}function x(e){var n=e.meta,t=e.onClickNext,r=e.handleDescEle,o=(0,l.useNavigate)(),i=(0,s.PE)(),a=i.t,c=i.locale,p=t||function(){o("/launch-blocklet/install".concat(window.location.search))};return(0,f.jsxs)(v,{children:[(0,f.jsx)("div",{className:"app-content",children:(0,f.jsx)("div",{className:"agreement",children:(0,f.jsx)("div",{className:"agreement-content",children:(0,f.jsx)(d.Z,{blockletMeta:{data:n},locale:c,handleDescEle:r})})})}),(0,f.jsx)("div",{className:"button-container","data-cy":"agree-all",children:(0,f.jsx)(u.Z,{onContinue:p,description:(0,f.jsx)(h,{}),texts:{listenName:a("launchBlocklet.license"),buttonNext:a("launchBlocklet.next")}})})]})}x.propTypes={meta:a().object.isRequired,onClickNext:a().func,handleDescEle:a().node},x.defaultProps={onClickNext:null,handleDescEle:""};var v=c.Z.div(r||(r=(0,o.Z)(["\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n height: 100%;\n flex: 1;\n .app-content {\n padding: 2px 24px 24px;\n "," {\n padding-top: 10px;\n }\n width: 100%;\n flex: 1;\n letter-spacing: normal;\n }\n .agreement {\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n border: 1px solid ",";\n border-radius: 12px;\n "," {\n margin-top: 24px;\n }\n "," {\n margin-top: 16px;\n }\n .agreement-content {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n font-size: 14px;\n overflow-y: auto;\n "," {\n padding: 0 24px;\n }\n "," {\n padding: 0 16px;\n }\n &:after {\n display: block;\n content: '';\n height: 24px;\n }\n }\n }\n .button-container {\n padding-top: 24px;\n padding-bottom: 34px;\n "," {\n padding-right: 24px;\n margin-left: auto;\n }\n "," {\n padding-top: 0;\n padding-bottom: 16px;\n }\n }\n"])),(function(e){return e.theme.breakpoints.down("md")}),(function(e){return e.theme.palette.grey[100]}),(function(e){return e.theme.breakpoints.up("md")}),(function(e){return e.theme.breakpoints.down("md")}),(function(e){return e.theme.breakpoints.up("md")}),(function(e){return e.theme.breakpoints.down("md")}),(function(e){return e.theme.breakpoints.up("md")}),(function(e){return e.theme.breakpoints.down("md")}))},80378:function(e,n,t){"use strict";t.d(n,{Z:function(){return x}});var r=t(33028),o=t(59740),i=t(55898),a=t.n(i),l=t(62681),c=t(72333),s=t(6352),u=t.n(s),d=t(35432),p=t(58238),m=t(14491);var f=t(96266),h=["blocklet","style","size","ancestors"];function x(e){var n=e.blocklet,t=e.style,i=e.size,a=e.ancestors,s=(0,o.Z)(e,h),x=(0,p.h6)(),v=function(e){var n,t=e.blocklet,r=e.ancestors,o=void 0===r?[]:r,i=(0,p.h6)(),a=i.inService,l="?v=".concat(null===t||void 0===t||null===(n=t.meta)||void 0===n?void 0:n.version).concat((0,m.XN)(null===t||void 0===t?void 0:t.status)?"~":""),c=a?u()(m.zn,d.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo-bundle",l):u()(i.imgPrefix,"blocklet.png");if("registry"===t.source&&t.deployedFrom&&t.meta.logo)c=u()(t.deployedFrom,(0,m.lk)(t.meta.bundleDid,t.meta.logo),l);else{var s=window.env.apiPrefix||"/",f=o.concat(t),h=a?f.slice(1):f;c=u()(s,"/blocklet/logo-bundle".concat(h.map((function(e){return"/".concat(e.meta.did)})).join("")),l)}return{logoUrl:c,inService:a}}({blocklet:n,ancestors:a}),g=v.logoUrl,Z=v.inService,b=s.variant,y=Z?function(){}:function(e){e.target.src="".concat(x.imgPrefix,"/blocklet.png")},k=(0,f.jsx)("img",{src:g,onError:y,alt:n.meta.name,style:{width:i}});return n.meta.logo||(k=(0,f.jsx)(c.Z,{did:n.meta.did||"",responsive:!0})),(0,f.jsx)(l.Z,(0,r.Z)((0,r.Z)({variant:b||"square",style:Object.assign({backgroundColor:"transparent",width:i,height:i,borderRadius:10},t)},s),{},{children:k}))}x.propTypes={blocklet:a().object.isRequired,style:a().object,size:a().oneOfType([a().number,a().string]),ancestors:a().array},x.defaultProps={style:{},size:40,ancestors:[]}},74286:function(e,n,t){"use strict";t.d(n,{Z:function(){return l}});var r=t(55898),o=t.n(r),i=t(39948),a=t(96266);function l(e){var n=e.depth;return(0,a.jsx)(i.Z,{ml:Math.max(2*(n-1),0),sx:{borderBottom:1,borderColor:"rgba(0,0,0,0.12)"}},"group-collapse-box")}l.propTypes={depth:o().number},l.defaultProps={depth:1}},61813:function(e,n,t){"use strict";t.d(n,{Z:function(){return S}});var r=t(33028),o=t(32723),i=t(34795),a=t(96234),l=t(5057),c=t(55898),s=t.n(c),u=t(13128),d=t(44846),p=t(55372),m=t(11750),f=t(47020),h=t(20870),x=t(31089),v=t(71767),g=t(64886),Z=t(55152),b=t(68420),y=t(28726),k=t(88574),j=t(38242),C=t(58238),P=t(73545),E=t(14491),w=t(4651),R=t(17450),T=t(96266);function S(e){var n=e.defaultUrl,t=e.onCancel,c=e.onSuccess,s=e.onError,S=e.mode,_=e.handleText,U=(0,C.h6)().api,I=(0,P.T)().api,N=(0,l.useState)(!1),L=(0,a.Z)(N,2),D=L[0],O=L[1],B=(0,l.useState)(""),F=(0,a.Z)(B,2),z=F[0],q=F[1],A=(0,b.PE)().t,G={dist:{}},M=(0,l.useState)(n),W=(0,a.Z)(M,2),K=W[0],V=W[1],Y=(0,l.useState)(n?1:0),H=(0,a.Z)(Y,2),X=H[0],$=H[1],J=(0,l.useState)(G),Q=(0,a.Z)(J,2),ee=Q[0],ne=Q[1],te=(0,l.useState)(!1),re=(0,a.Z)(te,2),oe=re[0],ie=re[1],ae=(0,l.useState)({}),le=(0,a.Z)(ae,2),ce=le[0],se=le[1],ue="component"===S,de=!!ue||!n,pe=function(){var e=(0,i.Z)((0,o.Z)().mark((function e(){var n,t,r,i,a,l;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:ne(G),q(null),O(!0),e.prev=3,n=decodeURIComponent(K.trim()),e.prev=5,new URL(n),e.next=12;break;case 9:throw e.prev=9,e.t0=e.catch(5),new Error("Invalid URL");case 12:return e.next=14,U.getBlockletMetaFromUrl({input:{url:n}});case 14:t=e.sent,r=t.meta,i=t.inStore,a=t.registryUrl,ne(r),se({inStore:i,registryUrl:a,inputUrl:K.trim()}),e.next=28;break;case 22:e.prev=22,e.t1=e.catch(3),console.error(e.t1),l="Blocklet Install failed: ".concat((0,E.Z)(e.t1)),q(l),s(e.t1);case 28:return e.prev=28,O(!1),e.finish(28);case 31:case"end":return e.stop()}}),e,null,[[3,22,28,31],[5,9]])})));return function(){return e.apply(this,arguments)}}();(0,l.useEffect)((function(){n&&pe()}),[n]);var me=[{name:A("common.name"),value:(0,j.getDisplayName)({meta:ee},!0)},{name:A("common.version"),value:ee.version},{name:A("common.did"),value:(0,T.jsx)(R.Z,{did:ee.did})},{name:A("common.author"),value:(0,E.rq)(ee.author)},{name:A("blocklet.dist.downloadLink"),value:ee.dist.tarball}],fe=[{label:A("blocklet.fromUrl.step0"),body:(0,T.jsx)(m.Z,{component:"div",children:(0,T.jsx)(f.Z,{label:A("blocklet.fromUrl.label"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"blocklet-url-input",fullWidth:!0,autoFocus:!0,style:{marginBottom:32},margin:"dense",helperText:A("blocklet.fromUrl.description"),value:K,onChange:function(e){q(null),V(e.target.value)},disabled:D,onKeyPress:function(e){"Enter"===e.key&&(e.preventDefault(),pe(),$(1))}})}),cancel:A("common.cancel"),confirm:A("common.next"),onCancel:t,onConfirm:function(){pe(),$(1)}},{label:A("blocklet.fromUrl.step1"),body:D?(0,T.jsx)("div",{style:{height:200,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:(0,T.jsx)(d.Z,{})}):ee.did?(0,T.jsx)("div",{style:{paddingLeft:"10%"},children:me.map((function(e){return e.name===A("common.did")?(0,T.jsx)(g.Z,{valueComponent:"div",nameWidth:120,name:e.name,nameFormatter:function(){return A("common.did")},children:e.value},e.name):(0,T.jsx)(g.Z,{valueComponent:"div",nameWidth:120,name:e.name,children:e.value},e.name)}))}):null,cancel:A(de?"common.pre":"common.cancel"),confirm:(null===_||void 0===_?void 0:_.confirm)||A("blocklet.fromUrl.confirm"),onCancel:function(){de?$((function(e){return e-1})):t()},onConfirm:function(){!function(){if(ue)return c((0,r.Z)({meta:ee},ce)),void t();O(!0),ie(!0)}()}}],he=fe[X];return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(u.ZP,{title:(null===_||void 0===_?void 0:_.title)||A("blocklet.fromUrl.title"),fullWidth:!0,maxWidth:"md",onClose:function(){return he.onCancel()},showCloseButton:0===X,disableEscapeKeyDown:!0,open:!0,actions:(0,T.jsxs)(T.Fragment,{children:[he.cancel&&(0,T.jsx)(y.Z,{onClick:function(e){e.stopPropagation(),q(null),he.onCancel()},color:"inherit",children:he.cancel||A("common.cancel")}),(0,T.jsxs)(y.Z,{onClick:function(e){e.stopPropagation(),he.onConfirm()},color:"primary","data-cy":"install-blocklet-next-step",disabled:D||!K||z,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[D&&0===X&&(0,T.jsx)(d.Z,{size:16}),he.confirm]})]}),children:[de&&(0,T.jsx)(h.Z,{alternativeLabel:!0,activeStep:X,children:fe.map((function(e){var n=e.label;return(0,T.jsx)(x.Z,{children:(0,T.jsx)(v.Z,{children:n})},n)}))}),(0,T.jsx)(p.Z,{component:"div",style:{marginTop:24},children:he.body}),!!z&&(0,T.jsx)(k.Z,{type:"error",style:{width:"100%",marginTop:8},children:z})]}),ee&&oe&&(0,T.jsx)(Z.default,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:I.get,checkTimeout:3e5,onSuccess:function(){O(!1),ie(!1),c((0,r.Z)({meta:ee},ce)),t()},extraParams:{title:ee.title,wt:(0,w.iK)(ee),blockletMetaUrl:decodeURIComponent(K.trim())},messages:{title:A("setup.keyPair.title"),scan:A("setup.keyPair.scan"),confirm:A("setup.keyPair.confirm"),success:A("setup.keyPair.success")},onClose:function(){O(!1),ie(!1)}})]})}S.propTypes={defaultUrl:s().string,onCancel:s().func.isRequired,onSuccess:s().func.isRequired,onError:s().func,mode:s().oneOf(["install","component"]),handleText:s().object},S.defaultProps={onError:function(){},defaultUrl:"",mode:"install",handleText:{}}},32349:function(e,n,t){"use strict";t.d(n,{Z:function(){return u}});var r=t(33028),o=t(59740),i=t(55898),a=t.n(i),l=t(22228),c=t(96266),s=["mode"];function u(e){var n=e.mode,t=(0,o.Z)(e,s);return"development"===n?(0,c.jsx)(l.Z,(0,r.Z)((0,r.Z)({type:"primary"},t),{},{children:"DEV"})):null}u.propTypes={mode:a().string.isRequired}},51233:function(e,n,t){"use strict";t.d(n,{Rw:function(){return u},fX:function(){return s},sf:function(){return d},ub:function(){return c}});var r=t(35432),o=t(44543),i=t.n(o),a=t(76811),l=function(e,n){if(e.type===r.ROUTING_RULE_TYPES.REDIRECT){if(!e.url)return new Error("".concat(n("router.validation.redirectUrlRequired")));if(!e.redirectCode)return new Error("redirect ".concat(n("router.validation.redirectCodeRequired")))}else if(e.type===r.ROUTING_RULE_TYPES.BLOCKLET&&!e.did)return new Error(n("router.validation.didRequired"));return null},c=function(e,n){return e?e.endsWith(r.DEFAULT_IP_DOMAIN_SUFFIX)?n("router.domain.validate.suffixTip",{suffix:r.DEFAULT_IP_DOMAIN_SUFFIX}):null:n("router.domain.validate.emptyTip")},s=function(e,n){var t=l(e,n);return t||(e.pathPrefix.length?e.pathPrefix.length>150?new Error(n("router.validation.pathPrefixTooLong",{length:150})):null:new Error(n("router.validation.pathPrefixCannotBeEmpty")))},u=function(e){var n=e.params,t=e.blocklets,r=e.blocklet,o=e.locale,l=void 0===o?"en":o;if(r){var c=(r.children||[]).find((function(e){return i()(e.mountPoint,n.pathPrefix)}));if("gateway"!==r.meta.group&&"/"===n.pathPrefix&&(c="/"),c)return{zh:"\u6302\u8f7d\u70b9 ".concat(n.pathPrefix," \u5df2\u5b58\u5728\uff0c\u8bf7\u4f7f\u7528\u5176\u4ed6\u6302\u8f7d\u70b9"),en:"The mount point ".concat(n.pathPrefix," already exist, please use another mount point")}[l]}var s=t.find((function(e){return e.meta.did===n.did}));if(!s)return"";var u=s.meta.interfaces.find((function(e){return"web"===e.type}));return u&&u.prefix!==a.BLOCKLET_DYNAMIC_PATH_PREFIX&&n.pathPrefix!==u.prefix?{zh:"\u8be5 blocklet \u53ea\u80fd\u6302\u8f7d\u5728 ".concat(u.prefix),en:"This blocklet can only be mounted on ".concat(u.prefix)}[l]:""},d=function(e){if(!e||"string"!==typeof e)return e;var n=e.trim();try{return(n=n.toLowerCase()).startsWith("http://")||n.startsWith("https://")?new URL(n).hostname:n}catch(t){return console.error("format domain failed",t),n}}},28641:function(e,n,t){"use strict";t.d(n,{Z:function(){return j}});var r=t(33028),o=t(32723),i=t(34795),a=t(96234),l=t(59740),c=t(5057),s=t(55898),u=t.n(s),d=t(39948),p=t(47020),m=t(44846),f=t(13727),h=t(56184),x=t(67680),v=t(35406),g=t(11875),Z=t(95890),b=t(96266),y=["label","disabled","required","initialValue","onChange","placeholder","style","onSubmit","secure","triggers","formatterBeforeSubmit"],k=function(e,n,t){return null===e&&n&&t?"******":e?n?"******":e:""};function j(e){var n=e.label,t=e.disabled,s=e.required,u=e.initialValue,j=e.onChange,C=e.placeholder,P=e.style,E=e.onSubmit,w=e.secure,R=e.triggers,T=e.formatterBeforeSubmit,S=(0,l.Z)(e,y),_=(0,c.useState)(!1),U=(0,a.Z)(_,2),I=U[0],N=U[1],L=(0,c.useState)(!1),D=(0,a.Z)(L,2),O=D[0],B=D[1],F=(0,c.useState)(w&&"__encrypted__"===u?null:u),z=(0,a.Z)(F,2),q=z[0],A=z[1],G=(0,c.useState)(q),M=(0,a.Z)(G,2),W=M[0],K=M[1],V=function(){var e=(0,i.Z)((0,o.Z)().mark((function e(){var n;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return B(!0),e.prev=1,e.next=4,E(W);case 4:!1===e.sent?K(q):(n=W,"function"===typeof T&&(n=T(W)),K(n),A(n)),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),K(q);case 11:return e.prev=11,B(!1),N(!1),e.finish(11);case 15:case"end":return e.stop()}}),e,null,[[1,8,11,15]])})));return function(){return e.apply(this,arguments)}}(),Y=function(e){K(e),j(e)},H=I?(0,b.jsx)(p.Z,(0,r.Z)({style:{flex:1},fullWidth:!0,value:W,onChange:function(e){Y(e.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:C,onKeyDown:function(e){"Enter"===e.key&&V()},disabled:t,type:w?"password":"text"},S)):(0,b.jsx)(d.Z,{px:1,className:"form-item-input slot",style:{whiteSpace:"pre-wrap"},children:k(W,w,u)});return(0,b.jsx)(g.Z,{className:"form",style:P,children:(0,b.jsxs)(d.Z,{className:"form-item",children:[(0,b.jsxs)(d.Z,{className:"form-item-label",children:[n,s&&(0,b.jsx)(v.Z,{})]}),(0,b.jsxs)(d.Z,{className:"form-item-body",children:[(0,b.jsx)(d.Z,{className:"form-item-input",children:H}),(0,b.jsx)(d.Z,{className:"form-item-action",children:I?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(x.Z,{"data-cy":"schema-form-item-confirm",onClick:V,disabled:t||O,size:"large",children:O?(0,b.jsx)(m.Z,{size:24}):(0,b.jsx)(h.Z,{})}),(0,b.jsx)(x.Z,{"data-cy":"schema-form-item-cancel",onClick:function(){K(q),N(!1)},disabled:t||O,size:"large",children:(0,b.jsx)(f.default,{})})]}):(0,b.jsx)(Z.Z,{triggers:R,onEnterEdit:function(){return N(!0)},disabled:t})})]})]})})}j.propTypes={style:u().object,onSubmit:u().func,onChange:u().func,label:u().string,initialValue:u().string,placeholder:u().string,required:u().bool,disabled:u().bool,secure:u().bool,triggers:u().array,formatterBeforeSubmit:u().func},j.defaultProps={style:{},onSubmit:function(){},onChange:function(){},label:"",initialValue:"",placeholder:"",required:!1,disabled:!1,secure:!1,triggers:[],formatterBeforeSubmit:null}},11875:function(e,n,t){"use strict";var r,o=t(71171),i=t(33518),a=t(39948);n.Z=(0,i.Z)(a.Z)(r||(r=(0,o.Z)(["\n width: 100%;\n flex-grow: 1;\n overflow-y: auto;\n "," {\n width: 100%;\n flex-shrink: 0;\n padding: 0 24px;\n transform: translate(0, 0);\n /* max-height: 60vh; */\n }\n\n .form-item {\n width: 100%;\n margin-bottom: 24px;\n position: relative;\n "," {\n flex-wrap: wrap;\n justify-content: space-between;\n width: 100%;\n flex-shrink: 0;\n }\n }\n\n .form-item-body {\n display: flex;\n align-items: center;\n width: 100%;\n margin-top: 4px;\n }\n\n .form-item-label {\n line-height: 1.2;\n font-size: 14px;\n color: #888;\n font-weight: bold;\n\n "," {\n text-align: left;\n width: auto;\n flex-grow: 1;\n }\n }\n\n .form-item-input {\n flex-grow: 1;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n\n &.slot {\n height: 40px;\n line-height: 40px;\n background: #f8f8f8;\n font-size: 16px;\n\n .MuiChip-root {\n margin-top: -4px;\n }\n }\n\n .MuiSelect-select {\n padding: 8px;\n }\n }\n\n .form-item-action {\n // width: 100px;\n text-align: left;\n margin-left: 12px;\n flex-shrink: 0;\n "," {\n width: auto;\n margin-left: 0px;\n }\n .MuiIconButton-root {\n padding: 8px;\n svg {\n fill: #888;\n }\n &.Mui-disabled {\n opacity: 0.4;\n }\n }\n }\n"])),(function(e){return e.theme.breakpoints.down("md")}),(function(e){return e.theme.breakpoints.down("md")}),(function(e){return e.theme.breakpoints.down("md")}),(function(e){return e.theme.breakpoints.down("md")}))},95890:function(e,n,t){"use strict";t.d(n,{Z:function(){return g}});var r=t(96234),o=t(5057),i=t(55898),a=t.n(i),l=t(24558),c=t(67680),s=t(56556),u=t(80633),d=t(49390),p=t(37200),m=t(25228),f=t(24202),h=t(74490),x=t(1733),v=t(96266);function g(e){var n=e.triggers,t=e.onEnterEdit,i=e.disabled,a=o.useRef(null),g=o.useState(!1),Z=(0,r.Z)(g,2),b=Z[0],y=Z[1];return 0===n.length?(0,v.jsx)(c.Z,{"data-cy":"schema-form-item-edit",onClick:t,disabled:i,size:"large",children:(0,v.jsx)(l.Z,{})}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(u.Z,{variant:"outlined",ref:a,"aria-label":"split button",children:[(0,v.jsx)(s.Z,{"data-cy":"schema-form-item-edit",onClick:t,disabled:i,size:"large",children:(0,v.jsx)(l.Z,{})}),(0,v.jsx)(s.Z,{size:"small","aria-controls":b?"split-button-menu":void 0,"aria-expanded":b?"true":void 0,onClick:function(){y((function(e){return!e}))},children:(0,v.jsx)(d.Z,{})})]}),(0,v.jsx)(f.Z,{sx:{zIndex:9999},open:b,anchorEl:a.current,role:void 0,placement:"bottom-end",children:(0,v.jsx)(m.Z,{children:(0,v.jsx)(p.d,{onClickAway:function(e){a.current&&a.current.contains(e.target)||y(!1)},children:(0,v.jsx)(x.Z,{id:"split-button-menu",autoFocusItem:!0,children:n.map((function(e){return(0,v.jsx)(h.Z,{onClick:function(){return n=e.handler,y(!1),void n();var n},children:e.title},e.key)}))})})})})]})}g.propTypes={triggers:a().arrayOf(a().shape({key:a().string.isRequired,title:a().string.isRequired,handler:a().func.isRequired})),onEnterEdit:a().func.isRequired,disabled:a().bool.isRequired},g.defaultProps={triggers:[]}},35406:function(e,n,t){"use strict";var r,o=t(71171),i=t(33518).Z.span(r||(r=(0,o.Z)(["\n color: ",";\n &::before {\n content: '*';\n }\n"])),(function(e){return e.theme.palette.error.main}));n.Z=i},35918:function(e,n,t){"use strict";var r=t(44919),o=t(42876),i=t(27773),a=t(11997),l=t(93734),c=t(76667),s=t(39293),u=t(36903),d=t(3422),p=t(92273),m=t(72906),f=t(57201),h=t(49390),x=t(33225),v=t(30770);n.Z={Add:r.Z,Check:o.default,Delete:i.default,Edit:c.default,Clear:a.default,DetailPanel:p.default,Filter:s.Z,FirstPage:u.default,LastPage:d.default,NextPage:p.default,PreviousPage:m.default,Search:f.default,ResetSearch:a.default,SortArrow:h.Z,Export:l.default,ThirdStateCheck:x.default,ViewColumn:v.default}},74782:function(e,n,t){"use strict";var r,o=t(71171),i=t(33518).Z.div(r||(r=(0,o.Z)(["\n .MuiPaper-root {\n box-shadow: none !important;\n border: none !important;\n border-radius: 0 !important;\n background: transparent;\n }\n .MuiToolbar-root {\n background: transparent;\n padding-left: 0;\n display: none;\n }\n\n &.show-pagination {\n .MuiTablePagination-toolbar {\n display: flex;\n }\n }\n\n .MuiTableHead-root th {\n min-width: 100px;\n background: transparent;\n }\n\n .MuiTable-root {\n overflow-y: hidden;\n }\n .MuiTableRow-root {\n border: none !important;\n }\n\n .MuiTableCell-root {\n padding-right: 16px;\n &:last-of-type {\n padding-right: 0;\n }\n }\n\n /* @material-table/core@next \u517c\u5bb9 mui v5, \u4f46 pagination \u6837\u5f0f\u4f3c\u4e4e\u6709\u4e9b\u95ee\u9898, \u6682\u5730\u5b9a\u5236\u4e0b\u9762\u7684\u6837\u5f0f\u4fee\u590d, \u540e\u9762\u8003\u8651\u5f03\u7528 material-table */\n .MuiTablePagination-selectLabel,\n .MuiTablePagination-displayedRows {\n display: none;\n }\n .MuiTypography-caption {\n display: inline-block;\n }\n .MuiTablePagination-selectLabel + .MuiInputBase-root {\n margin-right: 8px;\n }\n"])));n.Z=i}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[9038],{39038:function(e,t,r){r.r(t),r.d(t,{default:function(){return m}});var n,o=r(71171),i=r(5057),a=r(33518),s=r(11750),l=r(68420),d=r(33028),c=r(33665),h=r(96266),p=function(e){var t=Object.assign({},((0,c.Z)(e),e));return(0,h.jsxs)("div",(0,d.Z)((0,d.Z)({},t),{},{children:[(0,h.jsx)("h3",{children:"End User License Agreement for Blocklet Server"}),(0,h.jsx)("p",{children:"Blocklet Server License Agreement ArcBlock, Inc. version 2020-08-28"}),(0,h.jsx)("p",{children:"Blocklet Server LICENSE AGREEMENT"}),(0,h.jsx)("p",{children:"PLEASE READ THIS END USER LICENCE AGREEMENT CAREFULLY. This Blocklet Server License Agreement ('Agreement') is a legal agreement between you (the 'End User') and ArcBlock, Inc. (ARCBLOCK) for the Blocklet Server software (the 'Software') licensed to End User hereunder and supplied to End User. The term Software includes any APIs, software modules, and any associated materials and 'online' or electronic documentation. This Agreement applies to End User's use of the Software but it shall be superseded by any signed agreement between End User and ARCBLOCK concerning the Software."}),(0,h.jsx)("p",{children:"By installing or using the Software, You agree to accept and to be bound by this Agreement at all times. If You do not agree with one of these, please do not install or use the Software."}),(0,h.jsx)("h4",{children:"1. Software license"}),(0,h.jsx)("p",{children:"Notwithstanding any reference to 'sale' or 'purchase', the Software is licensed, not sold. Subject to the terms and conditions of this Agreement, ARCBLOCK grants End User a non-exclusive, non-transferable right to access and use the Software as part of the services for End User's use ('Authorized Use') in object form in the products, versions, and number of installed instances as purchased from ARCBLOCK."}),(0,h.jsx)("h4",{children:"2. Limitations"}),(0,h.jsx)("p",{children:"2.1. Restrictions. End User shall not itself, or through any parent, subsidiary, affiliate, agent or other third party: (a) sell, lease, license, distribute, sublicense or otherwise transfer in whole or in part, the Software to a third party; (b) decompile, disassemble, translate, reverse engineer or otherwise attempt to derive source code from the Software except to the limited extent, if any, that applicable law permits such acts notwithstanding any contractual prohibitions, provided, however, before End User exercises any rights that End User believes to be entitled to based on mandatory law, End User shall provide ARCBLOCK with thirty (30) days prior written notice and provide all reasonably requested information to allow ARCBLOCK to assess End User's claim and, at ARCBLOCK sole discretion, to provide alternatives that reduce any adverse impact on ARCBLOCK's intellectual property or other rights; (c) allow access or permit use of the Software by any third party except authorized third party contractors solely to provide services to End User, provided that End User shall be liable for all acts and omissions of such authorized third party contractors; (d) modify or create derivative works based upon the Software; (e) disclose the results of any benchmark test of the Software to any third party; (f) change any proprietary rights notices which appear in the Software; or (g) circumvent the license keys embedded within the Software."}),(0,h.jsx)("p",{children:"2.2. Software Transfer. Upon written consent from ARCBLOCK, which will not be unreasonably withheld, End User may permanently transfer all of its rights under this Agreement; provided that the recipient agrees to the terms of this Agreement."}),(0,h.jsx)("p",{children:"2.3. High Risk Activities. The Software is not intended for use in hazardous environments requiring fail safe performance (such as, without limitation, the planning, construction, maintenance, control, or direct operation of nuclear facilities, aircraft navigation or communication systems, air traffic control, medical device and life support machines, or weapon systems) in which the failure of the Software could lead to death, personal injury or physical and environmental damage ('High Risk Activities'). Accordingly, this Agreement excludes any High Risk Activities and End User agrees not to use the Software in connection with High Risk Activities."}),(0,h.jsx)("h4",{children:"3. Ownership"}),(0,h.jsx)("p",{children:"The Software is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. ARCBLOCK owns all rights, title and interest in the copyrights, patents and all other intellectual property rights in and to the Software and any accompanying printed materials, and all derivative works thereof."}),(0,h.jsx)("h4",{children:"4. Open source programs"}),(0,h.jsx)("p",{children:"The Software may include individual open source software components, each of which has its own copyright and its own applicable license conditions. The open source software components are licensed to End User under the terms of the applicable open source license conditions and/or copyright notices that can be found in the licenses file, the related documentation or other materials accompanying the Software."}),(0,h.jsx)("h4",{children:"5. Trademarks"}),(0,h.jsx)("p",{children:"The marks 'ARCBLOCK', \u2018BLOCKLETS\u2019 and \u2018Blocklet Server\u2019 are trademarks of ARCBLOCK. ARCBLOCK's failure to list a trademark in this Section shall not constitute a waiver of any trademark rights. All other trademarks in the Software not owned by ARCBLOCK are the property of their respective owners."}),(0,h.jsx)("h4",{children:"6. Disclaimer and Warranty"}),(0,h.jsx)("p",{children:"6.1. DISCLAIMER OF WARRANTIES. THE SOFTWARE IS PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND AND ARCBLOCK EXPRESSLY DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED OR ARISING OUT OF A COURSE OF CONDUCT OR COURSE OF DEALING, INCLUDING ALL WARRANTIES OF TITLE, PERFORMANCE, USE, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON INFRINGEMENT AND THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER OR NOT DISCOVERABLE. ARCBLOCK MAKES NO WARRANTY REGARDING NON INTERRUPTION OF USE. NO ORAL OR WRITTEN STATEMENT PROVIDED BY ARCBLOCK SHALL CREATE ANY WARRANTY."}),(0,h.jsx)("p",{children:"6.2. LIMITATION OF LIABILITY. THE ENTIRE RISK AS TO THE RESULTS AND PERFORMANCE OF THE SOFTWARE IS ASSUMED BY END USER. ARCBLOCK SHALL NOT HAVE ANY LIABILITY TO END USER OR ANY OTHER PARTY FOR ANY INDIRECT, INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES WHATSOEVER, INCLUDING, BUT NOT LIMITED TO, LOSS OF REVENUE, PROFIT OR OPPORTUNITY, LOST OR DAMAGED DATA OR OTHER COMMERCIAL OR ECONOMIC LOSS, EVEN IF ARCBLOCK HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, OR THEY ARE FORESEEABLE. ARCBLOCK'S MAXIMUM AGGREGATE LIABILITY RELATING TO THIS AGREEMENT OR THE SOFTWARE SHALL NOT EXCEED THE AMOUNT PAID BY END USER FOR THE SOFTWARE."}),(0,h.jsx)("p",{children:"6.3. ALLOCATION. THE PROVISIONS OF THIS SECTION ALLOCATE RISKS UNDER THIS AGREEMENT BETWEEN ARCBLOCK AND END USER. ARCBLOCK'S LICENSING FEES FOR THE SOFTWARE REFLECT THIS ALLOCATION OF RISKS AND LIMITATION OF LIABILITY. THE FOREGOING LIMITATIONS, EXCLUSIONS AND DISCLAIMERS APPLY TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, EVEN IF ANY REMEDY FAILS IN ITS ESSENTIAL PURPOSE."}),(0,h.jsx)("p",{children:"6.4. Limitation. Because some jurisdictions do not allow certain disclaimers, exclusions or limitations of warranties, damages or liability, the above disclaimers, exclusions or limitations may not apply to End User and, therefore, shall apply only to the maximum extent allowed under applicable law."}),(0,h.jsx)("h4",{children:"7. Term"}),(0,h.jsx)("p",{children:"This Agreement is effective until terminated. End Users may terminate the Agreement at any time by returning or destroying all copies of the Software and related documentation. End User's rights under this Agreement will terminate automatically if End User fails to comply with the Agreement."}),(0,h.jsx)("h4",{children:"8. Miscellaneous"}),(0,h.jsx)("p",{children:"8.1. Governing Law. This Agreement shall be governed by the laws of the State of Washington, without reference to the principles of conflicts of law. The provisions of the Uniform Computerized Information Transaction Act and United Nations Convention on Contracts for the International Sale of Goods shall not apply to this Agreement. Any litigation related to this Agreement shall be brought in the state or federal courts located in Washington, and only in those courts and each party irrevocably waives any objections to such venue. Notwithstanding anything to the contrary herein, ARCBLOCK shall be entitled to seek injunctive or other equitable relief, wherever ARCBLOCK deems appropriate in any jurisdiction, in order to preserve or enforce ARCBLOCK's rights for any breach or threatened breach of this Agreement."}),(0,h.jsx)("p",{children:"8.2. Severability. Every term, condition or provision of this Agreement is severable from the others. If a court or an arbitrator of competent jurisdiction holds any term, condition or provision of this Agreement to be invalid, unenforceable or illegal in whole or in part for any reason, the validity and enforceability of the remaining terms, conditions or provisions, or portions of them, will not be affected."}),(0,h.jsx)("p",{children:"8.3. Confidentiality. Except as expressly allowed by this Agreement, End User will not use or disclose any Software or related technology, idea, algorithm or information ('Confidential Information') except to the extent End User can document that it is generally available for use and disclosure by the public without charge or license. End User shall hold the Confidential Information in trust and confidence and avoid the disclosure or release thereof to any other person or entity by using the same degree of care as it uses to avoid unauthorized use, disclosure, or dissemination of its own Confidential Information of a similar nature, but not less than reasonable care. End User may disclose Confidential Information as required to comply with binding orders of governmental entities that have jurisdiction over it; provided that End User gives ARCBLOCK reasonable written notice to allow ARCBLOCK to seek a protective order or other appropriate remedy, discloses only such Confidential Information as is required by the governmental entity, and uses commercially reasonable efforts to obtain confidential treatment for any Confidential Information disclosed. End User recognizes and agrees that there is no adequate remedy at law for a breach of this Section, that such a breach would irreparably harm ARCBLOCK and that ARCBLOCK is entitled to equitable relief (without need to post a bond) with respect to any such breach or potential breach in addition to any other remedies."}),(0,h.jsx)("p",{children:"8.4. Indemnity. End User shall defend, indemnify and hold harmless ARCBLOCK, and its officers, directors, employees and agents (the ARCBLOCK indemnities\u2019), from and against all suits, claims, demands, losses, liabilities, damages and expenses (including reasonable attorneys' fees and costs) that the ARCBLOCK Indemnities may suffer or incur in connection with: (i) any third party claim arising from End User's breach of this Agreement; and (ii) any infringement by End User of ARCBLOCK's intellectual property rights in the Software."}),(0,h.jsx)("p",{children:"8.5. Entire Agreement and Waiver. The Agreement is the sole, final and entire agreement between the parties with respect to the subject matter hereof, may only be amended in writing signed by both ARCBLOCK License parties. A failure or delay in enforcing any provisions, exercising any option or requiring performance, be construed to be a waiver by ARCBLOCK."}),(0,h.jsx)("p",{children:"8.6. Marketing. ARCBLOCK may use End User's name and company logo on its customer list and web site, and link to End User's web site."}),(0,h.jsx)("p",{children:"8.7. Independent Contractor. The relationship of the parties is that of independent contractors. Neither party will be deemed to be the legal representative of the other nor will it have any right to bind the other party to any contract or commitment. This Agreement does not, and will not, be construed to create an employer employee, agency, joint venture or partnership relationship between the parties. Each party agrees to assume complete responsibility for its own employees regarding federal or state laws, including employers' liability and tax withholding, worker's compensation, social security, unemployment insurance, and OSHA requirements."}),(0,h.jsx)("p",{children:"8.8. Notices. All notices must be in writing and will be effective three (3) days after the date sent to each party's corporate headquarters."}),(0,h.jsx)("p",{children:"8.9. Audit. During the term of this Agreement and for one (1) year following termination or expiration (but no more than once in a calendar year), ARCBLOCK and its auditors may inspect End User's records relating to its reproduction and use of the Software for the purposes of verifying End User's compliance with this Agreement. End User shall cooperate fully with ARCBLOCK and its auditors in conducting audits and provide reasonable assistance. If an underpayment is discovered, End User shall promptly pay such amount and End User shall reimburse ARCBLOCK for the cost of the audit."}),(0,h.jsx)("p",{children:'8.10. Government Regulation. End User acknowledges that the Software is subject to export restrictions by the U.S. government and import restrictions by certain foreign governments. End User may not export or re-export the Software except in compliance with the U.S. Export Administration Act and the related rules and regulations and similar non-U.S. government restrictions, if applicable. End User shall not and shall not allow any third party to remove or export from the United States or allow the export or re export of any part of the Software or any direct product thereof: (i) into (or to a national or resident of) any embargoed or terrorist supporting country; (ii) to anyone on the U.S. Commerce Department\'s Table of Denial Orders or U.S. Treasury Department\'s list of Specially Designated Nationals; (iii) to any country to which such export or re export is restricted or prohibited, or as to which the U.S. government or any agency thereof requires an export license or other governmental approval at the time of export or re export without first obtaining such license or approval; or (iv) otherwise in violation of any export or import restrictions, laws or regulations of any United States or foreign agency or authority. End User agrees to the foregoing and warrants that it is not located in, under the control of, or a national or resident of any such prohibited country or on any such prohibited party list. The Software is further restricted from being used for terrorist activity, or for the design or development of nuclear, chemical, or biological weapons or missile technology without the prior permission of the U.S. government. The Software and accompanying documentation are deemed to be "commercial computer software" and "commercial computer software documentation", respectively, pursuant to DFAR Section 227.7202 and FAR Section 12.212(b), as applicable. Any use, modification, reproduction, release, performing, displaying or disclosing of the Software and related documentation by the U.S. Government shall be governed solely by the terms of this Agreement.'})]}))};function m(){var e=(0,i.useContext)(l.RD).t;return(0,h.jsxs)(f,{children:[(0,h.jsx)(s.Z,{component:"h2",variant:"h4",className:"page-header",color:"textPrimary",children:e("setup.steps.eula")}),(0,h.jsx)(p,{})]})}var f=a.Z.main(n||(n=(0,o.Z)(["\n .page-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n }\n\n .page-content {\n margin-top: 16px;\n }\n"])))}}]);