import { UnityFluentIcon } from "../../iconLibrary/UnityFluentIcon.mjs";
import { getIconFromName } from "../../tree/TreeUtilities.mjs";
import { InputAdornment } from "../../../UI/utilityDisplay/InputAdornment.mjs";
import { getCreditCardMethodIcon } from "./CreditCardUtils.mjs";
import { c } from "react-compiler-runtime";
import React from "react";
//#region src/utilities/form/paymentForm/CreditCardAdornment.tsx
/**
* CreditCardAdornment component displays an icon at the start of an input field.
* It shows a default payment card icon if no credit card number is provided.
* If a valid credit card number is provided, it displays the corresponding credit card method icon.
*
* @param {Object} props - The props object.
* @param {string} props.creditCardNumberInput - The credit card number input string.
* @returns {JSX.Element} The InputAdornment component with the appropriate icon.
*/
const CreditCardAdornment = (t0) => {
	const $ = c(5);
	const { creditCardNumberInput } = t0;
	let t1;
	if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
		t1 = /* @__PURE__ */ React.createElement(InputAdornment, { position: "start" }, /* @__PURE__ */ React.createElement(UnityFluentIcon, {
			size: 12,
			icon: getIconFromName("PaymentCardIcon")
		}));
		$[0] = t1;
	} else t1 = $[0];
	const defaultAdornment = t1;
	if (!creditCardNumberInput) return defaultAdornment;
	let t2;
	if ($[1] !== creditCardNumberInput) {
		t2 = getCreditCardMethodIcon(creditCardNumberInput);
		$[1] = creditCardNumberInput;
		$[2] = t2;
	} else t2 = $[2];
	const iconPath = t2;
	if (!iconPath || iconPath === "unknown") return defaultAdornment;
	let t3;
	if ($[3] !== iconPath) {
		t3 = /* @__PURE__ */ React.createElement(InputAdornment, { position: "start" }, /* @__PURE__ */ React.createElement("img", {
			src: iconPath,
			alt: "credit-card",
			width: 21
		}));
		$[3] = iconPath;
		$[4] = t3;
	} else t3 = $[4];
	return t3;
};
//#endregion
export { CreditCardAdornment };

//# sourceMappingURL=CreditCardAdornment.mjs.map