import { h as e } from "./chunk.BlbRoQQ3.js";
import { a9 as t, ab as n, aj as r, ao as i } from "./system.DbMQd1I1.js";
import * as a from "react";
const o = {
	width: {
		type: "string",
		className: "rt-r-w",
		customProperties: ["--width"],
		responsive: !0
	},
	minWidth: {
		type: "string",
		className: "rt-r-min-w",
		customProperties: ["--min-width"],
		responsive: !0
	},
	maxWidth: {
		type: "string",
		className: "rt-r-max-w",
		customProperties: ["--max-width"],
		responsive: !0
	}
}, s = { highContrast: {
	type: "boolean",
	className: "rt-high-contrast",
	default: void 0
} }, c = [
	"normal",
	"start",
	"end",
	"both"
], l = { trim: {
	type: "enum",
	className: "rt-r-lt",
	values: c,
	responsive: !0
} }, u = [
	"left",
	"center",
	"right"
], d = { align: {
	type: "enum",
	className: "rt-r-ta",
	values: u,
	responsive: !0
} }, f = [
	"wrap",
	"nowrap",
	"pretty",
	"balance"
], p = { wrap: {
	type: "enum",
	className: "rt-r-tw",
	values: f,
	responsive: !0
} }, m = { truncate: {
	type: "boolean",
	className: "rt-truncate"
} }, h = [
	"light",
	"regular",
	"medium",
	"bold"
], g = { weight: {
	type: "enum",
	className: "rt-r-weight",
	values: h,
	responsive: !0
} }, _ = [
	"initial",
	"xs",
	"sm",
	"md",
	"lg",
	"xl"
];
function v(e, t) {
	return Object.prototype.hasOwnProperty.call(e, t);
}
function y(e) {
	return typeof e == "object" && Object.keys(e).some((e) => _.includes(e));
}
function b({ className: e, customProperties: t,...n }) {
	let r = x({
		allowArbitraryValues: !0,
		className: e,
		...n
	}), i = C({
		customProperties: t,
		...n
	});
	return [r, i];
}
function x({ allowArbitraryValues: e, value: t, className: n, propValues: r, parseValue: i = (e) => e }) {
	let a = [];
	if (t) {
		if (typeof t == "string" && r.includes(t)) return S(n, t, i);
		if (y(t)) {
			let o = t;
			for (let t in o) {
				if (!v(o, t) || !_.includes(t)) continue;
				let s = o[t];
				if (s !== void 0) {
					if (r.includes(s)) {
						let e = S(n, s, i), r = t === "initial" ? e : `${t}:${e}`;
						a.push(r);
					} else if (e) {
						let e = t === "initial" ? n : `${t}:${n}`;
						a.push(e);
					}
				}
			}
			return a.join(" ");
		}
		if (e) return n;
	}
}
function S(e, t, n) {
	let r = e ? "-" : "", i = n(t), a = i?.startsWith("-"), o = a ? "-" : "", s = a ? i?.substring(1) : i;
	return `${o}${e}${r}${s}`;
}
function C({ customProperties: e, value: t, propValues: n, parseValue: r = (e) => e }) {
	let i = {};
	if (!(!t || typeof t == "string" && n.includes(t))) {
		if (typeof t == "string" && (i = Object.fromEntries(e.map((e) => [e, t]))), y(t)) {
			let r = t;
			for (let t in r) {
				if (!v(r, t) || !_.includes(t)) continue;
				let a = r[t];
				if (!n.includes(a)) for (let n of e) i = {
					[t === "initial" ? n : `${n}-${t}`]: a,
					...i
				};
			}
		}
		for (let e in i) {
			let t = i[e];
			t !== void 0 && (i[e] = r(t));
		}
		return i;
	}
}
function w(...e) {
	let t = {};
	for (let n of e) n && (t = {
		...t,
		...n
	});
	return Object.keys(t).length ? t : void 0;
}
var T = /* @__PURE__ */ e(r());
function E(...e) {
	return Object.assign({}, ...e);
}
function D(e, ...t) {
	let n, r, i = { ...e }, a = E(...t);
	for (let e in a) {
		let t = i[e], o = a[e];
		if (o.default !== void 0 && t === void 0 && (t = o.default), o.type === "enum" && ![o.default, ...o.values].includes(t) && !y(t) && (t = o.default), i[e] = t, "className" in o && o.className) {
			delete i[e];
			let a = "responsive" in o;
			if (!t || y(t) && !a) continue;
			if (y(t) && (o.default !== void 0 && t.initial === void 0 && (t.initial = o.default), o.type === "enum" && ([o.default, ...o.values].includes(t.initial) || (t.initial = o.default))), o.type === "enum") {
				let e = x({
					allowArbitraryValues: !1,
					value: t,
					className: o.className,
					propValues: o.values,
					parseValue: o.parseValue
				});
				n = (0, T.default)(n, e);
				continue;
			}
			if (o.type === "string" || o.type === "enum | string") {
				let e = o.type === "string" ? [] : o.values, [i, a] = b({
					className: o.className,
					customProperties: o.customProperties,
					propValues: e,
					parseValue: o.parseValue,
					value: t
				});
				r = w(r, a), n = (0, T.default)(n, i);
				continue;
			}
			if (o.type === "boolean" && t) {
				n = (0, T.default)(n, o.className);
				continue;
			}
		}
	}
	return i.className = (0, T.default)(n, e.className), i.style = w(r, e.style), i;
}
const O = [
	"0",
	"1",
	"2",
	"3",
	"4",
	"5",
	"6",
	"7",
	"8",
	"9",
	"-1",
	"-2",
	"-3",
	"-4",
	"-5",
	"-6",
	"-7",
	"-8",
	"-9"
], k = {
	m: {
		type: "enum | string",
		values: O,
		responsive: !0,
		className: "rt-r-m",
		customProperties: ["--m"]
	},
	mx: {
		type: "enum | string",
		values: O,
		responsive: !0,
		className: "rt-r-mx",
		customProperties: ["--ml", "--mr"]
	},
	my: {
		type: "enum | string",
		values: O,
		responsive: !0,
		className: "rt-r-my",
		customProperties: ["--mt", "--mb"]
	},
	mt: {
		type: "enum | string",
		values: O,
		responsive: !0,
		className: "rt-r-mt",
		customProperties: ["--mt"]
	},
	mr: {
		type: "enum | string",
		values: O,
		responsive: !0,
		className: "rt-r-mr",
		customProperties: ["--mr"]
	},
	mb: {
		type: "enum | string",
		values: O,
		responsive: !0,
		className: "rt-r-mb",
		customProperties: ["--mb"]
	},
	ml: {
		type: "enum | string",
		values: O,
		responsive: !0,
		className: "rt-r-ml",
		customProperties: ["--ml"]
	}
}, A = [
	"span",
	"div",
	"label",
	"p"
], j = [
	"1",
	"2",
	"3",
	"4",
	"5",
	"6",
	"7",
	"8",
	"9"
], M = {
	as: {
		type: "enum",
		values: A,
		default: "span"
	},
	...n,
	size: {
		type: "enum",
		className: "rt-r-size",
		values: j,
		responsive: !0
	},
	...g,
	...d,
	...l,
	...m,
	...p,
	...t,
	...s
};
var N = /* @__PURE__ */ e(r());
const P = a.forwardRef((e, t) => {
	let { children: n, className: r, asChild: o, as: s = "span", color: c,...l } = D(e, M, k);
	return a.createElement(i, {
		"data-accent-color": c,
		...l,
		ref: t,
		className: (0, N.default)("rt-Text", r)
	}, o ? n : a.createElement(s, null, n));
});
P.displayName = "Text";
export { P as b, k as c, D as d, w as e, b as f, x as g, g as h, m as i, p as j, d as k, l, s as m, o as n };

//# sourceMappingURL=text.CvSXsyI-.js.map