//#region src/elements/ElementPositionInfo.ts
/**
* Mixin that adds getPositionInfo() method to LitElement.
* Elements can use this to expose their position information.
*/
function PositionInfoMixin(superClass) {
	class PositionInfoElement extends superClass {
		/**
		* Get position information for this element.
		* Returns computed bounds, transform, and rotation.
		*
		* @public
		*/
		getPositionInfo() {
			return getPositionInfoFromElement(this);
		}
	}
	return PositionInfoElement;
}
/**
* Helper function to get position info from any HTMLElement.
* Reads computed styles and bounding rect to determine position.
*/
function getPositionInfoFromElement(element) {
	if (!element) return null;
	const rect = element.getBoundingClientRect();
	const transform = window.getComputedStyle(element).transform;
	let rotation = 0;
	if (transform && transform !== "none") {
		const matrixMatch = transform.match(/matrix\(([^)]+)\)/);
		if (matrixMatch && matrixMatch[1]) {
			const values = matrixMatch[1].split(",").map((v) => parseFloat(v.trim()));
			if (values.length >= 4) {
				const a = values[0];
				const b = values[1];
				rotation = Math.atan2(b, a) * (180 / Math.PI);
			}
		}
	}
	return {
		bounds: rect,
		transform: transform || "none",
		rotation
	};
}

//#endregion
export { PositionInfoMixin, getPositionInfoFromElement };
//# sourceMappingURL=ElementPositionInfo.js.map