try {
	let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
	n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "abc0066b-11ef-44c6-a539-9d3ee8010192", e._sentryDebugIdIdentifier = "sentry-dbid-abc0066b-11ef-44c6-a539-9d3ee8010192");
} catch (e) {}
import { r as useTranslation } from "./translation-Br5wIPO-.js";
import { t as LegalEntityTypes } from "./legal-entity-type-VIfNYnJP.js";
import { l as keysOf } from "./AnalyticsContext-C0HNdPss.js";
import { t as CountryCodes } from "./country-code-D3oCpE4i.js";
import { t as TaskTypes } from "./taskTypes-DWaxzvnQ.js";
import { t as SettingNames } from "./types-BklAlvuU.js";
import { t as CompanyTypesValues } from "./company-types-value-B-nraMaa.js";
import { a as alphanumericInputs, c as nonInputs, i as alphaInputs, l as numericInputs, o as customInputs, s as makeMask, u as spacer } from "./MaskedInput-uN8G9HRq.js";
import { c as COUNTRIES_WITH_STATES_DATASET } from "./utils-DLDyhf2J.js";
import { t as isJapanLocalizationEnabled } from "./japanSupportUtils-BjabsTWv.js";
import { t as uppercase } from "./uppercase-DKruhEuk.js";
import { a as validateNotEmptyOnBlur, o as validatePatternOnBlur } from "./patternValidators-DMnU4iGe.js";
import { t as Field } from "./Field-BEqknhTe.js";
import { t as RadioGroup } from "./RadioGroup-XuCtbRrH.js";
import { t as createFormRules } from "./form-rules-CvdV5rPY.js";
import { n as isDateOlderThanAYear } from "./utils-Do5CMPEN.js";
import { useCallback, useEffect, useMemo } from "preact/hooks";
import { jsx } from "preact/jsx-runtime";
//#region src/types/datasets/state-code.ts
var StateCodesUS = {
	Alabama: "AL",
	Alaska: "AK",
	Arizona: "AZ",
	Arkansas: "AR",
	California: "CA",
	Colorado: "CO",
	Connecticut: "CT",
	Delaware: "DE",
	DistrictOfColumbia: "DC",
	Florida: "FL",
	Georgia: "GA",
	Hawaii: "HI",
	Idaho: "ID",
	Illinois: "IL",
	Indiana: "IN",
	Iowa: "IA",
	Kansas: "KS",
	Kentucky: "KY",
	Louisiana: "LA",
	Maine: "ME",
	Maryland: "MD",
	Massachusetts: "MA",
	Michigan: "MI",
	Minnesota: "MN",
	Mississippi: "MS",
	Missouri: "MO",
	Montana: "MT",
	Nebraska: "NE",
	Nevada: "NV",
	NewHampshire: "NH",
	NewJersey: "NJ",
	NewMexico: "NM",
	NewYork: "NY",
	NorthCarolina: "NC",
	NorthDakota: "ND",
	Ohio: "OH",
	Oklahoma: "OK",
	Oregon: "OR",
	Pennsylvania: "PA",
	RhodeIsland: "RI",
	SouthCarolina: "SC",
	SouthDakota: "SD",
	Tennessee: "TN",
	Texas: "TX",
	Utah: "UT",
	Vermont: "VT",
	Virginia: "VA",
	Washington: "WA",
	WestVirginia: "WV",
	Wisconsin: "WI",
	Wyoming: "WY",
	ArmedForcesAmericas: "AA",
	ArmedForcesEurope: "AE",
	ArmedForcesPacific: "AP"
};
//#endregion
//#region src/utils/masking/masks/businessRegistrationNumberMasks.ts
var businessRegistrationNumberMasks = {
	[CountryCodes.Austria]: {
		firmenbuchnummer: { mask: makeMask({
			type: "input",
			allow: /[TF]/
		}, {
			type: "input",
			allow: /N/,
			optional: true
		}, ...numericInputs(3), ...numericInputs(3, true), {
			type: "input",
			allow: /[a-z]/
		}) },
		ZVR: { mask: makeMask(...nonInputs("AT", { includeInValue: true }), spacer, ...nonInputs("-", { includeInValue: true }), spacer, ...nonInputs("ZVR", { includeInValue: true }), spacer, ...nonInputs("-", { includeInValue: true }), spacer, ...numericInputs(9), ...numericInputs(1, true)) }
	},
	[CountryCodes.Australia]: {
		default: { mask: makeMask(...numericInputs(3), spacer, ...numericInputs(3), spacer, ...numericInputs(3)) },
		associationIncorporated: {
			mask: makeMask(...alphanumericInputs(3), ...alphanumericInputs(20, true)),
			transformOnType: uppercase
		}
	},
	[CountryCodes.Belgium]: { default: { mask: makeMask(...numericInputs(10)) } },
	[CountryCodes.Brazil]: { default: { mask: makeMask(...numericInputs(2), ...nonInputs(" . "), ...numericInputs(3), ...nonInputs(" . "), ...numericInputs(3), ...nonInputs(" / "), ...numericInputs(4), ...nonInputs(" - "), ...numericInputs(2)) } },
	[CountryCodes.Bulgaria]: { default: { mask: makeMask(...numericInputs(9)) } },
	[CountryCodes.Canada]: { default: {
		mask: makeMask(...alphanumericInputs(5), ...alphanumericInputs(5, true)),
		transformOnType: uppercase
	} },
	[CountryCodes.Croatia]: {
		default: { mask: makeMask(...numericInputs(9)) },
		[CompanyTypesValues.SOLE_PROPRIETORSHIP]: { mask: makeMask(...numericInputs(8)) }
	},
	[CountryCodes.Cyprus]: { default: {
		mask: makeMask(...customInputs(1, /^[COP]$/), ...numericInputs(1), ...numericInputs(7, true)),
		transformOnType: uppercase
	} },
	[CountryCodes.CzechRepublic]: { default: { mask: makeMask(...numericInputs(8), ...numericInputs(2, true)) } },
	[CountryCodes.Denmark]: { default: { mask: makeMask(...numericInputs(8)) } },
	[CountryCodes.Estonia]: { default: { mask: makeMask(...numericInputs(8)) } },
	[CountryCodes.Finland]: { default: { mask: makeMask(...numericInputs(7), spacer, ...nonInputs("-", { includeInValue: true }), spacer, ...numericInputs(1)) } },
	[CountryCodes.France]: {
		SIRET: { mask: makeMask(...numericInputs(9), ...nonInputs(" - "), ...numericInputs(5)) },
		RNA: { mask: makeMask(...nonInputs("W", { includeInValue: true }), ...numericInputs(1), ...alphanumericInputs(1), ...numericInputs(7)) }
	},
	[CountryCodes.Germany]: { default: {
		mask: makeMask(...alphanumericInputs(3), ...customInputs(17, /[A-Z0-9-]/, true)),
		transformOnType: uppercase
	} },
	[CountryCodes.Gibraltar]: { default: {
		mask: makeMask(...alphanumericInputs(1), ...alphanumericInputs(7, true)),
		transformOnType: uppercase
	} },
	[CountryCodes.Greece]: { default: { mask: makeMask(...numericInputs(12)) } },
	[CountryCodes.Guernsey]: { default: { mask: makeMask(...numericInputs(1), ...numericInputs(8, true)) } },
	[CountryCodes.HongKong]: { default: { mask: makeMask(...numericInputs(7)) } },
	[CountryCodes.Hungary]: {
		default: { mask: makeMask(...numericInputs(2), ...nonInputs(" - "), ...numericInputs(2), ...nonInputs(" - "), ...numericInputs(6)) },
		nyilvantartasiSzam: { mask: makeMask(...numericInputs(10)) }
	},
	[CountryCodes.Ireland]: { default: { mask: makeMask(...numericInputs(1), ...numericInputs(7, true)) } },
	[CountryCodes.IsleOfMan]: { default: {
		mask: makeMask(...numericInputs(6), ...alphaInputs(1)),
		transformOnType: uppercase
	} },
	[CountryCodes.Italy]: {
		partitaIVA: { mask: makeMask(...numericInputs(11)) },
		CCIAA: {
			mask: makeMask(...alphaInputs(2), ...numericInputs(6), ...numericInputs(1, true)),
			transformOnType: uppercase
		}
	},
	[CountryCodes.Japan]: { default: { mask: makeMask(...numericInputs(12)) } },
	[CountryCodes.Jersey]: { default: {
		mask: makeMask(...alphanumericInputs(1), ...alphanumericInputs(8, true)),
		transformOnType: uppercase
	} },
	[CountryCodes.Latvia]: { default: { mask: makeMask(...numericInputs(11)) } },
	[CountryCodes.Liechtenstein]: { default: { mask: makeMask(...nonInputs("FL", { includeInValue: true }), spacer, ...nonInputs("-", { includeInValue: true }), spacer, ...numericInputs(4), spacer, ...nonInputs(".", { includeInValue: true }), spacer, ...numericInputs(3), spacer, ...nonInputs(".", { includeInValue: true }), spacer, ...numericInputs(3), spacer, ...nonInputs("-", { includeInValue: true }), spacer, ...numericInputs(1)) } },
	[CountryCodes.Lithuania]: { default: { mask: makeMask(...numericInputs(6), ...numericInputs(3, true)) } },
	[CountryCodes.Luxembourg]: { default: {
		mask: makeMask(...alphaInputs(1), ...numericInputs(9, true)),
		transformOnType: uppercase
	} },
	[CountryCodes.Malaysia]: { default: { mask: makeMask(...numericInputs(7), ...numericInputs(5, true)) } },
	[CountryCodes.Malta]: { default: {
		mask: makeMask(...customInputs(1, /[CP]/), spacer, ...numericInputs(4), ...numericInputs(2, true)),
		transformOnType: uppercase
	} },
	[CountryCodes.Mexico]: { default: { mask: makeMask(...alphanumericInputs(12)) } },
	[CountryCodes.Monaco]: {
		default: {
			mask: makeMask(...alphanumericInputs(8), ...alphanumericInputs(3, true)),
			transformOnType: uppercase
		},
		[CompanyTypesValues.SOLE_PROPRIETORSHIP]: {
			mask: makeMask(...alphanumericInputs(8), ...alphanumericInputs(3, true)),
			transformOnType: uppercase
		}
	},
	[CountryCodes.Netherlands]: { default: { mask: makeMask(...numericInputs(8)) } },
	[CountryCodes.NewZealand]: {
		NZBN: { mask: makeMask(...numericInputs(13)) },
		companyNumberNZ: { mask: makeMask(...numericInputs(7)) }
	},
	[CountryCodes.Norway]: { default: { mask: makeMask(...numericInputs(9)) } },
	[CountryCodes.Poland]: {
		krsNumber: { mask: makeMask(...numericInputs(10)) },
		regon: { mask: makeMask(...numericInputs(9)) }
	},
	[CountryCodes.Portugal]: { default: { mask: makeMask(...numericInputs(9)) } },
	[CountryCodes.Romania]: {
		roRegNumberOldFormat: {
			mask: makeMask(...alphaInputs(1), ...numericInputs(1), ...numericInputs(1, true), ...customInputs(1, /[/]/), ...numericInputs(1), ...numericInputs(8, true), ...customInputs(1, /[/]/), ...numericInputs(4)),
			transformOnType: uppercase
		},
		roRegNumberNewFormat: {
			mask: makeMask({
				type: "input",
				allow: /[JFC]/
			}, ...numericInputs(13)),
			transformOnType: uppercase
		}
	},
	[CountryCodes.Singapore]: { default: {
		mask: makeMask(...alphanumericInputs(9), ...alphanumericInputs(1, true)),
		transformOnType: uppercase
	} },
	[CountryCodes.Slovakia]: { default: { mask: makeMask(...numericInputs(8)) } },
	[CountryCodes.Slovenia]: { default: { mask: makeMask(...numericInputs(10)) } },
	[CountryCodes.Spain]: { default: {
		mask: makeMask(...alphaInputs(1), ...alphanumericInputs(8)),
		transformOnType: uppercase
	} },
	[CountryCodes.Sweden]: { default: { mask: makeMask(...numericInputs(6), ...nonInputs(" - "), ...numericInputs(4)) } },
	[CountryCodes.Switzerland]: { default: { mask: makeMask(...nonInputs("CHE", { includeInValue: true }), ...nonInputs(" - "), ...numericInputs(3), ...nonInputs(" . "), ...numericInputs(3), ...nonInputs(" . "), ...numericInputs(3)) } },
	[CountryCodes.UnitedKingdom]: {
		default: {
			mask: makeMask(...alphanumericInputs(8)),
			transformOnType: uppercase
		},
		nonProfit: {
			mask: makeMask(...alphanumericInputs(6), ...customInputs(1, /[a-zA-Z0-9-]/, true), ...alphanumericInputs(1, true)),
			transformOnType: uppercase
		}
	},
	[CountryCodes.UnitedStates]: {
		[StateCodesUS.Alabama]: {
			mask: makeMask(...numericInputs(9), ...nonInputs(" "), ...nonInputs(StateCodesUS.Alabama)),
			transformOnType: uppercase
		},
		[StateCodesUS.Alaska]: {
			mask: makeMask(...numericInputs(8), ...nonInputs(" "), ...nonInputs(StateCodesUS.Alaska)),
			transformOnType: uppercase
		},
		[StateCodesUS.Arizona]: {
			mask: makeMask(...numericInputs(8), ...nonInputs(" "), ...nonInputs(StateCodesUS.Arizona)),
			transformOnType: uppercase
		},
		[StateCodesUS.Arkansas]: {
			mask: makeMask({
				type: "input",
				allow: /[8]/
			}, ...numericInputs(8), ...nonInputs(" "), ...nonInputs(StateCodesUS.Arkansas)),
			transformOnType: uppercase
		},
		[StateCodesUS.California]: {
			mask: makeMask(...numericInputs(7), ...numericInputs(5, true), ...nonInputs(" "), ...nonInputs(StateCodesUS.California)),
			transformOnType: uppercase
		},
		[StateCodesUS.Colorado]: {
			mask: makeMask(...numericInputs(11), ...nonInputs(" "), ...nonInputs(StateCodesUS.Colorado)),
			transformOnType: uppercase
		},
		[StateCodesUS.Connecticut]: {
			mask: makeMask(...numericInputs(7), ...nonInputs(" "), ...nonInputs(StateCodesUS.Connecticut)),
			transformOnType: uppercase
		},
		[StateCodesUS.Delaware]: {
			mask: makeMask(...numericInputs(7), ...nonInputs(" "), ...nonInputs(StateCodesUS.Delaware)),
			transformOnType: uppercase
		},
		[StateCodesUS.Florida]: {
			mask: makeMask(...numericInputs(6), ...numericInputs(6, true), ...nonInputs(" "), ...nonInputs(StateCodesUS.Florida)),
			transformOnType: uppercase
		},
		[StateCodesUS.Georgia]: {
			mask: makeMask(...numericInputs(8), ...nonInputs(" "), ...nonInputs(StateCodesUS.Georgia)),
			transformOnType: uppercase
		},
		[StateCodesUS.Hawaii]: {
			mask: makeMask(...numericInputs(5), ...numericInputs(3, true), {
				type: "input",
				allow: /[CDFLNPTZ]/
			}, {
				type: "input",
				allow: /[1-8Z]/
			}, ...nonInputs(" "), ...nonInputs(StateCodesUS.Hawaii)),
			transformOnType: uppercase
		},
		[StateCodesUS.Idaho]: {
			mask: makeMask(...numericInputs(6), ...nonInputs(" "), ...nonInputs(StateCodesUS.Idaho)),
			transformOnType: uppercase
		},
		[StateCodesUS.Illinois]: {
			mask: makeMask(...numericInputs(8), ...nonInputs(" "), ...nonInputs(StateCodesUS.Illinois)),
			transformOnType: uppercase
		},
		[StateCodesUS.Indiana]: {
			mask: makeMask(...numericInputs(10), ...nonInputs(" "), ...nonInputs(StateCodesUS.Indiana)),
			transformOnType: uppercase
		},
		[StateCodesUS.Iowa]: {
			mask: makeMask(...numericInputs(6), ...numericInputs(2, true), ...nonInputs(" "), ...nonInputs(StateCodesUS.Iowa)),
			transformOnType: uppercase
		},
		[StateCodesUS.Kansas]: {
			mask: makeMask(...numericInputs(7), ...numericInputs(2, true), ...nonInputs(" "), ...nonInputs(StateCodesUS.Kansas)),
			transformOnType: uppercase
		},
		[StateCodesUS.Kentucky]: {
			mask: makeMask(...numericInputs(9), ...numericInputs(1, true), ...nonInputs(" "), ...nonInputs(StateCodesUS.Kentucky)),
			transformOnType: uppercase
		},
		[StateCodesUS.Louisiana]: {
			mask: makeMask(...numericInputs(9), ...numericInputs(1, true), ...nonInputs(" "), ...nonInputs(StateCodesUS.Louisiana)),
			transformOnType: uppercase
		},
		[StateCodesUS.Maine]: {
			mask: makeMask(...numericInputs(8), ...nonInputs(" "), ...nonInputs(StateCodesUS.Maine)),
			transformOnType: uppercase
		},
		[StateCodesUS.Maryland]: {
			mask: makeMask(...numericInputs(8), ...nonInputs(" "), ...nonInputs(StateCodesUS.Maryland)),
			transformOnType: uppercase
		},
		[StateCodesUS.Massachusetts]: {
			mask: makeMask(...numericInputs(10), ...nonInputs(" "), ...nonInputs(StateCodesUS.Massachusetts)),
			transformOnType: uppercase
		},
		[StateCodesUS.Michigan]: {
			mask: makeMask(...numericInputs(6), ...numericInputs(3, true), ...nonInputs(" "), ...nonInputs(StateCodesUS.Michigan)),
			transformOnType: uppercase
		},
		[StateCodesUS.Minnesota]: {
			mask: makeMask(...numericInputs(7), ...nonInputs(" "), ...nonInputs(StateCodesUS.Minnesota)),
			transformOnType: uppercase
		},
		[StateCodesUS.Mississippi]: {
			mask: makeMask(...numericInputs(7), ...numericInputs(3, true), ...nonInputs(" "), ...nonInputs(StateCodesUS.Mississippi)),
			transformOnType: uppercase
		},
		[StateCodesUS.Missouri]: {
			mask: makeMask(...numericInputs(10), ...nonInputs(" "), ...nonInputs(StateCodesUS.Missouri)),
			transformOnType: uppercase
		},
		[StateCodesUS.Montana]: {
			mask: makeMask(...numericInputs(7), ...nonInputs(" "), ...nonInputs(StateCodesUS.Montana)),
			transformOnType: uppercase
		},
		[StateCodesUS.Nebraska]: {
			mask: makeMask(...numericInputs(9), ...numericInputs(2, true), ...nonInputs(" "), ...nonInputs(StateCodesUS.Nebraska)),
			transformOnType: uppercase
		},
		[StateCodesUS.Nevada]: {
			mask: makeMask(...numericInputs(9), ...numericInputs(2, true), ...nonInputs(" "), ...nonInputs(StateCodesUS.Nevada)),
			transformOnType: uppercase
		},
		[StateCodesUS.NewHampshire]: {
			mask: makeMask(...numericInputs(9), ...nonInputs(" "), ...nonInputs(StateCodesUS.NewHampshire)),
			transformOnType: uppercase
		},
		[StateCodesUS.NewJersey]: {
			mask: makeMask(...numericInputs(10), ...nonInputs(" "), ...nonInputs(StateCodesUS.NewJersey)),
			transformOnType: uppercase
		},
		[StateCodesUS.NewMexico]: {
			mask: makeMask(...numericInputs(6), ...nonInputs(" "), ...nonInputs(StateCodesUS.NewMexico)),
			transformOnType: uppercase
		},
		[StateCodesUS.NewYork]: {
			mask: makeMask(...numericInputs(7), ...nonInputs(" "), ...nonInputs(StateCodesUS.NewYork)),
			transformOnType: uppercase
		},
		[StateCodesUS.NorthCarolina]: {
			mask: makeMask(...numericInputs(7), ...nonInputs(" "), ...nonInputs(StateCodesUS.NorthCarolina)),
			transformOnType: uppercase
		},
		[StateCodesUS.NorthDakota]: {
			mask: makeMask(...numericInputs(7), ...numericInputs(3, true), ...nonInputs(" "), ...nonInputs(StateCodesUS.NorthDakota)),
			transformOnType: uppercase
		},
		[StateCodesUS.Ohio]: {
			mask: makeMask(...numericInputs(10), ...nonInputs(" "), ...nonInputs(StateCodesUS.Ohio)),
			transformOnType: uppercase
		},
		[StateCodesUS.Oklahoma]: {
			mask: makeMask(...numericInputs(10), ...nonInputs(" "), ...nonInputs(StateCodesUS.Oklahoma)),
			transformOnType: uppercase
		},
		[StateCodesUS.Oregon]: {
			mask: makeMask(...numericInputs(9), ...nonInputs(" "), ...nonInputs(StateCodesUS.Oregon)),
			transformOnType: uppercase
		},
		[StateCodesUS.Pennsylvania]: {
			mask: makeMask(...numericInputs(7), ...nonInputs(" "), ...nonInputs(StateCodesUS.Pennsylvania)),
			transformOnType: uppercase
		},
		[StateCodesUS.RhodeIsland]: {
			mask: makeMask(...numericInputs(7), ...nonInputs(" "), ...nonInputs(StateCodesUS.RhodeIsland)),
			transformOnType: uppercase
		},
		[StateCodesUS.SouthCarolina]: {
			mask: makeMask(...numericInputs(7), ...nonInputs(" "), ...nonInputs(StateCodesUS.SouthCarolina)),
			transformOnType: uppercase
		},
		[StateCodesUS.SouthDakota]: {
			mask: makeMask(...numericInputs(7), ...nonInputs(" "), ...nonInputs(StateCodesUS.SouthDakota)),
			transformOnType: uppercase
		},
		[StateCodesUS.Tennessee]: {
			mask: makeMask(...numericInputs(6), ...nonInputs(" "), ...nonInputs(StateCodesUS.Tennessee)),
			transformOnType: uppercase
		},
		[StateCodesUS.Texas]: {
			mask: makeMask(...numericInputs(10), ...nonInputs(" "), ...nonInputs(StateCodesUS.Texas)),
			transformOnType: uppercase
		},
		[StateCodesUS.Utah]: {
			mask: makeMask(...numericInputs(7), ...nonInputs(" "), ...nonInputs(StateCodesUS.Utah)),
			transformOnType: uppercase
		},
		[StateCodesUS.Vermont]: {
			mask: makeMask(...numericInputs(6), ...nonInputs(" "), ...nonInputs(StateCodesUS.Vermont)),
			transformOnType: uppercase
		},
		[StateCodesUS.Virginia]: {
			mask: makeMask(...numericInputs(7), ...nonInputs(" "), ...nonInputs(StateCodesUS.Virginia)),
			transformOnType: uppercase
		},
		[StateCodesUS.Washington]: {
			mask: makeMask(...numericInputs(9), ...nonInputs(" "), ...nonInputs(StateCodesUS.Washington)),
			transformOnType: uppercase
		},
		[StateCodesUS.WestVirginia]: {
			mask: makeMask(...numericInputs(6), ...nonInputs(" "), ...nonInputs(StateCodesUS.WestVirginia)),
			transformOnType: uppercase
		},
		[StateCodesUS.Wisconsin]: {
			mask: makeMask(...numericInputs(6), ...nonInputs(" "), ...nonInputs(StateCodesUS.Wisconsin)),
			transformOnType: uppercase
		},
		[StateCodesUS.Wyoming]: {
			mask: makeMask(...numericInputs(6), ...nonInputs(" "), ...nonInputs(StateCodesUS.Wyoming)),
			transformOnType: uppercase
		},
		[StateCodesUS.DistrictOfColumbia]: {
			mask: makeMask(...numericInputs(9)),
			transformOnType: uppercase
		},
		[StateCodesUS.ArmedForcesAmericas]: {
			mask: makeMask(...numericInputs(9)),
			transformOnType: uppercase
		},
		[StateCodesUS.ArmedForcesEurope]: {
			mask: makeMask(...numericInputs(9)),
			transformOnType: uppercase
		},
		[StateCodesUS.ArmedForcesPacific]: {
			mask: makeMask(...numericInputs(9)),
			transformOnType: uppercase
		},
		default: {
			mask: makeMask(...numericInputs(9)),
			transformOnType: uppercase
		}
	}
};
var stateFormatGuidanceText = {
	[StateCodesUS.Alabama]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "9",
			example: "123456789 AL"
		}
	},
	[StateCodesUS.Alaska]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "8",
			example: "12345678 AK"
		}
	},
	[StateCodesUS.Arizona]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "8",
			example: "12345678 AZ"
		}
	},
	[StateCodesUS.Arkansas]: {
		key: "enterTheRemainingNDigitsForExample",
		values: {
			numDigits: "8",
			example: "800000001 AR"
		}
	},
	[StateCodesUS.California]: {
		key: "enterXOrYDigitsForExample",
		values: {
			xDigits: "8",
			yDigits: "12",
			example: "12345678 CA"
		}
	},
	[StateCodesUS.Colorado]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "11",
			example: "12345678901 CO"
		}
	},
	[StateCodesUS.Connecticut]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "7",
			example: "1234567 CT"
		}
	},
	[StateCodesUS.Delaware]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "7",
			example: "1234567 DE"
		}
	},
	[StateCodesUS.Florida]: {
		key: "enterXOrYDigitsForExample",
		values: {
			xDigits: "6",
			yDigits: "12",
			example: "123456789012 FL"
		}
	},
	[StateCodesUS.Georgia]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "8",
			example: "12345678 GA"
		}
	},
	[StateCodesUS.Hawaii]: {
		key: "validationPleaseEnterAValidBusinessRegistrationNumberWithFormat",
		values: { example: "12345678ZZ HI" }
	},
	[StateCodesUS.Idaho]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "6",
			example: "123456 ID"
		}
	},
	[StateCodesUS.Illinois]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "8",
			example: "12345678 IL"
		}
	},
	[StateCodesUS.Indiana]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "10",
			example: "1234567890 IN"
		}
	},
	[StateCodesUS.Iowa]: {
		key: "enterXToYDigitsForExample",
		values: {
			minDigits: "6",
			maxDigits: "8",
			example: "12345678 IA"
		}
	},
	[StateCodesUS.Kansas]: {
		key: "enterXToYDigitsForExample",
		values: {
			minDigits: "7",
			maxDigits: "9",
			example: "1234567890 KS"
		}
	},
	[StateCodesUS.Kentucky]: {
		key: "enterXToYDigitsForExample",
		values: {
			minDigits: "9",
			maxDigits: "10",
			example: "1234567890 KY"
		}
	},
	[StateCodesUS.Louisiana]: {
		key: "enterXToYDigitsForExample",
		values: {
			minDigits: "9",
			maxDigits: "10",
			example: "1234567890 LA"
		}
	},
	[StateCodesUS.Maine]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "8",
			example: "12345678 ME"
		}
	},
	[StateCodesUS.Maryland]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "8",
			example: "12345678 MD"
		}
	},
	[StateCodesUS.Massachusetts]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "10",
			example: "1234567890 MA"
		}
	},
	[StateCodesUS.Michigan]: {
		key: "enterXOrYDigitsForExample",
		values: {
			xDigits: "6",
			yDigits: "9",
			example: "123456 MI"
		}
	},
	[StateCodesUS.Minnesota]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "7",
			example: "1234567 MN"
		}
	},
	[StateCodesUS.Mississippi]: {
		key: "enterXToYDigitsForExample",
		values: {
			minDigits: "7",
			maxDigits: "10",
			example: "1234567 MS"
		}
	},
	[StateCodesUS.Missouri]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "10",
			example: "1234567890 MO"
		}
	},
	[StateCodesUS.Montana]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "7",
			example: "1234567 MT"
		}
	},
	[StateCodesUS.Nebraska]: {
		key: "enterXToYDigitsForExample",
		values: {
			minDigits: "9",
			maxDigits: "11",
			example: "123456789 NE"
		}
	},
	[StateCodesUS.Nevada]: {
		key: "enterXToYDigitsForExample",
		values: {
			minDigits: "9",
			maxDigits: "11",
			example: "123456789 NV"
		}
	},
	[StateCodesUS.NewHampshire]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "9",
			example: "123456789 NH"
		}
	},
	[StateCodesUS.NewJersey]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "10",
			example: "1234567890 NJ"
		}
	},
	[StateCodesUS.NewMexico]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "6",
			example: "123456 NM"
		}
	},
	[StateCodesUS.NewYork]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "7",
			example: "1234567 NY"
		}
	},
	[StateCodesUS.NorthCarolina]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "7",
			example: "1234567 NC"
		}
	},
	[StateCodesUS.NorthDakota]: {
		key: "enterXToYDigitsForExample",
		values: {
			minDigits: "7",
			maxDigits: "10",
			example: "1234567 ND"
		}
	},
	[StateCodesUS.Ohio]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "10",
			example: "1234567890 OH"
		}
	},
	[StateCodesUS.Oklahoma]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "10",
			example: "1234567890 OK"
		}
	},
	[StateCodesUS.Oregon]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "9",
			example: "123456789 OR"
		}
	},
	[StateCodesUS.Pennsylvania]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "7",
			example: "1234567 PA"
		}
	},
	[StateCodesUS.RhodeIsland]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "7",
			example: "1234567 RI"
		}
	},
	[StateCodesUS.SouthCarolina]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "7",
			example: "1234567 SC"
		}
	},
	[StateCodesUS.SouthDakota]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "7",
			example: "1234567 SD"
		}
	},
	[StateCodesUS.Tennessee]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "6",
			example: "123456 TN"
		}
	},
	[StateCodesUS.Texas]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "10",
			example: "1234567890 TX"
		}
	},
	[StateCodesUS.Utah]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "7",
			example: "1234567 UT"
		}
	},
	[StateCodesUS.Vermont]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "6",
			example: "123456 VT"
		}
	},
	[StateCodesUS.Virginia]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "7",
			example: "1234567 VA"
		}
	},
	[StateCodesUS.Washington]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "9",
			example: "123456789 WA"
		}
	},
	[StateCodesUS.WestVirginia]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "6",
			example: "123456 WV"
		}
	},
	[StateCodesUS.Wisconsin]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "6",
			example: "123456 WI"
		}
	},
	[StateCodesUS.Wyoming]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "6",
			example: "123456 WY"
		}
	},
	[StateCodesUS.DistrictOfColumbia]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "9",
			example: "123456789"
		}
	},
	[StateCodesUS.ArmedForcesAmericas]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "9",
			example: "123456789"
		}
	},
	[StateCodesUS.ArmedForcesEurope]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "9",
			example: "123456789"
		}
	},
	[StateCodesUS.ArmedForcesPacific]: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "9",
			example: "123456789"
		}
	},
	default: {
		key: "enterNDigitsForExample",
		values: {
			numDigits: "9",
			example: "123456789"
		}
	}
};
//#endregion
//#region src/utils/regex/businessRegistrationNumberPatterns.ts
var businessRegistrationNumberPatterns = {
	[CountryCodes.Australia]: {
		default: /^\d{9}$/,
		associationIncorporated: /^[a-zA-Z0-9]{3,20}$/
	},
	[CountryCodes.Austria]: {
		firmenbuchnummer: /^(FN|T)\d{3,6}[a-z]$/,
		ZVR: /^(AT-ZVR-)\d{9,10}$/
	},
	[CountryCodes.Belgium]: { default: /^\d{10}$/ },
	[CountryCodes.Brazil]: { default: /^\d{14}$/ },
	[CountryCodes.Bulgaria]: { default: /^\d{9}$/ },
	[CountryCodes.Canada]: { default: /^[a-zA-Z0-9]{5,10}$/ },
	[CountryCodes.Croatia]: {
		default: /^\d{9}$/,
		soleProprietorship: /^\d{8}$/
	},
	[CountryCodes.Cyprus]: { default: /^[COP]{1}\d{1,8}$/ },
	[CountryCodes.CzechRepublic]: { default: /^\d{8,10}$/ },
	[CountryCodes.Denmark]: { default: /^\d{8}$/ },
	[CountryCodes.Estonia]: { default: /^\d{8}$/ },
	[CountryCodes.Finland]: { default: /^\d{7}-?\d$/ },
	[CountryCodes.France]: {
		SIRET: /^\d{9}-?\d{5}$/,
		RNA: /^W(\d{9}|\d[A-Za-z]\d{7})$/
	},
	[CountryCodes.Gibraltar]: { default: /^[a-zA-Z0-9]{1,8}$/ },
	[CountryCodes.Germany]: { default: /^[A-Z]{2,3}\d{1,6}[A-Z]{0,5}(?:-[A-Z]\d{4})?$/ },
	[CountryCodes.Greece]: { default: /^\d{12}$/ },
	[CountryCodes.Guernsey]: { default: /^\d{1,9}$/ },
	[CountryCodes.HongKong]: { default: /^\d{7}$/ },
	[CountryCodes.Hungary]: {
		default: /^\d{10}$/,
		nyilvantartasiSzam: /^\d{7,10}$/
	},
	[CountryCodes.Iceland]: { default: /^\d{10}$/ },
	[CountryCodes.India]: { default: /^\d{21}$/ },
	[CountryCodes.Indonesia]: { default: /^\d{12}$/ },
	[CountryCodes.Ireland]: { default: /^[1-9]\d{1,7}$/ },
	[CountryCodes.IsleOfMan]: { default: /^\d{6}[A-Z]$/ },
	[CountryCodes.Italy]: {
		partitaIVA: /^\d{11}$/,
		CCIAA: /^[a-zA-Z]{2}\d{6,7}$/
	},
	[CountryCodes.Japan]: { default: /^\d{12}$/ },
	[CountryCodes.Jersey]: { default: /^[a-zA-Z0-9]{1,9}$/ },
	[CountryCodes.Korea]: { default: /^\d{10}$/ },
	[CountryCodes.Latvia]: { default: /^\d{11}$/ },
	[CountryCodes.Liechtenstein]: { default: /FL-[0-9]{4}[.][0-9]{3}[.][0-9]{3}-[0-9]$/ },
	[CountryCodes.Lithuania]: { default: /^\d{6,9}$/ },
	[CountryCodes.Luxembourg]: { default: /^[a-zA-Z]\d{1,9}$/ },
	[CountryCodes.Malaysia]: { default: /^\d{7}$|^\d{12}$/ },
	[CountryCodes.Malta]: { default: /^[CP]\s?\d{4,6}$/ },
	[CountryCodes.Mexico]: { default: /^\D{3}\d{6}\w{3}$/ },
	[CountryCodes.Monaco]: {
		default: /^[0-9]{2}[A-Z]{1,3}[0-9]{5}$/,
		soleProprietorship: /^\d{2,4}[A-Z]\d{5}$/
	},
	[CountryCodes.Netherlands]: { default: /^\d{8}$/ },
	[CountryCodes.NewZealand]: {
		NZBN: /^\d{13}$/,
		companyNumberNZ: /^\d{7}$/
	},
	[CountryCodes.Norway]: { default: /^\d{9}$/ },
	[CountryCodes.Poland]: {
		krsNumber: /^\d{10}$/,
		regon: /^\d{9}$/
	},
	[CountryCodes.Portugal]: { default: /^\d{9}$/ },
	[CountryCodes.Romania]: {
		roRegNumberOldFormat: /^[A-Z]\d{1,2}\/\d{1,9}\/\d{4}$/,
		roRegNumberNewFormat: /^[JFC]\d{13}$/
	},
	[CountryCodes.Singapore]: { default: /^[a-zA-Z0-9]{9,10}$/ },
	[CountryCodes.Slovakia]: { default: /^\d{8}$/ },
	[CountryCodes.Slovenia]: { default: /^\d{10}$/ },
	[CountryCodes.Spain]: { default: /^[a-zA-Z][a-zA-Z0-9]{8}$/ },
	[CountryCodes.Sweden]: { default: /^\d{10}$/ },
	[CountryCodes.Switzerland]: { default: /^CHE\d{9}$|^CH\d{11}$/ },
	[CountryCodes.UnitedKingdom]: {
		default: /^[a-zA-Z0-9]{8}$/,
		nonProfit: /^(?:(?:[A-Z]{2})?\d{6}|\d{6,8}|\d{6}-\d)$/
	},
	[CountryCodes.UnitedStates]: {
		[StateCodesUS.Alabama]: /^\d{9}$/,
		[StateCodesUS.Alaska]: /^\d{8}$/,
		[StateCodesUS.Arizona]: /^\d{8}$/,
		[StateCodesUS.Arkansas]: /^8\d{8}$/,
		[StateCodesUS.California]: /^\d{7}$|^\d{12}$/,
		[StateCodesUS.Colorado]: /^\d{11}$/,
		[StateCodesUS.Connecticut]: /^\d{7}$/,
		[StateCodesUS.Delaware]: /^\d{7}$/,
		[StateCodesUS.Florida]: /^\d{6}$|^\d{12}$/,
		[StateCodesUS.Georgia]: /^\d{8}$/,
		[StateCodesUS.Hawaii]: /^\d{5,8}(C1|C2|C3|C4|C5|D1|D2|D3|D4|F1|F2|L1|L2|N1|N2|P1|P2|T1|T2|T3|T4|T5|T6|T7|T8|ZZ)$/,
		[StateCodesUS.Idaho]: /^\d{6}$/,
		[StateCodesUS.Illinois]: /^\d{8}$/,
		[StateCodesUS.Indiana]: /^\d{10}$/,
		[StateCodesUS.Iowa]: /^\d{6,8}$/,
		[StateCodesUS.Kansas]: /^\d{7,9}$/,
		[StateCodesUS.Kentucky]: /^\d{9,10}$/,
		[StateCodesUS.Louisiana]: /^\d{9,10}$/,
		[StateCodesUS.Maine]: /^\d{8}$/,
		[StateCodesUS.Maryland]: /^\d{8}$/,
		[StateCodesUS.Massachusetts]: /^\d{10}$/,
		[StateCodesUS.Michigan]: /^\d{6}$|^\d{9}$/,
		[StateCodesUS.Minnesota]: /^\d{7}$/,
		[StateCodesUS.Mississippi]: /^\d{7,10}$/,
		[StateCodesUS.Missouri]: /^\d{10}$/,
		[StateCodesUS.Montana]: /^\d{7}$/,
		[StateCodesUS.Nebraska]: /^\d{9,11}$/,
		[StateCodesUS.Nevada]: /^\d{9,11}$/,
		[StateCodesUS.NewHampshire]: /^\d{9}$/,
		[StateCodesUS.NewJersey]: /^\d{10}$/,
		[StateCodesUS.NewMexico]: /^\d{6}$/,
		[StateCodesUS.NewYork]: /^\d{7}$/,
		[StateCodesUS.NorthCarolina]: /^\d{7}$/,
		[StateCodesUS.NorthDakota]: /^\d{7,10}$/,
		[StateCodesUS.Ohio]: /^\d{10}$/,
		[StateCodesUS.Oklahoma]: /^\d{10}$/,
		[StateCodesUS.Oregon]: /^\d{9}$/,
		[StateCodesUS.Pennsylvania]: /^\d{7}$/,
		[StateCodesUS.RhodeIsland]: /^\d{7}$/,
		[StateCodesUS.SouthCarolina]: /^\d{7}$/,
		[StateCodesUS.SouthDakota]: /^\d{7}$/,
		[StateCodesUS.Tennessee]: /^\d{6}$/,
		[StateCodesUS.Texas]: /^\d{10}$/,
		[StateCodesUS.Utah]: /^\d{7}$/,
		[StateCodesUS.Vermont]: /^\d{6}$/,
		[StateCodesUS.Virginia]: /^\d{7}$/,
		[StateCodesUS.Washington]: /^\d{9}$/,
		[StateCodesUS.WestVirginia]: /^\d{6}$/,
		[StateCodesUS.Wisconsin]: /^\d{6}$/,
		[StateCodesUS.Wyoming]: /^\d{6}$/,
		[StateCodesUS.DistrictOfColumbia]: /^\d{9}$/,
		[StateCodesUS.ArmedForcesAmericas]: /^\d{9}$/,
		[StateCodesUS.ArmedForcesEurope]: /^\d{9}$/,
		[StateCodesUS.ArmedForcesPacific]: /^\d{9}$/,
		default: /^\d{9}$/
	}
};
//#endregion
//#region src/components/Shared/fields/TaxInformationField/fieldConfig.ts
var taxInformationDefaultFieldMetadata = { label: "taxId" };
var exemptedFromTaxDefaultFieldMetadata = { label: "iDontHaveATaxId" };
/**
* Mapping function to parse TaxInformation schemas to validate the string for TaxInformation.number
*
* @param validators - String validators for the TaxInformation.number
* @param country - Country in the fieldConfig
*/
var mapValidators = (validators, country) => {
	return validators.map((validator) => ({
		...validator,
		validate: (taxInformation) => {
			const taxInfo = taxInformation?.find((taxId) => country === taxId.country);
			if (taxInfo?.numberAbsent) return true;
			return taxInfo?.number ? validator.validate(taxInfo.number) : false;
		}
	}));
};
var taxInformationDefaultFieldConfig = {
	[CountryCodes.Australia]: {
		label: "australianBusinessNumberAbn",
		validators: mapValidators([validatePatternOnBlur(/^\d{11}$/)], CountryCodes.Australia),
		mask: { mask: makeMask(...numericInputs(2), spacer, ...numericInputs(3), spacer, ...numericInputs(3), spacer, ...numericInputs(3)) },
		guidanceText: {
			key: "enterNDigitsForExample",
			values: {
				numDigits: "11",
				example: "51 824 753 556"
			}
		}
	},
	[CountryCodes.Austria]: {
		label: "taxInformationNumber__AT",
		validators: mapValidators([validatePatternOnBlur(/^(?=(?:[^0-9]*\d){9}[^0-9]*$)[\d\-/]+$/)], CountryCodes.Austria),
		mask: { mask: makeMask(...numericInputs(2), {
			type: "input",
			allow: /[-/]/,
			optional: true
		}, ...numericInputs(3), {
			type: "input",
			allow: /[-/]/,
			optional: true
		}, ...numericInputs(4)) },
		guidanceText: {
			key: "enterNDigitsForExample",
			values: {
				numDigits: "9",
				example: "931736581"
			}
		}
	},
	[CountryCodes.Belgium]: ({ taxIdNumberType }) => {
		switch (taxIdNumberType) {
			case "NUMERO_NATIONAL": return {
				label: "taxInformationNumber__BE_Individual",
				validators: mapValidators([validatePatternOnBlur(/^\d{11}$/)], CountryCodes.Belgium),
				mask: { mask: makeMask(...numericInputs(11)) },
				guidanceText: {
					key: "validationPleaseEnterAValidIdNumberWithExample",
					values: {
						example: "99999999999",
						idType: "Numeró National"
					}
				}
			};
			default: return {
				label: "taxInformationNumber__BE",
				validators: mapValidators([validatePatternOnBlur(/^\d{10}$/)], CountryCodes.Belgium),
				mask: { mask: makeMask(...numericInputs(10)) },
				guidanceText: {
					key: "validationPleaseEnterAValidIdNumberWithExample",
					values: {
						example: "0123321123",
						idType: "Business nummer"
					}
				}
			};
		}
	},
	[CountryCodes.Canada]: {
		label: "businessNumber",
		validators: mapValidators([validatePatternOnBlur(/^\d{9}$/)], CountryCodes.Canada),
		mask: { mask: makeMask(...numericInputs(9)) },
		guidanceText: {
			key: "enterNDigitsForExample",
			values: {
				numDigits: "9",
				example: "123456789"
			}
		}
	},
	[CountryCodes.Croatia]: {
		label: "taxInformationNumber__HR",
		validators: mapValidators([validatePatternOnBlur(/^\d{11}$/)], CountryCodes.Croatia),
		mask: { mask: makeMask(...numericInputs(11)) },
		guidanceText: {
			key: "validationPleaseEnterAValidIdNumberWithExample",
			values: {
				example: "94577403194",
				idType: "OIB"
			}
		}
	},
	[CountryCodes.Cyprus]: {
		label: "taxInformationNumber__CY",
		validators: mapValidators([validatePatternOnBlur(/^\d{8,9}[A-Z]$/)], CountryCodes.Cyprus),
		mask: {
			mask: makeMask(...numericInputs(8), ...numericInputs(1, true), ...alphaInputs(1)),
			transformOnType: uppercase
		},
		guidanceText: {
			key: "validationPleaseEnterAValidIdNumberWithExample",
			values: {
				example: "00123123T",
				idType: "TIC"
			}
		}
	},
	[CountryCodes.Estonia]: {
		label: "taxInformationNumber__ET_Individual",
		validators: mapValidators([validatePatternOnBlur(/^\d{11}$/)], CountryCodes.Estonia),
		mask: { mask: makeMask(...numericInputs(11)) },
		guidanceText: {
			key: "validationPleaseEnterAValidIdNumberWithExample",
			values: {
				example: "32708101201",
				idType: "Isikukood"
			}
		}
	},
	[CountryCodes.Finland]: {
		label: "taxInformationNumber__FI",
		validators: mapValidators([validatePatternOnBlur(/^\d{6}[+\-A]\d{3}[0-9A-Y]$/)], CountryCodes.Finland),
		mask: {
			mask: makeMask(...numericInputs(6), {
				type: "input",
				allow: /[+\-A]/
			}, ...numericInputs(3), {
				type: "input",
				allow: /[0-9A-Y]/
			}),
			transformOnType: uppercase
		},
		guidanceText: {
			key: "validationPleaseEnterAValidIdNumberWithExample",
			values: {
				example: "131052-308T",
				idType: "Henkilötunnus"
			}
		}
	},
	[CountryCodes.France]: {
		label: "taxInformationNumber__FR",
		validators: mapValidators([validatePatternOnBlur(/^\s*(\d\s*){13}$/)], CountryCodes.France),
		mask: { mask: makeMask(...numericInputs(2), spacer, ...numericInputs(2), spacer, ...numericInputs(3), spacer, ...numericInputs(3), spacer, ...numericInputs(3)) },
		guidanceText: {
			key: "validationPleaseEnterAValidIdNumberWithExample",
			values: {
				example: "30 23 217 600 053",
				idType: "Numéro SPI"
			}
		}
	},
	[CountryCodes.Germany]: ({ taxIdNumberType }) => {
		switch (taxIdNumberType) {
			case "IDNR": return {
				label: "taxInformationNumber__DE_Individual",
				validators: mapValidators([validatePatternOnBlur(/^\d{11}$/)], CountryCodes.Germany),
				mask: { mask: makeMask(...numericInputs(11)) },
				guidanceText: {
					key: "validationPleaseEnterAValidIdNumberWithExample",
					values: {
						example: "26954371827",
						idType: "IdNr"
					}
				}
			};
			default: return {
				label: "taxInformationNumber__DE",
				validators: mapValidators([validatePatternOnBlur(/^\d{10}$|^\d{11}$|^\d{13}$/)], CountryCodes.Germany),
				mask: { mask: makeMask(...numericInputs(10), ...numericInputs(3, true)) },
				guidanceText: {
					key: "validationPleaseEnterAValidIdNumberWithExample",
					values: {
						example: "14310260208",
						idType: "Steuernummer"
					}
				}
			};
		}
	},
	[CountryCodes.Gibraltar]: {
		label: "taxpayerReferenceNumber",
		validators: mapValidators([validatePatternOnBlur(/^\d{1,7}$/)], CountryCodes.Gibraltar),
		mask: { mask: makeMask(...numericInputs(1), ...numericInputs(6, true)) },
		guidanceText: {
			key: "enterAMaximumOfNDigitsForExample",
			values: {
				maxDigits: "7",
				example: "123456"
			}
		}
	},
	[CountryCodes.Greece]: {
		label: "taxInformationNumber__GR",
		validators: mapValidators([validatePatternOnBlur(/^\d{9}$/)], CountryCodes.Greece),
		mask: { mask: makeMask(...numericInputs(9)) },
		guidanceText: {
			key: "validationPleaseEnterAValidIdNumberWithExample",
			values: {
				example: "244709851",
				idType: "AFM"
			}
		}
	},
	[CountryCodes.Guernsey]: ({ taxIdNumberType }) => {
		switch (taxIdNumberType) {
			case "TIN_GG": return {
				label: "nationalInsuranceNumber",
				validators: mapValidators([validatePatternOnBlur(/^GY\d{6}[A-D]$/)], CountryCodes.Guernsey),
				mask: {
					mask: makeMask(...nonInputs("GY", { includeInValue: true }), spacer, ...numericInputs(2), spacer, ...numericInputs(2), spacer, ...numericInputs(2), spacer, {
						type: "input",
						allow: /[A-D]/
					}),
					transformOnType: uppercase
				},
				guidanceText: {
					key: "enterTheRemainingNCharactersForExample",
					values: {
						numChars: "7",
						example: "GY 12 34 56 A"
					}
				}
			};
			default: return {
				label: "taxInformationNumber",
				mask: businessRegistrationNumberMasks[CountryCodes.Guernsey].default,
				validators: mapValidators([validatePatternOnBlur(businessRegistrationNumberPatterns[CountryCodes.Guernsey].default)], CountryCodes.Guernsey),
				guidanceText: {
					key: "enterAMaximumOfNDigitsForExample",
					values: {
						maxDigits: "9",
						example: "123456"
					}
				}
			};
		}
	},
	[CountryCodes.HongKong]: {
		label: "taxInformationNumber__HK",
		validators: mapValidators([validatePatternOnBlur(/^\d{8}$/)], CountryCodes.HongKong),
		mask: { mask: makeMask(...numericInputs(8)) },
		guidanceText: {
			key: "enterNDigitsForExample",
			values: {
				numDigits: "8",
				example: "70569713"
			}
		}
	},
	[CountryCodes.Ireland]: ({ taxIdNumberType }) => {
		switch (taxIdNumberType) {
			case "PERSONAL_PUBLIC_SERVICE_NUMBER": return {
				label: "taxInformationNumber__IE_Individual",
				validators: mapValidators([validatePatternOnBlur(/^\d{7}[A-Z]$|^\d{7}[A-Z]{2}$/)], CountryCodes.Ireland),
				mask: {
					mask: makeMask(...numericInputs(7), ...alphaInputs(1), ...alphaInputs(1, true)),
					transformOnType: uppercase
				},
				guidanceText: {
					key: "validationPleaseEnterAValidIdNumberWithExample",
					values: {
						example: "1234567T",
						idType: "Personal Public Service Number"
					}
				}
			};
			default: return {
				label: "trnNumber",
				validators: mapValidators([validatePatternOnBlur(/^\d{7}[A-Z]$|^\d{7}[A-Z]{2}$/)], CountryCodes.Ireland),
				mask: {
					mask: makeMask(...numericInputs(7), ...alphaInputs(1), ...alphaInputs(1, true)),
					transformOnType: uppercase
				},
				guidanceText: {
					key: "enterXDigitsThenXToYLettersForExample",
					values: {
						numDigits: "7",
						minLetters: "1",
						maxLetters: "2",
						example: "1497955KA"
					}
				}
			};
		}
	},
	[CountryCodes.Italy]: {
		label: "codiceFiscale",
		mask: { mask: makeMask(...numericInputs(11)) },
		validators: mapValidators([validatePatternOnBlur(/^\d{11}$/)], CountryCodes.Italy),
		guidanceText: {
			key: "enterNDigitsForExample",
			values: {
				numDigits: "11",
				example: "12345678901"
			}
		}
	},
	[CountryCodes.IsleOfMan]: {
		label: "taxReferenceNumber",
		validators: mapValidators([validatePatternOnBlur(/^[HCX]\d{8}$/)], CountryCodes.IsleOfMan),
		mask: {
			mask: makeMask({
				type: "input",
				allow: /[HCX]/
			}, ...numericInputs(6), ...nonInputs(" - "), ...numericInputs(2)),
			transformOnType: uppercase
		},
		guidanceText: {
			key: "enterNCharactersForExample",
			values: {
				numChars: "9",
				example: "C155673-79"
			}
		}
	},
	[CountryCodes.Jersey]: ({ taxIdNumberType, companyType }) => {
		switch (taxIdNumberType) {
			case "SSN": return {
				label: "socialSecurityNumber",
				validators: mapValidators([validatePatternOnBlur(/^[A-Z]{2}\d{6}[A-Z]$/)], CountryCodes.Jersey),
				mask: {
					mask: makeMask(...alphaInputs(2), ...numericInputs(6), ...alphaInputs(1)),
					transformOnType: uppercase
				},
				guidanceText: {
					key: "enterNCharactersForExample",
					values: {
						numChars: "9",
						example: "JY000000A"
					}
				}
			};
			default: switch (companyType) {
				case CompanyTypesValues.SOLE_PROPRIETORSHIP: return {
					label: "taxIdentificationNumber",
					validators: mapValidators([validatePatternOnBlur(/^\d{10}$/)], CountryCodes.Jersey),
					mask: { mask: makeMask(...numericInputs(3), ...nonInputs(" - "), ...numericInputs(3), ...nonInputs(" - "), ...numericInputs(4)) },
					guidanceText: {
						key: "enterNDigitsForExample",
						values: {
							numDigits: "10",
							example: "100-100-1000"
						}
					}
				};
				default: return {
					label: "taxIdentificationNumber",
					validators: mapValidators([validatePatternOnBlur(/^[A-Z]{2}\d{5}$/)], CountryCodes.Jersey),
					mask: {
						mask: makeMask(...alphaInputs(2), ...numericInputs(5)),
						transformOnType: uppercase
					},
					guidanceText: {
						key: "enterNCharactersForExample",
						values: {
							numChars: "7",
							example: "CC17261"
						}
					}
				};
			}
		}
	},
	[CountryCodes.Latvia]: {
		label: "taxInformationNumber__LV",
		validators: mapValidators([validatePatternOnBlur(/^\d{11}$/)], CountryCodes.Latvia),
		mask: { mask: makeMask(...numericInputs(11)) },
		guidanceText: {
			key: "validationPleaseEnterAValidIdNumberWithExample",
			values: {
				example: "32532963606",
				idType: "Personas kods"
			}
		}
	},
	[CountryCodes.Lithuania]: {
		label: "taxInformationNumber__LT",
		validators: mapValidators([validatePatternOnBlur(/^\d{11}$/)], CountryCodes.Lithuania),
		mask: { mask: makeMask(...numericInputs(11)) },
		guidanceText: {
			key: "validationPleaseEnterAValidIdNumberWithExample",
			values: {
				example: "33309240064",
				idType: "Asmens kodas"
			}
		}
	},
	[CountryCodes.Luxembourg]: ({ companyType }) => {
		switch (companyType) {
			case LegalEntityTypes.INDIVIDUAL: return {
				label: "taxInformationNumber__LU_Individual",
				validators: mapValidators([validatePatternOnBlur(/^\d{13}$/)], CountryCodes.Luxembourg),
				mask: { mask: makeMask(...numericInputs(13)) },
				guidanceText: {
					key: "enterNCharactersForExample",
					values: {
						numChars: "13",
						example: "1893120105732"
					}
				}
			};
			default: return {
				label: "taxInformationNumber__LU_Org",
				validators: mapValidators([validatePatternOnBlur(/^\d{11}$/)], CountryCodes.Luxembourg),
				mask: { mask: makeMask(...numericInputs(11)) },
				guidanceText: {
					key: "enterNCharactersForExample",
					values: {
						numChars: "11",
						example: "19991201001"
					}
				}
			};
		}
	},
	[CountryCodes.Malta]: ({ taxIdNumberType }) => {
		switch (taxIdNumberType) {
			case "IDENTITY_CARD_NUMBER": return {
				label: "taxInformationNumber__MT_Individual",
				validators: mapValidators([validatePatternOnBlur(/^\d{7}[A-Z]$|^\d{9}$/)], CountryCodes.Malta),
				mask: {
					mask: makeMask(...numericInputs(7), ...alphanumericInputs(2)),
					transformOnType: uppercase
				},
				guidanceText: {
					key: "validationPleaseEnterAValidIdNumberWithExample",
					values: {
						example: "1234567A",
						idType: "Identity card number or unique taxpayer reference number (Maltese nationals)"
					}
				}
			};
			case "NRU": return {
				label: "taxInformationNumber__MT_NRU_Individual",
				validators: mapValidators([validatePatternOnBlur(/^\d{9}$/)], CountryCodes.Malta),
				mask: { mask: makeMask(...numericInputs(9)) },
				guidanceText: {
					key: "validationPleaseEnterAValidIdNumberWithExample",
					values: {
						example: "999999999",
						idType: "NRU (Non-Maltese nationals)"
					}
				}
			};
			default: return {
				label: "taxInformationNumber__MT_Org",
				validators: mapValidators([validatePatternOnBlur(/^\d{9}$/)], CountryCodes.Malta),
				mask: { mask: makeMask(...numericInputs(9)) },
				guidanceText: {
					key: "validationPleaseEnterAValidIdNumberWithExample",
					values: {
						example: "123456789",
						idType: "Income Tax Registration Number"
					}
				}
			};
		}
	},
	[CountryCodes.Netherlands]: ({ companyType }) => {
		switch (companyType) {
			case LegalEntityTypes.INDIVIDUAL: return {
				label: "bsnNumber",
				validators: mapValidators([validatePatternOnBlur(/^\d{9}$/)], CountryCodes.Netherlands),
				mask: { mask: makeMask(...numericInputs(9)) },
				guidanceText: {
					key: "validationPleaseEnterAValidIdNumberWithExample",
					values: {
						example: "999999999",
						idType: "BSN"
					}
				}
			};
			default: return {
				label: "rsinNumber",
				validators: mapValidators([validatePatternOnBlur(/^\d{9}$/)], CountryCodes.Netherlands),
				mask: { mask: makeMask(...numericInputs(9)) },
				guidanceText: {
					key: "validationPleaseEnterAValidIdNumberWithExample",
					values: {
						example: "811786523",
						idType: "RSIN"
					}
				}
			};
		}
	},
	[CountryCodes.NewZealand]: {
		label: "irdNumber",
		validators: mapValidators([validatePatternOnBlur(/^\d{8,9}$/)], CountryCodes.NewZealand),
		mask: { mask: makeMask(...numericInputs(8), ...numericInputs(1, true)) },
		guidanceText: {
			key: "enterXToYDigitsForExample",
			values: {
				minDigits: "8",
				maxDigits: "9",
				example: "12345678"
			}
		}
	},
	[CountryCodes.Portugal]: {
		label: "taxInformationNumber__PT",
		validators: mapValidators([validatePatternOnBlur(/^\d{9}$/)], CountryCodes.Portugal),
		mask: { mask: makeMask(...numericInputs(9)) },
		guidanceText: {
			key: "validationPleaseEnterAValidIdNumberWithExample",
			values: {
				example: "299999998",
				idType: "Numéro ID Civil"
			}
		}
	},
	[CountryCodes.PuertoRico]: {
		label: "taxInformationNumber__US",
		validators: mapValidators([validatePatternOnBlur(/^\d{9}$/)], CountryCodes.PuertoRico),
		mask: { mask: makeMask(...numericInputs(2), ...nonInputs(" - "), ...numericInputs(7)) },
		guidanceText: {
			key: "validationPleaseEnterAValidEINWithFormat",
			values: {
				format: "XX-XXXXXXX",
				example: "98-7654321"
			}
		}
	},
	[CountryCodes.Singapore]: {
		label: "gst",
		validators: mapValidators([validatePatternOnBlur(/^[A-Z0-9]{9,10}$/)], CountryCodes.Singapore),
		mask: {
			mask: makeMask(...alphanumericInputs(2), ...nonInputs(" - "), ...alphanumericInputs(7), ...nonInputs(" - "), ...alphanumericInputs(1)),
			transformOnType: uppercase
		},
		guidanceText: {
			key: "enterNCharactersForExample",
			values: {
				numChars: "10",
				example: "M212345678"
			}
		}
	},
	[CountryCodes.Slovakia]: ({ companyType }) => {
		switch (companyType) {
			case LegalEntityTypes.INDIVIDUAL: return {
				label: "taxInformationNumber__SK_Individual",
				validators: mapValidators([validatePatternOnBlur(/^\d{9}$|^\d{10}$|^\d{11}$|^\d{6}\/\d{3}$|^\d{6}\/\d{4}$/)], CountryCodes.Slovakia),
				mask: { mask: makeMask(...numericInputs(6), {
					type: "input",
					allow: /\//,
					optional: true
				}, ...numericInputs(4), ...numericInputs(1, true)) },
				guidanceText: {
					key: "validationPleaseEnterAValidIdNumberWithExample",
					values: {
						example: "7711167420",
						idType: "Rodne Cislo"
					}
				}
			};
			default: return {
				label: "taxInformationNumber__SK_Org",
				validators: mapValidators([validatePatternOnBlur(/^\d{10}$/)], CountryCodes.Slovakia),
				mask: { mask: makeMask(...numericInputs(10)) },
				guidanceText: {
					key: "validationPleaseEnterAValidIdNumberWithExample",
					values: {
						example: "2020123456",
						idType: "Daňové identifikačné číslo (DIČ)"
					}
				}
			};
		}
	},
	[CountryCodes.Slovenia]: ({ companyType }) => {
		switch (companyType) {
			case LegalEntityTypes.INDIVIDUAL: return {
				label: "taxInformationNumber__SI_Individual",
				validators: mapValidators([validatePatternOnBlur(/^\d{8}$/)], CountryCodes.Slovenia),
				mask: { mask: makeMask(...numericInputs(8)) },
				guidanceText: {
					key: "validationPleaseEnterAValidIdNumberWithExample",
					values: {
						example: "15012557",
						idType: "SI tax number"
					}
				}
			};
			default: return {
				label: "taxInformationNumber__SI_Org",
				validators: mapValidators([validatePatternOnBlur(/^\d{8}$/)], CountryCodes.Slovenia),
				mask: { mask: makeMask(...numericInputs(8)) },
				guidanceText: {
					key: "validationPleaseEnterAValidIdNumberWithExample",
					values: {
						example: "12345678",
						idType: "Davčna številka"
					}
				}
			};
		}
	},
	[CountryCodes.UnitedKingdom]: ({ taxIdNumberType, companyType }) => {
		switch (companyType) {
			case LegalEntityTypes.INDIVIDUAL: switch (taxIdNumberType) {
				case "NINO": return {
					label: "nationalInsuranceNumber",
					validators: mapValidators([validatePatternOnBlur(/^[A-Z]{2}\d{6}[A-D]$/)], CountryCodes.UnitedKingdom),
					guidanceText: {
						key: "validationPleaseEnterAValidIdNumberWithExample",
						values: {
							example: "AA123456C",
							idType: "NINO"
						}
					}
				};
				default: return {
					label: "utr",
					validators: mapValidators([validatePatternOnBlur(/^\d{10}$/)], CountryCodes.UnitedKingdom),
					mask: { mask: makeMask(...numericInputs(10)) },
					guidanceText: {
						key: "validationPleaseEnterAValidIdNumberWithExample",
						values: {
							example: "7172510005",
							idType: "UTR"
						}
					}
				};
			}
			default: return {
				label: "utr",
				validators: mapValidators([validatePatternOnBlur(/^\d{10}$/)], CountryCodes.UnitedKingdom),
				mask: { mask: makeMask(...numericInputs(10)) },
				guidanceText: {
					key: "validationPleaseEnterAValidIdNumberWithExample",
					values: {
						example: "7172510005",
						idType: "UTR"
					}
				}
			};
		}
	},
	[CountryCodes.UnitedStates]: {
		label: "taxInformationNumber__US",
		validators: mapValidators([validateNotEmptyOnBlur, validatePatternOnBlur(/^\d{9}$/)], CountryCodes.UnitedStates),
		mask: { mask: makeMask(...numericInputs(2), ...nonInputs(" - "), ...numericInputs(7)) },
		guidanceText: {
			key: "validationPleaseEnterAValidEINWithFormat",
			values: {
				format: "XX-XXXXXXX",
				example: "98-7654321"
			}
		}
	},
	/**
	* NOT YET SUPPORTED
	* These are brought over from the old pattern files. We have no idea if they are accurate or not.
	* See https://en.wikipedia.org/wiki/VAT_identification_number
	*/
	[CountryCodes.India]: { validators: mapValidators([validatePatternOnBlur(/^[A-Z0-9]{15}$/)], CountryCodes.India) },
	[CountryCodes.Japan]: {
		label: "taxInformationNumber__JP",
		validators: mapValidators([validatePatternOnBlur(/^\d{13}$/)], CountryCodes.Japan),
		guidanceText: {
			key: "enterNDigitsForExample",
			values: {
				numDigits: "13",
				example: "2169151989941"
			}
		}
	},
	[CountryCodes.Philippines]: { validators: mapValidators([validatePatternOnBlur(/^\d{12}$/)], CountryCodes.Philippines) }
};
var exemptedFromTaxDefaultFieldConfig = { [CountryCodes.Australia]: { label: "doNotHaveAbn" } };
var getTaxInformationPlaceholderText = ({ country, companyType, taxIdNumberType }) => {
	switch (country) {
		case CountryCodes.Austria: return "931736581";
		case CountryCodes.Belgium: switch (companyType) {
			case LegalEntityTypes.INDIVIDUAL: return "99999999999";
			default: return "0123321123";
		}
		case CountryCodes.Croatia: return "94577403194";
		case CountryCodes.Cyprus: return "00123123T";
		case CountryCodes.Estonia: return "32708101201";
		case CountryCodes.Ethiopia: return "32708101201";
		case CountryCodes.Finland: return "131052-308T";
		case CountryCodes.France: return "30 23 217 600 053";
		case CountryCodes.Germany: switch (companyType) {
			case LegalEntityTypes.INDIVIDUAL: return "26954371827";
			default: return "14310260208";
		}
		case CountryCodes.Gibraltar: return "123456";
		case CountryCodes.Greece: return "244709851";
		case CountryCodes.Ireland: switch (companyType) {
			case LegalEntityTypes.INDIVIDUAL: return "1234567T";
			default: return "1497955KA";
		}
		case CountryCodes.Italy: return "12345678901";
		case CountryCodes.IsleOfMan: return "C155673-79";
		case CountryCodes.Latvia: return "32532963606";
		case CountryCodes.Lithuania: return "33309240064";
		case CountryCodes.Luxembourg: switch (companyType) {
			case LegalEntityTypes.INDIVIDUAL: return "1893120105732";
			default: return "19991201001";
		}
		case CountryCodes.Malta: switch (companyType) {
			case LegalEntityTypes.INDIVIDUAL: switch (taxIdNumberType) {
				case "NRU": return "999999999";
				default: return "1234567A";
			}
			default: return "999999999";
		}
		case CountryCodes.Netherlands: switch (companyType) {
			case LegalEntityTypes.INDIVIDUAL: return "999999999";
			default: return "811786523";
		}
		case CountryCodes.Portugal: return "299999998";
		case CountryCodes.Slovakia: switch (companyType) {
			case LegalEntityTypes.INDIVIDUAL: return "7711167420";
			default: return "2020123456";
		}
		case CountryCodes.Slovenia: switch (companyType) {
			case LegalEntityTypes.INDIVIDUAL: return "15012557";
			default: return "12345678";
		}
		case CountryCodes.UnitedKingdom: return "7172510005";
		case CountryCodes.Spain: return "99999999L";
		case CountryCodes.PuertoRico:
		case CountryCodes.UnitedStates: return "11-0000000";
	}
};
//#endregion
//#region src/components/Shared/fields/TaxInformationField/taxIdNumberTypes.ts
var restrictedEntityTypes = [
	CompanyTypesValues.SOLE_PROPRIETORSHIP,
	LegalEntityTypes.TRUST,
	LegalEntityTypes.INDIVIDUAL
];
var isRestrictedEntityType = (entityType) => Boolean(entityType && restrictedEntityTypes.includes(entityType));
var isApplicableOnlyForSingleRestrictedType = (option) => {
	if (!option.applicableOnlyFor || option.applicableOnlyFor.length !== 1) return false;
	return restrictedEntityTypes.includes(option.applicableOnlyFor[0]);
};
var taxIdNumberOptions = {
	[CountryCodes.Australia]: [{
		id: "ABN",
		name: "australianBusinessNumberAbn"
	}],
	[CountryCodes.Austria]: [{
		id: "STEUERNUMMER",
		name: "taxInformationNumber__AT"
	}],
	[CountryCodes.Belgium]: [{
		id: "BUSINESS_NUMMER",
		name: "businessNumber",
		applicableOnlyFor: [
			CompanyTypesValues.SOLE_PROPRIETORSHIP,
			CompanyTypesValues.PRIVATE_COMPANY,
			CompanyTypesValues.GOVERNMENTAL_ORGANIZATION,
			CompanyTypesValues.INCORPORATED_ASSOCIATION,
			CompanyTypesValues.INCORPORATED_PARTNERSHIP,
			CompanyTypesValues.NON_PROFIT_OR_CHARITABLE,
			CompanyTypesValues.UNINCORPORATED_PARTNERSHIP,
			CompanyTypesValues.UNLISTED_PUBLIC_COMPANY
		]
	}, {
		id: "NUMERO_NATIONAL",
		name: "taxInformationNumber__BE_Individual",
		applicableOnlyFor: [LegalEntityTypes.INDIVIDUAL]
	}],
	[CountryCodes.Brazil]: [{
		id: "CNPJ",
		name: "CNPJ"
	}],
	[CountryCodes.Canada]: [{
		id: "BUSINESS_NUMBER",
		name: "businessNumber"
	}],
	[CountryCodes.Croatia]: [{
		id: "OIB",
		name: "taxInformationNumber__HR"
	}],
	[CountryCodes.Cyprus]: [{
		id: "TIC",
		name: "taxInformationNumber__CY"
	}],
	[CountryCodes.Estonia]: [{
		id: "ISIKUKOOD",
		name: "taxInformationNumber__ET_Individual",
		applicableOnlyFor: [LegalEntityTypes.INDIVIDUAL]
	}, {
		id: "registrikood",
		name: "registrikood",
		applicableOnlyFor: [CompanyTypesValues.PRIVATE_COMPANY]
	}],
	[CountryCodes.Finland]: [{
		id: "HENKILOTUNNUS",
		name: "taxInformationNumber__FI",
		applicableOnlyFor: [LegalEntityTypes.INDIVIDUAL]
	}, {
		id: "YTUNNUS",
		name: "YTunnus",
		applicableOnlyFor: [CompanyTypesValues.PRIVATE_COMPANY]
	}],
	[CountryCodes.France]: [{
		id: "SIRET",
		name: "siret",
		applicableOnlyFor: [CompanyTypesValues.PRIVATE_COMPANY]
	}],
	[CountryCodes.Germany]: [{
		id: "STEUERNUMMER",
		name: "taxInformationNumber__DE",
		applicableOnlyFor: [
			CompanyTypesValues.SOLE_PROPRIETORSHIP,
			CompanyTypesValues.PRIVATE_COMPANY,
			CompanyTypesValues.GOVERNMENTAL_ORGANIZATION,
			CompanyTypesValues.INCORPORATED_ASSOCIATION,
			CompanyTypesValues.INCORPORATED_PARTNERSHIP,
			CompanyTypesValues.NON_PROFIT_OR_CHARITABLE,
			CompanyTypesValues.UNINCORPORATED_PARTNERSHIP,
			CompanyTypesValues.UNLISTED_PUBLIC_COMPANY
		]
	}, {
		id: "IDNR",
		name: "taxInformationNumber__DE_Individual",
		applicableOnlyFor: [LegalEntityTypes.INDIVIDUAL]
	}],
	[CountryCodes.Gibraltar]: [{
		id: "GI_TAXPAYER_REFERENCE_NUMBER",
		name: "taxpayerReferenceNumber"
	}],
	[CountryCodes.Greece]: [{
		id: "AFM",
		name: "taxInformationNumber__GR"
	}],
	[CountryCodes.Guernsey]: [{
		id: "GG_REGISTRATION_NUMBER",
		name: "taxInformationNumber"
	}, {
		id: "TIN_GG",
		name: "nationalInsuranceNumber",
		applicableOnlyFor: [CompanyTypesValues.SOLE_PROPRIETORSHIP]
	}],
	[CountryCodes.HongKong]: [{
		id: "BRN",
		name: "taxInformationNumber__HK"
	}],
	[CountryCodes.Ireland]: [{
		id: "TRN",
		name: "trnNumber",
		applicableOnlyFor: [CompanyTypesValues.PRIVATE_COMPANY, CompanyTypesValues.UNINCORPORATED_PARTNERSHIP]
	}, {
		id: "PERSONAL_PUBLIC_SERVICE_NUMBER",
		name: "taxInformationNumber__IE_Individual",
		applicableOnlyFor: [LegalEntityTypes.INDIVIDUAL]
	}],
	[CountryCodes.IsleOfMan]: [{
		id: "IM_TAX_REFERENCE_NUMBER",
		name: "taxReferenceNumber"
	}],
	[CountryCodes.Italy]: [{
		id: "CODICE_FISCALE",
		name: "taxInformationNumber__IT"
	}],
	[CountryCodes.Japan]: [{
		id: "CORPORATE_NUMBER",
		name: "taxInformationNumber"
	}],
	[CountryCodes.Jersey]: [{
		id: "TIN_JE",
		name: "taxIdentificationNumber"
	}, {
		id: "SSN",
		name: "socialSecurityNumber",
		applicableOnlyFor: [CompanyTypesValues.SOLE_PROPRIETORSHIP]
	}],
	[CountryCodes.Latvia]: [{
		id: "PERSONAS_KODS",
		name: "taxInformationNumber__LV",
		applicableOnlyFor: [LegalEntityTypes.INDIVIDUAL]
	}, {
		id: "REGISTRACIJAS_NUMURS",
		name: "lvRegistrationNumber",
		applicableOnlyFor: [CompanyTypesValues.PRIVATE_COMPANY]
	}],
	[CountryCodes.Lithuania]: [{
		id: "ASMENS_KODAS",
		name: "taxInformationNumber__LT"
	}],
	[CountryCodes.Luxembourg]: [{
		id: "NATIONAL_IDENTIFICATION_NUMBER",
		name: "taxInformationNumber__LU_Individual",
		applicableOnlyFor: [LegalEntityTypes.INDIVIDUAL]
	}, {
		id: "NATIONAL_IDENTIFICATION_NUMBER",
		name: "taxInformationNumber__LU_Org",
		applicableOnlyFor: [CompanyTypesValues.PRIVATE_COMPANY]
	}],
	[CountryCodes.Malta]: [
		{
			id: "NRU",
			name: "taxInformationNumber__MT_NRU_Individual",
			applicableOnlyFor: [LegalEntityTypes.INDIVIDUAL]
		},
		{
			id: "IDENTITY_CARD_NUMBER",
			name: "taxInformationNumber__MT_Individual",
			applicableOnlyFor: [LegalEntityTypes.INDIVIDUAL]
		},
		{
			id: "INCOME_TAX_REGISTRATION_NUMBER",
			name: "taxInformationNumber__MT_Org",
			applicableOnlyFor: [CompanyTypesValues.PRIVATE_COMPANY]
		}
	],
	[CountryCodes.Netherlands]: [{
		id: "RSIN",
		name: "rsinNumber",
		applicableOnlyFor: [
			CompanyTypesValues.PRIVATE_COMPANY,
			CompanyTypesValues.GOVERNMENTAL_ORGANIZATION,
			CompanyTypesValues.INCORPORATED_ASSOCIATION,
			CompanyTypesValues.INCORPORATED_PARTNERSHIP,
			CompanyTypesValues.NON_PROFIT_OR_CHARITABLE,
			CompanyTypesValues.UNINCORPORATED_PARTNERSHIP,
			CompanyTypesValues.UNLISTED_PUBLIC_COMPANY
		]
	}, {
		id: "BSN",
		name: "bsnNumber",
		applicableOnlyFor: [LegalEntityTypes.INDIVIDUAL]
	}],
	[CountryCodes.NewZealand]: [{
		id: "IRD",
		name: "irdNumber"
	}],
	[CountryCodes.Portugal]: [{
		id: "NUMERO_ID_CIVIL",
		name: "taxInformationNumber__PT",
		applicableOnlyFor: [LegalEntityTypes.INDIVIDUAL]
	}, {
		id: "NIPC",
		name: "NIPC",
		applicableOnlyFor: [CompanyTypesValues.PRIVATE_COMPANY]
	}],
	[CountryCodes.PuertoRico]: [{
		id: "EIN",
		name: "ein"
	}],
	[CountryCodes.Singapore]: [{
		id: "GST",
		name: "gst"
	}, {
		id: "UEN",
		name: "uen"
	}],
	[CountryCodes.Slovakia]: [{
		id: "RODNE_CISLO",
		name: "taxInformationNumber__SK_Individual",
		applicableOnlyFor: [LegalEntityTypes.INDIVIDUAL]
	}, {
		id: "NATIONAL_IDENTIFICATION_NUMBER",
		name: "taxInformationNumber__SK_Org",
		applicableOnlyFor: [CompanyTypesValues.PRIVATE_COMPANY]
	}],
	[CountryCodes.Slovenia]: [{
		id: "SI_TAX_NUMBER",
		name: "taxInformationNumber__SI_Individual",
		applicableOnlyFor: [LegalEntityTypes.INDIVIDUAL]
	}, {
		id: "NATIONAL_IDENTIFICATION_NUMBER",
		name: "taxInformationNumber__SI_Org",
		applicableOnlyFor: [CompanyTypesValues.PRIVATE_COMPANY]
	}],
	[CountryCodes.Spain]: [
		{
			id: "dni",
			name: "dni",
			applicableOnlyFor: [LegalEntityTypes.INDIVIDUAL]
		},
		{
			id: "nie",
			name: "nie",
			applicableOnlyFor: [LegalEntityTypes.INDIVIDUAL]
		},
		{
			id: "NIF",
			name: "NIF",
			applicableOnlyFor: [CompanyTypesValues.PRIVATE_COMPANY]
		}
	],
	[CountryCodes.UnitedKingdom]: [{
		id: "UTR",
		name: "utr"
	}, {
		id: "NINO",
		name: "nationalInsuranceNumber",
		applicableOnlyFor: [LegalEntityTypes.INDIVIDUAL]
	}],
	[CountryCodes.UnitedStates]: [{
		id: "EIN",
		name: "ein"
	}]
};
var getTaxIdNumberOptions = (country, companyType, invertCompanyTypeFilter = false) => {
	const optionsForCountry = taxIdNumberOptions[country];
	if (!optionsForCountry) return optionsForCountry;
	if (invertCompanyTypeFilter) {
		if (isRestrictedEntityType(companyType)) return optionsForCountry.filter((option) => option.applicableOnlyFor?.includes(companyType) ?? true);
		return optionsForCountry.filter((option) => !isApplicableOnlyForSingleRestrictedType(option));
	}
	if (!companyType) return optionsForCountry;
	return optionsForCountry.filter((option) => option.applicableOnlyFor?.includes(companyType) ?? true);
};
function getValidCompanyTypesForTaxIdNumberType(country, taxIdNumberType) {
	if (!taxIdNumberType) return void 0;
	const taxIdOption = taxIdNumberOptions[country]?.find((option) => option.id === taxIdNumberType);
	if (!taxIdOption?.applicableOnlyFor) return void 0;
	const validCompanyTypes = taxIdOption.applicableOnlyFor.filter((type) => type !== LegalEntityTypes.INDIVIDUAL && type !== LegalEntityTypes.TRUST);
	return validCompanyTypes.length > 0 ? validCompanyTypes : void 0;
}
//#endregion
//#region src/components/Shared/fields/TaxInformationField/TaxIdNumberTypeSelector/inferTaxIdNumberType.ts
/**
* For existing data, we need to infer the tax ID number type from the existing data.
* Otherwise, the incorrect mask will be applied.
* We don't store this choice in the API.
* @param taxInformation the existing tax information
* @param country the country of the LE
* @param companyType the company type, e.g. `nonProfit`
*/
var inferTaxIdNumberType = (taxInformation, country, companyType, invertCompanyTypeFilter = false) => {
	if (!taxInformation) return void 0;
	const optionsForCountry = getTaxIdNumberOptions(country, companyType, invertCompanyTypeFilter);
	const metadataFn = taxInformationDefaultFieldConfig[country];
	if (!optionsForCountry || !metadataFn) return void 0;
	if (optionsForCountry.length === 1) return optionsForCountry[0].id;
	const allMetaData = optionsForCountry.reduce((acc, option) => {
		const meta = typeof metadataFn === "function" ? metadataFn({
			taxIdNumberType: option.id,
			companyType
		}) : metadataFn;
		if (meta.label && !acc[meta.label]) acc[meta.label] = meta;
		return acc;
	}, {});
	for (const option of optionsForCountry) {
		const fieldMetadata = allMetaData[option.name];
		if (!fieldMetadata?.validators) continue;
		if ((Array.isArray(fieldMetadata.validators) ? fieldMetadata.validators : [fieldMetadata.validators]).every((validator) => validator.validate(taxInformation))) return option.id;
	}
};
//#endregion
//#region src/components/Shared/fields/TaxInformationField/TaxIdNumberTypeSelector/getDefaultTaxIdNumberType.ts
/**
* Finds tax information for a specific country from an array of tax information objects.
*
* @param taxInformation - Array of tax information objects to search through
* @param country - Country code to find tax information for
* @returns The first matching tax information object or undefined if none found
*/
function findExistingTaxInformation(taxInformation, country) {
	return taxInformation?.find((taxId) => taxId.country === country);
}
/**
* Determines the default tax ID number type based on existing information and entity type.
* This function follows a priority order:
* 1. Use the type from existing tax information if available
* 2. If there's a tax number but no type, infer the type from the number
* 3. Otherwise, use the first available tax ID option for the country and entity type
*
* @param taxInformation - Array of tax information objects
* @param country - Country code to determine the tax ID type for
* @param entityType - Type of entity (company type or individual)
* @returns The determined tax ID number type or undefined if none can be determined
*/
function getDefaultTaxIdNumberType(taxInformation, country, entityType, invertCompanyTypeFilter) {
	const existingTaxInformation = findExistingTaxInformation(taxInformation, country);
	return existingTaxInformation?.type ?? (existingTaxInformation?.number ? inferTaxIdNumberType(taxInformation, country, entityType, invertCompanyTypeFilter) : getTaxIdNumberOptions(country, entityType, invertCompanyTypeFilter)?.[0]?.id);
}
//#endregion
//#region src/components/Business/utils/requestingCapabilities.ts
var ISSUING_CAPABILITY_GROUP = [
	"issueCard",
	"issueCardConsumer",
	"issueCardCommercial",
	"useCard",
	"useCardConsumer",
	"useCardCommercial"
];
function requestingIssuing(rootLegalEntity) {
	const capabilities = rootLegalEntity?.capabilities ?? {};
	return ISSUING_CAPABILITY_GROUP.some((capability) => capability in capabilities && capabilities[capability]?.requested === true);
}
var BANKING_CAPABILITY_GROUP = [
	"issueBankAccount",
	"sendToThirdParty",
	"receiveFromThirdParty"
];
function requestingBanking(rootLegalEntity) {
	const capabilities = rootLegalEntity?.capabilities ?? {};
	return BANKING_CAPABILITY_GROUP.some((capability) => capability in capabilities && capabilities[capability]?.requested === true);
}
//#endregion
//#region src/components/Business/utils/utils.ts
var countryToTaxInfoTypeMap = {
	US: "EIN",
	AU: "ABN",
	NZ: "IRD",
	HK: "BRN",
	SG: "GST"
};
var isFinancialInformationRequired = (isFinancialInformationFeatureEnabled, taskType, country, capabilities, legalEntityType) => {
	const isOrganization = legalEntityType === LegalEntityTypes.ORGANIZATION;
	if (!isFinancialInformationFeatureEnabled || !COUNTRIES_REQUIRING_FINANCIAL_INFORMATION.includes(country)) return;
	if (country === CountryCodes.UnitedKingdom && (taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY || taskType === TaskTypes.BUSINESS_DETAILS)) return "REQUIRED";
	if (taskType === TaskTypes.BUSINESS_DETAILS && isOrganization) {
		if (keysOf(capabilities ?? {}).some((capability) => capability === "issueBankAccount")) return "REQUIRED";
	}
};
var getCountryOfGoverningLaw = (isCountryOfGoverningLawEnabled, basicData) => {
	if (!isCountryOfGoverningLawEnabled || basicData?.country !== CountryCodes.UnitedKingdom) return;
	return !basicData.countryOfGoverningLaw ? CountryCodes.UnitedKingdom : basicData.countryOfGoverningLaw;
};
//#endregion
//#region src/components/Business/forms/rules.ts
var COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION = [
	CountryCodes.Australia,
	CountryCodes.Gibraltar,
	CountryCodes.Guernsey,
	CountryCodes.HongKong,
	CountryCodes.Ireland,
	CountryCodes.IsleOfMan,
	CountryCodes.Jersey,
	CountryCodes.Malta,
	CountryCodes.PuertoRico,
	CountryCodes.Spain,
	CountryCodes.UnitedKingdom,
	CountryCodes.UnitedStates
];
var COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION = [
	CountryCodes.HongKong,
	CountryCodes.PuertoRico,
	CountryCodes.UnitedStates
];
var COUNTRIES_WITH_POSSIBLE_REGISTRATION_EXEMPTIONS_FOR_ORGANIZATIONS = [CountryCodes.HongKong];
var COUNTRIES_WITH_POSSIBLE_REGISTRATION_EXEMPTIONS_FOR_SOLE_PROPS = [
	CountryCodes.Austria,
	CountryCodes.Canada,
	CountryCodes.Finland,
	CountryCodes.Germany,
	CountryCodes.Lithuania,
	CountryCodes.Luxembourg,
	CountryCodes.NewZealand,
	CountryCodes.Poland,
	CountryCodes.Sweden,
	CountryCodes.Switzerland
];
var COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER = [CountryCodes.Canada, CountryCodes.UnitedStates];
var COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER_SOLE_PROPS = [CountryCodes.Germany];
/**
*  Also used to determine what documenttype needs to be used
*  when uploading tax document in mapping.ts
* */
var COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT = [
	CountryCodes.Australia,
	CountryCodes.Canada,
	CountryCodes.Gibraltar,
	CountryCodes.HongKong,
	CountryCodes.NewZealand,
	CountryCodes.PuertoRico,
	CountryCodes.Singapore,
	CountryCodes.UnitedStates,
	CountryCodes.Guernsey,
	CountryCodes.Jersey,
	CountryCodes.IsleOfMan,
	CountryCodes.Mexico,
	CountryCodes.Brazil,
	CountryCodes.Japan
];
var COUNTRIES_THAT_DO_NOT_USE_TAX_ID_FOR_SOLE_PROP = [CountryCodes.Singapore];
var COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_COMPANIES = [];
var COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_SOLE_PROPS = [
	CountryCodes.Canada,
	CountryCodes.PuertoRico,
	CountryCodes.UnitedStates
];
var COUNTRIES_THAT_REQUIRE_DATE_OF_INCORPORATION = [CountryCodes.HongKong, CountryCodes.Singapore];
var COUNTRIES_THAT_USES_UEN_OR_GST = [CountryCodes.Singapore];
/**
* @description Countries in this list use the provider-backed company search flow.
* For these countries, business details can be prefilled from provider results,
* and search/verification may require tax identifiers (for example TIN or VAT)
* in addition to company name/registration details.
*
* If a country is in this list, it means it will attempt to make an api call for company search.
* If the api doesnt have a provider for that country, it will return no results like below
* ```
* {
*   "results": [],
*   "provider": "NO_PROVIDER"
* }
* ```
*/
var COUNTRIES_USING_COMPANY_SEARCH = [CountryCodes.UnitedStates, CountryCodes.UnitedKingdom];
var COUNTRY_OF_GOVERNING_LAW_POSSIBLE = [CountryCodes.UnitedKingdom];
var COUNTRIES_REQUIRING_FINANCIAL_INFORMATION = [
	CountryCodes.Austria,
	CountryCodes.Belgium,
	CountryCodes.Croatia,
	CountryCodes.Cyprus,
	CountryCodes.Estonia,
	CountryCodes.Finland,
	CountryCodes.France,
	CountryCodes.Germany,
	CountryCodes.Greece,
	CountryCodes.Ireland,
	CountryCodes.Italy,
	CountryCodes.Latvia,
	CountryCodes.Lithuania,
	CountryCodes.Luxembourg,
	CountryCodes.Malta,
	CountryCodes.Netherlands,
	CountryCodes.Portugal,
	CountryCodes.Slovakia,
	CountryCodes.Slovenia,
	CountryCodes.Spain,
	CountryCodes.UnitedKingdom
];
var COUNTRIES_REQUIRING_E_INVOICING_CODE = [CountryCodes.Italy];
var COUNTRIES_WITH_POSSIBLE_TRUSTEE_TAXID_ABSENT_V4 = [CountryCodes.Australia];
var TAX_ID_REQUIRED_COUNTRIES_ORGANIZATION = [
	CountryCodes.Austria,
	CountryCodes.Belgium,
	CountryCodes.Croatia,
	CountryCodes.Cyprus,
	CountryCodes.Germany,
	CountryCodes.Greece,
	CountryCodes.Ireland,
	CountryCodes.Luxembourg,
	CountryCodes.Malta,
	CountryCodes.Netherlands,
	CountryCodes.Slovakia,
	CountryCodes.Slovenia,
	CountryCodes.UnitedKingdom
];
function isUsingCompanySearch(country, taskType) {
	if (taskType !== TaskTypes.BUSINESS_DETAILS) return false;
	return COUNTRIES_USING_COMPANY_SEARCH.includes(country);
}
var isRegistrationNumberAbsentStateV4Scenario = (country, entityType) => {
	return country === CountryCodes.Australia && (entityType === CompanyTypesValues.GOVERNMENTAL_ORGANIZATION || entityType === CompanyTypesValues.INCORPORATED_PARTNERSHIP) || country === CountryCodes.NewZealand;
};
var rules = ({ data, defaultData, country, taskType, isFeatureEnabled = () => false, isSettingEnabled = () => false, accountHolder, rootLegalEntity, tinMatched }) => {
	const countryRequiresDateOfIncorporationForCompanies = () => {
		if (COUNTRIES_THAT_REQUIRE_DATE_OF_INCORPORATION.includes(country)) return "REQUIRED";
	};
	const countryRequiresFinancialInformation = () => {
		if (isFeatureEnabled("EnableFinancialInformationComponentV4") && COUNTRIES_REQUIRING_FINANCIAL_INFORMATION.includes(country)) {
			const isFinancialInformationFeatureEnabled = isFeatureEnabled("EnableFinancialInformationComponentV4");
			const leType = rootLegalEntity?.type;
			return isFinancialInformationRequired(isFinancialInformationFeatureEnabled, taskType, country, rootLegalEntity?.capabilities, leType);
		}
	};
	return createFormRules({
		requireDoingBusinessAsName: () => {
			return data.additionalInformation?.hasDoingBusinessAs ? "REQUIRED" : void 0;
		},
		countryRequiresStateOrProvince: () => {
			if (COUNTRIES_WITH_STATES_DATASET.includes(country)) return "REQUIRED";
		},
		ifPubliclyTradedCompany: () => {
			if (data.companyStructure?.entityType === CompanyTypesValues.PUBLIC_COMPANY) return "REQUIRED";
		},
		countryUsesVat: () => {
			if (!COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT.includes(country)) return data.additionalInformation?.exemptedFromVat ? "OPTIONAL" : "REQUIRED";
		},
		vatNumberType: () => {
			if (!COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT.includes(country)) return "OPTIONAL";
		},
		isVatExempt: () => {
			if (!COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT.includes(country)) return data.additionalInformation?.exemptedFromVat ? "REQUIRED" : "OPTIONAL";
		},
		countryUsesTaxId: () => {
			const isExemptFromTax = Boolean(data.basicInformation?.exemptedFromTax ?? data.additionalInformation?.exemptedFromTax);
			const isOrgWithBanking = rootLegalEntity?.type === "organization" && keysOf(rootLegalEntity.capabilities ?? {}).includes("issueBankAccount");
			const registrationNumberType = isFeatureEnabled("EnableUnifiedCompanySearch") ? data.basicInformation?.registrationNumberType : data.additionalInformation?.registrationNumberType;
			if (TAX_ID_REQUIRED_COUNTRIES_ORGANIZATION.includes(country) && isOrgWithBanking) return isExemptFromTax ? "OPTIONAL" : "REQUIRED";
			if (country === CountryCodes.Italy && isOrgWithBanking && registrationNumberType === "CCIAA") return isExemptFromTax ? "OPTIONAL" : "REQUIRED";
			if (COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT.includes(country) && !(taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY && COUNTRIES_THAT_DO_NOT_USE_TAX_ID_FOR_SOLE_PROP.includes(country))) return isExemptFromTax ? "OPTIONAL" : "REQUIRED";
		},
		companyRegistrationNumberExemptionAllowed: () => {
			const isExemptFromRegistrationNumber = Boolean(data.basicInformation?.exemptedFromRegistrationNumber ?? data.additionalInformation?.exemptedFromRegistrationNumber);
			if (isFeatureEnabled("EnableRegistrationAndTaxAbsentStatesV4") && isRegistrationNumberAbsentStateV4Scenario(country, data.companyStructure?.entityType)) return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
			switch (taskType) {
				case TaskTypes.SOLE_PROPRIETOR_COMPANY:
					if (!COUNTRIES_WITH_POSSIBLE_REGISTRATION_EXEMPTIONS_FOR_SOLE_PROPS.includes(country)) return;
					return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
				default: switch (country) {
					case CountryCodes.Germany:
						if (data.companyStructure?.entityType === CompanyTypesValues.GOVERNMENTAL_ORGANIZATION || data.companyStructure?.entityType === CompanyTypesValues.NON_PROFIT_OR_CHARITABLE) return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
						return;
					case CountryCodes.Denmark:
						if (data.companyStructure?.entityType === CompanyTypesValues.NON_PROFIT_OR_CHARITABLE) return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
						return;
					case CountryCodes.HongKong:
						if (country === CountryCodes.HongKong && !defaultData?.additionalInformation?.registrationNumber) return;
						return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
					default:
						if (!COUNTRIES_WITH_POSSIBLE_REGISTRATION_EXEMPTIONS_FOR_ORGANIZATIONS.includes(country)) return;
						return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
				}
			}
		},
		countryOfGoverningLawRequired: () => {
			if (isFeatureEnabled("EnableCountryOfGoverningLawForUKCompanies") && COUNTRY_OF_GOVERNING_LAW_POSSIBLE.includes(data.basicInformation?.country)) return "REQUIRED";
		},
		countryRequiresRegistrationNumber: () => {
			const isExemptFromRegistrationNumber = Boolean(data.basicInformation?.exemptedFromRegistrationNumber ?? data.additionalInformation?.exemptedFromRegistrationNumber);
			switch (taskType) {
				case TaskTypes.SOLE_PROPRIETOR_COMPANY:
					if (COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION.includes(country)) return;
					if (COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER_SOLE_PROPS.includes(country)) return "OPTIONAL";
					return isExemptFromRegistrationNumber ? "OPTIONAL" : "REQUIRED";
				default:
					if (COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER.includes(country)) return "OPTIONAL";
					if (country === CountryCodes.HongKong) {
						if (!defaultData?.additionalInformation?.registrationNumber) return;
						return isExemptFromRegistrationNumber ? "OPTIONAL" : "REQUIRED";
					}
					if (!COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION.includes(country)) return isExemptFromRegistrationNumber ? "OPTIONAL" : "REQUIRED";
			}
		},
		registrationNumberType: () => {
			switch (taskType) {
				case TaskTypes.SOLE_PROPRIETOR_COMPANY:
					if (COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION.includes(country)) return;
					return "OPTIONAL";
				default:
					if (COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER.includes(country)) return "OPTIONAL";
					if (COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION.includes(country)) return;
					return "OPTIONAL";
			}
		},
		countryUsesUenOrGst: () => {
			if (taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY) return;
			if (COUNTRIES_THAT_USES_UEN_OR_GST.includes(country)) return "REQUIRED";
		},
		countryHasTaxExemptions: () => {
			const isExemptFromTax = Boolean(data.basicInformation?.exemptedFromTax ?? data.additionalInformation?.exemptedFromTax);
			switch (taskType) {
				case TaskTypes.SOLE_PROPRIETOR_COMPANY:
					if (!COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_SOLE_PROPS.includes(country)) return;
					return isExemptFromTax ? "REQUIRED" : "OPTIONAL";
				default:
					if (isFeatureEnabled("EnableRegistrationAndTaxAbsentStatesV4") && COUNTRIES_WITH_POSSIBLE_TRUSTEE_TAXID_ABSENT_V4.includes(country) && accountHolder === "aTrust") return isExemptFromTax ? "REQUIRED" : "OPTIONAL";
					if (COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_COMPANIES.includes(country)) return isExemptFromTax ? "REQUIRED" : "OPTIONAL";
			}
		},
		usingCompanySearch: () => {
			if (isUsingCompanySearch(country, taskType)) return "REQUIRED";
		},
		requireStateOrProvinceForCompanySearch: () => {
			if (isUsingCompanySearch(country, taskType) && COUNTRIES_WITH_STATES_DATASET.includes(country)) return "REQUIRED";
		},
		countryRequiresFinancialInformation,
		isDateOfIncorporationRequired: () => {
			return countryRequiresDateOfIncorporationForCompanies() || countryRequiresFinancialInformation();
		},
		isFinancialReportingFieldsRequired: () => {
			return countryRequiresFinancialInformation() === "REQUIRED" && isDateOlderThanAYear(data.additionalInformation?.dateOfIncorporation) ? "REQUIRED" : void 0;
		},
		isIndustryCodeRequired: () => {
			const needsBusinessLine = requestingIssuing(rootLegalEntity) || requestingBanking(rootLegalEntity);
			if (isSettingEnabled(SettingNames.AllowBusinessLines) && needsBusinessLine) return "REQUIRED";
		},
		annualTurnoverRequired: () => {
			if (data.companyFinancialInformation?.reportedValueOption === "annualTurnover") return "REQUIRED";
		},
		balanceSheetTotalRequired: () => {
			if (data.companyFinancialInformation?.reportedValueOption === "balanceSheetTotal") return "REQUIRED";
		},
		isEInvoicingCodeEnabled: () => {
			if (isFeatureEnabled("EnableEInvoicingCodeField") && COUNTRIES_REQUIRING_E_INVOICING_CODE.includes(country)) return "REQUIRED";
		},
		ifCountryUsAndTinFailed: () => {
			if (taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY) return;
			if (tinMatched === false && country === CountryCodes.UnitedStates) return "REQUIRED";
		},
		businessRequiresCompanyType: () => {
			if (taskType !== TaskTypes.SOLE_PROPRIETOR_COMPANY) return "REQUIRED";
		},
		japaneseLegalCompanyName: () => {
			if (isJapanLocalizationEnabled(isFeatureEnabled, country)) return "REQUIRED";
		}
	});
};
//#endregion
//#region src/components/Shared/fields/TaxInformationField/TaxIdNumberTypeSelector/TaxIdNumberTypeSelector.tsx
function TaxIdNumberTypeSelector({ country, companyType, invertCompanyTypeFilter, selected, setSelected, exemptedOptionLabel, isUsSoleProp, errorMessage }) {
	const { t } = useTranslation("common");
	const handleSelect = useCallback((selectedStr) => {
		const newSelected = selectedStr;
		if (newSelected === "exempted") {
			if (exemptedOptionLabel) setSelected(newSelected);
			return;
		}
		setSelected(newSelected);
	}, [exemptedOptionLabel, setSelected]);
	const options = useMemo(() => {
		const availableOptions = getTaxIdNumberOptions(country, companyType, invertCompanyTypeFilter) ?? [];
		if (availableOptions.length === 0 || !exemptedOptionLabel) return availableOptions;
		return [...availableOptions, {
			id: "exempted",
			name: exemptedOptionLabel
		}];
	}, [
		country,
		companyType,
		exemptedOptionLabel,
		invertCompanyTypeFilter
	]);
	useEffect(() => {
		if (!isUsSoleProp && !selected && options.length > 0) handleSelect(options[0].id);
	}, [
		options,
		selected,
		handleSelect,
		isUsSoleProp
	]);
	if (options.length <= 1) return null;
	return /* @__PURE__ */ jsx(Field, {
		el: "fieldset",
		name: "taxIdNumberType",
		label: t(($) => $["whichTaxpayerIdentificationNumberDoYouUse"]),
		errorMessage,
		children: (childProps) => /* @__PURE__ */ jsx(RadioGroup, {
			...childProps,
			name: "taxIdNumberType",
			items: options,
			value: selected,
			onChange: handleSelect
		})
	});
}
//#endregion
//#region src/components/Shared/fields/TaxInformationField/utils.ts
/**
* Immutably upserts a TaxInformation entry for a given country within the tax information array.
* - If the array doesn't exist, creates a new one with the entry.
* - If the country already has an entry, replaces it in-place.
* - If the country has no entry yet, appends the new entry.
*/
function upsertTaxInfoForCountry(taxInformation, country, newEntry) {
	if (!taxInformation) return [newEntry];
	return (taxInformation.some((t) => t.country === country) ? taxInformation : [...taxInformation, newEntry]).map((t) => t.country === country ? newEntry : t);
}
/**
* Removes all TaxInformation entries for the given country from the array.
*/
function removeTaxInfoForCountry(taxInformation, country) {
	return taxInformation?.filter((t) => t.country !== country);
}
//#endregion
export { businessRegistrationNumberPatterns as C, taxInformationDefaultFieldMetadata as S, stateFormatGuidanceText as T, taxIdNumberOptions as _, COUNTRIES_WITH_POSSIBLE_TRUSTEE_TAXID_ABSENT_V4 as a, getTaxInformationPlaceholderText as b, isUsingCompanySearch as c, getCountryOfGoverningLaw as d, requestingBanking as f, getValidCompanyTypesForTaxIdNumberType as g, getTaxIdNumberOptions as h, COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT as i, rules as l, getDefaultTaxIdNumberType as m, upsertTaxInfoForCountry as n, COUNTRY_OF_GOVERNING_LAW_POSSIBLE as o, requestingIssuing as p, TaxIdNumberTypeSelector as r, isRegistrationNumberAbsentStateV4Scenario as s, removeTaxInfoForCountry as t, countryToTaxInfoTypeMap as u, exemptedFromTaxDefaultFieldConfig as v, businessRegistrationNumberMasks as w, taxInformationDefaultFieldConfig as x, exemptedFromTaxDefaultFieldMetadata as y };
