import{d as f,c as r,o,w as a,aj as u,e as n,u as l,f as t,n as i,i as T,t as d,aw as m,an as b}from"./DnBXlrVC.js";import{a as c,b as C,T as k}from"./K6vzxPhR.js";import"./b0zdy1x6.js";const w=["for"],B=["data-state","disabled"],y=f({__name:"UiEditorSwitch",props:{pressed:{type:Boolean},disabled:{type:Boolean},tooltip:{},label:{},onClick:{},classes:{},offset:{default:4}},setup(E){return(e,s)=>(o(),r(l(k),null,{default:a(()=>[u(l(c),{class:"TOOLTIP_TRIGGER"},{default:a(()=>[t("div",{class:i(["group flex items-center gap0.5",e.classes])},[e.label?(o(),T("label",{key:0,for:e.label,class:"LABEL"},d(e.label),9,w)):n("",!0),t("button",{role:"switch","data-state":e.pressed?"on":"off",disabled:e.disabled?!0:void 0,class:i(["TOGGLE_SWITCH",e.classes]),onClick:s[0]||(s[0]=(...p)=>e.onClick&&e.onClick(...p)),onMousedown:s[1]||(s[1]=m(()=>{},["prevent"]))},[t("span",{class:i(e.pressed&&"translate-x-full")},null,2)],42,B)],2)]),_:1}),e.tooltip&&!e.disabled?(o(),r(l(C),{key:0,offset:e.offset,class:"TOOLTIP_CONTENT"},{default:a(()=>[b(d(e.tooltip),1)]),_:1},8,["offset"])):n("",!0)]),_:1}))}});export{y as default};
