import{ao as a,aO as x,aU as o,aP as C,aq as i,L as h,bN as j,az as n,bu as L,aj as S,aI as I,v as b,f as v,e as E}from"./app-k0jcl5PQ.js";import{L as N}from"./N1H32_hG.chunk.js";import{S as U}from"./EHuWazu9.chunk.js";import{L as A}from"./F6ooBnzv.chunk.js";import"./BojVbZw0.chunk.js";import"./CCtuxSlD.chunk.js";import"./CPXlV0fg.chunk.js";import"./ApI7cEru.chunk.js";import"./DXxHdeNz.chunk.js";import"./CpGXOT1_.chunk.js";import"./DkDkjje4.chunk.js";import"./hKqzfsO4.chunk.js";import"./fstW5ZQE.chunk.js";import"./9ls1F1Ve.chunk.js";import"./DRKUY7jf.chunk.js";const g="settings.localCachesEmptyState";function w(t){return a.jsx(x.Provider,{value:g,children:a.jsxs(o,{children:[a.jsx(o.Image,{src:C.EmptyStates.LOCAL_CACHE}),a.jsx(o.Heading,{children:a.jsx(i,{phrase:"heading"})}),a.jsx(o.Info,{className:"w-50",children:a.jsx(i,{phrase:"info"})}),a.jsx(o.Cta,{href:t.config.localCacheUrl,className:"btn btn-dark",text:h.getPhrase(g,"download"),openInNewTab:!0})]})})}const u="settings.localCaches",c=h.encloseNamespace(u);function $(){var m,l,d,p;j({title:c("pageTitle")});const t=n(L.config()),s=n(S.currentUser()),e=n(A.devices());return I.useEffect(()=>{var r;s.hasCompleted&&((r=e.data)==null?void 0:r.length)===1&&e.data[0].customerId===s.data.customerId&&b.trigger({application:E.SETTINGS,action:v.Settings.LOCAL_CACHE,args:[e.data[0].deviceId]},{replace:!0})},[(m=e.data)==null?void 0:m.length,s.hasCompleted]),!e.hasCompleted||!s.data||!t.data?a.jsx(a.Fragment,{}):a.jsxs(U,{heading:c("heading"),breadcrumbs:[c("breadcrumb")],children:[(l=e.data)!=null&&l.length?a.jsxs(a.Fragment,{children:[a.jsx("p",{children:a.jsx(i,{namespace:u,phrase:"info",options:{downloadUrl:(d=t.data)==null?void 0:d.localCacheUrl}})}),a.jsx("hr",{})]}):a.jsx(w,{config:t.data}),a.jsx("div",{className:"row",children:(p=e.data)==null?void 0:p.map((r,f)=>a.jsx("div",{className:"col-12 col-sm-6 col-md-4 columns-of-five-lg mb-2",children:a.jsx(N,{localCache:r,canManage:r.customerId.toString()===s.data.customerId.toString()})},f))})]})}export{$ as LocalCachesView};
//# sourceMappingURL=BnDbjkid.chunk.js.map
