import{r as e}from"./rolldown-runtime-DIIn1E2Q.js";import{X as t}from"./vendor-primevue-DGevbYGF.js";import{Bt as n,D as r,F as i,G as a,I as o,K as s,M as c,Pt as l,R as u,Rt as d,U as f,Ut as p,_t as m,et as h,j as g,k as _,kt as v,rt as y,tt as b,ut as x}from"./vendor-vue-core-BdhYaYlO.js";import{D as S}from"./vendor-other-D9HJWI2D.js";import{n as C}from"./vendor-i18n-JubCsGQ_.js";import{a as w,i as T,lt as E,ut as D}from"./vendor-reka-ui-CSo89nDv.js";import{t as O}from"./src-zUtq9Eft.js";import{r as k}from"./widgetTypes-Lta44m93.js";import{a as A,o as j}from"./widgetPropFilter-C6hJUR5m.js";import{t as M}from"./layout-ClVoG198.js";import{t as N}from"./WidgetLayoutField-yd8wJePn.js";const P=Symbol(`toggleGroupVariant`),F=S({base:`flex items-center justify-center gap-1`,variants:{variant:{default:`bg-transparent`,outline:`bg-transparent`}},defaultVariants:{variant:`default`}}),I=S({base:[`inline-flex items-center justify-center rounded`,`border-none cursor-pointer appearance-none`,`text-center font-normal`,`transition-all duration-150 ease-in-out`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,`disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed`,`data-[state=on]:bg-interface-menu-component-surface-selected data-[state=on]:text-text-primary`],variants:{variant:{default:`bg-transparent hover:bg-interface-menu-component-surface-selected/50 text-text-secondary`,outline:`border border-border-default bg-transparent hover:bg-secondary-background text-text-secondary`},size:{default:`h-7 px-3 text-sm`,sm:`h-6 px-5 py-[5px] text-xs`,lg:`h-9 px-4 text-sm`}},defaultVariants:{variant:`default`,size:`default`}});var L=u({__name:`ToggleGroup`,props:{class:{},variant:{default:`default`},rovingFocus:{type:Boolean},disabled:{type:Boolean},orientation:{},dir:{},loop:{type:Boolean},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},type:{},modelValue:{},defaultValue:{}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=E(c(e,[`class`,`variant`]),t);return b(P,l(()=>e.variant)),(t,r)=>(h(),_(d(w),s(d(n),{class:d(O)(d(F)({variant:t.variant}),e.class)}),{default:m(()=>[y(t.$slots,`default`)]),_:3},16,[`class`]))}}),R=u({__name:`ToggleGroupItem`,props:{class:{},variant:{},size:{default:`default`},value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){let t=c(e,[`class`,`variant`,`size`]),n=f(P,v(`default`)),i=D(t),a=r(()=>e.variant??n.value??`default`);return(t,n)=>(h(),_(d(T),s(d(i),{class:d(O)(d(I)({variant:a.value,size:t.size}),`flex-1 min-w-0 truncate`,e.class)}),{default:m(()=>[y(t.$slots,`default`)]),_:3},16,[`class`]))}}),z=u({__name:`WidgetToggleSwitch`,props:a({widget:{}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let a=x(e,`modelValue`),c=k(),{t:l}=C(),u=r(()=>j(e.widget.options,A)),f=r(()=>e.widget.options?.on!=null||e.widget.options?.off!=null);function handleOptionChange(e){e&&(a.value=e===`on`)}return(e,r)=>(h(),_(N,{widget:e.widget},{default:m(()=>[f.value?(h(),_(d(L),{key:0,type:`single`,"model-value":a.value?`on`:`off`,disabled:!!e.widget.options?.read_only,class:n(d(O)(d(M),`w-full min-w-0 p-1 flex items-center justify-center gap-1`)),"onUpdate:modelValue":r[0]||=e=>handleOptionChange(e)},{default:m(()=>[o(d(R),{value:`off`,size:`sm`},{default:m(()=>[i(p(e.widget.options?.off??d(l)(`widgets.boolean.false`)),1)]),_:1}),o(d(R),{value:`on`,size:`sm`},{default:m(()=>[i(p(e.widget.options?.on??d(l)(`widgets.boolean.true`)),1)]),_:1})]),_:1},8,[`model-value`,`disabled`,`class`])):(h(),g(`div`,{key:1,class:n(d(O)(`flex w-fit items-center gap-2`,d(c)||`ml-auto`))},[o(d(t),s({modelValue:a.value,"onUpdate:modelValue":r[1]||=e=>a.value=e},u.value,{"aria-label":e.widget.name}),null,16,[`modelValue`,`aria-label`])],2))]),_:1},8,[`widget`]))}});export{z as default};
//# sourceMappingURL=WidgetToggleSwitch-DEdFAS9F.js.map