@abtnode/webapp 1.16.21-beta-46c675eb → 1.16.21-beta-e828f413
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blocklet.js +1 -1
- package/blocklet.yml +1 -1
- package/build/asset-manifest.json +36 -35
- package/build/index.html +1 -1
- package/build/service-worker.js +1 -1
- package/build/static/js/1294.5b08d5e3.chunk.js +1 -0
- package/build/static/js/{1667.3001639f.chunk.js → 1667.488a600b.chunk.js} +1 -1
- package/build/static/js/{1685.00ac41cb.chunk.js → 1685.c6f7a83f.chunk.js} +2 -2
- package/build/static/js/2183.e57ce8a2.chunk.js +1 -0
- package/build/static/js/2435.88762f30.chunk.js +1 -0
- package/build/static/js/2443.00426c01.chunk.js +1 -0
- package/build/static/js/{3389.72b7e591.chunk.js → 3389.282a0683.chunk.js} +1 -1
- package/build/static/js/3883.f14e204a.chunk.js +1 -0
- package/build/static/js/4382.0d3258d7.chunk.js +2 -0
- package/build/static/js/4471.a41284d9.chunk.js +1 -0
- package/build/static/js/{6490.8f3553c2.chunk.js → 4509.231da63f.chunk.js} +2 -2
- package/build/static/js/4549.5fda7728.chunk.js +1 -0
- package/build/static/js/{4775.b0cede7b.chunk.js → 4775.19ec4c25.chunk.js} +1 -1
- package/build/static/js/4906.aced1b76.chunk.js +1 -0
- package/build/static/js/5059.b85795c1.chunk.js +1 -0
- package/build/static/js/{5672.b32c024f.chunk.js → 5672.19e3e3e6.chunk.js} +1 -1
- package/build/static/js/{5804.996e83bb.chunk.js → 5804.c02bc104.chunk.js} +2 -2
- package/build/static/js/{5979.bd3d3c0f.chunk.js → 5979.4e4ebbf1.chunk.js} +1 -1
- package/build/static/js/6230.b1753197.chunk.js +1 -0
- package/build/static/js/6511.623f368a.chunk.js +1 -0
- package/build/static/js/{6580.8cdb4aa4.chunk.js → 6580.fc3c74eb.chunk.js} +1 -1
- package/build/static/js/{6931.e9297d29.chunk.js → 6931.a2586ea5.chunk.js} +1 -1
- package/build/static/js/{7020.2fd6f467.chunk.js → 7020.ccd573af.chunk.js} +1 -1
- package/build/static/js/{7022.02d74e90.chunk.js → 7022.9d96c66f.chunk.js} +1 -1
- package/build/static/js/{7150.9849325f.chunk.js → 7150.ff7c498c.chunk.js} +1 -1
- package/build/static/js/{7657.380e09e9.chunk.js → 7657.ec1da0b4.chunk.js} +2 -2
- package/build/static/js/7706.74e51876.chunk.js +2 -0
- package/build/static/js/7718.b0d91373.chunk.js +1 -0
- package/build/static/js/8537.b03e14a8.chunk.js +1 -0
- package/build/static/js/{8986.0c6ecc50.chunk.js → 8986.d64838dd.chunk.js} +1 -1
- package/build/static/js/95.08f81beb.chunk.js +1 -0
- package/build/static/js/{9552.82c09530.chunk.js → 9552.3effa95b.chunk.js} +1 -1
- package/build/static/js/main.b3ba7d08.js +2 -0
- package/build/static/js/{main.c88b220e.js.LICENSE.txt → main.b3ba7d08.js.LICENSE.txt} +1 -1
- package/package.json +1 -1
- package/build/static/js/1294.8ccea539.chunk.js +0 -1
- package/build/static/js/1633.5c43bf43.chunk.js +0 -2
- package/build/static/js/3826.d40f6fa7.chunk.js +0 -2
- package/build/static/js/3883.46d0ebdd.chunk.js +0 -1
- package/build/static/js/4435.5212440d.chunk.js +0 -1
- package/build/static/js/4448.d67840f3.chunk.js +0 -1
- package/build/static/js/4471.c2380391.chunk.js +0 -1
- package/build/static/js/4906.b8af826c.chunk.js +0 -1
- package/build/static/js/6511.978080d1.chunk.js +0 -1
- package/build/static/js/7718.49194e44.chunk.js +0 -1
- package/build/static/js/8382.e1c429ed.chunk.js +0 -1
- package/build/static/js/8537.d5e4e119.chunk.js +0 -1
- package/build/static/js/8973.639c0cf3.chunk.js +0 -1
- package/build/static/js/9277.babc5673.chunk.js +0 -1
- package/build/static/js/95.f2b78229.chunk.js +0 -1
- package/build/static/js/main.c88b220e.js +0 -2
- /package/build/static/css/{3826.a5e3e6d6.chunk.css → 4382.a5e3e6d6.chunk.css} +0 -0
- /package/build/static/css/{8973.9cab926a.chunk.css → 6230.9cab926a.chunk.css} +0 -0
- /package/build/static/js/{1685.00ac41cb.chunk.js.LICENSE.txt → 1685.c6f7a83f.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{3826.d40f6fa7.chunk.js.LICENSE.txt → 4382.0d3258d7.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{5804.996e83bb.chunk.js.LICENSE.txt → 4509.231da63f.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{6490.8f3553c2.chunk.js.LICENSE.txt → 5804.c02bc104.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{7657.380e09e9.chunk.js.LICENSE.txt → 7657.ec1da0b4.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{1633.5c43bf43.chunk.js.LICENSE.txt → 7706.74e51876.chunk.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[2183],{96499:(e,t,i)=>{i.r(t),i.d(t,{default:()=>S});var n,a=i(71171),s=i(5057),r=i(33518),o=i(15849),l=i(55898),d=i.n(l),c=i(5609),p=i(19577),f=i(2478),m=i(44067),u=i(44846),g=i(42761),x=i(75239),h=i(62681),j=i(29034),y=i(11750),Z=i(88092),b=i(26174),v=i(83580),N=i(67680),w=i(39529),k=i(39948),C=i(59662),z=i(28726),M=i(68420),R=i(7403),D=i(14491),L=i(63406),A=i(58238),_=i(96266);function U(e){let{api:t,paging:i,loading:n,notifications:a,updateNotifications:r,teamDid:l}=e;const{inService:d}=(0,A.h6)(),[U,P]=(0,s.useState)(!0),[S,T]=(0,s.useState)(!1),{t:F,locale:I}=(0,s.useContext)(M.RD),$=async e=>{d?await t.readBlockletNotifications({input:{id:e,teamDid:l}}):await t.readNotifications({input:{id:e}}),r()},B=U?a:a.filter((e=>!1===e.read)),O=a.filter((e=>!1===e.read)).length>0,W=e=>(0,_.jsxs)("div",{className:"title",children:[e.title," ",(0,_.jsx)("span",{className:"time-ago",title:(0,D.B2)(e.createdAt,I),children:(0,c.WU)(new Date(e.createdAt),(0,D.FF)(I))})]});return(0,_.jsxs)(q,{children:[(0,_.jsxs)(y.Z,{component:"h2",variant:"h4",className:"page-header",color:"textPrimary",children:[F("notification.title"),(0,_.jsxs)(y.Z,{component:"span",className:"notification-actions",children:[(0,_.jsx)(b.Z,{control:(0,_.jsx)(Z.Z,{checked:U,onChange:()=>P(!U),name:"showRead",color:"primary"}),label:F("notification.showRead")}),(0,_.jsx)(L.Z,{permission:d?"":"mutate_notification",role:d?D.Wf:[],children:O&&(0,_.jsxs)(z.Z,{disabled:S,onClick:async()=>{T(!0);const e=a.filter((e=>!1===e.read)).map((e=>e.id)).join(",");d?await t.readBlockletNotifications({input:{id:e,teamDid:l}}):await t.readNotifications({input:{id:e}}),r(),T(!1)},className:"",children:[S&&(0,_.jsx)(u.Z,{size:16,style:{marginRight:"1em"}}),F("notification.markAllAsRead")]})})]})]}),(0,_.jsx)(j.Z,{}),(0,_.jsxs)(p.Z,{className:"notification-list",children:[n&&(0,_.jsx)(u.Z,{size:[32,20],style:{opacity:"0.8",zIndex:1e4,position:"fixed",top:30,left:"50%",marginLeft:-16}}),0===B.length&&(0,_.jsx)(y.Z,{component:"p",variant:"body1",className:"notification-tip",children:F("notification.empty")}),B.length>0&&B.map((e=>e.action?(0,_.jsxs)(f.ZP,{component:o.Link,to:e.action,alignItems:"flex-start",disabled:e.read,children:[(0,_.jsx)(g.Z,{className:"list-item-avatar",children:(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(h.Z,{children:e.entityType.substr(0,1).toUpperCase()}),(0,_.jsx)(R.Z,{className:"notification-tag",status:e.severity})]})}),(0,_.jsx)(m.Z,{className:"list-item-text",classes:{secondary:"list-item-secondary-text"},primary:W(e),secondary:e.description}),!1===e.read&&(0,_.jsx)(v.Z,{children:(0,_.jsx)(x.Z,{title:F("notification.markAsRead"),children:(0,_.jsx)(N.Z,{edge:"end","aria-label":"delete",onClick:()=>$(e.id),size:"large",children:(0,_.jsx)(w.Z,{})})})})]},e.id):(0,_.jsxs)(f.ZP,{alignItems:"flex-start",disabled:e.read,children:[(0,_.jsx)(g.Z,{className:"list-item-avatar",children:(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(h.Z,{children:e.entityType.substr(0,1).toUpperCase()}),(0,_.jsx)(R.Z,{className:"notification-tag",status:e.severity})]})}),(0,_.jsx)(m.Z,{className:"list-item-text",classes:{secondary:"list-item-secondary-text"},primary:W(e),secondary:e.description}),!1===e.read&&(0,_.jsx)(v.Z,{children:(0,_.jsx)(x.Z,{title:F("notification.markAsRead"),children:(0,_.jsx)(N.Z,{edge:"end","aria-label":"delete",onClick:()=>$(e.id),size:"large",children:(0,_.jsx)(w.Z,{})})})})]},e.id)))]}),!!B.length&&i.pageCount>1&&(0,_.jsx)(k.Z,{mt:2,display:"flex",justifyContent:"flex-end",children:(0,_.jsx)(C.Z,{disabled:n,count:i.pageCount,page:i.page,onChange:(e,t)=>{r({page:t})}})})]})}const q=r.Z.div(n||(n=(0,a.Z)(["\n min-height: 60vh;\n\n .page-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n\n .notification-actions {\n width: auto;\n display: flex;\n justify-content: space-between;\n }\n }\n\n .page-content {\n margin-top: 16px;\n }\n\n .list-item-avatar {\n display: flex;\n flex-direction: column;\n align-items: center;\n min-width: 80px;\n\n .notification-tag {\n margin-top: 4px;\n }\n }\n\n .MuiListItem-root:not(.Mui-disabled) {\n .MuiAvatar-root {\n background: ",";\n }\n }\n\n .list-item-text {\n .title {\n display: flex;\n align-items: center;\n .time-ago {\n background: #bdbdbd;\n font-size: 11px;\n margin-left: 8px;\n color: #f7f8f8;\n border-radius: 3px;\n padding: 1px 4px;\n }\n }\n }\n .Mui-disabled .list-item-text .title .time-ago {\n background: #666;\n }\n\n .list-item-secondary-text {\n word-break: break-word;\n }\n"])),(e=>e.theme.palette.primary.light));U.propTypes={loading:d().bool,paging:d().objectOf(d().any),api:d().shape({readNotifications:d().func.isRequired,readBlockletNotifications:d().func.isRequired}).isRequired,notifications:d().arrayOf(d().shape({id:d().string,read:d().bool,entityType:d().string,title:d().string,createdAt:d().string,description:d().string}).isRequired).isRequired,updateNotifications:d().func.isRequired,teamDid:d().string},U.defaultProps={paging:!1,loading:!1,teamDid:""};var P=i(27690);function S(){const{api:e,data:t,paging:i,refresh:n,loading:a}=(0,P.nw)();return(0,_.jsx)(U,{paging:i,loading:a,api:e,notifications:t,updateNotifications:n})}},39529:(e,t,i)=>{var n=i(71600);t.Z=void 0;var a=n(i(56930)),s=i(96266),r=(0,a.default)((0,s.jsx)("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"}),"VisibilityOff");t.Z=r},96646:(e,t,i)=>{i.d(t,{Z:()=>s});i(5057);var n=i(57471),a=i(96266);const s=(0,n.Z)((0,a.jsx)("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),"FirstPage")},54665:(e,t,i)=>{i.d(t,{Z:()=>s});i(5057);var n=i(57471),a=i(96266);const s=(0,n.Z)((0,a.jsx)("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),"LastPage")},5609:(e,t,i)=>{i.d(t,{WU:()=>d});var n=["second","minute","hour","day","week","month","year"];var a=["\u79d2","\u5206\u949f","\u5c0f\u65f6","\u5929","\u5468","\u4e2a\u6708","\u5e74"];var s={},r=function(e,t){s[e]=t},o=[60,60,24,7,365/7/12,12];function l(e){return e instanceof Date?e:!isNaN(e)||/^\d+$/.test(e)?new Date(parseInt(e)):(e=(e||"").trim().replace(/\.\d+/,"").replace(/-/,"/").replace(/-/,"/").replace(/(\d)T(\d)/,"$1 $2").replace(/Z/," UTC").replace(/([+-]\d\d):?(\d\d)/," $1$2"),new Date(e))}var d=function(e,t,i){var n=function(e,t){return(+(t?l(t):new Date)-+l(e))/1e3}(e,i&&i.relativeDate);return function(e,t){for(var i=e<0?1:0,n=e=Math.abs(e),a=0;e>=o[a]&&a<o.length;a++)e/=o[a];return(e=Math.floor(e))>(0===(a*=2)?9:1)&&(a+=1),t(e,a,n)[i].replace("%s",e.toString())}(n,function(e){return s[e]||s.en_US}(t))};r("en_US",(function(e,t){if(0===t)return["just now","right now"];var i=n[Math.floor(t/2)];return e>1&&(i+="s"),[e+" "+i+" ago","in "+e+" "+i]})),r("zh_CN",(function(e,t){if(0===t)return["\u521a\u521a","\u7247\u523b\u540e"];var i=a[~~(t/2)];return[e+" "+i+"\u524d",e+" "+i+"\u540e"]}))}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[2435],{18067:(e,t,r)=>{"use strict";t.Z=void 0;(n=r(5057))&&n.__esModule;var n,o=r(96266);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){s(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function s(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var c=function(e){return(0,o.jsx)("svg",i(i({},e),{},{children:(0,o.jsx)("path",{d:"M11.78 2.25c-2.767 0-5.019 2.271-5.019 5.063v3.037H5.758a2.018 2.018 0 0 0-2.008 2.025v8.1c0 1.117.9 2.025 2.008 2.025h12.045a2.018 2.018 0 0 0 2.007-2.025v-8.1c0-1.117-.9-2.025-2.007-2.025h-1.004V7.313c0-2.792-2.251-5.063-5.019-5.063zm6.023 10.125l.002 8.1H5.758v-8.1h12.045zM8.769 10.35V7.313c0-1.675 1.35-3.038 3.011-3.038 1.66 0 3.011 1.363 3.011 3.037v3.038H8.77z"})}))};c.defaultProps={width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},c.displayName="lock";var d=c;t.Z=d},64886:(e,t,r)=>{"use strict";r.d(t,{Z:()=>m});var n,o=r(71171),a=r(55898),i=r.n(a),s=r(51540),c=r.n(s),d=r(26538),p=r.n(d),h=r(11750),l=r(47685),u=r(96266);function f(e){let{name:t,nameFormatter:r,layout:n,children:o,valueComponent:a,nameWidth:i,...s}=e;return(0,u.jsxs)(v,{layout:n,width:i,...s,children:[(0,u.jsx)(h.Z,{color:"textSecondary",className:"info-row__name",children:r(t)}),o&&(0,u.jsx)(h.Z,{color:"textPrimary",component:a,className:"info-row__value",children:o})]})}f.propTypes={name:i().any.isRequired,layout:i().oneOf(["horizontal","vertical"]),children:i().any,nameFormatter:i().func,valueComponent:i().string,nameWidth:i().number},f.defaultProps={children:null,nameWidth:90,nameFormatter:e=>{const t=e.split(" ").map((e=>p()(c()(e)))).join(" ");return"string"===typeof e?t:e},valueComponent:"div",layout:"horizontal"};const v=(0,l.zo)("div")(n||(n=(0,o.Z)(["\n display: flex;\n flex-direction: ",";\n justify-content: flex-start;\n align-items: ",";\n margin-bottom: 16px;\n\n .info-row__name {\n width: ","px;\n margin-right: ",";\n margin-bottom: ",";\n text-transform: capitalize;\n }\n\n .info-row__value {\n flex: 1;\n overflow: auto;\n word-wrap: break-word;\n font-weight: 500;\n }\n\n @media (max-width: ","px) {\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n .info-row__name {\n font-weight: bold;\n }\n\n .info-row__value {\n width: 100%;\n font-size: 12px;\n margin-top: 8px;\n }\n }\n"])),(e=>"vertical"===e.layout?"column":"row"),(e=>"vertical"===e.layout?"flex-start":"center"),(e=>e.width),(e=>"vertical"===e.layout?"0":"8px"),(e=>"vertical"===e.layout?"8px":"0"),(e=>e.theme.breakpoints.values.md)),m=f},44919:(e,t,r)=>{"use strict";var n=r(71600);t.Z=void 0;var o=n(r(56930)),a=r(96266),i=(0,o.default)((0,a.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"Add");t.Z=i},11593:(e,t,r)=>{"use strict";var n=r(71600);t.Z=void 0;var o=n(r(56930)),a=r(96266),i=(0,o.default)((0,a.jsx)("path",{d:"M17 20.41 18.41 19 15 15.59 13.59 17 17 20.41zM7.5 8H11v5.59L5.59 19 7 20.41l6-6V8h3.5L12 3.5 7.5 8z"}),"CallMerge");t.Z=i},76416:(e,t,r)=>{"use strict";var n=r(71600);t.Z=void 0;var o=n(r(56930)),a=r(96266),i=(0,o.default)((0,a.jsx)("path",{d:"M12.16 3h-.32L9.21 8.25h5.58zm4.3 5.25h5.16L19 3h-5.16zm4.92 1.5h-8.63V20.1zM11.25 20.1V9.75H2.62zM7.54 8.25 10.16 3H5L2.38 8.25z"}),"Diamond");t.Z=i},17655:(e,t,r)=>{"use strict";var n=r(71600);t.Z=void 0;var o=n(r(56930)),a=r(96266),i=(0,o.default)((0,a.jsx)("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess");t.Z=i},31942:(e,t,r)=>{"use strict";var n=r(71600);t.Z=void 0;var o=n(r(56930)),a=r(96266),i=(0,o.default)((0,a.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"}),"Https");t.Z=i},34966:(e,t,r)=>{"use strict";var n=r(71600);t.Z=void 0;var o=n(r(56930)),a=r(96266),i=(0,o.default)((0,a.jsx)("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"}),"InfoOutlined");t.Z=i},45267:(e,t,r)=>{"use strict";var n=r(71600);t.Z=void 0;var o=n(r(56930)),a=r(96266),i=(0,o.default)((0,a.jsx)("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreHoriz");t.Z=i},96538:(e,t,r)=>{"use strict";var n=r(71600);t.Z=void 0;var o=n(r(56930)),a=r(96266),i=(0,o.default)((0,a.jsx)("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"}),"OpenInNew");t.Z=i},75392:(e,t,r)=>{"use strict";r.d(t,{Z:()=>m});var n=r(7896),o=r(31461),a=r(5057),i=r(9978),s=r(91213),c=r(62773),d=r(42908),p=r(31821),h=r(18561);function l(e){return(0,h.Z)("MuiCardContent",e)}(0,p.Z)("MuiCardContent",["root"]);var u=r(96266);const f=["className","component"],v=(0,c.ZP)("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(e,t)=>t.root})((()=>({padding:16,"&:last-child":{paddingBottom:24}}))),m=a.forwardRef((function(e,t){const r=(0,d.Z)({props:e,name:"MuiCardContent"}),{className:a,component:c="div"}=r,p=(0,o.Z)(r,f),h=(0,n.Z)({},r,{component:c}),m=(e=>{const{classes:t}=e;return(0,s.Z)({root:["root"]},l,t)})(h);return(0,u.jsx)(v,(0,n.Z)({as:c,className:(0,i.Z)(m.root,a),ownerState:h,ref:t},p))}))},48191:(e,t,r)=>{var n=r(54305);e.exports=function(e,t){for(var r=-1,o=e.length;++r<o&&n(t,e[r],0)>-1;);return r}},11854:(e,t,r)=>{var n=r(57333),o=r(39594),a=r(69123),i=r(38828),s=r(48191),c=r(38554),d=r(26849);e.exports=function(e,t,r){if((e=d(e))&&(r||void 0===t))return o(e);if(!e||!(t=n(t)))return e;var p=c(e),h=c(t),l=s(p,h),u=i(p,h)+1;return a(p,l,u).join("")}},46422:(e,t,r)=>{"use strict";r.r(t),r.d(t,{base32:()=>p,base32hex:()=>f,base32hexpad:()=>m,base32hexpadupper:()=>b,base32hexupper:()=>v,base32pad:()=>l,base32padupper:()=>u,base32upper:()=>h,base32z:()=>x});new Uint8Array(0);class n{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return"".concat(this.prefix).concat(this.baseEncode(e));throw Error("Unknown type, must be binary type")}}class o{constructor(e,t,r){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if("string"===typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error("Unable to decode multibase string ".concat(JSON.stringify(e),", ").concat(this.name," decoder only supports inputs prefixed with ").concat(this.prefix));return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return i(this,e)}}class a{constructor(e){this.decoders=e}or(e){return i(this,e)}decode(e){const t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError("Unable to decode multibase string ".concat(JSON.stringify(e),", only inputs prefixed with ").concat(Object.keys(this.decoders)," are supported"))}}const i=(e,t)=>new a({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class s{constructor(e,t,r,a){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=a,this.encoder=new n(e,t,r),this.decoder=new o(e,t,a)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const c=e=>{let{name:t,prefix:r,encode:n,decode:o}=e;return new s(t,r,n,o)},d=e=>{let{name:t,prefix:r,bitsPerChar:n,alphabet:o}=e;return c({prefix:r,name:t,encode:e=>((e,t,r)=>{const n="="===t[t.length-1],o=(1<<r)-1;let a="",i=0,s=0;for(let c=0;c<e.length;++c)for(s=s<<8|e[c],i+=8;i>r;)i-=r,a+=t[o&s>>i];if(i&&(a+=t[o&s<<r-i]),n)for(;a.length*r&7;)a+="=";return a})(e,o,n),decode:e=>((e,t,r,n)=>{const o={};for(let p=0;p<t.length;++p)o[t[p]]=p;let a=e.length;for(;"="===e[a-1];)--a;const i=new Uint8Array(a*r/8|0);let s=0,c=0,d=0;for(let p=0;p<a;++p){const t=o[e[p]];if(void 0===t)throw new SyntaxError("Non-".concat(n," character"));c=c<<r|t,s+=r,s>=8&&(s-=8,i[d++]=255&c>>s)}if(s>=r||255&c<<8-s)throw new SyntaxError("Unexpected end of data");return i})(e,o,n,t)})},p=d({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),h=d({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),l=d({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),u=d({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),f=d({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),v=d({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),m=d({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),b=d({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),x=d({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[2443],{63769:(e,t,o)=>{"use strict";o.d(t,{Z:()=>ae});var n=o(31461),a=o(7896),r=o(5057),i=o(9978),l=o(91213),c=o(32852),s=o(62663),p=o(77590),u=o(2534),d=o(98038);function g(e){return"undefined"!==typeof e.normalize?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e}function f(e,t){for(let o=0;o<e.length;o+=1)if(t(e[o]))return o;return-1}const h=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{ignoreAccents:t=!0,ignoreCase:o=!0,limit:n,matchFrom:a="any",stringify:r,trim:i=!1}=e;return(e,l)=>{let{inputValue:c,getOptionLabel:s}=l,p=i?c.trim():c;o&&(p=p.toLowerCase()),t&&(p=g(p));const u=p?e.filter((e=>{let n=(r||s)(e);return o&&(n=n.toLowerCase()),t&&(n=g(n)),"start"===a?0===n.indexOf(p):n.indexOf(p)>-1})):e;return"number"===typeof n?u.slice(0,n):u}}(),m=e=>{var t;return null!==e.current&&(null==(t=e.current.parentElement)?void 0:t.contains(document.activeElement))};function b(e){const{unstable_isActiveElementInListbox:t=m,unstable_classNamePrefix:o="Mui",autoComplete:n=!1,autoHighlight:i=!1,autoSelect:l=!1,blurOnSelect:g=!1,clearOnBlur:b=!e.freeSolo,clearOnEscape:v=!1,componentName:x="useAutocomplete",defaultValue:Z=(e.multiple?[]:null),disableClearable:y=!1,disableCloseOnSelect:O=!1,disabled:I,disabledItemsFocusable:S=!1,disableListWrap:P=!1,filterOptions:C=h,filterSelectedOptions:k=!1,freeSolo:w=!1,getOptionDisabled:L,getOptionKey:A,getOptionLabel:T=(e=>{var t;return null!=(t=e.label)?t:e}),groupBy:R,handleHomeEndKeys:N=!e.freeSolo,id:M,includeInputInList:D=!1,inputValue:z,isOptionEqualToValue:E=((e,t)=>e===t),multiple:F=!1,onChange:H,onClose:W,onHighlightChange:j,onInputChange:V,onOpen:B,open:q,openOnFocus:G=!1,options:K,readOnly:U=!1,selectOnFocus:_=!e.freeSolo,value:J}=e,Q=(0,c.Z)(M);let X=T;X=e=>{const t=T(e);return"string"!==typeof t?String(t):t};const Y=r.useRef(!1),$=r.useRef(!0),ee=r.useRef(null),te=r.useRef(null),[oe,ne]=r.useState(null),[ae,re]=r.useState(-1),ie=i?0:-1,le=r.useRef(ie),[ce,se]=(0,s.Z)({controlled:J,default:Z,name:x}),[pe,ue]=(0,s.Z)({controlled:z,default:"",name:x,state:"inputValue"}),[de,ge]=r.useState(!1),fe=r.useCallback(((e,t)=>{if(!(F?ce.length<t.length:null!==t)&&!b)return;let o;if(F)o="";else if(null==t)o="";else{const e=X(t);o="string"===typeof e?e:""}pe!==o&&(ue(o),V&&V(e,o,"reset"))}),[X,pe,F,V,ue,b,ce]),[he,me]=(0,s.Z)({controlled:q,default:!1,name:x,state:"open"}),[be,ve]=r.useState(!0),xe=!F&&null!=ce&&pe===X(ce),Ze=he&&!U,ye=Ze?C(K.filter((e=>!k||!(F?ce:[ce]).some((t=>null!==t&&E(e,t))))),{inputValue:xe&&be?"":pe,getOptionLabel:X}):[],Oe=(0,p.Z)({filteredOptions:ye,value:ce,inputValue:pe});r.useEffect((()=>{const e=ce!==Oe.value;de&&!e||w&&!e||fe(null,ce)}),[ce,fe,de,Oe.value,w]);const Ie=he&&ye.length>0&&!U;const Se=(0,u.Z)((e=>{-1===e?ee.current.focus():oe.querySelector('[data-tag-index="'.concat(e,'"]')).focus()}));r.useEffect((()=>{F&&ae>ce.length-1&&(re(-1),Se(-1))}),[ce,F,ae,Se]);const Pe=(0,u.Z)((e=>{let{event:t,index:n,reason:a="auto"}=e;if(le.current=n,-1===n?ee.current.removeAttribute("aria-activedescendant"):ee.current.setAttribute("aria-activedescendant","".concat(Q,"-option-").concat(n)),j&&j(t,-1===n?null:ye[n],a),!te.current)return;const r=te.current.querySelector('[role="option"].'.concat(o,"-focused"));r&&(r.classList.remove("".concat(o,"-focused")),r.classList.remove("".concat(o,"-focusVisible")));let i=te.current;if("listbox"!==te.current.getAttribute("role")&&(i=te.current.parentElement.querySelector('[role="listbox"]')),!i)return;if(-1===n)return void(i.scrollTop=0);const l=te.current.querySelector('[data-option-index="'.concat(n,'"]'));if(l&&(l.classList.add("".concat(o,"-focused")),"keyboard"===a&&l.classList.add("".concat(o,"-focusVisible")),i.scrollHeight>i.clientHeight&&"mouse"!==a&&"touch"!==a)){const e=l,t=i.clientHeight+i.scrollTop,o=e.offsetTop+e.offsetHeight;o>t?i.scrollTop=o-i.clientHeight:e.offsetTop-e.offsetHeight*(R?1.3:0)<i.scrollTop&&(i.scrollTop=e.offsetTop-e.offsetHeight*(R?1.3:0))}})),Ce=(0,u.Z)((e=>{let{event:t,diff:o,direction:a="next",reason:r="auto"}=e;if(!Ze)return;const i=function(e,t){if(!te.current||e<0||e>=ye.length)return-1;let o=e;for(;;){const n=te.current.querySelector('[data-option-index="'.concat(o,'"]')),a=!S&&(!n||n.disabled||"true"===n.getAttribute("aria-disabled"));if(n&&n.hasAttribute("tabindex")&&!a)return o;if(o="next"===t?(o+1)%ye.length:(o-1+ye.length)%ye.length,o===e)return-1}}((()=>{const e=ye.length-1;if("reset"===o)return ie;if("start"===o)return 0;if("end"===o)return e;const t=le.current+o;return t<0?-1===t&&D?-1:P&&-1!==le.current||Math.abs(o)>1?0:e:t>e?t===e+1&&D?-1:P||Math.abs(o)>1?e:0:t})(),a);if(Pe({index:i,reason:r,event:t}),n&&"reset"!==o)if(-1===i)ee.current.value=pe;else{const e=X(ye[i]);ee.current.value=e;0===e.toLowerCase().indexOf(pe.toLowerCase())&&pe.length>0&&ee.current.setSelectionRange(pe.length,e.length)}})),ke=r.useCallback((()=>{if(!Ze)return;if((()=>{if(-1!==le.current&&Oe.filteredOptions&&Oe.filteredOptions.length!==ye.length&&Oe.inputValue===pe&&(F?ce.length===Oe.value.length&&Oe.value.every(((e,t)=>X(ce[t])===X(e))):(e=Oe.value,t=ce,(e?X(e):"")===(t?X(t):"")))){const e=Oe.filteredOptions[le.current];if(e&&ye.some((t=>X(t)===X(e))))return!0}var e,t;return!1})())return;const e=F?ce[0]:ce;if(0!==ye.length&&null!=e){if(te.current)if(null==e)le.current>=ye.length-1?Pe({index:ye.length-1}):Pe({index:le.current});else{const t=ye[le.current];if(F&&t&&-1!==f(ce,(e=>E(t,e))))return;const o=f(ye,(t=>E(t,e)));-1===o?Ce({diff:"reset"}):Pe({index:o})}}else Ce({diff:"reset"})}),[ye.length,!F&&ce,k,Ce,Pe,Ze,pe,F]),we=(0,u.Z)((e=>{(0,d.Z)(te,e),e&&ke()}));r.useEffect((()=>{ke()}),[ke]);const Le=e=>{he||(me(!0),ve(!0),B&&B(e))},Ae=(e,t)=>{he&&(me(!1),W&&W(e,t))},Te=(e,t,o,n)=>{if(F){if(ce.length===t.length&&ce.every(((e,o)=>e===t[o])))return}else if(ce===t)return;H&&H(e,t,o,n),se(t)},Re=r.useRef(!1),Ne=function(e,t){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"options",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"selectOption",a=t;if(F){a=Array.isArray(ce)?ce.slice():[];const e=f(a,(e=>E(t,e)));-1===e?a.push(t):"freeSolo"!==o&&(a.splice(e,1),n="removeOption")}fe(e,a),Te(e,a,n,{option:t}),O||e&&(e.ctrlKey||e.metaKey)||Ae(e,n),(!0===g||"touch"===g&&Re.current||"mouse"===g&&!Re.current)&&ee.current.blur()};const Me=(e,t)=>{if(!F)return;""===pe&&Ae(e,"toggleInput");let o=ae;-1===ae?""===pe&&"previous"===t&&(o=ce.length-1):(o+="next"===t?1:-1,o<0&&(o=0),o===ce.length&&(o=-1)),o=function(e,t){if(-1===e)return-1;let o=e;for(;;){if("next"===t&&o===ce.length||"previous"===t&&-1===o)return-1;const e=oe.querySelector('[data-tag-index="'.concat(o,'"]'));if(e&&e.hasAttribute("tabindex")&&!e.disabled&&"true"!==e.getAttribute("aria-disabled"))return o;o+="next"===t?1:-1}}(o,t),re(o),Se(o)},De=e=>{Y.current=!0,ue(""),V&&V(e,"","clear"),Te(e,F?[]:null,"clear")},ze=e=>t=>{if(e.onKeyDown&&e.onKeyDown(t),!t.defaultMuiPrevented&&(-1!==ae&&-1===["ArrowLeft","ArrowRight"].indexOf(t.key)&&(re(-1),Se(-1)),229!==t.which))switch(t.key){case"Home":Ze&&N&&(t.preventDefault(),Ce({diff:"start",direction:"next",reason:"keyboard",event:t}));break;case"End":Ze&&N&&(t.preventDefault(),Ce({diff:"end",direction:"previous",reason:"keyboard",event:t}));break;case"PageUp":t.preventDefault(),Ce({diff:-5,direction:"previous",reason:"keyboard",event:t}),Le(t);break;case"PageDown":t.preventDefault(),Ce({diff:5,direction:"next",reason:"keyboard",event:t}),Le(t);break;case"ArrowDown":t.preventDefault(),Ce({diff:1,direction:"next",reason:"keyboard",event:t}),Le(t);break;case"ArrowUp":t.preventDefault(),Ce({diff:-1,direction:"previous",reason:"keyboard",event:t}),Le(t);break;case"ArrowLeft":Me(t,"previous");break;case"ArrowRight":Me(t,"next");break;case"Enter":if(-1!==le.current&&Ze){const e=ye[le.current],o=!!L&&L(e);if(t.preventDefault(),o)return;Ne(t,e,"selectOption"),n&&ee.current.setSelectionRange(ee.current.value.length,ee.current.value.length)}else w&&""!==pe&&!1===xe&&(F&&t.preventDefault(),Ne(t,pe,"createOption","freeSolo"));break;case"Escape":Ze?(t.preventDefault(),t.stopPropagation(),Ae(t,"escape")):v&&(""!==pe||F&&ce.length>0)&&(t.preventDefault(),t.stopPropagation(),De(t));break;case"Backspace":if(F&&!U&&""===pe&&ce.length>0){const e=-1===ae?ce.length-1:ae,o=ce.slice();o.splice(e,1),Te(t,o,"removeOption",{option:ce[e]})}break;case"Delete":if(F&&!U&&""===pe&&ce.length>0&&-1!==ae){const e=ae,o=ce.slice();o.splice(e,1),Te(t,o,"removeOption",{option:ce[e]})}}},Ee=e=>{ge(!0),G&&!Y.current&&Le(e)},Fe=e=>{t(te)?ee.current.focus():(ge(!1),$.current=!0,Y.current=!1,l&&-1!==le.current&&Ze?Ne(e,ye[le.current],"blur"):l&&w&&""!==pe?Ne(e,pe,"blur","freeSolo"):b&&fe(e,ce),Ae(e,"blur"))},He=e=>{const t=e.target.value;pe!==t&&(ue(t),ve(!1),V&&V(e,t,"input")),""===t?y||F||Te(e,null,"clear"):Le(e)},We=e=>{const t=Number(e.currentTarget.getAttribute("data-option-index"));le.current!==t&&Pe({event:e,index:t,reason:"mouse"})},je=e=>{Pe({event:e,index:Number(e.currentTarget.getAttribute("data-option-index")),reason:"touch"}),Re.current=!0},Ve=e=>{const t=Number(e.currentTarget.getAttribute("data-option-index"));Ne(e,ye[t],"selectOption"),Re.current=!1},Be=e=>t=>{const o=ce.slice();o.splice(e,1),Te(t,o,"removeOption",{option:ce[e]})},qe=e=>{he?Ae(e,"toggleInput"):Le(e)},Ge=e=>{e.currentTarget.contains(e.target)&&e.target.getAttribute("id")!==Q&&e.preventDefault()},Ke=e=>{e.currentTarget.contains(e.target)&&(ee.current.focus(),_&&$.current&&ee.current.selectionEnd-ee.current.selectionStart===0&&ee.current.select(),$.current=!1)},Ue=e=>{I||""!==pe&&he||qe(e)};let _e=w&&pe.length>0;_e=_e||(F?ce.length>0:null!==ce);let Je=ye;if(R){new Map;Je=ye.reduce(((e,t,o)=>{const n=R(t);return e.length>0&&e[e.length-1].group===n?e[e.length-1].options.push(t):e.push({key:o,index:o,group:n,options:[t]}),e}),[])}return I&&de&&Fe(),{getRootProps:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,a.Z)({"aria-owns":Ie?"".concat(Q,"-listbox"):null},e,{onKeyDown:ze(e),onMouseDown:Ge,onClick:Ke})},getInputLabelProps:()=>({id:"".concat(Q,"-label"),htmlFor:Q}),getInputProps:()=>({id:Q,value:pe,onBlur:Fe,onFocus:Ee,onChange:He,onMouseDown:Ue,"aria-activedescendant":Ze?"":null,"aria-autocomplete":n?"both":"list","aria-controls":Ie?"".concat(Q,"-listbox"):void 0,"aria-expanded":Ie,autoComplete:"off",ref:ee,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:I}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:De}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:qe}),getTagProps:e=>{let{index:t}=e;return(0,a.Z)({key:t,"data-tag-index":t,tabIndex:-1},!U&&{onDelete:Be(t)})},getListboxProps:()=>({role:"listbox",id:"".concat(Q,"-listbox"),"aria-labelledby":"".concat(Q,"-label"),ref:we,onMouseDown:e=>{e.preventDefault()}}),getOptionProps:e=>{let{index:t,option:o}=e;var n;const a=(F?ce:[ce]).some((e=>null!=e&&E(o,e))),r=!!L&&L(o);return{key:null!=(n=null==A?void 0:A(o))?n:X(o),tabIndex:-1,role:"option",id:"".concat(Q,"-option-").concat(t),onMouseMove:We,onClick:Ve,onTouchStart:je,"data-option-index":t,"aria-disabled":r,"aria-selected":a}},id:Q,inputValue:pe,value:ce,dirty:_e,expanded:Ze&&oe,popupOpen:Ze,focused:de||-1!==ae,anchorEl:oe,setAnchorEl:ne,focusedTag:ae,groupedOptions:Je}}var v=o(66685),x=o(24202),Z=o(62773),y=o(42908),O=o(6285),I=o(31821),S=o(18561);function P(e){return(0,S.Z)("MuiListSubheader",e)}(0,I.Z)("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);var C=o(96266);const k=["className","color","component","disableGutters","disableSticky","inset"],w=(0,Z.ZP)("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,"default"!==o.color&&t["color".concat((0,O.Z)(o.color))],!o.disableGutters&&t.gutters,o.inset&&t.inset,!o.disableSticky&&t.sticky]}})((e=>{let{theme:t,ownerState:o}=e;return(0,a.Z)({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(t.vars||t).palette.text.secondary,fontFamily:t.typography.fontFamily,fontWeight:t.typography.fontWeightMedium,fontSize:t.typography.pxToRem(14)},"primary"===o.color&&{color:(t.vars||t).palette.primary.main},"inherit"===o.color&&{color:"inherit"},!o.disableGutters&&{paddingLeft:16,paddingRight:16},o.inset&&{paddingLeft:72},!o.disableSticky&&{position:"sticky",top:0,zIndex:1,backgroundColor:(t.vars||t).palette.background.paper})})),L=r.forwardRef((function(e,t){const o=(0,y.Z)({props:e,name:"MuiListSubheader"}),{className:r,color:c="default",component:s="li",disableGutters:p=!1,disableSticky:u=!1,inset:d=!1}=o,g=(0,n.Z)(o,k),f=(0,a.Z)({},o,{color:c,component:s,disableGutters:p,disableSticky:u,inset:d}),h=(e=>{const{classes:t,color:o,disableGutters:n,inset:a,disableSticky:r}=e,i={root:["root","default"!==o&&"color".concat((0,O.Z)(o)),!n&&"gutters",a&&"inset",!r&&"sticky"]};return(0,l.Z)(i,P,t)})(f);return(0,C.jsx)(w,(0,a.Z)({as:s,className:(0,i.Z)(h.root,r),ref:t,ownerState:f},g))}));L.muiSkipListHighlight=!0;const A=L;var T,R,N=o(25228),M=o(67680),D=o(19654),z=o(46234),E=o(9243),F=o(82226),H=o(75623),W=o(74235),j=o(60473),V=o(43897),B=o(2286);const q=["autoComplete","autoHighlight","autoSelect","blurOnSelect","ChipProps","className","clearIcon","clearOnBlur","clearOnEscape","clearText","closeText","componentsProps","defaultValue","disableClearable","disableCloseOnSelect","disabled","disabledItemsFocusable","disableListWrap","disablePortal","filterOptions","filterSelectedOptions","forcePopupIcon","freeSolo","fullWidth","getLimitTagsText","getOptionDisabled","getOptionKey","getOptionLabel","isOptionEqualToValue","groupBy","handleHomeEndKeys","id","includeInputInList","inputValue","limitTags","ListboxComponent","ListboxProps","loading","loadingText","multiple","noOptionsText","onChange","onClose","onHighlightChange","onInputChange","onOpen","open","openOnFocus","openText","options","PaperComponent","PopperComponent","popupIcon","readOnly","renderGroup","renderInput","renderOption","renderTags","selectOnFocus","size","slotProps","value"],G=["ref"],K=["key"],U=(0,Z.ZP)("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e,{fullWidth:n,hasClearIcon:a,hasPopupIcon:r,inputFocused:i,size:l}=o;return[{["& .".concat(V.Z.tag)]:t.tag},{["& .".concat(V.Z.tag)]:t["tagSize".concat((0,O.Z)(l))]},{["& .".concat(V.Z.inputRoot)]:t.inputRoot},{["& .".concat(V.Z.input)]:t.input},{["& .".concat(V.Z.input)]:i&&t.inputFocused},t.root,n&&t.fullWidth,r&&t.hasPopupIcon,a&&t.hasClearIcon]}})((e=>{let{ownerState:t}=e;return(0,a.Z)({["&.".concat(V.Z.focused," .").concat(V.Z.clearIndicator)]:{visibility:"visible"},"@media (pointer: fine)":{["&:hover .".concat(V.Z.clearIndicator)]:{visibility:"visible"}}},t.fullWidth&&{width:"100%"},{["& .".concat(V.Z.tag)]:(0,a.Z)({margin:3,maxWidth:"calc(100% - 6px)"},"small"===t.size&&{margin:2,maxWidth:"calc(100% - 4px)"}),["& .".concat(V.Z.inputRoot)]:{flexWrap:"wrap",[".".concat(V.Z.hasPopupIcon,"&, .").concat(V.Z.hasClearIcon,"&")]:{paddingRight:30},[".".concat(V.Z.hasPopupIcon,".").concat(V.Z.hasClearIcon,"&")]:{paddingRight:56},["& .".concat(V.Z.input)]:{width:0,minWidth:30}},["& .".concat(z.Z.root)]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},["& .".concat(z.Z.root,".").concat(E.Z.sizeSmall)]:{["& .".concat(z.Z.input)]:{padding:"2px 4px 3px 0"}},["& .".concat(F.Z.root)]:{padding:9,[".".concat(V.Z.hasPopupIcon,"&, .").concat(V.Z.hasClearIcon,"&")]:{paddingRight:39},[".".concat(V.Z.hasPopupIcon,".").concat(V.Z.hasClearIcon,"&")]:{paddingRight:65},["& .".concat(V.Z.input)]:{padding:"7.5px 4px 7.5px 5px"},["& .".concat(V.Z.endAdornment)]:{right:9}},["& .".concat(F.Z.root,".").concat(E.Z.sizeSmall)]:{paddingTop:6,paddingBottom:6,paddingLeft:6,["& .".concat(V.Z.input)]:{padding:"2.5px 4px 2.5px 8px"}},["& .".concat(H.Z.root)]:{paddingTop:19,paddingLeft:8,[".".concat(V.Z.hasPopupIcon,"&, .").concat(V.Z.hasClearIcon,"&")]:{paddingRight:39},[".".concat(V.Z.hasPopupIcon,".").concat(V.Z.hasClearIcon,"&")]:{paddingRight:65},["& .".concat(H.Z.input)]:{padding:"7px 4px"},["& .".concat(V.Z.endAdornment)]:{right:9}},["& .".concat(H.Z.root,".").concat(E.Z.sizeSmall)]:{paddingBottom:1,["& .".concat(H.Z.input)]:{padding:"2.5px 4px"}},["& .".concat(E.Z.hiddenLabel)]:{paddingTop:8},["& .".concat(H.Z.root,".").concat(E.Z.hiddenLabel)]:{paddingTop:0,paddingBottom:0,["& .".concat(V.Z.input)]:{paddingTop:16,paddingBottom:17}},["& .".concat(H.Z.root,".").concat(E.Z.hiddenLabel,".").concat(E.Z.sizeSmall)]:{["& .".concat(V.Z.input)]:{paddingTop:8,paddingBottom:9}},["& .".concat(V.Z.input)]:(0,a.Z)({flexGrow:1,textOverflow:"ellipsis",opacity:0},t.inputFocused&&{opacity:1})})})),_=(0,Z.ZP)("div",{name:"MuiAutocomplete",slot:"EndAdornment",overridesResolver:(e,t)=>t.endAdornment})({position:"absolute",right:0,top:"calc(50% - 14px)"}),J=(0,Z.ZP)(M.Z,{name:"MuiAutocomplete",slot:"ClearIndicator",overridesResolver:(e,t)=>t.clearIndicator})({marginRight:-2,padding:4,visibility:"hidden"}),Q=(0,Z.ZP)(M.Z,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:(e,t)=>{let{ownerState:o}=e;return(0,a.Z)({},t.popupIndicator,o.popupOpen&&t.popupIndicatorOpen)}})((e=>{let{ownerState:t}=e;return(0,a.Z)({padding:2,marginRight:-2},t.popupOpen&&{transform:"rotate(180deg)"})})),X=(0,Z.ZP)(x.Z,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[{["& .".concat(V.Z.option)]:t.option},t.popper,o.disablePortal&&t.popperDisablePortal]}})((e=>{let{theme:t,ownerState:o}=e;return(0,a.Z)({zIndex:(t.vars||t).zIndex.modal},o.disablePortal&&{position:"absolute"})})),Y=(0,Z.ZP)(N.Z,{name:"MuiAutocomplete",slot:"Paper",overridesResolver:(e,t)=>t.paper})((e=>{let{theme:t}=e;return(0,a.Z)({},t.typography.body1,{overflow:"auto"})})),$=(0,Z.ZP)("div",{name:"MuiAutocomplete",slot:"Loading",overridesResolver:(e,t)=>t.loading})((e=>{let{theme:t}=e;return{color:(t.vars||t).palette.text.secondary,padding:"14px 16px"}})),ee=(0,Z.ZP)("div",{name:"MuiAutocomplete",slot:"NoOptions",overridesResolver:(e,t)=>t.noOptions})((e=>{let{theme:t}=e;return{color:(t.vars||t).palette.text.secondary,padding:"14px 16px"}})),te=(0,Z.ZP)("div",{name:"MuiAutocomplete",slot:"Listbox",overridesResolver:(e,t)=>t.listbox})((e=>{let{theme:t}=e;return{listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",["& .".concat(V.Z.option)]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[t.breakpoints.up("sm")]:{minHeight:"auto"},["&.".concat(V.Z.focused)]:{backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(t.vars||t).palette.action.disabledOpacity,pointerEvents:"none"},["&.".concat(V.Z.focusVisible)]:{backgroundColor:(t.vars||t).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:t.vars?"rgba(".concat(t.vars.palette.primary.mainChannel," / ").concat(t.vars.palette.action.selectedOpacity,")"):(0,v.Fq)(t.palette.primary.main,t.palette.action.selectedOpacity),["&.".concat(V.Z.focused)]:{backgroundColor:t.vars?"rgba(".concat(t.vars.palette.primary.mainChannel," / calc(").concat(t.vars.palette.action.selectedOpacity," + ").concat(t.vars.palette.action.hoverOpacity,"))"):(0,v.Fq)(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(t.vars||t).palette.action.selected}},["&.".concat(V.Z.focusVisible)]:{backgroundColor:t.vars?"rgba(".concat(t.vars.palette.primary.mainChannel," / calc(").concat(t.vars.palette.action.selectedOpacity," + ").concat(t.vars.palette.action.focusOpacity,"))"):(0,v.Fq)(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}}}}})),oe=(0,Z.ZP)(A,{name:"MuiAutocomplete",slot:"GroupLabel",overridesResolver:(e,t)=>t.groupLabel})((e=>{let{theme:t}=e;return{backgroundColor:(t.vars||t).palette.background.paper,top:-8}})),ne=(0,Z.ZP)("ul",{name:"MuiAutocomplete",slot:"GroupUl",overridesResolver:(e,t)=>t.groupUl})({padding:0,["& .".concat(V.Z.option)]:{paddingLeft:24}}),ae=r.forwardRef((function(e,t){var o,c,s,p;const u=(0,y.Z)({props:e,name:"MuiAutocomplete"}),{autoComplete:d=!1,autoHighlight:g=!1,autoSelect:f=!1,blurOnSelect:h=!1,ChipProps:m,className:v,clearIcon:Z=T||(T=(0,C.jsx)(W.Z,{fontSize:"small"})),clearOnBlur:I=!u.freeSolo,clearOnEscape:S=!1,clearText:P="Clear",closeText:k="Close",componentsProps:w={},defaultValue:L=(u.multiple?[]:null),disableClearable:A=!1,disableCloseOnSelect:M=!1,disabled:z=!1,disabledItemsFocusable:E=!1,disableListWrap:F=!1,disablePortal:H=!1,filterSelectedOptions:ae=!1,forcePopupIcon:re="auto",freeSolo:ie=!1,fullWidth:le=!1,getLimitTagsText:ce=(e=>"+".concat(e)),getOptionLabel:se,groupBy:pe,handleHomeEndKeys:ue=!u.freeSolo,includeInputInList:de=!1,limitTags:ge=-1,ListboxComponent:fe="ul",ListboxProps:he,loading:me=!1,loadingText:be="Loading\u2026",multiple:ve=!1,noOptionsText:xe="No options",openOnFocus:Ze=!1,openText:ye="Open",PaperComponent:Oe=N.Z,PopperComponent:Ie=x.Z,popupIcon:Se=R||(R=(0,C.jsx)(j.Z,{})),readOnly:Pe=!1,renderGroup:Ce,renderInput:ke,renderOption:we,renderTags:Le,selectOnFocus:Ae=!u.freeSolo,size:Te="medium",slotProps:Re={}}=u,Ne=(0,n.Z)(u,q),{getRootProps:Me,getInputProps:De,getInputLabelProps:ze,getPopupIndicatorProps:Ee,getClearProps:Fe,getTagProps:He,getListboxProps:We,getOptionProps:je,value:Ve,dirty:Be,expanded:qe,id:Ge,popupOpen:Ke,focused:Ue,focusedTag:_e,anchorEl:Je,setAnchorEl:Qe,inputValue:Xe,groupedOptions:Ye}=b((0,a.Z)({},u,{componentName:"Autocomplete"})),$e=!A&&!z&&Be&&!Pe,et=(!ie||!0===re)&&!1!==re,{onMouseDown:tt}=De(),{ref:ot}=null!=he?he:{},nt=We(),{ref:at}=nt,rt=(0,n.Z)(nt,G),it=(0,B.Z)(at,ot),lt=se||(e=>{var t;return null!=(t=e.label)?t:e}),ct=(0,a.Z)({},u,{disablePortal:H,expanded:qe,focused:Ue,fullWidth:le,getOptionLabel:lt,hasClearIcon:$e,hasPopupIcon:et,inputFocused:-1===_e,popupOpen:Ke,size:Te}),st=(e=>{const{classes:t,disablePortal:o,expanded:n,focused:a,fullWidth:r,hasClearIcon:i,hasPopupIcon:c,inputFocused:s,popupOpen:p,size:u}=e,d={root:["root",n&&"expanded",a&&"focused",r&&"fullWidth",i&&"hasClearIcon",c&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",s&&"inputFocused"],tag:["tag","tagSize".concat((0,O.Z)(u))],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",p&&"popupIndicatorOpen"],popper:["popper",o&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return(0,l.Z)(d,V.q,t)})(ct);let pt;if(ve&&Ve.length>0){const e=e=>(0,a.Z)({className:st.tag,disabled:z},He(e));pt=Le?Le(Ve,e,ct):Ve.map(((t,o)=>(0,C.jsx)(D.Z,(0,a.Z)({label:lt(t),size:Te},e({index:o}),m))))}if(ge>-1&&Array.isArray(pt)){const e=pt.length-ge;!Ue&&e>0&&(pt=pt.splice(0,ge),pt.push((0,C.jsx)("span",{className:st.tag,children:ce(e)},pt.length)))}const ut=Ce||(e=>(0,C.jsxs)("li",{children:[(0,C.jsx)(oe,{className:st.groupLabel,ownerState:ct,component:"div",children:e.group}),(0,C.jsx)(ne,{className:st.groupUl,ownerState:ct,children:e.children})]},e.key)),dt=we||((e,t)=>{const{key:o}=e,r=(0,n.Z)(e,K);return(0,C.jsx)("li",(0,a.Z)({},r,{children:lt(t)}),o)}),gt=(e,t)=>{const o=je({option:e,index:t});return dt((0,a.Z)({},o,{className:st.option}),e,{selected:o["aria-selected"],index:t,inputValue:Xe},ct)},ft=null!=(o=Re.clearIndicator)?o:w.clearIndicator,ht=null!=(c=Re.paper)?c:w.paper,mt=null!=(s=Re.popper)?s:w.popper,bt=null!=(p=Re.popupIndicator)?p:w.popupIndicator;return(0,C.jsxs)(r.Fragment,{children:[(0,C.jsx)(U,(0,a.Z)({ref:t,className:(0,i.Z)(st.root,v),ownerState:ct},Me(Ne),{children:ke({id:Ge,disabled:z,fullWidth:!0,size:"small"===Te?"small":void 0,InputLabelProps:ze(),InputProps:(0,a.Z)({ref:Qe,className:st.inputRoot,startAdornment:pt,onClick:e=>{e.target===e.currentTarget&&tt(e)}},($e||et)&&{endAdornment:(0,C.jsxs)(_,{className:st.endAdornment,ownerState:ct,children:[$e?(0,C.jsx)(J,(0,a.Z)({},Fe(),{"aria-label":P,title:P,ownerState:ct},ft,{className:(0,i.Z)(st.clearIndicator,null==ft?void 0:ft.className),children:Z})):null,et?(0,C.jsx)(Q,(0,a.Z)({},Ee(),{disabled:z,"aria-label":Ke?k:ye,title:Ke?k:ye,ownerState:ct},bt,{className:(0,i.Z)(st.popupIndicator,null==bt?void 0:bt.className),children:Se})):null]})}),inputProps:(0,a.Z)({className:st.input,disabled:z,readOnly:Pe},De())})})),Je?(0,C.jsx)(X,(0,a.Z)({as:Ie,disablePortal:H,style:{width:Je?Je.clientWidth:null},ownerState:ct,role:"presentation",anchorEl:Je,open:Ke},mt,{className:(0,i.Z)(st.popper,null==mt?void 0:mt.className),children:(0,C.jsxs)(Y,(0,a.Z)({ownerState:ct,as:Oe},ht,{className:(0,i.Z)(st.paper,null==ht?void 0:ht.className),children:[me&&0===Ye.length?(0,C.jsx)($,{className:st.loading,ownerState:ct,children:be}):null,0!==Ye.length||ie||me?null:(0,C.jsx)(ee,{className:st.noOptions,ownerState:ct,role:"presentation",onMouseDown:e=>{e.preventDefault()},children:xe}),Ye.length>0?(0,C.jsx)(te,(0,a.Z)({as:fe,className:st.listbox,ownerState:ct},rt,he,{ref:it,children:Ye.map(((e,t)=>pe?ut({key:e.key,group:e.group,children:e.options.map(((t,o)=>gt(t,e.index+o)))}):gt(e,t)))})):null]}))})):null]})}))},43897:(e,t,o)=>{"use strict";o.d(t,{Z:()=>i,q:()=>r});var n=o(31821),a=o(18561);function r(e){return(0,a.Z)("MuiAutocomplete",e)}const i=(0,n.Z)("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"])},50482:(e,t,o)=>{var n=o(23800);e.exports=function(e,t){return n(e,t)}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[3389],{13455:(e,t,n)=>{n.d(t,{Z:()=>d});var o=n(55898),a=n.n(o),s=n(95081),r=n(72333);const i="data:image/png;base64,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";var l=n(74094),c=n(96266);function d(e){let{blocklet:t,blockletMetaUrl:n}=e;const{did:o,logo:a}=t.meta;let d;return d=a?(0,c.jsx)(s.Z,{src:(0,l.aZ)({did:o,logoPath:a,baseUrl:new URL(n).origin}),fallback:i,width:64,size:"contain",placeholder:"application logo"}):(0,c.jsx)(r.Z,{did:o,size:64}),d}d.propTypes={blocklet:a().object.isRequired,blockletMetaUrl:a().string.isRequired}},13932:(e,t,n)=>{n.d(t,{Z:()=>h});var o,a=n(71171),s=n(68420),r=n(76811),i=n(33518),l=n(39948),c=n(5057),d=n(34937),p=n(96266);const u=(e,t)=>{console.info("getDownloadBundleStep",e);return(e||[]).map((e=>{var n;const o=t("launchBlocklet.waiting.".concat("extracting"===e.status?"extractingComponent":"downloadingComponent"),{name:(null===(n=e.component)||void 0===n?void 0:n.title)||""}),a=e.total&&e.current?": ".concat(Math.floor(e.current/e.total*100)," %"):"";let s=e.name?": ".concat(e.name):"";return a||(s+="..."),"".concat(o).concat(a).concat(s)})).join("\n")};function h(e){let{appDid:t,visible:n}=e;const{t:o}=(0,s.PE)(),a=function(e){let{appDid:t}=e;const[n,o]=(0,c.useState)([]),a=(0,d.ZP)();return(0,c.useEffect)((()=>(a.on(r.BlockletEvents.downloadBundleProgress,(e=>{t&&t===(null===e||void 0===e?void 0:e.appDid)&&o((t=>{const n=[...t],o=n.findIndex((t=>{var n,o;return(null===(n=t.component)||void 0===n?void 0:n.did)===(null===(o=e.component)||void 0===o?void 0:o.did)}));return"completed"===e.status?-1!==o&&n.splice(o,1):-1!==o?n[o]=e:n.push(e),[...n]}))})),()=>{a.off(r.BlockletEvents.downloadBundleProgress)})),[t,a]),n}({appDid:t});return(0,p.jsx)(m,{style:{display:n?"block":"none"},children:u(a,o)})}h.defaultProps={appDid:"",visible:!0};const m=(0,i.Z)(l.Z)(o||(o=(0,a.Z)(["\n flex: 0 0 auto;\n white-space: pre;\n overflow-y: auto;\n overflow-x: auto;\n max-height: 10em;\n max-width: 500px;\n min-width: auto;\n @media (max-width: ","px) {\n max-width: 90%;\n max-height: 30vh;\n }\n"])),(e=>e.theme.breakpoints.values.md))},66436:(e,t,n)=>{n.d(t,{Z:()=>i});var o,a=n(71171),s=n(33518),r=n(96266);function i(e){let{children:t}=e;return(0,r.jsx)(l,{children:t})}const l=s.Z.div(o||(o=(0,a.Z)(["\n color: #1dc1c7;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n width: 100%;\n"])))},11476:(e,t,n)=>{n.d(t,{Z:()=>g});var o=n(5057),a=n(76811),s=n(31853),r=n(11397),i=n.n(r),l=n(34937),c=n(10155);const d=i()("@abtnode/webapp:launch-blocklet:runtime-state"),p=Object.keys(a.BlockletStatus),u=Object.values(a.BlockletStatus),h=Object.values(a.BlockletEvents).filter((e=>![a.BlockletEvents.purchaseChange,a.BlockletEvents.domainStatus].includes(e))),m=(e,t)=>{var n;return(null===e||void 0===e?void 0:e.appDid)===t||(null===e||void 0===e||null===(n=e.meta)||void 0===n?void 0:n.did)===t},f=8e3,x=2e3;function g(e){const t=(0,c.Z)(),n=(0,l.ZP)(),a=(0,o.useRef)(null),r=()=>{e&&!a.current&&(a.current=setInterval((()=>{e&&(d("polling blocklet state"),v())}),x))},[i,g]=(0,s.Z)({status:null,eventName:"",runtimeBlocklet:null,error:"",isGetBlocklet:!1,startPolling:r,stopPolling:()=>{a.current&&clearInterval(a.current)}}),v=()=>{t.getBlocklet({input:{did:e,attachRuntimeInfo:!0}}).then((e=>{g({status:e.blocklet?e.blocklet.status:"",eventName:"",runtimeBlocklet:e.blocklet,isGetBlocklet:!0})})).catch((e=>{console.error("get blocklet failed",e)}))};(0,o.useEffect)((()=>{let t=null;return e&&(d("schedule polling blocklet state"),t=setTimeout((()=>{r()}),f)),()=>{t&&clearInterval(t)}}),[e]),(0,o.useEffect)((()=>{e?null===i.status&&(d("polling blocklet state on start"),v()):g({status:"",eventName:"",runtimeBlocklet:null})}),[e,i.status]);const k=t=>n=>{if(m(n,e)){const e={status:null,eventName:t,runtimeBlocklet:n,isGetBlocklet:!1};if(n.error)d("blocklet error",{blockletEventName:t,error:n.error}),e.status="error",e.error=n.error;else{const o=p[u.indexOf(n.status)];d("blocklet event",{blockletEventName:t,status:o}),o&&(e.status=o)}g(e)}};for(const s of h)(0,o.useEffect)((()=>{const t=k(s);return e&&n.on(s,t),()=>{e&&n.off(s,t)}}),[e]);return i}},53389:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Ut});var o,a=n(71171),s=n(5057),r=n(53616),i=n.n(r),l=n(85493),c=n(6352),d=n.n(c),p=n(21371),u=n(72904),h=n(33518),m=n(68420),f=n(63902),x=n(51703),g=n(12073),v=n(10866),k=n(4456),w=n(99641),y=n(4651),b=n(14491),j=n(25339),A=n(75793),Z=n(2660),E=n(39948),S=n(19577),C=n(2478),P=n(44067),B=n(28726),T=n(42876),D=n(55898),R=n(96266);function M(e){let{children:t,selected:n}=e;return(0,R.jsxs)(L,{children:[t,(0,R.jsx)(E.Z,{className:"selected-container ".concat(n?"selected":""),children:(0,R.jsx)(T.default,{className:"selected-icon"})})]})}const L=(0,h.Z)(E.Z)(o||(o=(0,a.Z)(["\n position: relative;\n\n .selected-container {\n display: flex !important;\n position: absolute;\n right: 0px;\n bottom: 0px;\n -webkit-box-pack: end;\n justify-content: flex-end;\n align-items: flex-end;\n width: 32px;\n height: 32px;\n border-radius: 0px 0px 8px;\n color: rgb(255, 255, 255);\n overflow: hidden;\n transition: all 0.4s ease 0s;\n\n &::after {\n position: absolute;\n z-index: 0;\n left: 60px;\n top: 60px;\n display: block;\n width: 0px;\n height: 0px;\n border-width: 16px;\n border-style: solid;\n border-color: transparent #1dc1c7 #1dc1c7 transparent;\n transition: all 0.1s ease 0s;\n content: '';\n }\n\n .selected-icon {\n visibility: hidden;\n width: 60%;\n height: 60%;\n position: relative;\n z-index: 2;\n margin: 0px 1px 1px 0px;\n font-size: 16px;\n transition: all 0.2s ease 0s;\n }\n }\n\n .selected-container.selected {\n &::after {\n left: 0px;\n top: 0px;\n }\n\n .selected-icon {\n visibility: visible;\n }\n }\n"])));M.propTypes={children:D.node.isRequired,selected:D.bool},M.defaultProps={selected:!1};var N=n(67654),F=n(65873),Q=n(94639);const U=(0,s.createContext)({}),{Provider:O,Consumer:G}=U;function I(e){let{children:t}=e;const{t:n}=(0,m.PE)(),[o,a]=(0,N.Z)("spaceGatewaysForRestore",[{name:"Prod DID Spaces",url:"https://www.didspaces.com/app",protected:!0},{name:"Staging DID Spaces",url:"https://spaces.staging.arcblock.io/app",protected:!0}]),[r,i]=(0,N.Z)("selectedSpaceGatewayForRestore",o.find((e=>"https://www.didspaces.com/app"===e.url)));return(0,s.useEffect)((()=>{!async function(){const e=await Promise.all(o.map((async e=>{var t;const{data:n}=await Q.Z.get(d()(e.url,"/__blocklet__.js?type=json"),{timeout:5e3}).catch((e=>(console.error(e),{data:{}}))),o=null!==(t=n.appName)&&void 0!==t?t:e.name;return(0,F.merge)(e,{name:o})})));a(e)}()}),[]),(0,R.jsx)(O,{value:{spaceGateways:o,selectedSpaceGateway:r,addSpaceGateway:e=>{const t=o.find((t=>e.url===t.url));if(t)throw new Error(n("storage.spaces.gateway.add.duplicate",{name:t.name}));a((()=>[...o,(0,F.cloneDeep)(e)])),i(e)},deleteSpaceGateway:e=>{if(e.url===r.url)throw new Error(n("storage.spaces.gateway.delete.failedForSelected"));a((()=>o.filter((t=>t.url!==e.url))))},handleSelectSpaceGateway:e=>{i(e)}},children:t})}I.defaultProps={};var J=n(92877),z=n(11750),H=n(83580),X=n(94552),K=n(67680),Y=n(19778),W=n(47595),_=n(60939),V=n(86229),q=n(72443),$=n.n(q);function ee(e){let{spaceGateway:t,onDeleteSpaceGateway:n}=e;const{t:o}=(0,m.PE)(),[a,r]=(0,s.useState)(!1),[i,l]=(0,s.useState)(!1),c=(e,t)=>{null===e||void 0===e||e.stopPropagation(),r(t)};return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(K.Z,{size:"small",onClick:e=>c(e,!0),children:(0,R.jsx)(W.default,{})}),(0,R.jsx)(_.Z,{title:o("common.delConfirmDescription",{data:"".concat(null===t||void 0===t?void 0:t.name)}),open:a,confirmButton:{text:o("common.confirm"),props:{variant:"contained",color:"error",loading:i}},cancelButton:{text:o("common.cancel"),props:{variant:"contained",color:"primary"}},onConfirm:async e=>{try{null===e||void 0===e||e.stopPropagation(),l(!0),await n(t),r(!1)}catch(a){console.error(a),V.Z.error("".concat(o("storage.spaces.gateway.delete.failed"),": ").concat($()(a)))}finally{l(!1)}},onCancel:e=>c(e,!1)})]})}ee.defaultProps={onDeleteSpaceGateway:()=>{}};const te=ee;var ne=n(95335);const oe=function(){const e=(0,ne.Z)(),t=(0,u.Z)(e.breakpoints.down("md"));return{minWidth:t?300:e.breakpoints.values.sm,isMobile:t}};var ae,se=n(74094);const re=(0,J.Z)((()=>({menuName:{display:"flex",flex:1,flexDirection:"column",paddingRight:"24px","& span":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})));function ie(e){let{spaceGateway:t,selected:n,onDeleteSpaceGateway:o,onSelectGateway:a,...s}=e;const r=re(),{t:i}=(0,m.PE)(),{isMobile:l}=oe();return(0,R.jsxs)(le,{...s,children:[(0,R.jsx)(E.Z,{display:"inline-flex",marginRight:"8px",alignItems:"center",children:(0,R.jsx)("img",{alt:t.name,src:d()(t.url,"favicon.ico"),width:"48px",height:"48px"})}),(0,R.jsxs)(E.Z,{className:r.menuName,onClick:a,children:[(0,R.jsxs)(z.Z,{component:"span",variant:"subtitle1",style:{fontWeight:"400"},children:[null===t||void 0===t?void 0:t.name," ",n&&(0,R.jsx)(Y.Z,{color:"primary",style:{marginLeft:"8px"},children:i("common.selected")})]}),(0,R.jsx)(z.Z,{className:"url",component:"span",variant:"inherit",children:"".concat(l?(0,se.aS)(null===t||void 0===t?void 0:t.url,38):null===t||void 0===t?void 0:t.url)})]}),(0,R.jsxs)(H.Z,{children:[(0,R.jsx)(K.Z,{onClick:e=>{e.stopPropagation(),window.open(t.url)},size:"small",children:(0,R.jsx)(X.Z,{})}),!0!==(null===t||void 0===t?void 0:t.protected)&&(0,R.jsx)(te,{spaceGateway:t,onDeleteSpaceGateway:async()=>{await o(t)}})]})]})}const le=(0,h.Z)(E.Z)(ae||(ae=(0,a.Z)(["\n display: flex;\n"])));ie.defaultProps={onDeleteSpaceGateway:()=>{},selected:!1,onSelectGateway:()=>{}};var ce=n(13128),de=n(44846),pe=n(47020),ue=n(55372),he=n(88574),me=n(84584);function fe(e){let{onAddGateway:t,...n}=e;const{t:o,locale:a}=(0,m.PE)(),[r,i]=(0,s.useState)(""),[l,c]=(0,s.useState)(!1),[p,u]=(0,s.useState)(!1),[h,f]=(0,s.useState)(""),x=async()=>{try{c(!0);const e=await(0,me.Z3)(r,{withSearchParams:!1});if(!await(0,me.w2)(e))throw new Error(o("storage.spaces.gateway.add.invalidUrl"));const{data:n}=await Q.Z.get(d()(new URL(e).origin,"/__blocklet__.js?type=json")),a={name:n.appName,url:e,protected:!1};await t(a),V.Z.success(o("storage.spaces.addedWithName",{name:a.name})),u(!1)}catch(e){f("".concat(o("storage.spaces.gateway.add.failed",a),": ").concat($()(e)))}finally{c(!1)}};return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(B.Z,{size:"middle",color:"primary",variant:"outlined",onClick:()=>u(!0),...n,children:o("storage.spaces.gateway.add.title")}),(0,R.jsxs)(ce.ZP,{title:o("storage.spaces.gateway.add.title"),fullWidth:!0,maxWidth:"md",open:p,onClose:()=>u(!1),PaperProps:{style:{minHeight:"auto"}},actions:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(B.Z,{onClick:e=>{e.stopPropagation(),u(!1)},color:"inherit",children:o("common.cancel")}),(0,R.jsxs)(B.Z,{onClick:e=>{e.stopPropagation(),x()},color:"primary","data-cy":"install-blocklet-next-step",disabled:l||!r,variant:"contained",autoFocus:!0,children:[l&&(0,R.jsx)(de.Z,{size:16}),o("common.confirm")]})]}),children:[(0,R.jsx)("div",{style:{paddingTop:12,overflowY:"hidden"},children:(0,R.jsx)(ue.Z,{component:"div",children:(0,R.jsx)(z.Z,{component:"div",children:(0,R.jsx)(pe.Z,{label:o("storage.spaces.gateway.add.label"),autoComplete:"off",variant:"outlined",name:"url",fullWidth:!0,value:r,onChange:e=>{f(null),i(e.target.value)},disabled:l,onKeyPress:async e=>{"Enter"===e.key&&(e.preventDefault(),await x())},autoFocus:!0})})})}),!!h&&(0,R.jsx)(he.Z,{type:"error",style:{width:"100%"},children:h})]})]})}fe.defaultProps={onAddGateway:()=>{}};const xe=fe;function ge(e){let{onConnect:t,...n}=e;const{spaceGateways:o,selectedSpaceGateway:a,handleSelectSpaceGateway:r,addSpaceGateway:i,deleteSpaceGateway:l}=(0,s.useContext)(U),{t:c}=(0,m.PE)(),d=async e=>{await l(e)};return(0,R.jsxs)(E.Z,{...n,children:[(0,R.jsx)(S.Z,{children:o.map((e=>{const t=(null===e||void 0===e?void 0:e.url)===a.url;return(0,R.jsx)(M,{selected:t,children:(0,R.jsx)(C.ZP,{button:!0,selected:t,"data-cy":"get-space-endpoint-for-restore",children:(0,R.jsx)(P.Z,{children:(0,R.jsx)(ie,{spaceGateway:e,onDeleteSpaceGateway:d,selected:t,onSelectGateway:()=>(e=>{r(e)})(e)})})},e.url)})}))}),(0,R.jsxs)(E.Z,{display:"flex",marginTop:"16px",justifyContent:"center",alignItems:"center",children:[(0,R.jsx)(xe,{onAddGateway:async e=>{await i(e)}}),(0,R.jsx)(B.Z,{sx:{marginLeft:"16px"},size:"middle",variant:"contained",onClick:()=>{t(a)},children:c("storage.spaces.connect.now")})]})]})}ge.defaultProps={onConnect:()=>{}};const ve=ge;var ke;const we=(0,h.Z)("div")(ke||(ke=(0,a.Z)(["\n width: 100%;\n height: 100%;\n overflow-y: auto;\n"])));const ye=function(){const{info:e}=(0,A.h6)(),{t:t,locale:n}=(0,s.useContext)(m.RD),o=(0,s.useMemo)((()=>e?(0,y.RU)(e):""),[e]);return(0,R.jsx)(I,{children:(0,R.jsxs)(we,{children:[(0,R.jsx)(Z.Z,{title:t("blocklet.restoreFromSpaces.connect.title"),subTitle:t("blocklet.restoreFromSpaces.connect.subTitle"),onClickBack:()=>window.history.back()}),(0,R.jsx)(E.Z,{display:"flex",justifyContent:"center",children:(0,R.jsx)(ve,{sx:{marginTop:"64px",marginBottom:"32px",width:"720px"},onConnect:e=>{const t=new URL(d()(e.url,"restore")),a=d()(o,"blocklets/restore/verify-ownership");t.searchParams.set("redirectUrl",a),t.searchParams.set("locale",n),window.location.href=t.toString()}})})]})})};var be,je=n(15849),Ae=n(73545),Ze=n(49983),Ee=n(17450),Se=n(38898),Ce=n(39463),Pe=n(70461),Be=n(31853),Te=n(13455),De=n(13932),Re=n(31910),Me=n(93040);const Le=(0,h.Z)("div")(be||(be=(0,a.Z)(["\n width: 100%;\n height: 100%;\n overflow-y: auto;\n"]))),Ne="verify-app-ownership-spaces";const Fe=function(){const{session:e}=(0,Ae.T)(),[t]=(0,je.useSearchParams)(),{t:n}=(0,m.PE)(),{api:o,info:a}=(0,A.h6)(),{api:r}=(0,Ae.T)(),{meta:i}=(0,Re.J_)(),c=(0,l.useNavigate)(),p=(0,s.useMemo)((()=>a?(0,y.RU)(a):""),[a]),[u,h]=(0,Be.Z)({isRestoring:!1,isComplete:!1,isOverwrite:!1,shouldReconnect:!1,exists:!1,accessUrl:"",isConnectOpen:!1,isConfirmOpen:!1,connectData:{action:"",checkFn:()=>{},extraParams:{}},connectMessages:{}}),f=t.get("launchType"),x=t.get("nftId"),g=t.get("chainHost"),v=t.get("from"),k=t.get("blocklet_meta_url"),w=t.get("launcherSessionId")||"",b=t.get("launcherUrl")||"",j=(e=>{const t=e.split("/").filter(Boolean);return t[t.length-2]})(i.spaceEndpoint),S=(0,Ce.getServerAuthMethod)(a,f,w,e.user),C=async(t,n)=>{const o=Array.isArray(t)?t.find((e=>!!e.sessionToken)):t;null!==o&&void 0!==o&&o.sessionToken&&((0,se.ZB)(n(o.sessionToken)),await e.refresh()),h({isConnectOpen:!1}),setTimeout((()=>{const e=new URLSearchParams({appDid:j});[{name:"launchType",value:f},{name:"nftId",value:x},{name:"from",value:v},{name:"blocklet_meta_url",value:k},{name:"chainHost",value:g}].forEach((t=>{let{name:n,value:o}=t;o&&e.set(n,o)})),c("/blocklets/restore/restore-blocklet?".concat(e.toString()))}),0)},P=async function(){var t,a,s;let l=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!l){if(u.shouldReconnect)return void(window.location.href=d()(p,"blocklets/restore/connect-space"));if(e.user){const e=await o.getBlocklet({input:{did:j,attachRuntimeInfo:!0}});if(e.blocklet){const t=await(0,Me.DB)(e.blocklet);if(t){const n=new URL(t);"running"!==e.blocklet.status&&n.searchParams.set("__start__","1"),h({shouldReconnect:!0,exists:!0,accessUrl:n.href})}return}}}if("nft"===S){var c,m,v;const e=new URL(window.location.href);e.pathname=d()(null!==(c=null===(m=window)||void 0===m||null===(v=m.env)||void 0===v?void 0:v.apiPrefix)&&void 0!==c?c:"/","/api/did/".concat(Ne,"/token")),e.searchParams.set("appDid",j),e.searchParams.set("endpoint",i.spaceEndpoint),e.searchParams.set("referrer",window.location.href),e.searchParams.set("nftId",x),e.searchParams.set("appPid",i.did);const t={autoConnect:!1,launchType:f,nftId:x};g&&(e.searchParams.set("chainHost",g),t.chainHost=g),l&&e.searchParams.set("overwrite","1");const{data:o}=await r.get(e.href);return o.error?void V.Z.error(o.error):(t.nw=o.url,void h({isConnectOpen:!0,connectData:{action:"verify-restore-by-nft",extraParams:t},connectMessages:{title:n("blocklet.restoreFromSpaces.nftAuthDialog.title"),scan:n("blocklet.restoreFromSpaces.nftAuthDialog.scan"),confirm:n("blocklet.restoreFromSpaces.nftAuthDialog.confirm"),success:n("blocklet.restoreFromSpaces.nftAuthDialog.success")}}))}if("launcher"===S){const{launcherSession:e,error:t}=await o.getLauncherSession({input:{launcherUrl:b,launcherSessionId:w}});return void(e?h({isConnectOpen:!0,connectData:{action:Ne,extraParams:{appDid:j,appPid:i.did,endpoint:i.spaceEndpoint,referrer:window.location.href,restoreFrom:"spaces",overwrite:l?"1":void 0,launcherUrl:b,launcherSessionId:w,chainHost:g}},connectMessages:{title:n("blocklet.restoreBlocklet.verify.title"),scan:n("blocklet.restoreBlocklet.verify.scan"),confirm:n("blocklet.restoreBlocklet.verify.confirm"),success:n("blocklet.restoreBlocklet.verify.success")}}):V.Z.error("Launch session invalid: ".concat(t)))}if("session"===S)return void h({isConnectOpen:!0,connectData:{action:Ne,extraParams:{appDid:j,appPid:i.did,endpoint:i.spaceEndpoint,referrer:window.location.href,overwrite:l?"1":void 0,restoreFrom:"spaces"}},connectMessages:{title:n("blocklet.restoreBlocklet.verify.title"),scan:n("blocklet.restoreBlocklet.verify.scan"),confirm:n("blocklet.restoreBlocklet.verify.confirm"),success:n("blocklet.restoreBlocklet.verify.success")}});const k=new URL(window.location.href);k.pathname=d()(null!==(t=null===(a=window)||void 0===a||null===(s=a.env)||void 0===s?void 0:s.apiPrefix)&&void 0!==t?t:"/","/api/did/".concat(Ne,"/token")),k.searchParams.set("appDid",j),k.searchParams.set("appPid",i.did),k.searchParams.set("endpoint",i.spaceEndpoint),k.searchParams.set("referrer",window.location.href),k.searchParams.set("restoreFrom","spaces");const{data:y}=await r.get(k.href);e.login(C,{nw:y.url,openMode:"popup"})};return(0,s.useEffect)((()=>{P()}),[]),(0,R.jsxs)(Le,{children:[(0,R.jsx)(Z.Z,{title:n("blocklet.restoreBlocklet.verify.title"),subTitle:n("blocklet.restoreBlocklet.verify.subTitle"),onClickBack:()=>window.history.back()}),(0,R.jsxs)(E.Z,{textAlign:"center",mt:6,children:[(0,R.jsx)(Te.Z,{blocklet:{meta:i},blockletMetaUrl:k}),(0,R.jsxs)(E.Z,{mt:2,mb:2,children:[(0,R.jsx)(z.Z,{variant:"body2",children:i.title}),(0,R.jsx)(Ee.Z,{did:j})]}),u.exists&&u.accessUrl&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(z.Z,{component:"p",variant:"body1",gutterBottom:!0,sx:{color:"orange"},children:n("blocklet.restoreBlocklet.verify.exists")}),(0,R.jsxs)(z.Z,{component:"div",sx:{marginTop:"32px"},children:[u.accessUrl&&(0,R.jsx)(B.Z,{variant:"contained",component:Se.Z,href:u.accessUrl,sx:{width:"160px",height:"100%"},children:n("blocklet.restoreBlocklet.verify.open")}),(0,R.jsx)(B.Z,{variant:"contained",color:"error",onClick:()=>{h({isConfirmOpen:!0})},sx:{width:"160px",height:"100%",marginLeft:"32px"},children:n("blocklet.restoreBlocklet.verify.overwrite")})]})]}),!u.exists&&(0,R.jsx)(B.Z,{variant:"contained",disabled:u.isConnectOpen,onClick:P,sx:{width:"180px",height:"100%"},children:n("blocklet.restoreBlocklet.verify.".concat(u.shouldReconnect?"reconnect":"verify"))})]}),u.connectData.isConnectOpen&&(0,R.jsx)(De.Z,{appDid:j,visible:!1}),(0,R.jsx)(Ze.Z,{popup:!0,open:u.isConnectOpen,forceConnected:!1,saveConnect:!1,action:u.connectData.action,checkFn:r.get,checkTimeout:3e5,webWalletUrl:(0,se.yP)(a),onSuccess:C,extraParams:u.connectData.extraParams,messages:u.connectMessages,onClose:()=>{h({isConnectOpen:!1})}}),u.isConfirmOpen&&(0,R.jsx)(Pe.Z,{color:"error",title:n("blocklet.restoreBlocklet.overwrite.title"),description:n("blocklet.restoreBlocklet.overwrite.description"),confirm:n("common.confirm"),onCancel:()=>{h({isConfirmOpen:!1})},onConfirm:()=>{h({isConfirmOpen:!1,isOverwrite:!0}),P(!0)}})]})};var Qe,Ue=n(55309);const Oe=(0,h.Z)(Ue.Z)(Qe||(Qe=(0,a.Z)(["\n && .result-footer {\n height: 120px;\n > div {\n flex-wrap: wrap;\n }\n }\n"])));var Ge,Ie,Je,ze=n(35266),He=n(76811),Xe=n(77429),Ke=n(75506),Ye=n.n(Ke),We=n(50482),_e=n.n(We),Ve=n(11397),qe=n.n(Ve),$e=n(11476),et=n(34937),tt=n(66436);const nt=qe()("@abtnode/webapp:restore-blocklet:step-install"),ot=(0,h.Z)("div")(Ge||(Ge=(0,a.Z)(["\n display: flex;\n align-items: center;\n justify-content: flex-start;\n flex-direction: column;\n width: 100%;\n height: 100%;\n overflow-y: auto;\n"]))),at=h.Z.div(Ie||(Ie=(0,a.Z)(["\n line-height: 1.4em;\n .error-desc {\n margin-top: 8px;\n word-wrap: break-word;\n color: ",";\n }\n"])),(e=>e.theme.palette.grey[500])),st={[He.RESTORE_PROGRESS_STATUS.waiting]:0,[He.RESTORE_PROGRESS_STATUS.start]:1,[He.RESTORE_PROGRESS_STATUS.importData]:2,[He.RESTORE_PROGRESS_STATUS.downloading]:3,[He.RESTORE_PROGRESS_STATUS.importDataSuccess]:4,[He.RESTORE_PROGRESS_STATUS.installing]:5,[He.RESTORE_PROGRESS_STATUS.completed]:10};const rt=(0,h.Z)(E.Z)(Je||(Je=(0,a.Z)(["\n padding-top: 24px;\n"]))),it=function(){var e,t,n,o;const a=new URL(window.location.href),r=a.searchParams.get("appDid"),i=a.searchParams.get("launchType"),l=a.searchParams.get("nftId"),c=a.searchParams.get("fromLauncher"),d=a.searchParams.get("from"),p=a.searchParams.get("chainHost"),u=function(e){let{appDid:t}=e;const[n,o]=(0,s.useState)(He.RESTORE_PROGRESS_STATUS.waiting),a=(0,et.ZP)();return a.connect(),(0,s.useEffect)((()=>(a.on(He.BlockletEvents.restoreProgress,(e=>{t===(null===e||void 0===e?void 0:e.appDid)&&o(e)})),()=>{a.off(He.BlockletEvents.restoreProgress)})),[t,a]),n}({appDid:r}),[h,f]=(0,s.useState)(0),x=(0,s.useRef)(null),{meta:g}=(0,Re.J_)(),{t:v}=(0,m.PE)(),{api:k,info:w}=(0,A.h6)(),[b,j]=(0,Be.Z)({nextAccessUrl:"",installError:null}),E=(0,$e.Z)(r),{status:S,eventName:C}=E,P=()=>{f(12),x.current&&(clearTimeout(x.current),x.current=null),x.current=setTimeout((()=>{k.getBlocklet({input:{did:r,attachRuntimeInfo:!0}}).then((e=>{e.blocklet&&M(e.blocklet)}))}),500)},T=()=>{var e,t;null!==E&&void 0!==E&&null!==(e=E.runtimeBlocklet)&&void 0!==e&&null!==(t=e.settings)&&void 0!==t&&t.initialized?f(11):P()},D=[v("blocklet.restoreFromSpaces.progress.waiting"),v("blocklet.restoreFromSpaces.progress.restoring"),v("blocklet.restoreFromSpaces.progress.importData"),v("blocklet.restoreFromSpaces.progress.downloading",{progress:"".concat(null!==(e=null===u||void 0===u||null===(t=u.data)||void 0===t?void 0:t.completed)&&void 0!==e?e:100,"/").concat(null!==(n=null===u||void 0===u||null===(o=u.data)||void 0===o?void 0:o.total)&&void 0!==n?n:100)}),v("blocklet.restoreFromSpaces.progress.importSuccess"),v("launchBlocklet.waiting.downloading"),v("launchBlocklet.waiting.verifying"),v("launchBlocklet.waiting.downloading"),v("launchBlocklet.waiting.extracting"),v("upgrading"===S?"common.upgrading":"launchBlocklet.waiting.installing"),v("launchBlocklet.waiting.installed"),v("launchBlocklet.waiting.starting"),v("launchBlocklet.waiting.done")];(0,s.useEffect)((()=>{if(u.status===He.RESTORE_PROGRESS_STATUS.error){const e={message:u.message,name:"restoreFailed",action:"retryRestore"};return _e()(e,b.installError)||V.Z.error($()(e)),void j({installError:e})}f(st[u.status]||0)}),[u.status]),(0,s.useEffect)((()=>{if("serverless"!==i||C!==He.BlockletEvents.nftConsumed)switch(S){case"waiting":f(6);break;case"downloading":f(7);break;case"installing":case"upgrading":f(8);break;case"installed":if("serverless"===i&&!(0,Me.MZ)(E))break;T();break;case"starting":f(11);break;case"running":f(12),P();break;case"stopped":P();break;case"corrupted":case"error":{var e;null===E||void 0===E||E.stopPolling();const t={message:null===E||void 0===E||null===(e=E.error)||void 0===e?void 0:e.message,name:null===E||void 0===E?void 0:E.eventName,action:"retryRestore"},n=function(){var e;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!_e()(t,b.installError)&&null!==E&&void 0!==E&&null!==(e=E.error)&&void 0!==e&&e.message&&V.Z.error($()(E.error)),j({installError:t,...n})};k.getBlocklet({input:{did:r,attachRuntimeInfo:!0}}).then((e=>{var o;let{blocklet:a}=e;null!==a&&void 0!==a&&null!==(o=a.settings)&&void 0!==o&&o.initialized&&(t.action="retryStart"),n()})).catch((()=>{n()}))}}else T()}),[S,C,E]);const M=async e=>{const t=await(0,Me.DB)(e);if(Ye()(t))return;const n=new URL(t);n.searchParams.set("serverUrl",(0,y.RU)(w)),"running"!==e.status&&n.searchParams.set("__start__","1"),c&&n.searchParams.set("fromLauncher",c),d&&n.searchParams.set("from",d),i&&n.searchParams.set("launchType",i),l&&n.searchParams.set("nftId",l),p&&n.searchParams.set("chainHost",p),null===E||void 0===E||E.stopPolling(),j({nextAccessUrl:n.href,status:e.status,resultMessage:"running"===e.status?{variant:"success",title:v("blocklet.restoreFromSpaces.restore.completeTitle"),subTitle:"",footer:v("common.open")}:{variant:"info",title:v("blocklet.restoreFromSpaces.restore.installedTitle"),subTitle:v("blocklet.restoreFromSpaces.restore.installedSubTitle"),footer:v("common.configuration")}})};if(b.installError){const e={retryRestore:(0,R.jsx)(B.Z,{variant:"contained",className:"bottom-button","data-cy":"retry-install",component:je.Link,to:"/blocklets/restore/verify-ownership".concat(window.location.search),children:v("common.retry")}),retryStart:(0,R.jsx)(B.Z,{variant:"contained",className:"bottom-button","data-cy":"retry-start",onClick:()=>(async()=>{j({installError:null,nextAccessUrl:""}),await k.startBlocklet({input:{did:r}}),null===E||void 0===E||E.startPolling()})(),children:v("common.retry")})},t=b.installError.name?b.installError.name.replace("blocklet.",""):"installFailed";return(0,R.jsx)(Oe,{variant:"error",title:null===g||void 0===g?void 0:g.title,subTitle:(0,R.jsxs)(at,{children:[(0,R.jsx)("div",{children:v("launchBlocklet.error.".concat(t))}),b.installError.message&&(0,R.jsx)("div",{className:"error-desc",children:v("common.errorMessage")+b.installError.message})]}),footer:(0,R.jsxs)(rt,{children:[e[b.installError.action],"serverless"===i&&(0,R.jsx)("div",{style:{marginTop:"24px"},dangerouslySetInnerHTML:{__html:v("blocklet.restoreFromSpaces.restore.support",{communityLink:"https://community.arcblock.io/",supportEmail:"launcher@arcblock.io"})}})]})})}const L=!!b.nextAccessUrl;return nt("render",{status:S,eventName:C,launchType:i,runtimeBlockletState:E,state:b}),(0,R.jsxs)(ot,{children:[!L&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Z.Z,{title:v("blocklet.restoreBlocklet.restore.title"),subTitle:v("blocklet.restoreFromSpaces.restore.subTitle")}),(0,R.jsxs)(tt.Z,{children:[(0,R.jsx)(ze.Z,{increaseSpeed:.3,messageLoop:!1,message:(0,R.jsx)(Xe.Z,{steps:D,stepIndex:h,autoGrowth:10===h?1e3:4e3})}),[5,7,8].includes(h)&&(0,R.jsx)(De.Z,{appDid:r})]})]}),L&&(0,R.jsx)(Oe,{variant:b.resultMessage.variant,title:b.resultMessage.title,subTitle:b.resultMessage.subTitle,footer:(0,R.jsx)(rt,{children:(0,R.jsx)(B.Z,{variant:"contained",style:{width:"200px"},component:Se.Z,href:b.nextAccessUrl,children:b.resultMessage.footer})})})]})};const lt=function(){return(0,R.jsx)(it,{})};var ct,dt,pt,ut=n(23484);function ht(){const e=(0,u.Z)((e=>e.breakpoints.down("md"))),{t:t,locale:n}=(0,m.PE)(),{info:o}=(0,A.h6)(),a=(0,ut.Z)(),{meta:r}=(0,Re.J_)(),c=(0,s.useMemo)((()=>o?(0,y.RU)(o):""),[o]),h=(0,b.yP)(o),Z=d()((0,b.Y5)(),"/blocklets/restore"),E=[{key:"verify-ownership",name:t("blocklet.restoreBlocklet.verify.title"),path:d()(Z,"verify-ownership")},{key:"restore-blocklet",name:t("blocklet.restoreFromSpaces.restore.title"),path:d()(Z,"restore-blocklet")}];let S=[];S="launcher"===i()(a.get("from"))?[{key:"purchase-space",name:t("launchBlocklet.steps.purchaseSpace")},{key:"prepare-space",name:t("launchBlocklet.steps.prepareSpace")},...E]:[{key:"connect-space",name:t("blocklet.restoreFromSpaces.connect.title"),path:d()(Z,"connect-space")},{key:"select-blocklet",name:t("blocklet.restoreFromSpaces.selectBlocklet.title")},...E];const C=(0,R.jsx)(xt,{className:"".concat(c?"logo-can-click":""),children:(0,R.jsx)(w.Z,{onClick:()=>{c&&window.open(c)},logo:e?(0,R.jsx)(v.Z,{width:"32",height:"32"}):(0,R.jsx)(k.Z,{width:"128",height:"48"})})});return(0,R.jsx)(x.W,{steps:S,children:(0,R.jsx)(f.Z,{blockletMeta:r,locale:n,useOfSkeleton:!1,navLogo:C,navSubTitle:t("blocklet.restoreFromSpaces.navSubTitle"),loading:!1,headerEndAddons:(0,R.jsx)(g.Z,{webWalletUrl:h,SessionContext:j.B3}),pcWidth:"80%",style:{height:"100%"},logoUrl:null===r||void 0===r?void 0:r.logo,children:(0,R.jsxs)(ft,{children:[(0,R.jsx)(p.Global,{styles:mt}),(0,R.jsxs)(l.Routes,{children:[(0,R.jsx)(l.Route,{path:"connect-space",element:(0,R.jsx)(ye,{})}),(0,R.jsx)(l.Route,{path:"verify-ownership",element:(0,R.jsx)(Fe,{})}),(0,R.jsx)(l.Route,{path:"restore-blocklet",element:(0,R.jsx)(lt,{})}),(0,R.jsx)(l.Route,{path:"*",element:(0,R.jsx)(l.Navigate,{to:"connect-space",replace:!0})})]})]})})})}const mt=(0,p.css)(ct||(ct=(0,a.Z)(["\n html,\n body,\n #root,\n #root > .wrapper {\n height: 100%;\n }\n"]))),ft=h.Z.div(dt||(dt=(0,a.Z)(["\n "," {\n padding-top: 34px;\n }\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n\n .bottom-button {\n min-width: 200px;\n }\n"])),(e=>e.theme.breakpoints.up("md"))),xt=h.Z.div(pt||(pt=(0,a.Z)(["\n margin-top: -1px;\n &.logo-can-click {\n cursor: pointer;\n }\n"])));var gt,vt,kt,wt=n(83294),yt=n(72333),bt=n(25710);function jt(e){let{onSelect:t}=e;const{api:n}=(0,A.h6)(),{t:o,locale:a}=(0,m.PE)(),[r,i]=(0,s.useState)(!1),[c,d]=(0,s.useState)([]),[p,u]=(0,s.useState)(""),[h,f]=(0,s.useState)(null),x=(0,l.useNavigate)();(0,s.useEffect)((()=>{(async()=>{try{i(!0),f(!1);const{getBlocklets:{blocklets:e},getBlockletsFromBackup:{backups:t}}=await n.doBatchQuery({getBlocklets:{input:{}},getBlockletsFromBackup:{input:{}}});d((t||[]).filter((t=>!(e||[]).some((e=>{var n;return t.appPid===(null===(n=e.meta)||void 0===n?void 0:n.did)})))).sort(((e,t)=>t.createdAt-e.createdAt)).slice(0,200)),i(!1)}catch(e){i(!1),f(e.message)}})()}),[]);let g=null;return g=h?(0,R.jsx)(he.Z,{type:"error",style:{width:"100%",marginTop:8},children:h}):r?(0,R.jsx)(de.Z,{size:16}):c.length?(0,R.jsx)(Zt,{children:c.map((e=>(0,R.jsxs)(Et,{className:"middle-font-size space ".concat(p===e.appDid?"selected":""),onClick:()=>(e=>{u(e.appDid)})(e),children:[(0,R.jsxs)("div",{className:"left",children:[(0,R.jsx)("div",{className:"header",children:(0,R.jsx)(E.Z,{sx:{width:40,height:40},children:(0,R.jsx)(yt.Z,{did:e.appDid,size:40})})}),(0,R.jsxs)("div",{className:"body",children:[(0,R.jsx)(z.Z,{className:"text",children:e.name}),(0,R.jsx)(z.Z,{className:"text middle-font-size",children:(0,R.jsx)(Ee.Z,{responsive:!1,compact:!0,inline:!0,copyable:!1,size:12,did:e.appDid})})]}),(0,R.jsxs)(E.Z,{color:"text.secondary",className:"footer small-font-size",children:[o("blocklet.restoreFromServer.backupIn")," ",(0,b.B2)(e.createdAt,a)]})]}),(0,R.jsx)("div",{className:"right",children:(0,R.jsx)("div",{className:"more",children:(0,R.jsx)(K.Z,{onClick:()=>{},className:"more-btn",size:"large","aria-label":"more functions",children:(0,R.jsx)(wt.Z,{color:"disabled"})})})}),(0,R.jsx)("div",{className:"selected-container",children:(0,R.jsx)(T.default,{className:"selected-icon"})})]},e.appDid)))}):(0,R.jsx)(bt.Z,{children:o("common.empty")}),(0,R.jsxs)(At,{style:{width:"100%"},children:[(0,R.jsx)(Z.Z,{title:o("blocklet.restoreFromServer.selectTitle"),subTitle:o("blocklet.restoreFromServer.description")}),(0,R.jsx)(E.Z,{mt:4,mx:3,className:"main-body",children:g}),(0,R.jsx)(E.Z,{className:"main-footer",display:"flex",justifyContent:"center",children:(0,R.jsx)(B.Z,{sx:{width:"180px",height:"100%"},onClick:e=>{e.stopPropagation(),(()=>{const e=c.find((e=>e.appDid===p));t({did:e.appDid,name:e.appDid,title:e.name});const n=new URL(window.location.href);n.searchParams.set("appDid",e.appDid),n.searchParams.set("appName",e.name),x("/blocklets/restore/verify-ownership".concat(n.search))})()},color:"primary","data-cy":"install-blocklet-next-step",variant:"contained",disabled:r||h||!p,children:o("common.restore")})})]})}jt.defaultProps={onSelect:()=>{}};const At=(0,h.Z)(E.Z)(gt||(gt=(0,a.Z)(["\n .main-body {\n height: 50vh;\n "," {\n height: 80vh;\n }\n\n overflow: auto;\n }\n .main-footer {\n padding-top: 24px;\n padding-bottom: 24px;\n "," {\n position: fixed;\n bottom: 16px;\n width: 100%;\n padding-bottom: 0;\n }\n }\n"])),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.breakpoints.down("md"))),Zt=(0,h.Z)(E.Z)(vt||(vt=(0,a.Z)(["\n display: block;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n max-width: 1000px;\n margin: 0 auto;\n\n .space {\n display: flex;\n margin: 8px auto;\n\n .selected-container {\n position: absolute;\n right: 0px;\n bottom: 0px;\n display: flex;\n -webkit-box-pack: end;\n justify-content: flex-end;\n align-items: flex-end;\n width: 30px;\n height: 30px;\n border-radius: 0px 0px 7px;\n color: rgb(255, 255, 255);\n overflow: hidden;\n transition: all 0.3s ease 0s;\n\n &::after {\n position: absolute;\n z-index: 0;\n left: 30px;\n top: 30px;\n display: block;\n width: 0px;\n height: 0px;\n border-width: 15px;\n border-style: solid;\n /* border-color: transparent rgb(29, 193, 199) rgb(29, 193, 199) transparent; */\n border-color: transparent ","\n "," transparent;\n transition: all 0.1s ease 0s;\n content: '';\n }\n\n .selected-icon {\n visibility: hidden;\n width: 60%;\n height: 60%;\n position: relative;\n z-index: 2;\n margin: 0px 1px 1px 0px;\n font-size: 16px;\n transition: all 0.2s ease 0s;\n }\n }\n }\n\n .space.selected {\n background-color: rgb(236, 251, 253);\n border-color: rgb(236, 251, 253);\n\n .selected-container {\n &::after {\n left: 0px;\n top: 0px;\n }\n\n .selected-icon {\n visibility: visible;\n }\n }\n }\n"])),(e=>e.theme.palette.primary.main),(e=>e.theme.palette.primary.main)),Et=(0,h.Z)("div")(kt||(kt=(0,a.Z)(["\n display: flex;\n position: relative;\n width: 100%;\n padding: 10px;\n border: 1 solid #ccc;\n cursor: pointer;\n\n .left {\n display: flex;\n align-items: flex-start;\n width: 100%;\n margin: 0px 20px 0px 0px;\n\n .header {\n padding: 5px 16px 0 0;\n }\n\n .body {\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n\n .footer {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n height: 100%;\n }\n }\n\n .right {\n display: flex;\n }\n\n "," {\n .left {\n display: flex;\n flex-direction: column;\n margin-right: 20px;\n\n .header {\n display: none;\n }\n\n .footer {\n margin-top: 6px;\n margin-left: 0px;\n padding: 2px 0px;\n height: auto;\n }\n }\n\n .right {\n width: auto;\n }\n\n .text {\n display: -webkit-box;\n overflow: hidden;\n -webkit-box-orient: vertical;\n }\n }\n\n // \u516c\u5171\u5c5e\u6027\n .middle-font-size {\n font-size: 14px;\n }\n\n .small-font-size {\n font-size: 12px;\n }\n"])),(e=>e.theme.breakpoints.down("md")));var St,Ct=n(95712);const Pt=(0,h.Z)("div")(St||(St=(0,a.Z)(["\n width: 100%;\n height: 100%;\n overflow-y: auto;\n"]))),Bt="verify-app-ownership-disk";const Tt=function(){const e=new URL(window.location.href),t=e.searchParams.get("appDid"),n=e.searchParams.get("appName"),{t:o}=(0,m.PE)(),{api:a,info:r}=(0,A.h6)(),{session:i,api:l}=(0,Ae.T)(),c=(0,s.useMemo)((()=>r?(0,y.RU)(r):""),[r]),[p,u]=(0,Be.Z)({isRestoring:!1,isComplete:!1,connectData:{isConnectOpen:!1,action:"",checkFn:()=>{},extraParams:{}}}),h=()=>{u({connectData:{isConnectOpen:!1}}),setTimeout((()=>{const e=new URL(d()(c,"blocklets/restore/restore-blocklet".concat(window.location.search)));window.location.href=e.href}),0)},f=async()=>{if(i.user)await(async()=>{if((await a.getBlocklet({input:{did:t}})).blocklet)return V.Z.error("Blocklet ".concat(n,"(").concat(t,") already exists")),void u({shouldReconnect:!0});u({connectData:{isConnectOpen:!0,action:Bt,extraParams:{appDid:t,restoreFrom:"disk"}}})})();else{var e,o,s;const n=new URL(window.location.href);n.pathname=d()(null!==(e=null===(o=window)||void 0===o||null===(s=o.env)||void 0===s?void 0:s.apiPrefix)&&void 0!==e?e:"/","/api/did/".concat(Bt,"/token")),n.searchParams.set("appDid",t),n.searchParams.set("restoreFrom","disk");const{data:a}=await l.get(n.href);i.login(h,{nw:a.url,openMode:"popup"})}};return(0,s.useEffect)((()=>{f()}),[]),(0,R.jsxs)(Pt,{children:[(0,R.jsx)(Z.Z,{title:o("blocklet.restoreBlocklet.verify.title"),subTitle:o("blocklet.restoreBlocklet.verify.subTitle")}),(0,R.jsxs)(E.Z,{textAlign:"center",mt:6,children:[(0,R.jsx)(Ct.Z,{did:t,size:128}),(0,R.jsxs)(E.Z,{mt:2,mb:2,children:[(0,R.jsx)(z.Z,{variant:"body2",children:n}),(0,R.jsx)(Ee.Z,{did:t})]}),(0,R.jsx)(B.Z,{variant:"contained",disabled:p.connectData.isConnectOpen,onClick:f,sx:{width:"180px",height:"100%"},children:o("blocklet.restoreBlocklet.verify.".concat(p.shouldReconnect?"reconnect":"verify"))})]}),p.connectData.isConnectOpen&&(0,R.jsx)(De.Z,{appDid:t,visible:!1}),(0,R.jsx)(Ze.Z,{popup:!0,open:p.connectData.isConnectOpen,forceConnected:!1,saveConnect:!1,action:p.connectData.action,checkFn:l.get,checkTimeout:3e5,webWalletUrl:(0,se.yP)(r),onSuccess:h,extraParams:p.connectData.extraParams,messages:{title:o("blocklet.restoreBlocklet.verify.title"),scan:o("blocklet.restoreBlocklet.verify.scan"),confirm:o("blocklet.restoreBlocklet.verify.confirm"),success:o("blocklet.restoreBlocklet.verify.success")},onClose:()=>{u({connectData:{isConnectOpen:!1}})}})]})};var Dt,Rt,Mt;function Lt(){const e=(0,u.Z)((e=>e.breakpoints.down("md"))),{t:t,locale:n}=(0,m.PE)(),{info:o}=(0,A.h6)(),{meta:a,setMeta:r}=(0,s.useState)({}),i=(0,s.useMemo)((()=>o?(0,y.RU)(o):""),[o]),c=(0,b.yP)(o),h=d()((0,b.Y5)(),"/blocklets/restore"),Z=[{key:"select",name:t("blocklet.restoreFromServer.selectTitle"),path:d()(h,"select")},{key:"verify-ownership",name:t("blocklet.restoreBlocklet.verify.title"),path:d()(h,"verify-ownership")},{key:"restore-blocklet",name:t("blocklet.restoreBlocklet.restore.title"),path:d()(h,"restore-blocklet")}],E=(0,R.jsx)(Qt,{className:"".concat(i?"logo-can-click":""),children:(0,R.jsx)(w.Z,{onClick:()=>{i&&window.open(i)},logo:e?(0,R.jsx)(v.Z,{width:"32",height:"32"}):(0,R.jsx)(k.Z,{width:"128",height:"48"})})});return(0,R.jsx)(x.W,{steps:Z,children:(0,R.jsx)(f.Z,{blockletMeta:{...a,registryUrl:""},locale:n,useOfSkeleton:!1,navLogo:E,headerEndAddons:(0,R.jsx)(g.Z,{webWalletUrl:c,SessionContext:j.B3}),pcWidth:"80%",style:{height:"100%"},logoUrl:null===a||void 0===a?void 0:a.logo,children:(0,R.jsxs)(Ft,{children:[(0,R.jsx)(p.Global,{styles:Nt}),(0,R.jsxs)(l.Routes,{children:[(0,R.jsx)(l.Route,{path:"select",element:(0,R.jsx)(jt,{onSelect:r})}),(0,R.jsx)(l.Route,{path:"verify-ownership",element:(0,R.jsx)(Tt,{})}),(0,R.jsx)(l.Route,{path:"restore-blocklet",element:(0,R.jsx)(lt,{})}),(0,R.jsx)(l.Route,{path:"*",element:(0,R.jsx)(l.Navigate,{to:"select".concat(window.location.search),replace:!0})})]})]})})})}const Nt=(0,p.css)(Dt||(Dt=(0,a.Z)(["\n html,\n body,\n #root,\n #root > .wrapper {\n height: 100%;\n }\n"]))),Ft=h.Z.div(Rt||(Rt=(0,a.Z)(["\n "," {\n padding-top: 34px;\n }\n width: 100%;\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n\n .bottom-button {\n min-width: 200px;\n }\n"])),(e=>e.theme.breakpoints.up("md"))),Qt=h.Z.div(Mt||(Mt=(0,a.Z)(["\n margin-top: -1px;\n &.logo-can-click {\n cursor: pointer;\n }\n"])));function Ut(){const{search:e}=window.location;return e.includes("restoreFrom=server")?(0,R.jsx)(Lt,{}):(0,R.jsx)(ht,{})}},99641:(e,t,n)=>{n.d(t,{Z:()=>d});var o,a,s=n(71171),r=n(55898),i=n.n(r),l=n(33518),c=n(96266);function d(e){let{logo:t,name:n,subname:o,previousData:a,...s}=e,r=(0,c.jsx)(p,{logo:t}),i=n,l=o;return a.logo&&(r=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(p,{logo:t,className:"left-fade-in-ele"}),(0,c.jsx)(p,{logo:a.logo,className:"postion-abs left-fade-out-ele"})]})),a.name&&a.name!==n&&(i=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("span",{className:"right-fade-in-ele",style:{display:"inline-block"},children:n}),(0,c.jsx)("span",{className:"postion-abs right-fade-out-ele",children:a.name})]})),a.subname&&a.subname!==o&&(l=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("span",{className:"right-fade-in-ele",style:{display:"inline-block"},children:o}),(0,c.jsx)("span",{className:"postion-abs right-fade-out-ele",children:a.subname})]})),(0,c.jsx)(h,{...s,children:(0,c.jsxs)("div",{className:"logo-inner",children:[(0,c.jsx)("div",{className:"logo-img-content",children:r}),(0,c.jsxs)("div",{className:"logo-info ".concat(n||o?"":"zero-left"),children:[(0,c.jsx)("div",{className:"logo-name",children:i}),(0,c.jsx)("div",{className:"logo-subname",children:l})]})]})})}function p(e){let{logo:t,...n}=e;return(0,c.jsx)(u,{...n,children:t})}d.propTypes={logo:i().element.isRequired,name:i().string,subname:i().string,previousData:i().object},d.defaultProps={name:"",subname:"",previousData:{logo:"",name:"",subname:""}};const u=l.Z.div(o||(o=(0,s.Z)(["\n display: block;\n > * {\n display: block;\n }\n"]))),h=l.Z.div(a||(a=(0,s.Z)(["\n position: relative;\n display: block;\n\n .logo-inner {\n display: flex;\n align-items: center;\n height: 100%;\n .logo-img-content {\n position: relative;\n display: block;\n }\n .logo-info {\n display: flex;\n flex-direction: column;\n justify-content: center;\n margin-left: 10px;\n letter-spacing: 0.1px;\n &.zero-left {\n margin-left: 0%;\n }\n .logo-name {\n position: relative;\n line-height: 16px;\n font-size: 16px;\n color: #121319;\n }\n .logo-subname {\n position: relative;\n line-height: 13px;\n font-size: 13px;\n color: #7d8085;\n }\n }\n }\n\n .postion-abs {\n position: absolute;\n left: 0;\n top: 0;\n height: 100%;\n }\n\n .right-fade-out-ele {\n animation: right-fade-out ease 0.5s;\n animation-delay: 2s;\n animation-fill-mode: forwards;\n }\n\n .right-fade-in-ele {\n animation: right-fade-in ease 0.5s;\n animation-delay: 2s;\n animation-fill-mode: both;\n }\n\n @keyframes right-fade-out {\n 0% {\n opacity: 1;\n transform: translate(0, 0);\n }\n 100% {\n opacity: 0;\n transform: translate(8px, 0);\n }\n }\n\n @keyframes right-fade-in {\n 0% {\n opacity: 0;\n transform: translate(8px, 0);\n }\n 100% {\n opacity: 1;\n transform: translate(0, 0);\n }\n }\n\n .left-fade-out-ele {\n animation: left-fade-out ease 0.5s;\n animation-delay: 2s;\n animation-fill-mode: forwards;\n }\n\n .left-fade-in-ele {\n animation: left-fade-in ease 0.5s;\n animation-delay: 2s;\n animation-fill-mode: both;\n }\n\n @keyframes left-fade-out {\n 0% {\n opacity: 1;\n transform: translate(0, 0);\n }\n 100% {\n opacity: 0;\n transform: translate(-8px, 0);\n }\n }\n\n @keyframes left-fade-in {\n 0% {\n opacity: 0;\n transform: translate(-8px, 0);\n }\n 100% {\n opacity: 1;\n transform: translate(0, 0);\n }\n }\n"])))},60344:(e,t,n)=>{n.d(t,{hi:()=>s,od:()=>a.a});var o=n(10458),a=n.n(o);a().defaults.timeout=1e4;const s=a().create()},84584:(e,t,n)=>{n.d(t,{EJ:()=>v,Jf:()=>g,LQ:()=>p,Nb:()=>u,UV:()=>k,Xv:()=>c,Z3:()=>w,ag:()=>m,mo:()=>h,nD:()=>d,nU:()=>x,w2:()=>f});var o=n(82434),a=n.n(o),s=n(76811),r=n(65873),i=n(2842),l=n(60344);function c(e){const t=e.replace(/\/api\/space\/.+/,""),n=e.replace(/\/$/,"").split("/"),o=n.at(-4),a=n.at(-2);return(0,i.xn)(t,"space",o,"apps",a,"explorer?key=/apps/".concat(a,"/.did-objects/").concat(a,"/"))}function d(e){const t=e.replace(/\/api\/space\/.+/,""),n=e.replace(/\/$/,"").split("/").at(-4);return(0,i.xn)(t,"space",n)}function p(e){return e.replace(/\/$/,"").split("/").at(-4)}async function u(e){try{if(!a()(e))return!1;const{headers:t}=await l.hi.head(e,{timeout:5e3});return"true"===t["x-listable"]&&"true"===t["x-readable"]&&"true"===t["x-writeable"]}catch(t){return console.error(t),!1}}function h(e){var t;return(null===e||void 0===e||null===(t=e.find((e=>e.key===s.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT)))||void 0===t?void 0:t.value)||""}function m(e){const t=new URL(e);return(0,i.xn)(t.origin,t.pathname)}async function f(e){try{if(!a()(e))return!1;const t=m(e),n=(0,i.xn)(t,"space/api/did/one-click-authorization/token"),{status:o,data:s}=await l.hi.get(n,{timeout:5e3});return 200===o&&(0,r.isObject)(s)}catch(t){return console.error(t),!1}}async function x(e){let{timeout:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{timeout:3e3};try{if(!a()(e))return"";const{headers:n}=await l.hi.head(e,{timeout:t}),o=n["x-space-name"];return o?decodeURIComponent(o):""}catch(n){return console.error(n),""}}function g(e){const t=e.replace(/\/api\/space\/.+/,""),n=e.replace(/\/$/,"").split("/").at(-4);return(0,i.xn)(t,"/api/space/nft/display?spaceDid=".concat(n))}const v=e=>{var t,n;return(null===e||void 0===e||null===(t=e.configs)||void 0===t||null===(n=t.find((e=>e.key===s.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT)))||void 0===n?void 0:n.value)||null};async function k(e){const t={};return t.did=p(e),t.name=await x(e),t.url=function(e){return null===e||void 0===e?void 0:e.replace(/\/api\/space\/.+/,"")}(e),t.endpoint=e,t}async function w(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{timeout:3e4,withSearchParams:!0};if(!(0,r.isString)(e))throw new Error("url(".concat(e,") must be a string"));const o=e.startsWith("http")?e:"https://".concat(e),a=new URL(o),{data:s}=await l.hi.get((0,i.xn)(a.origin,"/__blocklet__.js?type=json"),{timeout:n.timeout}),c=null===(t=s.componentMountPoints.findLast((e=>"z8iZnaYxnkMD5AKRjTKiCb8pQr1ut8UantAcf"===e.did)))||void 0===t?void 0:t.mountPoint;if(!c)throw new Error("MountPoint(".concat(c,") not found"));const d=(0,i.xn)(a.origin,c);return n.withSearchParams&&a.searchParams.get("spaceDid")?(0,i.xn)(d,"?spaceDid=".concat(a.searchParams.get("spaceDid"))):d}}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[3389],{13455:(e,t,n)=>{n.d(t,{Z:()=>d});var o=n(55898),a=n.n(o),s=n(95081),r=n(72333);const i="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUAAAAFACAYAAADNkKWqAAAACXBIWXMAACxLAAAsSwGlPZapAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA1aSURBVHgB7d3ZjhxVEoDhxDKN902AUF/w/s/lCwthtXc3VsvyzETNJNOUe6kllzgnvk9KwVyMMNj5d2ZGRtUP//qPAaCgOwNAUQIIlCWAQFl3B5jJt2/fhvPz8+HDhw/DxcXF5n/fuXNnODk5GR4/fjzcv39/uHvXH0HW84MhCFOL0L1//35zxN9fJ+J379694cWLF0LIKgSQyewavqs8evRICFmcAHK0Y8K3LUL45MmTzZUhzE0AOdiU4dsWAYznhHHAXASQvX39+nUTvY8fP04evm1xS/z8+XMhZBYCyM5ikjuGb2ljCE2OmZIAcqsvX74Mb9682fx1bSbHTEkAuVam8F3F5JhjCSDfyR6+bSbHHEoA+Vtr4dtmcsy+BJDh06dPm3W1VsO3zeSYXQlgUeOeblzxxWstPTI55jYCWMycLy9nZXLMdQSwiIrhu4rJMZcJYOeE72omxwQB7FTG8MVnAWaLsMlxbQLYmSX3dHc1DiMePny4WaeLX9sa63Q3MTmuSQA7seae7nVuurqKUL99+zZtCE2OaxDAxmV8eXmcuO7yfG0M4V9//ZXqdRyT4xoEsFGth29bxG/8d8r2XqLJcb8EsDG9he8qsZmSNYQmx30RwEZUCN+2rCt6Jsf9EMDkMkYgroSePXu2+XrLJcS/u8kxcxDAhDLu6cY7fHGiP336dLVnYSbHTE0AE8n68nJEL474+wxMjpmKACYgfIcxOeZYArgi4ZuOyTGHEMAVCN98TI7ZhwAuKPuebsvh22ZyzC4EcAEZp5dVrkhMjrmJAM6o4svLWZkccxUBnIHw5WVyzGUCOCHha4vJMQI4AeFrm8lxXQJ4BHu6fTE5rkcAD5Dt1inDnm5PTI7rEMAdeXm5HpPj/gngLYQPk+N+CeA1hI+rmBz3RQC3CB+7MDnugwD+jz1dDmFy3LbyAbSnyxRMjttUNoBeXmYOJsdtKRdA4WMJJsdtKBNA4WMtJsd5dR9A4SMLk+N8ug2gPV2yMjnOo7sA2tOlFSbH6+sigF5epmUmx+tpOoDCR09MjpfXZACFj96ZHC+jqQAKH9WYHM+riQDa06U6k+N5pA6gPV34J5PjaaUMoJeX4WYmx9NIFUDhg/2YHB8nRQCFD45ncry/VQMofDA9k+PdrRJAe7owP5Pj2y0aQHu6sDyT4+vNHkAvL0MOJsffmzWAEb34Dy58kEfmyXFcEcaxlNkCGOGLIwPhg6tlnBzHc/jT09NFztVZApglfsIHu8k2mIxb4ojg3CYPYPwkefny5bAme7pwmEyT419++WX2SfHkATw7O9s8+1uDPV2YRobJ8RJXgZOPXGLCtDQvL8O04i4qrsDiTmqtyXFcjcYAdc67uMkDeHFxMSxF+GBeYwjXmhxHT+Y8v5t9QBY/FcQPlhEhfPDgQXePl5pdf4hL41evXpX8Kj9YUsZlhqk0v/8Vl+OvX7/ePKcQQphOxk9in1o3C7BCCNPI+ClNc+nuEwCEEA5TKXyjbj8CZTuEFb7lHg6R9fMDl9B9EcYQRvzGl6SFkOp6Hmzso0wJxjfb4+j1W+7hNsL3TyULEJf8cQghVVSY6B6i9JkvhPSu4mBjH874QQjpj/Dtxpl+yeUQZv0aP7hJ5YnuIQTwCmMIfdgCLTDYOFy6AP7+++9pvsEqforaNyarrOG7/Ensf/zxR+qr0XQB3P4csgwhtF1CJlknui1+BUXaW2AhhH/KOtiIczWiF+dDa19Bkf4ZoBBSXdbw9fCMvJkhyOUQjl/asvZX+dk3Zk5ZJ7o9DQebO1svDyQ+f/68eRaSJYT2jTlW5oluj6+HNXuWjs8d4sjy5c72jTlUCxPdHr9itouzM2ITR6Zvubddwi5MdNfV1VkphLTCRDeHLs9GISQrE91cuj4LxxBm+kNn37gmE92cSlyGxG/u6enp5g/fu3fvhvPz82Ft9o37Z6KbX6n7sPjN/u233/6e1to3Zg4muu0o+SDKdglzMNFtT+kn8ULIFEx022UUOQghhzHRbZ8AXmLfmF2Y6PbDmXQF+8ZsM9HtkzPoBvaNMdHtmzNnR7ZLajHRrcEZsych7JuJbi3OlAMJYV9MdGtyhhzJvnHbTHRrE8CJ2Dduh4kuIwGcmH3jvEx02SaAM7FdkoeJLtcRwJkJ4XpMdLmNAC5ECJdjosuuBHBh9o3nY6LLvgRwJfaNp2GiyzEEcGX2jQ9jossUBDAR2yW3M9FlSgKYkBB+z0SXOQhgYkJoosu8BLABFfeNTXRZggA2pPd9YxNdliaADept39hEl7UIYMNa3y4x0WVtAtiB1kJooksWAtiR7CGMuMTWi8EGWQhgh7LuG5+dnQ2ZCB8C2LGM+8YZmOgyEsACMu4bL81gg6sIYDEZt0vmJHzcRACL6j2EJrrsQgCL6y2EBhvsQwDZyLhvvA/h4xACyD9k3De+iYkuxxBArpRx33hksMFUBJAbZdouET6mJoDsZM0QmugyFwFkL0uG0GCDuQkgB5lz31j4WIoAcpTL+8bjh5oe6uTkZPj555+Fj8V4oMIkIoQ//fTTcIwIoPixJAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKCsdAH8+vXrALTv27dvmyOzu0MyL1++HB49ejS8ePFiuHs33S8PuEVE7/3795tDAA/w6dOnzSGE0I6Li4tN9D5//pw+fKPUZRFCyO/Lly/DmzdvNn9tTRNFEULIp+XwjZoqyRjCBw8eDM+ePRvu3bs3AMuJW9vz8/Ph3bt3m1ve1k0ewDt37sx+/x+/AXFEAOOKUAhhXi0NNvYxeQDj9nSpnwxx6f3q1avNP/P58+fD48ePB2A6a4fv5ORkmNPkAXz48OHil8bx7uDr16+Ht2/fCiFMIMNEN+IXd5RzmjyAT58+Xe2nhRDCcTINNqIlc5vlGWDE5+zsbFiLEMJ+sk10Y9C5xHk7yxQ4yh1XgBGgNV0OYfya4vbcKzTwX1knunHr++uvvw5LmK0GceX1448/bn6qrL3fG//8uCKNW/P4qRKHEFJV1olu3D3GhUoccz/7G81agXhxOY54dy9LCONqMA4vVVON8H1vkbM/WwiD7RKqyLqju2b4Roue9UIIy8m6qhbP+MZn8muFb7TK2S6EMJ+s4cu4ubXqWT6GMNNvmH1jWpR5RzfzymqKy5z4D3N6eroJ4MePHzfH2uwb04LMg43xImLudbZjpLrPi8jEEa/QxKQ2QwjtG5ORie40fvjXfwxJja+tZAjhSAivF48O/vzzz+FQ8ThkqRdgW2WiO63UARwJYRsEcD4muvNoIoAjIcxNAKdnojuvpgI4ihCOw5IsX6MZIay+byyA0zDRXU6TZ+rlq67xJ6R9Y1pnoru8ps/QCIx9Y1pnoruebs5M2yW0xkR3fd2dkUJIdia6eXR7Jgoh2Zjo5tP9GWjfmDWZ6OZW5hLEvjFLMtFtQ7l7MPvGzMlEty1Nvgg9Jdsl06n8IrSJbpvKB3AkhMerGEAT3bYJ4BYhPFylAJro9kEAr2HfeH+9B9BEtz9eRLuGfWNGJrr9cvbcwr5xXSa6/XPW7MF2SQ0munU4Ww4ghH0y0a3HWXIEIeyDiW5dzo4J2Dduj4kuQQAnZN84PxNdLhPAGdg3zsdEl6t4EXoBVbZLMr4IbaLLTQRwQb2HMFMATXTZhQCuoNcQZgigiS77EMAV9bZvvFYATXQ5lCHIiuwbH8dEl2MJYAL2jfdjostUBDAZ2yXXM9FlagKYlBD+n4kucxHA5CqH0ESXuQlgI1rYN56CiS5L8hpMoyKAEYmIRRZxJXjMFWr8/yOAJrosRQAbl/Gl6h4YbNQggJ0QwmkIXy0C2BkhPIyJbk0C2Ckh3I3BRm0C2LmM+8YZCB9BAIuI+MUGRWxSVA2hiS7bBLCgTC9VL8Fgg+sIYGG9h1D4uI0A0l0ITXTZlQDyt9ZDaLDBvgSQ72T9EILrCB+HEkCulXHf+LL4cIgnT54IHwcTQG6V6aVqgw2mJIDsbM0QCh9zEED2tmQIx2+piy9nEj6mJoAcbM4QGmywBAHkaFPuGwsfSxJAJnPMvrGJLmsQQGaxy0vVBhusTQCZVYTww4cPmy84iu/6iNDFqtr9+/eFj9UJIFCWH79AWQIIlCWAQFn/BizMxGSX68uEAAAAAElFTkSuQmCC";var l=n(74094),c=n(96266);function d(e){let{blocklet:t,blockletMetaUrl:n}=e;const{did:o,logo:a}=t.meta;let d;return d=a?(0,c.jsx)(s.Z,{src:(0,l.aZ)({did:o,logoPath:a,baseUrl:new URL(n).origin}),fallback:i,width:64,size:"contain",placeholder:"application logo"}):(0,c.jsx)(r.Z,{did:o,size:64}),d}d.propTypes={blocklet:a().object.isRequired,blockletMetaUrl:a().string.isRequired}},13932:(e,t,n)=>{n.d(t,{Z:()=>h});var o,a=n(71171),s=n(68420),r=n(77277),i=n(33518),l=n(39948),c=n(5057),d=n(34937),p=n(96266);const u=(e,t)=>{console.info("getDownloadBundleStep",e);return(e||[]).map((e=>{var n;const o=t("launchBlocklet.waiting.".concat("extracting"===e.status?"extractingComponent":"downloadingComponent"),{name:(null===(n=e.component)||void 0===n?void 0:n.title)||""}),a=e.total&&e.current?": ".concat(Math.floor(e.current/e.total*100)," %"):"";let s=e.name?": ".concat(e.name):"";return a||(s+="..."),"".concat(o).concat(a).concat(s)})).join("\n")};function h(e){let{appDid:t,visible:n}=e;const{t:o}=(0,s.PE)(),a=function(e){let{appDid:t}=e;const[n,o]=(0,c.useState)([]),a=(0,d.ZP)();return(0,c.useEffect)((()=>(a.on(r.BlockletEvents.downloadBundleProgress,(e=>{t&&t===(null===e||void 0===e?void 0:e.appDid)&&o((t=>{const n=[...t],o=n.findIndex((t=>{var n,o;return(null===(n=t.component)||void 0===n?void 0:n.did)===(null===(o=e.component)||void 0===o?void 0:o.did)}));return"completed"===e.status?-1!==o&&n.splice(o,1):-1!==o?n[o]=e:n.push(e),[...n]}))})),()=>{a.off(r.BlockletEvents.downloadBundleProgress)})),[t,a]),n}({appDid:t});return(0,p.jsx)(m,{style:{display:n?"block":"none"},children:u(a,o)})}h.defaultProps={appDid:"",visible:!0};const m=(0,i.Z)(l.Z)(o||(o=(0,a.Z)(["\n flex: 0 0 auto;\n white-space: pre;\n overflow-y: auto;\n overflow-x: auto;\n max-height: 10em;\n max-width: 500px;\n min-width: auto;\n @media (max-width: ","px) {\n max-width: 90%;\n max-height: 30vh;\n }\n"])),(e=>e.theme.breakpoints.values.md))},66436:(e,t,n)=>{n.d(t,{Z:()=>i});var o,a=n(71171),s=n(33518),r=n(96266);function i(e){let{children:t}=e;return(0,r.jsx)(l,{children:t})}const l=s.Z.div(o||(o=(0,a.Z)(["\n color: #1dc1c7;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n width: 100%;\n"])))},11476:(e,t,n)=>{n.d(t,{Z:()=>g});var o=n(5057),a=n(77277),s=n(31853),r=n(11397),i=n.n(r),l=n(34937),c=n(10155);const d=i()("@abtnode/webapp:launch-blocklet:runtime-state"),p=Object.keys(a.BlockletStatus),u=Object.values(a.BlockletStatus),h=Object.values(a.BlockletEvents).filter((e=>![a.BlockletEvents.purchaseChange,a.BlockletEvents.domainStatus].includes(e))),m=(e,t)=>{var n;return(null===e||void 0===e?void 0:e.appDid)===t||(null===e||void 0===e||null===(n=e.meta)||void 0===n?void 0:n.did)===t},f=8e3,x=2e3;function g(e){const t=(0,c.Z)(),n=(0,l.ZP)(),a=(0,o.useRef)(null),r=()=>{e&&!a.current&&(a.current=setInterval((()=>{e&&(d("polling blocklet state"),v())}),x))},[i,g]=(0,s.Z)({status:null,eventName:"",runtimeBlocklet:null,error:"",isGetBlocklet:!1,startPolling:r,stopPolling:()=>{a.current&&clearInterval(a.current)}}),v=()=>{t.getBlocklet({input:{did:e,attachRuntimeInfo:!0}}).then((e=>{g({status:e.blocklet?e.blocklet.status:"",eventName:"",runtimeBlocklet:e.blocklet,isGetBlocklet:!0})})).catch((e=>{console.error("get blocklet failed",e)}))};(0,o.useEffect)((()=>{let t=null;return e&&(d("schedule polling blocklet state"),t=setTimeout((()=>{r()}),f)),()=>{t&&clearInterval(t)}}),[e]),(0,o.useEffect)((()=>{e?null===i.status&&(d("polling blocklet state on start"),v()):g({status:"",eventName:"",runtimeBlocklet:null})}),[e,i.status]);const k=t=>n=>{if(m(n,e)){const e={status:null,eventName:t,runtimeBlocklet:n,isGetBlocklet:!1};if(n.error)d("blocklet error",{blockletEventName:t,error:n.error}),e.status="error",e.error=n.error;else{const o=p[u.indexOf(n.status)];d("blocklet event",{blockletEventName:t,status:o}),o&&(e.status=o)}g(e)}};for(const s of h)(0,o.useEffect)((()=>{const t=k(s);return e&&n.on(s,t),()=>{e&&n.off(s,t)}}),[e]);return i}},53389:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Ut});var o,a=n(71171),s=n(5057),r=n(53616),i=n.n(r),l=n(85493),c=n(6352),d=n.n(c),p=n(21371),u=n(72904),h=n(33518),m=n(68420),f=n(63902),x=n(51703),g=n(12073),v=n(10866),k=n(4456),w=n(99641),y=n(4651),b=n(14491),j=n(25339),A=n(75793),Z=n(2660),E=n(39948),S=n(19577),C=n(2478),P=n(44067),B=n(28726),T=n(42876),D=n(55898),R=n(96266);function M(e){let{children:t,selected:n}=e;return(0,R.jsxs)(L,{children:[t,(0,R.jsx)(E.Z,{className:"selected-container ".concat(n?"selected":""),children:(0,R.jsx)(T.default,{className:"selected-icon"})})]})}const L=(0,h.Z)(E.Z)(o||(o=(0,a.Z)(["\n position: relative;\n\n .selected-container {\n display: flex !important;\n position: absolute;\n right: 0px;\n bottom: 0px;\n -webkit-box-pack: end;\n justify-content: flex-end;\n align-items: flex-end;\n width: 32px;\n height: 32px;\n border-radius: 0px 0px 8px;\n color: rgb(255, 255, 255);\n overflow: hidden;\n transition: all 0.4s ease 0s;\n\n &::after {\n position: absolute;\n z-index: 0;\n left: 60px;\n top: 60px;\n display: block;\n width: 0px;\n height: 0px;\n border-width: 16px;\n border-style: solid;\n border-color: transparent #1dc1c7 #1dc1c7 transparent;\n transition: all 0.1s ease 0s;\n content: '';\n }\n\n .selected-icon {\n visibility: hidden;\n width: 60%;\n height: 60%;\n position: relative;\n z-index: 2;\n margin: 0px 1px 1px 0px;\n font-size: 16px;\n transition: all 0.2s ease 0s;\n }\n }\n\n .selected-container.selected {\n &::after {\n left: 0px;\n top: 0px;\n }\n\n .selected-icon {\n visibility: visible;\n }\n }\n"])));M.propTypes={children:D.node.isRequired,selected:D.bool},M.defaultProps={selected:!1};var N=n(67654),F=n(65873),Q=n(94639);const U=(0,s.createContext)({}),{Provider:O,Consumer:G}=U;function I(e){let{children:t}=e;const{t:n}=(0,m.PE)(),[o,a]=(0,N.Z)("spaceGatewaysForRestore",[{name:"Prod DID Spaces",url:"https://www.didspaces.com/app",protected:!0},{name:"Staging DID Spaces",url:"https://spaces.staging.arcblock.io/app",protected:!0}]),[r,i]=(0,N.Z)("selectedSpaceGatewayForRestore",o.find((e=>"https://www.didspaces.com/app"===e.url)));return(0,s.useEffect)((()=>{!async function(){const e=await Promise.all(o.map((async e=>{var t;const{data:n}=await Q.Z.get(d()(e.url,"/__blocklet__.js?type=json"),{timeout:5e3}).catch((e=>(console.error(e),{data:{}}))),o=null!==(t=n.appName)&&void 0!==t?t:e.name;return(0,F.merge)(e,{name:o})})));a(e)}()}),[]),(0,R.jsx)(O,{value:{spaceGateways:o,selectedSpaceGateway:r,addSpaceGateway:e=>{const t=o.find((t=>e.url===t.url));if(t)throw new Error(n("storage.spaces.gateway.add.duplicate",{name:t.name}));a((()=>[...o,(0,F.cloneDeep)(e)])),i(e)},deleteSpaceGateway:e=>{if(e.url===r.url)throw new Error(n("storage.spaces.gateway.delete.failedForSelected"));a((()=>o.filter((t=>t.url!==e.url))))},handleSelectSpaceGateway:e=>{i(e)}},children:t})}I.defaultProps={};var J=n(92877),z=n(11750),H=n(83580),X=n(94552),K=n(67680),Y=n(19778),W=n(47595),_=n(60939),V=n(86229),q=n(72443),$=n.n(q);function ee(e){let{spaceGateway:t,onDeleteSpaceGateway:n}=e;const{t:o}=(0,m.PE)(),[a,r]=(0,s.useState)(!1),[i,l]=(0,s.useState)(!1),c=(e,t)=>{null===e||void 0===e||e.stopPropagation(),r(t)};return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(K.Z,{size:"small",onClick:e=>c(e,!0),children:(0,R.jsx)(W.default,{})}),(0,R.jsx)(_.Z,{title:o("common.delConfirmDescription",{data:"".concat(null===t||void 0===t?void 0:t.name)}),open:a,confirmButton:{text:o("common.confirm"),props:{variant:"contained",color:"error",loading:i}},cancelButton:{text:o("common.cancel"),props:{variant:"contained",color:"primary"}},onConfirm:async e=>{try{null===e||void 0===e||e.stopPropagation(),l(!0),await n(t),r(!1)}catch(a){console.error(a),V.Z.error("".concat(o("storage.spaces.gateway.delete.failed"),": ").concat($()(a)))}finally{l(!1)}},onCancel:e=>c(e,!1)})]})}ee.defaultProps={onDeleteSpaceGateway:()=>{}};const te=ee;var ne=n(95335);const oe=function(){const e=(0,ne.Z)(),t=(0,u.Z)(e.breakpoints.down("md"));return{minWidth:t?300:e.breakpoints.values.sm,isMobile:t}};var ae,se=n(74094);const re=(0,J.Z)((()=>({menuName:{display:"flex",flex:1,flexDirection:"column",paddingRight:"24px","& span":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})));function ie(e){let{spaceGateway:t,selected:n,onDeleteSpaceGateway:o,onSelectGateway:a,...s}=e;const r=re(),{t:i}=(0,m.PE)(),{isMobile:l}=oe();return(0,R.jsxs)(le,{...s,children:[(0,R.jsx)(E.Z,{display:"inline-flex",marginRight:"8px",alignItems:"center",children:(0,R.jsx)("img",{alt:t.name,src:d()(t.url,"favicon.ico"),width:"48px",height:"48px"})}),(0,R.jsxs)(E.Z,{className:r.menuName,onClick:a,children:[(0,R.jsxs)(z.Z,{component:"span",variant:"subtitle1",style:{fontWeight:"400"},children:[null===t||void 0===t?void 0:t.name," ",n&&(0,R.jsx)(Y.Z,{color:"primary",style:{marginLeft:"8px"},children:i("common.selected")})]}),(0,R.jsx)(z.Z,{className:"url",component:"span",variant:"inherit",children:"".concat(l?(0,se.aS)(null===t||void 0===t?void 0:t.url,38):null===t||void 0===t?void 0:t.url)})]}),(0,R.jsxs)(H.Z,{children:[(0,R.jsx)(K.Z,{onClick:e=>{e.stopPropagation(),window.open(t.url)},size:"small",children:(0,R.jsx)(X.Z,{})}),!0!==(null===t||void 0===t?void 0:t.protected)&&(0,R.jsx)(te,{spaceGateway:t,onDeleteSpaceGateway:async()=>{await o(t)}})]})]})}const le=(0,h.Z)(E.Z)(ae||(ae=(0,a.Z)(["\n display: flex;\n"])));ie.defaultProps={onDeleteSpaceGateway:()=>{},selected:!1,onSelectGateway:()=>{}};var ce=n(13128),de=n(44846),pe=n(47020),ue=n(55372),he=n(88574),me=n(84584);function fe(e){let{onAddGateway:t,...n}=e;const{t:o,locale:a}=(0,m.PE)(),[r,i]=(0,s.useState)(""),[l,c]=(0,s.useState)(!1),[p,u]=(0,s.useState)(!1),[h,f]=(0,s.useState)(""),x=async()=>{try{c(!0);const e=await(0,me.Z3)(r,{withSearchParams:!1});if(!await(0,me.w2)(e))throw new Error(o("storage.spaces.gateway.add.invalidUrl"));const{data:n}=await Q.Z.get(d()(new URL(e).origin,"/__blocklet__.js?type=json")),a={name:n.appName,url:e,protected:!1};await t(a),V.Z.success(o("storage.spaces.addedWithName",{name:a.name})),u(!1)}catch(e){f("".concat(o("storage.spaces.gateway.add.failed",a),": ").concat($()(e)))}finally{c(!1)}};return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(B.Z,{size:"middle",color:"primary",variant:"outlined",onClick:()=>u(!0),...n,children:o("storage.spaces.gateway.add.title")}),(0,R.jsxs)(ce.ZP,{title:o("storage.spaces.gateway.add.title"),fullWidth:!0,maxWidth:"md",open:p,onClose:()=>u(!1),PaperProps:{style:{minHeight:"auto"}},actions:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(B.Z,{onClick:e=>{e.stopPropagation(),u(!1)},color:"inherit",children:o("common.cancel")}),(0,R.jsxs)(B.Z,{onClick:e=>{e.stopPropagation(),x()},color:"primary","data-cy":"install-blocklet-next-step",disabled:l||!r,variant:"contained",autoFocus:!0,children:[l&&(0,R.jsx)(de.Z,{size:16}),o("common.confirm")]})]}),children:[(0,R.jsx)("div",{style:{paddingTop:12,overflowY:"hidden"},children:(0,R.jsx)(ue.Z,{component:"div",children:(0,R.jsx)(z.Z,{component:"div",children:(0,R.jsx)(pe.Z,{label:o("storage.spaces.gateway.add.label"),autoComplete:"off",variant:"outlined",name:"url",fullWidth:!0,value:r,onChange:e=>{f(null),i(e.target.value)},disabled:l,onKeyPress:async e=>{"Enter"===e.key&&(e.preventDefault(),await x())},autoFocus:!0})})})}),!!h&&(0,R.jsx)(he.Z,{type:"error",style:{width:"100%"},children:h})]})]})}fe.defaultProps={onAddGateway:()=>{}};const xe=fe;function ge(e){let{onConnect:t,...n}=e;const{spaceGateways:o,selectedSpaceGateway:a,handleSelectSpaceGateway:r,addSpaceGateway:i,deleteSpaceGateway:l}=(0,s.useContext)(U),{t:c}=(0,m.PE)(),d=async e=>{await l(e)};return(0,R.jsxs)(E.Z,{...n,children:[(0,R.jsx)(S.Z,{children:o.map((e=>{const t=(null===e||void 0===e?void 0:e.url)===a.url;return(0,R.jsx)(M,{selected:t,children:(0,R.jsx)(C.ZP,{button:!0,selected:t,"data-cy":"get-space-endpoint-for-restore",children:(0,R.jsx)(P.Z,{children:(0,R.jsx)(ie,{spaceGateway:e,onDeleteSpaceGateway:d,selected:t,onSelectGateway:()=>(e=>{r(e)})(e)})})},e.url)})}))}),(0,R.jsxs)(E.Z,{display:"flex",marginTop:"16px",justifyContent:"center",alignItems:"center",children:[(0,R.jsx)(xe,{onAddGateway:async e=>{await i(e)}}),(0,R.jsx)(B.Z,{sx:{marginLeft:"16px"},size:"middle",variant:"contained",onClick:()=>{t(a)},children:c("storage.spaces.connect.now")})]})]})}ge.defaultProps={onConnect:()=>{}};const ve=ge;var ke;const we=(0,h.Z)("div")(ke||(ke=(0,a.Z)(["\n width: 100%;\n height: 100%;\n overflow-y: auto;\n"])));const ye=function(){const{info:e}=(0,A.h6)(),{t:t,locale:n}=(0,s.useContext)(m.RD),o=(0,s.useMemo)((()=>e?(0,y.RU)(e):""),[e]);return(0,R.jsx)(I,{children:(0,R.jsxs)(we,{children:[(0,R.jsx)(Z.Z,{title:t("blocklet.restoreFromSpaces.connect.title"),subTitle:t("blocklet.restoreFromSpaces.connect.subTitle"),onClickBack:()=>window.history.back()}),(0,R.jsx)(E.Z,{display:"flex",justifyContent:"center",children:(0,R.jsx)(ve,{sx:{marginTop:"64px",marginBottom:"32px",width:"720px"},onConnect:e=>{const t=new URL(d()(e.url,"restore")),a=d()(o,"blocklets/restore/verify-ownership");t.searchParams.set("redirectUrl",a),t.searchParams.set("locale",n),window.location.href=t.toString()}})})]})})};var be,je=n(15849),Ae=n(73545),Ze=n(49983),Ee=n(17450),Se=n(38898),Ce=n(39463),Pe=n(70461),Be=n(31853),Te=n(13455),De=n(13932),Re=n(31910),Me=n(93040);const Le=(0,h.Z)("div")(be||(be=(0,a.Z)(["\n width: 100%;\n height: 100%;\n overflow-y: auto;\n"]))),Ne="verify-app-ownership-spaces";const Fe=function(){const{session:e}=(0,Ae.T)(),[t]=(0,je.useSearchParams)(),{t:n}=(0,m.PE)(),{api:o,info:a}=(0,A.h6)(),{api:r}=(0,Ae.T)(),{meta:i}=(0,Re.J_)(),c=(0,l.useNavigate)(),p=(0,s.useMemo)((()=>a?(0,y.RU)(a):""),[a]),[u,h]=(0,Be.Z)({isRestoring:!1,isComplete:!1,isOverwrite:!1,shouldReconnect:!1,exists:!1,accessUrl:"",isConnectOpen:!1,isConfirmOpen:!1,connectData:{action:"",checkFn:()=>{},extraParams:{}},connectMessages:{}}),f=t.get("launchType"),x=t.get("nftId"),g=t.get("chainHost"),v=t.get("from"),k=t.get("blocklet_meta_url"),w=t.get("launcherSessionId")||"",b=t.get("launcherUrl")||"",j=(e=>{const t=e.split("/").filter(Boolean);return t[t.length-2]})(i.spaceEndpoint),S=(0,Ce.getServerAuthMethod)(a,f,w,e.user),C=async(t,n)=>{const o=Array.isArray(t)?t.find((e=>!!e.sessionToken)):t;null!==o&&void 0!==o&&o.sessionToken&&((0,se.ZB)(n(o.sessionToken)),await e.refresh()),h({isConnectOpen:!1}),setTimeout((()=>{const e=new URLSearchParams({appDid:j});[{name:"launchType",value:f},{name:"nftId",value:x},{name:"from",value:v},{name:"blocklet_meta_url",value:k},{name:"chainHost",value:g}].forEach((t=>{let{name:n,value:o}=t;o&&e.set(n,o)})),c("/blocklets/restore/restore-blocklet?".concat(e.toString()))}),0)},P=async function(){var t,a,s;let l=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!l){if(u.shouldReconnect)return void(window.location.href=d()(p,"blocklets/restore/connect-space"));if(e.user){const e=await o.getBlocklet({input:{did:j,attachRuntimeInfo:!0}});if(e.blocklet){const t=await(0,Me.DB)(e.blocklet);if(t){const n=new URL(t);"running"!==e.blocklet.status&&n.searchParams.set("__start__","1"),h({shouldReconnect:!0,exists:!0,accessUrl:n.href})}return}}}if("nft"===S){var c,m,v;const e=new URL(window.location.href);e.pathname=d()(null!==(c=null===(m=window)||void 0===m||null===(v=m.env)||void 0===v?void 0:v.apiPrefix)&&void 0!==c?c:"/","/api/did/".concat(Ne,"/token")),e.searchParams.set("appDid",j),e.searchParams.set("endpoint",i.spaceEndpoint),e.searchParams.set("referrer",window.location.href),e.searchParams.set("nftId",x),e.searchParams.set("appPid",i.did);const t={autoConnect:!1,launchType:f,nftId:x};g&&(e.searchParams.set("chainHost",g),t.chainHost=g),l&&e.searchParams.set("overwrite","1");const{data:o}=await r.get(e.href);return o.error?void V.Z.error(o.error):(t.nw=o.url,void h({isConnectOpen:!0,connectData:{action:"verify-restore-by-nft",extraParams:t},connectMessages:{title:n("blocklet.restoreFromSpaces.nftAuthDialog.title"),scan:n("blocklet.restoreFromSpaces.nftAuthDialog.scan"),confirm:n("blocklet.restoreFromSpaces.nftAuthDialog.confirm"),success:n("blocklet.restoreFromSpaces.nftAuthDialog.success")}}))}if("launcher"===S){const{launcherSession:e,error:t}=await o.getLauncherSession({input:{launcherUrl:b,launcherSessionId:w}});return void(e?h({isConnectOpen:!0,connectData:{action:Ne,extraParams:{appDid:j,appPid:i.did,endpoint:i.spaceEndpoint,referrer:window.location.href,restoreFrom:"spaces",overwrite:l?"1":void 0,launcherUrl:b,launcherSessionId:w,chainHost:g}},connectMessages:{title:n("blocklet.restoreBlocklet.verify.title"),scan:n("blocklet.restoreBlocklet.verify.scan"),confirm:n("blocklet.restoreBlocklet.verify.confirm"),success:n("blocklet.restoreBlocklet.verify.success")}}):V.Z.error("Launch session invalid: ".concat(t)))}if("session"===S)return void h({isConnectOpen:!0,connectData:{action:Ne,extraParams:{appDid:j,appPid:i.did,endpoint:i.spaceEndpoint,referrer:window.location.href,overwrite:l?"1":void 0,restoreFrom:"spaces"}},connectMessages:{title:n("blocklet.restoreBlocklet.verify.title"),scan:n("blocklet.restoreBlocklet.verify.scan"),confirm:n("blocklet.restoreBlocklet.verify.confirm"),success:n("blocklet.restoreBlocklet.verify.success")}});const k=new URL(window.location.href);k.pathname=d()(null!==(t=null===(a=window)||void 0===a||null===(s=a.env)||void 0===s?void 0:s.apiPrefix)&&void 0!==t?t:"/","/api/did/".concat(Ne,"/token")),k.searchParams.set("appDid",j),k.searchParams.set("appPid",i.did),k.searchParams.set("endpoint",i.spaceEndpoint),k.searchParams.set("referrer",window.location.href),k.searchParams.set("restoreFrom","spaces");const{data:y}=await r.get(k.href);e.login(C,{nw:y.url,openMode:"popup"})};return(0,s.useEffect)((()=>{P()}),[]),(0,R.jsxs)(Le,{children:[(0,R.jsx)(Z.Z,{title:n("blocklet.restoreBlocklet.verify.title"),subTitle:n("blocklet.restoreBlocklet.verify.subTitle"),onClickBack:()=>window.history.back()}),(0,R.jsxs)(E.Z,{textAlign:"center",mt:6,children:[(0,R.jsx)(Te.Z,{blocklet:{meta:i},blockletMetaUrl:k}),(0,R.jsxs)(E.Z,{mt:2,mb:2,children:[(0,R.jsx)(z.Z,{variant:"body2",children:i.title}),(0,R.jsx)(Ee.Z,{did:j})]}),u.exists&&u.accessUrl&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(z.Z,{component:"p",variant:"body1",gutterBottom:!0,sx:{color:"orange"},children:n("blocklet.restoreBlocklet.verify.exists")}),(0,R.jsxs)(z.Z,{component:"div",sx:{marginTop:"32px"},children:[u.accessUrl&&(0,R.jsx)(B.Z,{variant:"contained",component:Se.Z,href:u.accessUrl,sx:{width:"160px",height:"100%"},children:n("blocklet.restoreBlocklet.verify.open")}),(0,R.jsx)(B.Z,{variant:"contained",color:"error",onClick:()=>{h({isConfirmOpen:!0})},sx:{width:"160px",height:"100%",marginLeft:"32px"},children:n("blocklet.restoreBlocklet.verify.overwrite")})]})]}),!u.exists&&(0,R.jsx)(B.Z,{variant:"contained",disabled:u.isConnectOpen,onClick:P,sx:{width:"180px",height:"100%"},children:n("blocklet.restoreBlocklet.verify.".concat(u.shouldReconnect?"reconnect":"verify"))})]}),u.connectData.isConnectOpen&&(0,R.jsx)(De.Z,{appDid:j,visible:!1}),(0,R.jsx)(Ze.Z,{popup:!0,open:u.isConnectOpen,forceConnected:!1,saveConnect:!1,action:u.connectData.action,checkFn:r.get,checkTimeout:3e5,webWalletUrl:(0,se.yP)(a),onSuccess:C,extraParams:u.connectData.extraParams,messages:u.connectMessages,onClose:()=>{h({isConnectOpen:!1})}}),u.isConfirmOpen&&(0,R.jsx)(Pe.Z,{color:"error",title:n("blocklet.restoreBlocklet.overwrite.title"),description:n("blocklet.restoreBlocklet.overwrite.description"),confirm:n("common.confirm"),onCancel:()=>{h({isConfirmOpen:!1})},onConfirm:()=>{h({isConfirmOpen:!1,isOverwrite:!0}),P(!0)}})]})};var Qe,Ue=n(55309);const Oe=(0,h.Z)(Ue.Z)(Qe||(Qe=(0,a.Z)(["\n && .result-footer {\n height: 120px;\n > div {\n flex-wrap: wrap;\n }\n }\n"])));var Ge,Ie,Je,ze=n(35266),He=n(77277),Xe=n(77429),Ke=n(75506),Ye=n.n(Ke),We=n(50482),_e=n.n(We),Ve=n(11397),qe=n.n(Ve),$e=n(11476),et=n(34937),tt=n(66436);const nt=qe()("@abtnode/webapp:restore-blocklet:step-install"),ot=(0,h.Z)("div")(Ge||(Ge=(0,a.Z)(["\n display: flex;\n align-items: center;\n justify-content: flex-start;\n flex-direction: column;\n width: 100%;\n height: 100%;\n overflow-y: auto;\n"]))),at=h.Z.div(Ie||(Ie=(0,a.Z)(["\n line-height: 1.4em;\n .error-desc {\n margin-top: 8px;\n word-wrap: break-word;\n color: ",";\n }\n"])),(e=>e.theme.palette.grey[500])),st={[He.RESTORE_PROGRESS_STATUS.waiting]:0,[He.RESTORE_PROGRESS_STATUS.start]:1,[He.RESTORE_PROGRESS_STATUS.importData]:2,[He.RESTORE_PROGRESS_STATUS.downloading]:3,[He.RESTORE_PROGRESS_STATUS.importDataSuccess]:4,[He.RESTORE_PROGRESS_STATUS.installing]:5,[He.RESTORE_PROGRESS_STATUS.completed]:10};const rt=(0,h.Z)(E.Z)(Je||(Je=(0,a.Z)(["\n padding-top: 24px;\n"]))),it=function(){var e,t,n,o;const a=new URL(window.location.href),r=a.searchParams.get("appDid"),i=a.searchParams.get("launchType"),l=a.searchParams.get("nftId"),c=a.searchParams.get("fromLauncher"),d=a.searchParams.get("from"),p=a.searchParams.get("chainHost"),u=function(e){let{appDid:t}=e;const[n,o]=(0,s.useState)(He.RESTORE_PROGRESS_STATUS.waiting),a=(0,et.ZP)();return a.connect(),(0,s.useEffect)((()=>(a.on(He.BlockletEvents.restoreProgress,(e=>{t===(null===e||void 0===e?void 0:e.appDid)&&o(e)})),()=>{a.off(He.BlockletEvents.restoreProgress)})),[t,a]),n}({appDid:r}),[h,f]=(0,s.useState)(0),x=(0,s.useRef)(null),{meta:g}=(0,Re.J_)(),{t:v}=(0,m.PE)(),{api:k,info:w}=(0,A.h6)(),[b,j]=(0,Be.Z)({nextAccessUrl:"",installError:null}),E=(0,$e.Z)(r),{status:S,eventName:C}=E,P=()=>{f(12),x.current&&(clearTimeout(x.current),x.current=null),x.current=setTimeout((()=>{k.getBlocklet({input:{did:r,attachRuntimeInfo:!0}}).then((e=>{e.blocklet&&M(e.blocklet)}))}),500)},T=()=>{var e,t;null!==E&&void 0!==E&&null!==(e=E.runtimeBlocklet)&&void 0!==e&&null!==(t=e.settings)&&void 0!==t&&t.initialized?f(11):P()},D=[v("blocklet.restoreFromSpaces.progress.waiting"),v("blocklet.restoreFromSpaces.progress.restoring"),v("blocklet.restoreFromSpaces.progress.importData"),v("blocklet.restoreFromSpaces.progress.downloading",{progress:"".concat(null!==(e=null===u||void 0===u||null===(t=u.data)||void 0===t?void 0:t.completed)&&void 0!==e?e:100,"/").concat(null!==(n=null===u||void 0===u||null===(o=u.data)||void 0===o?void 0:o.total)&&void 0!==n?n:100)}),v("blocklet.restoreFromSpaces.progress.importSuccess"),v("launchBlocklet.waiting.downloading"),v("launchBlocklet.waiting.verifying"),v("launchBlocklet.waiting.downloading"),v("launchBlocklet.waiting.extracting"),v("upgrading"===S?"common.upgrading":"launchBlocklet.waiting.installing"),v("launchBlocklet.waiting.installed"),v("launchBlocklet.waiting.starting"),v("launchBlocklet.waiting.done")];(0,s.useEffect)((()=>{if(u.status===He.RESTORE_PROGRESS_STATUS.error){const e={message:u.message,name:"restoreFailed",action:"retryRestore"};return _e()(e,b.installError)||V.Z.error($()(e)),void j({installError:e})}f(st[u.status]||0)}),[u.status]),(0,s.useEffect)((()=>{if("serverless"!==i||C!==He.BlockletEvents.nftConsumed)switch(S){case"waiting":f(6);break;case"downloading":f(7);break;case"installing":case"upgrading":f(8);break;case"installed":if("serverless"===i&&!(0,Me.MZ)(E))break;T();break;case"starting":f(11);break;case"running":f(12),P();break;case"stopped":P();break;case"corrupted":case"error":{var e;null===E||void 0===E||E.stopPolling();const t={message:null===E||void 0===E||null===(e=E.error)||void 0===e?void 0:e.message,name:null===E||void 0===E?void 0:E.eventName,action:"retryRestore"},n=function(){var e;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!_e()(t,b.installError)&&null!==E&&void 0!==E&&null!==(e=E.error)&&void 0!==e&&e.message&&V.Z.error($()(E.error)),j({installError:t,...n})};k.getBlocklet({input:{did:r,attachRuntimeInfo:!0}}).then((e=>{var o;let{blocklet:a}=e;null!==a&&void 0!==a&&null!==(o=a.settings)&&void 0!==o&&o.initialized&&(t.action="retryStart"),n()})).catch((()=>{n()}))}}else T()}),[S,C,E]);const M=async e=>{const t=await(0,Me.DB)(e);if(Ye()(t))return;const n=new URL(t);n.searchParams.set("serverUrl",(0,y.RU)(w)),"running"!==e.status&&n.searchParams.set("__start__","1"),c&&n.searchParams.set("fromLauncher",c),d&&n.searchParams.set("from",d),i&&n.searchParams.set("launchType",i),l&&n.searchParams.set("nftId",l),p&&n.searchParams.set("chainHost",p),null===E||void 0===E||E.stopPolling(),j({nextAccessUrl:n.href,status:e.status,resultMessage:"running"===e.status?{variant:"success",title:v("blocklet.restoreFromSpaces.restore.completeTitle"),subTitle:"",footer:v("common.open")}:{variant:"info",title:v("blocklet.restoreFromSpaces.restore.installedTitle"),subTitle:v("blocklet.restoreFromSpaces.restore.installedSubTitle"),footer:v("common.configuration")}})};if(b.installError){const e={retryRestore:(0,R.jsx)(B.Z,{variant:"contained",className:"bottom-button","data-cy":"retry-install",component:je.Link,to:"/blocklets/restore/verify-ownership".concat(window.location.search),children:v("common.retry")}),retryStart:(0,R.jsx)(B.Z,{variant:"contained",className:"bottom-button","data-cy":"retry-start",onClick:()=>(async()=>{j({installError:null,nextAccessUrl:""}),await k.startBlocklet({input:{did:r}}),null===E||void 0===E||E.startPolling()})(),children:v("common.retry")})},t=b.installError.name?b.installError.name.replace("blocklet.",""):"installFailed";return(0,R.jsx)(Oe,{variant:"error",title:null===g||void 0===g?void 0:g.title,subTitle:(0,R.jsxs)(at,{children:[(0,R.jsx)("div",{children:v("launchBlocklet.error.".concat(t))}),b.installError.message&&(0,R.jsx)("div",{className:"error-desc",children:v("common.errorMessage")+b.installError.message})]}),footer:(0,R.jsxs)(rt,{children:[e[b.installError.action],"serverless"===i&&(0,R.jsx)("div",{style:{marginTop:"24px"},dangerouslySetInnerHTML:{__html:v("blocklet.restoreFromSpaces.restore.support",{communityLink:"https://community.arcblock.io/",supportEmail:"launcher@arcblock.io"})}})]})})}const L=!!b.nextAccessUrl;return nt("render",{status:S,eventName:C,launchType:i,runtimeBlockletState:E,state:b}),(0,R.jsxs)(ot,{children:[!L&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Z.Z,{title:v("blocklet.restoreBlocklet.restore.title"),subTitle:v("blocklet.restoreFromSpaces.restore.subTitle")}),(0,R.jsxs)(tt.Z,{children:[(0,R.jsx)(ze.Z,{increaseSpeed:.3,messageLoop:!1,message:(0,R.jsx)(Xe.Z,{steps:D,stepIndex:h,autoGrowth:10===h?1e3:4e3})}),[5,7,8].includes(h)&&(0,R.jsx)(De.Z,{appDid:r})]})]}),L&&(0,R.jsx)(Oe,{variant:b.resultMessage.variant,title:b.resultMessage.title,subTitle:b.resultMessage.subTitle,footer:(0,R.jsx)(rt,{children:(0,R.jsx)(B.Z,{variant:"contained",style:{width:"200px"},component:Se.Z,href:b.nextAccessUrl,children:b.resultMessage.footer})})})]})};const lt=function(){return(0,R.jsx)(it,{})};var ct,dt,pt,ut=n(23484);function ht(){const e=(0,u.Z)((e=>e.breakpoints.down("md"))),{t:t,locale:n}=(0,m.PE)(),{info:o}=(0,A.h6)(),a=(0,ut.Z)(),{meta:r}=(0,Re.J_)(),c=(0,s.useMemo)((()=>o?(0,y.RU)(o):""),[o]),h=(0,b.yP)(o),Z=d()((0,b.Y5)(),"/blocklets/restore"),E=[{key:"verify-ownership",name:t("blocklet.restoreBlocklet.verify.title"),path:d()(Z,"verify-ownership")},{key:"restore-blocklet",name:t("blocklet.restoreFromSpaces.restore.title"),path:d()(Z,"restore-blocklet")}];let S=[];S="launcher"===i()(a.get("from"))?[{key:"purchase-space",name:t("launchBlocklet.steps.purchaseSpace")},{key:"prepare-space",name:t("launchBlocklet.steps.prepareSpace")},...E]:[{key:"connect-space",name:t("blocklet.restoreFromSpaces.connect.title"),path:d()(Z,"connect-space")},{key:"select-blocklet",name:t("blocklet.restoreFromSpaces.selectBlocklet.title")},...E];const C=(0,R.jsx)(xt,{className:"".concat(c?"logo-can-click":""),children:(0,R.jsx)(w.Z,{onClick:()=>{c&&window.open(c)},logo:e?(0,R.jsx)(v.Z,{width:"32",height:"32"}):(0,R.jsx)(k.Z,{width:"128",height:"48"})})});return(0,R.jsx)(x.W,{steps:S,children:(0,R.jsx)(f.Z,{blockletMeta:r,locale:n,useOfSkeleton:!1,navLogo:C,navSubTitle:t("blocklet.restoreFromSpaces.navSubTitle"),loading:!1,headerEndAddons:(0,R.jsx)(g.Z,{webWalletUrl:h,SessionContext:j.B3}),pcWidth:"80%",style:{height:"100%"},logoUrl:null===r||void 0===r?void 0:r.logo,children:(0,R.jsxs)(ft,{children:[(0,R.jsx)(p.Global,{styles:mt}),(0,R.jsxs)(l.Routes,{children:[(0,R.jsx)(l.Route,{path:"connect-space",element:(0,R.jsx)(ye,{})}),(0,R.jsx)(l.Route,{path:"verify-ownership",element:(0,R.jsx)(Fe,{})}),(0,R.jsx)(l.Route,{path:"restore-blocklet",element:(0,R.jsx)(lt,{})}),(0,R.jsx)(l.Route,{path:"*",element:(0,R.jsx)(l.Navigate,{to:"connect-space",replace:!0})})]})]})})})}const mt=(0,p.css)(ct||(ct=(0,a.Z)(["\n html,\n body,\n #root,\n #root > .wrapper {\n height: 100%;\n }\n"]))),ft=h.Z.div(dt||(dt=(0,a.Z)(["\n "," {\n padding-top: 34px;\n }\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n\n .bottom-button {\n min-width: 200px;\n }\n"])),(e=>e.theme.breakpoints.up("md"))),xt=h.Z.div(pt||(pt=(0,a.Z)(["\n margin-top: -1px;\n &.logo-can-click {\n cursor: pointer;\n }\n"])));var gt,vt,kt,wt=n(83294),yt=n(72333),bt=n(25710);function jt(e){let{onSelect:t}=e;const{api:n}=(0,A.h6)(),{t:o,locale:a}=(0,m.PE)(),[r,i]=(0,s.useState)(!1),[c,d]=(0,s.useState)([]),[p,u]=(0,s.useState)(""),[h,f]=(0,s.useState)(null),x=(0,l.useNavigate)();(0,s.useEffect)((()=>{(async()=>{try{i(!0),f(!1);const{getBlocklets:{blocklets:e},getBlockletsFromBackup:{backups:t}}=await n.doBatchQuery({getBlocklets:{input:{}},getBlockletsFromBackup:{input:{}}});d((t||[]).filter((t=>!(e||[]).some((e=>{var n;return t.appPid===(null===(n=e.meta)||void 0===n?void 0:n.did)})))).sort(((e,t)=>t.createdAt-e.createdAt)).slice(0,200)),i(!1)}catch(e){i(!1),f(e.message)}})()}),[]);let g=null;return g=h?(0,R.jsx)(he.Z,{type:"error",style:{width:"100%",marginTop:8},children:h}):r?(0,R.jsx)(de.Z,{size:16}):c.length?(0,R.jsx)(Zt,{children:c.map((e=>(0,R.jsxs)(Et,{className:"middle-font-size space ".concat(p===e.appDid?"selected":""),onClick:()=>(e=>{u(e.appDid)})(e),children:[(0,R.jsxs)("div",{className:"left",children:[(0,R.jsx)("div",{className:"header",children:(0,R.jsx)(E.Z,{sx:{width:40,height:40},children:(0,R.jsx)(yt.Z,{did:e.appDid,size:40})})}),(0,R.jsxs)("div",{className:"body",children:[(0,R.jsx)(z.Z,{className:"text",children:e.name}),(0,R.jsx)(z.Z,{className:"text middle-font-size",children:(0,R.jsx)(Ee.Z,{responsive:!1,compact:!0,inline:!0,copyable:!1,size:12,did:e.appDid})})]}),(0,R.jsxs)(E.Z,{color:"text.secondary",className:"footer small-font-size",children:[o("blocklet.restoreFromServer.backupIn")," ",(0,b.B2)(e.createdAt,a)]})]}),(0,R.jsx)("div",{className:"right",children:(0,R.jsx)("div",{className:"more",children:(0,R.jsx)(K.Z,{onClick:()=>{},className:"more-btn",size:"large","aria-label":"more functions",children:(0,R.jsx)(wt.Z,{color:"disabled"})})})}),(0,R.jsx)("div",{className:"selected-container",children:(0,R.jsx)(T.default,{className:"selected-icon"})})]},e.appDid)))}):(0,R.jsx)(bt.Z,{children:o("common.empty")}),(0,R.jsxs)(At,{style:{width:"100%"},children:[(0,R.jsx)(Z.Z,{title:o("blocklet.restoreFromServer.selectTitle"),subTitle:o("blocklet.restoreFromServer.description")}),(0,R.jsx)(E.Z,{mt:4,mx:3,className:"main-body",children:g}),(0,R.jsx)(E.Z,{className:"main-footer",display:"flex",justifyContent:"center",children:(0,R.jsx)(B.Z,{sx:{width:"180px",height:"100%"},onClick:e=>{e.stopPropagation(),(()=>{const e=c.find((e=>e.appDid===p));t({did:e.appDid,name:e.appDid,title:e.name});const n=new URL(window.location.href);n.searchParams.set("appDid",e.appDid),n.searchParams.set("appName",e.name),x("/blocklets/restore/verify-ownership".concat(n.search))})()},color:"primary","data-cy":"install-blocklet-next-step",variant:"contained",disabled:r||h||!p,children:o("common.restore")})})]})}jt.defaultProps={onSelect:()=>{}};const At=(0,h.Z)(E.Z)(gt||(gt=(0,a.Z)(["\n .main-body {\n height: 50vh;\n "," {\n height: 80vh;\n }\n\n overflow: auto;\n }\n .main-footer {\n padding-top: 24px;\n padding-bottom: 24px;\n "," {\n position: fixed;\n bottom: 16px;\n width: 100%;\n padding-bottom: 0;\n }\n }\n"])),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.breakpoints.down("md"))),Zt=(0,h.Z)(E.Z)(vt||(vt=(0,a.Z)(["\n display: block;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n max-width: 1000px;\n margin: 0 auto;\n\n .space {\n display: flex;\n margin: 8px auto;\n\n .selected-container {\n position: absolute;\n right: 0px;\n bottom: 0px;\n display: flex;\n -webkit-box-pack: end;\n justify-content: flex-end;\n align-items: flex-end;\n width: 30px;\n height: 30px;\n border-radius: 0px 0px 7px;\n color: rgb(255, 255, 255);\n overflow: hidden;\n transition: all 0.3s ease 0s;\n\n &::after {\n position: absolute;\n z-index: 0;\n left: 30px;\n top: 30px;\n display: block;\n width: 0px;\n height: 0px;\n border-width: 15px;\n border-style: solid;\n /* border-color: transparent rgb(29, 193, 199) rgb(29, 193, 199) transparent; */\n border-color: transparent ","\n "," transparent;\n transition: all 0.1s ease 0s;\n content: '';\n }\n\n .selected-icon {\n visibility: hidden;\n width: 60%;\n height: 60%;\n position: relative;\n z-index: 2;\n margin: 0px 1px 1px 0px;\n font-size: 16px;\n transition: all 0.2s ease 0s;\n }\n }\n }\n\n .space.selected {\n background-color: rgb(236, 251, 253);\n border-color: rgb(236, 251, 253);\n\n .selected-container {\n &::after {\n left: 0px;\n top: 0px;\n }\n\n .selected-icon {\n visibility: visible;\n }\n }\n }\n"])),(e=>e.theme.palette.primary.main),(e=>e.theme.palette.primary.main)),Et=(0,h.Z)("div")(kt||(kt=(0,a.Z)(["\n display: flex;\n position: relative;\n width: 100%;\n padding: 10px;\n border: 1 solid #ccc;\n cursor: pointer;\n\n .left {\n display: flex;\n align-items: flex-start;\n width: 100%;\n margin: 0px 20px 0px 0px;\n\n .header {\n padding: 5px 16px 0 0;\n }\n\n .body {\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n\n .footer {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n height: 100%;\n }\n }\n\n .right {\n display: flex;\n }\n\n "," {\n .left {\n display: flex;\n flex-direction: column;\n margin-right: 20px;\n\n .header {\n display: none;\n }\n\n .footer {\n margin-top: 6px;\n margin-left: 0px;\n padding: 2px 0px;\n height: auto;\n }\n }\n\n .right {\n width: auto;\n }\n\n .text {\n display: -webkit-box;\n overflow: hidden;\n -webkit-box-orient: vertical;\n }\n }\n\n // \u516c\u5171\u5c5e\u6027\n .middle-font-size {\n font-size: 14px;\n }\n\n .small-font-size {\n font-size: 12px;\n }\n"])),(e=>e.theme.breakpoints.down("md")));var St,Ct=n(95712);const Pt=(0,h.Z)("div")(St||(St=(0,a.Z)(["\n width: 100%;\n height: 100%;\n overflow-y: auto;\n"]))),Bt="verify-app-ownership-disk";const Tt=function(){const e=new URL(window.location.href),t=e.searchParams.get("appDid"),n=e.searchParams.get("appName"),{t:o}=(0,m.PE)(),{api:a,info:r}=(0,A.h6)(),{session:i,api:l}=(0,Ae.T)(),c=(0,s.useMemo)((()=>r?(0,y.RU)(r):""),[r]),[p,u]=(0,Be.Z)({isRestoring:!1,isComplete:!1,connectData:{isConnectOpen:!1,action:"",checkFn:()=>{},extraParams:{}}}),h=()=>{u({connectData:{isConnectOpen:!1}}),setTimeout((()=>{const e=new URL(d()(c,"blocklets/restore/restore-blocklet".concat(window.location.search)));window.location.href=e.href}),0)},f=async()=>{if(i.user)await(async()=>{if((await a.getBlocklet({input:{did:t}})).blocklet)return V.Z.error("Blocklet ".concat(n,"(").concat(t,") already exists")),void u({shouldReconnect:!0});u({connectData:{isConnectOpen:!0,action:Bt,extraParams:{appDid:t,restoreFrom:"disk"}}})})();else{var e,o,s;const n=new URL(window.location.href);n.pathname=d()(null!==(e=null===(o=window)||void 0===o||null===(s=o.env)||void 0===s?void 0:s.apiPrefix)&&void 0!==e?e:"/","/api/did/".concat(Bt,"/token")),n.searchParams.set("appDid",t),n.searchParams.set("restoreFrom","disk");const{data:a}=await l.get(n.href);i.login(h,{nw:a.url,openMode:"popup"})}};return(0,s.useEffect)((()=>{f()}),[]),(0,R.jsxs)(Pt,{children:[(0,R.jsx)(Z.Z,{title:o("blocklet.restoreBlocklet.verify.title"),subTitle:o("blocklet.restoreBlocklet.verify.subTitle")}),(0,R.jsxs)(E.Z,{textAlign:"center",mt:6,children:[(0,R.jsx)(Ct.Z,{did:t,size:128}),(0,R.jsxs)(E.Z,{mt:2,mb:2,children:[(0,R.jsx)(z.Z,{variant:"body2",children:n}),(0,R.jsx)(Ee.Z,{did:t})]}),(0,R.jsx)(B.Z,{variant:"contained",disabled:p.connectData.isConnectOpen,onClick:f,sx:{width:"180px",height:"100%"},children:o("blocklet.restoreBlocklet.verify.".concat(p.shouldReconnect?"reconnect":"verify"))})]}),p.connectData.isConnectOpen&&(0,R.jsx)(De.Z,{appDid:t,visible:!1}),(0,R.jsx)(Ze.Z,{popup:!0,open:p.connectData.isConnectOpen,forceConnected:!1,saveConnect:!1,action:p.connectData.action,checkFn:l.get,checkTimeout:3e5,webWalletUrl:(0,se.yP)(r),onSuccess:h,extraParams:p.connectData.extraParams,messages:{title:o("blocklet.restoreBlocklet.verify.title"),scan:o("blocklet.restoreBlocklet.verify.scan"),confirm:o("blocklet.restoreBlocklet.verify.confirm"),success:o("blocklet.restoreBlocklet.verify.success")},onClose:()=>{u({connectData:{isConnectOpen:!1}})}})]})};var Dt,Rt,Mt;function Lt(){const e=(0,u.Z)((e=>e.breakpoints.down("md"))),{t:t,locale:n}=(0,m.PE)(),{info:o}=(0,A.h6)(),{meta:a,setMeta:r}=(0,s.useState)({}),i=(0,s.useMemo)((()=>o?(0,y.RU)(o):""),[o]),c=(0,b.yP)(o),h=d()((0,b.Y5)(),"/blocklets/restore"),Z=[{key:"select",name:t("blocklet.restoreFromServer.selectTitle"),path:d()(h,"select")},{key:"verify-ownership",name:t("blocklet.restoreBlocklet.verify.title"),path:d()(h,"verify-ownership")},{key:"restore-blocklet",name:t("blocklet.restoreBlocklet.restore.title"),path:d()(h,"restore-blocklet")}],E=(0,R.jsx)(Qt,{className:"".concat(i?"logo-can-click":""),children:(0,R.jsx)(w.Z,{onClick:()=>{i&&window.open(i)},logo:e?(0,R.jsx)(v.Z,{width:"32",height:"32"}):(0,R.jsx)(k.Z,{width:"128",height:"48"})})});return(0,R.jsx)(x.W,{steps:Z,children:(0,R.jsx)(f.Z,{blockletMeta:{...a,registryUrl:""},locale:n,useOfSkeleton:!1,navLogo:E,headerEndAddons:(0,R.jsx)(g.Z,{webWalletUrl:c,SessionContext:j.B3}),pcWidth:"80%",style:{height:"100%"},logoUrl:null===a||void 0===a?void 0:a.logo,children:(0,R.jsxs)(Ft,{children:[(0,R.jsx)(p.Global,{styles:Nt}),(0,R.jsxs)(l.Routes,{children:[(0,R.jsx)(l.Route,{path:"select",element:(0,R.jsx)(jt,{onSelect:r})}),(0,R.jsx)(l.Route,{path:"verify-ownership",element:(0,R.jsx)(Tt,{})}),(0,R.jsx)(l.Route,{path:"restore-blocklet",element:(0,R.jsx)(lt,{})}),(0,R.jsx)(l.Route,{path:"*",element:(0,R.jsx)(l.Navigate,{to:"select".concat(window.location.search),replace:!0})})]})]})})})}const Nt=(0,p.css)(Dt||(Dt=(0,a.Z)(["\n html,\n body,\n #root,\n #root > .wrapper {\n height: 100%;\n }\n"]))),Ft=h.Z.div(Rt||(Rt=(0,a.Z)(["\n "," {\n padding-top: 34px;\n }\n width: 100%;\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n\n .bottom-button {\n min-width: 200px;\n }\n"])),(e=>e.theme.breakpoints.up("md"))),Qt=h.Z.div(Mt||(Mt=(0,a.Z)(["\n margin-top: -1px;\n &.logo-can-click {\n cursor: pointer;\n }\n"])));function Ut(){const{search:e}=window.location;return e.includes("restoreFrom=server")?(0,R.jsx)(Lt,{}):(0,R.jsx)(ht,{})}},99641:(e,t,n)=>{n.d(t,{Z:()=>d});var o,a,s=n(71171),r=n(55898),i=n.n(r),l=n(33518),c=n(96266);function d(e){let{logo:t,name:n,subname:o,previousData:a,...s}=e,r=(0,c.jsx)(p,{logo:t}),i=n,l=o;return a.logo&&(r=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(p,{logo:t,className:"left-fade-in-ele"}),(0,c.jsx)(p,{logo:a.logo,className:"postion-abs left-fade-out-ele"})]})),a.name&&a.name!==n&&(i=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("span",{className:"right-fade-in-ele",style:{display:"inline-block"},children:n}),(0,c.jsx)("span",{className:"postion-abs right-fade-out-ele",children:a.name})]})),a.subname&&a.subname!==o&&(l=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("span",{className:"right-fade-in-ele",style:{display:"inline-block"},children:o}),(0,c.jsx)("span",{className:"postion-abs right-fade-out-ele",children:a.subname})]})),(0,c.jsx)(h,{...s,children:(0,c.jsxs)("div",{className:"logo-inner",children:[(0,c.jsx)("div",{className:"logo-img-content",children:r}),(0,c.jsxs)("div",{className:"logo-info ".concat(n||o?"":"zero-left"),children:[(0,c.jsx)("div",{className:"logo-name",children:i}),(0,c.jsx)("div",{className:"logo-subname",children:l})]})]})})}function p(e){let{logo:t,...n}=e;return(0,c.jsx)(u,{...n,children:t})}d.propTypes={logo:i().element.isRequired,name:i().string,subname:i().string,previousData:i().object},d.defaultProps={name:"",subname:"",previousData:{logo:"",name:"",subname:""}};const u=l.Z.div(o||(o=(0,s.Z)(["\n display: block;\n > * {\n display: block;\n }\n"]))),h=l.Z.div(a||(a=(0,s.Z)(["\n position: relative;\n display: block;\n\n .logo-inner {\n display: flex;\n align-items: center;\n height: 100%;\n .logo-img-content {\n position: relative;\n display: block;\n }\n .logo-info {\n display: flex;\n flex-direction: column;\n justify-content: center;\n margin-left: 10px;\n letter-spacing: 0.1px;\n &.zero-left {\n margin-left: 0%;\n }\n .logo-name {\n position: relative;\n line-height: 16px;\n font-size: 16px;\n color: #121319;\n }\n .logo-subname {\n position: relative;\n line-height: 13px;\n font-size: 13px;\n color: #7d8085;\n }\n }\n }\n\n .postion-abs {\n position: absolute;\n left: 0;\n top: 0;\n height: 100%;\n }\n\n .right-fade-out-ele {\n animation: right-fade-out ease 0.5s;\n animation-delay: 2s;\n animation-fill-mode: forwards;\n }\n\n .right-fade-in-ele {\n animation: right-fade-in ease 0.5s;\n animation-delay: 2s;\n animation-fill-mode: both;\n }\n\n @keyframes right-fade-out {\n 0% {\n opacity: 1;\n transform: translate(0, 0);\n }\n 100% {\n opacity: 0;\n transform: translate(8px, 0);\n }\n }\n\n @keyframes right-fade-in {\n 0% {\n opacity: 0;\n transform: translate(8px, 0);\n }\n 100% {\n opacity: 1;\n transform: translate(0, 0);\n }\n }\n\n .left-fade-out-ele {\n animation: left-fade-out ease 0.5s;\n animation-delay: 2s;\n animation-fill-mode: forwards;\n }\n\n .left-fade-in-ele {\n animation: left-fade-in ease 0.5s;\n animation-delay: 2s;\n animation-fill-mode: both;\n }\n\n @keyframes left-fade-out {\n 0% {\n opacity: 1;\n transform: translate(0, 0);\n }\n 100% {\n opacity: 0;\n transform: translate(-8px, 0);\n }\n }\n\n @keyframes left-fade-in {\n 0% {\n opacity: 0;\n transform: translate(-8px, 0);\n }\n 100% {\n opacity: 1;\n transform: translate(0, 0);\n }\n }\n"])))},60344:(e,t,n)=>{n.d(t,{hi:()=>s,od:()=>a.a});var o=n(10458),a=n.n(o);a().defaults.timeout=1e4;const s=a().create()},84584:(e,t,n)=>{n.d(t,{EJ:()=>v,Jf:()=>g,LQ:()=>p,Nb:()=>u,UV:()=>k,Xv:()=>c,Z3:()=>w,ag:()=>m,mo:()=>h,nD:()=>d,nU:()=>x,w2:()=>f});var o=n(82434),a=n.n(o),s=n(77277),r=n(65873),i=n(2842),l=n(60344);function c(e){const t=e.replace(/\/api\/space\/.+/,""),n=e.replace(/\/$/,"").split("/"),o=n.at(-4),a=n.at(-2);return(0,i.xn)(t,"space",o,"apps",a,"explorer?key=/apps/".concat(a,"/.did-objects/").concat(a,"/"))}function d(e){const t=e.replace(/\/api\/space\/.+/,""),n=e.replace(/\/$/,"").split("/").at(-4);return(0,i.xn)(t,"space",n)}function p(e){return e.replace(/\/$/,"").split("/").at(-4)}async function u(e){try{if(!a()(e))return!1;const{headers:t}=await l.hi.head(e,{timeout:5e3});return"true"===t["x-listable"]&&"true"===t["x-readable"]&&"true"===t["x-writeable"]}catch(t){return console.error(t),!1}}function h(e){var t;return(null===e||void 0===e||null===(t=e.find((e=>e.key===s.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT)))||void 0===t?void 0:t.value)||""}function m(e){const t=new URL(e);return(0,i.xn)(t.origin,t.pathname)}async function f(e){try{if(!a()(e))return!1;const t=m(e),n=(0,i.xn)(t,"space/api/did/one-click-authorization/token"),{status:o,data:s}=await l.hi.get(n,{timeout:5e3});return 200===o&&(0,r.isObject)(s)}catch(t){return console.error(t),!1}}async function x(e){let{timeout:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{timeout:3e3};try{if(!a()(e))return"";const{headers:n}=await l.hi.head(e,{timeout:t}),o=n["x-space-name"];return o?decodeURIComponent(o):""}catch(n){return console.error(n),""}}function g(e){const t=e.replace(/\/api\/space\/.+/,""),n=e.replace(/\/$/,"").split("/").at(-4);return(0,i.xn)(t,"/api/space/nft/display?spaceDid=".concat(n))}const v=e=>{var t,n;return(null===e||void 0===e||null===(t=e.configs)||void 0===t||null===(n=t.find((e=>e.key===s.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT)))||void 0===n?void 0:n.value)||null};async function k(e){const t={};return t.did=p(e),t.name=await x(e),t.url=function(e){return null===e||void 0===e?void 0:e.replace(/\/api\/space\/.+/,"")}(e),t.endpoint=e,t}async function w(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{timeout:3e4,withSearchParams:!0};if(!(0,r.isString)(e))throw new Error("url(".concat(e,") must be a string"));const o=e.startsWith("http")?e:"https://".concat(e),a=new URL(o),{data:s}=await l.hi.get((0,i.xn)(a.origin,"/__blocklet__.js?type=json"),{timeout:n.timeout}),c=null===(t=s.componentMountPoints.findLast((e=>"z8iZnaYxnkMD5AKRjTKiCb8pQr1ut8UantAcf"===e.did)))||void 0===t?void 0:t.mountPoint;if(!c)throw new Error("MountPoint(".concat(c,") not found"));const d=(0,i.xn)(a.origin,c);return n.withSearchParams&&a.searchParams.get("spaceDid")?(0,i.xn)(d,"?spaceDid=".concat(a.searchParams.get("spaceDid"))):d}}}]);
|