import{n as e}from"./rolldown-runtime-DAXXjFlN.js";import{Cr as t,Fn as n,Fr as r,Mn as i,Pn as a,Rn as o,Vn as s,Wr as c,ar as l,dn as u,vr as d,yr as f,zn as p}from"./vendor-6bGPahzI.js";import{At as m,Ft as h,It as g,Mt as _,Nt as v,Pt as y,S as b,Ut as x,Wt as S,b as C,jt as w,kt as T,nt as E,tt as D,x as O,y as k}from"./vendor-quasar-Bl8FKFQs.js";import{Bi as A,Da as j,Fi as M,Ki as N,Ni as P,Oa as F,qi as I,zi as L}from"./ws-BfVPV0ME.js";import{o as R,s as z}from"./index-BfA-u3L9.js";import{n as B,t as V}from"./CTooltip-Cuxty1Ws.js";var H,U,W=e((()=>{B(),b(),g(),_(),C(),m(),y(),S(),E(),u(),L(),R(),I(),H={class:`text-h6`},U=s({__name:`SleepTimerBadge`,setup(e){let s=z(),u=r(!1),m=r(``);function g(){let e=new Date;m.value=`${e.getHours().toString().padStart(2,`0`)}:${e.getMinutes().toString().padStart(2,`0`)}`,u.value=!0}function _(){if(!m.value)return;let e=new Date,[t,n]=m.value.split(`:`).map(Number);if(t===void 0||n===void 0)return;let r=new Date(e);r.setHours(t,n,0,0),r<=e&&r.setDate(r.getDate()+1);let i=r.getTime()-e.getTime(),a=Math.floor(i/6e4);a>0&&s.startTimer(a),u.value=!1}function y(e){let t=new P;t.setItems([M(`15 Minutes`,()=>s.startTimer(15)),M(`30 Minutes`,()=>s.startTimer(30)),M(`45 Minutes`,()=>s.startTimer(45)),M(`1 Hour`,()=>s.startTimer(60)),M(`Custom...`,async()=>{g()}),A(),M(`Clear Timer`,()=>s.clearTimer())]),t.show(e)}return(e,r)=>{let g=V;return c(s).isActive?(l(),n(`div`,{key:0,class:`sleep-timer-badge`,onClick:y},[p(N,{name:`sleepTimer`,size:`18px`}),p(g,null,{default:d(()=>[o(t(c(s).formattedRemainingTime)+` remaining (Ends at `+t(c(s).endTimeFormatted)+`)`,1)]),_:1}),p(x,{modelValue:u.value,"onUpdate:modelValue":r[1]||=e=>u.value=e,class:`z-top`},{default:d(()=>[p(v,{style:{"min-width":`300px`}},{default:d(()=>[p(w,{class:`row items-center`},{default:d(()=>[i(`div`,H,t(e.$lz(`Set Sleep Timer`,`sleepTimer.setSleepTimer`)),1),p(O),f(p(h,{icon:`close`,flat:``,round:``,dense:``},null,512),[[D]])]),_:1}),p(w,{class:`flex flex-center`},{default:d(()=>[p(k,{modelValue:m.value,"onUpdate:modelValue":r[0]||=e=>m.value=e,format24h:``},null,8,[`modelValue`])]),_:1}),p(T,{align:`right`},{default:d(()=>[f(p(h,{flat:``,label:`Cancel`,color:`primary`},null,512),[[D]]),p(h,{flat:``,label:`Start`,color:`primary`,onClick:_})]),_:1})]),_:1})]),_:1},8,[`modelValue`])])):a(``,!0)}}})})),G=e((()=>{})),K,q=e((()=>{W(),W(),G(),F(),K=j(U,[[`__scopeId`,`data-v-6bceb368`]])}));export{q as n,K as t};