import{p as T,z as F,F as A,r as D,av as N,v as C,c as $,L as I,u as E,J as o,ap as L,M as R,o as z,a3 as V,l as p,S as b,K as M,q as O,w as i,m as U,Q as k,a4 as q,$ as w,_ as y,V as J}from"./index-2a796b7e.js";import{m as K,V as Q,b as x}from"./VOverlay-c0aec02e.js";import{f as W}from"./forwardRefs-ab2b038b.js";import{u as j}from"./scopeId-32cc0eee.js";import{i as G,x as H}from"./VImg-9fff8259.js";import{V as X,c as P,b as h,a as Y}from"./VCard-e2c302fe.js";import{V as B}from"./VBtn-29a0de88.js";import"./VAvatar-c55f1640.js";import"./VProgressCircular-57c5ac59.js";import"./resizeObserver-a1e84c0c.js";const Z=T({fullscreen:Boolean,retainFocus:{type:Boolean,default:!0},scrollable:Boolean,...K({origin:"center center",scrollStrategy:"block",transition:{component:Q},zIndex:2400})},"VDialog"),ee=F()({name:"VDialog",props:Z(),emits:{"update:modelValue":a=>!0},setup(a,d){let{slots:s}=d;const c=A(a,"modelValue"),{scopeId:m}=j(),e=D();function t(n){var u,f;const l=n.relatedTarget,r=n.target;if(l!==r&&((u=e.value)!=null&&u.contentEl)&&((f=e.value)!=null&&f.globalTop)&&![document,e.value.contentEl].includes(r)&&!e.value.contentEl.contains(r)){const v=L(e.value.contentEl);if(!v.length)return;const _=v[0],S=v[v.length-1];l===_?S.focus():_.focus()}}N&&C(()=>c.value&&a.retainFocus,n=>{n?document.addEventListener("focusin",t):document.removeEventListener("focusin",t)},{immediate:!0}),C(c,async n=>{var l,r;await I(),n?(l=e.value.contentEl)==null||l.focus({preventScroll:!0}):(r=e.value.activatorEl)==null||r.focus({preventScroll:!0})});const g=$(()=>E({"aria-haspopup":"dialog","aria-expanded":String(c.value)},a.activatorProps));return G(()=>{const n=x.filterProps(a);return o(x,E({ref:e,class:["v-dialog",{"v-dialog--fullscreen":a.fullscreen,"v-dialog--scrollable":a.scrollable},a.class],style:a.style},n,{modelValue:c.value,"onUpdate:modelValue":l=>c.value=l,"aria-modal":"true",activatorProps:g.value,role:"dialog"},m),{activator:s.activator,default:function(){for(var l=arguments.length,r=new Array(l),u=0;u<l;u++)r[u]=arguments[u];return o(H,{root:"VDialog"},{default:()=>{var f;return[(f=s.default)==null?void 0:f.call(s,...r)]}})}})}),W({},e)}}),ae={class:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 p-4 bg-background"},te={class:""},fe=R({__name:"Devices",setup(a){const d=D(),s=D(!1),c=async function(m){await V.deleteDevice(m),d.value=await V.getAllDevices(!1),s.value=!0};return z(async()=>{d.value=await V.getAllDevices(!1)}),(m,e)=>(p(),b("div",ae,[(p(!0),b(M,null,O(d.value,(t,g)=>(p(),b("div",{key:g},[t.id!="9c0e0865-f3b0-488f-8d3f-b3b0cdda5de7"?(p(),U(h,{key:0,class:"m-4 max-w-sm elevation-2"},{default:i(()=>[o(X,null,{default:i(()=>[k("span",{class:q(["mdi pr-2",t.icon])},null,2),k("span",te,w(t.name),1)]),_:2},1024),o(P,null,{default:i(()=>[o(B,{class:"m-2",onClick:n=>c(t.id)},{default:i(()=>[y(w(m.$t("settings.delete_action")),1)]),_:2},1032,["onClick"])]),_:2},1024)]),_:2},1024)):J("",!0)]))),128)),o(ee,{modelValue:s.value,"onUpdate:modelValue":e[1]||(e[1]=t=>s.value=t),width:"auto"},{default:i(()=>[o(h,null,{default:i(()=>[o(Y,null,{default:i(()=>[y(" Please remove the device manually from the config file. ")]),_:1}),o(P,null,{default:i(()=>[o(B,{color:"primary",block:"",onClick:e[0]||(e[0]=t=>s.value=!1)},{default:i(()=>[y("Close")]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])]))}});export{fe as default};
