\ No newline at end of file
diff --git a/renterd/assets/_next/static/DhCDGrAedZ1ed72AMDF1_/_buildManifest.js b/renterd/assets/_next/static/_et0AI6yuiqRgs-Qs3VAA/_buildManifest.js
similarity index 89%
rename from renterd/assets/_next/static/DhCDGrAedZ1ed72AMDF1_/_buildManifest.js
rename to renterd/assets/_next/static/_et0AI6yuiqRgs-Qs3VAA/_buildManifest.js
index 8c2d1de8a..b92a9ff7e 100644
--- a/renterd/assets/_next/static/DhCDGrAedZ1ed72AMDF1_/_buildManifest.js
+++ b/renterd/assets/_next/static/_et0AI6yuiqRgs-Qs3VAA/_buildManifest.js
@@ -1 +1 @@
-self.__BUILD_MANIFEST=function(s){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/":["static/chunks/pages/index-337e1779f85f0e02.js"],"/_error":["static/chunks/pages/_error-4dfdedf844297a3b.js"],"/alerts":["static/chunks/pages/alerts-8c9a007a8e78cc18.js"],"/buckets":[s,"static/chunks/pages/buckets-8030b904192e6bd3.js"],"/buckets/[bucket]/files/[[...path]]":[s,"static/chunks/pages/buckets/[bucket]/files/[[...path]]-0b6c7fddc068f7a4.js"],"/buckets/[bucket]/uploads":["static/chunks/pages/buckets/[bucket]/uploads-f3223af501a990c8.js"],"/config":["static/chunks/pages/config-e049d91a502e042e.js"],"/contracts":["static/chunks/pages/contracts-dc0bc9cf9e4488a2.js"],"/hosts":["static/chunks/pages/hosts-4e50519b4ec175fc.js"],"/keys":["static/chunks/pages/keys-2c6dc4b775f55750.js"],"/login":["static/chunks/pages/login-7e91176bb9a8308b.js"],"/node":["static/chunks/pages/node-9fd581721c1714ca.js"],"/wallet":["static/chunks/pages/wallet-6769328adb3b2364.js"],sortedPages:["/","/_app","/_error","/alerts","/buckets","/buckets/[bucket]/files/[[...path]]","/buckets/[bucket]/uploads","/config","/contracts","/hosts","/keys","/login","/node","/wallet"]}}("static/chunks/448-c4b4d96c451d40c6.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
\ No newline at end of file
+self.__BUILD_MANIFEST=function(s){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/":["static/chunks/pages/index-337e1779f85f0e02.js"],"/_error":["static/chunks/pages/_error-4dfdedf844297a3b.js"],"/alerts":["static/chunks/pages/alerts-8c9a007a8e78cc18.js"],"/buckets":[s,"static/chunks/pages/buckets-8030b904192e6bd3.js"],"/buckets/[bucket]/files/[[...path]]":[s,"static/chunks/pages/buckets/[bucket]/files/[[...path]]-0b6c7fddc068f7a4.js"],"/buckets/[bucket]/uploads":["static/chunks/pages/buckets/[bucket]/uploads-2ae34e6ce9470e40.js"],"/config":["static/chunks/pages/config-e049d91a502e042e.js"],"/contracts":["static/chunks/pages/contracts-dc0bc9cf9e4488a2.js"],"/hosts":["static/chunks/pages/hosts-4e50519b4ec175fc.js"],"/keys":["static/chunks/pages/keys-2c6dc4b775f55750.js"],"/login":["static/chunks/pages/login-7e91176bb9a8308b.js"],"/node":["static/chunks/pages/node-9fd581721c1714ca.js"],"/wallet":["static/chunks/pages/wallet-6769328adb3b2364.js"],sortedPages:["/","/_app","/_error","/alerts","/buckets","/buckets/[bucket]/files/[[...path]]","/buckets/[bucket]/uploads","/config","/contracts","/hosts","/keys","/login","/node","/wallet"]}}("static/chunks/448-d0f934bc853d5322.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
\ No newline at end of file
diff --git a/renterd/assets/_next/static/DhCDGrAedZ1ed72AMDF1_/_ssgManifest.js b/renterd/assets/_next/static/_et0AI6yuiqRgs-Qs3VAA/_ssgManifest.js
similarity index 100%
rename from renterd/assets/_next/static/DhCDGrAedZ1ed72AMDF1_/_ssgManifest.js
rename to renterd/assets/_next/static/_et0AI6yuiqRgs-Qs3VAA/_ssgManifest.js
diff --git a/renterd/assets/_next/static/chunks/448-c4b4d96c451d40c6.js b/renterd/assets/_next/static/chunks/448-c4b4d96c451d40c6.js
deleted file mode 100644
index f19d6d976..000000000
--- a/renterd/assets/_next/static/chunks/448-c4b4d96c451d40c6.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[448],{17398:function(e,s,t){t.d(s,{C:function(){return o}});var l=t(52322),i=t(36655),n=t(61020),a=t(41736),r=t(73076);function c(){let{activeExplorerMode:e,setExplorerModeDirectory:s,setExplorerModeFlat:t}=(0,a.b)(),{isViewingUploads:c,navigateToUploads:o}=(0,r.x)();return(0,l.jsxs)(i.h_2,{trigger:(0,l.jsx)(i.zxk,{tipSide:"bottom",tip:c?"Viewing uploads":"directory"===e?"Viewing directory explorer":"Viewing all bucket files",children:c?(0,l.jsx)(n.bQp,{}):"directory"===e?(0,l.jsx)(n.Qbr,{}):(0,l.jsx)(n.nDH,{})}),contentProps:{align:"start",side:"bottom",className:"max-w-[300px]"},children:[(0,l.jsxs)(i.Xiv,{onSelect:s,children:[(0,l.jsx)(i.KpP,{children:(0,l.jsx)(n.Qbr,{})}),"Directory"]}),(0,l.jsxs)(i.Xiv,{onSelect:t,children:[(0,l.jsx)(i.KpP,{children:(0,l.jsx)(n.nDH,{})}),"All files"]}),(0,l.jsxs)(i.Xiv,{onSelect:o,children:[(0,l.jsx)(i.KpP,{children:(0,l.jsx)(n.bQp,{})}),"Uploads"]})]})}function o(){let{isViewingBuckets:e}=(0,a.b)();return e?(0,l.jsx)(i.ua7,{content:"Viewing all buckets",children:(0,l.jsx)("div",{children:(0,l.jsx)(i.zxk,{state:"waiting",children:(0,l.jsx)(n.fi8,{size:16})})})}):(0,l.jsx)(c,{})}},57448:function(e,s,t){t.d(s,{h:function(){return et}});var l=t(52322),i=t(97992),n=t(98334),a=t(97112),r=t(2784),c=t(36655),o=t(61020),d=t(41736),x=t(17398);function u(){let{activeDirectory:e,setActiveDirectory:s}=(0,d.b)(),t=(0,r.useRef)(null);return(0,r.useEffect)(()=>{let e=setTimeout(()=>{var e;null===(e=t.current)||void 0===e||e.scrollIntoView({behavior:"smooth"})},100);return()=>{clearTimeout(e)}},[e]),(0,l.jsxs)("div",{className:"flex gap-2 items-center h-full",children:[(0,l.jsx)(x.C,{}),(0,l.jsx)(c.xrM,{children:(0,l.jsxs)("div",{className:"flex gap-1 items-center h-full",children:[(0,l.jsx)(c.xvT,{onClick:()=>s(()=>[]),size:"18",weight:"semibold",className:"flex items-center cursor-pointer",noWrap:!0,children:"Buckets"}),e.length>0&&(0,l.jsx)(c.xvT,{size:"16",color:"verySubtle",className:"flex items-center",children:(0,l.jsx)(o.F3j,{})}),e.map((e,t)=>(0,l.jsxs)(r.Fragment,{children:[t>0&&(0,l.jsx)(c.xvT,{size:"16",color:"verySubtle",className:"flex items-center",children:(0,l.jsx)(o.F3j,{})}),(0,l.jsx)(c.xvT,{onClick:()=>s(e=>e.slice(0,t+1)),size:"18",weight:"semibold",className:"flex items-center cursor-pointer",noWrap:!0,children:e})]},e+t)),(0,l.jsx)("div",{ref:t})]})})]})}var h=t(91362),j=t(74424),f=t(3077),m=t(52058);function v(){let{configurableColumns:e,toggleColumnVisibility:s,resetDefaultColumnVisibility:t,sortField:i,setSortField:n,sortDirection:a,setSortDirection:r,enabledColumns:x}=(0,d.b)();return(0,l.jsxs)(c.J2e,{trigger:(0,l.jsxs)(c.zxk,{size:"small",tip:"Configure view",tipAlign:"end",children:[(0,l.jsx)(o.hiv,{}),"View",(0,l.jsx)(o.EMN,{})]}),contentProps:{align:"end",className:"max-w-[300px]"},children:[(0,l.jsxs)(c.WVB,{children:[(0,l.jsx)(c.__J,{children:"Order by"}),(0,l.jsx)(c.kFS,{children:(0,l.jsx)(c.PhF,{value:i,onChange:e=>{n(e.currentTarget.value)},children:Object.entries((0,m.Z)(f.Fo,"category")).map(e=>{let[s,t]=e;return(0,l.jsx)("optgroup",{label:s,children:t.map(e=>(0,l.jsx)(c.Wxm,{value:e.id,children:e.label},e.id))},s)})})})]}),(0,l.jsxs)(c.WVB,{children:[(0,l.jsx)(c.__J,{children:"Direction"}),(0,l.jsx)(c.kFS,{children:(0,l.jsxs)(c.PhF,{value:a,onClick:e=>{e.stopPropagation()},onChange:e=>{r(e.currentTarget.value)},children:[(0,l.jsx)(c.Wxm,{value:"desc",children:"descending"},"desc"),(0,l.jsx)(c.Wxm,{value:"asc",children:"ascending"},"asc")]})})]}),(0,l.jsx)(c.Clw,{}),(0,l.jsxs)(c.WVB,{children:[(0,l.jsx)(c.__J,{children:"Display properties"}),(0,l.jsx)(c.kFS,{children:(0,l.jsx)(c.zxk,{onClick:e=>{e.stopPropagation(),t()},children:"Reset default"})})]}),(0,l.jsx)(c.WVB,{children:(0,l.jsx)(c.j4H,{options:e.map(e=>({label:e.label,value:e.id})),values:x,onChange:e=>s(e)})})]})}var g=t(38855),p=t(57016),b=t(46081);function N(){let{autopilot:e}=(0,b.q)(),s=(0,p.e$)({config:{swr:{errorRetryCount:0}}});return{active:"on"===e.status&&!!s.error}}var w=t(42770);function T(){let{isViewingABucket:e}=(0,d.b)(),s=(0,g.n)(),t=N(),l=(0,w.F)();return e&&!t.active&&!l.active&&s.isSynced}let{useDropzone:y}=j;function z(){let{openDialog:e}=(0,a.Rh)(),{uploadFiles:s,isViewingBuckets:t}=(0,d.b)(),i=T(),{getRootProps:n,getInputProps:r}=y({noDrag:!0,noClick:!i,onDrop:s});return(0,l.jsxs)("div",{className:"flex gap-2",children:[t?(0,l.jsxs)(c.zxk,{onClick:()=>e("filesCreateBucket"),tip:"Create bucket",children:[(0,l.jsx)(o.aXP,{}),"Create bucket"]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.zxk,{onClick:()=>e("filesSearch"),tip:"Search files",children:(0,l.jsx)(o.UBs,{})}),(0,l.jsxs)(c.zxk,{...n(),tip:"Upload files",disabled:!i,children:[(0,l.jsx)("input",{...r()}),(0,l.jsx)(o.bQp,{})]}),(0,l.jsx)(c.zxk,{disabled:!i,onClick:()=>e("filesCreateDirectory"),tip:"Create directory",children:(0,l.jsx)(o.L37,{})})]}),(0,l.jsx)(v,{})]})}var k=t(75618),S=t(21487);function C(){let e=(0,p.Q5)({config:{swr:{refreshInterval:6e4,keepPreviousData:!0,revalidateOnFocus:!1}}});if(!e.data&&e.isValidating)return(0,l.jsx)(c.xgg,{className:"pr-1"});if(!e.data)return null;let s=e.data.totalObjectsSize+e.data.totalUnfinishedObjectsSize,t=s?e.data.totalSectorsSize/s:0;return(0,l.jsx)(c.ua7,{side:"bottom",content:(0,l.jsxs)(c.xvT,{className:"flex justify-between gap-6",children:[(0,l.jsxs)(c.xvT,{className:"flex flex-col gap-1",children:[(0,l.jsx)(c.xvT,{size:"12",color:"subtle",children:"size of all files"}),(0,l.jsx)(c.xvT,{size:"12",color:"subtle",children:"with redundancy"}),!!t&&(0,l.jsx)(c.xvT,{size:"12",color:"subtle",children:"average redundancy factor"}),(0,l.jsx)(c.Z0O,{className:"w-full my-1"}),(0,l.jsx)(c.xvT,{size:"12",color:"subtle",children:"reclaimable space"}),(0,l.jsx)(c.xvT,{size:"12",color:"subtle",children:"total storage utilization"})]}),(0,l.jsxs)(c.xvT,{className:"flex flex-col gap-1 items-end",children:[(0,l.jsx)(c.xvT,{size:"12",children:(0,S.vW)(e.data.totalObjectsSize)}),(0,l.jsx)(c.xvT,{size:"12",children:(0,S.vW)(e.data.totalSectorsSize)}),!!t&&(0,l.jsxs)(c.xvT,{size:"12",font:"mono",children:[t.toFixed(1),"x"]}),(0,l.jsx)(c.Z0O,{className:"w-full my-1"}),(0,l.jsx)(c.xvT,{size:"12",children:(0,S.vW)(e.data.totalUploadedSize-e.data.totalSectorsSize)}),(0,l.jsx)(c.xvT,{size:"12",children:(0,S.vW)(e.data.totalUploadedSize)})]})]}),children:(0,l.jsx)(c.xvT,{size:"12",font:"mono",children:"".concat((0,S.vW)(e.data.totalObjectsSize)).concat(t?" @ ".concat(t.toFixed(1),"x"):"")})})}var F=t(18121);function _(){var e,s;let t=(0,p.Q5)({config:{swr:{refreshInterval:6e4,keepPreviousData:!0,revalidateOnFocus:!1}}}),{displayHealth:i,label:n}=(0,F.B)({health:null===(e=t.data)||void 0===e?void 0:e.minHealth,size:1,isDirectory:!0}),a=(null===(s=t.data)||void 0===s?void 0:s.totalObjectsSize)===0;return!t.data||a?null:(0,l.jsx)(c.ua7,{align:"end",content:(0,l.jsxs)("div",{className:"flex flex-col overflow-hidden mb-1",children:[(0,l.jsxs)("div",{className:"flex justify-between gap-2",children:[(0,l.jsx)(c.xvT,{size:"12",children:n}),(0,l.jsxs)(c.xvT,{size:"12",children:[(100*i).toFixed(0),"%"]})]}),(0,l.jsx)(c.Z0O,{className:"w-full my-1.5"}),(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsx)(c.xvT,{size:"12",color:"subtle",children:"Health is calculated as the minimum health value from across all file slabs. For directories this is across all contained files."}),(0,l.jsx)(c.xvT,{size:"12",color:"subtle",children:"Slab health is calculated as the number of shards with active contracts in the autopilot contract set above the minimum required shards and expressed as a percentage."})]}),(0,l.jsx)(c.Z0O,{className:"w-full my-1.5"}),(0,l.jsxs)("div",{className:"flex gap-3 justify-between",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)(c.xvT,{size:"12",color:"subtle",children:"excellent health"}),(0,l.jsx)(c.xvT,{size:"12",color:"subtle",children:"good health"}),(0,l.jsx)(c.xvT,{size:"12",color:"subtle",children:"poor health"})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-1 items-end",children:[(0,l.jsxs)(c.xvT,{size:"12",color:"subtle",children:[100*F.V.excellent,"%"]}),(0,l.jsxs)(c.xvT,{size:"12",color:"subtle",children:[100*F.V.good,"% -"," ",100*F.V.excellent,"%"]}),(0,l.jsxs)(c.xvT,{size:"12",color:"subtle",children:[100*F.V.poor,"% - ",100*F.V.good,"%"]})]})]})]}),children:(0,l.jsx)(c.xvT,{size:"12",font:"mono",className:"flex",children:n})})}var W=t(91332);function D(){let e=(0,g.n)(),s=function(){let{autopilot:e}=(0,b.q)(),s=function(){var e,s;let{autopilot:t}=(0,b.q)(),l=(0,p.e$)({disabled:"on"!==t.status}),i=(0,W.a)();return{isValidating:l.isValidating||i.isValidating,data:(null===(e=l.data)||void 0===e?void 0:e.contracts.set)===(null===(s=i.data)||void 0===s?void 0:s.default)}}();return{active:"on"===e.status&&!s.isValidating&&!s.data}}(),t=N(),i=(0,w.F)(),n=(0,r.useMemo)(()=>e.isSynced?null:(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)(c.xvT,{size:"12",font:"mono",weight:"medium",color:"amber",children:"Uploads are disabled until renterd is synced."}),(0,l.jsx)(c.nvN,{size:"12",children:"The blockchain must be fully synced before uploading files. This can take a while depending on your hardware and network connection."})]},"syncStatus"),[e.isSynced]),a=(0,r.useMemo)(()=>t.active?(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)(c.xvT,{size:"12",font:"mono",weight:"medium",color:"amber",children:"Uploads are disabled until settings are configured."}),(0,l.jsxs)(c.nvN,{size:"12",children:["Before you can upload files you must configure your settings. Once configured, ",(0,l.jsx)(c.EKh,{children:"renterd"})," will find contracts with hosts based on the settings you choose. ",(0,l.jsx)(c.EKh,{children:"renterd"})," will also repair your data as hosts come and go."]})]},"autopilotNotConfigured"):null,[t.active]),d=(0,r.useMemo)(()=>i.active?(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)(c.xvT,{size:"12",font:"mono",weight:"medium",color:"amber",children:"Uploads are disabled until settings are configured."}),(0,l.jsxs)(c.nvN,{size:"12",children:["There are not enough contracts to upload data yet. Redundancy is configured to use ",i.required," shards which means at least that many contracts are required."]})]},"notEnoughContracts"):null,[i]),x=(0,r.useMemo)(()=>s.active?(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)(c.xvT,{size:"12",font:"mono",weight:"medium",color:"amber",children:"Uploaded data will not be managed by autopilot."}),(0,l.jsx)(c.nvN,{size:"12",children:"The autopilot contract set does not match the default contract set. This means that by default workers will not upload data to contracts that autopilot manages. Unless these contract are being manually maintained, this will result in data loss. Continue with caution or update the autopilot contract set to match the default contract set."})]},"contractSetMismatch"):null,[s.active]),u=(0,r.useMemo)(()=>[n,a,d,x].filter(Boolean),[n,a,d,x]);if(u.length)return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.J2e,{trigger:(0,l.jsx)(c.zxk,{variant:"ghost",icon:"contrast",color:"amber",children:(0,l.jsx)(o.qdM,{})}),children:(0,l.jsx)("div",{className:"flex flex-col gap-3 px-1 py-2",children:u})}),(0,l.jsx)(c.Z0O,{variant:"vertical",className:"h-full"})]})}var V=t(43385);function O(){var e;let{isViewingABucket:s,uploadsList:t,activeExplorerMode:i}=(0,d.b)(),{pageCount:n}=(0,k.J)(),{pageCount:a}=(0,V.o)(),r=(0,p.Q5)({config:{swr:{refreshInterval:6e4,keepPreviousData:!0,revalidateOnFocus:!1}}}),o=((null===(e=r.data)||void 0===e?void 0:e.numObjects)||0)+t.length;return s?(0,l.jsxs)("div",{className:"flex gap-1",children:[(0,l.jsx)(c.ua7,{side:"bottom",content:"Number of files in page of current directory",children:(0,l.jsx)(c.xvT,{size:"12",font:"mono",children:("flat"===i?a:n).toLocaleString()})}),(0,l.jsx)(c.ua7,{side:"bottom",content:"Number of files across all buckets",children:(0,l.jsx)(c.xvT,{size:"12",font:"mono",children:r.data?"of ".concat(o.toLocaleString()," files"):" files"})})]}):(0,l.jsx)(c.ua7,{side:"bottom",content:"Number of files across all buckets",children:r.data?(0,l.jsxs)(c.xvT,{size:"12",font:"mono",children:[o.toLocaleString()," files"]}):(0,l.jsx)(c.xgg,{})})}function B(){return(0,l.jsxs)("div",{className:"flex gap-3 items-center",children:[(0,l.jsx)(D,{}),(0,l.jsxs)("div",{className:"flex gap-3",children:[(0,l.jsx)(c.ua7,{side:"bottom",content:"Filtered statistics",children:(0,l.jsx)(c.xvT,{size:"12",color:"verySubtle",children:(0,l.jsx)(o.q0D,{})})}),(0,l.jsx)(O,{})]}),(0,l.jsx)(c.Z0O,{variant:"vertical",className:"h-full"}),(0,l.jsxs)("div",{className:"flex gap-3",children:[(0,l.jsx)(c.ua7,{side:"bottom",content:"Global statistics",children:(0,l.jsx)(c.xvT,{size:"12",color:"verySubtle",children:(0,l.jsx)(o.RFr,{})})}),(0,l.jsx)(C,{}),(0,l.jsx)(_,{})]})]})}var P=t(94225);function J(e){let{placeholder:s}=e,{setFilter:t,removeFilter:i,fileNamePrefixFilter:n}=(0,d.b)(),[a,x]=(0,r.useState)(n),[u]=(0,P.Nr)(a,500);return(0,r.useEffect)(()=>{n!==a&&x(n)},[n]),(0,r.useEffect)(()=>{n!==u&&(u.length?t({id:"fileNamePrefix",label:"",value:u}):i("fileNamePrefix"))},[u]),(0,l.jsxs)("div",{className:"flex gap-1 flex-1",children:[(0,l.jsx)(c.nvn,{variant:"ghost",focus:"none",placeholder:s||"Filter files in current directory",value:a,onChange:e=>x(e.currentTarget.value),className:"w-full !pl-0"}),!!a.length&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.zxk,{variant:"ghost",onClick:()=>x(""),children:(0,l.jsx)(o.PcV,{})}),(0,l.jsx)(c.Z0O,{variant:"vertical",className:"h-full"})]})]})}function E(){let{isViewingABucket:e,isViewingBuckets:s}=(0,d.b)(),{limit:t,offset:i,pageCount:n,dataState:a}=(0,k.J)();return(0,l.jsxs)("div",{className:"flex gap-3 w-full",children:[s?(0,l.jsx)("div",{className:"flex-1"}):(0,l.jsx)(J,{}),(0,l.jsx)(B,{}),e&&(0,l.jsx)(c.wFK,{offset:i,limit:t,pageTotal:n,isLoading:"loading"===a})]})}function K(){return(0,l.jsxs)("div",{className:"flex flex-col gap-10 justify-center items-center h-[400px]",children:[(0,l.jsx)(c.xvT,{children:(0,l.jsx)(o.Ckx,{className:"scale-[200%]"})}),(0,l.jsx)(c.xvT,{color:"subtle",className:"text-center max-w-[500px]",children:"Error fetching files."})]})}function M(){let{filters:e,resetFilters:s}=(0,d.b)();return(0,l.jsxs)("div",{className:"flex flex-col gap-10 justify-center items-center h-[400px]",children:[(0,l.jsx)(c.xvT,{children:(0,l.jsx)(o.Hb6,{className:"scale-[200%]"})}),(0,l.jsxs)("div",{className:"flex flex-col gap-3 items-center",children:[(0,l.jsx)(c.xvT,{color:"subtle",className:"text-center max-w-[500px]",children:"No files matching filters."}),!!e.length&&(0,l.jsx)(c.zxk,{onClick:e=>{e.stopPropagation(),s()},children:"Clear filters"})]})]})}function U(){let{activeBucketName:e}=(0,d.b)();return(0,l.jsxs)("div",{className:"flex flex-col gap-10 justify-center items-center h-[400px] cursor-pointer",children:[(0,l.jsx)(c.xvT,{children:(0,l.jsx)(o.Y9T,{className:"scale-[200%]"})}),(0,l.jsxs)("div",{className:"flex flex-col gap-3 items-center",children:[(0,l.jsxs)(c.xvT,{color:"subtle",className:"text-center max-w-[500px]",children:["The ",(0,l.jsx)(c.EKh,{children:e})," bucket does not contain any files, drag and drop files or click here to start uploading."]}),(0,l.jsx)(c.Qjf,{href:n._.buckets.index,onClick:e=>{e.stopPropagation()},children:"View buckets list"})]})]})}function H(){let{isViewingRootOfABucket:e}=(0,d.b)(),{dataState:s}=(0,k.J)(),t=N(),i=(0,w.F)();return"noneMatchingFilters"===s?(0,l.jsx)(M,{}):"error"===s?(0,l.jsx)(K,{}):e&&"noneYet"===s&&t.active?(0,l.jsxs)("div",{className:"flex flex-col gap-10 justify-center items-center h-[400px] cursor-pointer",children:[(0,l.jsx)(c.xvT,{children:(0,l.jsx)(o.Y9T,{className:"scale-[200%]"})}),(0,l.jsxs)("div",{className:"flex flex-col gap-6 justify-center items-center",children:[(0,l.jsxs)(c.xvT,{color:"subtle",className:"text-center max-w-[500px]",children:["Before you can upload files you must configure your settings. Once configured, ",(0,l.jsx)(c.EKh,{children:"renterd"})," will find contracts with hosts based on the settings you choose. ",(0,l.jsx)(c.EKh,{children:"renterd"})," will also repair your data as hosts come and go."]}),(0,l.jsx)(c.Qjf,{variant:"accent",href:n._.config.index,children:"Configure"})]})]}):e&&"noneYet"===s&&i.active?(0,l.jsxs)("div",{className:"flex flex-col gap-12 justify-center items-center h-[400px] cursor-pointer",children:[(0,l.jsx)(c.xvT,{children:(0,l.jsx)(o.Y9T,{className:"scale-[200%]"})}),(0,l.jsxs)("div",{className:"flex flex-col gap-4 justify-center items-center",children:[(0,l.jsxs)(c.xvT,{color:"subtle",className:"text-center max-w-[500px]",children:["There are not enough contracts to upload data yet. Redundancy is configured to use ",i.required," shards which means at least that many contracts are required."]}),(0,l.jsxs)(c.xvT,{size:"30",className:"text-center max-w-[500px]",children:[i.count,"/",i.required]})]})]}):"noneYet"===s?(0,l.jsx)(U,{}):null}var R=t(72199);function Q(){let{uploadFiles:e,sortField:s,sortDirection:t,sortableColumns:i,toggleSort:n}=(0,d.b)(),{datasetPage:a,pageCount:r,dataState:o,onDragEnd:x,onDragOver:u,onDragStart:h,onDragCancel:j,onDragMove:f,draggingObject:m}=(0,k.J)(),v=T();return(0,l.jsx)("div",{className:"relative",children:(0,l.jsx)(c.fhJ,{onDrop:e,noClick:!v||r>0,noDrag:!v,children:(0,l.jsx)(c.iA_,{isLoading:"loading"===o,emptyState:(0,l.jsx)(H,{}),pageSize:10,data:a,columns:R.z,sortableColumns:i,sortField:s,sortDirection:t,toggleSort:n,rowSize:"dense",onDragStart:h,onDragOver:u,onDragEnd:x,onDragCancel:j,onDragMove:f,draggingDatum:m})})})}function q(){let{openDialog:e}=(0,a.Rh)();return(0,l.jsx)(h.J,{title:"Files",navTitle:null,routes:n._,sidenav:(0,l.jsx)(i.e,{}),nav:(0,l.jsx)(u,{}),stats:(0,l.jsx)(E,{}),actions:(0,l.jsx)(z,{}),openSettings:()=>e("settings"),children:(0,l.jsx)("div",{className:"p-6 min-w-fit",children:(0,l.jsx)(Q,{})})})}function L(){let{activeBucketName:e,setActiveDirectory:s}=(0,d.b)();return(0,l.jsxs)("div",{className:"flex gap-2 items-center h-full",children:[(0,l.jsx)(x.C,{}),(0,l.jsx)(c.xrM,{children:(0,l.jsxs)("div",{className:"flex gap-1 items-center h-full",children:[(0,l.jsx)(c.xvT,{onClick:()=>s(()=>[]),size:"18",weight:"semibold",className:"flex items-center cursor-pointer",noWrap:!0,children:"Buckets"}),(0,l.jsx)(c.xvT,{size:"16",color:"verySubtle",className:"flex items-center",children:(0,l.jsx)(o.F3j,{})}),(0,l.jsx)(c.xvT,{onClick:()=>null,size:"18",weight:"semibold",className:"flex items-center cursor-pointer",noWrap:!0,children:e}),(0,l.jsx)(c.xvT,{size:"16",color:"verySubtle",className:"flex items-center",children:(0,l.jsx)(o.F3j,{})}),(0,l.jsx)(c.xvT,{size:"18",weight:"semibold",className:"flex items-center cursor-pointer",noWrap:!0,children:"All files"})]})})]})}function Z(){let{openDialog:e}=(0,a.Rh)();return(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(c.zxk,{onClick:()=>e("filesSearch"),tip:"Search files",children:(0,l.jsx)(o.UBs,{})}),(0,l.jsx)(v,{})]})}function Y(){let{limit:e,pageCount:s,dataState:t,nextMarker:i,isMore:n}=(0,V.o)();return(0,l.jsxs)("div",{className:"flex gap-3 w-full",children:[(0,l.jsx)(J,{placeholder:"Filter files in current bucket"}),(0,l.jsx)(B,{}),(0,l.jsx)(c._5,{marker:i,isMore:n,limit:e,pageTotal:s,isLoading:"loading"===t})]})}function X(){return(0,l.jsxs)("div",{className:"flex flex-col gap-10 justify-center items-center h-[400px]",children:[(0,l.jsx)(c.xvT,{children:(0,l.jsx)(o.Ckx,{className:"scale-[200%]"})}),(0,l.jsx)(c.xvT,{color:"subtle",className:"text-center max-w-[500px]",children:"Error fetching files."})]})}function A(){let{filters:e,resetFilters:s}=(0,d.b)();return(0,l.jsxs)("div",{className:"flex flex-col gap-10 justify-center items-center h-[400px]",children:[(0,l.jsx)(c.xvT,{children:(0,l.jsx)(o.Hb6,{className:"scale-[200%]"})}),(0,l.jsxs)("div",{className:"flex flex-col gap-3 items-center",children:[(0,l.jsx)(c.xvT,{color:"subtle",className:"text-center max-w-[500px]",children:"No files matching filters."}),!!e.length&&(0,l.jsx)(c.zxk,{onClick:e=>{e.stopPropagation(),s()},children:"Clear filters"})]})]})}function I(){let{activeBucketName:e}=(0,d.b)();return(0,l.jsxs)("div",{className:"flex flex-col gap-10 justify-center items-center h-[400px] cursor-pointer",children:[(0,l.jsx)(c.xvT,{children:(0,l.jsx)(o.Y9T,{className:"scale-[200%]"})}),(0,l.jsxs)("div",{className:"flex flex-col gap-3 items-center",children:[(0,l.jsxs)(c.xvT,{color:"subtle",className:"text-center max-w-[500px]",children:["The ",(0,l.jsx)(c.EKh,{children:e})," bucket does not contain any files."]}),(0,l.jsx)(c.Qjf,{href:n._.buckets.index,onClick:e=>{e.stopPropagation()},children:"View buckets list"})]})]})}function $(){let{dataState:e}=(0,V.o)();return"noneMatchingFilters"===e?(0,l.jsx)(A,{}):"error"===e?(0,l.jsx)(X,{}):"noneYet"===e?(0,l.jsx)(I,{}):null}var G=t(33351);function ee(){let{sortableColumns:e,toggleSort:s}=(0,d.b)(),{datasetPage:t,dataState:i,sortField:n,sortDirection:a}=(0,V.o)();return(0,l.jsx)("div",{className:"relative",children:(0,l.jsx)(c.iA_,{isLoading:"loading"===i,emptyState:(0,l.jsx)($,{}),pageSize:10,data:t,columns:G.z,sortableColumns:e,sortField:n,sortDirection:a,toggleSort:s,rowSize:"dense"})})}function es(){let{openDialog:e}=(0,a.Rh)();return(0,l.jsx)(h.J,{title:"Files",navTitle:null,routes:n._,sidenav:(0,l.jsx)(i.e,{}),nav:(0,l.jsx)(L,{}),stats:(0,l.jsx)(Y,{}),actions:(0,l.jsx)(Z,{}),openSettings:()=>e("settings"),children:(0,l.jsx)("div",{className:"p-6 min-w-fit",children:(0,l.jsx)(ee,{})})})}function et(){let{isViewingBuckets:e,activeExplorerMode:s}=(0,d.b)();return"directory"===s||e?(0,l.jsx)(q,{}):(0,l.jsx)(es,{})}},91362:function(e,s,t){t.d(s,{J:function(){return j}});var l=t(52322),i=t(36655),n=t(57016),a=t(6391),r=t.n(a),c=t(98334),o=t(38855),d=t(97112),x=t(21487);function u(){var e,s,t,a,r,c;let{openDialog:u}=(0,d.Rh)(),h=(0,n.d_)({config:{swr:{revalidateOnFocus:!1}}}),j=(0,n.X2)({config:{swr:{revalidateOnFocus:!1}}}),f=(0,n.cQ)(),m=(0,o.n)(),v=null===(e=h.data)||void 0===e?void 0:e.version,g="?"===v?"https://github.com/SiaFoundation/renterd/commits/":(null==v?void 0:v.match(/^v\d+\.\d+\.\d+/))?"https://github.com/SiaFoundation/renterd/releases/".concat(v):"https://github.com/SiaFoundation/renterd/tree/".concat(v),p=h.data?new Date().getTime()-new Date(null===(s=h.data)||void 0===s?void 0:s.startTime).getTime():0;return(0,l.jsxs)(i.HfT,{name:"renterd",peerCount:null===(t=f.data)||void 0===t?void 0:t.length,connectPeer:()=>u("connectPeer"),isSynced:m.isSynced,syncPercent:m.syncPercent,nodeBlockHeight:m.nodeBlockHeight,estimatedBlockHeight:m.estimatedBlockHeight,firstTimeSyncing:m.firstTimeSyncing,moreThan100BlocksToSync:m.moreThan100BlocksToSync,children:[(0,l.jsxs)("div",{className:"flex gap-4 justify-between items-center",children:[(0,l.jsx)(i.__J,{size:"14",color:"subtle",noWrap:!0,className:"w-[100px]",children:"Wallet address"}),(0,l.jsx)("div",{className:"flex-1 flex justify-end overflow-hidden -mr-0.5 pr-0.5",children:(0,l.jsx)(i.XxW,{size:"14",maxLength:50,value:null===(a=j.data)||void 0===a?void 0:a.address,type:"address"})})]}),h.data&&(0,l.jsxs)("div",{className:"flex gap-4 justify-between items-center",children:[(0,l.jsx)(i.__J,{size:"14",color:"subtle",noWrap:!0,className:"w-[100px]",children:"Uptime"}),(0,l.jsx)("div",{className:"flex-1 flex justify-end overflow-hidden -mr-0.5 pr-0.5",children:(0,l.jsx)(i.xvT,{size:"14",children:(0,x.bc)(p,{format:"long"})})})]}),(0,l.jsxs)("div",{className:"flex gap-4 justify-between items-center",children:[(0,l.jsx)(i.__J,{size:"14",color:"subtle",noWrap:!0,className:"w-[100px]",children:"Network"}),(0,l.jsx)("div",{className:"flex-1 flex justify-end overflow-hidden -mr-0.5 pr-0.5",children:(0,l.jsx)(i.xvT,{size:"14",children:null===(r=h.data)||void 0===r?void 0:r.network})})]}),(0,l.jsxs)("div",{className:"flex gap-4 justify-between items-center",children:[(0,l.jsx)(i.__J,{size:"14",color:"subtle",noWrap:!0,className:"w-[100px]",children:"Version"}),(0,l.jsx)(i.rUS,{size:"14",href:g,underline:"hover",target:"_blank",ellipsis:!0,children:null===(c=h.data)||void 0===c?void 0:c.version})]})]})}function h(){let e=(0,n.d_)({config:{swr:{revalidateOnFocus:!1}}});return e.data&&"Mainnet"!==e.data.network?(0,l.jsx)(i.t6k,{testnetName:e.data.network}):null}function j(e){let s=(0,n.X2)(),{isSynced:t}=(0,o.n)();return(0,l.jsx)(i.tU3,{appName:"renterd",profile:(0,l.jsx)(u,{}),banner:(0,l.jsx)(h,{}),connectivityRoute:c.h,isSynced:t,walletBalanceSc:s.data&&{spendable:new(r())(s.data.spendable),confirmed:new(r())(s.data.confirmed),unconfirmed:new(r())(s.data.unconfirmed)},...e})}},97992:function(e,s,t){t.d(s,{e:function(){return o}});var l=t(52322),i=t(36655),n=t(61020),a=t(82851),r=t(98334),c=t(87764);function o(){let{totals:e}=(0,c.Z)(),s=e.all===e.info;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(i.KJW,{title:"Files",route:r._.buckets.index,children:(0,l.jsx)(n.ROc,{})}),(0,l.jsx)(i.KJW,{title:"Configuration",route:r._.config.index,children:(0,l.jsx)(n.wWN,{})}),(0,l.jsx)(i.KJW,{title:"Contracts",route:r._.contracts.index,children:(0,l.jsx)(n.VBo,{})}),(0,l.jsx)(i.KJW,{title:"Hosts",route:r._.hosts.index,children:(0,l.jsx)(n.VHe,{})}),(0,l.jsx)(i.KJW,{title:"S3 authentication keypairs",route:r._.keys.index,children:(0,l.jsx)(n._m8,{})}),(0,l.jsxs)("div",{className:"relative",children:[e.all?s?(0,l.jsx)("div",{className:(0,a.cx)("absolute -right-[2px] top-px w-1 h-1","rounded-full","bg-gray-1000 dark:bg-white","pointer-events-none")}):(0,l.jsx)(i.xvT,{size:"10",className:(0,a.cx)("absolute -right-[9px] -top-1 py-px px-[5px]","text-white","bg-red-500 dark:bg-red-500 rounded","pointer-events-none"),color:"none",children:e.all.toLocaleString()}):null,(0,l.jsx)(i.KJW,{title:"Alerts",route:r._.alerts.index,children:(0,l.jsx)(n.Dkj,{})})]})]})}}}]);
\ No newline at end of file
diff --git a/renterd/assets/_next/static/chunks/448-d0f934bc853d5322.js b/renterd/assets/_next/static/chunks/448-d0f934bc853d5322.js
new file mode 100644
index 000000000..5e9e8f4b9
--- /dev/null
+++ b/renterd/assets/_next/static/chunks/448-d0f934bc853d5322.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[448],{17398:function(e,s,t){t.d(s,{C:function(){return c}});var l=t(52322),i=t(36655),n=t(61020),a=t(41736);function r(){let{activeExplorerMode:e,setExplorerModeDirectory:s,setExplorerModeFlat:t,isViewingUploads:r,navigateToUploads:c}=(0,a.b)();return(0,l.jsxs)(i.h_2,{trigger:(0,l.jsx)(i.zxk,{tipSide:"bottom",tip:r?"Viewing uploads":"directory"===e?"Viewing directory explorer":"Viewing all bucket files",children:r?(0,l.jsx)(n.bQp,{}):"directory"===e?(0,l.jsx)(n.Qbr,{}):(0,l.jsx)(n.nDH,{})}),contentProps:{align:"start",side:"bottom",className:"max-w-[300px]"},children:[(0,l.jsxs)(i.Xiv,{onSelect:s,children:[(0,l.jsx)(i.KpP,{children:(0,l.jsx)(n.Qbr,{})}),"Directory"]}),(0,l.jsxs)(i.Xiv,{onSelect:t,children:[(0,l.jsx)(i.KpP,{children:(0,l.jsx)(n.nDH,{})}),"All files"]}),(0,l.jsxs)(i.Xiv,{onSelect:c,children:[(0,l.jsx)(i.KpP,{children:(0,l.jsx)(n.bQp,{})}),"Uploads"]})]})}function c(){let{isViewingBuckets:e}=(0,a.b)();return e?(0,l.jsx)(i.ua7,{content:"Viewing all buckets",children:(0,l.jsx)("div",{children:(0,l.jsx)(i.zxk,{state:"waiting",children:(0,l.jsx)(n.fi8,{size:16})})})}):(0,l.jsx)(r,{})}},57448:function(e,s,t){t.d(s,{h:function(){return et}});var l=t(52322),i=t(97992),n=t(98334),a=t(97112),r=t(2784),c=t(36655),o=t(61020),d=t(41736),x=t(17398);function u(){let{activeDirectory:e,setActiveDirectory:s}=(0,d.b)(),t=(0,r.useRef)(null);return(0,r.useEffect)(()=>{let e=setTimeout(()=>{var e;null===(e=t.current)||void 0===e||e.scrollIntoView({behavior:"smooth"})},100);return()=>{clearTimeout(e)}},[e]),(0,l.jsxs)("div",{className:"flex gap-2 items-center h-full",children:[(0,l.jsx)(x.C,{}),(0,l.jsx)(c.xrM,{children:(0,l.jsxs)("div",{className:"flex gap-1 items-center h-full",children:[(0,l.jsx)(c.xvT,{onClick:()=>s(()=>[]),size:"18",weight:"semibold",className:"flex items-center cursor-pointer",noWrap:!0,children:"Buckets"}),e.length>0&&(0,l.jsx)(c.xvT,{size:"16",color:"verySubtle",className:"flex items-center",children:(0,l.jsx)(o.F3j,{})}),e.map((e,t)=>(0,l.jsxs)(r.Fragment,{children:[t>0&&(0,l.jsx)(c.xvT,{size:"16",color:"verySubtle",className:"flex items-center",children:(0,l.jsx)(o.F3j,{})}),(0,l.jsx)(c.xvT,{onClick:()=>s(e=>e.slice(0,t+1)),size:"18",weight:"semibold",className:"flex items-center cursor-pointer",noWrap:!0,children:e})]},e+t)),(0,l.jsx)("div",{ref:t})]})})]})}var h=t(91362),j=t(74424),f=t(3077),m=t(52058);function v(){let{configurableColumns:e,toggleColumnVisibility:s,resetDefaultColumnVisibility:t,sortField:i,setSortField:n,sortDirection:a,setSortDirection:r,enabledColumns:x}=(0,d.b)();return(0,l.jsxs)(c.J2e,{trigger:(0,l.jsxs)(c.zxk,{size:"small",tip:"Configure view",tipAlign:"end",children:[(0,l.jsx)(o.hiv,{}),"View",(0,l.jsx)(o.EMN,{})]}),contentProps:{align:"end",className:"max-w-[300px]"},children:[(0,l.jsxs)(c.WVB,{children:[(0,l.jsx)(c.__J,{children:"Order by"}),(0,l.jsx)(c.kFS,{children:(0,l.jsx)(c.PhF,{value:i,onChange:e=>{n(e.currentTarget.value)},children:Object.entries((0,m.Z)(f.Fo,"category")).map(e=>{let[s,t]=e;return(0,l.jsx)("optgroup",{label:s,children:t.map(e=>(0,l.jsx)(c.Wxm,{value:e.id,children:e.label},e.id))},s)})})})]}),(0,l.jsxs)(c.WVB,{children:[(0,l.jsx)(c.__J,{children:"Direction"}),(0,l.jsx)(c.kFS,{children:(0,l.jsxs)(c.PhF,{value:a,onClick:e=>{e.stopPropagation()},onChange:e=>{r(e.currentTarget.value)},children:[(0,l.jsx)(c.Wxm,{value:"desc",children:"descending"},"desc"),(0,l.jsx)(c.Wxm,{value:"asc",children:"ascending"},"asc")]})})]}),(0,l.jsx)(c.Clw,{}),(0,l.jsxs)(c.WVB,{children:[(0,l.jsx)(c.__J,{children:"Display properties"}),(0,l.jsx)(c.kFS,{children:(0,l.jsx)(c.zxk,{onClick:e=>{e.stopPropagation(),t()},children:"Reset default"})})]}),(0,l.jsx)(c.WVB,{children:(0,l.jsx)(c.j4H,{options:e.map(e=>({label:e.label,value:e.id})),values:x,onChange:e=>s(e)})})]})}var g=t(38855),p=t(57016),b=t(46081);function N(){let{autopilot:e}=(0,b.q)(),s=(0,p.e$)({config:{swr:{errorRetryCount:0}}});return{active:"on"===e.status&&!!s.error}}var w=t(42770);function T(){let{isViewingABucket:e}=(0,d.b)(),s=(0,g.n)(),t=N(),l=(0,w.F)();return e&&!t.active&&!l.active&&s.isSynced}let{useDropzone:y}=j;function z(){let{openDialog:e}=(0,a.Rh)(),{uploadFiles:s,isViewingBuckets:t}=(0,d.b)(),i=T(),{getRootProps:n,getInputProps:r}=y({noDrag:!0,noClick:!i,onDrop:s});return(0,l.jsxs)("div",{className:"flex gap-2",children:[t?(0,l.jsxs)(c.zxk,{onClick:()=>e("filesCreateBucket"),tip:"Create bucket",children:[(0,l.jsx)(o.aXP,{}),"Create bucket"]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.zxk,{onClick:()=>e("filesSearch"),tip:"Search files",children:(0,l.jsx)(o.UBs,{})}),(0,l.jsxs)(c.zxk,{...n(),tip:"Upload files",disabled:!i,children:[(0,l.jsx)("input",{...r()}),(0,l.jsx)(o.bQp,{})]}),(0,l.jsx)(c.zxk,{disabled:!i,onClick:()=>e("filesCreateDirectory"),tip:"Create directory",children:(0,l.jsx)(o.L37,{})})]}),(0,l.jsx)(v,{})]})}var k=t(75618),S=t(21487);function C(){let e=(0,p.Q5)({config:{swr:{refreshInterval:6e4,keepPreviousData:!0,revalidateOnFocus:!1}}});if(!e.data&&e.isValidating)return(0,l.jsx)(c.xgg,{className:"pr-1"});if(!e.data)return null;let s=e.data.totalObjectsSize+e.data.totalUnfinishedObjectsSize,t=s?e.data.totalSectorsSize/s:0;return(0,l.jsx)(c.ua7,{side:"bottom",content:(0,l.jsxs)(c.xvT,{className:"flex justify-between gap-6",children:[(0,l.jsxs)(c.xvT,{className:"flex flex-col gap-1",children:[(0,l.jsx)(c.xvT,{size:"12",color:"subtle",children:"size of all files"}),(0,l.jsx)(c.xvT,{size:"12",color:"subtle",children:"with redundancy"}),!!t&&(0,l.jsx)(c.xvT,{size:"12",color:"subtle",children:"average redundancy factor"}),(0,l.jsx)(c.Z0O,{className:"w-full my-1"}),(0,l.jsx)(c.xvT,{size:"12",color:"subtle",children:"reclaimable space"}),(0,l.jsx)(c.xvT,{size:"12",color:"subtle",children:"total storage utilization"})]}),(0,l.jsxs)(c.xvT,{className:"flex flex-col gap-1 items-end",children:[(0,l.jsx)(c.xvT,{size:"12",children:(0,S.vW)(e.data.totalObjectsSize)}),(0,l.jsx)(c.xvT,{size:"12",children:(0,S.vW)(e.data.totalSectorsSize)}),!!t&&(0,l.jsxs)(c.xvT,{size:"12",font:"mono",children:[t.toFixed(1),"x"]}),(0,l.jsx)(c.Z0O,{className:"w-full my-1"}),(0,l.jsx)(c.xvT,{size:"12",children:(0,S.vW)(e.data.totalUploadedSize-e.data.totalSectorsSize)}),(0,l.jsx)(c.xvT,{size:"12",children:(0,S.vW)(e.data.totalUploadedSize)})]})]}),children:(0,l.jsx)(c.xvT,{size:"12",font:"mono",children:"".concat((0,S.vW)(e.data.totalObjectsSize)).concat(t?" @ ".concat(t.toFixed(1),"x"):"")})})}var F=t(18121);function _(){var e,s;let t=(0,p.Q5)({config:{swr:{refreshInterval:6e4,keepPreviousData:!0,revalidateOnFocus:!1}}}),{displayHealth:i,label:n}=(0,F.B)({health:null===(e=t.data)||void 0===e?void 0:e.minHealth,size:1,isDirectory:!0}),a=(null===(s=t.data)||void 0===s?void 0:s.totalObjectsSize)===0;return!t.data||a?null:(0,l.jsx)(c.ua7,{align:"end",content:(0,l.jsxs)("div",{className:"flex flex-col overflow-hidden mb-1",children:[(0,l.jsxs)("div",{className:"flex justify-between gap-2",children:[(0,l.jsx)(c.xvT,{size:"12",children:n}),(0,l.jsxs)(c.xvT,{size:"12",children:[(100*i).toFixed(0),"%"]})]}),(0,l.jsx)(c.Z0O,{className:"w-full my-1.5"}),(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsx)(c.xvT,{size:"12",color:"subtle",children:"Health is calculated as the minimum health value from across all file slabs. For directories this is across all contained files."}),(0,l.jsx)(c.xvT,{size:"12",color:"subtle",children:"Slab health is calculated as the number of shards with active contracts in the autopilot contract set above the minimum required shards and expressed as a percentage."})]}),(0,l.jsx)(c.Z0O,{className:"w-full my-1.5"}),(0,l.jsxs)("div",{className:"flex gap-3 justify-between",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)(c.xvT,{size:"12",color:"subtle",children:"excellent health"}),(0,l.jsx)(c.xvT,{size:"12",color:"subtle",children:"good health"}),(0,l.jsx)(c.xvT,{size:"12",color:"subtle",children:"poor health"})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-1 items-end",children:[(0,l.jsxs)(c.xvT,{size:"12",color:"subtle",children:[100*F.V.excellent,"%"]}),(0,l.jsxs)(c.xvT,{size:"12",color:"subtle",children:[100*F.V.good,"% -"," ",100*F.V.excellent,"%"]}),(0,l.jsxs)(c.xvT,{size:"12",color:"subtle",children:[100*F.V.poor,"% - ",100*F.V.good,"%"]})]})]})]}),children:(0,l.jsx)(c.xvT,{size:"12",font:"mono",className:"flex",children:n})})}var W=t(91332);function D(){let e=(0,g.n)(),s=function(){let{autopilot:e}=(0,b.q)(),s=function(){var e,s;let{autopilot:t}=(0,b.q)(),l=(0,p.e$)({disabled:"on"!==t.status}),i=(0,W.a)();return{isValidating:l.isValidating||i.isValidating,data:(null===(e=l.data)||void 0===e?void 0:e.contracts.set)===(null===(s=i.data)||void 0===s?void 0:s.default)}}();return{active:"on"===e.status&&!s.isValidating&&!s.data}}(),t=N(),i=(0,w.F)(),n=(0,r.useMemo)(()=>e.isSynced?null:(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)(c.xvT,{size:"12",font:"mono",weight:"medium",color:"amber",children:"Uploads are disabled until renterd is synced."}),(0,l.jsx)(c.nvN,{size:"12",children:"The blockchain must be fully synced before uploading files. This can take a while depending on your hardware and network connection."})]},"syncStatus"),[e.isSynced]),a=(0,r.useMemo)(()=>t.active?(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)(c.xvT,{size:"12",font:"mono",weight:"medium",color:"amber",children:"Uploads are disabled until settings are configured."}),(0,l.jsxs)(c.nvN,{size:"12",children:["Before you can upload files you must configure your settings. Once configured, ",(0,l.jsx)(c.EKh,{children:"renterd"})," will find contracts with hosts based on the settings you choose. ",(0,l.jsx)(c.EKh,{children:"renterd"})," will also repair your data as hosts come and go."]})]},"autopilotNotConfigured"):null,[t.active]),d=(0,r.useMemo)(()=>i.active?(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)(c.xvT,{size:"12",font:"mono",weight:"medium",color:"amber",children:"Uploads are disabled until settings are configured."}),(0,l.jsxs)(c.nvN,{size:"12",children:["There are not enough contracts to upload data yet. Redundancy is configured to use ",i.required," shards which means at least that many contracts are required."]})]},"notEnoughContracts"):null,[i]),x=(0,r.useMemo)(()=>s.active?(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)(c.xvT,{size:"12",font:"mono",weight:"medium",color:"amber",children:"Uploaded data will not be managed by autopilot."}),(0,l.jsx)(c.nvN,{size:"12",children:"The autopilot contract set does not match the default contract set. This means that by default workers will not upload data to contracts that autopilot manages. Unless these contract are being manually maintained, this will result in data loss. Continue with caution or update the autopilot contract set to match the default contract set."})]},"contractSetMismatch"):null,[s.active]),u=(0,r.useMemo)(()=>[n,a,d,x].filter(Boolean),[n,a,d,x]);if(u.length)return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.J2e,{trigger:(0,l.jsx)(c.zxk,{variant:"ghost",icon:"contrast",color:"amber",children:(0,l.jsx)(o.qdM,{})}),children:(0,l.jsx)("div",{className:"flex flex-col gap-3 px-1 py-2",children:u})}),(0,l.jsx)(c.Z0O,{variant:"vertical",className:"h-full"})]})}var V=t(43385);function O(){var e;let{isViewingABucket:s,uploadsList:t,activeExplorerMode:i}=(0,d.b)(),{pageCount:n}=(0,k.J)(),{pageCount:a}=(0,V.o)(),r=(0,p.Q5)({config:{swr:{refreshInterval:6e4,keepPreviousData:!0,revalidateOnFocus:!1}}}),o=((null===(e=r.data)||void 0===e?void 0:e.numObjects)||0)+t.length;return s?(0,l.jsxs)("div",{className:"flex gap-1",children:[(0,l.jsx)(c.ua7,{side:"bottom",content:"Number of files in page of current directory",children:(0,l.jsx)(c.xvT,{size:"12",font:"mono",children:("flat"===i?a:n).toLocaleString()})}),(0,l.jsx)(c.ua7,{side:"bottom",content:"Number of files across all buckets",children:(0,l.jsx)(c.xvT,{size:"12",font:"mono",children:r.data?"of ".concat(o.toLocaleString()," files"):" files"})})]}):(0,l.jsx)(c.ua7,{side:"bottom",content:"Number of files across all buckets",children:r.data?(0,l.jsxs)(c.xvT,{size:"12",font:"mono",children:[o.toLocaleString()," files"]}):(0,l.jsx)(c.xgg,{})})}function B(){return(0,l.jsxs)("div",{className:"flex gap-3 items-center",children:[(0,l.jsx)(D,{}),(0,l.jsxs)("div",{className:"flex gap-3",children:[(0,l.jsx)(c.ua7,{side:"bottom",content:"Filtered statistics",children:(0,l.jsx)(c.xvT,{size:"12",color:"verySubtle",children:(0,l.jsx)(o.q0D,{})})}),(0,l.jsx)(O,{})]}),(0,l.jsx)(c.Z0O,{variant:"vertical",className:"h-full"}),(0,l.jsxs)("div",{className:"flex gap-3",children:[(0,l.jsx)(c.ua7,{side:"bottom",content:"Global statistics",children:(0,l.jsx)(c.xvT,{size:"12",color:"verySubtle",children:(0,l.jsx)(o.RFr,{})})}),(0,l.jsx)(C,{}),(0,l.jsx)(_,{})]})]})}var P=t(94225);function J(e){let{placeholder:s}=e,{setFilter:t,removeFilter:i,fileNamePrefixFilter:n}=(0,d.b)(),[a,x]=(0,r.useState)(n),[u]=(0,P.Nr)(a,500);return(0,r.useEffect)(()=>{n!==a&&x(n)},[n]),(0,r.useEffect)(()=>{n!==u&&(u.length?t({id:"fileNamePrefix",label:"",value:u}):i("fileNamePrefix"))},[u]),(0,l.jsxs)("div",{className:"flex gap-1 flex-1",children:[(0,l.jsx)(c.nvn,{variant:"ghost",focus:"none",placeholder:s||"Filter files in current directory",value:a,onChange:e=>x(e.currentTarget.value),className:"w-full !pl-0"}),!!a.length&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.zxk,{variant:"ghost",onClick:()=>x(""),children:(0,l.jsx)(o.PcV,{})}),(0,l.jsx)(c.Z0O,{variant:"vertical",className:"h-full"})]})]})}function E(){let{isViewingABucket:e,isViewingBuckets:s}=(0,d.b)(),{limit:t,offset:i,pageCount:n,dataState:a}=(0,k.J)();return(0,l.jsxs)("div",{className:"flex gap-3 w-full",children:[s?(0,l.jsx)("div",{className:"flex-1"}):(0,l.jsx)(J,{}),(0,l.jsx)(B,{}),e&&(0,l.jsx)(c.wFK,{offset:i,limit:t,pageTotal:n,isLoading:"loading"===a})]})}function K(){return(0,l.jsxs)("div",{className:"flex flex-col gap-10 justify-center items-center h-[400px]",children:[(0,l.jsx)(c.xvT,{children:(0,l.jsx)(o.Ckx,{className:"scale-[200%]"})}),(0,l.jsx)(c.xvT,{color:"subtle",className:"text-center max-w-[500px]",children:"Error fetching files."})]})}function M(){let{filters:e,resetFilters:s}=(0,d.b)();return(0,l.jsxs)("div",{className:"flex flex-col gap-10 justify-center items-center h-[400px]",children:[(0,l.jsx)(c.xvT,{children:(0,l.jsx)(o.Hb6,{className:"scale-[200%]"})}),(0,l.jsxs)("div",{className:"flex flex-col gap-3 items-center",children:[(0,l.jsx)(c.xvT,{color:"subtle",className:"text-center max-w-[500px]",children:"No files matching filters."}),!!e.length&&(0,l.jsx)(c.zxk,{onClick:e=>{e.stopPropagation(),s()},children:"Clear filters"})]})]})}function U(){let{activeBucketName:e}=(0,d.b)();return(0,l.jsxs)("div",{className:"flex flex-col gap-10 justify-center items-center h-[400px] cursor-pointer",children:[(0,l.jsx)(c.xvT,{children:(0,l.jsx)(o.Y9T,{className:"scale-[200%]"})}),(0,l.jsxs)("div",{className:"flex flex-col gap-3 items-center",children:[(0,l.jsxs)(c.xvT,{color:"subtle",className:"text-center max-w-[500px]",children:["The ",(0,l.jsx)(c.EKh,{children:e})," bucket does not contain any files, drag and drop files or click here to start uploading."]}),(0,l.jsx)(c.Qjf,{href:n._.buckets.index,onClick:e=>{e.stopPropagation()},children:"View buckets list"})]})]})}function H(){let{isViewingRootOfABucket:e}=(0,d.b)(),{dataState:s}=(0,k.J)(),t=N(),i=(0,w.F)();return"noneMatchingFilters"===s?(0,l.jsx)(M,{}):"error"===s?(0,l.jsx)(K,{}):e&&"noneYet"===s&&t.active?(0,l.jsxs)("div",{className:"flex flex-col gap-10 justify-center items-center h-[400px] cursor-pointer",children:[(0,l.jsx)(c.xvT,{children:(0,l.jsx)(o.Y9T,{className:"scale-[200%]"})}),(0,l.jsxs)("div",{className:"flex flex-col gap-6 justify-center items-center",children:[(0,l.jsxs)(c.xvT,{color:"subtle",className:"text-center max-w-[500px]",children:["Before you can upload files you must configure your settings. Once configured, ",(0,l.jsx)(c.EKh,{children:"renterd"})," will find contracts with hosts based on the settings you choose. ",(0,l.jsx)(c.EKh,{children:"renterd"})," will also repair your data as hosts come and go."]}),(0,l.jsx)(c.Qjf,{variant:"accent",href:n._.config.index,children:"Configure"})]})]}):e&&"noneYet"===s&&i.active?(0,l.jsxs)("div",{className:"flex flex-col gap-12 justify-center items-center h-[400px] cursor-pointer",children:[(0,l.jsx)(c.xvT,{children:(0,l.jsx)(o.Y9T,{className:"scale-[200%]"})}),(0,l.jsxs)("div",{className:"flex flex-col gap-4 justify-center items-center",children:[(0,l.jsxs)(c.xvT,{color:"subtle",className:"text-center max-w-[500px]",children:["There are not enough contracts to upload data yet. Redundancy is configured to use ",i.required," shards which means at least that many contracts are required."]}),(0,l.jsxs)(c.xvT,{size:"30",className:"text-center max-w-[500px]",children:[i.count,"/",i.required]})]})]}):"noneYet"===s?(0,l.jsx)(U,{}):null}var R=t(72199);function Q(){let{uploadFiles:e,sortField:s,sortDirection:t,sortableColumns:i,toggleSort:n}=(0,d.b)(),{datasetPage:a,pageCount:r,dataState:o,onDragEnd:x,onDragOver:u,onDragStart:h,onDragCancel:j,onDragMove:f,draggingObject:m}=(0,k.J)(),v=T();return(0,l.jsx)("div",{className:"relative",children:(0,l.jsx)(c.fhJ,{onDrop:e,noClick:!v||r>0,noDrag:!v,children:(0,l.jsx)(c.iA_,{isLoading:"loading"===o,emptyState:(0,l.jsx)(H,{}),pageSize:10,data:a,columns:R.z,sortableColumns:i,sortField:s,sortDirection:t,toggleSort:n,rowSize:"dense",onDragStart:h,onDragOver:u,onDragEnd:x,onDragCancel:j,onDragMove:f,draggingDatum:m})})})}function q(){let{openDialog:e}=(0,a.Rh)();return(0,l.jsx)(h.J,{title:"Files",navTitle:null,routes:n._,sidenav:(0,l.jsx)(i.e,{}),nav:(0,l.jsx)(u,{}),stats:(0,l.jsx)(E,{}),actions:(0,l.jsx)(z,{}),openSettings:()=>e("settings"),children:(0,l.jsx)("div",{className:"p-6 min-w-fit",children:(0,l.jsx)(Q,{})})})}function L(){let{activeBucketName:e,setActiveDirectory:s}=(0,d.b)();return(0,l.jsxs)("div",{className:"flex gap-2 items-center h-full",children:[(0,l.jsx)(x.C,{}),(0,l.jsx)(c.xrM,{children:(0,l.jsxs)("div",{className:"flex gap-1 items-center h-full",children:[(0,l.jsx)(c.xvT,{onClick:()=>s(()=>[]),size:"18",weight:"semibold",className:"flex items-center cursor-pointer",noWrap:!0,children:"Buckets"}),(0,l.jsx)(c.xvT,{size:"16",color:"verySubtle",className:"flex items-center",children:(0,l.jsx)(o.F3j,{})}),(0,l.jsx)(c.xvT,{onClick:()=>null,size:"18",weight:"semibold",className:"flex items-center cursor-pointer",noWrap:!0,children:e}),(0,l.jsx)(c.xvT,{size:"16",color:"verySubtle",className:"flex items-center",children:(0,l.jsx)(o.F3j,{})}),(0,l.jsx)(c.xvT,{size:"18",weight:"semibold",className:"flex items-center cursor-pointer",noWrap:!0,children:"All files"})]})})]})}function Z(){let{openDialog:e}=(0,a.Rh)();return(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(c.zxk,{onClick:()=>e("filesSearch"),tip:"Search files",children:(0,l.jsx)(o.UBs,{})}),(0,l.jsx)(v,{})]})}function Y(){let{limit:e,pageCount:s,dataState:t,nextMarker:i,isMore:n}=(0,V.o)();return(0,l.jsxs)("div",{className:"flex gap-3 w-full",children:[(0,l.jsx)(J,{placeholder:"Filter files in current bucket"}),(0,l.jsx)(B,{}),(0,l.jsx)(c._5,{marker:i,isMore:n,limit:e,pageTotal:s,isLoading:"loading"===t})]})}function X(){return(0,l.jsxs)("div",{className:"flex flex-col gap-10 justify-center items-center h-[400px]",children:[(0,l.jsx)(c.xvT,{children:(0,l.jsx)(o.Ckx,{className:"scale-[200%]"})}),(0,l.jsx)(c.xvT,{color:"subtle",className:"text-center max-w-[500px]",children:"Error fetching files."})]})}function A(){let{filters:e,resetFilters:s}=(0,d.b)();return(0,l.jsxs)("div",{className:"flex flex-col gap-10 justify-center items-center h-[400px]",children:[(0,l.jsx)(c.xvT,{children:(0,l.jsx)(o.Hb6,{className:"scale-[200%]"})}),(0,l.jsxs)("div",{className:"flex flex-col gap-3 items-center",children:[(0,l.jsx)(c.xvT,{color:"subtle",className:"text-center max-w-[500px]",children:"No files matching filters."}),!!e.length&&(0,l.jsx)(c.zxk,{onClick:e=>{e.stopPropagation(),s()},children:"Clear filters"})]})]})}function I(){let{activeBucketName:e}=(0,d.b)();return(0,l.jsxs)("div",{className:"flex flex-col gap-10 justify-center items-center h-[400px] cursor-pointer",children:[(0,l.jsx)(c.xvT,{children:(0,l.jsx)(o.Y9T,{className:"scale-[200%]"})}),(0,l.jsxs)("div",{className:"flex flex-col gap-3 items-center",children:[(0,l.jsxs)(c.xvT,{color:"subtle",className:"text-center max-w-[500px]",children:["The ",(0,l.jsx)(c.EKh,{children:e})," bucket does not contain any files."]}),(0,l.jsx)(c.Qjf,{href:n._.buckets.index,onClick:e=>{e.stopPropagation()},children:"View buckets list"})]})]})}function $(){let{dataState:e}=(0,V.o)();return"noneMatchingFilters"===e?(0,l.jsx)(A,{}):"error"===e?(0,l.jsx)(X,{}):"noneYet"===e?(0,l.jsx)(I,{}):null}var G=t(33351);function ee(){let{sortableColumns:e,toggleSort:s}=(0,d.b)(),{datasetPage:t,dataState:i,sortField:n,sortDirection:a}=(0,V.o)();return(0,l.jsx)("div",{className:"relative",children:(0,l.jsx)(c.iA_,{isLoading:"loading"===i,emptyState:(0,l.jsx)($,{}),pageSize:10,data:t,columns:G.z,sortableColumns:e,sortField:n,sortDirection:a,toggleSort:s,rowSize:"dense"})})}function es(){let{openDialog:e}=(0,a.Rh)();return(0,l.jsx)(h.J,{title:"Files",navTitle:null,routes:n._,sidenav:(0,l.jsx)(i.e,{}),nav:(0,l.jsx)(L,{}),stats:(0,l.jsx)(Y,{}),actions:(0,l.jsx)(Z,{}),openSettings:()=>e("settings"),children:(0,l.jsx)("div",{className:"p-6 min-w-fit",children:(0,l.jsx)(ee,{})})})}function et(){let{isViewingBuckets:e,activeExplorerMode:s}=(0,d.b)();return"directory"===s||e?(0,l.jsx)(q,{}):(0,l.jsx)(es,{})}},91362:function(e,s,t){t.d(s,{J:function(){return j}});var l=t(52322),i=t(36655),n=t(57016),a=t(6391),r=t.n(a),c=t(98334),o=t(38855),d=t(97112),x=t(21487);function u(){var e,s,t,a,r,c;let{openDialog:u}=(0,d.Rh)(),h=(0,n.d_)({config:{swr:{revalidateOnFocus:!1}}}),j=(0,n.X2)({config:{swr:{revalidateOnFocus:!1}}}),f=(0,n.cQ)(),m=(0,o.n)(),v=null===(e=h.data)||void 0===e?void 0:e.version,g="?"===v?"https://github.com/SiaFoundation/renterd/commits/":(null==v?void 0:v.match(/^v\d+\.\d+\.\d+/))?"https://github.com/SiaFoundation/renterd/releases/".concat(v):"https://github.com/SiaFoundation/renterd/tree/".concat(v),p=h.data?new Date().getTime()-new Date(null===(s=h.data)||void 0===s?void 0:s.startTime).getTime():0;return(0,l.jsxs)(i.HfT,{name:"renterd",peerCount:null===(t=f.data)||void 0===t?void 0:t.length,connectPeer:()=>u("connectPeer"),isSynced:m.isSynced,syncPercent:m.syncPercent,nodeBlockHeight:m.nodeBlockHeight,estimatedBlockHeight:m.estimatedBlockHeight,firstTimeSyncing:m.firstTimeSyncing,moreThan100BlocksToSync:m.moreThan100BlocksToSync,children:[(0,l.jsxs)("div",{className:"flex gap-4 justify-between items-center",children:[(0,l.jsx)(i.__J,{size:"14",color:"subtle",noWrap:!0,className:"w-[100px]",children:"Wallet address"}),(0,l.jsx)("div",{className:"flex-1 flex justify-end overflow-hidden -mr-0.5 pr-0.5",children:(0,l.jsx)(i.XxW,{size:"14",maxLength:50,value:null===(a=j.data)||void 0===a?void 0:a.address,type:"address"})})]}),h.data&&(0,l.jsxs)("div",{className:"flex gap-4 justify-between items-center",children:[(0,l.jsx)(i.__J,{size:"14",color:"subtle",noWrap:!0,className:"w-[100px]",children:"Uptime"}),(0,l.jsx)("div",{className:"flex-1 flex justify-end overflow-hidden -mr-0.5 pr-0.5",children:(0,l.jsx)(i.xvT,{size:"14",children:(0,x.bc)(p,{format:"long"})})})]}),(0,l.jsxs)("div",{className:"flex gap-4 justify-between items-center",children:[(0,l.jsx)(i.__J,{size:"14",color:"subtle",noWrap:!0,className:"w-[100px]",children:"Network"}),(0,l.jsx)("div",{className:"flex-1 flex justify-end overflow-hidden -mr-0.5 pr-0.5",children:(0,l.jsx)(i.xvT,{size:"14",children:null===(r=h.data)||void 0===r?void 0:r.network})})]}),(0,l.jsxs)("div",{className:"flex gap-4 justify-between items-center",children:[(0,l.jsx)(i.__J,{size:"14",color:"subtle",noWrap:!0,className:"w-[100px]",children:"Version"}),(0,l.jsx)(i.rUS,{size:"14",href:g,underline:"hover",target:"_blank",ellipsis:!0,children:null===(c=h.data)||void 0===c?void 0:c.version})]})]})}function h(){let e=(0,n.d_)({config:{swr:{revalidateOnFocus:!1}}});return e.data&&"Mainnet"!==e.data.network?(0,l.jsx)(i.t6k,{testnetName:e.data.network}):null}function j(e){let s=(0,n.X2)(),{isSynced:t}=(0,o.n)();return(0,l.jsx)(i.tU3,{appName:"renterd",profile:(0,l.jsx)(u,{}),banner:(0,l.jsx)(h,{}),connectivityRoute:c.h,isSynced:t,walletBalanceSc:s.data&&{spendable:new(r())(s.data.spendable),confirmed:new(r())(s.data.confirmed),unconfirmed:new(r())(s.data.unconfirmed)},...e})}},97992:function(e,s,t){t.d(s,{e:function(){return o}});var l=t(52322),i=t(36655),n=t(61020),a=t(82851),r=t(98334),c=t(87764);function o(){let{totals:e}=(0,c.Z)(),s=e.all===e.info;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(i.KJW,{title:"Files",route:r._.buckets.index,children:(0,l.jsx)(n.ROc,{})}),(0,l.jsx)(i.KJW,{title:"Configuration",route:r._.config.index,children:(0,l.jsx)(n.wWN,{})}),(0,l.jsx)(i.KJW,{title:"Contracts",route:r._.contracts.index,children:(0,l.jsx)(n.VBo,{})}),(0,l.jsx)(i.KJW,{title:"Hosts",route:r._.hosts.index,children:(0,l.jsx)(n.VHe,{})}),(0,l.jsx)(i.KJW,{title:"S3 authentication keypairs",route:r._.keys.index,children:(0,l.jsx)(n._m8,{})}),(0,l.jsxs)("div",{className:"relative",children:[e.all?s?(0,l.jsx)("div",{className:(0,a.cx)("absolute -right-[2px] top-px w-1 h-1","rounded-full","bg-gray-1000 dark:bg-white","pointer-events-none")}):(0,l.jsx)(i.xvT,{size:"10",className:(0,a.cx)("absolute -right-[9px] -top-1 py-px px-[5px]","text-white","bg-red-500 dark:bg-red-500 rounded","pointer-events-none"),color:"none",children:e.all.toLocaleString()}):null,(0,l.jsx)(i.KJW,{title:"Alerts",route:r._.alerts.index,children:(0,l.jsx)(n.Dkj,{})})]})]})}}}]);
\ No newline at end of file
diff --git a/renterd/assets/_next/static/chunks/pages/_app-e2047494ccafb856.js b/renterd/assets/_next/static/chunks/pages/_app-1b088d0420f04c9e.js
similarity index 88%
rename from renterd/assets/_next/static/chunks/pages/_app-e2047494ccafb856.js
rename to renterd/assets/_next/static/chunks/pages/_app-1b088d0420f04c9e.js
index 202431a96..e01a9fbc8 100644
--- a/renterd/assets/_next/static/chunks/pages/_app-e2047494ccafb856.js
+++ b/renterd/assets/_next/static/chunks/pages/_app-1b088d0420f04c9e.js
@@ -14,7 +14,7 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
- */var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,a=n?Symbol.for("react.fragment"):60107,o=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,u=n?Symbol.for("react.context"):60110,c=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,h=n?Symbol.for("react.suspense"):60113,p=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,v=n?Symbol.for("react.lazy"):60116,g=n?Symbol.for("react.block"):60121,y=n?Symbol.for("react.fundamental"):60117,b=n?Symbol.for("react.responder"):60118,x=n?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case c:case d:case a:case s:case o:case h:return e;default:switch(e=e&&e.$$typeof){case u:case f:case v:case m:case l:return e;default:return t}}case i:return t}}}function j(e){return w(e)===d}t.AsyncMode=c,t.ConcurrentMode=d,t.ContextConsumer=u,t.ContextProvider=l,t.Element=r,t.ForwardRef=f,t.Fragment=a,t.Lazy=v,t.Memo=m,t.Portal=i,t.Profiler=s,t.StrictMode=o,t.Suspense=h,t.isAsyncMode=function(e){return j(e)||w(e)===c},t.isConcurrentMode=j,t.isContextConsumer=function(e){return w(e)===u},t.isContextProvider=function(e){return w(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return w(e)===f},t.isFragment=function(e){return w(e)===a},t.isLazy=function(e){return w(e)===v},t.isMemo=function(e){return w(e)===m},t.isPortal=function(e){return w(e)===i},t.isProfiler=function(e){return w(e)===s},t.isStrictMode=function(e){return w(e)===o},t.isSuspense=function(e){return w(e)===h},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===d||e===s||e===o||e===h||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===m||e.$$typeof===l||e.$$typeof===u||e.$$typeof===f||e.$$typeof===y||e.$$typeof===b||e.$$typeof===x||e.$$typeof===g)},t.typeOf=w},73887:function(e,t,n){"use strict";e.exports=n(43459)},62333:function(e,t){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */t.read=function(e,t,n,r,i){var a,o,s=8*i-r-1,l=(1<>1,c=-7,d=n?i-1:0,f=n?-1:1,h=e[t+d];for(d+=f,a=h&(1<<-c)-1,h>>=-c,c+=s;c>0;a=256*a+e[t+d],d+=f,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=r;c>0;o=256*o+e[t+d],d+=f,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,r),a-=u}return(h?-1:1)*o*Math.pow(2,a-r)},t.write=function(e,t,n,r,i,a){var o,s,l,u=8*a-i-1,c=(1<>1,f=23===i?5960464477539062e-23:0,h=r?0:a-1,p=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(isNaN(t=Math.abs(t))||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+d>=1?t+=f/l:t+=f*Math.pow(2,1-d),t*l>=2&&(o++,l/=2),o+d>=c?(s=0,o=c):o+d>=1?(s=(t*l-1)*Math.pow(2,i),o+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),o=0));i>=8;e[n+h]=255&s,h+=p,s/=256,i-=8);for(o=o<0;e[n+h]=255&o,h+=p,o/=256,u-=8);e[n+h-p]|=128*m}},39515:function(e,t,n){var r=n(38761)(n(37772),"DataView");e.exports=r},89612:function(e,t,n){var r=n(52118),i=n(96909),a=n(98138),o=n(4174),s=n(7942);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++ti?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r=i?e:r(e,t,n)}},24019:function(e,t,n){var r=n(37772)["__core-js_shared__"];e.exports=r},55463:function(e){e.exports=function(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var l=o[e?s:++i];if(!1===n(a[l],l,a))break}return t}}},83126:function(e,t,n){var r=n(23895),i=n(33880),a=n(8435),o=n(66188);e.exports=function(e){return function(t){var n=i(t=o(t))?a(t):void 0,s=n?n[0]:t.charAt(0),l=n?r(n,1).join(""):t.slice(1);return s[e]()+l}}},34311:function(e,t,n){var r=n(81207),i=n(97329),a=n(11618),o=RegExp("['’]","g");e.exports=function(e){return function(t){return r(a(i(t).replace(o,"")),e,"")}}},61655:function(e,t,n){var r=n(6435)({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"});e.exports=r},83043:function(e,t,n){var r=n(38761),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},74871:function(e,t,n){var r=n(45386),i=n(87064),a=n(59950);e.exports=function(e,t,n,o,s,l){var u=1&n,c=e.length,d=t.length;if(c!=d&&!(u&&d>c))return!1;var f=l.get(e),h=l.get(t);if(f&&h)return f==t&&h==e;var p=-1,m=!0,v=2&n?new r:void 0;for(l.set(e,t),l.set(t,e);++p-1&&e%1==0&&e-1}},94769:function(e,t,n){var r=n(22218);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},92411:function(e,t,n){var r=n(89612),i=n(80235),a=n(10326);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(a||i),string:new r}}},36417:function(e,t,n){var r=n(27937);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},86928:function(e,t,n){var r=n(27937);e.exports=function(e){return r(this,e).get(e)}},18052:function(e,t,n){var r=n(27937);e.exports=function(e){return r(this,e).has(e)}},24150:function(e,t,n){var r=n(27937);e.exports=function(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}},75179:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}},73477:function(e){e.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},77777:function(e,t,n){var r=n(30733);e.exports=function(e){var t=r(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}},99191:function(e,t,n){var r=n(38761)(Object,"create");e.exports=r},54248:function(e,t,n){var r=n(60241)(Object.keys,Object);e.exports=r},4146:function(e,t,n){e=n.nmd(e);var r=n(51242),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,o=a&&a.exports===i&&r.process,s=function(){try{var e=a&&a.require&&a.require("util").types;if(e)return e;return o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=s},37157:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},60241:function(e){e.exports=function(e,t){return function(n){return e(t(n))}}},37772:function(e,t,n){var r=n(51242),i="object"==typeof self&&self&&self.Object===Object&&self,a=r||i||Function("return this")();e.exports=a},52842:function(e){e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},52482:function(e){e.exports=function(e){return this.__data__.has(e)}},16909:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}},15243:function(e,t,n){var r=n(80235);e.exports=function(){this.__data__=new r,this.size=0}},72858:function(e){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},4417:function(e){e.exports=function(e){return this.__data__.get(e)}},8605:function(e){e.exports=function(e){return this.__data__.has(e)}},71418:function(e,t,n){var r=n(80235),i=n(10326),a=n(96738);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var o=n.__data__;if(!i||o.length<199)return o.push([e,t]),this.size=++n.size,this;n=this.__data__=new a(o)}return n.set(e,t),this.size=n.size,this}},8435:function(e,t,n){var r=n(50217),i=n(33880),a=n(63344);e.exports=function(e){return i(e)?a(e):r(e)}},54452:function(e,t,n){var r=n(77777),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g,o=r(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,function(e,n,r,i){t.push(r?i.replace(a,"$1"):n||e)}),t});e.exports=o},33812:function(e,t,n){var r=n(4795),i=1/0;e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-i?"-0":t}},87035:function(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},52153:function(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},63344:function(e){var t="\ud800-\udfff",n="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",r="\ud83c[\udffb-\udfff]",i="[^"+t+"]",a="(?:\ud83c[\udde6-\uddff]){2}",o="[\ud800-\udbff][\udc00-\udfff]",s="(?:"+n+"|"+r+")?",l="[\\ufe0e\\ufe0f]?",u="(?:\\u200d(?:"+[i,a,o].join("|")+")"+l+s+")*",c=RegExp(r+"(?="+r+")|(?:"+[i+n+"?",n,a,o,"["+t+"]"].join("|")+")"+(l+s+u),"g");e.exports=function(e){return e.match(c)||[]}},75304:function(e){var t="\ud800-\udfff",n="\\u2700-\\u27bf",r="a-z\\xdf-\\xf6\\xf8-\\xff",i="A-Z\\xc0-\\xd6\\xd8-\\xde",a="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",o="['’]",s="["+a+"]",l="["+r+"]",u="[^"+t+a+"\\d+"+n+r+i+"]",c="(?:\ud83c[\udde6-\uddff]){2}",d="[\ud800-\udbff][\udc00-\udfff]",f="["+i+"]",h="(?:"+l+"|"+u+")",p="(?:"+o+"(?:d|ll|m|re|s|t|ve))?",m="(?:"+o+"(?:D|LL|M|RE|S|T|VE))?",v="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\ud83c[\udffb-\udfff])?",g="[\\ufe0e\\ufe0f]?",y="(?:\\u200d(?:"+["[^"+t+"]",c,d].join("|")+")"+g+v+")*",b="(?:"+["["+n+"]",c,d].join("|")+")"+(g+v+y),x=RegExp([f+"?"+l+"+"+p+"(?="+[s,f,"$"].join("|")+")","(?:"+f+"|"+u+")+"+m+"(?="+[s,f+h,"$"].join("|")+")",f+"?"+h+"+"+p,f+"+"+m,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])","\\d+",b].join("|"),"g");e.exports=function(e){return e.match(x)||[]}},96009:function(e,t,n){var r=n(82108),i=n(34311)(function(e,t,n){return t=t.toLowerCase(),e+(n?r(t):t)});e.exports=i},82108:function(e,t,n){var r=n(66188),i=n(23779);e.exports=function(e){return i(r(e).toLowerCase())}},54073:function(e,t,n){var r=n(29259),i=n(61100),a=n(7642),o=Math.max,s=Math.min;e.exports=function(e,t,n){var l,u,c,d,f,h,p=0,m=!1,v=!1,g=!0;if("function"!=typeof e)throw TypeError("Expected a function");function y(t){var n=l,r=u;return l=u=void 0,p=t,d=e.apply(r,n)}function b(e){var n=e-h,r=e-p;return void 0===h||n>=t||n<0||v&&r>=c}function x(){var e,n,r,a=i();if(b(a))return w(a);f=setTimeout(x,(e=a-h,n=a-p,r=t-e,v?s(r,c-n):r))}function w(e){return(f=void 0,g&&l)?y(e):(l=u=void 0,d)}function j(){var e,n=i(),r=b(n);if(l=arguments,u=this,h=n,r){if(void 0===f)return p=e=h,f=setTimeout(x,t),m?y(e):d;if(v)return clearTimeout(f),f=setTimeout(x,t),y(h)}return void 0===f&&(f=setTimeout(x,t)),d}return t=a(t)||0,r(n)&&(m=!!n.leading,c=(v="maxWait"in n)?o(a(n.maxWait)||0,t):c,g="trailing"in n?!!n.trailing:g),j.cancel=function(){void 0!==f&&clearTimeout(f),p=0,l=h=u=f=void 0},j.flush=function(){return void 0===f?d:w(i())},j}},97329:function(e,t,n){var r=n(61655),i=n(66188),a=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,o=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");e.exports=function(e){return(e=i(e))&&e.replace(a,r).replace(o,"")}},41225:function(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},72579:function(e,t,n){var r=n(13324);e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},93352:function(e,t,n){var r=n(32726),i=n(1369);e.exports=function(e,t){return null!=e&&i(e,t,r)}},95041:function(e,t,n){var r=n(20187),i=n(1369);e.exports=function(e,t){return null!=e&&i(e,t,r)}},23059:function(e){e.exports=function(e){return e}},79631:function(e,t,n){var r=n(15183),i=n(15125),a=Object.prototype,o=a.hasOwnProperty,s=a.propertyIsEnumerable,l=r(function(){return arguments}())?r:function(e){return i(e)&&o.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},86152:function(e){var t=Array.isArray;e.exports=t},67878:function(e,t,n){var r=n(61049),i=n(61158);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},73226:function(e,t,n){e=n.nmd(e);var r=n(37772),i=n(36330),a=t&&!t.nodeType&&t,o=a&&e&&!e.nodeType&&e,s=o&&o.exports===a?r.Buffer:void 0,l=s?s.isBuffer:void 0;e.exports=l||i},61049:function(e,t,n){var r=n(53366),i=n(29259);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},61158:function(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},29259:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},15125:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},4795:function(e,t,n){var r=n(53366),i=n(15125);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},77598:function(e,t,n){var r=n(35522),i=n(47826),a=n(4146),o=a&&a.isTypedArray,s=o?i(o):r;e.exports=s},90249:function(e,t,n){var r=n(1634),i=n(86411),a=n(67878);e.exports=function(e){return a(e)?r(e):i(e)}},19950:function(e,t,n){var r=n(13940),i=n(26548),a=n(68286);e.exports=function(e,t){var n={};return t=a(t,3),i(e,function(e,i,a){r(n,t(e,i,a),e)}),n}},34519:function(e,t,n){var r=n(13940),i=n(26548),a=n(68286);e.exports=function(e,t){var n={};return t=a(t,3),i(e,function(e,i,a){r(n,i,t(e,i,a))}),n}},30733:function(e,t,n){var r=n(96738);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(i.Cache||r),n}i.Cache=r,e.exports=i},61100:function(e,t,n){var r=n(37772);e.exports=function(){return r.Date.now()}},65798:function(e,t,n){var r=n(20256),i=n(82952),a=n(21401),o=n(33812);e.exports=function(e){return a(e)?r(o(e)):i(e)}},57370:function(e,t,n){var r=n(34311)(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()});e.exports=r},30981:function(e){e.exports=function(){return[]}},36330:function(e){e.exports=function(){return!1}},7642:function(e,t,n){var r=n(51704),i=n(29259),a=n(4795),o=0/0,s=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(a(e))return o;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=l.test(e);return n||u.test(e)?c(e.slice(2),n?2:8):s.test(e)?o:+e}},66188:function(e,t,n){var r=n(1054);e.exports=function(e){return null==e?"":r(e)}},23779:function(e,t,n){var r=n(83126)("toUpperCase");e.exports=r},11618:function(e,t,n){var r=n(45981),i=n(83559),a=n(66188),o=n(75304);e.exports=function(e,t,n){return(e=a(e),void 0===(t=n?void 0:t))?i(e)?o(e):r(e):e.match(t)||[]}},53207:function(e,t,n){var r=n(96570);r.prototype.formulaEval=function(){"use strict";for(var e,t,n,r=[],i=this.value,a=0;a"+t.value+""+i[a].show+""+e.value+"",type:10}):r.push({value:(1!=t.type?"(":"")+t.value+(1!=t.type?")":"")+""+e.value+"",type:1})):2===i[a].type||9===i[a].type?(e=r.pop(),t=r.pop(),r.push({value:(1!=t.type?"(":"")+t.value+(1!=t.type?")":"")+i[a].show+(1!=e.type?"(":"")+e.value+(1!=e.type?")":""),type:i[a].type})):12===i[a].type&&(e=r.pop(),t=r.pop(),n=r.pop(),r.push({value:i[a].show+"("+n.value+","+t.value+","+e.value+")",type:12}));return r[0].value},e.exports=r},66655:function(e,t,n){"use strict";var r=n(72346);function i(e,t){for(var n=0;np.length-2?p.length-1:e.length-l;n>0;n--)if(void 0!==p[n])for(i=0;i
0&&En)s.push(e);else{for(;n>=i&&!c||c&&i1)throw new r.Exception("Uncaught Syntax error");return a[0].value>1e15?"Infinity":parseFloat(a[0].value.toFixed(15))},r.eval=function(e,t,n){return void 0===t?this.lex(e).toPostfix().postfixEval():void 0!==n?this.lex(e,t).toPostfix().postfixEval(n):void 0!==t.length?this.lex(e,t).toPostfix().postfixEval():this.lex(e).toPostfix().postfixEval(t)},e.exports=r},38617:function(e,t,n){"use strict";n.d(t,{F:function(){return u},f:function(){return c}});var r=n(2784);let i=["light","dark"],a="(prefers-color-scheme: dark)",o="undefined"==typeof window,s=(0,r.createContext)(void 0),l={setTheme:e=>{},themes:[]},u=()=>{var e;return null!==(e=(0,r.useContext)(s))&&void 0!==e?e:l},c=e=>(0,r.useContext)(s)?r.createElement(r.Fragment,null,e.children):r.createElement(f,e),d=["light","dark"],f=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:o=!0,storageKey:l="theme",themes:u=d,defaultTheme:c=n?"system":"light",attribute:f="data-theme",value:g,children:y,nonce:b})=>{let[x,w]=(0,r.useState)(()=>p(l,c)),[j,k]=(0,r.useState)(()=>p(l)),E=g?Object.values(g):u,S=(0,r.useCallback)(e=>{let r=e;if(!r)return;"system"===e&&n&&(r=v());let a=g?g[r]:r,s=t?m():null,l=document.documentElement;if("class"===f?(l.classList.remove(...E),a&&l.classList.add(a)):a?l.setAttribute(f,a):l.removeAttribute(f),o){let e=i.includes(c)?c:null,t=i.includes(r)?r:e;l.style.colorScheme=t}null==s||s()},[]),C=(0,r.useCallback)(e=>{w(e);try{localStorage.setItem(l,e)}catch(e){}},[e]),_=(0,r.useCallback)(t=>{k(v(t)),"system"===x&&n&&!e&&S("system")},[x,e]);(0,r.useEffect)(()=>{let e=window.matchMedia(a);return e.addListener(_),_(e),()=>e.removeListener(_)},[_]),(0,r.useEffect)(()=>{let e=e=>{e.key===l&&C(e.newValue||c)};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[C]),(0,r.useEffect)(()=>{S(null!=e?e:x)},[e,x]);let O=(0,r.useMemo)(()=>({theme:x,setTheme:C,forcedTheme:e,resolvedTheme:"system"===x?j:x,themes:n?[...u,"system"]:u,systemTheme:n?j:void 0}),[x,C,e,j,n,u]);return r.createElement(s.Provider,{value:O},r.createElement(h,{forcedTheme:e,disableTransitionOnChange:t,enableSystem:n,enableColorScheme:o,storageKey:l,themes:u,defaultTheme:c,attribute:f,value:g,children:y,attrs:E,nonce:b}),y)},h=(0,r.memo)(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:o,enableColorScheme:s,defaultTheme:l,value:u,attrs:c,nonce:d})=>{let f="system"===l,h="class"===n?`var d=document.documentElement,c=d.classList;c.remove(${c.map(e=>`'${e}'`).join(",")});`:`var d=document.documentElement,n='${n}',s='setAttribute';`,p=s?i.includes(l)&&l?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${l}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",m=(e,t=!1,r=!0)=>{let a=u?u[e]:e,o=t?e+"|| ''":`'${a}'`,l="";return s&&r&&!t&&i.includes(e)&&(l+=`d.style.colorScheme = '${e}';`),"class"===n?l+=t||a?`c.add(${o})`:"null":a&&(l+=`d[s](n,${o})`),l},v=e?`!function(){${h}${m(e)}}()`:o?`!function(){try{${h}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${f})){var t='${a}',m=window.matchMedia(t);if(m.media!==t||m.matches){${m("dark")}}else{${m("light")}}}else if(e){${u?`var x=${JSON.stringify(u)};`:""}${m(u?"x[e]":"e",!0)}}${f?"":"else{"+m(l,!1,!1)+"}"}${p}}catch(e){}}()`:`!function(){try{${h}var e=localStorage.getItem('${t}');if(e){${u?`var x=${JSON.stringify(u)};`:""}${m(u?"x[e]":"e",!0)}}else{${m(l,!1,!1)};}${p}}catch(t){}}();`;return r.createElement("script",{nonce:d,dangerouslySetInnerHTML:{__html:v}})},()=>!0),p=(e,t)=>{let n;if(!o){try{n=localStorage.getItem(e)||void 0}catch(e){}return n||t}},m=()=>{let e=document.createElement("style");return e.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(e)},1)}},v=e=>(e||(e=window.matchMedia(a)),e.matches?"dark":"light")},86570:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return n(83391)}])},35599:function(e,t,n){"use strict";n.d(t,{Ul:function(){return s},WD:function(){return l},fu:function(){return c},o4:function(){return u}});var r=n(52322),i=n(36655),a=n(82851),o=n(99182);function s(e){let{currentPage:t,parentPage:n,commandPage:s,className:l,...u}=e,c=(0,o.U8)(e=>e.search);if((null==n?void 0:n.namespace)===(null==t?void 0:t.namespace)&&!c)return(0,r.jsx)(o.mY.Item,{className:(0,a.cx)((0,i.Vkc)(),"group",l),value:"".concat(null==s?void 0:s.label," ").concat(u.children.toString()),...u})}function l(e){let{currentPage:t,commandPage:n,className:s,...l}=e,u=(0,o.U8)(e=>e.search),c=n.namespace.startsWith((null==t?void 0:t.namespace)||"");if(u&&c||n.namespace===(null==t?void 0:t.namespace))return(0,r.jsx)(o.mY.Item,{className:(0,a.cx)((0,i.Vkc)(),"group",s),value:"".concat(n.label," ").concat(l.children.toString()),...l})}function u(e){let{currentPage:t,commandPage:n,className:s,...l}=e,u=(0,o.U8)(e=>e.search),c=n.namespace.startsWith((null==t?void 0:t.namespace)||"");if(u&&c||!t||n.namespace===(null==t?void 0:t.namespace))return(0,r.jsx)(o.mY.Item,{className:(0,a.cx)((0,i.Vkc)(),"group",s),value:"".concat(n.label," ").concat(l.children.toString()),...l})}function c(e){let{heading:t,currentPage:n,commandPage:a,...s}=e,l=(0,o.U8)(e=>e.search);return(0,r.jsx)(o.mY.Group,{heading:l&&(null==n?void 0:n.namespace)!==a.namespace&&(0,r.jsx)(i.__J,{className:"px-1",size:"12",children:a.label}),...s})}n(2784)},91492:function(e,t,n){"use strict";n.d(t,{F:function(){return g}});var r=n(52322),i=n(36655),a=n(61020),o=n(57016),s=n(98334),l=n(5632),u=n(76838),c=n(56328),d=n(82229),f=n(94613),h=n(98131),p=n(30291),m=n(97112),v=n(2784);function g(e){var t,n;let{id:g,trigger:y,address:b,publicKey:x,contentProps:w,buttonProps:j}=e,k=(0,l.useRouter)(),{setFilter:E,resetFilters:S}=(0,c.l)(),{setFilter:C,resetFilters:_}=(0,u.G)(),O=(0,o.uf)(),M=(0,o.s2)(),T=(0,f.l)(),A=(0,d.I)(),P=function(){let{openConfirmDialog:e}=(0,m.Rh)(),t=(0,o.IK)();return(0,v.useCallback)(n=>e({title:"Delete contract",action:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.Jrl,{}),"Delete"]}),variant:"red",body:(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)(i.nvN,{size:"14",children:"Are you sure you would like to delete the following contract:"}),(0,r.jsxs)(i.nvN,{size:"14",font:"mono",children:[n.slice(0,20),"..."]})]}),onConfirm:async()=>{(await t.delete({params:{id:n}})).error&&(0,i.OHV)("Error deleting contract."),(0,i.OPV)("Successfully deleted contract.")}}),[e,t])}();return(0,r.jsxs)(i.h_2,{trigger:y||(0,r.jsx)(i.zxk,{variant:"ghost",icon:"hover",...j,children:(0,r.jsx)(a.iG7,{})}),contentProps:{align:"start",...w,onClick:e=>{e.stopPropagation()}},children:[(0,r.jsx)("div",{className:"px-1.5 py-1",children:(0,r.jsxs)(i.xvT,{size:"14",weight:"medium",color:"subtle",children:["Contract ",x.slice(0,24),"..."]})}),(0,r.jsx)(i.Juw,{children:"Filters"}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{S(),E({id:"addressContains",value:b,label:"Address contains ".concat(b)}),k.push(s._.hosts.index)},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.q0D,{})}),"Filter hosts by host address"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{_(),C((0,h.e)(b)),k.push(s._.contracts.index)},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.q0D,{})}),"Filter contracts by host address"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{_(),C((0,p.V)(x)),k.push(s._.contracts.index)},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.q0D,{})}),"Filter contracts by host public key"]}),(0,r.jsx)(i.Juw,{children:"Actions"}),(null===(t=O.data)||void 0===t?void 0:t.find(e=>e===b))?(0,r.jsxs)(i.Xiv,{onSelect:()=>T([],[b]),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.nCM,{})}),"Remove host address from blocklist"]}):(0,r.jsxs)(i.Xiv,{onSelect:()=>T([b],[]),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.nCM,{})}),"Add host address to blocklist"]}),(null===(n=M.data)||void 0===n?void 0:n.find(e=>e===x))?(0,r.jsxs)(i.Xiv,{onSelect:()=>A([],[x]),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.nCM,{})}),"Remove host public key from allowlist"]}):(0,r.jsxs)(i.Xiv,{onSelect:()=>A([x],[]),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.nCM,{})}),"Add host public key to allowlist"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>P(g),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.Jrl,{})}),"Delete contract"]}),(0,r.jsx)(i.Juw,{children:"Copy"}),(0,r.jsxs)(i.Xiv,{onSelect:()=>(0,i.vQq)(g,"contract ID"),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.olJ,{})}),"Contract ID"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>(0,i.vQq)(x,"host public key"),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.olJ,{})}),"Host public key"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>(0,i.vQq)(b,"host address"),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.olJ,{})}),"Host address"]})]})}},14613:function(e,t,n){"use strict";n.d(t,{F:function(){return N}});var r=n(52322),i=n(36655),a=n(35599);let o={namespace:"contracts/filterExpiryDate",label:"Contracts filter by expiry date"},s=[{id:"expiry",value:"day",label:"expires today",fn:e=>{let t=new Date().getTime(),n=t+(0,i.NrH)(1);return e.endTimet}},{id:"expiry",value:"week",label:"expires this week",fn:e=>{let t=new Date().getTime(),n=t+(0,i.BL0)(1);return e.endTimet}},{id:"expiry",value:"month",label:"expires this month",fn:e=>{let t=new Date().getTime(),n=t+(0,i.xLV)(1);return e.endTimet}},{id:"expiry",value:"nextMonth",label:"expires next month",fn:e=>{let t=new Date().getTime(),n=t+(0,i.xLV)(2);return e.endTimet}},{id:"expiry",value:"year",label:"expires this year",fn:e=>{let t=new Date().getTime(),n=t+(0,i.ivg)(1);return e.endTimet}},{id:"expiry",value:"expired",label:"expired",fn:e=>{let t=new Date().getTime();return e.endTime(0,r.jsx)(a.WD,{currentPage:t,commandPage:o,onSelect:()=>{n(e)},children:e.label},e.id+e.value))})}let u={namespace:"contracts/filterFormationDate",label:"Contracts filter by formation date"},c=[{id:"formationDate",value:"day",label:"formed in the last day",fn:e=>{let t=new Date().getTime()-(0,i.NrH)(1);return e.startTime>=t}},{id:"formationDate",value:"week",label:"formed in the last week",fn:e=>{let t=new Date().getTime()-(0,i.BL0)(1);return e.startTime>=t}},{id:"formationDate",value:"twoWeeks",label:"formed in the last two weeks",fn:e=>{let t=new Date().getTime()-(0,i.BL0)(2);return e.startTime>=t}},{id:"formationDate",value:"month",label:"formed in the last month",fn:e=>{let t=new Date().getTime()-(0,i.xLV)(1);return e.startTime>=t}},{id:"formationDate",value:"twoMonths",label:"formed in the last two months",fn:e=>{let t=new Date().getTime()-(0,i.xLV)(2);return e.startTime>=t}},{id:"formationDate",value:"year",label:"formed in the last year",fn:e=>{let t=new Date().getTime()-(0,i.ivg)(1);return e.startTime>=t}}];function d(e){let{currentPage:t,select:n}=e;return(0,r.jsx)(a.fu,{currentPage:t,commandPage:u,children:c.map(e=>(0,r.jsx)(a.WD,{currentPage:t,commandPage:u,onSelect:()=>{n(e)},children:e.label},e.id+e.value))})}let f={namespace:"contracts/filterRenewDate",label:"Contracts filter by renew date"},h=[{id:"renewDate",value:"day",label:"renewed in the last day",fn:e=>{let t=new Date().getTime()-(0,i.NrH)(1);return e.isRenewed&&e.startTime>=t}},{id:"renewDate",value:"week",label:"renewed in the last week",fn:e=>{let t=new Date().getTime()-(0,i.BL0)(1);return e.isRenewed&&e.startTime>=t}},{id:"renewDate",value:"twoWeeks",label:"renewed in the last two weeks",fn:e=>{let t=new Date().getTime()-(0,i.BL0)(2);return e.isRenewed&&e.startTime>=t}},{id:"renewDate",value:"month",label:"renewed in the last month",fn:e=>{let t=new Date().getTime()-(0,i.xLV)(1);return e.isRenewed&&e.startTime>=t}},{id:"renewDate",value:"twoMonths",label:"renewed in the last two months",fn:e=>{let t=new Date().getTime()-(0,i.xLV)(2);return e.isRenewed&&e.startTime>=t}},{id:"renewDate",value:"year",label:"renewed in the last year",fn:e=>{let t=new Date().getTime()-(0,i.ivg)(1);return e.isRenewed&&e.startTime>=t}}];function p(e){let{currentPage:t,select:n}=e;return(0,r.jsx)(a.fu,{currentPage:t,commandPage:f,children:h.map(e=>(0,r.jsx)(a.WD,{currentPage:t,commandPage:f,onSelect:()=>{n(e)},children:e.label},e.id+e.value))})}var m=n(97112),v=n(98131);let g={namespace:"contracts/filterAddress",label:"Contracts filter by address"};function y(e){let{select:t,currentPage:n}=e,{openDialog:i}=(0,m.Rh)(),o=(0,v.e)("");return(0,r.jsx)(a.fu,{currentPage:n,commandPage:g,children:(0,r.jsx)(a.WD,{currentPage:n,commandPage:g,onSelect:()=>{t(),i("contractsFilterAddress")},children:o.label})})}function b(e){let{select:t,currentPage:n,parentPage:i,commandPage:o}=e,{openDialog:s}=(0,m.Rh)();return(0,r.jsx)(a.Ul,{currentPage:n,parentPage:i,commandPage:o,onSelect:()=>{t(),s("contractsFilterAddress")},children:g.label})}var x=n(30291);let w={namespace:"contracts/filterPublicKey",label:"Contracts filter by public key"};function j(e){let{select:t,currentPage:n}=e,i=(0,x.V)(""),{openDialog:o}=(0,m.Rh)();return(0,r.jsx)(a.fu,{currentPage:n,commandPage:w,children:(0,r.jsx)(a.WD,{currentPage:n,commandPage:w,onSelect:()=>{t(),o("contractsFilterPublicKey")},children:i.label})})}function k(e){let{select:t,currentPage:n,parentPage:i,commandPage:o}=e,{openDialog:s}=(0,m.Rh)();return(0,r.jsx)(a.Ul,{currentPage:n,parentPage:i,commandPage:o,onSelect:()=>{t(),s("contractsFilterPublicKey")},children:w.label})}var E=n(11948);let S={namespace:"contracts/filterContractSet",label:"Contracts filter by contract set"};function C(e){let{select:t,currentPage:n}=e,i=(0,E.l)(""),{openDialog:o}=(0,m.Rh)();return(0,r.jsx)(a.fu,{currentPage:n,commandPage:S,children:(0,r.jsx)(a.WD,{currentPage:n,commandPage:S,onSelect:()=>{t(),o("contractsFilterContractSet")},children:i.label})})}function _(e){let{select:t,currentPage:n,parentPage:i,commandPage:o}=e,{openDialog:s}=(0,m.Rh)();return(0,r.jsx)(a.Ul,{currentPage:n,parentPage:i,commandPage:o,onSelect:()=>{t(),s("contractsFilterContractSet")},children:S.label})}function O(e){let{currentPage:t,select:n}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(y,{currentPage:t,select:n}),(0,r.jsx)(j,{currentPage:t,select:n}),(0,r.jsx)(C,{currentPage:t,select:n}),(0,r.jsx)(l,{currentPage:t,select:n}),(0,r.jsx)(d,{currentPage:t,select:n}),(0,r.jsx)(p,{currentPage:t,select:n})]})}let M={namespace:"contracts",label:"Contracts"};function T(e){let{currentPage:t,parentPage:n,pushPage:i,select:s}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(b,{currentPage:t,parentPage:n,commandPage:M,select:s}),(0,r.jsx)(k,{currentPage:t,parentPage:n,commandPage:M,select:s}),(0,r.jsx)(_,{currentPage:t,parentPage:n,commandPage:M,select:s}),(0,r.jsx)(a.Ul,{currentPage:t,parentPage:n,commandPage:M,onSelect:()=>{i(u)},children:u.label}),(0,r.jsx)(a.Ul,{currentPage:t,parentPage:n,commandPage:M,onSelect:()=>{i(o)},children:o.label}),(0,r.jsx)(a.Ul,{currentPage:t,parentPage:n,commandPage:M,onSelect:()=>{i(f)},children:f.label})]})}var A=n(76838),P=n(2784);function N(e){let{currentPage:t,parentPage:n,pushPage:i,beforeSelect:a,afterSelect:o}=e,{setFilter:s}=(0,A.G)(),l=(0,P.useCallback)(e=>{a&&a(),e&&s(e),o&&o()},[s,a,o]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(T,{parentPage:n,currentPage:t,pushPage:i,select:l}),(0,r.jsx)(O,{currentPage:t,select:l})]})}},98131:function(e,t,n){"use strict";n.d(t,{e:function(){return u},p:function(){return f}});var r=n(52322),i=n(36655),a=n(76838),o=n(7114),s=n(24511),l=n(97112);function u(e){return{id:"addressContains",value:e,label:"address contains ".concat(e),fn:t=>t.hostIp.includes(e)}}let c={address:""},d=s.Ry().shape({address:s.Z_().required("Required")});function f(e){let{trigger:t,open:n,onOpenChange:s}=e,{closeDialog:f}=(0,l.Rh)(),{setFilter:h}=(0,a.G)(),p=(0,o.TA)({initialValues:c,validationSchema:d,onSubmit:e=>{h(u(e.address)),p.resetForm(),f()}});return(0,r.jsx)(i.VqE,{trigger:t,title:"Filter by address",open:n,onOpenChange:e=>{e||p.resetForm(),s(e)},contentVariants:{className:"w-[400px]"},onSubmit:p.handleSubmit,children:(0,r.jsx)("div",{className:"flex flex-col gap-4",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(i.cB7,{formik:p,title:"Address",name:"address",placeholder:"Partial match against domain or IP",autoComplete:"off",type:"text",variants:{size:"medium"}}),(0,r.jsx)(i.IKw,{formik:p,size:"medium",children:"Filter"})]})})})}},11948:function(e,t,n){"use strict";n.d(t,{X:function(){return u},l:function(){return l}});var r=n(52322),i=n(36655),a=n(76838),o=n(63955),s=n(2784);function l(e){return{id:"contractSetsInclude",value:e,label:"contract in set ".concat(e),fn:t=>{var n;return null===(n=t.contractSets)||void 0===n?void 0:n.includes(e)}}}function u(e){var t;let{trigger:n,open:u,onOpenChange:c}=e,{setFilter:d,contractSets:f}=(0,a.G)(),h={contractSet:null===(t=f.data)||void 0===t?void 0:t[0]},p=(0,o.cI)({mode:"all",defaultValues:h}),{handleOpenChange:m,closeAndReset:v}=(0,i.t0Y)({form:p,onOpenChange:c,defaultValues:h}),g=function(e){let{contractSets:t}=e;return{contractSet:{type:"select",title:"Contract set",options:t.map(e=>({label:e,value:e})),placeholder:"autopilot",validation:{required:"required"}}}}({contractSets:f.data||[]}),y=(0,s.useCallback)(e=>{d(l(e.contractSet)),v()},[d,v]),b=(0,i.WsO)(g);return(0,r.jsx)(i.VqE,{trigger:n,title:"Filter by contract set",open:u,onOpenChange:m,contentVariants:{className:"w-[400px]"},onSubmit:p.handleSubmit(y,b),children:(0,r.jsx)("div",{className:"flex flex-col gap-4",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(i.WyV,{form:p,fields:g,name:"contractSet"}),(0,r.jsx)(i.ZqQ,{form:p,size:"medium",children:"Filter"})]})})})}},30291:function(e,t,n){"use strict";n.d(t,{C:function(){return f},V:function(){return u}});var r=n(52322),i=n(36655),a=n(76838),o=n(7114),s=n(24511),l=n(97112);function u(e){return{id:"publicKeyContains",value:e,label:"public key contains ".concat((0,i.$Gg)(e,20)),fn:t=>t.hostKey.includes(e)}}let c={publicKey:""},d=s.Ry().shape({publicKey:s.Z_().required("Required")});function f(e){let{trigger:t,open:n,onOpenChange:s}=e,{closeDialog:f}=(0,l.Rh)(),{setFilter:h}=(0,a.G)(),p=(0,o.TA)({initialValues:c,validationSchema:d,onSubmit:e=>{h(u(e.publicKey)),p.resetForm(),f()}});return(0,r.jsx)(i.VqE,{trigger:t,title:"Filter by public key",open:n,onOpenChange:e=>{e||p.resetForm(),s(e)},contentVariants:{className:"w-[400px]"},onSubmit:p.handleSubmit,children:(0,r.jsx)("div",{className:"flex flex-col gap-4",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(i.cB7,{formik:p,title:"Public key",name:"publicKey",placeholder:"ed25519:02aabd26e627fd...",autoComplete:"off",type:"text",variants:{size:"medium"}}),(0,r.jsx)(i.IKw,{formik:p,size:"medium",children:"Filter"})]})})})}},90721:function(e,t,n){"use strict";n.d(t,{s:function(){return s}});var r=n(52322),i=n(36655),a=n(61020),o=n(97112);function s(e){let{name:t}=e,{openDialog:n}=(0,o.Rh)();return(0,r.jsxs)(i.h_2,{trigger:(0,r.jsx)(i.zxk,{variant:"ghost",icon:"hover",children:(0,r.jsx)(a.fi8,{size:16})}),contentProps:{align:"start"},children:[(0,r.jsx)(i.Juw,{children:"Actions"}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{n("filesBucketPolicy",t)},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.Zbu,{})}),"Change policy"]}),(0,r.jsxs)(i.Xiv,{disabled:"default"===t,onSelect:()=>{n("filesDeleteBucket",t)},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.Jrl,{})}),"Delete bucket"]})]})}},23094:function(e,t,n){"use strict";n.d(t,{z:function(){return f}});var r=n(52322),i=n(36655),a=n(18121),o=n(57016),s=n(82851),l=n(67693),u=n(70899);function c(e){var t,n,s,c;let{path:f,isUploading:h,type:p,health:m,size:v}=e,g="directory"===p,y=(0,o.wy)({disabled:h||g,params:(0,u.W0)(f),config:{swr:{dedupingInterval:5e3}}}),{displayHealth:b,label:x}=(0,a.B)({health:m,size:v,isDirectory:g});if(y.isValidating)return(0,r.jsx)(d,{displayHealth:b,label:x,children:(0,r.jsx)("div",{className:"flex justify-center my-2",children:(0,r.jsx)(i.xgg,{})})});if(!(null===(t=y.data)||void 0===t?void 0:t.object))return(0,r.jsx)(d,{displayHealth:b,label:x,children:(0,r.jsx)(i.xvT,{size:"12",children:"Error fetching slab metadata."})});let w=(0,l.Z)((null===(n=y.data.object.slabs)||void 0===n?void 0:n.map(e=>{var t;return{...e.slab,key:"".concat(e.offset).concat(e.length).concat(e.slab.key),isPartialSlab:!!e.slab.shards,contractSetShards:(null===(t=e.slab.shards)||void 0===t?void 0:t.length)?function(e){let{totalShards:t,minShards:n,health:r}=e,i=Math.ceil(r*(t-n))+n;return i<=0?0:i>t?t:i}({totalShards:e.slab.shards.length,minShards:e.slab.minShards,health:e.slab.health}):0}}))||[],"contractSetShards");return(0,r.jsx)(d,{className:w.length>15?"h-[300px]":"",displayHealth:b,label:x,minShards:null===(s=w.find(e=>e.minShards))||void 0===s?void 0:s.minShards,totalShards:null===(c=w.find(e=>e.shards))||void 0===c?void 0:c.shards.length,children:w.map(e=>(0,r.jsxs)("div",{className:"flex justify-between gap-2",children:[(0,r.jsxs)(i.xvT,{size:"12",color:"subtle",className:"flex items-center",font:"mono",children:["Slab ",e.key.replace("key:","").slice(0,4),":"]}),(0,r.jsx)(i.xvT,{size:"12",className:"flex items-center",children:e.isPartialSlab?"".concat(e.contractSetShards,"/").concat(e.shards.length):"partial slab"})]},e.key))})}function d(e){let{className:t,displayHealth:n,label:a,children:o,minShards:l,totalShards:u}=e;return(0,r.jsxs)("div",{className:(0,s.cx)("z-10 flex flex-col pb-1 -mx-1 overflow-hidden",t),children:[(0,r.jsxs)("div",{className:"flex justify-between gap-2 pt-0.5 pb-px px-2",children:[(0,r.jsx)(i.xvT,{size:"12",children:a}),(0,r.jsxs)(i.xvT,{size:"12",children:[(100*n).toFixed(0),"%"]})]}),l&&u?(0,r.jsxs)("div",{className:"flex justify-between gap-2 pt-0.5 pb-px px-2",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",children:"redundancy"}),(0,r.jsxs)(i.xvT,{size:"12",color:"subtle",children:[l," of ",u]})]}):null,(0,r.jsx)("div",{className:"px-2",children:(0,r.jsx)(i.Z0O,{className:"w-full my-1"})}),(0,r.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,r.jsx)(i.xrM,{children:(0,r.jsx)("div",{className:"px-2",children:o})})})]})}function f(e){let{name:t,isUploading:n,type:o,health:s,size:l}=e,u="directory"===o,{displayHealth:d,label:f,color:h,icon:p}=(0,a.B)({health:s,size:l,isDirectory:u}),m="".concat((100*d).toFixed(0),"%");return u?".."===t?null:(0,r.jsx)(i.zsw,{rootProps:{openDelay:100},trigger:(0,r.jsxs)("div",{className:"flex items-center gap-1 cursor-pointer",children:[(0,r.jsx)(i.xvT,{color:h,children:p}),(0,r.jsx)(i.xvT,{color:"verySubtle",size:"12",children:m})]}),children:(0,r.jsx)("div",{className:"z-10 flex flex-col -mx-1 overflow-hidden",children:(0,r.jsxs)("div",{className:"flex justify-between gap-2 py-0.5 px-2",children:[(0,r.jsx)(i.xvT,{size:"12",children:f}),(0,r.jsx)(i.xvT,{size:"12",children:m})]})})}):n?(0,r.jsx)(i.xgg,{}):(0,r.jsx)(i.zsw,{rootProps:{openDelay:100},trigger:(0,r.jsxs)("div",{className:"flex items-center gap-1 cursor-pointer",children:[(0,r.jsx)(i.xvT,{color:h,children:p}),(0,r.jsx)(i.xvT,{color:"verySubtle",size:"12",children:m})]}),children:(0,r.jsx)(c,{...e})})}},84301:function(e,t,n){"use strict";n.d(t,{I:function(){return d}});var r=n(52322),i=n(36655),a=n(61020),o=n(97112),s=n(2784),l=n(57016),u=n(21487),c=n(70899);function d(e){let{path:t,size:n}=e,d=function(){let{openConfirmDialog:e}=(0,o.Rh)(),t=(0,l.xw)();return(0,s.useCallback)((n,o)=>e({title:"Delete directory",action:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.Jrl,{}),"Delete"]}),variant:"red",body:(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsxs)(i.nvN,{size:"14",children:["Are you sure you would like to delete the following directory which contains ",(0,u.vW)(o)," of data:"]}),(0,r.jsx)(i.nvN,{size:"14",font:"mono",className:"break-words",children:n})]}),onConfirm:async()=>{(await t.delete({params:{...(0,c.W0)(n),batch:!0}})).error&&(0,i.OHV)("Error deleting directory."),(0,i.OPV)("Successfully deleted directory.")}}),[e,t])}(),{openDialog:f}=(0,o.Rh)();return(0,r.jsxs)(i.h_2,{trigger:(0,r.jsx)(i.zxk,{variant:"ghost",icon:"hover",children:(0,r.jsx)(a.ROc,{size:16})}),contentProps:{align:"start",onClick:e=>{e.stopPropagation()}},children:[(0,r.jsx)(i.Juw,{children:"Actions"}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{f("fileRename",t)},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.dr6,{})}),"Rename directory"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{d(t,n)},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.Jrl,{})}),"Delete directory"]})]})}},87023:function(e,t,n){"use strict";n.d(t,{e:function(){return f}});var r=n(52322),i=n(36655),a=n(61020),o=n(97112),s=n(2784),l=n(57016),u=n(70899);function c(e){let{path:t}=e,n=(0,l.wy)({params:(0,u.W0)(t),config:{swr:{dedupingInterval:5e3}}});return(0,r.jsxs)(i.Xiv,{disabled:!n.data,onSelect:()=>{n.data&&(0,i.vQq)(JSON.stringify(n.data.object,null,2),"object metadata")},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.olJ,{})}),"Copy metadata"]})}var d=n(41736);function f(e){let{path:t}=e,{downloadFiles:n,getFileUrl:f,navigateToModeSpecificFiltering:h}=(0,d.b)(),p=function(){let{openConfirmDialog:e}=(0,o.Rh)(),t=(0,l.xw)();return(0,s.useCallback)(n=>e({title:"Delete file",action:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.Jrl,{}),"Delete"]}),variant:"red",body:(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)(i.nvN,{size:"14",children:"Are you sure you would like to delete the following file:"}),(0,r.jsx)(i.nvN,{size:"14",font:"mono",className:"break-words",children:n})]}),onConfirm:async()=>{(await t.delete({params:(0,u.W0)(n)})).error&&(0,i.OHV)("Error deleting file."),(0,i.OPV)("Successfully deleted file.")}}),[e,t])}(),{openDialog:m}=(0,o.Rh)();return(0,r.jsxs)(i.h_2,{trigger:(0,r.jsx)(i.zxk,{variant:"ghost",icon:"hover",children:(0,r.jsx)(a.c_L,{})}),contentProps:{align:"start"},children:[(0,r.jsx)(i.Juw,{children:"Actions"}),(0,r.jsxs)(i.Xiv,{onSelect:async()=>{n([t])},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.vzB,{})}),"Download file"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>m("fileRename",t),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.dr6,{})}),"Rename file"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>p(t),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.Jrl,{})}),"Delete file"]}),(0,r.jsx)(i.Juw,{children:"Filter"}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{h(t)},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.q0D,{})}),"Filter by file name"]}),(0,r.jsx)(i.Juw,{children:"Copy"}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{(0,i.vQq)(t,"file path")},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.olJ,{})}),"Copy file path"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{(0,i.vQq)((0,u.vt)(t),"file path")},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.olJ,{})}),"Copy file name"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{(0,i.vQq)(f(t,!1),"file URL")},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.olJ,{})}),"Copy URL"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{(0,i.E5z)(f(t,!0),(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsx)(i.xvT,{children:"Copied authenticated file URL to clipboard."}),(0,r.jsxs)(i.xvT,{children:["The authenticated URL contains the ",(0,r.jsx)(i.EKh,{children:"renterd"})," ","password, be careful when pasting or sharing the URL."]})]}),{icon:(0,r.jsx)("div",{className:"!flex-none w-5",children:(0,r.jsx)(a.qdM,{className:"w-5 text-amber-600"})}),duration:1e4,className:"!max-w-[1200px]"})},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.olJ,{})}),"Copy authenticated URL"]}),(0,r.jsx)(c,{path:t})]})}},42770:function(e,t,n){"use strict";n.d(t,{F:function(){return a}});var r=n(76838),i=n(91157);function a(){var e;let t=(0,i.w)(),{datasetCount:n,isLoading:a}=(0,r.G)();return{active:t.data&&!a&&n{e.stopPropagation()}},children:[(0,r.jsx)("div",{className:"px-1.5 py-1",children:(0,r.jsxs)(i.xvT,{size:"14",weight:"medium",color:"subtle",children:["Host ",g.slice(0,24),"..."]})}),(0,r.jsx)(i.Juw,{children:"Filters"}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{k(),j({id:"addressContains",value:v,label:"Address contains ".concat((0,i.$Gg)(v,20))}),w.push(s._.hosts.index)},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.q0D,{})}),"Filter hosts by address"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{k(),j((0,m.K)(g)),w.push(s._.hosts.index)},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.q0D,{})}),"Filter hosts by public key"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{S(),E((0,h.e)(v)),w.push(s._.contracts.index)},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.q0D,{})}),"Filter contracts by host address"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{S(),E((0,p.V)(g)),w.push(s._.contracts.index)},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.q0D,{})}),"Filter contracts by host public key"]}),(0,r.jsx)(i.Juw,{children:"Actions"}),(0,r.jsxs)(i.Xiv,{onSelect:()=>T.post({payload:{hostKey:g,hostIP:v,timeout:(0,i.XBW)(30)}}),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a._Eq,{})}),"Rescan host"]}),(null===(t=C.data)||void 0===t?void 0:t.find(e=>e===v))?(0,r.jsxs)(i.Xiv,{onSelect:()=>O([],[v]),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.nCM,{})}),"Remove address from blocklist"]}):(0,r.jsxs)(i.Xiv,{onSelect:()=>O([v],[]),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.nCM,{})}),"Add address to blocklist"]}),(null===(n=_.data)||void 0===n?void 0:n.find(e=>e===g))?(0,r.jsxs)(i.Xiv,{onSelect:()=>M([],[g]),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.nCM,{})}),"Remove public key from allowlist"]}):(0,r.jsxs)(i.Xiv,{onSelect:()=>M([g],[]),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.nCM,{})}),"Add public key to allowlist"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>A.post({params:{publicKey:g}}),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.xkX,{})}),"Reset lost sector count"]}),(0,r.jsx)(i.Juw,{children:"Copy"}),(0,r.jsxs)(i.Xiv,{onSelect:()=>(0,i.vQq)(g,"host public key"),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.olJ,{})}),"Host public key"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>(0,i.vQq)(v,"host address"),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.olJ,{})}),"Host address"]})]})}},37769:function(e,t,n){"use strict";n.d(t,{T:function(){return x},N:function(){return b}});var r=n(52322),i=n(2784),a=n(36655),o=n(21487),s=n(6391),l=n.n(s);function u(e){let{host:t,rates:n}=e,r=n?"$".concat(new(l())(t.settings.storageprice).times((0,o.xf)(1)).times((0,o.S5)(1)).div(1e24).times((null==n?void 0:n.usd)||1).toFixed(2),"/TB"):"".concat((0,o.Vz)(new(l())(t.settings.storageprice).times((0,o.xf)(1)).times((0,o.S5)(1)),{fixed:0}),"/TB"),i="".concat((0,o.vW)(t.activeContracts.reduce((e,t)=>e.plus(t.size),new(l())(0)).toNumber())," utilized"),s="".concat((0,o.vW)(t.settings.remainingstorage)," / ").concat((0,o.vW)(t.settings.totalstorage)," available");return"".concat((0,a.HLH)(t.countryCode)," \xb7 ").concat(r," \xb7 ").concat(i," \xb7 ").concat(s)}var c=function(){let[e,t]=(0,i.useState)(null),[n,r]=(0,i.useState)({width:0,height:0}),a=(0,i.useCallback)(()=>{r({width:(null==e?void 0:e.offsetWidth)||0,height:(null==e?void 0:e.offsetHeight)||0})},[null==e?void 0:e.offsetHeight,null==e?void 0:e.offsetWidth]);return d("resize",a),f(()=>{a()},[null==e?void 0:e.offsetHeight,null==e?void 0:e.offsetWidth]),[t,n]},d=function(e,t,n,r){let a=(0,i.useRef)(t);f(()=>{a.current=t},[t]),(0,i.useEffect)(()=>{var t;let i=null!==(t=null==n?void 0:n.current)&&void 0!==t?t:window;if(!(i&&i.addEventListener))return;let o=e=>a.current(e);return i.addEventListener(e,o,r),()=>{i.removeEventListener(e,o,r)}},[e,n,r])},f="undefined"!=typeof window?i.useLayoutEffect:i.useEffect,h=n(10363),p=n(25237);let m=n.n(p)()(()=>Promise.all([n.e(546),n.e(508),n.e(167),n.e(764),n.e(936)]).then(n.bind(n,6936)),{loadableGenerated:{webpack:()=>[6936]},ssr:!1}),v=(0,i.forwardRef)(function(e,t){return(0,r.jsx)(m,{...e,forwardRef:t})});var g=n(10569),y=n(82494);let b={moveToLocation:(e,t)=>null};function x(e){let{activeHost:t,hosts:n,onMount:a,onHostClick:o,onHostHover:s}=e,d=(0,y.BW)({config:{swr:{revalidateOnFocus:!1}}}),f=(0,i.useRef)(null),p=(0,i.useRef)(b),m=(0,i.useCallback)((e,t)=>{var n;e&&(null===(n=f.current)||void 0===n||n.pointOfView({lat:e[0]-8,lng:e[1],altitude:t||1.5},700))},[]);(0,i.useEffect)(()=>{p.current.moveToLocation=m},[m]),(0,h.Q5)(()=>{var e;if(!f.current)return!1;m((null==t?void 0:t.location)||[48.8323,2.4075],1.5);let n=null===(e=f.current)||void 0===e?void 0:e.scene().children.find(e=>"DirectionalLight"===e.type);return n&&(n.intensity=10),!0}),(0,i.useEffect)(()=>{a&&a(p.current)},[]);let[x,{height:w,width:j}]=c(),k=(0,i.useMemo)(()=>n||[],[n]);return(0,r.jsx)("div",{ref:x,className:"w-full h-full",children:(0,r.jsx)(v,{ref:f,width:j,height:w,backgroundColor:"rgba(0,0,0,0)",globeImageUrl:"/_next/static/media/earth-dark-contrast.bf7081fc.png",bumpImageUrl:"/_next/static/media/earth-topology.e385a70e.png",arcsData:[],atmosphereColor:"rgba(0,0,0,0)",atmosphereAltitude:.16,animateIn:!1,arcLabel:e=>{var t;return u({host:e.dst,rates:null===(t=d.data)||void 0===t?void 0:t.rates.sc})},arcStartLat:e=>+e.src.location[0],arcStartLng:e=>+e.src.location[1],arcEndLat:e=>+e.dst.location[0],arcEndLng:e=>+e.dst.location[1],arcDashLength:.75,arcAltitude:0,arcDashGap:.1,arcDashInitialGap:()=>Math.random(),arcDashAnimateTime:5e3,arcColor:e=>t&&(e.dst.publicKey===t.publicKey||e.src.publicKey===t.publicKey)?["rgba(187, 229, 201, 0.25)","rgba(187, 229, 201, 0.25)"]:["rgba(187, 229, 201, 0.10)","rgba(187, 229, 201, 0.10)"],arcsTransitionDuration:0,pointsData:k,pointLat:e=>e.location[0],pointLng:e=>e.location[1],pointLabel:e=>{var t;return u({host:e,rates:null===(t=d.data)||void 0===t?void 0:t.rates.sc})},pointAltitude:e=>(t&&e.publicKey===(null==t?void 0:t.publicKey)||e.activeContractsCount.gt(0),.1),pointsTransitionDuration:0,pointColor:e=>{let{colorHex:n}=(0,g.Kg)(e);return t&&e.publicKey!==(null==t?void 0:t.publicKey)?function(e,t){let n=parseInt(e.slice(1,3),16),r=parseInt(e.slice(3,5),16),i=parseInt(e.slice(5,7),16);return"rgba(".concat(n,", ").concat(r,", ").concat(i,", ").concat(.2,")")}(n,0):n},pointRadius:e=>(e.activeContractsCount.gt(0)&&e.activeContracts.reduce((e,t)=>e.plus(t.size),new(l())(0)).div(1e12).toNumber(),Math.max(e.settings.remainingstorage/1e13/3,.1)),onPointHover:e=>{e&&(null==s||s(e.publicKey,e.location))},onPointClick:e=>{e&&(null==o||o(e.publicKey,e.location))},pointsMerge:!1})})}},42213:function(e,t,n){"use strict";n.d(t,{L:function(){return M}});var r=n(52322),i=n(35599),a=n(97112),o=n(10532);let s={namespace:"hosts/filterAddress",label:"Hosts filter by address"};function l(e){let{select:t,currentPage:n}=e,{openDialog:l}=(0,a.Rh)(),u=(0,o.q)("");return(0,r.jsx)(i.fu,{currentPage:n,commandPage:s,children:(0,r.jsx)(i.WD,{currentPage:n,commandPage:s,onSelect:()=>{t(),l("hostsFilterAddress")},children:u.label})})}function u(e){let{select:t,currentPage:n,parentPage:o,commandPage:l}=e,{openDialog:u}=(0,a.Rh)();return(0,r.jsx)(i.Ul,{currentPage:n,parentPage:o,commandPage:l,onSelect:()=>{t(),u("hostsFilterAddress")},children:s.label})}let c={namespace:"hosts/filterAllowBlock",label:"Hosts filter by allow/block status"},d=[{id:"filterMode",value:"allowed",label:"allowed"},{id:"filterMode",value:"blocked",label:"blocked"}];function f(e){let{select:t,currentPage:n}=e;return(0,r.jsx)(i.fu,{currentPage:n,commandPage:c,children:d.map(e=>(0,r.jsx)(i.WD,{currentPage:n,commandPage:c,onSelect:()=>{t(e)},children:e.label},e.id+e.value))})}let h={namespace:"hosts/filterActiveContracts",label:"Hosts filter by contracts"},p={id:"hasActiveContracts",bool:!0,label:"has active contracts"};function m(e){let{select:t,currentPage:n}=e;return(0,r.jsx)(i.fu,{currentPage:n,commandPage:h,children:(0,r.jsx)(i.WD,{currentPage:n,commandPage:h,onSelect:()=>{t(p)},children:p.label})})}let v={namespace:"hosts/filterUsable",label:"Hosts filter by usable"},g=[{id:"usabilityMode",value:"usable",label:"usable"},{id:"usabilityMode",value:"unusable",label:"unusable"}];function y(e){let{select:t,currentPage:n}=e;return(0,r.jsx)(i.fu,{currentPage:n,commandPage:v,children:g.map(e=>(0,r.jsx)(i.WD,{currentPage:n,commandPage:v,onSelect:()=>{t(e)},children:e.label},e.id+e.value))})}var b=n(46081),x=n(23771);let w={namespace:"hosts/filterPublicKey",label:"Hosts filter by public key"};function j(e){let{select:t,currentPage:n}=e,{openDialog:o}=(0,a.Rh)(),s=(0,x.K)("");return(0,r.jsx)(i.fu,{currentPage:n,commandPage:w,children:(0,r.jsx)(i.WD,{currentPage:n,commandPage:w,onSelect:()=>{t(),o("hostsFilterPublicKey")},children:s.label})})}function k(e){let{select:t,currentPage:n,parentPage:o,commandPage:s}=e,{openDialog:l}=(0,a.Rh)();return(0,r.jsx)(i.Ul,{currentPage:n,parentPage:o,commandPage:s,onSelect:()=>{t(),l("hostsFilterPublicKey")},children:w.label})}function E(e){let{currentPage:t,select:n}=e,{autopilot:i}=(0,b.q)();return(0,r.jsxs)(r.Fragment,{children:["on"===i.status&&(0,r.jsx)(y,{currentPage:t,select:n}),(0,r.jsx)(m,{currentPage:t,select:n}),(0,r.jsx)(l,{currentPage:t,select:n}),(0,r.jsx)(j,{currentPage:t,select:n}),(0,r.jsx)(f,{currentPage:t,select:n})]})}let S={namespace:"hosts",label:"Hosts"};function C(e){let{currentPage:t,parentPage:n,pushPage:a,select:o}=e,{autopilot:s}=(0,b.q)();return(0,r.jsxs)(r.Fragment,{children:["on"===s.status&&(0,r.jsx)(i.Ul,{currentPage:t,parentPage:n,commandPage:S,onSelect:()=>{a(v)},children:v.label}),(0,r.jsx)(k,{currentPage:t,parentPage:n,commandPage:S,select:o}),(0,r.jsx)(u,{currentPage:t,parentPage:n,commandPage:S,select:o}),(0,r.jsx)(i.Ul,{currentPage:t,parentPage:n,commandPage:S,onSelect:()=>{a(h)},children:h.label}),(0,r.jsx)(i.Ul,{currentPage:t,parentPage:n,commandPage:S,onSelect:()=>{a(c)},children:c.label})]})}var _=n(56328),O=n(2784);function M(e){let{currentPage:t,parentPage:n,pushPage:i,beforeSelect:a,afterSelect:o}=e,{setFilter:s}=(0,_.l)(),l=(0,O.useCallback)(e=>{a&&a(),e&&s(e),o&&o()},[s,a,o]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(C,{parentPage:n,currentPage:t,pushPage:i,select:l}),(0,r.jsx)(E,{currentPage:t,pushPage:i,select:l})]})}},10532:function(e,t,n){"use strict";n.d(t,{g:function(){return f},q:function(){return u}});var r=n(52322),i=n(36655),a=n(56328),o=n(7114),s=n(24511),l=n(97112);function u(e){return{id:"addressContains",value:e,label:"address contains ".concat(e)}}let c={address:""},d=s.Ry().shape({address:s.Z_().required("Required")});function f(e){let{trigger:t,open:n,onOpenChange:s}=e,{closeDialog:f}=(0,l.Rh)(),{setFilter:h}=(0,a.l)(),p=(0,o.TA)({initialValues:c,validationSchema:d,onSubmit:e=>{h(u(e.address)),p.resetForm(),f()}});return(0,r.jsx)(i.VqE,{trigger:t,title:"Filter by address",open:n,onOpenChange:e=>{e||p.resetForm(),s(e)},contentVariants:{className:"w-[400px]"},onSubmit:p.handleSubmit,children:(0,r.jsx)("div",{className:"flex flex-col gap-4",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(i.cB7,{formik:p,title:"Address",name:"address",placeholder:"Partial match against domain or IP",autoComplete:"off",type:"text",variants:{size:"medium"}}),(0,r.jsx)(i.IKw,{formik:p,size:"medium",children:"Filter"})]})})})}},23771:function(e,t,n){"use strict";n.d(t,{K:function(){return u},a:function(){return f}});var r=n(52322),i=n(36655),a=n(56328),o=n(7114),s=n(24511),l=n(97112);function u(e){return{id:"publicKeyEquals",value:e,label:"public key is ".concat((0,i.$Gg)(e,20))}}let c={publicKey:""},d=s.Ry().shape({publicKey:s.Z_().required("Required")});function f(e){let{trigger:t,open:n,onOpenChange:s}=e,{closeDialog:f}=(0,l.Rh)(),{setFilter:h}=(0,a.l)(),p=(0,o.TA)({initialValues:c,validationSchema:d,onSubmit:e=>{h(u(e.publicKey)),p.resetForm(),f()}});return(0,r.jsx)(i.VqE,{trigger:t,title:"Filter by public key",open:n,onOpenChange:e=>{e||p.resetForm(),s(e)},contentVariants:{className:"w-[400px]"},onSubmit:p.handleSubmit,children:(0,r.jsx)("div",{className:"flex flex-col gap-4",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(i.cB7,{formik:p,title:"Public key",name:"publicKey",placeholder:"ed25519:b050c0c6...",autoComplete:"off",type:"text",variants:{size:"medium"}}),(0,r.jsx)(i.IKw,{formik:p,size:"medium",children:"Filter"})]})})})}},26731:function(e,t,n){"use strict";n.d(t,{s:function(){return s}});var r=n(52322),i=n(36655),a=n(2784),o=n(34864);function s(e){let{loaded:t,size:n,status:s}=e,l=(0,a.useMemo)(()=>{var e;return void 0!==(e={loaded:t,size:n}).loaded?e.loaded/e.size:1},[t,n]);return(0,r.jsxs)("div",{className:"flex flex-col gap-1 w-full",children:[(0,r.jsx)(i.kod,{variant:"accent",value:t,max:n,className:1===l?"animate-pulse":""}),(0,r.jsxs)("div",{className:"flex gap-2 justify-between",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",children:(0,o.Z)(s)}),(0,r.jsxs)(i.xvT,{size:"12",color:"subtle",children:[(100*l).toFixed(0),"%"]})]})]})}},98334:function(e,t,n){"use strict";n.d(t,{_:function(){return i},h:function(){return a}});var r=n(57016);let i={home:"/",buckets:{index:"/buckets",files:"/buckets/[bucket]/files/[path]",uploads:"/buckets/[bucket]/uploads"},config:{index:"/config",storage:"/config#storage",pricing:"/config#pricing",hosts:"/config#hosts",wallet:"/config#wallet",contracts:"/config#contracts",uploads:"/config#uploads",redundancy:"/config#redundancy"},contracts:{index:"/contracts"},hosts:{index:"/hosts"},wallet:{view:"/wallet"},keys:{index:"/keys"},alerts:{index:"/alerts"},node:{index:"/node"},login:"/login"},a=r.HI},9338:function(e,t,n){"use strict";n.d(t,{h:function(){return r}});let r=(0,n(36655).XBW)(15)},87764:function(e,t,n){"use strict";n.d(t,{b:function(){return M},Z:function(){return O}});var r=n(52322),i=n(36655),a=n(5632),o=n(2784);let s=["actions","overview","data","time"],l=[];var u=n(57016),c=n(17448),d=n(41736),f=n(97112),h=n(70899),p=n(6391),m=n.n(p),v=n(61020);function g(e){let{hostKey:t,contentProps:n,buttonProps:a}=e,o=(0,u.$)({params:{hostKey:t}});return o.data?(0,r.jsx)(c.G,{address:o.data.netAddress,publicKey:o.data.publicKey,contentProps:n,buttonProps:a,trigger:(0,r.jsx)(i.zxk,{size:"none",icon:"hover",variant:"ghost",...a,children:(0,r.jsx)(v.EMN,{})})}):(0,r.jsx)(i.zxk,{size:"none",icon:"hover",variant:"ghost",state:"waiting",...a,children:(0,r.jsx)(v.EMN,{})})}var y=n(91492);function b(e){let{id:t,contentProps:n,buttonProps:a}=e,o=(0,u.cq)({params:{id:t}});return o.data?(0,r.jsx)(y.F,{id:t,address:o.data.hostIP,publicKey:o.data.hostKey,contentProps:n,buttonProps:a,trigger:(0,r.jsx)(i.zxk,{size:"none",icon:"hover",variant:"ghost",...a,children:(0,r.jsx)(v.EMN,{})})}):(0,r.jsx)(i.zxk,{size:"none",icon:"hover",variant:"ghost",state:"waiting",...a,children:(0,r.jsx)(v.EMN,{})})}var x=n(21487),w=n(32998);let j={origin:{render:function(e){let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",ellipsis:!0,children:"origin"}),(0,r.jsx)(i.xvT,{size:"12",color:"contrast",ellipsis:!0,children:t})]})}},contractID:{render:function(e){let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",ellipsis:!0,children:"contract ID"}),(0,r.jsx)(i.PF9,{size:"12",value:t,menu:(0,r.jsx)(b,{id:t,contentProps:{align:"end"},buttonProps:{size:"none"}})})]})}},accountID:{render:function(e){let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",ellipsis:!0,children:"account ID"}),(0,r.jsx)(i.XxW,{size:"12",value:t,label:"account ID"})]})}},hostKey:{render:function(e){let{value:t}=e,n=(0,u.$)({params:{hostKey:t}});return n.data?(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",ellipsis:!0,children:"host key"}),(0,r.jsx)(i.PF9,{size:"12",value:t,menu:(0,r.jsx)(c.G,{publicKey:n.data.publicKey,address:n.data.netAddress,contentProps:{align:"end"},buttonProps:{size:"none"}})})]}):null}},slabKey:{render:function(e){let{value:t}=e,{setActiveDirectory:n}=(0,d.b)(),{closeDialog:a}=(0,f.Rh)(),o=(0,u.og)({params:{key:t},config:{swr:{revalidateOnFocus:!1}}});return(0,r.jsxs)("div",{className:"flex flex-col gap-2 max-h-[100px]",children:[(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",ellipsis:!0,children:"key"}),(0,r.jsx)(i.XxW,{size:"12",value:t})]}),o.data&&(0,r.jsx)(i.xrM,{children:(0,r.jsx)("div",{className:"flex flex-col gap-2 mt-2 mb-2",children:o.data.map(e=>(0,r.jsx)(i.rUS,{color:"accent",underline:"hover",size:"12",noWrap:!0,onClick:()=>{n(()=>(0,h.gD)(e.name)),a()},children:e.name},e.name))})})]})}},added:{render:e=>{let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",ellipsis:!0,children:"added"}),(0,r.jsx)(i.xvT,{size:"12",color:"contrast",ellipsis:!0,children:t})]})}},removed:{render:e=>{let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",ellipsis:!0,children:"removed"}),(0,r.jsx)(i.xvT,{size:"12",color:"contrast",ellipsis:!0,children:t})]})}},setAdditions:{render:function(e){let{value:t}=e;return(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",ellipsis:!0,children:"contract set additions"}),t&&(0,r.jsx)("div",{className:"flex flex-col gap-3 mb-2",children:Object.entries(t).map((e,t)=>{let[n,{hostKey:i,additions:a}]=e;return(0,r.jsx)(k,{contractId:n,hostKey:i,changes:a,i:t},n)})})]})}},setRemovals:{render:function(e){let{value:t}=e;return(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",ellipsis:!0,children:"contract set removals"}),t&&(0,r.jsx)("div",{className:"flex flex-col gap-3 mb-2",children:Object.entries(t).map((e,t)=>{let[n,{hostKey:i,removals:a}]=e;return(0,r.jsx)(k,{contractId:n,hostKey:i,changes:a,i:t},n)})})]})}},migrationsInterrupted:{render:e=>{let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",ellipsis:!0,children:"migrations interrupted"}),(0,r.jsx)(i.xvT,{size:"12",weight:"medium",ellipsis:!0,children:t?"yes":"no"})]})}},allowance:{render:e=>{let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",ellipsis:!0,children:"allowance"}),(0,r.jsx)(i.YKL,{size:"12",variant:"value",value:new(m())(t)})]})}},balance:{render:e=>{let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",ellipsis:!0,children:"balance"}),(0,r.jsx)(i.YKL,{size:"12",variant:"value",value:new(m())(t)})]})}},address:{render:e=>{let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",ellipsis:!0,children:"address"}),(0,r.jsx)(i.XxW,{size:"12",value:t,type:"address"})]})}},account:{render:e=>{let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",ellipsis:!0,children:"account"}),(0,r.jsx)(i.XxW,{size:"12",value:t})]})}}};function k(e){let{contractId:t,hostKey:n,changes:a,i:o}=e;return(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsxs)("div",{className:"flex gap-2 justify-between",children:[(0,r.jsxs)(i.xvT,{size:"12",ellipsis:!0,children:[o+1,"."]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",ellipsis:!0,children:"contract"}),(0,r.jsx)(i.XxW,{size:"12",value:t,contextMenu:(0,r.jsx)(b,{id:t,contentProps:{align:"end"}})})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",ellipsis:!0,children:"host"}),(0,r.jsx)(i.XxW,{size:"12",value:n,label:"host key",contextMenu:(0,r.jsx)(g,{hostKey:n,contentProps:{align:"end"}})})]})]}),a.map(e=>{let{reasons:t,size:n,time:a}=e;return(0,r.jsxs)("div",{className:"flex gap-2 justify-between",children:[(0,r.jsx)(i.ua7,{content:t,children:(0,r.jsx)(i.xvT,{size:"12",ellipsis:!0,children:t})}),(0,r.jsx)("div",{className:"flex-1"}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",ellipsis:!0,children:"time"}),(0,r.jsx)(i.xvT,{size:"12",ellipsis:!0,children:(0,w.Z)(new Date,new Date(a))})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",ellipsis:!0,children:"size"}),(0,r.jsx)(i.xvT,{size:"12",ellipsis:!0,children:(0,x.vW)(n)})]})]},t+a)})]})}var E=n(98358);let S=[{id:"actions",label:"",fixed:!0,cellClassName:"w-[50px] !pr-4 [&+*]:!pl-0",render:e=>{let{data:{dismiss:t}}=e;return(0,r.jsx)(i.eQh,{children:(0,r.jsx)(i.zxk,{tip:"Dismiss alert",onClick:t,children:(0,r.jsx)(E.NlZ,{})})})}},{id:"overview",label:"overview",category:"general",contentClassName:"min-w-[200px] max-w-[500px]",render:e=>{let{data:{message:t,severity:n,data:a}}=e;return(0,r.jsxs)("div",{className:"flex flex-col gap-1 py-4",children:[(0,r.jsxs)("div",{className:"flex gap-1 items-center",children:[(0,r.jsx)(i.Cts,{variant:"error"===n||"critical"===n?"red":"warning"===n?"amber":"gray",size:"small",children:n}),(0,r.jsx)(i.xvT,{weight:"medium",noWrap:!0,children:t})]}),a.hint&&(0,r.jsx)(i.xvT,{size:"12",color:"subtle",children:a.hint}),a.error&&(0,r.jsx)(i.xvT,{size:"12",color:"subtle",children:a.error})]})}},{id:"data",label:"data",contentClassName:"w-[400px]",category:"general",render:function(e){let{data:{data:t}}=e,n=(0,o.useMemo)(()=>Object.keys(j).map(e=>{let n=t[e];return null!=n&&("object"!=typeof n||Object.keys(n).length)?{key:e,value:n}:null}).filter(Boolean),[t]);return(0,r.jsx)("div",{className:"py-4 w-full",children:(0,r.jsx)(i.s_4,{color:"subtle",className:"flex flex-col gap-1 w-full py-1",children:n.map((e,t)=>{var a;let{key:s,value:l}=e,u=null==j?void 0:null===(a=j[s])||void 0===a?void 0:a.render;return u?(0,r.jsxs)(o.Fragment,{children:[(0,r.jsx)("div",{className:"py-1 px-2",children:(0,r.jsx)(u,{value:l},s)}),n.length>1&&t{let{data:{timestamp:t}}=e;return(0,r.jsx)(i.xvT,{color:"subtle",size:"12",ellipsis:!0,children:(0,w.Z)(new Date,new Date(t))})}}];var C=n(9338);let _=(0,o.createContext)({}),O=()=>(0,o.useContext)(_);function M(e){let{children:t}=e,n=function(){var e;let t=(0,a.useRouter)(),n=Number(t.query.limit||50),r=Number(t.query.offset||0),{filters:c,setFilter:d,removeFilter:f,removeLastFilter:h,resetFilters:p}=(0,i.Uu5)(),m=(0,o.useCallback)(e=>{e?d({id:"severity",value:e,label:e}):f("severity")},[d,f]),v=null===(e=c.find(e=>"severity"===e.id))||void 0===e?void 0:e.value,g=(0,o.useMemo)(()=>{let e={limit:n,offset:r};return v&&(e.severity=v),e},[n,r,v]),y=(0,u.Z7)({params:g,config:{swr:{refreshInterval:C.h}}}),b=(0,u.Uy)(),x=(0,o.useCallback)(async e=>{(await b.post({payload:[e]})).error?(0,i.OHV)("Error dismissing alert."):(0,i.OPV)("Alert has been dismissed.")},[b]),w=(0,o.useCallback)(async e=>{(await b.post({payload:e})).error?(0,i.OHV)("Error dismissing alerts."):(0,i.OPV)("Selected alerts have been dismissed.")},[b]),j=(0,o.useMemo)(()=>{var e,t;return y.data?(null===(t=y.data)||void 0===t?void 0:null===(e=t.alerts)||void 0===e?void 0:e.map(e=>({id:e.id,severity:e.severity,message:e.message,timestamp:e.timestamp,data:e.data,dismiss:()=>x(e.id)})))||[]:null},[y.data,x]),{configurableColumns:k,enabledColumns:E,sortableColumns:_,toggleColumnVisibility:O,setColumnsVisible:M,setColumnsHidden:T,toggleSort:A,setSortDirection:P,setSortField:N,sortField:R,sortDirection:D,resetDefaultColumnVisibility:L}=(0,i.oy6)("renterd/v0/keys",{columns:S,columnsDefaultVisible:s,sortOptions:l,defaultSortField:""}),Z=(0,o.useMemo)(()=>S.filter(e=>e.fixed||E.includes(e.id)),[E]),F=(0,i.c2j)(j,y.isValidating,y.error,c),z=(0,o.useMemo)(()=>({}),[]),V=(0,o.useMemo)(()=>{var e,t;return{...null===(e=y.data)||void 0===e?void 0:e.totals,all:Object.entries((null===(t=y.data)||void 0===t?void 0:t.totals)||{}).reduce((e,t)=>{let[n,r]=t;return e+r},0)}},[y.data]);return{dataState:F,limit:n,offset:r,isLoading:y.isLoading,error:y.error,pageCount:(null==j?void 0:j.length)||0,totals:V,columns:Z,datasetPage:j,cellContext:z,configurableColumns:k,enabledColumns:E,sortableColumns:_,toggleColumnVisibility:O,setColumnsVisible:M,setColumnsHidden:T,toggleSort:A,setSortDirection:P,setSortField:N,sortField:R,filters:c,setFilter:d,removeFilter:f,removeLastFilter:h,resetFilters:p,sortDirection:D,resetDefaultColumnVisibility:L,dismissOne:x,dismissMany:w,severityFilter:v,setSeverityFilter:m}}();return(0,r.jsx)(_.Provider,{value:n,children:t})}},46081:function(e,t,n){"use strict";n.d(t,{w:function(){return u},q:function(){return l}});var r=n(52322),i=n(2784),a=n(36655),o=n(57016);let s=(0,i.createContext)({}),l=()=>(0,i.useContext)(s);function u(e){let{children:t}=e,n={autopilot:function(){let e=(0,o.YX)({config:{swr:{dedupingInterval:(0,a.XBW)(5),revalidateOnFocus:!1,refreshInterval:e=>e?(0,a.XBW)(60):(0,a.XBW)(1)}}}),[t,n]=(0,i.useState)("init");return(0,i.useEffect)(()=>{if(e.isLoading)n("init");else{if(e.isValidating)return;e.error?n("off"):e.data&&n("object"==typeof e.data?"on":"off")}},[e]),{status:t,state:e}}()};return(0,r.jsx)(s.Provider,{value:n,children:t})}},49889:function(e,t,n){"use strict";n.d(t,{iV:function(){return L},ZR:function(){return D}});var r=n(52322),i=n(2784),a=n(36655),o=n(21487),s=n(6391),l=n.n(s);let u={autopilotContractSet:"",amountHosts:void 0,allowanceMonth:void 0,periodWeeks:void 0,renewWindowWeeks:void 0,downloadTBMonth:void 0,uploadTBMonth:void 0,storageTB:void 0,prune:!1,allowRedundantIPs:!1,maxDowntimeHours:void 0,minRecentScanFailures:void 0},c={defaultContractSet:""},d={uploadPackingEnabled:!0},f={maxRpcPriceMillion:void 0,maxStoragePriceTBMonth:void 0,maxContractPrice:void 0,maxDownloadPriceTB:void 0,maxUploadPriceTB:void 0,minMaxCollateral:void 0,hostBlockHeightLeeway:void 0,minPriceTableValidityMinutes:void 0,minAccountExpiryDays:void 0,minMaxEphemeralAccountBalance:void 0,migrationSurchargeMultiplier:void 0},h={...u,...c,...d,...f,minShards:void 0,totalShards:void 0};function p(e){return{storageTB:void 0,downloadTBMonth:void 0,uploadTBMonth:void 0,allowanceMonth:void 0,..."Mainnet"===e?{periodWeeks:new(l())(6),renewWindowWeeks:new(l())(2),amountHosts:new(l())(50),autopilotContractSet:"autopilot",allowRedundantIPs:!1,maxDowntimeHours:new(l())(336),minRecentScanFailures:new(l())(10),prune:!0}:{periodWeeks:new(l())(6),renewWindowWeeks:new(l())(2),amountHosts:new(l())(12),autopilotContractSet:"autopilot",allowRedundantIPs:!1,maxDowntimeHours:new(l())(336),minRecentScanFailures:new(l())(10),prune:!0}}}let m={...c,defaultContractSet:"autopilot"},v={...d},g={...f},y=e=>Object.fromEntries(Object.entries(e).filter(e=>{let[t,n]=e;return void 0!==n&&""!==n}));function b(e,t){let n=e.defaultContractSet||(null==t?void 0:t.default)||m.defaultContractSet;return{...t,default:n}}function x(e){let{hasBeenConfigured:t,autopilot:n,contractSet:r,uploadPacking:i,gouging:s,redundancy:d,averages:f}=e;return{...function(e){if(!e)return u;let t=e.contracts.set,n=(0,o.ll)(j(new(l())(e.contracts.allowance),e.contracts.period),6),r=new(l())(e.contracts.amount),i=new(l())((0,o.x5)(e.contracts.period)),s=new(l())((0,o.x5)(e.contracts.renewWindow)),c=new(l())((0,a.y70)(j((0,o.JW)(e.contracts.download),e.contracts.period),2));return{autopilotContractSet:t,allowanceMonth:n,amountHosts:r,periodWeeks:i,renewWindowWeeks:s,downloadTBMonth:c,uploadTBMonth:new(l())((0,a.y70)(j((0,o.JW)(e.contracts.upload),e.contracts.period),2)),storageTB:(0,o.JW)(new(l())(e.contracts.storage)),prune:e.contracts.prune,allowRedundantIPs:e.hosts.allowRedundantIPs,maxDowntimeHours:new(l())(e.hosts.maxDowntimeHours),minRecentScanFailures:new(l())(e.hosts.minRecentScanFailures)}}(n),...r?{defaultContractSet:r.default}:c,uploadPackingEnabled:i.enabled,...function(e){let{gouging:t,averages:n,hasBeenConfigured:r}=e,i=function(e){let{gouging:t,averages:n,hasBeenConfigured:r}=e;return r||!n?t:{...t,maxStoragePrice:n.settings.storage_price,maxDownloadPrice:new(l())(n.settings.download_price).times((0,o.xf)(1)).toString(),maxUploadPrice:new(l())(n.settings.upload_price).times((0,o.xf)(1)).toString()}}({gouging:t,averages:n,hasBeenConfigured:r});return{maxStoragePriceTBMonth:(0,o.ll)(new(l())(i.maxStoragePrice).times((0,o.S5)(1)).times((0,o.xf)(1)),6),maxUploadPriceTB:(0,o.ll)(new(l())(i.maxUploadPrice),6),maxDownloadPriceTB:(0,o.ll)(i.maxDownloadPrice,6),maxContractPrice:(0,o.ll)(i.maxContractPrice,6),maxRpcPriceMillion:(0,o.ll)(i.maxRPCPrice,6).times(1e6),minMaxCollateral:(0,o.ll)(i.minMaxCollateral,6),hostBlockHeightLeeway:new(l())(i.hostBlockHeightLeeway),minPriceTableValidityMinutes:new(l())((0,a.AEA)(i.minPriceTableValidity)),minAccountExpiryDays:new(l())((0,a.okB)(i.minAccountExpiry)),minMaxEphemeralAccountBalance:(0,o.ll)(i.minMaxEphemeralAccountBalance,6),migrationSurchargeMultiplier:new(l())(i.migrationSurchargeMultiplier)}}({gouging:s,averages:f,hasBeenConfigured:t}),minShards:new(l())(d.minShards),totalShards:new(l())(d.totalShards)}}function w(e,t){let n=(0,o.mv)(t.toNumber());return e.times(n).div((0,o.S5)(1))}function j(e,t){return e.div(t).times((0,o.S5)(1))}var k=n(57016),E=n(92762),S=n(91332);function C(){let[e,t]=(0,E.Z)("v0/autopilot/syncDefaultContractSet",{defaultValue:!0}),n=(0,S.a)({config:{swr:{errorRetryCount:0}}}),o=(0,k.KJ)(),s=(0,i.useCallback)(async t=>{let i=n.data||{default:""};try{e&&t!==i.default&&(await o.put({params:{key:"contractset"},payload:b({defaultContractSet:t},n.data)}),n.mutate(),(0,a.OPV)((0,r.jsxs)(a.xvT,{children:["Default contract set has been updated to:"," ",(0,r.jsx)(a.EKh,{children:t}),"."]})))}catch(e){(0,a.OHV)(e.message),console.log(e)}},[n.data,o,e]);return{shouldSyncDefaultContractSet:e,setShouldSyncDefaultContractSet:t,syncDefaultContractSet:s}}var _=n(10363),O=n(91157),M=n(82494),T=n(46081),A=n(63955),P=n(315);function N(e){let{isAutopilotEnabled:t,advancedDefaults:n,showAdvanced:i,maxStoragePriceTBMonth:s,maxUploadPriceTB:u,minShards:c,totalShards:d,redundancyMultiplier:f,storageAverage:h,uploadAverage:p,downloadAverage:m,contractAverage:v}=e;return{storageTB:{type:"number",category:"storage",title:"Expected storage",description:(0,r.jsx)(r.Fragment,{children:"The amount of storage you would like to rent in TB."}),units:"TB",hidden:!t,validation:t?{required:"required"}:{}},uploadTBMonth:{type:"number",category:"storage",title:"Expected upload",description:(0,r.jsx)(r.Fragment,{children:"The amount of upload bandwidth you plan to use each month in TB."}),units:"TB/month",hidden:!t,validation:t?{required:"required"}:{}},downloadTBMonth:{type:"number",category:"storage",title:"Expected download",description:(0,r.jsx)(r.Fragment,{children:"The amount of download bandwidth you plan to use each month in TB."}),units:"TB/month",hidden:!t,validation:t?{required:"required"}:{}},allowanceMonth:{type:"siacoin",category:"storage",title:"Allowance",description:(0,r.jsx)(r.Fragment,{children:"The amount of Siacoin you would like to spend per month."}),units:"SC/month",decimalsLimitSc:6,hidden:!t||!i,validation:t&&i?{required:"required"}:{}},periodWeeks:{type:"number",category:"storage",title:"Period",description:(0,r.jsx)(r.Fragment,{children:"The length of the storage contracts."}),units:"weeks",suggestion:null==n?void 0:n.periodWeeks,suggestionTip:"Typically ".concat(null==n?void 0:n.periodWeeks," weeks."),hidden:!t||!i,validation:t&&i?{required:"required"}:{}},renewWindowWeeks:{type:"number",category:"storage",title:"Renew window",description:(0,r.jsx)(r.Fragment,{children:"The number of weeks prior to contract expiration that Sia will attempt to renew your contracts."}),units:"weeks",decimalsLimit:6,suggestion:null==n?void 0:n.renewWindowWeeks,suggestionTip:"Typically ".concat(null==n?void 0:n.renewWindowWeeks," weeks."),hidden:!t||!i,validation:t&&i?{required:"required"}:{}},amountHosts:{type:"number",category:"storage",title:"Hosts",description:(0,r.jsx)(r.Fragment,{children:"The number of hosts to create contracts with."}),units:"hosts",decimalsLimit:0,suggestion:null==n?void 0:n.amountHosts,suggestionTip:"Typically ".concat(null==n?void 0:n.amountHosts," hosts."),hidden:!t||!i,validation:t&&i?{required:"required"}:{}},autopilotContractSet:{type:"text",category:"storage",title:"Contract set",description:(0,r.jsx)(r.Fragment,{children:"The contract set that autopilot should use. This should typically be the same as the default contract set."}),placeholder:null==n?void 0:n.autopilotContractSet,suggestion:null==n?void 0:n.autopilotContractSet,suggestionTip:(0,r.jsxs)(r.Fragment,{children:["The default contract set is"," ",(0,r.jsx)(a.EKh,{children:null==n?void 0:n.autopilotContractSet}),"."]}),hidden:!t||!i,validation:t&&i?{required:"required"}:{}},prune:{type:"boolean",category:"storage",title:"Prune sector roots",description:(0,r.jsx)(r.Fragment,{children:"When enabled, autopilot will try to prune deleted sector roots from contracts one contract at a time, for a max duration of 10 minutes per contract. For old hosts this process takes quite a while, while for new hosts it is fast. For new hosts pruning effectively deletes data from the contract, allowing the renter to stop paying for storage they are not using."}),suggestion:null==n?void 0:n.prune,suggestionTip:(0,r.jsxs)(r.Fragment,{children:["The default value is ",(0,r.jsx)(a.EKh,{children:null==n?void 0:n.prune}),"."]}),hidden:!t||!i,validation:{}},allowRedundantIPs:{type:"boolean",category:"hosts",title:"Redundant IPs",description:(0,r.jsx)(r.Fragment,{children:"Whether or not to allow forming contracts with multiple hosts in the same IP subnet. The subnets used are /16 for IPv4, and /64 for IPv6."}),suggestion:null==n?void 0:n.allowRedundantIPs,suggestionTip:"Defaults to ".concat((null==n?void 0:n.allowRedundantIPs)?"on":"off","."),hidden:!t||!i,validation:{}},maxDowntimeHours:{type:"number",category:"hosts",title:"Max downtime",description:(0,r.jsx)(r.Fragment,{children:"The maximum amount of host downtime that autopilot will tolerate in hours."}),units:"hours",suggestion:null==n?void 0:n.maxDowntimeHours,suggestionTip:"Defaults to ".concat(null==n?void 0:n.maxDowntimeHours.toNumber().toLocaleString()," which is ").concat((0,a.y70)(new(l())((0,a.XAn)(null==n?void 0:n.maxDowntimeHours.toNumber())),1)," days."),hidden:!t||!i,validation:t&&i?{required:"required"}:{}},minRecentScanFailures:{type:"number",category:"hosts",title:"Min recent scan failures",description:(0,r.jsx)(r.Fragment,{children:"The minimum number of recent scan failures that autopilot will tolerate."}),units:"scans",decimalsLimit:0,suggestion:null==n?void 0:n.minRecentScanFailures,suggestionTip:"Defaults to ".concat(null==n?void 0:n.minRecentScanFailures.toNumber(),"."),hidden:!t||!i,validation:t&&i?{required:"required"}:{}},defaultContractSet:{category:"contractset",type:"text",title:"Default contract set",placeholder:null==n?void 0:n.defaultContractSet,suggestion:null==n?void 0:n.defaultContractSet,suggestionTip:(0,r.jsx)(r.Fragment,{children:"Autopilot users will typically want to keep this the same as the autopilot contract set."}),description:(0,r.jsx)(r.Fragment,{children:"The default contract set is where data is uploaded to by default."}),hidden:!i,validation:i?{required:"required"}:{}},uploadPackingEnabled:{category:"uploadpacking",type:"boolean",title:"Upload packing",description:(0,r.jsx)(r.Fragment,{children:"Data on the Sia network is stored in 4MiB sectors. With the default 10 of 30 redundancy scheme, uploaded files are split into 40MiB chunks and encoded into 120MiB slabs. This means that storage is wasted on padding and files smaller than 40MiB still use 120MiB of space. The redundancy scheme can be configured, but unless all files are exactly 4MiB * the redundancy's minimum shards, there will always be wasted storage. Upload packing avoids this waste by buffering files and packing them together before they are uploaded to the network. This trades some performance for storage efficiency. It is also important to note that because buffered files are temporarily stored on disk they must be considered when backing up your renterd data."}),hidden:!i,validation:{}},maxStoragePriceTBMonth:{category:"gouging",type:"siacoin",title:"Max storage price",description:(0,r.jsx)(r.Fragment,{children:"The max allowed price a host is allowed to charge to store 1 TB worth of data per month."}),units:"SC/TB/month",average:h,averageTip:"Averages provided by Sia Central.",after:function(){return s&&c&&d?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.Z0O,{}),(0,r.jsx)(a.ua7,{align:"start",side:"bottom",content:(0,r.jsxs)(r.Fragment,{children:["Price per TB/month when factoring in the configured"," ",c," of ",d," redundancy."]}),children:(0,r.jsxs)("div",{className:"flex gap-1 items-center relative overflow-hidden",children:[(0,r.jsx)(a.xvT,{className:"flex relative",children:(0,r.jsx)(P.RdX,{})}),(0,r.jsxs)(a.xvT,{size:"12",ellipsis:!0,children:[(0,o.Vz)((0,o.qN)(s).times(f),{fixed:0,dynamicUnits:!1}),"/TB/month with redundancy"]})]})})]}):null},decimalsLimitSc:6,validation:{required:"required"}},maxUploadPriceTB:{category:"gouging",type:"siacoin",title:"Max upload price",description:(0,r.jsx)(r.Fragment,{children:"The max allowed price a host is allowed to charge for uploading 1 TB worth of data."}),units:"SC/TB",average:p,averageTip:"Averages provided by Sia Central.",after:function(){return u&&c&&d?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.Z0O,{}),(0,r.jsx)(a.ua7,{align:"start",side:"bottom",content:(0,r.jsxs)(r.Fragment,{children:["Price per TB when factoring in the configured ",c," of"," ",d," redundancy."]}),children:(0,r.jsxs)("div",{className:"flex gap-1 items-center relative overflow-hidden",children:[(0,r.jsx)(a.xvT,{className:"flex relative",children:(0,r.jsx)(P.RdX,{})}),(0,r.jsxs)(a.xvT,{size:"12",ellipsis:!0,children:[(0,o.Vz)((0,o.qN)(u).times(f),{fixed:0,dynamicUnits:!1}),"/TB with redundancy"]})]})})]}):null},decimalsLimitSc:6,validation:{required:"required"}},maxDownloadPriceTB:{category:"gouging",type:"siacoin",title:"Max download price",description:(0,r.jsx)(r.Fragment,{children:"The max allowed price to download 1 TB."}),units:"SC/TB",average:m,averageTip:"Averages provided by Sia Central.",decimalsLimitSc:6,validation:{required:"required"}},maxContractPrice:{category:"gouging",type:"siacoin",title:"Max contract price",description:(0,r.jsx)(r.Fragment,{children:"The max allowed price to form a contract."}),average:v,decimalsLimitSc:6,tipsDecimalsLimitSc:3,hidden:!i,validation:i?{required:"required"}:{}},maxRpcPriceMillion:{category:"gouging",type:"siacoin",title:"Max RPC price",description:(0,r.jsx)(r.Fragment,{children:"The max allowed base price for RPCs in siacoins per million calls."}),units:"SC/million",decimalsLimitSc:6,hidden:!i,validation:i?{required:"required"}:{}},minMaxCollateral:{category:"gouging",type:"siacoin",title:"Min max collateral",description:(0,r.jsx)(r.Fragment,{children:"The min value for max collateral in the host's price settings."}),decimalsLimitSc:6,hidden:!i,validation:i?{required:"required"}:{}},hostBlockHeightLeeway:{category:"gouging",type:"number",title:"Block height leeway",description:(0,r.jsx)(r.Fragment,{children:"The amount of blocks of leeway given to the host block height in the host's price table."}),units:"blocks",decimalsLimit:0,suggestion:null==n?void 0:n.hostBlockHeightLeeway,suggestionTip:"The recommended value is 6 blocks.",hidden:!i,validation:i?{required:"required",validate:{min:e=>new(l())(e).gte(3)||"must be at least 3 blocks"}}:{}},minPriceTableValidityMinutes:{category:"gouging",type:"number",title:"Min price table validity",units:"minutes",description:(0,r.jsx)(r.Fragment,{children:"The min accepted value for `Validity` in the host's price settings."}),hidden:!i,validation:i?{required:"required",validate:{min:e=>new(l())(e).gte((0,a.GXN)(10))||"must be at least 10 seconds"}}:{}},minAccountExpiryDays:{category:"gouging",type:"number",title:"Min account expiry",units:"days",description:(0,r.jsx)(r.Fragment,{children:"The min accepted value for `AccountExpiry` in the host's price settings."}),hidden:!i,validation:i?{required:"required",validate:{min:e=>new(l())(e).gte((0,a.XAn)(1))||"must be at least 1 hour"}}:{}},minMaxEphemeralAccountBalance:{category:"gouging",type:"siacoin",title:"Min max ephemeral account balance",description:(0,r.jsx)(r.Fragment,{children:"The min accepted value for `MaxEphemeralAccountBalance` in the host's price settings."}),decimalsLimitSc:6,hidden:!i,validation:i?{required:"required",validate:{min:e=>new(l())(e).gte(1)||"must be at least 1 SC"}}:{}},migrationSurchargeMultiplier:{category:"gouging",type:"number",title:"Migration surcharge multiplier",units:"* download price",placeholder:"10",decimalsLimit:1,description:(0,r.jsx)(r.Fragment,{children:"Factor that gets applied on the max download price when trying to download migration-critical sectors from a host that is price gouging. For example, when migrating a low-health file, if the download is failing but would potentially succeed with looser gouging settings, we apply the migration surcharge multiplier to overpay on every sector download if it means saving the file/migration."}),suggestion:new(l())(10),suggestionTip:"The default multiplier is 10x the download price.",hidden:!i,validation:i?{required:"required"}:{}},minShards:{type:"number",category:"redundancy",title:"Min shards",description:(0,r.jsx)(r.Fragment,{children:"The min amount of shards needed to reconstruct a slab."}),suggestion:null==n?void 0:n.minShards,suggestionTip:"Typically ".concat(null==n?void 0:n.minShards," shards."),units:"shards",hidden:!i,validation:i?{required:"required",validate:{min:e=>new(l())(e).gt(0)||"must be greater than 0"}}:{},trigger:["totalShards"]},totalShards:{type:"number",category:"redundancy",title:"Total shards",description:(0,r.jsx)(r.Fragment,{children:"The total amount of shards for each slab."}),suggestion:null==n?void 0:n.totalShards,suggestionTip:"Typically ".concat(null==n?void 0:n.totalShards," shards."),units:"shards",hidden:!i,validation:i?{required:"required",validate:{gteMinShards:(e,t)=>new(l())(e).gte(t.minShards)||"must be at least equal to min shards",max:e=>new(l())(e).lt(256)||"must be less than 256"}}:{}}}}let R=(0,i.createContext)({}),D=()=>(0,i.useContext)(R);function L(e){let{children:t}=e,n=function(){let{autopilotState:e,autopilot:t,contractSet:n,gouging:r,redundancy:s,uploadPacking:u,averages:c,shouldSyncDefaultContractSet:d,setShouldSyncDefaultContractSet:f,appSettings:j,isAutopilotEnabled:P}=function(){var e,t;let n=(0,T.q)(),r="on"===n.autopilot.status,i=(0,k.e$)({config:{swr:{errorRetryCount:0,refreshInterval:(0,a.sWj)(1)}}}),o=(0,S.a)({config:{swr:{errorRetryCount:0,refreshInterval:(0,a.sWj)(1)}}}),s=(e={config:{swr:{refreshInterval:(0,a.sWj)(1)}}},(0,k.yu)({...e,params:{key:"gouging"}})),l=(0,O.w)({config:{swr:{refreshInterval:(0,a.sWj)(1)}}}),u=(t={config:{swr:{refreshInterval:(0,a.sWj)(1)}}},(0,k.yu)({...t,params:{key:"uploadpacking"}})),c=(0,M.BF)({config:{swr:{revalidateOnFocus:!1}}}),{shouldSyncDefaultContractSet:d,setShouldSyncDefaultContractSet:f,syncDefaultContractSet:h}=C(),p=(0,_.Hv)();return{autopilotState:n.autopilot.state,autopilot:i,contractSet:o,gouging:s,redundancy:l,uploadPacking:u,averages:c,shouldSyncDefaultContractSet:d,setShouldSyncDefaultContractSet:f,syncDefaultContractSet:h,appSettings:p,isAutopilotEnabled:r}}(),{form:R,maxStoragePriceTBMonth:D,maxDownloadPriceTB:L,maxUploadPriceTB:Z,storageTB:F,downloadTBMonth:z,uploadTBMonth:V,redundancyMultiplier:I,fields:B,showAdvanced:H,setShowAdvanced:U}=function(){let e=(0,A.cI)({mode:"all",defaultValues:h}),t=e.watch("maxStoragePriceTBMonth"),n=e.watch("maxDownloadPriceTB"),r=e.watch("maxUploadPriceTB"),a=e.watch("storageTB"),s=e.watch("downloadTBMonth"),u=e.watch("uploadTBMonth"),c=e.watch("minShards"),d=e.watch("totalShards"),f=(0,i.useMemo)(()=>{let e;return e=new(l())(1),c&&d&&!c.isZero()&&!d.isZero()&&d.gte(c)&&(e=d.div(c)),e},[c,d]),{averages:y,storageAverage:b,uploadAverage:x,downloadAverage:w,contractAverage:j}=function(){let e=(0,M.BF)({config:{swr:{revalidateOnFocus:!1}}}),t=(0,i.useMemo)(()=>e.data?new(l())((0,o.ll)(e.data.settings.storage_price).times((0,o.S5)(1)).times((0,o.xf)(1)).toFixed(0)):void 0,[e.data]),n=(0,i.useMemo)(()=>e.data?new(l())((0,o.ll)(e.data.settings.upload_price).times((0,o.xf)(1)).toFixed(0)):void 0,[e.data]),r=(0,i.useMemo)(()=>e.data?new(l())((0,o.ll)(e.data.settings.download_price).times((0,o.xf)(1)).toFixed(0)):void 0,[e.data]),a=(0,i.useMemo)(()=>e.data?new(l())((0,o.ll)(e.data.settings.contract_price).toFixed(0)):void 0,[e.data]);return{averages:e,storageAverage:t,uploadAverage:n,downloadAverage:r,contractAverage:a}}(),S="on"===(0,T.q)().autopilot.status,[C,_]=(0,E.Z)("v0/config/showAdvanced",{defaultValue:!1}),O=(0,k.d_)();return{form:e,fields:(0,i.useMemo)(()=>{var e;let n=O.data?{...p(e=O.data.network),...m,...v,...g,..."Mainnet"===e?{minShards:new(l())(10),totalShards:new(l())(30)}:{minShards:new(l())(2),totalShards:new(l())(6)}}:void 0;return y.data?N({advancedDefaults:n,isAutopilotEnabled:S,showAdvanced:C,maxStoragePriceTBMonth:t,maxUploadPriceTB:r,redundancyMultiplier:f,storageAverage:b,uploadAverage:x,downloadAverage:w,contractAverage:j,minShards:c,totalShards:d}):N({advancedDefaults:n,isAutopilotEnabled:S,showAdvanced:C,maxStoragePriceTBMonth:t,maxUploadPriceTB:r,redundancyMultiplier:f,minShards:c,totalShards:d})},[O.data,S,C,y.data,b,x,w,j,f,t,r,c,d]),maxStoragePriceTBMonth:t,maxDownloadPriceTB:n,maxUploadPriceTB:r,storageTB:a,downloadTBMonth:s,uploadTBMonth:u,minShards:c,totalShards:d,redundancyMultiplier:f,showAdvanced:C,setShowAdvanced:_}}(),W=(0,i.useMemo)(()=>({autopilotState:{data:e.data,error:e.error},autopilot:{data:t.data,error:t.error},contractSet:{data:n.data,error:n.error},uploadPacking:{data:u.data,error:u.error},gouging:{data:r.data,error:r.error},redundancy:{data:s.data,error:s.error},averages:{data:c.data,error:c.error},appSettings:{settings:{siaCentral:j.settings.siaCentral}}}),[e.data,e.error,t.data,t.error,n.data,n.error,u.data,u.error,r.data,r.error,s.data,s.error,c.data,c.error,j.settings.siaCentral]),q=(0,i.useMemo)(()=>{var e;return!function(e){let{autopilotState:t,autopilot:n,contractSet:r,uploadPacking:i,gouging:a,redundancy:o,averages:s,appSettings:l}=e;return!!(t.data&&o.data&&i.data&&a.data&&(n.data||n.error)&&(r.data||r.error)&&(!l.settings.siaCentral||s.data))}(W)?null:x({hasBeenConfigured:null===(e=W.autopilotState.data)||void 0===e?void 0:e.configured,autopilot:W.autopilot.data,contractSet:W.contractSet.data,uploadPacking:W.uploadPacking.data,gouging:W.gouging.data,averages:W.averages.data,redundancy:W.redundancy.data})},[W]),$=(0,i.useMemo)(()=>(function(e){let{uploadPacking:t,gouging:n,redundancy:r}=e;return!!(r.error||t.error||n.error)})(W),[W]),K=(0,i.useCallback)(async()=>{let i=await e.mutate(),o=P?await t.mutate():void 0,l=await n.mutate(),d=await r.mutate(),f=await s.mutate(),h=await u.mutate();if(!r||!s)return(0,a.OHV)("Error fetching settings."),null;R.reset(x({hasBeenConfigured:i.configured,autopilot:o,contractSet:l,uploadPacking:h,gouging:d,averages:c.data,redundancy:f}))},[R,e,P,t,n,r,u,s,c.data]);(0,a.u$d)({form:R,remoteValues:q}),(0,a.Z4p)({form:R,remoteValues:q});let{changeCount:Y}=(0,a.mYE)({form:R}),{canEstimate:X,estimatedSpendingPerMonth:G,estimatedSpendingPerTB:Q}=function(e){let{isAutopilotEnabled:t,redundancyMultiplier:n,maxStoragePriceTBMonth:r,storageTB:a,maxDownloadPriceTB:o,downloadTBMonth:s,maxUploadPriceTB:u,uploadTBMonth:c}=e,d=(0,i.useMemo)(()=>!!t&&(null==r?void 0:r.gt(0))&&(null==a?void 0:a.gt(0))&&(null==o?void 0:o.gt(0))&&(null==u?void 0:u.gt(0)),[t,r,a,o,u]),f=(0,i.useMemo)(()=>{if(!d)return new(l())(0);let e=(null==a?void 0:a.gt(0))?a:new(l())(0),t=(null==s?void 0:s.gt(0))?s:new(l())(0),i=(null==c?void 0:c.gt(0))?c:new(l())(0),f=(null==r?void 0:r.gt(0))?r:new(l())(0),h=(null==u?void 0:u.gt(0))?u:new(l())(0),p=(null==o?void 0:o.gt(0))?o:new(l())(0),m=f.times(n).times(e),v=p.times(t),g=h.times(n).times(i);return m.plus(v).plus(g)},[d,n,r,a,o,s,u,c]),h=(0,i.useMemo)(()=>d?f.div(a):new(l())(0),[d,f,a]);return{canEstimate:d,estimatedSpendingPerMonth:f,estimatedSpendingPerTB:h}}({isAutopilotEnabled:P,redundancyMultiplier:I,maxStoragePriceTBMonth:D,storageTB:F,maxDownloadPriceTB:L,downloadTBMonth:z,maxUploadPriceTB:Z,uploadTBMonth:V}),J=function(e){let{resources:t,estimatedSpendingPerMonth:n,isAutopilotEnabled:r,showAdvanced:s,revalidateAndResetForm:l}=e,u=(0,k.Bl)(),c=(0,k.oe)(),d=(0,k.KJ)(),f=(0,k.d_)(),{syncDefaultContractSet:h}=C(),m=(0,_.Tu)();return(0,i.useCallback)(async e=>{if(t.gouging.data&&t.redundancy.data&&f.data)try{let i={};r&&!s&&(i.allowanceMonth=n);let v={...e,...i},g=r&&!t.autopilot.data,x=r?await c.put({payload:function(e,t,n){let r={...p(e),...y(t)};return{...n,contracts:{...null==n?void 0:n.contracts,set:r.autopilotContractSet,amount:Math.round(r.amountHosts.toNumber()),allowance:(0,o.qN)(w(r.allowanceMonth,r.periodWeeks)).toString(),period:Math.round((0,o.mv)(r.periodWeeks.toNumber())),renewWindow:Math.round((0,o.mv)(r.renewWindowWeeks.toNumber())),download:Number(w((0,o.xf)(r.downloadTBMonth),r.periodWeeks).toFixed(0)),upload:Number(w((0,o.xf)(r.uploadTBMonth),r.periodWeeks).toFixed(0)),storage:(0,o.xf)(r.storageTB).toNumber(),prune:r.prune},hosts:{...null==n?void 0:n.hosts,maxDowntimeHours:r.maxDowntimeHours.toNumber(),minRecentScanFailures:r.minRecentScanFailures.toNumber(),allowRedundantIPs:r.allowRedundantIPs,scoreOverrides:(null==n?void 0:n.hosts.scoreOverrides)||null}}}(f.data.network,v,t.autopilot.data)}):void 0,[j,E,S,C]=await Promise.all([d.put({params:{key:"contractset"},payload:b(v,t.contractSet.data)}),d.put({params:{key:"uploadpacking"},payload:{...t.uploadPacking.data,enabled:v.uploadPackingEnabled}}),d.put({params:{key:"gouging"},payload:{...t.gouging.data,maxRPCPrice:(0,o.qN)(v.maxRpcPriceMillion.div(1e6)).toString(),maxStoragePrice:(0,o.qN)(v.maxStoragePriceTBMonth.div((0,o.S5)(1)).div((0,o.xf)(1))).toString(),maxUploadPrice:(0,o.qN)(v.maxUploadPriceTB).toString(),maxDownloadPrice:(0,o.qN)(v.maxDownloadPriceTB).toString(),maxContractPrice:(0,o.qN)(v.maxContractPrice).toString(),minMaxCollateral:(0,o.qN)(v.minMaxCollateral).toString(),hostBlockHeightLeeway:Math.round(v.hostBlockHeightLeeway.toNumber()),minPriceTableValidity:Math.round((0,a.ort)(v.minPriceTableValidityMinutes.toNumber())),minAccountExpiry:Math.round((0,a.k9c)(v.minAccountExpiryDays.toNumber())),minMaxEphemeralAccountBalance:(0,o.qN)(v.minMaxEphemeralAccountBalance).toString(),migrationSurchargeMultiplier:v.migrationSurchargeMultiplier.toNumber()}}),d.put({params:{key:"redundancy"},payload:{...t.redundancy.data,minShards:v.minShards.toNumber(),totalShards:v.totalShards.toNumber()}})]);if(null==x?void 0:x.error)throw Error(x.error);if(j.error)throw Error(j.error);if(E.error)throw Error(E.error);if(S.error)throw Error(S.error);if(C.error)throw Error(C.error);r&&(h(v.autopilotContractSet),u.post({payload:{forceScan:!0}})),(0,a.OPV)("Configuration has been saved."),g&&(async()=>{await (0,_.gw)(5e3),m(e=>e.startsWith(k.pz)),await (0,_.gw)(5e3),m(e=>e.startsWith(k.pz))})(),await l()}catch(e){(0,a.OHV)(e.message),console.log(e)}},[f.data,n,s,r,c,l,h,m,d,t,u])}({resources:W,estimatedSpendingPerMonth:G,showAdvanced:H,isAutopilotEnabled:P,revalidateAndResetForm:K}),ee=(0,a.WsO)(B),et=(0,i.useMemo)(()=>R.handleSubmit(J,ee),[R,J,ee]),en=(0,i.useRef)(),er=(0,i.useCallback)(async e=>{(0,a.S5N)(en.current,e)},[]);return{onSubmit:et,revalidateAndResetForm:K,form:R,fields:B,changeCount:Y,canEstimate:X,estimatedSpendingPerMonth:G,estimatedSpendingPerTB:Q,redundancyMultiplier:I,storageTB:F,shouldSyncDefaultContractSet:d,setShouldSyncDefaultContractSet:f,showAdvanced:H,setShowAdvanced:U,remoteError:$,configRef:en,takeScreenshot:er}}();return(0,r.jsx)(R.Provider,{value:n,children:t})}},76838:function(e,t,n){"use strict";n.d(t,{x:function(){return S},G:function(){return E}});var r=n(52322),i=n(36655),a=n(5632),o=n(57016),s=n(2784),l=n(6391),u=n.n(l),c=n(75262),d=n(61020),f=n(21487),h=n(91492),p=n(82851);let m=[{id:"actions",label:"",fixed:!0,cellClassName:"w-[50px] !pl-2 !pr-4 [&+*]:!pl-0",render:e=>{let{data:{id:t,hostIp:n,hostKey:i}}=e;return(0,r.jsx)(h.F,{id:t,address:n,publicKey:i})}},{id:"contractId",label:"contract ID",category:"general",render:e=>{let{data:{id:t,isRenewed:n,renewedFrom:a},context:{siascanUrl:o}}=e;return(0,r.jsxs)("div",{className:"flex flex-col gap-1 w-full",children:[(0,r.jsx)(i.XxW,{size:"12",value:(0,i.I13)(t),type:"contract",label:"contract ID",siascanUrl:o}),n&&(0,r.jsx)(i.ua7,{content:"Renewed from",align:"start",children:(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(i.xvT,{color:"subtle",children:(0,r.jsx)(d.L6f,{className:"scale-75"})}),(0,r.jsx)(i.XxW,{color:"subtle",size:"10",type:"contract",value:(0,i.I13)(a),siascanUrl:o,label:"contract ID"})]})})]})}},{id:"contractSets",label:"contract sets",contentClassName:"w-[120px]",category:"general",render:e=>{let{data:{contractSets:t},context:{defaultSet:n}}=e;return t?(0,r.jsx)("div",{className:"flex flex-col items-center overflow-hidden h-full",children:(0,r.jsx)(i.xrM,{children:(0,r.jsx)("div",{className:"flex min-h-full gap-1 flex-wrap py-2 items-center",children:t.map(e=>{let t=n===e;return(0,r.jsx)(i.ua7,{content:"Contract is part of set ".concat(e,".")+(t?" ".concat(e," is the default contract set."):""),children:(0,r.jsxs)(i.Cts,{interactive:!1,size:"small",className:(0,p.cx)("flex gap-px items-center",t?"pl-px":""),children:[t?(0,r.jsx)(d.Y3p,{className:"scale-75"}):null,e]})},e)})})})}):null}},{id:"hostIp",label:"host address",category:"general",render:e=>{let{data:{hostIp:t},context:{siascanUrl:n}}=e;return(0,r.jsx)(i.XxW,{size:"12",value:t,type:"hostIp",siascanUrl:n})}},{id:"hostKey",label:"host public key",category:"general",render:e=>{let{data:{hostKey:t},context:{siascanUrl:n}}=e;return(0,r.jsx)(i.XxW,{size:"12",value:t,type:"hostPublicKey",siascanUrl:n})}},{id:"state",label:"state",category:"general",render:e=>{let{data:{state:t}}=e;return(0,r.jsx)(i.ua7,{content:(0,r.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,r.jsxs)("div",{className:"flex",children:[(0,r.jsx)(i.xvT,{className:"flex-1",weight:"medium",children:"pending"}),(0,r.jsx)(i.xvT,{className:"flex-[2]",color:"subtle",children:"Contract has been added."})]}),(0,r.jsx)(i.Z0O,{className:"w-full"}),(0,r.jsxs)("div",{className:"flex",children:[(0,r.jsx)(i.xvT,{className:"flex-1",weight:"medium",children:"active"}),(0,r.jsx)(i.xvT,{className:"flex-[2]",color:"subtle",children:"Contract has appeared on chain."})]}),(0,r.jsx)(i.Z0O,{className:"w-full"}),(0,r.jsxs)("div",{className:"flex",children:[(0,r.jsx)(i.xvT,{className:"flex-1",weight:"medium",children:"complete"}),(0,r.jsx)(i.xvT,{className:"flex-[2]",color:"subtle",children:"Storage proof has appeared on chain."})]}),(0,r.jsx)(i.Z0O,{className:"w-full"}),(0,r.jsxs)("div",{className:"flex",children:[(0,r.jsx)(i.xvT,{className:"flex-1",weight:"medium",children:"failed"}),(0,r.jsx)(i.xvT,{className:"flex-[2]",color:"subtle",children:"Storage proof was not submitted before the end of proof window."})]})]}),children:(0,r.jsx)(i.Cts,{variant:"active"===t?"amber":"failed"===t?"red":"pending"===t?"amber":"complete"===t?"green":void 0,children:t})})}},{id:"timeline",label:"timeline",category:"time",render:e=>{let{data:{contractHeightStart:t,contractHeightEnd:n,proofWindowHeightStart:a,proofWindowHeightEnd:o,revisionHeight:s,proofHeight:l},context:{currentHeight:u,contractsTimeRange:c}}=e;return(0,r.jsx)("div",{className:"w-[400px]",children:(0,r.jsx)(i.TaT,{currentHeight:u,contractHeightStart:t,contractHeightEnd:n,proofWindowHeightStart:a,proofWindowHeightEnd:o,proofHeight:l,revisionHeight:s,range:c})})}},{id:"startTime",label:"start date",category:"time",contentClassName:"w-[120px] justify-end",render:e=>{let{data:{startTime:t}}=e;return(0,r.jsx)(i.xvT,{size:"12",font:"mono",ellipsis:!0,children:(0,f.rN)(t)})}},{id:"endTime",label:"end date",category:"time",contentClassName:"w-[120px] justify-end",render:e=>{let{data:{endTime:t}}=e;return(0,r.jsx)(i.xvT,{size:"12",font:"mono",ellipsis:!0,children:(0,f.rN)(t)})}},{id:"size",label:"size",category:"general",contentClassName:"w-[120px] justify-end",render:e=>{let{data:{size:t}}=e;return(0,r.jsx)(i.m2c,{size:"12",value:t,variant:"value",format:e=>(0,f.vW)(e)})}},{id:"totalCost",label:"total cost",category:"financial",contentClassName:"w-[120px] justify-end",render:e=>{let{data:{totalCost:t}}=e;return(0,r.jsx)(i.ho9,{displayBoth:!0,size:"12",value:t.negated()})}},{id:"spendingUploads",label:"uploads spending",category:"financial",contentClassName:"w-[120px] justify-end",render:e=>{let{data:{spendingUploads:t}}=e;return(0,r.jsx)(i.ho9,{displayBoth:!0,size:"12",value:t.negated()})}},{id:"spendingDownloads",label:"downloads spending",category:"financial",contentClassName:"w-[120px] justify-end",render:e=>{let{data:{spendingDownloads:t}}=e;return(0,r.jsx)(i.ho9,{displayBoth:!0,size:"12",value:t.negated()})}},{id:"spendingFundAccount",label:"fund account spending",category:"financial",contentClassName:"w-[120px] justify-end",render:e=>{let{data:{spendingFundAccount:t}}=e;return(0,r.jsx)(i.ho9,{displayBoth:!0,size:"12",value:t.negated()})}}];var v=n(82494),g=n(38855),y=n(45178);function b(e){let t=(0,i.sWj)(5);return Math.round(e/t)*t}function x(e){let{start:t,disabled:n,contractId:a}=e,l=b(t),c=(0,i.NrH)(1),d=(0,s.useMemo)(()=>Math.max(Math.round((b(new Date().getTime())-l)/c),1),[l,c]),h=(0,s.useMemo)(()=>{let e={start:new Date(l||0).toISOString(),interval:c,n:d};return a&&(e.contractID=a),e},[l,c,d,a]),p=(0,o.Yy)({disabled:n,params:h});return{contractMetrics:(0,s.useMemo)(()=>{var e;let t=(0,i.Y_Z)(null===(e=p.data)||void 0===e?void 0:e.map(e=>({uploadSpending:Number(e.uploadSpending),listSpending:Number(e.listSpending),deleteSpending:Number(e.deleteSpending),fundAccountSpending:Number(e.fundAccountSpending),remainingCollateral:Number(e.remainingCollateral),remainingFunds:Number(e.remainingFunds),timestamp:new Date(e.timestamp).getTime()})),"none"),n=(0,i.fVJ)(t);return{data:t,stats:n,config:{enabledGraph:["remainingFunds","remainingCollateral","fundAccountSpending","uploadSpending","listSpending","deleteSpending"],enabledTip:["remainingFunds","remainingCollateral","fundAccountSpending","uploadSpending","listSpending","deleteSpending"],categories:["funding","spending"],data:{remainingFunds:{label:"remaining funds",category:"funding",color:i.O9T.emerald[600]},remainingCollateral:{label:"remaining collateral",category:"funding",pattern:!0,color:i.O9T.emerald[600]},fundAccountSpending:{label:"fund account",category:"spending",color:i.O9T.red[600]},uploadSpending:{label:"upload",category:"spending",color:i.O9T.red[600]},listSpending:{label:"list",category:"spending",color:i.O9T.red[600]},deleteSpending:{label:"delete",category:"spending",color:i.O9T.red[600]}},formatComponent:function(e){let{value:t}=e;return(0,r.jsx)(i.ho9,{variant:"value",value:new(u())(t)})},formatTimestamp:c===(0,i.NrH)(1)?(0,i.kOJ)("daily"):void 0,formatTickY:e=>(0,f.Vz)(e,{fixed:0,dynamicUnits:!0}),disableAnimations:!0,chartType:"barstack",curveType:"linear",stackOffset:"none"},isLoading:p.isValidating&&!p.data}},[p.data,p.isValidating,c])}}var w=n(91332),j=n(9338);let k=(0,s.createContext)({}),E=()=>(0,s.useContext)(k);function S(e){let{children:t}=e,n=function(){let[e,t]=(0,s.useState)("list"),[n,r]=(0,s.useState)("spending"),l=(0,a.useRouter)(),d=Number(l.query.limit||50),h=Number(l.query.offset||0),p=(0,o.GP)({config:{swr:{refreshInterval:j.h}}}),k=(0,v.JL)(),E=(0,s.useMemo)(()=>{var e;return(null===(e=k.data)||void 0===e?void 0:e.hosts)||[]},[k.data]),S=(0,g.n)(),C=S.isSynced?S.nodeBlockHeight:S.estimatedBlockHeight,[_,O]=(0,s.useState)(),M=(0,s.useCallback)(e=>{if(_===e){O(void 0);return}O(e),t("detail"),r("spending")},[_,O,t]),T=(0,s.useMemo)(()=>{var e;return p.data?(null===(e=p.data)||void 0===e?void 0:e.map(e=>{var t;let n="fcid:0000000000000000000000000000000000000000000000000000000000000000"!==e.renewedFrom,r=(0,f.jr)(C,e.startHeight),i=e.windowStart,a=(0,f.jr)(C,i);return{id:e.id,onClick:()=>M(e.id),contractId:e.id,state:e.state,hostIp:e.hostIP,hostKey:e.hostKey,contractSets:e.contractSets,location:null===(t=E.find(t=>t.public_key===e.hostKey))||void 0===t?void 0:t.location,timeline:r,startTime:r,endTime:a,contractHeightStart:e.startHeight,contractHeightEnd:i,proofWindowHeightStart:e.windowStart,proofWindowHeightEnd:e.windowEnd,proofHeight:e.proofHeight,revisionHeight:e.revisionHeight,isRenewed:n,renewedFrom:e.renewedFrom,totalCost:new(u())(e.totalCost),spendingUploads:new(u())(e.spending.uploads),spendingDownloads:new(u())(e.spending.downloads),spendingFundAccount:new(u())(e.spending.fundAccount),size:new(u())(e.size)}}))||[]:null},[p.data,E,C,M]),A=(0,s.useMemo)(()=>null==T?void 0:T.find(e=>e.id===_),[T,_]),{filters:P,setFilter:N,removeFilter:R,removeLastFilter:D,resetFilters:L}=(0,i.Wdu)(),{configurableColumns:Z,enabledColumns:F,sortableColumns:z,toggleColumnVisibility:V,setColumnsVisible:I,setColumnsHidden:B,toggleSort:H,setSortDirection:U,setSortField:W,sortField:q,sortDirection:$,resetDefaultColumnVisibility:K}=(0,i.oy6)("renterd/v0/contracts",{columns:m,columnsDefaultVisible:c.gd,sortOptions:c.Fo,defaultSortField:c.nw}),Y=(0,i._4u)({dataset:T,filters:P,sortField:q,sortDirection:$}),X=(0,s.useMemo)(()=>Y?Y.slice(h,h+d):null,[Y,h,d]),{range:G}=(0,s.useMemo)(()=>(0,i.EJC)(C,X||[]),[C,X]),Q=(0,s.useMemo)(()=>m.filter(e=>e.fixed||F.includes(e.id)),[F]),J=(0,i.c2j)(Y,p.isValidating,p.error,P),ee=(0,y.B)(),et=(0,w.a)(),en=(0,s.useMemo)(()=>{var e;return{currentHeight:S.estimatedBlockHeight,defaultSet:null===(e=et.data)||void 0===e?void 0:e.default,contractsTimeRange:G,siascanUrl:ee}},[S.estimatedBlockHeight,G,ee,et.data]),{contractMetrics:er}=x({start:new Date().getTime()-(0,i.NrH)(30)}),{contractMetrics:ei}=x({contractId:_,start:(null==A?void 0:A.startTime)||0,disabled:!A}),{contractSetMetrics:ea}=function(){var e;let t=b(new Date().getTime()-(0,i.NrH)(30)),n=(0,i.NrH)(1),r=(0,s.useMemo)(()=>Math.round((b(new Date().getTime())-t)/n),[t,n]),a=(0,o.e$)(),l=(0,o.Bi)({disabled:!a.data,params:{name:null===(e=a.data)||void 0===e?void 0:e.contracts.set,start:new Date(t).toISOString(),interval:n,n:r}});return{contractSetMetrics:(0,s.useMemo)(()=>{var e;let t=(0,i.Y_Z)(null===(e=l.data)||void 0===e?void 0:e.map(e=>({contracts:Number(e.contracts),timestamp:new Date(e.timestamp).getTime()})),"none"),r=(0,i.fVJ)(t);return{data:t,stats:r,config:{enabledGraph:["contracts"],enabledTip:["contracts"],data:{contracts:{label:"contracts",color:i.O9T.emerald[600]}},formatTimestamp:n===(0,i.NrH)(1)?(0,i.kOJ)("daily"):void 0,disableAnimations:!0,chartType:"line",curveType:"linear",stackOffset:"none"},isLoading:l.isValidating&&!l.data}},[l.data,l.isValidating,n])}}(),eo=(0,o.Wu)();return{dataState:J,limit:d,offset:h,isLoading:p.isLoading,error:p.error,pageCount:(null==X?void 0:X.length)||0,datasetCount:(null==T?void 0:T.length)||0,datasetFilteredCount:(null==Y?void 0:Y.length)||0,columns:Q,dataset:T,cellContext:en,datasetPage:X,configurableColumns:Z,enabledColumns:F,sortableColumns:z,toggleColumnVisibility:V,setColumnsVisible:I,setColumnsHidden:B,toggleSort:H,setSortDirection:U,setSortField:W,sortField:q,filters:P,setFilter:N,removeFilter:R,removeLastFilter:D,resetFilters:L,sortDirection:$,resetDefaultColumnVisibility:K,viewMode:e,setViewMode:t,graphMode:n,setGraphMode:r,selectedContract:A,selectContract:M,allContractsSpendingMetrics:er,selectedContractSpendingMetrics:ei,contractSetCountMetrics:ea,contractSets:eo}}();return(0,r.jsx)(k.Provider,{value:n,children:t})}},75262:function(e,t,n){"use strict";n.d(t,{Fo:function(){return a},gd:function(){return r},nw:function(){return i}});let r=["contractId","contractSets","hostIp","hostKey","state","timeline","size","totalCost","spendingUploads","spendingDownloads","spendingFundAccount"],i="startTime",a=[{id:"contractId",label:"contract ID",category:"general"},{id:"hostIp",label:"host address",category:"general"},{id:"hostKey",label:"host public key",category:"general"},{id:"state",label:"state",category:"general"},{id:"timeline",label:"timeline",category:"time"},{id:"startTime",label:"start date",category:"time"},{id:"endTime",label:"end date",category:"time"},{id:"size",label:"size",category:"general"},{id:"totalCost",label:"total cost",category:"financial"},{id:"spendingUploads",label:"uploads spending",category:"financial"},{id:"spendingDownloads",label:"downloads spending",category:"financial"},{id:"spendingFundAccount",label:"fund account spending",category:"financial"}]},97112:function(e,t,n){"use strict";n.d(t,{Tu:function(){return eB},xQ:function(){return eH},Rh:function(){return eI}});var r=n(52322),i=n(2784),a=n(36655),o=n(10363),s=n(98334),l=n(82851),u=n(99182),c=n(5632),d=n(35599),f=n(57016);let h={namespace:"wallet",label:"Wallet"};function p(e){var t;let{currentPage:n,parentPage:i,pushPage:o}=e,{openDialog:l,closeDialog:u}=eI(),p=(0,c.useRouter)(),m=(0,f.X2)();return(0,r.jsxs)(d.fu,{currentPage:n,commandPage:h,children:[(0,r.jsx)(d.Ul,{currentPage:n,parentPage:i,commandPage:h,onSelect:()=>{o(h)},children:h.label}),(0,r.jsx)(d.WD,{currentPage:n,commandPage:h,onSelect:()=>{p.push(s._.wallet.view),u()},children:"View wallet transactions"}),(0,r.jsx)(d.WD,{currentPage:n,commandPage:h,onSelect:()=>{l("sendSiacoin")},children:"Send siacoin"}),(0,r.jsx)(d.WD,{currentPage:n,commandPage:h,onSelect:()=>{l("addressDetails")},children:"Receive siacoin"}),(0,r.jsx)(d.WD,{currentPage:n,commandPage:h,onSelect:()=>{l("addressDetails")},children:"View wallet address"}),(0,r.jsx)(d.WD,{currentPage:n,commandPage:h,disabled:!(null===(t=m.data)||void 0===t?void 0:t.address),onSelect:()=>{var e;(null===(e=m.data)||void 0===e?void 0:e.address)&&((0,a.vQq)(m.data.address,"wallet address"),u())},children:"Copy wallet address to clipboard"})]})}var m=n(38617);let v={namespace:"settings",label:"Settings"};function g(e){let{currentPage:t,parentPage:n}=e,{openDialog:i,closeDialog:a}=eI(),{setTheme:s}=(0,m.F)(),{settings:l,setSettings:u,lock:c,currencyOptions:f,setCurrency:h}=(0,o.Hv)();return(0,r.jsxs)(d.fu,{currentPage:t,commandPage:v,children:[(0,r.jsx)(d.Ul,{currentPage:t,parentPage:n,commandPage:v,onSelect:()=>{i("settings")},children:"Open settings"}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:v,onSelect:()=>{u({siaCentral:!l.siaCentral}),a()},children:(l.siaCentral?"Disable":"Enable")+" external API - Sia Central exchange rates"}),(0,r.jsx)(d.o4,{currentPage:t,commandPage:v,onSelect:()=>{c(),a()},children:"Lock renterd"}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:v,onSelect:()=>{i("settings")},children:"Open interface theme menu"}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:v,onSelect:()=>{s("system"),a()},children:"Set theme to system preference"}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:v,onSelect:()=>{s("dark"),a()},children:"Set theme to dark"}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:v,onSelect:()=>{s("light"),a()},children:"Set theme to light"}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:v,onSelect:()=>{i("settings")},children:"Open currency settings menu"}),f.map(e=>{let{id:n,label:i}=e;return(0,r.jsx)(d.WD,{currentPage:t,commandPage:v,onSelect:()=>{h(n),a()},children:"Set currency to ".concat(i)},n)})]})}let y={namespace:"node",label:"Blockchain node"};function b(e){let{currentPage:t,parentPage:n,pushPage:i}=e,{openDialog:a,closeDialog:o}=eI(),l=(0,c.useRouter)();return(0,r.jsxs)(d.fu,{currentPage:t,commandPage:y,children:[(0,r.jsx)(d.Ul,{currentPage:t,parentPage:n,commandPage:y,onSelect:()=>{i(y)},children:y.label}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:y,onSelect:()=>{a("connectPeer")},children:"Connect to a peer"}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:y,onSelect:()=>{l.push(s._.node.index),o()},children:"View peers"}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:y,onSelect:()=>{l.push(s._.node.index),o()},children:"View transaction pool"})]})}var x=n(49889),w=n(46081);let j={namespace:"configuration",label:"Configuration"};function k(e){let{currentPage:t,parentPage:n,pushPage:i}=e,a=(0,c.useRouter)(),{showAdvanced:o}=(0,x.ZR)(),{closeDialog:l}=eI(),{autopilot:u}=(0,w.q)();return(0,r.jsxs)(d.fu,{currentPage:t,commandPage:j,children:[(0,r.jsx)(d.Ul,{currentPage:t,parentPage:n,commandPage:j,onSelect:()=>{i(j)},children:j.label}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:j,onSelect:()=>{a.push(s._.config.index),l()},children:"Open configuration"}),"on"===u.status&&(0,r.jsx)(d.WD,{currentPage:t,commandPage:j,onSelect:()=>{a.push(s._.config.storage),l()},children:"Configure storage"}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:j,onSelect:()=>{a.push(s._.config.pricing),l()},children:"Configure pricing"}),o&&(0,r.jsxs)(r.Fragment,{children:["on"===u.status&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.WD,{currentPage:t,commandPage:j,onSelect:()=>{a.push(s._.config.hosts),l()},children:"Configure hosts"}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:j,onSelect:()=>{a.push(s._.config.wallet),l()},children:"Configure wallet"})]}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:j,onSelect:()=>{a.push(s._.config.contracts),l()},children:"Configure contracts"}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:j,onSelect:()=>{a.push(s._.config.uploads),l()},children:"Configure uploads"}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:j,onSelect:()=>{a.push(s._.config.redundancy),l()},children:"Configure redundancy"})]})]})}var E=n(14613);let S={namespace:"contracts",label:"Contracts"};function C(e){let{currentPage:t,parentPage:n,pushPage:i,beforeSelect:a,afterSelect:o}=e,l=(0,c.useRouter)(),{closeDialog:u}=eI();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.Ul,{currentPage:t,parentPage:n,commandPage:n,onSelect:()=>{i(S)},children:S.label}),(0,r.jsx)(d.fu,{currentPage:t,commandPage:S,children:(0,r.jsx)(d.WD,{currentPage:t,commandPage:S,onSelect:()=>{l.push(s._.contracts.index),u()},children:"View contracts"})}),(0,r.jsx)(E.F,{parentPage:S,currentPage:t,beforeSelect:a,afterSelect:o,pushPage:i})]})}let _={namespace:"alerts",label:"Alerts"};function O(e){let{currentPage:t,parentPage:n,pushPage:i}=e,a=(0,c.useRouter)(),{closeDialog:o}=eI();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.Ul,{currentPage:t,parentPage:n,commandPage:n,onSelect:()=>{i(_)},children:_.label}),(0,r.jsx)(d.fu,{currentPage:t,commandPage:_,children:(0,r.jsx)(d.WD,{currentPage:t,commandPage:_,onSelect:()=>{a.push(s._.alerts.index),o()},children:"View alerts"})})]})}var M=n(76838),T=n(42213);let A={namespace:"hosts",label:"Hosts"};function P(e){let{currentPage:t,parentPage:n,pushPage:i,beforeSelect:a,afterSelect:o}=e,l=(0,c.useRouter)(),{closeDialog:u,openDialog:f}=eI();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.Ul,{currentPage:t,parentPage:n,commandPage:n,onSelect:()=>{i(A)},children:A.label}),(0,r.jsx)(d.fu,{currentPage:t,commandPage:A,children:(0,r.jsx)(d.WD,{currentPage:t,commandPage:A,onSelect:()=>{l.push(s._.hosts.index),u()},children:"View hosts"})}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:A,onSelect:()=>{f("hostsManageAllowBlock")},children:"Manage filter lists: allowlist + blocklist"}),(0,r.jsx)(T.L,{parentPage:A,currentPage:t,beforeSelect:a,afterSelect:o,pushPage:i})]})}var N=n(70899),R=n(61020);function D(e){let{debouncedSearch:t}=e;return(0,r.jsxs)(a.xvT,{color:"verySubtle",className:"flex flex-col gap-2 justify-center items-center mt-5 mb-3",children:[(0,r.jsxs)(a.xvT,{color:"verySubtle",className:"flex gap-2 justify-center items-center",children:[(0,r.jsx)(R.e1T,{}),(0,r.jsx)(R.JCW,{}),(0,r.jsx)(R.c_L,{})]}),(0,r.jsx)(a.xvT,{size:"12",color:"verySubtle",className:"flex justify-center",children:t?"No files match the query.":"Type a query to get started."})]})}var L=n(41736);let Z={namespace:"files/search",label:"File search",prompt:"Search for files, eg: backups, photo_archive.zip, etc...",empty:D};function F(e){let{debouncedSearch:t,search:n,currentPage:i,beforeSelect:o,afterSelect:s}=e,{activeBucketName:l,navigateToModeSpecificFiltering:u}=(0,L.b)(),c=(null==i?void 0:i.namespace)===Z.namespace,h=l||"default",p=(0,f.Iy)({disabled:!c,params:{bucket:h,key:t,offset:0,limit:10},config:{swr:{keepPreviousData:!0}}});return c&&p.data?(0,r.jsx)(d.fu,{currentPage:i,commandPage:Z,children:p.data.map(e=>{let{name:t}=e,l=function(e,t,n){let r=Math.max(e.length-55,0);if(0===r)return e;let i=z(e),a=z(t),o=i.toLowerCase().indexOf(a.toLowerCase()),s=o+a.length-1,l=0,u=0;return i.split("/").map(e=>{if(l>=r)return u+=e.length,z(e);let t=u,n=u+e.length+1;return to?(u+=e.length,z(e)):!e.includes(a)&&e.length>3?(u+=e.length,l+=e.length+1,"..."):(u+=e.length,z(e))}).reverse().join("/")}(t,n,0),{startIndex:c,endIndex:f}=function(e,t){let n=z(e),r=z(t),i=n.toLowerCase().indexOf(r.toLowerCase()),a=i+r.length;return{endIndex:e.length-i,startIndex:e.length-a}}(l,n);return(0,r.jsx)(d.WD,{commandPage:Z,currentPage:i,onSelect:()=>{o(),u(h+t),s()},value:t,children:(0,r.jsxs)("div",{className:"flex items-center gap-2 overflow-hidden",children:[(0,r.jsx)(a.xvT,{color:"verySubtle",className:"group-data-[selected=true]:text-gray-1000 dark:group-data-[selected=true]:text-graydark-1000",children:(0,N.IQ)(t)?(0,r.jsx)(R.ROc,{size:16}):(0,r.jsx)(R.c_L,{})}),(0,r.jsxs)(a.xvT,{className:"flex items-center",children:[(0,r.jsx)(a.xvT,{color:"verySubtle",ellipsis:!0,children:l.slice(0,c)}),(0,r.jsx)(a.xvT,{color:"accent",ellipsis:!0,children:l.slice(c,f)}),(0,r.jsx)(a.xvT,{color:"verySubtle",ellipsis:!0,children:l.slice(f)})]})]})},t)})}):null}function z(e){return e.split("").reverse().join("")}let V={namespace:"files",label:"Files"};function I(e){let{search:t,debouncedSearch:n,currentPage:i,parentPage:a,pushPage:o,beforeSelect:l,afterSelect:u}=e,f=(0,c.useRouter)(),{closeDialog:h}=eI();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.Ul,{currentPage:i,parentPage:a,commandPage:a,onSelect:()=>{o(V)},children:V.label}),(0,r.jsxs)(d.fu,{currentPage:i,commandPage:V,children:[(0,r.jsx)(d.WD,{currentPage:i,commandPage:V,onSelect:()=>{f.pathname.startsWith(s._.buckets.index)||f.push(s._.buckets.index),h(),u()},children:"View files"}),(0,r.jsx)(d.WD,{currentPage:i,commandPage:V,onSelect:()=>{o(Z),u()},children:"Search files"})]}),(0,r.jsx)(F,{debouncedSearch:n,search:t,currentPage:i,beforeSelect:l,afterSelect:u})]})}var B=n(56328),H=n(94225);function U(e){let{search:t}=e;return(0,r.jsxs)(a.xvT,{color:"verySubtle",className:"flex flex-col gap-2 justify-center items-center mt-5 mb-3",children:[(0,r.jsx)(a.xvT,{color:"verySubtle",className:"flex gap-2 justify-center items-center",children:(0,r.jsx)(R.owP,{})}),(0,r.jsx)(a.xvT,{size:"12",color:"verySubtle",className:"flex justify-center",children:t?"No results matching query.":"Type a query to get started."})]})}let W={namespace:"keys",label:"S3 authentication keys"};function q(e){let{currentPage:t,parentPage:n,pushPage:i}=e,a=(0,c.useRouter)(),{closeDialog:o,openDialog:l}=eI();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.Ul,{currentPage:t,parentPage:n,commandPage:n,onSelect:()=>{i(W)},children:W.label}),(0,r.jsxs)(d.fu,{currentPage:t,commandPage:W,children:[(0,r.jsx)(d.WD,{currentPage:t,commandPage:W,onSelect:()=>{a.push(s._.keys.index),o()},children:"View keys"}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:W,onSelect:()=>{a.push(s._.keys.index),l("keysCreate")},children:"Create new S3 authentication keypair"})]})]})}function $(e){let{panel:t}=e,{resetFilters:n}=(0,M.G)(),{resetFilters:o}=(0,B.l)(),{closeDialog:d}=eI(),f=(0,c.useRouter)(),[h,m]=(0,i.useState)(""),[v]=(0,H.Nr)(h,500),[y,x]=(0,i.useState)([]),w=y[y.length-1],j=0===y.length,E=(0,i.useCallback)(e=>{x(t=>[...t,e])},[x]),S=(0,i.useCallback)(()=>{d()},[d]),_=(0,i.useCallback)(()=>{m("")},[m]),T=(null==w?void 0:w.empty)||U;return(0,r.jsxs)(u.mY,{label:"Command Menu",loop:!0,className:(0,l.cx)(t&&(0,a.z$)()),onKeyDown:e=>{(y.length>0&&"Escape"===e.key||"Backspace"===e.key&&!h)&&(e.preventDefault(),x(e=>e.slice(0,-1)))},children:[w&&(0,r.jsx)(a.__J,{className:"px-2",children:w.label}),(0,r.jsx)(u.mY.Input,{value:h,onValueChange:m,className:(0,a.cEb)({variant:"ghost",focus:"none"}),placeholder:(null==w?void 0:w.prompt)||(j?"Search for commands, eg: theme, redundancy":"Search commands")}),(0,r.jsx)(a.Z0O,{className:"my-2"}),(0,r.jsxs)(u.mY.List,{children:[(0,r.jsx)(u.mY.Empty,{children:(0,r.jsx)(T,{search:h,debouncedSearch:v})}),(0,r.jsx)(g,{currentPage:w,pushPage:E}),(0,r.jsx)(I,{debouncedSearch:v,search:h,currentPage:w,pushPage:E,beforeSelect:()=>{S()},afterSelect:()=>{_()}}),(0,r.jsx)(p,{currentPage:w,pushPage:E}),(0,r.jsx)(C,{currentPage:w,pushPage:E,beforeSelect:()=>{S(),n()},afterSelect:()=>{f.pathname.startsWith(s._.contracts.index)||f.push(s._.contracts.index),_()}}),(0,r.jsx)(P,{currentPage:w,pushPage:E,beforeSelect:()=>{S(),o()},afterSelect:()=>{f.pathname.startsWith(s._.hosts.index)||f.push(s._.hosts.index),_()}}),(0,r.jsx)(q,{currentPage:w,pushPage:E,beforeSelect:()=>{S()},afterSelect:()=>{f.pathname.startsWith(s._.keys.index)||f.push(s._.keys.index),_()}}),(0,r.jsx)(O,{currentPage:w,pushPage:E,beforeSelect:()=>{S(),n()},afterSelect:()=>{f.pathname.startsWith(s._.alerts.index)||f.push(s._.alerts.index),_()}}),(0,r.jsx)(k,{currentPage:w,pushPage:E}),(0,r.jsx)(b,{currentPage:w,pushPage:E})]})]})}function K(e){let{open:t,onOpenChange:n,setOpen:l}=e,{isUnlockedAndAuthedRoute:u}=(0,o.Hv)(),{isConnected:c}=(0,a.Y97)({route:s.h});return(0,i.useEffect)(()=>{if(!u||!c)return;let e=e=>{"k"===e.key&&e.metaKey&&l()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[u,c,l]),(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(a.VqE,{open:t,onOpenChange:n,contentVariants:{className:"!absolute !p-1 w-[450px] top-[200px]"},bodyClassName:"!px-1 !py-1",closeClassName:"hidden",children:(0,r.jsx)($,{})})})}var Y=n(7114),X=n(24511);let G={name:""},Q=X.Ry().shape({name:X.Z_().required("Required")});function J(e){let{trigger:t,open:n,onOpenChange:i}=e,{activeDirectoryPath:o}=(0,L.b)(),s=(0,f.ZM)(),l=(0,Y.TA)({initialValues:G,validationSchema:Q,onSubmit:async(e,t)=>{let n=await s.put({params:(0,N.W0)(o+e.name+"/"),payload:null});n.error?(0,a.OHV)(n.error):((0,a.RFt)("Directory created."),t.resetForm(),i(!1))}});return(0,r.jsx)(a.VqE,{trigger:t,title:"New directory",open:n,onOpenChange:e=>{e||l.resetForm(),i(e)},contentVariants:{className:"w-[400px]"},children:(0,r.jsx)("div",{className:"flex flex-col gap-4",children:(0,r.jsx)("form",{onSubmit:l.handleSubmit,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(a.cB7,{formik:l,title:"Name",name:"name",placeholder:"photos, backups, etc",autoComplete:"off",type:"text",variants:{size:"medium"}}),(0,r.jsx)(a.IKw,{formik:l,size:"medium",children:"Create"})]})})})})}var ee=n(82229);let et={publicKey:""},en=X.Ry().shape({publicKey:X.Z_().required("Required")});function er(){var e;let t=(0,f.s2)({config:{swr:{refreshInterval:6e4}}}),n=(0,ee.I)(),o=(0,Y.TA)({initialValues:et,validationSchema:en,onSubmit:async(e,t)=>{await n([e.publicKey],[])?t.resetForm():t.setStatus({error:"Error updating allowlist"})}});(0,i.useEffect)(()=>{o.setStatus(void 0)},[o.values]);let s=o.values.publicKey,l=(null===(e=t.data)||void 0===e?void 0:e.filter(e=>!o.values.publicKey||e.includes(o.values.publicKey)))||[];return(0,r.jsxs)("form",{onSubmit:o.handleSubmit,className:"flex flex-col gap-2 h-[400px]",children:[(0,r.jsx)(a.S$c,{title:"Public key",name:"publicKey",formik:o,withStatusError:!0,children:(0,r.jsxs)("div",{className:"flex gap-1",children:[(0,r.jsx)(a.KZS,{name:"publicKey",formik:o,placeholder:"ed25519:02aabd26e627fd...",autoComplete:"off",variants:{size:"small"}}),(0,r.jsx)(a.IKw,{formik:o,size:"small",variant:"amber",withStatusError:!1,children:"Allow public key"})]})}),(0,r.jsxs)(a.s_4,{className:"p-2 flex gap-2 items-center",children:[(0,r.jsx)(a.xvT,{children:(0,r.jsx)(R.qdM,{})}),(0,r.jsxs)(a.nvN,{size:"12",children:[(0,r.jsx)(a.xvT,{weight:"semibold",children:"Caution:"})," Please note that because the allowlist is inclusive, as soon as there are more than zero entries, contracting will be limited to only the hosts explicitly on the allowlist - all other existing contracts will immediately abort."]})]}),(0,r.jsx)("div",{className:"flex-1 overflow-hidden !-m-2",children:l.length?(0,r.jsx)(a.xrM,{children:(0,r.jsx)("div",{className:"p-2",children:(0,r.jsx)(a.hmz,{options:l.map(e=>({value:e,label:"".concat(e.slice(0,20),"...")}))||[],onClick:e=>(0,a.vQq)(e,"allowed public key"),onRemove:e=>n([],[e])})})}):s?(0,r.jsxs)("div",{className:"flex flex-col gap-3 items-center justify-center h-[200px]",children:[(0,r.jsx)(a.xvT,{color:"subtle",children:(0,r.jsx)(R.Hb6,{})}),(0,r.jsxs)(a.xvT,{color:"subtle",children:["No existing entries match ",o.values.publicKey,"."]})]}):(0,r.jsxs)("div",{className:"flex flex-col gap-3 items-center justify-center h-[200px]",children:[(0,r.jsx)(a.xvT,{color:"subtle",children:(0,r.jsx)(R.TtX,{})}),(0,r.jsx)(a.xvT,{color:"subtle",children:"The allowlist is empty."})]})})]})}var ei=n(94613);let ea={address:""},eo=["45.148.30.56","51.158.108.244","siacentral.ddnsfree.com","siacentral.mooo.com"],es=X.Ry().shape({address:X.Z_().required("Required").test("address","Invalid hostname or IP address",e=>(0,a.Ztc)().test(e||""))});function el(){let e=(0,f.uf)({config:{swr:{refreshInterval:6e4}}}),t=(0,ei.l)(),n=(0,Y.TA)({initialValues:ea,validationSchema:es,onSubmit:async(e,n)=>{await t([e.address],[])?n.resetForm():n.setStatus({error:"Error updating blocklist"})}});(0,i.useEffect)(()=>{n.setStatus(void 0)},[n.values]);let o=n.values.address,s=(0,i.useMemo)(()=>{var t;return(null===(t=e.data)||void 0===t?void 0:t.filter(e=>!n.values.address||e.includes(n.values.address)))||[]},[e.data,n.values.address]),{dataset:l}=(0,M.G)(),u=(0,i.useMemo)(()=>eo.filter(t=>{var n;return!(null===(n=e.data)||void 0===n?void 0:n.find(e=>e===t))}).map(e=>({address:e,contractCount:null==l?void 0:l.filter(t=>t.hostIp===e).length})),[e.data,l]);return(0,r.jsxs)("form",{onSubmit:n.handleSubmit,className:"flex flex-col gap-2 h-[400px]",children:[(0,r.jsx)(a.S$c,{title:"Address",name:"address",formik:n,withStatusError:!0,children:(0,r.jsxs)("div",{className:"flex gap-1",children:[(0,r.jsx)(a.KZS,{name:"address",formik:n,placeholder:"eg: 51.258.128.144 or spam.ddnsfree.com",autoComplete:"off",variants:{size:"small"}}),(0,r.jsx)(a.IKw,{formik:n,size:"small",variant:"red",withStatusError:!1,children:"Block address"})]})}),(0,r.jsx)("div",{className:"flex-1 overflow-hidden !-m-2",children:(0,r.jsx)(a.xrM,{children:(0,r.jsxs)("div",{className:"p-2",children:[!!u.length&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex gap-1 flex-wrap",children:[(0,r.jsx)(a.xvT,{size:"12",color:"subtle",children:"Suggestions:"}),u.map((e,t)=>{let{address:i,contractCount:o}=e;return(0,r.jsxs)(a.xvT,{size:"12",underline:"hover",className:"cursor-pointer",onClick:()=>n.setFieldValue("address",i),children:[i,!!o&&(0,r.jsxs)(r.Fragment,{children:[" ",(0,r.jsx)(a.ua7,{content:"".concat(o," active contracts"),children:(0,r.jsxs)(a.xvT,{color:"red",children:["(",o,")"]})})]}),t!==u.length-1&&(0,r.jsx)(a.xvT,{children:","})]},i)})]}),(0,r.jsx)(a.Z0O,{className:"my-2"})]}),s.length?(0,r.jsx)(a.hmz,{options:s.map(e=>({value:e,label:"".concat(e.slice(0,20),"...")}))||[],onClick:e=>(0,a.vQq)(e,"blocked address"),onRemove:e=>t([],[e])}):o?(0,r.jsxs)("div",{className:"flex flex-col gap-3 items-center justify-center h-[200px]",children:[(0,r.jsx)(a.xvT,{color:"subtle",children:(0,r.jsx)(R.Hb6,{})}),(0,r.jsxs)(a.xvT,{color:"subtle",children:["No existing entries match ",n.values.address,"."]})]}):(0,r.jsxs)("div",{className:"flex flex-col gap-3 items-center justify-center h-[200px]",children:[(0,r.jsx)(a.xvT,{color:"subtle",children:(0,r.jsx)(R.TtX,{})}),(0,r.jsx)(a.xvT,{color:"subtle",children:"The blocklist is empty."})]})]})})})]})}function eu(e){let{trigger:t,open:n,onOpenChange:i}=e;return(0,r.jsx)(a.VqE,{trigger:t,title:"Manage host blocklist and allowlist",open:n,onOpenChange:e=>{i(e)},contentVariants:{className:"w-[500px]"},children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(a.nvN,{size:"12",children:"The allowlist and blocklist limit the set of hosts that renterd will consider when forming contracts. The blocklist excludes hosts with matching addresses whereas the allowlist restricts consideration to hosts with a matching public key. Each list's filtering is enabled and applied when it contains more than zero entries."}),(0,r.jsxs)(a.mQc,{defaultValue:"blocklist",children:[(0,r.jsxs)(a.drW,{"aria-label":"blocklist and allowlist tabs",children:[(0,r.jsx)(a.SPt,{value:"blocklist",children:"Block"}),(0,r.jsx)(a.SPt,{value:"allowlist",children:"Allow"})]}),(0,r.jsx)(a.nUL,{value:"blocklist",children:(0,r.jsx)(el,{})}),(0,r.jsx)(a.nUL,{value:"allowlist",children:(0,r.jsx)(er,{})})]})]})})}var ec=n(10532),ed=n(98131),ef=n(30291),eh=n(11948),ep=n(99605);function em(e){let{panel:t}=e,{closeDialog:n}=eI(),o=(0,ep.xj)(),c=(0,ep.jD)(),[d,f]=(0,i.useState)(""),[h]=(0,H.Nr)(d,500),p=(0,i.useCallback)(()=>{n()},[n]);return(0,r.jsxs)(u.mY,{label:"Files search",shouldFilter:!1,className:(0,l.cx)(t&&(0,a.z$)()),children:[(0,r.jsx)(a.__J,{className:"px-2",children:"File search"}),(0,r.jsx)(u.mY.Input,{value:d,onValueChange:f,className:(0,a.cEb)({variant:"ghost",focus:"none"}),placeholder:Z.prompt}),(0,r.jsx)(a.Z0O,{className:"my-2"}),(0,r.jsx)("div",{className:"overflow-hidden",children:(0,r.jsxs)(u.mY.List,{children:[(0,r.jsx)(u.mY.Empty,{children:(0,r.jsx)(D,{search:d,debouncedSearch:h})}),(0,r.jsx)(F,{debouncedSearch:h,search:d,currentPage:Z,beforeSelect:()=>{p()},afterSelect:()=>{c.startsWith(s._.buckets.index)||o.push(s._.buckets.index)}})]})})]})}function ev(e){let{open:t,onOpenChange:n,trigger:i}=e;return(0,r.jsx)(a.VqE,{open:t,trigger:i,onOpenChange:n,contentVariants:{className:"!absolute !p-1 w-[450px] top-[200px]"},bodyClassName:"!px-1 !py-1",closeClassName:"hidden",children:(0,r.jsx)(em,{})})}var eg=n(6391),ey=n.n(eg);function eb(){let{dialog:e,openDialog:t,closeDialog:n}=eI(),o=(0,f.X2)(),s=(0,f.gU)(),l=(0,f.cg)(),u=(0,f.ys)(),c=(0,f.aO)(),d=(0,i.useCallback)(async e=>{let{sc:t,address:n}=e,r=await s.post({payload:{amount:t.toString(),transaction:{siacoinOutputs:[{address:n,value:t.toString()}]}}});if(r.error)return{error:r.error};let i=await l.post({payload:{transaction:r.data.transaction,toSign:r.data.toSign,coveredFields:{wholeTransaction:!0}}});if(i.error)return c.post({payload:r.data.transaction}),{error:i.error};let a=await u.post({payload:[i.data]});return a.error?(c.post({payload:i.data}),{error:a.error}):{}},[s,l,u,c]);return(0,r.jsx)(a.weF,{balance:o.data?new(ey())(o.data.spendable):void 0,send:d,open:"sendSiacoin"===e,onOpenChange:r=>r?t(e):n()})}var ex=n(40730);function ew(){let{id:e,dialog:t,openDialog:n,closeDialog:o}=eI(),{dataset:s}=(0,ex.n)(),l=(0,i.useMemo)(()=>null==s?void 0:s.find(t=>t.hash===e),[s,e]);return(0,r.jsx)(a.mPE,{id:e,transaction:l,open:"transactionDetails"===t,onOpenChange:e=>e?n(t):o()})}var ej=n(23771),ek=n(63955);let eE={name:""};function eS(e){let{trigger:t,open:n,onOpenChange:o}=e,{id:s,closeDialog:l}=eI(),u=(0,f.sg)(),c=(0,ek.cI)({mode:"all",defaultValues:eE}),d=(0,i.useCallback)(async e=>{let t=await u.delete({params:{name:e.name}});t.error?(0,a.OHV)(t.error):((0,a.OPV)("Bucket permanently deleted."),c.reset(),l())},[c,u,l]),h=(0,i.useMemo)(()=>({name:{type:"text",title:"Name",placeholder:s,validation:{required:"required",validate:{notDefault:()=>"default"!==s||"cannot delete default bucket",equals:e=>e===s||"bucket name does not match"}}}}),[s]),p=(0,a.WsO)(h);return(0,r.jsx)(a.VqE,{title:"Delete Bucket",trigger:t,open:n,onOpenChange:e=>{e||c.reset(eE),o(e)},contentVariants:{className:"w-[400px]"},onSubmit:c.handleSubmit(d,p),children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(a.nvN,{size:"14",children:"Before you delete a bucket you must ensure that it is empty. Re-enter the bucket name to confirm the removal."}),(0,r.jsx)("div",{children:(0,r.jsx)(a.EKh,{color:"gray",children:s})}),(0,r.jsx)(a.yEL,{name:"name",form:c,fields:h,autoComplete:"off"}),(0,r.jsx)(a.ZqQ,{variant:"red",form:c,children:"Delete"})]})})}let eC={visibility:"public"};function e_(e){let{trigger:t,open:n,onOpenChange:o}=e,{id:s,closeDialog:l}=eI(),u=(0,f.D5)({disabled:!n,params:{name:s},config:{swr:{revalidateOnFocus:!1}}}),c=(0,f.ol)(),d=(0,ek.cI)({mode:"all",defaultValues:eC});(0,i.useEffect)(()=>{var e,t;d.reset({visibility:(null===(t=u.data)||void 0===t?void 0:null===(e=t.policy)||void 0===e?void 0:e.publicReadAccess)?"public":"private"})},[d,u.data]);let h=(0,i.useCallback)(async e=>{let t=await c.put({params:{name:s},payload:{policy:{publicReadAccess:"public"===e.visibility}}});t.error?(0,a.OHV)(t.error):((0,a.OPV)("Bucket policy has been updated."),d.reset(),l())},[d,s,c,l]),p=(0,i.useMemo)(()=>({visibility:{type:"text",title:"Read Access",placeholder:s,validation:{required:"required"},options:[{label:"Public",value:"public"},{label:"Private",value:"private"}]}}),[s]),m=(0,a.WsO)(p);return(0,r.jsx)(a.VqE,{title:"Change Policy: ".concat(s),trigger:t,open:n,onOpenChange:e=>{e||d.reset(eC),o(e)},contentVariants:{className:"w-[400px]"},onSubmit:d.handleSubmit(h,m),children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(a.nvN,{size:"14",children:"Update the bucket's policy to set read access to either private or public. Files in public read access buckets can be accessed without authentication via the S3 API."}),(0,r.jsx)(a.WyV,{name:"visibility",form:d,fields:p}),(0,r.jsx)(a.ZqQ,{variant:"accent",form:d,children:"Update policy"})]})})}let eO={name:""};function eM(e){let{trigger:t,open:n,onOpenChange:o}=e,{closeDialog:s}=eI(),l=(0,f.oV)(),u=(0,ek.cI)({mode:"all",defaultValues:eO}),c=(0,i.useCallback)(async e=>{let t=await l.post({payload:{name:e.name}});t.error?(0,a.OHV)(t.error):((0,a.OPV)("Bucket created."),u.reset(),s())},[u,l,s]),d=(0,i.useMemo)(()=>({name:{type:"text",title:"Name",placeholder:"photos, backups, etc",validation:{required:"required"}}}),[]),h=(0,a.WsO)(d);return(0,r.jsx)(a.VqE,{title:"Create Bucket",trigger:t,open:n,onOpenChange:e=>{e||u.reset(eO),o(e)},contentVariants:{className:"w-[400px]"},onSubmit:u.handleSubmit(c,h),children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(a.nvN,{size:"14",children:"A bucket is an isolated collection of files."}),(0,r.jsx)(a.yEL,{name:"name",form:u,fields:d,autoComplete:"off"}),(0,r.jsx)(a.ZqQ,{form:u,children:"Create bucket"})]})})}var eT=n(5184),eA=n(75618),eP=n(43385);function eN(e){let{id:t,trigger:n,open:o,onOpenChange:s}=e,{closeDialog:l}=eI(),{refresh:u}=(0,eA.J)(),{refresh:c}=(0,eP.o)(),d=(0,N.vt)(t||""),h={name:d=d.endsWith("/")?d.slice(0,-1):d},p=(0,f.GD)(),m=(0,ek.cI)({mode:"all",defaultValues:h});(0,i.useEffect)(()=>{m.reset({name:d})},[m,d]);let v=(0,i.useCallback)(async e=>{let{bucket:n,to:r,from:i,mode:o}=(0,eT.E)(t,e.name),s=await p.post({payload:{bucket:n,to:r,from:i,mode:o,force:!1}});s.error?(0,a.OHV)(s.error):(u(),c(),m.reset(),l(),(0,a.OPV)((0,N.IQ)(t)?"Directory renamed.":"File renamed."))},[m,t,u,c,p,l]),g=(0,i.useMemo)(()=>(function(e){let{currentName:t}=e;return{name:{type:"text",title:"Name",placeholder:t,validation:{required:"required",validate:{noSlash:e=>!e.includes("/")||"Name cannot contain slashes"}}}}})({currentName:d}),[d]),y=(0,a.WsO)(g);return(0,r.jsx)(a.VqE,{title:"Rename file",trigger:n,open:o,onOpenChange:e=>{e||m.reset(h),s(e)},contentVariants:{className:"w-[400px]"},onSubmit:m.handleSubmit(v,y),children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(a.yEL,{name:"name",form:m,fields:g,autoComplete:"off"}),(0,r.jsx)(a.ZqQ,{form:m,children:"Save"})]})})}var eR=n(77248),eD=n(55791);function eL(){return{name:eF(),secret:ez()}}function eZ(e){let{trigger:t,open:n,onOpenChange:o}=e,{closeDialog:s}=eI(),l=(0,eR.m)(),u=(0,f.KJ)(),c=(0,ek.cI)({mode:"all",defaultValues:eL()}),d=(0,i.useCallback)(async e=>{var t;let n={...null===(t=l.data)||void 0===t?void 0:t.v4Keypairs,[e.name]:e.secret},r=await u.put({params:{key:"s3authentication"},payload:{v4Keypairs:n}});r.error?(0,a.OHV)(r.error):((0,a.OPV)("New key created."),c.reset(eL()),s())},[c,s,u,l.data]),h=(0,i.useMemo)(()=>{var e;return function(e){let{existingKeys:t,regenerateAccessKey:n,regenerateSecretKey:i}=e;return{name:{type:"text",title:"Access key ID",placeholder:"my secure key",actions:(0,r.jsx)(a.zxk,{onClick:n,tip:"Regenerate access key ID",icon:"contrast",variant:"ghost",size:"none",className:"m-1",children:(0,r.jsx)(eD.Wet,{})}),validation:{required:"required",validate:{minLength:e=>(null==e?void 0:e.length)>=16||"must be at least 16 characters",maxLength:e=>(null==e?void 0:e.length)<=128||"must be at most 128 characters",unique:e=>!t.includes(e)||"Name must be unique"}}},secret:{type:"text",title:"Secret access key",placeholder:"",actions:(0,r.jsx)(a.zxk,{onClick:i,tip:"Regenerate secret access key",icon:"contrast",variant:"ghost",size:"none",className:"m-1",children:(0,r.jsx)(eD.Wet,{})}),validation:{required:"required",validate:{exactLength:e=>(null==e?void 0:e.length)===40||"must be exactly 40 characters"}}}}}({regenerateAccessKey:()=>{c.setValue("name",eF())},regenerateSecretKey:()=>{c.setValue("secret",ez())},existingKeys:Object.keys((null===(e=l.data)||void 0===e?void 0:e.v4Keypairs)||{})})},[l.data,c]),p=(0,a.WsO)(h);return(0,r.jsx)(a.VqE,{title:"Create S3 key",trigger:t,open:n,onOpenChange:e=>{e||c.reset(eL()),o(e)},contentVariants:{className:"w-[400px]"},onSubmit:c.handleSubmit(d,p),controls:(0,r.jsx)("div",{className:"flex flex-col gap-1",children:(0,r.jsx)(a.ZqQ,{form:c,children:"Create"})}),children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(a.nvN,{children:"Create a new S3 authentication key."}),(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsx)(a.yEL,{name:"name",form:c,fields:h}),(0,r.jsx)(a.yEL,{name:"secret",form:c,fields:h})]})]})})}function eF(){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",t="";for(let n=0;n<20;n++)t+=e.charAt(Math.floor(Math.random()*e.length));return t}function ez(){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t="";for(let n=0;n<40;n++)t+=e.charAt(Math.floor(Math.random()*e.length));return t}let eV=(0,i.createContext)({}),eI=()=>(0,i.useContext)(eV);function eB(e){let{children:t}=e,n=function(){let[e,t]=(0,i.useState)(),[n,r]=(0,i.useState)(),a=(0,i.useCallback)((e,n)=>{t(e),r(n)},[t,r]),[o,s]=(0,i.useState)(),l=(0,i.useCallback)(e=>{t("confirm"),s(e)},[t,s]),u=(0,i.useCallback)(()=>{t(void 0),r(void 0),s(void 0)},[t,r,s]),c=(0,i.useCallback)(e=>{e||u()},[u]);return{dialog:e,id:n,openDialog:a,confirm:o,openConfirmDialog:l,closeDialog:u,onOpenChange:c}}();return(0,r.jsx)(eV.Provider,{value:n,children:t})}function eH(){var e;let{id:t,dialog:n,openDialog:i,onOpenChange:o,closeDialog:s,confirm:l,openConfirmDialog:u}=eI(),c=(0,f.Wl)(),d=(0,f.X2)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(K,{open:"cmdk"===n,onOpenChange:o,setOpen:()=>i("cmdk")}),(0,r.jsx)(a.DLL,{open:"settings"===n,onOpenChange:o,showGpuSetting:!0}),(0,r.jsx)(eb,{}),(0,r.jsx)(a.YNn,{address:null===(e=d.data)||void 0===e?void 0:e.address,isValidating:d.isValidating,open:"addressDetails"===n,onOpenChange:e=>e?i(n):s()}),(0,r.jsx)(ew,{}),(0,r.jsx)(a.D_D,{open:"connectPeer"===n,connect:e=>c.post({payload:e}),onOpenChange:e=>e?i(n):s()}),(0,r.jsx)(eM,{open:"filesCreateBucket"===n,onOpenChange:e=>e?i(n):s()}),(0,r.jsx)(eS,{open:"filesDeleteBucket"===n,onOpenChange:e=>e?i(n):s()}),(0,r.jsx)(e_,{open:"filesBucketPolicy"===n,onOpenChange:e=>e?i(n):s()}),(0,r.jsx)(J,{open:"filesCreateDirectory"===n,onOpenChange:e=>e?i(n):s()}),(0,r.jsx)(ev,{open:"filesSearch"===n,onOpenChange:e=>e?i(n):s()}),(0,r.jsx)(eN,{id:t,open:"fileRename"===n,onOpenChange:e=>e?i(n):s()}),(0,r.jsx)(eu,{open:"hostsManageAllowBlock"===n,onOpenChange:e=>e?i(n):s()}),(0,r.jsx)(ec.g,{open:"hostsFilterAddress"===n,onOpenChange:e=>e?i(n):s()}),(0,r.jsx)(ej.a,{open:"hostsFilterPublicKey"===n,onOpenChange:e=>e?i(n):s()}),(0,r.jsx)(ed.p,{open:"contractsFilterAddress"===n,onOpenChange:e=>e?i(n):s()}),(0,r.jsx)(eh.X,{open:"contractsFilterContractSet"===n,onOpenChange:e=>e?i(n):s()}),(0,r.jsx)(ef.C,{open:"contractsFilterPublicKey"===n,onOpenChange:e=>e?i(n):s()}),(0,r.jsx)(eZ,{open:"keysCreate"===n,onOpenChange:e=>e?i(n):s()}),(0,r.jsx)(a.QHy,{open:"confirm"===n,params:l,onOpenChange:e=>e?u(l):s()})]})}},72199:function(e,t,n){"use strict";n.d(t,{z:function(){return p}});var r=n(52322),i=n(36655),a=n(61020),o=n(21487),s=n(87023),l=n(84301),u=n(6391),c=n.n(u),d=n(23094),f=n(90721),h=n(41736);let p=[{id:"type",label:"",fixed:!0,cellClassName:"w-[50px] !pl-2 !pr-2 [&+*]:!pl-0",render:function(e){let{data:{isUploading:t,type:n,name:o,path:u,size:c}}=e,{setActiveDirectory:d}=(0,h.b)();return t?(0,r.jsx)(i.zxk,{variant:"ghost",state:"waiting",children:(0,r.jsx)(a.c_L,{})}):".."===o?(0,r.jsx)(i.zxk,{variant:"ghost",icon:"hover",onClick:e=>{e.stopPropagation(),d(e=>e.slice(0,-1))},children:(0,r.jsx)(a.ROc,{size:16})}):"bucket"===n?(0,r.jsx)(f.s,{name:o}):"directory"===n?(0,r.jsx)(l.I,{path:u,size:c}):(0,r.jsx)(s.e,{path:u})}},{id:"name",label:"name",category:"general",contentClassName:"max-w-[600px]",render:function(e){let{data:{name:t,type:n}}=e,{setActiveDirectoryAndFileNamePrefix:a,setActiveDirectory:o}=(0,h.b)();return"bucket"===n?(0,r.jsx)(i.xvT,{ellipsis:!0,color:"accent",weight:"semibold",className:"cursor-pointer",onClick:e=>{e.stopPropagation(),a([t],"")},children:t}):"directory"===n?".."===t?(0,r.jsx)(i.xvT,{ellipsis:!0,color:"accent",weight:"semibold",className:"cursor-pointer",onClick:e=>{e.stopPropagation(),o(e=>e.slice(0,-1))},children:t}):(0,r.jsx)(i.xvT,{ellipsis:!0,color:"accent",weight:"semibold",className:"cursor-pointer",onClick:e=>{e.stopPropagation(),o(e=>e.concat(t.slice(0,-1)))},children:t}):(0,r.jsx)(i.xvT,{ellipsis:!0,weight:"semibold",children:t})}},{id:"readAccess",label:"public read access",contentClassName:"justify-center",render:function(e){var t,n;let{data:o}=e;if(".."===o.name)return null;let s=null===(n=o.bucket)||void 0===n?void 0:null===(t=n.policy)||void 0===t?void 0:t.publicReadAccess;return(0,r.jsx)(i.ua7,{content:s?"The bucket policy allows public read access.":"The bucket policy only allows private read access.",children:(0,r.jsx)("div",{children:(0,r.jsx)(i.zxk,{variant:"ghost",state:"waiting",children:(0,r.jsx)(i.xvT,{color:s?"contrast":"verySubtle",className:"flex gap-0.5 items-center",children:s?(0,r.jsx)(a.nDH,{}):(0,r.jsx)(a.Lur,{})})})})})}},{id:"size",label:"size",contentClassName:"justify-end",render:function(e){let{data:{type:t,name:n,size:a,isUploading:s}}=e;return"bucket"===t?null:s?(0,r.jsx)(i.xgg,{}):".."===n?null:(0,r.jsx)(i.m2c,{size:"12",value:new(c())(a),variant:"value",color:"subtle",weight:"regular",format:e=>(0,o.vW)(e.toNumber())})}},{id:"health",label:"health",contentClassName:"justify-center",render:function(e){let{data:t}=e;return"bucket"===t.type?null:(0,r.jsx)(d.z,{...t})}}]},75618:function(e,t,n){"use strict";n.d(t,{V:function(){return v},J:function(){return m}});var r=n(52322),i=n(36655),a=n(2784),o=n(57016),s=n(37371),l=n(70899),u=n(5632),c=n(41736),d=n(9338),f=n(5184),h=n(72199);let p=(0,a.createContext)({}),m=()=>(0,a.useContext)(p);function v(e){let{children:t}=e,n=function(){let{activeDirectory:e,activeBucketName:t,activeDirectoryPath:n,setActiveDirectory:r,filters:p,enabledColumns:m}=(0,c.b)(),{limit:v,offset:g,response:y,refresh:b,dataset:x}=function(){var e;let{activeBucketName:t,activeDirectoryPath:n,fileNamePrefixFilter:r,sortDirection:i,sortField:f}=(0,c.b)(),h=(0,u.useRouter)(),p=Number(h.query.limit||50),m=Number(h.query.offset||0),v=(0,a.useMemo)(()=>{let e={...(0,l.W0)(n),sortBy:f,sortDir:i,offset:m,limit:p};return r&&(e.prefix=r.startsWith("/")?r.slice(1):r),e},[n,r,f,i,m,p]),g=(0,o.Jv)({disabled:!t,params:v,config:{swr:{refreshInterval:d.h}}}),y=(0,s.p)({objects:{isValidating:g.isValidating,data:null===(e=g.data)||void 0===e?void 0:e.entries}});return{limit:p,offset:m,response:g,dataset:y.data,refresh:g.mutate}}(),{onDragEnd:w,onDragOver:j,onDragCancel:k,onDragMove:E,onDragStart:S,draggingObject:C}=function(e){let{dataset:t,activeDirectory:n,setActiveDirectory:r,refresh:s}=e,[u,c]=(0,a.useState)(null),[,d]=(0,a.useState)(),h=(0,o.GD)(),p=(0,a.useCallback)(async e=>{let{bucket:t,from:r,to:a,mode:o}=(0,f.e)(e,n);if(r===a)return;let l=await h.post({payload:{force:!1,bucket:t,from:r,to:a,mode:o}});s(),l.error&&(0,i.OHV)(l.error)},[s,h,n]),m=(0,a.useCallback)(e=>{if(!e){d(e=>(e&&clearTimeout(e),null));return}let t=setTimeout(()=>{r(()=>e)},500);d(e=>(e&&clearTimeout(e),t))},[d,r]),v=(0,a.useCallback)(e=>{if(e.collisions.length){var t;let r=null===(t=e.collisions)||void 0===t?void 0:t[0].id;".."===r?m(n.slice(0,-1)):m((0,l.gD)(r))}else m(void 0)},[m,n]),g=(0,a.useCallback)(e=>{c(t.find(t=>t.id===e.active.id)||null)},[t,c]),y=(0,a.useCallback)(e=>{v(e)},[v]),b=(0,a.useCallback)(e=>{v(e)},[v]);return{onDragEnd:(0,a.useCallback)(async e=>{m(void 0),c(void 0),p(e)},[c,m,p]),onDragOver:y,onDragCancel:(0,a.useCallback)(async e=>{m(void 0),c(void 0)},[c,m]),onDragMove:b,onDragStart:g,draggingObject:u}}({dataset:x,activeDirectory:e,setActiveDirectory:r,refresh:b}),_=(0,a.useMemo)(()=>x?e.length>0&&x.length>0?[{id:"..",name:"..",path:"..",type:"directory",onClick:()=>{r(e=>e.slice(0,-1))}},...x]:x:null,[x]),O=(0,a.useMemo)(()=>_?_.map(e=>C&&C.id!==e.id&&"directory"===e.type?{...e,isDroppable:!0}:{...e,isDraggable:"bucket"!==e.type&&!e.isUploading}):null,[_,C]);return{activeBucket:t,activeDirectory:e,setActiveDirectory:r,activeDirectoryPath:n,dataState:(0,i.c2j)(x,y.isValidating,y.error,p),columns:(0,a.useMemo)(()=>h.z.filter(e=>e.fixed||m.includes(e.id)),[m]),refresh:b,limit:v,offset:g,datasetPage:O,pageCount:(null==x?void 0:x.length)||0,onDragStart:S,onDragEnd:w,onDragMove:E,onDragCancel:k,onDragOver:j,draggingObject:C}}();return(0,r.jsx)(p.Provider,{value:n,children:t})}},33351:function(e,t,n){"use strict";n.d(t,{z:function(){return m}});var r=n(52322),i=n(36655),a=n(61020),o=n(21487),s=n(87023),l=n(84301),u=n(6391),c=n.n(u),d=n(23094),f=n(90721),h=n(41736),p=n(70899);let m=[{id:"type",label:"",fixed:!0,cellClassName:"w-[50px] !pl-2 !pr-2 [&+*]:!pl-0",render:function(e){let{data:{isUploading:t,type:n,name:o,path:u,size:c}}=e;return t?(0,r.jsx)(i.zxk,{variant:"ghost",state:"waiting",children:(0,r.jsx)(a.c_L,{})}):"bucket"===n?(0,r.jsx)(f.s,{name:o}):"directory"===n?(0,r.jsx)(l.I,{path:u,size:c}):(0,r.jsx)(s.e,{path:u})}},{id:"name",label:"name",category:"general",render:function(e){let{data:{path:t,name:n,type:a}}=e,{setFileNamePrefixFilter:o}=(0,h.b)(),s=(0,p.kj)(t).slice(1);return"bucket"===a?(0,r.jsx)(i.xvT,{ellipsis:!0,color:"accent",weight:"semibold",className:"cursor-pointer",children:n}):"directory"===a?(0,r.jsx)(i.xvT,{ellipsis:!0,color:"accent",weight:"semibold",className:"cursor-pointer",onClick:e=>{e.stopPropagation(),o((0,p.rj)(s))},children:s}):(0,r.jsx)(i.xvT,{ellipsis:!0,weight:"semibold",className:"cursor-pointer",onClick:e=>{e.stopPropagation(),o((0,p.rj)(s))},children:s})}},{id:"readAccess",label:"public read access",contentClassName:"justify-center",render:function(e){var t,n;let{data:o}=e;if(".."===o.name)return null;let s=null===(n=o.bucket)||void 0===n?void 0:null===(t=n.policy)||void 0===t?void 0:t.publicReadAccess;return(0,r.jsx)(i.ua7,{content:s?"The bucket policy allows public read access.":"The bucket policy only allows private read access.",children:(0,r.jsx)("div",{children:(0,r.jsx)(i.zxk,{variant:"ghost",state:"waiting",children:(0,r.jsx)(i.xvT,{color:s?"contrast":"verySubtle",className:"flex gap-0.5 items-center",children:s?(0,r.jsx)(a.nDH,{}):(0,r.jsx)(a.Lur,{})})})})})}},{id:"size",label:"size",contentClassName:"justify-end",render:function(e){let{data:{type:t,name:n,size:a,isUploading:s}}=e;return"bucket"===t?null:s?(0,r.jsx)(i.xgg,{}):".."===n?null:(0,r.jsx)(i.m2c,{size:"12",value:new(c())(a),variant:"value",color:"subtle",weight:"regular",format:e=>(0,o.vW)(e.toNumber())})}},{id:"health",label:"health",contentClassName:"justify-center",render:function(e){let{data:t}=e;return"bucket"===t.type?null:(0,r.jsx)(d.z,{...t})}}]},43385:function(e,t,n){"use strict";n.d(t,{p:function(){return p},o:function(){return h}});var r=n(52322),i=n(36655),a=n(2784),o=n(57016),s=n(37371),l=n(5632),u=n(41736),c=n(9338),d=n(33351);let f=(0,a.createContext)({}),h=()=>(0,a.useContext)(f);function p(e){let{children:t}=e,n=function(){var e,t;let{sortDirection:n,sortField:r,filters:f,enabledColumns:h}=(0,u.b)(),{limit:p,response:m,refresh:v,dataset:g}=function(e){var t;let{sortDirection:n,sortField:r}=e,{activeBucketName:i,fileNamePrefixFilter:d}=(0,u.b)(),f=(0,l.useRouter)(),h=Number(f.query.limit||50),p=f.query.marker,m=(0,a.useMemo)(()=>{let e={bucket:i,sortBy:r,sortDir:n,marker:p,limit:h};return d&&(e.prefix=d.startsWith("/")?d:"/"+d),e},[i,d,r,n,p,h]),v=(0,o.SD)({disabled:!i,payload:m,config:{swr:{refreshInterval:c.h}}}),g=(0,s.p)({objects:{isValidating:v.isValidating,data:null===(t=v.data)||void 0===t?void 0:t.objects}});return{limit:h,marker:p,response:v,dataset:g.data,refresh:v.mutate}}({sortField:r,sortDirection:n}),y=null===(e=m.data)||void 0===e?void 0:e.nextMarker,b=null===(t=m.data)||void 0===t?void 0:t.hasMore,x=(0,a.useMemo)(()=>g,[g]);return{dataState:(0,i.c2j)(g,m.isValidating,m.error,f),refresh:v,limit:p,datasetPage:x,columns:(0,a.useMemo)(()=>d.z.filter(e=>e.fixed||h.includes(e.id)),[h]),nextMarker:y,isMore:b,pageCount:(null==g?void 0:g.length)||0,sortField:r,filters:f,sortDirection:n}}();return(0,r.jsx)(f.Provider,{value:n,children:t})}},37371:function(e,t,n){"use strict";n.d(t,{p:function(){return u}});var r=n(67693),i=n(69046),a=n(79381),o=n(76838),s=n(70899),l=n(41736);function u(e){let{objects:t}=e,{activeBucket:n,activeBucketName:u,fileNamePrefixFilter:c,uploadsList:d,sortDirection:f,sortField:h,activeDirectoryPath:p,buckets:m,setActiveDirectory:v}=(0,l.b)(),{dataset:g}=(0,o.G)();return(0,a.ZP)(t.isValidating||m.isValidating?null:[t.data,d,g,m.data,u,p],()=>{var e,a;let o={};n?t.data&&(null===(a=t.data)||void 0===a||a.forEach(e=>{let{name:t,size:r,health:i}=e,a=(0,s.v_)(u,t),l=(0,s.vt)(t);o[a]={id:a,path:a,bucket:n,size:r,health:i,name:l,onClick:(0,s.IQ)(t)?()=>{v(e=>e.concat(l.slice(0,-1)))}:void 0,type:(0,s.IQ)(t)?"directory":"file"}}),d.filter(e=>{let{path:t,name:n}=e;return t===(0,s.v_)(p,n)}).filter(e=>{let{path:t}=e;return t.startsWith((0,s.v_)(u,c))}).forEach(e=>{o[e.path]=e})):null===(e=m.data)||void 0===e||e.forEach(e=>{let t=e.name,n=(0,s.YF)(t,"");o[t]={id:n,path:n,bucket:e,size:0,health:0,name:t,onClick:()=>{v(e=>e.concat(t))},type:"bucket"}});let l=(0,r.Z)((0,i.Z)(o).map(e=>e[1]),h);return"desc"===f&&l.reverse(),l},{keepPreviousData:!0})}},41736:function(e,t,n){"use strict";n.d(t,{e:function(){return el},b:function(){return es}});var r=n(52322),i=n(36655),a=n(99605),o=n(2784),s=n(72199),l=n(3077),u=n(70899),c=n(57016),d=n(88744);function f(e,t,n){if(!t.has(e))throw TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function h(e,t){var n=f(e,t,"get");return n.get?n.get.call(e):n.value}function p(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function m(e,t,n){p(e,t),t.set(e,n)}function v(e,t,n){var r=f(e,t,"set");return!function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw TypeError("attempted to set read only private field");t.value=n}}(e,r,n),n}function g(e,t,n){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return n}function y(e,t){p(e,t),t.add(e)}var b=n(10363),x=new WeakMap,w=new WeakMap,j=new WeakMap,k=new WeakMap,E=new WeakMap,S=new WeakMap,C=new WeakMap,_=new WeakMap,O=new WeakMap,M=new WeakMap,T=new WeakMap,A=new WeakMap,P=new WeakMap,N=new WeakMap,R=new WeakMap,D=new WeakMap,L=new WeakMap,Z=new WeakMap,F=new WeakMap,z=new WeakMap,V=new WeakMap,I=new WeakMap,B=new WeakSet,H=new WeakSet,U=new WeakSet,W=new WeakSet,q=new WeakSet,$=new WeakSet;class K{async create(){var e;let t={bucket:h(this,x),generateKey:!0,path:h(this,w)};return v(this,Z,null===(e=(await h(this,_).post({payload:t})).data)||void 0===e?void 0:e.uploadID),v(this,D,Array.from({length:Math.ceil(h(this,j).size/h(this,k))},(e,t)=>t+1)),h(this,Z)}async start(){let e=new Promise(e=>{v(this,P,e)});g(this,B,Y).call(this),await e}async abort(){v(this,F,!0),Object.keys(h(this,R)).map(Number).forEach(e=>{h(this,R)[e].abort()});try{await h(this,O).post({payload:{bucket:h(this,x),path:h(this,w),uploadID:h(this,Z)}})}catch(e){(0,i.OHV)(e.message)}}setOnProgress(e){v(this,M,e)}setOnError(e){v(this,T,e)}setOnComplete(e){v(this,A,e)}constructor(e){y(this,B),y(this,H),y(this,U),y(this,W),y(this,q),y(this,$),m(this,x,{writable:!0,value:void 0}),m(this,w,{writable:!0,value:void 0}),m(this,j,{writable:!0,value:void 0}),m(this,k,{writable:!0,value:void 0}),m(this,E,{writable:!0,value:void 0}),m(this,S,{writable:!0,value:void 0}),m(this,C,{writable:!0,value:void 0}),m(this,_,{writable:!0,value:void 0}),m(this,O,{writable:!0,value:void 0}),m(this,M,{writable:!0,value:void 0}),m(this,T,{writable:!0,value:void 0}),m(this,A,{writable:!0,value:void 0}),m(this,P,{writable:!0,value:void 0}),m(this,N,{writable:!0,value:void 0}),m(this,R,{writable:!0,value:void 0}),m(this,D,{writable:!0,value:void 0}),m(this,L,{writable:!0,value:void 0}),m(this,Z,{writable:!0,value:void 0}),m(this,F,{writable:!0,value:void 0}),m(this,z,{writable:!0,value:void 0}),m(this,V,{writable:!0,value:void 0}),m(this,I,{writable:!0,value:void 0}),v(this,z,500),v(this,V,6e4),v(this,I,h(this,z)),v(this,x,e.bucket),v(this,w,e.path),v(this,k,e.partSize||5242880),v(this,E,Math.min(e.maxConcurrentParts||5,15)),v(this,j,e.file),v(this,S,e.apiWorkerUploadPart),v(this,O,e.apiBusUploadAbort),v(this,C,e.apiBusUploadComplete),v(this,_,e.apiBusUploadCreate),v(this,M,e.onProgress||(()=>null)),v(this,T,e.onError||(()=>null)),v(this,A,e.onComplete||(()=>null)),v(this,N,{}),v(this,R,{}),v(this,D,[]),v(this,L,[]),v(this,Z,null),v(this,F,!1)}}async function Y(){if(h(this,F))return;let e=Object.keys(h(this,R)).length;if(e>=h(this,E))return;if(!h(this,D).length){e||g(this,W,Q).call(this);return}let t=h(this,D).pop(),n=(t-1)*h(this,k),r=h(this,j).slice(n,n+h(this,k));try{await g(this,$,ee).call(this,t,r,n,()=>{g(this,B,Y).call(this)}),g(this,H,X).call(this)}catch(e){if("canceled"===e.name)return;h(this,D).push(t),await g(this,U,G).call(this)}g(this,B,Y).call(this)}function X(){v(this,I,h(this,z))}async function G(){let e=(0,b.gw)(h(this,I));v(this,I,Math.min(2*h(this,I),h(this,V))),await e}async function Q(){try{let e={bucket:h(this,x),path:h(this,w),uploadID:h(this,Z),parts:h(this,L).sort((e,t)=>e.partNumber-t.partNumber)};await h(this,C).post({payload:e}),h(this,A).call(this)}catch(e){h(this,T).call(this,e)}h(this,P).call(this)}function J(e,t){h(this,N)[e]=t.loaded;let n=Math.min(Object.keys(h(this,N)).map(Number).reduce((e,t)=>e+=h(this,N)[t],0),h(this,j).size),r=h(this,j).size;h(this,M).call(this,{sent:n,total:r,percentage:Math.round(n/r*100)})}async function ee(e,t,n,r){let i=new AbortController;h(this,R)[e]=i,r();try{let r=await h(this,S).put({params:{key:h(this,w).slice(1),bucket:h(this,x),uploadid:h(this,Z),offset:n,partnumber:e},payload:t,config:{axios:{onUploadProgress:t=>g(this,q,J).call(this,e,t),signal:i.signal}}});if(r.error)throw Error(r.error);let a=r.headers.etag;if(!a)throw Error("No ETag in response, add ETag to Access-Control-Expose-Headers list");let o={partNumber:e,eTag:a.replace(/"/g,"")};h(this,L).push(o),delete h(this,R)[e]}catch(t){throw delete h(this,R)[e],t}}var et=n(21487),en=n(91157);let er=e=>(0,et.B$)(4).times(e);var ei=n(98334),ea=n(92762);let eo=(0,o.createContext)({}),es=()=>(0,o.useContext)(eo);function el(e){let{children:t}=e,n=function(){var e;let{configurableColumns:t,enabledColumns:n,sortableColumns:r,toggleColumnVisibility:f,setColumnsVisible:h,setColumnsHidden:p,toggleSort:m,setSortDirection:v,setSortField:g,sortField:y,sortDirection:x,resetDefaultColumnVisibility:w}=(0,i.oy6)("renterd/v0/objects",{columns:s.z,columnsDefaultVisible:l.gd,sortOptions:l.Fo,defaultSortField:l.nw}),j=(0,a.xj)(),k=(0,a.UO)(),E=null==k?void 0:k.bucket,{filters:S,setFilter:C,removeFilter:_,removeLastFilter:O,resetFilters:M}=(0,i.Uu5)(),T=(0,o.useMemo)(()=>{var e;return(null===(e=S.find(e=>"fileNamePrefix"===e.id))||void 0===e?void 0:e.value)||""},[S]),A=(0,o.useMemo)(()=>E?[E,...((null==k?void 0:k.path)||[]).map(decodeURIComponent)]:[],[E,null==k?void 0:k.path]),P=(0,c.B$)(),N=null===(e=P.data)||void 0===e?void 0:e.find(e=>e.name===E),R=(0,o.useMemo)(()=>(0,u.rd)(A)+"/",[A]),[D,L]=(0,ea.Z)("renterd/v0/explorerMode",{defaultValue:"directory"}),Z=(0,o.useCallback)(e=>{let t=e(A);if(0===t.length){j.push(ei._.buckets.index);return}let n=ei._.buckets.files.replace("[bucket]",t[0]).replace("[path]",t.slice(1).map(encodeURIComponent).join("/"));j.push(n)},[j,A]),{uploadFiles:F,uploadsMap:z,uploadsList:V}=function(e){let{activeDirectoryPath:t}=e,n=(0,c.B$)(),r=(0,b.Tu)(),a=(0,c.Pt)(),s=(0,c._3)(),l=(0,c.eM)(),f=(0,c.LS)(),[h,p]=(0,o.useState)({}),m=(0,en.w)({config:{swr:{refreshInterval:(0,i.sWj)(1)}}}),v=(0,o.useRef)({checkAndStartUploads:()=>null}),g=(0,o.useCallback)(e=>{let{id:t}=e;p(e=>({...e,[t]:{...e[t],uploadStatus:"uploading",loaded:0}}))},[p]),y=(0,o.useCallback)(e=>{p(t=>t[e.id]?{...t,[e.id]:{...t[e.id],loaded:e.loaded,uploadStatus:e.loaded===e.size?"processing":"uploading",size:e.size}}:t)},[p]),x=(0,o.useCallback)(e=>{p(t=>(delete t[e],{...t}))},[p]),w=(0,o.useCallback)(async e=>{var t;let{path:n,bucket:o,uploadFile:c}=e,h=new K({file:c,path:(0,u.kj)(n),bucket:o.name,apiWorkerUploadPart:a,apiBusUploadComplete:s,apiBusUploadCreate:l,apiBusUploadAbort:f,partSize:er((null===(t=m.data)||void 0===t?void 0:t.minShards)||1).toNumber(),maxConcurrentParts:5}),p=await h.create();return h.setOnError(e=>{(0,i.OHV)(e.message),x(p)}),h.setOnProgress((0,d.Z)(e=>{y({id:p,loaded:e.sent,size:e.total})},1e3)),h.setOnComplete(async()=>{await r(e=>e.startsWith("/bus/objects")),x(p),setTimeout(()=>{v.current.checkAndStartUploads()},100)}),{uploadId:p,multipartUpload:h}},[f,s,l,a,r,y,x,m.data]),j=(0,o.useCallback)(async e=>{let{path:t,bucket:n,name:r,uploadFile:i}=e,{uploadId:a,multipartUpload:o}=await w({path:t,bucket:n,uploadFile:i});p(e=>({...e,[a]:{id:a,path:t,bucket:n,name:r,size:i.size,loaded:0,isUploading:!0,upload:o,uploadStatus:"queued",uploadFile:i,createdAt:new Date().toISOString(),uploadAbort:async()=>{await o.abort(),x(a)},type:"file"}}))},[p,w,x]),k=(0,o.useCallback)(async e=>{let{id:t,upload:n}=e;g({id:t}),n.start()},[g]),E=(0,o.useCallback)(()=>{let e=Object.values(h),t=e.filter(e=>"uploading"===e.uploadStatus).length;return e.filter(e=>"queued"===e.uploadStatus).slice(0,5-t).forEach(e=>{k({id:e.id,upload:e.upload})}),h},[h,k]),S=(0,o.useCallback)(e=>{e.forEach(e=>{var r,a,o;let s=e.path||e.name,l=(0,u.v_)(t,s),c=e.name,d=(0,u.ru)(l),f=null===(r=n.data)||void 0===r?void 0:r.find(e=>e.name===d);h[l]&&((0,i.OHV)("Already uploading file: ".concat(l,", aborting previous upload.")),null===(a=(o=h[l]).uploadAbort)||void 0===a||a.call(o)),j({path:l,name:c,bucket:f,uploadFile:e})}),setTimeout(()=>{v.current.checkAndStartUploads()},1e3)},[t,j,n.data,h]);v.current={checkAndStartUploads:E};let C=(0,o.useMemo)(()=>Object.entries(h).map(e=>e[1]),[h]);return!function(e){let{uploadsMap:t}=e;(0,o.useEffect)(()=>{let e=Object.values(t).filter(e=>"uploading"===e.uploadStatus),n=t=>{if(e.length>0){let n="Warning, closing the tab will abort all ".concat(e.length," active uploads.");return t.returnValue=n,n}};return e.length>0&&window.addEventListener("beforeunload",n),()=>{window.removeEventListener("beforeunload",n)}},[t])}({uploadsMap:h}),{uploadFiles:S,uploadsMap:h,uploadsList:C}}({activeDirectoryPath:R}),{downloadFiles:I,downloadsList:B,getFileUrl:H,downloadCancel:U}=function(){let e=(0,c.B$)(),t=(0,c.p$)(),[n,r]=(0,o.useState)({}),a=(0,o.useCallback)(e=>{r(t=>({...t,[e.path]:{id:e.path,path:e.path,bucket:e.bucket,name:e.name,size:e.size,loaded:e.loaded,isUploading:!1,controller:e.controller,type:"file"}}))},[r]),s=(0,o.useCallback)(e=>{r(t=>t[e.path]?{...t,[e.path]:{...t[e.path],path:e.path,loaded:e.loaded,size:e.size}}:t)},[r]),l=(0,o.useCallback)(e=>{r(t=>(delete t[e],{...t}))},[r]),f=(0,o.useCallback)(e=>{e.controller.abort()},[]),h=async r=>{r.forEach(async r=>{var o;let c=!1,f=(0,u.ru)(r),h=null===(o=e.data)||void 0===o?void 0:o.find(e=>e.name===f),p=(0,u.vt)(r);if(n[r]){(0,i.OHV)("Already downloading file: ".concat(r));return}let m=new AbortController,v=(0,d.Z)(e=>{c||s({path:r,loaded:e.loaded,size:e.total})},2e3);a({path:r,name:p,bucket:h,loaded:0,size:1,controller:m});let g=await t.get(p,{params:(0,u.W0)(r),config:{axios:{onDownloadProgress:v,signal:m.signal}}});c=!0,g.error&&("canceled"===g.error?(0,i.RFt)("File download canceled."):(0,i.OHV)(g.error)),l(r)})},p=(0,o.useMemo)(()=>Object.entries(n).map(e=>e[1]),[n]),{settings:m}=(0,b.Hv)();return{downloadFiles:h,downloadsList:p,getFileUrl:(0,o.useCallback)((e,t)=>{let{bucket:n,key:r}=(0,u.W0)(e),i="/worker/objects/".concat(r,"?bucket=").concat(n),a=m.api||location.origin,o=a.startsWith("https")?"https":"http",s=a.replace("https://","").replace("http://","");return t?"".concat(o,"://:").concat(m.password,"@").concat(s,"/api").concat(i):"".concat(o,"://").concat(s,"/api").concat(i)},[m]),downloadCancel:f}}(),W=0===A.length,q=1===A.length,$=A.length>0,Y=(0,o.useCallback)(e=>{C({id:"fileNamePrefix",label:"",value:e})},[C]),X=(0,o.useCallback)(()=>{_("fileNamePrefix")},[_]),G=(0,o.useCallback)((e,t)=>{t?Y(t):X(),Z(()=>e)},[Z,Y,X]),Q=(0,o.useCallback)(e=>{G((0,u.gD)(e),(0,u.vt)(e))},[G]),J=(0,o.useCallback)(e=>{"directory"===D?Q(e):Y((0,u.kj)(e).slice(1))},[D,Q,Y]),ee=(0,o.useCallback)(async()=>{"directory"!==D&&(G([E],void 0),L("directory"))},[D,E,L,G]),et=(0,o.useCallback)(async()=>{"flat"!==D&&(G([E],(0,u.kj)(R).slice(1)),L("flat"))},[D,E,R,L,G]);return{isViewingBuckets:W,isViewingABucket:$,isViewingRootOfABucket:q,buckets:P,activeBucket:N,activeBucketName:E,activeDirectory:A,setActiveDirectory:Z,setActiveDirectoryAndFileNamePrefix:G,activeDirectoryPath:R,navigateToModeSpecificFiltering:J,uploadFiles:F,uploadsMap:z,uploadsList:V,downloadFiles:I,downloadsList:B,downloadCancel:U,configurableColumns:t,enabledColumns:n,sortableColumns:r,toggleColumnVisibility:f,setColumnsVisible:h,setColumnsHidden:p,toggleSort:m,setSortDirection:v,setSortField:g,sortField:y,filters:S,fileNamePrefixFilter:T,setFileNamePrefixFilter:Y,setFilter:C,removeFilter:_,removeLastFilter:O,resetFilters:M,sortDirection:x,resetDefaultColumnVisibility:w,getFileUrl:H,activeExplorerMode:D,setExplorerModeDirectory:ee,setExplorerModeFlat:et}}();return(0,r.jsx)(eo.Provider,{value:n,children:t})}},3077:function(e,t,n){"use strict";n.d(t,{Fo:function(){return a},gd:function(){return r},nw:function(){return i}});let r=["type","name","readAccess","size","health"],i="name",a=[{id:"name",label:"name",category:"general"},{id:"health",label:"health",category:"general"},{id:"size",label:"size",category:"general"}]},56328:function(e,t,n){"use strict";n.d(t,{x:function(){return L},l:function(){return D}});var r,i,a=n(52322),o=n(36655),s=n(57016),l=n(2784);let u=["allow","netAddress","publicKey","lastScan","lastAnnouncement","totalScans","uptime","hasContract","ap_usable","ap_scoreOverall"];var c=n(5632),d=n(61020),f=n(21487),h=n(29193),p=n(62650),m=n(32998),v=n(17448),g=n(10363),y=n(6391),b=n.n(y);let x=[{id:"actions",label:"",fixed:!0,category:"general",cellClassName:"w-[50px] !pl-2 !pr-4 [&+*]:!pl-0",render:e=>{let{data:t}=e;return(0,a.jsx)(v.G,{address:t.netAddress,publicKey:t.publicKey})}},{id:"allow",label:"allowed",category:"general",contentClassName:"justify-center",render:function(e){var t;let{data:n}=e,r=!!(null===(t=(0,s.s2)({config:{swr:{dedupingInterval:5e3}}}).data)||void 0===t?void 0:t.length);return(0,a.jsx)(o.ua7,{side:"right",content:(r?"Allowlist ".concat(n.isOnAllowlist?"allows this host.":"does not allow this host."):"Allowlist is inactive.")+" Blocklist ".concat(n.isOnBlocklist?"blocks this host.":"does not block this host."),children:(0,a.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,a.jsx)("div",{className:"mt-[5px]",children:(0,a.jsx)(o.xvT,{color:n.isBlocked?"red":"green",children:n.isBlocked?(0,a.jsx)(d.SmH,{}):(0,a.jsx)(d.DI$,{})})}),(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)(o.xvT,{size:"10",color:n.isOnBlocklist?"red":"verySubtle",noWrap:!0,children:"Blocklist"}),(0,a.jsx)(o.xvT,{size:"10",color:r?n.isOnAllowlist?"green":"red":"verySubtle",noWrap:!0,children:"Allowlist"})]})]})})}},{id:"ap_usable",label:"usable",category:"autopilot",render:e=>{let{data:t,context:n}=e;return n.isAutopilotConfigured?(0,a.jsx)(o.ua7,{side:"right",content:t.usable?"Host is usable":"Host is not usable",children:(0,a.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,a.jsx)("div",{className:"mt-[5px]",children:(0,a.jsx)(o.xvT,{color:t.usable?"green":"red",children:t.usable?(0,a.jsx)(d.DI$,{}):(0,a.jsx)(d.SmH,{})})}),(0,a.jsx)("div",{className:"flex flex-col",children:t.unusableReasons.map(e=>(0,a.jsx)(o.xvT,{size:"10",noWrap:!0,children:e},e))})]})}):(0,a.jsx)(o.ua7,{side:"right",content:"Autopilot is not configured",children:(0,a.jsx)("div",{className:"mt-[5px]",children:(0,a.jsx)(o.xvT,{color:"subtle",children:(0,a.jsx)(d.I98,{})})})})}},{id:"ap_gouging",label:"gouging",category:"autopilot",render:e=>{let{data:t,context:n}=e;return n.isAutopilotConfigured?(0,a.jsx)(o.ua7,{side:"right",content:t.gouging?"Host is price gouging":"Host is not price gouging",children:(0,a.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,a.jsx)("div",{className:"mt-[5px]",children:(0,a.jsx)(o.xvT,{color:t.gouging?"red":"subtle",children:t.gouging?(0,a.jsx)(d.SmH,{}):(0,a.jsx)(d.I98,{})})}),(0,a.jsx)("div",{className:"flex flex-col",children:Object.entries(t.gougingBreakdown).filter(e=>{let[t,n]=e;return n&&"string"==typeof n}).map(e=>{let[t,n]=e;return(0,a.jsx)(o.xvT,{size:"10",noWrap:!0,children:n},t)})})]})}):(0,a.jsx)(o.ua7,{side:"right",content:"Autopilot is not configured",children:(0,a.jsx)("div",{className:"mt-[5px]",children:(0,a.jsx)(o.xvT,{color:"subtle",children:(0,a.jsx)(d.I98,{})})})})}},{id:"lastScan",label:"last scan",category:"general",render:function(e){let{data:t}=e,{workflows:n}=(0,g.D)();if(n.find(e=>{var n;return e.path.startsWith(s.RF)&&(null===(n=e.payload)||void 0===n?void 0:n.hostKey)===t.publicKey}))return(0,a.jsx)(o.xgg,{});let r=(0,h.Z)(new Date(t.lastScan||0),new Date,{addSuffix:!0}),i="",l=null,u="subtle";return t.lastScan||(i="host has not been scanned",l=(0,a.jsx)(d.I98,{}),u="subtle"),t.lastScan&&!t.lastScanSuccess&&(i="host scan failed ".concat(r),l=(0,a.jsx)(d.SmH,{}),u="red"),t.lastScan&&t.lastScanSuccess&&(i="host scan succeeded ".concat(r),l=(0,a.jsx)(d.DI$,{}),u="green"),(0,a.jsx)(o.ua7,{side:"right",content:i,children:(0,a.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,a.jsx)("div",{className:"mt-[5px]",children:(0,a.jsx)(o.xvT,{color:u,children:l})}),t.lastScan&&(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)(o.xvT,{size:"12",noWrap:!0,children:r}),(0,a.jsx)(o.xvT,{color:"subtle",size:"10",noWrap:!0,children:(0,p.Z)(new Date(t.lastScan),"Pp")})]})]})})}},{id:"hasContract",label:"active contract",category:"general",contentClassName:"w-[50px]",render:e=>{let{data:t}=e,n=t.activeContractsCount.gt(0);return(0,a.jsx)(o.ua7,{side:"right",content:n?"Host has active contract":"Host does not have an active contract",children:(0,a.jsx)("div",{className:"mt-[5px]",children:(0,a.jsx)(o.xvT,{color:n?"green":"subtle",children:n?(0,a.jsx)(d.DI$,{}):(0,a.jsx)(d.I98,{})})})})}},{id:"netAddress",label:"address",category:"general",render:e=>{let{data:t,context:n}=e;return(0,a.jsx)(o.XxW,{value:t.netAddress,size:"12",type:"hostIp",siascanUrl:n.siascanUrl})}},{id:"publicKey",label:"public key",category:"general",render:e=>{let{data:t,context:n}=e;return(0,a.jsx)(o.XxW,{value:t.publicKey,size:"12",type:"hostPublicKey",siascanUrl:n.siascanUrl})}},{id:"lastAnnouncement",label:"last announcement",category:"general",render:e=>{let{data:t}=e;return t.lastAnnouncement?(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsxs)(o.xvT,{size:"12",noWrap:!0,children:[(0,h.Z)(new Date,new Date(t.lastAnnouncement))," ago"]}),(0,a.jsx)(o.xvT,{color:"subtle",size:"10",noWrap:!0,children:(0,m.Z)(new Date(t.lastAnnouncement),new Date)})]}):null}},{id:"totalScans",label:"total scans",category:"general",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t}=e;return(0,a.jsx)(o.m2c,{size:"12",value:t.totalScans,variant:"value",format:e=>(0,f.yF)(e.toNumber())})}},{id:"uptime",label:"uptime",category:"general",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t}=e;return(0,a.jsx)(o.m2c,{size:"12",value:t.uptime.div(1e9).div(60).div(60).div(24),variant:"value",format:e=>(0,f.yF)(e,{fixed:e.isZero()?0:2,units:"days"})})}},{id:"downtime",label:"downtime",category:"general",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t}=e;return(0,a.jsx)(o.m2c,{size:"12",value:t.downtime.div(1e9).div(60).div(60).div(24),variant:"value",format:e=>(0,f.yF)(e,{fixed:e.isZero()?0:2,units:"days"})})}},{id:"totalInteractions",label:"total interactions",category:"general",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t}=e;return(0,a.jsx)(o.m2c,{size:"12",value:t.totalInteractions,variant:"value",format:e=>(0,f.yF)(e)})}},{id:"successfulInteractions",label:"successful interactions",category:"general",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t}=e;return(0,a.jsx)(o.m2c,{size:"12",value:t.successfulInteractions,variant:"value",format:e=>(0,f.yF)(e.toNumber())})}},{id:"failedInteractions",label:"failed interactions",category:"general",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t}=e;return(0,a.jsx)(o.m2c,{size:"12",value:t.failedInteractions,variant:"value",format:e=>(0,f.yF)(e.toNumber())})}},{id:"contractCount",label:"contract count",category:"general",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t}=e;return(0,a.jsx)(o.m2c,{size:"12",value:t.activeContractsCount,variant:"value",format:e=>(0,f.yF)(e.toNumber())})}},{id:"ap_scoreOverall",label:"overall score",category:"autopilot",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t,context:n}=e;return n.isAutopilotConfigured?(0,a.jsx)(o.m2c,{size:"12",value:t.score,variant:"value",format:e=>e.toPrecision(2)}):(0,a.jsx)(o.ua7,{content:"Autopilot is not configured",children:(0,a.jsx)(o.xvT,{color:"verySubtle",children:"-"})})}},{id:"ap_scoreAge",label:"age score",category:"autopilot",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t,context:n}=e;return n.isAutopilotConfigured?(0,a.jsx)(o.m2c,{size:"12",value:t.scoreBreakdown.age,variant:"value",format:e=>e.toPrecision(2)}):(0,a.jsx)(o.ua7,{content:"Autopilot is not configured",children:(0,a.jsx)(o.xvT,{color:"verySubtle",children:"-"})})}},{id:"ap_scoreCollateral",label:"collateral score",category:"autopilot",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t,context:n}=e;return n.isAutopilotConfigured?(0,a.jsx)(o.m2c,{size:"12",value:t.scoreBreakdown.collateral,variant:"value",format:e=>e.toPrecision(2)}):(0,a.jsx)(o.ua7,{content:"Autopilot is not configured",children:(0,a.jsx)(o.xvT,{color:"verySubtle",children:"-"})})}},{id:"ap_scoreInteractions",label:"interactions score",category:"autopilot",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t,context:n}=e;return n.isAutopilotConfigured?(0,a.jsx)(o.m2c,{size:"12",value:t.scoreBreakdown.interactions,variant:"value",format:e=>e.toPrecision(2)}):(0,a.jsx)(o.ua7,{content:"Autopilot is not configured",children:(0,a.jsx)(o.xvT,{color:"verySubtle",children:"-"})})}},{id:"ap_scorePrices",label:"prices score",category:"autopilot",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t,context:n}=e;return n.isAutopilotConfigured?(0,a.jsx)(o.m2c,{size:"12",value:t.scoreBreakdown.prices,variant:"value",format:e=>e.toPrecision(2)}):(0,a.jsx)(o.ua7,{content:"Autopilot is not configured",children:(0,a.jsx)(o.xvT,{color:"verySubtle",children:"-"})})}},{id:"ap_scoreStorageRemaining",label:"storage remaining score",category:"autopilot",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t,context:n}=e;return n.isAutopilotConfigured?(0,a.jsx)(o.m2c,{size:"12",value:t.scoreBreakdown.storageRemaining,variant:"value",format:e=>e.toPrecision(2)}):(0,a.jsx)(o.ua7,{content:"Autopilot is not configured",children:(0,a.jsx)(o.xvT,{color:"verySubtle",children:"-"})})}},{id:"ap_scoreUptime",label:"uptime score",category:"autopilot",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t,context:n}=e;return n.isAutopilotConfigured?(0,a.jsx)(o.m2c,{size:"12",value:t.scoreBreakdown.uptime,variant:"value",format:e=>e.toPrecision(2)}):(0,a.jsx)(o.ua7,{content:"Autopilot is not configured",children:(0,a.jsx)(o.xvT,{color:"verySubtle",children:"-"})})}},{id:"ap_scoreVersion",label:"version score",category:"autopilot",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t,context:n}=e;return n.isAutopilotConfigured?(0,a.jsx)(o.m2c,{size:"12",value:t.scoreBreakdown.version,variant:"value",format:e=>n.isAutopilotConfigured?"-":e.toPrecision(2)}):(0,a.jsx)(o.ua7,{content:"Autopilot is not configured",children:(0,a.jsx)(o.xvT,{color:"verySubtle",children:"-"})})}},{id:"hpt_accountbalancecost",label:"account balance cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","accountbalancecost")},{id:"hpt_collateralcost",label:"collateral cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","collateralcost")},{id:"hpt_contractprice",label:"contract price",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","contractprice")},{id:"hpt_downloadbandwidthcost",label:"download bandwidth cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","downloadbandwidthcost")},{id:"hpt_dropsectorsbasecost",label:"drop sectors base cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","dropsectorsbasecost")},{id:"hpt_dropsectorsunitcost",label:"drop sectors unit cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","dropsectorsunitcost")},{id:"hpt_expiry",label:"expiry",category:"priceTable",contentClassName:"w-[120px] justify-end",render:j("priceTable","dropsectorsunitcost")},{id:"hpt_fundaccountcost",label:"fund account cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","fundaccountcost")},{id:"hpt_hassectorbasecost",label:"has sector cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","hassectorbasecost")},{id:"hpt_hostblockheight",label:"host block height",category:"priceTable",contentClassName:"w-[120px] justify-end",render:j("priceTable","hostblockheight")},{id:"hpt_initbasecost",label:"init base cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","initbasecost")},{id:"hpt_latestrevisioncost",label:"latest revision cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","latestrevisioncost")},{id:"hpt_maxcollateral",label:"max collateral",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","maxcollateral")},{id:"hpt_maxduration",label:"max duration",category:"priceTable",contentClassName:"w-[120px] justify-end",render:j("priceTable","maxduration")},{id:"hpt_memorytimecost",label:"memory time cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","memorytimecost")},{id:"hpt_readbasecost",label:"read base cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","readbasecost")},{id:"hpt_readlengthcost",label:"read length cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","readlengthcost")},{id:"hpt_registryentriesleft",label:"registry entries left",category:"priceTable",contentClassName:"w-[120px] justify-end",render:j("priceTable","registryentriesleft")},{id:"hpt_registryentriestotal",label:"registry entries total",category:"priceTable",contentClassName:"w-[120px] justify-end",render:j("priceTable","registryentriestotal")},{id:"hpt_renewcontractcost",label:"renew contract cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","renewcontractcost")},{id:"hpt_revisionbasecost",label:"revision base cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","renewcontractcost")},{id:"hpt_subscriptionmemorycost",label:"subscription memory cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","subscriptionmemorycost")},{id:"hpt_subscriptionnotificationcost",label:"subscription notification cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","subscriptionnotificationcost")},{id:"hpt_swapsectorcost",label:"swap sector cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","swapsectorcost")},{id:"hpt_txnfeemaxrecommended",label:"txn fee max recommended",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","txnfeemaxrecommended")},{id:"hpt_txnfeeminrecommended",label:"txn fee min recommended",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","txnfeeminrecommended")},{id:"hpt_uid",label:"UID",category:"priceTable",contentClassName:"w-[120px] justify-end",render:k("priceTable","uid")},{id:"hpt_updatepricetablecost",label:"update price table cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","updatepricetablecost")},{id:"hpt_uploadbandwidthcost",label:"upload bandwidth cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","uploadbandwidthcost")},{id:"hpt_validity",label:"validity",category:"priceTable",contentClassName:"w-[120px] justify-end",render:j("priceTable","validity")},{id:"hpt_windowsize",label:"window size",category:"priceTable",contentClassName:"w-[120px] justify-end",render:j("priceTable","windowsize")},{id:"hpt_writebasecost",label:"write base cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","writebasecost")},{id:"hpt_writelengthcost",label:"write length cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","writelengthcost")},{id:"hpt_writestorecost",label:"write store cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","writestorecost")},{id:"hs_acceptingcontracts",label:"accepting contracts",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:(r="settings",i="acceptingcontracts",function(e){let{data:t}=e;return t[r]?(0,a.jsx)("div",{className:"mt-[5px]",children:(0,a.jsx)(o.xvT,{color:t[r][i]?"green":"red",children:t[r][i]?(0,a.jsx)(d.DI$,{}):(0,a.jsx)(d.SmH,{})})}):null})},{id:"hs_baserpcprice",label:"base RPC price",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:w("settings","baserpcprice")},{id:"hs_collateral",label:"collateral",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:w("settings","collateral")},{id:"hs_contractprice",label:"contract price",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:w("settings","contractprice")},{id:"hs_downloadbandwidthprice",label:"download bandwidth price",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:w("settings","downloadbandwidthprice")},{id:"hs_ephemeralaccountexpiry",label:"ephemeral account expiry",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:j("settings","ephemeralaccountexpiry")},{id:"hs_maxcollateral",label:"max collateral",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:w("settings","maxcollateral")},{id:"hs_maxdownloadbatchsize",label:"max download batch size",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:E("settings","maxdownloadbatchsize")},{id:"hs_maxduration",label:"max duration",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:j("settings","maxduration")},{id:"hs_maxephemeralaccountbalance",label:"max ephemeral account balance",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:w("settings","maxephemeralaccountbalance")},{id:"hs_maxrevisebatchsize",label:"max revise batch size",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:E("settings","maxrevisebatchsize")},{id:"hs_netaddress",label:"net address",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:k("settings","netaddress")},{id:"hs_remainingstorage",label:"remaining storage",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:E("settings","remainingstorage")},{id:"hs_revisionnumber",label:"revision number",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:j("settings","revisionnumber")},{id:"hs_sectoraccessprice",label:"sector access price",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:w("settings","sectoraccessprice")},{id:"hs_sectorsize",label:"sector size",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:E("settings","sectorsize")},{id:"hs_siamuxport",label:"siamux port",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:j("settings","siamuxport")},{id:"hs_storageprice",label:"storage price",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:w("settings","storageprice")},{id:"hs_totalstorage",label:"total storage",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:E("settings","totalstorage")},{id:"hs_unlockhash",label:"unlock hash",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:k("settings","unlockhash")},{id:"hs_uploadbandwidthprice",label:"upload bandwidth price",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:w("settings","uploadbandwidthprice")},{id:"hs_version",label:"verison",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:k("settings","version")},{id:"hs_windowsize",label:"window size",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:j("settings","windowsize")}].map(e=>({...e,..."autopilot"===e.category?{icon:(0,a.jsx)(d.n6M,{className:"relative opacity-50 scale-75"}),label:e.label,tip:"autopilot: ".concat(e.label)}:"hostSettings"===e.category?{icon:(0,a.jsx)(d.shL,{className:"relative top-px opacity-50 scale-75"}),label:e.label,tip:"host settings (RHPv2): ".concat(e.label)}:"priceTable"===e.category?{icon:(0,a.jsx)(d.B4q,{className:"relative top-px opacity-50 scale-75"}),label:e.label,tip:"price table (RHPv3): ".concat(e.label)}:{label:e.label,tip:e.label}}));function w(e,t){return(0,l.memo)(function(n){let{data:r}=n;return r[e]?(0,a.jsx)(o.ho9,{displayBoth:!0,size:"12",value:new(b())(r[e][t]||0),fixedFiat:4,variant:"value"}):null})}function j(e,t,n){return function(r){let{data:i}=r;return i[e]?(0,a.jsx)(o.m2c,{size:"12",value:new(b())(i[e][t]||0),variant:"value",format:e=>(0,f.yF)(e,{abbreviated:n})}):null}}function k(e,t){return function(n){let{data:r}=n;return r[e]?(0,a.jsx)(o.XxW,{value:r[e][t],size:"12"}):null}}function E(e,t){return function(n){let{data:r}=n;return r[e]?(0,a.jsx)(o.xvT,{size:"12",weight:"semibold",ellipsis:!0,children:(0,f.vW)(r[e][t])}):null}}var S=n(76838);function C(e,t){return{id:e.publicKey,netAddress:e.netAddress,publicKey:e.publicKey,lastScanSuccess:e.interactions.lastScanSuccess,lastScan:"0001-01-01T00:00:00Z"===e.interactions.lastScan?null:e.interactions.lastScan,knownSince:"0001-01-01T00:00:00Z"===e.knownSince?null:e.knownSince,lastAnnouncement:"0001-01-01T00:00:00Z"===e.lastAnnouncement?null:e.lastAnnouncement,uptime:new(b())(e.interactions.uptime||0),downtime:new(b())(e.interactions.downtime||0),successfulInteractions:new(b())(e.interactions.successfulInteractions||0),totalInteractions:new(b())(e.interactions.successfulInteractions+e.interactions.failedInteractions||0),failedInteractions:new(b())(e.interactions.failedInteractions||0),totalScans:new(b())(e.interactions.totalScans||0),activeContractsCount:new(b())((null==t?void 0:t.filter(t=>t.hostKey===e.publicKey).length)||0),activeContracts:(null==t?void 0:t.filter(t=>t.hostKey===e.publicKey))||[],priceTable:e.priceTable,settings:e.settings}}function _(e){let{host:t,allowlist:n,blocklist:r,isAllowlistActive:i}=e,a=!!(null==n?void 0:n.find(e=>e===t.publicKey)),o=!!(null==r?void 0:r.find(e=>{if(e===t.netAddress)return!0;try{let n=new URL("https://"+t.netAddress).hostname;return e===n}catch(e){return!1}}));return{isOnAllowlist:a,isOnBlocklist:o,isBlocked:o||!(!i||a)}}function O(e){return{score:new(b())((null==e?void 0:e.score)||0),scoreBreakdown:{age:new(b())((null==e?void 0:e.scoreBreakdown.age)||0),collateral:new(b())((null==e?void 0:e.scoreBreakdown.collateral)||0),interactions:new(b())((null==e?void 0:e.scoreBreakdown.interactions)||0),prices:new(b())((null==e?void 0:e.scoreBreakdown.prices)||0),storageRemaining:new(b())((null==e?void 0:e.scoreBreakdown.storageRemaining)||0),uptime:new(b())((null==e?void 0:e.scoreBreakdown.uptime)||0),version:new(b())((null==e?void 0:e.scoreBreakdown.version)||0)},gougingBreakdown:(null==e?void 0:e.gougingBreakdown)||{},gouging:null==e?void 0:e.gouging,unusableReasons:(null==e?void 0:e.unusableReasons)||[],usable:null==e?void 0:e.usable}}var M=n(46081),T=n(37769),A=n(82494),P=n(45178),N=n(9338);let R=(0,l.createContext)({}),D=()=>(0,l.useContext)(R);function L(e){let{children:t}=e,n=function(){var e,t,n,r,i,a,d;let f=(0,c.useRouter)(),[h,p]=(0,l.useState)("list"),m=Number(f.query.limit||50),v=Number(f.query.offset||0),{filters:y,setFilter:b,removeFilter:w,removeLastFilter:j,resetFilters:k}=(0,o.Uu5)(),{dataset:E}=(0,S.G)(),{autopilot:R}=(0,M.q)(),D=(0,l.useMemo)(()=>{let e=[];y.find(e=>"hasActiveContracts"===e.id)&&E&&(e=E.map(e=>e.hostKey));let t=y.find(e=>"publicKeyEquals"===e.id);return t&&e.push(null==t?void 0:t.value),e.length?e:void 0},[y,E]),L=(0,s.S0)({disabled:y.find(e=>"hasActiveContracts"===e.id)&&!E||"on"!==R.status,payload:{limit:m,offset:v,usabilityMode:(null===(e=y.find(e=>"usabilityMode"===e.id))||void 0===e?void 0:e.value)||"all",filterMode:(null===(t=y.find(e=>"filterMode"===e.id))||void 0===t?void 0:t.value)||"all",addressContains:null===(n=y.find(e=>"addressContains"===e.id))||void 0===n?void 0:n.value,keyIn:D},config:{swr:{errorRetryInterval:2e4,refreshInterval:N.h}}}),Z=(0,s.FV)({disabled:"off"!==R.status,payload:{limit:m,offset:v,filterMode:(null===(r=y.find(e=>"filterMode"===e.id))||void 0===r?void 0:r.value)||"all",addressContains:null===(i=y.find(e=>"addressContains"===e.id))||void 0===i?void 0:i.value,keyIn:y.find(e=>"hasActiveContracts"===e.id)&&E?E.map(e=>e.hostKey):void 0},config:{swr:{refreshInterval:N.h}}}),F=(0,s.s2)(),z=(0,s.uf)(),V=!!(null===(a=F.data)||void 0===a?void 0:a.length),{settings:I}=(0,g.Hv)(),B=(0,A.JL)({disabled:!I.siaCentral,config:{swr:{revalidateOnFocus:!1}}});(0,l.useEffect)(()=>{I.siaCentral||p("list")},[I.siaCentral]);let H=(0,l.useMemo)(()=>{var e;return(null===(e=B.data)||void 0===e?void 0:e.hosts)||[]},[B.data]),U=(0,l.useRef)(T.N),W=(0,l.useCallback)(e=>{U.current=e},[U]),[q,$]=(0,l.useState)(),K=(0,l.useCallback)(e=>{let t=document.getElementById(e),n=document.getElementById("scroll-hosts");t&&n&&n.scroll({top:t.offsetTop-50,behavior:"smooth"})},[]),Y=(0,l.useCallback)((e,t)=>{if(q===e){$(void 0);return}$(e),t&&U.current.moveToLocation(t),K(e)},[$,U,q,K]),X=(0,l.useCallback)((e,t)=>{if(q===e){$(void 0);return}$(e),t?U.current.moveToLocation(t):(0,o.OHV)("Geographic location is unknown for host ".concat((0,o.$Gg)(e,20))),K(e)},[$,U,q,K]),G=(0,l.useCallback)((e,t)=>null,[]),Q=function(e){let{autopilotStatus:t,regularResponse:n,autopilotResponse:r,allContracts:i,allowlist:a,blocklist:o,isAllowlistActive:s,geoHosts:u,onHostSelect:c}=e;return(0,l.useMemo)(()=>{var e,l;return"off"===t?(null===(e=n.data)||void 0===e?void 0:e.map(e=>{let t=u.find(t=>t.public_key===e.publicKey);return{onClick:()=>c(e.publicKey,null==t?void 0:t.location),...C(e,i),..._({host:e,allowlist:a.data,blocklist:o.data,isAllowlistActive:s}),...O(),location:null==t?void 0:t.location,countryCode:null==t?void 0:t.country_code}}))||null:"on"===t&&(null===(l=r.data)||void 0===l?void 0:l.map(e=>{let t=u.find(t=>t.public_key===e.host.publicKey);return{onClick:()=>c(e.host.publicKey,null==t?void 0:t.location),...C(e.host,i),..._({host:e.host,allowlist:a.data,blocklist:o.data,isAllowlistActive:s}),...O(e.checks),location:null==t?void 0:t.location,countryCode:null==t?void 0:t.country_code}}))||null},[c,t,n.data,r.data,i,a.data,o.data,s,u])}({autopilotStatus:R.status,autopilotResponse:L,regularResponse:Z,allContracts:E,allowlist:F,blocklist:z,isAllowlistActive:V,geoHosts:H,onHostSelect:X}),J=(0,l.useMemo)(()=>"off"===R.status?["autopilot"]:[],[R.status]),{configurableColumns:ee,enabledColumns:et,toggleColumnVisibility:en,setColumnsVisible:er,setColumnsHidden:ei,toggleSort:ea,setSortDirection:eo,setSortField:es,sortField:el,sortDirection:eu,resetDefaultColumnVisibility:ec}=(0,o.oy6)("renterd/v0/hosts",{columns:x,columnsDefaultVisible:u,disabledCategories:J}),ed=(0,l.useMemo)(()=>x.filter(e=>et.includes(e.id)),[et]),ef="on"===R.status?L.isValidating:Z.isValidating,eh="on"===R.status?L.error:Z.error,ep=(0,o.c2j)(Q,ef,eh,y),em=(0,P.B)(),ev=null===(d=R.state.data)||void 0===d?void 0:d.configured,eg=(0,l.useMemo)(()=>({isAutopilotConfigured:ev,siascanUrl:em}),[ev,em]),ey=(0,l.useMemo)(()=>null==Q?void 0:Q.filter(e=>e.location),[Q]);return{setCmd:W,viewMode:h,activeHost:(0,l.useMemo)(()=>null==Q?void 0:Q.find(e=>e.publicKey===q),[Q,q]),onHostMapHover:G,onHostMapClick:Y,setViewMode:p,hostsWithLocation:ey,error:eh,dataState:ep,offset:v,limit:m,pageCount:(null==Q?void 0:Q.length)||0,columns:ed,dataset:Q,tableContext:eg,configurableColumns:ee,enabledColumns:et,toggleColumnVisibility:en,setColumnsVisible:er,setColumnsHidden:ei,toggleSort:ea,setSortDirection:eo,setSortField:es,sortField:el,sortDirection:eu,resetDefaultColumnVisibility:ec,filters:y,setFilter:b,removeFilter:w,removeLastFilter:j,resetFilters:k}}();return(0,a.jsx)(R.Provider,{value:n,children:t})}},10569:function(e,t,n){"use strict";n.d(t,{Kg:function(){return a},jY:function(){return i}});var r=n(36655);let i={activeAndUsable:{colorHex:r.O9T.green[600],colorName:"green"},activeAndUnusable:{colorHex:r.O9T.amber[600],colorName:"amber"},potentialHost:{colorHex:r.O9T.blue[600],colorName:"blue"}};function a(e){return e.activeContractsCount.gt(0)&&!e.usable?{status:"activeAndUnusable",...i.activeAndUnusable}:e.activeContractsCount.gt(0)?{status:"activeAndUsable",...i.activeAndUsable}:{status:"potentialHost",...i.potentialHost}}},71367:function(e,t,n){"use strict";n.d(t,{f:function(){return y},E:function(){return g}});var r=n(52322),i=n(36655),a=n(5632),o=n(2784),s=n(33962),l=n(61020),u=n(57016),c=n(77248),d=n(13762),f=n(97112);function h(e){let{s3Key:t,contentProps:n,buttonProps:a}=e,{openConfirmDialog:s}=(0,f.Rh)(),h=(0,c.m)(),p=(0,u.KJ)(),m=(0,o.useCallback)(async()=>{var e;let n=(0,d.Z)(null===(e=h.data)||void 0===e?void 0:e.v4Keypairs,t),r=await p.put({params:{key:"s3authentication"},payload:{v4Keypairs:n}});r.error?(0,i.OHV)("Failed to delete key: ".concat(r.error)):(0,i.OPV)("Key ".concat(t," removed."))},[h.data,t,p]);return(0,r.jsxs)(i.h_2,{trigger:(0,r.jsx)(i.zxk,{variant:"ghost",icon:"hover",...a,children:(0,r.jsx)(l.iG7,{})}),contentProps:{align:"start",...n,onClick:e=>{e.stopPropagation()}},children:[(0,r.jsx)("div",{className:"px-1.5 py-1",children:(0,r.jsxs)(i.xvT,{size:"14",weight:"medium",color:"subtle",children:["Key ",t.slice(0,24),"..."]})}),(0,r.jsx)(i.Juw,{children:"Actions"}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{s({title:"Delete key ".concat((0,i.$Gg)(t,15)),action:"Remove",variant:"red",body:(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)(i.nvN,{size:"14",children:"Are you sure you would like to remove the following key?"}),(0,r.jsx)(i.nvN,{size:"14",font:"mono",children:(0,i.$Gg)(t,80)})]}),onConfirm:async()=>{m()}})},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(l.Jrl,{})}),"Delete key"]})]})}let p=[{id:"actions",label:"",fixed:!0,cellClassName:"w-[50px] !pl-2 !pr-4 [&+*]:!pl-0",render:e=>{let{data:{key:t}}=e;return(0,r.jsx)(h,{s3Key:t})}},{id:"key",label:"key",category:"general",render:e=>{let{data:{key:t}}=e;return(0,r.jsx)(i.XxW,{size:"12",value:t,label:"key",maxLength:80})}},{id:"secret",label:"secret",contentClassName:"w-[120px]",category:"general",render:e=>{let{data:{secret:t}}=e;return(0,r.jsx)(i.XxW,{size:"12",value:t,label:"key",maxLength:10,font:"mono"})}}];var m=n(9338);let v=(0,o.createContext)({}),g=()=>(0,o.useContext)(v);function y(e){let{children:t}=e,n=function(){let e=(0,a.useRouter)(),t=Number(e.query.limit||50),n=Number(e.query.offset||0),r=(0,c.m)({config:{swr:{refreshInterval:m.h}}}),l=(0,o.useMemo)(()=>{var e;return r.data?Object.entries((null===(e=r.data)||void 0===e?void 0:e.v4Keypairs)||{}).map(e=>{let[t,n]=e;return{id:t,key:t,secret:n}})||[]:null},[r.data]),{filters:u,setFilter:d,removeFilter:f,removeLastFilter:h,resetFilters:v}=(0,i.Wdu)(),{configurableColumns:g,enabledColumns:y,sortableColumns:b,toggleColumnVisibility:x,setColumnsVisible:w,setColumnsHidden:j,toggleSort:k,setSortDirection:E,setSortField:S,sortField:C,sortDirection:_,resetDefaultColumnVisibility:O}=(0,i.oy6)("renterd/v0/keys",{columns:p,columnsDefaultVisible:s.gd,sortOptions:s.Fo,defaultSortField:s.nw}),M=(0,i._4u)({dataset:l,filters:u,sortField:C,sortDirection:_}),T=(0,o.useMemo)(()=>M?M.slice(n,n+t):null,[M,n,t]),A=(0,o.useMemo)(()=>p.filter(e=>e.fixed||y.includes(e.id)),[y]),P=(0,i.c2j)(M,r.isValidating,r.error,u),N=(0,o.useMemo)(()=>({}),[]);return{dataState:P,limit:t,offset:n,isLoading:r.isLoading,error:r.error,pageCount:(null==T?void 0:T.length)||0,datasetCount:(null==l?void 0:l.length)||0,datasetFilteredCount:(null==M?void 0:M.length)||0,columns:A,dataset:l,cellContext:N,datasetPage:T,configurableColumns:g,enabledColumns:y,sortableColumns:b,toggleColumnVisibility:x,setColumnsVisible:w,setColumnsHidden:j,toggleSort:k,setSortDirection:E,setSortField:S,sortField:C,filters:u,setFilter:d,removeFilter:f,removeLastFilter:h,resetFilters:v,sortDirection:_,resetDefaultColumnVisibility:O}}();return(0,r.jsx)(v.Provider,{value:n,children:t})}},33962:function(e,t,n){"use strict";n.d(t,{Fo:function(){return a},gd:function(){return r},nw:function(){return i}});let r=["key","secret"],i="key",a=[{id:"key",label:"key",category:"general"},{id:"secret",label:"secret",category:"general"}]},40730:function(e,t,n){"use strict";n.d(t,{n:function(){return m},v:function(){return v}});var r=n(52322),i=n(36655),a=n(57016),o=n(2784),s=n(97112),l=n(6391),u=n.n(l),c=n(5632),d=n(45178),f=n(9338);let h=[],p=(0,o.createContext)({}),m=()=>(0,o.useContext)(p);function v(e){let{children:t}=e,n=function(){let e=(0,c.useRouter)(),t=Number(e.query.limit||50),n=Number(e.query.offset||0),r=(0,a.Qq)({params:{limit:t,offset:n},config:{swr:{refreshInterval:f.h}}}),l=(0,a.a0)({config:{swr:{refreshInterval:f.h}}}),{openDialog:p}=(0,s.Rh)(),m=(0,d.B)(),v=(0,o.useMemo)(()=>l.data&&r.data?[...(l.data||[]).map(e=>({type:"transaction",txType:(0,i.leQ)(e),unconfirmed:!0,siascanUrl:m})),...(r.data||[]).map(e=>({type:"transaction",txType:(0,i.leQ)(e.raw),hash:(0,i.I13)(e.id),timestamp:new Date(e.timestamp).getTime(),onClick:()=>p("transactionDetails",(0,i.I13)(e.id)),raw:e.raw,inflow:e.inflow,outflow:e.outflow,sc:new(u())(e.inflow).minus(e.outflow),siascanUrl:m})).sort((e,t)=>e.timestampnew Date(new Date().getTime()-30*b).toISOString(),[30,b]),w=(0,a.X1)({params:{start:x,interval:b,n:30}}),j=(0,o.useMemo)(()=>(w.data||[]).map(e=>({sc:new(u())(e.spendable).plus(e.unconfirmed).toNumber(),timestamp:new Date(e.timestamp).getTime()})).sort((e,t)=>e.timestamp>=t.timestamp?1:-1),[w.data]);return{dataset:v,error:g,dataState:y,offset:n,limit:t,pageCount:(null==v?void 0:v.length)||0,balances:j,metrics:w}}();return(0,r.jsx)(p.Provider,{value:n,children:t})}},88778:function(e,t,n){"use strict";n.d(t,{z:function(){return d}});var r=n(52322),i=n(36655),a=n(70899),o=n(26731),s=n(21487),l=n(32998),u=n(61020);function c(e){let{abort:t}=e;return(0,r.jsxs)(i.h_2,{trigger:(0,r.jsx)(i.zxk,{variant:"ghost",icon:"hover",children:(0,r.jsx)(u.bQp,{})}),contentProps:{align:"start"},children:[(0,r.jsx)(i.Juw,{children:"Actions"}),(0,r.jsxs)(i.Xiv,{onSelect:t,children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(u._fo,{})}),"Cancel upload"]})]})}let d=[{id:"actions",label:"",fixed:!0,cellClassName:"w-[50px] !pl-2 !pr-2 [&+*]:!pl-0",render:function(e){let{data:{uploadAbort:t}}=e;return(0,r.jsx)(c,{abort:t})}},{id:"path",label:"path",contentClassName:"max-w-[600px]",category:"general",render:function(e){let{data:{path:t,id:n}}=e,o=(0,a.kj)(t).slice(1);return(0,r.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,r.jsx)(i.xvT,{ellipsis:!0,weight:"semibold",size:"14",children:o}),(0,r.jsx)(i.XxW,{value:n,label:"upload ID",size:"10"})]})}},{id:"status",label:"status",category:"general",contentClassName:"w-[200px]",render:function(e){let{data:{loaded:t,size:n,uploadStatus:a,remote:s}}=e;return s?(0,r.jsx)(i.xvT,{size:"12",color:"subtle",children:"Uploading from a different session"}):(0,r.jsx)(o.s,{loaded:t,size:n,status:a})}},{id:"size",label:"size",category:"general",render:function(e){let{data:{remote:t,size:n}}=e;return t?null:(0,r.jsx)(i.xvT,{size:"12",color:"subtle",children:(0,s.vW)(n)})}},{id:"createdAt",label:"started at",category:"general",render:function(e){let{data:{createdAt:t}}=e;return(0,r.jsx)(i.xvT,{size:"12",color:"subtle",children:(0,l.Z)(new Date(t).getTime(),new Date)})}}]},73076:function(e,t,n){"use strict";n.d(t,{V:function(){return v},x:function(){return m}});var r=n(52322),i=n(36655),a=n(99605),o=n(57016),s=n(2784);let l=["path","status","size","createdAt"],u=[];var c=n(88778),d=n(70899),f=n(41736),h=n(98334);let p=(0,s.createContext)({}),m=()=>(0,s.useContext)(p);function v(e){let{children:t}=e,n=function(){var e,t;let{uploadsMap:n,activeBucket:r}=(0,f.b)(),p=(0,a.xj)(),m=(0,a.lr)(),v=Number(m.get("limit")||50),g=m.get("marker"),{filters:y,setFilter:b,removeFilter:x,removeLastFilter:w,resetFilters:j}=(0,i.Uu5)(),k=(0,o.LS)(),E=(0,o.bg)({disabled:!r,payload:{bucket:null==r?void 0:r.name,uploadIDMarker:g,limit:v}}),S=(0,s.useMemo)(()=>{var e,t;return(null===(t=E.data)||void 0===t?void 0:null===(e=t.uploads)||void 0===e?void 0:e.map(e=>{let t=e.uploadID,i=(0,d.vt)(e.path),a=(0,d.v_)(null==r?void 0:r.name,e.path);return n[t]||{id:t,path:a,bucket:r,name:i,size:1,loaded:1,isUploading:!0,uploadStatus:"uploading",createdAt:e.createdAt,remote:!0,type:"file",uploadAbort:async()=>{await k.post({payload:{bucket:null==r?void 0:r.name,path:e.path,uploadID:e.uploadID}})}}}))||[]},[n,r,E.data,k]),{configurableColumns:C,enabledColumns:_,sortableColumns:O,toggleColumnVisibility:M,setColumnsVisible:T,setColumnsHidden:A,toggleSort:P,setSortDirection:N,setSortField:R,sortField:D,sortDirection:L,resetDefaultColumnVisibility:Z}=(0,i.oy6)("renterd/v0/uploads",{columns:c.z,columnsDefaultVisible:l,sortOptions:u,defaultSortField:"path"}),F=(0,s.useMemo)(()=>c.z.filter(e=>e.fixed||_.includes(e.id)),[_]),z=(0,i.c2j)(S,E.isValidating,E.error,y),V=h._.buckets.uploads.replace("[bucket]",null==r?void 0:r.name),I=(0,a.jD)(),B=r&&I.startsWith(V);return{navigateToUploads:(0,s.useCallback)(()=>{r&&p.push(V)},[r,V,p]),isViewingUploads:B,dataState:z,limit:v,marker:g,nextMarker:null===(e=E.data)||void 0===e?void 0:e.nextUploadIDMarker,hasMore:null===(t=E.data)||void 0===t?void 0:t.hasMore,isLoading:E.isLoading,error:E.error,pageCount:(null==S?void 0:S.length)||0,columns:F,datasetPage:S,configurableColumns:C,enabledColumns:_,sortableColumns:O,toggleColumnVisibility:M,setColumnsVisible:T,setColumnsHidden:A,toggleSort:P,setSortDirection:N,setSortField:R,sortField:D,filters:y,setFilter:b,removeFilter:x,removeLastFilter:w,resetFilters:j,sortDirection:L,resetDefaultColumnVisibility:Z}}();return(0,r.jsx)(p.Provider,{value:n,children:t})}},82229:function(e,t,n){"use strict";n.d(t,{I:function(){return o}});var r=n(36655),i=n(57016),a=n(2784);function o(){let e=(0,i.ni)();return(0,a.useCallback)((t,n)=>(async()=>{let i=await e.put({payload:{add:t,remove:n}});return i.error?((0,r.OHV)(i.error),!1):(t.length&&(0,r.RFt)("".concat(t.map(e=>(0,r.$Gg)(e,20)).join(", ")," added to allowlist")),n.length&&(0,r.RFt)("".concat(n.map(e=>(0,r.$Gg)(e,20)).join(", ")," removed from allowlist")),!0)})(),[e])}},94613:function(e,t,n){"use strict";n.d(t,{l:function(){return o}});var r=n(36655),i=n(57016),a=n(2784);function o(){let e=(0,i.Os)();return(0,a.useCallback)((t,n)=>(async()=>{let i=await e.put({payload:{add:t,remove:n}});return i.error?((0,r.OHV)(i.error),!1):(t.length&&(0,r.RFt)("".concat(t.map(e=>(0,r.$Gg)(e,20)).join(", ")," added to blocklist")),n.length&&(0,r.RFt)("".concat(n.map(e=>(0,r.$Gg)(e,20)).join(", ")," removed from blocklist")),!0)})(),[e])}},91332:function(e,t,n){"use strict";n.d(t,{a:function(){return i}});var r=n(57016);function i(e){return(0,r.yu)({...e,params:{key:"contractset"}})}},18121:function(e,t,n){"use strict";n.d(t,{B:function(){return o},V:function(){return a}});var r=n(52322),i=n(61020);let a={excellent:1,good:.5,poor:0};function o(e){let{health:t,size:n,isDirectory:o}=e,s="excellent",l="green",u=t,c=(0,r.jsx)(i.Y3p,{});return t1&&(u=1),t<0&&(u=0),{label:s+" health",color:l,icon:c,displayHealth:u}}},91157:function(e,t,n){"use strict";n.d(t,{w:function(){return i}});var r=n(57016);function i(e){return(0,r.yu)({...e,params:{key:"redundancy"}})}},77248:function(e,t,n){"use strict";n.d(t,{m:function(){return i}});var r=n(57016);function i(e){return(0,r.yu)({...e,params:{key:"s3authentication"}})}},45178:function(e,t,n){"use strict";n.d(t,{B:function(){return a}});var r=n(36655),i=n(57016);function a(){var e;return(null===(e=(0,i.d_)().data)||void 0===e?void 0:e.network)==="Zen Testnet"?r.nNd.explore.testnetZen:r.nNd.explore.mainnet}},38855:function(e,t,n){"use strict";n.d(t,{n:function(){return o}});var r=n(36655),i=n(10363),a=n(57016);function o(){var e,t,n,o;let{isUnlockedAndAuthedRoute:s}=(0,i.Hv)(),l=(0,a.DQ)({config:{swr:{refreshInterval:e=>(null==e?void 0:e.synced)?(0,r.XBW)(60):(0,r.XBW)(10)}}}),u=(0,a.nH)(),c=l.data?null===(e=l.data)||void 0===e?void 0:e.blockHeight:0,d=(0,a.X2)({config:{swr:{refreshInterval:e=>(null==e?void 0:e.scanHeight)>=c?(0,r.XBW)(60):(0,r.XBW)(10)}}}),f=s&&c&&u?Number((100*Math.min(c/u,1)).toFixed(1)):0,h=s&&c&&d.data?Number((100*Math.min(d.data.scanHeight/u,1)).toFixed(1)):0;return{isSynced:null===(t=l.data)||void 0===t?void 0:t.synced,isWalletSynced:(null===(n=l.data)||void 0===n?void 0:n.synced)&&(null===(o=d.data)||void 0===o?void 0:o.scanHeight)>=c-1,nodeBlockHeight:c,estimatedBlockHeight:u,syncPercent:f,walletScanPercent:h,moreThan100BlocksToSync:!!c&&!!u&&u-c>100,firstTimeSyncing:!!c&&!!u&&u-c>5e4}}},70899:function(e,t,n){"use strict";n.d(t,{W0:function(){return m},YF:function(){return f},ez:function(){return w},ru:function(){return h},gD:function(){return b},vt:function(){return v},kj:function(){return p},rj:function(){return y},IQ:function(){return g},v_:function(){return d},rd:function(){return x}});var r=n(79200),i=n(81441),a=n(81721),o=function(e,t){for(var n=-1,r=e.length;++n-1;);return n},s=n(36202),l=n(25186),u=/^\s+/,c=function(e,t,n){if((e=(0,l.Z)(e))&&(n||void 0===t))return e.replace(u,"");if(!e||!(t=(0,r.Z)(t)))return e;var a=(0,s.Z)(e),c=o(a,(0,s.Z)(t));return(0,i.Z)(a,c).join("")};function d(e,t){let n=e.endsWith("/")?e.slice(0,-1):e,r=t.startsWith("/")?t.slice(1):t;return"".concat(n,"/").concat(r)}function f(e,t){let n=d(e=c(e,"/"),t);return n.endsWith("/")?n:n+"/"}function h(e){return e.split("/")[0]}function p(e){let t=(e=c(e,"/")).split("/").slice(1).join("/");return"/".concat(t)}function m(e){return{bucket:h(e),key:p(e).slice(1).split("/").map(encodeURIComponent).join("/")}}function v(e){let t=(e=c(e,"/")).split("/");return e.endsWith("/")?"".concat(t[t.length-2],"/"):t[t.length-1]}function g(e){return e.endsWith("/")}function y(e){return(g(e=c(e,"/"))?e.slice(0,-1):e).split("/").slice(0,-1).join("/").concat("/")}function b(e){return g(e=c(e,"/"))?e.slice(0,-1).split("/"):e.split("/").slice(0,-1)}function x(e){return e.join("/")}function w(e){return g(e=c(e,"/"))?e:e.concat("/")}},5184:function(e,t,n){"use strict";n.d(t,{E:function(){return a},e:function(){return i}});var r=n(70899);function i(e,t){let n=String(e.active.id),i=(0,r.rd)(t);e.collisions.length&&(i=".."===e.collisions[0].id?(0,r.rd)(t.slice(0,-1)):String(e.collisions[0].id));let a=(0,r.vt)(n);return{bucket:(0,r.ru)(n),from:(0,r.kj)(n),to:(0,r.kj)((0,r.v_)(i,a)),mode:a.endsWith("/")?"multi":"single"}}function a(e,t){let n=(0,r.v_)((0,r.rj)(e),t),i=(0,r.IQ)(e);return i&&(n=(0,r.ez)(n)),{bucket:(0,r.ru)(e),from:(0,r.kj)(e),to:(0,r.kj)(n),mode:i?"multi":"single"}}},83391:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return z}});var r=n(52322);n(50521);var i=n(36655),a=n(2784),o=n(97112),s=n(76838),l=n(56328),u=n(46081),c=n(49889),d=n(61020),f=n(38855),h=n(98334),p=n(42770),m=n(57016),v=n(6391),g=n.n(v),y=n(21487),b=n(10363),x=n(92762);function w(){var e,t;let{isUnlockedAndAuthedRoute:n}=(0,b.Hv)(),a=(0,u.q)(),{openDialog:s}=(0,o.Rh)(),l=(0,m.X2)(),c=(0,m.e$)({config:{swr:{errorRetryInterval:1e4}}}),[v,w]=(0,x.Z)("v0/renterd/onboarding/maximized",{defaultValue:!0}),k=(0,f.n)(),E=(0,p.F)();if(!n||"on"!==a.autopilot.status)return null;let S=new(g())(l.data?l.data.confirmed+l.data.unconfirmed:0),C=new(g())((null===(e=c.data)||void 0===e?void 0:e.contracts.allowance)||0),_=null===(t=a.autopilot.state.data)||void 0===t?void 0:t.configured,O=k.isSynced,M=S.gt(0),T=!E.active,A=[_,O,M,T],P=A.length,N=A.filter(e=>e).length;return P===N?null:v?(0,r.jsx)("div",{className:"z-20 fixed bottom-5 left-1/2 -translate-x-1/2 flex justify-center",children:(0,r.jsx)(i.s_4,{className:"w-[400px] flex flex-col max-h-[600px]",children:(0,r.jsxs)(i.xrM,{children:[(0,r.jsxs)("div",{className:"flex justify-between items-center px-3 py-2 border-b border-gray-200 dark:border-graydark-300",children:[(0,r.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,r.jsx)(i.TRl,{}),(0,r.jsx)(i.xvT,{size:"20",weight:"semibold",children:"Welcome to Sia"})]}),(0,r.jsx)(i.zxk,{variant:"ghost",onClick:()=>w(!1),children:(0,r.jsx)(d.mli,{})})]}),(0,r.jsx)("div",{className:"flex justify-between items-center px-3 py-2 border-b border-gray-200 dark:border-graydark-300",children:(0,r.jsx)(i.xvT,{size:"14",children:"Get set up by completing the following steps. Once they are complete, you can start uploading files."})}),(0,r.jsx)(j,{title:(0,r.jsx)(i.rUS,{href:h._.config.index,ellipsis:!0,size:"14",underline:"hover",children:"Step 1: Configure your storage settings"}),description:"Specify how much data you plan to store and your target price.",action:_?(0,r.jsx)(i.xvT,{color:"green",children:(0,r.jsx)(d.Y3p,{})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.rUS,{href:h._.config.index,children:(0,r.jsx)(d.V8Q,{})}),(0,r.jsx)(i.xvT,{color:"amber",children:(0,r.jsx)(d.Fs9,{})})]})}),(0,r.jsx)(j,{title:(0,r.jsx)(i.rUS,{href:h._.node.index,underline:"hover",ellipsis:!0,size:"14",children:"Step 2: Wait for the blockchain to sync"}),description:"The blockchain will sync in the background, this takes some time. No user action required.",action:O?(0,r.jsx)(i.xvT,{color:"green",children:(0,r.jsx)(d.Y3p,{})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(i.xvT,{ellipsis:!0,size:"14",children:[k.syncPercent,"%"]}),(0,r.jsx)(i.xvT,{color:"amber",children:(0,r.jsx)(d.hzZ,{})})]})}),(0,r.jsx)(j,{title:(0,r.jsx)(i.rUS,{href:h._.wallet.view,onClick:()=>s("addressDetails"),ellipsis:!0,size:"14",underline:"hover",children:"Step 3: Fund your wallet"}),description:"Fund your wallet with at least ".concat((0,y.Vz)(C)," siacoin to cover the required allowance.").concat(k.isWalletSynced?"":" Balance will not be accurate until wallet is finished scanning."),action:M?(0,r.jsx)(i.xvT,{color:"green",children:(0,r.jsx)(d.Y3p,{})}):(0,r.jsxs)(r.Fragment,{children:[!k.isWalletSynced&&(0,r.jsx)(i.ua7,{content:"Wallet scanning progress ".concat(k.walletScanPercent,"%"),children:(0,r.jsxs)(i.xvT,{size:"14",children:[k.walletScanPercent,"%"]})}),(0,r.jsx)(i.rUS,{href:h._.wallet.view,onClick:()=>s("addressDetails"),children:(0,r.jsx)(d.V8Q,{})}),(0,r.jsx)(i.xvT,{color:"amber",children:(0,r.jsx)(d.Fs9,{})})]})}),(0,r.jsx)(j,{title:(0,r.jsx)(i.rUS,{href:h._.contracts.index,ellipsis:!0,size:"14",underline:"hover",children:"Step 4: Wait for storage contracts to form"}),description:"Once all other steps are complete, contracts will automatically form. No user action required.",action:T?(0,r.jsx)(i.xvT,{color:"green",children:(0,r.jsx)(d.Y3p,{})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(i.xvT,{ellipsis:!0,size:"14",children:[E.count,"/",E.required]}),(0,r.jsx)(i.xvT,{color:"amber",children:(0,r.jsx)(d.hzZ,{})})]})})]})})}):(0,r.jsx)("div",{className:"z-30 fixed bottom-5 left-1/2 -translate-x-1/2 flex justify-center",children:(0,r.jsx)(i.zxk,{onClick:()=>w(!0),size:"large",className:"flex gap-3 !px-3",children:(0,r.jsxs)(i.xvT,{className:"flex items-center gap-1",children:[(0,r.jsx)(i.TRl,{}),"Setup: ",N,"/",P," steps complete"]})})})}function j(e){let{title:t,action:n,description:a}=e;return(0,r.jsx)("div",{className:"border-t first:border-t-0 border-gray-200 dark:border-graydark-300 px-3 py-2",children:(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,r.jsx)("div",{className:"flex-1 flex items-center",children:t}),n]}),(0,r.jsx)("div",{className:"pr-5",children:(0,r.jsx)(i.xvT,{size:"12",color:"subtle",children:a})})]})})}var k=n(41736),E=n(26731);function S(e){let{loaded:t,size:n,path:a,abortTip:o,abort:s,status:l}=e;return(0,r.jsxs)("div",{className:"flex flex-col gap-1 border-t first:border-t-0 border-gray-200 dark:border-graydark-300 px-3 py-2",children:[(0,r.jsxs)("div",{className:"flex gap-1",children:[(0,r.jsx)(i.xvT,{ellipsis:!0,size:"14",className:"flex-1",children:a}),(0,r.jsx)(i.zxk,{tip:o,variant:"ghost",size:"none",onClick:()=>null==s?void 0:s(),children:(0,r.jsx)(d.PcV,{})})]}),(0,r.jsx)(E.s,{loaded:t,size:n,status:l})]})}var C=n(73076);function _(){let{isUnlockedAndAuthedRoute:e}=(0,b.Hv)(),{downloadsList:t,downloadCancel:n}=(0,k.b)(),{pageCount:o,navigateToUploads:s,isViewingUploads:l}=(0,C.x)(),[u,c]=(0,a.useState)(!0),f=!!o,h=t.length,p=!!h;if(!e||!f&&!p)return null;let m=(0,r.jsxs)("div",{className:"flex gap-2",children:[f&&!l?(0,r.jsxs)(i.zxk,{tip:"Uploads list",onClick:s,className:"flex gap-3",children:[(0,r.jsx)(d.R$6,{className:"opacity-50 scale-75 relative top-px"}),"Active uploads"]}):null,p?(0,r.jsxs)(i.zxk,{tip:"Downloads list",onClick:()=>c(e=>!e),className:"flex gap-3",children:[(0,r.jsx)(d.vzB,{className:"opacity-50 scale-75"}),"Active downloads"]}):null]});return p&&u?(0,r.jsxs)("div",{className:"z-30 fixed bottom-5 left-1/2 -translate-x-1/2 flex flex-col items-center justify-center gap-2",children:[(0,r.jsx)(i.s_4,{className:"w-[400px] flex flex-col max-h-[600px]",children:(0,r.jsx)(i.xrM,{children:p?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex justify-between items-center px-3 py-2 border-b border-gray-200 dark:border-graydark-300",children:[(0,r.jsxs)(i.xvT,{size:"16",weight:"semibold",children:["Active downloads (",h,")"]}),(0,r.jsx)(i.zxk,{variant:"ghost",onClick:()=>c(!1),children:(0,r.jsx)(d.mli,{})})]}),t.map(e=>(0,r.jsx)(S,{path:e.path,loaded:e.loaded,size:e.size,status:e.loaded===e.size?"processing":"downloading",abort:()=>n(e),abortTip:"Cancel download"},e.id))]}):null})}),m]}):(0,r.jsx)("div",{className:"z-30 fixed bottom-5 left-1/2 -translate-x-1/2",children:m})}var O=n(40730),M=n(71367),T=n(43385),A=n(75618),P=n(87764);function N(e){let{children:t}=e;return(0,r.jsx)(u.w,{children:(0,r.jsx)(c.iV,{children:(0,r.jsx)(o.Tu,{children:(0,r.jsx)(O.v,{children:(0,r.jsx)(s.x,{children:(0,r.jsx)(l.x,{children:(0,r.jsx)(k.e,{children:(0,r.jsx)(C.V,{children:(0,r.jsx)(A.V,{children:(0,r.jsx)(T.p,{children:(0,r.jsx)(M.f,{children:(0,r.jsxs)(P.b,{children:[(0,r.jsx)(w,{}),(0,r.jsx)(_,{}),(0,r.jsx)(o.xQ,{}),t]})})})})})})})})})})})})}var R=n(46058),D=n.n(R),L=n(28863),Z=n.n(L);let F=(0,n(82851).cx)(D().variable,Z().variable);function z(e){let{Component:t,pageProps:n}=e;return(0,r.jsx)(i.PD$,{className:F,fallback:n.fallback,passwordProtectRequestHooks:!0,lockRoutes:h._,children:(0,r.jsx)(N,{children:(0,r.jsx)(t,{...n})})})}},36655:function(e,t,n){"use strict";let r,i,a,o;n.d(t,{tU3:function(){return OP},zXq:function(){return OH},juT:function(){return Oi},Cts:function(){return lq},Z58:function(){return Mf},WVB:function(){return c6},zxk:function(){return lM},b0u:function(){return k0},EKh:function(){return lY},vRO:function(){return MG},QHy:function(){return Mz},TaT:function(){return Mw},eQh:function(){return lG},HfT:function(){return MB},wEc:function(){return Mp},ncR:function(){return Ce},VqE:function(){return uO},h_2:function(){return dt},Xiv:function(){return dn},Juw:function(){return dr},KpP:function(){return di},fhJ:function(){return p9},XOF:function(){return S9},S$c:function(){return Cd},WyV:function(){return MQ},yEL:function(){return OV},cB7:function(){return Co},ZqQ:function(){return Ca},IKw:function(){return Cf},KZS:function(){return Cs},zsw:function(){return pm},__J:function(){return dv},rUS:function(){return db},Qjf:function(){return dx},xgg:function(){return kQ},TRl:function(){return dj},kFS:function(){return c8},FzK:function(){return ML},Clw:function(){return c5},PD$:function(){return M5},Wxm:function(){return hf},uDJ:function(){return _6},_5:function(){return _7},wFK:function(){return _8},s_4:function(){return nE},nvN:function(){return nj},u5Q:function(){return Mh},j4H:function(){return hl},hmz:function(){return hu},J2e:function(){return dU},kod:function(){return d3},xrM:function(){return uS},PhF:function(){return hd},Z0O:function(){return c0},DLL:function(){return Mr},KJW:function(){return Os},rsf:function(){return hO},D_D:function(){return O4},iA_:function(){return _5},mQc:function(){return fP},nUL:function(){return fD},drW:function(){return fN},SPt:function(){return fR},t6k:function(){return MH},xvT:function(){return nw},nvn:function(){return fZ},ua7:function(){return l_},mPE:function(){return O3},XxW:function(){return SI},PF9:function(){return SH},m2c:function(){return SY},YKL:function(){return SW},ho9:function(){return SK},QUh:function(){return Ma},weF:function(){return OJ},YNn:function(){return O8},DmW:function(){return O7},O9T:function(){return v9},fVJ:function(){return Mu},vQq:function(){return SO},E5z:function(){return ST},HLH:function(){return Tp},NrH:function(){return kz},k9c:function(){return kW},Y_Z:function(){return Mo},EJC:function(){return Tf},kOJ:function(){return Ml},leQ:function(){return SR},Ztc:function(){return O0},XAn:function(){return kq},Vkc:function(){return c2},sWj:function(){return kF},ort:function(){return k$},xLV:function(){return kI},okB:function(){return kU},AEA:function(){return kH},S5N:function(){return T9},z$:function(){return nk},XBW:function(){return kY},GXN:function(){return kK},I13:function(){return SP},cEb:function(){return fL},y70:function(){return ht},OHV:function(){return SS},OPV:function(){return SE},RFt:function(){return Sj},$Gg:function(){return SA},_4u:function(){return Tl},Wdu:function(){return Ts},Y97:function(){return OA},c2j:function(){return ON},t0Y:function(){return M2},mYE:function(){return M0},u$d:function(){return M1},Z4p:function(){return MJ},WsO:function(){return Oz},Uu5:function(){return Tu},fb0:function(){return Td},oy6:function(){return Ta},nNd:function(){return O9},BL0:function(){return kV},ivg:function(){return kB}});var s,l,u,c,d,f,h,p,m,v,g,y,b,x,w,j,k,E,S,C,_,O,M,T,A,P,N,R,D,L,Z,F,z,V,I,B,H,U,W,q,$,K,Y,X,G,Q,J,ee,et,en,er,ei,ea=n(52322),eo=n(2784),es=n.t(eo,2),el=n(7896),eu=n(34540),ec=n(26215),ed=n(99575);function ef(e){let t=e+"CollectionProvider",[n,r]=(0,eu.b)(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e+"CollectionSlot",s=eo.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=a(o,n),s=(0,ec.e)(t,i.collectionRef);return eo.createElement(ed.g7,{ref:s},r)}),l=e+"CollectionItemSlot",u="data-radix-collection-item";return[{Provider:e=>{let{scope:t,children:n}=e,r=eo.useRef(null),a=eo.useRef(new Map).current;return eo.createElement(i,{scope:t,itemMap:a,collectionRef:r},n)},Slot:s,ItemSlot:eo.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=eo.useRef(null),s=(0,ec.e)(t,o),c=a(l,n);return eo.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),eo.createElement(ed.g7,{[u]:"",ref:s},r)})},function(t){let n=a(e+"CollectionConsumer",t);return eo.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${u}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])},r]}var eh=n(41816),ep=n(73597),em=n(72130),ev=n(64680),eg=n(28245),ey=n(26074);let eb="Collapsible",[ex,ew]=(0,eu.b)(eb),[ej,ek]=ex(eb),eE=((e,t)=>{let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[l=!1,u]=(0,ep.T)({prop:r,defaultProp:i,onChange:o});return(0,eo.createElement)(ej,{scope:n,disabled:a,contentId:(0,ey.M)(),open:l,onOpenToggle:(0,eo.useCallback)(()=>u(e=>!e),[u])},(0,eo.createElement)(em.WV.div,(0,el.Z)({"data-state":eC(l),"data-disabled":a?"":void 0},s,{ref:t})))},"CollapsibleContent"),eS=((e,t)=>{let{forceMount:n,...r}=e,i=ek(eE,e.__scopeCollapsible);return(0,eo.createElement)(eg.z,{present:n||i.open},({present:e})=>(0,eo.createElement)(eS,(0,el.Z)({},r,{ref:t,present:e})))},(0,eo.forwardRef)((e,t)=>{let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=ek(eE,n),[s,l]=(0,eo.useState)(r),u=(0,eo.useRef)(null),c=(0,ec.e)(t,u),d=(0,eo.useRef)(0),f=d.current,h=(0,eo.useRef)(0),p=h.current,m=o.open||s,v=(0,eo.useRef)(m),g=(0,eo.useRef)();return(0,eo.useEffect)(()=>{let e=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,ev.b)(()=>{let e=u.current;if(e){g.current=g.current||{transitionDuration:e.style.transitionDuration,animationDuration:e.style.animationDuration,animationFillMode:e.style.animationFillMode},e.style.transitionDuration="0s",e.style.animationDuration="0s",e.style.animationFillMode="none";let t=e.getBoundingClientRect();d.current=t.height,h.current=t.width,v.current||(e.style.transitionDuration=g.current.transitionDuration,e.style.animationDuration=g.current.animationDuration,e.style.animationFillMode=g.current.animationFillMode),l(r)}},[o.open,r]),(0,eo.createElement)(em.WV.div,(0,el.Z)({"data-state":eC(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!m},a,{ref:c,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":p?`${p}px`:void 0,...e.style}}),m&&i)}));function eC(e){return e?"open":"closed"}let e_="Accordion",eO=["Home","End","ArrowDown","ArrowUp"],[eM,eT,eA]=ef(e_),[eP,eN]=(0,eu.b)(e_,[eA,ew]);ew(),eo.forwardRef((e,t)=>{let{type:n,...r}=e;return eo.createElement(eM.Provider,{scope:e.__scopeAccordion},"multiple"===n?eo.createElement(ez,(0,el.Z)({},r,{ref:t})):eo.createElement(eF,(0,el.Z)({},r,{ref:t})))}).propTypes={type(e){let t=e.value||e.defaultValue;return e.type&&!["single","multiple"].includes(e.type)?Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`."):"multiple"===e.type&&"string"==typeof t?Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`."):"single"===e.type&&Array.isArray(t)?Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`."):null}};let[eR,eD]=eP(e_),[eL,eZ]=eP(e_,{collapsible:!1}),eF=eo.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:a=!1,...o}=e,[s,l]=(0,ep.T)({prop:n,defaultProp:r,onChange:i});return eo.createElement(eR,{scope:e.__scopeAccordion,value:s?[s]:[],onItemOpen:l,onItemClose:eo.useCallback(()=>a&&l(""),[a,l])},eo.createElement(eL,{scope:e.__scopeAccordion,collapsible:a},eo.createElement(eB,(0,el.Z)({},o,{ref:t}))))}),ez=eo.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[o=[],s]=(0,ep.T)({prop:n,defaultProp:r,onChange:i}),l=eo.useCallback(e=>s((t=[])=>[...t,e]),[s]),u=eo.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return eo.createElement(eR,{scope:e.__scopeAccordion,value:o,onItemOpen:l,onItemClose:u},eo.createElement(eL,{scope:e.__scopeAccordion,collapsible:!0},eo.createElement(eB,(0,el.Z)({},a,{ref:t}))))}),[eV,eI]=eP(e_),eB=eo.forwardRef((e,t)=>{let{__scopeAccordion:n,disabled:r,...i}=e,a=eo.useRef(null),o=(0,ec.e)(a,t),s=eT(n),l=(0,eh.M)(e.onKeyDown,e=>{var t;if(!eO.includes(e.key))return;let n=e.target,r=s().filter(e=>{var t;return!(null!==(t=e.ref.current)&&void 0!==t&&t.disabled)}),i=r.findIndex(e=>e.ref.current===n),a=r.length;if(-1===i)return;e.preventDefault();let o=i;switch(e.key){case"Home":o=0;break;case"End":o=a-1;break;case"ArrowDown":o=i+1;break;case"ArrowUp":(o=i-1)<0&&(o=a-1)}null===(t=r[o%a].ref.current)||void 0===t||t.focus()});return eo.createElement(eV,{scope:n,disabled:r},eo.createElement(eM.Slot,{scope:n},eo.createElement(em.WV.div,(0,el.Z)({},i,{ref:o,onKeyDown:r?void 0:l}))))}),[eH,eU]=eP("AccordionItem");var eW=n(82851),eq=n(83317);function e$(e){return e.split("-")[0]}function eK(e){return e.split("-")[1]}function eY(e){return["top","bottom"].includes(e$(e))?"x":"y"}function eX(e){return"y"===e?"height":"width"}function eG(e,t,n){let r,{reference:i,floating:a}=e,o=i.x+i.width/2-a.width/2,s=i.y+i.height/2-a.height/2,l=eY(t),u=eX(l),c=i[u]/2-a[u]/2,d="x"===l;switch(e$(t)){case"top":r={x:o,y:i.y-a.height};break;case"bottom":r={x:o,y:i.y+i.height};break;case"right":r={x:i.x+i.width,y:s};break;case"left":r={x:i.x-a.width,y:s};break;default:r={x:i.x,y:i.y}}switch(eK(t)){case"start":r[l]-=c*(n&&d?-1:1);break;case"end":r[l]+=c*(n&&d?-1:1)}return r}let eQ=async(e,t,n)=>{let{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:o}=n,s=await (null==o.isRTL?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:c}=eG(l,r,s),d=r,f={},h=0;for(let n=0;n({name:"arrow",options:e,async fn(t){let{element:n,padding:r=0}=null!=e?e:{},{x:i,y:a,placement:o,rects:s,platform:l}=t;if(null==n)return{};let u=eJ(r),c={x:i,y:a},d=eY(o),f=eK(o),h=eX(d),p=await l.getDimensions(n),m="y"===d?"top":"left",v="y"===d?"bottom":"right",g=s.reference[h]+s.reference[d]-c[d]-s.floating[h],y=c[d]-s.reference[d],b=await (null==l.getOffsetParent?void 0:l.getOffsetParent(n)),x=b?"y"===d?b.clientHeight||0:b.clientWidth||0:0;0===x&&(x=s.floating[h]);let w=u[m],j=x-p[h]-u[v],k=x/2-p[h]/2+(g/2-y/2),E=e4(w,e2(k,j)),S=("start"===f?u[m]:u[v])>0&&k!==E&&s.reference[h]<=s.floating[h];return{[d]:c[d]-(S?ke5[e])}let e8={start:"end",end:"start"};function e7(e){return e.replace(/start|end/g,e=>e8[e])}let e9=["top","right","bottom","left"];e9.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);let te=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r,i,a;let{placement:o,middlewareData:s,rects:l,initialPlacement:u,platform:c,elements:d}=t,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",flipAlignment:v=!0,...g}=e,y=e$(o),b=p||(y!==u&&v?function(e){let t=e6(e);return[e7(e),t,e7(t)]}(u):[e6(u)]),x=[u,...b],w=await e1(t,g),j=[],k=(null==(n=s.flip)?void 0:n.overflows)||[];if(f&&j.push(w[y]),h){let{main:e,cross:t}=function(e,t,n){void 0===n&&(n=!1);let r=eK(e),i=eY(e),a=eX(i),o="x"===i?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=e6(o)),{main:o,cross:e6(o)}}(o,l,await (null==c.isRTL?void 0:c.isRTL(d.floating)));j.push(w[e],w[t])}if(k=[...k,{placement:o,overflows:j}],!j.every(e=>e<=0)){let e=(null!=(r=null==(i=s.flip)?void 0:i.index)?r:0)+1,t=x[e];if(t)return{data:{index:e,overflows:k},reset:{placement:t}};let n="bottom";switch(m){case"bestFit":{let e=null==(a=k.map(e=>[e,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:a[0].placement;e&&(n=e);break}case"initialPlacement":n=u}if(o!==n)return{reset:{placement:n}}}return{}}}};function tt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function tn(e){return e9.some(t=>e[t]>=0)}let tr=function(e){let{strategy:t="referenceHidden",...n}=void 0===e?{}:e;return{name:"hide",async fn(e){let{rects:r}=e;switch(t){case"referenceHidden":{let t=tt(await e1(e,{...n,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:tn(t)}}}case"escaped":{let t=tt(await e1(e,{...n,altBoundary:!0}),r.floating);return{data:{escapedOffsets:t,escaped:tn(t)}}}default:return{}}}}},ti=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){let{x:n,y:r}=t,i=await async function(e,t){let{placement:n,platform:r,elements:i}=e,a=await (null==r.isRTL?void 0:r.isRTL(i.floating)),o=e$(n),s=eK(n),l="x"===eY(n),u=["left","top"].includes(o)?-1:1,c=a&&l?-1:1,d="function"==typeof t?t(e):t,{mainAxis:f,crossAxis:h,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&"number"==typeof p&&(h="end"===s?-1*p:p),l?{x:h*c,y:f*u}:{x:f*u,y:h*c}}(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function ta(e){return"x"===e?"y":"x"}let to=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){let{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=e,u={x:n,y:r},c=await e1(t,l),d=eY(e$(i)),f=ta(d),h=u[d],p=u[f];if(a){let e="y"===d?"bottom":"right";h=e4(h+c["y"===d?"top":"left"],e2(h,h-c[e]))}if(o){let e="y"===f?"bottom":"right";p=e4(p+c["y"===f?"top":"left"],e2(p,p-c[e]))}let m=s.fn({...t,[d]:h,[f]:p});return{...m,data:{x:m.x-n,y:m.y-r}}}}},ts=function(e){return void 0===e&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=e,c={x:n,y:r},d=eY(i),f=ta(d),h=c[d],p=c[f],m="function"==typeof s?s({...a,placement:i}):s,v="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){let e="y"===d?"height":"width",t=a.reference[d]-a.floating[e]+v.mainAxis,n=a.reference[d]+a.reference[e]-v.mainAxis;hn&&(h=n)}if(u){var g,y,b,x;let e="y"===d?"width":"height",t=["top","left"].includes(e$(i)),n=a.reference[f]-a.floating[e]+(t&&null!=(g=null==(y=o.offset)?void 0:y[f])?g:0)+(t?0:v.crossAxis),r=a.reference[f]+a.reference[e]+(t?0:null!=(b=null==(x=o.offset)?void 0:x[f])?b:0)-(t?v.crossAxis:0);pr&&(p=r)}return{[d]:h,[f]:p}}}};function tl(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function tu(e){if(null==e)return window;if(!tl(e)){let t=e.ownerDocument;return t&&t.defaultView||window}return e}function tc(e){return tu(e).getComputedStyle(e)}function td(e){return tl(e)?"":e?(e.nodeName||"").toLowerCase():""}function tf(){let e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map(e=>e.brand+"/"+e.version).join(" "):navigator.userAgent}function th(e){return e instanceof tu(e).HTMLElement}function tp(e){return e instanceof tu(e).Element}function tm(e){return"undefined"!=typeof ShadowRoot&&(e instanceof tu(e).ShadowRoot||e instanceof ShadowRoot)}function tv(e){let{overflow:t,overflowX:n,overflowY:r}=tc(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function tg(e){let t=/firefox/i.test(tf()),n=tc(e);return"none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||["transform","perspective"].includes(n.willChange)||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter}function ty(){return!/^((?!chrome|android).)*safari/i.test(tf())}let tb=Math.min,tx=Math.max,tw=Math.round;function tj(e,t,n){var r,i,a,o;void 0===t&&(t=!1),void 0===n&&(n=!1);let s=e.getBoundingClientRect(),l=1,u=1;t&&th(e)&&(l=e.offsetWidth>0&&tw(s.width)/e.offsetWidth||1,u=e.offsetHeight>0&&tw(s.height)/e.offsetHeight||1);let c=tp(e)?tu(e):window,d=!ty()&&n,f=(s.left+(d&&null!=(r=null==(i=c.visualViewport)?void 0:i.offsetLeft)?r:0))/l,h=(s.top+(d&&null!=(a=null==(o=c.visualViewport)?void 0:o.offsetTop)?a:0))/u,p=s.width/l,m=s.height/u;return{width:p,height:m,top:h,right:f+p,bottom:h+m,left:f,x:f,y:h}}function tk(e){return((e instanceof tu(e).Node?e.ownerDocument:e.document)||window.document).documentElement}function tE(e){return tp(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function tS(e){return tj(tk(e)).left+tE(e).scrollLeft}function tC(e){return"html"===td(e)?e:e.assignedSlot||e.parentNode||(tm(e)?e.host:null)||tk(e)}function t_(e){return th(e)&&"fixed"!==getComputedStyle(e).position?e.offsetParent:null}function tO(e){let t=tu(e),n=t_(e);for(;n&&["table","td","th"].includes(td(n))&&"static"===getComputedStyle(n).position;)n=t_(n);return n&&("html"===td(n)||"body"===td(n)&&"static"===getComputedStyle(n).position&&!tg(n))?t:n||function(e){let t=tC(e);for(tm(t)&&(t=t.host);th(t)&&!["html","body"].includes(td(t));){if(tg(t))return t;t=t.parentNode}return null}(e)||t}function tM(e){if(th(e))return{width:e.offsetWidth,height:e.offsetHeight};let t=tj(e);return{width:t.width,height:t.height}}function tT(e,t){var n;void 0===t&&(t=[]);let r=function e(t){let n=tC(t);return["html","body","#document"].includes(td(n))?t.ownerDocument.body:th(n)&&tv(n)?n:e(n)}(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),a=tu(r),o=i?[a].concat(a.visualViewport||[],tv(r)?r:[]):r,s=t.concat(o);return i?s:s.concat(tT(o))}function tA(e,t,n){return"viewport"===t?e0(function(e,t){let n=tu(e),r=tk(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,l=0;if(i){a=i.width,o=i.height;let e=ty();(e||!e&&"fixed"===t)&&(s=i.offsetLeft,l=i.offsetTop)}return{width:a,height:o,x:s,y:l}}(e,n)):tp(t)?function(e,t){let n=tj(e,!1,"fixed"===t),r=n.top+e.clientTop,i=n.left+e.clientLeft;return{top:r,left:i,x:i,y:r,right:i+e.clientWidth,bottom:r+e.clientHeight,width:e.clientWidth,height:e.clientHeight}}(t,n):e0(function(e){var t;let n=tk(e),r=tE(e),i=null==(t=e.ownerDocument)?void 0:t.body,a=tx(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=tx(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+tS(e),l=-r.scrollTop;return"rtl"===tc(i||n).direction&&(s+=tx(n.clientWidth,i?i.clientWidth:0)-a),{width:a,height:o,x:s,y:l}}(tk(e)))}let tP={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[..."clippingAncestors"===n?function(e){let t=tT(e),n=["absolute","fixed"].includes(tc(e).position)&&th(e)?tO(e):e;return tp(n)?t.filter(e=>tp(e)&&function(e,t){let n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&tm(n)){let n=t;do{if(n&&e===n)return!0;n=n.parentNode||n.host}while(n)}return!1}(e,n)&&"body"!==td(e)):[]}(t):[].concat(n),r],o=a[0],s=a.reduce((e,n)=>{let r=tA(t,n,i);return e.top=tx(r.top,e.top),e.right=tb(r.right,e.right),e.bottom=tb(r.bottom,e.bottom),e.left=tx(r.left,e.left),e},tA(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e,i=th(n),a=tk(n);if(n===a)return t;let o={scrollLeft:0,scrollTop:0},s={x:0,y:0};if((i||!i&&"fixed"!==r)&&(("body"!==td(n)||tv(a))&&(o=tE(n)),th(n))){let e=tj(n,!0);s.x=e.x+n.clientLeft,s.y=e.y+n.clientTop}return{...t,x:t.x-o.scrollLeft+s.x,y:t.y-o.scrollTop+s.y}},isElement:tp,getDimensions:tM,getOffsetParent:tO,getDocumentElement:tk,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:function(e,t,n){let r=th(t),i=tk(t),a=tj(e,r&&function(e){let t=tj(e);return tw(t.width)!==e.offsetWidth||tw(t.height)!==e.offsetHeight}(t),"fixed"===n),o={scrollLeft:0,scrollTop:0},s={x:0,y:0};if(r||!r&&"fixed"!==n){if(("body"!==td(t)||tv(i))&&(o=tE(t)),th(t)){let e=tj(t,!0);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else i&&(s.x=tS(i))}return{x:a.left+o.scrollLeft-s.x,y:a.top+o.scrollTop-s.y,width:a.width,height:a.height}}(t,tO(n),r),floating:{...tM(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===tc(e).direction};function tN(e,t,n,r){void 0===r&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=!0,animationFrame:s=!1}=r,l=i&&!s,u=a&&!s,c=l||u?[...tp(e)?tT(e):[],...tT(t)]:[];c.forEach(e=>{l&&e.addEventListener("scroll",n,{passive:!0}),u&&e.addEventListener("resize",n)});let d,f=null;if(o){let r=!0;f=new ResizeObserver(()=>{r||n(),r=!1}),tp(e)&&!s&&f.observe(e),f.observe(t)}let h=s?tj(e):null;return s&&function t(){let r=tj(e);h&&(r.x!==h.x||r.y!==h.y||r.width!==h.width||r.height!==h.height)&&n(),h=r,d=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach(e=>{l&&e.removeEventListener("scroll",n),u&&e.removeEventListener("resize",n)}),null==(e=f)||e.disconnect(),f=null,s&&cancelAnimationFrame(d)}}let tR=(e,t,n)=>eQ(e,t,{platform:tP,...n});var tD=n(28316),tL="undefined"!=typeof document?eo.useLayoutEffect:eo.useEffect;function tZ(e){let{middleware:t,placement:n="bottom",strategy:r="absolute",whileElementsMounted:i}=void 0===e?{}:e,a=eo.useRef(null),o=eo.useRef(null),s=function(e){let t=eo.useRef(e);return tL(()=>{t.current=e}),t}(i),l=eo.useRef(null),[u,c]=eo.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[d,f]=eo.useState(t);!function e(t,n){let r,i,a;if(t===n)return!0;if(typeof t!=typeof n)return!1;if("function"==typeof t&&t.toString()===n.toString())return!0;if(t&&n&&"object"==typeof t){if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(i=r;0!=i--;)if(!e(t[i],n[i]))return!1;return!0}if((r=(a=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=r;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;0!=i--;){let r=a[i];if(("_owner"!==r||!t.$$typeof)&&!e(t[r],n[r]))return!1}return!0}return t!=t&&n!=n}(null==d?void 0:d.map(e=>{let{options:t}=e;return t}),null==t?void 0:t.map(e=>{let{options:t}=e;return t}))&&f(t);let h=eo.useCallback(()=>{a.current&&o.current&&tR(a.current,o.current,{middleware:d,placement:n,strategy:r}).then(e=>{p.current&&tD.flushSync(()=>{c(e)})})},[d,n,r]);tL(()=>{p.current&&h()},[h]);let p=eo.useRef(!1);tL(()=>(p.current=!0,()=>{p.current=!1}),[]);let m=eo.useCallback(()=>{if("function"==typeof l.current&&(l.current(),l.current=null),a.current&&o.current){if(s.current){let e=s.current(a.current,o.current,h);l.current=e}else h()}},[h,s]),v=eo.useCallback(e=>{a.current=e,m()},[m]),g=eo.useCallback(e=>{o.current=e,m()},[m]),y=eo.useMemo(()=>({reference:a,floating:o}),[]);return eo.useMemo(()=>({...u,update:h,refs:y,reference:v,floating:g}),[u,h,y,v,g])}let tF=e=>{let{element:t,padding:n}=e;return{name:"arrow",options:e,fn(e){if(Object.prototype.hasOwnProperty.call(t,"current")){if(null!=t.current)return e3({element:t.current,padding:n}).fn(e)}else if(t)return e3({element:t,padding:n}).fn(e);return{}}}},tz=(0,eo.forwardRef)((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,eo.createElement)(em.WV.svg,(0,el.Z)({},a,{ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none"}),e.asChild?n:(0,eo.createElement)("polygon",{points:"0,0 30,0 15,10"}))});function tV(e){let[t,n]=(0,eo.useState)(void 0);return(0,ev.b)(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let r,i;if(!Array.isArray(t)||!t.length)return;let a=t[0];if("borderBoxSize"in a){let e=a.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,i=t.blockSize}else r=e.offsetWidth,i=e.offsetHeight;n({width:r,height:i})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}let tI="Popper",[tB,tH]=(0,eu.b)(tI),[tU,tW]=tB(tI),tq=(0,eo.forwardRef)((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=tW("PopperAnchor",n),o=(0,eo.useRef)(null),s=(0,ec.e)(t,o);return(0,eo.useEffect)(()=>{a.onAnchorChange((null==r?void 0:r.current)||o.current)}),r?null:(0,eo.createElement)(em.WV.div,(0,el.Z)({},i,{ref:s}))}),t$="PopperContent",[tK,tY]=tB(t$),[tX,tG]=tB(t$,{hasParent:!1,positionUpdateFns:new Set}),tQ=(0,eo.forwardRef)((e,t)=>{var n,r,i,a,o,s,l,u;let{__scopePopper:c,side:d="bottom",sideOffset:f=0,align:h="center",alignOffset:p=0,arrowPadding:m=0,collisionBoundary:v=[],collisionPadding:g=0,sticky:y="partial",hideWhenDetached:b=!1,avoidCollisions:x=!0,...w}=e,j=tW(t$,c),[k,E]=(0,eo.useState)(null),S=(0,ec.e)(t,e=>E(e)),[C,_]=(0,eo.useState)(null),O=tV(C),M=null!==(n=null==O?void 0:O.width)&&void 0!==n?n:0,T=null!==(r=null==O?void 0:O.height)&&void 0!==r?r:0,A="number"==typeof g?g:{top:0,right:0,bottom:0,left:0,...g},P=Array.isArray(v)?v:[v],N=P.length>0,R={padding:A,boundary:P.filter(t2),altBoundary:N},{reference:D,floating:L,strategy:Z,x:F,y:z,placement:V,middlewareData:I,update:B}=tZ({strategy:"fixed",placement:d+("center"!==h?"-"+h:""),whileElementsMounted:tN,middleware:[ti({mainAxis:f+T,alignmentAxis:p}),x?to({mainAxis:!0,crossAxis:!1,limiter:"partial"===y?ts():void 0,...R}):void 0,C?tF({element:C,padding:m}):void 0,x?te({...R}):void 0,t4({arrowWidth:M,arrowHeight:T}),b?tr({strategy:"referenceHidden"}):void 0].filter(t1)});(0,ev.b)(()=>{D(j.anchor)},[D,j.anchor]);let H=null!==F&&null!==z,[U,W]=t3(V),q=null===(i=I.arrow)||void 0===i?void 0:i.x,$=null===(a=I.arrow)||void 0===a?void 0:a.y,K=(null===(o=I.arrow)||void 0===o?void 0:o.centerOffset)!==0,[Y,X]=(0,eo.useState)();(0,ev.b)(()=>{k&&X(window.getComputedStyle(k).zIndex)},[k]);let{hasParent:G,positionUpdateFns:Q}=tG(t$,c),J=!G;(0,eo.useLayoutEffect)(()=>{if(!J)return Q.add(B),()=>{Q.delete(B)}},[J,Q,B]),(0,eo.useLayoutEffect)(()=>{J&&H&&Array.from(Q).reverse().forEach(e=>requestAnimationFrame(e))},[J,H,Q]);let ee={"data-side":U,"data-align":W,...w,ref:S,style:{...w.style,animation:H?void 0:"none",opacity:null!==(s=I.hide)&&void 0!==s&&s.referenceHidden?0:void 0}};return(0,eo.createElement)("div",{ref:L,"data-radix-popper-content-wrapper":"",style:{position:Z,left:0,top:0,transform:H?`translate3d(${Math.round(F)}px, ${Math.round(z)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[null===(l=I.transformOrigin)||void 0===l?void 0:l.x,null===(u=I.transformOrigin)||void 0===u?void 0:u.y].join(" ")}},(0,eo.createElement)(tK,{scope:c,placedSide:U,onArrowChange:_,arrowX:q,arrowY:$,shouldHideArrow:K},J?(0,eo.createElement)(tX,{scope:c,hasParent:!0,positionUpdateFns:Q},(0,eo.createElement)(em.WV.div,ee)):(0,eo.createElement)(em.WV.div,ee)))}),tJ={top:"bottom",right:"left",bottom:"top",left:"right"},t0=(0,eo.forwardRef)(function(e,t){let{__scopePopper:n,...r}=e,i=tY("PopperArrow",n),a=tJ[i.placedSide];return(0,eo.createElement)("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0}},(0,eo.createElement)(tz,(0,el.Z)({},r,{ref:t,style:{...r.style,display:"block"}})))});function t1(e){return void 0!==e}function t2(e){return null!==e}let t4=e=>({name:"transformOrigin",options:e,fn(t){var n,r,i,a,o;let{placement:s,rects:l,middlewareData:u}=t,c=(null===(n=u.arrow)||void 0===n?void 0:n.centerOffset)!==0,d=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[h,p]=t3(s),m={start:"0%",center:"50%",end:"100%"}[p],v=(null!==(r=null===(i=u.arrow)||void 0===i?void 0:i.x)&&void 0!==r?r:0)+d/2,g=(null!==(a=null===(o=u.arrow)||void 0===o?void 0:o.y)&&void 0!==a?a:0)+f/2,y="",b="";return"bottom"===h?(y=c?m:`${v}px`,b=`${-f}px`):"top"===h?(y=c?m:`${v}px`,b=`${l.floating.height+f}px`):"right"===h?(y=`${-f}px`,b=c?m:`${g}px`):"left"===h&&(y=`${l.floating.width+f}px`,b=c?m:`${g}px`),{data:{x:y,y:b}}}});function t3(e){let[t,n="center"]=e.split("-");return[t,n]}let t5=e=>{let{__scopePopper:t,children:n}=e,[r,i]=(0,eo.useState)(null);return(0,eo.createElement)(tU,{scope:t,anchor:r,onAnchorChange:i},n)};var t6=n(6500);let t8=(0,eo.forwardRef)((e,t)=>(0,eo.createElement)(em.WV.span,(0,el.Z)({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}))),[t7,t9]=(0,eu.b)("Tooltip",[tH]),ne=tH(),nt="tooltip.open",[nn,nr]=t7("TooltipProvider"),ni="Tooltip",[na,no]=t7(ni),ns="TooltipTrigger",nl=(0,eo.forwardRef)((e,t)=>{let{__scopeTooltip:n,...r}=e,i=no(ns,n),a=nr(ns,n),o=ne(n),s=(0,eo.useRef)(null),l=(0,ec.e)(t,s,i.onTriggerChange),u=(0,eo.useRef)(!1),c=(0,eo.useRef)(!1),d=(0,eo.useCallback)(()=>u.current=!1,[]);return(0,eo.useEffect)(()=>()=>document.removeEventListener("pointerup",d),[d]),(0,eo.createElement)(tq,(0,el.Z)({asChild:!0},o),(0,eo.createElement)(em.WV.button,(0,el.Z)({"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute},r,{ref:l,onPointerMove:(0,eh.M)(e.onPointerMove,e=>{"touch"===e.pointerType||c.current||a.isPointerInTransitRef.current||(i.onTriggerEnter(),c.current=!0)}),onPointerLeave:(0,eh.M)(e.onPointerLeave,()=>{i.onTriggerLeave(),c.current=!1}),onPointerDown:(0,eh.M)(e.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:(0,eh.M)(e.onFocus,()=>{u.current||i.onOpen()}),onBlur:(0,eh.M)(e.onBlur,i.onClose),onClick:(0,eh.M)(e.onClick,e=>{0===e.detail&&i.onClose()})})))}),nu="TooltipPortal",[nc,nd]=t7(nu,{forceMount:void 0}),nf="TooltipContent",nh=(0,eo.forwardRef)((e,t)=>{let n=nd(nf,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...a}=e,o=no(nf,e.__scopeTooltip);return(0,eo.createElement)(eg.z,{present:r||o.open},o.disableHoverableContent?(0,eo.createElement)(ng,(0,el.Z)({side:i},a,{ref:t})):(0,eo.createElement)(np,(0,el.Z)({side:i},a,{ref:t})))}),np=(0,eo.forwardRef)((e,t)=>{let n=no(nf,e.__scopeTooltip),r=nr(nf,e.__scopeTooltip),i=(0,eo.useRef)(null),a=(0,ec.e)(t,i),[o,s]=(0,eo.useState)(null),{trigger:l,onClose:u}=n,c=i.current,{onPointerInTransitChange:d}=r,f=(0,eo.useCallback)(()=>{s(null),d(!1)},[d]),h=(0,eo.useCallback)((e,t)=>{let n=e.currentTarget,r=function(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:return null}}({x:e.clientX,y:e.clientY},n.getBoundingClientRect()),i="right"===r||"bottom"===r?-5:5;s(function(e){let t=e.slice();return t.sort((e,t)=>e.xt.x?1:e.yt.y?1:0),function(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return(n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y)?t:t.concat(n)}(t)}(["right"===r||"left"===r?{x:e.clientX+i,y:e.clientY}:{x:e.clientX,y:e.clientY+i},...function(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}(t.getBoundingClientRect())])),d(!0)},[d]);return(0,eo.useEffect)(()=>()=>f(),[f]),(0,eo.useEffect)(()=>{if(l&&c){let e=e=>h(e,c),t=e=>h(e,l);return l.addEventListener("pointerleave",e),c.addEventListener("pointerleave",t),()=>{l.removeEventListener("pointerleave",e),c.removeEventListener("pointerleave",t)}}},[l,c,h,f]),(0,eo.useEffect)(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=(null==l?void 0:l.contains(t))||(null==c?void 0:c.contains(t)),i=!function(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;er!=u>r&&n<(l-o)*(r-s)/(u-s)+o&&(i=!i)}return i}(n,o);r?f():i&&(f(),u())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[l,c,o,u,f]),(0,eo.createElement)(ng,(0,el.Z)({},e,{ref:a}))}),[nm,nv]=t7(ni,{isInside:!1}),ng=(0,eo.forwardRef)((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,l=no(nf,n),u=ne(n),{onClose:c}=l;return(0,eo.useEffect)(()=>(document.addEventListener(nt,c),()=>document.removeEventListener(nt,c)),[c]),(0,eo.useEffect)(()=>{if(l.trigger){let e=e=>{let t=e.target;null!=t&&t.contains(l.trigger)&&c()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[l.trigger,c]),(0,eo.createElement)(eq.XB,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:c},(0,eo.createElement)(tQ,(0,el.Z)({"data-state":l.stateAttribute},u,s,{ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)"}}),(0,eo.createElement)(ed.A4,null,r),(0,eo.createElement)(nm,{scope:n,isInside:!0},(0,eo.createElement)(t8,{id:l.contentId,role:"tooltip"},i||r))))}),ny=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i=!1,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,l=nr(ni,e.__scopeTooltip),u=ne(t),[c,d]=(0,eo.useState)(null),f=(0,ey.M)(),h=(0,eo.useRef)(0),p=null!=o?o:l.disableHoverableContent,m=null!=s?s:l.delayDuration,v=(0,eo.useRef)(!1),[g=!1,y]=(0,ep.T)({prop:r,defaultProp:i,onChange:e=>{e?(l.onOpen(),document.dispatchEvent(new CustomEvent(nt))):l.onClose(),null==a||a(e)}}),b=(0,eo.useMemo)(()=>g?v.current?"delayed-open":"instant-open":"closed",[g]),x=(0,eo.useCallback)(()=>{window.clearTimeout(h.current),v.current=!1,y(!0)},[y]),w=(0,eo.useCallback)(()=>{window.clearTimeout(h.current),y(!1)},[y]),j=(0,eo.useCallback)(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,y(!0)},m)},[m,y]);return(0,eo.useEffect)(()=>()=>window.clearTimeout(h.current),[]),(0,eo.createElement)(t5,u,(0,eo.createElement)(na,{scope:t,contentId:f,open:g,stateAttribute:b,trigger:c,onTriggerChange:d,onTriggerEnter:(0,eo.useCallback)(()=>{l.isOpenDelayed?j():x()},[l.isOpenDelayed,j,x]),onTriggerLeave:(0,eo.useCallback)(()=>{p?w():window.clearTimeout(h.current)},[w,p]),onOpen:x,onClose:w,disableHoverableContent:p},n))},nb=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=no(nu,t);return(0,eo.createElement)(nc,{scope:t,forceMount:n},(0,eo.createElement)(eg.z,{present:n||a.open},(0,eo.createElement)(t6.h,{asChild:!0,container:i},r)))},nx=(0,eW.j)([],{variants:{display:{default:"inline-block",none:""},font:{mono:"font-mono",sans:"font-sans"},color:{verySubtle:"text-gray-700 dark:text-graydark-700",subtle:"text-gray-1000 dark:text-graydark-1000",contrast:"text-gray-1100 dark:text-white",lo:"text-white dark:text-graydark-50",accent:"text-accent-1100 dark:text-accentdark-1100",red:"text-red-700 dark:text-red-400",green:"text-emerald-700 dark:text-emerald-500",amber:"text-amber-600 dark:text-amber-500",none:""},weight:{extrabold:"font-extrabold",bold:"font-bold",medium:"font-medium",semibold:"font-semibold",regular:"font-normal",normal:"font-normal",light:"font-light",none:""},size:{10:"text-xxs",12:"text-xs",14:"text-sm",16:"text-base",18:"text-lg",20:"text-xl",24:"text-2xl",30:"text-3xl",36:"text-4xl",40:"text-5xl",48:"text-5xl",60:"text-6xl",64:"text-6xl"},scaleSize:{12:"text-xxs md:text-xs",14:"text-xs md:text-sm",16:"text-sm md:text-base",18:"text-base md:text-lg",20:"text-base md:text-xl",24:"text-xl md:text-2xl",30:"text-2xl md:text-3xl",36:"text-3xl md:text-4xl",40:"text-4xl md:text-5xl",48:"text-4xl md:text-5xl",60:"text-5xl md:text-6xl",64:"text-5xl md:text-6xl"},noWrap:{true:"whitespace-nowrap"},underline:{accent:"underline underline-offset-2 decoration-2 decoration-accent-900 dark:decoration-accentdark-900",show:"underline underline-offset-2 decoration-gray-1100 dark:decoration-gray-500",hover:"hover:underline underline-offset-2 decoration-gray-1100 dark:decoration-gray-500",none:""},ellipsis:{true:"overflow-hidden text-ellipsis whitespace-nowrap"},wrapEllipsis:{true:"overflow-hidden text-ellipsis"}},defaultVariants:{display:"default",weight:"regular",font:"sans",color:"contrast",underline:"none"}}),nw=eo.forwardRef((e,t)=>{let{tag:n="span",className:r,font:i,color:a,weight:o,size:s,scaleSize:l,noWrap:u,underline:c,ellipsis:d,wrapEllipsis:f,...h}=e;return(0,ea.jsx)(n,{ref:t,className:(0,eW.cx)(r,nx({font:i,color:a,weight:o,size:s,scaleSize:l,underline:c,noWrap:u,ellipsis:d,wrapEllipsis:f})),...h})}),nj=eo.forwardRef((e,t)=>{let{size:n="18",...r}=e;return(0,ea.jsx)(nw,{tag:"p",...r,ref:t,weight:"regular",scaleSize:n,color:"subtle",className:(0,eW.cx)("leading-relaxed md:leading-relaxed",e.className)})}),nk=(0,eW.j)(["transition-shadow ease-in-out duration-300","shadow-sm hover:shadow","rounded","border"],{variants:{color:{default:["bg-white dark:bg-graydark-200","border-gray-400 dark:border-graydark-400"],subtle:["border-gray-200 dark:border-graydark-200"]}},defaultVariants:{color:"default"}}),nE=eo.forwardRef((e,t)=>{let{className:n,color:r,...i}=e;return(0,ea.jsx)("div",{ref:t,className:nk({className:n,color:r}),...i})});var nS=n(34406);let nC=(void 0===nS||nS.env,"production"),n_=1/60*1e3,nO="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),nM="undefined"!=typeof window?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(nO()),n_),nT=!0,nA=!1,nP=!1,nN={delta:0,timestamp:0},nR=["read","update","preRender","render","postRender"],nD=nR.reduce((e,t)=>(e[t]=function(e){let t=[],n=[],r=0,i=!1,a=!1,o=new WeakSet,s={schedule:(e,a=!1,s=!1)=>{let l=s&&i,u=l?t:n;return a&&o.add(e),-1===u.indexOf(e)&&(u.push(e),l&&i&&(r=t.length)),e},cancel:e=>{let t=n.indexOf(e);-1!==t&&n.splice(t,1),o.delete(e)},process:l=>{if(i){a=!0;return}if(i=!0,[t,n]=[n,t],n.length=0,r=t.length)for(let n=0;nnA=!0),e),{}),nL=nR.reduce((e,t)=>{let n=nD[t];return e[t]=(e,t=!1,r=!1)=>(nA||nI(),n.schedule(e,t,r)),e},{}),nZ=nR.reduce((e,t)=>(e[t]=nD[t].cancel,e),{}),nF=nR.reduce((e,t)=>(e[t]=()=>nD[t].process(nN),e),{}),nz=e=>nD[e].process(nN),nV=e=>{nA=!1,nN.delta=nT?n_:Math.max(Math.min(e-nN.timestamp,40),1),nN.timestamp=e,nP=!0,nR.forEach(nz),nP=!1,nA&&(nT=!1,nM(nV))},nI=()=>{nA=!0,nT=!0,nP||nM(nV)},nB=()=>nN,nH="undefined"!=typeof document,nU=nH?eo.useLayoutEffect:eo.useEffect;function nW(){let e=(0,eo.useRef)(!1);return nU(()=>(e.current=!0,()=>{e.current=!1}),[]),e}let nq=(0,eo.createContext)(null);function n$(e){let t=(0,eo.useRef)(null);return null===t.current&&(t.current=e()),t.current}class nK extends eo.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){let e=this.props.sizeRef.current;e.height=t.offsetHeight||0,e.width=t.offsetWidth||0,e.top=t.offsetTop,e.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function nY({children:e,isPresent:t}){let n=(0,eo.useId)(),r=(0,eo.useRef)(null),i=(0,eo.useRef)({width:0,height:0,top:0,left:0});return(0,eo.useInsertionEffect)(()=>{let{width:e,height:a,top:o,left:s}=i.current;if(t||!r.current||!e||!a)return;r.current.dataset.motionPopId=n;let l=document.createElement("style");return document.head.appendChild(l),l.sheet&&l.sheet.insertRule(`
+ */var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,a=n?Symbol.for("react.fragment"):60107,o=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,u=n?Symbol.for("react.context"):60110,c=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,h=n?Symbol.for("react.suspense"):60113,p=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,v=n?Symbol.for("react.lazy"):60116,g=n?Symbol.for("react.block"):60121,y=n?Symbol.for("react.fundamental"):60117,b=n?Symbol.for("react.responder"):60118,x=n?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case c:case d:case a:case s:case o:case h:return e;default:switch(e=e&&e.$$typeof){case u:case f:case v:case m:case l:return e;default:return t}}case i:return t}}}function j(e){return w(e)===d}t.AsyncMode=c,t.ConcurrentMode=d,t.ContextConsumer=u,t.ContextProvider=l,t.Element=r,t.ForwardRef=f,t.Fragment=a,t.Lazy=v,t.Memo=m,t.Portal=i,t.Profiler=s,t.StrictMode=o,t.Suspense=h,t.isAsyncMode=function(e){return j(e)||w(e)===c},t.isConcurrentMode=j,t.isContextConsumer=function(e){return w(e)===u},t.isContextProvider=function(e){return w(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return w(e)===f},t.isFragment=function(e){return w(e)===a},t.isLazy=function(e){return w(e)===v},t.isMemo=function(e){return w(e)===m},t.isPortal=function(e){return w(e)===i},t.isProfiler=function(e){return w(e)===s},t.isStrictMode=function(e){return w(e)===o},t.isSuspense=function(e){return w(e)===h},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===d||e===s||e===o||e===h||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===m||e.$$typeof===l||e.$$typeof===u||e.$$typeof===f||e.$$typeof===y||e.$$typeof===b||e.$$typeof===x||e.$$typeof===g)},t.typeOf=w},73887:function(e,t,n){"use strict";e.exports=n(43459)},62333:function(e,t){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */t.read=function(e,t,n,r,i){var a,o,s=8*i-r-1,l=(1<>1,c=-7,d=n?i-1:0,f=n?-1:1,h=e[t+d];for(d+=f,a=h&(1<<-c)-1,h>>=-c,c+=s;c>0;a=256*a+e[t+d],d+=f,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=r;c>0;o=256*o+e[t+d],d+=f,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,r),a-=u}return(h?-1:1)*o*Math.pow(2,a-r)},t.write=function(e,t,n,r,i,a){var o,s,l,u=8*a-i-1,c=(1<>1,f=23===i?5960464477539062e-23:0,h=r?0:a-1,p=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(isNaN(t=Math.abs(t))||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+d>=1?t+=f/l:t+=f*Math.pow(2,1-d),t*l>=2&&(o++,l/=2),o+d>=c?(s=0,o=c):o+d>=1?(s=(t*l-1)*Math.pow(2,i),o+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),o=0));i>=8;e[n+h]=255&s,h+=p,s/=256,i-=8);for(o=o<0;e[n+h]=255&o,h+=p,o/=256,u-=8);e[n+h-p]|=128*m}},39515:function(e,t,n){var r=n(38761)(n(37772),"DataView");e.exports=r},89612:function(e,t,n){var r=n(52118),i=n(96909),a=n(98138),o=n(4174),s=n(7942);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++ti?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r=i?e:r(e,t,n)}},24019:function(e,t,n){var r=n(37772)["__core-js_shared__"];e.exports=r},55463:function(e){e.exports=function(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var l=o[e?s:++i];if(!1===n(a[l],l,a))break}return t}}},83126:function(e,t,n){var r=n(23895),i=n(33880),a=n(8435),o=n(66188);e.exports=function(e){return function(t){var n=i(t=o(t))?a(t):void 0,s=n?n[0]:t.charAt(0),l=n?r(n,1).join(""):t.slice(1);return s[e]()+l}}},34311:function(e,t,n){var r=n(81207),i=n(97329),a=n(11618),o=RegExp("['’]","g");e.exports=function(e){return function(t){return r(a(i(t).replace(o,"")),e,"")}}},61655:function(e,t,n){var r=n(6435)({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"});e.exports=r},83043:function(e,t,n){var r=n(38761),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},74871:function(e,t,n){var r=n(45386),i=n(87064),a=n(59950);e.exports=function(e,t,n,o,s,l){var u=1&n,c=e.length,d=t.length;if(c!=d&&!(u&&d>c))return!1;var f=l.get(e),h=l.get(t);if(f&&h)return f==t&&h==e;var p=-1,m=!0,v=2&n?new r:void 0;for(l.set(e,t),l.set(t,e);++p-1&&e%1==0&&e-1}},94769:function(e,t,n){var r=n(22218);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},92411:function(e,t,n){var r=n(89612),i=n(80235),a=n(10326);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(a||i),string:new r}}},36417:function(e,t,n){var r=n(27937);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},86928:function(e,t,n){var r=n(27937);e.exports=function(e){return r(this,e).get(e)}},18052:function(e,t,n){var r=n(27937);e.exports=function(e){return r(this,e).has(e)}},24150:function(e,t,n){var r=n(27937);e.exports=function(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}},75179:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}},73477:function(e){e.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},77777:function(e,t,n){var r=n(30733);e.exports=function(e){var t=r(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}},99191:function(e,t,n){var r=n(38761)(Object,"create");e.exports=r},54248:function(e,t,n){var r=n(60241)(Object.keys,Object);e.exports=r},4146:function(e,t,n){e=n.nmd(e);var r=n(51242),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,o=a&&a.exports===i&&r.process,s=function(){try{var e=a&&a.require&&a.require("util").types;if(e)return e;return o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=s},37157:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},60241:function(e){e.exports=function(e,t){return function(n){return e(t(n))}}},37772:function(e,t,n){var r=n(51242),i="object"==typeof self&&self&&self.Object===Object&&self,a=r||i||Function("return this")();e.exports=a},52842:function(e){e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},52482:function(e){e.exports=function(e){return this.__data__.has(e)}},16909:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}},15243:function(e,t,n){var r=n(80235);e.exports=function(){this.__data__=new r,this.size=0}},72858:function(e){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},4417:function(e){e.exports=function(e){return this.__data__.get(e)}},8605:function(e){e.exports=function(e){return this.__data__.has(e)}},71418:function(e,t,n){var r=n(80235),i=n(10326),a=n(96738);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var o=n.__data__;if(!i||o.length<199)return o.push([e,t]),this.size=++n.size,this;n=this.__data__=new a(o)}return n.set(e,t),this.size=n.size,this}},8435:function(e,t,n){var r=n(50217),i=n(33880),a=n(63344);e.exports=function(e){return i(e)?a(e):r(e)}},54452:function(e,t,n){var r=n(77777),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g,o=r(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,function(e,n,r,i){t.push(r?i.replace(a,"$1"):n||e)}),t});e.exports=o},33812:function(e,t,n){var r=n(4795),i=1/0;e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-i?"-0":t}},87035:function(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},52153:function(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},63344:function(e){var t="\ud800-\udfff",n="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",r="\ud83c[\udffb-\udfff]",i="[^"+t+"]",a="(?:\ud83c[\udde6-\uddff]){2}",o="[\ud800-\udbff][\udc00-\udfff]",s="(?:"+n+"|"+r+")?",l="[\\ufe0e\\ufe0f]?",u="(?:\\u200d(?:"+[i,a,o].join("|")+")"+l+s+")*",c=RegExp(r+"(?="+r+")|(?:"+[i+n+"?",n,a,o,"["+t+"]"].join("|")+")"+(l+s+u),"g");e.exports=function(e){return e.match(c)||[]}},75304:function(e){var t="\ud800-\udfff",n="\\u2700-\\u27bf",r="a-z\\xdf-\\xf6\\xf8-\\xff",i="A-Z\\xc0-\\xd6\\xd8-\\xde",a="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",o="['’]",s="["+a+"]",l="["+r+"]",u="[^"+t+a+"\\d+"+n+r+i+"]",c="(?:\ud83c[\udde6-\uddff]){2}",d="[\ud800-\udbff][\udc00-\udfff]",f="["+i+"]",h="(?:"+l+"|"+u+")",p="(?:"+o+"(?:d|ll|m|re|s|t|ve))?",m="(?:"+o+"(?:D|LL|M|RE|S|T|VE))?",v="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\ud83c[\udffb-\udfff])?",g="[\\ufe0e\\ufe0f]?",y="(?:\\u200d(?:"+["[^"+t+"]",c,d].join("|")+")"+g+v+")*",b="(?:"+["["+n+"]",c,d].join("|")+")"+(g+v+y),x=RegExp([f+"?"+l+"+"+p+"(?="+[s,f,"$"].join("|")+")","(?:"+f+"|"+u+")+"+m+"(?="+[s,f+h,"$"].join("|")+")",f+"?"+h+"+"+p,f+"+"+m,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])","\\d+",b].join("|"),"g");e.exports=function(e){return e.match(x)||[]}},96009:function(e,t,n){var r=n(82108),i=n(34311)(function(e,t,n){return t=t.toLowerCase(),e+(n?r(t):t)});e.exports=i},82108:function(e,t,n){var r=n(66188),i=n(23779);e.exports=function(e){return i(r(e).toLowerCase())}},54073:function(e,t,n){var r=n(29259),i=n(61100),a=n(7642),o=Math.max,s=Math.min;e.exports=function(e,t,n){var l,u,c,d,f,h,p=0,m=!1,v=!1,g=!0;if("function"!=typeof e)throw TypeError("Expected a function");function y(t){var n=l,r=u;return l=u=void 0,p=t,d=e.apply(r,n)}function b(e){var n=e-h,r=e-p;return void 0===h||n>=t||n<0||v&&r>=c}function x(){var e,n,r,a=i();if(b(a))return w(a);f=setTimeout(x,(e=a-h,n=a-p,r=t-e,v?s(r,c-n):r))}function w(e){return(f=void 0,g&&l)?y(e):(l=u=void 0,d)}function j(){var e,n=i(),r=b(n);if(l=arguments,u=this,h=n,r){if(void 0===f)return p=e=h,f=setTimeout(x,t),m?y(e):d;if(v)return clearTimeout(f),f=setTimeout(x,t),y(h)}return void 0===f&&(f=setTimeout(x,t)),d}return t=a(t)||0,r(n)&&(m=!!n.leading,c=(v="maxWait"in n)?o(a(n.maxWait)||0,t):c,g="trailing"in n?!!n.trailing:g),j.cancel=function(){void 0!==f&&clearTimeout(f),p=0,l=h=u=f=void 0},j.flush=function(){return void 0===f?d:w(i())},j}},97329:function(e,t,n){var r=n(61655),i=n(66188),a=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,o=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");e.exports=function(e){return(e=i(e))&&e.replace(a,r).replace(o,"")}},41225:function(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},72579:function(e,t,n){var r=n(13324);e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},93352:function(e,t,n){var r=n(32726),i=n(1369);e.exports=function(e,t){return null!=e&&i(e,t,r)}},95041:function(e,t,n){var r=n(20187),i=n(1369);e.exports=function(e,t){return null!=e&&i(e,t,r)}},23059:function(e){e.exports=function(e){return e}},79631:function(e,t,n){var r=n(15183),i=n(15125),a=Object.prototype,o=a.hasOwnProperty,s=a.propertyIsEnumerable,l=r(function(){return arguments}())?r:function(e){return i(e)&&o.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},86152:function(e){var t=Array.isArray;e.exports=t},67878:function(e,t,n){var r=n(61049),i=n(61158);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},73226:function(e,t,n){e=n.nmd(e);var r=n(37772),i=n(36330),a=t&&!t.nodeType&&t,o=a&&e&&!e.nodeType&&e,s=o&&o.exports===a?r.Buffer:void 0,l=s?s.isBuffer:void 0;e.exports=l||i},61049:function(e,t,n){var r=n(53366),i=n(29259);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},61158:function(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},29259:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},15125:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},4795:function(e,t,n){var r=n(53366),i=n(15125);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},77598:function(e,t,n){var r=n(35522),i=n(47826),a=n(4146),o=a&&a.isTypedArray,s=o?i(o):r;e.exports=s},90249:function(e,t,n){var r=n(1634),i=n(86411),a=n(67878);e.exports=function(e){return a(e)?r(e):i(e)}},19950:function(e,t,n){var r=n(13940),i=n(26548),a=n(68286);e.exports=function(e,t){var n={};return t=a(t,3),i(e,function(e,i,a){r(n,t(e,i,a),e)}),n}},34519:function(e,t,n){var r=n(13940),i=n(26548),a=n(68286);e.exports=function(e,t){var n={};return t=a(t,3),i(e,function(e,i,a){r(n,i,t(e,i,a))}),n}},30733:function(e,t,n){var r=n(96738);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(i.Cache||r),n}i.Cache=r,e.exports=i},61100:function(e,t,n){var r=n(37772);e.exports=function(){return r.Date.now()}},65798:function(e,t,n){var r=n(20256),i=n(82952),a=n(21401),o=n(33812);e.exports=function(e){return a(e)?r(o(e)):i(e)}},57370:function(e,t,n){var r=n(34311)(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()});e.exports=r},30981:function(e){e.exports=function(){return[]}},36330:function(e){e.exports=function(){return!1}},7642:function(e,t,n){var r=n(51704),i=n(29259),a=n(4795),o=0/0,s=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(a(e))return o;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=l.test(e);return n||u.test(e)?c(e.slice(2),n?2:8):s.test(e)?o:+e}},66188:function(e,t,n){var r=n(1054);e.exports=function(e){return null==e?"":r(e)}},23779:function(e,t,n){var r=n(83126)("toUpperCase");e.exports=r},11618:function(e,t,n){var r=n(45981),i=n(83559),a=n(66188),o=n(75304);e.exports=function(e,t,n){return(e=a(e),void 0===(t=n?void 0:t))?i(e)?o(e):r(e):e.match(t)||[]}},53207:function(e,t,n){var r=n(96570);r.prototype.formulaEval=function(){"use strict";for(var e,t,n,r=[],i=this.value,a=0;a"+t.value+""+i[a].show+""+e.value+"",type:10}):r.push({value:(1!=t.type?"(":"")+t.value+(1!=t.type?")":"")+""+e.value+"",type:1})):2===i[a].type||9===i[a].type?(e=r.pop(),t=r.pop(),r.push({value:(1!=t.type?"(":"")+t.value+(1!=t.type?")":"")+i[a].show+(1!=e.type?"(":"")+e.value+(1!=e.type?")":""),type:i[a].type})):12===i[a].type&&(e=r.pop(),t=r.pop(),n=r.pop(),r.push({value:i[a].show+"("+n.value+","+t.value+","+e.value+")",type:12}));return r[0].value},e.exports=r},66655:function(e,t,n){"use strict";var r=n(72346);function i(e,t){for(var n=0;np.length-2?p.length-1:e.length-l;n>0;n--)if(void 0!==p[n])for(i=0;i
0&&En)s.push(e);else{for(;n>=i&&!c||c&&i1)throw new r.Exception("Uncaught Syntax error");return a[0].value>1e15?"Infinity":parseFloat(a[0].value.toFixed(15))},r.eval=function(e,t,n){return void 0===t?this.lex(e).toPostfix().postfixEval():void 0!==n?this.lex(e,t).toPostfix().postfixEval(n):void 0!==t.length?this.lex(e,t).toPostfix().postfixEval():this.lex(e).toPostfix().postfixEval(t)},e.exports=r},38617:function(e,t,n){"use strict";n.d(t,{F:function(){return u},f:function(){return c}});var r=n(2784);let i=["light","dark"],a="(prefers-color-scheme: dark)",o="undefined"==typeof window,s=(0,r.createContext)(void 0),l={setTheme:e=>{},themes:[]},u=()=>{var e;return null!==(e=(0,r.useContext)(s))&&void 0!==e?e:l},c=e=>(0,r.useContext)(s)?r.createElement(r.Fragment,null,e.children):r.createElement(f,e),d=["light","dark"],f=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:o=!0,storageKey:l="theme",themes:u=d,defaultTheme:c=n?"system":"light",attribute:f="data-theme",value:g,children:y,nonce:b})=>{let[x,w]=(0,r.useState)(()=>p(l,c)),[j,k]=(0,r.useState)(()=>p(l)),E=g?Object.values(g):u,S=(0,r.useCallback)(e=>{let r=e;if(!r)return;"system"===e&&n&&(r=v());let a=g?g[r]:r,s=t?m():null,l=document.documentElement;if("class"===f?(l.classList.remove(...E),a&&l.classList.add(a)):a?l.setAttribute(f,a):l.removeAttribute(f),o){let e=i.includes(c)?c:null,t=i.includes(r)?r:e;l.style.colorScheme=t}null==s||s()},[]),C=(0,r.useCallback)(e=>{w(e);try{localStorage.setItem(l,e)}catch(e){}},[e]),_=(0,r.useCallback)(t=>{k(v(t)),"system"===x&&n&&!e&&S("system")},[x,e]);(0,r.useEffect)(()=>{let e=window.matchMedia(a);return e.addListener(_),_(e),()=>e.removeListener(_)},[_]),(0,r.useEffect)(()=>{let e=e=>{e.key===l&&C(e.newValue||c)};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[C]),(0,r.useEffect)(()=>{S(null!=e?e:x)},[e,x]);let O=(0,r.useMemo)(()=>({theme:x,setTheme:C,forcedTheme:e,resolvedTheme:"system"===x?j:x,themes:n?[...u,"system"]:u,systemTheme:n?j:void 0}),[x,C,e,j,n,u]);return r.createElement(s.Provider,{value:O},r.createElement(h,{forcedTheme:e,disableTransitionOnChange:t,enableSystem:n,enableColorScheme:o,storageKey:l,themes:u,defaultTheme:c,attribute:f,value:g,children:y,attrs:E,nonce:b}),y)},h=(0,r.memo)(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:o,enableColorScheme:s,defaultTheme:l,value:u,attrs:c,nonce:d})=>{let f="system"===l,h="class"===n?`var d=document.documentElement,c=d.classList;c.remove(${c.map(e=>`'${e}'`).join(",")});`:`var d=document.documentElement,n='${n}',s='setAttribute';`,p=s?i.includes(l)&&l?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${l}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",m=(e,t=!1,r=!0)=>{let a=u?u[e]:e,o=t?e+"|| ''":`'${a}'`,l="";return s&&r&&!t&&i.includes(e)&&(l+=`d.style.colorScheme = '${e}';`),"class"===n?l+=t||a?`c.add(${o})`:"null":a&&(l+=`d[s](n,${o})`),l},v=e?`!function(){${h}${m(e)}}()`:o?`!function(){try{${h}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${f})){var t='${a}',m=window.matchMedia(t);if(m.media!==t||m.matches){${m("dark")}}else{${m("light")}}}else if(e){${u?`var x=${JSON.stringify(u)};`:""}${m(u?"x[e]":"e",!0)}}${f?"":"else{"+m(l,!1,!1)+"}"}${p}}catch(e){}}()`:`!function(){try{${h}var e=localStorage.getItem('${t}');if(e){${u?`var x=${JSON.stringify(u)};`:""}${m(u?"x[e]":"e",!0)}}else{${m(l,!1,!1)};}${p}}catch(t){}}();`;return r.createElement("script",{nonce:d,dangerouslySetInnerHTML:{__html:v}})},()=>!0),p=(e,t)=>{let n;if(!o){try{n=localStorage.getItem(e)||void 0}catch(e){}return n||t}},m=()=>{let e=document.createElement("style");return e.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(e)},1)}},v=e=>(e||(e=window.matchMedia(a)),e.matches?"dark":"light")},86570:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return n(83391)}])},35599:function(e,t,n){"use strict";n.d(t,{Ul:function(){return s},WD:function(){return l},fu:function(){return c},o4:function(){return u}});var r=n(52322),i=n(36655),a=n(82851),o=n(99182);function s(e){let{currentPage:t,parentPage:n,commandPage:s,className:l,...u}=e,c=(0,o.U8)(e=>e.search);if((null==n?void 0:n.namespace)===(null==t?void 0:t.namespace)&&!c)return(0,r.jsx)(o.mY.Item,{className:(0,a.cx)((0,i.Vkc)(),"group",l),value:"".concat(null==s?void 0:s.label," ").concat(u.children.toString()),...u})}function l(e){let{currentPage:t,commandPage:n,className:s,...l}=e,u=(0,o.U8)(e=>e.search),c=n.namespace.startsWith((null==t?void 0:t.namespace)||"");if(u&&c||n.namespace===(null==t?void 0:t.namespace))return(0,r.jsx)(o.mY.Item,{className:(0,a.cx)((0,i.Vkc)(),"group",s),value:"".concat(n.label," ").concat(l.children.toString()),...l})}function u(e){let{currentPage:t,commandPage:n,className:s,...l}=e,u=(0,o.U8)(e=>e.search),c=n.namespace.startsWith((null==t?void 0:t.namespace)||"");if(u&&c||!t||n.namespace===(null==t?void 0:t.namespace))return(0,r.jsx)(o.mY.Item,{className:(0,a.cx)((0,i.Vkc)(),"group",s),value:"".concat(n.label," ").concat(l.children.toString()),...l})}function c(e){let{heading:t,currentPage:n,commandPage:a,...s}=e,l=(0,o.U8)(e=>e.search);return(0,r.jsx)(o.mY.Group,{heading:l&&(null==n?void 0:n.namespace)!==a.namespace&&(0,r.jsx)(i.__J,{className:"px-1",size:"12",children:a.label}),...s})}n(2784)},91492:function(e,t,n){"use strict";n.d(t,{F:function(){return g}});var r=n(52322),i=n(36655),a=n(61020),o=n(57016),s=n(98334),l=n(5632),u=n(76838),c=n(56328),d=n(82229),f=n(94613),h=n(98131),p=n(30291),m=n(97112),v=n(2784);function g(e){var t,n;let{id:g,trigger:y,address:b,publicKey:x,contentProps:w,buttonProps:j}=e,k=(0,l.useRouter)(),{setFilter:E,resetFilters:S}=(0,c.l)(),{setFilter:C,resetFilters:_}=(0,u.G)(),O=(0,o.uf)(),M=(0,o.s2)(),T=(0,f.l)(),A=(0,d.I)(),P=function(){let{openConfirmDialog:e}=(0,m.Rh)(),t=(0,o.IK)();return(0,v.useCallback)(n=>e({title:"Delete contract",action:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.Jrl,{}),"Delete"]}),variant:"red",body:(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)(i.nvN,{size:"14",children:"Are you sure you would like to delete the following contract:"}),(0,r.jsxs)(i.nvN,{size:"14",font:"mono",children:[n.slice(0,20),"..."]})]}),onConfirm:async()=>{(await t.delete({params:{id:n}})).error&&(0,i.OHV)("Error deleting contract."),(0,i.OPV)("Successfully deleted contract.")}}),[e,t])}();return(0,r.jsxs)(i.h_2,{trigger:y||(0,r.jsx)(i.zxk,{variant:"ghost",icon:"hover",...j,children:(0,r.jsx)(a.iG7,{})}),contentProps:{align:"start",...w,onClick:e=>{e.stopPropagation()}},children:[(0,r.jsx)("div",{className:"px-1.5 py-1",children:(0,r.jsxs)(i.xvT,{size:"14",weight:"medium",color:"subtle",children:["Contract ",x.slice(0,24),"..."]})}),(0,r.jsx)(i.Juw,{children:"Filters"}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{S(),E({id:"addressContains",value:b,label:"Address contains ".concat(b)}),k.push(s._.hosts.index)},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.q0D,{})}),"Filter hosts by host address"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{_(),C((0,h.e)(b)),k.push(s._.contracts.index)},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.q0D,{})}),"Filter contracts by host address"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{_(),C((0,p.V)(x)),k.push(s._.contracts.index)},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.q0D,{})}),"Filter contracts by host public key"]}),(0,r.jsx)(i.Juw,{children:"Actions"}),(null===(t=O.data)||void 0===t?void 0:t.find(e=>e===b))?(0,r.jsxs)(i.Xiv,{onSelect:()=>T([],[b]),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.nCM,{})}),"Remove host address from blocklist"]}):(0,r.jsxs)(i.Xiv,{onSelect:()=>T([b],[]),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.nCM,{})}),"Add host address to blocklist"]}),(null===(n=M.data)||void 0===n?void 0:n.find(e=>e===x))?(0,r.jsxs)(i.Xiv,{onSelect:()=>A([],[x]),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.nCM,{})}),"Remove host public key from allowlist"]}):(0,r.jsxs)(i.Xiv,{onSelect:()=>A([x],[]),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.nCM,{})}),"Add host public key to allowlist"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>P(g),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.Jrl,{})}),"Delete contract"]}),(0,r.jsx)(i.Juw,{children:"Copy"}),(0,r.jsxs)(i.Xiv,{onSelect:()=>(0,i.vQq)(g,"contract ID"),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.olJ,{})}),"Contract ID"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>(0,i.vQq)(x,"host public key"),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.olJ,{})}),"Host public key"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>(0,i.vQq)(b,"host address"),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.olJ,{})}),"Host address"]})]})}},14613:function(e,t,n){"use strict";n.d(t,{F:function(){return N}});var r=n(52322),i=n(36655),a=n(35599);let o={namespace:"contracts/filterExpiryDate",label:"Contracts filter by expiry date"},s=[{id:"expiry",value:"day",label:"expires today",fn:e=>{let t=new Date().getTime(),n=t+(0,i.NrH)(1);return e.endTimet}},{id:"expiry",value:"week",label:"expires this week",fn:e=>{let t=new Date().getTime(),n=t+(0,i.BL0)(1);return e.endTimet}},{id:"expiry",value:"month",label:"expires this month",fn:e=>{let t=new Date().getTime(),n=t+(0,i.xLV)(1);return e.endTimet}},{id:"expiry",value:"nextMonth",label:"expires next month",fn:e=>{let t=new Date().getTime(),n=t+(0,i.xLV)(2);return e.endTimet}},{id:"expiry",value:"year",label:"expires this year",fn:e=>{let t=new Date().getTime(),n=t+(0,i.ivg)(1);return e.endTimet}},{id:"expiry",value:"expired",label:"expired",fn:e=>{let t=new Date().getTime();return e.endTime(0,r.jsx)(a.WD,{currentPage:t,commandPage:o,onSelect:()=>{n(e)},children:e.label},e.id+e.value))})}let u={namespace:"contracts/filterFormationDate",label:"Contracts filter by formation date"},c=[{id:"formationDate",value:"day",label:"formed in the last day",fn:e=>{let t=new Date().getTime()-(0,i.NrH)(1);return e.startTime>=t}},{id:"formationDate",value:"week",label:"formed in the last week",fn:e=>{let t=new Date().getTime()-(0,i.BL0)(1);return e.startTime>=t}},{id:"formationDate",value:"twoWeeks",label:"formed in the last two weeks",fn:e=>{let t=new Date().getTime()-(0,i.BL0)(2);return e.startTime>=t}},{id:"formationDate",value:"month",label:"formed in the last month",fn:e=>{let t=new Date().getTime()-(0,i.xLV)(1);return e.startTime>=t}},{id:"formationDate",value:"twoMonths",label:"formed in the last two months",fn:e=>{let t=new Date().getTime()-(0,i.xLV)(2);return e.startTime>=t}},{id:"formationDate",value:"year",label:"formed in the last year",fn:e=>{let t=new Date().getTime()-(0,i.ivg)(1);return e.startTime>=t}}];function d(e){let{currentPage:t,select:n}=e;return(0,r.jsx)(a.fu,{currentPage:t,commandPage:u,children:c.map(e=>(0,r.jsx)(a.WD,{currentPage:t,commandPage:u,onSelect:()=>{n(e)},children:e.label},e.id+e.value))})}let f={namespace:"contracts/filterRenewDate",label:"Contracts filter by renew date"},h=[{id:"renewDate",value:"day",label:"renewed in the last day",fn:e=>{let t=new Date().getTime()-(0,i.NrH)(1);return e.isRenewed&&e.startTime>=t}},{id:"renewDate",value:"week",label:"renewed in the last week",fn:e=>{let t=new Date().getTime()-(0,i.BL0)(1);return e.isRenewed&&e.startTime>=t}},{id:"renewDate",value:"twoWeeks",label:"renewed in the last two weeks",fn:e=>{let t=new Date().getTime()-(0,i.BL0)(2);return e.isRenewed&&e.startTime>=t}},{id:"renewDate",value:"month",label:"renewed in the last month",fn:e=>{let t=new Date().getTime()-(0,i.xLV)(1);return e.isRenewed&&e.startTime>=t}},{id:"renewDate",value:"twoMonths",label:"renewed in the last two months",fn:e=>{let t=new Date().getTime()-(0,i.xLV)(2);return e.isRenewed&&e.startTime>=t}},{id:"renewDate",value:"year",label:"renewed in the last year",fn:e=>{let t=new Date().getTime()-(0,i.ivg)(1);return e.isRenewed&&e.startTime>=t}}];function p(e){let{currentPage:t,select:n}=e;return(0,r.jsx)(a.fu,{currentPage:t,commandPage:f,children:h.map(e=>(0,r.jsx)(a.WD,{currentPage:t,commandPage:f,onSelect:()=>{n(e)},children:e.label},e.id+e.value))})}var m=n(97112),v=n(98131);let g={namespace:"contracts/filterAddress",label:"Contracts filter by address"};function y(e){let{select:t,currentPage:n}=e,{openDialog:i}=(0,m.Rh)(),o=(0,v.e)("");return(0,r.jsx)(a.fu,{currentPage:n,commandPage:g,children:(0,r.jsx)(a.WD,{currentPage:n,commandPage:g,onSelect:()=>{t(),i("contractsFilterAddress")},children:o.label})})}function b(e){let{select:t,currentPage:n,parentPage:i,commandPage:o}=e,{openDialog:s}=(0,m.Rh)();return(0,r.jsx)(a.Ul,{currentPage:n,parentPage:i,commandPage:o,onSelect:()=>{t(),s("contractsFilterAddress")},children:g.label})}var x=n(30291);let w={namespace:"contracts/filterPublicKey",label:"Contracts filter by public key"};function j(e){let{select:t,currentPage:n}=e,i=(0,x.V)(""),{openDialog:o}=(0,m.Rh)();return(0,r.jsx)(a.fu,{currentPage:n,commandPage:w,children:(0,r.jsx)(a.WD,{currentPage:n,commandPage:w,onSelect:()=>{t(),o("contractsFilterPublicKey")},children:i.label})})}function k(e){let{select:t,currentPage:n,parentPage:i,commandPage:o}=e,{openDialog:s}=(0,m.Rh)();return(0,r.jsx)(a.Ul,{currentPage:n,parentPage:i,commandPage:o,onSelect:()=>{t(),s("contractsFilterPublicKey")},children:w.label})}var E=n(11948);let S={namespace:"contracts/filterContractSet",label:"Contracts filter by contract set"};function C(e){let{select:t,currentPage:n}=e,i=(0,E.l)(""),{openDialog:o}=(0,m.Rh)();return(0,r.jsx)(a.fu,{currentPage:n,commandPage:S,children:(0,r.jsx)(a.WD,{currentPage:n,commandPage:S,onSelect:()=>{t(),o("contractsFilterContractSet")},children:i.label})})}function _(e){let{select:t,currentPage:n,parentPage:i,commandPage:o}=e,{openDialog:s}=(0,m.Rh)();return(0,r.jsx)(a.Ul,{currentPage:n,parentPage:i,commandPage:o,onSelect:()=>{t(),s("contractsFilterContractSet")},children:S.label})}function O(e){let{currentPage:t,select:n}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(y,{currentPage:t,select:n}),(0,r.jsx)(j,{currentPage:t,select:n}),(0,r.jsx)(C,{currentPage:t,select:n}),(0,r.jsx)(l,{currentPage:t,select:n}),(0,r.jsx)(d,{currentPage:t,select:n}),(0,r.jsx)(p,{currentPage:t,select:n})]})}let M={namespace:"contracts",label:"Contracts"};function T(e){let{currentPage:t,parentPage:n,pushPage:i,select:s}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(b,{currentPage:t,parentPage:n,commandPage:M,select:s}),(0,r.jsx)(k,{currentPage:t,parentPage:n,commandPage:M,select:s}),(0,r.jsx)(_,{currentPage:t,parentPage:n,commandPage:M,select:s}),(0,r.jsx)(a.Ul,{currentPage:t,parentPage:n,commandPage:M,onSelect:()=>{i(u)},children:u.label}),(0,r.jsx)(a.Ul,{currentPage:t,parentPage:n,commandPage:M,onSelect:()=>{i(o)},children:o.label}),(0,r.jsx)(a.Ul,{currentPage:t,parentPage:n,commandPage:M,onSelect:()=>{i(f)},children:f.label})]})}var A=n(76838),P=n(2784);function N(e){let{currentPage:t,parentPage:n,pushPage:i,beforeSelect:a,afterSelect:o}=e,{setFilter:s}=(0,A.G)(),l=(0,P.useCallback)(e=>{a&&a(),e&&s(e),o&&o()},[s,a,o]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(T,{parentPage:n,currentPage:t,pushPage:i,select:l}),(0,r.jsx)(O,{currentPage:t,select:l})]})}},98131:function(e,t,n){"use strict";n.d(t,{e:function(){return u},p:function(){return f}});var r=n(52322),i=n(36655),a=n(76838),o=n(7114),s=n(24511),l=n(97112);function u(e){return{id:"addressContains",value:e,label:"address contains ".concat(e),fn:t=>t.hostIp.includes(e)}}let c={address:""},d=s.Ry().shape({address:s.Z_().required("Required")});function f(e){let{trigger:t,open:n,onOpenChange:s}=e,{closeDialog:f}=(0,l.Rh)(),{setFilter:h}=(0,a.G)(),p=(0,o.TA)({initialValues:c,validationSchema:d,onSubmit:e=>{h(u(e.address)),p.resetForm(),f()}});return(0,r.jsx)(i.VqE,{trigger:t,title:"Filter by address",open:n,onOpenChange:e=>{e||p.resetForm(),s(e)},contentVariants:{className:"w-[400px]"},onSubmit:p.handleSubmit,children:(0,r.jsx)("div",{className:"flex flex-col gap-4",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(i.cB7,{formik:p,title:"Address",name:"address",placeholder:"Partial match against domain or IP",autoComplete:"off",type:"text",variants:{size:"medium"}}),(0,r.jsx)(i.IKw,{formik:p,size:"medium",children:"Filter"})]})})})}},11948:function(e,t,n){"use strict";n.d(t,{X:function(){return u},l:function(){return l}});var r=n(52322),i=n(36655),a=n(76838),o=n(63955),s=n(2784);function l(e){return{id:"contractSetsInclude",value:e,label:"contract in set ".concat(e),fn:t=>{var n;return null===(n=t.contractSets)||void 0===n?void 0:n.includes(e)}}}function u(e){var t;let{trigger:n,open:u,onOpenChange:c}=e,{setFilter:d,contractSets:f}=(0,a.G)(),h={contractSet:null===(t=f.data)||void 0===t?void 0:t[0]},p=(0,o.cI)({mode:"all",defaultValues:h}),{handleOpenChange:m,closeAndReset:v}=(0,i.t0Y)({form:p,onOpenChange:c,defaultValues:h}),g=function(e){let{contractSets:t}=e;return{contractSet:{type:"select",title:"Contract set",options:t.map(e=>({label:e,value:e})),placeholder:"autopilot",validation:{required:"required"}}}}({contractSets:f.data||[]}),y=(0,s.useCallback)(e=>{d(l(e.contractSet)),v()},[d,v]),b=(0,i.WsO)(g);return(0,r.jsx)(i.VqE,{trigger:n,title:"Filter by contract set",open:u,onOpenChange:m,contentVariants:{className:"w-[400px]"},onSubmit:p.handleSubmit(y,b),children:(0,r.jsx)("div",{className:"flex flex-col gap-4",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(i.WyV,{form:p,fields:g,name:"contractSet"}),(0,r.jsx)(i.ZqQ,{form:p,size:"medium",children:"Filter"})]})})})}},30291:function(e,t,n){"use strict";n.d(t,{C:function(){return f},V:function(){return u}});var r=n(52322),i=n(36655),a=n(76838),o=n(7114),s=n(24511),l=n(97112);function u(e){return{id:"publicKeyContains",value:e,label:"public key contains ".concat((0,i.$Gg)(e,20)),fn:t=>t.hostKey.includes(e)}}let c={publicKey:""},d=s.Ry().shape({publicKey:s.Z_().required("Required")});function f(e){let{trigger:t,open:n,onOpenChange:s}=e,{closeDialog:f}=(0,l.Rh)(),{setFilter:h}=(0,a.G)(),p=(0,o.TA)({initialValues:c,validationSchema:d,onSubmit:e=>{h(u(e.publicKey)),p.resetForm(),f()}});return(0,r.jsx)(i.VqE,{trigger:t,title:"Filter by public key",open:n,onOpenChange:e=>{e||p.resetForm(),s(e)},contentVariants:{className:"w-[400px]"},onSubmit:p.handleSubmit,children:(0,r.jsx)("div",{className:"flex flex-col gap-4",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(i.cB7,{formik:p,title:"Public key",name:"publicKey",placeholder:"ed25519:02aabd26e627fd...",autoComplete:"off",type:"text",variants:{size:"medium"}}),(0,r.jsx)(i.IKw,{formik:p,size:"medium",children:"Filter"})]})})})}},90721:function(e,t,n){"use strict";n.d(t,{s:function(){return s}});var r=n(52322),i=n(36655),a=n(61020),o=n(97112);function s(e){let{name:t}=e,{openDialog:n}=(0,o.Rh)();return(0,r.jsxs)(i.h_2,{trigger:(0,r.jsx)(i.zxk,{variant:"ghost",icon:"hover",children:(0,r.jsx)(a.fi8,{size:16})}),contentProps:{align:"start"},children:[(0,r.jsx)(i.Juw,{children:"Actions"}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{n("filesBucketPolicy",t)},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.Zbu,{})}),"Change policy"]}),(0,r.jsxs)(i.Xiv,{disabled:"default"===t,onSelect:()=>{n("filesDeleteBucket",t)},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.Jrl,{})}),"Delete bucket"]})]})}},23094:function(e,t,n){"use strict";n.d(t,{z:function(){return f}});var r=n(52322),i=n(36655),a=n(18121),o=n(57016),s=n(82851),l=n(67693),u=n(70899);function c(e){var t,n,s,c;let{path:f,isUploading:h,type:p,health:m,size:v}=e,g="directory"===p,y=(0,o.wy)({disabled:h||g,params:(0,u.W0)(f),config:{swr:{dedupingInterval:5e3}}}),{displayHealth:b,label:x}=(0,a.B)({health:m,size:v,isDirectory:g});if(y.isValidating)return(0,r.jsx)(d,{displayHealth:b,label:x,children:(0,r.jsx)("div",{className:"flex justify-center my-2",children:(0,r.jsx)(i.xgg,{})})});if(!(null===(t=y.data)||void 0===t?void 0:t.object))return(0,r.jsx)(d,{displayHealth:b,label:x,children:(0,r.jsx)(i.xvT,{size:"12",children:"Error fetching slab metadata."})});let w=(0,l.Z)((null===(n=y.data.object.slabs)||void 0===n?void 0:n.map(e=>{var t;return{...e.slab,key:"".concat(e.offset).concat(e.length).concat(e.slab.key),isPartialSlab:!!e.slab.shards,contractSetShards:(null===(t=e.slab.shards)||void 0===t?void 0:t.length)?function(e){let{totalShards:t,minShards:n,health:r}=e,i=Math.ceil(r*(t-n))+n;return i<=0?0:i>t?t:i}({totalShards:e.slab.shards.length,minShards:e.slab.minShards,health:e.slab.health}):0}}))||[],"contractSetShards");return(0,r.jsx)(d,{className:w.length>15?"h-[300px]":"",displayHealth:b,label:x,minShards:null===(s=w.find(e=>e.minShards))||void 0===s?void 0:s.minShards,totalShards:null===(c=w.find(e=>e.shards))||void 0===c?void 0:c.shards.length,children:w.map(e=>(0,r.jsxs)("div",{className:"flex justify-between gap-2",children:[(0,r.jsxs)(i.xvT,{size:"12",color:"subtle",className:"flex items-center",font:"mono",children:["Slab ",e.key.replace("key:","").slice(0,4),":"]}),(0,r.jsx)(i.xvT,{size:"12",className:"flex items-center",children:e.isPartialSlab?"".concat(e.contractSetShards,"/").concat(e.shards.length):"partial slab"})]},e.key))})}function d(e){let{className:t,displayHealth:n,label:a,children:o,minShards:l,totalShards:u}=e;return(0,r.jsxs)("div",{className:(0,s.cx)("z-10 flex flex-col pb-1 -mx-1 overflow-hidden",t),children:[(0,r.jsxs)("div",{className:"flex justify-between gap-2 pt-0.5 pb-px px-2",children:[(0,r.jsx)(i.xvT,{size:"12",children:a}),(0,r.jsxs)(i.xvT,{size:"12",children:[(100*n).toFixed(0),"%"]})]}),l&&u?(0,r.jsxs)("div",{className:"flex justify-between gap-2 pt-0.5 pb-px px-2",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",children:"redundancy"}),(0,r.jsxs)(i.xvT,{size:"12",color:"subtle",children:[l," of ",u]})]}):null,(0,r.jsx)("div",{className:"px-2",children:(0,r.jsx)(i.Z0O,{className:"w-full my-1"})}),(0,r.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,r.jsx)(i.xrM,{children:(0,r.jsx)("div",{className:"px-2",children:o})})})]})}function f(e){let{name:t,isUploading:n,type:o,health:s,size:l}=e,u="directory"===o,{displayHealth:d,label:f,color:h,icon:p}=(0,a.B)({health:s,size:l,isDirectory:u}),m="".concat((100*d).toFixed(0),"%");return u?".."===t?null:(0,r.jsx)(i.zsw,{rootProps:{openDelay:100},trigger:(0,r.jsxs)("div",{className:"flex items-center gap-1 cursor-pointer",children:[(0,r.jsx)(i.xvT,{color:h,children:p}),(0,r.jsx)(i.xvT,{color:"verySubtle",size:"12",children:m})]}),children:(0,r.jsx)("div",{className:"z-10 flex flex-col -mx-1 overflow-hidden",children:(0,r.jsxs)("div",{className:"flex justify-between gap-2 py-0.5 px-2",children:[(0,r.jsx)(i.xvT,{size:"12",children:f}),(0,r.jsx)(i.xvT,{size:"12",children:m})]})})}):n?(0,r.jsx)(i.xgg,{}):(0,r.jsx)(i.zsw,{rootProps:{openDelay:100},trigger:(0,r.jsxs)("div",{className:"flex items-center gap-1 cursor-pointer",children:[(0,r.jsx)(i.xvT,{color:h,children:p}),(0,r.jsx)(i.xvT,{color:"verySubtle",size:"12",children:m})]}),children:(0,r.jsx)(c,{...e})})}},84301:function(e,t,n){"use strict";n.d(t,{I:function(){return d}});var r=n(52322),i=n(36655),a=n(61020),o=n(97112),s=n(2784),l=n(57016),u=n(21487),c=n(70899);function d(e){let{path:t,size:n}=e,d=function(){let{openConfirmDialog:e}=(0,o.Rh)(),t=(0,l.xw)();return(0,s.useCallback)((n,o)=>e({title:"Delete directory",action:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.Jrl,{}),"Delete"]}),variant:"red",body:(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsxs)(i.nvN,{size:"14",children:["Are you sure you would like to delete the following directory which contains ",(0,u.vW)(o)," of data:"]}),(0,r.jsx)(i.nvN,{size:"14",font:"mono",className:"break-words",children:n})]}),onConfirm:async()=>{(await t.delete({params:{...(0,c.W0)(n),batch:!0}})).error&&(0,i.OHV)("Error deleting directory."),(0,i.OPV)("Successfully deleted directory.")}}),[e,t])}(),{openDialog:f}=(0,o.Rh)();return(0,r.jsxs)(i.h_2,{trigger:(0,r.jsx)(i.zxk,{variant:"ghost",icon:"hover",children:(0,r.jsx)(a.ROc,{size:16})}),contentProps:{align:"start",onClick:e=>{e.stopPropagation()}},children:[(0,r.jsx)(i.Juw,{children:"Actions"}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{f("fileRename",t)},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.dr6,{})}),"Rename directory"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{d(t,n)},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.Jrl,{})}),"Delete directory"]})]})}},87023:function(e,t,n){"use strict";n.d(t,{e:function(){return f}});var r=n(52322),i=n(36655),a=n(61020),o=n(97112),s=n(2784),l=n(57016),u=n(70899);function c(e){let{path:t}=e,n=(0,l.wy)({params:(0,u.W0)(t),config:{swr:{dedupingInterval:5e3}}});return(0,r.jsxs)(i.Xiv,{disabled:!n.data,onSelect:()=>{n.data&&(0,i.vQq)(JSON.stringify(n.data.object,null,2),"object metadata")},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.olJ,{})}),"Copy metadata"]})}var d=n(41736);function f(e){let{path:t}=e,{downloadFiles:n,getFileUrl:f,navigateToModeSpecificFiltering:h}=(0,d.b)(),p=function(){let{openConfirmDialog:e}=(0,o.Rh)(),t=(0,l.xw)();return(0,s.useCallback)(n=>e({title:"Delete file",action:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.Jrl,{}),"Delete"]}),variant:"red",body:(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)(i.nvN,{size:"14",children:"Are you sure you would like to delete the following file:"}),(0,r.jsx)(i.nvN,{size:"14",font:"mono",className:"break-words",children:n})]}),onConfirm:async()=>{(await t.delete({params:(0,u.W0)(n)})).error&&(0,i.OHV)("Error deleting file."),(0,i.OPV)("Successfully deleted file.")}}),[e,t])}(),{openDialog:m}=(0,o.Rh)();return(0,r.jsxs)(i.h_2,{trigger:(0,r.jsx)(i.zxk,{variant:"ghost",icon:"hover",children:(0,r.jsx)(a.c_L,{})}),contentProps:{align:"start"},children:[(0,r.jsx)(i.Juw,{children:"Actions"}),(0,r.jsxs)(i.Xiv,{onSelect:async()=>{n([t])},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.vzB,{})}),"Download file"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>m("fileRename",t),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.dr6,{})}),"Rename file"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>p(t),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.Jrl,{})}),"Delete file"]}),(0,r.jsx)(i.Juw,{children:"Filter"}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{h(t)},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.q0D,{})}),"Filter by file name"]}),(0,r.jsx)(i.Juw,{children:"Copy"}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{(0,i.vQq)(t,"file path")},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.olJ,{})}),"Copy file path"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{(0,i.vQq)((0,u.vt)(t),"file path")},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.olJ,{})}),"Copy file name"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{(0,i.vQq)(f(t,!1),"file URL")},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.olJ,{})}),"Copy URL"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{(0,i.E5z)(f(t,!0),(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsx)(i.xvT,{children:"Copied authenticated file URL to clipboard."}),(0,r.jsxs)(i.xvT,{children:["The authenticated URL contains the ",(0,r.jsx)(i.EKh,{children:"renterd"})," ","password, be careful when pasting or sharing the URL."]})]}),{icon:(0,r.jsx)("div",{className:"!flex-none w-5",children:(0,r.jsx)(a.qdM,{className:"w-5 text-amber-600"})}),duration:1e4,className:"!max-w-[1200px]"})},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.olJ,{})}),"Copy authenticated URL"]}),(0,r.jsx)(c,{path:t})]})}},42770:function(e,t,n){"use strict";n.d(t,{F:function(){return a}});var r=n(76838),i=n(91157);function a(){var e;let t=(0,i.w)(),{datasetCount:n,isLoading:a}=(0,r.G)();return{active:t.data&&!a&&n{e.stopPropagation()}},children:[(0,r.jsx)("div",{className:"px-1.5 py-1",children:(0,r.jsxs)(i.xvT,{size:"14",weight:"medium",color:"subtle",children:["Host ",g.slice(0,24),"..."]})}),(0,r.jsx)(i.Juw,{children:"Filters"}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{k(),j({id:"addressContains",value:v,label:"Address contains ".concat((0,i.$Gg)(v,20))}),w.push(s._.hosts.index)},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.q0D,{})}),"Filter hosts by address"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{k(),j((0,m.K)(g)),w.push(s._.hosts.index)},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.q0D,{})}),"Filter hosts by public key"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{S(),E((0,h.e)(v)),w.push(s._.contracts.index)},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.q0D,{})}),"Filter contracts by host address"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{S(),E((0,p.V)(g)),w.push(s._.contracts.index)},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.q0D,{})}),"Filter contracts by host public key"]}),(0,r.jsx)(i.Juw,{children:"Actions"}),(0,r.jsxs)(i.Xiv,{onSelect:()=>T.post({payload:{hostKey:g,hostIP:v,timeout:(0,i.XBW)(30)}}),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a._Eq,{})}),"Rescan host"]}),(null===(t=C.data)||void 0===t?void 0:t.find(e=>e===v))?(0,r.jsxs)(i.Xiv,{onSelect:()=>O([],[v]),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.nCM,{})}),"Remove address from blocklist"]}):(0,r.jsxs)(i.Xiv,{onSelect:()=>O([v],[]),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.nCM,{})}),"Add address to blocklist"]}),(null===(n=_.data)||void 0===n?void 0:n.find(e=>e===g))?(0,r.jsxs)(i.Xiv,{onSelect:()=>M([],[g]),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.nCM,{})}),"Remove public key from allowlist"]}):(0,r.jsxs)(i.Xiv,{onSelect:()=>M([g],[]),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.nCM,{})}),"Add public key to allowlist"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>A.post({params:{publicKey:g}}),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.xkX,{})}),"Reset lost sector count"]}),(0,r.jsx)(i.Juw,{children:"Copy"}),(0,r.jsxs)(i.Xiv,{onSelect:()=>(0,i.vQq)(g,"host public key"),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.olJ,{})}),"Host public key"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>(0,i.vQq)(v,"host address"),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(a.olJ,{})}),"Host address"]})]})}},37769:function(e,t,n){"use strict";n.d(t,{T:function(){return x},N:function(){return b}});var r=n(52322),i=n(2784),a=n(36655),o=n(21487),s=n(6391),l=n.n(s);function u(e){let{host:t,rates:n}=e,r=n?"$".concat(new(l())(t.settings.storageprice).times((0,o.xf)(1)).times((0,o.S5)(1)).div(1e24).times((null==n?void 0:n.usd)||1).toFixed(2),"/TB"):"".concat((0,o.Vz)(new(l())(t.settings.storageprice).times((0,o.xf)(1)).times((0,o.S5)(1)),{fixed:0}),"/TB"),i="".concat((0,o.vW)(t.activeContracts.reduce((e,t)=>e.plus(t.size),new(l())(0)).toNumber())," utilized"),s="".concat((0,o.vW)(t.settings.remainingstorage)," / ").concat((0,o.vW)(t.settings.totalstorage)," available");return"".concat((0,a.HLH)(t.countryCode)," \xb7 ").concat(r," \xb7 ").concat(i," \xb7 ").concat(s)}var c=function(){let[e,t]=(0,i.useState)(null),[n,r]=(0,i.useState)({width:0,height:0}),a=(0,i.useCallback)(()=>{r({width:(null==e?void 0:e.offsetWidth)||0,height:(null==e?void 0:e.offsetHeight)||0})},[null==e?void 0:e.offsetHeight,null==e?void 0:e.offsetWidth]);return d("resize",a),f(()=>{a()},[null==e?void 0:e.offsetHeight,null==e?void 0:e.offsetWidth]),[t,n]},d=function(e,t,n,r){let a=(0,i.useRef)(t);f(()=>{a.current=t},[t]),(0,i.useEffect)(()=>{var t;let i=null!==(t=null==n?void 0:n.current)&&void 0!==t?t:window;if(!(i&&i.addEventListener))return;let o=e=>a.current(e);return i.addEventListener(e,o,r),()=>{i.removeEventListener(e,o,r)}},[e,n,r])},f="undefined"!=typeof window?i.useLayoutEffect:i.useEffect,h=n(10363),p=n(25237);let m=n.n(p)()(()=>Promise.all([n.e(546),n.e(508),n.e(167),n.e(764),n.e(936)]).then(n.bind(n,6936)),{loadableGenerated:{webpack:()=>[6936]},ssr:!1}),v=(0,i.forwardRef)(function(e,t){return(0,r.jsx)(m,{...e,forwardRef:t})});var g=n(10569),y=n(82494);let b={moveToLocation:(e,t)=>null};function x(e){let{activeHost:t,hosts:n,onMount:a,onHostClick:o,onHostHover:s}=e,d=(0,y.BW)({config:{swr:{revalidateOnFocus:!1}}}),f=(0,i.useRef)(null),p=(0,i.useRef)(b),m=(0,i.useCallback)((e,t)=>{var n;e&&(null===(n=f.current)||void 0===n||n.pointOfView({lat:e[0]-8,lng:e[1],altitude:t||1.5},700))},[]);(0,i.useEffect)(()=>{p.current.moveToLocation=m},[m]),(0,h.Q5)(()=>{var e;if(!f.current)return!1;m((null==t?void 0:t.location)||[48.8323,2.4075],1.5);let n=null===(e=f.current)||void 0===e?void 0:e.scene().children.find(e=>"DirectionalLight"===e.type);return n&&(n.intensity=10),!0}),(0,i.useEffect)(()=>{a&&a(p.current)},[]);let[x,{height:w,width:j}]=c(),k=(0,i.useMemo)(()=>n||[],[n]);return(0,r.jsx)("div",{ref:x,className:"w-full h-full",children:(0,r.jsx)(v,{ref:f,width:j,height:w,backgroundColor:"rgba(0,0,0,0)",globeImageUrl:"/_next/static/media/earth-dark-contrast.bf7081fc.png",bumpImageUrl:"/_next/static/media/earth-topology.e385a70e.png",arcsData:[],atmosphereColor:"rgba(0,0,0,0)",atmosphereAltitude:.16,animateIn:!1,arcLabel:e=>{var t;return u({host:e.dst,rates:null===(t=d.data)||void 0===t?void 0:t.rates.sc})},arcStartLat:e=>+e.src.location[0],arcStartLng:e=>+e.src.location[1],arcEndLat:e=>+e.dst.location[0],arcEndLng:e=>+e.dst.location[1],arcDashLength:.75,arcAltitude:0,arcDashGap:.1,arcDashInitialGap:()=>Math.random(),arcDashAnimateTime:5e3,arcColor:e=>t&&(e.dst.publicKey===t.publicKey||e.src.publicKey===t.publicKey)?["rgba(187, 229, 201, 0.25)","rgba(187, 229, 201, 0.25)"]:["rgba(187, 229, 201, 0.10)","rgba(187, 229, 201, 0.10)"],arcsTransitionDuration:0,pointsData:k,pointLat:e=>e.location[0],pointLng:e=>e.location[1],pointLabel:e=>{var t;return u({host:e,rates:null===(t=d.data)||void 0===t?void 0:t.rates.sc})},pointAltitude:e=>(t&&e.publicKey===(null==t?void 0:t.publicKey)||e.activeContractsCount.gt(0),.1),pointsTransitionDuration:0,pointColor:e=>{let{colorHex:n}=(0,g.Kg)(e);return t&&e.publicKey!==(null==t?void 0:t.publicKey)?function(e,t){let n=parseInt(e.slice(1,3),16),r=parseInt(e.slice(3,5),16),i=parseInt(e.slice(5,7),16);return"rgba(".concat(n,", ").concat(r,", ").concat(i,", ").concat(.2,")")}(n,0):n},pointRadius:e=>(e.activeContractsCount.gt(0)&&e.activeContracts.reduce((e,t)=>e.plus(t.size),new(l())(0)).div(1e12).toNumber(),Math.max(e.settings.remainingstorage/1e13/3,.1)),onPointHover:e=>{e&&(null==s||s(e.publicKey,e.location))},onPointClick:e=>{e&&(null==o||o(e.publicKey,e.location))},pointsMerge:!1})})}},42213:function(e,t,n){"use strict";n.d(t,{L:function(){return M}});var r=n(52322),i=n(35599),a=n(97112),o=n(10532);let s={namespace:"hosts/filterAddress",label:"Hosts filter by address"};function l(e){let{select:t,currentPage:n}=e,{openDialog:l}=(0,a.Rh)(),u=(0,o.q)("");return(0,r.jsx)(i.fu,{currentPage:n,commandPage:s,children:(0,r.jsx)(i.WD,{currentPage:n,commandPage:s,onSelect:()=>{t(),l("hostsFilterAddress")},children:u.label})})}function u(e){let{select:t,currentPage:n,parentPage:o,commandPage:l}=e,{openDialog:u}=(0,a.Rh)();return(0,r.jsx)(i.Ul,{currentPage:n,parentPage:o,commandPage:l,onSelect:()=>{t(),u("hostsFilterAddress")},children:s.label})}let c={namespace:"hosts/filterAllowBlock",label:"Hosts filter by allow/block status"},d=[{id:"filterMode",value:"allowed",label:"allowed"},{id:"filterMode",value:"blocked",label:"blocked"}];function f(e){let{select:t,currentPage:n}=e;return(0,r.jsx)(i.fu,{currentPage:n,commandPage:c,children:d.map(e=>(0,r.jsx)(i.WD,{currentPage:n,commandPage:c,onSelect:()=>{t(e)},children:e.label},e.id+e.value))})}let h={namespace:"hosts/filterActiveContracts",label:"Hosts filter by contracts"},p={id:"hasActiveContracts",bool:!0,label:"has active contracts"};function m(e){let{select:t,currentPage:n}=e;return(0,r.jsx)(i.fu,{currentPage:n,commandPage:h,children:(0,r.jsx)(i.WD,{currentPage:n,commandPage:h,onSelect:()=>{t(p)},children:p.label})})}let v={namespace:"hosts/filterUsable",label:"Hosts filter by usable"},g=[{id:"usabilityMode",value:"usable",label:"usable"},{id:"usabilityMode",value:"unusable",label:"unusable"}];function y(e){let{select:t,currentPage:n}=e;return(0,r.jsx)(i.fu,{currentPage:n,commandPage:v,children:g.map(e=>(0,r.jsx)(i.WD,{currentPage:n,commandPage:v,onSelect:()=>{t(e)},children:e.label},e.id+e.value))})}var b=n(46081),x=n(23771);let w={namespace:"hosts/filterPublicKey",label:"Hosts filter by public key"};function j(e){let{select:t,currentPage:n}=e,{openDialog:o}=(0,a.Rh)(),s=(0,x.K)("");return(0,r.jsx)(i.fu,{currentPage:n,commandPage:w,children:(0,r.jsx)(i.WD,{currentPage:n,commandPage:w,onSelect:()=>{t(),o("hostsFilterPublicKey")},children:s.label})})}function k(e){let{select:t,currentPage:n,parentPage:o,commandPage:s}=e,{openDialog:l}=(0,a.Rh)();return(0,r.jsx)(i.Ul,{currentPage:n,parentPage:o,commandPage:s,onSelect:()=>{t(),l("hostsFilterPublicKey")},children:w.label})}function E(e){let{currentPage:t,select:n}=e,{autopilot:i}=(0,b.q)();return(0,r.jsxs)(r.Fragment,{children:["on"===i.status&&(0,r.jsx)(y,{currentPage:t,select:n}),(0,r.jsx)(m,{currentPage:t,select:n}),(0,r.jsx)(l,{currentPage:t,select:n}),(0,r.jsx)(j,{currentPage:t,select:n}),(0,r.jsx)(f,{currentPage:t,select:n})]})}let S={namespace:"hosts",label:"Hosts"};function C(e){let{currentPage:t,parentPage:n,pushPage:a,select:o}=e,{autopilot:s}=(0,b.q)();return(0,r.jsxs)(r.Fragment,{children:["on"===s.status&&(0,r.jsx)(i.Ul,{currentPage:t,parentPage:n,commandPage:S,onSelect:()=>{a(v)},children:v.label}),(0,r.jsx)(k,{currentPage:t,parentPage:n,commandPage:S,select:o}),(0,r.jsx)(u,{currentPage:t,parentPage:n,commandPage:S,select:o}),(0,r.jsx)(i.Ul,{currentPage:t,parentPage:n,commandPage:S,onSelect:()=>{a(h)},children:h.label}),(0,r.jsx)(i.Ul,{currentPage:t,parentPage:n,commandPage:S,onSelect:()=>{a(c)},children:c.label})]})}var _=n(56328),O=n(2784);function M(e){let{currentPage:t,parentPage:n,pushPage:i,beforeSelect:a,afterSelect:o}=e,{setFilter:s}=(0,_.l)(),l=(0,O.useCallback)(e=>{a&&a(),e&&s(e),o&&o()},[s,a,o]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(C,{parentPage:n,currentPage:t,pushPage:i,select:l}),(0,r.jsx)(E,{currentPage:t,pushPage:i,select:l})]})}},10532:function(e,t,n){"use strict";n.d(t,{g:function(){return f},q:function(){return u}});var r=n(52322),i=n(36655),a=n(56328),o=n(7114),s=n(24511),l=n(97112);function u(e){return{id:"addressContains",value:e,label:"address contains ".concat(e)}}let c={address:""},d=s.Ry().shape({address:s.Z_().required("Required")});function f(e){let{trigger:t,open:n,onOpenChange:s}=e,{closeDialog:f}=(0,l.Rh)(),{setFilter:h}=(0,a.l)(),p=(0,o.TA)({initialValues:c,validationSchema:d,onSubmit:e=>{h(u(e.address)),p.resetForm(),f()}});return(0,r.jsx)(i.VqE,{trigger:t,title:"Filter by address",open:n,onOpenChange:e=>{e||p.resetForm(),s(e)},contentVariants:{className:"w-[400px]"},onSubmit:p.handleSubmit,children:(0,r.jsx)("div",{className:"flex flex-col gap-4",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(i.cB7,{formik:p,title:"Address",name:"address",placeholder:"Partial match against domain or IP",autoComplete:"off",type:"text",variants:{size:"medium"}}),(0,r.jsx)(i.IKw,{formik:p,size:"medium",children:"Filter"})]})})})}},23771:function(e,t,n){"use strict";n.d(t,{K:function(){return u},a:function(){return f}});var r=n(52322),i=n(36655),a=n(56328),o=n(7114),s=n(24511),l=n(97112);function u(e){return{id:"publicKeyEquals",value:e,label:"public key is ".concat((0,i.$Gg)(e,20))}}let c={publicKey:""},d=s.Ry().shape({publicKey:s.Z_().required("Required")});function f(e){let{trigger:t,open:n,onOpenChange:s}=e,{closeDialog:f}=(0,l.Rh)(),{setFilter:h}=(0,a.l)(),p=(0,o.TA)({initialValues:c,validationSchema:d,onSubmit:e=>{h(u(e.publicKey)),p.resetForm(),f()}});return(0,r.jsx)(i.VqE,{trigger:t,title:"Filter by public key",open:n,onOpenChange:e=>{e||p.resetForm(),s(e)},contentVariants:{className:"w-[400px]"},onSubmit:p.handleSubmit,children:(0,r.jsx)("div",{className:"flex flex-col gap-4",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(i.cB7,{formik:p,title:"Public key",name:"publicKey",placeholder:"ed25519:b050c0c6...",autoComplete:"off",type:"text",variants:{size:"medium"}}),(0,r.jsx)(i.IKw,{formik:p,size:"medium",children:"Filter"})]})})})}},26731:function(e,t,n){"use strict";n.d(t,{s:function(){return s}});var r=n(52322),i=n(36655),a=n(2784),o=n(34864);function s(e){let{loaded:t,size:n,status:s}=e,l=(0,a.useMemo)(()=>{var e;return void 0!==(e={loaded:t,size:n}).loaded?e.loaded/e.size:1},[t,n]);return(0,r.jsxs)("div",{className:"flex flex-col gap-1 w-full",children:[(0,r.jsx)(i.kod,{variant:"accent",value:t,max:n,className:1===l?"animate-pulse":""}),(0,r.jsxs)("div",{className:"flex gap-2 justify-between",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",children:(0,o.Z)(s)}),(0,r.jsxs)(i.xvT,{size:"12",color:"subtle",children:[(100*l).toFixed(0),"%"]})]})]})}},98334:function(e,t,n){"use strict";n.d(t,{_:function(){return i},h:function(){return a}});var r=n(57016);let i={home:"/",buckets:{index:"/buckets",files:"/buckets/[bucket]/files/[path]",uploads:"/buckets/[bucket]/uploads"},config:{index:"/config",storage:"/config#storage",pricing:"/config#pricing",hosts:"/config#hosts",wallet:"/config#wallet",contracts:"/config#contracts",uploads:"/config#uploads",redundancy:"/config#redundancy"},contracts:{index:"/contracts"},hosts:{index:"/hosts"},wallet:{view:"/wallet"},keys:{index:"/keys"},alerts:{index:"/alerts"},node:{index:"/node"},login:"/login"},a=r.HI},9338:function(e,t,n){"use strict";n.d(t,{h:function(){return r}});let r=(0,n(36655).XBW)(15)},87764:function(e,t,n){"use strict";n.d(t,{b:function(){return M},Z:function(){return O}});var r=n(52322),i=n(36655),a=n(5632),o=n(2784);let s=["actions","overview","data","time"],l=[];var u=n(57016),c=n(17448),d=n(41736),f=n(97112),h=n(70899),p=n(6391),m=n.n(p),v=n(61020);function g(e){let{hostKey:t,contentProps:n,buttonProps:a}=e,o=(0,u.$)({params:{hostKey:t}});return o.data?(0,r.jsx)(c.G,{address:o.data.netAddress,publicKey:o.data.publicKey,contentProps:n,buttonProps:a,trigger:(0,r.jsx)(i.zxk,{size:"none",icon:"hover",variant:"ghost",...a,children:(0,r.jsx)(v.EMN,{})})}):(0,r.jsx)(i.zxk,{size:"none",icon:"hover",variant:"ghost",state:"waiting",...a,children:(0,r.jsx)(v.EMN,{})})}var y=n(91492);function b(e){let{id:t,contentProps:n,buttonProps:a}=e,o=(0,u.cq)({params:{id:t}});return o.data?(0,r.jsx)(y.F,{id:t,address:o.data.hostIP,publicKey:o.data.hostKey,contentProps:n,buttonProps:a,trigger:(0,r.jsx)(i.zxk,{size:"none",icon:"hover",variant:"ghost",...a,children:(0,r.jsx)(v.EMN,{})})}):(0,r.jsx)(i.zxk,{size:"none",icon:"hover",variant:"ghost",state:"waiting",...a,children:(0,r.jsx)(v.EMN,{})})}var x=n(21487),w=n(32998);let j={origin:{render:function(e){let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",ellipsis:!0,children:"origin"}),(0,r.jsx)(i.xvT,{size:"12",color:"contrast",ellipsis:!0,children:t})]})}},contractID:{render:function(e){let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",ellipsis:!0,children:"contract ID"}),(0,r.jsx)(i.PF9,{size:"12",value:t,menu:(0,r.jsx)(b,{id:t,contentProps:{align:"end"},buttonProps:{size:"none"}})})]})}},accountID:{render:function(e){let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",ellipsis:!0,children:"account ID"}),(0,r.jsx)(i.XxW,{size:"12",value:t,label:"account ID"})]})}},hostKey:{render:function(e){let{value:t}=e,n=(0,u.$)({params:{hostKey:t}});return n.data?(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",ellipsis:!0,children:"host key"}),(0,r.jsx)(i.PF9,{size:"12",value:t,menu:(0,r.jsx)(c.G,{publicKey:n.data.publicKey,address:n.data.netAddress,contentProps:{align:"end"},buttonProps:{size:"none"}})})]}):null}},slabKey:{render:function(e){let{value:t}=e,{setActiveDirectory:n}=(0,d.b)(),{closeDialog:a}=(0,f.Rh)(),o=(0,u.og)({params:{key:t},config:{swr:{revalidateOnFocus:!1}}});return(0,r.jsxs)("div",{className:"flex flex-col gap-2 max-h-[100px]",children:[(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",ellipsis:!0,children:"key"}),(0,r.jsx)(i.XxW,{size:"12",value:t})]}),o.data&&(0,r.jsx)(i.xrM,{children:(0,r.jsx)("div",{className:"flex flex-col gap-2 mt-2 mb-2",children:o.data.map(e=>(0,r.jsx)(i.rUS,{color:"accent",underline:"hover",size:"12",noWrap:!0,onClick:()=>{n(()=>(0,h.gD)(e.name)),a()},children:e.name},e.name))})})]})}},added:{render:e=>{let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",ellipsis:!0,children:"added"}),(0,r.jsx)(i.xvT,{size:"12",color:"contrast",ellipsis:!0,children:t})]})}},removed:{render:e=>{let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",ellipsis:!0,children:"removed"}),(0,r.jsx)(i.xvT,{size:"12",color:"contrast",ellipsis:!0,children:t})]})}},setAdditions:{render:function(e){let{value:t}=e;return(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",ellipsis:!0,children:"contract set additions"}),t&&(0,r.jsx)("div",{className:"flex flex-col gap-3 mb-2",children:Object.entries(t).map((e,t)=>{let[n,{hostKey:i,additions:a}]=e;return(0,r.jsx)(k,{contractId:n,hostKey:i,changes:a,i:t},n)})})]})}},setRemovals:{render:function(e){let{value:t}=e;return(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",ellipsis:!0,children:"contract set removals"}),t&&(0,r.jsx)("div",{className:"flex flex-col gap-3 mb-2",children:Object.entries(t).map((e,t)=>{let[n,{hostKey:i,removals:a}]=e;return(0,r.jsx)(k,{contractId:n,hostKey:i,changes:a,i:t},n)})})]})}},migrationsInterrupted:{render:e=>{let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",ellipsis:!0,children:"migrations interrupted"}),(0,r.jsx)(i.xvT,{size:"12",weight:"medium",ellipsis:!0,children:t?"yes":"no"})]})}},allowance:{render:e=>{let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",ellipsis:!0,children:"allowance"}),(0,r.jsx)(i.YKL,{size:"12",variant:"value",value:new(m())(t)})]})}},balance:{render:e=>{let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",ellipsis:!0,children:"balance"}),(0,r.jsx)(i.YKL,{size:"12",variant:"value",value:new(m())(t)})]})}},address:{render:e=>{let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",ellipsis:!0,children:"address"}),(0,r.jsx)(i.XxW,{size:"12",value:t,type:"address"})]})}},account:{render:e=>{let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",ellipsis:!0,children:"account"}),(0,r.jsx)(i.XxW,{size:"12",value:t})]})}}};function k(e){let{contractId:t,hostKey:n,changes:a,i:o}=e;return(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsxs)("div",{className:"flex gap-2 justify-between",children:[(0,r.jsxs)(i.xvT,{size:"12",ellipsis:!0,children:[o+1,"."]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",ellipsis:!0,children:"contract"}),(0,r.jsx)(i.XxW,{size:"12",value:t,contextMenu:(0,r.jsx)(b,{id:t,contentProps:{align:"end"}})})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",ellipsis:!0,children:"host"}),(0,r.jsx)(i.XxW,{size:"12",value:n,label:"host key",contextMenu:(0,r.jsx)(g,{hostKey:n,contentProps:{align:"end"}})})]})]}),a.map(e=>{let{reasons:t,size:n,time:a}=e;return(0,r.jsxs)("div",{className:"flex gap-2 justify-between",children:[(0,r.jsx)(i.ua7,{content:t,children:(0,r.jsx)(i.xvT,{size:"12",ellipsis:!0,children:t})}),(0,r.jsx)("div",{className:"flex-1"}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",ellipsis:!0,children:"time"}),(0,r.jsx)(i.xvT,{size:"12",ellipsis:!0,children:(0,w.Z)(new Date(a),new Date)})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",ellipsis:!0,children:"size"}),(0,r.jsx)(i.xvT,{size:"12",ellipsis:!0,children:(0,x.vW)(n)})]})]},t+a)})]})}var E=n(98358);let S=[{id:"actions",label:"",fixed:!0,cellClassName:"w-[50px] !pr-4 [&+*]:!pl-0",render:e=>{let{data:{dismiss:t}}=e;return(0,r.jsx)(i.eQh,{children:(0,r.jsx)(i.zxk,{tip:"Dismiss alert",onClick:t,children:(0,r.jsx)(E.NlZ,{})})})}},{id:"overview",label:"overview",category:"general",contentClassName:"min-w-[200px] max-w-[500px]",render:e=>{let{data:{message:t,severity:n,data:a}}=e;return(0,r.jsxs)("div",{className:"flex flex-col gap-1 py-4",children:[(0,r.jsxs)("div",{className:"flex gap-1 items-center",children:[(0,r.jsx)(i.Cts,{variant:"error"===n||"critical"===n?"red":"warning"===n?"amber":"gray",size:"small",children:n}),(0,r.jsx)(i.xvT,{weight:"medium",noWrap:!0,children:t})]}),a.hint&&(0,r.jsx)(i.xvT,{size:"12",color:"subtle",children:a.hint}),a.error&&(0,r.jsx)(i.xvT,{size:"12",color:"subtle",children:a.error})]})}},{id:"data",label:"data",contentClassName:"w-[400px]",category:"general",render:function(e){let{data:{data:t}}=e,n=(0,o.useMemo)(()=>Object.keys(j).map(e=>{let n=t[e];return null!=n&&("object"!=typeof n||Object.keys(n).length)?{key:e,value:n}:null}).filter(Boolean),[t]);return(0,r.jsx)("div",{className:"py-4 w-full",children:(0,r.jsx)(i.s_4,{color:"subtle",className:"flex flex-col gap-1 w-full py-1",children:n.map((e,t)=>{var a;let{key:s,value:l}=e,u=null==j?void 0:null===(a=j[s])||void 0===a?void 0:a.render;return u?(0,r.jsxs)(o.Fragment,{children:[(0,r.jsx)("div",{className:"py-1 px-2",children:(0,r.jsx)(u,{value:l},s)}),n.length>1&&t{let{data:{timestamp:t}}=e;return(0,r.jsx)(i.xvT,{color:"subtle",size:"12",ellipsis:!0,children:(0,w.Z)(new Date(t),new Date)})}}];var C=n(9338);let _=(0,o.createContext)({}),O=()=>(0,o.useContext)(_);function M(e){let{children:t}=e,n=function(){var e;let t=(0,a.useRouter)(),n=Number(t.query.limit||50),r=Number(t.query.offset||0),{filters:c,setFilter:d,removeFilter:f,removeLastFilter:h,resetFilters:p}=(0,i.Uu5)(),m=(0,o.useCallback)(e=>{e?d({id:"severity",value:e,label:e}):f("severity")},[d,f]),v=null===(e=c.find(e=>"severity"===e.id))||void 0===e?void 0:e.value,g=(0,o.useMemo)(()=>{let e={limit:n,offset:r};return v&&(e.severity=v),e},[n,r,v]),y=(0,u.Z7)({params:g,config:{swr:{refreshInterval:C.h}}}),b=(0,u.Uy)(),x=(0,o.useCallback)(async e=>{(await b.post({payload:[e]})).error?(0,i.OHV)("Error dismissing alert."):(0,i.OPV)("Alert has been dismissed.")},[b]),w=(0,o.useCallback)(async e=>{(await b.post({payload:e})).error?(0,i.OHV)("Error dismissing alerts."):(0,i.OPV)("Selected alerts have been dismissed.")},[b]),j=(0,o.useMemo)(()=>{var e,t;return y.data?(null===(t=y.data)||void 0===t?void 0:null===(e=t.alerts)||void 0===e?void 0:e.map(e=>({id:e.id,severity:e.severity,message:e.message,timestamp:e.timestamp,data:e.data,dismiss:()=>x(e.id)})))||[]:null},[y.data,x]),{configurableColumns:k,enabledColumns:E,sortableColumns:_,toggleColumnVisibility:O,setColumnsVisible:M,setColumnsHidden:T,toggleSort:A,setSortDirection:P,setSortField:N,sortField:R,sortDirection:D,resetDefaultColumnVisibility:L}=(0,i.oy6)("renterd/v0/alerts",{columns:S,columnsDefaultVisible:s,sortOptions:l,defaultSortField:""}),Z=(0,o.useMemo)(()=>S.filter(e=>e.fixed||E.includes(e.id)),[E]),F=(0,i.c2j)(j,y.isValidating,y.error,c),z=(0,o.useMemo)(()=>({}),[]),V=(0,o.useMemo)(()=>{var e,t;return{...null===(e=y.data)||void 0===e?void 0:e.totals,all:Object.entries((null===(t=y.data)||void 0===t?void 0:t.totals)||{}).reduce((e,t)=>{let[n,r]=t;return e+r},0)}},[y.data]);return{dataState:F,limit:n,offset:r,isLoading:y.isLoading,error:y.error,pageCount:(null==j?void 0:j.length)||0,totals:V,columns:Z,datasetPage:j,cellContext:z,configurableColumns:k,enabledColumns:E,sortableColumns:_,toggleColumnVisibility:O,setColumnsVisible:M,setColumnsHidden:T,toggleSort:A,setSortDirection:P,setSortField:N,sortField:R,filters:c,setFilter:d,removeFilter:f,removeLastFilter:h,resetFilters:p,sortDirection:D,resetDefaultColumnVisibility:L,dismissOne:x,dismissMany:w,severityFilter:v,setSeverityFilter:m}}();return(0,r.jsx)(_.Provider,{value:n,children:t})}},46081:function(e,t,n){"use strict";n.d(t,{w:function(){return u},q:function(){return l}});var r=n(52322),i=n(2784),a=n(36655),o=n(57016);let s=(0,i.createContext)({}),l=()=>(0,i.useContext)(s);function u(e){let{children:t}=e,n={autopilot:function(){let e=(0,o.YX)({config:{swr:{dedupingInterval:(0,a.XBW)(5),revalidateOnFocus:!1,refreshInterval:e=>e?(0,a.XBW)(60):(0,a.XBW)(1)}}}),[t,n]=(0,i.useState)("init");return(0,i.useEffect)(()=>{if(e.isLoading)n("init");else{if(e.isValidating)return;e.error?n("off"):e.data&&n("object"==typeof e.data?"on":"off")}},[e]),{status:t,state:e}}()};return(0,r.jsx)(s.Provider,{value:n,children:t})}},49889:function(e,t,n){"use strict";n.d(t,{iV:function(){return L},ZR:function(){return D}});var r=n(52322),i=n(2784),a=n(36655),o=n(21487),s=n(6391),l=n.n(s);let u={autopilotContractSet:"",amountHosts:void 0,allowanceMonth:void 0,periodWeeks:void 0,renewWindowWeeks:void 0,downloadTBMonth:void 0,uploadTBMonth:void 0,storageTB:void 0,prune:!1,allowRedundantIPs:!1,maxDowntimeHours:void 0,minRecentScanFailures:void 0},c={defaultContractSet:""},d={uploadPackingEnabled:!0},f={maxRpcPriceMillion:void 0,maxStoragePriceTBMonth:void 0,maxContractPrice:void 0,maxDownloadPriceTB:void 0,maxUploadPriceTB:void 0,minMaxCollateral:void 0,hostBlockHeightLeeway:void 0,minPriceTableValidityMinutes:void 0,minAccountExpiryDays:void 0,minMaxEphemeralAccountBalance:void 0,migrationSurchargeMultiplier:void 0},h={...u,...c,...d,...f,minShards:void 0,totalShards:void 0};function p(e){return{storageTB:void 0,downloadTBMonth:void 0,uploadTBMonth:void 0,allowanceMonth:void 0,..."Mainnet"===e?{periodWeeks:new(l())(6),renewWindowWeeks:new(l())(2),amountHosts:new(l())(50),autopilotContractSet:"autopilot",allowRedundantIPs:!1,maxDowntimeHours:new(l())(336),minRecentScanFailures:new(l())(10),prune:!0}:{periodWeeks:new(l())(6),renewWindowWeeks:new(l())(2),amountHosts:new(l())(12),autopilotContractSet:"autopilot",allowRedundantIPs:!1,maxDowntimeHours:new(l())(336),minRecentScanFailures:new(l())(10),prune:!0}}}let m={...c,defaultContractSet:"autopilot"},v={...d},g={...f},y=e=>Object.fromEntries(Object.entries(e).filter(e=>{let[t,n]=e;return void 0!==n&&""!==n}));function b(e,t){let n=e.defaultContractSet||(null==t?void 0:t.default)||m.defaultContractSet;return{...t,default:n}}function x(e){let{hasBeenConfigured:t,autopilot:n,contractSet:r,uploadPacking:i,gouging:s,redundancy:d,averages:f}=e;return{...function(e){if(!e)return u;let t=e.contracts.set,n=(0,o.ll)(j(new(l())(e.contracts.allowance),e.contracts.period),6),r=new(l())(e.contracts.amount),i=new(l())((0,o.x5)(e.contracts.period)),s=new(l())((0,o.x5)(e.contracts.renewWindow)),c=new(l())((0,a.y70)(j((0,o.JW)(e.contracts.download),e.contracts.period),2));return{autopilotContractSet:t,allowanceMonth:n,amountHosts:r,periodWeeks:i,renewWindowWeeks:s,downloadTBMonth:c,uploadTBMonth:new(l())((0,a.y70)(j((0,o.JW)(e.contracts.upload),e.contracts.period),2)),storageTB:(0,o.JW)(new(l())(e.contracts.storage)),prune:e.contracts.prune,allowRedundantIPs:e.hosts.allowRedundantIPs,maxDowntimeHours:new(l())(e.hosts.maxDowntimeHours),minRecentScanFailures:new(l())(e.hosts.minRecentScanFailures)}}(n),...r?{defaultContractSet:r.default}:c,uploadPackingEnabled:i.enabled,...function(e){let{gouging:t,averages:n,hasBeenConfigured:r}=e,i=function(e){let{gouging:t,averages:n,hasBeenConfigured:r}=e;return r||!n?t:{...t,maxStoragePrice:n.settings.storage_price,maxDownloadPrice:new(l())(n.settings.download_price).times((0,o.xf)(1)).toString(),maxUploadPrice:new(l())(n.settings.upload_price).times((0,o.xf)(1)).toString()}}({gouging:t,averages:n,hasBeenConfigured:r});return{maxStoragePriceTBMonth:(0,o.ll)(new(l())(i.maxStoragePrice).times((0,o.S5)(1)).times((0,o.xf)(1)),6),maxUploadPriceTB:(0,o.ll)(new(l())(i.maxUploadPrice),6),maxDownloadPriceTB:(0,o.ll)(i.maxDownloadPrice,6),maxContractPrice:(0,o.ll)(i.maxContractPrice,6),maxRpcPriceMillion:(0,o.ll)(i.maxRPCPrice,6).times(1e6),minMaxCollateral:(0,o.ll)(i.minMaxCollateral,6),hostBlockHeightLeeway:new(l())(i.hostBlockHeightLeeway),minPriceTableValidityMinutes:new(l())((0,a.AEA)(i.minPriceTableValidity)),minAccountExpiryDays:new(l())((0,a.okB)(i.minAccountExpiry)),minMaxEphemeralAccountBalance:(0,o.ll)(i.minMaxEphemeralAccountBalance,6),migrationSurchargeMultiplier:new(l())(i.migrationSurchargeMultiplier)}}({gouging:s,averages:f,hasBeenConfigured:t}),minShards:new(l())(d.minShards),totalShards:new(l())(d.totalShards)}}function w(e,t){let n=(0,o.mv)(t.toNumber());return e.times(n).div((0,o.S5)(1))}function j(e,t){return e.div(t).times((0,o.S5)(1))}var k=n(57016),E=n(92762),S=n(91332);function C(){let[e,t]=(0,E.Z)("v0/autopilot/syncDefaultContractSet",{defaultValue:!0}),n=(0,S.a)({config:{swr:{errorRetryCount:0}}}),o=(0,k.KJ)(),s=(0,i.useCallback)(async t=>{let i=n.data||{default:""};try{e&&t!==i.default&&(await o.put({params:{key:"contractset"},payload:b({defaultContractSet:t},n.data)}),n.mutate(),(0,a.OPV)((0,r.jsxs)(a.xvT,{children:["Default contract set has been updated to:"," ",(0,r.jsx)(a.EKh,{children:t}),"."]})))}catch(e){(0,a.OHV)(e.message),console.log(e)}},[n.data,o,e]);return{shouldSyncDefaultContractSet:e,setShouldSyncDefaultContractSet:t,syncDefaultContractSet:s}}var _=n(10363),O=n(91157),M=n(82494),T=n(46081),A=n(63955),P=n(315);function N(e){let{isAutopilotEnabled:t,advancedDefaults:n,showAdvanced:i,maxStoragePriceTBMonth:s,maxUploadPriceTB:u,minShards:c,totalShards:d,redundancyMultiplier:f,storageAverage:h,uploadAverage:p,downloadAverage:m,contractAverage:v}=e;return{storageTB:{type:"number",category:"storage",title:"Expected storage",description:(0,r.jsx)(r.Fragment,{children:"The amount of storage you would like to rent in TB."}),units:"TB",hidden:!t,validation:t?{required:"required"}:{}},uploadTBMonth:{type:"number",category:"storage",title:"Expected upload",description:(0,r.jsx)(r.Fragment,{children:"The amount of upload bandwidth you plan to use each month in TB."}),units:"TB/month",hidden:!t,validation:t?{required:"required"}:{}},downloadTBMonth:{type:"number",category:"storage",title:"Expected download",description:(0,r.jsx)(r.Fragment,{children:"The amount of download bandwidth you plan to use each month in TB."}),units:"TB/month",hidden:!t,validation:t?{required:"required"}:{}},allowanceMonth:{type:"siacoin",category:"storage",title:"Allowance",description:(0,r.jsx)(r.Fragment,{children:"The amount of Siacoin you would like to spend per month."}),units:"SC/month",decimalsLimitSc:6,hidden:!t||!i,validation:t&&i?{required:"required"}:{}},periodWeeks:{type:"number",category:"storage",title:"Period",description:(0,r.jsx)(r.Fragment,{children:"The length of the storage contracts."}),units:"weeks",suggestion:null==n?void 0:n.periodWeeks,suggestionTip:"Typically ".concat(null==n?void 0:n.periodWeeks," weeks."),hidden:!t||!i,validation:t&&i?{required:"required"}:{}},renewWindowWeeks:{type:"number",category:"storage",title:"Renew window",description:(0,r.jsx)(r.Fragment,{children:"The number of weeks prior to contract expiration that Sia will attempt to renew your contracts."}),units:"weeks",decimalsLimit:6,suggestion:null==n?void 0:n.renewWindowWeeks,suggestionTip:"Typically ".concat(null==n?void 0:n.renewWindowWeeks," weeks."),hidden:!t||!i,validation:t&&i?{required:"required"}:{}},amountHosts:{type:"number",category:"storage",title:"Hosts",description:(0,r.jsx)(r.Fragment,{children:"The number of hosts to create contracts with."}),units:"hosts",decimalsLimit:0,suggestion:null==n?void 0:n.amountHosts,suggestionTip:"Typically ".concat(null==n?void 0:n.amountHosts," hosts."),hidden:!t||!i,validation:t&&i?{required:"required"}:{}},autopilotContractSet:{type:"text",category:"storage",title:"Contract set",description:(0,r.jsx)(r.Fragment,{children:"The contract set that autopilot should use. This should typically be the same as the default contract set."}),placeholder:null==n?void 0:n.autopilotContractSet,suggestion:null==n?void 0:n.autopilotContractSet,suggestionTip:(0,r.jsxs)(r.Fragment,{children:["The default contract set is"," ",(0,r.jsx)(a.EKh,{children:null==n?void 0:n.autopilotContractSet}),"."]}),hidden:!t||!i,validation:t&&i?{required:"required"}:{}},prune:{type:"boolean",category:"storage",title:"Prune sector roots",description:(0,r.jsx)(r.Fragment,{children:"When enabled, autopilot will try to prune deleted sector roots from contracts one contract at a time, for a max duration of 10 minutes per contract. For old hosts this process takes quite a while, while for new hosts it is fast. For new hosts pruning effectively deletes data from the contract, allowing the renter to stop paying for storage they are not using."}),suggestion:null==n?void 0:n.prune,suggestionTip:(0,r.jsxs)(r.Fragment,{children:["The default value is ",(0,r.jsx)(a.EKh,{children:null==n?void 0:n.prune}),"."]}),hidden:!t||!i,validation:{}},allowRedundantIPs:{type:"boolean",category:"hosts",title:"Redundant IPs",description:(0,r.jsx)(r.Fragment,{children:"Whether or not to allow forming contracts with multiple hosts in the same IP subnet. The subnets used are /16 for IPv4, and /64 for IPv6."}),suggestion:null==n?void 0:n.allowRedundantIPs,suggestionTip:"Defaults to ".concat((null==n?void 0:n.allowRedundantIPs)?"on":"off","."),hidden:!t||!i,validation:{}},maxDowntimeHours:{type:"number",category:"hosts",title:"Max downtime",description:(0,r.jsx)(r.Fragment,{children:"The maximum amount of host downtime that autopilot will tolerate in hours."}),units:"hours",suggestion:null==n?void 0:n.maxDowntimeHours,suggestionTip:"Defaults to ".concat(null==n?void 0:n.maxDowntimeHours.toNumber().toLocaleString()," which is ").concat((0,a.y70)(new(l())((0,a.XAn)(null==n?void 0:n.maxDowntimeHours.toNumber())),1)," days."),hidden:!t||!i,validation:t&&i?{required:"required"}:{}},minRecentScanFailures:{type:"number",category:"hosts",title:"Min recent scan failures",description:(0,r.jsx)(r.Fragment,{children:"The minimum number of recent scan failures that autopilot will tolerate."}),units:"scans",decimalsLimit:0,suggestion:null==n?void 0:n.minRecentScanFailures,suggestionTip:"Defaults to ".concat(null==n?void 0:n.minRecentScanFailures.toNumber(),"."),hidden:!t||!i,validation:t&&i?{required:"required"}:{}},defaultContractSet:{category:"contractset",type:"text",title:"Default contract set",placeholder:null==n?void 0:n.defaultContractSet,suggestion:null==n?void 0:n.defaultContractSet,suggestionTip:(0,r.jsx)(r.Fragment,{children:"Autopilot users will typically want to keep this the same as the autopilot contract set."}),description:(0,r.jsx)(r.Fragment,{children:"The default contract set is where data is uploaded to by default."}),hidden:!i,validation:i?{required:"required"}:{}},uploadPackingEnabled:{category:"uploadpacking",type:"boolean",title:"Upload packing",description:(0,r.jsx)(r.Fragment,{children:"Data on the Sia network is stored in 4MiB sectors. With the default 10 of 30 redundancy scheme, uploaded files are split into 40MiB chunks and encoded into 120MiB slabs. This means that storage is wasted on padding and files smaller than 40MiB still use 120MiB of space. The redundancy scheme can be configured, but unless all files are exactly 4MiB * the redundancy's minimum shards, there will always be wasted storage. Upload packing avoids this waste by buffering files and packing them together before they are uploaded to the network. This trades some performance for storage efficiency. It is also important to note that because buffered files are temporarily stored on disk they must be considered when backing up your renterd data."}),hidden:!i,validation:{}},maxStoragePriceTBMonth:{category:"gouging",type:"siacoin",title:"Max storage price",description:(0,r.jsx)(r.Fragment,{children:"The max allowed price a host is allowed to charge to store 1 TB worth of data per month."}),units:"SC/TB/month",average:h,averageTip:"Averages provided by Sia Central.",after:function(){return s&&c&&d?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.Z0O,{}),(0,r.jsx)(a.ua7,{align:"start",side:"bottom",content:(0,r.jsxs)(r.Fragment,{children:["Price per TB/month when factoring in the configured"," ",c," of ",d," redundancy."]}),children:(0,r.jsxs)("div",{className:"flex gap-1 items-center relative overflow-hidden",children:[(0,r.jsx)(a.xvT,{className:"flex relative",children:(0,r.jsx)(P.RdX,{})}),(0,r.jsxs)(a.xvT,{size:"12",ellipsis:!0,children:[(0,o.Vz)((0,o.qN)(s).times(f),{fixed:0,dynamicUnits:!1}),"/TB/month with redundancy"]})]})})]}):null},decimalsLimitSc:6,validation:{required:"required"}},maxUploadPriceTB:{category:"gouging",type:"siacoin",title:"Max upload price",description:(0,r.jsx)(r.Fragment,{children:"The max allowed price a host is allowed to charge for uploading 1 TB worth of data."}),units:"SC/TB",average:p,averageTip:"Averages provided by Sia Central.",after:function(){return u&&c&&d?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.Z0O,{}),(0,r.jsx)(a.ua7,{align:"start",side:"bottom",content:(0,r.jsxs)(r.Fragment,{children:["Price per TB when factoring in the configured ",c," of"," ",d," redundancy."]}),children:(0,r.jsxs)("div",{className:"flex gap-1 items-center relative overflow-hidden",children:[(0,r.jsx)(a.xvT,{className:"flex relative",children:(0,r.jsx)(P.RdX,{})}),(0,r.jsxs)(a.xvT,{size:"12",ellipsis:!0,children:[(0,o.Vz)((0,o.qN)(u).times(f),{fixed:0,dynamicUnits:!1}),"/TB with redundancy"]})]})})]}):null},decimalsLimitSc:6,validation:{required:"required"}},maxDownloadPriceTB:{category:"gouging",type:"siacoin",title:"Max download price",description:(0,r.jsx)(r.Fragment,{children:"The max allowed price to download 1 TB."}),units:"SC/TB",average:m,averageTip:"Averages provided by Sia Central.",decimalsLimitSc:6,validation:{required:"required"}},maxContractPrice:{category:"gouging",type:"siacoin",title:"Max contract price",description:(0,r.jsx)(r.Fragment,{children:"The max allowed price to form a contract."}),average:v,decimalsLimitSc:6,tipsDecimalsLimitSc:3,hidden:!i,validation:i?{required:"required"}:{}},maxRpcPriceMillion:{category:"gouging",type:"siacoin",title:"Max RPC price",description:(0,r.jsx)(r.Fragment,{children:"The max allowed base price for RPCs in siacoins per million calls."}),units:"SC/million",decimalsLimitSc:6,hidden:!i,validation:i?{required:"required"}:{}},minMaxCollateral:{category:"gouging",type:"siacoin",title:"Min max collateral",description:(0,r.jsx)(r.Fragment,{children:"The min value for max collateral in the host's price settings."}),decimalsLimitSc:6,hidden:!i,validation:i?{required:"required"}:{}},hostBlockHeightLeeway:{category:"gouging",type:"number",title:"Block height leeway",description:(0,r.jsx)(r.Fragment,{children:"The amount of blocks of leeway given to the host block height in the host's price table."}),units:"blocks",decimalsLimit:0,suggestion:null==n?void 0:n.hostBlockHeightLeeway,suggestionTip:"The recommended value is 6 blocks.",hidden:!i,validation:i?{required:"required",validate:{min:e=>new(l())(e).gte(3)||"must be at least 3 blocks"}}:{}},minPriceTableValidityMinutes:{category:"gouging",type:"number",title:"Min price table validity",units:"minutes",description:(0,r.jsx)(r.Fragment,{children:"The min accepted value for `Validity` in the host's price settings."}),hidden:!i,validation:i?{required:"required",validate:{min:e=>new(l())(e).gte((0,a.GXN)(10))||"must be at least 10 seconds"}}:{}},minAccountExpiryDays:{category:"gouging",type:"number",title:"Min account expiry",units:"days",description:(0,r.jsx)(r.Fragment,{children:"The min accepted value for `AccountExpiry` in the host's price settings."}),hidden:!i,validation:i?{required:"required",validate:{min:e=>new(l())(e).gte((0,a.XAn)(1))||"must be at least 1 hour"}}:{}},minMaxEphemeralAccountBalance:{category:"gouging",type:"siacoin",title:"Min max ephemeral account balance",description:(0,r.jsx)(r.Fragment,{children:"The min accepted value for `MaxEphemeralAccountBalance` in the host's price settings."}),decimalsLimitSc:6,hidden:!i,validation:i?{required:"required",validate:{min:e=>new(l())(e).gte(1)||"must be at least 1 SC"}}:{}},migrationSurchargeMultiplier:{category:"gouging",type:"number",title:"Migration surcharge multiplier",units:"* download price",placeholder:"10",decimalsLimit:1,description:(0,r.jsx)(r.Fragment,{children:"Factor that gets applied on the max download price when trying to download migration-critical sectors from a host that is price gouging. For example, when migrating a low-health file, if the download is failing but would potentially succeed with looser gouging settings, we apply the migration surcharge multiplier to overpay on every sector download if it means saving the file/migration."}),suggestion:new(l())(10),suggestionTip:"The default multiplier is 10x the download price.",hidden:!i,validation:i?{required:"required"}:{}},minShards:{type:"number",category:"redundancy",title:"Min shards",description:(0,r.jsx)(r.Fragment,{children:"The min amount of shards needed to reconstruct a slab."}),suggestion:null==n?void 0:n.minShards,suggestionTip:"Typically ".concat(null==n?void 0:n.minShards," shards."),units:"shards",hidden:!i,validation:i?{required:"required",validate:{min:e=>new(l())(e).gt(0)||"must be greater than 0"}}:{},trigger:["totalShards"]},totalShards:{type:"number",category:"redundancy",title:"Total shards",description:(0,r.jsx)(r.Fragment,{children:"The total amount of shards for each slab."}),suggestion:null==n?void 0:n.totalShards,suggestionTip:"Typically ".concat(null==n?void 0:n.totalShards," shards."),units:"shards",hidden:!i,validation:i?{required:"required",validate:{gteMinShards:(e,t)=>new(l())(e).gte(t.minShards)||"must be at least equal to min shards",max:e=>new(l())(e).lt(256)||"must be less than 256"}}:{}}}}let R=(0,i.createContext)({}),D=()=>(0,i.useContext)(R);function L(e){let{children:t}=e,n=function(){let{autopilotState:e,autopilot:t,contractSet:n,gouging:r,redundancy:s,uploadPacking:u,averages:c,shouldSyncDefaultContractSet:d,setShouldSyncDefaultContractSet:f,appSettings:j,isAutopilotEnabled:P}=function(){var e,t;let n=(0,T.q)(),r="on"===n.autopilot.status,i=(0,k.e$)({config:{swr:{errorRetryCount:0,refreshInterval:(0,a.sWj)(1)}}}),o=(0,S.a)({config:{swr:{errorRetryCount:0,refreshInterval:(0,a.sWj)(1)}}}),s=(e={config:{swr:{refreshInterval:(0,a.sWj)(1)}}},(0,k.yu)({...e,params:{key:"gouging"}})),l=(0,O.w)({config:{swr:{refreshInterval:(0,a.sWj)(1)}}}),u=(t={config:{swr:{refreshInterval:(0,a.sWj)(1)}}},(0,k.yu)({...t,params:{key:"uploadpacking"}})),c=(0,M.BF)({config:{swr:{revalidateOnFocus:!1}}}),{shouldSyncDefaultContractSet:d,setShouldSyncDefaultContractSet:f,syncDefaultContractSet:h}=C(),p=(0,_.Hv)();return{autopilotState:n.autopilot.state,autopilot:i,contractSet:o,gouging:s,redundancy:l,uploadPacking:u,averages:c,shouldSyncDefaultContractSet:d,setShouldSyncDefaultContractSet:f,syncDefaultContractSet:h,appSettings:p,isAutopilotEnabled:r}}(),{form:R,maxStoragePriceTBMonth:D,maxDownloadPriceTB:L,maxUploadPriceTB:Z,storageTB:F,downloadTBMonth:z,uploadTBMonth:V,redundancyMultiplier:I,fields:B,showAdvanced:H,setShowAdvanced:U}=function(){let e=(0,A.cI)({mode:"all",defaultValues:h}),t=e.watch("maxStoragePriceTBMonth"),n=e.watch("maxDownloadPriceTB"),r=e.watch("maxUploadPriceTB"),a=e.watch("storageTB"),s=e.watch("downloadTBMonth"),u=e.watch("uploadTBMonth"),c=e.watch("minShards"),d=e.watch("totalShards"),f=(0,i.useMemo)(()=>{let e;return e=new(l())(1),c&&d&&!c.isZero()&&!d.isZero()&&d.gte(c)&&(e=d.div(c)),e},[c,d]),{averages:y,storageAverage:b,uploadAverage:x,downloadAverage:w,contractAverage:j}=function(){let e=(0,M.BF)({config:{swr:{revalidateOnFocus:!1}}}),t=(0,i.useMemo)(()=>e.data?new(l())((0,o.ll)(e.data.settings.storage_price).times((0,o.S5)(1)).times((0,o.xf)(1)).toFixed(0)):void 0,[e.data]),n=(0,i.useMemo)(()=>e.data?new(l())((0,o.ll)(e.data.settings.upload_price).times((0,o.xf)(1)).toFixed(0)):void 0,[e.data]),r=(0,i.useMemo)(()=>e.data?new(l())((0,o.ll)(e.data.settings.download_price).times((0,o.xf)(1)).toFixed(0)):void 0,[e.data]),a=(0,i.useMemo)(()=>e.data?new(l())((0,o.ll)(e.data.settings.contract_price).toFixed(0)):void 0,[e.data]);return{averages:e,storageAverage:t,uploadAverage:n,downloadAverage:r,contractAverage:a}}(),S="on"===(0,T.q)().autopilot.status,[C,_]=(0,E.Z)("v0/config/showAdvanced",{defaultValue:!1}),O=(0,k.d_)();return{form:e,fields:(0,i.useMemo)(()=>{var e;let n=O.data?{...p(e=O.data.network),...m,...v,...g,..."Mainnet"===e?{minShards:new(l())(10),totalShards:new(l())(30)}:{minShards:new(l())(2),totalShards:new(l())(6)}}:void 0;return y.data?N({advancedDefaults:n,isAutopilotEnabled:S,showAdvanced:C,maxStoragePriceTBMonth:t,maxUploadPriceTB:r,redundancyMultiplier:f,storageAverage:b,uploadAverage:x,downloadAverage:w,contractAverage:j,minShards:c,totalShards:d}):N({advancedDefaults:n,isAutopilotEnabled:S,showAdvanced:C,maxStoragePriceTBMonth:t,maxUploadPriceTB:r,redundancyMultiplier:f,minShards:c,totalShards:d})},[O.data,S,C,y.data,b,x,w,j,f,t,r,c,d]),maxStoragePriceTBMonth:t,maxDownloadPriceTB:n,maxUploadPriceTB:r,storageTB:a,downloadTBMonth:s,uploadTBMonth:u,minShards:c,totalShards:d,redundancyMultiplier:f,showAdvanced:C,setShowAdvanced:_}}(),W=(0,i.useMemo)(()=>({autopilotState:{data:e.data,error:e.error},autopilot:{data:t.data,error:t.error},contractSet:{data:n.data,error:n.error},uploadPacking:{data:u.data,error:u.error},gouging:{data:r.data,error:r.error},redundancy:{data:s.data,error:s.error},averages:{data:c.data,error:c.error},appSettings:{settings:{siaCentral:j.settings.siaCentral}}}),[e.data,e.error,t.data,t.error,n.data,n.error,u.data,u.error,r.data,r.error,s.data,s.error,c.data,c.error,j.settings.siaCentral]),q=(0,i.useMemo)(()=>{var e;return!function(e){let{autopilotState:t,autopilot:n,contractSet:r,uploadPacking:i,gouging:a,redundancy:o,averages:s,appSettings:l}=e;return!!(t.data&&o.data&&i.data&&a.data&&(n.data||n.error)&&(r.data||r.error)&&(!l.settings.siaCentral||s.data))}(W)?null:x({hasBeenConfigured:null===(e=W.autopilotState.data)||void 0===e?void 0:e.configured,autopilot:W.autopilot.data,contractSet:W.contractSet.data,uploadPacking:W.uploadPacking.data,gouging:W.gouging.data,averages:W.averages.data,redundancy:W.redundancy.data})},[W]),$=(0,i.useMemo)(()=>(function(e){let{uploadPacking:t,gouging:n,redundancy:r}=e;return!!(r.error||t.error||n.error)})(W),[W]),K=(0,i.useCallback)(async()=>{let i=await e.mutate(),o=P?await t.mutate():void 0,l=await n.mutate(),d=await r.mutate(),f=await s.mutate(),h=await u.mutate();if(!r||!s)return(0,a.OHV)("Error fetching settings."),null;R.reset(x({hasBeenConfigured:i.configured,autopilot:o,contractSet:l,uploadPacking:h,gouging:d,averages:c.data,redundancy:f}))},[R,e,P,t,n,r,u,s,c.data]);(0,a.u$d)({form:R,remoteValues:q}),(0,a.Z4p)({form:R,remoteValues:q});let{changeCount:Y}=(0,a.mYE)({form:R}),{canEstimate:X,estimatedSpendingPerMonth:G,estimatedSpendingPerTB:Q}=function(e){let{isAutopilotEnabled:t,redundancyMultiplier:n,maxStoragePriceTBMonth:r,storageTB:a,maxDownloadPriceTB:o,downloadTBMonth:s,maxUploadPriceTB:u,uploadTBMonth:c}=e,d=(0,i.useMemo)(()=>!!t&&(null==r?void 0:r.gt(0))&&(null==a?void 0:a.gt(0))&&(null==o?void 0:o.gt(0))&&(null==u?void 0:u.gt(0)),[t,r,a,o,u]),f=(0,i.useMemo)(()=>{if(!d)return new(l())(0);let e=(null==a?void 0:a.gt(0))?a:new(l())(0),t=(null==s?void 0:s.gt(0))?s:new(l())(0),i=(null==c?void 0:c.gt(0))?c:new(l())(0),f=(null==r?void 0:r.gt(0))?r:new(l())(0),h=(null==u?void 0:u.gt(0))?u:new(l())(0),p=(null==o?void 0:o.gt(0))?o:new(l())(0),m=f.times(n).times(e),v=p.times(t),g=h.times(n).times(i);return m.plus(v).plus(g)},[d,n,r,a,o,s,u,c]),h=(0,i.useMemo)(()=>d?f.div(a):new(l())(0),[d,f,a]);return{canEstimate:d,estimatedSpendingPerMonth:f,estimatedSpendingPerTB:h}}({isAutopilotEnabled:P,redundancyMultiplier:I,maxStoragePriceTBMonth:D,storageTB:F,maxDownloadPriceTB:L,downloadTBMonth:z,maxUploadPriceTB:Z,uploadTBMonth:V}),J=function(e){let{resources:t,estimatedSpendingPerMonth:n,isAutopilotEnabled:r,showAdvanced:s,revalidateAndResetForm:l}=e,u=(0,k.Bl)(),c=(0,k.oe)(),d=(0,k.KJ)(),f=(0,k.d_)(),{syncDefaultContractSet:h}=C(),m=(0,_.Tu)();return(0,i.useCallback)(async e=>{if(t.gouging.data&&t.redundancy.data&&f.data)try{let i={};r&&!s&&(i.allowanceMonth=n);let v={...e,...i},g=r&&!t.autopilot.data,x=r?await c.put({payload:function(e,t,n){let r={...p(e),...y(t)};return{...n,contracts:{...null==n?void 0:n.contracts,set:r.autopilotContractSet,amount:Math.round(r.amountHosts.toNumber()),allowance:(0,o.qN)(w(r.allowanceMonth,r.periodWeeks)).toString(),period:Math.round((0,o.mv)(r.periodWeeks.toNumber())),renewWindow:Math.round((0,o.mv)(r.renewWindowWeeks.toNumber())),download:Number(w((0,o.xf)(r.downloadTBMonth),r.periodWeeks).toFixed(0)),upload:Number(w((0,o.xf)(r.uploadTBMonth),r.periodWeeks).toFixed(0)),storage:(0,o.xf)(r.storageTB).toNumber(),prune:r.prune},hosts:{...null==n?void 0:n.hosts,maxDowntimeHours:r.maxDowntimeHours.toNumber(),minRecentScanFailures:r.minRecentScanFailures.toNumber(),allowRedundantIPs:r.allowRedundantIPs,scoreOverrides:(null==n?void 0:n.hosts.scoreOverrides)||null}}}(f.data.network,v,t.autopilot.data)}):void 0,[j,E,S,C]=await Promise.all([d.put({params:{key:"contractset"},payload:b(v,t.contractSet.data)}),d.put({params:{key:"uploadpacking"},payload:{...t.uploadPacking.data,enabled:v.uploadPackingEnabled}}),d.put({params:{key:"gouging"},payload:{...t.gouging.data,maxRPCPrice:(0,o.qN)(v.maxRpcPriceMillion.div(1e6)).toString(),maxStoragePrice:(0,o.qN)(v.maxStoragePriceTBMonth.div((0,o.S5)(1)).div((0,o.xf)(1))).toString(),maxUploadPrice:(0,o.qN)(v.maxUploadPriceTB).toString(),maxDownloadPrice:(0,o.qN)(v.maxDownloadPriceTB).toString(),maxContractPrice:(0,o.qN)(v.maxContractPrice).toString(),minMaxCollateral:(0,o.qN)(v.minMaxCollateral).toString(),hostBlockHeightLeeway:Math.round(v.hostBlockHeightLeeway.toNumber()),minPriceTableValidity:Math.round((0,a.ort)(v.minPriceTableValidityMinutes.toNumber())),minAccountExpiry:Math.round((0,a.k9c)(v.minAccountExpiryDays.toNumber())),minMaxEphemeralAccountBalance:(0,o.qN)(v.minMaxEphemeralAccountBalance).toString(),migrationSurchargeMultiplier:v.migrationSurchargeMultiplier.toNumber()}}),d.put({params:{key:"redundancy"},payload:{...t.redundancy.data,minShards:v.minShards.toNumber(),totalShards:v.totalShards.toNumber()}})]);if(null==x?void 0:x.error)throw Error(x.error);if(j.error)throw Error(j.error);if(E.error)throw Error(E.error);if(S.error)throw Error(S.error);if(C.error)throw Error(C.error);r&&(h(v.autopilotContractSet),u.post({payload:{forceScan:!0}})),(0,a.OPV)("Configuration has been saved."),g&&(async()=>{await (0,_.gw)(5e3),m(e=>e.startsWith(k.pz)),await (0,_.gw)(5e3),m(e=>e.startsWith(k.pz))})(),await l()}catch(e){(0,a.OHV)(e.message),console.log(e)}},[f.data,n,s,r,c,l,h,m,d,t,u])}({resources:W,estimatedSpendingPerMonth:G,showAdvanced:H,isAutopilotEnabled:P,revalidateAndResetForm:K}),ee=(0,a.WsO)(B),et=(0,i.useMemo)(()=>R.handleSubmit(J,ee),[R,J,ee]),en=(0,i.useRef)(),er=(0,i.useCallback)(async e=>{(0,a.S5N)(en.current,e)},[]);return{onSubmit:et,revalidateAndResetForm:K,form:R,fields:B,changeCount:Y,canEstimate:X,estimatedSpendingPerMonth:G,estimatedSpendingPerTB:Q,redundancyMultiplier:I,storageTB:F,shouldSyncDefaultContractSet:d,setShouldSyncDefaultContractSet:f,showAdvanced:H,setShowAdvanced:U,remoteError:$,configRef:en,takeScreenshot:er}}();return(0,r.jsx)(R.Provider,{value:n,children:t})}},76838:function(e,t,n){"use strict";n.d(t,{x:function(){return S},G:function(){return E}});var r=n(52322),i=n(36655),a=n(5632),o=n(57016),s=n(2784),l=n(6391),u=n.n(l),c=n(75262),d=n(61020),f=n(21487),h=n(91492),p=n(82851);let m=[{id:"actions",label:"",fixed:!0,cellClassName:"w-[50px] !pl-2 !pr-4 [&+*]:!pl-0",render:e=>{let{data:{id:t,hostIp:n,hostKey:i}}=e;return(0,r.jsx)(h.F,{id:t,address:n,publicKey:i})}},{id:"contractId",label:"contract ID",category:"general",render:e=>{let{data:{id:t,isRenewed:n,renewedFrom:a},context:{siascanUrl:o}}=e;return(0,r.jsxs)("div",{className:"flex flex-col gap-1 w-full",children:[(0,r.jsx)(i.XxW,{size:"12",value:(0,i.I13)(t),type:"contract",label:"contract ID",siascanUrl:o}),n&&(0,r.jsx)(i.ua7,{content:"Renewed from",align:"start",children:(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(i.xvT,{color:"subtle",children:(0,r.jsx)(d.L6f,{className:"scale-75"})}),(0,r.jsx)(i.XxW,{color:"subtle",size:"10",type:"contract",value:(0,i.I13)(a),siascanUrl:o,label:"contract ID"})]})})]})}},{id:"contractSets",label:"contract sets",contentClassName:"w-[120px]",category:"general",render:e=>{let{data:{contractSets:t},context:{defaultSet:n}}=e;return t?(0,r.jsx)("div",{className:"flex flex-col items-center overflow-hidden h-full",children:(0,r.jsx)(i.xrM,{children:(0,r.jsx)("div",{className:"flex min-h-full gap-1 flex-wrap py-2 items-center",children:t.map(e=>{let t=n===e;return(0,r.jsx)(i.ua7,{content:"Contract is part of set ".concat(e,".")+(t?" ".concat(e," is the default contract set."):""),children:(0,r.jsxs)(i.Cts,{interactive:!1,size:"small",className:(0,p.cx)("flex gap-px items-center",t?"pl-px":""),children:[t?(0,r.jsx)(d.Y3p,{className:"scale-75"}):null,e]})},e)})})})}):null}},{id:"hostIp",label:"host address",category:"general",render:e=>{let{data:{hostIp:t},context:{siascanUrl:n}}=e;return(0,r.jsx)(i.XxW,{size:"12",value:t,type:"hostIp",siascanUrl:n})}},{id:"hostKey",label:"host public key",category:"general",render:e=>{let{data:{hostKey:t},context:{siascanUrl:n}}=e;return(0,r.jsx)(i.XxW,{size:"12",value:t,type:"hostPublicKey",siascanUrl:n})}},{id:"state",label:"state",category:"general",render:e=>{let{data:{state:t}}=e;return(0,r.jsx)(i.ua7,{content:(0,r.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,r.jsxs)("div",{className:"flex",children:[(0,r.jsx)(i.xvT,{className:"flex-1",weight:"medium",children:"pending"}),(0,r.jsx)(i.xvT,{className:"flex-[2]",color:"subtle",children:"Contract has been added."})]}),(0,r.jsx)(i.Z0O,{className:"w-full"}),(0,r.jsxs)("div",{className:"flex",children:[(0,r.jsx)(i.xvT,{className:"flex-1",weight:"medium",children:"active"}),(0,r.jsx)(i.xvT,{className:"flex-[2]",color:"subtle",children:"Contract has appeared on chain."})]}),(0,r.jsx)(i.Z0O,{className:"w-full"}),(0,r.jsxs)("div",{className:"flex",children:[(0,r.jsx)(i.xvT,{className:"flex-1",weight:"medium",children:"complete"}),(0,r.jsx)(i.xvT,{className:"flex-[2]",color:"subtle",children:"Storage proof has appeared on chain."})]}),(0,r.jsx)(i.Z0O,{className:"w-full"}),(0,r.jsxs)("div",{className:"flex",children:[(0,r.jsx)(i.xvT,{className:"flex-1",weight:"medium",children:"failed"}),(0,r.jsx)(i.xvT,{className:"flex-[2]",color:"subtle",children:"Storage proof was not submitted before the end of proof window."})]})]}),children:(0,r.jsx)(i.Cts,{variant:"active"===t?"amber":"failed"===t?"red":"pending"===t?"amber":"complete"===t?"green":void 0,children:t})})}},{id:"timeline",label:"timeline",category:"time",render:e=>{let{data:{contractHeightStart:t,contractHeightEnd:n,proofWindowHeightStart:a,proofWindowHeightEnd:o,revisionHeight:s,proofHeight:l},context:{currentHeight:u,contractsTimeRange:c}}=e;return(0,r.jsx)("div",{className:"w-[400px]",children:(0,r.jsx)(i.TaT,{currentHeight:u,contractHeightStart:t,contractHeightEnd:n,proofWindowHeightStart:a,proofWindowHeightEnd:o,proofHeight:l,revisionHeight:s,range:c})})}},{id:"startTime",label:"start date",category:"time",contentClassName:"w-[120px] justify-end",render:e=>{let{data:{startTime:t}}=e;return(0,r.jsx)(i.xvT,{size:"12",font:"mono",ellipsis:!0,children:(0,f.rN)(t)})}},{id:"endTime",label:"end date",category:"time",contentClassName:"w-[120px] justify-end",render:e=>{let{data:{endTime:t}}=e;return(0,r.jsx)(i.xvT,{size:"12",font:"mono",ellipsis:!0,children:(0,f.rN)(t)})}},{id:"size",label:"size",category:"general",contentClassName:"w-[120px] justify-end",render:e=>{let{data:{size:t}}=e;return(0,r.jsx)(i.m2c,{size:"12",value:t,variant:"value",format:e=>(0,f.vW)(e)})}},{id:"totalCost",label:"total cost",category:"financial",contentClassName:"w-[120px] justify-end",render:e=>{let{data:{totalCost:t}}=e;return(0,r.jsx)(i.ho9,{displayBoth:!0,size:"12",value:t.negated()})}},{id:"spendingUploads",label:"uploads spending",category:"financial",contentClassName:"w-[120px] justify-end",render:e=>{let{data:{spendingUploads:t}}=e;return(0,r.jsx)(i.ho9,{displayBoth:!0,size:"12",value:t.negated()})}},{id:"spendingDownloads",label:"downloads spending",category:"financial",contentClassName:"w-[120px] justify-end",render:e=>{let{data:{spendingDownloads:t}}=e;return(0,r.jsx)(i.ho9,{displayBoth:!0,size:"12",value:t.negated()})}},{id:"spendingFundAccount",label:"fund account spending",category:"financial",contentClassName:"w-[120px] justify-end",render:e=>{let{data:{spendingFundAccount:t}}=e;return(0,r.jsx)(i.ho9,{displayBoth:!0,size:"12",value:t.negated()})}}];var v=n(82494),g=n(38855),y=n(45178);function b(e){let t=(0,i.sWj)(5);return Math.round(e/t)*t}function x(e){let{start:t,disabled:n,contractId:a}=e,l=b(t),c=(0,i.NrH)(1),d=(0,s.useMemo)(()=>Math.max(Math.round((b(new Date().getTime())-l)/c),1),[l,c]),h=(0,s.useMemo)(()=>{let e={start:new Date(l||0).toISOString(),interval:c,n:d};return a&&(e.contractID=a),e},[l,c,d,a]),p=(0,o.Yy)({disabled:n,params:h});return{contractMetrics:(0,s.useMemo)(()=>{var e;let t=(0,i.Y_Z)(null===(e=p.data)||void 0===e?void 0:e.map(e=>({uploadSpending:Number(e.uploadSpending),listSpending:Number(e.listSpending),deleteSpending:Number(e.deleteSpending),fundAccountSpending:Number(e.fundAccountSpending),remainingCollateral:Number(e.remainingCollateral),remainingFunds:Number(e.remainingFunds),timestamp:new Date(e.timestamp).getTime()})),"none"),n=(0,i.fVJ)(t);return{data:t,stats:n,config:{enabledGraph:["remainingFunds","remainingCollateral","fundAccountSpending","uploadSpending","listSpending","deleteSpending"],enabledTip:["remainingFunds","remainingCollateral","fundAccountSpending","uploadSpending","listSpending","deleteSpending"],categories:["funding","spending"],data:{remainingFunds:{label:"remaining funds",category:"funding",color:i.O9T.emerald[600]},remainingCollateral:{label:"remaining collateral",category:"funding",pattern:!0,color:i.O9T.emerald[600]},fundAccountSpending:{label:"fund account",category:"spending",color:i.O9T.red[600]},uploadSpending:{label:"upload",category:"spending",color:i.O9T.red[600]},listSpending:{label:"list",category:"spending",color:i.O9T.red[600]},deleteSpending:{label:"delete",category:"spending",color:i.O9T.red[600]}},formatComponent:function(e){let{value:t}=e;return(0,r.jsx)(i.ho9,{variant:"value",value:new(u())(t)})},formatTimestamp:c===(0,i.NrH)(1)?(0,i.kOJ)("daily"):void 0,formatTickY:e=>(0,f.Vz)(e,{fixed:0,dynamicUnits:!0}),disableAnimations:!0,chartType:"barstack",curveType:"linear",stackOffset:"none"},isLoading:p.isValidating&&!p.data}},[p.data,p.isValidating,c])}}var w=n(91332),j=n(9338);let k=(0,s.createContext)({}),E=()=>(0,s.useContext)(k);function S(e){let{children:t}=e,n=function(){let[e,t]=(0,s.useState)("list"),[n,r]=(0,s.useState)("spending"),l=(0,a.useRouter)(),d=Number(l.query.limit||50),h=Number(l.query.offset||0),p=(0,o.GP)({config:{swr:{refreshInterval:j.h}}}),k=(0,v.JL)(),E=(0,s.useMemo)(()=>{var e;return(null===(e=k.data)||void 0===e?void 0:e.hosts)||[]},[k.data]),S=(0,g.n)(),C=S.isSynced?S.nodeBlockHeight:S.estimatedBlockHeight,[_,O]=(0,s.useState)(),M=(0,s.useCallback)(e=>{if(_===e){O(void 0);return}O(e),t("detail"),r("spending")},[_,O,t]),T=(0,s.useMemo)(()=>{var e;return p.data?(null===(e=p.data)||void 0===e?void 0:e.map(e=>{var t;let n="fcid:0000000000000000000000000000000000000000000000000000000000000000"!==e.renewedFrom,r=(0,f.jr)(C,e.startHeight),i=e.windowStart,a=(0,f.jr)(C,i);return{id:e.id,onClick:()=>M(e.id),contractId:e.id,state:e.state,hostIp:e.hostIP,hostKey:e.hostKey,contractSets:e.contractSets,location:null===(t=E.find(t=>t.public_key===e.hostKey))||void 0===t?void 0:t.location,timeline:r,startTime:r,endTime:a,contractHeightStart:e.startHeight,contractHeightEnd:i,proofWindowHeightStart:e.windowStart,proofWindowHeightEnd:e.windowEnd,proofHeight:e.proofHeight,revisionHeight:e.revisionHeight,isRenewed:n,renewedFrom:e.renewedFrom,totalCost:new(u())(e.totalCost),spendingUploads:new(u())(e.spending.uploads),spendingDownloads:new(u())(e.spending.downloads),spendingFundAccount:new(u())(e.spending.fundAccount),size:new(u())(e.size)}}))||[]:null},[p.data,E,C,M]),A=(0,s.useMemo)(()=>null==T?void 0:T.find(e=>e.id===_),[T,_]),{filters:P,setFilter:N,removeFilter:R,removeLastFilter:D,resetFilters:L}=(0,i.Wdu)(),{configurableColumns:Z,enabledColumns:F,sortableColumns:z,toggleColumnVisibility:V,setColumnsVisible:I,setColumnsHidden:B,toggleSort:H,setSortDirection:U,setSortField:W,sortField:q,sortDirection:$,resetDefaultColumnVisibility:K}=(0,i.oy6)("renterd/v0/contracts",{columns:m,columnsDefaultVisible:c.gd,sortOptions:c.Fo,defaultSortField:c.nw}),Y=(0,i._4u)({dataset:T,filters:P,sortField:q,sortDirection:$}),X=(0,s.useMemo)(()=>Y?Y.slice(h,h+d):null,[Y,h,d]),{range:G}=(0,s.useMemo)(()=>(0,i.EJC)(C,X||[]),[C,X]),Q=(0,s.useMemo)(()=>m.filter(e=>e.fixed||F.includes(e.id)),[F]),J=(0,i.c2j)(Y,p.isValidating,p.error,P),ee=(0,y.B)(),et=(0,w.a)(),en=(0,s.useMemo)(()=>{var e;return{currentHeight:S.estimatedBlockHeight,defaultSet:null===(e=et.data)||void 0===e?void 0:e.default,contractsTimeRange:G,siascanUrl:ee}},[S.estimatedBlockHeight,G,ee,et.data]),{contractMetrics:er}=x({start:new Date().getTime()-(0,i.NrH)(30)}),{contractMetrics:ei}=x({contractId:_,start:(null==A?void 0:A.startTime)||0,disabled:!A}),{contractSetMetrics:ea}=function(){var e;let t=b(new Date().getTime()-(0,i.NrH)(30)),n=(0,i.NrH)(1),r=(0,s.useMemo)(()=>Math.round((b(new Date().getTime())-t)/n),[t,n]),a=(0,o.e$)(),l=(0,o.Bi)({disabled:!a.data,params:{name:null===(e=a.data)||void 0===e?void 0:e.contracts.set,start:new Date(t).toISOString(),interval:n,n:r}});return{contractSetMetrics:(0,s.useMemo)(()=>{var e;let t=(0,i.Y_Z)(null===(e=l.data)||void 0===e?void 0:e.map(e=>({contracts:Number(e.contracts),timestamp:new Date(e.timestamp).getTime()})),"none"),r=(0,i.fVJ)(t);return{data:t,stats:r,config:{enabledGraph:["contracts"],enabledTip:["contracts"],data:{contracts:{label:"contracts",color:i.O9T.emerald[600]}},formatTimestamp:n===(0,i.NrH)(1)?(0,i.kOJ)("daily"):void 0,disableAnimations:!0,chartType:"line",curveType:"linear",stackOffset:"none"},isLoading:l.isValidating&&!l.data}},[l.data,l.isValidating,n])}}(),eo=(0,o.Wu)();return{dataState:J,limit:d,offset:h,isLoading:p.isLoading,error:p.error,pageCount:(null==X?void 0:X.length)||0,datasetCount:(null==T?void 0:T.length)||0,datasetFilteredCount:(null==Y?void 0:Y.length)||0,columns:Q,dataset:T,cellContext:en,datasetPage:X,configurableColumns:Z,enabledColumns:F,sortableColumns:z,toggleColumnVisibility:V,setColumnsVisible:I,setColumnsHidden:B,toggleSort:H,setSortDirection:U,setSortField:W,sortField:q,filters:P,setFilter:N,removeFilter:R,removeLastFilter:D,resetFilters:L,sortDirection:$,resetDefaultColumnVisibility:K,viewMode:e,setViewMode:t,graphMode:n,setGraphMode:r,selectedContract:A,selectContract:M,allContractsSpendingMetrics:er,selectedContractSpendingMetrics:ei,contractSetCountMetrics:ea,contractSets:eo}}();return(0,r.jsx)(k.Provider,{value:n,children:t})}},75262:function(e,t,n){"use strict";n.d(t,{Fo:function(){return a},gd:function(){return r},nw:function(){return i}});let r=["contractId","contractSets","hostIp","hostKey","state","timeline","size","totalCost","spendingUploads","spendingDownloads","spendingFundAccount"],i="startTime",a=[{id:"contractId",label:"contract ID",category:"general"},{id:"hostIp",label:"host address",category:"general"},{id:"hostKey",label:"host public key",category:"general"},{id:"state",label:"state",category:"general"},{id:"timeline",label:"timeline",category:"time"},{id:"startTime",label:"start date",category:"time"},{id:"endTime",label:"end date",category:"time"},{id:"size",label:"size",category:"general"},{id:"totalCost",label:"total cost",category:"financial"},{id:"spendingUploads",label:"uploads spending",category:"financial"},{id:"spendingDownloads",label:"downloads spending",category:"financial"},{id:"spendingFundAccount",label:"fund account spending",category:"financial"}]},97112:function(e,t,n){"use strict";n.d(t,{Tu:function(){return eB},xQ:function(){return eH},Rh:function(){return eI}});var r=n(52322),i=n(2784),a=n(36655),o=n(10363),s=n(98334),l=n(82851),u=n(99182),c=n(5632),d=n(35599),f=n(57016);let h={namespace:"wallet",label:"Wallet"};function p(e){var t;let{currentPage:n,parentPage:i,pushPage:o}=e,{openDialog:l,closeDialog:u}=eI(),p=(0,c.useRouter)(),m=(0,f.X2)();return(0,r.jsxs)(d.fu,{currentPage:n,commandPage:h,children:[(0,r.jsx)(d.Ul,{currentPage:n,parentPage:i,commandPage:h,onSelect:()=>{o(h)},children:h.label}),(0,r.jsx)(d.WD,{currentPage:n,commandPage:h,onSelect:()=>{p.push(s._.wallet.view),u()},children:"View wallet transactions"}),(0,r.jsx)(d.WD,{currentPage:n,commandPage:h,onSelect:()=>{l("sendSiacoin")},children:"Send siacoin"}),(0,r.jsx)(d.WD,{currentPage:n,commandPage:h,onSelect:()=>{l("addressDetails")},children:"Receive siacoin"}),(0,r.jsx)(d.WD,{currentPage:n,commandPage:h,onSelect:()=>{l("addressDetails")},children:"View wallet address"}),(0,r.jsx)(d.WD,{currentPage:n,commandPage:h,disabled:!(null===(t=m.data)||void 0===t?void 0:t.address),onSelect:()=>{var e;(null===(e=m.data)||void 0===e?void 0:e.address)&&((0,a.vQq)(m.data.address,"wallet address"),u())},children:"Copy wallet address to clipboard"})]})}var m=n(38617);let v={namespace:"settings",label:"Settings"};function g(e){let{currentPage:t,parentPage:n}=e,{openDialog:i,closeDialog:a}=eI(),{setTheme:s}=(0,m.F)(),{settings:l,setSettings:u,lock:c,currencyOptions:f,setCurrency:h}=(0,o.Hv)();return(0,r.jsxs)(d.fu,{currentPage:t,commandPage:v,children:[(0,r.jsx)(d.Ul,{currentPage:t,parentPage:n,commandPage:v,onSelect:()=>{i("settings")},children:"Open settings"}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:v,onSelect:()=>{u({siaCentral:!l.siaCentral}),a()},children:(l.siaCentral?"Disable":"Enable")+" external API - Sia Central exchange rates"}),(0,r.jsx)(d.o4,{currentPage:t,commandPage:v,onSelect:()=>{c(),a()},children:"Lock renterd"}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:v,onSelect:()=>{i("settings")},children:"Open interface theme menu"}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:v,onSelect:()=>{s("system"),a()},children:"Set theme to system preference"}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:v,onSelect:()=>{s("dark"),a()},children:"Set theme to dark"}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:v,onSelect:()=>{s("light"),a()},children:"Set theme to light"}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:v,onSelect:()=>{i("settings")},children:"Open currency settings menu"}),f.map(e=>{let{id:n,label:i}=e;return(0,r.jsx)(d.WD,{currentPage:t,commandPage:v,onSelect:()=>{h(n),a()},children:"Set currency to ".concat(i)},n)})]})}let y={namespace:"node",label:"Blockchain node"};function b(e){let{currentPage:t,parentPage:n,pushPage:i}=e,{openDialog:a,closeDialog:o}=eI(),l=(0,c.useRouter)();return(0,r.jsxs)(d.fu,{currentPage:t,commandPage:y,children:[(0,r.jsx)(d.Ul,{currentPage:t,parentPage:n,commandPage:y,onSelect:()=>{i(y)},children:y.label}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:y,onSelect:()=>{a("connectPeer")},children:"Connect to a peer"}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:y,onSelect:()=>{l.push(s._.node.index),o()},children:"View peers"}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:y,onSelect:()=>{l.push(s._.node.index),o()},children:"View transaction pool"})]})}var x=n(49889),w=n(46081);let j={namespace:"configuration",label:"Configuration"};function k(e){let{currentPage:t,parentPage:n,pushPage:i}=e,a=(0,c.useRouter)(),{showAdvanced:o}=(0,x.ZR)(),{closeDialog:l}=eI(),{autopilot:u}=(0,w.q)();return(0,r.jsxs)(d.fu,{currentPage:t,commandPage:j,children:[(0,r.jsx)(d.Ul,{currentPage:t,parentPage:n,commandPage:j,onSelect:()=>{i(j)},children:j.label}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:j,onSelect:()=>{a.push(s._.config.index),l()},children:"Open configuration"}),"on"===u.status&&(0,r.jsx)(d.WD,{currentPage:t,commandPage:j,onSelect:()=>{a.push(s._.config.storage),l()},children:"Configure storage"}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:j,onSelect:()=>{a.push(s._.config.pricing),l()},children:"Configure pricing"}),o&&(0,r.jsxs)(r.Fragment,{children:["on"===u.status&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.WD,{currentPage:t,commandPage:j,onSelect:()=>{a.push(s._.config.hosts),l()},children:"Configure hosts"}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:j,onSelect:()=>{a.push(s._.config.wallet),l()},children:"Configure wallet"})]}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:j,onSelect:()=>{a.push(s._.config.contracts),l()},children:"Configure contracts"}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:j,onSelect:()=>{a.push(s._.config.uploads),l()},children:"Configure uploads"}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:j,onSelect:()=>{a.push(s._.config.redundancy),l()},children:"Configure redundancy"})]})]})}var E=n(14613);let S={namespace:"contracts",label:"Contracts"};function C(e){let{currentPage:t,parentPage:n,pushPage:i,beforeSelect:a,afterSelect:o}=e,l=(0,c.useRouter)(),{closeDialog:u}=eI();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.Ul,{currentPage:t,parentPage:n,commandPage:n,onSelect:()=>{i(S)},children:S.label}),(0,r.jsx)(d.fu,{currentPage:t,commandPage:S,children:(0,r.jsx)(d.WD,{currentPage:t,commandPage:S,onSelect:()=>{l.push(s._.contracts.index),u()},children:"View contracts"})}),(0,r.jsx)(E.F,{parentPage:S,currentPage:t,beforeSelect:a,afterSelect:o,pushPage:i})]})}let _={namespace:"alerts",label:"Alerts"};function O(e){let{currentPage:t,parentPage:n,pushPage:i}=e,a=(0,c.useRouter)(),{closeDialog:o}=eI();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.Ul,{currentPage:t,parentPage:n,commandPage:n,onSelect:()=>{i(_)},children:_.label}),(0,r.jsx)(d.fu,{currentPage:t,commandPage:_,children:(0,r.jsx)(d.WD,{currentPage:t,commandPage:_,onSelect:()=>{a.push(s._.alerts.index),o()},children:"View alerts"})})]})}var M=n(76838),T=n(42213);let A={namespace:"hosts",label:"Hosts"};function P(e){let{currentPage:t,parentPage:n,pushPage:i,beforeSelect:a,afterSelect:o}=e,l=(0,c.useRouter)(),{closeDialog:u,openDialog:f}=eI();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.Ul,{currentPage:t,parentPage:n,commandPage:n,onSelect:()=>{i(A)},children:A.label}),(0,r.jsx)(d.fu,{currentPage:t,commandPage:A,children:(0,r.jsx)(d.WD,{currentPage:t,commandPage:A,onSelect:()=>{l.push(s._.hosts.index),u()},children:"View hosts"})}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:A,onSelect:()=>{f("hostsManageAllowBlock")},children:"Manage filter lists: allowlist + blocklist"}),(0,r.jsx)(T.L,{parentPage:A,currentPage:t,beforeSelect:a,afterSelect:o,pushPage:i})]})}var N=n(70899),R=n(61020);function D(e){let{debouncedSearch:t}=e;return(0,r.jsxs)(a.xvT,{color:"verySubtle",className:"flex flex-col gap-2 justify-center items-center mt-5 mb-3",children:[(0,r.jsxs)(a.xvT,{color:"verySubtle",className:"flex gap-2 justify-center items-center",children:[(0,r.jsx)(R.e1T,{}),(0,r.jsx)(R.JCW,{}),(0,r.jsx)(R.c_L,{})]}),(0,r.jsx)(a.xvT,{size:"12",color:"verySubtle",className:"flex justify-center",children:t?"No files match the query.":"Type a query to get started."})]})}var L=n(41736);let Z={namespace:"files/search",label:"File search",prompt:"Search for files, eg: backups, photo_archive.zip, etc...",empty:D};function F(e){let{debouncedSearch:t,search:n,currentPage:i,beforeSelect:o,afterSelect:s}=e,{activeBucketName:l,navigateToModeSpecificFiltering:u}=(0,L.b)(),c=(null==i?void 0:i.namespace)===Z.namespace,h=l||"default",p=(0,f.Iy)({disabled:!c,params:{bucket:h,key:t,offset:0,limit:10},config:{swr:{keepPreviousData:!0}}});return c&&p.data?(0,r.jsx)(d.fu,{currentPage:i,commandPage:Z,children:p.data.map(e=>{let{name:t}=e,l=function(e,t,n){let r=Math.max(e.length-55,0);if(0===r)return e;let i=z(e),a=z(t),o=i.toLowerCase().indexOf(a.toLowerCase()),s=o+a.length-1,l=0,u=0;return i.split("/").map(e=>{if(l>=r)return u+=e.length,z(e);let t=u,n=u+e.length+1;return to?(u+=e.length,z(e)):!e.includes(a)&&e.length>3?(u+=e.length,l+=e.length+1,"..."):(u+=e.length,z(e))}).reverse().join("/")}(t,n,0),{startIndex:c,endIndex:f}=function(e,t){let n=z(e),r=z(t),i=n.toLowerCase().indexOf(r.toLowerCase()),a=i+r.length;return{endIndex:e.length-i,startIndex:e.length-a}}(l,n);return(0,r.jsx)(d.WD,{commandPage:Z,currentPage:i,onSelect:()=>{o(),u(h+t),s()},value:t,children:(0,r.jsxs)("div",{className:"flex items-center gap-2 overflow-hidden",children:[(0,r.jsx)(a.xvT,{color:"verySubtle",className:"group-data-[selected=true]:text-gray-1000 dark:group-data-[selected=true]:text-graydark-1000",children:(0,N.IQ)(t)?(0,r.jsx)(R.ROc,{size:16}):(0,r.jsx)(R.c_L,{})}),(0,r.jsxs)(a.xvT,{className:"flex items-center",children:[(0,r.jsx)(a.xvT,{color:"verySubtle",ellipsis:!0,children:l.slice(0,c)}),(0,r.jsx)(a.xvT,{color:"accent",ellipsis:!0,children:l.slice(c,f)}),(0,r.jsx)(a.xvT,{color:"verySubtle",ellipsis:!0,children:l.slice(f)})]})]})},t)})}):null}function z(e){return e.split("").reverse().join("")}let V={namespace:"files",label:"Files"};function I(e){let{search:t,debouncedSearch:n,currentPage:i,parentPage:a,pushPage:o,beforeSelect:l,afterSelect:u}=e,f=(0,c.useRouter)(),{closeDialog:h}=eI();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.Ul,{currentPage:i,parentPage:a,commandPage:a,onSelect:()=>{o(V)},children:V.label}),(0,r.jsxs)(d.fu,{currentPage:i,commandPage:V,children:[(0,r.jsx)(d.WD,{currentPage:i,commandPage:V,onSelect:()=>{f.pathname.startsWith(s._.buckets.index)||f.push(s._.buckets.index),h(),u()},children:"View files"}),(0,r.jsx)(d.WD,{currentPage:i,commandPage:V,onSelect:()=>{o(Z),u()},children:"Search files"})]}),(0,r.jsx)(F,{debouncedSearch:n,search:t,currentPage:i,beforeSelect:l,afterSelect:u})]})}var B=n(56328),H=n(94225);function U(e){let{search:t}=e;return(0,r.jsxs)(a.xvT,{color:"verySubtle",className:"flex flex-col gap-2 justify-center items-center mt-5 mb-3",children:[(0,r.jsx)(a.xvT,{color:"verySubtle",className:"flex gap-2 justify-center items-center",children:(0,r.jsx)(R.owP,{})}),(0,r.jsx)(a.xvT,{size:"12",color:"verySubtle",className:"flex justify-center",children:t?"No results matching query.":"Type a query to get started."})]})}let W={namespace:"keys",label:"S3 authentication keys"};function q(e){let{currentPage:t,parentPage:n,pushPage:i}=e,a=(0,c.useRouter)(),{closeDialog:o,openDialog:l}=eI();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.Ul,{currentPage:t,parentPage:n,commandPage:n,onSelect:()=>{i(W)},children:W.label}),(0,r.jsxs)(d.fu,{currentPage:t,commandPage:W,children:[(0,r.jsx)(d.WD,{currentPage:t,commandPage:W,onSelect:()=>{a.push(s._.keys.index),o()},children:"View keys"}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:W,onSelect:()=>{a.push(s._.keys.index),l("keysCreate")},children:"Create new S3 authentication keypair"})]})]})}function $(e){let{panel:t}=e,{resetFilters:n}=(0,M.G)(),{resetFilters:o}=(0,B.l)(),{closeDialog:d}=eI(),f=(0,c.useRouter)(),[h,m]=(0,i.useState)(""),[v]=(0,H.Nr)(h,500),[y,x]=(0,i.useState)([]),w=y[y.length-1],j=0===y.length,E=(0,i.useCallback)(e=>{x(t=>[...t,e])},[x]),S=(0,i.useCallback)(()=>{d()},[d]),_=(0,i.useCallback)(()=>{m("")},[m]),T=(null==w?void 0:w.empty)||U;return(0,r.jsxs)(u.mY,{label:"Command Menu",loop:!0,className:(0,l.cx)(t&&(0,a.z$)()),onKeyDown:e=>{(y.length>0&&"Escape"===e.key||"Backspace"===e.key&&!h)&&(e.preventDefault(),x(e=>e.slice(0,-1)))},children:[w&&(0,r.jsx)(a.__J,{className:"px-2",children:w.label}),(0,r.jsx)(u.mY.Input,{value:h,onValueChange:m,className:(0,a.cEb)({variant:"ghost",focus:"none"}),placeholder:(null==w?void 0:w.prompt)||(j?"Search for commands, eg: theme, redundancy":"Search commands")}),(0,r.jsx)(a.Z0O,{className:"my-2"}),(0,r.jsxs)(u.mY.List,{children:[(0,r.jsx)(u.mY.Empty,{children:(0,r.jsx)(T,{search:h,debouncedSearch:v})}),(0,r.jsx)(g,{currentPage:w,pushPage:E}),(0,r.jsx)(I,{debouncedSearch:v,search:h,currentPage:w,pushPage:E,beforeSelect:()=>{S()},afterSelect:()=>{_()}}),(0,r.jsx)(p,{currentPage:w,pushPage:E}),(0,r.jsx)(C,{currentPage:w,pushPage:E,beforeSelect:()=>{S(),n()},afterSelect:()=>{f.pathname.startsWith(s._.contracts.index)||f.push(s._.contracts.index),_()}}),(0,r.jsx)(P,{currentPage:w,pushPage:E,beforeSelect:()=>{S(),o()},afterSelect:()=>{f.pathname.startsWith(s._.hosts.index)||f.push(s._.hosts.index),_()}}),(0,r.jsx)(q,{currentPage:w,pushPage:E,beforeSelect:()=>{S()},afterSelect:()=>{f.pathname.startsWith(s._.keys.index)||f.push(s._.keys.index),_()}}),(0,r.jsx)(O,{currentPage:w,pushPage:E,beforeSelect:()=>{S(),n()},afterSelect:()=>{f.pathname.startsWith(s._.alerts.index)||f.push(s._.alerts.index),_()}}),(0,r.jsx)(k,{currentPage:w,pushPage:E}),(0,r.jsx)(b,{currentPage:w,pushPage:E})]})]})}function K(e){let{open:t,onOpenChange:n,setOpen:l}=e,{isUnlockedAndAuthedRoute:u}=(0,o.Hv)(),{isConnected:c}=(0,a.Y97)({route:s.h});return(0,i.useEffect)(()=>{if(!u||!c)return;let e=e=>{"k"===e.key&&e.metaKey&&l()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[u,c,l]),(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(a.VqE,{open:t,onOpenChange:n,contentVariants:{className:"!absolute !p-1 w-[450px] top-[200px]"},bodyClassName:"!px-1 !py-1",closeClassName:"hidden",children:(0,r.jsx)($,{})})})}var Y=n(7114),X=n(24511);let G={name:""},Q=X.Ry().shape({name:X.Z_().required("Required")});function J(e){let{trigger:t,open:n,onOpenChange:i}=e,{activeDirectoryPath:o}=(0,L.b)(),s=(0,f.ZM)(),l=(0,Y.TA)({initialValues:G,validationSchema:Q,onSubmit:async(e,t)=>{let n=await s.put({params:(0,N.W0)(o+e.name+"/"),payload:null});n.error?(0,a.OHV)(n.error):((0,a.RFt)("Directory created."),t.resetForm(),i(!1))}});return(0,r.jsx)(a.VqE,{trigger:t,title:"New directory",open:n,onOpenChange:e=>{e||l.resetForm(),i(e)},contentVariants:{className:"w-[400px]"},children:(0,r.jsx)("div",{className:"flex flex-col gap-4",children:(0,r.jsx)("form",{onSubmit:l.handleSubmit,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(a.cB7,{formik:l,title:"Name",name:"name",placeholder:"photos, backups, etc",autoComplete:"off",type:"text",variants:{size:"medium"}}),(0,r.jsx)(a.IKw,{formik:l,size:"medium",children:"Create"})]})})})})}var ee=n(82229);let et={publicKey:""},en=X.Ry().shape({publicKey:X.Z_().required("Required")});function er(){var e;let t=(0,f.s2)({config:{swr:{refreshInterval:6e4}}}),n=(0,ee.I)(),o=(0,Y.TA)({initialValues:et,validationSchema:en,onSubmit:async(e,t)=>{await n([e.publicKey],[])?t.resetForm():t.setStatus({error:"Error updating allowlist"})}});(0,i.useEffect)(()=>{o.setStatus(void 0)},[o.values]);let s=o.values.publicKey,l=(null===(e=t.data)||void 0===e?void 0:e.filter(e=>!o.values.publicKey||e.includes(o.values.publicKey)))||[];return(0,r.jsxs)("form",{onSubmit:o.handleSubmit,className:"flex flex-col gap-2 h-[400px]",children:[(0,r.jsx)(a.S$c,{title:"Public key",name:"publicKey",formik:o,withStatusError:!0,children:(0,r.jsxs)("div",{className:"flex gap-1",children:[(0,r.jsx)(a.KZS,{name:"publicKey",formik:o,placeholder:"ed25519:02aabd26e627fd...",autoComplete:"off",variants:{size:"small"}}),(0,r.jsx)(a.IKw,{formik:o,size:"small",variant:"amber",withStatusError:!1,children:"Allow public key"})]})}),(0,r.jsxs)(a.s_4,{className:"p-2 flex gap-2 items-center",children:[(0,r.jsx)(a.xvT,{children:(0,r.jsx)(R.qdM,{})}),(0,r.jsxs)(a.nvN,{size:"12",children:[(0,r.jsx)(a.xvT,{weight:"semibold",children:"Caution:"})," Please note that because the allowlist is inclusive, as soon as there are more than zero entries, contracting will be limited to only the hosts explicitly on the allowlist - all other existing contracts will immediately abort."]})]}),(0,r.jsx)("div",{className:"flex-1 overflow-hidden !-m-2",children:l.length?(0,r.jsx)(a.xrM,{children:(0,r.jsx)("div",{className:"p-2",children:(0,r.jsx)(a.hmz,{options:l.map(e=>({value:e,label:"".concat(e.slice(0,20),"...")}))||[],onClick:e=>(0,a.vQq)(e,"allowed public key"),onRemove:e=>n([],[e])})})}):s?(0,r.jsxs)("div",{className:"flex flex-col gap-3 items-center justify-center h-[200px]",children:[(0,r.jsx)(a.xvT,{color:"subtle",children:(0,r.jsx)(R.Hb6,{})}),(0,r.jsxs)(a.xvT,{color:"subtle",children:["No existing entries match ",o.values.publicKey,"."]})]}):(0,r.jsxs)("div",{className:"flex flex-col gap-3 items-center justify-center h-[200px]",children:[(0,r.jsx)(a.xvT,{color:"subtle",children:(0,r.jsx)(R.TtX,{})}),(0,r.jsx)(a.xvT,{color:"subtle",children:"The allowlist is empty."})]})})]})}var ei=n(94613);let ea={address:""},eo=["45.148.30.56","51.158.108.244","siacentral.ddnsfree.com","siacentral.mooo.com"],es=X.Ry().shape({address:X.Z_().required("Required").test("address","Invalid hostname or IP address",e=>(0,a.Ztc)().test(e||""))});function el(){let e=(0,f.uf)({config:{swr:{refreshInterval:6e4}}}),t=(0,ei.l)(),n=(0,Y.TA)({initialValues:ea,validationSchema:es,onSubmit:async(e,n)=>{await t([e.address],[])?n.resetForm():n.setStatus({error:"Error updating blocklist"})}});(0,i.useEffect)(()=>{n.setStatus(void 0)},[n.values]);let o=n.values.address,s=(0,i.useMemo)(()=>{var t;return(null===(t=e.data)||void 0===t?void 0:t.filter(e=>!n.values.address||e.includes(n.values.address)))||[]},[e.data,n.values.address]),{dataset:l}=(0,M.G)(),u=(0,i.useMemo)(()=>eo.filter(t=>{var n;return!(null===(n=e.data)||void 0===n?void 0:n.find(e=>e===t))}).map(e=>({address:e,contractCount:null==l?void 0:l.filter(t=>t.hostIp===e).length})),[e.data,l]);return(0,r.jsxs)("form",{onSubmit:n.handleSubmit,className:"flex flex-col gap-2 h-[400px]",children:[(0,r.jsx)(a.S$c,{title:"Address",name:"address",formik:n,withStatusError:!0,children:(0,r.jsxs)("div",{className:"flex gap-1",children:[(0,r.jsx)(a.KZS,{name:"address",formik:n,placeholder:"eg: 51.258.128.144 or spam.ddnsfree.com",autoComplete:"off",variants:{size:"small"}}),(0,r.jsx)(a.IKw,{formik:n,size:"small",variant:"red",withStatusError:!1,children:"Block address"})]})}),(0,r.jsx)("div",{className:"flex-1 overflow-hidden !-m-2",children:(0,r.jsx)(a.xrM,{children:(0,r.jsxs)("div",{className:"p-2",children:[!!u.length&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex gap-1 flex-wrap",children:[(0,r.jsx)(a.xvT,{size:"12",color:"subtle",children:"Suggestions:"}),u.map((e,t)=>{let{address:i,contractCount:o}=e;return(0,r.jsxs)(a.xvT,{size:"12",underline:"hover",className:"cursor-pointer",onClick:()=>n.setFieldValue("address",i),children:[i,!!o&&(0,r.jsxs)(r.Fragment,{children:[" ",(0,r.jsx)(a.ua7,{content:"".concat(o," active contracts"),children:(0,r.jsxs)(a.xvT,{color:"red",children:["(",o,")"]})})]}),t!==u.length-1&&(0,r.jsx)(a.xvT,{children:","})]},i)})]}),(0,r.jsx)(a.Z0O,{className:"my-2"})]}),s.length?(0,r.jsx)(a.hmz,{options:s.map(e=>({value:e,label:"".concat(e.slice(0,20),"...")}))||[],onClick:e=>(0,a.vQq)(e,"blocked address"),onRemove:e=>t([],[e])}):o?(0,r.jsxs)("div",{className:"flex flex-col gap-3 items-center justify-center h-[200px]",children:[(0,r.jsx)(a.xvT,{color:"subtle",children:(0,r.jsx)(R.Hb6,{})}),(0,r.jsxs)(a.xvT,{color:"subtle",children:["No existing entries match ",n.values.address,"."]})]}):(0,r.jsxs)("div",{className:"flex flex-col gap-3 items-center justify-center h-[200px]",children:[(0,r.jsx)(a.xvT,{color:"subtle",children:(0,r.jsx)(R.TtX,{})}),(0,r.jsx)(a.xvT,{color:"subtle",children:"The blocklist is empty."})]})]})})})]})}function eu(e){let{trigger:t,open:n,onOpenChange:i}=e;return(0,r.jsx)(a.VqE,{trigger:t,title:"Manage host blocklist and allowlist",open:n,onOpenChange:e=>{i(e)},contentVariants:{className:"w-[500px]"},children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(a.nvN,{size:"12",children:"The allowlist and blocklist limit the set of hosts that renterd will consider when forming contracts. The blocklist excludes hosts with matching addresses whereas the allowlist restricts consideration to hosts with a matching public key. Each list's filtering is enabled and applied when it contains more than zero entries."}),(0,r.jsxs)(a.mQc,{defaultValue:"blocklist",children:[(0,r.jsxs)(a.drW,{"aria-label":"blocklist and allowlist tabs",children:[(0,r.jsx)(a.SPt,{value:"blocklist",children:"Block"}),(0,r.jsx)(a.SPt,{value:"allowlist",children:"Allow"})]}),(0,r.jsx)(a.nUL,{value:"blocklist",children:(0,r.jsx)(el,{})}),(0,r.jsx)(a.nUL,{value:"allowlist",children:(0,r.jsx)(er,{})})]})]})})}var ec=n(10532),ed=n(98131),ef=n(30291),eh=n(11948),ep=n(99605);function em(e){let{panel:t}=e,{closeDialog:n}=eI(),o=(0,ep.xj)(),c=(0,ep.jD)(),[d,f]=(0,i.useState)(""),[h]=(0,H.Nr)(d,500),p=(0,i.useCallback)(()=>{n()},[n]);return(0,r.jsxs)(u.mY,{label:"Files search",shouldFilter:!1,className:(0,l.cx)(t&&(0,a.z$)()),children:[(0,r.jsx)(a.__J,{className:"px-2",children:"File search"}),(0,r.jsx)(u.mY.Input,{value:d,onValueChange:f,className:(0,a.cEb)({variant:"ghost",focus:"none"}),placeholder:Z.prompt}),(0,r.jsx)(a.Z0O,{className:"my-2"}),(0,r.jsx)("div",{className:"overflow-hidden",children:(0,r.jsxs)(u.mY.List,{children:[(0,r.jsx)(u.mY.Empty,{children:(0,r.jsx)(D,{search:d,debouncedSearch:h})}),(0,r.jsx)(F,{debouncedSearch:h,search:d,currentPage:Z,beforeSelect:()=>{p()},afterSelect:()=>{c.startsWith(s._.buckets.index)||o.push(s._.buckets.index)}})]})})]})}function ev(e){let{open:t,onOpenChange:n,trigger:i}=e;return(0,r.jsx)(a.VqE,{open:t,trigger:i,onOpenChange:n,contentVariants:{className:"!absolute !p-1 w-[450px] top-[200px]"},bodyClassName:"!px-1 !py-1",closeClassName:"hidden",children:(0,r.jsx)(em,{})})}var eg=n(6391),ey=n.n(eg);function eb(){let{dialog:e,openDialog:t,closeDialog:n}=eI(),o=(0,f.X2)(),s=(0,f.gU)(),l=(0,f.cg)(),u=(0,f.ys)(),c=(0,f.aO)(),d=(0,i.useCallback)(async e=>{let{sc:t,address:n}=e,r=await s.post({payload:{amount:t.toString(),transaction:{siacoinOutputs:[{address:n,value:t.toString()}]}}});if(r.error)return{error:r.error};let i=await l.post({payload:{transaction:r.data.transaction,toSign:r.data.toSign,coveredFields:{wholeTransaction:!0}}});if(i.error)return c.post({payload:r.data.transaction}),{error:i.error};let a=await u.post({payload:[i.data]});return a.error?(c.post({payload:i.data}),{error:a.error}):{}},[s,l,u,c]);return(0,r.jsx)(a.weF,{balance:o.data?new(ey())(o.data.spendable):void 0,send:d,open:"sendSiacoin"===e,onOpenChange:r=>r?t(e):n()})}var ex=n(40730);function ew(){let{id:e,dialog:t,openDialog:n,closeDialog:o}=eI(),{dataset:s}=(0,ex.n)(),l=(0,i.useMemo)(()=>null==s?void 0:s.find(t=>t.hash===e),[s,e]);return(0,r.jsx)(a.mPE,{id:e,transaction:l,open:"transactionDetails"===t,onOpenChange:e=>e?n(t):o()})}var ej=n(23771),ek=n(63955);let eE={name:""};function eS(e){let{trigger:t,open:n,onOpenChange:o}=e,{id:s,closeDialog:l}=eI(),u=(0,f.sg)(),c=(0,ek.cI)({mode:"all",defaultValues:eE}),d=(0,i.useCallback)(async e=>{let t=await u.delete({params:{name:e.name}});t.error?(0,a.OHV)(t.error):((0,a.OPV)("Bucket permanently deleted."),c.reset(),l())},[c,u,l]),h=(0,i.useMemo)(()=>({name:{type:"text",title:"Name",placeholder:s,validation:{required:"required",validate:{notDefault:()=>"default"!==s||"cannot delete default bucket",equals:e=>e===s||"bucket name does not match"}}}}),[s]),p=(0,a.WsO)(h);return(0,r.jsx)(a.VqE,{title:"Delete Bucket",trigger:t,open:n,onOpenChange:e=>{e||c.reset(eE),o(e)},contentVariants:{className:"w-[400px]"},onSubmit:c.handleSubmit(d,p),children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(a.nvN,{size:"14",children:"Before you delete a bucket you must ensure that it is empty. Re-enter the bucket name to confirm the removal."}),(0,r.jsx)("div",{children:(0,r.jsx)(a.EKh,{color:"gray",children:s})}),(0,r.jsx)(a.yEL,{name:"name",form:c,fields:h,autoComplete:"off"}),(0,r.jsx)(a.ZqQ,{variant:"red",form:c,children:"Delete"})]})})}let eC={visibility:"public"};function e_(e){let{trigger:t,open:n,onOpenChange:o}=e,{id:s,closeDialog:l}=eI(),u=(0,f.D5)({disabled:!n,params:{name:s},config:{swr:{revalidateOnFocus:!1}}}),c=(0,f.ol)(),d=(0,ek.cI)({mode:"all",defaultValues:eC});(0,i.useEffect)(()=>{var e,t;d.reset({visibility:(null===(t=u.data)||void 0===t?void 0:null===(e=t.policy)||void 0===e?void 0:e.publicReadAccess)?"public":"private"})},[d,u.data]);let h=(0,i.useCallback)(async e=>{let t=await c.put({params:{name:s},payload:{policy:{publicReadAccess:"public"===e.visibility}}});t.error?(0,a.OHV)(t.error):((0,a.OPV)("Bucket policy has been updated."),d.reset(),l())},[d,s,c,l]),p=(0,i.useMemo)(()=>({visibility:{type:"text",title:"Read Access",placeholder:s,validation:{required:"required"},options:[{label:"Public",value:"public"},{label:"Private",value:"private"}]}}),[s]),m=(0,a.WsO)(p);return(0,r.jsx)(a.VqE,{title:"Change Policy: ".concat(s),trigger:t,open:n,onOpenChange:e=>{e||d.reset(eC),o(e)},contentVariants:{className:"w-[400px]"},onSubmit:d.handleSubmit(h,m),children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(a.nvN,{size:"14",children:"Update the bucket's policy to set read access to either private or public. Files in public read access buckets can be accessed without authentication via the S3 API."}),(0,r.jsx)(a.WyV,{name:"visibility",form:d,fields:p}),(0,r.jsx)(a.ZqQ,{variant:"accent",form:d,children:"Update policy"})]})})}let eO={name:""};function eM(e){let{trigger:t,open:n,onOpenChange:o}=e,{closeDialog:s}=eI(),l=(0,f.oV)(),u=(0,ek.cI)({mode:"all",defaultValues:eO}),c=(0,i.useCallback)(async e=>{let t=await l.post({payload:{name:e.name}});t.error?(0,a.OHV)(t.error):((0,a.OPV)("Bucket created."),u.reset(),s())},[u,l,s]),d=(0,i.useMemo)(()=>({name:{type:"text",title:"Name",placeholder:"photos, backups, etc",validation:{required:"required"}}}),[]),h=(0,a.WsO)(d);return(0,r.jsx)(a.VqE,{title:"Create Bucket",trigger:t,open:n,onOpenChange:e=>{e||u.reset(eO),o(e)},contentVariants:{className:"w-[400px]"},onSubmit:u.handleSubmit(c,h),children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(a.nvN,{size:"14",children:"A bucket is an isolated collection of files."}),(0,r.jsx)(a.yEL,{name:"name",form:u,fields:d,autoComplete:"off"}),(0,r.jsx)(a.ZqQ,{form:u,children:"Create bucket"})]})})}var eT=n(5184),eA=n(75618),eP=n(43385);function eN(e){let{id:t,trigger:n,open:o,onOpenChange:s}=e,{closeDialog:l}=eI(),{refresh:u}=(0,eA.J)(),{refresh:c}=(0,eP.o)(),d=(0,N.vt)(t||""),h={name:d=d.endsWith("/")?d.slice(0,-1):d},p=(0,f.GD)(),m=(0,ek.cI)({mode:"all",defaultValues:h});(0,i.useEffect)(()=>{m.reset({name:d})},[m,d]);let v=(0,i.useCallback)(async e=>{let{bucket:n,to:r,from:i,mode:o}=(0,eT.E)(t,e.name),s=await p.post({payload:{bucket:n,to:r,from:i,mode:o,force:!1}});s.error?(0,a.OHV)(s.error):(u(),c(),m.reset(),l(),(0,a.OPV)((0,N.IQ)(t)?"Directory renamed.":"File renamed."))},[m,t,u,c,p,l]),g=(0,i.useMemo)(()=>(function(e){let{currentName:t}=e;return{name:{type:"text",title:"Name",placeholder:t,validation:{required:"required",validate:{noSlash:e=>!e.includes("/")||"Name cannot contain slashes"}}}}})({currentName:d}),[d]),y=(0,a.WsO)(g);return(0,r.jsx)(a.VqE,{title:"Rename file",trigger:n,open:o,onOpenChange:e=>{e||m.reset(h),s(e)},contentVariants:{className:"w-[400px]"},onSubmit:m.handleSubmit(v,y),children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(a.yEL,{name:"name",form:m,fields:g,autoComplete:"off"}),(0,r.jsx)(a.ZqQ,{form:m,children:"Save"})]})})}var eR=n(77248),eD=n(55791);function eL(){return{name:eF(),secret:ez()}}function eZ(e){let{trigger:t,open:n,onOpenChange:o}=e,{closeDialog:s}=eI(),l=(0,eR.m)(),u=(0,f.KJ)(),c=(0,ek.cI)({mode:"all",defaultValues:eL()}),d=(0,i.useCallback)(async e=>{var t;let n={...null===(t=l.data)||void 0===t?void 0:t.v4Keypairs,[e.name]:e.secret},r=await u.put({params:{key:"s3authentication"},payload:{v4Keypairs:n}});r.error?(0,a.OHV)(r.error):((0,a.OPV)("New key created."),c.reset(eL()),s())},[c,s,u,l.data]),h=(0,i.useMemo)(()=>{var e;return function(e){let{existingKeys:t,regenerateAccessKey:n,regenerateSecretKey:i}=e;return{name:{type:"text",title:"Access key ID",placeholder:"my secure key",actions:(0,r.jsx)(a.zxk,{onClick:n,tip:"Regenerate access key ID",icon:"contrast",variant:"ghost",size:"none",className:"m-1",children:(0,r.jsx)(eD.Wet,{})}),validation:{required:"required",validate:{minLength:e=>(null==e?void 0:e.length)>=16||"must be at least 16 characters",maxLength:e=>(null==e?void 0:e.length)<=128||"must be at most 128 characters",unique:e=>!t.includes(e)||"Name must be unique"}}},secret:{type:"text",title:"Secret access key",placeholder:"",actions:(0,r.jsx)(a.zxk,{onClick:i,tip:"Regenerate secret access key",icon:"contrast",variant:"ghost",size:"none",className:"m-1",children:(0,r.jsx)(eD.Wet,{})}),validation:{required:"required",validate:{exactLength:e=>(null==e?void 0:e.length)===40||"must be exactly 40 characters"}}}}}({regenerateAccessKey:()=>{c.setValue("name",eF())},regenerateSecretKey:()=>{c.setValue("secret",ez())},existingKeys:Object.keys((null===(e=l.data)||void 0===e?void 0:e.v4Keypairs)||{})})},[l.data,c]),p=(0,a.WsO)(h);return(0,r.jsx)(a.VqE,{title:"Create S3 key",trigger:t,open:n,onOpenChange:e=>{e||c.reset(eL()),o(e)},contentVariants:{className:"w-[400px]"},onSubmit:c.handleSubmit(d,p),controls:(0,r.jsx)("div",{className:"flex flex-col gap-1",children:(0,r.jsx)(a.ZqQ,{form:c,children:"Create"})}),children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(a.nvN,{children:"Create a new S3 authentication key."}),(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsx)(a.yEL,{name:"name",form:c,fields:h}),(0,r.jsx)(a.yEL,{name:"secret",form:c,fields:h})]})]})})}function eF(){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",t="";for(let n=0;n<20;n++)t+=e.charAt(Math.floor(Math.random()*e.length));return t}function ez(){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t="";for(let n=0;n<40;n++)t+=e.charAt(Math.floor(Math.random()*e.length));return t}let eV=(0,i.createContext)({}),eI=()=>(0,i.useContext)(eV);function eB(e){let{children:t}=e,n=function(){let[e,t]=(0,i.useState)(),[n,r]=(0,i.useState)(),a=(0,i.useCallback)((e,n)=>{t(e),r(n)},[t,r]),[o,s]=(0,i.useState)(),l=(0,i.useCallback)(e=>{t("confirm"),s(e)},[t,s]),u=(0,i.useCallback)(()=>{t(void 0),r(void 0),s(void 0)},[t,r,s]),c=(0,i.useCallback)(e=>{e||u()},[u]);return{dialog:e,id:n,openDialog:a,confirm:o,openConfirmDialog:l,closeDialog:u,onOpenChange:c}}();return(0,r.jsx)(eV.Provider,{value:n,children:t})}function eH(){var e;let{id:t,dialog:n,openDialog:i,onOpenChange:o,closeDialog:s,confirm:l,openConfirmDialog:u}=eI(),c=(0,f.Wl)(),d=(0,f.X2)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(K,{open:"cmdk"===n,onOpenChange:o,setOpen:()=>i("cmdk")}),(0,r.jsx)(a.DLL,{open:"settings"===n,onOpenChange:o,showGpuSetting:!0}),(0,r.jsx)(eb,{}),(0,r.jsx)(a.YNn,{address:null===(e=d.data)||void 0===e?void 0:e.address,isValidating:d.isValidating,open:"addressDetails"===n,onOpenChange:e=>e?i(n):s()}),(0,r.jsx)(ew,{}),(0,r.jsx)(a.D_D,{open:"connectPeer"===n,connect:e=>c.post({payload:e}),onOpenChange:e=>e?i(n):s()}),(0,r.jsx)(eM,{open:"filesCreateBucket"===n,onOpenChange:e=>e?i(n):s()}),(0,r.jsx)(eS,{open:"filesDeleteBucket"===n,onOpenChange:e=>e?i(n):s()}),(0,r.jsx)(e_,{open:"filesBucketPolicy"===n,onOpenChange:e=>e?i(n):s()}),(0,r.jsx)(J,{open:"filesCreateDirectory"===n,onOpenChange:e=>e?i(n):s()}),(0,r.jsx)(ev,{open:"filesSearch"===n,onOpenChange:e=>e?i(n):s()}),(0,r.jsx)(eN,{id:t,open:"fileRename"===n,onOpenChange:e=>e?i(n):s()}),(0,r.jsx)(eu,{open:"hostsManageAllowBlock"===n,onOpenChange:e=>e?i(n):s()}),(0,r.jsx)(ec.g,{open:"hostsFilterAddress"===n,onOpenChange:e=>e?i(n):s()}),(0,r.jsx)(ej.a,{open:"hostsFilterPublicKey"===n,onOpenChange:e=>e?i(n):s()}),(0,r.jsx)(ed.p,{open:"contractsFilterAddress"===n,onOpenChange:e=>e?i(n):s()}),(0,r.jsx)(eh.X,{open:"contractsFilterContractSet"===n,onOpenChange:e=>e?i(n):s()}),(0,r.jsx)(ef.C,{open:"contractsFilterPublicKey"===n,onOpenChange:e=>e?i(n):s()}),(0,r.jsx)(eZ,{open:"keysCreate"===n,onOpenChange:e=>e?i(n):s()}),(0,r.jsx)(a.QHy,{open:"confirm"===n,params:l,onOpenChange:e=>e?u(l):s()})]})}},72199:function(e,t,n){"use strict";n.d(t,{z:function(){return p}});var r=n(52322),i=n(36655),a=n(61020),o=n(21487),s=n(87023),l=n(84301),u=n(6391),c=n.n(u),d=n(23094),f=n(90721),h=n(41736);let p=[{id:"type",label:"",fixed:!0,cellClassName:"w-[50px] !pl-2 !pr-2 [&+*]:!pl-0",render:function(e){let{data:{isUploading:t,type:n,name:o,path:u,size:c}}=e,{setActiveDirectory:d}=(0,h.b)();return t?(0,r.jsx)(i.zxk,{variant:"ghost",state:"waiting",children:(0,r.jsx)(a.c_L,{})}):".."===o?(0,r.jsx)(i.zxk,{variant:"ghost",icon:"hover",onClick:e=>{e.stopPropagation(),d(e=>e.slice(0,-1))},children:(0,r.jsx)(a.ROc,{size:16})}):"bucket"===n?(0,r.jsx)(f.s,{name:o}):"directory"===n?(0,r.jsx)(l.I,{path:u,size:c}):(0,r.jsx)(s.e,{path:u})}},{id:"name",label:"name",category:"general",contentClassName:"max-w-[600px]",render:function(e){let{data:{name:t,type:n}}=e,{setActiveDirectoryAndFileNamePrefix:a,setActiveDirectory:o}=(0,h.b)();return"bucket"===n?(0,r.jsx)(i.xvT,{ellipsis:!0,color:"accent",weight:"semibold",className:"cursor-pointer",onClick:e=>{e.stopPropagation(),a([t],"")},children:t}):"directory"===n?".."===t?(0,r.jsx)(i.xvT,{ellipsis:!0,color:"accent",weight:"semibold",className:"cursor-pointer",onClick:e=>{e.stopPropagation(),o(e=>e.slice(0,-1))},children:t}):(0,r.jsx)(i.xvT,{ellipsis:!0,color:"accent",weight:"semibold",className:"cursor-pointer",onClick:e=>{e.stopPropagation(),o(e=>e.concat(t.slice(0,-1)))},children:t}):(0,r.jsx)(i.xvT,{ellipsis:!0,weight:"semibold",children:t})}},{id:"readAccess",label:"public read access",contentClassName:"justify-center",render:function(e){var t,n;let{data:o}=e;if(".."===o.name)return null;let s=null===(n=o.bucket)||void 0===n?void 0:null===(t=n.policy)||void 0===t?void 0:t.publicReadAccess;return(0,r.jsx)(i.ua7,{content:s?"The bucket policy allows public read access.":"The bucket policy only allows private read access.",children:(0,r.jsx)("div",{children:(0,r.jsx)(i.zxk,{variant:"ghost",state:"waiting",children:(0,r.jsx)(i.xvT,{color:s?"contrast":"verySubtle",className:"flex gap-0.5 items-center",children:s?(0,r.jsx)(a.nDH,{}):(0,r.jsx)(a.Lur,{})})})})})}},{id:"size",label:"size",contentClassName:"justify-end",render:function(e){let{data:{type:t,name:n,size:a,isUploading:s}}=e;return"bucket"===t?null:s?(0,r.jsx)(i.xgg,{}):".."===n?null:(0,r.jsx)(i.m2c,{size:"12",value:new(c())(a),variant:"value",color:"subtle",weight:"regular",format:e=>(0,o.vW)(e.toNumber())})}},{id:"health",label:"health",contentClassName:"justify-center",render:function(e){let{data:t}=e;return"bucket"===t.type?null:(0,r.jsx)(d.z,{...t})}}]},75618:function(e,t,n){"use strict";n.d(t,{V:function(){return v},J:function(){return m}});var r=n(52322),i=n(36655),a=n(2784),o=n(57016),s=n(37371),l=n(70899),u=n(5632),c=n(41736),d=n(9338),f=n(5184),h=n(72199);let p=(0,a.createContext)({}),m=()=>(0,a.useContext)(p);function v(e){let{children:t}=e,n=function(){let{activeDirectory:e,activeBucketName:t,activeDirectoryPath:n,setActiveDirectory:r,filters:p,enabledColumns:m}=(0,c.b)(),{limit:v,offset:g,response:y,refresh:b,dataset:x}=function(){var e;let{activeBucketName:t,activeDirectoryPath:n,fileNamePrefixFilter:r,sortDirection:i,sortField:f}=(0,c.b)(),h=(0,u.useRouter)(),p=Number(h.query.limit||50),m=Number(h.query.offset||0),v=(0,a.useMemo)(()=>{let e={...(0,l.W0)(n),sortBy:f,sortDir:i,offset:m,limit:p};return r&&(e.prefix=r.startsWith("/")?r.slice(1):r),e},[n,r,f,i,m,p]),g=(0,o.Jv)({disabled:!t,params:v,config:{swr:{refreshInterval:d.h}}}),y=(0,s.p)({objects:{isValidating:g.isValidating,data:null===(e=g.data)||void 0===e?void 0:e.entries}});return{limit:p,offset:m,response:g,dataset:y.data,refresh:g.mutate}}(),{onDragEnd:w,onDragOver:j,onDragCancel:k,onDragMove:E,onDragStart:S,draggingObject:C}=function(e){let{dataset:t,activeDirectory:n,setActiveDirectory:r,refresh:s}=e,[u,c]=(0,a.useState)(null),[,d]=(0,a.useState)(),h=(0,o.GD)(),p=(0,a.useCallback)(async e=>{let{bucket:t,from:r,to:a,mode:o}=(0,f.e)(e,n);if(r===a)return;let l=await h.post({payload:{force:!1,bucket:t,from:r,to:a,mode:o}});s(),l.error&&(0,i.OHV)(l.error)},[s,h,n]),m=(0,a.useCallback)(e=>{if(!e){d(e=>(e&&clearTimeout(e),null));return}let t=setTimeout(()=>{r(()=>e)},500);d(e=>(e&&clearTimeout(e),t))},[d,r]),v=(0,a.useCallback)(e=>{if(e.collisions.length){var t;let r=null===(t=e.collisions)||void 0===t?void 0:t[0].id;".."===r?m(n.slice(0,-1)):m((0,l.gD)(r))}else m(void 0)},[m,n]),g=(0,a.useCallback)(e=>{c(t.find(t=>t.id===e.active.id)||null)},[t,c]),y=(0,a.useCallback)(e=>{v(e)},[v]),b=(0,a.useCallback)(e=>{v(e)},[v]);return{onDragEnd:(0,a.useCallback)(async e=>{m(void 0),c(void 0),p(e)},[c,m,p]),onDragOver:y,onDragCancel:(0,a.useCallback)(async e=>{m(void 0),c(void 0)},[c,m]),onDragMove:b,onDragStart:g,draggingObject:u}}({dataset:x,activeDirectory:e,setActiveDirectory:r,refresh:b}),_=(0,a.useMemo)(()=>x?e.length>0&&x.length>0?[{id:"..",name:"..",path:"..",type:"directory",onClick:()=>{r(e=>e.slice(0,-1))}},...x]:x:null,[x]),O=(0,a.useMemo)(()=>_?_.map(e=>C&&C.id!==e.id&&"directory"===e.type?{...e,isDroppable:!0}:{...e,isDraggable:"bucket"!==e.type&&!e.isUploading}):null,[_,C]);return{activeBucket:t,activeDirectory:e,setActiveDirectory:r,activeDirectoryPath:n,dataState:(0,i.c2j)(x,y.isValidating,y.error,p),columns:(0,a.useMemo)(()=>h.z.filter(e=>e.fixed||m.includes(e.id)),[m]),refresh:b,limit:v,offset:g,datasetPage:O,pageCount:(null==x?void 0:x.length)||0,onDragStart:S,onDragEnd:w,onDragMove:E,onDragCancel:k,onDragOver:j,draggingObject:C}}();return(0,r.jsx)(p.Provider,{value:n,children:t})}},33351:function(e,t,n){"use strict";n.d(t,{z:function(){return m}});var r=n(52322),i=n(36655),a=n(61020),o=n(21487),s=n(87023),l=n(84301),u=n(6391),c=n.n(u),d=n(23094),f=n(90721),h=n(41736),p=n(70899);let m=[{id:"type",label:"",fixed:!0,cellClassName:"w-[50px] !pl-2 !pr-2 [&+*]:!pl-0",render:function(e){let{data:{isUploading:t,type:n,name:o,path:u,size:c}}=e;return t?(0,r.jsx)(i.zxk,{variant:"ghost",state:"waiting",children:(0,r.jsx)(a.c_L,{})}):"bucket"===n?(0,r.jsx)(f.s,{name:o}):"directory"===n?(0,r.jsx)(l.I,{path:u,size:c}):(0,r.jsx)(s.e,{path:u})}},{id:"name",label:"name",category:"general",render:function(e){let{data:{path:t,name:n,type:a}}=e,{setFileNamePrefixFilter:o}=(0,h.b)(),s=(0,p.kj)(t).slice(1);return"bucket"===a?(0,r.jsx)(i.xvT,{ellipsis:!0,color:"accent",weight:"semibold",className:"cursor-pointer",children:n}):"directory"===a?(0,r.jsx)(i.xvT,{ellipsis:!0,color:"accent",weight:"semibold",className:"cursor-pointer",onClick:e=>{e.stopPropagation(),o((0,p.rj)(s))},children:s}):(0,r.jsx)(i.xvT,{ellipsis:!0,weight:"semibold",className:"cursor-pointer",onClick:e=>{e.stopPropagation(),o((0,p.rj)(s))},children:s})}},{id:"readAccess",label:"public read access",contentClassName:"justify-center",render:function(e){var t,n;let{data:o}=e;if(".."===o.name)return null;let s=null===(n=o.bucket)||void 0===n?void 0:null===(t=n.policy)||void 0===t?void 0:t.publicReadAccess;return(0,r.jsx)(i.ua7,{content:s?"The bucket policy allows public read access.":"The bucket policy only allows private read access.",children:(0,r.jsx)("div",{children:(0,r.jsx)(i.zxk,{variant:"ghost",state:"waiting",children:(0,r.jsx)(i.xvT,{color:s?"contrast":"verySubtle",className:"flex gap-0.5 items-center",children:s?(0,r.jsx)(a.nDH,{}):(0,r.jsx)(a.Lur,{})})})})})}},{id:"size",label:"size",contentClassName:"justify-end",render:function(e){let{data:{type:t,name:n,size:a,isUploading:s}}=e;return"bucket"===t?null:s?(0,r.jsx)(i.xgg,{}):".."===n?null:(0,r.jsx)(i.m2c,{size:"12",value:new(c())(a),variant:"value",color:"subtle",weight:"regular",format:e=>(0,o.vW)(e.toNumber())})}},{id:"health",label:"health",contentClassName:"justify-center",render:function(e){let{data:t}=e;return"bucket"===t.type?null:(0,r.jsx)(d.z,{...t})}}]},43385:function(e,t,n){"use strict";n.d(t,{p:function(){return p},o:function(){return h}});var r=n(52322),i=n(36655),a=n(2784),o=n(57016),s=n(37371),l=n(5632),u=n(41736),c=n(9338),d=n(33351);let f=(0,a.createContext)({}),h=()=>(0,a.useContext)(f);function p(e){let{children:t}=e,n=function(){var e,t;let{sortDirection:n,sortField:r,filters:f,enabledColumns:h}=(0,u.b)(),{limit:p,response:m,refresh:v,dataset:g}=function(e){var t;let{sortDirection:n,sortField:r}=e,{activeBucketName:i,fileNamePrefixFilter:d}=(0,u.b)(),f=(0,l.useRouter)(),h=Number(f.query.limit||50),p=f.query.marker,m=(0,a.useMemo)(()=>{let e={bucket:i,sortBy:r,sortDir:n,marker:p,limit:h};return d&&(e.prefix=d.startsWith("/")?d:"/"+d),e},[i,d,r,n,p,h]),v=(0,o.SD)({disabled:!i,payload:m,config:{swr:{refreshInterval:c.h}}}),g=(0,s.p)({objects:{isValidating:v.isValidating,data:null===(t=v.data)||void 0===t?void 0:t.objects}});return{limit:h,marker:p,response:v,dataset:g.data,refresh:v.mutate}}({sortField:r,sortDirection:n}),y=null===(e=m.data)||void 0===e?void 0:e.nextMarker,b=null===(t=m.data)||void 0===t?void 0:t.hasMore,x=(0,a.useMemo)(()=>g,[g]);return{dataState:(0,i.c2j)(g,m.isValidating,m.error,f),refresh:v,limit:p,datasetPage:x,columns:(0,a.useMemo)(()=>d.z.filter(e=>e.fixed||h.includes(e.id)),[h]),nextMarker:y,isMore:b,pageCount:(null==g?void 0:g.length)||0,sortField:r,filters:f,sortDirection:n}}();return(0,r.jsx)(f.Provider,{value:n,children:t})}},37371:function(e,t,n){"use strict";n.d(t,{p:function(){return u}});var r=n(67693),i=n(69046),a=n(79381),o=n(76838),s=n(70899),l=n(41736);function u(e){let{objects:t}=e,{activeBucket:n,activeBucketName:u,fileNamePrefixFilter:c,uploadsList:d,sortDirection:f,sortField:h,activeDirectoryPath:p,buckets:m,setActiveDirectory:v}=(0,l.b)(),{dataset:g}=(0,o.G)();return(0,a.ZP)(t.isValidating||m.isValidating?null:[t.data,d,g,m.data,u,p],()=>{var e,a;let o={};n?t.data&&(null===(a=t.data)||void 0===a||a.forEach(e=>{let{name:t,size:r,health:i}=e,a=(0,s.v_)(u,t),l=(0,s.vt)(t);o[a]={id:a,path:a,bucket:n,size:r,health:i,name:l,onClick:(0,s.IQ)(t)?()=>{v(e=>e.concat(l.slice(0,-1)))}:void 0,type:(0,s.IQ)(t)?"directory":"file"}}),d.filter(e=>{let{path:t,name:n}=e;return t===(0,s.v_)(p,n)}).filter(e=>{let{path:t}=e;return t.startsWith((0,s.v_)(u,c))}).forEach(e=>{o[e.path]=e})):null===(e=m.data)||void 0===e||e.forEach(e=>{let t=e.name,n=(0,s.YF)(t,"");o[t]={id:n,path:n,bucket:e,size:0,health:0,name:t,onClick:()=>{v(e=>e.concat(t))},type:"bucket"}});let l=(0,r.Z)((0,i.Z)(o).map(e=>e[1]),h);return"desc"===f&&l.reverse(),l},{keepPreviousData:!0})}},41736:function(e,t,n){"use strict";n.d(t,{e:function(){return ec},b:function(){return eu}});var r=n(52322),i=n(36655),a=n(99605),o=n(2784),s=n(72199),l=n(3077),u=n(70899),c=n(57016),d=n(88744);function f(e,t,n){if(!t.has(e))throw TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function h(e,t){var n=f(e,t,"get");return n.get?n.get.call(e):n.value}function p(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function m(e,t,n){p(e,t),t.set(e,n)}function v(e,t,n){var r=f(e,t,"set");return!function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw TypeError("attempted to set read only private field");t.value=n}}(e,r,n),n}function g(e,t,n){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return n}function y(e,t){p(e,t),t.add(e)}var b=n(10363),x=new WeakMap,w=new WeakMap,j=new WeakMap,k=new WeakMap,E=new WeakMap,S=new WeakMap,C=new WeakMap,_=new WeakMap,O=new WeakMap,M=new WeakMap,T=new WeakMap,A=new WeakMap,P=new WeakMap,N=new WeakMap,R=new WeakMap,D=new WeakMap,L=new WeakMap,Z=new WeakMap,F=new WeakMap,z=new WeakMap,V=new WeakMap,I=new WeakMap,B=new WeakSet,H=new WeakSet,U=new WeakSet,W=new WeakSet,q=new WeakSet,$=new WeakSet;class K{async create(){var e;let t={bucket:h(this,x),generateKey:!0,path:h(this,w)};return v(this,Z,null===(e=(await h(this,_).post({payload:t})).data)||void 0===e?void 0:e.uploadID),v(this,D,Array.from({length:Math.ceil(h(this,j).size/h(this,k))},(e,t)=>t+1)),h(this,Z)}async start(){let e=new Promise(e=>{v(this,P,e)});g(this,B,Y).call(this),await e}async abort(){v(this,F,!0),Object.keys(h(this,R)).map(Number).forEach(e=>{h(this,R)[e].abort()});try{await h(this,O).post({payload:{bucket:h(this,x),path:h(this,w),uploadID:h(this,Z)}})}catch(e){(0,i.OHV)(e.message)}h(this,P).call(this)}setOnProgress(e){v(this,M,e)}setOnError(e){v(this,T,e)}setOnComplete(e){v(this,A,e)}constructor(e){y(this,B),y(this,H),y(this,U),y(this,W),y(this,q),y(this,$),m(this,x,{writable:!0,value:void 0}),m(this,w,{writable:!0,value:void 0}),m(this,j,{writable:!0,value:void 0}),m(this,k,{writable:!0,value:void 0}),m(this,E,{writable:!0,value:void 0}),m(this,S,{writable:!0,value:void 0}),m(this,C,{writable:!0,value:void 0}),m(this,_,{writable:!0,value:void 0}),m(this,O,{writable:!0,value:void 0}),m(this,M,{writable:!0,value:void 0}),m(this,T,{writable:!0,value:void 0}),m(this,A,{writable:!0,value:void 0}),m(this,P,{writable:!0,value:void 0}),m(this,N,{writable:!0,value:void 0}),m(this,R,{writable:!0,value:void 0}),m(this,D,{writable:!0,value:void 0}),m(this,L,{writable:!0,value:void 0}),m(this,Z,{writable:!0,value:void 0}),m(this,F,{writable:!0,value:void 0}),m(this,z,{writable:!0,value:void 0}),m(this,V,{writable:!0,value:void 0}),m(this,I,{writable:!0,value:void 0}),v(this,z,500),v(this,V,6e4),v(this,I,h(this,z)),v(this,x,e.bucket),v(this,w,e.path),v(this,k,e.partSize||5242880),v(this,E,Math.min(e.maxConcurrentParts||5,15)),v(this,j,e.file),v(this,S,e.apiWorkerUploadPart),v(this,O,e.apiBusUploadAbort),v(this,C,e.apiBusUploadComplete),v(this,_,e.apiBusUploadCreate),v(this,M,e.onProgress||(()=>null)),v(this,T,e.onError||(()=>null)),v(this,A,e.onComplete||(()=>null)),v(this,N,{}),v(this,R,{}),v(this,D,[]),v(this,L,[]),v(this,Z,null),v(this,F,!1)}}async function Y(){if(h(this,F))return;let e=Object.keys(h(this,R)).length;if(e>=h(this,E))return;if(!h(this,D).length){e||g(this,W,Q).call(this);return}let t=h(this,D).pop(),n=(t-1)*h(this,k),r=h(this,j).slice(n,n+h(this,k));try{await g(this,$,ee).call(this,t,r,n,()=>{g(this,B,Y).call(this)}),g(this,H,X).call(this)}catch(e){if(e instanceof et)return;if(e instanceof en){await this.abort(),h(this,T).call(this,e);return}h(this,D).push(t),await g(this,U,G).call(this)}g(this,B,Y).call(this)}function X(){v(this,I,h(this,z))}async function G(){let e=(0,b.gw)(h(this,I));v(this,I,Math.min(2*h(this,I),h(this,V))),await e}async function Q(){try{let e={bucket:h(this,x),path:h(this,w),uploadID:h(this,Z),parts:h(this,L).sort((e,t)=>e.partNumber-t.partNumber)};await h(this,C).post({payload:e}),h(this,A).call(this)}catch(e){h(this,T).call(this,e)}h(this,P).call(this)}function J(e,t){h(this,N)[e]=t.loaded;let n=Math.min(Object.keys(h(this,N)).map(Number).reduce((e,t)=>e+=h(this,N)[t],0),h(this,j).size),r=h(this,j).size;h(this,M).call(this,{sent:n,total:r,percentage:Math.round(n/r*100)})}async function ee(e,t,n,r){let i=new AbortController;h(this,R)[e]=i,r();try{let r=await h(this,S).put({params:{key:h(this,w).slice(1),bucket:h(this,x),uploadid:h(this,Z),offset:n,partnumber:e},payload:t,config:{axios:{onUploadProgress:t=>g(this,q,J).call(this,e,t),signal:i.signal}}});if(r.error){if("canceled"===r.error)throw new et;throw Error(r.error)}let a=r.headers.etag;if(!a)throw new en;let o={partNumber:e,eTag:a.replace(/"/g,"")};h(this,L).push(o)}finally{delete h(this,R)[e]}}class et extends Error{constructor(){super("canceled"),this.name="CanceledError"}}class en extends Error{constructor(){super("No ETag in response, add ETag to Access-Control-Expose-Headers list"),this.name="NoETagError"}}var er=n(21487),ei=n(91157);let ea=e=>(0,er.B$)(4).times(e);var eo=n(98334),es=n(92762);let el=(0,o.createContext)({}),eu=()=>(0,o.useContext)(el);function ec(e){let{children:t}=e,n=function(){var e;let{configurableColumns:t,enabledColumns:n,sortableColumns:r,toggleColumnVisibility:f,setColumnsVisible:h,setColumnsHidden:p,toggleSort:m,setSortDirection:v,setSortField:g,sortField:y,sortDirection:x,resetDefaultColumnVisibility:w}=(0,i.oy6)("renterd/v0/objects",{columns:s.z,columnsDefaultVisible:l.gd,sortOptions:l.Fo,defaultSortField:l.nw}),j=(0,a.xj)(),k=(0,a.UO)(),E=null==k?void 0:k.bucket,{filters:S,setFilter:C,removeFilter:_,removeLastFilter:O,resetFilters:M}=(0,i.Uu5)(),T=(0,o.useMemo)(()=>{var e;return(null===(e=S.find(e=>"fileNamePrefix"===e.id))||void 0===e?void 0:e.value)||""},[S]),A=(0,o.useMemo)(()=>E?[E,...((null==k?void 0:k.path)||[]).map(decodeURIComponent)]:[],[E,null==k?void 0:k.path]),P=(0,c.B$)(),N=null===(e=P.data)||void 0===e?void 0:e.find(e=>e.name===E),R=(0,o.useMemo)(()=>(0,u.rd)(A)+"/",[A]),[D,L]=(0,es.Z)("renterd/v0/explorerMode",{defaultValue:"directory"}),Z=(0,o.useCallback)(e=>{let t=e(A);if(0===t.length){j.push(eo._.buckets.index);return}let n=eo._.buckets.files.replace("[bucket]",t[0]).replace("[path]",t.slice(1).map(encodeURIComponent).join("/"));j.push(n)},[j,A]),{uploadFiles:F,uploadsMap:z,uploadsList:V}=function(e){let{activeDirectoryPath:t}=e,n=(0,c.B$)(),r=(0,b.Tu)(),a=(0,c.Pt)(),s=(0,c._3)(),l=(0,c.eM)(),f=(0,c.LS)(),[h,p]=(0,o.useState)({}),m=(0,ei.w)({config:{swr:{refreshInterval:(0,i.sWj)(1)}}}),v=(0,o.useRef)({checkAndStartUploads:()=>null}),g=(0,o.useCallback)(e=>{let{id:t}=e;p(e=>({...e,[t]:{...e[t],uploadStatus:"uploading",loaded:0}}))},[p]),y=(0,o.useCallback)(e=>{p(t=>t[e.id]?{...t,[e.id]:{...t[e.id],loaded:e.loaded,uploadStatus:e.loaded===e.size?"processing":"uploading",size:e.size}}:t)},[p]),x=(0,o.useCallback)(e=>{p(t=>(delete t[e],{...t}))},[p]),w=(0,o.useCallback)(async e=>{var t;let{path:n,bucket:o,uploadFile:c}=e,h=new K({file:c,path:(0,u.kj)(n),bucket:o.name,apiWorkerUploadPart:a,apiBusUploadComplete:s,apiBusUploadCreate:l,apiBusUploadAbort:f,partSize:ea((null===(t=m.data)||void 0===t?void 0:t.minShards)||1).toNumber(),maxConcurrentParts:5}),p=await h.create();return h.setOnError(e=>{(0,i.OHV)(e.message),x(p)}),h.setOnProgress((0,d.Z)(e=>{y({id:p,loaded:e.sent,size:e.total})},1e3)),h.setOnComplete(async()=>{await r(e=>e.startsWith("/bus/objects")),x(p),setTimeout(()=>{v.current.checkAndStartUploads()},100)}),{uploadId:p,multipartUpload:h}},[f,s,l,a,r,y,x,m.data]),j=(0,o.useCallback)(async e=>{let{path:t,bucket:n,name:r,uploadFile:i}=e,{uploadId:a,multipartUpload:o}=await w({path:t,bucket:n,uploadFile:i});p(e=>({...e,[a]:{id:a,path:t,bucket:n,name:r,size:i.size,loaded:0,isUploading:!0,upload:o,uploadStatus:"queued",uploadFile:i,createdAt:new Date().toISOString(),uploadAbort:async()=>{await o.abort(),x(a)},type:"file"}}))},[p,w,x]),k=(0,o.useCallback)(async e=>{let{id:t,upload:n}=e;g({id:t}),n.start()},[g]),E=(0,o.useCallback)(()=>{let e=Object.values(h),t=e.filter(e=>"uploading"===e.uploadStatus).length;return e.filter(e=>"queued"===e.uploadStatus).slice(0,5-t).forEach(e=>{k({id:e.id,upload:e.upload})}),h},[h,k]),S=(0,o.useCallback)(e=>{e.forEach(e=>{var r,a,o;let s=e.path||e.name,l=(0,u.v_)(t,s),c=e.name,d=(0,u.ru)(l),f=null===(r=n.data)||void 0===r?void 0:r.find(e=>e.name===d);h[l]&&((0,i.OHV)("Already uploading file: ".concat(l,", aborting previous upload.")),null===(a=(o=h[l]).uploadAbort)||void 0===a||a.call(o)),j({path:l,name:c,bucket:f,uploadFile:e})}),setTimeout(()=>{v.current.checkAndStartUploads()},1e3)},[t,j,n.data,h]);v.current={checkAndStartUploads:E};let C=(0,o.useMemo)(()=>Object.entries(h).map(e=>e[1]),[h]);return!function(e){let{uploadsMap:t}=e;(0,o.useEffect)(()=>{let e=Object.values(t).filter(e=>"uploading"===e.uploadStatus),n=t=>{if(e.length>0){let n="Warning, closing the tab will abort all ".concat(e.length," active uploads.");return t.returnValue=n,n}};return e.length>0&&window.addEventListener("beforeunload",n),()=>{window.removeEventListener("beforeunload",n)}},[t])}({uploadsMap:h}),{uploadFiles:S,uploadsMap:h,uploadsList:C}}({activeDirectoryPath:R}),{downloadFiles:I,downloadsList:B,getFileUrl:H,downloadCancel:U}=function(){let e=(0,c.B$)(),t=(0,c.p$)(),[n,r]=(0,o.useState)({}),a=(0,o.useCallback)(e=>{r(t=>({...t,[e.path]:{id:e.path,path:e.path,bucket:e.bucket,name:e.name,size:e.size,loaded:e.loaded,isUploading:!1,controller:e.controller,type:"file"}}))},[r]),s=(0,o.useCallback)(e=>{r(t=>t[e.path]?{...t,[e.path]:{...t[e.path],path:e.path,loaded:e.loaded,size:e.size}}:t)},[r]),l=(0,o.useCallback)(e=>{r(t=>(delete t[e],{...t}))},[r]),f=(0,o.useCallback)(e=>{e.controller.abort()},[]),h=async r=>{r.forEach(async r=>{var o;let c=!1,f=(0,u.ru)(r),h=null===(o=e.data)||void 0===o?void 0:o.find(e=>e.name===f),p=(0,u.vt)(r);if(n[r]){(0,i.OHV)("Already downloading file: ".concat(r));return}let m=new AbortController,v=(0,d.Z)(e=>{c||s({path:r,loaded:e.loaded,size:e.total})},2e3);a({path:r,name:p,bucket:h,loaded:0,size:1,controller:m});let g=await t.get(p,{params:(0,u.W0)(r),config:{axios:{onDownloadProgress:v,signal:m.signal}}});c=!0,g.error&&("canceled"===g.error?(0,i.RFt)("File download canceled."):(0,i.OHV)(g.error)),l(r)})},p=(0,o.useMemo)(()=>Object.entries(n).map(e=>e[1]),[n]),{settings:m}=(0,b.Hv)();return{downloadFiles:h,downloadsList:p,getFileUrl:(0,o.useCallback)((e,t)=>{let{bucket:n,key:r}=(0,u.W0)(e),i="/worker/objects/".concat(r,"?bucket=").concat(n),a=m.api||location.origin,o=a.startsWith("https")?"https":"http",s=a.replace("https://","").replace("http://","");return t?"".concat(o,"://:").concat(m.password,"@").concat(s,"/api").concat(i):"".concat(o,"://").concat(s,"/api").concat(i)},[m]),downloadCancel:f}}(),W=0===A.length,q=1===A.length,$=A.length>0,Y=(0,o.useCallback)(e=>{C({id:"fileNamePrefix",label:"",value:e})},[C]),X=(0,o.useCallback)(()=>{_("fileNamePrefix")},[_]),G=(0,o.useCallback)((e,t)=>{t?Y(t):X(),Z(()=>e)},[Z,Y,X]),Q=(0,o.useCallback)(e=>{G((0,u.gD)(e),(0,u.vt)(e))},[G]),J=(0,o.useCallback)(e=>{"directory"===D?Q(e):Y((0,u.kj)(e).slice(1))},[D,Q,Y]),ee=eo._.buckets.uploads.replace("[bucket]",E),et=(0,o.useCallback)(()=>{N&&j.push(ee)},[N,ee,j]),en=(0,a.jD)(),er=E&&en.startsWith(ee),el=(0,o.useCallback)(async()=>{(er||"directory"!==D)&&(G([E],void 0),L("directory"))},[er,D,E,L,G]),eu=(0,o.useCallback)(async()=>{(er||"flat"!==D)&&(G([E],(0,u.kj)(R).slice(1)),L("flat"))},[er,D,E,R,L,G]);return{isViewingBuckets:W,isViewingABucket:$,isViewingRootOfABucket:q,isViewingUploads:er,buckets:P,activeBucket:N,activeBucketName:E,activeDirectory:A,navigateToUploads:et,setActiveDirectory:Z,setActiveDirectoryAndFileNamePrefix:G,activeDirectoryPath:R,navigateToModeSpecificFiltering:J,uploadFiles:F,uploadsMap:z,uploadsList:V,downloadFiles:I,downloadsList:B,downloadCancel:U,configurableColumns:t,enabledColumns:n,sortableColumns:r,toggleColumnVisibility:f,setColumnsVisible:h,setColumnsHidden:p,toggleSort:m,setSortDirection:v,setSortField:g,sortField:y,filters:S,fileNamePrefixFilter:T,setFileNamePrefixFilter:Y,setFilter:C,removeFilter:_,removeLastFilter:O,resetFilters:M,sortDirection:x,resetDefaultColumnVisibility:w,getFileUrl:H,activeExplorerMode:D,setExplorerModeDirectory:el,setExplorerModeFlat:eu}}();return(0,r.jsx)(el.Provider,{value:n,children:t})}},3077:function(e,t,n){"use strict";n.d(t,{Fo:function(){return a},gd:function(){return r},nw:function(){return i}});let r=["type","name","readAccess","size","health"],i="name",a=[{id:"name",label:"name",category:"general"},{id:"health",label:"health",category:"general"},{id:"size",label:"size",category:"general"}]},56328:function(e,t,n){"use strict";n.d(t,{x:function(){return L},l:function(){return D}});var r,i,a=n(52322),o=n(36655),s=n(57016),l=n(2784);let u=["allow","netAddress","publicKey","lastScan","lastAnnouncement","totalScans","uptime","hasContract","ap_usable","ap_scoreOverall"];var c=n(5632),d=n(61020),f=n(21487),h=n(29193),p=n(62650),m=n(32998),v=n(17448),g=n(10363),y=n(6391),b=n.n(y);let x=[{id:"actions",label:"",fixed:!0,category:"general",cellClassName:"w-[50px] !pl-2 !pr-4 [&+*]:!pl-0",render:e=>{let{data:t}=e;return(0,a.jsx)(v.G,{address:t.netAddress,publicKey:t.publicKey})}},{id:"allow",label:"allowed",category:"general",contentClassName:"justify-center",render:function(e){var t;let{data:n}=e,r=!!(null===(t=(0,s.s2)({config:{swr:{dedupingInterval:5e3}}}).data)||void 0===t?void 0:t.length);return(0,a.jsx)(o.ua7,{side:"right",content:(r?"Allowlist ".concat(n.isOnAllowlist?"allows this host.":"does not allow this host."):"Allowlist is inactive.")+" Blocklist ".concat(n.isOnBlocklist?"blocks this host.":"does not block this host."),children:(0,a.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,a.jsx)("div",{className:"mt-[5px]",children:(0,a.jsx)(o.xvT,{color:n.isBlocked?"red":"green",children:n.isBlocked?(0,a.jsx)(d.SmH,{}):(0,a.jsx)(d.DI$,{})})}),(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)(o.xvT,{size:"10",color:n.isOnBlocklist?"red":"verySubtle",noWrap:!0,children:"Blocklist"}),(0,a.jsx)(o.xvT,{size:"10",color:r?n.isOnAllowlist?"green":"red":"verySubtle",noWrap:!0,children:"Allowlist"})]})]})})}},{id:"ap_usable",label:"usable",category:"autopilot",render:e=>{let{data:t,context:n}=e;return n.isAutopilotConfigured?(0,a.jsx)(o.ua7,{side:"right",content:t.usable?"Host is usable":"Host is not usable",children:(0,a.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,a.jsx)("div",{className:"mt-[5px]",children:(0,a.jsx)(o.xvT,{color:t.usable?"green":"red",children:t.usable?(0,a.jsx)(d.DI$,{}):(0,a.jsx)(d.SmH,{})})}),(0,a.jsx)("div",{className:"flex flex-col",children:t.unusableReasons.map(e=>(0,a.jsx)(o.xvT,{size:"10",noWrap:!0,children:e},e))})]})}):(0,a.jsx)(o.ua7,{side:"right",content:"Autopilot is not configured",children:(0,a.jsx)("div",{className:"mt-[5px]",children:(0,a.jsx)(o.xvT,{color:"subtle",children:(0,a.jsx)(d.I98,{})})})})}},{id:"ap_gouging",label:"gouging",category:"autopilot",render:e=>{let{data:t,context:n}=e;return n.isAutopilotConfigured?(0,a.jsx)(o.ua7,{side:"right",content:t.gouging?"Host is price gouging":"Host is not price gouging",children:(0,a.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,a.jsx)("div",{className:"mt-[5px]",children:(0,a.jsx)(o.xvT,{color:t.gouging?"red":"subtle",children:t.gouging?(0,a.jsx)(d.SmH,{}):(0,a.jsx)(d.I98,{})})}),(0,a.jsx)("div",{className:"flex flex-col",children:Object.entries(t.gougingBreakdown).filter(e=>{let[t,n]=e;return n&&"string"==typeof n}).map(e=>{let[t,n]=e;return(0,a.jsx)(o.xvT,{size:"10",noWrap:!0,children:n},t)})})]})}):(0,a.jsx)(o.ua7,{side:"right",content:"Autopilot is not configured",children:(0,a.jsx)("div",{className:"mt-[5px]",children:(0,a.jsx)(o.xvT,{color:"subtle",children:(0,a.jsx)(d.I98,{})})})})}},{id:"lastScan",label:"last scan",category:"general",render:function(e){let{data:t}=e,{workflows:n}=(0,g.D)();if(n.find(e=>{var n;return e.path.startsWith(s.RF)&&(null===(n=e.payload)||void 0===n?void 0:n.hostKey)===t.publicKey}))return(0,a.jsx)(o.xgg,{});let r=(0,h.Z)(new Date(t.lastScan||0),new Date,{addSuffix:!0}),i="",l=null,u="subtle";return t.lastScan||(i="host has not been scanned",l=(0,a.jsx)(d.I98,{}),u="subtle"),t.lastScan&&!t.lastScanSuccess&&(i="host scan failed ".concat(r),l=(0,a.jsx)(d.SmH,{}),u="red"),t.lastScan&&t.lastScanSuccess&&(i="host scan succeeded ".concat(r),l=(0,a.jsx)(d.DI$,{}),u="green"),(0,a.jsx)(o.ua7,{side:"right",content:i,children:(0,a.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,a.jsx)("div",{className:"mt-[5px]",children:(0,a.jsx)(o.xvT,{color:u,children:l})}),t.lastScan&&(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)(o.xvT,{size:"12",noWrap:!0,children:r}),(0,a.jsx)(o.xvT,{color:"subtle",size:"10",noWrap:!0,children:(0,p.Z)(new Date(t.lastScan),"Pp")})]})]})})}},{id:"hasContract",label:"active contract",category:"general",contentClassName:"w-[50px]",render:e=>{let{data:t}=e,n=t.activeContractsCount.gt(0);return(0,a.jsx)(o.ua7,{side:"right",content:n?"Host has active contract":"Host does not have an active contract",children:(0,a.jsx)("div",{className:"mt-[5px]",children:(0,a.jsx)(o.xvT,{color:n?"green":"subtle",children:n?(0,a.jsx)(d.DI$,{}):(0,a.jsx)(d.I98,{})})})})}},{id:"netAddress",label:"address",category:"general",render:e=>{let{data:t,context:n}=e;return(0,a.jsx)(o.XxW,{value:t.netAddress,size:"12",type:"hostIp",siascanUrl:n.siascanUrl})}},{id:"publicKey",label:"public key",category:"general",render:e=>{let{data:t,context:n}=e;return(0,a.jsx)(o.XxW,{value:t.publicKey,size:"12",type:"hostPublicKey",siascanUrl:n.siascanUrl})}},{id:"lastAnnouncement",label:"last announcement",category:"general",render:e=>{let{data:t}=e;return t.lastAnnouncement?(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsxs)(o.xvT,{size:"12",noWrap:!0,children:[(0,h.Z)(new Date,new Date(t.lastAnnouncement))," ago"]}),(0,a.jsx)(o.xvT,{color:"subtle",size:"10",noWrap:!0,children:(0,m.Z)(new Date(t.lastAnnouncement),new Date)})]}):null}},{id:"totalScans",label:"total scans",category:"general",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t}=e;return(0,a.jsx)(o.m2c,{size:"12",value:t.totalScans,variant:"value",format:e=>(0,f.yF)(e.toNumber())})}},{id:"uptime",label:"uptime",category:"general",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t}=e;return(0,a.jsx)(o.m2c,{size:"12",value:t.uptime.div(1e9).div(60).div(60).div(24),variant:"value",format:e=>(0,f.yF)(e,{fixed:e.isZero()?0:2,units:"days"})})}},{id:"downtime",label:"downtime",category:"general",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t}=e;return(0,a.jsx)(o.m2c,{size:"12",value:t.downtime.div(1e9).div(60).div(60).div(24),variant:"value",format:e=>(0,f.yF)(e,{fixed:e.isZero()?0:2,units:"days"})})}},{id:"totalInteractions",label:"total interactions",category:"general",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t}=e;return(0,a.jsx)(o.m2c,{size:"12",value:t.totalInteractions,variant:"value",format:e=>(0,f.yF)(e)})}},{id:"successfulInteractions",label:"successful interactions",category:"general",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t}=e;return(0,a.jsx)(o.m2c,{size:"12",value:t.successfulInteractions,variant:"value",format:e=>(0,f.yF)(e.toNumber())})}},{id:"failedInteractions",label:"failed interactions",category:"general",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t}=e;return(0,a.jsx)(o.m2c,{size:"12",value:t.failedInteractions,variant:"value",format:e=>(0,f.yF)(e.toNumber())})}},{id:"contractCount",label:"contract count",category:"general",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t}=e;return(0,a.jsx)(o.m2c,{size:"12",value:t.activeContractsCount,variant:"value",format:e=>(0,f.yF)(e.toNumber())})}},{id:"ap_scoreOverall",label:"overall score",category:"autopilot",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t,context:n}=e;return n.isAutopilotConfigured?(0,a.jsx)(o.m2c,{size:"12",value:t.score,variant:"value",format:e=>e.toPrecision(2)}):(0,a.jsx)(o.ua7,{content:"Autopilot is not configured",children:(0,a.jsx)(o.xvT,{color:"verySubtle",children:"-"})})}},{id:"ap_scoreAge",label:"age score",category:"autopilot",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t,context:n}=e;return n.isAutopilotConfigured?(0,a.jsx)(o.m2c,{size:"12",value:t.scoreBreakdown.age,variant:"value",format:e=>e.toPrecision(2)}):(0,a.jsx)(o.ua7,{content:"Autopilot is not configured",children:(0,a.jsx)(o.xvT,{color:"verySubtle",children:"-"})})}},{id:"ap_scoreCollateral",label:"collateral score",category:"autopilot",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t,context:n}=e;return n.isAutopilotConfigured?(0,a.jsx)(o.m2c,{size:"12",value:t.scoreBreakdown.collateral,variant:"value",format:e=>e.toPrecision(2)}):(0,a.jsx)(o.ua7,{content:"Autopilot is not configured",children:(0,a.jsx)(o.xvT,{color:"verySubtle",children:"-"})})}},{id:"ap_scoreInteractions",label:"interactions score",category:"autopilot",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t,context:n}=e;return n.isAutopilotConfigured?(0,a.jsx)(o.m2c,{size:"12",value:t.scoreBreakdown.interactions,variant:"value",format:e=>e.toPrecision(2)}):(0,a.jsx)(o.ua7,{content:"Autopilot is not configured",children:(0,a.jsx)(o.xvT,{color:"verySubtle",children:"-"})})}},{id:"ap_scorePrices",label:"prices score",category:"autopilot",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t,context:n}=e;return n.isAutopilotConfigured?(0,a.jsx)(o.m2c,{size:"12",value:t.scoreBreakdown.prices,variant:"value",format:e=>e.toPrecision(2)}):(0,a.jsx)(o.ua7,{content:"Autopilot is not configured",children:(0,a.jsx)(o.xvT,{color:"verySubtle",children:"-"})})}},{id:"ap_scoreStorageRemaining",label:"storage remaining score",category:"autopilot",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t,context:n}=e;return n.isAutopilotConfigured?(0,a.jsx)(o.m2c,{size:"12",value:t.scoreBreakdown.storageRemaining,variant:"value",format:e=>e.toPrecision(2)}):(0,a.jsx)(o.ua7,{content:"Autopilot is not configured",children:(0,a.jsx)(o.xvT,{color:"verySubtle",children:"-"})})}},{id:"ap_scoreUptime",label:"uptime score",category:"autopilot",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t,context:n}=e;return n.isAutopilotConfigured?(0,a.jsx)(o.m2c,{size:"12",value:t.scoreBreakdown.uptime,variant:"value",format:e=>e.toPrecision(2)}):(0,a.jsx)(o.ua7,{content:"Autopilot is not configured",children:(0,a.jsx)(o.xvT,{color:"verySubtle",children:"-"})})}},{id:"ap_scoreVersion",label:"version score",category:"autopilot",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t,context:n}=e;return n.isAutopilotConfigured?(0,a.jsx)(o.m2c,{size:"12",value:t.scoreBreakdown.version,variant:"value",format:e=>n.isAutopilotConfigured?"-":e.toPrecision(2)}):(0,a.jsx)(o.ua7,{content:"Autopilot is not configured",children:(0,a.jsx)(o.xvT,{color:"verySubtle",children:"-"})})}},{id:"hpt_accountbalancecost",label:"account balance cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","accountbalancecost")},{id:"hpt_collateralcost",label:"collateral cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","collateralcost")},{id:"hpt_contractprice",label:"contract price",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","contractprice")},{id:"hpt_downloadbandwidthcost",label:"download bandwidth cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","downloadbandwidthcost")},{id:"hpt_dropsectorsbasecost",label:"drop sectors base cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","dropsectorsbasecost")},{id:"hpt_dropsectorsunitcost",label:"drop sectors unit cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","dropsectorsunitcost")},{id:"hpt_expiry",label:"expiry",category:"priceTable",contentClassName:"w-[120px] justify-end",render:j("priceTable","dropsectorsunitcost")},{id:"hpt_fundaccountcost",label:"fund account cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","fundaccountcost")},{id:"hpt_hassectorbasecost",label:"has sector cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","hassectorbasecost")},{id:"hpt_hostblockheight",label:"host block height",category:"priceTable",contentClassName:"w-[120px] justify-end",render:j("priceTable","hostblockheight")},{id:"hpt_initbasecost",label:"init base cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","initbasecost")},{id:"hpt_latestrevisioncost",label:"latest revision cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","latestrevisioncost")},{id:"hpt_maxcollateral",label:"max collateral",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","maxcollateral")},{id:"hpt_maxduration",label:"max duration",category:"priceTable",contentClassName:"w-[120px] justify-end",render:j("priceTable","maxduration")},{id:"hpt_memorytimecost",label:"memory time cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","memorytimecost")},{id:"hpt_readbasecost",label:"read base cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","readbasecost")},{id:"hpt_readlengthcost",label:"read length cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","readlengthcost")},{id:"hpt_registryentriesleft",label:"registry entries left",category:"priceTable",contentClassName:"w-[120px] justify-end",render:j("priceTable","registryentriesleft")},{id:"hpt_registryentriestotal",label:"registry entries total",category:"priceTable",contentClassName:"w-[120px] justify-end",render:j("priceTable","registryentriestotal")},{id:"hpt_renewcontractcost",label:"renew contract cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","renewcontractcost")},{id:"hpt_revisionbasecost",label:"revision base cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","renewcontractcost")},{id:"hpt_subscriptionmemorycost",label:"subscription memory cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","subscriptionmemorycost")},{id:"hpt_subscriptionnotificationcost",label:"subscription notification cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","subscriptionnotificationcost")},{id:"hpt_swapsectorcost",label:"swap sector cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","swapsectorcost")},{id:"hpt_txnfeemaxrecommended",label:"txn fee max recommended",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","txnfeemaxrecommended")},{id:"hpt_txnfeeminrecommended",label:"txn fee min recommended",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","txnfeeminrecommended")},{id:"hpt_uid",label:"UID",category:"priceTable",contentClassName:"w-[120px] justify-end",render:k("priceTable","uid")},{id:"hpt_updatepricetablecost",label:"update price table cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","updatepricetablecost")},{id:"hpt_uploadbandwidthcost",label:"upload bandwidth cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","uploadbandwidthcost")},{id:"hpt_validity",label:"validity",category:"priceTable",contentClassName:"w-[120px] justify-end",render:j("priceTable","validity")},{id:"hpt_windowsize",label:"window size",category:"priceTable",contentClassName:"w-[120px] justify-end",render:j("priceTable","windowsize")},{id:"hpt_writebasecost",label:"write base cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","writebasecost")},{id:"hpt_writelengthcost",label:"write length cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","writelengthcost")},{id:"hpt_writestorecost",label:"write store cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:w("priceTable","writestorecost")},{id:"hs_acceptingcontracts",label:"accepting contracts",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:(r="settings",i="acceptingcontracts",function(e){let{data:t}=e;return t[r]?(0,a.jsx)("div",{className:"mt-[5px]",children:(0,a.jsx)(o.xvT,{color:t[r][i]?"green":"red",children:t[r][i]?(0,a.jsx)(d.DI$,{}):(0,a.jsx)(d.SmH,{})})}):null})},{id:"hs_baserpcprice",label:"base RPC price",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:w("settings","baserpcprice")},{id:"hs_collateral",label:"collateral",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:w("settings","collateral")},{id:"hs_contractprice",label:"contract price",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:w("settings","contractprice")},{id:"hs_downloadbandwidthprice",label:"download bandwidth price",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:w("settings","downloadbandwidthprice")},{id:"hs_ephemeralaccountexpiry",label:"ephemeral account expiry",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:j("settings","ephemeralaccountexpiry")},{id:"hs_maxcollateral",label:"max collateral",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:w("settings","maxcollateral")},{id:"hs_maxdownloadbatchsize",label:"max download batch size",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:E("settings","maxdownloadbatchsize")},{id:"hs_maxduration",label:"max duration",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:j("settings","maxduration")},{id:"hs_maxephemeralaccountbalance",label:"max ephemeral account balance",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:w("settings","maxephemeralaccountbalance")},{id:"hs_maxrevisebatchsize",label:"max revise batch size",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:E("settings","maxrevisebatchsize")},{id:"hs_netaddress",label:"net address",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:k("settings","netaddress")},{id:"hs_remainingstorage",label:"remaining storage",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:E("settings","remainingstorage")},{id:"hs_revisionnumber",label:"revision number",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:j("settings","revisionnumber")},{id:"hs_sectoraccessprice",label:"sector access price",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:w("settings","sectoraccessprice")},{id:"hs_sectorsize",label:"sector size",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:E("settings","sectorsize")},{id:"hs_siamuxport",label:"siamux port",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:j("settings","siamuxport")},{id:"hs_storageprice",label:"storage price",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:w("settings","storageprice")},{id:"hs_totalstorage",label:"total storage",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:E("settings","totalstorage")},{id:"hs_unlockhash",label:"unlock hash",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:k("settings","unlockhash")},{id:"hs_uploadbandwidthprice",label:"upload bandwidth price",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:w("settings","uploadbandwidthprice")},{id:"hs_version",label:"verison",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:k("settings","version")},{id:"hs_windowsize",label:"window size",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:j("settings","windowsize")}].map(e=>({...e,..."autopilot"===e.category?{icon:(0,a.jsx)(d.n6M,{className:"relative opacity-50 scale-75"}),label:e.label,tip:"autopilot: ".concat(e.label)}:"hostSettings"===e.category?{icon:(0,a.jsx)(d.shL,{className:"relative top-px opacity-50 scale-75"}),label:e.label,tip:"host settings (RHPv2): ".concat(e.label)}:"priceTable"===e.category?{icon:(0,a.jsx)(d.B4q,{className:"relative top-px opacity-50 scale-75"}),label:e.label,tip:"price table (RHPv3): ".concat(e.label)}:{label:e.label,tip:e.label}}));function w(e,t){return(0,l.memo)(function(n){let{data:r}=n;return r[e]?(0,a.jsx)(o.ho9,{displayBoth:!0,size:"12",value:new(b())(r[e][t]||0),fixedFiat:4,variant:"value"}):null})}function j(e,t,n){return function(r){let{data:i}=r;return i[e]?(0,a.jsx)(o.m2c,{size:"12",value:new(b())(i[e][t]||0),variant:"value",format:e=>(0,f.yF)(e,{abbreviated:n})}):null}}function k(e,t){return function(n){let{data:r}=n;return r[e]?(0,a.jsx)(o.XxW,{value:r[e][t],size:"12"}):null}}function E(e,t){return function(n){let{data:r}=n;return r[e]?(0,a.jsx)(o.xvT,{size:"12",weight:"semibold",ellipsis:!0,children:(0,f.vW)(r[e][t])}):null}}var S=n(76838);function C(e,t){return{id:e.publicKey,netAddress:e.netAddress,publicKey:e.publicKey,lastScanSuccess:e.interactions.lastScanSuccess,lastScan:"0001-01-01T00:00:00Z"===e.interactions.lastScan?null:e.interactions.lastScan,knownSince:"0001-01-01T00:00:00Z"===e.knownSince?null:e.knownSince,lastAnnouncement:"0001-01-01T00:00:00Z"===e.lastAnnouncement?null:e.lastAnnouncement,uptime:new(b())(e.interactions.uptime||0),downtime:new(b())(e.interactions.downtime||0),successfulInteractions:new(b())(e.interactions.successfulInteractions||0),totalInteractions:new(b())(e.interactions.successfulInteractions+e.interactions.failedInteractions||0),failedInteractions:new(b())(e.interactions.failedInteractions||0),totalScans:new(b())(e.interactions.totalScans||0),activeContractsCount:new(b())((null==t?void 0:t.filter(t=>t.hostKey===e.publicKey).length)||0),activeContracts:(null==t?void 0:t.filter(t=>t.hostKey===e.publicKey))||[],priceTable:e.priceTable,settings:e.settings}}function _(e){let{host:t,allowlist:n,blocklist:r,isAllowlistActive:i}=e,a=!!(null==n?void 0:n.find(e=>e===t.publicKey)),o=!!(null==r?void 0:r.find(e=>{if(e===t.netAddress)return!0;try{let n=new URL("https://"+t.netAddress).hostname;return e===n}catch(e){return!1}}));return{isOnAllowlist:a,isOnBlocklist:o,isBlocked:o||!(!i||a)}}function O(e){return{score:new(b())((null==e?void 0:e.score)||0),scoreBreakdown:{age:new(b())((null==e?void 0:e.scoreBreakdown.age)||0),collateral:new(b())((null==e?void 0:e.scoreBreakdown.collateral)||0),interactions:new(b())((null==e?void 0:e.scoreBreakdown.interactions)||0),prices:new(b())((null==e?void 0:e.scoreBreakdown.prices)||0),storageRemaining:new(b())((null==e?void 0:e.scoreBreakdown.storageRemaining)||0),uptime:new(b())((null==e?void 0:e.scoreBreakdown.uptime)||0),version:new(b())((null==e?void 0:e.scoreBreakdown.version)||0)},gougingBreakdown:(null==e?void 0:e.gougingBreakdown)||{},gouging:null==e?void 0:e.gouging,unusableReasons:(null==e?void 0:e.unusableReasons)||[],usable:null==e?void 0:e.usable}}var M=n(46081),T=n(37769),A=n(82494),P=n(45178),N=n(9338);let R=(0,l.createContext)({}),D=()=>(0,l.useContext)(R);function L(e){let{children:t}=e,n=function(){var e,t,n,r,i,a,d;let f=(0,c.useRouter)(),[h,p]=(0,l.useState)("list"),m=Number(f.query.limit||50),v=Number(f.query.offset||0),{filters:y,setFilter:b,removeFilter:w,removeLastFilter:j,resetFilters:k}=(0,o.Uu5)(),{dataset:E}=(0,S.G)(),{autopilot:R}=(0,M.q)(),D=(0,l.useMemo)(()=>{let e=[];y.find(e=>"hasActiveContracts"===e.id)&&E&&(e=E.map(e=>e.hostKey));let t=y.find(e=>"publicKeyEquals"===e.id);return t&&e.push(null==t?void 0:t.value),e.length?e:void 0},[y,E]),L=(0,s.S0)({disabled:y.find(e=>"hasActiveContracts"===e.id)&&!E||"on"!==R.status,payload:{limit:m,offset:v,usabilityMode:(null===(e=y.find(e=>"usabilityMode"===e.id))||void 0===e?void 0:e.value)||"all",filterMode:(null===(t=y.find(e=>"filterMode"===e.id))||void 0===t?void 0:t.value)||"all",addressContains:null===(n=y.find(e=>"addressContains"===e.id))||void 0===n?void 0:n.value,keyIn:D},config:{swr:{errorRetryInterval:2e4,refreshInterval:N.h}}}),Z=(0,s.FV)({disabled:"off"!==R.status,payload:{limit:m,offset:v,filterMode:(null===(r=y.find(e=>"filterMode"===e.id))||void 0===r?void 0:r.value)||"all",addressContains:null===(i=y.find(e=>"addressContains"===e.id))||void 0===i?void 0:i.value,keyIn:y.find(e=>"hasActiveContracts"===e.id)&&E?E.map(e=>e.hostKey):void 0},config:{swr:{refreshInterval:N.h}}}),F=(0,s.s2)(),z=(0,s.uf)(),V=!!(null===(a=F.data)||void 0===a?void 0:a.length),{settings:I}=(0,g.Hv)(),B=(0,A.JL)({disabled:!I.siaCentral,config:{swr:{revalidateOnFocus:!1}}});(0,l.useEffect)(()=>{I.siaCentral||p("list")},[I.siaCentral]);let H=(0,l.useMemo)(()=>{var e;return(null===(e=B.data)||void 0===e?void 0:e.hosts)||[]},[B.data]),U=(0,l.useRef)(T.N),W=(0,l.useCallback)(e=>{U.current=e},[U]),[q,$]=(0,l.useState)(),K=(0,l.useCallback)(e=>{let t=document.getElementById(e),n=document.getElementById("scroll-hosts");t&&n&&n.scroll({top:t.offsetTop-50,behavior:"smooth"})},[]),Y=(0,l.useCallback)((e,t)=>{if(q===e){$(void 0);return}$(e),t&&U.current.moveToLocation(t),K(e)},[$,U,q,K]),X=(0,l.useCallback)((e,t)=>{if(q===e){$(void 0);return}$(e),t?U.current.moveToLocation(t):(0,o.OHV)("Geographic location is unknown for host ".concat((0,o.$Gg)(e,20))),K(e)},[$,U,q,K]),G=(0,l.useCallback)((e,t)=>null,[]),Q=function(e){let{autopilotStatus:t,regularResponse:n,autopilotResponse:r,allContracts:i,allowlist:a,blocklist:o,isAllowlistActive:s,geoHosts:u,onHostSelect:c}=e;return(0,l.useMemo)(()=>{var e,l;return"off"===t?(null===(e=n.data)||void 0===e?void 0:e.map(e=>{let t=u.find(t=>t.public_key===e.publicKey);return{onClick:()=>c(e.publicKey,null==t?void 0:t.location),...C(e,i),..._({host:e,allowlist:a.data,blocklist:o.data,isAllowlistActive:s}),...O(),location:null==t?void 0:t.location,countryCode:null==t?void 0:t.country_code}}))||null:"on"===t&&(null===(l=r.data)||void 0===l?void 0:l.map(e=>{let t=u.find(t=>t.public_key===e.host.publicKey);return{onClick:()=>c(e.host.publicKey,null==t?void 0:t.location),...C(e.host,i),..._({host:e.host,allowlist:a.data,blocklist:o.data,isAllowlistActive:s}),...O(e.checks),location:null==t?void 0:t.location,countryCode:null==t?void 0:t.country_code}}))||null},[c,t,n.data,r.data,i,a.data,o.data,s,u])}({autopilotStatus:R.status,autopilotResponse:L,regularResponse:Z,allContracts:E,allowlist:F,blocklist:z,isAllowlistActive:V,geoHosts:H,onHostSelect:X}),J=(0,l.useMemo)(()=>"off"===R.status?["autopilot"]:[],[R.status]),{configurableColumns:ee,enabledColumns:et,toggleColumnVisibility:en,setColumnsVisible:er,setColumnsHidden:ei,toggleSort:ea,setSortDirection:eo,setSortField:es,sortField:el,sortDirection:eu,resetDefaultColumnVisibility:ec}=(0,o.oy6)("renterd/v0/hosts",{columns:x,columnsDefaultVisible:u,disabledCategories:J}),ed=(0,l.useMemo)(()=>x.filter(e=>et.includes(e.id)),[et]),ef="on"===R.status?L.isValidating:Z.isValidating,eh="on"===R.status?L.error:Z.error,ep=(0,o.c2j)(Q,ef,eh,y),em=(0,P.B)(),ev=null===(d=R.state.data)||void 0===d?void 0:d.configured,eg=(0,l.useMemo)(()=>({isAutopilotConfigured:ev,siascanUrl:em}),[ev,em]),ey=(0,l.useMemo)(()=>null==Q?void 0:Q.filter(e=>e.location),[Q]);return{setCmd:W,viewMode:h,activeHost:(0,l.useMemo)(()=>null==Q?void 0:Q.find(e=>e.publicKey===q),[Q,q]),onHostMapHover:G,onHostMapClick:Y,setViewMode:p,hostsWithLocation:ey,error:eh,dataState:ep,offset:v,limit:m,pageCount:(null==Q?void 0:Q.length)||0,columns:ed,dataset:Q,tableContext:eg,configurableColumns:ee,enabledColumns:et,toggleColumnVisibility:en,setColumnsVisible:er,setColumnsHidden:ei,toggleSort:ea,setSortDirection:eo,setSortField:es,sortField:el,sortDirection:eu,resetDefaultColumnVisibility:ec,filters:y,setFilter:b,removeFilter:w,removeLastFilter:j,resetFilters:k}}();return(0,a.jsx)(R.Provider,{value:n,children:t})}},10569:function(e,t,n){"use strict";n.d(t,{Kg:function(){return a},jY:function(){return i}});var r=n(36655);let i={activeAndUsable:{colorHex:r.O9T.green[600],colorName:"green"},activeAndUnusable:{colorHex:r.O9T.amber[600],colorName:"amber"},potentialHost:{colorHex:r.O9T.blue[600],colorName:"blue"}};function a(e){return e.activeContractsCount.gt(0)&&!e.usable?{status:"activeAndUnusable",...i.activeAndUnusable}:e.activeContractsCount.gt(0)?{status:"activeAndUsable",...i.activeAndUsable}:{status:"potentialHost",...i.potentialHost}}},71367:function(e,t,n){"use strict";n.d(t,{f:function(){return y},E:function(){return g}});var r=n(52322),i=n(36655),a=n(5632),o=n(2784),s=n(33962),l=n(61020),u=n(57016),c=n(77248),d=n(13762),f=n(97112);function h(e){let{s3Key:t,contentProps:n,buttonProps:a}=e,{openConfirmDialog:s}=(0,f.Rh)(),h=(0,c.m)(),p=(0,u.KJ)(),m=(0,o.useCallback)(async()=>{var e;let n=(0,d.Z)(null===(e=h.data)||void 0===e?void 0:e.v4Keypairs,t),r=await p.put({params:{key:"s3authentication"},payload:{v4Keypairs:n}});r.error?(0,i.OHV)("Failed to delete key: ".concat(r.error)):(0,i.OPV)("Key ".concat(t," removed."))},[h.data,t,p]);return(0,r.jsxs)(i.h_2,{trigger:(0,r.jsx)(i.zxk,{variant:"ghost",icon:"hover",...a,children:(0,r.jsx)(l.iG7,{})}),contentProps:{align:"start",...n,onClick:e=>{e.stopPropagation()}},children:[(0,r.jsx)("div",{className:"px-1.5 py-1",children:(0,r.jsxs)(i.xvT,{size:"14",weight:"medium",color:"subtle",children:["Key ",t.slice(0,24),"..."]})}),(0,r.jsx)(i.Juw,{children:"Actions"}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{s({title:"Delete key ".concat((0,i.$Gg)(t,15)),action:"Remove",variant:"red",body:(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)(i.nvN,{size:"14",children:"Are you sure you would like to remove the following key?"}),(0,r.jsx)(i.nvN,{size:"14",font:"mono",children:(0,i.$Gg)(t,80)})]}),onConfirm:async()=>{m()}})},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(l.Jrl,{})}),"Delete key"]})]})}let p=[{id:"actions",label:"",fixed:!0,cellClassName:"w-[50px] !pl-2 !pr-4 [&+*]:!pl-0",render:e=>{let{data:{key:t}}=e;return(0,r.jsx)(h,{s3Key:t})}},{id:"key",label:"key",category:"general",render:e=>{let{data:{key:t}}=e;return(0,r.jsx)(i.XxW,{size:"12",value:t,label:"key",maxLength:80})}},{id:"secret",label:"secret",contentClassName:"w-[120px]",category:"general",render:e=>{let{data:{secret:t}}=e;return(0,r.jsx)(i.XxW,{size:"12",value:t,label:"key",maxLength:10,font:"mono"})}}];var m=n(9338);let v=(0,o.createContext)({}),g=()=>(0,o.useContext)(v);function y(e){let{children:t}=e,n=function(){let e=(0,a.useRouter)(),t=Number(e.query.limit||50),n=Number(e.query.offset||0),r=(0,c.m)({config:{swr:{refreshInterval:m.h}}}),l=(0,o.useMemo)(()=>{var e;return r.data?Object.entries((null===(e=r.data)||void 0===e?void 0:e.v4Keypairs)||{}).map(e=>{let[t,n]=e;return{id:t,key:t,secret:n}})||[]:null},[r.data]),{filters:u,setFilter:d,removeFilter:f,removeLastFilter:h,resetFilters:v}=(0,i.Wdu)(),{configurableColumns:g,enabledColumns:y,sortableColumns:b,toggleColumnVisibility:x,setColumnsVisible:w,setColumnsHidden:j,toggleSort:k,setSortDirection:E,setSortField:S,sortField:C,sortDirection:_,resetDefaultColumnVisibility:O}=(0,i.oy6)("renterd/v0/keys",{columns:p,columnsDefaultVisible:s.gd,sortOptions:s.Fo,defaultSortField:s.nw}),M=(0,i._4u)({dataset:l,filters:u,sortField:C,sortDirection:_}),T=(0,o.useMemo)(()=>M?M.slice(n,n+t):null,[M,n,t]),A=(0,o.useMemo)(()=>p.filter(e=>e.fixed||y.includes(e.id)),[y]),P=(0,i.c2j)(M,r.isValidating,r.error,u),N=(0,o.useMemo)(()=>({}),[]);return{dataState:P,limit:t,offset:n,isLoading:r.isLoading,error:r.error,pageCount:(null==T?void 0:T.length)||0,datasetCount:(null==l?void 0:l.length)||0,datasetFilteredCount:(null==M?void 0:M.length)||0,columns:A,dataset:l,cellContext:N,datasetPage:T,configurableColumns:g,enabledColumns:y,sortableColumns:b,toggleColumnVisibility:x,setColumnsVisible:w,setColumnsHidden:j,toggleSort:k,setSortDirection:E,setSortField:S,sortField:C,filters:u,setFilter:d,removeFilter:f,removeLastFilter:h,resetFilters:v,sortDirection:_,resetDefaultColumnVisibility:O}}();return(0,r.jsx)(v.Provider,{value:n,children:t})}},33962:function(e,t,n){"use strict";n.d(t,{Fo:function(){return a},gd:function(){return r},nw:function(){return i}});let r=["key","secret"],i="key",a=[{id:"key",label:"key",category:"general"},{id:"secret",label:"secret",category:"general"}]},40730:function(e,t,n){"use strict";n.d(t,{n:function(){return m},v:function(){return v}});var r=n(52322),i=n(36655),a=n(57016),o=n(2784),s=n(97112),l=n(6391),u=n.n(l),c=n(5632),d=n(45178),f=n(9338);let h=[],p=(0,o.createContext)({}),m=()=>(0,o.useContext)(p);function v(e){let{children:t}=e,n=function(){let e=(0,c.useRouter)(),t=Number(e.query.limit||50),n=Number(e.query.offset||0),r=(0,a.Qq)({params:{limit:t,offset:n},config:{swr:{refreshInterval:f.h}}}),l=(0,a.a0)({config:{swr:{refreshInterval:f.h}}}),{openDialog:p}=(0,s.Rh)(),m=(0,d.B)(),v=(0,o.useMemo)(()=>l.data&&r.data?[...(l.data||[]).map(e=>({type:"transaction",txType:(0,i.leQ)(e),unconfirmed:!0,siascanUrl:m})),...(r.data||[]).map(e=>({type:"transaction",txType:(0,i.leQ)(e.raw),hash:(0,i.I13)(e.id),timestamp:new Date(e.timestamp).getTime(),onClick:()=>p("transactionDetails",(0,i.I13)(e.id)),raw:e.raw,inflow:e.inflow,outflow:e.outflow,sc:new(u())(e.inflow).minus(e.outflow),siascanUrl:m})).sort((e,t)=>e.timestampnew Date(new Date().getTime()-30*b).toISOString(),[30,b]),w=(0,a.X1)({params:{start:x,interval:b,n:30}}),j=(0,o.useMemo)(()=>(w.data||[]).map(e=>({sc:new(u())(e.spendable).plus(e.unconfirmed).toNumber(),timestamp:new Date(e.timestamp).getTime()})).sort((e,t)=>e.timestamp>=t.timestamp?1:-1),[w.data]);return{dataset:v,error:g,dataState:y,offset:n,limit:t,pageCount:(null==v?void 0:v.length)||0,balances:j,metrics:w}}();return(0,r.jsx)(p.Provider,{value:n,children:t})}},88778:function(e,t,n){"use strict";n.d(t,{z:function(){return d}});var r=n(52322),i=n(36655),a=n(70899),o=n(26731),s=n(21487),l=n(32998),u=n(61020);function c(e){let{abort:t}=e;return(0,r.jsxs)(i.h_2,{trigger:(0,r.jsx)(i.zxk,{variant:"ghost",icon:"hover",children:(0,r.jsx)(u.bQp,{})}),contentProps:{align:"start"},children:[(0,r.jsx)(i.Juw,{children:"Actions"}),(0,r.jsxs)(i.Xiv,{onSelect:t,children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(u._fo,{})}),"Cancel upload"]})]})}let d=[{id:"actions",label:"",fixed:!0,cellClassName:"w-[50px] !pl-2 !pr-2 [&+*]:!pl-0",render:function(e){let{data:{uploadAbort:t}}=e;return(0,r.jsx)(c,{abort:t})}},{id:"path",label:"path",contentClassName:"max-w-[600px]",category:"general",render:function(e){let{data:{path:t,id:n}}=e,o=(0,a.kj)(t).slice(1);return(0,r.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,r.jsx)(i.xvT,{ellipsis:!0,weight:"semibold",size:"14",children:o}),(0,r.jsx)(i.XxW,{value:n,label:"upload ID",size:"10"})]})}},{id:"status",label:"status",category:"general",contentClassName:"w-[200px]",render:function(e){let{data:{loaded:t,size:n,uploadStatus:a,remote:s}}=e;return s?(0,r.jsx)(i.xvT,{size:"12",color:"subtle",children:"Uploading from a different session"}):(0,r.jsx)(o.s,{loaded:t,size:n,status:a})}},{id:"size",label:"size",category:"general",render:function(e){let{data:{remote:t,size:n}}=e;return t?null:(0,r.jsx)(i.xvT,{size:"12",color:"subtle",children:(0,s.vW)(n)})}},{id:"createdAt",label:"started at",category:"general",render:function(e){let{data:{createdAt:t}}=e;return(0,r.jsx)(i.xvT,{size:"12",color:"subtle",children:(0,l.Z)(new Date(t).getTime(),new Date)})}}]},73076:function(e,t,n){"use strict";n.d(t,{V:function(){return m},x:function(){return p}});var r=n(52322),i=n(36655),a=n(99605),o=n(57016),s=n(2784);let l=["path","status","size","createdAt"],u=[];var c=n(88778),d=n(70899),f=n(41736);let h=(0,s.createContext)({}),p=()=>(0,s.useContext)(h);function m(e){let{children:t}=e,n=function(){var e,t;let{uploadsMap:n,activeBucket:r}=(0,f.b)(),h=(0,a.lr)(),p=Number(h.get("limit")||50),m=h.get("marker"),{filters:v,setFilter:g,removeFilter:y,removeLastFilter:b,resetFilters:x}=(0,i.Uu5)(),w=(0,o.LS)(),j=(0,o.bg)({disabled:!r,payload:{bucket:null==r?void 0:r.name,uploadIDMarker:m,limit:p}}),k=(0,s.useMemo)(()=>{var e,t;return(null===(t=j.data)||void 0===t?void 0:null===(e=t.uploads)||void 0===e?void 0:e.map(e=>{let t=e.uploadID,i=(0,d.vt)(e.path),a=(0,d.v_)(null==r?void 0:r.name,e.path);return n[t]||{id:t,path:a,bucket:r,name:i,size:1,loaded:1,isUploading:!0,uploadStatus:"uploading",createdAt:e.createdAt,remote:!0,type:"file",uploadAbort:async()=>{await w.post({payload:{bucket:null==r?void 0:r.name,path:e.path,uploadID:e.uploadID}})}}}))||[]},[n,r,j.data,w]),{configurableColumns:E,enabledColumns:S,sortableColumns:C,toggleColumnVisibility:_,setColumnsVisible:O,setColumnsHidden:M,toggleSort:T,setSortDirection:A,setSortField:P,sortField:N,sortDirection:R,resetDefaultColumnVisibility:D}=(0,i.oy6)("renterd/v0/uploads",{columns:c.z,columnsDefaultVisible:l,sortOptions:u,defaultSortField:"path"}),L=(0,s.useMemo)(()=>c.z.filter(e=>e.fixed||S.includes(e.id)),[S]);return{dataState:(0,i.c2j)(k,j.isValidating,j.error,v),limit:p,nextMarker:null===(e=j.data)||void 0===e?void 0:e.nextUploadIDMarker,hasMore:null===(t=j.data)||void 0===t?void 0:t.hasMore,isLoading:j.isLoading,error:j.error,pageCount:(null==k?void 0:k.length)||0,columns:L,datasetPage:k,configurableColumns:E,enabledColumns:S,sortableColumns:C,toggleColumnVisibility:_,setColumnsVisible:O,setColumnsHidden:M,toggleSort:T,setSortDirection:A,setSortField:P,sortField:N,filters:v,setFilter:g,removeFilter:y,removeLastFilter:b,resetFilters:x,sortDirection:R,resetDefaultColumnVisibility:D}}();return(0,r.jsx)(h.Provider,{value:n,children:t})}},82229:function(e,t,n){"use strict";n.d(t,{I:function(){return o}});var r=n(36655),i=n(57016),a=n(2784);function o(){let e=(0,i.ni)();return(0,a.useCallback)((t,n)=>(async()=>{let i=await e.put({payload:{add:t,remove:n}});return i.error?((0,r.OHV)(i.error),!1):(t.length&&(0,r.RFt)("".concat(t.map(e=>(0,r.$Gg)(e,20)).join(", ")," added to allowlist")),n.length&&(0,r.RFt)("".concat(n.map(e=>(0,r.$Gg)(e,20)).join(", ")," removed from allowlist")),!0)})(),[e])}},94613:function(e,t,n){"use strict";n.d(t,{l:function(){return o}});var r=n(36655),i=n(57016),a=n(2784);function o(){let e=(0,i.Os)();return(0,a.useCallback)((t,n)=>(async()=>{let i=await e.put({payload:{add:t,remove:n}});return i.error?((0,r.OHV)(i.error),!1):(t.length&&(0,r.RFt)("".concat(t.map(e=>(0,r.$Gg)(e,20)).join(", ")," added to blocklist")),n.length&&(0,r.RFt)("".concat(n.map(e=>(0,r.$Gg)(e,20)).join(", ")," removed from blocklist")),!0)})(),[e])}},91332:function(e,t,n){"use strict";n.d(t,{a:function(){return i}});var r=n(57016);function i(e){return(0,r.yu)({...e,params:{key:"contractset"}})}},18121:function(e,t,n){"use strict";n.d(t,{B:function(){return o},V:function(){return a}});var r=n(52322),i=n(61020);let a={excellent:1,good:.5,poor:0};function o(e){let{health:t,size:n,isDirectory:o}=e,s="excellent",l="green",u=t,c=(0,r.jsx)(i.Y3p,{});return t1&&(u=1),t<0&&(u=0),{label:s+" health",color:l,icon:c,displayHealth:u}}},91157:function(e,t,n){"use strict";n.d(t,{w:function(){return i}});var r=n(57016);function i(e){return(0,r.yu)({...e,params:{key:"redundancy"}})}},77248:function(e,t,n){"use strict";n.d(t,{m:function(){return i}});var r=n(57016);function i(e){return(0,r.yu)({...e,params:{key:"s3authentication"}})}},45178:function(e,t,n){"use strict";n.d(t,{B:function(){return a}});var r=n(36655),i=n(57016);function a(){var e;return(null===(e=(0,i.d_)().data)||void 0===e?void 0:e.network)==="Zen Testnet"?r.nNd.explore.testnetZen:r.nNd.explore.mainnet}},38855:function(e,t,n){"use strict";n.d(t,{n:function(){return o}});var r=n(36655),i=n(10363),a=n(57016);function o(){var e,t,n,o;let{isUnlockedAndAuthedRoute:s}=(0,i.Hv)(),l=(0,a.DQ)({config:{swr:{refreshInterval:e=>(null==e?void 0:e.synced)?(0,r.XBW)(60):(0,r.XBW)(10)}}}),u=(0,a.nH)(),c=l.data?null===(e=l.data)||void 0===e?void 0:e.blockHeight:0,d=(0,a.X2)({config:{swr:{refreshInterval:e=>(null==e?void 0:e.scanHeight)>=c?(0,r.XBW)(60):(0,r.XBW)(10)}}}),f=s&&c&&u?Number((100*Math.min(c/u,1)).toFixed(1)):0,h=s&&c&&d.data?Number((100*Math.min(d.data.scanHeight/u,1)).toFixed(1)):0;return{isSynced:null===(t=l.data)||void 0===t?void 0:t.synced,isWalletSynced:(null===(n=l.data)||void 0===n?void 0:n.synced)&&(null===(o=d.data)||void 0===o?void 0:o.scanHeight)>=c-1,nodeBlockHeight:c,estimatedBlockHeight:u,syncPercent:f,walletScanPercent:h,moreThan100BlocksToSync:!!c&&!!u&&u-c>100,firstTimeSyncing:!!c&&!!u&&u-c>5e4}}},70899:function(e,t,n){"use strict";n.d(t,{W0:function(){return m},YF:function(){return f},ez:function(){return w},ru:function(){return h},gD:function(){return b},vt:function(){return v},kj:function(){return p},rj:function(){return y},IQ:function(){return g},v_:function(){return d},rd:function(){return x}});var r=n(79200),i=n(81441),a=n(81721),o=function(e,t){for(var n=-1,r=e.length;++n-1;);return n},s=n(36202),l=n(25186),u=/^\s+/,c=function(e,t,n){if((e=(0,l.Z)(e))&&(n||void 0===t))return e.replace(u,"");if(!e||!(t=(0,r.Z)(t)))return e;var a=(0,s.Z)(e),c=o(a,(0,s.Z)(t));return(0,i.Z)(a,c).join("")};function d(e,t){let n=e.endsWith("/")?e.slice(0,-1):e,r=t.startsWith("/")?t.slice(1):t;return"".concat(n,"/").concat(r)}function f(e,t){let n=d(e=c(e,"/"),t);return n.endsWith("/")?n:n+"/"}function h(e){return e.split("/")[0]}function p(e){let t=(e=c(e,"/")).split("/").slice(1).join("/");return"/".concat(t)}function m(e){return{bucket:h(e),key:p(e).slice(1).split("/").map(encodeURIComponent).join("/")}}function v(e){let t=(e=c(e,"/")).split("/");return e.endsWith("/")?"".concat(t[t.length-2],"/"):t[t.length-1]}function g(e){return e.endsWith("/")}function y(e){return(g(e=c(e,"/"))?e.slice(0,-1):e).split("/").slice(0,-1).join("/").concat("/")}function b(e){return g(e=c(e,"/"))?e.slice(0,-1).split("/"):e.split("/").slice(0,-1)}function x(e){return e.join("/")}function w(e){return g(e=c(e,"/"))?e:e.concat("/")}},5184:function(e,t,n){"use strict";n.d(t,{E:function(){return a},e:function(){return i}});var r=n(70899);function i(e,t){let n=String(e.active.id),i=(0,r.rd)(t);e.collisions.length&&(i=".."===e.collisions[0].id?(0,r.rd)(t.slice(0,-1)):String(e.collisions[0].id));let a=(0,r.vt)(n);return{bucket:(0,r.ru)(n),from:(0,r.kj)(n),to:(0,r.kj)((0,r.v_)(i,a)),mode:a.endsWith("/")?"multi":"single"}}function a(e,t){let n=(0,r.v_)((0,r.rj)(e),t),i=(0,r.IQ)(e);return i&&(n=(0,r.ez)(n)),{bucket:(0,r.ru)(e),from:(0,r.kj)(e),to:(0,r.kj)(n),mode:i?"multi":"single"}}},83391:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return z}});var r=n(52322);n(50521);var i=n(36655),a=n(2784),o=n(97112),s=n(76838),l=n(56328),u=n(46081),c=n(49889),d=n(61020),f=n(38855),h=n(98334),p=n(42770),m=n(57016),v=n(6391),g=n.n(v),y=n(21487),b=n(10363),x=n(92762);function w(){var e,t;let{isUnlockedAndAuthedRoute:n}=(0,b.Hv)(),a=(0,u.q)(),{openDialog:s}=(0,o.Rh)(),l=(0,m.X2)(),c=(0,m.e$)({config:{swr:{errorRetryInterval:1e4}}}),[v,w]=(0,x.Z)("v0/renterd/onboarding/maximized",{defaultValue:!0}),k=(0,f.n)(),E=(0,p.F)();if(!n||"on"!==a.autopilot.status)return null;let S=new(g())(l.data?l.data.confirmed+l.data.unconfirmed:0),C=new(g())((null===(e=c.data)||void 0===e?void 0:e.contracts.allowance)||0),_=null===(t=a.autopilot.state.data)||void 0===t?void 0:t.configured,O=k.isSynced,M=S.gt(0),T=!E.active,A=[_,O,M,T],P=A.length,N=A.filter(e=>e).length;return P===N?null:v?(0,r.jsx)("div",{className:"z-20 fixed bottom-5 left-1/2 -translate-x-1/2 flex justify-center",children:(0,r.jsx)(i.s_4,{className:"w-[400px] flex flex-col max-h-[600px]",children:(0,r.jsxs)(i.xrM,{children:[(0,r.jsxs)("div",{className:"flex justify-between items-center px-3 py-2 border-b border-gray-200 dark:border-graydark-300",children:[(0,r.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,r.jsx)(i.TRl,{}),(0,r.jsx)(i.xvT,{size:"20",weight:"semibold",children:"Welcome to Sia"})]}),(0,r.jsx)(i.zxk,{variant:"ghost",onClick:()=>w(!1),children:(0,r.jsx)(d.mli,{})})]}),(0,r.jsx)("div",{className:"flex justify-between items-center px-3 py-2 border-b border-gray-200 dark:border-graydark-300",children:(0,r.jsx)(i.xvT,{size:"14",children:"Get set up by completing the following steps. Once they are complete, you can start uploading files."})}),(0,r.jsx)(j,{title:(0,r.jsx)(i.rUS,{href:h._.config.index,ellipsis:!0,size:"14",underline:"hover",children:"Step 1: Configure your storage settings"}),description:"Specify how much data you plan to store and your target price.",action:_?(0,r.jsx)(i.xvT,{color:"green",children:(0,r.jsx)(d.Y3p,{})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.rUS,{href:h._.config.index,children:(0,r.jsx)(d.V8Q,{})}),(0,r.jsx)(i.xvT,{color:"amber",children:(0,r.jsx)(d.Fs9,{})})]})}),(0,r.jsx)(j,{title:(0,r.jsx)(i.rUS,{href:h._.node.index,underline:"hover",ellipsis:!0,size:"14",children:"Step 2: Wait for the blockchain to sync"}),description:"The blockchain will sync in the background, this takes some time. No user action required.",action:O?(0,r.jsx)(i.xvT,{color:"green",children:(0,r.jsx)(d.Y3p,{})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(i.xvT,{ellipsis:!0,size:"14",children:[k.syncPercent,"%"]}),(0,r.jsx)(i.xvT,{color:"amber",children:(0,r.jsx)(d.hzZ,{})})]})}),(0,r.jsx)(j,{title:(0,r.jsx)(i.rUS,{href:h._.wallet.view,onClick:()=>s("addressDetails"),ellipsis:!0,size:"14",underline:"hover",children:"Step 3: Fund your wallet"}),description:"Fund your wallet with at least ".concat((0,y.Vz)(C)," siacoin to cover the required allowance.").concat(k.isWalletSynced?"":" Balance will not be accurate until wallet is finished scanning."),action:M?(0,r.jsx)(i.xvT,{color:"green",children:(0,r.jsx)(d.Y3p,{})}):(0,r.jsxs)(r.Fragment,{children:[!k.isWalletSynced&&(0,r.jsx)(i.ua7,{content:"Wallet scanning progress ".concat(k.walletScanPercent,"%"),children:(0,r.jsxs)(i.xvT,{size:"14",children:[k.walletScanPercent,"%"]})}),(0,r.jsx)(i.rUS,{href:h._.wallet.view,onClick:()=>s("addressDetails"),children:(0,r.jsx)(d.V8Q,{})}),(0,r.jsx)(i.xvT,{color:"amber",children:(0,r.jsx)(d.Fs9,{})})]})}),(0,r.jsx)(j,{title:(0,r.jsx)(i.rUS,{href:h._.contracts.index,ellipsis:!0,size:"14",underline:"hover",children:"Step 4: Wait for storage contracts to form"}),description:"Once all other steps are complete, contracts will automatically form. No user action required.",action:T?(0,r.jsx)(i.xvT,{color:"green",children:(0,r.jsx)(d.Y3p,{})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(i.xvT,{ellipsis:!0,size:"14",children:[E.count,"/",E.required]}),(0,r.jsx)(i.xvT,{color:"amber",children:(0,r.jsx)(d.hzZ,{})})]})})]})})}):(0,r.jsx)("div",{className:"z-30 fixed bottom-5 left-1/2 -translate-x-1/2 flex justify-center",children:(0,r.jsx)(i.zxk,{onClick:()=>w(!0),size:"large",className:"flex gap-3 !px-3",children:(0,r.jsxs)(i.xvT,{className:"flex items-center gap-1",children:[(0,r.jsx)(i.TRl,{}),"Setup: ",N,"/",P," steps complete"]})})})}function j(e){let{title:t,action:n,description:a}=e;return(0,r.jsx)("div",{className:"border-t first:border-t-0 border-gray-200 dark:border-graydark-300 px-3 py-2",children:(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,r.jsx)("div",{className:"flex-1 flex items-center",children:t}),n]}),(0,r.jsx)("div",{className:"pr-5",children:(0,r.jsx)(i.xvT,{size:"12",color:"subtle",children:a})})]})})}var k=n(41736),E=n(26731);function S(e){let{loaded:t,size:n,path:a,abortTip:o,abort:s,status:l}=e;return(0,r.jsxs)("div",{className:"flex flex-col gap-1 border-t first:border-t-0 border-gray-200 dark:border-graydark-300 px-3 py-2",children:[(0,r.jsxs)("div",{className:"flex gap-1",children:[(0,r.jsx)(i.xvT,{ellipsis:!0,size:"14",className:"flex-1",children:a}),(0,r.jsx)(i.zxk,{tip:o,variant:"ghost",size:"none",onClick:()=>null==s?void 0:s(),children:(0,r.jsx)(d.PcV,{})})]}),(0,r.jsx)(E.s,{loaded:t,size:n,status:l})]})}var C=n(73076);function _(){let{isUnlockedAndAuthedRoute:e}=(0,b.Hv)(),{downloadsList:t,downloadCancel:n,isViewingUploads:o,navigateToUploads:s}=(0,k.b)(),{pageCount:l}=(0,C.x)(),[u,c]=(0,a.useState)(!0),f=!!l,h=t.length,p=!!h;if(!e||!f&&!p)return null;let m=(0,r.jsxs)("div",{className:"flex gap-2",children:[f&&!o?(0,r.jsxs)(i.zxk,{tip:"Uploads list",onClick:s,className:"flex gap-3",children:[(0,r.jsx)(d.R$6,{className:"opacity-50 scale-75 relative top-px"}),"Active uploads"]}):null,p?(0,r.jsxs)(i.zxk,{tip:"Downloads list",onClick:()=>c(e=>!e),className:"flex gap-3",children:[(0,r.jsx)(d.vzB,{className:"opacity-50 scale-75"}),"Active downloads"]}):null]});return p&&u?(0,r.jsxs)("div",{className:"z-30 fixed bottom-5 left-1/2 -translate-x-1/2 flex flex-col items-center justify-center gap-2",children:[(0,r.jsx)(i.s_4,{className:"w-[400px] flex flex-col max-h-[600px]",children:(0,r.jsx)(i.xrM,{children:p?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex justify-between items-center px-3 py-2 border-b border-gray-200 dark:border-graydark-300",children:[(0,r.jsxs)(i.xvT,{size:"16",weight:"semibold",children:["Active downloads (",h,")"]}),(0,r.jsx)(i.zxk,{variant:"ghost",onClick:()=>c(!1),children:(0,r.jsx)(d.mli,{})})]}),t.map(e=>(0,r.jsx)(S,{path:e.path,loaded:e.loaded,size:e.size,status:e.loaded===e.size?"processing":"downloading",abort:()=>n(e),abortTip:"Cancel download"},e.id))]}):null})}),m]}):(0,r.jsx)("div",{className:"z-30 fixed bottom-5 left-1/2 -translate-x-1/2",children:m})}var O=n(40730),M=n(71367),T=n(43385),A=n(75618),P=n(87764);function N(e){let{children:t}=e;return(0,r.jsx)(u.w,{children:(0,r.jsx)(c.iV,{children:(0,r.jsx)(o.Tu,{children:(0,r.jsx)(O.v,{children:(0,r.jsx)(s.x,{children:(0,r.jsx)(l.x,{children:(0,r.jsx)(k.e,{children:(0,r.jsx)(C.V,{children:(0,r.jsx)(A.V,{children:(0,r.jsx)(T.p,{children:(0,r.jsx)(M.f,{children:(0,r.jsxs)(P.b,{children:[(0,r.jsx)(w,{}),(0,r.jsx)(_,{}),(0,r.jsx)(o.xQ,{}),t]})})})})})})})})})})})})}var R=n(46058),D=n.n(R),L=n(28863),Z=n.n(L);let F=(0,n(82851).cx)(D().variable,Z().variable);function z(e){let{Component:t,pageProps:n}=e;return(0,r.jsx)(i.PD$,{className:F,fallback:n.fallback,passwordProtectRequestHooks:!0,lockRoutes:h._,children:(0,r.jsx)(N,{children:(0,r.jsx)(t,{...n})})})}},36655:function(e,t,n){"use strict";let r,i,a,o;n.d(t,{tU3:function(){return OP},zXq:function(){return OH},juT:function(){return Oi},Cts:function(){return lq},Z58:function(){return Mf},WVB:function(){return c6},zxk:function(){return lM},b0u:function(){return k0},EKh:function(){return lY},vRO:function(){return MG},QHy:function(){return Mz},TaT:function(){return Mw},eQh:function(){return lG},HfT:function(){return MB},wEc:function(){return Mp},ncR:function(){return Ce},VqE:function(){return uO},h_2:function(){return dt},Xiv:function(){return dn},Juw:function(){return dr},KpP:function(){return di},fhJ:function(){return p9},XOF:function(){return S9},S$c:function(){return Cd},WyV:function(){return MQ},yEL:function(){return OV},cB7:function(){return Co},ZqQ:function(){return Ca},IKw:function(){return Cf},KZS:function(){return Cs},zsw:function(){return pm},__J:function(){return dv},rUS:function(){return db},Qjf:function(){return dx},xgg:function(){return kQ},TRl:function(){return dj},kFS:function(){return c8},FzK:function(){return ML},Clw:function(){return c5},PD$:function(){return M5},Wxm:function(){return hf},uDJ:function(){return _6},_5:function(){return _7},wFK:function(){return _8},s_4:function(){return nE},nvN:function(){return nj},u5Q:function(){return Mh},j4H:function(){return hl},hmz:function(){return hu},J2e:function(){return dU},kod:function(){return d3},xrM:function(){return uS},PhF:function(){return hd},Z0O:function(){return c0},DLL:function(){return Mr},KJW:function(){return Os},rsf:function(){return hO},D_D:function(){return O4},iA_:function(){return _5},mQc:function(){return fP},nUL:function(){return fD},drW:function(){return fN},SPt:function(){return fR},t6k:function(){return MH},xvT:function(){return nw},nvn:function(){return fZ},ua7:function(){return l_},mPE:function(){return O3},XxW:function(){return SI},PF9:function(){return SH},m2c:function(){return SY},YKL:function(){return SW},ho9:function(){return SK},QUh:function(){return Ma},weF:function(){return OJ},YNn:function(){return O8},DmW:function(){return O7},O9T:function(){return v9},fVJ:function(){return Mu},vQq:function(){return SO},E5z:function(){return ST},HLH:function(){return Tp},NrH:function(){return kz},k9c:function(){return kW},Y_Z:function(){return Mo},EJC:function(){return Tf},kOJ:function(){return Ml},leQ:function(){return SR},Ztc:function(){return O0},XAn:function(){return kq},Vkc:function(){return c2},sWj:function(){return kF},ort:function(){return k$},xLV:function(){return kI},okB:function(){return kU},AEA:function(){return kH},S5N:function(){return T9},z$:function(){return nk},XBW:function(){return kY},GXN:function(){return kK},I13:function(){return SP},cEb:function(){return fL},y70:function(){return ht},OHV:function(){return SS},OPV:function(){return SE},RFt:function(){return Sj},$Gg:function(){return SA},_4u:function(){return Tl},Wdu:function(){return Ts},Y97:function(){return OA},c2j:function(){return ON},t0Y:function(){return M2},mYE:function(){return M0},u$d:function(){return M1},Z4p:function(){return MJ},WsO:function(){return Oz},Uu5:function(){return Tu},fb0:function(){return Td},oy6:function(){return Ta},nNd:function(){return O9},BL0:function(){return kV},ivg:function(){return kB}});var s,l,u,c,d,f,h,p,m,v,g,y,b,x,w,j,k,E,S,C,_,O,M,T,A,P,N,R,D,L,Z,F,z,V,I,B,H,U,W,q,$,K,Y,X,G,Q,J,ee,et,en,er,ei,ea=n(52322),eo=n(2784),es=n.t(eo,2),el=n(7896),eu=n(34540),ec=n(26215),ed=n(99575);function ef(e){let t=e+"CollectionProvider",[n,r]=(0,eu.b)(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e+"CollectionSlot",s=eo.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=a(o,n),s=(0,ec.e)(t,i.collectionRef);return eo.createElement(ed.g7,{ref:s},r)}),l=e+"CollectionItemSlot",u="data-radix-collection-item";return[{Provider:e=>{let{scope:t,children:n}=e,r=eo.useRef(null),a=eo.useRef(new Map).current;return eo.createElement(i,{scope:t,itemMap:a,collectionRef:r},n)},Slot:s,ItemSlot:eo.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=eo.useRef(null),s=(0,ec.e)(t,o),c=a(l,n);return eo.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),eo.createElement(ed.g7,{[u]:"",ref:s},r)})},function(t){let n=a(e+"CollectionConsumer",t);return eo.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${u}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])},r]}var eh=n(41816),ep=n(73597),em=n(72130),ev=n(64680),eg=n(28245),ey=n(26074);let eb="Collapsible",[ex,ew]=(0,eu.b)(eb),[ej,ek]=ex(eb),eE=((e,t)=>{let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[l=!1,u]=(0,ep.T)({prop:r,defaultProp:i,onChange:o});return(0,eo.createElement)(ej,{scope:n,disabled:a,contentId:(0,ey.M)(),open:l,onOpenToggle:(0,eo.useCallback)(()=>u(e=>!e),[u])},(0,eo.createElement)(em.WV.div,(0,el.Z)({"data-state":eC(l),"data-disabled":a?"":void 0},s,{ref:t})))},"CollapsibleContent"),eS=((e,t)=>{let{forceMount:n,...r}=e,i=ek(eE,e.__scopeCollapsible);return(0,eo.createElement)(eg.z,{present:n||i.open},({present:e})=>(0,eo.createElement)(eS,(0,el.Z)({},r,{ref:t,present:e})))},(0,eo.forwardRef)((e,t)=>{let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=ek(eE,n),[s,l]=(0,eo.useState)(r),u=(0,eo.useRef)(null),c=(0,ec.e)(t,u),d=(0,eo.useRef)(0),f=d.current,h=(0,eo.useRef)(0),p=h.current,m=o.open||s,v=(0,eo.useRef)(m),g=(0,eo.useRef)();return(0,eo.useEffect)(()=>{let e=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,ev.b)(()=>{let e=u.current;if(e){g.current=g.current||{transitionDuration:e.style.transitionDuration,animationDuration:e.style.animationDuration,animationFillMode:e.style.animationFillMode},e.style.transitionDuration="0s",e.style.animationDuration="0s",e.style.animationFillMode="none";let t=e.getBoundingClientRect();d.current=t.height,h.current=t.width,v.current||(e.style.transitionDuration=g.current.transitionDuration,e.style.animationDuration=g.current.animationDuration,e.style.animationFillMode=g.current.animationFillMode),l(r)}},[o.open,r]),(0,eo.createElement)(em.WV.div,(0,el.Z)({"data-state":eC(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!m},a,{ref:c,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":p?`${p}px`:void 0,...e.style}}),m&&i)}));function eC(e){return e?"open":"closed"}let e_="Accordion",eO=["Home","End","ArrowDown","ArrowUp"],[eM,eT,eA]=ef(e_),[eP,eN]=(0,eu.b)(e_,[eA,ew]);ew(),eo.forwardRef((e,t)=>{let{type:n,...r}=e;return eo.createElement(eM.Provider,{scope:e.__scopeAccordion},"multiple"===n?eo.createElement(ez,(0,el.Z)({},r,{ref:t})):eo.createElement(eF,(0,el.Z)({},r,{ref:t})))}).propTypes={type(e){let t=e.value||e.defaultValue;return e.type&&!["single","multiple"].includes(e.type)?Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`."):"multiple"===e.type&&"string"==typeof t?Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`."):"single"===e.type&&Array.isArray(t)?Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`."):null}};let[eR,eD]=eP(e_),[eL,eZ]=eP(e_,{collapsible:!1}),eF=eo.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:a=!1,...o}=e,[s,l]=(0,ep.T)({prop:n,defaultProp:r,onChange:i});return eo.createElement(eR,{scope:e.__scopeAccordion,value:s?[s]:[],onItemOpen:l,onItemClose:eo.useCallback(()=>a&&l(""),[a,l])},eo.createElement(eL,{scope:e.__scopeAccordion,collapsible:a},eo.createElement(eB,(0,el.Z)({},o,{ref:t}))))}),ez=eo.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[o=[],s]=(0,ep.T)({prop:n,defaultProp:r,onChange:i}),l=eo.useCallback(e=>s((t=[])=>[...t,e]),[s]),u=eo.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return eo.createElement(eR,{scope:e.__scopeAccordion,value:o,onItemOpen:l,onItemClose:u},eo.createElement(eL,{scope:e.__scopeAccordion,collapsible:!0},eo.createElement(eB,(0,el.Z)({},a,{ref:t}))))}),[eV,eI]=eP(e_),eB=eo.forwardRef((e,t)=>{let{__scopeAccordion:n,disabled:r,...i}=e,a=eo.useRef(null),o=(0,ec.e)(a,t),s=eT(n),l=(0,eh.M)(e.onKeyDown,e=>{var t;if(!eO.includes(e.key))return;let n=e.target,r=s().filter(e=>{var t;return!(null!==(t=e.ref.current)&&void 0!==t&&t.disabled)}),i=r.findIndex(e=>e.ref.current===n),a=r.length;if(-1===i)return;e.preventDefault();let o=i;switch(e.key){case"Home":o=0;break;case"End":o=a-1;break;case"ArrowDown":o=i+1;break;case"ArrowUp":(o=i-1)<0&&(o=a-1)}null===(t=r[o%a].ref.current)||void 0===t||t.focus()});return eo.createElement(eV,{scope:n,disabled:r},eo.createElement(eM.Slot,{scope:n},eo.createElement(em.WV.div,(0,el.Z)({},i,{ref:o,onKeyDown:r?void 0:l}))))}),[eH,eU]=eP("AccordionItem");var eW=n(82851),eq=n(83317);function e$(e){return e.split("-")[0]}function eK(e){return e.split("-")[1]}function eY(e){return["top","bottom"].includes(e$(e))?"x":"y"}function eX(e){return"y"===e?"height":"width"}function eG(e,t,n){let r,{reference:i,floating:a}=e,o=i.x+i.width/2-a.width/2,s=i.y+i.height/2-a.height/2,l=eY(t),u=eX(l),c=i[u]/2-a[u]/2,d="x"===l;switch(e$(t)){case"top":r={x:o,y:i.y-a.height};break;case"bottom":r={x:o,y:i.y+i.height};break;case"right":r={x:i.x+i.width,y:s};break;case"left":r={x:i.x-a.width,y:s};break;default:r={x:i.x,y:i.y}}switch(eK(t)){case"start":r[l]-=c*(n&&d?-1:1);break;case"end":r[l]+=c*(n&&d?-1:1)}return r}let eQ=async(e,t,n)=>{let{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:o}=n,s=await (null==o.isRTL?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:c}=eG(l,r,s),d=r,f={},h=0;for(let n=0;n({name:"arrow",options:e,async fn(t){let{element:n,padding:r=0}=null!=e?e:{},{x:i,y:a,placement:o,rects:s,platform:l}=t;if(null==n)return{};let u=eJ(r),c={x:i,y:a},d=eY(o),f=eK(o),h=eX(d),p=await l.getDimensions(n),m="y"===d?"top":"left",v="y"===d?"bottom":"right",g=s.reference[h]+s.reference[d]-c[d]-s.floating[h],y=c[d]-s.reference[d],b=await (null==l.getOffsetParent?void 0:l.getOffsetParent(n)),x=b?"y"===d?b.clientHeight||0:b.clientWidth||0:0;0===x&&(x=s.floating[h]);let w=u[m],j=x-p[h]-u[v],k=x/2-p[h]/2+(g/2-y/2),E=e4(w,e2(k,j)),S=("start"===f?u[m]:u[v])>0&&k!==E&&s.reference[h]<=s.floating[h];return{[d]:c[d]-(S?ke5[e])}let e8={start:"end",end:"start"};function e7(e){return e.replace(/start|end/g,e=>e8[e])}let e9=["top","right","bottom","left"];e9.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);let te=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r,i,a;let{placement:o,middlewareData:s,rects:l,initialPlacement:u,platform:c,elements:d}=t,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",flipAlignment:v=!0,...g}=e,y=e$(o),b=p||(y!==u&&v?function(e){let t=e6(e);return[e7(e),t,e7(t)]}(u):[e6(u)]),x=[u,...b],w=await e1(t,g),j=[],k=(null==(n=s.flip)?void 0:n.overflows)||[];if(f&&j.push(w[y]),h){let{main:e,cross:t}=function(e,t,n){void 0===n&&(n=!1);let r=eK(e),i=eY(e),a=eX(i),o="x"===i?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=e6(o)),{main:o,cross:e6(o)}}(o,l,await (null==c.isRTL?void 0:c.isRTL(d.floating)));j.push(w[e],w[t])}if(k=[...k,{placement:o,overflows:j}],!j.every(e=>e<=0)){let e=(null!=(r=null==(i=s.flip)?void 0:i.index)?r:0)+1,t=x[e];if(t)return{data:{index:e,overflows:k},reset:{placement:t}};let n="bottom";switch(m){case"bestFit":{let e=null==(a=k.map(e=>[e,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:a[0].placement;e&&(n=e);break}case"initialPlacement":n=u}if(o!==n)return{reset:{placement:n}}}return{}}}};function tt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function tn(e){return e9.some(t=>e[t]>=0)}let tr=function(e){let{strategy:t="referenceHidden",...n}=void 0===e?{}:e;return{name:"hide",async fn(e){let{rects:r}=e;switch(t){case"referenceHidden":{let t=tt(await e1(e,{...n,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:tn(t)}}}case"escaped":{let t=tt(await e1(e,{...n,altBoundary:!0}),r.floating);return{data:{escapedOffsets:t,escaped:tn(t)}}}default:return{}}}}},ti=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){let{x:n,y:r}=t,i=await async function(e,t){let{placement:n,platform:r,elements:i}=e,a=await (null==r.isRTL?void 0:r.isRTL(i.floating)),o=e$(n),s=eK(n),l="x"===eY(n),u=["left","top"].includes(o)?-1:1,c=a&&l?-1:1,d="function"==typeof t?t(e):t,{mainAxis:f,crossAxis:h,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&"number"==typeof p&&(h="end"===s?-1*p:p),l?{x:h*c,y:f*u}:{x:f*u,y:h*c}}(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function ta(e){return"x"===e?"y":"x"}let to=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){let{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=e,u={x:n,y:r},c=await e1(t,l),d=eY(e$(i)),f=ta(d),h=u[d],p=u[f];if(a){let e="y"===d?"bottom":"right";h=e4(h+c["y"===d?"top":"left"],e2(h,h-c[e]))}if(o){let e="y"===f?"bottom":"right";p=e4(p+c["y"===f?"top":"left"],e2(p,p-c[e]))}let m=s.fn({...t,[d]:h,[f]:p});return{...m,data:{x:m.x-n,y:m.y-r}}}}},ts=function(e){return void 0===e&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=e,c={x:n,y:r},d=eY(i),f=ta(d),h=c[d],p=c[f],m="function"==typeof s?s({...a,placement:i}):s,v="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){let e="y"===d?"height":"width",t=a.reference[d]-a.floating[e]+v.mainAxis,n=a.reference[d]+a.reference[e]-v.mainAxis;hn&&(h=n)}if(u){var g,y,b,x;let e="y"===d?"width":"height",t=["top","left"].includes(e$(i)),n=a.reference[f]-a.floating[e]+(t&&null!=(g=null==(y=o.offset)?void 0:y[f])?g:0)+(t?0:v.crossAxis),r=a.reference[f]+a.reference[e]+(t?0:null!=(b=null==(x=o.offset)?void 0:x[f])?b:0)-(t?v.crossAxis:0);pr&&(p=r)}return{[d]:h,[f]:p}}}};function tl(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function tu(e){if(null==e)return window;if(!tl(e)){let t=e.ownerDocument;return t&&t.defaultView||window}return e}function tc(e){return tu(e).getComputedStyle(e)}function td(e){return tl(e)?"":e?(e.nodeName||"").toLowerCase():""}function tf(){let e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map(e=>e.brand+"/"+e.version).join(" "):navigator.userAgent}function th(e){return e instanceof tu(e).HTMLElement}function tp(e){return e instanceof tu(e).Element}function tm(e){return"undefined"!=typeof ShadowRoot&&(e instanceof tu(e).ShadowRoot||e instanceof ShadowRoot)}function tv(e){let{overflow:t,overflowX:n,overflowY:r}=tc(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function tg(e){let t=/firefox/i.test(tf()),n=tc(e);return"none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||["transform","perspective"].includes(n.willChange)||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter}function ty(){return!/^((?!chrome|android).)*safari/i.test(tf())}let tb=Math.min,tx=Math.max,tw=Math.round;function tj(e,t,n){var r,i,a,o;void 0===t&&(t=!1),void 0===n&&(n=!1);let s=e.getBoundingClientRect(),l=1,u=1;t&&th(e)&&(l=e.offsetWidth>0&&tw(s.width)/e.offsetWidth||1,u=e.offsetHeight>0&&tw(s.height)/e.offsetHeight||1);let c=tp(e)?tu(e):window,d=!ty()&&n,f=(s.left+(d&&null!=(r=null==(i=c.visualViewport)?void 0:i.offsetLeft)?r:0))/l,h=(s.top+(d&&null!=(a=null==(o=c.visualViewport)?void 0:o.offsetTop)?a:0))/u,p=s.width/l,m=s.height/u;return{width:p,height:m,top:h,right:f+p,bottom:h+m,left:f,x:f,y:h}}function tk(e){return((e instanceof tu(e).Node?e.ownerDocument:e.document)||window.document).documentElement}function tE(e){return tp(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function tS(e){return tj(tk(e)).left+tE(e).scrollLeft}function tC(e){return"html"===td(e)?e:e.assignedSlot||e.parentNode||(tm(e)?e.host:null)||tk(e)}function t_(e){return th(e)&&"fixed"!==getComputedStyle(e).position?e.offsetParent:null}function tO(e){let t=tu(e),n=t_(e);for(;n&&["table","td","th"].includes(td(n))&&"static"===getComputedStyle(n).position;)n=t_(n);return n&&("html"===td(n)||"body"===td(n)&&"static"===getComputedStyle(n).position&&!tg(n))?t:n||function(e){let t=tC(e);for(tm(t)&&(t=t.host);th(t)&&!["html","body"].includes(td(t));){if(tg(t))return t;t=t.parentNode}return null}(e)||t}function tM(e){if(th(e))return{width:e.offsetWidth,height:e.offsetHeight};let t=tj(e);return{width:t.width,height:t.height}}function tT(e,t){var n;void 0===t&&(t=[]);let r=function e(t){let n=tC(t);return["html","body","#document"].includes(td(n))?t.ownerDocument.body:th(n)&&tv(n)?n:e(n)}(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),a=tu(r),o=i?[a].concat(a.visualViewport||[],tv(r)?r:[]):r,s=t.concat(o);return i?s:s.concat(tT(o))}function tA(e,t,n){return"viewport"===t?e0(function(e,t){let n=tu(e),r=tk(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,l=0;if(i){a=i.width,o=i.height;let e=ty();(e||!e&&"fixed"===t)&&(s=i.offsetLeft,l=i.offsetTop)}return{width:a,height:o,x:s,y:l}}(e,n)):tp(t)?function(e,t){let n=tj(e,!1,"fixed"===t),r=n.top+e.clientTop,i=n.left+e.clientLeft;return{top:r,left:i,x:i,y:r,right:i+e.clientWidth,bottom:r+e.clientHeight,width:e.clientWidth,height:e.clientHeight}}(t,n):e0(function(e){var t;let n=tk(e),r=tE(e),i=null==(t=e.ownerDocument)?void 0:t.body,a=tx(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=tx(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+tS(e),l=-r.scrollTop;return"rtl"===tc(i||n).direction&&(s+=tx(n.clientWidth,i?i.clientWidth:0)-a),{width:a,height:o,x:s,y:l}}(tk(e)))}let tP={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[..."clippingAncestors"===n?function(e){let t=tT(e),n=["absolute","fixed"].includes(tc(e).position)&&th(e)?tO(e):e;return tp(n)?t.filter(e=>tp(e)&&function(e,t){let n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&tm(n)){let n=t;do{if(n&&e===n)return!0;n=n.parentNode||n.host}while(n)}return!1}(e,n)&&"body"!==td(e)):[]}(t):[].concat(n),r],o=a[0],s=a.reduce((e,n)=>{let r=tA(t,n,i);return e.top=tx(r.top,e.top),e.right=tb(r.right,e.right),e.bottom=tb(r.bottom,e.bottom),e.left=tx(r.left,e.left),e},tA(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e,i=th(n),a=tk(n);if(n===a)return t;let o={scrollLeft:0,scrollTop:0},s={x:0,y:0};if((i||!i&&"fixed"!==r)&&(("body"!==td(n)||tv(a))&&(o=tE(n)),th(n))){let e=tj(n,!0);s.x=e.x+n.clientLeft,s.y=e.y+n.clientTop}return{...t,x:t.x-o.scrollLeft+s.x,y:t.y-o.scrollTop+s.y}},isElement:tp,getDimensions:tM,getOffsetParent:tO,getDocumentElement:tk,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:function(e,t,n){let r=th(t),i=tk(t),a=tj(e,r&&function(e){let t=tj(e);return tw(t.width)!==e.offsetWidth||tw(t.height)!==e.offsetHeight}(t),"fixed"===n),o={scrollLeft:0,scrollTop:0},s={x:0,y:0};if(r||!r&&"fixed"!==n){if(("body"!==td(t)||tv(i))&&(o=tE(t)),th(t)){let e=tj(t,!0);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else i&&(s.x=tS(i))}return{x:a.left+o.scrollLeft-s.x,y:a.top+o.scrollTop-s.y,width:a.width,height:a.height}}(t,tO(n),r),floating:{...tM(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===tc(e).direction};function tN(e,t,n,r){void 0===r&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=!0,animationFrame:s=!1}=r,l=i&&!s,u=a&&!s,c=l||u?[...tp(e)?tT(e):[],...tT(t)]:[];c.forEach(e=>{l&&e.addEventListener("scroll",n,{passive:!0}),u&&e.addEventListener("resize",n)});let d,f=null;if(o){let r=!0;f=new ResizeObserver(()=>{r||n(),r=!1}),tp(e)&&!s&&f.observe(e),f.observe(t)}let h=s?tj(e):null;return s&&function t(){let r=tj(e);h&&(r.x!==h.x||r.y!==h.y||r.width!==h.width||r.height!==h.height)&&n(),h=r,d=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach(e=>{l&&e.removeEventListener("scroll",n),u&&e.removeEventListener("resize",n)}),null==(e=f)||e.disconnect(),f=null,s&&cancelAnimationFrame(d)}}let tR=(e,t,n)=>eQ(e,t,{platform:tP,...n});var tD=n(28316),tL="undefined"!=typeof document?eo.useLayoutEffect:eo.useEffect;function tZ(e){let{middleware:t,placement:n="bottom",strategy:r="absolute",whileElementsMounted:i}=void 0===e?{}:e,a=eo.useRef(null),o=eo.useRef(null),s=function(e){let t=eo.useRef(e);return tL(()=>{t.current=e}),t}(i),l=eo.useRef(null),[u,c]=eo.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[d,f]=eo.useState(t);!function e(t,n){let r,i,a;if(t===n)return!0;if(typeof t!=typeof n)return!1;if("function"==typeof t&&t.toString()===n.toString())return!0;if(t&&n&&"object"==typeof t){if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(i=r;0!=i--;)if(!e(t[i],n[i]))return!1;return!0}if((r=(a=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=r;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;0!=i--;){let r=a[i];if(("_owner"!==r||!t.$$typeof)&&!e(t[r],n[r]))return!1}return!0}return t!=t&&n!=n}(null==d?void 0:d.map(e=>{let{options:t}=e;return t}),null==t?void 0:t.map(e=>{let{options:t}=e;return t}))&&f(t);let h=eo.useCallback(()=>{a.current&&o.current&&tR(a.current,o.current,{middleware:d,placement:n,strategy:r}).then(e=>{p.current&&tD.flushSync(()=>{c(e)})})},[d,n,r]);tL(()=>{p.current&&h()},[h]);let p=eo.useRef(!1);tL(()=>(p.current=!0,()=>{p.current=!1}),[]);let m=eo.useCallback(()=>{if("function"==typeof l.current&&(l.current(),l.current=null),a.current&&o.current){if(s.current){let e=s.current(a.current,o.current,h);l.current=e}else h()}},[h,s]),v=eo.useCallback(e=>{a.current=e,m()},[m]),g=eo.useCallback(e=>{o.current=e,m()},[m]),y=eo.useMemo(()=>({reference:a,floating:o}),[]);return eo.useMemo(()=>({...u,update:h,refs:y,reference:v,floating:g}),[u,h,y,v,g])}let tF=e=>{let{element:t,padding:n}=e;return{name:"arrow",options:e,fn(e){if(Object.prototype.hasOwnProperty.call(t,"current")){if(null!=t.current)return e3({element:t.current,padding:n}).fn(e)}else if(t)return e3({element:t,padding:n}).fn(e);return{}}}},tz=(0,eo.forwardRef)((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,eo.createElement)(em.WV.svg,(0,el.Z)({},a,{ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none"}),e.asChild?n:(0,eo.createElement)("polygon",{points:"0,0 30,0 15,10"}))});function tV(e){let[t,n]=(0,eo.useState)(void 0);return(0,ev.b)(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let r,i;if(!Array.isArray(t)||!t.length)return;let a=t[0];if("borderBoxSize"in a){let e=a.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,i=t.blockSize}else r=e.offsetWidth,i=e.offsetHeight;n({width:r,height:i})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}let tI="Popper",[tB,tH]=(0,eu.b)(tI),[tU,tW]=tB(tI),tq=(0,eo.forwardRef)((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=tW("PopperAnchor",n),o=(0,eo.useRef)(null),s=(0,ec.e)(t,o);return(0,eo.useEffect)(()=>{a.onAnchorChange((null==r?void 0:r.current)||o.current)}),r?null:(0,eo.createElement)(em.WV.div,(0,el.Z)({},i,{ref:s}))}),t$="PopperContent",[tK,tY]=tB(t$),[tX,tG]=tB(t$,{hasParent:!1,positionUpdateFns:new Set}),tQ=(0,eo.forwardRef)((e,t)=>{var n,r,i,a,o,s,l,u;let{__scopePopper:c,side:d="bottom",sideOffset:f=0,align:h="center",alignOffset:p=0,arrowPadding:m=0,collisionBoundary:v=[],collisionPadding:g=0,sticky:y="partial",hideWhenDetached:b=!1,avoidCollisions:x=!0,...w}=e,j=tW(t$,c),[k,E]=(0,eo.useState)(null),S=(0,ec.e)(t,e=>E(e)),[C,_]=(0,eo.useState)(null),O=tV(C),M=null!==(n=null==O?void 0:O.width)&&void 0!==n?n:0,T=null!==(r=null==O?void 0:O.height)&&void 0!==r?r:0,A="number"==typeof g?g:{top:0,right:0,bottom:0,left:0,...g},P=Array.isArray(v)?v:[v],N=P.length>0,R={padding:A,boundary:P.filter(t2),altBoundary:N},{reference:D,floating:L,strategy:Z,x:F,y:z,placement:V,middlewareData:I,update:B}=tZ({strategy:"fixed",placement:d+("center"!==h?"-"+h:""),whileElementsMounted:tN,middleware:[ti({mainAxis:f+T,alignmentAxis:p}),x?to({mainAxis:!0,crossAxis:!1,limiter:"partial"===y?ts():void 0,...R}):void 0,C?tF({element:C,padding:m}):void 0,x?te({...R}):void 0,t4({arrowWidth:M,arrowHeight:T}),b?tr({strategy:"referenceHidden"}):void 0].filter(t1)});(0,ev.b)(()=>{D(j.anchor)},[D,j.anchor]);let H=null!==F&&null!==z,[U,W]=t3(V),q=null===(i=I.arrow)||void 0===i?void 0:i.x,$=null===(a=I.arrow)||void 0===a?void 0:a.y,K=(null===(o=I.arrow)||void 0===o?void 0:o.centerOffset)!==0,[Y,X]=(0,eo.useState)();(0,ev.b)(()=>{k&&X(window.getComputedStyle(k).zIndex)},[k]);let{hasParent:G,positionUpdateFns:Q}=tG(t$,c),J=!G;(0,eo.useLayoutEffect)(()=>{if(!J)return Q.add(B),()=>{Q.delete(B)}},[J,Q,B]),(0,eo.useLayoutEffect)(()=>{J&&H&&Array.from(Q).reverse().forEach(e=>requestAnimationFrame(e))},[J,H,Q]);let ee={"data-side":U,"data-align":W,...w,ref:S,style:{...w.style,animation:H?void 0:"none",opacity:null!==(s=I.hide)&&void 0!==s&&s.referenceHidden?0:void 0}};return(0,eo.createElement)("div",{ref:L,"data-radix-popper-content-wrapper":"",style:{position:Z,left:0,top:0,transform:H?`translate3d(${Math.round(F)}px, ${Math.round(z)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[null===(l=I.transformOrigin)||void 0===l?void 0:l.x,null===(u=I.transformOrigin)||void 0===u?void 0:u.y].join(" ")}},(0,eo.createElement)(tK,{scope:c,placedSide:U,onArrowChange:_,arrowX:q,arrowY:$,shouldHideArrow:K},J?(0,eo.createElement)(tX,{scope:c,hasParent:!0,positionUpdateFns:Q},(0,eo.createElement)(em.WV.div,ee)):(0,eo.createElement)(em.WV.div,ee)))}),tJ={top:"bottom",right:"left",bottom:"top",left:"right"},t0=(0,eo.forwardRef)(function(e,t){let{__scopePopper:n,...r}=e,i=tY("PopperArrow",n),a=tJ[i.placedSide];return(0,eo.createElement)("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0}},(0,eo.createElement)(tz,(0,el.Z)({},r,{ref:t,style:{...r.style,display:"block"}})))});function t1(e){return void 0!==e}function t2(e){return null!==e}let t4=e=>({name:"transformOrigin",options:e,fn(t){var n,r,i,a,o;let{placement:s,rects:l,middlewareData:u}=t,c=(null===(n=u.arrow)||void 0===n?void 0:n.centerOffset)!==0,d=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[h,p]=t3(s),m={start:"0%",center:"50%",end:"100%"}[p],v=(null!==(r=null===(i=u.arrow)||void 0===i?void 0:i.x)&&void 0!==r?r:0)+d/2,g=(null!==(a=null===(o=u.arrow)||void 0===o?void 0:o.y)&&void 0!==a?a:0)+f/2,y="",b="";return"bottom"===h?(y=c?m:`${v}px`,b=`${-f}px`):"top"===h?(y=c?m:`${v}px`,b=`${l.floating.height+f}px`):"right"===h?(y=`${-f}px`,b=c?m:`${g}px`):"left"===h&&(y=`${l.floating.width+f}px`,b=c?m:`${g}px`),{data:{x:y,y:b}}}});function t3(e){let[t,n="center"]=e.split("-");return[t,n]}let t5=e=>{let{__scopePopper:t,children:n}=e,[r,i]=(0,eo.useState)(null);return(0,eo.createElement)(tU,{scope:t,anchor:r,onAnchorChange:i},n)};var t6=n(6500);let t8=(0,eo.forwardRef)((e,t)=>(0,eo.createElement)(em.WV.span,(0,el.Z)({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}))),[t7,t9]=(0,eu.b)("Tooltip",[tH]),ne=tH(),nt="tooltip.open",[nn,nr]=t7("TooltipProvider"),ni="Tooltip",[na,no]=t7(ni),ns="TooltipTrigger",nl=(0,eo.forwardRef)((e,t)=>{let{__scopeTooltip:n,...r}=e,i=no(ns,n),a=nr(ns,n),o=ne(n),s=(0,eo.useRef)(null),l=(0,ec.e)(t,s,i.onTriggerChange),u=(0,eo.useRef)(!1),c=(0,eo.useRef)(!1),d=(0,eo.useCallback)(()=>u.current=!1,[]);return(0,eo.useEffect)(()=>()=>document.removeEventListener("pointerup",d),[d]),(0,eo.createElement)(tq,(0,el.Z)({asChild:!0},o),(0,eo.createElement)(em.WV.button,(0,el.Z)({"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute},r,{ref:l,onPointerMove:(0,eh.M)(e.onPointerMove,e=>{"touch"===e.pointerType||c.current||a.isPointerInTransitRef.current||(i.onTriggerEnter(),c.current=!0)}),onPointerLeave:(0,eh.M)(e.onPointerLeave,()=>{i.onTriggerLeave(),c.current=!1}),onPointerDown:(0,eh.M)(e.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:(0,eh.M)(e.onFocus,()=>{u.current||i.onOpen()}),onBlur:(0,eh.M)(e.onBlur,i.onClose),onClick:(0,eh.M)(e.onClick,e=>{0===e.detail&&i.onClose()})})))}),nu="TooltipPortal",[nc,nd]=t7(nu,{forceMount:void 0}),nf="TooltipContent",nh=(0,eo.forwardRef)((e,t)=>{let n=nd(nf,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...a}=e,o=no(nf,e.__scopeTooltip);return(0,eo.createElement)(eg.z,{present:r||o.open},o.disableHoverableContent?(0,eo.createElement)(ng,(0,el.Z)({side:i},a,{ref:t})):(0,eo.createElement)(np,(0,el.Z)({side:i},a,{ref:t})))}),np=(0,eo.forwardRef)((e,t)=>{let n=no(nf,e.__scopeTooltip),r=nr(nf,e.__scopeTooltip),i=(0,eo.useRef)(null),a=(0,ec.e)(t,i),[o,s]=(0,eo.useState)(null),{trigger:l,onClose:u}=n,c=i.current,{onPointerInTransitChange:d}=r,f=(0,eo.useCallback)(()=>{s(null),d(!1)},[d]),h=(0,eo.useCallback)((e,t)=>{let n=e.currentTarget,r=function(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:return null}}({x:e.clientX,y:e.clientY},n.getBoundingClientRect()),i="right"===r||"bottom"===r?-5:5;s(function(e){let t=e.slice();return t.sort((e,t)=>e.xt.x?1:e.yt.y?1:0),function(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return(n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y)?t:t.concat(n)}(t)}(["right"===r||"left"===r?{x:e.clientX+i,y:e.clientY}:{x:e.clientX,y:e.clientY+i},...function(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}(t.getBoundingClientRect())])),d(!0)},[d]);return(0,eo.useEffect)(()=>()=>f(),[f]),(0,eo.useEffect)(()=>{if(l&&c){let e=e=>h(e,c),t=e=>h(e,l);return l.addEventListener("pointerleave",e),c.addEventListener("pointerleave",t),()=>{l.removeEventListener("pointerleave",e),c.removeEventListener("pointerleave",t)}}},[l,c,h,f]),(0,eo.useEffect)(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=(null==l?void 0:l.contains(t))||(null==c?void 0:c.contains(t)),i=!function(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;er!=u>r&&n<(l-o)*(r-s)/(u-s)+o&&(i=!i)}return i}(n,o);r?f():i&&(f(),u())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[l,c,o,u,f]),(0,eo.createElement)(ng,(0,el.Z)({},e,{ref:a}))}),[nm,nv]=t7(ni,{isInside:!1}),ng=(0,eo.forwardRef)((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,l=no(nf,n),u=ne(n),{onClose:c}=l;return(0,eo.useEffect)(()=>(document.addEventListener(nt,c),()=>document.removeEventListener(nt,c)),[c]),(0,eo.useEffect)(()=>{if(l.trigger){let e=e=>{let t=e.target;null!=t&&t.contains(l.trigger)&&c()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[l.trigger,c]),(0,eo.createElement)(eq.XB,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:c},(0,eo.createElement)(tQ,(0,el.Z)({"data-state":l.stateAttribute},u,s,{ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)"}}),(0,eo.createElement)(ed.A4,null,r),(0,eo.createElement)(nm,{scope:n,isInside:!0},(0,eo.createElement)(t8,{id:l.contentId,role:"tooltip"},i||r))))}),ny=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i=!1,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,l=nr(ni,e.__scopeTooltip),u=ne(t),[c,d]=(0,eo.useState)(null),f=(0,ey.M)(),h=(0,eo.useRef)(0),p=null!=o?o:l.disableHoverableContent,m=null!=s?s:l.delayDuration,v=(0,eo.useRef)(!1),[g=!1,y]=(0,ep.T)({prop:r,defaultProp:i,onChange:e=>{e?(l.onOpen(),document.dispatchEvent(new CustomEvent(nt))):l.onClose(),null==a||a(e)}}),b=(0,eo.useMemo)(()=>g?v.current?"delayed-open":"instant-open":"closed",[g]),x=(0,eo.useCallback)(()=>{window.clearTimeout(h.current),v.current=!1,y(!0)},[y]),w=(0,eo.useCallback)(()=>{window.clearTimeout(h.current),y(!1)},[y]),j=(0,eo.useCallback)(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,y(!0)},m)},[m,y]);return(0,eo.useEffect)(()=>()=>window.clearTimeout(h.current),[]),(0,eo.createElement)(t5,u,(0,eo.createElement)(na,{scope:t,contentId:f,open:g,stateAttribute:b,trigger:c,onTriggerChange:d,onTriggerEnter:(0,eo.useCallback)(()=>{l.isOpenDelayed?j():x()},[l.isOpenDelayed,j,x]),onTriggerLeave:(0,eo.useCallback)(()=>{p?w():window.clearTimeout(h.current)},[w,p]),onOpen:x,onClose:w,disableHoverableContent:p},n))},nb=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=no(nu,t);return(0,eo.createElement)(nc,{scope:t,forceMount:n},(0,eo.createElement)(eg.z,{present:n||a.open},(0,eo.createElement)(t6.h,{asChild:!0,container:i},r)))},nx=(0,eW.j)([],{variants:{display:{default:"inline-block",none:""},font:{mono:"font-mono",sans:"font-sans"},color:{verySubtle:"text-gray-700 dark:text-graydark-700",subtle:"text-gray-1000 dark:text-graydark-1000",contrast:"text-gray-1100 dark:text-white",lo:"text-white dark:text-graydark-50",accent:"text-accent-1100 dark:text-accentdark-1100",red:"text-red-700 dark:text-red-400",green:"text-emerald-700 dark:text-emerald-500",amber:"text-amber-600 dark:text-amber-500",none:""},weight:{extrabold:"font-extrabold",bold:"font-bold",medium:"font-medium",semibold:"font-semibold",regular:"font-normal",normal:"font-normal",light:"font-light",none:""},size:{10:"text-xxs",12:"text-xs",14:"text-sm",16:"text-base",18:"text-lg",20:"text-xl",24:"text-2xl",30:"text-3xl",36:"text-4xl",40:"text-5xl",48:"text-5xl",60:"text-6xl",64:"text-6xl"},scaleSize:{12:"text-xxs md:text-xs",14:"text-xs md:text-sm",16:"text-sm md:text-base",18:"text-base md:text-lg",20:"text-base md:text-xl",24:"text-xl md:text-2xl",30:"text-2xl md:text-3xl",36:"text-3xl md:text-4xl",40:"text-4xl md:text-5xl",48:"text-4xl md:text-5xl",60:"text-5xl md:text-6xl",64:"text-5xl md:text-6xl"},noWrap:{true:"whitespace-nowrap"},underline:{accent:"underline underline-offset-2 decoration-2 decoration-accent-900 dark:decoration-accentdark-900",show:"underline underline-offset-2 decoration-gray-1100 dark:decoration-gray-500",hover:"hover:underline underline-offset-2 decoration-gray-1100 dark:decoration-gray-500",none:""},ellipsis:{true:"overflow-hidden text-ellipsis whitespace-nowrap"},wrapEllipsis:{true:"overflow-hidden text-ellipsis"}},defaultVariants:{display:"default",weight:"regular",font:"sans",color:"contrast",underline:"none"}}),nw=eo.forwardRef((e,t)=>{let{tag:n="span",className:r,font:i,color:a,weight:o,size:s,scaleSize:l,noWrap:u,underline:c,ellipsis:d,wrapEllipsis:f,...h}=e;return(0,ea.jsx)(n,{ref:t,className:(0,eW.cx)(r,nx({font:i,color:a,weight:o,size:s,scaleSize:l,underline:c,noWrap:u,ellipsis:d,wrapEllipsis:f})),...h})}),nj=eo.forwardRef((e,t)=>{let{size:n="18",...r}=e;return(0,ea.jsx)(nw,{tag:"p",...r,ref:t,weight:"regular",scaleSize:n,color:"subtle",className:(0,eW.cx)("leading-relaxed md:leading-relaxed",e.className)})}),nk=(0,eW.j)(["transition-shadow ease-in-out duration-300","shadow-sm hover:shadow","rounded","border"],{variants:{color:{default:["bg-white dark:bg-graydark-200","border-gray-400 dark:border-graydark-400"],subtle:["border-gray-200 dark:border-graydark-200"]}},defaultVariants:{color:"default"}}),nE=eo.forwardRef((e,t)=>{let{className:n,color:r,...i}=e;return(0,ea.jsx)("div",{ref:t,className:nk({className:n,color:r}),...i})});var nS=n(34406);let nC=(void 0===nS||nS.env,"production"),n_=1/60*1e3,nO="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),nM="undefined"!=typeof window?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(nO()),n_),nT=!0,nA=!1,nP=!1,nN={delta:0,timestamp:0},nR=["read","update","preRender","render","postRender"],nD=nR.reduce((e,t)=>(e[t]=function(e){let t=[],n=[],r=0,i=!1,a=!1,o=new WeakSet,s={schedule:(e,a=!1,s=!1)=>{let l=s&&i,u=l?t:n;return a&&o.add(e),-1===u.indexOf(e)&&(u.push(e),l&&i&&(r=t.length)),e},cancel:e=>{let t=n.indexOf(e);-1!==t&&n.splice(t,1),o.delete(e)},process:l=>{if(i){a=!0;return}if(i=!0,[t,n]=[n,t],n.length=0,r=t.length)for(let n=0;nnA=!0),e),{}),nL=nR.reduce((e,t)=>{let n=nD[t];return e[t]=(e,t=!1,r=!1)=>(nA||nI(),n.schedule(e,t,r)),e},{}),nZ=nR.reduce((e,t)=>(e[t]=nD[t].cancel,e),{}),nF=nR.reduce((e,t)=>(e[t]=()=>nD[t].process(nN),e),{}),nz=e=>nD[e].process(nN),nV=e=>{nA=!1,nN.delta=nT?n_:Math.max(Math.min(e-nN.timestamp,40),1),nN.timestamp=e,nP=!0,nR.forEach(nz),nP=!1,nA&&(nT=!1,nM(nV))},nI=()=>{nA=!0,nT=!0,nP||nM(nV)},nB=()=>nN,nH="undefined"!=typeof document,nU=nH?eo.useLayoutEffect:eo.useEffect;function nW(){let e=(0,eo.useRef)(!1);return nU(()=>(e.current=!0,()=>{e.current=!1}),[]),e}let nq=(0,eo.createContext)(null);function n$(e){let t=(0,eo.useRef)(null);return null===t.current&&(t.current=e()),t.current}class nK extends eo.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){let e=this.props.sizeRef.current;e.height=t.offsetHeight||0,e.width=t.offsetWidth||0,e.top=t.offsetTop,e.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function nY({children:e,isPresent:t}){let n=(0,eo.useId)(),r=(0,eo.useRef)(null),i=(0,eo.useRef)({width:0,height:0,top:0,left:0});return(0,eo.useInsertionEffect)(()=>{let{width:e,height:a,top:o,left:s}=i.current;if(t||!r.current||!e||!a)return;r.current.dataset.motionPopId=n;let l=document.createElement("style");return document.head.appendChild(l),l.sheet&&l.sheet.insertRule(`
[data-motion-pop-id="${n}"] {
position: absolute !important;
width: ${e}px !important;
diff --git a/renterd/assets/_next/static/chunks/pages/buckets/[bucket]/uploads-2ae34e6ce9470e40.js b/renterd/assets/_next/static/chunks/pages/buckets/[bucket]/uploads-2ae34e6ce9470e40.js
new file mode 100644
index 000000000..d29cbfaca
--- /dev/null
+++ b/renterd/assets/_next/static/chunks/pages/buckets/[bucket]/uploads-2ae34e6ce9470e40.js
@@ -0,0 +1 @@
+(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[264],{56592:function(e,s,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/buckets/[bucket]/uploads",function(){return n(44111)}])},17398:function(e,s,n){"use strict";n.d(s,{C:function(){return a}});var t=n(52322),i=n(36655),l=n(61020),r=n(41736);function c(){let{activeExplorerMode:e,setExplorerModeDirectory:s,setExplorerModeFlat:n,isViewingUploads:c,navigateToUploads:a}=(0,r.b)();return(0,t.jsxs)(i.h_2,{trigger:(0,t.jsx)(i.zxk,{tipSide:"bottom",tip:c?"Viewing uploads":"directory"===e?"Viewing directory explorer":"Viewing all bucket files",children:c?(0,t.jsx)(l.bQp,{}):"directory"===e?(0,t.jsx)(l.Qbr,{}):(0,t.jsx)(l.nDH,{})}),contentProps:{align:"start",side:"bottom",className:"max-w-[300px]"},children:[(0,t.jsxs)(i.Xiv,{onSelect:s,children:[(0,t.jsx)(i.KpP,{children:(0,t.jsx)(l.Qbr,{})}),"Directory"]}),(0,t.jsxs)(i.Xiv,{onSelect:n,children:[(0,t.jsx)(i.KpP,{children:(0,t.jsx)(l.nDH,{})}),"All files"]}),(0,t.jsxs)(i.Xiv,{onSelect:a,children:[(0,t.jsx)(i.KpP,{children:(0,t.jsx)(l.bQp,{})}),"Uploads"]})]})}function a(){let{isViewingBuckets:e}=(0,r.b)();return e?(0,t.jsx)(i.ua7,{content:"Viewing all buckets",children:(0,t.jsx)("div",{children:(0,t.jsx)(i.zxk,{state:"waiting",children:(0,t.jsx)(l.fi8,{size:16})})})}):(0,t.jsx)(c,{})}},91362:function(e,s,n){"use strict";n.d(s,{J:function(){return h}});var t=n(52322),i=n(36655),l=n(57016),r=n(6391),c=n.n(r),a=n(98334),o=n(38855),d=n(97112),x=n(21487);function u(){var e,s,n,r,c,a;let{openDialog:u}=(0,d.Rh)(),j=(0,l.d_)({config:{swr:{revalidateOnFocus:!1}}}),h=(0,l.X2)({config:{swr:{revalidateOnFocus:!1}}}),f=(0,l.cQ)(),m=(0,o.n)(),p=null===(e=j.data)||void 0===e?void 0:e.version,v="?"===p?"https://github.com/SiaFoundation/renterd/commits/":(null==p?void 0:p.match(/^v\d+\.\d+\.\d+/))?"https://github.com/SiaFoundation/renterd/releases/".concat(p):"https://github.com/SiaFoundation/renterd/tree/".concat(p),g=j.data?new Date().getTime()-new Date(null===(s=j.data)||void 0===s?void 0:s.startTime).getTime():0;return(0,t.jsxs)(i.HfT,{name:"renterd",peerCount:null===(n=f.data)||void 0===n?void 0:n.length,connectPeer:()=>u("connectPeer"),isSynced:m.isSynced,syncPercent:m.syncPercent,nodeBlockHeight:m.nodeBlockHeight,estimatedBlockHeight:m.estimatedBlockHeight,firstTimeSyncing:m.firstTimeSyncing,moreThan100BlocksToSync:m.moreThan100BlocksToSync,children:[(0,t.jsxs)("div",{className:"flex gap-4 justify-between items-center",children:[(0,t.jsx)(i.__J,{size:"14",color:"subtle",noWrap:!0,className:"w-[100px]",children:"Wallet address"}),(0,t.jsx)("div",{className:"flex-1 flex justify-end overflow-hidden -mr-0.5 pr-0.5",children:(0,t.jsx)(i.XxW,{size:"14",maxLength:50,value:null===(r=h.data)||void 0===r?void 0:r.address,type:"address"})})]}),j.data&&(0,t.jsxs)("div",{className:"flex gap-4 justify-between items-center",children:[(0,t.jsx)(i.__J,{size:"14",color:"subtle",noWrap:!0,className:"w-[100px]",children:"Uptime"}),(0,t.jsx)("div",{className:"flex-1 flex justify-end overflow-hidden -mr-0.5 pr-0.5",children:(0,t.jsx)(i.xvT,{size:"14",children:(0,x.bc)(g,{format:"long"})})})]}),(0,t.jsxs)("div",{className:"flex gap-4 justify-between items-center",children:[(0,t.jsx)(i.__J,{size:"14",color:"subtle",noWrap:!0,className:"w-[100px]",children:"Network"}),(0,t.jsx)("div",{className:"flex-1 flex justify-end overflow-hidden -mr-0.5 pr-0.5",children:(0,t.jsx)(i.xvT,{size:"14",children:null===(c=j.data)||void 0===c?void 0:c.network})})]}),(0,t.jsxs)("div",{className:"flex gap-4 justify-between items-center",children:[(0,t.jsx)(i.__J,{size:"14",color:"subtle",noWrap:!0,className:"w-[100px]",children:"Version"}),(0,t.jsx)(i.rUS,{size:"14",href:v,underline:"hover",target:"_blank",ellipsis:!0,children:null===(a=j.data)||void 0===a?void 0:a.version})]})]})}function j(){let e=(0,l.d_)({config:{swr:{revalidateOnFocus:!1}}});return e.data&&"Mainnet"!==e.data.network?(0,t.jsx)(i.t6k,{testnetName:e.data.network}):null}function h(e){let s=(0,l.X2)(),{isSynced:n}=(0,o.n)();return(0,t.jsx)(i.tU3,{appName:"renterd",profile:(0,t.jsx)(u,{}),banner:(0,t.jsx)(j,{}),connectivityRoute:a.h,isSynced:n,walletBalanceSc:s.data&&{spendable:new(c())(s.data.spendable),confirmed:new(c())(s.data.confirmed),unconfirmed:new(c())(s.data.unconfirmed)},...e})}},97992:function(e,s,n){"use strict";n.d(s,{e:function(){return o}});var t=n(52322),i=n(36655),l=n(61020),r=n(82851),c=n(98334),a=n(87764);function o(){let{totals:e}=(0,a.Z)(),s=e.all===e.info;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.KJW,{title:"Files",route:c._.buckets.index,children:(0,t.jsx)(l.ROc,{})}),(0,t.jsx)(i.KJW,{title:"Configuration",route:c._.config.index,children:(0,t.jsx)(l.wWN,{})}),(0,t.jsx)(i.KJW,{title:"Contracts",route:c._.contracts.index,children:(0,t.jsx)(l.VBo,{})}),(0,t.jsx)(i.KJW,{title:"Hosts",route:c._.hosts.index,children:(0,t.jsx)(l.VHe,{})}),(0,t.jsx)(i.KJW,{title:"S3 authentication keypairs",route:c._.keys.index,children:(0,t.jsx)(l._m8,{})}),(0,t.jsxs)("div",{className:"relative",children:[e.all?s?(0,t.jsx)("div",{className:(0,r.cx)("absolute -right-[2px] top-px w-1 h-1","rounded-full","bg-gray-1000 dark:bg-white","pointer-events-none")}):(0,t.jsx)(i.xvT,{size:"10",className:(0,r.cx)("absolute -right-[9px] -top-1 py-px px-[5px]","text-white","bg-red-500 dark:bg-red-500 rounded","pointer-events-none"),color:"none",children:e.all.toLocaleString()}):null,(0,t.jsx)(i.KJW,{title:"Alerts",route:c._.alerts.index,children:(0,t.jsx)(l.Dkj,{})})]})]})}},44111:function(e,s,n){"use strict";n.r(s),n.d(s,{default:function(){return _}});var t=n(52322),i=n(97992),l=n(98334),r=n(97112),c=n(91362),a=n(36655),o=n(61020),d=n(73076);function x(){let{configurableColumns:e,toggleColumnVisibility:s,resetDefaultColumnVisibility:n,enabledColumns:i}=(0,d.x)();return(0,t.jsxs)(a.J2e,{trigger:(0,t.jsxs)(a.zxk,{size:"small",tip:"Configure view",tipAlign:"end",children:[(0,t.jsx)(o.hiv,{}),"View",(0,t.jsx)(o.EMN,{})]}),contentProps:{align:"end",className:"max-w-[300px]"},children:[(0,t.jsxs)(a.WVB,{children:[(0,t.jsx)(a.__J,{children:"Display properties"}),(0,t.jsx)(a.kFS,{children:(0,t.jsx)(a.zxk,{onClick:e=>{e.stopPropagation(),n()},children:"Reset default"})})]}),(0,t.jsx)(a.WVB,{children:(0,t.jsx)(a.j4H,{options:e.map(e=>({label:e.label,value:e.id})),values:i,onChange:e=>s(e)})})]})}function u(){return(0,t.jsx)("div",{className:"flex gap-2",children:(0,t.jsx)(x,{})})}function j(){let{limit:e,pageCount:s,dataState:n,nextMarker:i,hasMore:l}=(0,d.x)();return(0,t.jsxs)("div",{className:"flex gap-3 w-full",children:[(0,t.jsx)("div",{className:"flex-1"}),(0,t.jsx)(a._5,{marker:i,isMore:l,limit:e,pageTotal:s,isLoading:"loading"===n})]})}function h(){return(0,t.jsxs)("div",{className:"flex flex-col gap-10 justify-center items-center h-[400px]",children:[(0,t.jsx)(a.xvT,{children:(0,t.jsx)(o.Ckx,{className:"scale-[200%]"})}),(0,t.jsx)(a.xvT,{color:"subtle",className:"text-center max-w-[500px]",children:"Error fetching uploads."})]})}var f=n(41736);function m(){let{filters:e,resetFilters:s}=(0,f.b)();return(0,t.jsxs)("div",{className:"flex flex-col gap-10 justify-center items-center h-[400px]",children:[(0,t.jsx)(a.xvT,{children:(0,t.jsx)(o.Hb6,{className:"scale-[200%]"})}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 items-center",children:[(0,t.jsx)(a.xvT,{color:"subtle",className:"text-center max-w-[500px]",children:"No uploads matching filters."}),!!e.length&&(0,t.jsx)(a.zxk,{onClick:e=>{e.stopPropagation(),s()},children:"Clear filters"})]})]})}function p(){let{activeBucketName:e}=(0,f.b)();return(0,t.jsxs)("div",{className:"flex flex-col gap-10 justify-center items-center h-[400px]",children:[(0,t.jsx)(a.xvT,{children:(0,t.jsx)(o.Y9T,{className:"scale-[200%]"})}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 items-center",children:[(0,t.jsxs)(a.xvT,{color:"subtle",className:"text-center max-w-[500px]",children:["The ",(0,t.jsx)(a.EKh,{children:e})," bucket does not have any active uploads."]}),(0,t.jsx)(a.Qjf,{href:l._.buckets.index,onClick:e=>{e.stopPropagation()},children:"View buckets list"})]})]})}function v(){let{dataState:e}=(0,d.x)();return"noneMatchingFilters"===e?(0,t.jsx)(m,{}):"error"===e?(0,t.jsx)(h,{}):"noneYet"===e?(0,t.jsx)(p,{}):null}var g=n(88778);function b(){let{sortableColumns:e,toggleSort:s,datasetPage:n,dataState:i,sortField:l,sortDirection:r}=(0,d.x)();return(0,t.jsx)("div",{className:"relative",children:(0,t.jsx)(a.iA_,{isLoading:"loading"===i,emptyState:(0,t.jsx)(v,{}),pageSize:10,data:n,columns:g.z,sortableColumns:e,sortField:l,sortDirection:r,toggleSort:s,rowSize:"dense"})})}var w=n(17398);function N(){let{activeBucketName:e,setActiveDirectory:s}=(0,f.b)();return(0,t.jsxs)("div",{className:"flex gap-2 items-center h-full",children:[(0,t.jsx)(w.C,{}),(0,t.jsx)(a.xrM,{children:(0,t.jsxs)("div",{className:"flex gap-1 items-center h-full",children:[(0,t.jsx)(a.xvT,{onClick:()=>s(()=>[]),size:"18",weight:"semibold",className:"flex items-center cursor-pointer",noWrap:!0,children:"Buckets"}),(0,t.jsx)(a.xvT,{size:"16",color:"verySubtle",className:"flex items-center",children:(0,t.jsx)(o.F3j,{})}),(0,t.jsx)(a.xvT,{onClick:()=>s(()=>[e]),size:"18",weight:"semibold",className:"flex items-center cursor-pointer",noWrap:!0,children:e}),(0,t.jsx)(a.xvT,{size:"16",color:"verySubtle",className:"flex items-center",children:(0,t.jsx)(o.F3j,{})}),(0,t.jsx)(a.xvT,{size:"18",weight:"semibold",className:"flex items-center cursor-pointer",noWrap:!0,children:"Uploads"})]})})]})}function k(){let{openDialog:e}=(0,r.Rh)();return(0,t.jsx)(c.J,{title:"Uploads",navTitle:null,routes:l._,sidenav:(0,t.jsx)(i.e,{}),nav:(0,t.jsx)(N,{}),stats:(0,t.jsx)(j,{}),actions:(0,t.jsx)(u,{}),openSettings:()=>e("settings"),children:(0,t.jsx)("div",{className:"p-6 min-w-fit",children:(0,t.jsx)(b,{})})})}function _(){return(0,t.jsx)(k,{})}}},function(e){e.O(0,[774,888,179],function(){return e(e.s=56592)}),_N_E=e.O()}]);
\ No newline at end of file
diff --git a/renterd/assets/_next/static/chunks/pages/buckets/[bucket]/uploads-f3223af501a990c8.js b/renterd/assets/_next/static/chunks/pages/buckets/[bucket]/uploads-f3223af501a990c8.js
deleted file mode 100644
index ae4dc3973..000000000
--- a/renterd/assets/_next/static/chunks/pages/buckets/[bucket]/uploads-f3223af501a990c8.js
+++ /dev/null
@@ -1 +0,0 @@
-(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[264],{56592:function(e,s,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/buckets/[bucket]/uploads",function(){return n(44111)}])},17398:function(e,s,n){"use strict";n.d(s,{C:function(){return o}});var t=n(52322),i=n(36655),l=n(61020),r=n(41736),c=n(73076);function a(){let{activeExplorerMode:e,setExplorerModeDirectory:s,setExplorerModeFlat:n}=(0,r.b)(),{isViewingUploads:a,navigateToUploads:o}=(0,c.x)();return(0,t.jsxs)(i.h_2,{trigger:(0,t.jsx)(i.zxk,{tipSide:"bottom",tip:a?"Viewing uploads":"directory"===e?"Viewing directory explorer":"Viewing all bucket files",children:a?(0,t.jsx)(l.bQp,{}):"directory"===e?(0,t.jsx)(l.Qbr,{}):(0,t.jsx)(l.nDH,{})}),contentProps:{align:"start",side:"bottom",className:"max-w-[300px]"},children:[(0,t.jsxs)(i.Xiv,{onSelect:s,children:[(0,t.jsx)(i.KpP,{children:(0,t.jsx)(l.Qbr,{})}),"Directory"]}),(0,t.jsxs)(i.Xiv,{onSelect:n,children:[(0,t.jsx)(i.KpP,{children:(0,t.jsx)(l.nDH,{})}),"All files"]}),(0,t.jsxs)(i.Xiv,{onSelect:o,children:[(0,t.jsx)(i.KpP,{children:(0,t.jsx)(l.bQp,{})}),"Uploads"]})]})}function o(){let{isViewingBuckets:e}=(0,r.b)();return e?(0,t.jsx)(i.ua7,{content:"Viewing all buckets",children:(0,t.jsx)("div",{children:(0,t.jsx)(i.zxk,{state:"waiting",children:(0,t.jsx)(l.fi8,{size:16})})})}):(0,t.jsx)(a,{})}},91362:function(e,s,n){"use strict";n.d(s,{J:function(){return h}});var t=n(52322),i=n(36655),l=n(57016),r=n(6391),c=n.n(r),a=n(98334),o=n(38855),d=n(97112),x=n(21487);function u(){var e,s,n,r,c,a;let{openDialog:u}=(0,d.Rh)(),j=(0,l.d_)({config:{swr:{revalidateOnFocus:!1}}}),h=(0,l.X2)({config:{swr:{revalidateOnFocus:!1}}}),f=(0,l.cQ)(),m=(0,o.n)(),p=null===(e=j.data)||void 0===e?void 0:e.version,v="?"===p?"https://github.com/SiaFoundation/renterd/commits/":(null==p?void 0:p.match(/^v\d+\.\d+\.\d+/))?"https://github.com/SiaFoundation/renterd/releases/".concat(p):"https://github.com/SiaFoundation/renterd/tree/".concat(p),g=j.data?new Date().getTime()-new Date(null===(s=j.data)||void 0===s?void 0:s.startTime).getTime():0;return(0,t.jsxs)(i.HfT,{name:"renterd",peerCount:null===(n=f.data)||void 0===n?void 0:n.length,connectPeer:()=>u("connectPeer"),isSynced:m.isSynced,syncPercent:m.syncPercent,nodeBlockHeight:m.nodeBlockHeight,estimatedBlockHeight:m.estimatedBlockHeight,firstTimeSyncing:m.firstTimeSyncing,moreThan100BlocksToSync:m.moreThan100BlocksToSync,children:[(0,t.jsxs)("div",{className:"flex gap-4 justify-between items-center",children:[(0,t.jsx)(i.__J,{size:"14",color:"subtle",noWrap:!0,className:"w-[100px]",children:"Wallet address"}),(0,t.jsx)("div",{className:"flex-1 flex justify-end overflow-hidden -mr-0.5 pr-0.5",children:(0,t.jsx)(i.XxW,{size:"14",maxLength:50,value:null===(r=h.data)||void 0===r?void 0:r.address,type:"address"})})]}),j.data&&(0,t.jsxs)("div",{className:"flex gap-4 justify-between items-center",children:[(0,t.jsx)(i.__J,{size:"14",color:"subtle",noWrap:!0,className:"w-[100px]",children:"Uptime"}),(0,t.jsx)("div",{className:"flex-1 flex justify-end overflow-hidden -mr-0.5 pr-0.5",children:(0,t.jsx)(i.xvT,{size:"14",children:(0,x.bc)(g,{format:"long"})})})]}),(0,t.jsxs)("div",{className:"flex gap-4 justify-between items-center",children:[(0,t.jsx)(i.__J,{size:"14",color:"subtle",noWrap:!0,className:"w-[100px]",children:"Network"}),(0,t.jsx)("div",{className:"flex-1 flex justify-end overflow-hidden -mr-0.5 pr-0.5",children:(0,t.jsx)(i.xvT,{size:"14",children:null===(c=j.data)||void 0===c?void 0:c.network})})]}),(0,t.jsxs)("div",{className:"flex gap-4 justify-between items-center",children:[(0,t.jsx)(i.__J,{size:"14",color:"subtle",noWrap:!0,className:"w-[100px]",children:"Version"}),(0,t.jsx)(i.rUS,{size:"14",href:v,underline:"hover",target:"_blank",ellipsis:!0,children:null===(a=j.data)||void 0===a?void 0:a.version})]})]})}function j(){let e=(0,l.d_)({config:{swr:{revalidateOnFocus:!1}}});return e.data&&"Mainnet"!==e.data.network?(0,t.jsx)(i.t6k,{testnetName:e.data.network}):null}function h(e){let s=(0,l.X2)(),{isSynced:n}=(0,o.n)();return(0,t.jsx)(i.tU3,{appName:"renterd",profile:(0,t.jsx)(u,{}),banner:(0,t.jsx)(j,{}),connectivityRoute:a.h,isSynced:n,walletBalanceSc:s.data&&{spendable:new(c())(s.data.spendable),confirmed:new(c())(s.data.confirmed),unconfirmed:new(c())(s.data.unconfirmed)},...e})}},97992:function(e,s,n){"use strict";n.d(s,{e:function(){return o}});var t=n(52322),i=n(36655),l=n(61020),r=n(82851),c=n(98334),a=n(87764);function o(){let{totals:e}=(0,a.Z)(),s=e.all===e.info;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.KJW,{title:"Files",route:c._.buckets.index,children:(0,t.jsx)(l.ROc,{})}),(0,t.jsx)(i.KJW,{title:"Configuration",route:c._.config.index,children:(0,t.jsx)(l.wWN,{})}),(0,t.jsx)(i.KJW,{title:"Contracts",route:c._.contracts.index,children:(0,t.jsx)(l.VBo,{})}),(0,t.jsx)(i.KJW,{title:"Hosts",route:c._.hosts.index,children:(0,t.jsx)(l.VHe,{})}),(0,t.jsx)(i.KJW,{title:"S3 authentication keypairs",route:c._.keys.index,children:(0,t.jsx)(l._m8,{})}),(0,t.jsxs)("div",{className:"relative",children:[e.all?s?(0,t.jsx)("div",{className:(0,r.cx)("absolute -right-[2px] top-px w-1 h-1","rounded-full","bg-gray-1000 dark:bg-white","pointer-events-none")}):(0,t.jsx)(i.xvT,{size:"10",className:(0,r.cx)("absolute -right-[9px] -top-1 py-px px-[5px]","text-white","bg-red-500 dark:bg-red-500 rounded","pointer-events-none"),color:"none",children:e.all.toLocaleString()}):null,(0,t.jsx)(i.KJW,{title:"Alerts",route:c._.alerts.index,children:(0,t.jsx)(l.Dkj,{})})]})]})}},44111:function(e,s,n){"use strict";n.r(s),n.d(s,{default:function(){return _}});var t=n(52322),i=n(97992),l=n(98334),r=n(97112),c=n(91362),a=n(36655),o=n(61020),d=n(73076);function x(){let{configurableColumns:e,toggleColumnVisibility:s,resetDefaultColumnVisibility:n,enabledColumns:i}=(0,d.x)();return(0,t.jsxs)(a.J2e,{trigger:(0,t.jsxs)(a.zxk,{size:"small",tip:"Configure view",tipAlign:"end",children:[(0,t.jsx)(o.hiv,{}),"View",(0,t.jsx)(o.EMN,{})]}),contentProps:{align:"end",className:"max-w-[300px]"},children:[(0,t.jsxs)(a.WVB,{children:[(0,t.jsx)(a.__J,{children:"Display properties"}),(0,t.jsx)(a.kFS,{children:(0,t.jsx)(a.zxk,{onClick:e=>{e.stopPropagation(),n()},children:"Reset default"})})]}),(0,t.jsx)(a.WVB,{children:(0,t.jsx)(a.j4H,{options:e.map(e=>({label:e.label,value:e.id})),values:i,onChange:e=>s(e)})})]})}function u(){return(0,t.jsx)("div",{className:"flex gap-2",children:(0,t.jsx)(x,{})})}function j(){let{limit:e,pageCount:s,dataState:n,nextMarker:i,hasMore:l}=(0,d.x)();return(0,t.jsxs)("div",{className:"flex gap-3 w-full",children:[(0,t.jsx)("div",{className:"flex-1"}),(0,t.jsx)(a._5,{marker:i,isMore:l,limit:e,pageTotal:s,isLoading:"loading"===n})]})}function h(){return(0,t.jsxs)("div",{className:"flex flex-col gap-10 justify-center items-center h-[400px]",children:[(0,t.jsx)(a.xvT,{children:(0,t.jsx)(o.Ckx,{className:"scale-[200%]"})}),(0,t.jsx)(a.xvT,{color:"subtle",className:"text-center max-w-[500px]",children:"Error fetching uploads."})]})}var f=n(41736);function m(){let{filters:e,resetFilters:s}=(0,f.b)();return(0,t.jsxs)("div",{className:"flex flex-col gap-10 justify-center items-center h-[400px]",children:[(0,t.jsx)(a.xvT,{children:(0,t.jsx)(o.Hb6,{className:"scale-[200%]"})}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 items-center",children:[(0,t.jsx)(a.xvT,{color:"subtle",className:"text-center max-w-[500px]",children:"No uploads matching filters."}),!!e.length&&(0,t.jsx)(a.zxk,{onClick:e=>{e.stopPropagation(),s()},children:"Clear filters"})]})]})}function p(){let{activeBucketName:e}=(0,f.b)();return(0,t.jsxs)("div",{className:"flex flex-col gap-10 justify-center items-center h-[400px]",children:[(0,t.jsx)(a.xvT,{children:(0,t.jsx)(o.Y9T,{className:"scale-[200%]"})}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 items-center",children:[(0,t.jsxs)(a.xvT,{color:"subtle",className:"text-center max-w-[500px]",children:["The ",(0,t.jsx)(a.EKh,{children:e})," bucket does not have any active uploads."]}),(0,t.jsx)(a.Qjf,{href:l._.buckets.index,onClick:e=>{e.stopPropagation()},children:"View buckets list"})]})]})}function v(){let{dataState:e}=(0,d.x)();return"noneMatchingFilters"===e?(0,t.jsx)(m,{}):"error"===e?(0,t.jsx)(h,{}):"noneYet"===e?(0,t.jsx)(p,{}):null}var g=n(88778);function b(){let{sortableColumns:e,toggleSort:s,datasetPage:n,dataState:i,sortField:l,sortDirection:r}=(0,d.x)();return(0,t.jsx)("div",{className:"relative",children:(0,t.jsx)(a.iA_,{isLoading:"loading"===i,emptyState:(0,t.jsx)(v,{}),pageSize:10,data:n,columns:g.z,sortableColumns:e,sortField:l,sortDirection:r,toggleSort:s,rowSize:"dense"})})}var w=n(17398);function N(){let{activeBucketName:e,setActiveDirectory:s}=(0,f.b)();return(0,t.jsxs)("div",{className:"flex gap-2 items-center h-full",children:[(0,t.jsx)(w.C,{}),(0,t.jsx)(a.xrM,{children:(0,t.jsxs)("div",{className:"flex gap-1 items-center h-full",children:[(0,t.jsx)(a.xvT,{onClick:()=>s(()=>[]),size:"18",weight:"semibold",className:"flex items-center cursor-pointer",noWrap:!0,children:"Buckets"}),(0,t.jsx)(a.xvT,{size:"16",color:"verySubtle",className:"flex items-center",children:(0,t.jsx)(o.F3j,{})}),(0,t.jsx)(a.xvT,{onClick:()=>s(()=>[e]),size:"18",weight:"semibold",className:"flex items-center cursor-pointer",noWrap:!0,children:e}),(0,t.jsx)(a.xvT,{size:"16",color:"verySubtle",className:"flex items-center",children:(0,t.jsx)(o.F3j,{})}),(0,t.jsx)(a.xvT,{size:"18",weight:"semibold",className:"flex items-center cursor-pointer",noWrap:!0,children:"Uploads"})]})})]})}function k(){let{openDialog:e}=(0,r.Rh)();return(0,t.jsx)(c.J,{title:"Uploads",navTitle:null,routes:l._,sidenav:(0,t.jsx)(i.e,{}),nav:(0,t.jsx)(N,{}),stats:(0,t.jsx)(j,{}),actions:(0,t.jsx)(u,{}),openSettings:()=>e("settings"),children:(0,t.jsx)("div",{className:"p-6 min-w-fit",children:(0,t.jsx)(b,{})})})}function _(){return(0,t.jsx)(k,{})}}},function(e){e.O(0,[774,888,179],function(){return e(e.s=56592)}),_N_E=e.O()}]);
\ No newline at end of file
diff --git a/renterd/assets/alerts.html b/renterd/assets/alerts.html
index 5d215ddb3..ef4a07dab 100644
--- a/renterd/assets/alerts.html
+++ b/renterd/assets/alerts.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/renterd/assets/buckets.html b/renterd/assets/buckets.html
index 5d079a5b4..3b0680832 100644
--- a/renterd/assets/buckets.html
+++ b/renterd/assets/buckets.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/renterd/assets/buckets/[bucket]/files/[[...path]].html b/renterd/assets/buckets/[bucket]/files/[[...path]].html
index 4c0d30429..222ff5598 100644
--- a/renterd/assets/buckets/[bucket]/files/[[...path]].html
+++ b/renterd/assets/buckets/[bucket]/files/[[...path]].html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/renterd/assets/buckets/[bucket]/uploads.html b/renterd/assets/buckets/[bucket]/uploads.html
index 346b7f6ac..42bc63786 100644
--- a/renterd/assets/buckets/[bucket]/uploads.html
+++ b/renterd/assets/buckets/[bucket]/uploads.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/renterd/assets/config.html b/renterd/assets/config.html
index 29cd668d3..d5212ca5f 100644
--- a/renterd/assets/config.html
+++ b/renterd/assets/config.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/renterd/assets/contracts.html b/renterd/assets/contracts.html
index 9cdaee51f..32d0b0524 100644
--- a/renterd/assets/contracts.html
+++ b/renterd/assets/contracts.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/renterd/assets/hosts.html b/renterd/assets/hosts.html
index e332efc15..09300327e 100644
--- a/renterd/assets/hosts.html
+++ b/renterd/assets/hosts.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/renterd/assets/index.html b/renterd/assets/index.html
index d86e1f447..2f673a7b7 100644
--- a/renterd/assets/index.html
+++ b/renterd/assets/index.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/renterd/assets/keys.html b/renterd/assets/keys.html
index 78b9212ff..8b93b18c0 100644
--- a/renterd/assets/keys.html
+++ b/renterd/assets/keys.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/renterd/assets/login.html b/renterd/assets/login.html
index a5f655a42..188215dd8 100644
--- a/renterd/assets/login.html
+++ b/renterd/assets/login.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/renterd/assets/node.html b/renterd/assets/node.html
index 6ee0d2fff..84ef3b3d6 100644
--- a/renterd/assets/node.html
+++ b/renterd/assets/node.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/renterd/assets/wallet.html b/renterd/assets/wallet.html
index 0e0d3f5d4..e752b8f9d 100644
--- a/renterd/assets/wallet.html
+++ b/renterd/assets/wallet.html
@@ -1 +1 @@
-