import{n as e,o as t}from"./rolldown-runtime-C0FnF6B9.js";import{t as n}from"./react-C21x__mS.js";import{n as r,t as i}from"./circle-check-CEAfOwEY.js";import{i as a,n as o,r as s}from"./iframe-GrlyTB2d.js";import{a as c,i as l}from"./utils-DUM89eIj.js";import{n as u,t as d}from"./ui.module-CiLQZm_L.js";var f,p;function m(){return(m=e((()=>{a(),f=[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}]],p=s(`ban`,f)})))()}var h,g,_,v,y;function b(){return(b=e((()=>{h=`Or5LYA`,g=`w0AMfA`,_=`P1x4lq`,v=`-ZVOZo`,y={switchWrapper:h,switch:`qge3io`,iconWrapper:g,auto:_,checked:v}})))()}function x(e){let{label:t,description:n,disabled:r,checkedIcon:a=(0,C.jsx)(i,{}),uncheckedIcon:o=(0,C.jsx)(p,{}),className:s,type:l,id:d,size:f,placeholder:m,onChange:h,value:g,triState:_,...v}=e,b=(0,S.useId)(),x=d??b,w=n?`${x}-description`:void 0,T=t?`${x}-label`:void 0,E=()=>{if(!e.triState){e.onChange(!e.value);return}if(e.value===void 0){e.onChange(!0);return}if(e.value===!0){e.onChange(!1);return}e.value===!1&&e.onChange(void 0)},D=typeof e.value==`boolean`&&e.value,O=e.triState&&typeof e.value!=`boolean`,k=v[`aria-label`]??(t?void 0:`Переключатель`);return(0,C.jsxs)(`div`,{className:c(u.uiElement,r&&u.disabled),"aria-disabled":r||void 0,children:[t&&(0,C.jsxs)(`div`,{id:T,className:u.uiLabel,children:[t,`:`]}),n&&(0,C.jsx)(`p`,{id:w,className:u.uiDescription,children:n}),(0,C.jsx)(`button`,{...v,id:x,type:l??`button`,role:`switch`,disabled:r,"aria-checked":D,"aria-describedby":w,"aria-labelledby":T,"aria-label":k,"aria-disabled":r,"data-ui":`switch`,"data-action":`toggle-switch`,onClick:E,className:c(u.uiInputControl,y.switchWrapper,s),children:(0,C.jsx)(`div`,{className:y.switch,"data-disabled":r||void 0,children:O?(0,C.jsx)(`div`,{className:c(y.iconWrapper,y.auto,y.checked),children:`Auto`}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`div`,{className:c(y.iconWrapper,!e.value&&y.checked),children:o}),(0,C.jsx)(`div`,{className:c(y.iconWrapper,e.value&&y.checked),children:a})]})})})]})}var S,C;function w(){return(w=e((()=>{S=t(n(),1),l(),m(),r(),d(),b(),C=o(),x.__docgenInfo={description:`Переключатель boolean-состояния в виде слайдера. Подходит для быстрых настроек и включения/отключения опций.`,methods:[],displayName:`Switch`}})))()}export{w as n,x as t};