/*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
import { Node, SyntaxKind } from "ts-morph";

//#region src/purger/optimized/ast/jsx.ts
/**
* Find all JSX usages of a component from its identifier
*/
const findJsxReferences = (identifier) => {
	try {
		return identifier.findReferencesAsNodes().map((reference) => reference.getFirstAncestor((n) => Node.isJsxOpeningElement(n) || Node.isJsxSelfClosingElement(n))).filter((node) => Boolean(node) && (Node.isJsxOpeningElement(node) || Node.isJsxSelfClosingElement(node)));
	} catch {
		return [];
	}
};

//#endregion
export { findJsxReferences };
//# sourceMappingURL=jsx.js.map