import { o as e } from "./resizable_utils-BComtrMV.js";
//#region components/resizable/composables/constraintResolver.ts
function t(e, t, n) {
	let r = e;
	return t !== void 0 && (r = Math.max(r, t)), n !== void 0 && (r = Math.min(r, n)), r;
}
function n(e, n, r = "system") {
	return t(e, r === "user" ? n.userMinSizePixels : n.systemMinSizePixels ?? n.userMinSizePixels, r === "user" ? n.userMaxSizePixels : n.systemMaxSizePixels ?? n.userMaxSizePixels);
}
function r(t, n) {
	return {
		userMinSizePixels: t.userMinSize ? e(t.userMinSize, n) : void 0,
		userMaxSizePixels: t.userMaxSize ? e(t.userMaxSize, n) : void 0
	};
}
function i(e, t) {
	return e === void 0 || t === void 0 ? e : Math.max(e, t);
}
function a(e, t) {
	return e === void 0 || t === void 0 ? e : Math.min(e, t);
}
function o(t, n, r, o) {
	let s = t.systemMinSize ? e(t.systemMinSize, n) : r, c = t.systemMaxSize ? e(t.systemMaxSize, n) : o;
	return {
		systemMinSizePixels: i(s, r),
		systemMaxSizePixels: a(c, o)
	};
}
function s(t, n) {
	let { userMinSizePixels: i, userMaxSizePixels: a } = r(t, n), { systemMinSizePixels: s, systemMaxSizePixels: c } = o(t, n, i, a);
	return {
		userMinSizePixels: i,
		userMaxSizePixels: a,
		systemMinSizePixels: s,
		systemMaxSizePixels: c,
		collapseSizePixels: t.collapseSize ? e(t.collapseSize, n, { clampToContainer: !1 }) : void 0
	};
}
//#endregion
//#region components/resizable/composables/useResizableCalculations.ts
function c(e) {
	function n(e, t, n) {
		return t.resizable === !1 || n.resizable === !1 ? {
			constrainedCursorPosition: e,
			beforePanelSize: t.pixelSize || 0,
			afterPanelSize: n.pixelSize || 0,
			isValidResize: !1
		} : null;
	}
	function r(e, n) {
		return t(e, n.userMinSizePixels, n.userMaxSizePixels);
	}
	function i(e, t, n) {
		let r = e.userMinSizePixels;
		if (r === void 0 || !n) return t;
		let i = n.findIndex((t) => t.id === e.id), a = n.slice(i + 1).reduce((e, t) => e + (t.pixelSize || 0), 0);
		return t - r - a;
	}
	function a(e, t, n, r) {
		if (!r) return t - e;
		let i = r.findIndex((e) => e.id === n.id), a = r.slice(i + 1).reduce((e, t) => e + (t.pixelSize || 0), 0);
		return t - e - a;
	}
	function o(e, t, o, s, c, l, u) {
		let d = n(e, t, o);
		if (d) return d;
		let f = u || 0, p = e - f, m = s - e, h = r(p, t), g = r(m, o), _ = i(o, s, l), v = f + h, y = Math.min(v, _), b;
		return y < v ? (b = y, h = b - f, g = a(b, s, o, l)) : (b = v, g = a(b, s, o, l)), {
			constrainedCursorPosition: b,
			beforePanelSize: h,
			afterPanelSize: g,
			isValidResize: h >= 10 && g >= 10
		};
	}
	return { processResizeMove: o };
}
//#endregion
export { s as n, n as r, c as t };

//# sourceMappingURL=useResizableCalculations-DAajatT4.js.map