@ethersphere/bee-dashboard 0.5.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +0,0 @@
1
- (this["webpackJsonp@ethersphere/bee-dashboard"]=this["webpackJsonp@ethersphere/bee-dashboard"]||[]).push([[3],{644:function(e,t,n){"use strict";n.r(t),n.d(t,"getCLS",(function(){return m})),n.d(t,"getFCP",(function(){return g})),n.d(t,"getFID",(function(){return F})),n.d(t,"getLCP",(function(){return k})),n.d(t,"getTTFB",(function(){return C}));var i,a,r,o,c=function(e,t){return{name:e,value:void 0===t?-1:t,delta:0,entries:[],id:"v1-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12)}},u=function(e,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver((function(e){return e.getEntries().map(t)}));return n.observe({type:e,buffered:!0}),n}}catch(e){}},s=function(e,t){var n=function n(i){"pagehide"!==i.type&&"hidden"!==document.visibilityState||(e(i),t&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)},f=function(e){addEventListener("pageshow",(function(t){t.persisted&&e(t)}),!0)},d="function"==typeof WeakSet?new WeakSet:new Set,p=function(e,t,n){var i;return function(){t.value>=0&&(n||d.has(t)||"hidden"===document.visibilityState)&&(t.delta=t.value-(i||0),(t.delta||void 0===i)&&(i=t.value,e(t)))}},m=function(e,t){var n,i=c("CLS",0),a=function(e){e.hadRecentInput||(i.value+=e.value,i.entries.push(e),n())},r=u("layout-shift",a);r&&(n=p(e,i,t),s((function(){r.takeRecords().map(a),n()})),f((function(){i=c("CLS",0),n=p(e,i,t)})))},v=-1,l=function(){return"hidden"===document.visibilityState?0:1/0},h=function(){s((function(e){var t=e.timeStamp;v=t}),!0)},S=function(){return v<0&&(v=l(),h(),f((function(){setTimeout((function(){v=l(),h()}),0)}))),{get timeStamp(){return v}}},g=function(e,t){var n,i=S(),a=c("FCP"),r=u("paint",(function(e){"first-contentful-paint"===e.name&&(r&&r.disconnect(),e.startTime<i.timeStamp&&(a.value=e.startTime,a.entries.push(e),d.add(a),n()))}));r&&(n=p(e,a,t),f((function(i){a=c("FCP"),n=p(e,a,t),requestAnimationFrame((function(){requestAnimationFrame((function(){a.value=performance.now()-i.timeStamp,d.add(a),n()}))}))})))},y={passive:!0,capture:!0},w=new Date,E=function(e,t){i||(i=t,a=e,r=new Date,T(removeEventListener),L())},L=function(){if(a>=0&&a<r-w){var e={entryType:"first-input",name:i.type,target:i.target,cancelable:i.cancelable,startTime:i.timeStamp,processingStart:i.timeStamp+a};o.forEach((function(t){t(e)})),o=[]}},b=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){E(e,t),a()},i=function(){a()},a=function(){removeEventListener("pointerup",n,y),removeEventListener("pointercancel",i,y)};addEventListener("pointerup",n,y),addEventListener("pointercancel",i,y)}(t,e):E(t,e)}},T=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,b,y)}))},F=function(e,t){var n,r=S(),m=c("FID"),v=function(e){e.startTime<r.timeStamp&&(m.value=e.processingStart-e.startTime,m.entries.push(e),d.add(m),n())},l=u("first-input",v);n=p(e,m,t),l&&s((function(){l.takeRecords().map(v),l.disconnect()}),!0),l&&f((function(){var r;m=c("FID"),n=p(e,m,t),o=[],a=-1,i=null,T(addEventListener),r=v,o.push(r),L()}))},k=function(e,t){var n,i=S(),a=c("LCP"),r=function(e){var t=e.startTime;t<i.timeStamp&&(a.value=t,a.entries.push(e)),n()},o=u("largest-contentful-paint",r);if(o){n=p(e,a,t);var m=function(){d.has(a)||(o.takeRecords().map(r),o.disconnect(),d.add(a),n())};["keydown","click"].forEach((function(e){addEventListener(e,m,{once:!0,capture:!0})})),s(m,!0),f((function(i){a=c("LCP"),n=p(e,a,t),requestAnimationFrame((function(){requestAnimationFrame((function(){a.value=performance.now()-i.timeStamp,d.add(a),n()}))}))}))}},C=function(e){var t,n=c("TTFB");t=function(){try{var t=performance.getEntriesByType("navigation")[0]||function(){var e=performance.timing,t={entryType:"navigation",startTime:0};for(var n in e)"navigationStart"!==n&&"toJSON"!==n&&(t[n]=Math.max(e[n]-e.navigationStart,0));return t}();n.value=n.delta=t.responseStart,n.entries=[t],e(n)}catch(e){}},"complete"===document.readyState?setTimeout(t,0):addEventListener("pageshow",t)}}}]);
2
- //# sourceMappingURL=3.0c27d1d4.chunk.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../node_modules/web-vitals/dist/web-vitals.js"],"names":["e","t","n","i","a","name","value","delta","entries","id","concat","Date","now","Math","floor","random","r","PerformanceObserver","supportedEntryTypes","includes","getEntries","map","observe","type","buffered","o","document","visibilityState","removeEventListener","addEventListener","c","persisted","u","WeakSet","Set","s","has","f","hadRecentInput","push","takeRecords","m","v","d","timeStamp","p","setTimeout","l","disconnect","startTime","add","requestAnimationFrame","performance","h","passive","capture","S","y","w","g","entryType","target","cancelable","processingStart","forEach","E","L","T","once","b","getEntriesByType","timing","max","navigationStart","responseStart","readyState"],"mappings":"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","file":"static/js/3.0c27d1d4.chunk.js","sourcesContent":["var e,t,n,i,a=function(e,t){return{name:e,value:void 0===t?-1:t,delta:0,entries:[],id:\"v1-\".concat(Date.now(),\"-\").concat(Math.floor(8999999999999*Math.random())+1e12)}},r=function(e,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver((function(e){return e.getEntries().map(t)}));return n.observe({type:e,buffered:!0}),n}}catch(e){}},o=function(e,t){var n=function n(i){\"pagehide\"!==i.type&&\"hidden\"!==document.visibilityState||(e(i),t&&(removeEventListener(\"visibilitychange\",n,!0),removeEventListener(\"pagehide\",n,!0)))};addEventListener(\"visibilitychange\",n,!0),addEventListener(\"pagehide\",n,!0)},c=function(e){addEventListener(\"pageshow\",(function(t){t.persisted&&e(t)}),!0)},u=\"function\"==typeof WeakSet?new WeakSet:new Set,s=function(e,t,n){var i;return function(){t.value>=0&&(n||u.has(t)||\"hidden\"===document.visibilityState)&&(t.delta=t.value-(i||0),(t.delta||void 0===i)&&(i=t.value,e(t)))}},f=function(e,t){var n,i=a(\"CLS\",0),u=function(e){e.hadRecentInput||(i.value+=e.value,i.entries.push(e),n())},f=r(\"layout-shift\",u);f&&(n=s(e,i,t),o((function(){f.takeRecords().map(u),n()})),c((function(){i=a(\"CLS\",0),n=s(e,i,t)})))},m=-1,v=function(){return\"hidden\"===document.visibilityState?0:1/0},d=function(){o((function(e){var t=e.timeStamp;m=t}),!0)},p=function(){return m<0&&(m=v(),d(),c((function(){setTimeout((function(){m=v(),d()}),0)}))),{get timeStamp(){return m}}},l=function(e,t){var n,i=p(),o=a(\"FCP\"),f=r(\"paint\",(function(e){\"first-contentful-paint\"===e.name&&(f&&f.disconnect(),e.startTime<i.timeStamp&&(o.value=e.startTime,o.entries.push(e),u.add(o),n()))}));f&&(n=s(e,o,t),c((function(i){o=a(\"FCP\"),n=s(e,o,t),requestAnimationFrame((function(){requestAnimationFrame((function(){o.value=performance.now()-i.timeStamp,u.add(o),n()}))}))})))},h={passive:!0,capture:!0},S=new Date,y=function(i,a){e||(e=a,t=i,n=new Date,w(removeEventListener),g())},g=function(){if(t>=0&&t<n-S){var a={entryType:\"first-input\",name:e.type,target:e.target,cancelable:e.cancelable,startTime:e.timeStamp,processingStart:e.timeStamp+t};i.forEach((function(e){e(a)})),i=[]}},E=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;\"pointerdown\"==e.type?function(e,t){var n=function(){y(e,t),a()},i=function(){a()},a=function(){removeEventListener(\"pointerup\",n,h),removeEventListener(\"pointercancel\",i,h)};addEventListener(\"pointerup\",n,h),addEventListener(\"pointercancel\",i,h)}(t,e):y(t,e)}},w=function(e){[\"mousedown\",\"keydown\",\"touchstart\",\"pointerdown\"].forEach((function(t){return e(t,E,h)}))},L=function(n,f){var m,v=p(),d=a(\"FID\"),l=function(e){e.startTime<v.timeStamp&&(d.value=e.processingStart-e.startTime,d.entries.push(e),u.add(d),m())},h=r(\"first-input\",l);m=s(n,d,f),h&&o((function(){h.takeRecords().map(l),h.disconnect()}),!0),h&&c((function(){var r;d=a(\"FID\"),m=s(n,d,f),i=[],t=-1,e=null,w(addEventListener),r=l,i.push(r),g()}))},T=function(e,t){var n,i=p(),f=a(\"LCP\"),m=function(e){var t=e.startTime;t<i.timeStamp&&(f.value=t,f.entries.push(e)),n()},v=r(\"largest-contentful-paint\",m);if(v){n=s(e,f,t);var d=function(){u.has(f)||(v.takeRecords().map(m),v.disconnect(),u.add(f),n())};[\"keydown\",\"click\"].forEach((function(e){addEventListener(e,d,{once:!0,capture:!0})})),o(d,!0),c((function(i){f=a(\"LCP\"),n=s(e,f,t),requestAnimationFrame((function(){requestAnimationFrame((function(){f.value=performance.now()-i.timeStamp,u.add(f),n()}))}))}))}},b=function(e){var t,n=a(\"TTFB\");t=function(){try{var t=performance.getEntriesByType(\"navigation\")[0]||function(){var e=performance.timing,t={entryType:\"navigation\",startTime:0};for(var n in e)\"navigationStart\"!==n&&\"toJSON\"!==n&&(t[n]=Math.max(e[n]-e.navigationStart,0));return t}();n.value=n.delta=t.responseStart,n.entries=[t],e(n)}catch(e){}},\"complete\"===document.readyState?setTimeout(t,0):addEventListener(\"pageshow\",t)};export{f as getCLS,l as getFCP,L as getFID,T as getLCP,b as getTTFB};\n"],"sourceRoot":""}
@@ -1,2 +0,0 @@
1
- (this["webpackJsonp@ethersphere/bee-dashboard"]=this["webpackJsonp@ethersphere/bee-dashboard"]||[]).push([[0],{190:function(e){e.exports=JSON.parse('{"a":{"node":">=12.0.0","npm":">=6.0.0","bee":">=0.6.0"}}')},239:function(e,t,n){},240:function(e,t,n){},519:function(e,t,n){"use strict";n.r(t);var a=n(0),i=n.n(a),r=n(13),c=n.n(r),s=(n(239),n(7)),o=n(45),l=(n(240),n(632)),d=n(633),u=n(39),j=n(19),b=n(16),h=n(1),O=function(e){var t=e.component,n=e.layout,a=e.exact,i=e.path;return Object(h.jsx)(j.a,{exact:a,path:i,render:function(e){return Object(h.jsx)(n,Object(b.a)(Object(b.a)({},e),{},{children:Object(h.jsx)(t,Object(b.a)({},e))}))}})},x=n(120),p=n(121),g=n(211),m=n(209),f=function(e){Object(g.a)(n,e);var t=Object(m.a)(n);function n(e){var a;return Object(x.a)(this,n),(a=t.call(this,e)).state={error:null},a}return Object(p.a)(n,[{key:"componentDidCatch",value:function(e,t){console.error({error:e,errorInfo:t})}},{key:"render",value:function(){return this.state.error?Object(h.jsxs)("h1",{children:["Something went wrong. Error: ",this.state.error.message]}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return{error:e}}}]),n}(a.Component),v=n(522),y=n(219),w=n(636),k=n(576),S=n(215),B=n(523),L=n(122),C=n.n(L),N=n(55),A=sessionStorage.getItem("api_host")||"http://localhost:1633",I=sessionStorage.getItem("debug_api_host")||"http://localhost:1635",P=function(){return new N.Bee(A)},E=function(){return new N.BeeDebug(I)},T={health:function(){return P().isConnected()}},D={uploadFile:function(e,t){return P().uploadFile(e,t)},downloadFile:function(e){return P().downloadFile(e)}},q={getPostageStamps:function(){return P().getAllPostageBatch()},buyPostageStamp:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return P().createPostageBatch(e.toString(),t,n)}},F={status:{nodeHealth:function(){return E().getHealth()}},connectivity:{addresses:function(){return E().getNodeAddresses()},listPeers:function(){return E().getPeers()},topology:function(){return E().getTopology()},ping:function(e){return E().pingPeer(e)}},balance:{balances:function(){return E().getAllBalances()}},chequebook:{address:function(){return E().getChequebookAddress()},balance:function(){return E().getChequebookBalance()},getLastCheques:function(){return E().getLastCheques()},peerCashout:function(e){return E().cashoutLastCheque(e)},getPeerLastCashout:function(e){return E().getLastCashoutAction(e)},getPeerLastCheques:function(e){return E().getLastChequesForPeer(e)},withdraw:function(e){return E().withdrawTokens(e.toString())},deposit:function(e){return E().depositTokens(e.toString())}},settlements:{getSettlements:function(){return E().getAllSettlements()}}},R=n(189),M=n.n(R),W=n(28),z=n.n(W);function H(e){return W.BigNumber.isBigNumber(e)&&e.isInteger()||"bigint"===typeof e}function _(e){if(W.BigNumber.isBigNumber(e))return e;if("string"===typeof e)return new W.BigNumber(e);if("bigint"===typeof e)return new W.BigNumber(e.toString());if("number"===typeof e)return new W.BigNumber(e);throw new TypeError("Not a BigNumber or BigNumber convertible value. Type: ".concat(typeof e," value: ").concat(e))}var U=[18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0],Z=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16;Object(x.a)(this,e),this.amount=void 0,this.decimals=void 0;var a=_(t);if(!H(a)||!U.includes(n))throw new TypeError("Not a valid token values");this.amount=a,this.decimals=n}return Object(p.a)(e,[{key:"toBigInt",get:function(){return BigInt(this.amount.toFixed(0))}},{key:"toString",get:function(){return this.amount.toFixed(0)}},{key:"toBigNumber",get:function(){return new W.BigNumber(this.amount)}},{key:"toDecimal",get:function(){return this.amount.dividedBy(new W.BigNumber(10).pow(this.decimals))}},{key:"toFixedDecimal",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:7;return this.toDecimal.toFixed(e)}}],[{key:"fromDecimal",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,a=_(t),i=a.multipliedBy(new W.BigNumber(10).pow(n));return new e(i,n)}}]),e}(),V=function(){var e=Object(a.useState)(!1),t=Object(s.a)(e,2),n=t[0],i=t[1],r=Object(a.useState)(!0),c=Object(s.a)(r,2),o=c[0],l=c[1],d=Object(a.useState)(null),u=Object(s.a)(d,2),j=u[0],b=u[1];return Object(a.useEffect)((function(){l(!0),T.health().then((function(e){i(e)})).catch((function(e){b(e)})).finally((function(){l(!1)}))}),[]),{health:n,isLoadingHealth:o,error:j}},G=function(){var e=Object(a.useState)(null),t=Object(s.a)(e,2),n=t[0],i=t[1],r=Object(a.useState)(!0),c=Object(s.a)(r,2),o=c[0],l=c[1],d=Object(a.useState)(null),u=Object(s.a)(d,2),j=u[0],b=u[1];return Object(a.useEffect)((function(){l(!0),F.status.nodeHealth().then((function(e){i(e)})).catch((function(e){b(e)})).finally((function(){l(!1)}))}),[]),{nodeHealth:n,isLoadingNodeHealth:o,error:j}},Y=function(){var e=Object(a.useState)(null),t=Object(s.a)(e,2),n=t[0],i=t[1],r=Object(a.useState)(!0),c=Object(s.a)(r,2),o=c[0],l=c[1],d=Object(a.useState)(null),u=Object(s.a)(d,2),j=u[0],b=u[1];return Object(a.useEffect)((function(){l(!0),F.connectivity.addresses().then((function(e){i(e)})).catch((function(e){b(e)})).finally((function(){l(!1)}))}),[]),{nodeAddresses:n,isLoadingNodeAddresses:o,error:j}},K=function(){var e=Object(a.useState)(null),t=Object(s.a)(e,2),n=t[0],i=t[1],r=Object(a.useState)(!0),c=Object(s.a)(r,2),o=c[0],l=c[1],d=Object(a.useState)(null),u=Object(s.a)(d,2),j=u[0],b=u[1];return Object(a.useEffect)((function(){l(!0),F.connectivity.topology().then((function(e){i(e)})).catch((function(e){b(e)})).finally((function(){l(!1)}))}),[]),{topology:n,isLoading:o,error:j}},J=function(){var e=Object(a.useState)(null),t=Object(s.a)(e,2),n=t[0],i=t[1],r=Object(a.useState)(!0),c=Object(s.a)(r,2),o=c[0],l=c[1],d=Object(a.useState)(null),u=Object(s.a)(d,2),j=u[0],b=u[1];return Object(a.useEffect)((function(){l(!0),F.chequebook.address().then((function(e){i(e)})).catch((function(e){b(e)})).finally((function(){l(!1)}))}),[]),{chequebookAddress:n,isLoadingChequebookAddress:o,error:j}},X=function(){var e=Object(a.useState)(null),t=Object(s.a)(e,2),n=t[0],i=t[1],r=Object(a.useState)(!0),c=Object(s.a)(r,2),o=c[0],l=c[1],d=Object(a.useState)(null),u=Object(s.a)(d,2),j=u[0],b=u[1];return Object(a.useEffect)((function(){l(!0),F.chequebook.balance().then((function(e){var t=e.totalBalance,n=e.availableBalance,a={totalBalance:new Z(t),availableBalance:new Z(n)};i(a)})).catch((function(e){b(e)})).finally((function(){l(!1)}))}),[]),{chequebookBalance:n,isLoadingChequebookBalance:o,error:j}},$=n(94),Q=n.n($),ee=n(190),te=function(){var e,t,n=function(){var e=Object(a.useState)(null),t=Object(s.a)(e,2),n=t[0],i=t[1],r=Object(a.useState)(!1),c=Object(s.a)(r,2),o=c[0],l=c[1],d=Object(a.useState)(null),u=Object(s.a)(d,2),j=u[0],b=u[1];return Object(a.useEffect)((function(){M.a.get("".concat("https://api.github.com/repos/ethersphere/bee","/releases/latest")).then((function(e){i(e.data)})).catch((function(e){b(e)})).finally((function(){l(!1)}))}),[]),{latestBeeRelease:n,isLoadingLatestBeeRelease:o,error:j}}(),i=n.latestBeeRelease,r=n.isLoadingLatestBeeRelease,c=G(),o=c.nodeHealth,l=c.isLoadingNodeHealth,d=null===(e=Q.a.coerce(null===i||void 0===i?void 0:i.name))||void 0===e?void 0:e.version,u=null===(t=Q.a.coerce(null===o||void 0===o?void 0:o.version))||void 0===t?void 0:t.version,j=Boolean(d&&u&&Q.a.satisfies(d,u,{includePrerelease:!0}));return{isLoading:l||r,isOk:Boolean(o&&Q.a.satisfies(o.version,ee.a.bee,{includePrerelease:!0})),userVersion:null===o||void 0===o?void 0:o.version,latestVersion:d,latestUrl:(null===i||void 0===i?void 0:i.html_url)||"https://github.com/ethersphere/bee/releases/latest",isLatestBeeVersion:j}},ne=Object(v.a)((function(e){return Object(y.a)({root:{width:"100%",marginBottom:e.spacing(2)}})}));function ae(){var e=ne(),t=te(),n=t.isLoading,i=t.userVersion,r=Object(a.useState)(!0),c=Object(s.a)(r,2),o=c[0],l=c[1],d=N.SUPPORTED_BEE_VERSION_EXACT===i;return n||!i?null:Object(h.jsx)(S.a,{in:!d&&o,children:Object(h.jsx)("div",{className:e.root,children:Object(h.jsxs)(w.a,{severity:"warning",action:Object(h.jsx)(B.a,{"aria-label":"close",color:"inherit",size:"small",onClick:function(){l(!1)},children:Object(h.jsx)(C.a,{fontSize:"inherit"})}),children:[Object(h.jsx)(k.a,{children:"Warning"}),"Your Bee node version (",Object(h.jsx)("code",{children:i}),") does not exactly match the Bee version we tested the Bee Dashboard against (",Object(h.jsx)("code",{children:N.SUPPORTED_BEE_VERSION_EXACT}),"). Please note that some functionality may not work properly."]})})})}var ie=n(583),re=n(585),ce=n(524),se=n(586),oe=n(587),le=n(588),de=n(589),ue=n(590),je=n(577),be=n(578),he=n(579),Oe=n(580),xe=n(581),pe=n(582),ge=n.p+"static/media/swarm-logo-orange.f09e1111.svg",me=240,fe=[{label:"Status",id:"status",path:"/",icon:je.a},{label:"Files",id:"files",path:"/files/",icon:be.a},{label:"Stamps",id:"stamps",path:"/stamps/",icon:he.a},{label:"Accounting",id:"accounting",path:"/accounting/",icon:Oe.a},{label:"Peers",id:"peers",path:"/peers/",icon:xe.a},{label:"Settings",id:"settings",path:"/settings/",icon:pe.a}],ve=Object(v.a)((function(e){return Object(y.a)({root:{display:"flex"},appBar:{width:"calc(100% - ".concat(me,"px)"),marginLeft:me},logo:{padding:1,marginTop:20},drawer:{width:me,flexShrink:0},drawerPaper:{width:me},activeSideBar:{color:"#dd7700"},activeSideBarItem:{borderLeft:"4px solid #dd7700",backgroundColor:"inherit !important"},toolbar:e.mixins.toolbar})}));function ye(e){var t,n=ve();return Object(h.jsx)("div",{className:n.root,children:Object(h.jsxs)(ie.a,{className:n.drawer,variant:"permanent",classes:{paper:n.drawerPaper},anchor:"left",children:[Object(h.jsx)("div",{className:n.toolbar,style:{textAlign:"left",marginLeft:20},children:Object(h.jsx)(o.b,{to:"/",children:Object(h.jsx)("img",{alt:"swarm",className:n.logo,src:(e.themeMode,ge),style:{maxHeight:"30px",alignItems:"center"}})})}),Object(h.jsx)(re.a,{children:fe.map((function(t){return Object(h.jsx)(o.b,{to:t.path,style:{color:"inherit",textDecoration:"none"},children:Object(h.jsxs)(ce.a,{button:!0,selected:e.location.pathname===t.path,className:e.location.pathname===t.path?n.activeSideBarItem:"",children:[Object(h.jsx)(se.a,{className:e.location.pathname===t.path?n.activeSideBar:"",children:Object(h.jsx)(t.icon,{style:{height:"20px"}})}),Object(h.jsx)(oe.a,{primary:t.label,className:e.location.pathname===t.path?n.activeSideBar:""})]})},t.id)}))}),Object(h.jsx)(le.a,{}),Object(h.jsx)(re.a,{children:Object(h.jsx)(de.a,{href:"https://docs.ethswarm.org/docs/",target:"_blank",style:{textDecoration:"none"},children:Object(h.jsxs)(ce.a,{button:!0,children:[Object(h.jsx)(oe.a,{primary:"Docs"}),Object(h.jsx)(ue.a,{fontSize:"small"})]})})}),Object(h.jsx)("div",{style:{position:"fixed",bottom:0,width:"inherit",padding:"10px"},children:Object(h.jsxs)(ce.a,{children:[Object(h.jsxs)("div",{style:{marginRight:"30px"},children:[Object(h.jsx)("div",{style:{backgroundColor:e.health?"#32c48d":"#c9201f",marginRight:"7px",height:"10px",width:"10px",borderRadius:"50%",display:"inline-block"}}),Object(h.jsx)("span",{children:"API"})]}),Object(h.jsxs)("div",{children:[Object(h.jsx)("div",{style:{backgroundColor:"ok"===(null===(t=e.nodeHealth)||void 0===t?void 0:t.status)?"#32c48d":"#c9201f",marginRight:"7px",height:"10px",width:"10px",borderRadius:"50%",display:"inline-block"}}),Object(h.jsx)("span",{children:"Debug API"})]})]})})]})})}var we=n(591),ke=n(592),Se=n(593),Be=Object(v.a)((function(){return Object(y.a)({appBar:{width:"calc(100% - ".concat(240,"px)"),marginLeft:240}})}));function Le(e){var t=Object(a.useState)(!1),n=Object(s.a)(t,2),i=n[0],r=n[1],c=Be();return Object(h.jsx)("div",{children:Object(h.jsx)("div",{style:{display:"fixed"},className:c.appBar,children:Object(h.jsx)(we.a,{style:{display:"flex"},children:Object(h.jsx)("div",{style:{width:"100%"},children:Object(h.jsx)("div",{style:{float:"right"},children:Object(h.jsx)(B.a,{style:{marginRight:"10px"},"aria-label":"dark-mode",onClick:function(){return function(){var e=localStorage.getItem("theme");e?localStorage.setItem("theme","light"===e?"dark":"light"):localStorage.setItem("theme",i?"dark":"light"),r(!i),window.location.reload()}()},children:"dark"===e.themeMode?Object(h.jsx)(ke.a,{}):Object(h.jsx)(Se.a,{})})})})})})})}var Ce=Object(v.a)((function(e){return Object(y.a)({content:{marginLeft:"240px",flexGrow:1,backgroundColor:e.palette.background.default,padding:e.spacing(3),paddingBottom:"65px"}})})),Ne=function(e){var t=Ce(),n=Object(a.useState)("light"),i=Object(s.a)(n,2),r=i[0],c=i[1],o=V().health,l=G().nodeHealth;return Object(a.useEffect)((function(){var e,t,n,a;return localStorage.getItem("theme")?c(String(localStorage.getItem("theme"))):(null===(e=window)||void 0===e||null===(t=e.matchMedia("(prefers-color-scheme: dark)"))||void 0===t?void 0:t.matches)&&c("dark"),null===(n=window)||void 0===n||null===(a=n.matchMedia("(prefers-color-scheme: dark)"))||void 0===a||a.addEventListener("change",(function(e){c((null===e||void 0===e?void 0:e.matches)?"dark":"light")})),function(){var e,t;return null===(e=window)||void 0===e||null===(t=e.matchMedia("(prefers-color-scheme: dark)"))||void 0===t?void 0:t.removeEventListener("change",(function(e){c((null===e||void 0===e?void 0:e.matches)?"dark":"light")}))}}),[]),Object(h.jsxs)("div",{children:[Object(h.jsx)(ye,Object(b.a)(Object(b.a)({},e),{},{themeMode:r,health:o,nodeHealth:l})),Object(h.jsx)(Le,{themeMode:r}),Object(h.jsx)(f,{children:Object(h.jsxs)("main",{className:t.content,children:[Object(h.jsx)(ae,{}),e.children]})})]})},Ae=n(597),Ie=n(598),Pe=n(155),Ee=n(69),Te=n(596),De=n(639),qe=n(611),Fe=n(531),Re=n(615),Me=n(617),We=n(610),ze=n(612),He=n(613),_e=n(614),Ue=n(616),Ze=n(601),Ve=n(638),Ge=n(600),Ye=n(602),Ke=n(594);function Je(e){var t=Object(a.useState)(!1),n=Object(s.a)(t,2),i=n[0],r=n[1],c=Object(a.useState)(!1),o=Object(s.a)(c,2),l=o[0],d=o[1],u=Object(a.useState)(""),j=Object(s.a)(u,2),b=j[0],O=j[1];return Object(h.jsx)("div",{children:i?Object(h.jsxs)("div",{style:{display:"flex"},children:[Object(h.jsx)(Ke.a,{defaultValue:e.defaultHost,label:"Enter host",variant:"outlined",size:"small",onChange:function(e){return O(e.target.value)},style:{marginRight:"15px",minWidth:"300px"}}),Object(h.jsx)(Te.a,{onClick:function(){b&&(d(!0),sessionStorage.setItem(e.hostName,b),r(!i),window.location.reload())},size:"small",variant:"outlined",children:"Connect"}),Object(h.jsx)(Te.a,{style:{marginLeft:"7px"},onClick:function(){return r(!i)},size:"small",children:"Cancel"})]}):l?Object(h.jsx)(Ae.a,{style:{textAlign:"center",padding:"0px"},children:Object(h.jsx)(Ie.a,{size:20})}):Object(h.jsx)(Te.a,{onClick:function(){return r(!i)},size:"small",variant:"outlined",children:"Change host"})})}var Xe=n(128),$e=n(6),Qe=n(634),et=n(635),tt=n(599),nt=n(637),at=function(e){return Object(h.jsx)("div",{style:{textAlign:"left"},children:Object(h.jsx)(nt.a,{language:e.language,showLineNumbers:e.showLineNumbers,children:e.code})})};function it(e){return{id:"simple-tab-".concat(e),"aria-controls":"simple-tabpanel-".concat(e)}}function rt(e){var t=i.a.useState(0),n=Object(s.a)(t,2),r=n[0],c=n[1];function o(e){var t=e.children,n=e.value,a=e.index,i=Object(Xe.a)(e,["children","value","index"]);return Object(h.jsx)("div",Object(b.a)(Object(b.a)({role:"tabpanel",hidden:n!==a,id:"simple-tabpanel-".concat(a),"aria-labelledby":"simple-tab-".concat(a)},i),{},{children:n===a&&Object(h.jsx)(Qe.a,{style:{marginTop:"-12px"},children:Object(h.jsx)(Ee.a,{component:"div",children:t})})}))}Object(a.useEffect)((function(){var e=function(){var e=window.navigator.userAgent,t=window.navigator.platform;return["Macintosh","MacIntel","MacPPC","Mac68K"].includes(t)?"macOS":["iPhone","iPad","iPod"].includes(t)?"iOS":["Win32","Win64","Windows","WinCE"].includes(t)?"windows":/Android/.test(e)?"android":/Linux/.test(t)?"linux":null}();"windows"===e||"linux"===e?c(0):"macOS"===e&&c(1)}),[]);var l=Object($e.a)({root:{borderBottom:"1px solid #e8e8e8"},indicator:{backgroundColor:"#3f51b5"}})(et.a),d=Object($e.a)((function(e){return Object(y.a)({root:{textTransform:"none",minWidth:72,backgroundColor:"transparent",fontWeight:e.typography.fontWeightRegular,marginRight:e.spacing(4),fontFamily:["-apple-system","BlinkMacSystemFont",'"Segoe UI"',"Roboto",'"Helvetica Neue"',"Arial","sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"'].join(","),"&:hover":{color:"#3f51b5",opacity:1},"&$selected":{color:"#3f51b5",fontWeight:e.typography.fontWeightMedium},"&:focus":{color:"#3f51b5"}},selected:{}})}))((function(e){return Object(h.jsx)(tt.a,Object(b.a)({disableRipple:!0},e))}));return Object(h.jsxs)("div",{children:[Object(h.jsxs)(l,{style:{marginTop:"12px"},value:r,onChange:function(e,t){c(t)},"aria-label":"ant example",children:[Object(h.jsx)(d,Object(b.a)({label:"Linux"},it(0))),Object(h.jsx)(d,Object(b.a)({label:"MacOS"},it(1)))]}),Object(h.jsx)(o,{value:r,index:0,children:Object(h.jsx)(at,{showLineNumbers:e.showLineNumbers,language:"bash",code:e.linux})}),Object(h.jsx)(o,{value:r,index:1,children:Object(h.jsx)(at,{showLineNumbers:e.showLineNumbers,language:"bash",code:e.mac})})]})}function ct(e){var t=e.isLoading,n=e.isOk;if(t)return null;var a=Object(h.jsxs)("div",{style:{display:"flex",marginTop:"25px",marginBottom:"25px"},children:[Object(h.jsxs)("span",{style:{marginRight:"15px"},children:["Debug API (",Object(h.jsx)(Ee.a,{variant:"button",children:I}),")"]}),Object(h.jsx)(Je,{hostName:"debug_api_host",defaultHost:I})]});return n?a:Object(h.jsxs)("div",{children:[a,Object(h.jsx)("div",{children:Object(h.jsxs)(Ee.a,{component:"div",variant:"body2",gutterBottom:!0,style:{margin:"15px"},children:["We cannot connect to your nodes debug API at ",Object(h.jsx)(Ee.a,{variant:"button",children:I}),". Please check the following to troubleshoot your issue.",Object(h.jsxs)(Ve.a,{style:{marginTop:"20px"},children:[Object(h.jsx)(Ge.a,{expandIcon:Object(h.jsx)(Ze.a,{}),"aria-controls":"panel1a-content",id:"panel1a-header",children:Object(h.jsx)(Ee.a,{children:"Troubleshoot"})}),Object(h.jsx)(Ye.a,{children:Object(h.jsx)(Ee.a,{component:"div",children:Object(h.jsxs)("ol",{children:[Object(h.jsx)("li",{children:"Check the status of your node by running the below command to see if your node is running."}),Object(h.jsx)(rt,{showLineNumbers:!0,linux:"sudo systemctl status bee",mac:"brew services list"}),Object(h.jsx)("li",{children:"If your node is running, check your firewall settings to make sure that port 1635 (or your custom specified port) is bound to localhost. If your node is not running try executing the below command to start your bee node"}),Object(h.jsx)(w.a,{style:{marginTop:"10px",marginBottom:"10px"},elevation:6,variant:"filled",severity:"error",children:'Your debug node API should never be completely open to the internet. If you want to connect remotely, make sure your firewall settings are set to only allow specific trusted IP addresses and block all other ports. A simple google search for "what is my ip" will show you your computers public IP address to allow.'}),Object(h.jsx)(rt,{showLineNumbers:!0,linux:"sudo systemctl start bee",mac:"brew services start swarm-bee"}),Object(h.jsx)("li",{children:"Run the commands to validate your node is running and see the log output."}),Object(h.jsx)(rt,{showLineNumbers:!0,linux:"sudo systemctl status bee \njournalctl --lines=100 --follow --unit bee",mac:"brew services list \ntail -f /usr/local/var/log/swarm-bee/bee.log"}),Object(h.jsxs)("li",{children:["Lastly, check your nodes configuration settings to validate the debug API is enabled and the Cross Origin Resource Sharing (CORS) setting is configured to allow your host. Config parameter"," ",Object(h.jsx)("strong",{children:"debug-api-enable"})," must be set to ",Object(h.jsx)("strong",{children:"true"})," and"," ",Object(h.jsx)("strong",{children:"cors-allowed-origins"})," must be set to your host domain or IP (you can also use the wildcard ",Object(h.jsx)("code",{children:"cors-allowed-origins: ['*']"}),"). If edits are made to the configuration run the restart command below for changes to take effect."]}),Object(h.jsx)(rt,{showLineNumbers:!0,linux:"sudo vi /etc/bee/bee.yaml\nsudo systemctl restart bee",mac:"sudo vi /usr/local/etc/swarm-bee/bee.yaml \nbrew services restart swarm-bee"})]})})})]})]})})]})}function st(e){var t=e.isLoading,n=e.isOk;return t?null:Object(h.jsxs)("div",{children:[Object(h.jsxs)("div",{style:{display:"flex",marginBottom:"25px"},children:[Object(h.jsxs)("span",{style:{marginRight:"15px"},children:["Node API (",Object(h.jsx)(Ee.a,{variant:"button",children:A}),")"]}),Object(h.jsx)(Je,{hostName:"api_host",defaultHost:A})]}),Object(h.jsx)("div",{children:!n&&Object(h.jsxs)(Ee.a,{component:"div",variant:"body2",gutterBottom:!0,style:{margin:"15px"},children:["We cannot connect to your nodes API at ",Object(h.jsx)(Ee.a,{variant:"button",children:A}),". Please check the following to troubleshoot your issue.",Object(h.jsxs)(Ve.a,{style:{marginTop:"20px"},children:[Object(h.jsx)(Ge.a,{expandIcon:Object(h.jsx)(Ze.a,{}),"aria-controls":"panel1a-content",id:"panel1a-header",children:Object(h.jsx)(Ee.a,{children:"Troubleshoot"})}),Object(h.jsx)(Ye.a,{children:Object(h.jsx)(Ee.a,{component:"div",children:Object(h.jsxs)("ol",{children:[Object(h.jsx)("li",{children:"Check the status of your node by running the below command to see if your node is running."}),Object(h.jsx)(rt,{showLineNumbers:!0,linux:"sudo systemctl status bee",mac:"brew services list"}),Object(h.jsx)("li",{children:"If your node is running, check your firewall settings to make sure that port 1633 (or your custom specified port) is exposed to the internet. If your node is not running try executing the below command to start your bee node"}),Object(h.jsx)(rt,{showLineNumbers:!0,linux:"sudo systemctl start bee",mac:"brew services start swarm-bee"}),Object(h.jsx)("li",{children:"Run the commands to validate your node is running and see the log output."}),Object(h.jsx)(rt,{showLineNumbers:!0,linux:"sudo systemctl status bee \njournalctl --lines=100 --follow --unit bee",mac:"brew services list \ntail -f /usr/local/var/log/swarm-bee/bee.log"})]})})})]})]})})]})}function ot(e){var t=e.isLoading,n=e.isOk,a=e.userVersion,i=e.latestVersion,r=e.latestUrl;if(t)return null;var c=Object(h.jsxs)("div",{style:{display:"flex"},children:[Object(h.jsxs)("div",{style:{marginRight:"30px"},children:[Object(h.jsx)("p",{children:Object(h.jsx)("span",{children:"User Version"})}),Object(h.jsx)(Ee.a,{component:"h5",variant:"h5",children:Object(h.jsx)("span",{children:a})})]}),Object(h.jsxs)("div",{children:[Object(h.jsx)("p",{children:Object(h.jsx)("span",{children:"Latest Version"})}),Object(h.jsx)(Ee.a,{component:"h5",variant:"h5",children:Object(h.jsx)("span",{children:i})})]})]});return n?Object(h.jsxs)(h.Fragment,{children:[Object(h.jsx)("span",{children:"You are running the latest version of Bee"}),c]}):Object(h.jsxs)(h.Fragment,{children:[Object(h.jsxs)("span",{children:["Your Bee version is out of date. Please update to the"," ",Object(h.jsx)("a",{href:r,rel:"noreferrer",target:"_blank",children:"latest"})," ","before continuing. Rerun the installation script below to upgrade. Reference the docs for help with updating."," ",Object(h.jsx)("a",{href:"https://docs.ethswarm.org/docs/installation/manual#upgrading-bee",rel:"noreferrer",target:"_blank",children:"Docs"})]}),Object(h.jsx)(rt,{showLineNumbers:!0,linux:"bee version\nwget https://github.com/ethersphere/bee/releases/download/".concat(i,"/bee_").concat(i,"_amd64.deb\nsudo dpkg -i bee_").concat(i,"_amd64.deb"),mac:"bee version\nbrew tap ethersphere/tap\nbrew install swarm-bee\nbrew services start swarm-bee"}),c]})}var lt=n(193),dt=n.n(lt),ut=n(604),jt=n(605),bt=n(603);function ht(e){var t=Object(a.useState)(!1),n=Object(s.a)(t,2),i=n[0],r=n[1];return Object(h.jsxs)("div",{children:[Object(h.jsx)(B.a,{color:"primary",size:"small",onClick:function(){r(!0)},children:Object(h.jsx)(bt.a,{})}),Object(h.jsx)(ut.a,{onClose:function(){r(!1)},"aria-labelledby":"simple-dialog-title",open:i,children:Object(h.jsxs)("div",{style:{padding:"30px",textAlign:"center"},children:[Object(h.jsx)(jt.a,{id:"simple-dialog-title",children:e.label}),Object(h.jsx)(dt.a,{value:e.value,size:150,bgColor:"#ffffff",fgColor:"#000000",level:"L",includeMargin:!1,renderAs:"svg"})]})})]})}var Ot=n(194),xt=n(606);function pt(e){var t=e.value,n=Object(u.b)().enqueueSnackbar;return Object(h.jsx)("div",{style:{marginRight:"3px",marginLeft:"3px"},children:Object(h.jsx)(B.a,{color:"primary",size:"small",onClick:function(){return n("Copied: ".concat(t),{variant:"success"})},children:Object(h.jsx)(Ot.CopyToClipboard,{text:t,children:Object(h.jsx)(xt.a,{style:{height:"20px"}})})})})}var gt=n(195),mt=n.n(gt);function ft(e){return Object(h.jsx)(Ee.a,{component:"div",variant:"subtitle1",children:e.address?Object(h.jsxs)("div",{style:{display:"flex"},children:[e.hideBlockie?null:Object(h.jsx)("div",{style:{paddingTop:"5px",marginRight:"10px"},children:Object(h.jsx)(mt.a,{size:20,string:e.address})}),Object(h.jsx)("div",{children:Object(h.jsx)("a",{style:e.truncate?{marginRight:"7px",maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"}:{marginRight:"7px"},href:"".concat("https://blockscout.com/xdai/mainnet","/").concat(e.transaction?"tx":"address","/").concat(e.address),target:"_blank",rel:"noreferrer",children:e.address})}),Object(h.jsx)(ht,{value:e.address,label:"Ethereum Address"}),Object(h.jsx)(pt,{value:e.address})]}):"-"})}function vt(e){var t=e.isLoading,n=e.isOk,a=e.nodeAddresses;return t?null:n?Object(h.jsxs)("div",{children:[Object(h.jsx)(Ee.a,{variant:"subtitle1",gutterBottom:!0,children:"Node Address"}),Object(h.jsx)(ft,{address:null===a||void 0===a?void 0:a.ethereum})]}):Object(h.jsxs)("p",{children:["Your Bee node must have access to the xDai blockchain, so that it can interact and deploy your chequebook contract. You can run"," ",Object(h.jsx)("a",{href:"https://www.xdaichain.com/",rel:"noreferrer",target:"_blank",children:"your own xDai node"}),", or use a provider instead - we recommend"," ",Object(h.jsx)("a",{href:"https://getblock.io/",rel:"noreferrer",target:"_blank",children:"Getblock"}),". By default, Bee expects a local node at http://localhost:8545. To use a provider instead, simply change the"," ",Object(h.jsx)("strong",{children:"swap-endpoint"})," in your configuration file."]})}var yt=n(51),wt=n.n(yt),kt=n(81),St=n(525),Bt=n(609),Lt=n(607),Ct=n(608),Nt=n(528);function At(e){var t=e.successMessage,n=e.errorMessage,i=e.dialogMessage,r=e.min,c=e.max,o=e.label,l=e.action,d=Object(a.useState)(!1),j=Object(s.a)(d,2),b=j[0],O=j[1],x=Object(a.useState)(""),p=Object(s.a)(x,2),g=p[0],m=p[1],f=Object(a.useState)(null),v=Object(s.a)(f,2),y=v[0],w=v[1],k=Object(a.useState)(null),S=Object(s.a)(k,2),B=S[0],L=S[1],C=Object(u.b)().enqueueSnackbar,N=function(){O(!1)},A=function(){var e=Object(kt.a)(wt.a.mark((function e(){var a;return wt.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==y){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,e.next=5,l(y.toBigInt);case 5:a=e.sent,O(!1),C("".concat(t," Transaction ").concat(a),{variant:"success"}),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(2),C("".concat(n," Error: ").concat(e.t0.message),{variant:"error"});case 13:case"end":return e.stop()}}),e,null,[[2,10]])})));return function(){return e.apply(this,arguments)}}();return Object(h.jsxs)("div",{children:[Object(h.jsx)(Te.a,{variant:"outlined",color:"primary",onClick:function(){O(!0)},children:o}),Object(h.jsxs)(ut.a,{open:b,onClose:N,"aria-labelledby":"form-dialog-title",children:[Object(h.jsx)(jt.a,{id:"form-dialog-title",children:o}),Object(h.jsxs)(Lt.a,{children:[Object(h.jsx)(Ct.a,{children:i}),Object(h.jsx)(St.a,{autoFocus:!0,margin:"dense",id:"name",type:"text",placeholder:"Amount",fullWidth:!0,value:g,onChange:function(e){var t=e.target.value;m(t),L(null);try{var n=Z.fromDecimal(t);w(n),r&&n.toDecimal.isLessThan(r)&&L(new Error("Needs to be more than ".concat(r))),c&&n.toDecimal.isGreaterThan(c)&&L(new Error("Needs to be less than ".concat(c)))}catch(e){L(e)}}}),B&&Object(h.jsxs)(Nt.a,{error:!0,children:["Please provide valid BZZ amount (max 16 decimals). Error: ",B.message]})]}),Object(h.jsxs)(Bt.a,{children:[Object(h.jsx)(Te.a,{onClick:N,color:"primary",children:"Cancel"}),Object(h.jsx)(Te.a,{onClick:A,color:"primary",children:o})]})]})]})}function It(){return Object(h.jsx)(At,{successMessage:"Successful deposit.",errorMessage:"Error with depositing",dialogMessage:"Specify the amount of BZZ you would like to withdraw from your node.",label:"Deposit",min:new W.BigNumber(0),action:F.chequebook.deposit})}var Pt=function(e){var t=e.isLoading,n=e.chequebookAddress,a=e.chequebookBalance;return t?null:Object(h.jsxs)("div",{children:[Object(h.jsx)("p",{style:{marginBottom:"20px",display:"flex"},children:(null===n||void 0===n?void 0:n.chequebookAddress)&&Object(h.jsx)(It,{})}),Object(h.jsx)("div",{style:{marginBottom:"10px"},children:!((null===n||void 0===n?void 0:n.chequebookAddress)&&(null===a||void 0===a?void 0:a.totalBalance.toBigNumber.isGreaterThan(0)))&&Object(h.jsx)("div",{children:Object(h.jsxs)("span",{children:["Your chequebook is either not deployed or funded. To run the node you will need xDAI and xBZZ on the xDai network. You may need to aquire BZZ through (e.g. ",Object(h.jsx)("a",{href:"https://bzz.exchange/",children:"bzz.exchange"}),") and bridge it to the xDai network through the ",Object(h.jsx)("a",{href:"https://omni.xdaichain.com/bridge",children:"omni bridge"}),". To pay the transaction fees, you will also need xDAI token. You can purchase DAI on the network and bridge it to xDai network through the ",Object(h.jsx)("a",{href:"https://bridge.xdaichain.com/",children:"xDai Bridge"}),". See the"," ",Object(h.jsx)("a",{href:"https://www.xdaichain.com/#xdai-stable-chain",children:"official xDai website"})," for more information."]})})}),Object(h.jsx)(Ee.a,{variant:"subtitle1",gutterBottom:!0,children:"Chequebook Address"}),Object(h.jsx)(ft,{address:null===n||void 0===n?void 0:n.chequebookAddress})]})};function Et(e){var t=e.isLoading,n=e.isOk,a=e.topology;if(t)return null;var i=Object(h.jsxs)("div",{style:{display:"flex",marginTop:"15px"},children:[Object(h.jsxs)("div",{style:{marginRight:"30px"},children:[Object(h.jsx)(Ee.a,{component:"div",variant:"subtitle1",gutterBottom:!0,color:"textSecondary",children:Object(h.jsx)("span",{children:"Connected Peers"})}),Object(h.jsx)(Ee.a,{component:"h2",variant:"h5",children:(null===a||void 0===a?void 0:a.connected)?a.connected:"-"})]}),Object(h.jsxs)("div",{children:[Object(h.jsx)(Ee.a,{component:"div",variant:"subtitle1",gutterBottom:!0,color:"textSecondary",children:Object(h.jsx)("span",{children:"Discovered Nodes"})}),Object(h.jsx)(Ee.a,{component:"h2",variant:"h5",children:(null===a||void 0===a?void 0:a.population)?a.population:"-"})]})]});return n?Object(h.jsxs)(h.Fragment,{children:[Object(h.jsx)("span",{children:"You are connected to peers!"}),i]}):Object(h.jsxs)(h.Fragment,{children:[Object(h.jsx)("span",{children:"Your node is not connected to any peers"}),i]})}var Tt=Object(v.a)((function(e){return Object(y.a)({root:{padding:e.spacing(2),width:"100%"},button:{marginTop:e.spacing(1),marginRight:e.spacing(1)},actionsContainer:{margin:e.spacing(2)}})}));function Dt(e){var t,n=e.nodeVersion,i=e.ethereumConnection,r=e.debugApiConnection,c=e.apiConnection,o=e.topology,l=e.chequebook,d=Tt(),u=Object(a.useState)(-1),j=Object(s.a)(u,2),O=j[0],x=j[1],p=[{label:"Connected to Node DebugAPI",isOk:r.isOk,isLoading:r.isLoading,component:Object(h.jsx)(ct,Object(b.a)({},r))},{label:"Running latest Bee version",isOk:n.isOk,isLoading:n.isLoading,component:Object(h.jsx)(ot,Object(b.a)({},n))},{label:"Connected to Ethereum Blockchain",isOk:i.isOk,isLoading:i.isLoading,component:Object(h.jsx)(vt,Object(b.a)({},i))},{label:"Deployed and Funded Chequebook",isOk:l.isOk,isLoading:l.isLoading,component:Object(h.jsx)(Pt,Object(b.a)({ethereumAddress:null===(t=i.nodeAddresses)||void 0===t?void 0:t.ethereum},l))},{label:"Connected to Node API",isOk:c.isOk,isLoading:c.isLoading,component:Object(h.jsx)(st,Object(b.a)({},c))},{label:"Connected to Peers",isOk:o.isOk,isLoading:o.isLoading,component:Object(h.jsx)(Et,Object(b.a)({},o))}];Object(a.useEffect)((function(){if(!(O>=0&&O<p.length)&&p.every((function(e){return!e.isLoading})))for(var e=0;e<p.length;++e)if(!p[e].isOk)return void x(e)}),[p]);var g=function(){x((function(e){return e+1}))},m=function(){x((function(e){return e-1}))};return Object(h.jsxs)(Pe.a,{className:d.root,children:[Object(h.jsxs)(Ee.a,{variant:"h5",gutterBottom:!0,children:["Node Setup",Object(h.jsx)("span",{style:{marginLeft:"25px"},children:Object(h.jsxs)(Te.a,{variant:"outlined",size:"small",onClick:function(){return window.location.reload()},children:[Object(h.jsx)(We.a,{}),Object(h.jsx)("span",{style:{marginLeft:"7px"},children:"Refresh Checks"})]})})]}),Object(h.jsx)(De.a,{nonLinear:!0,activeStep:O,orientation:"vertical",children:p.map((function(e,t){var n=e.label,a=e.isOk,i=e.component,r=e.isLoading;return Object(h.jsxs)(qe.a,{children:[Object(h.jsx)(Fe.a,{disabled:r,onClick:function(){return x(t===O?p.length:t)},StepIconComponent:function(){return r?Object(h.jsx)(ze.a,{style:{height:"25px",cursor:"pointer"}}):a?Object(h.jsx)(He.a,{style:{color:"#32c48d",height:"25px",cursor:"pointer"}}):Object(h.jsx)(_e.a,{style:{color:"#c9201f",height:"25px",cursor:"pointer"}})},children:Object(h.jsx)(Re.a,{disabled:r,onClick:function(){return x(t===O?p.length:t)},style:{justifyContent:"space-between"},children:Object(h.jsxs)("div",{style:{display:"flex"},children:[Object(h.jsx)("div",{style:{marginTop:"5px"},children:n}),Object(h.jsx)("div",{style:{marginLeft:"12px"},children:t===O?Object(h.jsx)(Ue.a,{}):Object(h.jsx)(Ze.a,{})})]})})}),Object(h.jsxs)(Me.a,{children:[Object(h.jsx)(Ee.a,{component:"div",children:i}),Object(h.jsx)("div",{className:d.actionsContainer,children:Object(h.jsxs)("div",{children:[Object(h.jsx)(Te.a,{disabled:0===O,onClick:m,className:d.button,children:"Back"}),Object(h.jsx)(Te.a,{variant:"contained",color:"primary",onClick:g,className:d.button,children:t<p.length-1?"Next":"Finish"})]})})]})]},n)}))})]})}var qt=n(618),Ft=n(619),Rt=n(640),Mt=n(620),Wt=n(621),zt=Object(v.a)((function(){return Object(y.a)({root:{display:"flex",flex:"1 1 auto",flexDirection:"column"},status:{color:"#2145a0",backgroundColor:"#e1effe"}})}));var Ht=function(e){var t=e.userBeeVersion,n=e.nodeAddresses,i=e.nodeTopology,r=e.isOk,c=e.isLatestBeeVersion,l=e.latestUrl,d=zt(),u=Object(a.useState)(!1),j=Object(s.a)(u,2),b=j[0],O=j[1];return Object(h.jsx)(qt.a,{children:Object(h.jsxs)(Ft.a,{className:d.root,children:[Object(h.jsxs)(Ee.a,{component:"h5",variant:"h5",style:{display:"flex",justifyContent:"space-between"},children:[r&&Object(h.jsxs)("div",{children:[Object(h.jsx)(He.a,{style:{color:"#32c48d",marginRight:"7px"}}),Object(h.jsx)("span",{children:"Your Bee node is running as expected"})]}),!r&&Object(h.jsxs)("div",{children:[Object(h.jsx)(_e.a,{style:{color:"#c9201f",marginRight:"7px"}}),Object(h.jsx)("span",{children:"Could not connect to Bee Node"})]})]}),r&&Object(h.jsxs)(h.Fragment,{children:[Object(h.jsxs)("div",{style:{marginBottom:"20px"},children:[Object(h.jsxs)("span",{style:{marginRight:"20px"},children:["Discovered Nodes: ",null===i||void 0===i?void 0:i.population]}),Object(h.jsxs)("span",{style:{marginRight:"20px"},children:[Object(h.jsx)("span",{children:"Connected Peers: "}),Object(h.jsx)(o.b,{to:"/peers/",children:null===i||void 0===i?void 0:i.connected})]})]}),Object(h.jsxs)("div",{children:[Object(h.jsxs)(Ee.a,{component:"div",variant:"subtitle2",gutterBottom:!0,children:[Object(h.jsx)("span",{children:"AGENT: "}),Object(h.jsx)("a",{href:"https://github.com/ethersphere/bee",rel:"noreferrer",target:"_blank",children:"Bee"})," ",Object(h.jsx)("span",{children:t||"-"}),c?Object(h.jsx)(Rt.a,{style:{marginLeft:"7px",color:"#2145a0"},size:"small",label:"latest",className:d.status}):Object(h.jsx)(Te.a,{size:"small",variant:"outlined",href:l,children:"update"})]}),Object(h.jsxs)(Ee.a,{component:"div",variant:"subtitle2",gutterBottom:!0,children:[Object(h.jsx)("span",{children:"PUBLIC KEY: "}),Object(h.jsx)("span",{children:(null===n||void 0===n?void 0:n.publicKey)?n.publicKey:"-"})]}),Object(h.jsxs)(Ee.a,{component:"div",variant:"subtitle2",gutterBottom:!0,children:[Object(h.jsx)("span",{children:"PSS PUBLIC KEY: "}),Object(h.jsx)("span",{children:(null===n||void 0===n?void 0:n.pssPublicKey)?n.pssPublicKey:"-"})]}),Object(h.jsxs)(Ee.a,{component:"div",variant:"subtitle2",gutterBottom:!0,children:[Object(h.jsx)("span",{children:"OVERLAY ADDRESS (PEER ID): "}),Object(h.jsx)("span",{children:(null===n||void 0===n?void 0:n.overlay)?n.overlay:"-"})]}),Object(h.jsxs)(Ee.a,{component:"div",variant:"subtitle2",gutterBottom:!0,children:[Object(h.jsx)(Ee.a,{component:"div",onClick:function(){return O(!b)},children:Object(h.jsxs)(Te.a,{color:"primary",style:{padding:0,marginTop:"6px"},children:[b?Object(h.jsx)(Mt.a,{style:{fontSize:"12px"}}):Object(h.jsx)(Wt.a,{style:{fontSize:"12px"}}),Object(h.jsx)("span",{children:"Underlay Addresses"})]})}),b&&Object(h.jsx)("div",{children:null===n||void 0===n?void 0:n.underlay.map((function(e){return Object(h.jsx)("li",{children:e},e)}))})]})]})]})]})})},_t=n(622),Ut=Object(v.a)((function(){return Object(y.a)({root:{display:"flex",alignItems:"center",justifyContent:"space-around",flexWrap:"wrap"},details:{display:"flex",flexDirection:"column"},content:{flex:"1 0 auto"}})}));var Zt=function(e){var t,n,a=Ut();return Object(h.jsxs)(qt.a,{className:a.root,children:[e.isLoadingNodeAddresses?Object(h.jsxs)("div",{style:{padding:"16px"},children:[Object(h.jsx)(_t.a,{width:300,height:30,animation:"wave"}),Object(h.jsx)(_t.a,{width:300,height:50,animation:"wave"})]}):Object(h.jsx)("div",{className:a.details,children:Object(h.jsxs)(Ft.a,{className:a.content,children:[Object(h.jsx)(Ee.a,{variant:"subtitle1",gutterBottom:!0,children:"Ethereum Address"}),Object(h.jsx)(ft,{address:null===(t=e.nodeAddresses)||void 0===t?void 0:t.ethereum})]})}),e.isLoadingChequebookAddress?Object(h.jsxs)("div",{style:{padding:"16px"},children:[Object(h.jsx)(_t.a,{width:300,height:30,animation:"wave"}),Object(h.jsx)(_t.a,{width:300,height:50,animation:"wave"})]}):Object(h.jsx)("div",{className:a.details,children:Object(h.jsxs)(Ft.a,{className:a.content,children:[Object(h.jsx)(Ee.a,{variant:"subtitle1",gutterBottom:!0,children:"Chequebook Contract Address"}),Object(h.jsx)(ft,{address:null===(n=e.chequebookAddress)||void 0===n?void 0:n.chequebookAddress})]})})]})},Vt=Object(v.a)((function(e){return Object(y.a)({root:{width:"100%",display:"grid",rowGap:e.spacing(3)}})}));function Gt(){var e=Vt(),t=te(),n=function(){var e=Y(),t=e.isLoadingNodeAddresses,n=e.nodeAddresses;return{isLoading:t,isOk:Boolean(null===n||void 0===n?void 0:n.ethereum),nodeAddresses:n}}(),a=function(){var e=G(),t=e.isLoadingNodeHealth,n=e.nodeHealth;return{isLoading:t,isOk:Boolean("ok"===(null===n||void 0===n?void 0:n.status))}}(),i=function(){var e=V();return{isLoading:e.isLoadingHealth,isOk:e.health}}(),r=function(){var e=K(),t=e.topology;return{isLoading:e.isLoading,isOk:Boolean((null===t||void 0===t?void 0:t.connected)&&(null===t||void 0===t?void 0:t.connected)>0),topology:t}}(),c=function(){var e=J(),t=e.chequebookAddress,n=e.isLoadingChequebookAddress,a=X(),i=a.chequebookBalance,r=a.isLoadingChequebookBalance;return{isLoading:n||r,isOk:Boolean(null===t||void 0===t?void 0:t.chequebookAddress)&&null!==i&&(null===i||void 0===i?void 0:i.totalBalance.toBigNumber.isGreaterThan(0)),chequebookBalance:i,chequebookAddress:t}}(),s=[t,n,a,i,r,c];return s.every((function(e){return!e.isLoading}))?Object(h.jsxs)("div",{className:e.root,children:[Object(h.jsx)(Ht,{userBeeVersion:t.userVersion,isLatestBeeVersion:t.isLatestBeeVersion,isOk:s.every((function(e){return e.isOk})),nodeTopology:r.topology,latestUrl:t.latestUrl,nodeAddresses:n.nodeAddresses}),n.nodeAddresses&&c.chequebookAddress&&Object(h.jsx)(Zt,{nodeAddresses:n.nodeAddresses,isLoadingNodeAddresses:n.isLoading,chequebookAddress:c.chequebookAddress,isLoadingChequebookAddress:c.isLoading}),Object(h.jsx)(Dt,{nodeVersion:t,ethereumConnection:n,debugApiConnection:a,apiConnection:i,topology:r,chequebook:c})]}):Object(h.jsx)(Ae.a,{style:{textAlign:"center",padding:"50px"},children:Object(h.jsx)(Ie.a,{})})}var Yt=Object(v.a)({root:{flexGrow:1,marginTop:"20px"},title:{textAlign:"center",fontSize:26}});function Kt(){var e=Yt();return Object(h.jsx)(qt.a,{className:e.root,children:Object(h.jsxs)(Ft.a,{children:[Object(h.jsx)(Ee.a,{className:e.title,gutterBottom:!0,children:"Looks like your node is not connected"}),Object(h.jsx)("div",{style:{marginBottom:"20px",textAlign:"center"},children:Object(h.jsxs)("strong",{children:[Object(h.jsx)(o.b,{to:"/",children:"Click to run status checks"})," on your nodes connection or check out the"," ",Object(h.jsx)("a",{href:"https://docs.ethswarm.org/docs/",target:"_blank",rel:"noreferrer",children:"Swarm Bee Docs"})]})}),Object(h.jsx)("div",{style:{marginBottom:"20px",textAlign:"center"},children:Object(h.jsxs)("p",{style:{marginTop:"50px"},children:["Still not working? Drop us a message on the Ethereum Swarm"," ",Object(h.jsx)("a",{href:"https://discord.gg/eKr9XPv7",target:"_blank",rel:"noreferrer",children:"Discord"})]})})]})})}var Jt=n(220),Xt=n(623),$t=Object(v.a)((function(e){return Object(y.a)({root:{padding:e.spacing(.25),display:"flex",alignItems:"center"},input:{marginLeft:e.spacing(1),flex:1},iconButton:{padding:10},divider:{height:28,margin:4}})}));function Qt(){var e=$t(),t=Object(a.useState)(""),n=Object(s.a)(t,2),i=n[0],r=n[1],c=Object(a.useState)(null),o=Object(s.a)(c,2),l=o[0],d=o[1];return Object(h.jsxs)(h.Fragment,{children:[Object(h.jsxs)(Pe.a,{className:e.root,children:[Object(h.jsx)(Jt.a,{className:e.input,placeholder:"Enter swarm reference e.g. 0773a91efd6547c754fc1d95fb1c62c7d1b47f959c2caa685dfec8736da95c1c",inputProps:{"aria-label":"retrieve file from swarm"},value:i,onChange:function(e){r(e.target.value),N.Utils.Hex.isHexString(e.target.value,64)||N.Utils.Hex.isHexString(e.target.value,128)?d(null):d(new Error("Incorrect format of swarm hash"))}}),Object(h.jsx)(B.a,{href:"".concat(A,"/bzz/").concat(i),target:"_blank",disabled:null!==l||!i,className:e.iconButton,"aria-label":"download",children:Object(h.jsx)(Xt.a,{})})]}),l&&Object(h.jsx)(Nt.a,{error:!0,children:l.message})]})}var en=n(641),tn=n(208),nn=Object(v.a)((function(e){return Object(y.a)({root:{width:"100%",marginTop:e.spacing(2),marginBottom:e.spacing(2)}})}));function an(e){var t=nn(),n=e.file.size>=1e8;return Object(h.jsx)(S.a,{in:n,children:Object(h.jsx)("div",{className:t.root,children:Object(h.jsxs)(w.a,{severity:"warning",children:[Object(h.jsx)(k.a,{children:"Warning"}),"The file you are trying to upload is above the recommended size. The chunks may not be synchronised properly over the network."]})})})}function rn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return"".concat(e.substring(0,t),"...").concat(e.substring(e.length-n,e.length))}function cn(e){var t=e.peerId,n=e.characterLength;return Object(h.jsx)(Ee.a,{variant:"button",style:{fontFamily:"monospace, monospace"},children:rn(t,n,n)})}var sn={stamps:null,error:null,isLoading:!1,lastUpdate:null,start:function(){},stop:function(){},refresh:function(){return Promise.reject()}},on=Object(a.createContext)(sn);on.Consumer;function ln(e){var t=e.depth,n=e.bucketDepth,a=e.utilization/Math.pow(2,t-n),i="".concat(Math.ceil(100*a),"%");return Object(b.a)(Object(b.a)({},e),{},{usage:a,usageText:i})}function dn(e){var t=e.children,n=Object(a.useState)(sn.stamps),i=Object(s.a)(n,2),r=i[0],c=i[1],o=Object(a.useState)(sn.error),l=Object(s.a)(o,2),d=l[0],u=l[1],j=Object(a.useState)(sn.isLoading),b=Object(s.a)(j,2),O=b[0],x=b[1],p=Object(a.useState)(sn.lastUpdate),g=Object(s.a)(p,2),m=g[0],f=g[1],v=Object(a.useState)(null),y=Object(s.a)(v,2),w=y[0],k=y[1],S=function(){var e=Object(kt.a)(wt.a.mark((function e(){var t;return wt.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!O){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,x(!0),e.next=6,q.getPostageStamps();case 6:t=e.sent,c(t.map(ln)),f(Date.now()),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(2),u(e.t0);case 14:return e.prev=14,x(!1),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[2,11,14,17]])})));return function(){return e.apply(this,arguments)}}();return Object(a.useEffect)((function(){if(S(),w){var e=setInterval(S,w);return function(){return clearInterval(e)}}}),[w]),Object(h.jsx)(on.Provider,{value:{stamps:r,error:d,isLoading:O,lastUpdate:m,start:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e4;return k(e)},stop:function(){return k(null)},refresh:S},children:t})}var un=n(47),jn=n(130),bn={depth:"",amount:"",label:""},hn=Object(v.a)((function(e){return Object(y.a)({wrapper:{margin:e.spacing(1),position:"relative"},field:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},buttonProgress:{position:"absolute",top:"50%",left:"50%",marginTop:-12,marginBottom:-12}})}));function On(e){var t=e.label,n=hn(),r=i.a.useState(!1),c=Object(s.a)(r,2),o=c[0],l=c[1],d=Object(a.useContext)(on).refresh,j=function(){return l(!0)},b=function(){return l(!1)},O=Object(u.b)().enqueueSnackbar;return Object(h.jsx)(un.c,{initialValues:bn,onSubmit:function(){var e=Object(kt.a)(wt.a.mark((function e(t,n){var a,i,r;return wt.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,t.depth&&t.amount){e.next=3;break}return e.abrupt("return");case 3:return a=BigInt(t.amount),i=Number.parseInt(t.depth),r=t.label?{label:t.label}:void 0,e.next=8,q.buyPostageStamp(a,i,r);case 8:return n.resetForm(),e.next=11,d();case 11:b(),e.next=18;break;case 14:e.prev=14,e.t0=e.catch(0),O("Error: ".concat(e.t0.message),{variant:"error"}),n.setSubmitting(!1);case 18:case"end":return e.stop()}}),e,null,[[0,14]])})));return function(t,n){return e.apply(this,arguments)}}(),validate:function(e){var t={};if(e.depth){var n=new z.a(e.depth);n.isInteger()?n.isLessThan(16)?t.depth="Minimal depth is 16":n.isGreaterThan(255)&&(t.depth="Depth has to be at most 255"):t.depth="Depth must be an integer"}else t.depth="Required field";if(e.amount){var a=new z.a(e.amount);a.isInteger()?a.isLessThanOrEqualTo(0)&&(t.amount="Amount must be greater than 0"):t.amount="Amount must be an integer"}else t.amount="Required field";return e.label&&!/^[0-9a-z]*$/i.test(e.label)&&(t.label="Label must be an alphanumeric string"),t},children:function(e){var a=e.submitForm,i=e.isValid,r=e.isSubmitting,c=e.values;return Object(h.jsxs)(un.b,{children:[Object(h.jsxs)(Te.a,{variant:"outlined",color:"primary",onClick:j,children:[t||"Buy Postage Stamp",r&&Object(h.jsx)(Ie.a,{size:24,className:n.buttonProgress})]}),Object(h.jsxs)(ut.a,{open:o,onClose:b,"aria-labelledby":"form-dialog-title",children:[Object(h.jsx)(jt.a,{id:"form-dialog-title",children:"Purchase new postage stamp"}),Object(h.jsxs)(Lt.a,{children:[Object(h.jsxs)(Ct.a,{children:["Provide the depth, amount and optionally the label of the postage stamp. Please refer to the"," ",Object(h.jsx)("a",{href:"https://docs.ethswarm.org/docs/access-the-swarm/keep-your-data-alive",target:"blank",children:"official bee docs"})," ","to understand these values."]}),Object(h.jsx)(un.a,{component:jn.a,required:!0,name:"depth",autoFocus:!0,label:"Depth",fullWidth:!0,className:n.field}),Object(h.jsx)(un.a,{component:jn.a,required:!0,name:"amount",label:"Amount",fullWidth:!0,className:n.field}),Object(h.jsx)(un.a,{component:jn.a,name:"label",label:"Label",fullWidth:!0,className:n.field})]}),Object(h.jsxs)(Bt.a,{children:[Object(h.jsx)(Te.a,{onClick:b,color:"primary",children:"Cancel"}),Object(h.jsx)("div",{className:n.wrapper,children:Object(h.jsxs)(Te.a,{color:"primary",disabled:r||!i||!c.amount||!c.depth,type:"submit",variant:"contained",onClick:a,children:["Create",r&&Object(h.jsx)(Ie.a,{size:24,className:n.buttonProgress})]})})]})]})]})}})}var xn=n(210),pn=n(625);function gn(e){var t=e.stamps,n=e.selectedStamp,a=e.setSelected,r=i.a.useState(null),c=Object(s.a)(r,2),o=c[0],l=c[1];if(!t)return null;var d=function(){return l(null)};return Object(h.jsxs)("div",{children:[Object(h.jsx)(Te.a,{"aria-controls":"simple-menu","aria-haspopup":"true",onClick:function(e){l(e.currentTarget)},children:"Change"}),Object(h.jsx)(xn.a,{id:"simple-menu",anchorEl:o,keepMounted:!0,open:Boolean(o),onClose:d,children:t.map((function(e){return Object(h.jsxs)(pn.a,{onClick:function(){a(e),d()},selected:e.batchID===(null===n||void 0===n?void 0:n.batchID),children:[Object(h.jsx)(se.a,{children:e.usageText}),Object(h.jsx)(cn,{peerId:e.batchID})]},e.batchID)}))})]})}function mn(){var e=Object(a.useState)(0),t=Object(s.a)(e,2),n=t[0],i=t[1],r=Object(a.useState)(null),c=Object(s.a)(r,2),o=c[0],l=c[1],d=Object(a.useState)(""),j=Object(s.a)(d,2),b=j[0],O=j[1],x=Object(a.useState)(!1),p=Object(s.a)(x,2),g=p[0],m=p[1],f=Object(a.useState)(null),v=Object(s.a)(f,2),y=v[0],w=v[1],k=Object(a.useContext)(on),S=k.isLoading,B=k.error,L=k.stamps,C=Object(u.b)().enqueueSnackbar;Object(a.useEffect)((function(){if(!y&&L&&L.length>0){var e=L.reduce((function(e,t){return t.usage<e.usage?t:e}),L[0]);w(e)}}),[S,B,L,y]);return Object(h.jsx)("div",{children:Object(h.jsxs)("div",{children:[Object(h.jsx)(tn.a,{onChange:function(e){e&&l(e[0])},filesLimit:1,maxFileSize:1e9},"dropzone-"+n),Object(h.jsxs)("div",{style:{marginTop:"15px"},children:[y&&Object(h.jsxs)("div",{style:{display:"flex"},children:[Object(h.jsxs)("small",{children:["with Postage Stamp"," ",Object(h.jsx)(Rt.a,{avatar:Object(h.jsx)(en.a,{children:y.usageText}),label:Object(h.jsx)(cn,{peerId:y.batchID,characterLength:6}),deleteIcon:Object(h.jsx)(pt,{value:y.batchID}),onDelete:function(){},variant:"outlined"})]}),Object(h.jsx)(gn,{stamps:L,selectedStamp:y,setSelected:w})]}),!y&&Object(h.jsx)(On,{}),Object(h.jsx)(Te.a,{disabled:!o&&g&&!y,onClick:function(){null!==o&&null!==y&&(m(!0),D.uploadFile(y.batchID,o).then((function(e){window.setTimeout((function(){l(null),O(e),i(n+1)}),0)})).catch((function(e){return C("Error uploading: ".concat(e.message),{variant:"error"})})).finally((function(){m(!1)})))},children:"Upload"}),o&&Object(h.jsx)(an,{file:o}),g&&Object(h.jsx)(Ae.a,{style:{textAlign:"center",padding:"50px"},children:Object(h.jsx)(Ie.a,{})}),b&&Object(h.jsxs)("div",{style:{marginBottom:"15px",display:"flex"},children:[Object(h.jsx)("span",{children:b}),Object(h.jsx)(pt,{value:b})]})]})]})})}function fn(e){var t=e.children,n=e.value,a=e.index,i=Object(Xe.a)(e,["children","value","index"]);return Object(h.jsx)("div",Object(b.a)(Object(b.a)({role:"tabpanel",hidden:n!==a,id:"simple-tabpanel-".concat(a),"aria-labelledby":"simple-tab-".concat(a)},i),{},{children:n===a&&Object(h.jsx)(Qe.a,{p:3,children:Object(h.jsx)(Ee.a,{children:t})})}))}var vn=Object(v.a)((function(){return{root:{flexGrow:1}}}));function yn(e){var t=e.values,n=vn(),a=i.a.useState(0),r=Object(s.a)(a,2),c=r[0],o=r[1];return Object(h.jsxs)("div",{className:n.root,children:[Object(h.jsx)(et.a,{value:c,onChange:function(e,t){o(t)},"aria-label":"simple tabs example",children:t.map((function(e,t){var n=e.label;return Object(h.jsx)(tt.a,{label:n},t)}))}),t.map((function(e,t){var n=e.component;return Object(h.jsx)(fn,{value:c,index:t,children:n},t)}))]})}function wn(){var e=V(),t=e.health,n=e.isLoadingHealth,a=G(),i=a.nodeHealth,r=a.isLoadingNodeHealth;return n||r?Object(h.jsx)(Ae.a,{style:{textAlign:"center",padding:"50px"},children:Object(h.jsx)(Ie.a,{})}):t&&"ok"===(null===i||void 0===i?void 0:i.status)?Object(h.jsx)(Ae.a,{maxWidth:"sm",children:Object(h.jsx)(yn,{values:[{label:"download",component:Object(h.jsx)(Qt,{})},{label:"upload",component:Object(h.jsx)(mn,{})}]})}):Object(h.jsx)(Kt,{})}var kn=n(131),Sn=n(626),Bn=n(627),Ln=n(628),Cn=n(629),Nn=n(630),An=n(631),In=n(642),Pn=Object(v.a)({table:{minWidth:650}});var En=function(e){var t=Pn(),n=Object(a.useState)([{peerId:"",rtt:"",loading:!1}]),i=Object(s.a)(n,2),r=i[0],c=i[1];return e.isLoading?Object(h.jsx)(Ae.a,{style:{textAlign:"center",padding:"50px"},children:Object(h.jsx)(Ie.a,{})}):e.error||null===e.peers?Object(h.jsx)(Ae.a,{style:{textAlign:"center",padding:"50px"},children:Object(h.jsx)("p",{children:"Failed to load peers"})}):Object(h.jsx)("div",{children:Object(h.jsx)(Sn.a,{component:Pe.a,children:Object(h.jsxs)(Bn.a,{className:t.table,"aria-label":"simple table",children:[Object(h.jsx)(Ln.a,{children:Object(h.jsxs)(Cn.a,{children:[Object(h.jsx)(Nn.a,{children:"Index"}),Object(h.jsx)(Nn.a,{children:"Peer Id"}),Object(h.jsx)(Nn.a,{align:"right",children:"Actions"})]})}),Object(h.jsx)(An.a,{children:e.peers.map((function(e,t){return Object(h.jsxs)(Cn.a,{children:[Object(h.jsx)(Nn.a,{component:"th",scope:"row",children:t+1}),Object(h.jsx)(Nn.a,{children:e.address}),Object(h.jsx)(Nn.a,{align:"right",children:Object(h.jsx)(In.a,{title:"Ping node",children:Object(h.jsx)(Te.a,{color:"primary",onClick:function(){return t=e.address,c([].concat(Object(kn.a)(r),[{peerId:t,rtt:"",loading:!0}])),void F.connectivity.ping(t).then((function(e){c([].concat(Object(kn.a)(r),[{peerId:t,rtt:e.rtt,loading:!1}]))})).catch((function(){c([].concat(Object(kn.a)(r),[{peerId:t,rtt:"error",loading:!1}]))}));var t},children:r.find((function(t){return t.peerId===e.address}))?r.filter((function(t){return t.peerId===e.address}))[0].loading?Object(h.jsx)(Ie.a,{size:20}):r.filter((function(t){return t.peerId===e.address}))[0].rtt:Object(h.jsx)(ze.a,{})})})})]},e.address)}))})]})})})},Tn=n(624),Dn=Object(v.a)({root:{minWidth:275},title:{fontSize:16},pos:{marginBottom:12}});function qn(e){var t=e.loading,n=e.label,a=e.statistic,i=Dn();return Object(h.jsx)(qt.a,{className:i.root,children:Object(h.jsxs)(Ft.a,{children:[t&&Object(h.jsxs)(h.Fragment,{children:[Object(h.jsx)(_t.a,{width:180,height:25,animation:"wave"}),Object(h.jsx)(_t.a,{width:180,height:35,animation:"wave"})]}),!t&&Object(h.jsxs)(h.Fragment,{children:[Object(h.jsx)(Ee.a,{className:i.title,color:"textSecondary",gutterBottom:!0,children:n}),Object(h.jsx)(Ee.a,{variant:"h5",component:"h2",children:a})]})]})})}var Fn=function(e){var t=e.isLoading,n=e.topology;return Object(h.jsx)(Tn.a,{style:{marginBottom:"20px",flexGrow:1},children:Object(h.jsxs)(Tn.a,{container:!0,spacing:3,children:[Object(h.jsx)(Tn.a,{item:!0,xs:12,sm:12,md:6,lg:4,xl:4,children:Object(h.jsx)(qn,{label:"Connected Peers",statistic:null===n||void 0===n?void 0:n.connected.toString(),loading:t})},1),Object(h.jsx)(Tn.a,{item:!0,xs:12,sm:12,md:6,lg:4,xl:4,children:Object(h.jsx)(qn,{label:"Population",statistic:null===n||void 0===n?void 0:n.population.toString(),loading:t})},2),Object(h.jsx)(Tn.a,{item:!0,xs:12,sm:12,md:6,lg:4,xl:4,children:Object(h.jsx)(qn,{label:"Depth",statistic:null===n||void 0===n?void 0:n.depth.toString(),loading:t})},3)]})})};function Rn(){var e=K(),t=G(),n=function(){var e=Object(a.useState)(null),t=Object(s.a)(e,2),n=t[0],i=t[1],r=Object(a.useState)(!0),c=Object(s.a)(r,2),o=c[0],l=c[1],d=Object(a.useState)(null),u=Object(s.a)(d,2),j=u[0],b=u[1];return Object(a.useEffect)((function(){l(!0),F.connectivity.listPeers().then((function(e){i(e)})).catch((function(e){b(e)})).finally((function(){l(!1)}))}),[]),{peers:n,isLoading:o,error:j}}();return t.isLoadingNodeHealth?Object(h.jsx)(Ae.a,{style:{textAlign:"center",padding:"50px"},children:Object(h.jsx)(Ie.a,{})}):t.error?Object(h.jsx)(Kt,{}):Object(h.jsxs)(h.Fragment,{children:[Object(h.jsx)(Fn,Object(b.a)({},e)),Object(h.jsx)(En,Object(b.a)({},n))]})}function Mn(){return Object(h.jsx)(At,{successMessage:"Successful withdrawl.",errorMessage:"Error with withdrawing.",dialogMessage:"Specify the amount of BZZ you would like to withdraw from your node.",label:"Withdraw",min:new W.BigNumber(0),action:F.chequebook.withdraw})}var Wn=Object(v.a)((function(e){return Object(y.a)({root:{display:"flex"},buttons:{display:"flex",columnGap:e.spacing(1)},gridContainer:{display:"flex",width:"100%",marginLeft:e.spacing(1),marginRight:e.spacing(1),columnGap:e.spacing(1),rowGap:e.spacing(1),flex:"0 1 auto",flexWrap:"wrap",justifyContent:"space-between"},chequebookActions:{justifyContent:"space-between",display:"flex",marginBottom:e.spacing(1)}})}));var zn=function(e){var t=e.totalreceived,n=e.totalsent,a=e.chequebookBalance,i=e.isLoading,r=Wn();return Object(h.jsxs)("div",{children:[Object(h.jsxs)("div",{className:r.chequebookActions,children:[Object(h.jsx)(Ee.a,{component:"h2",variant:"h6",children:"Chequebook"}),Object(h.jsxs)("div",{className:r.buttons,children:[Object(h.jsx)(Mn,{}),Object(h.jsx)(It,{})]})]}),Object(h.jsxs)(qt.a,{className:r.root,children:[!i&&Object(h.jsxs)(Ft.a,{className:r.gridContainer,children:[Object(h.jsxs)("div",{children:[Object(h.jsx)(Ee.a,{component:"h2",variant:"h6",color:"primary",gutterBottom:!0,children:"Total Balance"}),Object(h.jsxs)(Ee.a,{variant:"h5",children:[null===a||void 0===a?void 0:a.totalBalance.toFixedDecimal()," BZZ"]})]}),Object(h.jsxs)("div",{children:[Object(h.jsx)(Ee.a,{component:"h2",variant:"h6",color:"primary",gutterBottom:!0,children:"Available Uncommitted Balance"}),Object(h.jsxs)(Ee.a,{variant:"h5",children:[null===a||void 0===a?void 0:a.availableBalance.toFixedDecimal()," BZZ"]})]}),Object(h.jsxs)("div",{children:[Object(h.jsx)(Ee.a,{component:"h2",variant:"h6",color:"primary",gutterBottom:!0,children:"Total Sent / Received"}),Object(h.jsxs)(Ee.a,{variant:"h5",children:[n.toFixedDecimal()," / ",t.toFixedDecimal()," BZZ"]})]})]}),i&&Object(h.jsxs)("div",{className:r.gridContainer,children:[Object(h.jsx)(_t.a,{width:180,height:110,animation:"wave"}),Object(h.jsx)(_t.a,{width:180,height:110,animation:"wave"}),Object(h.jsx)(_t.a,{width:180,height:110,animation:"wave"})]})]})]})};function Hn(e){var t=e.peerId,n=e.uncashedAmount,i=Object(a.useState)(!1),r=Object(s.a)(i,2),c=r[0],o=r[1],l=Object(a.useState)(!1),d=Object(s.a)(l,2),j=d[0],b=d[1],O=Object(u.b)().enqueueSnackbar,x=function(){o(!1)};return Object(h.jsxs)("div",{children:[Object(h.jsx)(Te.a,{variant:"contained",color:"primary",onClick:function(){o(!0)},style:{marginLeft:"7px"},children:"Cashout"}),Object(h.jsxs)(ut.a,{open:c,onClose:x,"aria-labelledby":"form-dialog-title",children:[Object(h.jsx)(jt.a,{id:"form-dialog-title",children:"Cashout Cheque"}),Object(h.jsx)(Lt.a,{children:Object(h.jsxs)(Ct.a,{style:{marginTop:"20px",overflowWrap:"break-word"},children:[j&&Object(h.jsxs)(h.Fragment,{children:[Object(h.jsxs)("span",{children:["Cashing out ",Object(h.jsx)("strong",{children:n})," from Peer ",Object(h.jsx)("strong",{children:t}),". Please wait..."]}),Object(h.jsx)(Ae.a,{style:{textAlign:"center",padding:"50px"},children:Object(h.jsx)(Ie.a,{})})]}),!j&&Object(h.jsxs)("span",{children:["Are you sure you want to cashout ",Object(h.jsxs)("strong",{children:[n," BZZ"]})," from Peer"," ",Object(h.jsx)("strong",{children:t}),"?"]})]})}),Object(h.jsxs)(Bt.a,{children:[Object(h.jsx)(Te.a,{onClick:x,color:"primary",children:"Cancel"}),Object(h.jsx)(Te.a,{onClick:function(){t?(b(!0),F.chequebook.peerCashout(t).then((function(e){o(!1),O(Object(h.jsxs)("span",{children:["Successfully cashed out cheque. Transaction",Object(h.jsx)(ft,{hideBlockie:!0,transaction:!0,address:e})]}),{variant:"success"})})).catch((function(e){O(Object(h.jsxs)("span",{children:["Error: ",e.message]}),{variant:"error"})})).finally((function(){b(!1)}))):O(Object(h.jsx)("span",{children:"Peer Id invalid"}),{variant:"error"})},color:"primary",disabled:j,children:"Yes Cashout"})]})]})]})}var _n=Object(v.a)({table:{minWidth:650},values:{textAlign:"right",fontFamily:"monospace, monospace"}});var Un=function(e){var t=e.accounting,n=e.isLoadingUncashed;if(null===t)return null;var a=_n();return Object(h.jsx)(Sn.a,{component:Pe.a,children:Object(h.jsxs)(Bn.a,{className:a.table,size:"small","aria-label":"Balances Table",children:[Object(h.jsx)(Ln.a,{children:Object(h.jsxs)(Cn.a,{children:[Object(h.jsx)(Nn.a,{children:"Peer"}),Object(h.jsx)(Nn.a,{align:"right",children:"Outstanding Balance"}),Object(h.jsx)(Nn.a,{align:"right",children:"Settlements Sent / Received"}),Object(h.jsx)(Nn.a,{align:"right",children:"Total"}),Object(h.jsx)(Nn.a,{align:"right",children:"Uncashed Amount"}),Object(h.jsx)(Nn.a,{})]})}),Object(h.jsx)(An.a,{children:t.map((function(e){var t=e.peer,i=e.balance,r=e.received,c=e.sent,s=e.uncashedAmount,o=e.total;return Object(h.jsxs)(Cn.a,{children:[Object(h.jsx)(Nn.a,{children:Object(h.jsxs)("div",{style:{display:"flex"},children:[Object(h.jsx)("small",{children:Object(h.jsx)(cn,{peerId:t})}),Object(h.jsx)(pt,{value:t})]})}),Object(h.jsxs)(Nn.a,{className:a.values,children:[Object(h.jsx)("span",{style:{color:i.toBigNumber.isPositive()?"#32c48d":"#c9201f"},children:i.toFixedDecimal()})," ","BZZ"]}),Object(h.jsxs)(Nn.a,{className:a.values,children:["-",c.toFixedDecimal()," / ",r.toFixedDecimal()," BZZ"]}),Object(h.jsxs)(Nn.a,{className:a.values,children:[Object(h.jsx)("span",{style:{color:o.toBigNumber.isPositive()?"#32c48d":"#c9201f"},children:o.toFixedDecimal()})," ","BZZ"]}),Object(h.jsxs)(Nn.a,{className:a.values,children:[n&&"loading...",!n&&Object(h.jsxs)(h.Fragment,{children:[s.toBigNumber.isGreaterThan("0")?s.toFixedDecimal():"0"," BZZ"]})]}),Object(h.jsx)(Nn.a,{className:a.values,children:s.toBigNumber.isGreaterThan("0")&&Object(h.jsx)(Hn,{uncashedAmount:s.toFixedDecimal(),peerId:t})})]},t)}))})]})})};var Zn=function(){var e,t,n,i=function(){var e=Object(a.useState)(null),t=Object(s.a)(e,2),n=t[0],i=t[1],r=Object(a.useState)(!0),c=Object(s.a)(r,2),o=c[0],l=c[1],d=Object(a.useState)(null),u=Object(s.a)(d,2),j=u[0],b=u[1];return Object(a.useEffect)((function(){l(!0),F.settlements.getSettlements().then((function(e){var t=e.totalReceived,n=e.settlements,a=e.totalSent,r={totalReceived:new Z(t),totalSent:new Z(a),settlements:n.map((function(e){var t=e.peer,n=e.received,a=e.sent;return{peer:t,received:new Z(n),sent:new Z(a)}}))};i(r)})).catch((function(e){b(e)})).finally((function(){l(!1)}))}),[]),{settlements:n,isLoadingSettlements:o,error:j}}(),r=function(){var e=Object(a.useState)(null),t=Object(s.a)(e,2),n=t[0],i=t[1],r=Object(a.useState)(!0),c=Object(s.a)(r,2),o=c[0],l=c[1],d=Object(a.useState)(null),u=Object(s.a)(d,2),j=u[0],b=u[1];return Object(a.useEffect)((function(){l(!0),F.balance.balances().then((function(e){var t=e.balances.map((function(e){var t=e.peer,n=e.balance;return{peer:t,balance:new Z(n)}}));i(t)})).catch((function(e){b(e)})).finally((function(){l(!1)}))}),[]),{peerBalances:n,isLoadingPeerBalances:o,error:j}}(),c=Object(a.useState)(null),o=Object(s.a)(c,2),l=o[0],d=o[1],u=Object(a.useState)(!1),j=Object(s.a)(u,2),h=j[0],O=j[1],x=Object(a.useState)(void 0),p=Object(s.a)(x,2),g=p[0],m=p[1],f=r.error||i.error||l;Object(a.useEffect)((function(){if(!h&&i.settlements&&!g&&!f){O(!0);var e=i.settlements.settlements.filter((function(e){return e.received.toBigNumber.gt("0")})).map((function(e){var t=e.peer;return F.chequebook.getPeerLastCashout(t)}));Promise.all(e).then(m).catch(d).finally((function(){return O(!1)}))}}),[i,h,g,f]);var v=function(e,t,n){if(!e||!t)return null;var a={};return e.forEach((function(e){var t=e.peer,n=e.balance;return a[t]={peer:t,balance:n,sent:new Z("0"),received:new Z("0"),uncashedAmount:new Z("0"),total:n}})),t.forEach((function(e){var t=e.peer,n=e.sent,i=e.received;return a[t]=Object(b.a)(Object(b.a)({},a[t]),{},{sent:n,received:i,total:new Z(a[t].balance.toBigNumber.plus(i.toBigNumber).minus(n.toBigNumber))})})),n?(null===n||void 0===n||n.forEach((function(e){var t=e.peer,n=e.uncashedAmount;a[t].uncashedAmount=new Z(n)})),Object.values(a).sort((function(e,t){return t.uncashedAmount.toBigNumber.minus(e.uncashedAmount.toBigNumber).toNumber()}))):Object.values(a)}(r.peerBalances,null===(e=i.settlements)||void 0===e?void 0:e.settlements,g);return{isLoading:i.isLoadingSettlements||r.isLoadingPeerBalances,isLoadingUncashed:h,error:f,accounting:v,totalsent:(null===(t=i.settlements)||void 0===t?void 0:t.totalSent)||new Z("0"),totalreceived:(null===(n=i.settlements)||void 0===n?void 0:n.totalReceived)||new Z("0")}},Vn=Object(v.a)((function(e){return Object(y.a)({root:{width:"100%",display:"grid",rowGap:e.spacing(3)}})}));function Gn(){var e=Vn(),t=J(),n=t.chequebookAddress,a=t.isLoadingChequebookAddress,i=X(),r=i.chequebookBalance,c=i.isLoadingChequebookBalance,s=Y(),o=s.nodeAddresses,l=s.isLoadingNodeAddresses,d=V(),u=d.health,j=d.isLoadingHealth,b=G(),O=b.nodeHealth,x=b.isLoadingNodeHealth,p=Zn(),g=p.isLoading,m=p.totalsent,f=p.totalreceived,v=p.accounting,y=p.isLoadingUncashed,w=p.error;return j||x?Object(h.jsx)(Ae.a,{style:{textAlign:"center",padding:"50px"},children:Object(h.jsx)(Ie.a,{})}):"ok"===(null===O||void 0===O?void 0:O.status)&&u?Object(h.jsxs)("div",{className:e.root,children:[Object(h.jsx)(zn,{chequebookAddress:n,isLoading:a||g||c,chequebookBalance:r,totalsent:m,totalreceived:f}),Object(h.jsx)(Zt,{nodeAddresses:o,isLoadingNodeAddresses:l,chequebookAddress:n,isLoadingChequebookAddress:a}),w&&Object(h.jsxs)(Ae.a,{style:{textAlign:"center",padding:"50px"},children:["Error loading accounting details: ",w.message]}),!w&&Object(h.jsx)(Un,{accounting:v,isLoadingUncashed:y})]}):Object(h.jsx)(Kt,{})}function Yn(){var e=Object(a.useState)(!1),t=Object(s.a)(e,2),n=t[0],i=t[1],r=Object(a.useState)(""),c=Object(s.a)(r,2),o=c[0],l=c[1],d=Object(a.useState)(""),u=Object(s.a)(d,2),j=u[0],b=u[1];return Object(h.jsx)("div",{children:Object(h.jsxs)(Ae.a,{children:[Object(h.jsx)(Ee.a,{variant:"h4",gutterBottom:!0,children:"Settings"}),Object(h.jsx)(Pe.a,{children:Object(h.jsx)(Ke.a,{label:"API Endpoint",style:{margin:0},placeholder:"ex: 127.0.0.0.1:1633",helperText:"Enter node host override / port",fullWidth:!0,defaultValue:sessionStorage.getItem("api_host")?sessionStorage.getItem("api_host"):"http://localhost:1633",margin:"normal",InputLabelProps:{shrink:!0},onChange:function(e){l(e.target.value),i(!0)},variant:"filled"})}),Object(h.jsx)(Pe.a,{style:{marginTop:"20px"},children:Object(h.jsx)(Ke.a,{label:"Debug API Endpoint",style:{margin:0},placeholder:"ex: 127.0.0.0.1:1635",helperText:"Enter node debug host override / port",fullWidth:!0,defaultValue:sessionStorage.getItem("debug_api_host")?sessionStorage.getItem("debug_api_host"):"http://localhost:1635",onChange:function(e){b(e.target.value),i(!0)},margin:"normal",InputLabelProps:{shrink:!0},variant:"filled"})}),n?Object(h.jsx)("div",{style:{marginTop:"20px"},children:Object(h.jsx)(Te.a,{variant:"outlined",color:"primary",onClick:function(){return o&&sessionStorage.setItem("api_host",o),j&&sessionStorage.setItem("debug_api_host",j),void((o||j)&&(i(!n),window.location.reload()))},children:"Save"})}):null]})})}var Kn=Object(v.a)({table:{minWidth:650},values:{textAlign:"right",fontFamily:"monospace, monospace"}});var Jn=function(e){var t=e.postageStamps;if(null===t)return null;var n=Kn();return Object(h.jsx)(Sn.a,{component:Pe.a,children:Object(h.jsxs)(Bn.a,{className:n.table,size:"small","aria-label":"Balances Table",children:[Object(h.jsx)(Ln.a,{children:Object(h.jsxs)(Cn.a,{children:[Object(h.jsx)(Nn.a,{children:"Batch ID"}),Object(h.jsx)(Nn.a,{align:"right",children:"Usage"})]})}),Object(h.jsx)(An.a,{children:t.map((function(e){var t=e.batchID,a=e.usageText;return Object(h.jsxs)(Cn.a,{children:[Object(h.jsx)(Nn.a,{children:Object(h.jsxs)("div",{style:{display:"flex"},children:[Object(h.jsx)("small",{children:Object(h.jsx)(cn,{peerId:t})}),Object(h.jsx)(pt,{value:t})]})}),Object(h.jsx)(Nn.a,{className:n.values,children:a})]},t)}))})]})})};function Xn(e){var t=e.date,n=Object(a.useState)("never"),i=Object(s.a)(n,2),r=i[0],c=i[1],o=function(){c(t?"".concat(((Date.now()-t)/1e3).toFixed()," seconds ago"):"never")};return Object(a.useEffect)((function(){o();var e=setInterval(o,1e3);return function(){return clearInterval(e)}}),[t]),Object(h.jsxs)("span",{children:["Last Update: ",r]})}var $n=Object(v.a)((function(e){return Object(y.a)({root:{width:"100%",display:"grid",rowGap:e.spacing(2)},actions:{display:"flex",width:"100%",columnGap:e.spacing(1),rowGap:e.spacing(1),flex:"0 1 auto",flexWrap:"wrap",alignItems:"center"}})}));function Qn(){var e=$n(),t=V(),n=t.health,i=t.isLoadingHealth,r=G(),c=r.nodeHealth,s=r.isLoadingNodeHealth,o=Object(a.useContext)(on),l=o.stamps,d=o.isLoading,u=o.error,j=o.lastUpdate,b=o.start,O=o.stop;return Object(a.useEffect)((function(){return b(),function(){return O()}}),[]),i||s?Object(h.jsx)(Ae.a,{style:{textAlign:"center",padding:"50px"},children:Object(h.jsx)(Ie.a,{})}):"ok"===(null===c||void 0===c?void 0:c.status)&&n?Object(h.jsxs)("div",{className:e.root,children:[u&&Object(h.jsxs)(Ae.a,{style:{textAlign:"center",padding:"50px"},children:["Error loading postage stamps details: ",u.message]}),!u&&Object(h.jsxs)(h.Fragment,{children:[Object(h.jsxs)("div",{className:e.actions,children:[Object(h.jsx)(On,{}),Object(h.jsx)(Xn,{date:j}),Object(h.jsx)("div",{style:{height:"5px"},children:d&&Object(h.jsx)(Ie.a,{})})]}),Object(h.jsx)(Jn,{postageStamps:l})]})]}):Object(h.jsx)(Kt,{})}var ea=function(){return Object(h.jsxs)(j.c,{children:[Object(h.jsx)(O,{exact:!0,path:"/",layout:Ne,component:Gt}),Object(h.jsx)(O,{exact:!0,path:"/files/",layout:Ne,component:wn}),Object(h.jsx)(O,{exact:!0,path:"/peers/",layout:Ne,component:Rn}),Object(h.jsx)(O,{exact:!0,path:"/accounting/",layout:Ne,component:Gn}),Object(h.jsx)(O,{exact:!0,path:"/settings/",layout:Ne,component:Yn}),Object(h.jsx)(O,{exact:!0,path:"/stamps/",layout:Ne,component:Qn})]})},ta=n(207),na=n(129),aa=function(e){return{MuiTab:{root:{backgroundColor:"transparent",fontWeight:e.typography.fontWeightRegular,marginRight:e.spacing(4),fontFamily:["-apple-system","BlinkMacSystemFont",'"Segoe UI"',"Roboto",'"Helvetica Neue"',"Arial","sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"'].join(","),"&:hover":{color:e.palette.secondary,opacity:1},"&$selected":{color:e.palette.secondary,fontWeight:e.typography.fontWeightMedium},"&:focus":{color:e.palette.secondary}}},MuiTabs:{root:{borderBottom:"none"},indicator:{backgroundColor:e.palette.primary.main}}}},ia={MuiTab:{disableRipple:!0}},ra=Object(ta.a)({palette:{type:"light",background:{default:"#fafafa"},primary:{light:na.a.A200,main:"#dd7700",dark:na.a[800]},secondary:{main:"#333333"}},typography:{fontFamily:["Work Sans","Montserrat","Nunito","Roboto",'"Helvetica Neue"',"Arial","sans-serif"].join(",")}}),ca=Object(ta.a)({palette:{type:"dark",background:{default:"#0d1117",paper:"#161b22"},primary:{light:na.a.A200,main:"#dd7700",dark:na.a[800]},secondary:{main:"#1f2937"}},typography:{fontFamily:["Work Sans","Montserrat","Nunito","Roboto",'"Helvetica Neue"',"Arial","sans-serif"].join(",")}});ca.overrides=aa(ca),ca.props=ia,ra.overrides=aa(ra),ra.props=ia;var sa=function(){var e=Object(a.useState)("light"),t=Object(s.a)(e,2),n=t[0],i=t[1];return Object(a.useEffect)((function(){var e,t,n,a;return localStorage.getItem("theme")?i(String(localStorage.getItem("theme"))):(null===(e=window)||void 0===e||null===(t=e.matchMedia("(prefers-color-scheme: dark)"))||void 0===t?void 0:t.matches)&&i("dark"),null===(n=window)||void 0===n||null===(a=n.matchMedia("(prefers-color-scheme: dark)"))||void 0===a||a.addEventListener("change",(function(e){i((null===e||void 0===e?void 0:e.matches)?"dark":"light")})),function(){var e,t;return null===(e=window)||void 0===e||null===(t=e.matchMedia("(prefers-color-scheme: dark)"))||void 0===t?void 0:t.removeEventListener("change",(function(e){i((null===e||void 0===e?void 0:e.matches)?"dark":"light")}))}}),[]),Object(h.jsx)("div",{className:"App",children:Object(h.jsx)(l.a,{theme:"light"===n?ra:ca,children:Object(h.jsx)(dn,{children:Object(h.jsx)(u.a,{children:Object(h.jsxs)(h.Fragment,{children:[Object(h.jsx)(d.a,{}),Object(h.jsx)(o.a,{children:Object(h.jsx)(ea,{})})]})})})})})},oa=function(e){e&&e instanceof Function&&n.e(3).then(n.bind(null,644)).then((function(t){var n=t.getCLS,a=t.getFID,i=t.getFCP,r=t.getLCP,c=t.getTTFB;n(e),a(e),i(e),r(e),c(e)}))};c.a.render(Object(h.jsx)(i.a.StrictMode,{children:Object(h.jsx)(sa,{})}),document.getElementById("root")),oa()}},[[519,1,2]]]);
2
- //# sourceMappingURL=main.e959d365.chunk.js.map