"use client"
import{b as u}from"./chunk-O4B2G523.mjs";import{l as n}from"./chunk-EOVN2AF5.mjs";import*as i from"@radix-ui/react-switch";import{useMemo as f}from"react";import{jsx as t}from"react/jsx-runtime";function S({fn:r,trackDimensions:h,thumbDimensions:d,thumbTranslate:s,checked:m=!0,loading:o=!1,disabled:a=!1,disabledTooltip:e}){let c=f(()=>e?!0:a||o,[e,a,o]),l=t(i.Root,{checked:o?!1:m,name:"switch",...r&&{onCheckedChange:r},disabled:c,className:n("radix-state-checked:bg-blue-500 radix-state-unchecked:bg-gray-200 relative inline-flex h-4 w-8 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring focus-visible:ring-blue-500 focus-visible:ring-opacity-75",c&&"cursor-not-allowed",h),children:t(i.Thumb,{className:n(`radix-state-checked:${s}`,"radix-state-unchecked:translate-x-0","pointer-events-none h-3 w-3 translate-x-4 transform rounded-full bg-white shadow-lg ring-0 transition duration-200 ease-in-out",d,s)})});return e?t(u,{content:e,children:t("div",{children:l})}):l}export{S as a};
