/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
import { DividerLabel } from "./DividerLabel.js";
import { DividerLine } from "./DividerLine.js";
import { Children, cloneElement, isValidElement } from "react";
//#region src/components/Divider/utils.ts
function isDividerLineElement(child) {
	return isValidElement(child) && child.type === DividerLine;
}
function isDividerLabelElement(child) {
	return isValidElement(child) && child.type === DividerLabel;
}
function hasManualLine(children) {
	return Children.toArray(children).some((child) => isDividerLineElement(child));
}
function shouldWrapInLabel(children) {
	return Children.toArray(children).every((child) => typeof child === "string" || typeof child === "number");
}
function renderManualChildren(children, variant, vertical) {
	return Children.map(children, (child) => {
		if (isDividerLineElement(child)) return cloneElement(child, {
			variant: child.props.variant ?? variant,
			vertical: child.props.vertical ?? vertical
		});
		if (isDividerLabelElement(child)) return cloneElement(child, { variant: child.props.variant ?? variant });
		return child;
	});
}
//#endregion
export { hasManualLine, renderManualChildren, shouldWrapInLabel };
