//#region ../../node_modules/.pnpm/luxon@3.5.0/node_modules/luxon/src/impl/digits.js
const numberingSystems = {
	arab: "[٠-٩]",
	arabext: "[۰-۹]",
	bali: "[᭐-᭙]",
	beng: "[০-৯]",
	deva: "[०-९]",
	fullwide: "[０-９]",
	gujr: "[૦-૯]",
	hanidec: "[〇|一|二|三|四|五|六|七|八|九]",
	khmr: "[០-៩]",
	knda: "[೦-೯]",
	laoo: "[໐-໙]",
	limb: "[᥆-᥏]",
	mlym: "[൦-൯]",
	mong: "[᠐-᠙]",
	mymr: "[၀-၉]",
	orya: "[୦-୯]",
	tamldec: "[௦-௯]",
	telu: "[౦-౯]",
	thai: "[๐-๙]",
	tibt: "[༠-༩]",
	latn: "\\d"
};
const numberingSystemsUTF16 = {
	arab: [1632, 1641],
	arabext: [1776, 1785],
	bali: [6992, 7001],
	beng: [2534, 2543],
	deva: [2406, 2415],
	fullwide: [65296, 65303],
	gujr: [2790, 2799],
	khmr: [6112, 6121],
	knda: [3302, 3311],
	laoo: [3792, 3801],
	limb: [6470, 6479],
	mlym: [3430, 3439],
	mong: [6160, 6169],
	mymr: [4160, 4169],
	orya: [2918, 2927],
	tamldec: [3046, 3055],
	telu: [3174, 3183],
	thai: [3664, 3673],
	tibt: [3872, 3881]
};
const hanidecChars = numberingSystems.hanidec.replace(/[\[|\]]/g, "").split("");
function parseDigits(str) {
	let value = parseInt(str, 10);
	if (isNaN(value)) {
		value = "";
		for (let i = 0; i < str.length; i++) {
			const code = str.charCodeAt(i);
			if (str[i].search(numberingSystems.hanidec) !== -1) value += hanidecChars.indexOf(str[i]);
			else for (const key in numberingSystemsUTF16) {
				const [min, max] = numberingSystemsUTF16[key];
				if (code >= min && code <= max) value += code - min;
			}
		}
		return parseInt(value, 10);
	} else return value;
}
let digitRegexCache = {};
function resetDigitRegexCache() {
	digitRegexCache = {};
}
function digitRegex({ numberingSystem }, append = "") {
	const ns = numberingSystem || "latn";
	if (!digitRegexCache[ns]) digitRegexCache[ns] = {};
	if (!digitRegexCache[ns][append]) digitRegexCache[ns][append] = /* @__PURE__ */ new RegExp(`${numberingSystems[ns]}${append}`);
	return digitRegexCache[ns][append];
}

//#endregion
export { digitRegex, parseDigits, resetDigitRegexCache };
//# sourceMappingURL=digits.mjs.map