@ethersphere/bee-dashboard 0.8.0 → 0.11.2
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/CHANGELOG.md +43 -0
- package/README.md +10 -3
- package/build/asset-manifest.json +12 -12
- package/build/index.html +1 -1
- package/build/static/js/2.4ff98457.chunk.js +3 -0
- package/build/static/js/{2.ab1e4c48.chunk.js.LICENSE.txt → 2.4ff98457.chunk.js.LICENSE.txt} +13 -0
- package/build/static/js/2.4ff98457.chunk.js.map +1 -0
- package/build/static/js/3.11a1627e.chunk.js +2 -0
- package/build/static/js/3.11a1627e.chunk.js.map +1 -0
- package/build/static/js/main.83c3a1a6.chunk.js +2 -0
- package/build/static/js/main.83c3a1a6.chunk.js.map +1 -0
- package/build/static/js/{runtime-main.e4043ba2.js → runtime-main.6c2da3b6.js} +2 -2
- package/build/static/js/{runtime-main.e4043ba2.js.map → runtime-main.6c2da3b6.js.map} +1 -1
- package/lib/App.js +105277 -0
- package/lib/App.js.map +1 -0
- package/lib/assets/fonts/IBMPlexMono500.ttf +0 -0
- package/lib/assets/fonts/IBMPlexMono600.ttf +0 -0
- package/lib/assets/fonts/IBMPlexMonoregular.ttf +0 -0
- package/lib/assets/fonts/WorkSans-Italic-VariableFont_wght.ttf +0 -0
- package/lib/assets/fonts/WorkSans-VariableFont_wght.ttf +0 -0
- package/lib/assets/logo.svg +11 -0
- package/lib/src/App.d.ts +9 -0
- package/lib/src/App.test.d.ts +1 -0
- package/lib/src/components/AlertUploadSize.d.ts +6 -0
- package/lib/src/components/AlertVersion.d.ts +2 -0
- package/lib/src/components/Capacity.d.ts +7 -0
- package/lib/src/components/CashoutModal.d.ts +7 -0
- package/lib/src/components/ClipboardCopy.d.ts +6 -0
- package/lib/src/components/CodeBlock.d.ts +8 -0
- package/lib/src/components/CodeBlockTabs.d.ts +8 -0
- package/lib/src/components/ErrorBoundary.d.ts +16 -0
- package/lib/src/components/EthereumAddress.d.ts +9 -0
- package/lib/src/components/ExpandableElement.d.ts +8 -0
- package/lib/src/components/ExpandableList.d.ts +10 -0
- package/lib/src/components/ExpandableListItem.d.ts +8 -0
- package/lib/src/components/ExpandableListItemActions.d.ts +6 -0
- package/lib/src/components/ExpandableListItemInput.d.ts +16 -0
- package/lib/src/components/ExpandableListItemKey.d.ts +7 -0
- package/lib/src/components/ExpandableListItemLink.d.ts +10 -0
- package/lib/src/components/ExpandableListItemNote.d.ts +6 -0
- package/lib/src/components/FitImage.d.ts +9 -0
- package/lib/src/components/History.d.ts +8 -0
- package/lib/src/components/HistoryHeader.d.ts +6 -0
- package/lib/src/components/Loading.d.ts +2 -0
- package/lib/src/components/QRCodeModal.d.ts +7 -0
- package/lib/src/components/SideBar.d.ts +2 -0
- package/lib/src/components/SideBarItem.d.ts +9 -0
- package/lib/src/components/SideBarStatus.d.ts +6 -0
- package/lib/src/components/StatusIcon.d.ts +9 -0
- package/lib/src/components/StripedWrapper.d.ts +6 -0
- package/lib/src/components/SwarmButton.d.ts +12 -0
- package/lib/src/components/TabsContainer.d.ts +12 -0
- package/lib/src/components/TopologyStats.d.ts +7 -0
- package/lib/src/components/TroubleshootConnectionCard.d.ts +2 -0
- package/lib/src/components/WithdrawDepositModal.d.ts +14 -0
- package/lib/src/config.d.ts +11 -0
- package/lib/src/containers/DepositModal.d.ts +2 -0
- package/lib/src/containers/WithdrawModal.d.ts +2 -0
- package/lib/src/hooks/accounting.d.ts +18 -0
- package/lib/src/hooks/apiHooks.d.ts +6 -0
- package/lib/src/index.d.ts +1 -0
- package/lib/src/layout/Dashboard.d.ts +6 -0
- package/lib/src/models/Token.d.ts +25 -0
- package/lib/src/models/Token.test.d.ts +1 -0
- package/lib/src/pages/accounting/PeerBalances.d.ts +10 -0
- package/lib/src/pages/accounting/index.d.ts +2 -0
- package/lib/src/pages/files/AssetIcon.d.ts +6 -0
- package/lib/src/pages/files/AssetPreview.d.ts +8 -0
- package/lib/src/pages/files/AssetSummary.d.ts +6 -0
- package/lib/src/pages/files/Download.d.ts +2 -0
- package/lib/src/pages/files/DownloadActionBar.d.ts +10 -0
- package/lib/src/pages/files/FileNavigation.d.ts +6 -0
- package/lib/src/pages/files/SelectStamp.d.ts +9 -0
- package/lib/src/pages/files/Share.d.ts +7 -0
- package/lib/src/pages/files/StampPreview.d.ts +7 -0
- package/lib/src/pages/files/Upload.d.ts +2 -0
- package/lib/src/pages/files/UploadActionBar.d.ts +13 -0
- package/lib/src/pages/files/UploadArea.d.ts +6 -0
- package/lib/src/pages/files/UploadLander.d.ts +2 -0
- package/lib/src/pages/info/index.d.ts +2 -0
- package/lib/src/pages/settings/index.d.ts +2 -0
- package/lib/src/pages/stamps/CreatePostageStampModal.d.ts +6 -0
- package/lib/src/pages/stamps/PostageStamp.d.ts +8 -0
- package/lib/src/pages/stamps/SelectPostageStampModal.d.ts +9 -0
- package/lib/src/pages/stamps/StampsTable.d.ts +7 -0
- package/lib/src/pages/stamps/index.d.ts +2 -0
- package/lib/src/pages/status/SetupSteps/ChequebookDeployFund.d.ts +3 -0
- package/lib/src/pages/status/SetupSteps/DebugConnectionCheck.d.ts +2 -0
- package/lib/src/pages/status/SetupSteps/EthereumConnectionCheck.d.ts +2 -0
- package/lib/src/pages/status/SetupSteps/NodeConnectionCheck.d.ts +2 -0
- package/lib/src/pages/status/SetupSteps/PeerConnection.d.ts +2 -0
- package/lib/src/pages/status/SetupSteps/VersionCheck.d.ts +2 -0
- package/lib/src/pages/status/index.d.ts +2 -0
- package/lib/src/providers/Bee.d.ts +45 -0
- package/lib/src/providers/File.d.ts +13 -0
- package/lib/src/providers/Platform.d.ts +23 -0
- package/lib/src/providers/Settings.d.ts +21 -0
- package/lib/src/providers/Stamps.d.ts +22 -0
- package/lib/src/reportWebVitals.d.ts +3 -0
- package/lib/src/routes.d.ts +15 -0
- package/lib/src/setupTests.d.ts +1 -0
- package/lib/src/theme.d.ts +7 -0
- package/lib/src/types.d.ts +19 -0
- package/lib/src/utils/SwarmFile.d.ts +10 -0
- package/lib/src/utils/date.d.ts +1 -0
- package/lib/src/utils/file.d.ts +7 -0
- package/lib/src/utils/hash.d.ts +1 -0
- package/lib/src/utils/index.d.ts +52 -0
- package/lib/src/utils/local-storage.d.ts +12 -0
- package/lib/src/utils/threshold.d.ts +22 -0
- package/package.json +70 -39
- package/serve.js +0 -0
- package/build/static/js/2.ab1e4c48.chunk.js +0 -3
- package/build/static/js/2.ab1e4c48.chunk.js.map +0 -1
- package/build/static/js/3.ad8c73af.chunk.js +0 -2
- package/build/static/js/3.ad8c73af.chunk.js.map +0 -1
- package/build/static/js/main.105fda76.chunk.js +0 -2
- package/build/static/js/main.105fda76.chunk.js.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(this["webpackJsonp@ethersphere/bee-dashboard"]=this["webpackJsonp@ethersphere/bee-dashboard"]||[]).push([[3],{640:function(e,t,n){"use strict";n.r(t),n.d(t,"getCLS",(function(){return y})),n.d(t,"getFCP",(function(){return h})),n.d(t,"getFID",(function(){return C})),n.d(t,"getLCP",(function(){return k})),n.d(t,"getTTFB",(function(){return D}));var i,r,a,o,u=function(e,t){return{name:e,value:void 0===t?-1:t,delta:0,entries:[],id:"v2-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12)}},c=function(e,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){if("first-input"===e&&!("PerformanceEventTiming"in self))return;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)},m=function(e,t,n){var i;return function(r){t.value>=0&&(r||n)&&(t.delta=t.value-(i||0),(t.delta||void 0===i)&&(i=t.value,e(t)))}},d=-1,p=function(){return"hidden"===document.visibilityState?0:1/0},v=function(){s((function(e){var t=e.timeStamp;d=t}),!0)},l=function(){return d<0&&(d=p(),v(),f((function(){setTimeout((function(){d=p(),v()}),0)}))),{get firstHiddenTime(){return d}}},h=function(e,t){var n,i=l(),r=u("FCP"),a=function(e){"first-contentful-paint"===e.name&&(s&&s.disconnect(),e.startTime<i.firstHiddenTime&&(r.value=e.startTime,r.entries.push(e),n(!0)))},o=window.performance&&performance.getEntriesByName&&performance.getEntriesByName("first-contentful-paint")[0],s=o?null:c("paint",a);(o||s)&&(n=m(e,r,t),o&&a(o),f((function(i){r=u("FCP"),n=m(e,r,t),requestAnimationFrame((function(){requestAnimationFrame((function(){r.value=performance.now()-i.timeStamp,n(!0)}))}))})))},g=!1,T=-1,y=function(e,t){g||(h((function(e){T=e.value})),g=!0);var n,i=function(t){T>-1&&e(t)},r=u("CLS",0),a=0,o=[],d=function(e){if(!e.hadRecentInput){var t=o[0],i=o[o.length-1];a&&e.startTime-i.startTime<1e3&&e.startTime-t.startTime<5e3?(a+=e.value,o.push(e)):(a=e.value,o=[e]),a>r.value&&(r.value=a,r.entries=o,n())}},p=c("layout-shift",d);p&&(n=m(i,r,t),s((function(){p.takeRecords().map(d),n(!0)})),f((function(){a=0,T=-1,r=u("CLS",0),n=m(i,r,t)})))},E={passive:!0,capture:!0},w=new Date,L=function(e,t){i||(i=t,r=e,a=new Date,F(removeEventListener),S())},S=function(){if(r>=0&&r<a-w){var e={entryType:"first-input",name:i.type,target:i.target,cancelable:i.cancelable,startTime:i.timeStamp,processingStart:i.timeStamp+r};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(){L(e,t),r()},i=function(){r()},r=function(){removeEventListener("pointerup",n,E),removeEventListener("pointercancel",i,E)};addEventListener("pointerup",n,E),addEventListener("pointercancel",i,E)}(t,e):L(t,e)}},F=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,b,E)}))},C=function(e,t){var n,a=l(),d=u("FID"),p=function(e){e.startTime<a.firstHiddenTime&&(d.value=e.processingStart-e.startTime,d.entries.push(e),n(!0))},v=c("first-input",p);n=m(e,d,t),v&&s((function(){v.takeRecords().map(p),v.disconnect()}),!0),v&&f((function(){var a;d=u("FID"),n=m(e,d,t),o=[],r=-1,i=null,F(addEventListener),a=p,o.push(a),S()}))},P={},k=function(e,t){var n,i=l(),r=u("LCP"),a=function(e){var t=e.startTime;t<i.firstHiddenTime&&(r.value=t,r.entries.push(e)),n()},o=c("largest-contentful-paint",a);if(o){n=m(e,r,t);var d=function(){P[r.id]||(o.takeRecords().map(a),o.disconnect(),P[r.id]=!0,n(!0))};["keydown","click"].forEach((function(e){addEventListener(e,d,{once:!0,capture:!0})})),s(d,!0),f((function(i){r=u("LCP"),n=m(e,r,t),requestAnimationFrame((function(){requestAnimationFrame((function(){r.value=performance.now()-i.timeStamp,P[r.id]=!0,n(!0)}))}))}))}},D=function(e){var t,n=u("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}();if(n.value=n.delta=t.responseStart,n.value<0||n.value>performance.now())return;n.entries=[t],e(n)}catch(e){}},"complete"===document.readyState?setTimeout(t,0):addEventListener("pageshow",t)}}}]);
|
|
2
|
+
//# sourceMappingURL=3.11a1627e.chunk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../node_modules/web-vitals/dist/web-vitals.js"],"names":["e","t","n","i","r","name","value","delta","entries","id","concat","Date","now","Math","floor","random","a","PerformanceObserver","supportedEntryTypes","includes","self","getEntries","map","observe","type","buffered","o","document","visibilityState","removeEventListener","addEventListener","c","persisted","u","f","s","m","timeStamp","v","setTimeout","firstHiddenTime","p","disconnect","startTime","push","window","performance","getEntriesByName","requestAnimationFrame","d","l","h","hadRecentInput","length","takeRecords","g","passive","capture","y","T","S","E","entryType","target","cancelable","processingStart","forEach","w","L","b","F","once","P","getEntriesByType","timing","max","navigationStart","responseStart","readyState"],"mappings":"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","file":"static/js/3.11a1627e.chunk.js","sourcesContent":["var e,t,n,i,r=function(e,t){return{name:e,value:void 0===t?-1:t,delta:0,entries:[],id:\"v2-\".concat(Date.now(),\"-\").concat(Math.floor(8999999999999*Math.random())+1e12)}},a=function(e,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){if(\"first-input\"===e&&!(\"PerformanceEventTiming\"in self))return;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(e,t,n){var i;return function(r){t.value>=0&&(r||n)&&(t.delta=t.value-(i||0),(t.delta||void 0===i)&&(i=t.value,e(t)))}},f=-1,s=function(){return\"hidden\"===document.visibilityState?0:1/0},m=function(){o((function(e){var t=e.timeStamp;f=t}),!0)},v=function(){return f<0&&(f=s(),m(),c((function(){setTimeout((function(){f=s(),m()}),0)}))),{get firstHiddenTime(){return f}}},p=function(e,t){var n,i=v(),o=r(\"FCP\"),f=function(e){\"first-contentful-paint\"===e.name&&(m&&m.disconnect(),e.startTime<i.firstHiddenTime&&(o.value=e.startTime,o.entries.push(e),n(!0)))},s=window.performance&&performance.getEntriesByName&&performance.getEntriesByName(\"first-contentful-paint\")[0],m=s?null:a(\"paint\",f);(s||m)&&(n=u(e,o,t),s&&f(s),c((function(i){o=r(\"FCP\"),n=u(e,o,t),requestAnimationFrame((function(){requestAnimationFrame((function(){o.value=performance.now()-i.timeStamp,n(!0)}))}))})))},d=!1,l=-1,h=function(e,t){d||(p((function(e){l=e.value})),d=!0);var n,i=function(t){l>-1&&e(t)},f=r(\"CLS\",0),s=0,m=[],v=function(e){if(!e.hadRecentInput){var t=m[0],i=m[m.length-1];s&&e.startTime-i.startTime<1e3&&e.startTime-t.startTime<5e3?(s+=e.value,m.push(e)):(s=e.value,m=[e]),s>f.value&&(f.value=s,f.entries=m,n())}},h=a(\"layout-shift\",v);h&&(n=u(i,f,t),o((function(){h.takeRecords().map(v),n(!0)})),c((function(){s=0,l=-1,f=r(\"CLS\",0),n=u(i,f,t)})))},g={passive:!0,capture:!0},y=new Date,T=function(i,r){e||(e=r,t=i,n=new Date,S(removeEventListener),E())},E=function(){if(t>=0&&t<n-y){var r={entryType:\"first-input\",name:e.type,target:e.target,cancelable:e.cancelable,startTime:e.timeStamp,processingStart:e.timeStamp+t};i.forEach((function(e){e(r)})),i=[]}},w=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(){T(e,t),r()},i=function(){r()},r=function(){removeEventListener(\"pointerup\",n,g),removeEventListener(\"pointercancel\",i,g)};addEventListener(\"pointerup\",n,g),addEventListener(\"pointercancel\",i,g)}(t,e):T(t,e)}},S=function(e){[\"mousedown\",\"keydown\",\"touchstart\",\"pointerdown\"].forEach((function(t){return e(t,w,g)}))},L=function(n,f){var s,m=v(),p=r(\"FID\"),d=function(e){e.startTime<m.firstHiddenTime&&(p.value=e.processingStart-e.startTime,p.entries.push(e),s(!0))},l=a(\"first-input\",d);s=u(n,p,f),l&&o((function(){l.takeRecords().map(d),l.disconnect()}),!0),l&&c((function(){var a;p=r(\"FID\"),s=u(n,p,f),i=[],t=-1,e=null,S(addEventListener),a=d,i.push(a),E()}))},b={},F=function(e,t){var n,i=v(),f=r(\"LCP\"),s=function(e){var t=e.startTime;t<i.firstHiddenTime&&(f.value=t,f.entries.push(e)),n()},m=a(\"largest-contentful-paint\",s);if(m){n=u(e,f,t);var p=function(){b[f.id]||(m.takeRecords().map(s),m.disconnect(),b[f.id]=!0,n(!0))};[\"keydown\",\"click\"].forEach((function(e){addEventListener(e,p,{once:!0,capture:!0})})),o(p,!0),c((function(i){f=r(\"LCP\"),n=u(e,f,t),requestAnimationFrame((function(){requestAnimationFrame((function(){f.value=performance.now()-i.timeStamp,b[f.id]=!0,n(!0)}))}))}))}},P=function(e){var t,n=r(\"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}();if(n.value=n.delta=t.responseStart,n.value<0||n.value>performance.now())return;n.entries=[t],e(n)}catch(e){}},\"complete\"===document.readyState?setTimeout(t,0):addEventListener(\"pageshow\",t)};export{h as getCLS,p as getFCP,L as getFID,F as getLCP,P as getTTFB};\n"],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(this["webpackJsonp@ethersphere/bee-dashboard"]=this["webpackJsonp@ethersphere/bee-dashboard"]||[]).push([[0],{195:function(e){e.exports=JSON.parse('{"a":{"node":">=12.0.0","npm":">=6.0.0","bee":">=0.6.0"}}')},247:function(e,t,n){},252:function(e,t,n){},45:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return c}));var a=n(71);function r(t){return"object"===typeof e&&Object({NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_BEE_HOST:"http://localhost:1633",REACT_APP_BEE_DEBUG_HOST:"http://localhost:1635",REACT_APP_BEE_DOCS_HOST:"https://docs.ethswarm.org/docs/",REACT_APP_BEE_DISCORD_HOST:"https://discord.gg/eKr9XPv7",REACT_APP_BLOCKCHAIN_EXPLORER_URL:"https://blockscout.com/xdai/mainnet",REACT_APP_BEE_GITHUB_REPO_URL:"https://api.github.com/repos/ethersphere/bee"})[t]}var c=new function e(){Object(a.a)(this,e),this.BEE_API_HOST=void 0,this.BEE_DEBUG_API_HOST=void 0,this.BLOCKCHAIN_EXPLORER_URL=void 0,this.BEE_DOCS_HOST=void 0,this.BEE_DISCORD_HOST=void 0,this.GITHUB_REPO_URL=void 0,this.BEE_API_HOST=sessionStorage.getItem("api_host")||r("REACT_APP_BEE_HOST")||"http://localhost:1633",this.BEE_DEBUG_API_HOST=sessionStorage.getItem("debug_api_host")||r("REACT_APP_BEE_DEBUG_HOST")||"http://localhost:1635",this.BLOCKCHAIN_EXPLORER_URL=r("REACT_APP_BLOCKCHAIN_EXPLORER_URL")||"https://blockscout.com/xdai/mainnet",this.BEE_DOCS_HOST=r("REACT_APP_BEE_DOCS_HOST")||"https://docs.ethswarm.org/docs/",this.BEE_DISCORD_HOST=r("REACT_APP_BEE_DISCORD_HOST")||"https://discord.gg/eKr9XPv7",this.GITHUB_REPO_URL=r("REACT_APP_BEE_GITHUB_REPO_URL")||"https://api.github.com/repos/ethersphere/bee"}}).call(this,n(84))},530:function(e,t,n){"use strict";n.r(t);var a=n(0),r=n.n(a),c=n(15),o=n.n(c),i=(n(247),n(631)),s=n(630),l=n(30),u=n(28),d=(n(252),n(71)),b=n(125),j=n(218),h=n(217),p=n(1),O=function(e){Object(j.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(d.a)(this,n),(a=t.call(this,e)).state={error:null},a}return Object(b.a)(n,[{key:"componentDidCatch",value:function(e,t){console.error({error:e,errorInfo:t})}},{key:"render",value:function(){return this.state.error?Object(p.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),m=n(7),f=n(534),x=n(227),g=n(635),v=n(571),y=n(533),w=n(570),S=n(126),k=n.n(S),C=n(13),B=n.n(C),A=n(21),T=n(46),E=n(95),P=n.n(E),N=n(195),_=n(196),D=n.n(_),L=n(45),I=n(29),R=n.n(I);function U(e){return I.BigNumber.isBigNumber(e)&&e.isInteger()||"bigint"===typeof e}function F(e){if(I.BigNumber.isBigNumber(e))return e;if("string"===typeof e)return new I.BigNumber(e);if("bigint"===typeof e)return new I.BigNumber(e.toString());if("number"===typeof e)return new I.BigNumber(e);throw new TypeError("Not a BigNumber or BigNumber convertible value. Type: ".concat(typeof e," value: ").concat(e))}function W(e){return H.apply(this,arguments)}function H(){return(H=Object(A.a)(B.a.mark((function e(t){return B.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,new Promise((function(e){return setTimeout((function(){e()}),t)}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var z=[18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0],M=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16;Object(d.a)(this,e),this.amount=void 0,this.decimals=void 0;var a=F(t);if(!U(a)||!z.includes(n))throw new TypeError("Not a valid token values");this.amount=a,this.decimals=n}return Object(b.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 I.BigNumber(this.amount)}},{key:"toDecimal",get:function(){return this.amount.dividedBy(new I.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=F(t),r=a.multipliedBy(new I.BigNumber(10).pow(n));return new e(r,n)}}]),e}(),V=n(60),q={apiUrl:L.a.BEE_API_HOST,apiDebugUrl:L.a.BEE_DEBUG_API_HOST,beeApi:null,beeDebugApi:null,setApiUrl:function(){},setDebugApiUrl:function(){},lockedApiSettings:!1},Y=Object(a.createContext)(q);Y.Consumer;function Z(e){var t=e.children,n=e.beeApiUrl,r=e.beeDebugApiUrl,c=e.lockedApiSettings,o=Object(a.useState)(q.apiUrl),i=Object(m.a)(o,2),s=i[0],l=i[1],u=Object(a.useState)(q.apiDebugUrl),d=Object(m.a)(u,2),b=d[0],j=d[1],h=Object(a.useState)(null),O=Object(m.a)(h,2),f=O[0],x=O[1],g=Object(a.useState)(null),v=Object(m.a)(g,2),y=v[0],w=v[1],S=Object(a.useState)(Boolean(c)),k=Object(m.a)(S,1)[0];return Object(a.useEffect)((function(){try{x(new V.Bee(s)),sessionStorage.setItem("api_host",s)}catch(e){x(null)}}),[s]),Object(a.useEffect)((function(){n&&l(n)}),[n]),Object(a.useEffect)((function(){r&&j(r)}),[r]),Object(a.useEffect)((function(){try{w(new V.BeeDebug(b)),sessionStorage.setItem("debug_api_host",b)}catch(e){w(null)}}),[b]),Object(p.jsx)(Y.Provider,{value:{apiUrl:s,apiDebugUrl:b,beeApi:f,beeDebugApi:y,setApiUrl:l,setDebugApiUrl:j,lockedApiSettings:k},children:t})}var G=window.location.search.includes("devMode=1"),K={status:{all:!1,version:!1,blockchainConnection:!1,debugApiConnection:!1,apiConnection:!1,topology:!1,chequebook:!1},latestPublishedVersion:void 0,latestUserVersion:void 0,latestUserVersionExact:void 0,isLatestBeeVersion:!1,latestBeeVersionUrl:"https://github.com/ethersphere/bee/releases/latest",error:null,apiHealth:!1,debugApiHealth:null,nodeAddresses:null,topology:null,chequebookAddress:null,peers:null,chequebookBalance:null,peerBalances:null,peerCheques:null,settlements:null,latestBeeRelease:null,isLoading:!0,isRefreshing:!1,lastUpdate:null,start:function(){},stop:function(){},refresh:function(){return Promise.reject()}},X=Object(a.createContext)(K);X.Consumer;function J(e,t,n,a,r,c,o){var i=G||Boolean(Object({NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_BEE_HOST:"http://localhost:1633",REACT_APP_BEE_DEBUG_HOST:"http://localhost:1635",REACT_APP_BEE_DOCS_HOST:"https://docs.ethswarm.org/docs/",REACT_APP_BEE_DISCORD_HOST:"https://discord.gg/eKr9XPv7",REACT_APP_BLOCKCHAIN_EXPLORER_URL:"https://blockscout.com/xdai/mainnet",REACT_APP_BEE_GITHUB_REPO_URL:"https://api.github.com/repos/ethersphere/bee"}).REACT_APP_DEV_MODE),s={version:Boolean(e&&P.a.satisfies(e.version,N.a.bee,{includePrerelease:!0})),blockchainConnection:Boolean(null===t||void 0===t?void 0:t.ethereum),debugApiConnection:Boolean("ok"===(null===e||void 0===e?void 0:e.status)),apiConnection:n,topology:Boolean((null===a||void 0===a?void 0:a.connected)&&(null===a||void 0===a?void 0:a.connected)>0)||i,chequebook:Boolean(null===r||void 0===r?void 0:r.chequebookAddress)&&null!==c&&(null===c||void 0===c?void 0:c.totalBalance.toBigNumber.isGreaterThan(0))||i};return Object(T.a)(Object(T.a)({},s),{},{all:!o&&Object.values(s).every((function(e){return e}))})}function $(e){var t,n,r=e.children,c=Object(a.useContext)(Y),o=c.beeApi,i=c.beeDebugApi,s=Object(a.useState)(!1),l=Object(m.a)(s,2),u=l[0],d=l[1],b=Object(a.useState)(null),j=Object(m.a)(b,2),h=j[0],O=j[1],f=Object(a.useState)(null),x=Object(m.a)(f,2),g=x[0],v=x[1],y=Object(a.useState)(null),w=Object(m.a)(y,2),S=w[0],k=w[1],C=Object(a.useState)(null),T=Object(m.a)(C,2),E=T[0],N=T[1],_=Object(a.useState)(null),I=Object(m.a)(_,2),R=I[0],U=I[1],F=Object(a.useState)(null),W=Object(m.a)(F,2),H=W[0],z=W[1],V=Object(a.useState)(null),q=Object(m.a)(V,2),Z=q[0],G=q[1],$=Object(a.useState)(null),Q=Object(m.a)($,2),ee=Q[0],te=Q[1],ne=Object(a.useState)(null),ae=Object(m.a)(ne,2),re=ae[0],ce=ae[1],oe=function(){var e=Object(a.useState)(null),t=Object(m.a)(e,2),n=t[0],r=t[1],c=Object(a.useState)(!1),o=Object(m.a)(c,2),i=o[0],s=o[1],l=Object(a.useState)(null),u=Object(m.a)(l,2),d=u[0],b=u[1];return Object(a.useEffect)((function(){D.a.get("".concat(L.a.GITHUB_REPO_URL,"/releases/latest")).then((function(e){r(e.data)})).catch((function(e){b(e)})).finally((function(){s(!1)}))}),[]),{latestBeeRelease:n,isLoadingLatestBeeRelease:i,error:d}}(),ie=oe.latestBeeRelease,se=Object(a.useState)(K.error),le=Object(m.a)(se,2),ue=le[0],de=le[1],be=Object(a.useState)(K.isLoading),je=Object(m.a)(be,2),he=je[0],pe=je[1],Oe=Object(a.useState)(K.isRefreshing),me=Object(m.a)(Oe,2),fe=me[0],xe=me[1],ge=Object(a.useState)(K.lastUpdate),ve=Object(m.a)(ge,2),ye=ve[0],we=ve[1],Se=Object(a.useState)(3e4),ke=Object(m.a)(Se,2),Ce=ke[0],Be=ke[1],Ae=null===(t=P.a.coerce(null===ie||void 0===ie?void 0:ie.name))||void 0===t?void 0:t.version,Te=null===(n=P.a.coerce(null===h||void 0===h?void 0:h.version))||void 0===n?void 0:n.version,Ee=null===h||void 0===h?void 0:h.version;Object(a.useEffect)((function(){pe(!0),d(!1),Pe()}),[o]),Object(a.useEffect)((function(){pe(!0),O(null),v(null),k(null),U(null),N(null),z(null),G(null),te(null),ce(null),Pe()}),[i]);var Pe=function(){var e=Object(A.a)(B.a.mark((function e(){var t,n,a,r;return B.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!fe){e.next=2;break}return e.abrupt("return");case 2:if(o&&i){e.next=5;break}return pe(!1),e.abrupt("return");case 5:return e.prev=5,xe(!0),de(null),t=function(){var e=Object(A.a)(B.a.mark((function e(){var t,n,a;return B.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.getChequebookBalance();case 2:return t=e.sent,n=t.totalBalance,a=t.availableBalance,e.abrupt("return",{totalBalance:new M(n),availableBalance:new M(a)});case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),n=function(){var e=Object(A.a)(B.a.mark((function e(){var t,n;return B.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.getAllBalances();case 2:return t=e.sent,n=t.balances,e.abrupt("return",n.map((function(e){var t=e.peer,n=e.balance;return{peer:t,balance:new M(n)}})));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),a=function(){var e=Object(A.a)(B.a.mark((function e(){var t,n,a,r;return B.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.getAllSettlements();case 2:return t=e.sent,n=t.totalReceived,a=t.settlements,r=t.totalSent,e.abrupt("return",{totalReceived:new M(n),totalSent:new M(r),settlements:a.map((function(e){var t=e.peer,n=e.received,a=e.sent;return{peer:t,received:new M(n),sent:new M(a)}}))});case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),r=[o.isConnected().then(d).catch((function(){return d(!1)})),i.getHealth().then(O).catch((function(){return O(null)})),i.getNodeAddresses().then(v).catch((function(){return v(null)})),i.getTopology().then(k).catch((function(){return k(null)})),i.getPeers().then(U).catch((function(){return U(null)})),i.getChequebookAddress().then(N).catch((function(){return N(null)})),i.getLastCheques().then(te).catch((function(){return te(null)})),t().then(z).catch((function(){return z(null)})),n().then(G).catch((function(){return G(null)})),a().then(ce).catch((function(){return ce(null)}))],e.next=14,Promise.allSettled(r);case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(5),de(e.t0);case 19:return e.prev=19,pe(!1),xe(!1),we(Date.now()),e.finish(19);case 24:case"end":return e.stop()}}),e,null,[[5,16,19,24]])})));return function(){return e.apply(this,arguments)}}();return Object(a.useEffect)((function(){if(Pe(),Ce){var e=setInterval(Pe,Ce);return function(){return clearInterval(e)}}}),[Ce,i,o]),Object(p.jsx)(X.Provider,{value:{status:J(h,g,u,S,E,H,ue),latestUserVersion:Te,latestUserVersionExact:Ee,latestPublishedVersion:Ae,isLatestBeeVersion:Boolean(Ae&&Te&&P.a.satisfies(Ae,Te,{includePrerelease:!0})),latestBeeVersionUrl:(null===ie||void 0===ie?void 0:ie.html_url)||"https://github.com/ethersphere/bee/releases/latest",error:ue,apiHealth:u,debugApiHealth:h,nodeAddresses:g,topology:S,chequebookAddress:E,peers:R,chequebookBalance:H,peerBalances:Z,peerCheques:ee,settlements:re,latestBeeRelease:ie,isLoading:he,isRefreshing:fe,lastUpdate:ye,start:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e4;return Be(e)},stop:function(){return Be(null)},refresh:Pe},children:r})}var Q=Object(f.a)((function(e){return Object(x.a)({root:{width:"100%",marginBottom:e.spacing(2)}})}));function ee(){var e=Q(),t=Object(a.useContext)(X),n=t.isLoading,r=t.latestUserVersionExact,c=Object(a.useState)(!0),o=Object(m.a)(c,2),i=o[0],s=o[1],l=V.SUPPORTED_BEE_VERSION_EXACT===r;return n||!r?null:Object(p.jsx)(y.a,{in:!l&&i,children:Object(p.jsx)("div",{className:e.root,children:Object(p.jsxs)(g.a,{severity:"warning",action:Object(p.jsx)(w.a,{"aria-label":"close",color:"inherit",size:"small",onClick:function(){s(!1)},children:Object(p.jsx)(k.a,{fontSize:"inherit"})}),children:[Object(p.jsx)(v.a,{children:"Warning"}),"Your Bee node version (",Object(p.jsx)("code",{children:r}),") does not exactly match the Bee version we tested the Bee Dashboard against (",Object(p.jsx)("code",{children:V.SUPPORTED_BEE_VERSION_EXACT}),"). Please note that some functionality may not work properly."]})})})}var te=n(589),ne=n(590),ae=n(627),re=n(575),ce=n(612),oe=n(628),ie=n(592),se=n(601),le=n(623),ue=n(624),de=n(616),be=n(625),je=n(626),he=n(629),pe=n.p+"static/media/logo.3d1155fe.svg",Oe=n(17),me=n(535),fe=n(572),xe=n(73),ge=n(573),ve=n(574),ye=Object(f.a)((function(e){return Object(x.a)({root:{width:"100%",padding:0,margin:0,marginTop:e.spacing(4),"&:first-child":{marginTop:0}},rootLevel1:{marginTop:e.spacing(1)},rootLevel2:{marginTop:e.spacing(.5)},header:{backgroundColor:e.palette.background.paper},contentLevel0:{marginTop:e.spacing(1)},contentLevel12:{marginTop:e.spacing(.25)},infoText:{color:"#c9c9c9"}})}));function we(e){var t=e.children,n=e.label,r=e.level,c=e.defaultOpen,o=e.info,i=ye(),s=Object(a.useState)(Boolean(c)),l=Object(m.a)(s,2),u=l[0],d=l[1],b="",j="h1",h=i.contentLevel0;return 1===r?(b=i.rootLevel1,j="h2",h=i.contentLevel12):2===r&&(b=i.rootLevel2,j="h3",h=i.contentLevel12),Object(p.jsxs)("div",{className:"".concat(i.root," ").concat(b),children:[Object(p.jsxs)(me.a,{button:!0,onClick:function(){d(!u)},className:i.header,children:[Object(p.jsx)(fe.a,{primary:Object(p.jsx)(xe.a,{variant:j,children:n})}),Object(p.jsxs)("div",{style:{display:"flex"},children:[!u&&Object(p.jsx)(xe.a,{variant:"body2",className:i.infoText,children:o}),u?Object(p.jsx)(ge.a,{}):Object(p.jsx)(ve.a,{})]})]}),Object(p.jsx)(y.a,{in:u,timeout:"auto",unmountOnExit:!0,children:Object(p.jsx)("div",{className:h,children:t})})]})}var Se=n(637),ke=n(578),Ce=Object(f.a)((function(e){return Object(x.a)({header:{backgroundColor:e.palette.background.paper,marginBottom:e.spacing(.25),wordBreak:"break-word"},copyValue:{cursor:"pointer",padding:e.spacing(1),borderRadius:0,"&:hover":{backgroundColor:"#fcf2e8",color:e.palette.primary.main}}})}));function Be(e){var t=e.label,n=e.value,a=e.tooltip,r=Ce();return Object(p.jsx)(me.a,{className:r.header,children:Object(p.jsxs)(re.a,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[t&&Object(p.jsx)(xe.a,{variant:"body1",children:t}),n&&Object(p.jsxs)(xe.a,{variant:"body2",children:[n,a&&Object(p.jsx)(Se.a,{title:a,placement:"top",arrow:!0,children:Object(p.jsx)(w.a,{size:"small",className:r.copyValue,children:Object(p.jsx)(ke.a,{strokeWidth:1})})})]})]})})}var Ae=Object(f.a)((function(e){return Object(x.a)({action:{marginTop:e.spacing(.75),marginBottom:e.spacing(1),marginRight:e.spacing(1)}})}));function Te(e){var t=e.children,n=Ae();return Array.isArray(t)?Object(p.jsx)(re.a,{container:!0,direction:"row",children:t.filter((function(e){return e})).map((function(e,t){return Object(p.jsx)(re.a,{className:n.action,children:e},t)}))}):Object(p.jsx)(re.a,{container:!0,direction:"row",children:Object(p.jsx)(re.a,{className:n.action,children:t})})}var Ee=n(79),Pe=n.n(Ee),Ne=n(579),_e=n(580),De=Object(f.a)((function(e){return Object(x.a)({header:{backgroundColor:e.palette.background.paper,marginBottom:e.spacing(.25),borderLeft:"".concat(e.spacing(.25),"px solid rgba(0,0,0,0)"),wordBreak:"break-word"},headerOpen:{borderLeft:"".concat(e.spacing(.25),"px solid ").concat(e.palette.primary.main)},copyValue:{cursor:"pointer",padding:e.spacing(1),borderRadius:0,"&:hover":{backgroundColor:"#fcf2e8",color:e.palette.primary.main}},content:{marginTop:e.spacing(2),marginBottom:e.spacing(2)},keyMargin:{marginRight:e.spacing(1)}})}));function Le(e){var t,n=e.label,r=e.value,c=De(),o=Object(a.useState)(!1),i=Object(m.a)(o,2),s=i[0],l=i[1],u=Object(a.useState)(!1),d=Object(m.a)(u,2),b=d[0],j=d[1],h=function(){return l(!s)},O=function(){return j(!0)},f=function(){return j(!1)},x=function(e){var t=function(e){return e.replace(/^0x/i,"").length}(e);return t%6===0?e.match(/(0x|.{6})/gi)||[]:e.match(/(0x|.{1,8})/gi)||[]}(r),g="string"===typeof(t=r)&&/^0x[0-9a-f]+$/i.test(t),v="".concat(g?"".concat(x[0]," ").concat(x[1]):x[0],"[\u2026]").concat(x[x.length-1]);return Object(p.jsx)(me.a,{className:"".concat(c.header," ").concat(s?c.headerOpen:""),children:Object(p.jsxs)(re.a,{container:!0,direction:"column",justifyContent:"space-between",alignItems:"stretch",children:[Object(p.jsxs)(re.a,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[n&&Object(p.jsx)(xe.a,{variant:"body1",children:n}),Object(p.jsx)(xe.a,{variant:"body2",children:Object(p.jsxs)("div",{children:[!s&&Object(p.jsx)("span",{className:c.copyValue,children:Object(p.jsx)(Se.a,{title:b?"Copied":"Copy",placement:"top",arrow:!0,onClose:f,children:Object(p.jsx)(Ee.CopyToClipboard,{text:r,children:Object(p.jsx)("span",{onClick:O,children:r?v:""})})})}),Object(p.jsx)(w.a,{size:"small",className:c.copyValue,children:s?Object(p.jsx)(Ne.a,{onClick:h,strokeWidth:1}):Object(p.jsx)(_e.a,{onClick:h,strokeWidth:1})})]})})]}),Object(p.jsx)(y.a,{in:s,timeout:"auto",unmountOnExit:!0,children:Object(p.jsx)("div",{className:c.content,children:Object(p.jsx)(Se.a,{title:b?"Copied":"Copy",placement:"top",arrow:!0,onClose:f,children:Object(p.jsx)(Ee.CopyToClipboard,{text:r,children:Object(p.jsx)("span",{onClick:O,children:Object(p.jsx)("span",{className:c.copyValue,children:x.map((function(e,t){return Object(p.jsx)(xe.a,{variant:"body2",className:c.keyMargin,component:"span",children:e},t)}))})})})})})})]})})}var Ie=n(585),Re=n(583),Ue=n(591),Fe=n(587),We=n(588),He=n(584),ze=n(586),Me=n(198),Ve=n.n(Me),qe=n(581);function Ye(e){var t=e.value,n=Object(l.b)().enqueueSnackbar;return Object(p.jsx)("div",{style:{marginRight:"3px",marginLeft:"3px"},children:Object(p.jsx)(w.a,{color:"primary",size:"small",onClick:function(){return n("Copied: ".concat(t),{variant:"success"})},children:Object(p.jsx)(Ee.CopyToClipboard,{text:t,children:Object(p.jsx)(qe.a,{style:{height:"20px"}})})})})}var Ze=n(199),Ge=n.n(Ze),Ke=n(582);function Xe(e){var t=Object(a.useState)(!1),n=Object(m.a)(t,2),r=n[0],c=n[1];return Object(p.jsxs)("div",{children:[Object(p.jsx)(w.a,{color:"primary",size:"small",onClick:function(){c(!0)},children:Object(p.jsx)(Ke.a,{})}),Object(p.jsx)(Re.a,{onClose:function(){c(!1)},"aria-labelledby":"simple-dialog-title",open:r,children:Object(p.jsxs)("div",{style:{padding:"30px",textAlign:"center"},children:[Object(p.jsx)(He.a,{id:"simple-dialog-title",children:e.label}),Object(p.jsx)(Ge.a,{value:e.value,size:150,bgColor:"#ffffff",fgColor:"#000000",level:"L",includeMargin:!1,renderAs:"svg"})]})})]})}function Je(e){return Object(p.jsx)(xe.a,{component:"div",variant:"subtitle1",children:e.address?Object(p.jsxs)("div",{style:{display:"flex"},children:[e.hideBlockie?null:Object(p.jsx)("div",{style:{paddingTop:"5px",marginRight:"10px"},children:Object(p.jsx)(Ve.a,{size:20,string:e.address})}),Object(p.jsx)("div",{children:Object(p.jsx)("a",{style:e.truncate?{marginRight:"7px",maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"}:{marginRight:"7px"},href:"".concat(L.a.BLOCKCHAIN_EXPLORER_URL,"/").concat(e.transaction?"tx":"address","/").concat(e.address),target:"_blank",rel:"noreferrer",children:e.address})}),Object(p.jsx)(Xe,{value:e.address,label:"Ethereum Address"}),Object(p.jsx)(Ye,{value:e.address})]}):"-"})}function $e(e){var t=e.peerId,n=e.uncashedAmount,r=Object(a.useState)(!1),c=Object(m.a)(r,2),o=c[0],i=c[1],s=Object(a.useState)(!1),u=Object(m.a)(s,2),d=u[0],b=u[1],j=Object(l.b)().enqueueSnackbar,h=Object(a.useContext)(Y).beeDebugApi,O=function(){i(!1)};return Object(p.jsxs)("div",{children:[Object(p.jsxs)(Ie.a,{variant:"contained",onClick:function(){i(!0)},startIcon:Object(p.jsx)(ze.a,{size:"1rem"}),children:["Cash out peer ",t.substr(0,8),"[\u2026]"]}),Object(p.jsxs)(Re.a,{open:o,onClose:O,"aria-labelledby":"form-dialog-title",children:[Object(p.jsx)(He.a,{id:"form-dialog-title",children:"Cashout Cheque"}),Object(p.jsx)(Fe.a,{children:Object(p.jsxs)(We.a,{style:{marginTop:"20px",overflowWrap:"break-word"},children:[d&&Object(p.jsxs)(p.Fragment,{children:[Object(p.jsxs)("span",{children:["Cashing out ",Object(p.jsx)("strong",{children:n})," from Peer ",Object(p.jsx)("strong",{children:t}),". Please wait..."]}),Object(p.jsx)(te.a,{style:{textAlign:"center",padding:"50px"},children:Object(p.jsx)(ne.a,{})})]}),!d&&Object(p.jsxs)("span",{children:["Are you sure you want to cashout ",Object(p.jsxs)("strong",{children:[n," BZZ"]})," from Peer"," ",Object(p.jsx)("strong",{children:t}),"?"]})]})}),Object(p.jsxs)(Ue.a,{children:[Object(p.jsx)(Ie.a,{onClick:O,color:"primary",children:"Cancel"}),Object(p.jsx)(Ie.a,{onClick:function(){h&&(t?(b(!0),h.cashoutLastCheque(t).then((function(e){i(!1),j(Object(p.jsxs)("span",{children:["Successfully cashed out cheque. Transaction",Object(p.jsx)(Je,{hideBlockie:!0,transaction:!0,address:e})]}),{variant:"success"})})).catch((function(e){j(Object(p.jsxs)("span",{children:["Error: ",e.message]}),{variant:"error"})})).finally((function(){b(!1)}))):j(Object(p.jsx)("span",{children:"Peer Id invalid"}),{variant:"error"}))},color:"primary",disabled:d,children:"Yes Cashout"})]})]})]})}function Qe(e){var t=e.accounting,n=e.isLoadingUncashed,a=e.totalUncashed;return Object(p.jsxs)(we,{label:"Peers (".concat((null===t||void 0===t?void 0:t.length)||0,")"),info:"".concat(a.toFixedDecimal()," BZZ (uncashed)"),children:[Object(p.jsx)(Be,{label:"Uncashed Amount Total",value:"".concat(a.toFixedDecimal()," BZZ")}),null===t||void 0===t?void 0:t.map((function(e){var t=e.peer,a=e.balance,r=e.received,c=e.sent,o=e.uncashedAmount,i=e.total;return Object(p.jsxs)(we,{label:"Peer ".concat(t.substr(0,8),"[\u2026]"),level:1,info:"".concat(o.toFixedDecimal()," BZZ (uncashed)"),children:[Object(p.jsx)(Le,{label:"Peer ID",value:t}),Object(p.jsx)(Be,{label:"Outstanding Balance",value:"".concat(a.toFixedDecimal()," BZZ")}),Object(p.jsx)(Be,{label:"Settlements Sent / Received",value:"-".concat(c.toFixedDecimal()," / ").concat(r.toFixedDecimal()," BZZ")}),Object(p.jsx)(Be,{label:"Total",value:"".concat(i.toFixedDecimal()," BZZ")}),Object(p.jsx)(Be,{label:"Uncashed Amount",value:n?"loading\u2026":"".concat(o.toFixedDecimal()," BZZ")}),o.toBigNumber.isGreaterThan("0")&&Object(p.jsx)(Te,{children:Object(p.jsx)($e,{uncashedAmount:o.toFixedDecimal(),peerId:t})})]},t)}))]})}var et=n(593),tt=Object(f.a)((function(e){return Object(x.a)({root:{height:"100%"},content:{maxWidth:500,marginBottom:e.spacing(4),"&:last-child":{marginBottom:0}},icon:{height:"1rem"}})}));function nt(){var e=tt();return Object(p.jsxs)(re.a,{container:!0,direction:"column",justifyContent:"center",alignItems:"center",className:e.root,children:[Object(p.jsx)(re.a,{item:!0,className:e.content,children:Object(p.jsx)(xe.a,{variant:"h1",align:"center",children:"Uh oh, it looks like your node is not connected."})}),Object(p.jsx)(re.a,{item:!0,className:e.content,children:Object(p.jsxs)(xe.a,{align:"center",children:["Please check your node status to fix the problem. You can also check out the"," ",Object(p.jsx)(ie.a,{href:L.a.BEE_DOCS_HOST,target:"_blank",rel:"noreferrer",children:"Swarm Bee Docs"})," ","or ask for support on the"," ",Object(p.jsx)(ie.a,{href:L.a.BEE_DISCORD_HOST,target:"_blank",rel:"noreferrer",children:"Ethereum Swarm Discord"}),"."]})}),Object(p.jsx)(re.a,{item:!0,className:e.content,children:Object(p.jsx)(xe.a,{align:"center",children:Object(p.jsx)(Ie.a,{component:u.b,variant:"contained",startIcon:Object(p.jsx)(et.a,{className:e.icon}),to:ya.STATUS,children:"Check node status"})})})]})}var at=function(e,t,n){var r=Object(a.useState)(!1),c=Object(m.a)(r,2),o=c[0],i=c[1],s=Object(a.useState)(void 0),l=Object(m.a)(s,2),u=l[0],d=l[1];Object(a.useEffect)((function(){if(!o&&e&&t&&!u){i(!0);var n=t.settlements.filter((function(e){return e.received.toBigNumber.gt("0")})).map((function(t){var n=t.peer;return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3;return new Promise(function(){var a=Object(A.a)(B.a.mark((function a(r,c){var o,i;return B.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:o=0;case 1:if(!(o<t)){a.next=21;break}return a.prev=2,a.next=5,e();case 5:return i=a.sent,r(i),a.abrupt("return");case 10:if(a.prev=10,a.t0=a.catch(2),!(o<t-1)){a.next=17;break}return a.next=15,W(n);case 15:a.next=18;break;case 17:c(a.t0);case 18:o++,a.next=1;break;case 21:case"end":return a.stop()}}),a,null,[[2,10]])})));return function(e,t){return a.apply(this,arguments)}}())}((function(){return e.getLastCashoutAction(n)}))}));Promise.allSettled(n).then((function(e){var t=function(e){var t,n={fulfilled:(t=e).filter((function(e){return"fulfilled"===e.status})),rejected:t.filter((function(e){return"rejected"===e.status}))};return{fulfilled:n.fulfilled.map((function(e){return e.value})),rejected:n.rejected.map((function(e){return e.reason?String(e.reason):"Unknown error"}))}}(e);d(t.fulfilled),i(!1)}))}}),[t,o,u,e]);var b=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 M("0"),received:new M("0"),uncashedAmount:new M("0"),total:n}})),t.forEach((function(e){var t=e.peer,n=e.sent,r=e.received;return a[t]=Object(T.a)(Object(T.a)({},a[t]),{},{sent:n,received:r,total:new M(a[t].balance.toBigNumber.plus(r.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 M(n)})),Object.values(a).sort((function(e,t){var n=t.uncashedAmount.toBigNumber.minus(e.uncashedAmount.toBigNumber).toNumber();return 0!==n?n:e.peer<t.peer?-1:1}))):Object.values(a).sort((function(e,t){return e.peer<t.peer?-1:1}))}(n,null===t||void 0===t?void 0:t.settlements,u),j=new M("0");return null===b||void 0===b||b.forEach((function(e){var t=e.uncashedAmount;return j=new M(j.toBigNumber.plus(t.toBigNumber))})),{isLoadingUncashed:o,totalUncashed:j,accounting:b}},rt=n(596),ct=n(594),ot=n(595);function it(e){var t=e.successMessage,n=e.errorMessage,r=e.dialogMessage,c=e.min,o=e.max,i=e.label,s=e.action,u=e.icon,d=Object(a.useState)(!1),b=Object(m.a)(d,2),j=b[0],h=b[1],O=Object(a.useState)(""),f=Object(m.a)(O,2),x=f[0],g=f[1],v=Object(a.useState)(null),y=Object(m.a)(v,2),w=y[0],S=y[1],k=Object(a.useState)(null),C=Object(m.a)(k,2),T=C[0],E=C[1],P=Object(l.b)().enqueueSnackbar,N=function(){h(!1)},_=function(){var e=Object(A.a)(B.a.mark((function e(){var a;return B.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==w){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,e.next=5,s(w.toBigInt);case 5:a=e.sent,h(!1),P("".concat(t," Transaction ").concat(a),{variant:"success"}),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(2),P("".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(p.jsxs)("div",{children:[Object(p.jsx)(Ie.a,{variant:"contained",onClick:function(e){h(!0),e.stopPropagation()},startIcon:u,children:i}),Object(p.jsxs)(Re.a,{open:j,onClose:N,"aria-labelledby":"form-dialog-title",children:[Object(p.jsx)(He.a,{id:"form-dialog-title",children:i}),Object(p.jsxs)(Fe.a,{children:[Object(p.jsx)(We.a,{children:r}),Object(p.jsx)(ct.a,{autoFocus:!0,margin:"dense",id:"name",type:"text",placeholder:"Amount",fullWidth:!0,value:x,onChange:function(e){var t=e.target.value;g(t),E(null);try{var n=M.fromDecimal(t);S(n),c&&n.toDecimal.isLessThan(c)&&E(new Error("Needs to be more than ".concat(c))),o&&n.toDecimal.isGreaterThan(o)&&E(new Error("Needs to be less than ".concat(o)))}catch(e){E(e)}}}),T&&Object(p.jsxs)(ot.a,{error:!0,children:["Please provide valid BZZ amount (max 16 decimals). Error: ",T.message]})]}),Object(p.jsxs)(Ue.a,{children:[Object(p.jsx)(Ie.a,{onClick:N,color:"primary",children:"Cancel"}),Object(p.jsx)(Ie.a,{onClick:_,color:"primary",children:i})]})]})]})}function st(){var e=Object(a.useContext)(Y).beeDebugApi;return Object(p.jsx)(it,{successMessage:"Successful withdrawal.",errorMessage:"Error with withdrawing.",dialogMessage:"Specify the amount of BZZ you would like to withdraw from your node.",label:"Withdraw",icon:Object(p.jsx)(rt.a,{size:"1rem"}),min:new I.BigNumber(0),action:function(t){if(!e)throw new Error("Bee Debug URL is not valid");return e.withdrawTokens(t.toString())}})}var lt=n(597);function ut(){var e=Object(a.useContext)(Y).beeDebugApi;return Object(p.jsx)(it,{successMessage:"Successful deposit.",errorMessage:"Error with depositing",dialogMessage:"Specify the amount of BZZ you would like to deposit to your node.",label:"Deposit",icon:Object(p.jsx)(lt.a,{size:"1rem"}),min:new I.BigNumber(0),action:function(t){if(!e)throw new Error("Bee Debug URL is not valid");return e.depositTokens(t.toString())}})}function dt(){var e=Object(a.useContext)(X),t=e.status,n=e.nodeAddresses,r=e.chequebookAddress,c=e.chequebookBalance,o=e.settlements,i=e.peerBalances,s=Object(a.useContext)(Y).beeDebugApi,l=at(s,o,i),u=l.accounting,d=l.totalUncashed,b=l.isLoadingUncashed;return t.all?Object(p.jsxs)("div",{children:[Object(p.jsxs)(we,{label:"Chequebook",defaultOpen:!0,children:[Object(p.jsx)(Be,{label:"Total Balance",value:"".concat(null===c||void 0===c?void 0:c.totalBalance.toFixedDecimal()," BZZ")}),Object(p.jsx)(Be,{label:"Available Uncommitted Balance",value:"".concat(null===c||void 0===c?void 0:c.availableBalance.toFixedDecimal()," BZZ")}),Object(p.jsx)(Be,{label:"Total Cheques Amount Sent",value:"".concat(null===o||void 0===o?void 0:o.totalSent.toFixedDecimal()," BZZ")}),Object(p.jsx)(Be,{label:"Total Cheques Amount Received",value:"".concat(null===o||void 0===o?void 0:o.totalReceived.toFixedDecimal()," BZZ")}),Object(p.jsxs)(Te,{children:[Object(p.jsx)(st,{}),Object(p.jsx)(ut,{})]})]}),Object(p.jsxs)(we,{label:"Blockchain",defaultOpen:!0,children:[Object(p.jsx)(Le,{label:"Ethereum address",value:(null===n||void 0===n?void 0:n.ethereum)||""}),Object(p.jsx)(Le,{label:"Chequebook contract address",value:(null===r||void 0===r?void 0:r.chequebookAddress)||""})]}),Object(p.jsx)(Qe,{accounting:u,isLoadingUncashed:b,totalUncashed:d})]}):Object(p.jsx)(nt,{})}var bt=n(128),jt=n(228),ht=n(598),pt=n(599),Ot=n(600),mt=Object(f.a)((function(e){return Object(x.a)({header:{backgroundColor:"#F7F7F7",marginBottom:e.spacing(.25)},typography:{color:"#242424"}})}));function ft(e){var t=e.children,n=mt();return Object(p.jsx)(me.a,{className:n.header,children:Object(p.jsx)(xe.a,{variant:"body1",className:n.typography,children:t})})}var xt,gt=Object(f.a)((function(e){return Object(x.a)({header:{backgroundColor:e.palette.background.paper,marginBottom:e.spacing(.25),borderLeft:"".concat(e.spacing(.25),"px solid rgba(0,0,0,0)"),wordBreak:"break-word"},headerOpen:{borderLeft:"".concat(e.spacing(.25),"px solid ").concat(e.palette.primary.main)},copyValue:{cursor:"pointer",padding:e.spacing(1),borderRadius:0,"&:hover":{backgroundColor:"#fcf2e8",color:e.palette.primary.main}},content:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},keyMargin:{marginRight:e.spacing(1)},unselectableLabel:{cursor:"default",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"}})}));function vt(e){var t=e.label,n=e.value,r=e.onConfirm,c=e.onChange,o=e.confirmLabel,i=e.confirmLabelDisabled,s=e.expandedOnly,l=e.helperText,u=e.placeholder,d=e.mapperFn,b=e.locked,j=gt(),h=Object(a.useState)(Boolean(s)),O=Object(m.a)(h,2),f=O[0],x=O[1],g=Object(a.useState)(n||""),v=Object(m.a)(g,2),S=v[0],k=v[1],C=function(){return x(!f)};return Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(me.a,{className:"".concat(j.header," ").concat(f?j.headerOpen:""),children:Object(p.jsxs)(re.a,{container:!0,direction:"column",justifyContent:"space-between",alignItems:"stretch",children:[Object(p.jsxs)(re.a,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[t&&Object(p.jsx)(xe.a,{variant:"body1",className:j.unselectableLabel,children:t}),Object(p.jsx)(xe.a,{variant:"body2",children:Object(p.jsxs)("div",{children:[!f&&n,!s&&!b&&Object(p.jsx)(w.a,{size:"small",className:j.copyValue,children:f?Object(p.jsx)(Ne.a,{onClick:C,strokeWidth:1}):Object(p.jsx)(ht.a,{onClick:C,strokeWidth:1})})]})})]}),Object(p.jsx)(y.a,{in:f,timeout:"auto",unmountOnExit:!0,children:Object(p.jsx)(jt.a,{value:S,placeholder:u,onChange:function(e){d&&(e.target.value=d(e.target.value)),k(e.target.value),c&&c(e.target.value)},fullWidth:!0,className:j.content,autoFocus:!0,hidden:b})})]})}),Object(p.jsxs)(y.a,{in:f,timeout:"auto",unmountOnExit:!0,children:[l&&Object(p.jsx)(ft,{children:l}),Object(p.jsxs)(Te,{children:[Object(p.jsx)(Ie.a,{variant:"contained",disabled:S===n||Boolean(i)||""===S&&void 0===n,startIcon:Object(p.jsx)(pt.a,{size:"1rem"}),onClick:function(){return r(S)},children:o||"Save"}),Object(p.jsx)(Ie.a,{variant:"contained",disabled:S===n||""===S,startIcon:Object(p.jsx)(Ot.a,{size:"1rem"}),onClick:function(){return k(n||"")},children:"Cancel"})]})]})]})}function yt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return"".concat(e.slice(0,t),"[\u2026]").concat(e.slice(-t))}function wt(e,t,n){var a=St(e),r=a.findIndex((function(e){return e.hash===t}));-1!==r&&a.splice(r,1),a.unshift({createdAt:Date.now(),hash:t,name:n}),a.length>10&&(a.length=10),localStorage.setItem(e,JSON.stringify(a))}function St(e){var t=localStorage.getItem(e);if(!t)return[];try{var n=JSON.parse(t);return Array.isArray(n)&&n.every(kt)?n:[]}catch(a){return[]}}function kt(e){return"object"===typeof e&&null!==e&&("createdAt"in e&&"hash"in e)}function Ct(e,t){return"index.html"===t?"Website ".concat(yt(e,4)):t||"Folder ".concat(yt(e,4))}!function(e){e.UPLOAD_HISTORY="UPLOAD_HISTORY",e.DOWNLOAD_HISTORY="DOWNLOAD_HISTORY"}(xt||(xt={}));var Bt=n(602),At=Object(f.a)((function(e){return Object(x.a)({header:{backgroundColor:e.palette.background.paper,marginBottom:e.spacing(.25),borderLeft:"".concat(e.spacing(.25),"px solid rgba(0,0,0,0)"),wordBreak:"break-word"},headerOpen:{borderLeft:"".concat(e.spacing(.25),"px solid ").concat(e.palette.primary.main)},openLinkIcon:{cursor:"pointer",padding:e.spacing(1),borderRadius:0,"&:hover":{backgroundColor:"#fcf2e8",color:e.palette.primary.main}},content:{marginTop:e.spacing(2),marginBottom:e.spacing(2)},keyMargin:{marginRight:e.spacing(1)},copyValue:{cursor:"pointer",padding:e.spacing(1),borderRadius:0,"&:hover":{backgroundColor:"#fcf2e8",color:e.palette.primary.main}}})}));function Tt(e){var t=e.label,n=e.value,r=e.link,c=e.navigationType,o=void 0===c?"NEW_WINDOW":c,i=e.allowClipboard,s=void 0===i||i,l=At(),u=Object(a.useState)(!1),d=Object(m.a)(u,2),b=d[0],j=d[1],h=Object(Oe.f)(),O=n.length>22?n.slice(0,19)+"...":n;function f(){"NEW_WINDOW"===o?window.open(r||n):h.push(r||n)}return Object(p.jsx)(me.a,{className:l.header,children:Object(p.jsx)(re.a,{container:!0,direction:"column",justifyContent:"space-between",alignItems:"stretch",children:Object(p.jsxs)(re.a,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[t&&Object(p.jsx)(xe.a,{variant:"body1",children:t}),Object(p.jsx)(xe.a,{variant:"body2",children:Object(p.jsxs)("div",{children:[s&&Object(p.jsx)("span",{className:l.copyValue,children:Object(p.jsx)(Se.a,{title:b?"Copied":"Copy",placement:"top",arrow:!0,onClose:function(){return j(!1)},children:Object(p.jsx)(Pe.a,{text:n,children:Object(p.jsx)("span",{onClick:function(){return j(!0)},children:O})})})}),!s&&Object(p.jsx)("span",{onClick:f,children:O}),Object(p.jsxs)(w.a,{size:"small",className:l.openLinkIcon,children:["NEW_WINDOW"===o&&Object(p.jsx)(se.a,{onClick:f,strokeWidth:1}),"HISTORY_PUSH"===o&&Object(p.jsx)(Bt.a,{onClick:f,strokeWidth:1})]})]})})]})})})}function Et(e){var t=e.title,n=e.localStorageKey,r=Object(a.useState)([]),c=Object(m.a)(r,2),o=c[0],i=c[1];return Object(a.useEffect)((function(){i(St(n))}),[n]),o.length?Object(p.jsx)(we,{label:t,defaultOpen:!0,children:o.map((function(e,t){return Object(p.jsx)(Tt,{label:(n=new Date(e.createdAt),n.toString().split("GMT")[0].trim()),value:e.name,link:"/files/hash/"+e.hash,navigationType:"HISTORY_PUSH",allowClipboard:!1},t);var n}))}):null}var Pt=n(633),Nt=n(603),_t=Object(f.a)((function(e){return Object(x.a)({root:{flexGrow:1,marginBottom:e.spacing(4)},leftTab:{marginRight:e.spacing(.5)},rightTab:{marginLeft:e.spacing(.5)}})}));function Dt(e){var t=e.active,n=_t(),a=Object(Oe.f)();return Object(p.jsx)("div",{className:n.root,children:Object(p.jsxs)(Pt.a,{value:"UPLOAD"===t?0:1,onChange:function(e,t){a.push(1===t?ya.DOWNLOAD:ya.UPLOAD)},variant:"fullWidth",children:[Object(p.jsx)(Nt.a,{className:n.leftTab,label:"Upload"},"UPLOAD"),Object(p.jsx)(Nt.a,{className:n.rightTab,label:"Download"},"DOWNLOAD")]})})}function Lt(){var e=Object(a.useState)(!1),t=Object(m.a)(e,2),n=t[0],r=t[1],c=Object(a.useContext)(Y).beeApi,o=Object(a.useState)(void 0),i=Object(m.a)(o,2),s=i[0],u=i[1],d=Object(l.b)().enqueueSnackbar,b=Object(Oe.f)();function j(){return(j=Object(A.a)(B.a.mark((function e(t){var n,a,o;return B.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,n=new bt.ManifestJs(c),e.next=6,n.isManifest(t);case 6:if(e.sent){e.next=9;break}throw Error("The specified hash does not contain valid content.");case 9:return e.next=11,n.getIndexDocumentPath(t);case 11:a=e.sent,wt(xt.DOWNLOAD_HISTORY,t,Ct(t,a)),b.push(ya.HASH.replace(":hash",t)),e.next=22;break;case 16:e.prev=16,e.t0=e.catch(2),(o="object"===typeof e.t0&&null!==e.t0&&Reflect.get(e.t0,"message")).includes("path address not found")&&(o="The specified hash does not have an index document set."),o.includes("Not Found: Not Found")&&(o="The specified hash was not found."),d(Object(p.jsxs)("span",{children:["Error: ",o||"Unknown"]}),{variant:"error"});case 22:return e.prev=22,r(!1),e.finish(22);case 25:case"end":return e.stop()}}),e,null,[[2,16,22,25]])})))).apply(this,arguments)}return Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(Dt,{active:"DOWNLOAD"}),Object(p.jsx)(vt,{label:"Swarm Hash",onConfirm:function(e){return function(e){return j.apply(this,arguments)}(e)},onChange:function(e){V.Utils.isHexString(e,64)||V.Utils.isHexString(e,128)||!e.trim().length?u(void 0):u("Incorrect format of swarm hash. Expected 64 or 128 hexstring characters.")},helperText:s,confirmLabel:"Search",confirmLabelDisabled:Boolean(s)||n,placeholder:"e.g. 31fb0362b1a42536134c86bc58b97ac0244e5c6630beec3e27c2d1cecb38c605",expandedOnly:!0,mapperFn:function(e){return function(e){return e.length<64?e:function(e){var t=e.match(/[a-fA-F0-9]{64,128}/);return t&&t[0]||null}(e)||e}(e)}}),Object(p.jsx)(Et,{title:"Download History",localStorageKey:xt.DOWNLOAD_HISTORY})]})}var It=n(632),Rt=n(200),Ut=n(201),Ft=n.n(Ut);function Wt(){return Object(p.jsx)(re.a,{container:!0,direction:"row",justifyContent:"center",alignItems:"center",children:Object(p.jsx)(ne.a,{})})}var Ht=["index.html","index.htm"];function zt(e){if(!e.length)return!1;var t=e.find((function(e){return Ht.includes(e.path)}));if(t)return t.name;var n=e[0].path.split("/")[0]+"/";if(e.every((function(e){return e.path.startsWith(n)}))){var a=e.find((function(e){return Ht.map((function(e){return n+e})).includes(e.path)}));if(a)return a.name}return!1}function Mt(e){return{name:e.name,size:e.data.byteLength,type:e.contentType,arrayBuffer:function(){return new Promise((function(t){return t(e.data)}))}}}function Vt(e){return Object.entries(e).map((function(e){return{name:e[0],path:e[0],type:"n/a",size:0,webkitRelativePath:e[0],arrayBuffer:function(){return new Promise((function(e){return e(new ArrayBuffer(0))}))}}}))}function qt(e){return 1===e.length?e[0].name:e[0].path.split("/")[0]}var Yt=function e(t){var n=this;Object(d.a)(this,e),this.name=void 0,this.path=void 0,this.type=void 0,this.size=void 0,this.webkitRelativePath=void 0,this.arrayBuffer=void 0,this.data=void 0;var a=Reflect.get(t,"path")||t.webkitRelativePath||t.name;this.path=a.startsWith("/")?a.slice(1):a,this.webkitRelativePath=this.path,this.name=t.name,this.type=t.type,this.size=t.size,this.data=t.arrayBuffer(),this.arrayBuffer=Object(A.a)(B.a.mark((function e(){var t;return B.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.data;case 2:return t=e.sent,e.abrupt("return",t);case 4:case"end":return e.stop()}}),e)})))},Zt=n(605),Gt=n(604),Kt=n(606),Xt=Object(f.a)((function(){return Object(x.a)({image:{width:"100%",height:"100%",objectFit:"cover"}})}));function Jt(e){var t=Xt(),n={};return e.maxHeight&&(n.maxHeight=e.maxHeight),e.maxWidth&&(n.maxWidth=e.maxWidth),Object(p.jsx)("img",{className:t.image,alt:e.alt,src:e.src,style:n})}var $t=Object(f.a)((function(){return Object(x.a)({wrapper:{display:"flex",justifyContent:"center",alignItems:"center",width:"175px",height:"175px",background:"repeating-linear-gradient(\n 45deg,\n #efefef,\n #efefef 4px,\n #ffffff 4px,\n #ffffff 8px\n )"}})}));function Qt(e){var t=e.children,n=$t();return Object(p.jsx)("div",{className:n.wrapper,children:t})}function en(e){var t=e.icon;return Object(p.jsx)(Qt,{children:t})}function tn(e){var t=e.assetName,n=e.files,r=Object(a.useState)(void 0),c=Object(m.a)(r,2),o=c[0],i=c[1],s=Object(a.useState)(void 0),l=Object(m.a)(s,2),u=l[0],d=l[1];Object(a.useEffect)((function(){1===n.length?n[0].type.startsWith("image/")?n[0].arrayBuffer().then((function(e){var t=new Blob([e]);d(URL.createObjectURL(t))})):(d(void 0),i(Object(p.jsx)(en,{icon:Object(p.jsx)(Gt.a,{})}))):zt(n)?(d(void 0),i(Object(p.jsx)(en,{icon:Object(p.jsx)(Zt.a,{})}))):(d(void 0),i(Object(p.jsx)(en,{icon:Object(p.jsx)(Kt.a,{})})))}),[n]);var b,j=function(){return 1===n.length?n[0].type:zt(n)?"Website":"Folder"},h=(b=n.reduce((function(e,t){return e+t.size}),0))>=1e6?(b/1e6).toFixed(2)+" MB":b>=1e3?(b/1e3).toFixed(2)+" kB":b+" bytes";return Object(p.jsxs)(It.a,{mb:4,children:[Object(p.jsx)(It.a,{bgcolor:"background.paper",children:Object(p.jsxs)(re.a,{container:!0,direction:"row",children:[o||Object(p.jsx)(Jt,{maxWidth:"250px",maxHeight:"175px",alt:"Upload Preview",src:u}),Object(p.jsxs)(It.a,{p:2,children:[Object(p.jsx)(xe.a,{children:function(){var e=qt(n);return 1===n.length?"Filename: "+(t||e):"Folder name: "+(t||e)}()}),Object(p.jsxs)(xe.a,{children:["Kind: ",j()]}),"0 bytes"!==h&&Object(p.jsxs)(xe.a,{children:["Size: ",h]})]})]})}),["Folder","Website"].includes(j())&&Object(p.jsx)(It.a,{mt:.25,p:2,bgcolor:"background.paper",children:Object(p.jsxs)(re.a,{container:!0,justifyContent:"space-between",alignItems:"center",direction:"row",children:[Object(p.jsx)(xe.a,{variant:"subtitle2",children:"Folder content"}),Object(p.jsxs)(xe.a,{variant:"subtitle2",children:[n.length," items"]})]})})]})}function nn(e){var t=e.hash;return Object(p.jsxs)(p.Fragment,{children:[Object(p.jsxs)(It.a,{mb:4,children:[Object(p.jsx)(Le,{label:"Swarm hash",value:t}),Object(p.jsx)(Tt,{label:"Share on Swarm Gateway",value:"https://gateway.ethswarm.org/access/".concat(t)})]}),Object(p.jsxs)(xe.a,{children:["The Swarm Gateway is graciously provided by the Swarm Foundation. This service is under development and provided for testing purposes only. Learn more at"," ",Object(p.jsx)("a",{href:"https://gateway.ethswarm.org/",children:"https://gateway.ethswarm.org/"}),"."]})]})}var an=n(608),rn=n(607),cn=Object(f.a)((function(){return Object(x.a)({button:{position:"relative",whiteSpace:"nowrap","&:hover, &:focus":{"& svg":{stroke:"#fff",transition:"0.1s"}}},spinnerWrapper:{position:"absolute",left:"50%",top:"50%",width:"40px",height:"40px",transform:"translate(-50%, -50%)"}})}));function on(e){var t=e.children,n=e.onClick,a=e.iconType,c=e.className,o=e.disabled,i=e.loading,s=cn(),l=r.a.createElement(a,{size:"1.25rem",color:o?"rgba(0, 0, 0, 0.26)":"#dd7700"}),u=c?[c,s.button].join(" "):s.button;return Object(p.jsxs)(Ie.a,{className:u,onClick:function(e){n(),e.currentTarget.blur()},variant:"contained",startIcon:l,disabled:o,children:[t,i&&Object(p.jsx)("div",{className:s.spinnerWrapper,children:Object(p.jsx)(ne.a,{})})]})}function sn(e){var t=e.onOpen,n=e.onDownload,a=e.onCancel,r=e.hasIndexDocument,c=e.loading;return Object(p.jsxs)(Te,{children:[r&&Object(p.jsx)(on,{onClick:t,iconType:rn.a,disabled:c,children:"View Website"}),Object(p.jsx)(on,{onClick:n,iconType:lt.a,disabled:c,loading:c,children:"Download"}),Object(p.jsx)(Ie.a,{onClick:a,variant:"contained",startIcon:Object(p.jsx)(an.a,{}),disabled:c,children:"Close"})]})}function ln(e){var t=Object(a.useContext)(Y),n=t.apiUrl,r=t.beeApi,c=e.match.params.hash,o=Object(Oe.f)(),i=Object(a.useState)(!0),s=Object(m.a)(i,2),l=s[0],u=s[1],d=Object(a.useState)(!1),b=Object(m.a)(d,2),j=b[0],h=b[1],O=Object(a.useState)([]),f=Object(m.a)(O,2),x=f[0],g=f[1],v=Object(a.useState)({}),y=Object(m.a)(v,2),w=y[0],S=y[1],k=Object(a.useState)(null),C=Object(m.a)(k,2),T=C[0],E=C[1];function P(){return P=Object(A.a)(B.a.mark((function e(){var t,n,a,o;return B.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r){e.next=2;break}return e.abrupt("return");case 2:return t=new bt.ManifestJs(r),e.next=5,t.isManifest(c);case 5:if(e.sent){e.next=8;break}throw Error("The specified hash does not contain valid content.");case 8:return e.next=10,t.getHashes(c);case 10:return n=e.sent,S(n),e.next=14,t.getIndexDocumentPath(c);case 14:if(a=e.sent,E(a),1!==Object.keys(n).length){e.next=23;break}return e.next=19,r.downloadFile(c);case 19:o=e.sent,g([new Yt(Mt(o))]),e.next=24;break;case 23:g(Vt(n));case 24:case"end":return e.stop()}}),e)}))),P.apply(this,arguments)}function N(){return(N=Object(A.a)(B.a.mark((function e(){var t,a,o,i,s,l,u;return B.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r){e.next=2;break}return e.abrupt("return");case 2:if(wt(xt.DOWNLOAD_HISTORY,c,Ct(c,T)),h(!0),1!==Object.keys(w).length){e.next=8;break}window.open("".concat(n,"/bzz/").concat(c,"/"),"_blank"),e.next=25;break;case 8:t=new Ft.a,a=0,o=Object.entries(w);case 10:if(!(a<o.length)){e.next=21;break}return i=Object(m.a)(o[a],2),s=i[0],l=i[1],e.t0=t,e.t1=s,e.next=16,r.downloadData(l);case 16:e.t2=e.sent,e.t0.file.call(e.t0,e.t1,e.t2);case 18:a++,e.next=10;break;case 21:return e.next=23,t.generateAsync({type:"blob"});case 23:u=e.sent,Object(Rt.saveAs)(u,c+".zip");case 25:h(!1);case 26:case"end":return e.stop()}}),e)})))).apply(this,arguments)}Object(a.useEffect)((function(){u(!0),function(){return P.apply(this,arguments)}().then((function(){u(!1)}))}),[c]);var _=yt(c);return l?Object(p.jsx)(Wt,{}):Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(It.a,{mb:4,children:Object(p.jsx)(tn,{files:x,assetName:_})}),Object(p.jsx)(It.a,{mb:4,children:Object(p.jsx)(nn,{hash:c})}),Object(p.jsx)(sn,{onOpen:function(){window.open("".concat(n,"/bzz/").concat(c,"/"),"_blank")},onCancel:function(){"POP"===o.action?o.push(ya.UPLOAD):o.goBack()},onDownload:function(){return N.apply(this,arguments)},hasIndexDocument:Boolean(T&&x.length>1),loading:j})]})}var un=n(609),dn=Object(f.a)((function(){return Object(x.a)({pressable:{cursor:"pointer"},icon:{color:"#242424"}})}));function bn(e){var t=e.children,n=dn(),a=Object(Oe.f)();return Object(p.jsx)(It.a,{mb:4,children:Object(p.jsxs)(re.a,{container:!0,direction:"row",children:[Object(p.jsx)(It.a,{mr:2,children:Object(p.jsx)("div",{className:n.pressable,onClick:function(){a.goBack()},children:Object(p.jsx)(un.a,{className:n.icon})})}),Object(p.jsx)(xe.a,{variant:"h1",children:t})]})})}var jn={files:[],setFiles:function(){}},hn=Object(a.createContext)(jn);hn.Consumer;function pn(e){var t=e.children,n=Object(a.useState)(jn.files),r=Object(m.a)(n,2),c=r[0],o=r[1];return Object(p.jsx)(hn.Provider,{value:{files:c,setFiles:o},children:t})}var On={stamps:null,error:null,isLoading:!1,lastUpdate:null,start:function(){},stop:function(){},refresh:function(){return Promise.reject()}},mn=Object(a.createContext)(On);mn.Consumer;function fn(e){var t=e.depth,n=e.bucketDepth,a=e.utilization/Math.pow(2,t-n),r="".concat(Math.ceil(100*a),"%");return Object(T.a)(Object(T.a)({},e),{},{usage:a,usageText:r})}function xn(e){var t=e.children,n=Object(a.useContext)(Y).beeDebugApi,r=Object(a.useState)(On.stamps),c=Object(m.a)(r,2),o=c[0],i=c[1],s=Object(a.useState)(On.error),l=Object(m.a)(s,2),u=l[0],d=l[1],b=Object(a.useState)(On.isLoading),j=Object(m.a)(b,2),h=j[0],O=j[1],f=Object(a.useState)(On.lastUpdate),x=Object(m.a)(f,2),g=x[0],v=x[1],y=Object(a.useState)(null),w=Object(m.a)(y,2),S=w[0],k=w[1],C=function(){var e=Object(A.a)(B.a.mark((function e(){var t;return B.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!h){e.next=2;break}return e.abrupt("return");case 2:if(n){e.next=4;break}return e.abrupt("return");case 4:return e.prev=4,O(!0),e.next=8,n.getAllPostageBatch();case 8:t=e.sent,i(t.map(fn)),v(Date.now()),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(4),d(e.t0);case 16:return e.prev=16,O(!1),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[4,13,16,19]])})));return function(){return e.apply(this,arguments)}}();return Object(a.useEffect)((function(){if(C(),S){var e=setInterval(C,S);return function(){return clearInterval(e)}}}),[S]),Object(p.jsx)(mn.Provider,{value:{stamps:o,error:u,isLoading:h,lastUpdate:g,start:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e4;return k(e)},stop:function(){return k(null)},refresh:C},children:t})}var gn=n(51),vn=n(133),yn={depth:"",amount:"",label:""},wn=Object(f.a)((function(e){return Object(x.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 Sn(e){var t=e.onClose,n=wn(),r=Object(a.useContext)(mn).refresh,c=Object(a.useContext)(Y).beeDebugApi,o=Object(l.b)().enqueueSnackbar;return Object(p.jsx)(gn.c,{initialValues:yn,onSubmit:function(){var e=Object(A.a)(B.a.mark((function e(n,a){var i,s,l;return B.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,n.depth&&n.amount){e.next=3;break}return e.abrupt("return");case 3:if(c){e.next=5;break}return e.abrupt("return");case 5:return i=BigInt(n.amount),s=Number.parseInt(n.depth),l=n.label?{label:n.label}:void 0,e.next=10,c.createPostageBatch(i.toString(),s,l);case 10:return a.resetForm(),e.next=13,r();case 13:t(),e.next=20;break;case 16:e.prev=16,e.t0=e.catch(0),o("Error: ".concat(e.t0.message),{variant:"error"}),a.setSubmitting(!1);case 20:case"end":return e.stop()}}),e,null,[[0,16]])})));return function(t,n){return e.apply(this,arguments)}}(),validate:function(e){var t={};if(e.depth){var n=new R.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 R.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,r=e.isValid,c=e.isSubmitting,o=e.values;return Object(p.jsx)(gn.b,{children:Object(p.jsxs)(Re.a,{open:!0,onClose:t,"aria-labelledby":"form-dialog-title",children:[Object(p.jsx)(He.a,{id:"form-dialog-title",children:"Buy new postage stamp"}),Object(p.jsxs)(Fe.a,{children:[Object(p.jsx)(gn.a,{component:vn.a,required:!0,name:"depth",autoFocus:!0,label:"Depth",fullWidth:!0,className:n.field}),Object(p.jsx)(gn.a,{component:vn.a,required:!0,name:"amount",label:"Amount",fullWidth:!0,className:n.field}),Object(p.jsx)(gn.a,{component:vn.a,name:"label",label:"Label",fullWidth:!0,className:n.field})]}),Object(p.jsxs)(Ue.a,{children:[Object(p.jsx)(Ie.a,{onClick:t,variant:"contained",children:"Cancel"}),Object(p.jsx)("div",{className:n.wrapper,children:Object(p.jsxs)(Ie.a,{disabled:c||!r||!o.amount||!o.depth,type:"submit",variant:"contained",onClick:a,children:["Create",c&&Object(p.jsx)(ne.a,{size:24,className:n.buttonProgress})]})})]}),Object(p.jsx)(Fe.a,{children:Object(p.jsx)(We.a,{children:"Please refer to the official Bee documentation to understand these values."})})]})})}})}var kn=n(611),Cn=n(634),Bn=n(613),An=n(614),Tn=Object(f.a)((function(e){return Object(x.a)({dialog:{background:e.palette.background.default,borderRadius:0,width:"100%",maxWidth:"890px"},title:{color:"#606060",textAlign:"center"},select:{background:e.palette.background.paper,borderRadius:0,border:0},option:{height:"52px"},hint:{marginBottom:"16px"}})}));function En(e){var t=e.stamps,n=e.onSelect,r=e.onClose,c=Object(a.useState)(null),o=Object(m.a)(c,2),i=o[0],s=o[1],l=Tn();return Object(p.jsxs)(Re.a,{open:!0,onClose:r,"aria-labelledby":"form-dialog-title",fullWidth:!0,PaperProps:{className:l.dialog},children:[Object(p.jsx)(He.a,{id:"form-dialog-title",className:l.title,children:"Select postage stamp"}),Object(p.jsx)(Fe.a,{children:Object(p.jsx)(kn.a,{fullWidth:!0,children:Object(p.jsx)(Cn.a,{onChange:function(e){return function(e){var n=t.find((function(t){return t.batchID===e}));n&&s(n)}(e.target.value)},fullWidth:!0,variant:"outlined",className:l.select,defaultValue:"",children:t.map((function(e){return Object(p.jsx)(Bn.a,{value:e.batchID,className:l.option,children:e.batchID.slice(0,8)},e.batchID)}))})})}),Object(p.jsx)(Fe.a,{children:Object(p.jsxs)(Te,{children:[Object(p.jsx)(Ie.a,{disabled:!i,onClick:function(){i&&(n(i),r())},variant:"contained",startIcon:Object(p.jsx)(An.a,{}),children:"Select"}),Object(p.jsx)(Ie.a,{onClick:r,variant:"contained",startIcon:Object(p.jsx)(an.a,{}),children:"Cancel"})]})})]})}function Pn(e){var t=e.width,n=e.usage,a=Math.round(100*n),r=a+"%",c=98-a+"%";return Object(p.jsx)("div",{style:{display:"flex",alignItems:"center",height:"100%",width:t},children:Object(p.jsxs)("div",{style:{display:"flex",height:"4px",width:"100%"},children:[Object(p.jsx)("div",{style:{width:r,background:"#dd7200"}}),Object(p.jsx)("div",{style:{width:"2%"}}),Object(p.jsx)("div",{style:{width:c,background:"#c9c9c9"}})]})})}function Nn(e){var t=e.stamp,n=e.shorten;return Object(p.jsx)(It.a,{p:2,width:"100%",children:Object(p.jsxs)(re.a,{container:!0,justifyContent:"space-between",alignItems:"center",direction:"row",children:[Object(p.jsx)(xe.a,{variant:"subtitle2",children:n?t.batchID.slice(0,8):t.batchID}),Object(p.jsx)(Pn,{width:"100px",usage:t.usage})]})})}function _n(e){var t=e.stamp;return Object(p.jsxs)(It.a,{mb:4,children:[Object(p.jsx)(It.a,{mb:.25,p:2,bgcolor:"background.paper",children:Object(p.jsx)(xe.a,{variant:"subtitle2",children:"Associated postage stamp:"})}),Object(p.jsx)(It.a,{bgcolor:"background.paper",children:Object(p.jsx)(Nn,{stamp:t,shorten:!0})})]})}var Dn=n(615),Ln=n(617);function In(e){var t=e.canSelectStamp,n=e.hasSelectedStamp,a=e.onUpload,r=e.onBuy,c=e.onSelect,o=e.onCancel,i=e.onClearStamp,s=e.isUploading,l=!n,u=t&&!n,d=n,b=t&&n;return Object(p.jsxs)(p.Fragment,{children:[Object(p.jsxs)(Te,{children:[l?Object(p.jsx)(on,{onClick:r,iconType:Dn.a,children:"Buy New Postage Stamp"}):null,u?Object(p.jsx)(on,{onClick:c,iconType:de.a,children:"Use Existing Postage Stamp"}):null,d?Object(p.jsx)(on,{onClick:a,iconType:pt.a,disabled:s,loading:s,children:"Upload To Your Node"}):null,b?Object(p.jsx)(on,{onClick:i,iconType:Ln.a,disabled:s,children:"Change Postage Stamp"}):null,Object(p.jsx)(Ie.a,{onClick:o,variant:"contained",startIcon:Object(p.jsx)(an.a,{}),children:"Cancel"})]}),u?Object(p.jsx)(xe.a,{children:"You need a postage stamp to upload. Please refer to the official Bee documentation to understand how postage stamps work."}):null]})}function Rn(){var e=Object(a.useState)(!1),t=Object(m.a)(e,2),n=t[0],r=t[1],c=Object(a.useState)(!1),o=Object(m.a)(c,2),i=o[0],s=o[1],u=Object(a.useState)(null),d=Object(m.a)(u,2),b=d[0],j=d[1],h=Object(a.useState)(!1),O=Object(m.a)(h,2),f=O[0],x=O[1],g=Object(a.useContext)(mn),v=g.stamps,y=g.refresh,w=Object(a.useContext)(Y).beeApi,S=Object(a.useContext)(hn),k=S.files,C=S.setFiles,B=Object(l.b)().enqueueSnackbar,A=Object(Oe.f)();k.length||(C([]),A.replace(ya.UPLOAD)),Object(a.useEffect)((function(){y()}),[]);return Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(bn,{children:"Upload"}),k.length&&Object(p.jsx)(tn,{files:k}),null!==b?Object(p.jsx)(_n,{stamp:b}):null,k.length&&Object(p.jsx)(In,{canSelectStamp:null!==v&&v.length>0,hasSelectedStamp:null!==b,onCancel:function(){C([]),j(null),x(!1)},onBuy:function(){return r(!0)},onSelect:function(){return s(!0)},onUpload:function(){if(w&&k.length&&b){var e=1===k.length?k[0].name:zt(k)||void 0;x(!0),w.uploadFiles(b.batchID,k,{indexDocument:e}).then((function(e){wt(xt.UPLOAD_HISTORY,e.reference,qt(k)),A.replace(ya.HASH.replace(":hash",e.reference))})).catch((function(e){B("Error uploading: ".concat(e.message),{variant:"error"}),x(!1)}))}},onClearStamp:function(){return j(null)},isUploading:f}),n?Object(p.jsx)(Sn,{onClose:function(){return r(!1)}}):null,v&&i?Object(p.jsx)(En,{stamps:v,onClose:function(){return s(!1)},onSelect:function(e){return j(e)}}):null]})}var Un=n(216),Fn=n(618),Wn=n(619),Hn=n(620),zn=Object(f.a)((function(e){return Object(x.a)({areaWrapper:{position:"relative",marginBottom:e.spacing(2)},dropzone:{background:e.palette.background.default,outline:"none",color:"transparent",zIndex:1,"& svg":{opacity:0}},buttonWrapper:{top:"0",left:"0",position:"absolute",display:"flex",width:"100%",height:"100%",justifyContent:"center",alignItems:"center"},button:{marginLeft:e.spacing(.5),marginRight:e.spacing(.5),zIndex:2}})}));function Mn(e){var t=e.maximumSizeInBytes,n=Object(a.useContext)(hn).setFiles,r=zn(),c=Object(Oe.f)(),o=Object(l.b)().enqueueSnackbar,i=Object(a.useState)(!1),s=Object(m.a)(i,2),u=s[0],d=s[1],b=Object(a.useState)(0),j=Object(m.a)(b,2),h=j[0],O=j[1],f=function(){return document.querySelector(".MuiDropzoneArea-root input")},x=function(){var e=f();e&&(e.setAttribute("directory",""),e.setAttribute("webkitdirectory",""),e.setAttribute("mozdirectory",""),e.click())};return Object(p.jsxs)(p.Fragment,{children:[Object(p.jsxs)("div",{className:r.areaWrapper,children:[Object(p.jsx)(Un.a,{dropzoneClass:r.dropzone,onChange:function(e){if(e){var t=e.map((function(e){return new Yt(e)})),a=1===e.length?e[0].name:zt(t)||void 0;if(e.length&&u&&!a)return o("To upload a website, there must be an index.html or index.htm in the root of the folder.",{variant:"error"}),void setTimeout((function(){O((function(e){return e+1})),n([])}),0);n(t),e.length&&c.push(ya.UPLOAD_IN_PROGRESS)}},filesLimit:1e9,maxFileSize:t,showPreviews:!1},h),Object(p.jsxs)("div",{className:r.buttonWrapper,children:[Object(p.jsx)(on,{className:r.button,onClick:function(){var e=f();e&&(e.removeAttribute("directory"),e.removeAttribute("webkitdirectory"),e.removeAttribute("mozdirectory"),e.click())},iconType:Fn.a,children:"Add File"}),Object(p.jsx)(on,{className:r.button,onClick:function(){x(),d(!1)},iconType:Wn.a,children:"Add Folder"}),Object(p.jsx)(on,{className:r.button,onClick:function(){x(),d(!0)},iconType:Hn.a,children:"Add Website"})]})]}),Object(p.jsx)(xe.a,{children:"You can click the buttons above or simply drag and drop to add a file or folder. To upload a website to Swarm, make sure that your folder contains an \u201cindex.html\u201d file."})]})}function Vn(){return Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(Dt,{active:"UPLOAD"}),Object(p.jsx)(Mn,{maximumSizeInBytes:1e9}),Object(p.jsx)(Et,{title:"Upload History",localStorageKey:xt.UPLOAD_HISTORY})]})}var qn=n(212),Yn=1e5,Zn="There may be issues with your Bee node or connection.",Gn={connectedPeers:[{minimumValue:200,explanation:"Perfect! ".concat(200," or more connected peers indicate a healthy topology."),score:2},{minimumValue:1,explanation:"Your Bee node is connected to peers, but this number should ideally be above ".concat(200,". If you have only started your Bee node, this number may increase quickly."),score:1},{minimumValue:0,explanation:"Your Bee node has not connected to any peers. "+Zn,score:0}],population:[{minimumValue:Yn,explanation:"Perfect! Your Bee node seems to have a realistic value for the network size, which means everything is working well on your end.",score:2},{minimumValue:1,explanation:"Population is usually above ".concat(Yn.toLocaleString(),". If the number does not increase within a few hours, there may be issues with your Bee node."),score:1},{minimumValue:0,explanation:"Your Bee node has no information on the network population. "+Zn,score:0}],depth:[{minimumValue:12,explanation:"Perfect! Your Bee node has the highest available depth.",score:2},{minimumValue:1,explanation:"Your Bee node is supposed to reach a depth of ".concat(12," eventually. Stagnation or decrease in this number may indicate problems with your Bee node."),score:1},{minimumValue:0,explanation:"Your Bee node has not started building its topology yet. "+Zn,score:0}]};function Kn(e,t){var n,a=Gn[e],r=a[0].score,c=Object(qn.a)(a);try{for(c.s();!(n=c.n()).done;){var o=n.value;if(t>=o.minimumValue)return{score:o.score,maximumScore:r,explanation:o.explanation}}}catch(s){c.e(s)}finally{c.f()}var i=a[a.length-1];return{score:i.score,maximumScore:r,explanation:i.explanation}}var Xn=function(e){var t,n,a,r,c,o,i={connectedPeers:Kn("connectedPeers",(null===(t=e.topology)||void 0===t?void 0:t.connected)||0),population:Kn("population",(null===(n=e.topology)||void 0===n?void 0:n.population)||0),depth:Kn("depth",(null===(a=e.topology)||void 0===a?void 0:a.depth)||0)},s=Object.values(i).reduce((function(e,t){return e+t.maximumScore}),0),l=Object.values(i).reduce((function(e,t){return e+t.score}),0),u=Math.round(l/s*100)+"%";return Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(Be,{label:"Overall Health Indicator",value:u}),Object(p.jsx)(Be,{label:"Connected Peers",value:null===(r=e.topology)||void 0===r?void 0:r.connected.toString(),tooltip:i.connectedPeers.explanation}),Object(p.jsx)(Be,{label:"Population",value:null===(c=e.topology)||void 0===c?void 0:c.population.toString(),tooltip:i.population.explanation}),Object(p.jsx)(Be,{label:"Depth",value:null===(o=e.topology)||void 0===o?void 0:o.depth.toString(),tooltip:i.depth.explanation})]})};function Jn(){var e=Object(a.useContext)(X),t=e.status,n=e.latestUserVersion,r=e.isLatestBeeVersion,c=e.latestBeeVersionUrl,o=e.topology,i=e.nodeAddresses,s=e.chequebookAddress;return t.all?Object(p.jsxs)("div",{children:[Object(p.jsxs)(we,{label:"Bee Node",defaultOpen:!0,children:[Object(p.jsx)(Be,{label:"Agent",value:Object(p.jsxs)("div",{children:[Object(p.jsx)("a",{href:"https://github.com/ethersphere/bee",rel:"noreferrer",target:"_blank",children:"Bee"})," ".concat(n||"-"," "),Object(p.jsx)(Ie.a,{size:"small",variant:"outlined",href:c,target:"_blank",children:r?"latest":"update"})]})}),Object(p.jsx)(Le,{label:"Public key",value:(null===i||void 0===i?void 0:i.publicKey)||""}),Object(p.jsx)(Le,{label:"PSS public key",value:(null===i||void 0===i?void 0:i.pssPublicKey)||""}),Object(p.jsx)(Le,{label:"Overlay address (Peer ID)",value:(null===i||void 0===i?void 0:i.overlay)||""}),Object(p.jsx)(we,{level:1,label:"Underlay addresses",children:null===i||void 0===i?void 0:i.underlay.map((function(e){return Object(p.jsx)(Be,{value:e},e)}))})]}),Object(p.jsxs)(we,{label:"Blockchain",defaultOpen:!0,children:[Object(p.jsx)(Le,{label:"Ethereum address",value:(null===i||void 0===i?void 0:i.ethereum)||""}),Object(p.jsx)(Le,{label:"Chequebook contract address",value:(null===s||void 0===s?void 0:s.chequebookAddress)||""})]}),Object(p.jsx)(we,{label:"Connectivity",defaultOpen:!0,children:Object(p.jsx)(Xn,{topology:o})})]}):Object(p.jsx)(nt,{})}function $n(){var e=Object(a.useContext)(Y),t=e.apiUrl,n=e.apiDebugUrl,r=e.setApiUrl,c=e.setDebugApiUrl,o=e.lockedApiSettings;return Object(p.jsxs)(we,{label:"API Settings",defaultOpen:!0,children:[Object(p.jsx)(vt,{label:"Bee API",value:t,onConfirm:r,locked:o}),Object(p.jsx)(vt,{label:"Bee Debug API",value:n,onConfirm:c,locked:o})]})}var Qn=Object(f.a)((function(e){return Object(x.a)({root:{width:"100%",padding:0,margin:0,marginTop:e.spacing(4),"&:first-child":{marginTop:0}},rootLevel1:{marginTop:e.spacing(1)},rootLevel2:{marginTop:e.spacing(.5)},header:{backgroundColor:e.palette.background.paper},contentLevel0:{marginTop:e.spacing(1)},contentLevel12:{marginTop:e.spacing(.25)},infoText:{color:"#c9c9c9"}})}));function ea(e){var t=e.children,n=e.expandable,r=e.defaultOpen,c=Qn(),o=Object(a.useState)(Boolean(r)),i=Object(m.a)(o,2),s=i[0],l=i[1];return Object(p.jsxs)("div",{className:"".concat(c.root," ").concat(c.rootLevel2),children:[Object(p.jsxs)(me.a,{button:!0,onClick:function(){l(!s)},className:c.header,children:[t,s?Object(p.jsx)(ge.a,{}):Object(p.jsx)(ve.a,{})]}),Object(p.jsx)(y.a,{in:s,timeout:"auto",unmountOnExit:!0,children:Object(p.jsx)("div",{className:c.contentLevel12,children:n})})]})}var ta=function(e){var t=e.postageStamps;return null===t?null:Object(p.jsx)(we,{label:"Postage Stamps",defaultOpen:!0,children:t.map((function(e){return Object(p.jsx)(ea,{expandable:Object(p.jsx)(Le,{label:"Batch ID",value:e.batchID}),children:Object(p.jsx)(Nn,{stamp:e,shorten:!0})},e.batchID)}))})},na=Object(f.a)((function(){return Object(x.a)({root:{width:"100%",display:"grid"},actions:{display:"flex",width:"100%",flex:"0 1 auto",flexWrap:"wrap",alignItems:"center"}})}));function aa(){var e=na(),t=Object(a.useState)(!1),n=Object(m.a)(t,2),r=n[0],c=n[1],o=Object(a.useContext)(mn),i=o.stamps,s=o.isLoading,l=o.error,u=o.start,d=o.stop,b=Object(a.useContext)(X).status;return Object(a.useEffect)((function(){if(b.all)return u(),function(){return d()}}),[b]),b.all?Object(p.jsxs)("div",{className:e.root,children:[l&&Object(p.jsxs)(te.a,{style:{textAlign:"center",padding:"50px"},children:["Error loading postage stamps details: ",l.message]}),!l&&Object(p.jsxs)(p.Fragment,{children:[Object(p.jsxs)("div",{className:e.actions,children:[r?Object(p.jsx)(Sn,{onClose:function(){return c(!1)}}):null,Object(p.jsx)(on,{onClick:function(){return c(!0)},iconType:Dn.a,children:"Buy New Postage Stamp"}),Object(p.jsx)("div",{style:{height:"5px"},children:s&&Object(p.jsx)(ne.a,{})})]}),Object(p.jsx)(ta,{postageStamps:i})]})]}):Object(p.jsx)(nt,{})}var ra=n(219),ca=["children","value","index"];function oa(e){var t=e.children,n=e.value,a=e.index,r=Object(ra.a)(e,ca);return Object(p.jsx)("div",Object(T.a)(Object(T.a)({role:"tabpanel",hidden:n!==a},r),{},{children:n===a&&t}))}var ia=Object(f.a)((function(e){return Object(x.a)({root:{flexGrow:1},content:{marginTop:e.spacing(2)}})}));function sa(e){var t=e.values,n=e.index,a=e.indexChanged,c=ia(),o=r.a.useState(n||0),i=Object(m.a)(o,2),s=i[0],l=i[1],u=void 0!==n?n:s;return Object(p.jsxs)("div",{className:c.root,children:[Object(p.jsx)(Pt.a,{value:u,onChange:function(e,t){a?a(t):l(t)},variant:"fullWidth",children:t.map((function(e,t){var n=e.label;return Object(p.jsx)(Nt.a,{label:n},t)}))}),Object(p.jsx)("div",{className:c.content,children:t.map((function(e,t){var n=e.component;return Object(p.jsx)(oa,{value:u,index:t,children:n},t)}))})]})}var la,ua,da=n(636),ba=function(e){return Object(p.jsx)("div",{style:{textAlign:"left"},children:Object(p.jsx)(da.a,{language:e.language,showLineNumbers:e.showLineNumbers,children:e.code})})};!function(e){e[e.macOS=0]="macOS",e[e.Linux=1]="Linux",e[e.Windows=2]="Windows",e[e.iOS=3]="iOS",e[e.Android=4]="Android"}(la||(la={})),function(e){e[e.macOS=la.macOS]="macOS",e[e.Linux=la.Linux]="Linux"}(ua||(ua={}));var ja={platform:ua.macOS,setPlatform:function(){}},ha=Object(a.createContext)(ja);ha.Consumer;function pa(e){var t=e.children,n=Object(a.useState)(ua.Linux),r=Object(m.a)(n,2),c=r[0],o=r[1];return Object(a.useEffect)((function(){var e=function(){var e=window.navigator.userAgent,t=window.navigator.platform;return["Macintosh","MacIntel","MacPPC","Mac68K"].includes(t)?la.macOS:["iPhone","iPad","iPod"].includes(t)?la.iOS:["Win32","Win64","Windows","WinCE"].includes(t)?la.Windows:/Android/.test(e)?la.Android:/Linux/.test(t)?la.Linux:null}();o(function(e){return Object.keys(ua).includes(e)}(e)?e:ua.Linux)}),[]),Object(p.jsx)(ha.Provider,{value:{platform:c,setPlatform:o},children:t})}function Oa(e){var t=Object(a.useContext)(ha),n=t.platform,r=t.setPlatform;return Object(p.jsx)(sa,{index:n,indexChanged:r,values:[{label:"Linux",component:Object(p.jsx)(ba,{showLineNumbers:e.showLineNumbers,language:"bash",code:e.linux})},{label:"macOS",component:Object(p.jsx)(ba,{showLineNumbers:e.showLineNumbers,language:"bash",code:e.mac})}]})}function ma(e){var t=e.isOk,n=e.size,a=e.className,r=n||"1rem";return e.isLoading?Object(p.jsx)(ne.a,{size:r,className:a}):Object(p.jsx)("span",{className:a,style:{backgroundColor:t?"#1de600":"#ff3a52",height:r,width:r,borderRadius:"50%",display:"inline-block"}})}function fa(){var e=Object(a.useContext)(X),t=e.status,n=e.isLoading,r=Object(a.useContext)(Y),c=r.setDebugApiUrl,o=r.apiDebugUrl,i=t.debugApiConnection;return Object(p.jsxs)(we,{label:Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(ma,{isOk:i,isLoading:n})," Connection to Bee Debug API"]}),children:[Object(p.jsx)(ft,{children:i?"The connection to the Bee nodes debug API has been successful":"We cannot connect to your nodes debug API. Please check the following to troubleshoot your issue."}),Object(p.jsx)(vt,{label:"Bee Debug API",value:o,onConfirm:c}),!i&&Object(p.jsx)(we,{level:1,label:"Troubleshoot",children:Object(p.jsx)(Be,{label:Object(p.jsxs)("ol",{children:[Object(p.jsx)("li",{children:"Check the status of your node by running the below command to see if your node is running."}),Object(p.jsx)(Oa,{showLineNumbers:!0,linux:"sudo systemctl status bee",mac:"brew services list"}),Object(p.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(p.jsx)(g.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(p.jsx)(Oa,{showLineNumbers:!0,linux:"sudo systemctl start bee",mac:"brew services start swarm-bee"}),Object(p.jsx)("li",{children:"Run the commands to validate your node is running and see the log output."}),Object(p.jsx)(Oa,{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(p.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(p.jsx)("strong",{children:"debug-api-enable"})," must be set to ",Object(p.jsx)("strong",{children:"true"})," and"," ",Object(p.jsx)("strong",{children:"cors-allowed-origins"})," must be set to your host domain or IP (you can also use the wildcard ",Object(p.jsx)("code",{children:"cors-allowed-origins: ['*']"}),"). If edits are made to the configuration run the restart command below for changes to take effect."]}),Object(p.jsx)(Oa,{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 xa(){var e=Object(a.useContext)(Y),t=e.setApiUrl,n=e.apiUrl,r=Object(a.useContext)(X),c=r.status,o=r.isLoading,i=c.apiConnection;return Object(p.jsxs)(we,{label:Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(ma,{isOk:i,isLoading:o})," Connection to Bee API"]}),children:[Object(p.jsx)(ft,{children:i?"The connection to the Bee nodes API has been successful":"Could not connect to your Bee nodes API. Please check the troubleshoot below on how you may resolve it."}),Object(p.jsx)(vt,{label:"Bee API",value:n,onConfirm:t}),!i&&Object(p.jsx)(we,{level:1,label:"Troubleshoot",children:Object(p.jsx)(Be,{label:Object(p.jsxs)("ol",{children:[Object(p.jsx)("li",{children:"Check the status of your node by running the below command to see if your node is running."}),Object(p.jsx)(Oa,{showLineNumbers:!0,linux:"sudo systemctl status bee",mac:"brew services list"}),Object(p.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(p.jsx)(Oa,{showLineNumbers:!0,linux:"sudo systemctl start bee",mac:"brew services start swarm-bee"}),Object(p.jsx)("li",{children:"Run the commands to validate your node is running and see the log output."}),Object(p.jsx)(Oa,{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 ga(){var e=Object(a.useContext)(X),t=e.status,n=e.isLoading,r=e.latestUserVersion,c=e.latestPublishedVersion,o=e.latestBeeVersionUrl,i=t.version;return Object(p.jsxs)(we,{label:Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(ma,{isOk:i,isLoading:n})," Bee Version"]}),children:[Object(p.jsx)(ft,{children:i?"You are running the latest version of Bee.":Object(p.jsxs)(p.Fragment,{children:["Your Bee version is out of date. Please update to the"," ",Object(p.jsx)("a",{href:o,rel:"noreferrer",target:"_blank",children:"latest"})," ","before continuing. Rerun the installation script below to upgrade. For more information please see the"," ",Object(p.jsx)("a",{href:"https://docs.ethswarm.org/docs/installation/manual#upgrading-bee",rel:"noreferrer",target:"_blank",children:"Docs"}),".",Object(p.jsx)(Oa,{showLineNumbers:!0,linux:"bee version\nwget https://github.com/ethersphere/bee/releases/download/".concat(c,"/bee_").concat(c,"_amd64.deb\nsudo dpkg -i bee_").concat(c,"_amd64.deb"),mac:"bee version\nbrew tap ethersphere/tap\nbrew install swarm-bee\nbrew services start swarm-bee"})]})}),Object(p.jsx)(Be,{label:"Your Version",value:r||"-"}),Object(p.jsx)(Be,{label:"Latest Version",value:c||"-"})]})}function va(){var e=Object(a.useContext)(X),t=e.status,n=e.isLoading,r=e.nodeAddresses,c=t.blockchainConnection;return Object(p.jsxs)(we,{label:Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(ma,{isOk:c,isLoading:n})," Connection to Blockchain"]}),children:[Object(p.jsx)(ft,{children:c?"Your node is connected to the xDai blockchain":Object(p.jsxs)(p.Fragment,{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(p.jsx)("a",{href:"https://www.xdaichain.com/",rel:"noreferrer",target:"_blank",children:"your own xDai node"}),", or use a provider instead - we recommend"," ",Object(p.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(p.jsx)("strong",{children:"swap-endpoint"})," in your configuration file."]})}),(null===r||void 0===r?void 0:r.ethereum)&&Object(p.jsx)(Le,{label:"Ethereum Address",value:null===r||void 0===r?void 0:r.ethereum})]})}var ya,wa=function(){var e=Object(a.useContext)(X),t=e.status,n=e.isLoading,r=e.chequebookAddress,c=t.chequebook;return Object(p.jsxs)(we,{label:Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(ma,{isOk:c,isLoading:n})," Chequebook Deployment & Funding"]}),children:[Object(p.jsx)(ft,{children:c?"Your chequebook is deployed and funded":Object(p.jsxs)(p.Fragment,{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 (e.g. ",Object(p.jsx)("a",{href:"https://bzz.exchange/",children:"bzz.exchange"}),") and bridge it to the xDai network through the ",Object(p.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(p.jsx)("a",{href:"https://bridge.xdaichain.com/",children:"xDai Bridge"}),". See the"," ",Object(p.jsx)("a",{href:"https://www.xdaichain.com/#xdai-stable-chain",children:"official xDai website"})," for more information."]})}),r&&Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(Le,{label:"Chequebook Address",value:r.chequebookAddress}),Object(p.jsx)(Te,{children:Object(p.jsx)(ut,{})})]})]})};function Sa(){var e=Object(a.useContext)(X),t=e.status,n=e.isLoading,r=e.topology,c=t.topology;return Object(p.jsxs)(we,{label:Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(ma,{isOk:c,isLoading:n})," Connection to Peers"]}),children:[Object(p.jsx)(ft,{children:c?"You are connected to other Bee nodes":"Your node is not connected to any peers. Please wait a bit if you just started the node, otherwise review your configuration file."}),Object(p.jsx)(Xn,{topology:r})]})}function ka(){return Object(p.jsxs)("div",{children:[Object(p.jsx)(fa,{}),Object(p.jsx)(ga,{}),Object(p.jsx)(va,{}),Object(p.jsx)(wa,{}),Object(p.jsx)(xa,{}),Object(p.jsx)(Sa,{})]})}!function(e){e.INFO="/",e.FILES="/files",e.UPLOAD="/files/upload",e.UPLOAD_IN_PROGRESS="/files/upload/workflow",e.DOWNLOAD="/files/download",e.HASH="/files/hash/:hash",e.ACCOUNTING="/accounting",e.SETTINGS="/settings",e.STAMPS="/stamps",e.STATUS="/status"}(ya||(ya={}));var Ca=function(){return Object(p.jsxs)(Oe.c,{children:[Object(p.jsx)(Oe.a,{exact:!0,path:ya.UPLOAD_IN_PROGRESS,component:Rn}),Object(p.jsx)(Oe.a,{exact:!0,path:ya.UPLOAD,component:Vn}),Object(p.jsx)(Oe.a,{exact:!0,path:ya.DOWNLOAD,component:Lt}),Object(p.jsx)(Oe.a,{exact:!0,path:ya.HASH,component:ln}),Object(p.jsx)(Oe.a,{exact:!0,path:ya.ACCOUNTING,component:dt}),Object(p.jsx)(Oe.a,{exact:!0,path:ya.SETTINGS,component:$n}),Object(p.jsx)(Oe.a,{exact:!0,path:ya.STAMPS,component:aa}),Object(p.jsx)(Oe.a,{exact:!0,path:ya.STATUS,component:ka}),Object(p.jsx)(Oe.a,{path:ya.INFO,component:Jn})]})},Ba=n(6),Aa=n(621),Ta=Object(Ba.a)((function(e){return{root:{paddingLeft:e.spacing(4),paddingRight:e.spacing(4),borderLeft:"4px solid rgba(0,0,0,0)","&.Mui-selected, &.Mui-selected:hover":{borderLeft:"4px solid ".concat(e.palette.primary.main),backgroundColor:"#2c2c2c",color:"#f9f9f9"}},button:{"&:hover":{backgroundColor:"#2c2c2c",color:"#f9f9f9","@media (hover: none)":{backgroundColor:"#2c2c2c",color:"#f9f9f9"}}}}}))(me.a),Ea=Object(f.a)((function(e){return Object(x.a)({icon:{color:"inherit"},activeIcon:{color:e.palette.primary.main}})}));function Pa(e){var t=e.iconStart,n=e.iconEnd,a=e.path,r=e.label,c=Ea(),o=Object(Oe.g)(),i=Boolean(Object(Oe.e)(o.pathname,{path:a,exact:!0}));return Object(p.jsxs)(Ta,{button:!0,selected:i,disableRipple:!0,children:[Object(p.jsx)(Aa.a,{className:i?c.activeIcon:c.icon,children:t}),Object(p.jsx)(fe.a,{primary:r}),Object(p.jsx)(Aa.a,{className:i?c.activeIcon:c.icon,children:n})]})}var Na=n(622),_a=Object(f.a)((function(e){return Object(x.a)({icon:{color:"inherit"},iconSmall:{height:e.spacing(2)},root:{height:e.spacing(4),paddingLeft:e.spacing(1),paddingRight:e.spacing(4),color:"#f9f9f9",borderLeft:"0px solid rgba(0,0,0,0)","&.Mui-selected, &.Mui-selected:hover":{borderLeft:"0px solid ".concat(e.palette.primary.main),backgroundColor:"#2c2c2c"}},rootError:{backgroundColor:"rgba(255, 58, 82, 0.25)"},button:{"&:hover":{backgroundColor:"#2c2c2c",color:"white","@media (hover: none)":{backgroundColor:"#2c2c2c",color:"white"}}},smallerText:{fontSize:"0.9rem"}})}));function Da(e){var t=e.path,n=Object(a.useContext)(X),r=n.status,c=n.isLoading,o=_a(),i=Object(Oe.g)(),s=Boolean(Object(Oe.e)(i.pathname,{path:t,exact:!0}));return Object(p.jsxs)(me.a,{button:!0,classes:{root:"".concat(o.root," ").concat(r.all?"":o.rootError),button:o.button},selected:s,disableRipple:!0,children:[Object(p.jsx)(Aa.a,{style:{marginLeft:"30px"},children:Object(p.jsx)(ma,{isOk:r.all,isLoading:c})}),Object(p.jsx)(fe.a,{primary:Object(p.jsx)(xe.a,{className:o.smallerText,children:"Node ".concat(r.all?"OK":"Error")})}),Object(p.jsx)(Aa.a,{className:o.icon,children:r.all?null:Object(p.jsx)(Na.a,{className:o.iconSmall})})]})}var La=[{label:"Info",path:ya.INFO,icon:le.a},{label:"Files",path:ya.UPLOAD,icon:ue.a},{label:"Stamps",path:ya.STAMPS,icon:de.a},{label:"Accounting",path:ya.ACCOUNTING,icon:be.a},{label:"Settings",path:ya.SETTINGS,icon:je.a}],Ia=Object(f.a)((function(e){return Object(x.a)({root:{flexWrap:"nowrap",minHeight:"100vh",paddingTop:e.spacing(8),paddingBottom:e.spacing(8)},drawer:{width:300,flexShrink:0},drawerPaper:{width:300,backgroundColor:"#212121"},logo:{marginLeft:e.spacing(8),marginRight:e.spacing(8)},icon:{height:e.spacing(4)},iconSmall:{height:e.spacing(2)},divider:{backgroundColor:"#2c2c2c",marginLeft:e.spacing(4),marginRight:e.spacing(4)},link:{color:"#9f9f9f",textDecoration:"none","&:hover":{textDecoration:"none","@media (hover: none)":{textDecoration:"none"}}}})}));function Ra(){var e=Ia();return Object(p.jsx)(ae.a,{className:e.drawer,variant:"permanent",anchor:"left",classes:{paper:e.drawerPaper},children:Object(p.jsxs)(re.a,{container:!0,direction:"column",justifyContent:"space-between",className:e.root,children:[Object(p.jsx)(re.a,{className:e.logo,children:Object(p.jsx)(u.b,{to:ya.INFO,children:Object(p.jsx)("img",{alt:"swarm",src:pe})})}),Object(p.jsxs)(re.a,{children:[Object(p.jsx)(ce.a,{children:La.map((function(t){return Object(p.jsx)(u.b,{to:t.path,className:e.link,children:Object(p.jsx)(Pa,{iconStart:Object(p.jsx)(t.icon,{className:e.icon}),path:t.path,label:t.label},t.path)},t.path)}))}),Object(p.jsx)(oe.a,{className:e.divider}),Object(p.jsx)(ce.a,{children:Object(p.jsx)(ie.a,{href:L.a.BEE_DOCS_HOST,target:"_blank",className:e.link,children:Object(p.jsx)(Pa,{iconStart:Object(p.jsx)(he.a,{className:e.icon}),iconEnd:Object(p.jsx)(se.a,{className:e.iconSmall}),label:Object(p.jsx)("span",{children:"Docs"})})})})]}),Object(p.jsx)(re.a,{children:Object(p.jsx)(u.b,{to:ya.STATUS,className:e.link,children:Object(p.jsx)(Da,{path:ya.STATUS})})})]})})}var Ua,Fa=Object(f.a)((function(e){return Object(x.a)({content:{backgroundColor:e.palette.background.default,minHeight:"100vh"}})})),Wa=function(e){var t=Fa(),n=Object(a.useContext)(X).isLoading;return Object(p.jsxs)("div",{style:{display:"flex"},children:[Object(p.jsx)(Ra,{}),Object(p.jsx)(te.a,{className:t.content,children:Object(p.jsx)(O,{children:Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(ee,{}),n?Object(p.jsx)("div",{style:{textAlign:"center",width:"100%"},children:Object(p.jsx)(ne.a,{})}):e.children]})})})]})},Ha=n(215),za=n(132),Ma=Object(Ha.a)({palette:{type:"light",background:{default:"#efefef"},primary:{light:"#fcf2e8",main:"#dd7700",dark:za.a[800]},secondary:{main:"#333333"}},typography:{fontFamily:["Work Sans","Montserrat","Nunito","Roboto",'"Helvetica Neue"',"Arial","sans-serif"].join(","),h1:{fontSize:"1.3rem",fontWeight:500},h2:{fontSize:"1rem",fontWeight:500},h3:{fontSize:"0.8rem",fontWeight:500},body2:{fontFamily:'"IBM Plex Mono", monospace',fontWeight:500,fontSize:"1rem"}}});Ma.overrides={MuiListItem:{button:{"&:hover":{backgroundColor:"#fcf2e8",color:(Ua=Ma).palette.primary.main,"@media (hover: none)":{backgroundColor:"#fcf2e8",color:Ua.palette.primary.main}}}},MuiContainer:{root:{padding:Ua.spacing(8)},maxWidthXs:{padding:Ua.spacing(8)},maxWidthSm:{padding:Ua.spacing(8)},maxWidthMd:{padding:Ua.spacing(8)},maxWidthLg:{padding:Ua.spacing(8)},maxWidthXl:{padding:Ua.spacing(8)}},MuiButton:{startIcon:{marginLeft:Ua.spacing(1)},endIcon:{marginRight:Ua.spacing(1)},outlined:{border:"none",borderRadius:Ua.spacing(10),color:Ua.palette.primary.main,backgroundColor:"#fcf2e8"},outlinedSizeSmall:{padding:Ua.spacing(1),paddingLeft:Ua.spacing(2),paddingRight:Ua.spacing(2),boxShadow:"none","&:hover":{backgroundColor:Ua.palette.primary.main,color:"white",boxShadow:"none","@media (hover: none)":{backgroundColor:Ua.palette.primary.main,color:"white",boxShadow:"none"}}},outlinedSizeLarge:{padding:Ua.spacing(4),borderRadius:0,boxShadow:"none","&:hover":{backgroundColor:Ua.palette.primary.main,color:"white",boxShadow:"none","@media (hover: none)":{backgroundColor:Ua.palette.primary.main,color:"white",boxShadow:"none"}}},containedSizeLarge:{padding:Ua.spacing(4),borderRadius:0,boxShadow:"none","&:hover":{backgroundColor:Ua.palette.primary.main,color:"white",boxShadow:"none","@media (hover: none)":{backgroundColor:Ua.palette.primary.main,color:"white",boxShadow:"none"}}},containedSizeSmall:{padding:Ua.spacing(1),paddingLeft:Ua.spacing(2),paddingRight:Ua.spacing(2),borderRadius:0,boxShadow:"none","&:hover":{backgroundColor:Ua.palette.primary.main,color:"white",boxShadow:"none","@media (hover: none)":{backgroundColor:Ua.palette.primary.main,color:"white",boxShadow:"none"}}},contained:{padding:Ua.spacing(2),backgroundColor:"white",boxShadow:"none",borderRadius:0,"&:hover":{backgroundColor:Ua.palette.primary.main,color:"white",boxShadow:"none","@media (hover: none)":{backgroundColor:Ua.palette.primary.main,color:"white",boxShadow:"none"}},"&:focus":{backgroundColor:Ua.palette.primary.main,color:"white"},"&:active":{backgroundColor:Ua.palette.primary.main,color:"white"},"&:disabled":{backgroundColor:"white"}}},MuiTab:{root:{backgroundColor:Ua.palette.background.paper,"&:hover":{backgroundColor:"#fcf2e8",color:Ua.palette.primary.main,opacity:1},"&$selected":{fontWeight:Ua.typography.fontWeightMedium}},textColorInherit:{opacity:.5}},MuiTabs:{root:{borderBottom:"none"},indicator:{backgroundColor:"transparent"}}},Ma.props={MuiTab:{disableRipple:!0},MuiButtonBase:{disableRipple:!0}};var Va=function(e){var t=e.beeApiUrl,n=e.beeDebugApiUrl,a=e.lockedApiSettings;return Object(p.jsx)("div",{className:"App",children:Object(p.jsx)(s.a,{theme:Ma,children:Object(p.jsx)(Z,{beeApiUrl:t,beeDebugApiUrl:n,lockedApiSettings:a,children:Object(p.jsx)($,{children:Object(p.jsx)(xn,{children:Object(p.jsx)(pn,{children:Object(p.jsx)(pa,{children:Object(p.jsx)(l.a,{children:Object(p.jsx)(u.a,{children:Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(i.a,{}),Object(p.jsx)(Wa,{children:Object(p.jsx)(Ca,{})})]})})})})})})})})})})},qa=function(e){e&&e instanceof Function&&n.e(3).then(n.bind(null,640)).then((function(t){var n=t.getCLS,a=t.getFID,r=t.getFCP,c=t.getLCP,o=t.getTTFB;n(e),a(e),r(e),c(e),o(e)}))};o.a.render(Object(p.jsx)(r.a.StrictMode,{children:Object(p.jsx)(Va,{})}),document.getElementById("root")),qa()}},[[530,1,2]]]);
|
|
2
|
+
//# sourceMappingURL=main.83c3a1a6.chunk.js.map
|