import { FluentTextFieldAutoComplete } from "../textField/FluentTextFieldAutoComplete.mjs";
import { c } from "react-compiler-runtime";
import React from "react";
//#region src/UI/inputs/fieldArrayCard/AutocompleteFinalField.jsx
const AutocompleteFinalField = (props) => {
	const $ = c(13);
	let options;
	let otherProps;
	let t0;
	let value;
	if ($[0] !== props) {
		({value, options, idField: t0, ...otherProps} = props);
		$[0] = props;
		$[1] = options;
		$[2] = otherProps;
		$[3] = t0;
		$[4] = value;
	} else {
		options = $[1];
		otherProps = $[2];
		t0 = $[3];
		value = $[4];
	}
	const idField = t0 === void 0 ? "id" : t0;
	let t1;
	bb0: {
		if (typeof value === "object") {
			t1 = value;
			break bb0;
		}
		let t2;
		if ($[5] !== idField || $[6] !== options || $[7] !== value) {
			t2 = options.find((option) => option[idField] === value) || null;
			$[5] = idField;
			$[6] = options;
			$[7] = value;
			$[8] = t2;
		} else t2 = $[8];
		t1 = t2;
	}
	const currentValue = t1;
	let t2;
	if ($[9] !== currentValue || $[10] !== options || $[11] !== otherProps) {
		t2 = /* @__PURE__ */ React.createElement(FluentTextFieldAutoComplete, {
			...otherProps,
			options,
			value: currentValue
		});
		$[9] = currentValue;
		$[10] = options;
		$[11] = otherProps;
		$[12] = t2;
	} else t2 = $[12];
	return t2;
};
//#endregion
export { AutocompleteFinalField as default };

//# sourceMappingURL=AutocompleteFinalField.mjs.map