import{ao as e,aq as l,bN as I,L as S,b2 as A,az as i,aj as E,aI as T,aQ as k,b5 as w,bm as _,f as r,e as m,a_ as B,iA as G,ba as H}from"./app-k0jcl5PQ.js";import{A as O}from"./wCY37Ze3.chunk.js";import{B as R}from"./CCtuxSlD.chunk.js";import{u as y}from"./CAxN5LKv.chunk.js";import{a as F,L as P}from"./N1H32_hG.chunk.js";import{L as n}from"./F6ooBnzv.chunk.js";import"./CPXlV0fg.chunk.js";import"./DIAJ896Y.chunk.js";import"./BojVbZw0.chunk.js";const b="settings.localCacheInfo";function U(a){const{localCache:d,stats:o,updates:t}=a,{storageFree:h=0,storageUsed:c=0,count:p=0}=o,x=((+h+ +c)/1024/1024/1024).toFixed(0);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"d-flex justify-content-between mb-2",children:[e.jsx("div",{className:"font-label",children:e.jsx(l,{namespace:b,phrase:"name"})}),d.deviceName]}),e.jsxs("div",{className:"d-flex justify-content-between mb-2",children:[e.jsx("div",{className:"font-label",children:e.jsx(l,{namespace:b,phrase:"cacheSize"})}),x," GB"]}),e.jsxs("div",{className:"d-flex justify-content-between mb-2",children:[e.jsx("div",{className:"font-label",children:e.jsx(l,{namespace:b,phrase:"totalVideos"})}),+p]}),e.jsxs("div",{className:"d-flex justify-content-between mb-2",children:[e.jsx("div",{className:"font-label",children:e.jsx(l,{namespace:b,phrase:"currentVersion"})}),t.currentBuild?t.currentBuild.version:e.jsx(e.Fragment,{})]})]})}const v="settings.localCache",s=S.encloseNamespace(v);function D(a,d){const o=[{name:s("settings"),appLink:{application:m.SETTINGS,action:r.Settings.HOME}},{name:s("breadcrumb"),appLink:{application:m.SETTINGS,action:r.Settings.LOCAL_CACHES},active:d.length===1}];return d.length>1&&o.push({name:a,active:!0}),o}function Y(a){var f;I({title:s("pageTitle")});const d=A(),o=i(E.currentUser()),t=i(n.device(a.deviceId)),h=i(n.devices()),c=i(n.updates(a.deviceId)),p=i(n.stats(a.deviceId)),x=i(n.channels(a.deviceId)),u=i(n.address(a.deviceId)),C=i(u.data&&n.ping(a.deviceId,u.data.httpsAddress));if(y([t,h,c,p,x,u]),T.useEffect(()=>{const L=window.setInterval(()=>{d(n.device(a.deviceId)),d(n.updates(a.deviceId))},3e4);return()=>window.clearInterval(L)},[]),!(o.hasCompleted&&t.hasCompleted&&h.hasCompleted&&c.hasCompleted&&p.hasCompleted&&x.hasCompleted&&u.hasCompleted))return e.jsx(e.Fragment,{});const g=s("heading",{name:t.data.deviceName}),j=C.data==="PONG";let N="";return j||(N=t.data.status===F.Inactive?s("couldNotReachOffline"):s("couldNotReachNetwork")),e.jsxs("div",{className:"px-3",children:[e.jsxs("div",{className:"d-flex justify-content-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"h2",children:g}),e.jsx("div",{className:"pb-3",children:e.jsx(R,{breadcrumbs:D(g,h.data)})})]}),e.jsxs("div",{children:[e.jsx(k,{title:N,spanHack:!0,spanHackClassName:"d-inline-block align-middle",children:e.jsx(w,{svg:_,className:`btn btn-outline-dark ${j?"":"disabled cursor-default"}`,href:j&&u.data.httpsAddress,openInNewTab:!0,children:e.jsx(l,{namespace:v,phrase:"adminConsole"})})}),e.jsx(O,{dropdownToggleClassName:"btn btn-outline-dark ms-2",className:"d-inline-block",actions:[{label:s("rename"),appLink:{application:m.SETTINGS,action:r.Settings.RENAME_LOCAL_CACHE,args:[a.deviceId]}},{label:s("update"),appLink:{application:m.SETTINGS,action:r.Settings.UPDATE_LOCAL_CACHE,args:[a.deviceId]},className:c.data.updateAvailable?"":"disabled",disabled:!c.data.updateAvailable,tooltip:c.data.updateAvailable?null:s("uptoDate")},{label:s("delete"),appLink:{application:m.SETTINGS,action:r.Settings.DELETE_LOCAL_CACHE,args:[a.deviceId]},className:"text-danger"}]})]})]}),((f=c.data.currentBuild)==null?void 0:f.blacklistedPlayback)&&e.jsx("div",{className:"row",children:e.jsx("div",{className:"col-12 col-6-sm col-4-md",children:e.jsxs("div",{className:"alert alert-warning",children:[e.jsx(B,{svg:G,className:"align-middle me-2 svg-container"}),e.jsx(l,{namespace:v,phrase:"blacklistedPlayback"})," ",e.jsx(H,{appLink:{application:m.SETTINGS,action:r.Settings.UPDATE_LOCAL_CACHE,args:[a.deviceId]},className:"info-link",children:e.jsx(l,{namespace:v,phrase:"pleaseUpdate"})})]})})}),e.jsx("h2",{className:"h3",children:e.jsx(l,{namespace:v,phrase:"details"})}),e.jsxs("div",{className:"row mb-3",children:[e.jsx("div",{className:"col-12 col-sm-6 col-md-4 columns-of-five-lg",children:e.jsx(P,{localCache:t.data,canManage:!0,minimal:!0})}),e.jsx("div",{className:"col-12 col-sm-6 col-md-5",children:e.jsx(U,{localCache:t.data,stats:p.data,updates:c.data})})]})]})}export{Y as LocalCacheView};
//# sourceMappingURL=DKFAueAd.chunk.js.map
