"use client";
const require_create_split_props = require("../../utils/create-split-props.cjs");
const require_factory = require("../factory.cjs");
const require_use_switch_context = require("./use-switch-context.cjs");
const require_use_switch = require("./use-switch.cjs");
let react = require("react");
let _zag_js_react = require("@zag-js/react");
let react_jsx_runtime = require("react/jsx-runtime");
//#region src/components/switch/switch-root.tsx
var splitRootProps = require_create_split_props.createSplitProps();
var SwitchRoot = (0, react.forwardRef)((props, ref) => {
	const [useSwitchProps, localProps] = splitRootProps(props, [
		"checked",
		"defaultChecked",
		"disabled",
		"form",
		"id",
		"ids",
		"invalid",
		"label",
		"name",
		"onCheckedChange",
		"readOnly",
		"required",
		"value"
	]);
	const switchContext = require_use_switch.useSwitch(useSwitchProps);
	const mergedProps = (0, _zag_js_react.mergeProps)(switchContext.getRootProps(), localProps);
	return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_use_switch_context.SwitchProvider, {
		value: switchContext,
		children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.ark.label, {
			...mergedProps,
			ref
		})
	});
});
SwitchRoot.displayName = "SwitchRoot";
//#endregion
exports.SwitchRoot = SwitchRoot;
